gdb.ada/lang_switch: Allow msg parameter to be a reference.
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
aba6bc71
AM
12012-12-07 Alan Modra <amodra@gmail.com>
2
3 * options.h (General_options): Add no_toc_optimize.
4 * powerpc.cc (ok_lo_toc_insn): New function.
5 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
6
9e69ed50
AM
72012-12-06 Alan Modra <amodra@gmail.com>
8
9 * options.h (General_options): Add plt_align, plt_static_chain,
10 plt_thread_safe. Update stub_group_size help text.
11 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
12 for new plt_thread_safe_ var.
13 (use_plt_offset): Correct comments.
14 (Target_powerpc::do_relax): Look for thread creation symbols to
15 determine default plt_thread_safe value. Clear plt call stubs
16 as well as branch stubs each iteration.
17 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
18 insn constants.
19 (l, hi, ha, write_insn): Move earlier.
20 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
21 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
22 plt stubs too.
23 (Stub_table::update_size): Adjust.
24 (Stub_table::prev_size, set_prev_size): Delete.
25 (Stub_table::stub_align): Let --plt-align affect result.
26 (Stub_table::plt_call_size): Calculate sizes for various stubs.
27 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
28 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
29 (Stub_table::do_write): Support more stub variants.
30
f43ba157
AM
312012-12-04 Alan Modra <amodra@gmail.com>
32
33 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
34 (Target_powerpc::do_define_standard_symbols): New function.
35
34171bc5
AM
362012-12-03 Alan Modra <amodra@gmail.com>
37
38 * output.h: Formatting, whitespace.
39
dc9589e9 402012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
41
42 * layout.h (Layout::get_executable_sections): Declare.
43 * layout.cc (Layout::get_executable_sections): New function.
44 * arm.cc (Target_arm::group_sections): Use it.
45 (Arm_output_section::group_sections): Delete now redundant test.
46 * output.cc (Output_reloc::Output_reloc): Add is_relative.
47 param to handle relative relocs.
48 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
49 (Output_data_reloc::add_absolute): Adjust.
50 (Output_data_reloc::add_relative): New function.
51 (Output_data::reset_data_size): New function.
52 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
53 (Output_section::set_addralign): New function.
54 (Output_section::checkpoint_set_addralign): New function.
55 (Output_section::clear_section_offsets_need_adjustment): New function.
56 (Output_section::input_sections): Make public.
57 * powerpc.cc (class Output_data_brlt_powerpc): New.
58 (class Stub_table, class Stub_control): New.
59 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
60 stub_table_, set_stub_table, stub_table): New vectors and accessor
61 functions.
62 (Target_powerpc::do_may_relax, do_relax, push_branch,
63 new_stub_table, stub_tables, brlt_section, group_sections,
64 add_branch_lookup_table, find_branch_lookup_table,
65 write_branch_lookup_table, make_brlt_section): New functions.
66 (Target_powerpc::struct Sort_sections, class Branch_info): New.
67 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
68 branch_info_): New vars.
69 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
70 make call stubs here.
71 (Output_data_glink): Remove all call stub handling from this class.
72 (Target_powerpc::Scan::local, global): Save interesting branch
73 relocs and relocs for ifunc. Adjust calls to plt entry functions.
74 (Target_powerpc::do_finalize_sections): Only make reg save/restore
75 functions on final link.
76 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
77 Handle long branch destinations too.
78 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
79 do_plt_address_for_local): Adjust lookup of plt call stubs.
80
627b30b7
AM
812012-11-30 Alan Modra <amodra@gmail.com>
82
83 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
84 relocs against protected symbols when building 32-bit shared libs.
85
40b469d7
AM
862012-11-30 Alan Modra <amodra@gmail.com>
87
88 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
89 param. Call got_section() to make .got. Update all callers
90 and their callers and so on.
91
bb66a627
AM
922012-11-30 Alan Modra <amodra@gmail.com>
93
94 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
95 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
96 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
97 value if it already exists.
98
d2cf1c6c
L
992012-11-19 H.J. Lu <hongjiu.lu@intel.com>
100
101 PR gold/14858
102 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
103
edccdf7c
RM
1042012-11-14 Roland McGrath <mcgrathr@google.com>
105
106 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
107 than bfc instruction for data sandboxing.
108
6febeb74
AM
1092012-11-08 Alan Modra <amodra@gmail.com>
110
111 * po/POTFILES.in: Regenerate.
112
0a6f1bf2
AM
1132012-11-05 Alan Modra <amodra@gmail.com>
114
115 * configure.ac: Apply 2012-09-10 change to config.in here.
116 * configure: Regenerate.
117
26a4e9cb
AM
1182012-11-05 Alan Modra <amodra@gmail.com>
119
120 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
121 (struct Opd_ent): Use "Address" rather than "Offset".
122 (Output_data_got_powerpc::got_base_offset): Return Valtype.
123 (Target_powerpc::got_section): Make public.
124 (Target_powerpc::scan_relocs): Move code setting symbols..
125 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
126 Create _SDA_BASE_ only when referenced.
127
cc928013
RM
1282012-11-02 Roland McGrath <mcgrathr@google.com>
129
130 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
131 from last change.
132
50ed5eb1
RM
1332012-11-01 Roland McGrath <mcgrathr@google.com>
134
62fe925a
RM
135 * target.h (Sized_target::relocate_relocs): Use Elf_Off
136 for offset_in_output_section parameter.
137 (Sized_target::relocate_special_relocatable): Likewise.
138 * arm.cc (Target_arm::relocate_relocs): Likewise.
139 (Target_arm::relocate_special_relocatable): Likewise.
140 * i386.cc (Target_i386::relocate_relocs): Likewise.
141 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
142 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
143 * target-reloc.h (relocate_relocs): Likewise.
144 * testsuite/testfile.cc (Target_test): Likewise.
145 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
146 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
147
148 * system.h: Move inclusion of <clocale> to after <libintl.h> in
149 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
150
151 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
152 parameter, which is unused in the [!F_SETFD] case.
153
50ed5eb1
RM
154 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
155 SYMNDX to off_t before comparing it to this->data_size().
156 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
157 * incremental.cc (Output_section_incremental_inputs::do_write):
158 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
159
2cadc0bf
RM
160 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
161
3bfcb652
NC
1622012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
163
164 * gold.cc (Target_arm::do_adjust_elf_header): Add the
165 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
166 in EABI_VER5.
167
c1a8d56e
CC
1682012-10-29 Cary Coutant <ccoutant@google.com>
169
170 * dwp.cc (usage): Add file and exit status parameters;
171 add --help and --version options.
172 (print_version): New function.
173 (main): Add --help and --version options.
174
b2490a7b
L
1752012-10-25 H.J. Lu <hongjiu.lu@intel.com>
176
177 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
178 final_layout_sequence.txt.
179 * testsuite/Makefile.in: Regenerated.
180
aa543512
L
1812012-10-25 H.J. Lu <hongjiu.lu@intel.com>
182
183 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
184 COMPILE generated by automake.
185 (LINK1): Likewise.
186 (CXXCOMPILE1): Likewise.
187 (CXXLINK1): Likewise.
188 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
189 (LINK): Likewise.
190 (CXXCOMPILE): Likewise.
191 (CXXLINK): Likewise.
192 * testsuite/Makefile.in: Regenerated.
193
d361fafb
L
1942012-10-25 H.J. Lu <hongjiu.lu@intel.com>
195
196 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
197 on bad fwrite return.
198
598c7410
L
1992012-10-25 H.J. Lu <hongjiu.lu@intel.com>
200
201 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
202 on val.
203
35c813e2
CC
2042012-10-23 Cary Coutant <ccoutant@google.com>
205
206 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
207 * testsuite/Makefile.in: Regenerate.
208 * testsuite/dwp_test.h: New source file.
209 * testsuite/dwp_test_1.cc: New source file.
210 * testsuite/dwp_test_1.s: New source file.
211 * testsuite/dwp_test_1.sh: New source file.
212 * testsuite/dwp_test_1b.cc: New source file.
213 * testsuite/dwp_test_1b.s: New source file.
214 * testsuite/dwp_test_2.cc: New source file.
215 * testsuite/dwp_test_2.s: New source file.
216 * testsuite/dwp_test_2.sh: New source file.
217 * testsuite/dwp_test_main.cc: New source file.
218 * testsuite/dwp_test_main.s: New source file.
219
77429909
CC
2202012-10-23 Cary Coutant <ccoutant@google.com>
221
222 * dwp.h: New header file.
223 * dwp.cc: New source file.
224 * gold.h: Move shared declarations to system.h.
225 * system.h: New header file.
226 * Makefile.am: Add dwp.
227 * Makefile.in: Regenerate.
228
ed5d6712
CC
2292012-10-23 Cary Coutant <ccoutant@google.com>
230
231 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
232 Dwarf_info_reader::read_from_pointer.
233 (Dwarf_pubnames_table::read_header): Likewise.
234 (Dwarf_pubnames_table::next_name): Likewise.
235 (Dwarf_die::read_attributes): Likewise.
236 (Dwarf_die::skip_attributes): Likewise.
237 (Dwarf_info_reader::read_from_pointer): New function template.
238 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
239 (Dwarf_pubnames_table): Likewise.
240 (Dwarf_info_reader::read_from_pointer): New function template.
241 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
242 Dwarf_pubnames_table ctor.
243
8787852d
CC
2442012-10-23 Cary Coutant <ccoutant@google.com>
245
246 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
247 abbrev_shndx.
248 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
249 abbrev_shndx_.
250 (Dwarf_info_reader::set_abbrev_shndx): New method.
251 (Dwarf_info_reader::abbrev_shndx_): New data member.
252
9fc236f3
CC
2532012-10-23 Cary Coutant <ccoutant@google.com>
254
255 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
256 from object, not parameters.
257 (Dwarf_info_reader::parse): Likewise.
258 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
259 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
260 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
261 methods.
262
effe8365
CC
2632012-10-23 Cary Coutant <ccoutant@google.com>
264
265 * fileread.cc (Input_file::Input_file): New constructor.
266 * fileread.h (class Input_file): Add new constructor.
267
1698990d
AM
2682012-10-18 Alan Modra <amodra@gmail.com>
269
270 PR gold/14727
271 * object.cc (Relobj::is_section_name_included): Also match
272 .sdata personality section.
273
168a4726
AM
2742012-10-18 Alan Modra <amodra@gmail.com>
275
276 * target-reloc.h (class Default_comdat_behavior): New, package up..
277 (get_comdat_behaviour): ..this.
278 (relocate_section): Add Relocate_comdat_behavior template arg,
279 adjust code to suit.
280 * arm.cc (Target_arm::relocate_section): Adjust to suit.
281 (Target_arm::scan_reloc_section): Likewise.
282 * i386.cc (Target_i386::relocate_section): Likewise.
283 * sparc.cc (Target_sparc::relocate_section): Likewise.
284 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
285 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
286 * powerpc.cc (class Relocate_comdat_behavior): New.
287 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
288 gold::relocate_section with new template arg.
289
acc276d8
AM
2902012-10-18 Alan Modra <amodra@gmail.com>
291
292 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
293 dynamic relocs for GOT_TPREL got entries, without symbol if
294 resolving locally.
295 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
296 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
297 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
298
e10f9870
AM
2992012-10-17 Alan Modra <amodra@gmail.com>
300
301 PR gold/14726
302 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
303
ae034989
ST
3042012-10-16 Sriraman Tallam <tmsriram@google.com>
305
306 * layout.cc (Layout::include_section): Keep sections marked
307 SHF_EXCLUDE when doing relocatable links.
308
f3a0ed29
AM
3092012-10-16 Alan Modra <amodra@gmail.com>
310
311 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
312 (Target_powerpc::do_finalize_sections): Call it.
313 (Output_data_save_res): New class and supporting functions.
314 (Target_powerpc::symval_for_branch): Only look up .opd entry for
315 normal symbols defined in object files.
316
c6de8ed4
AM
3172012-10-12 Alan Modra <amodra@gmail.com>
318
319 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
320 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
321 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
322 section if scan_opd_relocs not yet called.
323 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
324
03e25981
AM
3252012-10-12 Alan Modra <amodra@gmail.com>
326
327 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
328 add_local_ifunc_entry): Revert last change.
329 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
330
c9824451
AM
3312012-10-05 Alan Modra <amodra@gmail.com>
332
333 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
334 do_plt_address_for_global): New functions.
335 (Output_data_got_powerpc::do_write): Don't segfault when linking
336 statically.
337 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
338 add_local_ifunc_entry): Return true on adding entry..
339 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
340 glink->add_entry call. Remove unused symtab param. Adjust calls.
341 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
342 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
343 set up symbols here.
344 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
345 syms here. Do so even when no .iplt. Don't segfault when linking
346 statically.
347 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
348 new variants without reloc param.
349 (Glink_sym_ent::Glink_sym_ent): Likewise.
350 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
351 reloc when refs will resolve to plt call stub.
352 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
353 R_PPC_PLTREL24 to resolve locally.
354 (Target_powerpc::Scan::global): Correct ifunc handling.
355 (Target_powerpc::Relocate::relocate): Correct local sym glink
356 lookup. Don't destroy "value" when we have a plt call stub,
357 and when checking plt call validity.
358 (Target_powerpc::do_dynsym_value): Simplify.
359
19fec8c1
AM
3602012-10-05 Alan Modra <amodra@gmail.com>
361
362 * i386.cc (Output_data_plt_i386::address_for_global,
363 address_for_local): Add plt offset to returned value. Adjust uses.
364 * sparc.cc (Output_data_plt_sparc::address_for_global,
365 address_for_local): Likewise.
366 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
367 address_for_local): Likewise.
368 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
369 address_for_local): Likewise.
370 * target.h (Target::plt_address_for_global, plt_address_for_local):
371 Update comment.
372 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
373 (Output_data_got::Got_entry::write): Nor here.
374 * output.h: Comment fix.
375
e867b647
WL
3762012-10-02 Jiong Wang <jiwang@tilera.com>
377
378 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
379 global_offset_table_ value for larget got.
380 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
381
e5d5f5ed
AM
3822012-09-29 Alan Modra <amodra@gmail.com>
383
384 * powerpc.cc (Target_powerpc::iplt_): New output section.
385 (Target_powerpc::iplt_section, make_iplt_section,
386 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
387 (Target_powerpc::make_plt_entry): Handle ifunc syms.
388 Target_powerpc::plt_entry_count): Count iplt entries too.
389 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
390 reloc section in constructor. New params.
391 (Target_powerpc::make_plt_section): Create reloc section here instead.
392 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
393 functions.
394 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
395 (Output_data_glink::add_entry, find_entry): New functions to
396 deal with local syms.
397 (Glink_sym_ent): Add support for local syms.
398 (Output_data_glink::do_write): Handle ifunc plt entries.
399 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
400 (Target_powerpc::Scan::local, global): Handle ifunc syms.
401 (Target_powerpc::Relocate::relocate): Likewise.
402 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
403
ec4dbad3
AM
4042012-09-25 Alan Modra <amodra@gmail.com>
405
406 * object.h (Sized_relobj_file::adjust_local_symbol,
407 do_adjust_local_symbol): New functions.
408 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
409 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
410 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
411 and irregular opd entry spacing.
412 (Powerpc_relobj::do_read_relocs): Add opd size checks.
413 (Global_symbol_visitor_opd): New functor.
414 (Target_powerpc::do_finalize_sections): Omit global symbols defined
415 on deleted opd entries.
416
5c0b3823
WL
4172012-09-15 Jiong Wang <jiwang@tilera.com>
418
419 * tilegx.cc: New file.
420 * Makefile.am (TARGETSOURCES): Add tilegx.cc
421 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
422 * configure.tgt: Add entries for tilegx*.
423 * configure.ac: Likewise.
424 * Makefile.in: Rebuild.
425 * configure: Likewise.
426 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
427 tilegx.
428
bfdfa4cd
AM
4292012-09-13 Alan Modra <amodra@gmail.com>
430
431 * target-reloc.h (scan_relocs): Call scan.local for relocs
432 against symbols in discarded sections. Pass is_discarded
433 param.
434 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
435 Add is_discarded param.
436 * powerpc (Target_powerpc::Scan::local): Likewise. Use
437 is_discarded to flag opd entry as discarded. Don't emit dyn
438 relocs on such entries.
439 (Target_powerpc::Scan::global): Similarly detect and handle
440 such opd entries.
441 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
442 opd_ent_. Update all uses.
443 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
444 (Target_powerpc::relocate_section): Zero out discarded opd
445 entry relocs.
446
d77a0555
ILT
4472012-09-12 Ian Lance Taylor <iant@google.com>
448
449 PR gold/14570
450 * output.cc: Rename Output_data_got template parameter from size
451 to got_size for all functions. Compile all variants of
452 Output_data_got.
453 (Output_data_got::Got_entry::write): Correct use of size for
454 symbol value. Use local_is_tls rather than casting to
455 Sized_relobj_file.
456 * object.h (class Object): Add local_is_tls and do_local_is_tls.
457 (class Sized_relobj_file): Add do_local_is_tls.
458 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
459
815a1205
AM
4602012-09-11 Alan Modra <amodra@gmail.com>
461
462 PR gold/14566
463 * layout.cc (Layout::set_segment_offsets): When using
464 common-page-size alignment, ensure we are on a new max-page-size
465 page.
466 * output.cc (Output_segment::set_section_addresses): Use
467 abi_pagesize, not common_pagesize for relro boundary.
468 (Output_segment::set_offset): Likewise.
469
bd73a62d
AM
4702012-09-11 Alan Modra <amodra@gmail.com>
471
472 * output.h (Output_data_got::add_global_tls, add_local_tls,
473 add_local_tls_pair): New functions.
474 (Output_data_got::add_local_pair_with_rel): Remove second
475 reloc param. Expand comment.
476 (Output_data_got::Got_entry): Rename use_plt_offset_ to
477 use_plt_or_tls_offset_, similarly for constructor param.
478 (Output_data_got::Got_entry::write): Add got_index param.
479 * output.cc (Output_data_got::add_global_tls, add_local_tls,
480 add_local_tls_pair): New functions.
481 (Output_data_got::Got_entry::write): Handle tls symbols
482 with use_plt_or_tls_offset_ set specially.
483 (Output_data_got::add_local_pair_with_rel): Only one reloc.
484 (Output_data_got::do_write): Replace iterator with index, pass
485 index to entry write function.
486 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
487 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
488 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
489 call.
490 * i386.cc (Target_i386::Scan::local): Likewise.
491 * sparc.cc (Target_sparc::Scan::local): Likewise.
492 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
493 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
494 do_tls_offset_for_global): New functions.
495 (Target_powerpc::Scan::local): Correct TLS relocations and got
496 entry values.
497 (Target_powerpc::Scan::global): Don't emit unnecessary
498 dynamic relocations on TLS GOT entries.
499
00716ab1
AM
5002012-09-10 Matthias Klose <doko@ubuntu.com>
501
502 * config.in: Disable sanity check for kfreebsd.
503
c891b3f9
SA
5042012-09-10 Sterling Augustine <saugustine@google.com>
505
506 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
507 (Gdb_index::pubtypes_read): New parameter.
508 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
509 to calls.
510 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
511 pubtypes_object_.
512
e81fea4d
AM
5132012-09-09 Alan Modra <amodra@gmail.com>
514
515 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
516 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
517 * gc.h (gc_process_relocs): Call target gc_add_reference.
518 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
519 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
520 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
521 unnecessary cast.
522 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
523 to cater for when we don't need code offset. Update use.
524 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
525 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
526 set_opd_valid): New functions.
527 (Target_powerpc::do_gc_add_reference): New function.
528 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
529 stashed refs.
530 (Target_powerpc::do_gc_mark_symbol): New function.
531
d2d60eef
CC
5322012-09-06 Cary Coutant <ccoutant@google.com>
533
534 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
535 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
536 (Dwarf_die::skip_attributes): Likewise.
537 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
538 * testsuite/gdb_index_test.cc (inline_func_1): New function.
539 (main): Call it.
540 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
541
32ed4573
L
5422012-09-05 H.J. Lu <hongjiu.lu@intel.com>
543
544 * testsuite/script_test_3.t: Add .got.plt output section
545 statement.
546 * testsuite/script_test_4.t: Likewise.
547
f4baf0d4
AM
5482012-09-05 Alan Modra <amodra@gmail.com>
549
550 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
551 update all uses and lose "enum" when using type.
552
864a1b56
AM
5532012-09-05 Alan Modra <amodra@gmail.com>
554
555 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
556 * configure: Regenerate.
557 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
558 (plugin_final_layout.stdout): Likewise.
559 (memory_test): Set page sizes to 0x1000.
560 * testsuite/Makefile.in: Regenerate.
561 * testsuite/discard_locals_test.sh: Add FIXME comment.
562 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
563 * testsuite/pr14265.t: Add .got output section statement.
564 * testsuite/script_test_2.t: Likewise.
565 * testsuite/script_test_3.t: Likewise.
566 * testsuite/script_test_4.t: Likewise.
567 * testsuite/script_test_5.t: Likewise.
568 * testsuite/script_test_6.t: Likewise.
569 * testsuite/script_test_7.t: Likewise.
570 * testsuite/script_test_9.t: Likewise.
571
3ea0a085
AM
5722012-09-05 Alan Modra <amodra@gmail.com>
573
574 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
575 (Powerpc_relocate_functions::Status): New typedef.
576 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
577 (Target_powerpc::Scan::local): Handle REL64.
578 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
579 for REL32 and REL64.
580 (Target_powerpc::symval_for_branch): New function, extracted from..
581 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
582 checks. Report overflow errors.
583
7404fe1b
AM
5842012-09-05 Alan Modra <amodra@gmail.com>
585
586 * object.h (Sized_relobj_file::emit_relocs): Delete.
587 (Sized_relobj_file::emit_relocs_reltype): Delete.
588 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
589 relocate_relocs for --emit-relocs.
590 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
591 * output.h: Update comment.
592 (Output_segment::first_section): New function.
593 (Output_segment::first_section_load_address): Use first_section.
594 * output.cc (Output_segment::first_section): New function extracted..
595 (Output_segment::first_section_load_address): ..from here. Delete.
596 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
597 * target.h (Sized_target::relocate_for_relocatable): Likewise.
598 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
599 adjust call to target.h function.
600 * i386.cc (Target_i386): Likewise.
601 * sparc.cc (Target_sparc): Likewise.
602 * x86_64.cc (Target_x86_64): Likewise.
603 * powerpc.cc (Target_powerpc): Likewise.
604 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
605 first tls section has section symbol for optimised local dynamic
606 output relocs.
607 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
608 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
609 optimised tls code.
610 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
611 Rename to relocate_relocs. Update error message.
612
957564c9
AS
6132012-09-04 Andreas Schwab <schwab@linux-m68k.org>
614
615 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
616 --just-symbols.
617
dd93cd0a
AM
6182012-08-31 Alan Modra <amodra@gmail.com>
619
620 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
621 (Powerpc_relobj::toc_base_offset): New stub function.
622 (Target_powerpc): Add tp_offset, dtp_offset. Rename
623 got_mod_index_offset to tlsld_got_offset. Update all refs.
624 (Target_powerpc::Relocate::enum skip_tls): New.
625 (Target_powerpc::call_tls_get_addr_): New var.
626 (Target_powerpc::is_branch_reloc): Move to file scope.
627 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
628 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
629 New functions.
630 (Target_powerpc::enum Got_type): Delete old values, add new ones.
631 (powerpc_info): Correct common_pagesize for ppc64.
632 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
633 (Powerpc_relocate_functions): Add overflow check enums and functions.
634 Add non-shift version of rela, rela_ua. Delete all rel public
635 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
636 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
637 addr16_ha3, addr14 functions.
638 (Output_data_got_powerpc::add_constant_pair): New function.
639 (Output_data_got_powerpc::got_base_offset): Likewise.
640 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
641 (instruction constants): Sort, add some more.
642 (Output_data_glink::do_write): Add and use Address typedef. Use
643 object->toc_base_offset() stub for 64-bit.
644 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
645 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
646 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
647 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
648 Always treat .opd relocs as against locally defined symbol.
649 Correct condition for RELATIVE relocs.
650 (Target_powerpc::do_finalize_sections): Test for NULL sections.
651 (Target_powerpc::Relocate::relocate): Use plt call stub as value
652 for 32-bit syms with a plt entry. Correct ppc64 toc base
653 calculations. Handle TLS relocs, and more. Add overflow
654 checking and adjust for Powerpc_relocate_functions changes.
655 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
656 Reinstate --emit-relocs code with FIXME.
657
a1373b60
AM
6582012-08-30 Alan Modra <amodra@gmail.com>
659
660 * layout.cc (Layout::set_segment_offsets): Set p_align to
661 abi_pagesize, not common_pagesize.
662 (Layout::relaxation_loop_body): Similarly use abi_pagesize
663 to determine whether file header can go in segment.
664
703d02da
AM
6652012-08-30 Alan Modra <amodra@gmail.com>
666
667 * output.h (Output_reloc::Output_reloc <output section>): Add
668 is_relative param. Adjust calls.
669 (Output_reloc::add_output_section_relative): New functions.
670 * output.cc (Output_reloc::Output_reloc <output section>): Handle
671 is_relative.
672 (Output_reloc::symbol_value): Handle SECTION_CODE.
673
16164a6b
ST
6742012-08-24 Sriraman Tallam <tmsriram@google.com>
675
676 * gold.cc (queue_middle_tasks): Call layout again when unique
677 segments for sections is desired.
678 * layout.cc (Layout::Layout): Initialize new members.
679 (Layout::get_output_section_flags): New function.
680 (Layout::choose_output_section): Call get_output_section_flags.
681 (Layout::layout): Make output section for mapping to a unique segment.
682 (Layout::insert_section_segment_map): New function.
683 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 684 output sections marked so.
16164a6b
ST
685 (Layout::segment_precedes): Check for unique segments when sorting.
686 * layout.h (Layout::Unique_segment_info): New struct.
687 (Layout::Section_segment_map): New typedef.
688 (Layout::insert_section_segment_map): New function.
689 (Layout::get_output_section_flags): New function.
690 (Layout::is_unique_segment_for_sections_specified): New function.
691 (Layout::set_unique_segment_for_sections_specified): New function.
692 (Layout::unique_segment_for_sections_specified_): New member.
693 (Layout::section_segment_map_): New member.
694 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
695 Rename is_gc_pass_one to is_pass_one.
696 Rename is_gc_pass_two to is_pass_two.
697 Rename is_gc_or_icf to is_two_pass.
698 Check for which pass based on whether symbols data is present.
699 Make it two pass when unique segments for sections is desired.
700 * output.cc (Output_section::Output_section): Initialize new
701 members.
702 * output.h (Output_section::is_unique_segment): New function.
703 (Output_section::set_is_unique_segment): New function.
704 (Output_section::is_unique_segment_): New member.
705 (Output_section::extra_segment_flags): New function.
706 (Output_section::set_extra_segment_flags): New function.
707 (Output_section::extra_segment_flags_): New member.
708 (Output_section::segment_alignment): New function.
709 (Output_section::set_segment_alignment): New function.
710 (Output_section::segment_alignment_): New member.
711 (Output_segment::Output_segment): Initialize is_unique_segment_.
712 (Output_segment::is_unique_segment): New function.
713 (Output_segment::set_is_unique_segment): New function.
714 (Output_segment::is_unique_segment_): New member.
715 * plugin.cc (allow_unique_segment_for_sections): New function.
716 (unique_segment_for_sections): New function.
717 (Plugin::load): Add new functions to transfer vector.
718 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
719 * Makefile.in: Regenerate.
720 * testsuite/plugin_final_layout.sh: Check if unique segment
721 functionality works.
722 * testsuite/plugin_section_order.c (onload): Check if new interfaces
723 are available.
724 (allow_unique_segment_for_sections): New global.
725 (unique_segment_for_sections): New global.
726 (claim_file_hook): Call allow_unique_segment_for_sections.
727 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 728
1e2bee4f
CC
7292012-08-22 Cary Coutant <ccoutant@google.com>
730
731 * layout.cc (Layout::include_section): Don't assert on GROUP
732 sections with --emit-relocs.
733
1d5dfe78
CC
7342012-08-21 Cary Coutant <ccoutant@google.com>
735
736 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
737 if --export-dynamic-symbol names an undef symbol.
738
c9269dff
AM
7392012-08-18 Alan Modra <amodra@gmail.com>
740
741 * powerpc.cc: Formatting and white space.
742 (Powerpc_relobj): Rename got2_section_ to special_.
743 Add opd_ent_shndx_ and opd_ent_off_ vectors.
744 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
745 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
746 (Target_powerpc): Add Address typedef and invalid_address. Use
747 throughout.
748 (Target_powerpc::is_branch_reloc): New function.
749 (Powerpc_relocate_functions): Add Address typedef, use throughout.
750 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
751 for dst_mask, value and addend.
752 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
753 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
754 (Output_data_glink::do_write): Correct toc base. Don't try to use
755 uint16_t for 24-bit offset. Use get_output_section_offset and
756 check return.
757 (Target_powerpc::Scan::local): Handle more relocs.
758 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
759 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
760 Plug in toc restoring insn after plt calls. Translate branches
761 to function descriptor symbols to corresponding entry point.
762 (Target_powerpc::relocate_for_relocatable): Check return from
763 get_output_section_offset.
764 * symtab.h: Comment typo.
765
b1759dce
ILT
7662012-08-14 Ian Lance Taylor <iant@google.com>
767
768 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
769 unsupported_relocal_local to call unsupported_reloc_global.
770
b9b2ae8b
NC
7712012-08-14 Nick Clifton <nickc@redhat.com>
772
773 PR ld/14265
774 * script-sections.cc (Sections_element::output_section_name): Add
775 keep return parameter.
776 (Output_section_element::match_name): Add keep return parameter.
777 Return the value of the keep_ member.
778 * script-sections.h (class Output_section): Update
779 output_section_name prototype.
780 * layout.cc (Layout::keep_input_section): New public member
781 function.
782 (Layout::choose_output_section): Pass keep parameter to
783 output_section_name.
784 * layout.h (class Layout): Add keep_input_section.
785 * object.cc (Sized_relobj_file::do_layout): Check for kept input
786 sections.
787 * testsuite/Makefile.am: Add a test.
788 * testsuite/Makefile.in: Regenerate.
789 * testsuite/pr14265.c: Source file for the test.
790 * testsuite/pr14265.t: Linker script for the test.
791 * testsuite/pr14265.sh: Shell script for the test.
792
921b5322
AM
7932012-08-14 Alan Modra <amodra@gmail.com>
794
795 * target.h (Target::output_section_name): New function.
796 (Target::do_output_section_name): New function.
797 * layout.cc (Layout::choose_output_section): Call the above.
798 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
799
6ce78956
AM
8002012-08-14 Alan Modra <amodra@gmail.com>
801
802 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
803 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
804 for replace_constant call.
805 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
806 (Output_data_glink::do_print_to_mapfile): New function.
807 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
808 (Target_powerpc::Relocate::relocate): Likewise.
809
d1a8cabd
AM
8102012-08-14 Alan Modra <amodra@gmail.com>
811
812 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
813 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
814 (Output_data_glink::add_entry,find_entry): Remove shndx param.
815 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
816 all references to shndx_. Handle special case for R_PPC_PLTREL24
817 here.
818 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
819 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
820 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
821 here.
822 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
823 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
824
d83ce4e3
AM
8252012-08-12 Alan Modra <amodra@gmail.com>
826
827 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
828 (glink insn constants): Use uint32_t.
829 (Output_data_glink::add_entry): Use insert, not [] operator.
830
cf43a2fe
AM
8312012-08-11 Alan Modra <amodra@gmail.com>
832
833 * object.h (Sized_relobj_file::find_shdr): New function.
834 (Sized_relobj_file::find_special_sections): New function.
835 * object.cc (Sized_relobj_file::find_shdr): New function.
836 (Sized_relobj_file::find_eh_frame): Use find_shdr.
837 (Sized_relobj_file::find_special_sections): New function, split out..
838 (Sized_relobj_file::do_read_symbols): ..from here.
839 * output.h (Output_data_got::replace_constant): New function.
840 (Output_data_got::num_entries): New function.
841 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
842 (Output_data_got::got_offset): Protected rather than private.
843 (Output_data_got::replace_got_entry): New function.
844 * output.cc (Output_data_got::replace_got_entry): New function.
845 * powerpc.cc (class Powerpc_relobj): New.
846 (class Powerpc_relocate_functions): Delete all psymval variants or
847 convert to value,addend type. Delete pcrela, pcrela_unaligned.
848 Implement _ha functions using corresponding _hi function.
849 (Powerpc_relobj::find_special_sections): New function.
850 (Target_powerpc::do_make_elf_object): New function.
851 (class Output_data_got_powerpc): New.
852 (class Output_data_glink): New.
853 (class Powerpc_scan_relocatable_reloc): New.
854 Many more changes througout file.
855
3c892704
NC
8562012-08-09 Nick Clifton <nickc@redhat.com>
857
858 * po/vi.po: Updated Vietnamese translation.
859
82435b3b
ILT
8602012-08-07 Ian Lance Taylor <iant@google.com>
861
862 * layout.cc (Layout::add_target_dynamic_tags): If
863 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
864 plt_rel.
865
a6dc81d2
NC
8662012-07-30 Nick Clifton <nickc@redhat.com>
867
868 * po/gold.pot: Updated template.
869 * po/es.po: Updated Spanish translation.
870
f1415016
CC
8712012-07-18 Cary Coutant <ccoutant@google.com>
872
873 PR gold/14344
874 * configure.ac: Add check for -gpubnames support.
875 * configure: Regenerate.
876 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
877 support; force -gno-pubnames.
878 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
879 support.
880 (gdb_index_test_4): New test.
881 * testsuite/Makefile.in: Regenerate.
882 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
883 * testsuite/gdb_index_test_2.sh: Likewise.
884 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
885 * testsuite/gdb_index_test_4.sh: New script.
886 * testsuite/gdb_index_test_comm.sh: New script with common code;
887 don't look for space after colon.
888
b7fd7c37
ST
8892012-07-16 Sriraman Tallam <tmsriram@google.com>
890
891 * gold.cc (queue_middle_tasks): Update function order only after
892 deferred objects due to plugins are processed.
893
1f3212db
ILT
8942012-07-11 Ian Lance Taylor <iant@google.com>
895
896 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
897 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
898 (Target_arm::scan_reloc_for_stub): Likewise.
899 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
900 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
901 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
902 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
903 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
904
81c82a68
ILT
9052012-07-10 Dodji Seketeli <dodji@redhat.com>
906 Ian Lance Taylor <iant@google.com>
907
908 PR gold/14309
909 * configure.ac: Test whether std::tr1::hash<off_t> works.
910 * gold.h: Add a specialization for std::tr1::hash<off_t> if
911 needed.
912 * output.h (class Output_fill): Add virtual destructor.
913 * configure, config.in: Rebuild.
914
eabc84f4
RM
9152012-06-22 Roland McGrath <mcgrathr@google.com>
916
917 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
918
370e30b6
RÁE
9192012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
920
921 * plugin.cc (Plugin::load): Handle position independent executables.
922
fb1b895d
CC
9232012-06-06 Cary Coutant <ccoutant@google.com>
924
925 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
926 add .debug_macro.
927 (lines_only_debug_sections): Likewise.
928 (gdb_fast_lookup_sections): New static array.
929 (is_gdb_debug_section): Rename formal parameter.
930 (is_lines_only_debug_section): Likewise.
931 (is_gdb_fast_lookup_section): New function.
932 (Layout::include_section): Check for ".zdebug_" prefix; pass
933 section name suffix to is_gdb_debug_section, et al.; check for
934 fast-lookup sections when building .gdb_index.
935 * options.h (--strip-debug-gdb): Update GDB version number.
936
7c0640fa
CC
9372012-06-06 Cary Coutant <ccoutant@google.com>
938
939 * configure.ac: Add check for fallocate.
940 * configure: Regenerate.
941 * config.in: Regenerate.
942
943 * options.h (class General_options): Add --mmap-output-file and
944 --posix-fallocate options.
945 * output.cc: (posix_fallocate): Remove; replace with...
946 (gold_fallocate): New function.
947 (Output_file::map_no_anonymous): Call gold_fallocate.
948 (Output_file::map): Check --mmap-output-file option.
949
2a49eb69
DK
9502012-06-05 Jing Yu <jingyu@google.com>
951
952 * gold.h (textdomain): Add do {} to empty while(0).
953 (bindtextdomain): Likewise.
954
fad072ac
CC
9552012-06-04 Cary Coutant <ccoutant@google.com>
956
957 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
958 has_dynsym_index.
959
8cc69fb6
ST
9602012-05-25 Sriraman Tallam <tmsriram@google.com>
961
962 * symtab.cc (Symbol_table::define_special_symbol):
963 Initialize *poldsym to prevent uninitialized variable errors.
964
1be75daa
CC
9652012-05-23 Cary Coutant <ccoutant@google.com>
966
967 * layout.cc (Layout::section_name_mapping): Add rules to handle
968 exact match on .data.rel.ro.local or .data.rel.ro.
969 (Layout::output_section_name): Check for exact matches.
970
9b689de0
CC
9712012-05-23 Cary Coutant <ccoutant@google.com>
972
973 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
974 more carefully.
975
b24fdbf5
CC
9762012-05-22 Cary Coutant <ccoutant@google.com>
977
978 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
979 object before exporting symbol.
980
e550e1a2
L
9812012-05-21 H.J. Lu <hongjiu.lu@intel.com>
982
983 * testsuite/tls_test.cc: Include "config.h" first.
984 * testsuite/tls_test_c.c: Likewise.
985
df7b86aa
NC
9862012-05-17 Daniel Richard G. <skunk@iskunk.org>
987 Nick Clifton <nickc@redhat.com>
988
989 PR 14072
990 * configure.in: Add check that sysdep.h has been included before
991 any system header files.
992 * configure: Regenerate.
993 * config.in: Regenerate.
994
1007b503
CC
9952012-05-14 Cary Coutant <ccoutant@google.com>
996
997 * layout.cc (Layout::make_output_section): Mark .tdata section
998 as RELRO.
999 * testsuite/relro_test.cc: Add a TLS variable.
1000
fd885f3a
L
10012012-05-10 H.J. Lu <hongjiu.lu@intel.com>
1002
1003 PR gold/14091
1004 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
1005 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
1006 R_X86_64_64.
1007
80f5885c
CC
10082012-05-08 Cary Coutant <ccoutant@google.com>
1009
1010 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
1011 (lines_only_debug_sections): Likewise.
1012
2e702c99
RM
10132012-05-02 Roland McGrath <mcgrathr@google.com>
1014
1015 * nacl.cc: New file.
1016 * nacl.h: New file.
1017 * Makefile.am (CCFILES, HFILES): Add them.
1018 * Makefile.in: Regenerate.
1019 * i386.cc (Output_data_plt_i386_nacl): New class.
1020 (Output_data_plt_i386_nacl_exec): New class.
1021 (Output_data_plt_i386_nacl_dyn): New class.
1022 (Target_i386_nacl): New class.
1023 (Target_selector_i386_nacl): New class.
1024 (target_selector_i386): Use it instead of Target_selector_i386.
1025 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
1026 (Target_x86_64_nacl): New class.
1027 (Target_selector_x86_64_nacl): New class.
1028 (target_selector_x86_64, target_selector_x32): Use it instead of
1029 Target_selector_x86_64.
1030 * arm.cc (Output_data_plt_arm_nacl): New class.
1031 (Target_arm_nacl): New class.
1032 (Target_selector_arm_nacl): New class.
1033 (target_selector_arm, target_selector_armbe): Use it instead of
1034 Target_selector_arm.
1035
1036 * target-select.cc (select_target): Take new Input_file* and off_t
1037 arguments, pass them on to recognize method of selector.
1038 * object.cc (make_elf_sized_object): Update caller.
1039 * parameters.cc (parameters_force_valid_target): Likewise.
1040 * incremental.cc (make_sized_incremental_binary): Likewise.
1041 * target-select.h: Update decl.
1042 (Target_selector::recognize): Take new Input_file* argument,
1043 pass it on to do_recognize.
1044 (Target_selector::do_recognize): Take new Input_file* argument.
1045 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
1046 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
1047 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
1048 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
1049
1050 * target.h (Target::Target_info): New members isolate_execinstr
1051 and rosegment_gap.
1052 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
1053 * arm.cc (Target_arm::arm_info): Update initializer.
1054 * i386.cc (Target_i386::i386_info): Likewise.
1055 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
1056 * sparc.cc (Target_sparc::sparc_info): Likewise.
1057 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
1058 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1059 * layout.cc (Layout::attach_allocated_section_to_segment):
1060 Take new const Target* argument. If target->isolate_execinstr(), act
1061 like --rosegment.
1062 (Layout::find_first_load_seg): Take new const Target* argument;
1063 if target->isolate_execinstr(), reject PF_X segments.
1064 (Layout::relaxation_loop_body): Update caller.
1065 (Layout::set_segment_offsets): If target->isolate_execinstr(),
1066 reset file offset to zero when we hit LOAD_SEG, and then do a second
1067 loop over the segments before LOAD_SEG to reassign offsets after
1068 addresses have been determined. Handle target->rosegment_gap().
1069 (Layout::attach_section_to_segment): Take new const Target* argument;
1070 pass it to attach_allocated_section_to_segment.
1071 (Layout::make_output_section): Update caller.
1072 (Layout::attach_sections_to_segments): Take new const Target* argument;
1073 pass it to attach_section_to_segment.
1074 * gold.cc (queue_middle_tasks): Update caller.
1075 * layout.h (Layout): Update method decls with new arguments.
1076
1077 * arm.cc (Target_arm::Target_arm): Take optional argument for the
1078 Target_info pointer to use.
1079 (Target_arm::do_make_data_plt): New virtual method.
1080 (Target_arm::make_data_plt): New method that calls it.
1081 (Target_arm::make_plt_entry): Use it.
1082 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
1083 for the section alignment.
1084 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
1085 method.
1086 (Output_data_plt_arm::first_plt_entry_offset): Call it.
1087 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
1088 method.
1089 (Output_data_plt_arm::get_plt_entry_size): Call it.
1090 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
1091 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
1092 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
1093 method.
1094 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
1095 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
1096 method instead of sizeof(plt_entry).
1097 (Output_data_plt_arm::add_entry): Likewise.
1098 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
1099 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
1100 than static method.
1101 (Target_arm::plt_entry_size): Likewise.
1102 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
1103 Move to ...
1104 (Output_data_plt_arm_standard): ... here, new class.
1105 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
1106 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
1107 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
1108
1109 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
1110 Take additional argument for the PLT entry size.
1111 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
1112 Use get_plt_entry_size method rather than plt_entry_size variable.
1113 (Output_data_plt_x86_64::reserve_slot): Likewise.
1114 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
1115 (Output_data_plt_x86_64::add_entry): Likewise.
1116 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
1117 (Output_data_plt_x86_64::address_for_global): Likewise.
1118 (Output_data_plt_x86_64::address_for_local): Likewise.
1119 (Output_data_plt_x86_64::set_final_data_size): Likewise.
1120 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
1121 Make method non-static.
1122 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
1123 method.
1124 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
1125 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
1126 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
1127 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
1128 virtual method.
1129 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
1130 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
1131 virtual method.
1132 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
1133 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
1134 virtual method.
1135 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
1136 (Output_data_plt_x86_64::plt_entry_size)
1137 (Output_data_plt_x86_64::first_plt_entry)
1138 (Output_data_plt_x86_64::plt_entry)
1139 (Output_data_plt_x86_64::tlsdesc_plt_entry)
1140 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
1141 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
1142 (Output_data_plt_x86_64_standard): ... here, new class.
1143 (Target_x86_64::Target_x86_64): Take optional argument for the
1144 Target_info pointer to use.
1145 (Target_x86_64::do_make_data_plt): New virtual method.
1146 (Target_x86_64::make_data_plt): New method to call it.
1147 (Target_x86_64::init_got_plt_for_update): Use that.
1148 Call this->plt_->add_eh_frame method here.
1149 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
1150 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
1151 rather than static method.
1152 (Target_x86_64::plt_entry_size): Likewise.
1153 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
1154 rather than plt_entry_size variable. Move guts of PLT filling to...
1155 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
1156 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
1157 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
1158
1159 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
1160 additional argument for the section alignment.
1161 Don't do add_eh_frame_for_plt here.
1162 (Output_data_plt_i386::first_plt_entry_offset): Make the method
1163 non-static. Use get_plt_entry_size method rather than plt_entry_size
1164 variable.
1165 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
1166 method.
1167 (Output_data_plt_i386::get_plt_entry_size): Call it.
1168 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
1169 (Output_data_plt_i386::add_eh_frame): New method to call it.
1170 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
1171 method.
1172 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
1173 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
1174 method.
1175 (Output_data_plt_i386::fill_plt_entry): New method to call it.
1176 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
1177 method instead of plt_entry_size.
1178 (Output_data_plt_i386::plt_entry_size)
1179 (Output_data_plt_i386::plt_eh_frame_fde_size)
1180 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
1181 (Output_data_plt_i386_standard): ... here, new class.
1182 (Output_data_plt_i386_exec): New class.
1183 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
1184 (Output_data_plt_i386_exec::first_plt_entry): ... here.
1185 (Output_data_plt_i386::exec_plt_entry): Move to ...
1186 (Output_data_plt_i386_exec::plt_entry): ... here.
1187 (Output_data_plt_i386_dyn): New class.
1188 (Output_data_plt_i386::first_plt_entry): Move to ...
1189 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
1190 (Output_data_plt_i386::dyn_plt_entry): Move to ...
1191 (Output_data_plt_i386_dyn::plt_entry): ... here.
1192 (Target_i386::Target_i386): Take optional argument for the Target_info
1193 pointer to use.
1194 (Target_i386::do_make_data_plt): New virtual method.
1195 (Target_i386::make_data_plt): New method to call it.
1196 (Target_i386::make_plt_section): Use that.
1197 Call this->plt_->add_eh_frame method here.
1198 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
1199 rather than plt_entry_size variable.
1200 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
1201 (Output_data_plt_i386::address_for_local): Likewise.
1202 (Output_data_plt_i386::do_write): Likewise.
1203 Move guts of PLT filling to...
1204 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
1205 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
1206 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
1207 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
1208
b9b9f2ee
CC
12092012-05-01 Cary Coutant <ccoutant@google.com>
1210
1211 * dwarf_reader.cc (Dwarf_die::read_attributes)
1212 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
1213 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
1214 * reduced_debug_output.cc
1215 (Output_reduced_debug_info_section::get_die_end): Remove
1216 DW_FORM_GNU_ref_index. Add default case.
1217
57923f48
MW
12182012-04-26 Mark Wielaard <mjw@redhat.com>
1219
1220 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
1221 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
1222 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
1223 DW_AT_high_pc as offset from DW_AT_low_pc.
1224
1225 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
1226 * testsuite/Makefile.in: Regenerate.
1227 * testsuite/gdb_index_test_3.c: New test source file.
1228 * testsuite/gdb_index_test_3.sh: New test source file.
1229
2c54b4f4
ILT
12302012-04-25 Ian Lance Taylor <iant@google.com>
1231
1232 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
1233 pointer.
1234 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
1235 as a class, not a struct.
1236 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
1237 (Target_arm::apply_cortex_a8_workaround): Likewise.
1238 * gc.h: Declare Reloc_types as a struct, not a class.
1239 * object.h: Declare Symbols_data as a struct.
1240 * reloc.h: Declare Read_relocs_data as a struct.
1241 * target.h: Declare Relocate_info as a struct.
1242
a5a5f7a3
DM
12432012-04-24 David S. Miller <davem@davemloft.net>
1244
1245 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
1246 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
1247 and R_SPARC_WPLT30.
1248
f038d496
CC
12492012-04-24 Cary Coutant <ccoutant@google.com>
1250
1251 * incremental-dump.cc (find_input_containing_global): Replace
1252 magic number with symbolic constant.
1253 (dump_incremental_inputs): Update version number.
1254 * incremental.cc (Output_section_incremental_inputs): Update version
1255 number; import symbolic constants from Incremental_inputs_reader.
1256 (Incremental_inputs::create_data_sections): Align relocations
1257 section correctly for 64-bit targets.
1258 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
1259 constants; add padding.
1260 (Output_section_incremental_inputs::write_header): Add assert for
1261 header_size.
1262 (Output_section_incremental_inputs::write_input_files): Add assert
1263 for input_entry_size.
1264 (Output_section_incremental_inputs::write_info_blocks): Add padding;
1265 add assert for object_info_size, input_section_entry_size,
1266 global_sym_entry_size.
1267 * incremental.h (Incremental_inputs_reader): Add symbolic constants
1268 for data structure sizes; use them.
1269 (Incremental_input_entry_reader): Import symbolic constants from
1270 Incremental_inputs_reader; use them.
1271
a4d85145
DM
12722012-04-23 David S. Miller <davem@davemloft.net>
1273
1274 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
1275 and elf_flags_set_.
1276 (Target_sparc::Target_sparc): Initialize new fields.
1277 (Target_sparc::do_make_elf_object): New function.
1278 (Target_sparc::do_adjust_elf_header): New function.
1279
1d509098
CC
12802012-04-23 Cary Coutant <ccoutant@google.com>
1281
1282 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
1283 CU range table of gdb index.
1284
7ebeff7f
DM
12852012-04-20 David S. Miller <davem@davemloft.net>
1286
1287 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
1288 instead of false.
1289
13cf9988
DM
12902012-04-16 David S. Miller <davem@davemloft.net>
1291
2a1079e8
DM
1292 * sparc.cc (Target_sparc::got_address): New function.
1293 (Sparc_relocate_functions::gdop_hix22): New function.
1294 (Sparc_relocate_functions::gdop_lox10): New function.
1295 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
1296 relocs.
1297 (Target_sparc::Scan::local): Likewise if the global symbol is not
1298 preemptible and is not IFUNC.
1299 (Target_sparc::Relocate::relocate): Perform GOTDATA code
1300 transformations for local and non-preemptible non-IFUNC global
1301 symbols.
1302
0bc964fc
DM
1303 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
1304 writing out 64-bit part of ranges.
1305
661d7a80
DM
1306 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
1307 -fpic and -fpie respectively.
1308 * Makefile.in: Regenerate.
1309
8c2bf391
DM
1310 * sparc.cc (class Target_sparc): Add rela_ifunc_.
1311 (Target_sparc::Target_sparc): Initialize new field.
1312 (Target_sparc::do_plt_section_for_global): New function.
1313 (Target_sparc::do_plt_section_for_local): New function.
1314 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
1315 (Target_sparc::make_plt_section): New function, broken out of
1316 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
1317 (Target_sparc::make_plt_entry): Call make_plt_section.
1318 (Target_sparc::make_local_ifunc_plt_entry): New function.
1319 (Target_sparc::rela_ifunc_section): New function.
1320 (Target_sparc::plt_section): Remove const.
1321 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
1322 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
1323 and ifunc_count_ fields.
1324 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
1325 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
1326 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
1327 (Output_data_plt_sparc::rela_ifunc): New function.
1328 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
1329 (Output_data_plt_sparc::has_ifunc_section): New function.
1330 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
1331 (Output_data_plt_sparc::address_for_global): New function.
1332 (Output_data_plt_sparc::address_for_local): New function.
1333 (Output_data_plt_sparc::plt_index_to_offset): New function.
1334 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
1335 and entry_count.
1336 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
1337 entry_count.
1338 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
1339 R_SPARC_JMP_IREL to switch.
1340 (Target_sparc::Scan::check_non_pic): Likewise.
1341 (Target_sparc::Scan::local): Handle IFUNC symbols.
1342 (Target_sparc::Scan::local): Likewise.
1343 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
1344 and plt_address_for_local.
1345 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
1346 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
1347
13cf9988
DM
1348 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
1349 (class Output_data_reloc): Adjust calls to Output_reloc_type.
1350 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
1351 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
1352 global relocs too.
1353 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
1354 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
1355 calls.
1356 * sparc.cc (Target_sparc::Scan::global): Likewise.
1357 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
1358
31821be0
CC
13592012-04-16 Cary Coutant <ccoutant@google.com>
1360
1361 * archive.cc (Library_base::should_include_member): Check for
1362 --export-dynamic-symbol.
1363 * options.h (class General_options): Add --export-dynamic-symbol.
1364 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
1365 --export-dynamic-symbol.
1366 (Symbol_table::gc_mark_undef_symbols): Likewise.
1367 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
1368
2615994e
DM
13692012-04-12 David S. Miller <davem@davemloft.net>
1370
1371 * sparc.cc (Reloc::wdisp10): New relocation method.
1372 (Reloc::h34): Likewise.
1373 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
1374 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
1375 R_SPARC_WDISP10.
1376 (Target_sparc::Scan::local): Likewise.
1377 (Target_sparc::Scan::global): Likewise.
1378 (Target_sparc::Relocate::relocate): Likewise.
1379
6782735d
CC
13802012-04-09 Cary Coutant <ccoutant@google.com>
1381
1382 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
1383 low_pc == 0.
1384
8c7a0b00
ILT
13852012-04-06 Ian Lance Taylor <iant@google.com>
1386
1387 * timer.cc: #include <unistd.h>.
1388
58797674
RM
13892012-04-06 Roland McGrath <mcgrathr@google.com>
1390
1391 * configure.in (AC_CHECK_HEADERS): Add locale.h.
1392 * config.in: Regenerate.
1393 * configure: Regenerate.
1394
44350750
NC
13952012-04-05 Nick Clifton <nickc@redhat.com>
1396
1397 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
1398 (AM_LC_MESSAGES): Add.
1399 * aclocal.m4: Regenerate.
1400 * config.in: Regenerate.
1401 * configure: Regenerate.
1402
c1027032
CC
14032012-03-21 Cary Coutant <ccoutant@google.com>
1404
1405 * Makefile.am: Add gdb-index.cc, gdb-index.h.
1406 * Makefile.in: Regenerate.
1407 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
1408 (Sized_elf_reloc_mapper::symbol_section): New function.
1409 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
1410 (make_elf_reloc_mapper): New function.
1411 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
1412 (Dwarf_abbrev_table::do_read_abbrevs): New function.
1413 (Dwarf_abbrev_table::do_get_abbrev): New function.
1414 (Dwarf_ranges_table::read_ranges_table): New function.
1415 (Dwarf_ranges_table::read_range_list): New function.
1416 (Dwarf_pubnames_table::read_section): New function.
1417 (Dwarf_pubnames_table::read_header): New function.
1418 (Dwarf_pubnames_table::next_name): New function.
1419 (Dwarf_die::Dwarf_die): New function.
1420 (Dwarf_die::read_attributes): New function.
1421 (Dwarf_die::skip_attributes): New function.
1422 (Dwarf_die::set_name): New function.
1423 (Dwarf_die::set_linkage_name): New function.
1424 (Dwarf_die::attribute): New function.
1425 (Dwarf_die::string_attribute): New function.
1426 (Dwarf_die::int_attribute): New function.
1427 (Dwarf_die::uint_attribute): New function.
1428 (Dwarf_die::ref_attribute): New function.
1429 (Dwarf_die::child_offset): New function.
1430 (Dwarf_die::sibling_offset): New function.
1431 (Dwarf_info_reader::check_buffer): New function.
1432 (Dwarf_info_reader::parse): New function.
1433 (Dwarf_info_reader::do_parse): New function.
1434 (Dwarf_info_reader::do_read_string_table): New function.
1435 (Dwarf_info_reader::lookup_reloc): New function.
1436 (Dwarf_info_reader::get_string): New function.
1437 (Dwarf_info_reader::visit_compilation_unit): New function.
1438 (Dwarf_info_reader::visit_type_unit): New function.
1439 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
1440 Sized_elf_reloc_mapper.
1441 (Sized_dwarf_line_info::symbol_section): Remove function.
1442 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
1443 (Sized_dwarf_line_info::read_line_mappings): Remove object
1444 parameter, adjust callers.
1445 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
1446 * dwarf_reader.h: Include <sys/types.h>.
1447 (class Track_relocs): Remove forward declaration.
1448 (class Elf_reloc_mapper): New class.
1449 (class Sized_elf_reloc_mapper): New class.
1450 (class Dwarf_abbrev_table): New class.
1451 (class Dwarf_range_list): New class.
1452 (class Dwarf_ranges_table): New class.
1453 (class Dwarf_pubnames_table): New class.
1454 (class Dwarf_die): New class.
1455 (class Dwarf_info_reader): New class.
1456 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
1457 (Sized_dwarf_line_info::symbol_section): Remove member function.
1458 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
1459 base class.
1460 * gdb-index.cc: New source file.
1461 * gdb-index.h: New source file.
1462 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
1463 and .debug_types sections, call Layout::add_to_gdb_index.
1464 (Sized_relobj_incr::do_section_name): Implement.
1465 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
1466 return type; Implement.
1467 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
1468 return type.
1469 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
1470 parameter list and return type.
1471 (Sized_incr_dynobj::do_section_contents): Likewise.
1472 * layout.cc: Include gdb-index.h.
1473 (Layout::Layout): Initialize gdb_index_data_.
1474 (Layout::init_fixed_output_section): Check for .gdb_index section.
1475 (Layout::add_to_gdb_index): New function. Instantiate.
1476 * layout.h: Add forward declaration for class Gdb_index.
1477 (Layout::add_to_gdb_index): New member function.
1478 (Layout::gdb_index_data_): New data member.
1479 * main.cc: Include gdb-index.h.
1480 (main): Print statistics for gdb index.
1481 * object.cc (Object::section_contents): Move code into
1482 do_section_contents.
1483 (need_decompressed_section): Check for sections needed when building
1484 gdb index.
1485 (build_compressed_section_map): Likewise.
1486 (Sized_relobj_file::do_read_symbols): Need local symbols when building
1487 gdb index.
1488 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
1489 sections; call Layout::add_to_gdb_index.
1490 (Sized_relobj_file::do_decompressed_section_contents): Call
1491 do_section_contents directly.
1492 * object.h (Object::do_section_contents): Adjust parameter list and
1493 return type.
1494 (Object::do_decompressed_section_contents): Call do_section_contents
1495 directly.
1496 (Sized_relobj_file::do_section_contents): Adjust parameter list and
1497 return type.
1498 * options.h (class General_options): Add --gdb-index option.
1499 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
1500 list and return type.
1501 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
1502 * reloc.h (Track_relocs::checkpoint): New function.
1503 (Track_relocs::reset): New function.
1504
1505 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
1506 New test cases.
1507 * testsuite/Makefile.in: Regenerate.
1508 * testsuite/gdb_index_test.cc: New test source file.
1509 * testsuite/gdb_index_test_1.sh: New test source file.
1510 * testsuite/gdb_index_test_2.sh: New test source file.
1511
647f1574
DK
15122012-03-19 Doug Kwan <dougkwan@google.com>
1513
1514 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 1515 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
1516 __exidx_start and __exidx_end. Make symbol table parameter
1517 anonymous as it is not used.
1518 * gold.cc (queue_middle_tasks): Call target hook to define any
1519 target-specific symbols.
1520 * target.h (Target::define_standard_symbols): New method.
1521 (Target::do_define_standard_symbols): Same.
1522 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
1523 * testsuite/Makefile.in: Regenerate.
1524 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
1525 and __exidx_end.
1526 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
1527 relocations are generated for __exidx_start and __exidx_end.
1528
7c6109da
DK
15292012-03-16 Doug Kwan <dougkwan@google.com>
1530
1531 * testsuite/Makefile.am: Disable test initpri3b.
1532 * testsuite/Makefile.in: Regenerate.
1533
7b8957f8
DK
15342012-03-15 Doug Kwan <dougkwan@google.com>
1535
1536 * arm.cc (Target_arm::got_section): Make .got section read-only
1537 if -z now is given.
1538
14dc9ef7
ILT
15392012-03-15 Ian Lance Taylor <iant@google.com>
1540
1541 PR gold/13850
1542 * layout.cc (Layout::make_output_section): Correctly mark
1543 SHT_INIT_ARRAY, et. al., as relro.
1544
fa40b62a
DK
15452012-03-14 Doug Kwan <dougkwan@google.com>
1546
1547 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
1548 dynamic relocations for protected symbols in shared objects.
1549
fd325007
ILT
15502012-03-13 Ian Lance Taylor <iant@google.com>
1551
1552 * resolve.cc (Symbol_table::resolve): When merging common symbols,
1553 keep the larger alignment.
1554
e8dd54e1
CC
15552012-03-12 Cary Coutant <ccoutant@google.com>
1556
1557 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
1558 handling of DW_LNE_define_file.
1559
feb5f3b0
CC
15602012-03-12 Cary Coutant <ccoutant@google.com>
1561
1562 * reduced_debug_output.cc
1563 (Output_reduced_debug_info_section::get_die_end): Add new FORM
1564 codes to switch.
1565
a1fb4256
CC
15662012-02-29 Cary Coutant <ccoutant@google.com>
1567
1568 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
1569
5dd8762a
CC
15702012-02-29 Cary Coutant <ccoutant@google.com>
1571
1572 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
1573 Call Object::decompressed_section_contents.
1574 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
1575 New dtor.
1576 (Sized_dwarf_line_info::buffer_start_): New data member.
1577 * merge.cc (Output_merge_data::do_add_input_section): Call
1578 Object::decompressed_section_contents.
1579 (Output_merge_string::do_add_input_section): Likewise.
1580 * object.cc (need_decompressed_section): New function.
1581 (build_compressed_section_map): Decompress sections needed later.
1582 (Sized_relobj_file::do_decompressed_section_contents): New function.
1583 (Sized_relobj_file::do_discard_decompressed_sections): New function.
1584 * object.h (Object::decompressed_section_contents): New function.
1585 (Object::discard_decompressed_sections): New function.
1586 (Object::do_decompressed_section_contents): New function.
1587 (Object::do_discard_decompressed_sections): New function.
1588 (Compressed_section_info): New type.
1589 (Compressed_section_map): Include decompressed section contents.
1590 (Sized_relobj_file::do_decompressed_section_contents): New function.
1591 (Sized_relobj_file::do_discard_decompressed_sections): New function.
1592
7b5de7ee
CC
15932012-02-16 Cary Coutant <ccoutant@google.com>
1594
1595 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
1596 * testsuite/Makefile.in: Regenerate.
1597
f9fa4a63
CC
15982012-02-14 Cary Coutant <ccoutant@google.com>
1599
1600 * options.cc (General_options::finalize): Disallow -pie and -static.
1601
2c175ebc
DK
16022012-02-03 Doug Kwan <dougkwan@google.com>
1603
1604 * arm.cc (Arm_relocate_functions::abs8,
1605 Arm_relocate_functions::abs16): Use
1606 Bits::has_signed_unsigned_overflow32.
1607 (Arm_relocate_functions::thm_abs8): Correct range of
1608 overflow check.
1609 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
1610 in assertions.
1611
90cff06f
DK
16122012-02-02 Doug Kwan <dougkwan@google.com>
1613
1614 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
1615 position independent outputs, not just shared objects.
1616
63887f3d
L
16172012-01-30 H.J. Lu <hongjiu.lu@intel.com>
1618
1619 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
1620 * configure: Regenerated.
1621
bef2b434
ILT
16222012-01-27 Ian Lance Taylor <iant@google.com>
1623
1624 * reloc.h (Bits): New class with static functions, copied from
1625 namespace utils in arm.cc.
1626 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
1627 instead.
1628
c335b55d
L
16292012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1630
1631 * incremental.cc (write_info_blocks): Correct relocation offset.
1632
41194d9f
L
16332012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1634
1635 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
1636 (Relocate::tls_gd_to_le): Likewise.
1637
1bae613c
L
16382012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1639
1640 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
1641
24482ca0
L
16422012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1643
1644 * configure.ac: Check if -mcmodel=medium works.
1645 * configure: Regenerated.
1646
c2c7840a
CC
16472012-01-24 Cary Coutant <ccoutant@google.com>
1648
1649 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
1650 definition and ...
1651 (read_unsigned_LEB_128_x): ... this new function.
1652 (read_signed_LEB_128): Replaced with inline definition and ...
1653 (read_signed_LEB_128_x): ... this new function.
1654 * int_encoding.h (read_unsigned_LEB_128_x): New function.
1655 (read_unsigned_LEB_128): Add inline definition.
1656 (read_signed_LEB_128_x): New function.
1657 (read_signed_LEB_128): Add inline definition.
1658 * testsuite/Makefile.am (leb128_unittest): New unit test.
1659 * testsuite/Makefile.in: Regenerate.
1660 * testsuite/leb128_unittest.cc: New unit test.
1661
833de760 16622012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
1663
1664 PR gold/13617
1665 * i386.cc (Target_i386::do_code_fill): When using a jmp
1666 instruction, pad with nop instructions.
1667 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
1668
618d6666
L
16692012-01-22 H.J. Lu <hongjiu.lu@intel.com>
1670
1671 * x86_64.cc (gc_process_relocs): Add typename on types used in
1672 template.
1673 (scan_relocs): Likewise.
1674 (relocate_section): Likewise.
1675 (apply_relocation): Likewise.
1676
3660ff06
L
16772012-01-10 H.J. Lu <hongjiu.lu@intel.com>
1678
1679 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
1680 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
1681 under x32.
1682
fc51264f
L
16832012-01-09 H.J. Lu <hongjiu.lu@intel.com>
1684
1685 * x86_64.cc: Initial support for x32.
1686
dd74ae06
CC
16872012-01-03 Cary Coutant <ccoutant@google.com>
1688
1689 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
1690 Use abstract base class for GOT.
1691 * gold/output.h (class Output_data_got_base): New abstract base class.
1692 (class Output_data_got): Derive from new base class, adjust ctors.
1693 (Output_data_got::reserve_slot): Make virtual; rename to
1694 do_reserve_slot; Adjust callers.
1695 * gold/target.h (Sized_target::init_got_plt_for_update): Return
1696 pointer to abstract base class.
1697 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
1698
83896202
ILT
16992011-12-18 Ian Lance Taylor <iant@google.com>
1700
1701 * object.h (Relobj::local_symbol_value): New function.
1702 (Relobj::local_plt_offset): New function.
1703 (Relobj::local_has_got_offset): New function.
1704 (Relobj::local_got_offset): New function.
1705 (Relobj::set_local_got_offset): New function.
1706 (Relobj::do_local_symbol_value): New pure virtual function.
1707 (Relobj::do_local_plt_offset): Likewise.
1708 (Relobj::do_local_has_got_offset): Likewise.
1709 (Relobj::do_local_got_offset): Likewise.
1710 (Relobj::do_set_local_got_offset): Likewise.
1711 (Sized_relobj::do_local_has_got_offset): Rename from
1712 local_has_got_offset.
1713 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
1714 (Sized_relobj::do_set_local_got_offset): Rename from
1715 set_local_got_offset.
1716 (Sized_relobj_file::do_local_plt_offset): Rename from
1717 local_plt_offset.
1718 (Sized_relobj_file::do_local_symbol_value): New function.
1719 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
1720 local_plt_offset.
1721 * output.cc (Output_data_got::Got_entry::write): Change object to
1722 Relobj. Use local_symbol_value.
1723 (Output_data_got::add_global_with_rel): Change rel_dyn to
1724 Output_data_reloc_generic*. Use add_global_generic.
1725 (Output_data_got::add_global_with_rela): Remove. Change all
1726 callers to use add_global_with_rel.
1727 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
1728 Output_data_reloc_generic*. Use add_global_generic.
1729 (Output_data_got::add_global_pair_with_rela): Remove. Change all
1730 callers to use add_global_pair_with_rel.
1731 (Output_data_got::add_local): Change object to Relobj*.
1732 (Output_data_got::add_local_plt): Likewise.
1733 (Output_data_got::add_local_with_rel): Change object to Relobj*,
1734 change rel_dyn to Output_data_reloc_generic*. Use
1735 add_local_generic.
1736 (Output_data_got::add_local_with_rela): Remove. Change all
1737 callers to use all_local_with_rel.
1738 (Output_data_got::add_local_pair_with_rel): Change object to
1739 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
1740 add_output_section_generic.
1741 (Output_data_got::add_local_pair_with_rela): Remove. Change all
1742 callers to use add_local_pair_with_rel.
1743 (Output_data_got::reserve_local): Change object to Relobj*.
1744 * output.h: (class Output_data_reloc_generic): Add pure virtual
1745 declarations for add_global_generic, add_local_generic,
1746 add_output_section_generic.
1747 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
1748 functions for Output_data_reloc_generic. Update declarations for
1749 changes listed in output.cc.
1750 (class Output_data_got): Change template parameter to got_size.
1751 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
1752 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
1753 function.
1754 (Sized_relobj_incr::do_local_plt_offset): New function.
1755 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
1756 add_global_generic.
1757
76677ad0
CC
17582011-12-17 Cary Coutant <ccoutant@google.com>
1759
1760 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
1761 * resolve.cc (Symbol_table::resolve): Likewise.
1762 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
1763 arrays.
1764 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
1765
8b8dd8d5
ILT
17662011-12-16 Ian Lance Taylor <iant@google.com>
1767
1768 * output.h (Output_data_reloc_generic::add): Only call
1769 add_dynamic_reloc if this is a dynamic reloc section.
1770
d55525b9
L
17712011-12-15 H.J. Lu <hongjiu.lu@intel.com>
1772
1773 PR gold/13505
1774 * target-reloc.h (apply_relocation): Replace <64, false> with
1775 <size, big_endian>.
1776
ff81c7c1
NC
17772011-11-25 Nick Clifton <nickc@redhat.com>
1778
1779 * po/it.po: New Italian translation.
1780
628f39be
SA
17812011-11-17 Sterling Augustine <saugustine@google.com>
1782
1783 * script.cc (script_include_directive): Implement.
1784 (read_script_file): New local variables name and search_path. Update
1785 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
1786 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
1787 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
1788
98ef3ea4
SA
17892011-11-11 Sterling Augustine <saugustine@google.com>
1790
1791 * yyscript.y (section_cmd): Add support for INCLUDE directive.
1792 (file_or_sections_cmd): Likewise.
1793
f4a8b6d7
DK
17942011-11-11 Doug Kwan <dougkwan@google.com>
1795
1796 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
1797 if --just-symbols is given.
1798
29ab395d
DK
17992011-11-10 Doug Kwan <dougkwan@google.com>
1800
1801 PR gold/13362
1802 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
1803 when processing data relocs.
1804 * reloc.h (Relocate_functions::rel_unaligned): New method.
1805 (Relocate_functions::pcrel_unaligned): Ditto.
1806 (Relocate_functions::rel32_unaligned): Ditto.
1807 (Relocate_functions::pcrel32_unaligned): Ditto.
1808
2c339f71
DK
18092011-11-09 Doug Kwan <dougkwan@google.com>
1810
1811 PR gold/13362
1812 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
1813 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
1814 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
1815 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
1816 (Relocate_functions::rel_unaligned): New.
1817 (Relocate_functions::rel32_unaligned): New.
1818 * target-reloc.h (relocate_for_relocatable): Add code to handle
1819 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
1820 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
1821 arm_unaligned_reloc_r): New targets.
1822 * testsuite/Makefile.in: Regenerate.
1823 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
1824 linking.
1825
3f3cddf1
ILT
18262011-11-02 Ian Lance Taylor <iant@google.com>
1827
1828 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
1829 NATIVE_LINKER.
1830 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
1831 * options.cc (General_options::finalize): Use library search path
1832 from configure script if specified. If not native and no sysroot,
1833 only search TOOLLIBDIR.
1834 * options.h (Search_directory::Search_directory): Change name to
1835 const std::string&.
1836 (General_options::add_to_library_path_with_sysroot): Change arg to
1837 const std::string&.
1838 * configure, Makefile.in, config.in: Rebuild.
1839
a8e2273b
ILT
18402011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
1841
1842 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
1843 we are working around the ARM1176 Erratum.
1844 * options.h (General_options::fix_arm1176): Add option.
1845 * testsuite/Makefile.am: Add testcases, and keep current ones
1846 working.
1847 * testsuite/Makefile.in: Regenerate.
1848 * testsuite/arm_fix_1176.s: New file.
1849 * testsuite/arm_fix_1176.sh: Likewise.
1850
cd6eab1c
ILT
18512011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
1852
1853 * arm.cc (Target_arm::Target_arm): Remove initialisation of
1854 may_use_blx_.
1855 (Target_arm::may_use_blx): Remove method.
1856 (Target_arm::set_may_use_blx): Likewise.
1857 (Target_arm::may_use_v4t_interworking): New method.
1858 (Target_arm::may_use_v5t_interworking): Likewise.
1859 (Target_arm::may_use_blx_): Remove member variable.
1860 (Arm_relocate_functions::arm_branch_common): Check for v5T
1861 interworking.
1862 (Arm_relocate_functions::thumb_branch_common): Likewise.
1863 (Reloc_stub::stub_type_for_reloc): Likewise.
1864 (Target_arm::do_finalize_sections): Correct interworking checks.
1865 * testsuite/Makefile.am: Add new tests.
1866 * testsuite/Makefile.in: Regenerate.
1867 * testsuite/arm_farcall_arm_arm.s: New test.
1868 * testsuite/arm_farcall_arm_arm.sh: Likewise.
1869 * testsuite/arm_farcall_arm_thumb.s: Likewise.
1870 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
1871 * testsuite/arm_farcall_thumb_arm.s: Likewise.
1872 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
1873 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
1874 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
1875
286adcf4
CC
18762011-10-31 Cary Coutant <ccoutant@google.com>
1877
1878 PR gold/13023
1879 * expression.cc (Expression::eval_with_dot): Add
1880 is_section_dot_assignment parameter.
1881 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
1882 absolute and assigning to dot within a section.
1883 * script-sections.cc
1884 (Output_section_element_assignment::set_section_addresses): Pass
1885 dot_section to set_if_absolute.
1886 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
1887 as is_section_dot_assignment flag to eval_with_dot.
1888 (Output_section_element_dot_assignment::set_section_addresses):
1889 Likewise.
1890 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
1891 parameter. Also set value if relative to dot_section; set the
1892 symbol's output_section.
1893 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
1894 parameter. Adjust all callers.
1895 (Expression::eval_maybe_dot): Likewise.
1896 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
1897 Adjust all callers.
1898 * testsuite/script_test_2.t: Test assignment of an absolute value
1899 to dot within an output section element.
1900
9634ed06
CC
19012011-10-31 Cary Coutant <ccoutant@google.com>
1902
1903 * options.h (class General_options): Add --[no-]gnu-unique options.
1904 * symtab.cc (Symbol_table::sized_write_globals): Convert
1905 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
1906
de4101c7
CC
19072011-10-31 Cary Coutant <ccoutant@google.com>
1908
1909 PR gold/13359
1910 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
1911 unnecessary assertion.
1912 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
1913
7257cc92
ST
19142011-10-31 Sriraman Tallam <tmsriram@google.com>
1915
1916 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1917 gc_mark_symbol.
1918 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1919 gc_mark_symbol.
1920 Change to just keep the section associated with symbol.
1921 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
1922 they are externally visible and --export-dynamic is turned on.
1923 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
1924
bfc34b3f
ILT
19252011-10-19 Ian Lance Taylor <iant@google.com>
1926
1927 PR gold/13163
1928 * script-sections.cc
1929 (Output_section_element_dot_assignment::needs_output_section): New
1930 function.
1931
ea0d8c47
ILT
19322011-10-19 Ian Lance Taylor <iant@google.com>
1933
1934 PR gold/13204
1935 * layout.cc (Layout::segment_precedes): Don't assert failure if a
1936 --section-start option was seen.
1937 * options.h (General_options::any_section_start): New function.
1938
abd242a9
DM
19392011-10-18 David S. Miller <davem@davemloft.net>
1940
1941 PR binutils/13301
1942 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
1943 member to track relocation locations that have moved during TLS
1944 reloc optimizations.
1945 (Target_sparc::Relocate::Relocate): Initialize to NULL.
1946 (Target_sparc::Relocate::relocate): Adjust view down by 4
1947 bytes if it matches reloc_adjust_addr_.
1948 (Target_sparc::Relocate::relocate_tls): Always move the
1949 __tls_get_addr call delay slot instruction forward 4 bytes when
1950 performing relaxation.
1951
bab9090f
CC
19522011-10-18 Cary Coutant <ccoutant@google.com>
1953
1954 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
1955 (Output_file::map_no_anonymous): Check for non-zero
1956 return code from posix_fallocate.
1957
f7c5b166
CC
19582011-10-17 Cary Coutant <ccoutant@google.com>
1959
1960 PR gold/13245
1961 * plugin.cc (is_visible_from_outside): Check for symbols
1962 referenced from dynamic objects.
1963 * resolve.cc (Symbol_table::resolve): Don't count references
1964 from dynamic objects as references from real ELF files.
1965 * testsuite/plugin_test_2.sh: Adjust expected result.
1966
b490c0bb
CC
19672011-10-17 Cary Coutant <ccoutant@google.com>
1968
1969 * gold.cc: Include timer.h.
1970 (queue_middle_tasks): Stamp time.
1971 (queue_final_tasks): Likewise.
1972 * main.cc (main): Store timer in parameters. Print timers
1973 for each pass.
1974 * parameters.cc (Parameters::Parameters): Initialize timer_.
1975 (Parameters::set_timer): New function.
1976 (set_parameters_timer): New function.
1977 * parameters.h (Parameters::set_timer): New function.
1978 (Parameters::timer): New function.
1979 (Parameters::timer_): New data member.
1980 (set_parameters_timer): New function.
1981 * timer.cc (Timer::stamp): New function.
1982 (Timer::get_pass_time): New function.
1983 * timer.h (Timer::stamp): New function.
1984 (Timer::get_pass_time): New function.
1985 (Timer::pass_times_): New data member.
1986
f475cf7b
CC
19872011-10-17 Cary Coutant <ccoutant@google.com>
1988
1989 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
1990 task for members of lib groups.
1991
cdd7e244
CC
19922011-10-17 Cary Coutant <ccoutant@google.com>
1993
1994 PR gold/13288
4f95c8b4 1995 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
1996 (File_read::make_view): Move bounds check (replace with assert)...
1997 (File_read::find_or_make_view): ... to here.
1998
dfb45471
CC
19992011-10-12 Cary Coutant <ccoutant@google.com>
2000
4f95c8b4 2001 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
2002 ::read returns less than requested size.
2003
53bbcc1b
CC
20042011-10-10 Cary Coutant <ccoutant@google.com>
2005
4f95c8b4 2006 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
2007 Initialize defined_count_.
2008 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
2009 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
2010 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
2011 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
2012 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 2013 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
2014 member.
2015 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 2016 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
2017 Return zeroes instead of internal error.
2018
397b129b
CC
20192011-10-10 Cary Coutant <ccoutant@google.com>
2020
2021 PR gold/13249
4f95c8b4 2022 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 2023 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 2024 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
2025 (Output_reloc::type_): Adjust size of bit field.
2026 (Output_reloc::use_plt_offset_): New bit field.
2027 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
2028 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
2029 flag. Adjust all callers.
4f95c8b4 2030 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
2031 creating RELATIVE relocations.
2032
d5698657
NC
20332011-10-10 Nick Clifton <nickc@redhat.com>
2034
2035 * po/es.po: Updated Spanish translation.
2036 * po/fi.po: Updated Finnish translation.
2037
6a59a5c2
DN
20382011-10-03 Diego Novillo <dnovillo@google.com>
2039
2040 * options.cc (parse_uint): Fix dereference of RETVAL.
2041
f0558624
ST
20422011-09-29 Sriraman Tallam <tmsriram@google.com>
2043
2044 * layout.h (section_order_map_): New member.
2045 (get_section_order_map): New member function.
2046 * output.cc (Output_section::add_input_section): Check for patterns
2047 only when --section-ordering-file is specified.
2048 * gold.cc (queue_middle_tasks): Delay updating order of sections till
2049 output_sections have been formed.
2050 * layout.cc (Layout_Layout): Initialize section_order_map_.
2051 * plugin.cc (update_section_order): Store order in order_map. Do not
2052 update the order.
2053 * testsuite/Makefile.am: Add test case for plugin_final_layout.
2054 * testsuite/Makefile.in: Regenerate.
2055 * testsuite/plugin_section_order.c: New file.
2056 * testsuite/plugin_final_layout.cc: New file.
2057 * testsuite/plugin_final_layout.sh: New file.
2058
a7dac153
CC
20592011-09-29 Cary Coutant <ccoutant@google.com>
2060
4f95c8b4 2061 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 2062 Check for NULL.
4f95c8b4 2063 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
2064 symbols during incremental update.
2065 (Symbol_table::add_from_dynobj): Likewise.
2066
eebd87a5
ILT
20672011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2068 Ian Lance Taylor <iant@google.com>
2069
2070 * symtab.cc (Symbol_table::define_special_symbol): Always
2071 canonicalize version string.
2072
403a3331
CC
20732011-09-26 Cary Coutant <ccoutant@google.com>
2074
4f95c8b4
CC
2075 * gold.cc (queue_initial_tasks): Move option checks ...
2076 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
2077 some options; make others fatal.
2078
235061c2
CC
20792011-09-26 Cary Coutant <ccoutant@google.com>
2080
2081 gcc PR lto/47247
2082 * plugin.cc (get_symbols_v2): New function.
2083 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
2084 (is_referenced_from_outside): New function.
2085 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
2086 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
2087 (get_symbols): Pass version parameter.
2088 (get_symbols_v2): New function.
2089 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
2090 parameter.
2091 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
2092 (onload): Add LDPT_GET_SYMBOLS_V2.
2093 (all_symbols_read_hook): Use get_symbols_v2; check for
2094 LDPR_PREVAILING_DEF_IRONLY_EXP.
2095 * testsuite/plugin_test_3.sh: Update expected results.
2096
dc87f620
ILT
20972011-09-23 Simon Baldwin <simonb@google.com>
2098
2099 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
2100 configuration options.
2101 * configure: Regenerate.
2102 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
2103 * Makefile.in: Regenerate.
2104 * testsuite/Makefile.in: Regenerate.
2105
a8279f82
ST
21062011-09-19 Sriraman Tallam <tmsriram@google.com>
2107
2108 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
2109
0c9350c8
CC
21102011-09-19 Cary Coutant <ccoutant@google.com>
2111
2112 * incremental.cc (can_incremental_update): Fix typo in comment.
2113 * incremental.h (can_incremental_update): Likewise.
2114
aa06ae28
CC
21152011-09-18 Cary Coutant <ccoutant@google.com>
2116
2117 * incremental.cc (can_incremental_update): New function.
2118 * incremental.h (can_incremental_update): New function.
2119 * layout.cc (Layout::init_fixed_output_section): Call it.
2120 (Layout::make_output_section): Don't allow patch space in .eh_frame.
2121 * object.cc (Sized_relobj_file::do_layout): Call
2122 can_incremental_update.
2123
ebb300b2
CC
21242011-09-13 Cary Coutant <ccoutant@google.com>
2125
2126 * configure.ac: Check for glibc support for gnu_indirect_function
2127 support with static linking, setting automake conditional
2128 IFUNC_STATIC.
2129 * Makefile.in: Regenerate.
2130 * configure: Regenerate.
2131
2132 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
2133 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
2134 for IFUNC_STATIC.
2135 * testsuite/Makefile.in: Regenerate.
2136
1206d0d5
CC
21372011-09-13 Cary Coutant <ccoutant@google.com>
2138
2139 * incremental.cc (Sized_relobj_incr::do_layout): Call
2140 report_comdat_group for kept comdat sections.
2141 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
2142 * testsuite/Makefile.in: Regenerate.
2143 * testsuite/incr_comdat_test_1.cc: New source file.
2144 * testsuite/incr_comdat_test_2_v1.cc: New source file.
2145 * testsuite/incr_comdat_test_2_v2.cc: New source file.
2146 * testsuite/incr_comdat_test_2_v3.cc: New source file.
2147
40b29874
ILT
21482011-09-13 Ian Lance Taylor <iant@google.com>
2149
2150 * object.cc (Sized_relobj_file::do_layout): Remove unused local
2151 variable external_symbols_offset.
2152
1b045aac
ILT
21532011-09-12 Ian Lance Taylor <iant@google.com>
2154
2155 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
2156 triggered if object has no symbols.
2157
24c6c55a
DM
21582011-09-09 David S. Miller <davem@davemloft.net>
2159
2160 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
2161 (Output_fill_debug_line::do_write): Likewise.
2162
66570254
CC
21632011-08-29 Cary Coutant <ccoutant@google.com>
2164
2165 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
2166 casts to match formatting specs.
2167 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
2168
8ea8cd50
CC
21692011-08-26 Cary Coutant <ccoutant@google.com>
2170
2171 * layout.cc (Free_list::allocate): Provide guarantee of minimum
2172 remaining hole size when allocating.
2173 (Layout::make_output_section): Set fill methods for debug sections.
2174 * layout.h (Free_list::Free_list_node): Move from private to
2175 public.
2176 (Free_list::set_min_hole_size): New function.
2177 (Free_list::begin, Free_list::end): New functions.
2178 (Free_list::min_hole_): New data member.
2179 * output.cc: Include dwarf.h.
2180 (Output_fill_debug_info::do_minimum_hole_size): New function.
2181 (Output_fill_debug_info::do_write): New function.
2182 (Output_fill_debug_line::do_minimum_hole_size): New function.
2183 (Output_fill_debug_line::do_write): New function.
2184 (Output_section::Output_section): Initialize new data member.
2185 (Output_section::set_final_data_size): Ensure patch space is larger
2186 than minimum hole size.
2187 (Output_section::do_write): Fill holes in debug sections.
2188 * output.h (Output_fill): New class.
2189 (Output_fill_debug_info): New class.
2190 (Output_fill_debug_line): New class.
2191 (Output_section::set_free_space_fill): New function.
2192 (Output_section::free_space_fill_): New data member.
2193 * testsuite/Makefile.am (incremental_test_3): Add
2194 --incremental-patch option.
2195 (incremental_test_4): Likewise.
2196 (incremental_test_5): Likewise.
2197 (incremental_test_6): Likewise.
2198 (incremental_copy_test): Likewise.
2199 (incremental_common_test_1): Likewise.
2200 * testsuite/Makefile.in: Regenerate.
2201
7cf80422
NC
22022011-08-26 Nick Clifton <nickc@redhat.com>
2203
2204 * po/es.po: Updated Spanish translation.
2205
c3f7b0e5
CC
22062011-08-01 Cary Coutant <ccoutant@google.com>
2207
2208 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
2209 * gold/testsuite/Makefile.in: Regenerate.
2210 * gold/testsuite/justsyms_exec.c: New source file.
2211 * gold/testsuite/justsyms_lib.c: New source file.
2212
9590bf25
CC
22132011-08-01 Cary Coutant <ccoutant@google.com>
2214
2215 * layout.cc (Layout::set_segment_offsets): Don't realign text
2216 segment if -Ttext was specified.
2217 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
2218 file type.
2219 * object.h (Sized_relobj_file::e_type): New function.
2220 (Sized_relobj_file::e_type_): New data member.
2221 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
2222 base address for ET_EXEC files.
2223 * target.cc (Target::do_make_elf_object_implementation): Allow
2224 ET_EXEC files with --just-symbols option.
2225
dcd8d12e
CC
22262011-07-28 Cary Coutant <ccoutant@google.com>
2227
2228 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
2229 Add thread_number parameter.
2230 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
2231 * workqueue-threads.cc
2232 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
2233 current thread if its thread number is greater than desired thread
2234 count.
2235 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
2236 Add thread_number parameter.
2237 (Workqueue::should_cancel_thread): Likewise.
2238 (Workqueue::find_runnable_or_wait): Pass thread_number to
2239 should_cancel_thread.
2240 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
2241 parameter.
2242
804eb480
ST
22432011-07-22 Sriraman Tallam <tmsriram@google.com>
2244
2245 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
2246 only after checking if it cannot be forced local.
2247 * symtab.h (is_externally_visible): Check if the symbol is not forced
2248 local.
2249
f1ddb600
ILT
22502011-07-15 Ian Lance Taylor <iant@google.com>
2251
2252 * options.h (class General_options): Add --print-output-format.
2253 Move -EL next to -EB, for better --help output.
2254 * target-select.cc: Include <cstdio>, "options.h", and
2255 "parameters.h".
2256 (Target_selector::do_target_bfd_name): New function.
2257 (print_output_format): New function.
2258 * target-select.h (class Target_selector): Update declarations.
2259 (Target_selector::target_bfd_name): New function.
2260 (print_output_format): Declare.
2261 * main.cc: Include "target-select.h".
2262 (main): Handle --print-output-format.
2263 * gold.cc: Include "target-select.h".
2264 (queue_initial_tasks): Handle --print-output-format when there are
2265 no input files.
2266 * parameters.cc (parameters_force_valid_target): Give a better
2267 error message if -EB/-EL does not match target.
2268 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
2269 function.
2270
7d172687
ILT
22712011-07-15 Ian Lance Taylor <iant@google.com>
2272
2273 * i386.cc (class Output_data_plt_i386): Add layout_ field.
2274 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
2275 (Output_data_plt_i386::do_write): Write address of .dynamic
2276 section to first entry in .got.plt section.
2277 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
2278 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
2279 Initialize layout_.
2280 (Output_data_plt_x86_64::do_write): Write address of .dynamic
2281 section to first entry in .got.plt section.
2282 * layout.h (Layout::dynamic_section): New function.
2283
e9552f7e
ST
22842011-07-13 Sriraman Tallam <tmsriram@google.com>
2285
2286 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
2287 to claim_file call.
2288 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
2289 input_section_position_, and input_section_glob_.
2290 (read_layout_from_file): Call function section_ordering_specified.
2291 * layout.h (is_section_ordering_specified): New function.
2292 (section_ordering_specified): New function.
2293 (section_ordering_specified_): New boolean member.
2294 * main.cc(main): Call load_plugins after layout object is defined.
2295 * output.cc (Output_section::add_input_section): Use
2296 function section_ordering_specified to check if section ordering is
2297 needed.
2298 * output.cc (Output_section::add_relaxed_input_section): Use
2299 function section_ordering_specified to check if section ordering is
2300 needed.
2301 (Output_section::update_section_layout): New function.
2302 (Output_section::sort_attached_input_sections): Check if input section
2303 must be reordered.
2304 * output.h (Output_section::update_section_layout): New function.
2305 * plugin.cc (get_section_count): New function.
2306 (get_section_type): New function.
2307 (get_section_name): New function.
2308 (get_section_contents): New function.
2309 (update_section_order): New function.
58797674 2310 (allow_section_ordering): New function.
e9552f7e
ST
2311 (Plugin::load): Add the new interfaces to the transfer vector.
2312 (Plugin_manager::load_plugins): New parameter.
2313 (Plugin_manager::all_symbols_read): New parameter.
2314 (Plugin_manager::claim_file): New parameter. Save the elf object for
2315 unclaimed objects.
2316 (Plugin_manager::get_elf_object): New function.
2317 (Plugin_manager::get_view): Change to directly use the bool to check
2318 if get_view is called from claim_file_hook.
2319 * plugin.h (input_objects): New function
2320 (Plugin__manager::load_plugins): New parameter.
2321 (Plugin_manager::claim_file): New parameter.
2322 (Plugin_manager::get_elf_object): New function.
2323 (Plugin_manager::in_claim_file_handler): New function.
2324 (Plugin_manager::in_claim_file_handler_): New member.
2325 (layout): New function.
2326 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
2327 handler with an extra parameter. Make the elf object before calling
2328 claim_file handler.
2329 * testsuite/plugin_test.c (get_section_count): New function pointer.
2330 (get_section_type): New function pointer.
2331 (get_section_name): New function pointer.
2332 (get_section_contents): New function pointer.
2333 (update_section_order): New function pointer.
2334 (allow_section_ordering): New function pointer.
2335 (onload): Check if the new interfaces exist.
2336
9446efde
ILT
23372011-07-13 Ian Lance Taylor <iant@google.com>
2338
2339 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
2340 relro section.
2341 * x86_64.cc (Target_x86_64::got_section): Likewise.
2342 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
2343 (relro_now_test_SOURCES): New variable.
2344 (relro_now_test_DEPENDENCIES): New variable.
2345 (relro_now_test_LDFLAGS): New variable.
2346 (relro_now_test_LDADD): New variable.
2347 (relro_now_test.so): New target.
2348 * testsuite/Makefile.in: Rebuild.
2349
07aa62f2
ILT
23502011-07-12 Ian Lance Taylor <iant@google.com>
2351
2352 PR gold/12980
2353 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
2354 GLOB_DAT relocation rather than a RELATIVE relocation for a
2355 protected symbol when creating a shared library.
2356 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
2357 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
2358 * testsuite/protected_main_1.cc (main): Test that protected
2359 function has same address.
2360
e2153196
ILT
23612011-07-11 Ian Lance Taylor <iant@google.com>
2362
2363 PR gold/12979
2364 * options.h (class General_options): Add -Bgroup.
2365 * options.cc (General_options::finalize): If -Bgroup is set,
2366 default to --unresolved-symbols=report-all.
2367 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
2368 * target-reloc.h (issue_undefined_symbol_error): Handle
2369 --unresolved-symbols=report-all.
2370
6daf5215
ILT
23712011-07-08 Ian Lance Taylor <iant@google.com>
2372
2373 PR gold/11985
2374 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
2375 if linker script discards key sections.
2376 (Layout::create_dynamic_symtab): Likewise.
2377 (Layout::assign_local_dynsym_offsets): Likewise.
2378 (Layout::sized_create_version_sections): Likewise.
2379 (Layout::create_interp): Likewise.
2380 (Layout::finish_dynamic_section): Likewise.
2381 (Layout::set_dynamic_symbol_size): Likewise.
2382
beabb2c6
ILT
23832011-07-08 Ian Lance Taylor <iant@google.com>
2384
2385 PR gold/12386
2386 * options.h (class General_options): Add --unresolved-symbols.
2387 * target-reloc.h (issue_undefined_symbol_error): Check
2388 --unresolved-symbols. Add comments.
2389
9c16daf1
ILT
23902011-07-08 Ian Lance Taylor <iant@google.com>
2391
2392 * testsuite/odr_violation2.cc (Ordering::operator()): Make
2393 expression more complex.
2394
191f1a2d
ILT
23952011-07-08 Ian Lance Taylor <iant@google.com>
2396
2397 PR gold/11317
2398 * target-reloc.h (issue_undefined_symbol_error): New inline
2399 function, broken out of relocate_section.
2400 (relocate_section): Call issue_undefined_symbol_error.
2401 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
2402 there is no TLS segment if we are about to issue an undefined
2403 symbol error.
2404 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
2405
62855347
ILT
24062011-07-08 Ian Lance Taylor <iant@google.com>
2407
2408 PR gold/12279
2409 * resolve.cc (Symbol_table::should_override): Add fromtype
2410 parameter. Change all callers. Give error when linking together
2411 TLS and non-TLS symbol.
2412 (Symbol_table::should_override_with_special): Add fromtype
2413 parameter. Change all callers.
2414 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
2415 there is no TLS segment if we have reported some errors.
2416 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
2417
67181c72
ILT
24182011-07-08 Ian Lance Taylor <iant@google.com>
2419
2420 PR gold/12372
2421 * target.h (Target::plt_address_for_global): New function.
2422 (Target::plt_address_for_local): New function.
2423 (Target::plt_section_for_global): Remove.
2424 (Target::plt_section_for_local): Remove.
2425 (Target::do_plt_address_for_global): New virtual function.
2426 (Target::do_plt_address_for_local): New virtual function.
2427 (Target::do_plt_section_for_global): Remove.
2428 (Target::do_plt_section_for_local): Remove.
2429 (Target::register_global_plt_entry): Add Symbol_table and Layout
2430 parameters.
2431 * output.cc (Output_data_got::Got_entry::write): Use
2432 plt_address_for_global and plt_address_for_local.
2433 * layout.cc (Layout::add_target_dynamic_tags): Use size and
2434 address of output section.
2435 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
2436 got_irelative_, and irelative_count_ fields. Update
2437 declarations.
2438 (Output_data_plt_i386::has_irelative_section): New function.
2439 (Output_data_plt_i386::entry_count): Add irelative_count_.
2440 (Output_data_plt_i386::set_final_data_size): Likewise.
2441 (class Target_i386): Add got_irelative_ and rel_irelative_
2442 fields. Update declarations.
2443 (Target_i386::Target_i386): Initialize new fields.
2444 (Target_i386::do_plt_address_for_global): New function replacing
2445 do_plt_section_for_global.
2446 (Target_i386::do_plt_address_for_local): New function replacing
2447 do_plt_section_for_local.
2448 (Target_i386::got_section): Create got_irelative_.
2449 (Target_i386::rel_irelative_section): New function.
2450 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
2451 fields. Don't define __rel_iplt_{start,end}.
2452 (Output_data_plt_i386::add_entry): Add symtab and layout
2453 parameters. Change all callers. Use different PLT and GOT for
2454 IFUNC symbols.
2455 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
2456 layout parameters. Change all callers. Use different PLT and
2457 GOT.
2458 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
2459 (Output_data_plt_i386::rel_irelative): New function.
2460 (Output_data_plt_i386::address_for_global): New function.
2461 (Output_data_plt_i386::address_for_local): New function.
2462 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
2463 IRELATIVE GOT when changing IFUNC GOT entries.
2464 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
2465 reloc.
2466 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
2467 if we didn't create an IRELATIVE GOT.
2468 (Target_i386::Relocate::relocate): Use plt_address_for_global and
2469 plt_address_for_local.
2470 (Target_i386::do_dynsym_value): Use plt_address_for_global.
2471 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
2472 got_irelative_, and irelative_count_ fields. Update
2473 declarations.
2474 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
2475 Initialize new fields. Remove symtab parameter. Change all
2476 callers.
2477 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
2478 irelative_count_.
2479 (Output_data_plt_x86_64::has_irelative_section): New function.
2480 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
2481 (class Target_x86_64): Add got_irelative_ and rel_irelative_
2482 fields. Update declarations.
2483 (Target_x86_64::Target_x86_64): Initialize new fields.
2484 (Target_x86_64::do_plt_address_for_global): New function replacing
2485 do_plt_section_for_global.
2486 (Target_x86_64::do_plt_address_for_local): New function replacing
2487 do_plt_section_for_local.
2488 (Target_x86_64::got_section): Create got_irelative_.
2489 (Target_x86_64::rela_irelative_section): New function.
2490 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
2491 all callers. Don't create __rel_iplt_{start,end}.
2492 (Output_data_plt_x86_64::add_entry): Add symtab and layout
2493 parameters. Change all callers. Use different PLT and GOT for
2494 IFUNC symbols.
2495 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
2496 layout parameters. Change all callers. Use different PLT and
2497 GOT.
2498 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
2499 parameters. Change all callers. Use different PLT and GOT for
2500 IFUNC symbols.
2501 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
2502 (Output_data_plt_x86_64::rela_irelative): New function.
2503 (Output_data_plt_x86_64::address_for_global): New function.
2504 (Output_data_plt_x86_64::address_for_local): New function.
2505 (Output_data_plt_x86_64::set_final_data_size): Likewise.
2506 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
2507 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
2508 (Target_x86_64::register_global_plt_entry): Add symtab and layout
2509 parameters.
2510 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
2511 reloc.
2512 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
2513 symbols if we didn't create an IRELATIVE GOT.
2514 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
2515 plt_address_for_local.
2516 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
2517 * testsuite/ifuncvar1.c: New test file.
2518 * testsuite/ifuncvar2.c: New test file.
2519 * testsuite/ifuncvar3.c: New test file.
2520 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
2521 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
2522 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
2523 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
2524 * testsuite/Makefile.in: Rebuild.
2525
33c15b45
CC
25262011-07-07 Cary Coutant <ccoutant@google.com>
2527
2528 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
2529 (two_file_test_1_ndebug.o): Likewise.
2530 (two_file_test_1b_ndebug.o): Likewise.
2531 (two_file_test_2_ndebug.o): Likewise.
2532 (two_file_test_main_ndebug.o): Likewise.
2533 (incremental_test_2): Link with no-debug versions.
2534
f48b5fb7
CC
25352011-07-06 Cary Coutant <ccoutant@google.com>
2536
2537 * gold/incremental.cc
2538 (Output_section_incremental_inputs::write_info_blocks): Check for
2539 hidden and internal symbols.
2540
221597a5
CC
25412011-07-06 Cary Coutant <ccoutant@google.com>
2542
2543 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
2544 Check disposition for startup file.
2545 (Incremental_inputs::report_command_line): Ignore
2546 --incremental-startup-unchanged option.
2547 * options.cc (General_options::parse_incremental_startup_unchanged):
2548 New function.
2549 (General_options::General_options): Initialize new data member.
2550 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
2551 (General_options): Add --incremental-startup-unchanged option.
2552 (General_options::incremental_startup_disposition): New function.
2553 (General_options::incremental_startup_disposition_): New data member.
2554
e24719f6
CC
25552011-07-06 Cary Coutant <ccoutant@google.com>
2556
2557 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
2558 input file index to Script_info ctor.
2559 (Sized_incremental_binary::do_file_has_changed): Find the
2560 command-line argument for files named in scripts.
2561 * incremental.h (Script_info::Script_info): New ctor
2562 with input file index.
2563 (Script_info::input_file_index): New function.
2564 (Script_info::input_file_index_): New data member.
2565 (Incremental_binary::get_library): Add const.
2566 (Incremental_binary::get_script_info): Add const.
2567 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
2568 * testsuite/Makefile.am (incremental_test_5): New test case.
2569 (incremental_test_6): New test case.
2570 * testsuite/Makefile.in: Regenerate.
2571
8f7c81e8
CC
25722011-07-06 Cary Coutant <ccoutant@google.com>
2573
2574 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
2575 debug output when command lines differ.
2576
9fbd3822
CC
25772011-07-06 Cary Coutant <ccoutant@google.com>
2578
2579 * incremental.cc (Incremental_inputs::report_command_line): Ignore
2580 --incremental-patch option.
2581 * layout.cc (Free_list::allocate): Extend allocation beyond original
2582 end if enabled.
2583 (Layout::make_output_section): Mark sections that should get
2584 patch space.
2585 * options.cc (parse_percent): New function.
2586 * options.h (parse_percent): New function.
2587 (DEFINE_percent): New macro.
2588 (General_options): Add --incremental-patch option.
2589 * output.cc (Output_section::Output_section): Initialize new data
2590 members.
2591 (Output_section::add_input_section): Print section name when out
2592 of patch space.
2593 (Output_section::add_output_section_data): Likewise.
2594 (Output_section::set_final_data_size): Add patch space when
2595 doing --incremental-full.
2596 (Output_section::do_reset_address_and_file_offset): Remove patch
2597 space.
2598 (Output_segment::set_section_list_addresses): Print debug output
2599 only if --incremental-update.
2600 * output.h (Output_section::set_is_patch_space_allowed): New function.
2601 (Output_section::is_patch_space_allowed_): New data member.
2602 (Output_section::patch_space_): New data member.
2603 * parameters.cc (Parameters::incremental_full): New function.
2604 * parameters.h (Parameters::incremental_full): New function
2605 * testsuite/Makefile.am (incremental_test_2): Add test for
2606 --incremental-patch option.
2607 * testsuite/Makefile.in: Regenerate.
2608 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
2609 (t18): Remove function body.
2610
f6cccc2c
DK
26112011-07-05 Doug Kwan <dougkwan@google.com>
2612
2613 PR gold/12771
2614 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
2615 Arm_Address type for relocation result.
2616 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
2617 overflow check.
2618 (Arm_relocate_functions::abs32): Use unaligned access.
2619 (Arm_relocate_functions::rel32): Ditto.
2620 (Arm_relocate_functions::prel31): Ditto.
2621 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
2622 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
2623 static data relocations.
2624 * testsuite/Makefile.in: Regnerate.
2625 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
2626
28a13fec
ILT
26272011-07-05 Ian Lance Taylor <iant@google.com>
2628
2629 PR gold/12392
2630 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
2631 symbols if necessary.
2632 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
2633
24d47b34
ILT
26342011-07-05 Ian Lance Taylor <iant@google.com>
2635
2636 PR gold/12952
2637 * resolve.cc (Symbol::override_base_with_special): Simply override
2638 version with special symbol version, ignoring previous version.
2639
41f9cbbe
ILT
26402011-07-05 Ian Lance Taylor <iant@google.com>
2641
2642 * object.cc (Sized_relobj_file::include_section_group): Add
2643 information to comment about signature location.
2644
886288f1
ILT
26452011-07-02 Ian Lance Taylor <iant@google.com>
2646
2647 PR gold/12957
2648 * options.h (class General_options): Add -f and -F.
2649 * options.cc (General_options::finalize): Fatal error if -f/-F
2650 are used without -shared.
2651 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
2652
ae3a6d4f
ILT
26532011-07-02 Ian Lance Taylor <iant@google.com>
2654
2655 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
2656
21131061
ILT
26572011-07-01 Ian Lance Taylor <iant@google.com>
2658
2659 PR gold/12525
2660 PR gold/12952
2661 * resolve.cc (Symbol::override_base_with_special): Don't override
2662 the version if the overriding symbol has a different name.
2663 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
2664 all callers. If we give an error about an undefined version,
2665 define the base version if necessary.
2666 * dynobj.h (class Versions): Update declaration.
2667 * testsuite/weak_alias_test_5.cc: New file.
2668 * testsuite/weak_alias_test.script: New file.
2669 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
2670 and versioned_alias have the right value, and call t2.
2671 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
2672 weak_alias_test_5.so.
2673 (weak_alias_test_LDADD): Likewise.
2674 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
2675 * testsuite/Makefile.in: Rebuild.
2676
611062c0
ILT
26772011-07-01 Ian Lance Taylor <iant@google.com>
2678
2679 PR gold/12525
2680 * options.h (class General_options): Support -z notext.
2681 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
2682 -Wl,-z,notext.
2683 (two_file_shared_nonpic.so): Likewise.
2684 (two_file_shared_mixed.so): Likewise.
2685 (two_file_shared_mixed_1.so): Likewise.
2686 (weak_undef_lib_nonpic.so): Likewise.
2687 (alt/weak_undef_lib_nonpic.so): Likewise.
2688 (tls_test_shared_nonpic.so): Likewise.
2689 * testsuite/Makefile.in: Rebuild.
2690
328c7c2f
ILT
26912011-07-01 Ian Lance Taylor <iant@google.com>
2692
2693 PR gold/12525
2694 * configure.ac: Test whether static linking works, setting
2695 the automake conditional HAVE_STATIC.
2696 * testsuite/Makefile.am: Disable tests using -static if
2697 HAVE_STATIC is not true.
2698 * configure, testsuite/Makefile.in: Rebuild.
2699
02d7cd44
ILT
27002011-07-01 Ian Lance Taylor <iant@google.com>
2701
2702 PR gold/12525
2703 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
2704 Assert if we see DW_EH_PE_indirect.
2705 * target.h (Target::ehframe_datarel_base): New function.
2706 (Target::do_ehframe_datarel_base): New target function.
2707 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
2708 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
2709 function.
2710
07a60597
ILT
27112011-07-01 Ian Lance Taylor <iant@google.com>
2712
2713 PR gold/12571
2714 * options.h (class General_options): Add
2715 --ld-generated-unwind-info.
2716 * ehframe.cc (Fde::write): Add address parameter. Change all
2717 callers. If associated with PLT, fill in address and size.
2718 (Cie::set_output_offset): Only add merge mapping if there is an
2719 object.
2720 (Cie::write): Add address parameter. Change all callers.
2721 (Eh_frame::add_ehframe_for_plt): New function.
2722 * ehframe.h (class Fde): Update declarations. Move shndx_ and
2723 input_offset_ fields into union u_, with new plt field.
2724 (Fde::Fde): Adjust for new union field.
2725 (Fde::Fde) [Output_data version]: New constructor.
2726 (Fde::add_mapping): Only add merge mapping if there is an object.
2727 (class Cie): Update declarations.
2728 (class Eh_frame): Declare add_ehframe_for_plt.
2729 * layout.cc (Layout::layout_eh_frame): Break out code into
2730 make_eh_frame_section, and call it.
2731 (Layout::make_eh_frame_section): New function.
2732 (Layout::add_eh_frame_for_plt): New function.
2733 * layout.h (class Layout): Update declarations.
2734 * merge.cc (Merge_map::add_mapping): Add assertion.
2735 * i386.cc: Include "dwarf.h".
2736 (class Output_data_plt_i386): Make first_plt_entry,
2737 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
2738 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
2739 and plt_eh_frame_fde.
2740 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
2741 boundary. Call add_eh_frame_for_plt if appropriate.
2742 * x86_64.cc: Include "dwarf.h".
2743 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
2744 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
2745 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
2746 and plt_eh_frame_fde.
2747 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
2748 appropriate.
2749
14788a3f
ILT
27502011-06-29 Ian Lance Taylor <iant@google.com>
2751
2752 PR gold/12629
2753 * object.cc (Sized_relobj_file::layout_section): Change shdr
2754 parameter to be const.
2755 (Sized_relobj_file::layout_eh_frame_section): New function, broken
2756 out of do_layout.
2757 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
2758 appropriate. Call layout_eh_frame_section.
2759 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
2760 sections.
2761 * object.h (class Sized_relobj_file): Update declarations.
2762
6c21fce1
ILT
27632011-06-29 Ian Lance Taylor <iant@google.com>
2764
37e41b03 2765 PR gold/12652
6c21fce1
ILT
2766 * script.cc (Token::integer_value): Accept trailing M/m/K/k
2767 modifier.
2768 (Lex::gather_token): Accept trailing M/m/K/k for integers.
2769
4d5e4e62
ILT
27702011-06-29 Ian Lance Taylor <iant@google.com>
2771
2772 PR gold/12675
2773 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
2774 SHT_X86_64_UNWIND.
2775 * layout.cc (Layout::layout_eh_frame): Likewise.
2776
886f533a
ILT
27772011-06-29 Ian Lance Taylor <iant@google.com>
2778
2779 PR gold/12695
2780 * layout.cc (Layout::symtab_section_shndx): New function.
2781 * layout.h (class Layout): Declare symtab_section_shndx.
2782 * output.cc (Output_section::write_header): Call it.
2783
f3ae1b28
ILT
27842011-06-29 Ian Lance Taylor <iant@google.com>
2785
2786 PR gold/12818
2787 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
2788 symbols which are not used in a relocation.
2789
aecf301f
ILT
27902011-06-28 Ian Lance Taylor <iant@google.com>
2791
2792 PR gold/12898
2793 * layout.cc (Layout::segment_precedes): Don't crash if a linker
2794 script create indistinguishable segments.
2795 (Layout::set_segment_offsets): Use stable_sort when sorting
2796 segments. Pass this to Compare_segments constructor.
2797 * layout.h (class Layout): Make segment_precedes non-static.
2798 (class Compare_segments): Change from struct to class. Add
2799 layout_ field. Add constructor.
2800 * script-sections.cc
2801 (Script_sections::attach_sections_using_phdrs_clause): Rename
2802 local orphan to is_orphan. Don't report failure to put empty
2803 section in segment. On attachment failure, report name of
2804 section, and attach to first PT_LOAD segment.
2805
03ef7571
ILT
28062011-06-28 Ian Lance Taylor <iant@google.com>
2807
2808 PR gold/12934
2809 * target-select.cc (Target_selector::Target_selector): Add
2810 emulation parameter. Change all callers.
2811 (select_target_by_bfd_name): Rename from select_target_by_name.
2812 Change all callers.
2813 (select_target_by_emulation): New function.
2814 (supported_emulation_names): New function.
2815 * target-select.h (class Target_selector): Add emulation_ field.
2816 Update declarations.
2817 (Target_selector::recognize_by_bfd_name): Rename from
2818 recognize_by_name. Change all callers.
2819 (Target_selector::supported_bfd_names): Rename from
2820 supported_names. Change all callers.
2821 (Target_selector::recognize_by_emulation): New function.
2822 (Target_selector::supported_emulations): New function.
2823 (Target_selector::emulation): New function.
2824 (Target_selector::do_recognize_by_bfd_name): Rename from
2825 do_recognize_by_name. Change all callers.
2826 (Target_selector::do_supported_bfd_names): Rename from
2827 do_supported_names. Change all callers.
2828 (Target_selector::do_recognize_by_emulation): New function.
2829 (Target_selector::do_supported_emulations): New function.
2830 (select_target_by_bfd_name): Change name in declaration.
2831 (select_target_by_emulation): Declare.
2832 (supported_emulation_names): Declare.
2833 * parameters.cc (parameters_force_valid_target): Try to find
2834 target based on emulation from -m option.
2835 * options.h (class General_options): Change doc string for -m.
2836 * options.cc (help): Print emulations.
2837 (General_options::parse_V): Likewise.
2838 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
2839 Add emulation parameter. Change all callers.
2840
200b2bb9
ILT
28412011-06-28 Ian Lance Taylor <iant@google.com>
2842
2843 * target.h (class Target): Add osabi_ field.
2844 (Target::osabi): New function.
2845 (Target::set_osabi): New function.
2846 (Target::Target): Initialize osabi_.
2847 (Target::do_adjust_elf_header): Make pure virtual.
2848 (Sized_target::do_adjust_elf_header): Declare.
2849 * target.cc (Sized_target::do_adjust_elf_header): New function.
2850 (class Sized_target): Instantiate all versions.
2851 * freebsd.h (class Target_freebsd): Remove.
2852 (Target_selector_freebsd::do_recognize): Call set_osabi on
2853 Target.
2854 (Target_selector_freebsd::do_recognize_by_name): Likewise.
2855 (Target_selector_freebsd::set_osabi): Remove.
2856 * i386.cc (class Target_i386): Inherit from Sized_target rather
2857 than Target_freebsd.
2858 * x86_64.cc (class Target_x86_64): Likewise.
2859
b3ce541e
ILT
28602011-06-28 Ian Lance Taylor <iant@google.com>
2861
2862 * target.h (Target::can_check_for_function_pointers): Rewrite.
2863 Make non-virtual.
2864 (Target::can_icf_inline_merge_sections): Likewise.
2865 (Target::section_may_have_icf_unsafe_poineters): Likewise.
2866 (Target::Target_info): Add can_icf_inline_merge_sections field.
2867 (Target::do_can_check_for_function_pointers): New virtual
2868 function.
2869 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
2870 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
2871 from can_check_for_function_pointers, move in file.
2872 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
2873 section_may_have_icf_unsafe_poineters, move in file.
2874 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
2875 * i386.cc (Target_i386::do_can_check_for_function_pointers):
2876 Rename from can_check_for_function_pointers, move in file.
2877 (Target_i386::can_icf_inline_merge_sections): Remove.
2878 (Target_i386::i386_info): Initialize
2879 can_icf_inline_merge_sections.
2880 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
2881 Initialize can_icf_inline_merge_sections.
2882 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
2883 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
2884 Rename from can_check_for_function_pointers, move in file.
2885 (Target_x86_64::can_icf_inline_merge_sections): Remove.
2886 (Target_x86_64::x86_64_info): Initialize
2887 can_icf_inline_merge_sections.
2888 * testsuite/testfile.cc (Target_test::test_target_info):
2889 Likewise.
2890 * icf.cc (get_section_contents): Correct formatting.
2891
6d1c4efb
ILT
28922011-06-27 Ian Lance Taylor <iant@google.com>
2893
2894 * symtab.cc (Symbol::versioned_name): New function.
2895 (Symbol_table::add_to_final_symtab): Use versioned_name when
2896 appropriate.
2897 (Symbol_table::sized_write_symbol): Likewise.
2898 * symtab.h (class Symbol): Declare versioned_name.
2899 * stringpool.h (class Stringpool_template): Add variant of add
2900 which takes a std::basic_string.
2901 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
2902 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
2903 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
2904 (ver_test_12.o): New target.
2905 * testsuite/Makefile.in: Rebuild.
2906
57eb9b50
DK
29072011-06-27 Doug Kwan <dougkwan@google.com>
2908
2909 * arm.cc (Arm_relocate_functions::thm_jump8,
2910 Arm_relocate_functions::thm_jump11): Use a wider signed
2911 type to compute offset.
2912 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
2913 arm_thm_jump8.
2914 * testsuite/Makefile.in: Regenerate.
2915 * testsuite/arm_branch_in_range.sh: Check test results of
2916 arm_thm_jump11 and arm_thm_jump8.
2917 * testsuite/arm_thm_jump11.s: New test source file.
2918 * testsuite/arm_thm_jump11.t: New linker script.
2919 * testsuite/arm_thm_jump8.s: New test source file.
2920 * testsuite/arm_thm_jump8.t: New linker script.
2921
487b39df
ILT
29222011-06-24 Ian Lance Taylor <iant@google.com>
2923
2924 * layout.cc: Include "object.h".
2925 (ctors_sections_in_init_array): New static variable.
2926 (Layout::is_ctors_in_init_array): New function.
2927 (Layout::layout): Add entry to ctors_sections_in_init_array if
2928 appropriate.
2929 * layout.h (class Layout): Declare is_ctors_in_init_array.
2930 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
2931 is_ctors_reverse_view is set.
2932 (Sized_relobj_file::write_sections): Add layout parameter. Change
2933 all callers. Set is_ctors_reverse_view field of View_size.
2934 (Sized_relobj_file::reverse_words): New function.
2935 * object.h (Sized_relobj_file::View_size): Add
2936 is_ctors_reverse_view field.
2937 (class Sized_relobj_file): Update declarations.
2938 * testsuite/initpri3.c: New test.
2939 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
2940 initpri3b.
2941 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
2942 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
2943 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
2944 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
2945 * testsuite/Makefile.in: Rebuild.
2946
472076e4
CC
29472011-06-24 Cary Coutant <ccoutant@google.com>
2948
2949 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
2950 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
2951 (debug_msg_cdebug.err): New targets.
2952 * testsuite/Makefile.in: Regenerate.
2953 * testsuite/debug_msg.sh: Check output of link with compressed debug.
2954 Fix checks for link with shared library.
2955
a60af0db
DK
29562011-06-24 Doug Kwan <dougkwan@google.com>
2957
2958 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
2959 skip empty text sections.
2960 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
2961
5393d741
ILT
29622011-06-22 Ian Lance Taylor <iant@google.com>
2963
2964 PR gold/12910
2965 * options.h (class General_options): Add --ctors-in-init-array.
2966 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
2967 friends as SHT_PROGBITS for merging sections.
2968 (Layout::layout): Remove special handling of .init_array and
2969 friends. Don't sort if doing relocatable link. Sort for .ctors
2970 and .dtors if ctors_in_init_array.
2971 (Layout::make_output_section): Force correct section types for
2972 .init_array and friends. Don't sort if doing relocatable link,
2973 Don't sort .ctors and .dtors if ctors_in_init_array.
2974 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
2975 (Layout::output_section_name): Add relobj parameter. Change all
2976 callers. Handle .ctors. and .dtors. in code rather than table.
2977 Handle .ctors and .dtors if ctors_in_init_array.
2978 (Layout::match_file_name): New function, moved from output.cc.
2979 * layout.h (class Layout): Update declarations.
2980 * output.cc: Include "layout.h".
2981 (Input_section_sort_entry::get_priority): New function.
2982 (Input_section_sort_entry::match_file_name): Just call
2983 Layout::match_file_name.
2984 (Output_section::Input_section_sort_init_fini_compare::operator()):
2985 Handle .ctors and .dtors. Sort by explicit priority rather than
2986 by name.
2987 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
2988 * testsuite/initpri2.c: New test.
2989 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
2990 (check_PROGRAMS): Add initpri2.
2991 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
2992 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
2993 * configure, testsuite/Makefile.in: Rebuild.
2994
e1f74f98
ILT
29952011-06-19 Ian Lance Taylor <iant@google.com>
2996
2997 PR gold/12880
2998 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
2999 .interp section to a PT_INTERP segment even if we have seen a
3000 --dynamic-linker option. Don't do it if we have seen a PHDRS
3001 clause in a linker script.
3002 (Layout::finalize): Don't create a .interp section if we've
3003 already create a PT_INTERP segment.
3004 (Layout::create_interp): Always call choose_output_section (revert
3005 patch of 2011-06-17). Don't create PT_INTERP segment.
3006 * script-sections.cc
3007 (Script_sections::create_note_and_tls_segments): Add a .interp
3008 section to a PT_INTERP segment even if we have seen a
3009 --dynamic-linker option.
3010
766f91bb
ILT
30112011-06-18 Ian Lance Taylor <iant@google.com>
3012
3013 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
3014 merely because a non-PT_LOAD segment has a dynamic reloc.
3015
0d212c3a
ILT
30162011-06-18 Ian Lance Taylor <iant@google.com>
3017
3018 * layout.cc (Layout::finish_dynamic_section): Don't create
3019 DT_FLAGS entry if not needed.
3020
911a5072
ILT
30212011-06-18 Ian Lance Taylor <iant@google.com>
3022
3023 PR gold/12745
3024 * layout.cc (Layout::layout_eh_frame): Correct handling of
3025 writable .eh_frame section.
3026
534b4e5f
ILT
30272011-06-17 Ian Lance Taylor <iant@google.com>
3028
3029 PR gold/12893
3030 * resolve.cc (Symbol_table::resolve): Don't give an error if a
3031 symbol is redefined with the exact same object and value.
3032
10b4f102
ILT
30332011-06-17 Ian Lance Taylor <iant@google.com>
3034
3035 PR gold/12880
3036 * layout.h (class Layout): Add interp_segment_ field.
3037 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
3038 (Layout::attach_allocated_section_to_segment): If making shared
3039 library, put .interp section in PT_INTERP segment.
3040 (Layout::finalize): Also call create_interp if -dynamic-linker
3041 option was used.
3042 (Layout::create_interp): Assert that there is no PT_INTERP
3043 segment. If not using a SECTIONS clause, use make_output_section.
3044 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
3045 * script-sections.cc
3046 (Script_sections::create_note_and_tls_segments): If making shared
3047 library, put .interp section in PT_INTERP segment.
3048
a29b0dad
ILT
30492011-06-17 Ian Lance Taylor <iant@google.com>
3050
e588ea8d
ILT
3051 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
3052 when making a shared library.
3053
30542011-06-17 Ian Lance Taylor <iant@google.com>
3055
3056 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
3057 parameter. Change all callers. Don't issue warning about PC32
3058 against locally defined symbol.
a29b0dad 3059
9d3b0698
ILT
30602011-06-16 Ian Lance Taylor <iant@google.com>
3061
3062 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
3063 occurs in same object.
3064
85b0f90c
AM
30652011-06-14 Alan Modra <amodra@gmail.com>
3066
3067 * po/POTFILES.in: Regenerate.
3068
a94907d9
ILT
30692011-06-09 Ian Lance Taylor <iant@google.com>
3070
3071 * script-sections.cc
3072 (Orphan_output_section::set_section_addresses): For a relocatable
3073 link set address to 0.
3074
4fb3a1c3
CC
30752011-06-09 Cary Coutant <ccoutant@google.com>
3076
3077 PR gold/12804
3078 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
3079 used with --compress-debug-sections.
3080 * gold/object.cc (Sized_relobj_file::do_layout): Report
3081 uncompressed size of compressed input sections.
3082
61220854
CC
30832011-06-08 Cary Coutant <ccoutant@google.com>
3084
3085 PR gold/12804
3086 * testsuite/two_file_test_2_v1.cc: Change initialization of
3087 v2 to keep it in .data.
3088
e6455dfb
CC
30892011-06-07 Cary Coutant <ccoutant@google.com>
3090
3091 * common.cc (Symbol_table::do_allocate_commons_list): Call
3092 gold_fallback.
3093 * errors.cc (Errors::fatal): Adjust call to gold_exit.
3094 (Errors::fallback): New function.
3095 (gold_fallback): New function.
3096 * errors.h (Errors::fallback): New function.
3097 * gold.cc (gold_exit): Change status parameter to enum; adjust
3098 all callers.
3099 (queue_initial_tasks): Call gold_fallback.
3100 * gold.h: Include cstdlib.
3101 (Exit_status): New enum type.
3102 (gold_exit): Change status parameter to enum.
3103 (gold_fallback): New function.
3104 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
3105 (Layout::create_symtab_sections): Likewise.
3106 (Layout::create_shdrs): Likewise.
3107 * main.cc (main): Adjust call to gold_exit.
3108 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
3109 (Output_data_got::add_got_entry_pair): Likewise.
3110 (Output_section::add_input_section): Likewise.
3111 (Output_section::add_output_section_data): Likewise.
3112 (Output_segment::set_section_list_addresses): Likewise.
3113 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
3114
fb0e076f
CC
31152011-06-07 Cary Coutant <ccoutant@google.com>
3116
3117 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
3118 for incremental links.
3119 * output.cc (Output_segment::set_section_list_addresses): Remove
3120 FIXME and test for TLS or BSS.
3121
a5ee4d5d
CC
31222011-06-07 Cary Coutant <ccoutant@google.com>
3123
3124 * testsuite/Makefile.am: Add incremental_copy_test,
3125 incremental_common_test_1.
3126 * testsuite/Makefile.in: Regenerate.
3127 * testsuite/common_test_1_v1.c: New source file.
3128 * testsuite/common_test_1_v2.c: New source file.
3129 * testsuite/copy_test_v1.cc: New source file.
3130
5146f448
CC
31312011-06-07 Cary Coutant <ccoutant@google.com>
3132
3133 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
3134 update, allocate common from bss section's free list.
3135 * incremental-dump.cc (dump_incremental_inputs): Print flag for
3136 linker-defined symbols.
3137 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
3138 Skip GOT and PLT entries that are no longer referenced.
3139 (Output_section_incremental_inputs::write_info_blocks): Mark
3140 linker-defined symbols.
3141 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
3142 * output.cc (Output_section::allocate): New function.
3143 * output.h (Output_section::allocate): New function.
3144 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
3145 linker-defined symbols.
3146 (Symbol::override_base_with_special): Copy is_predefined_ flag.
3147 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
3148 (Symbol::init_base_output_data): Likewise.
3149 (Symbol::init_base_output_segment): Likewise.
3150 (Symbol::init_base_constant): Likewise.
3151 (Sized_symbol::init_output_data): Likewise.
3152 (Sized_symbol::init_output_segment): Likewise.
3153 (Sized_symbol::init_constant): Likewise.
3154 (Symbol_table::do_define_in_output_data): Likewise.
3155 (Symbol_table::do_define_in_output_segment): Likewise.
3156 (Symbol_table::do_define_as_constant): Likewise.
3157 * symtab.h (Symbol::is_predefined): New function.
3158 (Symbol::init_base_output_data): Add is_predefined parameter.
3159 (Symbol::init_base_output_segment): Likewise.
3160 (Symbol::init_base_constant): Likewise.
3161 (Symbol::is_predefined_): New data member.
3162 (Sized_symbol::init_output_data): Add is_predefined parameter.
3163 (Sized_symbol::init_output_segment): Likewise.
3164 (Sized_symbol::init_constant): Likewise.
3165 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
3166
26d3c67d
CC
31672011-06-07 Cary Coutant <ccoutant@google.com>
3168
3169 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
3170 instead of emit_copy_reloc.
3171 (Copy_relocs::emit_copy_reloc): Refactor.
3172 (Copy_relocs::make_copy_reloc): New function.
3173 (Copy_relocs::add_copy_reloc): Remove.
3174 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
3175 section.
3176 (Copy_relocs::make_copy_reloc): New function.
3177 (Copy_relocs::add_copy_reloc): Remove.
3178 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
3179 unchanged input files.
3180 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
3181 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
3182 Reserve BSS space for COPY relocations.
3183 (Sized_incremental_binary::do_emit_copy_relocs): New function.
3184 (Output_section_incremental_inputs::write_info_blocks): Record
3185 whether a symbol is copied from a shared object.
3186 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
3187 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
3188 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
3189 (Incremental_input_entry_reader::get_output_symbol_index): Add
3190 is_copy parameter.
3191 (Incremental_binary::emit_copy_relocs): New function.
3192 (Incremental_binary::do_emit_copy_relocs): New function.
3193 (Sized_incremental_binary::Sized_incremental_binary): Initialize
3194 new data member.
3195 (Sized_incremental_binary::add_copy_reloc): New function.
3196 (Sized_incremental_binary::do_emit_copy_relocs): New function.
3197 (Sized_incremental_binary::Copy_reloc): New struct.
3198 (Sized_incremental_binary::Copy_relocs): New typedef.
3199 (Sized_incremental_binary::copy_relocs_): New data member.
3200 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
3201 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
3202 * target.h (Sized_target::emit_copy_reloc): New function.
3203 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
3204
7cdb37d9
CC
32052011-06-02 Cary Coutant <ccoutant@google.com>
3206
3207 PR gold/12163
3208 * gold/archive.cc (Archive::Archive): Initialize new data member.
3209 (Archive::include_all_members): Return if archive has already been
3210 included.
3211 * gold/archive.h (Archive::include_all_members_): New data member.
3212
cc643b88
NC
32132011-06-02 Nick Clifton <nickc@redhat.com>
3214
3215 * dynobj.h: Fix spelling mistake in comment.
3216 * output.cc: Likewise.
3217
f62a3ca7 32182011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 3219 Asier Llano
f62a3ca7
DK
3220
3221 PR gold/12826
cc643b88 3222 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
3223 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
3224 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
3225 redundant arm_exidx_test.so.
3226 * testsuite/Makefile.in: Regenerate.
3227 (check_SCRIPTS): Add pr12826.sh
3228 (check_DATA): Add pr12826.stdout
3229 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
3230 * testsuite/pr12826.sh: New file.
3231 * testsuite/pr12826_1.s: Ditto.
3232 * testsuite/pr12826_1.s: Ditto.
3233
8dbe1edc
ILT
32342011-05-30 Ian Lance Taylor <iant@google.com>
3235
3236 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
3237 sections.
3238
c49875be
ILT
32392011-05-29 Ian Lance Taylor <iant@google.com>
3240
3241 PR gold/12804
3242 * testsuite/Makefile.am: Use different file name for two_file_test
3243 temporary file for each incremental test.
3244 * testsuite/Makefile.in: Rebuild.
3245
69d53f7a
ILT
32462011-05-29 Ian Lance Taylor <iant@google.com>
3247
3248 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
3249 binary input file is empty.
3250
41d0ab5f
ILT
32512011-05-27 Ian Lance Taylor <iant@google.com>
3252
3253 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
3254 (ver_test_9.so): Likewise.
3255 * testsuite/Makefile.in: Rebuild.
3256
89d8a36b
CC
32572011-05-26 Cary Coutant <ccoutant@google.com>
3258
3259 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
3260 * incremental.cc (Incremental_inputs::report_input_section): Fix
3261 comment, indentation.
3262 (Incremental_inputs::report_comdat_group): New function.
3263 (Output_section_incremental_inputs::set_final_data_size): Adjust size
3264 of data for incremental input file entry.
3265 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
3266 group count, COMDAT group signatures.
3267 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
3268 an unchanged input file.
3269 * incremental.h (Incremental_object_entry::Incremental_object_entry):
3270 Initialize new data member.
3271 (Incremental_object_entry::add_comdat_group): New function.
3272 (Incremental_object_entry::get_comdat_group_count): New function.
3273 (Incremental_object_entry::get_comdat_signature_key): New function.
3274 (Incremental_object_entry::groups_): New data member.
3275 (Incremental_inputs::report_comdat_group): New function.
3276 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
3277 data for incremental input file entry.
3278 (Incremental_input_entry_reader::get_comdat_group_count): New function.
3279 (Incremental_input_entry_reader::get_input_section): Adjust size of
3280 data for incremental input file entry.
3281 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
3282 (Incremental_input_entry_reader::get_comdat_group_signature): New
3283 function.
3284 * object.cc (Sized_relobj::include_section_group): Report kept
3285 COMDAT groups for incremental links.
3286
1706a06f
ILT
32872011-05-24 David Meyer <pdox@google.com>
3288
3289 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
3290 with name parameter. Add found_name parameter.
3291 * fileread.cc (Input_file::find_file): Adjust code accordingly.
3292 * dirsearch.h (class Dirsearch): Update declaration.
3293
a10ae760
ILT
32942011-05-24 Ian Lance Taylor <iant@google.com>
3295
3296 * archive.cc (Library_base::should_include_member): Pull in object
3297 from archive if it defines the entry symbol.
3298 * parameters.cc (Parameters::entry): New function.
3299 * parameters.h (class Parameters): Declare entry.
3300 * output.h (class Output_file_header): Remove entry_ field.
3301 * output.cc (Output_file_header::Output_file_header): Remove entry
3302 parameter. Change all callers.
3303 (Output_file_header::entry): Use parameters->entry.
3304 * gold.cc (queue_middle_tasks): Likewise.
3305 * plugin.cc (Plugin_hook::run): Likewise.
3306
aa92d6ed
CC
33072011-05-24 Cary Coutant <ccoutant@google.com>
3308
3309 * gold.cc (queue_initial_tasks): Pass incremental base filename
3310 to Output_file::open_base_file; don't print error message.
3311 * incremental-dump.cc (main): Adjust call to
3312 Output_file::open_for_modification.
3313 * incremental-dump.cc (main): Likewise.
3314 * incremental.cc (Incremental_inputs::report_command_line):
3315 Ignore --incremental-base option when comparing command lines.
3316 Ignore parameter when given as separate argument.
3317 * options.h (class General_options): Add --incremental-base.
3318 * output.cc (Output_file::Output_file):
3319 (Output_file::open_base_file): Add base_name and writable parameters;
3320 read base file into new file; print error message here.
3321 (Output_file::map_no_anonymous): Add writable parameter; adjust all
3322 callers.
3323 * output.h (Output_file::open_for_modification): Rename to...
3324 (Output_file::open_base_file): ...this; add base_name and
3325 writable parameters; adjust all callers.
3326 (Output_file::map_no_anonymous): Add writable parameter; adjust all
3327 callers.
3328 * testsuite/Makefile.am (incremental_test_4): Test
3329 --incremental-base.
3330 * testsuite/Makefile.in: Regenerate.
3331
2eedd706
CC
33322011-05-24 Cary Coutant <ccoutant@google.com>
3333
3334 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
3335 incremental_test_4.
3336 * testsuite/Makefile.in: Regenerate.
3337 * testsuite/two_file_test_1_v1.cc: New test source file.
3338 * testsuite/two_file_test_1b_v1.cc: New test source file.
3339 * testsuite/two_file_test_2_v1.cc: New test source file.
3340
0f1c85a6
CC
33412011-05-24 Cary Coutant <ccoutant@google.com>
3342
3343 * dynobj.h (Dynobj::do_dynobj): New function.
3344 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
3345 flag and soname for shared objects.
3346 * incremental.cc (Incremental_inputs::report_object): Make
3347 either Incremental_object_entry or Incremental_dynobj_entry; add
3348 soname to string table.
3349 (Incremental_inputs::report_input_section): Add assertion.
3350 (Output_section_incremental_inputs::set_final_data_size): Adjust
3351 type of input file entry for shared libraries; adjust size of
3352 shared library info entry.
3353 (Output_section_incremental_inputs::write_input_files): Write
3354 as_needed flag for shared libraries.
3355 (Output_section_incremental_inputs::write_info_blocks): Adjust type
3356 of input file entry for shared libraries; write soname.
3357 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
3358 soname from incremental info.
3359 * incremental.h (enum Incremental_input_flags): Add
3360 INCREMENTAL_INPUT_AS_NEEDED.
3361 (Incremental_input_entry::Incremental_input_entry): Initialize new
3362 data member.
3363 (Incremental_input_entry::set_as_needed): New function.
3364 (Incremental_input_entry::as_needed): New function.
3365 (Incremental_input_entry::do_dynobj_entry): New function.
3366 (Incremental_input_entry::as_needed_): New data member.
3367 (Incremental_object_entry::Incremental_object_entry): Don't check
3368 for shared library.
3369 (Incremental_object_entry::do_type): Likewise.
3370 (class Incremental_dynobj_entry): New class.
3371 (Incremental_input_entry_reader::as_needed): New function.
3372 (Incremental_input_entry_reader::get_soname): New function.
3373 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
3374 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
3375 size of shared library info entry.
58797674 3376 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
3377 incremental link when adding DT_NEEDED entries.
3378 * object.h (Object::Object): Initialize new data member.
3379 (Object::dynobj): New function.
3380 (Object::set_as_needed): New function.
3381 (Object::as_needed): New function.
3382 (Object::do_dynobj): New function.
3383 (Object::as_needed_): New data member.
3384
6fa2a40b
CC
33852011-05-24 Cary Coutant <ccoutant@google.com>
3386
3387 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
3388 info; adjust display of GOT entries.
3389 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
3390 vector of input objects; remove file_status_.
3391 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
3392 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
3393 got_plt reader; call target hooks to reserve GOT entries.
3394 (Output_section_incremental_inputs::set_final_data_size): Adjust size
3395 of input file info header and GOT info entry.
3396 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
3397 relocation info.
3398 (Got_plt_view_info::got_descriptor): Remove.
3399 (Got_plt_view_info::sym_index): New data member.
3400 (Got_plt_view_info::input_index): New data member.
3401 (Local_got_offset_visitor::visit): Write input file index.
3402 (Global_got_offset_visitor::visit): Write 0 for input file index.
3403 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
3404 with sym_index and input_index.
3405 (Output_section_incremental_inputs::write_got_plt): Adjust size of
3406 incremental info GOT entry; replace got_descriptor with input_index.
3407 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
3408 map from input file index to object.
3409 (Sized_relobj_incr::do_layout): Replace direct data member reference
3410 with accessor function.
3411 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
3412 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
3413 Adjust size of input file info header.
3414 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
3415 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
3416 (Incremental_input_entry_reader::get_input_section): Adjust size of
3417 input file info header.
3418 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
3419 of incremental info GOT entry.
3420 (Incremental_got_plt_reader::get_got_desc): Remove.
3421 (Incremental_got_plt_reader::get_got_symndx): New function.
3422 (Incremental_got_plt_reader::get_got_input_index): New function.
3423 (Sized_incremental_binary::Sized_incremental_binary): Remove
3424 file_status_; add input_objects_.
3425 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
3426 (Sized_incremental_binary::set_file_is_unchanged): Remove.
3427 (Sized_incremental_binary::file_is_unchanged): Remove.
3428 (Sized_incremental_binary::set_input_object): New function.
3429 (Sized_incremental_binary::input_object): New function.
3430 (Sized_incremental_binary::file_status_): Remove.
3431 (Sized_incremental_binary::input_objects_): New data member.
3432 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
3433 references.
3434 (Sized_relobj_incr::invalid_address): Move to base class.
3435 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
3436 class.
3437 (Sized_relobj_incr::do_output_section_offset): Likewise.
3438 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
3439 (Sized_relobj_incr::section_offsets_): Likewise.
3440 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
3441 function.
3442 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
3443 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
3444 with accessor function.
3445 (Sized_relobj_file::do_layout): Likewise.
3446 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
3447 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
3448 (Sized_relobj_file::compute_final_local_value): Replace refs to
3449 section_offsets_ with accessor function.
3450 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
3451 * object.h (Relobj::Relobj): Initialize new data members.
3452 (Relobj::add_dyn_reloc): New function.
3453 (Relobj::first_dyn_reloc): New function.
3454 (Relobj::dyn_reloc_count): New function.
3455 (Relobj::first_dyn_reloc_): New data member.
3456 (Relobj::dyn_reloc_count_): New data member.
3457 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
3458 references.
3459 (Sized_relobj::Address): New typedef.
3460 (Sized_relobj::invalid_address): Move here from child class.
3461 (Sized_relobj::Sized_relobj): Initialize new data members.
3462 (Sized_relobj::sized_relobj): New function.
3463 (Sized_relobj::is_output_section_offset_invalid): Move here from
3464 child class.
3465 (Sized_relobj::get_output_section_offset): Likewise.
3466 (Sized_relobj::local_has_got_offset): Likewise.
3467 (Sized_relobj::local_got_offset): Likewise.
3468 (Sized_relobj::set_local_got_offset): Likewise.
3469 (Sized_relobj::do_for_all_local_got_entries): Likewise.
3470 (Sized_relobj::clear_got_offsets): New function.
3471 (Sized_relobj::section_offsets): Move here from child class.
3472 (Sized_relobj::do_output_section_offset): Likewise.
3473 (Sized_relobj::do_set_section_offset): Likewise.
3474 (Sized_relobj::Local_got_offsets): Likewise.
3475 (Sized_relobj::local_got_offsets_): Likewise.
3476 (Sized_relobj::section_offsets_): Likewise.
3477 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
3478 references.
3479 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
3480 class.
3481 (Sized_relobj_file::sized_relobj): New function
3482 (Sized_relobj_file::local_has_got_offset): Move to base class.
3483 (Sized_relobj_file::local_got_offset): Likewise.
3484 (Sized_relobj_file::set_local_got_offset): Likewise.
3485 (Sized_relobj_file::get_output_section_offset): Likewise.
3486 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
3487 (Sized_relobj_file::do_output_section_offset): Likewise.
3488 (Sized_relobj_file::do_set_section_offset): Likewise.
3489 (Sized_relobj_file::Local_got_offsets): Likewise.
3490 (Sized_relobj_file::local_got_offsets_): Likewise.
3491 (Sized_relobj_file::section_offsets_): Likewise.
3492 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
3493 (all constructors).
3494 (set_needs_dynsym_index): Convert relobj to derived class pointer.
3495 (Output_reloc::get_symbol_index): Likewise.
3496 (Output_reloc::local_section_offset): Likewise.
3497 (Output_reloc::get_address): Likewise.
3498 (Output_reloc::symbol_value): Likewise.
3499 (Output_data_got::reserve_slot): Move to class definition.
3500 (Output_data_got::reserve_local): New function.
3501 (Output_data_got::reserve_slot_for_global): Remove.
3502 (Output_data_got::reserve_global): New function.
3503 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
3504 (all constructors, two instantiations).
3505 (Output_reloc::get_relobj): New function (two instantiations).
3506 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
3507 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
3508 (Output_data_reloc::add_global): Adjust type of relobj.
3509 (Output_data_reloc::add_global_relative): Likewise.
3510 (Output_data_reloc::add_symbolless_global_addend): Likewise.
3511 (Output_data_reloc::add_local): Likewise.
3512 (Output_data_reloc::add_local_relative): Likewise.
3513 (Output_data_reloc::add_symbolless_local_addend): Likewise.
3514 (Output_data_reloc::add_local_section): Likewise.
3515 (Output_data_reloc::add_output_section): Likewise.
3516 (Output_data_reloc::add_absolute): Likewise.
3517 (Output_data_reloc::add_target_specific): Likewise.
3518 (Output_data_got::reserve_slot): Move definition here.
3519 (Output_data_got::reserve_local): New function.
3520 (Output_data_got::reserve_global): New function.
3521 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
3522 section_offsets_ with accessor function.
3523 (Sized_relobj_file::write_sections): Likewise.
3524 (Sized_relobj_file::do_relocate_sections): Likewise.
3525 * target.h (Sized_target::reserve_local_got_entry): New function.
3526 (Sized_target::reserve_global_got_entry): New function.
3527 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
3528 (Target_x86_64::reserve_global_got_entry): New function.
3529 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
3530
4829d394
CC
35312011-05-23 Cary Coutant <ccoutant@google.com>
3532
3533 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
3534 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
3535 bit when checking got_type.
3536 * incremental.cc (Sized_incremental_binary::setup_readers):
3537 Store symbol table and string table locations; initialize bit vector
3538 of file status flags.
3539 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
3540 unchanged files.
3541 (Sized_incremental_binary::do_process_got_plt): New function.
3542 (Sized_incremental_binary::get_symtab_view): Use stored locations.
3543 (Output_section_incremental_inputs::set_final_data_size): Record
3544 file index for each input file.
3545 (Output_section_incremental_inputs::write_got_plt): Store file index
3546 instead of input entry offset for each GOT entry.
3547 * incremental.h
3548 (Incremental_input_entry::Incremental_input_entry): Initialize new
3549 data member.
3550 (Incremental_input_entry::set_offset): Store file index.
3551 (Incremental_input_entry::get_file_index): New function.
3552 (Incremental_input_entry::file_index_): New data member.
3553 (Incremental_binary::process_got_plt): New function.
3554 (Incremental_binary::do_process_got_plt): New function.
3555 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
3556 data members.
3557 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
3558 (Sized_incremental_binary::set_file_is_unchanged): New function.
3559 (Sized_incremental_binary::file_is_unchanged): New function.
3560 (Sized_incremental_binary::do_process_got_plt): New function.
3561 (Sized_incremental_binary::file_status_): New data member.
3562 (Sized_incremental_binary::main_symtab_loc_): New data member.
3563 (Sized_incremental_binary::main_strtab_loc_): New data member.
3564 * output.cc (Output_data_got::Got_entry::write): Add case
3565 RESERVED_CODE.
3566 (Output_data_got::add_global): Call add_got_entry.
3567 (Output_data_got::add_global_plt): Likewise.
3568 (Output_data_got::add_global_with_rel): Likewise.
3569 (Output_data_got::add_global_with_rela): Likewise.
3570 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
3571 (Output_data_got::add_global_pair_with_rela): Likewise.
3572 (Output_data_got::add_local): Call add_got_entry.
3573 (Output_data_got::add_local_plt): Likewise.
3574 (Output_data_got::add_local_with_rel): Likewise.
3575 (Output_data_got::add_local_with_rela): Likewise.
3576 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
3577 (Output_data_got::add_local_pair_with_rela): Likewise.
3578 (Output_data_got::reserve_slot): New function.
3579 (Output_data_got::reserve_slot_for_global): New function.
3580 (Output_data_got::add_got_entry): New function.
3581 (Output_data_got::add_got_entry_pair): New function.
3582 (Output_section::add_output_section_data): Edit FIXME.
3583 * output.h
3584 (Output_section_data_build::Output_section_data_build): New
3585 constructor with size parameter.
3586 (Output_data_space::Output_data_space): Likewise.
3587 (Output_data_got::Output_data_got): Initialize new data member; new
3588 constructor with size parameter.
3589 (Output_data_got::add_constant): Call add_got_entry.
3590 (Output_data_got::reserve_slot): New function.
3591 (Output_data_got::reserve_slot_for_global): New function.
3592 (class Output_data_got::Got_entry): Add RESERVED_CODE.
3593 (Output_data_got::add_got_entry): New function.
3594 (Output_data_got::add_got_entry_pair): New function.
3595 (Output_data_got::free_list_): New data member.
3596 * target.h (Sized_target::init_got_plt_for_update): New function.
3597 (Sized_target::register_global_plt_entry): New function.
3598 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3599 Initialize new data member; call init; add constructor with PLT count.
3600 (Output_data_plt_x86_64::init): New function.
3601 (Output_data_plt_x86_64::add_relocation): New function.
3602 (Output_data_plt_x86_64::reserve_slot): New function.
3603 (Output_data_plt_x86_64::free_list_): New data member.
3604 (Target_x86_64::init_got_plt_for_update): New function.
3605 (Target_x86_64::register_global_plt_entry): New function.
3606 (Output_data_plt_x86_64::add_entry): Allocate from free list for
3607 incremental updates.
3608 (Output_data_plt_x86_64::add_relocation): New function.
3609 * testsuite/object_unittest.cc (Object_test): Set default options.
3610
ec69d6da
ILT
36112011-05-16 Ian Lance Taylor <iant@google.com>
3612
3613 * options.h (class General_options): Make -i a synonym for -r.
3614
732e31de
ILT
36152011-05-16 Ian Lance Taylor <iant@google.com>
3616
3617 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
3618
403676b5
CC
36192011-05-10 Cary Coutant <ccoutant@google.com>
3620
3621 * object.cc (Sized_relobj::do_count_local_symbols): Check for
3622 strip_all (-s).
3623
5b7b7d6e
ILT
36242011-05-06 Ian Lance Taylor <iant@google.com>
3625
3626 * layout.cc (Layout::layout): If the output section flags change,
3627 update the ordering.
3628
f0f9babf
CC
36292011-04-25 Cary Coutant <ccoutant@google.com>
3630
3631 * incremental-dump.cc (dump_incremental_inputs): Print local
3632 symbol info for each input file.
3633 * incremental.cc
3634 (Output_section_incremental_inputs::set_final_data_size): Add local
3635 symbol info to input file entries in incremental info.
3636 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3637 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
3638 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
3639 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
3640 implementation.
3641 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
3642 (Sized_incr_relobj::do_relocate): Write the local symbols.
3643 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
3644 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
3645 Adjust size of input file header.
3646 (Incremental_inputs_reader::get_local_symbol_offset): New function.
3647 (Incremental_inputs_reader::get_local_symbol_count): New function.
3648 (Incremental_inputs_reader::get_input_section): Adjust size of input
3649 file header.
3650 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
3651 (Sized_incr_relobj::This): New typedef.
3652 (Sized_incr_relobj::sym_size): New const data member.
3653 (Sized_incr_relobj::Local_symbol): New struct.
3654 (Sized_incr_relobj::do_output_local_symbol_count): New function.
3655 (Sized_incr_relobj::do_local_symbol_offset): New function.
3656 (Sized_incr_relobj::local_symbol_count_): New data member.
3657 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
3658 (Sized_incr_relobj::local_symbol_index_): New data member.
3659 (Sized_incr_relobj::local_symbol_offset_): New data member.
3660 (Sized_incr_relobj::local_dynsym_offset_): New data member.
3661 (Sized_incr_relobj::local_symbols_): New data member.
3662 * object.h (Relobj::output_local_symbol_count): New function.
3663 (Relobj::local_symbol_offset): New function.
3664 (Relobj::do_output_local_symbol_count): New function.
3665 (Relobj::do_local_symbol_offset): New function.
3666 (Sized_relobj::do_output_local_symbol_count): New function.
3667 (Sized_relobj::do_local_symbol_offset): New function.
3668
d0a9ace3
ILT
36692011-04-22 Vladimir Simonov <sv@sw.ru>
3670
3671 * descriptors.cc (set_close_on_exec): New function.
3672 (Descriptors::open): Use set_close_on_exec.
3673 * output.cc (S_ISLNK): Define if not defined.
3674
94a3fc8b
CC
36752011-04-22 Cary Coutant <ccoutant@google.com>
3676
3677 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
3678 global symbol map.
3679 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
3680 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
3681 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
3682 relocations.
3683 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
3684 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
3685 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
3686 * incremental.h
3687 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
3688 function.
3689 (Incremental_binary::apply_incremental_relocs): New function.
3690 (Incremental_binary::do_apply_incremental_relocs): New function.
3691 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
3692 data member.
3693 (Sized_incremental_binary::add_global_symbol): New function.
3694 (Sized_incremental_binary::global_symbol): New function.
3695 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
3696 (Sized_incremental_binary::symbol_map_): New data member.
3697 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
3698 * target.h (Sized_target::apply_relocation): New function.
3699 * target-reloc.h (apply_relocation): New function.
3700 * x86_64.cc (Target_x86_64::apply_relocation): New function.
3701
c87e4302
DK
37022011-04-22 Doug Kwan <dougkwan@google.com>
3703
3704 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
3705 flag of a SHT_ARM_EXIDX section.
2e702c99 3706 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
3707 * testsuite/Makefile.in: Regenerate.
3708 * testsuite/arm_exidx_test.s: New file.
3709 * testsuite/arm_exidx_test.sh: Same.
3710
e7782cf6
CC
37112011-04-20 Cary Coutant <ccoutant@google.com>
3712
3713 PR gold/12689
3714 * archive.h (Incremental_archive_entry::Archive_member):
3715 Initialize arg_serial_ (second constructor).
3716
308ecdc7
ILT
37172011-04-17 Ian Lance Taylor <iant@google.com>
3718
3719 * object.cc (Relocate_info::location): Simplify location string.
3720 * errors.cc (Errors::error_at_location): Don't print program
3721 name.
3722 (Errors::warning_at_location): Likewise.
3723 (Errors::undefined_symbol): Likewise.
3724 * testsuite/debug_msg.sh: Update accordingly.
3725
bec5b579
CC
37262011-04-14 Cary Coutant <ccoutant@google.com>
3727
3728 * gold/layout.cc (Layout::symtab_section_offset): New function.
3729 * gold/layout.h (Layout::symtab_section_offset): New function.
3730 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
3731
88597d34
ILT
37322011-04-12 Ian Lance Taylor <iant@google.com>
3733
3734 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
3735 with MREMAP_MAYMOVE.
3736 * output.h (class Output_file): Add map_is_allocated_ field.
3737 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
3738 not available, provide stubs. If mremap is not available, #define
3739 it to gold_mremap.
3740 (MREMAP_MAYMOVE): Define if not defined.
3741 (Output_file::Output_file): Initialize map_is_allocated_.
3742 (Output_file::resize): Check map_is_allocated_.
3743 (Output_file::map_anonymous): If mmap fails, use malloc.
3744 (Output_file::unmap): Don't do anything for an anonymous map.
3745 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
3746 is not available, provide stubs.
3747 (File_read::View::~View): Use free rather than delete[].
3748 (File_read::make_view): Use malloc rather than new[]. If mmap
3749 fails, use malloc.
3750 (File_read::find_or_make_view): Use malloc rather than new[].
3751 * gold.h: Remove HAVE_REMAP code.
3752 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
3753 exists. Rename mremap to gold_mremap. If mmap is not available
3754 don't do anything.
3755 * configure, config.in: Rebuild.
3756
11e361bc
ILT
37572011-04-11 Ian Lance Taylor <iant@google.com>
3758
3759 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
3760 initialize local variable v.
3761
cdc29364
CC
37622011-04-11 Cary Coutant <ccoutant@google.com>
3763
3764 * archive.cc (Archive::include_member): Adjust call to
3765 report_object.
3766 (Add_archive_symbols::run): Track argument serial numbers.
3767 (Lib_group::include_member): Likewise.
3768 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
3769 * archive.h (Incremental_archive_entry::Archive_member):
3770 Initialize arg_serial_.
3771 (Archive_member::arg_serial_): New data member.
3772 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
3773 (Sized_dynobj::do_add_symbols): Track symbols when doing an
3774 incremental link.
3775 (Sized_dynobj::do_for_all_local_got_entries): New function.
3776 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
3777 function.
3778 * fileread.cc (get_mtime): New function.
3779 * fileread.h (get_mtime): New function.
3780 * gold.cc (queue_initial_tasks): Check for incremental update.
3781 (process_incremental_input): New function.
3782 (queue_middle_tasks): Don't force valid target for incremental
3783 update.
3784 * incremental-dump.cc (find_input_containing_global): Adjust
3785 size of symbol info entry.
3786 (dump_incremental_inputs): Dump argument serial number and
3787 in_system_directory flag; bias shndx by 1; print symbol names
3788 when dumping per-file symbol lists; use new symbol info readers.
3789 * incremental.cc
3790 (Output_section_incremental_inputs:update_data_size): New function.
3791 (Sized_incremental_binary::setup_readers): Setup input readers
3792 for each input file; build maps for files added from libraries
3793 and scripts.
3794 (Sized_incremental_binary::check_input_args): New function.
3795 (Sized_incremental_binary::do_check_inputs): Build map of argument
3796 serial numbers to input arguments.
3797 (Sized_incremental_binary::do_file_has_changed): Rename
3798 do_file_is_unchanged to this; compare file modification times.
3799 (Sized_incremental_binary::do_init_layout): New function.
3800 (Sized_incremental_binary::do_reserve_layout): New function.
3801 (Sized_incremental_binary::do_get_input_reader): Remove.
3802 (Sized_incremental_binary::get_symtab_view): New function.
3803 (Incremental_checker::can_incrementally_link_output_file): Remove.
3804 (Incremental_inputs::report_command_line): Exclude --debug options.
3805 (Incremental_inputs::report_archive_begin): Add parameter; track
3806 argument serial numbers; don't put input file entry for archive
3807 before archive members.
3808 (Incremental_inputs::report_archive_end): Put input file entry
3809 for archive after archive members.
3810 (Incremental_inputs::report_object): Add parameter; track argument
3811 serial numbers and in_system_directory flag.
3812 (Incremental_inputs::report_script): Add parameter; track argument
3813 serial numbers.
3814 (Output_section_incremental_inputs::set_final_data_size): Adjust
3815 size of symbol info entry; check for forwarding symbols.
3816 (Output_section_incremental_inputs::write_input_files): Write
3817 in_system_directory flag and argument serial number.
3818 (Output_section_incremental_inputs::write_info_blocks): Map section
3819 indices between incremental info and original input file; store
3820 input section index for each symbol.
3821 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
3822 change operator() to visit().
3823 (class Global_got_offset_visitor): Likewise.
3824 (class Global_symbol_visitor_got_plt):
3825 (Output_section_incremental_inputs::write_got_plt): Use new visitor
3826 classes.
3827 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
3828 (Sized_incr_relobj::do_read_symbols): New function.
3829 (Sized_incr_relobj::do_layout): New function.
3830 (Sized_incr_relobj::do_layout_deferred_sections): New function.
3831 (Sized_incr_relobj::do_add_symbols): New function.
3832 (Sized_incr_relobj::do_should_include_member): New function.
3833 (Sized_incr_relobj::do_for_all_global_symbols): New function.
3834 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
3835 (Sized_incr_relobj::do_section_size): New function.
3836 (Sized_incr_relobj::do_section_name): New function.
3837 (Sized_incr_relobj::do_section_contents): New function.
3838 (Sized_incr_relobj::do_section_flags): New function.
3839 (Sized_incr_relobj::do_section_entsize): New function.
3840 (Sized_incr_relobj::do_section_address): New function.
3841 (Sized_incr_relobj::do_section_type): New function.
3842 (Sized_incr_relobj::do_section_link): New function.
3843 (Sized_incr_relobj::do_section_info): New function.
3844 (Sized_incr_relobj::do_section_addralign): New function.
3845 (Sized_incr_relobj::do_initialize_xindex): New function.
3846 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
3847 (Sized_incr_relobj::do_read_relocs): New function.
3848 (Sized_incr_relobj::do_gc_process_relocs): New function.
3849 (Sized_incr_relobj::do_scan_relocs): New function.
3850 (Sized_incr_relobj::do_count_local_symbols): New function.
3851 (Sized_incr_relobj::do_finalize_local_symbols): New function.
3852 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
3853 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
3854 (Sized_incr_relobj::do_relocate): New function.
3855 (Sized_incr_relobj::do_set_section_offset): New function.
3856 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
3857 (Sized_incr_dynobj::do_read_symbols): New function.
3858 (Sized_incr_dynobj::do_layout): New function.
3859 (Sized_incr_dynobj::do_add_symbols): New function.
3860 (Sized_incr_dynobj::do_should_include_member): New function.
3861 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
3862 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
3863 (Sized_incr_dynobj::do_section_size): New function.
3864 (Sized_incr_dynobj::do_section_name): New function.
3865 (Sized_incr_dynobj::do_section_contents): New function.
3866 (Sized_incr_dynobj::do_section_flags): New function.
3867 (Sized_incr_dynobj::do_section_entsize): New function.
3868 (Sized_incr_dynobj::do_section_address): New function.
3869 (Sized_incr_dynobj::do_section_type): New function.
3870 (Sized_incr_dynobj::do_section_link): New function.
3871 (Sized_incr_dynobj::do_section_info): New function.
3872 (Sized_incr_dynobj::do_section_addralign): New function.
3873 (Sized_incr_dynobj::do_initialize_xindex): New function.
3874 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
3875 (make_sized_incremental_object): New function.
3876 (Incremental_library::copy_unused_symbols): New function.
3877 (Incremental_library::do_for_all_unused_symbols): New function.
3878 * incremental.h (enum Incremental_input_flags): New type.
3879 (class Incremental_checker): Remove.
3880 (Incremental_input_entry::Incremental_input_entry): Add argument
3881 serial number.
3882 (Incremental_input_entry::arg_serial): New function.
3883 (Incremental_input_entry::set_is_in_system_directory): New function.
3884 (Incremental_input_entry::is_in_system_directory): New function.
3885 (Incremental_input_entry::arg_serial_): New data member.
3886 (Incremental_input_entry::is_in_system_directory_): New data member.
3887 (class Script_info): Move here from script.h.
3888 (Script_info::Script_info): Add filename parameter.
3889 (Script_info::filename): New function.
3890 (Script_info::filename_): New data member.
3891 (Incremental_script_entry::Incremental_script_entry): Add argument
3892 serial number.
3893 (Incremental_object_entry::Incremental_object_entry): Likewise.
3894 (Incremental_object_entry::add_input_section): Build list of input
3895 sections with map to original shndx.
3896 (Incremental_object_entry::get_input_section_index): New function.
3897 (Incremental_object_entry::shndx_): New data member.
3898 (Incremental_object_entry::name_key_): Rename; adjust all refs.
3899 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
3900 (Incremental_archive_entry::Incremental_archive_entry): Add argument
3901 serial number.
3902 (Incremental_inputs::report_archive_begin): Likewise.
3903 (Incremental_inputs::report_object): Likewise.
3904 (Incremental_inputs::report_script): Likewise.
3905 (class Incremental_global_symbol_reader): New class.
3906 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
3907 and store flags and input file type.
3908 (Incremental_input_entry_reader::arg_serial): New function.
3909 (Incremental_input_entry_reader::type): Extract type from flags.
3910 (Incremental_input_entry_reader::is_in_system_directory): New function.
3911 (Incremental_input_entry_reader::get_input_section_count): Call
3912 accessor function for type.
3913 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
3914 function for type; adjust size of global symbol entry.
3915 (Incremental_input_entry_reader::get_global_symbol_count): Call
3916 accessor function for type.
3917 (Incremental_input_entry_reader::get_object_count): Likewise.
3918 (Incremental_input_entry_reader::get_object_offset): Likewise.
3919 (Incremental_input_entry_reader::get_member_count): Likewise.
3920 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
3921 (Incremental_input_entry_reader::get_member_offset): Likewise.
3922 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
3923 (Incremental_input_entry_reader::Global_symbol_info): Remove.
3924 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
3925 (Incremental_input_entry_reader::get_global_symbol_reader): New
3926 function.
3927 (Incremental_input_entry_reader::get_output_symbol_index): New
3928 function.
3929 (Incremental_input_entry_reader::type_): Remove.
3930 (Incremental_input_entry_reader::flags_): New data member.
3931 (Incremental_inputs_reader::input_file_offset): New function.
3932 (Incremental_inputs_reader::input_file_index): New function.
3933 (Incremental_inputs_reader::input_file): Call input_file_offset.
3934 (Incremental_inputs_reader::input_file_at_offset): New function.
3935 (Incremental_relocs_reader::get_r_type): Reformat.
3936 (Incremental_relocs_reader::get_r_shndx): Reformat.
3937 (Incremental_relocs_reader::get_r_offset): Reformat.
3938 (Incremental_relocs_reader::data): New function.
3939 (Incremental_binary::Incremental_binary): Initialize new data members.
3940 (Incremental_binary::check_inputs): Add cmdline parameter.
3941 (Incremental_binary::file_is_unchanged): Remove.
3942 (Input_reader::arg_serial): New function.
3943 (Input_reader::get_unused_symbol_count): New function.
3944 (Input_reader::get_unused_symbol): New function.
3945 (Input_reader::do_arg_serial): New function.
3946 (Input_reader::do_get_unused_symbol_count): New function.
3947 (Input_reader::do_get_unused_symbol): New function.
3948 (Incremental_binary::input_file_count): New function.
3949 (Incremental_binary::get_input_reader): Change signature to use
3950 index instead of filename.
3951 (Incremental_binary::file_has_changed): New function.
3952 (Incremental_binary::get_input_argument): New function.
3953 (Incremental_binary::get_library): New function.
3954 (Incremental_binary::get_script_info): New function.
3955 (Incremental_binary::init_layout): New function.
3956 (Incremental_binary::reserve_layout): New function.
3957 (Incremental_binary::output_file): New function.
3958 (Incremental_binary::do_check_inputs): New function.
3959 (Incremental_binary::do_file_is_unchanged): Remove.
3960 (Incremental_binary::do_file_has_changed): New function.
3961 (Incremental_binary::do_init_layout): New function.
3962 (Incremental_binary::do_reserve_layout): New function.
3963 (Incremental_binary::do_input_file_count): New function.
3964 (Incremental_binary::do_get_input_reader): Change signature.
3965 (Incremental_binary::input_args_map_): New data member.
3966 (Incremental_binary::library_map_): New data member.
3967 (Incremental_binary::script_map_): New data member.
3968 (Sized_incremental_binary::Sized_incremental_binary): Initialize
3969 new data members.
3970 (Sized_incremental_binary::output_section): New function.
3971 (Sized_incremental_binary::inputs_reader): Add const.
3972 (Sized_incremental_binary::symtab_reader): Add const.
3973 (Sized_incremental_binary::relocs_reader): Add const.
3974 (Sized_incremental_binary::got_plt_reader): Add const.
3975 (Sized_incremental_binary::get_symtab_view): New function.
3976 (Sized_incremental_binary::Inputs_reader): New typedef.
3977 (Sized_incremental_binary::Input_entry_reader): New typedef.
3978 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
3979 (Sized_incremental_binary::do_file_is_unchanged): Remove.
3980 (Sized_incremental_binary::do_file_has_changed): New function.
3981 (Sized_incremental_binary::do_init_layout): New function.
3982 (Sized_incremental_binary::do_reserve_layout): New function.
3983 (Sized_input_reader::Inputs_reader): Remove.
3984 (Sized_input_reader::Input_entry_reader): Remove.
3985 (Sized_input_reader::do_arg_serial): New function.
3986 (Sized_input_reader::do_get_unused_symbol_count): New function.
3987 (Sized_input_reader::do_get_unused_symbol): New function.
3988 (Sized_incremental_binary::do_input_file_count): New function.
3989 (Sized_incremental_binary::do_get_input_reader): Change signature;
3990 use index instead of filename.
3991 (Sized_incremental_binary::section_map_): New data member.
3992 (Sized_incremental_binary::input_entry_readers_): New data member.
3993 (class Sized_incr_relobj): New class.
3994 (class Sized_incr_dynobj): New class.
3995 (make_sized_incremental_object): New function.
3996 (class Incremental_library): New class.
3997 * layout.cc (Free_list::num_lists): New static data member.
3998 (Free_list::num_nodes): New static data member.
3999 (Free_list::num_removes): New static data member.
4000 (Free_list::num_remove_visits): New static data member.
4001 (Free_list::num_allocates): New static data member.
4002 (Free_list::num_allocate_visits): New static data member.
4003 (Free_list::init): New function.
4004 (Free_list::remove): New function.
4005 (Free_list::allocate): New function.
4006 (Free_list::dump): New function.
4007 (Free_list::print_stats): New function.
4008 (Layout_task_runner::run): Resize output file for incremental updates.
4009 (Layout::Layout): Initialize new data members.
4010 (Layout::set_incremental_base): New function.
4011 (Layout::init_fixed_output_section): New function.
4012 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
4013 incremental updates.
4014 (Layout::create_gold_note): Do not create gold note section for
4015 incremental updates.
4016 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
4017 for incremental updates.
4018 (Layout::set_section_offsets): For incremental updates, allocate space
4019 from free list.
4020 (Layout::create_symtab_sections): Layout with offsets relative to
4021 start of section; for incremental updates, allocate space from free
4022 list.
4023 (Layout::create_shdrs): For incremental updates, allocate space from
4024 free list.
4025 (Layout::finish_dynamic_section): For incremental updates, do not
4026 check --as-needed (fixed in subsequent patch).
4027 * layout.h (class Free_list): New class.
4028 (Layout::set_incremental_base): New function.
4029 (Layout::incremental_base): New function.
4030 (Layout::init_fixed_output_section): New function.
4031 (Layout::allocate): New function.
4032 (Layout::incremental_base_): New data member.
4033 (Layout::free_list_): New data member.
4034 * main.cc (main): Print Free_list statistics.
4035 * object.cc (Relobj::finalize_incremental_relocs): Add
4036 clear_counts parameter; clear counts only when clear_counts is set.
4037 (Sized_relobj::Sized_relobj): Initialize new base class.
4038 (Sized_relobj::do_layout): Don't report special sections.
4039 (Sized_relobj::do_for_all_local_got_entries): New function.
4040 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
4041 symtab_off to all symbol table offsets.
4042 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
4043 * object.h (class Got_offset_list): Move to top of file.
4044 (Object::Object): Allow case where input_file == NULL.
4045 (Object::~Object): Likewise.
4046 (Object::input_file): Assert that input_file != NULL.
4047 (Object::lock): Allow case where input_file == NULL.
4048 (Object::unlock): Likewise.
4049 (Object::is_locked): Likewise.
4050 (Object::token): Likewise.
4051 (Object::release): Likewise.
4052 (Object::is_incremental): New function.
4053 (Object::get_mtime): New function.
4054 (Object::for_all_local_got_entries): New function.
4055 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
4056 (Object::set_is_in_system_directory): New function.
4057 (Object::is_in_system_directory): New function.
4058 (Object::do_is_incremental): New function.
4059 (Object::do_get_mtime): New function.
4060 (Object::do_for_all_local_got_entries): New function.
4061 (Object::is_in_system_directory_): New data member.
4062 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
4063 (class Sized_relobj_base): New class.
4064 (class Sized_relobj): Derive from Sized_relobj_base.
4065 (class Sized_relobj::Symbols): Redeclare from base class.
4066 (class Sized_relobj::local_got_offset_list): Remove.
4067 (class Sized_relobj::Output_sections): Redeclare from base class.
4068 (class Sized_relobj::do_for_all_local_got_entries): New function.
4069 (class Sized_relobj::write_local_symbols): Add offset parameter.
4070 (class Sized_relobj::local_symbol_offset_): Update comment.
4071 (class Sized_relobj::local_dynsym_offset_): Update comment.
4072 * options.cc (Input_arguments::add_file): Remove const.
4073 * options.h (Input_file_argument::Input_file_argument):
4074 Initialize arg_serial_ (all constructors).
4075 (Input_file_argument::set_arg_serial): New function.
4076 (Input_file_argument::arg_serial): New function.
4077 (Input_file_argument::arg_serial_): New data member.
4078 (Input_arguments::Input_arguments): Initialize file_count_.
4079 (Input_arguments::add_file): Remove const.
4080 (Input_arguments::number_of_input_files): New function.
4081 (Input_arguments::file_count_): New data member.
4082 (Command_line::number_of_input_files): Call
4083 Input_arguments::number_of_input_files.
4084 * output.cc (Output_segment_headers::Output_segment_headers):
4085 Set current size.
4086 (Output_section::Input_section::current_data_size): New function.
4087 (Output_section::Output_section): Initialize new data members.
4088 (Output_section::add_input_section): Don't do merge sections for
4089 an incremental link; allocate space from free list for an
4090 incremental update.
4091 (Output_section::add_output_section_data): Allocate space from
4092 free list for an incremental update.
4093 (Output_section::update_data_size): New function.
4094 (Output_section::set_fixed_layout): New function.
4095 (Output_section::reserve): New function.
4096 (Output_segment::set_section_addresses): Remove const.
4097 (Output_segment::set_section_list_addresses): Remove const; allocate
4098 space from free list for an incremental update.
4099 (Output_segment::set_offset): Adjust size of RELRO segment for an
4100 incremental update.
4101 * output.h (Output_data::current_data_size): Move here from
4102 child classes.
4103 (Output_data::pre_finalize_data_size): New function.
4104 (Output_data::update_data_size): New function.
4105 (Output_section_headers::update_data_size): new function.
4106 (Output_section_data_build::current_data_size): Move to Output_data.
4107 (Output_data_strtab::update_data_size): New function.
4108 (Output_section::current_data_size): Move to Output_data.
4109 (Output_section::set_fixed_layout): New function.
4110 (Output_section::has_fixed_layout): New function.
4111 (Output_section::reserve): New function.
4112 (Output_section::update_data_size): New function.
4113 (Output_section::has_fixed_layout_): New data member.
4114 (Output_section::free_list_): New data member.
4115 (Output_segment::set_section_addresses): Remove const.
4116 (Output_segment::set_section_list_addresses): Remove const.
4117 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
4118 New function.
4119 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
4120 New function.
4121 * readsyms.cc (Read_symbols::do_read_symbols): Add library
4122 parameter when calling Add_symbols constructor; store argument
4123 serial number for members of a lib group.
4124 (Add_symbols::locks): Allow case where token == NULL.
4125 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
4126 (Read_member::~Read_member): New function.
4127 (Read_member::is_runnable): New function.
4128 (Read_member::locks): New function.
4129 (Read_member::run): New function.
4130 (Check_script::~Check_script): New function.
4131 (Check_script::is_runnable): New function.
4132 (Check_script::locks): New function.
4133 (Check_script::run): New function.
4134 (Check_library::~Check_library): New function.
4135 (Check_library::is_runnable): New function.
4136 (Check_library::locks): New function.
4137 (Check_library::run): New function.
4138 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
4139 (Add_symbols::library_): New data member.
4140 (class Read_member): New class.
4141 (class Check_script): New class.
4142 (class Check_library): New class.
4143 * reloc.cc (Read_relocs::is_runnable): Allow case where
4144 token == NULL.
4145 (Read_relocs::locks): Likewise.
4146 (Scan_relocs::locks): Likewise.
4147 (Relocate_task::locks): Likewise.
4148 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
4149 to clear counters.
4150 (Sized_relobj::incremental_relocs_scan): Fix comment.
4151 (Sized_relobj::do_relocate): Pass output file offset to
4152 write_local_symbols.
4153 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
4154 from class declaration.
4155 * script.cc (read_input_script): Allocate Script_info; pass
4156 argument serial number to report_script.
4157 * script.h (class Script_info): Move to incremental.h.
4158 * symtab.cc (Symbol_table::add_from_incrobj): New function.
4159 * symtab.h (Symbol_table::add_from_incrobj): New function.
4160 (Symbol_table::set_file_offset): New function.
4161
b961d0d7
CC
41622011-04-05 Cary Coutant <ccoutant@google.com>
4163
4164 * incremental-dump.cc (dump_incremental_inputs): Change signature
4165 to take a Sized_incremental_binary; change caller. Use readers
4166 in Sized_incremental_binary.
4167 * incremental.cc
4168 (Sized_incremental_binary::find_incremental_inputs_sections):
4169 Rename do_find_incremental_inputs_sections to this.
4170 (Sized_incremental_binary::setup_readers): New function.
4171 (Sized_incremental_binary::do_check_inputs): Check
4172 has_incremental_info_ flag; move setup code to setup_readers;
4173 use input readers.
4174 (Sized_incremental_binary::do_file_is_unchanged): New function.
4175 (Sized_incremental_binary::do_get_input_reader): New function.
4176 * incremental.h (class Incremental_binary): Move to end of file.
4177 (Incremental_binary::file_is_unchanged): New function.
4178 (Incremental_binary::do_file_is_unchanged): New function.
4179 (Incremental_binary::Input_reader): New class.
4180 (Incremental_binary::get_input_reader): New function.
4181 (class Sized_incremental_binary): Move to end of file.
4182 (Sized_incremental_binary::Sized_incremental_binary): Setup the
4183 input section reader classes.
4184 (Sized_incremental_binary::has_incremental_info): New function.
4185 (Sized_incremental_binary::inputs_reader): New function.
4186 (Sized_incremental_binary::symtab_reader): New function.
4187 (Sized_incremental_binary::relocs_reader): New function.
4188 (Sized_incremental_binary::got_plt_reader): New function.
4189 (Sized_incremental_binary::do_file_is_unchanged): New function.
4190 (Sized_incremental_binary::Sized_input_reader): New class.
4191 (Sized_incremental_binary::get_input_reader): New function.
4192 (Sized_incremental_binary::find_incremental_inputs_sections):
4193 Rename do_find_incremental_inputs_sections to this.
4194 (Sized_incremental_binary::setup_readers): New function.
4195 (Sized_incremental_binary::has_incremental_info_): New data member.
4196 (Sized_incremental_binary::inputs_reader_): New data member.
4197 (Sized_incremental_binary::symtab_reader_): New data member.
4198 (Sized_incremental_binary::relocs_reader_): New data member.
4199 (Sized_incremental_binary::got_plt_reader_): New data member.
4200 (Sized_incremental_binary::current_input_file_): New data member.
4201
a869183f
PP
42022011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
4203
4204 PR gold/12640
4205 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
4206 violation.
4207
42082011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
4209
4210 * archive.cc (Archive::include_member): Adjust call to report_object.
4211 (Add_archive_symbols::run): Add script_info to call to
4212 report_archive_begin.
4213 (Lib_group::include_member): Adjust call to report_object.
4214 (Add_lib_group_symbols::run): Adjust call to report_object.
4215 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
4216 blocks. Add object count for script input files.
4217 * incremental.cc (Incremental_inputs::report_archive_begin): Add
4218 script_info parameter; change all callers.
4219 (Incremental_inputs::report_object): Add script_info parameter;
4220 change all callers.
4221 (Incremental_inputs::report_script): Store backpointer to
4222 incremental info entry.
4223 (Output_section_incremental_inputs::set_final_data_size): Record
4224 additional information for scripts.
4225 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4226 * incremental.h (Incremental_script_entry::add_object): New function.
4227 (Incremental_script_entry::get_object_count): New function.
4228 (Incremental_script_entry::get_object): New function.
4229 (Incremental_script_entry::objects_): New data member; adjust
4230 constructor.
4231 (Incremental_inputs::report_archive_begin): Add script_info parameter.
4232 (Incremental_inputs::report_object): Add script_info parameter.
4233 (Incremental_inputs_reader::get_object_count): New function.
4234 (Incremental_inputs_reader::get_object_offset): New function.
4235 * options.cc (Input_arguments::add_file): Return reference to
4236 new input argument.
4237 * options.h (Input_argument::set_script_info): New function.
4238 (Input_argument::script_info): New function.
4239 (Input_argument::script_info_): New data member; adjust all
4240 constructors.
4241 (Input_file_group::add_file): Return reference to new input argument.
4242 (Input_file_lib::add_file): Likewise.
4243 (Input_arguments::add_file): Likewise.
4244 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
4245 * script.cc (Parser_closure::Parser_closure): Add script_info
4246 parameter; adjust all callers.
4247 (Parser_closure::script_info): New function.
4248 (Parser_closure::script_info_): New data member.
4249 (read_input_script): Report scripts earlier to incremental info.
4250 (script_add_file): Set script_info in Input_argument.
4251 (script_add_library): Likewise.
4252 * script.h (Script_options::Script_info): Rewrite class.
4253
a869183f 42542011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
4255
4256 * archive.cc (Library_base::should_include_member): Move
4257 method here from class Archive.
4258 (Archive::Archive): Initialize base class.
4259 (Archive::should_include_member): Move to base class.
4260 (Archive::do_for_all_unused_symbols): New function.
4261 (Add_archive_symbols::run): Remove redundant access to
4262 incremental_inputs.
4263 (Lib_group::Lib_group): Initialize base class.
4264 (Lib_group::do_filename): New function.
4265 (Lib_group::include_member): Pass pointer to Lib_group to
4266 report_object.
4267 (Lib_group::do_for_all_unused_symbols): New function.
4268 (Add_lib_group_symbols::run): Report archive information for
4269 incremental links.
4270 * archive.h (class Library_base): New base class.
4271 (class Archive): Derive from Library_base.
4272 (Archive::filename): Move to base class.
4273 (Archive::set_incremental_info): Likewise.
4274 (Archive::incremental_info): Likewise.
4275 (Archive::Should_include): Likewise.
4276 (Archive::should_include_member): Likewise.
4277 (Archive::Armap_entry): Remove.
4278 (Archive::Unused_symbol_iterator): Remove.
4279 (Archive::unused_symbols_begin): Remove.
4280 (Archive::unused_symbols_end): Remove.
4281 (Archive::do_filename): New function.
4282 (Archive::do_get_mtime): New function.
4283 (Archive::do_for_all_unused_symbols): New function.
4284 (Archive::task_): Move to base class.
4285 (Archive::incremental_info_): Likewise.
4286 (class Lib_group): Derive from Library_base.
4287 (Lib_group::do_filename): New function.
4288 (Lib_group::do_get_mtime): New function.
4289 (Lib_group::do_for_all_unused_symbols): New function.
4290 (Lib_group::task_): Move to base class.
4291 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
4292 function.
4293 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
4294 function.
4295 * incremental.cc (Incremental_inputs::report_archive_begin):
4296 Use Library_base; call library's get_mtime; add incremental inputs
4297 entry before members.
4298 (class Unused_symbol_visitor): New class.
4299 (Incremental_inputs::report_archive_end): Use Library_base; use
4300 visitor class to record unused symbols; don't add incremental inputs
4301 entry after members.
4302 (Incremental_inputs::report_object): Use Library_base.
4303 * incremental.h
4304 (Incremental_archive_entry::Incremental_archive_entry): Remove
4305 unused Archive parameter.
4306 (Incremental_inputs::report_archive_begin): Use Library_base.
4307 (Incremental_inputs::report_archive_end): Likewise.
4308 (Incremental_inputs::report_object): Likewise.
4309 * object.cc (Sized_relobj::do_for_all_global_symbols): New
4310 function.
4311 * object.h (Object::for_all_global_symbols): New function.
4312 (Object::do_for_all_global_symbols): New function.
4313 (Sized_relobj::do_for_all_global_symbols): New function.
4314 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
4315 function.
4316 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
4317 function.
4318
61ab3e40
ILT
43192011-03-27 Ian Lance Taylor <iant@google.com>
4320
4321 * archive.cc (Archive::interpret_header): Return -1 if something
4322 goes wrong. Change callers accordingly.
4323
30e1f9e6
CC
43242011-03-25 Cary Coutant <ccoutant@google.com>
4325
4326 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
4327 * testsuite/Makefile.in: Regenerate.
4328
9370ce59 43292011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
4330
4331 * plugin.cc (get_view): New.
4332 (Plugin::load): Pass get_view to the plugin.
4333 (Plugin_manager::get_view): New.
4334
9312bb0a
ILT
43352011-03-21 Ian Lance Taylor <iant@google.com>
4336
4337 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 4338 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 4339
7e12ba9e
ST
43402011-03-21 Sriraman Tallam <tmsriram@google.com>
4341
4342 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
4343 Change == to -eq.
4344 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
4345 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
4346 Change == to -eq.
4347 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
4348 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
4349
fd7a005d
ILT
43502011-03-14 Ian Lance Taylor <iant@google.com>
4351
4352 * script-sections.cc (Sort_output_sections::script_compare):
4353 Rename from is_before, change return type.
4354 (Sort_output_sections::operator()): Adjust accordingly.
4355
ed16fd1b
ILT
43562011-03-11 Jeffrey Yasskin <jyasskin@google.com>
4357
4358 PR gold/12572
4359 * testsuite/odr_violation2.cc: Add comment to make all error line
4360 numbers double digits.
4361 * testsuite/debug_msg.sh: Adjust expected errors.
4362
71ff8986
ILT
43632011-03-09 Jeffrey Yasskin <jyasskin@google.com>
4364
4365 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
4366 but mark earlier ones as non-canonical
4367 (offset_to_iterator): Update search target and example
4368 (do_addr2line): Return extra lines in a vector*
4369 (format_file_lineno): Extract from do_addr2line
4370 (one_addr2line): Add vector* out-param
4371 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
4372 when a lineno entry appeared last for its instruction
4373 (Dwarf_line_info): Add vector* out-param
4374 * object.cc (Relocate_info): Pass NULL for the vector* out-param
4375 * symtab.cc (Odr_violation_compare): Include the lineno in the
4376 comparison again.
4377 (linenos_from_loc): New. Combine the canonical line for an
4378 address with its other lines.
4379 (True_if_intersect): New. Helper functor to make
4380 std::set_intersection a query.
4381 (detect_odr_violations): Compare sets of lines instead of just
4382 one line for each function. This became less deterministic, but
4383 has fewer false positives.
4384 * symtab.h: Declarations.
4385 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
4386 mix an optimized and non-optimized object in the same binary
4387 (odr_violation2.so): Same.
4388 * testsuite/Makefile.in: Regenerate from Makefile.am.
4389 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
4390 * testsuite/debug_msg.sh: Update line numbers and add
4391 assertions.
4392 * testsuite/odr_violation1.cc: Use OdrDerived, in a
4393 non-optimized context.
4394 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
4395 isn't inlined, and use OdrDerived in an optimized context.
4396 * testsuite/odr_header1.h: Defines OdrDerived, where
4397 optimization will change the
4398 first-instruction-in-the-destructor's file and line number.
4399 * testsuite/odr_header2.h: Defines OdrBase.
4400
a19fefdc
ILT
44012011-03-09 Ian Lance Taylor <iant@google.com>
4402
4403 * fileread.cc (File_read::clear_views): Don't delete the whole
4404 file view.
4405
ecb351e9
ILT
44062011-03-08 Ian Lance Taylor <iant@google.com>
4407
4408 PR gold/12525
4409 * fileread.cc: #include <climits>.
4410 (GOLD_IOV_MAX): Define.
4411 (File_read::read_multiple): Limit number of entries by iov_max.
4412 * fileread.h (class File_read): Always set max_readv_entries to
4413 128.
4414
b821d13c
ILT
44152011-03-07 Ian Lance Taylor <iant@google.com>
4416
4417 PR gold/12525
4418 * options.h (class General_options): Add -dy and -dn.
4419
89243142
CC
44202011-03-02 Cary Coutant <ccoutant@google.com>
4421
4422 * testsuite/script_test_9.t: Add TLS segment.
4423
d0773f31
ILT
44242011-03-02 Simon Baldwin <simonb@google.com>
4425
4426 * configure.ac: Add check for gnu_indirect_function support in
4427 the toolchain building binutils.
4428 * configure: Rebuild.
4429
9370ce59 44302011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
4431
4432 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
4433 plugin only symbols.
4434 (Symbol_table::sized_finalize_symbol) Mark symbol only present
4435 in plugin files as not needed in the symbol table.
4436
4cf7a849
ST
44372011-02-11 Sriraman Tallam <tmsriram@google.com>
4438
4439 * output.cc (Output_section::add_input_section): Delay fill
4440 generation for section ordering.
4441
b578bd7d
ILT
44422011-02-09 Ian Lance Taylor <iant@google.com>
4443
4444 PR gold/12316
4445 * object.h (class Sized_relobj): Remove clear_local_symbols.
4446 * reloc.cc (Sized_relobj::do_relocate): Don't call
4447 clear_local_symbols.
4448
9370ce59 44492011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
4450
4451 * plugin.cc (is_visible_from_outside): Return true for symbols
4452 in the -u option.
4453
55382fb7
ILT
44542011-02-04 Jeffrey Yasskin <jyasskin@google.com>
4455
4456 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
4457 filename.
4458
4e271fff
ST
44592011-02-02 Sriraman Tallam <tmsriram@google.com>
4460
4461 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 4462 to std::string.
4e271fff 4463 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 4464 section_name to be std::string.
4e271fff
ST
4465 (is_function_ctor_or_dtor): Change type of parameter to std::string.
4466
d433c3ac
ILT
44672011-01-25 Ian Lance Taylor <iant@google.com>
4468
4469 * script.cc (script_add_extern): Rewrite to use
4470 add_symbol_reference.
4471
880473a6
DK
44722011-01-25 Doug Kwan <dougkwan@google.com>
4473
d433c3ac 4474 * icf.cc (get_section_contents): Always lock section's object.
880473a6 4475
f30f86fa
ILT
44762011-01-24 Ian Lance Taylor <iant@google.com>
4477
4478 * options.h (class General_options): Accept
4479 --no-detect-odr-violations.
4480
8e51a0b9
ILT
44812011-01-24 Ian Lance Taylor <iant@google.com>
4482
4483 * version.cc (version_string): Bump to 1.11.
4484
0f3b89d8
ILT
44852011-01-24 Ian Lance Taylor <iant@google.com>
4486
4487 * plugin.cc (class Plugin_rescan): Define new class.
4488 (Plugin_manager::claim_file): Set any_claimed_.
4489 (Plugin_manager::save_archive): New function.
4490 (Plugin_manager::save_input_group): New function.
4491 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
4492 necessary.
4493 (Plugin_manager::new_undefined_symbol): New function.
4494 (Plugin_manager::rescan): New function.
4495 (Plugin_manager::rescannable_defines): New function.
4496 (Plugin_manager::add_input_file): Set any_added_.
4497 * plugin.h (class Plugin_manager): define new fields rescannable_,
4498 undefined_symbols_, any_claimed_, and any_added_. Declare
4499 Plugin_rescan as friend. Declare new functions.
4500 (Plugin_manager::Rescannable): Define type.
4501 (Plugin_manager::Rescannable_list): Define type.
4502 (Plugin_manager::Undefined_symbol_list): Define type.
4503 (Plugin_manager::Plugin_manager): Initialize new fields.
4504 * archive.cc (Archive::defines_symbol): New function.
4505 (Add_archive_symbols::run): Pass archive to plugins if any.
4506 * archive.h (class Archive): Declare defines_symbol.
4507 * readsyms.cc (Input_group::~Input_group): New function.
4508 (Finish_group::run): Pass input_group to plugins if any.
4509 * readsyms.h (class Input_group): Declare destructor.
4510 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
4511 any.
4512
3bb951e5
ILT
45132011-01-10 Ian Lance Taylor <iant@google.com>
4514
4515 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
4516 section as relro.
4517 (Layout::set_segment_offsets): Reset increase_relro before calling
4518 set_section_addresses a second time.
4519
0aa45fac
CC
45202011-01-04 Cary Coutant <ccoutant@google.com>
4521
4522 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
4523 sections before NOBITS sections.
4524
0db46eb4
L
45252011-01-01 H.J. Lu <hongjiu.lu@intel.com>
4526
4527 * version.cc (print_version): Update copyright to 2011.
4528
829c9745
CC
45292010-12-23 Cary Coutant <ccoutant@google.com>
4530
4531 * output.h (Output_data_reloc::add_output_section): Pass OD instead
4532 of OS to this->add. Add OD parameter to second form of the function.
4533
7500420b
ILT
45342010-12-20 Ian Lance Taylor <iant@google.com>
4535
4536 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
4537 second of two consecutive entries with same offset.
4538
f8e9a930
RW
45392010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4540
4541 * testsuite/Makefile.am (ifuncmain2static_LDADD)
4542 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
4543 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
4544 to avoid unneeded links against $(LDADD).
4545 * testsuite/Makefile.in: Regenerate.
4546
2fbb4320
ILT
45472010-12-15 Ian Lance Taylor <iant@google.com>
4548
4549 PR gold/12324
4550 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
4551 for R_X86_64_32 and R_X86_64_PC32.
4552 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
4553 ver_matching_def_pic.o.
4554 (ver_matching_def_pic.o): New target.
4555
fedb228d
RW
45562010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4557
4558 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
4559 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
4560 Move definition before File_read::View member definitions.
4561 (File_read::View::~View): Initialize and hold lock before
4562 updating current_mapped_bytes.
4563
9b547ce6
RW
45642010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4565
4566 * dwarf_reader.cc: Remove outdated comment.
4567 * gold-threads.cc: Fix typo in error message.
4568 * archive.cc: Fix typos in comments.
4569 * archive.h: Likewise.
4570 * arm-reloc-property.cc: Likewise.
4571 * arm-reloc-property.h: Likewise.
4572 * arm-reloc.def: Likewise.
4573 * arm.cc: Likewise.
4574 * attributes.h: Likewise.
4575 * cref.cc: Likewise.
4576 * ehframe.cc: Likewise.
4577 * fileread.h: Likewise.
4578 * gold.h: Likewise.
4579 * i386.cc: Likewise.
4580 * icf.cc: Likewise.
4581 * incremental.h: Likewise.
4582 * int_encoding.cc: Likewise.
4583 * layout.h: Likewise.
4584 * main.cc: Likewise.
4585 * merge.h: Likewise.
4586 * object.cc: Likewise.
4587 * object.h: Likewise.
4588 * options.cc: Likewise.
4589 * readsyms.cc: Likewise.
4590 * reduced_debug_output.cc: Likewise.
4591 * reloc.cc: Likewise.
4592 * script-sections.cc: Likewise.
4593 * sparc.cc: Likewise.
4594 * symtab.h: Likewise.
4595 * target-reloc.h: Likewise.
4596 * target.cc: Likewise.
4597 * target.h: Likewise.
4598 * timer.cc: Likewise.
4599 * timer.h: Likewise.
4600 * x86_64.cc: Likewise.
4601
83e17bd5
CC
46022010-12-09 Cary Coutant <ccoutant@google.com>
4603
4604 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
4605 stack.
4606 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
4607 parameter; change all callers.
4608 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
4609 * options.h (warn_execstack): New option.
4610
017257f8
DK
46112010-12-07 Doug Kwan <dougkwan@google.com>
4612
4613 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
4614 like function call relocations.
4615
c20cbc06
ILT
46162010-12-07 Ian Lance Taylor <iant@google.com>
4617
4618 * archive.cc (Archive::get_elf_object_for_member): Permit
4619 punconfigured to be NULL.
4620 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
4621 (Archive::include_member): Pass NULL to get_elf_object_for_member
4622 if we searched for the archive and this is the first included
4623 object.
4624
4dbfafcc
ILT
46252010-12-01 Ian Lance Taylor <iant@google.com>
4626
4627 * dwarf_reader.h (class Sized_dwarf_line_info): Add
4628 track_relocs_type_ field.
4629 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4630 Set track_relocs_type_.
4631 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
4632 contents when using RELA relocs.
4633 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
4634 reloc_map_.
4635 * reloc.cc (Track_relocs::next_addend): New function.
4636 * reloc.h (class Track_relocs): Declare next_addend.
4637
e5e19edd
ILT
46382010-12-01 Ian Lance Taylor <iant@google.com>
4639
4640 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
4641 virtual destructor.
4642
9a5ce24c
ILT
46432010-12-01 Ian Lance Taylor <iant@google.com>
4644
4645 * README: Update compilers known to work and fail.
4646
c7791212
NC
46472010-11-23 Matthias Klose <doko@ubuntu.com>
4648
4649 * configure.in: For --enable-gold, handle value `default' instead of
4650 `both*'. Always install ld as ld.bfd, install as ld if gold is
4651 not the default.
4652 * configure: Regenerate.
4653
0ad220c9
DK
46542010-11-18 Doug Kwan <dougkwan@google.com>
4655
4656 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
4657 and right_alignment to be zero. Store result alignment only if it is
4658 greater than existing alignment.
4659
ab8056e0
CC
46602010-11-16 Cary Coutant <ccoutant@google.com>
4661
4662 PR gold/12220
4663 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4664 Check for ".zdebug_line".
4665
fd064a5b
CC
46662010-11-16 Doug Kwan <dougkwan@google.com>
4667 Cary Coutant <ccoutant@google.com>
4668
4669 * output.h (Output_segment::set_section_addresses): Pass increase_relro
4670 by reference; adjust all callers.
4671 * output.cc (Output_segment::set_section_addresses): Adjust references
4672 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
4673 list is empty.
4674 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
4675 end at page boundary.
4676
6fc6ea19
CC
46772010-11-16 Cary Coutant <ccoutant@google.com>
4678
4679 PR gold/12220
4680 * layout.cc (Layout::choose_output_section): Transform names of
4681 compressed sections even when using a script with a SECTIONS clause.
4682 (Layout::output_section_name): Remove code to transform
4683 compressed debug section names.
4684 * output.cc (Output_section::add_input_section): Use uncompressed
4685 section size when tracking input sections.
4686
95a2c8d6
RS
46872010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
4688
4689 * symtab.h (Symbol::NON_PIC_REF): Remove.
4690 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
4691 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
4692 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
4693 (Symbol::use_plt_offset): Take a flags argument and pass it
4694 directly to needs_dynamic_reloc. Restrict check for undefined
4695 weak symbols to function calls.
4696 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
4697 (Target_arm::Scan::global): Use it.
4698 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
4699 (Target_arm::Relocate::relocate): Likewise.
4700 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
4701 parameter with an r_type parameter. Use get_reference_flags
4702 to get the flags.
4703 (Target_arm::Relocate::relocate): Update accordingly.
4704 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
4705 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
4706 (Target_i386::Scan::global): Likewise.
4707 (Target_i386::Relocate::relocate): Likewise.
4708 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
4709 parameter with an r_type parameter. Use get_reference_flags
4710 to get the flags.
4711 (Target_i386::Relocate::relocate): Update accordingly.
4712 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
4713 (Target_powerpc::Scan::global): Use it.
4714 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
4715 (Target_powerpc::Relocate::relocate): Likewise.
4716 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
4717 (Target_sparc::Scan::global): Use it.
4718 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
4719 (Target_sparc::Relocate::relocate): Likewise.
4720 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
4721 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
4722 (Target_x86_64::Scan::global): Likewise.
4723 (Target_x86_64::Relocate::relocate): Likewise.
4724
f625ae50
DK
47252010-11-08 Doug Kwan <dougkwan@google.com>
4726 Cary Coutant <ccoutant@google.com>
4727
4728 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
4729 (Arm_exidx_merge_section::section_contents_): New data member.
4730 (Arm_input_section::Arm_input_section): Initialize original_contents_.
4731 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 4732 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
4733 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
4734 in parameters instead of calling Object::section_contents without
4735 locking.
4736 (Arm_output_section::group_section): New parameter TASK. Pass it
4737 to callees that need locking objects.
4738 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
4739 to lock EXIDX input sections. Fix a formatting issue. Call
4740 Arm_exidx_merged_section::build_contents to create merged section
4741 contents.
4742 (Arm_output_section::create_stub_group): New parameter TASK. Use it
4743 to lock object of stub table owner.
4744 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
4745 TEXT_SIZE to initialize data member TEXT_SIZE_.
4746 (Arm_exidx_input_section::addralign): Fix typo in comment.
4747 (Arm_exidx_input_section::text_size): New method.
4748 (Target_arm::do_relax): New parameter TASK. Pass it to callees
4749 that require locking objects. Lock objects before scanning for stubs
4750 and updating local symbols.
4751 (Arm_input_section<big_endian>::init): Copy contents of original
4752 input section.
2e702c99 4753 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
4754 original input section instead of calling Object::section_contents
4755 without locking.
4756 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
4757 size without calling Object::section_size().
4758 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
4759 for size. Allocate a buffer for merged EXIDX entries.
4760 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 4761 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
4762 building code to Arm_exidx_merged_section::build_contetns. Write
4763 out contetns in buffer instead of building it on the fly.
4764 (Arm_relobj::make_exidx_input_section): Also pass text section size
4765 to Arm_exidx_input_section constructor.
4766 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
4767 (Arm_dynobj::do_read_symbols): Fix memory leak.
4768 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
4769 * target.h: (class Task): Add forward declaration.
4770 (Target::relax): Add new parameter TASK and pass it to
4771 Target::do_relax().
4772 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
4773
5f9bcf58
CC
47742010-11-05 Cary Coutant <ccoutant@google.com>
4775
4776 PR gold/10708
4777 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
4778 object when reading from the file.
4779 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
4780 second layout pass.
4781 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
4782 when reading section contents.
4783 (get_section_contents): Likewise.
4784 (icf::find_identical_sections): Likewise.
4785 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
4786 object when reading from the file.
4787 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
4788 the object when doing deferred section layout.
4789
e597fa08
NC
47902010-11-03 Nick Clifton <nickc@redhat.com>
4791
4792 PR gold/12001
4793 * script.h (class Symbol_assignment: name): New member. Returns
4794 the name of the symbol.
4795 * scrfipt.cc (Script_options::is_pending_assignment): New member.
4796 Returns true if the given symbol name is on the list of
4797 assignments wating to be processed.
4798 * archive.cc (should_incldue_member): If the symbol is undefined,
4799 check to see if it is on the list of symbols pending assignment.
4800
3f9a3278
ILT
48012010-11-03 Ryan Mansfield <rmansfield@qnx.com>
4802
4803 * script-sections.cc (Script_sections::find_memory_region): Check
4804 for a NULL output section pointer.
4805
d06fb4d1
DK
48062010-10-29 Doug Kwan <dougkwan@google.com>
4807
4808 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
4809 Output_section::add_relaxed_input_section.
4810 * output.cc (Output_section::add_relaxed_input_section): Add new
4811 arguments LAYOUT and NAME. Set section order index.
4812 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
4813 Copy section order index.
4814 * output.h (Output_section::add_relaxed_input_section): Add new
4815 arguments LAYOUT and NAME.
4816
90e24de5
ILT
48172010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4818
4819 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 4820 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
4821 * testsuite/Makefile.in: Regenerate.
4822
c9484ea5
DK
48232010-10-20 Doug Kwan <dougkwan@google.com>
4824
4825 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
4826 without SHF_LINK_ORDER flags.
4827 * layout.cc (Layout::choose_output_section): Do not filter
4828 SHF_LINK_ORDER flag in a relocatable link.
4829
5bc2f5be
CC
48302010-10-17 Cary Coutant <ccoutant@google.com>
4831
4832 * output.h (Output_segment::set_section_addresses): Change function
4833 signature. Update all callers.
4834 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
4835 sections.
4836 (Output_segment::set_section_addresses): Align after last TLS
4837 section. Add padding before last relro section instead of after.
4838
0c91cf04
DK
48392010-10-17 Doug Kwan <dougkwan@google.com>
4840
4841 * gold/arm.cc (Target_arm::got_section): Use correct order and set
4842 GOT output section to be writable.
4843
8c21d9d3
CC
48442010-10-14 Cary Coutant <ccoutant@google.com>
4845
4846 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
4847 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
4848 * gold.cc (queue_initial_tasks): Check parameters for incremental link
4849 mode.
4850 * incremental.cc (report_command_line): Ignore all forms of
4851 --incremental.
4852 * layout.cc (Layout::Layout): Check parameters for incremental link
4853 mode.
4854 * options.cc (General_options::parse_incremental): New function.
4855 (General_options::parse_no_incremental): New function.
4856 (General_options::parse_incremental_full): New function.
4857 (General_options::parse_incremental_update): New function.
4858 (General_options::incremental_mode_): New data member.
4859 (General_options::finalize): Check incremental_mode_.
4860 * options.h (General_options): Update help text for --incremental.
4861 Add --no-incremental, --incremental-full, --incremental-update.
4862 (General_options::Incremental_mode): New enum type.
4863 (General_options::incremental_mode): New function.
4864 (General_options::incremental_mode_): New data member.
4865 * parameters.cc (Parameters::incremental_mode_): New data member.
4866 (Parameters::set_options): Set incremental_mode_.
4867 (Parameters::set_incremental_full): New function.
4868 (Parameters::incremental): New function.
4869 (Parameters::incremental_update): New function.
4870 (set_parameters_incremental_full): New function.
4871 * parameters.h (Parameters::set_incremental_full): New function.
4872 (Parameters::incremental): New function.
4873 (Parameters::incremental_update): New function.
4874 (Parameters::incremental_mode_): New data member.
4875 (set_parameters_incremental_full): New function.
4876 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
4877 incremental link mode.
4878 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
4879 (Sized_relobj::do_relocate_sections): Likewise.
4880 * testsuite/Makefile.am (incremental_test): Use --incremental-full
4881 option.
4882 * testsuite/Makefile.in: Regenerate.
4883 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 4884
bb32aa18 48852010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
4886
4887 * script-sections.h (class Script_sections): Make
4888 Sections_elements typedef public.
4889 * script-sections.cc (class Sort_output_sections): Add elements_
4890 field. Add constructor which sets it; change all callers.
4891 (Sort_output_sections::is_before): New function.
4892 (Sort_output_sections::operator()): Call is_before.
4893 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
4894 conditional.
4895 * testsuite/script_test_10.sh: New test. Test script section
4896 order.
4897 * testsuite/script_test_10.t: Likewise.
4898 * testsuite/script_test_10.s: Likewise.
4899 * testsuite/Makefile.am: Wrap the cross linker tests and the
4900 common tests into NATIVE_OR_CROSS_LINKER.
4901 (check_SCRIPTS): Add script_test_10.sh.
4902 (check_DATA): Add script_test_10.stdout.
4903 (script_test_10.o, script_test_10): New targets.
4904 (script_test_10.stdout): New target.
4905 * configure, testsuite/Makefile.in: Regenerate.
4906
3cef7179
ILT
49072010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4908
4909 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
4910 error for the deprecated relocations.
4911 (Target_arm::Scan::global): Likewise.
4912 (Target_arm::Relocate::relocate): Likewise.
4913
7411e9a8
RS
49142010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
4915
4916 * fileread.cc (Input_file::find_file): Initialize *found_name
4917 and *namep when using the fallback search for case 4.
4918
6a9da32a
CC
49192010-10-11 Cary Coutant <ccoutant@google.com>
4920
4921 * options.h (class General_options): Redefine -z lazy as an alias for
4922 the negation of -z now.
4923
ac897c20
ILT
49242010-10-11 Ian Lance Taylor <iant@google.com>
4925
4926 * resolve.cc (symbol_to_bits): Report the value of the unsupported
4927 binding.
4928
ea5cae92
NC
49292010-10-06 Nick Clifton <nickc@redhat.com>
4930
4931 * script-sections.cc(class Memory_region): Remove
4932 current_lma_offset_ field. Rename current_vma_offset_ to
4933 current_offset_. Add last_section_ field.
4934 (Memory_region::get_current_vma_address): Rename to
4935 get_current_address.
4936 (Memory_region::get_current_lma_address): Delete.
4937 (Memory_region::increment_vma_offset): Rename to
4938 increment_offset.
4939 (Memory_region::increment_lma_offset): Delete.
4940 (Memory_region::attributes_compatible): New method. Returns
4941 true if the provided section is compatible with the region.
4942 (Memory_region::get_last_section): New method. Returns the last
4943 section to use the region.
4944 (Memory_region::set_last_section): New method. Stores the last
4945 section to use the region.
4946 (Script_sections::block_in_region): New method. Returns true if
4947 a block of memory is contained within a region.
4948 (Script_sections::find_memory_region): New method. Locates a
4949 memory region to be used to set a VMA or LMA address.
4950 (Output_section_definition::set_section_addresses): Add code to
4951 check for addresses set by memory regions.
4952 (Output_segment::set_section_addresses): Remove memory region
4953 walking code.
4954 (Script_sections::create_segment): Add a warning if a header
4955 segment is created outside of any region.
4956 * script-sections.h (class Script_sections): Add prototypes for
4957 find_memory_region and block_in_region methods.
4958 * testsuite/memory_test.s: Use .long instead of .word.
4959 * testsuite/memory_test.t: Add some more output sections.
4960 * testsuite/memory_test.sh: Update expected output.
4961
a9bfd952
DK
49622010-10-02 Doug Kwan <dougkwan@google.com>
4963
4964 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
4965 defintion to symtab.h
4966 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
4967 declaration to defintion.
4968
bacff3ab
NC
49692010-10-01 Nick Clifton <nickc@redhat.com>
4970
4971 * expression.cc (eval): Replace dummy argument with NULL.
4972 (eval_maybe_dot): Check for a NULL result section pointer.
4973 (Symbol_expression::value): Likewise.
4974 (Dot_expression::value): Likewise.
4975 (BINARY_EXPRESSION): Likewise.
4976 (Max_expression::value): Likewise.
4977 (Min_expression::value): Likewise.
4978 (Absolute_expression::value): Likewise.
4979 (Addr_expression::value_from_output_section): Likewise.
4980 (Loaddddr_expression::value_from_output_section): Likewise.
4981 (Segment_start_expression::value): Likewise.
4982 * script-sections.cc
4983 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
4984 argument with NULL.
4985 (Sections_elememt_dot_assignment::set_section_addresses):
4986 Likewise.
4987 (Output_data_expression::do_write_to_buffer): Likewise.
4988 (Output_section_definition::finalize_symbols): Likewise.
4989 (Output_section_definition::set_section_addresses): Likewise.
4990
f81bc8b5
DK
49912010-09-30 Doug Kwan <dougkwan@google.com>
4992
4993 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
4994
c95e9f27
ST
49952010-09-28 Sriraman Tallam <tmsriram@google.com>
4996
4997 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 4998 function.
c95e9f27
ST
4999 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
5000 virtual function.
5001 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
5002 virtual function.
5003 * icf.cc (get_section_contents): Inline merge sections only when
5004 target allows it.
5005
3cac54d2
RW
50062010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5007
5008 * configure: Regenerate.
5009
2904037a
ILT
50102010-09-17 Ian Lance Taylor <iant@google.com>
5011
5012 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
5013 * testsuite/Makefile.am (memory_test.o): New target.
5014 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
5015 memory_test.t.
5016 * testsuite/Makefile.in: Rebuild.
2904037a 5017
bca7fb63
DK
50182010-09-17 Doug Kwan <dougkwan@google.com>
5019
5020 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
5021 defintion if relocation uses GOT entries of the symbol.
5022 * testsuite/icf_safe_test.sh: Fix test.
5023 * testsuite/icf_safe_so_test.sh: Fix test.
5024
4ef28648
CC
50252010-09-16 Cary Coutant <ccoutant@google.com>
5026
5027 * script_sections.cc (class Memory_region): Remove "NULL" from
5028 vector initializations.
5029
793990de
CC
50302010-09-15 Cary Coutant <ccoutant@google.com>
5031
5032 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
5033 Resolve forwarding symbols.
5034
81e015e2
DK
50352010-09-15 Doug Kwan <dougkwan@google.com>
5036
5037 * gold/testsuite/script_test_3.t: Add ARM special sections.
5038 * gold/testsuite/script_test_4.t: Same.
5039 * gold/testsuite/script_test_5.t: Same.
5040 * gold/testsuite/script_test_6.t: Same.
5041 * gold/testsuite/script_test_7.t: Same.
5042 * gold/testsuite/script_test_7.t: Same.
5043 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
5044
36171d64
CC
50452010-09-14 Cary Coutant <ccoutant@google.com>
5046
5047 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
5048 (Target_x86_64::Relocate::relocate_tls): Replace check for
5049 saw_tls_block_reloc_ with test for executable section.
5050
d89051bd
CC
50512010-09-12 Cary Coutant <ccoutant@google.com>
5052
5053 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
5054 position-independent executables to shared libraries need dynamic
5055 relocations.
5056 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
5057 position-independent executables.
5058 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
5059 * testsuite/Makefile.in: Regenerate.
5060
fca41f0f
NC
50612010-09-10 Nick Clifton <nickc@redhat.com>
5062
5063 PR gold/11997
5064 * testsuite/memory_test.t: Discard any sections that are not
5065 needed.
5066
6695e4b3
L
50672010-09-09 H.J. Lu <hongjiu.lu@intel.com>
5068
5069 PR gold/11996
5070 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
5071 "This::" to work around a bug in gcc 4.2.
5072
5073 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
5074
0f72bf6f
RÁE
50752010-09-09 Rafael Espindola <espindola@google.com>
5076
5077 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
5078 sections with different PF_X flags in the same segment.
5079 (Layout::find_first_load_seg): Search all segments to find the first
5080 one.
5081 * options.h (rosegment): New.
5082
50832010-09-08 Rafael Espindola <espindola@google.com>
a6577478 5084
05a79166 5085 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 5086
aa98ff75
DK
50872010-09-08 Doug Kwan <dougkwan@google.com>
5088
5089 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
5090 (Arm_relobj::do_relocate_sections): Add new parameter for output
5091 file to match the parent.
5092 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
5093 of local symbols instead of input values. Update code to track
5094 changes in gold::relocate_section.
5095 * object.cc (Sized_relobj::compute_final_local_value): New methods.
5096 (Sized_relobj::compute_final_local_value_internal): New methods.
5097 (Sized_relobj::do_finalize_local_symbols): Move code from loop
5098 body into private version of Sized_relobj::compute_final_local_value.
5099 Call the inline method.
5100 * object.h (Symbol_value::Symbol_value): Define destructor. Free
5101 merged symbol value if there is one.
5102 (Symbol_value::has_output_value): New method defintiion.
5103 (Sized_relobj::Compute_final_local_value_status): New enum type.
5104 (Sized_relobj::compute_final_local_value): New methods.
5105 (Sized_relobj::compute_final_local_value_internal): New methods.
5106 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
5107 and arm_cortex_a8.sh.
5108 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
5109 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
5110 New tests.
5111 * Makefile.in: Regenerate.
5112 * testsuite/arm_bl_out_of_range.s: Update test.
5113 * testsuite/thumb_bl_out_of_range.s: Ditto.
5114 * testsuite/thumb_blx_out_of_range.s: Ditto.
5115 * testsuite/arm_branch_out_of_range.sh: New file.
5116 * testsuite/arm_cortex_a8.sh: Ditto.
5117 * testsuite/arm_cortex_a8_b.s: Ditto.
5118 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
5119 * testsuite/arm_cortex_a8_b_local.s: Ditto.
5120 * testsuite/arm_cortex_a8_bl.s: Ditto.
5121 * testsuite/arm_cortex_a8_blx.s: Ditto.
5122 * testsuite/arm_cortex_a8_local.s: Ditto.
5123 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
5124 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
5125
05a79166
L
51262010-09-08 Rafael Espindola <espindola@google.com>
5127
5128 * Makefile.am (memory_test.stdout): Run readelf with -W.
5129 * Makefile.in: Regenerate.
5130 * testsuite/memory_test.sh: Make the regexps accept both 32 and
5131 64 bit output.
5132
33dbc701
RÁE
51332010-09-08 Rafael Espindola <espindola@google.com>
5134
5135 * script-sections.cc (Script_sections::add_memory_region): Convert
5136 field precision to int.
5137 * script.cc (script_set_section_region, script_set_section_region):
5138 Convert field precision to int.
5139
731ca54a
RÁE
51402010-09-08 Rafael Espindola <espindola@google.com>
5141
5142 * arm.cc (do_finalize_sections): Create the __exidx_start and
5143 __exdix_end symbols even when the section is missing.
5144
7f8cd844
NC
51452010-09-08 Nick Clifton <nickc@redhat.com>
5146
5147 * README: Remove claim that MEMORY is not supported.
5148 * expression.cc (script_exp_function_origin)
5149 (script_exp_function_length): Move from here to ...
5150 * script.cc: ... here.
5151 (script_set_section_region, script_add_memory)
5152 (script_parse_memory_attr, script_include_directive): New
5153 functions.
5154 * script-sections.cc
5155 (class Memory_region): New class.
5156 (class Output_section_definition): Add set_memory_region,
5157 set_section_vma, set_section_lma and get_section_name methods.
5158 (class Script_Sections): Add add_memory_region,
5159 find_memory_region, find_memory_region_origin,
5160 find_memory_region_length and set_memory_region methods.
5161 Have set_section_addresses method walk the list of set memory
5162 regions.
5163 Extend the print methos to display memory regions.
5164 * script-sections.h: Add prototypes for new methods.
5165 Add enum for MEMORY region attributes.
5166 * yyscript.y: Add support for parsing MEMORY regions.
5167 * script-c.h: Add prototypes for new functions.
5168 * testsuite/Makefile.am: Add test of MEMORY region functionality.
5169 * testsuite/Makefile.in: Regenerate.
5170 * testsuite/memory_test.sh: New script.
5171 * testsuite/memory_test.s: New assembler source file.
5172 * testsuite/memory_test.t: New linker script.
5173
a4649286
DK
51742010-08-27 Doug Kwan <dougkwan@google.com>
5175
5176 * gold/resolve.cc (Symbol_table::should_override): Let a weak
5177 reference override an existing dynamic weak reference.
5178 * testsuite/Makefile.am: Add new test dyn_weak_ref.
5179 * testsuite/Makefile.in: Regenerate.
5180 * testsuite/dyn_weak_ref.sh: New file.
5181 * testsuite/dyn_weak_ref_1.c: Ditto.
5182 * testsuite/dyn_weak_ref_2.c: Ditto.
5183
b56648ad
ILT
51842010-08-27 Ian Lance Taylor <iant@google.com>
5185
5186 * incremental.h (class Incremental_input_entry): Add virtual
5187 destructor.
5188
809313cb
ILT
51892010-08-27 Ian Lance Taylor <iant@google.com>
5190
5191 * testsuite/start_lib_test_3.c: Mark t3 as used.
5192
11e32464
NC
51932010-08-27 Nick Clifton <nickc@redhat.com>
5194
5195 * options.cc (version_script): Fix small typo in previous
5196 whitespace tidyup.
5197
ca09d69a
NC
51982010-08-25 Nick Clifton <nickc@redhat.com>
5199
5200 * archive.cc: Formatting fixes: Remove whitespace between
5201 typename and following asterisk. Remove whitespace between
5202 function name and opening parenthesis.
5203 * archive.h: Likewise.
5204 * arm.cc: Likewise.
5205 * attributes.cc: Likewise.
5206 * attributes.h: Likewise.
5207 * common.cc: Likewise.
5208 * copy-relocs.cc: Likewise.
5209 * dirsearch.h: Likewise.
5210 * dynobj.cc: Likewise.
5211 * ehframe.cc: Likewise.
5212 * ehframe.h: Likewise.
5213 * expression.cc: Likewise.
5214 * fileread.cc: Likewise.
5215 * fileread.h: Likewise.
5216 * gc.h: Likewise.
5217 * gold-threads.cc: Likewise.
5218 * gold.cc: Likewise.
5219 * i386.cc: Likewise.
5220 * icf.h: Likewise.
5221 * incremental-dump.cc: Likewise.
5222 * incremental.cc: Likewise.
5223 * layout.cc: Likewise.
5224 * layout.h: Likewise.
5225 * main.cc: Likewise.
5226 * merge.cc: Likewise.
5227 * merge.h: Likewise.
5228 * object.cc: Likewise.
5229 * object.h: Likewise.
5230 * options.cc: Likewise.
5231 * options.h: Likewise.
5232 * output.cc: Likewise.
5233 * output.h: Likewise.
5234 * plugin.cc: Likewise.
5235 * plugin.h: Likewise.
5236 * powerpc.cc: Likewise.
5237 * reloc.cc: Likewise.
5238 * script-c.h: Likewise.
5239 * script-sections.cc: Likewise.
5240 * script.cc: Likewise.
5241 * stringpool.cc: Likewise.
5242 * symtab.cc: Likewise.
5243 * symtab.h: Likewise.
5244 * target.cc: Likewise.
5245 * timer.cc: Likewise.
5246 * timer.h: Likewise.
5247 * version.cc: Likewise.
5248 * x86_64.cc: Likewise.
5249
b8fa8750
NC
52502010-08-24 Nick Clifton <nickc@redhat.com>
5251
5252 PR 11899
5253 * layout.cc (segment_precedes): Sort segments by their physical
5254 addresses, if they have been set.
5255
9919d93b
CC
52562010-08-23 Cary Coutant <ccoutant@google.com>
5257
5258 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
5259 symbols data.
5260 (Lib_group::include_member): Unlock object after deleting its
5261 symbols data.
5262 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
5263 the bug fixed here.
5264
97b4be1c
CC
52652010-08-19 Neil Vachharajani <nvachhar@google.com>
5266 Cary Coutant <ccoutant@google.com>
5267
5268 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
5269 constructor, and set_blocker.
5270 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
5271 readsyms_blocker_.
5272 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
5273 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
5274 * testsuite/Makefile.am (start_lib_test): New test case.
5275 * testsuite/Makefile.in: Regenerate.
5276 * testsuite/start_lib_test_main.c: New file.
5277 * testsuite/start_lib_test_1.c: New file.
5278 * testsuite/start_lib_test_2.c: New file.
5279 * testsuite/start_lib_test_3.c: New file.
5280
dd0b1884
ILT
52812010-08-19 Ian Lance Taylor <iant@google.com>
5282
5283 * Makefile.in: Rebuild with automake 1.11.1.
5284 * aclocal.m4: Likewise.
5285 * testsuite/Makefile.in: Likewise.
5286
7223e9ca
ILT
52872010-08-19 Ian Lance Taylor <iant@google.com>
5288
5289 PR 10893
5290 * i386.cc (class Output_data_plt_i386): Update declarations.
5291 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
5292 local_ifuncs_ fields.
5293 (Target_i386::do_plt_section_for_global): New function.
5294 (Target_i386::do_plt_section_for_local): New function.
5295 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
5296 parameter; change all callers. Initialize global_ifuncs_ and
5297 local_ifuncs_. If doing a static link define __rel_iplt_start and
5298 __rel_iplt_end.
5299 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
5300 (Output_data_plt_i386::add_local_ifunc_entry): New function.
5301 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
5302 symbols.
5303 (Target_i386::make_plt_section): New function, broken out of
5304 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
5305 (Target_i386::make_plt_entry): Call make_plt_section.
5306 (Target_i386::make_local_ifunc_plt_entry): New function.
5307 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
5308 (Target_i386::Scan::local): Handle IFUNC symbols. Add
5309 R_386_IRELATIVE to switch.
5310 (Target_i386::Scan::global): Likewise.
5311 (Target_i386::Relocate::relocate): Likewise.
5312 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
5313 switch.
5314 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
5315 (Target_x86_64::do_plt_section_for_global): New function.
5316 (Target_x86_64::do_plt_section_for_local): New function.
5317 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
5318 parameter; change all callers. If doing a static link define
5319 __rela_iplt_start and __rela_iplt_end.
5320 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
5321 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
5322 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
5323 to point to .plt.
5324 (Target_x86_64::make_local_ifunc_plt_entry): New function.
5325 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
5326 switch.
5327 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
5328 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
5329 R_X86_64_IRELATIVE to switch.
5330 (Target_x86_64::Scan::global): Likewise.
5331 (Target_x86_64::Relocate::relocate): Likewise.
5332 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
5333 switch.
5334 * target.h (class Target): Add plt_section_for_global and
5335 plt_section_for_local functions. Add do_plt_section_for_global
5336 and do_plt_section_for_local virtual functions.
5337 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
5338 clarifying comments.
5339 (Symbol::use_plt_offset): Handle IFUNC symbol.
5340 * object.cc (Sized_relobj::Sized_relobj): Initialize
5341 local_plt_offsets_.
5342 (Sized_relobj::local_has_plt_offset): New function.
5343 (Sized_relobj::local_plt_offset): New function.
5344 (Sized_relobj::set_local_plt_offset): New function.
5345 (Sized_relobj::do_count): Handle IFUNC symbol.
5346 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
5347 a bit away from input_shndx_ field. Add set_is_func_symbol and
5348 is_ifunc_symbol functions.
5349 (class Sized_relobj): Update declarations. Remove Tls_got_entry
5350 and Local_tls_got_offsets. Define Local_plt_offsets. Add
5351 local_plt_offsets_ field.
5352 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
5353 * output.h (class Output_section_data): Add non-const
5354 output_section function.
5355 (class Output_data_got): Update declarations.
5356 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
5357 Add use_plt_offset parameter to global and local constructors.
5358 Change all callers. Change local_sym_index_ field to 31 bits.
5359 Change GSYM_CODE and CONSTANT_CODE accordingly.
5360 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
5361 doing a static link don't set sh_link field.
5362 (Output_data_got::Got_entry::write): Use PLT offset if
5363 appropriate.
5364 (Output_data_got::add_global_plt): New function.
5365 (Output_data_got::add_local_plt): New function.
5366 * target-reloc.h (relocate_section): Handle IFUNC symbol.
5367 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
5368 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
5369 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
5370 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
5371 IFUNC conditional.
5372 * testsuite/ifunc-sel.h: New file.
5373 * testsuite/ifuncmain1.c: New file.
5374 * testsuite/ifuncmain1vis.c: New file.
5375 * testsuite/ifuncmod1.c: New file.
5376 * testsuite/ifuncdep2.c: New file.
5377 * testsuite/ifuncmain2.c: New file.
5378 * testsuite/ifuncmain3.c: New file.
5379 * testsuite/ifuncmod3.c: New file.
5380 * testsuite/ifuncmain4.c: New file.
5381 * testsuite/ifuncmain5.c: New file.
5382 * testsuite/ifuncmod5.c: New file.
5383 * testsuite/ifuncmain6pie.c: New file.
5384 * testsuite/ifuncmod6.c: New file.
5385 * testsuite/ifuncmain7.c: New file.
5386 * configure, testsuite/Makefile.in: Rebuild.
5387
56f75c03
ILT
53882010-08-18 Ian Lance Taylor <iant@google.com>
5389
5390 * incremental.cc
5391 (Output_section_incremental_inputs::write_input_files): Add cast
5392 to avoid signed/unsigned comparison warning.
5393 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5394
55455f89
CC
53952010-08-12 Cary Coutant <ccoutant@google.com>
5396
5397 * common.cc (Sort_commons::operator()): Remove unnecessary code.
5398
e2054bcb
ILT
53992010-08-13 Ian Lance Taylor <iant@google.com>
5400
5401 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
5402
74f67560
DK
54032010-08-12 Cary Coutant <ccoutant@google.com>
5404 Doug Kwan <dougkwan@google.com>
5405
5406 * resolve.cc (Symbol_table::should_override): When a weak dynamic
5407 defintion overrides non-weak undef, remember that the original undef
5408 is not weak.
5409 * symtab.cc (Symbol_table::sized_write_global): For undef without
5410 an original weak binding, set binding to global in output.
5411 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
5412 * testsuite/Makefile.in: Regenerate.
5413 * testsuite/strong_ref_weak_def.sh: New file.
5414 * testsuite/strong_ref_weak_def_1.c: Ditto.
5415 * testsuite/strong_ref_weak_def_2.c: Ditto.
5416
d1238d12
CC
54172010-08-12 Cary Coutant <ccoutant@google.com>
5418
5419 * testsuite/incremental_test.sh: Rewrite.
5420 * testsuite/incremental_test_1.c: Rewrite.
5421 * testsuite/incremental_test_2.c: Rewrite.
5422
0e70b911
CC
54232010-08-12 Cary Coutant <ccoutant@google.com>
5424
5425 * arm.cc (Target_arm::got_size): Add const.
5426 (Target_arm::got_entry_count): New function.
5427 (Target_arm::plt_entry_count): New function.
5428 (Target_arm::first_plt_entry_offset): New function.
5429 (Target_arm::plt_entry_size): New function.
5430 (Output_data_plt_arm::entry_count): New function.
5431 (Output_data_plt_arm::first_plt_entry_offset): New function.
5432 (Output_data_plt_arm::get_plt_entry_size): New function.
5433 * i386.cc (Target_i386::got_size): Add const.
5434 (Target_i386::got_entry_count): New function.
5435 (Target_i386::plt_entry_count): New function.
5436 (Target_i386::first_plt_entry_offset): New function.
5437 (Target_i386::plt_entry_size): New function.
5438 (Output_data_plt_i386::entry_count): New function.
5439 (Output_data_plt_i386::first_plt_entry_offset): New function.
5440 (Output_data_plt_i386::get_plt_entry_size): New function.
5441 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
5442 find_incremental_inputs_sections. Dump incremental_got_plt section.
5443 * incremental.cc: Include target.h.
5444 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
5445 parameter. Adjust all callers. Find incremental_got_plt section.
5446 (Incremental_inputs::create_data_sections): Create incremental_got_plt
5447 section.
5448 (Output_section_incremental_inputs::set_final_data_size): Calculate
5449 size of incremental_got_plt section.
5450 (Output_section_incremental_inputs::do_write): Write the
5451 incremental_got_plt section.
5452 (Got_plt_view_info): New struct.
5453 (Local_got_offset_visitor): New class.
5454 (Global_got_offset_visitor): New class.
5455 (Global_symbol_visitor_got_plt): New class.
5456 (Output_section_incremental_inputs::write_got_plt): New function.
5457 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
5458 Add parameter. Adjust all callers.
5459 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
5460 (Incremental_inputs::got_plt_section): New function.
5461 (Incremental_inputs::got_plt_section_): New data member.
5462 (Incremental_got_plt_reader): New class.
5463 * layout.cc (Layout::create_incremental_info_sections): Add the
5464 incremental_got_plt section.
5465 * object.h (Got_offset_list::get_list): New function.
5466 (Got offset_list::for_all_got_offsets): New function.
5467 (Sized_relobj::local_got_offset_list): New function.
5468 * powerpc.cc (Target_powerpc::got_size): Add const.
5469 (Target_powerpc::got_entry_count): New function.
5470 (Target_powerpc::plt_entry_count): New function.
5471 (Target_powerpc::first_plt_entry_offset): New function.
5472 (Target_powerpc::plt_entry_size): New function.
5473 (Output_data_plt_powerpc::entry_count): New function.
5474 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
5475 (Output_data_plt_powerpc::get_plt_entry_size): New function.
5476 * sparc.cc (Target_sparc::got_size): Add const.
5477 (Target_sparc::got_entry_count): New function.
5478 (Target_sparc::plt_entry_count): New function.
5479 (Target_sparc::first_plt_entry_offset): New function.
5480 (Target_sparc::plt_entry_size): New function.
5481 (Output_data_plt_sparc::entry_count): New function.
5482 (Output_data_plt_sparc::first_plt_entry_offset): New function.
5483 (Output_data_plt_sparc::get_plt_entry_size): New function.
5484 * symtab.h (Symbol::got_offset_list): New function.
5485 (Symbol_table::for_all_symbols): New function.
5486 * target.h (Sized_target::got_entry_count): New function.
5487 (Sized_target::plt_entry_count): New function.
5488 (Sized_target::plt_entry_size): New function.
5489 * x86_64.cc (Target_x86_64::got_size): Add const.
5490 (Target_x86_64::got_entry_count): New function.
5491 (Target_x86_64::plt_entry_count): New function.
5492 (Target_x86_64::first_plt_entry_offset): New function.
5493 (Target_x86_64::plt_entry_size): New function.
5494 (Output_data_plt_x86_64::entry_count): New function.
5495 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
5496 (Output_data_plt_x86_64::get_plt_entry_size): New function.
5497
09ec0418
CC
54982010-08-12 Cary Coutant <ccoutant@google.com>
5499
5500 * archive.cc: Include incremental.h.
5501 (Archive::Archive): Initialize incremental_info_.
5502 (Archive::include_member): Record archive members in incremental info.
5503 (Add_archive_symbols::run): Record begin and end of an archive in
5504 incremental info.
5505 (Lib_group::include_member): Record objects in incremental info.
5506 * archive.h (Incremental_archive_entry): Forward declaration.
5507 (Archive::set_incremental_info): New member function.
5508 (Archive::incremental_info): New member function.
5509 (Archive::Unused_symbol_iterator): New class.
5510 (Archive::unused_symbols_begin): New member function.
5511 (Archive::unused_symbols_end): New member function.
5512 (Archive::incremental_info_): New data member.
5513 * incremental-dump.cc (find_input_containing_global): New function.
5514 (dump_incremental_inputs): Dump new incremental info sections.
5515 * incremental.cc: Include symtab.h.
5516 (Output_section_incremental_inputs): New class.
5517 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
5518 new incremental info sections.
5519 (Sized_incremental_binary::do_check_inputs): Likewise.
5520 (Incremental_inputs::report_archive): Remove.
5521 (Incremental_inputs::report_archive_begin): New function.
5522 (Incremental_inputs::report_archive_end): New function.
5523 (Incremental_inputs::report_object): New function.
5524 (Incremental_inputs::finalize_inputs): Remove.
5525 (Incremental_inputs::report_input_section): New function.
5526 (Incremental_inputs::report_script): Rewrite.
5527 (Incremental_inputs::finalize): Do nothing but finalize string table.
5528 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
5529 (Incremental_inputs::sized_create_inputs_section_data): Remove.
5530 (Incremental_inputs::create_data_sections): New function.
5531 (Incremental_inputs::relocs_entsize): New function.
5532 (Output_section_incremental_inputs::set_final_data_size): New function.
5533 (Output_section_incremental_inputs::do_write): New function.
5534 (Output_section_incremental_inputs::write_header): New function.
5535 (Output_section_incremental_inputs::write_input_files): New function.
5536 (Output_section_incremental_inputs::write_info_blocks): New function.
5537 (Output_section_incremental_inputs::write_symtab): New function.
5538 * incremental.h (Incremental_script_entry): Forward declaration.
5539 (Incremental_object_entry): Forward declaration.
5540 (Incremental_archive_entry): Forward declaration.
5541 (Incremental_inputs): Forward declaration.
5542 (Incremental_inputs_header_data): Remove.
5543 (Incremental_inputs_header): Remove.
5544 (Incremental_inputs_header_write): Remove.
5545 (Incremental_inputs_entry_data): Remove.
5546 (Incremental_inputs_entry): Remove.
5547 (Incremental_inputs_entry_write): Remove.
5548 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
5549 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
5550 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
5551 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
5552 Likewise.
5553 (Incremental_input_entry): New class.
5554 (Incremental_script_entry): New class.
5555 (Incremental_object_entry): New class.
5556 (Incremental_archive_entry): New class.
5557 (Incremental_inputs::Incremental_inputs): Initialize new data members.
5558 (Incremental_inputs::report_inputs): Remove.
5559 (Incremental_inputs::report_archive): Remove.
5560 (Incremental_inputs::report_archive_begin): New function.
5561 (Incremental_inputs::report_archive_end): New function.
5562 (Incremental_inputs::report_object): Change prototype.
5563 (Incremental_inputs::report_input_section): New function.
5564 (Incremental_inputs::report_script): Change prototype.
5565 (Incremental_inputs::get_reloc_count): New function.
5566 (Incremental_inputs::set_reloc_count): New function.
5567 (Incremental_inputs::create_data_sections): New function.
5568 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
5569 (Incremental_inputs::inputs_section): New function.
5570 (Incremental_inputs::symtab_section): New function.
5571 (Incremental_inputs::relocs_section): New function.
5572 (Incremental_inputs::get_stringpool): Add const.
5573 (Incremental_inputs::command_line): Add const.
5574 (Incremental_inputs::inputs): Remove.
5575 (Incremental_inputs::command_line_key): New function.
5576 (Incremental_inputs::input_file_count): New function.
5577 (Incremental_inputs::input_files): New function.
5578 (Incremental_inputs::relocs_entsize): New function.
5579 (Incremental_inputs::sized_create_inputs_section_data): Remove.
5580 (Incremental_inputs::finalize_inputs): Remove.
5581 (Incremental_inputs::Input_info): Remove.
5582 (Incremental_inputs::lock_): Remove.
5583 (Incremental_inputs::inputs_): Change type.
5584 (Incremental_inputs::inputs_map_): Remove.
5585 (Incremental_inputs::current_object_entry_): New data member.
5586 (Incremental_inputs::inputs_section_): New data member.
5587 (Incremental_inputs::symtab_section_): New data member.
5588 (Incremental_inputs::relocs_section_): New data member.
5589 (Incremental_inputs::reloc_count_): New data member.
5590 (Incremental_inputs_reader): New class.
5591 (Incremental_symtab_reader): New class.
5592 (Incremental_relocs_reader): New class.
5593 * layout.cc (Layout::finalize): Move finalization of incremental info
5594 and creation of incremental info sections to follow finalization of
5595 symbol table. Set offsets for postprocessing sections.
5596 (Layout::create_incremental_info_sections): Call
5597 Incremental_inputs::create_data_sections. Add incremental symtab
5598 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
5599 sections to layout after input sections.
5600 * layout.h (struct Timespec): Forward declaration.
5601 (Layout::incremental_inputs): Add const.
5602 (Layout::create_incremental_info_sections): Add parameter.
5603 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
5604 * object.cc: Include incremental.h.
5605 (Relobj::finalize_incremental_relocs): New function.
5606 (Sized_relobj::do_layout): Record input sections in incremental info.
5607 * object.h (Object::output_section): New function.
5608 (Object::output_section_offset): Moved from Relobj.
5609 (Object::get_incremental_reloc_base): New function.
5610 (Object::get_incremental_reloc_count): New function.
5611 (Object::do_output_section): New function.
5612 (Object::do_output_section_offset): Moved from Relobj.
5613 (Object::do_get_incremental_reloc_base): New function.
5614 (Object::do_get_incremental_reloc_count): New function.
5615 (Object::Object): Initialize new data members.
5616 (Relobj::output_section): Renamed do_output_section and moved to
5617 protected.
5618 (Relobj::output_section_offset): Moved to Object.
5619 (Relobj::do_get_incremental_reloc_base): New function.
5620 (Relobj::do_get_incremental_reloc_count): New function.
5621 (Relobj::allocate_incremental_reloc_counts): New function.
5622 (Relobj::count_incremental_reloc): New function.
5623 (Relobj::finalize_incremental_relocs): New function.
5624 (Relobj::next_incremental_reloc_index): New function.
5625 (Relobj::reloc_counts_): New data member.
5626 (Relobj::reloc_bases_): New data member.
5627 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
5628 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
5629 (Sized_relobj::incremental_relocs_scan): New function.
5630 (Sized_relobj::incremental_relocs_scan_reltype): New function.
5631 (Sized_relobj::incremental_relocs_write): New function.
5632 (Sized_relobj::incremental_relocs_write_reltype): New function.
5633 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
5634 incremental link.
5635 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
5636 archives and object files elsewhere.
5637 (Add_symbols::run): Report object files here.
5638 (Finish_group::run): Report end of archive at end of group.
5639 * reloc.cc: Include layout.h, incremental.h.
5640 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
5641 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
5642 (Sized_relobj::incremental_relocs_scan): New function.
5643 (Sized_relobj::incremental_relocs_scan_reltype): New function.
5644 (Sized_relobj::do_relocate_sections): Write incremental relocations.
5645 (Sized_relobj::incremental_relocs_write): New function.
5646 (Sized_relobj::incremental_relocs_write_reltype): New function.
5647 * script.cc (read_input_script): Rewrite test for incremental link.
5648 Change call to Incremental_inputs::report_script.
5649 * symtab.h (Symbol_table::first_global_index): New function.
5650 (Symbol_table::output_count): New function.
5651
ce0d1972
DK
56522010-08-12 Doug Kwan <dougkwan@google.com>
5653
5654 * arm.cc (Target_arm::merge_object_attributes): Check command line
5655 options --no-wchar-size-warning and --no-enum-size-warning.
5656 * options.h (General_options): Add ld-compatible options
5657 --no-enum-size-warning and --no-wchar-size-warning.
5658
6e5710ce
ILT
56592010-08-04 Ian Lance Taylor <iant@google.com>
5660
5661 * x86_64.cc (Target_x86_64::Scan::local): Use
5662 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
5663 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
5664 (Target_x86_64::Scan::global): Likewise.
5665 (Target_x86_64::Relocate::relocate): Likewise.
5666 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
5667 Likewise.
5668
fef830db
CC
56692010-08-03 Cary Coutant <ccoutant@google.com>
5670
5671 * merge.cc (Output_merge_string::do_add_input_section): Count strings
5672 to reserve space in merged_strings vector. Keep total input size
5673 for stats.
5674 (Output_merge_string::do_print_merge_stats): Print total input size.
5675 * merge.h (Output_merge_string): Add input_size_ field.
5676 * stringpool.cc (Stringpool_template::string_length): Move
5677 implementations out of Stringpool_template class and place in
5678 stringpool.h.
5679 * stringpool.h (string_length): Move out of Stringpool_template.
5680
1e3811b0
ILT
56812010-08-03 Ian Lance Taylor <iant@google.com>
5682
5683 PR 11712
5684 * layout.cc (relaxation_loop_body): If address of load segment is
5685 set, adjust address to include headers if possible.
5686
7af0c620
ILT
56872010-08-03 Ian Lance Taylor <iant@google.com>
5688
5689 * version.cc (version_string): Bump to 1.10.
5690
22f0da72
ILT
56912010-08-03 Ian Lance Taylor <iant@google.com>
5692
5693 PR 11805
5694 * layout.h (enum Output_section_order): Define.
5695 (class Layout): Update declarations.
5696 * layout.cc (Layout::get_output_section): Add order parameter.
5697 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
5698 is_first_non_relro parameters. Change all callers.
5699 (Layout::choose_output_section): Likewise.
5700 (Layout::add_output_section_data): Likewise.
5701 (Layout::make_output_section): Likewise. Set order.
5702 (Layout::default_section_order): New function.
5703 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
5704 * output.cc (Output_section::Output_section): Initialize order_.
5705 Don't initialize deleted fields.
5706 (Output_segment::Output_segment): Don't initialize deleted
5707 fields.
5708 (Output_segment::add_output_section_to_load): New function
5709 replacing add_output_section. Change all callers to call this or
5710 add_output_section_to_nonload.
5711 (Output_segment::add_output_section_to_nonload): New function.
5712 (Output_segment::remove_output_section): Rewrite.
5713 (Output_segment::add_initial_output_data): Likewise.
5714 (Output_segment::has_any_data_sections): Likewise.
5715 (Output_segment::is_first_section_relro): Likewise.
5716 (Output_segment::maximum_alignment): Likewise.
5717 (Output_segment::has_dynamic_reloc): New function replacing
5718 dynamic_reloc_count. Change all callers.
5719 (Output_segment::has_dynamic_reloc_list): New function replacing
5720 dynamic_reloc_count_list. Change all callers.
5721 (Output_segment::set_section_addresses): Rewrite.
5722 (Output_segment::set_offset): Rewrite.
5723 (Output_segment::find_first_and_last_list): Remove.
5724 (Output_segment::set_tls_offsets): Rewrite.
5725 (Output_segment::first_section_load_address): Likewise.
5726 (Output_segment::output_section_count): Likewise.
5727 (Output_segment::section_with_lowest_load_address): Likewise.
5728 (Output_segment::write_section_headers): Likewise.
5729 (Output_segment::print_sections_to_map): Likewise.
5730 * output.h (class Output_data): Remove dynamic_reloc_count_
5731 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
5732 (Output_data::add_dynamic_reloc): Rewrite.
5733 (Output_data::has_dynamic_reloc): New function.
5734 (Output_data::dynamic_reloc_count): Remove.
5735 (class Output_section): Add order_ field. Remvoe is_relro_local_,
5736 is_last_relro_, is_first_non_relro_, is_interp_,
5737 is_dynamic_linker_section_ fields. Add order and set_order
5738 functions. Remove is_relro_local, set_is_relro_local,
5739 is_last_relro, set_is_last_relro, is_first_non_relro,
5740 set_is_first_non_relro functions, is_interp, set_is_interp,
5741 is_dynamic_linker_section, and set_is_dynamic_linker_section
5742 functions.
5743 (class Output_segment): Change Output_data_list from std::list to
5744 std:;vector. Add output_lists_ field. Remove output_data_ and
5745 output_bss_ fields. Update declarations.
5746
3ff2ccb0
ILT
57472010-08-02 Ian Lance Taylor <iant@google.com>
5748
5749 * arm.cc (Target_arm::gc_process_relocs): Use typename.
5750 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
5751 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
5752
88a4108b
ILT
57532010-08-02 Ian Lance Taylor <iant@google.com>
5754
5755 PR 11855
5756 * script.cc (Script_options::Script_options): Initialize
5757 symbol_definitions_ and symbol_references_.
5758 (Script_options::add_symbol_assignment): Update
5759 symbol_definitions_ and symbol_references_.
5760 (Script_options::add_symbol_reference): New function.
5761 (script_symbol): New function.
5762 * script.h (class Script_options): Add symbol_definitions_ and
5763 symbol_references_ fields.
5764 (Script_options::referenced_const_iterator): New type.
5765 (Script_options::referenced_begin): New function.
5766 (Script_options::referenced_end): New function.
5767 (Script_options::is_referenced): New function.
5768 (Script_options::any_unreferenced): New function.
5769 * script-c.h (script_symbol): Declare.
5770 * yyscript.y (exp): Call script_symbol.
5771 * symtab.cc: Include "script.h".
5772 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
5773 Change all callers. Check symbols referenced by scripts.
5774 (Symbol_table::add_undefined_symbols_from_command_line): Add
5775 layout parameter. Change all callers.
5776 (Symbol_table::do_add_undefined_symbols_from_command_line):
5777 Likewise. Break out loop body. Check symbols referenced by
5778 scripts.
5779 (Symbol_table::add_undefined_symbol_from_command_line): New
5780 function broken out of
5781 do_add_undefined_symbols_from_command_line.
5782 * symtab.h (class Symbol_table): Update declarations.
5783 * archive.cc: Include "layout.h".
5784 (Archive::should_include_member): Add layout parameter. Change
5785 all callers. Check for symbol mentioned in expression.
5786 * archive.h (class Archive): Update declaration.
5787 * object.cc (Sized_relobj::do_should_include_member): Add layout
5788 parameter.
5789 * object.h (Object::should_include_member): Add layout parameter.
5790 Change all callers.
5791 (Object::do_should_include_member): Add layout parameter.
5792 (class Sized_relobj): Update declaration.
5793 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
5794 parameter.
5795 * dynobj.h (class Sized_dynobj): Update declaration.
5796 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
5797 layout parameter.
5798 * plugin.h (class Sized_pluginobj): Update declaration.
5799
5f1ab67a
ILT
58002010-08-02 Ian Lance Taylor <iant@google.com>
5801
5802 PR 11866
5803 * output.cc (Output_segment::set_offset): Search for the first and
5804 last sections rather than assuming that the list is in order.
5805 (Output_segment::find_first_and_last_list): New function.
5806 * output.h (class Output_segment): Update declarations.
5807 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
5808 (relro_strip_test_SOURCES): New variable.
5809 (relro_strip_test_DEPENDENCIES): New variable.
5810 (relro_strip_test_LDFLAGS): New variable.
5811 (relro_strip_test_LDADD): New variable.
5812 (relro_strip_test.so): New target.
5813
a8df5856
ILT
58142010-08-02 Ian Lance Taylor <iant@google.com>
5815
5816 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
5817 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
5818 (Target_i386::got_tlsdesc_section): New function.
5819 (Target_i386::got_section): Create space for GOT entries for
5820 TLSDESC relocations.
5821 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
5822 R_386_TLS_GOTDESC.
5823 (Target_i386::Scan::global): Likewise.
5824 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
5825 using TLSDESC GOT.
5826 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
5827 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
5828 (Target_x86_64::got_tlsdesc_section): New function.
5829 (Target_x86_64::got_section): Create space for GOT entries for
5830 TLSDESC relocations.
5831 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
5832 R_386_TLS_GOTDESC.
5833 (Target_x86_64::Scan::global): Likewise.
5834 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
5835 using TLSDESC GOT.
5836
0c10a0a6
ILT
58372010-08-02 Ian Lance Taylor <iant@google.com>
5838
5839 * testsuite/final_layout.sh: Use dc to convert from hex to
5840 decimal.
5841
41cbeecc
ST
58422010-07-29 Sriraman Tallam <tmsriram@google.com>
5843
5844 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
5845 paramter to the call to gold::gc_process_relocs.
5846 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
5847 paramter to the call to gold::gc_process_relocs.
5848 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
5849 parameter to the call to gold::gc_process_relocs.
5850 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
5851 template parameter to the call to gold::gc_process_relocs.
5852 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
5853 paramter to the call to gold::gc_process_relocs.
5854 * gc.h (get_embedded_addend_size): New function.
5855 (gc_process_relocs): Save the size of the reloc for use by ICF.
5856 * icf.cc (get_section_contents): Get the addend from the text section
5857 for SHT_REL relocation sections.
5858 * icf.h (Icf::Reloc_addend_size_info): New typedef.
5859 (Icf::Reloc_info): Add new member reloc_addend_size_info.
5860 * int_encoding.h (read_from_pointer): New overloaded function.
5861 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
5862 * testsuite/icf_sht_rel_addend_test.sh: New file.
5863 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
5864 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
5865
6ea55b82
RW
58662010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5867
5868 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
5869 * Makefile.in: Regenerate.
5870 * testsuite/Makefile.in: Regenerate.
5871
9691462b
ILT
58722010-07-27 Jeffrey Yasskin <jyasskin@google.com>
5873
5874 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
5875 * gold/testsuite/debug_msg.cc: Likewise.
5876 * gold/testsuite/odr_violation1.cc
5877 * gold/testsuite/odr_violation2.cc
5878
76897331
CC
58792010-07-21 Cary Coutant <ccoutant@google.com>
5880
5881 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
5882 string, and length fields.
5883 (Output_merge_string::Merged_strings_list): New type.
5884 (Output_merge_string::Merged_strings_lists): New typedef.
5885 (Output_merge_string): Replace merged_strings_ with
5886 merged_strings_lists_.
5887 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
5888 Merged_strings_list per input object and section. Don't store pointer
5889 to the string. Don't store length with each merged string entry.
5890 (Output_merge_string::finalize_merged_data): Loop over list of merged
5891 strings lists. Recompute length of each merged string.
5892
78384e8f
CC
58932010-07-15 Cary Coutant <ccoutant@google.com>
5894
5895 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
5896 here.
5897
783659f9
ILT
58982010-07-14 Ian Lance Taylor <iant@google.com>
5899
5900 * descriptors.cc (Descriptors::open): Report correct name in error
5901 message.
5902
131687b4
DK
59032010-07-13 Doug Kwan <dougkwan@google.com>
5904
5905 * arm.cc (Arm_input_section::Arm_input_section): For a
5906 SHT_ARM_EXIDX section, always keeps the input sections.
5907 (Arm_input_section::set_exidx_section_link): New method.
5908 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
5909 has_errors_ to false.
5910 (Arm_exidx_input_section::has_errors,
5911 Arm_exidx_input_section::set_has_errors): New methods.
5912 (Arm_exidx_input_section::has_errors_): New data member.
5913 (Arm_relobj::get_exidx_shndx_list): New method.
5914 (Arm_output_section::append_text_sections_to_list): Do not skip
5915 section without SHF_EXECINSTR.
5916 (Arm_output_section::fix_exidx_coverage): Skip input sections with
5917 errors.
2e702c99 5918 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
5919 section header. Make error messages more verbose. Check for
5920 a non-executable section linked to an EXIDX section.
5921 (Arm_relobj::do_read_symbols): Remove error checking, which has been
5922 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
5923 check that there is no deferred EXIDX section if we exit early.
5924 Instead of not making an EXIDX section in case of an error, make one
5925 and set the has_errors flag of it.
5926 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
5927 in a relocatable link.
5928 (Target_arm::do_relax): Look for the EXIDX output section instead of
5929 assuming that it is called .ARM.exidx.
2e702c99 5930 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
5931 section list. Do not check for SHF_EXECINSTR section flags but
5932 skip any input section with errors.
5933 * output.cc (Output_section::Output_section): Initialize
5934 always_keeps_input_sections_ to false.
5935 (Output_section::add_input_section): Check for
5936 always_keeps_input_sections_.
5937 * output.h (Output_section::always_keeps_input_sections,
5938 Output_section::set_always_keeps_input_sections): New methods.
5939 (Output_section::always_keeps_input_sections): New data member.
5940
69517287
RÁE
59412010-07-13 Rafael Espindola <espindola@google.com>
5942
5943 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
5944 * fileread.h (Input_file): Add try_extra_search_path and find_file.
5945
82742395
ILT
59462010-07-13 Philip Herron <herron.philip@googlemail.com>
5947 Ian Lance Taylor <iant@google.com>
5948
5949 * output.h (Output_section_lookup_maps::add_merge_section):
5950 Correct check of whether value was inserted.
5951 (Output_section_lookup_maps::add_merge_input_section): Likewise.
5952 (Output_section_lookup_maps::add_relaxed_input_section):
5953 Likewise.
5954 * arm.cc (Target_arm::got_section): Remove used local os.
5955 * i386.cc (Target_i386::got_section): Likewise.
5956 * x86_64.cc (Target_x86_64::got_section): Likewise.
5957 * sparc.cc (Target_sparc::got_section): Likewise.
5958 (Target_sparc::relocate): Remove unused local have_got_offset.
5959 * powerpc.cc (Target_powerpc::relocate): Likewise.
5960
f2d707b5
ILT
59612010-07-13 Ian Lance Taylor <iant@google.com>
5962
241531d6
ILT
5963 * compressed_output.cc (zlib_decompress): Fix signature in
5964 !HAVE_ZLIB_H case.
5965
f2d707b5
ILT
5966 * archive.cc (Archive::include_member): Unlock an external member
5967 of a thin archive. Don't bother to delete an object we know is
5968 NULL.
5969
a2e47362
CC
59702010-07-12 Cary Coutant <ccoutant@google.com>
5971
5972 * compressed_output.cc (zlib_decompress): New function.
5973 (get_uncompressed_size): New function.
5974 (decompress_input_section): New function.
5975 * compressed_output.h (get_uncompressed_size): New function.
5976 (decompress_input_section): New function.
5977 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
5978 Handle compressed debug sections.
5979 * layout.cc (is_compressed_debug_section): New function.
5980 (Layout::output_section_name): Map compressed section names to
5981 canonical names.
5982 * layout.h (is_compressed_debug_section): New function.
5983 (is_debug_info_section): Recognize compressed debug sections.
5984 * merge.cc: Include compressed_output.h.
5985 (Output_merge_data::do_add_input_section): Handle compressed
5986 debug sections.
5987 (Output_merge_string::do_add_input_section): Handle compressed
5988 debug sections.
5989 * object.cc: Include compressed_output.h.
5990 (Sized_relobj::Sized_relobj): Initialize new data members.
5991 (build_compressed_section_map): New function.
5992 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
5993 * object.h (Object::section_is_compressed): New method.
5994 (Object::do_section_is_compressed): New method.
5995 (Sized_relobj::Compressed_section_map): New type.
5996 (Sized_relobj::do_section_is_compressed): New method.
5997 (Sized_relobj::compressed_sections_): New data member.
5998 * output.cc (Output_section::add_input_section): Handle compressed
5999 debug sections.
6000 * reloc.cc: Include compressed_output.h.
6001 (Sized_relobj::write_sections): Handle compressed debug sections.
6002
ce279a62
CC
60032010-07-08 Cary Coutant <ccoutant@google.com>
6004
6005 * resolve.cc (Symbol_table::resolve): Remember whether undef was
6006 weak when resolving to a dynamic def.
6007 (Symbol_table::should_override): Add adjust_dyndef flag; set it
6008 for weak undef/dynamic def cases. Adjust callers.
6009 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
6010 undef_binding_weak_.
6011 (Symbol_table::sized_write_globals): Adjust symbol binding.
6012 (Symbol_table::sized_write_symbol): Add binding parameter.
6013 * symtab.h (Symbol::set_undef_binding): New method.
6014 (Symbol::is_undef_binding_weak): New method.
6015 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
6016 (Symbol_table::should_override): Add new parameter.
6017 (Symbol_table::sized_write_symbol): Add new parameter.
6018
6019 * testsuite/weak_undef_file1.cc: Add new test case.
6020 * testsuite/weak_undef_file2.cc: Fix header comment.
6021 * testsuite/weak_undef_test.cc: Add new test case.
6022
b2286c10
DK
60232010-06-29 Doug Kwan <dougkwan@google.com>
6024
6025 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
6026 Initialize USE_SYMBOL_.
6027 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
6028 definition.
6029 (Arm_reloc_property::uses_symbol_): New data member declaration.
6030 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
6031 uses symbol value and symbol is undefined but not weakly undefined.
6032
4802450a
RÁE
60332010-06-28 Rafael Espindola <espindola@google.com>
6034
6035 * plugin.cc (Plugin::load): Use dlerror.
6036
e5ca47ba
ILT
60372010-06-26 Jeffrey Yaskin <jyasskin@google.com>
6038
6039 * symtab.cc (detect_odr_violations): When reporting an ODR
6040 violation, report an object where the symbol is defined.
6041
8a75a161
DK
60422010-06-25 Doug Kwan <dougkwan@google.com>
6043
6044 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
6045 (Target_arm::section_may_have_icf_unsafe_pointers): New method
6046 definition.
6047 (Target_arm::Scan::local_reloc_may_be_function_pointer,
6048 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
6049 target hook to detect function points.
6050 (Target_arm::Scan::possible_function_pointer_reloc): New method.
6051 * icf.h (Icf::check_section_for_function_pointers): Change type of
6052 parameter SECTION_NAME to const reference to std::string. Use
6053 target hook to determine if section may have unsafe pointers.
6054 * target.h (Target::section_may_have_icf_unsafe_pointers): New
6055 method definition.
6056
42218b9f
RÁE
60572010-06-21 Rafael Espindola <espindola@google.com>
6058
6059 * fileread.cc (Input_file::find_fie): New
6060 (Input_file::open): Use Input_file::find_fie.
6061 * fileread.h (Input_file::find_fie): New
6062 * plugin.cc (set_extra_library_path): New.
6063 (Plugin::load): Add set_extra_library_path to the transfer vector.
6064 (Plugin_manager::set_extra_library_path): New.
6065 (Plugin_manager::add_input_file): Use the extra search path if set.
6066 (set_extra_library_path(): New.
6067 * plugin.h (Plugin_manager): Add set_extra_library_path and
6068 extra_search_path_.
6069
a0506cca
CC
60702010-06-19 Cary Coutant <ccoutant@google.com>
6071
6072 * layout.cc (gdb_sections): Add .debug_types.
6073 (lines_only_debug_sections): Likewise.
6074
6508b958
RÁE
60752010-06-18 Rafael Espindola <espindola@google.com>
6076
6077 * plugin.cc (add_input_file,add_input_library)
6078 (Plugin_manager::add_input_file): Make filename arguments const.
6079 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
6080 const.
6081
3e235302
DK
60822010-06-16 Doug Kwan <dougkwan@google.com>
6083
6084 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
6085 .ARM.attributes section if we have not merged any input
6086 attributes sections.
6087
106e8a6c
DK
60882010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6089
6090 * arm.cc: Allow combining objects with no EABI version
6091 information.
6092
91ff43fe
RÁE
60932010-06-15 Rafael Espindola <espindola@google.com>
6094
6095 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
6096
68ed838c
ILT
60972010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6098
6099 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
6100 (struct iovec): Correct !HAVE_READV definition.
6101
f3a2388f
CC
61022010-06-10 Cary Coutant <ccoutant@google.com>
6103
6104 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
6105 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
6106 reloc sections.
6107 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
6108
6109 PR 11683
6110 * symtab.h (Symbol::is_placeholder): New member function.
6111 * target-reloc.h (relocate_section): Check for placeholder symbols.
6112
6113 * testsuite/Makefile.am (plugin_test_8): New test.
6114 (plugin_test_9): New test.
6115 * testsuite/Makefile.in: Regenerate.
6116
e1df38aa
NC
61172010-06-09 Nick Clifton <nickc@redhat.com>
6118
6119 * yyscript.y (input_list_element): Allow strings prefixed with
6120 the '-' character. Treat these as libraries.
6121 * script.cc (script_add_library): New function. Adds a library
6122 specified by "-l<name>" found in an input script.
6123 * script-c.h: Add prototype for script_add_library.
6124
25bbe950
DK
61252010-06-07 Doug Kwan <dougkwan@google.com>
6126
6127 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
6128 Restrict stub-group size to be within long conditional branch
6129 range when working around cortex-A8 erratum.
6130
0f32ea4c
ILT
61312010-06-07 Damien Diederen <dd@crosstwine.com>
6132
6133 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
6134 #ifdef typo.
6135
8fe2a369
ST
61362010-06-03 Sriraman Tallam <tmsriram@google.com>
6137
6138 PR gold/11658
6139 * output.cc
6140 (Output_section::Input_section_sort_entry::compare_section_ordering):
6141 Change to return non-zero correctly.
6142 (Output_section::Input_section_sort_section_order_index_compare
6143 ::operator()): Change to fix ambiguity in comparisons.
6144
6e9ba2ca
ST
61452010-06-01 Sriraman Tallam <tmsriram@google.com>
6146
6147 * gold.h (is_wildcard_string): New function.
6148 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
6149 (Layout::layout_eh_frame): Ditto.
6150 (Layout::find_section_order_index): New method.
6151 (Layout::read_layout_from_file): New method.
6152 * layout.h (Layout::find_section_order_index): New method.
6153 (Layout::read_layout_from_file): New method.
6154 (Layout::input_section_position_): New private member.
6155 (Layout::input_section_glob_): New private member.
6156 * main.cc (main): Call read_layout_from_file here.
6157 * options.h (--section-ordering-file): New option.
6158 * output.cc (Output_section::input_section_order_specified_): New
6159 member.
6160 (Output_section::Output_section): Initialize new member.
6161 (Output_section::add_input_section): Add new parameter.
6162 Keep input sections when --section-ordering-file is used.
6163 (Output_section::set_final_data_size): Sort input sections when
6164 section ordering file is specified.
6165 (Output_section::Input_section_sort_entry): Add new parameter.
6166 Check sorting type.
6167 (Output_section::Input_section_sort_entry::compare_section_ordering):
6168 New method.
6169 (Output_section::Input_section_sort_compare::operator()): Change to
6170 consider section_order_index.
6171 (Output_section::Input_section_sort_init_fini_compare::operator()):
6172 Change to consider section_order_index.
6173 (Output_section::Input_section_sort_section_order_index_compare
6174 ::operator()): New method.
6175 (Output_section::sort_attached_input_sections): Change to sort
6176 according to section order when specified.
e1df38aa
NC
6177 (Output_section::add_input_section<32, true>): Add new parameter.
6178 (Output_section::add_input_section<64, true>): Add new parameter.
6179 (Output_section::add_input_section<32, false>): Add new parameter.
6180 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
6181 * output.h (Output_section::add_input_section): Add new parameter.
6182 (Output_section::input_section_order_specified): New
6183 method.
6184 (Output_section::set_input_section_order_specified): New method.
6185 (Input_section::Input_section): Initialize section_order_index_.
6186 (Input_section::section_order_index): New method.
6187 (Input_section::set_section_order_index): New method.
6188 (Input_section::section_order_index_): New member.
6189 (Input_section::Input_section_sort_section_order_index_compare): New
6190 struct.
6191 (Output_section::input_section_order_specified_): New member.
6192 * script-sections.cc (is_wildcard_string): Delete and move modified
6193 method to gold.h.
6194 (Output_section_element_input::Output_section_element_input): Modify
6195 call to is_wildcard_string.
6196 (Output_section_element_input::Input_section_pattern
6197 ::Input_section_pattern): Ditto.
6198 (Output_section_element_input::Output_section_element_input): Ditto.
6199 * testsuite/Makefile.am (final_layout): New test case.
6200 * testsuite/Makefile.in: Regenerate.
6201 * testsuite/final_layout.cc: New file.
6202 * testsuite/final_layout.sh: New file.
6203
3537c84b
RÁE
62042010-06-01 Rafael Espindola <espindola@google.com>
6205
6206 * plugin.cc (Plugin::load): Pass the output name to the plugin.
6207
105b6afd
RÁE
62082010-06-01 Rafael Espindola <espindola@google.com>
6209
6210 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
6211 visibility of symbols.
6212
29e11421
DK
62132010-05-27 Doug Kwan <dougkwan@google.com>
6214
6215 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
6216 from start of output section instead of address for a local symbol
6217 in a merged or relaxed section when doing a relocatable link.
6218
5e0f337e
RÁE
62192010-05-26 Rafael Espindola <espindola@google.com>
6220
703d02da 6221 PR 11604
5e0f337e
RÁE
6222 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
6223 adding sections the garbage collector removed.
6224 * gold/testsuite/Makefile.am: Add test.
6225 * gold/testsuite/Makefile.in: Regenerate.
6226 * gold/testsuite/plugin_test_7.sh: New.
6227 * gold/testsuite/plugin_test_7_1.c: New.
6228 * gold/testsuite/plugin_test_7_2.c: New.
6229
f4187277
RÁE
62302010-05-26 Rafael Espindola <espindola@google.com>
6231
6232 * script-sections.cc (Output_section_definition::set_section_addresses):
6233 Check for --section-start.
6234
5c388529
DK
62352010-05-26 Doug Kwan <dougkwan@google.com>
6236
6237 * arm.cc (Arm_scan_relocatable_relocs): New class.
6238 (Target_arm::relocate_special_relocatable): New method.
6239 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
6240 (Arm_relocate_functions::thumb_branch_common): Same.
6241 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
6242 instead of Default_scan_relocatable_relocs.
6243 * target-reloc.h (relocate_for_relocatable): Let target handle
6244 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
6245 * target.h (Sized_target::relocate_special_relocatable): New method.
6246
bca1c3ae
ILT
62472010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6248
6249 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
6250
0439c796
DK
62512010-05-23 Doug Kwan <dougkwan@google.com>
6252
6253 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
6254 instead of a cast.
6255 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
6256 with a direct branch, not a conditional branch, to a stub.
6257 * merge.cc (Output_merge_base::record_input_section): New method
6258 defintion.
6259 (Output_merge_data::do_add_input_section): Record input section if
6260 keeps-input-sections flag is set.
6261 (Output_merge_string::do_add_input_section): Ditto.
6262 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
6263 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
6264 INPUT_SECTIONS_.
6265 (Output_merge_base::keeps_input_sections,
6266 Output_merge_base::set_keeps_input_sections,
6267 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
6268 method definitions.
6269 (Output_merge_base::Input_sections): New type declaration.
6270 (Output_merge_base::input_sections_begin,
6271 Output_merge_base::input_sections_end,
6272 Output_merge_base::do_set_keeps_input_sections): New method definitions.
6273 (Output_merge_base::bool keeps_input_sections_,
6274 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
6275 Output_merge_base::input_sections_): New data members.
6276 (Output_merge_data::do_set_keeps_input_sections): New method
6277 defintion.
6278 (Output_merge_string::do_set_keeps_input_sections): Ditto.
6279 * output.cc (Output_section::Input_section::relobj): Move method
6280 defintion from class declaration to here and handle merge sections.
6281 (Output_section::Input_section::shndx): Ditto.
6282 (Output_section::Output_section): Remove initializations of removed
6283 data members and initialize new data member LOOKUP_MAPS_.
6284 (Output_section::add_input_section): Set keeps-input-sections flag
6285 for a newly created merge output section as appropriate. Adjust code
6286 to use Output_section_lookup_maps class.
6287 (Output_section::add_relaxed_input_section): Adjst code for lookup
6288 maps code refactoring.
2e702c99 6289 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
6290 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
6291 class. If adding input section to a newly created merge output
6292 section fails, remove the new merge section.
6293 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 6294 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 6295 (Output_section::find_merge_section): Ditto.
0439c796 6296 (Output_section::build_lookup_maps): New method defintion.
2e702c99 6297 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
6298 Output_section_lookup_maps class.
6299 (Output_section::get_input_sections): Export merge sections. Adjust
6300 code to use Output_section_lookup_maps class.
6301 (Output_section:::add_script_input_section): Adjust code to use
6302 Output_section_lookup_maps class. Update lookup maps for merge
6303 sections also.
6304 (Output_section::discard_states): Use Output_section_lookup_maps.
6305 (Output_section::restore_states): Same.
6306 * output.h (Merge_section_properties): Move class defintion out of
6307 Output_section.
6308 (Output_section_lookup_maps): New class.
6309 (Output_section::Input_section::is_merge_section): New method
6310 defintion.
6311 (Output_section::Input_section::relobj): Move defintion out of class
6312 defintion. Declare method only.
6313 (Output_section::Input_section::shndx): Ditto.
6314 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 6315 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
6316 (Output_section::Merge_section_by_properties_map,
6317 Output_section::Output_section_data_by_input_section_map,
6318 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
6319 Remove types.
2e702c99 6320 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
6321 KEEPS_INPUT_SECTIONS.
6322 (Output_section::build_lookup_maps): New method declaration.
6323 (Output_section::merge_section_map_,
6324 Output_section::merge_section_by_properties_map_,
6325 Output_section::relaxed_input_section_map_,
6326 Output_section::is_relaxed_input_section_map_valid_): Remove data
6327 members.
6328 (Output_section::lookup_maps_): New data member.
6329
76295588
L
63302010-05-21 Doug Kwan <dougkwan@google.com>
6331
6332 PR gold/11619
6333 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
6334 avoid a compilation error.
6335
d103a984
RÁE
63362010-05-19 Rafael Espindola <espindola@google.com>
6337
6338 * script-sections.cc (Output_section_definition::allocate_to_segment):
6339 Update the phdrs_list even when the output section is NULL.
6340 * testsuite/Makefile.am: Add test.
6341 * testsuite/Makefile.in: Regenerate.
6342 * testsuite/script_test_9.cc: New.
6343 * testsuite/script_test_9.sh: New.
6344 * testsuite/script_test_9.t: New.
6345
6625d24e
DK
63462010-05-19 Doug Kwan <dougkwan@google.com>
6347
6348 * arm.cc (Arm_input_section::original_size): New method.
6349 (Arm_input_section::do_addralign): Add a cast.
6350 (Arm_input_section::do_output_offset): Remove static cast.
6351 (Arm_input_section::original_addralign,
6352 Arm_input_section::original_size_): Change type to uint32_t.
6353 (Arm_input_section::init): Add safe casts for section alignment
6354 and size.
6355 (Arm_input_section::set_final_data_size): Do not set address and
6356 offset of stub table.
6357 (Arm_output_section::fix_exidx_coverage): Change use of of
6358 Output_section::Simple_input_section to that of
6359 Output_section::Input_section.
6360 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
6361 except for the first pass.
6362 * output.cc (Output_section::get_input_sections): Change type of
6363 input_sections to std::list<Input_section>.
6364 (Output_section::add_script_input_section): Rename from
6365 Output_section::add_simple_input_section. Change type of SIS
6366 parameter from Simple_input_section to Input_section.
6367 * output.h (Output_section::Simple_input_section): Remove class.
6368 (Output_section::Input_section): Change class visibility to public.
6369 (Output_section::Input_section::addralign): Use stored alignments
6370 for special input sections if set.
6371 (Output_section::Input_section::set_addralign): New method.
6372 (Output_section::get_input_sections): Change parameter type from
6373 list of Simple_input_section to list of Input_section.
6374 (Output_section::add_script_input_section): Rename from
6375 Output_section::add_simple_input_section. Change first parameter's
6376 type from Simple_input_section to Input_section and remove the
6377 second and third parameters.
6378 * script-sections.cc (Input_section::Input_section_list): Change
6379 type to list of Output_section::Input_section/
6380 (Input_section_info::Input_section_info): Change parameter type of
6381 INPUT_SECTION to Output_section::Input_section.
6382 (Input_section_info::input_section): Change return type.
6383 (Input_section_info::input_section_): Change type to
6384 Output_section::Input_section.
6385 (Output_section_element_input::set_section_addresses): Adjust code
6386 to use Output_section::Input_section instead of
6387 Output_section::Simple_input_section. Adjust code for renaming
6388 of Output_section::add_simple_input_section.
6389 (Orphan_output_section::set_section_addresses): Ditto.
6390
e1e82ea4
RW
63912010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6392
6393 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
6394 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
6395
91e75c8a
RÁE
63962010-05-18 Rafael Espindola <espindola@google.com>
6397
6398 * options.cc (General_options::finalize): Handle -nostdlib.
6399 * options.h (nostdlib): New option.
6400 * script.cc (script_add_search_dir): Handle -nostdlib.
6401
da59ad79
DK
64022010-05-12 Doug Kwan <dougkwan@google.com>
6403
6404 * arm.cc (Target_arm::do_finalize_sections): Create an empty
6405 attributes section only if there no attributes section after merging.
6406 (Target_arm::merge_object_attributes): Move value of
e1df38aa 6407 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
6408 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
6409 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
6410 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
6411 and arm_attr_merge_7.stdout.
6412 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
6413 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
6414 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
6415 arm_attr_merge_7b.o): New rules.
6416 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
6417 arm_attr_merge_7
6418 * testsuite/Makefile.in: Regenerate.
6419 * testsuite/arm_attr_merge.sh: New file.
6420 * testsuite/arm_attr_merge_[67][ab].s: Same.
6421
3e01a7fd
NC
64222010-05-05 Nick Clifton <nickc@redhat.com>
6423
6424 * po/es.po: Updated Spanish translation.
6425
7ad2014a
L
64262010-04-27 H.J. Lu <hongjiu.lu@intel.com>
6427
6428 * Makefile.am (install-exec-local): Properly install gold as
6429 default cross linker.
6430 * Makefile.in: Regenerated.
6431
4fda8867
NC
64322010-04-27 H.J. Lu <hongjiu.lu@intel.com>
6433 Nick Clifton <nickc@redhat.com>
6434
6435 * configure.ac (install_as_default): Define and set to false
6436 unless --enable-gold or --enable-gold=both/gold has been
6437 specified.
6438 * configure: Regenerate.
6439
6440 * Makefile.am (install-exec-local): Install the executable as
6441 'ld.gold'. If install_as_default is true then also install it as
6442 'ld'.
6443 * Makefile.in: Regenerated.
6444
bd288ea2
ILT
64452010-04-24 Ian Lance Taylor <iant@google.com>
6446
6447 * layout.cc (Layout::layout_reloc): In relocatable link don't
6448 combine reloc sections for grouped sections.
6449
ef38fd8a
ST
64502010-04-23 Sriraman Tallam <tmsriram@google.com>
6451
6452 * gc.h (gc_process_relocs): Pass information on relocs pointing to
6453 sections that are not ordinary to icf.
6454 * icf.cc (get_section_contents): Handle relocation pointing to section
6455 with no object or shndx information.
6456 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
6457 * testsuite/Makefile.in: Regenerate.
6458 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
6459 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
6460
f6973bdc
ILT
64612010-04-22 Ian Lance Taylor <iant@google.com>
6462
6463 * expression.cc (Expression::Expression_eval_info): Add
6464 result_alignment_pointer field.
6465 (Expression::eval_with_dot): Add result_alignment_pointer
6466 parameter. Change all callers.
6467 (Expression::eval_maybe_dot): Likewise.
6468 (class Binary_expression): Add alignment_pointer parameter to
6469 left_value and right_value. Change all callers.
6470 (BINARY_EXPRESSION): Set result alignment.
6471 (class Trinary_expression): Add alignment_pointer parameter to
6472 arg2_value and arg3_value. Change all callers.
6473 (Trinary_cond::value): Set result alignment.
6474 (Max_expression::value, Min_expression::value): Likewise.
6475 (Align_expression::value): Likewise.
6476 * script-sections.cc (class Sections_element): Add dot_alignment
6477 parameter to set_section_addresses virtual function. Update
6478 instantiations.
6479 (class Output_section_element): Likewise.
6480 (Script_sections::create_segments): Add dot_alignment parameter.
6481 Change all callers.
6482 (Script_sections::create_segments_from_phdrs_clause): Likewise.
6483 (Script_sections::set_phdrs_clause_addresses): Likewise.
6484 * script-sections.h: Update declarations.
6485 * script.h: Update declarations.
6486 * output.h (Output_segment::set_minimum_p_align): Don't decrease
6487 min_p_align.
6488 * testsuite/script_test_3.t: Set large alignment.
6489 * testsuite/script_test_3.sh: Make sure that at least one LOAD
6490 segment has expected alignment.
6491
9c9c98a5
NC
64922010-04-22 Nick Clifton <nickc@redhat.com>
6493
6494 * po/gold.pot: Updated by the Translation project.
6495 * po/vi.po: Updated Vietnamese translation.
6496
2253bfba
L
64972010-04-22 H.J. Lu <hongjiu.lu@intel.com>
6498
6499 * testsuite/Makefile.am (check_PROGRAMS): Add
6500 icf_virtual_function_folding_test.
6501 * testsuite/Makefile.in: Regenerated.
6502
85fdf906
AH
65032010-04-15 Andrew Haley <aph@redhat.com>
6504
6505 * options.h (merge_exidx_entries): New option.
6506 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
6507 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
6508 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
6509 (Target_arm::merge_exidx_entries): New function.
6510 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
6511 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
6512 to Arm_exidx_fixup constructor.
6513 Add new arg, merge_exidx_entries.
6514 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
6515 Arm_output_section::fix_exidx_coverage.
6516
ce97fa81
ST
65172010-04-18 Sriraman Tallam <tmsriram@google.com>
6518
6519 * icf.cc (get_section_contents): Check for preemptible functions.
6520 Ignore addend when appropriate.
6521 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
6522 section folded.
6523 (add_from_relobj): Check for section folded.
6524 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
6525 * symtab.h (should_add_dynsym_entry): Add new parameter.
6526 * target-reloc.h (scan_relocs): Check for section folded.
6527 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
6528 Check reloc types for function pointers in shared objects.
6529 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
6530 case.
6531 (icf_preemptible_functions_test): New test case.
6532 (icf_string_merge_test): New test case.
6533 * testsuite.Makefile.in: Regenerate.
6534 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
6535 bar_glob. Refactor code.
6536 * testsuite/icf_preemptible_functions_test.cc: New file.
6537 * testsuite/icf_preemptible_functions_test.sh: New file.
6538 * testsuite/icf_string_merge_test.cc: New file.
6539 * testsuite/icf_string_merge_test.sh: New file.
6540 * testsuite/icf_virtual_function_folding_test.cc: New file.
6541 * testsuite/icf_virtual_function_folding_test.sh: New file.
6542
04ceb17c
DK
65432010-04-14 Doug Kwan <dougkwan@google.com>
6544
6545 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
6546 for local symbol recounting if we remove a section due to ICF.
6547 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
6548 there are no regular objects in input.
6549
153e7da4
DK
65502010-04-13 Doug Kwan <dougkwan@google.com>
6551
6552 * arm.cc (Arm_input_section::set_final_data_size): Compute
6553 accurate final data size instead of using current data size.
6554
4dbd9faf
DK
65552010-04-09 Doug Kwan <dougkwan@google.com>
6556
6557 * layout.cc (Layout::choose_output_section): Handle script section
6558 types.
6559 (Layout::make_output_section_for_script): Add section type parameter.
6560 Handle script section types.
6561 * layout.h (Layout::make_output_section_for_script): Add section
6562 type parameter.
6563 * output.cc (Output_section::Output_section): Initialize data member
6564 is_noload_.
6565 (Output_section::do_reset_address_and_file_offset): Do not set address
6566 to 0 if section is a NOLOAD section.
6567 * output.h (Output_section::is_noload): New method.
6568 (Output_section::set_is_noload): Ditto.
6569 (Output_section::is_noload_): New data member.
6570 * script-c.h (Script_section_type): New enum type.
6571 (struct Parser_output_section_header): Add new file section_type.
6572 * script-sections.cc (Sections_element::output_section_name): Add
6573 parameter for returning script section type.
6574 (Output_section_definition::output_section_name): Ditto.
6575 (Output_section_definition::section_type)P; New method.
6576 (Output_section_definiton::script_section_type_name): Ditto.
6577 (Output_section_definition::script_section_type_): New data member.
6578 (Output_section_definition::Output_section_definition): Initialize
6579 data member Output_section_definition::script_section_type_.
6580 (Output_section_definition::create_sections): Pass script section type
6581 to Layout::make_output_section_for_script.
6582 (Output_section_definition::output_section_name): Return script
6583 section type to caller.
6584 (Output_section_definition::set_section_address): Do not advance
6585 dot value and load address if section type is NOLOAD. Set address
6586 of NOLOAD sections regardless of section flags.
6587 (Output_section_definition::print): Print section type if it is
6588 not SCRIPT_SECTION_TYPE_NONE.
6589 (Output_section_definition::section_type): New method.
6590 (Output_section_definition::script_section_type_name): Ditto.
6591 (Script_sections::output_section_name): Add new parameter
6592 PSECTION_TYPE for returning script section type. Pass it to
6593 section elements. Handle discard sections.
6594 (Sort_output_sections::operator()): Handle NOLOAD sections.
6595 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 6596 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
6597 returning script section type.
6598 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
6599 INFO and NOLOAD.
6600 * yyscript.y (union): Add new field SECTION_TYPE.
6601 (COPY, DSECT, INFO, NOLOAD): New tokens.
6602 (opt_address_and_section_type): Change type to output_section_header.
6603 (section_type): New non-terminal
6604 (section_header): Handle section type.
2253bfba 6605 (opt_address_and_section_type): Return section type value.
4dbd9faf 6606
721ea635
L
66072010-04-09 H.J. Lu <hongjiu.lu@intel.com>
6608
6609 * testsuite/plugin_common_test_1.c (foo): Add prototype.
6610 * testsuite/plugin_common_test_2.c (foo): Likewise.
6611
6bf924b0
DK
66122010-04-08 Doug Kwan <dougkwan@google.com>
6613
6614 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
6615 Output_merge_data.
6616 * output.cc (Output_section::add_merge_input_section): Simplify
6617 code and return status of Output_merge_base::add_input_section.
e1df38aa 6618 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
6619 returns true.
6620
24af6f92
DK
66212010-04-07 Doug Kwan <dougkwan@google.com>
6622
6623 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
6624 if section is marked as containing instructions but has no mapping
6625 symbols.
6626 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
6627 correct section index.
6628 (Arm_relobj::find_linked_text_section): Ditto.
6629
00698fc5
CC
66302010-04-07 Cary Coutant <ccoutant@google.com>
6631
6632 * archive.cc (include_member): Destroy Read_symbols_data object before
6633 releasing file.
6634 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
6635 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
6636 (Read_symbols_data::~Read_symbols_data) New destructor.
6637 (Section_relocs::Section_relocs) New constructor.
6638 (Section_relocs::~Section_relocs) New destructor.
6639 (Read_relocs_data::Read_relocs_data) New constructor.
6640 (Read_relocs_data::~Read_relocs_data) New destructor.
6641 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
6642 pointers to NULL after deleting.
6643
7296d933
DK
66442010-04-07 Doug Kwan <dougkwan@google.com>
6645
6646 * arm.cc: Replace "endianity" with "endianness" in comments.
6647 (Arm_exidx_cantunwind): Ditto.
6648 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
6649 (Arm_relobj::merge_flags_and_attributes): New method.
6650 (Arm_relobj::merge_flags_and_attributes_): New data member.
6651 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
6652 (Arm_relobj::scan_sections_for_stubs): Ditto.
6653 (Arm_relobj::do_read_symbols): Check to see if we really want to
6654 merge processor-specific flags and attributes. Exit early if
6655 an object is empty except for section names and the undefined symbol.
6656 (Target_arm::do_finalize_sections): Move check for ELF format to
6657 Arm_relobj::do_read_symbols. Merge processor specific flags and
6658 attributes from a regular object only when we have determined that
6659 it is aapropriate. Do not create an .ARM.attributes section in
6660 output if there is no regular input object.
6661 (Target_arm::merge_processor_specific_flags): Check
6662 --warn-mismatch before printing any error.
6663 (Target_arm::merge_object_attributes): Ditto.
6664 * gold.cc (queue_middle_tasks): Handle the case in which there is
6665 no regular object in input.
6666 * options.cc (General_options::parse_EB): New method.
6667 (General_options::parse_EL): Same.
6668 (General_options::General_options): Initialize endianness_.
6669 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
6670 New options.
6671 (General_options::Endianness): New enum.
6672 (General_options::endianness): New method.
6673 (General_options::endianness_): New data member.
6674 * parameters.cc (Parameters::set_options): Check target endianness.
6675 (Parameters::set_target_once): Ditto.
6676 (Parameters::check_target_endianness): New method.
6677 (parameters_force_valid_target): If either -EL or -EB is specified,
6678 use it to define endianness of default target.
6679 * parameters.h (Parameters::check_target_endianness): New method
6680 declaration.
6681 * target.h (class Target): Change "endianity" to "endianness"
6682 in comments.
6683
efc8d4f2
RW
66842010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6685
6686 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
6687 * configure: Regenerate.
6688 * Makefile.in: Regenerate.
6689 * testsuite/Makefile.in: Regenerate.
6690
be234d88
CC
66912010-04-06 Cary Coutant <ccoutant@google.com>
6692
6693 gcc PR lto/42757
6694 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
6695 prevailing definitions of common symbols.
6696 * testsuite/plugin_test_6.sh: New test case.
6697 * testsuite/plugin_common_test_1.c: New test case.
6698 * testsuite/plugin_common_test_2.c: New test case.
6699 * testsuite/Makefile.am (plugin_test_6): New test case.
6700 * testsuite/Makefile.in: Regenerate.
6701
bd32c6bd
NC
67022010-04-06 Nick Clifton <nickc@redhat.com>
6703
6704 * po/vi.po: New Vietnamese translation.
6705
323c532f
DK
67062010-03-30 Doug Kwan <dougkwan@google.com>
6707
6708 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
6709
4fcd97eb
DK
67102010-03-25 Doug Kwan <dougkwan@google.com>
6711
6712 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
6713 to avoid a conversion warning on a 32-bit host.
6714
4ebf39db
ILT
67152010-03-24 Ian Lance Taylor <iant@google.com>
6716
6717 * testsuite/script_test_3.t: Add a TLS segment.
6718 * testsuite/Makefile.am (check_PROGRAMS): Add
6719 tls_phdrs_script_test.
6720 (tls_phdrs_script_test_SOURCES): Define.
6721 (tls_phdrs_script_test_DEPENDENCIES): Define.
6722 (tls_phdrs_script_test_LDFLAGS): Define.
6723 (tls_phdrs_script_test_LDADD): Define.
6724 * testsuite/Makefile.in: Rebuild.
6725
4a599bdd
CC
67262010-03-23 Cary Coutant <ccoutant@google.com>
6727
6728 * fileread.cc (find_or_make_view): Fix comment.
6729
6c93b22c
ILT
67302010-03-23 Ian Lance Taylor <iant@google.com>
6731
6732 * script-sections.cc (class Orphan_section_placement): Define
6733 PLACE_TLS and PLACE_TLS_BSS.
6734 (Orphan_section_placement::Orphan_section_placement): Initialize
6735 new places.
6736 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
6737 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
6738 (tls_script_test_SOURCES): Define.
6739 (tls_script_test_DEPENDENCIES): Define.
6740 (tls_script_test_LDFLAGS): Define.
6741 (tls_script_test_LDADD): Define.
6742 * testsuite/Makefile.in: Rebuild.
6743
a2c7281b
DK
67442010-03-22 Doug Kwan <dougkwan@google.com>
6745
6746 * arm.cc (Arm_relocate_functions::abs8,
6747 Arm_relocate_functions::abs16): Use correct check for overflow
6748 specified in the ARM ELF specs.
6749 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
6750 target of a BLX instruction specially.
6751 (Reloc_stub::stub_type_for_reloc): Ditto.
6752 (Relocate::relocate): Use symbolic names instead of numeric relocation
6753 codes to report error.
6754 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
6755 workaround.
6756 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
6757 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
6758 thumb2_blx_out_of_range.stdout
6759 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
6760 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
6761 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
6762 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
6763 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
6764 thumb2_blx_in_range, thumb2_blx_in_range.o,
6765 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
6766 thumb2_blx_out_of_range.o): New rules.
2e702c99 6767 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
6768 thumb2_blx_in_range and thumb2_blx_out_of_range.
6769 * testsuite/Makefile.in: Regenerate.
6770 * arm_branch_in_range.sh: Add tests for THUMB BLX.
6771 * testsuite/thumb_blx_in_range.s: New file.
6772 * testsuite/thumb_blx_out_of_range.s: New file.
6773
b0193076
RÁE
67742010-03-22 Rafael Espindola <espindola@google.com>
6775
6776 * archive.cc (Should_include): Move to archive.h.
6777 (should_include_member): Make it a member of Archive.
6778 (Lib_group): New.
6779 (Add_lib_group_symbols): New.
6780 * archive.h: Include options.h.
6781 (Archive_member): Moved from Archive.
6782 (Should_include): Moved from archive.cc.
6783 (Lib_group): New.
6784 (Add_lib_group_symbols): New.
6785 * dynobj.cc (do_should_include_member): New.
6786 * dynobj.h (do_should_include_member): New.
6787 * gold.cc (queue_initial_tasks): Update call to queue.
6788 * main.cc (main): Print lib group stats.
6789 * object.cc (do_should_include_member): New.
6790 * object.h: Include archive.h.
6791 (Object::should_include_member): New.
6792 (Object::do_should_include_member): New.
6793 (Sized_relobj::do_should_include_member): New.
6794 * options.cc (General_options::parse_start_lib): New.
6795 (General_options::parse_end_lib): New.
6796 (Input_arguments::add_file): Handle lib groups.
6797 (Input_arguments::start_group): Check we are not in a lib.
6798 (Input_arguments::start_lib): New.
6799 (Input_arguments::end_lib): New.
6800 * options.h (General_options): Add start_lib and end_lib.
6801 (Input_argument::lib_): New.
6802 (Input_argument::lib): New.
6803 (Input_argument::is_lib): New.
6804 (Input_file_lib): New.
6805 (Input_arguments::in_lib_): New.
6806 (Input_arguments::in_lib): New.
6807 (Input_arguments::start_lib): New.
6808 (Input_arguments::end_lib_): New.
6809 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
6810 in unused members as preempted.
6811 (Sized_pluginobj::do_should_include_member): New.
6812 * plugin.h (Sized_pluginobj::do_should_include_member): New.
6813 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
6814 return the blocker.
6815 (Read_symbols::do_whole_lib_group): New.
6816 (Read_symbols::do_lib_group): New.
6817 (Read_symbols::do_read_symbols): Handle lib groups.
6818 (Read_symbols::get_name): Handle lib groups.
6819 * readsyms.h (Read_symbols): Add an archive member pointer.
6820 (Read_symbols::do_whole_lib_group): New.
6821 (Read_symbols::do_lib_group): New.
6822 (Read_symbols::member_): New.
6823 * script.cc (read_input_script): Update call to queue_soon.
6824
d099120c
DK
68252010-03-19 Doug Kwan <dougkwan@google.com>
6826
6827 * arm.cc (Stub_table::Stub_table): Initialize new data members
6828 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
6829 (Stub_table::add_reloc_stub): Assign stub offset and update
6830 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
6831 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
6832 New data members.
2e702c99 6833 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
6834 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
6835 instead of going over all reloc stubs.
2e702c99 6836 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
6837 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
6838 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 6839 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
6840 Stringpool_template::offset_.
6841 * stringpool.h (Stringpool_template::set_no_zero_null): Set
6842 Stringpool_template::offset_ to zero.
6843
1aa37384
DK
68442010-03-15 Doug Kwan <dougkwan@google.com>
6845
6846 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
6847 offset_.
6848 (Stringpool_template::new_key_offset): New method.
6849 (Stringpool_template::add_string): Assign offsets when adding new
6850 strings.
6851 (Stringpool_template::set_string_offsets): Do not set string offsets
6852 when not optimizing.
6853 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
6854 member size_.
2e702c99
RM
6855 (Chunked_vector::clear): Clear size_.
6856 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
6857 (Chunked_vector::size): Return size_.
6858 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 6859 (Chunked_vector::size_): New data member.
1aa37384
DK
6860 (Stringpool_template::set_no_zero_null): Assert string set is empty.
6861 (Stringpool_template::new_key_offset): New method declaration.
6862 (Stringpool_template::offset_): New data member.
6863
b672b057
RÁE
68642010-03-15 Rafael Espindola <espindola@google.com>
6865
6866 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
6867 Add_symbols' constructor.
6868 * readsyms.h (Add_symbols): Remove the input_group member.
6869
b6848d3c
ILT
68702010-03-10 Ian Lance Taylor <iant@google.com>
6871
6872 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
6873 target to ask whether a reference to a symbol requires a stack
6874 split.
6875 * target.h (Target::is_call_to_non_split): New function.
6876 (Target::do_is_call_to_non_split): Declare virtual function.
6877 * target.cc: Include "symtab.h".
6878 (Target::do_is_call_to_non_split): New function.
6879 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
6880
a2a5469e
CC
68812010-03-10 Cary Coutant <ccoutant@google.com>
6882
6883 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
6884 (File_read::open[1]): Remove initial mapping of whole_file_view_.
6885 (File_read::open[2]): Add whole_file_view_ to list of views.
6886 (File_read::make_view): Remove test of whole_file_view_.
6887 (File_read::find_or_make_view): Create whole_file_view_ if
6888 necessary.
6889 (File_read::clear_views): Replace bool parameter with enum;
6890 adjust all callers. Don't delete views with permanent data;
6891 do delete cached views and views from archives if
6892 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
6893 if clearing the corresponding view.
6894 * fileread.h (File_read::Clear_views_mode): New enum.
6895 (File_read::View::is_permanent_view): New method.
6896 (File_read::clear_views): Replace bool parameter
6897 with enum; adjust all callers.
6898 * options.h (General_options): Change keep_files_mapped option;
6899 add map_whole_files.
6900 * readsyms.cc (Add_symbols::run): Delete sd_ object before
6901 releasing the file.
6902 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
6903 the file.
6904
8861f32b
DM
69052010-03-10 David S. Miller <davem@davemloft.net>
6906
6907 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
6908
d62d0f5f
ST
69092010-03-09 Sriraman Tallam <tmsriram@google.com>
6910
6911 * icf.cc (get_section_contents): Add '@' marker after processing the
6912 merge reloc.
6913
9177756d
DK
69142010-03-08 Doug Kwan <dougkwan@google.com>
6915
6916 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
6917 due to a conversion warning.
6918 (Arm_relobj::update_output_local_symbol_count): Check for local
6919 symbol with unset output index.
6920
9e9e071b
ILT
69212010-03-05 Ian Lance Taylor <iant@google.com>
6922
6923 * options.h (class General_options): Add --spare-dynamic-tags.
6924 * output.cc (Output_data_dynamic::set_final_data_size): Implement
6925 --spare-dynamic-tags.
6926
a81ee015
ILT
69272010-03-05 Ian Lance Taylor <iant@google.com>
6928
6929 * incremental.cc: Include "libiberty.h".
6930
44ec90b9
RO
69312010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
6932
6933 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
6934 function, is_info_ member.
6935 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
6936 (Versions::Versions): Update caller.
6937 (Versions::define_base_version): Likewise.
6938 (Versions::add_def): Likewise.
6939
0897ed3b
ST
69402010-03-03 Sriraman Tallam <tmsriram@google.com>
6941
6942 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
6943 (Scan::possible_function_pointer_reloc): New function.
6944 (Scan::local_reloc_may_be_function_pointer): Change to call
6945 possible_function_pointer_reloc.
6946 (Scan::global_reloc_may_be_function_pointer): Ditto.
6947 * icf.h (Icf::check_section_for_function_pointers): Change to reject
6948 relocations in ".data.rel.ro._ZTV" section.
6949 * testsuite/icf_safe_so_test.sh: Change to pass i386.
6950 * testsuite/icf_safe_so_test.cc: Ditto.
6951 * testsuite/icf_safe_test.cc: Ditto.
6952 * testsuite/icf_safe_test.sh: Ditto.
6953
d3bbad62
ILT
69542010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6955 Ian Lance Taylor <iant@google.com>
6956
6957 * target-reloc.h (relocate_section): Check the symbol table index
6958 for -1U before setting the local symbol index.
6959 (scan_relocatable_relocs): If copying the relocation, record that
6960 the local symbol is required.
6961 * object.h (Symbol_value::is_output_symtab_index_set): New
6962 function.
6963 (Symbol_value::may_be_discarded_from_output_symtab): New
6964 function.
6965 (Symbol_value::has_output_symtab_entry): New function.
6966 (Symbol_value::needs_output_symtab_entry): Remove.
6967 (Symbol_value::output_symtab_index): Make sure the symbol index is
6968 set.
6969 (Symbol_value::set_output_symtab_index): Make sure the symbol
6970 index is not set. Make sure the new index is valid.
6971 (Symbol_value::set_must_have_output_symtab_entry): New function.
6972 (Symbol_value::has_output_dynsym_entry): New function.
6973 (Symbol_value::set_output_dynsym_index): Make sure the new index
6974 is valid.
6975 (Sized_relobj::set_must_have_output_symtab_entry): New function.
6976 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
6977 local symbol if permitted.
6978 (Sized_relobj::do_finalize_local_symbols): Call
6979 is_output_symtab_index_set rather than needs_output_symtab_entry.
6980 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
6981 rather than needs_output_symtab_entry. Call
6982 has_output_dynsym_entry rather than needs_output_dynsym_entry.
6983 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
6984 is_output_symtab_index_set rather than needs_output_symtab_entry.
6985 * testsuite/discard_locals_relocatable_test.c: New file.
6986 * testsuite/discard_locals_test.sh: Test -r.
6987 * testsuite/Makefile.am (check_DATA): Add
6988 discard_locals_relocatable_test1.syms,
6989 discard_local_relocatable_test2.syms.
6990 (MOSTLYCLEANFILES): Likewise. Also add
6991 discard_locals_relocatable_test1.lout and
6992 discard_locals_relocatable_test2.out.
6993 (discard_locals_relocatable_test1.syms): New target.
6994 (discard_locals_relocatable_test.o): New target.
6995 (discard_locals_relocatable_test1.out): New target.
6996 (discard_locals_relocatable_test2.syms): New target.
6997 (discard_locals_relocatable_test2.out): New target.
6998 (various): Add missing ../ld-new dependencies.
6999 * testsuite/Makefile.in: Rebuild.
7000
7e8ccf26
NC
70012010-03-03 Nick Clifton <nickc@redhat.com>
7002
7003 * po/fi.po: New Finnish translation.
7004
2a0ff005
DK
70052010-03-01 Doug Kwan <dougkwan@google.com>
7006
7007 * layout.cc (Layout::Layout): Force section types of .init_array*,
7008 .preinit_array* and .fini_array* sections.
7009 * output.cc (Output_section::Input_section_sort_entry::has_priority):
7010 Fix check of return value of std::string::find.().
7011 (Output_section::Input_section_sort_compare::operator()): Remove
7012 comment about .init_array.
7013 (Output_section::Input_section_sort_init_fini_compare::operator()):
7014 New method.
7015 (Output_section::sort_attached_input_sections): Handle .init_array
7016 and .fini_array specially.
7017 * output.h (Output_section::Inut_section_sort_compare): Update
7018 comment.
7019 (Output_section::Input_section_sort_init_fini_compare): New struct.
7020
c3e4ae29
DK
70212010-02-26 Doug Kwan <dougkwan@google.com>
7022
7023 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
7024 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
7025 * testsuite/debug_msg.sh: Avoid matching source line number for
7026 use of global variable undef_int.
7027
2fd9ae7a
DK
70282010-02-26 Doug Kwan <dougkwan@google.com>
7029
7030 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
7031 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
7032 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
7033 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
7034 * options.cc (General_options::General_options): Initialize member
7035 fix_v4bx_.
7036 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
7037 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
7038 and rm_no_fix_v4bx.stdout
7039 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
7040 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
7041 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
7042 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
7043 and arm_no_fix_v4bx.
7044 * Makefile.in: Regenerate.
7045 * testsuite/arm_fix_v4bx.s: New file.
7046 * testsuite/arm_fix_v4bx.sh: Ditto.
7047
67ec7d0b
DK
70482010-02-24 Doug Kwan <dougkwan@google.com>
7049
7050 * arm.cc (Target_arm::got_section): Make the .got section the first
7051 non RELRO section in the data segment.
7052 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
7053 suffixes of section names.
7054
10165461
DK
70552010-02-24 Doug Kwan <dougkwan@google.com>
7056
7057 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
7058 flags and attributes merging if an input file is a binary file.
7059 * fileread.cc (Input_file::open): Record format of original file.
7060 * fileread.h (Input_file::Format): New enum type.
2e702c99 7061 (Input_file::Input_file): Initialize data member format_.
10165461
DK
7062 (Input_file::format): New method definition.
7063 (Input_file::format_):: New data member.
7064
4a54abbb
DK
70652010-02-24 Doug Kwan <dougkwan@google.com>
7066
7067 * arm.cc (Arm_output_data_got): New class.
7068 (ARM_TCB_SIZE): New constant
7069 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
7070 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
7071 If user uses a script with a SECTIONS clause, issue only a warning
7072 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 7073 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
7074 garbage collection.
7075 (Target_arm::got_mode_index_entry): Handle static linking.
7076 (Target_arm::Scan::local): Ditto.
7077 (Target_arm::Scan::global): Ditto.
7078 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
7079 all incorrectly implemented relocations.
e1df38aa 7080 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
7081 Arm_output_section::fix_exidx_coverage.
7082 * layout.cc (Layout::section_name_mapping): Remove trailing dots
7083 from ".ARM.exidx." and ".ARM.extab.".
7084
ca419a6f
ILT
70852010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7086
7087 * arm.cc (Target_arm::do_finalize_sections): Create attribute
7088 section if it does not already exist.
7089 * attributes.cc (Attributes_section_data::Attributes_section_data):
7090 Don't crash if size is zero.
7091
135b9c78
ILT
70922010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7093 Ian Lance Taylor <iant@google.com>
7094
7095 * gold.cc (queue_middle_tasks): If no input files were opened,
7096 exit.
7097 * workqueue.h (Task_function::Task_function): Assert that there is
7098 a blocker.
7099
bb0bfe4f
DK
71002010-02-22 Doug Kwan <dougkwan@google.com>
7101
7102 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
7103 * icf.cc (get_section_contents): Cast snprintf arguments to long long
7104 types to avoid warnings due to different uint64_t implementations
7105 on different hosts.
7106
2a2b6d42
DK
71072010-02-21 Doug Kwan <dougkwan@google.com>
7108
7109 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
7110 handling of the maximum backward branch offset.
2e702c99 7111 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
7112 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
7113 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 7114 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
7115 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
7116 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
7117 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
7118 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
7119 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
7120 thumb_bl_out_of_range thumb_bl_out_of_range.o,
7121 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
7122 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
7123 thumb2_bl_out_of_range.o): New rules.
7124 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
7125 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
7126 thumb2_bl_out_of_range
7127 * testsuite/Makefile.in: Regenerate.
7128 * testsuite/arm_bl_in_range.s: New file.
7129 * testsuite/arm_bl_out_of_range.s: Ditto.
7130 * testsuite/arm_branch_in_range.sh: Ditto.
7131 * testsuite/arm_branch_range.t: Ditto.
7132 * testsuite/thumb2_branch_range.t: Ditto.
7133 * testsuite/thumb_bl_in_range.s: Ditto.
7134 * testsuite/thumb_bl_out_of_range.s: Ditto.
7135 * testsuite/thumb_branch_range.t: Ditto.
7136
b487ad64
ST
71372010-02-20 Sriraman Tallam <tmsriram@google.com>
7138
7139 * gc.h (gc_process_relocs): Change vectors to point to the new list.
7140 Add reloc offset information.
7141 * icf.cc (get_section_contents): Change iterators to point to the new
7142 vectors. Add reloc offset information to the contents.
7143 * icf.h (Icf::Sections_reachable_info): New typedef.
7144 (Icf::Sections_reachable_list): New typedef.
7145 (Icf::Offset_info): New typedef.
7146 (Icf::Reloc_info): New struct typedef.
7147 (Icf::Reloc_info_list): New typedef.
7148 (Icf::symbol_reloc_list): Delete method.
7149 (Icf::addend_reloc_list): Delete method.
7150 (Icf::section_reloc_list): Delete method.
7151 (Icf::reloc_info_list): New method.
7152 (Icf::reloc_info_list_): New member.
7153
f96accdf
DK
71542010-02-19 Doug Kwan <dougkwan@google.com>
7155
7156 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
7157 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
7158 * arm.cc (Arm_relocation_functions): New forward declaration.
7159 (Target_arm::Target_arm): Initialize new data members
7160 got_mod_index_offset_ and tls_base_symbol_defined_.
7161 (Target_arm::Relocate::relocate_tls): New method.
7162 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
7163 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
7164 New methods.
2e702c99 7165 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
7166 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
7167 (Target_arm::got_mod_index_offset_,
7168 Target_arm::tls_base_symbol_defined_): New data members.
7169 (Target_arm::Scan::local, Target::Scan::global,
7170 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
7171 relocations.
7172
c8761b9a
DK
71732010-02-18 Doug Kwan <dougkwan@google.com>
7174
7175 * arm.cc (Arm_relobj::find_linked_text_section): New method.
7176 (Arm_relobj::make_exidx_input_section): Pass section index of linked
7177 text section as a parameter becuase some broken tools may not set
7178 the link in section header.
7179 (Target_arm::has_got_section): New method.
7180 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
7181 without any mapping symbol as data only. Remove warning.
7182 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
7183 link in its section header, try to discover the link by inspecting the
7184 REL31 relocation at the beginning of the section.
7185 (Target_arm::Scan::check_non_pic): Report name of offending relocation
7186 in error message.
7187 (Target_arm::Scan::global): Treat any reference to the symbol
7188 _GLOBAL_OFFSET_TABLE_ as a GOT access.
7189
21bb3914
ST
71902010-02-12 Sriraman Tallam <tmsriram@google.com>
7191
7192 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
7193 (Scan::global_reloc_may_be_function_pointer): New function.
7194 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
7195 (Scan::global_reloc_may_be_function_pointer): New function.
7196 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
7197 (Scan::global_reloc_may_be_function_pointer): New function.
7198 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
7199 (Scan::global_reloc_may_be_function_pointer): New function.
7200 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
7201 (Scan::global_reloc_may_be_function_pointer): New function.
7202 (Scan::possible_function_pointer_reloc): New function.
7203 (Target_x86_64::can_check_for_function_pointers): New function.
7204 * gc.h (gc_process_relocs): Scan relocation types to determine if
7205 function pointers were taken for targets that support it.
7206 * icf.cc (Icf::find_identical_sections): Include functions for
7207 folding in safe ICF whose pointer is not taken.
7208 * icf.h (Secn_fptr_taken_set): New typedef.
7209 (fptr_section_id_): New member.
7210 (section_has_function_pointers): New function.
7211 (set_section_has_function_pointers): New function.
7212 (check_section_for_function_pointers): New function.
7213 * options.h: Fix comment for safe ICF option.
7214 * target.h (can_check_for_function_pointers): New function.
7215 * testsuite/Makefile.am: Add icf_safe_so_test test case.
7216 Modify icf_safe_test for X86-64.
7217 * testsuite/Makefile.in: Regenerate.
7218 * testsuite/icf_safe_so_test.cc: New file.
7219 * testsuite/icf_safe_so_test.sh: New file.
7220 * testsuite/icf_safe_test.cc (kept_func_3): New function.
7221 (main): Change to take pointer to function kept_func_3.
7222 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
7223 folding is done correctly for X86-64.
7224
0da6fa6c
DM
72252010-02-12 David S. Miller <davem@davemloft.net>
7226
7227 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
7228 is_symbolless parameter.
7229 (Output_reloc<SHT_REL>::is_symbolless): New.
7230 (Output_reloc<SHT_REL>::is_symbolless_): New.
7231 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
7232 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
7233 (Output_reloc<SHT_RELA>::is_symbolless): New.
7234 (Output_data_reloc::add_global): Handle is_symbolless.
7235 (Output_data_reloc::add_global_relative): Likewise.
7236 (Output_data_reloc::add_local): Likewise.
7237 (Output_data_reloc::add_local_relative): Likewise.
7238 (Output_data_reloc::add_symbolless_global_addend): New.
7239 (Output_data_reloc::add_symbolless_local_addend): New.
7240 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
7241 is_symbolless.
7242 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
7243 instead of ->is_relative_
7244 (Output_reloc::write): Likewise.
7245 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
7246 (Output_reloc::write_rel): Simplify.
7247
7248 * sparc.cc (Target_sparc::Scan::local): Use
7249 ->add_symbolless_local_addend as needed.
7250 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
7251 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
7252 based upon relocation offset.
7253
e4782e83
DK
72542010-02-11 Doug Kwan <dougkwan@google.com>
7255
7256 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
7257 (Target_arm::Scan::global): Ditto. Also remove a comment before the
7258 beginning of function.
7259 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
7260 and MOVT_ABS relocations. Those are non issued in scanning. Fix
7261 parameter is_32bit in calls to should_apply_static_reloc.
7262 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
7263 (check_DATA): Add arm_abs_global.stdout.
7264 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
7265 arm_abs_global.stdout): New rules.
7266 (MOSTLLYCLEANFILES): Add arm_abs_global
7267 * Makefile.in: Regenerate.
7268 * testsuite/arm_abs_global.s: New file.
7269 * testsuite/arm_abs_global.sh: Ditto.
7270 * testsuite/arm_abs_lib.s: Ditto.
7271
93ceb764
ILT
72722010-02-11 Ian Lance Taylor <iant@google.com>
7273
7274 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
7275 Read_relocs task.
7276 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
7277 Allocate_commons_task first.
7278 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
7279 task, rather than symtab_lock_.
7280 (Gc_process_relocs::~Gc_process_relocs): New function.
7281 (Gc_process_relocs::is_runnable): Check this_blocker_.
7282 (Gc_process_relocs::locks): Use next_blocker_ rather than
7283 blocker_.
7284 (Scan_relocs::~Scan_relocs): New function.
7285 (Scan_relocs::is_runnable): Check this_blocker_ rather than
7286 symtab_lock_.
7287 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
7288 next_blocker_.
7289 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
7290 fields. Add this_blocker_ and next_blocker_ fields. Adjust
7291 constructor accordingly.
7292 (class Gc_process_relocs): Likewise.
7293 (class Scan_relocs): Likewise.
7294 * common.h (class Allocate_commons_task): Remove symtab_lock_
7295 field, and corresponding constructor parameter.
7296 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
7297 symtab_lock_.
7298 (Allocate_commons_task::locks): Likewise.
7299
114dfbe1
ILT
73002010-02-11 Ian Lance Taylor <iant@google.com>
7301
7302 * gold-threads.h (class Once): Define.
7303 (class Initialize_lock): Rewrite as child of Once.
7304 * gold-threads.cc (class Once_initialize): Define.
7305 (once_pointer_control): New static variable.
7306 (once_pointer, once_arg): New static variables.
7307 (c_run_once): New static function.
7308 (Once::Once, Once::run_once, Once::internal_run): New functions.
7309 (class Initialize_lock_once): Remove.
7310 (initialize_lock_control): Remove.
7311 (initialize_lock_pointer): Remove.
7312 (initialize_lock_once): Remove.
7313 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
7314 (Initialize_lock::initialize): Rewrite.
7315 (Initialize_lock::do_run_once): New function.
7316 * archive.cc (Archive::interpret_header): Only clear name if it is
7317 not already empty.
7318 * fileread.cc: Include "gold-threads.h"
7319 (file_counts_lock): New static variable.
7320 (file_counts_initialize_lock): Likewise.
7321 (File_read::release): Only increment counts when using --stats.
7322 Use a lock around the increment.
7323 * parameters.cc (class Set_parameters_target_once): Define.
7324 (set_parameters_target_once): New static variable.
7325 (Parameters::Parameters): Move here from parameters.h.
7326 (Parameters::set_target): Rewrite.
7327 (Parameters::set_target_once): New function.
7328 (Parameters::clear_target): Move here and rewrite.
7329 * parameters.h (class Parameters): Update declarations. Add
7330 set_parameters_target_once_ field.
7331 (Parameters::Parameters): Move to parameters.cc.
7332 (Parameters::clear_target): Likewise.
7333 * readsyms.cc (Read_symbols::do_group): Create a Start_group
7334 task.
7335 (Start_group::~Start_group): New function.
7336 (Start_group::is_runnable): New function.
7337 (Start_group::locks, Start_group::run): New functions.
7338 (Finish_group::run): Change saw_undefined to size_t.
7339 * readsyms.h (class Start_group): Define.
7340 (class Finish_group): Change saw_undefined_ field to size_t.
7341 (Finish_group::Finish_group): Remove saw_undefined and
7342 this_blocker parameters. Change all callers.
7343 (Finish_group::set_saw_undefined): New function.
7344 (Finish_group::set_blocker): New function.
7345 * symtab.h (class Symbol_table): Change saw_undefined to return
7346 size_t. Change saw_undefined_ field to size_t.
7347 * target-select.cc (Set_target_once::do_run_once): New function.
7348 (Target_selector::Target_selector): Initialize set_target_once_
7349 field. Don't initialize lock_ and initialize_lock_ fields.
7350 (Target_selector::instantiate_target): Rewrite.
7351 (Target_selector::set_target): New function.
7352 * target-select.h (class Set_target_once): Define.
7353 (class Target_selector): Update declarations. Make
7354 Set_target_once a friend. Remove lock_ and initialize_lock_
7355 fields. Add set_target_once_ field.
7356
fa17a3f4
ILT
73572010-02-10 Ian Lance Taylor <iant@google.com>
7358
7359 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
7360 queueing any tasks.
7361 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
7362 (queue_middle_tasks): Add all blockers before queueing any tasks.
7363 (queue_final_tasks): Likewise.
7364 * token.h (Task_token::add_blockers): New function.
7365 * object.h (Input_objects::number_of_relobjs): New function.
7366
c7177d31
ILT
73672010-02-10 Ian Lance Taylor <iant@google.com>
7368
5de0e392
ILT
7369 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
7370 shared, not if not position independent.
7371 * x86_64.cc (Relocate::relocate_tls): Likewise.
7372 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
7373 (tls_pie_pic_test): New target.
7374 * testsuite/Makefile.in: Rebuild.
7375
c7177d31
ILT
7376 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
7377 (tls_test_main_pie.o, tls_test_pie.o): New targets.
7378 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
7379 * testsuite/Makefile.in: Rebuild.
7380
684b268a
DM
73812010-02-09 David S. Miller <davem@davemloft.net>
7382
7383 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
7384 R_SPARC_RELATIVE using ->add_local_relative().
7385 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
7386
612a8d3d
DM
7387 * output.h (Output_data_dynamic::add_section_size): New method
7388 that takes two Output_data objects.
7389 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
7390 entry param. Handle it in initializers.
7391 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
7392 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
7393 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
7394 arg.
7395 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
7396 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
7397 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
7398 for dynrel_includes_plt.
7399 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7400 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7401 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
7402 before .rela.plt
7403 (Target_sparc::do_finalize_sections): Update to pass true for
7404 dynrel_includes_plt.
7405 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
7406 output before .rela.plt
7407 (Target_powerpc::do_finalize_sections): Update to pass true for
7408 dynrel_includes_plt when 32-bit.
7409
cb1be87e
DK
74102010-02-08 Doug Kwan <dougkwan@google.com>
7411
7412 * arm.cc (Arm_relobj::simple_input_section_output_address): New
7413 method.
7414 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
7415 Arm_relobj::scan_section_for_cortex_a8_stubs,
7416 Arm_relobj::do_relocation_section): Instead of calling
7417 Output_section::output_address, use faster
7418 Arm_relobj::simple_input_section_output_address.
7419
705b5121
DM
74202010-02-08 David S. Miller <davem@davemloft.net>
7421
7422 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
7423 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
7424 relocation helper function.
7425
024c4466
DM
7426 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
7427 just like R_SPARC_GOT{10,13,22}.
7428 (Target_sparc::Scan::local): Likewise.
7429 (Target_sparc::Relocate:relocate): Likewise.
7430
9109c078
ILT
74312010-02-06 Ian Lance Taylor <iant@google.com>
7432
7433 * configure.ac: Rewrite targetobjs duplicate removal code to use
7434 only shell constructs.
7435 * configure: Rebuild.
7436
cf846138
DK
74372010-02-05 Doug Kwan <dougkwan@google.com>
7438
7439 PR 11247
7440 * arm.cc (Arm_relobj::section_is_scannable): New method.
7441 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
7442 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
7443
6cfaf60b
DK
74442010-02-04 Doug Kwan <dougkwan@google.com>
7445
7446 PR 11247
7447 * arm-reloc-property.cc (cstdio): Include.
7448 * configure.ac (targetobjs): Remove duplicates.
7449 * configure: Regenerate.
7450 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
7451 big and little endian version for a given address size.
7452
5c57f1be
DK
74532010-02-03 Doug Kwan <dougkwan@google.com>
7454
7455 * arm-reloc-property.cc
7456 (Arm_reloc_property_table::reloc_name_in_error_message): New method
7457 definition.
7458 * arm-reloc-property.h
7459 (Arm_reloc_property_table::get_implemented_static_reloc_property):
7460 New method definition.
7461 (Arm_reloc_property_table::reloc_name_in_error_message): New method
7462 declaration.
7463 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
7464 overflow to N.
7465 (GOT_PREL): Change implemented to Y.
7466 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
7467 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
7468 (Arm_relocate_functions::movw_abs_nc): Remove method.
7469 (Arm_relocate_functions::movt_abs): Ditto.
7470 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
7471 (Arm_relocate_functions::thm_movt_abs): Ditto.
7472 (Arm_relocate_functions::movw_rel_nc): Ditto.
7473 (Arm_relocate_functions::movw_rel): Ditto.
7474 (Arm_relocate_functions::movt_rel): Ditto.
7475 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
7476 (Arm_relocate_functions:thm_movw_rel): Ditto.
7477 (Arm_relocate_functions:thm_movt_rel): Ditto.
7478 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
7479 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
7480 New method definitions.
7481 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
7482 (Arm_relocation_functions::arm_grp_ldr): Ditto.
7483 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
7484 (Arm_relocation_functions::arm_grp_ldc): Ditto.
7485 (Target_arm::Relocate::relocate): Check for non-static or
7486 unimplemented relocation code and exit early. Change calls to
7487 Target_arm::reloc_uses_thumb_bit and
7488 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
7489 instead. Refactor code to handle similar relocations to increase
7490 code sharing. Remove check for unsupported relocation code in switch
7491 statement.
7492 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
7493 relocation property table to find out size. Change error message to
7494 print out the name of a relocation code instead of the numeric value.
7495 (Target_arm::scan_reloc_for_stub): Use relocation property table
7496 instead of calling Target_arm::reloc_uses_thumb_bit().
7497
218c5831
DK
74982010-02-02 Doug Kwan <dougkwan@google.com>
7499
7500 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
7501 types of relaxed input section.
7502
0d31c79d
DK
75032010-02-02 Doug Kwan <dougkwan@google.com>
7504
7505 * Makefile.am (HFILES): Add arm-reloc-property.h.
7506 (DEFFILES): New.
2e702c99
RM
7507 (TARGETSOURCES): Add arm-reloc-property.cc
7508 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
7509 (libgold_a_SOURCES): $(DEFFILES)
7510 * Makefile.in: Regenerate.
7511 * arm-reloc-property.cc: New file.
7512 * arm-reloc-property.h: New file.
7513 * arm-reloc.def: New file.
7514 * arm.cc: Update comments.
7515 (arm-reloc-property.h): New included header.
7516 (arm_reloc_property_table): New global variable.
7517 (Target_arm::do_select_as_default_target): New method definition.
7518 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
7519 arm-reloc-property to targ_extra_obj.
7520 * parameters.cc (set_parameters_target): Call
7521 Target::select_as_default_target().
7522 * target.h (Target::select_as_default_target): New method definition.
7523 (Target::do_select_as_default_target): Same.
7524
546c7457
DK
75252010-02-01 Doug Kwan <dougkwan@google.com>
7526
7527 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
7528 first_output_text_section_.
7529 (Arm_exidx_fixup::first_output_text_section): New method definition.
7530 (Arm_exidx_fixup::first_output_text_section_): New data member.
7531 (Arm_exidx_fixup::process_exidx_section): Record the first text
7532 output section seen.
7533 (Arm_output_section::fix_exidx_coverage): Set correct linked section
7534 and entsize in output section header.
7535
11b861d5
DK
75362010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7537
7538 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
7539 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
7540 (Arm_relocate_functions::thm_alu11): New Method.
7541 (Arm_relocate_functions::thm_pc8): New Method.
7542 (Arm_relocate_functions::thm_pc12): New Method.
7543 (Target_arm::Scan::local): Handle the relocations.
7544 (Target_arm::Scan::global): Likewise.
7545 (Target_arm::Relocate::relocate): Likewise.
7546 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7547
c9a2c125
DK
75482010-01-29 Doug Kwan <dougkwan@google.com>
7549
7550 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
7551 of relocation types as ld.
7552
1521477a
DK
75532010-01-29 Doug Kwan <dougkwan@google.com>
7554
7555 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
7556 to public.
7557 (Arm_relocate_functions::thumb_branch_common): Ditto.
7558 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
7559 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
7560 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
7561 Arm_relocate_functions::jump24): Remove.
7562 (Target_arm::Relocate::relocate): Adjust code to call
7563 Arm_relocation_functions::arm_branch_common and
7564 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 7565 wrappers. Merge switch-cases together to reduce source code size.
1521477a 7566
e7eca48c
DK
75672010-01-29 Doug Kwan <dougkwan@google.com>
7568
7569 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
7570 output_local_symbol_count_needs_update_.
7571 (Arm_relobj::output_local_symbol_count_needs_update,
7572 Arm_relobj::set_output_local_symbol_count_needs_update,
7573 Arm_relobj::update_output_local_symbol_count): New methods.
7574 (Arm_relobj::output_local_symbol_count_needs_update_): New data
7575 member.
7576 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
7577 of pointed function as in a R_ARM_PREL31 relocation.
7578 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
7579 for output local symbol count updating.
7580 (Target_arm::do_relax): Update output local symbol counts in objects
7581 if necessary.
7582 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
7583
02961d7e
ILT
75842010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7585
7586 * arm.cc: Added support for the ARM relocations:
7587 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
7588 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
7589 (Arm_relocate_functions::movw_rel_nc): Renamed (was
7590 movw_prel_nc).
7591 (Arm_relocate_functions::movw_rel): New method.
7592 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
7593 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
7594 thm_movw_prel_nc).
7595 (Arm_relocate_functions::thm_movw_rel): New method.
7596 (Arm_relocate_functions::thm_movt_rel): Renamed (was
7597 thm_movt_prel).
7598 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
7599 relocations.
7600 (Target_arm::Scan::global): Likewise.
7601 (Target_arm::Relocate::relocate): Likewise.
7602 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7603 Likewise.
7604
b10d2873
ILT
76052010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7606
7607 * arm.cc: Added support for ARM group relocations.
7608 (Target_arm::reloc_needs_sym_origin): New method.
7609 (Arm_relocate_functions::calc_grp_kn): New method.
7610 (Arm_relocate_functions::calc_grp_residual): New method.
7611 (Arm_relocate_functions::calc_grp_gn): New method.
7612 (Arm_relocate_functions::arm_grp_alu): New Method.
7613 (Arm_relocate_functions::arm_grp_ldr): New Method.
7614 (Arm_relocate_functions::arm_grp_ldrs): New Method.
7615 (Arm_relocate_functions::arm_grp_ldc): New Method.
7616 (Target_arm::Scan::local): Handle the ARM group relocations.
7617 (Target_arm::Scan::global): Likewise.
7618 (Target_arm::Relocate::relocate): Likewise.
7619 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7620 Likewise.
7621
2b328d4e
DK
76222010-01-26 Doug Kwan <dougkwan@google.com>
7623
7624 * arm.cc (set): Include.
7625 (class Arm_exidx_fixup): Change type of last_input_section_ to const
7626 pointer type.
2e702c99 7627 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
7628 (Arm_output_section::append_text_sections_to_list): New method.
7629 (Arm_output_section::fix_exidx_coverage): Ditto.
7630 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 7631 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
7632 Relobj::set_section_offset() instead of
7633 Sized_relobj::invalidate_section_offset().
2e702c99 7634 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
7635 parameter for section headers. Ignore relocation sections for
7636 unallocated sections and EXIDX sections.
7637 (Target_arm::fix_exidx_coverage): New method.
7638 (Target_arm::output_section_address_less_than): New type.
7639 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
7640 linked text section instead of the EXIDX section.
7641 (Arm_output_section::create_stub_group): Add an assertion to check
7642 that this is not an EXIDX output section.
7643 (Arm_output_section::append_text_sections_to_list): New method.
7644 (Arm_output_section::fix_exidx_coverage): Ditto.
7645 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 7646 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
7647 (Target_arm::do_relax): Fix EXIDX output section coverage in the
7648 first pass.
7649 (Target_arm::fix_exidx_coverage): New method.
7650 * object.h (Relobj::set_output_section): New method.
7651 (Sized_relobj::invalidate_section_offset): Remove method.
7652 (Sized_relobj::do_invalidate_section_offset): Remove method.
7653 (Sized_relobj::do_set_section_offset): Handle offset value -1.
7654
c7f3c371
DK
76552010-01-25 Doug Kwan <dougkwan@google.com>
7656
7657 * arm.cc (Arm_exidx_merged_section::do_output_offset):
7658 Fix warning due to signed and unsigned comparison on a 32-bit host.
7659
8923b24c
DK
76602010-01-22 Doug Kwan <dougkwan@google.com>
7661
7662 * arm.cc (Target_arm::do_relax): Record an output section for section
7663 offset adjustment it contains any stub table that has changed.
7664 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
7665 offsets in an output section if necessary.
7666 * output.cc (Output_section::Output_section): Initialize
7667 section_offsets_need_adjustments_.
7668 (Output_section::add_input_section_for_script): Renamed to
7669 Output_section::add_simple_input_section.
7670 (Output_section::save_states): Add a comment.
7671 (Output_section::discard_states): New method defintion.
7672 (Output_section::adjust_section_offsets): Same.
7673 * output.h (Output_section::add_input_section_for_script): Renamed to
7674 Output_section::add_simple_input_section.
7675 (Output_section::discard_states): New method declaration.
7676 (Output_section::adjust_section_offsets): Same.
7677 (Output_section::section_offsets_need_adjustment,
7678 Output_section::set_section_offsets_need_adjustment): New method
7679 definitions.
7680 (Output_section::section_offsets_need_adjustment_): New data member.
7681 * script-sections.cc
7682 (Output_section_element_input::set_section_address): Adjust code for
7683 renaming of Output_section::add_input_section_for_script.
7684 (Orphan_output_section::set_section_address): Same.
7685
9b2fd367
DK
76862010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7687
7688 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
7689 Fix_v4bx enum values .
7690 * gold/options.h (General_options): New option definitions.
7691 (General_options::fix_v4bx): New method.
7692 (General_options::Fix_v4bx): New enum.
7693 * gold/options.cc (General_options::parse_fix_v4bx): New method.
7694 (General_options::parse_fix_v4bx_interworking): New method.
7695
80d0d023
DK
76962010-01-22 Doug Kwan <dougkwan@google.com>
7697
7698 * arm.cc (Arm_exidx_fixup): New class.
7699
af2cdeae
DK
77002010-01-21 Doug Kwan <dougkwan@google.com>
7701
7702 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
7703 classes.
7704 (Arm_exidx_section_offset_map): New type.
7705
993d07c1
DK
77062010-01-21 Doug Kwan <dougkwan@google.com>
7707
7708 * arm.cc (Arm_exidx_input_section): New class.
7709 (Arm_relobj::exidx_input_section_by_link,
7710 Arm_relobj::exidx_input_section_by_shndx,
7711 Arm_relobj::make_exidx_input_section): New methods.
7712 (read_arm_attributes_section): Remove.
7713 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
7714 information about them.
7715 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
7716 to here.
7717
5ac169d4
DK
77182010-01-20 Doug Kwan <dougkwan@google.com>
7719
7720 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
7721 Input_section_specifier to Section_id.
7722 (Target_arm::new_arm_input_section: Adjust code for change of key
7723 type.
7724 (Target_arm::find_arm_input_section): Ditto.
7725 * gc.h (object.h): Include for Section_id nand Section_id_hash.
7726 (Section_id): Remove.
7727 (Garbage_collection::Section_id_hash): Remove.
7728 * icf.h (object.h): Include for Section_id nand Section_id_hash.
7729 (Section_id): Remove.
7730 (Icf::Section_id_hash): Remove.
7731 * object.h (Section_id, Const_section_id, Section_id_hash,
7732 Const_section_id_hash): New type definitions.
7733 * output.cc (Output_section::add_relaxed_input_section): Change to
7734 use Const_section_id instead of Input_section_specifier as key type.
7735 (Output_section::add_merge_input_section): Ditto.
7736 (Output_section::build_relaxation_map): Change to use Section_id
7737 instead of Input_section_specifier as key type.
2e702c99 7738 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
7739 Ditto.
7740 (Output_section::convert_input_sections_to_relaxed_sections): Change
7741 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 7742 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
7743 (Output_section::find_relaxed_input_section): Ditto.
7744 * output.h (Input_section_specifier): Remove class.
7745 (Output_section::Output_section_data_by_input_section_map): Change
7746 key type to Const_section_id.
7747 (Output_section::Output_relaxed_input_section_by_input_section_map):
7748 Ditto.
7749 (Output_section::Relaxation_map): Change key type to Section_id.
7750
a2162063
ILT
77512010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7752
7753 * gold/arm.cc: Added support for R_ARM_V4BX relocation
7754 (class Arm_v4bx_stub): New class.
7755 (DEF_STUBS): Updated definition to support v4_veneer_bx.
7756 (Stub_factory::make_arm_v4bx_stub): New method.
7757 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
7758 (Stub_table::empty): Handle v4bx stubs.
7759 (Stub_table::add_arm_v4bx_stub): New method.
7760 (Stub_table::find_arm_v4bx_stub): New method.
7761 (Arm_relocate_functions::v4bx): New method.
7762 (Target_arm::fix_v4bx): New method.
7763 (Target_arm::Target_arm): Handle R_ARM_V4BX.
7764 (Stub_table::relocate_stubs): Likewise.
7765 (Stub_table::do_write): Likewise.
7766 (Stub_table::update_data_size_and_addralign): Likewise.
7767 (Stub_table::finalize_stubs): Likewise.
7768 (Target_arm::Scan::local): Likewise.
7769 (Target_arm::Scan::global): Likewise.
7770 (Target_arm::do_finalize_sections): Likewise.
7771 (Target_arm::Relocate::relocate): Likewise.
7772 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7773 Likewise.
7774 (Target_arm::scan_reloc_for_stub): Likewise.
7775 (Target_arm::scan_reloc_section_for_stubs): Likewise.
7776
5696ab0b
ILT
77772010-01-19 Ian Lance Taylor <iant@google.com>
7778
7779 * output.cc (Output_section_headers::do_sized_write): Write large
7780 segment count to sh_info field.
7781 (Output_file_header::do_sized_write): For large segment count,
7782 write PN_XNUM to e_phnum field.
7783
800d0f56
ILT
77842010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7785
7786 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
7787 (Arm_relocate_functions::thm_jump8): New function.
7788 (Arm_relocate_functions::thm_jump11): New function.
7789 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
7790 R_ARM_THM_JUMP11.
7791 (Target_arm::Scan::global): Likewise.
7792 (Target_arm::Relocate::relocate): Likewise.
7793 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7794 Likewise.
7795
41263c05
DK
77962010-01-14 Doug Kwan <dougkwan@google.com>
7797
7798 * arm.cc (map, utility): Include headers.
7799 (Target_arm::apply_cortex_a8_workaround): New method.
7800 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
7801 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
7802 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
7803 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
7804 the --[no-]fix-cortex-a8 command line options.
7805 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
7806 (Target_arm::relocate_stub): Use addend in instruction template.
7807 * options.h (DEFINE_bool): Set the user-set flag.
7808 (General_options): Add --[no-]-fix-cortex options.
7809 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 7810 : Update fast look-up map after conversion.
41263c05 7811
459e9b03
ST
78122010-01-14 Sriraman Tallam <tmsriram@google.com>
7813
7814 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
7815 in the first pass of do_layout.
7816
b521dfe4
DK
78172010-01-13 Doug Kwan <dougkwan@google.com>
7818
7819 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
7820 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
7821 apparent compiler problem of not folding static constant integral
7822 data members of elfcpp::Elf_sizes<32>.
7823
44272192
DK
78242010-01-13 Doug Kwan <dougkwan@google.com>
7825
7826 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
7827 Arm_relobj::section_needs_cortex_a8_stub_scanning,
7828 Arm_relobj::scan_section_for_cortex_a8_erratum,
7829 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
7830 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
7831 sections to scan for relocation stubs into a new method
7832 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
7833 relocation and Cortex-A8 stub scanning.
7834 (Target_arm::do_relax): Force stubs to be after stubbed sections
7835 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 7836 the beginning of a new relaxation pass. Update a comment.
44272192
DK
7837 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
7838
44b71ece
ILT
78392010-01-12 Ian Lance Taylor <iant@google.com>
7840
7841 * target-reloc.h (visibility_error): New inline function.
7842 (relocate_section): Call visibility_error.
7843 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
7844 (MOSTLYCLEANFILES): Likewise.
7845 (protected_4_pic.o, protected_3.err): New targets.
7846 * testsuite/protected_4.cc: New file.
7847
a120bc7f
DK
78482010-01-12 Doug Kwan <dougkwan@google.com>
7849
7850 * arm.cc (Cortex_a8_reloc): New class.
7851 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
7852 and cortex_a8_relocs_info_.
7853 (Target_arm::fix_cortex_a8): New method definition.
7854 (Target_arm::Cortex_a8_relocs_info): New type.
7855 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
7856 New data member declarations.
7857 (Target_arm::scan_reloc_for_stub): Record information about
7858 relocations for THUMB branches that might be exempted from the
7859 Cortex-A8 workaround.
7860 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
7861 at the beginning of a relaxation pass.
7862
20138696
DK
78632010-01-12 Doug Kwan <dougkwan@google.com>
7864
7865 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
7866 (Arm_relobj::Mapping_symbol_position,
7867 Arm_reloj::Mapping_symbol_position_less,
7868 Arm_relobj::Mapping_symbols_info): New types.
7869 (Target_arm::is_mapping_symbol_name): New method definition.
7870 (Arm_relobj::do_count_local_symbols): Save information about mapping
7871 symbols.
7872
089d69dc
DK
78732010-01-11 Doug Kwan <dougkwan@google.com>
7874
7875 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
7876 Arm_relocate_functions::thumb32_branch_upper,
7877 Arm_relocate_functions::thumb32_branch_lower,
7878 Arm_relocate_functions::thumb32_cond_branch_offset,
7879 Arm_relocate_functions::thumb32_cond_branch_upper,
7880 Arm_relocate_functions::thumb32_cond_branch_lower,
7881 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
7882 branch offset encoding.
7883 (Arm_relocate_functions::thumb_branch_common): Use new branch
7884 offset encoding methods to avoid code duplication.
7885 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
7886 (Stub_addend_reader::operator()): Use new branch encoding method
7887 to avoid code duplication.
7888
99e5bff2
DK
78892010-01-11 Doug Kwan <dougkwan@google.com>
7890
7891 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
7892 (Target_arm::do_finalize_sections): Define special EXIDX section
7893 symbols only if referenced.
7894 * gc.h (Garbage_collection::add_reference): New method.
7895 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
7896 code duplication.
7897
98e090bd
ILT
78982010-01-11 Ian Lance Taylor <iant@google.com>
7899
d0a91bd8
ILT
7900 * script.cc (Version_script_info::build_expression_list_lookup):
7901 Change complaing about duplicate wildcard match from error to
7902 warning.
7903
98e090bd
ILT
7904 * script.cc (class Lazy_demangler): Recreate--revert part of patch
7905 of 2009-12-30.
7906 (Version_script_info::Version_script_info): Initialize globs_,
7907 default_version_, default_is_global_, and exact_. Don't
7908 initialize globals_ or locals_.
7909 (Version_script_info::build_lookup_tables): Build local symbols
7910 first.
7911 (Version_script_info::unquote): New function.
7912 (Version_script_info::add_exact_match): New function.
7913 (Version_script_info::build_expression_list_lookup): Remove lookup
7914 parameter. Add is_global parameter. Change all callers. Handle
7915 wildcard pattern specially. Unquote pattern. Call
7916 add_exact_match.
7917 (Version_script_info::get_name_to_match): New function.
7918 (Version_script_info::get_symbol_version): New function.
7919 (Version_script_info::get_symbol_version_helper): Remove.
7920 (Version_script_info::check_unmatched_names): Call unquote.
7921 * script.h (class Version_script_info): Change get_symbol_version
7922 to be non-inline and add is_global parameter; change all callers.
7923 Rewrite symbol_is_local. Update declarations. Define struct
7924 Version_tree_match, Exact, Globs. Don't define struct Lookup.
7925 Remove globals_ and locals_ members. Add exact_, globs_,
7926 default_version_, is_global_.
7927 (Version_script_info::Glob): Remove pattern, add expression and
7928 is_global. Update constructor. Change all callers.
7929 * dynobj.cc (Versions::finalize): Mark the version symbol as the
7930 default version.
7931 (Versions::symbol_section_contents): If a symbol is undefined, or
7932 defined in a dynamic object, set the version index to
7933 VER_NDX_LOCAL.
7934 * symtab.cc (Symbol_table::add_from_relobj): Don't call
7935 symbol_is_local.
7936 (Symbol_table::add_from_pluginobj): Likewise.
7937 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
7938
d56962d3
DK
79392010-01-11 Doug Kwan <dougkwan@google.com>
7940
7941 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
7942 (incremental_dump_LDADD): Add linking option for libintl.
7943 * Makefile.in: Regenerate.
7944
94e6ee91
L
79452010-01-11 H.J. Lu <hongjiu.lu@intel.com>
7946
7947 PR gold/11144
7948 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
7949 instead of -Ds.
7950 * testsuite/Makefile.in: Regenerated.
7951
e96c574b
DK
79522010-01-10 Doug Kwan <dougkwan@google.com>
7953
7954 * options.h (DEFINE_var): Use parentheses around argument varname__
7955 in macro body to avoid any unintended subsequent substitutions.
7956
7198066b
ILT
79572010-01-10 Ian Lance Taylor <iant@google.com>
7958
ba4d53bf
ILT
7959 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
7960 candidates before doing symbol resolution.
7961
7198066b
ILT
7962 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
7963 ODR candidates if only one is weak.
7964
a2beed37
ILT
79652010-01-08 Ian Lance Taylor <iant@google.com>
7966
7967 * script.cc (Version_script_info::build_expression_list_lookup):
7968 Don't warn about ambiguous version, just record the ambiguity.
7969 (Version_script_info::get_symbol_version_helper): Give error if
7970 version is ambiguous.
7971
2fb7225c
DK
79722010-01-08 Doug Kwan <dougkwan@google.com>
7973
7974 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
7975 prev_data_size_ and prev_addralign_. Remove initializer for
7976 deleted data member has_been_changed_.
7977 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
7978 to determine if the table is empty.
7979 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
7980 Remove.
7981 (Stub_table::add_reloc_stub): Define method in class definition
7982 instead of just declaring it there.
7983 (Stub_table::add_cortex_a8_stub): New method definition.
7984 (Stub_table::update_data_size_and_addralign): Ditto.
7985 (Stub_table::finalize_stubs): Ditto.
7986 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
7987 (Stub_table::do_addralign_): Return address alignment in the
7988 (Stub_table::do_reset_address_and_file_offset): Define method in
7989 class definition instead of declaring it there. Set current data
7990 size to be the data size of the previous pass.
7991 (Stub_table::set_final_data_size): Use current data size as the
7992 final data size.
7993 (Stub_table::relocate_stub): Change parameter type of stub from
7994 Reloc_stub pointer to Stub pointer.
7995 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
7996 (Stub_table::Cortex_a8_stub_list): New typedef.
7997 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
7998 Stub_table::prev_addralign_): New data member.
7999 (Arm_relobj::Arm_relobj): Initialize data member
8000 section_has_cortex_a8_workaround_.
8001 (Arm_relobj::section_has_cortex_a8_workaround,
8002 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
8003 definitions.
8004 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
8005 declarations.
8006 (Target_arm::relocate_stub): Change parameter type of stub from
8007 Reloc_stub pointer to Stub pointer.
8008 (Insn_template::size, Insn_template::alignment): Handle
8009 THUMB16_SPECIAL_TYPE.
8010 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
8011 Stub_table::update_data_size_and_addralign,
8012 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
8013 definitions.
8014 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
8015 (Stub_table::do_write): Ditto.
8016 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 8017
880cd20d
ILT
80182010-01-08 Ian Lance Taylor <iant@google.com>
8019
8020 PR 11108
8021 * symtab.h (class Symbol): Remove fields is_target_special_ and
8022 has_plt_offset_. Add field is_defined_in_discarded_section_.
8023 (Symbol::is_defined_in_discarded_section): New function.
8024 (Symbol::set_is_defined_in_discarded_section): New function.
8025 (Symbol::has_plt_offset): Rewrite.
8026 (Symbol::set_plt_offset): Verify that new offset is not -1U.
8027 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
8028 Don't initialize is_target_special_ or has_plt_offset_.
8029 Initialize is_defined_in_discarded_section_.
8030 (Symbol_table::add_from_relobj): If appropriate, set
8031 is_defined_in_discarded_section.
8032 * resolve.cc (Symbol::override_base_with_special): Don't test
8033 is_target_special_. Change has_plt_offset_ to has_plt_offset().
8034 * target-reloc.h (relocate_section): Do special handling for
8035 symbols defined in discarded sections for global symbols as well
8036 as local symbols.
8037
2703e3eb
ILT
80382010-01-08 Ian Lance Taylor <iant@google.com>
8039
8040 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
8041 the SHT_SYMTAB case.
8042
339d40a3
ILT
80432010-01-08 Ian Lance Taylor <iant@google.com>
8044
8045 * object.cc (Sized_relobj::do_layout): Don't get confused if
8046 layout_eh_frame returns NULL.
8047
abecea76
ILT
80482010-01-08 Ian Lance Taylor <iant@google.com>
8049
8050 PR 11084
8051 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
8052 dynamic symbol table, use the normal symbol table.
8053 (Sized_dynobj::do_read_symbols): Remove assertion about type of
8054 symbol table.
8055
6b7dd3f3
ILT
80562010-01-08 Ian Lance Taylor <iant@google.com>
8057
8058 PR 11072
8059 * layout.cc (Layout::include_section): Remove .gnu_debuglink
8060 sections.
8061
36c50e63
L
80622010-01-08 H.J. Lu <hongjiu.lu@intel.com>
8063
8064 * version.cc (print_version): Change to "Copyright 2010".
8065
e291e7b9
ILT
80662010-01-08 Ian Lance Taylor <iant@google.com>
8067
8068 PR 10287
8069 PR 11063
8070 * i386.cc (class Target_i386): Change return type of plt_section
8071 to be non-const.
8072 (class Output_data_plt_i386): Add tls_desc_rel_ field.
8073 (Output_data_plt_i386::Output_data_plt_i386): Initialize
8074 tls_desc_rel_ field.
8075 (Output_data_plt_i386::rel_tls_desc): New function.
8076 (Target_i386::rel_tls_desc_section): New function.
8077 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
8078 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
8079 R_386_TLS_DESC reloc in rel_tls_desc_section.
8080 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
8081 Define struct Tlsdesc_info.
8082 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
8083 (Target_x86_64::do_reloc_symbol_index): New function.
8084 (Target_x86_64::add_tlsdesc_info): New function.
8085 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
8086 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
8087 tlsdesc_rel_ field.
8088 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
8089 all callers.
8090 (Output_data_plt_x86_64::rela_tlsdesc): New function.
8091 (Target_x86_64::rela_tlsdesc_section): New function.
8092 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
8093 handling.
8094 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
8095 (Target_x86_64::do_reloc_addend): New function.
8096 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
8097 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
8098 declarations. Define TARGET_CODE. Add arg field to u1_ union.
8099 (Output_reloc::type): New function.
8100 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
8101 (Output_reloc::is_target_specific): New function.
8102 (Output_reloc::target_arg): New function.
8103 (class Output_reloc) [SHT_RELA]: Add four new constructors for
8104 absolute relocs and target specific relocs.
8105 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
8106 add_target_specific.
8107 (class Output_data_reloc) [SHT_RELA]: Likewise.
8108 * output.cc (Output_reloc::Output_reloc): Add four new versions
8109 for absolute relocs and target specific relocs.
8110 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
8111 (Output_reloc::get_symbol_index): Likewise.
8112 (Output_reloc::local_section_offset): Check that local_sym_index_
8113 is not TARGET_CODE or 0.
8114 (Output_reloc::symbol_value): Likewise.
8115 (Output_reloc::write) [SHT_RELA]: Call target for target specific
8116 reloc.
8117 * target.h (class Target): Add reloc_symbol_index and reloc_addend
8118 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
8119 functions.
8120 * layout.cc (add_target_dynamic_tags): Use output section for
8121 DT_PLTRELSZ and DT_JMPREL.
8122
3a44184e
ILT
81232010-01-07 Ian Lance Taylor <iant@google.com>
8124
8125 PR 11061
8126 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
8127 function.
8128 (class Output_data_reloc_generic): Define.
8129 (class Output_data_reloc_base): Change base class to
8130 Output_data_reloc_generic. Change add() method to call
8131 bump_relative_reloc_count for a relative reloc. Remove
8132 sort_relocs_ field.
8133 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
8134 to sort_relocs().
8135 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
8136 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
8137 appropriate.
8138 * layout.h (class Layout): Update declaration.
8139
ea715a34
ILT
81402010-01-07 Ian Lance Taylor <iant@google.com>
8141
8142 * output.h (class Output_data): Add const version of
8143 output_section and do_output_section.
8144 (class Output_section_data): Add const version of
8145 do_output_section.
8146 (class Output_section): Likewise.
8147 * layout.cc (Layout::add_target_dynamic_tags): New function.
8148 * layout.h (class Layout): Update declarations.
8149 * arm.cc (Target_arm::do_finalize_sections): Use
8150 add_target_dynamic_tags.
8151 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8152 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
8153 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
8154 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8155
659948a4
ILT
81562010-01-07 Ian Lance Taylor <iant@google.com>
8157
8158 PR 11042
8159 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
8160 object as needed.
8161
9d3b86f6
ILT
81622010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
8163 Ian Lance Taylor <iant@google.com>
8164
8165 PR 11019
8166 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
8167 Xindex::read_symtab_xindex.
8168
bb0d3eb0
DK
81692010-01-07 Doug Kwan <dougkwan@google.com>
8170
8171 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
8172 (Insn_template::thumb16_bcond_insn): New method declaration.
8173 (Insn_template): Fix spelling.
8174 (Stub::thumb16_special): New method declaration.
8175 (Stub::do_write): Define virtual method which was previously pure
8176 virtual.
8177 (Stub::do_thumb16_special): New method declaration.
8178 (Stub::do_fixed_endian_write): New template member.
8179 (Reloc_stub::do_write): Remove.
8180 (Reloc_stub::do_fixed_endian_write): Remove.
8181 (Cortex_a8_stub): New class definition.
8182 (Stub_factory::make_cortex_a8_stub): New method definition.
8183 (Stub_factory::Stub_factory): Add missing static storage class
8184 qualifier for elf32_arm_stub_a8_veneer_blx.
8185
ffeef7df
ILT
81862010-01-07 Ian Lance Taylor <iant@google.com>
8187
dc3f80fe
ILT
8188 PR 10980
8189 * options.h (class General_options): Add --warn-unresolved-symbols
8190 and --error-unresolved-symbols.
8191 * errors.cc (Errors::undefined_symbol): Implement
8192 --warn-unresolved-symbols.
8193
ffeef7df
ILT
8194 * options.h (class General_options): Add -z text and -z textoff.
8195 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
8196
f1ec9ded
ST
81972010-01-06 Sriraman Tallam <tmsriram@google.com>
8198
8199 * gc.h (Garbage_collection::Cident_section_map): New typedef.
8200 (Garbage_collection::cident_sections): New function.
8201 (Garbage_collection::add_cident_section): New function.
8202 (Garbage_collection::cident_sections_): New member.
8203 (gc_process_relocs): Add references to sections whose names are C
8204 identifiers.
8205 * gold.h (cident_section_start_prefix): New constant.
8206 (cident_section_stop_prefix): New constant.
8207 (is_cident): New function.
8208 * layout.cc (Layout::define_section_symbols): Replace string constants
8209 with the newly defined constants.
8210 * object.cc (Sized_relobj::do_layout): Track sections whose names are
8211 C identifiers.
8212 * testsuite/Makefile.am: Add gc_orphan_section_test.
8213 * testsuite/Makefile.in: Regenerate.
8214 * testsuite/gc_orphan_section_test.cc: New file.
8215 * testsuite/gc_orphan_section_test.sh: New file.
8216
6eda8c29
ILT
82172010-01-06 Ian Lance Taylor <iant@google.com>
8218
b9674e17
ILT
8219 PR 10980
8220 * options.h (class General_options): Add --warn-shared-textrel.
8221 * layout.cc (Layout::finish_dynamic_section): Implement
8222 --warn-shared-textrel.
8223
6eda8c29
ILT
8224 PR 10980
8225 * options.h (class General_options): Add --warn-multiple-gp.
8226
32dcd44e
ILT
82272010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8228
8229 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
8230 $(THREADSLIB) and $(LIBDL).
8231 * Makefile.in: Rebuild.
8232
a192ba05
ILT
82332010-01-06 Ian Lance Taylor <iant@google.com>
8234
8235 PR 10980
8236 * options.cc (General_options::parse_section_start): New function.
8237 (General_options::section_start): New function.
8238 (General_options::General_options): Initialize all members.
8239 * options.h: Include <map>
8240 (class General_options): Add --section-start. Add section_starts_
8241 member.
8242 * layout.cc (Layout::attach_allocated_section_to_segment): If
8243 --section-start was used, set the address of the segment. Remove
8244 local sort_sections.
8245 (Layout::relaxation_loop_body): If the address of the load segment
8246 has been set by --section-start, don't use it.
8247 * output.h (Output_segment::update_flags_for_output_section): New
8248 function.
8249 * output.cc (Output_segment::add_output_section): Call
8250 update_flags_for_output_section.
8251
dde3f402
ILT
82522010-01-05 Ian Lance Taylor <iant@google.com>
8253
62dfdd4d
ILT
8254 PR 10980
8255 * options.h (class General_options): Add --undefined-version.
8256 * script.cc (struct Version_expression): Add was_matched_by_symbol
8257 field.
8258 (Version_script_info::matched_symbol): New function.
8259 (Version_script_info::get_symbol_version_helper): Call
8260 matched_symbol.
8261 (Version_script_info::check_unmatched_names): New function.
8262 * script.h (class Version_script_info): Update declarations.
8263 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
8264
9c4ae156
ILT
8265 * options.h (class General_options): Use DEFINE_bool_alias for
8266 allow_multiple_definition.
8267 * resolve.cc (Symbol_table::should_override): Don't test
8268 allow_multiple_definition.
8269
dde3f402
ILT
8270 PR 10980
8271 * options.h (class General_options): Add --cref.
8272 * main.cc (main): Print cref table if --cref. Don't close mapfile
8273 until after printing cref table.
8274 * cref.cc: Include "symtab.h".
8275 (class Cref_inputs): Define Cref_table_compare and Cref_table.
8276 (Cref_table_compare::operator()): New function.
8277 (Cref_inputs::gather_cref): New function.
8278 (filecol): New static const.
8279 (Cref_inputs::print_cref): New function.
8280 (Cref::print_cref): New function.
8281 * cref.h: Include <cstdio>.
8282 (class Cref): Update declarations.
8283 * mapfile.h (Mapfile::file): New function.
8284 * object.h (class Object): Define Symbols. Declare virtual
8285 do_get_global_symbols.
8286 (Object::get_global_symbols): New function.
8287 * object.cc (Input_objects::add_object): Pass object to cref_ if
8288 --cref.
8289 (Input_objects::archive_start): Likewise.
8290 (Input_objects::archive_stop): Likewise.
8291 (Input_objects::print_cref): New function.
8292 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
8293 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
8294 --cref.
8295 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
8296 function.
8297 * plugin.h (class Sized_pluginobj): Update declarations.
8298
8781f709
ILT
82992010-01-05 Ian Lance Taylor <iant@google.com>
8300
8301 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
8302 to is_default_version. Rename insdef to insdefault.
8303 (Symbol_table::add_from_relobj): Rename def to is_default_version
8304 and local to is_forced_local.
8305 (Symbol_table::add_from_pluginobj): Likewise.
8306 (Symbol_table::add_from_dynobj): Likewise.
8307 (Symbol_table::define_special_symbol): Rename insdef to
8308 insdefault.
8309
fe35d28d
ILT
83102010-01-04 Ian Lance Taylor <iant@google.com>
8311
30bc8c46
ILT
8312 PR 10980
8313 * options.h (class General_options): Add
8314 --allow-multiple-definition and -z muldefs.
8315 * resolve.cc (Symbol_table::should_override): Don't warn about a
8316 multiple symbol definition if --allow-multiple-definition or -z
8317 muldefs.
8318
7eaea549
ILT
8319 PR 10980
8320 * options.h (class General_options): Add --add-needed and
8321 --copy-dt-needed-entries. Tweak --as-needed help entry.
8322 * object.cc (Input_objects::check_dynamic_dependencies): Give an
8323 error if --copy-dt-needed-entries aka --add-needed is used and
8324 would cause a change in behaviour.
8325
fe35d28d
ILT
8326 PR 10980
8327 * options.h (class General_options): Add -G as a short version of
8328 --shared. Add no-op options -assert, -g, and -i.
8329
55a2bb35
ST
83302010-01-04 Sriraman Tallam <tmsriram@google.com>
8331
8332 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
8333 check for .text or .gnu.linkonce.t sections.
8334 * icf.cc (Icf::find_identical_sections): Ditto.
8335 Change the detection for mangled function name within the section
8336 name.
8337 * icf.h (is_section_foldable_candidate): New function.
8338
719328e1
ILT
83392009-12-30 Ian Lance Taylor <iant@google.com>
8340
8341 PR 10980
8342 * options.h (class General_options): Permit two dashes with
8343 --retain-symbols-file.
8344
d7bb5745
ILT
83452009-12-30 Ian Lance Taylor <iant@google.com>
8346
403a15dd
ILT
8347 PR 10979
8348 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
8349 don't put the file header and segment headers in the text
8350 segment.
8351
eda294df
ILT
8352 PR 10979
8353 * common.cc (Sort_commons::operator()): Stabilize sort when both
8354 entries are NULL.
8355 (Symbol_table::do_allocate_commons_list): When allocating common
8356 symbols, skip a symbol which is no longer common.
8357 * symtab.h (Symbol::is_common): Test whether the symbol comes from
8358 an object before checking its type.
8359 * testsuite/common_test_2.c: New file.
8360 * testsuite/common_test_3.c: New file.
8361 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
8362 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
8363 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
8364 (common_test_2_pic.o, common_test_2.so): New targets.
8365 (common_test_3_pic.o, common_test_3.so): New targets.
8366 * testsuite/Makefile.in: Rebuild.
8367
d7bb5745
ILT
8368 PR 10979
8369 * script.cc (read_input_script): If we see a new SECTIONS clause,
8370 and we have added an input section, give an error.
8371 * layout.h (class Layout): Add have_added_input_section function.
8372 Add have_added_input_section_ field.
8373 * layout.cc (Layout::Layout): Initialize
8374 have_added_input_section_.
8375 (Layout::layout): Set have_added_input_section_.
8376 (Layout::layout_eh_frame): Likewise.
8377
fc59c572
ILT
83782009-12-30 Ian Lance Taylor <iant@google.com>
8379
8380 PR 10931
8381 * options.h (class General_options): Add --sort-common option.
8382 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
8383 * common.cc (Sort_common): Add sort_order parameter to
8384 constructor. Add sort_order_ field.
8385 (Sort_commons::operator): Check sort_order_.
8386 (Symbol_table::allocate_commons): Determine the sort order.
8387 (Symbol_table::do_allocate_commons): Add sort_order parameter.
8388 Change all callers.
8389 (Symbol_table::do_allocate_commons_list): Likewise.
8390
1c74fab0
ILT
83912009-12-30 Ian Lance Taylor <iant@google.com>
8392
8393 PR 10916
8394 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
8395 symbols from this object, don't change the visibility of an
8396 undefined symbol.
8397 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
8398
6affe781
ILT
83992009-12-30 Ian Lance Taylor <iant@google.com>
8400
8401 PR 10861
8402 * script.h (class Version_script_info): Define Language enum.
8403 Update declarations. Define Glob, Exact, and Lookup types. Add
8404 new fields globals_, locals_, and is_finalized_.
8405 * script.cc: Various formatting fixes.
8406 (class Parser_closure): Change language_stack_ from a vector of
8407 std::string to one of Version_script_info::Language. Adjust all
8408 uses accordingly.
8409 (class Lazy_demangler): Remove.
8410 (struct Version_expression): Change language from std::string to
8411 Version_script_info::Language.
8412 (Version_script_info::Version_script_info): New function.
8413 (Version_script_info::~Version_script_info): Don't call clear.
8414 (Version_script_info::finalize): New function.
8415 (Version_script_info::build_lookup_tables): New function.
8416 (Version_script_info::build_expression_list_lookup): New
8417 function.
8418 (Version_script_info::get_symbol_version_helper): Rewrite to use
8419 lookup tables.
8420 (Version_script_info::print_expression_list): Adjust to use
8421 Version_script_info::Language.
8422 (script_push_lex_into_version_mode): Check that the version script
8423 has not been finalized.
8424 (version_script_push_lang): Change language string to
8425 Version_script_info::Language.
8426 * options.cc (Command_line::version_script): New function.
8427 * options.h (class General_options): Add finalize_dynamic_list
8428 function. Change version_script from declaration to definition.
8429 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
8430 * testsuite/version_script.map: Remove duplicate def of foo.
8431 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
8432 version_script.map.
8433 * testsuite/Makefile.in: Rebuild.
8434
818bf354
ILT
84352009-12-30 Ian Lance Taylor <iant@google.com>
8436
8437 PR 10843
8438 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
8439 if the input symbol index is 0, make the output symbol index 0.
8440
ebcc8304
ILT
84412009-12-30 Ian Lance Taylor <iant@google.com>
8442
8443 PR 10670
8444 * options.h (class General_options): Add -x/--discard-all.
8445 * object.cc (Sized_relobj::do_count_local_symbols): Handle
8446 --discard-all. If the local symbol needs a dynamic entry, check
8447 that before handling --discard-locals.
8448
176fe33f
ILT
84492009-12-30 Ian Lance Taylor <iant@google.com>
8450
bb321bb1
ILT
8451 PR 10450
8452 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
8453 flags to PF_R.
8454 (Output_segment::add_output_section): Don't change the flags if
8455 the type is PT_TLS.
8456
176fe33f
ILT
8457 PR 10450
8458 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
8459 GNU hash table if they need a dynamic value. Otherwise, don't add
8460 them if they are defined in a dynamic object or are forced local.
8461
e8cd95c7
ILT
84622009-12-29 Ian Lance Taylor <iant@google.com>
8463
1b81fb71
ILT
8464 PR 10450
8465 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
8466 .gnu.hash table for a 32-bit target.
8467
8d6d383d
ILT
8468 PR 10450
8469 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
8470 regular and a dynamic object only needs a dynamic symbol table
8471 entry if it is externally visible.
8472
e785ec03
ILT
8473 PR 10450
8474 * i386.cc (class Target_i386): Initialize global_offset_table_ in
8475 constructor. Add global_offset_table_ field.
8476 (Target_i386::got_section): Set global_offset_table_.
8477 (Target_i386::do_finalize_sections): Set global_offset_table_
8478 size.
8479 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
8480 in constructor. Add global_offset_table_ field.
8481 (Target_x86_64::got_section): Set global_offset_table_.
8482 (Target_x86_64::do_finalize_sections): Set global_offset_table_
8483 size.
8484
1a2dff53
ILT
8485 * layout.cc (Layout::Layout): Initialize increase_relro_.
8486 (Layout::get_output_section): Add is_relro, is_last_relro, and
8487 is_first_non_relro parameters. Change all callers.
8488 (Layout::choose_output_section): Likewise.
8489 (Layout::add_output_section_data): Likewise.
8490 (Layout::make_output_section): Likewise.
8491 (Layout::set_segment_offsets): Clear increase_relro when using a
8492 linker script.
8493 * layout.h (class Layout): Add increase_relro method. Add
8494 increase_relro_ field. Update declarations.
8495 * output.cc (Output_section::Output_section): Initialize
8496 is_last_relro_ and is_first_non_relro_.
8497 (Output_segment::add_output_section): Group relro sections is
8498 do_sort is true. Handle is_last_relro and is_first_non_relro.
8499 (Output_segment::maximum_alignment): Remove relro handling.
8500 (Output_segment::set_section_addresses): Add increase_relro
8501 parameter. Change all callers. Add initial alignment to align
8502 relro sections on separate page. Remove old relro handling.
8503 (Output_segment::set_section_list_addresses): Remove in_relro
8504 parameter. Change all callers.
8505 (Output_segment::set_offset): Add increase parameter. Change all
8506 callers. Remove old relro handling.
8507 * output.h (class Output_section): Add new methods: is_last_relro,
8508 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
8509 Add is_last_relro_ and is_first_non_relro_ fields.
8510 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
8511 Create separate .got.plt section. Call increase_relro.
8512 * x86_64.cc (Target_x86_64::got_section): Likewise.
8513 * testsuite/relro_script_test.t: Add .got.plt.
8514
f0ba79e2
ILT
8515 PR 10450
8516 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
8517 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
8518 (Layout::finalize): Call set_dynamic_symbol_size.
8519 (Layout::set_dynamic_symbol_size): New function.
8520 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
8521 set_dynamic_symbol_size.
8522
e8cd95c7
ILT
8523 PR 10450
8524 * output.h (class Output_section): Add is_entsize_zero_ field.
8525 * output.cc (Output_section::Output_section): Initialize
8526 is_entsize_zero_.
8527 (Output_section::set_entsize): If two different entsizes are
8528 requested, force it to zero.
8529 (Output_section::add_input_section): Set flags for .debug_str
8530 before updating section flags. Set entsize.
8531 (Output_section::update_flags_for_input_section): Set SHF_MERGE
8532 and SHF_STRING if all input sections have those flags.
8533
3e1b9a8a
RÁE
85342009-12-29 Rafael Espindola <espindola@google.com>
8535
8536 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
8537 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
8538 reporting.
3e1b9a8a 8539
3dcad376
ST
85402009-12-29 Sriraman Tallam <tmsriram@google.com>
8541
8542 * options.cc (General_options::parse_version): Allow -v to exit
8543 without an error if there is nothing to link.
8544
084e2665
ILT
85452009-12-29 Ian Lance Taylor <iant@google.com>
8546
8547 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
8548 using a version of gcc before 4.1.
8549 * configure: Rebuild.
8550
250acde3
CD
85512009-12-28 Chris Demetriou <cgd@google.com>
8552
8553 * attributes.cc (Output_attributes_section_data::do_write): Use
8554 std::vector::front rather than std::vector::data.
8555
99fff23b
ILT
85562009-12-28 Ian Lance Taylor <iant@google.com>
8557
8558 * symtab.h (class Symbol_table): Add enum Defined.
8559 * resolve.cc (Symbol_table::should_override): Add defined
8560 parameter. Change all callers. Test whether object is NULL
8561 before calling a method on it.
8562 (Symbol_table::report_resolve_problem): Add defined parameter.
8563 Change all callers.
8564 (Symbol_table::should_override_with_special): Likewise.
8565 * symtab.cc (Symbol_table::define_in_output_data): Add defined
8566 parameter. Change all callers.
8567 (Symbol_table::do_define_in_output_data): Likewise.
8568 (Symbol_table::define_in_output_segment): Likewise.
8569 (Symbol_table::do_define_in_output_segment): Likewise.
8570 (Symbol_table::define_as_constant): Likewise.
8571 (Symbol_table::do_define_as_constant): Likewise.
8572 * script.h (class Symbol_assignment): Add is_defsym parameter to
8573 constructor; change all callers.
8574 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
8575 parameter. Change all callers. Add is_defsym_ field.
8576 (class Parser_closure): Add parsing_defsym parameter to
8577 constructor; change all callers. Add parsing_defsym accessor
8578 function. Add parsing_defsym_ field.
8579
556bd683
ILT
85802009-12-28 Ian Lance Taylor <iant@google.com>
8581
8582 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 8583 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 8584
1782c879
ILT
85852009-12-23 Ian Lance Taylor <iant@google.com>
8586
8587 * i386.cc (Target_i386::do_calls_non_split): Recognize
8588 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
8589 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
8590 -fsplit-stack prologue when using %r11.
1782c879 8591
329ca2b1
ST
85922009-12-21 Sriraman Tallam <tmsriram@google.com>
8593
8594 * options.cc (General_options::parse_version): Make -v continue and do
8595 the link like GNU ld does.
8596
d675ff46
RÁE
85972009-12-17 Rafael Avila de Espindola <espindola@google.com>
8598
8599 * Makefile.am (CCFILES): Add timer.cc.
8600 (HFILES): Add timer.h.
8601 * configure.ac: Check for sysconf and times.
8602 * main.cc: include timer.h.
8603 (main): Use Timer instead of get_run_time.
8604 * timer.cc: New.
8605 * timer.h: New.
8606 * workqueue.cc: include timer.h.
8607 (Workqueue::find_and_run_task):
8608 Report user, sys and wall time.
8609 * Makefile.in: Regenerate.
8610 * config.in: Regenerate.
8611 * configure: Regenerate.
8612
d6344fb5
DK
86132009-12-16 Doug Kwan <dougkwan@google.com>
8614
8615 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
8616 sections.
8617 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
8618 relaxed input sections.
8619 * output.cc (Output_section::find_relaxed_input_section): Change
8620 return type to Output_relaxed_input_section pointer. Adjust code
8621 for new type of relaxed_input_section_map_.
8622 * output.h (Output_section::find_relaxed_input_section): Change
8623 return type to Output_relaxed_input_section pointer.
8624 (Output_section::Output_relaxed_input_section_by_input_section_map):
8625 New type.
8626 (Output_section::relaxed_input_section_map_): Change type to
8627 Output_section::Output_relaxed_input_section_by_input_section_map.
8628 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
8629 input section.
8630
0e0d5469
ILT
86312009-12-15 Ian Lance Taylor <iant@google.com>
8632
8633 * layout.cc (Layout::create_shstrtab): Only write out after input
8634 sections if we are compressing debug sections.
8635
0649a889
ILT
86362009-12-15 Ian Lance Taylor <iant@google.com>
8637
8638 * archive.cc (Archive::add_symbols): Only look up a symbol without
8639 a version if there is, in fact, a version.
8640
2ea97941
ILT
86412009-12-14 Ian Lance Taylor <iant@google.com>
8642
8643 Revert -Wshadow changes, all changes from:
8644 2009-12-11 Doug Kwan <dougkwan@google.com>
8645 2009-12-11 Nick Clifton <nickc@redhat.com>
8646 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
8647
b0eec2cc
DK
86482009-12-11 Doug Kwan <dougkwan@google.com>
8649
8650 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
8651 due to -Wshadow.
8652 * attributes.cc (Object_attribute::size): Ditto.
8653 (Attributes_section_data::size): Ditto.
8654 (Attributes_section_data::Attributes_section_data): Ditto.
8655 (Output_attributes_section_data::do_write): Ditto.
8656 * attributes.h (Object_attribute::set_type): Ditto.
8657 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
8658
91d6fa6a
NC
86592009-12-11 Nick Clifton <nickc@redhat.com>
8660
8661 * archive.cc: Fix shadowed variable warnings.
8662 * arm.cc: Likewise.
8663 * compressed_output.cc: Likewise.
8664 * compressed_output.h: Likewise.
8665 * configure: Likewise.
8666 * dwarf_reader.cc: Likewise.
8667 * dynobj.cc: Likewise.
8668 * dynobj.h: Likewise.
8669 * ehframe.cc: Likewise.
8670 * ehframe.h: Likewise.
8671 * errors.cc: Likewise.
8672 * expression.cc: Likewise.
8673 * fileread.cc: Likewise.
8674 * fileread.h: Likewise.
8675 * freebsd.h: Likewise.
8676 * i386.cc: Likewise.
8677 * icf.cc: Likewise.
8678 * incremental.h: Likewise.
8679 * layout.cc: Likewise.
8680 * layout.h: Likewise.
8681 * mapfile.cc: Likewise.
8682 * merge.cc: Likewise.
8683 * merge.h: Likewise.
8684 * object.cc: Likewise.
8685 * object.h: Likewise.
8686 * options.h: Likewise.
8687 * output.cc: Likewise.
8688 * output.h: Likewise.
8689 * parameters.cc: Likewise.
8690 * plugin.cc: Likewise.
8691 * powerpc.cc: Likewise.
8692 * reduced_debug_output.cc: Likewise.
8693 * reduced_debug_output.h: Likewise.
8694 * reloc.cc: Likewise.
8695 * reloc.h: Likewise.
8696 * resolve.cc: Likewise.
8697 * script-sections.cc: Likewise.
8698 * script.cc: Likewise.
8699 * script.h: Likewise.
8700 * sparc.cc: Likewise.
8701 * symtab.cc: Likewise.
8702 * symtab.h: Likewise.
8703 * target-select.cc: Likewise.
8704 * target-select.h: Likewise.
8705 * token.h: Likewise.
8706 * workqueue.cc: Likewise.
8707 * workqueue.h: Likewise.
8708 * x86_64.cc: Likewise.
8709
a0351a69
DK
87102009-12-10 Doug Kwan <dougkwan@google.com>
8711
8712 * arm.cc (attributes.h): New include.
8713 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
8714 (Arm_relobj::~Arm_relobj): Delete object pointed by
8715 attributes_section_data_.
8716 (Arm_relobj::attributes_section_data): New method definition.
8717 (Arm_relobj::attributes_section_data_): New data member declaration.
8718 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
8719 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
8720 attributes_section_data_.
8721 (Arm_dynobj::attributes_section_data): New method definition.
8722 (Arm_dynobj::attributes_section_data_): New data member declaration.
8723 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
8724 initialization value of may_use_blx_ to false.
2e702c99 8725 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
8726 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
8727 object attributes to compute results instead of hard-coding.
8728 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
8729 Target_arm::get_secondary_compatible_arch,
8730 Target_arm::set_secondary_compatible_arch
8731 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
8732 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
8733 New method declarations.
8734 (Target_arm::get_aeabi_object_attribute): New method definition.
8735 (Target_arm::attributes_section_data_): New data member declaration.
8736 (read_arm_attributes_section): New template definition.
8737 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
8738 (Arm_dynobj::do_read_symbols): Ditto.
8739 (Target_arm::do_finalize_sections): Merge attributes sections from
8740 input. Check for BLX use after attributes section merging.
8741 Fix __exidx_start and __exidx_end visibility. Create an
8742 .ARM.attributes section if necessary.
8743 (Target_arm::get_secondary_compatible_arch,
8744 Target_arm::set_secondary_compatible_arch,
8745 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
8746 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 8747 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
8748 New method definitions.
8749
b59befec
ILT
87502009-12-09 Ian Lance Taylor <iant@google.com>
8751
8752 * plugin.cc (Plugin::load): Don't cast from void* to a function
8753 pointer.
8754
1276bc89
ILT
87552009-12-09 Ian Lance Taylor <iant@google.com>
8756
8757 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
8758 information fields.
8759
2f2de248
L
87602009-12-09 H.J. Lu <hongjiu.lu@intel.com>
8761
8762 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
8763 Replace two_file_shared_1.so with two_file_shared_2.so.
8764 * testsuite/Makefile.in: Regenerated.
8765
4f787271
DK
87662009-12-08 Doug Kwan <dougkwan@google.com>
8767
8768 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
8769 (HFILES): Add attributes.h and int_encoding.h.
8770 * Makefile.in: Regenerate.
8771 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
8772 function definitions to int_encoding.cc
8773 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
8774 prototypes to int_encoding.h
8775 * reduced_debug_output.cc (int_encoding.h): New include.
8776 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
8777 function definitions to int_encoding.cc
8778 (insert_into_vector, read_from_pointer): Move template definitions to
8779 int_encoding.h
8780 * attributes.cc: New file.
8781 * attributes.h: New file.
8782 * int_encoding.cc: New file.
8783 * int_encoding.h: New file.
8784
20b52f1a
RÁE
87852009-12-07 Rafael Avila de Espindola <espindola@google.com>
8786
8787 PR gold/11055
8788 * incremental-dump.cc (dump_incremental_inputs): New.
8789 (main): Use dump_incremental_inputs.
8790
53d7974c
L
87912009-12-07 H.J. Lu <hongjiu.lu@intel.com>
8792
8793 PR gold/10893
8794 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
8795 checking elfcpp::STT_FUNC.
8796 (Target_i386::Relocate::relocate): Likewise.
8797 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
8798
8799 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
8800 symbols from shared libraries into normal FUNC symbols.
8801
8802 * symtab.h (Symbol): Add is_func and use it.
8803
05a352e6
DK
88042009-12-05 Doug Kwan <dougkwan@google.com>
8805
8806 * arm.cc (Target_arm::arm_info): Initialize new fields
8807 attributes_section and attributes_vendor.
8808 * i386.cc (Target_i386::i386_info): Same.
8809 * object.cc (Sized_relobj::do_layout): Skip attribute section.
8810 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
8811 fields attributes_section and attributes_vendor.
53d7974c 8812 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
8813 * target.h (Target::attributes_section, Target::attributes_vendor,
8814 Target::is_attributes_section, Target::attribute_arg_type,
8815 Target::attributes_order): New method definitions.
8816 (Target::Target_info::attributes_section,
8817 Target::Target_info::attributes_vendor): New fields.
8818 (Target::do_attribute_arg_type, Target::do_attributes_order): New
8819 virtual method definitions.
8820 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
8821 attributes_section and attributes_vendor.
8822 * testsuite/testfile.cc (Target_test::test_target_info): Same.
8823
f4e5969c
DK
88242009-12-05 Doug Kwan <dougkwan@google.com>
8825
8826 * arm.cc: Update comments about interworking and stub generation.
8827 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
8828 considered as non-PIC.
8829 (Arm_relocate_functions::base_abs): Fix formatting.
8830 (Arm_relocate_functions::got_prel): Fix comment. Change interface
8831 of function to use GOT entry address instead of offset.
8832 (Target_arm::Scan::global): Issue an error if a symbol would need a
8833 PLT does not get one because it is untyped. Remove code to create
8834 dynamic symbols for relative branches.
8835 (Target_arm::Relocate::relocate: Use 0 instead of false since function
8836 takes unsigned integer instead of boolean.
8837
1abce4a6
L
88382009-12-05 H.J. Lu <hongjiu.lu@intel.com>
8839
8840 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
8841 (two_file_test_LDADD): Likewise.
8842 (common_test_1_LDADD): Likewise.
8843 (exception_test_LDADD) Likewise.
8844 (weak_test_LDADD): Likewise.
8845 (many_sections_test_LDADD): Likewise.
8846 (initpri1_LDADD): Likewise.
8847 (script_test_1_LDADD): Likewise.
8848 (script_test_2_LDADD): Likewise.
8849 (justsyms_LDADD): Likewise.
8850 (binary_test_LDADD): Likewise.
8851 (large_LDADD): Likewise.
8852 * testsuite/Makefile.in: Regenerated.
8853
adcf2816 88542009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 8855
adcf2816
L
8856 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
8857 (Symbol_table::override_with_special): Likewise.
8858 (Symbol_table::add_from_object): Likewise.
8859
28e67f5d
RÁE
88602009-12-04 Rafael Avila de Espindola <espindola@google.com>
8861
8862 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
8863 Don't set the data_offset twice.
8864
ae10a101
RÁE
88652009-12-04 Rafael Avila de Espindola <espindola@google.com>
8866
8867 * testsuite/Makefile.in: Regenerate.
8868
f59f41f3
DK
88692009-12-03 Doug Kwan <dougkwan@google.com>
8870
8871 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
8872 (Target_arm::do_finalize_sections): Add parameter for symbol table
8873 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
8874 * i386.cc (Target_i386::do_finalize_sections): Add an additional
8875 parameter for symbol table pointer.
8876 * layout.cc (Layout::finalize): Call Target::finalize_sections with
8877 an additional parameter for a pointer to symbol table.
8878 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
8879 parameter for a symbol table pointer.
8880 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
8881 * target.h (Target::finalize_sections, Target::do_finalize_sections):
8882 Ditto.
8883 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
8884 parameter for a symbol table pointer.
8885
ca55d848
RÁE
88862009-12-03 Rafael Avila de Espindola <espindola@google.com>
8887
8888 * incremental.cc (Incremental_inputs_header)
8889 (Incremental_inputs_header_write, Incremental_inputs_entry)
8890 (Incremental_inputs_entry_write): Move ...
8891 * incremental.h (Incremental_inputs_header)
8892 (Incremental_inputs_header_write, Incremental_inputs_entry)
8893 (Incremental_inputs_entry_write): here.
8894
3aec4f9c
RÁE
88952009-12-02 Rafael Avila de Espindola <espindola@google.com>
8896
8897 * incremental.cc (make_sized_incremental_binary): Set the target.
8898 Error if it is incompatible.
8899 * output.h (Output_file): Add filename method.
8900
9c0ae74d
RÁE
89012009-12-02 Rafael Avila de Espindola <espindola@google.com>
8902
8903 * incremental.cc (Incremental_inputs_entry): Remove unused argument
8904 from the get_* methods.
8905
a45500ae
RÁE
89062009-12-02 Rafael Avila de Espindola <espindola@google.com>
8907
8908 * incremental-dump.cc (main): Check that the offeset of a script is 0.
8909 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
8910 Write 0 for the data_offset of scripts.
8911
325e6408
RÁE
89122009-12-02 Rafael Avila de Espindola <espindola@google.com>
8913
8914 * testsuite/Makefile.am: Add the incremental_test.sh test.
8915 * testsuite/incremental_test.sh: New.
8916 * testsuite/incremental_test_1.c: New.
8917 * testsuite/incremental_test_2.c: New.
8918
954c3e2e
RÁE
89192009-12-01 Rafael Avila de Espindola <espindola@google.com>
8920
703d02da 8921 * incremental-dump.cc (main): Fix typos.
954c3e2e 8922
f8086623
RÁE
89232009-11-27 Rafael Avila de Espindola <espindola@google.com>
8924
8925 PR gold/11025
8926 * incremental-dump.cc (main): Use llu to print 64 bit values.
8927
3b0dd6ac
L
89282009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
8929 H.J. Lu <hongjiu.lu@intel.com>
8930
8931 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
8932 $(LIBDL).
8933 (incremental_dump_LDADD): Likewise.
8934 * Makefile.in: Regenerated.
8935
a6d1ef57 89362009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 8937
a6d1ef57
DK
8938 Revert:
8939
8940 2009-11-25 Doug Kwan <dougkwan@google.com>
8941
8942 * arm.cc (Target_arm::Target_arm): Move method definition
8943 outside of class definition. Add code to handle
8944 --target1-rel, --target1-abs and --target2= options.
8945 (Target_arm::get_reloc_reloc_type): Change method to be
8946 non-static and const.
8947 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
8948 New data member declaration.
8949 (Target_arm::Scan::local, Target_arm::Scan::global,
8950 Target_arm::Relocate::relocate,
8951 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8952 Adjust call to Target_arm::get_real_reloc_type.
8953 (Target_arm::get_real_reloc_type): Use command line options
8954 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8955 * options.h (--target1-rel, --target1-abs, --target2): New
8956 ARM-only options.
8957
50aeb7d4
DK
89582009-11-25 Doug Kwan <dougkwan@google.com>
8959
8960 * arm.cc (Target_arm::Target_arm): Move method definition outside of
8961 class definition. Add code to handle --target1-rel, --target1-abs
8962 and --target2= options.
8963 (Target_arm::get_reloc_reloc_type): Change method to be non-static
8964 and const.
8965 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
8966 member declaration.
8967 (Target_arm::Scan::local, Target_arm::Scan::global,
8968 Target_arm::Relocate::relocate,
8969 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
8970 call to Target_arm::get_real_reloc_type.
8971 (Target_arm::get_real_reloc_type): Use command line options to
8972 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8973 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
8974 options.
8975
51938283
DK
89762009-11-25 Doug Kwan <dougkwan@google.com>
8977
8978 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
8979 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
8980 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
8981 formatting.
8982 (Arm_relocate_functions::thm_call): Replace body with a call to
8983 Arm_relocate_functions::thumb_branch_common.
8984 (Arm_relocate_functions::thm_jump24,
8985 Arm_relocate_functions::thm_xpc22): New method definitions.
8986 (Arm_relocate_functions::thumb_branch_common): New method definition.
8987 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
8988 operator.
8989 (Target_arm::Relocate::relocate): Adjust call to thm_call.
8990 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
8991
e2b8f3c4
RÁE
89922009-11-24 Rafael Avila de Espindola <espindola@google.com>
8993
8994 * Makefile.am: Build incremental-dump
8995 * Makefile.in: Regenerate.
8996 * incremental-dump.cc: New.
8997 * incremental.cc (Incremental_inputs_header_data,
8998 Incremental_inputs_entry_data): Move to incremental.h
8999 * incremental.h: (Incremental_inputs_header_data,
9000 Incremental_inputs_entry_data): Move from incremental.cc
9001
bcba9aec
RÁE
90022009-11-24 Rafael Avila de Espindola <espindola@google.com>
9003
9004 * incremental.cc (Incremental_inputs_header,
9005 Incremental_inputs_header_write, Incremental_inputs_entry,
9006 Incremental_inputs_entry_write): Add a typedef with the data type.
9007
7c3afe08
RÁE
90082009-11-24 Rafael Avila de Espindola <espindola@google.com>
9009
9010 * incremental.cc (Incremental_inputs_header,
9011 Incremental_inputs_header_write, Incremental_inputs_entry,
9012 Incremental_inputs_entry_write): Update comment about which
9013 type has the filed descriptions.
9014
d204b6e9
DK
90152009-11-15 Doug Kwan <dougkwan@google.com>
9016
9017 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
9018 (Arm_relocate_functions::arm_branch_common): Change method defintion
9019 in class definition to a method declaration and update list of formal
9020 parameters.
9021 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
9022 Arm_relocation_functions::jump24): Adjust call to
9023 Arm_relocate_functions::arm_branch_common. Update list of formal
9024 parameters.
9025 (Arm_relocate_functions::xpc25): New method definition.
9026 (Arm_relocate_functions::arm_branch_common): Move method defintion
9027 out from class definition. Use stubs for mode-switching and extending
9028 branch ranges.
9029 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
9030 specially. Change code to enable use of stubs in ARM branches.
9031
43d12afe
DK
90322009-11-10 Doug Kwan <dougkwan@google.com>
9033
9034 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
9035 in method declaration.
9036 (Target_arm::relocate_stub): New method declaration.
9037 (Target_arm::default_target): Change to return a pointer instead of
9038 a const reference.
9039 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
9040 Target_arm::default_target.
9041 (Arm_Relobj::do_relocate_sections): Remove options paramater in
9042 method definition.
9043 (Target_arm::relocate_section): Adjust view.
9044 (Target_arm::relocate_stub): New method definition.
9045
ac33a407
DK
90462009-11-10 Doug Kwan <dougkwan@google.com>
9047
9048 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
9049 a format warning.
9050 * incremental.cc (open_incremental_binary): Initialized local
9051 variables to avoid warnings.
9052 * object.cc (make_elf_object): Ditto.
9053 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
9054 a format warning.
e1df38aa 9055
88ee28e9
L
9056009-11-09 H.J. Lu <hongjiu.lu@intel.com>
9057
9058 PR gold/10930
9059 * testsuite/plugin_test.c: Include "config.h".
9060
2daedcd6
DK
90612009-11-09 Doug Kwan <dougkwan@google.com>
9062
9063 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
9064 (arm_symbol_value): Remove.
9065 (Arm_relocate_functions::arm_branch_common,
9066 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
9067 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
9068 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
9069 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
9070 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
9071 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
9072 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
9073 Arm_relocate_functions::thm_mobw_abs_nc,
9074 Arm_relocate_functions::thm_mov_abs,
9075 Arm_relocate_functions::movw_prel_nc,
9076 Arm_relocate_functions::thm_movt_abs,
9077 Arm_relocate_functions::movt_prel,
9078 Arm_relocate_functions::thm_movw_prel_nc,
9079 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
9080 (Target_arm::Relocate::relocate): Only decompose address into two
9081 parts if relocation type uses the thumb-bit and pass the actual
9082 bit instead of a flag indicating that the thumb-bit is used. Adjust
9083 calls to methods in Arm_relocate_functions for this change.
9084
1276bc89 90852009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
9086
9087 PR 10925
9088 * reloc.cc: Instantiate
9089 Sized_relobj::initialize_input_to_output_maps and
9090 Sized_relobj:free_input_to_output_maps.
9091
e53ad1b5
ILT
90922009-11-06 Ian Lance Taylor <iant@google.com>
9093
9094 PR 10876
9095 * defstd.cc (in_segment): Set only_if_ref true for "end".
9096
eb44217c
DK
90972009-11-06 Doug Kwan <dougkwan@google.com>
9098
9099 * arm.cc (class Reloc_stub): Correct a comment.
9100 (Target_arm::Target_arm): Initialize arm_input_section_map_.
9101 (Target_arm::scan_section_for_stubs): New method declaration.
9102 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
9103 Change methods from private to protected.
9104 (Target_arm::do_may_relax): New method definition.
9105 (Target_arm::do_relax, Target_arm::group_sections,
9106 Target_arm::scan_reloc_for_stub,
9107 Target_arm::scan_reloc_section_for_stubs): New method declarations.
9108 (Target_arm::arm_input_section_map_): New data member declaration.
9109 (Target_arm::scan_reloc_for_stub,
9110 Target_arm::scan_reloc_section_for_stubs,
9111 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
9112 Target_arm::do_relax): New method definitions.
9113
5d329b7d
ILT
91142009-11-06 Mikolaj Zalewski <mikolaj@google.com>
9115
9116 * configure.ac: Check for (struct stat)::st_mtim
9117 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
9118 * config.in: Regenerate.
9119 * configure: Regenerate.
9120
96a0d71b
ILT
91212009-11-05 Ian Lance Taylor <iant@google.com>
9122
9123 PR 10910
9124 * output.cc (Output_segment::add_output_section): Add missing
9125 return statement.
9126
594c8e5e
ILT
91272009-11-04 Ian Lance Taylor <iant@google.com>
9128
9129 PR 10880
9130 * object.h (class Object): Add is_needed and set_is_needed
9131 methods. Add is_needed_ field. Make bool fields into bitfields.
9132 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
9133 defined in a dynamic object and referenced by a regular object,
9134 set is_needed for the dynamic object.
9135 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
9136 if the file is marked with as_needed and it is not needed.
9137
22b127cc
ILT
91382009-11-04 Ian Lance Taylor <iant@google.com>
9139
9140 PR 10887
9141 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
9142 tags if data is discarded by linker script.
9143 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9144 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
9145 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
9146 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9147
f5c870d2
ILT
91482009-11-04 Ian Lance Taylor <iant@google.com>
9149
9150 * layout.cc (Layout::get_output_section): Add is_interp and
9151 is_dynamic_linker_section parameters. Change all callers.
9152 (Layout::choose_output_section): Likewise.
9153 (Layout::make_output_section): Likewise.
9154 (Layout::add_output_section_data): Add is_dynamic_linker_section
9155 parameter. Change all callers.
9156 * layout.h (class Layout): Update declarations.
9157 * output.h (class Output_section): Add is_interp, set_is_interp,
9158 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
9159 Add is_interp_, is_dynamic_linker_section_ fields. Change
9160 generate_code_fills_at_write_ to a bitfield.
9161 * output.cc (Output_section::Output_sections): Initialize new
9162 fields.
9163 (Output_segment::add_output_section): Add do_sort parameter.
9164 Change all callers.
9165
1ae4d23b
ILT
91662009-11-03 Ian Lance Taylor <iant@google.com>
9167
9168 PR 10860
9169 * options.h (class General_options): Add --warn-common.
9170 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
9171 merging two common symbols.
9172 (Symbol_table::should_override): Handle --warn-common when merging
9173 a common symbol with a defined symbol. Use report_resolve_problem
9174 for multiple definitions.
9175 (Symbol_table::report_resolve_problem): New function.
9176 * symtab.h (class Symbol_table): Declare report_resolve_problem.
9177
55da9579
DK
91782009-11-03 Doug Kwan <dougkwan@google.com>
9179
9180 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
9181 stub_factory_.
9182 (Target_arm::stub_factory): New method definition.
9183 (Target_arm::new_arm_input_section,
9184 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
9185 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 9186 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
9187 New type definitions.
9188 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
9189 member declarations.
9190 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
9191 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
9192 New method definitions.
9193
37a9ac43
ILT
91942009-11-03 Ian Lance Taylor <iant@google.com>
9195
9196 * options.h (class General_options): Add --warn_constructors.
9197
b3d6a3d4
ILT
91982009-11-03 Ian Lance Taylor <iant@google.com>
9199
9200 PR 10893
9201 * defstd.cc (in_section): Add entries for __rel_iplt_start,
9202 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
9203
934b01dd
ILT
92042009-11-03 Ian Lance Taylor <iant@google.com>
9205
9206 PR 10895
9207 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
9208 --msgid-bugs-address.
9209 (install-pdf): New target.
9210 (install-data_yes): Look up one directory to find mkinstalldirs.
9211
03c1939b
L
92122009-11-03 H.J. Lu <hongjiu.lu@intel.com>
9213
9214 * po/Make-in (.po.gmo): Don't generate .gmo files in source
9215 tree.
9216
ebd95253
DK
92172009-10-30 Doug Kwan <dougkwan@google.com>
9218
9219 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
9220
e9bbb538
DK
92212009-10-30 Doug Kwan <dougkwan@google.com>
9222
9223 * arm.cc (Stub_addend_reader): New struct template definition
9224 and partial specializations.
9225 (Stub_addend_reader::operator()): New method definition for a
9226 partially specialized template.
9227
d5b40221
DK
92282009-10-30 Doug Kwan <dougkwan@google.com>
9229
9230 * arm.cc (Arm_relobj::processor_specific_flags): New method
9231 definition.
9232 (Arm_relobj::do_read_symbols): New method declaration.
9233 (Arm_relobj::processor_specific_flags_): New data member declaration.
9234 (Arm_dynobj): New class definition.
9235 (Target_arm::do_finalize_sections): Add input_objects parameter.
9236 (Target_arm::do_adjust_elf_header): New method declaration.
9237 (Target_arm::are_eabi_versions_compatible,
9238 (Target_arm::merge_processor_specific_flags): New method declaration.
9239 (Target_arm::do_make_elf_object): New overloaded method definitions
9240 and declaration.
9241 (Arm_relobj::do_read_symbols): New method definition.
9242 (Arm_dynobj::do_read_symbols): Ditto.
9243 (Target_arm::do_finalize_sections): Add input_objects parameters.
9244 Merge processor-specific flags from all input objects.
9245 (Target_arm::are_eabi_versions_compatible,
9246 Target_arm::merge_processor_specific_flags,
9247 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
9248 New method definitions.
9249 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
9250 Input_objects pointer type parameter.
9251 * layout.cc (Layout::finalize): Pass input objects to target's.
9252 finalize_sections function.
9253 * output.cc (Output_file_header::do_sized_write): Set ELF file
9254 header's processor-specific flags.
9255 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
9256 Input_objects pointer type parameter.
9257 * sparc.cc (Target_sparc::do_finalize_sections): Same.
9258 * target.h (Input_objects): New forward class declaration.
9259 (Target::processor_specific_flags,
9260 Target::are_processor_specific_flags_sect): New method definitions.
9261 (Target::finalize_sections): Add input_objects parameter.
9262 (Target::Target): Initialize processor_specific_flags_ and
9263 are_processor_specific_flags_set_.
9264 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
9265 parameter.
9266 (Target::set_processor_specific_flags): New method definition.
9267 (Target::processor_specific_flags_,
9268 Target::are_processor_specific_flags_set_): New data member
9269 declarations.
9270 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
9271 Input_objects pointer type parameter.
9272
ebabffbd
DK
92732009-10-30 Doug Kwan <dougkwan@google.com>
9274
9275 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
9276
ad0f2072
ILT
92772009-10-28 Ian Lance Taylor <iant@google.com>
9278
9279 * object.h (class Relobj): Drop options parameter from
9280 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
9281 do_scan_relocs, do_relocate. Change all callers.
9282 (class Sized_relobj): Drop options parameters from
9283 do_gc_process_relocs, do_scan_relocs, do_relocate,
9284 do_relocate_sections, relocate_sections, emit_relocs_scan,
9285 emit_relocs_scan_reltype. Change all callers.
9286 (struct Relocate_info): Remove options field and all references to
9287 it.
9288 * reloc.h (class Read_relocs): Remove options constructor
9289 parameter and options_ field. Change all callers.
9290 (class Gc_process_relocs, class Scan_relocs): Likewise.
9291 (class Relocate_task): Likewise.
9292 * target-reloc.h (scan_relocs): Remove options parameter. Change
9293 all callers.
9294 (scan_relocatable_relocs): Likewise.
9295 * target.h (class Sized_target): Remove options parameter from
9296 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
9297 all callers.
9298 * gc.h (gc_process_relocs): Remove options parameter. Change all
9299 callers.
9300 * arm.cc: Update functions to remove options parameters.
9301 * i386.cc: Likewise.
9302 * powerpc.cc: Likewise.
9303 * sparc.cc: Likewise.
9304 * x86_64.cc: Likewise.
9305 * testsuite/testfile.cc: Likewise.
9306
8ffa3667
DK
93072009-10-28 Doug Kwan <dougkwan@google.com>
9308
9309 * arm.cc (Arm_relobj): New class definition.
e1df38aa 9310 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
9311 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
9312 New method definitions.
9313
40f36857
CC
93142009-10-28 Cary Coutant <ccoutant@google.com>
9315
9316 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
9317 (Plugin::cleanup_done_): New member.
9318 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
9319 (Plugin_manager::cleanup_done_): Remove.
9320 (Plugin_manager::add_input_file): Edit error message.
9321 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
9322 (Plugin_manager::cleanup): Remove use of cleanup_done_.
9323
2c849493
ILT
93242009-10-27 Mikolaj Zalewski <mikolajz@google.com>
9325
9326 * fileread.cc: (File_read::View::~View): Use the new
9327 data_ownership_ filed.
9328 (File_read::~File_read): Dispose the new whole_file_view_.
9329 (File_read::open): Mmap the whole file if needed.
9330 (File_read::open): Use whole_file_view_ instead of contents_.
9331 (File_read::find_view): Use whole_file_view_ if applicable.
9332 (File_read::do_read): Use whole_file_view_ instead of contents_.
9333 (File_read::make_view): Use whole_file_view_ instead of contents_,
9334 update File_read::View::View call.
9335 (File_read::find_or_make_view): Update File_read::View::View
9336 call.
9337 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
9338 remove contents_
9339 (File_read::View::Data_ownership): New enum.
9340 (File_read::View::View): Replace bool mapped_ with Data_ownership
9341 argument.
9342 (File_read::View::mapped_): Remove (replaced by data_ownership_).
9343 (File_read::View::data_ownership_): New field.
9344 (File_read::contents_): Remove (replaced by whole_file_view_).
9345 (File_read::whole_file_view_): New field.
9346 * options.h (class General_options): Add --keep-files-mapped.
9347
24998053
CC
93482009-10-27 Cary Coutant <ccoutant@google.com>
9349
9350 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
9351 * testsuite/Makefile.am (plugin_test_5): New test case.
9352 * testsuite/Makefile.in: Regenerate.
9353
72adc4fa
DK
93542009-10-25 Doug Kwan <dougkwan@google.com>
9355
9356 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
9357 from private to protected to allow access by child class.
9358 (Sized_relobj::do_relocate_sections): New method declaration.
9359 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 9360 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
9361 Sized_relobj::relocate_sections. Instantiate template explicitly
9362 for different target sizes and endianity.
9363
07f508a2
DK
93642009-10-24 Doug Kwan <dougkwan@google.com>
9365
9366 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
9367 (Arm_input_section::as_arm_input_section): New method.
9368 (Arm_output_section): New class definition.
9369 (Arm_output_section::create_stub_group,
9370 Arm_output_section::group_sections): New method definitions.
9371
10ad9fe5
DK
93722009-10-22 Doug Kwan <dougkwan@google.com>
9373
9374 * arm.cc (Arm_input_section): New class definition.
9375 (Arm_input_section::init, Arm_input_section:do_write,
9376 Arm_input_section::set_final_data_size,
9377 Arm_input_section::do_reset_address_and_file_offset): New method
9378 definitions.
9379
56ee5e00
DK
93802009-10-21 Doug Kwan <dougkwan@google.com>
9381
9382 * arm.cc (Stub_table, Arm_input_section): New forward class
9383 declarations.
9384 (Stub_table): New class defintion.
9385 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
9386 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
9387 New method definition.
9388
b569affa
DK
93892009-10-21 Doug Kwan <dougkwan@google.com>
9390
9391 * arm.cc: Update copyright comments.
9392 (Target_arm): New forward class template declaration.
9393 (Arm_address): New type.
9394 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
9395 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
9396 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
9397 constants.
9398 (Insn_template): Same.
9399 (DEF_STUBS): New macro.
9400 (Stub_type): New enum type.
9401 (Stub_template): New class definition.
9402 (Stub): Same.
9403 (Reloc_stub): Same.
9404 (Stub_factory): Same.
9405 (Target_arm::Target_arm): Initialize may_use_blx_ and
9406 should_force_pic_veneer_.
9407 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
9408 Target_arm::should_force_pic_veneer,
9409 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
9410 Target_arm::using_thumb_only, Target_arm:;default_target): New
9411 method defintions.
9412 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
9413 New data member declarations.
9414 (Insn_template::size, Insn_template::alignment): New method defintions.
9415 (Stub_template::Stub_template): New method definition.
9416 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
9417 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
9418 (Stub_factory::Stub_factory): New method definition.
9419 * gold.h (string_hash): New template.
9420 * output.h (Input_section_specifier::hash_value): Use
9421 gold::string_hash.
9422 (Input_section_specifier::string_hash): Remove.
9423 * stringpool.cc (Stringpool_template::string_hash): Use
9424 gold::string_hash.
9425
6c172549
DK
94262009-10-20 Doug Kwan <dougkwan@google.com>
9427
9428 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
9429 symbols of relaxed input sections.
9430 * output.h (Output_section::find_relaxed_input_section): Make
9431 method public.
9432
c5617f2f
DK
94332009-10-16 Doug Kwan <dougkwan@google.com>
9434
9435 * dynobj.cc (Versions::Versions): Initialize version_script_.
9436 Only insert base version symbol definition for a shared object
9437 if version script defines any version versions.
9438 (Versions::define_base_version): New method definition.
9439 (Versions::add_def): Check that base version is not needed.
9440 (Versions::add_need): Define base version lazily.
9441 * dynobj.h (Versions::define_base_version): New method declaration.
9442 (Versions::needs_base_version_): New data member declaration.
9443 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
9444 (check_DATA): Add no_version_test.stdout.
9445 (libno_version_test.so, no_version_test.o no_version_test.stdout):
9446 New make rules.
9447 * testsuite/Makefile.in: Regenerate.
9448 * testsuite/no_version_test.c: New file.
9449 * testsuite/no_version_test.sh: Ditto.
9450
3c12dcdb
DK
94512009-10-16 Doug Kwan <dougkwan@google.com>
9452
9453 * expression.cc (class Segment_start_expression): New class definition.
9454 (Segment_start_expression::value): New method definition.
9455 (script_exp_function_segment_start): Return a new
9456 Segment_start_expression.
9457 * gold/script-c.h (script_saw_segment_start_expression): New function
9458 prototype.
9459 * script-sections.cc (Script_sections::Script_sections): Initialize
9460 SAW_SEGMENT_START_EXPRESSION_ to false.
9461 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
9462 and -Tbbs options to specify section addresses if given in
9463 command line and no SEGMENT_START expression is seen in a script.
9464 * script-sections.h (Script_sections::saw_segment_start_expression,
9465 Script_sections::set_saw_segment_start_expression): New method
9466 definition.
9467 (Script_sections::saw_segment_start_expression_): New data member
9468 declaration.
9469 * script.cc (script_saw_segment_start_expression): New function.
9470 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
9471 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
9472 script_test_7.sh and script_test_8.sh.
9473 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
9474 script_test_8.stdout.
9475 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
9476 (script_test_6, script_test_6.stdout, script_test_7,
9477 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
9478 * Makefile.in: Regenerate.
9479 * testsuite/script_test_6.sh: New file.
9480 * testsuite/script_test_6.t: Same.
9481 * testsuite/script_test_7.sh: Same.
9482 * testsuite/script_test_7.t: Same.
9483 * testsuite/script_test_8.sh: Same.
9484
64b1ae37
DK
94852009-10-16 Doug Kwan <dougkwan@google.com>
9486
9487 * output.cc (Output_segment::set_section_list_address): Cast
9488 expressions to unsigned long long type to avoid format warnings.
9489
661be1e2
ILT
94902009-10-15 Ian Lance Taylor <iant@google.com>
9491
12edd763 9492 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 9493 dot assignment to script_sections_.
12edd763
ILT
9494 * script-sections.cc (Script_sections::add_dot_assignment):
9495 Initialize if necessary.
9496
68b6574b
ILT
9497 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
9498 program headers with no load segment if there is a linker script.
9499
661be1e2
ILT
9500 * layout.cc (Layout::set_segment_offsets): Align the file offset
9501 to the segment aligment for -N or -n with no load segment.
9502 * output.cc (Output_segment::add_output_section): Don't crash if
9503 the first section is a TLS section.
9504 (Output_segment::set_section_list_addresses): Print an error
9505 message if the address moves backward in a linker script.
9506 * script-sections.cc
9507 (Output_section_element_input::set_section_addresses): Don't
9508 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
9509 (Orphan_output_section::set_section_addresses): Likewise.
9510
f15f61a7
DK
95112009-10-15 Doug Kwan <dougkwan@google.com>
9512
9513 * layout.cc (Layout::finish_dynamic_section): Generate tags
9514 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
9515 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
9516 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
9517
82bb573a
ILT
95182009-10-14 Ian Lance Taylor <iant@google.com>
9519
9520 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
9521 fields.
9522 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
9523 data_shdr fields of relinfo.
9524 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
9525 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
9526 R_386_TLS_LDO_32, adjust based on section flags.
9527 (Target_i386::Relocate::fix_up_ldo): Remove.
9528
374ad285
ILT
95292009-10-13 Ian Lance Taylor <iant@google.com>
9530
9531 Add support for -pie.
9532 * options.h (class General_options): Add -pie and
9533 --pic-executable.
9534 (General_options::output_is_position_independent): Test -pie.
9535 (General_options::output_is_executable): Return true if not shared
9536 and not relocatable.
9537 (General_options::output_is_pie): Remove.
9538 * options.cc (General_options::finalize): Reject incompatible uses
9539 of -pie.
9540 * gold.cc (queue_middle_tasks): A -pie link is not static.
9541 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
9542 * symtab.cc (Symbol::final_value_is_known): Return false if
9543 output_is_position_independent.
9544 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
9545 output_is_position_independent.
9546 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
9547 output_is_position_independent.
9548 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
9549 output_is_position_independent.
9550 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
9551 two_file_pie_test.
9552 (basic_pie_test.o, basic_pie_test): New targets.
9553 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
9554 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
9555 (two_file_pie_test): New target.
9556 * testsuite/Makefile.in: Rebuild.
9557 * README: Remove note saying that -pie is not supported.
9558
c6585162
ILT
95592009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
9560
9561 * options.h (class General_options): Add -init and -fini.
9562 * layout.cc (Layout::finish_dynamic_section): Emit
9563 given init and fini functions.
9564
032ce4e9
ST
95652009-10-13 Sriraman Tallam <tmsriram@google.com>
9566
9567 * gc.h (gc_process_relocs): Check if icf is enabled using new
9568 function.
9569 * gold.cc (queue_initial_tasks): Likewise.
9570 (queue_middle_tasks): Likewise.
9571 * object.cc (do_layout): Likewise.
9572 * symtab.cc (is_section_folded): Likewise.
9573 * main.cc (main): Likewise.
9574 * reloc.cc (Read_relocs::run): Likewise.
9575 (Sized_relobj::do_scan_relocs): Likewise.
9576 * icf.cc (is_function_ctor_or_dtor): New function.
9577 (Icf::find_identical_sections): Check if function is ctor or dtor when
9578 safe icf is chosen.
9579 * options.h (General_options::icf): Change option to be an enum.
9580 (Icf_status): New enum.
9581 (icf_enabled): New method.
9582 (icf_safe_folding): New method.
9583 (set_icf_status): New method.
9584 (icf_status_): New variable.
9585 * (options.cc) (General_options::finalize): Set icf_status_.
9586 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
9587 icf_test and icf_keep_unique_test to use the --icf enum flag.
9588 * testsuite/icf_safe_test.sh: New file.
e1df38aa 9589 * testsuite/icf_safe_test.cc: New file.
032ce4e9 9590
f345227a
ST
95912009-10-12 Sriraman Tallam <tmsriram@google.com>
9592
9593 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
9594 includes to gc.h and icf.h.
9595 * arm.cc: Include gc.h.
9596 * gold.cc: Likewise.
9597 * i386.cc: Likewise.
9598 * powerpc.cc: Likewise.
9599 * sparc.cc: Likewise.
9600 * x86_64.cc: Likewise.
9601 * gc.h: Include icf.h.
9602
1c7814ed
ILT
96032009-10-11 Ian Lance Taylor <iant@google.com>
9604
9605 * plugin.cc: Include "gold.h" before other header files.
9606
ae3b5189
CD
96072009-10-10 Chris Demetriou <cgd@google.com>
9608
9609 * options.h (Input_file_argument::Input_file_type): New enum.
9610 (Input_file_argument::is_lib_): Replace with...
9611 (Input_file_argument::type_): New member.
9612 (Input_file_argument::Input_file_argument): Take Input_file_type
9613 'type' rather than boolean 'is_lib' as second argument.
9614 (Input_file_argument::is_lib): Use type_.
9615 (Input_file_argument::is_searched_file): New function.
9616 (Input_file_argument::may_need_search): Handle is_searched_file.
9617 * options.cc (General_options::parse_library): Support -l:filename.
9618 (General_options::parse_just_symbols): Update for Input_file_argument
9619 changes.
9620 (Command_line::process): Likewise.
9621 * archive.cc (Archive::get_file_and_offset): Likewise.
9622 * plugin.cc (Plugin_manager::release_input_file): Likewise.
9623 * script.cc (read_script_file, script_add_file): Likewise.
9624 * fileread.cc (Input_file::Input_file): Likewise.
9625 (Input_file::will_search_for): Handle is_searched_file.
9626 (Input_file::open): Likewise.
9627 * readsyms.cc (Read_symbols::get_name): Likewise.
9628 * testsuite/Makefile.am (searched_file_test): New test.
9629 * testsuite/Makefile.in: Regenerate.
9630 * testsuite/searched_file_test.cc: New file.
9631 * testsuite/searched_file_test_lib.cc: New file.
9632
f3048a1d
ILT
96332009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9634 Ian Lance Taylor <iant@google.com>
9635
9636 * descriptor.cc: Include <cstdio> and "binary-io.h".
9637 (Descriptors::open): Open the files in binary mode always.
9638 * script.cc (Lex::get_token): Treat \r as whitespace.
9639
d4780e57
ILT
96402009-10-09 Ian Lance Taylor <iant@google.com>
9641
9642 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
9643
d9a893b8
ILT
96442009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9645 Ian Lance Taylor <iant@google.com>
9646
9647 * configure.ac: Check for readv function also.
9648 * fileread.cc (readv): Define if not HAVE_READV.
9649 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
9650 does not exist.
9651 * config.in: Regenerate.
9652 * configure: Regenerate.
9653
c0a62865
DK
96542009-10-09 Doug Kwan <dougkwan@google.com>
9655
9656 * layout.cc (Layout::make_output_section): Call target hook to make
9657 ordinary output section.
9658 (Layout::finalize): Adjust parameter list of call the
9659 Target::may_relax().
9660 * layout.h (class Layout::section_list): New method.
9661 * merge.h (Output_merge_base::entsize): Change visibility to public.
9662 (Output_merge_base::is_string, Output_merge_base::do_is_string):
9663 New methods.
9664 (Output_merge_string::do_is_string): New method.
9665 * object.cc (Sized_relobj::do_setup): renamed from
9666 Sized_relobj::set_up.
9667 * object.h (Sized_relobj::adjust_shndx,
9668 Sized_relobj::initializ_input_to_output_maps,
9669 Sized_relobj::free_input_to_output_maps): Change visibilities to
9670 protected.
9671 (Sized_relobj::setup): Virtualize.
9672 (Sized_relobj::do_setup): New method declaration.
9673 (Sized_relobj::invalidate_section_offset,
9674 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
9675 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
9676 * options.cc (parse_int): New function.
9677 * options.h (parse_int): New declaration.
9678 (DEFINE_int): New macro.
9679 (stub_group_size): New option.
9680 * output.cc (Output_section::Output_section): Initialize memebers
9681 merge_section_map_, merge_section_by_properties_map_,
9682 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
9683 (Output_section::add_input_section): Handled deferred code-fill
9684 generation and remove an old comment.
9685 (Output_section::add_relaxed_input_section): New method definition.
9686 (Output_section::add_merge_input_section): Use merge section by
9687 properties map to speed to search. Update merge section maps
9688 as appropriate.
9689 (Output_section::build_relaxation_map): New method definition.
9690 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
9691 Same.
9692 (Output_section::relax_input_section): Renamed to
9693 Output_section::convert_input_sections_to_relaxed_sections and change
9694 interface to take a vector of pointers to relaxed sections.
9695 (Output_section::find_merge_section,
9696 Output_section::find_relaxed_input_section): New method definitions.
9697 (Output_section::is_input_address_mapped,
9698 Output_section::output_offset, Output_section::output_address):
9699 Use output section data maps to speed up searching.
9700 (Output_section::find_starting_output_address): Add comments.
9701 (Output_section::do_write,
9702 Output_section::write_to_postprocessing_buffer): Do code-fill
9703 generation as appropriate.
9704 (Output_section::get_input_sections): Invalidate relaxed input section
9705 map.
9706 (Output_section::restore_states): Adjust type of checkpoint .
9707 Invalidate relaxed input section map.
9708 * output.h (Output_merge_base): New class declaration.
9709 (Input_section_specifier): New class defintion.
9710 (class Output_relaxed_input_section) Change base class to
9711 Output_section_data_build.
9712 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
9713 base class initializer.
9714 (Output_section::add_relaxed_input_section): New method declaration.
9715 (Output_section::Input_section): Change visibility to protected.
2e702c99 9716 (Output_section::Input_section::relobj,
c0a62865
DK
9717 Output_section::Input_section::shndx): Handle relaxed input sections.
9718 Output_section::input_sections) Change visibility to protected. Also
9719 define overload to return a non-const pointer.
9720 (Output_section::Merge_section_properties): New class defintion.
9721 (Output_section::Merge_section_by_properties_map,
9722 Output_section::Output_section_data_by_input_section_map,
9723 Output_section::Relaxation_map): New types.
9724 (Output_section::relax_input_section): Rename method to
9725 Output_section::convert_input_sections_to_relaxed_sections and change
9726 interface to take a vector of relaxed section pointers.
9727 (Output_section::find_merge_section,
9728 Output_section::find_relaxed_input_section,
9729 Output_section::build_relaxation_map,
9730 Output_section::convert_input_sections_in_list_to_relaxed_sections):
9731 New method declarations.
9732 (Output_section::merge_section_map_
9733 Output_section::merge_section_by_properties_map_,
9734 Output_section::relaxed_input_section_map_,
9735 Output_section::is_relaxed_input_section_map_valid_,
9736 Output_section::generate_code_fills_at_write_): New data members.
9737 * script-sections.cc
9738 (Output_section_element_input::set_section_addresses): Call
9739 current_data_size and addralign methods of relaxed input sections.
9740 (Orphan_output_section::set_section_addresses): Call current_data_size
9741 and addralign methods of relaxed input sections.
9742 * symtab.cc (Symbol_table::compute_final_value): Extract template
9743 from the body of Symbol_table::sized_finalize_symbol.
9744 (Symbol_table::sized_finalized_symbol): Call
9745 Symbol_table::compute_final_value.
9746 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
9747 (Symbol_table::compute_final_value): New templated method declaration.
9748 * target.cc (Target::do_make_output_section): New method defintion.
9749 * target.h (Target::make_output_section): New method declaration.
9750 (Target::relax): Add more parameters for input objects, symbol table
9751 and layout. Adjust call to do_relax.
9752 (Target::do_make_output_section): New method declaration.
9753 (Target::do_relax): Add parameters for input objects, symbol table
9754 and layout.
9755
d446d6c4
ILT
97562009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9757
9758 * pread.c: Include stdio.h.
9759
bc06c745
ILT
97602009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9761
9762 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
9763 defined.
9764
75aea3d0
ILT
97652009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9766
9767 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
9768 Change read_shndx type to unsigned int.
9769 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
9770 int.
9771 (Sized_dwarf_line_info::read_line_mappings): Likewise.
9772 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
9773 Change read_shndx type to unsigned int.
9774 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
9775 int.
9776 (Sized_dwarf_line_info::read_line_mappings): Likewise.
9777 * layout.cc (Layout::create_symtab_sections): Cast the result of
9778 local_symcount * symsize to off_t in the gold_assert.
9779
be8fcb75
ILT
97802009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9781
9782 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
9783 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
9784 R_ARM_BASE_ABS.
9785 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
9786 (Arm_relocate_functions::thm_abs5): New function.
9787 (Arm_relocate_functions::abs12): New function.
9788 (Arm_relocate_functions::abs16): New function.
9789 (Arm_relocate_functions::base_abs): New function.
9790 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
9791 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
9792 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
9793 R_ARM_BASE_ABS.
9794 (Scan::global): Likewise.
9795 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
9796 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
9797 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
9798 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
9799 R_ARM_BASE_ABS.
9800
c2a122b6
ILT
98012009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9802
9803 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
9804 (Arm_relocate_functions::movt_prel): New function.
9805 (Arm_relocate_functions::thm_movw_prel_nc): New function.
9806 (Arm_relocate_functions::thm_movt_prel): New function.
9807 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
9808 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
9809 (Scan::global, Relocate::relocate): Likewise.
9810 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9811
c4aa1e2d
ILT
98122009-10-09 Mikolaj Zalewski <mikolajz@google.com>
9813
9814 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
9815 Incremental_checker.
9816 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
9817 unsigned int.
9818 (class Incremental_inputs_header): New class.
9819 (Incremental_inputs_header_writer): Edit comment.
9820 (Incremental_inputs_entry): New class.
9821 (Incremental_inputs_entry_writer): Edit comment.
9822 (Sized_incremental_binary::do_find_incremental_inputs_section):
9823 Add *strtab_shndx parameter, fill it.
9824 (Sized_incremental_binary::do_check_inputs): New method.
9825 (Incremental_checker::can_incrementally_link_output_file): Use
9826 Sized_incremental_binary::check_inputs.
9827 (Incremental_inputs::report_command_line): Save command line in
9828 command_line_.
9829 * incremental.h:
9830 (Incremental_binary::find_incremental_inputs_section): New
9831 method.
9832 (Incremental_binary::do_find_incremental_inputs_section): Add
9833 strtab_shndx parameter.
9834 (Incremental_binary::do_check_inputs): New pure virtual method.
9835 (Sized_incremental_binary::do_check_inputs): Declare.
9836 (Incremental_checker::Incremental_checker): Add incremental_inputs
9837 parameter, use it to initialize incremental_inputs_.
9838 (Incremental_checker::incremental_inputs_): New field.
9839 (Incremental_checker::command_line): New method.
9840 (Incremental_checker::inputs): New method.
9841 (Incremental_checker::command_line_): New field.
9842
c549a694
ILT
98432009-10-09 Mikolaj Zalewski <mikolajz@google.com>
9844
9845 * incremental.cc: Include <cstdarg> and "target-select.h".
9846 (vexplain_no_incremental): New function.
9847 (explain_no_incremental): New function.
9848 (Incremental_binary::error): New method.
9849 (Sized_incremental_binary::do_find_incremental_inputs_section): New
9850 method.
9851 (make_sized_incremental_binary): New function.
9852 (open_incremental_binary): New function.
9853 (can_incrementally_link_file): Add checks if output is ELF and has
9854 inputs section.
9855 * incremental.h: Include "elfcpp_file.h" and "output.h".
9856 (Incremental_binary): New class.
9857 (Sized_incremental_binary): New class.
9858 (open_incremental_binary): Declare.
9859 * object.cc (is_elf_object): Use
9860 elfcpp::Elf_recognizer::is_elf_file.
9861 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
9862 * output.h (Output_file::filesize): New method.
9863
fd3c5f0b
ILT
98642009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9865
9866 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
9867 New function.
9868 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
9869 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
9870 function.
9871 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
9872 function.
9873 (Arm_relocate_functions::movw_abs_nc): New function.
9874 (Arm_relocate_functions::movt_abs): New function.
9875 (Arm_relocate_functions::thm_movw_abs_nc): New function.
9876 (Arm_relocate_functions::thm_movt_abs): New function.
9877 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
9878 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
9879 (Scan::global): Likewise.
9880 (Relocate::relocate): Likewise.
9881 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9882
7f5309a5
ILT
98832009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9884
9885 * arm.cc (Arm_relocate_functions::got_prel) New function.
9886 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
9887 (Relocate::relocate): Likewise.
9888 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9889
364c7fa5
ILT
98902009-10-06 Ian Lance Taylor <iant@google.com>
9891
9892 * options.h (class General_options): Define
9893 split_stack_adjust_size parameter.
9894 * object.h (class Object): Add uses_split_stack_ and
9895 has_no_split_stack_ fields. Add uses_split_stack and
9896 has_no_split_stack accessor functions. Declare
9897 handle_split_stack_section.
9898 (class Reloc_symbol_changes): Define.
9899 (class Sized_relobj): Define Function_offsets. Declare
9900 split_stack_adjust, split_stack_adjust_reltype, and
9901 find_functions.
9902 * object.cc (Object::handle_split_stack_section): New function.
9903 (Sized_relobj::do_layout): Call handle_split_stack_section.
9904 * dynobj.cc (Sized_dynobj::do_layout): Call
9905 handle_split_stack_section.
9906 * reloc.cc (Sized_relobj::relocate_sections): Call
9907 split_stack_adjust for executable sections in split_stack
9908 objects. Pass reloc_map to relocate_section.
9909 (Sized_relobj::split_stack_adjust): New function.
9910 (Sized_relobj::split_stack_adjust_reltype): New function.
9911 (Sized_relobj::find_functions): New function.
9912 * target-reloc.h: Include "object.h".
9913 (relocate_section): Add reloc_symbol_changes parameter. Change
9914 all callers.
9915 * target.h (class Target): Add calls_non_split method. Declare
9916 do_calls_non_split virtual method. Declare match_view and
9917 set_view_to_nop.
9918 * target.cc: Include "elfcpp.h".
9919 (Target::do_calls_non_split): New function.
9920 (Target::match_view): New function.
9921 (Target::set_view_to_nop): New function.
9922 * gold.cc (queue_middle_tasks): Give an error if mixing
9923 split-stack and non-split-stack objects with -r.
9924 * i386.cc (Target_i386::relocate_section): Add
9925 reloc_symbol_changes parameter.
9926 (Target_i386::do_calls_non_split): New function.
9927 * x86_64.cc (Target_x86_64::relocate_section): Add
9928 reloc_symbol_changes parameter.
9929 (Target_x86_64::do_calls_non_split): New function.
9930 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
9931 parameter.
9932 * powerpc.cc (Target_powerpc::relocate_section): Add
9933 reloc_symbol_changes parameter.
9934 * sparc.cc (Target_sparc::relocate_section): Add
9935 reloc_symbol_changes parameter.
9936 * configure.ac: Call AM_CONDITIONAL for the default target.
9937 * configure: Rebuild.
9938 * testsuite/Makefile.am (TEST_AS): New variable.
9939 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
9940 (check_DATA): Add split_i386 and split_x86_64 files.
9941 (SPLIT_DEFSYMS): Define.
9942 (split_i386_[1234n].o): New targets.
9943 (split_i386_[124]): New targets.
9944 (split_i386_[1234r].stdout): New targets.
9945 (split_x86_64_[1234n].o): New targets.
9946 (split_x86_64_[124]): New targets.
9947 (split_x86_64_[1234r].stdout): New targets.
9948 (MOSTLYCLEANFILES): Add new executables.
9949 * testsuite/split_i386.sh: New file.
9950 * testsuite/split_x86_64.sh: New file.
9951 * testsuite/split_i386_1.s: New file.
9952 * testsuite/split_i386_2.s: New file.
9953 * testsuite/split_i386_3.s: New file.
9954 * testsuite/split_i386_4.s: New file.
9955 * testsuite/split_i386_n.s: New file.
9956 * testsuite/split_x86_64_1.s: New file.
9957 * testsuite/split_x86_64_2.s: New file.
9958 * testsuite/split_x86_64_3.s: New file.
9959 * testsuite/split_x86_64_4.s: New file.
9960 * testsuite/split_x86_64_n.s: New file.
9961 * testsuite/testfile.cc (Target_test): Update relocation_section
9962 function.
9963 * testsuite/Makefile.in: Rebuild.
9964
e8a9fcda
ILT
99652009-10-06 Ian Lance Taylor <iant@google.com>
9966
9967 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
9968 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
9969 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
9970 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
9971 the address on ldo_addrs_.
9972 (Target_i386::Relocate::fix_up_ldo): New function.
9973
e99daf92
ILT
99742009-10-06 Rafael Espindola <espindola@google.com>
9975
9976 * plugin.cc (add_input_library): New.
9977 (Plugin::load): Add add_input_library to tv.
9978 (Plugin_manager::add_input_file): Add the is_lib argument.
9979 (add_input_file): Update call to Plugin_manager::add_input_file.
9980 (add_input_library): New.
9981 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
9982
966d4097
DK
99832009-09-30 Doug Kwan <dougkwan@google.com>
9984
9985 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
9986 symbol and call Symbol::may_need_copy_reloc to determine if
9987 a copy reloc is needed.
9988 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
9989 nocopyreloc is given in command line.
9990 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
9991 given in command line.
9992 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
9993 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
9994 of the removed Target_i386::may_need_copy_reloc.
9995 * options.h (copyreloc): New option with default value false.
9996 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9997 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
9998 instead of the removed Target_powerpc::may_need_copy_reloc.
9999 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
10000 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
10001 instead of the removed Target_sparc::may_need_copy_reloc.
10002 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
10003 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
10004 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
10005 instead of the removed Target_x86_64::may_need_copy_reloc.
10006
029ba973
ILT
100072009-09-30 Ian Lance Taylor <iant@google.com>
10008
10009 * object.h (class Object): Remove target_ field, and target,
10010 sized_target, and set_target methods.
10011 (Object::sized_target): Remove.
10012 (class Sized_relobj): Update declarations. Remove sized_target.
10013 * object.cc (Sized_relobj::setup): Remove target parameter.
10014 Change all callers.
10015 (Input_objects::add_object): Don't do anything with the target.
10016 (make_elf_sized_object): Add punconfigured parameter. Change all
10017 callers. Set or test parameter target.
10018 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
10019 Change all callers.
10020 * parameters.cc (Parameters::set_target): Change parameter type to
10021 be non-const.
10022 (Parameters::default_target): Remove.
10023 (set_parameters_target): Change parameter type to be non-const.
10024 (parameters_force_valid_target): New function.
10025 (parameters_clear_target): New function.
10026 * parameters.h (class Parameters): Update declarations. Remove
10027 default_target method. Add sized_target and clear_target
10028 methods. Change target_ to be non-const.
10029 (set_parameters_target): Update declaration.
10030 (parameters_force_valid_target): Declare.
10031 (parameters_clear_target): Declare.
10032 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
10033 as NULL if we aren't searching.
10034 (Add_symbols::run): Don't check for compatible target.
10035 * fileread.cc (Input_file::open_binary): Call
10036 parameters_force_valid_target.
10037 * gold.cc (queue_middle_tasks): Likewise.
10038 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
10039 set_target on object.
10040 * dynobj.h (class Sized_dynobj): Update declarations.
10041 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
10042 make_elf_object returns NULL.
10043 (Archive::include_member): Don't check whether object target is
10044 compatible.
10045 * output.cc (Output_section::add_input_section): Get target from
10046 parameters.
10047 (Output_section::relax_input_section): Likewise.
10048 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
10049 parameters.
10050 (Sized_relobj::do_scan_relocs): Likewise.
10051 (Sized_relobj::relocate_sections): Likewise.
10052 * resolve.cc (Symbol_table::resolve): Likewise.
10053 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
10054 parameter. Change all callers.
10055 (Symbol_table::add_from_object): Get target from parameters.
10056 (Symbol_table::add_from_relobj): Don't check object target.
10057 (Symbol_table::add_from_dynobj): Likewise.
10058 (Symbol_table::define_special_symbol): Get target from
10059 parameters.
10060 * symtab.h (class Symbol_table): Update declaration.
10061 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
10062 parameter. Change all callers. Clear parameter target.
10063 (Binary_test): Test target here.
10064 * testsuite/object_unittest.cc (gold_testsuite): Remove
10065 target_test_pointer parameter. Change all callers.
10066 (Object_test): Test target here.
10067
a6a22b83
ILT
100682009-09-26 Ian Lance Taylor <iant@google.com>
10069
10070 * testsuite/initpri1.c: Don't try to use constructor priorities if
10071 compiling with gcc before 4.3.
10072
6a8f49fe
ILT
100732009-09-22 Mikolaj Zalewski <mikolajz@google.com>
10074
10075 * testsuite/retain_symbols_file_test.sh (check_present): Change
10076 output file name to retain_symbols_file_test.stdout.
10077 (check_absent): Likewise.
10078
8c604651
CS
100792009-09-18 Craig Silverstein <csilvers@google.com>
10080
10081 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
10082 * options.cc: Include <cerrno> and <fstream>.
10083 (General_options::finalize): Parse -retain-symbols-file tag.
10084 * options.h: New flag.
10085 (General_options): New method should_retain_symbol, new
10086 variable symbols_to_retain.
10087 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
10088 should_retain_symbol map.
10089 * testsuite/Makefile.am (retain_symbols_file_test): New test.
10090 * testsuite/Makefile.in: Regenerate.
10091 * testsuite/retain_symbols_file_test.sh: New file.
10092
ca58b19f
NC
100932009-09-18 Nick Clifton <nickc@redhat.com>
10094
10095 * po/es.po: Updated Spanish translation.
10096
20e6d0d6
DK
100972009-09-17 Doug Kwan <dougkwan@google.com>
10098
10099 * debug.h (DEBUG_RELAXATION): New constant.
10100 (DEBUG_ALL): Add DEBUG_RELAXATION.
10101 (debug_string_to_enum): Add relaxation debug option.
10102 * layout.cc
10103 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
10104 Layout::Relaxation_debug_check::read_sections,
10105 Layout::Relaxation_debug_check::read_sections): New method definitions.
10106 (Layout::Layout): Initialize data members
10107 record_output_section_data_from_scrips_,
10108 script_output_section_data_list_ and relaxation_debug_check_.
10109 (Layout::save_segments, Layout::restore_segments,
10110 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
10111 Layout::relaxation_loop_body): New method definitions.
10112 (Layout::finalize): Support relaxation. Move section layout code to
10113 Layout::relaxation_loop_body.
10114 (Layout::set_asection_address_from_script): Move code for orphan
10115 section placement out.
10116 (Layout::place_orphan_sections_in_script): New method definition.
10117 * layout.h (Output_segment_headers, Output_file_header):
10118 New forward class declarations.
10119 (Layout::~Layout): Define.
10120 (Layout::new_output_section_data_from_script): New method definition.
10121 (Layout::place_orphan_sections_in_script): New method declaration.
10122 (Layout::Segment_states): New type declaration.
10123 (Layout::save_segments, Layout::restore_segments,
10124 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
10125 Layout::relaxation_loop_body): New method declarations.
10126 (Layout::Output_section_data_list): New type declaration.
10127 (Layout::Relaxation_debug_check): New class definition.
10128 (Layout::record_output_section_data_from_script_,
10129 Layout::script_output_section_data_list_, Layout::segment_states_,
10130 Layout::relaxation_debug_check_): New data members.
10131 * output.cc: (Output_section_headers::do_size): New method definition.
10132 (Output_section_headers::Output_section_headers): Move size
10133 computation to Output_section_headers::do_size.
10134 (Output_segment_headers::do_size): New method definition.
e1df38aa 10135 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
10136 Output_file_header::do_size and call it.
10137 (Output_file_header::do_size): New method definition.
10138 (Output_data_group::Output_data_group): Adjust call to
10139 Output_section_data.
10140 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
10141 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 10142 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
10143 RELAXED_INPUT_SECTION_CODE.
10144 (Output_section::Output_section): Initialize data member checkpoint_.
10145 (Output_section::~Output_section): Delete checkpoint object pointed
10146 by checkpoint_.
10147 (Output_section::add_input_section): Always add an Input_section if
10148 relaxing.
10149 (Output_section::add_merge_input_section): Add assert.
10150 (Output_section::relax_input_section): New method definition.
10151 (Output_section::set_final_data_size): Set load address to zero for
10152 an unallocated section.
10153 (Output_section::do_address_and_file_offset_have_reset_values):
10154 New method definition.
10155 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
10156 Handle relaxed input section.
10157 (Output_section::sort_attached_input_sections): Checkpoint input
10158 section list lazily.
10159 (Output_section::get_input_sections): Change type of input_sections to
10160 list of Simple_input_section pointers. Checkpoint input section list
10161 lazily. Also handle relaxed input sections.
10162 (Output_section::add_input_section_for_script): Take a reference to
10163 a Simple_input_section object instead of Relobj pointer and section
10164 index as parameter. Handle relaxed input sections.
10165 (Output_section::save_states, Output_section::restore_states): New
10166 method definitions.
10167 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
10168 (Output_data::is_data_size_fixed): New method definition.
10169 (Output_data::reset_addresss_and_file_offset): Do not reset data size
10170 if it is fixed.
10171 (Output_data::address_and_file_offset_have_reset_values): New method
10172 definition.
10173 (Output_data::do_address_and_file_offset_have_reset_values): New method
10174 definition.
10175 (Output_data::set_data_size): Check that data size is not fixed.
10176 (Output_data::fix_data_size): New method definition.
10177 (Output_data::is_data_size_fixed_): New data member.
10178 (Output_section_headers::set_final_data_size): New method definition.
10179 (Output_section_headers::do_size): New method declaration.
10180 (Output_segment_headers::set_final_data_size): New method definition.
10181 (Output_segment_headers::do_size): New method declaration.
10182 (Output_file_header::set_final_data_size)::New method definition.
10183 (Output_file_header::do_size)::New method declaration.
10184 (Output_section_data::Output_section_data): Add new parameter
10185 is_data_size_fixed and use it to fix data size.
10186 (Output_data_const::Output_data_const): Adjust call to base class
10187 constructor and fix data size.
10188 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
10189 base class constructor and fix data size.
10190 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
10191 base class constructor and fix data size.
10192 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
10193 class constructor and fix data size.
10194 (Output_data_group::set_final_data_size): New method definition.
10195 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
10196 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
10197 class constructor and fix data size.
10198 (Output_relaxed_input_section): New class definition.
10199 (Output_section::Simple_input_section): New class definition.
10200 (Output_section::get_input_sections): Adjust parameter list.
10201 (Output_section::add_input_section_for_script): Same.
10202 (Output_section::save_states, Output_section::restore_states,
10203 Output_section::do_address_and_file_offset_have_reset_values,
10204 (Output_section::Input_section::Input_section): Handle
10205 RELAXED_INPUT_SECTION_CODE. Add new overload for
10206 Output_relaxed_input_section.
10207 (Output_section::Input_section::is_input_section,
10208 Output_section::Input_section::set_output_section): Handle relaxed
10209 input section.
10210 (Output_section::Input_section::is_relaxed_input_section,
10211 Output_section::Input_section::output_section_data,
10212 Output_section::Input_section::relaxed_input_section): New method
10213 definitions.
10214 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
10215 value.
10216 (Output_section::Input_section::u1_): Update comments.
10217 (Output_section::Input_section::u2_): Add new union member poris.
10218 (Output_section::Checkpoint_output_section): New classs definition.
10219 (Output_section::relax_input_section): New method declaration.
10220 (Output_section::checkpoint_): New data member.
10221 (Output_segment): Update comments.
10222 (Output_segment::Output_segment): Un-privatize copy constructor.
10223 (Output_segment::operator=): Un-privatize.
10224 * script-sections.cc (Output_section_element::Input_section_list):
10225 Change element type to Output_section::Simple_input_section.
10226 (Output_section_element_dot_assignment::set_section_addresses):
10227 Register output section data for relaxation clean up.
10228 (Output_data_exression::Output_data_expression): Adjust call to base
10229 constructor to fix data size.
10230 (Output_section_element_data::set_section_addresses): Register
10231 Output_data_expression object for relaxation clean up.
10232 (struct Input_section_info): Replace Relobj pointer and section index
10233 pair with Output_section::Simple_input_section and Convert struct to a
10234 class.
10235 (Input_section_sorter::operator()): Adjust access to
e1df38aa 10236 Input_section_info data member to use accessors.
20e6d0d6
DK
10237 (Output_section_element_input::set_section_addresses): Use layout
10238 parameter. Adjust code to use Output_section::Simple_input_section
10239 and Input_secction_info classes. Register filler for relaxation
10240 clean up.
10241 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
10242 and section index pair with Output_section::Simple_input_section
10243 class. Adjust code accordingly.
10244 (Phdrs_element::release_segment): New method definition.
10245 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
10246 segment list.
10247 (Script_sections::release_segments): New method definition.
10248 * gold/script-sections.h (Script_sections::release_segments): New
10249 method declaration.
10250 * gold/target.h (Target::may_relax, Target::relax,
10251 Target::do_may_relax, Target::do_relax): New method definitions.
10252
5e445df6
ILT
102532009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10254
10255 * arm.cc (has_signed_unsigned_overflow): New function.
10256 (Arm_relocate_functions::abs8): New function.
10257 (Target_arm::Scan::local): Handle R_ARM_ABS8.
10258 (Target_arm::Scan::global): Likewise.
10259 (Target_arm::relocate::relocate): Likewise.
10260 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10261 Likewise.
10262
8c604651 102632009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
10264
10265 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
10266 * testsuite/Makefile.in: Regenerate.
10267
1e9cc1c2
NC
102682009-09-11 Nick Clifton <nickc@redhat.com>
10269
10270 * po/gold.pot: Updated by the Translation project.
10271
6a89f575
CC
102722009-09-08 Cary Coutant <ccoutant@google.com>
10273
10274 * output.cc (Output_file::open): Add execute permission to empty file.
10275 * testsuite/Makefile.am (permission_test): New test.
10276 * testsuite/Makefile.in: Regenerate.
10277
fdcac5af
ILT
102782009-09-02 Ian Lance Taylor <iant@google.com>
10279
10280 * output.cc (Output_file::resize): Call map_no_anonymous rather
10281 than map.
10282
44453f85
ILT
102832009-09-01 Mikolaj Zalewski <mikolajz@google.com>
10284
10285 * gold.cc: Include "incremental.h".
10286 (queue_initial_tasks): Call Incremental_checker methods.
10287 * incremental.cc: Include "output.h".
10288 (Incremental_checker::can_incrementally_link_output_file): New
10289 method.
10290 * incremental.h (Incremental_checker): New class.
10291
10292 * output.cc (Output_file::open_for_modification): New method.
10293 (Output_file::map_anonymous): Changed return type to bool. Record
10294 map in base_ field.
10295 (Output_file::map_no_anonymous): New method, broken out of map.
10296 (Output_file::map): Use map_no_anonymous and map_anonymous.
10297 * output.h (class Output_file): Update declarations.
10298
293c1386
CC
102992009-08-24 Cary Coutant <ccoutant@google.com>
10300
10301 * options.h (Command_line::Pre_options): New class.
10302 (Command_line::pre_options): New member.
10303 * options.cc (gold::options::ready_to_register): New variable.
10304 (One_option::register_option): Do nothing if not registering options.
10305 Assert if same short option registered twice.
10306 (General_options::General_options): Turn off option registration when
10307 done constructing.
10308 (Command_line::Pre_options::Pre_options): New constructor.
10309
f773f3d2
CC
103102009-08-24 Cary Coutant <ccoutant@google.com>
10311
06a73cfe
CC
10312 * options.h (General_options::no_keep_memory): Remove incorrect
10313 short option.
f773f3d2 10314
a15af8e2
RW
103152009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10316
10317 * Makefile.am (am__skiplex, am__skipyacc): New.
10318 * Makefile.in: Regenerate.
10319
c462b41b
RW
103202009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10321
14ec8efd
RW
10322 * Makefile.am (AM_CPPFLAGS): Renamed from ...
10323 (INCLUDES): ... this.
10324 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
10325 (AM_CPPFLAGS): Renamed from ...
10326 (INCLUDE): ... this.
10327 * Makefile.in, testsuite/Makefile.in: Regenerate.
10328
81ecdfbb
RW
10329 * Makefile.in: Regenerate.
10330 * aclocal.m4: Likewise.
10331 * config.in: Likewise.
10332 * configure: Likewise.
10333 * testsuite/Makefile.in: Likewise.
10334
c462b41b
RW
10335 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
10336 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
10337 * Makefile.in: Regenerate.
10338 * testsuite/Makefile.in: Regenerate.
10339
2da73f13
CC
103402009-08-19 Cary Coutant <ccoutant@google.com>
10341
10342 * resolve.cc (Symbol_table::resolve): Don't complain about defined
10343 symbols in shared libraries overridden by hidden or internal symbols
10344 in the main program.
10345
2db70501
CD
103462009-08-19 Chris Demetriou <cgd@google.com>
10347
10348 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
10349 checking source file names in error messages.
10350
f733487b
DK
103512009-08-18 Doug Kwan <dougkwan@google.com>
10352
10353 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
10354 an elcpp::Ehdr as parameter. Adjust call to set_target.
10355 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
10356 an elfcpp::Ehdr as parameter.
10357 * object.cc (Object::set_target): Remove the version that looks up
10358 a target and sets it.
10359 (Sized_relobj::setup): Take a Target object instead of
10360 an elfcpp::Ehdr as parameter. Adjust call to set_target.
10361 (make_elf_sized_object): Find target and ask target to
10362 make an ELF object.
10363 * object.h: (Object::set_target): Remove the version that looks up
10364 a target and sets it.
10365 (Sized_relobj::setup): Take a Target object instead of
10366 an elfcpp:Ehdr as parameter.
10367 * target.cc: Include dynobj.h.
10368 (Target::do_make_elf_object_implementation): New.
2e702c99 10369 (Target::do_make_elf_object): New.
f733487b
DK
10370 * target.h (Target::make_elf_object): New template declaration.
10371 (Target::do_make_elf_object): New method declarations.
10372 (Target::do_make_elf_object_implementation): New template declaration.
10373
cc70f101
ILT
103742009-08-14 Ian Lance Taylor <iant@google.com>
10375
10376 * gold.h (FUNCTION_NAME): Define.
10377 (gold_unreachable): Use FUNCTION_NAME.
10378
ef5e0cb1
ST
103792009-08-12 Sriraman Tallam <tmsriram@google.com>
10380
10381 * icf.cc (Icf::find_identical_sections): Issue a warning when a
10382 symbol in the --keep-unique list is not found.
10383
48c187ce
ST
103842009-08-12 Sriraman Tallam <tmsriram@google.com>
10385
10386 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
10387 been maked as --keep-unique.
10388 (Icf::unfold_section): New function.
10389 * icf.h (Icf::unfold_section): New function.
10390 * options.h (General_options::keep_unique): New option.
10391 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
10392 * testsuite/Makefile.in: Regenerate.
10393 * testsuite/icf_keep_unique_test.sh: New file.
10394 * testsuite/icf_keep_unique_test.cc: New file.
10395
645afe0c
CC
103962009-08-12 Cary Coutant <ccoutant@google.com>
10397
10398 PR 10471
10399 * resolve.cc (Symbol_table::resolve): Check for references from
10400 dynamic objects to hidden and internal symbols.
10401 * testsuite/Makefile.am (hidden_test.sh): New test.
10402 * testsuite/Makefile.in: Regenerate.
10403 * testsuite/hidden_test.sh: New script.
10404 * testsuite/hidden_test_1.c: New test source.
10405 * testsuite/hidden_test_main.c: New test source.
10406
11af873f
DK
104072009-08-11 Doug Kwan <dougkwan@google.com>
10408
10409 * arm.cc: Update comments.
10410 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
10411 segment to locate the .ARM.exidx section if present.
10412
b9f7d72d
DK
104132009-08-09 Doug Kwan <dougkwan@google.com>
10414
10415 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
10416 patch.
10417
ddd3c53c
ST
104182009-08-07 Sriraman Tallam <tmsriram@google.com>
10419 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
10420 compiler warnings.
10421
27721062
ST
104222009-08-06 Sriraman Tallam <tmsriram@google.com>
10423
10424 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
10425 valid tls_segment only for non-debug-section relocations.
10426 * testsuite/Makefile.am: Add gc_tls_test.
10427 * testsuite/Makefile.in: Regenerate.
10428 * testsuite/gc_tls_test.cc: New file.
10429 * testsuite/gc_tls_test.sh: New file.
10430
ef15dade 104312009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 10432
ef15dade
ST
10433 * icf.cc: New file.
10434 * icf.h: New file.
10435 * Makefile.am (CCFILES): Add icf.cc.
10436 (HFILES): Add icf.h
10437 * Makefile.in: Regenerate.
10438 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
10439 * gc.h (gc_process_relocs): Populate lists used by icf to contain
10440 section, symbol and addend information for the relocs.
10441 * gold.cc (queue_middle_tasks): Call identical code folding.
10442 * gold.h: Add defines for multimap.
10443 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
10444 to the call of finalize_local_symbols.
10445 * main.cc (main): Create object of class Icf.
10446 * object.cc (Sized_relobj::do_layout): Allow this function to be
10447 called twice during icf.
10448 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
10449 to sections marked as identical by icf.
10450 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
10451 when available.
10452 (Sized_relobj::do_section_entsize): New function.
10453 * object.h (Object::section_entsize): New function.
10454 (Object::do_section_entsize): New pure virtual function.
10455 (Relobj::finalize_local_symbols): Add new parameter.
10456 (Relobj::do_section_entsize): New function.
10457 * options.h (General_options::icf): New option.
10458 (General_options::icf_iterations): New option.
10459 (General_options::print_icf_sections): New option.
10460 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
10461 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
10462 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
10463 icf.
10464 * symtab.cc (Symbol_table::is_section_folded): New function.
10465 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
10466 to sections marked as identical by icf.
10467 * symtab.h (Symbol_table::set_icf): New function.
10468 (Symbol_table::icf): New function.
10469 (Symbol_table::is_section_folded): New function.
10470 (Symbol_table::icf_): New data member.
10471 * target-reloc.h (relocate_section): Ignore sections folded by icf.
10472 * testsuite/Makefile.am: Add commands to build icf_test.
10473 * testsuite/Makefile.in: Regenerate.
10474 * testsuite/icf_test.sh: New file.
10475 * testsuite/icf_test.cc: New file.
10476
c3b65ac4
CD
104772009-07-24 Chris Demetriou <cgd@google.com>
10478
10479 * layout.cc (is_compressible_debug_section): Fix incorrect
10480 comment about compressed section names.
10481
1caf2c51
ILT
104822009-07-20 Ian Lance Taylor <ian@airs.com>
10483
10484 PR 10419
10485 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
10486
1ef4d87f
ILT
104872009-07-16 Ian Lance Taylor <iant@google.com>
10488
10489 PR 10400
10490 * layout.h: #include <map>.
10491 (class Kept_section): Change from struct to class. Add accessors
10492 and setters. Add section size to Comdat_group mapping. Change
10493 Comdat_group to std::map. Add is_comdat_ field. Add
10494 linkonce_size field in union.
10495 (class Layout): Update declaration of find_or_add_kept_section.
10496 Don't declare find_kept_object.
10497 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
10498 parameter. Add object, shndx, is_comdat, and is_group_name
10499 parameters. Change all callers. Adjust for new Kept_section.
10500 (Layout::find_kept_object): Remove.
10501 * object.cc (Sized_relobj::include_section_group): Update use of
10502 Kept_section. Rename secnum to shndx. Only record
10503 Kept_comdat_section if sections are the same size.
10504 (Sized_relobj::include_linkonce_section): Update use of
10505 Kept_section. Only record Kept_comdat_section if sections are the
10506 same size. Set size of linkonce section.
10507 (Sized_relobj::map_to_kept_section): Update call to
10508 get_kept_comdat_section.
10509 * object.h (class Sized_relobj): Rename fields in
10510 Kept_comdat_section to drop trailing underscores; change object
10511 field to Relobj*. Change Kept_comdat_section_table to store
10512 struct rather than pointer.
10513 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
10514 Add kept_object and kept_shndx parameters. Change all callers.
10515 (Sized_relobj::get_kept_comdat_section): Change return type to
10516 bool. Add kept_object and kept_shndx parameters. Change all
10517 callers.
10518 * plugin.cc (Pluginobj::include_comdat_group): Update call to
10519 Layout::find_or_add_kept_section.
10520
37c3b7b0
ILT
105212009-07-09 Ian Lance Taylor <iant@google.com>
10522
10523 * merge.cc (Object_merge_map::initialize_input_to_output_map):
10524 Reserve space in the hash table.
10525
98fa85cb
ILT
105262009-07-06 Mikolaj Zalewski <mikolajz@google.com>
10527
10528 * fileread.cc (File_read::get_mtime): New method.
10529 * fileread.h (Timespec): New structure.
10530 (File_read::get_mtime): New method.
10531 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
10532 Renamed from timestamp_nsec.
10533 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
10534 Elf_Xword.
e1df38aa 10535 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 10536 timestamp_nsec.
e1df38aa 10537 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
10538 (Incremental_inputs::report_obejct): Save mtime; style fix.
10539 (Incremental_inputs::report_script): Save mtime; style fix.
10540 (Incremental_inputs::finalize_inputs): Style fix.
10541 (Incremental_inputs::finalize): Style fix.
10542 (Incremental_inputs::create_input_section_data): Store inputs
10543 mtime.
10544 * incremental.h (Incremental_inputs::report_script): Add mtime
10545 argument.
10546 (Incremental_inputs::Input_info::Input_info): Intialize only one
10547 union member.
10548 (Incremental_inputs::Input_info::archive): Move to nameless
10549 union.
10550 (Incremental_inputs::Input_info::obejct): Move to nameless union.
10551 (Incremental_inputs::Input_info::script): Move to nameless union.
10552 (Incremental_inputs::mtime): New field.
10553 * script.cc (read_input_script): Pass file mtime to
10554 Incremental_input.
10555 * script.h (Script_info::inputs): Style fix.
10556
c9d70757
ILT
105572009-07-01 Ian Lance Taylor <ian@airs.com>
10558
10559 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
10560 instead of 32.
10561
9c547ec3
ILT
105622009-06-24 Ian Lance Taylor <iant@google.com>
10563
10564 PR 10156
10565 * layout.cc (Layout::choose_output_section): If we find an
10566 existing section, update the flags.
10567 (Layout::create_notes): New function, broken out of
10568 Layout::finalize.
10569 (Layout::finalize): Don't create note sections.
10570 (Layout::create_note): Don't crash if linker script discards
10571 section.
10572 (Layout::create_gold_note): Likewise.
10573 (Layout::create_build_id): Likewise. Don't set
10574 after_input_sections on the section.
10575 (Layout::create_executable_stack_info): Remove target parameter.
10576 Change caller.
10577 * layout.h (class Layout): Declare create_notes. Update
10578 declaration of create_executable_stack_info.
10579 * gold.cc (queue_middle_tasks): Call create_notes.
10580 * output.cc (Output_section::update_flags_for_input_section): Move
10581 here from output.h. If SHF_ALLOC flag is newly set, mark address
10582 invalid.
10583 * output.h (Output_data::mark_address_invalid): New function.
10584 (class Output_section): Only declare, not define,
10585 update_flags_for_input_section. Remove set_flags.
10586
55458500
ILT
105872009-06-24 Ian Lance Taylor <iant@google.com>
10588
10589 * script-sections.cc (Output_section_definition::
10590 set_section_addresses): Rename shadowing local load_address to
10591 laddr.
10592
1307d6cd
ILT
105932009-06-24 Ian Lance Taylor <iant@google.com>
10594
10595 PR 10244
10596 * reloc.cc (relocate_sections): Skip empty relocation sections.
10597
ec3f783e
ILT
105982009-06-23 Ian Lance Taylor <iant@google.com>
10599
10600 PR 10156
10601 * layout.cc (Layout::create_note): Use choose_output_section
10602 rather than make_output_section.
10603
459c9f1c
ILT
106042009-06-23 Ian Lance Taylor <iant@google.com>
10605
10606 PR 10237
10607 * options.cc (General_options::parse_V): Set printed_version_.
10608 (General_options::General_options): Initialize printed_version_.
10609 * options.h (class General_options): Add printed_version_ field.
10610 * gold.cc (queue_initial_tasks): If there are no input files,
10611 don't give a fatal error if we printed the version information.
10612 (queue_middle_tasks): If using -r with a shared object, give a
10613 fatal error rather than an ordinary error.
10614
1518dc8f
ILT
106152009-06-23 Ian Lance Taylor <iant@google.com>
10616
10617 PR 10219
10618 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
10619 (Layout::make_output_section): Set have_stabstr_section_ if we see
10620 a .stab*str section.
10621 (Layout::finalize): Call link_stabs_sections.
10622 (Layout::link_stabs_sections): New file.
10623 * layout.h (class Layout): Add have_stabstr_section_ field.
10624 Declare link_stabs_sections.
10625
3d857b98
DK
106262009-06-23 Doug Kwan <dougkwan@google.com>
10627
10628 * Makefile.am (libgold_a_LIBADD): New.
10629 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 10630 * Makefile.in: Regenerate.
3d857b98
DK
10631 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
10632 * configure: Regenerate.
10633 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
10634 * fileread.cc: Include sys/state.h
10635 * gold.h: Declare memmem and strndup if found missing.
10636 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
10637
0639a6f6
ILT
106382009-06-23 Ian Lance Taylor <iant@google.com>
10639
10640 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
10641 * configure: Rebuild.
10642
8d63875c
ILT
106432009-06-23 Ian Lance Taylor <iant@google.com>
10644
10645 PR 10147
10646 * object.cc (Object::section_contents): Don't try to get a view if
10647 the section has length zero.
10648 (Object::handle_gnu_warning_section): If the section is empty, use
10649 the name of the section as the warning.
10650
f7c8a183
ILT
106512009-06-23 Ian Lance Taylor <iant@google.com>
10652
10653 PR 10133
10654 * stringpool.h (class Stringpool_template): Add optimize_ field.
10655 (Stringpool_template::set_optimize): New function.
10656 * stringpool.cc (Stringpool_template::Stringpool_template):
10657 Initialize optimize_ field.
10658 (Stringpool_template::set_string_offsets): Test local optimize
10659 fild rather than parameter.
10660 * layout.cc (Layout::Layout): Call set_optimize on the section
10661 name stringpool.
10662
e6a307ba
ILT
106632009-06-22 Ian Lance Taylor <iant@google.com>
10664
10665 PR 10030
10666 * yyscript.y: Parse TARGET.
10667 * script.cc (script_set_target): New function.
10668 * script-c.h (script_set_target): Declare.
10669 * options.cc (General_options::string_to_object_format): Rename
10670 from string_to_object_format in anonymous namespace. Change
10671 callers.
10672 * options.h (class General_options): Declare
10673 string_to_object_format.
10674
3ee173de
ILT
106752009-06-22 Ian Lance Taylor <iant@google.com>
10676
10677 * script-sections.cc (Script_sections::create_segments): Don't put
10678 program headers in a PT_LOAD segment if -n or -N.
10679
106802009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
10681
10682 PR 10141
10683 * options.h (class General_options): Add -z lazy and -z now. Sort
10684 -z options into alphabetical order.
10685 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
10686
cd6739a1 106872009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
10688
10689 * layout.cc (Layout::make_output_section): Call
10690 Target::new_output_section.
10691 (Layout::attach_allocated_section_to_segment): Put large section
10692 sections in a separate load segment with the large segment flag
10693 set.
10694 (Layout::segment_precedes): Sort large data segments after other
10695 load segments.
10696 (align_file_offset): New static function.
10697 (Layout::set_segment_offsets): Use align_file_offset.
10698 * output.h (class Output_section): Add is_small_section_ and
10699 is_large_section_ fields.
10700 (Output_section::is_small_section): New function.
10701 (Output_section::set_is_small_section): New function.
10702 (Output_section::is_large_section): New function.
10703 (Output_section::set_is_large_section): New function.
10704 (Output_section::is_large_data_section): New function.
10705 (class Output_segment): Add is_large_data_segment_ field.
10706 (Output_segment::is_large_data_segment): New function.
10707 (Output_segment::set_is_large_data_segment): New function.
10708 * output.cc (Output_section::Output_section): Initialize new
10709 fields.
10710 (Output_segment::Output_segment): Likewise.
10711 (Output_segment::add_output_section): Add assertion that large
10712 data sections always go in large data segments. Force small data
10713 sections to the end of the list of data sections. Force small BSS
10714 sections to the start of the list of BSS sections. For large BSS
10715 sections to the end of the list of BSS sections.
10716 * symtab.h (class Symbol): Declare is_common_shndx.
10717 (Symbol::is_defined): Check Symbol::is_common_shndx.
10718 (Symbol::is_common): Likewise.
10719 (class Symbol_table): Define enum Commons_section_type. Update
10720 declarations. Add small_commons_ and large_commons_ fields.
10721 * symtab.cc (Symbol::is_common_shndx): New function.
10722 (Symbol_table::Symbol_table): Initialize new fields.
10723 (Symbol_table::add_from_object): Put small and large common
10724 symbols in the right list.
10725 (Symbol_table::sized_finalized_symbol): Check
10726 Symbol::is_common_shndx.
10727 (Symbol_table::sized_write_globals): Likewise.
10728 * common.cc (Symbol_table::do_allocate_commons): Allocate new
10729 common symbol lists. Don't call do_allocate_commons_list if the
10730 list is empty.
10731 (Symbol_table::do_allocate_commons_list): Remove is_tls
10732 parameter. Add comons_section_type parameter. Change all
10733 callers. Handle small and large common symbols.
10734 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
10735 Symbol::is_common_shndx.
10736 * resolve.cc (symbol_to_bits): Likewise.
10737 * target.h (Target::small_common_shndx): New function.
10738 (Target::small_common_section_flags): New function.
10739 (Target::large_common_shndx): New function.
10740 (Target::large_common_section_flags): New function.
10741 (Target::new_output_section): New function.
10742 (Target::Target_info): Add small_common_shndx, large_common_shndx,
10743 small_common_section_flags, and large_common_section_flags
10744 fields.
10745 (Target::do_new_output_section): New virtual function.
10746 * arm.cc (Target_arm::arm_info): Initialize new fields.
10747 * i386.cc (Target_i386::i386_info): Likewise.
10748 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
10749 Likewise.
10750 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
10751 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
10752 (Target_x86_64::do_new_output_section): New function.
10753 * configure.ac: Define conditional MCMODEL_MEDIUM.
10754 * testsuite/Makefile.am (check_PROGRAMS): Add large.
10755 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
10756 (large_LDFLAGS): Define.
10757 * testsuite/large.c: New file.
10758 * testsuite/testfile.cc (Target_test::test_target_info):
10759 Initialize new fields.
10760 * configure, testsuite/Makefile.in: Rebuild.
10761
bb04269c
DK
107622009-06-05 Doug Kwan <dougkwan@google.com>
10763
10764 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 10765 * Makefile.in: Regenerate.
bb04269c
DK
10766 * i386.cc (class Target_i386): Define new virtual method to
10767 override do_is_local_label_name in parent.
10768 * object.cc (Sized_relobj::do_count_local_symbols): Discard
10769 local symbols if --discard-locals or -X is given.
10770 * options.h (class General_options): Declare new options
10771 '--discard-locals' and '-X' for discarding locals.
10772 * target.h (class Target): Define new methods is_local_label_name.
10773 Declare new virtual method do_is_local_label_name.
10774 * target.cc: New file.
10775 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
10776 (check_SCRIPTS): Add discard_locals_test.sh.
10777 (check_DATA): Add discard_local_tests.syms.
10778 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
10779 (discard_local_tests.syms, discard_locals_test.o): New make rules.
10780 * testsuite/Makefile.in: Regenerate.
10781 * testsuite/discard_locals_test.c: New file.
10782 * testsuite/discard_locals_test.sh: Same.
10783
805bb01c
DK
107842009-06-05 Doug Kwan <dougkwan@google.com>
10785
10786 * object.cc (Sized_relobj::Sized_relobj): Initialize
10787 discarded_eh_frame_shndx_ to -1U.
10788 (Sized_relobj::do_layout): Record index of a discard .eh_frame
10789 section.
10790 (Sized_relobj::do_count_local_symbols): Skip local symbols in
10791 a discarded .eh_frame section.
10792 (Sized_relobj::do_finalize_local_symbols): Ditto.
10793 * object.h (class Sized_relobj): Declare new member
10794 discarded_eh_frame_shndx_.
10795 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
10796 (local_labels_test.o, local_labels_test): New rules.
10797 * testsuite/Makefile.in: Regenerate.
10798
1dcd334d
DK
107992009-06-04 Doug Kwan <dougkwan@google.com>
10800
10801 * layout.cc (Layout::section_name_mapping): Add mapping for
10802 special ARM sections.
10803
96d49306
DK
108042009-06-03 Doug Kwan <dougkwan@google.com>
10805
10806 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
10807 (utils::has_overflow): Same.
10808
dff16297
ILT
108092009-06-03 Ian Lance Taylor <iant@google.com>
10810
10811 * layout.cc (Layout::section_name_mapping): New array, replacing
10812 Layout::linkonce_mapping.
10813 (Layout::section_name_mapping_count): New variable, replacing
10814 Layout::linkonce_mapping_count.
10815 (Layout::linkonce_output_name): Remove.
10816 (Layout::output_section_name): Rewrite.
10817 * layout.h (class Layout): Rename Linkonce_mapping to
10818 Section_name_mapping, linkonce_mapping to section_name_mapping,
10819 linkonce_mapping_count to section_name_mapping_count. Don't
10820 declare linkonce_output_name.
10821
c121c671
DK
108222009-06-03 Doug Kwan <dougkwan@google.com>
10823
10824 * gold/arm.cc (namespace utils): New.
10825 (Target_arm::reloc_is_non_pic): Define new method.
10826 (class Arm_relocate_functions): New.
10827 (Target_arm::Relocate::relocate): Handle relocation types used by
10828 Android.
10829
07800fab
ILT
108302009-06-03 Ian Lance Taylor <iant@google.com>
10831
10832 * arm.cc (Target_arm::scan::global): Use || instead of |.
10833
c121c671
DK
108342009-06-02 Doug Kwan <dougkwan@google.com>
10835
10836 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
10837 issued_non_pic_error_.
10838 (class Target_arm::Scan): Declare new method check_non_pic.
10839 Define new method symbol_needs_plt_entry.
10840 Declare new data member issued_non_pic_error_.
10841 (class Target_arm::Relocate): Declare new method
10842 should_apply_static_reloc.
10843 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
10844 (Target_arm::Scan::check_non_pic): Define new method.
10845 (Target_arm::Scan::local): Handle a small subset of reloc types used
10846 by Android.
10847 (Target_arm::Scan::local): Same.
10848 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
10849
b19b0c6d
ILT
108502009-05-31 Mikolaj Zalewski <mikolajz@google.com>
10851
10852 * incremental.cc (Incremental_inputs::report_command_line): Filter
10853 out --incremental-* options.
10854
94cdfcff
DK
108552009-05-29 Doug Kwan <dougkwan@google.com>
10856
10857 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
10858 template class.
10859 (class Target_arm): Update comment.
10860 (Target_arm::Target_arm): Initialize new data members GOT_,
10861 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
10862 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
10863 and Target_arm::rel_dyn_section.
10864 Declare new_enum Target_arm::Got_type.
10865 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
10866 and DYNBSS_.
10867 Update commments for member do_dynsym_value.
10868 (Target_arm::got_size, Target_arm::plt_section,
10869 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
10870 new methods inside class defintion.
10871 (Target_arm::got_section): Define new method.
10872 (Target_arm::rel_dyn_section): Same.
10873 (Output_data_plt_arm): New template class.
10874 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
10875 (Output_data_plt_arm:do_adjust_output_section): Define new method.
10876 (Output_data_plt_arm::add_entry): Same.
10877 (Output_data_plt_arm::first_plt_entry): Define new
10878 static data member for PLT instruction template.
10879 (Output_data_plt_arm::plt_entry): Same.
10880 (Output_data_plt_arm::do_write): Define new method.
10881 (Target_arm::make_plt_entry): Same.
10882 (Target_arm::do_finalize_sections): Same.
10883 (Target_arm::do_dynsym_value): Same.
10884
4a657b0d
DK
108852009-05-28 Doug Kwan <dougkwan@google.com>
10886
10887 * Makefile.am (TARGETSOURCES): Add arm.cc.
10888 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
10889 * Makefile.in: Regenerate.
10890 * arm.cc: New file.
10891 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
10892
e7ae8c36
DK
108932009-05-26 Doug Kwan <dougkwan@google.com>
10894
10895 * options.cc (General_options::parse_exclude_libs). Fix a comment.
10896 (General_options::check_excluded_libs): Strip off directories in
10897 archive name before matching like GNU ld does.
10898 * testsuite/Makefile.am (MOSTLYCLEANFILES,
10899 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
10900 (exclude_libs_test_LDFLAGS): Add linker option
10901 -Wl,--exclude-libs,libexclude_libs_test_3
10902 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
10903 an explicit archive without using -l.
10904 (alt/libexclude_libs_test_3.a): New make rule.
10905 * testsuite/Makefile.in: Regenerate.
10906 * testsuite/exclude_libs_test.c : Declare lib3_default().
10907 (main): Call it.
10908 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
10909 * exclude_libs_test_3.c: New file.
10910
f12e7348
NC
109112009-05-26 Nick Clifton <nickc@redhat.com>
10912
10913 * po/id.po: New Indonesian translation.
10914 * po/gold.pot: Updated template file.
10915
4daadc0d
ST
109162009-05-22 Sriraman Tallam <tmsriram@google.com>
10917
e1df38aa 10918 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
10919 gc_comdat_test files. Add -Wl,--gc-sections to build
10920 gc_comdat_test.
10921 * testsuite/Makefile.in: Regenerate.
10922 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
10923
531813ad
ST
109242009-05-21 Sriraman Tallam <tmsriram@google.com>
10925
10926 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
10927 kept comdat section was garbage collected.
10928 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
10929 * testsuite/Makefile.in: Regenerate.
10930 * testsuite/gc_comdat_test.sh: New file.
10931 * testsuite/gc_comdat_test_1.cc: New file.
10932 * testsuite/gc_comdat_test_2.cc: New file.
10933
65514900
CC
109342009-05-19 Doug Kwan <dougkwan@google.com>
10935
10936 * archive.cc (Archive::Archive): Move constructor from archive.h
10937 to here. Initialize no_export_.
10938 (Archive::get_elf_object_for_member): Set no_export flag of object.
10939 * archive.h (Archive::Archive): Move constructor body to
10940 archive.cc.
10941 (Archive::no_export): New method.
10942 (Archive::no_export_): New field.
10943 * object.h (Object::Object): Initialize no_export_ to false.
10944 (Object::no_export, Object::set_no_export): New methods.
10945 (Object::no_export_): New field.
10946 * options.cc (General_options::parse_exclude_libs): New method.
10947 (General_options::check_excluded_libs) Same.
10948 * options.h (exclude_libs): New option.
10949 (General_options::check_excluded_libs): New method declaration.
10950 (General_options::excluded_libs_): New field.
10951 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
10952 default or protected visibility if an object has no-export flag set.
10953 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
10954 (check_SCRIPTS): Add exclude_libs_test.sh.
10955 (check_DATA): Add exclude_libs_test.syms.
10956 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
10957 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
10958 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
10959 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
10960 (exclude_libs_test.syms, libexclude_libs_test_1.a,
10961 libexclude_libs_test_2.a): New rules.
10962 * testsuite/Makefile.in: Regenerate.
10963 * testsuite/exclude_libs_test.c: New file.
10964 * testsuite/exclude_libs_test.sh: Ditto.
10965 * testsuite/exclude_libs_test_1.c: Ditto.
10966 * testsuite/exclude_libs_test_2.c: Ditto.
10967
1b77ea50
ILT
109682009-05-15 Ian Lance Taylor <iant@google.com>
10969
10970 * configure.ac: Check for declarations for cases where libiberty.h
10971 checks HAVE_DECL_xxx.
10972 * configure, config.in: Rebuild.
10973
072fe7ce
ILT
109742009-05-15 Mikolaj Zalewski <mikolajz@google.com>
10975
10976 * gold.h (Incremental_argument_list): Remove (invalid) forward
10977 declaration.
10978 * incremental.cc (Incremental_inputs::report_achive): New method.
10979 (Incremental_inputs::report_object): New method.
10980 (Incremental_inputs::report_script): New method.
10981 (Incremental_inputs::finalize_inputs): New method.
10982 (Incremental_inputs::finalize): Call finalize_inputs().
10983 (Incremental_inputs::sized_create_incremental_inputs_section_data):
10984 Create inputs entries.
10985 * incremental.h (Incremental_input_type): New enum.
10986 (Incremental_inputs::Incremental_input): Initialize new fields.
10987 (Incremental_inputs::report_inputs): New method.
10988 (Incremental_inputs::report_achive): New method.
10989 (Incremental_inputs::report_object): New method.
10990 (Incremental_inputs::report_script): New method.
10991 (Incremental_inputs::finalize_inputs): New method.
10992 (Incremental_inputs::Input_info): New struct.
10993 (Incremental_inputs::Input_info_map): New typedef.
10994 (Incremental_inputs::lock_): New field.
10995 (Incremental_inputs::Inputs_): New field.
10996 (Incremental_inputs::Inputs_map): New field.
10997 * main.cc (main): Call Incremental_input::report_inputs.
10998 * options.h (Input_argument_list): Typedef moved from
10999 Input_arguments.
11000 (Input_file_group::Files): Remove, use ::Input_argument_list.
11001 (Input_file_group::Input_argument_list): Remove, use
11002 ::Input_argument_list.
11003 * plugin.cc (Plugin_manager::add_input_file): Add error in
11004 incremental build.
11005 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
11006 functions.
11007 * script.cc (read_input_script): Call
11008 Incremental_input::report_script.
11009 * script.h (Script_info): New class.
11010
b0481b0b
ILT
110112009-04-27 Ian Lance Taylor <iant@google.com>
11012
11013 * x86_64.cc (do_adjust_output_section): Set entsize to
11014 plt_entry_size.
11015
b22a5a41 110162009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
11017
11018 * output.cc (Output_file::close): After short writes, continue
11019 writing from the correct offset in the buffer being written.
11020
40fde488
CD
110212009-04-23 Chris Demetriou <cgd@google.com>
11022
11023 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
11024 * configure: Regenerate.
11025 * config.in: Regenerate.
11026 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
11027 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
11028
3ce2c28e
ILT
110292009-04-21 Mikolaj Zalewski <mikolajz@google.com>
11030
11031 * incremental.cc (Incremental_inputs_header_data): Renamed from
11032 Incremental_input_header_data.
11033 (Incremental_inputs_header_data::data_size): New field.
11034 (Incremental_inputs_header_data::put_input_file_count): Renamed
11035 from input_file_count.
11036 (Incremental_inputs_header_data::put_command_line_offset): Renamed
11037 from command_line_offset.
11038 (Incremental_inputs_header_data::put_reserved): Renamed from
11039 put_reserved.
11040 (Incremental_inputs_entry_data): Renamed from
11041 Incremental_input_entry_data.
11042 (Incremental_inputs_entry_data::data_size): New field.
11043 (Incremental_inputs::report_command_line): New method.
11044 (Incremental_inputs::finalize): New method.
11045 (Incremental_inputs::create_incremental_inputs_data): New method.
11046 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
11047 * incremental.h: New file.
11048 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 11049 (Layout::finalize): Create incremental inputs section in
3ce2c28e 11050 incremental builds.
703d02da 11051 (Layout::create_incremental_info_sections): New method.
3ce2c28e 11052 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
11053 (Layout::create_incremental_info_sections): New method.
11054 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
11055 * main.cc (main): Notify Incremental_input of the command line.
11056
e55bde5e
ILT
110572009-04-01 Ian Lance Taylor <iant@google.com>
11058 Mikolaj Zalewski <mikolajz@google.com>
11059
11060 * gold.h (reserve_unordered_map): Define, three versions, one for
11061 each version of Unordered_map.
11062 * layout.cc (Layout::Layout): Remove options parameter. Add
11063 number_of_input_files parameter. Don't initialize options_.
11064 Initialize number_of_input_files_ and resized_signatures_. Move
11065 sections_are_attached_.
11066 (Layout::layout_group): Reserve space for group_signatures_.
11067 (Layout::find_or_add_kept_section): Change name parameter to be a
11068 reference. Resize signatures_ map when it gets large enough.
11069 (Layout::layout_eh_frame): Use parameters->options() instead of
11070 this->options_.
11071 (Layout::make_output_section): Likewise.
11072 (Layout::attach_allocated_section_to_segment): Likewise.
11073 (Layout::finalize, Layout::create_executable_stack): Likewise.
11074 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
11075 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
11076 * layout.h (class Layout): Update declarations. Remove options_
11077 field. Add number_of_input_files_ and resized_signatures_
11078 fields. Move sections_are_attached_ field.
11079 * main.cc (main): Pass number of input files to Layout
11080 constructor. Don't pass options.
11081
154b857c
ILT
110822009-03-30 Ian Lance Taylor <iant@google.com>
11083
11084 * ffsll.c (ffsll): Correct implementation.
11085
2f35ab9b
ILT
110862009-03-27 Ian Lance Taylor <iant@google.com>
11087
fd03461a
ILT
11088 * ffsll.c: New file.
11089 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
11090 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
11091 * ftruncate.c (ftruncate): Declare before definition.
11092 * mremap.c (mremap): Likewise.
11093 * pread.c (pread): Likewise.
11094 * configure, Makefile.in, config.in: Rebuild.
11095
2f35ab9b
ILT
11096 * mremap.c: New file.
11097 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
11098 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
11099 (mremap): Declare if HAVE_MREMAP is not defined.
11100 * configure, Makefile.in, config.in: Rebuild.
11101
33aea2fd
CC
111022009-03-27 Cary Coutant <ccoutant@google.com>
11103
11104 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
11105 position independent.
11106 * sparc.cc (Target_sparc::check_non_pic): Likewise.
11107 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
11108
6d479619
CC
111092009-03-24 Cary Coutant <ccoutant@google.com>
11110
11111 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
11112 an executable.
11113 (needs_dynamic_reloc): Likewise.
11114
afc06bb8
ILT
111152009-03-24 Ian Lance Taylor <iant@google.com>
11116
11117 * yyscript.y (file_cmd): Recognize EXTERN.
11118 (extern_name_list, extern_name_list_body): New nonterminals.
11119 * script.cc (script_add_extern): Define.
11120 * script-c.h (script_add_extern): Declare.
11121
f6060a4d
ILT
111222009-03-24 Rafael Avila de Espindola <espindola@google.com>
11123
11124 * object.cc (is_elf_object): Define.
11125 * object.h (is_elf_object): Declare.
11126 * archive.cc (Archive::get_elf_object_for_member): Call
11127 is_elf_object.
33aea2fd 11128 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 11129
26736d8e
ILT
111302009-03-24 Elliott Hughes <enh@google.com>
11131
11132 * output.cc (Output_file::map_anonymous): Define.
11133 (Output_file::map): Use map_anonymous. If the regular mmap fails,
11134 try an anonymous one. Report the size if the mmap fails.
11135 * output.h (class Output_file): Declare map_anonymous.
11136
22fd9730
ILT
111372009-03-24 Ian Lance Taylor <iant@google.com>
11138
11139 * target-select.cc (instantiate_target): Don't acquire the lock if
11140 the instantiated_target_ field has already been set.
11141
cb010894
ILT
111422009-03-23 Ian Lance Taylor <iant@google.com>
11143
7f055c20
ILT
11144 * gold-threads.h (class Initialize_lock): Define.
11145 * gold-threads.cc (class Initialize_lock_once): Define.
11146 (initialize_lock_control): New static variable.
11147 (initialize_lock_pointer): New static variable.
11148 (initialize_lock_once): New static function.
11149 (Initialize_lock::Initialize_lock): Define.
11150 (Initialize_lock::initialize): Define.
11151 * target-select.h: Include "gold-threads.h".
11152 (class Target_selector): Add lock_ and initialize_lock_ fields.
11153 Don't define instantiate_target, just declare it.
11154 * target-select.cc (Target_selector::Target_selector): Initialize
11155 new fields.
11156 (Target_selector::instantiate_target): Define.
11157 * descriptors.h: Include "gold-threads.h".
11158 (class Descriptors): Add initialize_lock_ field.
11159 * descriptors.cc (Descriptors::Descriptors): Initialize new
11160 field.
11161 (Descriptors::open): Use initialize_lock_ field
11162 * errors.h (class Errors): Add initialize_lock_ field.
11163 * errors.cc (Errors::Errors): Initialize new field.
11164 (Errors::initialize_lock): Use initialize_lock_ field.
11165 * powerpc.cc (class Target_selector_powerpc): Remove
11166 instantiated_target_ field. In do_recognize call
11167 instantiate_target rather than do_instantiate_target. In
11168 do_instantiate_target just allocate a new target.
11169 * sparc.cc (class Target_selector_sparc): Likewise.
11170
36959681
ILT
11171 * freebsd.h: New file.
11172 * i386.cc: Include "freebsd.h".
11173 (Target_i386): Derive from Target_freebsd rather than
11174 Sized_target.
11175 (Target_selector_i386): Derive from Target_selector_freebsd rather
11176 than Target_selector.
11177 * x86_64.cc: Include "freebsd.h".
11178 (Target_x86_64): Derive from Target_freebsd rather than
11179 Sized_target.
11180 (Target_selector_x86_64): Derive from Target_selector_freebsd
11181 rather than Target_selector.
11182 * target.h (class Target): Add adjust_elf_header and
11183 do_adjust_elf_header.
11184 * output.cc (Output_file_header:: do_sized_write): Call target
11185 adjust_elf_header routine.
11186 * configure.tgt: Set targ_osabi.
11187 * configure.ac: Define GOLD_DEFAULT_OSABI.
11188 * parameters.cc (Parameters::default_target): Pass
11189 GOLD_DEFAULT_OSABI to select_target.
11190 * target-select.h (class Target_selector): Make instantiate_target
11191 protected rather than private.
11192 * Makefile.am (HFILES): Add freebsd.h.
11193 * configure, Makefile.in, config.in: Rebuild.
11194
cb010894
ILT
11195 * merge.cc (do_add_input_section): Correct pend value. Change
11196 message about last entry not being null terminated from error to
11197 warning.
11198
0e879927
ILT
111992009-03-20 Mikolaj Zalewski <mikolajz@google.com>
11200
11201 * incremental.cc: New file.
11202 * Makefile.am (CCFILES): Add incremental.cc.
11203 * Makefile.in: Rebuild.
11204
41105937
PP
112052009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
11206
11207 * layout.cc (Layout::output_section_name): Preserve names
11208 of '.note.' sections.
e1df38aa 11209
60439920
ILT
112102009-03-19 Ian Lance Taylor <iant@google.com>
11211
11212 * descriptors.cc (Descriptors::open): Check that the options are
11213 valid before using them.
11214
0d371ad3
ILT
112152009-03-18 Ian Lance Taylor <iant@google.com>
11216
11217 * script-sections.h: Include <list>.
11218 (class Script_sections): Change Sections_elements from std::vector
11219 to std::list. Typedef public Elements_iterator. Add
11220 orphan_section_placement_, data_segment_align_start_, and
11221 saw_data_segment_align_ fields. Remove data_segment_align_index_
11222 field.
11223 * script-sections.cc (class Orphan_section_placement): New class.
11224 (class Sections_element): Add virtual functions is_relro and
11225 orphan_section_init. Remove virtual function place_orphan_here.
11226 (class Output_section_definition): Add is_relro and
11227 orphan_section_init. Remove place_orphan_here.
11228 (class Orphan_output_section): Likewise.
11229 (Script_sections::Script_sections): Update for field changes.
11230 (Script_sections::data_segment_align): Set saw_data_segment_align_
11231 and data_segment_align_start_, not data_segment_align_index.
11232 (Script_sections::data_segment_relro_end): Check
11233 saw_data_segment_align_. Use data_segment_align_start_ rather
11234 than data_segment_align_index_.
11235 (Script_sections::place_orphan): Rewrite to use
11236 Orphan_section_placement.
11237
9201d894
ILT
112382009-03-17 Ian Lance Taylor <iant@google.com>
11239
9c5b8369
ILT
11240 * archive.cc (Archive::add_symbols): Check for a version attached
11241 to the symbol name in the archive map.
11242 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
11243 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
11244 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
11245 (ver_test_11.a): New target.
11246 * testsuite/Makefile.in: Rebuild.
11247
9201d894
ILT
11248 * configure.ac: Check for chsize and posix_fallocate. Replace
11249 ftruncate.
11250 * ftruncate.c: New file, from gnulib.
11251 * output.cc (posix_fallocate): Define dummy version if not
11252 HAVE_POSIX_FALLOCATE.
11253 (Output_file::map): Call posix_fallocate rather than lseek and
11254 write.
11255 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
11256 * configure, Makefile.in, config.in: Rebuild.
11257
ef4ab7a8 112582009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 11259
ef4ab7a8
PP
11260 * layout.h (Layout::create_note): Add section_name parameter.
11261 * layout.cc (Layout::create_note): Likewise.
11262 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 11263
8c500701
ILT
112642009-03-17 Ian Lance Taylor <iant@google.com>
11265
e85b18e1
ILT
11266 * descriptors.cc: Include "options.h".
11267 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
11268 (Descriptors::open): Always use O_CLOEXEC when opening a new
11269 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
11270 then set FD_CLOEXEC.
11271
9efe6174
ILT
11272 * sparc.cc (class Target_sparc): Add has_got_section.
11273 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
11274 make sure we have a GOT section.
11275
11276 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
11277 (Target_sparc::Scan::local): Likewise.
11278 (Target_sparc::Scan::global): Likewise.
11279 (Target_sparc::Relocate::relocate): Likewise.
11280 (Target_sparc::Relocate::relocate_tls): Likewise.
11281
8c500701
ILT
11282 * symtab.cc (Symbol_table::define_default_version): New function,
11283 broken out of add_from_object.
11284 (Symbol_table::add_from_object): Call define_default_version.
11285 (Symbol_table::define_special_symbol): Add resolve_oldsym
11286 parameter. Change all callers. If the version for a symbol comes
11287 from a version script, resolve it with the symbol with the same
11288 name with no version. Also add the symbol without a version if
11289 appropriate.
11290 (do_define_in_output_data): If resolving with oldsym, don't delete
11291 sym.
11292 (do_define_in_output_segment): Likewise.
11293 (do_define_as_constant): Likewise.
11294 * symtab.h (class Symbol_table): Update declarations.
11295
f1ed28fb
ILT
112962009-03-13 Ian Lance Taylor <iant@google.com>
11297
15f8229b
ILT
11298 * readsyms.cc (Read_symbols::incompatible_warning): New function.
11299 (Read_symbols::requeue): New function.
11300 (Read_symbols::do_read_symbols): If make_elf_object fails because
11301 the target type is not configured, and the file was searched for,
11302 issue a warning and retry with the next directory.
11303 (Add_symbols::run): If the file has an incompatible format, and
11304 it was searched for, requeue the Read_symbols task. On error,
11305 release the object.
11306 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
11307 dirindex parameter to constructor. Change all callers. Declare
11308 incompatible_warning and requeue.
11309 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
11310 input_argument_ and input_group_ fields. Add them to
11311 constructor. Change all callers.
11312 (class Read_script): Add dirindex_ field. Add it to constructor.
11313 Change all callers.
11314 * archive.cc (Archive::setup): Remove input_objects parameter.
11315 Change all callers.
11316 (Archive::get_file_and_offset): Likewise.
11317 (Archive::read_all_symbols): Likewise.
11318 (Archive::read_symbols): Likewise.
11319 (Archive::get_elf_object_for_member): Remove input_objects
11320 parameter. Add punconfigured parameter. Change all callers.
11321 (Archive::add_symbols): Change return type to bool. Check return
11322 value of include_member.
11323 (Archive::include_all_members): Likewise.
11324 (Archive::include_member): Change return type to bool. Return
11325 false if first included object has incompatible target. Set
11326 included_member_ field.
11327 (Add_archive_symbols::run): If add_symbols returns false, requeue
11328 Read_symbols task.
11329 * archive.h (class Archive): Add included_member_ field.
11330 Initialize it in constructor. Add input_file and searched_for
11331 methods. Update declarations.
11332 (class Add_archive_symbols): Add dirpath_, dirindex_, and
11333 input_argument_ fields. Add them to constructor. Change all
11334 callers.
11335 * script.cc: Include "target-select.h".
11336 (class Parser_closure): Add skip_on_incompatible_target_ and
11337 found_incompatible_target_ fields. Add
11338 skip_on_incompatible_target parameter to constructor. Change all
11339 callers. Add methods skip_on_incompatible_target,
11340 clear_skip_on_incompatible_target, found_incompatible_target, and
11341 set_found_incompatible_target.
11342 (read_input_script): Add dirindex parameter. Change all callers.
11343 If parser finds an incompatible target, requeue Read_symbols
11344 task.
11345 (script_set_symbol): Clear skip_on_incompatible_target in
11346 closure.
11347 (script_add_assertion, script_parse_option): Likewise.
11348 (script_start_sections, script_add_phdr): Likewise.
11349 (script_check_output_format): New function.
11350 * script.h (read_input_script): Update declaration.
11351 * script-c.h (script_check_output_format): Declare.
11352 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
11353 (ignore_cmd): Remove OUTPUT_FORMAT.
11354 * fileread.cc (Input_file::Input_file): Add explicit this.
11355 (Input_file::will_search_for): New function.
11356 (Input_file::open): Add pindex parameter. Change all callers.
11357 * fileread.h (class Input_file): Add input_file_argument method.
11358 Declare will_search_for. Update declarations.
11359 * object.cc (make_elf_object): Add punconfigured parameter.
11360 Change all callers.
11361 * object.h (class Object): Make input_file public. Add
11362 searched_for method.
11363 (make_elf_object): Update declaration.
11364 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
11365 restart search.
11366 * dirsearch.h (class Dirsearch): Update declaration.
11367 * options.h (class General_options): Add --warn-search-mismatch.
11368 * parameters.cc (Parameters::is_compatible_target): New function.
11369 * parameters.h (class Parameters): Declare is_compatible_target.
11370 * workqueue.cc (Workqueue::add_blocker): New function.
11371 * workqueue.h (class Workqueue): Declare add_blocker.
11372
f1ed28fb
ILT
11373 * fileread.cc (Input_file::open): Remove options parameter.
11374 Change all callers.
11375 (Input_file::open_binary): Likewise.
11376 * script.cc (read_input_script): Likewise.
11377 * readsyms.h (class Read_symbols): Remove options_ field. Remove
11378 options parameter from constructor. Change all callers.
11379 (class Read_script): Likewise.
11380 * fileread.h (class Input_file): Update declarations.
11381 * script.h (read_input_script): Update declaration.
11382
34dd024a
NC
113832009-03-10 Nick Clifton <nickc@redhat.com>
11384
11385 * po/es.po: New Spanish translation.
11386
6d71b17c
CC
113872009-03-06 Cary Coutant <ccoutant@google.com>
11388
11389 * options.cc (parse_short_option): Keep dash_z from registering itself.
11390
031cdbed
ILT
113912009-03-03 Ian Lance Taylor <iant@google.com>
11392
11393 PR 9918
11394 * target-reloc.h (relocate_section): Pass output_section to
11395 relocate.
11396 * i386.cc (Target_i386::should_apply_static_reloc): Add
11397 output_section parameter. Change all callers.
11398 (Target_i386::Relocate::relocate): Add output_section parameter.
11399 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
11400 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
11401 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
11402 * testsuite/two_file_shared.sh: New script.
11403 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
11404 (check_DATA): Add two_file_shared.dbg.
11405 (two_file_shared.dbg): New target.
11406 * testsuite/Makefile.in: Rebuild.
11407
15d5fa16
ILT
114082009-03-01 Ian Lance Taylor <iant@google.com>
11409
11410 * configure.ac: Check for byteswap.h.
11411 * configure: Rebuild.
11412 * config.in: Rebuild.
11413
8a4c0b0d
ILT
114142009-03-01 Mikolaj Zalewski <mikolajz@google.com>
11415
11416 * layout.cc (Layout::find_or_add_kept_section): New function.
11417 (Layout::add_comdat): Removed.
11418 * layout.h (struct Kept_section): Move out of class Layout.
11419 Remove trailing underscores from field names. Add group_sections
11420 field. Rename group_ field to is_group. Change all uses.
11421 (class Layout): Declare find_or_add_kept_section, not add_comdat.
11422 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
11423 comdat_groups_ field.
11424 (Sized_relobj::include_section_group): Use
11425 find_or_add_kept_section and Kept_section::group_sections.
11426 (Sized_relobj::include_linkonce_section): Likewise.
11427 * object.cc (class Sized_relobj): Don't define Comdat_group or
11428 Comdat_group_table. Remove find_comdat_group and
11429 add_comdat_group. Remove comdat_groups_ field.
11430 * plugin.cc (include_comdat_group): Use
11431 Layout::find_or_add_kept_section.
11432
b4ecf66b
ILT
114332009-02-28 Ian Lance Taylor <iant@google.com>
11434
14359ca0
ILT
11435 * README: --gc-sections and map files are now supported. Document
11436 some build requirements.
11437
b4ecf66b
ILT
11438 PR 6992
11439 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
11440 relocatable link set the value of the section symbol to zero.
11441 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
11442 relocatable link don't include the section address in the local
11443 symbol value.
11444
0602e05a
ILT
114452009-02-27 Ian Lance Taylor <iant@google.com>
11446
fd9d194f
ILT
11447 PR 6811
11448 * options.h (class Search_directory): Add is_system_directory.
11449 (class General_options): Declare is_in_system_directory.
11450 * options.cc (get_relative_sysroot): Make static.
11451 (get_default_sysroot): Make static.
11452 (General_optoins::is_in_system_directory): New function.
11453 * fileread.cc (Input_file::is_in_system_directory): New function.
11454 * fileread.h (class Input_file): Declare is_in_system_directory.
11455 * object.h (class Object): Add is_in_system_directory.
11456 (class Input_objects): Remove system_library_directory_ field.
11457 * object.cc (Input_objects::add_object): Don't set
11458 system_library_directory_.
11459 (input_objects::found_in_system_library_directory): Remove.
11460 * symtab.cc (Symbol_table::write_globals): Remove input_objects
11461 parameter. Change all callers.
11462 (Symbol_table::sized_write_globals): Likewise.
11463 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
11464 Call Object::is_in_system_directory.
11465 * symtab.h (class Symbol_table): Update declarations.
11466
61edd21f
ILT
11467 PR 5990
11468 * descriptors.h (Open_descriptor): Add is_on_stack field.
11469 * descriptors.cc (Descriptors::open): If the descriptor is on the
11470 top of the stack, remove it. Initialize is_on_stack field.
11471 (Descriptors::release): Only add pod to stack if it is not on the
11472 stack already.
11473 (Descriptors::close_some_descriptor): Clear stack_next and
11474 is_on_stack fields.
11475
e29e076a
ILT
11476 PR 7091
11477 * output.cc (Output_section::find_starting_output_address): Rename
11478 from starting_output_address; add PADDR parameter; change return
11479 type.
11480 * output.h (class Output_section): Declare
11481 find_starting_output_address instead of starting_output_address.
11482 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
11483 section symbol for which we can't find a merge section.
11484
0602e05a
ILT
11485 PR 9836
11486 * symtab.cc (Symbol_table::add_from_object): If the visibility is
11487 hidden or internal, force the symbol to be local.
11488 * resolve.cc (Symbol::override_visibility): Define.
11489 (Symbol::override_base): Use override_visibility.
11490 (Symbol_table::resolve): Likewise.
11491 (Symbol::override_base_with_special): Likewise.
11492 (Symbol_table::override_with_special): If the visibility is hidden
11493 or internal, force the symbol to be local.
11494 * symtab.h (class Symbol): Add set_visibility and
11495 override_visibility.
11496 * testsuite/ver_test_1.sh: New file.
11497 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
11498 (check_DATA): Add ver_test_1.syms.
11499 (ver_test_1.syms): New target.
11500 * testsuite/Makefile.in: Rebuild.
11501
401a9a73
CC
115022009-02-25 Cary Coutant <ccoutant@google.com>
11503
11504 * layout.cc (Layout::choose_output_section): Don't rename sections
11505 when using a linker script that has a SECTIONS clause.
11506 * Makefile.in: Regenerate.
11507
11508 * testsuite/Makefile.am (script_test_5.sh): New test case.
11509 * testsuite/Makefile.in: Regenerate.
11510 * testsuite/script_test_5.cc: New file.
11511 * testsuite/script_test_5.sh: New file.
11512 * testsuite/script_test_5.t: New file.
11513
f488e4b0
CC
115142009-02-13 Rafael Avila de Espindola <espindola@google.com>
11515
11516 * archive.cc (Archive::include_member): Update calls to add_symbols.
11517 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
11518 the Layout argument.
11519 * dynobj.h (do_add_symbols): Add the Layout argument.
11520 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
11521 Layout argument.
11522 * object.h (Object::add_symbols): Add the Layout argument.
11523 (Object::do_add_symbols): Add the Layout argument.
11524 (Sized_relobj::do_add_symbols): Add the Layout argument.
11525 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
11526 Unify the two versions.
11527 (Add_plugin_symbols): Remove.
11528 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
11529 (Sized_pluginobj::do_add_symbols): Unify the two versions.
11530 (Add_plugin_symbols): Remove.
11531 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
11532 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
11533 (Add_symbols::run): Make it work with Pulginobj.
11534
89dd1680
ILT
115352009-02-06 Ian Lance Taylor <iant@google.com>
11536
11537 * object.cc (Sized_relobj::do_layout): Make info message start
11538 with lower case letter.
11539
266d0a74
ILT
115402009-02-06 Mikolaj Zalewski <mikolajz@google.com>
11541
602b464e
ILT
11542 * binary.cc: Fix file comment.
11543
266d0a74
ILT
11544 * options.h (enum Incremental_disposition): Define.
11545 (class General_options): Add new options: --incremental,
11546 --incremental_changed, --incremental_unchanged,
11547 --incremental_unknown. Add incremental_disposition_ and
11548 implicit_incremental_ fields.
11549 (General_options::incremental_disposition): New function.
11550 (class Position_dependent_options): Add incremental_disposition
11551 option.
11552 (Position_dependent_options::copy_from_options): Set incremental
11553 dispositions.
11554 * options.cc (General_options::parse_incremental_changed): New
11555 function.
2e702c99
RM
11556 (General_options::parse_incremental_unchanged): New function.
11557 (General_options::parse_incremental_unknown): New function.
11558 (General_options::General_options): Initialize new fields
266d0a74 11559 incremental_disposition_ and implicit_incremental_.
2e702c99 11560 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
11561 without --incremental.
11562
f073bbf7
CD
115632009-02-06 Chris Demetriou <cgd@google.com>
11564
11565 * gold.h (gold_undefined_symbol): Change to take only a Symbol
11566 pointer and to report location as the file name associated with
11567 the symbol.
11568 (gold_undefined_symbol_at_location): New function to replace the
11569 old gold_undefined_symbol functionality.
11570 * target-reloc.h (relocate_section): Update to use
11571 gold_undefined_symbol_at_location.
11572 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
11573 Call gold_undefined_symbol function rather than gold_error.
11574 * errors.h (Errors::undefined_symbol): Take location as a
11575 string, rather than calculating it from a relocation.
11576 * errors.cc (Errors::fatal): Print "fatal error:" before the
11577 formatted message.
11578 (Errors::error, Errors::error_at_location): Print "error: "
11579 before the formatted message.
11580 (Errors::undefined_symbol): Take location as a string, rather
11581 than calculating it from a relocation.
11582 (gold_undefined_symbol_at_location): New function akin to
11583 old gold_undefined_symbol, calculates location from relocation.
11584 (gold_undefined_symbol): Change to take only a Symbol pointer
11585 and to report location as the file name associated with the symbol.
11586 * testsuite/debug_msg.sh: Update for changed error messages.
11587 * testsuite/undef_symbol.sh: Likewise.
11588
8e94a90c
ILT
115892009-02-04 Duncan Sands <baldrick@free.fr>
11590
11591 PR 9812
11592 * reduced_debug_output.h
11593 (Output_reduced_debug_abbrev_section::failed): Use format for
11594 gold_warning.
11595 (Output_reduced_debug_info_section::faild): Likewise.
11596
88a0e15b
ILT
115972009-01-31 Mikolaj Zalewski <mikolajz@google.com>
11598
11599 * script.cc (Lazy_demangler): New class.
2e702c99 11600 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
11601 symbol only once.
11602
5efc7cd2
CC
116032009-01-29 Cary Coutant <ccoutant@google.com>
11604
11605 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
11606 to __tls_get_addr.
11607 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
11608
e0ebcf42
ILT
116092009-01-28 Ian Lance Taylor <iant@google.com>
11610
5efc7cd2 11611 * version.cc (version_string): Bump to 1.9.
75fe7426 11612
e0ebcf42
ILT
11613 * gold.h: Include <cstring> and <stdint.h>.
11614 * version.cc: Include <cstdio>.
11615 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
11616 warning.
11617 * reduced_debug_output.cc (insert_into_vector): Rename from
11618 Insert_into_vector; change all callers. Use Swap_unaligned to
11619 avoid aliasing issue; remove union since it is unnecessary.
11620
8e2813be 116212009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
11622
11623 * Makefile.am (CCFILES): Add gc.cc.
11624 (HFILES): Add gc.h.
11625 * Makefile.in: Regenerate.
11626 * gold.cc (Gc_runner): New class.
11627 (queue_initial_tasks): Call garbage collection related tasks
11628 when corresponding options are invoked.
11629 (queue_middle_gc_tasks): New function.
11630 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
11631 processed early before laying out sections during garbage collection.
11632 * gold.h (queue_middle_gc_tasks): New function.
11633 (is_prefix_of): Move from "layout.cc".
11634 * i386.cc (Target_i386::gc_process_relocs): New function.
11635 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
11636 * main.cc (main): Create object of class "Garbage_collection".
11637 * object.cc (Relobj::copy_symbols_data): New function.
11638 (Relobj::is_section_name_included): New function.
e1df38aa
NC
11639 (Sized_relobj::do_layout): Allow this function to be called twice
11640 during garbage collection and defer layout of section during the
6d03d481
ST
11641 first call.
11642 * object.h (Relobj::get_symbols_data): New function.
11643 (Relobj::is_section_name_included): New function.
11644 (Relobj::copy_symbols_data): New function.
11645 (Relobj::set_symbols_data): New function.
11646 (Relobj::get_relocs_data): New function.
11647 (Relobj::set_relocs_data): New function.
11648 (Relobj::is_output_section_offset_invalid): New pure virtual function.
11649 (Relobj::gc_process_relocs): New function.
11650 (Relobj::do_gc_process_relocs): New pure virtual function.
11651 (Relobj::sd_): New data member.
11652 (Sized_relobj::is_output_section_offset_invalid): New function.
11653 (Sized_relobj::do_gc_process_relocs): New function.
11654 * options.h (General_options::gc_sections): Modify to not be a no-op.
11655 (General_options::print_gc_sections): New option.
11656 * plugin.cc (Plugin_finish::run): Remove function call to
11657 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
11658 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
11659 * reloc.cc (Read_relocs::run): Add task to process relocs and
11660 determine unreferenced sections when doing garbage collection.
11661 (Gc_process_relocs): New class.
11662 (Sized_relobj::do_gc_process_relocs): New function.
11663 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
11664 sections that are garbage collected.
11665 * reloc.h (Gc_process_relocs): New class.
11666 * sparc.cc (Target_sparc::gc_process_relocs): New function.
11667 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
11668 symbols whose corresponding sections are garbage collected.
11669 (Symbol_table::Symbol_table): Add new parameter for the garbage
11670 collection object.
11671 (Symbol_table::gc_mark_undef_symbols): New function.
11672 (Symbol_table::gc_mark_symbol_for_shlib): New function.
11673 (Symbol_table::gc_mark_dyn_syms): New function.
11674 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
11675 as garbage.
11676 (Symbol_table::add_from_object): Likewise.
11677 (Symbol_table::add_from_relobj): When building shared objects, do not
11678 treat externally visible symbols as garbage.
11679 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
11680 table information for static and relocatable links.
11681 * symtab.h (Symbol_table::set_gc): New function.
11682 (Symbol_table::gc): New function.
11683 (Symbol_table::gc_mark_undef_symbols): New function.
11684 (Symbol_table::gc_mark_symbol_for_shlib): New function.
11685 (Symbol_table::gc_mark_dyn_syms): New function.
11686 (Symbol_table::gc_): New data member.
e1df38aa 11687 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
11688 function.
11689 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
11690 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
11691
3b293544
CF
116922009-01-20 Chris Faylor <me.sourceware@sourceware.org>
11693
11694 * options.h (General_options::gc_sections): Define as a no-op for now.
11695 (General_options::no_keep_memory): Ditto.
11696 (General_options::Bshareable): Define.
11697 * options.cc (General_options::finalize): Honor -Bshareable.
11698
83d22aa8
AS
116992009-01-20 Andreas Schwab <schwab@suse.de>
11700
11701 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
11702 read the value in the contents, since we don't use it. Use the
11703 template endianness when writing.
11704 (Relocate::relocate): Use it for R_PPC_REL16_HA.
11705
cd536b21
AS
117062009-01-19 Andreas Schwab <schwab@suse.de>
11707
11708 * configure.tgt (powerpc64-*): Fix targ_obj.
11709
99e9a495
ILT
117102009-01-15 Ian Lance Taylor <iant@google.com>
11711
11712 * object.cc (Sized_relobj::write_local_symbols): Don't write out
11713 local symbols when stripping all symbols.
11714
bbbfea06
CC
117152009-01-14 Cary Coutant <ccoutant@google.com>
11716
99e9a495 11717 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 11718
0f7c0701
CC
117192009-01-14 Cary Coutant <ccoutant@google.com>
11720
11721 * archive.cc (Archive::get_elf_object_for_member): Remove call
11722 to File_read::claim_for_plugin.
11723 * descriptors.cc (Descriptors::open): Remove reference to
11724 is_claimed.
11725 (Descriptors::claim_for_plugin): Remove.
11726 * descriptors.h (Descriptors::claim_for_plugin): Remove.
11727 (Descriptors::is_claimed): Remove.
11728 (claim_descriptor_for_plugin): Remove.
11729 * fileread.cc (File_read::claim_for_plugin): Remove.
11730 * fileread.h (File_read::claim_for_plugin): Remove.
11731 (File_read::descriptor): Reopen descriptor if necessary.
11732 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
11733 (Plugin_manager::all_symbols_read): Add task parameter. Change
11734 all callers.
11735 (Plugin_manager::get_input_file): New function.
11736 (Plugin_manager::release_input_file): New function.
11737 (Pluginobj::Pluginobj): Add filesize parameter and initialize
11738 corresponding data member.
11739 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
11740 and pass to base constructor. Change all callers.
11741 (get_input_file, release_input_file): New functions.
11742 (make_sized_plugin_object): Add filesize parameter. Change all callers.
11743 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
11744 (Plugin_manager::all_symbols_read): Add task parameter.
11745 (Plugin_manager::get_input_file): New function.
11746 (Plugin_manager::release_input_file): New function.
11747 (Plugin_manager::task_): New data member.
11748 (Pluginobj::Pluginobj): Add filesize parameter.
11749 (Pluginobj::filename): New function.
11750 (Pluginobj::descriptor): New function.
11751 (Pluginobj::filesize): New function.
11752 (Pluginobj::filesize_): New data member.
11753 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
11754 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
11755 File_read::claim_for_plugin; use Object::unlock to unlock the file.
11756
11757 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
11758 with archive libraries.
11759 * testsuite/Makefile.in: Regenerate.
11760 * testsuite/plugin_test.c (struct sym_info): New type.
11761 (get_input_file, release_input_file): New static variables.
11762 (onload): Capture new transfer vector entries.
11763 (claim_file_hook): Stop reading at end of file according to filesize.
11764 Factor out parsing of readelf output into separate function.
11765 (all_symbols_read_hook): Exercise get_input_file and release_input_file
11766 APIs and get the source file name from the symbol table. Convert
11767 source file name to corresponding object file name. Print info
11768 message when adding new input files.
11769 (parse_readelf_line): New function.
11770 * testsuite/plugin_test_1.sh: Add checks for new info messages.
11771 * testsuite/plugin_test_2.sh: Likewise.
11772 * testsuite/plugin_test_3.sh: Likewise.
11773 * testsuite/plugin_test_4.sh: New test case.
11774
62a6d109
ILT
117752009-01-07 Ian Lance Taylor <iant@google.com>
11776
11777 * version.cc (version_string): Bump to 1.8.
11778
483620e8
CC
117792008-12-23 Cary Coutant <ccoutant@google.com>
11780
11781 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
11782 * plugin.cc (Plugin_manager::finish): Rename as
11783 layout_deferred_objects. Move cleanup to separate function.
11784 (Plugin_manager::cleanup): New function.
11785 (Plugin_finish::run): Call layout_deferred_objects and cleanup
11786 separately.
11787 * plugin.h (Plugin_manager::finish): Rename as
11788 layout_deferred_objects.
11789 (Plugin_manager::cleanup): New function.
11790 (Plugin_manager::cleanup_done): New field.
11791
d66a9eb3
CC
117922008-12-23 Cary Coutant <ccoutant@google.com>
11793
11794 * plugin.cc (is_visible_from_outside): New function.
11795 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
11796 so we don't return "IR only" status for exported symbols or -r links.
11797
11798 * testsuite/Makefile.am (plugin_test_3): New test case.
11799 * testsuite/Makefile.in: Regenerate.
11800 * testsuite/plugin_test_3.sh: New file.
11801
5995b570
CC
118022008-12-22 Cary Coutant <ccoutant@google.com>
11803
11804 * object.cc (Sized_relobj::layout_section): New function.
11805 (Sized_relobj::do_layout): Defer layout of input sections until after
11806 plugin has provided replacement files.
11807 (Sized_relobj::do_layout_deferred_sections): New function.
11808 * object.h (Relobj::set_section_offset): Remove virtual keyword.
11809 (Relobj::layout_deferred_sections): New function.
11810 (Relobj::do_layout_deferred_sections): New function.
11811 (Sized_relobj::do_layout_deferred_sections): New function.
11812 (Sized_relobj::layout_section): New function.
11813 (Sized_relobj::Deferred_layout): New structure.
11814 (Sized_relobj::deferred_layout_): New field.
11815 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
11816 Change all callers. Layout deferred sections.
11817 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
11818 references.
11819 (Plugin_hook::run): Move code from do_plugin_hook inline.
11820 (Plugin_hook::do_plugin_hook): Remove.
11821 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
11822 (Plugin_manager::finish): Renamed, was cleanup.
11823 (Plugin_manager::should_defer_layout): New function.
11824 (Plugin_manager::add_deferred_layout_object): New function.
11825 (Plugin_manager::Deferred_layout_list): New type.
11826 (Plugin_manager::deferred_layout_objects_): New field.
11827 (Plugin_hook::do_plugin_hook): Remove.
11828
ee769c88
ILT
118292008-12-17 Ian Lance Taylor <iant@google.com>
11830
11831 * options.h (class General_options): Add --no case for
11832 --export-dynamic.
11833
abc8dcba
CC
118342008-12-16 Cary Coutant <ccoutant@google.com>
11835
11836 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
11837 vector.
11838 (Plugin_manager::claim_file): Create plugin object even if
11839 plugin did not call the add_symbols callback.
11840 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
11841 asking for more symbols than were added.
11842 * testsuite/Makefile.am (plugin_test_1): Add test case with
11843 no global symbols.
11844 (empty.syms): New target.
11845 * testsuite/Makefile.in: Regenerate.
11846 * testsuite/plugin_test.c (claim_file_hook): Add new debug
11847 message. Don't call add_symbols if no globals.
11848 (all_symbols_read_hook): Don't provide replacement for empty
11849 claimed file.
11850
b0074644
ILT
118512008-12-12 Ian Lance Taylor <iant@google.com>
11852
68943102
ILT
11853 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
11854 r_type == 0 for a local symbol with r_sym == 0.
11855 (scan_relocatable_relocs): Pass r_sym to
11856 local_non_section_strategy.
11857 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
11858 r_sym parameter.
11859
b0074644
ILT
11860 * configure.ac: Update test for TLS descriptors: they are
11861 supported as of glibc 2.9.
11862 * configure: Rebuild.
11863
c2508178
ILT
118642008-12-11 Ian Lance Taylor <iant@google.com>
11865
11866 PR 7091
11867 * target-reloc.h (Default_scan_relocatable_relocs): For each
11868 function, map r_type == 0 to RELOC_DISCARD.
11869
2756a258
CC
118702008-12-10 Cary Coutant <ccoutant@google.com>
11871
11872 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
11873 object to override a kept COMDAT group from a plugin object.
11874
bb6f53d3
ILT
118752008-12-09 Ian Lance Taylor <iant@google.com>
11876
fbc558e1
ILT
11877 PR 7088
11878 * yyscript.y (file_cmd): Handle INPUT.
11879
bb6f53d3
ILT
11880 * testsuite/initpri1.c: Change all declarations to be full
11881 prototypes by adding void, to avoid compiler warnings.
11882
4674ecfc
CC
118832008-12-05 Rafael Avila de Espindola <espindola@google.com>
11884
11885 * options.cc (General_options::parse_plugin_opt): New.
11886 (General_options::add_plugin): The argument now is just the filename.
11887 (General_options::add_plugin_option): New.
11888 * options.h (plugin_opt): New.
11889 (add_plugin): Change argument name.
11890 (add_plugin_option): New.
11891 * plugin.cc (Plugin::load): Don't parse the plugin option.
11892 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
11893 (Plugin::add_option): New.
11894 (Plugin::args_): Change type.
11895 (Plugin::filename_): New.
11896 (Plugin_manager::add_plugin_option): New.
11897 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
11898 * testsuite/Makefile.in: Regenerate.
11899
fd06b4aa
CC
119002008-12-05 Cary Coutant <ccoutant@google.com>
11901
11902 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
11903 Handle --strip-lto-sections option.
11904 * options.h (strip_lto_sections): New option.
11905
6c52134c
CC
119062008-12-01 Cary Coutant <ccoutant@google.com>
11907
11908 * plugin.cc (ld_plugin_message): Change format parameter to const.
11909 Fix mismatch between new[] and delete.
11910
a45248e0
CC
119112008-11-14 Cary Coutant <ccoutant@google.com>
11912
11913 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
11914 instead of -1U.
11915
c82fbeee
CS
119162008-11-05 Craig Silverstein <csilvers@google.com>
11917
11918 * options.cc (General_options::parse_dynamic_list): New function.
11919 * options.h (General_options): New flags dynamic_list,
11920 dynamic_list_data, dynamic_list_cpp_new, and
11921 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
11922 (General_options::in_dynamic_list): New function.
11923 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
11924 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
11925 (Lex::can_continue_name): Likewise.
11926 (yylex): Likewise.
11927 (read_script_file): New parameter script_options.
11928 (read_dynamic_list): New function.
11929 (Script_options::define_dynamic_list): New function.
11930 (dynamic_list_keyword_parsecodes): New variable.
11931 (dynamic_list_keywords): New variable.
11932 * script.h (Script_options::define_dynamic_list): New function
11933 prototype.
11934 (read_dynamic_list): New function prototype.
11935 * symtab.cc (strprefix): New macro.
11936 (Symbol::should_add_dynsym_entry): Support dynamic_list,
11937 dynamic_list_data, dynamic_list_cpp_new, and
11938 dynamic_list_cpp_typeinfo.
11939 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
11940 (dynamic_list_expr): New rule.
11941 (dynamic_list_nodes): Likewise.
11942 (dynamic_list_node): Likewise.
11943 * testsuite/Makefile.am (dynamic_list): New test.
11944 * testsuite/Makefile.in: Regenerated.
11945 * testsuite/dynamic_list.t: New file.
11946 * testsuite/dynamic_list.sh: New file.
11947
e0bb29a5
CS
119482008-11-05 Craig Silverstein <csilvers@google.com>
11949
11950 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
11951 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
11952 (t11_last): Likewise.
11953 * testsuite/ver_test_6.c (main): Likewise.
11954
4e1e25e0
CC
119552008-10-07 Cary Coutant <ccoutant@google.com>
11956
11957 * options.c (General_options::finalize): Add check for -static and
11958 -shared.
11959 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
11960 is not empty.
11961
92f03fcb
CC
119622008-10-02 Cary Coutant <ccoutant@google.com>
11963
11964 * plugin.cc (make_sized_plugin_object): Fix conditional
11965 compilation to work when not all targets are enabled.
11966
fbd8a257
CC
119672008-09-29 Cary Coutant <ccoutant@google.com>
11968
11969 * archive.cc (Archive::get_file_and_offset): Use filename instead
11970 of name to get library path.
11971 (Archive::include_member): Unlock external member of a thin archive.
11972
11973 * testsuite/Makefile.am (TEST_AR): New variable.
11974 (thin_archive_test_1): New test.
11975 (thin_archive_test_2): New test.
81636b3f
CC
11976 * testsuite/Makefile.in: Regenerate.
11977 * testsuite/thin_archive_main.cc: New file.
11978 * testsuite/thin_archive_test_1.cc: New file.
11979 * testsuite/thin_archive_test_2.cc: New file.
11980 * testsuite/thin_archive_test_3.cc: New file.
11981 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 11982
eff45813
CC
119832008-09-29 Cary Coutant <ccoutant@google.com>
11984
11985 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
11986 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
11987 instead of -1U.
11988 (Sized_relobj::do_finalize_local_symbols): Likewise.
11989 (Sized_relobj::map_to_kept_section): Likewise.
11990 * object.h (Sized_relobj::invalid_address): New constant.
11991 (Sized_relobj::do_output_section_offset): Check for invalid_address
11992 and return -1ULL.
11993 * output.cc (Output_reloc::local_section_offset): Use constant
11994 invalid_address instead of -1U.
11995 (Output_reloc::get_address): Likewise.
11996 (Output_section::output_address): Change -1U to -1ULL.
11997 * output.h (Output_reloc::invalid_address): New constant.
11998 * reloc.cc (Sized_relobj::write_sections): Use constant
11999 invalid_address instead of -1U.
12000 (Sized_relobj::relocate_sections): Likewise.
12001 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
12002 values for merge sections.
12003 * target-reloc.h (relocate_for_relocatable): Use constant
12004 invalid_address instead of -1U.
12005
89fc3421
CC
120062008-09-19 Cary Coutant <ccoutant@google.com>
12007
12008 Add plugin functionality for link-time optimization (LTO).
12009 * configure.ac (plugins): Add --enable-plugins option.
12010 * configure: Regenerate.
12011 * config.in: Regenerate.
12012 * Makefile.am (LIBDL): New variable.
12013 (CCFILES): Add plugin.cc.
12014 (HFILES): Add plugin.h.
12015 (ldadd_var): Add LIBDL.
12016 * Makefile.in: Regenerate.
12017
12018 * archive.cc: Include "plugin.h".
12019 (Archive::setup): Don't preread archive symbols when using a plugin.
12020 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
12021 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
12022 files.
12023 (Archive::include_member): Add symbols from plugin objects.
12024 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
12025 * descriptors.cc (Descriptors::open): Check for file descriptors
12026 abandoned by plugins.
12027 (Descriptors::claim_for_plugin): New function.
12028 * descriptors.h (Descriptors::claim_for_plugin): New function.
12029 (Open_descriptor::is_claimed): New field.
12030 (claim_descriptor_for_plugin): New function.
12031 * fileread.cc (File_read::claim_for_plugin): New function.
12032 * fileread.h (File_read::claim_for_plugin): New function.
12033 (File_read::descriptor): New function.
12034 * gold.cc: Include "plugin.h".
12035 (queue_initial_tasks): Add task to call plugin hooks for generating
12036 new object files.
12037 * main.cc: Include "plugin.h".
12038 (main): Load plugin libraries.
12039 * object.h (Pluginobj): Declare.
12040 (Object::pluginobj): New function.
12041 (Object::do_pluginobj): New function.
12042 (Object::set_target): New function.
12043 * options.cc: Include "plugin.h".
12044 (General_options::parse_plugin): New function.
12045 (General_options::General_options): Initialize plugins_ field.
12046 (General_options::add_plugin): New function.
12047 * options.h (Plugin_manager): Declare.
12048 (General_options): Add --plugin option.
12049 (General_options::has_plugins): New function.
12050 (General_options::plugins): New function.
12051 (General_options::add_plugin): New function.
12052 (General_options::plugins_): New field.
12053 * plugin.cc: New file.
12054 * plugin.h: New file.
12055 * readsyms.cc: Include "plugin.h".
12056 (Read_symbols::do_read_symbols): Check for archive before checking
12057 for ELF file. Call plugin hooks to claim files.
12058 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
12059 from a real object file; force override when processing replacement
12060 files.
12061 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
12062 (Symbol::init_base_object): Likewise.
12063 (Symbol::init_base_output_data): Likewise.
12064 (Symbol::init_base_output_segment): Likewise.
12065 (Symbol::init_base_constant): Likewise.
12066 (Symbol::init_base_undefined): Likewise.
12067 (Symbol::output_section): Assert that object is not a plugin.
12068 (Symbol_table::add_from_pluginobj): New function.
12069 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
12070 undefined.
12071 (Symbol_table::sized_write_globals): Likewise.
12072 (Symbol_table::add_from_pluginobj): Instantiate template.
12073 * symtab.h (Sized_pluginobj): Declare.
12074 (Symbol::in_real_elf): New function.
12075 (Symbol::set_in_real_elf): New function.
12076 (Symbol::in_real_elf_): New field.
12077 (Symbol_table::add_from_pluginobj): New function.
12078
12079 * testsuite/Makefile.am (AM_CFLAGS): New variable.
12080 (LIBDL): New variable.
12081 (LDADD): Add LIBDL.
12082 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
12083 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
12084 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
12085 (MOSTLYCLEANFILES): Likewise.
12086 * testsuite/Makefile.in: Regenerate.
12087 * testsuite/plugin_test.c: New file.
12088 * testsuite/plugin_test_1.sh: New file.
12089 * testsuite/plugin_test_2.sh: New file.
12090
de31bda5
ILT
120912008-09-16 Ian Lance Taylor <iant@google.com>
12092
9c2d0ef9
ILT
12093 * target-reloc.h (relocate_section): Check whether a symbol is
12094 defined by the ABI before reporting an undefined symbol error.
12095 * target.h (Target::is_defined_by_abi): Make parameter const.
12096 (Target::do_is_defined_by_abi): Likewise.
12097 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
12098 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
12099 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
12100 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
12101 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
12102 * testsuite/Makefile.in: Rebuild.
12103
de31bda5
ILT
12104 * fileread.cc (make_view): Add casts to avoid warning.
12105
9fa33bee
AO
121062008-09-16 Alexandre Oliva <aoliva@redhat.com>
12107
12108 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
12109 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
12110
183fd0e3
AO
121112008-09-16 Alexandre Oliva <aoliva@redhat.com>
12112
12113 * options.h (General_options::output_is_executable): New.
12114 (General_options::output_is_pie): New.
12115 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
12116 for shared libraries.
12117 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
12118
7be8330a
CD
121192008-09-11 Chris Demetriou <cgd@google.com>
12120
12121 * options.h (origin): New -z option.
12122 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
12123 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
12124 in DT_FLAGS_1.
12125
a9caad02
CC
121262008-09-05 Cary Coutant <ccoutant@google.com>
12127
12128 * fileread.cc (File_read::make_view): Add check for attempt to map
12129 beyond end of file.
12130
ae6dce4d
CC
121312008-09-05 Cary Coutant <ccoutant@google.com>
12132
12133 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
12134 explicit instantiations.
12135
d7ab2a47
KVH
121362008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
12137
12138 PR gold/6858
12139 * options.cc (General_options::finalize): Allow undefined symbols
12140 in shlibs if linking -shared.
12141
12142 PR gold/6859
12143 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
12144 symbols as not needing a dynsym entry.
12145
1e52a9c1
CS
121462008-08-20 Craig Silverstein <csilvers@google.com>
12147
12148 * fileread.cc (File_read::open): Do not lock the file unless it
12149 was successfully opened.
12150
d85c80a3
CC
121512008-08-14 Cary Coutant <ccoutant@google.com>
12152
12153 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
12154 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
12155 * testsuite/tls_test.cc (struct int128): 128-bit struct
12156 for testing TLS relocs with non-zero addend.
12157 (v12): New TLS variable.
12158 (t12): New test.
12159 (t_last): Add check for v12.
12160 * testsuite/tls_test.h (t12): New function.
12161 * testsuite/tls_test_main.cc (thread_routine): Call new test.
12162
2d924fd9
ILT
121632008-08-13 Ian Lance Taylor <iant@google.com>
12164
12165 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
12166 set tls_segment_ or relro_segment_.
12167 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
12168 when appropriate.
12169 * output.h (Output_section::clear_is_relro): New function.
12170 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
12171 sections specially even when output_data_ is empty.
12172 (Output_segment::maximum_alignment): When first section is relro,
12173 only force alignment for PT_LOAD segments.
12174 * script.cc (script_data_segment_align): New function.
12175 (script_data_segment_relro_end): New function.
12176 * script-c.h (script_data_segment_align): Declare.
12177 (script_data_segment_relro_end): Declare.
12178 * script-sections.h (class Script_sections): Declare
12179 data_segment_align and data_segment_relro_end. Add fields
12180 segment_align_index_ and saw_relro_end_.
12181 * script-sections.cc (class Sections_element): Add set_is_relro
12182 virtual function. Add new bool* parameter to place_orphan_here.
12183 Add get_output_section virtual function.
12184 (class Output_section_definition): Add set_is_relro. Add new
12185 bool* parameter to place_orphan_here. Add get_output_section.
12186 Add is_relro_ field.
12187 (Output_section_definition::Output_section_definition): Initialize
12188 evaluated_address_, evaluated_load_address, evaluated_addralign_,
12189 and is_relro_ fields.
12190 (Output_section_definition::place_orphan_here): Add is_relro
12191 parameter.
12192 (Output_section_definition::set_section_addresses): Set relro for
12193 output section.
12194 (Output_section_definition::alternate_constraint): Likewise.
12195 (class Orphan_output_section): Add new bool* parameter to
12196 place_orphan_here. Add get_output_section.
12197 (Orphan_output_section::place_orphan_here): Add is_relro
12198 parameter.
12199 (Script_sections::Script_sections): Initialize
12200 data_segment_align_index_ and saw_relro_end_.
12201 (Script_sections::data_segment_align): New function.
12202 (Script_sections::data_segment_relro_end): New function.
12203 (Script_sections::place_orphan): Set or clear is_relro.
12204 (Script_sections::set_section_addresses): Force alignment of first
12205 TLS section.
12206 * yyscript.y (exp): Call script_data_segment_align and
12207 script_data_segment_relro_end.
12208 * testsuite/relro_script_test.t: New file.
12209 * testsuite/relro_test.cc (using_script): Declare.
12210 (t1, t2): Test using_script.
12211 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
12212 (relro_script_test_SOURCES): Define.
12213 (relro_script_test_DEPENDENCIES): Define.
12214 (relro_script_test_LDFLAGS): Define.
12215 (relro_script_test_LDADD): Define.
12216 (relro_script_test.so): New target.
12217 * testsuite/Makefile.in: Rebuild.
12218
f827c9a9
CC
122192008-08-06 Cary Coutant <ccoutant@google.com>
12220
12221 * archive.cc (Archive::total_archives, Archive::total_members)
12222 (Archive::total_members_loaded): New variables.
12223 (Archive::setup): Add parameter. Add option to preread
12224 archive symbols.
12225 (Archive::read_armap): Add counter.
12226 (Archive::get_file_and_offset): New function.
12227 (Archive::get_elf_object_for_member): New function.
12228 (Archive::read_all_symbols): New function.
12229 (Archive::read_symbols): New function.
12230 (Archive::add_symbols): Add counters.
12231 (Archive::include_all_members): Use armap to find members if it's
12232 already built.
12233 (Archive::include_member): Skip reading symbols if already read.
12234 Factored code into Archive::get_file_and_offset and
12235 Archive::get_elf_object_for_member. Changed call to
12236 Mapfile::report_include_archive_member.
12237 (Archive::print_stats): New function.
12238 * archive.h: Declare Object and Read_symbols_data classes.
12239 (Archive::Archive): Add initializers for new members.
12240 (Archive::setup): Add parameter.
12241 (Archive::print_stats): New function.
12242 (Archive::total_archives, Archive::total_members)
12243 (Archive::total_members_loaded): New variables.
12244 (Archive::get_file_and_offset): New function.
12245 (Archive::get_elf_object_for_member): New function.
12246 (Archive::read_all_symbols): New function.
12247 (Archive::read_symbols): New function.
12248 (Archive::Archive_member): New class.
12249 (Archive::members_): New member.
12250 (Archive::num_members_): New member.
12251 * main.cc: Include archive.h.
12252 (main): Call Archive::print_stats.
12253 * mapfile.cc (Mapfile::report_include_archive_member): Delete
12254 archive parameter; member_name is now the fully-decorated name.
12255 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
12256 * options.h: (General_options): Add --preread-archive-symbols option.
12257 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
12258 Archive::setup.
12259
de4c45bd
ILT
122602008-08-04 Ian Lance Taylor <iant@google.com>
12261
12262 * symtab.h (Symbol::use_plt_offset): New function.
12263 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
12264 * powerpc.cc (Relocate::relocate): Likewise.
12265 * sparc.cc (Relocate::relocate): Likewise.
12266 * x86_64.cc (Relocate::relocate): Likewise.
12267 * testsuite/weak_plt.sh: New test.
12268 * testsuite/weak_plt_main.cc: New test.
12269 * testsuite/weak_plt_shared.cc: New test.
12270 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
12271 (check_PROGRAMS): Add weak_plt.
12272 (check_DATA): Add weak_plt_shared.so.
12273 (weak_plt_main_pic.o, weak_plt): New targets.
12274 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
12275 * testsuite/Makefile.in: Rebuild.
12276
12277 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
12278 gcctestdir/ld.
12279 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
12280 * testsuite/Makefile.in: Rebuild.
12281
323ee3f4
AM
122822008-08-04 Alan Modra <amodra@bigpond.net.au>
12283
12284 * Makefile.am (POTFILES.in): Set LC_ALL=C.
12285 * Makefile.in: Regenerate.
12286 * po/POTFILES.in: Regenerate.
12287
7c07ecec
ILT
122882008-07-29 Ian Lance Taylor <iant@google.com>
12289
12290 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
12291 symbols before other symbols.
12292 * testsuite/script_test_2.cc (test_addr): Declare.
12293 (test_addr_alias): Declare.
12294 (main): Check that test_addr and test_addr_alias have the right
cd536b21 12295 values.
7c07ecec
ILT
12296 * testsuite/script_test_2.t: Define test_addr_alias and
12297 test_addr.
12298
5778530e
ILT
122992008-07-24 Ian Lance Taylor <iant@google.com>
12300
2a00e4fb
ILT
12301 PR 5990
12302 * descriptors.cc: New file.
12303 * descriptors.h: New file.
12304 * gold-threads.h (class Hold_optional_lock): New class.
12305 * fileread.cc: Include "descriptors.h".
12306 (File_read::~File_read): Release descriptor rather than closing
12307 it.
12308 (File_read::open) [file]: Call open_descriptor rather than open.
12309 Set is_descriptor_opened_.
12310 (File_read::open) [memory]: Assert that descriptor is not open.
12311 (File_read::reopen_descriptor): New function.
12312 (File_read::release): Release descriptor.
12313 (File_read::do_read): Make non-const. Reopen descriptor.
12314 (File_read::read): Make non-const.
12315 (File_read::make_view): Reopen descriptor.
12316 (File_read::do_readv): Likewise.
12317 * fileread.h (class File_read): Add is_descriptor_opened_ field.
12318 Update declarations.
12319 * layout.cc: Include "descriptors.h".
12320 (Layout::create_build_id): Use open_descriptor rather than open.
12321 * output.cc: Include "descriptors.h".
12322 (Output_file::open): Use open_descriptor rather than open.
12323 * archive.cc (Archive::const_iterator): Change Archive to be
12324 non-const.
12325 (Archive::begin, Archive::end): Make non-const.
12326 (Archive::count_members): Likewise.
12327 * archive.h (class Archive): Update declarations.
12328 * object.h (Object::read): Make non-const.
12329 * Makefile.am (CCFILES): Add descriptors.cc.
12330 (HFILES): Add descriptors.h.
12331 * Makefile.in: Rebuild.
12332
801647d1
ILT
12333 PR 6716
12334 * gold.h: Always include <clocale>. Add Solaris workarounds
12335 following code in binutils/sysdep.h.
12336
5edd166e
ILT
12337 PR 6048
12338 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
12339 this->eh_frame_hdr_ is NULL before using it.
12340
c89ad728
ILT
12341 * dynobj.cc (Versions::Versions): Update comment.
12342
aa86f06b
ILT
12343 * dynobj.cc (Versions::Versions): If there is an soname, use it as
12344 the base version name.
12345
5778530e
ILT
12346 * stringpool.cc (Stringpool_template::add_with_length): Set key to
12347 array size plus one.
12348 (Stringpool_template::set_string_offsets): Subtract one from key
12349 before using it as an array index.
12350 (Stringpool_template::get_offset_with_length): Likewise.
12351 (Stringpool_template::write_to_buffer): Likewise.
12352 * stringpool.h (Stringpool_template::get_offset_from_key):
12353 Likewise.
12354
057ead22
ILT
123552008-07-23 Ian Lance Taylor <iant@google.com>
12356
7f649c59
ILT
12357 PR 6658
12358 * object.h (Merged_symbol_value::value): Do our best to handle a
12359 negative addend.
12360
057ead22
ILT
12361 PR 6647
12362 * script.cc (Version_script_info::get_versions): Don't add empty
12363 version tag to return value.
12364 (Version_script_info::get_symbol_version_helper): Change return
12365 type to bool. Add pversion parameter. Change all callers.
12366 (script_register_vers_node): Don't require a non-NULL tag.
12367 * script.h (class Version_script_info): Update declarations.
12368 (Version_script_info::get_symbol_version): Change return type to
12369 bool. Add version parameter. Change all callers.
12370 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
12371 handling. Handle an empty version from a version script.
12372 (Symbol_table::define_special_symbol): Likewise.
12373 * testsuite/ver_test_10.script: New file.
12374 * testsuite/ver_test_10.sh: New file.
12375 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
12376 (check_DATA): Add ver_test_10.syms.
12377 (ver_test_10.syms, ver_test_10.so): New target.
12378 * testsuite/Makefile.in: Rebuild.
12379
58e54ac2
CD
123802008-07-23 Simon Baldwin <simonb@google.com>
12381
12382 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
12383 to zero for undefined symbols from dynamic libraries.
12384
95d14cd3
ILT
123852008-07-23 Ian Lance Taylor <iant@google.com>
12386
12387 * symtab.cc (Symbol_table::resolve): Remove version parameter.
12388 Change all callers.
12389 * symtab.h (class Symbol_table): Update declaration.
12390 * testsuite/ver_test_9.cc: New file.
12391 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
12392 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
12393 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
12394 (ver_test_9.so, ver_test_9.o): New targets.
12395 * testsuite/Makefile.in: Rebuild.
12396
92de84a6
ILT
123972008-07-22 Ian Lance Taylor <iant@google.com>
12398
34810851
ILT
12399 * options.h (class General_options): Define --check-sections.
12400 * layout.cc (Layout::set_segment_offsets): Handle
12401 --check-sections.
12402
af6156ef
ILT
12403 * options.h (class General_options): Define -n/--nmagic and
12404 -N/--omagic.
12405 * options.cc (General_options::finalize): For -n/--nmagic or
12406 -N/--omagic, set -static.
12407 * layout.cc (Layout::attach_allocated_section_to_segment): If
12408 -N/--omagic, don't put read-only and read-write sections in
12409 different segments.
12410 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
12411 finding a read-only segment.
12412 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
12413 don't set the minimum segment alignment to the common page size,
12414 and don't set the file offset to the address modulo the page size.
12415 * script-sections.cc (Script_sections::create_segments): If
12416 -n/--omagic, don't put read-only and read-write sections in
12417 different segments.
12418
92de84a6
ILT
12419 * cref.cc: New file.
12420 * cref.h: New file.
12421 * options.h (class General_options): Add --print-symbol-counts.
12422 * main.cc (main): Issue defined symbol report if requested.
12423 * archive.cc (Archive::interpret_header): Make into a const member
12424 function.
12425 (Archive::add_symbols): Call Input_objects::archive_start and
12426 archive_stop.
12427 (Archive::const_iterator): Define new class.
12428 (Archive::begin, Archive::end): New functions.
12429 (Archive::include_all_members): Rewrite to use iterator.
12430 (Archive::count_members): New function.
12431 * archive.h (class Archive): Update declarations.
12432 (Archive::filename): New function.
12433 * object.cc: Include "cref.h".
12434 (Sized_relobj::Sized_relobj): Initialize defined_count_.
12435 (Sized_relobj::do_get_global_symbol_counts): New function.
12436 (Input_objects::add_object): Add object to cross-referencer.
12437 (Input_objects::archive_start): New function.
12438 (Input_objects::archive_stop): New function.
12439 (Input_objects::print_symbol_counts): New function.
12440 * object.h: Declare Cref and Archive.
12441 (Object::get_global_symbol_counts): New function.
12442 (Object::do_get_global_symbol_counts): New pure virtual function.
12443 (class Sized_relobj): Add defined_count_ field. Update
12444 declarations.
12445 (class Input_objects): Add cref_ field. Update constructor.
12446 Update declarations.
12447 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
12448 defined_count_.
12449 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
12450 symbol counts.
12451 (Sized_dynobj::do_get_global_symbol_counts): New function.
12452 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
12453 defined_count_. Update declarations. Define Symbols typedef.
12454 * symtab.cc (Symbol_table::add_from_relobj): Add defined
12455 parameter. Change all callers.
12456 (Symbol_table::add_from_dynobj): Add sympointers and defined
12457 parameters. Change all callers.
12458 * symtab.h (class Symbol_table): Update declarations.
12459 * Makefile.am (CCFILES): Add cref.cc.
12460 (HFILES): Add cref.h.
12461 * Makefile.in: Rebuild.
12462
3f7c5e1d
CD
124632008-07-22 Simon Baldwin <simonb@google.com>
12464
12465 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
12466 to zero when writing undefined symbols.
12467
e0b64032
ILT
124682008-07-22 Ian Lance Taylor <iant@google.com>
12469
12470 * output.cc (Output_section::add_input_section): Don't try to
12471 merge empty merge sections.
12472
096b02cf
CS
124732008-07-21 Craig Silverstein <csilvers@google.com>
12474
12475 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
12476 Include symbol version in error message.
cd536b21 12477
1d1f116d
CD
124782008-07-20 Chris Demetriou <cgd@google.com>
12479
cd536b21 12480 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
12481 (RANDOM_SEED_CFLAGS): New substituted variable.
12482 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
12483 * configure: Rebuild.
12484 * Makefile.in: Likewise.
12485 * testsuite/Makefile.in: Likewise.
12486
a18f591e
ILT
124872008-07-18 Ian Lance Taylor <iant@google.com>
12488
12489 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
12490 where we see NAME/NULL and NAME/VERSION as separate symbols.
12491 * testsuite/ver_test_main.cc (main): Call t4.
12492 (t4, t4_2a): Define.
12493 * testsuite/ver_test_2.cc (t4_2): Define.
12494 * testsuite/ver_test_2.script: Put t4_2a in VER2.
12495 * testsuite/ver_test_4.cc (t4_2a): Define.
12496 * testsuite/ver_test_4.script: Put t4_2a in VER2.
12497 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
12498
c6e3f6ed
ILT
124992008-07-17 Ian Lance Taylor <iant@google.com>
12500
12501 * dynobj.cc (Versions::add_def): If we give an error about a
12502 missing version, go ahead and create the version anyhow.
12503
ef9beddf
ILT
125042008-07-10 Ian Lance Taylor <iant@google.com>
12505
12506 Handle output sections with more than 0x7fffffff bytes.
12507 * object.h (class Relobj): Change map_to_output_ to
12508 output_sections_, and just keep a section pointer. Change all
12509 uses. Move comdat group support to Sized_relobj.
12510 (Relobj::is_section_specially_mapped): Remove.
12511 (Relobj::output_section): Remove poff parameter. Change all
12512 callers.
12513 (Relobj::output_section_offset): New function.
12514 (Relobj::set_section_offset): Rewrite.
12515 (Relobj::map_to_output): Remove.
12516 (Relobj::output_sections): New function.
12517 (Relobj::do_output_section_offset): New pure virtual function.
12518 (Relobj::do_set_section_offset): Likewise.
12519 (class Sized_relobj): Add section_offsets_ field. Add comdat
12520 group support from Relobj. Update declarations.
12521 (Sized_relobj::get_output_section_offset): New function.
12522 (Sized_relobj::do_output_section_offset): New function.
12523 (Sized_relobj::do_set_section_offset): New function.
12524 * object.cc (Relobj::output_section_address): Remove.
12525 (Sized_relobj::Sized_relobj): Initialize new fields.
12526 (Sized_relobj::include_section_group): Cast find_kept_object to
12527 Sized_relobj.
12528 (Sized_relobj::include_linkonce_section): Likewise.
12529 (Sized_relobj::do_layout): Use separate arrays for output section
12530 and output offset.
12531 (Sized_relobj::do_count_local_symbols): Change map_to_output to
12532 output_sections.
12533 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
12534 output_sections and section_offsets.
12535 (Sized_relobj::write_local_symbols): Likewise.
12536 (map_to_kept_section): Compute output address directly.
12537 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
12538 output_sections and section_offsets.
12539 (Sized_relobj::write_sections): Likewise.
12540 (Sized_relobj::relocate_sections): Likewise.
12541 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
12542 * output.h (class Output_reloc): Update declarations. Change
12543 u2_.relobj to Sized_relobj*.
12544 (class Output_data_reloc): Change add functions to use
12545 Sized_relobj*.
12546 * output.cc (Output_reloc::Output_reloc): Change relobj to
12547 Sized_relobj*.
12548 (Output_reloc::local_section_offset): Change return type to
12549 Elf_Addr. Use get_output_section_offset.
12550 (Output_reloc::get_address): Likewise.
12551 (Output_section::is_input_address_mapped): Don't call
12552 is_section_specially_mapped.
12553 (Output_section::output_offset): Likewise.
12554 (Output_section::output_address): Likewise.
12555 (Output_section::starting_output_address): Likewise.
12556 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
12557 parameter to Sized_relobj*.
12558 (Copy_relocs::need_copy_reloc): Likewise.
12559 (Copy_relocs::save): Likewise.
12560 * copy-relocs.h (class Copy_relocs): Update declarations.
12561 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
12562 Sized_relobj*. Change relobj_ field to Sized_relobj*.
12563 * target-reloc.h (relocate_for_relocatable): Change
12564 offset_in_output_section type to Elf_Addr. Change code that uses
12565 it as well.
12566 * layout.cc (Layout::layout): Always set *off.
12567 * mapfile.cc (Mapfile::print_input_section): Use
12568 output_section_offset.
12569 * i386.cc (Target_i386::copy_reloc): Change object parameter to
12570 Sized_relobj*.
12571 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
12572 * sparc.cc (Target_sparc::copy_reloc): Likewise.
12573 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
12574
5cb66f97
ILT
125752008-07-03 Ian Lance Taylor <iant@google.com>
12576
12577 * layout.cc (Layout::include_section): Do not discard unrecognized
12578 SHT_STRTAB sections.
12579
afe47622
CS
125802008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
12581
12582 * script.cc (Lex::can_continue_name): Make '?' allowable in
12583 version-script names.
12584 * testsuite/version_script.map: Change glob pattern to use '?'
12585
5adf9721
ILT
125862008-06-30 Manish Singh <yosh@gimp.org>
12587
12588 PR 6585
12589 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
12590 Correct typo.
12591
e6fde208
ILT
125922008-06-30 Ian Lance Taylor <iant@google.com>
12593
12594 PR 6660
12595 PR 6682
12596 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
12597 versions]: Don't try to read the value in the contents, since we
12598 don't use it. Use the template endianness when writing.
12599
3f2e6a2d
CC
126002008-06-25 Cary Coutant <ccoutant@google.com>
12601
12602 * fileread.cc (File_read::make_view): Assert on zero-length view.
12603 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
12604 symbol table when there are no symbols to read.
12605
c43d3a48
CS
126062008-06-23 Craig Silverstein <csilvers@google.com>
12607
12608 * version.cc (version_string): Bump to 1.7
12609
5f494ea0
CS
126102008-06-18 Craig Silverstein <csilvers@google.com>
12611
12612 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
12613 constant 0xFFFF to type Valtype.
12614 (Powerpc_relocate_functions::rel16_ha): Likewise.
12615
c42e122e
ILT
126162008-06-17 Ian Lance Taylor <iant@google.com>
12617
f34787f8
ILT
12618 * output.h (Output_section::Input_section): Initialize p2align_ to
12619 zero for Output_section_data constructors.
12620 (Output_section::Input_section::addralign): If not an input
12621 section, return the alignment of the Output_section_data.
12622 * testsuite/copy_test.cc: New file.
12623 * testsuite/copy_test_1.cc: New file.
12624 * testsuite/copy_test_2.cc: New file.
12625 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
12626 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
12627 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
12628 (copy_test_1_pic.o, copy_test_1.so): New targets.
12629 (copy_test_2_pic.o, copy_test_2.so): New targets.
12630 * testsuite/Makefile.in: Rebuild.
12631
c42e122e
ILT
12632 * script-sections.cc (Script_sections::place_orphan): Initialize
12633 local variable exact.
12634
ce3ac18a
DE
126352008-06-13 David Edelsohn <edelsohn@gnu.org>
12636
12637 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
12638
42cacb20
DE
126392008-06-12 David Edelsohn <edelsohn@gnu.org>
12640 David S. Miller <davem@davemloft.net>
12641
12642 * powerpc.cc: New file.
12643 * Makefile.am (TARGETSOURCES): Add powerpc.cc
12644 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
12645 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
12646 * Makefile.in: Rebuild.
12647
7b308235
ILT
126482008-06-09 Ian Lance Taylor <iant@google.com>
12649
12650 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
12651 <exception>.
12652 (throwing, orig_terminate): New static variables.
12653 (terminate_handler): New static function.
12654 (t2): Set terminate handler.
12655
f0b886e3
ILT
126562008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
12657
12658 PR 6584
cd536b21 12659 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
12660 alignment.
12661
3e90f135
CC
126622008-05-30 Cary Coutant <ccoutant@google.com>
12663
12664 * archive.cc (Archive::include_all_members) Correct to step
12665 over symbol table and extended name table in thin archives.
12666
e09ad04a
ILT
126672008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
12668
12669 PR 6407
12670 * target-reloc.h (relocate_for_relocatable): Fix new_offset
12671 calculation.
12672
62b01cb5
ILT
126732008-05-28 Caleb Howe <cshowe@google.com>
12674
12675 * reduced_debug_output.cc: New file.
12676 * reduced_debug_output.h: New file.
92de84a6 12677 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
12678 * options.cc (General_options::finalize): Add strip_debug_non_line
12679 to the strip heirarchy.
12680 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
12681 fields.
12682 * layout.cc: Include "reduced_debug_output.h".
12683 (Layout::Layout): Initialize new fields.
12684 (line_only_debug_sections): New static array.
12685 (is_lines_only_debug_sections): New static inline function.
12686 (Layout::include_section): Handle --strip-debug-non-line.
12687 (Layout::make_output_section): If --strip-debug-non-line, build
12688 new output sections for .debug_abbrev and .debug_info.
12689 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
12690 gold. Warn about possible overflow.
12691 (read_signed_LEB_128): Likewise.
12692 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
12693 (read_signed_LEB_128): Declare.
12694 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
12695 (HFILES): Add reduced_debug_output.h.
12696 * Makefile.in: Rebuild.
12697
7d9e3d98
ILT
126982008-05-21 Ian Lance Taylor <iant@google.com>
12699
12700 * mapfile.cc: New file.
12701 * mapfile.h: New file.
12702 * options.h (class General_options): Add -M/--print-map and -Map.
12703 * options.cc (General_options::finalize): Make -M equivalent to
12704 -Map -.
12705 * main.cc: Include <cstdio> and "mapfile.h".
12706 (main): Open mapfile if requested.
12707 * gold.cc (class Middle_runner): Add mapfile_ field. Update
12708 constructor. Change caller.
12709 (queue_initial_tasks): Add mapfile parameter. Change caller.
12710 (queue_middle_tasks): Likewise.
12711 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
12712 declarations.
12713 * archive.cc: Include "mapfile.h".
12714 (Archive::add_symbols): Add mapfile parameter. Change all
12715 callers. Pass mapfile, symbol, and reason to include_member.
12716 (Archive::include_all_members): Add mapfile parameter. Change all
12717 callers.
12718 (Archive::include_member): Add mapfile, sym, and why parameters.
12719 Change all callers. Report inclusion to map file.
12720 * archive.h: Include "fileread.h".
12721 (class Archive): Update declarations.
12722 (Archive::file): New const method.
12723 (class Add_archive_symbols): Add mapfile_ field. Update
12724 constructor. Change all callers.
12725 * readsyms.h (class Read_symbols): Likewise.
12726 (class Finish_group): Likewise.
12727 (class Read_script): Likewise.
12728 * common.cc: Include "mapfile.h".
12729 (Symbol_table::allocate_commons): Add mapfile parameter. Change
12730 all callers.
12731 (Symbol_table::do_allocate_commons): Likewise.
12732 (Symbol_table::do_allocate_commons_list): Likewise. Report common
12733 symbol allocation to mapfile.
12734 * common.h (class Allocate_commons_task): Add mapfile_ field.
12735 Update constructor. Change all callers.
12736 * symtab.h (class Symbol_table): Update declarations.
12737 * layout.cc: Include "mapfile.h".
12738 (Layout_task_runner::run): Print information to mapfile.
12739 (Layout::create_gold_note): Change Output_data_fixed_space to
12740 Output_data_zero_fill.
12741 (Layout::create_build_id): Likewise.
12742 (Layout::print_to_mapfile): New function.
12743 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
12744 constructor. Change caller.
12745 (class Layout): Declare print_to_mapfile.
12746 * output.cc (Output_section::Input_section::print_to_mapfile): New
12747 function.
12748 (Output_section::add_input_section): If producing a map, always
12749 add to input_sections_ list.
12750 (Output_section::do_print_to_mapfile): New function.
12751 (Output_segment::print_sections_to_mapfile): New function.
12752 (Output_segment::print_section_list_to_mapfile): New function.
12753 * output.h: Include "mapfile.h".
12754 (Output_data::print_to_mapfile): New function.
12755 (Output_data::do_print_to_mapfile): New virtual function.
12756 (Output_segment_headers::do_print_to_mapfile): New function.
12757 (Output_file_header::do_print_to_mapfile): New function.
12758 (Output_data_const::do_print_to_mapfile): New function.
12759 (class Output_data_const_buffer): Add map_name_ field. Update
12760 constructor. Change all callers. Add do_print_to_mapfile
12761 function.
12762 (class Output_data_fixed_space): Likewise.
12763 (class Output_data_space): Likewise.
12764 (class Output_data_zero_fill): New class.
12765 (Output_data_strtab::do_print_to_mapfile): New function.
12766 (Output_data_reloc_base::do_print_to_mapfile): New function.
12767 (Output_relocatable_relocs::do_print_to_mapfile): New function.
12768 (Output_data_group::do_print_to_mapfile): New function.
12769 (Output_data_got::do_print_to_mapfile): New function.
12770 (Output_data_dynamic::do_print_to_mapfile): New function.
12771 (Output_symtab_xindex::do_print_to_mapfile): New function.
12772 (class Output_section): Declare do_print_to_mapflie. Declare
12773 print_to_mapfile in Input_section.
12774 (class Output_segment): Declare new functions.
12775 * object.h (Sized_relobj::symbol_count): New function.
12776 * script-sections.cc
12777 (Output_section_element_dot_assignment::set_section_addresses):
12778 Change Output_data_fixed_space to Output_data_zero_fill.
12779 (Output_data_expression::do_print_to_mapfile): New function.
12780 * script.cc (read_input_script): Add mapfile parameter. Change
12781 all callers.
12782 * script.h (read_input_script): Update declaration.
12783 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
12784 (Eh_frame::do_print_to_mapfile): New function.
12785 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
12786 (Output_merge_string::do_print_to_mapfile): New function.
12787 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
12788 function.
12789 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
12790 function.
12791 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
12792 function.
12793 * Makefile.am (CCFILES): Add mapfile.cc.
12794 (HFILES): Add mapfile.h.
12795 * Makefile.in: Rebuild.
12796
9f1d377b
ILT
127972008-05-19 Ian Lance Taylor <iant@google.com>
12798
12799 * options.h (class General_options): Add -z relro.
12800 * layout.cc (Layout::Layout): Initialize relro_segment_.
12801 (Layout::add_output_section_data): Return the output section.
12802 (Layout::make_output_section): Rcognize relro sections and mark
12803 them appropriately.
12804 (Layout::attach_allocated_section_to_segment): Put relro sections
12805 in a PT_GNU_RELRO segment.
12806 (Layout::create_initial_dynamic_sections): Mark the .dynamic
12807 section as relro.
12808 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
12809 PT_TLS segments.
12810 (Layout::linkonce_mapping): Map d.rel.ro.local to
12811 .data.rel.ro.local.
12812 (Layout::output_section_name): Us .data.rel.ro.local for any
12813 section which begins with that.
12814 * layout.h (class Layout): Update add_output_section_data
12815 declaration. Add relro_segment_ field.
12816 * output.cc (Output_section::Output_section): Initialize is_relro_
12817 and is_relro_local_ fields.
12818 (Output_segment::add_output_section): Group relro sections.
12819 (Output_segment::is_first_section_relro): New function.
12820 (Output_segment::maximum_alignment): If there is a relro section,
12821 align the segment to the common page size.
12822 (Output_segment::set_section_addresses): Track whether we are
12823 looking at relro sections. If the last section is a relro
12824 section, align to the common page size.
12825 (Output_segment::set_section_list_addresses): Add in_relro
12826 parameter. Change all callers. Align to the page size when
12827 moving from relro to non-relro section.
12828 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
12829 segment.
12830 * output.h (class Output_section): Add is_relro_ and
12831 is_relro_local_ fields.
12832 (Output_section::is_relro): New function.
12833 (Output_section::set_is_relro): New function.
12834 (Output_section::is_relro_local): New function.
12835 (Output_section::set_is_relro_local): New function.
12836 (class Output_segment): Update declarations.
12837 * i386.cc (Target_i386::got_section): Mark .got section as relro.
12838 * sparc.cc (Target_sparc::got_section): Likewise.
12839 * x86_64.cc (Target_x86_64::got_section): Likewise.
12840 * testsuite/relro_test_main.cc: New file.
12841 * testsuite/relro_test.cc: New file.
12842 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
12843 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
12844 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
12845 (relro_test.so, relro_test_pic.o): New targets.
12846 * testsuite/Makefile.in: Rebuild.
12847
a984ee1d
ILT
128482008-05-16 Ian Lance Taylor <iant@google.com>
12849
01676dcd
ILT
12850 * output.cc (Output_segment::add_output_section): Remove front
12851 parameter.
12852 * output.h (class Output_segment): Remove
12853 add_initial_output_section and overloaded add_output_section.
12854 Update declaration of remaining add_output_section.
12855 * layout.cc (Layout::create_interp): Call add_output_section
12856 rather than add_initial_output_section.
12857 (Layout::finish_dynamic_section): Likewise.
12858
497897f9
ILT
12859 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
12860 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
12861 know the dynamic type.
12862 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
12863 field. Initialize it in constructor.
12864 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
12865 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
12866 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
12867 reloc.
12868
a984ee1d
ILT
12869 * output.cc (Output_reloc::get_address): Change return type to
12870 Elf_Addr.
12871 * output.h (class Output_reloc): Update get_address declaration.
12872 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
12873 for section addresses.
12874
55ba0940
ILT
128752008-05-09 Ian Lance Taylor <iant@google.com>
12876
12877 PR 6493
12878 * gold.cc (gold_nomem): Use return value of write.
12879
75517b77
ILT
128802008-05-08 Ian Lance Taylor <iant@google.com>
12881
12882 * symtab.c (Symbol::init_base_output_data): Add version
12883 parameter. Change all callers.
12884 (Symbol::init_base_output_segment): Likewise.
12885 (Symbol::init_base_constant): Likewise.
12886 (Symbol::init_base_undefined): Likewise.
12887 (Sized_symbol::init_output_data): Likewise.
12888 (Sized_symbol::init_output_segment): Likewise.
12889 (Sized_symbol::init_constant): Likewise.
12890 (Sized_symbol::init_undefined): Likewise.
12891 (Symbol_table::do_define_in_output_data): If the new symbol has a
12892 version, mark it as the default.
12893 (Symbol_table::do_define_in_output_segment): Likewise.
12894 (Symbol_table::do_define_as_constant): Likewise.
12895 * symtab.h (class Symbol): Update declarations.
12896 (class Sized_symbol): Likewise.
12897 * resolve.cc (Symbol::override_version): New function.
c42e122e 12898 (Symbol::override_base): Call override_version.
75517b77
ILT
12899 (Symbol::override_base_with_special): Likewise.
12900 * testsuite/ver_script_8.script: New file.
12901 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
12902 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
12903 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
12904 (ver_test_8_1.so, ver_test_8_2.so): New targets.
12905
f1f70eae
ILT
129062008-05-06 Ian Lance Taylor <iant@google.com>
12907
f3e9c5c5
ILT
12908 PR 6049
12909 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
12910 functions.
12911 (class General_options): Remove existing --undefined, and add
12912 --no-undefined instead. Add new --undefined as synonym for -u.
12913 * archive.cc (Archive::add_symbols): Check whether symbol was
12914 named with -u.
12915 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
12916 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
12917 all uses. Add IS_UNDEFINED. Update declarations to split
12918 different versions of init_base. Declare init_base_undefined.
12919 (Symbol::is_defined): Handle IS_UNDEFINED.
12920 (Symbol::is_undefined): Likewise.
12921 (Symbol::is_weak_undefined): Call is_undefined.
12922 (Symbol::is_absolute): Handle IS_CONSTANT.
12923 (class Sized_symbol): Update declarations to split different
12924 versions of init. Declare init_undefined.
12925 (class Symbol_table): Declare new functions.
12926 * symtab.cc (Symbol::init_base_object): Rename from init_base.
12927 Change all callers.
12928 (Symbol::init_base_output_data): Likewise.
12929 (Symbol::init_base_output_segment): Likewise.
12930 (Symbol::init_base_constant): Likewise.
12931 (Symbol::init_base_undefined): New function.
12932 (Sized_symbol::init_object): Rename from init. Change all
12933 callers.
12934 (Sized_symbol::init_output_data): Likewise.
12935 (Sized_symbol::init_output_segment): Likewise.
12936 (Sized_symbol::init_constant): Likewise.
12937 (Sized_symbol::init_undefined): New function.
12938 (Symbol_table::add_undefined_symbols_from_command_line): New
12939 function.
12940 (Symbol_table::do_add_undefined_symbols_from_command_line): New
12941 function.
12942 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
12943 (Symbol::output_section): Likewise.
12944 (Symbol::set_output_section): Likewise.
12945 (Symbol_table::sized_finalize_symbol): Likewise.
12946 (Symbol_table::sized_write_globals): Likewise.
12947 * resolve.cc (Symbol_table::should_override): Likewise.
12948 (Symbol::override_base_with_special): Likewise.
12949
8bdcdf2c
ILT
12950 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
12951 symbol, change it to have default visibility.
12952 * testsuite/protected_1.cc: New file.
12953 * testsuite/protected_2.cc: New file.
12954 * testsuite/protected_3.cc: New file.
12955 * testsuite/protected_main_1.cc: New file.
12956 * testsuite/protected_main_2.cc: New file.
12957 * testsuite/protected_main_3.cc: New file.
12958 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
12959 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
12960 (protected_1_LDFLAGS, protected_1_LDADD): Define.
12961 (protected_1.so): New target.
12962 (protected_1_pic.o, protected_2_pic.o): New targets.
12963 (protected_3_pic.o): New target.
12964 (check_PROGRAMS): Add protected_2.
12965 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
12966 (protected_2_LDFLAGS, protected_2_LDADD): Define.
12967 * testsuite/Makefile.in: Rebuild.
12968
2b706932
ILT
12969 * options.h (DEFINE_var): Add set_user_set_##varname__.
12970 (DEFINE_bool_alias): New macro.
12971 (class General_options): Define -Bstatic using DEFINE_bool_alias
12972 rather than DEFINE_special. Add --undefined as an alias for -z
12973 defs.
12974 * options.cc (General_options::parse_Bstatic): Remove.
12975
d82a5bcc
ILT
12976 * options.h (class General_options): Add --fatal-warnings.
12977 * main.cc (main): Implement --fatal-warnings.
12978 * errors.h (Errors::warning_count): New function.
12979
f1f70eae
ILT
12980 * options.h (class General_options): Add -Bsymbolic-functions.
12981 * symtab.h (Symbol::is_preemptible): Check for
12982 -Bsymbolic-functions.
12983
8825ac63
ILT
129842008-05-05 Ian Lance Taylor <iant@google.com>
12985
d98bc257
ILT
12986 * options.h (DEFINE_bool): For DASH_Z, create the negative option
12987 as noVARNAME rather than no-VARNAME.
12988 (class General_options): Add option -z combreloc.
12989 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
12990 get_address.
12991 (Output_reloc::sort_before) [SHT_REL]: New function.
12992 (Output_reloc::sort_before) [SHT_RELA]: New function.
12993 (class Output_data_reloc_base): Add sort_relocs_ field. Define
12994 Sort_relocs_comparison.
12995 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
12996 parameter. Change all callers.
12997 (Output_data_reloc::Output_data_reloc) [both versions]: Add
12998 sort_relocs parameter. Change all callers.
12999 * output.cc (Output_reloc::get_address): New function, broken out
13000 of write_rel.
13001 (Output_reloc::write_rel): Call it.
13002 (Output_reloc::compare): New function.
13003 (Output_data_reloc_base::do_write): Optionally sort relocs.
13004
60b2b4e7
ILT
13005 * configure.ac: If targ_extra_obj is set, link it in.
13006 * configure.tgt: Initialize all variables.
13007 (x86_64*): Set targ_extra_obj and targ_extra_size.
13008 * configure: Rebuild.
13009
8825ac63
ILT
13010 * object.cc (Sized_relobj::include_section_group): Adjust section
13011 indexes read from group data. Build vector to pass to
13012 layout_group.
13013 * layout.cc (Layout::layout_group): Add flags and shndxes
13014 parameters. Remove contents parameter. Change caller. Update
13015 explicit instantiations.
13016 * layout.h (class Layout): Update layout_group declaration.
13017 * output.cc (Output_data_group::Output_data_group): Add flags and
13018 input_shndxes parameters. Remove contents parameter. Change
13019 caller.
13020 (Output_data_group::do_write): Change input_sections_ to
13021 input_shndxes_.
13022 * output.h (class Output_data_group): Update constructor
13023 declaration. Rename input_sections_ to input_shndxes_.
13024 * testsuite/many_sections_test.cc: Add template.
13025
e94cf127
CC
130262008-04-30 Cary Coutant <ccoutant@google.com>
13027
4418b2d5
CC
13028 * target-reloc.h (relocate_section): Fix dead-pointer bug.
13029
e94cf127
CC
13030 * layout.cc (Layout::include_section): Refactored check for debug
13031 info section.
13032 (Layout::add_comdat): Add new parameters. Change type
13033 of signature parameter. Add object and shndx to signatures table.
13034 (Layout::find_kept_object): New function.
13035 * layout.h: Include <cstring>.
13036 (Layout::is_debug_info_section): New function.
13037 (Layout::add_comdat): Add new parameters.
13038 (Layout::find_kept_object): New function.
13039 (Layout::Kept_section): New struct.
13040 (Layout::Signatures): Change type of map range.
13041 * object.cc (Relobj::output_section_address): New function.
13042 (Sized_relobj::include_section_group): Add new parameters. Change
13043 calls to Layout::add_comdat. Change to build table of kept comdat
13044 groups and table mapping discarded sections to kept sections.
13045 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
13046 (Sized_relobj::do_layout): Change calls to include_section_group and
13047 include_linkonce_section.
13048 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
13049 value to zero when section is discarded.
13050 (Sized_relobj::map_to_kept_section): New function.
13051 * object.h (Relobj::output_section_address): New function.
13052 (Relobj::Comdat_group): New type.
13053 (Relobj::find_comdat_group): New function.
13054 (Relobj::Comdat_group_table): New type.
13055 (Relobj::Kept_comdat_section): New type.
13056 (Relobj::Kept_comdat_section_table): New type.
13057 (Relobj::add_comdat_group): New function.
13058 (Relobj::set_kept_comdat_section): New function.
13059 (Relobj::get_kept_comdat_section): New function.
13060 (Relobj::comdat_groups_): New field.
13061 (Relobj::kept_comdat_sections_): New field.
13062 (Symbol_value::input_value): Update comment.
13063 (Sized_relobj::map_to_kept_section) New function.
13064 (Sized_relobj::include_linkonce_section): Add new parameter.
13065 * target-reloc.h (Comdat_behavior): New type.
13066 (get_comdat_behavior): New function.
13067 (relocate_section): Add code to map a discarded section to the
13068 corresponding kept section when applying a relocation.
13069
e4e5049b
CS
130702008-04-30 Craig Silverstein <csilvers@google.com>
13071
13072 * dwarf_reader.cc (next_generation_count): New static var.
13073 (Addr2line_cache_entry): New struct.
13074 (addr2line_cache): New static var.
13075 (Dwarf_line_info::one_addr2line): Added caching.
13076 (Dwarf_line_info::clear_addr2line_cache): New function.
13077 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
13078 cache-size parameter.
13079 (Dwarf_line_info::one_addr2line_cache): New function.
13080 * symtab.cc (Symbol_table::detect_odr_violations): Pass
13081 new cache-size argument to one_addr2line(), and clear cache.
13082
d09e9154
CC
130832008-04-28 Cary Coutant <ccoutant@google.com>
13084
13085 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
13086 R_386_PC8 relocations.
13087
7ef73768
ILT
130882008-04-23 Ian Lance Taylor <iant@google.com>
13089
55438702
ILT
13090 * object.cc (Sized_relobj::include_section_group): Check for
13091 invalid section group.
13092
c165fb93
ILT
13093 * object.cc (make_elf_object): Correct test for 64-bit ELF file
13094 header size.
13095
7ef73768
ILT
13096 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
13097 than read for file header.
13098 * archive.cc (Archive::include_member): Likewise.
13099
6194aaab
L
131002008-04-23 Paolo Bonzini <bonzini@gnu.org>
13101
13102 * aclocal.m4: Regenerate.
13103 * configure: Regenerate.
13104
d491d34e
ILT
131052008-04-19 Ian Lance Taylor <iant@google.com>
13106
5ea2bac6
ILT
13107 * version.cc (version_string): Bump to 1.6.
13108
7bc3e21a
ILT
13109 * testsuite/Makefile.am (many_sections_r_test): New target.
13110 (many_sections_r_test_SOURCES): Remove.
13111 (many_sections_r_test_DEPENDENCIES): Remove.
13112 (many_sections_r_test_LDFLAGS): Remove.
13113 (many_sections_r_test_LDADD): Remove.
13114
7fcd3aa9
ILT
13115 * object.cc (Sized_relobj::do_add_symbols): Always pass
13116 local_symbol_count_ to add_from_relobj.
13117
4c94d6ae
ILT
13118 * testsuite/Makefile.am (many_sections_check.h): Only check one in
13119 every thousand variables.
13120 * testsuite/Makefile.in: Rebuild.
13121
d491d34e
ILT
13122 * object.cc (Xindex::initialize_symtab_xindex): New function.
13123 (Xindex::read_symtab_xindex): New function.
13124 (Xindex::sym_xindex_to_shndx): New function.
13125 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
13126 available.
13127 (Sized_relobj::do_initialize_xindex): New function.
13128 (Sized_relobj::do_read_symbols): Adjust section links.
13129 (Sized_relobj::symbol_section_and_value): Add is_ordinary
13130 parameter. Change all callers.
13131 (Sized_relobj::include_section_group): Adjust section links and
13132 symbol section indexes.
13133 (Sized_relobj::do_layout): Adjust section links.
13134 (Sized_relobj::do_count_local_symbols): Adjust section links and
13135 symbol section indexes.
13136 (Sized_relobj::do_finalize_local_symbols): Distinguish between
13137 ordinary and special symbols.
13138 (Sized_relobj::write_local_symbols): Add symtab_xindex and
13139 dynsym_xindex parameters. Change all callers. Adjust section
13140 links. Use SHN_XINDEX when needed.
13141 (Sized_relobj::get_symbol_location_info): Adjust section links.
13142 Don't get fooled by special symbols.
13143 * object.h (class Xindex): Define.
13144 (class Object): Add xindex_ parameter. Declare virtual functoin
13145 do_initialize_xindex.
13146 (Object::adjust_sym_shndx): New function.
13147 (Object::set_xindex): New protected function.
13148 (class Symbol_value): Add is_ordinary_shndx_ field.
13149 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
13150 (Symbol_value::value): Assert ordinary section.
13151 (Symbol_value::initialize_input_to_output_map): Likewise.
13152 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
13153 Change all callers.
13154 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
13155 all callers.
13156 (class Sized_relobj): Update declarations.
13157 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
13158 parameter. Change all callers.
13159 (Sized_relobj::adjust_shndx): New function.
13160 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
13161 field.
13162 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
13163 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
13164 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
13165 (Sized_dynobj::read_dynsym_section): Adjust section links.
13166 (Sized_dynobj::read_dynamic): Likewise.
13167 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
13168 section links.
13169 (Sized_dynobj::do_initialize_xindex): New function.
13170 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
13171 do_initialize_xindex.
13172 (Sized_dynobj::adjust_shndx): New function.
13173 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
13174 dynsym_xindex_ fields.
13175 (Layout::finalize): Add a call to set_section_indexes before
13176 creating the symtab sections.
13177 (Layout::set_section_indexes): Don't do anything if the section
13178 already has a section index.
13179 (Layout::create_symtab_sections): Add shnum parameter. Change
13180 caller. Create .symtab_shndx section if needed.
13181 (Layout::create_shdrs): Add shstrtab_section parameter. Change
13182 caller.
13183 (Layout::allocated_output_section_count): New function.
13184 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
13185 needed.
13186 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
13187 fields. Update declarations.
13188 (Layout::symtab_xindex): New function.
13189 (Layout::dynsym_xindex): New function.
13190 (class Write_symbols_task): Add layout_ field.
13191 (Write_symbols_task::Write_symbols_task): Add layout parameter.
13192 Change caller.
13193 * output.cc (Output_section_headers::Output_section_headers): Add
13194 shstrtab_section parameter. Change all callers.
13195 (Output_section_headers::do_sized_write): Store overflow values
13196 for section count and section string table section index in
13197 section header zero.
13198 (Output_file_header::do_sized_write): Check for overflow of
13199 section count and section string table section index.
13200 (Output_symtab_xindex::do_write): New function.
13201 (Output_symtab_xindex::endian_do_write): New function.
13202 * output.h (class Output_section_headers): Add shstrtab_section_.
13203 Update declarations.
13204 (class Output_symtab_xindex): Define.
13205 (Output_section::has_out_shndx): New function.
13206 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
13207 field.
13208 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
13209 Change all callers.
13210 (Sized_symbol::init): Likewise.
13211 (Symbol::output_section): Check for ordinary symbol.
13212 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
13213 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
13214 callers.
13215 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
13216 Change all callers. Simplify handling of symbols from sections
13217 not included in the link.
13218 (Symbol_table::add_from_dynobj): Handle ordinary symbol
13219 distinction.
13220 (Weak_alias_sorter::operator()): Assert that symbols are
13221 ordinary.
13222 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
13223 distinction.
13224 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
13225 parameters. Change all callers.
13226 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
13227 symbol distinction. Use SHN_XINDEX when needed.
13228 (Symbol_table::write_section_symbol): Add symtab_xindex
13229 parameter. Change all callers.
13230 (Symbol_table::sized_write_section_symbol): Likewise. Use
13231 SHN_XINDEX when needed.
13232 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
13233 declarations.
13234 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
13235 (Symbol::is_defined): Check is_ordinary.
13236 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
13237 (Symbol::is_absolute, Symbol::is_common): Likewise.
13238 (class Sized_symbol): Update declarations.
13239 (class Symbol_table): Update declarations.
13240 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
13241 parameters. Change all callers.
13242 (Sized_symbol::override): Likewise.
13243 (Symbol_table::override): Likewise.
13244 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
13245 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
13246 is_ordinary, and orig_st_shndx parameters. Change all callers.
13247 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
13248 to be in an ordinary section.
13249 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
13250 object and is_ordinary parameters. Change all callers.
13251 (Sized_dwarf_line_info::read_relocs): Add object parameter.
13252 Change all callers. Don't add undefined or non-ordinary symbols
13253 to reloc_map_.
13254 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
13255 Change all callers.
13256 * dwarf_reader.h (class Sized_dwarf_line_info): Update
13257 declarations.
13258 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
13259 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
13260 (Sized_relobj::relocate_sections): Likewise.
13261 * target-reloc.h (scan_relocs): Adjust section symbol index.
13262 (scan_relocatable_relocs): Likewise.
13263 * i386.cc (Scan::local): Check for ordinary symbols.
13264 * sparc.cc (Scan::local): Likewise.
13265 * x86_64.cc (Scan::local): Likewise.
13266 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
13267 to symbol_section_and_value.
13268 * testsuite/many_sections_test.cc: New file.
13269 * testsuite/Makefile.am (BUILT_SOURCES): Define.
13270 (check_PROGRAMS): Add many_sections_test.
13271 (many_sections_test_SOURCES): Define.
13272 (many_sections_test_DEPENDENCIES): Define.
13273 (many_sections_test_LDFLAGS): Define.
13274 (BUILT_SOURCES): Add many_sections_define.h.
13275 (many_sections_define.h): New target.
13276 (BUILT_SOURCES): Add many_sections_check.h.
13277 (many_sections_check.h): New target.
13278 (check_PROGRAMS): Add many_sections_r_test.
13279 (many_sections_r_test_SOURCES): Define.
13280 (many_sections_r_test_DEPENDENCIES): Define.
13281 (many_sections_r_test_LDFLAGS): Define.
13282 (many_sections_r_test_LDADD): Define.
13283 (many_sections_r_test.o): New target.
13284 * testsuite/Makefile.in: Rebuild.
13285
c5818ff1
CC
132862008-04-17 Cary Coutant <ccoutant@google.com>
13287
13288 * errors.cc (Errors::info): New function.
13289 (gold_info): New function.
13290 * errors.h (Errors::info): New function.
13291 * gold.h (gold_info): New function.
13292 * object.cc (Input_objects::add_object): Print trace output.
13293 * options.cc (options::parse_set): New function.
13294 (General_options::parse_wrap): Deleted.
13295 (General_options::General_options): Deleted initializer.
13296 * options.h (options::String_set): New typedef.
13297 (options::parse_set): New function.
13298 (DEFINE_set): New macro.
13299 (General_options::wrap): Changed to use DEFINE_set. Changed
13300 callers of any_wrap_symbols and is_wrap_symbol.
13301 (General_options::trace, General_options::trace_symbol):
13302 New options.
13303 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
13304 (General_options::wrap_symbols_): Deleted.
13305 * symtab.cc (Symbol_table::add_from_object): Print trace output.
13306
b5be4a7c
DM
133072008-04-17 David S. Miller <davem@davemloft.net>
13308
13309 * options.cc (General_options::parse_V): New function.
13310 * options.h: Add entries for -V and -Qy.
13311
155a0dd7
ILT
133122008-04-17 Ian Lance Taylor <iant@google.com>
13313
13314 * common.cc (Symbol_table::allocate_commons): Remove options
13315 parameter. Change caller.
13316 (Symbol_table::do_allocate_commons): Remove options parameter.
13317 Change caller. Just call do_allocate_commons_list twice.
13318 (Symbol_table::do_allocate_commons_list): New function, broken out
13319 of do_allocate_commons.
13320 * common.h (class Allocate_commons_task): Remove options_ field.
13321 Update constructor.
13322 * symtab.cc (Symbol_table::Symbol_table): Initialize
13323 tls_commons_.
13324 (Symbol_table::add_from_object): Put TLS common symbols on
13325 tls_commons_ list.
13326 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
13327 which are IN_OUTPUT_DATA.
13328 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
13329 allocate_commons and do_allocate_commons declarations. Declare
13330 do_allocate_commons_list.
13331 * gold.cc (queue_middle_tasks): Update creation of
13332 Allocate_commons_task to not pass options.
13333 * testsuite/Makefile.am (INCLUDES): Add -I.. .
13334 (TLS_TEST_C_FLAGS): New variable.
13335 (tls_test_c_pic.o): New target.
13336 (tls_test_shared.so): Link in tls_test_c_pic.o.
13337 (tls_test_c_pic_ie.o): New target.
13338 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
13339 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
13340 (tls_test_c.o): New target.
13341 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
13342 (tls_pic_test_LDADD): Likewise.
13343 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
13344 (tls_shared_gd_to_ie_test_LDADD): Likewise.
13345 (tls_test_c_gnu2.o): New target.
13346 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
13347 tls_test_c_gnu2.o.
13348 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
13349 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
13350 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
13351 * testsuite/tls_test.cc: Include "config.h".
13352 (t_last): Call t11_last.
13353 * testsuite/tls_test.h (t11, t11_last): Declare.
13354 * testsuite/tls_test_c.c: New file.
13355 * testsuite/tls_test_main.cc (thread_routine): Call t11.
13356 * configure.ac: Check for OpenMP support.
13357 * configure, config.in, Makefile.in: Rebuild.
13358 * testsuite/Makefile.in: Rebuild.
13359
edfbb029
CC
133602008-04-16 Cary Coutant <ccoutant@google.com>
13361
13362 * i386.cc (Target_i386::define_tls_base_symbol): New function.
13363 (Target_i386::tls_base_symbol_defined_): New field.
13364 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
13365 (Target_i386::Scan::global): Likewise.
13366 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
13367 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
13368 (Target_x86_64::tls_base_symbol_defined_): New field.
13369 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
13370 (Target_x86_64::Scan::global): Likewise.
13371
f3c69fca
CC
133722008-04-16 Cary Coutant <ccoutant@google.com>
13373
13374 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
13375 (Symbol::needs_plt_entry): Allow weak undefined symbols.
13376 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
13377 building shared libraries.
13378 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
13379 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
13380 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
13381 * testsuite/Makefile.in: Rebuild.
13382 * testsuite/weak_undef.h: New file.
13383 * testsuite/weak_undef_file1.cc: Add extra test cases.
13384 * testsuite/weak_undef_file2.cc: Likewise.
13385 * testsuite/weak_undef_test.cc: Likewise.
13386
7c414435
DM
133872008-04-16 David S. Miller <davem@davemloft.net>
13388
32b769e1
DM
13389 * sparc.cc (Target_sparc::Scan): Change from struct to class.
13390 Add issued_non_pic_error_ field. Declare check_non_pic.
13391 (Target_sparc::Scan::check_non_pic): New function.
13392 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
13393 (Target_sparc::Scan::global): Likewise.
13394
11936fb1
DM
13395 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
13396 * configure: Rebuild.
13397
7c414435
DM
13398 * options.h (DEFINE_enable): New macro.
13399 (new_dtags): New enable option.
13400 (initfirst, interpose, loadfltr, nodefaultlib,
13401 nodelete, nodlopen, nodump): New -z options.
13402 * layout.cc (Layout:finish_dynamic_section): If new
13403 dtags enabled, emit DT_RUNPATH. Also, emit a
13404 DT_FLAGS_1 containing any specified -z flags.
13405
85c7bf8b
ILT
134062008-04-16 Ian Lance Taylor <iant@google.com>
13407
12c0daef
ILT
13408 * copy-relocs.cc: New file.
13409 * copy-relocs.h: New file.
13410 * reloc.cc: Remove Copy_relocs code.
13411 * reloc.h: Likewise.
13412 * reloc-types.h (struct Reloc_types) [both versions]: Add
13413 get_reloc_addend_noerror.
13414 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
13415 variants of add_global which take an addend which must be zero.
13416 * i386.cc: Include "copy-relocs.h".
13417 (class Target_i386): Change type of copy_relocs_ to variable,
13418 update initializer.
13419 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
13420 Change all callers.
13421 (Target_i386::do_finalize_sections): Change handling of
13422 copy_relocs_.
13423 * sparc.cc: Include "copy-relocs.h".
13424 (class Target_sparc): Change type of copy_relocs_ to variable,
13425 update initializer.
13426 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
13427 Change all callers.
13428 (Target_sparc::do_finalize_sections): Change handling of
13429 copy_relocs_.
13430 * x86_64.cc: Include "copy-relocs.h".
13431 (class Target_x86_64): Change type of copy_relocs_ to variable,
13432 update initializer.
13433 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
13434 class. Change all callers.
13435 (Target_x86_64::do_finalize_sections): Change handling of
13436 copy_relocs_.
13437 * Makefile.am (CCFILES): Add copy-relocs.cc.
13438 (HFILES): Add copy-relocs.h.
13439
4f4995b6
ILT
13440 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
13441
85c7bf8b
ILT
13442 * testsuite/script_test_4.sh: Permit leading zeroes.
13443
4f2a9edd
ILT
134442008-04-15 Ian Lance Taylor <iant@google.com>
13445
e6188289
ILT
13446 * script-sections.cc (Script_sections::create_segments): Use
13447 header_size_adjustment even when there is enough room for the
13448 headers.
13449 * testsuite/script_test_4.sh: New file.
13450 * testsuite/script_test_4.t: New file.
13451 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
13452 (check_DATA): Add script_test_4.stdout.
13453 (MOSTLYCLEANFILES): Likewise.
13454 (script_test_4): New target.
13455 (script_test_4.stdout): New target.
13456 * testsuite/Makefile.in: Rebuild.
13457
4f2a9edd
ILT
13458 * sparc.cc: Add definitions for Output_data_plt_sparc class
13459 constants.
13460
f5314dd5
DM
134612008-04-14 David S. Miller <davem@davemloft.net>
13462
13463 * sparc.cc: New file.
13464 * Makefile.am (TARGETSOURCES): Add sparc.cc
13465 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
13466 * configure.tgt: Document targ_extra_size and
13467 targ_extra_big_endian. Add entries for sparc-* and
13468 sparc64-*.
13469 * configure.ac: Handle targ_extra_size and
13470 targ_extra_big_endian.
13471 * Makefile.in: Rebuild.
13472 * configure: Likewise.
13473 * po/POTFILES.in: Likewise.
13474 * po/gold.pot: Likewise.
13475
154e0e9a
ILT
134762008-04-14 Ian Lance Taylor <iant@google.com>
13477
13478 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
13479 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
13480 in the name/type/flags to section mapping. Don't call
13481 allocate_output_section.
13482 (Layout::choose_output_section): Change parameter from adjust_name
13483 to is_input_section. Don't permit input sections after sections
13484 are attached to segments. Don't call allocate_output_section.
13485 (Layout::layout_eh_frame): Call update_flags_for_input_section,
13486 not write_enable_output_section.
13487 (Layout::make_output_section): Don't push to
13488 unattached_section_list_ nor call attach_to_segment. Call
13489 attach_section_to_segment if sections are attached.
13490 (Layout::attach_sections_to_segments): New function.
13491 (Layout::attach_section_to_segment): New function.
13492 (Layout::attach_allocated_section_to_segment): Rename from
13493 attach_to_segment. Remove flags parameter.
13494 (Layout::allocate_output_section): Remove function.
13495 (Layout::write_enable_output_section): Remove function.
13496 * layout.h (class Layout): Update for above changes. Add new
13497 field sections_are_attached_.
13498 * output.h (Output_section::update_flags_for_input_section): New
13499 function.
13500 * output.cc (Output_section::add_input_section): Call
13501 update_flags_for_input_section.
13502 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
13503
009a67a2
CC
135042008-04-11 Cary Coutant <ccoutant@google.com>
13505
13506 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
13507 thought unnecessary.
13508 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
13509
759b1a24
ILT
135102008-04-11 Ian Lance Taylor <iant@google.com>
13511
13512 * output.h (class Output_section_data): Remove inline definition
13513 of set_addralign.
13514 * output.cc (Output_section_data::set_addralign): New function.
13515
c2b45e22
CC
135162008-04-11 Cary Coutant <ccoutant@google.com>
13517
13518 Add support for TLS descriptors for i386 and x86_64.
13519 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
13520 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
13521 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
13522 GOT_TYPE_TLS_DESC.
13523 (Target_i386::got_mod_index_entry): Remove unnecessary code.
13524 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
13525 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
13526 relocations.
13527 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
13528 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
13529 Fix problem with initial-exec relocations.
13530 (Target_i386::Relocate::relocate_tls): Likewise.
13531 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
13532 relaxation.
13533 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
13534 support for section-plus-offset dynamic table entries.
13535 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
13536 (Output_data_dynamic::Dynamic_entry): Add support for
13537 section-plus-offset dynamic table entries.
13538 (Output_data_dynamic::Classification): Likewise.
13539 (Output_data_dynamic::classification_): Renamed offset_.
13540 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
13541 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
13542 (Target_x86_64::make_plt_section): New function.
13543 (Target_x86_64::reserve_tlsdesc_entries): New function.
13544 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
13545 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
13546 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
13547 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
13548 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
13549 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
13550 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
13551 add extra PLT entry for TLS descriptors.
13552 (Output_data_plt_x86_64::got_): New field.
13553 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
13554 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
13555 fields.
13556 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
13557 descriptors.
13558 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
13559 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
13560 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
13561 R_386_TLS_DESC_CALL relocations.
13562 (Target_x86_64::Scan::global): Likewise.
13563 (Target_x86_64::do_finalize_sections): Add dynamic table entries
13564 for TLS descriptors.
13565 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
13566 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
13567 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
13568 GD-to-IE relaxation.
13569 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
13570 and TLS_DESCRIPTORS.
13571 * Makefile.in: Rebuild.
13572 * configure: Rebuild.
13573 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
13574 (tls_test_shared2.so): New target.
13575 (tls_shared_gd_to_ie_test_SOURCES): New variable.
13576 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
13577 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
13578 (tls_shared_gd_to_ie_test_LDADD): New variable.
13579 (tls_shared_gnu2_gd_to_ie_test): New target.
13580 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
13581 New targets.
13582 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
13583 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
13584 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
13585 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
13586 (tls_shared_gnu2_test): New target.
13587 (tls_test_gnu2_shared.so): New target.
13588 (tls_shared_gnu2_test_SOURCES): New variable.
13589 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
13590 (tls_shared_gnu2_test_LDFLAGS): New variable.
13591 (tls_shared_gnu2_test_LDADD): New variable.
13592 * testsuite/Makefile.in: Rebuild.
13593 * testsuite/Makefile.
13594
83bfb6b7
ILT
135952008-04-11 Ian Lance Taylor <iant@google.com>
13596
13597 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
13598 justsyms.t.
13599 * testsuite/Makefile.in: Rebuild.
13600
13601 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
13602 long.
13603 * testsuite/script_test_2.cc (main): Adjust test.
13604
706e1f5e
ILT
136052008-04-11 David S. Miller <davem@davemloft.net>
13606 Ian Lance Taylor <iant@google.com>
13607
13608 * options.h (General_options): Add entries for '-Y' and
13609 '-relax'.
13610 * options.cc (General_options:finalize): If -Y was used, add those
13611 entries to the library path instead of the default "/lib" and
13612 "/usr/lib".
13613
7c98e6bb
DM
136142008-04-11 David S. Miller <davem@davemloft.net>
13615
13616 * testsuite/justsyms.t: Start at 0x100.
13617 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
13618 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
13619 long.
13620 * testsuite/script_test_2.cc: Adjust string and section length
13621 checks.
7c98e6bb 13622
99a37bfd
ILT
136232008-04-09 Ian Lance Taylor <iant@google.com>
13624
2cefc357
ILT
13625 PR gold/5996
13626 * script-sections.cc (Sections_element::allocate_to_segment): Add
13627 orphan parameter.
13628 (Output_section_definition::allocate_to_segment): Likewise.
13629 (Orphan_output_section::allocate_to_segment): Likewise.
13630 (Script_sections::attach_sections_using_phdrs_clause): Don't
13631 propagate non-PT_LOAD segments to orphan sections.
13632 * testsuite/Makefile.am (script_test_3.stdout): Generate using
13633 readelf rather than objdump.
13634 * testsuite/script_test_3.sh: Adjust accordingly. Test that
13635 .interp section and PT_INTERP segment are the same size.
13636 * testsuite/Makefile.in: Rebuild.
13637
99a37bfd
ILT
13638 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
13639 aliases for symbols defined in the same object.
13640 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
13641 (weak_alias_test_SOURCES): New variable.
13642 (weak_alias_test_DEPENDENCIES): New variable.
13643 (weak_alias_test_LDFLAGS): New variable.
13644 (weak_alias_test_LDADD): New variable.
13645 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
13646 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
13647 (weak_alias_test_3.o): New target.
13648 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
13649 * testsuite/weak_alias_test_main.cc: New file.
13650 * testsuite/weak_alias_test_1.cc: New file.
13651 * testsuite/weak_alias_test_2.cc: New file.
13652 * testsuite/weak_alias_test_3.cc: New file.
13653
780e49c5
ILT
136542008-04-08 Ian Lance Taylor <iant@google.com>
13655
cdb0b8f5
ILT
13656 * options.h (class General_options): Add --noinhibit-exec option.
13657 * main.cc (main): Check --noinhibit-exec.
13658
0864d551
ILT
13659 * options.h (class General_options): Define --wrap as a special
13660 option. Add wrap_symbols_ field.
13661 (General_options::any_wrap_symbols): New function.
13662 (General_options::is_wrap_symbol): New function.
13663 * options.cc (General_options::parse_wrap): New function.
13664 (General_options::General_options): Initialize wrap_symbols_.
13665 * symtab.cc (Symbol_table::wrap_symbol): New function.
13666 (Symbol_table::add_from_object): Handle --wrap.
13667 * symtab.h (class Symbol_table): Declare wrap_symbol.
13668 * target.h (Target::wrap_char): New function.
13669 (Target::Target_info): Add wrap_char field.
13670 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
13671 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13672 * testsuite/testfile.cc (Target_test::test_target_info):
13673 Likewise.
13674
789aa6de
ILT
13675 * errors.cc (Errors::undefined_symbol): Mention symbol version if
13676 there is one.
13677
2c38906f
ILT
13678 * layout.h (class Layout): Add added_eh_frame_data_ field.
13679 * layout.cc (Layout::Layout): Initialize new field.
13680 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
13681 output section until we find a section we merged successfully.
13682 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
13683 that the size be non-zero.
13684
780e49c5
ILT
13685 * merge.cc (Object_merge_map::get_output_offset): Remove inline
13686 qualifier.
13687
7fcd0256
ILT
136882008-04-08 Craig Silverstein <csilvers@google.com>
13689
13690 * configure.ac: Export new conditional variable HAVE_ZLIB.
13691 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
13692 on HAVE_ZLIB.
13693 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
13694 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13695
6835af53
ILT
136962008-04-07 Ian Lance Taylor <iant@google.com>
13697
e24f324c
ILT
13698 * version.cc (version_string): Set to "1.5".
13699
a036edd8
ILT
13700 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
13701 Add issued_non_pic_error_ field. Declare check_non_pic.
13702 (Target_x86_64::Scan::check_non_pic): New function.
13703 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
13704 (Target_x86_64::Scan::global): Likewise.
13705
624f8810
ILT
13706 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
13707 addend parameter. Change caller. Handle merge sections.
13708 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
13709 Address to Addend. Don't add in the result of
13710 local_section_offset, pass down the addend and use the returned
13711 value.
13712 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
13713 Update declarations of local_section_offset and symbol_value.
13714 * testsuite/two_file_test_1.cc (t18): New function.
13715 * testsuite/two_file_test_2.cc (f18): New function.
13716 * testsuite/two_file_test_main.cc (main): Call t18.
13717 * testsuite/two_file_test.h (t18, f18): Declare.
13718
6835af53
ILT
13719 * configure.ac: Don't test for objdump, c++filt, or readelf.
13720 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
13721 conditionals.
13722 (TEST_READELF): New variable.
13723 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
13724 (check_PROGRAMS): Add two_file_strip_test.
13725 (two_file_strip_test): New target.
13726 (check_PROGRAMS): Add two_file_same_shared_strip_test.
13727 (two_file_same_shared_strip_test_SOURCES): New variable.
13728 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
13729 (two_file_same_shared_strip_test_LDFLAGS): New variable.
13730 (two_file_same_shared_strip_test_LDADD): New variable.
13731 (two_file_shared_strip.so): New target.
13732 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
13733 (ver_test_5.syms, ver_test_7.syms): Likewise.
13734 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
13735 (strip_test_3.stdout): Use TEST_OBJDUMP.
13736 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13737
86925eef
CC
137382008-04-04 Cary Coutant <ccoutant@google.com>
13739
13740 * symtab.h (Symbol::is_weak_undefined): New function.
13741 (Symbol::is_strong_undefined): New function.
13742 (Symbol::is_absolute): New function.
13743 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
13744 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
13745 absolute symbols.
13746 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
13747 (weak_undef_test): New target.
13748 * testsuite/Makefile.in: Rebuild.
13749 * testsuite/weak_undef_file1.cc: New file.
13750 * testsuite/weak_undef_file2.cc: New file.
13751 * testsuite/weak_undef_test.cc: New file.
13752
126f3ece
ILT
137532008-04-03 Craig Silverstein <csilvers@google.com>
13754
13755 * compressed_output.h (class Output_compressed_section): Use
13756 unsigned buffer.
13757 * compressed_output.cc (zlib_compress): Use unsigned buffers,
13758 add zlib header.
13759 (zlib_compressed_suffix): Removed.
13760 (Output_compressed_section::set_final_data_size): Use unsigned
13761 buffers.
13762 * testsuite/Makefile.am (flagstest_compress_debug_sections):
13763 Fix linker invocation.
13764 (flagstest_o_specialfile_and_compress_debug_sections):
13765 Likewise.
13766 * testsuite/Makefile.in: Regenerated.
13767
deae2a14
DM
137682008-04-02 David S. Miller <davem@davemloft.net>
13769
13770 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
13771 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
13772
70752818
ILT
137732008-04-02 Craig Silverstein <csilvers@google.com>
13774
13775 * TODO: New file.
13776
39d0cb0e
ILT
137772008-04-02 Ian Lance Taylor <iant@google.com>
13778
13779 * fileread.cc (File_read::find_view): Add byteshift and vshifted
13780 parameters. Update for new key type to views_. Change all
13781 callers.
13782 (File_read::read): Adjust for byteshift in returned view.
13783 (File_read::add_view): New function, broken out of
13784 find_and_make_view.
13785 (File_read::make_view): New function, broken out of
13786 find_and_make_view.
13787 (File_read::find_or_make_view): Add offset and aligned
13788 parameters. Rewrite accordingly. Change all callers.
13789 (File_read::get_view): Add offset and aligned parameters. Adjust
13790 for byteshift in return value.
13791 (File_read::get_lasting_view): Likewise.
13792 * fileread.h (class File_read): Update declarations.
13793 (class File_read::View): Add byteshift_ field. Add byteshift to
13794 constructor. Add byteshift method.
13795 * archive.h (Archive::clear_uncached_views): New function.
13796 (Archive::get_view): Add aligned parameter. Change all callers.
13797 * object.h (Object::get_view): Add aligned parameter. Change all
13798 callers.
13799 (Object::get_lasting_view): Likewise.
13800
13801 * fileread.cc (File_read::release): Don't call clear_views if
13802 there are multiple objects.
13803 * fileread.h (File_read::clear_uncached_views): New function.
13804 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
13805 on the archive.
13806
a1207466
CC
138072008-03-31 Cary Coutant <ccoutant@google.com>
13808
13809 Add thin archive support.
13810 * archive.cc (Archive::armagt): New const.
13811 (Archive::setup): Remove task parameter and calls to unlock.
13812 (Archive::unlock_nested_archives): New function.
13813 (Archive::read_header): Add nested_off parameter. Change
13814 all callers.
13815 (Archive::interpret_header): Likewise.
13816 (Archive::include_all_members): Change to handle thin
13817 archives.
13818 (Archive::include_member): Likewise.
13819 * archive.h (Archive::Archive): Add new parameters and
13820 initializers.
13821 (Archive::armagt): New const.
13822 (Archive::setup): Remove task parameter.
13823 (Archive::unlock_nested_archives): New function.
13824 (Archive::read_header): Add nested_off parameter.
13825 (Archive::interpret_header): Likewise.
13826 (Archive::Nested_archive_table): New typedef.
13827 (Archive::is_thin_archive_): New field.
13828 (Archive::nested_archives_): New field.
13829 (Archive::options_): New field.
13830 (Archive::dirpath_): New field.
13831 (Archive::task_): New field.
13832 * readsyms.cc (Read_symbols::do_read_symbols): Add check
13833 for thin archives. Pass additional parameters to
13834 Archive::Archive. Unlock the archive file after calling
13835 Archive::setup.
cd536b21 13836
479f6503
ILT
138372008-03-29 Ian Lance Taylor <iant@google.com>
13838
686c8caf
ILT
13839 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
13840 version symbol to be local.
13841 * testsuite/ver_test_4.sh: New file.
13842 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
13843 (check_DATA): Add ver_test_4.syms.
13844 (ver_test_4.syms): New target.
13845 * testsuite/Makefile.in: Rebuild.
13846
ab794b6b
ILT
13847 * output.cc
13848 (Output_section::Input_section_sort_entry::has_priority): New
13849 function.
13850 (Output_section::Input_section_sort_entry::match_file_name): New
13851 function.
13852 (Output_section::Input_section_sort_entry::match_section_name):
13853 Remove.
13854 (Output_section::Input_section_sort_entry::match_section_name_prefix):
13855 Remove.
13856 (Output_section::Input_section_sort_entry::match_section_file):
13857 Remove.
13858 (Output_section::Input_section_sort_compare::operator()): Rewrite
13859 using new Input_section_sort_entry functions. Sort crtbegin and
13860 crtend first. Sort sections with no priority before sections with
13861 a priority.
13862 * testsuite/initpri1.c (d3): Check j != 4.
13863 (cd5): New constructor/destructor function.
13864 (main): Check j != 2.
13865
479f6503
ILT
13866 * symtab.cc (Symbol_table::add_from_object): If we don't use the
13867 new symbol when resolving, don't call set_is_default.
13868 * testsuite/ver_test_7.cc: New file.
13869 * testsuite/ver_test_7.sh: New file.
13870 * testsuite/Makefile.am (ver_test_7.so): New target.
13871 (ver_test_7.o): New target.
13872 (check_SCRIPTS): Add ver_test_7.sh.
13873 (check_DATA): Add ver_test_7.syms.
13874 (ver_test_7.syms): New target.
13875
2fd32231
ILT
138762008-03-28 Ian Lance Taylor <iant@google.com>
13877
13878 * layout.cc (Layout::layout): If we see an input section with a
13879 name that needs sorting, set the must_sort flag for the output
13880 section.
13881 (Layout::make_output_section): If the name of the output section
13882 indicates that it might require sorting, set the may_sort flag.
13883 * output.h (Output_section::may_sort_attached_input_sections): New
13884 function.
13885 (Output_section::set_may_sort_attached_input_sections): New
13886 function.
13887 (Output_section::must_sort_attached_input_sections): New
13888 function.
13889 (Output_section::set_must_sort_attached_input_sections): New
13890 function.
13891 (class Output_section): Declare Input_section_sort_entry. Define
13892 Input_section_sort_compare. Declare
13893 sort_attached_input_sections. Add new fields:
13894 may_sort_attached_input_sections_,
13895 must_sort_attached_input_sections_,
13896 attached_input_sections_are_sorted_.
13897 * output.cc (Output_section::Output_section): Initialize new
13898 fields.
13899 (Output_section::add_input_section): Add an entry to
13900 input_sections_ if may_sort or must_sort are true.
13901 (Output_section::set_final_data_size): Call
13902 sort_attached_input_sections if necessary.
13903 (Output_section::Input_section_sort_entry): Define new class.
13904 (Output_section::Input_section_sort_compare::operator()): New
13905 function.
13906 (Output_section::sort_attached_input_sections): New function.
13907 * configure.ac: Check whether the compiler supports constructor
13908 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
13909 * testsuite/initpri1.c: New file.
13910 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
13911 CONSTRUCTOR_PRIORITY.
13912 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
13913 (initpri1_LDFLAGS): New variable.
13914 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13915
18e6b24e
ILT
139162008-03-27 Ian Lance Taylor <iant@google.com>
13917
49bdd526
ILT
13918 * common.cc (Sort_commons::operator): Correct sorting algorithm.
13919 * testsuite/common_test_1.c: New file.
13920 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
13921 (common_test_1_SOURCES): New variable.
13922 (common_test_1_DEPENDENCIES): New variable.
13923 (common_test_1_LDFLAGS): New variable.
13924
18e6b24e
ILT
13925 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
13926 and commons_ correctly when NAME/VERSION does not override
13927 NAME/NULL.
13928 * testsuite/ver_test_6.c: New file.
13929 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
13930 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
13931 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
13932
04bf7072
ILT
139332008-03-26 Ian Lance Taylor <iant@google.com>
13934
5871526f
ILT
13935 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
13936 of an undefined symbol from a version script.
13937 * testsuite/Makefile.am (ver_test_5.so): New target.
13938 (ver_test_5.o): New target.
13939 (check_SCRIPTS): Add ver_test_5.sh.
13940 (check_DATA): Add ver_test_5.syms.
13941 (ver_test_5.syms): New target.
13942 * testsuite/ver_test_5.cc: New file.
13943 * testsuite/ver_test_5.script: New file.
13944 * testsuite/ver_test_5.sh: New file.
13945 * Makefile.in, testsuite/Makefile.in: Rebuild.
13946
04bf7072
ILT
13947 PR gold/5986
13948 Fix problems building gold with gcc 4.3.0.
13949 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
13950 (gold_error_at_location, gold_warning_at_location): Use it.
13951 * configure.ac: Check whether we can compile and use a template
13952 function with a printf attribute.
13953 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
13954 when jumping over bytes.
13955 * object.cc: Instantiate Object::read_section_data.
13956 * debug.h: Include <cstring>
13957 * dwarf_reader.cc: Include <algorithm>
13958 * main.cc: Include <cstring>.
13959 * options.cc: Include <cstring>.
13960 * output.cc: Include <cstring>.
13961 * script.cc: Include <cstring>.
13962 * script.h: Include <string>.
13963 * symtab.cc: Include <cstring> and <algorithm>.
13964 * target-select.cc: Include <cstring>.
13965 * version.cc: Include <string>.
13966 * testsuite/testmain.cc: Include <cstdlib>.
13967 * configure, config.in: Rebuild.
13968
874c5b28
ILT
139692008-03-25 Ian Lance Taylor <iant@google.com>
13970
819d6c3a
ILT
13971 * options.cc: Include "../bfd/bfdver.h".
13972 (options::help): Print bug reporting address.
13973
f4b2c6f5
ILT
13974 * version.cc (print_version): Adjust output for current value of
13975 BFD_VERSION_STRING.
13976
13977 * NEWS: New file.
13978
e96caa79
ILT
13979 * options.cc (options::help): Print list of supported targets.
13980 * target-select.h: Include <vector>.
13981 (class Target_selector): Make machine_, size_, and is_big_endian_
13982 fields const. Add bfd_name_ and instantiated_target_ fields.
13983 (Target_selector::Target_selector): Add bfd_name parameter.
13984 (Target_selector::recognize): Make non-virtual, call
13985 do_recognize.
13986 (Target_selector::recognize_by_name): Make non-virtual, call
13987 do_recognize_by_name.
13988 (Target_selector::supported_names): New function.
13989 (Target_selector::bfd_name): New function.
13990 (Target_selector::do_instantiate_target): New pure virtual
13991 function.
13992 (Target_selector::do_recognize): New virtual function.
13993 (Target_selector::do_recognize_by_name): New virtual function.
13994 (Target_selector::instantiate_target): New private function.
13995 (supported_target_names): Declare.
13996 * target-select.cc (Target_selector::Target_selector): Update for
13997 new parameter and fields.
13998 (select_target_by_name): Check that the name matches before
13999 calling recognize_by_name.
14000 (supported_target_names): New function.
14001 * i386.cc (class Target_selector_i386): Update Target_selector
14002 constructor call. Remove recognize and recognize_by_name. Add
14003 do_instantiate_target.
14004 * x86_64.cc (class Target_selector_x86_64): Likewise.
14005 * testsuite/testfile.cc (class Target_selector_test): Update for
14006 changes to Target_selector.
14007
874c5b28
ILT
14008 * README: Rewrite, with some notes on unsupported features.
14009
0a65a3a7
CC
140102008-03-24 Cary Coutant <ccoutant@google.com>
14011
14012 * i386.cc (Target_i386::Got_type): New enum declaration.
14013 (Target_i386::Scan::local): Updated callers of Output_data_got
14014 member functions.
14015 (Target_i386::Scan::global): Likewise.
14016 (Target_i386::Relocate::relocate): Likewise.
14017 (Target_i386::Relocate::relocate_tls): Likewise.
14018 * object.h (Got_offset_list): New class.
14019 (Sized_relobj::local_has_got_offset): Added got_type parameter.
14020 (Sized_relobj::local_got_offset): Likewise.
14021 (Sized_relobj::set_local_got_offset): Likewise.
14022 (Sized_relobj::local_has_tls_got_offset): Removed.
14023 (Sized_relobj::local_tls_got_offset): Removed.
14024 (Sized_relobj::set_local_tls_got_offset): Removed.
14025 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
14026 * output.cc (Output_data_got::add_global): Added got_type parameter.
14027 (Output_data_got::add_global_with_rel): Likewise.
14028 (Output_data_got::add_global_with_rela): Likewise.
14029 (Output_data_got::add_global_pair_with_rel): New function.
14030 (Output_data_got::add_global_pair_with_rela): New function.
14031 (Output_data_got::add_local): Added got_type parameter.
14032 (Output_data_got::add_local_with_rel): Likewise.
14033 (Output_data_got::add_local_with_rela): Likewise.
14034 (Output_data_got::add_local_pair_with_rel): New function.
14035 (Output_data_got::add_local_pair_with_rela): New function.
14036 (Output_data_got::add_global_tls): Removed.
14037 (Output_data_got::add_global_tls_with_rel): Removed.
14038 (Output_data_got::add_global_tls_with_rela): Removed.
14039 (Output_data_got::add_local_tls): Removed.
14040 (Output_data_got::add_local_tls_with_rel): Removed.
14041 (Output_data_got::add_local_tls_with_rela): Removed.
14042 * output.h (Output_data_got::add_global): Added got_type parameter.
14043 (Output_data_got::add_global_with_rel): Likewise.
14044 (Output_data_got::add_global_with_rela): Likewise.
14045 (Output_data_got::add_global_pair_with_rel): New function.
14046 (Output_data_got::add_global_pair_with_rela): New function.
14047 (Output_data_got::add_local): Added got_type parameter.
14048 (Output_data_got::add_local_with_rel): Likewise.
14049 (Output_data_got::add_local_with_rela): Likewise.
14050 (Output_data_got::add_local_pair_with_rel): New function.
14051 (Output_data_got::add_local_pair_with_rela): New function.
14052 (Output_data_got::add_global_tls): Removed.
14053 (Output_data_got::add_global_tls_with_rel): Removed.
14054 (Output_data_got::add_global_tls_with_rela): Removed.
14055 (Output_data_got::add_local_tls): Removed.
14056 (Output_data_got::add_local_tls_with_rel): Removed.
14057 (Output_data_got::add_local_tls_with_rela): Removed.
14058 * resolve.cc (Symbol::override_base_with_special): Removed
14059 reference to has_got_offset_ field.
14060 * symtab.cc (Symbol::init_fields): Replaced initialization
14061 of got_offset_ with got_offsets_. Removed initialization
14062 of has_got_offset_
53fcba31 14063 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
14064 (Symbol::got_offset): Likewise.
14065 (Symbol::set_got_offset): Likewise.
14066 (Symbol::has_tls_got_offset): Removed.
14067 (Symbol::tls_got_offset): Removed.
14068 (Symbol::set_tls_got_offset): Removed.
14069 (Symbol::got_offset_): Removed.
14070 (Symbol::tls_mod_got_offset_): Removed.
14071 (Symbol::tls_pair_got_offset_): Removed.
14072 (Symbol::got_offsets_): New field.
14073 (Symbol::has_got_offset): Removed.
14074 (Symbol::has_tls_mod_got_offset): Removed.
14075 (Symbol::has_tls_pair_got_offset): Removed.
14076 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
14077 (Target_x86_64::Scan::local): Updated callers of Output_data_got
14078 member functions.
14079 (Target_x86_64::Scan::global): Likewise.
14080 (Target_x86_64::Relocate::relocate): Likewise.
14081 (Target_x86_64::Relocate::relocate_tls): Likewise.
14082
bd52eafb
BE
140832008-03-25 Ben Elliston <bje@au.ibm.com>
14084
14085 * yyscript.y: Fix spelling error in comment.
14086
8b105e34
ILT
140872008-03-24 Ian Lance Taylor <iant@google.com>
14088
8ed814a9
ILT
14089 * options.h (class General_options): Define build_id option.
14090 * layout.h (class Layout): Declare write_build_id, create_note,
14091 create_build_id. Add build_id_note_ member.
14092 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
14093 "libiberty.h", "md5.h", "sha1.h".
14094 (Layout::Layout): Initialize eh_frame_data_,
14095 eh_frame_hdr_section_, and build_id_note_.
14096 (Layout::finalize): Call create_build_id.
14097 (Layout::create_note): New function, broken out of
14098 Layout::create_gold_note.
14099 (Layout::create_gold_note): Call create_note.
14100 (Layout::create_build_id): New function.
14101 (Layout::write_build_id): New function.
14102 (Close_task_runner::run): Call write_build_id.
14103
8b105e34
ILT
14104 * x86_64.cc: Correct license to GPLv3.
14105
086a1841
ILT
141062008-03-23 Ian Lance Taylor <iant@google.com>
14107
14108 * options.cc: Include "demangle.h".
14109 (parse_optional_string): New function.
14110 (parse_long_option): Handle takes_optional_argument.
14111 (parse_short_option): Update dash_z initializer. Handle
14112 takes_optional_argument.
14113 (General_options::General_options): Initialize do_demangle_.
14114 (General_options::finalize): Set do_demangle_. Handle demangling
14115 style.
14116 * options.h (parse_optional_string): Declare.
14117 (struct One_option): Add optional_arg field. Update constructor.
14118 Update call constructor calls. Add takes_optional_argument
14119 function.
14120 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
14121 (DEFINE_optional_string): Define.
14122 (General_options::demangle): Change from DEFINE_bool to
14123 DEFINE_optional_string.
14124 (General_options::no_demangle): New function.
14125 (General_options::do_demangle): New function.
14126 (General_options::set_do_demangle): New function.
14127 (General_options::execstack_status_): Move definition to end of
14128 class definition.
14129 (General_options::static_): Likewise.
14130 (General_options::do_demangle_): New field.
14131 * object.cc (big_endian>::get_symbol_location_info): Call
14132 Options::do_demangle, not Options::demangle.
14133 * symtab.cc (demangle): Likewise.
14134
cbb93e63
ILT
141352008-03-22 Ian Lance Taylor <iant@google.com>
14136
14137 * gold.h: Include <cstddef> and <sys/types.h>
14138 * options.h: Include <cstring>.
14139
ec531623
ILT
141402008-03-21 Ian Lance Taylor <iant@google.com>
14141
14142 * Added source code to GNU binutils.
This page took 0.910919 seconds and 4 git commands to generate.