* powerpc.cc (Target_powerpc::make_plt_section): Add symtab
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
40b469d7
AM
12012-11-30 Alan Modra <amodra@gmail.com>
2
3 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
4 param. Call got_section() to make .got. Update all callers
5 and their callers and so on.
6
bb66a627
AM
72012-11-30 Alan Modra <amodra@gmail.com>
8
9 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
10 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
11 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
12 value if it already exists.
13
d2cf1c6c
L
142012-11-19 H.J. Lu <hongjiu.lu@intel.com>
15
16 PR gold/14858
17 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
18
edccdf7c
RM
192012-11-14 Roland McGrath <mcgrathr@google.com>
20
21 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
22 than bfc instruction for data sandboxing.
23
6febeb74
AM
242012-11-08 Alan Modra <amodra@gmail.com>
25
26 * po/POTFILES.in: Regenerate.
27
0a6f1bf2
AM
282012-11-05 Alan Modra <amodra@gmail.com>
29
30 * configure.ac: Apply 2012-09-10 change to config.in here.
31 * configure: Regenerate.
32
26a4e9cb
AM
332012-11-05 Alan Modra <amodra@gmail.com>
34
35 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
36 (struct Opd_ent): Use "Address" rather than "Offset".
37 (Output_data_got_powerpc::got_base_offset): Return Valtype.
38 (Target_powerpc::got_section): Make public.
39 (Target_powerpc::scan_relocs): Move code setting symbols..
40 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
41 Create _SDA_BASE_ only when referenced.
42
cc928013
RM
432012-11-02 Roland McGrath <mcgrathr@google.com>
44
45 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
46 from last change.
47
50ed5eb1
RM
482012-11-01 Roland McGrath <mcgrathr@google.com>
49
62fe925a
RM
50 * target.h (Sized_target::relocate_relocs): Use Elf_Off
51 for offset_in_output_section parameter.
52 (Sized_target::relocate_special_relocatable): Likewise.
53 * arm.cc (Target_arm::relocate_relocs): Likewise.
54 (Target_arm::relocate_special_relocatable): Likewise.
55 * i386.cc (Target_i386::relocate_relocs): Likewise.
56 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
57 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
58 * target-reloc.h (relocate_relocs): Likewise.
59 * testsuite/testfile.cc (Target_test): Likewise.
60 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
61 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
62
63 * system.h: Move inclusion of <clocale> to after <libintl.h> in
64 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
65
66 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
67 parameter, which is unused in the [!F_SETFD] case.
68
50ed5eb1
RM
69 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
70 SYMNDX to off_t before comparing it to this->data_size().
71 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
72 * incremental.cc (Output_section_incremental_inputs::do_write):
73 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
74
2cadc0bf
RM
75 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
76
3bfcb652
NC
772012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
78
79 * gold.cc (Target_arm::do_adjust_elf_header): Add the
80 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
81 in EABI_VER5.
82
c1a8d56e
CC
832012-10-29 Cary Coutant <ccoutant@google.com>
84
85 * dwp.cc (usage): Add file and exit status parameters;
86 add --help and --version options.
87 (print_version): New function.
88 (main): Add --help and --version options.
89
b2490a7b
L
902012-10-25 H.J. Lu <hongjiu.lu@intel.com>
91
92 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
93 final_layout_sequence.txt.
94 * testsuite/Makefile.in: Regenerated.
95
aa543512
L
962012-10-25 H.J. Lu <hongjiu.lu@intel.com>
97
98 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
99 COMPILE generated by automake.
100 (LINK1): Likewise.
101 (CXXCOMPILE1): Likewise.
102 (CXXLINK1): Likewise.
103 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
104 (LINK): Likewise.
105 (CXXCOMPILE): Likewise.
106 (CXXLINK): Likewise.
107 * testsuite/Makefile.in: Regenerated.
108
d361fafb
L
1092012-10-25 H.J. Lu <hongjiu.lu@intel.com>
110
111 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
112 on bad fwrite return.
113
598c7410
L
1142012-10-25 H.J. Lu <hongjiu.lu@intel.com>
115
116 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
117 on val.
118
35c813e2
CC
1192012-10-23 Cary Coutant <ccoutant@google.com>
120
121 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
122 * testsuite/Makefile.in: Regenerate.
123 * testsuite/dwp_test.h: New source file.
124 * testsuite/dwp_test_1.cc: New source file.
125 * testsuite/dwp_test_1.s: New source file.
126 * testsuite/dwp_test_1.sh: New source file.
127 * testsuite/dwp_test_1b.cc: New source file.
128 * testsuite/dwp_test_1b.s: New source file.
129 * testsuite/dwp_test_2.cc: New source file.
130 * testsuite/dwp_test_2.s: New source file.
131 * testsuite/dwp_test_2.sh: New source file.
132 * testsuite/dwp_test_main.cc: New source file.
133 * testsuite/dwp_test_main.s: New source file.
134
77429909
CC
1352012-10-23 Cary Coutant <ccoutant@google.com>
136
137 * dwp.h: New header file.
138 * dwp.cc: New source file.
139 * gold.h: Move shared declarations to system.h.
140 * system.h: New header file.
141 * Makefile.am: Add dwp.
142 * Makefile.in: Regenerate.
143
ed5d6712
CC
1442012-10-23 Cary Coutant <ccoutant@google.com>
145
146 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
147 Dwarf_info_reader::read_from_pointer.
148 (Dwarf_pubnames_table::read_header): Likewise.
149 (Dwarf_pubnames_table::next_name): Likewise.
150 (Dwarf_die::read_attributes): Likewise.
151 (Dwarf_die::skip_attributes): Likewise.
152 (Dwarf_info_reader::read_from_pointer): New function template.
153 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
154 (Dwarf_pubnames_table): Likewise.
155 (Dwarf_info_reader::read_from_pointer): New function template.
156 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
157 Dwarf_pubnames_table ctor.
158
8787852d
CC
1592012-10-23 Cary Coutant <ccoutant@google.com>
160
161 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
162 abbrev_shndx.
163 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
164 abbrev_shndx_.
165 (Dwarf_info_reader::set_abbrev_shndx): New method.
166 (Dwarf_info_reader::abbrev_shndx_): New data member.
167
9fc236f3
CC
1682012-10-23 Cary Coutant <ccoutant@google.com>
169
170 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
171 from object, not parameters.
172 (Dwarf_info_reader::parse): Likewise.
173 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
174 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
175 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
176 methods.
177
effe8365
CC
1782012-10-23 Cary Coutant <ccoutant@google.com>
179
180 * fileread.cc (Input_file::Input_file): New constructor.
181 * fileread.h (class Input_file): Add new constructor.
182
1698990d
AM
1832012-10-18 Alan Modra <amodra@gmail.com>
184
185 PR gold/14727
186 * object.cc (Relobj::is_section_name_included): Also match
187 .sdata personality section.
188
168a4726
AM
1892012-10-18 Alan Modra <amodra@gmail.com>
190
191 * target-reloc.h (class Default_comdat_behavior): New, package up..
192 (get_comdat_behaviour): ..this.
193 (relocate_section): Add Relocate_comdat_behavior template arg,
194 adjust code to suit.
195 * arm.cc (Target_arm::relocate_section): Adjust to suit.
196 (Target_arm::scan_reloc_section): Likewise.
197 * i386.cc (Target_i386::relocate_section): Likewise.
198 * sparc.cc (Target_sparc::relocate_section): Likewise.
199 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
200 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
201 * powerpc.cc (class Relocate_comdat_behavior): New.
202 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
203 gold::relocate_section with new template arg.
204
acc276d8
AM
2052012-10-18 Alan Modra <amodra@gmail.com>
206
207 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
208 dynamic relocs for GOT_TPREL got entries, without symbol if
209 resolving locally.
210 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
211 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
212 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
213
e10f9870
AM
2142012-10-17 Alan Modra <amodra@gmail.com>
215
216 PR gold/14726
217 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
218
ae034989
ST
2192012-10-16 Sriraman Tallam <tmsriram@google.com>
220
221 * layout.cc (Layout::include_section): Keep sections marked
222 SHF_EXCLUDE when doing relocatable links.
223
f3a0ed29
AM
2242012-10-16 Alan Modra <amodra@gmail.com>
225
226 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
227 (Target_powerpc::do_finalize_sections): Call it.
228 (Output_data_save_res): New class and supporting functions.
229 (Target_powerpc::symval_for_branch): Only look up .opd entry for
230 normal symbols defined in object files.
231
c6de8ed4
AM
2322012-10-12 Alan Modra <amodra@gmail.com>
233
234 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
235 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
236 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
237 section if scan_opd_relocs not yet called.
238 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
239
03e25981
AM
2402012-10-12 Alan Modra <amodra@gmail.com>
241
242 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
243 add_local_ifunc_entry): Revert last change.
244 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
245
c9824451
AM
2462012-10-05 Alan Modra <amodra@gmail.com>
247
248 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
249 do_plt_address_for_global): New functions.
250 (Output_data_got_powerpc::do_write): Don't segfault when linking
251 statically.
252 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
253 add_local_ifunc_entry): Return true on adding entry..
254 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
255 glink->add_entry call. Remove unused symtab param. Adjust calls.
256 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
257 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
258 set up symbols here.
259 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
260 syms here. Do so even when no .iplt. Don't segfault when linking
261 statically.
262 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
263 new variants without reloc param.
264 (Glink_sym_ent::Glink_sym_ent): Likewise.
265 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
266 reloc when refs will resolve to plt call stub.
267 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
268 R_PPC_PLTREL24 to resolve locally.
269 (Target_powerpc::Scan::global): Correct ifunc handling.
270 (Target_powerpc::Relocate::relocate): Correct local sym glink
271 lookup. Don't destroy "value" when we have a plt call stub,
272 and when checking plt call validity.
273 (Target_powerpc::do_dynsym_value): Simplify.
274
19fec8c1
AM
2752012-10-05 Alan Modra <amodra@gmail.com>
276
277 * i386.cc (Output_data_plt_i386::address_for_global,
278 address_for_local): Add plt offset to returned value. Adjust uses.
279 * sparc.cc (Output_data_plt_sparc::address_for_global,
280 address_for_local): Likewise.
281 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
282 address_for_local): Likewise.
283 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
284 address_for_local): Likewise.
285 * target.h (Target::plt_address_for_global, plt_address_for_local):
286 Update comment.
287 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
288 (Output_data_got::Got_entry::write): Nor here.
289 * output.h: Comment fix.
290
e867b647
WL
2912012-10-02 Jiong Wang <jiwang@tilera.com>
292
293 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
294 global_offset_table_ value for larget got.
295 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
296
e5d5f5ed
AM
2972012-09-29 Alan Modra <amodra@gmail.com>
298
299 * powerpc.cc (Target_powerpc::iplt_): New output section.
300 (Target_powerpc::iplt_section, make_iplt_section,
301 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
302 (Target_powerpc::make_plt_entry): Handle ifunc syms.
303 Target_powerpc::plt_entry_count): Count iplt entries too.
304 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
305 reloc section in constructor. New params.
306 (Target_powerpc::make_plt_section): Create reloc section here instead.
307 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
308 functions.
309 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
310 (Output_data_glink::add_entry, find_entry): New functions to
311 deal with local syms.
312 (Glink_sym_ent): Add support for local syms.
313 (Output_data_glink::do_write): Handle ifunc plt entries.
314 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
315 (Target_powerpc::Scan::local, global): Handle ifunc syms.
316 (Target_powerpc::Relocate::relocate): Likewise.
317 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
318
ec4dbad3
AM
3192012-09-25 Alan Modra <amodra@gmail.com>
320
321 * object.h (Sized_relobj_file::adjust_local_symbol,
322 do_adjust_local_symbol): New functions.
323 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
324 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
325 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
326 and irregular opd entry spacing.
327 (Powerpc_relobj::do_read_relocs): Add opd size checks.
328 (Global_symbol_visitor_opd): New functor.
329 (Target_powerpc::do_finalize_sections): Omit global symbols defined
330 on deleted opd entries.
331
5c0b3823
WL
3322012-09-15 Jiong Wang <jiwang@tilera.com>
333
334 * tilegx.cc: New file.
335 * Makefile.am (TARGETSOURCES): Add tilegx.cc
336 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
337 * configure.tgt: Add entries for tilegx*.
338 * configure.ac: Likewise.
339 * Makefile.in: Rebuild.
340 * configure: Likewise.
341 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
342 tilegx.
343
bfdfa4cd
AM
3442012-09-13 Alan Modra <amodra@gmail.com>
345
346 * target-reloc.h (scan_relocs): Call scan.local for relocs
347 against symbols in discarded sections. Pass is_discarded
348 param.
349 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
350 Add is_discarded param.
351 * powerpc (Target_powerpc::Scan::local): Likewise. Use
352 is_discarded to flag opd entry as discarded. Don't emit dyn
353 relocs on such entries.
354 (Target_powerpc::Scan::global): Similarly detect and handle
355 such opd entries.
356 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
357 opd_ent_. Update all uses.
358 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
359 (Target_powerpc::relocate_section): Zero out discarded opd
360 entry relocs.
361
d77a0555
ILT
3622012-09-12 Ian Lance Taylor <iant@google.com>
363
364 PR gold/14570
365 * output.cc: Rename Output_data_got template parameter from size
366 to got_size for all functions. Compile all variants of
367 Output_data_got.
368 (Output_data_got::Got_entry::write): Correct use of size for
369 symbol value. Use local_is_tls rather than casting to
370 Sized_relobj_file.
371 * object.h (class Object): Add local_is_tls and do_local_is_tls.
372 (class Sized_relobj_file): Add do_local_is_tls.
373 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
374
815a1205
AM
3752012-09-11 Alan Modra <amodra@gmail.com>
376
377 PR gold/14566
378 * layout.cc (Layout::set_segment_offsets): When using
379 common-page-size alignment, ensure we are on a new max-page-size
380 page.
381 * output.cc (Output_segment::set_section_addresses): Use
382 abi_pagesize, not common_pagesize for relro boundary.
383 (Output_segment::set_offset): Likewise.
384
bd73a62d
AM
3852012-09-11 Alan Modra <amodra@gmail.com>
386
387 * output.h (Output_data_got::add_global_tls, add_local_tls,
388 add_local_tls_pair): New functions.
389 (Output_data_got::add_local_pair_with_rel): Remove second
390 reloc param. Expand comment.
391 (Output_data_got::Got_entry): Rename use_plt_offset_ to
392 use_plt_or_tls_offset_, similarly for constructor param.
393 (Output_data_got::Got_entry::write): Add got_index param.
394 * output.cc (Output_data_got::add_global_tls, add_local_tls,
395 add_local_tls_pair): New functions.
396 (Output_data_got::Got_entry::write): Handle tls symbols
397 with use_plt_or_tls_offset_ set specially.
398 (Output_data_got::add_local_pair_with_rel): Only one reloc.
399 (Output_data_got::do_write): Replace iterator with index, pass
400 index to entry write function.
401 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
402 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
403 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
404 call.
405 * i386.cc (Target_i386::Scan::local): Likewise.
406 * sparc.cc (Target_sparc::Scan::local): Likewise.
407 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
408 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
409 do_tls_offset_for_global): New functions.
410 (Target_powerpc::Scan::local): Correct TLS relocations and got
411 entry values.
412 (Target_powerpc::Scan::global): Don't emit unnecessary
413 dynamic relocations on TLS GOT entries.
414
00716ab1
AM
4152012-09-10 Matthias Klose <doko@ubuntu.com>
416
417 * config.in: Disable sanity check for kfreebsd.
418
c891b3f9
SA
4192012-09-10 Sterling Augustine <saugustine@google.com>
420
421 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
422 (Gdb_index::pubtypes_read): New parameter.
423 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
424 to calls.
425 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
426 pubtypes_object_.
427
e81fea4d
AM
4282012-09-09 Alan Modra <amodra@gmail.com>
429
430 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
431 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
432 * gc.h (gc_process_relocs): Call target gc_add_reference.
433 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
434 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
435 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
436 unnecessary cast.
437 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
438 to cater for when we don't need code offset. Update use.
439 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
440 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
441 set_opd_valid): New functions.
442 (Target_powerpc::do_gc_add_reference): New function.
443 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
444 stashed refs.
445 (Target_powerpc::do_gc_mark_symbol): New function.
446
d2d60eef
CC
4472012-09-06 Cary Coutant <ccoutant@google.com>
448
449 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
450 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
451 (Dwarf_die::skip_attributes): Likewise.
452 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
453 * testsuite/gdb_index_test.cc (inline_func_1): New function.
454 (main): Call it.
455 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
456
32ed4573
L
4572012-09-05 H.J. Lu <hongjiu.lu@intel.com>
458
459 * testsuite/script_test_3.t: Add .got.plt output section
460 statement.
461 * testsuite/script_test_4.t: Likewise.
462
f4baf0d4
AM
4632012-09-05 Alan Modra <amodra@gmail.com>
464
465 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
466 update all uses and lose "enum" when using type.
467
864a1b56
AM
4682012-09-05 Alan Modra <amodra@gmail.com>
469
470 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
471 * configure: Regenerate.
472 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
473 (plugin_final_layout.stdout): Likewise.
474 (memory_test): Set page sizes to 0x1000.
475 * testsuite/Makefile.in: Regenerate.
476 * testsuite/discard_locals_test.sh: Add FIXME comment.
477 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
478 * testsuite/pr14265.t: Add .got output section statement.
479 * testsuite/script_test_2.t: Likewise.
480 * testsuite/script_test_3.t: Likewise.
481 * testsuite/script_test_4.t: Likewise.
482 * testsuite/script_test_5.t: Likewise.
483 * testsuite/script_test_6.t: Likewise.
484 * testsuite/script_test_7.t: Likewise.
485 * testsuite/script_test_9.t: Likewise.
486
3ea0a085
AM
4872012-09-05 Alan Modra <amodra@gmail.com>
488
489 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
490 (Powerpc_relocate_functions::Status): New typedef.
491 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
492 (Target_powerpc::Scan::local): Handle REL64.
493 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
494 for REL32 and REL64.
495 (Target_powerpc::symval_for_branch): New function, extracted from..
496 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
497 checks. Report overflow errors.
498
7404fe1b
AM
4992012-09-05 Alan Modra <amodra@gmail.com>
500
501 * object.h (Sized_relobj_file::emit_relocs): Delete.
502 (Sized_relobj_file::emit_relocs_reltype): Delete.
503 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
504 relocate_relocs for --emit-relocs.
505 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
506 * output.h: Update comment.
507 (Output_segment::first_section): New function.
508 (Output_segment::first_section_load_address): Use first_section.
509 * output.cc (Output_segment::first_section): New function extracted..
510 (Output_segment::first_section_load_address): ..from here. Delete.
511 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
512 * target.h (Sized_target::relocate_for_relocatable): Likewise.
513 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
514 adjust call to target.h function.
515 * i386.cc (Target_i386): Likewise.
516 * sparc.cc (Target_sparc): Likewise.
517 * x86_64.cc (Target_x86_64): Likewise.
518 * powerpc.cc (Target_powerpc): Likewise.
519 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
520 first tls section has section symbol for optimised local dynamic
521 output relocs.
522 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
523 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
524 optimised tls code.
525 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
526 Rename to relocate_relocs. Update error message.
527
957564c9
AS
5282012-09-04 Andreas Schwab <schwab@linux-m68k.org>
529
530 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
531 --just-symbols.
532
dd93cd0a
AM
5332012-08-31 Alan Modra <amodra@gmail.com>
534
535 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
536 (Powerpc_relobj::toc_base_offset): New stub function.
537 (Target_powerpc): Add tp_offset, dtp_offset. Rename
538 got_mod_index_offset to tlsld_got_offset. Update all refs.
539 (Target_powerpc::Relocate::enum skip_tls): New.
540 (Target_powerpc::call_tls_get_addr_): New var.
541 (Target_powerpc::is_branch_reloc): Move to file scope.
542 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
543 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
544 New functions.
545 (Target_powerpc::enum Got_type): Delete old values, add new ones.
546 (powerpc_info): Correct common_pagesize for ppc64.
547 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
548 (Powerpc_relocate_functions): Add overflow check enums and functions.
549 Add non-shift version of rela, rela_ua. Delete all rel public
550 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
551 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
552 addr16_ha3, addr14 functions.
553 (Output_data_got_powerpc::add_constant_pair): New function.
554 (Output_data_got_powerpc::got_base_offset): Likewise.
555 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
556 (instruction constants): Sort, add some more.
557 (Output_data_glink::do_write): Add and use Address typedef. Use
558 object->toc_base_offset() stub for 64-bit.
559 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
560 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
561 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
562 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
563 Always treat .opd relocs as against locally defined symbol.
564 Correct condition for RELATIVE relocs.
565 (Target_powerpc::do_finalize_sections): Test for NULL sections.
566 (Target_powerpc::Relocate::relocate): Use plt call stub as value
567 for 32-bit syms with a plt entry. Correct ppc64 toc base
568 calculations. Handle TLS relocs, and more. Add overflow
569 checking and adjust for Powerpc_relocate_functions changes.
570 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
571 Reinstate --emit-relocs code with FIXME.
572
a1373b60
AM
5732012-08-30 Alan Modra <amodra@gmail.com>
574
575 * layout.cc (Layout::set_segment_offsets): Set p_align to
576 abi_pagesize, not common_pagesize.
577 (Layout::relaxation_loop_body): Similarly use abi_pagesize
578 to determine whether file header can go in segment.
579
703d02da
AM
5802012-08-30 Alan Modra <amodra@gmail.com>
581
582 * output.h (Output_reloc::Output_reloc <output section>): Add
583 is_relative param. Adjust calls.
584 (Output_reloc::add_output_section_relative): New functions.
585 * output.cc (Output_reloc::Output_reloc <output section>): Handle
586 is_relative.
587 (Output_reloc::symbol_value): Handle SECTION_CODE.
588
16164a6b
ST
5892012-08-24 Sriraman Tallam <tmsriram@google.com>
590
591 * gold.cc (queue_middle_tasks): Call layout again when unique
592 segments for sections is desired.
593 * layout.cc (Layout::Layout): Initialize new members.
594 (Layout::get_output_section_flags): New function.
595 (Layout::choose_output_section): Call get_output_section_flags.
596 (Layout::layout): Make output section for mapping to a unique segment.
597 (Layout::insert_section_segment_map): New function.
598 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 599 output sections marked so.
16164a6b
ST
600 (Layout::segment_precedes): Check for unique segments when sorting.
601 * layout.h (Layout::Unique_segment_info): New struct.
602 (Layout::Section_segment_map): New typedef.
603 (Layout::insert_section_segment_map): New function.
604 (Layout::get_output_section_flags): New function.
605 (Layout::is_unique_segment_for_sections_specified): New function.
606 (Layout::set_unique_segment_for_sections_specified): New function.
607 (Layout::unique_segment_for_sections_specified_): New member.
608 (Layout::section_segment_map_): New member.
609 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
610 Rename is_gc_pass_one to is_pass_one.
611 Rename is_gc_pass_two to is_pass_two.
612 Rename is_gc_or_icf to is_two_pass.
613 Check for which pass based on whether symbols data is present.
614 Make it two pass when unique segments for sections is desired.
615 * output.cc (Output_section::Output_section): Initialize new
616 members.
617 * output.h (Output_section::is_unique_segment): New function.
618 (Output_section::set_is_unique_segment): New function.
619 (Output_section::is_unique_segment_): New member.
620 (Output_section::extra_segment_flags): New function.
621 (Output_section::set_extra_segment_flags): New function.
622 (Output_section::extra_segment_flags_): New member.
623 (Output_section::segment_alignment): New function.
624 (Output_section::set_segment_alignment): New function.
625 (Output_section::segment_alignment_): New member.
626 (Output_segment::Output_segment): Initialize is_unique_segment_.
627 (Output_segment::is_unique_segment): New function.
628 (Output_segment::set_is_unique_segment): New function.
629 (Output_segment::is_unique_segment_): New member.
630 * plugin.cc (allow_unique_segment_for_sections): New function.
631 (unique_segment_for_sections): New function.
632 (Plugin::load): Add new functions to transfer vector.
633 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
634 * Makefile.in: Regenerate.
635 * testsuite/plugin_final_layout.sh: Check if unique segment
636 functionality works.
637 * testsuite/plugin_section_order.c (onload): Check if new interfaces
638 are available.
639 (allow_unique_segment_for_sections): New global.
640 (unique_segment_for_sections): New global.
641 (claim_file_hook): Call allow_unique_segment_for_sections.
642 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 643
1e2bee4f
CC
6442012-08-22 Cary Coutant <ccoutant@google.com>
645
646 * layout.cc (Layout::include_section): Don't assert on GROUP
647 sections with --emit-relocs.
648
1d5dfe78
CC
6492012-08-21 Cary Coutant <ccoutant@google.com>
650
651 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
652 if --export-dynamic-symbol names an undef symbol.
653
c9269dff
AM
6542012-08-18 Alan Modra <amodra@gmail.com>
655
656 * powerpc.cc: Formatting and white space.
657 (Powerpc_relobj): Rename got2_section_ to special_.
658 Add opd_ent_shndx_ and opd_ent_off_ vectors.
659 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
660 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
661 (Target_powerpc): Add Address typedef and invalid_address. Use
662 throughout.
663 (Target_powerpc::is_branch_reloc): New function.
664 (Powerpc_relocate_functions): Add Address typedef, use throughout.
665 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
666 for dst_mask, value and addend.
667 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
668 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
669 (Output_data_glink::do_write): Correct toc base. Don't try to use
670 uint16_t for 24-bit offset. Use get_output_section_offset and
671 check return.
672 (Target_powerpc::Scan::local): Handle more relocs.
673 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
674 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
675 Plug in toc restoring insn after plt calls. Translate branches
676 to function descriptor symbols to corresponding entry point.
677 (Target_powerpc::relocate_for_relocatable): Check return from
678 get_output_section_offset.
679 * symtab.h: Comment typo.
680
b1759dce
ILT
6812012-08-14 Ian Lance Taylor <iant@google.com>
682
683 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
684 unsupported_relocal_local to call unsupported_reloc_global.
685
b9b2ae8b
NC
6862012-08-14 Nick Clifton <nickc@redhat.com>
687
688 PR ld/14265
689 * script-sections.cc (Sections_element::output_section_name): Add
690 keep return parameter.
691 (Output_section_element::match_name): Add keep return parameter.
692 Return the value of the keep_ member.
693 * script-sections.h (class Output_section): Update
694 output_section_name prototype.
695 * layout.cc (Layout::keep_input_section): New public member
696 function.
697 (Layout::choose_output_section): Pass keep parameter to
698 output_section_name.
699 * layout.h (class Layout): Add keep_input_section.
700 * object.cc (Sized_relobj_file::do_layout): Check for kept input
701 sections.
702 * testsuite/Makefile.am: Add a test.
703 * testsuite/Makefile.in: Regenerate.
704 * testsuite/pr14265.c: Source file for the test.
705 * testsuite/pr14265.t: Linker script for the test.
706 * testsuite/pr14265.sh: Shell script for the test.
707
921b5322
AM
7082012-08-14 Alan Modra <amodra@gmail.com>
709
710 * target.h (Target::output_section_name): New function.
711 (Target::do_output_section_name): New function.
712 * layout.cc (Layout::choose_output_section): Call the above.
713 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
714
6ce78956
AM
7152012-08-14 Alan Modra <amodra@gmail.com>
716
717 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
718 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
719 for replace_constant call.
720 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
721 (Output_data_glink::do_print_to_mapfile): New function.
722 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
723 (Target_powerpc::Relocate::relocate): Likewise.
724
d1a8cabd
AM
7252012-08-14 Alan Modra <amodra@gmail.com>
726
727 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
728 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
729 (Output_data_glink::add_entry,find_entry): Remove shndx param.
730 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
731 all references to shndx_. Handle special case for R_PPC_PLTREL24
732 here.
733 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
734 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
735 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
736 here.
737 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
738 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
739
d83ce4e3
AM
7402012-08-12 Alan Modra <amodra@gmail.com>
741
742 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
743 (glink insn constants): Use uint32_t.
744 (Output_data_glink::add_entry): Use insert, not [] operator.
745
cf43a2fe
AM
7462012-08-11 Alan Modra <amodra@gmail.com>
747
748 * object.h (Sized_relobj_file::find_shdr): New function.
749 (Sized_relobj_file::find_special_sections): New function.
750 * object.cc (Sized_relobj_file::find_shdr): New function.
751 (Sized_relobj_file::find_eh_frame): Use find_shdr.
752 (Sized_relobj_file::find_special_sections): New function, split out..
753 (Sized_relobj_file::do_read_symbols): ..from here.
754 * output.h (Output_data_got::replace_constant): New function.
755 (Output_data_got::num_entries): New function.
756 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
757 (Output_data_got::got_offset): Protected rather than private.
758 (Output_data_got::replace_got_entry): New function.
759 * output.cc (Output_data_got::replace_got_entry): New function.
760 * powerpc.cc (class Powerpc_relobj): New.
761 (class Powerpc_relocate_functions): Delete all psymval variants or
762 convert to value,addend type. Delete pcrela, pcrela_unaligned.
763 Implement _ha functions using corresponding _hi function.
764 (Powerpc_relobj::find_special_sections): New function.
765 (Target_powerpc::do_make_elf_object): New function.
766 (class Output_data_got_powerpc): New.
767 (class Output_data_glink): New.
768 (class Powerpc_scan_relocatable_reloc): New.
769 Many more changes througout file.
770
3c892704
NC
7712012-08-09 Nick Clifton <nickc@redhat.com>
772
773 * po/vi.po: Updated Vietnamese translation.
774
82435b3b
ILT
7752012-08-07 Ian Lance Taylor <iant@google.com>
776
777 * layout.cc (Layout::add_target_dynamic_tags): If
778 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
779 plt_rel.
780
a6dc81d2
NC
7812012-07-30 Nick Clifton <nickc@redhat.com>
782
783 * po/gold.pot: Updated template.
784 * po/es.po: Updated Spanish translation.
785
f1415016
CC
7862012-07-18 Cary Coutant <ccoutant@google.com>
787
788 PR gold/14344
789 * configure.ac: Add check for -gpubnames support.
790 * configure: Regenerate.
791 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
792 support; force -gno-pubnames.
793 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
794 support.
795 (gdb_index_test_4): New test.
796 * testsuite/Makefile.in: Regenerate.
797 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
798 * testsuite/gdb_index_test_2.sh: Likewise.
799 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
800 * testsuite/gdb_index_test_4.sh: New script.
801 * testsuite/gdb_index_test_comm.sh: New script with common code;
802 don't look for space after colon.
803
b7fd7c37
ST
8042012-07-16 Sriraman Tallam <tmsriram@google.com>
805
806 * gold.cc (queue_middle_tasks): Update function order only after
807 deferred objects due to plugins are processed.
808
1f3212db
ILT
8092012-07-11 Ian Lance Taylor <iant@google.com>
810
811 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
812 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
813 (Target_arm::scan_reloc_for_stub): Likewise.
814 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
815 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
816 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
817 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
818 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
819
81c82a68
ILT
8202012-07-10 Dodji Seketeli <dodji@redhat.com>
821 Ian Lance Taylor <iant@google.com>
822
823 PR gold/14309
824 * configure.ac: Test whether std::tr1::hash<off_t> works.
825 * gold.h: Add a specialization for std::tr1::hash<off_t> if
826 needed.
827 * output.h (class Output_fill): Add virtual destructor.
828 * configure, config.in: Rebuild.
829
eabc84f4
RM
8302012-06-22 Roland McGrath <mcgrathr@google.com>
831
832 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
833
370e30b6
RÁE
8342012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
835
836 * plugin.cc (Plugin::load): Handle position independent executables.
837
fb1b895d
CC
8382012-06-06 Cary Coutant <ccoutant@google.com>
839
840 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
841 add .debug_macro.
842 (lines_only_debug_sections): Likewise.
843 (gdb_fast_lookup_sections): New static array.
844 (is_gdb_debug_section): Rename formal parameter.
845 (is_lines_only_debug_section): Likewise.
846 (is_gdb_fast_lookup_section): New function.
847 (Layout::include_section): Check for ".zdebug_" prefix; pass
848 section name suffix to is_gdb_debug_section, et al.; check for
849 fast-lookup sections when building .gdb_index.
850 * options.h (--strip-debug-gdb): Update GDB version number.
851
7c0640fa
CC
8522012-06-06 Cary Coutant <ccoutant@google.com>
853
854 * configure.ac: Add check for fallocate.
855 * configure: Regenerate.
856 * config.in: Regenerate.
857
858 * options.h (class General_options): Add --mmap-output-file and
859 --posix-fallocate options.
860 * output.cc: (posix_fallocate): Remove; replace with...
861 (gold_fallocate): New function.
862 (Output_file::map_no_anonymous): Call gold_fallocate.
863 (Output_file::map): Check --mmap-output-file option.
864
2a49eb69
DK
8652012-06-05 Jing Yu <jingyu@google.com>
866
867 * gold.h (textdomain): Add do {} to empty while(0).
868 (bindtextdomain): Likewise.
869
fad072ac
CC
8702012-06-04 Cary Coutant <ccoutant@google.com>
871
872 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
873 has_dynsym_index.
874
8cc69fb6
ST
8752012-05-25 Sriraman Tallam <tmsriram@google.com>
876
877 * symtab.cc (Symbol_table::define_special_symbol):
878 Initialize *poldsym to prevent uninitialized variable errors.
879
1be75daa
CC
8802012-05-23 Cary Coutant <ccoutant@google.com>
881
882 * layout.cc (Layout::section_name_mapping): Add rules to handle
883 exact match on .data.rel.ro.local or .data.rel.ro.
884 (Layout::output_section_name): Check for exact matches.
885
9b689de0
CC
8862012-05-23 Cary Coutant <ccoutant@google.com>
887
888 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
889 more carefully.
890
b24fdbf5
CC
8912012-05-22 Cary Coutant <ccoutant@google.com>
892
893 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
894 object before exporting symbol.
895
e550e1a2
L
8962012-05-21 H.J. Lu <hongjiu.lu@intel.com>
897
898 * testsuite/tls_test.cc: Include "config.h" first.
899 * testsuite/tls_test_c.c: Likewise.
900
df7b86aa
NC
9012012-05-17 Daniel Richard G. <skunk@iskunk.org>
902 Nick Clifton <nickc@redhat.com>
903
904 PR 14072
905 * configure.in: Add check that sysdep.h has been included before
906 any system header files.
907 * configure: Regenerate.
908 * config.in: Regenerate.
909
1007b503
CC
9102012-05-14 Cary Coutant <ccoutant@google.com>
911
912 * layout.cc (Layout::make_output_section): Mark .tdata section
913 as RELRO.
914 * testsuite/relro_test.cc: Add a TLS variable.
915
fd885f3a
L
9162012-05-10 H.J. Lu <hongjiu.lu@intel.com>
917
918 PR gold/14091
919 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
920 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
921 R_X86_64_64.
922
80f5885c
CC
9232012-05-08 Cary Coutant <ccoutant@google.com>
924
925 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
926 (lines_only_debug_sections): Likewise.
927
2e702c99
RM
9282012-05-02 Roland McGrath <mcgrathr@google.com>
929
930 * nacl.cc: New file.
931 * nacl.h: New file.
932 * Makefile.am (CCFILES, HFILES): Add them.
933 * Makefile.in: Regenerate.
934 * i386.cc (Output_data_plt_i386_nacl): New class.
935 (Output_data_plt_i386_nacl_exec): New class.
936 (Output_data_plt_i386_nacl_dyn): New class.
937 (Target_i386_nacl): New class.
938 (Target_selector_i386_nacl): New class.
939 (target_selector_i386): Use it instead of Target_selector_i386.
940 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
941 (Target_x86_64_nacl): New class.
942 (Target_selector_x86_64_nacl): New class.
943 (target_selector_x86_64, target_selector_x32): Use it instead of
944 Target_selector_x86_64.
945 * arm.cc (Output_data_plt_arm_nacl): New class.
946 (Target_arm_nacl): New class.
947 (Target_selector_arm_nacl): New class.
948 (target_selector_arm, target_selector_armbe): Use it instead of
949 Target_selector_arm.
950
951 * target-select.cc (select_target): Take new Input_file* and off_t
952 arguments, pass them on to recognize method of selector.
953 * object.cc (make_elf_sized_object): Update caller.
954 * parameters.cc (parameters_force_valid_target): Likewise.
955 * incremental.cc (make_sized_incremental_binary): Likewise.
956 * target-select.h: Update decl.
957 (Target_selector::recognize): Take new Input_file* argument,
958 pass it on to do_recognize.
959 (Target_selector::do_recognize): Take new Input_file* argument.
960 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
961 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
962 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
963 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
964
965 * target.h (Target::Target_info): New members isolate_execinstr
966 and rosegment_gap.
967 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
968 * arm.cc (Target_arm::arm_info): Update initializer.
969 * i386.cc (Target_i386::i386_info): Likewise.
970 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
971 * sparc.cc (Target_sparc::sparc_info): Likewise.
972 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
973 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
974 * layout.cc (Layout::attach_allocated_section_to_segment):
975 Take new const Target* argument. If target->isolate_execinstr(), act
976 like --rosegment.
977 (Layout::find_first_load_seg): Take new const Target* argument;
978 if target->isolate_execinstr(), reject PF_X segments.
979 (Layout::relaxation_loop_body): Update caller.
980 (Layout::set_segment_offsets): If target->isolate_execinstr(),
981 reset file offset to zero when we hit LOAD_SEG, and then do a second
982 loop over the segments before LOAD_SEG to reassign offsets after
983 addresses have been determined. Handle target->rosegment_gap().
984 (Layout::attach_section_to_segment): Take new const Target* argument;
985 pass it to attach_allocated_section_to_segment.
986 (Layout::make_output_section): Update caller.
987 (Layout::attach_sections_to_segments): Take new const Target* argument;
988 pass it to attach_section_to_segment.
989 * gold.cc (queue_middle_tasks): Update caller.
990 * layout.h (Layout): Update method decls with new arguments.
991
992 * arm.cc (Target_arm::Target_arm): Take optional argument for the
993 Target_info pointer to use.
994 (Target_arm::do_make_data_plt): New virtual method.
995 (Target_arm::make_data_plt): New method that calls it.
996 (Target_arm::make_plt_entry): Use it.
997 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
998 for the section alignment.
999 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
1000 method.
1001 (Output_data_plt_arm::first_plt_entry_offset): Call it.
1002 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
1003 method.
1004 (Output_data_plt_arm::get_plt_entry_size): Call it.
1005 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
1006 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
1007 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
1008 method.
1009 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
1010 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
1011 method instead of sizeof(plt_entry).
1012 (Output_data_plt_arm::add_entry): Likewise.
1013 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
1014 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
1015 than static method.
1016 (Target_arm::plt_entry_size): Likewise.
1017 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
1018 Move to ...
1019 (Output_data_plt_arm_standard): ... here, new class.
1020 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
1021 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
1022 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
1023
1024 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
1025 Take additional argument for the PLT entry size.
1026 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
1027 Use get_plt_entry_size method rather than plt_entry_size variable.
1028 (Output_data_plt_x86_64::reserve_slot): Likewise.
1029 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
1030 (Output_data_plt_x86_64::add_entry): Likewise.
1031 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
1032 (Output_data_plt_x86_64::address_for_global): Likewise.
1033 (Output_data_plt_x86_64::address_for_local): Likewise.
1034 (Output_data_plt_x86_64::set_final_data_size): Likewise.
1035 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
1036 Make method non-static.
1037 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
1038 method.
1039 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
1040 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
1041 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
1042 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
1043 virtual method.
1044 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
1045 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
1046 virtual method.
1047 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
1048 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
1049 virtual method.
1050 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
1051 (Output_data_plt_x86_64::plt_entry_size)
1052 (Output_data_plt_x86_64::first_plt_entry)
1053 (Output_data_plt_x86_64::plt_entry)
1054 (Output_data_plt_x86_64::tlsdesc_plt_entry)
1055 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
1056 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
1057 (Output_data_plt_x86_64_standard): ... here, new class.
1058 (Target_x86_64::Target_x86_64): Take optional argument for the
1059 Target_info pointer to use.
1060 (Target_x86_64::do_make_data_plt): New virtual method.
1061 (Target_x86_64::make_data_plt): New method to call it.
1062 (Target_x86_64::init_got_plt_for_update): Use that.
1063 Call this->plt_->add_eh_frame method here.
1064 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
1065 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
1066 rather than static method.
1067 (Target_x86_64::plt_entry_size): Likewise.
1068 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
1069 rather than plt_entry_size variable. Move guts of PLT filling to...
1070 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
1071 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
1072 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
1073
1074 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
1075 additional argument for the section alignment.
1076 Don't do add_eh_frame_for_plt here.
1077 (Output_data_plt_i386::first_plt_entry_offset): Make the method
1078 non-static. Use get_plt_entry_size method rather than plt_entry_size
1079 variable.
1080 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
1081 method.
1082 (Output_data_plt_i386::get_plt_entry_size): Call it.
1083 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
1084 (Output_data_plt_i386::add_eh_frame): New method to call it.
1085 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
1086 method.
1087 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
1088 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
1089 method.
1090 (Output_data_plt_i386::fill_plt_entry): New method to call it.
1091 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
1092 method instead of plt_entry_size.
1093 (Output_data_plt_i386::plt_entry_size)
1094 (Output_data_plt_i386::plt_eh_frame_fde_size)
1095 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
1096 (Output_data_plt_i386_standard): ... here, new class.
1097 (Output_data_plt_i386_exec): New class.
1098 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
1099 (Output_data_plt_i386_exec::first_plt_entry): ... here.
1100 (Output_data_plt_i386::exec_plt_entry): Move to ...
1101 (Output_data_plt_i386_exec::plt_entry): ... here.
1102 (Output_data_plt_i386_dyn): New class.
1103 (Output_data_plt_i386::first_plt_entry): Move to ...
1104 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
1105 (Output_data_plt_i386::dyn_plt_entry): Move to ...
1106 (Output_data_plt_i386_dyn::plt_entry): ... here.
1107 (Target_i386::Target_i386): Take optional argument for the Target_info
1108 pointer to use.
1109 (Target_i386::do_make_data_plt): New virtual method.
1110 (Target_i386::make_data_plt): New method to call it.
1111 (Target_i386::make_plt_section): Use that.
1112 Call this->plt_->add_eh_frame method here.
1113 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
1114 rather than plt_entry_size variable.
1115 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
1116 (Output_data_plt_i386::address_for_local): Likewise.
1117 (Output_data_plt_i386::do_write): Likewise.
1118 Move guts of PLT filling to...
1119 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
1120 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
1121 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
1122 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
1123
b9b9f2ee
CC
11242012-05-01 Cary Coutant <ccoutant@google.com>
1125
1126 * dwarf_reader.cc (Dwarf_die::read_attributes)
1127 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
1128 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
1129 * reduced_debug_output.cc
1130 (Output_reduced_debug_info_section::get_die_end): Remove
1131 DW_FORM_GNU_ref_index. Add default case.
1132
57923f48
MW
11332012-04-26 Mark Wielaard <mjw@redhat.com>
1134
1135 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
1136 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
1137 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
1138 DW_AT_high_pc as offset from DW_AT_low_pc.
1139
1140 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
1141 * testsuite/Makefile.in: Regenerate.
1142 * testsuite/gdb_index_test_3.c: New test source file.
1143 * testsuite/gdb_index_test_3.sh: New test source file.
1144
2c54b4f4
ILT
11452012-04-25 Ian Lance Taylor <iant@google.com>
1146
1147 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
1148 pointer.
1149 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
1150 as a class, not a struct.
1151 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
1152 (Target_arm::apply_cortex_a8_workaround): Likewise.
1153 * gc.h: Declare Reloc_types as a struct, not a class.
1154 * object.h: Declare Symbols_data as a struct.
1155 * reloc.h: Declare Read_relocs_data as a struct.
1156 * target.h: Declare Relocate_info as a struct.
1157
a5a5f7a3
DM
11582012-04-24 David S. Miller <davem@davemloft.net>
1159
1160 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
1161 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
1162 and R_SPARC_WPLT30.
1163
f038d496
CC
11642012-04-24 Cary Coutant <ccoutant@google.com>
1165
1166 * incremental-dump.cc (find_input_containing_global): Replace
1167 magic number with symbolic constant.
1168 (dump_incremental_inputs): Update version number.
1169 * incremental.cc (Output_section_incremental_inputs): Update version
1170 number; import symbolic constants from Incremental_inputs_reader.
1171 (Incremental_inputs::create_data_sections): Align relocations
1172 section correctly for 64-bit targets.
1173 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
1174 constants; add padding.
1175 (Output_section_incremental_inputs::write_header): Add assert for
1176 header_size.
1177 (Output_section_incremental_inputs::write_input_files): Add assert
1178 for input_entry_size.
1179 (Output_section_incremental_inputs::write_info_blocks): Add padding;
1180 add assert for object_info_size, input_section_entry_size,
1181 global_sym_entry_size.
1182 * incremental.h (Incremental_inputs_reader): Add symbolic constants
1183 for data structure sizes; use them.
1184 (Incremental_input_entry_reader): Import symbolic constants from
1185 Incremental_inputs_reader; use them.
1186
a4d85145
DM
11872012-04-23 David S. Miller <davem@davemloft.net>
1188
1189 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
1190 and elf_flags_set_.
1191 (Target_sparc::Target_sparc): Initialize new fields.
1192 (Target_sparc::do_make_elf_object): New function.
1193 (Target_sparc::do_adjust_elf_header): New function.
1194
1d509098
CC
11952012-04-23 Cary Coutant <ccoutant@google.com>
1196
1197 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
1198 CU range table of gdb index.
1199
7ebeff7f
DM
12002012-04-20 David S. Miller <davem@davemloft.net>
1201
1202 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
1203 instead of false.
1204
13cf9988
DM
12052012-04-16 David S. Miller <davem@davemloft.net>
1206
2a1079e8
DM
1207 * sparc.cc (Target_sparc::got_address): New function.
1208 (Sparc_relocate_functions::gdop_hix22): New function.
1209 (Sparc_relocate_functions::gdop_lox10): New function.
1210 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
1211 relocs.
1212 (Target_sparc::Scan::local): Likewise if the global symbol is not
1213 preemptible and is not IFUNC.
1214 (Target_sparc::Relocate::relocate): Perform GOTDATA code
1215 transformations for local and non-preemptible non-IFUNC global
1216 symbols.
1217
0bc964fc
DM
1218 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
1219 writing out 64-bit part of ranges.
1220
661d7a80
DM
1221 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
1222 -fpic and -fpie respectively.
1223 * Makefile.in: Regenerate.
1224
8c2bf391
DM
1225 * sparc.cc (class Target_sparc): Add rela_ifunc_.
1226 (Target_sparc::Target_sparc): Initialize new field.
1227 (Target_sparc::do_plt_section_for_global): New function.
1228 (Target_sparc::do_plt_section_for_local): New function.
1229 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
1230 (Target_sparc::make_plt_section): New function, broken out of
1231 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
1232 (Target_sparc::make_plt_entry): Call make_plt_section.
1233 (Target_sparc::make_local_ifunc_plt_entry): New function.
1234 (Target_sparc::rela_ifunc_section): New function.
1235 (Target_sparc::plt_section): Remove const.
1236 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
1237 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
1238 and ifunc_count_ fields.
1239 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
1240 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
1241 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
1242 (Output_data_plt_sparc::rela_ifunc): New function.
1243 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
1244 (Output_data_plt_sparc::has_ifunc_section): New function.
1245 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
1246 (Output_data_plt_sparc::address_for_global): New function.
1247 (Output_data_plt_sparc::address_for_local): New function.
1248 (Output_data_plt_sparc::plt_index_to_offset): New function.
1249 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
1250 and entry_count.
1251 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
1252 entry_count.
1253 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
1254 R_SPARC_JMP_IREL to switch.
1255 (Target_sparc::Scan::check_non_pic): Likewise.
1256 (Target_sparc::Scan::local): Handle IFUNC symbols.
1257 (Target_sparc::Scan::local): Likewise.
1258 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
1259 and plt_address_for_local.
1260 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
1261 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
1262
13cf9988
DM
1263 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
1264 (class Output_data_reloc): Adjust calls to Output_reloc_type.
1265 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
1266 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
1267 global relocs too.
1268 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
1269 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
1270 calls.
1271 * sparc.cc (Target_sparc::Scan::global): Likewise.
1272 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
1273
31821be0
CC
12742012-04-16 Cary Coutant <ccoutant@google.com>
1275
1276 * archive.cc (Library_base::should_include_member): Check for
1277 --export-dynamic-symbol.
1278 * options.h (class General_options): Add --export-dynamic-symbol.
1279 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
1280 --export-dynamic-symbol.
1281 (Symbol_table::gc_mark_undef_symbols): Likewise.
1282 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
1283
2615994e
DM
12842012-04-12 David S. Miller <davem@davemloft.net>
1285
1286 * sparc.cc (Reloc::wdisp10): New relocation method.
1287 (Reloc::h34): Likewise.
1288 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
1289 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
1290 R_SPARC_WDISP10.
1291 (Target_sparc::Scan::local): Likewise.
1292 (Target_sparc::Scan::global): Likewise.
1293 (Target_sparc::Relocate::relocate): Likewise.
1294
6782735d
CC
12952012-04-09 Cary Coutant <ccoutant@google.com>
1296
1297 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
1298 low_pc == 0.
1299
8c7a0b00
ILT
13002012-04-06 Ian Lance Taylor <iant@google.com>
1301
1302 * timer.cc: #include <unistd.h>.
1303
58797674
RM
13042012-04-06 Roland McGrath <mcgrathr@google.com>
1305
1306 * configure.in (AC_CHECK_HEADERS): Add locale.h.
1307 * config.in: Regenerate.
1308 * configure: Regenerate.
1309
44350750
NC
13102012-04-05 Nick Clifton <nickc@redhat.com>
1311
1312 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
1313 (AM_LC_MESSAGES): Add.
1314 * aclocal.m4: Regenerate.
1315 * config.in: Regenerate.
1316 * configure: Regenerate.
1317
c1027032
CC
13182012-03-21 Cary Coutant <ccoutant@google.com>
1319
1320 * Makefile.am: Add gdb-index.cc, gdb-index.h.
1321 * Makefile.in: Regenerate.
1322 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
1323 (Sized_elf_reloc_mapper::symbol_section): New function.
1324 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
1325 (make_elf_reloc_mapper): New function.
1326 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
1327 (Dwarf_abbrev_table::do_read_abbrevs): New function.
1328 (Dwarf_abbrev_table::do_get_abbrev): New function.
1329 (Dwarf_ranges_table::read_ranges_table): New function.
1330 (Dwarf_ranges_table::read_range_list): New function.
1331 (Dwarf_pubnames_table::read_section): New function.
1332 (Dwarf_pubnames_table::read_header): New function.
1333 (Dwarf_pubnames_table::next_name): New function.
1334 (Dwarf_die::Dwarf_die): New function.
1335 (Dwarf_die::read_attributes): New function.
1336 (Dwarf_die::skip_attributes): New function.
1337 (Dwarf_die::set_name): New function.
1338 (Dwarf_die::set_linkage_name): New function.
1339 (Dwarf_die::attribute): New function.
1340 (Dwarf_die::string_attribute): New function.
1341 (Dwarf_die::int_attribute): New function.
1342 (Dwarf_die::uint_attribute): New function.
1343 (Dwarf_die::ref_attribute): New function.
1344 (Dwarf_die::child_offset): New function.
1345 (Dwarf_die::sibling_offset): New function.
1346 (Dwarf_info_reader::check_buffer): New function.
1347 (Dwarf_info_reader::parse): New function.
1348 (Dwarf_info_reader::do_parse): New function.
1349 (Dwarf_info_reader::do_read_string_table): New function.
1350 (Dwarf_info_reader::lookup_reloc): New function.
1351 (Dwarf_info_reader::get_string): New function.
1352 (Dwarf_info_reader::visit_compilation_unit): New function.
1353 (Dwarf_info_reader::visit_type_unit): New function.
1354 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
1355 Sized_elf_reloc_mapper.
1356 (Sized_dwarf_line_info::symbol_section): Remove function.
1357 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
1358 (Sized_dwarf_line_info::read_line_mappings): Remove object
1359 parameter, adjust callers.
1360 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
1361 * dwarf_reader.h: Include <sys/types.h>.
1362 (class Track_relocs): Remove forward declaration.
1363 (class Elf_reloc_mapper): New class.
1364 (class Sized_elf_reloc_mapper): New class.
1365 (class Dwarf_abbrev_table): New class.
1366 (class Dwarf_range_list): New class.
1367 (class Dwarf_ranges_table): New class.
1368 (class Dwarf_pubnames_table): New class.
1369 (class Dwarf_die): New class.
1370 (class Dwarf_info_reader): New class.
1371 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
1372 (Sized_dwarf_line_info::symbol_section): Remove member function.
1373 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
1374 base class.
1375 * gdb-index.cc: New source file.
1376 * gdb-index.h: New source file.
1377 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
1378 and .debug_types sections, call Layout::add_to_gdb_index.
1379 (Sized_relobj_incr::do_section_name): Implement.
1380 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
1381 return type; Implement.
1382 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
1383 return type.
1384 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
1385 parameter list and return type.
1386 (Sized_incr_dynobj::do_section_contents): Likewise.
1387 * layout.cc: Include gdb-index.h.
1388 (Layout::Layout): Initialize gdb_index_data_.
1389 (Layout::init_fixed_output_section): Check for .gdb_index section.
1390 (Layout::add_to_gdb_index): New function. Instantiate.
1391 * layout.h: Add forward declaration for class Gdb_index.
1392 (Layout::add_to_gdb_index): New member function.
1393 (Layout::gdb_index_data_): New data member.
1394 * main.cc: Include gdb-index.h.
1395 (main): Print statistics for gdb index.
1396 * object.cc (Object::section_contents): Move code into
1397 do_section_contents.
1398 (need_decompressed_section): Check for sections needed when building
1399 gdb index.
1400 (build_compressed_section_map): Likewise.
1401 (Sized_relobj_file::do_read_symbols): Need local symbols when building
1402 gdb index.
1403 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
1404 sections; call Layout::add_to_gdb_index.
1405 (Sized_relobj_file::do_decompressed_section_contents): Call
1406 do_section_contents directly.
1407 * object.h (Object::do_section_contents): Adjust parameter list and
1408 return type.
1409 (Object::do_decompressed_section_contents): Call do_section_contents
1410 directly.
1411 (Sized_relobj_file::do_section_contents): Adjust parameter list and
1412 return type.
1413 * options.h (class General_options): Add --gdb-index option.
1414 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
1415 list and return type.
1416 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
1417 * reloc.h (Track_relocs::checkpoint): New function.
1418 (Track_relocs::reset): New function.
1419
1420 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
1421 New test cases.
1422 * testsuite/Makefile.in: Regenerate.
1423 * testsuite/gdb_index_test.cc: New test source file.
1424 * testsuite/gdb_index_test_1.sh: New test source file.
1425 * testsuite/gdb_index_test_2.sh: New test source file.
1426
647f1574
DK
14272012-03-19 Doug Kwan <dougkwan@google.com>
1428
1429 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 1430 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
1431 __exidx_start and __exidx_end. Make symbol table parameter
1432 anonymous as it is not used.
1433 * gold.cc (queue_middle_tasks): Call target hook to define any
1434 target-specific symbols.
1435 * target.h (Target::define_standard_symbols): New method.
1436 (Target::do_define_standard_symbols): Same.
1437 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
1438 * testsuite/Makefile.in: Regenerate.
1439 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
1440 and __exidx_end.
1441 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
1442 relocations are generated for __exidx_start and __exidx_end.
1443
7c6109da
DK
14442012-03-16 Doug Kwan <dougkwan@google.com>
1445
1446 * testsuite/Makefile.am: Disable test initpri3b.
1447 * testsuite/Makefile.in: Regenerate.
1448
7b8957f8
DK
14492012-03-15 Doug Kwan <dougkwan@google.com>
1450
1451 * arm.cc (Target_arm::got_section): Make .got section read-only
1452 if -z now is given.
1453
14dc9ef7
ILT
14542012-03-15 Ian Lance Taylor <iant@google.com>
1455
1456 PR gold/13850
1457 * layout.cc (Layout::make_output_section): Correctly mark
1458 SHT_INIT_ARRAY, et. al., as relro.
1459
fa40b62a
DK
14602012-03-14 Doug Kwan <dougkwan@google.com>
1461
1462 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
1463 dynamic relocations for protected symbols in shared objects.
1464
fd325007
ILT
14652012-03-13 Ian Lance Taylor <iant@google.com>
1466
1467 * resolve.cc (Symbol_table::resolve): When merging common symbols,
1468 keep the larger alignment.
1469
e8dd54e1
CC
14702012-03-12 Cary Coutant <ccoutant@google.com>
1471
1472 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
1473 handling of DW_LNE_define_file.
1474
feb5f3b0
CC
14752012-03-12 Cary Coutant <ccoutant@google.com>
1476
1477 * reduced_debug_output.cc
1478 (Output_reduced_debug_info_section::get_die_end): Add new FORM
1479 codes to switch.
1480
a1fb4256
CC
14812012-02-29 Cary Coutant <ccoutant@google.com>
1482
1483 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
1484
5dd8762a
CC
14852012-02-29 Cary Coutant <ccoutant@google.com>
1486
1487 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
1488 Call Object::decompressed_section_contents.
1489 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
1490 New dtor.
1491 (Sized_dwarf_line_info::buffer_start_): New data member.
1492 * merge.cc (Output_merge_data::do_add_input_section): Call
1493 Object::decompressed_section_contents.
1494 (Output_merge_string::do_add_input_section): Likewise.
1495 * object.cc (need_decompressed_section): New function.
1496 (build_compressed_section_map): Decompress sections needed later.
1497 (Sized_relobj_file::do_decompressed_section_contents): New function.
1498 (Sized_relobj_file::do_discard_decompressed_sections): New function.
1499 * object.h (Object::decompressed_section_contents): New function.
1500 (Object::discard_decompressed_sections): New function.
1501 (Object::do_decompressed_section_contents): New function.
1502 (Object::do_discard_decompressed_sections): New function.
1503 (Compressed_section_info): New type.
1504 (Compressed_section_map): Include decompressed section contents.
1505 (Sized_relobj_file::do_decompressed_section_contents): New function.
1506 (Sized_relobj_file::do_discard_decompressed_sections): New function.
1507
7b5de7ee
CC
15082012-02-16 Cary Coutant <ccoutant@google.com>
1509
1510 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
1511 * testsuite/Makefile.in: Regenerate.
1512
f9fa4a63
CC
15132012-02-14 Cary Coutant <ccoutant@google.com>
1514
1515 * options.cc (General_options::finalize): Disallow -pie and -static.
1516
2c175ebc
DK
15172012-02-03 Doug Kwan <dougkwan@google.com>
1518
1519 * arm.cc (Arm_relocate_functions::abs8,
1520 Arm_relocate_functions::abs16): Use
1521 Bits::has_signed_unsigned_overflow32.
1522 (Arm_relocate_functions::thm_abs8): Correct range of
1523 overflow check.
1524 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
1525 in assertions.
1526
90cff06f
DK
15272012-02-02 Doug Kwan <dougkwan@google.com>
1528
1529 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
1530 position independent outputs, not just shared objects.
1531
63887f3d
L
15322012-01-30 H.J. Lu <hongjiu.lu@intel.com>
1533
1534 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
1535 * configure: Regenerated.
1536
bef2b434
ILT
15372012-01-27 Ian Lance Taylor <iant@google.com>
1538
1539 * reloc.h (Bits): New class with static functions, copied from
1540 namespace utils in arm.cc.
1541 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
1542 instead.
1543
c335b55d
L
15442012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1545
1546 * incremental.cc (write_info_blocks): Correct relocation offset.
1547
41194d9f
L
15482012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1549
1550 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
1551 (Relocate::tls_gd_to_le): Likewise.
1552
1bae613c
L
15532012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1554
1555 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
1556
24482ca0
L
15572012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1558
1559 * configure.ac: Check if -mcmodel=medium works.
1560 * configure: Regenerated.
1561
c2c7840a
CC
15622012-01-24 Cary Coutant <ccoutant@google.com>
1563
1564 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
1565 definition and ...
1566 (read_unsigned_LEB_128_x): ... this new function.
1567 (read_signed_LEB_128): Replaced with inline definition and ...
1568 (read_signed_LEB_128_x): ... this new function.
1569 * int_encoding.h (read_unsigned_LEB_128_x): New function.
1570 (read_unsigned_LEB_128): Add inline definition.
1571 (read_signed_LEB_128_x): New function.
1572 (read_signed_LEB_128): Add inline definition.
1573 * testsuite/Makefile.am (leb128_unittest): New unit test.
1574 * testsuite/Makefile.in: Regenerate.
1575 * testsuite/leb128_unittest.cc: New unit test.
1576
833de760 15772012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
1578
1579 PR gold/13617
1580 * i386.cc (Target_i386::do_code_fill): When using a jmp
1581 instruction, pad with nop instructions.
1582 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
1583
618d6666
L
15842012-01-22 H.J. Lu <hongjiu.lu@intel.com>
1585
1586 * x86_64.cc (gc_process_relocs): Add typename on types used in
1587 template.
1588 (scan_relocs): Likewise.
1589 (relocate_section): Likewise.
1590 (apply_relocation): Likewise.
1591
3660ff06
L
15922012-01-10 H.J. Lu <hongjiu.lu@intel.com>
1593
1594 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
1595 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
1596 under x32.
1597
fc51264f
L
15982012-01-09 H.J. Lu <hongjiu.lu@intel.com>
1599
1600 * x86_64.cc: Initial support for x32.
1601
dd74ae06
CC
16022012-01-03 Cary Coutant <ccoutant@google.com>
1603
1604 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
1605 Use abstract base class for GOT.
1606 * gold/output.h (class Output_data_got_base): New abstract base class.
1607 (class Output_data_got): Derive from new base class, adjust ctors.
1608 (Output_data_got::reserve_slot): Make virtual; rename to
1609 do_reserve_slot; Adjust callers.
1610 * gold/target.h (Sized_target::init_got_plt_for_update): Return
1611 pointer to abstract base class.
1612 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
1613
83896202
ILT
16142011-12-18 Ian Lance Taylor <iant@google.com>
1615
1616 * object.h (Relobj::local_symbol_value): New function.
1617 (Relobj::local_plt_offset): New function.
1618 (Relobj::local_has_got_offset): New function.
1619 (Relobj::local_got_offset): New function.
1620 (Relobj::set_local_got_offset): New function.
1621 (Relobj::do_local_symbol_value): New pure virtual function.
1622 (Relobj::do_local_plt_offset): Likewise.
1623 (Relobj::do_local_has_got_offset): Likewise.
1624 (Relobj::do_local_got_offset): Likewise.
1625 (Relobj::do_set_local_got_offset): Likewise.
1626 (Sized_relobj::do_local_has_got_offset): Rename from
1627 local_has_got_offset.
1628 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
1629 (Sized_relobj::do_set_local_got_offset): Rename from
1630 set_local_got_offset.
1631 (Sized_relobj_file::do_local_plt_offset): Rename from
1632 local_plt_offset.
1633 (Sized_relobj_file::do_local_symbol_value): New function.
1634 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
1635 local_plt_offset.
1636 * output.cc (Output_data_got::Got_entry::write): Change object to
1637 Relobj. Use local_symbol_value.
1638 (Output_data_got::add_global_with_rel): Change rel_dyn to
1639 Output_data_reloc_generic*. Use add_global_generic.
1640 (Output_data_got::add_global_with_rela): Remove. Change all
1641 callers to use add_global_with_rel.
1642 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
1643 Output_data_reloc_generic*. Use add_global_generic.
1644 (Output_data_got::add_global_pair_with_rela): Remove. Change all
1645 callers to use add_global_pair_with_rel.
1646 (Output_data_got::add_local): Change object to Relobj*.
1647 (Output_data_got::add_local_plt): Likewise.
1648 (Output_data_got::add_local_with_rel): Change object to Relobj*,
1649 change rel_dyn to Output_data_reloc_generic*. Use
1650 add_local_generic.
1651 (Output_data_got::add_local_with_rela): Remove. Change all
1652 callers to use all_local_with_rel.
1653 (Output_data_got::add_local_pair_with_rel): Change object to
1654 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
1655 add_output_section_generic.
1656 (Output_data_got::add_local_pair_with_rela): Remove. Change all
1657 callers to use add_local_pair_with_rel.
1658 (Output_data_got::reserve_local): Change object to Relobj*.
1659 * output.h: (class Output_data_reloc_generic): Add pure virtual
1660 declarations for add_global_generic, add_local_generic,
1661 add_output_section_generic.
1662 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
1663 functions for Output_data_reloc_generic. Update declarations for
1664 changes listed in output.cc.
1665 (class Output_data_got): Change template parameter to got_size.
1666 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
1667 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
1668 function.
1669 (Sized_relobj_incr::do_local_plt_offset): New function.
1670 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
1671 add_global_generic.
1672
76677ad0
CC
16732011-12-17 Cary Coutant <ccoutant@google.com>
1674
1675 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
1676 * resolve.cc (Symbol_table::resolve): Likewise.
1677 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
1678 arrays.
1679 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
1680
8b8dd8d5
ILT
16812011-12-16 Ian Lance Taylor <iant@google.com>
1682
1683 * output.h (Output_data_reloc_generic::add): Only call
1684 add_dynamic_reloc if this is a dynamic reloc section.
1685
d55525b9
L
16862011-12-15 H.J. Lu <hongjiu.lu@intel.com>
1687
1688 PR gold/13505
1689 * target-reloc.h (apply_relocation): Replace <64, false> with
1690 <size, big_endian>.
1691
ff81c7c1
NC
16922011-11-25 Nick Clifton <nickc@redhat.com>
1693
1694 * po/it.po: New Italian translation.
1695
628f39be
SA
16962011-11-17 Sterling Augustine <saugustine@google.com>
1697
1698 * script.cc (script_include_directive): Implement.
1699 (read_script_file): New local variables name and search_path. Update
1700 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
1701 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
1702 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
1703
98ef3ea4
SA
17042011-11-11 Sterling Augustine <saugustine@google.com>
1705
1706 * yyscript.y (section_cmd): Add support for INCLUDE directive.
1707 (file_or_sections_cmd): Likewise.
1708
f4a8b6d7
DK
17092011-11-11 Doug Kwan <dougkwan@google.com>
1710
1711 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
1712 if --just-symbols is given.
1713
29ab395d
DK
17142011-11-10 Doug Kwan <dougkwan@google.com>
1715
1716 PR gold/13362
1717 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
1718 when processing data relocs.
1719 * reloc.h (Relocate_functions::rel_unaligned): New method.
1720 (Relocate_functions::pcrel_unaligned): Ditto.
1721 (Relocate_functions::rel32_unaligned): Ditto.
1722 (Relocate_functions::pcrel32_unaligned): Ditto.
1723
2c339f71
DK
17242011-11-09 Doug Kwan <dougkwan@google.com>
1725
1726 PR gold/13362
1727 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
1728 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
1729 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
1730 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
1731 (Relocate_functions::rel_unaligned): New.
1732 (Relocate_functions::rel32_unaligned): New.
1733 * target-reloc.h (relocate_for_relocatable): Add code to handle
1734 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
1735 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
1736 arm_unaligned_reloc_r): New targets.
1737 * testsuite/Makefile.in: Regenerate.
1738 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
1739 linking.
1740
3f3cddf1
ILT
17412011-11-02 Ian Lance Taylor <iant@google.com>
1742
1743 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
1744 NATIVE_LINKER.
1745 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
1746 * options.cc (General_options::finalize): Use library search path
1747 from configure script if specified. If not native and no sysroot,
1748 only search TOOLLIBDIR.
1749 * options.h (Search_directory::Search_directory): Change name to
1750 const std::string&.
1751 (General_options::add_to_library_path_with_sysroot): Change arg to
1752 const std::string&.
1753 * configure, Makefile.in, config.in: Rebuild.
1754
a8e2273b
ILT
17552011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
1756
1757 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
1758 we are working around the ARM1176 Erratum.
1759 * options.h (General_options::fix_arm1176): Add option.
1760 * testsuite/Makefile.am: Add testcases, and keep current ones
1761 working.
1762 * testsuite/Makefile.in: Regenerate.
1763 * testsuite/arm_fix_1176.s: New file.
1764 * testsuite/arm_fix_1176.sh: Likewise.
1765
cd6eab1c
ILT
17662011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
1767
1768 * arm.cc (Target_arm::Target_arm): Remove initialisation of
1769 may_use_blx_.
1770 (Target_arm::may_use_blx): Remove method.
1771 (Target_arm::set_may_use_blx): Likewise.
1772 (Target_arm::may_use_v4t_interworking): New method.
1773 (Target_arm::may_use_v5t_interworking): Likewise.
1774 (Target_arm::may_use_blx_): Remove member variable.
1775 (Arm_relocate_functions::arm_branch_common): Check for v5T
1776 interworking.
1777 (Arm_relocate_functions::thumb_branch_common): Likewise.
1778 (Reloc_stub::stub_type_for_reloc): Likewise.
1779 (Target_arm::do_finalize_sections): Correct interworking checks.
1780 * testsuite/Makefile.am: Add new tests.
1781 * testsuite/Makefile.in: Regenerate.
1782 * testsuite/arm_farcall_arm_arm.s: New test.
1783 * testsuite/arm_farcall_arm_arm.sh: Likewise.
1784 * testsuite/arm_farcall_arm_thumb.s: Likewise.
1785 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
1786 * testsuite/arm_farcall_thumb_arm.s: Likewise.
1787 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
1788 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
1789 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
1790
286adcf4
CC
17912011-10-31 Cary Coutant <ccoutant@google.com>
1792
1793 PR gold/13023
1794 * expression.cc (Expression::eval_with_dot): Add
1795 is_section_dot_assignment parameter.
1796 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
1797 absolute and assigning to dot within a section.
1798 * script-sections.cc
1799 (Output_section_element_assignment::set_section_addresses): Pass
1800 dot_section to set_if_absolute.
1801 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
1802 as is_section_dot_assignment flag to eval_with_dot.
1803 (Output_section_element_dot_assignment::set_section_addresses):
1804 Likewise.
1805 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
1806 parameter. Also set value if relative to dot_section; set the
1807 symbol's output_section.
1808 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
1809 parameter. Adjust all callers.
1810 (Expression::eval_maybe_dot): Likewise.
1811 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
1812 Adjust all callers.
1813 * testsuite/script_test_2.t: Test assignment of an absolute value
1814 to dot within an output section element.
1815
9634ed06
CC
18162011-10-31 Cary Coutant <ccoutant@google.com>
1817
1818 * options.h (class General_options): Add --[no-]gnu-unique options.
1819 * symtab.cc (Symbol_table::sized_write_globals): Convert
1820 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
1821
de4101c7
CC
18222011-10-31 Cary Coutant <ccoutant@google.com>
1823
1824 PR gold/13359
1825 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
1826 unnecessary assertion.
1827 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
1828
7257cc92
ST
18292011-10-31 Sriraman Tallam <tmsriram@google.com>
1830
1831 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1832 gc_mark_symbol.
1833 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1834 gc_mark_symbol.
1835 Change to just keep the section associated with symbol.
1836 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
1837 they are externally visible and --export-dynamic is turned on.
1838 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
1839
bfc34b3f
ILT
18402011-10-19 Ian Lance Taylor <iant@google.com>
1841
1842 PR gold/13163
1843 * script-sections.cc
1844 (Output_section_element_dot_assignment::needs_output_section): New
1845 function.
1846
ea0d8c47
ILT
18472011-10-19 Ian Lance Taylor <iant@google.com>
1848
1849 PR gold/13204
1850 * layout.cc (Layout::segment_precedes): Don't assert failure if a
1851 --section-start option was seen.
1852 * options.h (General_options::any_section_start): New function.
1853
abd242a9
DM
18542011-10-18 David S. Miller <davem@davemloft.net>
1855
1856 PR binutils/13301
1857 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
1858 member to track relocation locations that have moved during TLS
1859 reloc optimizations.
1860 (Target_sparc::Relocate::Relocate): Initialize to NULL.
1861 (Target_sparc::Relocate::relocate): Adjust view down by 4
1862 bytes if it matches reloc_adjust_addr_.
1863 (Target_sparc::Relocate::relocate_tls): Always move the
1864 __tls_get_addr call delay slot instruction forward 4 bytes when
1865 performing relaxation.
1866
bab9090f
CC
18672011-10-18 Cary Coutant <ccoutant@google.com>
1868
1869 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
1870 (Output_file::map_no_anonymous): Check for non-zero
1871 return code from posix_fallocate.
1872
f7c5b166
CC
18732011-10-17 Cary Coutant <ccoutant@google.com>
1874
1875 PR gold/13245
1876 * plugin.cc (is_visible_from_outside): Check for symbols
1877 referenced from dynamic objects.
1878 * resolve.cc (Symbol_table::resolve): Don't count references
1879 from dynamic objects as references from real ELF files.
1880 * testsuite/plugin_test_2.sh: Adjust expected result.
1881
b490c0bb
CC
18822011-10-17 Cary Coutant <ccoutant@google.com>
1883
1884 * gold.cc: Include timer.h.
1885 (queue_middle_tasks): Stamp time.
1886 (queue_final_tasks): Likewise.
1887 * main.cc (main): Store timer in parameters. Print timers
1888 for each pass.
1889 * parameters.cc (Parameters::Parameters): Initialize timer_.
1890 (Parameters::set_timer): New function.
1891 (set_parameters_timer): New function.
1892 * parameters.h (Parameters::set_timer): New function.
1893 (Parameters::timer): New function.
1894 (Parameters::timer_): New data member.
1895 (set_parameters_timer): New function.
1896 * timer.cc (Timer::stamp): New function.
1897 (Timer::get_pass_time): New function.
1898 * timer.h (Timer::stamp): New function.
1899 (Timer::get_pass_time): New function.
1900 (Timer::pass_times_): New data member.
1901
f475cf7b
CC
19022011-10-17 Cary Coutant <ccoutant@google.com>
1903
1904 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
1905 task for members of lib groups.
1906
cdd7e244
CC
19072011-10-17 Cary Coutant <ccoutant@google.com>
1908
1909 PR gold/13288
4f95c8b4 1910 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
1911 (File_read::make_view): Move bounds check (replace with assert)...
1912 (File_read::find_or_make_view): ... to here.
1913
dfb45471
CC
19142011-10-12 Cary Coutant <ccoutant@google.com>
1915
4f95c8b4 1916 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
1917 ::read returns less than requested size.
1918
53bbcc1b
CC
19192011-10-10 Cary Coutant <ccoutant@google.com>
1920
4f95c8b4 1921 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
1922 Initialize defined_count_.
1923 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
1924 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
1925 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
1926 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
1927 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 1928 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
1929 member.
1930 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 1931 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
1932 Return zeroes instead of internal error.
1933
397b129b
CC
19342011-10-10 Cary Coutant <ccoutant@google.com>
1935
1936 PR gold/13249
4f95c8b4 1937 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 1938 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 1939 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
1940 (Output_reloc::type_): Adjust size of bit field.
1941 (Output_reloc::use_plt_offset_): New bit field.
1942 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
1943 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
1944 flag. Adjust all callers.
4f95c8b4 1945 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
1946 creating RELATIVE relocations.
1947
d5698657
NC
19482011-10-10 Nick Clifton <nickc@redhat.com>
1949
1950 * po/es.po: Updated Spanish translation.
1951 * po/fi.po: Updated Finnish translation.
1952
6a59a5c2
DN
19532011-10-03 Diego Novillo <dnovillo@google.com>
1954
1955 * options.cc (parse_uint): Fix dereference of RETVAL.
1956
f0558624
ST
19572011-09-29 Sriraman Tallam <tmsriram@google.com>
1958
1959 * layout.h (section_order_map_): New member.
1960 (get_section_order_map): New member function.
1961 * output.cc (Output_section::add_input_section): Check for patterns
1962 only when --section-ordering-file is specified.
1963 * gold.cc (queue_middle_tasks): Delay updating order of sections till
1964 output_sections have been formed.
1965 * layout.cc (Layout_Layout): Initialize section_order_map_.
1966 * plugin.cc (update_section_order): Store order in order_map. Do not
1967 update the order.
1968 * testsuite/Makefile.am: Add test case for plugin_final_layout.
1969 * testsuite/Makefile.in: Regenerate.
1970 * testsuite/plugin_section_order.c: New file.
1971 * testsuite/plugin_final_layout.cc: New file.
1972 * testsuite/plugin_final_layout.sh: New file.
1973
a7dac153
CC
19742011-09-29 Cary Coutant <ccoutant@google.com>
1975
4f95c8b4 1976 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 1977 Check for NULL.
4f95c8b4 1978 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
1979 symbols during incremental update.
1980 (Symbol_table::add_from_dynobj): Likewise.
1981
eebd87a5
ILT
19822011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1983 Ian Lance Taylor <iant@google.com>
1984
1985 * symtab.cc (Symbol_table::define_special_symbol): Always
1986 canonicalize version string.
1987
403a3331
CC
19882011-09-26 Cary Coutant <ccoutant@google.com>
1989
4f95c8b4
CC
1990 * gold.cc (queue_initial_tasks): Move option checks ...
1991 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
1992 some options; make others fatal.
1993
235061c2
CC
19942011-09-26 Cary Coutant <ccoutant@google.com>
1995
1996 gcc PR lto/47247
1997 * plugin.cc (get_symbols_v2): New function.
1998 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
1999 (is_referenced_from_outside): New function.
2000 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
2001 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
2002 (get_symbols): Pass version parameter.
2003 (get_symbols_v2): New function.
2004 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
2005 parameter.
2006 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
2007 (onload): Add LDPT_GET_SYMBOLS_V2.
2008 (all_symbols_read_hook): Use get_symbols_v2; check for
2009 LDPR_PREVAILING_DEF_IRONLY_EXP.
2010 * testsuite/plugin_test_3.sh: Update expected results.
2011
dc87f620
ILT
20122011-09-23 Simon Baldwin <simonb@google.com>
2013
2014 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
2015 configuration options.
2016 * configure: Regenerate.
2017 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
2018 * Makefile.in: Regenerate.
2019 * testsuite/Makefile.in: Regenerate.
2020
a8279f82
ST
20212011-09-19 Sriraman Tallam <tmsriram@google.com>
2022
2023 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
2024
0c9350c8
CC
20252011-09-19 Cary Coutant <ccoutant@google.com>
2026
2027 * incremental.cc (can_incremental_update): Fix typo in comment.
2028 * incremental.h (can_incremental_update): Likewise.
2029
aa06ae28
CC
20302011-09-18 Cary Coutant <ccoutant@google.com>
2031
2032 * incremental.cc (can_incremental_update): New function.
2033 * incremental.h (can_incremental_update): New function.
2034 * layout.cc (Layout::init_fixed_output_section): Call it.
2035 (Layout::make_output_section): Don't allow patch space in .eh_frame.
2036 * object.cc (Sized_relobj_file::do_layout): Call
2037 can_incremental_update.
2038
ebb300b2
CC
20392011-09-13 Cary Coutant <ccoutant@google.com>
2040
2041 * configure.ac: Check for glibc support for gnu_indirect_function
2042 support with static linking, setting automake conditional
2043 IFUNC_STATIC.
2044 * Makefile.in: Regenerate.
2045 * configure: Regenerate.
2046
2047 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
2048 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
2049 for IFUNC_STATIC.
2050 * testsuite/Makefile.in: Regenerate.
2051
1206d0d5
CC
20522011-09-13 Cary Coutant <ccoutant@google.com>
2053
2054 * incremental.cc (Sized_relobj_incr::do_layout): Call
2055 report_comdat_group for kept comdat sections.
2056 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
2057 * testsuite/Makefile.in: Regenerate.
2058 * testsuite/incr_comdat_test_1.cc: New source file.
2059 * testsuite/incr_comdat_test_2_v1.cc: New source file.
2060 * testsuite/incr_comdat_test_2_v2.cc: New source file.
2061 * testsuite/incr_comdat_test_2_v3.cc: New source file.
2062
40b29874
ILT
20632011-09-13 Ian Lance Taylor <iant@google.com>
2064
2065 * object.cc (Sized_relobj_file::do_layout): Remove unused local
2066 variable external_symbols_offset.
2067
1b045aac
ILT
20682011-09-12 Ian Lance Taylor <iant@google.com>
2069
2070 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
2071 triggered if object has no symbols.
2072
24c6c55a
DM
20732011-09-09 David S. Miller <davem@davemloft.net>
2074
2075 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
2076 (Output_fill_debug_line::do_write): Likewise.
2077
66570254
CC
20782011-08-29 Cary Coutant <ccoutant@google.com>
2079
2080 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
2081 casts to match formatting specs.
2082 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
2083
8ea8cd50
CC
20842011-08-26 Cary Coutant <ccoutant@google.com>
2085
2086 * layout.cc (Free_list::allocate): Provide guarantee of minimum
2087 remaining hole size when allocating.
2088 (Layout::make_output_section): Set fill methods for debug sections.
2089 * layout.h (Free_list::Free_list_node): Move from private to
2090 public.
2091 (Free_list::set_min_hole_size): New function.
2092 (Free_list::begin, Free_list::end): New functions.
2093 (Free_list::min_hole_): New data member.
2094 * output.cc: Include dwarf.h.
2095 (Output_fill_debug_info::do_minimum_hole_size): New function.
2096 (Output_fill_debug_info::do_write): New function.
2097 (Output_fill_debug_line::do_minimum_hole_size): New function.
2098 (Output_fill_debug_line::do_write): New function.
2099 (Output_section::Output_section): Initialize new data member.
2100 (Output_section::set_final_data_size): Ensure patch space is larger
2101 than minimum hole size.
2102 (Output_section::do_write): Fill holes in debug sections.
2103 * output.h (Output_fill): New class.
2104 (Output_fill_debug_info): New class.
2105 (Output_fill_debug_line): New class.
2106 (Output_section::set_free_space_fill): New function.
2107 (Output_section::free_space_fill_): New data member.
2108 * testsuite/Makefile.am (incremental_test_3): Add
2109 --incremental-patch option.
2110 (incremental_test_4): Likewise.
2111 (incremental_test_5): Likewise.
2112 (incremental_test_6): Likewise.
2113 (incremental_copy_test): Likewise.
2114 (incremental_common_test_1): Likewise.
2115 * testsuite/Makefile.in: Regenerate.
2116
7cf80422
NC
21172011-08-26 Nick Clifton <nickc@redhat.com>
2118
2119 * po/es.po: Updated Spanish translation.
2120
c3f7b0e5
CC
21212011-08-01 Cary Coutant <ccoutant@google.com>
2122
2123 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
2124 * gold/testsuite/Makefile.in: Regenerate.
2125 * gold/testsuite/justsyms_exec.c: New source file.
2126 * gold/testsuite/justsyms_lib.c: New source file.
2127
9590bf25
CC
21282011-08-01 Cary Coutant <ccoutant@google.com>
2129
2130 * layout.cc (Layout::set_segment_offsets): Don't realign text
2131 segment if -Ttext was specified.
2132 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
2133 file type.
2134 * object.h (Sized_relobj_file::e_type): New function.
2135 (Sized_relobj_file::e_type_): New data member.
2136 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
2137 base address for ET_EXEC files.
2138 * target.cc (Target::do_make_elf_object_implementation): Allow
2139 ET_EXEC files with --just-symbols option.
2140
dcd8d12e
CC
21412011-07-28 Cary Coutant <ccoutant@google.com>
2142
2143 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
2144 Add thread_number parameter.
2145 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
2146 * workqueue-threads.cc
2147 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
2148 current thread if its thread number is greater than desired thread
2149 count.
2150 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
2151 Add thread_number parameter.
2152 (Workqueue::should_cancel_thread): Likewise.
2153 (Workqueue::find_runnable_or_wait): Pass thread_number to
2154 should_cancel_thread.
2155 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
2156 parameter.
2157
804eb480
ST
21582011-07-22 Sriraman Tallam <tmsriram@google.com>
2159
2160 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
2161 only after checking if it cannot be forced local.
2162 * symtab.h (is_externally_visible): Check if the symbol is not forced
2163 local.
2164
f1ddb600
ILT
21652011-07-15 Ian Lance Taylor <iant@google.com>
2166
2167 * options.h (class General_options): Add --print-output-format.
2168 Move -EL next to -EB, for better --help output.
2169 * target-select.cc: Include <cstdio>, "options.h", and
2170 "parameters.h".
2171 (Target_selector::do_target_bfd_name): New function.
2172 (print_output_format): New function.
2173 * target-select.h (class Target_selector): Update declarations.
2174 (Target_selector::target_bfd_name): New function.
2175 (print_output_format): Declare.
2176 * main.cc: Include "target-select.h".
2177 (main): Handle --print-output-format.
2178 * gold.cc: Include "target-select.h".
2179 (queue_initial_tasks): Handle --print-output-format when there are
2180 no input files.
2181 * parameters.cc (parameters_force_valid_target): Give a better
2182 error message if -EB/-EL does not match target.
2183 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
2184 function.
2185
7d172687
ILT
21862011-07-15 Ian Lance Taylor <iant@google.com>
2187
2188 * i386.cc (class Output_data_plt_i386): Add layout_ field.
2189 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
2190 (Output_data_plt_i386::do_write): Write address of .dynamic
2191 section to first entry in .got.plt section.
2192 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
2193 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
2194 Initialize layout_.
2195 (Output_data_plt_x86_64::do_write): Write address of .dynamic
2196 section to first entry in .got.plt section.
2197 * layout.h (Layout::dynamic_section): New function.
2198
e9552f7e
ST
21992011-07-13 Sriraman Tallam <tmsriram@google.com>
2200
2201 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
2202 to claim_file call.
2203 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
2204 input_section_position_, and input_section_glob_.
2205 (read_layout_from_file): Call function section_ordering_specified.
2206 * layout.h (is_section_ordering_specified): New function.
2207 (section_ordering_specified): New function.
2208 (section_ordering_specified_): New boolean member.
2209 * main.cc(main): Call load_plugins after layout object is defined.
2210 * output.cc (Output_section::add_input_section): Use
2211 function section_ordering_specified to check if section ordering is
2212 needed.
2213 * output.cc (Output_section::add_relaxed_input_section): Use
2214 function section_ordering_specified to check if section ordering is
2215 needed.
2216 (Output_section::update_section_layout): New function.
2217 (Output_section::sort_attached_input_sections): Check if input section
2218 must be reordered.
2219 * output.h (Output_section::update_section_layout): New function.
2220 * plugin.cc (get_section_count): New function.
2221 (get_section_type): New function.
2222 (get_section_name): New function.
2223 (get_section_contents): New function.
2224 (update_section_order): New function.
58797674 2225 (allow_section_ordering): New function.
e9552f7e
ST
2226 (Plugin::load): Add the new interfaces to the transfer vector.
2227 (Plugin_manager::load_plugins): New parameter.
2228 (Plugin_manager::all_symbols_read): New parameter.
2229 (Plugin_manager::claim_file): New parameter. Save the elf object for
2230 unclaimed objects.
2231 (Plugin_manager::get_elf_object): New function.
2232 (Plugin_manager::get_view): Change to directly use the bool to check
2233 if get_view is called from claim_file_hook.
2234 * plugin.h (input_objects): New function
2235 (Plugin__manager::load_plugins): New parameter.
2236 (Plugin_manager::claim_file): New parameter.
2237 (Plugin_manager::get_elf_object): New function.
2238 (Plugin_manager::in_claim_file_handler): New function.
2239 (Plugin_manager::in_claim_file_handler_): New member.
2240 (layout): New function.
2241 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
2242 handler with an extra parameter. Make the elf object before calling
2243 claim_file handler.
2244 * testsuite/plugin_test.c (get_section_count): New function pointer.
2245 (get_section_type): New function pointer.
2246 (get_section_name): New function pointer.
2247 (get_section_contents): New function pointer.
2248 (update_section_order): New function pointer.
2249 (allow_section_ordering): New function pointer.
2250 (onload): Check if the new interfaces exist.
2251
9446efde
ILT
22522011-07-13 Ian Lance Taylor <iant@google.com>
2253
2254 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
2255 relro section.
2256 * x86_64.cc (Target_x86_64::got_section): Likewise.
2257 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
2258 (relro_now_test_SOURCES): New variable.
2259 (relro_now_test_DEPENDENCIES): New variable.
2260 (relro_now_test_LDFLAGS): New variable.
2261 (relro_now_test_LDADD): New variable.
2262 (relro_now_test.so): New target.
2263 * testsuite/Makefile.in: Rebuild.
2264
07aa62f2
ILT
22652011-07-12 Ian Lance Taylor <iant@google.com>
2266
2267 PR gold/12980
2268 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
2269 GLOB_DAT relocation rather than a RELATIVE relocation for a
2270 protected symbol when creating a shared library.
2271 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
2272 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
2273 * testsuite/protected_main_1.cc (main): Test that protected
2274 function has same address.
2275
e2153196
ILT
22762011-07-11 Ian Lance Taylor <iant@google.com>
2277
2278 PR gold/12979
2279 * options.h (class General_options): Add -Bgroup.
2280 * options.cc (General_options::finalize): If -Bgroup is set,
2281 default to --unresolved-symbols=report-all.
2282 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
2283 * target-reloc.h (issue_undefined_symbol_error): Handle
2284 --unresolved-symbols=report-all.
2285
6daf5215
ILT
22862011-07-08 Ian Lance Taylor <iant@google.com>
2287
2288 PR gold/11985
2289 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
2290 if linker script discards key sections.
2291 (Layout::create_dynamic_symtab): Likewise.
2292 (Layout::assign_local_dynsym_offsets): Likewise.
2293 (Layout::sized_create_version_sections): Likewise.
2294 (Layout::create_interp): Likewise.
2295 (Layout::finish_dynamic_section): Likewise.
2296 (Layout::set_dynamic_symbol_size): Likewise.
2297
beabb2c6
ILT
22982011-07-08 Ian Lance Taylor <iant@google.com>
2299
2300 PR gold/12386
2301 * options.h (class General_options): Add --unresolved-symbols.
2302 * target-reloc.h (issue_undefined_symbol_error): Check
2303 --unresolved-symbols. Add comments.
2304
9c16daf1
ILT
23052011-07-08 Ian Lance Taylor <iant@google.com>
2306
2307 * testsuite/odr_violation2.cc (Ordering::operator()): Make
2308 expression more complex.
2309
191f1a2d
ILT
23102011-07-08 Ian Lance Taylor <iant@google.com>
2311
2312 PR gold/11317
2313 * target-reloc.h (issue_undefined_symbol_error): New inline
2314 function, broken out of relocate_section.
2315 (relocate_section): Call issue_undefined_symbol_error.
2316 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
2317 there is no TLS segment if we are about to issue an undefined
2318 symbol error.
2319 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
2320
62855347
ILT
23212011-07-08 Ian Lance Taylor <iant@google.com>
2322
2323 PR gold/12279
2324 * resolve.cc (Symbol_table::should_override): Add fromtype
2325 parameter. Change all callers. Give error when linking together
2326 TLS and non-TLS symbol.
2327 (Symbol_table::should_override_with_special): Add fromtype
2328 parameter. Change all callers.
2329 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
2330 there is no TLS segment if we have reported some errors.
2331 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
2332
67181c72
ILT
23332011-07-08 Ian Lance Taylor <iant@google.com>
2334
2335 PR gold/12372
2336 * target.h (Target::plt_address_for_global): New function.
2337 (Target::plt_address_for_local): New function.
2338 (Target::plt_section_for_global): Remove.
2339 (Target::plt_section_for_local): Remove.
2340 (Target::do_plt_address_for_global): New virtual function.
2341 (Target::do_plt_address_for_local): New virtual function.
2342 (Target::do_plt_section_for_global): Remove.
2343 (Target::do_plt_section_for_local): Remove.
2344 (Target::register_global_plt_entry): Add Symbol_table and Layout
2345 parameters.
2346 * output.cc (Output_data_got::Got_entry::write): Use
2347 plt_address_for_global and plt_address_for_local.
2348 * layout.cc (Layout::add_target_dynamic_tags): Use size and
2349 address of output section.
2350 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
2351 got_irelative_, and irelative_count_ fields. Update
2352 declarations.
2353 (Output_data_plt_i386::has_irelative_section): New function.
2354 (Output_data_plt_i386::entry_count): Add irelative_count_.
2355 (Output_data_plt_i386::set_final_data_size): Likewise.
2356 (class Target_i386): Add got_irelative_ and rel_irelative_
2357 fields. Update declarations.
2358 (Target_i386::Target_i386): Initialize new fields.
2359 (Target_i386::do_plt_address_for_global): New function replacing
2360 do_plt_section_for_global.
2361 (Target_i386::do_plt_address_for_local): New function replacing
2362 do_plt_section_for_local.
2363 (Target_i386::got_section): Create got_irelative_.
2364 (Target_i386::rel_irelative_section): New function.
2365 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
2366 fields. Don't define __rel_iplt_{start,end}.
2367 (Output_data_plt_i386::add_entry): Add symtab and layout
2368 parameters. Change all callers. Use different PLT and GOT for
2369 IFUNC symbols.
2370 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
2371 layout parameters. Change all callers. Use different PLT and
2372 GOT.
2373 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
2374 (Output_data_plt_i386::rel_irelative): New function.
2375 (Output_data_plt_i386::address_for_global): New function.
2376 (Output_data_plt_i386::address_for_local): New function.
2377 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
2378 IRELATIVE GOT when changing IFUNC GOT entries.
2379 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
2380 reloc.
2381 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
2382 if we didn't create an IRELATIVE GOT.
2383 (Target_i386::Relocate::relocate): Use plt_address_for_global and
2384 plt_address_for_local.
2385 (Target_i386::do_dynsym_value): Use plt_address_for_global.
2386 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
2387 got_irelative_, and irelative_count_ fields. Update
2388 declarations.
2389 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
2390 Initialize new fields. Remove symtab parameter. Change all
2391 callers.
2392 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
2393 irelative_count_.
2394 (Output_data_plt_x86_64::has_irelative_section): New function.
2395 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
2396 (class Target_x86_64): Add got_irelative_ and rel_irelative_
2397 fields. Update declarations.
2398 (Target_x86_64::Target_x86_64): Initialize new fields.
2399 (Target_x86_64::do_plt_address_for_global): New function replacing
2400 do_plt_section_for_global.
2401 (Target_x86_64::do_plt_address_for_local): New function replacing
2402 do_plt_section_for_local.
2403 (Target_x86_64::got_section): Create got_irelative_.
2404 (Target_x86_64::rela_irelative_section): New function.
2405 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
2406 all callers. Don't create __rel_iplt_{start,end}.
2407 (Output_data_plt_x86_64::add_entry): Add symtab and layout
2408 parameters. Change all callers. Use different PLT and GOT for
2409 IFUNC symbols.
2410 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
2411 layout parameters. Change all callers. Use different PLT and
2412 GOT.
2413 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
2414 parameters. Change all callers. Use different PLT and GOT for
2415 IFUNC symbols.
2416 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
2417 (Output_data_plt_x86_64::rela_irelative): New function.
2418 (Output_data_plt_x86_64::address_for_global): New function.
2419 (Output_data_plt_x86_64::address_for_local): New function.
2420 (Output_data_plt_x86_64::set_final_data_size): Likewise.
2421 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
2422 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
2423 (Target_x86_64::register_global_plt_entry): Add symtab and layout
2424 parameters.
2425 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
2426 reloc.
2427 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
2428 symbols if we didn't create an IRELATIVE GOT.
2429 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
2430 plt_address_for_local.
2431 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
2432 * testsuite/ifuncvar1.c: New test file.
2433 * testsuite/ifuncvar2.c: New test file.
2434 * testsuite/ifuncvar3.c: New test file.
2435 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
2436 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
2437 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
2438 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
2439 * testsuite/Makefile.in: Rebuild.
2440
33c15b45
CC
24412011-07-07 Cary Coutant <ccoutant@google.com>
2442
2443 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
2444 (two_file_test_1_ndebug.o): Likewise.
2445 (two_file_test_1b_ndebug.o): Likewise.
2446 (two_file_test_2_ndebug.o): Likewise.
2447 (two_file_test_main_ndebug.o): Likewise.
2448 (incremental_test_2): Link with no-debug versions.
2449
f48b5fb7
CC
24502011-07-06 Cary Coutant <ccoutant@google.com>
2451
2452 * gold/incremental.cc
2453 (Output_section_incremental_inputs::write_info_blocks): Check for
2454 hidden and internal symbols.
2455
221597a5
CC
24562011-07-06 Cary Coutant <ccoutant@google.com>
2457
2458 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
2459 Check disposition for startup file.
2460 (Incremental_inputs::report_command_line): Ignore
2461 --incremental-startup-unchanged option.
2462 * options.cc (General_options::parse_incremental_startup_unchanged):
2463 New function.
2464 (General_options::General_options): Initialize new data member.
2465 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
2466 (General_options): Add --incremental-startup-unchanged option.
2467 (General_options::incremental_startup_disposition): New function.
2468 (General_options::incremental_startup_disposition_): New data member.
2469
e24719f6
CC
24702011-07-06 Cary Coutant <ccoutant@google.com>
2471
2472 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
2473 input file index to Script_info ctor.
2474 (Sized_incremental_binary::do_file_has_changed): Find the
2475 command-line argument for files named in scripts.
2476 * incremental.h (Script_info::Script_info): New ctor
2477 with input file index.
2478 (Script_info::input_file_index): New function.
2479 (Script_info::input_file_index_): New data member.
2480 (Incremental_binary::get_library): Add const.
2481 (Incremental_binary::get_script_info): Add const.
2482 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
2483 * testsuite/Makefile.am (incremental_test_5): New test case.
2484 (incremental_test_6): New test case.
2485 * testsuite/Makefile.in: Regenerate.
2486
8f7c81e8
CC
24872011-07-06 Cary Coutant <ccoutant@google.com>
2488
2489 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
2490 debug output when command lines differ.
2491
9fbd3822
CC
24922011-07-06 Cary Coutant <ccoutant@google.com>
2493
2494 * incremental.cc (Incremental_inputs::report_command_line): Ignore
2495 --incremental-patch option.
2496 * layout.cc (Free_list::allocate): Extend allocation beyond original
2497 end if enabled.
2498 (Layout::make_output_section): Mark sections that should get
2499 patch space.
2500 * options.cc (parse_percent): New function.
2501 * options.h (parse_percent): New function.
2502 (DEFINE_percent): New macro.
2503 (General_options): Add --incremental-patch option.
2504 * output.cc (Output_section::Output_section): Initialize new data
2505 members.
2506 (Output_section::add_input_section): Print section name when out
2507 of patch space.
2508 (Output_section::add_output_section_data): Likewise.
2509 (Output_section::set_final_data_size): Add patch space when
2510 doing --incremental-full.
2511 (Output_section::do_reset_address_and_file_offset): Remove patch
2512 space.
2513 (Output_segment::set_section_list_addresses): Print debug output
2514 only if --incremental-update.
2515 * output.h (Output_section::set_is_patch_space_allowed): New function.
2516 (Output_section::is_patch_space_allowed_): New data member.
2517 (Output_section::patch_space_): New data member.
2518 * parameters.cc (Parameters::incremental_full): New function.
2519 * parameters.h (Parameters::incremental_full): New function
2520 * testsuite/Makefile.am (incremental_test_2): Add test for
2521 --incremental-patch option.
2522 * testsuite/Makefile.in: Regenerate.
2523 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
2524 (t18): Remove function body.
2525
f6cccc2c
DK
25262011-07-05 Doug Kwan <dougkwan@google.com>
2527
2528 PR gold/12771
2529 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
2530 Arm_Address type for relocation result.
2531 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
2532 overflow check.
2533 (Arm_relocate_functions::abs32): Use unaligned access.
2534 (Arm_relocate_functions::rel32): Ditto.
2535 (Arm_relocate_functions::prel31): Ditto.
2536 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
2537 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
2538 static data relocations.
2539 * testsuite/Makefile.in: Regnerate.
2540 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
2541
28a13fec
ILT
25422011-07-05 Ian Lance Taylor <iant@google.com>
2543
2544 PR gold/12392
2545 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
2546 symbols if necessary.
2547 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
2548
24d47b34
ILT
25492011-07-05 Ian Lance Taylor <iant@google.com>
2550
2551 PR gold/12952
2552 * resolve.cc (Symbol::override_base_with_special): Simply override
2553 version with special symbol version, ignoring previous version.
2554
41f9cbbe
ILT
25552011-07-05 Ian Lance Taylor <iant@google.com>
2556
2557 * object.cc (Sized_relobj_file::include_section_group): Add
2558 information to comment about signature location.
2559
886288f1
ILT
25602011-07-02 Ian Lance Taylor <iant@google.com>
2561
2562 PR gold/12957
2563 * options.h (class General_options): Add -f and -F.
2564 * options.cc (General_options::finalize): Fatal error if -f/-F
2565 are used without -shared.
2566 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
2567
ae3a6d4f
ILT
25682011-07-02 Ian Lance Taylor <iant@google.com>
2569
2570 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
2571
21131061
ILT
25722011-07-01 Ian Lance Taylor <iant@google.com>
2573
2574 PR gold/12525
2575 PR gold/12952
2576 * resolve.cc (Symbol::override_base_with_special): Don't override
2577 the version if the overriding symbol has a different name.
2578 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
2579 all callers. If we give an error about an undefined version,
2580 define the base version if necessary.
2581 * dynobj.h (class Versions): Update declaration.
2582 * testsuite/weak_alias_test_5.cc: New file.
2583 * testsuite/weak_alias_test.script: New file.
2584 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
2585 and versioned_alias have the right value, and call t2.
2586 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
2587 weak_alias_test_5.so.
2588 (weak_alias_test_LDADD): Likewise.
2589 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
2590 * testsuite/Makefile.in: Rebuild.
2591
611062c0
ILT
25922011-07-01 Ian Lance Taylor <iant@google.com>
2593
2594 PR gold/12525
2595 * options.h (class General_options): Support -z notext.
2596 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
2597 -Wl,-z,notext.
2598 (two_file_shared_nonpic.so): Likewise.
2599 (two_file_shared_mixed.so): Likewise.
2600 (two_file_shared_mixed_1.so): Likewise.
2601 (weak_undef_lib_nonpic.so): Likewise.
2602 (alt/weak_undef_lib_nonpic.so): Likewise.
2603 (tls_test_shared_nonpic.so): Likewise.
2604 * testsuite/Makefile.in: Rebuild.
2605
328c7c2f
ILT
26062011-07-01 Ian Lance Taylor <iant@google.com>
2607
2608 PR gold/12525
2609 * configure.ac: Test whether static linking works, setting
2610 the automake conditional HAVE_STATIC.
2611 * testsuite/Makefile.am: Disable tests using -static if
2612 HAVE_STATIC is not true.
2613 * configure, testsuite/Makefile.in: Rebuild.
2614
02d7cd44
ILT
26152011-07-01 Ian Lance Taylor <iant@google.com>
2616
2617 PR gold/12525
2618 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
2619 Assert if we see DW_EH_PE_indirect.
2620 * target.h (Target::ehframe_datarel_base): New function.
2621 (Target::do_ehframe_datarel_base): New target function.
2622 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
2623 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
2624 function.
2625
07a60597
ILT
26262011-07-01 Ian Lance Taylor <iant@google.com>
2627
2628 PR gold/12571
2629 * options.h (class General_options): Add
2630 --ld-generated-unwind-info.
2631 * ehframe.cc (Fde::write): Add address parameter. Change all
2632 callers. If associated with PLT, fill in address and size.
2633 (Cie::set_output_offset): Only add merge mapping if there is an
2634 object.
2635 (Cie::write): Add address parameter. Change all callers.
2636 (Eh_frame::add_ehframe_for_plt): New function.
2637 * ehframe.h (class Fde): Update declarations. Move shndx_ and
2638 input_offset_ fields into union u_, with new plt field.
2639 (Fde::Fde): Adjust for new union field.
2640 (Fde::Fde) [Output_data version]: New constructor.
2641 (Fde::add_mapping): Only add merge mapping if there is an object.
2642 (class Cie): Update declarations.
2643 (class Eh_frame): Declare add_ehframe_for_plt.
2644 * layout.cc (Layout::layout_eh_frame): Break out code into
2645 make_eh_frame_section, and call it.
2646 (Layout::make_eh_frame_section): New function.
2647 (Layout::add_eh_frame_for_plt): New function.
2648 * layout.h (class Layout): Update declarations.
2649 * merge.cc (Merge_map::add_mapping): Add assertion.
2650 * i386.cc: Include "dwarf.h".
2651 (class Output_data_plt_i386): Make first_plt_entry,
2652 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
2653 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
2654 and plt_eh_frame_fde.
2655 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
2656 boundary. Call add_eh_frame_for_plt if appropriate.
2657 * x86_64.cc: Include "dwarf.h".
2658 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
2659 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
2660 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
2661 and plt_eh_frame_fde.
2662 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
2663 appropriate.
2664
14788a3f
ILT
26652011-06-29 Ian Lance Taylor <iant@google.com>
2666
2667 PR gold/12629
2668 * object.cc (Sized_relobj_file::layout_section): Change shdr
2669 parameter to be const.
2670 (Sized_relobj_file::layout_eh_frame_section): New function, broken
2671 out of do_layout.
2672 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
2673 appropriate. Call layout_eh_frame_section.
2674 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
2675 sections.
2676 * object.h (class Sized_relobj_file): Update declarations.
2677
6c21fce1
ILT
26782011-06-29 Ian Lance Taylor <iant@google.com>
2679
37e41b03 2680 PR gold/12652
6c21fce1
ILT
2681 * script.cc (Token::integer_value): Accept trailing M/m/K/k
2682 modifier.
2683 (Lex::gather_token): Accept trailing M/m/K/k for integers.
2684
4d5e4e62
ILT
26852011-06-29 Ian Lance Taylor <iant@google.com>
2686
2687 PR gold/12675
2688 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
2689 SHT_X86_64_UNWIND.
2690 * layout.cc (Layout::layout_eh_frame): Likewise.
2691
886f533a
ILT
26922011-06-29 Ian Lance Taylor <iant@google.com>
2693
2694 PR gold/12695
2695 * layout.cc (Layout::symtab_section_shndx): New function.
2696 * layout.h (class Layout): Declare symtab_section_shndx.
2697 * output.cc (Output_section::write_header): Call it.
2698
f3ae1b28
ILT
26992011-06-29 Ian Lance Taylor <iant@google.com>
2700
2701 PR gold/12818
2702 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
2703 symbols which are not used in a relocation.
2704
aecf301f
ILT
27052011-06-28 Ian Lance Taylor <iant@google.com>
2706
2707 PR gold/12898
2708 * layout.cc (Layout::segment_precedes): Don't crash if a linker
2709 script create indistinguishable segments.
2710 (Layout::set_segment_offsets): Use stable_sort when sorting
2711 segments. Pass this to Compare_segments constructor.
2712 * layout.h (class Layout): Make segment_precedes non-static.
2713 (class Compare_segments): Change from struct to class. Add
2714 layout_ field. Add constructor.
2715 * script-sections.cc
2716 (Script_sections::attach_sections_using_phdrs_clause): Rename
2717 local orphan to is_orphan. Don't report failure to put empty
2718 section in segment. On attachment failure, report name of
2719 section, and attach to first PT_LOAD segment.
2720
03ef7571
ILT
27212011-06-28 Ian Lance Taylor <iant@google.com>
2722
2723 PR gold/12934
2724 * target-select.cc (Target_selector::Target_selector): Add
2725 emulation parameter. Change all callers.
2726 (select_target_by_bfd_name): Rename from select_target_by_name.
2727 Change all callers.
2728 (select_target_by_emulation): New function.
2729 (supported_emulation_names): New function.
2730 * target-select.h (class Target_selector): Add emulation_ field.
2731 Update declarations.
2732 (Target_selector::recognize_by_bfd_name): Rename from
2733 recognize_by_name. Change all callers.
2734 (Target_selector::supported_bfd_names): Rename from
2735 supported_names. Change all callers.
2736 (Target_selector::recognize_by_emulation): New function.
2737 (Target_selector::supported_emulations): New function.
2738 (Target_selector::emulation): New function.
2739 (Target_selector::do_recognize_by_bfd_name): Rename from
2740 do_recognize_by_name. Change all callers.
2741 (Target_selector::do_supported_bfd_names): Rename from
2742 do_supported_names. Change all callers.
2743 (Target_selector::do_recognize_by_emulation): New function.
2744 (Target_selector::do_supported_emulations): New function.
2745 (select_target_by_bfd_name): Change name in declaration.
2746 (select_target_by_emulation): Declare.
2747 (supported_emulation_names): Declare.
2748 * parameters.cc (parameters_force_valid_target): Try to find
2749 target based on emulation from -m option.
2750 * options.h (class General_options): Change doc string for -m.
2751 * options.cc (help): Print emulations.
2752 (General_options::parse_V): Likewise.
2753 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
2754 Add emulation parameter. Change all callers.
2755
200b2bb9
ILT
27562011-06-28 Ian Lance Taylor <iant@google.com>
2757
2758 * target.h (class Target): Add osabi_ field.
2759 (Target::osabi): New function.
2760 (Target::set_osabi): New function.
2761 (Target::Target): Initialize osabi_.
2762 (Target::do_adjust_elf_header): Make pure virtual.
2763 (Sized_target::do_adjust_elf_header): Declare.
2764 * target.cc (Sized_target::do_adjust_elf_header): New function.
2765 (class Sized_target): Instantiate all versions.
2766 * freebsd.h (class Target_freebsd): Remove.
2767 (Target_selector_freebsd::do_recognize): Call set_osabi on
2768 Target.
2769 (Target_selector_freebsd::do_recognize_by_name): Likewise.
2770 (Target_selector_freebsd::set_osabi): Remove.
2771 * i386.cc (class Target_i386): Inherit from Sized_target rather
2772 than Target_freebsd.
2773 * x86_64.cc (class Target_x86_64): Likewise.
2774
b3ce541e
ILT
27752011-06-28 Ian Lance Taylor <iant@google.com>
2776
2777 * target.h (Target::can_check_for_function_pointers): Rewrite.
2778 Make non-virtual.
2779 (Target::can_icf_inline_merge_sections): Likewise.
2780 (Target::section_may_have_icf_unsafe_poineters): Likewise.
2781 (Target::Target_info): Add can_icf_inline_merge_sections field.
2782 (Target::do_can_check_for_function_pointers): New virtual
2783 function.
2784 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
2785 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
2786 from can_check_for_function_pointers, move in file.
2787 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
2788 section_may_have_icf_unsafe_poineters, move in file.
2789 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
2790 * i386.cc (Target_i386::do_can_check_for_function_pointers):
2791 Rename from can_check_for_function_pointers, move in file.
2792 (Target_i386::can_icf_inline_merge_sections): Remove.
2793 (Target_i386::i386_info): Initialize
2794 can_icf_inline_merge_sections.
2795 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
2796 Initialize can_icf_inline_merge_sections.
2797 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
2798 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
2799 Rename from can_check_for_function_pointers, move in file.
2800 (Target_x86_64::can_icf_inline_merge_sections): Remove.
2801 (Target_x86_64::x86_64_info): Initialize
2802 can_icf_inline_merge_sections.
2803 * testsuite/testfile.cc (Target_test::test_target_info):
2804 Likewise.
2805 * icf.cc (get_section_contents): Correct formatting.
2806
6d1c4efb
ILT
28072011-06-27 Ian Lance Taylor <iant@google.com>
2808
2809 * symtab.cc (Symbol::versioned_name): New function.
2810 (Symbol_table::add_to_final_symtab): Use versioned_name when
2811 appropriate.
2812 (Symbol_table::sized_write_symbol): Likewise.
2813 * symtab.h (class Symbol): Declare versioned_name.
2814 * stringpool.h (class Stringpool_template): Add variant of add
2815 which takes a std::basic_string.
2816 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
2817 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
2818 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
2819 (ver_test_12.o): New target.
2820 * testsuite/Makefile.in: Rebuild.
2821
57eb9b50
DK
28222011-06-27 Doug Kwan <dougkwan@google.com>
2823
2824 * arm.cc (Arm_relocate_functions::thm_jump8,
2825 Arm_relocate_functions::thm_jump11): Use a wider signed
2826 type to compute offset.
2827 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
2828 arm_thm_jump8.
2829 * testsuite/Makefile.in: Regenerate.
2830 * testsuite/arm_branch_in_range.sh: Check test results of
2831 arm_thm_jump11 and arm_thm_jump8.
2832 * testsuite/arm_thm_jump11.s: New test source file.
2833 * testsuite/arm_thm_jump11.t: New linker script.
2834 * testsuite/arm_thm_jump8.s: New test source file.
2835 * testsuite/arm_thm_jump8.t: New linker script.
2836
487b39df
ILT
28372011-06-24 Ian Lance Taylor <iant@google.com>
2838
2839 * layout.cc: Include "object.h".
2840 (ctors_sections_in_init_array): New static variable.
2841 (Layout::is_ctors_in_init_array): New function.
2842 (Layout::layout): Add entry to ctors_sections_in_init_array if
2843 appropriate.
2844 * layout.h (class Layout): Declare is_ctors_in_init_array.
2845 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
2846 is_ctors_reverse_view is set.
2847 (Sized_relobj_file::write_sections): Add layout parameter. Change
2848 all callers. Set is_ctors_reverse_view field of View_size.
2849 (Sized_relobj_file::reverse_words): New function.
2850 * object.h (Sized_relobj_file::View_size): Add
2851 is_ctors_reverse_view field.
2852 (class Sized_relobj_file): Update declarations.
2853 * testsuite/initpri3.c: New test.
2854 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
2855 initpri3b.
2856 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
2857 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
2858 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
2859 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
2860 * testsuite/Makefile.in: Rebuild.
2861
472076e4
CC
28622011-06-24 Cary Coutant <ccoutant@google.com>
2863
2864 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
2865 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
2866 (debug_msg_cdebug.err): New targets.
2867 * testsuite/Makefile.in: Regenerate.
2868 * testsuite/debug_msg.sh: Check output of link with compressed debug.
2869 Fix checks for link with shared library.
2870
a60af0db
DK
28712011-06-24 Doug Kwan <dougkwan@google.com>
2872
2873 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
2874 skip empty text sections.
2875 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
2876
5393d741
ILT
28772011-06-22 Ian Lance Taylor <iant@google.com>
2878
2879 PR gold/12910
2880 * options.h (class General_options): Add --ctors-in-init-array.
2881 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
2882 friends as SHT_PROGBITS for merging sections.
2883 (Layout::layout): Remove special handling of .init_array and
2884 friends. Don't sort if doing relocatable link. Sort for .ctors
2885 and .dtors if ctors_in_init_array.
2886 (Layout::make_output_section): Force correct section types for
2887 .init_array and friends. Don't sort if doing relocatable link,
2888 Don't sort .ctors and .dtors if ctors_in_init_array.
2889 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
2890 (Layout::output_section_name): Add relobj parameter. Change all
2891 callers. Handle .ctors. and .dtors. in code rather than table.
2892 Handle .ctors and .dtors if ctors_in_init_array.
2893 (Layout::match_file_name): New function, moved from output.cc.
2894 * layout.h (class Layout): Update declarations.
2895 * output.cc: Include "layout.h".
2896 (Input_section_sort_entry::get_priority): New function.
2897 (Input_section_sort_entry::match_file_name): Just call
2898 Layout::match_file_name.
2899 (Output_section::Input_section_sort_init_fini_compare::operator()):
2900 Handle .ctors and .dtors. Sort by explicit priority rather than
2901 by name.
2902 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
2903 * testsuite/initpri2.c: New test.
2904 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
2905 (check_PROGRAMS): Add initpri2.
2906 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
2907 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
2908 * configure, testsuite/Makefile.in: Rebuild.
2909
e1f74f98
ILT
29102011-06-19 Ian Lance Taylor <iant@google.com>
2911
2912 PR gold/12880
2913 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
2914 .interp section to a PT_INTERP segment even if we have seen a
2915 --dynamic-linker option. Don't do it if we have seen a PHDRS
2916 clause in a linker script.
2917 (Layout::finalize): Don't create a .interp section if we've
2918 already create a PT_INTERP segment.
2919 (Layout::create_interp): Always call choose_output_section (revert
2920 patch of 2011-06-17). Don't create PT_INTERP segment.
2921 * script-sections.cc
2922 (Script_sections::create_note_and_tls_segments): Add a .interp
2923 section to a PT_INTERP segment even if we have seen a
2924 --dynamic-linker option.
2925
766f91bb
ILT
29262011-06-18 Ian Lance Taylor <iant@google.com>
2927
2928 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
2929 merely because a non-PT_LOAD segment has a dynamic reloc.
2930
0d212c3a
ILT
29312011-06-18 Ian Lance Taylor <iant@google.com>
2932
2933 * layout.cc (Layout::finish_dynamic_section): Don't create
2934 DT_FLAGS entry if not needed.
2935
911a5072
ILT
29362011-06-18 Ian Lance Taylor <iant@google.com>
2937
2938 PR gold/12745
2939 * layout.cc (Layout::layout_eh_frame): Correct handling of
2940 writable .eh_frame section.
2941
534b4e5f
ILT
29422011-06-17 Ian Lance Taylor <iant@google.com>
2943
2944 PR gold/12893
2945 * resolve.cc (Symbol_table::resolve): Don't give an error if a
2946 symbol is redefined with the exact same object and value.
2947
10b4f102
ILT
29482011-06-17 Ian Lance Taylor <iant@google.com>
2949
2950 PR gold/12880
2951 * layout.h (class Layout): Add interp_segment_ field.
2952 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
2953 (Layout::attach_allocated_section_to_segment): If making shared
2954 library, put .interp section in PT_INTERP segment.
2955 (Layout::finalize): Also call create_interp if -dynamic-linker
2956 option was used.
2957 (Layout::create_interp): Assert that there is no PT_INTERP
2958 segment. If not using a SECTIONS clause, use make_output_section.
2959 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
2960 * script-sections.cc
2961 (Script_sections::create_note_and_tls_segments): If making shared
2962 library, put .interp section in PT_INTERP segment.
2963
a29b0dad
ILT
29642011-06-17 Ian Lance Taylor <iant@google.com>
2965
e588ea8d
ILT
2966 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
2967 when making a shared library.
2968
29692011-06-17 Ian Lance Taylor <iant@google.com>
2970
2971 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
2972 parameter. Change all callers. Don't issue warning about PC32
2973 against locally defined symbol.
a29b0dad 2974
9d3b0698
ILT
29752011-06-16 Ian Lance Taylor <iant@google.com>
2976
2977 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
2978 occurs in same object.
2979
85b0f90c
AM
29802011-06-14 Alan Modra <amodra@gmail.com>
2981
2982 * po/POTFILES.in: Regenerate.
2983
a94907d9
ILT
29842011-06-09 Ian Lance Taylor <iant@google.com>
2985
2986 * script-sections.cc
2987 (Orphan_output_section::set_section_addresses): For a relocatable
2988 link set address to 0.
2989
4fb3a1c3
CC
29902011-06-09 Cary Coutant <ccoutant@google.com>
2991
2992 PR gold/12804
2993 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
2994 used with --compress-debug-sections.
2995 * gold/object.cc (Sized_relobj_file::do_layout): Report
2996 uncompressed size of compressed input sections.
2997
61220854
CC
29982011-06-08 Cary Coutant <ccoutant@google.com>
2999
3000 PR gold/12804
3001 * testsuite/two_file_test_2_v1.cc: Change initialization of
3002 v2 to keep it in .data.
3003
e6455dfb
CC
30042011-06-07 Cary Coutant <ccoutant@google.com>
3005
3006 * common.cc (Symbol_table::do_allocate_commons_list): Call
3007 gold_fallback.
3008 * errors.cc (Errors::fatal): Adjust call to gold_exit.
3009 (Errors::fallback): New function.
3010 (gold_fallback): New function.
3011 * errors.h (Errors::fallback): New function.
3012 * gold.cc (gold_exit): Change status parameter to enum; adjust
3013 all callers.
3014 (queue_initial_tasks): Call gold_fallback.
3015 * gold.h: Include cstdlib.
3016 (Exit_status): New enum type.
3017 (gold_exit): Change status parameter to enum.
3018 (gold_fallback): New function.
3019 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
3020 (Layout::create_symtab_sections): Likewise.
3021 (Layout::create_shdrs): Likewise.
3022 * main.cc (main): Adjust call to gold_exit.
3023 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
3024 (Output_data_got::add_got_entry_pair): Likewise.
3025 (Output_section::add_input_section): Likewise.
3026 (Output_section::add_output_section_data): Likewise.
3027 (Output_segment::set_section_list_addresses): Likewise.
3028 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
3029
fb0e076f
CC
30302011-06-07 Cary Coutant <ccoutant@google.com>
3031
3032 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
3033 for incremental links.
3034 * output.cc (Output_segment::set_section_list_addresses): Remove
3035 FIXME and test for TLS or BSS.
3036
a5ee4d5d
CC
30372011-06-07 Cary Coutant <ccoutant@google.com>
3038
3039 * testsuite/Makefile.am: Add incremental_copy_test,
3040 incremental_common_test_1.
3041 * testsuite/Makefile.in: Regenerate.
3042 * testsuite/common_test_1_v1.c: New source file.
3043 * testsuite/common_test_1_v2.c: New source file.
3044 * testsuite/copy_test_v1.cc: New source file.
3045
5146f448
CC
30462011-06-07 Cary Coutant <ccoutant@google.com>
3047
3048 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
3049 update, allocate common from bss section's free list.
3050 * incremental-dump.cc (dump_incremental_inputs): Print flag for
3051 linker-defined symbols.
3052 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
3053 Skip GOT and PLT entries that are no longer referenced.
3054 (Output_section_incremental_inputs::write_info_blocks): Mark
3055 linker-defined symbols.
3056 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
3057 * output.cc (Output_section::allocate): New function.
3058 * output.h (Output_section::allocate): New function.
3059 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
3060 linker-defined symbols.
3061 (Symbol::override_base_with_special): Copy is_predefined_ flag.
3062 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
3063 (Symbol::init_base_output_data): Likewise.
3064 (Symbol::init_base_output_segment): Likewise.
3065 (Symbol::init_base_constant): Likewise.
3066 (Sized_symbol::init_output_data): Likewise.
3067 (Sized_symbol::init_output_segment): Likewise.
3068 (Sized_symbol::init_constant): Likewise.
3069 (Symbol_table::do_define_in_output_data): Likewise.
3070 (Symbol_table::do_define_in_output_segment): Likewise.
3071 (Symbol_table::do_define_as_constant): Likewise.
3072 * symtab.h (Symbol::is_predefined): New function.
3073 (Symbol::init_base_output_data): Add is_predefined parameter.
3074 (Symbol::init_base_output_segment): Likewise.
3075 (Symbol::init_base_constant): Likewise.
3076 (Symbol::is_predefined_): New data member.
3077 (Sized_symbol::init_output_data): Add is_predefined parameter.
3078 (Sized_symbol::init_output_segment): Likewise.
3079 (Sized_symbol::init_constant): Likewise.
3080 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
3081
26d3c67d
CC
30822011-06-07 Cary Coutant <ccoutant@google.com>
3083
3084 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
3085 instead of emit_copy_reloc.
3086 (Copy_relocs::emit_copy_reloc): Refactor.
3087 (Copy_relocs::make_copy_reloc): New function.
3088 (Copy_relocs::add_copy_reloc): Remove.
3089 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
3090 section.
3091 (Copy_relocs::make_copy_reloc): New function.
3092 (Copy_relocs::add_copy_reloc): Remove.
3093 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
3094 unchanged input files.
3095 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
3096 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
3097 Reserve BSS space for COPY relocations.
3098 (Sized_incremental_binary::do_emit_copy_relocs): New function.
3099 (Output_section_incremental_inputs::write_info_blocks): Record
3100 whether a symbol is copied from a shared object.
3101 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
3102 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
3103 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
3104 (Incremental_input_entry_reader::get_output_symbol_index): Add
3105 is_copy parameter.
3106 (Incremental_binary::emit_copy_relocs): New function.
3107 (Incremental_binary::do_emit_copy_relocs): New function.
3108 (Sized_incremental_binary::Sized_incremental_binary): Initialize
3109 new data member.
3110 (Sized_incremental_binary::add_copy_reloc): New function.
3111 (Sized_incremental_binary::do_emit_copy_relocs): New function.
3112 (Sized_incremental_binary::Copy_reloc): New struct.
3113 (Sized_incremental_binary::Copy_relocs): New typedef.
3114 (Sized_incremental_binary::copy_relocs_): New data member.
3115 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
3116 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
3117 * target.h (Sized_target::emit_copy_reloc): New function.
3118 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
3119
7cdb37d9
CC
31202011-06-02 Cary Coutant <ccoutant@google.com>
3121
3122 PR gold/12163
3123 * gold/archive.cc (Archive::Archive): Initialize new data member.
3124 (Archive::include_all_members): Return if archive has already been
3125 included.
3126 * gold/archive.h (Archive::include_all_members_): New data member.
3127
cc643b88
NC
31282011-06-02 Nick Clifton <nickc@redhat.com>
3129
3130 * dynobj.h: Fix spelling mistake in comment.
3131 * output.cc: Likewise.
3132
f62a3ca7 31332011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 3134 Asier Llano
f62a3ca7
DK
3135
3136 PR gold/12826
cc643b88 3137 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
3138 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
3139 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
3140 redundant arm_exidx_test.so.
3141 * testsuite/Makefile.in: Regenerate.
3142 (check_SCRIPTS): Add pr12826.sh
3143 (check_DATA): Add pr12826.stdout
3144 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
3145 * testsuite/pr12826.sh: New file.
3146 * testsuite/pr12826_1.s: Ditto.
3147 * testsuite/pr12826_1.s: Ditto.
3148
8dbe1edc
ILT
31492011-05-30 Ian Lance Taylor <iant@google.com>
3150
3151 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
3152 sections.
3153
c49875be
ILT
31542011-05-29 Ian Lance Taylor <iant@google.com>
3155
3156 PR gold/12804
3157 * testsuite/Makefile.am: Use different file name for two_file_test
3158 temporary file for each incremental test.
3159 * testsuite/Makefile.in: Rebuild.
3160
69d53f7a
ILT
31612011-05-29 Ian Lance Taylor <iant@google.com>
3162
3163 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
3164 binary input file is empty.
3165
41d0ab5f
ILT
31662011-05-27 Ian Lance Taylor <iant@google.com>
3167
3168 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
3169 (ver_test_9.so): Likewise.
3170 * testsuite/Makefile.in: Rebuild.
3171
89d8a36b
CC
31722011-05-26 Cary Coutant <ccoutant@google.com>
3173
3174 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
3175 * incremental.cc (Incremental_inputs::report_input_section): Fix
3176 comment, indentation.
3177 (Incremental_inputs::report_comdat_group): New function.
3178 (Output_section_incremental_inputs::set_final_data_size): Adjust size
3179 of data for incremental input file entry.
3180 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
3181 group count, COMDAT group signatures.
3182 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
3183 an unchanged input file.
3184 * incremental.h (Incremental_object_entry::Incremental_object_entry):
3185 Initialize new data member.
3186 (Incremental_object_entry::add_comdat_group): New function.
3187 (Incremental_object_entry::get_comdat_group_count): New function.
3188 (Incremental_object_entry::get_comdat_signature_key): New function.
3189 (Incremental_object_entry::groups_): New data member.
3190 (Incremental_inputs::report_comdat_group): New function.
3191 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
3192 data for incremental input file entry.
3193 (Incremental_input_entry_reader::get_comdat_group_count): New function.
3194 (Incremental_input_entry_reader::get_input_section): Adjust size of
3195 data for incremental input file entry.
3196 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
3197 (Incremental_input_entry_reader::get_comdat_group_signature): New
3198 function.
3199 * object.cc (Sized_relobj::include_section_group): Report kept
3200 COMDAT groups for incremental links.
3201
1706a06f
ILT
32022011-05-24 David Meyer <pdox@google.com>
3203
3204 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
3205 with name parameter. Add found_name parameter.
3206 * fileread.cc (Input_file::find_file): Adjust code accordingly.
3207 * dirsearch.h (class Dirsearch): Update declaration.
3208
a10ae760
ILT
32092011-05-24 Ian Lance Taylor <iant@google.com>
3210
3211 * archive.cc (Library_base::should_include_member): Pull in object
3212 from archive if it defines the entry symbol.
3213 * parameters.cc (Parameters::entry): New function.
3214 * parameters.h (class Parameters): Declare entry.
3215 * output.h (class Output_file_header): Remove entry_ field.
3216 * output.cc (Output_file_header::Output_file_header): Remove entry
3217 parameter. Change all callers.
3218 (Output_file_header::entry): Use parameters->entry.
3219 * gold.cc (queue_middle_tasks): Likewise.
3220 * plugin.cc (Plugin_hook::run): Likewise.
3221
aa92d6ed
CC
32222011-05-24 Cary Coutant <ccoutant@google.com>
3223
3224 * gold.cc (queue_initial_tasks): Pass incremental base filename
3225 to Output_file::open_base_file; don't print error message.
3226 * incremental-dump.cc (main): Adjust call to
3227 Output_file::open_for_modification.
3228 * incremental-dump.cc (main): Likewise.
3229 * incremental.cc (Incremental_inputs::report_command_line):
3230 Ignore --incremental-base option when comparing command lines.
3231 Ignore parameter when given as separate argument.
3232 * options.h (class General_options): Add --incremental-base.
3233 * output.cc (Output_file::Output_file):
3234 (Output_file::open_base_file): Add base_name and writable parameters;
3235 read base file into new file; print error message here.
3236 (Output_file::map_no_anonymous): Add writable parameter; adjust all
3237 callers.
3238 * output.h (Output_file::open_for_modification): Rename to...
3239 (Output_file::open_base_file): ...this; add base_name and
3240 writable parameters; adjust all callers.
3241 (Output_file::map_no_anonymous): Add writable parameter; adjust all
3242 callers.
3243 * testsuite/Makefile.am (incremental_test_4): Test
3244 --incremental-base.
3245 * testsuite/Makefile.in: Regenerate.
3246
2eedd706
CC
32472011-05-24 Cary Coutant <ccoutant@google.com>
3248
3249 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
3250 incremental_test_4.
3251 * testsuite/Makefile.in: Regenerate.
3252 * testsuite/two_file_test_1_v1.cc: New test source file.
3253 * testsuite/two_file_test_1b_v1.cc: New test source file.
3254 * testsuite/two_file_test_2_v1.cc: New test source file.
3255
0f1c85a6
CC
32562011-05-24 Cary Coutant <ccoutant@google.com>
3257
3258 * dynobj.h (Dynobj::do_dynobj): New function.
3259 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
3260 flag and soname for shared objects.
3261 * incremental.cc (Incremental_inputs::report_object): Make
3262 either Incremental_object_entry or Incremental_dynobj_entry; add
3263 soname to string table.
3264 (Incremental_inputs::report_input_section): Add assertion.
3265 (Output_section_incremental_inputs::set_final_data_size): Adjust
3266 type of input file entry for shared libraries; adjust size of
3267 shared library info entry.
3268 (Output_section_incremental_inputs::write_input_files): Write
3269 as_needed flag for shared libraries.
3270 (Output_section_incremental_inputs::write_info_blocks): Adjust type
3271 of input file entry for shared libraries; write soname.
3272 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
3273 soname from incremental info.
3274 * incremental.h (enum Incremental_input_flags): Add
3275 INCREMENTAL_INPUT_AS_NEEDED.
3276 (Incremental_input_entry::Incremental_input_entry): Initialize new
3277 data member.
3278 (Incremental_input_entry::set_as_needed): New function.
3279 (Incremental_input_entry::as_needed): New function.
3280 (Incremental_input_entry::do_dynobj_entry): New function.
3281 (Incremental_input_entry::as_needed_): New data member.
3282 (Incremental_object_entry::Incremental_object_entry): Don't check
3283 for shared library.
3284 (Incremental_object_entry::do_type): Likewise.
3285 (class Incremental_dynobj_entry): New class.
3286 (Incremental_input_entry_reader::as_needed): New function.
3287 (Incremental_input_entry_reader::get_soname): New function.
3288 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
3289 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
3290 size of shared library info entry.
58797674 3291 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
3292 incremental link when adding DT_NEEDED entries.
3293 * object.h (Object::Object): Initialize new data member.
3294 (Object::dynobj): New function.
3295 (Object::set_as_needed): New function.
3296 (Object::as_needed): New function.
3297 (Object::do_dynobj): New function.
3298 (Object::as_needed_): New data member.
3299
6fa2a40b
CC
33002011-05-24 Cary Coutant <ccoutant@google.com>
3301
3302 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
3303 info; adjust display of GOT entries.
3304 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
3305 vector of input objects; remove file_status_.
3306 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
3307 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
3308 got_plt reader; call target hooks to reserve GOT entries.
3309 (Output_section_incremental_inputs::set_final_data_size): Adjust size
3310 of input file info header and GOT info entry.
3311 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
3312 relocation info.
3313 (Got_plt_view_info::got_descriptor): Remove.
3314 (Got_plt_view_info::sym_index): New data member.
3315 (Got_plt_view_info::input_index): New data member.
3316 (Local_got_offset_visitor::visit): Write input file index.
3317 (Global_got_offset_visitor::visit): Write 0 for input file index.
3318 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
3319 with sym_index and input_index.
3320 (Output_section_incremental_inputs::write_got_plt): Adjust size of
3321 incremental info GOT entry; replace got_descriptor with input_index.
3322 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
3323 map from input file index to object.
3324 (Sized_relobj_incr::do_layout): Replace direct data member reference
3325 with accessor function.
3326 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
3327 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
3328 Adjust size of input file info header.
3329 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
3330 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
3331 (Incremental_input_entry_reader::get_input_section): Adjust size of
3332 input file info header.
3333 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
3334 of incremental info GOT entry.
3335 (Incremental_got_plt_reader::get_got_desc): Remove.
3336 (Incremental_got_plt_reader::get_got_symndx): New function.
3337 (Incremental_got_plt_reader::get_got_input_index): New function.
3338 (Sized_incremental_binary::Sized_incremental_binary): Remove
3339 file_status_; add input_objects_.
3340 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
3341 (Sized_incremental_binary::set_file_is_unchanged): Remove.
3342 (Sized_incremental_binary::file_is_unchanged): Remove.
3343 (Sized_incremental_binary::set_input_object): New function.
3344 (Sized_incremental_binary::input_object): New function.
3345 (Sized_incremental_binary::file_status_): Remove.
3346 (Sized_incremental_binary::input_objects_): New data member.
3347 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
3348 references.
3349 (Sized_relobj_incr::invalid_address): Move to base class.
3350 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
3351 class.
3352 (Sized_relobj_incr::do_output_section_offset): Likewise.
3353 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
3354 (Sized_relobj_incr::section_offsets_): Likewise.
3355 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
3356 function.
3357 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
3358 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
3359 with accessor function.
3360 (Sized_relobj_file::do_layout): Likewise.
3361 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
3362 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
3363 (Sized_relobj_file::compute_final_local_value): Replace refs to
3364 section_offsets_ with accessor function.
3365 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
3366 * object.h (Relobj::Relobj): Initialize new data members.
3367 (Relobj::add_dyn_reloc): New function.
3368 (Relobj::first_dyn_reloc): New function.
3369 (Relobj::dyn_reloc_count): New function.
3370 (Relobj::first_dyn_reloc_): New data member.
3371 (Relobj::dyn_reloc_count_): New data member.
3372 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
3373 references.
3374 (Sized_relobj::Address): New typedef.
3375 (Sized_relobj::invalid_address): Move here from child class.
3376 (Sized_relobj::Sized_relobj): Initialize new data members.
3377 (Sized_relobj::sized_relobj): New function.
3378 (Sized_relobj::is_output_section_offset_invalid): Move here from
3379 child class.
3380 (Sized_relobj::get_output_section_offset): Likewise.
3381 (Sized_relobj::local_has_got_offset): Likewise.
3382 (Sized_relobj::local_got_offset): Likewise.
3383 (Sized_relobj::set_local_got_offset): Likewise.
3384 (Sized_relobj::do_for_all_local_got_entries): Likewise.
3385 (Sized_relobj::clear_got_offsets): New function.
3386 (Sized_relobj::section_offsets): Move here from child class.
3387 (Sized_relobj::do_output_section_offset): Likewise.
3388 (Sized_relobj::do_set_section_offset): Likewise.
3389 (Sized_relobj::Local_got_offsets): Likewise.
3390 (Sized_relobj::local_got_offsets_): Likewise.
3391 (Sized_relobj::section_offsets_): Likewise.
3392 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
3393 references.
3394 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
3395 class.
3396 (Sized_relobj_file::sized_relobj): New function
3397 (Sized_relobj_file::local_has_got_offset): Move to base class.
3398 (Sized_relobj_file::local_got_offset): Likewise.
3399 (Sized_relobj_file::set_local_got_offset): Likewise.
3400 (Sized_relobj_file::get_output_section_offset): Likewise.
3401 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
3402 (Sized_relobj_file::do_output_section_offset): Likewise.
3403 (Sized_relobj_file::do_set_section_offset): Likewise.
3404 (Sized_relobj_file::Local_got_offsets): Likewise.
3405 (Sized_relobj_file::local_got_offsets_): Likewise.
3406 (Sized_relobj_file::section_offsets_): Likewise.
3407 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
3408 (all constructors).
3409 (set_needs_dynsym_index): Convert relobj to derived class pointer.
3410 (Output_reloc::get_symbol_index): Likewise.
3411 (Output_reloc::local_section_offset): Likewise.
3412 (Output_reloc::get_address): Likewise.
3413 (Output_reloc::symbol_value): Likewise.
3414 (Output_data_got::reserve_slot): Move to class definition.
3415 (Output_data_got::reserve_local): New function.
3416 (Output_data_got::reserve_slot_for_global): Remove.
3417 (Output_data_got::reserve_global): New function.
3418 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
3419 (all constructors, two instantiations).
3420 (Output_reloc::get_relobj): New function (two instantiations).
3421 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
3422 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
3423 (Output_data_reloc::add_global): Adjust type of relobj.
3424 (Output_data_reloc::add_global_relative): Likewise.
3425 (Output_data_reloc::add_symbolless_global_addend): Likewise.
3426 (Output_data_reloc::add_local): Likewise.
3427 (Output_data_reloc::add_local_relative): Likewise.
3428 (Output_data_reloc::add_symbolless_local_addend): Likewise.
3429 (Output_data_reloc::add_local_section): Likewise.
3430 (Output_data_reloc::add_output_section): Likewise.
3431 (Output_data_reloc::add_absolute): Likewise.
3432 (Output_data_reloc::add_target_specific): Likewise.
3433 (Output_data_got::reserve_slot): Move definition here.
3434 (Output_data_got::reserve_local): New function.
3435 (Output_data_got::reserve_global): New function.
3436 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
3437 section_offsets_ with accessor function.
3438 (Sized_relobj_file::write_sections): Likewise.
3439 (Sized_relobj_file::do_relocate_sections): Likewise.
3440 * target.h (Sized_target::reserve_local_got_entry): New function.
3441 (Sized_target::reserve_global_got_entry): New function.
3442 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
3443 (Target_x86_64::reserve_global_got_entry): New function.
3444 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
3445
4829d394
CC
34462011-05-23 Cary Coutant <ccoutant@google.com>
3447
3448 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
3449 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
3450 bit when checking got_type.
3451 * incremental.cc (Sized_incremental_binary::setup_readers):
3452 Store symbol table and string table locations; initialize bit vector
3453 of file status flags.
3454 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
3455 unchanged files.
3456 (Sized_incremental_binary::do_process_got_plt): New function.
3457 (Sized_incremental_binary::get_symtab_view): Use stored locations.
3458 (Output_section_incremental_inputs::set_final_data_size): Record
3459 file index for each input file.
3460 (Output_section_incremental_inputs::write_got_plt): Store file index
3461 instead of input entry offset for each GOT entry.
3462 * incremental.h
3463 (Incremental_input_entry::Incremental_input_entry): Initialize new
3464 data member.
3465 (Incremental_input_entry::set_offset): Store file index.
3466 (Incremental_input_entry::get_file_index): New function.
3467 (Incremental_input_entry::file_index_): New data member.
3468 (Incremental_binary::process_got_plt): New function.
3469 (Incremental_binary::do_process_got_plt): New function.
3470 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
3471 data members.
3472 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
3473 (Sized_incremental_binary::set_file_is_unchanged): New function.
3474 (Sized_incremental_binary::file_is_unchanged): New function.
3475 (Sized_incremental_binary::do_process_got_plt): New function.
3476 (Sized_incremental_binary::file_status_): New data member.
3477 (Sized_incremental_binary::main_symtab_loc_): New data member.
3478 (Sized_incremental_binary::main_strtab_loc_): New data member.
3479 * output.cc (Output_data_got::Got_entry::write): Add case
3480 RESERVED_CODE.
3481 (Output_data_got::add_global): Call add_got_entry.
3482 (Output_data_got::add_global_plt): Likewise.
3483 (Output_data_got::add_global_with_rel): Likewise.
3484 (Output_data_got::add_global_with_rela): Likewise.
3485 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
3486 (Output_data_got::add_global_pair_with_rela): Likewise.
3487 (Output_data_got::add_local): Call add_got_entry.
3488 (Output_data_got::add_local_plt): Likewise.
3489 (Output_data_got::add_local_with_rel): Likewise.
3490 (Output_data_got::add_local_with_rela): Likewise.
3491 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
3492 (Output_data_got::add_local_pair_with_rela): Likewise.
3493 (Output_data_got::reserve_slot): New function.
3494 (Output_data_got::reserve_slot_for_global): New function.
3495 (Output_data_got::add_got_entry): New function.
3496 (Output_data_got::add_got_entry_pair): New function.
3497 (Output_section::add_output_section_data): Edit FIXME.
3498 * output.h
3499 (Output_section_data_build::Output_section_data_build): New
3500 constructor with size parameter.
3501 (Output_data_space::Output_data_space): Likewise.
3502 (Output_data_got::Output_data_got): Initialize new data member; new
3503 constructor with size parameter.
3504 (Output_data_got::add_constant): Call add_got_entry.
3505 (Output_data_got::reserve_slot): New function.
3506 (Output_data_got::reserve_slot_for_global): New function.
3507 (class Output_data_got::Got_entry): Add RESERVED_CODE.
3508 (Output_data_got::add_got_entry): New function.
3509 (Output_data_got::add_got_entry_pair): New function.
3510 (Output_data_got::free_list_): New data member.
3511 * target.h (Sized_target::init_got_plt_for_update): New function.
3512 (Sized_target::register_global_plt_entry): New function.
3513 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3514 Initialize new data member; call init; add constructor with PLT count.
3515 (Output_data_plt_x86_64::init): New function.
3516 (Output_data_plt_x86_64::add_relocation): New function.
3517 (Output_data_plt_x86_64::reserve_slot): New function.
3518 (Output_data_plt_x86_64::free_list_): New data member.
3519 (Target_x86_64::init_got_plt_for_update): New function.
3520 (Target_x86_64::register_global_plt_entry): New function.
3521 (Output_data_plt_x86_64::add_entry): Allocate from free list for
3522 incremental updates.
3523 (Output_data_plt_x86_64::add_relocation): New function.
3524 * testsuite/object_unittest.cc (Object_test): Set default options.
3525
ec69d6da
ILT
35262011-05-16 Ian Lance Taylor <iant@google.com>
3527
3528 * options.h (class General_options): Make -i a synonym for -r.
3529
732e31de
ILT
35302011-05-16 Ian Lance Taylor <iant@google.com>
3531
3532 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
3533
403676b5
CC
35342011-05-10 Cary Coutant <ccoutant@google.com>
3535
3536 * object.cc (Sized_relobj::do_count_local_symbols): Check for
3537 strip_all (-s).
3538
5b7b7d6e
ILT
35392011-05-06 Ian Lance Taylor <iant@google.com>
3540
3541 * layout.cc (Layout::layout): If the output section flags change,
3542 update the ordering.
3543
f0f9babf
CC
35442011-04-25 Cary Coutant <ccoutant@google.com>
3545
3546 * incremental-dump.cc (dump_incremental_inputs): Print local
3547 symbol info for each input file.
3548 * incremental.cc
3549 (Output_section_incremental_inputs::set_final_data_size): Add local
3550 symbol info to input file entries in incremental info.
3551 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3552 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
3553 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
3554 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
3555 implementation.
3556 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
3557 (Sized_incr_relobj::do_relocate): Write the local symbols.
3558 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
3559 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
3560 Adjust size of input file header.
3561 (Incremental_inputs_reader::get_local_symbol_offset): New function.
3562 (Incremental_inputs_reader::get_local_symbol_count): New function.
3563 (Incremental_inputs_reader::get_input_section): Adjust size of input
3564 file header.
3565 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
3566 (Sized_incr_relobj::This): New typedef.
3567 (Sized_incr_relobj::sym_size): New const data member.
3568 (Sized_incr_relobj::Local_symbol): New struct.
3569 (Sized_incr_relobj::do_output_local_symbol_count): New function.
3570 (Sized_incr_relobj::do_local_symbol_offset): New function.
3571 (Sized_incr_relobj::local_symbol_count_): New data member.
3572 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
3573 (Sized_incr_relobj::local_symbol_index_): New data member.
3574 (Sized_incr_relobj::local_symbol_offset_): New data member.
3575 (Sized_incr_relobj::local_dynsym_offset_): New data member.
3576 (Sized_incr_relobj::local_symbols_): New data member.
3577 * object.h (Relobj::output_local_symbol_count): New function.
3578 (Relobj::local_symbol_offset): New function.
3579 (Relobj::do_output_local_symbol_count): New function.
3580 (Relobj::do_local_symbol_offset): New function.
3581 (Sized_relobj::do_output_local_symbol_count): New function.
3582 (Sized_relobj::do_local_symbol_offset): New function.
3583
d0a9ace3
ILT
35842011-04-22 Vladimir Simonov <sv@sw.ru>
3585
3586 * descriptors.cc (set_close_on_exec): New function.
3587 (Descriptors::open): Use set_close_on_exec.
3588 * output.cc (S_ISLNK): Define if not defined.
3589
94a3fc8b
CC
35902011-04-22 Cary Coutant <ccoutant@google.com>
3591
3592 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
3593 global symbol map.
3594 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
3595 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
3596 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
3597 relocations.
3598 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
3599 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
3600 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
3601 * incremental.h
3602 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
3603 function.
3604 (Incremental_binary::apply_incremental_relocs): New function.
3605 (Incremental_binary::do_apply_incremental_relocs): New function.
3606 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
3607 data member.
3608 (Sized_incremental_binary::add_global_symbol): New function.
3609 (Sized_incremental_binary::global_symbol): New function.
3610 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
3611 (Sized_incremental_binary::symbol_map_): New data member.
3612 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
3613 * target.h (Sized_target::apply_relocation): New function.
3614 * target-reloc.h (apply_relocation): New function.
3615 * x86_64.cc (Target_x86_64::apply_relocation): New function.
3616
c87e4302
DK
36172011-04-22 Doug Kwan <dougkwan@google.com>
3618
3619 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
3620 flag of a SHT_ARM_EXIDX section.
2e702c99 3621 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
3622 * testsuite/Makefile.in: Regenerate.
3623 * testsuite/arm_exidx_test.s: New file.
3624 * testsuite/arm_exidx_test.sh: Same.
3625
e7782cf6
CC
36262011-04-20 Cary Coutant <ccoutant@google.com>
3627
3628 PR gold/12689
3629 * archive.h (Incremental_archive_entry::Archive_member):
3630 Initialize arg_serial_ (second constructor).
3631
308ecdc7
ILT
36322011-04-17 Ian Lance Taylor <iant@google.com>
3633
3634 * object.cc (Relocate_info::location): Simplify location string.
3635 * errors.cc (Errors::error_at_location): Don't print program
3636 name.
3637 (Errors::warning_at_location): Likewise.
3638 (Errors::undefined_symbol): Likewise.
3639 * testsuite/debug_msg.sh: Update accordingly.
3640
bec5b579
CC
36412011-04-14 Cary Coutant <ccoutant@google.com>
3642
3643 * gold/layout.cc (Layout::symtab_section_offset): New function.
3644 * gold/layout.h (Layout::symtab_section_offset): New function.
3645 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
3646
88597d34
ILT
36472011-04-12 Ian Lance Taylor <iant@google.com>
3648
3649 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
3650 with MREMAP_MAYMOVE.
3651 * output.h (class Output_file): Add map_is_allocated_ field.
3652 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
3653 not available, provide stubs. If mremap is not available, #define
3654 it to gold_mremap.
3655 (MREMAP_MAYMOVE): Define if not defined.
3656 (Output_file::Output_file): Initialize map_is_allocated_.
3657 (Output_file::resize): Check map_is_allocated_.
3658 (Output_file::map_anonymous): If mmap fails, use malloc.
3659 (Output_file::unmap): Don't do anything for an anonymous map.
3660 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
3661 is not available, provide stubs.
3662 (File_read::View::~View): Use free rather than delete[].
3663 (File_read::make_view): Use malloc rather than new[]. If mmap
3664 fails, use malloc.
3665 (File_read::find_or_make_view): Use malloc rather than new[].
3666 * gold.h: Remove HAVE_REMAP code.
3667 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
3668 exists. Rename mremap to gold_mremap. If mmap is not available
3669 don't do anything.
3670 * configure, config.in: Rebuild.
3671
11e361bc
ILT
36722011-04-11 Ian Lance Taylor <iant@google.com>
3673
3674 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
3675 initialize local variable v.
3676
cdc29364
CC
36772011-04-11 Cary Coutant <ccoutant@google.com>
3678
3679 * archive.cc (Archive::include_member): Adjust call to
3680 report_object.
3681 (Add_archive_symbols::run): Track argument serial numbers.
3682 (Lib_group::include_member): Likewise.
3683 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
3684 * archive.h (Incremental_archive_entry::Archive_member):
3685 Initialize arg_serial_.
3686 (Archive_member::arg_serial_): New data member.
3687 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
3688 (Sized_dynobj::do_add_symbols): Track symbols when doing an
3689 incremental link.
3690 (Sized_dynobj::do_for_all_local_got_entries): New function.
3691 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
3692 function.
3693 * fileread.cc (get_mtime): New function.
3694 * fileread.h (get_mtime): New function.
3695 * gold.cc (queue_initial_tasks): Check for incremental update.
3696 (process_incremental_input): New function.
3697 (queue_middle_tasks): Don't force valid target for incremental
3698 update.
3699 * incremental-dump.cc (find_input_containing_global): Adjust
3700 size of symbol info entry.
3701 (dump_incremental_inputs): Dump argument serial number and
3702 in_system_directory flag; bias shndx by 1; print symbol names
3703 when dumping per-file symbol lists; use new symbol info readers.
3704 * incremental.cc
3705 (Output_section_incremental_inputs:update_data_size): New function.
3706 (Sized_incremental_binary::setup_readers): Setup input readers
3707 for each input file; build maps for files added from libraries
3708 and scripts.
3709 (Sized_incremental_binary::check_input_args): New function.
3710 (Sized_incremental_binary::do_check_inputs): Build map of argument
3711 serial numbers to input arguments.
3712 (Sized_incremental_binary::do_file_has_changed): Rename
3713 do_file_is_unchanged to this; compare file modification times.
3714 (Sized_incremental_binary::do_init_layout): New function.
3715 (Sized_incremental_binary::do_reserve_layout): New function.
3716 (Sized_incremental_binary::do_get_input_reader): Remove.
3717 (Sized_incremental_binary::get_symtab_view): New function.
3718 (Incremental_checker::can_incrementally_link_output_file): Remove.
3719 (Incremental_inputs::report_command_line): Exclude --debug options.
3720 (Incremental_inputs::report_archive_begin): Add parameter; track
3721 argument serial numbers; don't put input file entry for archive
3722 before archive members.
3723 (Incremental_inputs::report_archive_end): Put input file entry
3724 for archive after archive members.
3725 (Incremental_inputs::report_object): Add parameter; track argument
3726 serial numbers and in_system_directory flag.
3727 (Incremental_inputs::report_script): Add parameter; track argument
3728 serial numbers.
3729 (Output_section_incremental_inputs::set_final_data_size): Adjust
3730 size of symbol info entry; check for forwarding symbols.
3731 (Output_section_incremental_inputs::write_input_files): Write
3732 in_system_directory flag and argument serial number.
3733 (Output_section_incremental_inputs::write_info_blocks): Map section
3734 indices between incremental info and original input file; store
3735 input section index for each symbol.
3736 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
3737 change operator() to visit().
3738 (class Global_got_offset_visitor): Likewise.
3739 (class Global_symbol_visitor_got_plt):
3740 (Output_section_incremental_inputs::write_got_plt): Use new visitor
3741 classes.
3742 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
3743 (Sized_incr_relobj::do_read_symbols): New function.
3744 (Sized_incr_relobj::do_layout): New function.
3745 (Sized_incr_relobj::do_layout_deferred_sections): New function.
3746 (Sized_incr_relobj::do_add_symbols): New function.
3747 (Sized_incr_relobj::do_should_include_member): New function.
3748 (Sized_incr_relobj::do_for_all_global_symbols): New function.
3749 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
3750 (Sized_incr_relobj::do_section_size): New function.
3751 (Sized_incr_relobj::do_section_name): New function.
3752 (Sized_incr_relobj::do_section_contents): New function.
3753 (Sized_incr_relobj::do_section_flags): New function.
3754 (Sized_incr_relobj::do_section_entsize): New function.
3755 (Sized_incr_relobj::do_section_address): New function.
3756 (Sized_incr_relobj::do_section_type): New function.
3757 (Sized_incr_relobj::do_section_link): New function.
3758 (Sized_incr_relobj::do_section_info): New function.
3759 (Sized_incr_relobj::do_section_addralign): New function.
3760 (Sized_incr_relobj::do_initialize_xindex): New function.
3761 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
3762 (Sized_incr_relobj::do_read_relocs): New function.
3763 (Sized_incr_relobj::do_gc_process_relocs): New function.
3764 (Sized_incr_relobj::do_scan_relocs): New function.
3765 (Sized_incr_relobj::do_count_local_symbols): New function.
3766 (Sized_incr_relobj::do_finalize_local_symbols): New function.
3767 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
3768 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
3769 (Sized_incr_relobj::do_relocate): New function.
3770 (Sized_incr_relobj::do_set_section_offset): New function.
3771 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
3772 (Sized_incr_dynobj::do_read_symbols): New function.
3773 (Sized_incr_dynobj::do_layout): New function.
3774 (Sized_incr_dynobj::do_add_symbols): New function.
3775 (Sized_incr_dynobj::do_should_include_member): New function.
3776 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
3777 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
3778 (Sized_incr_dynobj::do_section_size): New function.
3779 (Sized_incr_dynobj::do_section_name): New function.
3780 (Sized_incr_dynobj::do_section_contents): New function.
3781 (Sized_incr_dynobj::do_section_flags): New function.
3782 (Sized_incr_dynobj::do_section_entsize): New function.
3783 (Sized_incr_dynobj::do_section_address): New function.
3784 (Sized_incr_dynobj::do_section_type): New function.
3785 (Sized_incr_dynobj::do_section_link): New function.
3786 (Sized_incr_dynobj::do_section_info): New function.
3787 (Sized_incr_dynobj::do_section_addralign): New function.
3788 (Sized_incr_dynobj::do_initialize_xindex): New function.
3789 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
3790 (make_sized_incremental_object): New function.
3791 (Incremental_library::copy_unused_symbols): New function.
3792 (Incremental_library::do_for_all_unused_symbols): New function.
3793 * incremental.h (enum Incremental_input_flags): New type.
3794 (class Incremental_checker): Remove.
3795 (Incremental_input_entry::Incremental_input_entry): Add argument
3796 serial number.
3797 (Incremental_input_entry::arg_serial): New function.
3798 (Incremental_input_entry::set_is_in_system_directory): New function.
3799 (Incremental_input_entry::is_in_system_directory): New function.
3800 (Incremental_input_entry::arg_serial_): New data member.
3801 (Incremental_input_entry::is_in_system_directory_): New data member.
3802 (class Script_info): Move here from script.h.
3803 (Script_info::Script_info): Add filename parameter.
3804 (Script_info::filename): New function.
3805 (Script_info::filename_): New data member.
3806 (Incremental_script_entry::Incremental_script_entry): Add argument
3807 serial number.
3808 (Incremental_object_entry::Incremental_object_entry): Likewise.
3809 (Incremental_object_entry::add_input_section): Build list of input
3810 sections with map to original shndx.
3811 (Incremental_object_entry::get_input_section_index): New function.
3812 (Incremental_object_entry::shndx_): New data member.
3813 (Incremental_object_entry::name_key_): Rename; adjust all refs.
3814 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
3815 (Incremental_archive_entry::Incremental_archive_entry): Add argument
3816 serial number.
3817 (Incremental_inputs::report_archive_begin): Likewise.
3818 (Incremental_inputs::report_object): Likewise.
3819 (Incremental_inputs::report_script): Likewise.
3820 (class Incremental_global_symbol_reader): New class.
3821 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
3822 and store flags and input file type.
3823 (Incremental_input_entry_reader::arg_serial): New function.
3824 (Incremental_input_entry_reader::type): Extract type from flags.
3825 (Incremental_input_entry_reader::is_in_system_directory): New function.
3826 (Incremental_input_entry_reader::get_input_section_count): Call
3827 accessor function for type.
3828 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
3829 function for type; adjust size of global symbol entry.
3830 (Incremental_input_entry_reader::get_global_symbol_count): Call
3831 accessor function for type.
3832 (Incremental_input_entry_reader::get_object_count): Likewise.
3833 (Incremental_input_entry_reader::get_object_offset): Likewise.
3834 (Incremental_input_entry_reader::get_member_count): Likewise.
3835 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
3836 (Incremental_input_entry_reader::get_member_offset): Likewise.
3837 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
3838 (Incremental_input_entry_reader::Global_symbol_info): Remove.
3839 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
3840 (Incremental_input_entry_reader::get_global_symbol_reader): New
3841 function.
3842 (Incremental_input_entry_reader::get_output_symbol_index): New
3843 function.
3844 (Incremental_input_entry_reader::type_): Remove.
3845 (Incremental_input_entry_reader::flags_): New data member.
3846 (Incremental_inputs_reader::input_file_offset): New function.
3847 (Incremental_inputs_reader::input_file_index): New function.
3848 (Incremental_inputs_reader::input_file): Call input_file_offset.
3849 (Incremental_inputs_reader::input_file_at_offset): New function.
3850 (Incremental_relocs_reader::get_r_type): Reformat.
3851 (Incremental_relocs_reader::get_r_shndx): Reformat.
3852 (Incremental_relocs_reader::get_r_offset): Reformat.
3853 (Incremental_relocs_reader::data): New function.
3854 (Incremental_binary::Incremental_binary): Initialize new data members.
3855 (Incremental_binary::check_inputs): Add cmdline parameter.
3856 (Incremental_binary::file_is_unchanged): Remove.
3857 (Input_reader::arg_serial): New function.
3858 (Input_reader::get_unused_symbol_count): New function.
3859 (Input_reader::get_unused_symbol): New function.
3860 (Input_reader::do_arg_serial): New function.
3861 (Input_reader::do_get_unused_symbol_count): New function.
3862 (Input_reader::do_get_unused_symbol): New function.
3863 (Incremental_binary::input_file_count): New function.
3864 (Incremental_binary::get_input_reader): Change signature to use
3865 index instead of filename.
3866 (Incremental_binary::file_has_changed): New function.
3867 (Incremental_binary::get_input_argument): New function.
3868 (Incremental_binary::get_library): New function.
3869 (Incremental_binary::get_script_info): New function.
3870 (Incremental_binary::init_layout): New function.
3871 (Incremental_binary::reserve_layout): New function.
3872 (Incremental_binary::output_file): New function.
3873 (Incremental_binary::do_check_inputs): New function.
3874 (Incremental_binary::do_file_is_unchanged): Remove.
3875 (Incremental_binary::do_file_has_changed): New function.
3876 (Incremental_binary::do_init_layout): New function.
3877 (Incremental_binary::do_reserve_layout): New function.
3878 (Incremental_binary::do_input_file_count): New function.
3879 (Incremental_binary::do_get_input_reader): Change signature.
3880 (Incremental_binary::input_args_map_): New data member.
3881 (Incremental_binary::library_map_): New data member.
3882 (Incremental_binary::script_map_): New data member.
3883 (Sized_incremental_binary::Sized_incremental_binary): Initialize
3884 new data members.
3885 (Sized_incremental_binary::output_section): New function.
3886 (Sized_incremental_binary::inputs_reader): Add const.
3887 (Sized_incremental_binary::symtab_reader): Add const.
3888 (Sized_incremental_binary::relocs_reader): Add const.
3889 (Sized_incremental_binary::got_plt_reader): Add const.
3890 (Sized_incremental_binary::get_symtab_view): New function.
3891 (Sized_incremental_binary::Inputs_reader): New typedef.
3892 (Sized_incremental_binary::Input_entry_reader): New typedef.
3893 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
3894 (Sized_incremental_binary::do_file_is_unchanged): Remove.
3895 (Sized_incremental_binary::do_file_has_changed): New function.
3896 (Sized_incremental_binary::do_init_layout): New function.
3897 (Sized_incremental_binary::do_reserve_layout): New function.
3898 (Sized_input_reader::Inputs_reader): Remove.
3899 (Sized_input_reader::Input_entry_reader): Remove.
3900 (Sized_input_reader::do_arg_serial): New function.
3901 (Sized_input_reader::do_get_unused_symbol_count): New function.
3902 (Sized_input_reader::do_get_unused_symbol): New function.
3903 (Sized_incremental_binary::do_input_file_count): New function.
3904 (Sized_incremental_binary::do_get_input_reader): Change signature;
3905 use index instead of filename.
3906 (Sized_incremental_binary::section_map_): New data member.
3907 (Sized_incremental_binary::input_entry_readers_): New data member.
3908 (class Sized_incr_relobj): New class.
3909 (class Sized_incr_dynobj): New class.
3910 (make_sized_incremental_object): New function.
3911 (class Incremental_library): New class.
3912 * layout.cc (Free_list::num_lists): New static data member.
3913 (Free_list::num_nodes): New static data member.
3914 (Free_list::num_removes): New static data member.
3915 (Free_list::num_remove_visits): New static data member.
3916 (Free_list::num_allocates): New static data member.
3917 (Free_list::num_allocate_visits): New static data member.
3918 (Free_list::init): New function.
3919 (Free_list::remove): New function.
3920 (Free_list::allocate): New function.
3921 (Free_list::dump): New function.
3922 (Free_list::print_stats): New function.
3923 (Layout_task_runner::run): Resize output file for incremental updates.
3924 (Layout::Layout): Initialize new data members.
3925 (Layout::set_incremental_base): New function.
3926 (Layout::init_fixed_output_section): New function.
3927 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
3928 incremental updates.
3929 (Layout::create_gold_note): Do not create gold note section for
3930 incremental updates.
3931 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
3932 for incremental updates.
3933 (Layout::set_section_offsets): For incremental updates, allocate space
3934 from free list.
3935 (Layout::create_symtab_sections): Layout with offsets relative to
3936 start of section; for incremental updates, allocate space from free
3937 list.
3938 (Layout::create_shdrs): For incremental updates, allocate space from
3939 free list.
3940 (Layout::finish_dynamic_section): For incremental updates, do not
3941 check --as-needed (fixed in subsequent patch).
3942 * layout.h (class Free_list): New class.
3943 (Layout::set_incremental_base): New function.
3944 (Layout::incremental_base): New function.
3945 (Layout::init_fixed_output_section): New function.
3946 (Layout::allocate): New function.
3947 (Layout::incremental_base_): New data member.
3948 (Layout::free_list_): New data member.
3949 * main.cc (main): Print Free_list statistics.
3950 * object.cc (Relobj::finalize_incremental_relocs): Add
3951 clear_counts parameter; clear counts only when clear_counts is set.
3952 (Sized_relobj::Sized_relobj): Initialize new base class.
3953 (Sized_relobj::do_layout): Don't report special sections.
3954 (Sized_relobj::do_for_all_local_got_entries): New function.
3955 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
3956 symtab_off to all symbol table offsets.
3957 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
3958 * object.h (class Got_offset_list): Move to top of file.
3959 (Object::Object): Allow case where input_file == NULL.
3960 (Object::~Object): Likewise.
3961 (Object::input_file): Assert that input_file != NULL.
3962 (Object::lock): Allow case where input_file == NULL.
3963 (Object::unlock): Likewise.
3964 (Object::is_locked): Likewise.
3965 (Object::token): Likewise.
3966 (Object::release): Likewise.
3967 (Object::is_incremental): New function.
3968 (Object::get_mtime): New function.
3969 (Object::for_all_local_got_entries): New function.
3970 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
3971 (Object::set_is_in_system_directory): New function.
3972 (Object::is_in_system_directory): New function.
3973 (Object::do_is_incremental): New function.
3974 (Object::do_get_mtime): New function.
3975 (Object::do_for_all_local_got_entries): New function.
3976 (Object::is_in_system_directory_): New data member.
3977 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
3978 (class Sized_relobj_base): New class.
3979 (class Sized_relobj): Derive from Sized_relobj_base.
3980 (class Sized_relobj::Symbols): Redeclare from base class.
3981 (class Sized_relobj::local_got_offset_list): Remove.
3982 (class Sized_relobj::Output_sections): Redeclare from base class.
3983 (class Sized_relobj::do_for_all_local_got_entries): New function.
3984 (class Sized_relobj::write_local_symbols): Add offset parameter.
3985 (class Sized_relobj::local_symbol_offset_): Update comment.
3986 (class Sized_relobj::local_dynsym_offset_): Update comment.
3987 * options.cc (Input_arguments::add_file): Remove const.
3988 * options.h (Input_file_argument::Input_file_argument):
3989 Initialize arg_serial_ (all constructors).
3990 (Input_file_argument::set_arg_serial): New function.
3991 (Input_file_argument::arg_serial): New function.
3992 (Input_file_argument::arg_serial_): New data member.
3993 (Input_arguments::Input_arguments): Initialize file_count_.
3994 (Input_arguments::add_file): Remove const.
3995 (Input_arguments::number_of_input_files): New function.
3996 (Input_arguments::file_count_): New data member.
3997 (Command_line::number_of_input_files): Call
3998 Input_arguments::number_of_input_files.
3999 * output.cc (Output_segment_headers::Output_segment_headers):
4000 Set current size.
4001 (Output_section::Input_section::current_data_size): New function.
4002 (Output_section::Output_section): Initialize new data members.
4003 (Output_section::add_input_section): Don't do merge sections for
4004 an incremental link; allocate space from free list for an
4005 incremental update.
4006 (Output_section::add_output_section_data): Allocate space from
4007 free list for an incremental update.
4008 (Output_section::update_data_size): New function.
4009 (Output_section::set_fixed_layout): New function.
4010 (Output_section::reserve): New function.
4011 (Output_segment::set_section_addresses): Remove const.
4012 (Output_segment::set_section_list_addresses): Remove const; allocate
4013 space from free list for an incremental update.
4014 (Output_segment::set_offset): Adjust size of RELRO segment for an
4015 incremental update.
4016 * output.h (Output_data::current_data_size): Move here from
4017 child classes.
4018 (Output_data::pre_finalize_data_size): New function.
4019 (Output_data::update_data_size): New function.
4020 (Output_section_headers::update_data_size): new function.
4021 (Output_section_data_build::current_data_size): Move to Output_data.
4022 (Output_data_strtab::update_data_size): New function.
4023 (Output_section::current_data_size): Move to Output_data.
4024 (Output_section::set_fixed_layout): New function.
4025 (Output_section::has_fixed_layout): New function.
4026 (Output_section::reserve): New function.
4027 (Output_section::update_data_size): New function.
4028 (Output_section::has_fixed_layout_): New data member.
4029 (Output_section::free_list_): New data member.
4030 (Output_segment::set_section_addresses): Remove const.
4031 (Output_segment::set_section_list_addresses): Remove const.
4032 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
4033 New function.
4034 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
4035 New function.
4036 * readsyms.cc (Read_symbols::do_read_symbols): Add library
4037 parameter when calling Add_symbols constructor; store argument
4038 serial number for members of a lib group.
4039 (Add_symbols::locks): Allow case where token == NULL.
4040 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
4041 (Read_member::~Read_member): New function.
4042 (Read_member::is_runnable): New function.
4043 (Read_member::locks): New function.
4044 (Read_member::run): New function.
4045 (Check_script::~Check_script): New function.
4046 (Check_script::is_runnable): New function.
4047 (Check_script::locks): New function.
4048 (Check_script::run): New function.
4049 (Check_library::~Check_library): New function.
4050 (Check_library::is_runnable): New function.
4051 (Check_library::locks): New function.
4052 (Check_library::run): New function.
4053 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
4054 (Add_symbols::library_): New data member.
4055 (class Read_member): New class.
4056 (class Check_script): New class.
4057 (class Check_library): New class.
4058 * reloc.cc (Read_relocs::is_runnable): Allow case where
4059 token == NULL.
4060 (Read_relocs::locks): Likewise.
4061 (Scan_relocs::locks): Likewise.
4062 (Relocate_task::locks): Likewise.
4063 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
4064 to clear counters.
4065 (Sized_relobj::incremental_relocs_scan): Fix comment.
4066 (Sized_relobj::do_relocate): Pass output file offset to
4067 write_local_symbols.
4068 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
4069 from class declaration.
4070 * script.cc (read_input_script): Allocate Script_info; pass
4071 argument serial number to report_script.
4072 * script.h (class Script_info): Move to incremental.h.
4073 * symtab.cc (Symbol_table::add_from_incrobj): New function.
4074 * symtab.h (Symbol_table::add_from_incrobj): New function.
4075 (Symbol_table::set_file_offset): New function.
4076
b961d0d7
CC
40772011-04-05 Cary Coutant <ccoutant@google.com>
4078
4079 * incremental-dump.cc (dump_incremental_inputs): Change signature
4080 to take a Sized_incremental_binary; change caller. Use readers
4081 in Sized_incremental_binary.
4082 * incremental.cc
4083 (Sized_incremental_binary::find_incremental_inputs_sections):
4084 Rename do_find_incremental_inputs_sections to this.
4085 (Sized_incremental_binary::setup_readers): New function.
4086 (Sized_incremental_binary::do_check_inputs): Check
4087 has_incremental_info_ flag; move setup code to setup_readers;
4088 use input readers.
4089 (Sized_incremental_binary::do_file_is_unchanged): New function.
4090 (Sized_incremental_binary::do_get_input_reader): New function.
4091 * incremental.h (class Incremental_binary): Move to end of file.
4092 (Incremental_binary::file_is_unchanged): New function.
4093 (Incremental_binary::do_file_is_unchanged): New function.
4094 (Incremental_binary::Input_reader): New class.
4095 (Incremental_binary::get_input_reader): New function.
4096 (class Sized_incremental_binary): Move to end of file.
4097 (Sized_incremental_binary::Sized_incremental_binary): Setup the
4098 input section reader classes.
4099 (Sized_incremental_binary::has_incremental_info): New function.
4100 (Sized_incremental_binary::inputs_reader): New function.
4101 (Sized_incremental_binary::symtab_reader): New function.
4102 (Sized_incremental_binary::relocs_reader): New function.
4103 (Sized_incremental_binary::got_plt_reader): New function.
4104 (Sized_incremental_binary::do_file_is_unchanged): New function.
4105 (Sized_incremental_binary::Sized_input_reader): New class.
4106 (Sized_incremental_binary::get_input_reader): New function.
4107 (Sized_incremental_binary::find_incremental_inputs_sections):
4108 Rename do_find_incremental_inputs_sections to this.
4109 (Sized_incremental_binary::setup_readers): New function.
4110 (Sized_incremental_binary::has_incremental_info_): New data member.
4111 (Sized_incremental_binary::inputs_reader_): New data member.
4112 (Sized_incremental_binary::symtab_reader_): New data member.
4113 (Sized_incremental_binary::relocs_reader_): New data member.
4114 (Sized_incremental_binary::got_plt_reader_): New data member.
4115 (Sized_incremental_binary::current_input_file_): New data member.
4116
a869183f
PP
41172011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
4118
4119 PR gold/12640
4120 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
4121 violation.
4122
41232011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
4124
4125 * archive.cc (Archive::include_member): Adjust call to report_object.
4126 (Add_archive_symbols::run): Add script_info to call to
4127 report_archive_begin.
4128 (Lib_group::include_member): Adjust call to report_object.
4129 (Add_lib_group_symbols::run): Adjust call to report_object.
4130 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
4131 blocks. Add object count for script input files.
4132 * incremental.cc (Incremental_inputs::report_archive_begin): Add
4133 script_info parameter; change all callers.
4134 (Incremental_inputs::report_object): Add script_info parameter;
4135 change all callers.
4136 (Incremental_inputs::report_script): Store backpointer to
4137 incremental info entry.
4138 (Output_section_incremental_inputs::set_final_data_size): Record
4139 additional information for scripts.
4140 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4141 * incremental.h (Incremental_script_entry::add_object): New function.
4142 (Incremental_script_entry::get_object_count): New function.
4143 (Incremental_script_entry::get_object): New function.
4144 (Incremental_script_entry::objects_): New data member; adjust
4145 constructor.
4146 (Incremental_inputs::report_archive_begin): Add script_info parameter.
4147 (Incremental_inputs::report_object): Add script_info parameter.
4148 (Incremental_inputs_reader::get_object_count): New function.
4149 (Incremental_inputs_reader::get_object_offset): New function.
4150 * options.cc (Input_arguments::add_file): Return reference to
4151 new input argument.
4152 * options.h (Input_argument::set_script_info): New function.
4153 (Input_argument::script_info): New function.
4154 (Input_argument::script_info_): New data member; adjust all
4155 constructors.
4156 (Input_file_group::add_file): Return reference to new input argument.
4157 (Input_file_lib::add_file): Likewise.
4158 (Input_arguments::add_file): Likewise.
4159 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
4160 * script.cc (Parser_closure::Parser_closure): Add script_info
4161 parameter; adjust all callers.
4162 (Parser_closure::script_info): New function.
4163 (Parser_closure::script_info_): New data member.
4164 (read_input_script): Report scripts earlier to incremental info.
4165 (script_add_file): Set script_info in Input_argument.
4166 (script_add_library): Likewise.
4167 * script.h (Script_options::Script_info): Rewrite class.
4168
a869183f 41692011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
4170
4171 * archive.cc (Library_base::should_include_member): Move
4172 method here from class Archive.
4173 (Archive::Archive): Initialize base class.
4174 (Archive::should_include_member): Move to base class.
4175 (Archive::do_for_all_unused_symbols): New function.
4176 (Add_archive_symbols::run): Remove redundant access to
4177 incremental_inputs.
4178 (Lib_group::Lib_group): Initialize base class.
4179 (Lib_group::do_filename): New function.
4180 (Lib_group::include_member): Pass pointer to Lib_group to
4181 report_object.
4182 (Lib_group::do_for_all_unused_symbols): New function.
4183 (Add_lib_group_symbols::run): Report archive information for
4184 incremental links.
4185 * archive.h (class Library_base): New base class.
4186 (class Archive): Derive from Library_base.
4187 (Archive::filename): Move to base class.
4188 (Archive::set_incremental_info): Likewise.
4189 (Archive::incremental_info): Likewise.
4190 (Archive::Should_include): Likewise.
4191 (Archive::should_include_member): Likewise.
4192 (Archive::Armap_entry): Remove.
4193 (Archive::Unused_symbol_iterator): Remove.
4194 (Archive::unused_symbols_begin): Remove.
4195 (Archive::unused_symbols_end): Remove.
4196 (Archive::do_filename): New function.
4197 (Archive::do_get_mtime): New function.
4198 (Archive::do_for_all_unused_symbols): New function.
4199 (Archive::task_): Move to base class.
4200 (Archive::incremental_info_): Likewise.
4201 (class Lib_group): Derive from Library_base.
4202 (Lib_group::do_filename): New function.
4203 (Lib_group::do_get_mtime): New function.
4204 (Lib_group::do_for_all_unused_symbols): New function.
4205 (Lib_group::task_): Move to base class.
4206 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
4207 function.
4208 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
4209 function.
4210 * incremental.cc (Incremental_inputs::report_archive_begin):
4211 Use Library_base; call library's get_mtime; add incremental inputs
4212 entry before members.
4213 (class Unused_symbol_visitor): New class.
4214 (Incremental_inputs::report_archive_end): Use Library_base; use
4215 visitor class to record unused symbols; don't add incremental inputs
4216 entry after members.
4217 (Incremental_inputs::report_object): Use Library_base.
4218 * incremental.h
4219 (Incremental_archive_entry::Incremental_archive_entry): Remove
4220 unused Archive parameter.
4221 (Incremental_inputs::report_archive_begin): Use Library_base.
4222 (Incremental_inputs::report_archive_end): Likewise.
4223 (Incremental_inputs::report_object): Likewise.
4224 * object.cc (Sized_relobj::do_for_all_global_symbols): New
4225 function.
4226 * object.h (Object::for_all_global_symbols): New function.
4227 (Object::do_for_all_global_symbols): New function.
4228 (Sized_relobj::do_for_all_global_symbols): New function.
4229 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
4230 function.
4231 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
4232 function.
4233
61ab3e40
ILT
42342011-03-27 Ian Lance Taylor <iant@google.com>
4235
4236 * archive.cc (Archive::interpret_header): Return -1 if something
4237 goes wrong. Change callers accordingly.
4238
30e1f9e6
CC
42392011-03-25 Cary Coutant <ccoutant@google.com>
4240
4241 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
4242 * testsuite/Makefile.in: Regenerate.
4243
9370ce59 42442011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
4245
4246 * plugin.cc (get_view): New.
4247 (Plugin::load): Pass get_view to the plugin.
4248 (Plugin_manager::get_view): New.
4249
9312bb0a
ILT
42502011-03-21 Ian Lance Taylor <iant@google.com>
4251
4252 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 4253 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 4254
7e12ba9e
ST
42552011-03-21 Sriraman Tallam <tmsriram@google.com>
4256
4257 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
4258 Change == to -eq.
4259 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
4260 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
4261 Change == to -eq.
4262 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
4263 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
4264
fd7a005d
ILT
42652011-03-14 Ian Lance Taylor <iant@google.com>
4266
4267 * script-sections.cc (Sort_output_sections::script_compare):
4268 Rename from is_before, change return type.
4269 (Sort_output_sections::operator()): Adjust accordingly.
4270
ed16fd1b
ILT
42712011-03-11 Jeffrey Yasskin <jyasskin@google.com>
4272
4273 PR gold/12572
4274 * testsuite/odr_violation2.cc: Add comment to make all error line
4275 numbers double digits.
4276 * testsuite/debug_msg.sh: Adjust expected errors.
4277
71ff8986
ILT
42782011-03-09 Jeffrey Yasskin <jyasskin@google.com>
4279
4280 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
4281 but mark earlier ones as non-canonical
4282 (offset_to_iterator): Update search target and example
4283 (do_addr2line): Return extra lines in a vector*
4284 (format_file_lineno): Extract from do_addr2line
4285 (one_addr2line): Add vector* out-param
4286 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
4287 when a lineno entry appeared last for its instruction
4288 (Dwarf_line_info): Add vector* out-param
4289 * object.cc (Relocate_info): Pass NULL for the vector* out-param
4290 * symtab.cc (Odr_violation_compare): Include the lineno in the
4291 comparison again.
4292 (linenos_from_loc): New. Combine the canonical line for an
4293 address with its other lines.
4294 (True_if_intersect): New. Helper functor to make
4295 std::set_intersection a query.
4296 (detect_odr_violations): Compare sets of lines instead of just
4297 one line for each function. This became less deterministic, but
4298 has fewer false positives.
4299 * symtab.h: Declarations.
4300 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
4301 mix an optimized and non-optimized object in the same binary
4302 (odr_violation2.so): Same.
4303 * testsuite/Makefile.in: Regenerate from Makefile.am.
4304 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
4305 * testsuite/debug_msg.sh: Update line numbers and add
4306 assertions.
4307 * testsuite/odr_violation1.cc: Use OdrDerived, in a
4308 non-optimized context.
4309 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
4310 isn't inlined, and use OdrDerived in an optimized context.
4311 * testsuite/odr_header1.h: Defines OdrDerived, where
4312 optimization will change the
4313 first-instruction-in-the-destructor's file and line number.
4314 * testsuite/odr_header2.h: Defines OdrBase.
4315
a19fefdc
ILT
43162011-03-09 Ian Lance Taylor <iant@google.com>
4317
4318 * fileread.cc (File_read::clear_views): Don't delete the whole
4319 file view.
4320
ecb351e9
ILT
43212011-03-08 Ian Lance Taylor <iant@google.com>
4322
4323 PR gold/12525
4324 * fileread.cc: #include <climits>.
4325 (GOLD_IOV_MAX): Define.
4326 (File_read::read_multiple): Limit number of entries by iov_max.
4327 * fileread.h (class File_read): Always set max_readv_entries to
4328 128.
4329
b821d13c
ILT
43302011-03-07 Ian Lance Taylor <iant@google.com>
4331
4332 PR gold/12525
4333 * options.h (class General_options): Add -dy and -dn.
4334
89243142
CC
43352011-03-02 Cary Coutant <ccoutant@google.com>
4336
4337 * testsuite/script_test_9.t: Add TLS segment.
4338
d0773f31
ILT
43392011-03-02 Simon Baldwin <simonb@google.com>
4340
4341 * configure.ac: Add check for gnu_indirect_function support in
4342 the toolchain building binutils.
4343 * configure: Rebuild.
4344
9370ce59 43452011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
4346
4347 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
4348 plugin only symbols.
4349 (Symbol_table::sized_finalize_symbol) Mark symbol only present
4350 in plugin files as not needed in the symbol table.
4351
4cf7a849
ST
43522011-02-11 Sriraman Tallam <tmsriram@google.com>
4353
4354 * output.cc (Output_section::add_input_section): Delay fill
4355 generation for section ordering.
4356
b578bd7d
ILT
43572011-02-09 Ian Lance Taylor <iant@google.com>
4358
4359 PR gold/12316
4360 * object.h (class Sized_relobj): Remove clear_local_symbols.
4361 * reloc.cc (Sized_relobj::do_relocate): Don't call
4362 clear_local_symbols.
4363
9370ce59 43642011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
4365
4366 * plugin.cc (is_visible_from_outside): Return true for symbols
4367 in the -u option.
4368
55382fb7
ILT
43692011-02-04 Jeffrey Yasskin <jyasskin@google.com>
4370
4371 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
4372 filename.
4373
4e271fff
ST
43742011-02-02 Sriraman Tallam <tmsriram@google.com>
4375
4376 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 4377 to std::string.
4e271fff 4378 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 4379 section_name to be std::string.
4e271fff
ST
4380 (is_function_ctor_or_dtor): Change type of parameter to std::string.
4381
d433c3ac
ILT
43822011-01-25 Ian Lance Taylor <iant@google.com>
4383
4384 * script.cc (script_add_extern): Rewrite to use
4385 add_symbol_reference.
4386
880473a6
DK
43872011-01-25 Doug Kwan <dougkwan@google.com>
4388
d433c3ac 4389 * icf.cc (get_section_contents): Always lock section's object.
880473a6 4390
f30f86fa
ILT
43912011-01-24 Ian Lance Taylor <iant@google.com>
4392
4393 * options.h (class General_options): Accept
4394 --no-detect-odr-violations.
4395
8e51a0b9
ILT
43962011-01-24 Ian Lance Taylor <iant@google.com>
4397
4398 * version.cc (version_string): Bump to 1.11.
4399
0f3b89d8
ILT
44002011-01-24 Ian Lance Taylor <iant@google.com>
4401
4402 * plugin.cc (class Plugin_rescan): Define new class.
4403 (Plugin_manager::claim_file): Set any_claimed_.
4404 (Plugin_manager::save_archive): New function.
4405 (Plugin_manager::save_input_group): New function.
4406 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
4407 necessary.
4408 (Plugin_manager::new_undefined_symbol): New function.
4409 (Plugin_manager::rescan): New function.
4410 (Plugin_manager::rescannable_defines): New function.
4411 (Plugin_manager::add_input_file): Set any_added_.
4412 * plugin.h (class Plugin_manager): define new fields rescannable_,
4413 undefined_symbols_, any_claimed_, and any_added_. Declare
4414 Plugin_rescan as friend. Declare new functions.
4415 (Plugin_manager::Rescannable): Define type.
4416 (Plugin_manager::Rescannable_list): Define type.
4417 (Plugin_manager::Undefined_symbol_list): Define type.
4418 (Plugin_manager::Plugin_manager): Initialize new fields.
4419 * archive.cc (Archive::defines_symbol): New function.
4420 (Add_archive_symbols::run): Pass archive to plugins if any.
4421 * archive.h (class Archive): Declare defines_symbol.
4422 * readsyms.cc (Input_group::~Input_group): New function.
4423 (Finish_group::run): Pass input_group to plugins if any.
4424 * readsyms.h (class Input_group): Declare destructor.
4425 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
4426 any.
4427
3bb951e5
ILT
44282011-01-10 Ian Lance Taylor <iant@google.com>
4429
4430 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
4431 section as relro.
4432 (Layout::set_segment_offsets): Reset increase_relro before calling
4433 set_section_addresses a second time.
4434
0aa45fac
CC
44352011-01-04 Cary Coutant <ccoutant@google.com>
4436
4437 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
4438 sections before NOBITS sections.
4439
0db46eb4
L
44402011-01-01 H.J. Lu <hongjiu.lu@intel.com>
4441
4442 * version.cc (print_version): Update copyright to 2011.
4443
829c9745
CC
44442010-12-23 Cary Coutant <ccoutant@google.com>
4445
4446 * output.h (Output_data_reloc::add_output_section): Pass OD instead
4447 of OS to this->add. Add OD parameter to second form of the function.
4448
7500420b
ILT
44492010-12-20 Ian Lance Taylor <iant@google.com>
4450
4451 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
4452 second of two consecutive entries with same offset.
4453
f8e9a930
RW
44542010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4455
4456 * testsuite/Makefile.am (ifuncmain2static_LDADD)
4457 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
4458 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
4459 to avoid unneeded links against $(LDADD).
4460 * testsuite/Makefile.in: Regenerate.
4461
2fbb4320
ILT
44622010-12-15 Ian Lance Taylor <iant@google.com>
4463
4464 PR gold/12324
4465 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
4466 for R_X86_64_32 and R_X86_64_PC32.
4467 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
4468 ver_matching_def_pic.o.
4469 (ver_matching_def_pic.o): New target.
4470
fedb228d
RW
44712010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4472
4473 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
4474 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
4475 Move definition before File_read::View member definitions.
4476 (File_read::View::~View): Initialize and hold lock before
4477 updating current_mapped_bytes.
4478
9b547ce6
RW
44792010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4480
4481 * dwarf_reader.cc: Remove outdated comment.
4482 * gold-threads.cc: Fix typo in error message.
4483 * archive.cc: Fix typos in comments.
4484 * archive.h: Likewise.
4485 * arm-reloc-property.cc: Likewise.
4486 * arm-reloc-property.h: Likewise.
4487 * arm-reloc.def: Likewise.
4488 * arm.cc: Likewise.
4489 * attributes.h: Likewise.
4490 * cref.cc: Likewise.
4491 * ehframe.cc: Likewise.
4492 * fileread.h: Likewise.
4493 * gold.h: Likewise.
4494 * i386.cc: Likewise.
4495 * icf.cc: Likewise.
4496 * incremental.h: Likewise.
4497 * int_encoding.cc: Likewise.
4498 * layout.h: Likewise.
4499 * main.cc: Likewise.
4500 * merge.h: Likewise.
4501 * object.cc: Likewise.
4502 * object.h: Likewise.
4503 * options.cc: Likewise.
4504 * readsyms.cc: Likewise.
4505 * reduced_debug_output.cc: Likewise.
4506 * reloc.cc: Likewise.
4507 * script-sections.cc: Likewise.
4508 * sparc.cc: Likewise.
4509 * symtab.h: Likewise.
4510 * target-reloc.h: Likewise.
4511 * target.cc: Likewise.
4512 * target.h: Likewise.
4513 * timer.cc: Likewise.
4514 * timer.h: Likewise.
4515 * x86_64.cc: Likewise.
4516
83e17bd5
CC
45172010-12-09 Cary Coutant <ccoutant@google.com>
4518
4519 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
4520 stack.
4521 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
4522 parameter; change all callers.
4523 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
4524 * options.h (warn_execstack): New option.
4525
017257f8
DK
45262010-12-07 Doug Kwan <dougkwan@google.com>
4527
4528 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
4529 like function call relocations.
4530
c20cbc06
ILT
45312010-12-07 Ian Lance Taylor <iant@google.com>
4532
4533 * archive.cc (Archive::get_elf_object_for_member): Permit
4534 punconfigured to be NULL.
4535 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
4536 (Archive::include_member): Pass NULL to get_elf_object_for_member
4537 if we searched for the archive and this is the first included
4538 object.
4539
4dbfafcc
ILT
45402010-12-01 Ian Lance Taylor <iant@google.com>
4541
4542 * dwarf_reader.h (class Sized_dwarf_line_info): Add
4543 track_relocs_type_ field.
4544 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4545 Set track_relocs_type_.
4546 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
4547 contents when using RELA relocs.
4548 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
4549 reloc_map_.
4550 * reloc.cc (Track_relocs::next_addend): New function.
4551 * reloc.h (class Track_relocs): Declare next_addend.
4552
e5e19edd
ILT
45532010-12-01 Ian Lance Taylor <iant@google.com>
4554
4555 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
4556 virtual destructor.
4557
9a5ce24c
ILT
45582010-12-01 Ian Lance Taylor <iant@google.com>
4559
4560 * README: Update compilers known to work and fail.
4561
c7791212
NC
45622010-11-23 Matthias Klose <doko@ubuntu.com>
4563
4564 * configure.in: For --enable-gold, handle value `default' instead of
4565 `both*'. Always install ld as ld.bfd, install as ld if gold is
4566 not the default.
4567 * configure: Regenerate.
4568
0ad220c9
DK
45692010-11-18 Doug Kwan <dougkwan@google.com>
4570
4571 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
4572 and right_alignment to be zero. Store result alignment only if it is
4573 greater than existing alignment.
4574
ab8056e0
CC
45752010-11-16 Cary Coutant <ccoutant@google.com>
4576
4577 PR gold/12220
4578 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4579 Check for ".zdebug_line".
4580
fd064a5b
CC
45812010-11-16 Doug Kwan <dougkwan@google.com>
4582 Cary Coutant <ccoutant@google.com>
4583
4584 * output.h (Output_segment::set_section_addresses): Pass increase_relro
4585 by reference; adjust all callers.
4586 * output.cc (Output_segment::set_section_addresses): Adjust references
4587 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
4588 list is empty.
4589 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
4590 end at page boundary.
4591
6fc6ea19
CC
45922010-11-16 Cary Coutant <ccoutant@google.com>
4593
4594 PR gold/12220
4595 * layout.cc (Layout::choose_output_section): Transform names of
4596 compressed sections even when using a script with a SECTIONS clause.
4597 (Layout::output_section_name): Remove code to transform
4598 compressed debug section names.
4599 * output.cc (Output_section::add_input_section): Use uncompressed
4600 section size when tracking input sections.
4601
95a2c8d6
RS
46022010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
4603
4604 * symtab.h (Symbol::NON_PIC_REF): Remove.
4605 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
4606 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
4607 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
4608 (Symbol::use_plt_offset): Take a flags argument and pass it
4609 directly to needs_dynamic_reloc. Restrict check for undefined
4610 weak symbols to function calls.
4611 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
4612 (Target_arm::Scan::global): Use it.
4613 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
4614 (Target_arm::Relocate::relocate): Likewise.
4615 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
4616 parameter with an r_type parameter. Use get_reference_flags
4617 to get the flags.
4618 (Target_arm::Relocate::relocate): Update accordingly.
4619 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
4620 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
4621 (Target_i386::Scan::global): Likewise.
4622 (Target_i386::Relocate::relocate): Likewise.
4623 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
4624 parameter with an r_type parameter. Use get_reference_flags
4625 to get the flags.
4626 (Target_i386::Relocate::relocate): Update accordingly.
4627 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
4628 (Target_powerpc::Scan::global): Use it.
4629 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
4630 (Target_powerpc::Relocate::relocate): Likewise.
4631 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
4632 (Target_sparc::Scan::global): Use it.
4633 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
4634 (Target_sparc::Relocate::relocate): Likewise.
4635 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
4636 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
4637 (Target_x86_64::Scan::global): Likewise.
4638 (Target_x86_64::Relocate::relocate): Likewise.
4639
f625ae50
DK
46402010-11-08 Doug Kwan <dougkwan@google.com>
4641 Cary Coutant <ccoutant@google.com>
4642
4643 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
4644 (Arm_exidx_merge_section::section_contents_): New data member.
4645 (Arm_input_section::Arm_input_section): Initialize original_contents_.
4646 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 4647 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
4648 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
4649 in parameters instead of calling Object::section_contents without
4650 locking.
4651 (Arm_output_section::group_section): New parameter TASK. Pass it
4652 to callees that need locking objects.
4653 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
4654 to lock EXIDX input sections. Fix a formatting issue. Call
4655 Arm_exidx_merged_section::build_contents to create merged section
4656 contents.
4657 (Arm_output_section::create_stub_group): New parameter TASK. Use it
4658 to lock object of stub table owner.
4659 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
4660 TEXT_SIZE to initialize data member TEXT_SIZE_.
4661 (Arm_exidx_input_section::addralign): Fix typo in comment.
4662 (Arm_exidx_input_section::text_size): New method.
4663 (Target_arm::do_relax): New parameter TASK. Pass it to callees
4664 that require locking objects. Lock objects before scanning for stubs
4665 and updating local symbols.
4666 (Arm_input_section<big_endian>::init): Copy contents of original
4667 input section.
2e702c99 4668 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
4669 original input section instead of calling Object::section_contents
4670 without locking.
4671 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
4672 size without calling Object::section_size().
4673 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
4674 for size. Allocate a buffer for merged EXIDX entries.
4675 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 4676 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
4677 building code to Arm_exidx_merged_section::build_contetns. Write
4678 out contetns in buffer instead of building it on the fly.
4679 (Arm_relobj::make_exidx_input_section): Also pass text section size
4680 to Arm_exidx_input_section constructor.
4681 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
4682 (Arm_dynobj::do_read_symbols): Fix memory leak.
4683 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
4684 * target.h: (class Task): Add forward declaration.
4685 (Target::relax): Add new parameter TASK and pass it to
4686 Target::do_relax().
4687 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
4688
5f9bcf58
CC
46892010-11-05 Cary Coutant <ccoutant@google.com>
4690
4691 PR gold/10708
4692 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
4693 object when reading from the file.
4694 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
4695 second layout pass.
4696 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
4697 when reading section contents.
4698 (get_section_contents): Likewise.
4699 (icf::find_identical_sections): Likewise.
4700 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
4701 object when reading from the file.
4702 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
4703 the object when doing deferred section layout.
4704
e597fa08
NC
47052010-11-03 Nick Clifton <nickc@redhat.com>
4706
4707 PR gold/12001
4708 * script.h (class Symbol_assignment: name): New member. Returns
4709 the name of the symbol.
4710 * scrfipt.cc (Script_options::is_pending_assignment): New member.
4711 Returns true if the given symbol name is on the list of
4712 assignments wating to be processed.
4713 * archive.cc (should_incldue_member): If the symbol is undefined,
4714 check to see if it is on the list of symbols pending assignment.
4715
3f9a3278
ILT
47162010-11-03 Ryan Mansfield <rmansfield@qnx.com>
4717
4718 * script-sections.cc (Script_sections::find_memory_region): Check
4719 for a NULL output section pointer.
4720
d06fb4d1
DK
47212010-10-29 Doug Kwan <dougkwan@google.com>
4722
4723 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
4724 Output_section::add_relaxed_input_section.
4725 * output.cc (Output_section::add_relaxed_input_section): Add new
4726 arguments LAYOUT and NAME. Set section order index.
4727 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
4728 Copy section order index.
4729 * output.h (Output_section::add_relaxed_input_section): Add new
4730 arguments LAYOUT and NAME.
4731
90e24de5
ILT
47322010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4733
4734 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 4735 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
4736 * testsuite/Makefile.in: Regenerate.
4737
c9484ea5
DK
47382010-10-20 Doug Kwan <dougkwan@google.com>
4739
4740 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
4741 without SHF_LINK_ORDER flags.
4742 * layout.cc (Layout::choose_output_section): Do not filter
4743 SHF_LINK_ORDER flag in a relocatable link.
4744
5bc2f5be
CC
47452010-10-17 Cary Coutant <ccoutant@google.com>
4746
4747 * output.h (Output_segment::set_section_addresses): Change function
4748 signature. Update all callers.
4749 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
4750 sections.
4751 (Output_segment::set_section_addresses): Align after last TLS
4752 section. Add padding before last relro section instead of after.
4753
0c91cf04
DK
47542010-10-17 Doug Kwan <dougkwan@google.com>
4755
4756 * gold/arm.cc (Target_arm::got_section): Use correct order and set
4757 GOT output section to be writable.
4758
8c21d9d3
CC
47592010-10-14 Cary Coutant <ccoutant@google.com>
4760
4761 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
4762 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
4763 * gold.cc (queue_initial_tasks): Check parameters for incremental link
4764 mode.
4765 * incremental.cc (report_command_line): Ignore all forms of
4766 --incremental.
4767 * layout.cc (Layout::Layout): Check parameters for incremental link
4768 mode.
4769 * options.cc (General_options::parse_incremental): New function.
4770 (General_options::parse_no_incremental): New function.
4771 (General_options::parse_incremental_full): New function.
4772 (General_options::parse_incremental_update): New function.
4773 (General_options::incremental_mode_): New data member.
4774 (General_options::finalize): Check incremental_mode_.
4775 * options.h (General_options): Update help text for --incremental.
4776 Add --no-incremental, --incremental-full, --incremental-update.
4777 (General_options::Incremental_mode): New enum type.
4778 (General_options::incremental_mode): New function.
4779 (General_options::incremental_mode_): New data member.
4780 * parameters.cc (Parameters::incremental_mode_): New data member.
4781 (Parameters::set_options): Set incremental_mode_.
4782 (Parameters::set_incremental_full): New function.
4783 (Parameters::incremental): New function.
4784 (Parameters::incremental_update): New function.
4785 (set_parameters_incremental_full): New function.
4786 * parameters.h (Parameters::set_incremental_full): New function.
4787 (Parameters::incremental): New function.
4788 (Parameters::incremental_update): New function.
4789 (Parameters::incremental_mode_): New data member.
4790 (set_parameters_incremental_full): New function.
4791 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
4792 incremental link mode.
4793 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
4794 (Sized_relobj::do_relocate_sections): Likewise.
4795 * testsuite/Makefile.am (incremental_test): Use --incremental-full
4796 option.
4797 * testsuite/Makefile.in: Regenerate.
4798 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 4799
bb32aa18 48002010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
4801
4802 * script-sections.h (class Script_sections): Make
4803 Sections_elements typedef public.
4804 * script-sections.cc (class Sort_output_sections): Add elements_
4805 field. Add constructor which sets it; change all callers.
4806 (Sort_output_sections::is_before): New function.
4807 (Sort_output_sections::operator()): Call is_before.
4808 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
4809 conditional.
4810 * testsuite/script_test_10.sh: New test. Test script section
4811 order.
4812 * testsuite/script_test_10.t: Likewise.
4813 * testsuite/script_test_10.s: Likewise.
4814 * testsuite/Makefile.am: Wrap the cross linker tests and the
4815 common tests into NATIVE_OR_CROSS_LINKER.
4816 (check_SCRIPTS): Add script_test_10.sh.
4817 (check_DATA): Add script_test_10.stdout.
4818 (script_test_10.o, script_test_10): New targets.
4819 (script_test_10.stdout): New target.
4820 * configure, testsuite/Makefile.in: Regenerate.
4821
3cef7179
ILT
48222010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4823
4824 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
4825 error for the deprecated relocations.
4826 (Target_arm::Scan::global): Likewise.
4827 (Target_arm::Relocate::relocate): Likewise.
4828
7411e9a8
RS
48292010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
4830
4831 * fileread.cc (Input_file::find_file): Initialize *found_name
4832 and *namep when using the fallback search for case 4.
4833
6a9da32a
CC
48342010-10-11 Cary Coutant <ccoutant@google.com>
4835
4836 * options.h (class General_options): Redefine -z lazy as an alias for
4837 the negation of -z now.
4838
ac897c20
ILT
48392010-10-11 Ian Lance Taylor <iant@google.com>
4840
4841 * resolve.cc (symbol_to_bits): Report the value of the unsupported
4842 binding.
4843
ea5cae92
NC
48442010-10-06 Nick Clifton <nickc@redhat.com>
4845
4846 * script-sections.cc(class Memory_region): Remove
4847 current_lma_offset_ field. Rename current_vma_offset_ to
4848 current_offset_. Add last_section_ field.
4849 (Memory_region::get_current_vma_address): Rename to
4850 get_current_address.
4851 (Memory_region::get_current_lma_address): Delete.
4852 (Memory_region::increment_vma_offset): Rename to
4853 increment_offset.
4854 (Memory_region::increment_lma_offset): Delete.
4855 (Memory_region::attributes_compatible): New method. Returns
4856 true if the provided section is compatible with the region.
4857 (Memory_region::get_last_section): New method. Returns the last
4858 section to use the region.
4859 (Memory_region::set_last_section): New method. Stores the last
4860 section to use the region.
4861 (Script_sections::block_in_region): New method. Returns true if
4862 a block of memory is contained within a region.
4863 (Script_sections::find_memory_region): New method. Locates a
4864 memory region to be used to set a VMA or LMA address.
4865 (Output_section_definition::set_section_addresses): Add code to
4866 check for addresses set by memory regions.
4867 (Output_segment::set_section_addresses): Remove memory region
4868 walking code.
4869 (Script_sections::create_segment): Add a warning if a header
4870 segment is created outside of any region.
4871 * script-sections.h (class Script_sections): Add prototypes for
4872 find_memory_region and block_in_region methods.
4873 * testsuite/memory_test.s: Use .long instead of .word.
4874 * testsuite/memory_test.t: Add some more output sections.
4875 * testsuite/memory_test.sh: Update expected output.
4876
a9bfd952
DK
48772010-10-02 Doug Kwan <dougkwan@google.com>
4878
4879 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
4880 defintion to symtab.h
4881 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
4882 declaration to defintion.
4883
bacff3ab
NC
48842010-10-01 Nick Clifton <nickc@redhat.com>
4885
4886 * expression.cc (eval): Replace dummy argument with NULL.
4887 (eval_maybe_dot): Check for a NULL result section pointer.
4888 (Symbol_expression::value): Likewise.
4889 (Dot_expression::value): Likewise.
4890 (BINARY_EXPRESSION): Likewise.
4891 (Max_expression::value): Likewise.
4892 (Min_expression::value): Likewise.
4893 (Absolute_expression::value): Likewise.
4894 (Addr_expression::value_from_output_section): Likewise.
4895 (Loaddddr_expression::value_from_output_section): Likewise.
4896 (Segment_start_expression::value): Likewise.
4897 * script-sections.cc
4898 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
4899 argument with NULL.
4900 (Sections_elememt_dot_assignment::set_section_addresses):
4901 Likewise.
4902 (Output_data_expression::do_write_to_buffer): Likewise.
4903 (Output_section_definition::finalize_symbols): Likewise.
4904 (Output_section_definition::set_section_addresses): Likewise.
4905
f81bc8b5
DK
49062010-09-30 Doug Kwan <dougkwan@google.com>
4907
4908 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
4909
c95e9f27
ST
49102010-09-28 Sriraman Tallam <tmsriram@google.com>
4911
4912 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 4913 function.
c95e9f27
ST
4914 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
4915 virtual function.
4916 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
4917 virtual function.
4918 * icf.cc (get_section_contents): Inline merge sections only when
4919 target allows it.
4920
3cac54d2
RW
49212010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4922
4923 * configure: Regenerate.
4924
2904037a
ILT
49252010-09-17 Ian Lance Taylor <iant@google.com>
4926
4927 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
4928 * testsuite/Makefile.am (memory_test.o): New target.
4929 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
4930 memory_test.t.
4931 * testsuite/Makefile.in: Rebuild.
2904037a 4932
bca7fb63
DK
49332010-09-17 Doug Kwan <dougkwan@google.com>
4934
4935 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
4936 defintion if relocation uses GOT entries of the symbol.
4937 * testsuite/icf_safe_test.sh: Fix test.
4938 * testsuite/icf_safe_so_test.sh: Fix test.
4939
4ef28648
CC
49402010-09-16 Cary Coutant <ccoutant@google.com>
4941
4942 * script_sections.cc (class Memory_region): Remove "NULL" from
4943 vector initializations.
4944
793990de
CC
49452010-09-15 Cary Coutant <ccoutant@google.com>
4946
4947 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
4948 Resolve forwarding symbols.
4949
81e015e2
DK
49502010-09-15 Doug Kwan <dougkwan@google.com>
4951
4952 * gold/testsuite/script_test_3.t: Add ARM special sections.
4953 * gold/testsuite/script_test_4.t: Same.
4954 * gold/testsuite/script_test_5.t: Same.
4955 * gold/testsuite/script_test_6.t: Same.
4956 * gold/testsuite/script_test_7.t: Same.
4957 * gold/testsuite/script_test_7.t: Same.
4958 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
4959
36171d64
CC
49602010-09-14 Cary Coutant <ccoutant@google.com>
4961
4962 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
4963 (Target_x86_64::Relocate::relocate_tls): Replace check for
4964 saw_tls_block_reloc_ with test for executable section.
4965
d89051bd
CC
49662010-09-12 Cary Coutant <ccoutant@google.com>
4967
4968 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
4969 position-independent executables to shared libraries need dynamic
4970 relocations.
4971 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
4972 position-independent executables.
4973 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
4974 * testsuite/Makefile.in: Regenerate.
4975
fca41f0f
NC
49762010-09-10 Nick Clifton <nickc@redhat.com>
4977
4978 PR gold/11997
4979 * testsuite/memory_test.t: Discard any sections that are not
4980 needed.
4981
6695e4b3
L
49822010-09-09 H.J. Lu <hongjiu.lu@intel.com>
4983
4984 PR gold/11996
4985 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
4986 "This::" to work around a bug in gcc 4.2.
4987
4988 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
4989
0f72bf6f
RÁE
49902010-09-09 Rafael Espindola <espindola@google.com>
4991
4992 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
4993 sections with different PF_X flags in the same segment.
4994 (Layout::find_first_load_seg): Search all segments to find the first
4995 one.
4996 * options.h (rosegment): New.
4997
49982010-09-08 Rafael Espindola <espindola@google.com>
a6577478 4999
05a79166 5000 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 5001
aa98ff75
DK
50022010-09-08 Doug Kwan <dougkwan@google.com>
5003
5004 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
5005 (Arm_relobj::do_relocate_sections): Add new parameter for output
5006 file to match the parent.
5007 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
5008 of local symbols instead of input values. Update code to track
5009 changes in gold::relocate_section.
5010 * object.cc (Sized_relobj::compute_final_local_value): New methods.
5011 (Sized_relobj::compute_final_local_value_internal): New methods.
5012 (Sized_relobj::do_finalize_local_symbols): Move code from loop
5013 body into private version of Sized_relobj::compute_final_local_value.
5014 Call the inline method.
5015 * object.h (Symbol_value::Symbol_value): Define destructor. Free
5016 merged symbol value if there is one.
5017 (Symbol_value::has_output_value): New method defintiion.
5018 (Sized_relobj::Compute_final_local_value_status): New enum type.
5019 (Sized_relobj::compute_final_local_value): New methods.
5020 (Sized_relobj::compute_final_local_value_internal): New methods.
5021 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
5022 and arm_cortex_a8.sh.
5023 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
5024 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
5025 New tests.
5026 * Makefile.in: Regenerate.
5027 * testsuite/arm_bl_out_of_range.s: Update test.
5028 * testsuite/thumb_bl_out_of_range.s: Ditto.
5029 * testsuite/thumb_blx_out_of_range.s: Ditto.
5030 * testsuite/arm_branch_out_of_range.sh: New file.
5031 * testsuite/arm_cortex_a8.sh: Ditto.
5032 * testsuite/arm_cortex_a8_b.s: Ditto.
5033 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
5034 * testsuite/arm_cortex_a8_b_local.s: Ditto.
5035 * testsuite/arm_cortex_a8_bl.s: Ditto.
5036 * testsuite/arm_cortex_a8_blx.s: Ditto.
5037 * testsuite/arm_cortex_a8_local.s: Ditto.
5038 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
5039 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
5040
05a79166
L
50412010-09-08 Rafael Espindola <espindola@google.com>
5042
5043 * Makefile.am (memory_test.stdout): Run readelf with -W.
5044 * Makefile.in: Regenerate.
5045 * testsuite/memory_test.sh: Make the regexps accept both 32 and
5046 64 bit output.
5047
33dbc701
RÁE
50482010-09-08 Rafael Espindola <espindola@google.com>
5049
5050 * script-sections.cc (Script_sections::add_memory_region): Convert
5051 field precision to int.
5052 * script.cc (script_set_section_region, script_set_section_region):
5053 Convert field precision to int.
5054
731ca54a
RÁE
50552010-09-08 Rafael Espindola <espindola@google.com>
5056
5057 * arm.cc (do_finalize_sections): Create the __exidx_start and
5058 __exdix_end symbols even when the section is missing.
5059
7f8cd844
NC
50602010-09-08 Nick Clifton <nickc@redhat.com>
5061
5062 * README: Remove claim that MEMORY is not supported.
5063 * expression.cc (script_exp_function_origin)
5064 (script_exp_function_length): Move from here to ...
5065 * script.cc: ... here.
5066 (script_set_section_region, script_add_memory)
5067 (script_parse_memory_attr, script_include_directive): New
5068 functions.
5069 * script-sections.cc
5070 (class Memory_region): New class.
5071 (class Output_section_definition): Add set_memory_region,
5072 set_section_vma, set_section_lma and get_section_name methods.
5073 (class Script_Sections): Add add_memory_region,
5074 find_memory_region, find_memory_region_origin,
5075 find_memory_region_length and set_memory_region methods.
5076 Have set_section_addresses method walk the list of set memory
5077 regions.
5078 Extend the print methos to display memory regions.
5079 * script-sections.h: Add prototypes for new methods.
5080 Add enum for MEMORY region attributes.
5081 * yyscript.y: Add support for parsing MEMORY regions.
5082 * script-c.h: Add prototypes for new functions.
5083 * testsuite/Makefile.am: Add test of MEMORY region functionality.
5084 * testsuite/Makefile.in: Regenerate.
5085 * testsuite/memory_test.sh: New script.
5086 * testsuite/memory_test.s: New assembler source file.
5087 * testsuite/memory_test.t: New linker script.
5088
a4649286
DK
50892010-08-27 Doug Kwan <dougkwan@google.com>
5090
5091 * gold/resolve.cc (Symbol_table::should_override): Let a weak
5092 reference override an existing dynamic weak reference.
5093 * testsuite/Makefile.am: Add new test dyn_weak_ref.
5094 * testsuite/Makefile.in: Regenerate.
5095 * testsuite/dyn_weak_ref.sh: New file.
5096 * testsuite/dyn_weak_ref_1.c: Ditto.
5097 * testsuite/dyn_weak_ref_2.c: Ditto.
5098
b56648ad
ILT
50992010-08-27 Ian Lance Taylor <iant@google.com>
5100
5101 * incremental.h (class Incremental_input_entry): Add virtual
5102 destructor.
5103
809313cb
ILT
51042010-08-27 Ian Lance Taylor <iant@google.com>
5105
5106 * testsuite/start_lib_test_3.c: Mark t3 as used.
5107
11e32464
NC
51082010-08-27 Nick Clifton <nickc@redhat.com>
5109
5110 * options.cc (version_script): Fix small typo in previous
5111 whitespace tidyup.
5112
ca09d69a
NC
51132010-08-25 Nick Clifton <nickc@redhat.com>
5114
5115 * archive.cc: Formatting fixes: Remove whitespace between
5116 typename and following asterisk. Remove whitespace between
5117 function name and opening parenthesis.
5118 * archive.h: Likewise.
5119 * arm.cc: Likewise.
5120 * attributes.cc: Likewise.
5121 * attributes.h: Likewise.
5122 * common.cc: Likewise.
5123 * copy-relocs.cc: Likewise.
5124 * dirsearch.h: Likewise.
5125 * dynobj.cc: Likewise.
5126 * ehframe.cc: Likewise.
5127 * ehframe.h: Likewise.
5128 * expression.cc: Likewise.
5129 * fileread.cc: Likewise.
5130 * fileread.h: Likewise.
5131 * gc.h: Likewise.
5132 * gold-threads.cc: Likewise.
5133 * gold.cc: Likewise.
5134 * i386.cc: Likewise.
5135 * icf.h: Likewise.
5136 * incremental-dump.cc: Likewise.
5137 * incremental.cc: Likewise.
5138 * layout.cc: Likewise.
5139 * layout.h: Likewise.
5140 * main.cc: Likewise.
5141 * merge.cc: Likewise.
5142 * merge.h: Likewise.
5143 * object.cc: Likewise.
5144 * object.h: Likewise.
5145 * options.cc: Likewise.
5146 * options.h: Likewise.
5147 * output.cc: Likewise.
5148 * output.h: Likewise.
5149 * plugin.cc: Likewise.
5150 * plugin.h: Likewise.
5151 * powerpc.cc: Likewise.
5152 * reloc.cc: Likewise.
5153 * script-c.h: Likewise.
5154 * script-sections.cc: Likewise.
5155 * script.cc: Likewise.
5156 * stringpool.cc: Likewise.
5157 * symtab.cc: Likewise.
5158 * symtab.h: Likewise.
5159 * target.cc: Likewise.
5160 * timer.cc: Likewise.
5161 * timer.h: Likewise.
5162 * version.cc: Likewise.
5163 * x86_64.cc: Likewise.
5164
b8fa8750
NC
51652010-08-24 Nick Clifton <nickc@redhat.com>
5166
5167 PR 11899
5168 * layout.cc (segment_precedes): Sort segments by their physical
5169 addresses, if they have been set.
5170
9919d93b
CC
51712010-08-23 Cary Coutant <ccoutant@google.com>
5172
5173 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
5174 symbols data.
5175 (Lib_group::include_member): Unlock object after deleting its
5176 symbols data.
5177 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
5178 the bug fixed here.
5179
97b4be1c
CC
51802010-08-19 Neil Vachharajani <nvachhar@google.com>
5181 Cary Coutant <ccoutant@google.com>
5182
5183 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
5184 constructor, and set_blocker.
5185 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
5186 readsyms_blocker_.
5187 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
5188 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
5189 * testsuite/Makefile.am (start_lib_test): New test case.
5190 * testsuite/Makefile.in: Regenerate.
5191 * testsuite/start_lib_test_main.c: New file.
5192 * testsuite/start_lib_test_1.c: New file.
5193 * testsuite/start_lib_test_2.c: New file.
5194 * testsuite/start_lib_test_3.c: New file.
5195
dd0b1884
ILT
51962010-08-19 Ian Lance Taylor <iant@google.com>
5197
5198 * Makefile.in: Rebuild with automake 1.11.1.
5199 * aclocal.m4: Likewise.
5200 * testsuite/Makefile.in: Likewise.
5201
7223e9ca
ILT
52022010-08-19 Ian Lance Taylor <iant@google.com>
5203
5204 PR 10893
5205 * i386.cc (class Output_data_plt_i386): Update declarations.
5206 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
5207 local_ifuncs_ fields.
5208 (Target_i386::do_plt_section_for_global): New function.
5209 (Target_i386::do_plt_section_for_local): New function.
5210 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
5211 parameter; change all callers. Initialize global_ifuncs_ and
5212 local_ifuncs_. If doing a static link define __rel_iplt_start and
5213 __rel_iplt_end.
5214 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
5215 (Output_data_plt_i386::add_local_ifunc_entry): New function.
5216 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
5217 symbols.
5218 (Target_i386::make_plt_section): New function, broken out of
5219 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
5220 (Target_i386::make_plt_entry): Call make_plt_section.
5221 (Target_i386::make_local_ifunc_plt_entry): New function.
5222 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
5223 (Target_i386::Scan::local): Handle IFUNC symbols. Add
5224 R_386_IRELATIVE to switch.
5225 (Target_i386::Scan::global): Likewise.
5226 (Target_i386::Relocate::relocate): Likewise.
5227 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
5228 switch.
5229 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
5230 (Target_x86_64::do_plt_section_for_global): New function.
5231 (Target_x86_64::do_plt_section_for_local): New function.
5232 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
5233 parameter; change all callers. If doing a static link define
5234 __rela_iplt_start and __rela_iplt_end.
5235 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
5236 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
5237 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
5238 to point to .plt.
5239 (Target_x86_64::make_local_ifunc_plt_entry): New function.
5240 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
5241 switch.
5242 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
5243 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
5244 R_X86_64_IRELATIVE to switch.
5245 (Target_x86_64::Scan::global): Likewise.
5246 (Target_x86_64::Relocate::relocate): Likewise.
5247 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
5248 switch.
5249 * target.h (class Target): Add plt_section_for_global and
5250 plt_section_for_local functions. Add do_plt_section_for_global
5251 and do_plt_section_for_local virtual functions.
5252 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
5253 clarifying comments.
5254 (Symbol::use_plt_offset): Handle IFUNC symbol.
5255 * object.cc (Sized_relobj::Sized_relobj): Initialize
5256 local_plt_offsets_.
5257 (Sized_relobj::local_has_plt_offset): New function.
5258 (Sized_relobj::local_plt_offset): New function.
5259 (Sized_relobj::set_local_plt_offset): New function.
5260 (Sized_relobj::do_count): Handle IFUNC symbol.
5261 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
5262 a bit away from input_shndx_ field. Add set_is_func_symbol and
5263 is_ifunc_symbol functions.
5264 (class Sized_relobj): Update declarations. Remove Tls_got_entry
5265 and Local_tls_got_offsets. Define Local_plt_offsets. Add
5266 local_plt_offsets_ field.
5267 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
5268 * output.h (class Output_section_data): Add non-const
5269 output_section function.
5270 (class Output_data_got): Update declarations.
5271 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
5272 Add use_plt_offset parameter to global and local constructors.
5273 Change all callers. Change local_sym_index_ field to 31 bits.
5274 Change GSYM_CODE and CONSTANT_CODE accordingly.
5275 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
5276 doing a static link don't set sh_link field.
5277 (Output_data_got::Got_entry::write): Use PLT offset if
5278 appropriate.
5279 (Output_data_got::add_global_plt): New function.
5280 (Output_data_got::add_local_plt): New function.
5281 * target-reloc.h (relocate_section): Handle IFUNC symbol.
5282 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
5283 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
5284 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
5285 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
5286 IFUNC conditional.
5287 * testsuite/ifunc-sel.h: New file.
5288 * testsuite/ifuncmain1.c: New file.
5289 * testsuite/ifuncmain1vis.c: New file.
5290 * testsuite/ifuncmod1.c: New file.
5291 * testsuite/ifuncdep2.c: New file.
5292 * testsuite/ifuncmain2.c: New file.
5293 * testsuite/ifuncmain3.c: New file.
5294 * testsuite/ifuncmod3.c: New file.
5295 * testsuite/ifuncmain4.c: New file.
5296 * testsuite/ifuncmain5.c: New file.
5297 * testsuite/ifuncmod5.c: New file.
5298 * testsuite/ifuncmain6pie.c: New file.
5299 * testsuite/ifuncmod6.c: New file.
5300 * testsuite/ifuncmain7.c: New file.
5301 * configure, testsuite/Makefile.in: Rebuild.
5302
56f75c03
ILT
53032010-08-18 Ian Lance Taylor <iant@google.com>
5304
5305 * incremental.cc
5306 (Output_section_incremental_inputs::write_input_files): Add cast
5307 to avoid signed/unsigned comparison warning.
5308 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5309
55455f89
CC
53102010-08-12 Cary Coutant <ccoutant@google.com>
5311
5312 * common.cc (Sort_commons::operator()): Remove unnecessary code.
5313
e2054bcb
ILT
53142010-08-13 Ian Lance Taylor <iant@google.com>
5315
5316 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
5317
74f67560
DK
53182010-08-12 Cary Coutant <ccoutant@google.com>
5319 Doug Kwan <dougkwan@google.com>
5320
5321 * resolve.cc (Symbol_table::should_override): When a weak dynamic
5322 defintion overrides non-weak undef, remember that the original undef
5323 is not weak.
5324 * symtab.cc (Symbol_table::sized_write_global): For undef without
5325 an original weak binding, set binding to global in output.
5326 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
5327 * testsuite/Makefile.in: Regenerate.
5328 * testsuite/strong_ref_weak_def.sh: New file.
5329 * testsuite/strong_ref_weak_def_1.c: Ditto.
5330 * testsuite/strong_ref_weak_def_2.c: Ditto.
5331
d1238d12
CC
53322010-08-12 Cary Coutant <ccoutant@google.com>
5333
5334 * testsuite/incremental_test.sh: Rewrite.
5335 * testsuite/incremental_test_1.c: Rewrite.
5336 * testsuite/incremental_test_2.c: Rewrite.
5337
0e70b911
CC
53382010-08-12 Cary Coutant <ccoutant@google.com>
5339
5340 * arm.cc (Target_arm::got_size): Add const.
5341 (Target_arm::got_entry_count): New function.
5342 (Target_arm::plt_entry_count): New function.
5343 (Target_arm::first_plt_entry_offset): New function.
5344 (Target_arm::plt_entry_size): New function.
5345 (Output_data_plt_arm::entry_count): New function.
5346 (Output_data_plt_arm::first_plt_entry_offset): New function.
5347 (Output_data_plt_arm::get_plt_entry_size): New function.
5348 * i386.cc (Target_i386::got_size): Add const.
5349 (Target_i386::got_entry_count): New function.
5350 (Target_i386::plt_entry_count): New function.
5351 (Target_i386::first_plt_entry_offset): New function.
5352 (Target_i386::plt_entry_size): New function.
5353 (Output_data_plt_i386::entry_count): New function.
5354 (Output_data_plt_i386::first_plt_entry_offset): New function.
5355 (Output_data_plt_i386::get_plt_entry_size): New function.
5356 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
5357 find_incremental_inputs_sections. Dump incremental_got_plt section.
5358 * incremental.cc: Include target.h.
5359 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
5360 parameter. Adjust all callers. Find incremental_got_plt section.
5361 (Incremental_inputs::create_data_sections): Create incremental_got_plt
5362 section.
5363 (Output_section_incremental_inputs::set_final_data_size): Calculate
5364 size of incremental_got_plt section.
5365 (Output_section_incremental_inputs::do_write): Write the
5366 incremental_got_plt section.
5367 (Got_plt_view_info): New struct.
5368 (Local_got_offset_visitor): New class.
5369 (Global_got_offset_visitor): New class.
5370 (Global_symbol_visitor_got_plt): New class.
5371 (Output_section_incremental_inputs::write_got_plt): New function.
5372 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
5373 Add parameter. Adjust all callers.
5374 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
5375 (Incremental_inputs::got_plt_section): New function.
5376 (Incremental_inputs::got_plt_section_): New data member.
5377 (Incremental_got_plt_reader): New class.
5378 * layout.cc (Layout::create_incremental_info_sections): Add the
5379 incremental_got_plt section.
5380 * object.h (Got_offset_list::get_list): New function.
5381 (Got offset_list::for_all_got_offsets): New function.
5382 (Sized_relobj::local_got_offset_list): New function.
5383 * powerpc.cc (Target_powerpc::got_size): Add const.
5384 (Target_powerpc::got_entry_count): New function.
5385 (Target_powerpc::plt_entry_count): New function.
5386 (Target_powerpc::first_plt_entry_offset): New function.
5387 (Target_powerpc::plt_entry_size): New function.
5388 (Output_data_plt_powerpc::entry_count): New function.
5389 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
5390 (Output_data_plt_powerpc::get_plt_entry_size): New function.
5391 * sparc.cc (Target_sparc::got_size): Add const.
5392 (Target_sparc::got_entry_count): New function.
5393 (Target_sparc::plt_entry_count): New function.
5394 (Target_sparc::first_plt_entry_offset): New function.
5395 (Target_sparc::plt_entry_size): New function.
5396 (Output_data_plt_sparc::entry_count): New function.
5397 (Output_data_plt_sparc::first_plt_entry_offset): New function.
5398 (Output_data_plt_sparc::get_plt_entry_size): New function.
5399 * symtab.h (Symbol::got_offset_list): New function.
5400 (Symbol_table::for_all_symbols): New function.
5401 * target.h (Sized_target::got_entry_count): New function.
5402 (Sized_target::plt_entry_count): New function.
5403 (Sized_target::plt_entry_size): New function.
5404 * x86_64.cc (Target_x86_64::got_size): Add const.
5405 (Target_x86_64::got_entry_count): New function.
5406 (Target_x86_64::plt_entry_count): New function.
5407 (Target_x86_64::first_plt_entry_offset): New function.
5408 (Target_x86_64::plt_entry_size): New function.
5409 (Output_data_plt_x86_64::entry_count): New function.
5410 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
5411 (Output_data_plt_x86_64::get_plt_entry_size): New function.
5412
09ec0418
CC
54132010-08-12 Cary Coutant <ccoutant@google.com>
5414
5415 * archive.cc: Include incremental.h.
5416 (Archive::Archive): Initialize incremental_info_.
5417 (Archive::include_member): Record archive members in incremental info.
5418 (Add_archive_symbols::run): Record begin and end of an archive in
5419 incremental info.
5420 (Lib_group::include_member): Record objects in incremental info.
5421 * archive.h (Incremental_archive_entry): Forward declaration.
5422 (Archive::set_incremental_info): New member function.
5423 (Archive::incremental_info): New member function.
5424 (Archive::Unused_symbol_iterator): New class.
5425 (Archive::unused_symbols_begin): New member function.
5426 (Archive::unused_symbols_end): New member function.
5427 (Archive::incremental_info_): New data member.
5428 * incremental-dump.cc (find_input_containing_global): New function.
5429 (dump_incremental_inputs): Dump new incremental info sections.
5430 * incremental.cc: Include symtab.h.
5431 (Output_section_incremental_inputs): New class.
5432 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
5433 new incremental info sections.
5434 (Sized_incremental_binary::do_check_inputs): Likewise.
5435 (Incremental_inputs::report_archive): Remove.
5436 (Incremental_inputs::report_archive_begin): New function.
5437 (Incremental_inputs::report_archive_end): New function.
5438 (Incremental_inputs::report_object): New function.
5439 (Incremental_inputs::finalize_inputs): Remove.
5440 (Incremental_inputs::report_input_section): New function.
5441 (Incremental_inputs::report_script): Rewrite.
5442 (Incremental_inputs::finalize): Do nothing but finalize string table.
5443 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
5444 (Incremental_inputs::sized_create_inputs_section_data): Remove.
5445 (Incremental_inputs::create_data_sections): New function.
5446 (Incremental_inputs::relocs_entsize): New function.
5447 (Output_section_incremental_inputs::set_final_data_size): New function.
5448 (Output_section_incremental_inputs::do_write): New function.
5449 (Output_section_incremental_inputs::write_header): New function.
5450 (Output_section_incremental_inputs::write_input_files): New function.
5451 (Output_section_incremental_inputs::write_info_blocks): New function.
5452 (Output_section_incremental_inputs::write_symtab): New function.
5453 * incremental.h (Incremental_script_entry): Forward declaration.
5454 (Incremental_object_entry): Forward declaration.
5455 (Incremental_archive_entry): Forward declaration.
5456 (Incremental_inputs): Forward declaration.
5457 (Incremental_inputs_header_data): Remove.
5458 (Incremental_inputs_header): Remove.
5459 (Incremental_inputs_header_write): Remove.
5460 (Incremental_inputs_entry_data): Remove.
5461 (Incremental_inputs_entry): Remove.
5462 (Incremental_inputs_entry_write): Remove.
5463 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
5464 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
5465 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
5466 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
5467 Likewise.
5468 (Incremental_input_entry): New class.
5469 (Incremental_script_entry): New class.
5470 (Incremental_object_entry): New class.
5471 (Incremental_archive_entry): New class.
5472 (Incremental_inputs::Incremental_inputs): Initialize new data members.
5473 (Incremental_inputs::report_inputs): Remove.
5474 (Incremental_inputs::report_archive): Remove.
5475 (Incremental_inputs::report_archive_begin): New function.
5476 (Incremental_inputs::report_archive_end): New function.
5477 (Incremental_inputs::report_object): Change prototype.
5478 (Incremental_inputs::report_input_section): New function.
5479 (Incremental_inputs::report_script): Change prototype.
5480 (Incremental_inputs::get_reloc_count): New function.
5481 (Incremental_inputs::set_reloc_count): New function.
5482 (Incremental_inputs::create_data_sections): New function.
5483 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
5484 (Incremental_inputs::inputs_section): New function.
5485 (Incremental_inputs::symtab_section): New function.
5486 (Incremental_inputs::relocs_section): New function.
5487 (Incremental_inputs::get_stringpool): Add const.
5488 (Incremental_inputs::command_line): Add const.
5489 (Incremental_inputs::inputs): Remove.
5490 (Incremental_inputs::command_line_key): New function.
5491 (Incremental_inputs::input_file_count): New function.
5492 (Incremental_inputs::input_files): New function.
5493 (Incremental_inputs::relocs_entsize): New function.
5494 (Incremental_inputs::sized_create_inputs_section_data): Remove.
5495 (Incremental_inputs::finalize_inputs): Remove.
5496 (Incremental_inputs::Input_info): Remove.
5497 (Incremental_inputs::lock_): Remove.
5498 (Incremental_inputs::inputs_): Change type.
5499 (Incremental_inputs::inputs_map_): Remove.
5500 (Incremental_inputs::current_object_entry_): New data member.
5501 (Incremental_inputs::inputs_section_): New data member.
5502 (Incremental_inputs::symtab_section_): New data member.
5503 (Incremental_inputs::relocs_section_): New data member.
5504 (Incremental_inputs::reloc_count_): New data member.
5505 (Incremental_inputs_reader): New class.
5506 (Incremental_symtab_reader): New class.
5507 (Incremental_relocs_reader): New class.
5508 * layout.cc (Layout::finalize): Move finalization of incremental info
5509 and creation of incremental info sections to follow finalization of
5510 symbol table. Set offsets for postprocessing sections.
5511 (Layout::create_incremental_info_sections): Call
5512 Incremental_inputs::create_data_sections. Add incremental symtab
5513 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
5514 sections to layout after input sections.
5515 * layout.h (struct Timespec): Forward declaration.
5516 (Layout::incremental_inputs): Add const.
5517 (Layout::create_incremental_info_sections): Add parameter.
5518 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
5519 * object.cc: Include incremental.h.
5520 (Relobj::finalize_incremental_relocs): New function.
5521 (Sized_relobj::do_layout): Record input sections in incremental info.
5522 * object.h (Object::output_section): New function.
5523 (Object::output_section_offset): Moved from Relobj.
5524 (Object::get_incremental_reloc_base): New function.
5525 (Object::get_incremental_reloc_count): New function.
5526 (Object::do_output_section): New function.
5527 (Object::do_output_section_offset): Moved from Relobj.
5528 (Object::do_get_incremental_reloc_base): New function.
5529 (Object::do_get_incremental_reloc_count): New function.
5530 (Object::Object): Initialize new data members.
5531 (Relobj::output_section): Renamed do_output_section and moved to
5532 protected.
5533 (Relobj::output_section_offset): Moved to Object.
5534 (Relobj::do_get_incremental_reloc_base): New function.
5535 (Relobj::do_get_incremental_reloc_count): New function.
5536 (Relobj::allocate_incremental_reloc_counts): New function.
5537 (Relobj::count_incremental_reloc): New function.
5538 (Relobj::finalize_incremental_relocs): New function.
5539 (Relobj::next_incremental_reloc_index): New function.
5540 (Relobj::reloc_counts_): New data member.
5541 (Relobj::reloc_bases_): New data member.
5542 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
5543 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
5544 (Sized_relobj::incremental_relocs_scan): New function.
5545 (Sized_relobj::incremental_relocs_scan_reltype): New function.
5546 (Sized_relobj::incremental_relocs_write): New function.
5547 (Sized_relobj::incremental_relocs_write_reltype): New function.
5548 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
5549 incremental link.
5550 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
5551 archives and object files elsewhere.
5552 (Add_symbols::run): Report object files here.
5553 (Finish_group::run): Report end of archive at end of group.
5554 * reloc.cc: Include layout.h, incremental.h.
5555 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
5556 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
5557 (Sized_relobj::incremental_relocs_scan): New function.
5558 (Sized_relobj::incremental_relocs_scan_reltype): New function.
5559 (Sized_relobj::do_relocate_sections): Write incremental relocations.
5560 (Sized_relobj::incremental_relocs_write): New function.
5561 (Sized_relobj::incremental_relocs_write_reltype): New function.
5562 * script.cc (read_input_script): Rewrite test for incremental link.
5563 Change call to Incremental_inputs::report_script.
5564 * symtab.h (Symbol_table::first_global_index): New function.
5565 (Symbol_table::output_count): New function.
5566
ce0d1972
DK
55672010-08-12 Doug Kwan <dougkwan@google.com>
5568
5569 * arm.cc (Target_arm::merge_object_attributes): Check command line
5570 options --no-wchar-size-warning and --no-enum-size-warning.
5571 * options.h (General_options): Add ld-compatible options
5572 --no-enum-size-warning and --no-wchar-size-warning.
5573
6e5710ce
ILT
55742010-08-04 Ian Lance Taylor <iant@google.com>
5575
5576 * x86_64.cc (Target_x86_64::Scan::local): Use
5577 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
5578 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
5579 (Target_x86_64::Scan::global): Likewise.
5580 (Target_x86_64::Relocate::relocate): Likewise.
5581 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
5582 Likewise.
5583
fef830db
CC
55842010-08-03 Cary Coutant <ccoutant@google.com>
5585
5586 * merge.cc (Output_merge_string::do_add_input_section): Count strings
5587 to reserve space in merged_strings vector. Keep total input size
5588 for stats.
5589 (Output_merge_string::do_print_merge_stats): Print total input size.
5590 * merge.h (Output_merge_string): Add input_size_ field.
5591 * stringpool.cc (Stringpool_template::string_length): Move
5592 implementations out of Stringpool_template class and place in
5593 stringpool.h.
5594 * stringpool.h (string_length): Move out of Stringpool_template.
5595
1e3811b0
ILT
55962010-08-03 Ian Lance Taylor <iant@google.com>
5597
5598 PR 11712
5599 * layout.cc (relaxation_loop_body): If address of load segment is
5600 set, adjust address to include headers if possible.
5601
7af0c620
ILT
56022010-08-03 Ian Lance Taylor <iant@google.com>
5603
5604 * version.cc (version_string): Bump to 1.10.
5605
22f0da72
ILT
56062010-08-03 Ian Lance Taylor <iant@google.com>
5607
5608 PR 11805
5609 * layout.h (enum Output_section_order): Define.
5610 (class Layout): Update declarations.
5611 * layout.cc (Layout::get_output_section): Add order parameter.
5612 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
5613 is_first_non_relro parameters. Change all callers.
5614 (Layout::choose_output_section): Likewise.
5615 (Layout::add_output_section_data): Likewise.
5616 (Layout::make_output_section): Likewise. Set order.
5617 (Layout::default_section_order): New function.
5618 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
5619 * output.cc (Output_section::Output_section): Initialize order_.
5620 Don't initialize deleted fields.
5621 (Output_segment::Output_segment): Don't initialize deleted
5622 fields.
5623 (Output_segment::add_output_section_to_load): New function
5624 replacing add_output_section. Change all callers to call this or
5625 add_output_section_to_nonload.
5626 (Output_segment::add_output_section_to_nonload): New function.
5627 (Output_segment::remove_output_section): Rewrite.
5628 (Output_segment::add_initial_output_data): Likewise.
5629 (Output_segment::has_any_data_sections): Likewise.
5630 (Output_segment::is_first_section_relro): Likewise.
5631 (Output_segment::maximum_alignment): Likewise.
5632 (Output_segment::has_dynamic_reloc): New function replacing
5633 dynamic_reloc_count. Change all callers.
5634 (Output_segment::has_dynamic_reloc_list): New function replacing
5635 dynamic_reloc_count_list. Change all callers.
5636 (Output_segment::set_section_addresses): Rewrite.
5637 (Output_segment::set_offset): Rewrite.
5638 (Output_segment::find_first_and_last_list): Remove.
5639 (Output_segment::set_tls_offsets): Rewrite.
5640 (Output_segment::first_section_load_address): Likewise.
5641 (Output_segment::output_section_count): Likewise.
5642 (Output_segment::section_with_lowest_load_address): Likewise.
5643 (Output_segment::write_section_headers): Likewise.
5644 (Output_segment::print_sections_to_map): Likewise.
5645 * output.h (class Output_data): Remove dynamic_reloc_count_
5646 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
5647 (Output_data::add_dynamic_reloc): Rewrite.
5648 (Output_data::has_dynamic_reloc): New function.
5649 (Output_data::dynamic_reloc_count): Remove.
5650 (class Output_section): Add order_ field. Remvoe is_relro_local_,
5651 is_last_relro_, is_first_non_relro_, is_interp_,
5652 is_dynamic_linker_section_ fields. Add order and set_order
5653 functions. Remove is_relro_local, set_is_relro_local,
5654 is_last_relro, set_is_last_relro, is_first_non_relro,
5655 set_is_first_non_relro functions, is_interp, set_is_interp,
5656 is_dynamic_linker_section, and set_is_dynamic_linker_section
5657 functions.
5658 (class Output_segment): Change Output_data_list from std::list to
5659 std:;vector. Add output_lists_ field. Remove output_data_ and
5660 output_bss_ fields. Update declarations.
5661
3ff2ccb0
ILT
56622010-08-02 Ian Lance Taylor <iant@google.com>
5663
5664 * arm.cc (Target_arm::gc_process_relocs): Use typename.
5665 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
5666 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
5667
88a4108b
ILT
56682010-08-02 Ian Lance Taylor <iant@google.com>
5669
5670 PR 11855
5671 * script.cc (Script_options::Script_options): Initialize
5672 symbol_definitions_ and symbol_references_.
5673 (Script_options::add_symbol_assignment): Update
5674 symbol_definitions_ and symbol_references_.
5675 (Script_options::add_symbol_reference): New function.
5676 (script_symbol): New function.
5677 * script.h (class Script_options): Add symbol_definitions_ and
5678 symbol_references_ fields.
5679 (Script_options::referenced_const_iterator): New type.
5680 (Script_options::referenced_begin): New function.
5681 (Script_options::referenced_end): New function.
5682 (Script_options::is_referenced): New function.
5683 (Script_options::any_unreferenced): New function.
5684 * script-c.h (script_symbol): Declare.
5685 * yyscript.y (exp): Call script_symbol.
5686 * symtab.cc: Include "script.h".
5687 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
5688 Change all callers. Check symbols referenced by scripts.
5689 (Symbol_table::add_undefined_symbols_from_command_line): Add
5690 layout parameter. Change all callers.
5691 (Symbol_table::do_add_undefined_symbols_from_command_line):
5692 Likewise. Break out loop body. Check symbols referenced by
5693 scripts.
5694 (Symbol_table::add_undefined_symbol_from_command_line): New
5695 function broken out of
5696 do_add_undefined_symbols_from_command_line.
5697 * symtab.h (class Symbol_table): Update declarations.
5698 * archive.cc: Include "layout.h".
5699 (Archive::should_include_member): Add layout parameter. Change
5700 all callers. Check for symbol mentioned in expression.
5701 * archive.h (class Archive): Update declaration.
5702 * object.cc (Sized_relobj::do_should_include_member): Add layout
5703 parameter.
5704 * object.h (Object::should_include_member): Add layout parameter.
5705 Change all callers.
5706 (Object::do_should_include_member): Add layout parameter.
5707 (class Sized_relobj): Update declaration.
5708 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
5709 parameter.
5710 * dynobj.h (class Sized_dynobj): Update declaration.
5711 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
5712 layout parameter.
5713 * plugin.h (class Sized_pluginobj): Update declaration.
5714
5f1ab67a
ILT
57152010-08-02 Ian Lance Taylor <iant@google.com>
5716
5717 PR 11866
5718 * output.cc (Output_segment::set_offset): Search for the first and
5719 last sections rather than assuming that the list is in order.
5720 (Output_segment::find_first_and_last_list): New function.
5721 * output.h (class Output_segment): Update declarations.
5722 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
5723 (relro_strip_test_SOURCES): New variable.
5724 (relro_strip_test_DEPENDENCIES): New variable.
5725 (relro_strip_test_LDFLAGS): New variable.
5726 (relro_strip_test_LDADD): New variable.
5727 (relro_strip_test.so): New target.
5728
a8df5856
ILT
57292010-08-02 Ian Lance Taylor <iant@google.com>
5730
5731 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
5732 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
5733 (Target_i386::got_tlsdesc_section): New function.
5734 (Target_i386::got_section): Create space for GOT entries for
5735 TLSDESC relocations.
5736 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
5737 R_386_TLS_GOTDESC.
5738 (Target_i386::Scan::global): Likewise.
5739 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
5740 using TLSDESC GOT.
5741 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
5742 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
5743 (Target_x86_64::got_tlsdesc_section): New function.
5744 (Target_x86_64::got_section): Create space for GOT entries for
5745 TLSDESC relocations.
5746 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
5747 R_386_TLS_GOTDESC.
5748 (Target_x86_64::Scan::global): Likewise.
5749 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
5750 using TLSDESC GOT.
5751
0c10a0a6
ILT
57522010-08-02 Ian Lance Taylor <iant@google.com>
5753
5754 * testsuite/final_layout.sh: Use dc to convert from hex to
5755 decimal.
5756
41cbeecc
ST
57572010-07-29 Sriraman Tallam <tmsriram@google.com>
5758
5759 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
5760 paramter to the call to gold::gc_process_relocs.
5761 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
5762 paramter to the call to gold::gc_process_relocs.
5763 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
5764 parameter to the call to gold::gc_process_relocs.
5765 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
5766 template parameter to the call to gold::gc_process_relocs.
5767 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
5768 paramter to the call to gold::gc_process_relocs.
5769 * gc.h (get_embedded_addend_size): New function.
5770 (gc_process_relocs): Save the size of the reloc for use by ICF.
5771 * icf.cc (get_section_contents): Get the addend from the text section
5772 for SHT_REL relocation sections.
5773 * icf.h (Icf::Reloc_addend_size_info): New typedef.
5774 (Icf::Reloc_info): Add new member reloc_addend_size_info.
5775 * int_encoding.h (read_from_pointer): New overloaded function.
5776 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
5777 * testsuite/icf_sht_rel_addend_test.sh: New file.
5778 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
5779 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
5780
6ea55b82
RW
57812010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5782
5783 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
5784 * Makefile.in: Regenerate.
5785 * testsuite/Makefile.in: Regenerate.
5786
9691462b
ILT
57872010-07-27 Jeffrey Yasskin <jyasskin@google.com>
5788
5789 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
5790 * gold/testsuite/debug_msg.cc: Likewise.
5791 * gold/testsuite/odr_violation1.cc
5792 * gold/testsuite/odr_violation2.cc
5793
76897331
CC
57942010-07-21 Cary Coutant <ccoutant@google.com>
5795
5796 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
5797 string, and length fields.
5798 (Output_merge_string::Merged_strings_list): New type.
5799 (Output_merge_string::Merged_strings_lists): New typedef.
5800 (Output_merge_string): Replace merged_strings_ with
5801 merged_strings_lists_.
5802 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
5803 Merged_strings_list per input object and section. Don't store pointer
5804 to the string. Don't store length with each merged string entry.
5805 (Output_merge_string::finalize_merged_data): Loop over list of merged
5806 strings lists. Recompute length of each merged string.
5807
78384e8f
CC
58082010-07-15 Cary Coutant <ccoutant@google.com>
5809
5810 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
5811 here.
5812
783659f9
ILT
58132010-07-14 Ian Lance Taylor <iant@google.com>
5814
5815 * descriptors.cc (Descriptors::open): Report correct name in error
5816 message.
5817
131687b4
DK
58182010-07-13 Doug Kwan <dougkwan@google.com>
5819
5820 * arm.cc (Arm_input_section::Arm_input_section): For a
5821 SHT_ARM_EXIDX section, always keeps the input sections.
5822 (Arm_input_section::set_exidx_section_link): New method.
5823 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
5824 has_errors_ to false.
5825 (Arm_exidx_input_section::has_errors,
5826 Arm_exidx_input_section::set_has_errors): New methods.
5827 (Arm_exidx_input_section::has_errors_): New data member.
5828 (Arm_relobj::get_exidx_shndx_list): New method.
5829 (Arm_output_section::append_text_sections_to_list): Do not skip
5830 section without SHF_EXECINSTR.
5831 (Arm_output_section::fix_exidx_coverage): Skip input sections with
5832 errors.
2e702c99 5833 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
5834 section header. Make error messages more verbose. Check for
5835 a non-executable section linked to an EXIDX section.
5836 (Arm_relobj::do_read_symbols): Remove error checking, which has been
5837 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
5838 check that there is no deferred EXIDX section if we exit early.
5839 Instead of not making an EXIDX section in case of an error, make one
5840 and set the has_errors flag of it.
5841 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
5842 in a relocatable link.
5843 (Target_arm::do_relax): Look for the EXIDX output section instead of
5844 assuming that it is called .ARM.exidx.
2e702c99 5845 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
5846 section list. Do not check for SHF_EXECINSTR section flags but
5847 skip any input section with errors.
5848 * output.cc (Output_section::Output_section): Initialize
5849 always_keeps_input_sections_ to false.
5850 (Output_section::add_input_section): Check for
5851 always_keeps_input_sections_.
5852 * output.h (Output_section::always_keeps_input_sections,
5853 Output_section::set_always_keeps_input_sections): New methods.
5854 (Output_section::always_keeps_input_sections): New data member.
5855
69517287
RÁE
58562010-07-13 Rafael Espindola <espindola@google.com>
5857
5858 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
5859 * fileread.h (Input_file): Add try_extra_search_path and find_file.
5860
82742395
ILT
58612010-07-13 Philip Herron <herron.philip@googlemail.com>
5862 Ian Lance Taylor <iant@google.com>
5863
5864 * output.h (Output_section_lookup_maps::add_merge_section):
5865 Correct check of whether value was inserted.
5866 (Output_section_lookup_maps::add_merge_input_section): Likewise.
5867 (Output_section_lookup_maps::add_relaxed_input_section):
5868 Likewise.
5869 * arm.cc (Target_arm::got_section): Remove used local os.
5870 * i386.cc (Target_i386::got_section): Likewise.
5871 * x86_64.cc (Target_x86_64::got_section): Likewise.
5872 * sparc.cc (Target_sparc::got_section): Likewise.
5873 (Target_sparc::relocate): Remove unused local have_got_offset.
5874 * powerpc.cc (Target_powerpc::relocate): Likewise.
5875
f2d707b5
ILT
58762010-07-13 Ian Lance Taylor <iant@google.com>
5877
241531d6
ILT
5878 * compressed_output.cc (zlib_decompress): Fix signature in
5879 !HAVE_ZLIB_H case.
5880
f2d707b5
ILT
5881 * archive.cc (Archive::include_member): Unlock an external member
5882 of a thin archive. Don't bother to delete an object we know is
5883 NULL.
5884
a2e47362
CC
58852010-07-12 Cary Coutant <ccoutant@google.com>
5886
5887 * compressed_output.cc (zlib_decompress): New function.
5888 (get_uncompressed_size): New function.
5889 (decompress_input_section): New function.
5890 * compressed_output.h (get_uncompressed_size): New function.
5891 (decompress_input_section): New function.
5892 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
5893 Handle compressed debug sections.
5894 * layout.cc (is_compressed_debug_section): New function.
5895 (Layout::output_section_name): Map compressed section names to
5896 canonical names.
5897 * layout.h (is_compressed_debug_section): New function.
5898 (is_debug_info_section): Recognize compressed debug sections.
5899 * merge.cc: Include compressed_output.h.
5900 (Output_merge_data::do_add_input_section): Handle compressed
5901 debug sections.
5902 (Output_merge_string::do_add_input_section): Handle compressed
5903 debug sections.
5904 * object.cc: Include compressed_output.h.
5905 (Sized_relobj::Sized_relobj): Initialize new data members.
5906 (build_compressed_section_map): New function.
5907 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
5908 * object.h (Object::section_is_compressed): New method.
5909 (Object::do_section_is_compressed): New method.
5910 (Sized_relobj::Compressed_section_map): New type.
5911 (Sized_relobj::do_section_is_compressed): New method.
5912 (Sized_relobj::compressed_sections_): New data member.
5913 * output.cc (Output_section::add_input_section): Handle compressed
5914 debug sections.
5915 * reloc.cc: Include compressed_output.h.
5916 (Sized_relobj::write_sections): Handle compressed debug sections.
5917
ce279a62
CC
59182010-07-08 Cary Coutant <ccoutant@google.com>
5919
5920 * resolve.cc (Symbol_table::resolve): Remember whether undef was
5921 weak when resolving to a dynamic def.
5922 (Symbol_table::should_override): Add adjust_dyndef flag; set it
5923 for weak undef/dynamic def cases. Adjust callers.
5924 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
5925 undef_binding_weak_.
5926 (Symbol_table::sized_write_globals): Adjust symbol binding.
5927 (Symbol_table::sized_write_symbol): Add binding parameter.
5928 * symtab.h (Symbol::set_undef_binding): New method.
5929 (Symbol::is_undef_binding_weak): New method.
5930 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
5931 (Symbol_table::should_override): Add new parameter.
5932 (Symbol_table::sized_write_symbol): Add new parameter.
5933
5934 * testsuite/weak_undef_file1.cc: Add new test case.
5935 * testsuite/weak_undef_file2.cc: Fix header comment.
5936 * testsuite/weak_undef_test.cc: Add new test case.
5937
b2286c10
DK
59382010-06-29 Doug Kwan <dougkwan@google.com>
5939
5940 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
5941 Initialize USE_SYMBOL_.
5942 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
5943 definition.
5944 (Arm_reloc_property::uses_symbol_): New data member declaration.
5945 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
5946 uses symbol value and symbol is undefined but not weakly undefined.
5947
4802450a
RÁE
59482010-06-28 Rafael Espindola <espindola@google.com>
5949
5950 * plugin.cc (Plugin::load): Use dlerror.
5951
e5ca47ba
ILT
59522010-06-26 Jeffrey Yaskin <jyasskin@google.com>
5953
5954 * symtab.cc (detect_odr_violations): When reporting an ODR
5955 violation, report an object where the symbol is defined.
5956
8a75a161
DK
59572010-06-25 Doug Kwan <dougkwan@google.com>
5958
5959 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
5960 (Target_arm::section_may_have_icf_unsafe_pointers): New method
5961 definition.
5962 (Target_arm::Scan::local_reloc_may_be_function_pointer,
5963 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
5964 target hook to detect function points.
5965 (Target_arm::Scan::possible_function_pointer_reloc): New method.
5966 * icf.h (Icf::check_section_for_function_pointers): Change type of
5967 parameter SECTION_NAME to const reference to std::string. Use
5968 target hook to determine if section may have unsafe pointers.
5969 * target.h (Target::section_may_have_icf_unsafe_pointers): New
5970 method definition.
5971
42218b9f
RÁE
59722010-06-21 Rafael Espindola <espindola@google.com>
5973
5974 * fileread.cc (Input_file::find_fie): New
5975 (Input_file::open): Use Input_file::find_fie.
5976 * fileread.h (Input_file::find_fie): New
5977 * plugin.cc (set_extra_library_path): New.
5978 (Plugin::load): Add set_extra_library_path to the transfer vector.
5979 (Plugin_manager::set_extra_library_path): New.
5980 (Plugin_manager::add_input_file): Use the extra search path if set.
5981 (set_extra_library_path(): New.
5982 * plugin.h (Plugin_manager): Add set_extra_library_path and
5983 extra_search_path_.
5984
a0506cca
CC
59852010-06-19 Cary Coutant <ccoutant@google.com>
5986
5987 * layout.cc (gdb_sections): Add .debug_types.
5988 (lines_only_debug_sections): Likewise.
5989
6508b958
RÁE
59902010-06-18 Rafael Espindola <espindola@google.com>
5991
5992 * plugin.cc (add_input_file,add_input_library)
5993 (Plugin_manager::add_input_file): Make filename arguments const.
5994 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
5995 const.
5996
3e235302
DK
59972010-06-16 Doug Kwan <dougkwan@google.com>
5998
5999 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
6000 .ARM.attributes section if we have not merged any input
6001 attributes sections.
6002
106e8a6c
DK
60032010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6004
6005 * arm.cc: Allow combining objects with no EABI version
6006 information.
6007
91ff43fe
RÁE
60082010-06-15 Rafael Espindola <espindola@google.com>
6009
6010 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
6011
68ed838c
ILT
60122010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6013
6014 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
6015 (struct iovec): Correct !HAVE_READV definition.
6016
f3a2388f
CC
60172010-06-10 Cary Coutant <ccoutant@google.com>
6018
6019 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
6020 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
6021 reloc sections.
6022 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
6023
6024 PR 11683
6025 * symtab.h (Symbol::is_placeholder): New member function.
6026 * target-reloc.h (relocate_section): Check for placeholder symbols.
6027
6028 * testsuite/Makefile.am (plugin_test_8): New test.
6029 (plugin_test_9): New test.
6030 * testsuite/Makefile.in: Regenerate.
6031
e1df38aa
NC
60322010-06-09 Nick Clifton <nickc@redhat.com>
6033
6034 * yyscript.y (input_list_element): Allow strings prefixed with
6035 the '-' character. Treat these as libraries.
6036 * script.cc (script_add_library): New function. Adds a library
6037 specified by "-l<name>" found in an input script.
6038 * script-c.h: Add prototype for script_add_library.
6039
25bbe950
DK
60402010-06-07 Doug Kwan <dougkwan@google.com>
6041
6042 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
6043 Restrict stub-group size to be within long conditional branch
6044 range when working around cortex-A8 erratum.
6045
0f32ea4c
ILT
60462010-06-07 Damien Diederen <dd@crosstwine.com>
6047
6048 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
6049 #ifdef typo.
6050
8fe2a369
ST
60512010-06-03 Sriraman Tallam <tmsriram@google.com>
6052
6053 PR gold/11658
6054 * output.cc
6055 (Output_section::Input_section_sort_entry::compare_section_ordering):
6056 Change to return non-zero correctly.
6057 (Output_section::Input_section_sort_section_order_index_compare
6058 ::operator()): Change to fix ambiguity in comparisons.
6059
6e9ba2ca
ST
60602010-06-01 Sriraman Tallam <tmsriram@google.com>
6061
6062 * gold.h (is_wildcard_string): New function.
6063 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
6064 (Layout::layout_eh_frame): Ditto.
6065 (Layout::find_section_order_index): New method.
6066 (Layout::read_layout_from_file): New method.
6067 * layout.h (Layout::find_section_order_index): New method.
6068 (Layout::read_layout_from_file): New method.
6069 (Layout::input_section_position_): New private member.
6070 (Layout::input_section_glob_): New private member.
6071 * main.cc (main): Call read_layout_from_file here.
6072 * options.h (--section-ordering-file): New option.
6073 * output.cc (Output_section::input_section_order_specified_): New
6074 member.
6075 (Output_section::Output_section): Initialize new member.
6076 (Output_section::add_input_section): Add new parameter.
6077 Keep input sections when --section-ordering-file is used.
6078 (Output_section::set_final_data_size): Sort input sections when
6079 section ordering file is specified.
6080 (Output_section::Input_section_sort_entry): Add new parameter.
6081 Check sorting type.
6082 (Output_section::Input_section_sort_entry::compare_section_ordering):
6083 New method.
6084 (Output_section::Input_section_sort_compare::operator()): Change to
6085 consider section_order_index.
6086 (Output_section::Input_section_sort_init_fini_compare::operator()):
6087 Change to consider section_order_index.
6088 (Output_section::Input_section_sort_section_order_index_compare
6089 ::operator()): New method.
6090 (Output_section::sort_attached_input_sections): Change to sort
6091 according to section order when specified.
e1df38aa
NC
6092 (Output_section::add_input_section<32, true>): Add new parameter.
6093 (Output_section::add_input_section<64, true>): Add new parameter.
6094 (Output_section::add_input_section<32, false>): Add new parameter.
6095 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
6096 * output.h (Output_section::add_input_section): Add new parameter.
6097 (Output_section::input_section_order_specified): New
6098 method.
6099 (Output_section::set_input_section_order_specified): New method.
6100 (Input_section::Input_section): Initialize section_order_index_.
6101 (Input_section::section_order_index): New method.
6102 (Input_section::set_section_order_index): New method.
6103 (Input_section::section_order_index_): New member.
6104 (Input_section::Input_section_sort_section_order_index_compare): New
6105 struct.
6106 (Output_section::input_section_order_specified_): New member.
6107 * script-sections.cc (is_wildcard_string): Delete and move modified
6108 method to gold.h.
6109 (Output_section_element_input::Output_section_element_input): Modify
6110 call to is_wildcard_string.
6111 (Output_section_element_input::Input_section_pattern
6112 ::Input_section_pattern): Ditto.
6113 (Output_section_element_input::Output_section_element_input): Ditto.
6114 * testsuite/Makefile.am (final_layout): New test case.
6115 * testsuite/Makefile.in: Regenerate.
6116 * testsuite/final_layout.cc: New file.
6117 * testsuite/final_layout.sh: New file.
6118
3537c84b
RÁE
61192010-06-01 Rafael Espindola <espindola@google.com>
6120
6121 * plugin.cc (Plugin::load): Pass the output name to the plugin.
6122
105b6afd
RÁE
61232010-06-01 Rafael Espindola <espindola@google.com>
6124
6125 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
6126 visibility of symbols.
6127
29e11421
DK
61282010-05-27 Doug Kwan <dougkwan@google.com>
6129
6130 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
6131 from start of output section instead of address for a local symbol
6132 in a merged or relaxed section when doing a relocatable link.
6133
5e0f337e
RÁE
61342010-05-26 Rafael Espindola <espindola@google.com>
6135
703d02da 6136 PR 11604
5e0f337e
RÁE
6137 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
6138 adding sections the garbage collector removed.
6139 * gold/testsuite/Makefile.am: Add test.
6140 * gold/testsuite/Makefile.in: Regenerate.
6141 * gold/testsuite/plugin_test_7.sh: New.
6142 * gold/testsuite/plugin_test_7_1.c: New.
6143 * gold/testsuite/plugin_test_7_2.c: New.
6144
f4187277
RÁE
61452010-05-26 Rafael Espindola <espindola@google.com>
6146
6147 * script-sections.cc (Output_section_definition::set_section_addresses):
6148 Check for --section-start.
6149
5c388529
DK
61502010-05-26 Doug Kwan <dougkwan@google.com>
6151
6152 * arm.cc (Arm_scan_relocatable_relocs): New class.
6153 (Target_arm::relocate_special_relocatable): New method.
6154 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
6155 (Arm_relocate_functions::thumb_branch_common): Same.
6156 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
6157 instead of Default_scan_relocatable_relocs.
6158 * target-reloc.h (relocate_for_relocatable): Let target handle
6159 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
6160 * target.h (Sized_target::relocate_special_relocatable): New method.
6161
bca1c3ae
ILT
61622010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6163
6164 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
6165
0439c796
DK
61662010-05-23 Doug Kwan <dougkwan@google.com>
6167
6168 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
6169 instead of a cast.
6170 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
6171 with a direct branch, not a conditional branch, to a stub.
6172 * merge.cc (Output_merge_base::record_input_section): New method
6173 defintion.
6174 (Output_merge_data::do_add_input_section): Record input section if
6175 keeps-input-sections flag is set.
6176 (Output_merge_string::do_add_input_section): Ditto.
6177 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
6178 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
6179 INPUT_SECTIONS_.
6180 (Output_merge_base::keeps_input_sections,
6181 Output_merge_base::set_keeps_input_sections,
6182 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
6183 method definitions.
6184 (Output_merge_base::Input_sections): New type declaration.
6185 (Output_merge_base::input_sections_begin,
6186 Output_merge_base::input_sections_end,
6187 Output_merge_base::do_set_keeps_input_sections): New method definitions.
6188 (Output_merge_base::bool keeps_input_sections_,
6189 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
6190 Output_merge_base::input_sections_): New data members.
6191 (Output_merge_data::do_set_keeps_input_sections): New method
6192 defintion.
6193 (Output_merge_string::do_set_keeps_input_sections): Ditto.
6194 * output.cc (Output_section::Input_section::relobj): Move method
6195 defintion from class declaration to here and handle merge sections.
6196 (Output_section::Input_section::shndx): Ditto.
6197 (Output_section::Output_section): Remove initializations of removed
6198 data members and initialize new data member LOOKUP_MAPS_.
6199 (Output_section::add_input_section): Set keeps-input-sections flag
6200 for a newly created merge output section as appropriate. Adjust code
6201 to use Output_section_lookup_maps class.
6202 (Output_section::add_relaxed_input_section): Adjst code for lookup
6203 maps code refactoring.
2e702c99 6204 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
6205 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
6206 class. If adding input section to a newly created merge output
6207 section fails, remove the new merge section.
6208 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 6209 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 6210 (Output_section::find_merge_section): Ditto.
0439c796 6211 (Output_section::build_lookup_maps): New method defintion.
2e702c99 6212 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
6213 Output_section_lookup_maps class.
6214 (Output_section::get_input_sections): Export merge sections. Adjust
6215 code to use Output_section_lookup_maps class.
6216 (Output_section:::add_script_input_section): Adjust code to use
6217 Output_section_lookup_maps class. Update lookup maps for merge
6218 sections also.
6219 (Output_section::discard_states): Use Output_section_lookup_maps.
6220 (Output_section::restore_states): Same.
6221 * output.h (Merge_section_properties): Move class defintion out of
6222 Output_section.
6223 (Output_section_lookup_maps): New class.
6224 (Output_section::Input_section::is_merge_section): New method
6225 defintion.
6226 (Output_section::Input_section::relobj): Move defintion out of class
6227 defintion. Declare method only.
6228 (Output_section::Input_section::shndx): Ditto.
6229 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 6230 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
6231 (Output_section::Merge_section_by_properties_map,
6232 Output_section::Output_section_data_by_input_section_map,
6233 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
6234 Remove types.
2e702c99 6235 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
6236 KEEPS_INPUT_SECTIONS.
6237 (Output_section::build_lookup_maps): New method declaration.
6238 (Output_section::merge_section_map_,
6239 Output_section::merge_section_by_properties_map_,
6240 Output_section::relaxed_input_section_map_,
6241 Output_section::is_relaxed_input_section_map_valid_): Remove data
6242 members.
6243 (Output_section::lookup_maps_): New data member.
6244
76295588
L
62452010-05-21 Doug Kwan <dougkwan@google.com>
6246
6247 PR gold/11619
6248 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
6249 avoid a compilation error.
6250
d103a984
RÁE
62512010-05-19 Rafael Espindola <espindola@google.com>
6252
6253 * script-sections.cc (Output_section_definition::allocate_to_segment):
6254 Update the phdrs_list even when the output section is NULL.
6255 * testsuite/Makefile.am: Add test.
6256 * testsuite/Makefile.in: Regenerate.
6257 * testsuite/script_test_9.cc: New.
6258 * testsuite/script_test_9.sh: New.
6259 * testsuite/script_test_9.t: New.
6260
6625d24e
DK
62612010-05-19 Doug Kwan <dougkwan@google.com>
6262
6263 * arm.cc (Arm_input_section::original_size): New method.
6264 (Arm_input_section::do_addralign): Add a cast.
6265 (Arm_input_section::do_output_offset): Remove static cast.
6266 (Arm_input_section::original_addralign,
6267 Arm_input_section::original_size_): Change type to uint32_t.
6268 (Arm_input_section::init): Add safe casts for section alignment
6269 and size.
6270 (Arm_input_section::set_final_data_size): Do not set address and
6271 offset of stub table.
6272 (Arm_output_section::fix_exidx_coverage): Change use of of
6273 Output_section::Simple_input_section to that of
6274 Output_section::Input_section.
6275 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
6276 except for the first pass.
6277 * output.cc (Output_section::get_input_sections): Change type of
6278 input_sections to std::list<Input_section>.
6279 (Output_section::add_script_input_section): Rename from
6280 Output_section::add_simple_input_section. Change type of SIS
6281 parameter from Simple_input_section to Input_section.
6282 * output.h (Output_section::Simple_input_section): Remove class.
6283 (Output_section::Input_section): Change class visibility to public.
6284 (Output_section::Input_section::addralign): Use stored alignments
6285 for special input sections if set.
6286 (Output_section::Input_section::set_addralign): New method.
6287 (Output_section::get_input_sections): Change parameter type from
6288 list of Simple_input_section to list of Input_section.
6289 (Output_section::add_script_input_section): Rename from
6290 Output_section::add_simple_input_section. Change first parameter's
6291 type from Simple_input_section to Input_section and remove the
6292 second and third parameters.
6293 * script-sections.cc (Input_section::Input_section_list): Change
6294 type to list of Output_section::Input_section/
6295 (Input_section_info::Input_section_info): Change parameter type of
6296 INPUT_SECTION to Output_section::Input_section.
6297 (Input_section_info::input_section): Change return type.
6298 (Input_section_info::input_section_): Change type to
6299 Output_section::Input_section.
6300 (Output_section_element_input::set_section_addresses): Adjust code
6301 to use Output_section::Input_section instead of
6302 Output_section::Simple_input_section. Adjust code for renaming
6303 of Output_section::add_simple_input_section.
6304 (Orphan_output_section::set_section_addresses): Ditto.
6305
e1e82ea4
RW
63062010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6307
6308 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
6309 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
6310
91e75c8a
RÁE
63112010-05-18 Rafael Espindola <espindola@google.com>
6312
6313 * options.cc (General_options::finalize): Handle -nostdlib.
6314 * options.h (nostdlib): New option.
6315 * script.cc (script_add_search_dir): Handle -nostdlib.
6316
da59ad79
DK
63172010-05-12 Doug Kwan <dougkwan@google.com>
6318
6319 * arm.cc (Target_arm::do_finalize_sections): Create an empty
6320 attributes section only if there no attributes section after merging.
6321 (Target_arm::merge_object_attributes): Move value of
e1df38aa 6322 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
6323 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
6324 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
6325 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
6326 and arm_attr_merge_7.stdout.
6327 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
6328 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
6329 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
6330 arm_attr_merge_7b.o): New rules.
6331 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
6332 arm_attr_merge_7
6333 * testsuite/Makefile.in: Regenerate.
6334 * testsuite/arm_attr_merge.sh: New file.
6335 * testsuite/arm_attr_merge_[67][ab].s: Same.
6336
3e01a7fd
NC
63372010-05-05 Nick Clifton <nickc@redhat.com>
6338
6339 * po/es.po: Updated Spanish translation.
6340
7ad2014a
L
63412010-04-27 H.J. Lu <hongjiu.lu@intel.com>
6342
6343 * Makefile.am (install-exec-local): Properly install gold as
6344 default cross linker.
6345 * Makefile.in: Regenerated.
6346
4fda8867
NC
63472010-04-27 H.J. Lu <hongjiu.lu@intel.com>
6348 Nick Clifton <nickc@redhat.com>
6349
6350 * configure.ac (install_as_default): Define and set to false
6351 unless --enable-gold or --enable-gold=both/gold has been
6352 specified.
6353 * configure: Regenerate.
6354
6355 * Makefile.am (install-exec-local): Install the executable as
6356 'ld.gold'. If install_as_default is true then also install it as
6357 'ld'.
6358 * Makefile.in: Regenerated.
6359
bd288ea2
ILT
63602010-04-24 Ian Lance Taylor <iant@google.com>
6361
6362 * layout.cc (Layout::layout_reloc): In relocatable link don't
6363 combine reloc sections for grouped sections.
6364
ef38fd8a
ST
63652010-04-23 Sriraman Tallam <tmsriram@google.com>
6366
6367 * gc.h (gc_process_relocs): Pass information on relocs pointing to
6368 sections that are not ordinary to icf.
6369 * icf.cc (get_section_contents): Handle relocation pointing to section
6370 with no object or shndx information.
6371 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
6372 * testsuite/Makefile.in: Regenerate.
6373 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
6374 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
6375
f6973bdc
ILT
63762010-04-22 Ian Lance Taylor <iant@google.com>
6377
6378 * expression.cc (Expression::Expression_eval_info): Add
6379 result_alignment_pointer field.
6380 (Expression::eval_with_dot): Add result_alignment_pointer
6381 parameter. Change all callers.
6382 (Expression::eval_maybe_dot): Likewise.
6383 (class Binary_expression): Add alignment_pointer parameter to
6384 left_value and right_value. Change all callers.
6385 (BINARY_EXPRESSION): Set result alignment.
6386 (class Trinary_expression): Add alignment_pointer parameter to
6387 arg2_value and arg3_value. Change all callers.
6388 (Trinary_cond::value): Set result alignment.
6389 (Max_expression::value, Min_expression::value): Likewise.
6390 (Align_expression::value): Likewise.
6391 * script-sections.cc (class Sections_element): Add dot_alignment
6392 parameter to set_section_addresses virtual function. Update
6393 instantiations.
6394 (class Output_section_element): Likewise.
6395 (Script_sections::create_segments): Add dot_alignment parameter.
6396 Change all callers.
6397 (Script_sections::create_segments_from_phdrs_clause): Likewise.
6398 (Script_sections::set_phdrs_clause_addresses): Likewise.
6399 * script-sections.h: Update declarations.
6400 * script.h: Update declarations.
6401 * output.h (Output_segment::set_minimum_p_align): Don't decrease
6402 min_p_align.
6403 * testsuite/script_test_3.t: Set large alignment.
6404 * testsuite/script_test_3.sh: Make sure that at least one LOAD
6405 segment has expected alignment.
6406
9c9c98a5
NC
64072010-04-22 Nick Clifton <nickc@redhat.com>
6408
6409 * po/gold.pot: Updated by the Translation project.
6410 * po/vi.po: Updated Vietnamese translation.
6411
2253bfba
L
64122010-04-22 H.J. Lu <hongjiu.lu@intel.com>
6413
6414 * testsuite/Makefile.am (check_PROGRAMS): Add
6415 icf_virtual_function_folding_test.
6416 * testsuite/Makefile.in: Regenerated.
6417
85fdf906
AH
64182010-04-15 Andrew Haley <aph@redhat.com>
6419
6420 * options.h (merge_exidx_entries): New option.
6421 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
6422 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
6423 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
6424 (Target_arm::merge_exidx_entries): New function.
6425 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
6426 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
6427 to Arm_exidx_fixup constructor.
6428 Add new arg, merge_exidx_entries.
6429 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
6430 Arm_output_section::fix_exidx_coverage.
6431
ce97fa81
ST
64322010-04-18 Sriraman Tallam <tmsriram@google.com>
6433
6434 * icf.cc (get_section_contents): Check for preemptible functions.
6435 Ignore addend when appropriate.
6436 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
6437 section folded.
6438 (add_from_relobj): Check for section folded.
6439 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
6440 * symtab.h (should_add_dynsym_entry): Add new parameter.
6441 * target-reloc.h (scan_relocs): Check for section folded.
6442 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
6443 Check reloc types for function pointers in shared objects.
6444 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
6445 case.
6446 (icf_preemptible_functions_test): New test case.
6447 (icf_string_merge_test): New test case.
6448 * testsuite.Makefile.in: Regenerate.
6449 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
6450 bar_glob. Refactor code.
6451 * testsuite/icf_preemptible_functions_test.cc: New file.
6452 * testsuite/icf_preemptible_functions_test.sh: New file.
6453 * testsuite/icf_string_merge_test.cc: New file.
6454 * testsuite/icf_string_merge_test.sh: New file.
6455 * testsuite/icf_virtual_function_folding_test.cc: New file.
6456 * testsuite/icf_virtual_function_folding_test.sh: New file.
6457
04ceb17c
DK
64582010-04-14 Doug Kwan <dougkwan@google.com>
6459
6460 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
6461 for local symbol recounting if we remove a section due to ICF.
6462 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
6463 there are no regular objects in input.
6464
153e7da4
DK
64652010-04-13 Doug Kwan <dougkwan@google.com>
6466
6467 * arm.cc (Arm_input_section::set_final_data_size): Compute
6468 accurate final data size instead of using current data size.
6469
4dbd9faf
DK
64702010-04-09 Doug Kwan <dougkwan@google.com>
6471
6472 * layout.cc (Layout::choose_output_section): Handle script section
6473 types.
6474 (Layout::make_output_section_for_script): Add section type parameter.
6475 Handle script section types.
6476 * layout.h (Layout::make_output_section_for_script): Add section
6477 type parameter.
6478 * output.cc (Output_section::Output_section): Initialize data member
6479 is_noload_.
6480 (Output_section::do_reset_address_and_file_offset): Do not set address
6481 to 0 if section is a NOLOAD section.
6482 * output.h (Output_section::is_noload): New method.
6483 (Output_section::set_is_noload): Ditto.
6484 (Output_section::is_noload_): New data member.
6485 * script-c.h (Script_section_type): New enum type.
6486 (struct Parser_output_section_header): Add new file section_type.
6487 * script-sections.cc (Sections_element::output_section_name): Add
6488 parameter for returning script section type.
6489 (Output_section_definition::output_section_name): Ditto.
6490 (Output_section_definition::section_type)P; New method.
6491 (Output_section_definiton::script_section_type_name): Ditto.
6492 (Output_section_definition::script_section_type_): New data member.
6493 (Output_section_definition::Output_section_definition): Initialize
6494 data member Output_section_definition::script_section_type_.
6495 (Output_section_definition::create_sections): Pass script section type
6496 to Layout::make_output_section_for_script.
6497 (Output_section_definition::output_section_name): Return script
6498 section type to caller.
6499 (Output_section_definition::set_section_address): Do not advance
6500 dot value and load address if section type is NOLOAD. Set address
6501 of NOLOAD sections regardless of section flags.
6502 (Output_section_definition::print): Print section type if it is
6503 not SCRIPT_SECTION_TYPE_NONE.
6504 (Output_section_definition::section_type): New method.
6505 (Output_section_definition::script_section_type_name): Ditto.
6506 (Script_sections::output_section_name): Add new parameter
6507 PSECTION_TYPE for returning script section type. Pass it to
6508 section elements. Handle discard sections.
6509 (Sort_output_sections::operator()): Handle NOLOAD sections.
6510 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 6511 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
6512 returning script section type.
6513 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
6514 INFO and NOLOAD.
6515 * yyscript.y (union): Add new field SECTION_TYPE.
6516 (COPY, DSECT, INFO, NOLOAD): New tokens.
6517 (opt_address_and_section_type): Change type to output_section_header.
6518 (section_type): New non-terminal
6519 (section_header): Handle section type.
2253bfba 6520 (opt_address_and_section_type): Return section type value.
4dbd9faf 6521
721ea635
L
65222010-04-09 H.J. Lu <hongjiu.lu@intel.com>
6523
6524 * testsuite/plugin_common_test_1.c (foo): Add prototype.
6525 * testsuite/plugin_common_test_2.c (foo): Likewise.
6526
6bf924b0
DK
65272010-04-08 Doug Kwan <dougkwan@google.com>
6528
6529 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
6530 Output_merge_data.
6531 * output.cc (Output_section::add_merge_input_section): Simplify
6532 code and return status of Output_merge_base::add_input_section.
e1df38aa 6533 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
6534 returns true.
6535
24af6f92
DK
65362010-04-07 Doug Kwan <dougkwan@google.com>
6537
6538 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
6539 if section is marked as containing instructions but has no mapping
6540 symbols.
6541 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
6542 correct section index.
6543 (Arm_relobj::find_linked_text_section): Ditto.
6544
00698fc5
CC
65452010-04-07 Cary Coutant <ccoutant@google.com>
6546
6547 * archive.cc (include_member): Destroy Read_symbols_data object before
6548 releasing file.
6549 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
6550 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
6551 (Read_symbols_data::~Read_symbols_data) New destructor.
6552 (Section_relocs::Section_relocs) New constructor.
6553 (Section_relocs::~Section_relocs) New destructor.
6554 (Read_relocs_data::Read_relocs_data) New constructor.
6555 (Read_relocs_data::~Read_relocs_data) New destructor.
6556 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
6557 pointers to NULL after deleting.
6558
7296d933
DK
65592010-04-07 Doug Kwan <dougkwan@google.com>
6560
6561 * arm.cc: Replace "endianity" with "endianness" in comments.
6562 (Arm_exidx_cantunwind): Ditto.
6563 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
6564 (Arm_relobj::merge_flags_and_attributes): New method.
6565 (Arm_relobj::merge_flags_and_attributes_): New data member.
6566 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
6567 (Arm_relobj::scan_sections_for_stubs): Ditto.
6568 (Arm_relobj::do_read_symbols): Check to see if we really want to
6569 merge processor-specific flags and attributes. Exit early if
6570 an object is empty except for section names and the undefined symbol.
6571 (Target_arm::do_finalize_sections): Move check for ELF format to
6572 Arm_relobj::do_read_symbols. Merge processor specific flags and
6573 attributes from a regular object only when we have determined that
6574 it is aapropriate. Do not create an .ARM.attributes section in
6575 output if there is no regular input object.
6576 (Target_arm::merge_processor_specific_flags): Check
6577 --warn-mismatch before printing any error.
6578 (Target_arm::merge_object_attributes): Ditto.
6579 * gold.cc (queue_middle_tasks): Handle the case in which there is
6580 no regular object in input.
6581 * options.cc (General_options::parse_EB): New method.
6582 (General_options::parse_EL): Same.
6583 (General_options::General_options): Initialize endianness_.
6584 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
6585 New options.
6586 (General_options::Endianness): New enum.
6587 (General_options::endianness): New method.
6588 (General_options::endianness_): New data member.
6589 * parameters.cc (Parameters::set_options): Check target endianness.
6590 (Parameters::set_target_once): Ditto.
6591 (Parameters::check_target_endianness): New method.
6592 (parameters_force_valid_target): If either -EL or -EB is specified,
6593 use it to define endianness of default target.
6594 * parameters.h (Parameters::check_target_endianness): New method
6595 declaration.
6596 * target.h (class Target): Change "endianity" to "endianness"
6597 in comments.
6598
efc8d4f2
RW
65992010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6600
6601 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
6602 * configure: Regenerate.
6603 * Makefile.in: Regenerate.
6604 * testsuite/Makefile.in: Regenerate.
6605
be234d88
CC
66062010-04-06 Cary Coutant <ccoutant@google.com>
6607
6608 gcc PR lto/42757
6609 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
6610 prevailing definitions of common symbols.
6611 * testsuite/plugin_test_6.sh: New test case.
6612 * testsuite/plugin_common_test_1.c: New test case.
6613 * testsuite/plugin_common_test_2.c: New test case.
6614 * testsuite/Makefile.am (plugin_test_6): New test case.
6615 * testsuite/Makefile.in: Regenerate.
6616
bd32c6bd
NC
66172010-04-06 Nick Clifton <nickc@redhat.com>
6618
6619 * po/vi.po: New Vietnamese translation.
6620
323c532f
DK
66212010-03-30 Doug Kwan <dougkwan@google.com>
6622
6623 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
6624
4fcd97eb
DK
66252010-03-25 Doug Kwan <dougkwan@google.com>
6626
6627 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
6628 to avoid a conversion warning on a 32-bit host.
6629
4ebf39db
ILT
66302010-03-24 Ian Lance Taylor <iant@google.com>
6631
6632 * testsuite/script_test_3.t: Add a TLS segment.
6633 * testsuite/Makefile.am (check_PROGRAMS): Add
6634 tls_phdrs_script_test.
6635 (tls_phdrs_script_test_SOURCES): Define.
6636 (tls_phdrs_script_test_DEPENDENCIES): Define.
6637 (tls_phdrs_script_test_LDFLAGS): Define.
6638 (tls_phdrs_script_test_LDADD): Define.
6639 * testsuite/Makefile.in: Rebuild.
6640
4a599bdd
CC
66412010-03-23 Cary Coutant <ccoutant@google.com>
6642
6643 * fileread.cc (find_or_make_view): Fix comment.
6644
6c93b22c
ILT
66452010-03-23 Ian Lance Taylor <iant@google.com>
6646
6647 * script-sections.cc (class Orphan_section_placement): Define
6648 PLACE_TLS and PLACE_TLS_BSS.
6649 (Orphan_section_placement::Orphan_section_placement): Initialize
6650 new places.
6651 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
6652 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
6653 (tls_script_test_SOURCES): Define.
6654 (tls_script_test_DEPENDENCIES): Define.
6655 (tls_script_test_LDFLAGS): Define.
6656 (tls_script_test_LDADD): Define.
6657 * testsuite/Makefile.in: Rebuild.
6658
a2c7281b
DK
66592010-03-22 Doug Kwan <dougkwan@google.com>
6660
6661 * arm.cc (Arm_relocate_functions::abs8,
6662 Arm_relocate_functions::abs16): Use correct check for overflow
6663 specified in the ARM ELF specs.
6664 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
6665 target of a BLX instruction specially.
6666 (Reloc_stub::stub_type_for_reloc): Ditto.
6667 (Relocate::relocate): Use symbolic names instead of numeric relocation
6668 codes to report error.
6669 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
6670 workaround.
6671 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
6672 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
6673 thumb2_blx_out_of_range.stdout
6674 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
6675 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
6676 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
6677 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
6678 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
6679 thumb2_blx_in_range, thumb2_blx_in_range.o,
6680 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
6681 thumb2_blx_out_of_range.o): New rules.
2e702c99 6682 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
6683 thumb2_blx_in_range and thumb2_blx_out_of_range.
6684 * testsuite/Makefile.in: Regenerate.
6685 * arm_branch_in_range.sh: Add tests for THUMB BLX.
6686 * testsuite/thumb_blx_in_range.s: New file.
6687 * testsuite/thumb_blx_out_of_range.s: New file.
6688
b0193076
RÁE
66892010-03-22 Rafael Espindola <espindola@google.com>
6690
6691 * archive.cc (Should_include): Move to archive.h.
6692 (should_include_member): Make it a member of Archive.
6693 (Lib_group): New.
6694 (Add_lib_group_symbols): New.
6695 * archive.h: Include options.h.
6696 (Archive_member): Moved from Archive.
6697 (Should_include): Moved from archive.cc.
6698 (Lib_group): New.
6699 (Add_lib_group_symbols): New.
6700 * dynobj.cc (do_should_include_member): New.
6701 * dynobj.h (do_should_include_member): New.
6702 * gold.cc (queue_initial_tasks): Update call to queue.
6703 * main.cc (main): Print lib group stats.
6704 * object.cc (do_should_include_member): New.
6705 * object.h: Include archive.h.
6706 (Object::should_include_member): New.
6707 (Object::do_should_include_member): New.
6708 (Sized_relobj::do_should_include_member): New.
6709 * options.cc (General_options::parse_start_lib): New.
6710 (General_options::parse_end_lib): New.
6711 (Input_arguments::add_file): Handle lib groups.
6712 (Input_arguments::start_group): Check we are not in a lib.
6713 (Input_arguments::start_lib): New.
6714 (Input_arguments::end_lib): New.
6715 * options.h (General_options): Add start_lib and end_lib.
6716 (Input_argument::lib_): New.
6717 (Input_argument::lib): New.
6718 (Input_argument::is_lib): New.
6719 (Input_file_lib): New.
6720 (Input_arguments::in_lib_): New.
6721 (Input_arguments::in_lib): New.
6722 (Input_arguments::start_lib): New.
6723 (Input_arguments::end_lib_): New.
6724 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
6725 in unused members as preempted.
6726 (Sized_pluginobj::do_should_include_member): New.
6727 * plugin.h (Sized_pluginobj::do_should_include_member): New.
6728 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
6729 return the blocker.
6730 (Read_symbols::do_whole_lib_group): New.
6731 (Read_symbols::do_lib_group): New.
6732 (Read_symbols::do_read_symbols): Handle lib groups.
6733 (Read_symbols::get_name): Handle lib groups.
6734 * readsyms.h (Read_symbols): Add an archive member pointer.
6735 (Read_symbols::do_whole_lib_group): New.
6736 (Read_symbols::do_lib_group): New.
6737 (Read_symbols::member_): New.
6738 * script.cc (read_input_script): Update call to queue_soon.
6739
d099120c
DK
67402010-03-19 Doug Kwan <dougkwan@google.com>
6741
6742 * arm.cc (Stub_table::Stub_table): Initialize new data members
6743 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
6744 (Stub_table::add_reloc_stub): Assign stub offset and update
6745 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
6746 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
6747 New data members.
2e702c99 6748 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
6749 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
6750 instead of going over all reloc stubs.
2e702c99 6751 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
6752 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
6753 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 6754 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
6755 Stringpool_template::offset_.
6756 * stringpool.h (Stringpool_template::set_no_zero_null): Set
6757 Stringpool_template::offset_ to zero.
6758
1aa37384
DK
67592010-03-15 Doug Kwan <dougkwan@google.com>
6760
6761 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
6762 offset_.
6763 (Stringpool_template::new_key_offset): New method.
6764 (Stringpool_template::add_string): Assign offsets when adding new
6765 strings.
6766 (Stringpool_template::set_string_offsets): Do not set string offsets
6767 when not optimizing.
6768 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
6769 member size_.
2e702c99
RM
6770 (Chunked_vector::clear): Clear size_.
6771 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
6772 (Chunked_vector::size): Return size_.
6773 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 6774 (Chunked_vector::size_): New data member.
1aa37384
DK
6775 (Stringpool_template::set_no_zero_null): Assert string set is empty.
6776 (Stringpool_template::new_key_offset): New method declaration.
6777 (Stringpool_template::offset_): New data member.
6778
b672b057
RÁE
67792010-03-15 Rafael Espindola <espindola@google.com>
6780
6781 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
6782 Add_symbols' constructor.
6783 * readsyms.h (Add_symbols): Remove the input_group member.
6784
b6848d3c
ILT
67852010-03-10 Ian Lance Taylor <iant@google.com>
6786
6787 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
6788 target to ask whether a reference to a symbol requires a stack
6789 split.
6790 * target.h (Target::is_call_to_non_split): New function.
6791 (Target::do_is_call_to_non_split): Declare virtual function.
6792 * target.cc: Include "symtab.h".
6793 (Target::do_is_call_to_non_split): New function.
6794 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
6795
a2a5469e
CC
67962010-03-10 Cary Coutant <ccoutant@google.com>
6797
6798 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
6799 (File_read::open[1]): Remove initial mapping of whole_file_view_.
6800 (File_read::open[2]): Add whole_file_view_ to list of views.
6801 (File_read::make_view): Remove test of whole_file_view_.
6802 (File_read::find_or_make_view): Create whole_file_view_ if
6803 necessary.
6804 (File_read::clear_views): Replace bool parameter with enum;
6805 adjust all callers. Don't delete views with permanent data;
6806 do delete cached views and views from archives if
6807 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
6808 if clearing the corresponding view.
6809 * fileread.h (File_read::Clear_views_mode): New enum.
6810 (File_read::View::is_permanent_view): New method.
6811 (File_read::clear_views): Replace bool parameter
6812 with enum; adjust all callers.
6813 * options.h (General_options): Change keep_files_mapped option;
6814 add map_whole_files.
6815 * readsyms.cc (Add_symbols::run): Delete sd_ object before
6816 releasing the file.
6817 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
6818 the file.
6819
8861f32b
DM
68202010-03-10 David S. Miller <davem@davemloft.net>
6821
6822 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
6823
d62d0f5f
ST
68242010-03-09 Sriraman Tallam <tmsriram@google.com>
6825
6826 * icf.cc (get_section_contents): Add '@' marker after processing the
6827 merge reloc.
6828
9177756d
DK
68292010-03-08 Doug Kwan <dougkwan@google.com>
6830
6831 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
6832 due to a conversion warning.
6833 (Arm_relobj::update_output_local_symbol_count): Check for local
6834 symbol with unset output index.
6835
9e9e071b
ILT
68362010-03-05 Ian Lance Taylor <iant@google.com>
6837
6838 * options.h (class General_options): Add --spare-dynamic-tags.
6839 * output.cc (Output_data_dynamic::set_final_data_size): Implement
6840 --spare-dynamic-tags.
6841
a81ee015
ILT
68422010-03-05 Ian Lance Taylor <iant@google.com>
6843
6844 * incremental.cc: Include "libiberty.h".
6845
44ec90b9
RO
68462010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
6847
6848 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
6849 function, is_info_ member.
6850 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
6851 (Versions::Versions): Update caller.
6852 (Versions::define_base_version): Likewise.
6853 (Versions::add_def): Likewise.
6854
0897ed3b
ST
68552010-03-03 Sriraman Tallam <tmsriram@google.com>
6856
6857 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
6858 (Scan::possible_function_pointer_reloc): New function.
6859 (Scan::local_reloc_may_be_function_pointer): Change to call
6860 possible_function_pointer_reloc.
6861 (Scan::global_reloc_may_be_function_pointer): Ditto.
6862 * icf.h (Icf::check_section_for_function_pointers): Change to reject
6863 relocations in ".data.rel.ro._ZTV" section.
6864 * testsuite/icf_safe_so_test.sh: Change to pass i386.
6865 * testsuite/icf_safe_so_test.cc: Ditto.
6866 * testsuite/icf_safe_test.cc: Ditto.
6867 * testsuite/icf_safe_test.sh: Ditto.
6868
d3bbad62
ILT
68692010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6870 Ian Lance Taylor <iant@google.com>
6871
6872 * target-reloc.h (relocate_section): Check the symbol table index
6873 for -1U before setting the local symbol index.
6874 (scan_relocatable_relocs): If copying the relocation, record that
6875 the local symbol is required.
6876 * object.h (Symbol_value::is_output_symtab_index_set): New
6877 function.
6878 (Symbol_value::may_be_discarded_from_output_symtab): New
6879 function.
6880 (Symbol_value::has_output_symtab_entry): New function.
6881 (Symbol_value::needs_output_symtab_entry): Remove.
6882 (Symbol_value::output_symtab_index): Make sure the symbol index is
6883 set.
6884 (Symbol_value::set_output_symtab_index): Make sure the symbol
6885 index is not set. Make sure the new index is valid.
6886 (Symbol_value::set_must_have_output_symtab_entry): New function.
6887 (Symbol_value::has_output_dynsym_entry): New function.
6888 (Symbol_value::set_output_dynsym_index): Make sure the new index
6889 is valid.
6890 (Sized_relobj::set_must_have_output_symtab_entry): New function.
6891 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
6892 local symbol if permitted.
6893 (Sized_relobj::do_finalize_local_symbols): Call
6894 is_output_symtab_index_set rather than needs_output_symtab_entry.
6895 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
6896 rather than needs_output_symtab_entry. Call
6897 has_output_dynsym_entry rather than needs_output_dynsym_entry.
6898 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
6899 is_output_symtab_index_set rather than needs_output_symtab_entry.
6900 * testsuite/discard_locals_relocatable_test.c: New file.
6901 * testsuite/discard_locals_test.sh: Test -r.
6902 * testsuite/Makefile.am (check_DATA): Add
6903 discard_locals_relocatable_test1.syms,
6904 discard_local_relocatable_test2.syms.
6905 (MOSTLYCLEANFILES): Likewise. Also add
6906 discard_locals_relocatable_test1.lout and
6907 discard_locals_relocatable_test2.out.
6908 (discard_locals_relocatable_test1.syms): New target.
6909 (discard_locals_relocatable_test.o): New target.
6910 (discard_locals_relocatable_test1.out): New target.
6911 (discard_locals_relocatable_test2.syms): New target.
6912 (discard_locals_relocatable_test2.out): New target.
6913 (various): Add missing ../ld-new dependencies.
6914 * testsuite/Makefile.in: Rebuild.
6915
7e8ccf26
NC
69162010-03-03 Nick Clifton <nickc@redhat.com>
6917
6918 * po/fi.po: New Finnish translation.
6919
2a0ff005
DK
69202010-03-01 Doug Kwan <dougkwan@google.com>
6921
6922 * layout.cc (Layout::Layout): Force section types of .init_array*,
6923 .preinit_array* and .fini_array* sections.
6924 * output.cc (Output_section::Input_section_sort_entry::has_priority):
6925 Fix check of return value of std::string::find.().
6926 (Output_section::Input_section_sort_compare::operator()): Remove
6927 comment about .init_array.
6928 (Output_section::Input_section_sort_init_fini_compare::operator()):
6929 New method.
6930 (Output_section::sort_attached_input_sections): Handle .init_array
6931 and .fini_array specially.
6932 * output.h (Output_section::Inut_section_sort_compare): Update
6933 comment.
6934 (Output_section::Input_section_sort_init_fini_compare): New struct.
6935
c3e4ae29
DK
69362010-02-26 Doug Kwan <dougkwan@google.com>
6937
6938 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
6939 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
6940 * testsuite/debug_msg.sh: Avoid matching source line number for
6941 use of global variable undef_int.
6942
2fd9ae7a
DK
69432010-02-26 Doug Kwan <dougkwan@google.com>
6944
6945 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
6946 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
6947 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
6948 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
6949 * options.cc (General_options::General_options): Initialize member
6950 fix_v4bx_.
6951 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
6952 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
6953 and rm_no_fix_v4bx.stdout
6954 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
6955 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
6956 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
6957 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
6958 and arm_no_fix_v4bx.
6959 * Makefile.in: Regenerate.
6960 * testsuite/arm_fix_v4bx.s: New file.
6961 * testsuite/arm_fix_v4bx.sh: Ditto.
6962
67ec7d0b
DK
69632010-02-24 Doug Kwan <dougkwan@google.com>
6964
6965 * arm.cc (Target_arm::got_section): Make the .got section the first
6966 non RELRO section in the data segment.
6967 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
6968 suffixes of section names.
6969
10165461
DK
69702010-02-24 Doug Kwan <dougkwan@google.com>
6971
6972 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
6973 flags and attributes merging if an input file is a binary file.
6974 * fileread.cc (Input_file::open): Record format of original file.
6975 * fileread.h (Input_file::Format): New enum type.
2e702c99 6976 (Input_file::Input_file): Initialize data member format_.
10165461
DK
6977 (Input_file::format): New method definition.
6978 (Input_file::format_):: New data member.
6979
4a54abbb
DK
69802010-02-24 Doug Kwan <dougkwan@google.com>
6981
6982 * arm.cc (Arm_output_data_got): New class.
6983 (ARM_TCB_SIZE): New constant
6984 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
6985 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
6986 If user uses a script with a SECTIONS clause, issue only a warning
6987 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 6988 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
6989 garbage collection.
6990 (Target_arm::got_mode_index_entry): Handle static linking.
6991 (Target_arm::Scan::local): Ditto.
6992 (Target_arm::Scan::global): Ditto.
6993 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
6994 all incorrectly implemented relocations.
e1df38aa 6995 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
6996 Arm_output_section::fix_exidx_coverage.
6997 * layout.cc (Layout::section_name_mapping): Remove trailing dots
6998 from ".ARM.exidx." and ".ARM.extab.".
6999
ca419a6f
ILT
70002010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7001
7002 * arm.cc (Target_arm::do_finalize_sections): Create attribute
7003 section if it does not already exist.
7004 * attributes.cc (Attributes_section_data::Attributes_section_data):
7005 Don't crash if size is zero.
7006
135b9c78
ILT
70072010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7008 Ian Lance Taylor <iant@google.com>
7009
7010 * gold.cc (queue_middle_tasks): If no input files were opened,
7011 exit.
7012 * workqueue.h (Task_function::Task_function): Assert that there is
7013 a blocker.
7014
bb0bfe4f
DK
70152010-02-22 Doug Kwan <dougkwan@google.com>
7016
7017 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
7018 * icf.cc (get_section_contents): Cast snprintf arguments to long long
7019 types to avoid warnings due to different uint64_t implementations
7020 on different hosts.
7021
2a2b6d42
DK
70222010-02-21 Doug Kwan <dougkwan@google.com>
7023
7024 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
7025 handling of the maximum backward branch offset.
2e702c99 7026 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
7027 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
7028 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 7029 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
7030 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
7031 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
7032 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
7033 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
7034 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
7035 thumb_bl_out_of_range thumb_bl_out_of_range.o,
7036 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
7037 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
7038 thumb2_bl_out_of_range.o): New rules.
7039 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
7040 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
7041 thumb2_bl_out_of_range
7042 * testsuite/Makefile.in: Regenerate.
7043 * testsuite/arm_bl_in_range.s: New file.
7044 * testsuite/arm_bl_out_of_range.s: Ditto.
7045 * testsuite/arm_branch_in_range.sh: Ditto.
7046 * testsuite/arm_branch_range.t: Ditto.
7047 * testsuite/thumb2_branch_range.t: Ditto.
7048 * testsuite/thumb_bl_in_range.s: Ditto.
7049 * testsuite/thumb_bl_out_of_range.s: Ditto.
7050 * testsuite/thumb_branch_range.t: Ditto.
7051
b487ad64
ST
70522010-02-20 Sriraman Tallam <tmsriram@google.com>
7053
7054 * gc.h (gc_process_relocs): Change vectors to point to the new list.
7055 Add reloc offset information.
7056 * icf.cc (get_section_contents): Change iterators to point to the new
7057 vectors. Add reloc offset information to the contents.
7058 * icf.h (Icf::Sections_reachable_info): New typedef.
7059 (Icf::Sections_reachable_list): New typedef.
7060 (Icf::Offset_info): New typedef.
7061 (Icf::Reloc_info): New struct typedef.
7062 (Icf::Reloc_info_list): New typedef.
7063 (Icf::symbol_reloc_list): Delete method.
7064 (Icf::addend_reloc_list): Delete method.
7065 (Icf::section_reloc_list): Delete method.
7066 (Icf::reloc_info_list): New method.
7067 (Icf::reloc_info_list_): New member.
7068
f96accdf
DK
70692010-02-19 Doug Kwan <dougkwan@google.com>
7070
7071 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
7072 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
7073 * arm.cc (Arm_relocation_functions): New forward declaration.
7074 (Target_arm::Target_arm): Initialize new data members
7075 got_mod_index_offset_ and tls_base_symbol_defined_.
7076 (Target_arm::Relocate::relocate_tls): New method.
7077 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
7078 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
7079 New methods.
2e702c99 7080 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
7081 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
7082 (Target_arm::got_mod_index_offset_,
7083 Target_arm::tls_base_symbol_defined_): New data members.
7084 (Target_arm::Scan::local, Target::Scan::global,
7085 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
7086 relocations.
7087
c8761b9a
DK
70882010-02-18 Doug Kwan <dougkwan@google.com>
7089
7090 * arm.cc (Arm_relobj::find_linked_text_section): New method.
7091 (Arm_relobj::make_exidx_input_section): Pass section index of linked
7092 text section as a parameter becuase some broken tools may not set
7093 the link in section header.
7094 (Target_arm::has_got_section): New method.
7095 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
7096 without any mapping symbol as data only. Remove warning.
7097 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
7098 link in its section header, try to discover the link by inspecting the
7099 REL31 relocation at the beginning of the section.
7100 (Target_arm::Scan::check_non_pic): Report name of offending relocation
7101 in error message.
7102 (Target_arm::Scan::global): Treat any reference to the symbol
7103 _GLOBAL_OFFSET_TABLE_ as a GOT access.
7104
21bb3914
ST
71052010-02-12 Sriraman Tallam <tmsriram@google.com>
7106
7107 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
7108 (Scan::global_reloc_may_be_function_pointer): New function.
7109 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
7110 (Scan::global_reloc_may_be_function_pointer): New function.
7111 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
7112 (Scan::global_reloc_may_be_function_pointer): New function.
7113 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
7114 (Scan::global_reloc_may_be_function_pointer): New function.
7115 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
7116 (Scan::global_reloc_may_be_function_pointer): New function.
7117 (Scan::possible_function_pointer_reloc): New function.
7118 (Target_x86_64::can_check_for_function_pointers): New function.
7119 * gc.h (gc_process_relocs): Scan relocation types to determine if
7120 function pointers were taken for targets that support it.
7121 * icf.cc (Icf::find_identical_sections): Include functions for
7122 folding in safe ICF whose pointer is not taken.
7123 * icf.h (Secn_fptr_taken_set): New typedef.
7124 (fptr_section_id_): New member.
7125 (section_has_function_pointers): New function.
7126 (set_section_has_function_pointers): New function.
7127 (check_section_for_function_pointers): New function.
7128 * options.h: Fix comment for safe ICF option.
7129 * target.h (can_check_for_function_pointers): New function.
7130 * testsuite/Makefile.am: Add icf_safe_so_test test case.
7131 Modify icf_safe_test for X86-64.
7132 * testsuite/Makefile.in: Regenerate.
7133 * testsuite/icf_safe_so_test.cc: New file.
7134 * testsuite/icf_safe_so_test.sh: New file.
7135 * testsuite/icf_safe_test.cc (kept_func_3): New function.
7136 (main): Change to take pointer to function kept_func_3.
7137 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
7138 folding is done correctly for X86-64.
7139
0da6fa6c
DM
71402010-02-12 David S. Miller <davem@davemloft.net>
7141
7142 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
7143 is_symbolless parameter.
7144 (Output_reloc<SHT_REL>::is_symbolless): New.
7145 (Output_reloc<SHT_REL>::is_symbolless_): New.
7146 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
7147 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
7148 (Output_reloc<SHT_RELA>::is_symbolless): New.
7149 (Output_data_reloc::add_global): Handle is_symbolless.
7150 (Output_data_reloc::add_global_relative): Likewise.
7151 (Output_data_reloc::add_local): Likewise.
7152 (Output_data_reloc::add_local_relative): Likewise.
7153 (Output_data_reloc::add_symbolless_global_addend): New.
7154 (Output_data_reloc::add_symbolless_local_addend): New.
7155 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
7156 is_symbolless.
7157 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
7158 instead of ->is_relative_
7159 (Output_reloc::write): Likewise.
7160 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
7161 (Output_reloc::write_rel): Simplify.
7162
7163 * sparc.cc (Target_sparc::Scan::local): Use
7164 ->add_symbolless_local_addend as needed.
7165 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
7166 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
7167 based upon relocation offset.
7168
e4782e83
DK
71692010-02-11 Doug Kwan <dougkwan@google.com>
7170
7171 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
7172 (Target_arm::Scan::global): Ditto. Also remove a comment before the
7173 beginning of function.
7174 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
7175 and MOVT_ABS relocations. Those are non issued in scanning. Fix
7176 parameter is_32bit in calls to should_apply_static_reloc.
7177 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
7178 (check_DATA): Add arm_abs_global.stdout.
7179 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
7180 arm_abs_global.stdout): New rules.
7181 (MOSTLLYCLEANFILES): Add arm_abs_global
7182 * Makefile.in: Regenerate.
7183 * testsuite/arm_abs_global.s: New file.
7184 * testsuite/arm_abs_global.sh: Ditto.
7185 * testsuite/arm_abs_lib.s: Ditto.
7186
93ceb764
ILT
71872010-02-11 Ian Lance Taylor <iant@google.com>
7188
7189 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
7190 Read_relocs task.
7191 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
7192 Allocate_commons_task first.
7193 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
7194 task, rather than symtab_lock_.
7195 (Gc_process_relocs::~Gc_process_relocs): New function.
7196 (Gc_process_relocs::is_runnable): Check this_blocker_.
7197 (Gc_process_relocs::locks): Use next_blocker_ rather than
7198 blocker_.
7199 (Scan_relocs::~Scan_relocs): New function.
7200 (Scan_relocs::is_runnable): Check this_blocker_ rather than
7201 symtab_lock_.
7202 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
7203 next_blocker_.
7204 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
7205 fields. Add this_blocker_ and next_blocker_ fields. Adjust
7206 constructor accordingly.
7207 (class Gc_process_relocs): Likewise.
7208 (class Scan_relocs): Likewise.
7209 * common.h (class Allocate_commons_task): Remove symtab_lock_
7210 field, and corresponding constructor parameter.
7211 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
7212 symtab_lock_.
7213 (Allocate_commons_task::locks): Likewise.
7214
114dfbe1
ILT
72152010-02-11 Ian Lance Taylor <iant@google.com>
7216
7217 * gold-threads.h (class Once): Define.
7218 (class Initialize_lock): Rewrite as child of Once.
7219 * gold-threads.cc (class Once_initialize): Define.
7220 (once_pointer_control): New static variable.
7221 (once_pointer, once_arg): New static variables.
7222 (c_run_once): New static function.
7223 (Once::Once, Once::run_once, Once::internal_run): New functions.
7224 (class Initialize_lock_once): Remove.
7225 (initialize_lock_control): Remove.
7226 (initialize_lock_pointer): Remove.
7227 (initialize_lock_once): Remove.
7228 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
7229 (Initialize_lock::initialize): Rewrite.
7230 (Initialize_lock::do_run_once): New function.
7231 * archive.cc (Archive::interpret_header): Only clear name if it is
7232 not already empty.
7233 * fileread.cc: Include "gold-threads.h"
7234 (file_counts_lock): New static variable.
7235 (file_counts_initialize_lock): Likewise.
7236 (File_read::release): Only increment counts when using --stats.
7237 Use a lock around the increment.
7238 * parameters.cc (class Set_parameters_target_once): Define.
7239 (set_parameters_target_once): New static variable.
7240 (Parameters::Parameters): Move here from parameters.h.
7241 (Parameters::set_target): Rewrite.
7242 (Parameters::set_target_once): New function.
7243 (Parameters::clear_target): Move here and rewrite.
7244 * parameters.h (class Parameters): Update declarations. Add
7245 set_parameters_target_once_ field.
7246 (Parameters::Parameters): Move to parameters.cc.
7247 (Parameters::clear_target): Likewise.
7248 * readsyms.cc (Read_symbols::do_group): Create a Start_group
7249 task.
7250 (Start_group::~Start_group): New function.
7251 (Start_group::is_runnable): New function.
7252 (Start_group::locks, Start_group::run): New functions.
7253 (Finish_group::run): Change saw_undefined to size_t.
7254 * readsyms.h (class Start_group): Define.
7255 (class Finish_group): Change saw_undefined_ field to size_t.
7256 (Finish_group::Finish_group): Remove saw_undefined and
7257 this_blocker parameters. Change all callers.
7258 (Finish_group::set_saw_undefined): New function.
7259 (Finish_group::set_blocker): New function.
7260 * symtab.h (class Symbol_table): Change saw_undefined to return
7261 size_t. Change saw_undefined_ field to size_t.
7262 * target-select.cc (Set_target_once::do_run_once): New function.
7263 (Target_selector::Target_selector): Initialize set_target_once_
7264 field. Don't initialize lock_ and initialize_lock_ fields.
7265 (Target_selector::instantiate_target): Rewrite.
7266 (Target_selector::set_target): New function.
7267 * target-select.h (class Set_target_once): Define.
7268 (class Target_selector): Update declarations. Make
7269 Set_target_once a friend. Remove lock_ and initialize_lock_
7270 fields. Add set_target_once_ field.
7271
fa17a3f4
ILT
72722010-02-10 Ian Lance Taylor <iant@google.com>
7273
7274 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
7275 queueing any tasks.
7276 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
7277 (queue_middle_tasks): Add all blockers before queueing any tasks.
7278 (queue_final_tasks): Likewise.
7279 * token.h (Task_token::add_blockers): New function.
7280 * object.h (Input_objects::number_of_relobjs): New function.
7281
c7177d31
ILT
72822010-02-10 Ian Lance Taylor <iant@google.com>
7283
5de0e392
ILT
7284 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
7285 shared, not if not position independent.
7286 * x86_64.cc (Relocate::relocate_tls): Likewise.
7287 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
7288 (tls_pie_pic_test): New target.
7289 * testsuite/Makefile.in: Rebuild.
7290
c7177d31
ILT
7291 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
7292 (tls_test_main_pie.o, tls_test_pie.o): New targets.
7293 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
7294 * testsuite/Makefile.in: Rebuild.
7295
684b268a
DM
72962010-02-09 David S. Miller <davem@davemloft.net>
7297
7298 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
7299 R_SPARC_RELATIVE using ->add_local_relative().
7300 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
7301
612a8d3d
DM
7302 * output.h (Output_data_dynamic::add_section_size): New method
7303 that takes two Output_data objects.
7304 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
7305 entry param. Handle it in initializers.
7306 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
7307 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
7308 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
7309 arg.
7310 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
7311 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
7312 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
7313 for dynrel_includes_plt.
7314 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7315 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7316 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
7317 before .rela.plt
7318 (Target_sparc::do_finalize_sections): Update to pass true for
7319 dynrel_includes_plt.
7320 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
7321 output before .rela.plt
7322 (Target_powerpc::do_finalize_sections): Update to pass true for
7323 dynrel_includes_plt when 32-bit.
7324
cb1be87e
DK
73252010-02-08 Doug Kwan <dougkwan@google.com>
7326
7327 * arm.cc (Arm_relobj::simple_input_section_output_address): New
7328 method.
7329 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
7330 Arm_relobj::scan_section_for_cortex_a8_stubs,
7331 Arm_relobj::do_relocation_section): Instead of calling
7332 Output_section::output_address, use faster
7333 Arm_relobj::simple_input_section_output_address.
7334
705b5121
DM
73352010-02-08 David S. Miller <davem@davemloft.net>
7336
7337 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
7338 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
7339 relocation helper function.
7340
024c4466
DM
7341 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
7342 just like R_SPARC_GOT{10,13,22}.
7343 (Target_sparc::Scan::local): Likewise.
7344 (Target_sparc::Relocate:relocate): Likewise.
7345
9109c078
ILT
73462010-02-06 Ian Lance Taylor <iant@google.com>
7347
7348 * configure.ac: Rewrite targetobjs duplicate removal code to use
7349 only shell constructs.
7350 * configure: Rebuild.
7351
cf846138
DK
73522010-02-05 Doug Kwan <dougkwan@google.com>
7353
7354 PR 11247
7355 * arm.cc (Arm_relobj::section_is_scannable): New method.
7356 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
7357 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
7358
6cfaf60b
DK
73592010-02-04 Doug Kwan <dougkwan@google.com>
7360
7361 PR 11247
7362 * arm-reloc-property.cc (cstdio): Include.
7363 * configure.ac (targetobjs): Remove duplicates.
7364 * configure: Regenerate.
7365 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
7366 big and little endian version for a given address size.
7367
5c57f1be
DK
73682010-02-03 Doug Kwan <dougkwan@google.com>
7369
7370 * arm-reloc-property.cc
7371 (Arm_reloc_property_table::reloc_name_in_error_message): New method
7372 definition.
7373 * arm-reloc-property.h
7374 (Arm_reloc_property_table::get_implemented_static_reloc_property):
7375 New method definition.
7376 (Arm_reloc_property_table::reloc_name_in_error_message): New method
7377 declaration.
7378 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
7379 overflow to N.
7380 (GOT_PREL): Change implemented to Y.
7381 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
7382 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
7383 (Arm_relocate_functions::movw_abs_nc): Remove method.
7384 (Arm_relocate_functions::movt_abs): Ditto.
7385 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
7386 (Arm_relocate_functions::thm_movt_abs): Ditto.
7387 (Arm_relocate_functions::movw_rel_nc): Ditto.
7388 (Arm_relocate_functions::movw_rel): Ditto.
7389 (Arm_relocate_functions::movt_rel): Ditto.
7390 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
7391 (Arm_relocate_functions:thm_movw_rel): Ditto.
7392 (Arm_relocate_functions:thm_movt_rel): Ditto.
7393 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
7394 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
7395 New method definitions.
7396 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
7397 (Arm_relocation_functions::arm_grp_ldr): Ditto.
7398 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
7399 (Arm_relocation_functions::arm_grp_ldc): Ditto.
7400 (Target_arm::Relocate::relocate): Check for non-static or
7401 unimplemented relocation code and exit early. Change calls to
7402 Target_arm::reloc_uses_thumb_bit and
7403 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
7404 instead. Refactor code to handle similar relocations to increase
7405 code sharing. Remove check for unsupported relocation code in switch
7406 statement.
7407 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
7408 relocation property table to find out size. Change error message to
7409 print out the name of a relocation code instead of the numeric value.
7410 (Target_arm::scan_reloc_for_stub): Use relocation property table
7411 instead of calling Target_arm::reloc_uses_thumb_bit().
7412
218c5831
DK
74132010-02-02 Doug Kwan <dougkwan@google.com>
7414
7415 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
7416 types of relaxed input section.
7417
0d31c79d
DK
74182010-02-02 Doug Kwan <dougkwan@google.com>
7419
7420 * Makefile.am (HFILES): Add arm-reloc-property.h.
7421 (DEFFILES): New.
2e702c99
RM
7422 (TARGETSOURCES): Add arm-reloc-property.cc
7423 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
7424 (libgold_a_SOURCES): $(DEFFILES)
7425 * Makefile.in: Regenerate.
7426 * arm-reloc-property.cc: New file.
7427 * arm-reloc-property.h: New file.
7428 * arm-reloc.def: New file.
7429 * arm.cc: Update comments.
7430 (arm-reloc-property.h): New included header.
7431 (arm_reloc_property_table): New global variable.
7432 (Target_arm::do_select_as_default_target): New method definition.
7433 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
7434 arm-reloc-property to targ_extra_obj.
7435 * parameters.cc (set_parameters_target): Call
7436 Target::select_as_default_target().
7437 * target.h (Target::select_as_default_target): New method definition.
7438 (Target::do_select_as_default_target): Same.
7439
546c7457
DK
74402010-02-01 Doug Kwan <dougkwan@google.com>
7441
7442 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
7443 first_output_text_section_.
7444 (Arm_exidx_fixup::first_output_text_section): New method definition.
7445 (Arm_exidx_fixup::first_output_text_section_): New data member.
7446 (Arm_exidx_fixup::process_exidx_section): Record the first text
7447 output section seen.
7448 (Arm_output_section::fix_exidx_coverage): Set correct linked section
7449 and entsize in output section header.
7450
11b861d5
DK
74512010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7452
7453 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
7454 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
7455 (Arm_relocate_functions::thm_alu11): New Method.
7456 (Arm_relocate_functions::thm_pc8): New Method.
7457 (Arm_relocate_functions::thm_pc12): New Method.
7458 (Target_arm::Scan::local): Handle the relocations.
7459 (Target_arm::Scan::global): Likewise.
7460 (Target_arm::Relocate::relocate): Likewise.
7461 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7462
c9a2c125
DK
74632010-01-29 Doug Kwan <dougkwan@google.com>
7464
7465 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
7466 of relocation types as ld.
7467
1521477a
DK
74682010-01-29 Doug Kwan <dougkwan@google.com>
7469
7470 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
7471 to public.
7472 (Arm_relocate_functions::thumb_branch_common): Ditto.
7473 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
7474 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
7475 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
7476 Arm_relocate_functions::jump24): Remove.
7477 (Target_arm::Relocate::relocate): Adjust code to call
7478 Arm_relocation_functions::arm_branch_common and
7479 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 7480 wrappers. Merge switch-cases together to reduce source code size.
1521477a 7481
e7eca48c
DK
74822010-01-29 Doug Kwan <dougkwan@google.com>
7483
7484 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
7485 output_local_symbol_count_needs_update_.
7486 (Arm_relobj::output_local_symbol_count_needs_update,
7487 Arm_relobj::set_output_local_symbol_count_needs_update,
7488 Arm_relobj::update_output_local_symbol_count): New methods.
7489 (Arm_relobj::output_local_symbol_count_needs_update_): New data
7490 member.
7491 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
7492 of pointed function as in a R_ARM_PREL31 relocation.
7493 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
7494 for output local symbol count updating.
7495 (Target_arm::do_relax): Update output local symbol counts in objects
7496 if necessary.
7497 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
7498
02961d7e
ILT
74992010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7500
7501 * arm.cc: Added support for the ARM relocations:
7502 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
7503 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
7504 (Arm_relocate_functions::movw_rel_nc): Renamed (was
7505 movw_prel_nc).
7506 (Arm_relocate_functions::movw_rel): New method.
7507 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
7508 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
7509 thm_movw_prel_nc).
7510 (Arm_relocate_functions::thm_movw_rel): New method.
7511 (Arm_relocate_functions::thm_movt_rel): Renamed (was
7512 thm_movt_prel).
7513 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
7514 relocations.
7515 (Target_arm::Scan::global): Likewise.
7516 (Target_arm::Relocate::relocate): Likewise.
7517 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7518 Likewise.
7519
b10d2873
ILT
75202010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7521
7522 * arm.cc: Added support for ARM group relocations.
7523 (Target_arm::reloc_needs_sym_origin): New method.
7524 (Arm_relocate_functions::calc_grp_kn): New method.
7525 (Arm_relocate_functions::calc_grp_residual): New method.
7526 (Arm_relocate_functions::calc_grp_gn): New method.
7527 (Arm_relocate_functions::arm_grp_alu): New Method.
7528 (Arm_relocate_functions::arm_grp_ldr): New Method.
7529 (Arm_relocate_functions::arm_grp_ldrs): New Method.
7530 (Arm_relocate_functions::arm_grp_ldc): New Method.
7531 (Target_arm::Scan::local): Handle the ARM group relocations.
7532 (Target_arm::Scan::global): Likewise.
7533 (Target_arm::Relocate::relocate): Likewise.
7534 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7535 Likewise.
7536
2b328d4e
DK
75372010-01-26 Doug Kwan <dougkwan@google.com>
7538
7539 * arm.cc (set): Include.
7540 (class Arm_exidx_fixup): Change type of last_input_section_ to const
7541 pointer type.
2e702c99 7542 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
7543 (Arm_output_section::append_text_sections_to_list): New method.
7544 (Arm_output_section::fix_exidx_coverage): Ditto.
7545 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 7546 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
7547 Relobj::set_section_offset() instead of
7548 Sized_relobj::invalidate_section_offset().
2e702c99 7549 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
7550 parameter for section headers. Ignore relocation sections for
7551 unallocated sections and EXIDX sections.
7552 (Target_arm::fix_exidx_coverage): New method.
7553 (Target_arm::output_section_address_less_than): New type.
7554 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
7555 linked text section instead of the EXIDX section.
7556 (Arm_output_section::create_stub_group): Add an assertion to check
7557 that this is not an EXIDX output section.
7558 (Arm_output_section::append_text_sections_to_list): New method.
7559 (Arm_output_section::fix_exidx_coverage): Ditto.
7560 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 7561 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
7562 (Target_arm::do_relax): Fix EXIDX output section coverage in the
7563 first pass.
7564 (Target_arm::fix_exidx_coverage): New method.
7565 * object.h (Relobj::set_output_section): New method.
7566 (Sized_relobj::invalidate_section_offset): Remove method.
7567 (Sized_relobj::do_invalidate_section_offset): Remove method.
7568 (Sized_relobj::do_set_section_offset): Handle offset value -1.
7569
c7f3c371
DK
75702010-01-25 Doug Kwan <dougkwan@google.com>
7571
7572 * arm.cc (Arm_exidx_merged_section::do_output_offset):
7573 Fix warning due to signed and unsigned comparison on a 32-bit host.
7574
8923b24c
DK
75752010-01-22 Doug Kwan <dougkwan@google.com>
7576
7577 * arm.cc (Target_arm::do_relax): Record an output section for section
7578 offset adjustment it contains any stub table that has changed.
7579 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
7580 offsets in an output section if necessary.
7581 * output.cc (Output_section::Output_section): Initialize
7582 section_offsets_need_adjustments_.
7583 (Output_section::add_input_section_for_script): Renamed to
7584 Output_section::add_simple_input_section.
7585 (Output_section::save_states): Add a comment.
7586 (Output_section::discard_states): New method defintion.
7587 (Output_section::adjust_section_offsets): Same.
7588 * output.h (Output_section::add_input_section_for_script): Renamed to
7589 Output_section::add_simple_input_section.
7590 (Output_section::discard_states): New method declaration.
7591 (Output_section::adjust_section_offsets): Same.
7592 (Output_section::section_offsets_need_adjustment,
7593 Output_section::set_section_offsets_need_adjustment): New method
7594 definitions.
7595 (Output_section::section_offsets_need_adjustment_): New data member.
7596 * script-sections.cc
7597 (Output_section_element_input::set_section_address): Adjust code for
7598 renaming of Output_section::add_input_section_for_script.
7599 (Orphan_output_section::set_section_address): Same.
7600
9b2fd367
DK
76012010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7602
7603 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
7604 Fix_v4bx enum values .
7605 * gold/options.h (General_options): New option definitions.
7606 (General_options::fix_v4bx): New method.
7607 (General_options::Fix_v4bx): New enum.
7608 * gold/options.cc (General_options::parse_fix_v4bx): New method.
7609 (General_options::parse_fix_v4bx_interworking): New method.
7610
80d0d023
DK
76112010-01-22 Doug Kwan <dougkwan@google.com>
7612
7613 * arm.cc (Arm_exidx_fixup): New class.
7614
af2cdeae
DK
76152010-01-21 Doug Kwan <dougkwan@google.com>
7616
7617 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
7618 classes.
7619 (Arm_exidx_section_offset_map): New type.
7620
993d07c1
DK
76212010-01-21 Doug Kwan <dougkwan@google.com>
7622
7623 * arm.cc (Arm_exidx_input_section): New class.
7624 (Arm_relobj::exidx_input_section_by_link,
7625 Arm_relobj::exidx_input_section_by_shndx,
7626 Arm_relobj::make_exidx_input_section): New methods.
7627 (read_arm_attributes_section): Remove.
7628 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
7629 information about them.
7630 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
7631 to here.
7632
5ac169d4
DK
76332010-01-20 Doug Kwan <dougkwan@google.com>
7634
7635 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
7636 Input_section_specifier to Section_id.
7637 (Target_arm::new_arm_input_section: Adjust code for change of key
7638 type.
7639 (Target_arm::find_arm_input_section): Ditto.
7640 * gc.h (object.h): Include for Section_id nand Section_id_hash.
7641 (Section_id): Remove.
7642 (Garbage_collection::Section_id_hash): Remove.
7643 * icf.h (object.h): Include for Section_id nand Section_id_hash.
7644 (Section_id): Remove.
7645 (Icf::Section_id_hash): Remove.
7646 * object.h (Section_id, Const_section_id, Section_id_hash,
7647 Const_section_id_hash): New type definitions.
7648 * output.cc (Output_section::add_relaxed_input_section): Change to
7649 use Const_section_id instead of Input_section_specifier as key type.
7650 (Output_section::add_merge_input_section): Ditto.
7651 (Output_section::build_relaxation_map): Change to use Section_id
7652 instead of Input_section_specifier as key type.
2e702c99 7653 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
7654 Ditto.
7655 (Output_section::convert_input_sections_to_relaxed_sections): Change
7656 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 7657 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
7658 (Output_section::find_relaxed_input_section): Ditto.
7659 * output.h (Input_section_specifier): Remove class.
7660 (Output_section::Output_section_data_by_input_section_map): Change
7661 key type to Const_section_id.
7662 (Output_section::Output_relaxed_input_section_by_input_section_map):
7663 Ditto.
7664 (Output_section::Relaxation_map): Change key type to Section_id.
7665
a2162063
ILT
76662010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7667
7668 * gold/arm.cc: Added support for R_ARM_V4BX relocation
7669 (class Arm_v4bx_stub): New class.
7670 (DEF_STUBS): Updated definition to support v4_veneer_bx.
7671 (Stub_factory::make_arm_v4bx_stub): New method.
7672 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
7673 (Stub_table::empty): Handle v4bx stubs.
7674 (Stub_table::add_arm_v4bx_stub): New method.
7675 (Stub_table::find_arm_v4bx_stub): New method.
7676 (Arm_relocate_functions::v4bx): New method.
7677 (Target_arm::fix_v4bx): New method.
7678 (Target_arm::Target_arm): Handle R_ARM_V4BX.
7679 (Stub_table::relocate_stubs): Likewise.
7680 (Stub_table::do_write): Likewise.
7681 (Stub_table::update_data_size_and_addralign): Likewise.
7682 (Stub_table::finalize_stubs): Likewise.
7683 (Target_arm::Scan::local): Likewise.
7684 (Target_arm::Scan::global): Likewise.
7685 (Target_arm::do_finalize_sections): Likewise.
7686 (Target_arm::Relocate::relocate): Likewise.
7687 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7688 Likewise.
7689 (Target_arm::scan_reloc_for_stub): Likewise.
7690 (Target_arm::scan_reloc_section_for_stubs): Likewise.
7691
5696ab0b
ILT
76922010-01-19 Ian Lance Taylor <iant@google.com>
7693
7694 * output.cc (Output_section_headers::do_sized_write): Write large
7695 segment count to sh_info field.
7696 (Output_file_header::do_sized_write): For large segment count,
7697 write PN_XNUM to e_phnum field.
7698
800d0f56
ILT
76992010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7700
7701 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
7702 (Arm_relocate_functions::thm_jump8): New function.
7703 (Arm_relocate_functions::thm_jump11): New function.
7704 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
7705 R_ARM_THM_JUMP11.
7706 (Target_arm::Scan::global): Likewise.
7707 (Target_arm::Relocate::relocate): Likewise.
7708 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7709 Likewise.
7710
41263c05
DK
77112010-01-14 Doug Kwan <dougkwan@google.com>
7712
7713 * arm.cc (map, utility): Include headers.
7714 (Target_arm::apply_cortex_a8_workaround): New method.
7715 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
7716 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
7717 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
7718 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
7719 the --[no-]fix-cortex-a8 command line options.
7720 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
7721 (Target_arm::relocate_stub): Use addend in instruction template.
7722 * options.h (DEFINE_bool): Set the user-set flag.
7723 (General_options): Add --[no-]-fix-cortex options.
7724 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 7725 : Update fast look-up map after conversion.
41263c05 7726
459e9b03
ST
77272010-01-14 Sriraman Tallam <tmsriram@google.com>
7728
7729 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
7730 in the first pass of do_layout.
7731
b521dfe4
DK
77322010-01-13 Doug Kwan <dougkwan@google.com>
7733
7734 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
7735 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
7736 apparent compiler problem of not folding static constant integral
7737 data members of elfcpp::Elf_sizes<32>.
7738
44272192
DK
77392010-01-13 Doug Kwan <dougkwan@google.com>
7740
7741 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
7742 Arm_relobj::section_needs_cortex_a8_stub_scanning,
7743 Arm_relobj::scan_section_for_cortex_a8_erratum,
7744 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
7745 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
7746 sections to scan for relocation stubs into a new method
7747 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
7748 relocation and Cortex-A8 stub scanning.
7749 (Target_arm::do_relax): Force stubs to be after stubbed sections
7750 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 7751 the beginning of a new relaxation pass. Update a comment.
44272192
DK
7752 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
7753
44b71ece
ILT
77542010-01-12 Ian Lance Taylor <iant@google.com>
7755
7756 * target-reloc.h (visibility_error): New inline function.
7757 (relocate_section): Call visibility_error.
7758 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
7759 (MOSTLYCLEANFILES): Likewise.
7760 (protected_4_pic.o, protected_3.err): New targets.
7761 * testsuite/protected_4.cc: New file.
7762
a120bc7f
DK
77632010-01-12 Doug Kwan <dougkwan@google.com>
7764
7765 * arm.cc (Cortex_a8_reloc): New class.
7766 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
7767 and cortex_a8_relocs_info_.
7768 (Target_arm::fix_cortex_a8): New method definition.
7769 (Target_arm::Cortex_a8_relocs_info): New type.
7770 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
7771 New data member declarations.
7772 (Target_arm::scan_reloc_for_stub): Record information about
7773 relocations for THUMB branches that might be exempted from the
7774 Cortex-A8 workaround.
7775 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
7776 at the beginning of a relaxation pass.
7777
20138696
DK
77782010-01-12 Doug Kwan <dougkwan@google.com>
7779
7780 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
7781 (Arm_relobj::Mapping_symbol_position,
7782 Arm_reloj::Mapping_symbol_position_less,
7783 Arm_relobj::Mapping_symbols_info): New types.
7784 (Target_arm::is_mapping_symbol_name): New method definition.
7785 (Arm_relobj::do_count_local_symbols): Save information about mapping
7786 symbols.
7787
089d69dc
DK
77882010-01-11 Doug Kwan <dougkwan@google.com>
7789
7790 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
7791 Arm_relocate_functions::thumb32_branch_upper,
7792 Arm_relocate_functions::thumb32_branch_lower,
7793 Arm_relocate_functions::thumb32_cond_branch_offset,
7794 Arm_relocate_functions::thumb32_cond_branch_upper,
7795 Arm_relocate_functions::thumb32_cond_branch_lower,
7796 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
7797 branch offset encoding.
7798 (Arm_relocate_functions::thumb_branch_common): Use new branch
7799 offset encoding methods to avoid code duplication.
7800 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
7801 (Stub_addend_reader::operator()): Use new branch encoding method
7802 to avoid code duplication.
7803
99e5bff2
DK
78042010-01-11 Doug Kwan <dougkwan@google.com>
7805
7806 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
7807 (Target_arm::do_finalize_sections): Define special EXIDX section
7808 symbols only if referenced.
7809 * gc.h (Garbage_collection::add_reference): New method.
7810 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
7811 code duplication.
7812
98e090bd
ILT
78132010-01-11 Ian Lance Taylor <iant@google.com>
7814
d0a91bd8
ILT
7815 * script.cc (Version_script_info::build_expression_list_lookup):
7816 Change complaing about duplicate wildcard match from error to
7817 warning.
7818
98e090bd
ILT
7819 * script.cc (class Lazy_demangler): Recreate--revert part of patch
7820 of 2009-12-30.
7821 (Version_script_info::Version_script_info): Initialize globs_,
7822 default_version_, default_is_global_, and exact_. Don't
7823 initialize globals_ or locals_.
7824 (Version_script_info::build_lookup_tables): Build local symbols
7825 first.
7826 (Version_script_info::unquote): New function.
7827 (Version_script_info::add_exact_match): New function.
7828 (Version_script_info::build_expression_list_lookup): Remove lookup
7829 parameter. Add is_global parameter. Change all callers. Handle
7830 wildcard pattern specially. Unquote pattern. Call
7831 add_exact_match.
7832 (Version_script_info::get_name_to_match): New function.
7833 (Version_script_info::get_symbol_version): New function.
7834 (Version_script_info::get_symbol_version_helper): Remove.
7835 (Version_script_info::check_unmatched_names): Call unquote.
7836 * script.h (class Version_script_info): Change get_symbol_version
7837 to be non-inline and add is_global parameter; change all callers.
7838 Rewrite symbol_is_local. Update declarations. Define struct
7839 Version_tree_match, Exact, Globs. Don't define struct Lookup.
7840 Remove globals_ and locals_ members. Add exact_, globs_,
7841 default_version_, is_global_.
7842 (Version_script_info::Glob): Remove pattern, add expression and
7843 is_global. Update constructor. Change all callers.
7844 * dynobj.cc (Versions::finalize): Mark the version symbol as the
7845 default version.
7846 (Versions::symbol_section_contents): If a symbol is undefined, or
7847 defined in a dynamic object, set the version index to
7848 VER_NDX_LOCAL.
7849 * symtab.cc (Symbol_table::add_from_relobj): Don't call
7850 symbol_is_local.
7851 (Symbol_table::add_from_pluginobj): Likewise.
7852 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
7853
d56962d3
DK
78542010-01-11 Doug Kwan <dougkwan@google.com>
7855
7856 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
7857 (incremental_dump_LDADD): Add linking option for libintl.
7858 * Makefile.in: Regenerate.
7859
94e6ee91
L
78602010-01-11 H.J. Lu <hongjiu.lu@intel.com>
7861
7862 PR gold/11144
7863 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
7864 instead of -Ds.
7865 * testsuite/Makefile.in: Regenerated.
7866
e96c574b
DK
78672010-01-10 Doug Kwan <dougkwan@google.com>
7868
7869 * options.h (DEFINE_var): Use parentheses around argument varname__
7870 in macro body to avoid any unintended subsequent substitutions.
7871
7198066b
ILT
78722010-01-10 Ian Lance Taylor <iant@google.com>
7873
ba4d53bf
ILT
7874 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
7875 candidates before doing symbol resolution.
7876
7198066b
ILT
7877 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
7878 ODR candidates if only one is weak.
7879
a2beed37
ILT
78802010-01-08 Ian Lance Taylor <iant@google.com>
7881
7882 * script.cc (Version_script_info::build_expression_list_lookup):
7883 Don't warn about ambiguous version, just record the ambiguity.
7884 (Version_script_info::get_symbol_version_helper): Give error if
7885 version is ambiguous.
7886
2fb7225c
DK
78872010-01-08 Doug Kwan <dougkwan@google.com>
7888
7889 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
7890 prev_data_size_ and prev_addralign_. Remove initializer for
7891 deleted data member has_been_changed_.
7892 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
7893 to determine if the table is empty.
7894 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
7895 Remove.
7896 (Stub_table::add_reloc_stub): Define method in class definition
7897 instead of just declaring it there.
7898 (Stub_table::add_cortex_a8_stub): New method definition.
7899 (Stub_table::update_data_size_and_addralign): Ditto.
7900 (Stub_table::finalize_stubs): Ditto.
7901 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
7902 (Stub_table::do_addralign_): Return address alignment in the
7903 (Stub_table::do_reset_address_and_file_offset): Define method in
7904 class definition instead of declaring it there. Set current data
7905 size to be the data size of the previous pass.
7906 (Stub_table::set_final_data_size): Use current data size as the
7907 final data size.
7908 (Stub_table::relocate_stub): Change parameter type of stub from
7909 Reloc_stub pointer to Stub pointer.
7910 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
7911 (Stub_table::Cortex_a8_stub_list): New typedef.
7912 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
7913 Stub_table::prev_addralign_): New data member.
7914 (Arm_relobj::Arm_relobj): Initialize data member
7915 section_has_cortex_a8_workaround_.
7916 (Arm_relobj::section_has_cortex_a8_workaround,
7917 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
7918 definitions.
7919 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
7920 declarations.
7921 (Target_arm::relocate_stub): Change parameter type of stub from
7922 Reloc_stub pointer to Stub pointer.
7923 (Insn_template::size, Insn_template::alignment): Handle
7924 THUMB16_SPECIAL_TYPE.
7925 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
7926 Stub_table::update_data_size_and_addralign,
7927 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
7928 definitions.
7929 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
7930 (Stub_table::do_write): Ditto.
7931 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 7932
880cd20d
ILT
79332010-01-08 Ian Lance Taylor <iant@google.com>
7934
7935 PR 11108
7936 * symtab.h (class Symbol): Remove fields is_target_special_ and
7937 has_plt_offset_. Add field is_defined_in_discarded_section_.
7938 (Symbol::is_defined_in_discarded_section): New function.
7939 (Symbol::set_is_defined_in_discarded_section): New function.
7940 (Symbol::has_plt_offset): Rewrite.
7941 (Symbol::set_plt_offset): Verify that new offset is not -1U.
7942 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
7943 Don't initialize is_target_special_ or has_plt_offset_.
7944 Initialize is_defined_in_discarded_section_.
7945 (Symbol_table::add_from_relobj): If appropriate, set
7946 is_defined_in_discarded_section.
7947 * resolve.cc (Symbol::override_base_with_special): Don't test
7948 is_target_special_. Change has_plt_offset_ to has_plt_offset().
7949 * target-reloc.h (relocate_section): Do special handling for
7950 symbols defined in discarded sections for global symbols as well
7951 as local symbols.
7952
2703e3eb
ILT
79532010-01-08 Ian Lance Taylor <iant@google.com>
7954
7955 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
7956 the SHT_SYMTAB case.
7957
339d40a3
ILT
79582010-01-08 Ian Lance Taylor <iant@google.com>
7959
7960 * object.cc (Sized_relobj::do_layout): Don't get confused if
7961 layout_eh_frame returns NULL.
7962
abecea76
ILT
79632010-01-08 Ian Lance Taylor <iant@google.com>
7964
7965 PR 11084
7966 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
7967 dynamic symbol table, use the normal symbol table.
7968 (Sized_dynobj::do_read_symbols): Remove assertion about type of
7969 symbol table.
7970
6b7dd3f3
ILT
79712010-01-08 Ian Lance Taylor <iant@google.com>
7972
7973 PR 11072
7974 * layout.cc (Layout::include_section): Remove .gnu_debuglink
7975 sections.
7976
36c50e63
L
79772010-01-08 H.J. Lu <hongjiu.lu@intel.com>
7978
7979 * version.cc (print_version): Change to "Copyright 2010".
7980
e291e7b9
ILT
79812010-01-08 Ian Lance Taylor <iant@google.com>
7982
7983 PR 10287
7984 PR 11063
7985 * i386.cc (class Target_i386): Change return type of plt_section
7986 to be non-const.
7987 (class Output_data_plt_i386): Add tls_desc_rel_ field.
7988 (Output_data_plt_i386::Output_data_plt_i386): Initialize
7989 tls_desc_rel_ field.
7990 (Output_data_plt_i386::rel_tls_desc): New function.
7991 (Target_i386::rel_tls_desc_section): New function.
7992 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
7993 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
7994 R_386_TLS_DESC reloc in rel_tls_desc_section.
7995 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
7996 Define struct Tlsdesc_info.
7997 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
7998 (Target_x86_64::do_reloc_symbol_index): New function.
7999 (Target_x86_64::add_tlsdesc_info): New function.
8000 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
8001 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
8002 tlsdesc_rel_ field.
8003 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
8004 all callers.
8005 (Output_data_plt_x86_64::rela_tlsdesc): New function.
8006 (Target_x86_64::rela_tlsdesc_section): New function.
8007 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
8008 handling.
8009 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
8010 (Target_x86_64::do_reloc_addend): New function.
8011 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
8012 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
8013 declarations. Define TARGET_CODE. Add arg field to u1_ union.
8014 (Output_reloc::type): New function.
8015 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
8016 (Output_reloc::is_target_specific): New function.
8017 (Output_reloc::target_arg): New function.
8018 (class Output_reloc) [SHT_RELA]: Add four new constructors for
8019 absolute relocs and target specific relocs.
8020 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
8021 add_target_specific.
8022 (class Output_data_reloc) [SHT_RELA]: Likewise.
8023 * output.cc (Output_reloc::Output_reloc): Add four new versions
8024 for absolute relocs and target specific relocs.
8025 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
8026 (Output_reloc::get_symbol_index): Likewise.
8027 (Output_reloc::local_section_offset): Check that local_sym_index_
8028 is not TARGET_CODE or 0.
8029 (Output_reloc::symbol_value): Likewise.
8030 (Output_reloc::write) [SHT_RELA]: Call target for target specific
8031 reloc.
8032 * target.h (class Target): Add reloc_symbol_index and reloc_addend
8033 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
8034 functions.
8035 * layout.cc (add_target_dynamic_tags): Use output section for
8036 DT_PLTRELSZ and DT_JMPREL.
8037
3a44184e
ILT
80382010-01-07 Ian Lance Taylor <iant@google.com>
8039
8040 PR 11061
8041 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
8042 function.
8043 (class Output_data_reloc_generic): Define.
8044 (class Output_data_reloc_base): Change base class to
8045 Output_data_reloc_generic. Change add() method to call
8046 bump_relative_reloc_count for a relative reloc. Remove
8047 sort_relocs_ field.
8048 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
8049 to sort_relocs().
8050 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
8051 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
8052 appropriate.
8053 * layout.h (class Layout): Update declaration.
8054
ea715a34
ILT
80552010-01-07 Ian Lance Taylor <iant@google.com>
8056
8057 * output.h (class Output_data): Add const version of
8058 output_section and do_output_section.
8059 (class Output_section_data): Add const version of
8060 do_output_section.
8061 (class Output_section): Likewise.
8062 * layout.cc (Layout::add_target_dynamic_tags): New function.
8063 * layout.h (class Layout): Update declarations.
8064 * arm.cc (Target_arm::do_finalize_sections): Use
8065 add_target_dynamic_tags.
8066 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8067 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
8068 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
8069 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8070
659948a4
ILT
80712010-01-07 Ian Lance Taylor <iant@google.com>
8072
8073 PR 11042
8074 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
8075 object as needed.
8076
9d3b86f6
ILT
80772010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
8078 Ian Lance Taylor <iant@google.com>
8079
8080 PR 11019
8081 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
8082 Xindex::read_symtab_xindex.
8083
bb0d3eb0
DK
80842010-01-07 Doug Kwan <dougkwan@google.com>
8085
8086 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
8087 (Insn_template::thumb16_bcond_insn): New method declaration.
8088 (Insn_template): Fix spelling.
8089 (Stub::thumb16_special): New method declaration.
8090 (Stub::do_write): Define virtual method which was previously pure
8091 virtual.
8092 (Stub::do_thumb16_special): New method declaration.
8093 (Stub::do_fixed_endian_write): New template member.
8094 (Reloc_stub::do_write): Remove.
8095 (Reloc_stub::do_fixed_endian_write): Remove.
8096 (Cortex_a8_stub): New class definition.
8097 (Stub_factory::make_cortex_a8_stub): New method definition.
8098 (Stub_factory::Stub_factory): Add missing static storage class
8099 qualifier for elf32_arm_stub_a8_veneer_blx.
8100
ffeef7df
ILT
81012010-01-07 Ian Lance Taylor <iant@google.com>
8102
dc3f80fe
ILT
8103 PR 10980
8104 * options.h (class General_options): Add --warn-unresolved-symbols
8105 and --error-unresolved-symbols.
8106 * errors.cc (Errors::undefined_symbol): Implement
8107 --warn-unresolved-symbols.
8108
ffeef7df
ILT
8109 * options.h (class General_options): Add -z text and -z textoff.
8110 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
8111
f1ec9ded
ST
81122010-01-06 Sriraman Tallam <tmsriram@google.com>
8113
8114 * gc.h (Garbage_collection::Cident_section_map): New typedef.
8115 (Garbage_collection::cident_sections): New function.
8116 (Garbage_collection::add_cident_section): New function.
8117 (Garbage_collection::cident_sections_): New member.
8118 (gc_process_relocs): Add references to sections whose names are C
8119 identifiers.
8120 * gold.h (cident_section_start_prefix): New constant.
8121 (cident_section_stop_prefix): New constant.
8122 (is_cident): New function.
8123 * layout.cc (Layout::define_section_symbols): Replace string constants
8124 with the newly defined constants.
8125 * object.cc (Sized_relobj::do_layout): Track sections whose names are
8126 C identifiers.
8127 * testsuite/Makefile.am: Add gc_orphan_section_test.
8128 * testsuite/Makefile.in: Regenerate.
8129 * testsuite/gc_orphan_section_test.cc: New file.
8130 * testsuite/gc_orphan_section_test.sh: New file.
8131
6eda8c29
ILT
81322010-01-06 Ian Lance Taylor <iant@google.com>
8133
b9674e17
ILT
8134 PR 10980
8135 * options.h (class General_options): Add --warn-shared-textrel.
8136 * layout.cc (Layout::finish_dynamic_section): Implement
8137 --warn-shared-textrel.
8138
6eda8c29
ILT
8139 PR 10980
8140 * options.h (class General_options): Add --warn-multiple-gp.
8141
32dcd44e
ILT
81422010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8143
8144 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
8145 $(THREADSLIB) and $(LIBDL).
8146 * Makefile.in: Rebuild.
8147
a192ba05
ILT
81482010-01-06 Ian Lance Taylor <iant@google.com>
8149
8150 PR 10980
8151 * options.cc (General_options::parse_section_start): New function.
8152 (General_options::section_start): New function.
8153 (General_options::General_options): Initialize all members.
8154 * options.h: Include <map>
8155 (class General_options): Add --section-start. Add section_starts_
8156 member.
8157 * layout.cc (Layout::attach_allocated_section_to_segment): If
8158 --section-start was used, set the address of the segment. Remove
8159 local sort_sections.
8160 (Layout::relaxation_loop_body): If the address of the load segment
8161 has been set by --section-start, don't use it.
8162 * output.h (Output_segment::update_flags_for_output_section): New
8163 function.
8164 * output.cc (Output_segment::add_output_section): Call
8165 update_flags_for_output_section.
8166
dde3f402
ILT
81672010-01-05 Ian Lance Taylor <iant@google.com>
8168
62dfdd4d
ILT
8169 PR 10980
8170 * options.h (class General_options): Add --undefined-version.
8171 * script.cc (struct Version_expression): Add was_matched_by_symbol
8172 field.
8173 (Version_script_info::matched_symbol): New function.
8174 (Version_script_info::get_symbol_version_helper): Call
8175 matched_symbol.
8176 (Version_script_info::check_unmatched_names): New function.
8177 * script.h (class Version_script_info): Update declarations.
8178 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
8179
9c4ae156
ILT
8180 * options.h (class General_options): Use DEFINE_bool_alias for
8181 allow_multiple_definition.
8182 * resolve.cc (Symbol_table::should_override): Don't test
8183 allow_multiple_definition.
8184
dde3f402
ILT
8185 PR 10980
8186 * options.h (class General_options): Add --cref.
8187 * main.cc (main): Print cref table if --cref. Don't close mapfile
8188 until after printing cref table.
8189 * cref.cc: Include "symtab.h".
8190 (class Cref_inputs): Define Cref_table_compare and Cref_table.
8191 (Cref_table_compare::operator()): New function.
8192 (Cref_inputs::gather_cref): New function.
8193 (filecol): New static const.
8194 (Cref_inputs::print_cref): New function.
8195 (Cref::print_cref): New function.
8196 * cref.h: Include <cstdio>.
8197 (class Cref): Update declarations.
8198 * mapfile.h (Mapfile::file): New function.
8199 * object.h (class Object): Define Symbols. Declare virtual
8200 do_get_global_symbols.
8201 (Object::get_global_symbols): New function.
8202 * object.cc (Input_objects::add_object): Pass object to cref_ if
8203 --cref.
8204 (Input_objects::archive_start): Likewise.
8205 (Input_objects::archive_stop): Likewise.
8206 (Input_objects::print_cref): New function.
8207 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
8208 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
8209 --cref.
8210 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
8211 function.
8212 * plugin.h (class Sized_pluginobj): Update declarations.
8213
8781f709
ILT
82142010-01-05 Ian Lance Taylor <iant@google.com>
8215
8216 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
8217 to is_default_version. Rename insdef to insdefault.
8218 (Symbol_table::add_from_relobj): Rename def to is_default_version
8219 and local to is_forced_local.
8220 (Symbol_table::add_from_pluginobj): Likewise.
8221 (Symbol_table::add_from_dynobj): Likewise.
8222 (Symbol_table::define_special_symbol): Rename insdef to
8223 insdefault.
8224
fe35d28d
ILT
82252010-01-04 Ian Lance Taylor <iant@google.com>
8226
30bc8c46
ILT
8227 PR 10980
8228 * options.h (class General_options): Add
8229 --allow-multiple-definition and -z muldefs.
8230 * resolve.cc (Symbol_table::should_override): Don't warn about a
8231 multiple symbol definition if --allow-multiple-definition or -z
8232 muldefs.
8233
7eaea549
ILT
8234 PR 10980
8235 * options.h (class General_options): Add --add-needed and
8236 --copy-dt-needed-entries. Tweak --as-needed help entry.
8237 * object.cc (Input_objects::check_dynamic_dependencies): Give an
8238 error if --copy-dt-needed-entries aka --add-needed is used and
8239 would cause a change in behaviour.
8240
fe35d28d
ILT
8241 PR 10980
8242 * options.h (class General_options): Add -G as a short version of
8243 --shared. Add no-op options -assert, -g, and -i.
8244
55a2bb35
ST
82452010-01-04 Sriraman Tallam <tmsriram@google.com>
8246
8247 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
8248 check for .text or .gnu.linkonce.t sections.
8249 * icf.cc (Icf::find_identical_sections): Ditto.
8250 Change the detection for mangled function name within the section
8251 name.
8252 * icf.h (is_section_foldable_candidate): New function.
8253
719328e1
ILT
82542009-12-30 Ian Lance Taylor <iant@google.com>
8255
8256 PR 10980
8257 * options.h (class General_options): Permit two dashes with
8258 --retain-symbols-file.
8259
d7bb5745
ILT
82602009-12-30 Ian Lance Taylor <iant@google.com>
8261
403a15dd
ILT
8262 PR 10979
8263 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
8264 don't put the file header and segment headers in the text
8265 segment.
8266
eda294df
ILT
8267 PR 10979
8268 * common.cc (Sort_commons::operator()): Stabilize sort when both
8269 entries are NULL.
8270 (Symbol_table::do_allocate_commons_list): When allocating common
8271 symbols, skip a symbol which is no longer common.
8272 * symtab.h (Symbol::is_common): Test whether the symbol comes from
8273 an object before checking its type.
8274 * testsuite/common_test_2.c: New file.
8275 * testsuite/common_test_3.c: New file.
8276 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
8277 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
8278 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
8279 (common_test_2_pic.o, common_test_2.so): New targets.
8280 (common_test_3_pic.o, common_test_3.so): New targets.
8281 * testsuite/Makefile.in: Rebuild.
8282
d7bb5745
ILT
8283 PR 10979
8284 * script.cc (read_input_script): If we see a new SECTIONS clause,
8285 and we have added an input section, give an error.
8286 * layout.h (class Layout): Add have_added_input_section function.
8287 Add have_added_input_section_ field.
8288 * layout.cc (Layout::Layout): Initialize
8289 have_added_input_section_.
8290 (Layout::layout): Set have_added_input_section_.
8291 (Layout::layout_eh_frame): Likewise.
8292
fc59c572
ILT
82932009-12-30 Ian Lance Taylor <iant@google.com>
8294
8295 PR 10931
8296 * options.h (class General_options): Add --sort-common option.
8297 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
8298 * common.cc (Sort_common): Add sort_order parameter to
8299 constructor. Add sort_order_ field.
8300 (Sort_commons::operator): Check sort_order_.
8301 (Symbol_table::allocate_commons): Determine the sort order.
8302 (Symbol_table::do_allocate_commons): Add sort_order parameter.
8303 Change all callers.
8304 (Symbol_table::do_allocate_commons_list): Likewise.
8305
1c74fab0
ILT
83062009-12-30 Ian Lance Taylor <iant@google.com>
8307
8308 PR 10916
8309 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
8310 symbols from this object, don't change the visibility of an
8311 undefined symbol.
8312 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
8313
6affe781
ILT
83142009-12-30 Ian Lance Taylor <iant@google.com>
8315
8316 PR 10861
8317 * script.h (class Version_script_info): Define Language enum.
8318 Update declarations. Define Glob, Exact, and Lookup types. Add
8319 new fields globals_, locals_, and is_finalized_.
8320 * script.cc: Various formatting fixes.
8321 (class Parser_closure): Change language_stack_ from a vector of
8322 std::string to one of Version_script_info::Language. Adjust all
8323 uses accordingly.
8324 (class Lazy_demangler): Remove.
8325 (struct Version_expression): Change language from std::string to
8326 Version_script_info::Language.
8327 (Version_script_info::Version_script_info): New function.
8328 (Version_script_info::~Version_script_info): Don't call clear.
8329 (Version_script_info::finalize): New function.
8330 (Version_script_info::build_lookup_tables): New function.
8331 (Version_script_info::build_expression_list_lookup): New
8332 function.
8333 (Version_script_info::get_symbol_version_helper): Rewrite to use
8334 lookup tables.
8335 (Version_script_info::print_expression_list): Adjust to use
8336 Version_script_info::Language.
8337 (script_push_lex_into_version_mode): Check that the version script
8338 has not been finalized.
8339 (version_script_push_lang): Change language string to
8340 Version_script_info::Language.
8341 * options.cc (Command_line::version_script): New function.
8342 * options.h (class General_options): Add finalize_dynamic_list
8343 function. Change version_script from declaration to definition.
8344 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
8345 * testsuite/version_script.map: Remove duplicate def of foo.
8346 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
8347 version_script.map.
8348 * testsuite/Makefile.in: Rebuild.
8349
818bf354
ILT
83502009-12-30 Ian Lance Taylor <iant@google.com>
8351
8352 PR 10843
8353 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
8354 if the input symbol index is 0, make the output symbol index 0.
8355
ebcc8304
ILT
83562009-12-30 Ian Lance Taylor <iant@google.com>
8357
8358 PR 10670
8359 * options.h (class General_options): Add -x/--discard-all.
8360 * object.cc (Sized_relobj::do_count_local_symbols): Handle
8361 --discard-all. If the local symbol needs a dynamic entry, check
8362 that before handling --discard-locals.
8363
176fe33f
ILT
83642009-12-30 Ian Lance Taylor <iant@google.com>
8365
bb321bb1
ILT
8366 PR 10450
8367 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
8368 flags to PF_R.
8369 (Output_segment::add_output_section): Don't change the flags if
8370 the type is PT_TLS.
8371
176fe33f
ILT
8372 PR 10450
8373 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
8374 GNU hash table if they need a dynamic value. Otherwise, don't add
8375 them if they are defined in a dynamic object or are forced local.
8376
e8cd95c7
ILT
83772009-12-29 Ian Lance Taylor <iant@google.com>
8378
1b81fb71
ILT
8379 PR 10450
8380 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
8381 .gnu.hash table for a 32-bit target.
8382
8d6d383d
ILT
8383 PR 10450
8384 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
8385 regular and a dynamic object only needs a dynamic symbol table
8386 entry if it is externally visible.
8387
e785ec03
ILT
8388 PR 10450
8389 * i386.cc (class Target_i386): Initialize global_offset_table_ in
8390 constructor. Add global_offset_table_ field.
8391 (Target_i386::got_section): Set global_offset_table_.
8392 (Target_i386::do_finalize_sections): Set global_offset_table_
8393 size.
8394 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
8395 in constructor. Add global_offset_table_ field.
8396 (Target_x86_64::got_section): Set global_offset_table_.
8397 (Target_x86_64::do_finalize_sections): Set global_offset_table_
8398 size.
8399
1a2dff53
ILT
8400 * layout.cc (Layout::Layout): Initialize increase_relro_.
8401 (Layout::get_output_section): Add is_relro, is_last_relro, and
8402 is_first_non_relro parameters. Change all callers.
8403 (Layout::choose_output_section): Likewise.
8404 (Layout::add_output_section_data): Likewise.
8405 (Layout::make_output_section): Likewise.
8406 (Layout::set_segment_offsets): Clear increase_relro when using a
8407 linker script.
8408 * layout.h (class Layout): Add increase_relro method. Add
8409 increase_relro_ field. Update declarations.
8410 * output.cc (Output_section::Output_section): Initialize
8411 is_last_relro_ and is_first_non_relro_.
8412 (Output_segment::add_output_section): Group relro sections is
8413 do_sort is true. Handle is_last_relro and is_first_non_relro.
8414 (Output_segment::maximum_alignment): Remove relro handling.
8415 (Output_segment::set_section_addresses): Add increase_relro
8416 parameter. Change all callers. Add initial alignment to align
8417 relro sections on separate page. Remove old relro handling.
8418 (Output_segment::set_section_list_addresses): Remove in_relro
8419 parameter. Change all callers.
8420 (Output_segment::set_offset): Add increase parameter. Change all
8421 callers. Remove old relro handling.
8422 * output.h (class Output_section): Add new methods: is_last_relro,
8423 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
8424 Add is_last_relro_ and is_first_non_relro_ fields.
8425 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
8426 Create separate .got.plt section. Call increase_relro.
8427 * x86_64.cc (Target_x86_64::got_section): Likewise.
8428 * testsuite/relro_script_test.t: Add .got.plt.
8429
f0ba79e2
ILT
8430 PR 10450
8431 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
8432 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
8433 (Layout::finalize): Call set_dynamic_symbol_size.
8434 (Layout::set_dynamic_symbol_size): New function.
8435 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
8436 set_dynamic_symbol_size.
8437
e8cd95c7
ILT
8438 PR 10450
8439 * output.h (class Output_section): Add is_entsize_zero_ field.
8440 * output.cc (Output_section::Output_section): Initialize
8441 is_entsize_zero_.
8442 (Output_section::set_entsize): If two different entsizes are
8443 requested, force it to zero.
8444 (Output_section::add_input_section): Set flags for .debug_str
8445 before updating section flags. Set entsize.
8446 (Output_section::update_flags_for_input_section): Set SHF_MERGE
8447 and SHF_STRING if all input sections have those flags.
8448
3e1b9a8a
RÁE
84492009-12-29 Rafael Espindola <espindola@google.com>
8450
8451 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
8452 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
8453 reporting.
3e1b9a8a 8454
3dcad376
ST
84552009-12-29 Sriraman Tallam <tmsriram@google.com>
8456
8457 * options.cc (General_options::parse_version): Allow -v to exit
8458 without an error if there is nothing to link.
8459
084e2665
ILT
84602009-12-29 Ian Lance Taylor <iant@google.com>
8461
8462 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
8463 using a version of gcc before 4.1.
8464 * configure: Rebuild.
8465
250acde3
CD
84662009-12-28 Chris Demetriou <cgd@google.com>
8467
8468 * attributes.cc (Output_attributes_section_data::do_write): Use
8469 std::vector::front rather than std::vector::data.
8470
99fff23b
ILT
84712009-12-28 Ian Lance Taylor <iant@google.com>
8472
8473 * symtab.h (class Symbol_table): Add enum Defined.
8474 * resolve.cc (Symbol_table::should_override): Add defined
8475 parameter. Change all callers. Test whether object is NULL
8476 before calling a method on it.
8477 (Symbol_table::report_resolve_problem): Add defined parameter.
8478 Change all callers.
8479 (Symbol_table::should_override_with_special): Likewise.
8480 * symtab.cc (Symbol_table::define_in_output_data): Add defined
8481 parameter. Change all callers.
8482 (Symbol_table::do_define_in_output_data): Likewise.
8483 (Symbol_table::define_in_output_segment): Likewise.
8484 (Symbol_table::do_define_in_output_segment): Likewise.
8485 (Symbol_table::define_as_constant): Likewise.
8486 (Symbol_table::do_define_as_constant): Likewise.
8487 * script.h (class Symbol_assignment): Add is_defsym parameter to
8488 constructor; change all callers.
8489 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
8490 parameter. Change all callers. Add is_defsym_ field.
8491 (class Parser_closure): Add parsing_defsym parameter to
8492 constructor; change all callers. Add parsing_defsym accessor
8493 function. Add parsing_defsym_ field.
8494
556bd683
ILT
84952009-12-28 Ian Lance Taylor <iant@google.com>
8496
8497 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 8498 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 8499
1782c879
ILT
85002009-12-23 Ian Lance Taylor <iant@google.com>
8501
8502 * i386.cc (Target_i386::do_calls_non_split): Recognize
8503 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
8504 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
8505 -fsplit-stack prologue when using %r11.
1782c879 8506
329ca2b1
ST
85072009-12-21 Sriraman Tallam <tmsriram@google.com>
8508
8509 * options.cc (General_options::parse_version): Make -v continue and do
8510 the link like GNU ld does.
8511
d675ff46
RÁE
85122009-12-17 Rafael Avila de Espindola <espindola@google.com>
8513
8514 * Makefile.am (CCFILES): Add timer.cc.
8515 (HFILES): Add timer.h.
8516 * configure.ac: Check for sysconf and times.
8517 * main.cc: include timer.h.
8518 (main): Use Timer instead of get_run_time.
8519 * timer.cc: New.
8520 * timer.h: New.
8521 * workqueue.cc: include timer.h.
8522 (Workqueue::find_and_run_task):
8523 Report user, sys and wall time.
8524 * Makefile.in: Regenerate.
8525 * config.in: Regenerate.
8526 * configure: Regenerate.
8527
d6344fb5
DK
85282009-12-16 Doug Kwan <dougkwan@google.com>
8529
8530 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
8531 sections.
8532 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
8533 relaxed input sections.
8534 * output.cc (Output_section::find_relaxed_input_section): Change
8535 return type to Output_relaxed_input_section pointer. Adjust code
8536 for new type of relaxed_input_section_map_.
8537 * output.h (Output_section::find_relaxed_input_section): Change
8538 return type to Output_relaxed_input_section pointer.
8539 (Output_section::Output_relaxed_input_section_by_input_section_map):
8540 New type.
8541 (Output_section::relaxed_input_section_map_): Change type to
8542 Output_section::Output_relaxed_input_section_by_input_section_map.
8543 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
8544 input section.
8545
0e0d5469
ILT
85462009-12-15 Ian Lance Taylor <iant@google.com>
8547
8548 * layout.cc (Layout::create_shstrtab): Only write out after input
8549 sections if we are compressing debug sections.
8550
0649a889
ILT
85512009-12-15 Ian Lance Taylor <iant@google.com>
8552
8553 * archive.cc (Archive::add_symbols): Only look up a symbol without
8554 a version if there is, in fact, a version.
8555
2ea97941
ILT
85562009-12-14 Ian Lance Taylor <iant@google.com>
8557
8558 Revert -Wshadow changes, all changes from:
8559 2009-12-11 Doug Kwan <dougkwan@google.com>
8560 2009-12-11 Nick Clifton <nickc@redhat.com>
8561 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
8562
b0eec2cc
DK
85632009-12-11 Doug Kwan <dougkwan@google.com>
8564
8565 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
8566 due to -Wshadow.
8567 * attributes.cc (Object_attribute::size): Ditto.
8568 (Attributes_section_data::size): Ditto.
8569 (Attributes_section_data::Attributes_section_data): Ditto.
8570 (Output_attributes_section_data::do_write): Ditto.
8571 * attributes.h (Object_attribute::set_type): Ditto.
8572 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
8573
91d6fa6a
NC
85742009-12-11 Nick Clifton <nickc@redhat.com>
8575
8576 * archive.cc: Fix shadowed variable warnings.
8577 * arm.cc: Likewise.
8578 * compressed_output.cc: Likewise.
8579 * compressed_output.h: Likewise.
8580 * configure: Likewise.
8581 * dwarf_reader.cc: Likewise.
8582 * dynobj.cc: Likewise.
8583 * dynobj.h: Likewise.
8584 * ehframe.cc: Likewise.
8585 * ehframe.h: Likewise.
8586 * errors.cc: Likewise.
8587 * expression.cc: Likewise.
8588 * fileread.cc: Likewise.
8589 * fileread.h: Likewise.
8590 * freebsd.h: Likewise.
8591 * i386.cc: Likewise.
8592 * icf.cc: Likewise.
8593 * incremental.h: Likewise.
8594 * layout.cc: Likewise.
8595 * layout.h: Likewise.
8596 * mapfile.cc: Likewise.
8597 * merge.cc: Likewise.
8598 * merge.h: Likewise.
8599 * object.cc: Likewise.
8600 * object.h: Likewise.
8601 * options.h: Likewise.
8602 * output.cc: Likewise.
8603 * output.h: Likewise.
8604 * parameters.cc: Likewise.
8605 * plugin.cc: Likewise.
8606 * powerpc.cc: Likewise.
8607 * reduced_debug_output.cc: Likewise.
8608 * reduced_debug_output.h: Likewise.
8609 * reloc.cc: Likewise.
8610 * reloc.h: Likewise.
8611 * resolve.cc: Likewise.
8612 * script-sections.cc: Likewise.
8613 * script.cc: Likewise.
8614 * script.h: Likewise.
8615 * sparc.cc: Likewise.
8616 * symtab.cc: Likewise.
8617 * symtab.h: Likewise.
8618 * target-select.cc: Likewise.
8619 * target-select.h: Likewise.
8620 * token.h: Likewise.
8621 * workqueue.cc: Likewise.
8622 * workqueue.h: Likewise.
8623 * x86_64.cc: Likewise.
8624
a0351a69
DK
86252009-12-10 Doug Kwan <dougkwan@google.com>
8626
8627 * arm.cc (attributes.h): New include.
8628 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
8629 (Arm_relobj::~Arm_relobj): Delete object pointed by
8630 attributes_section_data_.
8631 (Arm_relobj::attributes_section_data): New method definition.
8632 (Arm_relobj::attributes_section_data_): New data member declaration.
8633 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
8634 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
8635 attributes_section_data_.
8636 (Arm_dynobj::attributes_section_data): New method definition.
8637 (Arm_dynobj::attributes_section_data_): New data member declaration.
8638 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
8639 initialization value of may_use_blx_ to false.
2e702c99 8640 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
8641 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
8642 object attributes to compute results instead of hard-coding.
8643 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
8644 Target_arm::get_secondary_compatible_arch,
8645 Target_arm::set_secondary_compatible_arch
8646 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
8647 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
8648 New method declarations.
8649 (Target_arm::get_aeabi_object_attribute): New method definition.
8650 (Target_arm::attributes_section_data_): New data member declaration.
8651 (read_arm_attributes_section): New template definition.
8652 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
8653 (Arm_dynobj::do_read_symbols): Ditto.
8654 (Target_arm::do_finalize_sections): Merge attributes sections from
8655 input. Check for BLX use after attributes section merging.
8656 Fix __exidx_start and __exidx_end visibility. Create an
8657 .ARM.attributes section if necessary.
8658 (Target_arm::get_secondary_compatible_arch,
8659 Target_arm::set_secondary_compatible_arch,
8660 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
8661 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 8662 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
8663 New method definitions.
8664
b59befec
ILT
86652009-12-09 Ian Lance Taylor <iant@google.com>
8666
8667 * plugin.cc (Plugin::load): Don't cast from void* to a function
8668 pointer.
8669
1276bc89
ILT
86702009-12-09 Ian Lance Taylor <iant@google.com>
8671
8672 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
8673 information fields.
8674
2f2de248
L
86752009-12-09 H.J. Lu <hongjiu.lu@intel.com>
8676
8677 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
8678 Replace two_file_shared_1.so with two_file_shared_2.so.
8679 * testsuite/Makefile.in: Regenerated.
8680
4f787271
DK
86812009-12-08 Doug Kwan <dougkwan@google.com>
8682
8683 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
8684 (HFILES): Add attributes.h and int_encoding.h.
8685 * Makefile.in: Regenerate.
8686 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
8687 function definitions to int_encoding.cc
8688 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
8689 prototypes to int_encoding.h
8690 * reduced_debug_output.cc (int_encoding.h): New include.
8691 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
8692 function definitions to int_encoding.cc
8693 (insert_into_vector, read_from_pointer): Move template definitions to
8694 int_encoding.h
8695 * attributes.cc: New file.
8696 * attributes.h: New file.
8697 * int_encoding.cc: New file.
8698 * int_encoding.h: New file.
8699
20b52f1a
RÁE
87002009-12-07 Rafael Avila de Espindola <espindola@google.com>
8701
8702 PR gold/11055
8703 * incremental-dump.cc (dump_incremental_inputs): New.
8704 (main): Use dump_incremental_inputs.
8705
53d7974c
L
87062009-12-07 H.J. Lu <hongjiu.lu@intel.com>
8707
8708 PR gold/10893
8709 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
8710 checking elfcpp::STT_FUNC.
8711 (Target_i386::Relocate::relocate): Likewise.
8712 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
8713
8714 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
8715 symbols from shared libraries into normal FUNC symbols.
8716
8717 * symtab.h (Symbol): Add is_func and use it.
8718
05a352e6
DK
87192009-12-05 Doug Kwan <dougkwan@google.com>
8720
8721 * arm.cc (Target_arm::arm_info): Initialize new fields
8722 attributes_section and attributes_vendor.
8723 * i386.cc (Target_i386::i386_info): Same.
8724 * object.cc (Sized_relobj::do_layout): Skip attribute section.
8725 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
8726 fields attributes_section and attributes_vendor.
53d7974c 8727 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
8728 * target.h (Target::attributes_section, Target::attributes_vendor,
8729 Target::is_attributes_section, Target::attribute_arg_type,
8730 Target::attributes_order): New method definitions.
8731 (Target::Target_info::attributes_section,
8732 Target::Target_info::attributes_vendor): New fields.
8733 (Target::do_attribute_arg_type, Target::do_attributes_order): New
8734 virtual method definitions.
8735 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
8736 attributes_section and attributes_vendor.
8737 * testsuite/testfile.cc (Target_test::test_target_info): Same.
8738
f4e5969c
DK
87392009-12-05 Doug Kwan <dougkwan@google.com>
8740
8741 * arm.cc: Update comments about interworking and stub generation.
8742 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
8743 considered as non-PIC.
8744 (Arm_relocate_functions::base_abs): Fix formatting.
8745 (Arm_relocate_functions::got_prel): Fix comment. Change interface
8746 of function to use GOT entry address instead of offset.
8747 (Target_arm::Scan::global): Issue an error if a symbol would need a
8748 PLT does not get one because it is untyped. Remove code to create
8749 dynamic symbols for relative branches.
8750 (Target_arm::Relocate::relocate: Use 0 instead of false since function
8751 takes unsigned integer instead of boolean.
8752
1abce4a6
L
87532009-12-05 H.J. Lu <hongjiu.lu@intel.com>
8754
8755 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
8756 (two_file_test_LDADD): Likewise.
8757 (common_test_1_LDADD): Likewise.
8758 (exception_test_LDADD) Likewise.
8759 (weak_test_LDADD): Likewise.
8760 (many_sections_test_LDADD): Likewise.
8761 (initpri1_LDADD): Likewise.
8762 (script_test_1_LDADD): Likewise.
8763 (script_test_2_LDADD): Likewise.
8764 (justsyms_LDADD): Likewise.
8765 (binary_test_LDADD): Likewise.
8766 (large_LDADD): Likewise.
8767 * testsuite/Makefile.in: Regenerated.
8768
adcf2816 87692009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 8770
adcf2816
L
8771 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
8772 (Symbol_table::override_with_special): Likewise.
8773 (Symbol_table::add_from_object): Likewise.
8774
28e67f5d
RÁE
87752009-12-04 Rafael Avila de Espindola <espindola@google.com>
8776
8777 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
8778 Don't set the data_offset twice.
8779
ae10a101
RÁE
87802009-12-04 Rafael Avila de Espindola <espindola@google.com>
8781
8782 * testsuite/Makefile.in: Regenerate.
8783
f59f41f3
DK
87842009-12-03 Doug Kwan <dougkwan@google.com>
8785
8786 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
8787 (Target_arm::do_finalize_sections): Add parameter for symbol table
8788 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
8789 * i386.cc (Target_i386::do_finalize_sections): Add an additional
8790 parameter for symbol table pointer.
8791 * layout.cc (Layout::finalize): Call Target::finalize_sections with
8792 an additional parameter for a pointer to symbol table.
8793 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
8794 parameter for a symbol table pointer.
8795 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
8796 * target.h (Target::finalize_sections, Target::do_finalize_sections):
8797 Ditto.
8798 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
8799 parameter for a symbol table pointer.
8800
ca55d848
RÁE
88012009-12-03 Rafael Avila de Espindola <espindola@google.com>
8802
8803 * incremental.cc (Incremental_inputs_header)
8804 (Incremental_inputs_header_write, Incremental_inputs_entry)
8805 (Incremental_inputs_entry_write): Move ...
8806 * incremental.h (Incremental_inputs_header)
8807 (Incremental_inputs_header_write, Incremental_inputs_entry)
8808 (Incremental_inputs_entry_write): here.
8809
3aec4f9c
RÁE
88102009-12-02 Rafael Avila de Espindola <espindola@google.com>
8811
8812 * incremental.cc (make_sized_incremental_binary): Set the target.
8813 Error if it is incompatible.
8814 * output.h (Output_file): Add filename method.
8815
9c0ae74d
RÁE
88162009-12-02 Rafael Avila de Espindola <espindola@google.com>
8817
8818 * incremental.cc (Incremental_inputs_entry): Remove unused argument
8819 from the get_* methods.
8820
a45500ae
RÁE
88212009-12-02 Rafael Avila de Espindola <espindola@google.com>
8822
8823 * incremental-dump.cc (main): Check that the offeset of a script is 0.
8824 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
8825 Write 0 for the data_offset of scripts.
8826
325e6408
RÁE
88272009-12-02 Rafael Avila de Espindola <espindola@google.com>
8828
8829 * testsuite/Makefile.am: Add the incremental_test.sh test.
8830 * testsuite/incremental_test.sh: New.
8831 * testsuite/incremental_test_1.c: New.
8832 * testsuite/incremental_test_2.c: New.
8833
954c3e2e
RÁE
88342009-12-01 Rafael Avila de Espindola <espindola@google.com>
8835
703d02da 8836 * incremental-dump.cc (main): Fix typos.
954c3e2e 8837
f8086623
RÁE
88382009-11-27 Rafael Avila de Espindola <espindola@google.com>
8839
8840 PR gold/11025
8841 * incremental-dump.cc (main): Use llu to print 64 bit values.
8842
3b0dd6ac
L
88432009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
8844 H.J. Lu <hongjiu.lu@intel.com>
8845
8846 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
8847 $(LIBDL).
8848 (incremental_dump_LDADD): Likewise.
8849 * Makefile.in: Regenerated.
8850
a6d1ef57 88512009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 8852
a6d1ef57
DK
8853 Revert:
8854
8855 2009-11-25 Doug Kwan <dougkwan@google.com>
8856
8857 * arm.cc (Target_arm::Target_arm): Move method definition
8858 outside of class definition. Add code to handle
8859 --target1-rel, --target1-abs and --target2= options.
8860 (Target_arm::get_reloc_reloc_type): Change method to be
8861 non-static and const.
8862 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
8863 New data member declaration.
8864 (Target_arm::Scan::local, Target_arm::Scan::global,
8865 Target_arm::Relocate::relocate,
8866 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8867 Adjust call to Target_arm::get_real_reloc_type.
8868 (Target_arm::get_real_reloc_type): Use command line options
8869 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8870 * options.h (--target1-rel, --target1-abs, --target2): New
8871 ARM-only options.
8872
50aeb7d4
DK
88732009-11-25 Doug Kwan <dougkwan@google.com>
8874
8875 * arm.cc (Target_arm::Target_arm): Move method definition outside of
8876 class definition. Add code to handle --target1-rel, --target1-abs
8877 and --target2= options.
8878 (Target_arm::get_reloc_reloc_type): Change method to be non-static
8879 and const.
8880 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
8881 member declaration.
8882 (Target_arm::Scan::local, Target_arm::Scan::global,
8883 Target_arm::Relocate::relocate,
8884 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
8885 call to Target_arm::get_real_reloc_type.
8886 (Target_arm::get_real_reloc_type): Use command line options to
8887 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8888 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
8889 options.
8890
51938283
DK
88912009-11-25 Doug Kwan <dougkwan@google.com>
8892
8893 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
8894 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
8895 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
8896 formatting.
8897 (Arm_relocate_functions::thm_call): Replace body with a call to
8898 Arm_relocate_functions::thumb_branch_common.
8899 (Arm_relocate_functions::thm_jump24,
8900 Arm_relocate_functions::thm_xpc22): New method definitions.
8901 (Arm_relocate_functions::thumb_branch_common): New method definition.
8902 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
8903 operator.
8904 (Target_arm::Relocate::relocate): Adjust call to thm_call.
8905 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
8906
e2b8f3c4
RÁE
89072009-11-24 Rafael Avila de Espindola <espindola@google.com>
8908
8909 * Makefile.am: Build incremental-dump
8910 * Makefile.in: Regenerate.
8911 * incremental-dump.cc: New.
8912 * incremental.cc (Incremental_inputs_header_data,
8913 Incremental_inputs_entry_data): Move to incremental.h
8914 * incremental.h: (Incremental_inputs_header_data,
8915 Incremental_inputs_entry_data): Move from incremental.cc
8916
bcba9aec
RÁE
89172009-11-24 Rafael Avila de Espindola <espindola@google.com>
8918
8919 * incremental.cc (Incremental_inputs_header,
8920 Incremental_inputs_header_write, Incremental_inputs_entry,
8921 Incremental_inputs_entry_write): Add a typedef with the data type.
8922
7c3afe08
RÁE
89232009-11-24 Rafael Avila de Espindola <espindola@google.com>
8924
8925 * incremental.cc (Incremental_inputs_header,
8926 Incremental_inputs_header_write, Incremental_inputs_entry,
8927 Incremental_inputs_entry_write): Update comment about which
8928 type has the filed descriptions.
8929
d204b6e9
DK
89302009-11-15 Doug Kwan <dougkwan@google.com>
8931
8932 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
8933 (Arm_relocate_functions::arm_branch_common): Change method defintion
8934 in class definition to a method declaration and update list of formal
8935 parameters.
8936 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
8937 Arm_relocation_functions::jump24): Adjust call to
8938 Arm_relocate_functions::arm_branch_common. Update list of formal
8939 parameters.
8940 (Arm_relocate_functions::xpc25): New method definition.
8941 (Arm_relocate_functions::arm_branch_common): Move method defintion
8942 out from class definition. Use stubs for mode-switching and extending
8943 branch ranges.
8944 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
8945 specially. Change code to enable use of stubs in ARM branches.
8946
43d12afe
DK
89472009-11-10 Doug Kwan <dougkwan@google.com>
8948
8949 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
8950 in method declaration.
8951 (Target_arm::relocate_stub): New method declaration.
8952 (Target_arm::default_target): Change to return a pointer instead of
8953 a const reference.
8954 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
8955 Target_arm::default_target.
8956 (Arm_Relobj::do_relocate_sections): Remove options paramater in
8957 method definition.
8958 (Target_arm::relocate_section): Adjust view.
8959 (Target_arm::relocate_stub): New method definition.
8960
ac33a407
DK
89612009-11-10 Doug Kwan <dougkwan@google.com>
8962
8963 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
8964 a format warning.
8965 * incremental.cc (open_incremental_binary): Initialized local
8966 variables to avoid warnings.
8967 * object.cc (make_elf_object): Ditto.
8968 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
8969 a format warning.
e1df38aa 8970
88ee28e9
L
8971009-11-09 H.J. Lu <hongjiu.lu@intel.com>
8972
8973 PR gold/10930
8974 * testsuite/plugin_test.c: Include "config.h".
8975
2daedcd6
DK
89762009-11-09 Doug Kwan <dougkwan@google.com>
8977
8978 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
8979 (arm_symbol_value): Remove.
8980 (Arm_relocate_functions::arm_branch_common,
8981 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
8982 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
8983 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
8984 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
8985 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
8986 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
8987 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
8988 Arm_relocate_functions::thm_mobw_abs_nc,
8989 Arm_relocate_functions::thm_mov_abs,
8990 Arm_relocate_functions::movw_prel_nc,
8991 Arm_relocate_functions::thm_movt_abs,
8992 Arm_relocate_functions::movt_prel,
8993 Arm_relocate_functions::thm_movw_prel_nc,
8994 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
8995 (Target_arm::Relocate::relocate): Only decompose address into two
8996 parts if relocation type uses the thumb-bit and pass the actual
8997 bit instead of a flag indicating that the thumb-bit is used. Adjust
8998 calls to methods in Arm_relocate_functions for this change.
8999
1276bc89 90002009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
9001
9002 PR 10925
9003 * reloc.cc: Instantiate
9004 Sized_relobj::initialize_input_to_output_maps and
9005 Sized_relobj:free_input_to_output_maps.
9006
e53ad1b5
ILT
90072009-11-06 Ian Lance Taylor <iant@google.com>
9008
9009 PR 10876
9010 * defstd.cc (in_segment): Set only_if_ref true for "end".
9011
eb44217c
DK
90122009-11-06 Doug Kwan <dougkwan@google.com>
9013
9014 * arm.cc (class Reloc_stub): Correct a comment.
9015 (Target_arm::Target_arm): Initialize arm_input_section_map_.
9016 (Target_arm::scan_section_for_stubs): New method declaration.
9017 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
9018 Change methods from private to protected.
9019 (Target_arm::do_may_relax): New method definition.
9020 (Target_arm::do_relax, Target_arm::group_sections,
9021 Target_arm::scan_reloc_for_stub,
9022 Target_arm::scan_reloc_section_for_stubs): New method declarations.
9023 (Target_arm::arm_input_section_map_): New data member declaration.
9024 (Target_arm::scan_reloc_for_stub,
9025 Target_arm::scan_reloc_section_for_stubs,
9026 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
9027 Target_arm::do_relax): New method definitions.
9028
5d329b7d
ILT
90292009-11-06 Mikolaj Zalewski <mikolaj@google.com>
9030
9031 * configure.ac: Check for (struct stat)::st_mtim
9032 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
9033 * config.in: Regenerate.
9034 * configure: Regenerate.
9035
96a0d71b
ILT
90362009-11-05 Ian Lance Taylor <iant@google.com>
9037
9038 PR 10910
9039 * output.cc (Output_segment::add_output_section): Add missing
9040 return statement.
9041
594c8e5e
ILT
90422009-11-04 Ian Lance Taylor <iant@google.com>
9043
9044 PR 10880
9045 * object.h (class Object): Add is_needed and set_is_needed
9046 methods. Add is_needed_ field. Make bool fields into bitfields.
9047 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
9048 defined in a dynamic object and referenced by a regular object,
9049 set is_needed for the dynamic object.
9050 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
9051 if the file is marked with as_needed and it is not needed.
9052
22b127cc
ILT
90532009-11-04 Ian Lance Taylor <iant@google.com>
9054
9055 PR 10887
9056 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
9057 tags if data is discarded by linker script.
9058 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9059 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
9060 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
9061 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9062
f5c870d2
ILT
90632009-11-04 Ian Lance Taylor <iant@google.com>
9064
9065 * layout.cc (Layout::get_output_section): Add is_interp and
9066 is_dynamic_linker_section parameters. Change all callers.
9067 (Layout::choose_output_section): Likewise.
9068 (Layout::make_output_section): Likewise.
9069 (Layout::add_output_section_data): Add is_dynamic_linker_section
9070 parameter. Change all callers.
9071 * layout.h (class Layout): Update declarations.
9072 * output.h (class Output_section): Add is_interp, set_is_interp,
9073 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
9074 Add is_interp_, is_dynamic_linker_section_ fields. Change
9075 generate_code_fills_at_write_ to a bitfield.
9076 * output.cc (Output_section::Output_sections): Initialize new
9077 fields.
9078 (Output_segment::add_output_section): Add do_sort parameter.
9079 Change all callers.
9080
1ae4d23b
ILT
90812009-11-03 Ian Lance Taylor <iant@google.com>
9082
9083 PR 10860
9084 * options.h (class General_options): Add --warn-common.
9085 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
9086 merging two common symbols.
9087 (Symbol_table::should_override): Handle --warn-common when merging
9088 a common symbol with a defined symbol. Use report_resolve_problem
9089 for multiple definitions.
9090 (Symbol_table::report_resolve_problem): New function.
9091 * symtab.h (class Symbol_table): Declare report_resolve_problem.
9092
55da9579
DK
90932009-11-03 Doug Kwan <dougkwan@google.com>
9094
9095 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
9096 stub_factory_.
9097 (Target_arm::stub_factory): New method definition.
9098 (Target_arm::new_arm_input_section,
9099 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
9100 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 9101 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
9102 New type definitions.
9103 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
9104 member declarations.
9105 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
9106 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
9107 New method definitions.
9108
37a9ac43
ILT
91092009-11-03 Ian Lance Taylor <iant@google.com>
9110
9111 * options.h (class General_options): Add --warn_constructors.
9112
b3d6a3d4
ILT
91132009-11-03 Ian Lance Taylor <iant@google.com>
9114
9115 PR 10893
9116 * defstd.cc (in_section): Add entries for __rel_iplt_start,
9117 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
9118
934b01dd
ILT
91192009-11-03 Ian Lance Taylor <iant@google.com>
9120
9121 PR 10895
9122 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
9123 --msgid-bugs-address.
9124 (install-pdf): New target.
9125 (install-data_yes): Look up one directory to find mkinstalldirs.
9126
03c1939b
L
91272009-11-03 H.J. Lu <hongjiu.lu@intel.com>
9128
9129 * po/Make-in (.po.gmo): Don't generate .gmo files in source
9130 tree.
9131
ebd95253
DK
91322009-10-30 Doug Kwan <dougkwan@google.com>
9133
9134 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
9135
e9bbb538
DK
91362009-10-30 Doug Kwan <dougkwan@google.com>
9137
9138 * arm.cc (Stub_addend_reader): New struct template definition
9139 and partial specializations.
9140 (Stub_addend_reader::operator()): New method definition for a
9141 partially specialized template.
9142
d5b40221
DK
91432009-10-30 Doug Kwan <dougkwan@google.com>
9144
9145 * arm.cc (Arm_relobj::processor_specific_flags): New method
9146 definition.
9147 (Arm_relobj::do_read_symbols): New method declaration.
9148 (Arm_relobj::processor_specific_flags_): New data member declaration.
9149 (Arm_dynobj): New class definition.
9150 (Target_arm::do_finalize_sections): Add input_objects parameter.
9151 (Target_arm::do_adjust_elf_header): New method declaration.
9152 (Target_arm::are_eabi_versions_compatible,
9153 (Target_arm::merge_processor_specific_flags): New method declaration.
9154 (Target_arm::do_make_elf_object): New overloaded method definitions
9155 and declaration.
9156 (Arm_relobj::do_read_symbols): New method definition.
9157 (Arm_dynobj::do_read_symbols): Ditto.
9158 (Target_arm::do_finalize_sections): Add input_objects parameters.
9159 Merge processor-specific flags from all input objects.
9160 (Target_arm::are_eabi_versions_compatible,
9161 Target_arm::merge_processor_specific_flags,
9162 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
9163 New method definitions.
9164 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
9165 Input_objects pointer type parameter.
9166 * layout.cc (Layout::finalize): Pass input objects to target's.
9167 finalize_sections function.
9168 * output.cc (Output_file_header::do_sized_write): Set ELF file
9169 header's processor-specific flags.
9170 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
9171 Input_objects pointer type parameter.
9172 * sparc.cc (Target_sparc::do_finalize_sections): Same.
9173 * target.h (Input_objects): New forward class declaration.
9174 (Target::processor_specific_flags,
9175 Target::are_processor_specific_flags_sect): New method definitions.
9176 (Target::finalize_sections): Add input_objects parameter.
9177 (Target::Target): Initialize processor_specific_flags_ and
9178 are_processor_specific_flags_set_.
9179 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
9180 parameter.
9181 (Target::set_processor_specific_flags): New method definition.
9182 (Target::processor_specific_flags_,
9183 Target::are_processor_specific_flags_set_): New data member
9184 declarations.
9185 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
9186 Input_objects pointer type parameter.
9187
ebabffbd
DK
91882009-10-30 Doug Kwan <dougkwan@google.com>
9189
9190 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
9191
ad0f2072
ILT
91922009-10-28 Ian Lance Taylor <iant@google.com>
9193
9194 * object.h (class Relobj): Drop options parameter from
9195 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
9196 do_scan_relocs, do_relocate. Change all callers.
9197 (class Sized_relobj): Drop options parameters from
9198 do_gc_process_relocs, do_scan_relocs, do_relocate,
9199 do_relocate_sections, relocate_sections, emit_relocs_scan,
9200 emit_relocs_scan_reltype. Change all callers.
9201 (struct Relocate_info): Remove options field and all references to
9202 it.
9203 * reloc.h (class Read_relocs): Remove options constructor
9204 parameter and options_ field. Change all callers.
9205 (class Gc_process_relocs, class Scan_relocs): Likewise.
9206 (class Relocate_task): Likewise.
9207 * target-reloc.h (scan_relocs): Remove options parameter. Change
9208 all callers.
9209 (scan_relocatable_relocs): Likewise.
9210 * target.h (class Sized_target): Remove options parameter from
9211 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
9212 all callers.
9213 * gc.h (gc_process_relocs): Remove options parameter. Change all
9214 callers.
9215 * arm.cc: Update functions to remove options parameters.
9216 * i386.cc: Likewise.
9217 * powerpc.cc: Likewise.
9218 * sparc.cc: Likewise.
9219 * x86_64.cc: Likewise.
9220 * testsuite/testfile.cc: Likewise.
9221
8ffa3667
DK
92222009-10-28 Doug Kwan <dougkwan@google.com>
9223
9224 * arm.cc (Arm_relobj): New class definition.
e1df38aa 9225 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
9226 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
9227 New method definitions.
9228
40f36857
CC
92292009-10-28 Cary Coutant <ccoutant@google.com>
9230
9231 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
9232 (Plugin::cleanup_done_): New member.
9233 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
9234 (Plugin_manager::cleanup_done_): Remove.
9235 (Plugin_manager::add_input_file): Edit error message.
9236 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
9237 (Plugin_manager::cleanup): Remove use of cleanup_done_.
9238
2c849493
ILT
92392009-10-27 Mikolaj Zalewski <mikolajz@google.com>
9240
9241 * fileread.cc: (File_read::View::~View): Use the new
9242 data_ownership_ filed.
9243 (File_read::~File_read): Dispose the new whole_file_view_.
9244 (File_read::open): Mmap the whole file if needed.
9245 (File_read::open): Use whole_file_view_ instead of contents_.
9246 (File_read::find_view): Use whole_file_view_ if applicable.
9247 (File_read::do_read): Use whole_file_view_ instead of contents_.
9248 (File_read::make_view): Use whole_file_view_ instead of contents_,
9249 update File_read::View::View call.
9250 (File_read::find_or_make_view): Update File_read::View::View
9251 call.
9252 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
9253 remove contents_
9254 (File_read::View::Data_ownership): New enum.
9255 (File_read::View::View): Replace bool mapped_ with Data_ownership
9256 argument.
9257 (File_read::View::mapped_): Remove (replaced by data_ownership_).
9258 (File_read::View::data_ownership_): New field.
9259 (File_read::contents_): Remove (replaced by whole_file_view_).
9260 (File_read::whole_file_view_): New field.
9261 * options.h (class General_options): Add --keep-files-mapped.
9262
24998053
CC
92632009-10-27 Cary Coutant <ccoutant@google.com>
9264
9265 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
9266 * testsuite/Makefile.am (plugin_test_5): New test case.
9267 * testsuite/Makefile.in: Regenerate.
9268
72adc4fa
DK
92692009-10-25 Doug Kwan <dougkwan@google.com>
9270
9271 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
9272 from private to protected to allow access by child class.
9273 (Sized_relobj::do_relocate_sections): New method declaration.
9274 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 9275 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
9276 Sized_relobj::relocate_sections. Instantiate template explicitly
9277 for different target sizes and endianity.
9278
07f508a2
DK
92792009-10-24 Doug Kwan <dougkwan@google.com>
9280
9281 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
9282 (Arm_input_section::as_arm_input_section): New method.
9283 (Arm_output_section): New class definition.
9284 (Arm_output_section::create_stub_group,
9285 Arm_output_section::group_sections): New method definitions.
9286
10ad9fe5
DK
92872009-10-22 Doug Kwan <dougkwan@google.com>
9288
9289 * arm.cc (Arm_input_section): New class definition.
9290 (Arm_input_section::init, Arm_input_section:do_write,
9291 Arm_input_section::set_final_data_size,
9292 Arm_input_section::do_reset_address_and_file_offset): New method
9293 definitions.
9294
56ee5e00
DK
92952009-10-21 Doug Kwan <dougkwan@google.com>
9296
9297 * arm.cc (Stub_table, Arm_input_section): New forward class
9298 declarations.
9299 (Stub_table): New class defintion.
9300 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
9301 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
9302 New method definition.
9303
b569affa
DK
93042009-10-21 Doug Kwan <dougkwan@google.com>
9305
9306 * arm.cc: Update copyright comments.
9307 (Target_arm): New forward class template declaration.
9308 (Arm_address): New type.
9309 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
9310 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
9311 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
9312 constants.
9313 (Insn_template): Same.
9314 (DEF_STUBS): New macro.
9315 (Stub_type): New enum type.
9316 (Stub_template): New class definition.
9317 (Stub): Same.
9318 (Reloc_stub): Same.
9319 (Stub_factory): Same.
9320 (Target_arm::Target_arm): Initialize may_use_blx_ and
9321 should_force_pic_veneer_.
9322 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
9323 Target_arm::should_force_pic_veneer,
9324 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
9325 Target_arm::using_thumb_only, Target_arm:;default_target): New
9326 method defintions.
9327 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
9328 New data member declarations.
9329 (Insn_template::size, Insn_template::alignment): New method defintions.
9330 (Stub_template::Stub_template): New method definition.
9331 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
9332 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
9333 (Stub_factory::Stub_factory): New method definition.
9334 * gold.h (string_hash): New template.
9335 * output.h (Input_section_specifier::hash_value): Use
9336 gold::string_hash.
9337 (Input_section_specifier::string_hash): Remove.
9338 * stringpool.cc (Stringpool_template::string_hash): Use
9339 gold::string_hash.
9340
6c172549
DK
93412009-10-20 Doug Kwan <dougkwan@google.com>
9342
9343 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
9344 symbols of relaxed input sections.
9345 * output.h (Output_section::find_relaxed_input_section): Make
9346 method public.
9347
c5617f2f
DK
93482009-10-16 Doug Kwan <dougkwan@google.com>
9349
9350 * dynobj.cc (Versions::Versions): Initialize version_script_.
9351 Only insert base version symbol definition for a shared object
9352 if version script defines any version versions.
9353 (Versions::define_base_version): New method definition.
9354 (Versions::add_def): Check that base version is not needed.
9355 (Versions::add_need): Define base version lazily.
9356 * dynobj.h (Versions::define_base_version): New method declaration.
9357 (Versions::needs_base_version_): New data member declaration.
9358 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
9359 (check_DATA): Add no_version_test.stdout.
9360 (libno_version_test.so, no_version_test.o no_version_test.stdout):
9361 New make rules.
9362 * testsuite/Makefile.in: Regenerate.
9363 * testsuite/no_version_test.c: New file.
9364 * testsuite/no_version_test.sh: Ditto.
9365
3c12dcdb
DK
93662009-10-16 Doug Kwan <dougkwan@google.com>
9367
9368 * expression.cc (class Segment_start_expression): New class definition.
9369 (Segment_start_expression::value): New method definition.
9370 (script_exp_function_segment_start): Return a new
9371 Segment_start_expression.
9372 * gold/script-c.h (script_saw_segment_start_expression): New function
9373 prototype.
9374 * script-sections.cc (Script_sections::Script_sections): Initialize
9375 SAW_SEGMENT_START_EXPRESSION_ to false.
9376 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
9377 and -Tbbs options to specify section addresses if given in
9378 command line and no SEGMENT_START expression is seen in a script.
9379 * script-sections.h (Script_sections::saw_segment_start_expression,
9380 Script_sections::set_saw_segment_start_expression): New method
9381 definition.
9382 (Script_sections::saw_segment_start_expression_): New data member
9383 declaration.
9384 * script.cc (script_saw_segment_start_expression): New function.
9385 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
9386 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
9387 script_test_7.sh and script_test_8.sh.
9388 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
9389 script_test_8.stdout.
9390 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
9391 (script_test_6, script_test_6.stdout, script_test_7,
9392 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
9393 * Makefile.in: Regenerate.
9394 * testsuite/script_test_6.sh: New file.
9395 * testsuite/script_test_6.t: Same.
9396 * testsuite/script_test_7.sh: Same.
9397 * testsuite/script_test_7.t: Same.
9398 * testsuite/script_test_8.sh: Same.
9399
64b1ae37
DK
94002009-10-16 Doug Kwan <dougkwan@google.com>
9401
9402 * output.cc (Output_segment::set_section_list_address): Cast
9403 expressions to unsigned long long type to avoid format warnings.
9404
661be1e2
ILT
94052009-10-15 Ian Lance Taylor <iant@google.com>
9406
12edd763 9407 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 9408 dot assignment to script_sections_.
12edd763
ILT
9409 * script-sections.cc (Script_sections::add_dot_assignment):
9410 Initialize if necessary.
9411
68b6574b
ILT
9412 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
9413 program headers with no load segment if there is a linker script.
9414
661be1e2
ILT
9415 * layout.cc (Layout::set_segment_offsets): Align the file offset
9416 to the segment aligment for -N or -n with no load segment.
9417 * output.cc (Output_segment::add_output_section): Don't crash if
9418 the first section is a TLS section.
9419 (Output_segment::set_section_list_addresses): Print an error
9420 message if the address moves backward in a linker script.
9421 * script-sections.cc
9422 (Output_section_element_input::set_section_addresses): Don't
9423 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
9424 (Orphan_output_section::set_section_addresses): Likewise.
9425
f15f61a7
DK
94262009-10-15 Doug Kwan <dougkwan@google.com>
9427
9428 * layout.cc (Layout::finish_dynamic_section): Generate tags
9429 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
9430 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
9431 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
9432
82bb573a
ILT
94332009-10-14 Ian Lance Taylor <iant@google.com>
9434
9435 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
9436 fields.
9437 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
9438 data_shdr fields of relinfo.
9439 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
9440 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
9441 R_386_TLS_LDO_32, adjust based on section flags.
9442 (Target_i386::Relocate::fix_up_ldo): Remove.
9443
374ad285
ILT
94442009-10-13 Ian Lance Taylor <iant@google.com>
9445
9446 Add support for -pie.
9447 * options.h (class General_options): Add -pie and
9448 --pic-executable.
9449 (General_options::output_is_position_independent): Test -pie.
9450 (General_options::output_is_executable): Return true if not shared
9451 and not relocatable.
9452 (General_options::output_is_pie): Remove.
9453 * options.cc (General_options::finalize): Reject incompatible uses
9454 of -pie.
9455 * gold.cc (queue_middle_tasks): A -pie link is not static.
9456 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
9457 * symtab.cc (Symbol::final_value_is_known): Return false if
9458 output_is_position_independent.
9459 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
9460 output_is_position_independent.
9461 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
9462 output_is_position_independent.
9463 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
9464 output_is_position_independent.
9465 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
9466 two_file_pie_test.
9467 (basic_pie_test.o, basic_pie_test): New targets.
9468 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
9469 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
9470 (two_file_pie_test): New target.
9471 * testsuite/Makefile.in: Rebuild.
9472 * README: Remove note saying that -pie is not supported.
9473
c6585162
ILT
94742009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
9475
9476 * options.h (class General_options): Add -init and -fini.
9477 * layout.cc (Layout::finish_dynamic_section): Emit
9478 given init and fini functions.
9479
032ce4e9
ST
94802009-10-13 Sriraman Tallam <tmsriram@google.com>
9481
9482 * gc.h (gc_process_relocs): Check if icf is enabled using new
9483 function.
9484 * gold.cc (queue_initial_tasks): Likewise.
9485 (queue_middle_tasks): Likewise.
9486 * object.cc (do_layout): Likewise.
9487 * symtab.cc (is_section_folded): Likewise.
9488 * main.cc (main): Likewise.
9489 * reloc.cc (Read_relocs::run): Likewise.
9490 (Sized_relobj::do_scan_relocs): Likewise.
9491 * icf.cc (is_function_ctor_or_dtor): New function.
9492 (Icf::find_identical_sections): Check if function is ctor or dtor when
9493 safe icf is chosen.
9494 * options.h (General_options::icf): Change option to be an enum.
9495 (Icf_status): New enum.
9496 (icf_enabled): New method.
9497 (icf_safe_folding): New method.
9498 (set_icf_status): New method.
9499 (icf_status_): New variable.
9500 * (options.cc) (General_options::finalize): Set icf_status_.
9501 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
9502 icf_test and icf_keep_unique_test to use the --icf enum flag.
9503 * testsuite/icf_safe_test.sh: New file.
e1df38aa 9504 * testsuite/icf_safe_test.cc: New file.
032ce4e9 9505
f345227a
ST
95062009-10-12 Sriraman Tallam <tmsriram@google.com>
9507
9508 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
9509 includes to gc.h and icf.h.
9510 * arm.cc: Include gc.h.
9511 * gold.cc: Likewise.
9512 * i386.cc: Likewise.
9513 * powerpc.cc: Likewise.
9514 * sparc.cc: Likewise.
9515 * x86_64.cc: Likewise.
9516 * gc.h: Include icf.h.
9517
1c7814ed
ILT
95182009-10-11 Ian Lance Taylor <iant@google.com>
9519
9520 * plugin.cc: Include "gold.h" before other header files.
9521
ae3b5189
CD
95222009-10-10 Chris Demetriou <cgd@google.com>
9523
9524 * options.h (Input_file_argument::Input_file_type): New enum.
9525 (Input_file_argument::is_lib_): Replace with...
9526 (Input_file_argument::type_): New member.
9527 (Input_file_argument::Input_file_argument): Take Input_file_type
9528 'type' rather than boolean 'is_lib' as second argument.
9529 (Input_file_argument::is_lib): Use type_.
9530 (Input_file_argument::is_searched_file): New function.
9531 (Input_file_argument::may_need_search): Handle is_searched_file.
9532 * options.cc (General_options::parse_library): Support -l:filename.
9533 (General_options::parse_just_symbols): Update for Input_file_argument
9534 changes.
9535 (Command_line::process): Likewise.
9536 * archive.cc (Archive::get_file_and_offset): Likewise.
9537 * plugin.cc (Plugin_manager::release_input_file): Likewise.
9538 * script.cc (read_script_file, script_add_file): Likewise.
9539 * fileread.cc (Input_file::Input_file): Likewise.
9540 (Input_file::will_search_for): Handle is_searched_file.
9541 (Input_file::open): Likewise.
9542 * readsyms.cc (Read_symbols::get_name): Likewise.
9543 * testsuite/Makefile.am (searched_file_test): New test.
9544 * testsuite/Makefile.in: Regenerate.
9545 * testsuite/searched_file_test.cc: New file.
9546 * testsuite/searched_file_test_lib.cc: New file.
9547
f3048a1d
ILT
95482009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9549 Ian Lance Taylor <iant@google.com>
9550
9551 * descriptor.cc: Include <cstdio> and "binary-io.h".
9552 (Descriptors::open): Open the files in binary mode always.
9553 * script.cc (Lex::get_token): Treat \r as whitespace.
9554
d4780e57
ILT
95552009-10-09 Ian Lance Taylor <iant@google.com>
9556
9557 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
9558
d9a893b8
ILT
95592009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9560 Ian Lance Taylor <iant@google.com>
9561
9562 * configure.ac: Check for readv function also.
9563 * fileread.cc (readv): Define if not HAVE_READV.
9564 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
9565 does not exist.
9566 * config.in: Regenerate.
9567 * configure: Regenerate.
9568
c0a62865
DK
95692009-10-09 Doug Kwan <dougkwan@google.com>
9570
9571 * layout.cc (Layout::make_output_section): Call target hook to make
9572 ordinary output section.
9573 (Layout::finalize): Adjust parameter list of call the
9574 Target::may_relax().
9575 * layout.h (class Layout::section_list): New method.
9576 * merge.h (Output_merge_base::entsize): Change visibility to public.
9577 (Output_merge_base::is_string, Output_merge_base::do_is_string):
9578 New methods.
9579 (Output_merge_string::do_is_string): New method.
9580 * object.cc (Sized_relobj::do_setup): renamed from
9581 Sized_relobj::set_up.
9582 * object.h (Sized_relobj::adjust_shndx,
9583 Sized_relobj::initializ_input_to_output_maps,
9584 Sized_relobj::free_input_to_output_maps): Change visibilities to
9585 protected.
9586 (Sized_relobj::setup): Virtualize.
9587 (Sized_relobj::do_setup): New method declaration.
9588 (Sized_relobj::invalidate_section_offset,
9589 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
9590 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
9591 * options.cc (parse_int): New function.
9592 * options.h (parse_int): New declaration.
9593 (DEFINE_int): New macro.
9594 (stub_group_size): New option.
9595 * output.cc (Output_section::Output_section): Initialize memebers
9596 merge_section_map_, merge_section_by_properties_map_,
9597 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
9598 (Output_section::add_input_section): Handled deferred code-fill
9599 generation and remove an old comment.
9600 (Output_section::add_relaxed_input_section): New method definition.
9601 (Output_section::add_merge_input_section): Use merge section by
9602 properties map to speed to search. Update merge section maps
9603 as appropriate.
9604 (Output_section::build_relaxation_map): New method definition.
9605 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
9606 Same.
9607 (Output_section::relax_input_section): Renamed to
9608 Output_section::convert_input_sections_to_relaxed_sections and change
9609 interface to take a vector of pointers to relaxed sections.
9610 (Output_section::find_merge_section,
9611 Output_section::find_relaxed_input_section): New method definitions.
9612 (Output_section::is_input_address_mapped,
9613 Output_section::output_offset, Output_section::output_address):
9614 Use output section data maps to speed up searching.
9615 (Output_section::find_starting_output_address): Add comments.
9616 (Output_section::do_write,
9617 Output_section::write_to_postprocessing_buffer): Do code-fill
9618 generation as appropriate.
9619 (Output_section::get_input_sections): Invalidate relaxed input section
9620 map.
9621 (Output_section::restore_states): Adjust type of checkpoint .
9622 Invalidate relaxed input section map.
9623 * output.h (Output_merge_base): New class declaration.
9624 (Input_section_specifier): New class defintion.
9625 (class Output_relaxed_input_section) Change base class to
9626 Output_section_data_build.
9627 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
9628 base class initializer.
9629 (Output_section::add_relaxed_input_section): New method declaration.
9630 (Output_section::Input_section): Change visibility to protected.
2e702c99 9631 (Output_section::Input_section::relobj,
c0a62865
DK
9632 Output_section::Input_section::shndx): Handle relaxed input sections.
9633 Output_section::input_sections) Change visibility to protected. Also
9634 define overload to return a non-const pointer.
9635 (Output_section::Merge_section_properties): New class defintion.
9636 (Output_section::Merge_section_by_properties_map,
9637 Output_section::Output_section_data_by_input_section_map,
9638 Output_section::Relaxation_map): New types.
9639 (Output_section::relax_input_section): Rename method to
9640 Output_section::convert_input_sections_to_relaxed_sections and change
9641 interface to take a vector of relaxed section pointers.
9642 (Output_section::find_merge_section,
9643 Output_section::find_relaxed_input_section,
9644 Output_section::build_relaxation_map,
9645 Output_section::convert_input_sections_in_list_to_relaxed_sections):
9646 New method declarations.
9647 (Output_section::merge_section_map_
9648 Output_section::merge_section_by_properties_map_,
9649 Output_section::relaxed_input_section_map_,
9650 Output_section::is_relaxed_input_section_map_valid_,
9651 Output_section::generate_code_fills_at_write_): New data members.
9652 * script-sections.cc
9653 (Output_section_element_input::set_section_addresses): Call
9654 current_data_size and addralign methods of relaxed input sections.
9655 (Orphan_output_section::set_section_addresses): Call current_data_size
9656 and addralign methods of relaxed input sections.
9657 * symtab.cc (Symbol_table::compute_final_value): Extract template
9658 from the body of Symbol_table::sized_finalize_symbol.
9659 (Symbol_table::sized_finalized_symbol): Call
9660 Symbol_table::compute_final_value.
9661 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
9662 (Symbol_table::compute_final_value): New templated method declaration.
9663 * target.cc (Target::do_make_output_section): New method defintion.
9664 * target.h (Target::make_output_section): New method declaration.
9665 (Target::relax): Add more parameters for input objects, symbol table
9666 and layout. Adjust call to do_relax.
9667 (Target::do_make_output_section): New method declaration.
9668 (Target::do_relax): Add parameters for input objects, symbol table
9669 and layout.
9670
d446d6c4
ILT
96712009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9672
9673 * pread.c: Include stdio.h.
9674
bc06c745
ILT
96752009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9676
9677 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
9678 defined.
9679
75aea3d0
ILT
96802009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9681
9682 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
9683 Change read_shndx type to unsigned int.
9684 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
9685 int.
9686 (Sized_dwarf_line_info::read_line_mappings): Likewise.
9687 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
9688 Change read_shndx type to unsigned int.
9689 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
9690 int.
9691 (Sized_dwarf_line_info::read_line_mappings): Likewise.
9692 * layout.cc (Layout::create_symtab_sections): Cast the result of
9693 local_symcount * symsize to off_t in the gold_assert.
9694
be8fcb75
ILT
96952009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9696
9697 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
9698 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
9699 R_ARM_BASE_ABS.
9700 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
9701 (Arm_relocate_functions::thm_abs5): New function.
9702 (Arm_relocate_functions::abs12): New function.
9703 (Arm_relocate_functions::abs16): New function.
9704 (Arm_relocate_functions::base_abs): New function.
9705 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
9706 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
9707 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
9708 R_ARM_BASE_ABS.
9709 (Scan::global): Likewise.
9710 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
9711 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
9712 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
9713 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
9714 R_ARM_BASE_ABS.
9715
c2a122b6
ILT
97162009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9717
9718 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
9719 (Arm_relocate_functions::movt_prel): New function.
9720 (Arm_relocate_functions::thm_movw_prel_nc): New function.
9721 (Arm_relocate_functions::thm_movt_prel): New function.
9722 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
9723 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
9724 (Scan::global, Relocate::relocate): Likewise.
9725 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9726
c4aa1e2d
ILT
97272009-10-09 Mikolaj Zalewski <mikolajz@google.com>
9728
9729 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
9730 Incremental_checker.
9731 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
9732 unsigned int.
9733 (class Incremental_inputs_header): New class.
9734 (Incremental_inputs_header_writer): Edit comment.
9735 (Incremental_inputs_entry): New class.
9736 (Incremental_inputs_entry_writer): Edit comment.
9737 (Sized_incremental_binary::do_find_incremental_inputs_section):
9738 Add *strtab_shndx parameter, fill it.
9739 (Sized_incremental_binary::do_check_inputs): New method.
9740 (Incremental_checker::can_incrementally_link_output_file): Use
9741 Sized_incremental_binary::check_inputs.
9742 (Incremental_inputs::report_command_line): Save command line in
9743 command_line_.
9744 * incremental.h:
9745 (Incremental_binary::find_incremental_inputs_section): New
9746 method.
9747 (Incremental_binary::do_find_incremental_inputs_section): Add
9748 strtab_shndx parameter.
9749 (Incremental_binary::do_check_inputs): New pure virtual method.
9750 (Sized_incremental_binary::do_check_inputs): Declare.
9751 (Incremental_checker::Incremental_checker): Add incremental_inputs
9752 parameter, use it to initialize incremental_inputs_.
9753 (Incremental_checker::incremental_inputs_): New field.
9754 (Incremental_checker::command_line): New method.
9755 (Incremental_checker::inputs): New method.
9756 (Incremental_checker::command_line_): New field.
9757
c549a694
ILT
97582009-10-09 Mikolaj Zalewski <mikolajz@google.com>
9759
9760 * incremental.cc: Include <cstdarg> and "target-select.h".
9761 (vexplain_no_incremental): New function.
9762 (explain_no_incremental): New function.
9763 (Incremental_binary::error): New method.
9764 (Sized_incremental_binary::do_find_incremental_inputs_section): New
9765 method.
9766 (make_sized_incremental_binary): New function.
9767 (open_incremental_binary): New function.
9768 (can_incrementally_link_file): Add checks if output is ELF and has
9769 inputs section.
9770 * incremental.h: Include "elfcpp_file.h" and "output.h".
9771 (Incremental_binary): New class.
9772 (Sized_incremental_binary): New class.
9773 (open_incremental_binary): Declare.
9774 * object.cc (is_elf_object): Use
9775 elfcpp::Elf_recognizer::is_elf_file.
9776 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
9777 * output.h (Output_file::filesize): New method.
9778
fd3c5f0b
ILT
97792009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9780
9781 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
9782 New function.
9783 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
9784 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
9785 function.
9786 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
9787 function.
9788 (Arm_relocate_functions::movw_abs_nc): New function.
9789 (Arm_relocate_functions::movt_abs): New function.
9790 (Arm_relocate_functions::thm_movw_abs_nc): New function.
9791 (Arm_relocate_functions::thm_movt_abs): New function.
9792 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
9793 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
9794 (Scan::global): Likewise.
9795 (Relocate::relocate): Likewise.
9796 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9797
7f5309a5
ILT
97982009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9799
9800 * arm.cc (Arm_relocate_functions::got_prel) New function.
9801 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
9802 (Relocate::relocate): Likewise.
9803 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9804
364c7fa5
ILT
98052009-10-06 Ian Lance Taylor <iant@google.com>
9806
9807 * options.h (class General_options): Define
9808 split_stack_adjust_size parameter.
9809 * object.h (class Object): Add uses_split_stack_ and
9810 has_no_split_stack_ fields. Add uses_split_stack and
9811 has_no_split_stack accessor functions. Declare
9812 handle_split_stack_section.
9813 (class Reloc_symbol_changes): Define.
9814 (class Sized_relobj): Define Function_offsets. Declare
9815 split_stack_adjust, split_stack_adjust_reltype, and
9816 find_functions.
9817 * object.cc (Object::handle_split_stack_section): New function.
9818 (Sized_relobj::do_layout): Call handle_split_stack_section.
9819 * dynobj.cc (Sized_dynobj::do_layout): Call
9820 handle_split_stack_section.
9821 * reloc.cc (Sized_relobj::relocate_sections): Call
9822 split_stack_adjust for executable sections in split_stack
9823 objects. Pass reloc_map to relocate_section.
9824 (Sized_relobj::split_stack_adjust): New function.
9825 (Sized_relobj::split_stack_adjust_reltype): New function.
9826 (Sized_relobj::find_functions): New function.
9827 * target-reloc.h: Include "object.h".
9828 (relocate_section): Add reloc_symbol_changes parameter. Change
9829 all callers.
9830 * target.h (class Target): Add calls_non_split method. Declare
9831 do_calls_non_split virtual method. Declare match_view and
9832 set_view_to_nop.
9833 * target.cc: Include "elfcpp.h".
9834 (Target::do_calls_non_split): New function.
9835 (Target::match_view): New function.
9836 (Target::set_view_to_nop): New function.
9837 * gold.cc (queue_middle_tasks): Give an error if mixing
9838 split-stack and non-split-stack objects with -r.
9839 * i386.cc (Target_i386::relocate_section): Add
9840 reloc_symbol_changes parameter.
9841 (Target_i386::do_calls_non_split): New function.
9842 * x86_64.cc (Target_x86_64::relocate_section): Add
9843 reloc_symbol_changes parameter.
9844 (Target_x86_64::do_calls_non_split): New function.
9845 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
9846 parameter.
9847 * powerpc.cc (Target_powerpc::relocate_section): Add
9848 reloc_symbol_changes parameter.
9849 * sparc.cc (Target_sparc::relocate_section): Add
9850 reloc_symbol_changes parameter.
9851 * configure.ac: Call AM_CONDITIONAL for the default target.
9852 * configure: Rebuild.
9853 * testsuite/Makefile.am (TEST_AS): New variable.
9854 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
9855 (check_DATA): Add split_i386 and split_x86_64 files.
9856 (SPLIT_DEFSYMS): Define.
9857 (split_i386_[1234n].o): New targets.
9858 (split_i386_[124]): New targets.
9859 (split_i386_[1234r].stdout): New targets.
9860 (split_x86_64_[1234n].o): New targets.
9861 (split_x86_64_[124]): New targets.
9862 (split_x86_64_[1234r].stdout): New targets.
9863 (MOSTLYCLEANFILES): Add new executables.
9864 * testsuite/split_i386.sh: New file.
9865 * testsuite/split_x86_64.sh: New file.
9866 * testsuite/split_i386_1.s: New file.
9867 * testsuite/split_i386_2.s: New file.
9868 * testsuite/split_i386_3.s: New file.
9869 * testsuite/split_i386_4.s: New file.
9870 * testsuite/split_i386_n.s: New file.
9871 * testsuite/split_x86_64_1.s: New file.
9872 * testsuite/split_x86_64_2.s: New file.
9873 * testsuite/split_x86_64_3.s: New file.
9874 * testsuite/split_x86_64_4.s: New file.
9875 * testsuite/split_x86_64_n.s: New file.
9876 * testsuite/testfile.cc (Target_test): Update relocation_section
9877 function.
9878 * testsuite/Makefile.in: Rebuild.
9879
e8a9fcda
ILT
98802009-10-06 Ian Lance Taylor <iant@google.com>
9881
9882 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
9883 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
9884 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
9885 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
9886 the address on ldo_addrs_.
9887 (Target_i386::Relocate::fix_up_ldo): New function.
9888
e99daf92
ILT
98892009-10-06 Rafael Espindola <espindola@google.com>
9890
9891 * plugin.cc (add_input_library): New.
9892 (Plugin::load): Add add_input_library to tv.
9893 (Plugin_manager::add_input_file): Add the is_lib argument.
9894 (add_input_file): Update call to Plugin_manager::add_input_file.
9895 (add_input_library): New.
9896 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
9897
966d4097
DK
98982009-09-30 Doug Kwan <dougkwan@google.com>
9899
9900 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
9901 symbol and call Symbol::may_need_copy_reloc to determine if
9902 a copy reloc is needed.
9903 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
9904 nocopyreloc is given in command line.
9905 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
9906 given in command line.
9907 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
9908 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
9909 of the removed Target_i386::may_need_copy_reloc.
9910 * options.h (copyreloc): New option with default value false.
9911 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9912 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
9913 instead of the removed Target_powerpc::may_need_copy_reloc.
9914 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9915 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
9916 instead of the removed Target_sparc::may_need_copy_reloc.
9917 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
9918 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
9919 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
9920 instead of the removed Target_x86_64::may_need_copy_reloc.
9921
029ba973
ILT
99222009-09-30 Ian Lance Taylor <iant@google.com>
9923
9924 * object.h (class Object): Remove target_ field, and target,
9925 sized_target, and set_target methods.
9926 (Object::sized_target): Remove.
9927 (class Sized_relobj): Update declarations. Remove sized_target.
9928 * object.cc (Sized_relobj::setup): Remove target parameter.
9929 Change all callers.
9930 (Input_objects::add_object): Don't do anything with the target.
9931 (make_elf_sized_object): Add punconfigured parameter. Change all
9932 callers. Set or test parameter target.
9933 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
9934 Change all callers.
9935 * parameters.cc (Parameters::set_target): Change parameter type to
9936 be non-const.
9937 (Parameters::default_target): Remove.
9938 (set_parameters_target): Change parameter type to be non-const.
9939 (parameters_force_valid_target): New function.
9940 (parameters_clear_target): New function.
9941 * parameters.h (class Parameters): Update declarations. Remove
9942 default_target method. Add sized_target and clear_target
9943 methods. Change target_ to be non-const.
9944 (set_parameters_target): Update declaration.
9945 (parameters_force_valid_target): Declare.
9946 (parameters_clear_target): Declare.
9947 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
9948 as NULL if we aren't searching.
9949 (Add_symbols::run): Don't check for compatible target.
9950 * fileread.cc (Input_file::open_binary): Call
9951 parameters_force_valid_target.
9952 * gold.cc (queue_middle_tasks): Likewise.
9953 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
9954 set_target on object.
9955 * dynobj.h (class Sized_dynobj): Update declarations.
9956 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
9957 make_elf_object returns NULL.
9958 (Archive::include_member): Don't check whether object target is
9959 compatible.
9960 * output.cc (Output_section::add_input_section): Get target from
9961 parameters.
9962 (Output_section::relax_input_section): Likewise.
9963 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
9964 parameters.
9965 (Sized_relobj::do_scan_relocs): Likewise.
9966 (Sized_relobj::relocate_sections): Likewise.
9967 * resolve.cc (Symbol_table::resolve): Likewise.
9968 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
9969 parameter. Change all callers.
9970 (Symbol_table::add_from_object): Get target from parameters.
9971 (Symbol_table::add_from_relobj): Don't check object target.
9972 (Symbol_table::add_from_dynobj): Likewise.
9973 (Symbol_table::define_special_symbol): Get target from
9974 parameters.
9975 * symtab.h (class Symbol_table): Update declaration.
9976 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
9977 parameter. Change all callers. Clear parameter target.
9978 (Binary_test): Test target here.
9979 * testsuite/object_unittest.cc (gold_testsuite): Remove
9980 target_test_pointer parameter. Change all callers.
9981 (Object_test): Test target here.
9982
a6a22b83
ILT
99832009-09-26 Ian Lance Taylor <iant@google.com>
9984
9985 * testsuite/initpri1.c: Don't try to use constructor priorities if
9986 compiling with gcc before 4.3.
9987
6a8f49fe
ILT
99882009-09-22 Mikolaj Zalewski <mikolajz@google.com>
9989
9990 * testsuite/retain_symbols_file_test.sh (check_present): Change
9991 output file name to retain_symbols_file_test.stdout.
9992 (check_absent): Likewise.
9993
8c604651
CS
99942009-09-18 Craig Silverstein <csilvers@google.com>
9995
9996 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
9997 * options.cc: Include <cerrno> and <fstream>.
9998 (General_options::finalize): Parse -retain-symbols-file tag.
9999 * options.h: New flag.
10000 (General_options): New method should_retain_symbol, new
10001 variable symbols_to_retain.
10002 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
10003 should_retain_symbol map.
10004 * testsuite/Makefile.am (retain_symbols_file_test): New test.
10005 * testsuite/Makefile.in: Regenerate.
10006 * testsuite/retain_symbols_file_test.sh: New file.
10007
ca58b19f
NC
100082009-09-18 Nick Clifton <nickc@redhat.com>
10009
10010 * po/es.po: Updated Spanish translation.
10011
20e6d0d6
DK
100122009-09-17 Doug Kwan <dougkwan@google.com>
10013
10014 * debug.h (DEBUG_RELAXATION): New constant.
10015 (DEBUG_ALL): Add DEBUG_RELAXATION.
10016 (debug_string_to_enum): Add relaxation debug option.
10017 * layout.cc
10018 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
10019 Layout::Relaxation_debug_check::read_sections,
10020 Layout::Relaxation_debug_check::read_sections): New method definitions.
10021 (Layout::Layout): Initialize data members
10022 record_output_section_data_from_scrips_,
10023 script_output_section_data_list_ and relaxation_debug_check_.
10024 (Layout::save_segments, Layout::restore_segments,
10025 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
10026 Layout::relaxation_loop_body): New method definitions.
10027 (Layout::finalize): Support relaxation. Move section layout code to
10028 Layout::relaxation_loop_body.
10029 (Layout::set_asection_address_from_script): Move code for orphan
10030 section placement out.
10031 (Layout::place_orphan_sections_in_script): New method definition.
10032 * layout.h (Output_segment_headers, Output_file_header):
10033 New forward class declarations.
10034 (Layout::~Layout): Define.
10035 (Layout::new_output_section_data_from_script): New method definition.
10036 (Layout::place_orphan_sections_in_script): New method declaration.
10037 (Layout::Segment_states): New type declaration.
10038 (Layout::save_segments, Layout::restore_segments,
10039 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
10040 Layout::relaxation_loop_body): New method declarations.
10041 (Layout::Output_section_data_list): New type declaration.
10042 (Layout::Relaxation_debug_check): New class definition.
10043 (Layout::record_output_section_data_from_script_,
10044 Layout::script_output_section_data_list_, Layout::segment_states_,
10045 Layout::relaxation_debug_check_): New data members.
10046 * output.cc: (Output_section_headers::do_size): New method definition.
10047 (Output_section_headers::Output_section_headers): Move size
10048 computation to Output_section_headers::do_size.
10049 (Output_segment_headers::do_size): New method definition.
e1df38aa 10050 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
10051 Output_file_header::do_size and call it.
10052 (Output_file_header::do_size): New method definition.
10053 (Output_data_group::Output_data_group): Adjust call to
10054 Output_section_data.
10055 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
10056 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 10057 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
10058 RELAXED_INPUT_SECTION_CODE.
10059 (Output_section::Output_section): Initialize data member checkpoint_.
10060 (Output_section::~Output_section): Delete checkpoint object pointed
10061 by checkpoint_.
10062 (Output_section::add_input_section): Always add an Input_section if
10063 relaxing.
10064 (Output_section::add_merge_input_section): Add assert.
10065 (Output_section::relax_input_section): New method definition.
10066 (Output_section::set_final_data_size): Set load address to zero for
10067 an unallocated section.
10068 (Output_section::do_address_and_file_offset_have_reset_values):
10069 New method definition.
10070 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
10071 Handle relaxed input section.
10072 (Output_section::sort_attached_input_sections): Checkpoint input
10073 section list lazily.
10074 (Output_section::get_input_sections): Change type of input_sections to
10075 list of Simple_input_section pointers. Checkpoint input section list
10076 lazily. Also handle relaxed input sections.
10077 (Output_section::add_input_section_for_script): Take a reference to
10078 a Simple_input_section object instead of Relobj pointer and section
10079 index as parameter. Handle relaxed input sections.
10080 (Output_section::save_states, Output_section::restore_states): New
10081 method definitions.
10082 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
10083 (Output_data::is_data_size_fixed): New method definition.
10084 (Output_data::reset_addresss_and_file_offset): Do not reset data size
10085 if it is fixed.
10086 (Output_data::address_and_file_offset_have_reset_values): New method
10087 definition.
10088 (Output_data::do_address_and_file_offset_have_reset_values): New method
10089 definition.
10090 (Output_data::set_data_size): Check that data size is not fixed.
10091 (Output_data::fix_data_size): New method definition.
10092 (Output_data::is_data_size_fixed_): New data member.
10093 (Output_section_headers::set_final_data_size): New method definition.
10094 (Output_section_headers::do_size): New method declaration.
10095 (Output_segment_headers::set_final_data_size): New method definition.
10096 (Output_segment_headers::do_size): New method declaration.
10097 (Output_file_header::set_final_data_size)::New method definition.
10098 (Output_file_header::do_size)::New method declaration.
10099 (Output_section_data::Output_section_data): Add new parameter
10100 is_data_size_fixed and use it to fix data size.
10101 (Output_data_const::Output_data_const): Adjust call to base class
10102 constructor and fix data size.
10103 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
10104 base class constructor and fix data size.
10105 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
10106 base class constructor and fix data size.
10107 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
10108 class constructor and fix data size.
10109 (Output_data_group::set_final_data_size): New method definition.
10110 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
10111 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
10112 class constructor and fix data size.
10113 (Output_relaxed_input_section): New class definition.
10114 (Output_section::Simple_input_section): New class definition.
10115 (Output_section::get_input_sections): Adjust parameter list.
10116 (Output_section::add_input_section_for_script): Same.
10117 (Output_section::save_states, Output_section::restore_states,
10118 Output_section::do_address_and_file_offset_have_reset_values,
10119 (Output_section::Input_section::Input_section): Handle
10120 RELAXED_INPUT_SECTION_CODE. Add new overload for
10121 Output_relaxed_input_section.
10122 (Output_section::Input_section::is_input_section,
10123 Output_section::Input_section::set_output_section): Handle relaxed
10124 input section.
10125 (Output_section::Input_section::is_relaxed_input_section,
10126 Output_section::Input_section::output_section_data,
10127 Output_section::Input_section::relaxed_input_section): New method
10128 definitions.
10129 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
10130 value.
10131 (Output_section::Input_section::u1_): Update comments.
10132 (Output_section::Input_section::u2_): Add new union member poris.
10133 (Output_section::Checkpoint_output_section): New classs definition.
10134 (Output_section::relax_input_section): New method declaration.
10135 (Output_section::checkpoint_): New data member.
10136 (Output_segment): Update comments.
10137 (Output_segment::Output_segment): Un-privatize copy constructor.
10138 (Output_segment::operator=): Un-privatize.
10139 * script-sections.cc (Output_section_element::Input_section_list):
10140 Change element type to Output_section::Simple_input_section.
10141 (Output_section_element_dot_assignment::set_section_addresses):
10142 Register output section data for relaxation clean up.
10143 (Output_data_exression::Output_data_expression): Adjust call to base
10144 constructor to fix data size.
10145 (Output_section_element_data::set_section_addresses): Register
10146 Output_data_expression object for relaxation clean up.
10147 (struct Input_section_info): Replace Relobj pointer and section index
10148 pair with Output_section::Simple_input_section and Convert struct to a
10149 class.
10150 (Input_section_sorter::operator()): Adjust access to
e1df38aa 10151 Input_section_info data member to use accessors.
20e6d0d6
DK
10152 (Output_section_element_input::set_section_addresses): Use layout
10153 parameter. Adjust code to use Output_section::Simple_input_section
10154 and Input_secction_info classes. Register filler for relaxation
10155 clean up.
10156 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
10157 and section index pair with Output_section::Simple_input_section
10158 class. Adjust code accordingly.
10159 (Phdrs_element::release_segment): New method definition.
10160 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
10161 segment list.
10162 (Script_sections::release_segments): New method definition.
10163 * gold/script-sections.h (Script_sections::release_segments): New
10164 method declaration.
10165 * gold/target.h (Target::may_relax, Target::relax,
10166 Target::do_may_relax, Target::do_relax): New method definitions.
10167
5e445df6
ILT
101682009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10169
10170 * arm.cc (has_signed_unsigned_overflow): New function.
10171 (Arm_relocate_functions::abs8): New function.
10172 (Target_arm::Scan::local): Handle R_ARM_ABS8.
10173 (Target_arm::Scan::global): Likewise.
10174 (Target_arm::relocate::relocate): Likewise.
10175 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10176 Likewise.
10177
8c604651 101782009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
10179
10180 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
10181 * testsuite/Makefile.in: Regenerate.
10182
1e9cc1c2
NC
101832009-09-11 Nick Clifton <nickc@redhat.com>
10184
10185 * po/gold.pot: Updated by the Translation project.
10186
6a89f575
CC
101872009-09-08 Cary Coutant <ccoutant@google.com>
10188
10189 * output.cc (Output_file::open): Add execute permission to empty file.
10190 * testsuite/Makefile.am (permission_test): New test.
10191 * testsuite/Makefile.in: Regenerate.
10192
fdcac5af
ILT
101932009-09-02 Ian Lance Taylor <iant@google.com>
10194
10195 * output.cc (Output_file::resize): Call map_no_anonymous rather
10196 than map.
10197
44453f85
ILT
101982009-09-01 Mikolaj Zalewski <mikolajz@google.com>
10199
10200 * gold.cc: Include "incremental.h".
10201 (queue_initial_tasks): Call Incremental_checker methods.
10202 * incremental.cc: Include "output.h".
10203 (Incremental_checker::can_incrementally_link_output_file): New
10204 method.
10205 * incremental.h (Incremental_checker): New class.
10206
10207 * output.cc (Output_file::open_for_modification): New method.
10208 (Output_file::map_anonymous): Changed return type to bool. Record
10209 map in base_ field.
10210 (Output_file::map_no_anonymous): New method, broken out of map.
10211 (Output_file::map): Use map_no_anonymous and map_anonymous.
10212 * output.h (class Output_file): Update declarations.
10213
293c1386
CC
102142009-08-24 Cary Coutant <ccoutant@google.com>
10215
10216 * options.h (Command_line::Pre_options): New class.
10217 (Command_line::pre_options): New member.
10218 * options.cc (gold::options::ready_to_register): New variable.
10219 (One_option::register_option): Do nothing if not registering options.
10220 Assert if same short option registered twice.
10221 (General_options::General_options): Turn off option registration when
10222 done constructing.
10223 (Command_line::Pre_options::Pre_options): New constructor.
10224
f773f3d2
CC
102252009-08-24 Cary Coutant <ccoutant@google.com>
10226
06a73cfe
CC
10227 * options.h (General_options::no_keep_memory): Remove incorrect
10228 short option.
f773f3d2 10229
a15af8e2
RW
102302009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10231
10232 * Makefile.am (am__skiplex, am__skipyacc): New.
10233 * Makefile.in: Regenerate.
10234
c462b41b
RW
102352009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10236
14ec8efd
RW
10237 * Makefile.am (AM_CPPFLAGS): Renamed from ...
10238 (INCLUDES): ... this.
10239 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
10240 (AM_CPPFLAGS): Renamed from ...
10241 (INCLUDE): ... this.
10242 * Makefile.in, testsuite/Makefile.in: Regenerate.
10243
81ecdfbb
RW
10244 * Makefile.in: Regenerate.
10245 * aclocal.m4: Likewise.
10246 * config.in: Likewise.
10247 * configure: Likewise.
10248 * testsuite/Makefile.in: Likewise.
10249
c462b41b
RW
10250 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
10251 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
10252 * Makefile.in: Regenerate.
10253 * testsuite/Makefile.in: Regenerate.
10254
2da73f13
CC
102552009-08-19 Cary Coutant <ccoutant@google.com>
10256
10257 * resolve.cc (Symbol_table::resolve): Don't complain about defined
10258 symbols in shared libraries overridden by hidden or internal symbols
10259 in the main program.
10260
2db70501
CD
102612009-08-19 Chris Demetriou <cgd@google.com>
10262
10263 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
10264 checking source file names in error messages.
10265
f733487b
DK
102662009-08-18 Doug Kwan <dougkwan@google.com>
10267
10268 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
10269 an elcpp::Ehdr as parameter. Adjust call to set_target.
10270 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
10271 an elfcpp::Ehdr as parameter.
10272 * object.cc (Object::set_target): Remove the version that looks up
10273 a target and sets it.
10274 (Sized_relobj::setup): Take a Target object instead of
10275 an elfcpp::Ehdr as parameter. Adjust call to set_target.
10276 (make_elf_sized_object): Find target and ask target to
10277 make an ELF object.
10278 * object.h: (Object::set_target): Remove the version that looks up
10279 a target and sets it.
10280 (Sized_relobj::setup): Take a Target object instead of
10281 an elfcpp:Ehdr as parameter.
10282 * target.cc: Include dynobj.h.
10283 (Target::do_make_elf_object_implementation): New.
2e702c99 10284 (Target::do_make_elf_object): New.
f733487b
DK
10285 * target.h (Target::make_elf_object): New template declaration.
10286 (Target::do_make_elf_object): New method declarations.
10287 (Target::do_make_elf_object_implementation): New template declaration.
10288
cc70f101
ILT
102892009-08-14 Ian Lance Taylor <iant@google.com>
10290
10291 * gold.h (FUNCTION_NAME): Define.
10292 (gold_unreachable): Use FUNCTION_NAME.
10293
ef5e0cb1
ST
102942009-08-12 Sriraman Tallam <tmsriram@google.com>
10295
10296 * icf.cc (Icf::find_identical_sections): Issue a warning when a
10297 symbol in the --keep-unique list is not found.
10298
48c187ce
ST
102992009-08-12 Sriraman Tallam <tmsriram@google.com>
10300
10301 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
10302 been maked as --keep-unique.
10303 (Icf::unfold_section): New function.
10304 * icf.h (Icf::unfold_section): New function.
10305 * options.h (General_options::keep_unique): New option.
10306 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
10307 * testsuite/Makefile.in: Regenerate.
10308 * testsuite/icf_keep_unique_test.sh: New file.
10309 * testsuite/icf_keep_unique_test.cc: New file.
10310
645afe0c
CC
103112009-08-12 Cary Coutant <ccoutant@google.com>
10312
10313 PR 10471
10314 * resolve.cc (Symbol_table::resolve): Check for references from
10315 dynamic objects to hidden and internal symbols.
10316 * testsuite/Makefile.am (hidden_test.sh): New test.
10317 * testsuite/Makefile.in: Regenerate.
10318 * testsuite/hidden_test.sh: New script.
10319 * testsuite/hidden_test_1.c: New test source.
10320 * testsuite/hidden_test_main.c: New test source.
10321
11af873f
DK
103222009-08-11 Doug Kwan <dougkwan@google.com>
10323
10324 * arm.cc: Update comments.
10325 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
10326 segment to locate the .ARM.exidx section if present.
10327
b9f7d72d
DK
103282009-08-09 Doug Kwan <dougkwan@google.com>
10329
10330 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
10331 patch.
10332
ddd3c53c
ST
103332009-08-07 Sriraman Tallam <tmsriram@google.com>
10334 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
10335 compiler warnings.
10336
27721062
ST
103372009-08-06 Sriraman Tallam <tmsriram@google.com>
10338
10339 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
10340 valid tls_segment only for non-debug-section relocations.
10341 * testsuite/Makefile.am: Add gc_tls_test.
10342 * testsuite/Makefile.in: Regenerate.
10343 * testsuite/gc_tls_test.cc: New file.
10344 * testsuite/gc_tls_test.sh: New file.
10345
ef15dade 103462009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 10347
ef15dade
ST
10348 * icf.cc: New file.
10349 * icf.h: New file.
10350 * Makefile.am (CCFILES): Add icf.cc.
10351 (HFILES): Add icf.h
10352 * Makefile.in: Regenerate.
10353 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
10354 * gc.h (gc_process_relocs): Populate lists used by icf to contain
10355 section, symbol and addend information for the relocs.
10356 * gold.cc (queue_middle_tasks): Call identical code folding.
10357 * gold.h: Add defines for multimap.
10358 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
10359 to the call of finalize_local_symbols.
10360 * main.cc (main): Create object of class Icf.
10361 * object.cc (Sized_relobj::do_layout): Allow this function to be
10362 called twice during icf.
10363 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
10364 to sections marked as identical by icf.
10365 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
10366 when available.
10367 (Sized_relobj::do_section_entsize): New function.
10368 * object.h (Object::section_entsize): New function.
10369 (Object::do_section_entsize): New pure virtual function.
10370 (Relobj::finalize_local_symbols): Add new parameter.
10371 (Relobj::do_section_entsize): New function.
10372 * options.h (General_options::icf): New option.
10373 (General_options::icf_iterations): New option.
10374 (General_options::print_icf_sections): New option.
10375 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
10376 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
10377 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
10378 icf.
10379 * symtab.cc (Symbol_table::is_section_folded): New function.
10380 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
10381 to sections marked as identical by icf.
10382 * symtab.h (Symbol_table::set_icf): New function.
10383 (Symbol_table::icf): New function.
10384 (Symbol_table::is_section_folded): New function.
10385 (Symbol_table::icf_): New data member.
10386 * target-reloc.h (relocate_section): Ignore sections folded by icf.
10387 * testsuite/Makefile.am: Add commands to build icf_test.
10388 * testsuite/Makefile.in: Regenerate.
10389 * testsuite/icf_test.sh: New file.
10390 * testsuite/icf_test.cc: New file.
10391
c3b65ac4
CD
103922009-07-24 Chris Demetriou <cgd@google.com>
10393
10394 * layout.cc (is_compressible_debug_section): Fix incorrect
10395 comment about compressed section names.
10396
1caf2c51
ILT
103972009-07-20 Ian Lance Taylor <ian@airs.com>
10398
10399 PR 10419
10400 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
10401
1ef4d87f
ILT
104022009-07-16 Ian Lance Taylor <iant@google.com>
10403
10404 PR 10400
10405 * layout.h: #include <map>.
10406 (class Kept_section): Change from struct to class. Add accessors
10407 and setters. Add section size to Comdat_group mapping. Change
10408 Comdat_group to std::map. Add is_comdat_ field. Add
10409 linkonce_size field in union.
10410 (class Layout): Update declaration of find_or_add_kept_section.
10411 Don't declare find_kept_object.
10412 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
10413 parameter. Add object, shndx, is_comdat, and is_group_name
10414 parameters. Change all callers. Adjust for new Kept_section.
10415 (Layout::find_kept_object): Remove.
10416 * object.cc (Sized_relobj::include_section_group): Update use of
10417 Kept_section. Rename secnum to shndx. Only record
10418 Kept_comdat_section if sections are the same size.
10419 (Sized_relobj::include_linkonce_section): Update use of
10420 Kept_section. Only record Kept_comdat_section if sections are the
10421 same size. Set size of linkonce section.
10422 (Sized_relobj::map_to_kept_section): Update call to
10423 get_kept_comdat_section.
10424 * object.h (class Sized_relobj): Rename fields in
10425 Kept_comdat_section to drop trailing underscores; change object
10426 field to Relobj*. Change Kept_comdat_section_table to store
10427 struct rather than pointer.
10428 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
10429 Add kept_object and kept_shndx parameters. Change all callers.
10430 (Sized_relobj::get_kept_comdat_section): Change return type to
10431 bool. Add kept_object and kept_shndx parameters. Change all
10432 callers.
10433 * plugin.cc (Pluginobj::include_comdat_group): Update call to
10434 Layout::find_or_add_kept_section.
10435
37c3b7b0
ILT
104362009-07-09 Ian Lance Taylor <iant@google.com>
10437
10438 * merge.cc (Object_merge_map::initialize_input_to_output_map):
10439 Reserve space in the hash table.
10440
98fa85cb
ILT
104412009-07-06 Mikolaj Zalewski <mikolajz@google.com>
10442
10443 * fileread.cc (File_read::get_mtime): New method.
10444 * fileread.h (Timespec): New structure.
10445 (File_read::get_mtime): New method.
10446 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
10447 Renamed from timestamp_nsec.
10448 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
10449 Elf_Xword.
e1df38aa 10450 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 10451 timestamp_nsec.
e1df38aa 10452 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
10453 (Incremental_inputs::report_obejct): Save mtime; style fix.
10454 (Incremental_inputs::report_script): Save mtime; style fix.
10455 (Incremental_inputs::finalize_inputs): Style fix.
10456 (Incremental_inputs::finalize): Style fix.
10457 (Incremental_inputs::create_input_section_data): Store inputs
10458 mtime.
10459 * incremental.h (Incremental_inputs::report_script): Add mtime
10460 argument.
10461 (Incremental_inputs::Input_info::Input_info): Intialize only one
10462 union member.
10463 (Incremental_inputs::Input_info::archive): Move to nameless
10464 union.
10465 (Incremental_inputs::Input_info::obejct): Move to nameless union.
10466 (Incremental_inputs::Input_info::script): Move to nameless union.
10467 (Incremental_inputs::mtime): New field.
10468 * script.cc (read_input_script): Pass file mtime to
10469 Incremental_input.
10470 * script.h (Script_info::inputs): Style fix.
10471
c9d70757
ILT
104722009-07-01 Ian Lance Taylor <ian@airs.com>
10473
10474 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
10475 instead of 32.
10476
9c547ec3
ILT
104772009-06-24 Ian Lance Taylor <iant@google.com>
10478
10479 PR 10156
10480 * layout.cc (Layout::choose_output_section): If we find an
10481 existing section, update the flags.
10482 (Layout::create_notes): New function, broken out of
10483 Layout::finalize.
10484 (Layout::finalize): Don't create note sections.
10485 (Layout::create_note): Don't crash if linker script discards
10486 section.
10487 (Layout::create_gold_note): Likewise.
10488 (Layout::create_build_id): Likewise. Don't set
10489 after_input_sections on the section.
10490 (Layout::create_executable_stack_info): Remove target parameter.
10491 Change caller.
10492 * layout.h (class Layout): Declare create_notes. Update
10493 declaration of create_executable_stack_info.
10494 * gold.cc (queue_middle_tasks): Call create_notes.
10495 * output.cc (Output_section::update_flags_for_input_section): Move
10496 here from output.h. If SHF_ALLOC flag is newly set, mark address
10497 invalid.
10498 * output.h (Output_data::mark_address_invalid): New function.
10499 (class Output_section): Only declare, not define,
10500 update_flags_for_input_section. Remove set_flags.
10501
55458500
ILT
105022009-06-24 Ian Lance Taylor <iant@google.com>
10503
10504 * script-sections.cc (Output_section_definition::
10505 set_section_addresses): Rename shadowing local load_address to
10506 laddr.
10507
1307d6cd
ILT
105082009-06-24 Ian Lance Taylor <iant@google.com>
10509
10510 PR 10244
10511 * reloc.cc (relocate_sections): Skip empty relocation sections.
10512
ec3f783e
ILT
105132009-06-23 Ian Lance Taylor <iant@google.com>
10514
10515 PR 10156
10516 * layout.cc (Layout::create_note): Use choose_output_section
10517 rather than make_output_section.
10518
459c9f1c
ILT
105192009-06-23 Ian Lance Taylor <iant@google.com>
10520
10521 PR 10237
10522 * options.cc (General_options::parse_V): Set printed_version_.
10523 (General_options::General_options): Initialize printed_version_.
10524 * options.h (class General_options): Add printed_version_ field.
10525 * gold.cc (queue_initial_tasks): If there are no input files,
10526 don't give a fatal error if we printed the version information.
10527 (queue_middle_tasks): If using -r with a shared object, give a
10528 fatal error rather than an ordinary error.
10529
1518dc8f
ILT
105302009-06-23 Ian Lance Taylor <iant@google.com>
10531
10532 PR 10219
10533 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
10534 (Layout::make_output_section): Set have_stabstr_section_ if we see
10535 a .stab*str section.
10536 (Layout::finalize): Call link_stabs_sections.
10537 (Layout::link_stabs_sections): New file.
10538 * layout.h (class Layout): Add have_stabstr_section_ field.
10539 Declare link_stabs_sections.
10540
3d857b98
DK
105412009-06-23 Doug Kwan <dougkwan@google.com>
10542
10543 * Makefile.am (libgold_a_LIBADD): New.
10544 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 10545 * Makefile.in: Regenerate.
3d857b98
DK
10546 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
10547 * configure: Regenerate.
10548 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
10549 * fileread.cc: Include sys/state.h
10550 * gold.h: Declare memmem and strndup if found missing.
10551 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
10552
0639a6f6
ILT
105532009-06-23 Ian Lance Taylor <iant@google.com>
10554
10555 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
10556 * configure: Rebuild.
10557
8d63875c
ILT
105582009-06-23 Ian Lance Taylor <iant@google.com>
10559
10560 PR 10147
10561 * object.cc (Object::section_contents): Don't try to get a view if
10562 the section has length zero.
10563 (Object::handle_gnu_warning_section): If the section is empty, use
10564 the name of the section as the warning.
10565
f7c8a183
ILT
105662009-06-23 Ian Lance Taylor <iant@google.com>
10567
10568 PR 10133
10569 * stringpool.h (class Stringpool_template): Add optimize_ field.
10570 (Stringpool_template::set_optimize): New function.
10571 * stringpool.cc (Stringpool_template::Stringpool_template):
10572 Initialize optimize_ field.
10573 (Stringpool_template::set_string_offsets): Test local optimize
10574 fild rather than parameter.
10575 * layout.cc (Layout::Layout): Call set_optimize on the section
10576 name stringpool.
10577
e6a307ba
ILT
105782009-06-22 Ian Lance Taylor <iant@google.com>
10579
10580 PR 10030
10581 * yyscript.y: Parse TARGET.
10582 * script.cc (script_set_target): New function.
10583 * script-c.h (script_set_target): Declare.
10584 * options.cc (General_options::string_to_object_format): Rename
10585 from string_to_object_format in anonymous namespace. Change
10586 callers.
10587 * options.h (class General_options): Declare
10588 string_to_object_format.
10589
3ee173de
ILT
105902009-06-22 Ian Lance Taylor <iant@google.com>
10591
10592 * script-sections.cc (Script_sections::create_segments): Don't put
10593 program headers in a PT_LOAD segment if -n or -N.
10594
105952009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
10596
10597 PR 10141
10598 * options.h (class General_options): Add -z lazy and -z now. Sort
10599 -z options into alphabetical order.
10600 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
10601
cd6739a1 106022009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
10603
10604 * layout.cc (Layout::make_output_section): Call
10605 Target::new_output_section.
10606 (Layout::attach_allocated_section_to_segment): Put large section
10607 sections in a separate load segment with the large segment flag
10608 set.
10609 (Layout::segment_precedes): Sort large data segments after other
10610 load segments.
10611 (align_file_offset): New static function.
10612 (Layout::set_segment_offsets): Use align_file_offset.
10613 * output.h (class Output_section): Add is_small_section_ and
10614 is_large_section_ fields.
10615 (Output_section::is_small_section): New function.
10616 (Output_section::set_is_small_section): New function.
10617 (Output_section::is_large_section): New function.
10618 (Output_section::set_is_large_section): New function.
10619 (Output_section::is_large_data_section): New function.
10620 (class Output_segment): Add is_large_data_segment_ field.
10621 (Output_segment::is_large_data_segment): New function.
10622 (Output_segment::set_is_large_data_segment): New function.
10623 * output.cc (Output_section::Output_section): Initialize new
10624 fields.
10625 (Output_segment::Output_segment): Likewise.
10626 (Output_segment::add_output_section): Add assertion that large
10627 data sections always go in large data segments. Force small data
10628 sections to the end of the list of data sections. Force small BSS
10629 sections to the start of the list of BSS sections. For large BSS
10630 sections to the end of the list of BSS sections.
10631 * symtab.h (class Symbol): Declare is_common_shndx.
10632 (Symbol::is_defined): Check Symbol::is_common_shndx.
10633 (Symbol::is_common): Likewise.
10634 (class Symbol_table): Define enum Commons_section_type. Update
10635 declarations. Add small_commons_ and large_commons_ fields.
10636 * symtab.cc (Symbol::is_common_shndx): New function.
10637 (Symbol_table::Symbol_table): Initialize new fields.
10638 (Symbol_table::add_from_object): Put small and large common
10639 symbols in the right list.
10640 (Symbol_table::sized_finalized_symbol): Check
10641 Symbol::is_common_shndx.
10642 (Symbol_table::sized_write_globals): Likewise.
10643 * common.cc (Symbol_table::do_allocate_commons): Allocate new
10644 common symbol lists. Don't call do_allocate_commons_list if the
10645 list is empty.
10646 (Symbol_table::do_allocate_commons_list): Remove is_tls
10647 parameter. Add comons_section_type parameter. Change all
10648 callers. Handle small and large common symbols.
10649 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
10650 Symbol::is_common_shndx.
10651 * resolve.cc (symbol_to_bits): Likewise.
10652 * target.h (Target::small_common_shndx): New function.
10653 (Target::small_common_section_flags): New function.
10654 (Target::large_common_shndx): New function.
10655 (Target::large_common_section_flags): New function.
10656 (Target::new_output_section): New function.
10657 (Target::Target_info): Add small_common_shndx, large_common_shndx,
10658 small_common_section_flags, and large_common_section_flags
10659 fields.
10660 (Target::do_new_output_section): New virtual function.
10661 * arm.cc (Target_arm::arm_info): Initialize new fields.
10662 * i386.cc (Target_i386::i386_info): Likewise.
10663 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
10664 Likewise.
10665 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
10666 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
10667 (Target_x86_64::do_new_output_section): New function.
10668 * configure.ac: Define conditional MCMODEL_MEDIUM.
10669 * testsuite/Makefile.am (check_PROGRAMS): Add large.
10670 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
10671 (large_LDFLAGS): Define.
10672 * testsuite/large.c: New file.
10673 * testsuite/testfile.cc (Target_test::test_target_info):
10674 Initialize new fields.
10675 * configure, testsuite/Makefile.in: Rebuild.
10676
bb04269c
DK
106772009-06-05 Doug Kwan <dougkwan@google.com>
10678
10679 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 10680 * Makefile.in: Regenerate.
bb04269c
DK
10681 * i386.cc (class Target_i386): Define new virtual method to
10682 override do_is_local_label_name in parent.
10683 * object.cc (Sized_relobj::do_count_local_symbols): Discard
10684 local symbols if --discard-locals or -X is given.
10685 * options.h (class General_options): Declare new options
10686 '--discard-locals' and '-X' for discarding locals.
10687 * target.h (class Target): Define new methods is_local_label_name.
10688 Declare new virtual method do_is_local_label_name.
10689 * target.cc: New file.
10690 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
10691 (check_SCRIPTS): Add discard_locals_test.sh.
10692 (check_DATA): Add discard_local_tests.syms.
10693 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
10694 (discard_local_tests.syms, discard_locals_test.o): New make rules.
10695 * testsuite/Makefile.in: Regenerate.
10696 * testsuite/discard_locals_test.c: New file.
10697 * testsuite/discard_locals_test.sh: Same.
10698
805bb01c
DK
106992009-06-05 Doug Kwan <dougkwan@google.com>
10700
10701 * object.cc (Sized_relobj::Sized_relobj): Initialize
10702 discarded_eh_frame_shndx_ to -1U.
10703 (Sized_relobj::do_layout): Record index of a discard .eh_frame
10704 section.
10705 (Sized_relobj::do_count_local_symbols): Skip local symbols in
10706 a discarded .eh_frame section.
10707 (Sized_relobj::do_finalize_local_symbols): Ditto.
10708 * object.h (class Sized_relobj): Declare new member
10709 discarded_eh_frame_shndx_.
10710 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
10711 (local_labels_test.o, local_labels_test): New rules.
10712 * testsuite/Makefile.in: Regenerate.
10713
1dcd334d
DK
107142009-06-04 Doug Kwan <dougkwan@google.com>
10715
10716 * layout.cc (Layout::section_name_mapping): Add mapping for
10717 special ARM sections.
10718
96d49306
DK
107192009-06-03 Doug Kwan <dougkwan@google.com>
10720
10721 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
10722 (utils::has_overflow): Same.
10723
dff16297
ILT
107242009-06-03 Ian Lance Taylor <iant@google.com>
10725
10726 * layout.cc (Layout::section_name_mapping): New array, replacing
10727 Layout::linkonce_mapping.
10728 (Layout::section_name_mapping_count): New variable, replacing
10729 Layout::linkonce_mapping_count.
10730 (Layout::linkonce_output_name): Remove.
10731 (Layout::output_section_name): Rewrite.
10732 * layout.h (class Layout): Rename Linkonce_mapping to
10733 Section_name_mapping, linkonce_mapping to section_name_mapping,
10734 linkonce_mapping_count to section_name_mapping_count. Don't
10735 declare linkonce_output_name.
10736
c121c671
DK
107372009-06-03 Doug Kwan <dougkwan@google.com>
10738
10739 * gold/arm.cc (namespace utils): New.
10740 (Target_arm::reloc_is_non_pic): Define new method.
10741 (class Arm_relocate_functions): New.
10742 (Target_arm::Relocate::relocate): Handle relocation types used by
10743 Android.
10744
07800fab
ILT
107452009-06-03 Ian Lance Taylor <iant@google.com>
10746
10747 * arm.cc (Target_arm::scan::global): Use || instead of |.
10748
c121c671
DK
107492009-06-02 Doug Kwan <dougkwan@google.com>
10750
10751 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
10752 issued_non_pic_error_.
10753 (class Target_arm::Scan): Declare new method check_non_pic.
10754 Define new method symbol_needs_plt_entry.
10755 Declare new data member issued_non_pic_error_.
10756 (class Target_arm::Relocate): Declare new method
10757 should_apply_static_reloc.
10758 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
10759 (Target_arm::Scan::check_non_pic): Define new method.
10760 (Target_arm::Scan::local): Handle a small subset of reloc types used
10761 by Android.
10762 (Target_arm::Scan::local): Same.
10763 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
10764
b19b0c6d
ILT
107652009-05-31 Mikolaj Zalewski <mikolajz@google.com>
10766
10767 * incremental.cc (Incremental_inputs::report_command_line): Filter
10768 out --incremental-* options.
10769
94cdfcff
DK
107702009-05-29 Doug Kwan <dougkwan@google.com>
10771
10772 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
10773 template class.
10774 (class Target_arm): Update comment.
10775 (Target_arm::Target_arm): Initialize new data members GOT_,
10776 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
10777 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
10778 and Target_arm::rel_dyn_section.
10779 Declare new_enum Target_arm::Got_type.
10780 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
10781 and DYNBSS_.
10782 Update commments for member do_dynsym_value.
10783 (Target_arm::got_size, Target_arm::plt_section,
10784 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
10785 new methods inside class defintion.
10786 (Target_arm::got_section): Define new method.
10787 (Target_arm::rel_dyn_section): Same.
10788 (Output_data_plt_arm): New template class.
10789 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
10790 (Output_data_plt_arm:do_adjust_output_section): Define new method.
10791 (Output_data_plt_arm::add_entry): Same.
10792 (Output_data_plt_arm::first_plt_entry): Define new
10793 static data member for PLT instruction template.
10794 (Output_data_plt_arm::plt_entry): Same.
10795 (Output_data_plt_arm::do_write): Define new method.
10796 (Target_arm::make_plt_entry): Same.
10797 (Target_arm::do_finalize_sections): Same.
10798 (Target_arm::do_dynsym_value): Same.
10799
4a657b0d
DK
108002009-05-28 Doug Kwan <dougkwan@google.com>
10801
10802 * Makefile.am (TARGETSOURCES): Add arm.cc.
10803 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
10804 * Makefile.in: Regenerate.
10805 * arm.cc: New file.
10806 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
10807
e7ae8c36
DK
108082009-05-26 Doug Kwan <dougkwan@google.com>
10809
10810 * options.cc (General_options::parse_exclude_libs). Fix a comment.
10811 (General_options::check_excluded_libs): Strip off directories in
10812 archive name before matching like GNU ld does.
10813 * testsuite/Makefile.am (MOSTLYCLEANFILES,
10814 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
10815 (exclude_libs_test_LDFLAGS): Add linker option
10816 -Wl,--exclude-libs,libexclude_libs_test_3
10817 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
10818 an explicit archive without using -l.
10819 (alt/libexclude_libs_test_3.a): New make rule.
10820 * testsuite/Makefile.in: Regenerate.
10821 * testsuite/exclude_libs_test.c : Declare lib3_default().
10822 (main): Call it.
10823 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
10824 * exclude_libs_test_3.c: New file.
10825
f12e7348
NC
108262009-05-26 Nick Clifton <nickc@redhat.com>
10827
10828 * po/id.po: New Indonesian translation.
10829 * po/gold.pot: Updated template file.
10830
4daadc0d
ST
108312009-05-22 Sriraman Tallam <tmsriram@google.com>
10832
e1df38aa 10833 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
10834 gc_comdat_test files. Add -Wl,--gc-sections to build
10835 gc_comdat_test.
10836 * testsuite/Makefile.in: Regenerate.
10837 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
10838
531813ad
ST
108392009-05-21 Sriraman Tallam <tmsriram@google.com>
10840
10841 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
10842 kept comdat section was garbage collected.
10843 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
10844 * testsuite/Makefile.in: Regenerate.
10845 * testsuite/gc_comdat_test.sh: New file.
10846 * testsuite/gc_comdat_test_1.cc: New file.
10847 * testsuite/gc_comdat_test_2.cc: New file.
10848
65514900
CC
108492009-05-19 Doug Kwan <dougkwan@google.com>
10850
10851 * archive.cc (Archive::Archive): Move constructor from archive.h
10852 to here. Initialize no_export_.
10853 (Archive::get_elf_object_for_member): Set no_export flag of object.
10854 * archive.h (Archive::Archive): Move constructor body to
10855 archive.cc.
10856 (Archive::no_export): New method.
10857 (Archive::no_export_): New field.
10858 * object.h (Object::Object): Initialize no_export_ to false.
10859 (Object::no_export, Object::set_no_export): New methods.
10860 (Object::no_export_): New field.
10861 * options.cc (General_options::parse_exclude_libs): New method.
10862 (General_options::check_excluded_libs) Same.
10863 * options.h (exclude_libs): New option.
10864 (General_options::check_excluded_libs): New method declaration.
10865 (General_options::excluded_libs_): New field.
10866 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
10867 default or protected visibility if an object has no-export flag set.
10868 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
10869 (check_SCRIPTS): Add exclude_libs_test.sh.
10870 (check_DATA): Add exclude_libs_test.syms.
10871 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
10872 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
10873 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
10874 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
10875 (exclude_libs_test.syms, libexclude_libs_test_1.a,
10876 libexclude_libs_test_2.a): New rules.
10877 * testsuite/Makefile.in: Regenerate.
10878 * testsuite/exclude_libs_test.c: New file.
10879 * testsuite/exclude_libs_test.sh: Ditto.
10880 * testsuite/exclude_libs_test_1.c: Ditto.
10881 * testsuite/exclude_libs_test_2.c: Ditto.
10882
1b77ea50
ILT
108832009-05-15 Ian Lance Taylor <iant@google.com>
10884
10885 * configure.ac: Check for declarations for cases where libiberty.h
10886 checks HAVE_DECL_xxx.
10887 * configure, config.in: Rebuild.
10888
072fe7ce
ILT
108892009-05-15 Mikolaj Zalewski <mikolajz@google.com>
10890
10891 * gold.h (Incremental_argument_list): Remove (invalid) forward
10892 declaration.
10893 * incremental.cc (Incremental_inputs::report_achive): New method.
10894 (Incremental_inputs::report_object): New method.
10895 (Incremental_inputs::report_script): New method.
10896 (Incremental_inputs::finalize_inputs): New method.
10897 (Incremental_inputs::finalize): Call finalize_inputs().
10898 (Incremental_inputs::sized_create_incremental_inputs_section_data):
10899 Create inputs entries.
10900 * incremental.h (Incremental_input_type): New enum.
10901 (Incremental_inputs::Incremental_input): Initialize new fields.
10902 (Incremental_inputs::report_inputs): New method.
10903 (Incremental_inputs::report_achive): New method.
10904 (Incremental_inputs::report_object): New method.
10905 (Incremental_inputs::report_script): New method.
10906 (Incremental_inputs::finalize_inputs): New method.
10907 (Incremental_inputs::Input_info): New struct.
10908 (Incremental_inputs::Input_info_map): New typedef.
10909 (Incremental_inputs::lock_): New field.
10910 (Incremental_inputs::Inputs_): New field.
10911 (Incremental_inputs::Inputs_map): New field.
10912 * main.cc (main): Call Incremental_input::report_inputs.
10913 * options.h (Input_argument_list): Typedef moved from
10914 Input_arguments.
10915 (Input_file_group::Files): Remove, use ::Input_argument_list.
10916 (Input_file_group::Input_argument_list): Remove, use
10917 ::Input_argument_list.
10918 * plugin.cc (Plugin_manager::add_input_file): Add error in
10919 incremental build.
10920 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
10921 functions.
10922 * script.cc (read_input_script): Call
10923 Incremental_input::report_script.
10924 * script.h (Script_info): New class.
10925
b0481b0b
ILT
109262009-04-27 Ian Lance Taylor <iant@google.com>
10927
10928 * x86_64.cc (do_adjust_output_section): Set entsize to
10929 plt_entry_size.
10930
b22a5a41 109312009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
10932
10933 * output.cc (Output_file::close): After short writes, continue
10934 writing from the correct offset in the buffer being written.
10935
40fde488
CD
109362009-04-23 Chris Demetriou <cgd@google.com>
10937
10938 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
10939 * configure: Regenerate.
10940 * config.in: Regenerate.
10941 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
10942 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
10943
3ce2c28e
ILT
109442009-04-21 Mikolaj Zalewski <mikolajz@google.com>
10945
10946 * incremental.cc (Incremental_inputs_header_data): Renamed from
10947 Incremental_input_header_data.
10948 (Incremental_inputs_header_data::data_size): New field.
10949 (Incremental_inputs_header_data::put_input_file_count): Renamed
10950 from input_file_count.
10951 (Incremental_inputs_header_data::put_command_line_offset): Renamed
10952 from command_line_offset.
10953 (Incremental_inputs_header_data::put_reserved): Renamed from
10954 put_reserved.
10955 (Incremental_inputs_entry_data): Renamed from
10956 Incremental_input_entry_data.
10957 (Incremental_inputs_entry_data::data_size): New field.
10958 (Incremental_inputs::report_command_line): New method.
10959 (Incremental_inputs::finalize): New method.
10960 (Incremental_inputs::create_incremental_inputs_data): New method.
10961 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
10962 * incremental.h: New file.
10963 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 10964 (Layout::finalize): Create incremental inputs section in
3ce2c28e 10965 incremental builds.
703d02da 10966 (Layout::create_incremental_info_sections): New method.
3ce2c28e 10967 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
10968 (Layout::create_incremental_info_sections): New method.
10969 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
10970 * main.cc (main): Notify Incremental_input of the command line.
10971
e55bde5e
ILT
109722009-04-01 Ian Lance Taylor <iant@google.com>
10973 Mikolaj Zalewski <mikolajz@google.com>
10974
10975 * gold.h (reserve_unordered_map): Define, three versions, one for
10976 each version of Unordered_map.
10977 * layout.cc (Layout::Layout): Remove options parameter. Add
10978 number_of_input_files parameter. Don't initialize options_.
10979 Initialize number_of_input_files_ and resized_signatures_. Move
10980 sections_are_attached_.
10981 (Layout::layout_group): Reserve space for group_signatures_.
10982 (Layout::find_or_add_kept_section): Change name parameter to be a
10983 reference. Resize signatures_ map when it gets large enough.
10984 (Layout::layout_eh_frame): Use parameters->options() instead of
10985 this->options_.
10986 (Layout::make_output_section): Likewise.
10987 (Layout::attach_allocated_section_to_segment): Likewise.
10988 (Layout::finalize, Layout::create_executable_stack): Likewise.
10989 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
10990 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
10991 * layout.h (class Layout): Update declarations. Remove options_
10992 field. Add number_of_input_files_ and resized_signatures_
10993 fields. Move sections_are_attached_ field.
10994 * main.cc (main): Pass number of input files to Layout
10995 constructor. Don't pass options.
10996
154b857c
ILT
109972009-03-30 Ian Lance Taylor <iant@google.com>
10998
10999 * ffsll.c (ffsll): Correct implementation.
11000
2f35ab9b
ILT
110012009-03-27 Ian Lance Taylor <iant@google.com>
11002
fd03461a
ILT
11003 * ffsll.c: New file.
11004 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
11005 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
11006 * ftruncate.c (ftruncate): Declare before definition.
11007 * mremap.c (mremap): Likewise.
11008 * pread.c (pread): Likewise.
11009 * configure, Makefile.in, config.in: Rebuild.
11010
2f35ab9b
ILT
11011 * mremap.c: New file.
11012 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
11013 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
11014 (mremap): Declare if HAVE_MREMAP is not defined.
11015 * configure, Makefile.in, config.in: Rebuild.
11016
33aea2fd
CC
110172009-03-27 Cary Coutant <ccoutant@google.com>
11018
11019 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
11020 position independent.
11021 * sparc.cc (Target_sparc::check_non_pic): Likewise.
11022 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
11023
6d479619
CC
110242009-03-24 Cary Coutant <ccoutant@google.com>
11025
11026 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
11027 an executable.
11028 (needs_dynamic_reloc): Likewise.
11029
afc06bb8
ILT
110302009-03-24 Ian Lance Taylor <iant@google.com>
11031
11032 * yyscript.y (file_cmd): Recognize EXTERN.
11033 (extern_name_list, extern_name_list_body): New nonterminals.
11034 * script.cc (script_add_extern): Define.
11035 * script-c.h (script_add_extern): Declare.
11036
f6060a4d
ILT
110372009-03-24 Rafael Avila de Espindola <espindola@google.com>
11038
11039 * object.cc (is_elf_object): Define.
11040 * object.h (is_elf_object): Declare.
11041 * archive.cc (Archive::get_elf_object_for_member): Call
11042 is_elf_object.
33aea2fd 11043 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 11044
26736d8e
ILT
110452009-03-24 Elliott Hughes <enh@google.com>
11046
11047 * output.cc (Output_file::map_anonymous): Define.
11048 (Output_file::map): Use map_anonymous. If the regular mmap fails,
11049 try an anonymous one. Report the size if the mmap fails.
11050 * output.h (class Output_file): Declare map_anonymous.
11051
22fd9730
ILT
110522009-03-24 Ian Lance Taylor <iant@google.com>
11053
11054 * target-select.cc (instantiate_target): Don't acquire the lock if
11055 the instantiated_target_ field has already been set.
11056
cb010894
ILT
110572009-03-23 Ian Lance Taylor <iant@google.com>
11058
7f055c20
ILT
11059 * gold-threads.h (class Initialize_lock): Define.
11060 * gold-threads.cc (class Initialize_lock_once): Define.
11061 (initialize_lock_control): New static variable.
11062 (initialize_lock_pointer): New static variable.
11063 (initialize_lock_once): New static function.
11064 (Initialize_lock::Initialize_lock): Define.
11065 (Initialize_lock::initialize): Define.
11066 * target-select.h: Include "gold-threads.h".
11067 (class Target_selector): Add lock_ and initialize_lock_ fields.
11068 Don't define instantiate_target, just declare it.
11069 * target-select.cc (Target_selector::Target_selector): Initialize
11070 new fields.
11071 (Target_selector::instantiate_target): Define.
11072 * descriptors.h: Include "gold-threads.h".
11073 (class Descriptors): Add initialize_lock_ field.
11074 * descriptors.cc (Descriptors::Descriptors): Initialize new
11075 field.
11076 (Descriptors::open): Use initialize_lock_ field
11077 * errors.h (class Errors): Add initialize_lock_ field.
11078 * errors.cc (Errors::Errors): Initialize new field.
11079 (Errors::initialize_lock): Use initialize_lock_ field.
11080 * powerpc.cc (class Target_selector_powerpc): Remove
11081 instantiated_target_ field. In do_recognize call
11082 instantiate_target rather than do_instantiate_target. In
11083 do_instantiate_target just allocate a new target.
11084 * sparc.cc (class Target_selector_sparc): Likewise.
11085
36959681
ILT
11086 * freebsd.h: New file.
11087 * i386.cc: Include "freebsd.h".
11088 (Target_i386): Derive from Target_freebsd rather than
11089 Sized_target.
11090 (Target_selector_i386): Derive from Target_selector_freebsd rather
11091 than Target_selector.
11092 * x86_64.cc: Include "freebsd.h".
11093 (Target_x86_64): Derive from Target_freebsd rather than
11094 Sized_target.
11095 (Target_selector_x86_64): Derive from Target_selector_freebsd
11096 rather than Target_selector.
11097 * target.h (class Target): Add adjust_elf_header and
11098 do_adjust_elf_header.
11099 * output.cc (Output_file_header:: do_sized_write): Call target
11100 adjust_elf_header routine.
11101 * configure.tgt: Set targ_osabi.
11102 * configure.ac: Define GOLD_DEFAULT_OSABI.
11103 * parameters.cc (Parameters::default_target): Pass
11104 GOLD_DEFAULT_OSABI to select_target.
11105 * target-select.h (class Target_selector): Make instantiate_target
11106 protected rather than private.
11107 * Makefile.am (HFILES): Add freebsd.h.
11108 * configure, Makefile.in, config.in: Rebuild.
11109
cb010894
ILT
11110 * merge.cc (do_add_input_section): Correct pend value. Change
11111 message about last entry not being null terminated from error to
11112 warning.
11113
0e879927
ILT
111142009-03-20 Mikolaj Zalewski <mikolajz@google.com>
11115
11116 * incremental.cc: New file.
11117 * Makefile.am (CCFILES): Add incremental.cc.
11118 * Makefile.in: Rebuild.
11119
41105937
PP
111202009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
11121
11122 * layout.cc (Layout::output_section_name): Preserve names
11123 of '.note.' sections.
e1df38aa 11124
60439920
ILT
111252009-03-19 Ian Lance Taylor <iant@google.com>
11126
11127 * descriptors.cc (Descriptors::open): Check that the options are
11128 valid before using them.
11129
0d371ad3
ILT
111302009-03-18 Ian Lance Taylor <iant@google.com>
11131
11132 * script-sections.h: Include <list>.
11133 (class Script_sections): Change Sections_elements from std::vector
11134 to std::list. Typedef public Elements_iterator. Add
11135 orphan_section_placement_, data_segment_align_start_, and
11136 saw_data_segment_align_ fields. Remove data_segment_align_index_
11137 field.
11138 * script-sections.cc (class Orphan_section_placement): New class.
11139 (class Sections_element): Add virtual functions is_relro and
11140 orphan_section_init. Remove virtual function place_orphan_here.
11141 (class Output_section_definition): Add is_relro and
11142 orphan_section_init. Remove place_orphan_here.
11143 (class Orphan_output_section): Likewise.
11144 (Script_sections::Script_sections): Update for field changes.
11145 (Script_sections::data_segment_align): Set saw_data_segment_align_
11146 and data_segment_align_start_, not data_segment_align_index.
11147 (Script_sections::data_segment_relro_end): Check
11148 saw_data_segment_align_. Use data_segment_align_start_ rather
11149 than data_segment_align_index_.
11150 (Script_sections::place_orphan): Rewrite to use
11151 Orphan_section_placement.
11152
9201d894
ILT
111532009-03-17 Ian Lance Taylor <iant@google.com>
11154
9c5b8369
ILT
11155 * archive.cc (Archive::add_symbols): Check for a version attached
11156 to the symbol name in the archive map.
11157 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
11158 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
11159 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
11160 (ver_test_11.a): New target.
11161 * testsuite/Makefile.in: Rebuild.
11162
9201d894
ILT
11163 * configure.ac: Check for chsize and posix_fallocate. Replace
11164 ftruncate.
11165 * ftruncate.c: New file, from gnulib.
11166 * output.cc (posix_fallocate): Define dummy version if not
11167 HAVE_POSIX_FALLOCATE.
11168 (Output_file::map): Call posix_fallocate rather than lseek and
11169 write.
11170 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
11171 * configure, Makefile.in, config.in: Rebuild.
11172
ef4ab7a8 111732009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 11174
ef4ab7a8
PP
11175 * layout.h (Layout::create_note): Add section_name parameter.
11176 * layout.cc (Layout::create_note): Likewise.
11177 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 11178
8c500701
ILT
111792009-03-17 Ian Lance Taylor <iant@google.com>
11180
e85b18e1
ILT
11181 * descriptors.cc: Include "options.h".
11182 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
11183 (Descriptors::open): Always use O_CLOEXEC when opening a new
11184 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
11185 then set FD_CLOEXEC.
11186
9efe6174
ILT
11187 * sparc.cc (class Target_sparc): Add has_got_section.
11188 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
11189 make sure we have a GOT section.
11190
11191 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
11192 (Target_sparc::Scan::local): Likewise.
11193 (Target_sparc::Scan::global): Likewise.
11194 (Target_sparc::Relocate::relocate): Likewise.
11195 (Target_sparc::Relocate::relocate_tls): Likewise.
11196
8c500701
ILT
11197 * symtab.cc (Symbol_table::define_default_version): New function,
11198 broken out of add_from_object.
11199 (Symbol_table::add_from_object): Call define_default_version.
11200 (Symbol_table::define_special_symbol): Add resolve_oldsym
11201 parameter. Change all callers. If the version for a symbol comes
11202 from a version script, resolve it with the symbol with the same
11203 name with no version. Also add the symbol without a version if
11204 appropriate.
11205 (do_define_in_output_data): If resolving with oldsym, don't delete
11206 sym.
11207 (do_define_in_output_segment): Likewise.
11208 (do_define_as_constant): Likewise.
11209 * symtab.h (class Symbol_table): Update declarations.
11210
f1ed28fb
ILT
112112009-03-13 Ian Lance Taylor <iant@google.com>
11212
15f8229b
ILT
11213 * readsyms.cc (Read_symbols::incompatible_warning): New function.
11214 (Read_symbols::requeue): New function.
11215 (Read_symbols::do_read_symbols): If make_elf_object fails because
11216 the target type is not configured, and the file was searched for,
11217 issue a warning and retry with the next directory.
11218 (Add_symbols::run): If the file has an incompatible format, and
11219 it was searched for, requeue the Read_symbols task. On error,
11220 release the object.
11221 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
11222 dirindex parameter to constructor. Change all callers. Declare
11223 incompatible_warning and requeue.
11224 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
11225 input_argument_ and input_group_ fields. Add them to
11226 constructor. Change all callers.
11227 (class Read_script): Add dirindex_ field. Add it to constructor.
11228 Change all callers.
11229 * archive.cc (Archive::setup): Remove input_objects parameter.
11230 Change all callers.
11231 (Archive::get_file_and_offset): Likewise.
11232 (Archive::read_all_symbols): Likewise.
11233 (Archive::read_symbols): Likewise.
11234 (Archive::get_elf_object_for_member): Remove input_objects
11235 parameter. Add punconfigured parameter. Change all callers.
11236 (Archive::add_symbols): Change return type to bool. Check return
11237 value of include_member.
11238 (Archive::include_all_members): Likewise.
11239 (Archive::include_member): Change return type to bool. Return
11240 false if first included object has incompatible target. Set
11241 included_member_ field.
11242 (Add_archive_symbols::run): If add_symbols returns false, requeue
11243 Read_symbols task.
11244 * archive.h (class Archive): Add included_member_ field.
11245 Initialize it in constructor. Add input_file and searched_for
11246 methods. Update declarations.
11247 (class Add_archive_symbols): Add dirpath_, dirindex_, and
11248 input_argument_ fields. Add them to constructor. Change all
11249 callers.
11250 * script.cc: Include "target-select.h".
11251 (class Parser_closure): Add skip_on_incompatible_target_ and
11252 found_incompatible_target_ fields. Add
11253 skip_on_incompatible_target parameter to constructor. Change all
11254 callers. Add methods skip_on_incompatible_target,
11255 clear_skip_on_incompatible_target, found_incompatible_target, and
11256 set_found_incompatible_target.
11257 (read_input_script): Add dirindex parameter. Change all callers.
11258 If parser finds an incompatible target, requeue Read_symbols
11259 task.
11260 (script_set_symbol): Clear skip_on_incompatible_target in
11261 closure.
11262 (script_add_assertion, script_parse_option): Likewise.
11263 (script_start_sections, script_add_phdr): Likewise.
11264 (script_check_output_format): New function.
11265 * script.h (read_input_script): Update declaration.
11266 * script-c.h (script_check_output_format): Declare.
11267 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
11268 (ignore_cmd): Remove OUTPUT_FORMAT.
11269 * fileread.cc (Input_file::Input_file): Add explicit this.
11270 (Input_file::will_search_for): New function.
11271 (Input_file::open): Add pindex parameter. Change all callers.
11272 * fileread.h (class Input_file): Add input_file_argument method.
11273 Declare will_search_for. Update declarations.
11274 * object.cc (make_elf_object): Add punconfigured parameter.
11275 Change all callers.
11276 * object.h (class Object): Make input_file public. Add
11277 searched_for method.
11278 (make_elf_object): Update declaration.
11279 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
11280 restart search.
11281 * dirsearch.h (class Dirsearch): Update declaration.
11282 * options.h (class General_options): Add --warn-search-mismatch.
11283 * parameters.cc (Parameters::is_compatible_target): New function.
11284 * parameters.h (class Parameters): Declare is_compatible_target.
11285 * workqueue.cc (Workqueue::add_blocker): New function.
11286 * workqueue.h (class Workqueue): Declare add_blocker.
11287
f1ed28fb
ILT
11288 * fileread.cc (Input_file::open): Remove options parameter.
11289 Change all callers.
11290 (Input_file::open_binary): Likewise.
11291 * script.cc (read_input_script): Likewise.
11292 * readsyms.h (class Read_symbols): Remove options_ field. Remove
11293 options parameter from constructor. Change all callers.
11294 (class Read_script): Likewise.
11295 * fileread.h (class Input_file): Update declarations.
11296 * script.h (read_input_script): Update declaration.
11297
34dd024a
NC
112982009-03-10 Nick Clifton <nickc@redhat.com>
11299
11300 * po/es.po: New Spanish translation.
11301
6d71b17c
CC
113022009-03-06 Cary Coutant <ccoutant@google.com>
11303
11304 * options.cc (parse_short_option): Keep dash_z from registering itself.
11305
031cdbed
ILT
113062009-03-03 Ian Lance Taylor <iant@google.com>
11307
11308 PR 9918
11309 * target-reloc.h (relocate_section): Pass output_section to
11310 relocate.
11311 * i386.cc (Target_i386::should_apply_static_reloc): Add
11312 output_section parameter. Change all callers.
11313 (Target_i386::Relocate::relocate): Add output_section parameter.
11314 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
11315 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
11316 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
11317 * testsuite/two_file_shared.sh: New script.
11318 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
11319 (check_DATA): Add two_file_shared.dbg.
11320 (two_file_shared.dbg): New target.
11321 * testsuite/Makefile.in: Rebuild.
11322
15d5fa16
ILT
113232009-03-01 Ian Lance Taylor <iant@google.com>
11324
11325 * configure.ac: Check for byteswap.h.
11326 * configure: Rebuild.
11327 * config.in: Rebuild.
11328
8a4c0b0d
ILT
113292009-03-01 Mikolaj Zalewski <mikolajz@google.com>
11330
11331 * layout.cc (Layout::find_or_add_kept_section): New function.
11332 (Layout::add_comdat): Removed.
11333 * layout.h (struct Kept_section): Move out of class Layout.
11334 Remove trailing underscores from field names. Add group_sections
11335 field. Rename group_ field to is_group. Change all uses.
11336 (class Layout): Declare find_or_add_kept_section, not add_comdat.
11337 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
11338 comdat_groups_ field.
11339 (Sized_relobj::include_section_group): Use
11340 find_or_add_kept_section and Kept_section::group_sections.
11341 (Sized_relobj::include_linkonce_section): Likewise.
11342 * object.cc (class Sized_relobj): Don't define Comdat_group or
11343 Comdat_group_table. Remove find_comdat_group and
11344 add_comdat_group. Remove comdat_groups_ field.
11345 * plugin.cc (include_comdat_group): Use
11346 Layout::find_or_add_kept_section.
11347
b4ecf66b
ILT
113482009-02-28 Ian Lance Taylor <iant@google.com>
11349
14359ca0
ILT
11350 * README: --gc-sections and map files are now supported. Document
11351 some build requirements.
11352
b4ecf66b
ILT
11353 PR 6992
11354 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
11355 relocatable link set the value of the section symbol to zero.
11356 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
11357 relocatable link don't include the section address in the local
11358 symbol value.
11359
0602e05a
ILT
113602009-02-27 Ian Lance Taylor <iant@google.com>
11361
fd9d194f
ILT
11362 PR 6811
11363 * options.h (class Search_directory): Add is_system_directory.
11364 (class General_options): Declare is_in_system_directory.
11365 * options.cc (get_relative_sysroot): Make static.
11366 (get_default_sysroot): Make static.
11367 (General_optoins::is_in_system_directory): New function.
11368 * fileread.cc (Input_file::is_in_system_directory): New function.
11369 * fileread.h (class Input_file): Declare is_in_system_directory.
11370 * object.h (class Object): Add is_in_system_directory.
11371 (class Input_objects): Remove system_library_directory_ field.
11372 * object.cc (Input_objects::add_object): Don't set
11373 system_library_directory_.
11374 (input_objects::found_in_system_library_directory): Remove.
11375 * symtab.cc (Symbol_table::write_globals): Remove input_objects
11376 parameter. Change all callers.
11377 (Symbol_table::sized_write_globals): Likewise.
11378 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
11379 Call Object::is_in_system_directory.
11380 * symtab.h (class Symbol_table): Update declarations.
11381
61edd21f
ILT
11382 PR 5990
11383 * descriptors.h (Open_descriptor): Add is_on_stack field.
11384 * descriptors.cc (Descriptors::open): If the descriptor is on the
11385 top of the stack, remove it. Initialize is_on_stack field.
11386 (Descriptors::release): Only add pod to stack if it is not on the
11387 stack already.
11388 (Descriptors::close_some_descriptor): Clear stack_next and
11389 is_on_stack fields.
11390
e29e076a
ILT
11391 PR 7091
11392 * output.cc (Output_section::find_starting_output_address): Rename
11393 from starting_output_address; add PADDR parameter; change return
11394 type.
11395 * output.h (class Output_section): Declare
11396 find_starting_output_address instead of starting_output_address.
11397 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
11398 section symbol for which we can't find a merge section.
11399
0602e05a
ILT
11400 PR 9836
11401 * symtab.cc (Symbol_table::add_from_object): If the visibility is
11402 hidden or internal, force the symbol to be local.
11403 * resolve.cc (Symbol::override_visibility): Define.
11404 (Symbol::override_base): Use override_visibility.
11405 (Symbol_table::resolve): Likewise.
11406 (Symbol::override_base_with_special): Likewise.
11407 (Symbol_table::override_with_special): If the visibility is hidden
11408 or internal, force the symbol to be local.
11409 * symtab.h (class Symbol): Add set_visibility and
11410 override_visibility.
11411 * testsuite/ver_test_1.sh: New file.
11412 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
11413 (check_DATA): Add ver_test_1.syms.
11414 (ver_test_1.syms): New target.
11415 * testsuite/Makefile.in: Rebuild.
11416
401a9a73
CC
114172009-02-25 Cary Coutant <ccoutant@google.com>
11418
11419 * layout.cc (Layout::choose_output_section): Don't rename sections
11420 when using a linker script that has a SECTIONS clause.
11421 * Makefile.in: Regenerate.
11422
11423 * testsuite/Makefile.am (script_test_5.sh): New test case.
11424 * testsuite/Makefile.in: Regenerate.
11425 * testsuite/script_test_5.cc: New file.
11426 * testsuite/script_test_5.sh: New file.
11427 * testsuite/script_test_5.t: New file.
11428
f488e4b0
CC
114292009-02-13 Rafael Avila de Espindola <espindola@google.com>
11430
11431 * archive.cc (Archive::include_member): Update calls to add_symbols.
11432 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
11433 the Layout argument.
11434 * dynobj.h (do_add_symbols): Add the Layout argument.
11435 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
11436 Layout argument.
11437 * object.h (Object::add_symbols): Add the Layout argument.
11438 (Object::do_add_symbols): Add the Layout argument.
11439 (Sized_relobj::do_add_symbols): Add the Layout argument.
11440 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
11441 Unify the two versions.
11442 (Add_plugin_symbols): Remove.
11443 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
11444 (Sized_pluginobj::do_add_symbols): Unify the two versions.
11445 (Add_plugin_symbols): Remove.
11446 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
11447 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
11448 (Add_symbols::run): Make it work with Pulginobj.
11449
89dd1680
ILT
114502009-02-06 Ian Lance Taylor <iant@google.com>
11451
11452 * object.cc (Sized_relobj::do_layout): Make info message start
11453 with lower case letter.
11454
266d0a74
ILT
114552009-02-06 Mikolaj Zalewski <mikolajz@google.com>
11456
602b464e
ILT
11457 * binary.cc: Fix file comment.
11458
266d0a74
ILT
11459 * options.h (enum Incremental_disposition): Define.
11460 (class General_options): Add new options: --incremental,
11461 --incremental_changed, --incremental_unchanged,
11462 --incremental_unknown. Add incremental_disposition_ and
11463 implicit_incremental_ fields.
11464 (General_options::incremental_disposition): New function.
11465 (class Position_dependent_options): Add incremental_disposition
11466 option.
11467 (Position_dependent_options::copy_from_options): Set incremental
11468 dispositions.
11469 * options.cc (General_options::parse_incremental_changed): New
11470 function.
2e702c99
RM
11471 (General_options::parse_incremental_unchanged): New function.
11472 (General_options::parse_incremental_unknown): New function.
11473 (General_options::General_options): Initialize new fields
266d0a74 11474 incremental_disposition_ and implicit_incremental_.
2e702c99 11475 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
11476 without --incremental.
11477
f073bbf7
CD
114782009-02-06 Chris Demetriou <cgd@google.com>
11479
11480 * gold.h (gold_undefined_symbol): Change to take only a Symbol
11481 pointer and to report location as the file name associated with
11482 the symbol.
11483 (gold_undefined_symbol_at_location): New function to replace the
11484 old gold_undefined_symbol functionality.
11485 * target-reloc.h (relocate_section): Update to use
11486 gold_undefined_symbol_at_location.
11487 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
11488 Call gold_undefined_symbol function rather than gold_error.
11489 * errors.h (Errors::undefined_symbol): Take location as a
11490 string, rather than calculating it from a relocation.
11491 * errors.cc (Errors::fatal): Print "fatal error:" before the
11492 formatted message.
11493 (Errors::error, Errors::error_at_location): Print "error: "
11494 before the formatted message.
11495 (Errors::undefined_symbol): Take location as a string, rather
11496 than calculating it from a relocation.
11497 (gold_undefined_symbol_at_location): New function akin to
11498 old gold_undefined_symbol, calculates location from relocation.
11499 (gold_undefined_symbol): Change to take only a Symbol pointer
11500 and to report location as the file name associated with the symbol.
11501 * testsuite/debug_msg.sh: Update for changed error messages.
11502 * testsuite/undef_symbol.sh: Likewise.
11503
8e94a90c
ILT
115042009-02-04 Duncan Sands <baldrick@free.fr>
11505
11506 PR 9812
11507 * reduced_debug_output.h
11508 (Output_reduced_debug_abbrev_section::failed): Use format for
11509 gold_warning.
11510 (Output_reduced_debug_info_section::faild): Likewise.
11511
88a0e15b
ILT
115122009-01-31 Mikolaj Zalewski <mikolajz@google.com>
11513
11514 * script.cc (Lazy_demangler): New class.
2e702c99 11515 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
11516 symbol only once.
11517
5efc7cd2
CC
115182009-01-29 Cary Coutant <ccoutant@google.com>
11519
11520 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
11521 to __tls_get_addr.
11522 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
11523
e0ebcf42
ILT
115242009-01-28 Ian Lance Taylor <iant@google.com>
11525
5efc7cd2 11526 * version.cc (version_string): Bump to 1.9.
75fe7426 11527
e0ebcf42
ILT
11528 * gold.h: Include <cstring> and <stdint.h>.
11529 * version.cc: Include <cstdio>.
11530 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
11531 warning.
11532 * reduced_debug_output.cc (insert_into_vector): Rename from
11533 Insert_into_vector; change all callers. Use Swap_unaligned to
11534 avoid aliasing issue; remove union since it is unnecessary.
11535
8e2813be 115362009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
11537
11538 * Makefile.am (CCFILES): Add gc.cc.
11539 (HFILES): Add gc.h.
11540 * Makefile.in: Regenerate.
11541 * gold.cc (Gc_runner): New class.
11542 (queue_initial_tasks): Call garbage collection related tasks
11543 when corresponding options are invoked.
11544 (queue_middle_gc_tasks): New function.
11545 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
11546 processed early before laying out sections during garbage collection.
11547 * gold.h (queue_middle_gc_tasks): New function.
11548 (is_prefix_of): Move from "layout.cc".
11549 * i386.cc (Target_i386::gc_process_relocs): New function.
11550 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
11551 * main.cc (main): Create object of class "Garbage_collection".
11552 * object.cc (Relobj::copy_symbols_data): New function.
11553 (Relobj::is_section_name_included): New function.
e1df38aa
NC
11554 (Sized_relobj::do_layout): Allow this function to be called twice
11555 during garbage collection and defer layout of section during the
6d03d481
ST
11556 first call.
11557 * object.h (Relobj::get_symbols_data): New function.
11558 (Relobj::is_section_name_included): New function.
11559 (Relobj::copy_symbols_data): New function.
11560 (Relobj::set_symbols_data): New function.
11561 (Relobj::get_relocs_data): New function.
11562 (Relobj::set_relocs_data): New function.
11563 (Relobj::is_output_section_offset_invalid): New pure virtual function.
11564 (Relobj::gc_process_relocs): New function.
11565 (Relobj::do_gc_process_relocs): New pure virtual function.
11566 (Relobj::sd_): New data member.
11567 (Sized_relobj::is_output_section_offset_invalid): New function.
11568 (Sized_relobj::do_gc_process_relocs): New function.
11569 * options.h (General_options::gc_sections): Modify to not be a no-op.
11570 (General_options::print_gc_sections): New option.
11571 * plugin.cc (Plugin_finish::run): Remove function call to
11572 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
11573 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
11574 * reloc.cc (Read_relocs::run): Add task to process relocs and
11575 determine unreferenced sections when doing garbage collection.
11576 (Gc_process_relocs): New class.
11577 (Sized_relobj::do_gc_process_relocs): New function.
11578 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
11579 sections that are garbage collected.
11580 * reloc.h (Gc_process_relocs): New class.
11581 * sparc.cc (Target_sparc::gc_process_relocs): New function.
11582 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
11583 symbols whose corresponding sections are garbage collected.
11584 (Symbol_table::Symbol_table): Add new parameter for the garbage
11585 collection object.
11586 (Symbol_table::gc_mark_undef_symbols): New function.
11587 (Symbol_table::gc_mark_symbol_for_shlib): New function.
11588 (Symbol_table::gc_mark_dyn_syms): New function.
11589 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
11590 as garbage.
11591 (Symbol_table::add_from_object): Likewise.
11592 (Symbol_table::add_from_relobj): When building shared objects, do not
11593 treat externally visible symbols as garbage.
11594 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
11595 table information for static and relocatable links.
11596 * symtab.h (Symbol_table::set_gc): New function.
11597 (Symbol_table::gc): New function.
11598 (Symbol_table::gc_mark_undef_symbols): New function.
11599 (Symbol_table::gc_mark_symbol_for_shlib): New function.
11600 (Symbol_table::gc_mark_dyn_syms): New function.
11601 (Symbol_table::gc_): New data member.
e1df38aa 11602 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
11603 function.
11604 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
11605 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
11606
3b293544
CF
116072009-01-20 Chris Faylor <me.sourceware@sourceware.org>
11608
11609 * options.h (General_options::gc_sections): Define as a no-op for now.
11610 (General_options::no_keep_memory): Ditto.
11611 (General_options::Bshareable): Define.
11612 * options.cc (General_options::finalize): Honor -Bshareable.
11613
83d22aa8
AS
116142009-01-20 Andreas Schwab <schwab@suse.de>
11615
11616 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
11617 read the value in the contents, since we don't use it. Use the
11618 template endianness when writing.
11619 (Relocate::relocate): Use it for R_PPC_REL16_HA.
11620
cd536b21
AS
116212009-01-19 Andreas Schwab <schwab@suse.de>
11622
11623 * configure.tgt (powerpc64-*): Fix targ_obj.
11624
99e9a495
ILT
116252009-01-15 Ian Lance Taylor <iant@google.com>
11626
11627 * object.cc (Sized_relobj::write_local_symbols): Don't write out
11628 local symbols when stripping all symbols.
11629
bbbfea06
CC
116302009-01-14 Cary Coutant <ccoutant@google.com>
11631
99e9a495 11632 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 11633
0f7c0701
CC
116342009-01-14 Cary Coutant <ccoutant@google.com>
11635
11636 * archive.cc (Archive::get_elf_object_for_member): Remove call
11637 to File_read::claim_for_plugin.
11638 * descriptors.cc (Descriptors::open): Remove reference to
11639 is_claimed.
11640 (Descriptors::claim_for_plugin): Remove.
11641 * descriptors.h (Descriptors::claim_for_plugin): Remove.
11642 (Descriptors::is_claimed): Remove.
11643 (claim_descriptor_for_plugin): Remove.
11644 * fileread.cc (File_read::claim_for_plugin): Remove.
11645 * fileread.h (File_read::claim_for_plugin): Remove.
11646 (File_read::descriptor): Reopen descriptor if necessary.
11647 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
11648 (Plugin_manager::all_symbols_read): Add task parameter. Change
11649 all callers.
11650 (Plugin_manager::get_input_file): New function.
11651 (Plugin_manager::release_input_file): New function.
11652 (Pluginobj::Pluginobj): Add filesize parameter and initialize
11653 corresponding data member.
11654 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
11655 and pass to base constructor. Change all callers.
11656 (get_input_file, release_input_file): New functions.
11657 (make_sized_plugin_object): Add filesize parameter. Change all callers.
11658 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
11659 (Plugin_manager::all_symbols_read): Add task parameter.
11660 (Plugin_manager::get_input_file): New function.
11661 (Plugin_manager::release_input_file): New function.
11662 (Plugin_manager::task_): New data member.
11663 (Pluginobj::Pluginobj): Add filesize parameter.
11664 (Pluginobj::filename): New function.
11665 (Pluginobj::descriptor): New function.
11666 (Pluginobj::filesize): New function.
11667 (Pluginobj::filesize_): New data member.
11668 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
11669 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
11670 File_read::claim_for_plugin; use Object::unlock to unlock the file.
11671
11672 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
11673 with archive libraries.
11674 * testsuite/Makefile.in: Regenerate.
11675 * testsuite/plugin_test.c (struct sym_info): New type.
11676 (get_input_file, release_input_file): New static variables.
11677 (onload): Capture new transfer vector entries.
11678 (claim_file_hook): Stop reading at end of file according to filesize.
11679 Factor out parsing of readelf output into separate function.
11680 (all_symbols_read_hook): Exercise get_input_file and release_input_file
11681 APIs and get the source file name from the symbol table. Convert
11682 source file name to corresponding object file name. Print info
11683 message when adding new input files.
11684 (parse_readelf_line): New function.
11685 * testsuite/plugin_test_1.sh: Add checks for new info messages.
11686 * testsuite/plugin_test_2.sh: Likewise.
11687 * testsuite/plugin_test_3.sh: Likewise.
11688 * testsuite/plugin_test_4.sh: New test case.
11689
62a6d109
ILT
116902009-01-07 Ian Lance Taylor <iant@google.com>
11691
11692 * version.cc (version_string): Bump to 1.8.
11693
483620e8
CC
116942008-12-23 Cary Coutant <ccoutant@google.com>
11695
11696 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
11697 * plugin.cc (Plugin_manager::finish): Rename as
11698 layout_deferred_objects. Move cleanup to separate function.
11699 (Plugin_manager::cleanup): New function.
11700 (Plugin_finish::run): Call layout_deferred_objects and cleanup
11701 separately.
11702 * plugin.h (Plugin_manager::finish): Rename as
11703 layout_deferred_objects.
11704 (Plugin_manager::cleanup): New function.
11705 (Plugin_manager::cleanup_done): New field.
11706
d66a9eb3
CC
117072008-12-23 Cary Coutant <ccoutant@google.com>
11708
11709 * plugin.cc (is_visible_from_outside): New function.
11710 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
11711 so we don't return "IR only" status for exported symbols or -r links.
11712
11713 * testsuite/Makefile.am (plugin_test_3): New test case.
11714 * testsuite/Makefile.in: Regenerate.
11715 * testsuite/plugin_test_3.sh: New file.
11716
5995b570
CC
117172008-12-22 Cary Coutant <ccoutant@google.com>
11718
11719 * object.cc (Sized_relobj::layout_section): New function.
11720 (Sized_relobj::do_layout): Defer layout of input sections until after
11721 plugin has provided replacement files.
11722 (Sized_relobj::do_layout_deferred_sections): New function.
11723 * object.h (Relobj::set_section_offset): Remove virtual keyword.
11724 (Relobj::layout_deferred_sections): New function.
11725 (Relobj::do_layout_deferred_sections): New function.
11726 (Sized_relobj::do_layout_deferred_sections): New function.
11727 (Sized_relobj::layout_section): New function.
11728 (Sized_relobj::Deferred_layout): New structure.
11729 (Sized_relobj::deferred_layout_): New field.
11730 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
11731 Change all callers. Layout deferred sections.
11732 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
11733 references.
11734 (Plugin_hook::run): Move code from do_plugin_hook inline.
11735 (Plugin_hook::do_plugin_hook): Remove.
11736 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
11737 (Plugin_manager::finish): Renamed, was cleanup.
11738 (Plugin_manager::should_defer_layout): New function.
11739 (Plugin_manager::add_deferred_layout_object): New function.
11740 (Plugin_manager::Deferred_layout_list): New type.
11741 (Plugin_manager::deferred_layout_objects_): New field.
11742 (Plugin_hook::do_plugin_hook): Remove.
11743
ee769c88
ILT
117442008-12-17 Ian Lance Taylor <iant@google.com>
11745
11746 * options.h (class General_options): Add --no case for
11747 --export-dynamic.
11748
abc8dcba
CC
117492008-12-16 Cary Coutant <ccoutant@google.com>
11750
11751 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
11752 vector.
11753 (Plugin_manager::claim_file): Create plugin object even if
11754 plugin did not call the add_symbols callback.
11755 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
11756 asking for more symbols than were added.
11757 * testsuite/Makefile.am (plugin_test_1): Add test case with
11758 no global symbols.
11759 (empty.syms): New target.
11760 * testsuite/Makefile.in: Regenerate.
11761 * testsuite/plugin_test.c (claim_file_hook): Add new debug
11762 message. Don't call add_symbols if no globals.
11763 (all_symbols_read_hook): Don't provide replacement for empty
11764 claimed file.
11765
b0074644
ILT
117662008-12-12 Ian Lance Taylor <iant@google.com>
11767
68943102
ILT
11768 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
11769 r_type == 0 for a local symbol with r_sym == 0.
11770 (scan_relocatable_relocs): Pass r_sym to
11771 local_non_section_strategy.
11772 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
11773 r_sym parameter.
11774
b0074644
ILT
11775 * configure.ac: Update test for TLS descriptors: they are
11776 supported as of glibc 2.9.
11777 * configure: Rebuild.
11778
c2508178
ILT
117792008-12-11 Ian Lance Taylor <iant@google.com>
11780
11781 PR 7091
11782 * target-reloc.h (Default_scan_relocatable_relocs): For each
11783 function, map r_type == 0 to RELOC_DISCARD.
11784
2756a258
CC
117852008-12-10 Cary Coutant <ccoutant@google.com>
11786
11787 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
11788 object to override a kept COMDAT group from a plugin object.
11789
bb6f53d3
ILT
117902008-12-09 Ian Lance Taylor <iant@google.com>
11791
fbc558e1
ILT
11792 PR 7088
11793 * yyscript.y (file_cmd): Handle INPUT.
11794
bb6f53d3
ILT
11795 * testsuite/initpri1.c: Change all declarations to be full
11796 prototypes by adding void, to avoid compiler warnings.
11797
4674ecfc
CC
117982008-12-05 Rafael Avila de Espindola <espindola@google.com>
11799
11800 * options.cc (General_options::parse_plugin_opt): New.
11801 (General_options::add_plugin): The argument now is just the filename.
11802 (General_options::add_plugin_option): New.
11803 * options.h (plugin_opt): New.
11804 (add_plugin): Change argument name.
11805 (add_plugin_option): New.
11806 * plugin.cc (Plugin::load): Don't parse the plugin option.
11807 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
11808 (Plugin::add_option): New.
11809 (Plugin::args_): Change type.
11810 (Plugin::filename_): New.
11811 (Plugin_manager::add_plugin_option): New.
11812 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
11813 * testsuite/Makefile.in: Regenerate.
11814
fd06b4aa
CC
118152008-12-05 Cary Coutant <ccoutant@google.com>
11816
11817 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
11818 Handle --strip-lto-sections option.
11819 * options.h (strip_lto_sections): New option.
11820
6c52134c
CC
118212008-12-01 Cary Coutant <ccoutant@google.com>
11822
11823 * plugin.cc (ld_plugin_message): Change format parameter to const.
11824 Fix mismatch between new[] and delete.
11825
a45248e0
CC
118262008-11-14 Cary Coutant <ccoutant@google.com>
11827
11828 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
11829 instead of -1U.
11830
c82fbeee
CS
118312008-11-05 Craig Silverstein <csilvers@google.com>
11832
11833 * options.cc (General_options::parse_dynamic_list): New function.
11834 * options.h (General_options): New flags dynamic_list,
11835 dynamic_list_data, dynamic_list_cpp_new, and
11836 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
11837 (General_options::in_dynamic_list): New function.
11838 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
11839 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
11840 (Lex::can_continue_name): Likewise.
11841 (yylex): Likewise.
11842 (read_script_file): New parameter script_options.
11843 (read_dynamic_list): New function.
11844 (Script_options::define_dynamic_list): New function.
11845 (dynamic_list_keyword_parsecodes): New variable.
11846 (dynamic_list_keywords): New variable.
11847 * script.h (Script_options::define_dynamic_list): New function
11848 prototype.
11849 (read_dynamic_list): New function prototype.
11850 * symtab.cc (strprefix): New macro.
11851 (Symbol::should_add_dynsym_entry): Support dynamic_list,
11852 dynamic_list_data, dynamic_list_cpp_new, and
11853 dynamic_list_cpp_typeinfo.
11854 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
11855 (dynamic_list_expr): New rule.
11856 (dynamic_list_nodes): Likewise.
11857 (dynamic_list_node): Likewise.
11858 * testsuite/Makefile.am (dynamic_list): New test.
11859 * testsuite/Makefile.in: Regenerated.
11860 * testsuite/dynamic_list.t: New file.
11861 * testsuite/dynamic_list.sh: New file.
11862
e0bb29a5
CS
118632008-11-05 Craig Silverstein <csilvers@google.com>
11864
11865 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
11866 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
11867 (t11_last): Likewise.
11868 * testsuite/ver_test_6.c (main): Likewise.
11869
4e1e25e0
CC
118702008-10-07 Cary Coutant <ccoutant@google.com>
11871
11872 * options.c (General_options::finalize): Add check for -static and
11873 -shared.
11874 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
11875 is not empty.
11876
92f03fcb
CC
118772008-10-02 Cary Coutant <ccoutant@google.com>
11878
11879 * plugin.cc (make_sized_plugin_object): Fix conditional
11880 compilation to work when not all targets are enabled.
11881
fbd8a257
CC
118822008-09-29 Cary Coutant <ccoutant@google.com>
11883
11884 * archive.cc (Archive::get_file_and_offset): Use filename instead
11885 of name to get library path.
11886 (Archive::include_member): Unlock external member of a thin archive.
11887
11888 * testsuite/Makefile.am (TEST_AR): New variable.
11889 (thin_archive_test_1): New test.
11890 (thin_archive_test_2): New test.
81636b3f
CC
11891 * testsuite/Makefile.in: Regenerate.
11892 * testsuite/thin_archive_main.cc: New file.
11893 * testsuite/thin_archive_test_1.cc: New file.
11894 * testsuite/thin_archive_test_2.cc: New file.
11895 * testsuite/thin_archive_test_3.cc: New file.
11896 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 11897
eff45813
CC
118982008-09-29 Cary Coutant <ccoutant@google.com>
11899
11900 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
11901 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
11902 instead of -1U.
11903 (Sized_relobj::do_finalize_local_symbols): Likewise.
11904 (Sized_relobj::map_to_kept_section): Likewise.
11905 * object.h (Sized_relobj::invalid_address): New constant.
11906 (Sized_relobj::do_output_section_offset): Check for invalid_address
11907 and return -1ULL.
11908 * output.cc (Output_reloc::local_section_offset): Use constant
11909 invalid_address instead of -1U.
11910 (Output_reloc::get_address): Likewise.
11911 (Output_section::output_address): Change -1U to -1ULL.
11912 * output.h (Output_reloc::invalid_address): New constant.
11913 * reloc.cc (Sized_relobj::write_sections): Use constant
11914 invalid_address instead of -1U.
11915 (Sized_relobj::relocate_sections): Likewise.
11916 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
11917 values for merge sections.
11918 * target-reloc.h (relocate_for_relocatable): Use constant
11919 invalid_address instead of -1U.
11920
89fc3421
CC
119212008-09-19 Cary Coutant <ccoutant@google.com>
11922
11923 Add plugin functionality for link-time optimization (LTO).
11924 * configure.ac (plugins): Add --enable-plugins option.
11925 * configure: Regenerate.
11926 * config.in: Regenerate.
11927 * Makefile.am (LIBDL): New variable.
11928 (CCFILES): Add plugin.cc.
11929 (HFILES): Add plugin.h.
11930 (ldadd_var): Add LIBDL.
11931 * Makefile.in: Regenerate.
11932
11933 * archive.cc: Include "plugin.h".
11934 (Archive::setup): Don't preread archive symbols when using a plugin.
11935 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
11936 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
11937 files.
11938 (Archive::include_member): Add symbols from plugin objects.
11939 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
11940 * descriptors.cc (Descriptors::open): Check for file descriptors
11941 abandoned by plugins.
11942 (Descriptors::claim_for_plugin): New function.
11943 * descriptors.h (Descriptors::claim_for_plugin): New function.
11944 (Open_descriptor::is_claimed): New field.
11945 (claim_descriptor_for_plugin): New function.
11946 * fileread.cc (File_read::claim_for_plugin): New function.
11947 * fileread.h (File_read::claim_for_plugin): New function.
11948 (File_read::descriptor): New function.
11949 * gold.cc: Include "plugin.h".
11950 (queue_initial_tasks): Add task to call plugin hooks for generating
11951 new object files.
11952 * main.cc: Include "plugin.h".
11953 (main): Load plugin libraries.
11954 * object.h (Pluginobj): Declare.
11955 (Object::pluginobj): New function.
11956 (Object::do_pluginobj): New function.
11957 (Object::set_target): New function.
11958 * options.cc: Include "plugin.h".
11959 (General_options::parse_plugin): New function.
11960 (General_options::General_options): Initialize plugins_ field.
11961 (General_options::add_plugin): New function.
11962 * options.h (Plugin_manager): Declare.
11963 (General_options): Add --plugin option.
11964 (General_options::has_plugins): New function.
11965 (General_options::plugins): New function.
11966 (General_options::add_plugin): New function.
11967 (General_options::plugins_): New field.
11968 * plugin.cc: New file.
11969 * plugin.h: New file.
11970 * readsyms.cc: Include "plugin.h".
11971 (Read_symbols::do_read_symbols): Check for archive before checking
11972 for ELF file. Call plugin hooks to claim files.
11973 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
11974 from a real object file; force override when processing replacement
11975 files.
11976 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
11977 (Symbol::init_base_object): Likewise.
11978 (Symbol::init_base_output_data): Likewise.
11979 (Symbol::init_base_output_segment): Likewise.
11980 (Symbol::init_base_constant): Likewise.
11981 (Symbol::init_base_undefined): Likewise.
11982 (Symbol::output_section): Assert that object is not a plugin.
11983 (Symbol_table::add_from_pluginobj): New function.
11984 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
11985 undefined.
11986 (Symbol_table::sized_write_globals): Likewise.
11987 (Symbol_table::add_from_pluginobj): Instantiate template.
11988 * symtab.h (Sized_pluginobj): Declare.
11989 (Symbol::in_real_elf): New function.
11990 (Symbol::set_in_real_elf): New function.
11991 (Symbol::in_real_elf_): New field.
11992 (Symbol_table::add_from_pluginobj): New function.
11993
11994 * testsuite/Makefile.am (AM_CFLAGS): New variable.
11995 (LIBDL): New variable.
11996 (LDADD): Add LIBDL.
11997 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
11998 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
11999 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
12000 (MOSTLYCLEANFILES): Likewise.
12001 * testsuite/Makefile.in: Regenerate.
12002 * testsuite/plugin_test.c: New file.
12003 * testsuite/plugin_test_1.sh: New file.
12004 * testsuite/plugin_test_2.sh: New file.
12005
de31bda5
ILT
120062008-09-16 Ian Lance Taylor <iant@google.com>
12007
9c2d0ef9
ILT
12008 * target-reloc.h (relocate_section): Check whether a symbol is
12009 defined by the ABI before reporting an undefined symbol error.
12010 * target.h (Target::is_defined_by_abi): Make parameter const.
12011 (Target::do_is_defined_by_abi): Likewise.
12012 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
12013 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
12014 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
12015 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
12016 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
12017 * testsuite/Makefile.in: Rebuild.
12018
de31bda5
ILT
12019 * fileread.cc (make_view): Add casts to avoid warning.
12020
9fa33bee
AO
120212008-09-16 Alexandre Oliva <aoliva@redhat.com>
12022
12023 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
12024 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
12025
183fd0e3
AO
120262008-09-16 Alexandre Oliva <aoliva@redhat.com>
12027
12028 * options.h (General_options::output_is_executable): New.
12029 (General_options::output_is_pie): New.
12030 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
12031 for shared libraries.
12032 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
12033
7be8330a
CD
120342008-09-11 Chris Demetriou <cgd@google.com>
12035
12036 * options.h (origin): New -z option.
12037 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
12038 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
12039 in DT_FLAGS_1.
12040
a9caad02
CC
120412008-09-05 Cary Coutant <ccoutant@google.com>
12042
12043 * fileread.cc (File_read::make_view): Add check for attempt to map
12044 beyond end of file.
12045
ae6dce4d
CC
120462008-09-05 Cary Coutant <ccoutant@google.com>
12047
12048 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
12049 explicit instantiations.
12050
d7ab2a47
KVH
120512008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
12052
12053 PR gold/6858
12054 * options.cc (General_options::finalize): Allow undefined symbols
12055 in shlibs if linking -shared.
12056
12057 PR gold/6859
12058 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
12059 symbols as not needing a dynsym entry.
12060
1e52a9c1
CS
120612008-08-20 Craig Silverstein <csilvers@google.com>
12062
12063 * fileread.cc (File_read::open): Do not lock the file unless it
12064 was successfully opened.
12065
d85c80a3
CC
120662008-08-14 Cary Coutant <ccoutant@google.com>
12067
12068 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
12069 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
12070 * testsuite/tls_test.cc (struct int128): 128-bit struct
12071 for testing TLS relocs with non-zero addend.
12072 (v12): New TLS variable.
12073 (t12): New test.
12074 (t_last): Add check for v12.
12075 * testsuite/tls_test.h (t12): New function.
12076 * testsuite/tls_test_main.cc (thread_routine): Call new test.
12077
2d924fd9
ILT
120782008-08-13 Ian Lance Taylor <iant@google.com>
12079
12080 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
12081 set tls_segment_ or relro_segment_.
12082 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
12083 when appropriate.
12084 * output.h (Output_section::clear_is_relro): New function.
12085 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
12086 sections specially even when output_data_ is empty.
12087 (Output_segment::maximum_alignment): When first section is relro,
12088 only force alignment for PT_LOAD segments.
12089 * script.cc (script_data_segment_align): New function.
12090 (script_data_segment_relro_end): New function.
12091 * script-c.h (script_data_segment_align): Declare.
12092 (script_data_segment_relro_end): Declare.
12093 * script-sections.h (class Script_sections): Declare
12094 data_segment_align and data_segment_relro_end. Add fields
12095 segment_align_index_ and saw_relro_end_.
12096 * script-sections.cc (class Sections_element): Add set_is_relro
12097 virtual function. Add new bool* parameter to place_orphan_here.
12098 Add get_output_section virtual function.
12099 (class Output_section_definition): Add set_is_relro. Add new
12100 bool* parameter to place_orphan_here. Add get_output_section.
12101 Add is_relro_ field.
12102 (Output_section_definition::Output_section_definition): Initialize
12103 evaluated_address_, evaluated_load_address, evaluated_addralign_,
12104 and is_relro_ fields.
12105 (Output_section_definition::place_orphan_here): Add is_relro
12106 parameter.
12107 (Output_section_definition::set_section_addresses): Set relro for
12108 output section.
12109 (Output_section_definition::alternate_constraint): Likewise.
12110 (class Orphan_output_section): Add new bool* parameter to
12111 place_orphan_here. Add get_output_section.
12112 (Orphan_output_section::place_orphan_here): Add is_relro
12113 parameter.
12114 (Script_sections::Script_sections): Initialize
12115 data_segment_align_index_ and saw_relro_end_.
12116 (Script_sections::data_segment_align): New function.
12117 (Script_sections::data_segment_relro_end): New function.
12118 (Script_sections::place_orphan): Set or clear is_relro.
12119 (Script_sections::set_section_addresses): Force alignment of first
12120 TLS section.
12121 * yyscript.y (exp): Call script_data_segment_align and
12122 script_data_segment_relro_end.
12123 * testsuite/relro_script_test.t: New file.
12124 * testsuite/relro_test.cc (using_script): Declare.
12125 (t1, t2): Test using_script.
12126 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
12127 (relro_script_test_SOURCES): Define.
12128 (relro_script_test_DEPENDENCIES): Define.
12129 (relro_script_test_LDFLAGS): Define.
12130 (relro_script_test_LDADD): Define.
12131 (relro_script_test.so): New target.
12132 * testsuite/Makefile.in: Rebuild.
12133
f827c9a9
CC
121342008-08-06 Cary Coutant <ccoutant@google.com>
12135
12136 * archive.cc (Archive::total_archives, Archive::total_members)
12137 (Archive::total_members_loaded): New variables.
12138 (Archive::setup): Add parameter. Add option to preread
12139 archive symbols.
12140 (Archive::read_armap): Add counter.
12141 (Archive::get_file_and_offset): New function.
12142 (Archive::get_elf_object_for_member): New function.
12143 (Archive::read_all_symbols): New function.
12144 (Archive::read_symbols): New function.
12145 (Archive::add_symbols): Add counters.
12146 (Archive::include_all_members): Use armap to find members if it's
12147 already built.
12148 (Archive::include_member): Skip reading symbols if already read.
12149 Factored code into Archive::get_file_and_offset and
12150 Archive::get_elf_object_for_member. Changed call to
12151 Mapfile::report_include_archive_member.
12152 (Archive::print_stats): New function.
12153 * archive.h: Declare Object and Read_symbols_data classes.
12154 (Archive::Archive): Add initializers for new members.
12155 (Archive::setup): Add parameter.
12156 (Archive::print_stats): New function.
12157 (Archive::total_archives, Archive::total_members)
12158 (Archive::total_members_loaded): New variables.
12159 (Archive::get_file_and_offset): New function.
12160 (Archive::get_elf_object_for_member): New function.
12161 (Archive::read_all_symbols): New function.
12162 (Archive::read_symbols): New function.
12163 (Archive::Archive_member): New class.
12164 (Archive::members_): New member.
12165 (Archive::num_members_): New member.
12166 * main.cc: Include archive.h.
12167 (main): Call Archive::print_stats.
12168 * mapfile.cc (Mapfile::report_include_archive_member): Delete
12169 archive parameter; member_name is now the fully-decorated name.
12170 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
12171 * options.h: (General_options): Add --preread-archive-symbols option.
12172 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
12173 Archive::setup.
12174
de4c45bd
ILT
121752008-08-04 Ian Lance Taylor <iant@google.com>
12176
12177 * symtab.h (Symbol::use_plt_offset): New function.
12178 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
12179 * powerpc.cc (Relocate::relocate): Likewise.
12180 * sparc.cc (Relocate::relocate): Likewise.
12181 * x86_64.cc (Relocate::relocate): Likewise.
12182 * testsuite/weak_plt.sh: New test.
12183 * testsuite/weak_plt_main.cc: New test.
12184 * testsuite/weak_plt_shared.cc: New test.
12185 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
12186 (check_PROGRAMS): Add weak_plt.
12187 (check_DATA): Add weak_plt_shared.so.
12188 (weak_plt_main_pic.o, weak_plt): New targets.
12189 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
12190 * testsuite/Makefile.in: Rebuild.
12191
12192 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
12193 gcctestdir/ld.
12194 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
12195 * testsuite/Makefile.in: Rebuild.
12196
323ee3f4
AM
121972008-08-04 Alan Modra <amodra@bigpond.net.au>
12198
12199 * Makefile.am (POTFILES.in): Set LC_ALL=C.
12200 * Makefile.in: Regenerate.
12201 * po/POTFILES.in: Regenerate.
12202
7c07ecec
ILT
122032008-07-29 Ian Lance Taylor <iant@google.com>
12204
12205 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
12206 symbols before other symbols.
12207 * testsuite/script_test_2.cc (test_addr): Declare.
12208 (test_addr_alias): Declare.
12209 (main): Check that test_addr and test_addr_alias have the right
cd536b21 12210 values.
7c07ecec
ILT
12211 * testsuite/script_test_2.t: Define test_addr_alias and
12212 test_addr.
12213
5778530e
ILT
122142008-07-24 Ian Lance Taylor <iant@google.com>
12215
2a00e4fb
ILT
12216 PR 5990
12217 * descriptors.cc: New file.
12218 * descriptors.h: New file.
12219 * gold-threads.h (class Hold_optional_lock): New class.
12220 * fileread.cc: Include "descriptors.h".
12221 (File_read::~File_read): Release descriptor rather than closing
12222 it.
12223 (File_read::open) [file]: Call open_descriptor rather than open.
12224 Set is_descriptor_opened_.
12225 (File_read::open) [memory]: Assert that descriptor is not open.
12226 (File_read::reopen_descriptor): New function.
12227 (File_read::release): Release descriptor.
12228 (File_read::do_read): Make non-const. Reopen descriptor.
12229 (File_read::read): Make non-const.
12230 (File_read::make_view): Reopen descriptor.
12231 (File_read::do_readv): Likewise.
12232 * fileread.h (class File_read): Add is_descriptor_opened_ field.
12233 Update declarations.
12234 * layout.cc: Include "descriptors.h".
12235 (Layout::create_build_id): Use open_descriptor rather than open.
12236 * output.cc: Include "descriptors.h".
12237 (Output_file::open): Use open_descriptor rather than open.
12238 * archive.cc (Archive::const_iterator): Change Archive to be
12239 non-const.
12240 (Archive::begin, Archive::end): Make non-const.
12241 (Archive::count_members): Likewise.
12242 * archive.h (class Archive): Update declarations.
12243 * object.h (Object::read): Make non-const.
12244 * Makefile.am (CCFILES): Add descriptors.cc.
12245 (HFILES): Add descriptors.h.
12246 * Makefile.in: Rebuild.
12247
801647d1
ILT
12248 PR 6716
12249 * gold.h: Always include <clocale>. Add Solaris workarounds
12250 following code in binutils/sysdep.h.
12251
5edd166e
ILT
12252 PR 6048
12253 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
12254 this->eh_frame_hdr_ is NULL before using it.
12255
c89ad728
ILT
12256 * dynobj.cc (Versions::Versions): Update comment.
12257
aa86f06b
ILT
12258 * dynobj.cc (Versions::Versions): If there is an soname, use it as
12259 the base version name.
12260
5778530e
ILT
12261 * stringpool.cc (Stringpool_template::add_with_length): Set key to
12262 array size plus one.
12263 (Stringpool_template::set_string_offsets): Subtract one from key
12264 before using it as an array index.
12265 (Stringpool_template::get_offset_with_length): Likewise.
12266 (Stringpool_template::write_to_buffer): Likewise.
12267 * stringpool.h (Stringpool_template::get_offset_from_key):
12268 Likewise.
12269
057ead22
ILT
122702008-07-23 Ian Lance Taylor <iant@google.com>
12271
7f649c59
ILT
12272 PR 6658
12273 * object.h (Merged_symbol_value::value): Do our best to handle a
12274 negative addend.
12275
057ead22
ILT
12276 PR 6647
12277 * script.cc (Version_script_info::get_versions): Don't add empty
12278 version tag to return value.
12279 (Version_script_info::get_symbol_version_helper): Change return
12280 type to bool. Add pversion parameter. Change all callers.
12281 (script_register_vers_node): Don't require a non-NULL tag.
12282 * script.h (class Version_script_info): Update declarations.
12283 (Version_script_info::get_symbol_version): Change return type to
12284 bool. Add version parameter. Change all callers.
12285 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
12286 handling. Handle an empty version from a version script.
12287 (Symbol_table::define_special_symbol): Likewise.
12288 * testsuite/ver_test_10.script: New file.
12289 * testsuite/ver_test_10.sh: New file.
12290 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
12291 (check_DATA): Add ver_test_10.syms.
12292 (ver_test_10.syms, ver_test_10.so): New target.
12293 * testsuite/Makefile.in: Rebuild.
12294
58e54ac2
CD
122952008-07-23 Simon Baldwin <simonb@google.com>
12296
12297 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
12298 to zero for undefined symbols from dynamic libraries.
12299
95d14cd3
ILT
123002008-07-23 Ian Lance Taylor <iant@google.com>
12301
12302 * symtab.cc (Symbol_table::resolve): Remove version parameter.
12303 Change all callers.
12304 * symtab.h (class Symbol_table): Update declaration.
12305 * testsuite/ver_test_9.cc: New file.
12306 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
12307 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
12308 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
12309 (ver_test_9.so, ver_test_9.o): New targets.
12310 * testsuite/Makefile.in: Rebuild.
12311
92de84a6
ILT
123122008-07-22 Ian Lance Taylor <iant@google.com>
12313
34810851
ILT
12314 * options.h (class General_options): Define --check-sections.
12315 * layout.cc (Layout::set_segment_offsets): Handle
12316 --check-sections.
12317
af6156ef
ILT
12318 * options.h (class General_options): Define -n/--nmagic and
12319 -N/--omagic.
12320 * options.cc (General_options::finalize): For -n/--nmagic or
12321 -N/--omagic, set -static.
12322 * layout.cc (Layout::attach_allocated_section_to_segment): If
12323 -N/--omagic, don't put read-only and read-write sections in
12324 different segments.
12325 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
12326 finding a read-only segment.
12327 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
12328 don't set the minimum segment alignment to the common page size,
12329 and don't set the file offset to the address modulo the page size.
12330 * script-sections.cc (Script_sections::create_segments): If
12331 -n/--omagic, don't put read-only and read-write sections in
12332 different segments.
12333
92de84a6
ILT
12334 * cref.cc: New file.
12335 * cref.h: New file.
12336 * options.h (class General_options): Add --print-symbol-counts.
12337 * main.cc (main): Issue defined symbol report if requested.
12338 * archive.cc (Archive::interpret_header): Make into a const member
12339 function.
12340 (Archive::add_symbols): Call Input_objects::archive_start and
12341 archive_stop.
12342 (Archive::const_iterator): Define new class.
12343 (Archive::begin, Archive::end): New functions.
12344 (Archive::include_all_members): Rewrite to use iterator.
12345 (Archive::count_members): New function.
12346 * archive.h (class Archive): Update declarations.
12347 (Archive::filename): New function.
12348 * object.cc: Include "cref.h".
12349 (Sized_relobj::Sized_relobj): Initialize defined_count_.
12350 (Sized_relobj::do_get_global_symbol_counts): New function.
12351 (Input_objects::add_object): Add object to cross-referencer.
12352 (Input_objects::archive_start): New function.
12353 (Input_objects::archive_stop): New function.
12354 (Input_objects::print_symbol_counts): New function.
12355 * object.h: Declare Cref and Archive.
12356 (Object::get_global_symbol_counts): New function.
12357 (Object::do_get_global_symbol_counts): New pure virtual function.
12358 (class Sized_relobj): Add defined_count_ field. Update
12359 declarations.
12360 (class Input_objects): Add cref_ field. Update constructor.
12361 Update declarations.
12362 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
12363 defined_count_.
12364 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
12365 symbol counts.
12366 (Sized_dynobj::do_get_global_symbol_counts): New function.
12367 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
12368 defined_count_. Update declarations. Define Symbols typedef.
12369 * symtab.cc (Symbol_table::add_from_relobj): Add defined
12370 parameter. Change all callers.
12371 (Symbol_table::add_from_dynobj): Add sympointers and defined
12372 parameters. Change all callers.
12373 * symtab.h (class Symbol_table): Update declarations.
12374 * Makefile.am (CCFILES): Add cref.cc.
12375 (HFILES): Add cref.h.
12376 * Makefile.in: Rebuild.
12377
3f7c5e1d
CD
123782008-07-22 Simon Baldwin <simonb@google.com>
12379
12380 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
12381 to zero when writing undefined symbols.
12382
e0b64032
ILT
123832008-07-22 Ian Lance Taylor <iant@google.com>
12384
12385 * output.cc (Output_section::add_input_section): Don't try to
12386 merge empty merge sections.
12387
096b02cf
CS
123882008-07-21 Craig Silverstein <csilvers@google.com>
12389
12390 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
12391 Include symbol version in error message.
cd536b21 12392
1d1f116d
CD
123932008-07-20 Chris Demetriou <cgd@google.com>
12394
cd536b21 12395 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
12396 (RANDOM_SEED_CFLAGS): New substituted variable.
12397 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
12398 * configure: Rebuild.
12399 * Makefile.in: Likewise.
12400 * testsuite/Makefile.in: Likewise.
12401
a18f591e
ILT
124022008-07-18 Ian Lance Taylor <iant@google.com>
12403
12404 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
12405 where we see NAME/NULL and NAME/VERSION as separate symbols.
12406 * testsuite/ver_test_main.cc (main): Call t4.
12407 (t4, t4_2a): Define.
12408 * testsuite/ver_test_2.cc (t4_2): Define.
12409 * testsuite/ver_test_2.script: Put t4_2a in VER2.
12410 * testsuite/ver_test_4.cc (t4_2a): Define.
12411 * testsuite/ver_test_4.script: Put t4_2a in VER2.
12412 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
12413
c6e3f6ed
ILT
124142008-07-17 Ian Lance Taylor <iant@google.com>
12415
12416 * dynobj.cc (Versions::add_def): If we give an error about a
12417 missing version, go ahead and create the version anyhow.
12418
ef9beddf
ILT
124192008-07-10 Ian Lance Taylor <iant@google.com>
12420
12421 Handle output sections with more than 0x7fffffff bytes.
12422 * object.h (class Relobj): Change map_to_output_ to
12423 output_sections_, and just keep a section pointer. Change all
12424 uses. Move comdat group support to Sized_relobj.
12425 (Relobj::is_section_specially_mapped): Remove.
12426 (Relobj::output_section): Remove poff parameter. Change all
12427 callers.
12428 (Relobj::output_section_offset): New function.
12429 (Relobj::set_section_offset): Rewrite.
12430 (Relobj::map_to_output): Remove.
12431 (Relobj::output_sections): New function.
12432 (Relobj::do_output_section_offset): New pure virtual function.
12433 (Relobj::do_set_section_offset): Likewise.
12434 (class Sized_relobj): Add section_offsets_ field. Add comdat
12435 group support from Relobj. Update declarations.
12436 (Sized_relobj::get_output_section_offset): New function.
12437 (Sized_relobj::do_output_section_offset): New function.
12438 (Sized_relobj::do_set_section_offset): New function.
12439 * object.cc (Relobj::output_section_address): Remove.
12440 (Sized_relobj::Sized_relobj): Initialize new fields.
12441 (Sized_relobj::include_section_group): Cast find_kept_object to
12442 Sized_relobj.
12443 (Sized_relobj::include_linkonce_section): Likewise.
12444 (Sized_relobj::do_layout): Use separate arrays for output section
12445 and output offset.
12446 (Sized_relobj::do_count_local_symbols): Change map_to_output to
12447 output_sections.
12448 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
12449 output_sections and section_offsets.
12450 (Sized_relobj::write_local_symbols): Likewise.
12451 (map_to_kept_section): Compute output address directly.
12452 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
12453 output_sections and section_offsets.
12454 (Sized_relobj::write_sections): Likewise.
12455 (Sized_relobj::relocate_sections): Likewise.
12456 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
12457 * output.h (class Output_reloc): Update declarations. Change
12458 u2_.relobj to Sized_relobj*.
12459 (class Output_data_reloc): Change add functions to use
12460 Sized_relobj*.
12461 * output.cc (Output_reloc::Output_reloc): Change relobj to
12462 Sized_relobj*.
12463 (Output_reloc::local_section_offset): Change return type to
12464 Elf_Addr. Use get_output_section_offset.
12465 (Output_reloc::get_address): Likewise.
12466 (Output_section::is_input_address_mapped): Don't call
12467 is_section_specially_mapped.
12468 (Output_section::output_offset): Likewise.
12469 (Output_section::output_address): Likewise.
12470 (Output_section::starting_output_address): Likewise.
12471 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
12472 parameter to Sized_relobj*.
12473 (Copy_relocs::need_copy_reloc): Likewise.
12474 (Copy_relocs::save): Likewise.
12475 * copy-relocs.h (class Copy_relocs): Update declarations.
12476 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
12477 Sized_relobj*. Change relobj_ field to Sized_relobj*.
12478 * target-reloc.h (relocate_for_relocatable): Change
12479 offset_in_output_section type to Elf_Addr. Change code that uses
12480 it as well.
12481 * layout.cc (Layout::layout): Always set *off.
12482 * mapfile.cc (Mapfile::print_input_section): Use
12483 output_section_offset.
12484 * i386.cc (Target_i386::copy_reloc): Change object parameter to
12485 Sized_relobj*.
12486 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
12487 * sparc.cc (Target_sparc::copy_reloc): Likewise.
12488 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
12489
5cb66f97
ILT
124902008-07-03 Ian Lance Taylor <iant@google.com>
12491
12492 * layout.cc (Layout::include_section): Do not discard unrecognized
12493 SHT_STRTAB sections.
12494
afe47622
CS
124952008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
12496
12497 * script.cc (Lex::can_continue_name): Make '?' allowable in
12498 version-script names.
12499 * testsuite/version_script.map: Change glob pattern to use '?'
12500
5adf9721
ILT
125012008-06-30 Manish Singh <yosh@gimp.org>
12502
12503 PR 6585
12504 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
12505 Correct typo.
12506
e6fde208
ILT
125072008-06-30 Ian Lance Taylor <iant@google.com>
12508
12509 PR 6660
12510 PR 6682
12511 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
12512 versions]: Don't try to read the value in the contents, since we
12513 don't use it. Use the template endianness when writing.
12514
3f2e6a2d
CC
125152008-06-25 Cary Coutant <ccoutant@google.com>
12516
12517 * fileread.cc (File_read::make_view): Assert on zero-length view.
12518 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
12519 symbol table when there are no symbols to read.
12520
c43d3a48
CS
125212008-06-23 Craig Silverstein <csilvers@google.com>
12522
12523 * version.cc (version_string): Bump to 1.7
12524
5f494ea0
CS
125252008-06-18 Craig Silverstein <csilvers@google.com>
12526
12527 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
12528 constant 0xFFFF to type Valtype.
12529 (Powerpc_relocate_functions::rel16_ha): Likewise.
12530
c42e122e
ILT
125312008-06-17 Ian Lance Taylor <iant@google.com>
12532
f34787f8
ILT
12533 * output.h (Output_section::Input_section): Initialize p2align_ to
12534 zero for Output_section_data constructors.
12535 (Output_section::Input_section::addralign): If not an input
12536 section, return the alignment of the Output_section_data.
12537 * testsuite/copy_test.cc: New file.
12538 * testsuite/copy_test_1.cc: New file.
12539 * testsuite/copy_test_2.cc: New file.
12540 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
12541 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
12542 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
12543 (copy_test_1_pic.o, copy_test_1.so): New targets.
12544 (copy_test_2_pic.o, copy_test_2.so): New targets.
12545 * testsuite/Makefile.in: Rebuild.
12546
c42e122e
ILT
12547 * script-sections.cc (Script_sections::place_orphan): Initialize
12548 local variable exact.
12549
ce3ac18a
DE
125502008-06-13 David Edelsohn <edelsohn@gnu.org>
12551
12552 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
12553
42cacb20
DE
125542008-06-12 David Edelsohn <edelsohn@gnu.org>
12555 David S. Miller <davem@davemloft.net>
12556
12557 * powerpc.cc: New file.
12558 * Makefile.am (TARGETSOURCES): Add powerpc.cc
12559 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
12560 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
12561 * Makefile.in: Rebuild.
12562
7b308235
ILT
125632008-06-09 Ian Lance Taylor <iant@google.com>
12564
12565 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
12566 <exception>.
12567 (throwing, orig_terminate): New static variables.
12568 (terminate_handler): New static function.
12569 (t2): Set terminate handler.
12570
f0b886e3
ILT
125712008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
12572
12573 PR 6584
cd536b21 12574 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
12575 alignment.
12576
3e90f135
CC
125772008-05-30 Cary Coutant <ccoutant@google.com>
12578
12579 * archive.cc (Archive::include_all_members) Correct to step
12580 over symbol table and extended name table in thin archives.
12581
e09ad04a
ILT
125822008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
12583
12584 PR 6407
12585 * target-reloc.h (relocate_for_relocatable): Fix new_offset
12586 calculation.
12587
62b01cb5
ILT
125882008-05-28 Caleb Howe <cshowe@google.com>
12589
12590 * reduced_debug_output.cc: New file.
12591 * reduced_debug_output.h: New file.
92de84a6 12592 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
12593 * options.cc (General_options::finalize): Add strip_debug_non_line
12594 to the strip heirarchy.
12595 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
12596 fields.
12597 * layout.cc: Include "reduced_debug_output.h".
12598 (Layout::Layout): Initialize new fields.
12599 (line_only_debug_sections): New static array.
12600 (is_lines_only_debug_sections): New static inline function.
12601 (Layout::include_section): Handle --strip-debug-non-line.
12602 (Layout::make_output_section): If --strip-debug-non-line, build
12603 new output sections for .debug_abbrev and .debug_info.
12604 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
12605 gold. Warn about possible overflow.
12606 (read_signed_LEB_128): Likewise.
12607 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
12608 (read_signed_LEB_128): Declare.
12609 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
12610 (HFILES): Add reduced_debug_output.h.
12611 * Makefile.in: Rebuild.
12612
7d9e3d98
ILT
126132008-05-21 Ian Lance Taylor <iant@google.com>
12614
12615 * mapfile.cc: New file.
12616 * mapfile.h: New file.
12617 * options.h (class General_options): Add -M/--print-map and -Map.
12618 * options.cc (General_options::finalize): Make -M equivalent to
12619 -Map -.
12620 * main.cc: Include <cstdio> and "mapfile.h".
12621 (main): Open mapfile if requested.
12622 * gold.cc (class Middle_runner): Add mapfile_ field. Update
12623 constructor. Change caller.
12624 (queue_initial_tasks): Add mapfile parameter. Change caller.
12625 (queue_middle_tasks): Likewise.
12626 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
12627 declarations.
12628 * archive.cc: Include "mapfile.h".
12629 (Archive::add_symbols): Add mapfile parameter. Change all
12630 callers. Pass mapfile, symbol, and reason to include_member.
12631 (Archive::include_all_members): Add mapfile parameter. Change all
12632 callers.
12633 (Archive::include_member): Add mapfile, sym, and why parameters.
12634 Change all callers. Report inclusion to map file.
12635 * archive.h: Include "fileread.h".
12636 (class Archive): Update declarations.
12637 (Archive::file): New const method.
12638 (class Add_archive_symbols): Add mapfile_ field. Update
12639 constructor. Change all callers.
12640 * readsyms.h (class Read_symbols): Likewise.
12641 (class Finish_group): Likewise.
12642 (class Read_script): Likewise.
12643 * common.cc: Include "mapfile.h".
12644 (Symbol_table::allocate_commons): Add mapfile parameter. Change
12645 all callers.
12646 (Symbol_table::do_allocate_commons): Likewise.
12647 (Symbol_table::do_allocate_commons_list): Likewise. Report common
12648 symbol allocation to mapfile.
12649 * common.h (class Allocate_commons_task): Add mapfile_ field.
12650 Update constructor. Change all callers.
12651 * symtab.h (class Symbol_table): Update declarations.
12652 * layout.cc: Include "mapfile.h".
12653 (Layout_task_runner::run): Print information to mapfile.
12654 (Layout::create_gold_note): Change Output_data_fixed_space to
12655 Output_data_zero_fill.
12656 (Layout::create_build_id): Likewise.
12657 (Layout::print_to_mapfile): New function.
12658 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
12659 constructor. Change caller.
12660 (class Layout): Declare print_to_mapfile.
12661 * output.cc (Output_section::Input_section::print_to_mapfile): New
12662 function.
12663 (Output_section::add_input_section): If producing a map, always
12664 add to input_sections_ list.
12665 (Output_section::do_print_to_mapfile): New function.
12666 (Output_segment::print_sections_to_mapfile): New function.
12667 (Output_segment::print_section_list_to_mapfile): New function.
12668 * output.h: Include "mapfile.h".
12669 (Output_data::print_to_mapfile): New function.
12670 (Output_data::do_print_to_mapfile): New virtual function.
12671 (Output_segment_headers::do_print_to_mapfile): New function.
12672 (Output_file_header::do_print_to_mapfile): New function.
12673 (Output_data_const::do_print_to_mapfile): New function.
12674 (class Output_data_const_buffer): Add map_name_ field. Update
12675 constructor. Change all callers. Add do_print_to_mapfile
12676 function.
12677 (class Output_data_fixed_space): Likewise.
12678 (class Output_data_space): Likewise.
12679 (class Output_data_zero_fill): New class.
12680 (Output_data_strtab::do_print_to_mapfile): New function.
12681 (Output_data_reloc_base::do_print_to_mapfile): New function.
12682 (Output_relocatable_relocs::do_print_to_mapfile): New function.
12683 (Output_data_group::do_print_to_mapfile): New function.
12684 (Output_data_got::do_print_to_mapfile): New function.
12685 (Output_data_dynamic::do_print_to_mapfile): New function.
12686 (Output_symtab_xindex::do_print_to_mapfile): New function.
12687 (class Output_section): Declare do_print_to_mapflie. Declare
12688 print_to_mapfile in Input_section.
12689 (class Output_segment): Declare new functions.
12690 * object.h (Sized_relobj::symbol_count): New function.
12691 * script-sections.cc
12692 (Output_section_element_dot_assignment::set_section_addresses):
12693 Change Output_data_fixed_space to Output_data_zero_fill.
12694 (Output_data_expression::do_print_to_mapfile): New function.
12695 * script.cc (read_input_script): Add mapfile parameter. Change
12696 all callers.
12697 * script.h (read_input_script): Update declaration.
12698 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
12699 (Eh_frame::do_print_to_mapfile): New function.
12700 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
12701 (Output_merge_string::do_print_to_mapfile): New function.
12702 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
12703 function.
12704 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
12705 function.
12706 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
12707 function.
12708 * Makefile.am (CCFILES): Add mapfile.cc.
12709 (HFILES): Add mapfile.h.
12710 * Makefile.in: Rebuild.
12711
9f1d377b
ILT
127122008-05-19 Ian Lance Taylor <iant@google.com>
12713
12714 * options.h (class General_options): Add -z relro.
12715 * layout.cc (Layout::Layout): Initialize relro_segment_.
12716 (Layout::add_output_section_data): Return the output section.
12717 (Layout::make_output_section): Rcognize relro sections and mark
12718 them appropriately.
12719 (Layout::attach_allocated_section_to_segment): Put relro sections
12720 in a PT_GNU_RELRO segment.
12721 (Layout::create_initial_dynamic_sections): Mark the .dynamic
12722 section as relro.
12723 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
12724 PT_TLS segments.
12725 (Layout::linkonce_mapping): Map d.rel.ro.local to
12726 .data.rel.ro.local.
12727 (Layout::output_section_name): Us .data.rel.ro.local for any
12728 section which begins with that.
12729 * layout.h (class Layout): Update add_output_section_data
12730 declaration. Add relro_segment_ field.
12731 * output.cc (Output_section::Output_section): Initialize is_relro_
12732 and is_relro_local_ fields.
12733 (Output_segment::add_output_section): Group relro sections.
12734 (Output_segment::is_first_section_relro): New function.
12735 (Output_segment::maximum_alignment): If there is a relro section,
12736 align the segment to the common page size.
12737 (Output_segment::set_section_addresses): Track whether we are
12738 looking at relro sections. If the last section is a relro
12739 section, align to the common page size.
12740 (Output_segment::set_section_list_addresses): Add in_relro
12741 parameter. Change all callers. Align to the page size when
12742 moving from relro to non-relro section.
12743 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
12744 segment.
12745 * output.h (class Output_section): Add is_relro_ and
12746 is_relro_local_ fields.
12747 (Output_section::is_relro): New function.
12748 (Output_section::set_is_relro): New function.
12749 (Output_section::is_relro_local): New function.
12750 (Output_section::set_is_relro_local): New function.
12751 (class Output_segment): Update declarations.
12752 * i386.cc (Target_i386::got_section): Mark .got section as relro.
12753 * sparc.cc (Target_sparc::got_section): Likewise.
12754 * x86_64.cc (Target_x86_64::got_section): Likewise.
12755 * testsuite/relro_test_main.cc: New file.
12756 * testsuite/relro_test.cc: New file.
12757 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
12758 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
12759 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
12760 (relro_test.so, relro_test_pic.o): New targets.
12761 * testsuite/Makefile.in: Rebuild.
12762
a984ee1d
ILT
127632008-05-16 Ian Lance Taylor <iant@google.com>
12764
01676dcd
ILT
12765 * output.cc (Output_segment::add_output_section): Remove front
12766 parameter.
12767 * output.h (class Output_segment): Remove
12768 add_initial_output_section and overloaded add_output_section.
12769 Update declaration of remaining add_output_section.
12770 * layout.cc (Layout::create_interp): Call add_output_section
12771 rather than add_initial_output_section.
12772 (Layout::finish_dynamic_section): Likewise.
12773
497897f9
ILT
12774 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
12775 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
12776 know the dynamic type.
12777 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
12778 field. Initialize it in constructor.
12779 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
12780 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
12781 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
12782 reloc.
12783
a984ee1d
ILT
12784 * output.cc (Output_reloc::get_address): Change return type to
12785 Elf_Addr.
12786 * output.h (class Output_reloc): Update get_address declaration.
12787 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
12788 for section addresses.
12789
55ba0940
ILT
127902008-05-09 Ian Lance Taylor <iant@google.com>
12791
12792 PR 6493
12793 * gold.cc (gold_nomem): Use return value of write.
12794
75517b77
ILT
127952008-05-08 Ian Lance Taylor <iant@google.com>
12796
12797 * symtab.c (Symbol::init_base_output_data): Add version
12798 parameter. Change all callers.
12799 (Symbol::init_base_output_segment): Likewise.
12800 (Symbol::init_base_constant): Likewise.
12801 (Symbol::init_base_undefined): Likewise.
12802 (Sized_symbol::init_output_data): Likewise.
12803 (Sized_symbol::init_output_segment): Likewise.
12804 (Sized_symbol::init_constant): Likewise.
12805 (Sized_symbol::init_undefined): Likewise.
12806 (Symbol_table::do_define_in_output_data): If the new symbol has a
12807 version, mark it as the default.
12808 (Symbol_table::do_define_in_output_segment): Likewise.
12809 (Symbol_table::do_define_as_constant): Likewise.
12810 * symtab.h (class Symbol): Update declarations.
12811 (class Sized_symbol): Likewise.
12812 * resolve.cc (Symbol::override_version): New function.
c42e122e 12813 (Symbol::override_base): Call override_version.
75517b77
ILT
12814 (Symbol::override_base_with_special): Likewise.
12815 * testsuite/ver_script_8.script: New file.
12816 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
12817 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
12818 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
12819 (ver_test_8_1.so, ver_test_8_2.so): New targets.
12820
f1f70eae
ILT
128212008-05-06 Ian Lance Taylor <iant@google.com>
12822
f3e9c5c5
ILT
12823 PR 6049
12824 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
12825 functions.
12826 (class General_options): Remove existing --undefined, and add
12827 --no-undefined instead. Add new --undefined as synonym for -u.
12828 * archive.cc (Archive::add_symbols): Check whether symbol was
12829 named with -u.
12830 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
12831 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
12832 all uses. Add IS_UNDEFINED. Update declarations to split
12833 different versions of init_base. Declare init_base_undefined.
12834 (Symbol::is_defined): Handle IS_UNDEFINED.
12835 (Symbol::is_undefined): Likewise.
12836 (Symbol::is_weak_undefined): Call is_undefined.
12837 (Symbol::is_absolute): Handle IS_CONSTANT.
12838 (class Sized_symbol): Update declarations to split different
12839 versions of init. Declare init_undefined.
12840 (class Symbol_table): Declare new functions.
12841 * symtab.cc (Symbol::init_base_object): Rename from init_base.
12842 Change all callers.
12843 (Symbol::init_base_output_data): Likewise.
12844 (Symbol::init_base_output_segment): Likewise.
12845 (Symbol::init_base_constant): Likewise.
12846 (Symbol::init_base_undefined): New function.
12847 (Sized_symbol::init_object): Rename from init. Change all
12848 callers.
12849 (Sized_symbol::init_output_data): Likewise.
12850 (Sized_symbol::init_output_segment): Likewise.
12851 (Sized_symbol::init_constant): Likewise.
12852 (Sized_symbol::init_undefined): New function.
12853 (Symbol_table::add_undefined_symbols_from_command_line): New
12854 function.
12855 (Symbol_table::do_add_undefined_symbols_from_command_line): New
12856 function.
12857 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
12858 (Symbol::output_section): Likewise.
12859 (Symbol::set_output_section): Likewise.
12860 (Symbol_table::sized_finalize_symbol): Likewise.
12861 (Symbol_table::sized_write_globals): Likewise.
12862 * resolve.cc (Symbol_table::should_override): Likewise.
12863 (Symbol::override_base_with_special): Likewise.
12864
8bdcdf2c
ILT
12865 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
12866 symbol, change it to have default visibility.
12867 * testsuite/protected_1.cc: New file.
12868 * testsuite/protected_2.cc: New file.
12869 * testsuite/protected_3.cc: New file.
12870 * testsuite/protected_main_1.cc: New file.
12871 * testsuite/protected_main_2.cc: New file.
12872 * testsuite/protected_main_3.cc: New file.
12873 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
12874 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
12875 (protected_1_LDFLAGS, protected_1_LDADD): Define.
12876 (protected_1.so): New target.
12877 (protected_1_pic.o, protected_2_pic.o): New targets.
12878 (protected_3_pic.o): New target.
12879 (check_PROGRAMS): Add protected_2.
12880 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
12881 (protected_2_LDFLAGS, protected_2_LDADD): Define.
12882 * testsuite/Makefile.in: Rebuild.
12883
2b706932
ILT
12884 * options.h (DEFINE_var): Add set_user_set_##varname__.
12885 (DEFINE_bool_alias): New macro.
12886 (class General_options): Define -Bstatic using DEFINE_bool_alias
12887 rather than DEFINE_special. Add --undefined as an alias for -z
12888 defs.
12889 * options.cc (General_options::parse_Bstatic): Remove.
12890
d82a5bcc
ILT
12891 * options.h (class General_options): Add --fatal-warnings.
12892 * main.cc (main): Implement --fatal-warnings.
12893 * errors.h (Errors::warning_count): New function.
12894
f1f70eae
ILT
12895 * options.h (class General_options): Add -Bsymbolic-functions.
12896 * symtab.h (Symbol::is_preemptible): Check for
12897 -Bsymbolic-functions.
12898
8825ac63
ILT
128992008-05-05 Ian Lance Taylor <iant@google.com>
12900
d98bc257
ILT
12901 * options.h (DEFINE_bool): For DASH_Z, create the negative option
12902 as noVARNAME rather than no-VARNAME.
12903 (class General_options): Add option -z combreloc.
12904 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
12905 get_address.
12906 (Output_reloc::sort_before) [SHT_REL]: New function.
12907 (Output_reloc::sort_before) [SHT_RELA]: New function.
12908 (class Output_data_reloc_base): Add sort_relocs_ field. Define
12909 Sort_relocs_comparison.
12910 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
12911 parameter. Change all callers.
12912 (Output_data_reloc::Output_data_reloc) [both versions]: Add
12913 sort_relocs parameter. Change all callers.
12914 * output.cc (Output_reloc::get_address): New function, broken out
12915 of write_rel.
12916 (Output_reloc::write_rel): Call it.
12917 (Output_reloc::compare): New function.
12918 (Output_data_reloc_base::do_write): Optionally sort relocs.
12919
60b2b4e7
ILT
12920 * configure.ac: If targ_extra_obj is set, link it in.
12921 * configure.tgt: Initialize all variables.
12922 (x86_64*): Set targ_extra_obj and targ_extra_size.
12923 * configure: Rebuild.
12924
8825ac63
ILT
12925 * object.cc (Sized_relobj::include_section_group): Adjust section
12926 indexes read from group data. Build vector to pass to
12927 layout_group.
12928 * layout.cc (Layout::layout_group): Add flags and shndxes
12929 parameters. Remove contents parameter. Change caller. Update
12930 explicit instantiations.
12931 * layout.h (class Layout): Update layout_group declaration.
12932 * output.cc (Output_data_group::Output_data_group): Add flags and
12933 input_shndxes parameters. Remove contents parameter. Change
12934 caller.
12935 (Output_data_group::do_write): Change input_sections_ to
12936 input_shndxes_.
12937 * output.h (class Output_data_group): Update constructor
12938 declaration. Rename input_sections_ to input_shndxes_.
12939 * testsuite/many_sections_test.cc: Add template.
12940
e94cf127
CC
129412008-04-30 Cary Coutant <ccoutant@google.com>
12942
4418b2d5
CC
12943 * target-reloc.h (relocate_section): Fix dead-pointer bug.
12944
e94cf127
CC
12945 * layout.cc (Layout::include_section): Refactored check for debug
12946 info section.
12947 (Layout::add_comdat): Add new parameters. Change type
12948 of signature parameter. Add object and shndx to signatures table.
12949 (Layout::find_kept_object): New function.
12950 * layout.h: Include <cstring>.
12951 (Layout::is_debug_info_section): New function.
12952 (Layout::add_comdat): Add new parameters.
12953 (Layout::find_kept_object): New function.
12954 (Layout::Kept_section): New struct.
12955 (Layout::Signatures): Change type of map range.
12956 * object.cc (Relobj::output_section_address): New function.
12957 (Sized_relobj::include_section_group): Add new parameters. Change
12958 calls to Layout::add_comdat. Change to build table of kept comdat
12959 groups and table mapping discarded sections to kept sections.
12960 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
12961 (Sized_relobj::do_layout): Change calls to include_section_group and
12962 include_linkonce_section.
12963 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
12964 value to zero when section is discarded.
12965 (Sized_relobj::map_to_kept_section): New function.
12966 * object.h (Relobj::output_section_address): New function.
12967 (Relobj::Comdat_group): New type.
12968 (Relobj::find_comdat_group): New function.
12969 (Relobj::Comdat_group_table): New type.
12970 (Relobj::Kept_comdat_section): New type.
12971 (Relobj::Kept_comdat_section_table): New type.
12972 (Relobj::add_comdat_group): New function.
12973 (Relobj::set_kept_comdat_section): New function.
12974 (Relobj::get_kept_comdat_section): New function.
12975 (Relobj::comdat_groups_): New field.
12976 (Relobj::kept_comdat_sections_): New field.
12977 (Symbol_value::input_value): Update comment.
12978 (Sized_relobj::map_to_kept_section) New function.
12979 (Sized_relobj::include_linkonce_section): Add new parameter.
12980 * target-reloc.h (Comdat_behavior): New type.
12981 (get_comdat_behavior): New function.
12982 (relocate_section): Add code to map a discarded section to the
12983 corresponding kept section when applying a relocation.
12984
e4e5049b
CS
129852008-04-30 Craig Silverstein <csilvers@google.com>
12986
12987 * dwarf_reader.cc (next_generation_count): New static var.
12988 (Addr2line_cache_entry): New struct.
12989 (addr2line_cache): New static var.
12990 (Dwarf_line_info::one_addr2line): Added caching.
12991 (Dwarf_line_info::clear_addr2line_cache): New function.
12992 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
12993 cache-size parameter.
12994 (Dwarf_line_info::one_addr2line_cache): New function.
12995 * symtab.cc (Symbol_table::detect_odr_violations): Pass
12996 new cache-size argument to one_addr2line(), and clear cache.
12997
d09e9154
CC
129982008-04-28 Cary Coutant <ccoutant@google.com>
12999
13000 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
13001 R_386_PC8 relocations.
13002
7ef73768
ILT
130032008-04-23 Ian Lance Taylor <iant@google.com>
13004
55438702
ILT
13005 * object.cc (Sized_relobj::include_section_group): Check for
13006 invalid section group.
13007
c165fb93
ILT
13008 * object.cc (make_elf_object): Correct test for 64-bit ELF file
13009 header size.
13010
7ef73768
ILT
13011 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
13012 than read for file header.
13013 * archive.cc (Archive::include_member): Likewise.
13014
6194aaab
L
130152008-04-23 Paolo Bonzini <bonzini@gnu.org>
13016
13017 * aclocal.m4: Regenerate.
13018 * configure: Regenerate.
13019
d491d34e
ILT
130202008-04-19 Ian Lance Taylor <iant@google.com>
13021
5ea2bac6
ILT
13022 * version.cc (version_string): Bump to 1.6.
13023
7bc3e21a
ILT
13024 * testsuite/Makefile.am (many_sections_r_test): New target.
13025 (many_sections_r_test_SOURCES): Remove.
13026 (many_sections_r_test_DEPENDENCIES): Remove.
13027 (many_sections_r_test_LDFLAGS): Remove.
13028 (many_sections_r_test_LDADD): Remove.
13029
7fcd3aa9
ILT
13030 * object.cc (Sized_relobj::do_add_symbols): Always pass
13031 local_symbol_count_ to add_from_relobj.
13032
4c94d6ae
ILT
13033 * testsuite/Makefile.am (many_sections_check.h): Only check one in
13034 every thousand variables.
13035 * testsuite/Makefile.in: Rebuild.
13036
d491d34e
ILT
13037 * object.cc (Xindex::initialize_symtab_xindex): New function.
13038 (Xindex::read_symtab_xindex): New function.
13039 (Xindex::sym_xindex_to_shndx): New function.
13040 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
13041 available.
13042 (Sized_relobj::do_initialize_xindex): New function.
13043 (Sized_relobj::do_read_symbols): Adjust section links.
13044 (Sized_relobj::symbol_section_and_value): Add is_ordinary
13045 parameter. Change all callers.
13046 (Sized_relobj::include_section_group): Adjust section links and
13047 symbol section indexes.
13048 (Sized_relobj::do_layout): Adjust section links.
13049 (Sized_relobj::do_count_local_symbols): Adjust section links and
13050 symbol section indexes.
13051 (Sized_relobj::do_finalize_local_symbols): Distinguish between
13052 ordinary and special symbols.
13053 (Sized_relobj::write_local_symbols): Add symtab_xindex and
13054 dynsym_xindex parameters. Change all callers. Adjust section
13055 links. Use SHN_XINDEX when needed.
13056 (Sized_relobj::get_symbol_location_info): Adjust section links.
13057 Don't get fooled by special symbols.
13058 * object.h (class Xindex): Define.
13059 (class Object): Add xindex_ parameter. Declare virtual functoin
13060 do_initialize_xindex.
13061 (Object::adjust_sym_shndx): New function.
13062 (Object::set_xindex): New protected function.
13063 (class Symbol_value): Add is_ordinary_shndx_ field.
13064 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
13065 (Symbol_value::value): Assert ordinary section.
13066 (Symbol_value::initialize_input_to_output_map): Likewise.
13067 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
13068 Change all callers.
13069 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
13070 all callers.
13071 (class Sized_relobj): Update declarations.
13072 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
13073 parameter. Change all callers.
13074 (Sized_relobj::adjust_shndx): New function.
13075 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
13076 field.
13077 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
13078 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
13079 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
13080 (Sized_dynobj::read_dynsym_section): Adjust section links.
13081 (Sized_dynobj::read_dynamic): Likewise.
13082 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
13083 section links.
13084 (Sized_dynobj::do_initialize_xindex): New function.
13085 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
13086 do_initialize_xindex.
13087 (Sized_dynobj::adjust_shndx): New function.
13088 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
13089 dynsym_xindex_ fields.
13090 (Layout::finalize): Add a call to set_section_indexes before
13091 creating the symtab sections.
13092 (Layout::set_section_indexes): Don't do anything if the section
13093 already has a section index.
13094 (Layout::create_symtab_sections): Add shnum parameter. Change
13095 caller. Create .symtab_shndx section if needed.
13096 (Layout::create_shdrs): Add shstrtab_section parameter. Change
13097 caller.
13098 (Layout::allocated_output_section_count): New function.
13099 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
13100 needed.
13101 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
13102 fields. Update declarations.
13103 (Layout::symtab_xindex): New function.
13104 (Layout::dynsym_xindex): New function.
13105 (class Write_symbols_task): Add layout_ field.
13106 (Write_symbols_task::Write_symbols_task): Add layout parameter.
13107 Change caller.
13108 * output.cc (Output_section_headers::Output_section_headers): Add
13109 shstrtab_section parameter. Change all callers.
13110 (Output_section_headers::do_sized_write): Store overflow values
13111 for section count and section string table section index in
13112 section header zero.
13113 (Output_file_header::do_sized_write): Check for overflow of
13114 section count and section string table section index.
13115 (Output_symtab_xindex::do_write): New function.
13116 (Output_symtab_xindex::endian_do_write): New function.
13117 * output.h (class Output_section_headers): Add shstrtab_section_.
13118 Update declarations.
13119 (class Output_symtab_xindex): Define.
13120 (Output_section::has_out_shndx): New function.
13121 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
13122 field.
13123 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
13124 Change all callers.
13125 (Sized_symbol::init): Likewise.
13126 (Symbol::output_section): Check for ordinary symbol.
13127 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
13128 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
13129 callers.
13130 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
13131 Change all callers. Simplify handling of symbols from sections
13132 not included in the link.
13133 (Symbol_table::add_from_dynobj): Handle ordinary symbol
13134 distinction.
13135 (Weak_alias_sorter::operator()): Assert that symbols are
13136 ordinary.
13137 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
13138 distinction.
13139 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
13140 parameters. Change all callers.
13141 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
13142 symbol distinction. Use SHN_XINDEX when needed.
13143 (Symbol_table::write_section_symbol): Add symtab_xindex
13144 parameter. Change all callers.
13145 (Symbol_table::sized_write_section_symbol): Likewise. Use
13146 SHN_XINDEX when needed.
13147 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
13148 declarations.
13149 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
13150 (Symbol::is_defined): Check is_ordinary.
13151 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
13152 (Symbol::is_absolute, Symbol::is_common): Likewise.
13153 (class Sized_symbol): Update declarations.
13154 (class Symbol_table): Update declarations.
13155 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
13156 parameters. Change all callers.
13157 (Sized_symbol::override): Likewise.
13158 (Symbol_table::override): Likewise.
13159 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
13160 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
13161 is_ordinary, and orig_st_shndx parameters. Change all callers.
13162 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
13163 to be in an ordinary section.
13164 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
13165 object and is_ordinary parameters. Change all callers.
13166 (Sized_dwarf_line_info::read_relocs): Add object parameter.
13167 Change all callers. Don't add undefined or non-ordinary symbols
13168 to reloc_map_.
13169 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
13170 Change all callers.
13171 * dwarf_reader.h (class Sized_dwarf_line_info): Update
13172 declarations.
13173 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
13174 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
13175 (Sized_relobj::relocate_sections): Likewise.
13176 * target-reloc.h (scan_relocs): Adjust section symbol index.
13177 (scan_relocatable_relocs): Likewise.
13178 * i386.cc (Scan::local): Check for ordinary symbols.
13179 * sparc.cc (Scan::local): Likewise.
13180 * x86_64.cc (Scan::local): Likewise.
13181 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
13182 to symbol_section_and_value.
13183 * testsuite/many_sections_test.cc: New file.
13184 * testsuite/Makefile.am (BUILT_SOURCES): Define.
13185 (check_PROGRAMS): Add many_sections_test.
13186 (many_sections_test_SOURCES): Define.
13187 (many_sections_test_DEPENDENCIES): Define.
13188 (many_sections_test_LDFLAGS): Define.
13189 (BUILT_SOURCES): Add many_sections_define.h.
13190 (many_sections_define.h): New target.
13191 (BUILT_SOURCES): Add many_sections_check.h.
13192 (many_sections_check.h): New target.
13193 (check_PROGRAMS): Add many_sections_r_test.
13194 (many_sections_r_test_SOURCES): Define.
13195 (many_sections_r_test_DEPENDENCIES): Define.
13196 (many_sections_r_test_LDFLAGS): Define.
13197 (many_sections_r_test_LDADD): Define.
13198 (many_sections_r_test.o): New target.
13199 * testsuite/Makefile.in: Rebuild.
13200
c5818ff1
CC
132012008-04-17 Cary Coutant <ccoutant@google.com>
13202
13203 * errors.cc (Errors::info): New function.
13204 (gold_info): New function.
13205 * errors.h (Errors::info): New function.
13206 * gold.h (gold_info): New function.
13207 * object.cc (Input_objects::add_object): Print trace output.
13208 * options.cc (options::parse_set): New function.
13209 (General_options::parse_wrap): Deleted.
13210 (General_options::General_options): Deleted initializer.
13211 * options.h (options::String_set): New typedef.
13212 (options::parse_set): New function.
13213 (DEFINE_set): New macro.
13214 (General_options::wrap): Changed to use DEFINE_set. Changed
13215 callers of any_wrap_symbols and is_wrap_symbol.
13216 (General_options::trace, General_options::trace_symbol):
13217 New options.
13218 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
13219 (General_options::wrap_symbols_): Deleted.
13220 * symtab.cc (Symbol_table::add_from_object): Print trace output.
13221
b5be4a7c
DM
132222008-04-17 David S. Miller <davem@davemloft.net>
13223
13224 * options.cc (General_options::parse_V): New function.
13225 * options.h: Add entries for -V and -Qy.
13226
155a0dd7
ILT
132272008-04-17 Ian Lance Taylor <iant@google.com>
13228
13229 * common.cc (Symbol_table::allocate_commons): Remove options
13230 parameter. Change caller.
13231 (Symbol_table::do_allocate_commons): Remove options parameter.
13232 Change caller. Just call do_allocate_commons_list twice.
13233 (Symbol_table::do_allocate_commons_list): New function, broken out
13234 of do_allocate_commons.
13235 * common.h (class Allocate_commons_task): Remove options_ field.
13236 Update constructor.
13237 * symtab.cc (Symbol_table::Symbol_table): Initialize
13238 tls_commons_.
13239 (Symbol_table::add_from_object): Put TLS common symbols on
13240 tls_commons_ list.
13241 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
13242 which are IN_OUTPUT_DATA.
13243 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
13244 allocate_commons and do_allocate_commons declarations. Declare
13245 do_allocate_commons_list.
13246 * gold.cc (queue_middle_tasks): Update creation of
13247 Allocate_commons_task to not pass options.
13248 * testsuite/Makefile.am (INCLUDES): Add -I.. .
13249 (TLS_TEST_C_FLAGS): New variable.
13250 (tls_test_c_pic.o): New target.
13251 (tls_test_shared.so): Link in tls_test_c_pic.o.
13252 (tls_test_c_pic_ie.o): New target.
13253 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
13254 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
13255 (tls_test_c.o): New target.
13256 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
13257 (tls_pic_test_LDADD): Likewise.
13258 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
13259 (tls_shared_gd_to_ie_test_LDADD): Likewise.
13260 (tls_test_c_gnu2.o): New target.
13261 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
13262 tls_test_c_gnu2.o.
13263 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
13264 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
13265 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
13266 * testsuite/tls_test.cc: Include "config.h".
13267 (t_last): Call t11_last.
13268 * testsuite/tls_test.h (t11, t11_last): Declare.
13269 * testsuite/tls_test_c.c: New file.
13270 * testsuite/tls_test_main.cc (thread_routine): Call t11.
13271 * configure.ac: Check for OpenMP support.
13272 * configure, config.in, Makefile.in: Rebuild.
13273 * testsuite/Makefile.in: Rebuild.
13274
edfbb029
CC
132752008-04-16 Cary Coutant <ccoutant@google.com>
13276
13277 * i386.cc (Target_i386::define_tls_base_symbol): New function.
13278 (Target_i386::tls_base_symbol_defined_): New field.
13279 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
13280 (Target_i386::Scan::global): Likewise.
13281 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
13282 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
13283 (Target_x86_64::tls_base_symbol_defined_): New field.
13284 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
13285 (Target_x86_64::Scan::global): Likewise.
13286
f3c69fca
CC
132872008-04-16 Cary Coutant <ccoutant@google.com>
13288
13289 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
13290 (Symbol::needs_plt_entry): Allow weak undefined symbols.
13291 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
13292 building shared libraries.
13293 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
13294 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
13295 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
13296 * testsuite/Makefile.in: Rebuild.
13297 * testsuite/weak_undef.h: New file.
13298 * testsuite/weak_undef_file1.cc: Add extra test cases.
13299 * testsuite/weak_undef_file2.cc: Likewise.
13300 * testsuite/weak_undef_test.cc: Likewise.
13301
7c414435
DM
133022008-04-16 David S. Miller <davem@davemloft.net>
13303
32b769e1
DM
13304 * sparc.cc (Target_sparc::Scan): Change from struct to class.
13305 Add issued_non_pic_error_ field. Declare check_non_pic.
13306 (Target_sparc::Scan::check_non_pic): New function.
13307 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
13308 (Target_sparc::Scan::global): Likewise.
13309
11936fb1
DM
13310 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
13311 * configure: Rebuild.
13312
7c414435
DM
13313 * options.h (DEFINE_enable): New macro.
13314 (new_dtags): New enable option.
13315 (initfirst, interpose, loadfltr, nodefaultlib,
13316 nodelete, nodlopen, nodump): New -z options.
13317 * layout.cc (Layout:finish_dynamic_section): If new
13318 dtags enabled, emit DT_RUNPATH. Also, emit a
13319 DT_FLAGS_1 containing any specified -z flags.
13320
85c7bf8b
ILT
133212008-04-16 Ian Lance Taylor <iant@google.com>
13322
12c0daef
ILT
13323 * copy-relocs.cc: New file.
13324 * copy-relocs.h: New file.
13325 * reloc.cc: Remove Copy_relocs code.
13326 * reloc.h: Likewise.
13327 * reloc-types.h (struct Reloc_types) [both versions]: Add
13328 get_reloc_addend_noerror.
13329 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
13330 variants of add_global which take an addend which must be zero.
13331 * i386.cc: Include "copy-relocs.h".
13332 (class Target_i386): Change type of copy_relocs_ to variable,
13333 update initializer.
13334 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
13335 Change all callers.
13336 (Target_i386::do_finalize_sections): Change handling of
13337 copy_relocs_.
13338 * sparc.cc: Include "copy-relocs.h".
13339 (class Target_sparc): Change type of copy_relocs_ to variable,
13340 update initializer.
13341 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
13342 Change all callers.
13343 (Target_sparc::do_finalize_sections): Change handling of
13344 copy_relocs_.
13345 * x86_64.cc: Include "copy-relocs.h".
13346 (class Target_x86_64): Change type of copy_relocs_ to variable,
13347 update initializer.
13348 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
13349 class. Change all callers.
13350 (Target_x86_64::do_finalize_sections): Change handling of
13351 copy_relocs_.
13352 * Makefile.am (CCFILES): Add copy-relocs.cc.
13353 (HFILES): Add copy-relocs.h.
13354
4f4995b6
ILT
13355 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
13356
85c7bf8b
ILT
13357 * testsuite/script_test_4.sh: Permit leading zeroes.
13358
4f2a9edd
ILT
133592008-04-15 Ian Lance Taylor <iant@google.com>
13360
e6188289
ILT
13361 * script-sections.cc (Script_sections::create_segments): Use
13362 header_size_adjustment even when there is enough room for the
13363 headers.
13364 * testsuite/script_test_4.sh: New file.
13365 * testsuite/script_test_4.t: New file.
13366 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
13367 (check_DATA): Add script_test_4.stdout.
13368 (MOSTLYCLEANFILES): Likewise.
13369 (script_test_4): New target.
13370 (script_test_4.stdout): New target.
13371 * testsuite/Makefile.in: Rebuild.
13372
4f2a9edd
ILT
13373 * sparc.cc: Add definitions for Output_data_plt_sparc class
13374 constants.
13375
f5314dd5
DM
133762008-04-14 David S. Miller <davem@davemloft.net>
13377
13378 * sparc.cc: New file.
13379 * Makefile.am (TARGETSOURCES): Add sparc.cc
13380 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
13381 * configure.tgt: Document targ_extra_size and
13382 targ_extra_big_endian. Add entries for sparc-* and
13383 sparc64-*.
13384 * configure.ac: Handle targ_extra_size and
13385 targ_extra_big_endian.
13386 * Makefile.in: Rebuild.
13387 * configure: Likewise.
13388 * po/POTFILES.in: Likewise.
13389 * po/gold.pot: Likewise.
13390
154e0e9a
ILT
133912008-04-14 Ian Lance Taylor <iant@google.com>
13392
13393 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
13394 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
13395 in the name/type/flags to section mapping. Don't call
13396 allocate_output_section.
13397 (Layout::choose_output_section): Change parameter from adjust_name
13398 to is_input_section. Don't permit input sections after sections
13399 are attached to segments. Don't call allocate_output_section.
13400 (Layout::layout_eh_frame): Call update_flags_for_input_section,
13401 not write_enable_output_section.
13402 (Layout::make_output_section): Don't push to
13403 unattached_section_list_ nor call attach_to_segment. Call
13404 attach_section_to_segment if sections are attached.
13405 (Layout::attach_sections_to_segments): New function.
13406 (Layout::attach_section_to_segment): New function.
13407 (Layout::attach_allocated_section_to_segment): Rename from
13408 attach_to_segment. Remove flags parameter.
13409 (Layout::allocate_output_section): Remove function.
13410 (Layout::write_enable_output_section): Remove function.
13411 * layout.h (class Layout): Update for above changes. Add new
13412 field sections_are_attached_.
13413 * output.h (Output_section::update_flags_for_input_section): New
13414 function.
13415 * output.cc (Output_section::add_input_section): Call
13416 update_flags_for_input_section.
13417 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
13418
009a67a2
CC
134192008-04-11 Cary Coutant <ccoutant@google.com>
13420
13421 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
13422 thought unnecessary.
13423 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
13424
759b1a24
ILT
134252008-04-11 Ian Lance Taylor <iant@google.com>
13426
13427 * output.h (class Output_section_data): Remove inline definition
13428 of set_addralign.
13429 * output.cc (Output_section_data::set_addralign): New function.
13430
c2b45e22
CC
134312008-04-11 Cary Coutant <ccoutant@google.com>
13432
13433 Add support for TLS descriptors for i386 and x86_64.
13434 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
13435 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
13436 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
13437 GOT_TYPE_TLS_DESC.
13438 (Target_i386::got_mod_index_entry): Remove unnecessary code.
13439 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
13440 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
13441 relocations.
13442 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
13443 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
13444 Fix problem with initial-exec relocations.
13445 (Target_i386::Relocate::relocate_tls): Likewise.
13446 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
13447 relaxation.
13448 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
13449 support for section-plus-offset dynamic table entries.
13450 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
13451 (Output_data_dynamic::Dynamic_entry): Add support for
13452 section-plus-offset dynamic table entries.
13453 (Output_data_dynamic::Classification): Likewise.
13454 (Output_data_dynamic::classification_): Renamed offset_.
13455 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
13456 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
13457 (Target_x86_64::make_plt_section): New function.
13458 (Target_x86_64::reserve_tlsdesc_entries): New function.
13459 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
13460 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
13461 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
13462 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
13463 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
13464 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
13465 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
13466 add extra PLT entry for TLS descriptors.
13467 (Output_data_plt_x86_64::got_): New field.
13468 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
13469 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
13470 fields.
13471 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
13472 descriptors.
13473 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
13474 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
13475 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
13476 R_386_TLS_DESC_CALL relocations.
13477 (Target_x86_64::Scan::global): Likewise.
13478 (Target_x86_64::do_finalize_sections): Add dynamic table entries
13479 for TLS descriptors.
13480 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
13481 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
13482 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
13483 GD-to-IE relaxation.
13484 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
13485 and TLS_DESCRIPTORS.
13486 * Makefile.in: Rebuild.
13487 * configure: Rebuild.
13488 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
13489 (tls_test_shared2.so): New target.
13490 (tls_shared_gd_to_ie_test_SOURCES): New variable.
13491 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
13492 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
13493 (tls_shared_gd_to_ie_test_LDADD): New variable.
13494 (tls_shared_gnu2_gd_to_ie_test): New target.
13495 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
13496 New targets.
13497 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
13498 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
13499 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
13500 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
13501 (tls_shared_gnu2_test): New target.
13502 (tls_test_gnu2_shared.so): New target.
13503 (tls_shared_gnu2_test_SOURCES): New variable.
13504 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
13505 (tls_shared_gnu2_test_LDFLAGS): New variable.
13506 (tls_shared_gnu2_test_LDADD): New variable.
13507 * testsuite/Makefile.in: Rebuild.
13508 * testsuite/Makefile.
13509
83bfb6b7
ILT
135102008-04-11 Ian Lance Taylor <iant@google.com>
13511
13512 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
13513 justsyms.t.
13514 * testsuite/Makefile.in: Rebuild.
13515
13516 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
13517 long.
13518 * testsuite/script_test_2.cc (main): Adjust test.
13519
706e1f5e
ILT
135202008-04-11 David S. Miller <davem@davemloft.net>
13521 Ian Lance Taylor <iant@google.com>
13522
13523 * options.h (General_options): Add entries for '-Y' and
13524 '-relax'.
13525 * options.cc (General_options:finalize): If -Y was used, add those
13526 entries to the library path instead of the default "/lib" and
13527 "/usr/lib".
13528
7c98e6bb
DM
135292008-04-11 David S. Miller <davem@davemloft.net>
13530
13531 * testsuite/justsyms.t: Start at 0x100.
13532 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
13533 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
13534 long.
13535 * testsuite/script_test_2.cc: Adjust string and section length
13536 checks.
7c98e6bb 13537
99a37bfd
ILT
135382008-04-09 Ian Lance Taylor <iant@google.com>
13539
2cefc357
ILT
13540 PR gold/5996
13541 * script-sections.cc (Sections_element::allocate_to_segment): Add
13542 orphan parameter.
13543 (Output_section_definition::allocate_to_segment): Likewise.
13544 (Orphan_output_section::allocate_to_segment): Likewise.
13545 (Script_sections::attach_sections_using_phdrs_clause): Don't
13546 propagate non-PT_LOAD segments to orphan sections.
13547 * testsuite/Makefile.am (script_test_3.stdout): Generate using
13548 readelf rather than objdump.
13549 * testsuite/script_test_3.sh: Adjust accordingly. Test that
13550 .interp section and PT_INTERP segment are the same size.
13551 * testsuite/Makefile.in: Rebuild.
13552
99a37bfd
ILT
13553 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
13554 aliases for symbols defined in the same object.
13555 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
13556 (weak_alias_test_SOURCES): New variable.
13557 (weak_alias_test_DEPENDENCIES): New variable.
13558 (weak_alias_test_LDFLAGS): New variable.
13559 (weak_alias_test_LDADD): New variable.
13560 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
13561 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
13562 (weak_alias_test_3.o): New target.
13563 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
13564 * testsuite/weak_alias_test_main.cc: New file.
13565 * testsuite/weak_alias_test_1.cc: New file.
13566 * testsuite/weak_alias_test_2.cc: New file.
13567 * testsuite/weak_alias_test_3.cc: New file.
13568
780e49c5
ILT
135692008-04-08 Ian Lance Taylor <iant@google.com>
13570
cdb0b8f5
ILT
13571 * options.h (class General_options): Add --noinhibit-exec option.
13572 * main.cc (main): Check --noinhibit-exec.
13573
0864d551
ILT
13574 * options.h (class General_options): Define --wrap as a special
13575 option. Add wrap_symbols_ field.
13576 (General_options::any_wrap_symbols): New function.
13577 (General_options::is_wrap_symbol): New function.
13578 * options.cc (General_options::parse_wrap): New function.
13579 (General_options::General_options): Initialize wrap_symbols_.
13580 * symtab.cc (Symbol_table::wrap_symbol): New function.
13581 (Symbol_table::add_from_object): Handle --wrap.
13582 * symtab.h (class Symbol_table): Declare wrap_symbol.
13583 * target.h (Target::wrap_char): New function.
13584 (Target::Target_info): Add wrap_char field.
13585 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
13586 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13587 * testsuite/testfile.cc (Target_test::test_target_info):
13588 Likewise.
13589
789aa6de
ILT
13590 * errors.cc (Errors::undefined_symbol): Mention symbol version if
13591 there is one.
13592
2c38906f
ILT
13593 * layout.h (class Layout): Add added_eh_frame_data_ field.
13594 * layout.cc (Layout::Layout): Initialize new field.
13595 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
13596 output section until we find a section we merged successfully.
13597 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
13598 that the size be non-zero.
13599
780e49c5
ILT
13600 * merge.cc (Object_merge_map::get_output_offset): Remove inline
13601 qualifier.
13602
7fcd0256
ILT
136032008-04-08 Craig Silverstein <csilvers@google.com>
13604
13605 * configure.ac: Export new conditional variable HAVE_ZLIB.
13606 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
13607 on HAVE_ZLIB.
13608 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
13609 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13610
6835af53
ILT
136112008-04-07 Ian Lance Taylor <iant@google.com>
13612
e24f324c
ILT
13613 * version.cc (version_string): Set to "1.5".
13614
a036edd8
ILT
13615 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
13616 Add issued_non_pic_error_ field. Declare check_non_pic.
13617 (Target_x86_64::Scan::check_non_pic): New function.
13618 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
13619 (Target_x86_64::Scan::global): Likewise.
13620
624f8810
ILT
13621 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
13622 addend parameter. Change caller. Handle merge sections.
13623 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
13624 Address to Addend. Don't add in the result of
13625 local_section_offset, pass down the addend and use the returned
13626 value.
13627 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
13628 Update declarations of local_section_offset and symbol_value.
13629 * testsuite/two_file_test_1.cc (t18): New function.
13630 * testsuite/two_file_test_2.cc (f18): New function.
13631 * testsuite/two_file_test_main.cc (main): Call t18.
13632 * testsuite/two_file_test.h (t18, f18): Declare.
13633
6835af53
ILT
13634 * configure.ac: Don't test for objdump, c++filt, or readelf.
13635 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
13636 conditionals.
13637 (TEST_READELF): New variable.
13638 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
13639 (check_PROGRAMS): Add two_file_strip_test.
13640 (two_file_strip_test): New target.
13641 (check_PROGRAMS): Add two_file_same_shared_strip_test.
13642 (two_file_same_shared_strip_test_SOURCES): New variable.
13643 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
13644 (two_file_same_shared_strip_test_LDFLAGS): New variable.
13645 (two_file_same_shared_strip_test_LDADD): New variable.
13646 (two_file_shared_strip.so): New target.
13647 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
13648 (ver_test_5.syms, ver_test_7.syms): Likewise.
13649 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
13650 (strip_test_3.stdout): Use TEST_OBJDUMP.
13651 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13652
86925eef
CC
136532008-04-04 Cary Coutant <ccoutant@google.com>
13654
13655 * symtab.h (Symbol::is_weak_undefined): New function.
13656 (Symbol::is_strong_undefined): New function.
13657 (Symbol::is_absolute): New function.
13658 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
13659 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
13660 absolute symbols.
13661 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
13662 (weak_undef_test): New target.
13663 * testsuite/Makefile.in: Rebuild.
13664 * testsuite/weak_undef_file1.cc: New file.
13665 * testsuite/weak_undef_file2.cc: New file.
13666 * testsuite/weak_undef_test.cc: New file.
13667
126f3ece
ILT
136682008-04-03 Craig Silverstein <csilvers@google.com>
13669
13670 * compressed_output.h (class Output_compressed_section): Use
13671 unsigned buffer.
13672 * compressed_output.cc (zlib_compress): Use unsigned buffers,
13673 add zlib header.
13674 (zlib_compressed_suffix): Removed.
13675 (Output_compressed_section::set_final_data_size): Use unsigned
13676 buffers.
13677 * testsuite/Makefile.am (flagstest_compress_debug_sections):
13678 Fix linker invocation.
13679 (flagstest_o_specialfile_and_compress_debug_sections):
13680 Likewise.
13681 * testsuite/Makefile.in: Regenerated.
13682
deae2a14
DM
136832008-04-02 David S. Miller <davem@davemloft.net>
13684
13685 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
13686 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
13687
70752818
ILT
136882008-04-02 Craig Silverstein <csilvers@google.com>
13689
13690 * TODO: New file.
13691
39d0cb0e
ILT
136922008-04-02 Ian Lance Taylor <iant@google.com>
13693
13694 * fileread.cc (File_read::find_view): Add byteshift and vshifted
13695 parameters. Update for new key type to views_. Change all
13696 callers.
13697 (File_read::read): Adjust for byteshift in returned view.
13698 (File_read::add_view): New function, broken out of
13699 find_and_make_view.
13700 (File_read::make_view): New function, broken out of
13701 find_and_make_view.
13702 (File_read::find_or_make_view): Add offset and aligned
13703 parameters. Rewrite accordingly. Change all callers.
13704 (File_read::get_view): Add offset and aligned parameters. Adjust
13705 for byteshift in return value.
13706 (File_read::get_lasting_view): Likewise.
13707 * fileread.h (class File_read): Update declarations.
13708 (class File_read::View): Add byteshift_ field. Add byteshift to
13709 constructor. Add byteshift method.
13710 * archive.h (Archive::clear_uncached_views): New function.
13711 (Archive::get_view): Add aligned parameter. Change all callers.
13712 * object.h (Object::get_view): Add aligned parameter. Change all
13713 callers.
13714 (Object::get_lasting_view): Likewise.
13715
13716 * fileread.cc (File_read::release): Don't call clear_views if
13717 there are multiple objects.
13718 * fileread.h (File_read::clear_uncached_views): New function.
13719 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
13720 on the archive.
13721
a1207466
CC
137222008-03-31 Cary Coutant <ccoutant@google.com>
13723
13724 Add thin archive support.
13725 * archive.cc (Archive::armagt): New const.
13726 (Archive::setup): Remove task parameter and calls to unlock.
13727 (Archive::unlock_nested_archives): New function.
13728 (Archive::read_header): Add nested_off parameter. Change
13729 all callers.
13730 (Archive::interpret_header): Likewise.
13731 (Archive::include_all_members): Change to handle thin
13732 archives.
13733 (Archive::include_member): Likewise.
13734 * archive.h (Archive::Archive): Add new parameters and
13735 initializers.
13736 (Archive::armagt): New const.
13737 (Archive::setup): Remove task parameter.
13738 (Archive::unlock_nested_archives): New function.
13739 (Archive::read_header): Add nested_off parameter.
13740 (Archive::interpret_header): Likewise.
13741 (Archive::Nested_archive_table): New typedef.
13742 (Archive::is_thin_archive_): New field.
13743 (Archive::nested_archives_): New field.
13744 (Archive::options_): New field.
13745 (Archive::dirpath_): New field.
13746 (Archive::task_): New field.
13747 * readsyms.cc (Read_symbols::do_read_symbols): Add check
13748 for thin archives. Pass additional parameters to
13749 Archive::Archive. Unlock the archive file after calling
13750 Archive::setup.
cd536b21 13751
479f6503
ILT
137522008-03-29 Ian Lance Taylor <iant@google.com>
13753
686c8caf
ILT
13754 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
13755 version symbol to be local.
13756 * testsuite/ver_test_4.sh: New file.
13757 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
13758 (check_DATA): Add ver_test_4.syms.
13759 (ver_test_4.syms): New target.
13760 * testsuite/Makefile.in: Rebuild.
13761
ab794b6b
ILT
13762 * output.cc
13763 (Output_section::Input_section_sort_entry::has_priority): New
13764 function.
13765 (Output_section::Input_section_sort_entry::match_file_name): New
13766 function.
13767 (Output_section::Input_section_sort_entry::match_section_name):
13768 Remove.
13769 (Output_section::Input_section_sort_entry::match_section_name_prefix):
13770 Remove.
13771 (Output_section::Input_section_sort_entry::match_section_file):
13772 Remove.
13773 (Output_section::Input_section_sort_compare::operator()): Rewrite
13774 using new Input_section_sort_entry functions. Sort crtbegin and
13775 crtend first. Sort sections with no priority before sections with
13776 a priority.
13777 * testsuite/initpri1.c (d3): Check j != 4.
13778 (cd5): New constructor/destructor function.
13779 (main): Check j != 2.
13780
479f6503
ILT
13781 * symtab.cc (Symbol_table::add_from_object): If we don't use the
13782 new symbol when resolving, don't call set_is_default.
13783 * testsuite/ver_test_7.cc: New file.
13784 * testsuite/ver_test_7.sh: New file.
13785 * testsuite/Makefile.am (ver_test_7.so): New target.
13786 (ver_test_7.o): New target.
13787 (check_SCRIPTS): Add ver_test_7.sh.
13788 (check_DATA): Add ver_test_7.syms.
13789 (ver_test_7.syms): New target.
13790
2fd32231
ILT
137912008-03-28 Ian Lance Taylor <iant@google.com>
13792
13793 * layout.cc (Layout::layout): If we see an input section with a
13794 name that needs sorting, set the must_sort flag for the output
13795 section.
13796 (Layout::make_output_section): If the name of the output section
13797 indicates that it might require sorting, set the may_sort flag.
13798 * output.h (Output_section::may_sort_attached_input_sections): New
13799 function.
13800 (Output_section::set_may_sort_attached_input_sections): New
13801 function.
13802 (Output_section::must_sort_attached_input_sections): New
13803 function.
13804 (Output_section::set_must_sort_attached_input_sections): New
13805 function.
13806 (class Output_section): Declare Input_section_sort_entry. Define
13807 Input_section_sort_compare. Declare
13808 sort_attached_input_sections. Add new fields:
13809 may_sort_attached_input_sections_,
13810 must_sort_attached_input_sections_,
13811 attached_input_sections_are_sorted_.
13812 * output.cc (Output_section::Output_section): Initialize new
13813 fields.
13814 (Output_section::add_input_section): Add an entry to
13815 input_sections_ if may_sort or must_sort are true.
13816 (Output_section::set_final_data_size): Call
13817 sort_attached_input_sections if necessary.
13818 (Output_section::Input_section_sort_entry): Define new class.
13819 (Output_section::Input_section_sort_compare::operator()): New
13820 function.
13821 (Output_section::sort_attached_input_sections): New function.
13822 * configure.ac: Check whether the compiler supports constructor
13823 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
13824 * testsuite/initpri1.c: New file.
13825 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
13826 CONSTRUCTOR_PRIORITY.
13827 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
13828 (initpri1_LDFLAGS): New variable.
13829 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13830
18e6b24e
ILT
138312008-03-27 Ian Lance Taylor <iant@google.com>
13832
49bdd526
ILT
13833 * common.cc (Sort_commons::operator): Correct sorting algorithm.
13834 * testsuite/common_test_1.c: New file.
13835 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
13836 (common_test_1_SOURCES): New variable.
13837 (common_test_1_DEPENDENCIES): New variable.
13838 (common_test_1_LDFLAGS): New variable.
13839
18e6b24e
ILT
13840 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
13841 and commons_ correctly when NAME/VERSION does not override
13842 NAME/NULL.
13843 * testsuite/ver_test_6.c: New file.
13844 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
13845 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
13846 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
13847
04bf7072
ILT
138482008-03-26 Ian Lance Taylor <iant@google.com>
13849
5871526f
ILT
13850 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
13851 of an undefined symbol from a version script.
13852 * testsuite/Makefile.am (ver_test_5.so): New target.
13853 (ver_test_5.o): New target.
13854 (check_SCRIPTS): Add ver_test_5.sh.
13855 (check_DATA): Add ver_test_5.syms.
13856 (ver_test_5.syms): New target.
13857 * testsuite/ver_test_5.cc: New file.
13858 * testsuite/ver_test_5.script: New file.
13859 * testsuite/ver_test_5.sh: New file.
13860 * Makefile.in, testsuite/Makefile.in: Rebuild.
13861
04bf7072
ILT
13862 PR gold/5986
13863 Fix problems building gold with gcc 4.3.0.
13864 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
13865 (gold_error_at_location, gold_warning_at_location): Use it.
13866 * configure.ac: Check whether we can compile and use a template
13867 function with a printf attribute.
13868 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
13869 when jumping over bytes.
13870 * object.cc: Instantiate Object::read_section_data.
13871 * debug.h: Include <cstring>
13872 * dwarf_reader.cc: Include <algorithm>
13873 * main.cc: Include <cstring>.
13874 * options.cc: Include <cstring>.
13875 * output.cc: Include <cstring>.
13876 * script.cc: Include <cstring>.
13877 * script.h: Include <string>.
13878 * symtab.cc: Include <cstring> and <algorithm>.
13879 * target-select.cc: Include <cstring>.
13880 * version.cc: Include <string>.
13881 * testsuite/testmain.cc: Include <cstdlib>.
13882 * configure, config.in: Rebuild.
13883
874c5b28
ILT
138842008-03-25 Ian Lance Taylor <iant@google.com>
13885
819d6c3a
ILT
13886 * options.cc: Include "../bfd/bfdver.h".
13887 (options::help): Print bug reporting address.
13888
f4b2c6f5
ILT
13889 * version.cc (print_version): Adjust output for current value of
13890 BFD_VERSION_STRING.
13891
13892 * NEWS: New file.
13893
e96caa79
ILT
13894 * options.cc (options::help): Print list of supported targets.
13895 * target-select.h: Include <vector>.
13896 (class Target_selector): Make machine_, size_, and is_big_endian_
13897 fields const. Add bfd_name_ and instantiated_target_ fields.
13898 (Target_selector::Target_selector): Add bfd_name parameter.
13899 (Target_selector::recognize): Make non-virtual, call
13900 do_recognize.
13901 (Target_selector::recognize_by_name): Make non-virtual, call
13902 do_recognize_by_name.
13903 (Target_selector::supported_names): New function.
13904 (Target_selector::bfd_name): New function.
13905 (Target_selector::do_instantiate_target): New pure virtual
13906 function.
13907 (Target_selector::do_recognize): New virtual function.
13908 (Target_selector::do_recognize_by_name): New virtual function.
13909 (Target_selector::instantiate_target): New private function.
13910 (supported_target_names): Declare.
13911 * target-select.cc (Target_selector::Target_selector): Update for
13912 new parameter and fields.
13913 (select_target_by_name): Check that the name matches before
13914 calling recognize_by_name.
13915 (supported_target_names): New function.
13916 * i386.cc (class Target_selector_i386): Update Target_selector
13917 constructor call. Remove recognize and recognize_by_name. Add
13918 do_instantiate_target.
13919 * x86_64.cc (class Target_selector_x86_64): Likewise.
13920 * testsuite/testfile.cc (class Target_selector_test): Update for
13921 changes to Target_selector.
13922
874c5b28
ILT
13923 * README: Rewrite, with some notes on unsupported features.
13924
0a65a3a7
CC
139252008-03-24 Cary Coutant <ccoutant@google.com>
13926
13927 * i386.cc (Target_i386::Got_type): New enum declaration.
13928 (Target_i386::Scan::local): Updated callers of Output_data_got
13929 member functions.
13930 (Target_i386::Scan::global): Likewise.
13931 (Target_i386::Relocate::relocate): Likewise.
13932 (Target_i386::Relocate::relocate_tls): Likewise.
13933 * object.h (Got_offset_list): New class.
13934 (Sized_relobj::local_has_got_offset): Added got_type parameter.
13935 (Sized_relobj::local_got_offset): Likewise.
13936 (Sized_relobj::set_local_got_offset): Likewise.
13937 (Sized_relobj::local_has_tls_got_offset): Removed.
13938 (Sized_relobj::local_tls_got_offset): Removed.
13939 (Sized_relobj::set_local_tls_got_offset): Removed.
13940 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
13941 * output.cc (Output_data_got::add_global): Added got_type parameter.
13942 (Output_data_got::add_global_with_rel): Likewise.
13943 (Output_data_got::add_global_with_rela): Likewise.
13944 (Output_data_got::add_global_pair_with_rel): New function.
13945 (Output_data_got::add_global_pair_with_rela): New function.
13946 (Output_data_got::add_local): Added got_type parameter.
13947 (Output_data_got::add_local_with_rel): Likewise.
13948 (Output_data_got::add_local_with_rela): Likewise.
13949 (Output_data_got::add_local_pair_with_rel): New function.
13950 (Output_data_got::add_local_pair_with_rela): New function.
13951 (Output_data_got::add_global_tls): Removed.
13952 (Output_data_got::add_global_tls_with_rel): Removed.
13953 (Output_data_got::add_global_tls_with_rela): Removed.
13954 (Output_data_got::add_local_tls): Removed.
13955 (Output_data_got::add_local_tls_with_rel): Removed.
13956 (Output_data_got::add_local_tls_with_rela): Removed.
13957 * output.h (Output_data_got::add_global): Added got_type parameter.
13958 (Output_data_got::add_global_with_rel): Likewise.
13959 (Output_data_got::add_global_with_rela): Likewise.
13960 (Output_data_got::add_global_pair_with_rel): New function.
13961 (Output_data_got::add_global_pair_with_rela): New function.
13962 (Output_data_got::add_local): Added got_type parameter.
13963 (Output_data_got::add_local_with_rel): Likewise.
13964 (Output_data_got::add_local_with_rela): Likewise.
13965 (Output_data_got::add_local_pair_with_rel): New function.
13966 (Output_data_got::add_local_pair_with_rela): New function.
13967 (Output_data_got::add_global_tls): Removed.
13968 (Output_data_got::add_global_tls_with_rel): Removed.
13969 (Output_data_got::add_global_tls_with_rela): Removed.
13970 (Output_data_got::add_local_tls): Removed.
13971 (Output_data_got::add_local_tls_with_rel): Removed.
13972 (Output_data_got::add_local_tls_with_rela): Removed.
13973 * resolve.cc (Symbol::override_base_with_special): Removed
13974 reference to has_got_offset_ field.
13975 * symtab.cc (Symbol::init_fields): Replaced initialization
13976 of got_offset_ with got_offsets_. Removed initialization
13977 of has_got_offset_
53fcba31 13978 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
13979 (Symbol::got_offset): Likewise.
13980 (Symbol::set_got_offset): Likewise.
13981 (Symbol::has_tls_got_offset): Removed.
13982 (Symbol::tls_got_offset): Removed.
13983 (Symbol::set_tls_got_offset): Removed.
13984 (Symbol::got_offset_): Removed.
13985 (Symbol::tls_mod_got_offset_): Removed.
13986 (Symbol::tls_pair_got_offset_): Removed.
13987 (Symbol::got_offsets_): New field.
13988 (Symbol::has_got_offset): Removed.
13989 (Symbol::has_tls_mod_got_offset): Removed.
13990 (Symbol::has_tls_pair_got_offset): Removed.
13991 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
13992 (Target_x86_64::Scan::local): Updated callers of Output_data_got
13993 member functions.
13994 (Target_x86_64::Scan::global): Likewise.
13995 (Target_x86_64::Relocate::relocate): Likewise.
13996 (Target_x86_64::Relocate::relocate_tls): Likewise.
13997
bd52eafb
BE
139982008-03-25 Ben Elliston <bje@au.ibm.com>
13999
14000 * yyscript.y: Fix spelling error in comment.
14001
8b105e34
ILT
140022008-03-24 Ian Lance Taylor <iant@google.com>
14003
8ed814a9
ILT
14004 * options.h (class General_options): Define build_id option.
14005 * layout.h (class Layout): Declare write_build_id, create_note,
14006 create_build_id. Add build_id_note_ member.
14007 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
14008 "libiberty.h", "md5.h", "sha1.h".
14009 (Layout::Layout): Initialize eh_frame_data_,
14010 eh_frame_hdr_section_, and build_id_note_.
14011 (Layout::finalize): Call create_build_id.
14012 (Layout::create_note): New function, broken out of
14013 Layout::create_gold_note.
14014 (Layout::create_gold_note): Call create_note.
14015 (Layout::create_build_id): New function.
14016 (Layout::write_build_id): New function.
14017 (Close_task_runner::run): Call write_build_id.
14018
8b105e34
ILT
14019 * x86_64.cc: Correct license to GPLv3.
14020
086a1841
ILT
140212008-03-23 Ian Lance Taylor <iant@google.com>
14022
14023 * options.cc: Include "demangle.h".
14024 (parse_optional_string): New function.
14025 (parse_long_option): Handle takes_optional_argument.
14026 (parse_short_option): Update dash_z initializer. Handle
14027 takes_optional_argument.
14028 (General_options::General_options): Initialize do_demangle_.
14029 (General_options::finalize): Set do_demangle_. Handle demangling
14030 style.
14031 * options.h (parse_optional_string): Declare.
14032 (struct One_option): Add optional_arg field. Update constructor.
14033 Update call constructor calls. Add takes_optional_argument
14034 function.
14035 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
14036 (DEFINE_optional_string): Define.
14037 (General_options::demangle): Change from DEFINE_bool to
14038 DEFINE_optional_string.
14039 (General_options::no_demangle): New function.
14040 (General_options::do_demangle): New function.
14041 (General_options::set_do_demangle): New function.
14042 (General_options::execstack_status_): Move definition to end of
14043 class definition.
14044 (General_options::static_): Likewise.
14045 (General_options::do_demangle_): New field.
14046 * object.cc (big_endian>::get_symbol_location_info): Call
14047 Options::do_demangle, not Options::demangle.
14048 * symtab.cc (demangle): Likewise.
14049
cbb93e63
ILT
140502008-03-22 Ian Lance Taylor <iant@google.com>
14051
14052 * gold.h: Include <cstddef> and <sys/types.h>
14053 * options.h: Include <cstring>.
14054
ec531623
ILT
140552008-03-21 Ian Lance Taylor <iant@google.com>
14056
14057 * Added source code to GNU binutils.
This page took 0.849141 seconds and 4 git commands to generate.