Add Linux/x86_64 core support to i[3-7]86-*-linux
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
c1a8d56e
CC
12012-10-29 Cary Coutant <ccoutant@google.com>
2
3 * dwp.cc (usage): Add file and exit status parameters;
4 add --help and --version options.
5 (print_version): New function.
6 (main): Add --help and --version options.
7
b2490a7b
L
82012-10-25 H.J. Lu <hongjiu.lu@intel.com>
9
10 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
11 final_layout_sequence.txt.
12 * testsuite/Makefile.in: Regenerated.
13
aa543512
L
142012-10-25 H.J. Lu <hongjiu.lu@intel.com>
15
16 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
17 COMPILE generated by automake.
18 (LINK1): Likewise.
19 (CXXCOMPILE1): Likewise.
20 (CXXLINK1): Likewise.
21 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
22 (LINK): Likewise.
23 (CXXCOMPILE): Likewise.
24 (CXXLINK): Likewise.
25 * testsuite/Makefile.in: Regenerated.
26
d361fafb
L
272012-10-25 H.J. Lu <hongjiu.lu@intel.com>
28
29 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
30 on bad fwrite return.
31
598c7410
L
322012-10-25 H.J. Lu <hongjiu.lu@intel.com>
33
34 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
35 on val.
36
35c813e2
CC
372012-10-23 Cary Coutant <ccoutant@google.com>
38
39 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
40 * testsuite/Makefile.in: Regenerate.
41 * testsuite/dwp_test.h: New source file.
42 * testsuite/dwp_test_1.cc: New source file.
43 * testsuite/dwp_test_1.s: New source file.
44 * testsuite/dwp_test_1.sh: New source file.
45 * testsuite/dwp_test_1b.cc: New source file.
46 * testsuite/dwp_test_1b.s: New source file.
47 * testsuite/dwp_test_2.cc: New source file.
48 * testsuite/dwp_test_2.s: New source file.
49 * testsuite/dwp_test_2.sh: New source file.
50 * testsuite/dwp_test_main.cc: New source file.
51 * testsuite/dwp_test_main.s: New source file.
52
77429909
CC
532012-10-23 Cary Coutant <ccoutant@google.com>
54
55 * dwp.h: New header file.
56 * dwp.cc: New source file.
57 * gold.h: Move shared declarations to system.h.
58 * system.h: New header file.
59 * Makefile.am: Add dwp.
60 * Makefile.in: Regenerate.
61
ed5d6712
CC
622012-10-23 Cary Coutant <ccoutant@google.com>
63
64 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
65 Dwarf_info_reader::read_from_pointer.
66 (Dwarf_pubnames_table::read_header): Likewise.
67 (Dwarf_pubnames_table::next_name): Likewise.
68 (Dwarf_die::read_attributes): Likewise.
69 (Dwarf_die::skip_attributes): Likewise.
70 (Dwarf_info_reader::read_from_pointer): New function template.
71 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
72 (Dwarf_pubnames_table): Likewise.
73 (Dwarf_info_reader::read_from_pointer): New function template.
74 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
75 Dwarf_pubnames_table ctor.
76
8787852d
CC
772012-10-23 Cary Coutant <ccoutant@google.com>
78
79 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
80 abbrev_shndx.
81 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
82 abbrev_shndx_.
83 (Dwarf_info_reader::set_abbrev_shndx): New method.
84 (Dwarf_info_reader::abbrev_shndx_): New data member.
85
9fc236f3
CC
862012-10-23 Cary Coutant <ccoutant@google.com>
87
88 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
89 from object, not parameters.
90 (Dwarf_info_reader::parse): Likewise.
91 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
92 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
93 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
94 methods.
95
effe8365
CC
962012-10-23 Cary Coutant <ccoutant@google.com>
97
98 * fileread.cc (Input_file::Input_file): New constructor.
99 * fileread.h (class Input_file): Add new constructor.
100
1698990d
AM
1012012-10-18 Alan Modra <amodra@gmail.com>
102
103 PR gold/14727
104 * object.cc (Relobj::is_section_name_included): Also match
105 .sdata personality section.
106
168a4726
AM
1072012-10-18 Alan Modra <amodra@gmail.com>
108
109 * target-reloc.h (class Default_comdat_behavior): New, package up..
110 (get_comdat_behaviour): ..this.
111 (relocate_section): Add Relocate_comdat_behavior template arg,
112 adjust code to suit.
113 * arm.cc (Target_arm::relocate_section): Adjust to suit.
114 (Target_arm::scan_reloc_section): Likewise.
115 * i386.cc (Target_i386::relocate_section): Likewise.
116 * sparc.cc (Target_sparc::relocate_section): Likewise.
117 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
118 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
119 * powerpc.cc (class Relocate_comdat_behavior): New.
120 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
121 gold::relocate_section with new template arg.
122
acc276d8
AM
1232012-10-18 Alan Modra <amodra@gmail.com>
124
125 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
126 dynamic relocs for GOT_TPREL got entries, without symbol if
127 resolving locally.
128 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
129 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
130 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
131
e10f9870
AM
1322012-10-17 Alan Modra <amodra@gmail.com>
133
134 PR gold/14726
135 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
136
ae034989
ST
1372012-10-16 Sriraman Tallam <tmsriram@google.com>
138
139 * layout.cc (Layout::include_section): Keep sections marked
140 SHF_EXCLUDE when doing relocatable links.
141
f3a0ed29
AM
1422012-10-16 Alan Modra <amodra@gmail.com>
143
144 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
145 (Target_powerpc::do_finalize_sections): Call it.
146 (Output_data_save_res): New class and supporting functions.
147 (Target_powerpc::symval_for_branch): Only look up .opd entry for
148 normal symbols defined in object files.
149
c6de8ed4
AM
1502012-10-12 Alan Modra <amodra@gmail.com>
151
152 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
153 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
154 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
155 section if scan_opd_relocs not yet called.
156 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
157
03e25981
AM
1582012-10-12 Alan Modra <amodra@gmail.com>
159
160 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
161 add_local_ifunc_entry): Revert last change.
162 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
163
c9824451
AM
1642012-10-05 Alan Modra <amodra@gmail.com>
165
166 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
167 do_plt_address_for_global): New functions.
168 (Output_data_got_powerpc::do_write): Don't segfault when linking
169 statically.
170 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
171 add_local_ifunc_entry): Return true on adding entry..
172 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
173 glink->add_entry call. Remove unused symtab param. Adjust calls.
174 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
175 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
176 set up symbols here.
177 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
178 syms here. Do so even when no .iplt. Don't segfault when linking
179 statically.
180 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
181 new variants without reloc param.
182 (Glink_sym_ent::Glink_sym_ent): Likewise.
183 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
184 reloc when refs will resolve to plt call stub.
185 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
186 R_PPC_PLTREL24 to resolve locally.
187 (Target_powerpc::Scan::global): Correct ifunc handling.
188 (Target_powerpc::Relocate::relocate): Correct local sym glink
189 lookup. Don't destroy "value" when we have a plt call stub,
190 and when checking plt call validity.
191 (Target_powerpc::do_dynsym_value): Simplify.
192
19fec8c1
AM
1932012-10-05 Alan Modra <amodra@gmail.com>
194
195 * i386.cc (Output_data_plt_i386::address_for_global,
196 address_for_local): Add plt offset to returned value. Adjust uses.
197 * sparc.cc (Output_data_plt_sparc::address_for_global,
198 address_for_local): Likewise.
199 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
200 address_for_local): Likewise.
201 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
202 address_for_local): Likewise.
203 * target.h (Target::plt_address_for_global, plt_address_for_local):
204 Update comment.
205 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
206 (Output_data_got::Got_entry::write): Nor here.
207 * output.h: Comment fix.
208
e867b647
WL
2092012-10-02 Jiong Wang <jiwang@tilera.com>
210
211 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
212 global_offset_table_ value for larget got.
213 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
214
e5d5f5ed
AM
2152012-09-29 Alan Modra <amodra@gmail.com>
216
217 * powerpc.cc (Target_powerpc::iplt_): New output section.
218 (Target_powerpc::iplt_section, make_iplt_section,
219 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
220 (Target_powerpc::make_plt_entry): Handle ifunc syms.
221 Target_powerpc::plt_entry_count): Count iplt entries too.
222 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
223 reloc section in constructor. New params.
224 (Target_powerpc::make_plt_section): Create reloc section here instead.
225 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
226 functions.
227 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
228 (Output_data_glink::add_entry, find_entry): New functions to
229 deal with local syms.
230 (Glink_sym_ent): Add support for local syms.
231 (Output_data_glink::do_write): Handle ifunc plt entries.
232 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
233 (Target_powerpc::Scan::local, global): Handle ifunc syms.
234 (Target_powerpc::Relocate::relocate): Likewise.
235 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
236
ec4dbad3
AM
2372012-09-25 Alan Modra <amodra@gmail.com>
238
239 * object.h (Sized_relobj_file::adjust_local_symbol,
240 do_adjust_local_symbol): New functions.
241 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
242 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
243 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
244 and irregular opd entry spacing.
245 (Powerpc_relobj::do_read_relocs): Add opd size checks.
246 (Global_symbol_visitor_opd): New functor.
247 (Target_powerpc::do_finalize_sections): Omit global symbols defined
248 on deleted opd entries.
249
5c0b3823
WL
2502012-09-15 Jiong Wang <jiwang@tilera.com>
251
252 * tilegx.cc: New file.
253 * Makefile.am (TARGETSOURCES): Add tilegx.cc
254 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
255 * configure.tgt: Add entries for tilegx*.
256 * configure.ac: Likewise.
257 * Makefile.in: Rebuild.
258 * configure: Likewise.
259 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
260 tilegx.
261
bfdfa4cd
AM
2622012-09-13 Alan Modra <amodra@gmail.com>
263
264 * target-reloc.h (scan_relocs): Call scan.local for relocs
265 against symbols in discarded sections. Pass is_discarded
266 param.
267 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
268 Add is_discarded param.
269 * powerpc (Target_powerpc::Scan::local): Likewise. Use
270 is_discarded to flag opd entry as discarded. Don't emit dyn
271 relocs on such entries.
272 (Target_powerpc::Scan::global): Similarly detect and handle
273 such opd entries.
274 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
275 opd_ent_. Update all uses.
276 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
277 (Target_powerpc::relocate_section): Zero out discarded opd
278 entry relocs.
279
d77a0555
ILT
2802012-09-12 Ian Lance Taylor <iant@google.com>
281
282 PR gold/14570
283 * output.cc: Rename Output_data_got template parameter from size
284 to got_size for all functions. Compile all variants of
285 Output_data_got.
286 (Output_data_got::Got_entry::write): Correct use of size for
287 symbol value. Use local_is_tls rather than casting to
288 Sized_relobj_file.
289 * object.h (class Object): Add local_is_tls and do_local_is_tls.
290 (class Sized_relobj_file): Add do_local_is_tls.
291 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
292
815a1205
AM
2932012-09-11 Alan Modra <amodra@gmail.com>
294
295 PR gold/14566
296 * layout.cc (Layout::set_segment_offsets): When using
297 common-page-size alignment, ensure we are on a new max-page-size
298 page.
299 * output.cc (Output_segment::set_section_addresses): Use
300 abi_pagesize, not common_pagesize for relro boundary.
301 (Output_segment::set_offset): Likewise.
302
bd73a62d
AM
3032012-09-11 Alan Modra <amodra@gmail.com>
304
305 * output.h (Output_data_got::add_global_tls, add_local_tls,
306 add_local_tls_pair): New functions.
307 (Output_data_got::add_local_pair_with_rel): Remove second
308 reloc param. Expand comment.
309 (Output_data_got::Got_entry): Rename use_plt_offset_ to
310 use_plt_or_tls_offset_, similarly for constructor param.
311 (Output_data_got::Got_entry::write): Add got_index param.
312 * output.cc (Output_data_got::add_global_tls, add_local_tls,
313 add_local_tls_pair): New functions.
314 (Output_data_got::Got_entry::write): Handle tls symbols
315 with use_plt_or_tls_offset_ set specially.
316 (Output_data_got::add_local_pair_with_rel): Only one reloc.
317 (Output_data_got::do_write): Replace iterator with index, pass
318 index to entry write function.
319 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
320 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
321 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
322 call.
323 * i386.cc (Target_i386::Scan::local): Likewise.
324 * sparc.cc (Target_sparc::Scan::local): Likewise.
325 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
326 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
327 do_tls_offset_for_global): New functions.
328 (Target_powerpc::Scan::local): Correct TLS relocations and got
329 entry values.
330 (Target_powerpc::Scan::global): Don't emit unnecessary
331 dynamic relocations on TLS GOT entries.
332
00716ab1
AM
3332012-09-10 Matthias Klose <doko@ubuntu.com>
334
335 * config.in: Disable sanity check for kfreebsd.
336
c891b3f9
SA
3372012-09-10 Sterling Augustine <saugustine@google.com>
338
339 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
340 (Gdb_index::pubtypes_read): New parameter.
341 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
342 to calls.
343 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
344 pubtypes_object_.
345
e81fea4d
AM
3462012-09-09 Alan Modra <amodra@gmail.com>
347
348 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
349 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
350 * gc.h (gc_process_relocs): Call target gc_add_reference.
351 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
352 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
353 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
354 unnecessary cast.
355 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
356 to cater for when we don't need code offset. Update use.
357 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
358 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
359 set_opd_valid): New functions.
360 (Target_powerpc::do_gc_add_reference): New function.
361 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
362 stashed refs.
363 (Target_powerpc::do_gc_mark_symbol): New function.
364
d2d60eef
CC
3652012-09-06 Cary Coutant <ccoutant@google.com>
366
367 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
368 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
369 (Dwarf_die::skip_attributes): Likewise.
370 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
371 * testsuite/gdb_index_test.cc (inline_func_1): New function.
372 (main): Call it.
373 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
374
32ed4573
L
3752012-09-05 H.J. Lu <hongjiu.lu@intel.com>
376
377 * testsuite/script_test_3.t: Add .got.plt output section
378 statement.
379 * testsuite/script_test_4.t: Likewise.
380
f4baf0d4
AM
3812012-09-05 Alan Modra <amodra@gmail.com>
382
383 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
384 update all uses and lose "enum" when using type.
385
864a1b56
AM
3862012-09-05 Alan Modra <amodra@gmail.com>
387
388 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
389 * configure: Regenerate.
390 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
391 (plugin_final_layout.stdout): Likewise.
392 (memory_test): Set page sizes to 0x1000.
393 * testsuite/Makefile.in: Regenerate.
394 * testsuite/discard_locals_test.sh: Add FIXME comment.
395 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
396 * testsuite/pr14265.t: Add .got output section statement.
397 * testsuite/script_test_2.t: Likewise.
398 * testsuite/script_test_3.t: Likewise.
399 * testsuite/script_test_4.t: Likewise.
400 * testsuite/script_test_5.t: Likewise.
401 * testsuite/script_test_6.t: Likewise.
402 * testsuite/script_test_7.t: Likewise.
403 * testsuite/script_test_9.t: Likewise.
404
3ea0a085
AM
4052012-09-05 Alan Modra <amodra@gmail.com>
406
407 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
408 (Powerpc_relocate_functions::Status): New typedef.
409 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
410 (Target_powerpc::Scan::local): Handle REL64.
411 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
412 for REL32 and REL64.
413 (Target_powerpc::symval_for_branch): New function, extracted from..
414 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
415 checks. Report overflow errors.
416
7404fe1b
AM
4172012-09-05 Alan Modra <amodra@gmail.com>
418
419 * object.h (Sized_relobj_file::emit_relocs): Delete.
420 (Sized_relobj_file::emit_relocs_reltype): Delete.
421 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
422 relocate_relocs for --emit-relocs.
423 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
424 * output.h: Update comment.
425 (Output_segment::first_section): New function.
426 (Output_segment::first_section_load_address): Use first_section.
427 * output.cc (Output_segment::first_section): New function extracted..
428 (Output_segment::first_section_load_address): ..from here. Delete.
429 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
430 * target.h (Sized_target::relocate_for_relocatable): Likewise.
431 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
432 adjust call to target.h function.
433 * i386.cc (Target_i386): Likewise.
434 * sparc.cc (Target_sparc): Likewise.
435 * x86_64.cc (Target_x86_64): Likewise.
436 * powerpc.cc (Target_powerpc): Likewise.
437 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
438 first tls section has section symbol for optimised local dynamic
439 output relocs.
440 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
441 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
442 optimised tls code.
443 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
444 Rename to relocate_relocs. Update error message.
445
957564c9
AS
4462012-09-04 Andreas Schwab <schwab@linux-m68k.org>
447
448 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
449 --just-symbols.
450
dd93cd0a
AM
4512012-08-31 Alan Modra <amodra@gmail.com>
452
453 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
454 (Powerpc_relobj::toc_base_offset): New stub function.
455 (Target_powerpc): Add tp_offset, dtp_offset. Rename
456 got_mod_index_offset to tlsld_got_offset. Update all refs.
457 (Target_powerpc::Relocate::enum skip_tls): New.
458 (Target_powerpc::call_tls_get_addr_): New var.
459 (Target_powerpc::is_branch_reloc): Move to file scope.
460 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
461 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
462 New functions.
463 (Target_powerpc::enum Got_type): Delete old values, add new ones.
464 (powerpc_info): Correct common_pagesize for ppc64.
465 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
466 (Powerpc_relocate_functions): Add overflow check enums and functions.
467 Add non-shift version of rela, rela_ua. Delete all rel public
468 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
469 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
470 addr16_ha3, addr14 functions.
471 (Output_data_got_powerpc::add_constant_pair): New function.
472 (Output_data_got_powerpc::got_base_offset): Likewise.
473 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
474 (instruction constants): Sort, add some more.
475 (Output_data_glink::do_write): Add and use Address typedef. Use
476 object->toc_base_offset() stub for 64-bit.
477 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
478 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
479 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
480 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
481 Always treat .opd relocs as against locally defined symbol.
482 Correct condition for RELATIVE relocs.
483 (Target_powerpc::do_finalize_sections): Test for NULL sections.
484 (Target_powerpc::Relocate::relocate): Use plt call stub as value
485 for 32-bit syms with a plt entry. Correct ppc64 toc base
486 calculations. Handle TLS relocs, and more. Add overflow
487 checking and adjust for Powerpc_relocate_functions changes.
488 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
489 Reinstate --emit-relocs code with FIXME.
490
a1373b60
AM
4912012-08-30 Alan Modra <amodra@gmail.com>
492
493 * layout.cc (Layout::set_segment_offsets): Set p_align to
494 abi_pagesize, not common_pagesize.
495 (Layout::relaxation_loop_body): Similarly use abi_pagesize
496 to determine whether file header can go in segment.
497
703d02da
AM
4982012-08-30 Alan Modra <amodra@gmail.com>
499
500 * output.h (Output_reloc::Output_reloc <output section>): Add
501 is_relative param. Adjust calls.
502 (Output_reloc::add_output_section_relative): New functions.
503 * output.cc (Output_reloc::Output_reloc <output section>): Handle
504 is_relative.
505 (Output_reloc::symbol_value): Handle SECTION_CODE.
506
16164a6b
ST
5072012-08-24 Sriraman Tallam <tmsriram@google.com>
508
509 * gold.cc (queue_middle_tasks): Call layout again when unique
510 segments for sections is desired.
511 * layout.cc (Layout::Layout): Initialize new members.
512 (Layout::get_output_section_flags): New function.
513 (Layout::choose_output_section): Call get_output_section_flags.
514 (Layout::layout): Make output section for mapping to a unique segment.
515 (Layout::insert_section_segment_map): New function.
516 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 517 output sections marked so.
16164a6b
ST
518 (Layout::segment_precedes): Check for unique segments when sorting.
519 * layout.h (Layout::Unique_segment_info): New struct.
520 (Layout::Section_segment_map): New typedef.
521 (Layout::insert_section_segment_map): New function.
522 (Layout::get_output_section_flags): New function.
523 (Layout::is_unique_segment_for_sections_specified): New function.
524 (Layout::set_unique_segment_for_sections_specified): New function.
525 (Layout::unique_segment_for_sections_specified_): New member.
526 (Layout::section_segment_map_): New member.
527 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
528 Rename is_gc_pass_one to is_pass_one.
529 Rename is_gc_pass_two to is_pass_two.
530 Rename is_gc_or_icf to is_two_pass.
531 Check for which pass based on whether symbols data is present.
532 Make it two pass when unique segments for sections is desired.
533 * output.cc (Output_section::Output_section): Initialize new
534 members.
535 * output.h (Output_section::is_unique_segment): New function.
536 (Output_section::set_is_unique_segment): New function.
537 (Output_section::is_unique_segment_): New member.
538 (Output_section::extra_segment_flags): New function.
539 (Output_section::set_extra_segment_flags): New function.
540 (Output_section::extra_segment_flags_): New member.
541 (Output_section::segment_alignment): New function.
542 (Output_section::set_segment_alignment): New function.
543 (Output_section::segment_alignment_): New member.
544 (Output_segment::Output_segment): Initialize is_unique_segment_.
545 (Output_segment::is_unique_segment): New function.
546 (Output_segment::set_is_unique_segment): New function.
547 (Output_segment::is_unique_segment_): New member.
548 * plugin.cc (allow_unique_segment_for_sections): New function.
549 (unique_segment_for_sections): New function.
550 (Plugin::load): Add new functions to transfer vector.
551 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
552 * Makefile.in: Regenerate.
553 * testsuite/plugin_final_layout.sh: Check if unique segment
554 functionality works.
555 * testsuite/plugin_section_order.c (onload): Check if new interfaces
556 are available.
557 (allow_unique_segment_for_sections): New global.
558 (unique_segment_for_sections): New global.
559 (claim_file_hook): Call allow_unique_segment_for_sections.
560 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 561
1e2bee4f
CC
5622012-08-22 Cary Coutant <ccoutant@google.com>
563
564 * layout.cc (Layout::include_section): Don't assert on GROUP
565 sections with --emit-relocs.
566
1d5dfe78
CC
5672012-08-21 Cary Coutant <ccoutant@google.com>
568
569 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
570 if --export-dynamic-symbol names an undef symbol.
571
c9269dff
AM
5722012-08-18 Alan Modra <amodra@gmail.com>
573
574 * powerpc.cc: Formatting and white space.
575 (Powerpc_relobj): Rename got2_section_ to special_.
576 Add opd_ent_shndx_ and opd_ent_off_ vectors.
577 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
578 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
579 (Target_powerpc): Add Address typedef and invalid_address. Use
580 throughout.
581 (Target_powerpc::is_branch_reloc): New function.
582 (Powerpc_relocate_functions): Add Address typedef, use throughout.
583 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
584 for dst_mask, value and addend.
585 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
586 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
587 (Output_data_glink::do_write): Correct toc base. Don't try to use
588 uint16_t for 24-bit offset. Use get_output_section_offset and
589 check return.
590 (Target_powerpc::Scan::local): Handle more relocs.
591 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
592 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
593 Plug in toc restoring insn after plt calls. Translate branches
594 to function descriptor symbols to corresponding entry point.
595 (Target_powerpc::relocate_for_relocatable): Check return from
596 get_output_section_offset.
597 * symtab.h: Comment typo.
598
b1759dce
ILT
5992012-08-14 Ian Lance Taylor <iant@google.com>
600
601 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
602 unsupported_relocal_local to call unsupported_reloc_global.
603
b9b2ae8b
NC
6042012-08-14 Nick Clifton <nickc@redhat.com>
605
606 PR ld/14265
607 * script-sections.cc (Sections_element::output_section_name): Add
608 keep return parameter.
609 (Output_section_element::match_name): Add keep return parameter.
610 Return the value of the keep_ member.
611 * script-sections.h (class Output_section): Update
612 output_section_name prototype.
613 * layout.cc (Layout::keep_input_section): New public member
614 function.
615 (Layout::choose_output_section): Pass keep parameter to
616 output_section_name.
617 * layout.h (class Layout): Add keep_input_section.
618 * object.cc (Sized_relobj_file::do_layout): Check for kept input
619 sections.
620 * testsuite/Makefile.am: Add a test.
621 * testsuite/Makefile.in: Regenerate.
622 * testsuite/pr14265.c: Source file for the test.
623 * testsuite/pr14265.t: Linker script for the test.
624 * testsuite/pr14265.sh: Shell script for the test.
625
921b5322
AM
6262012-08-14 Alan Modra <amodra@gmail.com>
627
628 * target.h (Target::output_section_name): New function.
629 (Target::do_output_section_name): New function.
630 * layout.cc (Layout::choose_output_section): Call the above.
631 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
632
6ce78956
AM
6332012-08-14 Alan Modra <amodra@gmail.com>
634
635 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
636 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
637 for replace_constant call.
638 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
639 (Output_data_glink::do_print_to_mapfile): New function.
640 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
641 (Target_powerpc::Relocate::relocate): Likewise.
642
d1a8cabd
AM
6432012-08-14 Alan Modra <amodra@gmail.com>
644
645 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
646 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
647 (Output_data_glink::add_entry,find_entry): Remove shndx param.
648 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
649 all references to shndx_. Handle special case for R_PPC_PLTREL24
650 here.
651 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
652 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
653 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
654 here.
655 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
656 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
657
d83ce4e3
AM
6582012-08-12 Alan Modra <amodra@gmail.com>
659
660 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
661 (glink insn constants): Use uint32_t.
662 (Output_data_glink::add_entry): Use insert, not [] operator.
663
cf43a2fe
AM
6642012-08-11 Alan Modra <amodra@gmail.com>
665
666 * object.h (Sized_relobj_file::find_shdr): New function.
667 (Sized_relobj_file::find_special_sections): New function.
668 * object.cc (Sized_relobj_file::find_shdr): New function.
669 (Sized_relobj_file::find_eh_frame): Use find_shdr.
670 (Sized_relobj_file::find_special_sections): New function, split out..
671 (Sized_relobj_file::do_read_symbols): ..from here.
672 * output.h (Output_data_got::replace_constant): New function.
673 (Output_data_got::num_entries): New function.
674 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
675 (Output_data_got::got_offset): Protected rather than private.
676 (Output_data_got::replace_got_entry): New function.
677 * output.cc (Output_data_got::replace_got_entry): New function.
678 * powerpc.cc (class Powerpc_relobj): New.
679 (class Powerpc_relocate_functions): Delete all psymval variants or
680 convert to value,addend type. Delete pcrela, pcrela_unaligned.
681 Implement _ha functions using corresponding _hi function.
682 (Powerpc_relobj::find_special_sections): New function.
683 (Target_powerpc::do_make_elf_object): New function.
684 (class Output_data_got_powerpc): New.
685 (class Output_data_glink): New.
686 (class Powerpc_scan_relocatable_reloc): New.
687 Many more changes througout file.
688
3c892704
NC
6892012-08-09 Nick Clifton <nickc@redhat.com>
690
691 * po/vi.po: Updated Vietnamese translation.
692
82435b3b
ILT
6932012-08-07 Ian Lance Taylor <iant@google.com>
694
695 * layout.cc (Layout::add_target_dynamic_tags): If
696 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
697 plt_rel.
698
a6dc81d2
NC
6992012-07-30 Nick Clifton <nickc@redhat.com>
700
701 * po/gold.pot: Updated template.
702 * po/es.po: Updated Spanish translation.
703
f1415016
CC
7042012-07-18 Cary Coutant <ccoutant@google.com>
705
706 PR gold/14344
707 * configure.ac: Add check for -gpubnames support.
708 * configure: Regenerate.
709 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
710 support; force -gno-pubnames.
711 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
712 support.
713 (gdb_index_test_4): New test.
714 * testsuite/Makefile.in: Regenerate.
715 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
716 * testsuite/gdb_index_test_2.sh: Likewise.
717 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
718 * testsuite/gdb_index_test_4.sh: New script.
719 * testsuite/gdb_index_test_comm.sh: New script with common code;
720 don't look for space after colon.
721
b7fd7c37
ST
7222012-07-16 Sriraman Tallam <tmsriram@google.com>
723
724 * gold.cc (queue_middle_tasks): Update function order only after
725 deferred objects due to plugins are processed.
726
1f3212db
ILT
7272012-07-11 Ian Lance Taylor <iant@google.com>
728
729 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
730 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
731 (Target_arm::scan_reloc_for_stub): Likewise.
732 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
733 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
734 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
735 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
736 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
737
81c82a68
ILT
7382012-07-10 Dodji Seketeli <dodji@redhat.com>
739 Ian Lance Taylor <iant@google.com>
740
741 PR gold/14309
742 * configure.ac: Test whether std::tr1::hash<off_t> works.
743 * gold.h: Add a specialization for std::tr1::hash<off_t> if
744 needed.
745 * output.h (class Output_fill): Add virtual destructor.
746 * configure, config.in: Rebuild.
747
eabc84f4
RM
7482012-06-22 Roland McGrath <mcgrathr@google.com>
749
750 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
751
370e30b6
RÁE
7522012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
753
754 * plugin.cc (Plugin::load): Handle position independent executables.
755
fb1b895d
CC
7562012-06-06 Cary Coutant <ccoutant@google.com>
757
758 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
759 add .debug_macro.
760 (lines_only_debug_sections): Likewise.
761 (gdb_fast_lookup_sections): New static array.
762 (is_gdb_debug_section): Rename formal parameter.
763 (is_lines_only_debug_section): Likewise.
764 (is_gdb_fast_lookup_section): New function.
765 (Layout::include_section): Check for ".zdebug_" prefix; pass
766 section name suffix to is_gdb_debug_section, et al.; check for
767 fast-lookup sections when building .gdb_index.
768 * options.h (--strip-debug-gdb): Update GDB version number.
769
7c0640fa
CC
7702012-06-06 Cary Coutant <ccoutant@google.com>
771
772 * configure.ac: Add check for fallocate.
773 * configure: Regenerate.
774 * config.in: Regenerate.
775
776 * options.h (class General_options): Add --mmap-output-file and
777 --posix-fallocate options.
778 * output.cc: (posix_fallocate): Remove; replace with...
779 (gold_fallocate): New function.
780 (Output_file::map_no_anonymous): Call gold_fallocate.
781 (Output_file::map): Check --mmap-output-file option.
782
2a49eb69
DK
7832012-06-05 Jing Yu <jingyu@google.com>
784
785 * gold.h (textdomain): Add do {} to empty while(0).
786 (bindtextdomain): Likewise.
787
fad072ac
CC
7882012-06-04 Cary Coutant <ccoutant@google.com>
789
790 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
791 has_dynsym_index.
792
8cc69fb6
ST
7932012-05-25 Sriraman Tallam <tmsriram@google.com>
794
795 * symtab.cc (Symbol_table::define_special_symbol):
796 Initialize *poldsym to prevent uninitialized variable errors.
797
1be75daa
CC
7982012-05-23 Cary Coutant <ccoutant@google.com>
799
800 * layout.cc (Layout::section_name_mapping): Add rules to handle
801 exact match on .data.rel.ro.local or .data.rel.ro.
802 (Layout::output_section_name): Check for exact matches.
803
9b689de0
CC
8042012-05-23 Cary Coutant <ccoutant@google.com>
805
806 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
807 more carefully.
808
b24fdbf5
CC
8092012-05-22 Cary Coutant <ccoutant@google.com>
810
811 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
812 object before exporting symbol.
813
e550e1a2
L
8142012-05-21 H.J. Lu <hongjiu.lu@intel.com>
815
816 * testsuite/tls_test.cc: Include "config.h" first.
817 * testsuite/tls_test_c.c: Likewise.
818
df7b86aa
NC
8192012-05-17 Daniel Richard G. <skunk@iskunk.org>
820 Nick Clifton <nickc@redhat.com>
821
822 PR 14072
823 * configure.in: Add check that sysdep.h has been included before
824 any system header files.
825 * configure: Regenerate.
826 * config.in: Regenerate.
827
1007b503
CC
8282012-05-14 Cary Coutant <ccoutant@google.com>
829
830 * layout.cc (Layout::make_output_section): Mark .tdata section
831 as RELRO.
832 * testsuite/relro_test.cc: Add a TLS variable.
833
fd885f3a
L
8342012-05-10 H.J. Lu <hongjiu.lu@intel.com>
835
836 PR gold/14091
837 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
838 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
839 R_X86_64_64.
840
80f5885c
CC
8412012-05-08 Cary Coutant <ccoutant@google.com>
842
843 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
844 (lines_only_debug_sections): Likewise.
845
2e702c99
RM
8462012-05-02 Roland McGrath <mcgrathr@google.com>
847
848 * nacl.cc: New file.
849 * nacl.h: New file.
850 * Makefile.am (CCFILES, HFILES): Add them.
851 * Makefile.in: Regenerate.
852 * i386.cc (Output_data_plt_i386_nacl): New class.
853 (Output_data_plt_i386_nacl_exec): New class.
854 (Output_data_plt_i386_nacl_dyn): New class.
855 (Target_i386_nacl): New class.
856 (Target_selector_i386_nacl): New class.
857 (target_selector_i386): Use it instead of Target_selector_i386.
858 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
859 (Target_x86_64_nacl): New class.
860 (Target_selector_x86_64_nacl): New class.
861 (target_selector_x86_64, target_selector_x32): Use it instead of
862 Target_selector_x86_64.
863 * arm.cc (Output_data_plt_arm_nacl): New class.
864 (Target_arm_nacl): New class.
865 (Target_selector_arm_nacl): New class.
866 (target_selector_arm, target_selector_armbe): Use it instead of
867 Target_selector_arm.
868
869 * target-select.cc (select_target): Take new Input_file* and off_t
870 arguments, pass them on to recognize method of selector.
871 * object.cc (make_elf_sized_object): Update caller.
872 * parameters.cc (parameters_force_valid_target): Likewise.
873 * incremental.cc (make_sized_incremental_binary): Likewise.
874 * target-select.h: Update decl.
875 (Target_selector::recognize): Take new Input_file* argument,
876 pass it on to do_recognize.
877 (Target_selector::do_recognize): Take new Input_file* argument.
878 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
879 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
880 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
881 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
882
883 * target.h (Target::Target_info): New members isolate_execinstr
884 and rosegment_gap.
885 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
886 * arm.cc (Target_arm::arm_info): Update initializer.
887 * i386.cc (Target_i386::i386_info): Likewise.
888 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
889 * sparc.cc (Target_sparc::sparc_info): Likewise.
890 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
891 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
892 * layout.cc (Layout::attach_allocated_section_to_segment):
893 Take new const Target* argument. If target->isolate_execinstr(), act
894 like --rosegment.
895 (Layout::find_first_load_seg): Take new const Target* argument;
896 if target->isolate_execinstr(), reject PF_X segments.
897 (Layout::relaxation_loop_body): Update caller.
898 (Layout::set_segment_offsets): If target->isolate_execinstr(),
899 reset file offset to zero when we hit LOAD_SEG, and then do a second
900 loop over the segments before LOAD_SEG to reassign offsets after
901 addresses have been determined. Handle target->rosegment_gap().
902 (Layout::attach_section_to_segment): Take new const Target* argument;
903 pass it to attach_allocated_section_to_segment.
904 (Layout::make_output_section): Update caller.
905 (Layout::attach_sections_to_segments): Take new const Target* argument;
906 pass it to attach_section_to_segment.
907 * gold.cc (queue_middle_tasks): Update caller.
908 * layout.h (Layout): Update method decls with new arguments.
909
910 * arm.cc (Target_arm::Target_arm): Take optional argument for the
911 Target_info pointer to use.
912 (Target_arm::do_make_data_plt): New virtual method.
913 (Target_arm::make_data_plt): New method that calls it.
914 (Target_arm::make_plt_entry): Use it.
915 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
916 for the section alignment.
917 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
918 method.
919 (Output_data_plt_arm::first_plt_entry_offset): Call it.
920 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
921 method.
922 (Output_data_plt_arm::get_plt_entry_size): Call it.
923 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
924 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
925 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
926 method.
927 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
928 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
929 method instead of sizeof(plt_entry).
930 (Output_data_plt_arm::add_entry): Likewise.
931 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
932 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
933 than static method.
934 (Target_arm::plt_entry_size): Likewise.
935 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
936 Move to ...
937 (Output_data_plt_arm_standard): ... here, new class.
938 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
939 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
940 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
941
942 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
943 Take additional argument for the PLT entry size.
944 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
945 Use get_plt_entry_size method rather than plt_entry_size variable.
946 (Output_data_plt_x86_64::reserve_slot): Likewise.
947 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
948 (Output_data_plt_x86_64::add_entry): Likewise.
949 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
950 (Output_data_plt_x86_64::address_for_global): Likewise.
951 (Output_data_plt_x86_64::address_for_local): Likewise.
952 (Output_data_plt_x86_64::set_final_data_size): Likewise.
953 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
954 Make method non-static.
955 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
956 method.
957 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
958 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
959 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
960 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
961 virtual method.
962 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
963 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
964 virtual method.
965 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
966 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
967 virtual method.
968 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
969 (Output_data_plt_x86_64::plt_entry_size)
970 (Output_data_plt_x86_64::first_plt_entry)
971 (Output_data_plt_x86_64::plt_entry)
972 (Output_data_plt_x86_64::tlsdesc_plt_entry)
973 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
974 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
975 (Output_data_plt_x86_64_standard): ... here, new class.
976 (Target_x86_64::Target_x86_64): Take optional argument for the
977 Target_info pointer to use.
978 (Target_x86_64::do_make_data_plt): New virtual method.
979 (Target_x86_64::make_data_plt): New method to call it.
980 (Target_x86_64::init_got_plt_for_update): Use that.
981 Call this->plt_->add_eh_frame method here.
982 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
983 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
984 rather than static method.
985 (Target_x86_64::plt_entry_size): Likewise.
986 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
987 rather than plt_entry_size variable. Move guts of PLT filling to...
988 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
989 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
990 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
991
992 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
993 additional argument for the section alignment.
994 Don't do add_eh_frame_for_plt here.
995 (Output_data_plt_i386::first_plt_entry_offset): Make the method
996 non-static. Use get_plt_entry_size method rather than plt_entry_size
997 variable.
998 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
999 method.
1000 (Output_data_plt_i386::get_plt_entry_size): Call it.
1001 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
1002 (Output_data_plt_i386::add_eh_frame): New method to call it.
1003 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
1004 method.
1005 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
1006 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
1007 method.
1008 (Output_data_plt_i386::fill_plt_entry): New method to call it.
1009 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
1010 method instead of plt_entry_size.
1011 (Output_data_plt_i386::plt_entry_size)
1012 (Output_data_plt_i386::plt_eh_frame_fde_size)
1013 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
1014 (Output_data_plt_i386_standard): ... here, new class.
1015 (Output_data_plt_i386_exec): New class.
1016 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
1017 (Output_data_plt_i386_exec::first_plt_entry): ... here.
1018 (Output_data_plt_i386::exec_plt_entry): Move to ...
1019 (Output_data_plt_i386_exec::plt_entry): ... here.
1020 (Output_data_plt_i386_dyn): New class.
1021 (Output_data_plt_i386::first_plt_entry): Move to ...
1022 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
1023 (Output_data_plt_i386::dyn_plt_entry): Move to ...
1024 (Output_data_plt_i386_dyn::plt_entry): ... here.
1025 (Target_i386::Target_i386): Take optional argument for the Target_info
1026 pointer to use.
1027 (Target_i386::do_make_data_plt): New virtual method.
1028 (Target_i386::make_data_plt): New method to call it.
1029 (Target_i386::make_plt_section): Use that.
1030 Call this->plt_->add_eh_frame method here.
1031 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
1032 rather than plt_entry_size variable.
1033 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
1034 (Output_data_plt_i386::address_for_local): Likewise.
1035 (Output_data_plt_i386::do_write): Likewise.
1036 Move guts of PLT filling to...
1037 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
1038 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
1039 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
1040 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
1041
b9b9f2ee
CC
10422012-05-01 Cary Coutant <ccoutant@google.com>
1043
1044 * dwarf_reader.cc (Dwarf_die::read_attributes)
1045 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
1046 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
1047 * reduced_debug_output.cc
1048 (Output_reduced_debug_info_section::get_die_end): Remove
1049 DW_FORM_GNU_ref_index. Add default case.
1050
57923f48
MW
10512012-04-26 Mark Wielaard <mjw@redhat.com>
1052
1053 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
1054 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
1055 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
1056 DW_AT_high_pc as offset from DW_AT_low_pc.
1057
1058 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
1059 * testsuite/Makefile.in: Regenerate.
1060 * testsuite/gdb_index_test_3.c: New test source file.
1061 * testsuite/gdb_index_test_3.sh: New test source file.
1062
2c54b4f4
ILT
10632012-04-25 Ian Lance Taylor <iant@google.com>
1064
1065 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
1066 pointer.
1067 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
1068 as a class, not a struct.
1069 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
1070 (Target_arm::apply_cortex_a8_workaround): Likewise.
1071 * gc.h: Declare Reloc_types as a struct, not a class.
1072 * object.h: Declare Symbols_data as a struct.
1073 * reloc.h: Declare Read_relocs_data as a struct.
1074 * target.h: Declare Relocate_info as a struct.
1075
a5a5f7a3
DM
10762012-04-24 David S. Miller <davem@davemloft.net>
1077
1078 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
1079 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
1080 and R_SPARC_WPLT30.
1081
f038d496
CC
10822012-04-24 Cary Coutant <ccoutant@google.com>
1083
1084 * incremental-dump.cc (find_input_containing_global): Replace
1085 magic number with symbolic constant.
1086 (dump_incremental_inputs): Update version number.
1087 * incremental.cc (Output_section_incremental_inputs): Update version
1088 number; import symbolic constants from Incremental_inputs_reader.
1089 (Incremental_inputs::create_data_sections): Align relocations
1090 section correctly for 64-bit targets.
1091 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
1092 constants; add padding.
1093 (Output_section_incremental_inputs::write_header): Add assert for
1094 header_size.
1095 (Output_section_incremental_inputs::write_input_files): Add assert
1096 for input_entry_size.
1097 (Output_section_incremental_inputs::write_info_blocks): Add padding;
1098 add assert for object_info_size, input_section_entry_size,
1099 global_sym_entry_size.
1100 * incremental.h (Incremental_inputs_reader): Add symbolic constants
1101 for data structure sizes; use them.
1102 (Incremental_input_entry_reader): Import symbolic constants from
1103 Incremental_inputs_reader; use them.
1104
a4d85145
DM
11052012-04-23 David S. Miller <davem@davemloft.net>
1106
1107 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
1108 and elf_flags_set_.
1109 (Target_sparc::Target_sparc): Initialize new fields.
1110 (Target_sparc::do_make_elf_object): New function.
1111 (Target_sparc::do_adjust_elf_header): New function.
1112
1d509098
CC
11132012-04-23 Cary Coutant <ccoutant@google.com>
1114
1115 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
1116 CU range table of gdb index.
1117
7ebeff7f
DM
11182012-04-20 David S. Miller <davem@davemloft.net>
1119
1120 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
1121 instead of false.
1122
13cf9988
DM
11232012-04-16 David S. Miller <davem@davemloft.net>
1124
2a1079e8
DM
1125 * sparc.cc (Target_sparc::got_address): New function.
1126 (Sparc_relocate_functions::gdop_hix22): New function.
1127 (Sparc_relocate_functions::gdop_lox10): New function.
1128 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
1129 relocs.
1130 (Target_sparc::Scan::local): Likewise if the global symbol is not
1131 preemptible and is not IFUNC.
1132 (Target_sparc::Relocate::relocate): Perform GOTDATA code
1133 transformations for local and non-preemptible non-IFUNC global
1134 symbols.
1135
0bc964fc
DM
1136 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
1137 writing out 64-bit part of ranges.
1138
661d7a80
DM
1139 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
1140 -fpic and -fpie respectively.
1141 * Makefile.in: Regenerate.
1142
8c2bf391
DM
1143 * sparc.cc (class Target_sparc): Add rela_ifunc_.
1144 (Target_sparc::Target_sparc): Initialize new field.
1145 (Target_sparc::do_plt_section_for_global): New function.
1146 (Target_sparc::do_plt_section_for_local): New function.
1147 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
1148 (Target_sparc::make_plt_section): New function, broken out of
1149 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
1150 (Target_sparc::make_plt_entry): Call make_plt_section.
1151 (Target_sparc::make_local_ifunc_plt_entry): New function.
1152 (Target_sparc::rela_ifunc_section): New function.
1153 (Target_sparc::plt_section): Remove const.
1154 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
1155 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
1156 and ifunc_count_ fields.
1157 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
1158 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
1159 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
1160 (Output_data_plt_sparc::rela_ifunc): New function.
1161 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
1162 (Output_data_plt_sparc::has_ifunc_section): New function.
1163 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
1164 (Output_data_plt_sparc::address_for_global): New function.
1165 (Output_data_plt_sparc::address_for_local): New function.
1166 (Output_data_plt_sparc::plt_index_to_offset): New function.
1167 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
1168 and entry_count.
1169 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
1170 entry_count.
1171 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
1172 R_SPARC_JMP_IREL to switch.
1173 (Target_sparc::Scan::check_non_pic): Likewise.
1174 (Target_sparc::Scan::local): Handle IFUNC symbols.
1175 (Target_sparc::Scan::local): Likewise.
1176 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
1177 and plt_address_for_local.
1178 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
1179 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
1180
13cf9988
DM
1181 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
1182 (class Output_data_reloc): Adjust calls to Output_reloc_type.
1183 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
1184 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
1185 global relocs too.
1186 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
1187 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
1188 calls.
1189 * sparc.cc (Target_sparc::Scan::global): Likewise.
1190 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
1191
31821be0
CC
11922012-04-16 Cary Coutant <ccoutant@google.com>
1193
1194 * archive.cc (Library_base::should_include_member): Check for
1195 --export-dynamic-symbol.
1196 * options.h (class General_options): Add --export-dynamic-symbol.
1197 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
1198 --export-dynamic-symbol.
1199 (Symbol_table::gc_mark_undef_symbols): Likewise.
1200 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
1201
2615994e
DM
12022012-04-12 David S. Miller <davem@davemloft.net>
1203
1204 * sparc.cc (Reloc::wdisp10): New relocation method.
1205 (Reloc::h34): Likewise.
1206 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
1207 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
1208 R_SPARC_WDISP10.
1209 (Target_sparc::Scan::local): Likewise.
1210 (Target_sparc::Scan::global): Likewise.
1211 (Target_sparc::Relocate::relocate): Likewise.
1212
6782735d
CC
12132012-04-09 Cary Coutant <ccoutant@google.com>
1214
1215 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
1216 low_pc == 0.
1217
8c7a0b00
ILT
12182012-04-06 Ian Lance Taylor <iant@google.com>
1219
1220 * timer.cc: #include <unistd.h>.
1221
58797674
RM
12222012-04-06 Roland McGrath <mcgrathr@google.com>
1223
1224 * configure.in (AC_CHECK_HEADERS): Add locale.h.
1225 * config.in: Regenerate.
1226 * configure: Regenerate.
1227
44350750
NC
12282012-04-05 Nick Clifton <nickc@redhat.com>
1229
1230 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
1231 (AM_LC_MESSAGES): Add.
1232 * aclocal.m4: Regenerate.
1233 * config.in: Regenerate.
1234 * configure: Regenerate.
1235
c1027032
CC
12362012-03-21 Cary Coutant <ccoutant@google.com>
1237
1238 * Makefile.am: Add gdb-index.cc, gdb-index.h.
1239 * Makefile.in: Regenerate.
1240 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
1241 (Sized_elf_reloc_mapper::symbol_section): New function.
1242 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
1243 (make_elf_reloc_mapper): New function.
1244 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
1245 (Dwarf_abbrev_table::do_read_abbrevs): New function.
1246 (Dwarf_abbrev_table::do_get_abbrev): New function.
1247 (Dwarf_ranges_table::read_ranges_table): New function.
1248 (Dwarf_ranges_table::read_range_list): New function.
1249 (Dwarf_pubnames_table::read_section): New function.
1250 (Dwarf_pubnames_table::read_header): New function.
1251 (Dwarf_pubnames_table::next_name): New function.
1252 (Dwarf_die::Dwarf_die): New function.
1253 (Dwarf_die::read_attributes): New function.
1254 (Dwarf_die::skip_attributes): New function.
1255 (Dwarf_die::set_name): New function.
1256 (Dwarf_die::set_linkage_name): New function.
1257 (Dwarf_die::attribute): New function.
1258 (Dwarf_die::string_attribute): New function.
1259 (Dwarf_die::int_attribute): New function.
1260 (Dwarf_die::uint_attribute): New function.
1261 (Dwarf_die::ref_attribute): New function.
1262 (Dwarf_die::child_offset): New function.
1263 (Dwarf_die::sibling_offset): New function.
1264 (Dwarf_info_reader::check_buffer): New function.
1265 (Dwarf_info_reader::parse): New function.
1266 (Dwarf_info_reader::do_parse): New function.
1267 (Dwarf_info_reader::do_read_string_table): New function.
1268 (Dwarf_info_reader::lookup_reloc): New function.
1269 (Dwarf_info_reader::get_string): New function.
1270 (Dwarf_info_reader::visit_compilation_unit): New function.
1271 (Dwarf_info_reader::visit_type_unit): New function.
1272 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
1273 Sized_elf_reloc_mapper.
1274 (Sized_dwarf_line_info::symbol_section): Remove function.
1275 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
1276 (Sized_dwarf_line_info::read_line_mappings): Remove object
1277 parameter, adjust callers.
1278 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
1279 * dwarf_reader.h: Include <sys/types.h>.
1280 (class Track_relocs): Remove forward declaration.
1281 (class Elf_reloc_mapper): New class.
1282 (class Sized_elf_reloc_mapper): New class.
1283 (class Dwarf_abbrev_table): New class.
1284 (class Dwarf_range_list): New class.
1285 (class Dwarf_ranges_table): New class.
1286 (class Dwarf_pubnames_table): New class.
1287 (class Dwarf_die): New class.
1288 (class Dwarf_info_reader): New class.
1289 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
1290 (Sized_dwarf_line_info::symbol_section): Remove member function.
1291 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
1292 base class.
1293 * gdb-index.cc: New source file.
1294 * gdb-index.h: New source file.
1295 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
1296 and .debug_types sections, call Layout::add_to_gdb_index.
1297 (Sized_relobj_incr::do_section_name): Implement.
1298 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
1299 return type; Implement.
1300 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
1301 return type.
1302 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
1303 parameter list and return type.
1304 (Sized_incr_dynobj::do_section_contents): Likewise.
1305 * layout.cc: Include gdb-index.h.
1306 (Layout::Layout): Initialize gdb_index_data_.
1307 (Layout::init_fixed_output_section): Check for .gdb_index section.
1308 (Layout::add_to_gdb_index): New function. Instantiate.
1309 * layout.h: Add forward declaration for class Gdb_index.
1310 (Layout::add_to_gdb_index): New member function.
1311 (Layout::gdb_index_data_): New data member.
1312 * main.cc: Include gdb-index.h.
1313 (main): Print statistics for gdb index.
1314 * object.cc (Object::section_contents): Move code into
1315 do_section_contents.
1316 (need_decompressed_section): Check for sections needed when building
1317 gdb index.
1318 (build_compressed_section_map): Likewise.
1319 (Sized_relobj_file::do_read_symbols): Need local symbols when building
1320 gdb index.
1321 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
1322 sections; call Layout::add_to_gdb_index.
1323 (Sized_relobj_file::do_decompressed_section_contents): Call
1324 do_section_contents directly.
1325 * object.h (Object::do_section_contents): Adjust parameter list and
1326 return type.
1327 (Object::do_decompressed_section_contents): Call do_section_contents
1328 directly.
1329 (Sized_relobj_file::do_section_contents): Adjust parameter list and
1330 return type.
1331 * options.h (class General_options): Add --gdb-index option.
1332 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
1333 list and return type.
1334 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
1335 * reloc.h (Track_relocs::checkpoint): New function.
1336 (Track_relocs::reset): New function.
1337
1338 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
1339 New test cases.
1340 * testsuite/Makefile.in: Regenerate.
1341 * testsuite/gdb_index_test.cc: New test source file.
1342 * testsuite/gdb_index_test_1.sh: New test source file.
1343 * testsuite/gdb_index_test_2.sh: New test source file.
1344
647f1574
DK
13452012-03-19 Doug Kwan <dougkwan@google.com>
1346
1347 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 1348 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
1349 __exidx_start and __exidx_end. Make symbol table parameter
1350 anonymous as it is not used.
1351 * gold.cc (queue_middle_tasks): Call target hook to define any
1352 target-specific symbols.
1353 * target.h (Target::define_standard_symbols): New method.
1354 (Target::do_define_standard_symbols): Same.
1355 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
1356 * testsuite/Makefile.in: Regenerate.
1357 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
1358 and __exidx_end.
1359 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
1360 relocations are generated for __exidx_start and __exidx_end.
1361
7c6109da
DK
13622012-03-16 Doug Kwan <dougkwan@google.com>
1363
1364 * testsuite/Makefile.am: Disable test initpri3b.
1365 * testsuite/Makefile.in: Regenerate.
1366
7b8957f8
DK
13672012-03-15 Doug Kwan <dougkwan@google.com>
1368
1369 * arm.cc (Target_arm::got_section): Make .got section read-only
1370 if -z now is given.
1371
14dc9ef7
ILT
13722012-03-15 Ian Lance Taylor <iant@google.com>
1373
1374 PR gold/13850
1375 * layout.cc (Layout::make_output_section): Correctly mark
1376 SHT_INIT_ARRAY, et. al., as relro.
1377
fa40b62a
DK
13782012-03-14 Doug Kwan <dougkwan@google.com>
1379
1380 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
1381 dynamic relocations for protected symbols in shared objects.
1382
fd325007
ILT
13832012-03-13 Ian Lance Taylor <iant@google.com>
1384
1385 * resolve.cc (Symbol_table::resolve): When merging common symbols,
1386 keep the larger alignment.
1387
e8dd54e1
CC
13882012-03-12 Cary Coutant <ccoutant@google.com>
1389
1390 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
1391 handling of DW_LNE_define_file.
1392
feb5f3b0
CC
13932012-03-12 Cary Coutant <ccoutant@google.com>
1394
1395 * reduced_debug_output.cc
1396 (Output_reduced_debug_info_section::get_die_end): Add new FORM
1397 codes to switch.
1398
a1fb4256
CC
13992012-02-29 Cary Coutant <ccoutant@google.com>
1400
1401 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
1402
5dd8762a
CC
14032012-02-29 Cary Coutant <ccoutant@google.com>
1404
1405 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
1406 Call Object::decompressed_section_contents.
1407 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
1408 New dtor.
1409 (Sized_dwarf_line_info::buffer_start_): New data member.
1410 * merge.cc (Output_merge_data::do_add_input_section): Call
1411 Object::decompressed_section_contents.
1412 (Output_merge_string::do_add_input_section): Likewise.
1413 * object.cc (need_decompressed_section): New function.
1414 (build_compressed_section_map): Decompress sections needed later.
1415 (Sized_relobj_file::do_decompressed_section_contents): New function.
1416 (Sized_relobj_file::do_discard_decompressed_sections): New function.
1417 * object.h (Object::decompressed_section_contents): New function.
1418 (Object::discard_decompressed_sections): New function.
1419 (Object::do_decompressed_section_contents): New function.
1420 (Object::do_discard_decompressed_sections): New function.
1421 (Compressed_section_info): New type.
1422 (Compressed_section_map): Include decompressed section contents.
1423 (Sized_relobj_file::do_decompressed_section_contents): New function.
1424 (Sized_relobj_file::do_discard_decompressed_sections): New function.
1425
7b5de7ee
CC
14262012-02-16 Cary Coutant <ccoutant@google.com>
1427
1428 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
1429 * testsuite/Makefile.in: Regenerate.
1430
f9fa4a63
CC
14312012-02-14 Cary Coutant <ccoutant@google.com>
1432
1433 * options.cc (General_options::finalize): Disallow -pie and -static.
1434
2c175ebc
DK
14352012-02-03 Doug Kwan <dougkwan@google.com>
1436
1437 * arm.cc (Arm_relocate_functions::abs8,
1438 Arm_relocate_functions::abs16): Use
1439 Bits::has_signed_unsigned_overflow32.
1440 (Arm_relocate_functions::thm_abs8): Correct range of
1441 overflow check.
1442 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
1443 in assertions.
1444
90cff06f
DK
14452012-02-02 Doug Kwan <dougkwan@google.com>
1446
1447 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
1448 position independent outputs, not just shared objects.
1449
63887f3d
L
14502012-01-30 H.J. Lu <hongjiu.lu@intel.com>
1451
1452 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
1453 * configure: Regenerated.
1454
bef2b434
ILT
14552012-01-27 Ian Lance Taylor <iant@google.com>
1456
1457 * reloc.h (Bits): New class with static functions, copied from
1458 namespace utils in arm.cc.
1459 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
1460 instead.
1461
c335b55d
L
14622012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1463
1464 * incremental.cc (write_info_blocks): Correct relocation offset.
1465
41194d9f
L
14662012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1467
1468 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
1469 (Relocate::tls_gd_to_le): Likewise.
1470
1bae613c
L
14712012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1472
1473 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
1474
24482ca0
L
14752012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1476
1477 * configure.ac: Check if -mcmodel=medium works.
1478 * configure: Regenerated.
1479
c2c7840a
CC
14802012-01-24 Cary Coutant <ccoutant@google.com>
1481
1482 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
1483 definition and ...
1484 (read_unsigned_LEB_128_x): ... this new function.
1485 (read_signed_LEB_128): Replaced with inline definition and ...
1486 (read_signed_LEB_128_x): ... this new function.
1487 * int_encoding.h (read_unsigned_LEB_128_x): New function.
1488 (read_unsigned_LEB_128): Add inline definition.
1489 (read_signed_LEB_128_x): New function.
1490 (read_signed_LEB_128): Add inline definition.
1491 * testsuite/Makefile.am (leb128_unittest): New unit test.
1492 * testsuite/Makefile.in: Regenerate.
1493 * testsuite/leb128_unittest.cc: New unit test.
1494
833de760 14952012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
1496
1497 PR gold/13617
1498 * i386.cc (Target_i386::do_code_fill): When using a jmp
1499 instruction, pad with nop instructions.
1500 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
1501
618d6666
L
15022012-01-22 H.J. Lu <hongjiu.lu@intel.com>
1503
1504 * x86_64.cc (gc_process_relocs): Add typename on types used in
1505 template.
1506 (scan_relocs): Likewise.
1507 (relocate_section): Likewise.
1508 (apply_relocation): Likewise.
1509
3660ff06
L
15102012-01-10 H.J. Lu <hongjiu.lu@intel.com>
1511
1512 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
1513 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
1514 under x32.
1515
fc51264f
L
15162012-01-09 H.J. Lu <hongjiu.lu@intel.com>
1517
1518 * x86_64.cc: Initial support for x32.
1519
dd74ae06
CC
15202012-01-03 Cary Coutant <ccoutant@google.com>
1521
1522 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
1523 Use abstract base class for GOT.
1524 * gold/output.h (class Output_data_got_base): New abstract base class.
1525 (class Output_data_got): Derive from new base class, adjust ctors.
1526 (Output_data_got::reserve_slot): Make virtual; rename to
1527 do_reserve_slot; Adjust callers.
1528 * gold/target.h (Sized_target::init_got_plt_for_update): Return
1529 pointer to abstract base class.
1530 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
1531
83896202
ILT
15322011-12-18 Ian Lance Taylor <iant@google.com>
1533
1534 * object.h (Relobj::local_symbol_value): New function.
1535 (Relobj::local_plt_offset): New function.
1536 (Relobj::local_has_got_offset): New function.
1537 (Relobj::local_got_offset): New function.
1538 (Relobj::set_local_got_offset): New function.
1539 (Relobj::do_local_symbol_value): New pure virtual function.
1540 (Relobj::do_local_plt_offset): Likewise.
1541 (Relobj::do_local_has_got_offset): Likewise.
1542 (Relobj::do_local_got_offset): Likewise.
1543 (Relobj::do_set_local_got_offset): Likewise.
1544 (Sized_relobj::do_local_has_got_offset): Rename from
1545 local_has_got_offset.
1546 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
1547 (Sized_relobj::do_set_local_got_offset): Rename from
1548 set_local_got_offset.
1549 (Sized_relobj_file::do_local_plt_offset): Rename from
1550 local_plt_offset.
1551 (Sized_relobj_file::do_local_symbol_value): New function.
1552 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
1553 local_plt_offset.
1554 * output.cc (Output_data_got::Got_entry::write): Change object to
1555 Relobj. Use local_symbol_value.
1556 (Output_data_got::add_global_with_rel): Change rel_dyn to
1557 Output_data_reloc_generic*. Use add_global_generic.
1558 (Output_data_got::add_global_with_rela): Remove. Change all
1559 callers to use add_global_with_rel.
1560 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
1561 Output_data_reloc_generic*. Use add_global_generic.
1562 (Output_data_got::add_global_pair_with_rela): Remove. Change all
1563 callers to use add_global_pair_with_rel.
1564 (Output_data_got::add_local): Change object to Relobj*.
1565 (Output_data_got::add_local_plt): Likewise.
1566 (Output_data_got::add_local_with_rel): Change object to Relobj*,
1567 change rel_dyn to Output_data_reloc_generic*. Use
1568 add_local_generic.
1569 (Output_data_got::add_local_with_rela): Remove. Change all
1570 callers to use all_local_with_rel.
1571 (Output_data_got::add_local_pair_with_rel): Change object to
1572 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
1573 add_output_section_generic.
1574 (Output_data_got::add_local_pair_with_rela): Remove. Change all
1575 callers to use add_local_pair_with_rel.
1576 (Output_data_got::reserve_local): Change object to Relobj*.
1577 * output.h: (class Output_data_reloc_generic): Add pure virtual
1578 declarations for add_global_generic, add_local_generic,
1579 add_output_section_generic.
1580 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
1581 functions for Output_data_reloc_generic. Update declarations for
1582 changes listed in output.cc.
1583 (class Output_data_got): Change template parameter to got_size.
1584 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
1585 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
1586 function.
1587 (Sized_relobj_incr::do_local_plt_offset): New function.
1588 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
1589 add_global_generic.
1590
76677ad0
CC
15912011-12-17 Cary Coutant <ccoutant@google.com>
1592
1593 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
1594 * resolve.cc (Symbol_table::resolve): Likewise.
1595 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
1596 arrays.
1597 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
1598
8b8dd8d5
ILT
15992011-12-16 Ian Lance Taylor <iant@google.com>
1600
1601 * output.h (Output_data_reloc_generic::add): Only call
1602 add_dynamic_reloc if this is a dynamic reloc section.
1603
d55525b9
L
16042011-12-15 H.J. Lu <hongjiu.lu@intel.com>
1605
1606 PR gold/13505
1607 * target-reloc.h (apply_relocation): Replace <64, false> with
1608 <size, big_endian>.
1609
ff81c7c1
NC
16102011-11-25 Nick Clifton <nickc@redhat.com>
1611
1612 * po/it.po: New Italian translation.
1613
628f39be
SA
16142011-11-17 Sterling Augustine <saugustine@google.com>
1615
1616 * script.cc (script_include_directive): Implement.
1617 (read_script_file): New local variables name and search_path. Update
1618 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
1619 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
1620 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
1621
98ef3ea4
SA
16222011-11-11 Sterling Augustine <saugustine@google.com>
1623
1624 * yyscript.y (section_cmd): Add support for INCLUDE directive.
1625 (file_or_sections_cmd): Likewise.
1626
f4a8b6d7
DK
16272011-11-11 Doug Kwan <dougkwan@google.com>
1628
1629 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
1630 if --just-symbols is given.
1631
29ab395d
DK
16322011-11-10 Doug Kwan <dougkwan@google.com>
1633
1634 PR gold/13362
1635 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
1636 when processing data relocs.
1637 * reloc.h (Relocate_functions::rel_unaligned): New method.
1638 (Relocate_functions::pcrel_unaligned): Ditto.
1639 (Relocate_functions::rel32_unaligned): Ditto.
1640 (Relocate_functions::pcrel32_unaligned): Ditto.
1641
2c339f71
DK
16422011-11-09 Doug Kwan <dougkwan@google.com>
1643
1644 PR gold/13362
1645 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
1646 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
1647 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
1648 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
1649 (Relocate_functions::rel_unaligned): New.
1650 (Relocate_functions::rel32_unaligned): New.
1651 * target-reloc.h (relocate_for_relocatable): Add code to handle
1652 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
1653 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
1654 arm_unaligned_reloc_r): New targets.
1655 * testsuite/Makefile.in: Regenerate.
1656 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
1657 linking.
1658
3f3cddf1
ILT
16592011-11-02 Ian Lance Taylor <iant@google.com>
1660
1661 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
1662 NATIVE_LINKER.
1663 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
1664 * options.cc (General_options::finalize): Use library search path
1665 from configure script if specified. If not native and no sysroot,
1666 only search TOOLLIBDIR.
1667 * options.h (Search_directory::Search_directory): Change name to
1668 const std::string&.
1669 (General_options::add_to_library_path_with_sysroot): Change arg to
1670 const std::string&.
1671 * configure, Makefile.in, config.in: Rebuild.
1672
a8e2273b
ILT
16732011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
1674
1675 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
1676 we are working around the ARM1176 Erratum.
1677 * options.h (General_options::fix_arm1176): Add option.
1678 * testsuite/Makefile.am: Add testcases, and keep current ones
1679 working.
1680 * testsuite/Makefile.in: Regenerate.
1681 * testsuite/arm_fix_1176.s: New file.
1682 * testsuite/arm_fix_1176.sh: Likewise.
1683
cd6eab1c
ILT
16842011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
1685
1686 * arm.cc (Target_arm::Target_arm): Remove initialisation of
1687 may_use_blx_.
1688 (Target_arm::may_use_blx): Remove method.
1689 (Target_arm::set_may_use_blx): Likewise.
1690 (Target_arm::may_use_v4t_interworking): New method.
1691 (Target_arm::may_use_v5t_interworking): Likewise.
1692 (Target_arm::may_use_blx_): Remove member variable.
1693 (Arm_relocate_functions::arm_branch_common): Check for v5T
1694 interworking.
1695 (Arm_relocate_functions::thumb_branch_common): Likewise.
1696 (Reloc_stub::stub_type_for_reloc): Likewise.
1697 (Target_arm::do_finalize_sections): Correct interworking checks.
1698 * testsuite/Makefile.am: Add new tests.
1699 * testsuite/Makefile.in: Regenerate.
1700 * testsuite/arm_farcall_arm_arm.s: New test.
1701 * testsuite/arm_farcall_arm_arm.sh: Likewise.
1702 * testsuite/arm_farcall_arm_thumb.s: Likewise.
1703 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
1704 * testsuite/arm_farcall_thumb_arm.s: Likewise.
1705 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
1706 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
1707 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
1708
286adcf4
CC
17092011-10-31 Cary Coutant <ccoutant@google.com>
1710
1711 PR gold/13023
1712 * expression.cc (Expression::eval_with_dot): Add
1713 is_section_dot_assignment parameter.
1714 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
1715 absolute and assigning to dot within a section.
1716 * script-sections.cc
1717 (Output_section_element_assignment::set_section_addresses): Pass
1718 dot_section to set_if_absolute.
1719 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
1720 as is_section_dot_assignment flag to eval_with_dot.
1721 (Output_section_element_dot_assignment::set_section_addresses):
1722 Likewise.
1723 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
1724 parameter. Also set value if relative to dot_section; set the
1725 symbol's output_section.
1726 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
1727 parameter. Adjust all callers.
1728 (Expression::eval_maybe_dot): Likewise.
1729 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
1730 Adjust all callers.
1731 * testsuite/script_test_2.t: Test assignment of an absolute value
1732 to dot within an output section element.
1733
9634ed06
CC
17342011-10-31 Cary Coutant <ccoutant@google.com>
1735
1736 * options.h (class General_options): Add --[no-]gnu-unique options.
1737 * symtab.cc (Symbol_table::sized_write_globals): Convert
1738 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
1739
de4101c7
CC
17402011-10-31 Cary Coutant <ccoutant@google.com>
1741
1742 PR gold/13359
1743 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
1744 unnecessary assertion.
1745 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
1746
7257cc92
ST
17472011-10-31 Sriraman Tallam <tmsriram@google.com>
1748
1749 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1750 gc_mark_symbol.
1751 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1752 gc_mark_symbol.
1753 Change to just keep the section associated with symbol.
1754 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
1755 they are externally visible and --export-dynamic is turned on.
1756 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
1757
bfc34b3f
ILT
17582011-10-19 Ian Lance Taylor <iant@google.com>
1759
1760 PR gold/13163
1761 * script-sections.cc
1762 (Output_section_element_dot_assignment::needs_output_section): New
1763 function.
1764
ea0d8c47
ILT
17652011-10-19 Ian Lance Taylor <iant@google.com>
1766
1767 PR gold/13204
1768 * layout.cc (Layout::segment_precedes): Don't assert failure if a
1769 --section-start option was seen.
1770 * options.h (General_options::any_section_start): New function.
1771
abd242a9
DM
17722011-10-18 David S. Miller <davem@davemloft.net>
1773
1774 PR binutils/13301
1775 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
1776 member to track relocation locations that have moved during TLS
1777 reloc optimizations.
1778 (Target_sparc::Relocate::Relocate): Initialize to NULL.
1779 (Target_sparc::Relocate::relocate): Adjust view down by 4
1780 bytes if it matches reloc_adjust_addr_.
1781 (Target_sparc::Relocate::relocate_tls): Always move the
1782 __tls_get_addr call delay slot instruction forward 4 bytes when
1783 performing relaxation.
1784
bab9090f
CC
17852011-10-18 Cary Coutant <ccoutant@google.com>
1786
1787 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
1788 (Output_file::map_no_anonymous): Check for non-zero
1789 return code from posix_fallocate.
1790
f7c5b166
CC
17912011-10-17 Cary Coutant <ccoutant@google.com>
1792
1793 PR gold/13245
1794 * plugin.cc (is_visible_from_outside): Check for symbols
1795 referenced from dynamic objects.
1796 * resolve.cc (Symbol_table::resolve): Don't count references
1797 from dynamic objects as references from real ELF files.
1798 * testsuite/plugin_test_2.sh: Adjust expected result.
1799
b490c0bb
CC
18002011-10-17 Cary Coutant <ccoutant@google.com>
1801
1802 * gold.cc: Include timer.h.
1803 (queue_middle_tasks): Stamp time.
1804 (queue_final_tasks): Likewise.
1805 * main.cc (main): Store timer in parameters. Print timers
1806 for each pass.
1807 * parameters.cc (Parameters::Parameters): Initialize timer_.
1808 (Parameters::set_timer): New function.
1809 (set_parameters_timer): New function.
1810 * parameters.h (Parameters::set_timer): New function.
1811 (Parameters::timer): New function.
1812 (Parameters::timer_): New data member.
1813 (set_parameters_timer): New function.
1814 * timer.cc (Timer::stamp): New function.
1815 (Timer::get_pass_time): New function.
1816 * timer.h (Timer::stamp): New function.
1817 (Timer::get_pass_time): New function.
1818 (Timer::pass_times_): New data member.
1819
f475cf7b
CC
18202011-10-17 Cary Coutant <ccoutant@google.com>
1821
1822 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
1823 task for members of lib groups.
1824
cdd7e244
CC
18252011-10-17 Cary Coutant <ccoutant@google.com>
1826
1827 PR gold/13288
4f95c8b4 1828 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
1829 (File_read::make_view): Move bounds check (replace with assert)...
1830 (File_read::find_or_make_view): ... to here.
1831
dfb45471
CC
18322011-10-12 Cary Coutant <ccoutant@google.com>
1833
4f95c8b4 1834 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
1835 ::read returns less than requested size.
1836
53bbcc1b
CC
18372011-10-10 Cary Coutant <ccoutant@google.com>
1838
4f95c8b4 1839 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
1840 Initialize defined_count_.
1841 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
1842 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
1843 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
1844 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
1845 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 1846 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
1847 member.
1848 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 1849 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
1850 Return zeroes instead of internal error.
1851
397b129b
CC
18522011-10-10 Cary Coutant <ccoutant@google.com>
1853
1854 PR gold/13249
4f95c8b4 1855 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 1856 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 1857 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
1858 (Output_reloc::type_): Adjust size of bit field.
1859 (Output_reloc::use_plt_offset_): New bit field.
1860 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
1861 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
1862 flag. Adjust all callers.
4f95c8b4 1863 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
1864 creating RELATIVE relocations.
1865
d5698657
NC
18662011-10-10 Nick Clifton <nickc@redhat.com>
1867
1868 * po/es.po: Updated Spanish translation.
1869 * po/fi.po: Updated Finnish translation.
1870
6a59a5c2
DN
18712011-10-03 Diego Novillo <dnovillo@google.com>
1872
1873 * options.cc (parse_uint): Fix dereference of RETVAL.
1874
f0558624
ST
18752011-09-29 Sriraman Tallam <tmsriram@google.com>
1876
1877 * layout.h (section_order_map_): New member.
1878 (get_section_order_map): New member function.
1879 * output.cc (Output_section::add_input_section): Check for patterns
1880 only when --section-ordering-file is specified.
1881 * gold.cc (queue_middle_tasks): Delay updating order of sections till
1882 output_sections have been formed.
1883 * layout.cc (Layout_Layout): Initialize section_order_map_.
1884 * plugin.cc (update_section_order): Store order in order_map. Do not
1885 update the order.
1886 * testsuite/Makefile.am: Add test case for plugin_final_layout.
1887 * testsuite/Makefile.in: Regenerate.
1888 * testsuite/plugin_section_order.c: New file.
1889 * testsuite/plugin_final_layout.cc: New file.
1890 * testsuite/plugin_final_layout.sh: New file.
1891
a7dac153
CC
18922011-09-29 Cary Coutant <ccoutant@google.com>
1893
4f95c8b4 1894 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 1895 Check for NULL.
4f95c8b4 1896 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
1897 symbols during incremental update.
1898 (Symbol_table::add_from_dynobj): Likewise.
1899
eebd87a5
ILT
19002011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1901 Ian Lance Taylor <iant@google.com>
1902
1903 * symtab.cc (Symbol_table::define_special_symbol): Always
1904 canonicalize version string.
1905
403a3331
CC
19062011-09-26 Cary Coutant <ccoutant@google.com>
1907
4f95c8b4
CC
1908 * gold.cc (queue_initial_tasks): Move option checks ...
1909 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
1910 some options; make others fatal.
1911
235061c2
CC
19122011-09-26 Cary Coutant <ccoutant@google.com>
1913
1914 gcc PR lto/47247
1915 * plugin.cc (get_symbols_v2): New function.
1916 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
1917 (is_referenced_from_outside): New function.
1918 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
1919 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
1920 (get_symbols): Pass version parameter.
1921 (get_symbols_v2): New function.
1922 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
1923 parameter.
1924 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
1925 (onload): Add LDPT_GET_SYMBOLS_V2.
1926 (all_symbols_read_hook): Use get_symbols_v2; check for
1927 LDPR_PREVAILING_DEF_IRONLY_EXP.
1928 * testsuite/plugin_test_3.sh: Update expected results.
1929
dc87f620
ILT
19302011-09-23 Simon Baldwin <simonb@google.com>
1931
1932 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
1933 configuration options.
1934 * configure: Regenerate.
1935 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
1936 * Makefile.in: Regenerate.
1937 * testsuite/Makefile.in: Regenerate.
1938
a8279f82
ST
19392011-09-19 Sriraman Tallam <tmsriram@google.com>
1940
1941 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
1942
0c9350c8
CC
19432011-09-19 Cary Coutant <ccoutant@google.com>
1944
1945 * incremental.cc (can_incremental_update): Fix typo in comment.
1946 * incremental.h (can_incremental_update): Likewise.
1947
aa06ae28
CC
19482011-09-18 Cary Coutant <ccoutant@google.com>
1949
1950 * incremental.cc (can_incremental_update): New function.
1951 * incremental.h (can_incremental_update): New function.
1952 * layout.cc (Layout::init_fixed_output_section): Call it.
1953 (Layout::make_output_section): Don't allow patch space in .eh_frame.
1954 * object.cc (Sized_relobj_file::do_layout): Call
1955 can_incremental_update.
1956
ebb300b2
CC
19572011-09-13 Cary Coutant <ccoutant@google.com>
1958
1959 * configure.ac: Check for glibc support for gnu_indirect_function
1960 support with static linking, setting automake conditional
1961 IFUNC_STATIC.
1962 * Makefile.in: Regenerate.
1963 * configure: Regenerate.
1964
1965 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
1966 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
1967 for IFUNC_STATIC.
1968 * testsuite/Makefile.in: Regenerate.
1969
1206d0d5
CC
19702011-09-13 Cary Coutant <ccoutant@google.com>
1971
1972 * incremental.cc (Sized_relobj_incr::do_layout): Call
1973 report_comdat_group for kept comdat sections.
1974 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
1975 * testsuite/Makefile.in: Regenerate.
1976 * testsuite/incr_comdat_test_1.cc: New source file.
1977 * testsuite/incr_comdat_test_2_v1.cc: New source file.
1978 * testsuite/incr_comdat_test_2_v2.cc: New source file.
1979 * testsuite/incr_comdat_test_2_v3.cc: New source file.
1980
40b29874
ILT
19812011-09-13 Ian Lance Taylor <iant@google.com>
1982
1983 * object.cc (Sized_relobj_file::do_layout): Remove unused local
1984 variable external_symbols_offset.
1985
1b045aac
ILT
19862011-09-12 Ian Lance Taylor <iant@google.com>
1987
1988 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
1989 triggered if object has no symbols.
1990
24c6c55a
DM
19912011-09-09 David S. Miller <davem@davemloft.net>
1992
1993 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
1994 (Output_fill_debug_line::do_write): Likewise.
1995
66570254
CC
19962011-08-29 Cary Coutant <ccoutant@google.com>
1997
1998 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
1999 casts to match formatting specs.
2000 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
2001
8ea8cd50
CC
20022011-08-26 Cary Coutant <ccoutant@google.com>
2003
2004 * layout.cc (Free_list::allocate): Provide guarantee of minimum
2005 remaining hole size when allocating.
2006 (Layout::make_output_section): Set fill methods for debug sections.
2007 * layout.h (Free_list::Free_list_node): Move from private to
2008 public.
2009 (Free_list::set_min_hole_size): New function.
2010 (Free_list::begin, Free_list::end): New functions.
2011 (Free_list::min_hole_): New data member.
2012 * output.cc: Include dwarf.h.
2013 (Output_fill_debug_info::do_minimum_hole_size): New function.
2014 (Output_fill_debug_info::do_write): New function.
2015 (Output_fill_debug_line::do_minimum_hole_size): New function.
2016 (Output_fill_debug_line::do_write): New function.
2017 (Output_section::Output_section): Initialize new data member.
2018 (Output_section::set_final_data_size): Ensure patch space is larger
2019 than minimum hole size.
2020 (Output_section::do_write): Fill holes in debug sections.
2021 * output.h (Output_fill): New class.
2022 (Output_fill_debug_info): New class.
2023 (Output_fill_debug_line): New class.
2024 (Output_section::set_free_space_fill): New function.
2025 (Output_section::free_space_fill_): New data member.
2026 * testsuite/Makefile.am (incremental_test_3): Add
2027 --incremental-patch option.
2028 (incremental_test_4): Likewise.
2029 (incremental_test_5): Likewise.
2030 (incremental_test_6): Likewise.
2031 (incremental_copy_test): Likewise.
2032 (incremental_common_test_1): Likewise.
2033 * testsuite/Makefile.in: Regenerate.
2034
7cf80422
NC
20352011-08-26 Nick Clifton <nickc@redhat.com>
2036
2037 * po/es.po: Updated Spanish translation.
2038
c3f7b0e5
CC
20392011-08-01 Cary Coutant <ccoutant@google.com>
2040
2041 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
2042 * gold/testsuite/Makefile.in: Regenerate.
2043 * gold/testsuite/justsyms_exec.c: New source file.
2044 * gold/testsuite/justsyms_lib.c: New source file.
2045
9590bf25
CC
20462011-08-01 Cary Coutant <ccoutant@google.com>
2047
2048 * layout.cc (Layout::set_segment_offsets): Don't realign text
2049 segment if -Ttext was specified.
2050 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
2051 file type.
2052 * object.h (Sized_relobj_file::e_type): New function.
2053 (Sized_relobj_file::e_type_): New data member.
2054 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
2055 base address for ET_EXEC files.
2056 * target.cc (Target::do_make_elf_object_implementation): Allow
2057 ET_EXEC files with --just-symbols option.
2058
dcd8d12e
CC
20592011-07-28 Cary Coutant <ccoutant@google.com>
2060
2061 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
2062 Add thread_number parameter.
2063 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
2064 * workqueue-threads.cc
2065 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
2066 current thread if its thread number is greater than desired thread
2067 count.
2068 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
2069 Add thread_number parameter.
2070 (Workqueue::should_cancel_thread): Likewise.
2071 (Workqueue::find_runnable_or_wait): Pass thread_number to
2072 should_cancel_thread.
2073 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
2074 parameter.
2075
804eb480
ST
20762011-07-22 Sriraman Tallam <tmsriram@google.com>
2077
2078 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
2079 only after checking if it cannot be forced local.
2080 * symtab.h (is_externally_visible): Check if the symbol is not forced
2081 local.
2082
f1ddb600
ILT
20832011-07-15 Ian Lance Taylor <iant@google.com>
2084
2085 * options.h (class General_options): Add --print-output-format.
2086 Move -EL next to -EB, for better --help output.
2087 * target-select.cc: Include <cstdio>, "options.h", and
2088 "parameters.h".
2089 (Target_selector::do_target_bfd_name): New function.
2090 (print_output_format): New function.
2091 * target-select.h (class Target_selector): Update declarations.
2092 (Target_selector::target_bfd_name): New function.
2093 (print_output_format): Declare.
2094 * main.cc: Include "target-select.h".
2095 (main): Handle --print-output-format.
2096 * gold.cc: Include "target-select.h".
2097 (queue_initial_tasks): Handle --print-output-format when there are
2098 no input files.
2099 * parameters.cc (parameters_force_valid_target): Give a better
2100 error message if -EB/-EL does not match target.
2101 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
2102 function.
2103
7d172687
ILT
21042011-07-15 Ian Lance Taylor <iant@google.com>
2105
2106 * i386.cc (class Output_data_plt_i386): Add layout_ field.
2107 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
2108 (Output_data_plt_i386::do_write): Write address of .dynamic
2109 section to first entry in .got.plt section.
2110 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
2111 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
2112 Initialize layout_.
2113 (Output_data_plt_x86_64::do_write): Write address of .dynamic
2114 section to first entry in .got.plt section.
2115 * layout.h (Layout::dynamic_section): New function.
2116
e9552f7e
ST
21172011-07-13 Sriraman Tallam <tmsriram@google.com>
2118
2119 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
2120 to claim_file call.
2121 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
2122 input_section_position_, and input_section_glob_.
2123 (read_layout_from_file): Call function section_ordering_specified.
2124 * layout.h (is_section_ordering_specified): New function.
2125 (section_ordering_specified): New function.
2126 (section_ordering_specified_): New boolean member.
2127 * main.cc(main): Call load_plugins after layout object is defined.
2128 * output.cc (Output_section::add_input_section): Use
2129 function section_ordering_specified to check if section ordering is
2130 needed.
2131 * output.cc (Output_section::add_relaxed_input_section): Use
2132 function section_ordering_specified to check if section ordering is
2133 needed.
2134 (Output_section::update_section_layout): New function.
2135 (Output_section::sort_attached_input_sections): Check if input section
2136 must be reordered.
2137 * output.h (Output_section::update_section_layout): New function.
2138 * plugin.cc (get_section_count): New function.
2139 (get_section_type): New function.
2140 (get_section_name): New function.
2141 (get_section_contents): New function.
2142 (update_section_order): New function.
58797674 2143 (allow_section_ordering): New function.
e9552f7e
ST
2144 (Plugin::load): Add the new interfaces to the transfer vector.
2145 (Plugin_manager::load_plugins): New parameter.
2146 (Plugin_manager::all_symbols_read): New parameter.
2147 (Plugin_manager::claim_file): New parameter. Save the elf object for
2148 unclaimed objects.
2149 (Plugin_manager::get_elf_object): New function.
2150 (Plugin_manager::get_view): Change to directly use the bool to check
2151 if get_view is called from claim_file_hook.
2152 * plugin.h (input_objects): New function
2153 (Plugin__manager::load_plugins): New parameter.
2154 (Plugin_manager::claim_file): New parameter.
2155 (Plugin_manager::get_elf_object): New function.
2156 (Plugin_manager::in_claim_file_handler): New function.
2157 (Plugin_manager::in_claim_file_handler_): New member.
2158 (layout): New function.
2159 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
2160 handler with an extra parameter. Make the elf object before calling
2161 claim_file handler.
2162 * testsuite/plugin_test.c (get_section_count): New function pointer.
2163 (get_section_type): New function pointer.
2164 (get_section_name): New function pointer.
2165 (get_section_contents): New function pointer.
2166 (update_section_order): New function pointer.
2167 (allow_section_ordering): New function pointer.
2168 (onload): Check if the new interfaces exist.
2169
9446efde
ILT
21702011-07-13 Ian Lance Taylor <iant@google.com>
2171
2172 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
2173 relro section.
2174 * x86_64.cc (Target_x86_64::got_section): Likewise.
2175 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
2176 (relro_now_test_SOURCES): New variable.
2177 (relro_now_test_DEPENDENCIES): New variable.
2178 (relro_now_test_LDFLAGS): New variable.
2179 (relro_now_test_LDADD): New variable.
2180 (relro_now_test.so): New target.
2181 * testsuite/Makefile.in: Rebuild.
2182
07aa62f2
ILT
21832011-07-12 Ian Lance Taylor <iant@google.com>
2184
2185 PR gold/12980
2186 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
2187 GLOB_DAT relocation rather than a RELATIVE relocation for a
2188 protected symbol when creating a shared library.
2189 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
2190 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
2191 * testsuite/protected_main_1.cc (main): Test that protected
2192 function has same address.
2193
e2153196
ILT
21942011-07-11 Ian Lance Taylor <iant@google.com>
2195
2196 PR gold/12979
2197 * options.h (class General_options): Add -Bgroup.
2198 * options.cc (General_options::finalize): If -Bgroup is set,
2199 default to --unresolved-symbols=report-all.
2200 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
2201 * target-reloc.h (issue_undefined_symbol_error): Handle
2202 --unresolved-symbols=report-all.
2203
6daf5215
ILT
22042011-07-08 Ian Lance Taylor <iant@google.com>
2205
2206 PR gold/11985
2207 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
2208 if linker script discards key sections.
2209 (Layout::create_dynamic_symtab): Likewise.
2210 (Layout::assign_local_dynsym_offsets): Likewise.
2211 (Layout::sized_create_version_sections): Likewise.
2212 (Layout::create_interp): Likewise.
2213 (Layout::finish_dynamic_section): Likewise.
2214 (Layout::set_dynamic_symbol_size): Likewise.
2215
beabb2c6
ILT
22162011-07-08 Ian Lance Taylor <iant@google.com>
2217
2218 PR gold/12386
2219 * options.h (class General_options): Add --unresolved-symbols.
2220 * target-reloc.h (issue_undefined_symbol_error): Check
2221 --unresolved-symbols. Add comments.
2222
9c16daf1
ILT
22232011-07-08 Ian Lance Taylor <iant@google.com>
2224
2225 * testsuite/odr_violation2.cc (Ordering::operator()): Make
2226 expression more complex.
2227
191f1a2d
ILT
22282011-07-08 Ian Lance Taylor <iant@google.com>
2229
2230 PR gold/11317
2231 * target-reloc.h (issue_undefined_symbol_error): New inline
2232 function, broken out of relocate_section.
2233 (relocate_section): Call issue_undefined_symbol_error.
2234 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
2235 there is no TLS segment if we are about to issue an undefined
2236 symbol error.
2237 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
2238
62855347
ILT
22392011-07-08 Ian Lance Taylor <iant@google.com>
2240
2241 PR gold/12279
2242 * resolve.cc (Symbol_table::should_override): Add fromtype
2243 parameter. Change all callers. Give error when linking together
2244 TLS and non-TLS symbol.
2245 (Symbol_table::should_override_with_special): Add fromtype
2246 parameter. Change all callers.
2247 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
2248 there is no TLS segment if we have reported some errors.
2249 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
2250
67181c72
ILT
22512011-07-08 Ian Lance Taylor <iant@google.com>
2252
2253 PR gold/12372
2254 * target.h (Target::plt_address_for_global): New function.
2255 (Target::plt_address_for_local): New function.
2256 (Target::plt_section_for_global): Remove.
2257 (Target::plt_section_for_local): Remove.
2258 (Target::do_plt_address_for_global): New virtual function.
2259 (Target::do_plt_address_for_local): New virtual function.
2260 (Target::do_plt_section_for_global): Remove.
2261 (Target::do_plt_section_for_local): Remove.
2262 (Target::register_global_plt_entry): Add Symbol_table and Layout
2263 parameters.
2264 * output.cc (Output_data_got::Got_entry::write): Use
2265 plt_address_for_global and plt_address_for_local.
2266 * layout.cc (Layout::add_target_dynamic_tags): Use size and
2267 address of output section.
2268 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
2269 got_irelative_, and irelative_count_ fields. Update
2270 declarations.
2271 (Output_data_plt_i386::has_irelative_section): New function.
2272 (Output_data_plt_i386::entry_count): Add irelative_count_.
2273 (Output_data_plt_i386::set_final_data_size): Likewise.
2274 (class Target_i386): Add got_irelative_ and rel_irelative_
2275 fields. Update declarations.
2276 (Target_i386::Target_i386): Initialize new fields.
2277 (Target_i386::do_plt_address_for_global): New function replacing
2278 do_plt_section_for_global.
2279 (Target_i386::do_plt_address_for_local): New function replacing
2280 do_plt_section_for_local.
2281 (Target_i386::got_section): Create got_irelative_.
2282 (Target_i386::rel_irelative_section): New function.
2283 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
2284 fields. Don't define __rel_iplt_{start,end}.
2285 (Output_data_plt_i386::add_entry): Add symtab and layout
2286 parameters. Change all callers. Use different PLT and GOT for
2287 IFUNC symbols.
2288 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
2289 layout parameters. Change all callers. Use different PLT and
2290 GOT.
2291 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
2292 (Output_data_plt_i386::rel_irelative): New function.
2293 (Output_data_plt_i386::address_for_global): New function.
2294 (Output_data_plt_i386::address_for_local): New function.
2295 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
2296 IRELATIVE GOT when changing IFUNC GOT entries.
2297 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
2298 reloc.
2299 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
2300 if we didn't create an IRELATIVE GOT.
2301 (Target_i386::Relocate::relocate): Use plt_address_for_global and
2302 plt_address_for_local.
2303 (Target_i386::do_dynsym_value): Use plt_address_for_global.
2304 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
2305 got_irelative_, and irelative_count_ fields. Update
2306 declarations.
2307 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
2308 Initialize new fields. Remove symtab parameter. Change all
2309 callers.
2310 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
2311 irelative_count_.
2312 (Output_data_plt_x86_64::has_irelative_section): New function.
2313 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
2314 (class Target_x86_64): Add got_irelative_ and rel_irelative_
2315 fields. Update declarations.
2316 (Target_x86_64::Target_x86_64): Initialize new fields.
2317 (Target_x86_64::do_plt_address_for_global): New function replacing
2318 do_plt_section_for_global.
2319 (Target_x86_64::do_plt_address_for_local): New function replacing
2320 do_plt_section_for_local.
2321 (Target_x86_64::got_section): Create got_irelative_.
2322 (Target_x86_64::rela_irelative_section): New function.
2323 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
2324 all callers. Don't create __rel_iplt_{start,end}.
2325 (Output_data_plt_x86_64::add_entry): Add symtab and layout
2326 parameters. Change all callers. Use different PLT and GOT for
2327 IFUNC symbols.
2328 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
2329 layout parameters. Change all callers. Use different PLT and
2330 GOT.
2331 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
2332 parameters. Change all callers. Use different PLT and GOT for
2333 IFUNC symbols.
2334 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
2335 (Output_data_plt_x86_64::rela_irelative): New function.
2336 (Output_data_plt_x86_64::address_for_global): New function.
2337 (Output_data_plt_x86_64::address_for_local): New function.
2338 (Output_data_plt_x86_64::set_final_data_size): Likewise.
2339 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
2340 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
2341 (Target_x86_64::register_global_plt_entry): Add symtab and layout
2342 parameters.
2343 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
2344 reloc.
2345 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
2346 symbols if we didn't create an IRELATIVE GOT.
2347 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
2348 plt_address_for_local.
2349 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
2350 * testsuite/ifuncvar1.c: New test file.
2351 * testsuite/ifuncvar2.c: New test file.
2352 * testsuite/ifuncvar3.c: New test file.
2353 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
2354 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
2355 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
2356 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
2357 * testsuite/Makefile.in: Rebuild.
2358
33c15b45
CC
23592011-07-07 Cary Coutant <ccoutant@google.com>
2360
2361 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
2362 (two_file_test_1_ndebug.o): Likewise.
2363 (two_file_test_1b_ndebug.o): Likewise.
2364 (two_file_test_2_ndebug.o): Likewise.
2365 (two_file_test_main_ndebug.o): Likewise.
2366 (incremental_test_2): Link with no-debug versions.
2367
f48b5fb7
CC
23682011-07-06 Cary Coutant <ccoutant@google.com>
2369
2370 * gold/incremental.cc
2371 (Output_section_incremental_inputs::write_info_blocks): Check for
2372 hidden and internal symbols.
2373
221597a5
CC
23742011-07-06 Cary Coutant <ccoutant@google.com>
2375
2376 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
2377 Check disposition for startup file.
2378 (Incremental_inputs::report_command_line): Ignore
2379 --incremental-startup-unchanged option.
2380 * options.cc (General_options::parse_incremental_startup_unchanged):
2381 New function.
2382 (General_options::General_options): Initialize new data member.
2383 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
2384 (General_options): Add --incremental-startup-unchanged option.
2385 (General_options::incremental_startup_disposition): New function.
2386 (General_options::incremental_startup_disposition_): New data member.
2387
e24719f6
CC
23882011-07-06 Cary Coutant <ccoutant@google.com>
2389
2390 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
2391 input file index to Script_info ctor.
2392 (Sized_incremental_binary::do_file_has_changed): Find the
2393 command-line argument for files named in scripts.
2394 * incremental.h (Script_info::Script_info): New ctor
2395 with input file index.
2396 (Script_info::input_file_index): New function.
2397 (Script_info::input_file_index_): New data member.
2398 (Incremental_binary::get_library): Add const.
2399 (Incremental_binary::get_script_info): Add const.
2400 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
2401 * testsuite/Makefile.am (incremental_test_5): New test case.
2402 (incremental_test_6): New test case.
2403 * testsuite/Makefile.in: Regenerate.
2404
8f7c81e8
CC
24052011-07-06 Cary Coutant <ccoutant@google.com>
2406
2407 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
2408 debug output when command lines differ.
2409
9fbd3822
CC
24102011-07-06 Cary Coutant <ccoutant@google.com>
2411
2412 * incremental.cc (Incremental_inputs::report_command_line): Ignore
2413 --incremental-patch option.
2414 * layout.cc (Free_list::allocate): Extend allocation beyond original
2415 end if enabled.
2416 (Layout::make_output_section): Mark sections that should get
2417 patch space.
2418 * options.cc (parse_percent): New function.
2419 * options.h (parse_percent): New function.
2420 (DEFINE_percent): New macro.
2421 (General_options): Add --incremental-patch option.
2422 * output.cc (Output_section::Output_section): Initialize new data
2423 members.
2424 (Output_section::add_input_section): Print section name when out
2425 of patch space.
2426 (Output_section::add_output_section_data): Likewise.
2427 (Output_section::set_final_data_size): Add patch space when
2428 doing --incremental-full.
2429 (Output_section::do_reset_address_and_file_offset): Remove patch
2430 space.
2431 (Output_segment::set_section_list_addresses): Print debug output
2432 only if --incremental-update.
2433 * output.h (Output_section::set_is_patch_space_allowed): New function.
2434 (Output_section::is_patch_space_allowed_): New data member.
2435 (Output_section::patch_space_): New data member.
2436 * parameters.cc (Parameters::incremental_full): New function.
2437 * parameters.h (Parameters::incremental_full): New function
2438 * testsuite/Makefile.am (incremental_test_2): Add test for
2439 --incremental-patch option.
2440 * testsuite/Makefile.in: Regenerate.
2441 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
2442 (t18): Remove function body.
2443
f6cccc2c
DK
24442011-07-05 Doug Kwan <dougkwan@google.com>
2445
2446 PR gold/12771
2447 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
2448 Arm_Address type for relocation result.
2449 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
2450 overflow check.
2451 (Arm_relocate_functions::abs32): Use unaligned access.
2452 (Arm_relocate_functions::rel32): Ditto.
2453 (Arm_relocate_functions::prel31): Ditto.
2454 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
2455 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
2456 static data relocations.
2457 * testsuite/Makefile.in: Regnerate.
2458 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
2459
28a13fec
ILT
24602011-07-05 Ian Lance Taylor <iant@google.com>
2461
2462 PR gold/12392
2463 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
2464 symbols if necessary.
2465 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
2466
24d47b34
ILT
24672011-07-05 Ian Lance Taylor <iant@google.com>
2468
2469 PR gold/12952
2470 * resolve.cc (Symbol::override_base_with_special): Simply override
2471 version with special symbol version, ignoring previous version.
2472
41f9cbbe
ILT
24732011-07-05 Ian Lance Taylor <iant@google.com>
2474
2475 * object.cc (Sized_relobj_file::include_section_group): Add
2476 information to comment about signature location.
2477
886288f1
ILT
24782011-07-02 Ian Lance Taylor <iant@google.com>
2479
2480 PR gold/12957
2481 * options.h (class General_options): Add -f and -F.
2482 * options.cc (General_options::finalize): Fatal error if -f/-F
2483 are used without -shared.
2484 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
2485
ae3a6d4f
ILT
24862011-07-02 Ian Lance Taylor <iant@google.com>
2487
2488 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
2489
21131061
ILT
24902011-07-01 Ian Lance Taylor <iant@google.com>
2491
2492 PR gold/12525
2493 PR gold/12952
2494 * resolve.cc (Symbol::override_base_with_special): Don't override
2495 the version if the overriding symbol has a different name.
2496 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
2497 all callers. If we give an error about an undefined version,
2498 define the base version if necessary.
2499 * dynobj.h (class Versions): Update declaration.
2500 * testsuite/weak_alias_test_5.cc: New file.
2501 * testsuite/weak_alias_test.script: New file.
2502 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
2503 and versioned_alias have the right value, and call t2.
2504 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
2505 weak_alias_test_5.so.
2506 (weak_alias_test_LDADD): Likewise.
2507 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
2508 * testsuite/Makefile.in: Rebuild.
2509
611062c0
ILT
25102011-07-01 Ian Lance Taylor <iant@google.com>
2511
2512 PR gold/12525
2513 * options.h (class General_options): Support -z notext.
2514 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
2515 -Wl,-z,notext.
2516 (two_file_shared_nonpic.so): Likewise.
2517 (two_file_shared_mixed.so): Likewise.
2518 (two_file_shared_mixed_1.so): Likewise.
2519 (weak_undef_lib_nonpic.so): Likewise.
2520 (alt/weak_undef_lib_nonpic.so): Likewise.
2521 (tls_test_shared_nonpic.so): Likewise.
2522 * testsuite/Makefile.in: Rebuild.
2523
328c7c2f
ILT
25242011-07-01 Ian Lance Taylor <iant@google.com>
2525
2526 PR gold/12525
2527 * configure.ac: Test whether static linking works, setting
2528 the automake conditional HAVE_STATIC.
2529 * testsuite/Makefile.am: Disable tests using -static if
2530 HAVE_STATIC is not true.
2531 * configure, testsuite/Makefile.in: Rebuild.
2532
02d7cd44
ILT
25332011-07-01 Ian Lance Taylor <iant@google.com>
2534
2535 PR gold/12525
2536 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
2537 Assert if we see DW_EH_PE_indirect.
2538 * target.h (Target::ehframe_datarel_base): New function.
2539 (Target::do_ehframe_datarel_base): New target function.
2540 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
2541 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
2542 function.
2543
07a60597
ILT
25442011-07-01 Ian Lance Taylor <iant@google.com>
2545
2546 PR gold/12571
2547 * options.h (class General_options): Add
2548 --ld-generated-unwind-info.
2549 * ehframe.cc (Fde::write): Add address parameter. Change all
2550 callers. If associated with PLT, fill in address and size.
2551 (Cie::set_output_offset): Only add merge mapping if there is an
2552 object.
2553 (Cie::write): Add address parameter. Change all callers.
2554 (Eh_frame::add_ehframe_for_plt): New function.
2555 * ehframe.h (class Fde): Update declarations. Move shndx_ and
2556 input_offset_ fields into union u_, with new plt field.
2557 (Fde::Fde): Adjust for new union field.
2558 (Fde::Fde) [Output_data version]: New constructor.
2559 (Fde::add_mapping): Only add merge mapping if there is an object.
2560 (class Cie): Update declarations.
2561 (class Eh_frame): Declare add_ehframe_for_plt.
2562 * layout.cc (Layout::layout_eh_frame): Break out code into
2563 make_eh_frame_section, and call it.
2564 (Layout::make_eh_frame_section): New function.
2565 (Layout::add_eh_frame_for_plt): New function.
2566 * layout.h (class Layout): Update declarations.
2567 * merge.cc (Merge_map::add_mapping): Add assertion.
2568 * i386.cc: Include "dwarf.h".
2569 (class Output_data_plt_i386): Make first_plt_entry,
2570 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
2571 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
2572 and plt_eh_frame_fde.
2573 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
2574 boundary. Call add_eh_frame_for_plt if appropriate.
2575 * x86_64.cc: Include "dwarf.h".
2576 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
2577 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
2578 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
2579 and plt_eh_frame_fde.
2580 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
2581 appropriate.
2582
14788a3f
ILT
25832011-06-29 Ian Lance Taylor <iant@google.com>
2584
2585 PR gold/12629
2586 * object.cc (Sized_relobj_file::layout_section): Change shdr
2587 parameter to be const.
2588 (Sized_relobj_file::layout_eh_frame_section): New function, broken
2589 out of do_layout.
2590 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
2591 appropriate. Call layout_eh_frame_section.
2592 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
2593 sections.
2594 * object.h (class Sized_relobj_file): Update declarations.
2595
6c21fce1
ILT
25962011-06-29 Ian Lance Taylor <iant@google.com>
2597
37e41b03 2598 PR gold/12652
6c21fce1
ILT
2599 * script.cc (Token::integer_value): Accept trailing M/m/K/k
2600 modifier.
2601 (Lex::gather_token): Accept trailing M/m/K/k for integers.
2602
4d5e4e62
ILT
26032011-06-29 Ian Lance Taylor <iant@google.com>
2604
2605 PR gold/12675
2606 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
2607 SHT_X86_64_UNWIND.
2608 * layout.cc (Layout::layout_eh_frame): Likewise.
2609
886f533a
ILT
26102011-06-29 Ian Lance Taylor <iant@google.com>
2611
2612 PR gold/12695
2613 * layout.cc (Layout::symtab_section_shndx): New function.
2614 * layout.h (class Layout): Declare symtab_section_shndx.
2615 * output.cc (Output_section::write_header): Call it.
2616
f3ae1b28
ILT
26172011-06-29 Ian Lance Taylor <iant@google.com>
2618
2619 PR gold/12818
2620 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
2621 symbols which are not used in a relocation.
2622
aecf301f
ILT
26232011-06-28 Ian Lance Taylor <iant@google.com>
2624
2625 PR gold/12898
2626 * layout.cc (Layout::segment_precedes): Don't crash if a linker
2627 script create indistinguishable segments.
2628 (Layout::set_segment_offsets): Use stable_sort when sorting
2629 segments. Pass this to Compare_segments constructor.
2630 * layout.h (class Layout): Make segment_precedes non-static.
2631 (class Compare_segments): Change from struct to class. Add
2632 layout_ field. Add constructor.
2633 * script-sections.cc
2634 (Script_sections::attach_sections_using_phdrs_clause): Rename
2635 local orphan to is_orphan. Don't report failure to put empty
2636 section in segment. On attachment failure, report name of
2637 section, and attach to first PT_LOAD segment.
2638
03ef7571
ILT
26392011-06-28 Ian Lance Taylor <iant@google.com>
2640
2641 PR gold/12934
2642 * target-select.cc (Target_selector::Target_selector): Add
2643 emulation parameter. Change all callers.
2644 (select_target_by_bfd_name): Rename from select_target_by_name.
2645 Change all callers.
2646 (select_target_by_emulation): New function.
2647 (supported_emulation_names): New function.
2648 * target-select.h (class Target_selector): Add emulation_ field.
2649 Update declarations.
2650 (Target_selector::recognize_by_bfd_name): Rename from
2651 recognize_by_name. Change all callers.
2652 (Target_selector::supported_bfd_names): Rename from
2653 supported_names. Change all callers.
2654 (Target_selector::recognize_by_emulation): New function.
2655 (Target_selector::supported_emulations): New function.
2656 (Target_selector::emulation): New function.
2657 (Target_selector::do_recognize_by_bfd_name): Rename from
2658 do_recognize_by_name. Change all callers.
2659 (Target_selector::do_supported_bfd_names): Rename from
2660 do_supported_names. Change all callers.
2661 (Target_selector::do_recognize_by_emulation): New function.
2662 (Target_selector::do_supported_emulations): New function.
2663 (select_target_by_bfd_name): Change name in declaration.
2664 (select_target_by_emulation): Declare.
2665 (supported_emulation_names): Declare.
2666 * parameters.cc (parameters_force_valid_target): Try to find
2667 target based on emulation from -m option.
2668 * options.h (class General_options): Change doc string for -m.
2669 * options.cc (help): Print emulations.
2670 (General_options::parse_V): Likewise.
2671 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
2672 Add emulation parameter. Change all callers.
2673
200b2bb9
ILT
26742011-06-28 Ian Lance Taylor <iant@google.com>
2675
2676 * target.h (class Target): Add osabi_ field.
2677 (Target::osabi): New function.
2678 (Target::set_osabi): New function.
2679 (Target::Target): Initialize osabi_.
2680 (Target::do_adjust_elf_header): Make pure virtual.
2681 (Sized_target::do_adjust_elf_header): Declare.
2682 * target.cc (Sized_target::do_adjust_elf_header): New function.
2683 (class Sized_target): Instantiate all versions.
2684 * freebsd.h (class Target_freebsd): Remove.
2685 (Target_selector_freebsd::do_recognize): Call set_osabi on
2686 Target.
2687 (Target_selector_freebsd::do_recognize_by_name): Likewise.
2688 (Target_selector_freebsd::set_osabi): Remove.
2689 * i386.cc (class Target_i386): Inherit from Sized_target rather
2690 than Target_freebsd.
2691 * x86_64.cc (class Target_x86_64): Likewise.
2692
b3ce541e
ILT
26932011-06-28 Ian Lance Taylor <iant@google.com>
2694
2695 * target.h (Target::can_check_for_function_pointers): Rewrite.
2696 Make non-virtual.
2697 (Target::can_icf_inline_merge_sections): Likewise.
2698 (Target::section_may_have_icf_unsafe_poineters): Likewise.
2699 (Target::Target_info): Add can_icf_inline_merge_sections field.
2700 (Target::do_can_check_for_function_pointers): New virtual
2701 function.
2702 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
2703 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
2704 from can_check_for_function_pointers, move in file.
2705 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
2706 section_may_have_icf_unsafe_poineters, move in file.
2707 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
2708 * i386.cc (Target_i386::do_can_check_for_function_pointers):
2709 Rename from can_check_for_function_pointers, move in file.
2710 (Target_i386::can_icf_inline_merge_sections): Remove.
2711 (Target_i386::i386_info): Initialize
2712 can_icf_inline_merge_sections.
2713 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
2714 Initialize can_icf_inline_merge_sections.
2715 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
2716 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
2717 Rename from can_check_for_function_pointers, move in file.
2718 (Target_x86_64::can_icf_inline_merge_sections): Remove.
2719 (Target_x86_64::x86_64_info): Initialize
2720 can_icf_inline_merge_sections.
2721 * testsuite/testfile.cc (Target_test::test_target_info):
2722 Likewise.
2723 * icf.cc (get_section_contents): Correct formatting.
2724
6d1c4efb
ILT
27252011-06-27 Ian Lance Taylor <iant@google.com>
2726
2727 * symtab.cc (Symbol::versioned_name): New function.
2728 (Symbol_table::add_to_final_symtab): Use versioned_name when
2729 appropriate.
2730 (Symbol_table::sized_write_symbol): Likewise.
2731 * symtab.h (class Symbol): Declare versioned_name.
2732 * stringpool.h (class Stringpool_template): Add variant of add
2733 which takes a std::basic_string.
2734 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
2735 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
2736 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
2737 (ver_test_12.o): New target.
2738 * testsuite/Makefile.in: Rebuild.
2739
57eb9b50
DK
27402011-06-27 Doug Kwan <dougkwan@google.com>
2741
2742 * arm.cc (Arm_relocate_functions::thm_jump8,
2743 Arm_relocate_functions::thm_jump11): Use a wider signed
2744 type to compute offset.
2745 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
2746 arm_thm_jump8.
2747 * testsuite/Makefile.in: Regenerate.
2748 * testsuite/arm_branch_in_range.sh: Check test results of
2749 arm_thm_jump11 and arm_thm_jump8.
2750 * testsuite/arm_thm_jump11.s: New test source file.
2751 * testsuite/arm_thm_jump11.t: New linker script.
2752 * testsuite/arm_thm_jump8.s: New test source file.
2753 * testsuite/arm_thm_jump8.t: New linker script.
2754
487b39df
ILT
27552011-06-24 Ian Lance Taylor <iant@google.com>
2756
2757 * layout.cc: Include "object.h".
2758 (ctors_sections_in_init_array): New static variable.
2759 (Layout::is_ctors_in_init_array): New function.
2760 (Layout::layout): Add entry to ctors_sections_in_init_array if
2761 appropriate.
2762 * layout.h (class Layout): Declare is_ctors_in_init_array.
2763 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
2764 is_ctors_reverse_view is set.
2765 (Sized_relobj_file::write_sections): Add layout parameter. Change
2766 all callers. Set is_ctors_reverse_view field of View_size.
2767 (Sized_relobj_file::reverse_words): New function.
2768 * object.h (Sized_relobj_file::View_size): Add
2769 is_ctors_reverse_view field.
2770 (class Sized_relobj_file): Update declarations.
2771 * testsuite/initpri3.c: New test.
2772 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
2773 initpri3b.
2774 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
2775 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
2776 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
2777 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
2778 * testsuite/Makefile.in: Rebuild.
2779
472076e4
CC
27802011-06-24 Cary Coutant <ccoutant@google.com>
2781
2782 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
2783 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
2784 (debug_msg_cdebug.err): New targets.
2785 * testsuite/Makefile.in: Regenerate.
2786 * testsuite/debug_msg.sh: Check output of link with compressed debug.
2787 Fix checks for link with shared library.
2788
a60af0db
DK
27892011-06-24 Doug Kwan <dougkwan@google.com>
2790
2791 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
2792 skip empty text sections.
2793 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
2794
5393d741
ILT
27952011-06-22 Ian Lance Taylor <iant@google.com>
2796
2797 PR gold/12910
2798 * options.h (class General_options): Add --ctors-in-init-array.
2799 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
2800 friends as SHT_PROGBITS for merging sections.
2801 (Layout::layout): Remove special handling of .init_array and
2802 friends. Don't sort if doing relocatable link. Sort for .ctors
2803 and .dtors if ctors_in_init_array.
2804 (Layout::make_output_section): Force correct section types for
2805 .init_array and friends. Don't sort if doing relocatable link,
2806 Don't sort .ctors and .dtors if ctors_in_init_array.
2807 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
2808 (Layout::output_section_name): Add relobj parameter. Change all
2809 callers. Handle .ctors. and .dtors. in code rather than table.
2810 Handle .ctors and .dtors if ctors_in_init_array.
2811 (Layout::match_file_name): New function, moved from output.cc.
2812 * layout.h (class Layout): Update declarations.
2813 * output.cc: Include "layout.h".
2814 (Input_section_sort_entry::get_priority): New function.
2815 (Input_section_sort_entry::match_file_name): Just call
2816 Layout::match_file_name.
2817 (Output_section::Input_section_sort_init_fini_compare::operator()):
2818 Handle .ctors and .dtors. Sort by explicit priority rather than
2819 by name.
2820 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
2821 * testsuite/initpri2.c: New test.
2822 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
2823 (check_PROGRAMS): Add initpri2.
2824 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
2825 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
2826 * configure, testsuite/Makefile.in: Rebuild.
2827
e1f74f98
ILT
28282011-06-19 Ian Lance Taylor <iant@google.com>
2829
2830 PR gold/12880
2831 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
2832 .interp section to a PT_INTERP segment even if we have seen a
2833 --dynamic-linker option. Don't do it if we have seen a PHDRS
2834 clause in a linker script.
2835 (Layout::finalize): Don't create a .interp section if we've
2836 already create a PT_INTERP segment.
2837 (Layout::create_interp): Always call choose_output_section (revert
2838 patch of 2011-06-17). Don't create PT_INTERP segment.
2839 * script-sections.cc
2840 (Script_sections::create_note_and_tls_segments): Add a .interp
2841 section to a PT_INTERP segment even if we have seen a
2842 --dynamic-linker option.
2843
766f91bb
ILT
28442011-06-18 Ian Lance Taylor <iant@google.com>
2845
2846 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
2847 merely because a non-PT_LOAD segment has a dynamic reloc.
2848
0d212c3a
ILT
28492011-06-18 Ian Lance Taylor <iant@google.com>
2850
2851 * layout.cc (Layout::finish_dynamic_section): Don't create
2852 DT_FLAGS entry if not needed.
2853
911a5072
ILT
28542011-06-18 Ian Lance Taylor <iant@google.com>
2855
2856 PR gold/12745
2857 * layout.cc (Layout::layout_eh_frame): Correct handling of
2858 writable .eh_frame section.
2859
534b4e5f
ILT
28602011-06-17 Ian Lance Taylor <iant@google.com>
2861
2862 PR gold/12893
2863 * resolve.cc (Symbol_table::resolve): Don't give an error if a
2864 symbol is redefined with the exact same object and value.
2865
10b4f102
ILT
28662011-06-17 Ian Lance Taylor <iant@google.com>
2867
2868 PR gold/12880
2869 * layout.h (class Layout): Add interp_segment_ field.
2870 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
2871 (Layout::attach_allocated_section_to_segment): If making shared
2872 library, put .interp section in PT_INTERP segment.
2873 (Layout::finalize): Also call create_interp if -dynamic-linker
2874 option was used.
2875 (Layout::create_interp): Assert that there is no PT_INTERP
2876 segment. If not using a SECTIONS clause, use make_output_section.
2877 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
2878 * script-sections.cc
2879 (Script_sections::create_note_and_tls_segments): If making shared
2880 library, put .interp section in PT_INTERP segment.
2881
a29b0dad
ILT
28822011-06-17 Ian Lance Taylor <iant@google.com>
2883
e588ea8d
ILT
2884 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
2885 when making a shared library.
2886
28872011-06-17 Ian Lance Taylor <iant@google.com>
2888
2889 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
2890 parameter. Change all callers. Don't issue warning about PC32
2891 against locally defined symbol.
a29b0dad 2892
9d3b0698
ILT
28932011-06-16 Ian Lance Taylor <iant@google.com>
2894
2895 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
2896 occurs in same object.
2897
85b0f90c
AM
28982011-06-14 Alan Modra <amodra@gmail.com>
2899
2900 * po/POTFILES.in: Regenerate.
2901
a94907d9
ILT
29022011-06-09 Ian Lance Taylor <iant@google.com>
2903
2904 * script-sections.cc
2905 (Orphan_output_section::set_section_addresses): For a relocatable
2906 link set address to 0.
2907
4fb3a1c3
CC
29082011-06-09 Cary Coutant <ccoutant@google.com>
2909
2910 PR gold/12804
2911 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
2912 used with --compress-debug-sections.
2913 * gold/object.cc (Sized_relobj_file::do_layout): Report
2914 uncompressed size of compressed input sections.
2915
61220854
CC
29162011-06-08 Cary Coutant <ccoutant@google.com>
2917
2918 PR gold/12804
2919 * testsuite/two_file_test_2_v1.cc: Change initialization of
2920 v2 to keep it in .data.
2921
e6455dfb
CC
29222011-06-07 Cary Coutant <ccoutant@google.com>
2923
2924 * common.cc (Symbol_table::do_allocate_commons_list): Call
2925 gold_fallback.
2926 * errors.cc (Errors::fatal): Adjust call to gold_exit.
2927 (Errors::fallback): New function.
2928 (gold_fallback): New function.
2929 * errors.h (Errors::fallback): New function.
2930 * gold.cc (gold_exit): Change status parameter to enum; adjust
2931 all callers.
2932 (queue_initial_tasks): Call gold_fallback.
2933 * gold.h: Include cstdlib.
2934 (Exit_status): New enum type.
2935 (gold_exit): Change status parameter to enum.
2936 (gold_fallback): New function.
2937 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
2938 (Layout::create_symtab_sections): Likewise.
2939 (Layout::create_shdrs): Likewise.
2940 * main.cc (main): Adjust call to gold_exit.
2941 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
2942 (Output_data_got::add_got_entry_pair): Likewise.
2943 (Output_section::add_input_section): Likewise.
2944 (Output_section::add_output_section_data): Likewise.
2945 (Output_segment::set_section_list_addresses): Likewise.
2946 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
2947
fb0e076f
CC
29482011-06-07 Cary Coutant <ccoutant@google.com>
2949
2950 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
2951 for incremental links.
2952 * output.cc (Output_segment::set_section_list_addresses): Remove
2953 FIXME and test for TLS or BSS.
2954
a5ee4d5d
CC
29552011-06-07 Cary Coutant <ccoutant@google.com>
2956
2957 * testsuite/Makefile.am: Add incremental_copy_test,
2958 incremental_common_test_1.
2959 * testsuite/Makefile.in: Regenerate.
2960 * testsuite/common_test_1_v1.c: New source file.
2961 * testsuite/common_test_1_v2.c: New source file.
2962 * testsuite/copy_test_v1.cc: New source file.
2963
5146f448
CC
29642011-06-07 Cary Coutant <ccoutant@google.com>
2965
2966 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
2967 update, allocate common from bss section's free list.
2968 * incremental-dump.cc (dump_incremental_inputs): Print flag for
2969 linker-defined symbols.
2970 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
2971 Skip GOT and PLT entries that are no longer referenced.
2972 (Output_section_incremental_inputs::write_info_blocks): Mark
2973 linker-defined symbols.
2974 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
2975 * output.cc (Output_section::allocate): New function.
2976 * output.h (Output_section::allocate): New function.
2977 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
2978 linker-defined symbols.
2979 (Symbol::override_base_with_special): Copy is_predefined_ flag.
2980 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
2981 (Symbol::init_base_output_data): Likewise.
2982 (Symbol::init_base_output_segment): Likewise.
2983 (Symbol::init_base_constant): Likewise.
2984 (Sized_symbol::init_output_data): Likewise.
2985 (Sized_symbol::init_output_segment): Likewise.
2986 (Sized_symbol::init_constant): Likewise.
2987 (Symbol_table::do_define_in_output_data): Likewise.
2988 (Symbol_table::do_define_in_output_segment): Likewise.
2989 (Symbol_table::do_define_as_constant): Likewise.
2990 * symtab.h (Symbol::is_predefined): New function.
2991 (Symbol::init_base_output_data): Add is_predefined parameter.
2992 (Symbol::init_base_output_segment): Likewise.
2993 (Symbol::init_base_constant): Likewise.
2994 (Symbol::is_predefined_): New data member.
2995 (Sized_symbol::init_output_data): Add is_predefined parameter.
2996 (Sized_symbol::init_output_segment): Likewise.
2997 (Sized_symbol::init_constant): Likewise.
2998 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
2999
26d3c67d
CC
30002011-06-07 Cary Coutant <ccoutant@google.com>
3001
3002 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
3003 instead of emit_copy_reloc.
3004 (Copy_relocs::emit_copy_reloc): Refactor.
3005 (Copy_relocs::make_copy_reloc): New function.
3006 (Copy_relocs::add_copy_reloc): Remove.
3007 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
3008 section.
3009 (Copy_relocs::make_copy_reloc): New function.
3010 (Copy_relocs::add_copy_reloc): Remove.
3011 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
3012 unchanged input files.
3013 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
3014 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
3015 Reserve BSS space for COPY relocations.
3016 (Sized_incremental_binary::do_emit_copy_relocs): New function.
3017 (Output_section_incremental_inputs::write_info_blocks): Record
3018 whether a symbol is copied from a shared object.
3019 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
3020 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
3021 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
3022 (Incremental_input_entry_reader::get_output_symbol_index): Add
3023 is_copy parameter.
3024 (Incremental_binary::emit_copy_relocs): New function.
3025 (Incremental_binary::do_emit_copy_relocs): New function.
3026 (Sized_incremental_binary::Sized_incremental_binary): Initialize
3027 new data member.
3028 (Sized_incremental_binary::add_copy_reloc): New function.
3029 (Sized_incremental_binary::do_emit_copy_relocs): New function.
3030 (Sized_incremental_binary::Copy_reloc): New struct.
3031 (Sized_incremental_binary::Copy_relocs): New typedef.
3032 (Sized_incremental_binary::copy_relocs_): New data member.
3033 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
3034 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
3035 * target.h (Sized_target::emit_copy_reloc): New function.
3036 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
3037
7cdb37d9
CC
30382011-06-02 Cary Coutant <ccoutant@google.com>
3039
3040 PR gold/12163
3041 * gold/archive.cc (Archive::Archive): Initialize new data member.
3042 (Archive::include_all_members): Return if archive has already been
3043 included.
3044 * gold/archive.h (Archive::include_all_members_): New data member.
3045
cc643b88
NC
30462011-06-02 Nick Clifton <nickc@redhat.com>
3047
3048 * dynobj.h: Fix spelling mistake in comment.
3049 * output.cc: Likewise.
3050
f62a3ca7 30512011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 3052 Asier Llano
f62a3ca7
DK
3053
3054 PR gold/12826
cc643b88 3055 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
3056 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
3057 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
3058 redundant arm_exidx_test.so.
3059 * testsuite/Makefile.in: Regenerate.
3060 (check_SCRIPTS): Add pr12826.sh
3061 (check_DATA): Add pr12826.stdout
3062 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
3063 * testsuite/pr12826.sh: New file.
3064 * testsuite/pr12826_1.s: Ditto.
3065 * testsuite/pr12826_1.s: Ditto.
3066
8dbe1edc
ILT
30672011-05-30 Ian Lance Taylor <iant@google.com>
3068
3069 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
3070 sections.
3071
c49875be
ILT
30722011-05-29 Ian Lance Taylor <iant@google.com>
3073
3074 PR gold/12804
3075 * testsuite/Makefile.am: Use different file name for two_file_test
3076 temporary file for each incremental test.
3077 * testsuite/Makefile.in: Rebuild.
3078
69d53f7a
ILT
30792011-05-29 Ian Lance Taylor <iant@google.com>
3080
3081 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
3082 binary input file is empty.
3083
41d0ab5f
ILT
30842011-05-27 Ian Lance Taylor <iant@google.com>
3085
3086 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
3087 (ver_test_9.so): Likewise.
3088 * testsuite/Makefile.in: Rebuild.
3089
89d8a36b
CC
30902011-05-26 Cary Coutant <ccoutant@google.com>
3091
3092 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
3093 * incremental.cc (Incremental_inputs::report_input_section): Fix
3094 comment, indentation.
3095 (Incremental_inputs::report_comdat_group): New function.
3096 (Output_section_incremental_inputs::set_final_data_size): Adjust size
3097 of data for incremental input file entry.
3098 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
3099 group count, COMDAT group signatures.
3100 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
3101 an unchanged input file.
3102 * incremental.h (Incremental_object_entry::Incremental_object_entry):
3103 Initialize new data member.
3104 (Incremental_object_entry::add_comdat_group): New function.
3105 (Incremental_object_entry::get_comdat_group_count): New function.
3106 (Incremental_object_entry::get_comdat_signature_key): New function.
3107 (Incremental_object_entry::groups_): New data member.
3108 (Incremental_inputs::report_comdat_group): New function.
3109 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
3110 data for incremental input file entry.
3111 (Incremental_input_entry_reader::get_comdat_group_count): New function.
3112 (Incremental_input_entry_reader::get_input_section): Adjust size of
3113 data for incremental input file entry.
3114 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
3115 (Incremental_input_entry_reader::get_comdat_group_signature): New
3116 function.
3117 * object.cc (Sized_relobj::include_section_group): Report kept
3118 COMDAT groups for incremental links.
3119
1706a06f
ILT
31202011-05-24 David Meyer <pdox@google.com>
3121
3122 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
3123 with name parameter. Add found_name parameter.
3124 * fileread.cc (Input_file::find_file): Adjust code accordingly.
3125 * dirsearch.h (class Dirsearch): Update declaration.
3126
a10ae760
ILT
31272011-05-24 Ian Lance Taylor <iant@google.com>
3128
3129 * archive.cc (Library_base::should_include_member): Pull in object
3130 from archive if it defines the entry symbol.
3131 * parameters.cc (Parameters::entry): New function.
3132 * parameters.h (class Parameters): Declare entry.
3133 * output.h (class Output_file_header): Remove entry_ field.
3134 * output.cc (Output_file_header::Output_file_header): Remove entry
3135 parameter. Change all callers.
3136 (Output_file_header::entry): Use parameters->entry.
3137 * gold.cc (queue_middle_tasks): Likewise.
3138 * plugin.cc (Plugin_hook::run): Likewise.
3139
aa92d6ed
CC
31402011-05-24 Cary Coutant <ccoutant@google.com>
3141
3142 * gold.cc (queue_initial_tasks): Pass incremental base filename
3143 to Output_file::open_base_file; don't print error message.
3144 * incremental-dump.cc (main): Adjust call to
3145 Output_file::open_for_modification.
3146 * incremental-dump.cc (main): Likewise.
3147 * incremental.cc (Incremental_inputs::report_command_line):
3148 Ignore --incremental-base option when comparing command lines.
3149 Ignore parameter when given as separate argument.
3150 * options.h (class General_options): Add --incremental-base.
3151 * output.cc (Output_file::Output_file):
3152 (Output_file::open_base_file): Add base_name and writable parameters;
3153 read base file into new file; print error message here.
3154 (Output_file::map_no_anonymous): Add writable parameter; adjust all
3155 callers.
3156 * output.h (Output_file::open_for_modification): Rename to...
3157 (Output_file::open_base_file): ...this; add base_name and
3158 writable parameters; adjust all callers.
3159 (Output_file::map_no_anonymous): Add writable parameter; adjust all
3160 callers.
3161 * testsuite/Makefile.am (incremental_test_4): Test
3162 --incremental-base.
3163 * testsuite/Makefile.in: Regenerate.
3164
2eedd706
CC
31652011-05-24 Cary Coutant <ccoutant@google.com>
3166
3167 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
3168 incremental_test_4.
3169 * testsuite/Makefile.in: Regenerate.
3170 * testsuite/two_file_test_1_v1.cc: New test source file.
3171 * testsuite/two_file_test_1b_v1.cc: New test source file.
3172 * testsuite/two_file_test_2_v1.cc: New test source file.
3173
0f1c85a6
CC
31742011-05-24 Cary Coutant <ccoutant@google.com>
3175
3176 * dynobj.h (Dynobj::do_dynobj): New function.
3177 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
3178 flag and soname for shared objects.
3179 * incremental.cc (Incremental_inputs::report_object): Make
3180 either Incremental_object_entry or Incremental_dynobj_entry; add
3181 soname to string table.
3182 (Incremental_inputs::report_input_section): Add assertion.
3183 (Output_section_incremental_inputs::set_final_data_size): Adjust
3184 type of input file entry for shared libraries; adjust size of
3185 shared library info entry.
3186 (Output_section_incremental_inputs::write_input_files): Write
3187 as_needed flag for shared libraries.
3188 (Output_section_incremental_inputs::write_info_blocks): Adjust type
3189 of input file entry for shared libraries; write soname.
3190 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
3191 soname from incremental info.
3192 * incremental.h (enum Incremental_input_flags): Add
3193 INCREMENTAL_INPUT_AS_NEEDED.
3194 (Incremental_input_entry::Incremental_input_entry): Initialize new
3195 data member.
3196 (Incremental_input_entry::set_as_needed): New function.
3197 (Incremental_input_entry::as_needed): New function.
3198 (Incremental_input_entry::do_dynobj_entry): New function.
3199 (Incremental_input_entry::as_needed_): New data member.
3200 (Incremental_object_entry::Incremental_object_entry): Don't check
3201 for shared library.
3202 (Incremental_object_entry::do_type): Likewise.
3203 (class Incremental_dynobj_entry): New class.
3204 (Incremental_input_entry_reader::as_needed): New function.
3205 (Incremental_input_entry_reader::get_soname): New function.
3206 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
3207 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
3208 size of shared library info entry.
58797674 3209 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
3210 incremental link when adding DT_NEEDED entries.
3211 * object.h (Object::Object): Initialize new data member.
3212 (Object::dynobj): New function.
3213 (Object::set_as_needed): New function.
3214 (Object::as_needed): New function.
3215 (Object::do_dynobj): New function.
3216 (Object::as_needed_): New data member.
3217
6fa2a40b
CC
32182011-05-24 Cary Coutant <ccoutant@google.com>
3219
3220 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
3221 info; adjust display of GOT entries.
3222 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
3223 vector of input objects; remove file_status_.
3224 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
3225 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
3226 got_plt reader; call target hooks to reserve GOT entries.
3227 (Output_section_incremental_inputs::set_final_data_size): Adjust size
3228 of input file info header and GOT info entry.
3229 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
3230 relocation info.
3231 (Got_plt_view_info::got_descriptor): Remove.
3232 (Got_plt_view_info::sym_index): New data member.
3233 (Got_plt_view_info::input_index): New data member.
3234 (Local_got_offset_visitor::visit): Write input file index.
3235 (Global_got_offset_visitor::visit): Write 0 for input file index.
3236 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
3237 with sym_index and input_index.
3238 (Output_section_incremental_inputs::write_got_plt): Adjust size of
3239 incremental info GOT entry; replace got_descriptor with input_index.
3240 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
3241 map from input file index to object.
3242 (Sized_relobj_incr::do_layout): Replace direct data member reference
3243 with accessor function.
3244 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
3245 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
3246 Adjust size of input file info header.
3247 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
3248 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
3249 (Incremental_input_entry_reader::get_input_section): Adjust size of
3250 input file info header.
3251 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
3252 of incremental info GOT entry.
3253 (Incremental_got_plt_reader::get_got_desc): Remove.
3254 (Incremental_got_plt_reader::get_got_symndx): New function.
3255 (Incremental_got_plt_reader::get_got_input_index): New function.
3256 (Sized_incremental_binary::Sized_incremental_binary): Remove
3257 file_status_; add input_objects_.
3258 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
3259 (Sized_incremental_binary::set_file_is_unchanged): Remove.
3260 (Sized_incremental_binary::file_is_unchanged): Remove.
3261 (Sized_incremental_binary::set_input_object): New function.
3262 (Sized_incremental_binary::input_object): New function.
3263 (Sized_incremental_binary::file_status_): Remove.
3264 (Sized_incremental_binary::input_objects_): New data member.
3265 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
3266 references.
3267 (Sized_relobj_incr::invalid_address): Move to base class.
3268 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
3269 class.
3270 (Sized_relobj_incr::do_output_section_offset): Likewise.
3271 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
3272 (Sized_relobj_incr::section_offsets_): Likewise.
3273 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
3274 function.
3275 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
3276 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
3277 with accessor function.
3278 (Sized_relobj_file::do_layout): Likewise.
3279 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
3280 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
3281 (Sized_relobj_file::compute_final_local_value): Replace refs to
3282 section_offsets_ with accessor function.
3283 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
3284 * object.h (Relobj::Relobj): Initialize new data members.
3285 (Relobj::add_dyn_reloc): New function.
3286 (Relobj::first_dyn_reloc): New function.
3287 (Relobj::dyn_reloc_count): New function.
3288 (Relobj::first_dyn_reloc_): New data member.
3289 (Relobj::dyn_reloc_count_): New data member.
3290 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
3291 references.
3292 (Sized_relobj::Address): New typedef.
3293 (Sized_relobj::invalid_address): Move here from child class.
3294 (Sized_relobj::Sized_relobj): Initialize new data members.
3295 (Sized_relobj::sized_relobj): New function.
3296 (Sized_relobj::is_output_section_offset_invalid): Move here from
3297 child class.
3298 (Sized_relobj::get_output_section_offset): Likewise.
3299 (Sized_relobj::local_has_got_offset): Likewise.
3300 (Sized_relobj::local_got_offset): Likewise.
3301 (Sized_relobj::set_local_got_offset): Likewise.
3302 (Sized_relobj::do_for_all_local_got_entries): Likewise.
3303 (Sized_relobj::clear_got_offsets): New function.
3304 (Sized_relobj::section_offsets): Move here from child class.
3305 (Sized_relobj::do_output_section_offset): Likewise.
3306 (Sized_relobj::do_set_section_offset): Likewise.
3307 (Sized_relobj::Local_got_offsets): Likewise.
3308 (Sized_relobj::local_got_offsets_): Likewise.
3309 (Sized_relobj::section_offsets_): Likewise.
3310 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
3311 references.
3312 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
3313 class.
3314 (Sized_relobj_file::sized_relobj): New function
3315 (Sized_relobj_file::local_has_got_offset): Move to base class.
3316 (Sized_relobj_file::local_got_offset): Likewise.
3317 (Sized_relobj_file::set_local_got_offset): Likewise.
3318 (Sized_relobj_file::get_output_section_offset): Likewise.
3319 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
3320 (Sized_relobj_file::do_output_section_offset): Likewise.
3321 (Sized_relobj_file::do_set_section_offset): Likewise.
3322 (Sized_relobj_file::Local_got_offsets): Likewise.
3323 (Sized_relobj_file::local_got_offsets_): Likewise.
3324 (Sized_relobj_file::section_offsets_): Likewise.
3325 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
3326 (all constructors).
3327 (set_needs_dynsym_index): Convert relobj to derived class pointer.
3328 (Output_reloc::get_symbol_index): Likewise.
3329 (Output_reloc::local_section_offset): Likewise.
3330 (Output_reloc::get_address): Likewise.
3331 (Output_reloc::symbol_value): Likewise.
3332 (Output_data_got::reserve_slot): Move to class definition.
3333 (Output_data_got::reserve_local): New function.
3334 (Output_data_got::reserve_slot_for_global): Remove.
3335 (Output_data_got::reserve_global): New function.
3336 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
3337 (all constructors, two instantiations).
3338 (Output_reloc::get_relobj): New function (two instantiations).
3339 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
3340 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
3341 (Output_data_reloc::add_global): Adjust type of relobj.
3342 (Output_data_reloc::add_global_relative): Likewise.
3343 (Output_data_reloc::add_symbolless_global_addend): Likewise.
3344 (Output_data_reloc::add_local): Likewise.
3345 (Output_data_reloc::add_local_relative): Likewise.
3346 (Output_data_reloc::add_symbolless_local_addend): Likewise.
3347 (Output_data_reloc::add_local_section): Likewise.
3348 (Output_data_reloc::add_output_section): Likewise.
3349 (Output_data_reloc::add_absolute): Likewise.
3350 (Output_data_reloc::add_target_specific): Likewise.
3351 (Output_data_got::reserve_slot): Move definition here.
3352 (Output_data_got::reserve_local): New function.
3353 (Output_data_got::reserve_global): New function.
3354 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
3355 section_offsets_ with accessor function.
3356 (Sized_relobj_file::write_sections): Likewise.
3357 (Sized_relobj_file::do_relocate_sections): Likewise.
3358 * target.h (Sized_target::reserve_local_got_entry): New function.
3359 (Sized_target::reserve_global_got_entry): New function.
3360 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
3361 (Target_x86_64::reserve_global_got_entry): New function.
3362 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
3363
4829d394
CC
33642011-05-23 Cary Coutant <ccoutant@google.com>
3365
3366 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
3367 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
3368 bit when checking got_type.
3369 * incremental.cc (Sized_incremental_binary::setup_readers):
3370 Store symbol table and string table locations; initialize bit vector
3371 of file status flags.
3372 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
3373 unchanged files.
3374 (Sized_incremental_binary::do_process_got_plt): New function.
3375 (Sized_incremental_binary::get_symtab_view): Use stored locations.
3376 (Output_section_incremental_inputs::set_final_data_size): Record
3377 file index for each input file.
3378 (Output_section_incremental_inputs::write_got_plt): Store file index
3379 instead of input entry offset for each GOT entry.
3380 * incremental.h
3381 (Incremental_input_entry::Incremental_input_entry): Initialize new
3382 data member.
3383 (Incremental_input_entry::set_offset): Store file index.
3384 (Incremental_input_entry::get_file_index): New function.
3385 (Incremental_input_entry::file_index_): New data member.
3386 (Incremental_binary::process_got_plt): New function.
3387 (Incremental_binary::do_process_got_plt): New function.
3388 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
3389 data members.
3390 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
3391 (Sized_incremental_binary::set_file_is_unchanged): New function.
3392 (Sized_incremental_binary::file_is_unchanged): New function.
3393 (Sized_incremental_binary::do_process_got_plt): New function.
3394 (Sized_incremental_binary::file_status_): New data member.
3395 (Sized_incremental_binary::main_symtab_loc_): New data member.
3396 (Sized_incremental_binary::main_strtab_loc_): New data member.
3397 * output.cc (Output_data_got::Got_entry::write): Add case
3398 RESERVED_CODE.
3399 (Output_data_got::add_global): Call add_got_entry.
3400 (Output_data_got::add_global_plt): Likewise.
3401 (Output_data_got::add_global_with_rel): Likewise.
3402 (Output_data_got::add_global_with_rela): Likewise.
3403 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
3404 (Output_data_got::add_global_pair_with_rela): Likewise.
3405 (Output_data_got::add_local): Call add_got_entry.
3406 (Output_data_got::add_local_plt): Likewise.
3407 (Output_data_got::add_local_with_rel): Likewise.
3408 (Output_data_got::add_local_with_rela): Likewise.
3409 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
3410 (Output_data_got::add_local_pair_with_rela): Likewise.
3411 (Output_data_got::reserve_slot): New function.
3412 (Output_data_got::reserve_slot_for_global): New function.
3413 (Output_data_got::add_got_entry): New function.
3414 (Output_data_got::add_got_entry_pair): New function.
3415 (Output_section::add_output_section_data): Edit FIXME.
3416 * output.h
3417 (Output_section_data_build::Output_section_data_build): New
3418 constructor with size parameter.
3419 (Output_data_space::Output_data_space): Likewise.
3420 (Output_data_got::Output_data_got): Initialize new data member; new
3421 constructor with size parameter.
3422 (Output_data_got::add_constant): Call add_got_entry.
3423 (Output_data_got::reserve_slot): New function.
3424 (Output_data_got::reserve_slot_for_global): New function.
3425 (class Output_data_got::Got_entry): Add RESERVED_CODE.
3426 (Output_data_got::add_got_entry): New function.
3427 (Output_data_got::add_got_entry_pair): New function.
3428 (Output_data_got::free_list_): New data member.
3429 * target.h (Sized_target::init_got_plt_for_update): New function.
3430 (Sized_target::register_global_plt_entry): New function.
3431 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3432 Initialize new data member; call init; add constructor with PLT count.
3433 (Output_data_plt_x86_64::init): New function.
3434 (Output_data_plt_x86_64::add_relocation): New function.
3435 (Output_data_plt_x86_64::reserve_slot): New function.
3436 (Output_data_plt_x86_64::free_list_): New data member.
3437 (Target_x86_64::init_got_plt_for_update): New function.
3438 (Target_x86_64::register_global_plt_entry): New function.
3439 (Output_data_plt_x86_64::add_entry): Allocate from free list for
3440 incremental updates.
3441 (Output_data_plt_x86_64::add_relocation): New function.
3442 * testsuite/object_unittest.cc (Object_test): Set default options.
3443
ec69d6da
ILT
34442011-05-16 Ian Lance Taylor <iant@google.com>
3445
3446 * options.h (class General_options): Make -i a synonym for -r.
3447
732e31de
ILT
34482011-05-16 Ian Lance Taylor <iant@google.com>
3449
3450 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
3451
403676b5
CC
34522011-05-10 Cary Coutant <ccoutant@google.com>
3453
3454 * object.cc (Sized_relobj::do_count_local_symbols): Check for
3455 strip_all (-s).
3456
5b7b7d6e
ILT
34572011-05-06 Ian Lance Taylor <iant@google.com>
3458
3459 * layout.cc (Layout::layout): If the output section flags change,
3460 update the ordering.
3461
f0f9babf
CC
34622011-04-25 Cary Coutant <ccoutant@google.com>
3463
3464 * incremental-dump.cc (dump_incremental_inputs): Print local
3465 symbol info for each input file.
3466 * incremental.cc
3467 (Output_section_incremental_inputs::set_final_data_size): Add local
3468 symbol info to input file entries in incremental info.
3469 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3470 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
3471 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
3472 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
3473 implementation.
3474 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
3475 (Sized_incr_relobj::do_relocate): Write the local symbols.
3476 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
3477 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
3478 Adjust size of input file header.
3479 (Incremental_inputs_reader::get_local_symbol_offset): New function.
3480 (Incremental_inputs_reader::get_local_symbol_count): New function.
3481 (Incremental_inputs_reader::get_input_section): Adjust size of input
3482 file header.
3483 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
3484 (Sized_incr_relobj::This): New typedef.
3485 (Sized_incr_relobj::sym_size): New const data member.
3486 (Sized_incr_relobj::Local_symbol): New struct.
3487 (Sized_incr_relobj::do_output_local_symbol_count): New function.
3488 (Sized_incr_relobj::do_local_symbol_offset): New function.
3489 (Sized_incr_relobj::local_symbol_count_): New data member.
3490 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
3491 (Sized_incr_relobj::local_symbol_index_): New data member.
3492 (Sized_incr_relobj::local_symbol_offset_): New data member.
3493 (Sized_incr_relobj::local_dynsym_offset_): New data member.
3494 (Sized_incr_relobj::local_symbols_): New data member.
3495 * object.h (Relobj::output_local_symbol_count): New function.
3496 (Relobj::local_symbol_offset): New function.
3497 (Relobj::do_output_local_symbol_count): New function.
3498 (Relobj::do_local_symbol_offset): New function.
3499 (Sized_relobj::do_output_local_symbol_count): New function.
3500 (Sized_relobj::do_local_symbol_offset): New function.
3501
d0a9ace3
ILT
35022011-04-22 Vladimir Simonov <sv@sw.ru>
3503
3504 * descriptors.cc (set_close_on_exec): New function.
3505 (Descriptors::open): Use set_close_on_exec.
3506 * output.cc (S_ISLNK): Define if not defined.
3507
94a3fc8b
CC
35082011-04-22 Cary Coutant <ccoutant@google.com>
3509
3510 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
3511 global symbol map.
3512 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
3513 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
3514 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
3515 relocations.
3516 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
3517 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
3518 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
3519 * incremental.h
3520 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
3521 function.
3522 (Incremental_binary::apply_incremental_relocs): New function.
3523 (Incremental_binary::do_apply_incremental_relocs): New function.
3524 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
3525 data member.
3526 (Sized_incremental_binary::add_global_symbol): New function.
3527 (Sized_incremental_binary::global_symbol): New function.
3528 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
3529 (Sized_incremental_binary::symbol_map_): New data member.
3530 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
3531 * target.h (Sized_target::apply_relocation): New function.
3532 * target-reloc.h (apply_relocation): New function.
3533 * x86_64.cc (Target_x86_64::apply_relocation): New function.
3534
c87e4302
DK
35352011-04-22 Doug Kwan <dougkwan@google.com>
3536
3537 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
3538 flag of a SHT_ARM_EXIDX section.
2e702c99 3539 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
3540 * testsuite/Makefile.in: Regenerate.
3541 * testsuite/arm_exidx_test.s: New file.
3542 * testsuite/arm_exidx_test.sh: Same.
3543
e7782cf6
CC
35442011-04-20 Cary Coutant <ccoutant@google.com>
3545
3546 PR gold/12689
3547 * archive.h (Incremental_archive_entry::Archive_member):
3548 Initialize arg_serial_ (second constructor).
3549
308ecdc7
ILT
35502011-04-17 Ian Lance Taylor <iant@google.com>
3551
3552 * object.cc (Relocate_info::location): Simplify location string.
3553 * errors.cc (Errors::error_at_location): Don't print program
3554 name.
3555 (Errors::warning_at_location): Likewise.
3556 (Errors::undefined_symbol): Likewise.
3557 * testsuite/debug_msg.sh: Update accordingly.
3558
bec5b579
CC
35592011-04-14 Cary Coutant <ccoutant@google.com>
3560
3561 * gold/layout.cc (Layout::symtab_section_offset): New function.
3562 * gold/layout.h (Layout::symtab_section_offset): New function.
3563 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
3564
88597d34
ILT
35652011-04-12 Ian Lance Taylor <iant@google.com>
3566
3567 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
3568 with MREMAP_MAYMOVE.
3569 * output.h (class Output_file): Add map_is_allocated_ field.
3570 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
3571 not available, provide stubs. If mremap is not available, #define
3572 it to gold_mremap.
3573 (MREMAP_MAYMOVE): Define if not defined.
3574 (Output_file::Output_file): Initialize map_is_allocated_.
3575 (Output_file::resize): Check map_is_allocated_.
3576 (Output_file::map_anonymous): If mmap fails, use malloc.
3577 (Output_file::unmap): Don't do anything for an anonymous map.
3578 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
3579 is not available, provide stubs.
3580 (File_read::View::~View): Use free rather than delete[].
3581 (File_read::make_view): Use malloc rather than new[]. If mmap
3582 fails, use malloc.
3583 (File_read::find_or_make_view): Use malloc rather than new[].
3584 * gold.h: Remove HAVE_REMAP code.
3585 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
3586 exists. Rename mremap to gold_mremap. If mmap is not available
3587 don't do anything.
3588 * configure, config.in: Rebuild.
3589
11e361bc
ILT
35902011-04-11 Ian Lance Taylor <iant@google.com>
3591
3592 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
3593 initialize local variable v.
3594
cdc29364
CC
35952011-04-11 Cary Coutant <ccoutant@google.com>
3596
3597 * archive.cc (Archive::include_member): Adjust call to
3598 report_object.
3599 (Add_archive_symbols::run): Track argument serial numbers.
3600 (Lib_group::include_member): Likewise.
3601 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
3602 * archive.h (Incremental_archive_entry::Archive_member):
3603 Initialize arg_serial_.
3604 (Archive_member::arg_serial_): New data member.
3605 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
3606 (Sized_dynobj::do_add_symbols): Track symbols when doing an
3607 incremental link.
3608 (Sized_dynobj::do_for_all_local_got_entries): New function.
3609 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
3610 function.
3611 * fileread.cc (get_mtime): New function.
3612 * fileread.h (get_mtime): New function.
3613 * gold.cc (queue_initial_tasks): Check for incremental update.
3614 (process_incremental_input): New function.
3615 (queue_middle_tasks): Don't force valid target for incremental
3616 update.
3617 * incremental-dump.cc (find_input_containing_global): Adjust
3618 size of symbol info entry.
3619 (dump_incremental_inputs): Dump argument serial number and
3620 in_system_directory flag; bias shndx by 1; print symbol names
3621 when dumping per-file symbol lists; use new symbol info readers.
3622 * incremental.cc
3623 (Output_section_incremental_inputs:update_data_size): New function.
3624 (Sized_incremental_binary::setup_readers): Setup input readers
3625 for each input file; build maps for files added from libraries
3626 and scripts.
3627 (Sized_incremental_binary::check_input_args): New function.
3628 (Sized_incremental_binary::do_check_inputs): Build map of argument
3629 serial numbers to input arguments.
3630 (Sized_incremental_binary::do_file_has_changed): Rename
3631 do_file_is_unchanged to this; compare file modification times.
3632 (Sized_incremental_binary::do_init_layout): New function.
3633 (Sized_incremental_binary::do_reserve_layout): New function.
3634 (Sized_incremental_binary::do_get_input_reader): Remove.
3635 (Sized_incremental_binary::get_symtab_view): New function.
3636 (Incremental_checker::can_incrementally_link_output_file): Remove.
3637 (Incremental_inputs::report_command_line): Exclude --debug options.
3638 (Incremental_inputs::report_archive_begin): Add parameter; track
3639 argument serial numbers; don't put input file entry for archive
3640 before archive members.
3641 (Incremental_inputs::report_archive_end): Put input file entry
3642 for archive after archive members.
3643 (Incremental_inputs::report_object): Add parameter; track argument
3644 serial numbers and in_system_directory flag.
3645 (Incremental_inputs::report_script): Add parameter; track argument
3646 serial numbers.
3647 (Output_section_incremental_inputs::set_final_data_size): Adjust
3648 size of symbol info entry; check for forwarding symbols.
3649 (Output_section_incremental_inputs::write_input_files): Write
3650 in_system_directory flag and argument serial number.
3651 (Output_section_incremental_inputs::write_info_blocks): Map section
3652 indices between incremental info and original input file; store
3653 input section index for each symbol.
3654 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
3655 change operator() to visit().
3656 (class Global_got_offset_visitor): Likewise.
3657 (class Global_symbol_visitor_got_plt):
3658 (Output_section_incremental_inputs::write_got_plt): Use new visitor
3659 classes.
3660 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
3661 (Sized_incr_relobj::do_read_symbols): New function.
3662 (Sized_incr_relobj::do_layout): New function.
3663 (Sized_incr_relobj::do_layout_deferred_sections): New function.
3664 (Sized_incr_relobj::do_add_symbols): New function.
3665 (Sized_incr_relobj::do_should_include_member): New function.
3666 (Sized_incr_relobj::do_for_all_global_symbols): New function.
3667 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
3668 (Sized_incr_relobj::do_section_size): New function.
3669 (Sized_incr_relobj::do_section_name): New function.
3670 (Sized_incr_relobj::do_section_contents): New function.
3671 (Sized_incr_relobj::do_section_flags): New function.
3672 (Sized_incr_relobj::do_section_entsize): New function.
3673 (Sized_incr_relobj::do_section_address): New function.
3674 (Sized_incr_relobj::do_section_type): New function.
3675 (Sized_incr_relobj::do_section_link): New function.
3676 (Sized_incr_relobj::do_section_info): New function.
3677 (Sized_incr_relobj::do_section_addralign): New function.
3678 (Sized_incr_relobj::do_initialize_xindex): New function.
3679 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
3680 (Sized_incr_relobj::do_read_relocs): New function.
3681 (Sized_incr_relobj::do_gc_process_relocs): New function.
3682 (Sized_incr_relobj::do_scan_relocs): New function.
3683 (Sized_incr_relobj::do_count_local_symbols): New function.
3684 (Sized_incr_relobj::do_finalize_local_symbols): New function.
3685 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
3686 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
3687 (Sized_incr_relobj::do_relocate): New function.
3688 (Sized_incr_relobj::do_set_section_offset): New function.
3689 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
3690 (Sized_incr_dynobj::do_read_symbols): New function.
3691 (Sized_incr_dynobj::do_layout): New function.
3692 (Sized_incr_dynobj::do_add_symbols): New function.
3693 (Sized_incr_dynobj::do_should_include_member): New function.
3694 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
3695 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
3696 (Sized_incr_dynobj::do_section_size): New function.
3697 (Sized_incr_dynobj::do_section_name): New function.
3698 (Sized_incr_dynobj::do_section_contents): New function.
3699 (Sized_incr_dynobj::do_section_flags): New function.
3700 (Sized_incr_dynobj::do_section_entsize): New function.
3701 (Sized_incr_dynobj::do_section_address): New function.
3702 (Sized_incr_dynobj::do_section_type): New function.
3703 (Sized_incr_dynobj::do_section_link): New function.
3704 (Sized_incr_dynobj::do_section_info): New function.
3705 (Sized_incr_dynobj::do_section_addralign): New function.
3706 (Sized_incr_dynobj::do_initialize_xindex): New function.
3707 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
3708 (make_sized_incremental_object): New function.
3709 (Incremental_library::copy_unused_symbols): New function.
3710 (Incremental_library::do_for_all_unused_symbols): New function.
3711 * incremental.h (enum Incremental_input_flags): New type.
3712 (class Incremental_checker): Remove.
3713 (Incremental_input_entry::Incremental_input_entry): Add argument
3714 serial number.
3715 (Incremental_input_entry::arg_serial): New function.
3716 (Incremental_input_entry::set_is_in_system_directory): New function.
3717 (Incremental_input_entry::is_in_system_directory): New function.
3718 (Incremental_input_entry::arg_serial_): New data member.
3719 (Incremental_input_entry::is_in_system_directory_): New data member.
3720 (class Script_info): Move here from script.h.
3721 (Script_info::Script_info): Add filename parameter.
3722 (Script_info::filename): New function.
3723 (Script_info::filename_): New data member.
3724 (Incremental_script_entry::Incremental_script_entry): Add argument
3725 serial number.
3726 (Incremental_object_entry::Incremental_object_entry): Likewise.
3727 (Incremental_object_entry::add_input_section): Build list of input
3728 sections with map to original shndx.
3729 (Incremental_object_entry::get_input_section_index): New function.
3730 (Incremental_object_entry::shndx_): New data member.
3731 (Incremental_object_entry::name_key_): Rename; adjust all refs.
3732 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
3733 (Incremental_archive_entry::Incremental_archive_entry): Add argument
3734 serial number.
3735 (Incremental_inputs::report_archive_begin): Likewise.
3736 (Incremental_inputs::report_object): Likewise.
3737 (Incremental_inputs::report_script): Likewise.
3738 (class Incremental_global_symbol_reader): New class.
3739 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
3740 and store flags and input file type.
3741 (Incremental_input_entry_reader::arg_serial): New function.
3742 (Incremental_input_entry_reader::type): Extract type from flags.
3743 (Incremental_input_entry_reader::is_in_system_directory): New function.
3744 (Incremental_input_entry_reader::get_input_section_count): Call
3745 accessor function for type.
3746 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
3747 function for type; adjust size of global symbol entry.
3748 (Incremental_input_entry_reader::get_global_symbol_count): Call
3749 accessor function for type.
3750 (Incremental_input_entry_reader::get_object_count): Likewise.
3751 (Incremental_input_entry_reader::get_object_offset): Likewise.
3752 (Incremental_input_entry_reader::get_member_count): Likewise.
3753 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
3754 (Incremental_input_entry_reader::get_member_offset): Likewise.
3755 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
3756 (Incremental_input_entry_reader::Global_symbol_info): Remove.
3757 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
3758 (Incremental_input_entry_reader::get_global_symbol_reader): New
3759 function.
3760 (Incremental_input_entry_reader::get_output_symbol_index): New
3761 function.
3762 (Incremental_input_entry_reader::type_): Remove.
3763 (Incremental_input_entry_reader::flags_): New data member.
3764 (Incremental_inputs_reader::input_file_offset): New function.
3765 (Incremental_inputs_reader::input_file_index): New function.
3766 (Incremental_inputs_reader::input_file): Call input_file_offset.
3767 (Incremental_inputs_reader::input_file_at_offset): New function.
3768 (Incremental_relocs_reader::get_r_type): Reformat.
3769 (Incremental_relocs_reader::get_r_shndx): Reformat.
3770 (Incremental_relocs_reader::get_r_offset): Reformat.
3771 (Incremental_relocs_reader::data): New function.
3772 (Incremental_binary::Incremental_binary): Initialize new data members.
3773 (Incremental_binary::check_inputs): Add cmdline parameter.
3774 (Incremental_binary::file_is_unchanged): Remove.
3775 (Input_reader::arg_serial): New function.
3776 (Input_reader::get_unused_symbol_count): New function.
3777 (Input_reader::get_unused_symbol): New function.
3778 (Input_reader::do_arg_serial): New function.
3779 (Input_reader::do_get_unused_symbol_count): New function.
3780 (Input_reader::do_get_unused_symbol): New function.
3781 (Incremental_binary::input_file_count): New function.
3782 (Incremental_binary::get_input_reader): Change signature to use
3783 index instead of filename.
3784 (Incremental_binary::file_has_changed): New function.
3785 (Incremental_binary::get_input_argument): New function.
3786 (Incremental_binary::get_library): New function.
3787 (Incremental_binary::get_script_info): New function.
3788 (Incremental_binary::init_layout): New function.
3789 (Incremental_binary::reserve_layout): New function.
3790 (Incremental_binary::output_file): New function.
3791 (Incremental_binary::do_check_inputs): New function.
3792 (Incremental_binary::do_file_is_unchanged): Remove.
3793 (Incremental_binary::do_file_has_changed): New function.
3794 (Incremental_binary::do_init_layout): New function.
3795 (Incremental_binary::do_reserve_layout): New function.
3796 (Incremental_binary::do_input_file_count): New function.
3797 (Incremental_binary::do_get_input_reader): Change signature.
3798 (Incremental_binary::input_args_map_): New data member.
3799 (Incremental_binary::library_map_): New data member.
3800 (Incremental_binary::script_map_): New data member.
3801 (Sized_incremental_binary::Sized_incremental_binary): Initialize
3802 new data members.
3803 (Sized_incremental_binary::output_section): New function.
3804 (Sized_incremental_binary::inputs_reader): Add const.
3805 (Sized_incremental_binary::symtab_reader): Add const.
3806 (Sized_incremental_binary::relocs_reader): Add const.
3807 (Sized_incremental_binary::got_plt_reader): Add const.
3808 (Sized_incremental_binary::get_symtab_view): New function.
3809 (Sized_incremental_binary::Inputs_reader): New typedef.
3810 (Sized_incremental_binary::Input_entry_reader): New typedef.
3811 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
3812 (Sized_incremental_binary::do_file_is_unchanged): Remove.
3813 (Sized_incremental_binary::do_file_has_changed): New function.
3814 (Sized_incremental_binary::do_init_layout): New function.
3815 (Sized_incremental_binary::do_reserve_layout): New function.
3816 (Sized_input_reader::Inputs_reader): Remove.
3817 (Sized_input_reader::Input_entry_reader): Remove.
3818 (Sized_input_reader::do_arg_serial): New function.
3819 (Sized_input_reader::do_get_unused_symbol_count): New function.
3820 (Sized_input_reader::do_get_unused_symbol): New function.
3821 (Sized_incremental_binary::do_input_file_count): New function.
3822 (Sized_incremental_binary::do_get_input_reader): Change signature;
3823 use index instead of filename.
3824 (Sized_incremental_binary::section_map_): New data member.
3825 (Sized_incremental_binary::input_entry_readers_): New data member.
3826 (class Sized_incr_relobj): New class.
3827 (class Sized_incr_dynobj): New class.
3828 (make_sized_incremental_object): New function.
3829 (class Incremental_library): New class.
3830 * layout.cc (Free_list::num_lists): New static data member.
3831 (Free_list::num_nodes): New static data member.
3832 (Free_list::num_removes): New static data member.
3833 (Free_list::num_remove_visits): New static data member.
3834 (Free_list::num_allocates): New static data member.
3835 (Free_list::num_allocate_visits): New static data member.
3836 (Free_list::init): New function.
3837 (Free_list::remove): New function.
3838 (Free_list::allocate): New function.
3839 (Free_list::dump): New function.
3840 (Free_list::print_stats): New function.
3841 (Layout_task_runner::run): Resize output file for incremental updates.
3842 (Layout::Layout): Initialize new data members.
3843 (Layout::set_incremental_base): New function.
3844 (Layout::init_fixed_output_section): New function.
3845 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
3846 incremental updates.
3847 (Layout::create_gold_note): Do not create gold note section for
3848 incremental updates.
3849 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
3850 for incremental updates.
3851 (Layout::set_section_offsets): For incremental updates, allocate space
3852 from free list.
3853 (Layout::create_symtab_sections): Layout with offsets relative to
3854 start of section; for incremental updates, allocate space from free
3855 list.
3856 (Layout::create_shdrs): For incremental updates, allocate space from
3857 free list.
3858 (Layout::finish_dynamic_section): For incremental updates, do not
3859 check --as-needed (fixed in subsequent patch).
3860 * layout.h (class Free_list): New class.
3861 (Layout::set_incremental_base): New function.
3862 (Layout::incremental_base): New function.
3863 (Layout::init_fixed_output_section): New function.
3864 (Layout::allocate): New function.
3865 (Layout::incremental_base_): New data member.
3866 (Layout::free_list_): New data member.
3867 * main.cc (main): Print Free_list statistics.
3868 * object.cc (Relobj::finalize_incremental_relocs): Add
3869 clear_counts parameter; clear counts only when clear_counts is set.
3870 (Sized_relobj::Sized_relobj): Initialize new base class.
3871 (Sized_relobj::do_layout): Don't report special sections.
3872 (Sized_relobj::do_for_all_local_got_entries): New function.
3873 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
3874 symtab_off to all symbol table offsets.
3875 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
3876 * object.h (class Got_offset_list): Move to top of file.
3877 (Object::Object): Allow case where input_file == NULL.
3878 (Object::~Object): Likewise.
3879 (Object::input_file): Assert that input_file != NULL.
3880 (Object::lock): Allow case where input_file == NULL.
3881 (Object::unlock): Likewise.
3882 (Object::is_locked): Likewise.
3883 (Object::token): Likewise.
3884 (Object::release): Likewise.
3885 (Object::is_incremental): New function.
3886 (Object::get_mtime): New function.
3887 (Object::for_all_local_got_entries): New function.
3888 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
3889 (Object::set_is_in_system_directory): New function.
3890 (Object::is_in_system_directory): New function.
3891 (Object::do_is_incremental): New function.
3892 (Object::do_get_mtime): New function.
3893 (Object::do_for_all_local_got_entries): New function.
3894 (Object::is_in_system_directory_): New data member.
3895 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
3896 (class Sized_relobj_base): New class.
3897 (class Sized_relobj): Derive from Sized_relobj_base.
3898 (class Sized_relobj::Symbols): Redeclare from base class.
3899 (class Sized_relobj::local_got_offset_list): Remove.
3900 (class Sized_relobj::Output_sections): Redeclare from base class.
3901 (class Sized_relobj::do_for_all_local_got_entries): New function.
3902 (class Sized_relobj::write_local_symbols): Add offset parameter.
3903 (class Sized_relobj::local_symbol_offset_): Update comment.
3904 (class Sized_relobj::local_dynsym_offset_): Update comment.
3905 * options.cc (Input_arguments::add_file): Remove const.
3906 * options.h (Input_file_argument::Input_file_argument):
3907 Initialize arg_serial_ (all constructors).
3908 (Input_file_argument::set_arg_serial): New function.
3909 (Input_file_argument::arg_serial): New function.
3910 (Input_file_argument::arg_serial_): New data member.
3911 (Input_arguments::Input_arguments): Initialize file_count_.
3912 (Input_arguments::add_file): Remove const.
3913 (Input_arguments::number_of_input_files): New function.
3914 (Input_arguments::file_count_): New data member.
3915 (Command_line::number_of_input_files): Call
3916 Input_arguments::number_of_input_files.
3917 * output.cc (Output_segment_headers::Output_segment_headers):
3918 Set current size.
3919 (Output_section::Input_section::current_data_size): New function.
3920 (Output_section::Output_section): Initialize new data members.
3921 (Output_section::add_input_section): Don't do merge sections for
3922 an incremental link; allocate space from free list for an
3923 incremental update.
3924 (Output_section::add_output_section_data): Allocate space from
3925 free list for an incremental update.
3926 (Output_section::update_data_size): New function.
3927 (Output_section::set_fixed_layout): New function.
3928 (Output_section::reserve): New function.
3929 (Output_segment::set_section_addresses): Remove const.
3930 (Output_segment::set_section_list_addresses): Remove const; allocate
3931 space from free list for an incremental update.
3932 (Output_segment::set_offset): Adjust size of RELRO segment for an
3933 incremental update.
3934 * output.h (Output_data::current_data_size): Move here from
3935 child classes.
3936 (Output_data::pre_finalize_data_size): New function.
3937 (Output_data::update_data_size): New function.
3938 (Output_section_headers::update_data_size): new function.
3939 (Output_section_data_build::current_data_size): Move to Output_data.
3940 (Output_data_strtab::update_data_size): New function.
3941 (Output_section::current_data_size): Move to Output_data.
3942 (Output_section::set_fixed_layout): New function.
3943 (Output_section::has_fixed_layout): New function.
3944 (Output_section::reserve): New function.
3945 (Output_section::update_data_size): New function.
3946 (Output_section::has_fixed_layout_): New data member.
3947 (Output_section::free_list_): New data member.
3948 (Output_segment::set_section_addresses): Remove const.
3949 (Output_segment::set_section_list_addresses): Remove const.
3950 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
3951 New function.
3952 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
3953 New function.
3954 * readsyms.cc (Read_symbols::do_read_symbols): Add library
3955 parameter when calling Add_symbols constructor; store argument
3956 serial number for members of a lib group.
3957 (Add_symbols::locks): Allow case where token == NULL.
3958 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
3959 (Read_member::~Read_member): New function.
3960 (Read_member::is_runnable): New function.
3961 (Read_member::locks): New function.
3962 (Read_member::run): New function.
3963 (Check_script::~Check_script): New function.
3964 (Check_script::is_runnable): New function.
3965 (Check_script::locks): New function.
3966 (Check_script::run): New function.
3967 (Check_library::~Check_library): New function.
3968 (Check_library::is_runnable): New function.
3969 (Check_library::locks): New function.
3970 (Check_library::run): New function.
3971 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
3972 (Add_symbols::library_): New data member.
3973 (class Read_member): New class.
3974 (class Check_script): New class.
3975 (class Check_library): New class.
3976 * reloc.cc (Read_relocs::is_runnable): Allow case where
3977 token == NULL.
3978 (Read_relocs::locks): Likewise.
3979 (Scan_relocs::locks): Likewise.
3980 (Relocate_task::locks): Likewise.
3981 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
3982 to clear counters.
3983 (Sized_relobj::incremental_relocs_scan): Fix comment.
3984 (Sized_relobj::do_relocate): Pass output file offset to
3985 write_local_symbols.
3986 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
3987 from class declaration.
3988 * script.cc (read_input_script): Allocate Script_info; pass
3989 argument serial number to report_script.
3990 * script.h (class Script_info): Move to incremental.h.
3991 * symtab.cc (Symbol_table::add_from_incrobj): New function.
3992 * symtab.h (Symbol_table::add_from_incrobj): New function.
3993 (Symbol_table::set_file_offset): New function.
3994
b961d0d7
CC
39952011-04-05 Cary Coutant <ccoutant@google.com>
3996
3997 * incremental-dump.cc (dump_incremental_inputs): Change signature
3998 to take a Sized_incremental_binary; change caller. Use readers
3999 in Sized_incremental_binary.
4000 * incremental.cc
4001 (Sized_incremental_binary::find_incremental_inputs_sections):
4002 Rename do_find_incremental_inputs_sections to this.
4003 (Sized_incremental_binary::setup_readers): New function.
4004 (Sized_incremental_binary::do_check_inputs): Check
4005 has_incremental_info_ flag; move setup code to setup_readers;
4006 use input readers.
4007 (Sized_incremental_binary::do_file_is_unchanged): New function.
4008 (Sized_incremental_binary::do_get_input_reader): New function.
4009 * incremental.h (class Incremental_binary): Move to end of file.
4010 (Incremental_binary::file_is_unchanged): New function.
4011 (Incremental_binary::do_file_is_unchanged): New function.
4012 (Incremental_binary::Input_reader): New class.
4013 (Incremental_binary::get_input_reader): New function.
4014 (class Sized_incremental_binary): Move to end of file.
4015 (Sized_incremental_binary::Sized_incremental_binary): Setup the
4016 input section reader classes.
4017 (Sized_incremental_binary::has_incremental_info): New function.
4018 (Sized_incremental_binary::inputs_reader): New function.
4019 (Sized_incremental_binary::symtab_reader): New function.
4020 (Sized_incremental_binary::relocs_reader): New function.
4021 (Sized_incremental_binary::got_plt_reader): New function.
4022 (Sized_incremental_binary::do_file_is_unchanged): New function.
4023 (Sized_incremental_binary::Sized_input_reader): New class.
4024 (Sized_incremental_binary::get_input_reader): New function.
4025 (Sized_incremental_binary::find_incremental_inputs_sections):
4026 Rename do_find_incremental_inputs_sections to this.
4027 (Sized_incremental_binary::setup_readers): New function.
4028 (Sized_incremental_binary::has_incremental_info_): New data member.
4029 (Sized_incremental_binary::inputs_reader_): New data member.
4030 (Sized_incremental_binary::symtab_reader_): New data member.
4031 (Sized_incremental_binary::relocs_reader_): New data member.
4032 (Sized_incremental_binary::got_plt_reader_): New data member.
4033 (Sized_incremental_binary::current_input_file_): New data member.
4034
a869183f
PP
40352011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
4036
4037 PR gold/12640
4038 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
4039 violation.
4040
40412011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
4042
4043 * archive.cc (Archive::include_member): Adjust call to report_object.
4044 (Add_archive_symbols::run): Add script_info to call to
4045 report_archive_begin.
4046 (Lib_group::include_member): Adjust call to report_object.
4047 (Add_lib_group_symbols::run): Adjust call to report_object.
4048 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
4049 blocks. Add object count for script input files.
4050 * incremental.cc (Incremental_inputs::report_archive_begin): Add
4051 script_info parameter; change all callers.
4052 (Incremental_inputs::report_object): Add script_info parameter;
4053 change all callers.
4054 (Incremental_inputs::report_script): Store backpointer to
4055 incremental info entry.
4056 (Output_section_incremental_inputs::set_final_data_size): Record
4057 additional information for scripts.
4058 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4059 * incremental.h (Incremental_script_entry::add_object): New function.
4060 (Incremental_script_entry::get_object_count): New function.
4061 (Incremental_script_entry::get_object): New function.
4062 (Incremental_script_entry::objects_): New data member; adjust
4063 constructor.
4064 (Incremental_inputs::report_archive_begin): Add script_info parameter.
4065 (Incremental_inputs::report_object): Add script_info parameter.
4066 (Incremental_inputs_reader::get_object_count): New function.
4067 (Incremental_inputs_reader::get_object_offset): New function.
4068 * options.cc (Input_arguments::add_file): Return reference to
4069 new input argument.
4070 * options.h (Input_argument::set_script_info): New function.
4071 (Input_argument::script_info): New function.
4072 (Input_argument::script_info_): New data member; adjust all
4073 constructors.
4074 (Input_file_group::add_file): Return reference to new input argument.
4075 (Input_file_lib::add_file): Likewise.
4076 (Input_arguments::add_file): Likewise.
4077 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
4078 * script.cc (Parser_closure::Parser_closure): Add script_info
4079 parameter; adjust all callers.
4080 (Parser_closure::script_info): New function.
4081 (Parser_closure::script_info_): New data member.
4082 (read_input_script): Report scripts earlier to incremental info.
4083 (script_add_file): Set script_info in Input_argument.
4084 (script_add_library): Likewise.
4085 * script.h (Script_options::Script_info): Rewrite class.
4086
a869183f 40872011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
4088
4089 * archive.cc (Library_base::should_include_member): Move
4090 method here from class Archive.
4091 (Archive::Archive): Initialize base class.
4092 (Archive::should_include_member): Move to base class.
4093 (Archive::do_for_all_unused_symbols): New function.
4094 (Add_archive_symbols::run): Remove redundant access to
4095 incremental_inputs.
4096 (Lib_group::Lib_group): Initialize base class.
4097 (Lib_group::do_filename): New function.
4098 (Lib_group::include_member): Pass pointer to Lib_group to
4099 report_object.
4100 (Lib_group::do_for_all_unused_symbols): New function.
4101 (Add_lib_group_symbols::run): Report archive information for
4102 incremental links.
4103 * archive.h (class Library_base): New base class.
4104 (class Archive): Derive from Library_base.
4105 (Archive::filename): Move to base class.
4106 (Archive::set_incremental_info): Likewise.
4107 (Archive::incremental_info): Likewise.
4108 (Archive::Should_include): Likewise.
4109 (Archive::should_include_member): Likewise.
4110 (Archive::Armap_entry): Remove.
4111 (Archive::Unused_symbol_iterator): Remove.
4112 (Archive::unused_symbols_begin): Remove.
4113 (Archive::unused_symbols_end): Remove.
4114 (Archive::do_filename): New function.
4115 (Archive::do_get_mtime): New function.
4116 (Archive::do_for_all_unused_symbols): New function.
4117 (Archive::task_): Move to base class.
4118 (Archive::incremental_info_): Likewise.
4119 (class Lib_group): Derive from Library_base.
4120 (Lib_group::do_filename): New function.
4121 (Lib_group::do_get_mtime): New function.
4122 (Lib_group::do_for_all_unused_symbols): New function.
4123 (Lib_group::task_): Move to base class.
4124 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
4125 function.
4126 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
4127 function.
4128 * incremental.cc (Incremental_inputs::report_archive_begin):
4129 Use Library_base; call library's get_mtime; add incremental inputs
4130 entry before members.
4131 (class Unused_symbol_visitor): New class.
4132 (Incremental_inputs::report_archive_end): Use Library_base; use
4133 visitor class to record unused symbols; don't add incremental inputs
4134 entry after members.
4135 (Incremental_inputs::report_object): Use Library_base.
4136 * incremental.h
4137 (Incremental_archive_entry::Incremental_archive_entry): Remove
4138 unused Archive parameter.
4139 (Incremental_inputs::report_archive_begin): Use Library_base.
4140 (Incremental_inputs::report_archive_end): Likewise.
4141 (Incremental_inputs::report_object): Likewise.
4142 * object.cc (Sized_relobj::do_for_all_global_symbols): New
4143 function.
4144 * object.h (Object::for_all_global_symbols): New function.
4145 (Object::do_for_all_global_symbols): New function.
4146 (Sized_relobj::do_for_all_global_symbols): New function.
4147 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
4148 function.
4149 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
4150 function.
4151
61ab3e40
ILT
41522011-03-27 Ian Lance Taylor <iant@google.com>
4153
4154 * archive.cc (Archive::interpret_header): Return -1 if something
4155 goes wrong. Change callers accordingly.
4156
30e1f9e6
CC
41572011-03-25 Cary Coutant <ccoutant@google.com>
4158
4159 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
4160 * testsuite/Makefile.in: Regenerate.
4161
9370ce59 41622011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
4163
4164 * plugin.cc (get_view): New.
4165 (Plugin::load): Pass get_view to the plugin.
4166 (Plugin_manager::get_view): New.
4167
9312bb0a
ILT
41682011-03-21 Ian Lance Taylor <iant@google.com>
4169
4170 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 4171 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 4172
7e12ba9e
ST
41732011-03-21 Sriraman Tallam <tmsriram@google.com>
4174
4175 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
4176 Change == to -eq.
4177 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
4178 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
4179 Change == to -eq.
4180 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
4181 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
4182
fd7a005d
ILT
41832011-03-14 Ian Lance Taylor <iant@google.com>
4184
4185 * script-sections.cc (Sort_output_sections::script_compare):
4186 Rename from is_before, change return type.
4187 (Sort_output_sections::operator()): Adjust accordingly.
4188
ed16fd1b
ILT
41892011-03-11 Jeffrey Yasskin <jyasskin@google.com>
4190
4191 PR gold/12572
4192 * testsuite/odr_violation2.cc: Add comment to make all error line
4193 numbers double digits.
4194 * testsuite/debug_msg.sh: Adjust expected errors.
4195
71ff8986
ILT
41962011-03-09 Jeffrey Yasskin <jyasskin@google.com>
4197
4198 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
4199 but mark earlier ones as non-canonical
4200 (offset_to_iterator): Update search target and example
4201 (do_addr2line): Return extra lines in a vector*
4202 (format_file_lineno): Extract from do_addr2line
4203 (one_addr2line): Add vector* out-param
4204 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
4205 when a lineno entry appeared last for its instruction
4206 (Dwarf_line_info): Add vector* out-param
4207 * object.cc (Relocate_info): Pass NULL for the vector* out-param
4208 * symtab.cc (Odr_violation_compare): Include the lineno in the
4209 comparison again.
4210 (linenos_from_loc): New. Combine the canonical line for an
4211 address with its other lines.
4212 (True_if_intersect): New. Helper functor to make
4213 std::set_intersection a query.
4214 (detect_odr_violations): Compare sets of lines instead of just
4215 one line for each function. This became less deterministic, but
4216 has fewer false positives.
4217 * symtab.h: Declarations.
4218 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
4219 mix an optimized and non-optimized object in the same binary
4220 (odr_violation2.so): Same.
4221 * testsuite/Makefile.in: Regenerate from Makefile.am.
4222 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
4223 * testsuite/debug_msg.sh: Update line numbers and add
4224 assertions.
4225 * testsuite/odr_violation1.cc: Use OdrDerived, in a
4226 non-optimized context.
4227 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
4228 isn't inlined, and use OdrDerived in an optimized context.
4229 * testsuite/odr_header1.h: Defines OdrDerived, where
4230 optimization will change the
4231 first-instruction-in-the-destructor's file and line number.
4232 * testsuite/odr_header2.h: Defines OdrBase.
4233
a19fefdc
ILT
42342011-03-09 Ian Lance Taylor <iant@google.com>
4235
4236 * fileread.cc (File_read::clear_views): Don't delete the whole
4237 file view.
4238
ecb351e9
ILT
42392011-03-08 Ian Lance Taylor <iant@google.com>
4240
4241 PR gold/12525
4242 * fileread.cc: #include <climits>.
4243 (GOLD_IOV_MAX): Define.
4244 (File_read::read_multiple): Limit number of entries by iov_max.
4245 * fileread.h (class File_read): Always set max_readv_entries to
4246 128.
4247
b821d13c
ILT
42482011-03-07 Ian Lance Taylor <iant@google.com>
4249
4250 PR gold/12525
4251 * options.h (class General_options): Add -dy and -dn.
4252
89243142
CC
42532011-03-02 Cary Coutant <ccoutant@google.com>
4254
4255 * testsuite/script_test_9.t: Add TLS segment.
4256
d0773f31
ILT
42572011-03-02 Simon Baldwin <simonb@google.com>
4258
4259 * configure.ac: Add check for gnu_indirect_function support in
4260 the toolchain building binutils.
4261 * configure: Rebuild.
4262
9370ce59 42632011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
4264
4265 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
4266 plugin only symbols.
4267 (Symbol_table::sized_finalize_symbol) Mark symbol only present
4268 in plugin files as not needed in the symbol table.
4269
4cf7a849
ST
42702011-02-11 Sriraman Tallam <tmsriram@google.com>
4271
4272 * output.cc (Output_section::add_input_section): Delay fill
4273 generation for section ordering.
4274
b578bd7d
ILT
42752011-02-09 Ian Lance Taylor <iant@google.com>
4276
4277 PR gold/12316
4278 * object.h (class Sized_relobj): Remove clear_local_symbols.
4279 * reloc.cc (Sized_relobj::do_relocate): Don't call
4280 clear_local_symbols.
4281
9370ce59 42822011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
4283
4284 * plugin.cc (is_visible_from_outside): Return true for symbols
4285 in the -u option.
4286
55382fb7
ILT
42872011-02-04 Jeffrey Yasskin <jyasskin@google.com>
4288
4289 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
4290 filename.
4291
4e271fff
ST
42922011-02-02 Sriraman Tallam <tmsriram@google.com>
4293
4294 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 4295 to std::string.
4e271fff 4296 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 4297 section_name to be std::string.
4e271fff
ST
4298 (is_function_ctor_or_dtor): Change type of parameter to std::string.
4299
d433c3ac
ILT
43002011-01-25 Ian Lance Taylor <iant@google.com>
4301
4302 * script.cc (script_add_extern): Rewrite to use
4303 add_symbol_reference.
4304
880473a6
DK
43052011-01-25 Doug Kwan <dougkwan@google.com>
4306
d433c3ac 4307 * icf.cc (get_section_contents): Always lock section's object.
880473a6 4308
f30f86fa
ILT
43092011-01-24 Ian Lance Taylor <iant@google.com>
4310
4311 * options.h (class General_options): Accept
4312 --no-detect-odr-violations.
4313
8e51a0b9
ILT
43142011-01-24 Ian Lance Taylor <iant@google.com>
4315
4316 * version.cc (version_string): Bump to 1.11.
4317
0f3b89d8
ILT
43182011-01-24 Ian Lance Taylor <iant@google.com>
4319
4320 * plugin.cc (class Plugin_rescan): Define new class.
4321 (Plugin_manager::claim_file): Set any_claimed_.
4322 (Plugin_manager::save_archive): New function.
4323 (Plugin_manager::save_input_group): New function.
4324 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
4325 necessary.
4326 (Plugin_manager::new_undefined_symbol): New function.
4327 (Plugin_manager::rescan): New function.
4328 (Plugin_manager::rescannable_defines): New function.
4329 (Plugin_manager::add_input_file): Set any_added_.
4330 * plugin.h (class Plugin_manager): define new fields rescannable_,
4331 undefined_symbols_, any_claimed_, and any_added_. Declare
4332 Plugin_rescan as friend. Declare new functions.
4333 (Plugin_manager::Rescannable): Define type.
4334 (Plugin_manager::Rescannable_list): Define type.
4335 (Plugin_manager::Undefined_symbol_list): Define type.
4336 (Plugin_manager::Plugin_manager): Initialize new fields.
4337 * archive.cc (Archive::defines_symbol): New function.
4338 (Add_archive_symbols::run): Pass archive to plugins if any.
4339 * archive.h (class Archive): Declare defines_symbol.
4340 * readsyms.cc (Input_group::~Input_group): New function.
4341 (Finish_group::run): Pass input_group to plugins if any.
4342 * readsyms.h (class Input_group): Declare destructor.
4343 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
4344 any.
4345
3bb951e5
ILT
43462011-01-10 Ian Lance Taylor <iant@google.com>
4347
4348 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
4349 section as relro.
4350 (Layout::set_segment_offsets): Reset increase_relro before calling
4351 set_section_addresses a second time.
4352
0aa45fac
CC
43532011-01-04 Cary Coutant <ccoutant@google.com>
4354
4355 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
4356 sections before NOBITS sections.
4357
0db46eb4
L
43582011-01-01 H.J. Lu <hongjiu.lu@intel.com>
4359
4360 * version.cc (print_version): Update copyright to 2011.
4361
829c9745
CC
43622010-12-23 Cary Coutant <ccoutant@google.com>
4363
4364 * output.h (Output_data_reloc::add_output_section): Pass OD instead
4365 of OS to this->add. Add OD parameter to second form of the function.
4366
7500420b
ILT
43672010-12-20 Ian Lance Taylor <iant@google.com>
4368
4369 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
4370 second of two consecutive entries with same offset.
4371
f8e9a930
RW
43722010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4373
4374 * testsuite/Makefile.am (ifuncmain2static_LDADD)
4375 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
4376 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
4377 to avoid unneeded links against $(LDADD).
4378 * testsuite/Makefile.in: Regenerate.
4379
2fbb4320
ILT
43802010-12-15 Ian Lance Taylor <iant@google.com>
4381
4382 PR gold/12324
4383 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
4384 for R_X86_64_32 and R_X86_64_PC32.
4385 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
4386 ver_matching_def_pic.o.
4387 (ver_matching_def_pic.o): New target.
4388
fedb228d
RW
43892010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4390
4391 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
4392 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
4393 Move definition before File_read::View member definitions.
4394 (File_read::View::~View): Initialize and hold lock before
4395 updating current_mapped_bytes.
4396
9b547ce6
RW
43972010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4398
4399 * dwarf_reader.cc: Remove outdated comment.
4400 * gold-threads.cc: Fix typo in error message.
4401 * archive.cc: Fix typos in comments.
4402 * archive.h: Likewise.
4403 * arm-reloc-property.cc: Likewise.
4404 * arm-reloc-property.h: Likewise.
4405 * arm-reloc.def: Likewise.
4406 * arm.cc: Likewise.
4407 * attributes.h: Likewise.
4408 * cref.cc: Likewise.
4409 * ehframe.cc: Likewise.
4410 * fileread.h: Likewise.
4411 * gold.h: Likewise.
4412 * i386.cc: Likewise.
4413 * icf.cc: Likewise.
4414 * incremental.h: Likewise.
4415 * int_encoding.cc: Likewise.
4416 * layout.h: Likewise.
4417 * main.cc: Likewise.
4418 * merge.h: Likewise.
4419 * object.cc: Likewise.
4420 * object.h: Likewise.
4421 * options.cc: Likewise.
4422 * readsyms.cc: Likewise.
4423 * reduced_debug_output.cc: Likewise.
4424 * reloc.cc: Likewise.
4425 * script-sections.cc: Likewise.
4426 * sparc.cc: Likewise.
4427 * symtab.h: Likewise.
4428 * target-reloc.h: Likewise.
4429 * target.cc: Likewise.
4430 * target.h: Likewise.
4431 * timer.cc: Likewise.
4432 * timer.h: Likewise.
4433 * x86_64.cc: Likewise.
4434
83e17bd5
CC
44352010-12-09 Cary Coutant <ccoutant@google.com>
4436
4437 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
4438 stack.
4439 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
4440 parameter; change all callers.
4441 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
4442 * options.h (warn_execstack): New option.
4443
017257f8
DK
44442010-12-07 Doug Kwan <dougkwan@google.com>
4445
4446 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
4447 like function call relocations.
4448
c20cbc06
ILT
44492010-12-07 Ian Lance Taylor <iant@google.com>
4450
4451 * archive.cc (Archive::get_elf_object_for_member): Permit
4452 punconfigured to be NULL.
4453 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
4454 (Archive::include_member): Pass NULL to get_elf_object_for_member
4455 if we searched for the archive and this is the first included
4456 object.
4457
4dbfafcc
ILT
44582010-12-01 Ian Lance Taylor <iant@google.com>
4459
4460 * dwarf_reader.h (class Sized_dwarf_line_info): Add
4461 track_relocs_type_ field.
4462 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4463 Set track_relocs_type_.
4464 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
4465 contents when using RELA relocs.
4466 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
4467 reloc_map_.
4468 * reloc.cc (Track_relocs::next_addend): New function.
4469 * reloc.h (class Track_relocs): Declare next_addend.
4470
e5e19edd
ILT
44712010-12-01 Ian Lance Taylor <iant@google.com>
4472
4473 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
4474 virtual destructor.
4475
9a5ce24c
ILT
44762010-12-01 Ian Lance Taylor <iant@google.com>
4477
4478 * README: Update compilers known to work and fail.
4479
c7791212
NC
44802010-11-23 Matthias Klose <doko@ubuntu.com>
4481
4482 * configure.in: For --enable-gold, handle value `default' instead of
4483 `both*'. Always install ld as ld.bfd, install as ld if gold is
4484 not the default.
4485 * configure: Regenerate.
4486
0ad220c9
DK
44872010-11-18 Doug Kwan <dougkwan@google.com>
4488
4489 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
4490 and right_alignment to be zero. Store result alignment only if it is
4491 greater than existing alignment.
4492
ab8056e0
CC
44932010-11-16 Cary Coutant <ccoutant@google.com>
4494
4495 PR gold/12220
4496 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4497 Check for ".zdebug_line".
4498
fd064a5b
CC
44992010-11-16 Doug Kwan <dougkwan@google.com>
4500 Cary Coutant <ccoutant@google.com>
4501
4502 * output.h (Output_segment::set_section_addresses): Pass increase_relro
4503 by reference; adjust all callers.
4504 * output.cc (Output_segment::set_section_addresses): Adjust references
4505 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
4506 list is empty.
4507 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
4508 end at page boundary.
4509
6fc6ea19
CC
45102010-11-16 Cary Coutant <ccoutant@google.com>
4511
4512 PR gold/12220
4513 * layout.cc (Layout::choose_output_section): Transform names of
4514 compressed sections even when using a script with a SECTIONS clause.
4515 (Layout::output_section_name): Remove code to transform
4516 compressed debug section names.
4517 * output.cc (Output_section::add_input_section): Use uncompressed
4518 section size when tracking input sections.
4519
95a2c8d6
RS
45202010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
4521
4522 * symtab.h (Symbol::NON_PIC_REF): Remove.
4523 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
4524 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
4525 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
4526 (Symbol::use_plt_offset): Take a flags argument and pass it
4527 directly to needs_dynamic_reloc. Restrict check for undefined
4528 weak symbols to function calls.
4529 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
4530 (Target_arm::Scan::global): Use it.
4531 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
4532 (Target_arm::Relocate::relocate): Likewise.
4533 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
4534 parameter with an r_type parameter. Use get_reference_flags
4535 to get the flags.
4536 (Target_arm::Relocate::relocate): Update accordingly.
4537 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
4538 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
4539 (Target_i386::Scan::global): Likewise.
4540 (Target_i386::Relocate::relocate): Likewise.
4541 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
4542 parameter with an r_type parameter. Use get_reference_flags
4543 to get the flags.
4544 (Target_i386::Relocate::relocate): Update accordingly.
4545 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
4546 (Target_powerpc::Scan::global): Use it.
4547 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
4548 (Target_powerpc::Relocate::relocate): Likewise.
4549 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
4550 (Target_sparc::Scan::global): Use it.
4551 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
4552 (Target_sparc::Relocate::relocate): Likewise.
4553 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
4554 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
4555 (Target_x86_64::Scan::global): Likewise.
4556 (Target_x86_64::Relocate::relocate): Likewise.
4557
f625ae50
DK
45582010-11-08 Doug Kwan <dougkwan@google.com>
4559 Cary Coutant <ccoutant@google.com>
4560
4561 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
4562 (Arm_exidx_merge_section::section_contents_): New data member.
4563 (Arm_input_section::Arm_input_section): Initialize original_contents_.
4564 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 4565 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
4566 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
4567 in parameters instead of calling Object::section_contents without
4568 locking.
4569 (Arm_output_section::group_section): New parameter TASK. Pass it
4570 to callees that need locking objects.
4571 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
4572 to lock EXIDX input sections. Fix a formatting issue. Call
4573 Arm_exidx_merged_section::build_contents to create merged section
4574 contents.
4575 (Arm_output_section::create_stub_group): New parameter TASK. Use it
4576 to lock object of stub table owner.
4577 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
4578 TEXT_SIZE to initialize data member TEXT_SIZE_.
4579 (Arm_exidx_input_section::addralign): Fix typo in comment.
4580 (Arm_exidx_input_section::text_size): New method.
4581 (Target_arm::do_relax): New parameter TASK. Pass it to callees
4582 that require locking objects. Lock objects before scanning for stubs
4583 and updating local symbols.
4584 (Arm_input_section<big_endian>::init): Copy contents of original
4585 input section.
2e702c99 4586 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
4587 original input section instead of calling Object::section_contents
4588 without locking.
4589 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
4590 size without calling Object::section_size().
4591 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
4592 for size. Allocate a buffer for merged EXIDX entries.
4593 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 4594 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
4595 building code to Arm_exidx_merged_section::build_contetns. Write
4596 out contetns in buffer instead of building it on the fly.
4597 (Arm_relobj::make_exidx_input_section): Also pass text section size
4598 to Arm_exidx_input_section constructor.
4599 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
4600 (Arm_dynobj::do_read_symbols): Fix memory leak.
4601 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
4602 * target.h: (class Task): Add forward declaration.
4603 (Target::relax): Add new parameter TASK and pass it to
4604 Target::do_relax().
4605 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
4606
5f9bcf58
CC
46072010-11-05 Cary Coutant <ccoutant@google.com>
4608
4609 PR gold/10708
4610 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
4611 object when reading from the file.
4612 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
4613 second layout pass.
4614 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
4615 when reading section contents.
4616 (get_section_contents): Likewise.
4617 (icf::find_identical_sections): Likewise.
4618 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
4619 object when reading from the file.
4620 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
4621 the object when doing deferred section layout.
4622
e597fa08
NC
46232010-11-03 Nick Clifton <nickc@redhat.com>
4624
4625 PR gold/12001
4626 * script.h (class Symbol_assignment: name): New member. Returns
4627 the name of the symbol.
4628 * scrfipt.cc (Script_options::is_pending_assignment): New member.
4629 Returns true if the given symbol name is on the list of
4630 assignments wating to be processed.
4631 * archive.cc (should_incldue_member): If the symbol is undefined,
4632 check to see if it is on the list of symbols pending assignment.
4633
3f9a3278
ILT
46342010-11-03 Ryan Mansfield <rmansfield@qnx.com>
4635
4636 * script-sections.cc (Script_sections::find_memory_region): Check
4637 for a NULL output section pointer.
4638
d06fb4d1
DK
46392010-10-29 Doug Kwan <dougkwan@google.com>
4640
4641 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
4642 Output_section::add_relaxed_input_section.
4643 * output.cc (Output_section::add_relaxed_input_section): Add new
4644 arguments LAYOUT and NAME. Set section order index.
4645 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
4646 Copy section order index.
4647 * output.h (Output_section::add_relaxed_input_section): Add new
4648 arguments LAYOUT and NAME.
4649
90e24de5
ILT
46502010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4651
4652 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 4653 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
4654 * testsuite/Makefile.in: Regenerate.
4655
c9484ea5
DK
46562010-10-20 Doug Kwan <dougkwan@google.com>
4657
4658 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
4659 without SHF_LINK_ORDER flags.
4660 * layout.cc (Layout::choose_output_section): Do not filter
4661 SHF_LINK_ORDER flag in a relocatable link.
4662
5bc2f5be
CC
46632010-10-17 Cary Coutant <ccoutant@google.com>
4664
4665 * output.h (Output_segment::set_section_addresses): Change function
4666 signature. Update all callers.
4667 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
4668 sections.
4669 (Output_segment::set_section_addresses): Align after last TLS
4670 section. Add padding before last relro section instead of after.
4671
0c91cf04
DK
46722010-10-17 Doug Kwan <dougkwan@google.com>
4673
4674 * gold/arm.cc (Target_arm::got_section): Use correct order and set
4675 GOT output section to be writable.
4676
8c21d9d3
CC
46772010-10-14 Cary Coutant <ccoutant@google.com>
4678
4679 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
4680 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
4681 * gold.cc (queue_initial_tasks): Check parameters for incremental link
4682 mode.
4683 * incremental.cc (report_command_line): Ignore all forms of
4684 --incremental.
4685 * layout.cc (Layout::Layout): Check parameters for incremental link
4686 mode.
4687 * options.cc (General_options::parse_incremental): New function.
4688 (General_options::parse_no_incremental): New function.
4689 (General_options::parse_incremental_full): New function.
4690 (General_options::parse_incremental_update): New function.
4691 (General_options::incremental_mode_): New data member.
4692 (General_options::finalize): Check incremental_mode_.
4693 * options.h (General_options): Update help text for --incremental.
4694 Add --no-incremental, --incremental-full, --incremental-update.
4695 (General_options::Incremental_mode): New enum type.
4696 (General_options::incremental_mode): New function.
4697 (General_options::incremental_mode_): New data member.
4698 * parameters.cc (Parameters::incremental_mode_): New data member.
4699 (Parameters::set_options): Set incremental_mode_.
4700 (Parameters::set_incremental_full): New function.
4701 (Parameters::incremental): New function.
4702 (Parameters::incremental_update): New function.
4703 (set_parameters_incremental_full): New function.
4704 * parameters.h (Parameters::set_incremental_full): New function.
4705 (Parameters::incremental): New function.
4706 (Parameters::incremental_update): New function.
4707 (Parameters::incremental_mode_): New data member.
4708 (set_parameters_incremental_full): New function.
4709 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
4710 incremental link mode.
4711 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
4712 (Sized_relobj::do_relocate_sections): Likewise.
4713 * testsuite/Makefile.am (incremental_test): Use --incremental-full
4714 option.
4715 * testsuite/Makefile.in: Regenerate.
4716 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 4717
bb32aa18 47182010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
4719
4720 * script-sections.h (class Script_sections): Make
4721 Sections_elements typedef public.
4722 * script-sections.cc (class Sort_output_sections): Add elements_
4723 field. Add constructor which sets it; change all callers.
4724 (Sort_output_sections::is_before): New function.
4725 (Sort_output_sections::operator()): Call is_before.
4726 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
4727 conditional.
4728 * testsuite/script_test_10.sh: New test. Test script section
4729 order.
4730 * testsuite/script_test_10.t: Likewise.
4731 * testsuite/script_test_10.s: Likewise.
4732 * testsuite/Makefile.am: Wrap the cross linker tests and the
4733 common tests into NATIVE_OR_CROSS_LINKER.
4734 (check_SCRIPTS): Add script_test_10.sh.
4735 (check_DATA): Add script_test_10.stdout.
4736 (script_test_10.o, script_test_10): New targets.
4737 (script_test_10.stdout): New target.
4738 * configure, testsuite/Makefile.in: Regenerate.
4739
3cef7179
ILT
47402010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4741
4742 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
4743 error for the deprecated relocations.
4744 (Target_arm::Scan::global): Likewise.
4745 (Target_arm::Relocate::relocate): Likewise.
4746
7411e9a8
RS
47472010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
4748
4749 * fileread.cc (Input_file::find_file): Initialize *found_name
4750 and *namep when using the fallback search for case 4.
4751
6a9da32a
CC
47522010-10-11 Cary Coutant <ccoutant@google.com>
4753
4754 * options.h (class General_options): Redefine -z lazy as an alias for
4755 the negation of -z now.
4756
ac897c20
ILT
47572010-10-11 Ian Lance Taylor <iant@google.com>
4758
4759 * resolve.cc (symbol_to_bits): Report the value of the unsupported
4760 binding.
4761
ea5cae92
NC
47622010-10-06 Nick Clifton <nickc@redhat.com>
4763
4764 * script-sections.cc(class Memory_region): Remove
4765 current_lma_offset_ field. Rename current_vma_offset_ to
4766 current_offset_. Add last_section_ field.
4767 (Memory_region::get_current_vma_address): Rename to
4768 get_current_address.
4769 (Memory_region::get_current_lma_address): Delete.
4770 (Memory_region::increment_vma_offset): Rename to
4771 increment_offset.
4772 (Memory_region::increment_lma_offset): Delete.
4773 (Memory_region::attributes_compatible): New method. Returns
4774 true if the provided section is compatible with the region.
4775 (Memory_region::get_last_section): New method. Returns the last
4776 section to use the region.
4777 (Memory_region::set_last_section): New method. Stores the last
4778 section to use the region.
4779 (Script_sections::block_in_region): New method. Returns true if
4780 a block of memory is contained within a region.
4781 (Script_sections::find_memory_region): New method. Locates a
4782 memory region to be used to set a VMA or LMA address.
4783 (Output_section_definition::set_section_addresses): Add code to
4784 check for addresses set by memory regions.
4785 (Output_segment::set_section_addresses): Remove memory region
4786 walking code.
4787 (Script_sections::create_segment): Add a warning if a header
4788 segment is created outside of any region.
4789 * script-sections.h (class Script_sections): Add prototypes for
4790 find_memory_region and block_in_region methods.
4791 * testsuite/memory_test.s: Use .long instead of .word.
4792 * testsuite/memory_test.t: Add some more output sections.
4793 * testsuite/memory_test.sh: Update expected output.
4794
a9bfd952
DK
47952010-10-02 Doug Kwan <dougkwan@google.com>
4796
4797 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
4798 defintion to symtab.h
4799 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
4800 declaration to defintion.
4801
bacff3ab
NC
48022010-10-01 Nick Clifton <nickc@redhat.com>
4803
4804 * expression.cc (eval): Replace dummy argument with NULL.
4805 (eval_maybe_dot): Check for a NULL result section pointer.
4806 (Symbol_expression::value): Likewise.
4807 (Dot_expression::value): Likewise.
4808 (BINARY_EXPRESSION): Likewise.
4809 (Max_expression::value): Likewise.
4810 (Min_expression::value): Likewise.
4811 (Absolute_expression::value): Likewise.
4812 (Addr_expression::value_from_output_section): Likewise.
4813 (Loaddddr_expression::value_from_output_section): Likewise.
4814 (Segment_start_expression::value): Likewise.
4815 * script-sections.cc
4816 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
4817 argument with NULL.
4818 (Sections_elememt_dot_assignment::set_section_addresses):
4819 Likewise.
4820 (Output_data_expression::do_write_to_buffer): Likewise.
4821 (Output_section_definition::finalize_symbols): Likewise.
4822 (Output_section_definition::set_section_addresses): Likewise.
4823
f81bc8b5
DK
48242010-09-30 Doug Kwan <dougkwan@google.com>
4825
4826 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
4827
c95e9f27
ST
48282010-09-28 Sriraman Tallam <tmsriram@google.com>
4829
4830 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 4831 function.
c95e9f27
ST
4832 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
4833 virtual function.
4834 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
4835 virtual function.
4836 * icf.cc (get_section_contents): Inline merge sections only when
4837 target allows it.
4838
3cac54d2
RW
48392010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4840
4841 * configure: Regenerate.
4842
2904037a
ILT
48432010-09-17 Ian Lance Taylor <iant@google.com>
4844
4845 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
4846 * testsuite/Makefile.am (memory_test.o): New target.
4847 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
4848 memory_test.t.
4849 * testsuite/Makefile.in: Rebuild.
2904037a 4850
bca7fb63
DK
48512010-09-17 Doug Kwan <dougkwan@google.com>
4852
4853 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
4854 defintion if relocation uses GOT entries of the symbol.
4855 * testsuite/icf_safe_test.sh: Fix test.
4856 * testsuite/icf_safe_so_test.sh: Fix test.
4857
4ef28648
CC
48582010-09-16 Cary Coutant <ccoutant@google.com>
4859
4860 * script_sections.cc (class Memory_region): Remove "NULL" from
4861 vector initializations.
4862
793990de
CC
48632010-09-15 Cary Coutant <ccoutant@google.com>
4864
4865 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
4866 Resolve forwarding symbols.
4867
81e015e2
DK
48682010-09-15 Doug Kwan <dougkwan@google.com>
4869
4870 * gold/testsuite/script_test_3.t: Add ARM special sections.
4871 * gold/testsuite/script_test_4.t: Same.
4872 * gold/testsuite/script_test_5.t: Same.
4873 * gold/testsuite/script_test_6.t: Same.
4874 * gold/testsuite/script_test_7.t: Same.
4875 * gold/testsuite/script_test_7.t: Same.
4876 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
4877
36171d64
CC
48782010-09-14 Cary Coutant <ccoutant@google.com>
4879
4880 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
4881 (Target_x86_64::Relocate::relocate_tls): Replace check for
4882 saw_tls_block_reloc_ with test for executable section.
4883
d89051bd
CC
48842010-09-12 Cary Coutant <ccoutant@google.com>
4885
4886 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
4887 position-independent executables to shared libraries need dynamic
4888 relocations.
4889 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
4890 position-independent executables.
4891 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
4892 * testsuite/Makefile.in: Regenerate.
4893
fca41f0f
NC
48942010-09-10 Nick Clifton <nickc@redhat.com>
4895
4896 PR gold/11997
4897 * testsuite/memory_test.t: Discard any sections that are not
4898 needed.
4899
6695e4b3
L
49002010-09-09 H.J. Lu <hongjiu.lu@intel.com>
4901
4902 PR gold/11996
4903 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
4904 "This::" to work around a bug in gcc 4.2.
4905
4906 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
4907
0f72bf6f
RÁE
49082010-09-09 Rafael Espindola <espindola@google.com>
4909
4910 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
4911 sections with different PF_X flags in the same segment.
4912 (Layout::find_first_load_seg): Search all segments to find the first
4913 one.
4914 * options.h (rosegment): New.
4915
49162010-09-08 Rafael Espindola <espindola@google.com>
a6577478 4917
05a79166 4918 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 4919
aa98ff75
DK
49202010-09-08 Doug Kwan <dougkwan@google.com>
4921
4922 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
4923 (Arm_relobj::do_relocate_sections): Add new parameter for output
4924 file to match the parent.
4925 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
4926 of local symbols instead of input values. Update code to track
4927 changes in gold::relocate_section.
4928 * object.cc (Sized_relobj::compute_final_local_value): New methods.
4929 (Sized_relobj::compute_final_local_value_internal): New methods.
4930 (Sized_relobj::do_finalize_local_symbols): Move code from loop
4931 body into private version of Sized_relobj::compute_final_local_value.
4932 Call the inline method.
4933 * object.h (Symbol_value::Symbol_value): Define destructor. Free
4934 merged symbol value if there is one.
4935 (Symbol_value::has_output_value): New method defintiion.
4936 (Sized_relobj::Compute_final_local_value_status): New enum type.
4937 (Sized_relobj::compute_final_local_value): New methods.
4938 (Sized_relobj::compute_final_local_value_internal): New methods.
4939 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
4940 and arm_cortex_a8.sh.
4941 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
4942 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
4943 New tests.
4944 * Makefile.in: Regenerate.
4945 * testsuite/arm_bl_out_of_range.s: Update test.
4946 * testsuite/thumb_bl_out_of_range.s: Ditto.
4947 * testsuite/thumb_blx_out_of_range.s: Ditto.
4948 * testsuite/arm_branch_out_of_range.sh: New file.
4949 * testsuite/arm_cortex_a8.sh: Ditto.
4950 * testsuite/arm_cortex_a8_b.s: Ditto.
4951 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
4952 * testsuite/arm_cortex_a8_b_local.s: Ditto.
4953 * testsuite/arm_cortex_a8_bl.s: Ditto.
4954 * testsuite/arm_cortex_a8_blx.s: Ditto.
4955 * testsuite/arm_cortex_a8_local.s: Ditto.
4956 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
4957 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
4958
05a79166
L
49592010-09-08 Rafael Espindola <espindola@google.com>
4960
4961 * Makefile.am (memory_test.stdout): Run readelf with -W.
4962 * Makefile.in: Regenerate.
4963 * testsuite/memory_test.sh: Make the regexps accept both 32 and
4964 64 bit output.
4965
33dbc701
RÁE
49662010-09-08 Rafael Espindola <espindola@google.com>
4967
4968 * script-sections.cc (Script_sections::add_memory_region): Convert
4969 field precision to int.
4970 * script.cc (script_set_section_region, script_set_section_region):
4971 Convert field precision to int.
4972
731ca54a
RÁE
49732010-09-08 Rafael Espindola <espindola@google.com>
4974
4975 * arm.cc (do_finalize_sections): Create the __exidx_start and
4976 __exdix_end symbols even when the section is missing.
4977
7f8cd844
NC
49782010-09-08 Nick Clifton <nickc@redhat.com>
4979
4980 * README: Remove claim that MEMORY is not supported.
4981 * expression.cc (script_exp_function_origin)
4982 (script_exp_function_length): Move from here to ...
4983 * script.cc: ... here.
4984 (script_set_section_region, script_add_memory)
4985 (script_parse_memory_attr, script_include_directive): New
4986 functions.
4987 * script-sections.cc
4988 (class Memory_region): New class.
4989 (class Output_section_definition): Add set_memory_region,
4990 set_section_vma, set_section_lma and get_section_name methods.
4991 (class Script_Sections): Add add_memory_region,
4992 find_memory_region, find_memory_region_origin,
4993 find_memory_region_length and set_memory_region methods.
4994 Have set_section_addresses method walk the list of set memory
4995 regions.
4996 Extend the print methos to display memory regions.
4997 * script-sections.h: Add prototypes for new methods.
4998 Add enum for MEMORY region attributes.
4999 * yyscript.y: Add support for parsing MEMORY regions.
5000 * script-c.h: Add prototypes for new functions.
5001 * testsuite/Makefile.am: Add test of MEMORY region functionality.
5002 * testsuite/Makefile.in: Regenerate.
5003 * testsuite/memory_test.sh: New script.
5004 * testsuite/memory_test.s: New assembler source file.
5005 * testsuite/memory_test.t: New linker script.
5006
a4649286
DK
50072010-08-27 Doug Kwan <dougkwan@google.com>
5008
5009 * gold/resolve.cc (Symbol_table::should_override): Let a weak
5010 reference override an existing dynamic weak reference.
5011 * testsuite/Makefile.am: Add new test dyn_weak_ref.
5012 * testsuite/Makefile.in: Regenerate.
5013 * testsuite/dyn_weak_ref.sh: New file.
5014 * testsuite/dyn_weak_ref_1.c: Ditto.
5015 * testsuite/dyn_weak_ref_2.c: Ditto.
5016
b56648ad
ILT
50172010-08-27 Ian Lance Taylor <iant@google.com>
5018
5019 * incremental.h (class Incremental_input_entry): Add virtual
5020 destructor.
5021
809313cb
ILT
50222010-08-27 Ian Lance Taylor <iant@google.com>
5023
5024 * testsuite/start_lib_test_3.c: Mark t3 as used.
5025
11e32464
NC
50262010-08-27 Nick Clifton <nickc@redhat.com>
5027
5028 * options.cc (version_script): Fix small typo in previous
5029 whitespace tidyup.
5030
ca09d69a
NC
50312010-08-25 Nick Clifton <nickc@redhat.com>
5032
5033 * archive.cc: Formatting fixes: Remove whitespace between
5034 typename and following asterisk. Remove whitespace between
5035 function name and opening parenthesis.
5036 * archive.h: Likewise.
5037 * arm.cc: Likewise.
5038 * attributes.cc: Likewise.
5039 * attributes.h: Likewise.
5040 * common.cc: Likewise.
5041 * copy-relocs.cc: Likewise.
5042 * dirsearch.h: Likewise.
5043 * dynobj.cc: Likewise.
5044 * ehframe.cc: Likewise.
5045 * ehframe.h: Likewise.
5046 * expression.cc: Likewise.
5047 * fileread.cc: Likewise.
5048 * fileread.h: Likewise.
5049 * gc.h: Likewise.
5050 * gold-threads.cc: Likewise.
5051 * gold.cc: Likewise.
5052 * i386.cc: Likewise.
5053 * icf.h: Likewise.
5054 * incremental-dump.cc: Likewise.
5055 * incremental.cc: Likewise.
5056 * layout.cc: Likewise.
5057 * layout.h: Likewise.
5058 * main.cc: Likewise.
5059 * merge.cc: Likewise.
5060 * merge.h: Likewise.
5061 * object.cc: Likewise.
5062 * object.h: Likewise.
5063 * options.cc: Likewise.
5064 * options.h: Likewise.
5065 * output.cc: Likewise.
5066 * output.h: Likewise.
5067 * plugin.cc: Likewise.
5068 * plugin.h: Likewise.
5069 * powerpc.cc: Likewise.
5070 * reloc.cc: Likewise.
5071 * script-c.h: Likewise.
5072 * script-sections.cc: Likewise.
5073 * script.cc: Likewise.
5074 * stringpool.cc: Likewise.
5075 * symtab.cc: Likewise.
5076 * symtab.h: Likewise.
5077 * target.cc: Likewise.
5078 * timer.cc: Likewise.
5079 * timer.h: Likewise.
5080 * version.cc: Likewise.
5081 * x86_64.cc: Likewise.
5082
b8fa8750
NC
50832010-08-24 Nick Clifton <nickc@redhat.com>
5084
5085 PR 11899
5086 * layout.cc (segment_precedes): Sort segments by their physical
5087 addresses, if they have been set.
5088
9919d93b
CC
50892010-08-23 Cary Coutant <ccoutant@google.com>
5090
5091 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
5092 symbols data.
5093 (Lib_group::include_member): Unlock object after deleting its
5094 symbols data.
5095 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
5096 the bug fixed here.
5097
97b4be1c
CC
50982010-08-19 Neil Vachharajani <nvachhar@google.com>
5099 Cary Coutant <ccoutant@google.com>
5100
5101 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
5102 constructor, and set_blocker.
5103 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
5104 readsyms_blocker_.
5105 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
5106 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
5107 * testsuite/Makefile.am (start_lib_test): New test case.
5108 * testsuite/Makefile.in: Regenerate.
5109 * testsuite/start_lib_test_main.c: New file.
5110 * testsuite/start_lib_test_1.c: New file.
5111 * testsuite/start_lib_test_2.c: New file.
5112 * testsuite/start_lib_test_3.c: New file.
5113
dd0b1884
ILT
51142010-08-19 Ian Lance Taylor <iant@google.com>
5115
5116 * Makefile.in: Rebuild with automake 1.11.1.
5117 * aclocal.m4: Likewise.
5118 * testsuite/Makefile.in: Likewise.
5119
7223e9ca
ILT
51202010-08-19 Ian Lance Taylor <iant@google.com>
5121
5122 PR 10893
5123 * i386.cc (class Output_data_plt_i386): Update declarations.
5124 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
5125 local_ifuncs_ fields.
5126 (Target_i386::do_plt_section_for_global): New function.
5127 (Target_i386::do_plt_section_for_local): New function.
5128 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
5129 parameter; change all callers. Initialize global_ifuncs_ and
5130 local_ifuncs_. If doing a static link define __rel_iplt_start and
5131 __rel_iplt_end.
5132 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
5133 (Output_data_plt_i386::add_local_ifunc_entry): New function.
5134 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
5135 symbols.
5136 (Target_i386::make_plt_section): New function, broken out of
5137 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
5138 (Target_i386::make_plt_entry): Call make_plt_section.
5139 (Target_i386::make_local_ifunc_plt_entry): New function.
5140 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
5141 (Target_i386::Scan::local): Handle IFUNC symbols. Add
5142 R_386_IRELATIVE to switch.
5143 (Target_i386::Scan::global): Likewise.
5144 (Target_i386::Relocate::relocate): Likewise.
5145 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
5146 switch.
5147 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
5148 (Target_x86_64::do_plt_section_for_global): New function.
5149 (Target_x86_64::do_plt_section_for_local): New function.
5150 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
5151 parameter; change all callers. If doing a static link define
5152 __rela_iplt_start and __rela_iplt_end.
5153 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
5154 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
5155 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
5156 to point to .plt.
5157 (Target_x86_64::make_local_ifunc_plt_entry): New function.
5158 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
5159 switch.
5160 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
5161 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
5162 R_X86_64_IRELATIVE to switch.
5163 (Target_x86_64::Scan::global): Likewise.
5164 (Target_x86_64::Relocate::relocate): Likewise.
5165 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
5166 switch.
5167 * target.h (class Target): Add plt_section_for_global and
5168 plt_section_for_local functions. Add do_plt_section_for_global
5169 and do_plt_section_for_local virtual functions.
5170 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
5171 clarifying comments.
5172 (Symbol::use_plt_offset): Handle IFUNC symbol.
5173 * object.cc (Sized_relobj::Sized_relobj): Initialize
5174 local_plt_offsets_.
5175 (Sized_relobj::local_has_plt_offset): New function.
5176 (Sized_relobj::local_plt_offset): New function.
5177 (Sized_relobj::set_local_plt_offset): New function.
5178 (Sized_relobj::do_count): Handle IFUNC symbol.
5179 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
5180 a bit away from input_shndx_ field. Add set_is_func_symbol and
5181 is_ifunc_symbol functions.
5182 (class Sized_relobj): Update declarations. Remove Tls_got_entry
5183 and Local_tls_got_offsets. Define Local_plt_offsets. Add
5184 local_plt_offsets_ field.
5185 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
5186 * output.h (class Output_section_data): Add non-const
5187 output_section function.
5188 (class Output_data_got): Update declarations.
5189 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
5190 Add use_plt_offset parameter to global and local constructors.
5191 Change all callers. Change local_sym_index_ field to 31 bits.
5192 Change GSYM_CODE and CONSTANT_CODE accordingly.
5193 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
5194 doing a static link don't set sh_link field.
5195 (Output_data_got::Got_entry::write): Use PLT offset if
5196 appropriate.
5197 (Output_data_got::add_global_plt): New function.
5198 (Output_data_got::add_local_plt): New function.
5199 * target-reloc.h (relocate_section): Handle IFUNC symbol.
5200 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
5201 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
5202 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
5203 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
5204 IFUNC conditional.
5205 * testsuite/ifunc-sel.h: New file.
5206 * testsuite/ifuncmain1.c: New file.
5207 * testsuite/ifuncmain1vis.c: New file.
5208 * testsuite/ifuncmod1.c: New file.
5209 * testsuite/ifuncdep2.c: New file.
5210 * testsuite/ifuncmain2.c: New file.
5211 * testsuite/ifuncmain3.c: New file.
5212 * testsuite/ifuncmod3.c: New file.
5213 * testsuite/ifuncmain4.c: New file.
5214 * testsuite/ifuncmain5.c: New file.
5215 * testsuite/ifuncmod5.c: New file.
5216 * testsuite/ifuncmain6pie.c: New file.
5217 * testsuite/ifuncmod6.c: New file.
5218 * testsuite/ifuncmain7.c: New file.
5219 * configure, testsuite/Makefile.in: Rebuild.
5220
56f75c03
ILT
52212010-08-18 Ian Lance Taylor <iant@google.com>
5222
5223 * incremental.cc
5224 (Output_section_incremental_inputs::write_input_files): Add cast
5225 to avoid signed/unsigned comparison warning.
5226 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5227
55455f89
CC
52282010-08-12 Cary Coutant <ccoutant@google.com>
5229
5230 * common.cc (Sort_commons::operator()): Remove unnecessary code.
5231
e2054bcb
ILT
52322010-08-13 Ian Lance Taylor <iant@google.com>
5233
5234 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
5235
74f67560
DK
52362010-08-12 Cary Coutant <ccoutant@google.com>
5237 Doug Kwan <dougkwan@google.com>
5238
5239 * resolve.cc (Symbol_table::should_override): When a weak dynamic
5240 defintion overrides non-weak undef, remember that the original undef
5241 is not weak.
5242 * symtab.cc (Symbol_table::sized_write_global): For undef without
5243 an original weak binding, set binding to global in output.
5244 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
5245 * testsuite/Makefile.in: Regenerate.
5246 * testsuite/strong_ref_weak_def.sh: New file.
5247 * testsuite/strong_ref_weak_def_1.c: Ditto.
5248 * testsuite/strong_ref_weak_def_2.c: Ditto.
5249
d1238d12
CC
52502010-08-12 Cary Coutant <ccoutant@google.com>
5251
5252 * testsuite/incremental_test.sh: Rewrite.
5253 * testsuite/incremental_test_1.c: Rewrite.
5254 * testsuite/incremental_test_2.c: Rewrite.
5255
0e70b911
CC
52562010-08-12 Cary Coutant <ccoutant@google.com>
5257
5258 * arm.cc (Target_arm::got_size): Add const.
5259 (Target_arm::got_entry_count): New function.
5260 (Target_arm::plt_entry_count): New function.
5261 (Target_arm::first_plt_entry_offset): New function.
5262 (Target_arm::plt_entry_size): New function.
5263 (Output_data_plt_arm::entry_count): New function.
5264 (Output_data_plt_arm::first_plt_entry_offset): New function.
5265 (Output_data_plt_arm::get_plt_entry_size): New function.
5266 * i386.cc (Target_i386::got_size): Add const.
5267 (Target_i386::got_entry_count): New function.
5268 (Target_i386::plt_entry_count): New function.
5269 (Target_i386::first_plt_entry_offset): New function.
5270 (Target_i386::plt_entry_size): New function.
5271 (Output_data_plt_i386::entry_count): New function.
5272 (Output_data_plt_i386::first_plt_entry_offset): New function.
5273 (Output_data_plt_i386::get_plt_entry_size): New function.
5274 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
5275 find_incremental_inputs_sections. Dump incremental_got_plt section.
5276 * incremental.cc: Include target.h.
5277 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
5278 parameter. Adjust all callers. Find incremental_got_plt section.
5279 (Incremental_inputs::create_data_sections): Create incremental_got_plt
5280 section.
5281 (Output_section_incremental_inputs::set_final_data_size): Calculate
5282 size of incremental_got_plt section.
5283 (Output_section_incremental_inputs::do_write): Write the
5284 incremental_got_plt section.
5285 (Got_plt_view_info): New struct.
5286 (Local_got_offset_visitor): New class.
5287 (Global_got_offset_visitor): New class.
5288 (Global_symbol_visitor_got_plt): New class.
5289 (Output_section_incremental_inputs::write_got_plt): New function.
5290 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
5291 Add parameter. Adjust all callers.
5292 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
5293 (Incremental_inputs::got_plt_section): New function.
5294 (Incremental_inputs::got_plt_section_): New data member.
5295 (Incremental_got_plt_reader): New class.
5296 * layout.cc (Layout::create_incremental_info_sections): Add the
5297 incremental_got_plt section.
5298 * object.h (Got_offset_list::get_list): New function.
5299 (Got offset_list::for_all_got_offsets): New function.
5300 (Sized_relobj::local_got_offset_list): New function.
5301 * powerpc.cc (Target_powerpc::got_size): Add const.
5302 (Target_powerpc::got_entry_count): New function.
5303 (Target_powerpc::plt_entry_count): New function.
5304 (Target_powerpc::first_plt_entry_offset): New function.
5305 (Target_powerpc::plt_entry_size): New function.
5306 (Output_data_plt_powerpc::entry_count): New function.
5307 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
5308 (Output_data_plt_powerpc::get_plt_entry_size): New function.
5309 * sparc.cc (Target_sparc::got_size): Add const.
5310 (Target_sparc::got_entry_count): New function.
5311 (Target_sparc::plt_entry_count): New function.
5312 (Target_sparc::first_plt_entry_offset): New function.
5313 (Target_sparc::plt_entry_size): New function.
5314 (Output_data_plt_sparc::entry_count): New function.
5315 (Output_data_plt_sparc::first_plt_entry_offset): New function.
5316 (Output_data_plt_sparc::get_plt_entry_size): New function.
5317 * symtab.h (Symbol::got_offset_list): New function.
5318 (Symbol_table::for_all_symbols): New function.
5319 * target.h (Sized_target::got_entry_count): New function.
5320 (Sized_target::plt_entry_count): New function.
5321 (Sized_target::plt_entry_size): New function.
5322 * x86_64.cc (Target_x86_64::got_size): Add const.
5323 (Target_x86_64::got_entry_count): New function.
5324 (Target_x86_64::plt_entry_count): New function.
5325 (Target_x86_64::first_plt_entry_offset): New function.
5326 (Target_x86_64::plt_entry_size): New function.
5327 (Output_data_plt_x86_64::entry_count): New function.
5328 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
5329 (Output_data_plt_x86_64::get_plt_entry_size): New function.
5330
09ec0418
CC
53312010-08-12 Cary Coutant <ccoutant@google.com>
5332
5333 * archive.cc: Include incremental.h.
5334 (Archive::Archive): Initialize incremental_info_.
5335 (Archive::include_member): Record archive members in incremental info.
5336 (Add_archive_symbols::run): Record begin and end of an archive in
5337 incremental info.
5338 (Lib_group::include_member): Record objects in incremental info.
5339 * archive.h (Incremental_archive_entry): Forward declaration.
5340 (Archive::set_incremental_info): New member function.
5341 (Archive::incremental_info): New member function.
5342 (Archive::Unused_symbol_iterator): New class.
5343 (Archive::unused_symbols_begin): New member function.
5344 (Archive::unused_symbols_end): New member function.
5345 (Archive::incremental_info_): New data member.
5346 * incremental-dump.cc (find_input_containing_global): New function.
5347 (dump_incremental_inputs): Dump new incremental info sections.
5348 * incremental.cc: Include symtab.h.
5349 (Output_section_incremental_inputs): New class.
5350 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
5351 new incremental info sections.
5352 (Sized_incremental_binary::do_check_inputs): Likewise.
5353 (Incremental_inputs::report_archive): Remove.
5354 (Incremental_inputs::report_archive_begin): New function.
5355 (Incremental_inputs::report_archive_end): New function.
5356 (Incremental_inputs::report_object): New function.
5357 (Incremental_inputs::finalize_inputs): Remove.
5358 (Incremental_inputs::report_input_section): New function.
5359 (Incremental_inputs::report_script): Rewrite.
5360 (Incremental_inputs::finalize): Do nothing but finalize string table.
5361 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
5362 (Incremental_inputs::sized_create_inputs_section_data): Remove.
5363 (Incremental_inputs::create_data_sections): New function.
5364 (Incremental_inputs::relocs_entsize): New function.
5365 (Output_section_incremental_inputs::set_final_data_size): New function.
5366 (Output_section_incremental_inputs::do_write): New function.
5367 (Output_section_incremental_inputs::write_header): New function.
5368 (Output_section_incremental_inputs::write_input_files): New function.
5369 (Output_section_incremental_inputs::write_info_blocks): New function.
5370 (Output_section_incremental_inputs::write_symtab): New function.
5371 * incremental.h (Incremental_script_entry): Forward declaration.
5372 (Incremental_object_entry): Forward declaration.
5373 (Incremental_archive_entry): Forward declaration.
5374 (Incremental_inputs): Forward declaration.
5375 (Incremental_inputs_header_data): Remove.
5376 (Incremental_inputs_header): Remove.
5377 (Incremental_inputs_header_write): Remove.
5378 (Incremental_inputs_entry_data): Remove.
5379 (Incremental_inputs_entry): Remove.
5380 (Incremental_inputs_entry_write): Remove.
5381 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
5382 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
5383 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
5384 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
5385 Likewise.
5386 (Incremental_input_entry): New class.
5387 (Incremental_script_entry): New class.
5388 (Incremental_object_entry): New class.
5389 (Incremental_archive_entry): New class.
5390 (Incremental_inputs::Incremental_inputs): Initialize new data members.
5391 (Incremental_inputs::report_inputs): Remove.
5392 (Incremental_inputs::report_archive): Remove.
5393 (Incremental_inputs::report_archive_begin): New function.
5394 (Incremental_inputs::report_archive_end): New function.
5395 (Incremental_inputs::report_object): Change prototype.
5396 (Incremental_inputs::report_input_section): New function.
5397 (Incremental_inputs::report_script): Change prototype.
5398 (Incremental_inputs::get_reloc_count): New function.
5399 (Incremental_inputs::set_reloc_count): New function.
5400 (Incremental_inputs::create_data_sections): New function.
5401 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
5402 (Incremental_inputs::inputs_section): New function.
5403 (Incremental_inputs::symtab_section): New function.
5404 (Incremental_inputs::relocs_section): New function.
5405 (Incremental_inputs::get_stringpool): Add const.
5406 (Incremental_inputs::command_line): Add const.
5407 (Incremental_inputs::inputs): Remove.
5408 (Incremental_inputs::command_line_key): New function.
5409 (Incremental_inputs::input_file_count): New function.
5410 (Incremental_inputs::input_files): New function.
5411 (Incremental_inputs::relocs_entsize): New function.
5412 (Incremental_inputs::sized_create_inputs_section_data): Remove.
5413 (Incremental_inputs::finalize_inputs): Remove.
5414 (Incremental_inputs::Input_info): Remove.
5415 (Incremental_inputs::lock_): Remove.
5416 (Incremental_inputs::inputs_): Change type.
5417 (Incremental_inputs::inputs_map_): Remove.
5418 (Incremental_inputs::current_object_entry_): New data member.
5419 (Incremental_inputs::inputs_section_): New data member.
5420 (Incremental_inputs::symtab_section_): New data member.
5421 (Incremental_inputs::relocs_section_): New data member.
5422 (Incremental_inputs::reloc_count_): New data member.
5423 (Incremental_inputs_reader): New class.
5424 (Incremental_symtab_reader): New class.
5425 (Incremental_relocs_reader): New class.
5426 * layout.cc (Layout::finalize): Move finalization of incremental info
5427 and creation of incremental info sections to follow finalization of
5428 symbol table. Set offsets for postprocessing sections.
5429 (Layout::create_incremental_info_sections): Call
5430 Incremental_inputs::create_data_sections. Add incremental symtab
5431 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
5432 sections to layout after input sections.
5433 * layout.h (struct Timespec): Forward declaration.
5434 (Layout::incremental_inputs): Add const.
5435 (Layout::create_incremental_info_sections): Add parameter.
5436 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
5437 * object.cc: Include incremental.h.
5438 (Relobj::finalize_incremental_relocs): New function.
5439 (Sized_relobj::do_layout): Record input sections in incremental info.
5440 * object.h (Object::output_section): New function.
5441 (Object::output_section_offset): Moved from Relobj.
5442 (Object::get_incremental_reloc_base): New function.
5443 (Object::get_incremental_reloc_count): New function.
5444 (Object::do_output_section): New function.
5445 (Object::do_output_section_offset): Moved from Relobj.
5446 (Object::do_get_incremental_reloc_base): New function.
5447 (Object::do_get_incremental_reloc_count): New function.
5448 (Object::Object): Initialize new data members.
5449 (Relobj::output_section): Renamed do_output_section and moved to
5450 protected.
5451 (Relobj::output_section_offset): Moved to Object.
5452 (Relobj::do_get_incremental_reloc_base): New function.
5453 (Relobj::do_get_incremental_reloc_count): New function.
5454 (Relobj::allocate_incremental_reloc_counts): New function.
5455 (Relobj::count_incremental_reloc): New function.
5456 (Relobj::finalize_incremental_relocs): New function.
5457 (Relobj::next_incremental_reloc_index): New function.
5458 (Relobj::reloc_counts_): New data member.
5459 (Relobj::reloc_bases_): New data member.
5460 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
5461 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
5462 (Sized_relobj::incremental_relocs_scan): New function.
5463 (Sized_relobj::incremental_relocs_scan_reltype): New function.
5464 (Sized_relobj::incremental_relocs_write): New function.
5465 (Sized_relobj::incremental_relocs_write_reltype): New function.
5466 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
5467 incremental link.
5468 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
5469 archives and object files elsewhere.
5470 (Add_symbols::run): Report object files here.
5471 (Finish_group::run): Report end of archive at end of group.
5472 * reloc.cc: Include layout.h, incremental.h.
5473 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
5474 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
5475 (Sized_relobj::incremental_relocs_scan): New function.
5476 (Sized_relobj::incremental_relocs_scan_reltype): New function.
5477 (Sized_relobj::do_relocate_sections): Write incremental relocations.
5478 (Sized_relobj::incremental_relocs_write): New function.
5479 (Sized_relobj::incremental_relocs_write_reltype): New function.
5480 * script.cc (read_input_script): Rewrite test for incremental link.
5481 Change call to Incremental_inputs::report_script.
5482 * symtab.h (Symbol_table::first_global_index): New function.
5483 (Symbol_table::output_count): New function.
5484
ce0d1972
DK
54852010-08-12 Doug Kwan <dougkwan@google.com>
5486
5487 * arm.cc (Target_arm::merge_object_attributes): Check command line
5488 options --no-wchar-size-warning and --no-enum-size-warning.
5489 * options.h (General_options): Add ld-compatible options
5490 --no-enum-size-warning and --no-wchar-size-warning.
5491
6e5710ce
ILT
54922010-08-04 Ian Lance Taylor <iant@google.com>
5493
5494 * x86_64.cc (Target_x86_64::Scan::local): Use
5495 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
5496 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
5497 (Target_x86_64::Scan::global): Likewise.
5498 (Target_x86_64::Relocate::relocate): Likewise.
5499 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
5500 Likewise.
5501
fef830db
CC
55022010-08-03 Cary Coutant <ccoutant@google.com>
5503
5504 * merge.cc (Output_merge_string::do_add_input_section): Count strings
5505 to reserve space in merged_strings vector. Keep total input size
5506 for stats.
5507 (Output_merge_string::do_print_merge_stats): Print total input size.
5508 * merge.h (Output_merge_string): Add input_size_ field.
5509 * stringpool.cc (Stringpool_template::string_length): Move
5510 implementations out of Stringpool_template class and place in
5511 stringpool.h.
5512 * stringpool.h (string_length): Move out of Stringpool_template.
5513
1e3811b0
ILT
55142010-08-03 Ian Lance Taylor <iant@google.com>
5515
5516 PR 11712
5517 * layout.cc (relaxation_loop_body): If address of load segment is
5518 set, adjust address to include headers if possible.
5519
7af0c620
ILT
55202010-08-03 Ian Lance Taylor <iant@google.com>
5521
5522 * version.cc (version_string): Bump to 1.10.
5523
22f0da72
ILT
55242010-08-03 Ian Lance Taylor <iant@google.com>
5525
5526 PR 11805
5527 * layout.h (enum Output_section_order): Define.
5528 (class Layout): Update declarations.
5529 * layout.cc (Layout::get_output_section): Add order parameter.
5530 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
5531 is_first_non_relro parameters. Change all callers.
5532 (Layout::choose_output_section): Likewise.
5533 (Layout::add_output_section_data): Likewise.
5534 (Layout::make_output_section): Likewise. Set order.
5535 (Layout::default_section_order): New function.
5536 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
5537 * output.cc (Output_section::Output_section): Initialize order_.
5538 Don't initialize deleted fields.
5539 (Output_segment::Output_segment): Don't initialize deleted
5540 fields.
5541 (Output_segment::add_output_section_to_load): New function
5542 replacing add_output_section. Change all callers to call this or
5543 add_output_section_to_nonload.
5544 (Output_segment::add_output_section_to_nonload): New function.
5545 (Output_segment::remove_output_section): Rewrite.
5546 (Output_segment::add_initial_output_data): Likewise.
5547 (Output_segment::has_any_data_sections): Likewise.
5548 (Output_segment::is_first_section_relro): Likewise.
5549 (Output_segment::maximum_alignment): Likewise.
5550 (Output_segment::has_dynamic_reloc): New function replacing
5551 dynamic_reloc_count. Change all callers.
5552 (Output_segment::has_dynamic_reloc_list): New function replacing
5553 dynamic_reloc_count_list. Change all callers.
5554 (Output_segment::set_section_addresses): Rewrite.
5555 (Output_segment::set_offset): Rewrite.
5556 (Output_segment::find_first_and_last_list): Remove.
5557 (Output_segment::set_tls_offsets): Rewrite.
5558 (Output_segment::first_section_load_address): Likewise.
5559 (Output_segment::output_section_count): Likewise.
5560 (Output_segment::section_with_lowest_load_address): Likewise.
5561 (Output_segment::write_section_headers): Likewise.
5562 (Output_segment::print_sections_to_map): Likewise.
5563 * output.h (class Output_data): Remove dynamic_reloc_count_
5564 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
5565 (Output_data::add_dynamic_reloc): Rewrite.
5566 (Output_data::has_dynamic_reloc): New function.
5567 (Output_data::dynamic_reloc_count): Remove.
5568 (class Output_section): Add order_ field. Remvoe is_relro_local_,
5569 is_last_relro_, is_first_non_relro_, is_interp_,
5570 is_dynamic_linker_section_ fields. Add order and set_order
5571 functions. Remove is_relro_local, set_is_relro_local,
5572 is_last_relro, set_is_last_relro, is_first_non_relro,
5573 set_is_first_non_relro functions, is_interp, set_is_interp,
5574 is_dynamic_linker_section, and set_is_dynamic_linker_section
5575 functions.
5576 (class Output_segment): Change Output_data_list from std::list to
5577 std:;vector. Add output_lists_ field. Remove output_data_ and
5578 output_bss_ fields. Update declarations.
5579
3ff2ccb0
ILT
55802010-08-02 Ian Lance Taylor <iant@google.com>
5581
5582 * arm.cc (Target_arm::gc_process_relocs): Use typename.
5583 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
5584 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
5585
88a4108b
ILT
55862010-08-02 Ian Lance Taylor <iant@google.com>
5587
5588 PR 11855
5589 * script.cc (Script_options::Script_options): Initialize
5590 symbol_definitions_ and symbol_references_.
5591 (Script_options::add_symbol_assignment): Update
5592 symbol_definitions_ and symbol_references_.
5593 (Script_options::add_symbol_reference): New function.
5594 (script_symbol): New function.
5595 * script.h (class Script_options): Add symbol_definitions_ and
5596 symbol_references_ fields.
5597 (Script_options::referenced_const_iterator): New type.
5598 (Script_options::referenced_begin): New function.
5599 (Script_options::referenced_end): New function.
5600 (Script_options::is_referenced): New function.
5601 (Script_options::any_unreferenced): New function.
5602 * script-c.h (script_symbol): Declare.
5603 * yyscript.y (exp): Call script_symbol.
5604 * symtab.cc: Include "script.h".
5605 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
5606 Change all callers. Check symbols referenced by scripts.
5607 (Symbol_table::add_undefined_symbols_from_command_line): Add
5608 layout parameter. Change all callers.
5609 (Symbol_table::do_add_undefined_symbols_from_command_line):
5610 Likewise. Break out loop body. Check symbols referenced by
5611 scripts.
5612 (Symbol_table::add_undefined_symbol_from_command_line): New
5613 function broken out of
5614 do_add_undefined_symbols_from_command_line.
5615 * symtab.h (class Symbol_table): Update declarations.
5616 * archive.cc: Include "layout.h".
5617 (Archive::should_include_member): Add layout parameter. Change
5618 all callers. Check for symbol mentioned in expression.
5619 * archive.h (class Archive): Update declaration.
5620 * object.cc (Sized_relobj::do_should_include_member): Add layout
5621 parameter.
5622 * object.h (Object::should_include_member): Add layout parameter.
5623 Change all callers.
5624 (Object::do_should_include_member): Add layout parameter.
5625 (class Sized_relobj): Update declaration.
5626 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
5627 parameter.
5628 * dynobj.h (class Sized_dynobj): Update declaration.
5629 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
5630 layout parameter.
5631 * plugin.h (class Sized_pluginobj): Update declaration.
5632
5f1ab67a
ILT
56332010-08-02 Ian Lance Taylor <iant@google.com>
5634
5635 PR 11866
5636 * output.cc (Output_segment::set_offset): Search for the first and
5637 last sections rather than assuming that the list is in order.
5638 (Output_segment::find_first_and_last_list): New function.
5639 * output.h (class Output_segment): Update declarations.
5640 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
5641 (relro_strip_test_SOURCES): New variable.
5642 (relro_strip_test_DEPENDENCIES): New variable.
5643 (relro_strip_test_LDFLAGS): New variable.
5644 (relro_strip_test_LDADD): New variable.
5645 (relro_strip_test.so): New target.
5646
a8df5856
ILT
56472010-08-02 Ian Lance Taylor <iant@google.com>
5648
5649 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
5650 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
5651 (Target_i386::got_tlsdesc_section): New function.
5652 (Target_i386::got_section): Create space for GOT entries for
5653 TLSDESC relocations.
5654 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
5655 R_386_TLS_GOTDESC.
5656 (Target_i386::Scan::global): Likewise.
5657 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
5658 using TLSDESC GOT.
5659 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
5660 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
5661 (Target_x86_64::got_tlsdesc_section): New function.
5662 (Target_x86_64::got_section): Create space for GOT entries for
5663 TLSDESC relocations.
5664 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
5665 R_386_TLS_GOTDESC.
5666 (Target_x86_64::Scan::global): Likewise.
5667 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
5668 using TLSDESC GOT.
5669
0c10a0a6
ILT
56702010-08-02 Ian Lance Taylor <iant@google.com>
5671
5672 * testsuite/final_layout.sh: Use dc to convert from hex to
5673 decimal.
5674
41cbeecc
ST
56752010-07-29 Sriraman Tallam <tmsriram@google.com>
5676
5677 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
5678 paramter to the call to gold::gc_process_relocs.
5679 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
5680 paramter to the call to gold::gc_process_relocs.
5681 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
5682 parameter to the call to gold::gc_process_relocs.
5683 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
5684 template parameter to the call to gold::gc_process_relocs.
5685 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
5686 paramter to the call to gold::gc_process_relocs.
5687 * gc.h (get_embedded_addend_size): New function.
5688 (gc_process_relocs): Save the size of the reloc for use by ICF.
5689 * icf.cc (get_section_contents): Get the addend from the text section
5690 for SHT_REL relocation sections.
5691 * icf.h (Icf::Reloc_addend_size_info): New typedef.
5692 (Icf::Reloc_info): Add new member reloc_addend_size_info.
5693 * int_encoding.h (read_from_pointer): New overloaded function.
5694 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
5695 * testsuite/icf_sht_rel_addend_test.sh: New file.
5696 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
5697 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
5698
6ea55b82
RW
56992010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5700
5701 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
5702 * Makefile.in: Regenerate.
5703 * testsuite/Makefile.in: Regenerate.
5704
9691462b
ILT
57052010-07-27 Jeffrey Yasskin <jyasskin@google.com>
5706
5707 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
5708 * gold/testsuite/debug_msg.cc: Likewise.
5709 * gold/testsuite/odr_violation1.cc
5710 * gold/testsuite/odr_violation2.cc
5711
76897331
CC
57122010-07-21 Cary Coutant <ccoutant@google.com>
5713
5714 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
5715 string, and length fields.
5716 (Output_merge_string::Merged_strings_list): New type.
5717 (Output_merge_string::Merged_strings_lists): New typedef.
5718 (Output_merge_string): Replace merged_strings_ with
5719 merged_strings_lists_.
5720 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
5721 Merged_strings_list per input object and section. Don't store pointer
5722 to the string. Don't store length with each merged string entry.
5723 (Output_merge_string::finalize_merged_data): Loop over list of merged
5724 strings lists. Recompute length of each merged string.
5725
78384e8f
CC
57262010-07-15 Cary Coutant <ccoutant@google.com>
5727
5728 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
5729 here.
5730
783659f9
ILT
57312010-07-14 Ian Lance Taylor <iant@google.com>
5732
5733 * descriptors.cc (Descriptors::open): Report correct name in error
5734 message.
5735
131687b4
DK
57362010-07-13 Doug Kwan <dougkwan@google.com>
5737
5738 * arm.cc (Arm_input_section::Arm_input_section): For a
5739 SHT_ARM_EXIDX section, always keeps the input sections.
5740 (Arm_input_section::set_exidx_section_link): New method.
5741 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
5742 has_errors_ to false.
5743 (Arm_exidx_input_section::has_errors,
5744 Arm_exidx_input_section::set_has_errors): New methods.
5745 (Arm_exidx_input_section::has_errors_): New data member.
5746 (Arm_relobj::get_exidx_shndx_list): New method.
5747 (Arm_output_section::append_text_sections_to_list): Do not skip
5748 section without SHF_EXECINSTR.
5749 (Arm_output_section::fix_exidx_coverage): Skip input sections with
5750 errors.
2e702c99 5751 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
5752 section header. Make error messages more verbose. Check for
5753 a non-executable section linked to an EXIDX section.
5754 (Arm_relobj::do_read_symbols): Remove error checking, which has been
5755 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
5756 check that there is no deferred EXIDX section if we exit early.
5757 Instead of not making an EXIDX section in case of an error, make one
5758 and set the has_errors flag of it.
5759 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
5760 in a relocatable link.
5761 (Target_arm::do_relax): Look for the EXIDX output section instead of
5762 assuming that it is called .ARM.exidx.
2e702c99 5763 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
5764 section list. Do not check for SHF_EXECINSTR section flags but
5765 skip any input section with errors.
5766 * output.cc (Output_section::Output_section): Initialize
5767 always_keeps_input_sections_ to false.
5768 (Output_section::add_input_section): Check for
5769 always_keeps_input_sections_.
5770 * output.h (Output_section::always_keeps_input_sections,
5771 Output_section::set_always_keeps_input_sections): New methods.
5772 (Output_section::always_keeps_input_sections): New data member.
5773
69517287
RÁE
57742010-07-13 Rafael Espindola <espindola@google.com>
5775
5776 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
5777 * fileread.h (Input_file): Add try_extra_search_path and find_file.
5778
82742395
ILT
57792010-07-13 Philip Herron <herron.philip@googlemail.com>
5780 Ian Lance Taylor <iant@google.com>
5781
5782 * output.h (Output_section_lookup_maps::add_merge_section):
5783 Correct check of whether value was inserted.
5784 (Output_section_lookup_maps::add_merge_input_section): Likewise.
5785 (Output_section_lookup_maps::add_relaxed_input_section):
5786 Likewise.
5787 * arm.cc (Target_arm::got_section): Remove used local os.
5788 * i386.cc (Target_i386::got_section): Likewise.
5789 * x86_64.cc (Target_x86_64::got_section): Likewise.
5790 * sparc.cc (Target_sparc::got_section): Likewise.
5791 (Target_sparc::relocate): Remove unused local have_got_offset.
5792 * powerpc.cc (Target_powerpc::relocate): Likewise.
5793
f2d707b5
ILT
57942010-07-13 Ian Lance Taylor <iant@google.com>
5795
241531d6
ILT
5796 * compressed_output.cc (zlib_decompress): Fix signature in
5797 !HAVE_ZLIB_H case.
5798
f2d707b5
ILT
5799 * archive.cc (Archive::include_member): Unlock an external member
5800 of a thin archive. Don't bother to delete an object we know is
5801 NULL.
5802
a2e47362
CC
58032010-07-12 Cary Coutant <ccoutant@google.com>
5804
5805 * compressed_output.cc (zlib_decompress): New function.
5806 (get_uncompressed_size): New function.
5807 (decompress_input_section): New function.
5808 * compressed_output.h (get_uncompressed_size): New function.
5809 (decompress_input_section): New function.
5810 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
5811 Handle compressed debug sections.
5812 * layout.cc (is_compressed_debug_section): New function.
5813 (Layout::output_section_name): Map compressed section names to
5814 canonical names.
5815 * layout.h (is_compressed_debug_section): New function.
5816 (is_debug_info_section): Recognize compressed debug sections.
5817 * merge.cc: Include compressed_output.h.
5818 (Output_merge_data::do_add_input_section): Handle compressed
5819 debug sections.
5820 (Output_merge_string::do_add_input_section): Handle compressed
5821 debug sections.
5822 * object.cc: Include compressed_output.h.
5823 (Sized_relobj::Sized_relobj): Initialize new data members.
5824 (build_compressed_section_map): New function.
5825 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
5826 * object.h (Object::section_is_compressed): New method.
5827 (Object::do_section_is_compressed): New method.
5828 (Sized_relobj::Compressed_section_map): New type.
5829 (Sized_relobj::do_section_is_compressed): New method.
5830 (Sized_relobj::compressed_sections_): New data member.
5831 * output.cc (Output_section::add_input_section): Handle compressed
5832 debug sections.
5833 * reloc.cc: Include compressed_output.h.
5834 (Sized_relobj::write_sections): Handle compressed debug sections.
5835
ce279a62
CC
58362010-07-08 Cary Coutant <ccoutant@google.com>
5837
5838 * resolve.cc (Symbol_table::resolve): Remember whether undef was
5839 weak when resolving to a dynamic def.
5840 (Symbol_table::should_override): Add adjust_dyndef flag; set it
5841 for weak undef/dynamic def cases. Adjust callers.
5842 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
5843 undef_binding_weak_.
5844 (Symbol_table::sized_write_globals): Adjust symbol binding.
5845 (Symbol_table::sized_write_symbol): Add binding parameter.
5846 * symtab.h (Symbol::set_undef_binding): New method.
5847 (Symbol::is_undef_binding_weak): New method.
5848 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
5849 (Symbol_table::should_override): Add new parameter.
5850 (Symbol_table::sized_write_symbol): Add new parameter.
5851
5852 * testsuite/weak_undef_file1.cc: Add new test case.
5853 * testsuite/weak_undef_file2.cc: Fix header comment.
5854 * testsuite/weak_undef_test.cc: Add new test case.
5855
b2286c10
DK
58562010-06-29 Doug Kwan <dougkwan@google.com>
5857
5858 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
5859 Initialize USE_SYMBOL_.
5860 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
5861 definition.
5862 (Arm_reloc_property::uses_symbol_): New data member declaration.
5863 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
5864 uses symbol value and symbol is undefined but not weakly undefined.
5865
4802450a
RÁE
58662010-06-28 Rafael Espindola <espindola@google.com>
5867
5868 * plugin.cc (Plugin::load): Use dlerror.
5869
e5ca47ba
ILT
58702010-06-26 Jeffrey Yaskin <jyasskin@google.com>
5871
5872 * symtab.cc (detect_odr_violations): When reporting an ODR
5873 violation, report an object where the symbol is defined.
5874
8a75a161
DK
58752010-06-25 Doug Kwan <dougkwan@google.com>
5876
5877 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
5878 (Target_arm::section_may_have_icf_unsafe_pointers): New method
5879 definition.
5880 (Target_arm::Scan::local_reloc_may_be_function_pointer,
5881 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
5882 target hook to detect function points.
5883 (Target_arm::Scan::possible_function_pointer_reloc): New method.
5884 * icf.h (Icf::check_section_for_function_pointers): Change type of
5885 parameter SECTION_NAME to const reference to std::string. Use
5886 target hook to determine if section may have unsafe pointers.
5887 * target.h (Target::section_may_have_icf_unsafe_pointers): New
5888 method definition.
5889
42218b9f
RÁE
58902010-06-21 Rafael Espindola <espindola@google.com>
5891
5892 * fileread.cc (Input_file::find_fie): New
5893 (Input_file::open): Use Input_file::find_fie.
5894 * fileread.h (Input_file::find_fie): New
5895 * plugin.cc (set_extra_library_path): New.
5896 (Plugin::load): Add set_extra_library_path to the transfer vector.
5897 (Plugin_manager::set_extra_library_path): New.
5898 (Plugin_manager::add_input_file): Use the extra search path if set.
5899 (set_extra_library_path(): New.
5900 * plugin.h (Plugin_manager): Add set_extra_library_path and
5901 extra_search_path_.
5902
a0506cca
CC
59032010-06-19 Cary Coutant <ccoutant@google.com>
5904
5905 * layout.cc (gdb_sections): Add .debug_types.
5906 (lines_only_debug_sections): Likewise.
5907
6508b958
RÁE
59082010-06-18 Rafael Espindola <espindola@google.com>
5909
5910 * plugin.cc (add_input_file,add_input_library)
5911 (Plugin_manager::add_input_file): Make filename arguments const.
5912 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
5913 const.
5914
3e235302
DK
59152010-06-16 Doug Kwan <dougkwan@google.com>
5916
5917 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
5918 .ARM.attributes section if we have not merged any input
5919 attributes sections.
5920
106e8a6c
DK
59212010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5922
5923 * arm.cc: Allow combining objects with no EABI version
5924 information.
5925
91ff43fe
RÁE
59262010-06-15 Rafael Espindola <espindola@google.com>
5927
5928 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
5929
68ed838c
ILT
59302010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5931
5932 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
5933 (struct iovec): Correct !HAVE_READV definition.
5934
f3a2388f
CC
59352010-06-10 Cary Coutant <ccoutant@google.com>
5936
5937 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
5938 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
5939 reloc sections.
5940 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
5941
5942 PR 11683
5943 * symtab.h (Symbol::is_placeholder): New member function.
5944 * target-reloc.h (relocate_section): Check for placeholder symbols.
5945
5946 * testsuite/Makefile.am (plugin_test_8): New test.
5947 (plugin_test_9): New test.
5948 * testsuite/Makefile.in: Regenerate.
5949
e1df38aa
NC
59502010-06-09 Nick Clifton <nickc@redhat.com>
5951
5952 * yyscript.y (input_list_element): Allow strings prefixed with
5953 the '-' character. Treat these as libraries.
5954 * script.cc (script_add_library): New function. Adds a library
5955 specified by "-l<name>" found in an input script.
5956 * script-c.h: Add prototype for script_add_library.
5957
25bbe950
DK
59582010-06-07 Doug Kwan <dougkwan@google.com>
5959
5960 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
5961 Restrict stub-group size to be within long conditional branch
5962 range when working around cortex-A8 erratum.
5963
0f32ea4c
ILT
59642010-06-07 Damien Diederen <dd@crosstwine.com>
5965
5966 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
5967 #ifdef typo.
5968
8fe2a369
ST
59692010-06-03 Sriraman Tallam <tmsriram@google.com>
5970
5971 PR gold/11658
5972 * output.cc
5973 (Output_section::Input_section_sort_entry::compare_section_ordering):
5974 Change to return non-zero correctly.
5975 (Output_section::Input_section_sort_section_order_index_compare
5976 ::operator()): Change to fix ambiguity in comparisons.
5977
6e9ba2ca
ST
59782010-06-01 Sriraman Tallam <tmsriram@google.com>
5979
5980 * gold.h (is_wildcard_string): New function.
5981 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
5982 (Layout::layout_eh_frame): Ditto.
5983 (Layout::find_section_order_index): New method.
5984 (Layout::read_layout_from_file): New method.
5985 * layout.h (Layout::find_section_order_index): New method.
5986 (Layout::read_layout_from_file): New method.
5987 (Layout::input_section_position_): New private member.
5988 (Layout::input_section_glob_): New private member.
5989 * main.cc (main): Call read_layout_from_file here.
5990 * options.h (--section-ordering-file): New option.
5991 * output.cc (Output_section::input_section_order_specified_): New
5992 member.
5993 (Output_section::Output_section): Initialize new member.
5994 (Output_section::add_input_section): Add new parameter.
5995 Keep input sections when --section-ordering-file is used.
5996 (Output_section::set_final_data_size): Sort input sections when
5997 section ordering file is specified.
5998 (Output_section::Input_section_sort_entry): Add new parameter.
5999 Check sorting type.
6000 (Output_section::Input_section_sort_entry::compare_section_ordering):
6001 New method.
6002 (Output_section::Input_section_sort_compare::operator()): Change to
6003 consider section_order_index.
6004 (Output_section::Input_section_sort_init_fini_compare::operator()):
6005 Change to consider section_order_index.
6006 (Output_section::Input_section_sort_section_order_index_compare
6007 ::operator()): New method.
6008 (Output_section::sort_attached_input_sections): Change to sort
6009 according to section order when specified.
e1df38aa
NC
6010 (Output_section::add_input_section<32, true>): Add new parameter.
6011 (Output_section::add_input_section<64, true>): Add new parameter.
6012 (Output_section::add_input_section<32, false>): Add new parameter.
6013 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
6014 * output.h (Output_section::add_input_section): Add new parameter.
6015 (Output_section::input_section_order_specified): New
6016 method.
6017 (Output_section::set_input_section_order_specified): New method.
6018 (Input_section::Input_section): Initialize section_order_index_.
6019 (Input_section::section_order_index): New method.
6020 (Input_section::set_section_order_index): New method.
6021 (Input_section::section_order_index_): New member.
6022 (Input_section::Input_section_sort_section_order_index_compare): New
6023 struct.
6024 (Output_section::input_section_order_specified_): New member.
6025 * script-sections.cc (is_wildcard_string): Delete and move modified
6026 method to gold.h.
6027 (Output_section_element_input::Output_section_element_input): Modify
6028 call to is_wildcard_string.
6029 (Output_section_element_input::Input_section_pattern
6030 ::Input_section_pattern): Ditto.
6031 (Output_section_element_input::Output_section_element_input): Ditto.
6032 * testsuite/Makefile.am (final_layout): New test case.
6033 * testsuite/Makefile.in: Regenerate.
6034 * testsuite/final_layout.cc: New file.
6035 * testsuite/final_layout.sh: New file.
6036
3537c84b
RÁE
60372010-06-01 Rafael Espindola <espindola@google.com>
6038
6039 * plugin.cc (Plugin::load): Pass the output name to the plugin.
6040
105b6afd
RÁE
60412010-06-01 Rafael Espindola <espindola@google.com>
6042
6043 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
6044 visibility of symbols.
6045
29e11421
DK
60462010-05-27 Doug Kwan <dougkwan@google.com>
6047
6048 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
6049 from start of output section instead of address for a local symbol
6050 in a merged or relaxed section when doing a relocatable link.
6051
5e0f337e
RÁE
60522010-05-26 Rafael Espindola <espindola@google.com>
6053
703d02da 6054 PR 11604
5e0f337e
RÁE
6055 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
6056 adding sections the garbage collector removed.
6057 * gold/testsuite/Makefile.am: Add test.
6058 * gold/testsuite/Makefile.in: Regenerate.
6059 * gold/testsuite/plugin_test_7.sh: New.
6060 * gold/testsuite/plugin_test_7_1.c: New.
6061 * gold/testsuite/plugin_test_7_2.c: New.
6062
f4187277
RÁE
60632010-05-26 Rafael Espindola <espindola@google.com>
6064
6065 * script-sections.cc (Output_section_definition::set_section_addresses):
6066 Check for --section-start.
6067
5c388529
DK
60682010-05-26 Doug Kwan <dougkwan@google.com>
6069
6070 * arm.cc (Arm_scan_relocatable_relocs): New class.
6071 (Target_arm::relocate_special_relocatable): New method.
6072 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
6073 (Arm_relocate_functions::thumb_branch_common): Same.
6074 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
6075 instead of Default_scan_relocatable_relocs.
6076 * target-reloc.h (relocate_for_relocatable): Let target handle
6077 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
6078 * target.h (Sized_target::relocate_special_relocatable): New method.
6079
bca1c3ae
ILT
60802010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6081
6082 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
6083
0439c796
DK
60842010-05-23 Doug Kwan <dougkwan@google.com>
6085
6086 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
6087 instead of a cast.
6088 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
6089 with a direct branch, not a conditional branch, to a stub.
6090 * merge.cc (Output_merge_base::record_input_section): New method
6091 defintion.
6092 (Output_merge_data::do_add_input_section): Record input section if
6093 keeps-input-sections flag is set.
6094 (Output_merge_string::do_add_input_section): Ditto.
6095 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
6096 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
6097 INPUT_SECTIONS_.
6098 (Output_merge_base::keeps_input_sections,
6099 Output_merge_base::set_keeps_input_sections,
6100 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
6101 method definitions.
6102 (Output_merge_base::Input_sections): New type declaration.
6103 (Output_merge_base::input_sections_begin,
6104 Output_merge_base::input_sections_end,
6105 Output_merge_base::do_set_keeps_input_sections): New method definitions.
6106 (Output_merge_base::bool keeps_input_sections_,
6107 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
6108 Output_merge_base::input_sections_): New data members.
6109 (Output_merge_data::do_set_keeps_input_sections): New method
6110 defintion.
6111 (Output_merge_string::do_set_keeps_input_sections): Ditto.
6112 * output.cc (Output_section::Input_section::relobj): Move method
6113 defintion from class declaration to here and handle merge sections.
6114 (Output_section::Input_section::shndx): Ditto.
6115 (Output_section::Output_section): Remove initializations of removed
6116 data members and initialize new data member LOOKUP_MAPS_.
6117 (Output_section::add_input_section): Set keeps-input-sections flag
6118 for a newly created merge output section as appropriate. Adjust code
6119 to use Output_section_lookup_maps class.
6120 (Output_section::add_relaxed_input_section): Adjst code for lookup
6121 maps code refactoring.
2e702c99 6122 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
6123 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
6124 class. If adding input section to a newly created merge output
6125 section fails, remove the new merge section.
6126 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 6127 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 6128 (Output_section::find_merge_section): Ditto.
0439c796 6129 (Output_section::build_lookup_maps): New method defintion.
2e702c99 6130 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
6131 Output_section_lookup_maps class.
6132 (Output_section::get_input_sections): Export merge sections. Adjust
6133 code to use Output_section_lookup_maps class.
6134 (Output_section:::add_script_input_section): Adjust code to use
6135 Output_section_lookup_maps class. Update lookup maps for merge
6136 sections also.
6137 (Output_section::discard_states): Use Output_section_lookup_maps.
6138 (Output_section::restore_states): Same.
6139 * output.h (Merge_section_properties): Move class defintion out of
6140 Output_section.
6141 (Output_section_lookup_maps): New class.
6142 (Output_section::Input_section::is_merge_section): New method
6143 defintion.
6144 (Output_section::Input_section::relobj): Move defintion out of class
6145 defintion. Declare method only.
6146 (Output_section::Input_section::shndx): Ditto.
6147 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 6148 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
6149 (Output_section::Merge_section_by_properties_map,
6150 Output_section::Output_section_data_by_input_section_map,
6151 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
6152 Remove types.
2e702c99 6153 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
6154 KEEPS_INPUT_SECTIONS.
6155 (Output_section::build_lookup_maps): New method declaration.
6156 (Output_section::merge_section_map_,
6157 Output_section::merge_section_by_properties_map_,
6158 Output_section::relaxed_input_section_map_,
6159 Output_section::is_relaxed_input_section_map_valid_): Remove data
6160 members.
6161 (Output_section::lookup_maps_): New data member.
6162
76295588
L
61632010-05-21 Doug Kwan <dougkwan@google.com>
6164
6165 PR gold/11619
6166 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
6167 avoid a compilation error.
6168
d103a984
RÁE
61692010-05-19 Rafael Espindola <espindola@google.com>
6170
6171 * script-sections.cc (Output_section_definition::allocate_to_segment):
6172 Update the phdrs_list even when the output section is NULL.
6173 * testsuite/Makefile.am: Add test.
6174 * testsuite/Makefile.in: Regenerate.
6175 * testsuite/script_test_9.cc: New.
6176 * testsuite/script_test_9.sh: New.
6177 * testsuite/script_test_9.t: New.
6178
6625d24e
DK
61792010-05-19 Doug Kwan <dougkwan@google.com>
6180
6181 * arm.cc (Arm_input_section::original_size): New method.
6182 (Arm_input_section::do_addralign): Add a cast.
6183 (Arm_input_section::do_output_offset): Remove static cast.
6184 (Arm_input_section::original_addralign,
6185 Arm_input_section::original_size_): Change type to uint32_t.
6186 (Arm_input_section::init): Add safe casts for section alignment
6187 and size.
6188 (Arm_input_section::set_final_data_size): Do not set address and
6189 offset of stub table.
6190 (Arm_output_section::fix_exidx_coverage): Change use of of
6191 Output_section::Simple_input_section to that of
6192 Output_section::Input_section.
6193 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
6194 except for the first pass.
6195 * output.cc (Output_section::get_input_sections): Change type of
6196 input_sections to std::list<Input_section>.
6197 (Output_section::add_script_input_section): Rename from
6198 Output_section::add_simple_input_section. Change type of SIS
6199 parameter from Simple_input_section to Input_section.
6200 * output.h (Output_section::Simple_input_section): Remove class.
6201 (Output_section::Input_section): Change class visibility to public.
6202 (Output_section::Input_section::addralign): Use stored alignments
6203 for special input sections if set.
6204 (Output_section::Input_section::set_addralign): New method.
6205 (Output_section::get_input_sections): Change parameter type from
6206 list of Simple_input_section to list of Input_section.
6207 (Output_section::add_script_input_section): Rename from
6208 Output_section::add_simple_input_section. Change first parameter's
6209 type from Simple_input_section to Input_section and remove the
6210 second and third parameters.
6211 * script-sections.cc (Input_section::Input_section_list): Change
6212 type to list of Output_section::Input_section/
6213 (Input_section_info::Input_section_info): Change parameter type of
6214 INPUT_SECTION to Output_section::Input_section.
6215 (Input_section_info::input_section): Change return type.
6216 (Input_section_info::input_section_): Change type to
6217 Output_section::Input_section.
6218 (Output_section_element_input::set_section_addresses): Adjust code
6219 to use Output_section::Input_section instead of
6220 Output_section::Simple_input_section. Adjust code for renaming
6221 of Output_section::add_simple_input_section.
6222 (Orphan_output_section::set_section_addresses): Ditto.
6223
e1e82ea4
RW
62242010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6225
6226 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
6227 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
6228
91e75c8a
RÁE
62292010-05-18 Rafael Espindola <espindola@google.com>
6230
6231 * options.cc (General_options::finalize): Handle -nostdlib.
6232 * options.h (nostdlib): New option.
6233 * script.cc (script_add_search_dir): Handle -nostdlib.
6234
da59ad79
DK
62352010-05-12 Doug Kwan <dougkwan@google.com>
6236
6237 * arm.cc (Target_arm::do_finalize_sections): Create an empty
6238 attributes section only if there no attributes section after merging.
6239 (Target_arm::merge_object_attributes): Move value of
e1df38aa 6240 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
6241 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
6242 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
6243 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
6244 and arm_attr_merge_7.stdout.
6245 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
6246 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
6247 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
6248 arm_attr_merge_7b.o): New rules.
6249 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
6250 arm_attr_merge_7
6251 * testsuite/Makefile.in: Regenerate.
6252 * testsuite/arm_attr_merge.sh: New file.
6253 * testsuite/arm_attr_merge_[67][ab].s: Same.
6254
3e01a7fd
NC
62552010-05-05 Nick Clifton <nickc@redhat.com>
6256
6257 * po/es.po: Updated Spanish translation.
6258
7ad2014a
L
62592010-04-27 H.J. Lu <hongjiu.lu@intel.com>
6260
6261 * Makefile.am (install-exec-local): Properly install gold as
6262 default cross linker.
6263 * Makefile.in: Regenerated.
6264
4fda8867
NC
62652010-04-27 H.J. Lu <hongjiu.lu@intel.com>
6266 Nick Clifton <nickc@redhat.com>
6267
6268 * configure.ac (install_as_default): Define and set to false
6269 unless --enable-gold or --enable-gold=both/gold has been
6270 specified.
6271 * configure: Regenerate.
6272
6273 * Makefile.am (install-exec-local): Install the executable as
6274 'ld.gold'. If install_as_default is true then also install it as
6275 'ld'.
6276 * Makefile.in: Regenerated.
6277
bd288ea2
ILT
62782010-04-24 Ian Lance Taylor <iant@google.com>
6279
6280 * layout.cc (Layout::layout_reloc): In relocatable link don't
6281 combine reloc sections for grouped sections.
6282
ef38fd8a
ST
62832010-04-23 Sriraman Tallam <tmsriram@google.com>
6284
6285 * gc.h (gc_process_relocs): Pass information on relocs pointing to
6286 sections that are not ordinary to icf.
6287 * icf.cc (get_section_contents): Handle relocation pointing to section
6288 with no object or shndx information.
6289 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
6290 * testsuite/Makefile.in: Regenerate.
6291 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
6292 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
6293
f6973bdc
ILT
62942010-04-22 Ian Lance Taylor <iant@google.com>
6295
6296 * expression.cc (Expression::Expression_eval_info): Add
6297 result_alignment_pointer field.
6298 (Expression::eval_with_dot): Add result_alignment_pointer
6299 parameter. Change all callers.
6300 (Expression::eval_maybe_dot): Likewise.
6301 (class Binary_expression): Add alignment_pointer parameter to
6302 left_value and right_value. Change all callers.
6303 (BINARY_EXPRESSION): Set result alignment.
6304 (class Trinary_expression): Add alignment_pointer parameter to
6305 arg2_value and arg3_value. Change all callers.
6306 (Trinary_cond::value): Set result alignment.
6307 (Max_expression::value, Min_expression::value): Likewise.
6308 (Align_expression::value): Likewise.
6309 * script-sections.cc (class Sections_element): Add dot_alignment
6310 parameter to set_section_addresses virtual function. Update
6311 instantiations.
6312 (class Output_section_element): Likewise.
6313 (Script_sections::create_segments): Add dot_alignment parameter.
6314 Change all callers.
6315 (Script_sections::create_segments_from_phdrs_clause): Likewise.
6316 (Script_sections::set_phdrs_clause_addresses): Likewise.
6317 * script-sections.h: Update declarations.
6318 * script.h: Update declarations.
6319 * output.h (Output_segment::set_minimum_p_align): Don't decrease
6320 min_p_align.
6321 * testsuite/script_test_3.t: Set large alignment.
6322 * testsuite/script_test_3.sh: Make sure that at least one LOAD
6323 segment has expected alignment.
6324
9c9c98a5
NC
63252010-04-22 Nick Clifton <nickc@redhat.com>
6326
6327 * po/gold.pot: Updated by the Translation project.
6328 * po/vi.po: Updated Vietnamese translation.
6329
2253bfba
L
63302010-04-22 H.J. Lu <hongjiu.lu@intel.com>
6331
6332 * testsuite/Makefile.am (check_PROGRAMS): Add
6333 icf_virtual_function_folding_test.
6334 * testsuite/Makefile.in: Regenerated.
6335
85fdf906
AH
63362010-04-15 Andrew Haley <aph@redhat.com>
6337
6338 * options.h (merge_exidx_entries): New option.
6339 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
6340 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
6341 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
6342 (Target_arm::merge_exidx_entries): New function.
6343 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
6344 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
6345 to Arm_exidx_fixup constructor.
6346 Add new arg, merge_exidx_entries.
6347 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
6348 Arm_output_section::fix_exidx_coverage.
6349
ce97fa81
ST
63502010-04-18 Sriraman Tallam <tmsriram@google.com>
6351
6352 * icf.cc (get_section_contents): Check for preemptible functions.
6353 Ignore addend when appropriate.
6354 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
6355 section folded.
6356 (add_from_relobj): Check for section folded.
6357 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
6358 * symtab.h (should_add_dynsym_entry): Add new parameter.
6359 * target-reloc.h (scan_relocs): Check for section folded.
6360 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
6361 Check reloc types for function pointers in shared objects.
6362 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
6363 case.
6364 (icf_preemptible_functions_test): New test case.
6365 (icf_string_merge_test): New test case.
6366 * testsuite.Makefile.in: Regenerate.
6367 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
6368 bar_glob. Refactor code.
6369 * testsuite/icf_preemptible_functions_test.cc: New file.
6370 * testsuite/icf_preemptible_functions_test.sh: New file.
6371 * testsuite/icf_string_merge_test.cc: New file.
6372 * testsuite/icf_string_merge_test.sh: New file.
6373 * testsuite/icf_virtual_function_folding_test.cc: New file.
6374 * testsuite/icf_virtual_function_folding_test.sh: New file.
6375
04ceb17c
DK
63762010-04-14 Doug Kwan <dougkwan@google.com>
6377
6378 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
6379 for local symbol recounting if we remove a section due to ICF.
6380 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
6381 there are no regular objects in input.
6382
153e7da4
DK
63832010-04-13 Doug Kwan <dougkwan@google.com>
6384
6385 * arm.cc (Arm_input_section::set_final_data_size): Compute
6386 accurate final data size instead of using current data size.
6387
4dbd9faf
DK
63882010-04-09 Doug Kwan <dougkwan@google.com>
6389
6390 * layout.cc (Layout::choose_output_section): Handle script section
6391 types.
6392 (Layout::make_output_section_for_script): Add section type parameter.
6393 Handle script section types.
6394 * layout.h (Layout::make_output_section_for_script): Add section
6395 type parameter.
6396 * output.cc (Output_section::Output_section): Initialize data member
6397 is_noload_.
6398 (Output_section::do_reset_address_and_file_offset): Do not set address
6399 to 0 if section is a NOLOAD section.
6400 * output.h (Output_section::is_noload): New method.
6401 (Output_section::set_is_noload): Ditto.
6402 (Output_section::is_noload_): New data member.
6403 * script-c.h (Script_section_type): New enum type.
6404 (struct Parser_output_section_header): Add new file section_type.
6405 * script-sections.cc (Sections_element::output_section_name): Add
6406 parameter for returning script section type.
6407 (Output_section_definition::output_section_name): Ditto.
6408 (Output_section_definition::section_type)P; New method.
6409 (Output_section_definiton::script_section_type_name): Ditto.
6410 (Output_section_definition::script_section_type_): New data member.
6411 (Output_section_definition::Output_section_definition): Initialize
6412 data member Output_section_definition::script_section_type_.
6413 (Output_section_definition::create_sections): Pass script section type
6414 to Layout::make_output_section_for_script.
6415 (Output_section_definition::output_section_name): Return script
6416 section type to caller.
6417 (Output_section_definition::set_section_address): Do not advance
6418 dot value and load address if section type is NOLOAD. Set address
6419 of NOLOAD sections regardless of section flags.
6420 (Output_section_definition::print): Print section type if it is
6421 not SCRIPT_SECTION_TYPE_NONE.
6422 (Output_section_definition::section_type): New method.
6423 (Output_section_definition::script_section_type_name): Ditto.
6424 (Script_sections::output_section_name): Add new parameter
6425 PSECTION_TYPE for returning script section type. Pass it to
6426 section elements. Handle discard sections.
6427 (Sort_output_sections::operator()): Handle NOLOAD sections.
6428 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 6429 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
6430 returning script section type.
6431 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
6432 INFO and NOLOAD.
6433 * yyscript.y (union): Add new field SECTION_TYPE.
6434 (COPY, DSECT, INFO, NOLOAD): New tokens.
6435 (opt_address_and_section_type): Change type to output_section_header.
6436 (section_type): New non-terminal
6437 (section_header): Handle section type.
2253bfba 6438 (opt_address_and_section_type): Return section type value.
4dbd9faf 6439
721ea635
L
64402010-04-09 H.J. Lu <hongjiu.lu@intel.com>
6441
6442 * testsuite/plugin_common_test_1.c (foo): Add prototype.
6443 * testsuite/plugin_common_test_2.c (foo): Likewise.
6444
6bf924b0
DK
64452010-04-08 Doug Kwan <dougkwan@google.com>
6446
6447 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
6448 Output_merge_data.
6449 * output.cc (Output_section::add_merge_input_section): Simplify
6450 code and return status of Output_merge_base::add_input_section.
e1df38aa 6451 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
6452 returns true.
6453
24af6f92
DK
64542010-04-07 Doug Kwan <dougkwan@google.com>
6455
6456 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
6457 if section is marked as containing instructions but has no mapping
6458 symbols.
6459 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
6460 correct section index.
6461 (Arm_relobj::find_linked_text_section): Ditto.
6462
00698fc5
CC
64632010-04-07 Cary Coutant <ccoutant@google.com>
6464
6465 * archive.cc (include_member): Destroy Read_symbols_data object before
6466 releasing file.
6467 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
6468 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
6469 (Read_symbols_data::~Read_symbols_data) New destructor.
6470 (Section_relocs::Section_relocs) New constructor.
6471 (Section_relocs::~Section_relocs) New destructor.
6472 (Read_relocs_data::Read_relocs_data) New constructor.
6473 (Read_relocs_data::~Read_relocs_data) New destructor.
6474 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
6475 pointers to NULL after deleting.
6476
7296d933
DK
64772010-04-07 Doug Kwan <dougkwan@google.com>
6478
6479 * arm.cc: Replace "endianity" with "endianness" in comments.
6480 (Arm_exidx_cantunwind): Ditto.
6481 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
6482 (Arm_relobj::merge_flags_and_attributes): New method.
6483 (Arm_relobj::merge_flags_and_attributes_): New data member.
6484 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
6485 (Arm_relobj::scan_sections_for_stubs): Ditto.
6486 (Arm_relobj::do_read_symbols): Check to see if we really want to
6487 merge processor-specific flags and attributes. Exit early if
6488 an object is empty except for section names and the undefined symbol.
6489 (Target_arm::do_finalize_sections): Move check for ELF format to
6490 Arm_relobj::do_read_symbols. Merge processor specific flags and
6491 attributes from a regular object only when we have determined that
6492 it is aapropriate. Do not create an .ARM.attributes section in
6493 output if there is no regular input object.
6494 (Target_arm::merge_processor_specific_flags): Check
6495 --warn-mismatch before printing any error.
6496 (Target_arm::merge_object_attributes): Ditto.
6497 * gold.cc (queue_middle_tasks): Handle the case in which there is
6498 no regular object in input.
6499 * options.cc (General_options::parse_EB): New method.
6500 (General_options::parse_EL): Same.
6501 (General_options::General_options): Initialize endianness_.
6502 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
6503 New options.
6504 (General_options::Endianness): New enum.
6505 (General_options::endianness): New method.
6506 (General_options::endianness_): New data member.
6507 * parameters.cc (Parameters::set_options): Check target endianness.
6508 (Parameters::set_target_once): Ditto.
6509 (Parameters::check_target_endianness): New method.
6510 (parameters_force_valid_target): If either -EL or -EB is specified,
6511 use it to define endianness of default target.
6512 * parameters.h (Parameters::check_target_endianness): New method
6513 declaration.
6514 * target.h (class Target): Change "endianity" to "endianness"
6515 in comments.
6516
efc8d4f2
RW
65172010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6518
6519 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
6520 * configure: Regenerate.
6521 * Makefile.in: Regenerate.
6522 * testsuite/Makefile.in: Regenerate.
6523
be234d88
CC
65242010-04-06 Cary Coutant <ccoutant@google.com>
6525
6526 gcc PR lto/42757
6527 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
6528 prevailing definitions of common symbols.
6529 * testsuite/plugin_test_6.sh: New test case.
6530 * testsuite/plugin_common_test_1.c: New test case.
6531 * testsuite/plugin_common_test_2.c: New test case.
6532 * testsuite/Makefile.am (plugin_test_6): New test case.
6533 * testsuite/Makefile.in: Regenerate.
6534
bd32c6bd
NC
65352010-04-06 Nick Clifton <nickc@redhat.com>
6536
6537 * po/vi.po: New Vietnamese translation.
6538
323c532f
DK
65392010-03-30 Doug Kwan <dougkwan@google.com>
6540
6541 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
6542
4fcd97eb
DK
65432010-03-25 Doug Kwan <dougkwan@google.com>
6544
6545 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
6546 to avoid a conversion warning on a 32-bit host.
6547
4ebf39db
ILT
65482010-03-24 Ian Lance Taylor <iant@google.com>
6549
6550 * testsuite/script_test_3.t: Add a TLS segment.
6551 * testsuite/Makefile.am (check_PROGRAMS): Add
6552 tls_phdrs_script_test.
6553 (tls_phdrs_script_test_SOURCES): Define.
6554 (tls_phdrs_script_test_DEPENDENCIES): Define.
6555 (tls_phdrs_script_test_LDFLAGS): Define.
6556 (tls_phdrs_script_test_LDADD): Define.
6557 * testsuite/Makefile.in: Rebuild.
6558
4a599bdd
CC
65592010-03-23 Cary Coutant <ccoutant@google.com>
6560
6561 * fileread.cc (find_or_make_view): Fix comment.
6562
6c93b22c
ILT
65632010-03-23 Ian Lance Taylor <iant@google.com>
6564
6565 * script-sections.cc (class Orphan_section_placement): Define
6566 PLACE_TLS and PLACE_TLS_BSS.
6567 (Orphan_section_placement::Orphan_section_placement): Initialize
6568 new places.
6569 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
6570 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
6571 (tls_script_test_SOURCES): Define.
6572 (tls_script_test_DEPENDENCIES): Define.
6573 (tls_script_test_LDFLAGS): Define.
6574 (tls_script_test_LDADD): Define.
6575 * testsuite/Makefile.in: Rebuild.
6576
a2c7281b
DK
65772010-03-22 Doug Kwan <dougkwan@google.com>
6578
6579 * arm.cc (Arm_relocate_functions::abs8,
6580 Arm_relocate_functions::abs16): Use correct check for overflow
6581 specified in the ARM ELF specs.
6582 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
6583 target of a BLX instruction specially.
6584 (Reloc_stub::stub_type_for_reloc): Ditto.
6585 (Relocate::relocate): Use symbolic names instead of numeric relocation
6586 codes to report error.
6587 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
6588 workaround.
6589 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
6590 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
6591 thumb2_blx_out_of_range.stdout
6592 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
6593 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
6594 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
6595 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
6596 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
6597 thumb2_blx_in_range, thumb2_blx_in_range.o,
6598 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
6599 thumb2_blx_out_of_range.o): New rules.
2e702c99 6600 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
6601 thumb2_blx_in_range and thumb2_blx_out_of_range.
6602 * testsuite/Makefile.in: Regenerate.
6603 * arm_branch_in_range.sh: Add tests for THUMB BLX.
6604 * testsuite/thumb_blx_in_range.s: New file.
6605 * testsuite/thumb_blx_out_of_range.s: New file.
6606
b0193076
RÁE
66072010-03-22 Rafael Espindola <espindola@google.com>
6608
6609 * archive.cc (Should_include): Move to archive.h.
6610 (should_include_member): Make it a member of Archive.
6611 (Lib_group): New.
6612 (Add_lib_group_symbols): New.
6613 * archive.h: Include options.h.
6614 (Archive_member): Moved from Archive.
6615 (Should_include): Moved from archive.cc.
6616 (Lib_group): New.
6617 (Add_lib_group_symbols): New.
6618 * dynobj.cc (do_should_include_member): New.
6619 * dynobj.h (do_should_include_member): New.
6620 * gold.cc (queue_initial_tasks): Update call to queue.
6621 * main.cc (main): Print lib group stats.
6622 * object.cc (do_should_include_member): New.
6623 * object.h: Include archive.h.
6624 (Object::should_include_member): New.
6625 (Object::do_should_include_member): New.
6626 (Sized_relobj::do_should_include_member): New.
6627 * options.cc (General_options::parse_start_lib): New.
6628 (General_options::parse_end_lib): New.
6629 (Input_arguments::add_file): Handle lib groups.
6630 (Input_arguments::start_group): Check we are not in a lib.
6631 (Input_arguments::start_lib): New.
6632 (Input_arguments::end_lib): New.
6633 * options.h (General_options): Add start_lib and end_lib.
6634 (Input_argument::lib_): New.
6635 (Input_argument::lib): New.
6636 (Input_argument::is_lib): New.
6637 (Input_file_lib): New.
6638 (Input_arguments::in_lib_): New.
6639 (Input_arguments::in_lib): New.
6640 (Input_arguments::start_lib): New.
6641 (Input_arguments::end_lib_): New.
6642 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
6643 in unused members as preempted.
6644 (Sized_pluginobj::do_should_include_member): New.
6645 * plugin.h (Sized_pluginobj::do_should_include_member): New.
6646 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
6647 return the blocker.
6648 (Read_symbols::do_whole_lib_group): New.
6649 (Read_symbols::do_lib_group): New.
6650 (Read_symbols::do_read_symbols): Handle lib groups.
6651 (Read_symbols::get_name): Handle lib groups.
6652 * readsyms.h (Read_symbols): Add an archive member pointer.
6653 (Read_symbols::do_whole_lib_group): New.
6654 (Read_symbols::do_lib_group): New.
6655 (Read_symbols::member_): New.
6656 * script.cc (read_input_script): Update call to queue_soon.
6657
d099120c
DK
66582010-03-19 Doug Kwan <dougkwan@google.com>
6659
6660 * arm.cc (Stub_table::Stub_table): Initialize new data members
6661 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
6662 (Stub_table::add_reloc_stub): Assign stub offset and update
6663 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
6664 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
6665 New data members.
2e702c99 6666 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
6667 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
6668 instead of going over all reloc stubs.
2e702c99 6669 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
6670 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
6671 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 6672 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
6673 Stringpool_template::offset_.
6674 * stringpool.h (Stringpool_template::set_no_zero_null): Set
6675 Stringpool_template::offset_ to zero.
6676
1aa37384
DK
66772010-03-15 Doug Kwan <dougkwan@google.com>
6678
6679 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
6680 offset_.
6681 (Stringpool_template::new_key_offset): New method.
6682 (Stringpool_template::add_string): Assign offsets when adding new
6683 strings.
6684 (Stringpool_template::set_string_offsets): Do not set string offsets
6685 when not optimizing.
6686 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
6687 member size_.
2e702c99
RM
6688 (Chunked_vector::clear): Clear size_.
6689 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
6690 (Chunked_vector::size): Return size_.
6691 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 6692 (Chunked_vector::size_): New data member.
1aa37384
DK
6693 (Stringpool_template::set_no_zero_null): Assert string set is empty.
6694 (Stringpool_template::new_key_offset): New method declaration.
6695 (Stringpool_template::offset_): New data member.
6696
b672b057
RÁE
66972010-03-15 Rafael Espindola <espindola@google.com>
6698
6699 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
6700 Add_symbols' constructor.
6701 * readsyms.h (Add_symbols): Remove the input_group member.
6702
b6848d3c
ILT
67032010-03-10 Ian Lance Taylor <iant@google.com>
6704
6705 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
6706 target to ask whether a reference to a symbol requires a stack
6707 split.
6708 * target.h (Target::is_call_to_non_split): New function.
6709 (Target::do_is_call_to_non_split): Declare virtual function.
6710 * target.cc: Include "symtab.h".
6711 (Target::do_is_call_to_non_split): New function.
6712 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
6713
a2a5469e
CC
67142010-03-10 Cary Coutant <ccoutant@google.com>
6715
6716 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
6717 (File_read::open[1]): Remove initial mapping of whole_file_view_.
6718 (File_read::open[2]): Add whole_file_view_ to list of views.
6719 (File_read::make_view): Remove test of whole_file_view_.
6720 (File_read::find_or_make_view): Create whole_file_view_ if
6721 necessary.
6722 (File_read::clear_views): Replace bool parameter with enum;
6723 adjust all callers. Don't delete views with permanent data;
6724 do delete cached views and views from archives if
6725 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
6726 if clearing the corresponding view.
6727 * fileread.h (File_read::Clear_views_mode): New enum.
6728 (File_read::View::is_permanent_view): New method.
6729 (File_read::clear_views): Replace bool parameter
6730 with enum; adjust all callers.
6731 * options.h (General_options): Change keep_files_mapped option;
6732 add map_whole_files.
6733 * readsyms.cc (Add_symbols::run): Delete sd_ object before
6734 releasing the file.
6735 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
6736 the file.
6737
8861f32b
DM
67382010-03-10 David S. Miller <davem@davemloft.net>
6739
6740 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
6741
d62d0f5f
ST
67422010-03-09 Sriraman Tallam <tmsriram@google.com>
6743
6744 * icf.cc (get_section_contents): Add '@' marker after processing the
6745 merge reloc.
6746
9177756d
DK
67472010-03-08 Doug Kwan <dougkwan@google.com>
6748
6749 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
6750 due to a conversion warning.
6751 (Arm_relobj::update_output_local_symbol_count): Check for local
6752 symbol with unset output index.
6753
9e9e071b
ILT
67542010-03-05 Ian Lance Taylor <iant@google.com>
6755
6756 * options.h (class General_options): Add --spare-dynamic-tags.
6757 * output.cc (Output_data_dynamic::set_final_data_size): Implement
6758 --spare-dynamic-tags.
6759
a81ee015
ILT
67602010-03-05 Ian Lance Taylor <iant@google.com>
6761
6762 * incremental.cc: Include "libiberty.h".
6763
44ec90b9
RO
67642010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
6765
6766 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
6767 function, is_info_ member.
6768 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
6769 (Versions::Versions): Update caller.
6770 (Versions::define_base_version): Likewise.
6771 (Versions::add_def): Likewise.
6772
0897ed3b
ST
67732010-03-03 Sriraman Tallam <tmsriram@google.com>
6774
6775 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
6776 (Scan::possible_function_pointer_reloc): New function.
6777 (Scan::local_reloc_may_be_function_pointer): Change to call
6778 possible_function_pointer_reloc.
6779 (Scan::global_reloc_may_be_function_pointer): Ditto.
6780 * icf.h (Icf::check_section_for_function_pointers): Change to reject
6781 relocations in ".data.rel.ro._ZTV" section.
6782 * testsuite/icf_safe_so_test.sh: Change to pass i386.
6783 * testsuite/icf_safe_so_test.cc: Ditto.
6784 * testsuite/icf_safe_test.cc: Ditto.
6785 * testsuite/icf_safe_test.sh: Ditto.
6786
d3bbad62
ILT
67872010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6788 Ian Lance Taylor <iant@google.com>
6789
6790 * target-reloc.h (relocate_section): Check the symbol table index
6791 for -1U before setting the local symbol index.
6792 (scan_relocatable_relocs): If copying the relocation, record that
6793 the local symbol is required.
6794 * object.h (Symbol_value::is_output_symtab_index_set): New
6795 function.
6796 (Symbol_value::may_be_discarded_from_output_symtab): New
6797 function.
6798 (Symbol_value::has_output_symtab_entry): New function.
6799 (Symbol_value::needs_output_symtab_entry): Remove.
6800 (Symbol_value::output_symtab_index): Make sure the symbol index is
6801 set.
6802 (Symbol_value::set_output_symtab_index): Make sure the symbol
6803 index is not set. Make sure the new index is valid.
6804 (Symbol_value::set_must_have_output_symtab_entry): New function.
6805 (Symbol_value::has_output_dynsym_entry): New function.
6806 (Symbol_value::set_output_dynsym_index): Make sure the new index
6807 is valid.
6808 (Sized_relobj::set_must_have_output_symtab_entry): New function.
6809 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
6810 local symbol if permitted.
6811 (Sized_relobj::do_finalize_local_symbols): Call
6812 is_output_symtab_index_set rather than needs_output_symtab_entry.
6813 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
6814 rather than needs_output_symtab_entry. Call
6815 has_output_dynsym_entry rather than needs_output_dynsym_entry.
6816 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
6817 is_output_symtab_index_set rather than needs_output_symtab_entry.
6818 * testsuite/discard_locals_relocatable_test.c: New file.
6819 * testsuite/discard_locals_test.sh: Test -r.
6820 * testsuite/Makefile.am (check_DATA): Add
6821 discard_locals_relocatable_test1.syms,
6822 discard_local_relocatable_test2.syms.
6823 (MOSTLYCLEANFILES): Likewise. Also add
6824 discard_locals_relocatable_test1.lout and
6825 discard_locals_relocatable_test2.out.
6826 (discard_locals_relocatable_test1.syms): New target.
6827 (discard_locals_relocatable_test.o): New target.
6828 (discard_locals_relocatable_test1.out): New target.
6829 (discard_locals_relocatable_test2.syms): New target.
6830 (discard_locals_relocatable_test2.out): New target.
6831 (various): Add missing ../ld-new dependencies.
6832 * testsuite/Makefile.in: Rebuild.
6833
7e8ccf26
NC
68342010-03-03 Nick Clifton <nickc@redhat.com>
6835
6836 * po/fi.po: New Finnish translation.
6837
2a0ff005
DK
68382010-03-01 Doug Kwan <dougkwan@google.com>
6839
6840 * layout.cc (Layout::Layout): Force section types of .init_array*,
6841 .preinit_array* and .fini_array* sections.
6842 * output.cc (Output_section::Input_section_sort_entry::has_priority):
6843 Fix check of return value of std::string::find.().
6844 (Output_section::Input_section_sort_compare::operator()): Remove
6845 comment about .init_array.
6846 (Output_section::Input_section_sort_init_fini_compare::operator()):
6847 New method.
6848 (Output_section::sort_attached_input_sections): Handle .init_array
6849 and .fini_array specially.
6850 * output.h (Output_section::Inut_section_sort_compare): Update
6851 comment.
6852 (Output_section::Input_section_sort_init_fini_compare): New struct.
6853
c3e4ae29
DK
68542010-02-26 Doug Kwan <dougkwan@google.com>
6855
6856 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
6857 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
6858 * testsuite/debug_msg.sh: Avoid matching source line number for
6859 use of global variable undef_int.
6860
2fd9ae7a
DK
68612010-02-26 Doug Kwan <dougkwan@google.com>
6862
6863 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
6864 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
6865 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
6866 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
6867 * options.cc (General_options::General_options): Initialize member
6868 fix_v4bx_.
6869 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
6870 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
6871 and rm_no_fix_v4bx.stdout
6872 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
6873 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
6874 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
6875 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
6876 and arm_no_fix_v4bx.
6877 * Makefile.in: Regenerate.
6878 * testsuite/arm_fix_v4bx.s: New file.
6879 * testsuite/arm_fix_v4bx.sh: Ditto.
6880
67ec7d0b
DK
68812010-02-24 Doug Kwan <dougkwan@google.com>
6882
6883 * arm.cc (Target_arm::got_section): Make the .got section the first
6884 non RELRO section in the data segment.
6885 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
6886 suffixes of section names.
6887
10165461
DK
68882010-02-24 Doug Kwan <dougkwan@google.com>
6889
6890 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
6891 flags and attributes merging if an input file is a binary file.
6892 * fileread.cc (Input_file::open): Record format of original file.
6893 * fileread.h (Input_file::Format): New enum type.
2e702c99 6894 (Input_file::Input_file): Initialize data member format_.
10165461
DK
6895 (Input_file::format): New method definition.
6896 (Input_file::format_):: New data member.
6897
4a54abbb
DK
68982010-02-24 Doug Kwan <dougkwan@google.com>
6899
6900 * arm.cc (Arm_output_data_got): New class.
6901 (ARM_TCB_SIZE): New constant
6902 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
6903 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
6904 If user uses a script with a SECTIONS clause, issue only a warning
6905 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 6906 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
6907 garbage collection.
6908 (Target_arm::got_mode_index_entry): Handle static linking.
6909 (Target_arm::Scan::local): Ditto.
6910 (Target_arm::Scan::global): Ditto.
6911 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
6912 all incorrectly implemented relocations.
e1df38aa 6913 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
6914 Arm_output_section::fix_exidx_coverage.
6915 * layout.cc (Layout::section_name_mapping): Remove trailing dots
6916 from ".ARM.exidx." and ".ARM.extab.".
6917
ca419a6f
ILT
69182010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6919
6920 * arm.cc (Target_arm::do_finalize_sections): Create attribute
6921 section if it does not already exist.
6922 * attributes.cc (Attributes_section_data::Attributes_section_data):
6923 Don't crash if size is zero.
6924
135b9c78
ILT
69252010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6926 Ian Lance Taylor <iant@google.com>
6927
6928 * gold.cc (queue_middle_tasks): If no input files were opened,
6929 exit.
6930 * workqueue.h (Task_function::Task_function): Assert that there is
6931 a blocker.
6932
bb0bfe4f
DK
69332010-02-22 Doug Kwan <dougkwan@google.com>
6934
6935 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
6936 * icf.cc (get_section_contents): Cast snprintf arguments to long long
6937 types to avoid warnings due to different uint64_t implementations
6938 on different hosts.
6939
2a2b6d42
DK
69402010-02-21 Doug Kwan <dougkwan@google.com>
6941
6942 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
6943 handling of the maximum backward branch offset.
2e702c99 6944 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
6945 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
6946 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 6947 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
6948 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
6949 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
6950 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
6951 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
6952 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
6953 thumb_bl_out_of_range thumb_bl_out_of_range.o,
6954 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
6955 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
6956 thumb2_bl_out_of_range.o): New rules.
6957 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
6958 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
6959 thumb2_bl_out_of_range
6960 * testsuite/Makefile.in: Regenerate.
6961 * testsuite/arm_bl_in_range.s: New file.
6962 * testsuite/arm_bl_out_of_range.s: Ditto.
6963 * testsuite/arm_branch_in_range.sh: Ditto.
6964 * testsuite/arm_branch_range.t: Ditto.
6965 * testsuite/thumb2_branch_range.t: Ditto.
6966 * testsuite/thumb_bl_in_range.s: Ditto.
6967 * testsuite/thumb_bl_out_of_range.s: Ditto.
6968 * testsuite/thumb_branch_range.t: Ditto.
6969
b487ad64
ST
69702010-02-20 Sriraman Tallam <tmsriram@google.com>
6971
6972 * gc.h (gc_process_relocs): Change vectors to point to the new list.
6973 Add reloc offset information.
6974 * icf.cc (get_section_contents): Change iterators to point to the new
6975 vectors. Add reloc offset information to the contents.
6976 * icf.h (Icf::Sections_reachable_info): New typedef.
6977 (Icf::Sections_reachable_list): New typedef.
6978 (Icf::Offset_info): New typedef.
6979 (Icf::Reloc_info): New struct typedef.
6980 (Icf::Reloc_info_list): New typedef.
6981 (Icf::symbol_reloc_list): Delete method.
6982 (Icf::addend_reloc_list): Delete method.
6983 (Icf::section_reloc_list): Delete method.
6984 (Icf::reloc_info_list): New method.
6985 (Icf::reloc_info_list_): New member.
6986
f96accdf
DK
69872010-02-19 Doug Kwan <dougkwan@google.com>
6988
6989 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
6990 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
6991 * arm.cc (Arm_relocation_functions): New forward declaration.
6992 (Target_arm::Target_arm): Initialize new data members
6993 got_mod_index_offset_ and tls_base_symbol_defined_.
6994 (Target_arm::Relocate::relocate_tls): New method.
6995 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
6996 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
6997 New methods.
2e702c99 6998 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
6999 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
7000 (Target_arm::got_mod_index_offset_,
7001 Target_arm::tls_base_symbol_defined_): New data members.
7002 (Target_arm::Scan::local, Target::Scan::global,
7003 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
7004 relocations.
7005
c8761b9a
DK
70062010-02-18 Doug Kwan <dougkwan@google.com>
7007
7008 * arm.cc (Arm_relobj::find_linked_text_section): New method.
7009 (Arm_relobj::make_exidx_input_section): Pass section index of linked
7010 text section as a parameter becuase some broken tools may not set
7011 the link in section header.
7012 (Target_arm::has_got_section): New method.
7013 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
7014 without any mapping symbol as data only. Remove warning.
7015 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
7016 link in its section header, try to discover the link by inspecting the
7017 REL31 relocation at the beginning of the section.
7018 (Target_arm::Scan::check_non_pic): Report name of offending relocation
7019 in error message.
7020 (Target_arm::Scan::global): Treat any reference to the symbol
7021 _GLOBAL_OFFSET_TABLE_ as a GOT access.
7022
21bb3914
ST
70232010-02-12 Sriraman Tallam <tmsriram@google.com>
7024
7025 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
7026 (Scan::global_reloc_may_be_function_pointer): New function.
7027 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
7028 (Scan::global_reloc_may_be_function_pointer): New function.
7029 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
7030 (Scan::global_reloc_may_be_function_pointer): New function.
7031 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
7032 (Scan::global_reloc_may_be_function_pointer): New function.
7033 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
7034 (Scan::global_reloc_may_be_function_pointer): New function.
7035 (Scan::possible_function_pointer_reloc): New function.
7036 (Target_x86_64::can_check_for_function_pointers): New function.
7037 * gc.h (gc_process_relocs): Scan relocation types to determine if
7038 function pointers were taken for targets that support it.
7039 * icf.cc (Icf::find_identical_sections): Include functions for
7040 folding in safe ICF whose pointer is not taken.
7041 * icf.h (Secn_fptr_taken_set): New typedef.
7042 (fptr_section_id_): New member.
7043 (section_has_function_pointers): New function.
7044 (set_section_has_function_pointers): New function.
7045 (check_section_for_function_pointers): New function.
7046 * options.h: Fix comment for safe ICF option.
7047 * target.h (can_check_for_function_pointers): New function.
7048 * testsuite/Makefile.am: Add icf_safe_so_test test case.
7049 Modify icf_safe_test for X86-64.
7050 * testsuite/Makefile.in: Regenerate.
7051 * testsuite/icf_safe_so_test.cc: New file.
7052 * testsuite/icf_safe_so_test.sh: New file.
7053 * testsuite/icf_safe_test.cc (kept_func_3): New function.
7054 (main): Change to take pointer to function kept_func_3.
7055 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
7056 folding is done correctly for X86-64.
7057
0da6fa6c
DM
70582010-02-12 David S. Miller <davem@davemloft.net>
7059
7060 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
7061 is_symbolless parameter.
7062 (Output_reloc<SHT_REL>::is_symbolless): New.
7063 (Output_reloc<SHT_REL>::is_symbolless_): New.
7064 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
7065 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
7066 (Output_reloc<SHT_RELA>::is_symbolless): New.
7067 (Output_data_reloc::add_global): Handle is_symbolless.
7068 (Output_data_reloc::add_global_relative): Likewise.
7069 (Output_data_reloc::add_local): Likewise.
7070 (Output_data_reloc::add_local_relative): Likewise.
7071 (Output_data_reloc::add_symbolless_global_addend): New.
7072 (Output_data_reloc::add_symbolless_local_addend): New.
7073 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
7074 is_symbolless.
7075 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
7076 instead of ->is_relative_
7077 (Output_reloc::write): Likewise.
7078 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
7079 (Output_reloc::write_rel): Simplify.
7080
7081 * sparc.cc (Target_sparc::Scan::local): Use
7082 ->add_symbolless_local_addend as needed.
7083 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
7084 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
7085 based upon relocation offset.
7086
e4782e83
DK
70872010-02-11 Doug Kwan <dougkwan@google.com>
7088
7089 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
7090 (Target_arm::Scan::global): Ditto. Also remove a comment before the
7091 beginning of function.
7092 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
7093 and MOVT_ABS relocations. Those are non issued in scanning. Fix
7094 parameter is_32bit in calls to should_apply_static_reloc.
7095 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
7096 (check_DATA): Add arm_abs_global.stdout.
7097 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
7098 arm_abs_global.stdout): New rules.
7099 (MOSTLLYCLEANFILES): Add arm_abs_global
7100 * Makefile.in: Regenerate.
7101 * testsuite/arm_abs_global.s: New file.
7102 * testsuite/arm_abs_global.sh: Ditto.
7103 * testsuite/arm_abs_lib.s: Ditto.
7104
93ceb764
ILT
71052010-02-11 Ian Lance Taylor <iant@google.com>
7106
7107 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
7108 Read_relocs task.
7109 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
7110 Allocate_commons_task first.
7111 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
7112 task, rather than symtab_lock_.
7113 (Gc_process_relocs::~Gc_process_relocs): New function.
7114 (Gc_process_relocs::is_runnable): Check this_blocker_.
7115 (Gc_process_relocs::locks): Use next_blocker_ rather than
7116 blocker_.
7117 (Scan_relocs::~Scan_relocs): New function.
7118 (Scan_relocs::is_runnable): Check this_blocker_ rather than
7119 symtab_lock_.
7120 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
7121 next_blocker_.
7122 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
7123 fields. Add this_blocker_ and next_blocker_ fields. Adjust
7124 constructor accordingly.
7125 (class Gc_process_relocs): Likewise.
7126 (class Scan_relocs): Likewise.
7127 * common.h (class Allocate_commons_task): Remove symtab_lock_
7128 field, and corresponding constructor parameter.
7129 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
7130 symtab_lock_.
7131 (Allocate_commons_task::locks): Likewise.
7132
114dfbe1
ILT
71332010-02-11 Ian Lance Taylor <iant@google.com>
7134
7135 * gold-threads.h (class Once): Define.
7136 (class Initialize_lock): Rewrite as child of Once.
7137 * gold-threads.cc (class Once_initialize): Define.
7138 (once_pointer_control): New static variable.
7139 (once_pointer, once_arg): New static variables.
7140 (c_run_once): New static function.
7141 (Once::Once, Once::run_once, Once::internal_run): New functions.
7142 (class Initialize_lock_once): Remove.
7143 (initialize_lock_control): Remove.
7144 (initialize_lock_pointer): Remove.
7145 (initialize_lock_once): Remove.
7146 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
7147 (Initialize_lock::initialize): Rewrite.
7148 (Initialize_lock::do_run_once): New function.
7149 * archive.cc (Archive::interpret_header): Only clear name if it is
7150 not already empty.
7151 * fileread.cc: Include "gold-threads.h"
7152 (file_counts_lock): New static variable.
7153 (file_counts_initialize_lock): Likewise.
7154 (File_read::release): Only increment counts when using --stats.
7155 Use a lock around the increment.
7156 * parameters.cc (class Set_parameters_target_once): Define.
7157 (set_parameters_target_once): New static variable.
7158 (Parameters::Parameters): Move here from parameters.h.
7159 (Parameters::set_target): Rewrite.
7160 (Parameters::set_target_once): New function.
7161 (Parameters::clear_target): Move here and rewrite.
7162 * parameters.h (class Parameters): Update declarations. Add
7163 set_parameters_target_once_ field.
7164 (Parameters::Parameters): Move to parameters.cc.
7165 (Parameters::clear_target): Likewise.
7166 * readsyms.cc (Read_symbols::do_group): Create a Start_group
7167 task.
7168 (Start_group::~Start_group): New function.
7169 (Start_group::is_runnable): New function.
7170 (Start_group::locks, Start_group::run): New functions.
7171 (Finish_group::run): Change saw_undefined to size_t.
7172 * readsyms.h (class Start_group): Define.
7173 (class Finish_group): Change saw_undefined_ field to size_t.
7174 (Finish_group::Finish_group): Remove saw_undefined and
7175 this_blocker parameters. Change all callers.
7176 (Finish_group::set_saw_undefined): New function.
7177 (Finish_group::set_blocker): New function.
7178 * symtab.h (class Symbol_table): Change saw_undefined to return
7179 size_t. Change saw_undefined_ field to size_t.
7180 * target-select.cc (Set_target_once::do_run_once): New function.
7181 (Target_selector::Target_selector): Initialize set_target_once_
7182 field. Don't initialize lock_ and initialize_lock_ fields.
7183 (Target_selector::instantiate_target): Rewrite.
7184 (Target_selector::set_target): New function.
7185 * target-select.h (class Set_target_once): Define.
7186 (class Target_selector): Update declarations. Make
7187 Set_target_once a friend. Remove lock_ and initialize_lock_
7188 fields. Add set_target_once_ field.
7189
fa17a3f4
ILT
71902010-02-10 Ian Lance Taylor <iant@google.com>
7191
7192 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
7193 queueing any tasks.
7194 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
7195 (queue_middle_tasks): Add all blockers before queueing any tasks.
7196 (queue_final_tasks): Likewise.
7197 * token.h (Task_token::add_blockers): New function.
7198 * object.h (Input_objects::number_of_relobjs): New function.
7199
c7177d31
ILT
72002010-02-10 Ian Lance Taylor <iant@google.com>
7201
5de0e392
ILT
7202 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
7203 shared, not if not position independent.
7204 * x86_64.cc (Relocate::relocate_tls): Likewise.
7205 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
7206 (tls_pie_pic_test): New target.
7207 * testsuite/Makefile.in: Rebuild.
7208
c7177d31
ILT
7209 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
7210 (tls_test_main_pie.o, tls_test_pie.o): New targets.
7211 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
7212 * testsuite/Makefile.in: Rebuild.
7213
684b268a
DM
72142010-02-09 David S. Miller <davem@davemloft.net>
7215
7216 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
7217 R_SPARC_RELATIVE using ->add_local_relative().
7218 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
7219
612a8d3d
DM
7220 * output.h (Output_data_dynamic::add_section_size): New method
7221 that takes two Output_data objects.
7222 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
7223 entry param. Handle it in initializers.
7224 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
7225 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
7226 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
7227 arg.
7228 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
7229 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
7230 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
7231 for dynrel_includes_plt.
7232 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7233 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7234 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
7235 before .rela.plt
7236 (Target_sparc::do_finalize_sections): Update to pass true for
7237 dynrel_includes_plt.
7238 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
7239 output before .rela.plt
7240 (Target_powerpc::do_finalize_sections): Update to pass true for
7241 dynrel_includes_plt when 32-bit.
7242
cb1be87e
DK
72432010-02-08 Doug Kwan <dougkwan@google.com>
7244
7245 * arm.cc (Arm_relobj::simple_input_section_output_address): New
7246 method.
7247 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
7248 Arm_relobj::scan_section_for_cortex_a8_stubs,
7249 Arm_relobj::do_relocation_section): Instead of calling
7250 Output_section::output_address, use faster
7251 Arm_relobj::simple_input_section_output_address.
7252
705b5121
DM
72532010-02-08 David S. Miller <davem@davemloft.net>
7254
7255 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
7256 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
7257 relocation helper function.
7258
024c4466
DM
7259 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
7260 just like R_SPARC_GOT{10,13,22}.
7261 (Target_sparc::Scan::local): Likewise.
7262 (Target_sparc::Relocate:relocate): Likewise.
7263
9109c078
ILT
72642010-02-06 Ian Lance Taylor <iant@google.com>
7265
7266 * configure.ac: Rewrite targetobjs duplicate removal code to use
7267 only shell constructs.
7268 * configure: Rebuild.
7269
cf846138
DK
72702010-02-05 Doug Kwan <dougkwan@google.com>
7271
7272 PR 11247
7273 * arm.cc (Arm_relobj::section_is_scannable): New method.
7274 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
7275 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
7276
6cfaf60b
DK
72772010-02-04 Doug Kwan <dougkwan@google.com>
7278
7279 PR 11247
7280 * arm-reloc-property.cc (cstdio): Include.
7281 * configure.ac (targetobjs): Remove duplicates.
7282 * configure: Regenerate.
7283 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
7284 big and little endian version for a given address size.
7285
5c57f1be
DK
72862010-02-03 Doug Kwan <dougkwan@google.com>
7287
7288 * arm-reloc-property.cc
7289 (Arm_reloc_property_table::reloc_name_in_error_message): New method
7290 definition.
7291 * arm-reloc-property.h
7292 (Arm_reloc_property_table::get_implemented_static_reloc_property):
7293 New method definition.
7294 (Arm_reloc_property_table::reloc_name_in_error_message): New method
7295 declaration.
7296 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
7297 overflow to N.
7298 (GOT_PREL): Change implemented to Y.
7299 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
7300 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
7301 (Arm_relocate_functions::movw_abs_nc): Remove method.
7302 (Arm_relocate_functions::movt_abs): Ditto.
7303 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
7304 (Arm_relocate_functions::thm_movt_abs): Ditto.
7305 (Arm_relocate_functions::movw_rel_nc): Ditto.
7306 (Arm_relocate_functions::movw_rel): Ditto.
7307 (Arm_relocate_functions::movt_rel): Ditto.
7308 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
7309 (Arm_relocate_functions:thm_movw_rel): Ditto.
7310 (Arm_relocate_functions:thm_movt_rel): Ditto.
7311 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
7312 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
7313 New method definitions.
7314 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
7315 (Arm_relocation_functions::arm_grp_ldr): Ditto.
7316 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
7317 (Arm_relocation_functions::arm_grp_ldc): Ditto.
7318 (Target_arm::Relocate::relocate): Check for non-static or
7319 unimplemented relocation code and exit early. Change calls to
7320 Target_arm::reloc_uses_thumb_bit and
7321 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
7322 instead. Refactor code to handle similar relocations to increase
7323 code sharing. Remove check for unsupported relocation code in switch
7324 statement.
7325 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
7326 relocation property table to find out size. Change error message to
7327 print out the name of a relocation code instead of the numeric value.
7328 (Target_arm::scan_reloc_for_stub): Use relocation property table
7329 instead of calling Target_arm::reloc_uses_thumb_bit().
7330
218c5831
DK
73312010-02-02 Doug Kwan <dougkwan@google.com>
7332
7333 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
7334 types of relaxed input section.
7335
0d31c79d
DK
73362010-02-02 Doug Kwan <dougkwan@google.com>
7337
7338 * Makefile.am (HFILES): Add arm-reloc-property.h.
7339 (DEFFILES): New.
2e702c99
RM
7340 (TARGETSOURCES): Add arm-reloc-property.cc
7341 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
7342 (libgold_a_SOURCES): $(DEFFILES)
7343 * Makefile.in: Regenerate.
7344 * arm-reloc-property.cc: New file.
7345 * arm-reloc-property.h: New file.
7346 * arm-reloc.def: New file.
7347 * arm.cc: Update comments.
7348 (arm-reloc-property.h): New included header.
7349 (arm_reloc_property_table): New global variable.
7350 (Target_arm::do_select_as_default_target): New method definition.
7351 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
7352 arm-reloc-property to targ_extra_obj.
7353 * parameters.cc (set_parameters_target): Call
7354 Target::select_as_default_target().
7355 * target.h (Target::select_as_default_target): New method definition.
7356 (Target::do_select_as_default_target): Same.
7357
546c7457
DK
73582010-02-01 Doug Kwan <dougkwan@google.com>
7359
7360 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
7361 first_output_text_section_.
7362 (Arm_exidx_fixup::first_output_text_section): New method definition.
7363 (Arm_exidx_fixup::first_output_text_section_): New data member.
7364 (Arm_exidx_fixup::process_exidx_section): Record the first text
7365 output section seen.
7366 (Arm_output_section::fix_exidx_coverage): Set correct linked section
7367 and entsize in output section header.
7368
11b861d5
DK
73692010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7370
7371 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
7372 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
7373 (Arm_relocate_functions::thm_alu11): New Method.
7374 (Arm_relocate_functions::thm_pc8): New Method.
7375 (Arm_relocate_functions::thm_pc12): New Method.
7376 (Target_arm::Scan::local): Handle the relocations.
7377 (Target_arm::Scan::global): Likewise.
7378 (Target_arm::Relocate::relocate): Likewise.
7379 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7380
c9a2c125
DK
73812010-01-29 Doug Kwan <dougkwan@google.com>
7382
7383 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
7384 of relocation types as ld.
7385
1521477a
DK
73862010-01-29 Doug Kwan <dougkwan@google.com>
7387
7388 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
7389 to public.
7390 (Arm_relocate_functions::thumb_branch_common): Ditto.
7391 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
7392 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
7393 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
7394 Arm_relocate_functions::jump24): Remove.
7395 (Target_arm::Relocate::relocate): Adjust code to call
7396 Arm_relocation_functions::arm_branch_common and
7397 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 7398 wrappers. Merge switch-cases together to reduce source code size.
1521477a 7399
e7eca48c
DK
74002010-01-29 Doug Kwan <dougkwan@google.com>
7401
7402 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
7403 output_local_symbol_count_needs_update_.
7404 (Arm_relobj::output_local_symbol_count_needs_update,
7405 Arm_relobj::set_output_local_symbol_count_needs_update,
7406 Arm_relobj::update_output_local_symbol_count): New methods.
7407 (Arm_relobj::output_local_symbol_count_needs_update_): New data
7408 member.
7409 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
7410 of pointed function as in a R_ARM_PREL31 relocation.
7411 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
7412 for output local symbol count updating.
7413 (Target_arm::do_relax): Update output local symbol counts in objects
7414 if necessary.
7415 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
7416
02961d7e
ILT
74172010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7418
7419 * arm.cc: Added support for the ARM relocations:
7420 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
7421 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
7422 (Arm_relocate_functions::movw_rel_nc): Renamed (was
7423 movw_prel_nc).
7424 (Arm_relocate_functions::movw_rel): New method.
7425 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
7426 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
7427 thm_movw_prel_nc).
7428 (Arm_relocate_functions::thm_movw_rel): New method.
7429 (Arm_relocate_functions::thm_movt_rel): Renamed (was
7430 thm_movt_prel).
7431 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
7432 relocations.
7433 (Target_arm::Scan::global): Likewise.
7434 (Target_arm::Relocate::relocate): Likewise.
7435 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7436 Likewise.
7437
b10d2873
ILT
74382010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7439
7440 * arm.cc: Added support for ARM group relocations.
7441 (Target_arm::reloc_needs_sym_origin): New method.
7442 (Arm_relocate_functions::calc_grp_kn): New method.
7443 (Arm_relocate_functions::calc_grp_residual): New method.
7444 (Arm_relocate_functions::calc_grp_gn): New method.
7445 (Arm_relocate_functions::arm_grp_alu): New Method.
7446 (Arm_relocate_functions::arm_grp_ldr): New Method.
7447 (Arm_relocate_functions::arm_grp_ldrs): New Method.
7448 (Arm_relocate_functions::arm_grp_ldc): New Method.
7449 (Target_arm::Scan::local): Handle the ARM group relocations.
7450 (Target_arm::Scan::global): Likewise.
7451 (Target_arm::Relocate::relocate): Likewise.
7452 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7453 Likewise.
7454
2b328d4e
DK
74552010-01-26 Doug Kwan <dougkwan@google.com>
7456
7457 * arm.cc (set): Include.
7458 (class Arm_exidx_fixup): Change type of last_input_section_ to const
7459 pointer type.
2e702c99 7460 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
7461 (Arm_output_section::append_text_sections_to_list): New method.
7462 (Arm_output_section::fix_exidx_coverage): Ditto.
7463 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 7464 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
7465 Relobj::set_section_offset() instead of
7466 Sized_relobj::invalidate_section_offset().
2e702c99 7467 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
7468 parameter for section headers. Ignore relocation sections for
7469 unallocated sections and EXIDX sections.
7470 (Target_arm::fix_exidx_coverage): New method.
7471 (Target_arm::output_section_address_less_than): New type.
7472 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
7473 linked text section instead of the EXIDX section.
7474 (Arm_output_section::create_stub_group): Add an assertion to check
7475 that this is not an EXIDX output section.
7476 (Arm_output_section::append_text_sections_to_list): New method.
7477 (Arm_output_section::fix_exidx_coverage): Ditto.
7478 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 7479 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
7480 (Target_arm::do_relax): Fix EXIDX output section coverage in the
7481 first pass.
7482 (Target_arm::fix_exidx_coverage): New method.
7483 * object.h (Relobj::set_output_section): New method.
7484 (Sized_relobj::invalidate_section_offset): Remove method.
7485 (Sized_relobj::do_invalidate_section_offset): Remove method.
7486 (Sized_relobj::do_set_section_offset): Handle offset value -1.
7487
c7f3c371
DK
74882010-01-25 Doug Kwan <dougkwan@google.com>
7489
7490 * arm.cc (Arm_exidx_merged_section::do_output_offset):
7491 Fix warning due to signed and unsigned comparison on a 32-bit host.
7492
8923b24c
DK
74932010-01-22 Doug Kwan <dougkwan@google.com>
7494
7495 * arm.cc (Target_arm::do_relax): Record an output section for section
7496 offset adjustment it contains any stub table that has changed.
7497 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
7498 offsets in an output section if necessary.
7499 * output.cc (Output_section::Output_section): Initialize
7500 section_offsets_need_adjustments_.
7501 (Output_section::add_input_section_for_script): Renamed to
7502 Output_section::add_simple_input_section.
7503 (Output_section::save_states): Add a comment.
7504 (Output_section::discard_states): New method defintion.
7505 (Output_section::adjust_section_offsets): Same.
7506 * output.h (Output_section::add_input_section_for_script): Renamed to
7507 Output_section::add_simple_input_section.
7508 (Output_section::discard_states): New method declaration.
7509 (Output_section::adjust_section_offsets): Same.
7510 (Output_section::section_offsets_need_adjustment,
7511 Output_section::set_section_offsets_need_adjustment): New method
7512 definitions.
7513 (Output_section::section_offsets_need_adjustment_): New data member.
7514 * script-sections.cc
7515 (Output_section_element_input::set_section_address): Adjust code for
7516 renaming of Output_section::add_input_section_for_script.
7517 (Orphan_output_section::set_section_address): Same.
7518
9b2fd367
DK
75192010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7520
7521 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
7522 Fix_v4bx enum values .
7523 * gold/options.h (General_options): New option definitions.
7524 (General_options::fix_v4bx): New method.
7525 (General_options::Fix_v4bx): New enum.
7526 * gold/options.cc (General_options::parse_fix_v4bx): New method.
7527 (General_options::parse_fix_v4bx_interworking): New method.
7528
80d0d023
DK
75292010-01-22 Doug Kwan <dougkwan@google.com>
7530
7531 * arm.cc (Arm_exidx_fixup): New class.
7532
af2cdeae
DK
75332010-01-21 Doug Kwan <dougkwan@google.com>
7534
7535 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
7536 classes.
7537 (Arm_exidx_section_offset_map): New type.
7538
993d07c1
DK
75392010-01-21 Doug Kwan <dougkwan@google.com>
7540
7541 * arm.cc (Arm_exidx_input_section): New class.
7542 (Arm_relobj::exidx_input_section_by_link,
7543 Arm_relobj::exidx_input_section_by_shndx,
7544 Arm_relobj::make_exidx_input_section): New methods.
7545 (read_arm_attributes_section): Remove.
7546 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
7547 information about them.
7548 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
7549 to here.
7550
5ac169d4
DK
75512010-01-20 Doug Kwan <dougkwan@google.com>
7552
7553 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
7554 Input_section_specifier to Section_id.
7555 (Target_arm::new_arm_input_section: Adjust code for change of key
7556 type.
7557 (Target_arm::find_arm_input_section): Ditto.
7558 * gc.h (object.h): Include for Section_id nand Section_id_hash.
7559 (Section_id): Remove.
7560 (Garbage_collection::Section_id_hash): Remove.
7561 * icf.h (object.h): Include for Section_id nand Section_id_hash.
7562 (Section_id): Remove.
7563 (Icf::Section_id_hash): Remove.
7564 * object.h (Section_id, Const_section_id, Section_id_hash,
7565 Const_section_id_hash): New type definitions.
7566 * output.cc (Output_section::add_relaxed_input_section): Change to
7567 use Const_section_id instead of Input_section_specifier as key type.
7568 (Output_section::add_merge_input_section): Ditto.
7569 (Output_section::build_relaxation_map): Change to use Section_id
7570 instead of Input_section_specifier as key type.
2e702c99 7571 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
7572 Ditto.
7573 (Output_section::convert_input_sections_to_relaxed_sections): Change
7574 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 7575 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
7576 (Output_section::find_relaxed_input_section): Ditto.
7577 * output.h (Input_section_specifier): Remove class.
7578 (Output_section::Output_section_data_by_input_section_map): Change
7579 key type to Const_section_id.
7580 (Output_section::Output_relaxed_input_section_by_input_section_map):
7581 Ditto.
7582 (Output_section::Relaxation_map): Change key type to Section_id.
7583
a2162063
ILT
75842010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7585
7586 * gold/arm.cc: Added support for R_ARM_V4BX relocation
7587 (class Arm_v4bx_stub): New class.
7588 (DEF_STUBS): Updated definition to support v4_veneer_bx.
7589 (Stub_factory::make_arm_v4bx_stub): New method.
7590 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
7591 (Stub_table::empty): Handle v4bx stubs.
7592 (Stub_table::add_arm_v4bx_stub): New method.
7593 (Stub_table::find_arm_v4bx_stub): New method.
7594 (Arm_relocate_functions::v4bx): New method.
7595 (Target_arm::fix_v4bx): New method.
7596 (Target_arm::Target_arm): Handle R_ARM_V4BX.
7597 (Stub_table::relocate_stubs): Likewise.
7598 (Stub_table::do_write): Likewise.
7599 (Stub_table::update_data_size_and_addralign): Likewise.
7600 (Stub_table::finalize_stubs): Likewise.
7601 (Target_arm::Scan::local): Likewise.
7602 (Target_arm::Scan::global): Likewise.
7603 (Target_arm::do_finalize_sections): Likewise.
7604 (Target_arm::Relocate::relocate): Likewise.
7605 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7606 Likewise.
7607 (Target_arm::scan_reloc_for_stub): Likewise.
7608 (Target_arm::scan_reloc_section_for_stubs): Likewise.
7609
5696ab0b
ILT
76102010-01-19 Ian Lance Taylor <iant@google.com>
7611
7612 * output.cc (Output_section_headers::do_sized_write): Write large
7613 segment count to sh_info field.
7614 (Output_file_header::do_sized_write): For large segment count,
7615 write PN_XNUM to e_phnum field.
7616
800d0f56
ILT
76172010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7618
7619 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
7620 (Arm_relocate_functions::thm_jump8): New function.
7621 (Arm_relocate_functions::thm_jump11): New function.
7622 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
7623 R_ARM_THM_JUMP11.
7624 (Target_arm::Scan::global): Likewise.
7625 (Target_arm::Relocate::relocate): Likewise.
7626 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7627 Likewise.
7628
41263c05
DK
76292010-01-14 Doug Kwan <dougkwan@google.com>
7630
7631 * arm.cc (map, utility): Include headers.
7632 (Target_arm::apply_cortex_a8_workaround): New method.
7633 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
7634 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
7635 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
7636 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
7637 the --[no-]fix-cortex-a8 command line options.
7638 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
7639 (Target_arm::relocate_stub): Use addend in instruction template.
7640 * options.h (DEFINE_bool): Set the user-set flag.
7641 (General_options): Add --[no-]-fix-cortex options.
7642 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 7643 : Update fast look-up map after conversion.
41263c05 7644
459e9b03
ST
76452010-01-14 Sriraman Tallam <tmsriram@google.com>
7646
7647 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
7648 in the first pass of do_layout.
7649
b521dfe4
DK
76502010-01-13 Doug Kwan <dougkwan@google.com>
7651
7652 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
7653 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
7654 apparent compiler problem of not folding static constant integral
7655 data members of elfcpp::Elf_sizes<32>.
7656
44272192
DK
76572010-01-13 Doug Kwan <dougkwan@google.com>
7658
7659 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
7660 Arm_relobj::section_needs_cortex_a8_stub_scanning,
7661 Arm_relobj::scan_section_for_cortex_a8_erratum,
7662 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
7663 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
7664 sections to scan for relocation stubs into a new method
7665 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
7666 relocation and Cortex-A8 stub scanning.
7667 (Target_arm::do_relax): Force stubs to be after stubbed sections
7668 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 7669 the beginning of a new relaxation pass. Update a comment.
44272192
DK
7670 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
7671
44b71ece
ILT
76722010-01-12 Ian Lance Taylor <iant@google.com>
7673
7674 * target-reloc.h (visibility_error): New inline function.
7675 (relocate_section): Call visibility_error.
7676 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
7677 (MOSTLYCLEANFILES): Likewise.
7678 (protected_4_pic.o, protected_3.err): New targets.
7679 * testsuite/protected_4.cc: New file.
7680
a120bc7f
DK
76812010-01-12 Doug Kwan <dougkwan@google.com>
7682
7683 * arm.cc (Cortex_a8_reloc): New class.
7684 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
7685 and cortex_a8_relocs_info_.
7686 (Target_arm::fix_cortex_a8): New method definition.
7687 (Target_arm::Cortex_a8_relocs_info): New type.
7688 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
7689 New data member declarations.
7690 (Target_arm::scan_reloc_for_stub): Record information about
7691 relocations for THUMB branches that might be exempted from the
7692 Cortex-A8 workaround.
7693 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
7694 at the beginning of a relaxation pass.
7695
20138696
DK
76962010-01-12 Doug Kwan <dougkwan@google.com>
7697
7698 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
7699 (Arm_relobj::Mapping_symbol_position,
7700 Arm_reloj::Mapping_symbol_position_less,
7701 Arm_relobj::Mapping_symbols_info): New types.
7702 (Target_arm::is_mapping_symbol_name): New method definition.
7703 (Arm_relobj::do_count_local_symbols): Save information about mapping
7704 symbols.
7705
089d69dc
DK
77062010-01-11 Doug Kwan <dougkwan@google.com>
7707
7708 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
7709 Arm_relocate_functions::thumb32_branch_upper,
7710 Arm_relocate_functions::thumb32_branch_lower,
7711 Arm_relocate_functions::thumb32_cond_branch_offset,
7712 Arm_relocate_functions::thumb32_cond_branch_upper,
7713 Arm_relocate_functions::thumb32_cond_branch_lower,
7714 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
7715 branch offset encoding.
7716 (Arm_relocate_functions::thumb_branch_common): Use new branch
7717 offset encoding methods to avoid code duplication.
7718 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
7719 (Stub_addend_reader::operator()): Use new branch encoding method
7720 to avoid code duplication.
7721
99e5bff2
DK
77222010-01-11 Doug Kwan <dougkwan@google.com>
7723
7724 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
7725 (Target_arm::do_finalize_sections): Define special EXIDX section
7726 symbols only if referenced.
7727 * gc.h (Garbage_collection::add_reference): New method.
7728 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
7729 code duplication.
7730
98e090bd
ILT
77312010-01-11 Ian Lance Taylor <iant@google.com>
7732
d0a91bd8
ILT
7733 * script.cc (Version_script_info::build_expression_list_lookup):
7734 Change complaing about duplicate wildcard match from error to
7735 warning.
7736
98e090bd
ILT
7737 * script.cc (class Lazy_demangler): Recreate--revert part of patch
7738 of 2009-12-30.
7739 (Version_script_info::Version_script_info): Initialize globs_,
7740 default_version_, default_is_global_, and exact_. Don't
7741 initialize globals_ or locals_.
7742 (Version_script_info::build_lookup_tables): Build local symbols
7743 first.
7744 (Version_script_info::unquote): New function.
7745 (Version_script_info::add_exact_match): New function.
7746 (Version_script_info::build_expression_list_lookup): Remove lookup
7747 parameter. Add is_global parameter. Change all callers. Handle
7748 wildcard pattern specially. Unquote pattern. Call
7749 add_exact_match.
7750 (Version_script_info::get_name_to_match): New function.
7751 (Version_script_info::get_symbol_version): New function.
7752 (Version_script_info::get_symbol_version_helper): Remove.
7753 (Version_script_info::check_unmatched_names): Call unquote.
7754 * script.h (class Version_script_info): Change get_symbol_version
7755 to be non-inline and add is_global parameter; change all callers.
7756 Rewrite symbol_is_local. Update declarations. Define struct
7757 Version_tree_match, Exact, Globs. Don't define struct Lookup.
7758 Remove globals_ and locals_ members. Add exact_, globs_,
7759 default_version_, is_global_.
7760 (Version_script_info::Glob): Remove pattern, add expression and
7761 is_global. Update constructor. Change all callers.
7762 * dynobj.cc (Versions::finalize): Mark the version symbol as the
7763 default version.
7764 (Versions::symbol_section_contents): If a symbol is undefined, or
7765 defined in a dynamic object, set the version index to
7766 VER_NDX_LOCAL.
7767 * symtab.cc (Symbol_table::add_from_relobj): Don't call
7768 symbol_is_local.
7769 (Symbol_table::add_from_pluginobj): Likewise.
7770 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
7771
d56962d3
DK
77722010-01-11 Doug Kwan <dougkwan@google.com>
7773
7774 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
7775 (incremental_dump_LDADD): Add linking option for libintl.
7776 * Makefile.in: Regenerate.
7777
94e6ee91
L
77782010-01-11 H.J. Lu <hongjiu.lu@intel.com>
7779
7780 PR gold/11144
7781 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
7782 instead of -Ds.
7783 * testsuite/Makefile.in: Regenerated.
7784
e96c574b
DK
77852010-01-10 Doug Kwan <dougkwan@google.com>
7786
7787 * options.h (DEFINE_var): Use parentheses around argument varname__
7788 in macro body to avoid any unintended subsequent substitutions.
7789
7198066b
ILT
77902010-01-10 Ian Lance Taylor <iant@google.com>
7791
ba4d53bf
ILT
7792 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
7793 candidates before doing symbol resolution.
7794
7198066b
ILT
7795 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
7796 ODR candidates if only one is weak.
7797
a2beed37
ILT
77982010-01-08 Ian Lance Taylor <iant@google.com>
7799
7800 * script.cc (Version_script_info::build_expression_list_lookup):
7801 Don't warn about ambiguous version, just record the ambiguity.
7802 (Version_script_info::get_symbol_version_helper): Give error if
7803 version is ambiguous.
7804
2fb7225c
DK
78052010-01-08 Doug Kwan <dougkwan@google.com>
7806
7807 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
7808 prev_data_size_ and prev_addralign_. Remove initializer for
7809 deleted data member has_been_changed_.
7810 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
7811 to determine if the table is empty.
7812 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
7813 Remove.
7814 (Stub_table::add_reloc_stub): Define method in class definition
7815 instead of just declaring it there.
7816 (Stub_table::add_cortex_a8_stub): New method definition.
7817 (Stub_table::update_data_size_and_addralign): Ditto.
7818 (Stub_table::finalize_stubs): Ditto.
7819 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
7820 (Stub_table::do_addralign_): Return address alignment in the
7821 (Stub_table::do_reset_address_and_file_offset): Define method in
7822 class definition instead of declaring it there. Set current data
7823 size to be the data size of the previous pass.
7824 (Stub_table::set_final_data_size): Use current data size as the
7825 final data size.
7826 (Stub_table::relocate_stub): Change parameter type of stub from
7827 Reloc_stub pointer to Stub pointer.
7828 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
7829 (Stub_table::Cortex_a8_stub_list): New typedef.
7830 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
7831 Stub_table::prev_addralign_): New data member.
7832 (Arm_relobj::Arm_relobj): Initialize data member
7833 section_has_cortex_a8_workaround_.
7834 (Arm_relobj::section_has_cortex_a8_workaround,
7835 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
7836 definitions.
7837 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
7838 declarations.
7839 (Target_arm::relocate_stub): Change parameter type of stub from
7840 Reloc_stub pointer to Stub pointer.
7841 (Insn_template::size, Insn_template::alignment): Handle
7842 THUMB16_SPECIAL_TYPE.
7843 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
7844 Stub_table::update_data_size_and_addralign,
7845 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
7846 definitions.
7847 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
7848 (Stub_table::do_write): Ditto.
7849 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 7850
880cd20d
ILT
78512010-01-08 Ian Lance Taylor <iant@google.com>
7852
7853 PR 11108
7854 * symtab.h (class Symbol): Remove fields is_target_special_ and
7855 has_plt_offset_. Add field is_defined_in_discarded_section_.
7856 (Symbol::is_defined_in_discarded_section): New function.
7857 (Symbol::set_is_defined_in_discarded_section): New function.
7858 (Symbol::has_plt_offset): Rewrite.
7859 (Symbol::set_plt_offset): Verify that new offset is not -1U.
7860 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
7861 Don't initialize is_target_special_ or has_plt_offset_.
7862 Initialize is_defined_in_discarded_section_.
7863 (Symbol_table::add_from_relobj): If appropriate, set
7864 is_defined_in_discarded_section.
7865 * resolve.cc (Symbol::override_base_with_special): Don't test
7866 is_target_special_. Change has_plt_offset_ to has_plt_offset().
7867 * target-reloc.h (relocate_section): Do special handling for
7868 symbols defined in discarded sections for global symbols as well
7869 as local symbols.
7870
2703e3eb
ILT
78712010-01-08 Ian Lance Taylor <iant@google.com>
7872
7873 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
7874 the SHT_SYMTAB case.
7875
339d40a3
ILT
78762010-01-08 Ian Lance Taylor <iant@google.com>
7877
7878 * object.cc (Sized_relobj::do_layout): Don't get confused if
7879 layout_eh_frame returns NULL.
7880
abecea76
ILT
78812010-01-08 Ian Lance Taylor <iant@google.com>
7882
7883 PR 11084
7884 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
7885 dynamic symbol table, use the normal symbol table.
7886 (Sized_dynobj::do_read_symbols): Remove assertion about type of
7887 symbol table.
7888
6b7dd3f3
ILT
78892010-01-08 Ian Lance Taylor <iant@google.com>
7890
7891 PR 11072
7892 * layout.cc (Layout::include_section): Remove .gnu_debuglink
7893 sections.
7894
36c50e63
L
78952010-01-08 H.J. Lu <hongjiu.lu@intel.com>
7896
7897 * version.cc (print_version): Change to "Copyright 2010".
7898
e291e7b9
ILT
78992010-01-08 Ian Lance Taylor <iant@google.com>
7900
7901 PR 10287
7902 PR 11063
7903 * i386.cc (class Target_i386): Change return type of plt_section
7904 to be non-const.
7905 (class Output_data_plt_i386): Add tls_desc_rel_ field.
7906 (Output_data_plt_i386::Output_data_plt_i386): Initialize
7907 tls_desc_rel_ field.
7908 (Output_data_plt_i386::rel_tls_desc): New function.
7909 (Target_i386::rel_tls_desc_section): New function.
7910 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
7911 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
7912 R_386_TLS_DESC reloc in rel_tls_desc_section.
7913 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
7914 Define struct Tlsdesc_info.
7915 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
7916 (Target_x86_64::do_reloc_symbol_index): New function.
7917 (Target_x86_64::add_tlsdesc_info): New function.
7918 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
7919 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
7920 tlsdesc_rel_ field.
7921 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
7922 all callers.
7923 (Output_data_plt_x86_64::rela_tlsdesc): New function.
7924 (Target_x86_64::rela_tlsdesc_section): New function.
7925 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
7926 handling.
7927 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
7928 (Target_x86_64::do_reloc_addend): New function.
7929 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
7930 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
7931 declarations. Define TARGET_CODE. Add arg field to u1_ union.
7932 (Output_reloc::type): New function.
7933 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
7934 (Output_reloc::is_target_specific): New function.
7935 (Output_reloc::target_arg): New function.
7936 (class Output_reloc) [SHT_RELA]: Add four new constructors for
7937 absolute relocs and target specific relocs.
7938 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
7939 add_target_specific.
7940 (class Output_data_reloc) [SHT_RELA]: Likewise.
7941 * output.cc (Output_reloc::Output_reloc): Add four new versions
7942 for absolute relocs and target specific relocs.
7943 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
7944 (Output_reloc::get_symbol_index): Likewise.
7945 (Output_reloc::local_section_offset): Check that local_sym_index_
7946 is not TARGET_CODE or 0.
7947 (Output_reloc::symbol_value): Likewise.
7948 (Output_reloc::write) [SHT_RELA]: Call target for target specific
7949 reloc.
7950 * target.h (class Target): Add reloc_symbol_index and reloc_addend
7951 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
7952 functions.
7953 * layout.cc (add_target_dynamic_tags): Use output section for
7954 DT_PLTRELSZ and DT_JMPREL.
7955
3a44184e
ILT
79562010-01-07 Ian Lance Taylor <iant@google.com>
7957
7958 PR 11061
7959 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
7960 function.
7961 (class Output_data_reloc_generic): Define.
7962 (class Output_data_reloc_base): Change base class to
7963 Output_data_reloc_generic. Change add() method to call
7964 bump_relative_reloc_count for a relative reloc. Remove
7965 sort_relocs_ field.
7966 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
7967 to sort_relocs().
7968 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
7969 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
7970 appropriate.
7971 * layout.h (class Layout): Update declaration.
7972
ea715a34
ILT
79732010-01-07 Ian Lance Taylor <iant@google.com>
7974
7975 * output.h (class Output_data): Add const version of
7976 output_section and do_output_section.
7977 (class Output_section_data): Add const version of
7978 do_output_section.
7979 (class Output_section): Likewise.
7980 * layout.cc (Layout::add_target_dynamic_tags): New function.
7981 * layout.h (class Layout): Update declarations.
7982 * arm.cc (Target_arm::do_finalize_sections): Use
7983 add_target_dynamic_tags.
7984 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7985 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
7986 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
7987 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7988
659948a4
ILT
79892010-01-07 Ian Lance Taylor <iant@google.com>
7990
7991 PR 11042
7992 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
7993 object as needed.
7994
9d3b86f6
ILT
79952010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
7996 Ian Lance Taylor <iant@google.com>
7997
7998 PR 11019
7999 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
8000 Xindex::read_symtab_xindex.
8001
bb0d3eb0
DK
80022010-01-07 Doug Kwan <dougkwan@google.com>
8003
8004 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
8005 (Insn_template::thumb16_bcond_insn): New method declaration.
8006 (Insn_template): Fix spelling.
8007 (Stub::thumb16_special): New method declaration.
8008 (Stub::do_write): Define virtual method which was previously pure
8009 virtual.
8010 (Stub::do_thumb16_special): New method declaration.
8011 (Stub::do_fixed_endian_write): New template member.
8012 (Reloc_stub::do_write): Remove.
8013 (Reloc_stub::do_fixed_endian_write): Remove.
8014 (Cortex_a8_stub): New class definition.
8015 (Stub_factory::make_cortex_a8_stub): New method definition.
8016 (Stub_factory::Stub_factory): Add missing static storage class
8017 qualifier for elf32_arm_stub_a8_veneer_blx.
8018
ffeef7df
ILT
80192010-01-07 Ian Lance Taylor <iant@google.com>
8020
dc3f80fe
ILT
8021 PR 10980
8022 * options.h (class General_options): Add --warn-unresolved-symbols
8023 and --error-unresolved-symbols.
8024 * errors.cc (Errors::undefined_symbol): Implement
8025 --warn-unresolved-symbols.
8026
ffeef7df
ILT
8027 * options.h (class General_options): Add -z text and -z textoff.
8028 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
8029
f1ec9ded
ST
80302010-01-06 Sriraman Tallam <tmsriram@google.com>
8031
8032 * gc.h (Garbage_collection::Cident_section_map): New typedef.
8033 (Garbage_collection::cident_sections): New function.
8034 (Garbage_collection::add_cident_section): New function.
8035 (Garbage_collection::cident_sections_): New member.
8036 (gc_process_relocs): Add references to sections whose names are C
8037 identifiers.
8038 * gold.h (cident_section_start_prefix): New constant.
8039 (cident_section_stop_prefix): New constant.
8040 (is_cident): New function.
8041 * layout.cc (Layout::define_section_symbols): Replace string constants
8042 with the newly defined constants.
8043 * object.cc (Sized_relobj::do_layout): Track sections whose names are
8044 C identifiers.
8045 * testsuite/Makefile.am: Add gc_orphan_section_test.
8046 * testsuite/Makefile.in: Regenerate.
8047 * testsuite/gc_orphan_section_test.cc: New file.
8048 * testsuite/gc_orphan_section_test.sh: New file.
8049
6eda8c29
ILT
80502010-01-06 Ian Lance Taylor <iant@google.com>
8051
b9674e17
ILT
8052 PR 10980
8053 * options.h (class General_options): Add --warn-shared-textrel.
8054 * layout.cc (Layout::finish_dynamic_section): Implement
8055 --warn-shared-textrel.
8056
6eda8c29
ILT
8057 PR 10980
8058 * options.h (class General_options): Add --warn-multiple-gp.
8059
32dcd44e
ILT
80602010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8061
8062 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
8063 $(THREADSLIB) and $(LIBDL).
8064 * Makefile.in: Rebuild.
8065
a192ba05
ILT
80662010-01-06 Ian Lance Taylor <iant@google.com>
8067
8068 PR 10980
8069 * options.cc (General_options::parse_section_start): New function.
8070 (General_options::section_start): New function.
8071 (General_options::General_options): Initialize all members.
8072 * options.h: Include <map>
8073 (class General_options): Add --section-start. Add section_starts_
8074 member.
8075 * layout.cc (Layout::attach_allocated_section_to_segment): If
8076 --section-start was used, set the address of the segment. Remove
8077 local sort_sections.
8078 (Layout::relaxation_loop_body): If the address of the load segment
8079 has been set by --section-start, don't use it.
8080 * output.h (Output_segment::update_flags_for_output_section): New
8081 function.
8082 * output.cc (Output_segment::add_output_section): Call
8083 update_flags_for_output_section.
8084
dde3f402
ILT
80852010-01-05 Ian Lance Taylor <iant@google.com>
8086
62dfdd4d
ILT
8087 PR 10980
8088 * options.h (class General_options): Add --undefined-version.
8089 * script.cc (struct Version_expression): Add was_matched_by_symbol
8090 field.
8091 (Version_script_info::matched_symbol): New function.
8092 (Version_script_info::get_symbol_version_helper): Call
8093 matched_symbol.
8094 (Version_script_info::check_unmatched_names): New function.
8095 * script.h (class Version_script_info): Update declarations.
8096 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
8097
9c4ae156
ILT
8098 * options.h (class General_options): Use DEFINE_bool_alias for
8099 allow_multiple_definition.
8100 * resolve.cc (Symbol_table::should_override): Don't test
8101 allow_multiple_definition.
8102
dde3f402
ILT
8103 PR 10980
8104 * options.h (class General_options): Add --cref.
8105 * main.cc (main): Print cref table if --cref. Don't close mapfile
8106 until after printing cref table.
8107 * cref.cc: Include "symtab.h".
8108 (class Cref_inputs): Define Cref_table_compare and Cref_table.
8109 (Cref_table_compare::operator()): New function.
8110 (Cref_inputs::gather_cref): New function.
8111 (filecol): New static const.
8112 (Cref_inputs::print_cref): New function.
8113 (Cref::print_cref): New function.
8114 * cref.h: Include <cstdio>.
8115 (class Cref): Update declarations.
8116 * mapfile.h (Mapfile::file): New function.
8117 * object.h (class Object): Define Symbols. Declare virtual
8118 do_get_global_symbols.
8119 (Object::get_global_symbols): New function.
8120 * object.cc (Input_objects::add_object): Pass object to cref_ if
8121 --cref.
8122 (Input_objects::archive_start): Likewise.
8123 (Input_objects::archive_stop): Likewise.
8124 (Input_objects::print_cref): New function.
8125 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
8126 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
8127 --cref.
8128 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
8129 function.
8130 * plugin.h (class Sized_pluginobj): Update declarations.
8131
8781f709
ILT
81322010-01-05 Ian Lance Taylor <iant@google.com>
8133
8134 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
8135 to is_default_version. Rename insdef to insdefault.
8136 (Symbol_table::add_from_relobj): Rename def to is_default_version
8137 and local to is_forced_local.
8138 (Symbol_table::add_from_pluginobj): Likewise.
8139 (Symbol_table::add_from_dynobj): Likewise.
8140 (Symbol_table::define_special_symbol): Rename insdef to
8141 insdefault.
8142
fe35d28d
ILT
81432010-01-04 Ian Lance Taylor <iant@google.com>
8144
30bc8c46
ILT
8145 PR 10980
8146 * options.h (class General_options): Add
8147 --allow-multiple-definition and -z muldefs.
8148 * resolve.cc (Symbol_table::should_override): Don't warn about a
8149 multiple symbol definition if --allow-multiple-definition or -z
8150 muldefs.
8151
7eaea549
ILT
8152 PR 10980
8153 * options.h (class General_options): Add --add-needed and
8154 --copy-dt-needed-entries. Tweak --as-needed help entry.
8155 * object.cc (Input_objects::check_dynamic_dependencies): Give an
8156 error if --copy-dt-needed-entries aka --add-needed is used and
8157 would cause a change in behaviour.
8158
fe35d28d
ILT
8159 PR 10980
8160 * options.h (class General_options): Add -G as a short version of
8161 --shared. Add no-op options -assert, -g, and -i.
8162
55a2bb35
ST
81632010-01-04 Sriraman Tallam <tmsriram@google.com>
8164
8165 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
8166 check for .text or .gnu.linkonce.t sections.
8167 * icf.cc (Icf::find_identical_sections): Ditto.
8168 Change the detection for mangled function name within the section
8169 name.
8170 * icf.h (is_section_foldable_candidate): New function.
8171
719328e1
ILT
81722009-12-30 Ian Lance Taylor <iant@google.com>
8173
8174 PR 10980
8175 * options.h (class General_options): Permit two dashes with
8176 --retain-symbols-file.
8177
d7bb5745
ILT
81782009-12-30 Ian Lance Taylor <iant@google.com>
8179
403a15dd
ILT
8180 PR 10979
8181 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
8182 don't put the file header and segment headers in the text
8183 segment.
8184
eda294df
ILT
8185 PR 10979
8186 * common.cc (Sort_commons::operator()): Stabilize sort when both
8187 entries are NULL.
8188 (Symbol_table::do_allocate_commons_list): When allocating common
8189 symbols, skip a symbol which is no longer common.
8190 * symtab.h (Symbol::is_common): Test whether the symbol comes from
8191 an object before checking its type.
8192 * testsuite/common_test_2.c: New file.
8193 * testsuite/common_test_3.c: New file.
8194 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
8195 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
8196 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
8197 (common_test_2_pic.o, common_test_2.so): New targets.
8198 (common_test_3_pic.o, common_test_3.so): New targets.
8199 * testsuite/Makefile.in: Rebuild.
8200
d7bb5745
ILT
8201 PR 10979
8202 * script.cc (read_input_script): If we see a new SECTIONS clause,
8203 and we have added an input section, give an error.
8204 * layout.h (class Layout): Add have_added_input_section function.
8205 Add have_added_input_section_ field.
8206 * layout.cc (Layout::Layout): Initialize
8207 have_added_input_section_.
8208 (Layout::layout): Set have_added_input_section_.
8209 (Layout::layout_eh_frame): Likewise.
8210
fc59c572
ILT
82112009-12-30 Ian Lance Taylor <iant@google.com>
8212
8213 PR 10931
8214 * options.h (class General_options): Add --sort-common option.
8215 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
8216 * common.cc (Sort_common): Add sort_order parameter to
8217 constructor. Add sort_order_ field.
8218 (Sort_commons::operator): Check sort_order_.
8219 (Symbol_table::allocate_commons): Determine the sort order.
8220 (Symbol_table::do_allocate_commons): Add sort_order parameter.
8221 Change all callers.
8222 (Symbol_table::do_allocate_commons_list): Likewise.
8223
1c74fab0
ILT
82242009-12-30 Ian Lance Taylor <iant@google.com>
8225
8226 PR 10916
8227 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
8228 symbols from this object, don't change the visibility of an
8229 undefined symbol.
8230 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
8231
6affe781
ILT
82322009-12-30 Ian Lance Taylor <iant@google.com>
8233
8234 PR 10861
8235 * script.h (class Version_script_info): Define Language enum.
8236 Update declarations. Define Glob, Exact, and Lookup types. Add
8237 new fields globals_, locals_, and is_finalized_.
8238 * script.cc: Various formatting fixes.
8239 (class Parser_closure): Change language_stack_ from a vector of
8240 std::string to one of Version_script_info::Language. Adjust all
8241 uses accordingly.
8242 (class Lazy_demangler): Remove.
8243 (struct Version_expression): Change language from std::string to
8244 Version_script_info::Language.
8245 (Version_script_info::Version_script_info): New function.
8246 (Version_script_info::~Version_script_info): Don't call clear.
8247 (Version_script_info::finalize): New function.
8248 (Version_script_info::build_lookup_tables): New function.
8249 (Version_script_info::build_expression_list_lookup): New
8250 function.
8251 (Version_script_info::get_symbol_version_helper): Rewrite to use
8252 lookup tables.
8253 (Version_script_info::print_expression_list): Adjust to use
8254 Version_script_info::Language.
8255 (script_push_lex_into_version_mode): Check that the version script
8256 has not been finalized.
8257 (version_script_push_lang): Change language string to
8258 Version_script_info::Language.
8259 * options.cc (Command_line::version_script): New function.
8260 * options.h (class General_options): Add finalize_dynamic_list
8261 function. Change version_script from declaration to definition.
8262 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
8263 * testsuite/version_script.map: Remove duplicate def of foo.
8264 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
8265 version_script.map.
8266 * testsuite/Makefile.in: Rebuild.
8267
818bf354
ILT
82682009-12-30 Ian Lance Taylor <iant@google.com>
8269
8270 PR 10843
8271 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
8272 if the input symbol index is 0, make the output symbol index 0.
8273
ebcc8304
ILT
82742009-12-30 Ian Lance Taylor <iant@google.com>
8275
8276 PR 10670
8277 * options.h (class General_options): Add -x/--discard-all.
8278 * object.cc (Sized_relobj::do_count_local_symbols): Handle
8279 --discard-all. If the local symbol needs a dynamic entry, check
8280 that before handling --discard-locals.
8281
176fe33f
ILT
82822009-12-30 Ian Lance Taylor <iant@google.com>
8283
bb321bb1
ILT
8284 PR 10450
8285 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
8286 flags to PF_R.
8287 (Output_segment::add_output_section): Don't change the flags if
8288 the type is PT_TLS.
8289
176fe33f
ILT
8290 PR 10450
8291 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
8292 GNU hash table if they need a dynamic value. Otherwise, don't add
8293 them if they are defined in a dynamic object or are forced local.
8294
e8cd95c7
ILT
82952009-12-29 Ian Lance Taylor <iant@google.com>
8296
1b81fb71
ILT
8297 PR 10450
8298 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
8299 .gnu.hash table for a 32-bit target.
8300
8d6d383d
ILT
8301 PR 10450
8302 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
8303 regular and a dynamic object only needs a dynamic symbol table
8304 entry if it is externally visible.
8305
e785ec03
ILT
8306 PR 10450
8307 * i386.cc (class Target_i386): Initialize global_offset_table_ in
8308 constructor. Add global_offset_table_ field.
8309 (Target_i386::got_section): Set global_offset_table_.
8310 (Target_i386::do_finalize_sections): Set global_offset_table_
8311 size.
8312 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
8313 in constructor. Add global_offset_table_ field.
8314 (Target_x86_64::got_section): Set global_offset_table_.
8315 (Target_x86_64::do_finalize_sections): Set global_offset_table_
8316 size.
8317
1a2dff53
ILT
8318 * layout.cc (Layout::Layout): Initialize increase_relro_.
8319 (Layout::get_output_section): Add is_relro, is_last_relro, and
8320 is_first_non_relro parameters. Change all callers.
8321 (Layout::choose_output_section): Likewise.
8322 (Layout::add_output_section_data): Likewise.
8323 (Layout::make_output_section): Likewise.
8324 (Layout::set_segment_offsets): Clear increase_relro when using a
8325 linker script.
8326 * layout.h (class Layout): Add increase_relro method. Add
8327 increase_relro_ field. Update declarations.
8328 * output.cc (Output_section::Output_section): Initialize
8329 is_last_relro_ and is_first_non_relro_.
8330 (Output_segment::add_output_section): Group relro sections is
8331 do_sort is true. Handle is_last_relro and is_first_non_relro.
8332 (Output_segment::maximum_alignment): Remove relro handling.
8333 (Output_segment::set_section_addresses): Add increase_relro
8334 parameter. Change all callers. Add initial alignment to align
8335 relro sections on separate page. Remove old relro handling.
8336 (Output_segment::set_section_list_addresses): Remove in_relro
8337 parameter. Change all callers.
8338 (Output_segment::set_offset): Add increase parameter. Change all
8339 callers. Remove old relro handling.
8340 * output.h (class Output_section): Add new methods: is_last_relro,
8341 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
8342 Add is_last_relro_ and is_first_non_relro_ fields.
8343 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
8344 Create separate .got.plt section. Call increase_relro.
8345 * x86_64.cc (Target_x86_64::got_section): Likewise.
8346 * testsuite/relro_script_test.t: Add .got.plt.
8347
f0ba79e2
ILT
8348 PR 10450
8349 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
8350 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
8351 (Layout::finalize): Call set_dynamic_symbol_size.
8352 (Layout::set_dynamic_symbol_size): New function.
8353 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
8354 set_dynamic_symbol_size.
8355
e8cd95c7
ILT
8356 PR 10450
8357 * output.h (class Output_section): Add is_entsize_zero_ field.
8358 * output.cc (Output_section::Output_section): Initialize
8359 is_entsize_zero_.
8360 (Output_section::set_entsize): If two different entsizes are
8361 requested, force it to zero.
8362 (Output_section::add_input_section): Set flags for .debug_str
8363 before updating section flags. Set entsize.
8364 (Output_section::update_flags_for_input_section): Set SHF_MERGE
8365 and SHF_STRING if all input sections have those flags.
8366
3e1b9a8a
RÁE
83672009-12-29 Rafael Espindola <espindola@google.com>
8368
8369 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
8370 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
8371 reporting.
3e1b9a8a 8372
3dcad376
ST
83732009-12-29 Sriraman Tallam <tmsriram@google.com>
8374
8375 * options.cc (General_options::parse_version): Allow -v to exit
8376 without an error if there is nothing to link.
8377
084e2665
ILT
83782009-12-29 Ian Lance Taylor <iant@google.com>
8379
8380 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
8381 using a version of gcc before 4.1.
8382 * configure: Rebuild.
8383
250acde3
CD
83842009-12-28 Chris Demetriou <cgd@google.com>
8385
8386 * attributes.cc (Output_attributes_section_data::do_write): Use
8387 std::vector::front rather than std::vector::data.
8388
99fff23b
ILT
83892009-12-28 Ian Lance Taylor <iant@google.com>
8390
8391 * symtab.h (class Symbol_table): Add enum Defined.
8392 * resolve.cc (Symbol_table::should_override): Add defined
8393 parameter. Change all callers. Test whether object is NULL
8394 before calling a method on it.
8395 (Symbol_table::report_resolve_problem): Add defined parameter.
8396 Change all callers.
8397 (Symbol_table::should_override_with_special): Likewise.
8398 * symtab.cc (Symbol_table::define_in_output_data): Add defined
8399 parameter. Change all callers.
8400 (Symbol_table::do_define_in_output_data): Likewise.
8401 (Symbol_table::define_in_output_segment): Likewise.
8402 (Symbol_table::do_define_in_output_segment): Likewise.
8403 (Symbol_table::define_as_constant): Likewise.
8404 (Symbol_table::do_define_as_constant): Likewise.
8405 * script.h (class Symbol_assignment): Add is_defsym parameter to
8406 constructor; change all callers.
8407 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
8408 parameter. Change all callers. Add is_defsym_ field.
8409 (class Parser_closure): Add parsing_defsym parameter to
8410 constructor; change all callers. Add parsing_defsym accessor
8411 function. Add parsing_defsym_ field.
8412
556bd683
ILT
84132009-12-28 Ian Lance Taylor <iant@google.com>
8414
8415 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 8416 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 8417
1782c879
ILT
84182009-12-23 Ian Lance Taylor <iant@google.com>
8419
8420 * i386.cc (Target_i386::do_calls_non_split): Recognize
8421 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
8422 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
8423 -fsplit-stack prologue when using %r11.
1782c879 8424
329ca2b1
ST
84252009-12-21 Sriraman Tallam <tmsriram@google.com>
8426
8427 * options.cc (General_options::parse_version): Make -v continue and do
8428 the link like GNU ld does.
8429
d675ff46
RÁE
84302009-12-17 Rafael Avila de Espindola <espindola@google.com>
8431
8432 * Makefile.am (CCFILES): Add timer.cc.
8433 (HFILES): Add timer.h.
8434 * configure.ac: Check for sysconf and times.
8435 * main.cc: include timer.h.
8436 (main): Use Timer instead of get_run_time.
8437 * timer.cc: New.
8438 * timer.h: New.
8439 * workqueue.cc: include timer.h.
8440 (Workqueue::find_and_run_task):
8441 Report user, sys and wall time.
8442 * Makefile.in: Regenerate.
8443 * config.in: Regenerate.
8444 * configure: Regenerate.
8445
d6344fb5
DK
84462009-12-16 Doug Kwan <dougkwan@google.com>
8447
8448 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
8449 sections.
8450 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
8451 relaxed input sections.
8452 * output.cc (Output_section::find_relaxed_input_section): Change
8453 return type to Output_relaxed_input_section pointer. Adjust code
8454 for new type of relaxed_input_section_map_.
8455 * output.h (Output_section::find_relaxed_input_section): Change
8456 return type to Output_relaxed_input_section pointer.
8457 (Output_section::Output_relaxed_input_section_by_input_section_map):
8458 New type.
8459 (Output_section::relaxed_input_section_map_): Change type to
8460 Output_section::Output_relaxed_input_section_by_input_section_map.
8461 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
8462 input section.
8463
0e0d5469
ILT
84642009-12-15 Ian Lance Taylor <iant@google.com>
8465
8466 * layout.cc (Layout::create_shstrtab): Only write out after input
8467 sections if we are compressing debug sections.
8468
0649a889
ILT
84692009-12-15 Ian Lance Taylor <iant@google.com>
8470
8471 * archive.cc (Archive::add_symbols): Only look up a symbol without
8472 a version if there is, in fact, a version.
8473
2ea97941
ILT
84742009-12-14 Ian Lance Taylor <iant@google.com>
8475
8476 Revert -Wshadow changes, all changes from:
8477 2009-12-11 Doug Kwan <dougkwan@google.com>
8478 2009-12-11 Nick Clifton <nickc@redhat.com>
8479 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
8480
b0eec2cc
DK
84812009-12-11 Doug Kwan <dougkwan@google.com>
8482
8483 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
8484 due to -Wshadow.
8485 * attributes.cc (Object_attribute::size): Ditto.
8486 (Attributes_section_data::size): Ditto.
8487 (Attributes_section_data::Attributes_section_data): Ditto.
8488 (Output_attributes_section_data::do_write): Ditto.
8489 * attributes.h (Object_attribute::set_type): Ditto.
8490 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
8491
91d6fa6a
NC
84922009-12-11 Nick Clifton <nickc@redhat.com>
8493
8494 * archive.cc: Fix shadowed variable warnings.
8495 * arm.cc: Likewise.
8496 * compressed_output.cc: Likewise.
8497 * compressed_output.h: Likewise.
8498 * configure: Likewise.
8499 * dwarf_reader.cc: Likewise.
8500 * dynobj.cc: Likewise.
8501 * dynobj.h: Likewise.
8502 * ehframe.cc: Likewise.
8503 * ehframe.h: Likewise.
8504 * errors.cc: Likewise.
8505 * expression.cc: Likewise.
8506 * fileread.cc: Likewise.
8507 * fileread.h: Likewise.
8508 * freebsd.h: Likewise.
8509 * i386.cc: Likewise.
8510 * icf.cc: Likewise.
8511 * incremental.h: Likewise.
8512 * layout.cc: Likewise.
8513 * layout.h: Likewise.
8514 * mapfile.cc: Likewise.
8515 * merge.cc: Likewise.
8516 * merge.h: Likewise.
8517 * object.cc: Likewise.
8518 * object.h: Likewise.
8519 * options.h: Likewise.
8520 * output.cc: Likewise.
8521 * output.h: Likewise.
8522 * parameters.cc: Likewise.
8523 * plugin.cc: Likewise.
8524 * powerpc.cc: Likewise.
8525 * reduced_debug_output.cc: Likewise.
8526 * reduced_debug_output.h: Likewise.
8527 * reloc.cc: Likewise.
8528 * reloc.h: Likewise.
8529 * resolve.cc: Likewise.
8530 * script-sections.cc: Likewise.
8531 * script.cc: Likewise.
8532 * script.h: Likewise.
8533 * sparc.cc: Likewise.
8534 * symtab.cc: Likewise.
8535 * symtab.h: Likewise.
8536 * target-select.cc: Likewise.
8537 * target-select.h: Likewise.
8538 * token.h: Likewise.
8539 * workqueue.cc: Likewise.
8540 * workqueue.h: Likewise.
8541 * x86_64.cc: Likewise.
8542
a0351a69
DK
85432009-12-10 Doug Kwan <dougkwan@google.com>
8544
8545 * arm.cc (attributes.h): New include.
8546 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
8547 (Arm_relobj::~Arm_relobj): Delete object pointed by
8548 attributes_section_data_.
8549 (Arm_relobj::attributes_section_data): New method definition.
8550 (Arm_relobj::attributes_section_data_): New data member declaration.
8551 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
8552 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
8553 attributes_section_data_.
8554 (Arm_dynobj::attributes_section_data): New method definition.
8555 (Arm_dynobj::attributes_section_data_): New data member declaration.
8556 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
8557 initialization value of may_use_blx_ to false.
2e702c99 8558 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
8559 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
8560 object attributes to compute results instead of hard-coding.
8561 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
8562 Target_arm::get_secondary_compatible_arch,
8563 Target_arm::set_secondary_compatible_arch
8564 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
8565 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
8566 New method declarations.
8567 (Target_arm::get_aeabi_object_attribute): New method definition.
8568 (Target_arm::attributes_section_data_): New data member declaration.
8569 (read_arm_attributes_section): New template definition.
8570 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
8571 (Arm_dynobj::do_read_symbols): Ditto.
8572 (Target_arm::do_finalize_sections): Merge attributes sections from
8573 input. Check for BLX use after attributes section merging.
8574 Fix __exidx_start and __exidx_end visibility. Create an
8575 .ARM.attributes section if necessary.
8576 (Target_arm::get_secondary_compatible_arch,
8577 Target_arm::set_secondary_compatible_arch,
8578 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
8579 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 8580 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
8581 New method definitions.
8582
b59befec
ILT
85832009-12-09 Ian Lance Taylor <iant@google.com>
8584
8585 * plugin.cc (Plugin::load): Don't cast from void* to a function
8586 pointer.
8587
1276bc89
ILT
85882009-12-09 Ian Lance Taylor <iant@google.com>
8589
8590 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
8591 information fields.
8592
2f2de248
L
85932009-12-09 H.J. Lu <hongjiu.lu@intel.com>
8594
8595 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
8596 Replace two_file_shared_1.so with two_file_shared_2.so.
8597 * testsuite/Makefile.in: Regenerated.
8598
4f787271
DK
85992009-12-08 Doug Kwan <dougkwan@google.com>
8600
8601 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
8602 (HFILES): Add attributes.h and int_encoding.h.
8603 * Makefile.in: Regenerate.
8604 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
8605 function definitions to int_encoding.cc
8606 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
8607 prototypes to int_encoding.h
8608 * reduced_debug_output.cc (int_encoding.h): New include.
8609 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
8610 function definitions to int_encoding.cc
8611 (insert_into_vector, read_from_pointer): Move template definitions to
8612 int_encoding.h
8613 * attributes.cc: New file.
8614 * attributes.h: New file.
8615 * int_encoding.cc: New file.
8616 * int_encoding.h: New file.
8617
20b52f1a
RÁE
86182009-12-07 Rafael Avila de Espindola <espindola@google.com>
8619
8620 PR gold/11055
8621 * incremental-dump.cc (dump_incremental_inputs): New.
8622 (main): Use dump_incremental_inputs.
8623
53d7974c
L
86242009-12-07 H.J. Lu <hongjiu.lu@intel.com>
8625
8626 PR gold/10893
8627 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
8628 checking elfcpp::STT_FUNC.
8629 (Target_i386::Relocate::relocate): Likewise.
8630 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
8631
8632 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
8633 symbols from shared libraries into normal FUNC symbols.
8634
8635 * symtab.h (Symbol): Add is_func and use it.
8636
05a352e6
DK
86372009-12-05 Doug Kwan <dougkwan@google.com>
8638
8639 * arm.cc (Target_arm::arm_info): Initialize new fields
8640 attributes_section and attributes_vendor.
8641 * i386.cc (Target_i386::i386_info): Same.
8642 * object.cc (Sized_relobj::do_layout): Skip attribute section.
8643 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
8644 fields attributes_section and attributes_vendor.
53d7974c 8645 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
8646 * target.h (Target::attributes_section, Target::attributes_vendor,
8647 Target::is_attributes_section, Target::attribute_arg_type,
8648 Target::attributes_order): New method definitions.
8649 (Target::Target_info::attributes_section,
8650 Target::Target_info::attributes_vendor): New fields.
8651 (Target::do_attribute_arg_type, Target::do_attributes_order): New
8652 virtual method definitions.
8653 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
8654 attributes_section and attributes_vendor.
8655 * testsuite/testfile.cc (Target_test::test_target_info): Same.
8656
f4e5969c
DK
86572009-12-05 Doug Kwan <dougkwan@google.com>
8658
8659 * arm.cc: Update comments about interworking and stub generation.
8660 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
8661 considered as non-PIC.
8662 (Arm_relocate_functions::base_abs): Fix formatting.
8663 (Arm_relocate_functions::got_prel): Fix comment. Change interface
8664 of function to use GOT entry address instead of offset.
8665 (Target_arm::Scan::global): Issue an error if a symbol would need a
8666 PLT does not get one because it is untyped. Remove code to create
8667 dynamic symbols for relative branches.
8668 (Target_arm::Relocate::relocate: Use 0 instead of false since function
8669 takes unsigned integer instead of boolean.
8670
1abce4a6
L
86712009-12-05 H.J. Lu <hongjiu.lu@intel.com>
8672
8673 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
8674 (two_file_test_LDADD): Likewise.
8675 (common_test_1_LDADD): Likewise.
8676 (exception_test_LDADD) Likewise.
8677 (weak_test_LDADD): Likewise.
8678 (many_sections_test_LDADD): Likewise.
8679 (initpri1_LDADD): Likewise.
8680 (script_test_1_LDADD): Likewise.
8681 (script_test_2_LDADD): Likewise.
8682 (justsyms_LDADD): Likewise.
8683 (binary_test_LDADD): Likewise.
8684 (large_LDADD): Likewise.
8685 * testsuite/Makefile.in: Regenerated.
8686
adcf2816 86872009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 8688
adcf2816
L
8689 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
8690 (Symbol_table::override_with_special): Likewise.
8691 (Symbol_table::add_from_object): Likewise.
8692
28e67f5d
RÁE
86932009-12-04 Rafael Avila de Espindola <espindola@google.com>
8694
8695 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
8696 Don't set the data_offset twice.
8697
ae10a101
RÁE
86982009-12-04 Rafael Avila de Espindola <espindola@google.com>
8699
8700 * testsuite/Makefile.in: Regenerate.
8701
f59f41f3
DK
87022009-12-03 Doug Kwan <dougkwan@google.com>
8703
8704 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
8705 (Target_arm::do_finalize_sections): Add parameter for symbol table
8706 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
8707 * i386.cc (Target_i386::do_finalize_sections): Add an additional
8708 parameter for symbol table pointer.
8709 * layout.cc (Layout::finalize): Call Target::finalize_sections with
8710 an additional parameter for a pointer to symbol table.
8711 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
8712 parameter for a symbol table pointer.
8713 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
8714 * target.h (Target::finalize_sections, Target::do_finalize_sections):
8715 Ditto.
8716 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
8717 parameter for a symbol table pointer.
8718
ca55d848
RÁE
87192009-12-03 Rafael Avila de Espindola <espindola@google.com>
8720
8721 * incremental.cc (Incremental_inputs_header)
8722 (Incremental_inputs_header_write, Incremental_inputs_entry)
8723 (Incremental_inputs_entry_write): Move ...
8724 * incremental.h (Incremental_inputs_header)
8725 (Incremental_inputs_header_write, Incremental_inputs_entry)
8726 (Incremental_inputs_entry_write): here.
8727
3aec4f9c
RÁE
87282009-12-02 Rafael Avila de Espindola <espindola@google.com>
8729
8730 * incremental.cc (make_sized_incremental_binary): Set the target.
8731 Error if it is incompatible.
8732 * output.h (Output_file): Add filename method.
8733
9c0ae74d
RÁE
87342009-12-02 Rafael Avila de Espindola <espindola@google.com>
8735
8736 * incremental.cc (Incremental_inputs_entry): Remove unused argument
8737 from the get_* methods.
8738
a45500ae
RÁE
87392009-12-02 Rafael Avila de Espindola <espindola@google.com>
8740
8741 * incremental-dump.cc (main): Check that the offeset of a script is 0.
8742 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
8743 Write 0 for the data_offset of scripts.
8744
325e6408
RÁE
87452009-12-02 Rafael Avila de Espindola <espindola@google.com>
8746
8747 * testsuite/Makefile.am: Add the incremental_test.sh test.
8748 * testsuite/incremental_test.sh: New.
8749 * testsuite/incremental_test_1.c: New.
8750 * testsuite/incremental_test_2.c: New.
8751
954c3e2e
RÁE
87522009-12-01 Rafael Avila de Espindola <espindola@google.com>
8753
703d02da 8754 * incremental-dump.cc (main): Fix typos.
954c3e2e 8755
f8086623
RÁE
87562009-11-27 Rafael Avila de Espindola <espindola@google.com>
8757
8758 PR gold/11025
8759 * incremental-dump.cc (main): Use llu to print 64 bit values.
8760
3b0dd6ac
L
87612009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
8762 H.J. Lu <hongjiu.lu@intel.com>
8763
8764 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
8765 $(LIBDL).
8766 (incremental_dump_LDADD): Likewise.
8767 * Makefile.in: Regenerated.
8768
a6d1ef57 87692009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 8770
a6d1ef57
DK
8771 Revert:
8772
8773 2009-11-25 Doug Kwan <dougkwan@google.com>
8774
8775 * arm.cc (Target_arm::Target_arm): Move method definition
8776 outside of class definition. Add code to handle
8777 --target1-rel, --target1-abs and --target2= options.
8778 (Target_arm::get_reloc_reloc_type): Change method to be
8779 non-static and const.
8780 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
8781 New data member declaration.
8782 (Target_arm::Scan::local, Target_arm::Scan::global,
8783 Target_arm::Relocate::relocate,
8784 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8785 Adjust call to Target_arm::get_real_reloc_type.
8786 (Target_arm::get_real_reloc_type): Use command line options
8787 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8788 * options.h (--target1-rel, --target1-abs, --target2): New
8789 ARM-only options.
8790
50aeb7d4
DK
87912009-11-25 Doug Kwan <dougkwan@google.com>
8792
8793 * arm.cc (Target_arm::Target_arm): Move method definition outside of
8794 class definition. Add code to handle --target1-rel, --target1-abs
8795 and --target2= options.
8796 (Target_arm::get_reloc_reloc_type): Change method to be non-static
8797 and const.
8798 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
8799 member declaration.
8800 (Target_arm::Scan::local, Target_arm::Scan::global,
8801 Target_arm::Relocate::relocate,
8802 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
8803 call to Target_arm::get_real_reloc_type.
8804 (Target_arm::get_real_reloc_type): Use command line options to
8805 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8806 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
8807 options.
8808
51938283
DK
88092009-11-25 Doug Kwan <dougkwan@google.com>
8810
8811 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
8812 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
8813 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
8814 formatting.
8815 (Arm_relocate_functions::thm_call): Replace body with a call to
8816 Arm_relocate_functions::thumb_branch_common.
8817 (Arm_relocate_functions::thm_jump24,
8818 Arm_relocate_functions::thm_xpc22): New method definitions.
8819 (Arm_relocate_functions::thumb_branch_common): New method definition.
8820 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
8821 operator.
8822 (Target_arm::Relocate::relocate): Adjust call to thm_call.
8823 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
8824
e2b8f3c4
RÁE
88252009-11-24 Rafael Avila de Espindola <espindola@google.com>
8826
8827 * Makefile.am: Build incremental-dump
8828 * Makefile.in: Regenerate.
8829 * incremental-dump.cc: New.
8830 * incremental.cc (Incremental_inputs_header_data,
8831 Incremental_inputs_entry_data): Move to incremental.h
8832 * incremental.h: (Incremental_inputs_header_data,
8833 Incremental_inputs_entry_data): Move from incremental.cc
8834
bcba9aec
RÁE
88352009-11-24 Rafael Avila de Espindola <espindola@google.com>
8836
8837 * incremental.cc (Incremental_inputs_header,
8838 Incremental_inputs_header_write, Incremental_inputs_entry,
8839 Incremental_inputs_entry_write): Add a typedef with the data type.
8840
7c3afe08
RÁE
88412009-11-24 Rafael Avila de Espindola <espindola@google.com>
8842
8843 * incremental.cc (Incremental_inputs_header,
8844 Incremental_inputs_header_write, Incremental_inputs_entry,
8845 Incremental_inputs_entry_write): Update comment about which
8846 type has the filed descriptions.
8847
d204b6e9
DK
88482009-11-15 Doug Kwan <dougkwan@google.com>
8849
8850 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
8851 (Arm_relocate_functions::arm_branch_common): Change method defintion
8852 in class definition to a method declaration and update list of formal
8853 parameters.
8854 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
8855 Arm_relocation_functions::jump24): Adjust call to
8856 Arm_relocate_functions::arm_branch_common. Update list of formal
8857 parameters.
8858 (Arm_relocate_functions::xpc25): New method definition.
8859 (Arm_relocate_functions::arm_branch_common): Move method defintion
8860 out from class definition. Use stubs for mode-switching and extending
8861 branch ranges.
8862 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
8863 specially. Change code to enable use of stubs in ARM branches.
8864
43d12afe
DK
88652009-11-10 Doug Kwan <dougkwan@google.com>
8866
8867 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
8868 in method declaration.
8869 (Target_arm::relocate_stub): New method declaration.
8870 (Target_arm::default_target): Change to return a pointer instead of
8871 a const reference.
8872 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
8873 Target_arm::default_target.
8874 (Arm_Relobj::do_relocate_sections): Remove options paramater in
8875 method definition.
8876 (Target_arm::relocate_section): Adjust view.
8877 (Target_arm::relocate_stub): New method definition.
8878
ac33a407
DK
88792009-11-10 Doug Kwan <dougkwan@google.com>
8880
8881 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
8882 a format warning.
8883 * incremental.cc (open_incremental_binary): Initialized local
8884 variables to avoid warnings.
8885 * object.cc (make_elf_object): Ditto.
8886 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
8887 a format warning.
e1df38aa 8888
88ee28e9
L
8889009-11-09 H.J. Lu <hongjiu.lu@intel.com>
8890
8891 PR gold/10930
8892 * testsuite/plugin_test.c: Include "config.h".
8893
2daedcd6
DK
88942009-11-09 Doug Kwan <dougkwan@google.com>
8895
8896 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
8897 (arm_symbol_value): Remove.
8898 (Arm_relocate_functions::arm_branch_common,
8899 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
8900 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
8901 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
8902 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
8903 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
8904 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
8905 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
8906 Arm_relocate_functions::thm_mobw_abs_nc,
8907 Arm_relocate_functions::thm_mov_abs,
8908 Arm_relocate_functions::movw_prel_nc,
8909 Arm_relocate_functions::thm_movt_abs,
8910 Arm_relocate_functions::movt_prel,
8911 Arm_relocate_functions::thm_movw_prel_nc,
8912 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
8913 (Target_arm::Relocate::relocate): Only decompose address into two
8914 parts if relocation type uses the thumb-bit and pass the actual
8915 bit instead of a flag indicating that the thumb-bit is used. Adjust
8916 calls to methods in Arm_relocate_functions for this change.
8917
1276bc89 89182009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
8919
8920 PR 10925
8921 * reloc.cc: Instantiate
8922 Sized_relobj::initialize_input_to_output_maps and
8923 Sized_relobj:free_input_to_output_maps.
8924
e53ad1b5
ILT
89252009-11-06 Ian Lance Taylor <iant@google.com>
8926
8927 PR 10876
8928 * defstd.cc (in_segment): Set only_if_ref true for "end".
8929
eb44217c
DK
89302009-11-06 Doug Kwan <dougkwan@google.com>
8931
8932 * arm.cc (class Reloc_stub): Correct a comment.
8933 (Target_arm::Target_arm): Initialize arm_input_section_map_.
8934 (Target_arm::scan_section_for_stubs): New method declaration.
8935 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
8936 Change methods from private to protected.
8937 (Target_arm::do_may_relax): New method definition.
8938 (Target_arm::do_relax, Target_arm::group_sections,
8939 Target_arm::scan_reloc_for_stub,
8940 Target_arm::scan_reloc_section_for_stubs): New method declarations.
8941 (Target_arm::arm_input_section_map_): New data member declaration.
8942 (Target_arm::scan_reloc_for_stub,
8943 Target_arm::scan_reloc_section_for_stubs,
8944 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
8945 Target_arm::do_relax): New method definitions.
8946
5d329b7d
ILT
89472009-11-06 Mikolaj Zalewski <mikolaj@google.com>
8948
8949 * configure.ac: Check for (struct stat)::st_mtim
8950 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
8951 * config.in: Regenerate.
8952 * configure: Regenerate.
8953
96a0d71b
ILT
89542009-11-05 Ian Lance Taylor <iant@google.com>
8955
8956 PR 10910
8957 * output.cc (Output_segment::add_output_section): Add missing
8958 return statement.
8959
594c8e5e
ILT
89602009-11-04 Ian Lance Taylor <iant@google.com>
8961
8962 PR 10880
8963 * object.h (class Object): Add is_needed and set_is_needed
8964 methods. Add is_needed_ field. Make bool fields into bitfields.
8965 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
8966 defined in a dynamic object and referenced by a regular object,
8967 set is_needed for the dynamic object.
8968 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
8969 if the file is marked with as_needed and it is not needed.
8970
22b127cc
ILT
89712009-11-04 Ian Lance Taylor <iant@google.com>
8972
8973 PR 10887
8974 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
8975 tags if data is discarded by linker script.
8976 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8977 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
8978 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
8979 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8980
f5c870d2
ILT
89812009-11-04 Ian Lance Taylor <iant@google.com>
8982
8983 * layout.cc (Layout::get_output_section): Add is_interp and
8984 is_dynamic_linker_section parameters. Change all callers.
8985 (Layout::choose_output_section): Likewise.
8986 (Layout::make_output_section): Likewise.
8987 (Layout::add_output_section_data): Add is_dynamic_linker_section
8988 parameter. Change all callers.
8989 * layout.h (class Layout): Update declarations.
8990 * output.h (class Output_section): Add is_interp, set_is_interp,
8991 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
8992 Add is_interp_, is_dynamic_linker_section_ fields. Change
8993 generate_code_fills_at_write_ to a bitfield.
8994 * output.cc (Output_section::Output_sections): Initialize new
8995 fields.
8996 (Output_segment::add_output_section): Add do_sort parameter.
8997 Change all callers.
8998
1ae4d23b
ILT
89992009-11-03 Ian Lance Taylor <iant@google.com>
9000
9001 PR 10860
9002 * options.h (class General_options): Add --warn-common.
9003 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
9004 merging two common symbols.
9005 (Symbol_table::should_override): Handle --warn-common when merging
9006 a common symbol with a defined symbol. Use report_resolve_problem
9007 for multiple definitions.
9008 (Symbol_table::report_resolve_problem): New function.
9009 * symtab.h (class Symbol_table): Declare report_resolve_problem.
9010
55da9579
DK
90112009-11-03 Doug Kwan <dougkwan@google.com>
9012
9013 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
9014 stub_factory_.
9015 (Target_arm::stub_factory): New method definition.
9016 (Target_arm::new_arm_input_section,
9017 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
9018 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 9019 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
9020 New type definitions.
9021 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
9022 member declarations.
9023 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
9024 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
9025 New method definitions.
9026
37a9ac43
ILT
90272009-11-03 Ian Lance Taylor <iant@google.com>
9028
9029 * options.h (class General_options): Add --warn_constructors.
9030
b3d6a3d4
ILT
90312009-11-03 Ian Lance Taylor <iant@google.com>
9032
9033 PR 10893
9034 * defstd.cc (in_section): Add entries for __rel_iplt_start,
9035 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
9036
934b01dd
ILT
90372009-11-03 Ian Lance Taylor <iant@google.com>
9038
9039 PR 10895
9040 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
9041 --msgid-bugs-address.
9042 (install-pdf): New target.
9043 (install-data_yes): Look up one directory to find mkinstalldirs.
9044
03c1939b
L
90452009-11-03 H.J. Lu <hongjiu.lu@intel.com>
9046
9047 * po/Make-in (.po.gmo): Don't generate .gmo files in source
9048 tree.
9049
ebd95253
DK
90502009-10-30 Doug Kwan <dougkwan@google.com>
9051
9052 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
9053
e9bbb538
DK
90542009-10-30 Doug Kwan <dougkwan@google.com>
9055
9056 * arm.cc (Stub_addend_reader): New struct template definition
9057 and partial specializations.
9058 (Stub_addend_reader::operator()): New method definition for a
9059 partially specialized template.
9060
d5b40221
DK
90612009-10-30 Doug Kwan <dougkwan@google.com>
9062
9063 * arm.cc (Arm_relobj::processor_specific_flags): New method
9064 definition.
9065 (Arm_relobj::do_read_symbols): New method declaration.
9066 (Arm_relobj::processor_specific_flags_): New data member declaration.
9067 (Arm_dynobj): New class definition.
9068 (Target_arm::do_finalize_sections): Add input_objects parameter.
9069 (Target_arm::do_adjust_elf_header): New method declaration.
9070 (Target_arm::are_eabi_versions_compatible,
9071 (Target_arm::merge_processor_specific_flags): New method declaration.
9072 (Target_arm::do_make_elf_object): New overloaded method definitions
9073 and declaration.
9074 (Arm_relobj::do_read_symbols): New method definition.
9075 (Arm_dynobj::do_read_symbols): Ditto.
9076 (Target_arm::do_finalize_sections): Add input_objects parameters.
9077 Merge processor-specific flags from all input objects.
9078 (Target_arm::are_eabi_versions_compatible,
9079 Target_arm::merge_processor_specific_flags,
9080 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
9081 New method definitions.
9082 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
9083 Input_objects pointer type parameter.
9084 * layout.cc (Layout::finalize): Pass input objects to target's.
9085 finalize_sections function.
9086 * output.cc (Output_file_header::do_sized_write): Set ELF file
9087 header's processor-specific flags.
9088 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
9089 Input_objects pointer type parameter.
9090 * sparc.cc (Target_sparc::do_finalize_sections): Same.
9091 * target.h (Input_objects): New forward class declaration.
9092 (Target::processor_specific_flags,
9093 Target::are_processor_specific_flags_sect): New method definitions.
9094 (Target::finalize_sections): Add input_objects parameter.
9095 (Target::Target): Initialize processor_specific_flags_ and
9096 are_processor_specific_flags_set_.
9097 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
9098 parameter.
9099 (Target::set_processor_specific_flags): New method definition.
9100 (Target::processor_specific_flags_,
9101 Target::are_processor_specific_flags_set_): New data member
9102 declarations.
9103 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
9104 Input_objects pointer type parameter.
9105
ebabffbd
DK
91062009-10-30 Doug Kwan <dougkwan@google.com>
9107
9108 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
9109
ad0f2072
ILT
91102009-10-28 Ian Lance Taylor <iant@google.com>
9111
9112 * object.h (class Relobj): Drop options parameter from
9113 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
9114 do_scan_relocs, do_relocate. Change all callers.
9115 (class Sized_relobj): Drop options parameters from
9116 do_gc_process_relocs, do_scan_relocs, do_relocate,
9117 do_relocate_sections, relocate_sections, emit_relocs_scan,
9118 emit_relocs_scan_reltype. Change all callers.
9119 (struct Relocate_info): Remove options field and all references to
9120 it.
9121 * reloc.h (class Read_relocs): Remove options constructor
9122 parameter and options_ field. Change all callers.
9123 (class Gc_process_relocs, class Scan_relocs): Likewise.
9124 (class Relocate_task): Likewise.
9125 * target-reloc.h (scan_relocs): Remove options parameter. Change
9126 all callers.
9127 (scan_relocatable_relocs): Likewise.
9128 * target.h (class Sized_target): Remove options parameter from
9129 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
9130 all callers.
9131 * gc.h (gc_process_relocs): Remove options parameter. Change all
9132 callers.
9133 * arm.cc: Update functions to remove options parameters.
9134 * i386.cc: Likewise.
9135 * powerpc.cc: Likewise.
9136 * sparc.cc: Likewise.
9137 * x86_64.cc: Likewise.
9138 * testsuite/testfile.cc: Likewise.
9139
8ffa3667
DK
91402009-10-28 Doug Kwan <dougkwan@google.com>
9141
9142 * arm.cc (Arm_relobj): New class definition.
e1df38aa 9143 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
9144 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
9145 New method definitions.
9146
40f36857
CC
91472009-10-28 Cary Coutant <ccoutant@google.com>
9148
9149 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
9150 (Plugin::cleanup_done_): New member.
9151 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
9152 (Plugin_manager::cleanup_done_): Remove.
9153 (Plugin_manager::add_input_file): Edit error message.
9154 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
9155 (Plugin_manager::cleanup): Remove use of cleanup_done_.
9156
2c849493
ILT
91572009-10-27 Mikolaj Zalewski <mikolajz@google.com>
9158
9159 * fileread.cc: (File_read::View::~View): Use the new
9160 data_ownership_ filed.
9161 (File_read::~File_read): Dispose the new whole_file_view_.
9162 (File_read::open): Mmap the whole file if needed.
9163 (File_read::open): Use whole_file_view_ instead of contents_.
9164 (File_read::find_view): Use whole_file_view_ if applicable.
9165 (File_read::do_read): Use whole_file_view_ instead of contents_.
9166 (File_read::make_view): Use whole_file_view_ instead of contents_,
9167 update File_read::View::View call.
9168 (File_read::find_or_make_view): Update File_read::View::View
9169 call.
9170 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
9171 remove contents_
9172 (File_read::View::Data_ownership): New enum.
9173 (File_read::View::View): Replace bool mapped_ with Data_ownership
9174 argument.
9175 (File_read::View::mapped_): Remove (replaced by data_ownership_).
9176 (File_read::View::data_ownership_): New field.
9177 (File_read::contents_): Remove (replaced by whole_file_view_).
9178 (File_read::whole_file_view_): New field.
9179 * options.h (class General_options): Add --keep-files-mapped.
9180
24998053
CC
91812009-10-27 Cary Coutant <ccoutant@google.com>
9182
9183 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
9184 * testsuite/Makefile.am (plugin_test_5): New test case.
9185 * testsuite/Makefile.in: Regenerate.
9186
72adc4fa
DK
91872009-10-25 Doug Kwan <dougkwan@google.com>
9188
9189 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
9190 from private to protected to allow access by child class.
9191 (Sized_relobj::do_relocate_sections): New method declaration.
9192 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 9193 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
9194 Sized_relobj::relocate_sections. Instantiate template explicitly
9195 for different target sizes and endianity.
9196
07f508a2
DK
91972009-10-24 Doug Kwan <dougkwan@google.com>
9198
9199 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
9200 (Arm_input_section::as_arm_input_section): New method.
9201 (Arm_output_section): New class definition.
9202 (Arm_output_section::create_stub_group,
9203 Arm_output_section::group_sections): New method definitions.
9204
10ad9fe5
DK
92052009-10-22 Doug Kwan <dougkwan@google.com>
9206
9207 * arm.cc (Arm_input_section): New class definition.
9208 (Arm_input_section::init, Arm_input_section:do_write,
9209 Arm_input_section::set_final_data_size,
9210 Arm_input_section::do_reset_address_and_file_offset): New method
9211 definitions.
9212
56ee5e00
DK
92132009-10-21 Doug Kwan <dougkwan@google.com>
9214
9215 * arm.cc (Stub_table, Arm_input_section): New forward class
9216 declarations.
9217 (Stub_table): New class defintion.
9218 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
9219 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
9220 New method definition.
9221
b569affa
DK
92222009-10-21 Doug Kwan <dougkwan@google.com>
9223
9224 * arm.cc: Update copyright comments.
9225 (Target_arm): New forward class template declaration.
9226 (Arm_address): New type.
9227 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
9228 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
9229 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
9230 constants.
9231 (Insn_template): Same.
9232 (DEF_STUBS): New macro.
9233 (Stub_type): New enum type.
9234 (Stub_template): New class definition.
9235 (Stub): Same.
9236 (Reloc_stub): Same.
9237 (Stub_factory): Same.
9238 (Target_arm::Target_arm): Initialize may_use_blx_ and
9239 should_force_pic_veneer_.
9240 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
9241 Target_arm::should_force_pic_veneer,
9242 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
9243 Target_arm::using_thumb_only, Target_arm:;default_target): New
9244 method defintions.
9245 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
9246 New data member declarations.
9247 (Insn_template::size, Insn_template::alignment): New method defintions.
9248 (Stub_template::Stub_template): New method definition.
9249 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
9250 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
9251 (Stub_factory::Stub_factory): New method definition.
9252 * gold.h (string_hash): New template.
9253 * output.h (Input_section_specifier::hash_value): Use
9254 gold::string_hash.
9255 (Input_section_specifier::string_hash): Remove.
9256 * stringpool.cc (Stringpool_template::string_hash): Use
9257 gold::string_hash.
9258
6c172549
DK
92592009-10-20 Doug Kwan <dougkwan@google.com>
9260
9261 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
9262 symbols of relaxed input sections.
9263 * output.h (Output_section::find_relaxed_input_section): Make
9264 method public.
9265
c5617f2f
DK
92662009-10-16 Doug Kwan <dougkwan@google.com>
9267
9268 * dynobj.cc (Versions::Versions): Initialize version_script_.
9269 Only insert base version symbol definition for a shared object
9270 if version script defines any version versions.
9271 (Versions::define_base_version): New method definition.
9272 (Versions::add_def): Check that base version is not needed.
9273 (Versions::add_need): Define base version lazily.
9274 * dynobj.h (Versions::define_base_version): New method declaration.
9275 (Versions::needs_base_version_): New data member declaration.
9276 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
9277 (check_DATA): Add no_version_test.stdout.
9278 (libno_version_test.so, no_version_test.o no_version_test.stdout):
9279 New make rules.
9280 * testsuite/Makefile.in: Regenerate.
9281 * testsuite/no_version_test.c: New file.
9282 * testsuite/no_version_test.sh: Ditto.
9283
3c12dcdb
DK
92842009-10-16 Doug Kwan <dougkwan@google.com>
9285
9286 * expression.cc (class Segment_start_expression): New class definition.
9287 (Segment_start_expression::value): New method definition.
9288 (script_exp_function_segment_start): Return a new
9289 Segment_start_expression.
9290 * gold/script-c.h (script_saw_segment_start_expression): New function
9291 prototype.
9292 * script-sections.cc (Script_sections::Script_sections): Initialize
9293 SAW_SEGMENT_START_EXPRESSION_ to false.
9294 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
9295 and -Tbbs options to specify section addresses if given in
9296 command line and no SEGMENT_START expression is seen in a script.
9297 * script-sections.h (Script_sections::saw_segment_start_expression,
9298 Script_sections::set_saw_segment_start_expression): New method
9299 definition.
9300 (Script_sections::saw_segment_start_expression_): New data member
9301 declaration.
9302 * script.cc (script_saw_segment_start_expression): New function.
9303 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
9304 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
9305 script_test_7.sh and script_test_8.sh.
9306 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
9307 script_test_8.stdout.
9308 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
9309 (script_test_6, script_test_6.stdout, script_test_7,
9310 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
9311 * Makefile.in: Regenerate.
9312 * testsuite/script_test_6.sh: New file.
9313 * testsuite/script_test_6.t: Same.
9314 * testsuite/script_test_7.sh: Same.
9315 * testsuite/script_test_7.t: Same.
9316 * testsuite/script_test_8.sh: Same.
9317
64b1ae37
DK
93182009-10-16 Doug Kwan <dougkwan@google.com>
9319
9320 * output.cc (Output_segment::set_section_list_address): Cast
9321 expressions to unsigned long long type to avoid format warnings.
9322
661be1e2
ILT
93232009-10-15 Ian Lance Taylor <iant@google.com>
9324
12edd763 9325 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 9326 dot assignment to script_sections_.
12edd763
ILT
9327 * script-sections.cc (Script_sections::add_dot_assignment):
9328 Initialize if necessary.
9329
68b6574b
ILT
9330 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
9331 program headers with no load segment if there is a linker script.
9332
661be1e2
ILT
9333 * layout.cc (Layout::set_segment_offsets): Align the file offset
9334 to the segment aligment for -N or -n with no load segment.
9335 * output.cc (Output_segment::add_output_section): Don't crash if
9336 the first section is a TLS section.
9337 (Output_segment::set_section_list_addresses): Print an error
9338 message if the address moves backward in a linker script.
9339 * script-sections.cc
9340 (Output_section_element_input::set_section_addresses): Don't
9341 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
9342 (Orphan_output_section::set_section_addresses): Likewise.
9343
f15f61a7
DK
93442009-10-15 Doug Kwan <dougkwan@google.com>
9345
9346 * layout.cc (Layout::finish_dynamic_section): Generate tags
9347 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
9348 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
9349 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
9350
82bb573a
ILT
93512009-10-14 Ian Lance Taylor <iant@google.com>
9352
9353 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
9354 fields.
9355 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
9356 data_shdr fields of relinfo.
9357 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
9358 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
9359 R_386_TLS_LDO_32, adjust based on section flags.
9360 (Target_i386::Relocate::fix_up_ldo): Remove.
9361
374ad285
ILT
93622009-10-13 Ian Lance Taylor <iant@google.com>
9363
9364 Add support for -pie.
9365 * options.h (class General_options): Add -pie and
9366 --pic-executable.
9367 (General_options::output_is_position_independent): Test -pie.
9368 (General_options::output_is_executable): Return true if not shared
9369 and not relocatable.
9370 (General_options::output_is_pie): Remove.
9371 * options.cc (General_options::finalize): Reject incompatible uses
9372 of -pie.
9373 * gold.cc (queue_middle_tasks): A -pie link is not static.
9374 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
9375 * symtab.cc (Symbol::final_value_is_known): Return false if
9376 output_is_position_independent.
9377 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
9378 output_is_position_independent.
9379 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
9380 output_is_position_independent.
9381 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
9382 output_is_position_independent.
9383 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
9384 two_file_pie_test.
9385 (basic_pie_test.o, basic_pie_test): New targets.
9386 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
9387 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
9388 (two_file_pie_test): New target.
9389 * testsuite/Makefile.in: Rebuild.
9390 * README: Remove note saying that -pie is not supported.
9391
c6585162
ILT
93922009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
9393
9394 * options.h (class General_options): Add -init and -fini.
9395 * layout.cc (Layout::finish_dynamic_section): Emit
9396 given init and fini functions.
9397
032ce4e9
ST
93982009-10-13 Sriraman Tallam <tmsriram@google.com>
9399
9400 * gc.h (gc_process_relocs): Check if icf is enabled using new
9401 function.
9402 * gold.cc (queue_initial_tasks): Likewise.
9403 (queue_middle_tasks): Likewise.
9404 * object.cc (do_layout): Likewise.
9405 * symtab.cc (is_section_folded): Likewise.
9406 * main.cc (main): Likewise.
9407 * reloc.cc (Read_relocs::run): Likewise.
9408 (Sized_relobj::do_scan_relocs): Likewise.
9409 * icf.cc (is_function_ctor_or_dtor): New function.
9410 (Icf::find_identical_sections): Check if function is ctor or dtor when
9411 safe icf is chosen.
9412 * options.h (General_options::icf): Change option to be an enum.
9413 (Icf_status): New enum.
9414 (icf_enabled): New method.
9415 (icf_safe_folding): New method.
9416 (set_icf_status): New method.
9417 (icf_status_): New variable.
9418 * (options.cc) (General_options::finalize): Set icf_status_.
9419 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
9420 icf_test and icf_keep_unique_test to use the --icf enum flag.
9421 * testsuite/icf_safe_test.sh: New file.
e1df38aa 9422 * testsuite/icf_safe_test.cc: New file.
032ce4e9 9423
f345227a
ST
94242009-10-12 Sriraman Tallam <tmsriram@google.com>
9425
9426 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
9427 includes to gc.h and icf.h.
9428 * arm.cc: Include gc.h.
9429 * gold.cc: Likewise.
9430 * i386.cc: Likewise.
9431 * powerpc.cc: Likewise.
9432 * sparc.cc: Likewise.
9433 * x86_64.cc: Likewise.
9434 * gc.h: Include icf.h.
9435
1c7814ed
ILT
94362009-10-11 Ian Lance Taylor <iant@google.com>
9437
9438 * plugin.cc: Include "gold.h" before other header files.
9439
ae3b5189
CD
94402009-10-10 Chris Demetriou <cgd@google.com>
9441
9442 * options.h (Input_file_argument::Input_file_type): New enum.
9443 (Input_file_argument::is_lib_): Replace with...
9444 (Input_file_argument::type_): New member.
9445 (Input_file_argument::Input_file_argument): Take Input_file_type
9446 'type' rather than boolean 'is_lib' as second argument.
9447 (Input_file_argument::is_lib): Use type_.
9448 (Input_file_argument::is_searched_file): New function.
9449 (Input_file_argument::may_need_search): Handle is_searched_file.
9450 * options.cc (General_options::parse_library): Support -l:filename.
9451 (General_options::parse_just_symbols): Update for Input_file_argument
9452 changes.
9453 (Command_line::process): Likewise.
9454 * archive.cc (Archive::get_file_and_offset): Likewise.
9455 * plugin.cc (Plugin_manager::release_input_file): Likewise.
9456 * script.cc (read_script_file, script_add_file): Likewise.
9457 * fileread.cc (Input_file::Input_file): Likewise.
9458 (Input_file::will_search_for): Handle is_searched_file.
9459 (Input_file::open): Likewise.
9460 * readsyms.cc (Read_symbols::get_name): Likewise.
9461 * testsuite/Makefile.am (searched_file_test): New test.
9462 * testsuite/Makefile.in: Regenerate.
9463 * testsuite/searched_file_test.cc: New file.
9464 * testsuite/searched_file_test_lib.cc: New file.
9465
f3048a1d
ILT
94662009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9467 Ian Lance Taylor <iant@google.com>
9468
9469 * descriptor.cc: Include <cstdio> and "binary-io.h".
9470 (Descriptors::open): Open the files in binary mode always.
9471 * script.cc (Lex::get_token): Treat \r as whitespace.
9472
d4780e57
ILT
94732009-10-09 Ian Lance Taylor <iant@google.com>
9474
9475 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
9476
d9a893b8
ILT
94772009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9478 Ian Lance Taylor <iant@google.com>
9479
9480 * configure.ac: Check for readv function also.
9481 * fileread.cc (readv): Define if not HAVE_READV.
9482 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
9483 does not exist.
9484 * config.in: Regenerate.
9485 * configure: Regenerate.
9486
c0a62865
DK
94872009-10-09 Doug Kwan <dougkwan@google.com>
9488
9489 * layout.cc (Layout::make_output_section): Call target hook to make
9490 ordinary output section.
9491 (Layout::finalize): Adjust parameter list of call the
9492 Target::may_relax().
9493 * layout.h (class Layout::section_list): New method.
9494 * merge.h (Output_merge_base::entsize): Change visibility to public.
9495 (Output_merge_base::is_string, Output_merge_base::do_is_string):
9496 New methods.
9497 (Output_merge_string::do_is_string): New method.
9498 * object.cc (Sized_relobj::do_setup): renamed from
9499 Sized_relobj::set_up.
9500 * object.h (Sized_relobj::adjust_shndx,
9501 Sized_relobj::initializ_input_to_output_maps,
9502 Sized_relobj::free_input_to_output_maps): Change visibilities to
9503 protected.
9504 (Sized_relobj::setup): Virtualize.
9505 (Sized_relobj::do_setup): New method declaration.
9506 (Sized_relobj::invalidate_section_offset,
9507 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
9508 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
9509 * options.cc (parse_int): New function.
9510 * options.h (parse_int): New declaration.
9511 (DEFINE_int): New macro.
9512 (stub_group_size): New option.
9513 * output.cc (Output_section::Output_section): Initialize memebers
9514 merge_section_map_, merge_section_by_properties_map_,
9515 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
9516 (Output_section::add_input_section): Handled deferred code-fill
9517 generation and remove an old comment.
9518 (Output_section::add_relaxed_input_section): New method definition.
9519 (Output_section::add_merge_input_section): Use merge section by
9520 properties map to speed to search. Update merge section maps
9521 as appropriate.
9522 (Output_section::build_relaxation_map): New method definition.
9523 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
9524 Same.
9525 (Output_section::relax_input_section): Renamed to
9526 Output_section::convert_input_sections_to_relaxed_sections and change
9527 interface to take a vector of pointers to relaxed sections.
9528 (Output_section::find_merge_section,
9529 Output_section::find_relaxed_input_section): New method definitions.
9530 (Output_section::is_input_address_mapped,
9531 Output_section::output_offset, Output_section::output_address):
9532 Use output section data maps to speed up searching.
9533 (Output_section::find_starting_output_address): Add comments.
9534 (Output_section::do_write,
9535 Output_section::write_to_postprocessing_buffer): Do code-fill
9536 generation as appropriate.
9537 (Output_section::get_input_sections): Invalidate relaxed input section
9538 map.
9539 (Output_section::restore_states): Adjust type of checkpoint .
9540 Invalidate relaxed input section map.
9541 * output.h (Output_merge_base): New class declaration.
9542 (Input_section_specifier): New class defintion.
9543 (class Output_relaxed_input_section) Change base class to
9544 Output_section_data_build.
9545 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
9546 base class initializer.
9547 (Output_section::add_relaxed_input_section): New method declaration.
9548 (Output_section::Input_section): Change visibility to protected.
2e702c99 9549 (Output_section::Input_section::relobj,
c0a62865
DK
9550 Output_section::Input_section::shndx): Handle relaxed input sections.
9551 Output_section::input_sections) Change visibility to protected. Also
9552 define overload to return a non-const pointer.
9553 (Output_section::Merge_section_properties): New class defintion.
9554 (Output_section::Merge_section_by_properties_map,
9555 Output_section::Output_section_data_by_input_section_map,
9556 Output_section::Relaxation_map): New types.
9557 (Output_section::relax_input_section): Rename method to
9558 Output_section::convert_input_sections_to_relaxed_sections and change
9559 interface to take a vector of relaxed section pointers.
9560 (Output_section::find_merge_section,
9561 Output_section::find_relaxed_input_section,
9562 Output_section::build_relaxation_map,
9563 Output_section::convert_input_sections_in_list_to_relaxed_sections):
9564 New method declarations.
9565 (Output_section::merge_section_map_
9566 Output_section::merge_section_by_properties_map_,
9567 Output_section::relaxed_input_section_map_,
9568 Output_section::is_relaxed_input_section_map_valid_,
9569 Output_section::generate_code_fills_at_write_): New data members.
9570 * script-sections.cc
9571 (Output_section_element_input::set_section_addresses): Call
9572 current_data_size and addralign methods of relaxed input sections.
9573 (Orphan_output_section::set_section_addresses): Call current_data_size
9574 and addralign methods of relaxed input sections.
9575 * symtab.cc (Symbol_table::compute_final_value): Extract template
9576 from the body of Symbol_table::sized_finalize_symbol.
9577 (Symbol_table::sized_finalized_symbol): Call
9578 Symbol_table::compute_final_value.
9579 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
9580 (Symbol_table::compute_final_value): New templated method declaration.
9581 * target.cc (Target::do_make_output_section): New method defintion.
9582 * target.h (Target::make_output_section): New method declaration.
9583 (Target::relax): Add more parameters for input objects, symbol table
9584 and layout. Adjust call to do_relax.
9585 (Target::do_make_output_section): New method declaration.
9586 (Target::do_relax): Add parameters for input objects, symbol table
9587 and layout.
9588
d446d6c4
ILT
95892009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9590
9591 * pread.c: Include stdio.h.
9592
bc06c745
ILT
95932009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9594
9595 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
9596 defined.
9597
75aea3d0
ILT
95982009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9599
9600 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
9601 Change read_shndx type to unsigned int.
9602 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
9603 int.
9604 (Sized_dwarf_line_info::read_line_mappings): Likewise.
9605 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
9606 Change read_shndx type to unsigned int.
9607 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
9608 int.
9609 (Sized_dwarf_line_info::read_line_mappings): Likewise.
9610 * layout.cc (Layout::create_symtab_sections): Cast the result of
9611 local_symcount * symsize to off_t in the gold_assert.
9612
be8fcb75
ILT
96132009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9614
9615 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
9616 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
9617 R_ARM_BASE_ABS.
9618 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
9619 (Arm_relocate_functions::thm_abs5): New function.
9620 (Arm_relocate_functions::abs12): New function.
9621 (Arm_relocate_functions::abs16): New function.
9622 (Arm_relocate_functions::base_abs): New function.
9623 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
9624 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
9625 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
9626 R_ARM_BASE_ABS.
9627 (Scan::global): Likewise.
9628 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
9629 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
9630 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
9631 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
9632 R_ARM_BASE_ABS.
9633
c2a122b6
ILT
96342009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9635
9636 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
9637 (Arm_relocate_functions::movt_prel): New function.
9638 (Arm_relocate_functions::thm_movw_prel_nc): New function.
9639 (Arm_relocate_functions::thm_movt_prel): New function.
9640 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
9641 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
9642 (Scan::global, Relocate::relocate): Likewise.
9643 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9644
c4aa1e2d
ILT
96452009-10-09 Mikolaj Zalewski <mikolajz@google.com>
9646
9647 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
9648 Incremental_checker.
9649 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
9650 unsigned int.
9651 (class Incremental_inputs_header): New class.
9652 (Incremental_inputs_header_writer): Edit comment.
9653 (Incremental_inputs_entry): New class.
9654 (Incremental_inputs_entry_writer): Edit comment.
9655 (Sized_incremental_binary::do_find_incremental_inputs_section):
9656 Add *strtab_shndx parameter, fill it.
9657 (Sized_incremental_binary::do_check_inputs): New method.
9658 (Incremental_checker::can_incrementally_link_output_file): Use
9659 Sized_incremental_binary::check_inputs.
9660 (Incremental_inputs::report_command_line): Save command line in
9661 command_line_.
9662 * incremental.h:
9663 (Incremental_binary::find_incremental_inputs_section): New
9664 method.
9665 (Incremental_binary::do_find_incremental_inputs_section): Add
9666 strtab_shndx parameter.
9667 (Incremental_binary::do_check_inputs): New pure virtual method.
9668 (Sized_incremental_binary::do_check_inputs): Declare.
9669 (Incremental_checker::Incremental_checker): Add incremental_inputs
9670 parameter, use it to initialize incremental_inputs_.
9671 (Incremental_checker::incremental_inputs_): New field.
9672 (Incremental_checker::command_line): New method.
9673 (Incremental_checker::inputs): New method.
9674 (Incremental_checker::command_line_): New field.
9675
c549a694
ILT
96762009-10-09 Mikolaj Zalewski <mikolajz@google.com>
9677
9678 * incremental.cc: Include <cstdarg> and "target-select.h".
9679 (vexplain_no_incremental): New function.
9680 (explain_no_incremental): New function.
9681 (Incremental_binary::error): New method.
9682 (Sized_incremental_binary::do_find_incremental_inputs_section): New
9683 method.
9684 (make_sized_incremental_binary): New function.
9685 (open_incremental_binary): New function.
9686 (can_incrementally_link_file): Add checks if output is ELF and has
9687 inputs section.
9688 * incremental.h: Include "elfcpp_file.h" and "output.h".
9689 (Incremental_binary): New class.
9690 (Sized_incremental_binary): New class.
9691 (open_incremental_binary): Declare.
9692 * object.cc (is_elf_object): Use
9693 elfcpp::Elf_recognizer::is_elf_file.
9694 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
9695 * output.h (Output_file::filesize): New method.
9696
fd3c5f0b
ILT
96972009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9698
9699 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
9700 New function.
9701 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
9702 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
9703 function.
9704 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
9705 function.
9706 (Arm_relocate_functions::movw_abs_nc): New function.
9707 (Arm_relocate_functions::movt_abs): New function.
9708 (Arm_relocate_functions::thm_movw_abs_nc): New function.
9709 (Arm_relocate_functions::thm_movt_abs): New function.
9710 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
9711 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
9712 (Scan::global): Likewise.
9713 (Relocate::relocate): Likewise.
9714 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9715
7f5309a5
ILT
97162009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9717
9718 * arm.cc (Arm_relocate_functions::got_prel) New function.
9719 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
9720 (Relocate::relocate): Likewise.
9721 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9722
364c7fa5
ILT
97232009-10-06 Ian Lance Taylor <iant@google.com>
9724
9725 * options.h (class General_options): Define
9726 split_stack_adjust_size parameter.
9727 * object.h (class Object): Add uses_split_stack_ and
9728 has_no_split_stack_ fields. Add uses_split_stack and
9729 has_no_split_stack accessor functions. Declare
9730 handle_split_stack_section.
9731 (class Reloc_symbol_changes): Define.
9732 (class Sized_relobj): Define Function_offsets. Declare
9733 split_stack_adjust, split_stack_adjust_reltype, and
9734 find_functions.
9735 * object.cc (Object::handle_split_stack_section): New function.
9736 (Sized_relobj::do_layout): Call handle_split_stack_section.
9737 * dynobj.cc (Sized_dynobj::do_layout): Call
9738 handle_split_stack_section.
9739 * reloc.cc (Sized_relobj::relocate_sections): Call
9740 split_stack_adjust for executable sections in split_stack
9741 objects. Pass reloc_map to relocate_section.
9742 (Sized_relobj::split_stack_adjust): New function.
9743 (Sized_relobj::split_stack_adjust_reltype): New function.
9744 (Sized_relobj::find_functions): New function.
9745 * target-reloc.h: Include "object.h".
9746 (relocate_section): Add reloc_symbol_changes parameter. Change
9747 all callers.
9748 * target.h (class Target): Add calls_non_split method. Declare
9749 do_calls_non_split virtual method. Declare match_view and
9750 set_view_to_nop.
9751 * target.cc: Include "elfcpp.h".
9752 (Target::do_calls_non_split): New function.
9753 (Target::match_view): New function.
9754 (Target::set_view_to_nop): New function.
9755 * gold.cc (queue_middle_tasks): Give an error if mixing
9756 split-stack and non-split-stack objects with -r.
9757 * i386.cc (Target_i386::relocate_section): Add
9758 reloc_symbol_changes parameter.
9759 (Target_i386::do_calls_non_split): New function.
9760 * x86_64.cc (Target_x86_64::relocate_section): Add
9761 reloc_symbol_changes parameter.
9762 (Target_x86_64::do_calls_non_split): New function.
9763 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
9764 parameter.
9765 * powerpc.cc (Target_powerpc::relocate_section): Add
9766 reloc_symbol_changes parameter.
9767 * sparc.cc (Target_sparc::relocate_section): Add
9768 reloc_symbol_changes parameter.
9769 * configure.ac: Call AM_CONDITIONAL for the default target.
9770 * configure: Rebuild.
9771 * testsuite/Makefile.am (TEST_AS): New variable.
9772 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
9773 (check_DATA): Add split_i386 and split_x86_64 files.
9774 (SPLIT_DEFSYMS): Define.
9775 (split_i386_[1234n].o): New targets.
9776 (split_i386_[124]): New targets.
9777 (split_i386_[1234r].stdout): New targets.
9778 (split_x86_64_[1234n].o): New targets.
9779 (split_x86_64_[124]): New targets.
9780 (split_x86_64_[1234r].stdout): New targets.
9781 (MOSTLYCLEANFILES): Add new executables.
9782 * testsuite/split_i386.sh: New file.
9783 * testsuite/split_x86_64.sh: New file.
9784 * testsuite/split_i386_1.s: New file.
9785 * testsuite/split_i386_2.s: New file.
9786 * testsuite/split_i386_3.s: New file.
9787 * testsuite/split_i386_4.s: New file.
9788 * testsuite/split_i386_n.s: New file.
9789 * testsuite/split_x86_64_1.s: New file.
9790 * testsuite/split_x86_64_2.s: New file.
9791 * testsuite/split_x86_64_3.s: New file.
9792 * testsuite/split_x86_64_4.s: New file.
9793 * testsuite/split_x86_64_n.s: New file.
9794 * testsuite/testfile.cc (Target_test): Update relocation_section
9795 function.
9796 * testsuite/Makefile.in: Rebuild.
9797
e8a9fcda
ILT
97982009-10-06 Ian Lance Taylor <iant@google.com>
9799
9800 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
9801 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
9802 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
9803 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
9804 the address on ldo_addrs_.
9805 (Target_i386::Relocate::fix_up_ldo): New function.
9806
e99daf92
ILT
98072009-10-06 Rafael Espindola <espindola@google.com>
9808
9809 * plugin.cc (add_input_library): New.
9810 (Plugin::load): Add add_input_library to tv.
9811 (Plugin_manager::add_input_file): Add the is_lib argument.
9812 (add_input_file): Update call to Plugin_manager::add_input_file.
9813 (add_input_library): New.
9814 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
9815
966d4097
DK
98162009-09-30 Doug Kwan <dougkwan@google.com>
9817
9818 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
9819 symbol and call Symbol::may_need_copy_reloc to determine if
9820 a copy reloc is needed.
9821 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
9822 nocopyreloc is given in command line.
9823 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
9824 given in command line.
9825 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
9826 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
9827 of the removed Target_i386::may_need_copy_reloc.
9828 * options.h (copyreloc): New option with default value false.
9829 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9830 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
9831 instead of the removed Target_powerpc::may_need_copy_reloc.
9832 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9833 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
9834 instead of the removed Target_sparc::may_need_copy_reloc.
9835 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
9836 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
9837 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
9838 instead of the removed Target_x86_64::may_need_copy_reloc.
9839
029ba973
ILT
98402009-09-30 Ian Lance Taylor <iant@google.com>
9841
9842 * object.h (class Object): Remove target_ field, and target,
9843 sized_target, and set_target methods.
9844 (Object::sized_target): Remove.
9845 (class Sized_relobj): Update declarations. Remove sized_target.
9846 * object.cc (Sized_relobj::setup): Remove target parameter.
9847 Change all callers.
9848 (Input_objects::add_object): Don't do anything with the target.
9849 (make_elf_sized_object): Add punconfigured parameter. Change all
9850 callers. Set or test parameter target.
9851 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
9852 Change all callers.
9853 * parameters.cc (Parameters::set_target): Change parameter type to
9854 be non-const.
9855 (Parameters::default_target): Remove.
9856 (set_parameters_target): Change parameter type to be non-const.
9857 (parameters_force_valid_target): New function.
9858 (parameters_clear_target): New function.
9859 * parameters.h (class Parameters): Update declarations. Remove
9860 default_target method. Add sized_target and clear_target
9861 methods. Change target_ to be non-const.
9862 (set_parameters_target): Update declaration.
9863 (parameters_force_valid_target): Declare.
9864 (parameters_clear_target): Declare.
9865 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
9866 as NULL if we aren't searching.
9867 (Add_symbols::run): Don't check for compatible target.
9868 * fileread.cc (Input_file::open_binary): Call
9869 parameters_force_valid_target.
9870 * gold.cc (queue_middle_tasks): Likewise.
9871 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
9872 set_target on object.
9873 * dynobj.h (class Sized_dynobj): Update declarations.
9874 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
9875 make_elf_object returns NULL.
9876 (Archive::include_member): Don't check whether object target is
9877 compatible.
9878 * output.cc (Output_section::add_input_section): Get target from
9879 parameters.
9880 (Output_section::relax_input_section): Likewise.
9881 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
9882 parameters.
9883 (Sized_relobj::do_scan_relocs): Likewise.
9884 (Sized_relobj::relocate_sections): Likewise.
9885 * resolve.cc (Symbol_table::resolve): Likewise.
9886 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
9887 parameter. Change all callers.
9888 (Symbol_table::add_from_object): Get target from parameters.
9889 (Symbol_table::add_from_relobj): Don't check object target.
9890 (Symbol_table::add_from_dynobj): Likewise.
9891 (Symbol_table::define_special_symbol): Get target from
9892 parameters.
9893 * symtab.h (class Symbol_table): Update declaration.
9894 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
9895 parameter. Change all callers. Clear parameter target.
9896 (Binary_test): Test target here.
9897 * testsuite/object_unittest.cc (gold_testsuite): Remove
9898 target_test_pointer parameter. Change all callers.
9899 (Object_test): Test target here.
9900
a6a22b83
ILT
99012009-09-26 Ian Lance Taylor <iant@google.com>
9902
9903 * testsuite/initpri1.c: Don't try to use constructor priorities if
9904 compiling with gcc before 4.3.
9905
6a8f49fe
ILT
99062009-09-22 Mikolaj Zalewski <mikolajz@google.com>
9907
9908 * testsuite/retain_symbols_file_test.sh (check_present): Change
9909 output file name to retain_symbols_file_test.stdout.
9910 (check_absent): Likewise.
9911
8c604651
CS
99122009-09-18 Craig Silverstein <csilvers@google.com>
9913
9914 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
9915 * options.cc: Include <cerrno> and <fstream>.
9916 (General_options::finalize): Parse -retain-symbols-file tag.
9917 * options.h: New flag.
9918 (General_options): New method should_retain_symbol, new
9919 variable symbols_to_retain.
9920 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
9921 should_retain_symbol map.
9922 * testsuite/Makefile.am (retain_symbols_file_test): New test.
9923 * testsuite/Makefile.in: Regenerate.
9924 * testsuite/retain_symbols_file_test.sh: New file.
9925
ca58b19f
NC
99262009-09-18 Nick Clifton <nickc@redhat.com>
9927
9928 * po/es.po: Updated Spanish translation.
9929
20e6d0d6
DK
99302009-09-17 Doug Kwan <dougkwan@google.com>
9931
9932 * debug.h (DEBUG_RELAXATION): New constant.
9933 (DEBUG_ALL): Add DEBUG_RELAXATION.
9934 (debug_string_to_enum): Add relaxation debug option.
9935 * layout.cc
9936 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
9937 Layout::Relaxation_debug_check::read_sections,
9938 Layout::Relaxation_debug_check::read_sections): New method definitions.
9939 (Layout::Layout): Initialize data members
9940 record_output_section_data_from_scrips_,
9941 script_output_section_data_list_ and relaxation_debug_check_.
9942 (Layout::save_segments, Layout::restore_segments,
9943 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9944 Layout::relaxation_loop_body): New method definitions.
9945 (Layout::finalize): Support relaxation. Move section layout code to
9946 Layout::relaxation_loop_body.
9947 (Layout::set_asection_address_from_script): Move code for orphan
9948 section placement out.
9949 (Layout::place_orphan_sections_in_script): New method definition.
9950 * layout.h (Output_segment_headers, Output_file_header):
9951 New forward class declarations.
9952 (Layout::~Layout): Define.
9953 (Layout::new_output_section_data_from_script): New method definition.
9954 (Layout::place_orphan_sections_in_script): New method declaration.
9955 (Layout::Segment_states): New type declaration.
9956 (Layout::save_segments, Layout::restore_segments,
9957 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9958 Layout::relaxation_loop_body): New method declarations.
9959 (Layout::Output_section_data_list): New type declaration.
9960 (Layout::Relaxation_debug_check): New class definition.
9961 (Layout::record_output_section_data_from_script_,
9962 Layout::script_output_section_data_list_, Layout::segment_states_,
9963 Layout::relaxation_debug_check_): New data members.
9964 * output.cc: (Output_section_headers::do_size): New method definition.
9965 (Output_section_headers::Output_section_headers): Move size
9966 computation to Output_section_headers::do_size.
9967 (Output_segment_headers::do_size): New method definition.
e1df38aa 9968 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
9969 Output_file_header::do_size and call it.
9970 (Output_file_header::do_size): New method definition.
9971 (Output_data_group::Output_data_group): Adjust call to
9972 Output_section_data.
9973 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
9974 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 9975 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
9976 RELAXED_INPUT_SECTION_CODE.
9977 (Output_section::Output_section): Initialize data member checkpoint_.
9978 (Output_section::~Output_section): Delete checkpoint object pointed
9979 by checkpoint_.
9980 (Output_section::add_input_section): Always add an Input_section if
9981 relaxing.
9982 (Output_section::add_merge_input_section): Add assert.
9983 (Output_section::relax_input_section): New method definition.
9984 (Output_section::set_final_data_size): Set load address to zero for
9985 an unallocated section.
9986 (Output_section::do_address_and_file_offset_have_reset_values):
9987 New method definition.
9988 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
9989 Handle relaxed input section.
9990 (Output_section::sort_attached_input_sections): Checkpoint input
9991 section list lazily.
9992 (Output_section::get_input_sections): Change type of input_sections to
9993 list of Simple_input_section pointers. Checkpoint input section list
9994 lazily. Also handle relaxed input sections.
9995 (Output_section::add_input_section_for_script): Take a reference to
9996 a Simple_input_section object instead of Relobj pointer and section
9997 index as parameter. Handle relaxed input sections.
9998 (Output_section::save_states, Output_section::restore_states): New
9999 method definitions.
10000 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
10001 (Output_data::is_data_size_fixed): New method definition.
10002 (Output_data::reset_addresss_and_file_offset): Do not reset data size
10003 if it is fixed.
10004 (Output_data::address_and_file_offset_have_reset_values): New method
10005 definition.
10006 (Output_data::do_address_and_file_offset_have_reset_values): New method
10007 definition.
10008 (Output_data::set_data_size): Check that data size is not fixed.
10009 (Output_data::fix_data_size): New method definition.
10010 (Output_data::is_data_size_fixed_): New data member.
10011 (Output_section_headers::set_final_data_size): New method definition.
10012 (Output_section_headers::do_size): New method declaration.
10013 (Output_segment_headers::set_final_data_size): New method definition.
10014 (Output_segment_headers::do_size): New method declaration.
10015 (Output_file_header::set_final_data_size)::New method definition.
10016 (Output_file_header::do_size)::New method declaration.
10017 (Output_section_data::Output_section_data): Add new parameter
10018 is_data_size_fixed and use it to fix data size.
10019 (Output_data_const::Output_data_const): Adjust call to base class
10020 constructor and fix data size.
10021 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
10022 base class constructor and fix data size.
10023 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
10024 base class constructor and fix data size.
10025 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
10026 class constructor and fix data size.
10027 (Output_data_group::set_final_data_size): New method definition.
10028 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
10029 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
10030 class constructor and fix data size.
10031 (Output_relaxed_input_section): New class definition.
10032 (Output_section::Simple_input_section): New class definition.
10033 (Output_section::get_input_sections): Adjust parameter list.
10034 (Output_section::add_input_section_for_script): Same.
10035 (Output_section::save_states, Output_section::restore_states,
10036 Output_section::do_address_and_file_offset_have_reset_values,
10037 (Output_section::Input_section::Input_section): Handle
10038 RELAXED_INPUT_SECTION_CODE. Add new overload for
10039 Output_relaxed_input_section.
10040 (Output_section::Input_section::is_input_section,
10041 Output_section::Input_section::set_output_section): Handle relaxed
10042 input section.
10043 (Output_section::Input_section::is_relaxed_input_section,
10044 Output_section::Input_section::output_section_data,
10045 Output_section::Input_section::relaxed_input_section): New method
10046 definitions.
10047 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
10048 value.
10049 (Output_section::Input_section::u1_): Update comments.
10050 (Output_section::Input_section::u2_): Add new union member poris.
10051 (Output_section::Checkpoint_output_section): New classs definition.
10052 (Output_section::relax_input_section): New method declaration.
10053 (Output_section::checkpoint_): New data member.
10054 (Output_segment): Update comments.
10055 (Output_segment::Output_segment): Un-privatize copy constructor.
10056 (Output_segment::operator=): Un-privatize.
10057 * script-sections.cc (Output_section_element::Input_section_list):
10058 Change element type to Output_section::Simple_input_section.
10059 (Output_section_element_dot_assignment::set_section_addresses):
10060 Register output section data for relaxation clean up.
10061 (Output_data_exression::Output_data_expression): Adjust call to base
10062 constructor to fix data size.
10063 (Output_section_element_data::set_section_addresses): Register
10064 Output_data_expression object for relaxation clean up.
10065 (struct Input_section_info): Replace Relobj pointer and section index
10066 pair with Output_section::Simple_input_section and Convert struct to a
10067 class.
10068 (Input_section_sorter::operator()): Adjust access to
e1df38aa 10069 Input_section_info data member to use accessors.
20e6d0d6
DK
10070 (Output_section_element_input::set_section_addresses): Use layout
10071 parameter. Adjust code to use Output_section::Simple_input_section
10072 and Input_secction_info classes. Register filler for relaxation
10073 clean up.
10074 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
10075 and section index pair with Output_section::Simple_input_section
10076 class. Adjust code accordingly.
10077 (Phdrs_element::release_segment): New method definition.
10078 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
10079 segment list.
10080 (Script_sections::release_segments): New method definition.
10081 * gold/script-sections.h (Script_sections::release_segments): New
10082 method declaration.
10083 * gold/target.h (Target::may_relax, Target::relax,
10084 Target::do_may_relax, Target::do_relax): New method definitions.
10085
5e445df6
ILT
100862009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10087
10088 * arm.cc (has_signed_unsigned_overflow): New function.
10089 (Arm_relocate_functions::abs8): New function.
10090 (Target_arm::Scan::local): Handle R_ARM_ABS8.
10091 (Target_arm::Scan::global): Likewise.
10092 (Target_arm::relocate::relocate): Likewise.
10093 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10094 Likewise.
10095
8c604651 100962009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
10097
10098 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
10099 * testsuite/Makefile.in: Regenerate.
10100
1e9cc1c2
NC
101012009-09-11 Nick Clifton <nickc@redhat.com>
10102
10103 * po/gold.pot: Updated by the Translation project.
10104
6a89f575
CC
101052009-09-08 Cary Coutant <ccoutant@google.com>
10106
10107 * output.cc (Output_file::open): Add execute permission to empty file.
10108 * testsuite/Makefile.am (permission_test): New test.
10109 * testsuite/Makefile.in: Regenerate.
10110
fdcac5af
ILT
101112009-09-02 Ian Lance Taylor <iant@google.com>
10112
10113 * output.cc (Output_file::resize): Call map_no_anonymous rather
10114 than map.
10115
44453f85
ILT
101162009-09-01 Mikolaj Zalewski <mikolajz@google.com>
10117
10118 * gold.cc: Include "incremental.h".
10119 (queue_initial_tasks): Call Incremental_checker methods.
10120 * incremental.cc: Include "output.h".
10121 (Incremental_checker::can_incrementally_link_output_file): New
10122 method.
10123 * incremental.h (Incremental_checker): New class.
10124
10125 * output.cc (Output_file::open_for_modification): New method.
10126 (Output_file::map_anonymous): Changed return type to bool. Record
10127 map in base_ field.
10128 (Output_file::map_no_anonymous): New method, broken out of map.
10129 (Output_file::map): Use map_no_anonymous and map_anonymous.
10130 * output.h (class Output_file): Update declarations.
10131
293c1386
CC
101322009-08-24 Cary Coutant <ccoutant@google.com>
10133
10134 * options.h (Command_line::Pre_options): New class.
10135 (Command_line::pre_options): New member.
10136 * options.cc (gold::options::ready_to_register): New variable.
10137 (One_option::register_option): Do nothing if not registering options.
10138 Assert if same short option registered twice.
10139 (General_options::General_options): Turn off option registration when
10140 done constructing.
10141 (Command_line::Pre_options::Pre_options): New constructor.
10142
f773f3d2
CC
101432009-08-24 Cary Coutant <ccoutant@google.com>
10144
06a73cfe
CC
10145 * options.h (General_options::no_keep_memory): Remove incorrect
10146 short option.
f773f3d2 10147
a15af8e2
RW
101482009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10149
10150 * Makefile.am (am__skiplex, am__skipyacc): New.
10151 * Makefile.in: Regenerate.
10152
c462b41b
RW
101532009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10154
14ec8efd
RW
10155 * Makefile.am (AM_CPPFLAGS): Renamed from ...
10156 (INCLUDES): ... this.
10157 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
10158 (AM_CPPFLAGS): Renamed from ...
10159 (INCLUDE): ... this.
10160 * Makefile.in, testsuite/Makefile.in: Regenerate.
10161
81ecdfbb
RW
10162 * Makefile.in: Regenerate.
10163 * aclocal.m4: Likewise.
10164 * config.in: Likewise.
10165 * configure: Likewise.
10166 * testsuite/Makefile.in: Likewise.
10167
c462b41b
RW
10168 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
10169 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
10170 * Makefile.in: Regenerate.
10171 * testsuite/Makefile.in: Regenerate.
10172
2da73f13
CC
101732009-08-19 Cary Coutant <ccoutant@google.com>
10174
10175 * resolve.cc (Symbol_table::resolve): Don't complain about defined
10176 symbols in shared libraries overridden by hidden or internal symbols
10177 in the main program.
10178
2db70501
CD
101792009-08-19 Chris Demetriou <cgd@google.com>
10180
10181 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
10182 checking source file names in error messages.
10183
f733487b
DK
101842009-08-18 Doug Kwan <dougkwan@google.com>
10185
10186 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
10187 an elcpp::Ehdr as parameter. Adjust call to set_target.
10188 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
10189 an elfcpp::Ehdr as parameter.
10190 * object.cc (Object::set_target): Remove the version that looks up
10191 a target and sets it.
10192 (Sized_relobj::setup): Take a Target object instead of
10193 an elfcpp::Ehdr as parameter. Adjust call to set_target.
10194 (make_elf_sized_object): Find target and ask target to
10195 make an ELF object.
10196 * object.h: (Object::set_target): Remove the version that looks up
10197 a target and sets it.
10198 (Sized_relobj::setup): Take a Target object instead of
10199 an elfcpp:Ehdr as parameter.
10200 * target.cc: Include dynobj.h.
10201 (Target::do_make_elf_object_implementation): New.
2e702c99 10202 (Target::do_make_elf_object): New.
f733487b
DK
10203 * target.h (Target::make_elf_object): New template declaration.
10204 (Target::do_make_elf_object): New method declarations.
10205 (Target::do_make_elf_object_implementation): New template declaration.
10206
cc70f101
ILT
102072009-08-14 Ian Lance Taylor <iant@google.com>
10208
10209 * gold.h (FUNCTION_NAME): Define.
10210 (gold_unreachable): Use FUNCTION_NAME.
10211
ef5e0cb1
ST
102122009-08-12 Sriraman Tallam <tmsriram@google.com>
10213
10214 * icf.cc (Icf::find_identical_sections): Issue a warning when a
10215 symbol in the --keep-unique list is not found.
10216
48c187ce
ST
102172009-08-12 Sriraman Tallam <tmsriram@google.com>
10218
10219 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
10220 been maked as --keep-unique.
10221 (Icf::unfold_section): New function.
10222 * icf.h (Icf::unfold_section): New function.
10223 * options.h (General_options::keep_unique): New option.
10224 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
10225 * testsuite/Makefile.in: Regenerate.
10226 * testsuite/icf_keep_unique_test.sh: New file.
10227 * testsuite/icf_keep_unique_test.cc: New file.
10228
645afe0c
CC
102292009-08-12 Cary Coutant <ccoutant@google.com>
10230
10231 PR 10471
10232 * resolve.cc (Symbol_table::resolve): Check for references from
10233 dynamic objects to hidden and internal symbols.
10234 * testsuite/Makefile.am (hidden_test.sh): New test.
10235 * testsuite/Makefile.in: Regenerate.
10236 * testsuite/hidden_test.sh: New script.
10237 * testsuite/hidden_test_1.c: New test source.
10238 * testsuite/hidden_test_main.c: New test source.
10239
11af873f
DK
102402009-08-11 Doug Kwan <dougkwan@google.com>
10241
10242 * arm.cc: Update comments.
10243 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
10244 segment to locate the .ARM.exidx section if present.
10245
b9f7d72d
DK
102462009-08-09 Doug Kwan <dougkwan@google.com>
10247
10248 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
10249 patch.
10250
ddd3c53c
ST
102512009-08-07 Sriraman Tallam <tmsriram@google.com>
10252 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
10253 compiler warnings.
10254
27721062
ST
102552009-08-06 Sriraman Tallam <tmsriram@google.com>
10256
10257 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
10258 valid tls_segment only for non-debug-section relocations.
10259 * testsuite/Makefile.am: Add gc_tls_test.
10260 * testsuite/Makefile.in: Regenerate.
10261 * testsuite/gc_tls_test.cc: New file.
10262 * testsuite/gc_tls_test.sh: New file.
10263
ef15dade 102642009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 10265
ef15dade
ST
10266 * icf.cc: New file.
10267 * icf.h: New file.
10268 * Makefile.am (CCFILES): Add icf.cc.
10269 (HFILES): Add icf.h
10270 * Makefile.in: Regenerate.
10271 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
10272 * gc.h (gc_process_relocs): Populate lists used by icf to contain
10273 section, symbol and addend information for the relocs.
10274 * gold.cc (queue_middle_tasks): Call identical code folding.
10275 * gold.h: Add defines for multimap.
10276 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
10277 to the call of finalize_local_symbols.
10278 * main.cc (main): Create object of class Icf.
10279 * object.cc (Sized_relobj::do_layout): Allow this function to be
10280 called twice during icf.
10281 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
10282 to sections marked as identical by icf.
10283 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
10284 when available.
10285 (Sized_relobj::do_section_entsize): New function.
10286 * object.h (Object::section_entsize): New function.
10287 (Object::do_section_entsize): New pure virtual function.
10288 (Relobj::finalize_local_symbols): Add new parameter.
10289 (Relobj::do_section_entsize): New function.
10290 * options.h (General_options::icf): New option.
10291 (General_options::icf_iterations): New option.
10292 (General_options::print_icf_sections): New option.
10293 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
10294 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
10295 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
10296 icf.
10297 * symtab.cc (Symbol_table::is_section_folded): New function.
10298 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
10299 to sections marked as identical by icf.
10300 * symtab.h (Symbol_table::set_icf): New function.
10301 (Symbol_table::icf): New function.
10302 (Symbol_table::is_section_folded): New function.
10303 (Symbol_table::icf_): New data member.
10304 * target-reloc.h (relocate_section): Ignore sections folded by icf.
10305 * testsuite/Makefile.am: Add commands to build icf_test.
10306 * testsuite/Makefile.in: Regenerate.
10307 * testsuite/icf_test.sh: New file.
10308 * testsuite/icf_test.cc: New file.
10309
c3b65ac4
CD
103102009-07-24 Chris Demetriou <cgd@google.com>
10311
10312 * layout.cc (is_compressible_debug_section): Fix incorrect
10313 comment about compressed section names.
10314
1caf2c51
ILT
103152009-07-20 Ian Lance Taylor <ian@airs.com>
10316
10317 PR 10419
10318 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
10319
1ef4d87f
ILT
103202009-07-16 Ian Lance Taylor <iant@google.com>
10321
10322 PR 10400
10323 * layout.h: #include <map>.
10324 (class Kept_section): Change from struct to class. Add accessors
10325 and setters. Add section size to Comdat_group mapping. Change
10326 Comdat_group to std::map. Add is_comdat_ field. Add
10327 linkonce_size field in union.
10328 (class Layout): Update declaration of find_or_add_kept_section.
10329 Don't declare find_kept_object.
10330 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
10331 parameter. Add object, shndx, is_comdat, and is_group_name
10332 parameters. Change all callers. Adjust for new Kept_section.
10333 (Layout::find_kept_object): Remove.
10334 * object.cc (Sized_relobj::include_section_group): Update use of
10335 Kept_section. Rename secnum to shndx. Only record
10336 Kept_comdat_section if sections are the same size.
10337 (Sized_relobj::include_linkonce_section): Update use of
10338 Kept_section. Only record Kept_comdat_section if sections are the
10339 same size. Set size of linkonce section.
10340 (Sized_relobj::map_to_kept_section): Update call to
10341 get_kept_comdat_section.
10342 * object.h (class Sized_relobj): Rename fields in
10343 Kept_comdat_section to drop trailing underscores; change object
10344 field to Relobj*. Change Kept_comdat_section_table to store
10345 struct rather than pointer.
10346 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
10347 Add kept_object and kept_shndx parameters. Change all callers.
10348 (Sized_relobj::get_kept_comdat_section): Change return type to
10349 bool. Add kept_object and kept_shndx parameters. Change all
10350 callers.
10351 * plugin.cc (Pluginobj::include_comdat_group): Update call to
10352 Layout::find_or_add_kept_section.
10353
37c3b7b0
ILT
103542009-07-09 Ian Lance Taylor <iant@google.com>
10355
10356 * merge.cc (Object_merge_map::initialize_input_to_output_map):
10357 Reserve space in the hash table.
10358
98fa85cb
ILT
103592009-07-06 Mikolaj Zalewski <mikolajz@google.com>
10360
10361 * fileread.cc (File_read::get_mtime): New method.
10362 * fileread.h (Timespec): New structure.
10363 (File_read::get_mtime): New method.
10364 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
10365 Renamed from timestamp_nsec.
10366 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
10367 Elf_Xword.
e1df38aa 10368 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 10369 timestamp_nsec.
e1df38aa 10370 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
10371 (Incremental_inputs::report_obejct): Save mtime; style fix.
10372 (Incremental_inputs::report_script): Save mtime; style fix.
10373 (Incremental_inputs::finalize_inputs): Style fix.
10374 (Incremental_inputs::finalize): Style fix.
10375 (Incremental_inputs::create_input_section_data): Store inputs
10376 mtime.
10377 * incremental.h (Incremental_inputs::report_script): Add mtime
10378 argument.
10379 (Incremental_inputs::Input_info::Input_info): Intialize only one
10380 union member.
10381 (Incremental_inputs::Input_info::archive): Move to nameless
10382 union.
10383 (Incremental_inputs::Input_info::obejct): Move to nameless union.
10384 (Incremental_inputs::Input_info::script): Move to nameless union.
10385 (Incremental_inputs::mtime): New field.
10386 * script.cc (read_input_script): Pass file mtime to
10387 Incremental_input.
10388 * script.h (Script_info::inputs): Style fix.
10389
c9d70757
ILT
103902009-07-01 Ian Lance Taylor <ian@airs.com>
10391
10392 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
10393 instead of 32.
10394
9c547ec3
ILT
103952009-06-24 Ian Lance Taylor <iant@google.com>
10396
10397 PR 10156
10398 * layout.cc (Layout::choose_output_section): If we find an
10399 existing section, update the flags.
10400 (Layout::create_notes): New function, broken out of
10401 Layout::finalize.
10402 (Layout::finalize): Don't create note sections.
10403 (Layout::create_note): Don't crash if linker script discards
10404 section.
10405 (Layout::create_gold_note): Likewise.
10406 (Layout::create_build_id): Likewise. Don't set
10407 after_input_sections on the section.
10408 (Layout::create_executable_stack_info): Remove target parameter.
10409 Change caller.
10410 * layout.h (class Layout): Declare create_notes. Update
10411 declaration of create_executable_stack_info.
10412 * gold.cc (queue_middle_tasks): Call create_notes.
10413 * output.cc (Output_section::update_flags_for_input_section): Move
10414 here from output.h. If SHF_ALLOC flag is newly set, mark address
10415 invalid.
10416 * output.h (Output_data::mark_address_invalid): New function.
10417 (class Output_section): Only declare, not define,
10418 update_flags_for_input_section. Remove set_flags.
10419
55458500
ILT
104202009-06-24 Ian Lance Taylor <iant@google.com>
10421
10422 * script-sections.cc (Output_section_definition::
10423 set_section_addresses): Rename shadowing local load_address to
10424 laddr.
10425
1307d6cd
ILT
104262009-06-24 Ian Lance Taylor <iant@google.com>
10427
10428 PR 10244
10429 * reloc.cc (relocate_sections): Skip empty relocation sections.
10430
ec3f783e
ILT
104312009-06-23 Ian Lance Taylor <iant@google.com>
10432
10433 PR 10156
10434 * layout.cc (Layout::create_note): Use choose_output_section
10435 rather than make_output_section.
10436
459c9f1c
ILT
104372009-06-23 Ian Lance Taylor <iant@google.com>
10438
10439 PR 10237
10440 * options.cc (General_options::parse_V): Set printed_version_.
10441 (General_options::General_options): Initialize printed_version_.
10442 * options.h (class General_options): Add printed_version_ field.
10443 * gold.cc (queue_initial_tasks): If there are no input files,
10444 don't give a fatal error if we printed the version information.
10445 (queue_middle_tasks): If using -r with a shared object, give a
10446 fatal error rather than an ordinary error.
10447
1518dc8f
ILT
104482009-06-23 Ian Lance Taylor <iant@google.com>
10449
10450 PR 10219
10451 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
10452 (Layout::make_output_section): Set have_stabstr_section_ if we see
10453 a .stab*str section.
10454 (Layout::finalize): Call link_stabs_sections.
10455 (Layout::link_stabs_sections): New file.
10456 * layout.h (class Layout): Add have_stabstr_section_ field.
10457 Declare link_stabs_sections.
10458
3d857b98
DK
104592009-06-23 Doug Kwan <dougkwan@google.com>
10460
10461 * Makefile.am (libgold_a_LIBADD): New.
10462 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 10463 * Makefile.in: Regenerate.
3d857b98
DK
10464 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
10465 * configure: Regenerate.
10466 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
10467 * fileread.cc: Include sys/state.h
10468 * gold.h: Declare memmem and strndup if found missing.
10469 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
10470
0639a6f6
ILT
104712009-06-23 Ian Lance Taylor <iant@google.com>
10472
10473 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
10474 * configure: Rebuild.
10475
8d63875c
ILT
104762009-06-23 Ian Lance Taylor <iant@google.com>
10477
10478 PR 10147
10479 * object.cc (Object::section_contents): Don't try to get a view if
10480 the section has length zero.
10481 (Object::handle_gnu_warning_section): If the section is empty, use
10482 the name of the section as the warning.
10483
f7c8a183
ILT
104842009-06-23 Ian Lance Taylor <iant@google.com>
10485
10486 PR 10133
10487 * stringpool.h (class Stringpool_template): Add optimize_ field.
10488 (Stringpool_template::set_optimize): New function.
10489 * stringpool.cc (Stringpool_template::Stringpool_template):
10490 Initialize optimize_ field.
10491 (Stringpool_template::set_string_offsets): Test local optimize
10492 fild rather than parameter.
10493 * layout.cc (Layout::Layout): Call set_optimize on the section
10494 name stringpool.
10495
e6a307ba
ILT
104962009-06-22 Ian Lance Taylor <iant@google.com>
10497
10498 PR 10030
10499 * yyscript.y: Parse TARGET.
10500 * script.cc (script_set_target): New function.
10501 * script-c.h (script_set_target): Declare.
10502 * options.cc (General_options::string_to_object_format): Rename
10503 from string_to_object_format in anonymous namespace. Change
10504 callers.
10505 * options.h (class General_options): Declare
10506 string_to_object_format.
10507
3ee173de
ILT
105082009-06-22 Ian Lance Taylor <iant@google.com>
10509
10510 * script-sections.cc (Script_sections::create_segments): Don't put
10511 program headers in a PT_LOAD segment if -n or -N.
10512
105132009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
10514
10515 PR 10141
10516 * options.h (class General_options): Add -z lazy and -z now. Sort
10517 -z options into alphabetical order.
10518 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
10519
cd6739a1 105202009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
10521
10522 * layout.cc (Layout::make_output_section): Call
10523 Target::new_output_section.
10524 (Layout::attach_allocated_section_to_segment): Put large section
10525 sections in a separate load segment with the large segment flag
10526 set.
10527 (Layout::segment_precedes): Sort large data segments after other
10528 load segments.
10529 (align_file_offset): New static function.
10530 (Layout::set_segment_offsets): Use align_file_offset.
10531 * output.h (class Output_section): Add is_small_section_ and
10532 is_large_section_ fields.
10533 (Output_section::is_small_section): New function.
10534 (Output_section::set_is_small_section): New function.
10535 (Output_section::is_large_section): New function.
10536 (Output_section::set_is_large_section): New function.
10537 (Output_section::is_large_data_section): New function.
10538 (class Output_segment): Add is_large_data_segment_ field.
10539 (Output_segment::is_large_data_segment): New function.
10540 (Output_segment::set_is_large_data_segment): New function.
10541 * output.cc (Output_section::Output_section): Initialize new
10542 fields.
10543 (Output_segment::Output_segment): Likewise.
10544 (Output_segment::add_output_section): Add assertion that large
10545 data sections always go in large data segments. Force small data
10546 sections to the end of the list of data sections. Force small BSS
10547 sections to the start of the list of BSS sections. For large BSS
10548 sections to the end of the list of BSS sections.
10549 * symtab.h (class Symbol): Declare is_common_shndx.
10550 (Symbol::is_defined): Check Symbol::is_common_shndx.
10551 (Symbol::is_common): Likewise.
10552 (class Symbol_table): Define enum Commons_section_type. Update
10553 declarations. Add small_commons_ and large_commons_ fields.
10554 * symtab.cc (Symbol::is_common_shndx): New function.
10555 (Symbol_table::Symbol_table): Initialize new fields.
10556 (Symbol_table::add_from_object): Put small and large common
10557 symbols in the right list.
10558 (Symbol_table::sized_finalized_symbol): Check
10559 Symbol::is_common_shndx.
10560 (Symbol_table::sized_write_globals): Likewise.
10561 * common.cc (Symbol_table::do_allocate_commons): Allocate new
10562 common symbol lists. Don't call do_allocate_commons_list if the
10563 list is empty.
10564 (Symbol_table::do_allocate_commons_list): Remove is_tls
10565 parameter. Add comons_section_type parameter. Change all
10566 callers. Handle small and large common symbols.
10567 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
10568 Symbol::is_common_shndx.
10569 * resolve.cc (symbol_to_bits): Likewise.
10570 * target.h (Target::small_common_shndx): New function.
10571 (Target::small_common_section_flags): New function.
10572 (Target::large_common_shndx): New function.
10573 (Target::large_common_section_flags): New function.
10574 (Target::new_output_section): New function.
10575 (Target::Target_info): Add small_common_shndx, large_common_shndx,
10576 small_common_section_flags, and large_common_section_flags
10577 fields.
10578 (Target::do_new_output_section): New virtual function.
10579 * arm.cc (Target_arm::arm_info): Initialize new fields.
10580 * i386.cc (Target_i386::i386_info): Likewise.
10581 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
10582 Likewise.
10583 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
10584 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
10585 (Target_x86_64::do_new_output_section): New function.
10586 * configure.ac: Define conditional MCMODEL_MEDIUM.
10587 * testsuite/Makefile.am (check_PROGRAMS): Add large.
10588 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
10589 (large_LDFLAGS): Define.
10590 * testsuite/large.c: New file.
10591 * testsuite/testfile.cc (Target_test::test_target_info):
10592 Initialize new fields.
10593 * configure, testsuite/Makefile.in: Rebuild.
10594
bb04269c
DK
105952009-06-05 Doug Kwan <dougkwan@google.com>
10596
10597 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 10598 * Makefile.in: Regenerate.
bb04269c
DK
10599 * i386.cc (class Target_i386): Define new virtual method to
10600 override do_is_local_label_name in parent.
10601 * object.cc (Sized_relobj::do_count_local_symbols): Discard
10602 local symbols if --discard-locals or -X is given.
10603 * options.h (class General_options): Declare new options
10604 '--discard-locals' and '-X' for discarding locals.
10605 * target.h (class Target): Define new methods is_local_label_name.
10606 Declare new virtual method do_is_local_label_name.
10607 * target.cc: New file.
10608 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
10609 (check_SCRIPTS): Add discard_locals_test.sh.
10610 (check_DATA): Add discard_local_tests.syms.
10611 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
10612 (discard_local_tests.syms, discard_locals_test.o): New make rules.
10613 * testsuite/Makefile.in: Regenerate.
10614 * testsuite/discard_locals_test.c: New file.
10615 * testsuite/discard_locals_test.sh: Same.
10616
805bb01c
DK
106172009-06-05 Doug Kwan <dougkwan@google.com>
10618
10619 * object.cc (Sized_relobj::Sized_relobj): Initialize
10620 discarded_eh_frame_shndx_ to -1U.
10621 (Sized_relobj::do_layout): Record index of a discard .eh_frame
10622 section.
10623 (Sized_relobj::do_count_local_symbols): Skip local symbols in
10624 a discarded .eh_frame section.
10625 (Sized_relobj::do_finalize_local_symbols): Ditto.
10626 * object.h (class Sized_relobj): Declare new member
10627 discarded_eh_frame_shndx_.
10628 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
10629 (local_labels_test.o, local_labels_test): New rules.
10630 * testsuite/Makefile.in: Regenerate.
10631
1dcd334d
DK
106322009-06-04 Doug Kwan <dougkwan@google.com>
10633
10634 * layout.cc (Layout::section_name_mapping): Add mapping for
10635 special ARM sections.
10636
96d49306
DK
106372009-06-03 Doug Kwan <dougkwan@google.com>
10638
10639 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
10640 (utils::has_overflow): Same.
10641
dff16297
ILT
106422009-06-03 Ian Lance Taylor <iant@google.com>
10643
10644 * layout.cc (Layout::section_name_mapping): New array, replacing
10645 Layout::linkonce_mapping.
10646 (Layout::section_name_mapping_count): New variable, replacing
10647 Layout::linkonce_mapping_count.
10648 (Layout::linkonce_output_name): Remove.
10649 (Layout::output_section_name): Rewrite.
10650 * layout.h (class Layout): Rename Linkonce_mapping to
10651 Section_name_mapping, linkonce_mapping to section_name_mapping,
10652 linkonce_mapping_count to section_name_mapping_count. Don't
10653 declare linkonce_output_name.
10654
c121c671
DK
106552009-06-03 Doug Kwan <dougkwan@google.com>
10656
10657 * gold/arm.cc (namespace utils): New.
10658 (Target_arm::reloc_is_non_pic): Define new method.
10659 (class Arm_relocate_functions): New.
10660 (Target_arm::Relocate::relocate): Handle relocation types used by
10661 Android.
10662
07800fab
ILT
106632009-06-03 Ian Lance Taylor <iant@google.com>
10664
10665 * arm.cc (Target_arm::scan::global): Use || instead of |.
10666
c121c671
DK
106672009-06-02 Doug Kwan <dougkwan@google.com>
10668
10669 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
10670 issued_non_pic_error_.
10671 (class Target_arm::Scan): Declare new method check_non_pic.
10672 Define new method symbol_needs_plt_entry.
10673 Declare new data member issued_non_pic_error_.
10674 (class Target_arm::Relocate): Declare new method
10675 should_apply_static_reloc.
10676 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
10677 (Target_arm::Scan::check_non_pic): Define new method.
10678 (Target_arm::Scan::local): Handle a small subset of reloc types used
10679 by Android.
10680 (Target_arm::Scan::local): Same.
10681 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
10682
b19b0c6d
ILT
106832009-05-31 Mikolaj Zalewski <mikolajz@google.com>
10684
10685 * incremental.cc (Incremental_inputs::report_command_line): Filter
10686 out --incremental-* options.
10687
94cdfcff
DK
106882009-05-29 Doug Kwan <dougkwan@google.com>
10689
10690 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
10691 template class.
10692 (class Target_arm): Update comment.
10693 (Target_arm::Target_arm): Initialize new data members GOT_,
10694 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
10695 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
10696 and Target_arm::rel_dyn_section.
10697 Declare new_enum Target_arm::Got_type.
10698 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
10699 and DYNBSS_.
10700 Update commments for member do_dynsym_value.
10701 (Target_arm::got_size, Target_arm::plt_section,
10702 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
10703 new methods inside class defintion.
10704 (Target_arm::got_section): Define new method.
10705 (Target_arm::rel_dyn_section): Same.
10706 (Output_data_plt_arm): New template class.
10707 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
10708 (Output_data_plt_arm:do_adjust_output_section): Define new method.
10709 (Output_data_plt_arm::add_entry): Same.
10710 (Output_data_plt_arm::first_plt_entry): Define new
10711 static data member for PLT instruction template.
10712 (Output_data_plt_arm::plt_entry): Same.
10713 (Output_data_plt_arm::do_write): Define new method.
10714 (Target_arm::make_plt_entry): Same.
10715 (Target_arm::do_finalize_sections): Same.
10716 (Target_arm::do_dynsym_value): Same.
10717
4a657b0d
DK
107182009-05-28 Doug Kwan <dougkwan@google.com>
10719
10720 * Makefile.am (TARGETSOURCES): Add arm.cc.
10721 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
10722 * Makefile.in: Regenerate.
10723 * arm.cc: New file.
10724 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
10725
e7ae8c36
DK
107262009-05-26 Doug Kwan <dougkwan@google.com>
10727
10728 * options.cc (General_options::parse_exclude_libs). Fix a comment.
10729 (General_options::check_excluded_libs): Strip off directories in
10730 archive name before matching like GNU ld does.
10731 * testsuite/Makefile.am (MOSTLYCLEANFILES,
10732 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
10733 (exclude_libs_test_LDFLAGS): Add linker option
10734 -Wl,--exclude-libs,libexclude_libs_test_3
10735 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
10736 an explicit archive without using -l.
10737 (alt/libexclude_libs_test_3.a): New make rule.
10738 * testsuite/Makefile.in: Regenerate.
10739 * testsuite/exclude_libs_test.c : Declare lib3_default().
10740 (main): Call it.
10741 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
10742 * exclude_libs_test_3.c: New file.
10743
f12e7348
NC
107442009-05-26 Nick Clifton <nickc@redhat.com>
10745
10746 * po/id.po: New Indonesian translation.
10747 * po/gold.pot: Updated template file.
10748
4daadc0d
ST
107492009-05-22 Sriraman Tallam <tmsriram@google.com>
10750
e1df38aa 10751 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
10752 gc_comdat_test files. Add -Wl,--gc-sections to build
10753 gc_comdat_test.
10754 * testsuite/Makefile.in: Regenerate.
10755 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
10756
531813ad
ST
107572009-05-21 Sriraman Tallam <tmsriram@google.com>
10758
10759 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
10760 kept comdat section was garbage collected.
10761 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
10762 * testsuite/Makefile.in: Regenerate.
10763 * testsuite/gc_comdat_test.sh: New file.
10764 * testsuite/gc_comdat_test_1.cc: New file.
10765 * testsuite/gc_comdat_test_2.cc: New file.
10766
65514900
CC
107672009-05-19 Doug Kwan <dougkwan@google.com>
10768
10769 * archive.cc (Archive::Archive): Move constructor from archive.h
10770 to here. Initialize no_export_.
10771 (Archive::get_elf_object_for_member): Set no_export flag of object.
10772 * archive.h (Archive::Archive): Move constructor body to
10773 archive.cc.
10774 (Archive::no_export): New method.
10775 (Archive::no_export_): New field.
10776 * object.h (Object::Object): Initialize no_export_ to false.
10777 (Object::no_export, Object::set_no_export): New methods.
10778 (Object::no_export_): New field.
10779 * options.cc (General_options::parse_exclude_libs): New method.
10780 (General_options::check_excluded_libs) Same.
10781 * options.h (exclude_libs): New option.
10782 (General_options::check_excluded_libs): New method declaration.
10783 (General_options::excluded_libs_): New field.
10784 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
10785 default or protected visibility if an object has no-export flag set.
10786 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
10787 (check_SCRIPTS): Add exclude_libs_test.sh.
10788 (check_DATA): Add exclude_libs_test.syms.
10789 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
10790 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
10791 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
10792 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
10793 (exclude_libs_test.syms, libexclude_libs_test_1.a,
10794 libexclude_libs_test_2.a): New rules.
10795 * testsuite/Makefile.in: Regenerate.
10796 * testsuite/exclude_libs_test.c: New file.
10797 * testsuite/exclude_libs_test.sh: Ditto.
10798 * testsuite/exclude_libs_test_1.c: Ditto.
10799 * testsuite/exclude_libs_test_2.c: Ditto.
10800
1b77ea50
ILT
108012009-05-15 Ian Lance Taylor <iant@google.com>
10802
10803 * configure.ac: Check for declarations for cases where libiberty.h
10804 checks HAVE_DECL_xxx.
10805 * configure, config.in: Rebuild.
10806
072fe7ce
ILT
108072009-05-15 Mikolaj Zalewski <mikolajz@google.com>
10808
10809 * gold.h (Incremental_argument_list): Remove (invalid) forward
10810 declaration.
10811 * incremental.cc (Incremental_inputs::report_achive): New method.
10812 (Incremental_inputs::report_object): New method.
10813 (Incremental_inputs::report_script): New method.
10814 (Incremental_inputs::finalize_inputs): New method.
10815 (Incremental_inputs::finalize): Call finalize_inputs().
10816 (Incremental_inputs::sized_create_incremental_inputs_section_data):
10817 Create inputs entries.
10818 * incremental.h (Incremental_input_type): New enum.
10819 (Incremental_inputs::Incremental_input): Initialize new fields.
10820 (Incremental_inputs::report_inputs): New method.
10821 (Incremental_inputs::report_achive): New method.
10822 (Incremental_inputs::report_object): New method.
10823 (Incremental_inputs::report_script): New method.
10824 (Incremental_inputs::finalize_inputs): New method.
10825 (Incremental_inputs::Input_info): New struct.
10826 (Incremental_inputs::Input_info_map): New typedef.
10827 (Incremental_inputs::lock_): New field.
10828 (Incremental_inputs::Inputs_): New field.
10829 (Incremental_inputs::Inputs_map): New field.
10830 * main.cc (main): Call Incremental_input::report_inputs.
10831 * options.h (Input_argument_list): Typedef moved from
10832 Input_arguments.
10833 (Input_file_group::Files): Remove, use ::Input_argument_list.
10834 (Input_file_group::Input_argument_list): Remove, use
10835 ::Input_argument_list.
10836 * plugin.cc (Plugin_manager::add_input_file): Add error in
10837 incremental build.
10838 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
10839 functions.
10840 * script.cc (read_input_script): Call
10841 Incremental_input::report_script.
10842 * script.h (Script_info): New class.
10843
b0481b0b
ILT
108442009-04-27 Ian Lance Taylor <iant@google.com>
10845
10846 * x86_64.cc (do_adjust_output_section): Set entsize to
10847 plt_entry_size.
10848
b22a5a41 108492009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
10850
10851 * output.cc (Output_file::close): After short writes, continue
10852 writing from the correct offset in the buffer being written.
10853
40fde488
CD
108542009-04-23 Chris Demetriou <cgd@google.com>
10855
10856 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
10857 * configure: Regenerate.
10858 * config.in: Regenerate.
10859 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
10860 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
10861
3ce2c28e
ILT
108622009-04-21 Mikolaj Zalewski <mikolajz@google.com>
10863
10864 * incremental.cc (Incremental_inputs_header_data): Renamed from
10865 Incremental_input_header_data.
10866 (Incremental_inputs_header_data::data_size): New field.
10867 (Incremental_inputs_header_data::put_input_file_count): Renamed
10868 from input_file_count.
10869 (Incremental_inputs_header_data::put_command_line_offset): Renamed
10870 from command_line_offset.
10871 (Incremental_inputs_header_data::put_reserved): Renamed from
10872 put_reserved.
10873 (Incremental_inputs_entry_data): Renamed from
10874 Incremental_input_entry_data.
10875 (Incremental_inputs_entry_data::data_size): New field.
10876 (Incremental_inputs::report_command_line): New method.
10877 (Incremental_inputs::finalize): New method.
10878 (Incremental_inputs::create_incremental_inputs_data): New method.
10879 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
10880 * incremental.h: New file.
10881 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 10882 (Layout::finalize): Create incremental inputs section in
3ce2c28e 10883 incremental builds.
703d02da 10884 (Layout::create_incremental_info_sections): New method.
3ce2c28e 10885 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
10886 (Layout::create_incremental_info_sections): New method.
10887 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
10888 * main.cc (main): Notify Incremental_input of the command line.
10889
e55bde5e
ILT
108902009-04-01 Ian Lance Taylor <iant@google.com>
10891 Mikolaj Zalewski <mikolajz@google.com>
10892
10893 * gold.h (reserve_unordered_map): Define, three versions, one for
10894 each version of Unordered_map.
10895 * layout.cc (Layout::Layout): Remove options parameter. Add
10896 number_of_input_files parameter. Don't initialize options_.
10897 Initialize number_of_input_files_ and resized_signatures_. Move
10898 sections_are_attached_.
10899 (Layout::layout_group): Reserve space for group_signatures_.
10900 (Layout::find_or_add_kept_section): Change name parameter to be a
10901 reference. Resize signatures_ map when it gets large enough.
10902 (Layout::layout_eh_frame): Use parameters->options() instead of
10903 this->options_.
10904 (Layout::make_output_section): Likewise.
10905 (Layout::attach_allocated_section_to_segment): Likewise.
10906 (Layout::finalize, Layout::create_executable_stack): Likewise.
10907 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
10908 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
10909 * layout.h (class Layout): Update declarations. Remove options_
10910 field. Add number_of_input_files_ and resized_signatures_
10911 fields. Move sections_are_attached_ field.
10912 * main.cc (main): Pass number of input files to Layout
10913 constructor. Don't pass options.
10914
154b857c
ILT
109152009-03-30 Ian Lance Taylor <iant@google.com>
10916
10917 * ffsll.c (ffsll): Correct implementation.
10918
2f35ab9b
ILT
109192009-03-27 Ian Lance Taylor <iant@google.com>
10920
fd03461a
ILT
10921 * ffsll.c: New file.
10922 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
10923 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
10924 * ftruncate.c (ftruncate): Declare before definition.
10925 * mremap.c (mremap): Likewise.
10926 * pread.c (pread): Likewise.
10927 * configure, Makefile.in, config.in: Rebuild.
10928
2f35ab9b
ILT
10929 * mremap.c: New file.
10930 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
10931 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
10932 (mremap): Declare if HAVE_MREMAP is not defined.
10933 * configure, Makefile.in, config.in: Rebuild.
10934
33aea2fd
CC
109352009-03-27 Cary Coutant <ccoutant@google.com>
10936
10937 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
10938 position independent.
10939 * sparc.cc (Target_sparc::check_non_pic): Likewise.
10940 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
10941
6d479619
CC
109422009-03-24 Cary Coutant <ccoutant@google.com>
10943
10944 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
10945 an executable.
10946 (needs_dynamic_reloc): Likewise.
10947
afc06bb8
ILT
109482009-03-24 Ian Lance Taylor <iant@google.com>
10949
10950 * yyscript.y (file_cmd): Recognize EXTERN.
10951 (extern_name_list, extern_name_list_body): New nonterminals.
10952 * script.cc (script_add_extern): Define.
10953 * script-c.h (script_add_extern): Declare.
10954
f6060a4d
ILT
109552009-03-24 Rafael Avila de Espindola <espindola@google.com>
10956
10957 * object.cc (is_elf_object): Define.
10958 * object.h (is_elf_object): Declare.
10959 * archive.cc (Archive::get_elf_object_for_member): Call
10960 is_elf_object.
33aea2fd 10961 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 10962
26736d8e
ILT
109632009-03-24 Elliott Hughes <enh@google.com>
10964
10965 * output.cc (Output_file::map_anonymous): Define.
10966 (Output_file::map): Use map_anonymous. If the regular mmap fails,
10967 try an anonymous one. Report the size if the mmap fails.
10968 * output.h (class Output_file): Declare map_anonymous.
10969
22fd9730
ILT
109702009-03-24 Ian Lance Taylor <iant@google.com>
10971
10972 * target-select.cc (instantiate_target): Don't acquire the lock if
10973 the instantiated_target_ field has already been set.
10974
cb010894
ILT
109752009-03-23 Ian Lance Taylor <iant@google.com>
10976
7f055c20
ILT
10977 * gold-threads.h (class Initialize_lock): Define.
10978 * gold-threads.cc (class Initialize_lock_once): Define.
10979 (initialize_lock_control): New static variable.
10980 (initialize_lock_pointer): New static variable.
10981 (initialize_lock_once): New static function.
10982 (Initialize_lock::Initialize_lock): Define.
10983 (Initialize_lock::initialize): Define.
10984 * target-select.h: Include "gold-threads.h".
10985 (class Target_selector): Add lock_ and initialize_lock_ fields.
10986 Don't define instantiate_target, just declare it.
10987 * target-select.cc (Target_selector::Target_selector): Initialize
10988 new fields.
10989 (Target_selector::instantiate_target): Define.
10990 * descriptors.h: Include "gold-threads.h".
10991 (class Descriptors): Add initialize_lock_ field.
10992 * descriptors.cc (Descriptors::Descriptors): Initialize new
10993 field.
10994 (Descriptors::open): Use initialize_lock_ field
10995 * errors.h (class Errors): Add initialize_lock_ field.
10996 * errors.cc (Errors::Errors): Initialize new field.
10997 (Errors::initialize_lock): Use initialize_lock_ field.
10998 * powerpc.cc (class Target_selector_powerpc): Remove
10999 instantiated_target_ field. In do_recognize call
11000 instantiate_target rather than do_instantiate_target. In
11001 do_instantiate_target just allocate a new target.
11002 * sparc.cc (class Target_selector_sparc): Likewise.
11003
36959681
ILT
11004 * freebsd.h: New file.
11005 * i386.cc: Include "freebsd.h".
11006 (Target_i386): Derive from Target_freebsd rather than
11007 Sized_target.
11008 (Target_selector_i386): Derive from Target_selector_freebsd rather
11009 than Target_selector.
11010 * x86_64.cc: Include "freebsd.h".
11011 (Target_x86_64): Derive from Target_freebsd rather than
11012 Sized_target.
11013 (Target_selector_x86_64): Derive from Target_selector_freebsd
11014 rather than Target_selector.
11015 * target.h (class Target): Add adjust_elf_header and
11016 do_adjust_elf_header.
11017 * output.cc (Output_file_header:: do_sized_write): Call target
11018 adjust_elf_header routine.
11019 * configure.tgt: Set targ_osabi.
11020 * configure.ac: Define GOLD_DEFAULT_OSABI.
11021 * parameters.cc (Parameters::default_target): Pass
11022 GOLD_DEFAULT_OSABI to select_target.
11023 * target-select.h (class Target_selector): Make instantiate_target
11024 protected rather than private.
11025 * Makefile.am (HFILES): Add freebsd.h.
11026 * configure, Makefile.in, config.in: Rebuild.
11027
cb010894
ILT
11028 * merge.cc (do_add_input_section): Correct pend value. Change
11029 message about last entry not being null terminated from error to
11030 warning.
11031
0e879927
ILT
110322009-03-20 Mikolaj Zalewski <mikolajz@google.com>
11033
11034 * incremental.cc: New file.
11035 * Makefile.am (CCFILES): Add incremental.cc.
11036 * Makefile.in: Rebuild.
11037
41105937
PP
110382009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
11039
11040 * layout.cc (Layout::output_section_name): Preserve names
11041 of '.note.' sections.
e1df38aa 11042
60439920
ILT
110432009-03-19 Ian Lance Taylor <iant@google.com>
11044
11045 * descriptors.cc (Descriptors::open): Check that the options are
11046 valid before using them.
11047
0d371ad3
ILT
110482009-03-18 Ian Lance Taylor <iant@google.com>
11049
11050 * script-sections.h: Include <list>.
11051 (class Script_sections): Change Sections_elements from std::vector
11052 to std::list. Typedef public Elements_iterator. Add
11053 orphan_section_placement_, data_segment_align_start_, and
11054 saw_data_segment_align_ fields. Remove data_segment_align_index_
11055 field.
11056 * script-sections.cc (class Orphan_section_placement): New class.
11057 (class Sections_element): Add virtual functions is_relro and
11058 orphan_section_init. Remove virtual function place_orphan_here.
11059 (class Output_section_definition): Add is_relro and
11060 orphan_section_init. Remove place_orphan_here.
11061 (class Orphan_output_section): Likewise.
11062 (Script_sections::Script_sections): Update for field changes.
11063 (Script_sections::data_segment_align): Set saw_data_segment_align_
11064 and data_segment_align_start_, not data_segment_align_index.
11065 (Script_sections::data_segment_relro_end): Check
11066 saw_data_segment_align_. Use data_segment_align_start_ rather
11067 than data_segment_align_index_.
11068 (Script_sections::place_orphan): Rewrite to use
11069 Orphan_section_placement.
11070
9201d894
ILT
110712009-03-17 Ian Lance Taylor <iant@google.com>
11072
9c5b8369
ILT
11073 * archive.cc (Archive::add_symbols): Check for a version attached
11074 to the symbol name in the archive map.
11075 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
11076 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
11077 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
11078 (ver_test_11.a): New target.
11079 * testsuite/Makefile.in: Rebuild.
11080
9201d894
ILT
11081 * configure.ac: Check for chsize and posix_fallocate. Replace
11082 ftruncate.
11083 * ftruncate.c: New file, from gnulib.
11084 * output.cc (posix_fallocate): Define dummy version if not
11085 HAVE_POSIX_FALLOCATE.
11086 (Output_file::map): Call posix_fallocate rather than lseek and
11087 write.
11088 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
11089 * configure, Makefile.in, config.in: Rebuild.
11090
ef4ab7a8 110912009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 11092
ef4ab7a8
PP
11093 * layout.h (Layout::create_note): Add section_name parameter.
11094 * layout.cc (Layout::create_note): Likewise.
11095 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 11096
8c500701
ILT
110972009-03-17 Ian Lance Taylor <iant@google.com>
11098
e85b18e1
ILT
11099 * descriptors.cc: Include "options.h".
11100 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
11101 (Descriptors::open): Always use O_CLOEXEC when opening a new
11102 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
11103 then set FD_CLOEXEC.
11104
9efe6174
ILT
11105 * sparc.cc (class Target_sparc): Add has_got_section.
11106 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
11107 make sure we have a GOT section.
11108
11109 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
11110 (Target_sparc::Scan::local): Likewise.
11111 (Target_sparc::Scan::global): Likewise.
11112 (Target_sparc::Relocate::relocate): Likewise.
11113 (Target_sparc::Relocate::relocate_tls): Likewise.
11114
8c500701
ILT
11115 * symtab.cc (Symbol_table::define_default_version): New function,
11116 broken out of add_from_object.
11117 (Symbol_table::add_from_object): Call define_default_version.
11118 (Symbol_table::define_special_symbol): Add resolve_oldsym
11119 parameter. Change all callers. If the version for a symbol comes
11120 from a version script, resolve it with the symbol with the same
11121 name with no version. Also add the symbol without a version if
11122 appropriate.
11123 (do_define_in_output_data): If resolving with oldsym, don't delete
11124 sym.
11125 (do_define_in_output_segment): Likewise.
11126 (do_define_as_constant): Likewise.
11127 * symtab.h (class Symbol_table): Update declarations.
11128
f1ed28fb
ILT
111292009-03-13 Ian Lance Taylor <iant@google.com>
11130
15f8229b
ILT
11131 * readsyms.cc (Read_symbols::incompatible_warning): New function.
11132 (Read_symbols::requeue): New function.
11133 (Read_symbols::do_read_symbols): If make_elf_object fails because
11134 the target type is not configured, and the file was searched for,
11135 issue a warning and retry with the next directory.
11136 (Add_symbols::run): If the file has an incompatible format, and
11137 it was searched for, requeue the Read_symbols task. On error,
11138 release the object.
11139 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
11140 dirindex parameter to constructor. Change all callers. Declare
11141 incompatible_warning and requeue.
11142 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
11143 input_argument_ and input_group_ fields. Add them to
11144 constructor. Change all callers.
11145 (class Read_script): Add dirindex_ field. Add it to constructor.
11146 Change all callers.
11147 * archive.cc (Archive::setup): Remove input_objects parameter.
11148 Change all callers.
11149 (Archive::get_file_and_offset): Likewise.
11150 (Archive::read_all_symbols): Likewise.
11151 (Archive::read_symbols): Likewise.
11152 (Archive::get_elf_object_for_member): Remove input_objects
11153 parameter. Add punconfigured parameter. Change all callers.
11154 (Archive::add_symbols): Change return type to bool. Check return
11155 value of include_member.
11156 (Archive::include_all_members): Likewise.
11157 (Archive::include_member): Change return type to bool. Return
11158 false if first included object has incompatible target. Set
11159 included_member_ field.
11160 (Add_archive_symbols::run): If add_symbols returns false, requeue
11161 Read_symbols task.
11162 * archive.h (class Archive): Add included_member_ field.
11163 Initialize it in constructor. Add input_file and searched_for
11164 methods. Update declarations.
11165 (class Add_archive_symbols): Add dirpath_, dirindex_, and
11166 input_argument_ fields. Add them to constructor. Change all
11167 callers.
11168 * script.cc: Include "target-select.h".
11169 (class Parser_closure): Add skip_on_incompatible_target_ and
11170 found_incompatible_target_ fields. Add
11171 skip_on_incompatible_target parameter to constructor. Change all
11172 callers. Add methods skip_on_incompatible_target,
11173 clear_skip_on_incompatible_target, found_incompatible_target, and
11174 set_found_incompatible_target.
11175 (read_input_script): Add dirindex parameter. Change all callers.
11176 If parser finds an incompatible target, requeue Read_symbols
11177 task.
11178 (script_set_symbol): Clear skip_on_incompatible_target in
11179 closure.
11180 (script_add_assertion, script_parse_option): Likewise.
11181 (script_start_sections, script_add_phdr): Likewise.
11182 (script_check_output_format): New function.
11183 * script.h (read_input_script): Update declaration.
11184 * script-c.h (script_check_output_format): Declare.
11185 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
11186 (ignore_cmd): Remove OUTPUT_FORMAT.
11187 * fileread.cc (Input_file::Input_file): Add explicit this.
11188 (Input_file::will_search_for): New function.
11189 (Input_file::open): Add pindex parameter. Change all callers.
11190 * fileread.h (class Input_file): Add input_file_argument method.
11191 Declare will_search_for. Update declarations.
11192 * object.cc (make_elf_object): Add punconfigured parameter.
11193 Change all callers.
11194 * object.h (class Object): Make input_file public. Add
11195 searched_for method.
11196 (make_elf_object): Update declaration.
11197 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
11198 restart search.
11199 * dirsearch.h (class Dirsearch): Update declaration.
11200 * options.h (class General_options): Add --warn-search-mismatch.
11201 * parameters.cc (Parameters::is_compatible_target): New function.
11202 * parameters.h (class Parameters): Declare is_compatible_target.
11203 * workqueue.cc (Workqueue::add_blocker): New function.
11204 * workqueue.h (class Workqueue): Declare add_blocker.
11205
f1ed28fb
ILT
11206 * fileread.cc (Input_file::open): Remove options parameter.
11207 Change all callers.
11208 (Input_file::open_binary): Likewise.
11209 * script.cc (read_input_script): Likewise.
11210 * readsyms.h (class Read_symbols): Remove options_ field. Remove
11211 options parameter from constructor. Change all callers.
11212 (class Read_script): Likewise.
11213 * fileread.h (class Input_file): Update declarations.
11214 * script.h (read_input_script): Update declaration.
11215
34dd024a
NC
112162009-03-10 Nick Clifton <nickc@redhat.com>
11217
11218 * po/es.po: New Spanish translation.
11219
6d71b17c
CC
112202009-03-06 Cary Coutant <ccoutant@google.com>
11221
11222 * options.cc (parse_short_option): Keep dash_z from registering itself.
11223
031cdbed
ILT
112242009-03-03 Ian Lance Taylor <iant@google.com>
11225
11226 PR 9918
11227 * target-reloc.h (relocate_section): Pass output_section to
11228 relocate.
11229 * i386.cc (Target_i386::should_apply_static_reloc): Add
11230 output_section parameter. Change all callers.
11231 (Target_i386::Relocate::relocate): Add output_section parameter.
11232 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
11233 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
11234 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
11235 * testsuite/two_file_shared.sh: New script.
11236 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
11237 (check_DATA): Add two_file_shared.dbg.
11238 (two_file_shared.dbg): New target.
11239 * testsuite/Makefile.in: Rebuild.
11240
15d5fa16
ILT
112412009-03-01 Ian Lance Taylor <iant@google.com>
11242
11243 * configure.ac: Check for byteswap.h.
11244 * configure: Rebuild.
11245 * config.in: Rebuild.
11246
8a4c0b0d
ILT
112472009-03-01 Mikolaj Zalewski <mikolajz@google.com>
11248
11249 * layout.cc (Layout::find_or_add_kept_section): New function.
11250 (Layout::add_comdat): Removed.
11251 * layout.h (struct Kept_section): Move out of class Layout.
11252 Remove trailing underscores from field names. Add group_sections
11253 field. Rename group_ field to is_group. Change all uses.
11254 (class Layout): Declare find_or_add_kept_section, not add_comdat.
11255 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
11256 comdat_groups_ field.
11257 (Sized_relobj::include_section_group): Use
11258 find_or_add_kept_section and Kept_section::group_sections.
11259 (Sized_relobj::include_linkonce_section): Likewise.
11260 * object.cc (class Sized_relobj): Don't define Comdat_group or
11261 Comdat_group_table. Remove find_comdat_group and
11262 add_comdat_group. Remove comdat_groups_ field.
11263 * plugin.cc (include_comdat_group): Use
11264 Layout::find_or_add_kept_section.
11265
b4ecf66b
ILT
112662009-02-28 Ian Lance Taylor <iant@google.com>
11267
14359ca0
ILT
11268 * README: --gc-sections and map files are now supported. Document
11269 some build requirements.
11270
b4ecf66b
ILT
11271 PR 6992
11272 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
11273 relocatable link set the value of the section symbol to zero.
11274 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
11275 relocatable link don't include the section address in the local
11276 symbol value.
11277
0602e05a
ILT
112782009-02-27 Ian Lance Taylor <iant@google.com>
11279
fd9d194f
ILT
11280 PR 6811
11281 * options.h (class Search_directory): Add is_system_directory.
11282 (class General_options): Declare is_in_system_directory.
11283 * options.cc (get_relative_sysroot): Make static.
11284 (get_default_sysroot): Make static.
11285 (General_optoins::is_in_system_directory): New function.
11286 * fileread.cc (Input_file::is_in_system_directory): New function.
11287 * fileread.h (class Input_file): Declare is_in_system_directory.
11288 * object.h (class Object): Add is_in_system_directory.
11289 (class Input_objects): Remove system_library_directory_ field.
11290 * object.cc (Input_objects::add_object): Don't set
11291 system_library_directory_.
11292 (input_objects::found_in_system_library_directory): Remove.
11293 * symtab.cc (Symbol_table::write_globals): Remove input_objects
11294 parameter. Change all callers.
11295 (Symbol_table::sized_write_globals): Likewise.
11296 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
11297 Call Object::is_in_system_directory.
11298 * symtab.h (class Symbol_table): Update declarations.
11299
61edd21f
ILT
11300 PR 5990
11301 * descriptors.h (Open_descriptor): Add is_on_stack field.
11302 * descriptors.cc (Descriptors::open): If the descriptor is on the
11303 top of the stack, remove it. Initialize is_on_stack field.
11304 (Descriptors::release): Only add pod to stack if it is not on the
11305 stack already.
11306 (Descriptors::close_some_descriptor): Clear stack_next and
11307 is_on_stack fields.
11308
e29e076a
ILT
11309 PR 7091
11310 * output.cc (Output_section::find_starting_output_address): Rename
11311 from starting_output_address; add PADDR parameter; change return
11312 type.
11313 * output.h (class Output_section): Declare
11314 find_starting_output_address instead of starting_output_address.
11315 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
11316 section symbol for which we can't find a merge section.
11317
0602e05a
ILT
11318 PR 9836
11319 * symtab.cc (Symbol_table::add_from_object): If the visibility is
11320 hidden or internal, force the symbol to be local.
11321 * resolve.cc (Symbol::override_visibility): Define.
11322 (Symbol::override_base): Use override_visibility.
11323 (Symbol_table::resolve): Likewise.
11324 (Symbol::override_base_with_special): Likewise.
11325 (Symbol_table::override_with_special): If the visibility is hidden
11326 or internal, force the symbol to be local.
11327 * symtab.h (class Symbol): Add set_visibility and
11328 override_visibility.
11329 * testsuite/ver_test_1.sh: New file.
11330 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
11331 (check_DATA): Add ver_test_1.syms.
11332 (ver_test_1.syms): New target.
11333 * testsuite/Makefile.in: Rebuild.
11334
401a9a73
CC
113352009-02-25 Cary Coutant <ccoutant@google.com>
11336
11337 * layout.cc (Layout::choose_output_section): Don't rename sections
11338 when using a linker script that has a SECTIONS clause.
11339 * Makefile.in: Regenerate.
11340
11341 * testsuite/Makefile.am (script_test_5.sh): New test case.
11342 * testsuite/Makefile.in: Regenerate.
11343 * testsuite/script_test_5.cc: New file.
11344 * testsuite/script_test_5.sh: New file.
11345 * testsuite/script_test_5.t: New file.
11346
f488e4b0
CC
113472009-02-13 Rafael Avila de Espindola <espindola@google.com>
11348
11349 * archive.cc (Archive::include_member): Update calls to add_symbols.
11350 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
11351 the Layout argument.
11352 * dynobj.h (do_add_symbols): Add the Layout argument.
11353 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
11354 Layout argument.
11355 * object.h (Object::add_symbols): Add the Layout argument.
11356 (Object::do_add_symbols): Add the Layout argument.
11357 (Sized_relobj::do_add_symbols): Add the Layout argument.
11358 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
11359 Unify the two versions.
11360 (Add_plugin_symbols): Remove.
11361 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
11362 (Sized_pluginobj::do_add_symbols): Unify the two versions.
11363 (Add_plugin_symbols): Remove.
11364 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
11365 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
11366 (Add_symbols::run): Make it work with Pulginobj.
11367
89dd1680
ILT
113682009-02-06 Ian Lance Taylor <iant@google.com>
11369
11370 * object.cc (Sized_relobj::do_layout): Make info message start
11371 with lower case letter.
11372
266d0a74
ILT
113732009-02-06 Mikolaj Zalewski <mikolajz@google.com>
11374
602b464e
ILT
11375 * binary.cc: Fix file comment.
11376
266d0a74
ILT
11377 * options.h (enum Incremental_disposition): Define.
11378 (class General_options): Add new options: --incremental,
11379 --incremental_changed, --incremental_unchanged,
11380 --incremental_unknown. Add incremental_disposition_ and
11381 implicit_incremental_ fields.
11382 (General_options::incremental_disposition): New function.
11383 (class Position_dependent_options): Add incremental_disposition
11384 option.
11385 (Position_dependent_options::copy_from_options): Set incremental
11386 dispositions.
11387 * options.cc (General_options::parse_incremental_changed): New
11388 function.
2e702c99
RM
11389 (General_options::parse_incremental_unchanged): New function.
11390 (General_options::parse_incremental_unknown): New function.
11391 (General_options::General_options): Initialize new fields
266d0a74 11392 incremental_disposition_ and implicit_incremental_.
2e702c99 11393 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
11394 without --incremental.
11395
f073bbf7
CD
113962009-02-06 Chris Demetriou <cgd@google.com>
11397
11398 * gold.h (gold_undefined_symbol): Change to take only a Symbol
11399 pointer and to report location as the file name associated with
11400 the symbol.
11401 (gold_undefined_symbol_at_location): New function to replace the
11402 old gold_undefined_symbol functionality.
11403 * target-reloc.h (relocate_section): Update to use
11404 gold_undefined_symbol_at_location.
11405 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
11406 Call gold_undefined_symbol function rather than gold_error.
11407 * errors.h (Errors::undefined_symbol): Take location as a
11408 string, rather than calculating it from a relocation.
11409 * errors.cc (Errors::fatal): Print "fatal error:" before the
11410 formatted message.
11411 (Errors::error, Errors::error_at_location): Print "error: "
11412 before the formatted message.
11413 (Errors::undefined_symbol): Take location as a string, rather
11414 than calculating it from a relocation.
11415 (gold_undefined_symbol_at_location): New function akin to
11416 old gold_undefined_symbol, calculates location from relocation.
11417 (gold_undefined_symbol): Change to take only a Symbol pointer
11418 and to report location as the file name associated with the symbol.
11419 * testsuite/debug_msg.sh: Update for changed error messages.
11420 * testsuite/undef_symbol.sh: Likewise.
11421
8e94a90c
ILT
114222009-02-04 Duncan Sands <baldrick@free.fr>
11423
11424 PR 9812
11425 * reduced_debug_output.h
11426 (Output_reduced_debug_abbrev_section::failed): Use format for
11427 gold_warning.
11428 (Output_reduced_debug_info_section::faild): Likewise.
11429
88a0e15b
ILT
114302009-01-31 Mikolaj Zalewski <mikolajz@google.com>
11431
11432 * script.cc (Lazy_demangler): New class.
2e702c99 11433 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
11434 symbol only once.
11435
5efc7cd2
CC
114362009-01-29 Cary Coutant <ccoutant@google.com>
11437
11438 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
11439 to __tls_get_addr.
11440 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
11441
e0ebcf42
ILT
114422009-01-28 Ian Lance Taylor <iant@google.com>
11443
5efc7cd2 11444 * version.cc (version_string): Bump to 1.9.
75fe7426 11445
e0ebcf42
ILT
11446 * gold.h: Include <cstring> and <stdint.h>.
11447 * version.cc: Include <cstdio>.
11448 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
11449 warning.
11450 * reduced_debug_output.cc (insert_into_vector): Rename from
11451 Insert_into_vector; change all callers. Use Swap_unaligned to
11452 avoid aliasing issue; remove union since it is unnecessary.
11453
8e2813be 114542009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
11455
11456 * Makefile.am (CCFILES): Add gc.cc.
11457 (HFILES): Add gc.h.
11458 * Makefile.in: Regenerate.
11459 * gold.cc (Gc_runner): New class.
11460 (queue_initial_tasks): Call garbage collection related tasks
11461 when corresponding options are invoked.
11462 (queue_middle_gc_tasks): New function.
11463 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
11464 processed early before laying out sections during garbage collection.
11465 * gold.h (queue_middle_gc_tasks): New function.
11466 (is_prefix_of): Move from "layout.cc".
11467 * i386.cc (Target_i386::gc_process_relocs): New function.
11468 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
11469 * main.cc (main): Create object of class "Garbage_collection".
11470 * object.cc (Relobj::copy_symbols_data): New function.
11471 (Relobj::is_section_name_included): New function.
e1df38aa
NC
11472 (Sized_relobj::do_layout): Allow this function to be called twice
11473 during garbage collection and defer layout of section during the
6d03d481
ST
11474 first call.
11475 * object.h (Relobj::get_symbols_data): New function.
11476 (Relobj::is_section_name_included): New function.
11477 (Relobj::copy_symbols_data): New function.
11478 (Relobj::set_symbols_data): New function.
11479 (Relobj::get_relocs_data): New function.
11480 (Relobj::set_relocs_data): New function.
11481 (Relobj::is_output_section_offset_invalid): New pure virtual function.
11482 (Relobj::gc_process_relocs): New function.
11483 (Relobj::do_gc_process_relocs): New pure virtual function.
11484 (Relobj::sd_): New data member.
11485 (Sized_relobj::is_output_section_offset_invalid): New function.
11486 (Sized_relobj::do_gc_process_relocs): New function.
11487 * options.h (General_options::gc_sections): Modify to not be a no-op.
11488 (General_options::print_gc_sections): New option.
11489 * plugin.cc (Plugin_finish::run): Remove function call to
11490 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
11491 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
11492 * reloc.cc (Read_relocs::run): Add task to process relocs and
11493 determine unreferenced sections when doing garbage collection.
11494 (Gc_process_relocs): New class.
11495 (Sized_relobj::do_gc_process_relocs): New function.
11496 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
11497 sections that are garbage collected.
11498 * reloc.h (Gc_process_relocs): New class.
11499 * sparc.cc (Target_sparc::gc_process_relocs): New function.
11500 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
11501 symbols whose corresponding sections are garbage collected.
11502 (Symbol_table::Symbol_table): Add new parameter for the garbage
11503 collection object.
11504 (Symbol_table::gc_mark_undef_symbols): New function.
11505 (Symbol_table::gc_mark_symbol_for_shlib): New function.
11506 (Symbol_table::gc_mark_dyn_syms): New function.
11507 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
11508 as garbage.
11509 (Symbol_table::add_from_object): Likewise.
11510 (Symbol_table::add_from_relobj): When building shared objects, do not
11511 treat externally visible symbols as garbage.
11512 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
11513 table information for static and relocatable links.
11514 * symtab.h (Symbol_table::set_gc): New function.
11515 (Symbol_table::gc): New function.
11516 (Symbol_table::gc_mark_undef_symbols): New function.
11517 (Symbol_table::gc_mark_symbol_for_shlib): New function.
11518 (Symbol_table::gc_mark_dyn_syms): New function.
11519 (Symbol_table::gc_): New data member.
e1df38aa 11520 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
11521 function.
11522 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
11523 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
11524
3b293544
CF
115252009-01-20 Chris Faylor <me.sourceware@sourceware.org>
11526
11527 * options.h (General_options::gc_sections): Define as a no-op for now.
11528 (General_options::no_keep_memory): Ditto.
11529 (General_options::Bshareable): Define.
11530 * options.cc (General_options::finalize): Honor -Bshareable.
11531
83d22aa8
AS
115322009-01-20 Andreas Schwab <schwab@suse.de>
11533
11534 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
11535 read the value in the contents, since we don't use it. Use the
11536 template endianness when writing.
11537 (Relocate::relocate): Use it for R_PPC_REL16_HA.
11538
cd536b21
AS
115392009-01-19 Andreas Schwab <schwab@suse.de>
11540
11541 * configure.tgt (powerpc64-*): Fix targ_obj.
11542
99e9a495
ILT
115432009-01-15 Ian Lance Taylor <iant@google.com>
11544
11545 * object.cc (Sized_relobj::write_local_symbols): Don't write out
11546 local symbols when stripping all symbols.
11547
bbbfea06
CC
115482009-01-14 Cary Coutant <ccoutant@google.com>
11549
99e9a495 11550 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 11551
0f7c0701
CC
115522009-01-14 Cary Coutant <ccoutant@google.com>
11553
11554 * archive.cc (Archive::get_elf_object_for_member): Remove call
11555 to File_read::claim_for_plugin.
11556 * descriptors.cc (Descriptors::open): Remove reference to
11557 is_claimed.
11558 (Descriptors::claim_for_plugin): Remove.
11559 * descriptors.h (Descriptors::claim_for_plugin): Remove.
11560 (Descriptors::is_claimed): Remove.
11561 (claim_descriptor_for_plugin): Remove.
11562 * fileread.cc (File_read::claim_for_plugin): Remove.
11563 * fileread.h (File_read::claim_for_plugin): Remove.
11564 (File_read::descriptor): Reopen descriptor if necessary.
11565 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
11566 (Plugin_manager::all_symbols_read): Add task parameter. Change
11567 all callers.
11568 (Plugin_manager::get_input_file): New function.
11569 (Plugin_manager::release_input_file): New function.
11570 (Pluginobj::Pluginobj): Add filesize parameter and initialize
11571 corresponding data member.
11572 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
11573 and pass to base constructor. Change all callers.
11574 (get_input_file, release_input_file): New functions.
11575 (make_sized_plugin_object): Add filesize parameter. Change all callers.
11576 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
11577 (Plugin_manager::all_symbols_read): Add task parameter.
11578 (Plugin_manager::get_input_file): New function.
11579 (Plugin_manager::release_input_file): New function.
11580 (Plugin_manager::task_): New data member.
11581 (Pluginobj::Pluginobj): Add filesize parameter.
11582 (Pluginobj::filename): New function.
11583 (Pluginobj::descriptor): New function.
11584 (Pluginobj::filesize): New function.
11585 (Pluginobj::filesize_): New data member.
11586 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
11587 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
11588 File_read::claim_for_plugin; use Object::unlock to unlock the file.
11589
11590 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
11591 with archive libraries.
11592 * testsuite/Makefile.in: Regenerate.
11593 * testsuite/plugin_test.c (struct sym_info): New type.
11594 (get_input_file, release_input_file): New static variables.
11595 (onload): Capture new transfer vector entries.
11596 (claim_file_hook): Stop reading at end of file according to filesize.
11597 Factor out parsing of readelf output into separate function.
11598 (all_symbols_read_hook): Exercise get_input_file and release_input_file
11599 APIs and get the source file name from the symbol table. Convert
11600 source file name to corresponding object file name. Print info
11601 message when adding new input files.
11602 (parse_readelf_line): New function.
11603 * testsuite/plugin_test_1.sh: Add checks for new info messages.
11604 * testsuite/plugin_test_2.sh: Likewise.
11605 * testsuite/plugin_test_3.sh: Likewise.
11606 * testsuite/plugin_test_4.sh: New test case.
11607
62a6d109
ILT
116082009-01-07 Ian Lance Taylor <iant@google.com>
11609
11610 * version.cc (version_string): Bump to 1.8.
11611
483620e8
CC
116122008-12-23 Cary Coutant <ccoutant@google.com>
11613
11614 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
11615 * plugin.cc (Plugin_manager::finish): Rename as
11616 layout_deferred_objects. Move cleanup to separate function.
11617 (Plugin_manager::cleanup): New function.
11618 (Plugin_finish::run): Call layout_deferred_objects and cleanup
11619 separately.
11620 * plugin.h (Plugin_manager::finish): Rename as
11621 layout_deferred_objects.
11622 (Plugin_manager::cleanup): New function.
11623 (Plugin_manager::cleanup_done): New field.
11624
d66a9eb3
CC
116252008-12-23 Cary Coutant <ccoutant@google.com>
11626
11627 * plugin.cc (is_visible_from_outside): New function.
11628 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
11629 so we don't return "IR only" status for exported symbols or -r links.
11630
11631 * testsuite/Makefile.am (plugin_test_3): New test case.
11632 * testsuite/Makefile.in: Regenerate.
11633 * testsuite/plugin_test_3.sh: New file.
11634
5995b570
CC
116352008-12-22 Cary Coutant <ccoutant@google.com>
11636
11637 * object.cc (Sized_relobj::layout_section): New function.
11638 (Sized_relobj::do_layout): Defer layout of input sections until after
11639 plugin has provided replacement files.
11640 (Sized_relobj::do_layout_deferred_sections): New function.
11641 * object.h (Relobj::set_section_offset): Remove virtual keyword.
11642 (Relobj::layout_deferred_sections): New function.
11643 (Relobj::do_layout_deferred_sections): New function.
11644 (Sized_relobj::do_layout_deferred_sections): New function.
11645 (Sized_relobj::layout_section): New function.
11646 (Sized_relobj::Deferred_layout): New structure.
11647 (Sized_relobj::deferred_layout_): New field.
11648 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
11649 Change all callers. Layout deferred sections.
11650 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
11651 references.
11652 (Plugin_hook::run): Move code from do_plugin_hook inline.
11653 (Plugin_hook::do_plugin_hook): Remove.
11654 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
11655 (Plugin_manager::finish): Renamed, was cleanup.
11656 (Plugin_manager::should_defer_layout): New function.
11657 (Plugin_manager::add_deferred_layout_object): New function.
11658 (Plugin_manager::Deferred_layout_list): New type.
11659 (Plugin_manager::deferred_layout_objects_): New field.
11660 (Plugin_hook::do_plugin_hook): Remove.
11661
ee769c88
ILT
116622008-12-17 Ian Lance Taylor <iant@google.com>
11663
11664 * options.h (class General_options): Add --no case for
11665 --export-dynamic.
11666
abc8dcba
CC
116672008-12-16 Cary Coutant <ccoutant@google.com>
11668
11669 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
11670 vector.
11671 (Plugin_manager::claim_file): Create plugin object even if
11672 plugin did not call the add_symbols callback.
11673 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
11674 asking for more symbols than were added.
11675 * testsuite/Makefile.am (plugin_test_1): Add test case with
11676 no global symbols.
11677 (empty.syms): New target.
11678 * testsuite/Makefile.in: Regenerate.
11679 * testsuite/plugin_test.c (claim_file_hook): Add new debug
11680 message. Don't call add_symbols if no globals.
11681 (all_symbols_read_hook): Don't provide replacement for empty
11682 claimed file.
11683
b0074644
ILT
116842008-12-12 Ian Lance Taylor <iant@google.com>
11685
68943102
ILT
11686 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
11687 r_type == 0 for a local symbol with r_sym == 0.
11688 (scan_relocatable_relocs): Pass r_sym to
11689 local_non_section_strategy.
11690 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
11691 r_sym parameter.
11692
b0074644
ILT
11693 * configure.ac: Update test for TLS descriptors: they are
11694 supported as of glibc 2.9.
11695 * configure: Rebuild.
11696
c2508178
ILT
116972008-12-11 Ian Lance Taylor <iant@google.com>
11698
11699 PR 7091
11700 * target-reloc.h (Default_scan_relocatable_relocs): For each
11701 function, map r_type == 0 to RELOC_DISCARD.
11702
2756a258
CC
117032008-12-10 Cary Coutant <ccoutant@google.com>
11704
11705 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
11706 object to override a kept COMDAT group from a plugin object.
11707
bb6f53d3
ILT
117082008-12-09 Ian Lance Taylor <iant@google.com>
11709
fbc558e1
ILT
11710 PR 7088
11711 * yyscript.y (file_cmd): Handle INPUT.
11712
bb6f53d3
ILT
11713 * testsuite/initpri1.c: Change all declarations to be full
11714 prototypes by adding void, to avoid compiler warnings.
11715
4674ecfc
CC
117162008-12-05 Rafael Avila de Espindola <espindola@google.com>
11717
11718 * options.cc (General_options::parse_plugin_opt): New.
11719 (General_options::add_plugin): The argument now is just the filename.
11720 (General_options::add_plugin_option): New.
11721 * options.h (plugin_opt): New.
11722 (add_plugin): Change argument name.
11723 (add_plugin_option): New.
11724 * plugin.cc (Plugin::load): Don't parse the plugin option.
11725 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
11726 (Plugin::add_option): New.
11727 (Plugin::args_): Change type.
11728 (Plugin::filename_): New.
11729 (Plugin_manager::add_plugin_option): New.
11730 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
11731 * testsuite/Makefile.in: Regenerate.
11732
fd06b4aa
CC
117332008-12-05 Cary Coutant <ccoutant@google.com>
11734
11735 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
11736 Handle --strip-lto-sections option.
11737 * options.h (strip_lto_sections): New option.
11738
6c52134c
CC
117392008-12-01 Cary Coutant <ccoutant@google.com>
11740
11741 * plugin.cc (ld_plugin_message): Change format parameter to const.
11742 Fix mismatch between new[] and delete.
11743
a45248e0
CC
117442008-11-14 Cary Coutant <ccoutant@google.com>
11745
11746 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
11747 instead of -1U.
11748
c82fbeee
CS
117492008-11-05 Craig Silverstein <csilvers@google.com>
11750
11751 * options.cc (General_options::parse_dynamic_list): New function.
11752 * options.h (General_options): New flags dynamic_list,
11753 dynamic_list_data, dynamic_list_cpp_new, and
11754 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
11755 (General_options::in_dynamic_list): New function.
11756 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
11757 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
11758 (Lex::can_continue_name): Likewise.
11759 (yylex): Likewise.
11760 (read_script_file): New parameter script_options.
11761 (read_dynamic_list): New function.
11762 (Script_options::define_dynamic_list): New function.
11763 (dynamic_list_keyword_parsecodes): New variable.
11764 (dynamic_list_keywords): New variable.
11765 * script.h (Script_options::define_dynamic_list): New function
11766 prototype.
11767 (read_dynamic_list): New function prototype.
11768 * symtab.cc (strprefix): New macro.
11769 (Symbol::should_add_dynsym_entry): Support dynamic_list,
11770 dynamic_list_data, dynamic_list_cpp_new, and
11771 dynamic_list_cpp_typeinfo.
11772 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
11773 (dynamic_list_expr): New rule.
11774 (dynamic_list_nodes): Likewise.
11775 (dynamic_list_node): Likewise.
11776 * testsuite/Makefile.am (dynamic_list): New test.
11777 * testsuite/Makefile.in: Regenerated.
11778 * testsuite/dynamic_list.t: New file.
11779 * testsuite/dynamic_list.sh: New file.
11780
e0bb29a5
CS
117812008-11-05 Craig Silverstein <csilvers@google.com>
11782
11783 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
11784 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
11785 (t11_last): Likewise.
11786 * testsuite/ver_test_6.c (main): Likewise.
11787
4e1e25e0
CC
117882008-10-07 Cary Coutant <ccoutant@google.com>
11789
11790 * options.c (General_options::finalize): Add check for -static and
11791 -shared.
11792 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
11793 is not empty.
11794
92f03fcb
CC
117952008-10-02 Cary Coutant <ccoutant@google.com>
11796
11797 * plugin.cc (make_sized_plugin_object): Fix conditional
11798 compilation to work when not all targets are enabled.
11799
fbd8a257
CC
118002008-09-29 Cary Coutant <ccoutant@google.com>
11801
11802 * archive.cc (Archive::get_file_and_offset): Use filename instead
11803 of name to get library path.
11804 (Archive::include_member): Unlock external member of a thin archive.
11805
11806 * testsuite/Makefile.am (TEST_AR): New variable.
11807 (thin_archive_test_1): New test.
11808 (thin_archive_test_2): New test.
81636b3f
CC
11809 * testsuite/Makefile.in: Regenerate.
11810 * testsuite/thin_archive_main.cc: New file.
11811 * testsuite/thin_archive_test_1.cc: New file.
11812 * testsuite/thin_archive_test_2.cc: New file.
11813 * testsuite/thin_archive_test_3.cc: New file.
11814 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 11815
eff45813
CC
118162008-09-29 Cary Coutant <ccoutant@google.com>
11817
11818 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
11819 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
11820 instead of -1U.
11821 (Sized_relobj::do_finalize_local_symbols): Likewise.
11822 (Sized_relobj::map_to_kept_section): Likewise.
11823 * object.h (Sized_relobj::invalid_address): New constant.
11824 (Sized_relobj::do_output_section_offset): Check for invalid_address
11825 and return -1ULL.
11826 * output.cc (Output_reloc::local_section_offset): Use constant
11827 invalid_address instead of -1U.
11828 (Output_reloc::get_address): Likewise.
11829 (Output_section::output_address): Change -1U to -1ULL.
11830 * output.h (Output_reloc::invalid_address): New constant.
11831 * reloc.cc (Sized_relobj::write_sections): Use constant
11832 invalid_address instead of -1U.
11833 (Sized_relobj::relocate_sections): Likewise.
11834 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
11835 values for merge sections.
11836 * target-reloc.h (relocate_for_relocatable): Use constant
11837 invalid_address instead of -1U.
11838
89fc3421
CC
118392008-09-19 Cary Coutant <ccoutant@google.com>
11840
11841 Add plugin functionality for link-time optimization (LTO).
11842 * configure.ac (plugins): Add --enable-plugins option.
11843 * configure: Regenerate.
11844 * config.in: Regenerate.
11845 * Makefile.am (LIBDL): New variable.
11846 (CCFILES): Add plugin.cc.
11847 (HFILES): Add plugin.h.
11848 (ldadd_var): Add LIBDL.
11849 * Makefile.in: Regenerate.
11850
11851 * archive.cc: Include "plugin.h".
11852 (Archive::setup): Don't preread archive symbols when using a plugin.
11853 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
11854 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
11855 files.
11856 (Archive::include_member): Add symbols from plugin objects.
11857 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
11858 * descriptors.cc (Descriptors::open): Check for file descriptors
11859 abandoned by plugins.
11860 (Descriptors::claim_for_plugin): New function.
11861 * descriptors.h (Descriptors::claim_for_plugin): New function.
11862 (Open_descriptor::is_claimed): New field.
11863 (claim_descriptor_for_plugin): New function.
11864 * fileread.cc (File_read::claim_for_plugin): New function.
11865 * fileread.h (File_read::claim_for_plugin): New function.
11866 (File_read::descriptor): New function.
11867 * gold.cc: Include "plugin.h".
11868 (queue_initial_tasks): Add task to call plugin hooks for generating
11869 new object files.
11870 * main.cc: Include "plugin.h".
11871 (main): Load plugin libraries.
11872 * object.h (Pluginobj): Declare.
11873 (Object::pluginobj): New function.
11874 (Object::do_pluginobj): New function.
11875 (Object::set_target): New function.
11876 * options.cc: Include "plugin.h".
11877 (General_options::parse_plugin): New function.
11878 (General_options::General_options): Initialize plugins_ field.
11879 (General_options::add_plugin): New function.
11880 * options.h (Plugin_manager): Declare.
11881 (General_options): Add --plugin option.
11882 (General_options::has_plugins): New function.
11883 (General_options::plugins): New function.
11884 (General_options::add_plugin): New function.
11885 (General_options::plugins_): New field.
11886 * plugin.cc: New file.
11887 * plugin.h: New file.
11888 * readsyms.cc: Include "plugin.h".
11889 (Read_symbols::do_read_symbols): Check for archive before checking
11890 for ELF file. Call plugin hooks to claim files.
11891 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
11892 from a real object file; force override when processing replacement
11893 files.
11894 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
11895 (Symbol::init_base_object): Likewise.
11896 (Symbol::init_base_output_data): Likewise.
11897 (Symbol::init_base_output_segment): Likewise.
11898 (Symbol::init_base_constant): Likewise.
11899 (Symbol::init_base_undefined): Likewise.
11900 (Symbol::output_section): Assert that object is not a plugin.
11901 (Symbol_table::add_from_pluginobj): New function.
11902 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
11903 undefined.
11904 (Symbol_table::sized_write_globals): Likewise.
11905 (Symbol_table::add_from_pluginobj): Instantiate template.
11906 * symtab.h (Sized_pluginobj): Declare.
11907 (Symbol::in_real_elf): New function.
11908 (Symbol::set_in_real_elf): New function.
11909 (Symbol::in_real_elf_): New field.
11910 (Symbol_table::add_from_pluginobj): New function.
11911
11912 * testsuite/Makefile.am (AM_CFLAGS): New variable.
11913 (LIBDL): New variable.
11914 (LDADD): Add LIBDL.
11915 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
11916 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
11917 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
11918 (MOSTLYCLEANFILES): Likewise.
11919 * testsuite/Makefile.in: Regenerate.
11920 * testsuite/plugin_test.c: New file.
11921 * testsuite/plugin_test_1.sh: New file.
11922 * testsuite/plugin_test_2.sh: New file.
11923
de31bda5
ILT
119242008-09-16 Ian Lance Taylor <iant@google.com>
11925
9c2d0ef9
ILT
11926 * target-reloc.h (relocate_section): Check whether a symbol is
11927 defined by the ABI before reporting an undefined symbol error.
11928 * target.h (Target::is_defined_by_abi): Make parameter const.
11929 (Target::do_is_defined_by_abi): Likewise.
11930 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
11931 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
11932 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
11933 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
11934 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
11935 * testsuite/Makefile.in: Rebuild.
11936
de31bda5
ILT
11937 * fileread.cc (make_view): Add casts to avoid warning.
11938
9fa33bee
AO
119392008-09-16 Alexandre Oliva <aoliva@redhat.com>
11940
11941 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
11942 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11943
183fd0e3
AO
119442008-09-16 Alexandre Oliva <aoliva@redhat.com>
11945
11946 * options.h (General_options::output_is_executable): New.
11947 (General_options::output_is_pie): New.
11948 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
11949 for shared libraries.
11950 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11951
7be8330a
CD
119522008-09-11 Chris Demetriou <cgd@google.com>
11953
11954 * options.h (origin): New -z option.
11955 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
11956 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
11957 in DT_FLAGS_1.
11958
a9caad02
CC
119592008-09-05 Cary Coutant <ccoutant@google.com>
11960
11961 * fileread.cc (File_read::make_view): Add check for attempt to map
11962 beyond end of file.
11963
ae6dce4d
CC
119642008-09-05 Cary Coutant <ccoutant@google.com>
11965
11966 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
11967 explicit instantiations.
11968
d7ab2a47
KVH
119692008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
11970
11971 PR gold/6858
11972 * options.cc (General_options::finalize): Allow undefined symbols
11973 in shlibs if linking -shared.
11974
11975 PR gold/6859
11976 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
11977 symbols as not needing a dynsym entry.
11978
1e52a9c1
CS
119792008-08-20 Craig Silverstein <csilvers@google.com>
11980
11981 * fileread.cc (File_read::open): Do not lock the file unless it
11982 was successfully opened.
11983
d85c80a3
CC
119842008-08-14 Cary Coutant <ccoutant@google.com>
11985
11986 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
11987 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
11988 * testsuite/tls_test.cc (struct int128): 128-bit struct
11989 for testing TLS relocs with non-zero addend.
11990 (v12): New TLS variable.
11991 (t12): New test.
11992 (t_last): Add check for v12.
11993 * testsuite/tls_test.h (t12): New function.
11994 * testsuite/tls_test_main.cc (thread_routine): Call new test.
11995
2d924fd9
ILT
119962008-08-13 Ian Lance Taylor <iant@google.com>
11997
11998 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
11999 set tls_segment_ or relro_segment_.
12000 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
12001 when appropriate.
12002 * output.h (Output_section::clear_is_relro): New function.
12003 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
12004 sections specially even when output_data_ is empty.
12005 (Output_segment::maximum_alignment): When first section is relro,
12006 only force alignment for PT_LOAD segments.
12007 * script.cc (script_data_segment_align): New function.
12008 (script_data_segment_relro_end): New function.
12009 * script-c.h (script_data_segment_align): Declare.
12010 (script_data_segment_relro_end): Declare.
12011 * script-sections.h (class Script_sections): Declare
12012 data_segment_align and data_segment_relro_end. Add fields
12013 segment_align_index_ and saw_relro_end_.
12014 * script-sections.cc (class Sections_element): Add set_is_relro
12015 virtual function. Add new bool* parameter to place_orphan_here.
12016 Add get_output_section virtual function.
12017 (class Output_section_definition): Add set_is_relro. Add new
12018 bool* parameter to place_orphan_here. Add get_output_section.
12019 Add is_relro_ field.
12020 (Output_section_definition::Output_section_definition): Initialize
12021 evaluated_address_, evaluated_load_address, evaluated_addralign_,
12022 and is_relro_ fields.
12023 (Output_section_definition::place_orphan_here): Add is_relro
12024 parameter.
12025 (Output_section_definition::set_section_addresses): Set relro for
12026 output section.
12027 (Output_section_definition::alternate_constraint): Likewise.
12028 (class Orphan_output_section): Add new bool* parameter to
12029 place_orphan_here. Add get_output_section.
12030 (Orphan_output_section::place_orphan_here): Add is_relro
12031 parameter.
12032 (Script_sections::Script_sections): Initialize
12033 data_segment_align_index_ and saw_relro_end_.
12034 (Script_sections::data_segment_align): New function.
12035 (Script_sections::data_segment_relro_end): New function.
12036 (Script_sections::place_orphan): Set or clear is_relro.
12037 (Script_sections::set_section_addresses): Force alignment of first
12038 TLS section.
12039 * yyscript.y (exp): Call script_data_segment_align and
12040 script_data_segment_relro_end.
12041 * testsuite/relro_script_test.t: New file.
12042 * testsuite/relro_test.cc (using_script): Declare.
12043 (t1, t2): Test using_script.
12044 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
12045 (relro_script_test_SOURCES): Define.
12046 (relro_script_test_DEPENDENCIES): Define.
12047 (relro_script_test_LDFLAGS): Define.
12048 (relro_script_test_LDADD): Define.
12049 (relro_script_test.so): New target.
12050 * testsuite/Makefile.in: Rebuild.
12051
f827c9a9
CC
120522008-08-06 Cary Coutant <ccoutant@google.com>
12053
12054 * archive.cc (Archive::total_archives, Archive::total_members)
12055 (Archive::total_members_loaded): New variables.
12056 (Archive::setup): Add parameter. Add option to preread
12057 archive symbols.
12058 (Archive::read_armap): Add counter.
12059 (Archive::get_file_and_offset): New function.
12060 (Archive::get_elf_object_for_member): New function.
12061 (Archive::read_all_symbols): New function.
12062 (Archive::read_symbols): New function.
12063 (Archive::add_symbols): Add counters.
12064 (Archive::include_all_members): Use armap to find members if it's
12065 already built.
12066 (Archive::include_member): Skip reading symbols if already read.
12067 Factored code into Archive::get_file_and_offset and
12068 Archive::get_elf_object_for_member. Changed call to
12069 Mapfile::report_include_archive_member.
12070 (Archive::print_stats): New function.
12071 * archive.h: Declare Object and Read_symbols_data classes.
12072 (Archive::Archive): Add initializers for new members.
12073 (Archive::setup): Add parameter.
12074 (Archive::print_stats): New function.
12075 (Archive::total_archives, Archive::total_members)
12076 (Archive::total_members_loaded): New variables.
12077 (Archive::get_file_and_offset): New function.
12078 (Archive::get_elf_object_for_member): New function.
12079 (Archive::read_all_symbols): New function.
12080 (Archive::read_symbols): New function.
12081 (Archive::Archive_member): New class.
12082 (Archive::members_): New member.
12083 (Archive::num_members_): New member.
12084 * main.cc: Include archive.h.
12085 (main): Call Archive::print_stats.
12086 * mapfile.cc (Mapfile::report_include_archive_member): Delete
12087 archive parameter; member_name is now the fully-decorated name.
12088 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
12089 * options.h: (General_options): Add --preread-archive-symbols option.
12090 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
12091 Archive::setup.
12092
de4c45bd
ILT
120932008-08-04 Ian Lance Taylor <iant@google.com>
12094
12095 * symtab.h (Symbol::use_plt_offset): New function.
12096 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
12097 * powerpc.cc (Relocate::relocate): Likewise.
12098 * sparc.cc (Relocate::relocate): Likewise.
12099 * x86_64.cc (Relocate::relocate): Likewise.
12100 * testsuite/weak_plt.sh: New test.
12101 * testsuite/weak_plt_main.cc: New test.
12102 * testsuite/weak_plt_shared.cc: New test.
12103 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
12104 (check_PROGRAMS): Add weak_plt.
12105 (check_DATA): Add weak_plt_shared.so.
12106 (weak_plt_main_pic.o, weak_plt): New targets.
12107 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
12108 * testsuite/Makefile.in: Rebuild.
12109
12110 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
12111 gcctestdir/ld.
12112 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
12113 * testsuite/Makefile.in: Rebuild.
12114
323ee3f4
AM
121152008-08-04 Alan Modra <amodra@bigpond.net.au>
12116
12117 * Makefile.am (POTFILES.in): Set LC_ALL=C.
12118 * Makefile.in: Regenerate.
12119 * po/POTFILES.in: Regenerate.
12120
7c07ecec
ILT
121212008-07-29 Ian Lance Taylor <iant@google.com>
12122
12123 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
12124 symbols before other symbols.
12125 * testsuite/script_test_2.cc (test_addr): Declare.
12126 (test_addr_alias): Declare.
12127 (main): Check that test_addr and test_addr_alias have the right
cd536b21 12128 values.
7c07ecec
ILT
12129 * testsuite/script_test_2.t: Define test_addr_alias and
12130 test_addr.
12131
5778530e
ILT
121322008-07-24 Ian Lance Taylor <iant@google.com>
12133
2a00e4fb
ILT
12134 PR 5990
12135 * descriptors.cc: New file.
12136 * descriptors.h: New file.
12137 * gold-threads.h (class Hold_optional_lock): New class.
12138 * fileread.cc: Include "descriptors.h".
12139 (File_read::~File_read): Release descriptor rather than closing
12140 it.
12141 (File_read::open) [file]: Call open_descriptor rather than open.
12142 Set is_descriptor_opened_.
12143 (File_read::open) [memory]: Assert that descriptor is not open.
12144 (File_read::reopen_descriptor): New function.
12145 (File_read::release): Release descriptor.
12146 (File_read::do_read): Make non-const. Reopen descriptor.
12147 (File_read::read): Make non-const.
12148 (File_read::make_view): Reopen descriptor.
12149 (File_read::do_readv): Likewise.
12150 * fileread.h (class File_read): Add is_descriptor_opened_ field.
12151 Update declarations.
12152 * layout.cc: Include "descriptors.h".
12153 (Layout::create_build_id): Use open_descriptor rather than open.
12154 * output.cc: Include "descriptors.h".
12155 (Output_file::open): Use open_descriptor rather than open.
12156 * archive.cc (Archive::const_iterator): Change Archive to be
12157 non-const.
12158 (Archive::begin, Archive::end): Make non-const.
12159 (Archive::count_members): Likewise.
12160 * archive.h (class Archive): Update declarations.
12161 * object.h (Object::read): Make non-const.
12162 * Makefile.am (CCFILES): Add descriptors.cc.
12163 (HFILES): Add descriptors.h.
12164 * Makefile.in: Rebuild.
12165
801647d1
ILT
12166 PR 6716
12167 * gold.h: Always include <clocale>. Add Solaris workarounds
12168 following code in binutils/sysdep.h.
12169
5edd166e
ILT
12170 PR 6048
12171 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
12172 this->eh_frame_hdr_ is NULL before using it.
12173
c89ad728
ILT
12174 * dynobj.cc (Versions::Versions): Update comment.
12175
aa86f06b
ILT
12176 * dynobj.cc (Versions::Versions): If there is an soname, use it as
12177 the base version name.
12178
5778530e
ILT
12179 * stringpool.cc (Stringpool_template::add_with_length): Set key to
12180 array size plus one.
12181 (Stringpool_template::set_string_offsets): Subtract one from key
12182 before using it as an array index.
12183 (Stringpool_template::get_offset_with_length): Likewise.
12184 (Stringpool_template::write_to_buffer): Likewise.
12185 * stringpool.h (Stringpool_template::get_offset_from_key):
12186 Likewise.
12187
057ead22
ILT
121882008-07-23 Ian Lance Taylor <iant@google.com>
12189
7f649c59
ILT
12190 PR 6658
12191 * object.h (Merged_symbol_value::value): Do our best to handle a
12192 negative addend.
12193
057ead22
ILT
12194 PR 6647
12195 * script.cc (Version_script_info::get_versions): Don't add empty
12196 version tag to return value.
12197 (Version_script_info::get_symbol_version_helper): Change return
12198 type to bool. Add pversion parameter. Change all callers.
12199 (script_register_vers_node): Don't require a non-NULL tag.
12200 * script.h (class Version_script_info): Update declarations.
12201 (Version_script_info::get_symbol_version): Change return type to
12202 bool. Add version parameter. Change all callers.
12203 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
12204 handling. Handle an empty version from a version script.
12205 (Symbol_table::define_special_symbol): Likewise.
12206 * testsuite/ver_test_10.script: New file.
12207 * testsuite/ver_test_10.sh: New file.
12208 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
12209 (check_DATA): Add ver_test_10.syms.
12210 (ver_test_10.syms, ver_test_10.so): New target.
12211 * testsuite/Makefile.in: Rebuild.
12212
58e54ac2
CD
122132008-07-23 Simon Baldwin <simonb@google.com>
12214
12215 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
12216 to zero for undefined symbols from dynamic libraries.
12217
95d14cd3
ILT
122182008-07-23 Ian Lance Taylor <iant@google.com>
12219
12220 * symtab.cc (Symbol_table::resolve): Remove version parameter.
12221 Change all callers.
12222 * symtab.h (class Symbol_table): Update declaration.
12223 * testsuite/ver_test_9.cc: New file.
12224 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
12225 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
12226 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
12227 (ver_test_9.so, ver_test_9.o): New targets.
12228 * testsuite/Makefile.in: Rebuild.
12229
92de84a6
ILT
122302008-07-22 Ian Lance Taylor <iant@google.com>
12231
34810851
ILT
12232 * options.h (class General_options): Define --check-sections.
12233 * layout.cc (Layout::set_segment_offsets): Handle
12234 --check-sections.
12235
af6156ef
ILT
12236 * options.h (class General_options): Define -n/--nmagic and
12237 -N/--omagic.
12238 * options.cc (General_options::finalize): For -n/--nmagic or
12239 -N/--omagic, set -static.
12240 * layout.cc (Layout::attach_allocated_section_to_segment): If
12241 -N/--omagic, don't put read-only and read-write sections in
12242 different segments.
12243 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
12244 finding a read-only segment.
12245 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
12246 don't set the minimum segment alignment to the common page size,
12247 and don't set the file offset to the address modulo the page size.
12248 * script-sections.cc (Script_sections::create_segments): If
12249 -n/--omagic, don't put read-only and read-write sections in
12250 different segments.
12251
92de84a6
ILT
12252 * cref.cc: New file.
12253 * cref.h: New file.
12254 * options.h (class General_options): Add --print-symbol-counts.
12255 * main.cc (main): Issue defined symbol report if requested.
12256 * archive.cc (Archive::interpret_header): Make into a const member
12257 function.
12258 (Archive::add_symbols): Call Input_objects::archive_start and
12259 archive_stop.
12260 (Archive::const_iterator): Define new class.
12261 (Archive::begin, Archive::end): New functions.
12262 (Archive::include_all_members): Rewrite to use iterator.
12263 (Archive::count_members): New function.
12264 * archive.h (class Archive): Update declarations.
12265 (Archive::filename): New function.
12266 * object.cc: Include "cref.h".
12267 (Sized_relobj::Sized_relobj): Initialize defined_count_.
12268 (Sized_relobj::do_get_global_symbol_counts): New function.
12269 (Input_objects::add_object): Add object to cross-referencer.
12270 (Input_objects::archive_start): New function.
12271 (Input_objects::archive_stop): New function.
12272 (Input_objects::print_symbol_counts): New function.
12273 * object.h: Declare Cref and Archive.
12274 (Object::get_global_symbol_counts): New function.
12275 (Object::do_get_global_symbol_counts): New pure virtual function.
12276 (class Sized_relobj): Add defined_count_ field. Update
12277 declarations.
12278 (class Input_objects): Add cref_ field. Update constructor.
12279 Update declarations.
12280 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
12281 defined_count_.
12282 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
12283 symbol counts.
12284 (Sized_dynobj::do_get_global_symbol_counts): New function.
12285 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
12286 defined_count_. Update declarations. Define Symbols typedef.
12287 * symtab.cc (Symbol_table::add_from_relobj): Add defined
12288 parameter. Change all callers.
12289 (Symbol_table::add_from_dynobj): Add sympointers and defined
12290 parameters. Change all callers.
12291 * symtab.h (class Symbol_table): Update declarations.
12292 * Makefile.am (CCFILES): Add cref.cc.
12293 (HFILES): Add cref.h.
12294 * Makefile.in: Rebuild.
12295
3f7c5e1d
CD
122962008-07-22 Simon Baldwin <simonb@google.com>
12297
12298 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
12299 to zero when writing undefined symbols.
12300
e0b64032
ILT
123012008-07-22 Ian Lance Taylor <iant@google.com>
12302
12303 * output.cc (Output_section::add_input_section): Don't try to
12304 merge empty merge sections.
12305
096b02cf
CS
123062008-07-21 Craig Silverstein <csilvers@google.com>
12307
12308 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
12309 Include symbol version in error message.
cd536b21 12310
1d1f116d
CD
123112008-07-20 Chris Demetriou <cgd@google.com>
12312
cd536b21 12313 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
12314 (RANDOM_SEED_CFLAGS): New substituted variable.
12315 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
12316 * configure: Rebuild.
12317 * Makefile.in: Likewise.
12318 * testsuite/Makefile.in: Likewise.
12319
a18f591e
ILT
123202008-07-18 Ian Lance Taylor <iant@google.com>
12321
12322 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
12323 where we see NAME/NULL and NAME/VERSION as separate symbols.
12324 * testsuite/ver_test_main.cc (main): Call t4.
12325 (t4, t4_2a): Define.
12326 * testsuite/ver_test_2.cc (t4_2): Define.
12327 * testsuite/ver_test_2.script: Put t4_2a in VER2.
12328 * testsuite/ver_test_4.cc (t4_2a): Define.
12329 * testsuite/ver_test_4.script: Put t4_2a in VER2.
12330 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
12331
c6e3f6ed
ILT
123322008-07-17 Ian Lance Taylor <iant@google.com>
12333
12334 * dynobj.cc (Versions::add_def): If we give an error about a
12335 missing version, go ahead and create the version anyhow.
12336
ef9beddf
ILT
123372008-07-10 Ian Lance Taylor <iant@google.com>
12338
12339 Handle output sections with more than 0x7fffffff bytes.
12340 * object.h (class Relobj): Change map_to_output_ to
12341 output_sections_, and just keep a section pointer. Change all
12342 uses. Move comdat group support to Sized_relobj.
12343 (Relobj::is_section_specially_mapped): Remove.
12344 (Relobj::output_section): Remove poff parameter. Change all
12345 callers.
12346 (Relobj::output_section_offset): New function.
12347 (Relobj::set_section_offset): Rewrite.
12348 (Relobj::map_to_output): Remove.
12349 (Relobj::output_sections): New function.
12350 (Relobj::do_output_section_offset): New pure virtual function.
12351 (Relobj::do_set_section_offset): Likewise.
12352 (class Sized_relobj): Add section_offsets_ field. Add comdat
12353 group support from Relobj. Update declarations.
12354 (Sized_relobj::get_output_section_offset): New function.
12355 (Sized_relobj::do_output_section_offset): New function.
12356 (Sized_relobj::do_set_section_offset): New function.
12357 * object.cc (Relobj::output_section_address): Remove.
12358 (Sized_relobj::Sized_relobj): Initialize new fields.
12359 (Sized_relobj::include_section_group): Cast find_kept_object to
12360 Sized_relobj.
12361 (Sized_relobj::include_linkonce_section): Likewise.
12362 (Sized_relobj::do_layout): Use separate arrays for output section
12363 and output offset.
12364 (Sized_relobj::do_count_local_symbols): Change map_to_output to
12365 output_sections.
12366 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
12367 output_sections and section_offsets.
12368 (Sized_relobj::write_local_symbols): Likewise.
12369 (map_to_kept_section): Compute output address directly.
12370 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
12371 output_sections and section_offsets.
12372 (Sized_relobj::write_sections): Likewise.
12373 (Sized_relobj::relocate_sections): Likewise.
12374 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
12375 * output.h (class Output_reloc): Update declarations. Change
12376 u2_.relobj to Sized_relobj*.
12377 (class Output_data_reloc): Change add functions to use
12378 Sized_relobj*.
12379 * output.cc (Output_reloc::Output_reloc): Change relobj to
12380 Sized_relobj*.
12381 (Output_reloc::local_section_offset): Change return type to
12382 Elf_Addr. Use get_output_section_offset.
12383 (Output_reloc::get_address): Likewise.
12384 (Output_section::is_input_address_mapped): Don't call
12385 is_section_specially_mapped.
12386 (Output_section::output_offset): Likewise.
12387 (Output_section::output_address): Likewise.
12388 (Output_section::starting_output_address): Likewise.
12389 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
12390 parameter to Sized_relobj*.
12391 (Copy_relocs::need_copy_reloc): Likewise.
12392 (Copy_relocs::save): Likewise.
12393 * copy-relocs.h (class Copy_relocs): Update declarations.
12394 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
12395 Sized_relobj*. Change relobj_ field to Sized_relobj*.
12396 * target-reloc.h (relocate_for_relocatable): Change
12397 offset_in_output_section type to Elf_Addr. Change code that uses
12398 it as well.
12399 * layout.cc (Layout::layout): Always set *off.
12400 * mapfile.cc (Mapfile::print_input_section): Use
12401 output_section_offset.
12402 * i386.cc (Target_i386::copy_reloc): Change object parameter to
12403 Sized_relobj*.
12404 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
12405 * sparc.cc (Target_sparc::copy_reloc): Likewise.
12406 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
12407
5cb66f97
ILT
124082008-07-03 Ian Lance Taylor <iant@google.com>
12409
12410 * layout.cc (Layout::include_section): Do not discard unrecognized
12411 SHT_STRTAB sections.
12412
afe47622
CS
124132008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
12414
12415 * script.cc (Lex::can_continue_name): Make '?' allowable in
12416 version-script names.
12417 * testsuite/version_script.map: Change glob pattern to use '?'
12418
5adf9721
ILT
124192008-06-30 Manish Singh <yosh@gimp.org>
12420
12421 PR 6585
12422 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
12423 Correct typo.
12424
e6fde208
ILT
124252008-06-30 Ian Lance Taylor <iant@google.com>
12426
12427 PR 6660
12428 PR 6682
12429 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
12430 versions]: Don't try to read the value in the contents, since we
12431 don't use it. Use the template endianness when writing.
12432
3f2e6a2d
CC
124332008-06-25 Cary Coutant <ccoutant@google.com>
12434
12435 * fileread.cc (File_read::make_view): Assert on zero-length view.
12436 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
12437 symbol table when there are no symbols to read.
12438
c43d3a48
CS
124392008-06-23 Craig Silverstein <csilvers@google.com>
12440
12441 * version.cc (version_string): Bump to 1.7
12442
5f494ea0
CS
124432008-06-18 Craig Silverstein <csilvers@google.com>
12444
12445 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
12446 constant 0xFFFF to type Valtype.
12447 (Powerpc_relocate_functions::rel16_ha): Likewise.
12448
c42e122e
ILT
124492008-06-17 Ian Lance Taylor <iant@google.com>
12450
f34787f8
ILT
12451 * output.h (Output_section::Input_section): Initialize p2align_ to
12452 zero for Output_section_data constructors.
12453 (Output_section::Input_section::addralign): If not an input
12454 section, return the alignment of the Output_section_data.
12455 * testsuite/copy_test.cc: New file.
12456 * testsuite/copy_test_1.cc: New file.
12457 * testsuite/copy_test_2.cc: New file.
12458 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
12459 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
12460 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
12461 (copy_test_1_pic.o, copy_test_1.so): New targets.
12462 (copy_test_2_pic.o, copy_test_2.so): New targets.
12463 * testsuite/Makefile.in: Rebuild.
12464
c42e122e
ILT
12465 * script-sections.cc (Script_sections::place_orphan): Initialize
12466 local variable exact.
12467
ce3ac18a
DE
124682008-06-13 David Edelsohn <edelsohn@gnu.org>
12469
12470 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
12471
42cacb20
DE
124722008-06-12 David Edelsohn <edelsohn@gnu.org>
12473 David S. Miller <davem@davemloft.net>
12474
12475 * powerpc.cc: New file.
12476 * Makefile.am (TARGETSOURCES): Add powerpc.cc
12477 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
12478 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
12479 * Makefile.in: Rebuild.
12480
7b308235
ILT
124812008-06-09 Ian Lance Taylor <iant@google.com>
12482
12483 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
12484 <exception>.
12485 (throwing, orig_terminate): New static variables.
12486 (terminate_handler): New static function.
12487 (t2): Set terminate handler.
12488
f0b886e3
ILT
124892008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
12490
12491 PR 6584
cd536b21 12492 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
12493 alignment.
12494
3e90f135
CC
124952008-05-30 Cary Coutant <ccoutant@google.com>
12496
12497 * archive.cc (Archive::include_all_members) Correct to step
12498 over symbol table and extended name table in thin archives.
12499
e09ad04a
ILT
125002008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
12501
12502 PR 6407
12503 * target-reloc.h (relocate_for_relocatable): Fix new_offset
12504 calculation.
12505
62b01cb5
ILT
125062008-05-28 Caleb Howe <cshowe@google.com>
12507
12508 * reduced_debug_output.cc: New file.
12509 * reduced_debug_output.h: New file.
92de84a6 12510 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
12511 * options.cc (General_options::finalize): Add strip_debug_non_line
12512 to the strip heirarchy.
12513 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
12514 fields.
12515 * layout.cc: Include "reduced_debug_output.h".
12516 (Layout::Layout): Initialize new fields.
12517 (line_only_debug_sections): New static array.
12518 (is_lines_only_debug_sections): New static inline function.
12519 (Layout::include_section): Handle --strip-debug-non-line.
12520 (Layout::make_output_section): If --strip-debug-non-line, build
12521 new output sections for .debug_abbrev and .debug_info.
12522 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
12523 gold. Warn about possible overflow.
12524 (read_signed_LEB_128): Likewise.
12525 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
12526 (read_signed_LEB_128): Declare.
12527 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
12528 (HFILES): Add reduced_debug_output.h.
12529 * Makefile.in: Rebuild.
12530
7d9e3d98
ILT
125312008-05-21 Ian Lance Taylor <iant@google.com>
12532
12533 * mapfile.cc: New file.
12534 * mapfile.h: New file.
12535 * options.h (class General_options): Add -M/--print-map and -Map.
12536 * options.cc (General_options::finalize): Make -M equivalent to
12537 -Map -.
12538 * main.cc: Include <cstdio> and "mapfile.h".
12539 (main): Open mapfile if requested.
12540 * gold.cc (class Middle_runner): Add mapfile_ field. Update
12541 constructor. Change caller.
12542 (queue_initial_tasks): Add mapfile parameter. Change caller.
12543 (queue_middle_tasks): Likewise.
12544 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
12545 declarations.
12546 * archive.cc: Include "mapfile.h".
12547 (Archive::add_symbols): Add mapfile parameter. Change all
12548 callers. Pass mapfile, symbol, and reason to include_member.
12549 (Archive::include_all_members): Add mapfile parameter. Change all
12550 callers.
12551 (Archive::include_member): Add mapfile, sym, and why parameters.
12552 Change all callers. Report inclusion to map file.
12553 * archive.h: Include "fileread.h".
12554 (class Archive): Update declarations.
12555 (Archive::file): New const method.
12556 (class Add_archive_symbols): Add mapfile_ field. Update
12557 constructor. Change all callers.
12558 * readsyms.h (class Read_symbols): Likewise.
12559 (class Finish_group): Likewise.
12560 (class Read_script): Likewise.
12561 * common.cc: Include "mapfile.h".
12562 (Symbol_table::allocate_commons): Add mapfile parameter. Change
12563 all callers.
12564 (Symbol_table::do_allocate_commons): Likewise.
12565 (Symbol_table::do_allocate_commons_list): Likewise. Report common
12566 symbol allocation to mapfile.
12567 * common.h (class Allocate_commons_task): Add mapfile_ field.
12568 Update constructor. Change all callers.
12569 * symtab.h (class Symbol_table): Update declarations.
12570 * layout.cc: Include "mapfile.h".
12571 (Layout_task_runner::run): Print information to mapfile.
12572 (Layout::create_gold_note): Change Output_data_fixed_space to
12573 Output_data_zero_fill.
12574 (Layout::create_build_id): Likewise.
12575 (Layout::print_to_mapfile): New function.
12576 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
12577 constructor. Change caller.
12578 (class Layout): Declare print_to_mapfile.
12579 * output.cc (Output_section::Input_section::print_to_mapfile): New
12580 function.
12581 (Output_section::add_input_section): If producing a map, always
12582 add to input_sections_ list.
12583 (Output_section::do_print_to_mapfile): New function.
12584 (Output_segment::print_sections_to_mapfile): New function.
12585 (Output_segment::print_section_list_to_mapfile): New function.
12586 * output.h: Include "mapfile.h".
12587 (Output_data::print_to_mapfile): New function.
12588 (Output_data::do_print_to_mapfile): New virtual function.
12589 (Output_segment_headers::do_print_to_mapfile): New function.
12590 (Output_file_header::do_print_to_mapfile): New function.
12591 (Output_data_const::do_print_to_mapfile): New function.
12592 (class Output_data_const_buffer): Add map_name_ field. Update
12593 constructor. Change all callers. Add do_print_to_mapfile
12594 function.
12595 (class Output_data_fixed_space): Likewise.
12596 (class Output_data_space): Likewise.
12597 (class Output_data_zero_fill): New class.
12598 (Output_data_strtab::do_print_to_mapfile): New function.
12599 (Output_data_reloc_base::do_print_to_mapfile): New function.
12600 (Output_relocatable_relocs::do_print_to_mapfile): New function.
12601 (Output_data_group::do_print_to_mapfile): New function.
12602 (Output_data_got::do_print_to_mapfile): New function.
12603 (Output_data_dynamic::do_print_to_mapfile): New function.
12604 (Output_symtab_xindex::do_print_to_mapfile): New function.
12605 (class Output_section): Declare do_print_to_mapflie. Declare
12606 print_to_mapfile in Input_section.
12607 (class Output_segment): Declare new functions.
12608 * object.h (Sized_relobj::symbol_count): New function.
12609 * script-sections.cc
12610 (Output_section_element_dot_assignment::set_section_addresses):
12611 Change Output_data_fixed_space to Output_data_zero_fill.
12612 (Output_data_expression::do_print_to_mapfile): New function.
12613 * script.cc (read_input_script): Add mapfile parameter. Change
12614 all callers.
12615 * script.h (read_input_script): Update declaration.
12616 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
12617 (Eh_frame::do_print_to_mapfile): New function.
12618 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
12619 (Output_merge_string::do_print_to_mapfile): New function.
12620 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
12621 function.
12622 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
12623 function.
12624 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
12625 function.
12626 * Makefile.am (CCFILES): Add mapfile.cc.
12627 (HFILES): Add mapfile.h.
12628 * Makefile.in: Rebuild.
12629
9f1d377b
ILT
126302008-05-19 Ian Lance Taylor <iant@google.com>
12631
12632 * options.h (class General_options): Add -z relro.
12633 * layout.cc (Layout::Layout): Initialize relro_segment_.
12634 (Layout::add_output_section_data): Return the output section.
12635 (Layout::make_output_section): Rcognize relro sections and mark
12636 them appropriately.
12637 (Layout::attach_allocated_section_to_segment): Put relro sections
12638 in a PT_GNU_RELRO segment.
12639 (Layout::create_initial_dynamic_sections): Mark the .dynamic
12640 section as relro.
12641 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
12642 PT_TLS segments.
12643 (Layout::linkonce_mapping): Map d.rel.ro.local to
12644 .data.rel.ro.local.
12645 (Layout::output_section_name): Us .data.rel.ro.local for any
12646 section which begins with that.
12647 * layout.h (class Layout): Update add_output_section_data
12648 declaration. Add relro_segment_ field.
12649 * output.cc (Output_section::Output_section): Initialize is_relro_
12650 and is_relro_local_ fields.
12651 (Output_segment::add_output_section): Group relro sections.
12652 (Output_segment::is_first_section_relro): New function.
12653 (Output_segment::maximum_alignment): If there is a relro section,
12654 align the segment to the common page size.
12655 (Output_segment::set_section_addresses): Track whether we are
12656 looking at relro sections. If the last section is a relro
12657 section, align to the common page size.
12658 (Output_segment::set_section_list_addresses): Add in_relro
12659 parameter. Change all callers. Align to the page size when
12660 moving from relro to non-relro section.
12661 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
12662 segment.
12663 * output.h (class Output_section): Add is_relro_ and
12664 is_relro_local_ fields.
12665 (Output_section::is_relro): New function.
12666 (Output_section::set_is_relro): New function.
12667 (Output_section::is_relro_local): New function.
12668 (Output_section::set_is_relro_local): New function.
12669 (class Output_segment): Update declarations.
12670 * i386.cc (Target_i386::got_section): Mark .got section as relro.
12671 * sparc.cc (Target_sparc::got_section): Likewise.
12672 * x86_64.cc (Target_x86_64::got_section): Likewise.
12673 * testsuite/relro_test_main.cc: New file.
12674 * testsuite/relro_test.cc: New file.
12675 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
12676 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
12677 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
12678 (relro_test.so, relro_test_pic.o): New targets.
12679 * testsuite/Makefile.in: Rebuild.
12680
a984ee1d
ILT
126812008-05-16 Ian Lance Taylor <iant@google.com>
12682
01676dcd
ILT
12683 * output.cc (Output_segment::add_output_section): Remove front
12684 parameter.
12685 * output.h (class Output_segment): Remove
12686 add_initial_output_section and overloaded add_output_section.
12687 Update declaration of remaining add_output_section.
12688 * layout.cc (Layout::create_interp): Call add_output_section
12689 rather than add_initial_output_section.
12690 (Layout::finish_dynamic_section): Likewise.
12691
497897f9
ILT
12692 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
12693 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
12694 know the dynamic type.
12695 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
12696 field. Initialize it in constructor.
12697 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
12698 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
12699 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
12700 reloc.
12701
a984ee1d
ILT
12702 * output.cc (Output_reloc::get_address): Change return type to
12703 Elf_Addr.
12704 * output.h (class Output_reloc): Update get_address declaration.
12705 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
12706 for section addresses.
12707
55ba0940
ILT
127082008-05-09 Ian Lance Taylor <iant@google.com>
12709
12710 PR 6493
12711 * gold.cc (gold_nomem): Use return value of write.
12712
75517b77
ILT
127132008-05-08 Ian Lance Taylor <iant@google.com>
12714
12715 * symtab.c (Symbol::init_base_output_data): Add version
12716 parameter. Change all callers.
12717 (Symbol::init_base_output_segment): Likewise.
12718 (Symbol::init_base_constant): Likewise.
12719 (Symbol::init_base_undefined): Likewise.
12720 (Sized_symbol::init_output_data): Likewise.
12721 (Sized_symbol::init_output_segment): Likewise.
12722 (Sized_symbol::init_constant): Likewise.
12723 (Sized_symbol::init_undefined): Likewise.
12724 (Symbol_table::do_define_in_output_data): If the new symbol has a
12725 version, mark it as the default.
12726 (Symbol_table::do_define_in_output_segment): Likewise.
12727 (Symbol_table::do_define_as_constant): Likewise.
12728 * symtab.h (class Symbol): Update declarations.
12729 (class Sized_symbol): Likewise.
12730 * resolve.cc (Symbol::override_version): New function.
c42e122e 12731 (Symbol::override_base): Call override_version.
75517b77
ILT
12732 (Symbol::override_base_with_special): Likewise.
12733 * testsuite/ver_script_8.script: New file.
12734 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
12735 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
12736 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
12737 (ver_test_8_1.so, ver_test_8_2.so): New targets.
12738
f1f70eae
ILT
127392008-05-06 Ian Lance Taylor <iant@google.com>
12740
f3e9c5c5
ILT
12741 PR 6049
12742 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
12743 functions.
12744 (class General_options): Remove existing --undefined, and add
12745 --no-undefined instead. Add new --undefined as synonym for -u.
12746 * archive.cc (Archive::add_symbols): Check whether symbol was
12747 named with -u.
12748 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
12749 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
12750 all uses. Add IS_UNDEFINED. Update declarations to split
12751 different versions of init_base. Declare init_base_undefined.
12752 (Symbol::is_defined): Handle IS_UNDEFINED.
12753 (Symbol::is_undefined): Likewise.
12754 (Symbol::is_weak_undefined): Call is_undefined.
12755 (Symbol::is_absolute): Handle IS_CONSTANT.
12756 (class Sized_symbol): Update declarations to split different
12757 versions of init. Declare init_undefined.
12758 (class Symbol_table): Declare new functions.
12759 * symtab.cc (Symbol::init_base_object): Rename from init_base.
12760 Change all callers.
12761 (Symbol::init_base_output_data): Likewise.
12762 (Symbol::init_base_output_segment): Likewise.
12763 (Symbol::init_base_constant): Likewise.
12764 (Symbol::init_base_undefined): New function.
12765 (Sized_symbol::init_object): Rename from init. Change all
12766 callers.
12767 (Sized_symbol::init_output_data): Likewise.
12768 (Sized_symbol::init_output_segment): Likewise.
12769 (Sized_symbol::init_constant): Likewise.
12770 (Sized_symbol::init_undefined): New function.
12771 (Symbol_table::add_undefined_symbols_from_command_line): New
12772 function.
12773 (Symbol_table::do_add_undefined_symbols_from_command_line): New
12774 function.
12775 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
12776 (Symbol::output_section): Likewise.
12777 (Symbol::set_output_section): Likewise.
12778 (Symbol_table::sized_finalize_symbol): Likewise.
12779 (Symbol_table::sized_write_globals): Likewise.
12780 * resolve.cc (Symbol_table::should_override): Likewise.
12781 (Symbol::override_base_with_special): Likewise.
12782
8bdcdf2c
ILT
12783 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
12784 symbol, change it to have default visibility.
12785 * testsuite/protected_1.cc: New file.
12786 * testsuite/protected_2.cc: New file.
12787 * testsuite/protected_3.cc: New file.
12788 * testsuite/protected_main_1.cc: New file.
12789 * testsuite/protected_main_2.cc: New file.
12790 * testsuite/protected_main_3.cc: New file.
12791 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
12792 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
12793 (protected_1_LDFLAGS, protected_1_LDADD): Define.
12794 (protected_1.so): New target.
12795 (protected_1_pic.o, protected_2_pic.o): New targets.
12796 (protected_3_pic.o): New target.
12797 (check_PROGRAMS): Add protected_2.
12798 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
12799 (protected_2_LDFLAGS, protected_2_LDADD): Define.
12800 * testsuite/Makefile.in: Rebuild.
12801
2b706932
ILT
12802 * options.h (DEFINE_var): Add set_user_set_##varname__.
12803 (DEFINE_bool_alias): New macro.
12804 (class General_options): Define -Bstatic using DEFINE_bool_alias
12805 rather than DEFINE_special. Add --undefined as an alias for -z
12806 defs.
12807 * options.cc (General_options::parse_Bstatic): Remove.
12808
d82a5bcc
ILT
12809 * options.h (class General_options): Add --fatal-warnings.
12810 * main.cc (main): Implement --fatal-warnings.
12811 * errors.h (Errors::warning_count): New function.
12812
f1f70eae
ILT
12813 * options.h (class General_options): Add -Bsymbolic-functions.
12814 * symtab.h (Symbol::is_preemptible): Check for
12815 -Bsymbolic-functions.
12816
8825ac63
ILT
128172008-05-05 Ian Lance Taylor <iant@google.com>
12818
d98bc257
ILT
12819 * options.h (DEFINE_bool): For DASH_Z, create the negative option
12820 as noVARNAME rather than no-VARNAME.
12821 (class General_options): Add option -z combreloc.
12822 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
12823 get_address.
12824 (Output_reloc::sort_before) [SHT_REL]: New function.
12825 (Output_reloc::sort_before) [SHT_RELA]: New function.
12826 (class Output_data_reloc_base): Add sort_relocs_ field. Define
12827 Sort_relocs_comparison.
12828 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
12829 parameter. Change all callers.
12830 (Output_data_reloc::Output_data_reloc) [both versions]: Add
12831 sort_relocs parameter. Change all callers.
12832 * output.cc (Output_reloc::get_address): New function, broken out
12833 of write_rel.
12834 (Output_reloc::write_rel): Call it.
12835 (Output_reloc::compare): New function.
12836 (Output_data_reloc_base::do_write): Optionally sort relocs.
12837
60b2b4e7
ILT
12838 * configure.ac: If targ_extra_obj is set, link it in.
12839 * configure.tgt: Initialize all variables.
12840 (x86_64*): Set targ_extra_obj and targ_extra_size.
12841 * configure: Rebuild.
12842
8825ac63
ILT
12843 * object.cc (Sized_relobj::include_section_group): Adjust section
12844 indexes read from group data. Build vector to pass to
12845 layout_group.
12846 * layout.cc (Layout::layout_group): Add flags and shndxes
12847 parameters. Remove contents parameter. Change caller. Update
12848 explicit instantiations.
12849 * layout.h (class Layout): Update layout_group declaration.
12850 * output.cc (Output_data_group::Output_data_group): Add flags and
12851 input_shndxes parameters. Remove contents parameter. Change
12852 caller.
12853 (Output_data_group::do_write): Change input_sections_ to
12854 input_shndxes_.
12855 * output.h (class Output_data_group): Update constructor
12856 declaration. Rename input_sections_ to input_shndxes_.
12857 * testsuite/many_sections_test.cc: Add template.
12858
e94cf127
CC
128592008-04-30 Cary Coutant <ccoutant@google.com>
12860
4418b2d5
CC
12861 * target-reloc.h (relocate_section): Fix dead-pointer bug.
12862
e94cf127
CC
12863 * layout.cc (Layout::include_section): Refactored check for debug
12864 info section.
12865 (Layout::add_comdat): Add new parameters. Change type
12866 of signature parameter. Add object and shndx to signatures table.
12867 (Layout::find_kept_object): New function.
12868 * layout.h: Include <cstring>.
12869 (Layout::is_debug_info_section): New function.
12870 (Layout::add_comdat): Add new parameters.
12871 (Layout::find_kept_object): New function.
12872 (Layout::Kept_section): New struct.
12873 (Layout::Signatures): Change type of map range.
12874 * object.cc (Relobj::output_section_address): New function.
12875 (Sized_relobj::include_section_group): Add new parameters. Change
12876 calls to Layout::add_comdat. Change to build table of kept comdat
12877 groups and table mapping discarded sections to kept sections.
12878 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
12879 (Sized_relobj::do_layout): Change calls to include_section_group and
12880 include_linkonce_section.
12881 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
12882 value to zero when section is discarded.
12883 (Sized_relobj::map_to_kept_section): New function.
12884 * object.h (Relobj::output_section_address): New function.
12885 (Relobj::Comdat_group): New type.
12886 (Relobj::find_comdat_group): New function.
12887 (Relobj::Comdat_group_table): New type.
12888 (Relobj::Kept_comdat_section): New type.
12889 (Relobj::Kept_comdat_section_table): New type.
12890 (Relobj::add_comdat_group): New function.
12891 (Relobj::set_kept_comdat_section): New function.
12892 (Relobj::get_kept_comdat_section): New function.
12893 (Relobj::comdat_groups_): New field.
12894 (Relobj::kept_comdat_sections_): New field.
12895 (Symbol_value::input_value): Update comment.
12896 (Sized_relobj::map_to_kept_section) New function.
12897 (Sized_relobj::include_linkonce_section): Add new parameter.
12898 * target-reloc.h (Comdat_behavior): New type.
12899 (get_comdat_behavior): New function.
12900 (relocate_section): Add code to map a discarded section to the
12901 corresponding kept section when applying a relocation.
12902
e4e5049b
CS
129032008-04-30 Craig Silverstein <csilvers@google.com>
12904
12905 * dwarf_reader.cc (next_generation_count): New static var.
12906 (Addr2line_cache_entry): New struct.
12907 (addr2line_cache): New static var.
12908 (Dwarf_line_info::one_addr2line): Added caching.
12909 (Dwarf_line_info::clear_addr2line_cache): New function.
12910 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
12911 cache-size parameter.
12912 (Dwarf_line_info::one_addr2line_cache): New function.
12913 * symtab.cc (Symbol_table::detect_odr_violations): Pass
12914 new cache-size argument to one_addr2line(), and clear cache.
12915
d09e9154
CC
129162008-04-28 Cary Coutant <ccoutant@google.com>
12917
12918 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
12919 R_386_PC8 relocations.
12920
7ef73768
ILT
129212008-04-23 Ian Lance Taylor <iant@google.com>
12922
55438702
ILT
12923 * object.cc (Sized_relobj::include_section_group): Check for
12924 invalid section group.
12925
c165fb93
ILT
12926 * object.cc (make_elf_object): Correct test for 64-bit ELF file
12927 header size.
12928
7ef73768
ILT
12929 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
12930 than read for file header.
12931 * archive.cc (Archive::include_member): Likewise.
12932
6194aaab
L
129332008-04-23 Paolo Bonzini <bonzini@gnu.org>
12934
12935 * aclocal.m4: Regenerate.
12936 * configure: Regenerate.
12937
d491d34e
ILT
129382008-04-19 Ian Lance Taylor <iant@google.com>
12939
5ea2bac6
ILT
12940 * version.cc (version_string): Bump to 1.6.
12941
7bc3e21a
ILT
12942 * testsuite/Makefile.am (many_sections_r_test): New target.
12943 (many_sections_r_test_SOURCES): Remove.
12944 (many_sections_r_test_DEPENDENCIES): Remove.
12945 (many_sections_r_test_LDFLAGS): Remove.
12946 (many_sections_r_test_LDADD): Remove.
12947
7fcd3aa9
ILT
12948 * object.cc (Sized_relobj::do_add_symbols): Always pass
12949 local_symbol_count_ to add_from_relobj.
12950
4c94d6ae
ILT
12951 * testsuite/Makefile.am (many_sections_check.h): Only check one in
12952 every thousand variables.
12953 * testsuite/Makefile.in: Rebuild.
12954
d491d34e
ILT
12955 * object.cc (Xindex::initialize_symtab_xindex): New function.
12956 (Xindex::read_symtab_xindex): New function.
12957 (Xindex::sym_xindex_to_shndx): New function.
12958 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
12959 available.
12960 (Sized_relobj::do_initialize_xindex): New function.
12961 (Sized_relobj::do_read_symbols): Adjust section links.
12962 (Sized_relobj::symbol_section_and_value): Add is_ordinary
12963 parameter. Change all callers.
12964 (Sized_relobj::include_section_group): Adjust section links and
12965 symbol section indexes.
12966 (Sized_relobj::do_layout): Adjust section links.
12967 (Sized_relobj::do_count_local_symbols): Adjust section links and
12968 symbol section indexes.
12969 (Sized_relobj::do_finalize_local_symbols): Distinguish between
12970 ordinary and special symbols.
12971 (Sized_relobj::write_local_symbols): Add symtab_xindex and
12972 dynsym_xindex parameters. Change all callers. Adjust section
12973 links. Use SHN_XINDEX when needed.
12974 (Sized_relobj::get_symbol_location_info): Adjust section links.
12975 Don't get fooled by special symbols.
12976 * object.h (class Xindex): Define.
12977 (class Object): Add xindex_ parameter. Declare virtual functoin
12978 do_initialize_xindex.
12979 (Object::adjust_sym_shndx): New function.
12980 (Object::set_xindex): New protected function.
12981 (class Symbol_value): Add is_ordinary_shndx_ field.
12982 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
12983 (Symbol_value::value): Assert ordinary section.
12984 (Symbol_value::initialize_input_to_output_map): Likewise.
12985 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
12986 Change all callers.
12987 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
12988 all callers.
12989 (class Sized_relobj): Update declarations.
12990 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
12991 parameter. Change all callers.
12992 (Sized_relobj::adjust_shndx): New function.
12993 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
12994 field.
12995 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
12996 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
12997 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
12998 (Sized_dynobj::read_dynsym_section): Adjust section links.
12999 (Sized_dynobj::read_dynamic): Likewise.
13000 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
13001 section links.
13002 (Sized_dynobj::do_initialize_xindex): New function.
13003 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
13004 do_initialize_xindex.
13005 (Sized_dynobj::adjust_shndx): New function.
13006 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
13007 dynsym_xindex_ fields.
13008 (Layout::finalize): Add a call to set_section_indexes before
13009 creating the symtab sections.
13010 (Layout::set_section_indexes): Don't do anything if the section
13011 already has a section index.
13012 (Layout::create_symtab_sections): Add shnum parameter. Change
13013 caller. Create .symtab_shndx section if needed.
13014 (Layout::create_shdrs): Add shstrtab_section parameter. Change
13015 caller.
13016 (Layout::allocated_output_section_count): New function.
13017 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
13018 needed.
13019 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
13020 fields. Update declarations.
13021 (Layout::symtab_xindex): New function.
13022 (Layout::dynsym_xindex): New function.
13023 (class Write_symbols_task): Add layout_ field.
13024 (Write_symbols_task::Write_symbols_task): Add layout parameter.
13025 Change caller.
13026 * output.cc (Output_section_headers::Output_section_headers): Add
13027 shstrtab_section parameter. Change all callers.
13028 (Output_section_headers::do_sized_write): Store overflow values
13029 for section count and section string table section index in
13030 section header zero.
13031 (Output_file_header::do_sized_write): Check for overflow of
13032 section count and section string table section index.
13033 (Output_symtab_xindex::do_write): New function.
13034 (Output_symtab_xindex::endian_do_write): New function.
13035 * output.h (class Output_section_headers): Add shstrtab_section_.
13036 Update declarations.
13037 (class Output_symtab_xindex): Define.
13038 (Output_section::has_out_shndx): New function.
13039 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
13040 field.
13041 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
13042 Change all callers.
13043 (Sized_symbol::init): Likewise.
13044 (Symbol::output_section): Check for ordinary symbol.
13045 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
13046 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
13047 callers.
13048 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
13049 Change all callers. Simplify handling of symbols from sections
13050 not included in the link.
13051 (Symbol_table::add_from_dynobj): Handle ordinary symbol
13052 distinction.
13053 (Weak_alias_sorter::operator()): Assert that symbols are
13054 ordinary.
13055 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
13056 distinction.
13057 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
13058 parameters. Change all callers.
13059 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
13060 symbol distinction. Use SHN_XINDEX when needed.
13061 (Symbol_table::write_section_symbol): Add symtab_xindex
13062 parameter. Change all callers.
13063 (Symbol_table::sized_write_section_symbol): Likewise. Use
13064 SHN_XINDEX when needed.
13065 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
13066 declarations.
13067 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
13068 (Symbol::is_defined): Check is_ordinary.
13069 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
13070 (Symbol::is_absolute, Symbol::is_common): Likewise.
13071 (class Sized_symbol): Update declarations.
13072 (class Symbol_table): Update declarations.
13073 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
13074 parameters. Change all callers.
13075 (Sized_symbol::override): Likewise.
13076 (Symbol_table::override): Likewise.
13077 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
13078 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
13079 is_ordinary, and orig_st_shndx parameters. Change all callers.
13080 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
13081 to be in an ordinary section.
13082 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
13083 object and is_ordinary parameters. Change all callers.
13084 (Sized_dwarf_line_info::read_relocs): Add object parameter.
13085 Change all callers. Don't add undefined or non-ordinary symbols
13086 to reloc_map_.
13087 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
13088 Change all callers.
13089 * dwarf_reader.h (class Sized_dwarf_line_info): Update
13090 declarations.
13091 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
13092 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
13093 (Sized_relobj::relocate_sections): Likewise.
13094 * target-reloc.h (scan_relocs): Adjust section symbol index.
13095 (scan_relocatable_relocs): Likewise.
13096 * i386.cc (Scan::local): Check for ordinary symbols.
13097 * sparc.cc (Scan::local): Likewise.
13098 * x86_64.cc (Scan::local): Likewise.
13099 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
13100 to symbol_section_and_value.
13101 * testsuite/many_sections_test.cc: New file.
13102 * testsuite/Makefile.am (BUILT_SOURCES): Define.
13103 (check_PROGRAMS): Add many_sections_test.
13104 (many_sections_test_SOURCES): Define.
13105 (many_sections_test_DEPENDENCIES): Define.
13106 (many_sections_test_LDFLAGS): Define.
13107 (BUILT_SOURCES): Add many_sections_define.h.
13108 (many_sections_define.h): New target.
13109 (BUILT_SOURCES): Add many_sections_check.h.
13110 (many_sections_check.h): New target.
13111 (check_PROGRAMS): Add many_sections_r_test.
13112 (many_sections_r_test_SOURCES): Define.
13113 (many_sections_r_test_DEPENDENCIES): Define.
13114 (many_sections_r_test_LDFLAGS): Define.
13115 (many_sections_r_test_LDADD): Define.
13116 (many_sections_r_test.o): New target.
13117 * testsuite/Makefile.in: Rebuild.
13118
c5818ff1
CC
131192008-04-17 Cary Coutant <ccoutant@google.com>
13120
13121 * errors.cc (Errors::info): New function.
13122 (gold_info): New function.
13123 * errors.h (Errors::info): New function.
13124 * gold.h (gold_info): New function.
13125 * object.cc (Input_objects::add_object): Print trace output.
13126 * options.cc (options::parse_set): New function.
13127 (General_options::parse_wrap): Deleted.
13128 (General_options::General_options): Deleted initializer.
13129 * options.h (options::String_set): New typedef.
13130 (options::parse_set): New function.
13131 (DEFINE_set): New macro.
13132 (General_options::wrap): Changed to use DEFINE_set. Changed
13133 callers of any_wrap_symbols and is_wrap_symbol.
13134 (General_options::trace, General_options::trace_symbol):
13135 New options.
13136 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
13137 (General_options::wrap_symbols_): Deleted.
13138 * symtab.cc (Symbol_table::add_from_object): Print trace output.
13139
b5be4a7c
DM
131402008-04-17 David S. Miller <davem@davemloft.net>
13141
13142 * options.cc (General_options::parse_V): New function.
13143 * options.h: Add entries for -V and -Qy.
13144
155a0dd7
ILT
131452008-04-17 Ian Lance Taylor <iant@google.com>
13146
13147 * common.cc (Symbol_table::allocate_commons): Remove options
13148 parameter. Change caller.
13149 (Symbol_table::do_allocate_commons): Remove options parameter.
13150 Change caller. Just call do_allocate_commons_list twice.
13151 (Symbol_table::do_allocate_commons_list): New function, broken out
13152 of do_allocate_commons.
13153 * common.h (class Allocate_commons_task): Remove options_ field.
13154 Update constructor.
13155 * symtab.cc (Symbol_table::Symbol_table): Initialize
13156 tls_commons_.
13157 (Symbol_table::add_from_object): Put TLS common symbols on
13158 tls_commons_ list.
13159 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
13160 which are IN_OUTPUT_DATA.
13161 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
13162 allocate_commons and do_allocate_commons declarations. Declare
13163 do_allocate_commons_list.
13164 * gold.cc (queue_middle_tasks): Update creation of
13165 Allocate_commons_task to not pass options.
13166 * testsuite/Makefile.am (INCLUDES): Add -I.. .
13167 (TLS_TEST_C_FLAGS): New variable.
13168 (tls_test_c_pic.o): New target.
13169 (tls_test_shared.so): Link in tls_test_c_pic.o.
13170 (tls_test_c_pic_ie.o): New target.
13171 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
13172 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
13173 (tls_test_c.o): New target.
13174 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
13175 (tls_pic_test_LDADD): Likewise.
13176 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
13177 (tls_shared_gd_to_ie_test_LDADD): Likewise.
13178 (tls_test_c_gnu2.o): New target.
13179 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
13180 tls_test_c_gnu2.o.
13181 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
13182 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
13183 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
13184 * testsuite/tls_test.cc: Include "config.h".
13185 (t_last): Call t11_last.
13186 * testsuite/tls_test.h (t11, t11_last): Declare.
13187 * testsuite/tls_test_c.c: New file.
13188 * testsuite/tls_test_main.cc (thread_routine): Call t11.
13189 * configure.ac: Check for OpenMP support.
13190 * configure, config.in, Makefile.in: Rebuild.
13191 * testsuite/Makefile.in: Rebuild.
13192
edfbb029
CC
131932008-04-16 Cary Coutant <ccoutant@google.com>
13194
13195 * i386.cc (Target_i386::define_tls_base_symbol): New function.
13196 (Target_i386::tls_base_symbol_defined_): New field.
13197 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
13198 (Target_i386::Scan::global): Likewise.
13199 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
13200 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
13201 (Target_x86_64::tls_base_symbol_defined_): New field.
13202 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
13203 (Target_x86_64::Scan::global): Likewise.
13204
f3c69fca
CC
132052008-04-16 Cary Coutant <ccoutant@google.com>
13206
13207 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
13208 (Symbol::needs_plt_entry): Allow weak undefined symbols.
13209 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
13210 building shared libraries.
13211 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
13212 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
13213 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
13214 * testsuite/Makefile.in: Rebuild.
13215 * testsuite/weak_undef.h: New file.
13216 * testsuite/weak_undef_file1.cc: Add extra test cases.
13217 * testsuite/weak_undef_file2.cc: Likewise.
13218 * testsuite/weak_undef_test.cc: Likewise.
13219
7c414435
DM
132202008-04-16 David S. Miller <davem@davemloft.net>
13221
32b769e1
DM
13222 * sparc.cc (Target_sparc::Scan): Change from struct to class.
13223 Add issued_non_pic_error_ field. Declare check_non_pic.
13224 (Target_sparc::Scan::check_non_pic): New function.
13225 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
13226 (Target_sparc::Scan::global): Likewise.
13227
11936fb1
DM
13228 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
13229 * configure: Rebuild.
13230
7c414435
DM
13231 * options.h (DEFINE_enable): New macro.
13232 (new_dtags): New enable option.
13233 (initfirst, interpose, loadfltr, nodefaultlib,
13234 nodelete, nodlopen, nodump): New -z options.
13235 * layout.cc (Layout:finish_dynamic_section): If new
13236 dtags enabled, emit DT_RUNPATH. Also, emit a
13237 DT_FLAGS_1 containing any specified -z flags.
13238
85c7bf8b
ILT
132392008-04-16 Ian Lance Taylor <iant@google.com>
13240
12c0daef
ILT
13241 * copy-relocs.cc: New file.
13242 * copy-relocs.h: New file.
13243 * reloc.cc: Remove Copy_relocs code.
13244 * reloc.h: Likewise.
13245 * reloc-types.h (struct Reloc_types) [both versions]: Add
13246 get_reloc_addend_noerror.
13247 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
13248 variants of add_global which take an addend which must be zero.
13249 * i386.cc: Include "copy-relocs.h".
13250 (class Target_i386): Change type of copy_relocs_ to variable,
13251 update initializer.
13252 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
13253 Change all callers.
13254 (Target_i386::do_finalize_sections): Change handling of
13255 copy_relocs_.
13256 * sparc.cc: Include "copy-relocs.h".
13257 (class Target_sparc): Change type of copy_relocs_ to variable,
13258 update initializer.
13259 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
13260 Change all callers.
13261 (Target_sparc::do_finalize_sections): Change handling of
13262 copy_relocs_.
13263 * x86_64.cc: Include "copy-relocs.h".
13264 (class Target_x86_64): Change type of copy_relocs_ to variable,
13265 update initializer.
13266 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
13267 class. Change all callers.
13268 (Target_x86_64::do_finalize_sections): Change handling of
13269 copy_relocs_.
13270 * Makefile.am (CCFILES): Add copy-relocs.cc.
13271 (HFILES): Add copy-relocs.h.
13272
4f4995b6
ILT
13273 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
13274
85c7bf8b
ILT
13275 * testsuite/script_test_4.sh: Permit leading zeroes.
13276
4f2a9edd
ILT
132772008-04-15 Ian Lance Taylor <iant@google.com>
13278
e6188289
ILT
13279 * script-sections.cc (Script_sections::create_segments): Use
13280 header_size_adjustment even when there is enough room for the
13281 headers.
13282 * testsuite/script_test_4.sh: New file.
13283 * testsuite/script_test_4.t: New file.
13284 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
13285 (check_DATA): Add script_test_4.stdout.
13286 (MOSTLYCLEANFILES): Likewise.
13287 (script_test_4): New target.
13288 (script_test_4.stdout): New target.
13289 * testsuite/Makefile.in: Rebuild.
13290
4f2a9edd
ILT
13291 * sparc.cc: Add definitions for Output_data_plt_sparc class
13292 constants.
13293
f5314dd5
DM
132942008-04-14 David S. Miller <davem@davemloft.net>
13295
13296 * sparc.cc: New file.
13297 * Makefile.am (TARGETSOURCES): Add sparc.cc
13298 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
13299 * configure.tgt: Document targ_extra_size and
13300 targ_extra_big_endian. Add entries for sparc-* and
13301 sparc64-*.
13302 * configure.ac: Handle targ_extra_size and
13303 targ_extra_big_endian.
13304 * Makefile.in: Rebuild.
13305 * configure: Likewise.
13306 * po/POTFILES.in: Likewise.
13307 * po/gold.pot: Likewise.
13308
154e0e9a
ILT
133092008-04-14 Ian Lance Taylor <iant@google.com>
13310
13311 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
13312 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
13313 in the name/type/flags to section mapping. Don't call
13314 allocate_output_section.
13315 (Layout::choose_output_section): Change parameter from adjust_name
13316 to is_input_section. Don't permit input sections after sections
13317 are attached to segments. Don't call allocate_output_section.
13318 (Layout::layout_eh_frame): Call update_flags_for_input_section,
13319 not write_enable_output_section.
13320 (Layout::make_output_section): Don't push to
13321 unattached_section_list_ nor call attach_to_segment. Call
13322 attach_section_to_segment if sections are attached.
13323 (Layout::attach_sections_to_segments): New function.
13324 (Layout::attach_section_to_segment): New function.
13325 (Layout::attach_allocated_section_to_segment): Rename from
13326 attach_to_segment. Remove flags parameter.
13327 (Layout::allocate_output_section): Remove function.
13328 (Layout::write_enable_output_section): Remove function.
13329 * layout.h (class Layout): Update for above changes. Add new
13330 field sections_are_attached_.
13331 * output.h (Output_section::update_flags_for_input_section): New
13332 function.
13333 * output.cc (Output_section::add_input_section): Call
13334 update_flags_for_input_section.
13335 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
13336
009a67a2
CC
133372008-04-11 Cary Coutant <ccoutant@google.com>
13338
13339 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
13340 thought unnecessary.
13341 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
13342
759b1a24
ILT
133432008-04-11 Ian Lance Taylor <iant@google.com>
13344
13345 * output.h (class Output_section_data): Remove inline definition
13346 of set_addralign.
13347 * output.cc (Output_section_data::set_addralign): New function.
13348
c2b45e22
CC
133492008-04-11 Cary Coutant <ccoutant@google.com>
13350
13351 Add support for TLS descriptors for i386 and x86_64.
13352 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
13353 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
13354 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
13355 GOT_TYPE_TLS_DESC.
13356 (Target_i386::got_mod_index_entry): Remove unnecessary code.
13357 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
13358 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
13359 relocations.
13360 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
13361 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
13362 Fix problem with initial-exec relocations.
13363 (Target_i386::Relocate::relocate_tls): Likewise.
13364 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
13365 relaxation.
13366 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
13367 support for section-plus-offset dynamic table entries.
13368 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
13369 (Output_data_dynamic::Dynamic_entry): Add support for
13370 section-plus-offset dynamic table entries.
13371 (Output_data_dynamic::Classification): Likewise.
13372 (Output_data_dynamic::classification_): Renamed offset_.
13373 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
13374 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
13375 (Target_x86_64::make_plt_section): New function.
13376 (Target_x86_64::reserve_tlsdesc_entries): New function.
13377 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
13378 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
13379 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
13380 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
13381 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
13382 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
13383 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
13384 add extra PLT entry for TLS descriptors.
13385 (Output_data_plt_x86_64::got_): New field.
13386 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
13387 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
13388 fields.
13389 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
13390 descriptors.
13391 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
13392 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
13393 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
13394 R_386_TLS_DESC_CALL relocations.
13395 (Target_x86_64::Scan::global): Likewise.
13396 (Target_x86_64::do_finalize_sections): Add dynamic table entries
13397 for TLS descriptors.
13398 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
13399 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
13400 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
13401 GD-to-IE relaxation.
13402 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
13403 and TLS_DESCRIPTORS.
13404 * Makefile.in: Rebuild.
13405 * configure: Rebuild.
13406 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
13407 (tls_test_shared2.so): New target.
13408 (tls_shared_gd_to_ie_test_SOURCES): New variable.
13409 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
13410 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
13411 (tls_shared_gd_to_ie_test_LDADD): New variable.
13412 (tls_shared_gnu2_gd_to_ie_test): New target.
13413 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
13414 New targets.
13415 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
13416 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
13417 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
13418 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
13419 (tls_shared_gnu2_test): New target.
13420 (tls_test_gnu2_shared.so): New target.
13421 (tls_shared_gnu2_test_SOURCES): New variable.
13422 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
13423 (tls_shared_gnu2_test_LDFLAGS): New variable.
13424 (tls_shared_gnu2_test_LDADD): New variable.
13425 * testsuite/Makefile.in: Rebuild.
13426 * testsuite/Makefile.
13427
83bfb6b7
ILT
134282008-04-11 Ian Lance Taylor <iant@google.com>
13429
13430 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
13431 justsyms.t.
13432 * testsuite/Makefile.in: Rebuild.
13433
13434 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
13435 long.
13436 * testsuite/script_test_2.cc (main): Adjust test.
13437
706e1f5e
ILT
134382008-04-11 David S. Miller <davem@davemloft.net>
13439 Ian Lance Taylor <iant@google.com>
13440
13441 * options.h (General_options): Add entries for '-Y' and
13442 '-relax'.
13443 * options.cc (General_options:finalize): If -Y was used, add those
13444 entries to the library path instead of the default "/lib" and
13445 "/usr/lib".
13446
7c98e6bb
DM
134472008-04-11 David S. Miller <davem@davemloft.net>
13448
13449 * testsuite/justsyms.t: Start at 0x100.
13450 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
13451 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
13452 long.
13453 * testsuite/script_test_2.cc: Adjust string and section length
13454 checks.
7c98e6bb 13455
99a37bfd
ILT
134562008-04-09 Ian Lance Taylor <iant@google.com>
13457
2cefc357
ILT
13458 PR gold/5996
13459 * script-sections.cc (Sections_element::allocate_to_segment): Add
13460 orphan parameter.
13461 (Output_section_definition::allocate_to_segment): Likewise.
13462 (Orphan_output_section::allocate_to_segment): Likewise.
13463 (Script_sections::attach_sections_using_phdrs_clause): Don't
13464 propagate non-PT_LOAD segments to orphan sections.
13465 * testsuite/Makefile.am (script_test_3.stdout): Generate using
13466 readelf rather than objdump.
13467 * testsuite/script_test_3.sh: Adjust accordingly. Test that
13468 .interp section and PT_INTERP segment are the same size.
13469 * testsuite/Makefile.in: Rebuild.
13470
99a37bfd
ILT
13471 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
13472 aliases for symbols defined in the same object.
13473 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
13474 (weak_alias_test_SOURCES): New variable.
13475 (weak_alias_test_DEPENDENCIES): New variable.
13476 (weak_alias_test_LDFLAGS): New variable.
13477 (weak_alias_test_LDADD): New variable.
13478 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
13479 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
13480 (weak_alias_test_3.o): New target.
13481 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
13482 * testsuite/weak_alias_test_main.cc: New file.
13483 * testsuite/weak_alias_test_1.cc: New file.
13484 * testsuite/weak_alias_test_2.cc: New file.
13485 * testsuite/weak_alias_test_3.cc: New file.
13486
780e49c5
ILT
134872008-04-08 Ian Lance Taylor <iant@google.com>
13488
cdb0b8f5
ILT
13489 * options.h (class General_options): Add --noinhibit-exec option.
13490 * main.cc (main): Check --noinhibit-exec.
13491
0864d551
ILT
13492 * options.h (class General_options): Define --wrap as a special
13493 option. Add wrap_symbols_ field.
13494 (General_options::any_wrap_symbols): New function.
13495 (General_options::is_wrap_symbol): New function.
13496 * options.cc (General_options::parse_wrap): New function.
13497 (General_options::General_options): Initialize wrap_symbols_.
13498 * symtab.cc (Symbol_table::wrap_symbol): New function.
13499 (Symbol_table::add_from_object): Handle --wrap.
13500 * symtab.h (class Symbol_table): Declare wrap_symbol.
13501 * target.h (Target::wrap_char): New function.
13502 (Target::Target_info): Add wrap_char field.
13503 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
13504 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13505 * testsuite/testfile.cc (Target_test::test_target_info):
13506 Likewise.
13507
789aa6de
ILT
13508 * errors.cc (Errors::undefined_symbol): Mention symbol version if
13509 there is one.
13510
2c38906f
ILT
13511 * layout.h (class Layout): Add added_eh_frame_data_ field.
13512 * layout.cc (Layout::Layout): Initialize new field.
13513 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
13514 output section until we find a section we merged successfully.
13515 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
13516 that the size be non-zero.
13517
780e49c5
ILT
13518 * merge.cc (Object_merge_map::get_output_offset): Remove inline
13519 qualifier.
13520
7fcd0256
ILT
135212008-04-08 Craig Silverstein <csilvers@google.com>
13522
13523 * configure.ac: Export new conditional variable HAVE_ZLIB.
13524 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
13525 on HAVE_ZLIB.
13526 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
13527 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13528
6835af53
ILT
135292008-04-07 Ian Lance Taylor <iant@google.com>
13530
e24f324c
ILT
13531 * version.cc (version_string): Set to "1.5".
13532
a036edd8
ILT
13533 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
13534 Add issued_non_pic_error_ field. Declare check_non_pic.
13535 (Target_x86_64::Scan::check_non_pic): New function.
13536 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
13537 (Target_x86_64::Scan::global): Likewise.
13538
624f8810
ILT
13539 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
13540 addend parameter. Change caller. Handle merge sections.
13541 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
13542 Address to Addend. Don't add in the result of
13543 local_section_offset, pass down the addend and use the returned
13544 value.
13545 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
13546 Update declarations of local_section_offset and symbol_value.
13547 * testsuite/two_file_test_1.cc (t18): New function.
13548 * testsuite/two_file_test_2.cc (f18): New function.
13549 * testsuite/two_file_test_main.cc (main): Call t18.
13550 * testsuite/two_file_test.h (t18, f18): Declare.
13551
6835af53
ILT
13552 * configure.ac: Don't test for objdump, c++filt, or readelf.
13553 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
13554 conditionals.
13555 (TEST_READELF): New variable.
13556 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
13557 (check_PROGRAMS): Add two_file_strip_test.
13558 (two_file_strip_test): New target.
13559 (check_PROGRAMS): Add two_file_same_shared_strip_test.
13560 (two_file_same_shared_strip_test_SOURCES): New variable.
13561 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
13562 (two_file_same_shared_strip_test_LDFLAGS): New variable.
13563 (two_file_same_shared_strip_test_LDADD): New variable.
13564 (two_file_shared_strip.so): New target.
13565 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
13566 (ver_test_5.syms, ver_test_7.syms): Likewise.
13567 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
13568 (strip_test_3.stdout): Use TEST_OBJDUMP.
13569 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13570
86925eef
CC
135712008-04-04 Cary Coutant <ccoutant@google.com>
13572
13573 * symtab.h (Symbol::is_weak_undefined): New function.
13574 (Symbol::is_strong_undefined): New function.
13575 (Symbol::is_absolute): New function.
13576 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
13577 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
13578 absolute symbols.
13579 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
13580 (weak_undef_test): New target.
13581 * testsuite/Makefile.in: Rebuild.
13582 * testsuite/weak_undef_file1.cc: New file.
13583 * testsuite/weak_undef_file2.cc: New file.
13584 * testsuite/weak_undef_test.cc: New file.
13585
126f3ece
ILT
135862008-04-03 Craig Silverstein <csilvers@google.com>
13587
13588 * compressed_output.h (class Output_compressed_section): Use
13589 unsigned buffer.
13590 * compressed_output.cc (zlib_compress): Use unsigned buffers,
13591 add zlib header.
13592 (zlib_compressed_suffix): Removed.
13593 (Output_compressed_section::set_final_data_size): Use unsigned
13594 buffers.
13595 * testsuite/Makefile.am (flagstest_compress_debug_sections):
13596 Fix linker invocation.
13597 (flagstest_o_specialfile_and_compress_debug_sections):
13598 Likewise.
13599 * testsuite/Makefile.in: Regenerated.
13600
deae2a14
DM
136012008-04-02 David S. Miller <davem@davemloft.net>
13602
13603 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
13604 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
13605
70752818
ILT
136062008-04-02 Craig Silverstein <csilvers@google.com>
13607
13608 * TODO: New file.
13609
39d0cb0e
ILT
136102008-04-02 Ian Lance Taylor <iant@google.com>
13611
13612 * fileread.cc (File_read::find_view): Add byteshift and vshifted
13613 parameters. Update for new key type to views_. Change all
13614 callers.
13615 (File_read::read): Adjust for byteshift in returned view.
13616 (File_read::add_view): New function, broken out of
13617 find_and_make_view.
13618 (File_read::make_view): New function, broken out of
13619 find_and_make_view.
13620 (File_read::find_or_make_view): Add offset and aligned
13621 parameters. Rewrite accordingly. Change all callers.
13622 (File_read::get_view): Add offset and aligned parameters. Adjust
13623 for byteshift in return value.
13624 (File_read::get_lasting_view): Likewise.
13625 * fileread.h (class File_read): Update declarations.
13626 (class File_read::View): Add byteshift_ field. Add byteshift to
13627 constructor. Add byteshift method.
13628 * archive.h (Archive::clear_uncached_views): New function.
13629 (Archive::get_view): Add aligned parameter. Change all callers.
13630 * object.h (Object::get_view): Add aligned parameter. Change all
13631 callers.
13632 (Object::get_lasting_view): Likewise.
13633
13634 * fileread.cc (File_read::release): Don't call clear_views if
13635 there are multiple objects.
13636 * fileread.h (File_read::clear_uncached_views): New function.
13637 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
13638 on the archive.
13639
a1207466
CC
136402008-03-31 Cary Coutant <ccoutant@google.com>
13641
13642 Add thin archive support.
13643 * archive.cc (Archive::armagt): New const.
13644 (Archive::setup): Remove task parameter and calls to unlock.
13645 (Archive::unlock_nested_archives): New function.
13646 (Archive::read_header): Add nested_off parameter. Change
13647 all callers.
13648 (Archive::interpret_header): Likewise.
13649 (Archive::include_all_members): Change to handle thin
13650 archives.
13651 (Archive::include_member): Likewise.
13652 * archive.h (Archive::Archive): Add new parameters and
13653 initializers.
13654 (Archive::armagt): New const.
13655 (Archive::setup): Remove task parameter.
13656 (Archive::unlock_nested_archives): New function.
13657 (Archive::read_header): Add nested_off parameter.
13658 (Archive::interpret_header): Likewise.
13659 (Archive::Nested_archive_table): New typedef.
13660 (Archive::is_thin_archive_): New field.
13661 (Archive::nested_archives_): New field.
13662 (Archive::options_): New field.
13663 (Archive::dirpath_): New field.
13664 (Archive::task_): New field.
13665 * readsyms.cc (Read_symbols::do_read_symbols): Add check
13666 for thin archives. Pass additional parameters to
13667 Archive::Archive. Unlock the archive file after calling
13668 Archive::setup.
cd536b21 13669
479f6503
ILT
136702008-03-29 Ian Lance Taylor <iant@google.com>
13671
686c8caf
ILT
13672 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
13673 version symbol to be local.
13674 * testsuite/ver_test_4.sh: New file.
13675 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
13676 (check_DATA): Add ver_test_4.syms.
13677 (ver_test_4.syms): New target.
13678 * testsuite/Makefile.in: Rebuild.
13679
ab794b6b
ILT
13680 * output.cc
13681 (Output_section::Input_section_sort_entry::has_priority): New
13682 function.
13683 (Output_section::Input_section_sort_entry::match_file_name): New
13684 function.
13685 (Output_section::Input_section_sort_entry::match_section_name):
13686 Remove.
13687 (Output_section::Input_section_sort_entry::match_section_name_prefix):
13688 Remove.
13689 (Output_section::Input_section_sort_entry::match_section_file):
13690 Remove.
13691 (Output_section::Input_section_sort_compare::operator()): Rewrite
13692 using new Input_section_sort_entry functions. Sort crtbegin and
13693 crtend first. Sort sections with no priority before sections with
13694 a priority.
13695 * testsuite/initpri1.c (d3): Check j != 4.
13696 (cd5): New constructor/destructor function.
13697 (main): Check j != 2.
13698
479f6503
ILT
13699 * symtab.cc (Symbol_table::add_from_object): If we don't use the
13700 new symbol when resolving, don't call set_is_default.
13701 * testsuite/ver_test_7.cc: New file.
13702 * testsuite/ver_test_7.sh: New file.
13703 * testsuite/Makefile.am (ver_test_7.so): New target.
13704 (ver_test_7.o): New target.
13705 (check_SCRIPTS): Add ver_test_7.sh.
13706 (check_DATA): Add ver_test_7.syms.
13707 (ver_test_7.syms): New target.
13708
2fd32231
ILT
137092008-03-28 Ian Lance Taylor <iant@google.com>
13710
13711 * layout.cc (Layout::layout): If we see an input section with a
13712 name that needs sorting, set the must_sort flag for the output
13713 section.
13714 (Layout::make_output_section): If the name of the output section
13715 indicates that it might require sorting, set the may_sort flag.
13716 * output.h (Output_section::may_sort_attached_input_sections): New
13717 function.
13718 (Output_section::set_may_sort_attached_input_sections): New
13719 function.
13720 (Output_section::must_sort_attached_input_sections): New
13721 function.
13722 (Output_section::set_must_sort_attached_input_sections): New
13723 function.
13724 (class Output_section): Declare Input_section_sort_entry. Define
13725 Input_section_sort_compare. Declare
13726 sort_attached_input_sections. Add new fields:
13727 may_sort_attached_input_sections_,
13728 must_sort_attached_input_sections_,
13729 attached_input_sections_are_sorted_.
13730 * output.cc (Output_section::Output_section): Initialize new
13731 fields.
13732 (Output_section::add_input_section): Add an entry to
13733 input_sections_ if may_sort or must_sort are true.
13734 (Output_section::set_final_data_size): Call
13735 sort_attached_input_sections if necessary.
13736 (Output_section::Input_section_sort_entry): Define new class.
13737 (Output_section::Input_section_sort_compare::operator()): New
13738 function.
13739 (Output_section::sort_attached_input_sections): New function.
13740 * configure.ac: Check whether the compiler supports constructor
13741 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
13742 * testsuite/initpri1.c: New file.
13743 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
13744 CONSTRUCTOR_PRIORITY.
13745 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
13746 (initpri1_LDFLAGS): New variable.
13747 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13748
18e6b24e
ILT
137492008-03-27 Ian Lance Taylor <iant@google.com>
13750
49bdd526
ILT
13751 * common.cc (Sort_commons::operator): Correct sorting algorithm.
13752 * testsuite/common_test_1.c: New file.
13753 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
13754 (common_test_1_SOURCES): New variable.
13755 (common_test_1_DEPENDENCIES): New variable.
13756 (common_test_1_LDFLAGS): New variable.
13757
18e6b24e
ILT
13758 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
13759 and commons_ correctly when NAME/VERSION does not override
13760 NAME/NULL.
13761 * testsuite/ver_test_6.c: New file.
13762 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
13763 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
13764 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
13765
04bf7072
ILT
137662008-03-26 Ian Lance Taylor <iant@google.com>
13767
5871526f
ILT
13768 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
13769 of an undefined symbol from a version script.
13770 * testsuite/Makefile.am (ver_test_5.so): New target.
13771 (ver_test_5.o): New target.
13772 (check_SCRIPTS): Add ver_test_5.sh.
13773 (check_DATA): Add ver_test_5.syms.
13774 (ver_test_5.syms): New target.
13775 * testsuite/ver_test_5.cc: New file.
13776 * testsuite/ver_test_5.script: New file.
13777 * testsuite/ver_test_5.sh: New file.
13778 * Makefile.in, testsuite/Makefile.in: Rebuild.
13779
04bf7072
ILT
13780 PR gold/5986
13781 Fix problems building gold with gcc 4.3.0.
13782 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
13783 (gold_error_at_location, gold_warning_at_location): Use it.
13784 * configure.ac: Check whether we can compile and use a template
13785 function with a printf attribute.
13786 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
13787 when jumping over bytes.
13788 * object.cc: Instantiate Object::read_section_data.
13789 * debug.h: Include <cstring>
13790 * dwarf_reader.cc: Include <algorithm>
13791 * main.cc: Include <cstring>.
13792 * options.cc: Include <cstring>.
13793 * output.cc: Include <cstring>.
13794 * script.cc: Include <cstring>.
13795 * script.h: Include <string>.
13796 * symtab.cc: Include <cstring> and <algorithm>.
13797 * target-select.cc: Include <cstring>.
13798 * version.cc: Include <string>.
13799 * testsuite/testmain.cc: Include <cstdlib>.
13800 * configure, config.in: Rebuild.
13801
874c5b28
ILT
138022008-03-25 Ian Lance Taylor <iant@google.com>
13803
819d6c3a
ILT
13804 * options.cc: Include "../bfd/bfdver.h".
13805 (options::help): Print bug reporting address.
13806
f4b2c6f5
ILT
13807 * version.cc (print_version): Adjust output for current value of
13808 BFD_VERSION_STRING.
13809
13810 * NEWS: New file.
13811
e96caa79
ILT
13812 * options.cc (options::help): Print list of supported targets.
13813 * target-select.h: Include <vector>.
13814 (class Target_selector): Make machine_, size_, and is_big_endian_
13815 fields const. Add bfd_name_ and instantiated_target_ fields.
13816 (Target_selector::Target_selector): Add bfd_name parameter.
13817 (Target_selector::recognize): Make non-virtual, call
13818 do_recognize.
13819 (Target_selector::recognize_by_name): Make non-virtual, call
13820 do_recognize_by_name.
13821 (Target_selector::supported_names): New function.
13822 (Target_selector::bfd_name): New function.
13823 (Target_selector::do_instantiate_target): New pure virtual
13824 function.
13825 (Target_selector::do_recognize): New virtual function.
13826 (Target_selector::do_recognize_by_name): New virtual function.
13827 (Target_selector::instantiate_target): New private function.
13828 (supported_target_names): Declare.
13829 * target-select.cc (Target_selector::Target_selector): Update for
13830 new parameter and fields.
13831 (select_target_by_name): Check that the name matches before
13832 calling recognize_by_name.
13833 (supported_target_names): New function.
13834 * i386.cc (class Target_selector_i386): Update Target_selector
13835 constructor call. Remove recognize and recognize_by_name. Add
13836 do_instantiate_target.
13837 * x86_64.cc (class Target_selector_x86_64): Likewise.
13838 * testsuite/testfile.cc (class Target_selector_test): Update for
13839 changes to Target_selector.
13840
874c5b28
ILT
13841 * README: Rewrite, with some notes on unsupported features.
13842
0a65a3a7
CC
138432008-03-24 Cary Coutant <ccoutant@google.com>
13844
13845 * i386.cc (Target_i386::Got_type): New enum declaration.
13846 (Target_i386::Scan::local): Updated callers of Output_data_got
13847 member functions.
13848 (Target_i386::Scan::global): Likewise.
13849 (Target_i386::Relocate::relocate): Likewise.
13850 (Target_i386::Relocate::relocate_tls): Likewise.
13851 * object.h (Got_offset_list): New class.
13852 (Sized_relobj::local_has_got_offset): Added got_type parameter.
13853 (Sized_relobj::local_got_offset): Likewise.
13854 (Sized_relobj::set_local_got_offset): Likewise.
13855 (Sized_relobj::local_has_tls_got_offset): Removed.
13856 (Sized_relobj::local_tls_got_offset): Removed.
13857 (Sized_relobj::set_local_tls_got_offset): Removed.
13858 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
13859 * output.cc (Output_data_got::add_global): Added got_type parameter.
13860 (Output_data_got::add_global_with_rel): Likewise.
13861 (Output_data_got::add_global_with_rela): Likewise.
13862 (Output_data_got::add_global_pair_with_rel): New function.
13863 (Output_data_got::add_global_pair_with_rela): New function.
13864 (Output_data_got::add_local): Added got_type parameter.
13865 (Output_data_got::add_local_with_rel): Likewise.
13866 (Output_data_got::add_local_with_rela): Likewise.
13867 (Output_data_got::add_local_pair_with_rel): New function.
13868 (Output_data_got::add_local_pair_with_rela): New function.
13869 (Output_data_got::add_global_tls): Removed.
13870 (Output_data_got::add_global_tls_with_rel): Removed.
13871 (Output_data_got::add_global_tls_with_rela): Removed.
13872 (Output_data_got::add_local_tls): Removed.
13873 (Output_data_got::add_local_tls_with_rel): Removed.
13874 (Output_data_got::add_local_tls_with_rela): Removed.
13875 * output.h (Output_data_got::add_global): Added got_type parameter.
13876 (Output_data_got::add_global_with_rel): Likewise.
13877 (Output_data_got::add_global_with_rela): Likewise.
13878 (Output_data_got::add_global_pair_with_rel): New function.
13879 (Output_data_got::add_global_pair_with_rela): New function.
13880 (Output_data_got::add_local): Added got_type parameter.
13881 (Output_data_got::add_local_with_rel): Likewise.
13882 (Output_data_got::add_local_with_rela): Likewise.
13883 (Output_data_got::add_local_pair_with_rel): New function.
13884 (Output_data_got::add_local_pair_with_rela): New function.
13885 (Output_data_got::add_global_tls): Removed.
13886 (Output_data_got::add_global_tls_with_rel): Removed.
13887 (Output_data_got::add_global_tls_with_rela): Removed.
13888 (Output_data_got::add_local_tls): Removed.
13889 (Output_data_got::add_local_tls_with_rel): Removed.
13890 (Output_data_got::add_local_tls_with_rela): Removed.
13891 * resolve.cc (Symbol::override_base_with_special): Removed
13892 reference to has_got_offset_ field.
13893 * symtab.cc (Symbol::init_fields): Replaced initialization
13894 of got_offset_ with got_offsets_. Removed initialization
13895 of has_got_offset_
53fcba31 13896 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
13897 (Symbol::got_offset): Likewise.
13898 (Symbol::set_got_offset): Likewise.
13899 (Symbol::has_tls_got_offset): Removed.
13900 (Symbol::tls_got_offset): Removed.
13901 (Symbol::set_tls_got_offset): Removed.
13902 (Symbol::got_offset_): Removed.
13903 (Symbol::tls_mod_got_offset_): Removed.
13904 (Symbol::tls_pair_got_offset_): Removed.
13905 (Symbol::got_offsets_): New field.
13906 (Symbol::has_got_offset): Removed.
13907 (Symbol::has_tls_mod_got_offset): Removed.
13908 (Symbol::has_tls_pair_got_offset): Removed.
13909 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
13910 (Target_x86_64::Scan::local): Updated callers of Output_data_got
13911 member functions.
13912 (Target_x86_64::Scan::global): Likewise.
13913 (Target_x86_64::Relocate::relocate): Likewise.
13914 (Target_x86_64::Relocate::relocate_tls): Likewise.
13915
bd52eafb
BE
139162008-03-25 Ben Elliston <bje@au.ibm.com>
13917
13918 * yyscript.y: Fix spelling error in comment.
13919
8b105e34
ILT
139202008-03-24 Ian Lance Taylor <iant@google.com>
13921
8ed814a9
ILT
13922 * options.h (class General_options): Define build_id option.
13923 * layout.h (class Layout): Declare write_build_id, create_note,
13924 create_build_id. Add build_id_note_ member.
13925 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
13926 "libiberty.h", "md5.h", "sha1.h".
13927 (Layout::Layout): Initialize eh_frame_data_,
13928 eh_frame_hdr_section_, and build_id_note_.
13929 (Layout::finalize): Call create_build_id.
13930 (Layout::create_note): New function, broken out of
13931 Layout::create_gold_note.
13932 (Layout::create_gold_note): Call create_note.
13933 (Layout::create_build_id): New function.
13934 (Layout::write_build_id): New function.
13935 (Close_task_runner::run): Call write_build_id.
13936
8b105e34
ILT
13937 * x86_64.cc: Correct license to GPLv3.
13938
086a1841
ILT
139392008-03-23 Ian Lance Taylor <iant@google.com>
13940
13941 * options.cc: Include "demangle.h".
13942 (parse_optional_string): New function.
13943 (parse_long_option): Handle takes_optional_argument.
13944 (parse_short_option): Update dash_z initializer. Handle
13945 takes_optional_argument.
13946 (General_options::General_options): Initialize do_demangle_.
13947 (General_options::finalize): Set do_demangle_. Handle demangling
13948 style.
13949 * options.h (parse_optional_string): Declare.
13950 (struct One_option): Add optional_arg field. Update constructor.
13951 Update call constructor calls. Add takes_optional_argument
13952 function.
13953 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
13954 (DEFINE_optional_string): Define.
13955 (General_options::demangle): Change from DEFINE_bool to
13956 DEFINE_optional_string.
13957 (General_options::no_demangle): New function.
13958 (General_options::do_demangle): New function.
13959 (General_options::set_do_demangle): New function.
13960 (General_options::execstack_status_): Move definition to end of
13961 class definition.
13962 (General_options::static_): Likewise.
13963 (General_options::do_demangle_): New field.
13964 * object.cc (big_endian>::get_symbol_location_info): Call
13965 Options::do_demangle, not Options::demangle.
13966 * symtab.cc (demangle): Likewise.
13967
cbb93e63
ILT
139682008-03-22 Ian Lance Taylor <iant@google.com>
13969
13970 * gold.h: Include <cstddef> and <sys/types.h>
13971 * options.h: Include <cstring>.
13972
ec531623
ILT
139732008-03-21 Ian Lance Taylor <iant@google.com>
13974
13975 * Added source code to GNU binutils.
This page took 0.853216 seconds and 4 git commands to generate.