* MAINTAINERS: Add myself and Cary as gold maintainers.
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
49926cd0
AM
12013-04-25 Alan Modra <amodra@gmail.com>
2
3 * configure.tgt: Add powerpcle and powerpc64le.
4
a4034750
AM
52013-04-22 Alan Modra <amodra@gmail.com>
6
7 PR gold/15355
8 * layout.cc (Layout::segment_precedes): Allow more than one
9 segment with the same type and flags.
10
e79c84aa
CC
112013-04-15 Cary Coutant <ccoutant@google.com>
12
13 * layout.cc (Layout::set_relocatable_section_offsets): Don't
14 allocate space in file for BSS sections.
15
2199fbe7
CC
162013-04-15 Cary Coutant <ccoutant@google.com>
17
18 * script-sections.cc (Orphan_output_section): Reset address
19 to zero after each orphaned section for relocatable links.
20
502e8a84
CC
212013-04-15 Cary Coutant <ccoutant@google.com>
22
a4034750
AM
23 * symtab.cc (Symbol_table::sized_write_globals): Subtract
24 section starting address for relocatable link.
25 * testsuite/Makefile.am (script_test_11): New test.
26 * testsuite/Makefile.in: Regenerate.
27 * testsuite/script_test_11.c: New source file.
28 * testsuite/script_test_11.t: New linker script.
502e8a84 29
0cfdc767
AM
302013-04-13 Alan Modra <amodra@gmail.com>
31
32 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
33 owner when sections are not adjacent and exceed group size.
34 (Target_powerpc::group_sections): Handle corner case.
35 (Target_powerpc::Branch_info::make_stub): Handle case where
36 stub table doesn't exist due to branches in non-exec sections.
37 (Target_powerpc::Relocate::relocate): Likewise.
38
6830ee24
AM
392013-04-11 Alan Modra <amodra@gmail.com>
40
41 PR gold/15354
42 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
43 .branch_lt to match bfd ld. Adjust comments throughout file.
44
54a3d865
ILT
452013-04-04 Ian Lance Taylor <iant@google.com>
46
47 GCC PR c++/56840
48 * object.cc (do_layout_deferred_sections): Handle .eh_frame
49 sections before checking whether they are included in the link.
50
9993ba11
ST
512013-03-29 Sriraman Tallam <tmsriram@google.com>
52
53 * archive.cc (Archive::get_elf_object_for_member): Create the elf
54 object before calling the plugin claim_file handler. Pass the elf
55 object of the archive to the plugin. Delete the elf object if the
56 plugin claims the file.
57
ebacd51e
AM
582013-03-21 Alan Modra <amodra@gmail.com>
59
60 * layout.cc (Layout::set_segment_offsets): Accept writable .text
61 segment when omagic.
62
117be58f
AM
632013-03-21 Alan Modra <amodra@gmail.com>
64
65 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
66 comparison warning.
67 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
68 uninitialized" warning.
69
32e2b61d
AM
702013-03-20 Alan Modra <amodra@gmail.com>
71
72 * symtab.h (Symbol::clear_version): New function.
73 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
74 is_needed by weak references. Clear version for symbols defined
75 in as-needed objects that are not needed.
76
b3ccdeb5
AM
772013-03-15 Alan Modra <amodra@gmail.com>
78
79 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
80 static and public. Add report_err param. Return false for data refs.
81 (Target_powerpc::rela_dyn_section): New overloaded function.
82 (Target_powerpc::plt_, iplt_): Elucidate.
83 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
84 (Output_data_plt_powerpc::do_write): Don't write .iplt.
85 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
86 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
87 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
88 push_branch and make_plt_entry for ifunc syms when
89 reloc_needs_plt_for_ifunc.
90 (Target_powerpc::Relocate::relocate): Don't use plt entry value
91 for ifunc unless reloc_needs_plt_for_ifunc.
92
ad3d8a2f
AM
932013-03-15 Alan Modra <amodra@gmail.com>
94
95 * gc.h (gc_process_relocs): Don't look through function descriptors.
96 * icf.cc (get_section_contents): Do so here instead.
97
4d9aa155
AM
982013-03-13 Alan Modra <amodra@gmail.com>
99
100 * powerpc.cc (is_branch_reloc): Forward declare.
101 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
102 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
103 false for 64-bit, true for 32-bit non-branch relocs.
104 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
105 * testsuite/Makefile.am (icf_test): Use linker map file instead of
106 nm output.
107 (icf_safe_test): Generate linker map file as well as nm output.
108 (icf_safe_so_test): Likewise.
109 * testsuite/Makefile.in: Regenerate.
110 * testsuite/icf_test.sh: Parse linker map file to determine
111 section folding.
112 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
113 * testsuite/icf_safe_so_test.sh: Likewise.
114 (X86_32_or_ARM_specific_safe_fold): Merge into..
115 (arch_specific_safe_fold): ..this.
116 (X86_64_specific_safe_fold): Delete unused function.
117
57420c20
AM
1182013-03-12 Alan Modra <amodra@gmail.com>
119
120 * gc.h (gc_process_relocs): Look through function descriptors
121 to determine shndx, symvalue and addend used by ICF. Tidy
122 variable duplication.
123
dc3714f3
AM
1242013-03-11 Alan Modra <amodra@gmail.com>
125
126 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
127 * layout.cc (Layout_task_runner::run): ..to here.
128 * symtab.h (struct Symbol_location): Extract from..
129 (class Symbol_table): ..here.
130 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
131 * target.h (class Target): Add function_location and
132 do_function_location functions.
133 (class Sized_target): Add do_function_location.
134 * object.h (class Sized_relobj_file): Move find_shdr..
135 (class Object): ..to here.
136 * object.cc: Likewise. Update to suit. Instantiate.
137 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
138 * powerpc.cc (class Powerpc_dynobj): New.
139 (Target_powerpc::do_function_location): New function.
140 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
141 (Powerpc_dynobj::do_read_symbols): New function.
142 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
143
956b03bb
ILT
1442013-03-08 Ian Lance Taylor <iant@google.com>
145
146 * options.cc (General_options::string_to_object_format): Accept
147 "default".
148
4bead2d5
AM
1492013-03-08 Alan Modra <amodra@gmail.com>
150
151 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
152 pointer to Post_fde.
153 (struct Post_fde): Move definition to here..
154 * ehframe.cc (struct Post_fde): ..from here.
155 (Cie::write): Don't alloc Post_fde.
156 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
157
02e60bf7
AM
1582013-03-07 Alan Modra <amodra@gmail.com>
159
160 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
161 relocation referencing .LC0.
162 * testsuite/discard_locals_test.sh: Remove FIXMEs.
163
8343f03a
AM
1642013-03-07 Alan Modra <amodra@gmail.com>
165
166 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
167 always_inline. Add assembly for powerpc to avoid GOT.
168
3366d57c
AM
1692013-03-07 Alan Modra <amodra@gmail.com>
170
171 * testsuite/script_test_10.sh: Don't test .bss section
172 header number.
173
6c77229c
AM
1742013-03-06 Alan Modra <amodra@gmail.com>
175
176 * powerpc.cc (class Powerpc_relobj): Move some member functions.
177 (Target_powerpc::symval_for_branch): Add symtab param. Update
178 all callers. Handle folded sections.
179 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
180 to Powerpc_relobj.
181 (Global_symbol_visitor_opd::operator()): Likewise.
182
a39e4af6
AM
1832013-03-04 Alan Modra <amodra@gmail.com>
184
185 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
186 * testsuite/Makefile.in: Regenerate.
187
d5834edb
CC
1882013-03-01 Cary Coutant <ccoutant@google.com>
189
190 Add dwp support for v2 DWARF package file format.
191 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
192 tu_length parameter. Adjust all callers.
193 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
194 * dwp.cc: Include dwarf.h.
195 (Section_bounds): New struct type.
196 (Unit_set): New struct type.
197 (Dwo_file::Dwo_file): Initialize new data member.
198 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
199 Combine and rename to...
200 (Dwo_file::read_unit_index): ...this.
201 (Dwo_file::sized_read_compunit_index)
202 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
203 (Dwo_file::sized_read_unit_index): ...this.
204 (Dwo_file::copy_section): Remove section_name, is_str_offsets
205 parameters; add section_id parameter.
206 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
207 (Dwo_file::add_unit_set): ...this.
208 (Dwo_file::shndx_map_): Remove.
209 (Dwo_file::sect_offsets_): New data member.
210 (Dwp_output_file::Dwp_output_file): Initialize new data members.
211 (Dwp_output_file::add_section): Rename to...
212 (Dwp_output_file::add_contribution): ...this.
213 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
214 (Dwp_output_file::add_tu_set): Likewise.
215 (Dwp_output_file::Contribution): New type.
216 (Dwp_output_file::Section::contributions): New data member.
217 (Dwp_output_file::Cu_or_tu_set): Remove.
218 (Dwp_output_file::Section::Section): New ctor.
219 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
220 (Dwp_output_file::Dwp_index::Section_table): New type.
221 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
222 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
223 parameter.
224 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
225 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
226 (Dwp_output_file::Dwp_index::section_table): New member function.
227 (Dwp_output_file::Dwp_index::section_table_end): New member function.
228 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
229 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
230 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
231 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
232 (Dwp_output_file::Dwp_index::section_table_): New data member.
233 (Dwp_output_file::Dwp_index::section_mask_): New data member.
234 (Dwp_output_file::add_output_section): New member function.
235 (Dwp_output_file::write_new_section): New member function.
236 (Dwp_output_file::write_contributions): New member function.
237 (Dwp_output_file::section_id_map_): New data member.
238 (class Dwo_id_info_reader): Remove.
239 (class Unit_reader): New class.
240 (get_dwarf_section_name): New function.
241 (Dwo_file::read_executable): Adjust initializations of class data.
242 (Dwo_file::read): Add support for v2 package file format.
243 (Dwo_file::read_unit_index): Likewise.
244 (Dwo_file::sized_read_unit_index): Likewise.
245 (Dwo_file::copy_section): Likewise.
246 (Dwo_file::add_unit_set): Likewise.
247 (Dwp_output_file::add_output_section): Likewise.
248 (Dwp_output_file::add_contribution): Likewise.
249 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
250 for empty slot.
251 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
252 file format.
253 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
254 slot.
255 (Dwp_output_file::initialize): Remove unused function.
256 (Dwp_output_file::finalize): Add support for v2 package file format.
257 (Dwp_output_file::write_index): Likewise.
258 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
259 function prototype.
260
a68a081d
CC
2612013-03-01 Cary Coutant <ccoutant@google.com>
262
263 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
264 function into class definition in header file.
265 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
266 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
267 New function.
268 (Dwarf_info_reader::check_buffer): Move here from .cc file.
269
9d5781f8
AM
2702013-02-28 Alan Modra <amodra@gmail.com>
271
272 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
273 * target.cc (Target::do_plt_fde_location): New function.
274 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
275 accessor function, and constructor param.
276 (struct Post_fde, Post_fdes): Declare.
277 (Cie::write): Add post_fdes param.
278 * ehframe.cc (Fde::write): Use plt_fde_location.
279 (struct Post_fde): Define.
280 (Cie::write): Stash FDEs added post merge mapping.
281 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
282 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
283 (Eh_frame::do_sized_write): Arrange to write post map FDES after
284 other FDEs.
285 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
286 (Target_powerpc::has_glink): New function.
287 (Target_powerpc::do_relax): Add eh_frame info for stubs.
288 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
289 glink_eh_frame_fde_32, default_fde): New data.
290 (Stub_table::eh_frame_added_): New var.
291 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
292 Make const.
293 (Stub_table::add_eh_frame): New function.
294 (Output_data_glink::add_eh_frame): New function.
295 (Target_powerpc::make_glink_section): Call add_eh_frame.
296
214383dd
ILT
2972013-02-15 Ian Lance Taylor <iant@google.com>
298
299 * options.h (DEFINE_uint64_alias): Define.
300 (class General_options): Add -Ttext-segment as an alias for
301 -Ttext.
302
91c2b899
AM
3032013-02-15 Alan Modra <amodra@gmail.com>
304
305 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
306 (Stub_table::do_write): ..here, two places.
307 (Stub_table::plt_call_size): Use it here too.
308
20e2a8aa
ILT
3092013-02-11 Ian Lance Taylor <iant@google.com>
310
311 * descriptors.cc (Descriptors::close_all): New function.
312 * descriptors.h (class Descriptors): Declare close_all.
313 (close_all_descriptors): New inline function.
314 * plugin.cc: Include "descriptors.h".
315 (Plugin_manager::cleanup): Call close_all_descriptors.
316
8952bc69
AM
3172013-02-06 Alan Modra <amodra@gmail.com>
318
319 * README: Update coding style link.
320
29bd8b6b
CC
3212013-01-28 Cary Coutant <ccoutant@google.com>
322
a4034750
AM
323 * dwp.cc (File_list): New typedef.
324 (Dwo_name_info_reader): New class.
325 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
326 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
327 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
328 (Dwo_file::read_executable): New function.
329 (Dwo_file::read): Move common setup code to ...
330 (Dwo_file::make_object): ... here.
331 (dwp_options): Add --exec/-e.
332 (usage): Likewise.
333 (main): Likewise.
29bd8b6b 334
c6ac678d
ST
3352013-01-24 Sriraman Tallam <tmsriram@google.com>
336
337 * layout.cc (Layout::layout): Check for option text_reorder.
338 (Layout::make_output_section): Ditto.
339 * options.h (text_reorder): New option.
340 * output.cc (Input_section_sort_compare): Remove special ordering
341 of section names.
342 (Output_section::
343 Input_section_sort_section_name_special_ordering_compare::
344 operator()): New function.
345 (Output_section::sort_attached_input_sections): Use new sort function
346 for .text.
347 * output.h (Input_section_sort_section_name_special_ordering_compare):
348 New struct.
349 * testsuite/Makefile.am (text_section_grouping): Test option
350 --no-text-reorder
351 * testsuite/Makefile.in: Regenerate.
352 * testsuite/text_section_grouping.sh: Check order of functions without
353 default text reordering.
354
50701cc1
MF
3552013-01-18 Mike Frysinger <vapier@gentoo.org>
356
357 * options.h (General_options): Change default to true for new_dtags.
358
b1b00fcc
MF
3592013-01-18 Mike Frysinger <vapier@gentoo.org>
360
361 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
362 when enable_new_dtags is false. Only add DT_RUNPATH when
363 enable_new_dtags is true.
364
ec5b8187
AM
3652013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
366
367 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
368 used in declaration and definition consistent.
369 (Target_powerpc::symval_for_branch): Ditto.
370
a880d4c4
ST
3712013-01-16 Sriraman Tallam <tmsriram@google.com>
372
373 * testsuite/plugin_final_layout.cc: Fix comment.
374
7c381248
ST
3752013-01-16 Sriraman Tallam <tmsriram@google.com>
376
377 * layout.cc (Layout::layout): Do not do default sorting for
378 text sections when section ordering is specified.
379 (make_output_section): Ditto.
380 * testsuite/plugin_final_layout.cc: Name the function sections
381 to catch reordering issues.
382
e2458743
AM
3832013-01-15 Alan Modra <amodra@gmail.com>
384
385 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
386 plt-thread-safe.
387
431ed302
AM
3882013-01-15 Alan Modra <amodra@gmail.com>
389
390 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
391 * testsuite/Makefile.in: Regenerate.
392
0ec6429b
AM
3932013-01-14 Alan Modra <amodra@gmail.com>
394
395 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
396 * testsuite/Makefile.in: Regenerate.
397
0bf402d5
ILT
3982013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
399
36af3926 400 PR bfd/14430
0bf402d5
ILT
401 Fix mingw gold build with plugins enabled
402 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
403 * configure.ac: Export DLOPEN_LIBS and add headers check.
404 * plugin.cc: Handle non-dlfcn case.
405 * Makefile.in: Regenerate.
406 * config.in: Regenerate.
407 * configure: Regenerate.
408 * testsuite/Makefile.in: Regenerate.
409
9e9143bc
ST
4102013-01-09 Sriraman Tallam <tmsriram@google.com>
411
412 * output.h (sort_attached_input_sections): Change to be public.
413 * script-sections.cc
414 (Output_section_definition::set_section_addresses): Sort
415 attached input sections according to section order before linker
416 script assigns section addresses.
417 (Orphan_output_section::set_section_addresses): Sort
418 attached input sections according to section order before linker
419 script assigns section addresses.
420 * Makefile.am (final_layout.sh): Use a simple linker script to
421 check if section ordering still works.
422 * Makefile.in: Regenerate.
423
679af368
ILT
4242013-01-09 Ben Cheng <bccheng@google.com>
425
426 * arm.cc (Target_arm::attributes_accept_div): New function.
427 (Target_arm::attributes_forbid_div): New function.
428 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
429 attribute using the same new functions as what bfd/elf32_arm.c
430 does.
431
3136a00e
CC
4322013-01-07 Cary Coutant <ccoutant@google.com>
433
434 PR gold/14993
435 * output.cc (Output_section::add_input_section): For incremental
436 updates, don't track input sections that are allocated from patch
437 space.
438
f2a6224b
L
4392013-01-07 H.J. Lu <hongjiu.lu@intel.com>
440 Ian Lance Taylor <iant@google.com>
441
442 PR gold/14897
443 * configure.ac (--enable-ld): Removed.
444 (install_as_default): Set to yes only for --enable-gold=default
445 or --disable-ld.
446 * configure: Regenerated.
447
4f46f626
L
4482013-01-07 H.J. Lu <hongjiu.lu@intel.com>
449
450 * options.h (General_options): Add -fuse-ld= for GCC linker
451 option compatibility.
452
26e4ef59
CC
4532013-01-04 Cary Coutant <ccoutant@google.com>
454
455 * configure.ac: Fix typo restoring CXXFLAGS.
456 * configure: Regenerate.
457
3d587466
CC
4582013-01-04 Cary Coutant <ccoutant@google.com>
459
4f46f626
L
460 * testsuite/Makefile.am (CXXLINK_S): New macro.
461 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
462 * testsuite/Makefile.in: Regenerate.
3d587466 463
44db6695
L
4642013-01-02 H.J. Lu <hongjiu.lu@intel.com>
465
466 * version.cc (print_version): Update copyright year to 2013.
467
edcac0c1
ILT
4682012-12-20 Ian Lance Taylor <iant@google.com>
469
470 * layout.cc (Layout::special_ordering_of_input_section): New
471 function.
472 (Layout::layout): If input section requires special ordering, must
473 sort input sections.
474 (Layout::make_output_section): May sort .text input sections.
475 (Layout::is_section_name_prefix_grouped): Remove.
476 * layout.h (class Layout): Declare
477 special_ordering_of_input_section. Don't declare
478 is_section_name_prefix_grouped.
479 * output.cc (Output_section::add_input_section): Revert last
480 change.
481 (Output_section::Input_section_sort::match_file_name): Don't crash
482 if called on output section data.
483 (Output_section::Input_section_sort_compare): Sort based on
484 special ordering.
485 (Output_section::Input_section_sort_section_order_index_compare):
486 Revert last patch.
487 (Output_section::sort_attached_input_sections): Likewise.
488
28f2a4ac
ST
4892012-12-18 Sriraman Tallam <tmsriram@google.com>
490
edcac0c1 491 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
492 * layout.h (Layout::is_section_name_prefix_grouped): New function.
493 * output.cc (Output_section::add_input_section): Check if section
494 name contains special prefix. Keep input sections to sort such
495 sections.
496 (Output_section::Input_section_sort_section_order_index_compare
497 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
498 (Output_section::sort_attached_input_sections): Add condition to
499 Input_section_entry constructor call.
28f2a4ac
ST
500 * testsuite/Makefile.am (text_section_grouping): New test.
501 * testsuite/Makefile.in: Regenerate.
502 * testsuite/text_section_grouping.cc: New file.
503 * testsuite/text_section_grouping.sh: New file.
504
5bf135a7
NC
5052012-12-17 Nick Clifton <nickc@redhat.com>
506
507 * Makefile.am: Add copyright notice.
508 * NEWS: Likewise.
509 * README: Likewise.
510 * configure.ac: Likewise.
511 * ftruncate.c: Likewise.
512 * Makefile.in: Regenerate.
513
59965708
CC
5142012-12-14 Cary Coutant <ccoutant@google.com>
515
a4034750
AM
516 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
517 --no-as-needed flag.
518 (exception_separate_shared_12_test): Likewise.
519 (incremental_copy_test): Likewise.
520 * testsuite/Makefile.in: Regenerate.
59965708 521
2a77e2ab
CC
5222012-12-14 Cary Coutant <ccoutant@google.com>
523
524 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
525 (Dwp_output_file::Dwp_index::enter_set): Add assert.
526
e3deeb9c
AM
5272012-12-12 Alan Modra <amodra@gmail.com>
528
529 * powerpc.cc (class Track_tls): New.
530 (class Relocate, class Scan): Inherit Track_tls.
531 (Target_powerpc::Scan::local, global): Track tls optimization
532 and avoid creating plt entry for __tls_get_addr if all uses
533 are optimized away.
534 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
535
d8f5a274
AM
5362012-12-12 Alan Modra <amodra@gmail.com>
537
538 * options.h (General_options): Add --toc-sort/--no-toc-sort.
539 Replace no_toc_optimize with toc_optimize.
540 * output.h (Output_section::input_sections): Provide non-const variant.
541 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
542 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
543 accessors.
544 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
545 (class Sort_toc_sections): New.
546 (Target_powerpc::do_finalize_sections): Sort toc sections.
547 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
548
4c8a1de1
RM
5492012-12-10 Roland McGrath <mcgrathr@google.com>
550
551 * testsuite/binary_unittest.cc (read_all): New function.
552 (Sized_binary_test): Use it instead of ::read.
553 * fileread.cc (do_read): Don't assume pread always reads the whole
554 amount in a single call.
555
edc27beb
AM
5562012-12-10 Alan Modra <amodra@gmail.com>
557
558 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
559 Set EM_PPC64 or EM_PPC here.
560 (Target_selector_powerpc::do_recognize): Delete.
561
906b9150
AM
5622012-12-10 Alan Modra <amodra@gmail.com>
563
564 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
565 stub_table_.
566 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
567
418c15ae
RM
5682012-12-07 Roland McGrath <mcgrathr@google.com>
569
570 * testsuite/binary_unittest.cc (Sized_binary_test):
571 Use open_descriptor rather than ::open.
572
decdd3bc
AM
5732012-12-07 Alan Modra <amodra@gmail.com>
574
575 * powerpc.cc (Stub_table::do_write): Delete redundant Address
576 typedef and invalid_address constant.
577 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
578 instantiate constants.
579
db399005
ILT
5802012-12-06 Roland McGrath <mcgrathr@google.com>
581
582 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
583 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
584 * aclocal.m4: Regenerate.
585 * configure: Regenerate.
586 * Makefile.in: Regenerate.
587 * testsuite/Makefile.in: Regenerate.
588
aba6bc71
AM
5892012-12-07 Alan Modra <amodra@gmail.com>
590
591 * options.h (General_options): Add no_toc_optimize.
592 * powerpc.cc (ok_lo_toc_insn): New function.
593 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
594
9e69ed50
AM
5952012-12-06 Alan Modra <amodra@gmail.com>
596
597 * options.h (General_options): Add plt_align, plt_static_chain,
598 plt_thread_safe. Update stub_group_size help text.
599 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
600 for new plt_thread_safe_ var.
601 (use_plt_offset): Correct comments.
602 (Target_powerpc::do_relax): Look for thread creation symbols to
603 determine default plt_thread_safe value. Clear plt call stubs
604 as well as branch stubs each iteration.
605 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
606 insn constants.
607 (l, hi, ha, write_insn): Move earlier.
608 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
609 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
610 plt stubs too.
611 (Stub_table::update_size): Adjust.
612 (Stub_table::prev_size, set_prev_size): Delete.
613 (Stub_table::stub_align): Let --plt-align affect result.
614 (Stub_table::plt_call_size): Calculate sizes for various stubs.
615 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
616 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
617 (Stub_table::do_write): Support more stub variants.
618
f43ba157
AM
6192012-12-04 Alan Modra <amodra@gmail.com>
620
621 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
622 (Target_powerpc::do_define_standard_symbols): New function.
623
34171bc5
AM
6242012-12-03 Alan Modra <amodra@gmail.com>
625
626 * output.h: Formatting, whitespace.
627
dc9589e9 6282012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
629
630 * layout.h (Layout::get_executable_sections): Declare.
631 * layout.cc (Layout::get_executable_sections): New function.
632 * arm.cc (Target_arm::group_sections): Use it.
633 (Arm_output_section::group_sections): Delete now redundant test.
634 * output.cc (Output_reloc::Output_reloc): Add is_relative.
635 param to handle relative relocs.
636 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
637 (Output_data_reloc::add_absolute): Adjust.
638 (Output_data_reloc::add_relative): New function.
639 (Output_data::reset_data_size): New function.
640 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
641 (Output_section::set_addralign): New function.
642 (Output_section::checkpoint_set_addralign): New function.
643 (Output_section::clear_section_offsets_need_adjustment): New function.
644 (Output_section::input_sections): Make public.
645 * powerpc.cc (class Output_data_brlt_powerpc): New.
646 (class Stub_table, class Stub_control): New.
647 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
648 stub_table_, set_stub_table, stub_table): New vectors and accessor
649 functions.
650 (Target_powerpc::do_may_relax, do_relax, push_branch,
651 new_stub_table, stub_tables, brlt_section, group_sections,
652 add_branch_lookup_table, find_branch_lookup_table,
653 write_branch_lookup_table, make_brlt_section): New functions.
654 (Target_powerpc::struct Sort_sections, class Branch_info): New.
655 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
656 branch_info_): New vars.
657 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
658 make call stubs here.
659 (Output_data_glink): Remove all call stub handling from this class.
660 (Target_powerpc::Scan::local, global): Save interesting branch
661 relocs and relocs for ifunc. Adjust calls to plt entry functions.
662 (Target_powerpc::do_finalize_sections): Only make reg save/restore
663 functions on final link.
664 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
665 Handle long branch destinations too.
666 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
667 do_plt_address_for_local): Adjust lookup of plt call stubs.
668
627b30b7
AM
6692012-11-30 Alan Modra <amodra@gmail.com>
670
671 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
672 relocs against protected symbols when building 32-bit shared libs.
673
40b469d7
AM
6742012-11-30 Alan Modra <amodra@gmail.com>
675
676 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
677 param. Call got_section() to make .got. Update all callers
678 and their callers and so on.
679
bb66a627
AM
6802012-11-30 Alan Modra <amodra@gmail.com>
681
682 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
683 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
684 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
685 value if it already exists.
686
d2cf1c6c
L
6872012-11-19 H.J. Lu <hongjiu.lu@intel.com>
688
689 PR gold/14858
690 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
691
edccdf7c
RM
6922012-11-14 Roland McGrath <mcgrathr@google.com>
693
694 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
695 than bfc instruction for data sandboxing.
696
6febeb74
AM
6972012-11-08 Alan Modra <amodra@gmail.com>
698
699 * po/POTFILES.in: Regenerate.
700
0a6f1bf2
AM
7012012-11-05 Alan Modra <amodra@gmail.com>
702
703 * configure.ac: Apply 2012-09-10 change to config.in here.
704 * configure: Regenerate.
705
26a4e9cb
AM
7062012-11-05 Alan Modra <amodra@gmail.com>
707
708 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
709 (struct Opd_ent): Use "Address" rather than "Offset".
710 (Output_data_got_powerpc::got_base_offset): Return Valtype.
711 (Target_powerpc::got_section): Make public.
712 (Target_powerpc::scan_relocs): Move code setting symbols..
713 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
714 Create _SDA_BASE_ only when referenced.
715
cc928013
RM
7162012-11-02 Roland McGrath <mcgrathr@google.com>
717
718 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
719 from last change.
720
50ed5eb1
RM
7212012-11-01 Roland McGrath <mcgrathr@google.com>
722
62fe925a
RM
723 * target.h (Sized_target::relocate_relocs): Use Elf_Off
724 for offset_in_output_section parameter.
725 (Sized_target::relocate_special_relocatable): Likewise.
726 * arm.cc (Target_arm::relocate_relocs): Likewise.
727 (Target_arm::relocate_special_relocatable): Likewise.
728 * i386.cc (Target_i386::relocate_relocs): Likewise.
729 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
730 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
731 * target-reloc.h (relocate_relocs): Likewise.
732 * testsuite/testfile.cc (Target_test): Likewise.
733 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
734 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
735
736 * system.h: Move inclusion of <clocale> to after <libintl.h> in
737 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
738
739 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
740 parameter, which is unused in the [!F_SETFD] case.
741
50ed5eb1
RM
742 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
743 SYMNDX to off_t before comparing it to this->data_size().
744 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
745 * incremental.cc (Output_section_incremental_inputs::do_write):
746 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
747
2cadc0bf
RM
748 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
749
3bfcb652
NC
7502012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
751
752 * gold.cc (Target_arm::do_adjust_elf_header): Add the
753 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
754 in EABI_VER5.
755
c1a8d56e
CC
7562012-10-29 Cary Coutant <ccoutant@google.com>
757
758 * dwp.cc (usage): Add file and exit status parameters;
759 add --help and --version options.
760 (print_version): New function.
761 (main): Add --help and --version options.
762
b2490a7b
L
7632012-10-25 H.J. Lu <hongjiu.lu@intel.com>
764
765 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
766 final_layout_sequence.txt.
767 * testsuite/Makefile.in: Regenerated.
768
aa543512
L
7692012-10-25 H.J. Lu <hongjiu.lu@intel.com>
770
771 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
772 COMPILE generated by automake.
773 (LINK1): Likewise.
774 (CXXCOMPILE1): Likewise.
775 (CXXLINK1): Likewise.
776 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
777 (LINK): Likewise.
778 (CXXCOMPILE): Likewise.
779 (CXXLINK): Likewise.
780 * testsuite/Makefile.in: Regenerated.
781
d361fafb
L
7822012-10-25 H.J. Lu <hongjiu.lu@intel.com>
783
784 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
785 on bad fwrite return.
786
598c7410
L
7872012-10-25 H.J. Lu <hongjiu.lu@intel.com>
788
789 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
790 on val.
791
35c813e2
CC
7922012-10-23 Cary Coutant <ccoutant@google.com>
793
794 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
795 * testsuite/Makefile.in: Regenerate.
796 * testsuite/dwp_test.h: New source file.
797 * testsuite/dwp_test_1.cc: New source file.
798 * testsuite/dwp_test_1.s: New source file.
799 * testsuite/dwp_test_1.sh: New source file.
800 * testsuite/dwp_test_1b.cc: New source file.
801 * testsuite/dwp_test_1b.s: New source file.
802 * testsuite/dwp_test_2.cc: New source file.
803 * testsuite/dwp_test_2.s: New source file.
804 * testsuite/dwp_test_2.sh: New source file.
805 * testsuite/dwp_test_main.cc: New source file.
806 * testsuite/dwp_test_main.s: New source file.
807
77429909
CC
8082012-10-23 Cary Coutant <ccoutant@google.com>
809
810 * dwp.h: New header file.
811 * dwp.cc: New source file.
812 * gold.h: Move shared declarations to system.h.
813 * system.h: New header file.
814 * Makefile.am: Add dwp.
815 * Makefile.in: Regenerate.
816
ed5d6712
CC
8172012-10-23 Cary Coutant <ccoutant@google.com>
818
819 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
820 Dwarf_info_reader::read_from_pointer.
821 (Dwarf_pubnames_table::read_header): Likewise.
822 (Dwarf_pubnames_table::next_name): Likewise.
823 (Dwarf_die::read_attributes): Likewise.
824 (Dwarf_die::skip_attributes): Likewise.
825 (Dwarf_info_reader::read_from_pointer): New function template.
826 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
827 (Dwarf_pubnames_table): Likewise.
828 (Dwarf_info_reader::read_from_pointer): New function template.
829 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
830 Dwarf_pubnames_table ctor.
831
8787852d
CC
8322012-10-23 Cary Coutant <ccoutant@google.com>
833
834 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
835 abbrev_shndx.
836 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
837 abbrev_shndx_.
838 (Dwarf_info_reader::set_abbrev_shndx): New method.
839 (Dwarf_info_reader::abbrev_shndx_): New data member.
840
9fc236f3
CC
8412012-10-23 Cary Coutant <ccoutant@google.com>
842
843 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
844 from object, not parameters.
845 (Dwarf_info_reader::parse): Likewise.
846 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
847 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
848 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
849 methods.
850
effe8365
CC
8512012-10-23 Cary Coutant <ccoutant@google.com>
852
853 * fileread.cc (Input_file::Input_file): New constructor.
854 * fileread.h (class Input_file): Add new constructor.
855
1698990d
AM
8562012-10-18 Alan Modra <amodra@gmail.com>
857
858 PR gold/14727
859 * object.cc (Relobj::is_section_name_included): Also match
860 .sdata personality section.
861
168a4726
AM
8622012-10-18 Alan Modra <amodra@gmail.com>
863
864 * target-reloc.h (class Default_comdat_behavior): New, package up..
865 (get_comdat_behaviour): ..this.
866 (relocate_section): Add Relocate_comdat_behavior template arg,
867 adjust code to suit.
868 * arm.cc (Target_arm::relocate_section): Adjust to suit.
869 (Target_arm::scan_reloc_section): Likewise.
870 * i386.cc (Target_i386::relocate_section): Likewise.
871 * sparc.cc (Target_sparc::relocate_section): Likewise.
872 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
873 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
874 * powerpc.cc (class Relocate_comdat_behavior): New.
875 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
876 gold::relocate_section with new template arg.
877
acc276d8
AM
8782012-10-18 Alan Modra <amodra@gmail.com>
879
880 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
881 dynamic relocs for GOT_TPREL got entries, without symbol if
882 resolving locally.
883 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
884 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
885 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
886
e10f9870
AM
8872012-10-17 Alan Modra <amodra@gmail.com>
888
889 PR gold/14726
890 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
891
ae034989
ST
8922012-10-16 Sriraman Tallam <tmsriram@google.com>
893
894 * layout.cc (Layout::include_section): Keep sections marked
895 SHF_EXCLUDE when doing relocatable links.
896
f3a0ed29
AM
8972012-10-16 Alan Modra <amodra@gmail.com>
898
899 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
900 (Target_powerpc::do_finalize_sections): Call it.
901 (Output_data_save_res): New class and supporting functions.
902 (Target_powerpc::symval_for_branch): Only look up .opd entry for
903 normal symbols defined in object files.
904
c6de8ed4
AM
9052012-10-12 Alan Modra <amodra@gmail.com>
906
907 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
908 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
909 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
910 section if scan_opd_relocs not yet called.
911 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
912
03e25981
AM
9132012-10-12 Alan Modra <amodra@gmail.com>
914
915 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
916 add_local_ifunc_entry): Revert last change.
917 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
918
c9824451
AM
9192012-10-05 Alan Modra <amodra@gmail.com>
920
921 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
922 do_plt_address_for_global): New functions.
923 (Output_data_got_powerpc::do_write): Don't segfault when linking
924 statically.
925 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
926 add_local_ifunc_entry): Return true on adding entry..
927 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
928 glink->add_entry call. Remove unused symtab param. Adjust calls.
929 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
930 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
931 set up symbols here.
932 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
933 syms here. Do so even when no .iplt. Don't segfault when linking
934 statically.
935 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
936 new variants without reloc param.
937 (Glink_sym_ent::Glink_sym_ent): Likewise.
938 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
939 reloc when refs will resolve to plt call stub.
940 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
941 R_PPC_PLTREL24 to resolve locally.
942 (Target_powerpc::Scan::global): Correct ifunc handling.
943 (Target_powerpc::Relocate::relocate): Correct local sym glink
944 lookup. Don't destroy "value" when we have a plt call stub,
945 and when checking plt call validity.
946 (Target_powerpc::do_dynsym_value): Simplify.
947
19fec8c1
AM
9482012-10-05 Alan Modra <amodra@gmail.com>
949
950 * i386.cc (Output_data_plt_i386::address_for_global,
951 address_for_local): Add plt offset to returned value. Adjust uses.
952 * sparc.cc (Output_data_plt_sparc::address_for_global,
953 address_for_local): Likewise.
954 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
955 address_for_local): Likewise.
956 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
957 address_for_local): Likewise.
958 * target.h (Target::plt_address_for_global, plt_address_for_local):
959 Update comment.
960 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
961 (Output_data_got::Got_entry::write): Nor here.
962 * output.h: Comment fix.
963
e867b647
WL
9642012-10-02 Jiong Wang <jiwang@tilera.com>
965
966 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
967 global_offset_table_ value for larget got.
968 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
969
e5d5f5ed
AM
9702012-09-29 Alan Modra <amodra@gmail.com>
971
972 * powerpc.cc (Target_powerpc::iplt_): New output section.
973 (Target_powerpc::iplt_section, make_iplt_section,
974 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
975 (Target_powerpc::make_plt_entry): Handle ifunc syms.
976 Target_powerpc::plt_entry_count): Count iplt entries too.
977 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
978 reloc section in constructor. New params.
979 (Target_powerpc::make_plt_section): Create reloc section here instead.
980 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
981 functions.
982 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
983 (Output_data_glink::add_entry, find_entry): New functions to
984 deal with local syms.
985 (Glink_sym_ent): Add support for local syms.
986 (Output_data_glink::do_write): Handle ifunc plt entries.
987 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
988 (Target_powerpc::Scan::local, global): Handle ifunc syms.
989 (Target_powerpc::Relocate::relocate): Likewise.
990 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
991
ec4dbad3
AM
9922012-09-25 Alan Modra <amodra@gmail.com>
993
994 * object.h (Sized_relobj_file::adjust_local_symbol,
995 do_adjust_local_symbol): New functions.
996 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
997 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
998 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
999 and irregular opd entry spacing.
1000 (Powerpc_relobj::do_read_relocs): Add opd size checks.
1001 (Global_symbol_visitor_opd): New functor.
1002 (Target_powerpc::do_finalize_sections): Omit global symbols defined
1003 on deleted opd entries.
1004
5c0b3823
WL
10052012-09-15 Jiong Wang <jiwang@tilera.com>
1006
1007 * tilegx.cc: New file.
1008 * Makefile.am (TARGETSOURCES): Add tilegx.cc
1009 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
1010 * configure.tgt: Add entries for tilegx*.
1011 * configure.ac: Likewise.
1012 * Makefile.in: Rebuild.
1013 * configure: Likewise.
1014 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
1015 tilegx.
1016
bfdfa4cd
AM
10172012-09-13 Alan Modra <amodra@gmail.com>
1018
1019 * target-reloc.h (scan_relocs): Call scan.local for relocs
1020 against symbols in discarded sections. Pass is_discarded
1021 param.
1022 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
1023 Add is_discarded param.
1024 * powerpc (Target_powerpc::Scan::local): Likewise. Use
1025 is_discarded to flag opd entry as discarded. Don't emit dyn
1026 relocs on such entries.
1027 (Target_powerpc::Scan::global): Similarly detect and handle
1028 such opd entries.
1029 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
1030 opd_ent_. Update all uses.
1031 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
1032 (Target_powerpc::relocate_section): Zero out discarded opd
1033 entry relocs.
1034
d77a0555
ILT
10352012-09-12 Ian Lance Taylor <iant@google.com>
1036
1037 PR gold/14570
1038 * output.cc: Rename Output_data_got template parameter from size
1039 to got_size for all functions. Compile all variants of
1040 Output_data_got.
1041 (Output_data_got::Got_entry::write): Correct use of size for
1042 symbol value. Use local_is_tls rather than casting to
1043 Sized_relobj_file.
1044 * object.h (class Object): Add local_is_tls and do_local_is_tls.
1045 (class Sized_relobj_file): Add do_local_is_tls.
1046 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
1047
815a1205
AM
10482012-09-11 Alan Modra <amodra@gmail.com>
1049
1050 PR gold/14566
1051 * layout.cc (Layout::set_segment_offsets): When using
1052 common-page-size alignment, ensure we are on a new max-page-size
1053 page.
1054 * output.cc (Output_segment::set_section_addresses): Use
1055 abi_pagesize, not common_pagesize for relro boundary.
1056 (Output_segment::set_offset): Likewise.
1057
bd73a62d
AM
10582012-09-11 Alan Modra <amodra@gmail.com>
1059
1060 * output.h (Output_data_got::add_global_tls, add_local_tls,
1061 add_local_tls_pair): New functions.
1062 (Output_data_got::add_local_pair_with_rel): Remove second
1063 reloc param. Expand comment.
1064 (Output_data_got::Got_entry): Rename use_plt_offset_ to
1065 use_plt_or_tls_offset_, similarly for constructor param.
1066 (Output_data_got::Got_entry::write): Add got_index param.
1067 * output.cc (Output_data_got::add_global_tls, add_local_tls,
1068 add_local_tls_pair): New functions.
1069 (Output_data_got::Got_entry::write): Handle tls symbols
1070 with use_plt_or_tls_offset_ set specially.
1071 (Output_data_got::add_local_pair_with_rel): Only one reloc.
1072 (Output_data_got::do_write): Replace iterator with index, pass
1073 index to entry write function.
1074 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
1075 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
1076 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
1077 call.
1078 * i386.cc (Target_i386::Scan::local): Likewise.
1079 * sparc.cc (Target_sparc::Scan::local): Likewise.
1080 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
1081 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
1082 do_tls_offset_for_global): New functions.
1083 (Target_powerpc::Scan::local): Correct TLS relocations and got
1084 entry values.
1085 (Target_powerpc::Scan::global): Don't emit unnecessary
1086 dynamic relocations on TLS GOT entries.
1087
00716ab1
AM
10882012-09-10 Matthias Klose <doko@ubuntu.com>
1089
1090 * config.in: Disable sanity check for kfreebsd.
1091
c891b3f9
SA
10922012-09-10 Sterling Augustine <saugustine@google.com>
1093
1094 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
1095 (Gdb_index::pubtypes_read): New parameter.
1096 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
1097 to calls.
1098 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
1099 pubtypes_object_.
1100
e81fea4d
AM
11012012-09-09 Alan Modra <amodra@gmail.com>
1102
1103 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
1104 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
1105 * gc.h (gc_process_relocs): Call target gc_add_reference.
1106 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
1107 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
1108 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
1109 unnecessary cast.
1110 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
1111 to cater for when we don't need code offset. Update use.
1112 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
1113 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
1114 set_opd_valid): New functions.
1115 (Target_powerpc::do_gc_add_reference): New function.
1116 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
1117 stashed refs.
1118 (Target_powerpc::do_gc_mark_symbol): New function.
1119
d2d60eef
CC
11202012-09-06 Cary Coutant <ccoutant@google.com>
1121
1122 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
1123 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
1124 (Dwarf_die::skip_attributes): Likewise.
1125 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
1126 * testsuite/gdb_index_test.cc (inline_func_1): New function.
1127 (main): Call it.
1128 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
1129
32ed4573
L
11302012-09-05 H.J. Lu <hongjiu.lu@intel.com>
1131
1132 * testsuite/script_test_3.t: Add .got.plt output section
1133 statement.
1134 * testsuite/script_test_4.t: Likewise.
1135
f4baf0d4
AM
11362012-09-05 Alan Modra <amodra@gmail.com>
1137
1138 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
1139 update all uses and lose "enum" when using type.
1140
864a1b56
AM
11412012-09-05 Alan Modra <amodra@gmail.com>
1142
1143 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
1144 * configure: Regenerate.
1145 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
1146 (plugin_final_layout.stdout): Likewise.
1147 (memory_test): Set page sizes to 0x1000.
1148 * testsuite/Makefile.in: Regenerate.
1149 * testsuite/discard_locals_test.sh: Add FIXME comment.
1150 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
1151 * testsuite/pr14265.t: Add .got output section statement.
1152 * testsuite/script_test_2.t: Likewise.
1153 * testsuite/script_test_3.t: Likewise.
1154 * testsuite/script_test_4.t: Likewise.
1155 * testsuite/script_test_5.t: Likewise.
1156 * testsuite/script_test_6.t: Likewise.
1157 * testsuite/script_test_7.t: Likewise.
1158 * testsuite/script_test_9.t: Likewise.
1159
3ea0a085
AM
11602012-09-05 Alan Modra <amodra@gmail.com>
1161
1162 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
1163 (Powerpc_relocate_functions::Status): New typedef.
1164 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
1165 (Target_powerpc::Scan::local): Handle REL64.
1166 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
1167 for REL32 and REL64.
1168 (Target_powerpc::symval_for_branch): New function, extracted from..
1169 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
1170 checks. Report overflow errors.
1171
7404fe1b
AM
11722012-09-05 Alan Modra <amodra@gmail.com>
1173
1174 * object.h (Sized_relobj_file::emit_relocs): Delete.
1175 (Sized_relobj_file::emit_relocs_reltype): Delete.
1176 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
1177 relocate_relocs for --emit-relocs.
1178 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
1179 * output.h: Update comment.
1180 (Output_segment::first_section): New function.
1181 (Output_segment::first_section_load_address): Use first_section.
1182 * output.cc (Output_segment::first_section): New function extracted..
1183 (Output_segment::first_section_load_address): ..from here. Delete.
1184 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
1185 * target.h (Sized_target::relocate_for_relocatable): Likewise.
1186 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
1187 adjust call to target.h function.
1188 * i386.cc (Target_i386): Likewise.
1189 * sparc.cc (Target_sparc): Likewise.
1190 * x86_64.cc (Target_x86_64): Likewise.
1191 * powerpc.cc (Target_powerpc): Likewise.
1192 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
1193 first tls section has section symbol for optimised local dynamic
1194 output relocs.
1195 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
1196 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
1197 optimised tls code.
1198 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
1199 Rename to relocate_relocs. Update error message.
1200
957564c9
AS
12012012-09-04 Andreas Schwab <schwab@linux-m68k.org>
1202
1203 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
1204 --just-symbols.
1205
dd93cd0a
AM
12062012-08-31 Alan Modra <amodra@gmail.com>
1207
1208 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
1209 (Powerpc_relobj::toc_base_offset): New stub function.
1210 (Target_powerpc): Add tp_offset, dtp_offset. Rename
1211 got_mod_index_offset to tlsld_got_offset. Update all refs.
1212 (Target_powerpc::Relocate::enum skip_tls): New.
1213 (Target_powerpc::call_tls_get_addr_): New var.
1214 (Target_powerpc::is_branch_reloc): Move to file scope.
1215 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
1216 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
1217 New functions.
1218 (Target_powerpc::enum Got_type): Delete old values, add new ones.
1219 (powerpc_info): Correct common_pagesize for ppc64.
1220 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
1221 (Powerpc_relocate_functions): Add overflow check enums and functions.
1222 Add non-shift version of rela, rela_ua. Delete all rel public
1223 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
1224 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
1225 addr16_ha3, addr14 functions.
1226 (Output_data_got_powerpc::add_constant_pair): New function.
1227 (Output_data_got_powerpc::got_base_offset): Likewise.
1228 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
1229 (instruction constants): Sort, add some more.
1230 (Output_data_glink::do_write): Add and use Address typedef. Use
1231 object->toc_base_offset() stub for 64-bit.
1232 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
1233 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
1234 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
1235 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
1236 Always treat .opd relocs as against locally defined symbol.
1237 Correct condition for RELATIVE relocs.
1238 (Target_powerpc::do_finalize_sections): Test for NULL sections.
1239 (Target_powerpc::Relocate::relocate): Use plt call stub as value
1240 for 32-bit syms with a plt entry. Correct ppc64 toc base
1241 calculations. Handle TLS relocs, and more. Add overflow
1242 checking and adjust for Powerpc_relocate_functions changes.
1243 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
1244 Reinstate --emit-relocs code with FIXME.
1245
a1373b60
AM
12462012-08-30 Alan Modra <amodra@gmail.com>
1247
1248 * layout.cc (Layout::set_segment_offsets): Set p_align to
1249 abi_pagesize, not common_pagesize.
1250 (Layout::relaxation_loop_body): Similarly use abi_pagesize
1251 to determine whether file header can go in segment.
1252
703d02da
AM
12532012-08-30 Alan Modra <amodra@gmail.com>
1254
1255 * output.h (Output_reloc::Output_reloc <output section>): Add
1256 is_relative param. Adjust calls.
1257 (Output_reloc::add_output_section_relative): New functions.
1258 * output.cc (Output_reloc::Output_reloc <output section>): Handle
1259 is_relative.
1260 (Output_reloc::symbol_value): Handle SECTION_CODE.
1261
16164a6b
ST
12622012-08-24 Sriraman Tallam <tmsriram@google.com>
1263
1264 * gold.cc (queue_middle_tasks): Call layout again when unique
1265 segments for sections is desired.
1266 * layout.cc (Layout::Layout): Initialize new members.
1267 (Layout::get_output_section_flags): New function.
1268 (Layout::choose_output_section): Call get_output_section_flags.
1269 (Layout::layout): Make output section for mapping to a unique segment.
1270 (Layout::insert_section_segment_map): New function.
1271 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 1272 output sections marked so.
16164a6b
ST
1273 (Layout::segment_precedes): Check for unique segments when sorting.
1274 * layout.h (Layout::Unique_segment_info): New struct.
1275 (Layout::Section_segment_map): New typedef.
1276 (Layout::insert_section_segment_map): New function.
1277 (Layout::get_output_section_flags): New function.
1278 (Layout::is_unique_segment_for_sections_specified): New function.
1279 (Layout::set_unique_segment_for_sections_specified): New function.
1280 (Layout::unique_segment_for_sections_specified_): New member.
1281 (Layout::section_segment_map_): New member.
1282 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
1283 Rename is_gc_pass_one to is_pass_one.
1284 Rename is_gc_pass_two to is_pass_two.
1285 Rename is_gc_or_icf to is_two_pass.
1286 Check for which pass based on whether symbols data is present.
1287 Make it two pass when unique segments for sections is desired.
1288 * output.cc (Output_section::Output_section): Initialize new
1289 members.
1290 * output.h (Output_section::is_unique_segment): New function.
1291 (Output_section::set_is_unique_segment): New function.
1292 (Output_section::is_unique_segment_): New member.
1293 (Output_section::extra_segment_flags): New function.
1294 (Output_section::set_extra_segment_flags): New function.
1295 (Output_section::extra_segment_flags_): New member.
1296 (Output_section::segment_alignment): New function.
1297 (Output_section::set_segment_alignment): New function.
1298 (Output_section::segment_alignment_): New member.
1299 (Output_segment::Output_segment): Initialize is_unique_segment_.
1300 (Output_segment::is_unique_segment): New function.
1301 (Output_segment::set_is_unique_segment): New function.
1302 (Output_segment::is_unique_segment_): New member.
1303 * plugin.cc (allow_unique_segment_for_sections): New function.
1304 (unique_segment_for_sections): New function.
1305 (Plugin::load): Add new functions to transfer vector.
1306 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
1307 * Makefile.in: Regenerate.
1308 * testsuite/plugin_final_layout.sh: Check if unique segment
1309 functionality works.
1310 * testsuite/plugin_section_order.c (onload): Check if new interfaces
1311 are available.
1312 (allow_unique_segment_for_sections): New global.
1313 (unique_segment_for_sections): New global.
1314 (claim_file_hook): Call allow_unique_segment_for_sections.
1315 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 1316
1e2bee4f
CC
13172012-08-22 Cary Coutant <ccoutant@google.com>
1318
1319 * layout.cc (Layout::include_section): Don't assert on GROUP
1320 sections with --emit-relocs.
1321
1d5dfe78
CC
13222012-08-21 Cary Coutant <ccoutant@google.com>
1323
1324 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
1325 if --export-dynamic-symbol names an undef symbol.
1326
c9269dff
AM
13272012-08-18 Alan Modra <amodra@gmail.com>
1328
1329 * powerpc.cc: Formatting and white space.
1330 (Powerpc_relobj): Rename got2_section_ to special_.
1331 Add opd_ent_shndx_ and opd_ent_off_ vectors.
1332 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
1333 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
1334 (Target_powerpc): Add Address typedef and invalid_address. Use
1335 throughout.
1336 (Target_powerpc::is_branch_reloc): New function.
1337 (Powerpc_relocate_functions): Add Address typedef, use throughout.
1338 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
1339 for dst_mask, value and addend.
1340 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
1341 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
1342 (Output_data_glink::do_write): Correct toc base. Don't try to use
1343 uint16_t for 24-bit offset. Use get_output_section_offset and
1344 check return.
1345 (Target_powerpc::Scan::local): Handle more relocs.
1346 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
1347 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
1348 Plug in toc restoring insn after plt calls. Translate branches
1349 to function descriptor symbols to corresponding entry point.
1350 (Target_powerpc::relocate_for_relocatable): Check return from
1351 get_output_section_offset.
1352 * symtab.h: Comment typo.
1353
b1759dce
ILT
13542012-08-14 Ian Lance Taylor <iant@google.com>
1355
1356 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
1357 unsupported_relocal_local to call unsupported_reloc_global.
1358
b9b2ae8b
NC
13592012-08-14 Nick Clifton <nickc@redhat.com>
1360
1361 PR ld/14265
1362 * script-sections.cc (Sections_element::output_section_name): Add
1363 keep return parameter.
1364 (Output_section_element::match_name): Add keep return parameter.
1365 Return the value of the keep_ member.
1366 * script-sections.h (class Output_section): Update
1367 output_section_name prototype.
1368 * layout.cc (Layout::keep_input_section): New public member
1369 function.
1370 (Layout::choose_output_section): Pass keep parameter to
1371 output_section_name.
1372 * layout.h (class Layout): Add keep_input_section.
1373 * object.cc (Sized_relobj_file::do_layout): Check for kept input
1374 sections.
1375 * testsuite/Makefile.am: Add a test.
1376 * testsuite/Makefile.in: Regenerate.
1377 * testsuite/pr14265.c: Source file for the test.
1378 * testsuite/pr14265.t: Linker script for the test.
1379 * testsuite/pr14265.sh: Shell script for the test.
1380
921b5322
AM
13812012-08-14 Alan Modra <amodra@gmail.com>
1382
1383 * target.h (Target::output_section_name): New function.
1384 (Target::do_output_section_name): New function.
1385 * layout.cc (Layout::choose_output_section): Call the above.
1386 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
1387
6ce78956
AM
13882012-08-14 Alan Modra <amodra@gmail.com>
1389
1390 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
1391 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
1392 for replace_constant call.
1393 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
1394 (Output_data_glink::do_print_to_mapfile): New function.
1395 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
1396 (Target_powerpc::Relocate::relocate): Likewise.
1397
d1a8cabd
AM
13982012-08-14 Alan Modra <amodra@gmail.com>
1399
1400 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
1401 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
1402 (Output_data_glink::add_entry,find_entry): Remove shndx param.
1403 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
1404 all references to shndx_. Handle special case for R_PPC_PLTREL24
1405 here.
1406 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
1407 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
1408 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
1409 here.
1410 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
1411 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
1412
d83ce4e3
AM
14132012-08-12 Alan Modra <amodra@gmail.com>
1414
1415 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
1416 (glink insn constants): Use uint32_t.
1417 (Output_data_glink::add_entry): Use insert, not [] operator.
1418
cf43a2fe
AM
14192012-08-11 Alan Modra <amodra@gmail.com>
1420
1421 * object.h (Sized_relobj_file::find_shdr): New function.
1422 (Sized_relobj_file::find_special_sections): New function.
1423 * object.cc (Sized_relobj_file::find_shdr): New function.
1424 (Sized_relobj_file::find_eh_frame): Use find_shdr.
1425 (Sized_relobj_file::find_special_sections): New function, split out..
1426 (Sized_relobj_file::do_read_symbols): ..from here.
1427 * output.h (Output_data_got::replace_constant): New function.
1428 (Output_data_got::num_entries): New function.
1429 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
1430 (Output_data_got::got_offset): Protected rather than private.
1431 (Output_data_got::replace_got_entry): New function.
1432 * output.cc (Output_data_got::replace_got_entry): New function.
1433 * powerpc.cc (class Powerpc_relobj): New.
1434 (class Powerpc_relocate_functions): Delete all psymval variants or
1435 convert to value,addend type. Delete pcrela, pcrela_unaligned.
1436 Implement _ha functions using corresponding _hi function.
1437 (Powerpc_relobj::find_special_sections): New function.
1438 (Target_powerpc::do_make_elf_object): New function.
1439 (class Output_data_got_powerpc): New.
1440 (class Output_data_glink): New.
1441 (class Powerpc_scan_relocatable_reloc): New.
1442 Many more changes througout file.
1443
3c892704
NC
14442012-08-09 Nick Clifton <nickc@redhat.com>
1445
1446 * po/vi.po: Updated Vietnamese translation.
1447
82435b3b
ILT
14482012-08-07 Ian Lance Taylor <iant@google.com>
1449
1450 * layout.cc (Layout::add_target_dynamic_tags): If
1451 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
1452 plt_rel.
1453
a6dc81d2
NC
14542012-07-30 Nick Clifton <nickc@redhat.com>
1455
1456 * po/gold.pot: Updated template.
1457 * po/es.po: Updated Spanish translation.
1458
f1415016
CC
14592012-07-18 Cary Coutant <ccoutant@google.com>
1460
1461 PR gold/14344
1462 * configure.ac: Add check for -gpubnames support.
1463 * configure: Regenerate.
1464 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
1465 support; force -gno-pubnames.
1466 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
1467 support.
1468 (gdb_index_test_4): New test.
1469 * testsuite/Makefile.in: Regenerate.
1470 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
1471 * testsuite/gdb_index_test_2.sh: Likewise.
1472 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
1473 * testsuite/gdb_index_test_4.sh: New script.
1474 * testsuite/gdb_index_test_comm.sh: New script with common code;
1475 don't look for space after colon.
1476
b7fd7c37
ST
14772012-07-16 Sriraman Tallam <tmsriram@google.com>
1478
1479 * gold.cc (queue_middle_tasks): Update function order only after
1480 deferred objects due to plugins are processed.
1481
1f3212db
ILT
14822012-07-11 Ian Lance Taylor <iant@google.com>
1483
1484 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
1485 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
1486 (Target_arm::scan_reloc_for_stub): Likewise.
1487 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
1488 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
1489 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
1490 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
1491 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
1492
81c82a68
ILT
14932012-07-10 Dodji Seketeli <dodji@redhat.com>
1494 Ian Lance Taylor <iant@google.com>
1495
1496 PR gold/14309
1497 * configure.ac: Test whether std::tr1::hash<off_t> works.
1498 * gold.h: Add a specialization for std::tr1::hash<off_t> if
1499 needed.
1500 * output.h (class Output_fill): Add virtual destructor.
1501 * configure, config.in: Rebuild.
1502
eabc84f4
RM
15032012-06-22 Roland McGrath <mcgrathr@google.com>
1504
1505 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
1506
370e30b6
RÁE
15072012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
1508
1509 * plugin.cc (Plugin::load): Handle position independent executables.
1510
fb1b895d
CC
15112012-06-06 Cary Coutant <ccoutant@google.com>
1512
1513 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
1514 add .debug_macro.
1515 (lines_only_debug_sections): Likewise.
1516 (gdb_fast_lookup_sections): New static array.
1517 (is_gdb_debug_section): Rename formal parameter.
1518 (is_lines_only_debug_section): Likewise.
1519 (is_gdb_fast_lookup_section): New function.
1520 (Layout::include_section): Check for ".zdebug_" prefix; pass
1521 section name suffix to is_gdb_debug_section, et al.; check for
1522 fast-lookup sections when building .gdb_index.
1523 * options.h (--strip-debug-gdb): Update GDB version number.
1524
7c0640fa
CC
15252012-06-06 Cary Coutant <ccoutant@google.com>
1526
1527 * configure.ac: Add check for fallocate.
1528 * configure: Regenerate.
1529 * config.in: Regenerate.
1530
1531 * options.h (class General_options): Add --mmap-output-file and
1532 --posix-fallocate options.
1533 * output.cc: (posix_fallocate): Remove; replace with...
1534 (gold_fallocate): New function.
1535 (Output_file::map_no_anonymous): Call gold_fallocate.
1536 (Output_file::map): Check --mmap-output-file option.
1537
2a49eb69
DK
15382012-06-05 Jing Yu <jingyu@google.com>
1539
1540 * gold.h (textdomain): Add do {} to empty while(0).
1541 (bindtextdomain): Likewise.
1542
fad072ac
CC
15432012-06-04 Cary Coutant <ccoutant@google.com>
1544
1545 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
1546 has_dynsym_index.
1547
8cc69fb6
ST
15482012-05-25 Sriraman Tallam <tmsriram@google.com>
1549
1550 * symtab.cc (Symbol_table::define_special_symbol):
1551 Initialize *poldsym to prevent uninitialized variable errors.
1552
1be75daa
CC
15532012-05-23 Cary Coutant <ccoutant@google.com>
1554
1555 * layout.cc (Layout::section_name_mapping): Add rules to handle
1556 exact match on .data.rel.ro.local or .data.rel.ro.
1557 (Layout::output_section_name): Check for exact matches.
1558
9b689de0
CC
15592012-05-23 Cary Coutant <ccoutant@google.com>
1560
1561 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
1562 more carefully.
1563
b24fdbf5
CC
15642012-05-22 Cary Coutant <ccoutant@google.com>
1565
1566 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
1567 object before exporting symbol.
1568
e550e1a2
L
15692012-05-21 H.J. Lu <hongjiu.lu@intel.com>
1570
1571 * testsuite/tls_test.cc: Include "config.h" first.
1572 * testsuite/tls_test_c.c: Likewise.
1573
df7b86aa
NC
15742012-05-17 Daniel Richard G. <skunk@iskunk.org>
1575 Nick Clifton <nickc@redhat.com>
1576
1577 PR 14072
1578 * configure.in: Add check that sysdep.h has been included before
1579 any system header files.
1580 * configure: Regenerate.
1581 * config.in: Regenerate.
1582
1007b503
CC
15832012-05-14 Cary Coutant <ccoutant@google.com>
1584
1585 * layout.cc (Layout::make_output_section): Mark .tdata section
1586 as RELRO.
1587 * testsuite/relro_test.cc: Add a TLS variable.
1588
fd885f3a
L
15892012-05-10 H.J. Lu <hongjiu.lu@intel.com>
1590
1591 PR gold/14091
1592 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
1593 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
1594 R_X86_64_64.
1595
80f5885c
CC
15962012-05-08 Cary Coutant <ccoutant@google.com>
1597
1598 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
1599 (lines_only_debug_sections): Likewise.
1600
2e702c99
RM
16012012-05-02 Roland McGrath <mcgrathr@google.com>
1602
1603 * nacl.cc: New file.
1604 * nacl.h: New file.
1605 * Makefile.am (CCFILES, HFILES): Add them.
1606 * Makefile.in: Regenerate.
1607 * i386.cc (Output_data_plt_i386_nacl): New class.
1608 (Output_data_plt_i386_nacl_exec): New class.
1609 (Output_data_plt_i386_nacl_dyn): New class.
1610 (Target_i386_nacl): New class.
1611 (Target_selector_i386_nacl): New class.
1612 (target_selector_i386): Use it instead of Target_selector_i386.
1613 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
1614 (Target_x86_64_nacl): New class.
1615 (Target_selector_x86_64_nacl): New class.
1616 (target_selector_x86_64, target_selector_x32): Use it instead of
1617 Target_selector_x86_64.
1618 * arm.cc (Output_data_plt_arm_nacl): New class.
1619 (Target_arm_nacl): New class.
1620 (Target_selector_arm_nacl): New class.
1621 (target_selector_arm, target_selector_armbe): Use it instead of
1622 Target_selector_arm.
1623
1624 * target-select.cc (select_target): Take new Input_file* and off_t
1625 arguments, pass them on to recognize method of selector.
1626 * object.cc (make_elf_sized_object): Update caller.
1627 * parameters.cc (parameters_force_valid_target): Likewise.
1628 * incremental.cc (make_sized_incremental_binary): Likewise.
1629 * target-select.h: Update decl.
1630 (Target_selector::recognize): Take new Input_file* argument,
1631 pass it on to do_recognize.
1632 (Target_selector::do_recognize): Take new Input_file* argument.
1633 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
1634 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
1635 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
1636 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
1637
1638 * target.h (Target::Target_info): New members isolate_execinstr
1639 and rosegment_gap.
1640 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
1641 * arm.cc (Target_arm::arm_info): Update initializer.
1642 * i386.cc (Target_i386::i386_info): Likewise.
1643 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
1644 * sparc.cc (Target_sparc::sparc_info): Likewise.
1645 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
1646 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1647 * layout.cc (Layout::attach_allocated_section_to_segment):
1648 Take new const Target* argument. If target->isolate_execinstr(), act
1649 like --rosegment.
1650 (Layout::find_first_load_seg): Take new const Target* argument;
1651 if target->isolate_execinstr(), reject PF_X segments.
1652 (Layout::relaxation_loop_body): Update caller.
1653 (Layout::set_segment_offsets): If target->isolate_execinstr(),
1654 reset file offset to zero when we hit LOAD_SEG, and then do a second
1655 loop over the segments before LOAD_SEG to reassign offsets after
1656 addresses have been determined. Handle target->rosegment_gap().
1657 (Layout::attach_section_to_segment): Take new const Target* argument;
1658 pass it to attach_allocated_section_to_segment.
1659 (Layout::make_output_section): Update caller.
1660 (Layout::attach_sections_to_segments): Take new const Target* argument;
1661 pass it to attach_section_to_segment.
1662 * gold.cc (queue_middle_tasks): Update caller.
1663 * layout.h (Layout): Update method decls with new arguments.
1664
1665 * arm.cc (Target_arm::Target_arm): Take optional argument for the
1666 Target_info pointer to use.
1667 (Target_arm::do_make_data_plt): New virtual method.
1668 (Target_arm::make_data_plt): New method that calls it.
1669 (Target_arm::make_plt_entry): Use it.
1670 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
1671 for the section alignment.
1672 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
1673 method.
1674 (Output_data_plt_arm::first_plt_entry_offset): Call it.
1675 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
1676 method.
1677 (Output_data_plt_arm::get_plt_entry_size): Call it.
1678 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
1679 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
1680 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
1681 method.
1682 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
1683 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
1684 method instead of sizeof(plt_entry).
1685 (Output_data_plt_arm::add_entry): Likewise.
1686 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
1687 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
1688 than static method.
1689 (Target_arm::plt_entry_size): Likewise.
1690 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
1691 Move to ...
1692 (Output_data_plt_arm_standard): ... here, new class.
1693 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
1694 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
1695 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
1696
1697 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
1698 Take additional argument for the PLT entry size.
1699 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
1700 Use get_plt_entry_size method rather than plt_entry_size variable.
1701 (Output_data_plt_x86_64::reserve_slot): Likewise.
1702 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
1703 (Output_data_plt_x86_64::add_entry): Likewise.
1704 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
1705 (Output_data_plt_x86_64::address_for_global): Likewise.
1706 (Output_data_plt_x86_64::address_for_local): Likewise.
1707 (Output_data_plt_x86_64::set_final_data_size): Likewise.
1708 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
1709 Make method non-static.
1710 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
1711 method.
1712 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
1713 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
1714 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
1715 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
1716 virtual method.
1717 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
1718 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
1719 virtual method.
1720 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
1721 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
1722 virtual method.
1723 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
1724 (Output_data_plt_x86_64::plt_entry_size)
1725 (Output_data_plt_x86_64::first_plt_entry)
1726 (Output_data_plt_x86_64::plt_entry)
1727 (Output_data_plt_x86_64::tlsdesc_plt_entry)
1728 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
1729 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
1730 (Output_data_plt_x86_64_standard): ... here, new class.
1731 (Target_x86_64::Target_x86_64): Take optional argument for the
1732 Target_info pointer to use.
1733 (Target_x86_64::do_make_data_plt): New virtual method.
1734 (Target_x86_64::make_data_plt): New method to call it.
1735 (Target_x86_64::init_got_plt_for_update): Use that.
1736 Call this->plt_->add_eh_frame method here.
1737 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
1738 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
1739 rather than static method.
1740 (Target_x86_64::plt_entry_size): Likewise.
1741 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
1742 rather than plt_entry_size variable. Move guts of PLT filling to...
1743 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
1744 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
1745 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
1746
1747 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
1748 additional argument for the section alignment.
1749 Don't do add_eh_frame_for_plt here.
1750 (Output_data_plt_i386::first_plt_entry_offset): Make the method
1751 non-static. Use get_plt_entry_size method rather than plt_entry_size
1752 variable.
1753 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
1754 method.
1755 (Output_data_plt_i386::get_plt_entry_size): Call it.
1756 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
1757 (Output_data_plt_i386::add_eh_frame): New method to call it.
1758 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
1759 method.
1760 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
1761 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
1762 method.
1763 (Output_data_plt_i386::fill_plt_entry): New method to call it.
1764 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
1765 method instead of plt_entry_size.
1766 (Output_data_plt_i386::plt_entry_size)
1767 (Output_data_plt_i386::plt_eh_frame_fde_size)
1768 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
1769 (Output_data_plt_i386_standard): ... here, new class.
1770 (Output_data_plt_i386_exec): New class.
1771 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
1772 (Output_data_plt_i386_exec::first_plt_entry): ... here.
1773 (Output_data_plt_i386::exec_plt_entry): Move to ...
1774 (Output_data_plt_i386_exec::plt_entry): ... here.
1775 (Output_data_plt_i386_dyn): New class.
1776 (Output_data_plt_i386::first_plt_entry): Move to ...
1777 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
1778 (Output_data_plt_i386::dyn_plt_entry): Move to ...
1779 (Output_data_plt_i386_dyn::plt_entry): ... here.
1780 (Target_i386::Target_i386): Take optional argument for the Target_info
1781 pointer to use.
1782 (Target_i386::do_make_data_plt): New virtual method.
1783 (Target_i386::make_data_plt): New method to call it.
1784 (Target_i386::make_plt_section): Use that.
1785 Call this->plt_->add_eh_frame method here.
1786 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
1787 rather than plt_entry_size variable.
1788 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
1789 (Output_data_plt_i386::address_for_local): Likewise.
1790 (Output_data_plt_i386::do_write): Likewise.
1791 Move guts of PLT filling to...
1792 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
1793 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
1794 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
1795 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
1796
b9b9f2ee
CC
17972012-05-01 Cary Coutant <ccoutant@google.com>
1798
1799 * dwarf_reader.cc (Dwarf_die::read_attributes)
1800 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
1801 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
1802 * reduced_debug_output.cc
1803 (Output_reduced_debug_info_section::get_die_end): Remove
1804 DW_FORM_GNU_ref_index. Add default case.
1805
57923f48
MW
18062012-04-26 Mark Wielaard <mjw@redhat.com>
1807
1808 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
1809 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
1810 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
1811 DW_AT_high_pc as offset from DW_AT_low_pc.
1812
1813 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
1814 * testsuite/Makefile.in: Regenerate.
1815 * testsuite/gdb_index_test_3.c: New test source file.
1816 * testsuite/gdb_index_test_3.sh: New test source file.
1817
2c54b4f4
ILT
18182012-04-25 Ian Lance Taylor <iant@google.com>
1819
1820 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
1821 pointer.
1822 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
1823 as a class, not a struct.
1824 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
1825 (Target_arm::apply_cortex_a8_workaround): Likewise.
1826 * gc.h: Declare Reloc_types as a struct, not a class.
1827 * object.h: Declare Symbols_data as a struct.
1828 * reloc.h: Declare Read_relocs_data as a struct.
1829 * target.h: Declare Relocate_info as a struct.
1830
a5a5f7a3
DM
18312012-04-24 David S. Miller <davem@davemloft.net>
1832
1833 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
1834 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
1835 and R_SPARC_WPLT30.
1836
f038d496
CC
18372012-04-24 Cary Coutant <ccoutant@google.com>
1838
1839 * incremental-dump.cc (find_input_containing_global): Replace
1840 magic number with symbolic constant.
1841 (dump_incremental_inputs): Update version number.
1842 * incremental.cc (Output_section_incremental_inputs): Update version
1843 number; import symbolic constants from Incremental_inputs_reader.
1844 (Incremental_inputs::create_data_sections): Align relocations
1845 section correctly for 64-bit targets.
1846 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
1847 constants; add padding.
1848 (Output_section_incremental_inputs::write_header): Add assert for
1849 header_size.
1850 (Output_section_incremental_inputs::write_input_files): Add assert
1851 for input_entry_size.
1852 (Output_section_incremental_inputs::write_info_blocks): Add padding;
1853 add assert for object_info_size, input_section_entry_size,
1854 global_sym_entry_size.
1855 * incremental.h (Incremental_inputs_reader): Add symbolic constants
1856 for data structure sizes; use them.
1857 (Incremental_input_entry_reader): Import symbolic constants from
1858 Incremental_inputs_reader; use them.
1859
a4d85145
DM
18602012-04-23 David S. Miller <davem@davemloft.net>
1861
1862 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
1863 and elf_flags_set_.
1864 (Target_sparc::Target_sparc): Initialize new fields.
1865 (Target_sparc::do_make_elf_object): New function.
1866 (Target_sparc::do_adjust_elf_header): New function.
1867
1d509098
CC
18682012-04-23 Cary Coutant <ccoutant@google.com>
1869
1870 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
1871 CU range table of gdb index.
1872
7ebeff7f
DM
18732012-04-20 David S. Miller <davem@davemloft.net>
1874
1875 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
1876 instead of false.
1877
13cf9988
DM
18782012-04-16 David S. Miller <davem@davemloft.net>
1879
2a1079e8
DM
1880 * sparc.cc (Target_sparc::got_address): New function.
1881 (Sparc_relocate_functions::gdop_hix22): New function.
1882 (Sparc_relocate_functions::gdop_lox10): New function.
1883 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
1884 relocs.
1885 (Target_sparc::Scan::local): Likewise if the global symbol is not
1886 preemptible and is not IFUNC.
1887 (Target_sparc::Relocate::relocate): Perform GOTDATA code
1888 transformations for local and non-preemptible non-IFUNC global
1889 symbols.
1890
0bc964fc
DM
1891 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
1892 writing out 64-bit part of ranges.
1893
661d7a80
DM
1894 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
1895 -fpic and -fpie respectively.
1896 * Makefile.in: Regenerate.
1897
8c2bf391
DM
1898 * sparc.cc (class Target_sparc): Add rela_ifunc_.
1899 (Target_sparc::Target_sparc): Initialize new field.
1900 (Target_sparc::do_plt_section_for_global): New function.
1901 (Target_sparc::do_plt_section_for_local): New function.
1902 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
1903 (Target_sparc::make_plt_section): New function, broken out of
1904 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
1905 (Target_sparc::make_plt_entry): Call make_plt_section.
1906 (Target_sparc::make_local_ifunc_plt_entry): New function.
1907 (Target_sparc::rela_ifunc_section): New function.
1908 (Target_sparc::plt_section): Remove const.
1909 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
1910 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
1911 and ifunc_count_ fields.
1912 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
1913 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
1914 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
1915 (Output_data_plt_sparc::rela_ifunc): New function.
1916 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
1917 (Output_data_plt_sparc::has_ifunc_section): New function.
1918 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
1919 (Output_data_plt_sparc::address_for_global): New function.
1920 (Output_data_plt_sparc::address_for_local): New function.
1921 (Output_data_plt_sparc::plt_index_to_offset): New function.
1922 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
1923 and entry_count.
1924 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
1925 entry_count.
1926 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
1927 R_SPARC_JMP_IREL to switch.
1928 (Target_sparc::Scan::check_non_pic): Likewise.
1929 (Target_sparc::Scan::local): Handle IFUNC symbols.
1930 (Target_sparc::Scan::local): Likewise.
1931 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
1932 and plt_address_for_local.
1933 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
1934 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
1935
13cf9988
DM
1936 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
1937 (class Output_data_reloc): Adjust calls to Output_reloc_type.
1938 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
1939 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
1940 global relocs too.
1941 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
1942 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
1943 calls.
1944 * sparc.cc (Target_sparc::Scan::global): Likewise.
1945 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
1946
31821be0
CC
19472012-04-16 Cary Coutant <ccoutant@google.com>
1948
1949 * archive.cc (Library_base::should_include_member): Check for
1950 --export-dynamic-symbol.
1951 * options.h (class General_options): Add --export-dynamic-symbol.
1952 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
1953 --export-dynamic-symbol.
1954 (Symbol_table::gc_mark_undef_symbols): Likewise.
1955 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
1956
2615994e
DM
19572012-04-12 David S. Miller <davem@davemloft.net>
1958
1959 * sparc.cc (Reloc::wdisp10): New relocation method.
1960 (Reloc::h34): Likewise.
1961 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
1962 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
1963 R_SPARC_WDISP10.
1964 (Target_sparc::Scan::local): Likewise.
1965 (Target_sparc::Scan::global): Likewise.
1966 (Target_sparc::Relocate::relocate): Likewise.
1967
6782735d
CC
19682012-04-09 Cary Coutant <ccoutant@google.com>
1969
1970 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
1971 low_pc == 0.
1972
8c7a0b00
ILT
19732012-04-06 Ian Lance Taylor <iant@google.com>
1974
1975 * timer.cc: #include <unistd.h>.
1976
58797674
RM
19772012-04-06 Roland McGrath <mcgrathr@google.com>
1978
1979 * configure.in (AC_CHECK_HEADERS): Add locale.h.
1980 * config.in: Regenerate.
1981 * configure: Regenerate.
1982
44350750
NC
19832012-04-05 Nick Clifton <nickc@redhat.com>
1984
1985 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
1986 (AM_LC_MESSAGES): Add.
1987 * aclocal.m4: Regenerate.
1988 * config.in: Regenerate.
1989 * configure: Regenerate.
1990
c1027032
CC
19912012-03-21 Cary Coutant <ccoutant@google.com>
1992
1993 * Makefile.am: Add gdb-index.cc, gdb-index.h.
1994 * Makefile.in: Regenerate.
1995 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
1996 (Sized_elf_reloc_mapper::symbol_section): New function.
1997 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
1998 (make_elf_reloc_mapper): New function.
1999 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
2000 (Dwarf_abbrev_table::do_read_abbrevs): New function.
2001 (Dwarf_abbrev_table::do_get_abbrev): New function.
2002 (Dwarf_ranges_table::read_ranges_table): New function.
2003 (Dwarf_ranges_table::read_range_list): New function.
2004 (Dwarf_pubnames_table::read_section): New function.
2005 (Dwarf_pubnames_table::read_header): New function.
2006 (Dwarf_pubnames_table::next_name): New function.
2007 (Dwarf_die::Dwarf_die): New function.
2008 (Dwarf_die::read_attributes): New function.
2009 (Dwarf_die::skip_attributes): New function.
2010 (Dwarf_die::set_name): New function.
2011 (Dwarf_die::set_linkage_name): New function.
2012 (Dwarf_die::attribute): New function.
2013 (Dwarf_die::string_attribute): New function.
2014 (Dwarf_die::int_attribute): New function.
2015 (Dwarf_die::uint_attribute): New function.
2016 (Dwarf_die::ref_attribute): New function.
2017 (Dwarf_die::child_offset): New function.
2018 (Dwarf_die::sibling_offset): New function.
2019 (Dwarf_info_reader::check_buffer): New function.
2020 (Dwarf_info_reader::parse): New function.
2021 (Dwarf_info_reader::do_parse): New function.
2022 (Dwarf_info_reader::do_read_string_table): New function.
2023 (Dwarf_info_reader::lookup_reloc): New function.
2024 (Dwarf_info_reader::get_string): New function.
2025 (Dwarf_info_reader::visit_compilation_unit): New function.
2026 (Dwarf_info_reader::visit_type_unit): New function.
2027 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
2028 Sized_elf_reloc_mapper.
2029 (Sized_dwarf_line_info::symbol_section): Remove function.
2030 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
2031 (Sized_dwarf_line_info::read_line_mappings): Remove object
2032 parameter, adjust callers.
2033 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
2034 * dwarf_reader.h: Include <sys/types.h>.
2035 (class Track_relocs): Remove forward declaration.
2036 (class Elf_reloc_mapper): New class.
2037 (class Sized_elf_reloc_mapper): New class.
2038 (class Dwarf_abbrev_table): New class.
2039 (class Dwarf_range_list): New class.
2040 (class Dwarf_ranges_table): New class.
2041 (class Dwarf_pubnames_table): New class.
2042 (class Dwarf_die): New class.
2043 (class Dwarf_info_reader): New class.
2044 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
2045 (Sized_dwarf_line_info::symbol_section): Remove member function.
2046 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
2047 base class.
2048 * gdb-index.cc: New source file.
2049 * gdb-index.h: New source file.
2050 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
2051 and .debug_types sections, call Layout::add_to_gdb_index.
2052 (Sized_relobj_incr::do_section_name): Implement.
2053 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
2054 return type; Implement.
2055 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
2056 return type.
2057 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
2058 parameter list and return type.
2059 (Sized_incr_dynobj::do_section_contents): Likewise.
2060 * layout.cc: Include gdb-index.h.
2061 (Layout::Layout): Initialize gdb_index_data_.
2062 (Layout::init_fixed_output_section): Check for .gdb_index section.
2063 (Layout::add_to_gdb_index): New function. Instantiate.
2064 * layout.h: Add forward declaration for class Gdb_index.
2065 (Layout::add_to_gdb_index): New member function.
2066 (Layout::gdb_index_data_): New data member.
2067 * main.cc: Include gdb-index.h.
2068 (main): Print statistics for gdb index.
2069 * object.cc (Object::section_contents): Move code into
2070 do_section_contents.
2071 (need_decompressed_section): Check for sections needed when building
2072 gdb index.
2073 (build_compressed_section_map): Likewise.
2074 (Sized_relobj_file::do_read_symbols): Need local symbols when building
2075 gdb index.
2076 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
2077 sections; call Layout::add_to_gdb_index.
2078 (Sized_relobj_file::do_decompressed_section_contents): Call
2079 do_section_contents directly.
2080 * object.h (Object::do_section_contents): Adjust parameter list and
2081 return type.
2082 (Object::do_decompressed_section_contents): Call do_section_contents
2083 directly.
2084 (Sized_relobj_file::do_section_contents): Adjust parameter list and
2085 return type.
2086 * options.h (class General_options): Add --gdb-index option.
2087 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
2088 list and return type.
2089 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
2090 * reloc.h (Track_relocs::checkpoint): New function.
2091 (Track_relocs::reset): New function.
2092
2093 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
2094 New test cases.
2095 * testsuite/Makefile.in: Regenerate.
2096 * testsuite/gdb_index_test.cc: New test source file.
2097 * testsuite/gdb_index_test_1.sh: New test source file.
2098 * testsuite/gdb_index_test_2.sh: New test source file.
2099
647f1574
DK
21002012-03-19 Doug Kwan <dougkwan@google.com>
2101
2102 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 2103 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
2104 __exidx_start and __exidx_end. Make symbol table parameter
2105 anonymous as it is not used.
2106 * gold.cc (queue_middle_tasks): Call target hook to define any
2107 target-specific symbols.
2108 * target.h (Target::define_standard_symbols): New method.
2109 (Target::do_define_standard_symbols): Same.
2110 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
2111 * testsuite/Makefile.in: Regenerate.
2112 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
2113 and __exidx_end.
2114 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
2115 relocations are generated for __exidx_start and __exidx_end.
2116
7c6109da
DK
21172012-03-16 Doug Kwan <dougkwan@google.com>
2118
2119 * testsuite/Makefile.am: Disable test initpri3b.
2120 * testsuite/Makefile.in: Regenerate.
2121
7b8957f8
DK
21222012-03-15 Doug Kwan <dougkwan@google.com>
2123
2124 * arm.cc (Target_arm::got_section): Make .got section read-only
2125 if -z now is given.
2126
14dc9ef7
ILT
21272012-03-15 Ian Lance Taylor <iant@google.com>
2128
2129 PR gold/13850
2130 * layout.cc (Layout::make_output_section): Correctly mark
2131 SHT_INIT_ARRAY, et. al., as relro.
2132
fa40b62a
DK
21332012-03-14 Doug Kwan <dougkwan@google.com>
2134
2135 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
2136 dynamic relocations for protected symbols in shared objects.
2137
fd325007
ILT
21382012-03-13 Ian Lance Taylor <iant@google.com>
2139
2140 * resolve.cc (Symbol_table::resolve): When merging common symbols,
2141 keep the larger alignment.
2142
e8dd54e1
CC
21432012-03-12 Cary Coutant <ccoutant@google.com>
2144
2145 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
2146 handling of DW_LNE_define_file.
2147
feb5f3b0
CC
21482012-03-12 Cary Coutant <ccoutant@google.com>
2149
2150 * reduced_debug_output.cc
2151 (Output_reduced_debug_info_section::get_die_end): Add new FORM
2152 codes to switch.
2153
a1fb4256
CC
21542012-02-29 Cary Coutant <ccoutant@google.com>
2155
2156 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
2157
5dd8762a
CC
21582012-02-29 Cary Coutant <ccoutant@google.com>
2159
2160 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
2161 Call Object::decompressed_section_contents.
2162 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
2163 New dtor.
2164 (Sized_dwarf_line_info::buffer_start_): New data member.
2165 * merge.cc (Output_merge_data::do_add_input_section): Call
2166 Object::decompressed_section_contents.
2167 (Output_merge_string::do_add_input_section): Likewise.
2168 * object.cc (need_decompressed_section): New function.
2169 (build_compressed_section_map): Decompress sections needed later.
2170 (Sized_relobj_file::do_decompressed_section_contents): New function.
2171 (Sized_relobj_file::do_discard_decompressed_sections): New function.
2172 * object.h (Object::decompressed_section_contents): New function.
2173 (Object::discard_decompressed_sections): New function.
2174 (Object::do_decompressed_section_contents): New function.
2175 (Object::do_discard_decompressed_sections): New function.
2176 (Compressed_section_info): New type.
2177 (Compressed_section_map): Include decompressed section contents.
2178 (Sized_relobj_file::do_decompressed_section_contents): New function.
2179 (Sized_relobj_file::do_discard_decompressed_sections): New function.
2180
7b5de7ee
CC
21812012-02-16 Cary Coutant <ccoutant@google.com>
2182
2183 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
2184 * testsuite/Makefile.in: Regenerate.
2185
f9fa4a63
CC
21862012-02-14 Cary Coutant <ccoutant@google.com>
2187
2188 * options.cc (General_options::finalize): Disallow -pie and -static.
2189
2c175ebc
DK
21902012-02-03 Doug Kwan <dougkwan@google.com>
2191
2192 * arm.cc (Arm_relocate_functions::abs8,
2193 Arm_relocate_functions::abs16): Use
2194 Bits::has_signed_unsigned_overflow32.
2195 (Arm_relocate_functions::thm_abs8): Correct range of
2196 overflow check.
2197 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
2198 in assertions.
2199
90cff06f
DK
22002012-02-02 Doug Kwan <dougkwan@google.com>
2201
2202 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
2203 position independent outputs, not just shared objects.
2204
63887f3d
L
22052012-01-30 H.J. Lu <hongjiu.lu@intel.com>
2206
2207 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
2208 * configure: Regenerated.
2209
bef2b434
ILT
22102012-01-27 Ian Lance Taylor <iant@google.com>
2211
2212 * reloc.h (Bits): New class with static functions, copied from
2213 namespace utils in arm.cc.
2214 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
2215 instead.
2216
c335b55d
L
22172012-01-27 H.J. Lu <hongjiu.lu@intel.com>
2218
2219 * incremental.cc (write_info_blocks): Correct relocation offset.
2220
41194d9f
L
22212012-01-27 H.J. Lu <hongjiu.lu@intel.com>
2222
2223 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
2224 (Relocate::tls_gd_to_le): Likewise.
2225
1bae613c
L
22262012-01-27 H.J. Lu <hongjiu.lu@intel.com>
2227
2228 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
2229
24482ca0
L
22302012-01-27 H.J. Lu <hongjiu.lu@intel.com>
2231
2232 * configure.ac: Check if -mcmodel=medium works.
2233 * configure: Regenerated.
2234
c2c7840a
CC
22352012-01-24 Cary Coutant <ccoutant@google.com>
2236
2237 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
2238 definition and ...
2239 (read_unsigned_LEB_128_x): ... this new function.
2240 (read_signed_LEB_128): Replaced with inline definition and ...
2241 (read_signed_LEB_128_x): ... this new function.
2242 * int_encoding.h (read_unsigned_LEB_128_x): New function.
2243 (read_unsigned_LEB_128): Add inline definition.
2244 (read_signed_LEB_128_x): New function.
2245 (read_signed_LEB_128): Add inline definition.
2246 * testsuite/Makefile.am (leb128_unittest): New unit test.
2247 * testsuite/Makefile.in: Regenerate.
2248 * testsuite/leb128_unittest.cc: New unit test.
2249
833de760 22502012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
2251
2252 PR gold/13617
2253 * i386.cc (Target_i386::do_code_fill): When using a jmp
2254 instruction, pad with nop instructions.
2255 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
2256
618d6666
L
22572012-01-22 H.J. Lu <hongjiu.lu@intel.com>
2258
2259 * x86_64.cc (gc_process_relocs): Add typename on types used in
2260 template.
2261 (scan_relocs): Likewise.
2262 (relocate_section): Likewise.
2263 (apply_relocation): Likewise.
2264
3660ff06
L
22652012-01-10 H.J. Lu <hongjiu.lu@intel.com>
2266
2267 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
2268 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
2269 under x32.
2270
fc51264f
L
22712012-01-09 H.J. Lu <hongjiu.lu@intel.com>
2272
2273 * x86_64.cc: Initial support for x32.
2274
dd74ae06
CC
22752012-01-03 Cary Coutant <ccoutant@google.com>
2276
2277 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
2278 Use abstract base class for GOT.
2279 * gold/output.h (class Output_data_got_base): New abstract base class.
2280 (class Output_data_got): Derive from new base class, adjust ctors.
2281 (Output_data_got::reserve_slot): Make virtual; rename to
2282 do_reserve_slot; Adjust callers.
2283 * gold/target.h (Sized_target::init_got_plt_for_update): Return
2284 pointer to abstract base class.
2285 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
2286
83896202
ILT
22872011-12-18 Ian Lance Taylor <iant@google.com>
2288
2289 * object.h (Relobj::local_symbol_value): New function.
2290 (Relobj::local_plt_offset): New function.
2291 (Relobj::local_has_got_offset): New function.
2292 (Relobj::local_got_offset): New function.
2293 (Relobj::set_local_got_offset): New function.
2294 (Relobj::do_local_symbol_value): New pure virtual function.
2295 (Relobj::do_local_plt_offset): Likewise.
2296 (Relobj::do_local_has_got_offset): Likewise.
2297 (Relobj::do_local_got_offset): Likewise.
2298 (Relobj::do_set_local_got_offset): Likewise.
2299 (Sized_relobj::do_local_has_got_offset): Rename from
2300 local_has_got_offset.
2301 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
2302 (Sized_relobj::do_set_local_got_offset): Rename from
2303 set_local_got_offset.
2304 (Sized_relobj_file::do_local_plt_offset): Rename from
2305 local_plt_offset.
2306 (Sized_relobj_file::do_local_symbol_value): New function.
2307 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
2308 local_plt_offset.
2309 * output.cc (Output_data_got::Got_entry::write): Change object to
2310 Relobj. Use local_symbol_value.
2311 (Output_data_got::add_global_with_rel): Change rel_dyn to
2312 Output_data_reloc_generic*. Use add_global_generic.
2313 (Output_data_got::add_global_with_rela): Remove. Change all
2314 callers to use add_global_with_rel.
2315 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
2316 Output_data_reloc_generic*. Use add_global_generic.
2317 (Output_data_got::add_global_pair_with_rela): Remove. Change all
2318 callers to use add_global_pair_with_rel.
2319 (Output_data_got::add_local): Change object to Relobj*.
2320 (Output_data_got::add_local_plt): Likewise.
2321 (Output_data_got::add_local_with_rel): Change object to Relobj*,
2322 change rel_dyn to Output_data_reloc_generic*. Use
2323 add_local_generic.
2324 (Output_data_got::add_local_with_rela): Remove. Change all
2325 callers to use all_local_with_rel.
2326 (Output_data_got::add_local_pair_with_rel): Change object to
2327 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
2328 add_output_section_generic.
2329 (Output_data_got::add_local_pair_with_rela): Remove. Change all
2330 callers to use add_local_pair_with_rel.
2331 (Output_data_got::reserve_local): Change object to Relobj*.
2332 * output.h: (class Output_data_reloc_generic): Add pure virtual
2333 declarations for add_global_generic, add_local_generic,
2334 add_output_section_generic.
2335 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
2336 functions for Output_data_reloc_generic. Update declarations for
2337 changes listed in output.cc.
2338 (class Output_data_got): Change template parameter to got_size.
2339 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
2340 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
2341 function.
2342 (Sized_relobj_incr::do_local_plt_offset): New function.
2343 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
2344 add_global_generic.
2345
76677ad0
CC
23462011-12-17 Cary Coutant <ccoutant@google.com>
2347
2348 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
2349 * resolve.cc (Symbol_table::resolve): Likewise.
2350 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
2351 arrays.
2352 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
2353
8b8dd8d5
ILT
23542011-12-16 Ian Lance Taylor <iant@google.com>
2355
2356 * output.h (Output_data_reloc_generic::add): Only call
2357 add_dynamic_reloc if this is a dynamic reloc section.
2358
d55525b9
L
23592011-12-15 H.J. Lu <hongjiu.lu@intel.com>
2360
2361 PR gold/13505
2362 * target-reloc.h (apply_relocation): Replace <64, false> with
2363 <size, big_endian>.
2364
ff81c7c1
NC
23652011-11-25 Nick Clifton <nickc@redhat.com>
2366
2367 * po/it.po: New Italian translation.
2368
628f39be
SA
23692011-11-17 Sterling Augustine <saugustine@google.com>
2370
2371 * script.cc (script_include_directive): Implement.
2372 (read_script_file): New local variables name and search_path. Update
2373 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
2374 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
2375 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
2376
98ef3ea4
SA
23772011-11-11 Sterling Augustine <saugustine@google.com>
2378
2379 * yyscript.y (section_cmd): Add support for INCLUDE directive.
2380 (file_or_sections_cmd): Likewise.
2381
f4a8b6d7
DK
23822011-11-11 Doug Kwan <dougkwan@google.com>
2383
2384 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
2385 if --just-symbols is given.
2386
29ab395d
DK
23872011-11-10 Doug Kwan <dougkwan@google.com>
2388
2389 PR gold/13362
2390 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
2391 when processing data relocs.
2392 * reloc.h (Relocate_functions::rel_unaligned): New method.
2393 (Relocate_functions::pcrel_unaligned): Ditto.
2394 (Relocate_functions::rel32_unaligned): Ditto.
2395 (Relocate_functions::pcrel32_unaligned): Ditto.
2396
2c339f71
DK
23972011-11-09 Doug Kwan <dougkwan@google.com>
2398
2399 PR gold/13362
2400 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
2401 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
2402 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
2403 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
2404 (Relocate_functions::rel_unaligned): New.
2405 (Relocate_functions::rel32_unaligned): New.
2406 * target-reloc.h (relocate_for_relocatable): Add code to handle
2407 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
2408 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
2409 arm_unaligned_reloc_r): New targets.
2410 * testsuite/Makefile.in: Regenerate.
2411 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
2412 linking.
2413
3f3cddf1
ILT
24142011-11-02 Ian Lance Taylor <iant@google.com>
2415
2416 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
2417 NATIVE_LINKER.
2418 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
2419 * options.cc (General_options::finalize): Use library search path
2420 from configure script if specified. If not native and no sysroot,
2421 only search TOOLLIBDIR.
2422 * options.h (Search_directory::Search_directory): Change name to
2423 const std::string&.
2424 (General_options::add_to_library_path_with_sysroot): Change arg to
2425 const std::string&.
2426 * configure, Makefile.in, config.in: Rebuild.
2427
a8e2273b
ILT
24282011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
2429
2430 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
2431 we are working around the ARM1176 Erratum.
2432 * options.h (General_options::fix_arm1176): Add option.
2433 * testsuite/Makefile.am: Add testcases, and keep current ones
2434 working.
2435 * testsuite/Makefile.in: Regenerate.
2436 * testsuite/arm_fix_1176.s: New file.
2437 * testsuite/arm_fix_1176.sh: Likewise.
2438
cd6eab1c
ILT
24392011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
2440
2441 * arm.cc (Target_arm::Target_arm): Remove initialisation of
2442 may_use_blx_.
2443 (Target_arm::may_use_blx): Remove method.
2444 (Target_arm::set_may_use_blx): Likewise.
2445 (Target_arm::may_use_v4t_interworking): New method.
2446 (Target_arm::may_use_v5t_interworking): Likewise.
2447 (Target_arm::may_use_blx_): Remove member variable.
2448 (Arm_relocate_functions::arm_branch_common): Check for v5T
2449 interworking.
2450 (Arm_relocate_functions::thumb_branch_common): Likewise.
2451 (Reloc_stub::stub_type_for_reloc): Likewise.
2452 (Target_arm::do_finalize_sections): Correct interworking checks.
2453 * testsuite/Makefile.am: Add new tests.
2454 * testsuite/Makefile.in: Regenerate.
2455 * testsuite/arm_farcall_arm_arm.s: New test.
2456 * testsuite/arm_farcall_arm_arm.sh: Likewise.
2457 * testsuite/arm_farcall_arm_thumb.s: Likewise.
2458 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
2459 * testsuite/arm_farcall_thumb_arm.s: Likewise.
2460 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
2461 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
2462 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
2463
286adcf4
CC
24642011-10-31 Cary Coutant <ccoutant@google.com>
2465
2466 PR gold/13023
2467 * expression.cc (Expression::eval_with_dot): Add
2468 is_section_dot_assignment parameter.
2469 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
2470 absolute and assigning to dot within a section.
2471 * script-sections.cc
2472 (Output_section_element_assignment::set_section_addresses): Pass
2473 dot_section to set_if_absolute.
2474 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
2475 as is_section_dot_assignment flag to eval_with_dot.
2476 (Output_section_element_dot_assignment::set_section_addresses):
2477 Likewise.
2478 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
2479 parameter. Also set value if relative to dot_section; set the
2480 symbol's output_section.
2481 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
2482 parameter. Adjust all callers.
2483 (Expression::eval_maybe_dot): Likewise.
2484 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
2485 Adjust all callers.
2486 * testsuite/script_test_2.t: Test assignment of an absolute value
2487 to dot within an output section element.
2488
9634ed06
CC
24892011-10-31 Cary Coutant <ccoutant@google.com>
2490
2491 * options.h (class General_options): Add --[no-]gnu-unique options.
2492 * symtab.cc (Symbol_table::sized_write_globals): Convert
2493 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
2494
de4101c7
CC
24952011-10-31 Cary Coutant <ccoutant@google.com>
2496
2497 PR gold/13359
2498 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
2499 unnecessary assertion.
2500 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
2501
7257cc92
ST
25022011-10-31 Sriraman Tallam <tmsriram@google.com>
2503
2504 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
2505 gc_mark_symbol.
2506 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
2507 gc_mark_symbol.
2508 Change to just keep the section associated with symbol.
2509 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
2510 they are externally visible and --export-dynamic is turned on.
2511 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
2512
bfc34b3f
ILT
25132011-10-19 Ian Lance Taylor <iant@google.com>
2514
2515 PR gold/13163
2516 * script-sections.cc
2517 (Output_section_element_dot_assignment::needs_output_section): New
2518 function.
2519
ea0d8c47
ILT
25202011-10-19 Ian Lance Taylor <iant@google.com>
2521
2522 PR gold/13204
2523 * layout.cc (Layout::segment_precedes): Don't assert failure if a
2524 --section-start option was seen.
2525 * options.h (General_options::any_section_start): New function.
2526
abd242a9
DM
25272011-10-18 David S. Miller <davem@davemloft.net>
2528
2529 PR binutils/13301
2530 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
2531 member to track relocation locations that have moved during TLS
2532 reloc optimizations.
2533 (Target_sparc::Relocate::Relocate): Initialize to NULL.
2534 (Target_sparc::Relocate::relocate): Adjust view down by 4
2535 bytes if it matches reloc_adjust_addr_.
2536 (Target_sparc::Relocate::relocate_tls): Always move the
2537 __tls_get_addr call delay slot instruction forward 4 bytes when
2538 performing relaxation.
2539
bab9090f
CC
25402011-10-18 Cary Coutant <ccoutant@google.com>
2541
2542 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
2543 (Output_file::map_no_anonymous): Check for non-zero
2544 return code from posix_fallocate.
2545
f7c5b166
CC
25462011-10-17 Cary Coutant <ccoutant@google.com>
2547
2548 PR gold/13245
2549 * plugin.cc (is_visible_from_outside): Check for symbols
2550 referenced from dynamic objects.
2551 * resolve.cc (Symbol_table::resolve): Don't count references
2552 from dynamic objects as references from real ELF files.
2553 * testsuite/plugin_test_2.sh: Adjust expected result.
2554
b490c0bb
CC
25552011-10-17 Cary Coutant <ccoutant@google.com>
2556
2557 * gold.cc: Include timer.h.
2558 (queue_middle_tasks): Stamp time.
2559 (queue_final_tasks): Likewise.
2560 * main.cc (main): Store timer in parameters. Print timers
2561 for each pass.
2562 * parameters.cc (Parameters::Parameters): Initialize timer_.
2563 (Parameters::set_timer): New function.
2564 (set_parameters_timer): New function.
2565 * parameters.h (Parameters::set_timer): New function.
2566 (Parameters::timer): New function.
2567 (Parameters::timer_): New data member.
2568 (set_parameters_timer): New function.
2569 * timer.cc (Timer::stamp): New function.
2570 (Timer::get_pass_time): New function.
2571 * timer.h (Timer::stamp): New function.
2572 (Timer::get_pass_time): New function.
2573 (Timer::pass_times_): New data member.
2574
f475cf7b
CC
25752011-10-17 Cary Coutant <ccoutant@google.com>
2576
2577 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
2578 task for members of lib groups.
2579
cdd7e244
CC
25802011-10-17 Cary Coutant <ccoutant@google.com>
2581
2582 PR gold/13288
4f95c8b4 2583 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
2584 (File_read::make_view): Move bounds check (replace with assert)...
2585 (File_read::find_or_make_view): ... to here.
2586
dfb45471
CC
25872011-10-12 Cary Coutant <ccoutant@google.com>
2588
4f95c8b4 2589 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
2590 ::read returns less than requested size.
2591
53bbcc1b
CC
25922011-10-10 Cary Coutant <ccoutant@google.com>
2593
4f95c8b4 2594 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
2595 Initialize defined_count_.
2596 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
2597 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
2598 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
2599 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
2600 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 2601 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
2602 member.
2603 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 2604 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
2605 Return zeroes instead of internal error.
2606
397b129b
CC
26072011-10-10 Cary Coutant <ccoutant@google.com>
2608
2609 PR gold/13249
4f95c8b4 2610 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 2611 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 2612 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
2613 (Output_reloc::type_): Adjust size of bit field.
2614 (Output_reloc::use_plt_offset_): New bit field.
2615 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
2616 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
2617 flag. Adjust all callers.
4f95c8b4 2618 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
2619 creating RELATIVE relocations.
2620
d5698657
NC
26212011-10-10 Nick Clifton <nickc@redhat.com>
2622
2623 * po/es.po: Updated Spanish translation.
2624 * po/fi.po: Updated Finnish translation.
2625
6a59a5c2
DN
26262011-10-03 Diego Novillo <dnovillo@google.com>
2627
2628 * options.cc (parse_uint): Fix dereference of RETVAL.
2629
f0558624
ST
26302011-09-29 Sriraman Tallam <tmsriram@google.com>
2631
2632 * layout.h (section_order_map_): New member.
2633 (get_section_order_map): New member function.
2634 * output.cc (Output_section::add_input_section): Check for patterns
2635 only when --section-ordering-file is specified.
2636 * gold.cc (queue_middle_tasks): Delay updating order of sections till
2637 output_sections have been formed.
2638 * layout.cc (Layout_Layout): Initialize section_order_map_.
2639 * plugin.cc (update_section_order): Store order in order_map. Do not
2640 update the order.
2641 * testsuite/Makefile.am: Add test case for plugin_final_layout.
2642 * testsuite/Makefile.in: Regenerate.
2643 * testsuite/plugin_section_order.c: New file.
2644 * testsuite/plugin_final_layout.cc: New file.
2645 * testsuite/plugin_final_layout.sh: New file.
2646
a7dac153
CC
26472011-09-29 Cary Coutant <ccoutant@google.com>
2648
4f95c8b4 2649 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 2650 Check for NULL.
4f95c8b4 2651 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
2652 symbols during incremental update.
2653 (Symbol_table::add_from_dynobj): Likewise.
2654
eebd87a5
ILT
26552011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2656 Ian Lance Taylor <iant@google.com>
2657
2658 * symtab.cc (Symbol_table::define_special_symbol): Always
2659 canonicalize version string.
2660
403a3331
CC
26612011-09-26 Cary Coutant <ccoutant@google.com>
2662
4f95c8b4
CC
2663 * gold.cc (queue_initial_tasks): Move option checks ...
2664 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
2665 some options; make others fatal.
2666
235061c2
CC
26672011-09-26 Cary Coutant <ccoutant@google.com>
2668
2669 gcc PR lto/47247
2670 * plugin.cc (get_symbols_v2): New function.
2671 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
2672 (is_referenced_from_outside): New function.
2673 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
2674 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
2675 (get_symbols): Pass version parameter.
2676 (get_symbols_v2): New function.
2677 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
2678 parameter.
2679 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
2680 (onload): Add LDPT_GET_SYMBOLS_V2.
2681 (all_symbols_read_hook): Use get_symbols_v2; check for
2682 LDPR_PREVAILING_DEF_IRONLY_EXP.
2683 * testsuite/plugin_test_3.sh: Update expected results.
2684
dc87f620
ILT
26852011-09-23 Simon Baldwin <simonb@google.com>
2686
2687 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
2688 configuration options.
2689 * configure: Regenerate.
2690 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
2691 * Makefile.in: Regenerate.
2692 * testsuite/Makefile.in: Regenerate.
2693
a8279f82
ST
26942011-09-19 Sriraman Tallam <tmsriram@google.com>
2695
2696 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
2697
0c9350c8
CC
26982011-09-19 Cary Coutant <ccoutant@google.com>
2699
2700 * incremental.cc (can_incremental_update): Fix typo in comment.
2701 * incremental.h (can_incremental_update): Likewise.
2702
aa06ae28
CC
27032011-09-18 Cary Coutant <ccoutant@google.com>
2704
2705 * incremental.cc (can_incremental_update): New function.
2706 * incremental.h (can_incremental_update): New function.
2707 * layout.cc (Layout::init_fixed_output_section): Call it.
2708 (Layout::make_output_section): Don't allow patch space in .eh_frame.
2709 * object.cc (Sized_relobj_file::do_layout): Call
2710 can_incremental_update.
2711
ebb300b2
CC
27122011-09-13 Cary Coutant <ccoutant@google.com>
2713
2714 * configure.ac: Check for glibc support for gnu_indirect_function
2715 support with static linking, setting automake conditional
2716 IFUNC_STATIC.
2717 * Makefile.in: Regenerate.
2718 * configure: Regenerate.
2719
2720 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
2721 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
2722 for IFUNC_STATIC.
2723 * testsuite/Makefile.in: Regenerate.
2724
1206d0d5
CC
27252011-09-13 Cary Coutant <ccoutant@google.com>
2726
2727 * incremental.cc (Sized_relobj_incr::do_layout): Call
2728 report_comdat_group for kept comdat sections.
2729 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
2730 * testsuite/Makefile.in: Regenerate.
2731 * testsuite/incr_comdat_test_1.cc: New source file.
2732 * testsuite/incr_comdat_test_2_v1.cc: New source file.
2733 * testsuite/incr_comdat_test_2_v2.cc: New source file.
2734 * testsuite/incr_comdat_test_2_v3.cc: New source file.
2735
40b29874
ILT
27362011-09-13 Ian Lance Taylor <iant@google.com>
2737
2738 * object.cc (Sized_relobj_file::do_layout): Remove unused local
2739 variable external_symbols_offset.
2740
1b045aac
ILT
27412011-09-12 Ian Lance Taylor <iant@google.com>
2742
2743 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
2744 triggered if object has no symbols.
2745
24c6c55a
DM
27462011-09-09 David S. Miller <davem@davemloft.net>
2747
2748 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
2749 (Output_fill_debug_line::do_write): Likewise.
2750
66570254
CC
27512011-08-29 Cary Coutant <ccoutant@google.com>
2752
2753 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
2754 casts to match formatting specs.
2755 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
2756
8ea8cd50
CC
27572011-08-26 Cary Coutant <ccoutant@google.com>
2758
2759 * layout.cc (Free_list::allocate): Provide guarantee of minimum
2760 remaining hole size when allocating.
2761 (Layout::make_output_section): Set fill methods for debug sections.
2762 * layout.h (Free_list::Free_list_node): Move from private to
2763 public.
2764 (Free_list::set_min_hole_size): New function.
2765 (Free_list::begin, Free_list::end): New functions.
2766 (Free_list::min_hole_): New data member.
2767 * output.cc: Include dwarf.h.
2768 (Output_fill_debug_info::do_minimum_hole_size): New function.
2769 (Output_fill_debug_info::do_write): New function.
2770 (Output_fill_debug_line::do_minimum_hole_size): New function.
2771 (Output_fill_debug_line::do_write): New function.
2772 (Output_section::Output_section): Initialize new data member.
2773 (Output_section::set_final_data_size): Ensure patch space is larger
2774 than minimum hole size.
2775 (Output_section::do_write): Fill holes in debug sections.
2776 * output.h (Output_fill): New class.
2777 (Output_fill_debug_info): New class.
2778 (Output_fill_debug_line): New class.
2779 (Output_section::set_free_space_fill): New function.
2780 (Output_section::free_space_fill_): New data member.
2781 * testsuite/Makefile.am (incremental_test_3): Add
2782 --incremental-patch option.
2783 (incremental_test_4): Likewise.
2784 (incremental_test_5): Likewise.
2785 (incremental_test_6): Likewise.
2786 (incremental_copy_test): Likewise.
2787 (incremental_common_test_1): Likewise.
2788 * testsuite/Makefile.in: Regenerate.
2789
7cf80422
NC
27902011-08-26 Nick Clifton <nickc@redhat.com>
2791
2792 * po/es.po: Updated Spanish translation.
2793
c3f7b0e5
CC
27942011-08-01 Cary Coutant <ccoutant@google.com>
2795
2796 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
2797 * gold/testsuite/Makefile.in: Regenerate.
2798 * gold/testsuite/justsyms_exec.c: New source file.
2799 * gold/testsuite/justsyms_lib.c: New source file.
2800
9590bf25
CC
28012011-08-01 Cary Coutant <ccoutant@google.com>
2802
2803 * layout.cc (Layout::set_segment_offsets): Don't realign text
2804 segment if -Ttext was specified.
2805 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
2806 file type.
2807 * object.h (Sized_relobj_file::e_type): New function.
2808 (Sized_relobj_file::e_type_): New data member.
2809 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
2810 base address for ET_EXEC files.
2811 * target.cc (Target::do_make_elf_object_implementation): Allow
2812 ET_EXEC files with --just-symbols option.
2813
dcd8d12e
CC
28142011-07-28 Cary Coutant <ccoutant@google.com>
2815
2816 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
2817 Add thread_number parameter.
2818 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
2819 * workqueue-threads.cc
2820 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
2821 current thread if its thread number is greater than desired thread
2822 count.
2823 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
2824 Add thread_number parameter.
2825 (Workqueue::should_cancel_thread): Likewise.
2826 (Workqueue::find_runnable_or_wait): Pass thread_number to
2827 should_cancel_thread.
2828 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
2829 parameter.
2830
804eb480
ST
28312011-07-22 Sriraman Tallam <tmsriram@google.com>
2832
2833 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
2834 only after checking if it cannot be forced local.
2835 * symtab.h (is_externally_visible): Check if the symbol is not forced
2836 local.
2837
f1ddb600
ILT
28382011-07-15 Ian Lance Taylor <iant@google.com>
2839
2840 * options.h (class General_options): Add --print-output-format.
2841 Move -EL next to -EB, for better --help output.
2842 * target-select.cc: Include <cstdio>, "options.h", and
2843 "parameters.h".
2844 (Target_selector::do_target_bfd_name): New function.
2845 (print_output_format): New function.
2846 * target-select.h (class Target_selector): Update declarations.
2847 (Target_selector::target_bfd_name): New function.
2848 (print_output_format): Declare.
2849 * main.cc: Include "target-select.h".
2850 (main): Handle --print-output-format.
2851 * gold.cc: Include "target-select.h".
2852 (queue_initial_tasks): Handle --print-output-format when there are
2853 no input files.
2854 * parameters.cc (parameters_force_valid_target): Give a better
2855 error message if -EB/-EL does not match target.
2856 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
2857 function.
2858
7d172687
ILT
28592011-07-15 Ian Lance Taylor <iant@google.com>
2860
2861 * i386.cc (class Output_data_plt_i386): Add layout_ field.
2862 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
2863 (Output_data_plt_i386::do_write): Write address of .dynamic
2864 section to first entry in .got.plt section.
2865 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
2866 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
2867 Initialize layout_.
2868 (Output_data_plt_x86_64::do_write): Write address of .dynamic
2869 section to first entry in .got.plt section.
2870 * layout.h (Layout::dynamic_section): New function.
2871
e9552f7e
ST
28722011-07-13 Sriraman Tallam <tmsriram@google.com>
2873
2874 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
2875 to claim_file call.
2876 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
2877 input_section_position_, and input_section_glob_.
2878 (read_layout_from_file): Call function section_ordering_specified.
2879 * layout.h (is_section_ordering_specified): New function.
2880 (section_ordering_specified): New function.
2881 (section_ordering_specified_): New boolean member.
2882 * main.cc(main): Call load_plugins after layout object is defined.
2883 * output.cc (Output_section::add_input_section): Use
2884 function section_ordering_specified to check if section ordering is
2885 needed.
2886 * output.cc (Output_section::add_relaxed_input_section): Use
2887 function section_ordering_specified to check if section ordering is
2888 needed.
2889 (Output_section::update_section_layout): New function.
2890 (Output_section::sort_attached_input_sections): Check if input section
2891 must be reordered.
2892 * output.h (Output_section::update_section_layout): New function.
2893 * plugin.cc (get_section_count): New function.
2894 (get_section_type): New function.
2895 (get_section_name): New function.
2896 (get_section_contents): New function.
2897 (update_section_order): New function.
58797674 2898 (allow_section_ordering): New function.
e9552f7e
ST
2899 (Plugin::load): Add the new interfaces to the transfer vector.
2900 (Plugin_manager::load_plugins): New parameter.
2901 (Plugin_manager::all_symbols_read): New parameter.
2902 (Plugin_manager::claim_file): New parameter. Save the elf object for
2903 unclaimed objects.
2904 (Plugin_manager::get_elf_object): New function.
2905 (Plugin_manager::get_view): Change to directly use the bool to check
2906 if get_view is called from claim_file_hook.
2907 * plugin.h (input_objects): New function
2908 (Plugin__manager::load_plugins): New parameter.
2909 (Plugin_manager::claim_file): New parameter.
2910 (Plugin_manager::get_elf_object): New function.
2911 (Plugin_manager::in_claim_file_handler): New function.
2912 (Plugin_manager::in_claim_file_handler_): New member.
2913 (layout): New function.
2914 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
2915 handler with an extra parameter. Make the elf object before calling
2916 claim_file handler.
2917 * testsuite/plugin_test.c (get_section_count): New function pointer.
2918 (get_section_type): New function pointer.
2919 (get_section_name): New function pointer.
2920 (get_section_contents): New function pointer.
2921 (update_section_order): New function pointer.
2922 (allow_section_ordering): New function pointer.
2923 (onload): Check if the new interfaces exist.
2924
9446efde
ILT
29252011-07-13 Ian Lance Taylor <iant@google.com>
2926
2927 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
2928 relro section.
2929 * x86_64.cc (Target_x86_64::got_section): Likewise.
2930 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
2931 (relro_now_test_SOURCES): New variable.
2932 (relro_now_test_DEPENDENCIES): New variable.
2933 (relro_now_test_LDFLAGS): New variable.
2934 (relro_now_test_LDADD): New variable.
2935 (relro_now_test.so): New target.
2936 * testsuite/Makefile.in: Rebuild.
2937
07aa62f2
ILT
29382011-07-12 Ian Lance Taylor <iant@google.com>
2939
2940 PR gold/12980
2941 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
2942 GLOB_DAT relocation rather than a RELATIVE relocation for a
2943 protected symbol when creating a shared library.
2944 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
2945 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
2946 * testsuite/protected_main_1.cc (main): Test that protected
2947 function has same address.
2948
e2153196
ILT
29492011-07-11 Ian Lance Taylor <iant@google.com>
2950
2951 PR gold/12979
2952 * options.h (class General_options): Add -Bgroup.
2953 * options.cc (General_options::finalize): If -Bgroup is set,
2954 default to --unresolved-symbols=report-all.
2955 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
2956 * target-reloc.h (issue_undefined_symbol_error): Handle
2957 --unresolved-symbols=report-all.
2958
6daf5215
ILT
29592011-07-08 Ian Lance Taylor <iant@google.com>
2960
2961 PR gold/11985
2962 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
2963 if linker script discards key sections.
2964 (Layout::create_dynamic_symtab): Likewise.
2965 (Layout::assign_local_dynsym_offsets): Likewise.
2966 (Layout::sized_create_version_sections): Likewise.
2967 (Layout::create_interp): Likewise.
2968 (Layout::finish_dynamic_section): Likewise.
2969 (Layout::set_dynamic_symbol_size): Likewise.
2970
beabb2c6
ILT
29712011-07-08 Ian Lance Taylor <iant@google.com>
2972
2973 PR gold/12386
2974 * options.h (class General_options): Add --unresolved-symbols.
2975 * target-reloc.h (issue_undefined_symbol_error): Check
2976 --unresolved-symbols. Add comments.
2977
9c16daf1
ILT
29782011-07-08 Ian Lance Taylor <iant@google.com>
2979
2980 * testsuite/odr_violation2.cc (Ordering::operator()): Make
2981 expression more complex.
2982
191f1a2d
ILT
29832011-07-08 Ian Lance Taylor <iant@google.com>
2984
2985 PR gold/11317
2986 * target-reloc.h (issue_undefined_symbol_error): New inline
2987 function, broken out of relocate_section.
2988 (relocate_section): Call issue_undefined_symbol_error.
2989 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
2990 there is no TLS segment if we are about to issue an undefined
2991 symbol error.
2992 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
2993
62855347
ILT
29942011-07-08 Ian Lance Taylor <iant@google.com>
2995
2996 PR gold/12279
2997 * resolve.cc (Symbol_table::should_override): Add fromtype
2998 parameter. Change all callers. Give error when linking together
2999 TLS and non-TLS symbol.
3000 (Symbol_table::should_override_with_special): Add fromtype
3001 parameter. Change all callers.
3002 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
3003 there is no TLS segment if we have reported some errors.
3004 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
3005
67181c72
ILT
30062011-07-08 Ian Lance Taylor <iant@google.com>
3007
3008 PR gold/12372
3009 * target.h (Target::plt_address_for_global): New function.
3010 (Target::plt_address_for_local): New function.
3011 (Target::plt_section_for_global): Remove.
3012 (Target::plt_section_for_local): Remove.
3013 (Target::do_plt_address_for_global): New virtual function.
3014 (Target::do_plt_address_for_local): New virtual function.
3015 (Target::do_plt_section_for_global): Remove.
3016 (Target::do_plt_section_for_local): Remove.
3017 (Target::register_global_plt_entry): Add Symbol_table and Layout
3018 parameters.
3019 * output.cc (Output_data_got::Got_entry::write): Use
3020 plt_address_for_global and plt_address_for_local.
3021 * layout.cc (Layout::add_target_dynamic_tags): Use size and
3022 address of output section.
3023 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
3024 got_irelative_, and irelative_count_ fields. Update
3025 declarations.
3026 (Output_data_plt_i386::has_irelative_section): New function.
3027 (Output_data_plt_i386::entry_count): Add irelative_count_.
3028 (Output_data_plt_i386::set_final_data_size): Likewise.
3029 (class Target_i386): Add got_irelative_ and rel_irelative_
3030 fields. Update declarations.
3031 (Target_i386::Target_i386): Initialize new fields.
3032 (Target_i386::do_plt_address_for_global): New function replacing
3033 do_plt_section_for_global.
3034 (Target_i386::do_plt_address_for_local): New function replacing
3035 do_plt_section_for_local.
3036 (Target_i386::got_section): Create got_irelative_.
3037 (Target_i386::rel_irelative_section): New function.
3038 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
3039 fields. Don't define __rel_iplt_{start,end}.
3040 (Output_data_plt_i386::add_entry): Add symtab and layout
3041 parameters. Change all callers. Use different PLT and GOT for
3042 IFUNC symbols.
3043 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
3044 layout parameters. Change all callers. Use different PLT and
3045 GOT.
3046 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
3047 (Output_data_plt_i386::rel_irelative): New function.
3048 (Output_data_plt_i386::address_for_global): New function.
3049 (Output_data_plt_i386::address_for_local): New function.
3050 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
3051 IRELATIVE GOT when changing IFUNC GOT entries.
3052 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
3053 reloc.
3054 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
3055 if we didn't create an IRELATIVE GOT.
3056 (Target_i386::Relocate::relocate): Use plt_address_for_global and
3057 plt_address_for_local.
3058 (Target_i386::do_dynsym_value): Use plt_address_for_global.
3059 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
3060 got_irelative_, and irelative_count_ fields. Update
3061 declarations.
3062 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
3063 Initialize new fields. Remove symtab parameter. Change all
3064 callers.
3065 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
3066 irelative_count_.
3067 (Output_data_plt_x86_64::has_irelative_section): New function.
3068 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
3069 (class Target_x86_64): Add got_irelative_ and rel_irelative_
3070 fields. Update declarations.
3071 (Target_x86_64::Target_x86_64): Initialize new fields.
3072 (Target_x86_64::do_plt_address_for_global): New function replacing
3073 do_plt_section_for_global.
3074 (Target_x86_64::do_plt_address_for_local): New function replacing
3075 do_plt_section_for_local.
3076 (Target_x86_64::got_section): Create got_irelative_.
3077 (Target_x86_64::rela_irelative_section): New function.
3078 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
3079 all callers. Don't create __rel_iplt_{start,end}.
3080 (Output_data_plt_x86_64::add_entry): Add symtab and layout
3081 parameters. Change all callers. Use different PLT and GOT for
3082 IFUNC symbols.
3083 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
3084 layout parameters. Change all callers. Use different PLT and
3085 GOT.
3086 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
3087 parameters. Change all callers. Use different PLT and GOT for
3088 IFUNC symbols.
3089 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
3090 (Output_data_plt_x86_64::rela_irelative): New function.
3091 (Output_data_plt_x86_64::address_for_global): New function.
3092 (Output_data_plt_x86_64::address_for_local): New function.
3093 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3094 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
3095 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
3096 (Target_x86_64::register_global_plt_entry): Add symtab and layout
3097 parameters.
3098 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
3099 reloc.
3100 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
3101 symbols if we didn't create an IRELATIVE GOT.
3102 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
3103 plt_address_for_local.
3104 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
3105 * testsuite/ifuncvar1.c: New test file.
3106 * testsuite/ifuncvar2.c: New test file.
3107 * testsuite/ifuncvar3.c: New test file.
3108 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
3109 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
3110 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
3111 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
3112 * testsuite/Makefile.in: Rebuild.
3113
33c15b45
CC
31142011-07-07 Cary Coutant <ccoutant@google.com>
3115
3116 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
3117 (two_file_test_1_ndebug.o): Likewise.
3118 (two_file_test_1b_ndebug.o): Likewise.
3119 (two_file_test_2_ndebug.o): Likewise.
3120 (two_file_test_main_ndebug.o): Likewise.
3121 (incremental_test_2): Link with no-debug versions.
3122
f48b5fb7
CC
31232011-07-06 Cary Coutant <ccoutant@google.com>
3124
3125 * gold/incremental.cc
3126 (Output_section_incremental_inputs::write_info_blocks): Check for
3127 hidden and internal symbols.
3128
221597a5
CC
31292011-07-06 Cary Coutant <ccoutant@google.com>
3130
3131 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
3132 Check disposition for startup file.
3133 (Incremental_inputs::report_command_line): Ignore
3134 --incremental-startup-unchanged option.
3135 * options.cc (General_options::parse_incremental_startup_unchanged):
3136 New function.
3137 (General_options::General_options): Initialize new data member.
3138 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
3139 (General_options): Add --incremental-startup-unchanged option.
3140 (General_options::incremental_startup_disposition): New function.
3141 (General_options::incremental_startup_disposition_): New data member.
3142
e24719f6
CC
31432011-07-06 Cary Coutant <ccoutant@google.com>
3144
3145 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
3146 input file index to Script_info ctor.
3147 (Sized_incremental_binary::do_file_has_changed): Find the
3148 command-line argument for files named in scripts.
3149 * incremental.h (Script_info::Script_info): New ctor
3150 with input file index.
3151 (Script_info::input_file_index): New function.
3152 (Script_info::input_file_index_): New data member.
3153 (Incremental_binary::get_library): Add const.
3154 (Incremental_binary::get_script_info): Add const.
3155 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
3156 * testsuite/Makefile.am (incremental_test_5): New test case.
3157 (incremental_test_6): New test case.
3158 * testsuite/Makefile.in: Regenerate.
3159
8f7c81e8
CC
31602011-07-06 Cary Coutant <ccoutant@google.com>
3161
3162 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
3163 debug output when command lines differ.
3164
9fbd3822
CC
31652011-07-06 Cary Coutant <ccoutant@google.com>
3166
3167 * incremental.cc (Incremental_inputs::report_command_line): Ignore
3168 --incremental-patch option.
3169 * layout.cc (Free_list::allocate): Extend allocation beyond original
3170 end if enabled.
3171 (Layout::make_output_section): Mark sections that should get
3172 patch space.
3173 * options.cc (parse_percent): New function.
3174 * options.h (parse_percent): New function.
3175 (DEFINE_percent): New macro.
3176 (General_options): Add --incremental-patch option.
3177 * output.cc (Output_section::Output_section): Initialize new data
3178 members.
3179 (Output_section::add_input_section): Print section name when out
3180 of patch space.
3181 (Output_section::add_output_section_data): Likewise.
3182 (Output_section::set_final_data_size): Add patch space when
3183 doing --incremental-full.
3184 (Output_section::do_reset_address_and_file_offset): Remove patch
3185 space.
3186 (Output_segment::set_section_list_addresses): Print debug output
3187 only if --incremental-update.
3188 * output.h (Output_section::set_is_patch_space_allowed): New function.
3189 (Output_section::is_patch_space_allowed_): New data member.
3190 (Output_section::patch_space_): New data member.
3191 * parameters.cc (Parameters::incremental_full): New function.
3192 * parameters.h (Parameters::incremental_full): New function
3193 * testsuite/Makefile.am (incremental_test_2): Add test for
3194 --incremental-patch option.
3195 * testsuite/Makefile.in: Regenerate.
3196 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
3197 (t18): Remove function body.
3198
f6cccc2c
DK
31992011-07-05 Doug Kwan <dougkwan@google.com>
3200
3201 PR gold/12771
3202 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
3203 Arm_Address type for relocation result.
3204 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
3205 overflow check.
3206 (Arm_relocate_functions::abs32): Use unaligned access.
3207 (Arm_relocate_functions::rel32): Ditto.
3208 (Arm_relocate_functions::prel31): Ditto.
3209 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
3210 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
3211 static data relocations.
3212 * testsuite/Makefile.in: Regnerate.
3213 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
3214
28a13fec
ILT
32152011-07-05 Ian Lance Taylor <iant@google.com>
3216
3217 PR gold/12392
3218 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
3219 symbols if necessary.
3220 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
3221
24d47b34
ILT
32222011-07-05 Ian Lance Taylor <iant@google.com>
3223
3224 PR gold/12952
3225 * resolve.cc (Symbol::override_base_with_special): Simply override
3226 version with special symbol version, ignoring previous version.
3227
41f9cbbe
ILT
32282011-07-05 Ian Lance Taylor <iant@google.com>
3229
3230 * object.cc (Sized_relobj_file::include_section_group): Add
3231 information to comment about signature location.
3232
886288f1
ILT
32332011-07-02 Ian Lance Taylor <iant@google.com>
3234
3235 PR gold/12957
3236 * options.h (class General_options): Add -f and -F.
3237 * options.cc (General_options::finalize): Fatal error if -f/-F
3238 are used without -shared.
3239 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
3240
ae3a6d4f
ILT
32412011-07-02 Ian Lance Taylor <iant@google.com>
3242
3243 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
3244
21131061
ILT
32452011-07-01 Ian Lance Taylor <iant@google.com>
3246
3247 PR gold/12525
3248 PR gold/12952
3249 * resolve.cc (Symbol::override_base_with_special): Don't override
3250 the version if the overriding symbol has a different name.
3251 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
3252 all callers. If we give an error about an undefined version,
3253 define the base version if necessary.
3254 * dynobj.h (class Versions): Update declaration.
3255 * testsuite/weak_alias_test_5.cc: New file.
3256 * testsuite/weak_alias_test.script: New file.
3257 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
3258 and versioned_alias have the right value, and call t2.
3259 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
3260 weak_alias_test_5.so.
3261 (weak_alias_test_LDADD): Likewise.
3262 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
3263 * testsuite/Makefile.in: Rebuild.
3264
611062c0
ILT
32652011-07-01 Ian Lance Taylor <iant@google.com>
3266
3267 PR gold/12525
3268 * options.h (class General_options): Support -z notext.
3269 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
3270 -Wl,-z,notext.
3271 (two_file_shared_nonpic.so): Likewise.
3272 (two_file_shared_mixed.so): Likewise.
3273 (two_file_shared_mixed_1.so): Likewise.
3274 (weak_undef_lib_nonpic.so): Likewise.
3275 (alt/weak_undef_lib_nonpic.so): Likewise.
3276 (tls_test_shared_nonpic.so): Likewise.
3277 * testsuite/Makefile.in: Rebuild.
3278
328c7c2f
ILT
32792011-07-01 Ian Lance Taylor <iant@google.com>
3280
3281 PR gold/12525
3282 * configure.ac: Test whether static linking works, setting
3283 the automake conditional HAVE_STATIC.
3284 * testsuite/Makefile.am: Disable tests using -static if
3285 HAVE_STATIC is not true.
3286 * configure, testsuite/Makefile.in: Rebuild.
3287
02d7cd44
ILT
32882011-07-01 Ian Lance Taylor <iant@google.com>
3289
3290 PR gold/12525
3291 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
3292 Assert if we see DW_EH_PE_indirect.
3293 * target.h (Target::ehframe_datarel_base): New function.
3294 (Target::do_ehframe_datarel_base): New target function.
3295 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
3296 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
3297 function.
3298
07a60597
ILT
32992011-07-01 Ian Lance Taylor <iant@google.com>
3300
3301 PR gold/12571
3302 * options.h (class General_options): Add
3303 --ld-generated-unwind-info.
3304 * ehframe.cc (Fde::write): Add address parameter. Change all
3305 callers. If associated with PLT, fill in address and size.
3306 (Cie::set_output_offset): Only add merge mapping if there is an
3307 object.
3308 (Cie::write): Add address parameter. Change all callers.
3309 (Eh_frame::add_ehframe_for_plt): New function.
3310 * ehframe.h (class Fde): Update declarations. Move shndx_ and
3311 input_offset_ fields into union u_, with new plt field.
3312 (Fde::Fde): Adjust for new union field.
3313 (Fde::Fde) [Output_data version]: New constructor.
3314 (Fde::add_mapping): Only add merge mapping if there is an object.
3315 (class Cie): Update declarations.
3316 (class Eh_frame): Declare add_ehframe_for_plt.
3317 * layout.cc (Layout::layout_eh_frame): Break out code into
3318 make_eh_frame_section, and call it.
3319 (Layout::make_eh_frame_section): New function.
3320 (Layout::add_eh_frame_for_plt): New function.
3321 * layout.h (class Layout): Update declarations.
3322 * merge.cc (Merge_map::add_mapping): Add assertion.
3323 * i386.cc: Include "dwarf.h".
3324 (class Output_data_plt_i386): Make first_plt_entry,
3325 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
3326 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
3327 and plt_eh_frame_fde.
3328 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
3329 boundary. Call add_eh_frame_for_plt if appropriate.
3330 * x86_64.cc: Include "dwarf.h".
3331 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
3332 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
3333 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
3334 and plt_eh_frame_fde.
3335 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
3336 appropriate.
3337
14788a3f
ILT
33382011-06-29 Ian Lance Taylor <iant@google.com>
3339
3340 PR gold/12629
3341 * object.cc (Sized_relobj_file::layout_section): Change shdr
3342 parameter to be const.
3343 (Sized_relobj_file::layout_eh_frame_section): New function, broken
3344 out of do_layout.
3345 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
3346 appropriate. Call layout_eh_frame_section.
3347 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
3348 sections.
3349 * object.h (class Sized_relobj_file): Update declarations.
3350
6c21fce1
ILT
33512011-06-29 Ian Lance Taylor <iant@google.com>
3352
37e41b03 3353 PR gold/12652
6c21fce1
ILT
3354 * script.cc (Token::integer_value): Accept trailing M/m/K/k
3355 modifier.
3356 (Lex::gather_token): Accept trailing M/m/K/k for integers.
3357
4d5e4e62
ILT
33582011-06-29 Ian Lance Taylor <iant@google.com>
3359
3360 PR gold/12675
3361 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
3362 SHT_X86_64_UNWIND.
3363 * layout.cc (Layout::layout_eh_frame): Likewise.
3364
886f533a
ILT
33652011-06-29 Ian Lance Taylor <iant@google.com>
3366
3367 PR gold/12695
3368 * layout.cc (Layout::symtab_section_shndx): New function.
3369 * layout.h (class Layout): Declare symtab_section_shndx.
3370 * output.cc (Output_section::write_header): Call it.
3371
f3ae1b28
ILT
33722011-06-29 Ian Lance Taylor <iant@google.com>
3373
3374 PR gold/12818
3375 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
3376 symbols which are not used in a relocation.
3377
aecf301f
ILT
33782011-06-28 Ian Lance Taylor <iant@google.com>
3379
3380 PR gold/12898
3381 * layout.cc (Layout::segment_precedes): Don't crash if a linker
3382 script create indistinguishable segments.
3383 (Layout::set_segment_offsets): Use stable_sort when sorting
3384 segments. Pass this to Compare_segments constructor.
3385 * layout.h (class Layout): Make segment_precedes non-static.
3386 (class Compare_segments): Change from struct to class. Add
3387 layout_ field. Add constructor.
3388 * script-sections.cc
3389 (Script_sections::attach_sections_using_phdrs_clause): Rename
3390 local orphan to is_orphan. Don't report failure to put empty
3391 section in segment. On attachment failure, report name of
3392 section, and attach to first PT_LOAD segment.
3393
03ef7571
ILT
33942011-06-28 Ian Lance Taylor <iant@google.com>
3395
3396 PR gold/12934
3397 * target-select.cc (Target_selector::Target_selector): Add
3398 emulation parameter. Change all callers.
3399 (select_target_by_bfd_name): Rename from select_target_by_name.
3400 Change all callers.
3401 (select_target_by_emulation): New function.
3402 (supported_emulation_names): New function.
3403 * target-select.h (class Target_selector): Add emulation_ field.
3404 Update declarations.
3405 (Target_selector::recognize_by_bfd_name): Rename from
3406 recognize_by_name. Change all callers.
3407 (Target_selector::supported_bfd_names): Rename from
3408 supported_names. Change all callers.
3409 (Target_selector::recognize_by_emulation): New function.
3410 (Target_selector::supported_emulations): New function.
3411 (Target_selector::emulation): New function.
3412 (Target_selector::do_recognize_by_bfd_name): Rename from
3413 do_recognize_by_name. Change all callers.
3414 (Target_selector::do_supported_bfd_names): Rename from
3415 do_supported_names. Change all callers.
3416 (Target_selector::do_recognize_by_emulation): New function.
3417 (Target_selector::do_supported_emulations): New function.
3418 (select_target_by_bfd_name): Change name in declaration.
3419 (select_target_by_emulation): Declare.
3420 (supported_emulation_names): Declare.
3421 * parameters.cc (parameters_force_valid_target): Try to find
3422 target based on emulation from -m option.
3423 * options.h (class General_options): Change doc string for -m.
3424 * options.cc (help): Print emulations.
3425 (General_options::parse_V): Likewise.
3426 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
3427 Add emulation parameter. Change all callers.
3428
200b2bb9
ILT
34292011-06-28 Ian Lance Taylor <iant@google.com>
3430
3431 * target.h (class Target): Add osabi_ field.
3432 (Target::osabi): New function.
3433 (Target::set_osabi): New function.
3434 (Target::Target): Initialize osabi_.
3435 (Target::do_adjust_elf_header): Make pure virtual.
3436 (Sized_target::do_adjust_elf_header): Declare.
3437 * target.cc (Sized_target::do_adjust_elf_header): New function.
3438 (class Sized_target): Instantiate all versions.
3439 * freebsd.h (class Target_freebsd): Remove.
3440 (Target_selector_freebsd::do_recognize): Call set_osabi on
3441 Target.
3442 (Target_selector_freebsd::do_recognize_by_name): Likewise.
3443 (Target_selector_freebsd::set_osabi): Remove.
3444 * i386.cc (class Target_i386): Inherit from Sized_target rather
3445 than Target_freebsd.
3446 * x86_64.cc (class Target_x86_64): Likewise.
3447
b3ce541e
ILT
34482011-06-28 Ian Lance Taylor <iant@google.com>
3449
3450 * target.h (Target::can_check_for_function_pointers): Rewrite.
3451 Make non-virtual.
3452 (Target::can_icf_inline_merge_sections): Likewise.
3453 (Target::section_may_have_icf_unsafe_poineters): Likewise.
3454 (Target::Target_info): Add can_icf_inline_merge_sections field.
3455 (Target::do_can_check_for_function_pointers): New virtual
3456 function.
3457 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
3458 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
3459 from can_check_for_function_pointers, move in file.
3460 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
3461 section_may_have_icf_unsafe_poineters, move in file.
3462 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
3463 * i386.cc (Target_i386::do_can_check_for_function_pointers):
3464 Rename from can_check_for_function_pointers, move in file.
3465 (Target_i386::can_icf_inline_merge_sections): Remove.
3466 (Target_i386::i386_info): Initialize
3467 can_icf_inline_merge_sections.
3468 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
3469 Initialize can_icf_inline_merge_sections.
3470 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
3471 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
3472 Rename from can_check_for_function_pointers, move in file.
3473 (Target_x86_64::can_icf_inline_merge_sections): Remove.
3474 (Target_x86_64::x86_64_info): Initialize
3475 can_icf_inline_merge_sections.
3476 * testsuite/testfile.cc (Target_test::test_target_info):
3477 Likewise.
3478 * icf.cc (get_section_contents): Correct formatting.
3479
6d1c4efb
ILT
34802011-06-27 Ian Lance Taylor <iant@google.com>
3481
3482 * symtab.cc (Symbol::versioned_name): New function.
3483 (Symbol_table::add_to_final_symtab): Use versioned_name when
3484 appropriate.
3485 (Symbol_table::sized_write_symbol): Likewise.
3486 * symtab.h (class Symbol): Declare versioned_name.
3487 * stringpool.h (class Stringpool_template): Add variant of add
3488 which takes a std::basic_string.
3489 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
3490 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
3491 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
3492 (ver_test_12.o): New target.
3493 * testsuite/Makefile.in: Rebuild.
3494
57eb9b50
DK
34952011-06-27 Doug Kwan <dougkwan@google.com>
3496
3497 * arm.cc (Arm_relocate_functions::thm_jump8,
3498 Arm_relocate_functions::thm_jump11): Use a wider signed
3499 type to compute offset.
3500 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
3501 arm_thm_jump8.
3502 * testsuite/Makefile.in: Regenerate.
3503 * testsuite/arm_branch_in_range.sh: Check test results of
3504 arm_thm_jump11 and arm_thm_jump8.
3505 * testsuite/arm_thm_jump11.s: New test source file.
3506 * testsuite/arm_thm_jump11.t: New linker script.
3507 * testsuite/arm_thm_jump8.s: New test source file.
3508 * testsuite/arm_thm_jump8.t: New linker script.
3509
487b39df
ILT
35102011-06-24 Ian Lance Taylor <iant@google.com>
3511
3512 * layout.cc: Include "object.h".
3513 (ctors_sections_in_init_array): New static variable.
3514 (Layout::is_ctors_in_init_array): New function.
3515 (Layout::layout): Add entry to ctors_sections_in_init_array if
3516 appropriate.
3517 * layout.h (class Layout): Declare is_ctors_in_init_array.
3518 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
3519 is_ctors_reverse_view is set.
3520 (Sized_relobj_file::write_sections): Add layout parameter. Change
3521 all callers. Set is_ctors_reverse_view field of View_size.
3522 (Sized_relobj_file::reverse_words): New function.
3523 * object.h (Sized_relobj_file::View_size): Add
3524 is_ctors_reverse_view field.
3525 (class Sized_relobj_file): Update declarations.
3526 * testsuite/initpri3.c: New test.
3527 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
3528 initpri3b.
3529 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
3530 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
3531 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
3532 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
3533 * testsuite/Makefile.in: Rebuild.
3534
472076e4
CC
35352011-06-24 Cary Coutant <ccoutant@google.com>
3536
3537 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
3538 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
3539 (debug_msg_cdebug.err): New targets.
3540 * testsuite/Makefile.in: Regenerate.
3541 * testsuite/debug_msg.sh: Check output of link with compressed debug.
3542 Fix checks for link with shared library.
3543
a60af0db
DK
35442011-06-24 Doug Kwan <dougkwan@google.com>
3545
3546 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
3547 skip empty text sections.
3548 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
3549
5393d741
ILT
35502011-06-22 Ian Lance Taylor <iant@google.com>
3551
3552 PR gold/12910
3553 * options.h (class General_options): Add --ctors-in-init-array.
3554 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
3555 friends as SHT_PROGBITS for merging sections.
3556 (Layout::layout): Remove special handling of .init_array and
3557 friends. Don't sort if doing relocatable link. Sort for .ctors
3558 and .dtors if ctors_in_init_array.
3559 (Layout::make_output_section): Force correct section types for
3560 .init_array and friends. Don't sort if doing relocatable link,
3561 Don't sort .ctors and .dtors if ctors_in_init_array.
3562 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
3563 (Layout::output_section_name): Add relobj parameter. Change all
3564 callers. Handle .ctors. and .dtors. in code rather than table.
3565 Handle .ctors and .dtors if ctors_in_init_array.
3566 (Layout::match_file_name): New function, moved from output.cc.
3567 * layout.h (class Layout): Update declarations.
3568 * output.cc: Include "layout.h".
3569 (Input_section_sort_entry::get_priority): New function.
3570 (Input_section_sort_entry::match_file_name): Just call
3571 Layout::match_file_name.
3572 (Output_section::Input_section_sort_init_fini_compare::operator()):
3573 Handle .ctors and .dtors. Sort by explicit priority rather than
3574 by name.
3575 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
3576 * testsuite/initpri2.c: New test.
3577 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
3578 (check_PROGRAMS): Add initpri2.
3579 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
3580 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
3581 * configure, testsuite/Makefile.in: Rebuild.
3582
e1f74f98
ILT
35832011-06-19 Ian Lance Taylor <iant@google.com>
3584
3585 PR gold/12880
3586 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
3587 .interp section to a PT_INTERP segment even if we have seen a
3588 --dynamic-linker option. Don't do it if we have seen a PHDRS
3589 clause in a linker script.
3590 (Layout::finalize): Don't create a .interp section if we've
3591 already create a PT_INTERP segment.
3592 (Layout::create_interp): Always call choose_output_section (revert
3593 patch of 2011-06-17). Don't create PT_INTERP segment.
3594 * script-sections.cc
3595 (Script_sections::create_note_and_tls_segments): Add a .interp
3596 section to a PT_INTERP segment even if we have seen a
3597 --dynamic-linker option.
3598
766f91bb
ILT
35992011-06-18 Ian Lance Taylor <iant@google.com>
3600
3601 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
3602 merely because a non-PT_LOAD segment has a dynamic reloc.
3603
0d212c3a
ILT
36042011-06-18 Ian Lance Taylor <iant@google.com>
3605
3606 * layout.cc (Layout::finish_dynamic_section): Don't create
3607 DT_FLAGS entry if not needed.
3608
911a5072
ILT
36092011-06-18 Ian Lance Taylor <iant@google.com>
3610
3611 PR gold/12745
3612 * layout.cc (Layout::layout_eh_frame): Correct handling of
3613 writable .eh_frame section.
3614
534b4e5f
ILT
36152011-06-17 Ian Lance Taylor <iant@google.com>
3616
3617 PR gold/12893
3618 * resolve.cc (Symbol_table::resolve): Don't give an error if a
3619 symbol is redefined with the exact same object and value.
3620
10b4f102
ILT
36212011-06-17 Ian Lance Taylor <iant@google.com>
3622
3623 PR gold/12880
3624 * layout.h (class Layout): Add interp_segment_ field.
3625 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
3626 (Layout::attach_allocated_section_to_segment): If making shared
3627 library, put .interp section in PT_INTERP segment.
3628 (Layout::finalize): Also call create_interp if -dynamic-linker
3629 option was used.
3630 (Layout::create_interp): Assert that there is no PT_INTERP
3631 segment. If not using a SECTIONS clause, use make_output_section.
3632 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
3633 * script-sections.cc
3634 (Script_sections::create_note_and_tls_segments): If making shared
3635 library, put .interp section in PT_INTERP segment.
3636
a29b0dad
ILT
36372011-06-17 Ian Lance Taylor <iant@google.com>
3638
e588ea8d
ILT
3639 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
3640 when making a shared library.
3641
36422011-06-17 Ian Lance Taylor <iant@google.com>
3643
3644 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
3645 parameter. Change all callers. Don't issue warning about PC32
3646 against locally defined symbol.
a29b0dad 3647
9d3b0698
ILT
36482011-06-16 Ian Lance Taylor <iant@google.com>
3649
3650 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
3651 occurs in same object.
3652
85b0f90c
AM
36532011-06-14 Alan Modra <amodra@gmail.com>
3654
3655 * po/POTFILES.in: Regenerate.
3656
a94907d9
ILT
36572011-06-09 Ian Lance Taylor <iant@google.com>
3658
3659 * script-sections.cc
3660 (Orphan_output_section::set_section_addresses): For a relocatable
3661 link set address to 0.
3662
4fb3a1c3
CC
36632011-06-09 Cary Coutant <ccoutant@google.com>
3664
3665 PR gold/12804
3666 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
3667 used with --compress-debug-sections.
3668 * gold/object.cc (Sized_relobj_file::do_layout): Report
3669 uncompressed size of compressed input sections.
3670
61220854
CC
36712011-06-08 Cary Coutant <ccoutant@google.com>
3672
3673 PR gold/12804
3674 * testsuite/two_file_test_2_v1.cc: Change initialization of
3675 v2 to keep it in .data.
3676
e6455dfb
CC
36772011-06-07 Cary Coutant <ccoutant@google.com>
3678
3679 * common.cc (Symbol_table::do_allocate_commons_list): Call
3680 gold_fallback.
3681 * errors.cc (Errors::fatal): Adjust call to gold_exit.
3682 (Errors::fallback): New function.
3683 (gold_fallback): New function.
3684 * errors.h (Errors::fallback): New function.
3685 * gold.cc (gold_exit): Change status parameter to enum; adjust
3686 all callers.
3687 (queue_initial_tasks): Call gold_fallback.
3688 * gold.h: Include cstdlib.
3689 (Exit_status): New enum type.
3690 (gold_exit): Change status parameter to enum.
3691 (gold_fallback): New function.
3692 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
3693 (Layout::create_symtab_sections): Likewise.
3694 (Layout::create_shdrs): Likewise.
3695 * main.cc (main): Adjust call to gold_exit.
3696 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
3697 (Output_data_got::add_got_entry_pair): Likewise.
3698 (Output_section::add_input_section): Likewise.
3699 (Output_section::add_output_section_data): Likewise.
3700 (Output_segment::set_section_list_addresses): Likewise.
3701 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
3702
fb0e076f
CC
37032011-06-07 Cary Coutant <ccoutant@google.com>
3704
3705 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
3706 for incremental links.
3707 * output.cc (Output_segment::set_section_list_addresses): Remove
3708 FIXME and test for TLS or BSS.
3709
a5ee4d5d
CC
37102011-06-07 Cary Coutant <ccoutant@google.com>
3711
3712 * testsuite/Makefile.am: Add incremental_copy_test,
3713 incremental_common_test_1.
3714 * testsuite/Makefile.in: Regenerate.
3715 * testsuite/common_test_1_v1.c: New source file.
3716 * testsuite/common_test_1_v2.c: New source file.
3717 * testsuite/copy_test_v1.cc: New source file.
3718
5146f448
CC
37192011-06-07 Cary Coutant <ccoutant@google.com>
3720
3721 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
3722 update, allocate common from bss section's free list.
3723 * incremental-dump.cc (dump_incremental_inputs): Print flag for
3724 linker-defined symbols.
3725 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
3726 Skip GOT and PLT entries that are no longer referenced.
3727 (Output_section_incremental_inputs::write_info_blocks): Mark
3728 linker-defined symbols.
3729 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
3730 * output.cc (Output_section::allocate): New function.
3731 * output.h (Output_section::allocate): New function.
3732 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
3733 linker-defined symbols.
3734 (Symbol::override_base_with_special): Copy is_predefined_ flag.
3735 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
3736 (Symbol::init_base_output_data): Likewise.
3737 (Symbol::init_base_output_segment): Likewise.
3738 (Symbol::init_base_constant): Likewise.
3739 (Sized_symbol::init_output_data): Likewise.
3740 (Sized_symbol::init_output_segment): Likewise.
3741 (Sized_symbol::init_constant): Likewise.
3742 (Symbol_table::do_define_in_output_data): Likewise.
3743 (Symbol_table::do_define_in_output_segment): Likewise.
3744 (Symbol_table::do_define_as_constant): Likewise.
3745 * symtab.h (Symbol::is_predefined): New function.
3746 (Symbol::init_base_output_data): Add is_predefined parameter.
3747 (Symbol::init_base_output_segment): Likewise.
3748 (Symbol::init_base_constant): Likewise.
3749 (Symbol::is_predefined_): New data member.
3750 (Sized_symbol::init_output_data): Add is_predefined parameter.
3751 (Sized_symbol::init_output_segment): Likewise.
3752 (Sized_symbol::init_constant): Likewise.
3753 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
3754
26d3c67d
CC
37552011-06-07 Cary Coutant <ccoutant@google.com>
3756
3757 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
3758 instead of emit_copy_reloc.
3759 (Copy_relocs::emit_copy_reloc): Refactor.
3760 (Copy_relocs::make_copy_reloc): New function.
3761 (Copy_relocs::add_copy_reloc): Remove.
3762 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
3763 section.
3764 (Copy_relocs::make_copy_reloc): New function.
3765 (Copy_relocs::add_copy_reloc): Remove.
3766 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
3767 unchanged input files.
3768 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
3769 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
3770 Reserve BSS space for COPY relocations.
3771 (Sized_incremental_binary::do_emit_copy_relocs): New function.
3772 (Output_section_incremental_inputs::write_info_blocks): Record
3773 whether a symbol is copied from a shared object.
3774 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
3775 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
3776 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
3777 (Incremental_input_entry_reader::get_output_symbol_index): Add
3778 is_copy parameter.
3779 (Incremental_binary::emit_copy_relocs): New function.
3780 (Incremental_binary::do_emit_copy_relocs): New function.
3781 (Sized_incremental_binary::Sized_incremental_binary): Initialize
3782 new data member.
3783 (Sized_incremental_binary::add_copy_reloc): New function.
3784 (Sized_incremental_binary::do_emit_copy_relocs): New function.
3785 (Sized_incremental_binary::Copy_reloc): New struct.
3786 (Sized_incremental_binary::Copy_relocs): New typedef.
3787 (Sized_incremental_binary::copy_relocs_): New data member.
3788 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
3789 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
3790 * target.h (Sized_target::emit_copy_reloc): New function.
3791 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
3792
7cdb37d9
CC
37932011-06-02 Cary Coutant <ccoutant@google.com>
3794
3795 PR gold/12163
3796 * gold/archive.cc (Archive::Archive): Initialize new data member.
3797 (Archive::include_all_members): Return if archive has already been
3798 included.
3799 * gold/archive.h (Archive::include_all_members_): New data member.
3800
cc643b88
NC
38012011-06-02 Nick Clifton <nickc@redhat.com>
3802
3803 * dynobj.h: Fix spelling mistake in comment.
3804 * output.cc: Likewise.
3805
f62a3ca7 38062011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 3807 Asier Llano
f62a3ca7
DK
3808
3809 PR gold/12826
cc643b88 3810 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
3811 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
3812 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
3813 redundant arm_exidx_test.so.
3814 * testsuite/Makefile.in: Regenerate.
3815 (check_SCRIPTS): Add pr12826.sh
3816 (check_DATA): Add pr12826.stdout
3817 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
3818 * testsuite/pr12826.sh: New file.
3819 * testsuite/pr12826_1.s: Ditto.
3820 * testsuite/pr12826_1.s: Ditto.
3821
8dbe1edc
ILT
38222011-05-30 Ian Lance Taylor <iant@google.com>
3823
3824 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
3825 sections.
3826
c49875be
ILT
38272011-05-29 Ian Lance Taylor <iant@google.com>
3828
3829 PR gold/12804
3830 * testsuite/Makefile.am: Use different file name for two_file_test
3831 temporary file for each incremental test.
3832 * testsuite/Makefile.in: Rebuild.
3833
69d53f7a
ILT
38342011-05-29 Ian Lance Taylor <iant@google.com>
3835
3836 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
3837 binary input file is empty.
3838
41d0ab5f
ILT
38392011-05-27 Ian Lance Taylor <iant@google.com>
3840
3841 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
3842 (ver_test_9.so): Likewise.
3843 * testsuite/Makefile.in: Rebuild.
3844
89d8a36b
CC
38452011-05-26 Cary Coutant <ccoutant@google.com>
3846
3847 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
3848 * incremental.cc (Incremental_inputs::report_input_section): Fix
3849 comment, indentation.
3850 (Incremental_inputs::report_comdat_group): New function.
3851 (Output_section_incremental_inputs::set_final_data_size): Adjust size
3852 of data for incremental input file entry.
3853 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
3854 group count, COMDAT group signatures.
3855 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
3856 an unchanged input file.
3857 * incremental.h (Incremental_object_entry::Incremental_object_entry):
3858 Initialize new data member.
3859 (Incremental_object_entry::add_comdat_group): New function.
3860 (Incremental_object_entry::get_comdat_group_count): New function.
3861 (Incremental_object_entry::get_comdat_signature_key): New function.
3862 (Incremental_object_entry::groups_): New data member.
3863 (Incremental_inputs::report_comdat_group): New function.
3864 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
3865 data for incremental input file entry.
3866 (Incremental_input_entry_reader::get_comdat_group_count): New function.
3867 (Incremental_input_entry_reader::get_input_section): Adjust size of
3868 data for incremental input file entry.
3869 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
3870 (Incremental_input_entry_reader::get_comdat_group_signature): New
3871 function.
3872 * object.cc (Sized_relobj::include_section_group): Report kept
3873 COMDAT groups for incremental links.
3874
1706a06f
ILT
38752011-05-24 David Meyer <pdox@google.com>
3876
3877 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
3878 with name parameter. Add found_name parameter.
3879 * fileread.cc (Input_file::find_file): Adjust code accordingly.
3880 * dirsearch.h (class Dirsearch): Update declaration.
3881
a10ae760
ILT
38822011-05-24 Ian Lance Taylor <iant@google.com>
3883
3884 * archive.cc (Library_base::should_include_member): Pull in object
3885 from archive if it defines the entry symbol.
3886 * parameters.cc (Parameters::entry): New function.
3887 * parameters.h (class Parameters): Declare entry.
3888 * output.h (class Output_file_header): Remove entry_ field.
3889 * output.cc (Output_file_header::Output_file_header): Remove entry
3890 parameter. Change all callers.
3891 (Output_file_header::entry): Use parameters->entry.
3892 * gold.cc (queue_middle_tasks): Likewise.
3893 * plugin.cc (Plugin_hook::run): Likewise.
3894
aa92d6ed
CC
38952011-05-24 Cary Coutant <ccoutant@google.com>
3896
3897 * gold.cc (queue_initial_tasks): Pass incremental base filename
3898 to Output_file::open_base_file; don't print error message.
3899 * incremental-dump.cc (main): Adjust call to
3900 Output_file::open_for_modification.
3901 * incremental-dump.cc (main): Likewise.
3902 * incremental.cc (Incremental_inputs::report_command_line):
3903 Ignore --incremental-base option when comparing command lines.
3904 Ignore parameter when given as separate argument.
3905 * options.h (class General_options): Add --incremental-base.
3906 * output.cc (Output_file::Output_file):
3907 (Output_file::open_base_file): Add base_name and writable parameters;
3908 read base file into new file; print error message here.
3909 (Output_file::map_no_anonymous): Add writable parameter; adjust all
3910 callers.
3911 * output.h (Output_file::open_for_modification): Rename to...
3912 (Output_file::open_base_file): ...this; add base_name and
3913 writable parameters; adjust all callers.
3914 (Output_file::map_no_anonymous): Add writable parameter; adjust all
3915 callers.
3916 * testsuite/Makefile.am (incremental_test_4): Test
3917 --incremental-base.
3918 * testsuite/Makefile.in: Regenerate.
3919
2eedd706
CC
39202011-05-24 Cary Coutant <ccoutant@google.com>
3921
3922 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
3923 incremental_test_4.
3924 * testsuite/Makefile.in: Regenerate.
3925 * testsuite/two_file_test_1_v1.cc: New test source file.
3926 * testsuite/two_file_test_1b_v1.cc: New test source file.
3927 * testsuite/two_file_test_2_v1.cc: New test source file.
3928
0f1c85a6
CC
39292011-05-24 Cary Coutant <ccoutant@google.com>
3930
3931 * dynobj.h (Dynobj::do_dynobj): New function.
3932 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
3933 flag and soname for shared objects.
3934 * incremental.cc (Incremental_inputs::report_object): Make
3935 either Incremental_object_entry or Incremental_dynobj_entry; add
3936 soname to string table.
3937 (Incremental_inputs::report_input_section): Add assertion.
3938 (Output_section_incremental_inputs::set_final_data_size): Adjust
3939 type of input file entry for shared libraries; adjust size of
3940 shared library info entry.
3941 (Output_section_incremental_inputs::write_input_files): Write
3942 as_needed flag for shared libraries.
3943 (Output_section_incremental_inputs::write_info_blocks): Adjust type
3944 of input file entry for shared libraries; write soname.
3945 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
3946 soname from incremental info.
3947 * incremental.h (enum Incremental_input_flags): Add
3948 INCREMENTAL_INPUT_AS_NEEDED.
3949 (Incremental_input_entry::Incremental_input_entry): Initialize new
3950 data member.
3951 (Incremental_input_entry::set_as_needed): New function.
3952 (Incremental_input_entry::as_needed): New function.
3953 (Incremental_input_entry::do_dynobj_entry): New function.
3954 (Incremental_input_entry::as_needed_): New data member.
3955 (Incremental_object_entry::Incremental_object_entry): Don't check
3956 for shared library.
3957 (Incremental_object_entry::do_type): Likewise.
3958 (class Incremental_dynobj_entry): New class.
3959 (Incremental_input_entry_reader::as_needed): New function.
3960 (Incremental_input_entry_reader::get_soname): New function.
3961 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
3962 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
3963 size of shared library info entry.
58797674 3964 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
3965 incremental link when adding DT_NEEDED entries.
3966 * object.h (Object::Object): Initialize new data member.
3967 (Object::dynobj): New function.
3968 (Object::set_as_needed): New function.
3969 (Object::as_needed): New function.
3970 (Object::do_dynobj): New function.
3971 (Object::as_needed_): New data member.
3972
6fa2a40b
CC
39732011-05-24 Cary Coutant <ccoutant@google.com>
3974
3975 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
3976 info; adjust display of GOT entries.
3977 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
3978 vector of input objects; remove file_status_.
3979 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
3980 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
3981 got_plt reader; call target hooks to reserve GOT entries.
3982 (Output_section_incremental_inputs::set_final_data_size): Adjust size
3983 of input file info header and GOT info entry.
3984 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
3985 relocation info.
3986 (Got_plt_view_info::got_descriptor): Remove.
3987 (Got_plt_view_info::sym_index): New data member.
3988 (Got_plt_view_info::input_index): New data member.
3989 (Local_got_offset_visitor::visit): Write input file index.
3990 (Global_got_offset_visitor::visit): Write 0 for input file index.
3991 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
3992 with sym_index and input_index.
3993 (Output_section_incremental_inputs::write_got_plt): Adjust size of
3994 incremental info GOT entry; replace got_descriptor with input_index.
3995 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
3996 map from input file index to object.
3997 (Sized_relobj_incr::do_layout): Replace direct data member reference
3998 with accessor function.
3999 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
4000 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
4001 Adjust size of input file info header.
4002 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
4003 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
4004 (Incremental_input_entry_reader::get_input_section): Adjust size of
4005 input file info header.
4006 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
4007 of incremental info GOT entry.
4008 (Incremental_got_plt_reader::get_got_desc): Remove.
4009 (Incremental_got_plt_reader::get_got_symndx): New function.
4010 (Incremental_got_plt_reader::get_got_input_index): New function.
4011 (Sized_incremental_binary::Sized_incremental_binary): Remove
4012 file_status_; add input_objects_.
4013 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
4014 (Sized_incremental_binary::set_file_is_unchanged): Remove.
4015 (Sized_incremental_binary::file_is_unchanged): Remove.
4016 (Sized_incremental_binary::set_input_object): New function.
4017 (Sized_incremental_binary::input_object): New function.
4018 (Sized_incremental_binary::file_status_): Remove.
4019 (Sized_incremental_binary::input_objects_): New data member.
4020 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
4021 references.
4022 (Sized_relobj_incr::invalid_address): Move to base class.
4023 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
4024 class.
4025 (Sized_relobj_incr::do_output_section_offset): Likewise.
4026 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
4027 (Sized_relobj_incr::section_offsets_): Likewise.
4028 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
4029 function.
4030 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
4031 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
4032 with accessor function.
4033 (Sized_relobj_file::do_layout): Likewise.
4034 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
4035 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
4036 (Sized_relobj_file::compute_final_local_value): Replace refs to
4037 section_offsets_ with accessor function.
4038 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
4039 * object.h (Relobj::Relobj): Initialize new data members.
4040 (Relobj::add_dyn_reloc): New function.
4041 (Relobj::first_dyn_reloc): New function.
4042 (Relobj::dyn_reloc_count): New function.
4043 (Relobj::first_dyn_reloc_): New data member.
4044 (Relobj::dyn_reloc_count_): New data member.
4045 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
4046 references.
4047 (Sized_relobj::Address): New typedef.
4048 (Sized_relobj::invalid_address): Move here from child class.
4049 (Sized_relobj::Sized_relobj): Initialize new data members.
4050 (Sized_relobj::sized_relobj): New function.
4051 (Sized_relobj::is_output_section_offset_invalid): Move here from
4052 child class.
4053 (Sized_relobj::get_output_section_offset): Likewise.
4054 (Sized_relobj::local_has_got_offset): Likewise.
4055 (Sized_relobj::local_got_offset): Likewise.
4056 (Sized_relobj::set_local_got_offset): Likewise.
4057 (Sized_relobj::do_for_all_local_got_entries): Likewise.
4058 (Sized_relobj::clear_got_offsets): New function.
4059 (Sized_relobj::section_offsets): Move here from child class.
4060 (Sized_relobj::do_output_section_offset): Likewise.
4061 (Sized_relobj::do_set_section_offset): Likewise.
4062 (Sized_relobj::Local_got_offsets): Likewise.
4063 (Sized_relobj::local_got_offsets_): Likewise.
4064 (Sized_relobj::section_offsets_): Likewise.
4065 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
4066 references.
4067 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
4068 class.
4069 (Sized_relobj_file::sized_relobj): New function
4070 (Sized_relobj_file::local_has_got_offset): Move to base class.
4071 (Sized_relobj_file::local_got_offset): Likewise.
4072 (Sized_relobj_file::set_local_got_offset): Likewise.
4073 (Sized_relobj_file::get_output_section_offset): Likewise.
4074 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
4075 (Sized_relobj_file::do_output_section_offset): Likewise.
4076 (Sized_relobj_file::do_set_section_offset): Likewise.
4077 (Sized_relobj_file::Local_got_offsets): Likewise.
4078 (Sized_relobj_file::local_got_offsets_): Likewise.
4079 (Sized_relobj_file::section_offsets_): Likewise.
4080 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
4081 (all constructors).
4082 (set_needs_dynsym_index): Convert relobj to derived class pointer.
4083 (Output_reloc::get_symbol_index): Likewise.
4084 (Output_reloc::local_section_offset): Likewise.
4085 (Output_reloc::get_address): Likewise.
4086 (Output_reloc::symbol_value): Likewise.
4087 (Output_data_got::reserve_slot): Move to class definition.
4088 (Output_data_got::reserve_local): New function.
4089 (Output_data_got::reserve_slot_for_global): Remove.
4090 (Output_data_got::reserve_global): New function.
4091 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
4092 (all constructors, two instantiations).
4093 (Output_reloc::get_relobj): New function (two instantiations).
4094 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
4095 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
4096 (Output_data_reloc::add_global): Adjust type of relobj.
4097 (Output_data_reloc::add_global_relative): Likewise.
4098 (Output_data_reloc::add_symbolless_global_addend): Likewise.
4099 (Output_data_reloc::add_local): Likewise.
4100 (Output_data_reloc::add_local_relative): Likewise.
4101 (Output_data_reloc::add_symbolless_local_addend): Likewise.
4102 (Output_data_reloc::add_local_section): Likewise.
4103 (Output_data_reloc::add_output_section): Likewise.
4104 (Output_data_reloc::add_absolute): Likewise.
4105 (Output_data_reloc::add_target_specific): Likewise.
4106 (Output_data_got::reserve_slot): Move definition here.
4107 (Output_data_got::reserve_local): New function.
4108 (Output_data_got::reserve_global): New function.
4109 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
4110 section_offsets_ with accessor function.
4111 (Sized_relobj_file::write_sections): Likewise.
4112 (Sized_relobj_file::do_relocate_sections): Likewise.
4113 * target.h (Sized_target::reserve_local_got_entry): New function.
4114 (Sized_target::reserve_global_got_entry): New function.
4115 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
4116 (Target_x86_64::reserve_global_got_entry): New function.
4117 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
4118
4829d394
CC
41192011-05-23 Cary Coutant <ccoutant@google.com>
4120
4121 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
4122 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
4123 bit when checking got_type.
4124 * incremental.cc (Sized_incremental_binary::setup_readers):
4125 Store symbol table and string table locations; initialize bit vector
4126 of file status flags.
4127 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
4128 unchanged files.
4129 (Sized_incremental_binary::do_process_got_plt): New function.
4130 (Sized_incremental_binary::get_symtab_view): Use stored locations.
4131 (Output_section_incremental_inputs::set_final_data_size): Record
4132 file index for each input file.
4133 (Output_section_incremental_inputs::write_got_plt): Store file index
4134 instead of input entry offset for each GOT entry.
4135 * incremental.h
4136 (Incremental_input_entry::Incremental_input_entry): Initialize new
4137 data member.
4138 (Incremental_input_entry::set_offset): Store file index.
4139 (Incremental_input_entry::get_file_index): New function.
4140 (Incremental_input_entry::file_index_): New data member.
4141 (Incremental_binary::process_got_plt): New function.
4142 (Incremental_binary::do_process_got_plt): New function.
4143 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
4144 data members.
4145 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
4146 (Sized_incremental_binary::set_file_is_unchanged): New function.
4147 (Sized_incremental_binary::file_is_unchanged): New function.
4148 (Sized_incremental_binary::do_process_got_plt): New function.
4149 (Sized_incremental_binary::file_status_): New data member.
4150 (Sized_incremental_binary::main_symtab_loc_): New data member.
4151 (Sized_incremental_binary::main_strtab_loc_): New data member.
4152 * output.cc (Output_data_got::Got_entry::write): Add case
4153 RESERVED_CODE.
4154 (Output_data_got::add_global): Call add_got_entry.
4155 (Output_data_got::add_global_plt): Likewise.
4156 (Output_data_got::add_global_with_rel): Likewise.
4157 (Output_data_got::add_global_with_rela): Likewise.
4158 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
4159 (Output_data_got::add_global_pair_with_rela): Likewise.
4160 (Output_data_got::add_local): Call add_got_entry.
4161 (Output_data_got::add_local_plt): Likewise.
4162 (Output_data_got::add_local_with_rel): Likewise.
4163 (Output_data_got::add_local_with_rela): Likewise.
4164 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
4165 (Output_data_got::add_local_pair_with_rela): Likewise.
4166 (Output_data_got::reserve_slot): New function.
4167 (Output_data_got::reserve_slot_for_global): New function.
4168 (Output_data_got::add_got_entry): New function.
4169 (Output_data_got::add_got_entry_pair): New function.
4170 (Output_section::add_output_section_data): Edit FIXME.
4171 * output.h
4172 (Output_section_data_build::Output_section_data_build): New
4173 constructor with size parameter.
4174 (Output_data_space::Output_data_space): Likewise.
4175 (Output_data_got::Output_data_got): Initialize new data member; new
4176 constructor with size parameter.
4177 (Output_data_got::add_constant): Call add_got_entry.
4178 (Output_data_got::reserve_slot): New function.
4179 (Output_data_got::reserve_slot_for_global): New function.
4180 (class Output_data_got::Got_entry): Add RESERVED_CODE.
4181 (Output_data_got::add_got_entry): New function.
4182 (Output_data_got::add_got_entry_pair): New function.
4183 (Output_data_got::free_list_): New data member.
4184 * target.h (Sized_target::init_got_plt_for_update): New function.
4185 (Sized_target::register_global_plt_entry): New function.
4186 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4187 Initialize new data member; call init; add constructor with PLT count.
4188 (Output_data_plt_x86_64::init): New function.
4189 (Output_data_plt_x86_64::add_relocation): New function.
4190 (Output_data_plt_x86_64::reserve_slot): New function.
4191 (Output_data_plt_x86_64::free_list_): New data member.
4192 (Target_x86_64::init_got_plt_for_update): New function.
4193 (Target_x86_64::register_global_plt_entry): New function.
4194 (Output_data_plt_x86_64::add_entry): Allocate from free list for
4195 incremental updates.
4196 (Output_data_plt_x86_64::add_relocation): New function.
4197 * testsuite/object_unittest.cc (Object_test): Set default options.
4198
ec69d6da
ILT
41992011-05-16 Ian Lance Taylor <iant@google.com>
4200
4201 * options.h (class General_options): Make -i a synonym for -r.
4202
732e31de
ILT
42032011-05-16 Ian Lance Taylor <iant@google.com>
4204
4205 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
4206
403676b5
CC
42072011-05-10 Cary Coutant <ccoutant@google.com>
4208
4209 * object.cc (Sized_relobj::do_count_local_symbols): Check for
4210 strip_all (-s).
4211
5b7b7d6e
ILT
42122011-05-06 Ian Lance Taylor <iant@google.com>
4213
4214 * layout.cc (Layout::layout): If the output section flags change,
4215 update the ordering.
4216
f0f9babf
CC
42172011-04-25 Cary Coutant <ccoutant@google.com>
4218
4219 * incremental-dump.cc (dump_incremental_inputs): Print local
4220 symbol info for each input file.
4221 * incremental.cc
4222 (Output_section_incremental_inputs::set_final_data_size): Add local
4223 symbol info to input file entries in incremental info.
4224 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4225 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
4226 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
4227 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
4228 implementation.
4229 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
4230 (Sized_incr_relobj::do_relocate): Write the local symbols.
4231 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
4232 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
4233 Adjust size of input file header.
4234 (Incremental_inputs_reader::get_local_symbol_offset): New function.
4235 (Incremental_inputs_reader::get_local_symbol_count): New function.
4236 (Incremental_inputs_reader::get_input_section): Adjust size of input
4237 file header.
4238 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
4239 (Sized_incr_relobj::This): New typedef.
4240 (Sized_incr_relobj::sym_size): New const data member.
4241 (Sized_incr_relobj::Local_symbol): New struct.
4242 (Sized_incr_relobj::do_output_local_symbol_count): New function.
4243 (Sized_incr_relobj::do_local_symbol_offset): New function.
4244 (Sized_incr_relobj::local_symbol_count_): New data member.
4245 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
4246 (Sized_incr_relobj::local_symbol_index_): New data member.
4247 (Sized_incr_relobj::local_symbol_offset_): New data member.
4248 (Sized_incr_relobj::local_dynsym_offset_): New data member.
4249 (Sized_incr_relobj::local_symbols_): New data member.
4250 * object.h (Relobj::output_local_symbol_count): New function.
4251 (Relobj::local_symbol_offset): New function.
4252 (Relobj::do_output_local_symbol_count): New function.
4253 (Relobj::do_local_symbol_offset): New function.
4254 (Sized_relobj::do_output_local_symbol_count): New function.
4255 (Sized_relobj::do_local_symbol_offset): New function.
4256
d0a9ace3
ILT
42572011-04-22 Vladimir Simonov <sv@sw.ru>
4258
4259 * descriptors.cc (set_close_on_exec): New function.
4260 (Descriptors::open): Use set_close_on_exec.
4261 * output.cc (S_ISLNK): Define if not defined.
4262
94a3fc8b
CC
42632011-04-22 Cary Coutant <ccoutant@google.com>
4264
4265 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
4266 global symbol map.
4267 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
4268 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
4269 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
4270 relocations.
4271 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
4272 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
4273 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
4274 * incremental.h
4275 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
4276 function.
4277 (Incremental_binary::apply_incremental_relocs): New function.
4278 (Incremental_binary::do_apply_incremental_relocs): New function.
4279 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
4280 data member.
4281 (Sized_incremental_binary::add_global_symbol): New function.
4282 (Sized_incremental_binary::global_symbol): New function.
4283 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
4284 (Sized_incremental_binary::symbol_map_): New data member.
4285 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
4286 * target.h (Sized_target::apply_relocation): New function.
4287 * target-reloc.h (apply_relocation): New function.
4288 * x86_64.cc (Target_x86_64::apply_relocation): New function.
4289
c87e4302
DK
42902011-04-22 Doug Kwan <dougkwan@google.com>
4291
4292 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
4293 flag of a SHT_ARM_EXIDX section.
2e702c99 4294 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
4295 * testsuite/Makefile.in: Regenerate.
4296 * testsuite/arm_exidx_test.s: New file.
4297 * testsuite/arm_exidx_test.sh: Same.
4298
e7782cf6
CC
42992011-04-20 Cary Coutant <ccoutant@google.com>
4300
4301 PR gold/12689
4302 * archive.h (Incremental_archive_entry::Archive_member):
4303 Initialize arg_serial_ (second constructor).
4304
308ecdc7
ILT
43052011-04-17 Ian Lance Taylor <iant@google.com>
4306
4307 * object.cc (Relocate_info::location): Simplify location string.
4308 * errors.cc (Errors::error_at_location): Don't print program
4309 name.
4310 (Errors::warning_at_location): Likewise.
4311 (Errors::undefined_symbol): Likewise.
4312 * testsuite/debug_msg.sh: Update accordingly.
4313
bec5b579
CC
43142011-04-14 Cary Coutant <ccoutant@google.com>
4315
4316 * gold/layout.cc (Layout::symtab_section_offset): New function.
4317 * gold/layout.h (Layout::symtab_section_offset): New function.
4318 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
4319
88597d34
ILT
43202011-04-12 Ian Lance Taylor <iant@google.com>
4321
4322 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
4323 with MREMAP_MAYMOVE.
4324 * output.h (class Output_file): Add map_is_allocated_ field.
4325 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
4326 not available, provide stubs. If mremap is not available, #define
4327 it to gold_mremap.
4328 (MREMAP_MAYMOVE): Define if not defined.
4329 (Output_file::Output_file): Initialize map_is_allocated_.
4330 (Output_file::resize): Check map_is_allocated_.
4331 (Output_file::map_anonymous): If mmap fails, use malloc.
4332 (Output_file::unmap): Don't do anything for an anonymous map.
4333 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
4334 is not available, provide stubs.
4335 (File_read::View::~View): Use free rather than delete[].
4336 (File_read::make_view): Use malloc rather than new[]. If mmap
4337 fails, use malloc.
4338 (File_read::find_or_make_view): Use malloc rather than new[].
4339 * gold.h: Remove HAVE_REMAP code.
4340 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
4341 exists. Rename mremap to gold_mremap. If mmap is not available
4342 don't do anything.
4343 * configure, config.in: Rebuild.
4344
11e361bc
ILT
43452011-04-11 Ian Lance Taylor <iant@google.com>
4346
4347 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
4348 initialize local variable v.
4349
cdc29364
CC
43502011-04-11 Cary Coutant <ccoutant@google.com>
4351
4352 * archive.cc (Archive::include_member): Adjust call to
4353 report_object.
4354 (Add_archive_symbols::run): Track argument serial numbers.
4355 (Lib_group::include_member): Likewise.
4356 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
4357 * archive.h (Incremental_archive_entry::Archive_member):
4358 Initialize arg_serial_.
4359 (Archive_member::arg_serial_): New data member.
4360 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
4361 (Sized_dynobj::do_add_symbols): Track symbols when doing an
4362 incremental link.
4363 (Sized_dynobj::do_for_all_local_got_entries): New function.
4364 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
4365 function.
4366 * fileread.cc (get_mtime): New function.
4367 * fileread.h (get_mtime): New function.
4368 * gold.cc (queue_initial_tasks): Check for incremental update.
4369 (process_incremental_input): New function.
4370 (queue_middle_tasks): Don't force valid target for incremental
4371 update.
4372 * incremental-dump.cc (find_input_containing_global): Adjust
4373 size of symbol info entry.
4374 (dump_incremental_inputs): Dump argument serial number and
4375 in_system_directory flag; bias shndx by 1; print symbol names
4376 when dumping per-file symbol lists; use new symbol info readers.
4377 * incremental.cc
4378 (Output_section_incremental_inputs:update_data_size): New function.
4379 (Sized_incremental_binary::setup_readers): Setup input readers
4380 for each input file; build maps for files added from libraries
4381 and scripts.
4382 (Sized_incremental_binary::check_input_args): New function.
4383 (Sized_incremental_binary::do_check_inputs): Build map of argument
4384 serial numbers to input arguments.
4385 (Sized_incremental_binary::do_file_has_changed): Rename
4386 do_file_is_unchanged to this; compare file modification times.
4387 (Sized_incremental_binary::do_init_layout): New function.
4388 (Sized_incremental_binary::do_reserve_layout): New function.
4389 (Sized_incremental_binary::do_get_input_reader): Remove.
4390 (Sized_incremental_binary::get_symtab_view): New function.
4391 (Incremental_checker::can_incrementally_link_output_file): Remove.
4392 (Incremental_inputs::report_command_line): Exclude --debug options.
4393 (Incremental_inputs::report_archive_begin): Add parameter; track
4394 argument serial numbers; don't put input file entry for archive
4395 before archive members.
4396 (Incremental_inputs::report_archive_end): Put input file entry
4397 for archive after archive members.
4398 (Incremental_inputs::report_object): Add parameter; track argument
4399 serial numbers and in_system_directory flag.
4400 (Incremental_inputs::report_script): Add parameter; track argument
4401 serial numbers.
4402 (Output_section_incremental_inputs::set_final_data_size): Adjust
4403 size of symbol info entry; check for forwarding symbols.
4404 (Output_section_incremental_inputs::write_input_files): Write
4405 in_system_directory flag and argument serial number.
4406 (Output_section_incremental_inputs::write_info_blocks): Map section
4407 indices between incremental info and original input file; store
4408 input section index for each symbol.
4409 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
4410 change operator() to visit().
4411 (class Global_got_offset_visitor): Likewise.
4412 (class Global_symbol_visitor_got_plt):
4413 (Output_section_incremental_inputs::write_got_plt): Use new visitor
4414 classes.
4415 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
4416 (Sized_incr_relobj::do_read_symbols): New function.
4417 (Sized_incr_relobj::do_layout): New function.
4418 (Sized_incr_relobj::do_layout_deferred_sections): New function.
4419 (Sized_incr_relobj::do_add_symbols): New function.
4420 (Sized_incr_relobj::do_should_include_member): New function.
4421 (Sized_incr_relobj::do_for_all_global_symbols): New function.
4422 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
4423 (Sized_incr_relobj::do_section_size): New function.
4424 (Sized_incr_relobj::do_section_name): New function.
4425 (Sized_incr_relobj::do_section_contents): New function.
4426 (Sized_incr_relobj::do_section_flags): New function.
4427 (Sized_incr_relobj::do_section_entsize): New function.
4428 (Sized_incr_relobj::do_section_address): New function.
4429 (Sized_incr_relobj::do_section_type): New function.
4430 (Sized_incr_relobj::do_section_link): New function.
4431 (Sized_incr_relobj::do_section_info): New function.
4432 (Sized_incr_relobj::do_section_addralign): New function.
4433 (Sized_incr_relobj::do_initialize_xindex): New function.
4434 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
4435 (Sized_incr_relobj::do_read_relocs): New function.
4436 (Sized_incr_relobj::do_gc_process_relocs): New function.
4437 (Sized_incr_relobj::do_scan_relocs): New function.
4438 (Sized_incr_relobj::do_count_local_symbols): New function.
4439 (Sized_incr_relobj::do_finalize_local_symbols): New function.
4440 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
4441 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
4442 (Sized_incr_relobj::do_relocate): New function.
4443 (Sized_incr_relobj::do_set_section_offset): New function.
4444 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
4445 (Sized_incr_dynobj::do_read_symbols): New function.
4446 (Sized_incr_dynobj::do_layout): New function.
4447 (Sized_incr_dynobj::do_add_symbols): New function.
4448 (Sized_incr_dynobj::do_should_include_member): New function.
4449 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
4450 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
4451 (Sized_incr_dynobj::do_section_size): New function.
4452 (Sized_incr_dynobj::do_section_name): New function.
4453 (Sized_incr_dynobj::do_section_contents): New function.
4454 (Sized_incr_dynobj::do_section_flags): New function.
4455 (Sized_incr_dynobj::do_section_entsize): New function.
4456 (Sized_incr_dynobj::do_section_address): New function.
4457 (Sized_incr_dynobj::do_section_type): New function.
4458 (Sized_incr_dynobj::do_section_link): New function.
4459 (Sized_incr_dynobj::do_section_info): New function.
4460 (Sized_incr_dynobj::do_section_addralign): New function.
4461 (Sized_incr_dynobj::do_initialize_xindex): New function.
4462 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
4463 (make_sized_incremental_object): New function.
4464 (Incremental_library::copy_unused_symbols): New function.
4465 (Incremental_library::do_for_all_unused_symbols): New function.
4466 * incremental.h (enum Incremental_input_flags): New type.
4467 (class Incremental_checker): Remove.
4468 (Incremental_input_entry::Incremental_input_entry): Add argument
4469 serial number.
4470 (Incremental_input_entry::arg_serial): New function.
4471 (Incremental_input_entry::set_is_in_system_directory): New function.
4472 (Incremental_input_entry::is_in_system_directory): New function.
4473 (Incremental_input_entry::arg_serial_): New data member.
4474 (Incremental_input_entry::is_in_system_directory_): New data member.
4475 (class Script_info): Move here from script.h.
4476 (Script_info::Script_info): Add filename parameter.
4477 (Script_info::filename): New function.
4478 (Script_info::filename_): New data member.
4479 (Incremental_script_entry::Incremental_script_entry): Add argument
4480 serial number.
4481 (Incremental_object_entry::Incremental_object_entry): Likewise.
4482 (Incremental_object_entry::add_input_section): Build list of input
4483 sections with map to original shndx.
4484 (Incremental_object_entry::get_input_section_index): New function.
4485 (Incremental_object_entry::shndx_): New data member.
4486 (Incremental_object_entry::name_key_): Rename; adjust all refs.
4487 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
4488 (Incremental_archive_entry::Incremental_archive_entry): Add argument
4489 serial number.
4490 (Incremental_inputs::report_archive_begin): Likewise.
4491 (Incremental_inputs::report_object): Likewise.
4492 (Incremental_inputs::report_script): Likewise.
4493 (class Incremental_global_symbol_reader): New class.
4494 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
4495 and store flags and input file type.
4496 (Incremental_input_entry_reader::arg_serial): New function.
4497 (Incremental_input_entry_reader::type): Extract type from flags.
4498 (Incremental_input_entry_reader::is_in_system_directory): New function.
4499 (Incremental_input_entry_reader::get_input_section_count): Call
4500 accessor function for type.
4501 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
4502 function for type; adjust size of global symbol entry.
4503 (Incremental_input_entry_reader::get_global_symbol_count): Call
4504 accessor function for type.
4505 (Incremental_input_entry_reader::get_object_count): Likewise.
4506 (Incremental_input_entry_reader::get_object_offset): Likewise.
4507 (Incremental_input_entry_reader::get_member_count): Likewise.
4508 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
4509 (Incremental_input_entry_reader::get_member_offset): Likewise.
4510 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
4511 (Incremental_input_entry_reader::Global_symbol_info): Remove.
4512 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
4513 (Incremental_input_entry_reader::get_global_symbol_reader): New
4514 function.
4515 (Incremental_input_entry_reader::get_output_symbol_index): New
4516 function.
4517 (Incremental_input_entry_reader::type_): Remove.
4518 (Incremental_input_entry_reader::flags_): New data member.
4519 (Incremental_inputs_reader::input_file_offset): New function.
4520 (Incremental_inputs_reader::input_file_index): New function.
4521 (Incremental_inputs_reader::input_file): Call input_file_offset.
4522 (Incremental_inputs_reader::input_file_at_offset): New function.
4523 (Incremental_relocs_reader::get_r_type): Reformat.
4524 (Incremental_relocs_reader::get_r_shndx): Reformat.
4525 (Incremental_relocs_reader::get_r_offset): Reformat.
4526 (Incremental_relocs_reader::data): New function.
4527 (Incremental_binary::Incremental_binary): Initialize new data members.
4528 (Incremental_binary::check_inputs): Add cmdline parameter.
4529 (Incremental_binary::file_is_unchanged): Remove.
4530 (Input_reader::arg_serial): New function.
4531 (Input_reader::get_unused_symbol_count): New function.
4532 (Input_reader::get_unused_symbol): New function.
4533 (Input_reader::do_arg_serial): New function.
4534 (Input_reader::do_get_unused_symbol_count): New function.
4535 (Input_reader::do_get_unused_symbol): New function.
4536 (Incremental_binary::input_file_count): New function.
4537 (Incremental_binary::get_input_reader): Change signature to use
4538 index instead of filename.
4539 (Incremental_binary::file_has_changed): New function.
4540 (Incremental_binary::get_input_argument): New function.
4541 (Incremental_binary::get_library): New function.
4542 (Incremental_binary::get_script_info): New function.
4543 (Incremental_binary::init_layout): New function.
4544 (Incremental_binary::reserve_layout): New function.
4545 (Incremental_binary::output_file): New function.
4546 (Incremental_binary::do_check_inputs): New function.
4547 (Incremental_binary::do_file_is_unchanged): Remove.
4548 (Incremental_binary::do_file_has_changed): New function.
4549 (Incremental_binary::do_init_layout): New function.
4550 (Incremental_binary::do_reserve_layout): New function.
4551 (Incremental_binary::do_input_file_count): New function.
4552 (Incremental_binary::do_get_input_reader): Change signature.
4553 (Incremental_binary::input_args_map_): New data member.
4554 (Incremental_binary::library_map_): New data member.
4555 (Incremental_binary::script_map_): New data member.
4556 (Sized_incremental_binary::Sized_incremental_binary): Initialize
4557 new data members.
4558 (Sized_incremental_binary::output_section): New function.
4559 (Sized_incremental_binary::inputs_reader): Add const.
4560 (Sized_incremental_binary::symtab_reader): Add const.
4561 (Sized_incremental_binary::relocs_reader): Add const.
4562 (Sized_incremental_binary::got_plt_reader): Add const.
4563 (Sized_incremental_binary::get_symtab_view): New function.
4564 (Sized_incremental_binary::Inputs_reader): New typedef.
4565 (Sized_incremental_binary::Input_entry_reader): New typedef.
4566 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
4567 (Sized_incremental_binary::do_file_is_unchanged): Remove.
4568 (Sized_incremental_binary::do_file_has_changed): New function.
4569 (Sized_incremental_binary::do_init_layout): New function.
4570 (Sized_incremental_binary::do_reserve_layout): New function.
4571 (Sized_input_reader::Inputs_reader): Remove.
4572 (Sized_input_reader::Input_entry_reader): Remove.
4573 (Sized_input_reader::do_arg_serial): New function.
4574 (Sized_input_reader::do_get_unused_symbol_count): New function.
4575 (Sized_input_reader::do_get_unused_symbol): New function.
4576 (Sized_incremental_binary::do_input_file_count): New function.
4577 (Sized_incremental_binary::do_get_input_reader): Change signature;
4578 use index instead of filename.
4579 (Sized_incremental_binary::section_map_): New data member.
4580 (Sized_incremental_binary::input_entry_readers_): New data member.
4581 (class Sized_incr_relobj): New class.
4582 (class Sized_incr_dynobj): New class.
4583 (make_sized_incremental_object): New function.
4584 (class Incremental_library): New class.
4585 * layout.cc (Free_list::num_lists): New static data member.
4586 (Free_list::num_nodes): New static data member.
4587 (Free_list::num_removes): New static data member.
4588 (Free_list::num_remove_visits): New static data member.
4589 (Free_list::num_allocates): New static data member.
4590 (Free_list::num_allocate_visits): New static data member.
4591 (Free_list::init): New function.
4592 (Free_list::remove): New function.
4593 (Free_list::allocate): New function.
4594 (Free_list::dump): New function.
4595 (Free_list::print_stats): New function.
4596 (Layout_task_runner::run): Resize output file for incremental updates.
4597 (Layout::Layout): Initialize new data members.
4598 (Layout::set_incremental_base): New function.
4599 (Layout::init_fixed_output_section): New function.
4600 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
4601 incremental updates.
4602 (Layout::create_gold_note): Do not create gold note section for
4603 incremental updates.
4604 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
4605 for incremental updates.
4606 (Layout::set_section_offsets): For incremental updates, allocate space
4607 from free list.
4608 (Layout::create_symtab_sections): Layout with offsets relative to
4609 start of section; for incremental updates, allocate space from free
4610 list.
4611 (Layout::create_shdrs): For incremental updates, allocate space from
4612 free list.
4613 (Layout::finish_dynamic_section): For incremental updates, do not
4614 check --as-needed (fixed in subsequent patch).
4615 * layout.h (class Free_list): New class.
4616 (Layout::set_incremental_base): New function.
4617 (Layout::incremental_base): New function.
4618 (Layout::init_fixed_output_section): New function.
4619 (Layout::allocate): New function.
4620 (Layout::incremental_base_): New data member.
4621 (Layout::free_list_): New data member.
4622 * main.cc (main): Print Free_list statistics.
4623 * object.cc (Relobj::finalize_incremental_relocs): Add
4624 clear_counts parameter; clear counts only when clear_counts is set.
4625 (Sized_relobj::Sized_relobj): Initialize new base class.
4626 (Sized_relobj::do_layout): Don't report special sections.
4627 (Sized_relobj::do_for_all_local_got_entries): New function.
4628 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
4629 symtab_off to all symbol table offsets.
4630 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
4631 * object.h (class Got_offset_list): Move to top of file.
4632 (Object::Object): Allow case where input_file == NULL.
4633 (Object::~Object): Likewise.
4634 (Object::input_file): Assert that input_file != NULL.
4635 (Object::lock): Allow case where input_file == NULL.
4636 (Object::unlock): Likewise.
4637 (Object::is_locked): Likewise.
4638 (Object::token): Likewise.
4639 (Object::release): Likewise.
4640 (Object::is_incremental): New function.
4641 (Object::get_mtime): New function.
4642 (Object::for_all_local_got_entries): New function.
4643 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
4644 (Object::set_is_in_system_directory): New function.
4645 (Object::is_in_system_directory): New function.
4646 (Object::do_is_incremental): New function.
4647 (Object::do_get_mtime): New function.
4648 (Object::do_for_all_local_got_entries): New function.
4649 (Object::is_in_system_directory_): New data member.
4650 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
4651 (class Sized_relobj_base): New class.
4652 (class Sized_relobj): Derive from Sized_relobj_base.
4653 (class Sized_relobj::Symbols): Redeclare from base class.
4654 (class Sized_relobj::local_got_offset_list): Remove.
4655 (class Sized_relobj::Output_sections): Redeclare from base class.
4656 (class Sized_relobj::do_for_all_local_got_entries): New function.
4657 (class Sized_relobj::write_local_symbols): Add offset parameter.
4658 (class Sized_relobj::local_symbol_offset_): Update comment.
4659 (class Sized_relobj::local_dynsym_offset_): Update comment.
4660 * options.cc (Input_arguments::add_file): Remove const.
4661 * options.h (Input_file_argument::Input_file_argument):
4662 Initialize arg_serial_ (all constructors).
4663 (Input_file_argument::set_arg_serial): New function.
4664 (Input_file_argument::arg_serial): New function.
4665 (Input_file_argument::arg_serial_): New data member.
4666 (Input_arguments::Input_arguments): Initialize file_count_.
4667 (Input_arguments::add_file): Remove const.
4668 (Input_arguments::number_of_input_files): New function.
4669 (Input_arguments::file_count_): New data member.
4670 (Command_line::number_of_input_files): Call
4671 Input_arguments::number_of_input_files.
4672 * output.cc (Output_segment_headers::Output_segment_headers):
4673 Set current size.
4674 (Output_section::Input_section::current_data_size): New function.
4675 (Output_section::Output_section): Initialize new data members.
4676 (Output_section::add_input_section): Don't do merge sections for
4677 an incremental link; allocate space from free list for an
4678 incremental update.
4679 (Output_section::add_output_section_data): Allocate space from
4680 free list for an incremental update.
4681 (Output_section::update_data_size): New function.
4682 (Output_section::set_fixed_layout): New function.
4683 (Output_section::reserve): New function.
4684 (Output_segment::set_section_addresses): Remove const.
4685 (Output_segment::set_section_list_addresses): Remove const; allocate
4686 space from free list for an incremental update.
4687 (Output_segment::set_offset): Adjust size of RELRO segment for an
4688 incremental update.
4689 * output.h (Output_data::current_data_size): Move here from
4690 child classes.
4691 (Output_data::pre_finalize_data_size): New function.
4692 (Output_data::update_data_size): New function.
4693 (Output_section_headers::update_data_size): new function.
4694 (Output_section_data_build::current_data_size): Move to Output_data.
4695 (Output_data_strtab::update_data_size): New function.
4696 (Output_section::current_data_size): Move to Output_data.
4697 (Output_section::set_fixed_layout): New function.
4698 (Output_section::has_fixed_layout): New function.
4699 (Output_section::reserve): New function.
4700 (Output_section::update_data_size): New function.
4701 (Output_section::has_fixed_layout_): New data member.
4702 (Output_section::free_list_): New data member.
4703 (Output_segment::set_section_addresses): Remove const.
4704 (Output_segment::set_section_list_addresses): Remove const.
4705 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
4706 New function.
4707 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
4708 New function.
4709 * readsyms.cc (Read_symbols::do_read_symbols): Add library
4710 parameter when calling Add_symbols constructor; store argument
4711 serial number for members of a lib group.
4712 (Add_symbols::locks): Allow case where token == NULL.
4713 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
4714 (Read_member::~Read_member): New function.
4715 (Read_member::is_runnable): New function.
4716 (Read_member::locks): New function.
4717 (Read_member::run): New function.
4718 (Check_script::~Check_script): New function.
4719 (Check_script::is_runnable): New function.
4720 (Check_script::locks): New function.
4721 (Check_script::run): New function.
4722 (Check_library::~Check_library): New function.
4723 (Check_library::is_runnable): New function.
4724 (Check_library::locks): New function.
4725 (Check_library::run): New function.
4726 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
4727 (Add_symbols::library_): New data member.
4728 (class Read_member): New class.
4729 (class Check_script): New class.
4730 (class Check_library): New class.
4731 * reloc.cc (Read_relocs::is_runnable): Allow case where
4732 token == NULL.
4733 (Read_relocs::locks): Likewise.
4734 (Scan_relocs::locks): Likewise.
4735 (Relocate_task::locks): Likewise.
4736 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
4737 to clear counters.
4738 (Sized_relobj::incremental_relocs_scan): Fix comment.
4739 (Sized_relobj::do_relocate): Pass output file offset to
4740 write_local_symbols.
4741 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
4742 from class declaration.
4743 * script.cc (read_input_script): Allocate Script_info; pass
4744 argument serial number to report_script.
4745 * script.h (class Script_info): Move to incremental.h.
4746 * symtab.cc (Symbol_table::add_from_incrobj): New function.
4747 * symtab.h (Symbol_table::add_from_incrobj): New function.
4748 (Symbol_table::set_file_offset): New function.
4749
b961d0d7
CC
47502011-04-05 Cary Coutant <ccoutant@google.com>
4751
4752 * incremental-dump.cc (dump_incremental_inputs): Change signature
4753 to take a Sized_incremental_binary; change caller. Use readers
4754 in Sized_incremental_binary.
4755 * incremental.cc
4756 (Sized_incremental_binary::find_incremental_inputs_sections):
4757 Rename do_find_incremental_inputs_sections to this.
4758 (Sized_incremental_binary::setup_readers): New function.
4759 (Sized_incremental_binary::do_check_inputs): Check
4760 has_incremental_info_ flag; move setup code to setup_readers;
4761 use input readers.
4762 (Sized_incremental_binary::do_file_is_unchanged): New function.
4763 (Sized_incremental_binary::do_get_input_reader): New function.
4764 * incremental.h (class Incremental_binary): Move to end of file.
4765 (Incremental_binary::file_is_unchanged): New function.
4766 (Incremental_binary::do_file_is_unchanged): New function.
4767 (Incremental_binary::Input_reader): New class.
4768 (Incremental_binary::get_input_reader): New function.
4769 (class Sized_incremental_binary): Move to end of file.
4770 (Sized_incremental_binary::Sized_incremental_binary): Setup the
4771 input section reader classes.
4772 (Sized_incremental_binary::has_incremental_info): New function.
4773 (Sized_incremental_binary::inputs_reader): New function.
4774 (Sized_incremental_binary::symtab_reader): New function.
4775 (Sized_incremental_binary::relocs_reader): New function.
4776 (Sized_incremental_binary::got_plt_reader): New function.
4777 (Sized_incremental_binary::do_file_is_unchanged): New function.
4778 (Sized_incremental_binary::Sized_input_reader): New class.
4779 (Sized_incremental_binary::get_input_reader): New function.
4780 (Sized_incremental_binary::find_incremental_inputs_sections):
4781 Rename do_find_incremental_inputs_sections to this.
4782 (Sized_incremental_binary::setup_readers): New function.
4783 (Sized_incremental_binary::has_incremental_info_): New data member.
4784 (Sized_incremental_binary::inputs_reader_): New data member.
4785 (Sized_incremental_binary::symtab_reader_): New data member.
4786 (Sized_incremental_binary::relocs_reader_): New data member.
4787 (Sized_incremental_binary::got_plt_reader_): New data member.
4788 (Sized_incremental_binary::current_input_file_): New data member.
4789
a869183f
PP
47902011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
4791
4792 PR gold/12640
4793 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
4794 violation.
4795
47962011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
4797
4798 * archive.cc (Archive::include_member): Adjust call to report_object.
4799 (Add_archive_symbols::run): Add script_info to call to
4800 report_archive_begin.
4801 (Lib_group::include_member): Adjust call to report_object.
4802 (Add_lib_group_symbols::run): Adjust call to report_object.
4803 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
4804 blocks. Add object count for script input files.
4805 * incremental.cc (Incremental_inputs::report_archive_begin): Add
4806 script_info parameter; change all callers.
4807 (Incremental_inputs::report_object): Add script_info parameter;
4808 change all callers.
4809 (Incremental_inputs::report_script): Store backpointer to
4810 incremental info entry.
4811 (Output_section_incremental_inputs::set_final_data_size): Record
4812 additional information for scripts.
4813 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4814 * incremental.h (Incremental_script_entry::add_object): New function.
4815 (Incremental_script_entry::get_object_count): New function.
4816 (Incremental_script_entry::get_object): New function.
4817 (Incremental_script_entry::objects_): New data member; adjust
4818 constructor.
4819 (Incremental_inputs::report_archive_begin): Add script_info parameter.
4820 (Incremental_inputs::report_object): Add script_info parameter.
4821 (Incremental_inputs_reader::get_object_count): New function.
4822 (Incremental_inputs_reader::get_object_offset): New function.
4823 * options.cc (Input_arguments::add_file): Return reference to
4824 new input argument.
4825 * options.h (Input_argument::set_script_info): New function.
4826 (Input_argument::script_info): New function.
4827 (Input_argument::script_info_): New data member; adjust all
4828 constructors.
4829 (Input_file_group::add_file): Return reference to new input argument.
4830 (Input_file_lib::add_file): Likewise.
4831 (Input_arguments::add_file): Likewise.
4832 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
4833 * script.cc (Parser_closure::Parser_closure): Add script_info
4834 parameter; adjust all callers.
4835 (Parser_closure::script_info): New function.
4836 (Parser_closure::script_info_): New data member.
4837 (read_input_script): Report scripts earlier to incremental info.
4838 (script_add_file): Set script_info in Input_argument.
4839 (script_add_library): Likewise.
4840 * script.h (Script_options::Script_info): Rewrite class.
4841
a869183f 48422011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
4843
4844 * archive.cc (Library_base::should_include_member): Move
4845 method here from class Archive.
4846 (Archive::Archive): Initialize base class.
4847 (Archive::should_include_member): Move to base class.
4848 (Archive::do_for_all_unused_symbols): New function.
4849 (Add_archive_symbols::run): Remove redundant access to
4850 incremental_inputs.
4851 (Lib_group::Lib_group): Initialize base class.
4852 (Lib_group::do_filename): New function.
4853 (Lib_group::include_member): Pass pointer to Lib_group to
4854 report_object.
4855 (Lib_group::do_for_all_unused_symbols): New function.
4856 (Add_lib_group_symbols::run): Report archive information for
4857 incremental links.
4858 * archive.h (class Library_base): New base class.
4859 (class Archive): Derive from Library_base.
4860 (Archive::filename): Move to base class.
4861 (Archive::set_incremental_info): Likewise.
4862 (Archive::incremental_info): Likewise.
4863 (Archive::Should_include): Likewise.
4864 (Archive::should_include_member): Likewise.
4865 (Archive::Armap_entry): Remove.
4866 (Archive::Unused_symbol_iterator): Remove.
4867 (Archive::unused_symbols_begin): Remove.
4868 (Archive::unused_symbols_end): Remove.
4869 (Archive::do_filename): New function.
4870 (Archive::do_get_mtime): New function.
4871 (Archive::do_for_all_unused_symbols): New function.
4872 (Archive::task_): Move to base class.
4873 (Archive::incremental_info_): Likewise.
4874 (class Lib_group): Derive from Library_base.
4875 (Lib_group::do_filename): New function.
4876 (Lib_group::do_get_mtime): New function.
4877 (Lib_group::do_for_all_unused_symbols): New function.
4878 (Lib_group::task_): Move to base class.
4879 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
4880 function.
4881 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
4882 function.
4883 * incremental.cc (Incremental_inputs::report_archive_begin):
4884 Use Library_base; call library's get_mtime; add incremental inputs
4885 entry before members.
4886 (class Unused_symbol_visitor): New class.
4887 (Incremental_inputs::report_archive_end): Use Library_base; use
4888 visitor class to record unused symbols; don't add incremental inputs
4889 entry after members.
4890 (Incremental_inputs::report_object): Use Library_base.
4891 * incremental.h
4892 (Incremental_archive_entry::Incremental_archive_entry): Remove
4893 unused Archive parameter.
4894 (Incremental_inputs::report_archive_begin): Use Library_base.
4895 (Incremental_inputs::report_archive_end): Likewise.
4896 (Incremental_inputs::report_object): Likewise.
4897 * object.cc (Sized_relobj::do_for_all_global_symbols): New
4898 function.
4899 * object.h (Object::for_all_global_symbols): New function.
4900 (Object::do_for_all_global_symbols): New function.
4901 (Sized_relobj::do_for_all_global_symbols): New function.
4902 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
4903 function.
4904 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
4905 function.
4906
61ab3e40
ILT
49072011-03-27 Ian Lance Taylor <iant@google.com>
4908
4909 * archive.cc (Archive::interpret_header): Return -1 if something
4910 goes wrong. Change callers accordingly.
4911
30e1f9e6
CC
49122011-03-25 Cary Coutant <ccoutant@google.com>
4913
4914 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
4915 * testsuite/Makefile.in: Regenerate.
4916
9370ce59 49172011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
4918
4919 * plugin.cc (get_view): New.
4920 (Plugin::load): Pass get_view to the plugin.
4921 (Plugin_manager::get_view): New.
4922
9312bb0a
ILT
49232011-03-21 Ian Lance Taylor <iant@google.com>
4924
4925 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 4926 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 4927
7e12ba9e
ST
49282011-03-21 Sriraman Tallam <tmsriram@google.com>
4929
4930 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
4931 Change == to -eq.
4932 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
4933 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
4934 Change == to -eq.
4935 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
4936 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
4937
fd7a005d
ILT
49382011-03-14 Ian Lance Taylor <iant@google.com>
4939
4940 * script-sections.cc (Sort_output_sections::script_compare):
4941 Rename from is_before, change return type.
4942 (Sort_output_sections::operator()): Adjust accordingly.
4943
ed16fd1b
ILT
49442011-03-11 Jeffrey Yasskin <jyasskin@google.com>
4945
4946 PR gold/12572
4947 * testsuite/odr_violation2.cc: Add comment to make all error line
4948 numbers double digits.
4949 * testsuite/debug_msg.sh: Adjust expected errors.
4950
71ff8986
ILT
49512011-03-09 Jeffrey Yasskin <jyasskin@google.com>
4952
4953 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
4954 but mark earlier ones as non-canonical
4955 (offset_to_iterator): Update search target and example
4956 (do_addr2line): Return extra lines in a vector*
4957 (format_file_lineno): Extract from do_addr2line
4958 (one_addr2line): Add vector* out-param
4959 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
4960 when a lineno entry appeared last for its instruction
4961 (Dwarf_line_info): Add vector* out-param
4962 * object.cc (Relocate_info): Pass NULL for the vector* out-param
4963 * symtab.cc (Odr_violation_compare): Include the lineno in the
4964 comparison again.
4965 (linenos_from_loc): New. Combine the canonical line for an
4966 address with its other lines.
4967 (True_if_intersect): New. Helper functor to make
4968 std::set_intersection a query.
4969 (detect_odr_violations): Compare sets of lines instead of just
4970 one line for each function. This became less deterministic, but
4971 has fewer false positives.
4972 * symtab.h: Declarations.
4973 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
4974 mix an optimized and non-optimized object in the same binary
4975 (odr_violation2.so): Same.
4976 * testsuite/Makefile.in: Regenerate from Makefile.am.
4977 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
4978 * testsuite/debug_msg.sh: Update line numbers and add
4979 assertions.
4980 * testsuite/odr_violation1.cc: Use OdrDerived, in a
4981 non-optimized context.
4982 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
4983 isn't inlined, and use OdrDerived in an optimized context.
4984 * testsuite/odr_header1.h: Defines OdrDerived, where
4985 optimization will change the
4986 first-instruction-in-the-destructor's file and line number.
4987 * testsuite/odr_header2.h: Defines OdrBase.
4988
a19fefdc
ILT
49892011-03-09 Ian Lance Taylor <iant@google.com>
4990
4991 * fileread.cc (File_read::clear_views): Don't delete the whole
4992 file view.
4993
ecb351e9
ILT
49942011-03-08 Ian Lance Taylor <iant@google.com>
4995
4996 PR gold/12525
4997 * fileread.cc: #include <climits>.
4998 (GOLD_IOV_MAX): Define.
4999 (File_read::read_multiple): Limit number of entries by iov_max.
5000 * fileread.h (class File_read): Always set max_readv_entries to
5001 128.
5002
b821d13c
ILT
50032011-03-07 Ian Lance Taylor <iant@google.com>
5004
5005 PR gold/12525
5006 * options.h (class General_options): Add -dy and -dn.
5007
89243142
CC
50082011-03-02 Cary Coutant <ccoutant@google.com>
5009
5010 * testsuite/script_test_9.t: Add TLS segment.
5011
d0773f31
ILT
50122011-03-02 Simon Baldwin <simonb@google.com>
5013
5014 * configure.ac: Add check for gnu_indirect_function support in
5015 the toolchain building binutils.
5016 * configure: Rebuild.
5017
9370ce59 50182011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
5019
5020 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
5021 plugin only symbols.
5022 (Symbol_table::sized_finalize_symbol) Mark symbol only present
5023 in plugin files as not needed in the symbol table.
5024
4cf7a849
ST
50252011-02-11 Sriraman Tallam <tmsriram@google.com>
5026
5027 * output.cc (Output_section::add_input_section): Delay fill
5028 generation for section ordering.
5029
b578bd7d
ILT
50302011-02-09 Ian Lance Taylor <iant@google.com>
5031
5032 PR gold/12316
5033 * object.h (class Sized_relobj): Remove clear_local_symbols.
5034 * reloc.cc (Sized_relobj::do_relocate): Don't call
5035 clear_local_symbols.
5036
9370ce59 50372011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
5038
5039 * plugin.cc (is_visible_from_outside): Return true for symbols
5040 in the -u option.
5041
55382fb7
ILT
50422011-02-04 Jeffrey Yasskin <jyasskin@google.com>
5043
5044 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
5045 filename.
5046
4e271fff
ST
50472011-02-02 Sriraman Tallam <tmsriram@google.com>
5048
5049 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 5050 to std::string.
4e271fff 5051 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 5052 section_name to be std::string.
4e271fff
ST
5053 (is_function_ctor_or_dtor): Change type of parameter to std::string.
5054
d433c3ac
ILT
50552011-01-25 Ian Lance Taylor <iant@google.com>
5056
5057 * script.cc (script_add_extern): Rewrite to use
5058 add_symbol_reference.
5059
880473a6
DK
50602011-01-25 Doug Kwan <dougkwan@google.com>
5061
d433c3ac 5062 * icf.cc (get_section_contents): Always lock section's object.
880473a6 5063
f30f86fa
ILT
50642011-01-24 Ian Lance Taylor <iant@google.com>
5065
5066 * options.h (class General_options): Accept
5067 --no-detect-odr-violations.
5068
8e51a0b9
ILT
50692011-01-24 Ian Lance Taylor <iant@google.com>
5070
5071 * version.cc (version_string): Bump to 1.11.
5072
0f3b89d8
ILT
50732011-01-24 Ian Lance Taylor <iant@google.com>
5074
5075 * plugin.cc (class Plugin_rescan): Define new class.
5076 (Plugin_manager::claim_file): Set any_claimed_.
5077 (Plugin_manager::save_archive): New function.
5078 (Plugin_manager::save_input_group): New function.
5079 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
5080 necessary.
5081 (Plugin_manager::new_undefined_symbol): New function.
5082 (Plugin_manager::rescan): New function.
5083 (Plugin_manager::rescannable_defines): New function.
5084 (Plugin_manager::add_input_file): Set any_added_.
5085 * plugin.h (class Plugin_manager): define new fields rescannable_,
5086 undefined_symbols_, any_claimed_, and any_added_. Declare
5087 Plugin_rescan as friend. Declare new functions.
5088 (Plugin_manager::Rescannable): Define type.
5089 (Plugin_manager::Rescannable_list): Define type.
5090 (Plugin_manager::Undefined_symbol_list): Define type.
5091 (Plugin_manager::Plugin_manager): Initialize new fields.
5092 * archive.cc (Archive::defines_symbol): New function.
5093 (Add_archive_symbols::run): Pass archive to plugins if any.
5094 * archive.h (class Archive): Declare defines_symbol.
5095 * readsyms.cc (Input_group::~Input_group): New function.
5096 (Finish_group::run): Pass input_group to plugins if any.
5097 * readsyms.h (class Input_group): Declare destructor.
5098 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
5099 any.
5100
3bb951e5
ILT
51012011-01-10 Ian Lance Taylor <iant@google.com>
5102
5103 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
5104 section as relro.
5105 (Layout::set_segment_offsets): Reset increase_relro before calling
5106 set_section_addresses a second time.
5107
0aa45fac
CC
51082011-01-04 Cary Coutant <ccoutant@google.com>
5109
5110 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
5111 sections before NOBITS sections.
5112
0db46eb4
L
51132011-01-01 H.J. Lu <hongjiu.lu@intel.com>
5114
5115 * version.cc (print_version): Update copyright to 2011.
5116
829c9745
CC
51172010-12-23 Cary Coutant <ccoutant@google.com>
5118
5119 * output.h (Output_data_reloc::add_output_section): Pass OD instead
5120 of OS to this->add. Add OD parameter to second form of the function.
5121
7500420b
ILT
51222010-12-20 Ian Lance Taylor <iant@google.com>
5123
5124 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
5125 second of two consecutive entries with same offset.
5126
f8e9a930
RW
51272010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5128
5129 * testsuite/Makefile.am (ifuncmain2static_LDADD)
5130 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
5131 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
5132 to avoid unneeded links against $(LDADD).
5133 * testsuite/Makefile.in: Regenerate.
5134
2fbb4320
ILT
51352010-12-15 Ian Lance Taylor <iant@google.com>
5136
5137 PR gold/12324
5138 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
5139 for R_X86_64_32 and R_X86_64_PC32.
5140 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
5141 ver_matching_def_pic.o.
5142 (ver_matching_def_pic.o): New target.
5143
fedb228d
RW
51442010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5145
5146 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
5147 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
5148 Move definition before File_read::View member definitions.
5149 (File_read::View::~View): Initialize and hold lock before
5150 updating current_mapped_bytes.
5151
9b547ce6
RW
51522010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5153
5154 * dwarf_reader.cc: Remove outdated comment.
5155 * gold-threads.cc: Fix typo in error message.
5156 * archive.cc: Fix typos in comments.
5157 * archive.h: Likewise.
5158 * arm-reloc-property.cc: Likewise.
5159 * arm-reloc-property.h: Likewise.
5160 * arm-reloc.def: Likewise.
5161 * arm.cc: Likewise.
5162 * attributes.h: Likewise.
5163 * cref.cc: Likewise.
5164 * ehframe.cc: Likewise.
5165 * fileread.h: Likewise.
5166 * gold.h: Likewise.
5167 * i386.cc: Likewise.
5168 * icf.cc: Likewise.
5169 * incremental.h: Likewise.
5170 * int_encoding.cc: Likewise.
5171 * layout.h: Likewise.
5172 * main.cc: Likewise.
5173 * merge.h: Likewise.
5174 * object.cc: Likewise.
5175 * object.h: Likewise.
5176 * options.cc: Likewise.
5177 * readsyms.cc: Likewise.
5178 * reduced_debug_output.cc: Likewise.
5179 * reloc.cc: Likewise.
5180 * script-sections.cc: Likewise.
5181 * sparc.cc: Likewise.
5182 * symtab.h: Likewise.
5183 * target-reloc.h: Likewise.
5184 * target.cc: Likewise.
5185 * target.h: Likewise.
5186 * timer.cc: Likewise.
5187 * timer.h: Likewise.
5188 * x86_64.cc: Likewise.
5189
83e17bd5
CC
51902010-12-09 Cary Coutant <ccoutant@google.com>
5191
5192 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
5193 stack.
5194 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
5195 parameter; change all callers.
5196 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
5197 * options.h (warn_execstack): New option.
5198
017257f8
DK
51992010-12-07 Doug Kwan <dougkwan@google.com>
5200
5201 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
5202 like function call relocations.
5203
c20cbc06
ILT
52042010-12-07 Ian Lance Taylor <iant@google.com>
5205
5206 * archive.cc (Archive::get_elf_object_for_member): Permit
5207 punconfigured to be NULL.
5208 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
5209 (Archive::include_member): Pass NULL to get_elf_object_for_member
5210 if we searched for the archive and this is the first included
5211 object.
5212
4dbfafcc
ILT
52132010-12-01 Ian Lance Taylor <iant@google.com>
5214
5215 * dwarf_reader.h (class Sized_dwarf_line_info): Add
5216 track_relocs_type_ field.
5217 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5218 Set track_relocs_type_.
5219 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
5220 contents when using RELA relocs.
5221 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
5222 reloc_map_.
5223 * reloc.cc (Track_relocs::next_addend): New function.
5224 * reloc.h (class Track_relocs): Declare next_addend.
5225
e5e19edd
ILT
52262010-12-01 Ian Lance Taylor <iant@google.com>
5227
5228 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
5229 virtual destructor.
5230
9a5ce24c
ILT
52312010-12-01 Ian Lance Taylor <iant@google.com>
5232
5233 * README: Update compilers known to work and fail.
5234
c7791212
NC
52352010-11-23 Matthias Klose <doko@ubuntu.com>
5236
5237 * configure.in: For --enable-gold, handle value `default' instead of
5238 `both*'. Always install ld as ld.bfd, install as ld if gold is
5239 not the default.
5240 * configure: Regenerate.
5241
0ad220c9
DK
52422010-11-18 Doug Kwan <dougkwan@google.com>
5243
5244 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
5245 and right_alignment to be zero. Store result alignment only if it is
5246 greater than existing alignment.
5247
ab8056e0
CC
52482010-11-16 Cary Coutant <ccoutant@google.com>
5249
5250 PR gold/12220
5251 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5252 Check for ".zdebug_line".
5253
fd064a5b
CC
52542010-11-16 Doug Kwan <dougkwan@google.com>
5255 Cary Coutant <ccoutant@google.com>
5256
5257 * output.h (Output_segment::set_section_addresses): Pass increase_relro
5258 by reference; adjust all callers.
5259 * output.cc (Output_segment::set_section_addresses): Adjust references
5260 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
5261 list is empty.
5262 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
5263 end at page boundary.
5264
6fc6ea19
CC
52652010-11-16 Cary Coutant <ccoutant@google.com>
5266
5267 PR gold/12220
5268 * layout.cc (Layout::choose_output_section): Transform names of
5269 compressed sections even when using a script with a SECTIONS clause.
5270 (Layout::output_section_name): Remove code to transform
5271 compressed debug section names.
5272 * output.cc (Output_section::add_input_section): Use uncompressed
5273 section size when tracking input sections.
5274
95a2c8d6
RS
52752010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
5276
5277 * symtab.h (Symbol::NON_PIC_REF): Remove.
5278 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
5279 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
5280 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
5281 (Symbol::use_plt_offset): Take a flags argument and pass it
5282 directly to needs_dynamic_reloc. Restrict check for undefined
5283 weak symbols to function calls.
5284 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
5285 (Target_arm::Scan::global): Use it.
5286 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
5287 (Target_arm::Relocate::relocate): Likewise.
5288 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
5289 parameter with an r_type parameter. Use get_reference_flags
5290 to get the flags.
5291 (Target_arm::Relocate::relocate): Update accordingly.
5292 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
5293 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
5294 (Target_i386::Scan::global): Likewise.
5295 (Target_i386::Relocate::relocate): Likewise.
5296 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
5297 parameter with an r_type parameter. Use get_reference_flags
5298 to get the flags.
5299 (Target_i386::Relocate::relocate): Update accordingly.
5300 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
5301 (Target_powerpc::Scan::global): Use it.
5302 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
5303 (Target_powerpc::Relocate::relocate): Likewise.
5304 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
5305 (Target_sparc::Scan::global): Use it.
5306 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
5307 (Target_sparc::Relocate::relocate): Likewise.
5308 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
5309 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
5310 (Target_x86_64::Scan::global): Likewise.
5311 (Target_x86_64::Relocate::relocate): Likewise.
5312
f625ae50
DK
53132010-11-08 Doug Kwan <dougkwan@google.com>
5314 Cary Coutant <ccoutant@google.com>
5315
5316 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
5317 (Arm_exidx_merge_section::section_contents_): New data member.
5318 (Arm_input_section::Arm_input_section): Initialize original_contents_.
5319 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 5320 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
5321 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
5322 in parameters instead of calling Object::section_contents without
5323 locking.
5324 (Arm_output_section::group_section): New parameter TASK. Pass it
5325 to callees that need locking objects.
5326 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
5327 to lock EXIDX input sections. Fix a formatting issue. Call
5328 Arm_exidx_merged_section::build_contents to create merged section
5329 contents.
5330 (Arm_output_section::create_stub_group): New parameter TASK. Use it
5331 to lock object of stub table owner.
5332 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
5333 TEXT_SIZE to initialize data member TEXT_SIZE_.
5334 (Arm_exidx_input_section::addralign): Fix typo in comment.
5335 (Arm_exidx_input_section::text_size): New method.
5336 (Target_arm::do_relax): New parameter TASK. Pass it to callees
5337 that require locking objects. Lock objects before scanning for stubs
5338 and updating local symbols.
5339 (Arm_input_section<big_endian>::init): Copy contents of original
5340 input section.
2e702c99 5341 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
5342 original input section instead of calling Object::section_contents
5343 without locking.
5344 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
5345 size without calling Object::section_size().
5346 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
5347 for size. Allocate a buffer for merged EXIDX entries.
5348 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 5349 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
5350 building code to Arm_exidx_merged_section::build_contetns. Write
5351 out contetns in buffer instead of building it on the fly.
5352 (Arm_relobj::make_exidx_input_section): Also pass text section size
5353 to Arm_exidx_input_section constructor.
5354 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
5355 (Arm_dynobj::do_read_symbols): Fix memory leak.
5356 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
5357 * target.h: (class Task): Add forward declaration.
5358 (Target::relax): Add new parameter TASK and pass it to
5359 Target::do_relax().
5360 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
5361
5f9bcf58
CC
53622010-11-05 Cary Coutant <ccoutant@google.com>
5363
5364 PR gold/10708
5365 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
5366 object when reading from the file.
5367 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
5368 second layout pass.
5369 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
5370 when reading section contents.
5371 (get_section_contents): Likewise.
5372 (icf::find_identical_sections): Likewise.
5373 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
5374 object when reading from the file.
5375 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
5376 the object when doing deferred section layout.
5377
e597fa08
NC
53782010-11-03 Nick Clifton <nickc@redhat.com>
5379
5380 PR gold/12001
5381 * script.h (class Symbol_assignment: name): New member. Returns
5382 the name of the symbol.
5383 * scrfipt.cc (Script_options::is_pending_assignment): New member.
5384 Returns true if the given symbol name is on the list of
5385 assignments wating to be processed.
5386 * archive.cc (should_incldue_member): If the symbol is undefined,
5387 check to see if it is on the list of symbols pending assignment.
5388
3f9a3278
ILT
53892010-11-03 Ryan Mansfield <rmansfield@qnx.com>
5390
5391 * script-sections.cc (Script_sections::find_memory_region): Check
5392 for a NULL output section pointer.
5393
d06fb4d1
DK
53942010-10-29 Doug Kwan <dougkwan@google.com>
5395
5396 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
5397 Output_section::add_relaxed_input_section.
5398 * output.cc (Output_section::add_relaxed_input_section): Add new
5399 arguments LAYOUT and NAME. Set section order index.
5400 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5401 Copy section order index.
5402 * output.h (Output_section::add_relaxed_input_section): Add new
5403 arguments LAYOUT and NAME.
5404
90e24de5
ILT
54052010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5406
5407 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 5408 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
5409 * testsuite/Makefile.in: Regenerate.
5410
c9484ea5
DK
54112010-10-20 Doug Kwan <dougkwan@google.com>
5412
5413 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
5414 without SHF_LINK_ORDER flags.
5415 * layout.cc (Layout::choose_output_section): Do not filter
5416 SHF_LINK_ORDER flag in a relocatable link.
5417
5bc2f5be
CC
54182010-10-17 Cary Coutant <ccoutant@google.com>
5419
5420 * output.h (Output_segment::set_section_addresses): Change function
5421 signature. Update all callers.
5422 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
5423 sections.
5424 (Output_segment::set_section_addresses): Align after last TLS
5425 section. Add padding before last relro section instead of after.
5426
0c91cf04
DK
54272010-10-17 Doug Kwan <dougkwan@google.com>
5428
5429 * gold/arm.cc (Target_arm::got_section): Use correct order and set
5430 GOT output section to be writable.
5431
8c21d9d3
CC
54322010-10-14 Cary Coutant <ccoutant@google.com>
5433
5434 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
5435 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
5436 * gold.cc (queue_initial_tasks): Check parameters for incremental link
5437 mode.
5438 * incremental.cc (report_command_line): Ignore all forms of
5439 --incremental.
5440 * layout.cc (Layout::Layout): Check parameters for incremental link
5441 mode.
5442 * options.cc (General_options::parse_incremental): New function.
5443 (General_options::parse_no_incremental): New function.
5444 (General_options::parse_incremental_full): New function.
5445 (General_options::parse_incremental_update): New function.
5446 (General_options::incremental_mode_): New data member.
5447 (General_options::finalize): Check incremental_mode_.
5448 * options.h (General_options): Update help text for --incremental.
5449 Add --no-incremental, --incremental-full, --incremental-update.
5450 (General_options::Incremental_mode): New enum type.
5451 (General_options::incremental_mode): New function.
5452 (General_options::incremental_mode_): New data member.
5453 * parameters.cc (Parameters::incremental_mode_): New data member.
5454 (Parameters::set_options): Set incremental_mode_.
5455 (Parameters::set_incremental_full): New function.
5456 (Parameters::incremental): New function.
5457 (Parameters::incremental_update): New function.
5458 (set_parameters_incremental_full): New function.
5459 * parameters.h (Parameters::set_incremental_full): New function.
5460 (Parameters::incremental): New function.
5461 (Parameters::incremental_update): New function.
5462 (Parameters::incremental_mode_): New data member.
5463 (set_parameters_incremental_full): New function.
5464 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
5465 incremental link mode.
5466 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
5467 (Sized_relobj::do_relocate_sections): Likewise.
5468 * testsuite/Makefile.am (incremental_test): Use --incremental-full
5469 option.
5470 * testsuite/Makefile.in: Regenerate.
5471 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 5472
bb32aa18 54732010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
5474
5475 * script-sections.h (class Script_sections): Make
5476 Sections_elements typedef public.
5477 * script-sections.cc (class Sort_output_sections): Add elements_
5478 field. Add constructor which sets it; change all callers.
5479 (Sort_output_sections::is_before): New function.
5480 (Sort_output_sections::operator()): Call is_before.
5481 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
5482 conditional.
5483 * testsuite/script_test_10.sh: New test. Test script section
5484 order.
5485 * testsuite/script_test_10.t: Likewise.
5486 * testsuite/script_test_10.s: Likewise.
5487 * testsuite/Makefile.am: Wrap the cross linker tests and the
5488 common tests into NATIVE_OR_CROSS_LINKER.
5489 (check_SCRIPTS): Add script_test_10.sh.
5490 (check_DATA): Add script_test_10.stdout.
5491 (script_test_10.o, script_test_10): New targets.
5492 (script_test_10.stdout): New target.
5493 * configure, testsuite/Makefile.in: Regenerate.
5494
3cef7179
ILT
54952010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5496
5497 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
5498 error for the deprecated relocations.
5499 (Target_arm::Scan::global): Likewise.
5500 (Target_arm::Relocate::relocate): Likewise.
5501
7411e9a8
RS
55022010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
5503
5504 * fileread.cc (Input_file::find_file): Initialize *found_name
5505 and *namep when using the fallback search for case 4.
5506
6a9da32a
CC
55072010-10-11 Cary Coutant <ccoutant@google.com>
5508
5509 * options.h (class General_options): Redefine -z lazy as an alias for
5510 the negation of -z now.
5511
ac897c20
ILT
55122010-10-11 Ian Lance Taylor <iant@google.com>
5513
5514 * resolve.cc (symbol_to_bits): Report the value of the unsupported
5515 binding.
5516
ea5cae92
NC
55172010-10-06 Nick Clifton <nickc@redhat.com>
5518
5519 * script-sections.cc(class Memory_region): Remove
5520 current_lma_offset_ field. Rename current_vma_offset_ to
5521 current_offset_. Add last_section_ field.
5522 (Memory_region::get_current_vma_address): Rename to
5523 get_current_address.
5524 (Memory_region::get_current_lma_address): Delete.
5525 (Memory_region::increment_vma_offset): Rename to
5526 increment_offset.
5527 (Memory_region::increment_lma_offset): Delete.
5528 (Memory_region::attributes_compatible): New method. Returns
5529 true if the provided section is compatible with the region.
5530 (Memory_region::get_last_section): New method. Returns the last
5531 section to use the region.
5532 (Memory_region::set_last_section): New method. Stores the last
5533 section to use the region.
5534 (Script_sections::block_in_region): New method. Returns true if
5535 a block of memory is contained within a region.
5536 (Script_sections::find_memory_region): New method. Locates a
5537 memory region to be used to set a VMA or LMA address.
5538 (Output_section_definition::set_section_addresses): Add code to
5539 check for addresses set by memory regions.
5540 (Output_segment::set_section_addresses): Remove memory region
5541 walking code.
5542 (Script_sections::create_segment): Add a warning if a header
5543 segment is created outside of any region.
5544 * script-sections.h (class Script_sections): Add prototypes for
5545 find_memory_region and block_in_region methods.
5546 * testsuite/memory_test.s: Use .long instead of .word.
5547 * testsuite/memory_test.t: Add some more output sections.
5548 * testsuite/memory_test.sh: Update expected output.
5549
a9bfd952
DK
55502010-10-02 Doug Kwan <dougkwan@google.com>
5551
5552 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
5553 defintion to symtab.h
5554 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
5555 declaration to defintion.
5556
bacff3ab
NC
55572010-10-01 Nick Clifton <nickc@redhat.com>
5558
5559 * expression.cc (eval): Replace dummy argument with NULL.
5560 (eval_maybe_dot): Check for a NULL result section pointer.
5561 (Symbol_expression::value): Likewise.
5562 (Dot_expression::value): Likewise.
5563 (BINARY_EXPRESSION): Likewise.
5564 (Max_expression::value): Likewise.
5565 (Min_expression::value): Likewise.
5566 (Absolute_expression::value): Likewise.
5567 (Addr_expression::value_from_output_section): Likewise.
5568 (Loaddddr_expression::value_from_output_section): Likewise.
5569 (Segment_start_expression::value): Likewise.
5570 * script-sections.cc
5571 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
5572 argument with NULL.
5573 (Sections_elememt_dot_assignment::set_section_addresses):
5574 Likewise.
5575 (Output_data_expression::do_write_to_buffer): Likewise.
5576 (Output_section_definition::finalize_symbols): Likewise.
5577 (Output_section_definition::set_section_addresses): Likewise.
5578
f81bc8b5
DK
55792010-09-30 Doug Kwan <dougkwan@google.com>
5580
5581 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
5582
c95e9f27
ST
55832010-09-28 Sriraman Tallam <tmsriram@google.com>
5584
5585 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 5586 function.
c95e9f27
ST
5587 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
5588 virtual function.
5589 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
5590 virtual function.
5591 * icf.cc (get_section_contents): Inline merge sections only when
5592 target allows it.
5593
3cac54d2
RW
55942010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5595
5596 * configure: Regenerate.
5597
2904037a
ILT
55982010-09-17 Ian Lance Taylor <iant@google.com>
5599
5600 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
5601 * testsuite/Makefile.am (memory_test.o): New target.
5602 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
5603 memory_test.t.
5604 * testsuite/Makefile.in: Rebuild.
2904037a 5605
bca7fb63
DK
56062010-09-17 Doug Kwan <dougkwan@google.com>
5607
5608 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
5609 defintion if relocation uses GOT entries of the symbol.
5610 * testsuite/icf_safe_test.sh: Fix test.
5611 * testsuite/icf_safe_so_test.sh: Fix test.
5612
4ef28648
CC
56132010-09-16 Cary Coutant <ccoutant@google.com>
5614
5615 * script_sections.cc (class Memory_region): Remove "NULL" from
5616 vector initializations.
5617
793990de
CC
56182010-09-15 Cary Coutant <ccoutant@google.com>
5619
5620 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
5621 Resolve forwarding symbols.
5622
81e015e2
DK
56232010-09-15 Doug Kwan <dougkwan@google.com>
5624
5625 * gold/testsuite/script_test_3.t: Add ARM special sections.
5626 * gold/testsuite/script_test_4.t: Same.
5627 * gold/testsuite/script_test_5.t: Same.
5628 * gold/testsuite/script_test_6.t: Same.
5629 * gold/testsuite/script_test_7.t: Same.
5630 * gold/testsuite/script_test_7.t: Same.
5631 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
5632
36171d64
CC
56332010-09-14 Cary Coutant <ccoutant@google.com>
5634
5635 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
5636 (Target_x86_64::Relocate::relocate_tls): Replace check for
5637 saw_tls_block_reloc_ with test for executable section.
5638
d89051bd
CC
56392010-09-12 Cary Coutant <ccoutant@google.com>
5640
5641 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
5642 position-independent executables to shared libraries need dynamic
5643 relocations.
5644 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
5645 position-independent executables.
5646 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
5647 * testsuite/Makefile.in: Regenerate.
5648
fca41f0f
NC
56492010-09-10 Nick Clifton <nickc@redhat.com>
5650
5651 PR gold/11997
5652 * testsuite/memory_test.t: Discard any sections that are not
5653 needed.
5654
6695e4b3
L
56552010-09-09 H.J. Lu <hongjiu.lu@intel.com>
5656
5657 PR gold/11996
5658 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
5659 "This::" to work around a bug in gcc 4.2.
5660
5661 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
5662
0f72bf6f
RÁE
56632010-09-09 Rafael Espindola <espindola@google.com>
5664
5665 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
5666 sections with different PF_X flags in the same segment.
5667 (Layout::find_first_load_seg): Search all segments to find the first
5668 one.
5669 * options.h (rosegment): New.
5670
56712010-09-08 Rafael Espindola <espindola@google.com>
a6577478 5672
05a79166 5673 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 5674
aa98ff75
DK
56752010-09-08 Doug Kwan <dougkwan@google.com>
5676
5677 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
5678 (Arm_relobj::do_relocate_sections): Add new parameter for output
5679 file to match the parent.
5680 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
5681 of local symbols instead of input values. Update code to track
5682 changes in gold::relocate_section.
5683 * object.cc (Sized_relobj::compute_final_local_value): New methods.
5684 (Sized_relobj::compute_final_local_value_internal): New methods.
5685 (Sized_relobj::do_finalize_local_symbols): Move code from loop
5686 body into private version of Sized_relobj::compute_final_local_value.
5687 Call the inline method.
5688 * object.h (Symbol_value::Symbol_value): Define destructor. Free
5689 merged symbol value if there is one.
5690 (Symbol_value::has_output_value): New method defintiion.
5691 (Sized_relobj::Compute_final_local_value_status): New enum type.
5692 (Sized_relobj::compute_final_local_value): New methods.
5693 (Sized_relobj::compute_final_local_value_internal): New methods.
5694 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
5695 and arm_cortex_a8.sh.
5696 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
5697 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
5698 New tests.
5699 * Makefile.in: Regenerate.
5700 * testsuite/arm_bl_out_of_range.s: Update test.
5701 * testsuite/thumb_bl_out_of_range.s: Ditto.
5702 * testsuite/thumb_blx_out_of_range.s: Ditto.
5703 * testsuite/arm_branch_out_of_range.sh: New file.
5704 * testsuite/arm_cortex_a8.sh: Ditto.
5705 * testsuite/arm_cortex_a8_b.s: Ditto.
5706 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
5707 * testsuite/arm_cortex_a8_b_local.s: Ditto.
5708 * testsuite/arm_cortex_a8_bl.s: Ditto.
5709 * testsuite/arm_cortex_a8_blx.s: Ditto.
5710 * testsuite/arm_cortex_a8_local.s: Ditto.
5711 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
5712 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
5713
05a79166
L
57142010-09-08 Rafael Espindola <espindola@google.com>
5715
5716 * Makefile.am (memory_test.stdout): Run readelf with -W.
5717 * Makefile.in: Regenerate.
5718 * testsuite/memory_test.sh: Make the regexps accept both 32 and
5719 64 bit output.
5720
33dbc701
RÁE
57212010-09-08 Rafael Espindola <espindola@google.com>
5722
5723 * script-sections.cc (Script_sections::add_memory_region): Convert
5724 field precision to int.
5725 * script.cc (script_set_section_region, script_set_section_region):
5726 Convert field precision to int.
5727
731ca54a
RÁE
57282010-09-08 Rafael Espindola <espindola@google.com>
5729
5730 * arm.cc (do_finalize_sections): Create the __exidx_start and
5731 __exdix_end symbols even when the section is missing.
5732
7f8cd844
NC
57332010-09-08 Nick Clifton <nickc@redhat.com>
5734
5735 * README: Remove claim that MEMORY is not supported.
5736 * expression.cc (script_exp_function_origin)
5737 (script_exp_function_length): Move from here to ...
5738 * script.cc: ... here.
5739 (script_set_section_region, script_add_memory)
5740 (script_parse_memory_attr, script_include_directive): New
5741 functions.
5742 * script-sections.cc
5743 (class Memory_region): New class.
5744 (class Output_section_definition): Add set_memory_region,
5745 set_section_vma, set_section_lma and get_section_name methods.
5746 (class Script_Sections): Add add_memory_region,
5747 find_memory_region, find_memory_region_origin,
5748 find_memory_region_length and set_memory_region methods.
5749 Have set_section_addresses method walk the list of set memory
5750 regions.
5751 Extend the print methos to display memory regions.
5752 * script-sections.h: Add prototypes for new methods.
5753 Add enum for MEMORY region attributes.
5754 * yyscript.y: Add support for parsing MEMORY regions.
5755 * script-c.h: Add prototypes for new functions.
5756 * testsuite/Makefile.am: Add test of MEMORY region functionality.
5757 * testsuite/Makefile.in: Regenerate.
5758 * testsuite/memory_test.sh: New script.
5759 * testsuite/memory_test.s: New assembler source file.
5760 * testsuite/memory_test.t: New linker script.
5761
a4649286
DK
57622010-08-27 Doug Kwan <dougkwan@google.com>
5763
5764 * gold/resolve.cc (Symbol_table::should_override): Let a weak
5765 reference override an existing dynamic weak reference.
5766 * testsuite/Makefile.am: Add new test dyn_weak_ref.
5767 * testsuite/Makefile.in: Regenerate.
5768 * testsuite/dyn_weak_ref.sh: New file.
5769 * testsuite/dyn_weak_ref_1.c: Ditto.
5770 * testsuite/dyn_weak_ref_2.c: Ditto.
5771
b56648ad
ILT
57722010-08-27 Ian Lance Taylor <iant@google.com>
5773
5774 * incremental.h (class Incremental_input_entry): Add virtual
5775 destructor.
5776
809313cb
ILT
57772010-08-27 Ian Lance Taylor <iant@google.com>
5778
5779 * testsuite/start_lib_test_3.c: Mark t3 as used.
5780
11e32464
NC
57812010-08-27 Nick Clifton <nickc@redhat.com>
5782
5783 * options.cc (version_script): Fix small typo in previous
5784 whitespace tidyup.
5785
ca09d69a
NC
57862010-08-25 Nick Clifton <nickc@redhat.com>
5787
5788 * archive.cc: Formatting fixes: Remove whitespace between
5789 typename and following asterisk. Remove whitespace between
5790 function name and opening parenthesis.
5791 * archive.h: Likewise.
5792 * arm.cc: Likewise.
5793 * attributes.cc: Likewise.
5794 * attributes.h: Likewise.
5795 * common.cc: Likewise.
5796 * copy-relocs.cc: Likewise.
5797 * dirsearch.h: Likewise.
5798 * dynobj.cc: Likewise.
5799 * ehframe.cc: Likewise.
5800 * ehframe.h: Likewise.
5801 * expression.cc: Likewise.
5802 * fileread.cc: Likewise.
5803 * fileread.h: Likewise.
5804 * gc.h: Likewise.
5805 * gold-threads.cc: Likewise.
5806 * gold.cc: Likewise.
5807 * i386.cc: Likewise.
5808 * icf.h: Likewise.
5809 * incremental-dump.cc: Likewise.
5810 * incremental.cc: Likewise.
5811 * layout.cc: Likewise.
5812 * layout.h: Likewise.
5813 * main.cc: Likewise.
5814 * merge.cc: Likewise.
5815 * merge.h: Likewise.
5816 * object.cc: Likewise.
5817 * object.h: Likewise.
5818 * options.cc: Likewise.
5819 * options.h: Likewise.
5820 * output.cc: Likewise.
5821 * output.h: Likewise.
5822 * plugin.cc: Likewise.
5823 * plugin.h: Likewise.
5824 * powerpc.cc: Likewise.
5825 * reloc.cc: Likewise.
5826 * script-c.h: Likewise.
5827 * script-sections.cc: Likewise.
5828 * script.cc: Likewise.
5829 * stringpool.cc: Likewise.
5830 * symtab.cc: Likewise.
5831 * symtab.h: Likewise.
5832 * target.cc: Likewise.
5833 * timer.cc: Likewise.
5834 * timer.h: Likewise.
5835 * version.cc: Likewise.
5836 * x86_64.cc: Likewise.
5837
b8fa8750
NC
58382010-08-24 Nick Clifton <nickc@redhat.com>
5839
5840 PR 11899
5841 * layout.cc (segment_precedes): Sort segments by their physical
5842 addresses, if they have been set.
5843
9919d93b
CC
58442010-08-23 Cary Coutant <ccoutant@google.com>
5845
5846 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
5847 symbols data.
5848 (Lib_group::include_member): Unlock object after deleting its
5849 symbols data.
5850 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
5851 the bug fixed here.
5852
97b4be1c
CC
58532010-08-19 Neil Vachharajani <nvachhar@google.com>
5854 Cary Coutant <ccoutant@google.com>
5855
5856 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
5857 constructor, and set_blocker.
5858 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
5859 readsyms_blocker_.
5860 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
5861 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
5862 * testsuite/Makefile.am (start_lib_test): New test case.
5863 * testsuite/Makefile.in: Regenerate.
5864 * testsuite/start_lib_test_main.c: New file.
5865 * testsuite/start_lib_test_1.c: New file.
5866 * testsuite/start_lib_test_2.c: New file.
5867 * testsuite/start_lib_test_3.c: New file.
5868
dd0b1884
ILT
58692010-08-19 Ian Lance Taylor <iant@google.com>
5870
5871 * Makefile.in: Rebuild with automake 1.11.1.
5872 * aclocal.m4: Likewise.
5873 * testsuite/Makefile.in: Likewise.
5874
7223e9ca
ILT
58752010-08-19 Ian Lance Taylor <iant@google.com>
5876
5877 PR 10893
5878 * i386.cc (class Output_data_plt_i386): Update declarations.
5879 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
5880 local_ifuncs_ fields.
5881 (Target_i386::do_plt_section_for_global): New function.
5882 (Target_i386::do_plt_section_for_local): New function.
5883 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
5884 parameter; change all callers. Initialize global_ifuncs_ and
5885 local_ifuncs_. If doing a static link define __rel_iplt_start and
5886 __rel_iplt_end.
5887 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
5888 (Output_data_plt_i386::add_local_ifunc_entry): New function.
5889 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
5890 symbols.
5891 (Target_i386::make_plt_section): New function, broken out of
5892 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
5893 (Target_i386::make_plt_entry): Call make_plt_section.
5894 (Target_i386::make_local_ifunc_plt_entry): New function.
5895 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
5896 (Target_i386::Scan::local): Handle IFUNC symbols. Add
5897 R_386_IRELATIVE to switch.
5898 (Target_i386::Scan::global): Likewise.
5899 (Target_i386::Relocate::relocate): Likewise.
5900 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
5901 switch.
5902 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
5903 (Target_x86_64::do_plt_section_for_global): New function.
5904 (Target_x86_64::do_plt_section_for_local): New function.
5905 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
5906 parameter; change all callers. If doing a static link define
5907 __rela_iplt_start and __rela_iplt_end.
5908 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
5909 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
5910 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
5911 to point to .plt.
5912 (Target_x86_64::make_local_ifunc_plt_entry): New function.
5913 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
5914 switch.
5915 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
5916 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
5917 R_X86_64_IRELATIVE to switch.
5918 (Target_x86_64::Scan::global): Likewise.
5919 (Target_x86_64::Relocate::relocate): Likewise.
5920 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
5921 switch.
5922 * target.h (class Target): Add plt_section_for_global and
5923 plt_section_for_local functions. Add do_plt_section_for_global
5924 and do_plt_section_for_local virtual functions.
5925 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
5926 clarifying comments.
5927 (Symbol::use_plt_offset): Handle IFUNC symbol.
5928 * object.cc (Sized_relobj::Sized_relobj): Initialize
5929 local_plt_offsets_.
5930 (Sized_relobj::local_has_plt_offset): New function.
5931 (Sized_relobj::local_plt_offset): New function.
5932 (Sized_relobj::set_local_plt_offset): New function.
5933 (Sized_relobj::do_count): Handle IFUNC symbol.
5934 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
5935 a bit away from input_shndx_ field. Add set_is_func_symbol and
5936 is_ifunc_symbol functions.
5937 (class Sized_relobj): Update declarations. Remove Tls_got_entry
5938 and Local_tls_got_offsets. Define Local_plt_offsets. Add
5939 local_plt_offsets_ field.
5940 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
5941 * output.h (class Output_section_data): Add non-const
5942 output_section function.
5943 (class Output_data_got): Update declarations.
5944 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
5945 Add use_plt_offset parameter to global and local constructors.
5946 Change all callers. Change local_sym_index_ field to 31 bits.
5947 Change GSYM_CODE and CONSTANT_CODE accordingly.
5948 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
5949 doing a static link don't set sh_link field.
5950 (Output_data_got::Got_entry::write): Use PLT offset if
5951 appropriate.
5952 (Output_data_got::add_global_plt): New function.
5953 (Output_data_got::add_local_plt): New function.
5954 * target-reloc.h (relocate_section): Handle IFUNC symbol.
5955 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
5956 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
5957 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
5958 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
5959 IFUNC conditional.
5960 * testsuite/ifunc-sel.h: New file.
5961 * testsuite/ifuncmain1.c: New file.
5962 * testsuite/ifuncmain1vis.c: New file.
5963 * testsuite/ifuncmod1.c: New file.
5964 * testsuite/ifuncdep2.c: New file.
5965 * testsuite/ifuncmain2.c: New file.
5966 * testsuite/ifuncmain3.c: New file.
5967 * testsuite/ifuncmod3.c: New file.
5968 * testsuite/ifuncmain4.c: New file.
5969 * testsuite/ifuncmain5.c: New file.
5970 * testsuite/ifuncmod5.c: New file.
5971 * testsuite/ifuncmain6pie.c: New file.
5972 * testsuite/ifuncmod6.c: New file.
5973 * testsuite/ifuncmain7.c: New file.
5974 * configure, testsuite/Makefile.in: Rebuild.
5975
56f75c03
ILT
59762010-08-18 Ian Lance Taylor <iant@google.com>
5977
5978 * incremental.cc
5979 (Output_section_incremental_inputs::write_input_files): Add cast
5980 to avoid signed/unsigned comparison warning.
5981 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5982
55455f89
CC
59832010-08-12 Cary Coutant <ccoutant@google.com>
5984
5985 * common.cc (Sort_commons::operator()): Remove unnecessary code.
5986
e2054bcb
ILT
59872010-08-13 Ian Lance Taylor <iant@google.com>
5988
5989 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
5990
74f67560
DK
59912010-08-12 Cary Coutant <ccoutant@google.com>
5992 Doug Kwan <dougkwan@google.com>
5993
5994 * resolve.cc (Symbol_table::should_override): When a weak dynamic
5995 defintion overrides non-weak undef, remember that the original undef
5996 is not weak.
5997 * symtab.cc (Symbol_table::sized_write_global): For undef without
5998 an original weak binding, set binding to global in output.
5999 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
6000 * testsuite/Makefile.in: Regenerate.
6001 * testsuite/strong_ref_weak_def.sh: New file.
6002 * testsuite/strong_ref_weak_def_1.c: Ditto.
6003 * testsuite/strong_ref_weak_def_2.c: Ditto.
6004
d1238d12
CC
60052010-08-12 Cary Coutant <ccoutant@google.com>
6006
6007 * testsuite/incremental_test.sh: Rewrite.
6008 * testsuite/incremental_test_1.c: Rewrite.
6009 * testsuite/incremental_test_2.c: Rewrite.
6010
0e70b911
CC
60112010-08-12 Cary Coutant <ccoutant@google.com>
6012
6013 * arm.cc (Target_arm::got_size): Add const.
6014 (Target_arm::got_entry_count): New function.
6015 (Target_arm::plt_entry_count): New function.
6016 (Target_arm::first_plt_entry_offset): New function.
6017 (Target_arm::plt_entry_size): New function.
6018 (Output_data_plt_arm::entry_count): New function.
6019 (Output_data_plt_arm::first_plt_entry_offset): New function.
6020 (Output_data_plt_arm::get_plt_entry_size): New function.
6021 * i386.cc (Target_i386::got_size): Add const.
6022 (Target_i386::got_entry_count): New function.
6023 (Target_i386::plt_entry_count): New function.
6024 (Target_i386::first_plt_entry_offset): New function.
6025 (Target_i386::plt_entry_size): New function.
6026 (Output_data_plt_i386::entry_count): New function.
6027 (Output_data_plt_i386::first_plt_entry_offset): New function.
6028 (Output_data_plt_i386::get_plt_entry_size): New function.
6029 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
6030 find_incremental_inputs_sections. Dump incremental_got_plt section.
6031 * incremental.cc: Include target.h.
6032 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
6033 parameter. Adjust all callers. Find incremental_got_plt section.
6034 (Incremental_inputs::create_data_sections): Create incremental_got_plt
6035 section.
6036 (Output_section_incremental_inputs::set_final_data_size): Calculate
6037 size of incremental_got_plt section.
6038 (Output_section_incremental_inputs::do_write): Write the
6039 incremental_got_plt section.
6040 (Got_plt_view_info): New struct.
6041 (Local_got_offset_visitor): New class.
6042 (Global_got_offset_visitor): New class.
6043 (Global_symbol_visitor_got_plt): New class.
6044 (Output_section_incremental_inputs::write_got_plt): New function.
6045 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
6046 Add parameter. Adjust all callers.
6047 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
6048 (Incremental_inputs::got_plt_section): New function.
6049 (Incremental_inputs::got_plt_section_): New data member.
6050 (Incremental_got_plt_reader): New class.
6051 * layout.cc (Layout::create_incremental_info_sections): Add the
6052 incremental_got_plt section.
6053 * object.h (Got_offset_list::get_list): New function.
6054 (Got offset_list::for_all_got_offsets): New function.
6055 (Sized_relobj::local_got_offset_list): New function.
6056 * powerpc.cc (Target_powerpc::got_size): Add const.
6057 (Target_powerpc::got_entry_count): New function.
6058 (Target_powerpc::plt_entry_count): New function.
6059 (Target_powerpc::first_plt_entry_offset): New function.
6060 (Target_powerpc::plt_entry_size): New function.
6061 (Output_data_plt_powerpc::entry_count): New function.
6062 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
6063 (Output_data_plt_powerpc::get_plt_entry_size): New function.
6064 * sparc.cc (Target_sparc::got_size): Add const.
6065 (Target_sparc::got_entry_count): New function.
6066 (Target_sparc::plt_entry_count): New function.
6067 (Target_sparc::first_plt_entry_offset): New function.
6068 (Target_sparc::plt_entry_size): New function.
6069 (Output_data_plt_sparc::entry_count): New function.
6070 (Output_data_plt_sparc::first_plt_entry_offset): New function.
6071 (Output_data_plt_sparc::get_plt_entry_size): New function.
6072 * symtab.h (Symbol::got_offset_list): New function.
6073 (Symbol_table::for_all_symbols): New function.
6074 * target.h (Sized_target::got_entry_count): New function.
6075 (Sized_target::plt_entry_count): New function.
6076 (Sized_target::plt_entry_size): New function.
6077 * x86_64.cc (Target_x86_64::got_size): Add const.
6078 (Target_x86_64::got_entry_count): New function.
6079 (Target_x86_64::plt_entry_count): New function.
6080 (Target_x86_64::first_plt_entry_offset): New function.
6081 (Target_x86_64::plt_entry_size): New function.
6082 (Output_data_plt_x86_64::entry_count): New function.
6083 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
6084 (Output_data_plt_x86_64::get_plt_entry_size): New function.
6085
09ec0418
CC
60862010-08-12 Cary Coutant <ccoutant@google.com>
6087
6088 * archive.cc: Include incremental.h.
6089 (Archive::Archive): Initialize incremental_info_.
6090 (Archive::include_member): Record archive members in incremental info.
6091 (Add_archive_symbols::run): Record begin and end of an archive in
6092 incremental info.
6093 (Lib_group::include_member): Record objects in incremental info.
6094 * archive.h (Incremental_archive_entry): Forward declaration.
6095 (Archive::set_incremental_info): New member function.
6096 (Archive::incremental_info): New member function.
6097 (Archive::Unused_symbol_iterator): New class.
6098 (Archive::unused_symbols_begin): New member function.
6099 (Archive::unused_symbols_end): New member function.
6100 (Archive::incremental_info_): New data member.
6101 * incremental-dump.cc (find_input_containing_global): New function.
6102 (dump_incremental_inputs): Dump new incremental info sections.
6103 * incremental.cc: Include symtab.h.
6104 (Output_section_incremental_inputs): New class.
6105 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
6106 new incremental info sections.
6107 (Sized_incremental_binary::do_check_inputs): Likewise.
6108 (Incremental_inputs::report_archive): Remove.
6109 (Incremental_inputs::report_archive_begin): New function.
6110 (Incremental_inputs::report_archive_end): New function.
6111 (Incremental_inputs::report_object): New function.
6112 (Incremental_inputs::finalize_inputs): Remove.
6113 (Incremental_inputs::report_input_section): New function.
6114 (Incremental_inputs::report_script): Rewrite.
6115 (Incremental_inputs::finalize): Do nothing but finalize string table.
6116 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
6117 (Incremental_inputs::sized_create_inputs_section_data): Remove.
6118 (Incremental_inputs::create_data_sections): New function.
6119 (Incremental_inputs::relocs_entsize): New function.
6120 (Output_section_incremental_inputs::set_final_data_size): New function.
6121 (Output_section_incremental_inputs::do_write): New function.
6122 (Output_section_incremental_inputs::write_header): New function.
6123 (Output_section_incremental_inputs::write_input_files): New function.
6124 (Output_section_incremental_inputs::write_info_blocks): New function.
6125 (Output_section_incremental_inputs::write_symtab): New function.
6126 * incremental.h (Incremental_script_entry): Forward declaration.
6127 (Incremental_object_entry): Forward declaration.
6128 (Incremental_archive_entry): Forward declaration.
6129 (Incremental_inputs): Forward declaration.
6130 (Incremental_inputs_header_data): Remove.
6131 (Incremental_inputs_header): Remove.
6132 (Incremental_inputs_header_write): Remove.
6133 (Incremental_inputs_entry_data): Remove.
6134 (Incremental_inputs_entry): Remove.
6135 (Incremental_inputs_entry_write): Remove.
6136 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
6137 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
6138 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
6139 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
6140 Likewise.
6141 (Incremental_input_entry): New class.
6142 (Incremental_script_entry): New class.
6143 (Incremental_object_entry): New class.
6144 (Incremental_archive_entry): New class.
6145 (Incremental_inputs::Incremental_inputs): Initialize new data members.
6146 (Incremental_inputs::report_inputs): Remove.
6147 (Incremental_inputs::report_archive): Remove.
6148 (Incremental_inputs::report_archive_begin): New function.
6149 (Incremental_inputs::report_archive_end): New function.
6150 (Incremental_inputs::report_object): Change prototype.
6151 (Incremental_inputs::report_input_section): New function.
6152 (Incremental_inputs::report_script): Change prototype.
6153 (Incremental_inputs::get_reloc_count): New function.
6154 (Incremental_inputs::set_reloc_count): New function.
6155 (Incremental_inputs::create_data_sections): New function.
6156 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
6157 (Incremental_inputs::inputs_section): New function.
6158 (Incremental_inputs::symtab_section): New function.
6159 (Incremental_inputs::relocs_section): New function.
6160 (Incremental_inputs::get_stringpool): Add const.
6161 (Incremental_inputs::command_line): Add const.
6162 (Incremental_inputs::inputs): Remove.
6163 (Incremental_inputs::command_line_key): New function.
6164 (Incremental_inputs::input_file_count): New function.
6165 (Incremental_inputs::input_files): New function.
6166 (Incremental_inputs::relocs_entsize): New function.
6167 (Incremental_inputs::sized_create_inputs_section_data): Remove.
6168 (Incremental_inputs::finalize_inputs): Remove.
6169 (Incremental_inputs::Input_info): Remove.
6170 (Incremental_inputs::lock_): Remove.
6171 (Incremental_inputs::inputs_): Change type.
6172 (Incremental_inputs::inputs_map_): Remove.
6173 (Incremental_inputs::current_object_entry_): New data member.
6174 (Incremental_inputs::inputs_section_): New data member.
6175 (Incremental_inputs::symtab_section_): New data member.
6176 (Incremental_inputs::relocs_section_): New data member.
6177 (Incremental_inputs::reloc_count_): New data member.
6178 (Incremental_inputs_reader): New class.
6179 (Incremental_symtab_reader): New class.
6180 (Incremental_relocs_reader): New class.
6181 * layout.cc (Layout::finalize): Move finalization of incremental info
6182 and creation of incremental info sections to follow finalization of
6183 symbol table. Set offsets for postprocessing sections.
6184 (Layout::create_incremental_info_sections): Call
6185 Incremental_inputs::create_data_sections. Add incremental symtab
6186 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
6187 sections to layout after input sections.
6188 * layout.h (struct Timespec): Forward declaration.
6189 (Layout::incremental_inputs): Add const.
6190 (Layout::create_incremental_info_sections): Add parameter.
6191 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
6192 * object.cc: Include incremental.h.
6193 (Relobj::finalize_incremental_relocs): New function.
6194 (Sized_relobj::do_layout): Record input sections in incremental info.
6195 * object.h (Object::output_section): New function.
6196 (Object::output_section_offset): Moved from Relobj.
6197 (Object::get_incremental_reloc_base): New function.
6198 (Object::get_incremental_reloc_count): New function.
6199 (Object::do_output_section): New function.
6200 (Object::do_output_section_offset): Moved from Relobj.
6201 (Object::do_get_incremental_reloc_base): New function.
6202 (Object::do_get_incremental_reloc_count): New function.
6203 (Object::Object): Initialize new data members.
6204 (Relobj::output_section): Renamed do_output_section and moved to
6205 protected.
6206 (Relobj::output_section_offset): Moved to Object.
6207 (Relobj::do_get_incremental_reloc_base): New function.
6208 (Relobj::do_get_incremental_reloc_count): New function.
6209 (Relobj::allocate_incremental_reloc_counts): New function.
6210 (Relobj::count_incremental_reloc): New function.
6211 (Relobj::finalize_incremental_relocs): New function.
6212 (Relobj::next_incremental_reloc_index): New function.
6213 (Relobj::reloc_counts_): New data member.
6214 (Relobj::reloc_bases_): New data member.
6215 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
6216 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
6217 (Sized_relobj::incremental_relocs_scan): New function.
6218 (Sized_relobj::incremental_relocs_scan_reltype): New function.
6219 (Sized_relobj::incremental_relocs_write): New function.
6220 (Sized_relobj::incremental_relocs_write_reltype): New function.
6221 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
6222 incremental link.
6223 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
6224 archives and object files elsewhere.
6225 (Add_symbols::run): Report object files here.
6226 (Finish_group::run): Report end of archive at end of group.
6227 * reloc.cc: Include layout.h, incremental.h.
6228 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
6229 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
6230 (Sized_relobj::incremental_relocs_scan): New function.
6231 (Sized_relobj::incremental_relocs_scan_reltype): New function.
6232 (Sized_relobj::do_relocate_sections): Write incremental relocations.
6233 (Sized_relobj::incremental_relocs_write): New function.
6234 (Sized_relobj::incremental_relocs_write_reltype): New function.
6235 * script.cc (read_input_script): Rewrite test for incremental link.
6236 Change call to Incremental_inputs::report_script.
6237 * symtab.h (Symbol_table::first_global_index): New function.
6238 (Symbol_table::output_count): New function.
6239
ce0d1972
DK
62402010-08-12 Doug Kwan <dougkwan@google.com>
6241
6242 * arm.cc (Target_arm::merge_object_attributes): Check command line
6243 options --no-wchar-size-warning and --no-enum-size-warning.
6244 * options.h (General_options): Add ld-compatible options
6245 --no-enum-size-warning and --no-wchar-size-warning.
6246
6e5710ce
ILT
62472010-08-04 Ian Lance Taylor <iant@google.com>
6248
6249 * x86_64.cc (Target_x86_64::Scan::local): Use
6250 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
6251 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
6252 (Target_x86_64::Scan::global): Likewise.
6253 (Target_x86_64::Relocate::relocate): Likewise.
6254 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
6255 Likewise.
6256
fef830db
CC
62572010-08-03 Cary Coutant <ccoutant@google.com>
6258
6259 * merge.cc (Output_merge_string::do_add_input_section): Count strings
6260 to reserve space in merged_strings vector. Keep total input size
6261 for stats.
6262 (Output_merge_string::do_print_merge_stats): Print total input size.
6263 * merge.h (Output_merge_string): Add input_size_ field.
6264 * stringpool.cc (Stringpool_template::string_length): Move
6265 implementations out of Stringpool_template class and place in
6266 stringpool.h.
6267 * stringpool.h (string_length): Move out of Stringpool_template.
6268
1e3811b0
ILT
62692010-08-03 Ian Lance Taylor <iant@google.com>
6270
6271 PR 11712
6272 * layout.cc (relaxation_loop_body): If address of load segment is
6273 set, adjust address to include headers if possible.
6274
7af0c620
ILT
62752010-08-03 Ian Lance Taylor <iant@google.com>
6276
6277 * version.cc (version_string): Bump to 1.10.
6278
22f0da72
ILT
62792010-08-03 Ian Lance Taylor <iant@google.com>
6280
6281 PR 11805
6282 * layout.h (enum Output_section_order): Define.
6283 (class Layout): Update declarations.
6284 * layout.cc (Layout::get_output_section): Add order parameter.
6285 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
6286 is_first_non_relro parameters. Change all callers.
6287 (Layout::choose_output_section): Likewise.
6288 (Layout::add_output_section_data): Likewise.
6289 (Layout::make_output_section): Likewise. Set order.
6290 (Layout::default_section_order): New function.
6291 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
6292 * output.cc (Output_section::Output_section): Initialize order_.
6293 Don't initialize deleted fields.
6294 (Output_segment::Output_segment): Don't initialize deleted
6295 fields.
6296 (Output_segment::add_output_section_to_load): New function
6297 replacing add_output_section. Change all callers to call this or
6298 add_output_section_to_nonload.
6299 (Output_segment::add_output_section_to_nonload): New function.
6300 (Output_segment::remove_output_section): Rewrite.
6301 (Output_segment::add_initial_output_data): Likewise.
6302 (Output_segment::has_any_data_sections): Likewise.
6303 (Output_segment::is_first_section_relro): Likewise.
6304 (Output_segment::maximum_alignment): Likewise.
6305 (Output_segment::has_dynamic_reloc): New function replacing
6306 dynamic_reloc_count. Change all callers.
6307 (Output_segment::has_dynamic_reloc_list): New function replacing
6308 dynamic_reloc_count_list. Change all callers.
6309 (Output_segment::set_section_addresses): Rewrite.
6310 (Output_segment::set_offset): Rewrite.
6311 (Output_segment::find_first_and_last_list): Remove.
6312 (Output_segment::set_tls_offsets): Rewrite.
6313 (Output_segment::first_section_load_address): Likewise.
6314 (Output_segment::output_section_count): Likewise.
6315 (Output_segment::section_with_lowest_load_address): Likewise.
6316 (Output_segment::write_section_headers): Likewise.
6317 (Output_segment::print_sections_to_map): Likewise.
6318 * output.h (class Output_data): Remove dynamic_reloc_count_
6319 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
6320 (Output_data::add_dynamic_reloc): Rewrite.
6321 (Output_data::has_dynamic_reloc): New function.
6322 (Output_data::dynamic_reloc_count): Remove.
6323 (class Output_section): Add order_ field. Remvoe is_relro_local_,
6324 is_last_relro_, is_first_non_relro_, is_interp_,
6325 is_dynamic_linker_section_ fields. Add order and set_order
6326 functions. Remove is_relro_local, set_is_relro_local,
6327 is_last_relro, set_is_last_relro, is_first_non_relro,
6328 set_is_first_non_relro functions, is_interp, set_is_interp,
6329 is_dynamic_linker_section, and set_is_dynamic_linker_section
6330 functions.
6331 (class Output_segment): Change Output_data_list from std::list to
6332 std:;vector. Add output_lists_ field. Remove output_data_ and
6333 output_bss_ fields. Update declarations.
6334
3ff2ccb0
ILT
63352010-08-02 Ian Lance Taylor <iant@google.com>
6336
6337 * arm.cc (Target_arm::gc_process_relocs): Use typename.
6338 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
6339 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
6340
88a4108b
ILT
63412010-08-02 Ian Lance Taylor <iant@google.com>
6342
6343 PR 11855
6344 * script.cc (Script_options::Script_options): Initialize
6345 symbol_definitions_ and symbol_references_.
6346 (Script_options::add_symbol_assignment): Update
6347 symbol_definitions_ and symbol_references_.
6348 (Script_options::add_symbol_reference): New function.
6349 (script_symbol): New function.
6350 * script.h (class Script_options): Add symbol_definitions_ and
6351 symbol_references_ fields.
6352 (Script_options::referenced_const_iterator): New type.
6353 (Script_options::referenced_begin): New function.
6354 (Script_options::referenced_end): New function.
6355 (Script_options::is_referenced): New function.
6356 (Script_options::any_unreferenced): New function.
6357 * script-c.h (script_symbol): Declare.
6358 * yyscript.y (exp): Call script_symbol.
6359 * symtab.cc: Include "script.h".
6360 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
6361 Change all callers. Check symbols referenced by scripts.
6362 (Symbol_table::add_undefined_symbols_from_command_line): Add
6363 layout parameter. Change all callers.
6364 (Symbol_table::do_add_undefined_symbols_from_command_line):
6365 Likewise. Break out loop body. Check symbols referenced by
6366 scripts.
6367 (Symbol_table::add_undefined_symbol_from_command_line): New
6368 function broken out of
6369 do_add_undefined_symbols_from_command_line.
6370 * symtab.h (class Symbol_table): Update declarations.
6371 * archive.cc: Include "layout.h".
6372 (Archive::should_include_member): Add layout parameter. Change
6373 all callers. Check for symbol mentioned in expression.
6374 * archive.h (class Archive): Update declaration.
6375 * object.cc (Sized_relobj::do_should_include_member): Add layout
6376 parameter.
6377 * object.h (Object::should_include_member): Add layout parameter.
6378 Change all callers.
6379 (Object::do_should_include_member): Add layout parameter.
6380 (class Sized_relobj): Update declaration.
6381 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
6382 parameter.
6383 * dynobj.h (class Sized_dynobj): Update declaration.
6384 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
6385 layout parameter.
6386 * plugin.h (class Sized_pluginobj): Update declaration.
6387
5f1ab67a
ILT
63882010-08-02 Ian Lance Taylor <iant@google.com>
6389
6390 PR 11866
6391 * output.cc (Output_segment::set_offset): Search for the first and
6392 last sections rather than assuming that the list is in order.
6393 (Output_segment::find_first_and_last_list): New function.
6394 * output.h (class Output_segment): Update declarations.
6395 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
6396 (relro_strip_test_SOURCES): New variable.
6397 (relro_strip_test_DEPENDENCIES): New variable.
6398 (relro_strip_test_LDFLAGS): New variable.
6399 (relro_strip_test_LDADD): New variable.
6400 (relro_strip_test.so): New target.
6401
a8df5856
ILT
64022010-08-02 Ian Lance Taylor <iant@google.com>
6403
6404 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
6405 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
6406 (Target_i386::got_tlsdesc_section): New function.
6407 (Target_i386::got_section): Create space for GOT entries for
6408 TLSDESC relocations.
6409 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
6410 R_386_TLS_GOTDESC.
6411 (Target_i386::Scan::global): Likewise.
6412 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
6413 using TLSDESC GOT.
6414 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
6415 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
6416 (Target_x86_64::got_tlsdesc_section): New function.
6417 (Target_x86_64::got_section): Create space for GOT entries for
6418 TLSDESC relocations.
6419 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
6420 R_386_TLS_GOTDESC.
6421 (Target_x86_64::Scan::global): Likewise.
6422 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
6423 using TLSDESC GOT.
6424
0c10a0a6
ILT
64252010-08-02 Ian Lance Taylor <iant@google.com>
6426
6427 * testsuite/final_layout.sh: Use dc to convert from hex to
6428 decimal.
6429
41cbeecc
ST
64302010-07-29 Sriraman Tallam <tmsriram@google.com>
6431
6432 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
6433 paramter to the call to gold::gc_process_relocs.
6434 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
6435 paramter to the call to gold::gc_process_relocs.
6436 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
6437 parameter to the call to gold::gc_process_relocs.
6438 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
6439 template parameter to the call to gold::gc_process_relocs.
6440 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
6441 paramter to the call to gold::gc_process_relocs.
6442 * gc.h (get_embedded_addend_size): New function.
6443 (gc_process_relocs): Save the size of the reloc for use by ICF.
6444 * icf.cc (get_section_contents): Get the addend from the text section
6445 for SHT_REL relocation sections.
6446 * icf.h (Icf::Reloc_addend_size_info): New typedef.
6447 (Icf::Reloc_info): Add new member reloc_addend_size_info.
6448 * int_encoding.h (read_from_pointer): New overloaded function.
6449 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
6450 * testsuite/icf_sht_rel_addend_test.sh: New file.
6451 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
6452 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
6453
6ea55b82
RW
64542010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6455
6456 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
6457 * Makefile.in: Regenerate.
6458 * testsuite/Makefile.in: Regenerate.
6459
9691462b
ILT
64602010-07-27 Jeffrey Yasskin <jyasskin@google.com>
6461
6462 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
6463 * gold/testsuite/debug_msg.cc: Likewise.
6464 * gold/testsuite/odr_violation1.cc
6465 * gold/testsuite/odr_violation2.cc
6466
76897331
CC
64672010-07-21 Cary Coutant <ccoutant@google.com>
6468
6469 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
6470 string, and length fields.
6471 (Output_merge_string::Merged_strings_list): New type.
6472 (Output_merge_string::Merged_strings_lists): New typedef.
6473 (Output_merge_string): Replace merged_strings_ with
6474 merged_strings_lists_.
6475 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
6476 Merged_strings_list per input object and section. Don't store pointer
6477 to the string. Don't store length with each merged string entry.
6478 (Output_merge_string::finalize_merged_data): Loop over list of merged
6479 strings lists. Recompute length of each merged string.
6480
78384e8f
CC
64812010-07-15 Cary Coutant <ccoutant@google.com>
6482
6483 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
6484 here.
6485
783659f9
ILT
64862010-07-14 Ian Lance Taylor <iant@google.com>
6487
6488 * descriptors.cc (Descriptors::open): Report correct name in error
6489 message.
6490
131687b4
DK
64912010-07-13 Doug Kwan <dougkwan@google.com>
6492
6493 * arm.cc (Arm_input_section::Arm_input_section): For a
6494 SHT_ARM_EXIDX section, always keeps the input sections.
6495 (Arm_input_section::set_exidx_section_link): New method.
6496 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
6497 has_errors_ to false.
6498 (Arm_exidx_input_section::has_errors,
6499 Arm_exidx_input_section::set_has_errors): New methods.
6500 (Arm_exidx_input_section::has_errors_): New data member.
6501 (Arm_relobj::get_exidx_shndx_list): New method.
6502 (Arm_output_section::append_text_sections_to_list): Do not skip
6503 section without SHF_EXECINSTR.
6504 (Arm_output_section::fix_exidx_coverage): Skip input sections with
6505 errors.
2e702c99 6506 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
6507 section header. Make error messages more verbose. Check for
6508 a non-executable section linked to an EXIDX section.
6509 (Arm_relobj::do_read_symbols): Remove error checking, which has been
6510 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
6511 check that there is no deferred EXIDX section if we exit early.
6512 Instead of not making an EXIDX section in case of an error, make one
6513 and set the has_errors flag of it.
6514 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
6515 in a relocatable link.
6516 (Target_arm::do_relax): Look for the EXIDX output section instead of
6517 assuming that it is called .ARM.exidx.
2e702c99 6518 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
6519 section list. Do not check for SHF_EXECINSTR section flags but
6520 skip any input section with errors.
6521 * output.cc (Output_section::Output_section): Initialize
6522 always_keeps_input_sections_ to false.
6523 (Output_section::add_input_section): Check for
6524 always_keeps_input_sections_.
6525 * output.h (Output_section::always_keeps_input_sections,
6526 Output_section::set_always_keeps_input_sections): New methods.
6527 (Output_section::always_keeps_input_sections): New data member.
6528
69517287
RÁE
65292010-07-13 Rafael Espindola <espindola@google.com>
6530
6531 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
6532 * fileread.h (Input_file): Add try_extra_search_path and find_file.
6533
82742395
ILT
65342010-07-13 Philip Herron <herron.philip@googlemail.com>
6535 Ian Lance Taylor <iant@google.com>
6536
6537 * output.h (Output_section_lookup_maps::add_merge_section):
6538 Correct check of whether value was inserted.
6539 (Output_section_lookup_maps::add_merge_input_section): Likewise.
6540 (Output_section_lookup_maps::add_relaxed_input_section):
6541 Likewise.
6542 * arm.cc (Target_arm::got_section): Remove used local os.
6543 * i386.cc (Target_i386::got_section): Likewise.
6544 * x86_64.cc (Target_x86_64::got_section): Likewise.
6545 * sparc.cc (Target_sparc::got_section): Likewise.
6546 (Target_sparc::relocate): Remove unused local have_got_offset.
6547 * powerpc.cc (Target_powerpc::relocate): Likewise.
6548
f2d707b5
ILT
65492010-07-13 Ian Lance Taylor <iant@google.com>
6550
241531d6
ILT
6551 * compressed_output.cc (zlib_decompress): Fix signature in
6552 !HAVE_ZLIB_H case.
6553
f2d707b5
ILT
6554 * archive.cc (Archive::include_member): Unlock an external member
6555 of a thin archive. Don't bother to delete an object we know is
6556 NULL.
6557
a2e47362
CC
65582010-07-12 Cary Coutant <ccoutant@google.com>
6559
6560 * compressed_output.cc (zlib_decompress): New function.
6561 (get_uncompressed_size): New function.
6562 (decompress_input_section): New function.
6563 * compressed_output.h (get_uncompressed_size): New function.
6564 (decompress_input_section): New function.
6565 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
6566 Handle compressed debug sections.
6567 * layout.cc (is_compressed_debug_section): New function.
6568 (Layout::output_section_name): Map compressed section names to
6569 canonical names.
6570 * layout.h (is_compressed_debug_section): New function.
6571 (is_debug_info_section): Recognize compressed debug sections.
6572 * merge.cc: Include compressed_output.h.
6573 (Output_merge_data::do_add_input_section): Handle compressed
6574 debug sections.
6575 (Output_merge_string::do_add_input_section): Handle compressed
6576 debug sections.
6577 * object.cc: Include compressed_output.h.
6578 (Sized_relobj::Sized_relobj): Initialize new data members.
6579 (build_compressed_section_map): New function.
6580 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
6581 * object.h (Object::section_is_compressed): New method.
6582 (Object::do_section_is_compressed): New method.
6583 (Sized_relobj::Compressed_section_map): New type.
6584 (Sized_relobj::do_section_is_compressed): New method.
6585 (Sized_relobj::compressed_sections_): New data member.
6586 * output.cc (Output_section::add_input_section): Handle compressed
6587 debug sections.
6588 * reloc.cc: Include compressed_output.h.
6589 (Sized_relobj::write_sections): Handle compressed debug sections.
6590
ce279a62
CC
65912010-07-08 Cary Coutant <ccoutant@google.com>
6592
6593 * resolve.cc (Symbol_table::resolve): Remember whether undef was
6594 weak when resolving to a dynamic def.
6595 (Symbol_table::should_override): Add adjust_dyndef flag; set it
6596 for weak undef/dynamic def cases. Adjust callers.
6597 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
6598 undef_binding_weak_.
6599 (Symbol_table::sized_write_globals): Adjust symbol binding.
6600 (Symbol_table::sized_write_symbol): Add binding parameter.
6601 * symtab.h (Symbol::set_undef_binding): New method.
6602 (Symbol::is_undef_binding_weak): New method.
6603 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
6604 (Symbol_table::should_override): Add new parameter.
6605 (Symbol_table::sized_write_symbol): Add new parameter.
6606
6607 * testsuite/weak_undef_file1.cc: Add new test case.
6608 * testsuite/weak_undef_file2.cc: Fix header comment.
6609 * testsuite/weak_undef_test.cc: Add new test case.
6610
b2286c10
DK
66112010-06-29 Doug Kwan <dougkwan@google.com>
6612
6613 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
6614 Initialize USE_SYMBOL_.
6615 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
6616 definition.
6617 (Arm_reloc_property::uses_symbol_): New data member declaration.
6618 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
6619 uses symbol value and symbol is undefined but not weakly undefined.
6620
4802450a
RÁE
66212010-06-28 Rafael Espindola <espindola@google.com>
6622
6623 * plugin.cc (Plugin::load): Use dlerror.
6624
e5ca47ba
ILT
66252010-06-26 Jeffrey Yaskin <jyasskin@google.com>
6626
6627 * symtab.cc (detect_odr_violations): When reporting an ODR
6628 violation, report an object where the symbol is defined.
6629
8a75a161
DK
66302010-06-25 Doug Kwan <dougkwan@google.com>
6631
6632 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
6633 (Target_arm::section_may_have_icf_unsafe_pointers): New method
6634 definition.
6635 (Target_arm::Scan::local_reloc_may_be_function_pointer,
6636 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
6637 target hook to detect function points.
6638 (Target_arm::Scan::possible_function_pointer_reloc): New method.
6639 * icf.h (Icf::check_section_for_function_pointers): Change type of
6640 parameter SECTION_NAME to const reference to std::string. Use
6641 target hook to determine if section may have unsafe pointers.
6642 * target.h (Target::section_may_have_icf_unsafe_pointers): New
6643 method definition.
6644
42218b9f
RÁE
66452010-06-21 Rafael Espindola <espindola@google.com>
6646
6647 * fileread.cc (Input_file::find_fie): New
6648 (Input_file::open): Use Input_file::find_fie.
6649 * fileread.h (Input_file::find_fie): New
6650 * plugin.cc (set_extra_library_path): New.
6651 (Plugin::load): Add set_extra_library_path to the transfer vector.
6652 (Plugin_manager::set_extra_library_path): New.
6653 (Plugin_manager::add_input_file): Use the extra search path if set.
6654 (set_extra_library_path(): New.
6655 * plugin.h (Plugin_manager): Add set_extra_library_path and
6656 extra_search_path_.
6657
a0506cca
CC
66582010-06-19 Cary Coutant <ccoutant@google.com>
6659
6660 * layout.cc (gdb_sections): Add .debug_types.
6661 (lines_only_debug_sections): Likewise.
6662
6508b958
RÁE
66632010-06-18 Rafael Espindola <espindola@google.com>
6664
6665 * plugin.cc (add_input_file,add_input_library)
6666 (Plugin_manager::add_input_file): Make filename arguments const.
6667 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
6668 const.
6669
3e235302
DK
66702010-06-16 Doug Kwan <dougkwan@google.com>
6671
6672 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
6673 .ARM.attributes section if we have not merged any input
6674 attributes sections.
6675
106e8a6c
DK
66762010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6677
6678 * arm.cc: Allow combining objects with no EABI version
6679 information.
6680
91ff43fe
RÁE
66812010-06-15 Rafael Espindola <espindola@google.com>
6682
6683 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
6684
68ed838c
ILT
66852010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6686
6687 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
6688 (struct iovec): Correct !HAVE_READV definition.
6689
f3a2388f
CC
66902010-06-10 Cary Coutant <ccoutant@google.com>
6691
6692 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
6693 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
6694 reloc sections.
6695 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
6696
6697 PR 11683
6698 * symtab.h (Symbol::is_placeholder): New member function.
6699 * target-reloc.h (relocate_section): Check for placeholder symbols.
6700
6701 * testsuite/Makefile.am (plugin_test_8): New test.
6702 (plugin_test_9): New test.
6703 * testsuite/Makefile.in: Regenerate.
6704
e1df38aa
NC
67052010-06-09 Nick Clifton <nickc@redhat.com>
6706
6707 * yyscript.y (input_list_element): Allow strings prefixed with
6708 the '-' character. Treat these as libraries.
6709 * script.cc (script_add_library): New function. Adds a library
6710 specified by "-l<name>" found in an input script.
6711 * script-c.h: Add prototype for script_add_library.
6712
25bbe950
DK
67132010-06-07 Doug Kwan <dougkwan@google.com>
6714
6715 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
6716 Restrict stub-group size to be within long conditional branch
6717 range when working around cortex-A8 erratum.
6718
0f32ea4c
ILT
67192010-06-07 Damien Diederen <dd@crosstwine.com>
6720
6721 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
6722 #ifdef typo.
6723
8fe2a369
ST
67242010-06-03 Sriraman Tallam <tmsriram@google.com>
6725
6726 PR gold/11658
6727 * output.cc
6728 (Output_section::Input_section_sort_entry::compare_section_ordering):
6729 Change to return non-zero correctly.
6730 (Output_section::Input_section_sort_section_order_index_compare
6731 ::operator()): Change to fix ambiguity in comparisons.
6732
6e9ba2ca
ST
67332010-06-01 Sriraman Tallam <tmsriram@google.com>
6734
6735 * gold.h (is_wildcard_string): New function.
6736 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
6737 (Layout::layout_eh_frame): Ditto.
6738 (Layout::find_section_order_index): New method.
6739 (Layout::read_layout_from_file): New method.
6740 * layout.h (Layout::find_section_order_index): New method.
6741 (Layout::read_layout_from_file): New method.
6742 (Layout::input_section_position_): New private member.
6743 (Layout::input_section_glob_): New private member.
6744 * main.cc (main): Call read_layout_from_file here.
6745 * options.h (--section-ordering-file): New option.
6746 * output.cc (Output_section::input_section_order_specified_): New
6747 member.
6748 (Output_section::Output_section): Initialize new member.
6749 (Output_section::add_input_section): Add new parameter.
6750 Keep input sections when --section-ordering-file is used.
6751 (Output_section::set_final_data_size): Sort input sections when
6752 section ordering file is specified.
6753 (Output_section::Input_section_sort_entry): Add new parameter.
6754 Check sorting type.
6755 (Output_section::Input_section_sort_entry::compare_section_ordering):
6756 New method.
6757 (Output_section::Input_section_sort_compare::operator()): Change to
6758 consider section_order_index.
6759 (Output_section::Input_section_sort_init_fini_compare::operator()):
6760 Change to consider section_order_index.
6761 (Output_section::Input_section_sort_section_order_index_compare
6762 ::operator()): New method.
6763 (Output_section::sort_attached_input_sections): Change to sort
6764 according to section order when specified.
e1df38aa
NC
6765 (Output_section::add_input_section<32, true>): Add new parameter.
6766 (Output_section::add_input_section<64, true>): Add new parameter.
6767 (Output_section::add_input_section<32, false>): Add new parameter.
6768 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
6769 * output.h (Output_section::add_input_section): Add new parameter.
6770 (Output_section::input_section_order_specified): New
6771 method.
6772 (Output_section::set_input_section_order_specified): New method.
6773 (Input_section::Input_section): Initialize section_order_index_.
6774 (Input_section::section_order_index): New method.
6775 (Input_section::set_section_order_index): New method.
6776 (Input_section::section_order_index_): New member.
6777 (Input_section::Input_section_sort_section_order_index_compare): New
6778 struct.
6779 (Output_section::input_section_order_specified_): New member.
6780 * script-sections.cc (is_wildcard_string): Delete and move modified
6781 method to gold.h.
6782 (Output_section_element_input::Output_section_element_input): Modify
6783 call to is_wildcard_string.
6784 (Output_section_element_input::Input_section_pattern
6785 ::Input_section_pattern): Ditto.
6786 (Output_section_element_input::Output_section_element_input): Ditto.
6787 * testsuite/Makefile.am (final_layout): New test case.
6788 * testsuite/Makefile.in: Regenerate.
6789 * testsuite/final_layout.cc: New file.
6790 * testsuite/final_layout.sh: New file.
6791
3537c84b
RÁE
67922010-06-01 Rafael Espindola <espindola@google.com>
6793
6794 * plugin.cc (Plugin::load): Pass the output name to the plugin.
6795
105b6afd
RÁE
67962010-06-01 Rafael Espindola <espindola@google.com>
6797
6798 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
6799 visibility of symbols.
6800
29e11421
DK
68012010-05-27 Doug Kwan <dougkwan@google.com>
6802
6803 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
6804 from start of output section instead of address for a local symbol
6805 in a merged or relaxed section when doing a relocatable link.
6806
5e0f337e
RÁE
68072010-05-26 Rafael Espindola <espindola@google.com>
6808
703d02da 6809 PR 11604
5e0f337e
RÁE
6810 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
6811 adding sections the garbage collector removed.
6812 * gold/testsuite/Makefile.am: Add test.
6813 * gold/testsuite/Makefile.in: Regenerate.
6814 * gold/testsuite/plugin_test_7.sh: New.
6815 * gold/testsuite/plugin_test_7_1.c: New.
6816 * gold/testsuite/plugin_test_7_2.c: New.
6817
f4187277
RÁE
68182010-05-26 Rafael Espindola <espindola@google.com>
6819
6820 * script-sections.cc (Output_section_definition::set_section_addresses):
6821 Check for --section-start.
6822
5c388529
DK
68232010-05-26 Doug Kwan <dougkwan@google.com>
6824
6825 * arm.cc (Arm_scan_relocatable_relocs): New class.
6826 (Target_arm::relocate_special_relocatable): New method.
6827 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
6828 (Arm_relocate_functions::thumb_branch_common): Same.
6829 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
6830 instead of Default_scan_relocatable_relocs.
6831 * target-reloc.h (relocate_for_relocatable): Let target handle
6832 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
6833 * target.h (Sized_target::relocate_special_relocatable): New method.
6834
bca1c3ae
ILT
68352010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6836
6837 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
6838
0439c796
DK
68392010-05-23 Doug Kwan <dougkwan@google.com>
6840
6841 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
6842 instead of a cast.
6843 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
6844 with a direct branch, not a conditional branch, to a stub.
6845 * merge.cc (Output_merge_base::record_input_section): New method
6846 defintion.
6847 (Output_merge_data::do_add_input_section): Record input section if
6848 keeps-input-sections flag is set.
6849 (Output_merge_string::do_add_input_section): Ditto.
6850 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
6851 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
6852 INPUT_SECTIONS_.
6853 (Output_merge_base::keeps_input_sections,
6854 Output_merge_base::set_keeps_input_sections,
6855 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
6856 method definitions.
6857 (Output_merge_base::Input_sections): New type declaration.
6858 (Output_merge_base::input_sections_begin,
6859 Output_merge_base::input_sections_end,
6860 Output_merge_base::do_set_keeps_input_sections): New method definitions.
6861 (Output_merge_base::bool keeps_input_sections_,
6862 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
6863 Output_merge_base::input_sections_): New data members.
6864 (Output_merge_data::do_set_keeps_input_sections): New method
6865 defintion.
6866 (Output_merge_string::do_set_keeps_input_sections): Ditto.
6867 * output.cc (Output_section::Input_section::relobj): Move method
6868 defintion from class declaration to here and handle merge sections.
6869 (Output_section::Input_section::shndx): Ditto.
6870 (Output_section::Output_section): Remove initializations of removed
6871 data members and initialize new data member LOOKUP_MAPS_.
6872 (Output_section::add_input_section): Set keeps-input-sections flag
6873 for a newly created merge output section as appropriate. Adjust code
6874 to use Output_section_lookup_maps class.
6875 (Output_section::add_relaxed_input_section): Adjst code for lookup
6876 maps code refactoring.
2e702c99 6877 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
6878 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
6879 class. If adding input section to a newly created merge output
6880 section fails, remove the new merge section.
6881 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 6882 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 6883 (Output_section::find_merge_section): Ditto.
0439c796 6884 (Output_section::build_lookup_maps): New method defintion.
2e702c99 6885 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
6886 Output_section_lookup_maps class.
6887 (Output_section::get_input_sections): Export merge sections. Adjust
6888 code to use Output_section_lookup_maps class.
6889 (Output_section:::add_script_input_section): Adjust code to use
6890 Output_section_lookup_maps class. Update lookup maps for merge
6891 sections also.
6892 (Output_section::discard_states): Use Output_section_lookup_maps.
6893 (Output_section::restore_states): Same.
6894 * output.h (Merge_section_properties): Move class defintion out of
6895 Output_section.
6896 (Output_section_lookup_maps): New class.
6897 (Output_section::Input_section::is_merge_section): New method
6898 defintion.
6899 (Output_section::Input_section::relobj): Move defintion out of class
6900 defintion. Declare method only.
6901 (Output_section::Input_section::shndx): Ditto.
6902 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 6903 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
6904 (Output_section::Merge_section_by_properties_map,
6905 Output_section::Output_section_data_by_input_section_map,
6906 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
6907 Remove types.
2e702c99 6908 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
6909 KEEPS_INPUT_SECTIONS.
6910 (Output_section::build_lookup_maps): New method declaration.
6911 (Output_section::merge_section_map_,
6912 Output_section::merge_section_by_properties_map_,
6913 Output_section::relaxed_input_section_map_,
6914 Output_section::is_relaxed_input_section_map_valid_): Remove data
6915 members.
6916 (Output_section::lookup_maps_): New data member.
6917
76295588
L
69182010-05-21 Doug Kwan <dougkwan@google.com>
6919
6920 PR gold/11619
6921 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
6922 avoid a compilation error.
6923
d103a984
RÁE
69242010-05-19 Rafael Espindola <espindola@google.com>
6925
6926 * script-sections.cc (Output_section_definition::allocate_to_segment):
6927 Update the phdrs_list even when the output section is NULL.
6928 * testsuite/Makefile.am: Add test.
6929 * testsuite/Makefile.in: Regenerate.
6930 * testsuite/script_test_9.cc: New.
6931 * testsuite/script_test_9.sh: New.
6932 * testsuite/script_test_9.t: New.
6933
6625d24e
DK
69342010-05-19 Doug Kwan <dougkwan@google.com>
6935
6936 * arm.cc (Arm_input_section::original_size): New method.
6937 (Arm_input_section::do_addralign): Add a cast.
6938 (Arm_input_section::do_output_offset): Remove static cast.
6939 (Arm_input_section::original_addralign,
6940 Arm_input_section::original_size_): Change type to uint32_t.
6941 (Arm_input_section::init): Add safe casts for section alignment
6942 and size.
6943 (Arm_input_section::set_final_data_size): Do not set address and
6944 offset of stub table.
6945 (Arm_output_section::fix_exidx_coverage): Change use of of
6946 Output_section::Simple_input_section to that of
6947 Output_section::Input_section.
6948 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
6949 except for the first pass.
6950 * output.cc (Output_section::get_input_sections): Change type of
6951 input_sections to std::list<Input_section>.
6952 (Output_section::add_script_input_section): Rename from
6953 Output_section::add_simple_input_section. Change type of SIS
6954 parameter from Simple_input_section to Input_section.
6955 * output.h (Output_section::Simple_input_section): Remove class.
6956 (Output_section::Input_section): Change class visibility to public.
6957 (Output_section::Input_section::addralign): Use stored alignments
6958 for special input sections if set.
6959 (Output_section::Input_section::set_addralign): New method.
6960 (Output_section::get_input_sections): Change parameter type from
6961 list of Simple_input_section to list of Input_section.
6962 (Output_section::add_script_input_section): Rename from
6963 Output_section::add_simple_input_section. Change first parameter's
6964 type from Simple_input_section to Input_section and remove the
6965 second and third parameters.
6966 * script-sections.cc (Input_section::Input_section_list): Change
6967 type to list of Output_section::Input_section/
6968 (Input_section_info::Input_section_info): Change parameter type of
6969 INPUT_SECTION to Output_section::Input_section.
6970 (Input_section_info::input_section): Change return type.
6971 (Input_section_info::input_section_): Change type to
6972 Output_section::Input_section.
6973 (Output_section_element_input::set_section_addresses): Adjust code
6974 to use Output_section::Input_section instead of
6975 Output_section::Simple_input_section. Adjust code for renaming
6976 of Output_section::add_simple_input_section.
6977 (Orphan_output_section::set_section_addresses): Ditto.
6978
e1e82ea4
RW
69792010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6980
6981 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
6982 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
6983
91e75c8a
RÁE
69842010-05-18 Rafael Espindola <espindola@google.com>
6985
6986 * options.cc (General_options::finalize): Handle -nostdlib.
6987 * options.h (nostdlib): New option.
6988 * script.cc (script_add_search_dir): Handle -nostdlib.
6989
da59ad79
DK
69902010-05-12 Doug Kwan <dougkwan@google.com>
6991
6992 * arm.cc (Target_arm::do_finalize_sections): Create an empty
6993 attributes section only if there no attributes section after merging.
6994 (Target_arm::merge_object_attributes): Move value of
e1df38aa 6995 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
6996 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
6997 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
6998 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
6999 and arm_attr_merge_7.stdout.
7000 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
7001 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
7002 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
7003 arm_attr_merge_7b.o): New rules.
7004 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
7005 arm_attr_merge_7
7006 * testsuite/Makefile.in: Regenerate.
7007 * testsuite/arm_attr_merge.sh: New file.
7008 * testsuite/arm_attr_merge_[67][ab].s: Same.
7009
3e01a7fd
NC
70102010-05-05 Nick Clifton <nickc@redhat.com>
7011
7012 * po/es.po: Updated Spanish translation.
7013
7ad2014a
L
70142010-04-27 H.J. Lu <hongjiu.lu@intel.com>
7015
7016 * Makefile.am (install-exec-local): Properly install gold as
7017 default cross linker.
7018 * Makefile.in: Regenerated.
7019
4fda8867
NC
70202010-04-27 H.J. Lu <hongjiu.lu@intel.com>
7021 Nick Clifton <nickc@redhat.com>
7022
7023 * configure.ac (install_as_default): Define and set to false
7024 unless --enable-gold or --enable-gold=both/gold has been
7025 specified.
7026 * configure: Regenerate.
7027
7028 * Makefile.am (install-exec-local): Install the executable as
7029 'ld.gold'. If install_as_default is true then also install it as
7030 'ld'.
7031 * Makefile.in: Regenerated.
7032
bd288ea2
ILT
70332010-04-24 Ian Lance Taylor <iant@google.com>
7034
7035 * layout.cc (Layout::layout_reloc): In relocatable link don't
7036 combine reloc sections for grouped sections.
7037
ef38fd8a
ST
70382010-04-23 Sriraman Tallam <tmsriram@google.com>
7039
7040 * gc.h (gc_process_relocs): Pass information on relocs pointing to
7041 sections that are not ordinary to icf.
7042 * icf.cc (get_section_contents): Handle relocation pointing to section
7043 with no object or shndx information.
7044 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
7045 * testsuite/Makefile.in: Regenerate.
7046 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
7047 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
7048
f6973bdc
ILT
70492010-04-22 Ian Lance Taylor <iant@google.com>
7050
7051 * expression.cc (Expression::Expression_eval_info): Add
7052 result_alignment_pointer field.
7053 (Expression::eval_with_dot): Add result_alignment_pointer
7054 parameter. Change all callers.
7055 (Expression::eval_maybe_dot): Likewise.
7056 (class Binary_expression): Add alignment_pointer parameter to
7057 left_value and right_value. Change all callers.
7058 (BINARY_EXPRESSION): Set result alignment.
7059 (class Trinary_expression): Add alignment_pointer parameter to
7060 arg2_value and arg3_value. Change all callers.
7061 (Trinary_cond::value): Set result alignment.
7062 (Max_expression::value, Min_expression::value): Likewise.
7063 (Align_expression::value): Likewise.
7064 * script-sections.cc (class Sections_element): Add dot_alignment
7065 parameter to set_section_addresses virtual function. Update
7066 instantiations.
7067 (class Output_section_element): Likewise.
7068 (Script_sections::create_segments): Add dot_alignment parameter.
7069 Change all callers.
7070 (Script_sections::create_segments_from_phdrs_clause): Likewise.
7071 (Script_sections::set_phdrs_clause_addresses): Likewise.
7072 * script-sections.h: Update declarations.
7073 * script.h: Update declarations.
7074 * output.h (Output_segment::set_minimum_p_align): Don't decrease
7075 min_p_align.
7076 * testsuite/script_test_3.t: Set large alignment.
7077 * testsuite/script_test_3.sh: Make sure that at least one LOAD
7078 segment has expected alignment.
7079
9c9c98a5
NC
70802010-04-22 Nick Clifton <nickc@redhat.com>
7081
7082 * po/gold.pot: Updated by the Translation project.
7083 * po/vi.po: Updated Vietnamese translation.
7084
2253bfba
L
70852010-04-22 H.J. Lu <hongjiu.lu@intel.com>
7086
7087 * testsuite/Makefile.am (check_PROGRAMS): Add
7088 icf_virtual_function_folding_test.
7089 * testsuite/Makefile.in: Regenerated.
7090
85fdf906
AH
70912010-04-15 Andrew Haley <aph@redhat.com>
7092
7093 * options.h (merge_exidx_entries): New option.
7094 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
7095 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
7096 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
7097 (Target_arm::merge_exidx_entries): New function.
7098 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
7099 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
7100 to Arm_exidx_fixup constructor.
7101 Add new arg, merge_exidx_entries.
7102 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
7103 Arm_output_section::fix_exidx_coverage.
7104
ce97fa81
ST
71052010-04-18 Sriraman Tallam <tmsriram@google.com>
7106
7107 * icf.cc (get_section_contents): Check for preemptible functions.
7108 Ignore addend when appropriate.
7109 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
7110 section folded.
7111 (add_from_relobj): Check for section folded.
7112 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
7113 * symtab.h (should_add_dynsym_entry): Add new parameter.
7114 * target-reloc.h (scan_relocs): Check for section folded.
7115 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
7116 Check reloc types for function pointers in shared objects.
7117 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
7118 case.
7119 (icf_preemptible_functions_test): New test case.
7120 (icf_string_merge_test): New test case.
7121 * testsuite.Makefile.in: Regenerate.
7122 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
7123 bar_glob. Refactor code.
7124 * testsuite/icf_preemptible_functions_test.cc: New file.
7125 * testsuite/icf_preemptible_functions_test.sh: New file.
7126 * testsuite/icf_string_merge_test.cc: New file.
7127 * testsuite/icf_string_merge_test.sh: New file.
7128 * testsuite/icf_virtual_function_folding_test.cc: New file.
7129 * testsuite/icf_virtual_function_folding_test.sh: New file.
7130
04ceb17c
DK
71312010-04-14 Doug Kwan <dougkwan@google.com>
7132
7133 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
7134 for local symbol recounting if we remove a section due to ICF.
7135 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
7136 there are no regular objects in input.
7137
153e7da4
DK
71382010-04-13 Doug Kwan <dougkwan@google.com>
7139
7140 * arm.cc (Arm_input_section::set_final_data_size): Compute
7141 accurate final data size instead of using current data size.
7142
4dbd9faf
DK
71432010-04-09 Doug Kwan <dougkwan@google.com>
7144
7145 * layout.cc (Layout::choose_output_section): Handle script section
7146 types.
7147 (Layout::make_output_section_for_script): Add section type parameter.
7148 Handle script section types.
7149 * layout.h (Layout::make_output_section_for_script): Add section
7150 type parameter.
7151 * output.cc (Output_section::Output_section): Initialize data member
7152 is_noload_.
7153 (Output_section::do_reset_address_and_file_offset): Do not set address
7154 to 0 if section is a NOLOAD section.
7155 * output.h (Output_section::is_noload): New method.
7156 (Output_section::set_is_noload): Ditto.
7157 (Output_section::is_noload_): New data member.
7158 * script-c.h (Script_section_type): New enum type.
7159 (struct Parser_output_section_header): Add new file section_type.
7160 * script-sections.cc (Sections_element::output_section_name): Add
7161 parameter for returning script section type.
7162 (Output_section_definition::output_section_name): Ditto.
7163 (Output_section_definition::section_type)P; New method.
7164 (Output_section_definiton::script_section_type_name): Ditto.
7165 (Output_section_definition::script_section_type_): New data member.
7166 (Output_section_definition::Output_section_definition): Initialize
7167 data member Output_section_definition::script_section_type_.
7168 (Output_section_definition::create_sections): Pass script section type
7169 to Layout::make_output_section_for_script.
7170 (Output_section_definition::output_section_name): Return script
7171 section type to caller.
7172 (Output_section_definition::set_section_address): Do not advance
7173 dot value and load address if section type is NOLOAD. Set address
7174 of NOLOAD sections regardless of section flags.
7175 (Output_section_definition::print): Print section type if it is
7176 not SCRIPT_SECTION_TYPE_NONE.
7177 (Output_section_definition::section_type): New method.
7178 (Output_section_definition::script_section_type_name): Ditto.
7179 (Script_sections::output_section_name): Add new parameter
7180 PSECTION_TYPE for returning script section type. Pass it to
7181 section elements. Handle discard sections.
7182 (Sort_output_sections::operator()): Handle NOLOAD sections.
7183 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 7184 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
7185 returning script section type.
7186 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
7187 INFO and NOLOAD.
7188 * yyscript.y (union): Add new field SECTION_TYPE.
7189 (COPY, DSECT, INFO, NOLOAD): New tokens.
7190 (opt_address_and_section_type): Change type to output_section_header.
7191 (section_type): New non-terminal
7192 (section_header): Handle section type.
2253bfba 7193 (opt_address_and_section_type): Return section type value.
4dbd9faf 7194
721ea635
L
71952010-04-09 H.J. Lu <hongjiu.lu@intel.com>
7196
7197 * testsuite/plugin_common_test_1.c (foo): Add prototype.
7198 * testsuite/plugin_common_test_2.c (foo): Likewise.
7199
6bf924b0
DK
72002010-04-08 Doug Kwan <dougkwan@google.com>
7201
7202 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
7203 Output_merge_data.
7204 * output.cc (Output_section::add_merge_input_section): Simplify
7205 code and return status of Output_merge_base::add_input_section.
e1df38aa 7206 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
7207 returns true.
7208
24af6f92
DK
72092010-04-07 Doug Kwan <dougkwan@google.com>
7210
7211 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
7212 if section is marked as containing instructions but has no mapping
7213 symbols.
7214 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
7215 correct section index.
7216 (Arm_relobj::find_linked_text_section): Ditto.
7217
00698fc5
CC
72182010-04-07 Cary Coutant <ccoutant@google.com>
7219
7220 * archive.cc (include_member): Destroy Read_symbols_data object before
7221 releasing file.
7222 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
7223 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
7224 (Read_symbols_data::~Read_symbols_data) New destructor.
7225 (Section_relocs::Section_relocs) New constructor.
7226 (Section_relocs::~Section_relocs) New destructor.
7227 (Read_relocs_data::Read_relocs_data) New constructor.
7228 (Read_relocs_data::~Read_relocs_data) New destructor.
7229 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
7230 pointers to NULL after deleting.
7231
7296d933
DK
72322010-04-07 Doug Kwan <dougkwan@google.com>
7233
7234 * arm.cc: Replace "endianity" with "endianness" in comments.
7235 (Arm_exidx_cantunwind): Ditto.
7236 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
7237 (Arm_relobj::merge_flags_and_attributes): New method.
7238 (Arm_relobj::merge_flags_and_attributes_): New data member.
7239 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
7240 (Arm_relobj::scan_sections_for_stubs): Ditto.
7241 (Arm_relobj::do_read_symbols): Check to see if we really want to
7242 merge processor-specific flags and attributes. Exit early if
7243 an object is empty except for section names and the undefined symbol.
7244 (Target_arm::do_finalize_sections): Move check for ELF format to
7245 Arm_relobj::do_read_symbols. Merge processor specific flags and
7246 attributes from a regular object only when we have determined that
7247 it is aapropriate. Do not create an .ARM.attributes section in
7248 output if there is no regular input object.
7249 (Target_arm::merge_processor_specific_flags): Check
7250 --warn-mismatch before printing any error.
7251 (Target_arm::merge_object_attributes): Ditto.
7252 * gold.cc (queue_middle_tasks): Handle the case in which there is
7253 no regular object in input.
7254 * options.cc (General_options::parse_EB): New method.
7255 (General_options::parse_EL): Same.
7256 (General_options::General_options): Initialize endianness_.
7257 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
7258 New options.
7259 (General_options::Endianness): New enum.
7260 (General_options::endianness): New method.
7261 (General_options::endianness_): New data member.
7262 * parameters.cc (Parameters::set_options): Check target endianness.
7263 (Parameters::set_target_once): Ditto.
7264 (Parameters::check_target_endianness): New method.
7265 (parameters_force_valid_target): If either -EL or -EB is specified,
7266 use it to define endianness of default target.
7267 * parameters.h (Parameters::check_target_endianness): New method
7268 declaration.
7269 * target.h (class Target): Change "endianity" to "endianness"
7270 in comments.
7271
efc8d4f2
RW
72722010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7273
7274 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
7275 * configure: Regenerate.
7276 * Makefile.in: Regenerate.
7277 * testsuite/Makefile.in: Regenerate.
7278
be234d88
CC
72792010-04-06 Cary Coutant <ccoutant@google.com>
7280
7281 gcc PR lto/42757
7282 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
7283 prevailing definitions of common symbols.
7284 * testsuite/plugin_test_6.sh: New test case.
7285 * testsuite/plugin_common_test_1.c: New test case.
7286 * testsuite/plugin_common_test_2.c: New test case.
7287 * testsuite/Makefile.am (plugin_test_6): New test case.
7288 * testsuite/Makefile.in: Regenerate.
7289
bd32c6bd
NC
72902010-04-06 Nick Clifton <nickc@redhat.com>
7291
7292 * po/vi.po: New Vietnamese translation.
7293
323c532f
DK
72942010-03-30 Doug Kwan <dougkwan@google.com>
7295
7296 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
7297
4fcd97eb
DK
72982010-03-25 Doug Kwan <dougkwan@google.com>
7299
7300 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
7301 to avoid a conversion warning on a 32-bit host.
7302
4ebf39db
ILT
73032010-03-24 Ian Lance Taylor <iant@google.com>
7304
7305 * testsuite/script_test_3.t: Add a TLS segment.
7306 * testsuite/Makefile.am (check_PROGRAMS): Add
7307 tls_phdrs_script_test.
7308 (tls_phdrs_script_test_SOURCES): Define.
7309 (tls_phdrs_script_test_DEPENDENCIES): Define.
7310 (tls_phdrs_script_test_LDFLAGS): Define.
7311 (tls_phdrs_script_test_LDADD): Define.
7312 * testsuite/Makefile.in: Rebuild.
7313
4a599bdd
CC
73142010-03-23 Cary Coutant <ccoutant@google.com>
7315
7316 * fileread.cc (find_or_make_view): Fix comment.
7317
6c93b22c
ILT
73182010-03-23 Ian Lance Taylor <iant@google.com>
7319
7320 * script-sections.cc (class Orphan_section_placement): Define
7321 PLACE_TLS and PLACE_TLS_BSS.
7322 (Orphan_section_placement::Orphan_section_placement): Initialize
7323 new places.
7324 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
7325 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
7326 (tls_script_test_SOURCES): Define.
7327 (tls_script_test_DEPENDENCIES): Define.
7328 (tls_script_test_LDFLAGS): Define.
7329 (tls_script_test_LDADD): Define.
7330 * testsuite/Makefile.in: Rebuild.
7331
a2c7281b
DK
73322010-03-22 Doug Kwan <dougkwan@google.com>
7333
7334 * arm.cc (Arm_relocate_functions::abs8,
7335 Arm_relocate_functions::abs16): Use correct check for overflow
7336 specified in the ARM ELF specs.
7337 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
7338 target of a BLX instruction specially.
7339 (Reloc_stub::stub_type_for_reloc): Ditto.
7340 (Relocate::relocate): Use symbolic names instead of numeric relocation
7341 codes to report error.
7342 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
7343 workaround.
7344 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
7345 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
7346 thumb2_blx_out_of_range.stdout
7347 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
7348 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
7349 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
7350 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
7351 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
7352 thumb2_blx_in_range, thumb2_blx_in_range.o,
7353 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
7354 thumb2_blx_out_of_range.o): New rules.
2e702c99 7355 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
7356 thumb2_blx_in_range and thumb2_blx_out_of_range.
7357 * testsuite/Makefile.in: Regenerate.
7358 * arm_branch_in_range.sh: Add tests for THUMB BLX.
7359 * testsuite/thumb_blx_in_range.s: New file.
7360 * testsuite/thumb_blx_out_of_range.s: New file.
7361
b0193076
RÁE
73622010-03-22 Rafael Espindola <espindola@google.com>
7363
7364 * archive.cc (Should_include): Move to archive.h.
7365 (should_include_member): Make it a member of Archive.
7366 (Lib_group): New.
7367 (Add_lib_group_symbols): New.
7368 * archive.h: Include options.h.
7369 (Archive_member): Moved from Archive.
7370 (Should_include): Moved from archive.cc.
7371 (Lib_group): New.
7372 (Add_lib_group_symbols): New.
7373 * dynobj.cc (do_should_include_member): New.
7374 * dynobj.h (do_should_include_member): New.
7375 * gold.cc (queue_initial_tasks): Update call to queue.
7376 * main.cc (main): Print lib group stats.
7377 * object.cc (do_should_include_member): New.
7378 * object.h: Include archive.h.
7379 (Object::should_include_member): New.
7380 (Object::do_should_include_member): New.
7381 (Sized_relobj::do_should_include_member): New.
7382 * options.cc (General_options::parse_start_lib): New.
7383 (General_options::parse_end_lib): New.
7384 (Input_arguments::add_file): Handle lib groups.
7385 (Input_arguments::start_group): Check we are not in a lib.
7386 (Input_arguments::start_lib): New.
7387 (Input_arguments::end_lib): New.
7388 * options.h (General_options): Add start_lib and end_lib.
7389 (Input_argument::lib_): New.
7390 (Input_argument::lib): New.
7391 (Input_argument::is_lib): New.
7392 (Input_file_lib): New.
7393 (Input_arguments::in_lib_): New.
7394 (Input_arguments::in_lib): New.
7395 (Input_arguments::start_lib): New.
7396 (Input_arguments::end_lib_): New.
7397 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
7398 in unused members as preempted.
7399 (Sized_pluginobj::do_should_include_member): New.
7400 * plugin.h (Sized_pluginobj::do_should_include_member): New.
7401 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
7402 return the blocker.
7403 (Read_symbols::do_whole_lib_group): New.
7404 (Read_symbols::do_lib_group): New.
7405 (Read_symbols::do_read_symbols): Handle lib groups.
7406 (Read_symbols::get_name): Handle lib groups.
7407 * readsyms.h (Read_symbols): Add an archive member pointer.
7408 (Read_symbols::do_whole_lib_group): New.
7409 (Read_symbols::do_lib_group): New.
7410 (Read_symbols::member_): New.
7411 * script.cc (read_input_script): Update call to queue_soon.
7412
d099120c
DK
74132010-03-19 Doug Kwan <dougkwan@google.com>
7414
7415 * arm.cc (Stub_table::Stub_table): Initialize new data members
7416 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
7417 (Stub_table::add_reloc_stub): Assign stub offset and update
7418 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
7419 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
7420 New data members.
2e702c99 7421 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
7422 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
7423 instead of going over all reloc stubs.
2e702c99 7424 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
7425 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
7426 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 7427 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
7428 Stringpool_template::offset_.
7429 * stringpool.h (Stringpool_template::set_no_zero_null): Set
7430 Stringpool_template::offset_ to zero.
7431
1aa37384
DK
74322010-03-15 Doug Kwan <dougkwan@google.com>
7433
7434 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
7435 offset_.
7436 (Stringpool_template::new_key_offset): New method.
7437 (Stringpool_template::add_string): Assign offsets when adding new
7438 strings.
7439 (Stringpool_template::set_string_offsets): Do not set string offsets
7440 when not optimizing.
7441 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
7442 member size_.
2e702c99
RM
7443 (Chunked_vector::clear): Clear size_.
7444 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
7445 (Chunked_vector::size): Return size_.
7446 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 7447 (Chunked_vector::size_): New data member.
1aa37384
DK
7448 (Stringpool_template::set_no_zero_null): Assert string set is empty.
7449 (Stringpool_template::new_key_offset): New method declaration.
7450 (Stringpool_template::offset_): New data member.
7451
b672b057
RÁE
74522010-03-15 Rafael Espindola <espindola@google.com>
7453
7454 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
7455 Add_symbols' constructor.
7456 * readsyms.h (Add_symbols): Remove the input_group member.
7457
b6848d3c
ILT
74582010-03-10 Ian Lance Taylor <iant@google.com>
7459
7460 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
7461 target to ask whether a reference to a symbol requires a stack
7462 split.
7463 * target.h (Target::is_call_to_non_split): New function.
7464 (Target::do_is_call_to_non_split): Declare virtual function.
7465 * target.cc: Include "symtab.h".
7466 (Target::do_is_call_to_non_split): New function.
7467 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
7468
a2a5469e
CC
74692010-03-10 Cary Coutant <ccoutant@google.com>
7470
7471 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
7472 (File_read::open[1]): Remove initial mapping of whole_file_view_.
7473 (File_read::open[2]): Add whole_file_view_ to list of views.
7474 (File_read::make_view): Remove test of whole_file_view_.
7475 (File_read::find_or_make_view): Create whole_file_view_ if
7476 necessary.
7477 (File_read::clear_views): Replace bool parameter with enum;
7478 adjust all callers. Don't delete views with permanent data;
7479 do delete cached views and views from archives if
7480 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
7481 if clearing the corresponding view.
7482 * fileread.h (File_read::Clear_views_mode): New enum.
7483 (File_read::View::is_permanent_view): New method.
7484 (File_read::clear_views): Replace bool parameter
7485 with enum; adjust all callers.
7486 * options.h (General_options): Change keep_files_mapped option;
7487 add map_whole_files.
7488 * readsyms.cc (Add_symbols::run): Delete sd_ object before
7489 releasing the file.
7490 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
7491 the file.
7492
8861f32b
DM
74932010-03-10 David S. Miller <davem@davemloft.net>
7494
7495 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
7496
d62d0f5f
ST
74972010-03-09 Sriraman Tallam <tmsriram@google.com>
7498
7499 * icf.cc (get_section_contents): Add '@' marker after processing the
7500 merge reloc.
7501
9177756d
DK
75022010-03-08 Doug Kwan <dougkwan@google.com>
7503
7504 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
7505 due to a conversion warning.
7506 (Arm_relobj::update_output_local_symbol_count): Check for local
7507 symbol with unset output index.
7508
9e9e071b
ILT
75092010-03-05 Ian Lance Taylor <iant@google.com>
7510
7511 * options.h (class General_options): Add --spare-dynamic-tags.
7512 * output.cc (Output_data_dynamic::set_final_data_size): Implement
7513 --spare-dynamic-tags.
7514
a81ee015
ILT
75152010-03-05 Ian Lance Taylor <iant@google.com>
7516
7517 * incremental.cc: Include "libiberty.h".
7518
44ec90b9
RO
75192010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
7520
7521 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
7522 function, is_info_ member.
7523 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
7524 (Versions::Versions): Update caller.
7525 (Versions::define_base_version): Likewise.
7526 (Versions::add_def): Likewise.
7527
0897ed3b
ST
75282010-03-03 Sriraman Tallam <tmsriram@google.com>
7529
7530 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
7531 (Scan::possible_function_pointer_reloc): New function.
7532 (Scan::local_reloc_may_be_function_pointer): Change to call
7533 possible_function_pointer_reloc.
7534 (Scan::global_reloc_may_be_function_pointer): Ditto.
7535 * icf.h (Icf::check_section_for_function_pointers): Change to reject
7536 relocations in ".data.rel.ro._ZTV" section.
7537 * testsuite/icf_safe_so_test.sh: Change to pass i386.
7538 * testsuite/icf_safe_so_test.cc: Ditto.
7539 * testsuite/icf_safe_test.cc: Ditto.
7540 * testsuite/icf_safe_test.sh: Ditto.
7541
d3bbad62
ILT
75422010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7543 Ian Lance Taylor <iant@google.com>
7544
7545 * target-reloc.h (relocate_section): Check the symbol table index
7546 for -1U before setting the local symbol index.
7547 (scan_relocatable_relocs): If copying the relocation, record that
7548 the local symbol is required.
7549 * object.h (Symbol_value::is_output_symtab_index_set): New
7550 function.
7551 (Symbol_value::may_be_discarded_from_output_symtab): New
7552 function.
7553 (Symbol_value::has_output_symtab_entry): New function.
7554 (Symbol_value::needs_output_symtab_entry): Remove.
7555 (Symbol_value::output_symtab_index): Make sure the symbol index is
7556 set.
7557 (Symbol_value::set_output_symtab_index): Make sure the symbol
7558 index is not set. Make sure the new index is valid.
7559 (Symbol_value::set_must_have_output_symtab_entry): New function.
7560 (Symbol_value::has_output_dynsym_entry): New function.
7561 (Symbol_value::set_output_dynsym_index): Make sure the new index
7562 is valid.
7563 (Sized_relobj::set_must_have_output_symtab_entry): New function.
7564 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
7565 local symbol if permitted.
7566 (Sized_relobj::do_finalize_local_symbols): Call
7567 is_output_symtab_index_set rather than needs_output_symtab_entry.
7568 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
7569 rather than needs_output_symtab_entry. Call
7570 has_output_dynsym_entry rather than needs_output_dynsym_entry.
7571 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
7572 is_output_symtab_index_set rather than needs_output_symtab_entry.
7573 * testsuite/discard_locals_relocatable_test.c: New file.
7574 * testsuite/discard_locals_test.sh: Test -r.
7575 * testsuite/Makefile.am (check_DATA): Add
7576 discard_locals_relocatable_test1.syms,
7577 discard_local_relocatable_test2.syms.
7578 (MOSTLYCLEANFILES): Likewise. Also add
7579 discard_locals_relocatable_test1.lout and
7580 discard_locals_relocatable_test2.out.
7581 (discard_locals_relocatable_test1.syms): New target.
7582 (discard_locals_relocatable_test.o): New target.
7583 (discard_locals_relocatable_test1.out): New target.
7584 (discard_locals_relocatable_test2.syms): New target.
7585 (discard_locals_relocatable_test2.out): New target.
7586 (various): Add missing ../ld-new dependencies.
7587 * testsuite/Makefile.in: Rebuild.
7588
7e8ccf26
NC
75892010-03-03 Nick Clifton <nickc@redhat.com>
7590
7591 * po/fi.po: New Finnish translation.
7592
2a0ff005
DK
75932010-03-01 Doug Kwan <dougkwan@google.com>
7594
7595 * layout.cc (Layout::Layout): Force section types of .init_array*,
7596 .preinit_array* and .fini_array* sections.
7597 * output.cc (Output_section::Input_section_sort_entry::has_priority):
7598 Fix check of return value of std::string::find.().
7599 (Output_section::Input_section_sort_compare::operator()): Remove
7600 comment about .init_array.
7601 (Output_section::Input_section_sort_init_fini_compare::operator()):
7602 New method.
7603 (Output_section::sort_attached_input_sections): Handle .init_array
7604 and .fini_array specially.
7605 * output.h (Output_section::Inut_section_sort_compare): Update
7606 comment.
7607 (Output_section::Input_section_sort_init_fini_compare): New struct.
7608
c3e4ae29
DK
76092010-02-26 Doug Kwan <dougkwan@google.com>
7610
7611 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
7612 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
7613 * testsuite/debug_msg.sh: Avoid matching source line number for
7614 use of global variable undef_int.
7615
2fd9ae7a
DK
76162010-02-26 Doug Kwan <dougkwan@google.com>
7617
7618 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
7619 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
7620 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
7621 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
7622 * options.cc (General_options::General_options): Initialize member
7623 fix_v4bx_.
7624 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
7625 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
7626 and rm_no_fix_v4bx.stdout
7627 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
7628 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
7629 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
7630 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
7631 and arm_no_fix_v4bx.
7632 * Makefile.in: Regenerate.
7633 * testsuite/arm_fix_v4bx.s: New file.
7634 * testsuite/arm_fix_v4bx.sh: Ditto.
7635
67ec7d0b
DK
76362010-02-24 Doug Kwan <dougkwan@google.com>
7637
7638 * arm.cc (Target_arm::got_section): Make the .got section the first
7639 non RELRO section in the data segment.
7640 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
7641 suffixes of section names.
7642
10165461
DK
76432010-02-24 Doug Kwan <dougkwan@google.com>
7644
7645 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
7646 flags and attributes merging if an input file is a binary file.
7647 * fileread.cc (Input_file::open): Record format of original file.
7648 * fileread.h (Input_file::Format): New enum type.
2e702c99 7649 (Input_file::Input_file): Initialize data member format_.
10165461
DK
7650 (Input_file::format): New method definition.
7651 (Input_file::format_):: New data member.
7652
4a54abbb
DK
76532010-02-24 Doug Kwan <dougkwan@google.com>
7654
7655 * arm.cc (Arm_output_data_got): New class.
7656 (ARM_TCB_SIZE): New constant
7657 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
7658 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
7659 If user uses a script with a SECTIONS clause, issue only a warning
7660 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 7661 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
7662 garbage collection.
7663 (Target_arm::got_mode_index_entry): Handle static linking.
7664 (Target_arm::Scan::local): Ditto.
7665 (Target_arm::Scan::global): Ditto.
7666 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
7667 all incorrectly implemented relocations.
e1df38aa 7668 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
7669 Arm_output_section::fix_exidx_coverage.
7670 * layout.cc (Layout::section_name_mapping): Remove trailing dots
7671 from ".ARM.exidx." and ".ARM.extab.".
7672
ca419a6f
ILT
76732010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7674
7675 * arm.cc (Target_arm::do_finalize_sections): Create attribute
7676 section if it does not already exist.
7677 * attributes.cc (Attributes_section_data::Attributes_section_data):
7678 Don't crash if size is zero.
7679
135b9c78
ILT
76802010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7681 Ian Lance Taylor <iant@google.com>
7682
7683 * gold.cc (queue_middle_tasks): If no input files were opened,
7684 exit.
7685 * workqueue.h (Task_function::Task_function): Assert that there is
7686 a blocker.
7687
bb0bfe4f
DK
76882010-02-22 Doug Kwan <dougkwan@google.com>
7689
7690 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
7691 * icf.cc (get_section_contents): Cast snprintf arguments to long long
7692 types to avoid warnings due to different uint64_t implementations
7693 on different hosts.
7694
2a2b6d42
DK
76952010-02-21 Doug Kwan <dougkwan@google.com>
7696
7697 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
7698 handling of the maximum backward branch offset.
2e702c99 7699 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
7700 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
7701 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 7702 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
7703 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
7704 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
7705 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
7706 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
7707 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
7708 thumb_bl_out_of_range thumb_bl_out_of_range.o,
7709 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
7710 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
7711 thumb2_bl_out_of_range.o): New rules.
7712 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
7713 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
7714 thumb2_bl_out_of_range
7715 * testsuite/Makefile.in: Regenerate.
7716 * testsuite/arm_bl_in_range.s: New file.
7717 * testsuite/arm_bl_out_of_range.s: Ditto.
7718 * testsuite/arm_branch_in_range.sh: Ditto.
7719 * testsuite/arm_branch_range.t: Ditto.
7720 * testsuite/thumb2_branch_range.t: Ditto.
7721 * testsuite/thumb_bl_in_range.s: Ditto.
7722 * testsuite/thumb_bl_out_of_range.s: Ditto.
7723 * testsuite/thumb_branch_range.t: Ditto.
7724
b487ad64
ST
77252010-02-20 Sriraman Tallam <tmsriram@google.com>
7726
7727 * gc.h (gc_process_relocs): Change vectors to point to the new list.
7728 Add reloc offset information.
7729 * icf.cc (get_section_contents): Change iterators to point to the new
7730 vectors. Add reloc offset information to the contents.
7731 * icf.h (Icf::Sections_reachable_info): New typedef.
7732 (Icf::Sections_reachable_list): New typedef.
7733 (Icf::Offset_info): New typedef.
7734 (Icf::Reloc_info): New struct typedef.
7735 (Icf::Reloc_info_list): New typedef.
7736 (Icf::symbol_reloc_list): Delete method.
7737 (Icf::addend_reloc_list): Delete method.
7738 (Icf::section_reloc_list): Delete method.
7739 (Icf::reloc_info_list): New method.
7740 (Icf::reloc_info_list_): New member.
7741
f96accdf
DK
77422010-02-19 Doug Kwan <dougkwan@google.com>
7743
7744 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
7745 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
7746 * arm.cc (Arm_relocation_functions): New forward declaration.
7747 (Target_arm::Target_arm): Initialize new data members
7748 got_mod_index_offset_ and tls_base_symbol_defined_.
7749 (Target_arm::Relocate::relocate_tls): New method.
7750 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
7751 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
7752 New methods.
2e702c99 7753 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
7754 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
7755 (Target_arm::got_mod_index_offset_,
7756 Target_arm::tls_base_symbol_defined_): New data members.
7757 (Target_arm::Scan::local, Target::Scan::global,
7758 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
7759 relocations.
7760
c8761b9a
DK
77612010-02-18 Doug Kwan <dougkwan@google.com>
7762
7763 * arm.cc (Arm_relobj::find_linked_text_section): New method.
7764 (Arm_relobj::make_exidx_input_section): Pass section index of linked
7765 text section as a parameter becuase some broken tools may not set
7766 the link in section header.
7767 (Target_arm::has_got_section): New method.
7768 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
7769 without any mapping symbol as data only. Remove warning.
7770 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
7771 link in its section header, try to discover the link by inspecting the
7772 REL31 relocation at the beginning of the section.
7773 (Target_arm::Scan::check_non_pic): Report name of offending relocation
7774 in error message.
7775 (Target_arm::Scan::global): Treat any reference to the symbol
7776 _GLOBAL_OFFSET_TABLE_ as a GOT access.
7777
21bb3914
ST
77782010-02-12 Sriraman Tallam <tmsriram@google.com>
7779
7780 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
7781 (Scan::global_reloc_may_be_function_pointer): New function.
7782 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
7783 (Scan::global_reloc_may_be_function_pointer): New function.
7784 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
7785 (Scan::global_reloc_may_be_function_pointer): New function.
7786 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
7787 (Scan::global_reloc_may_be_function_pointer): New function.
7788 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
7789 (Scan::global_reloc_may_be_function_pointer): New function.
7790 (Scan::possible_function_pointer_reloc): New function.
7791 (Target_x86_64::can_check_for_function_pointers): New function.
7792 * gc.h (gc_process_relocs): Scan relocation types to determine if
7793 function pointers were taken for targets that support it.
7794 * icf.cc (Icf::find_identical_sections): Include functions for
7795 folding in safe ICF whose pointer is not taken.
7796 * icf.h (Secn_fptr_taken_set): New typedef.
7797 (fptr_section_id_): New member.
7798 (section_has_function_pointers): New function.
7799 (set_section_has_function_pointers): New function.
7800 (check_section_for_function_pointers): New function.
7801 * options.h: Fix comment for safe ICF option.
7802 * target.h (can_check_for_function_pointers): New function.
7803 * testsuite/Makefile.am: Add icf_safe_so_test test case.
7804 Modify icf_safe_test for X86-64.
7805 * testsuite/Makefile.in: Regenerate.
7806 * testsuite/icf_safe_so_test.cc: New file.
7807 * testsuite/icf_safe_so_test.sh: New file.
7808 * testsuite/icf_safe_test.cc (kept_func_3): New function.
7809 (main): Change to take pointer to function kept_func_3.
7810 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
7811 folding is done correctly for X86-64.
7812
0da6fa6c
DM
78132010-02-12 David S. Miller <davem@davemloft.net>
7814
7815 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
7816 is_symbolless parameter.
7817 (Output_reloc<SHT_REL>::is_symbolless): New.
7818 (Output_reloc<SHT_REL>::is_symbolless_): New.
7819 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
7820 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
7821 (Output_reloc<SHT_RELA>::is_symbolless): New.
7822 (Output_data_reloc::add_global): Handle is_symbolless.
7823 (Output_data_reloc::add_global_relative): Likewise.
7824 (Output_data_reloc::add_local): Likewise.
7825 (Output_data_reloc::add_local_relative): Likewise.
7826 (Output_data_reloc::add_symbolless_global_addend): New.
7827 (Output_data_reloc::add_symbolless_local_addend): New.
7828 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
7829 is_symbolless.
7830 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
7831 instead of ->is_relative_
7832 (Output_reloc::write): Likewise.
7833 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
7834 (Output_reloc::write_rel): Simplify.
7835
7836 * sparc.cc (Target_sparc::Scan::local): Use
7837 ->add_symbolless_local_addend as needed.
7838 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
7839 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
7840 based upon relocation offset.
7841
e4782e83
DK
78422010-02-11 Doug Kwan <dougkwan@google.com>
7843
7844 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
7845 (Target_arm::Scan::global): Ditto. Also remove a comment before the
7846 beginning of function.
7847 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
7848 and MOVT_ABS relocations. Those are non issued in scanning. Fix
7849 parameter is_32bit in calls to should_apply_static_reloc.
7850 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
7851 (check_DATA): Add arm_abs_global.stdout.
7852 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
7853 arm_abs_global.stdout): New rules.
7854 (MOSTLLYCLEANFILES): Add arm_abs_global
7855 * Makefile.in: Regenerate.
7856 * testsuite/arm_abs_global.s: New file.
7857 * testsuite/arm_abs_global.sh: Ditto.
7858 * testsuite/arm_abs_lib.s: Ditto.
7859
93ceb764
ILT
78602010-02-11 Ian Lance Taylor <iant@google.com>
7861
7862 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
7863 Read_relocs task.
7864 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
7865 Allocate_commons_task first.
7866 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
7867 task, rather than symtab_lock_.
7868 (Gc_process_relocs::~Gc_process_relocs): New function.
7869 (Gc_process_relocs::is_runnable): Check this_blocker_.
7870 (Gc_process_relocs::locks): Use next_blocker_ rather than
7871 blocker_.
7872 (Scan_relocs::~Scan_relocs): New function.
7873 (Scan_relocs::is_runnable): Check this_blocker_ rather than
7874 symtab_lock_.
7875 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
7876 next_blocker_.
7877 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
7878 fields. Add this_blocker_ and next_blocker_ fields. Adjust
7879 constructor accordingly.
7880 (class Gc_process_relocs): Likewise.
7881 (class Scan_relocs): Likewise.
7882 * common.h (class Allocate_commons_task): Remove symtab_lock_
7883 field, and corresponding constructor parameter.
7884 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
7885 symtab_lock_.
7886 (Allocate_commons_task::locks): Likewise.
7887
114dfbe1
ILT
78882010-02-11 Ian Lance Taylor <iant@google.com>
7889
7890 * gold-threads.h (class Once): Define.
7891 (class Initialize_lock): Rewrite as child of Once.
7892 * gold-threads.cc (class Once_initialize): Define.
7893 (once_pointer_control): New static variable.
7894 (once_pointer, once_arg): New static variables.
7895 (c_run_once): New static function.
7896 (Once::Once, Once::run_once, Once::internal_run): New functions.
7897 (class Initialize_lock_once): Remove.
7898 (initialize_lock_control): Remove.
7899 (initialize_lock_pointer): Remove.
7900 (initialize_lock_once): Remove.
7901 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
7902 (Initialize_lock::initialize): Rewrite.
7903 (Initialize_lock::do_run_once): New function.
7904 * archive.cc (Archive::interpret_header): Only clear name if it is
7905 not already empty.
7906 * fileread.cc: Include "gold-threads.h"
7907 (file_counts_lock): New static variable.
7908 (file_counts_initialize_lock): Likewise.
7909 (File_read::release): Only increment counts when using --stats.
7910 Use a lock around the increment.
7911 * parameters.cc (class Set_parameters_target_once): Define.
7912 (set_parameters_target_once): New static variable.
7913 (Parameters::Parameters): Move here from parameters.h.
7914 (Parameters::set_target): Rewrite.
7915 (Parameters::set_target_once): New function.
7916 (Parameters::clear_target): Move here and rewrite.
7917 * parameters.h (class Parameters): Update declarations. Add
7918 set_parameters_target_once_ field.
7919 (Parameters::Parameters): Move to parameters.cc.
7920 (Parameters::clear_target): Likewise.
7921 * readsyms.cc (Read_symbols::do_group): Create a Start_group
7922 task.
7923 (Start_group::~Start_group): New function.
7924 (Start_group::is_runnable): New function.
7925 (Start_group::locks, Start_group::run): New functions.
7926 (Finish_group::run): Change saw_undefined to size_t.
7927 * readsyms.h (class Start_group): Define.
7928 (class Finish_group): Change saw_undefined_ field to size_t.
7929 (Finish_group::Finish_group): Remove saw_undefined and
7930 this_blocker parameters. Change all callers.
7931 (Finish_group::set_saw_undefined): New function.
7932 (Finish_group::set_blocker): New function.
7933 * symtab.h (class Symbol_table): Change saw_undefined to return
7934 size_t. Change saw_undefined_ field to size_t.
7935 * target-select.cc (Set_target_once::do_run_once): New function.
7936 (Target_selector::Target_selector): Initialize set_target_once_
7937 field. Don't initialize lock_ and initialize_lock_ fields.
7938 (Target_selector::instantiate_target): Rewrite.
7939 (Target_selector::set_target): New function.
7940 * target-select.h (class Set_target_once): Define.
7941 (class Target_selector): Update declarations. Make
7942 Set_target_once a friend. Remove lock_ and initialize_lock_
7943 fields. Add set_target_once_ field.
7944
fa17a3f4
ILT
79452010-02-10 Ian Lance Taylor <iant@google.com>
7946
7947 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
7948 queueing any tasks.
7949 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
7950 (queue_middle_tasks): Add all blockers before queueing any tasks.
7951 (queue_final_tasks): Likewise.
7952 * token.h (Task_token::add_blockers): New function.
7953 * object.h (Input_objects::number_of_relobjs): New function.
7954
c7177d31
ILT
79552010-02-10 Ian Lance Taylor <iant@google.com>
7956
5de0e392
ILT
7957 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
7958 shared, not if not position independent.
7959 * x86_64.cc (Relocate::relocate_tls): Likewise.
7960 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
7961 (tls_pie_pic_test): New target.
7962 * testsuite/Makefile.in: Rebuild.
7963
c7177d31
ILT
7964 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
7965 (tls_test_main_pie.o, tls_test_pie.o): New targets.
7966 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
7967 * testsuite/Makefile.in: Rebuild.
7968
684b268a
DM
79692010-02-09 David S. Miller <davem@davemloft.net>
7970
7971 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
7972 R_SPARC_RELATIVE using ->add_local_relative().
7973 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
7974
612a8d3d
DM
7975 * output.h (Output_data_dynamic::add_section_size): New method
7976 that takes two Output_data objects.
7977 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
7978 entry param. Handle it in initializers.
7979 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
7980 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
7981 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
7982 arg.
7983 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
7984 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
7985 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
7986 for dynrel_includes_plt.
7987 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7988 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7989 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
7990 before .rela.plt
7991 (Target_sparc::do_finalize_sections): Update to pass true for
7992 dynrel_includes_plt.
7993 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
7994 output before .rela.plt
7995 (Target_powerpc::do_finalize_sections): Update to pass true for
7996 dynrel_includes_plt when 32-bit.
7997
cb1be87e
DK
79982010-02-08 Doug Kwan <dougkwan@google.com>
7999
8000 * arm.cc (Arm_relobj::simple_input_section_output_address): New
8001 method.
8002 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
8003 Arm_relobj::scan_section_for_cortex_a8_stubs,
8004 Arm_relobj::do_relocation_section): Instead of calling
8005 Output_section::output_address, use faster
8006 Arm_relobj::simple_input_section_output_address.
8007
705b5121
DM
80082010-02-08 David S. Miller <davem@davemloft.net>
8009
8010 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
8011 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
8012 relocation helper function.
8013
024c4466
DM
8014 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
8015 just like R_SPARC_GOT{10,13,22}.
8016 (Target_sparc::Scan::local): Likewise.
8017 (Target_sparc::Relocate:relocate): Likewise.
8018
9109c078
ILT
80192010-02-06 Ian Lance Taylor <iant@google.com>
8020
8021 * configure.ac: Rewrite targetobjs duplicate removal code to use
8022 only shell constructs.
8023 * configure: Rebuild.
8024
cf846138
DK
80252010-02-05 Doug Kwan <dougkwan@google.com>
8026
8027 PR 11247
8028 * arm.cc (Arm_relobj::section_is_scannable): New method.
8029 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
8030 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
8031
6cfaf60b
DK
80322010-02-04 Doug Kwan <dougkwan@google.com>
8033
8034 PR 11247
8035 * arm-reloc-property.cc (cstdio): Include.
8036 * configure.ac (targetobjs): Remove duplicates.
8037 * configure: Regenerate.
8038 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
8039 big and little endian version for a given address size.
8040
5c57f1be
DK
80412010-02-03 Doug Kwan <dougkwan@google.com>
8042
8043 * arm-reloc-property.cc
8044 (Arm_reloc_property_table::reloc_name_in_error_message): New method
8045 definition.
8046 * arm-reloc-property.h
8047 (Arm_reloc_property_table::get_implemented_static_reloc_property):
8048 New method definition.
8049 (Arm_reloc_property_table::reloc_name_in_error_message): New method
8050 declaration.
8051 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
8052 overflow to N.
8053 (GOT_PREL): Change implemented to Y.
8054 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
8055 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
8056 (Arm_relocate_functions::movw_abs_nc): Remove method.
8057 (Arm_relocate_functions::movt_abs): Ditto.
8058 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
8059 (Arm_relocate_functions::thm_movt_abs): Ditto.
8060 (Arm_relocate_functions::movw_rel_nc): Ditto.
8061 (Arm_relocate_functions::movw_rel): Ditto.
8062 (Arm_relocate_functions::movt_rel): Ditto.
8063 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
8064 (Arm_relocate_functions:thm_movw_rel): Ditto.
8065 (Arm_relocate_functions:thm_movt_rel): Ditto.
8066 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
8067 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
8068 New method definitions.
8069 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
8070 (Arm_relocation_functions::arm_grp_ldr): Ditto.
8071 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
8072 (Arm_relocation_functions::arm_grp_ldc): Ditto.
8073 (Target_arm::Relocate::relocate): Check for non-static or
8074 unimplemented relocation code and exit early. Change calls to
8075 Target_arm::reloc_uses_thumb_bit and
8076 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
8077 instead. Refactor code to handle similar relocations to increase
8078 code sharing. Remove check for unsupported relocation code in switch
8079 statement.
8080 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
8081 relocation property table to find out size. Change error message to
8082 print out the name of a relocation code instead of the numeric value.
8083 (Target_arm::scan_reloc_for_stub): Use relocation property table
8084 instead of calling Target_arm::reloc_uses_thumb_bit().
8085
218c5831
DK
80862010-02-02 Doug Kwan <dougkwan@google.com>
8087
8088 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
8089 types of relaxed input section.
8090
0d31c79d
DK
80912010-02-02 Doug Kwan <dougkwan@google.com>
8092
8093 * Makefile.am (HFILES): Add arm-reloc-property.h.
8094 (DEFFILES): New.
2e702c99
RM
8095 (TARGETSOURCES): Add arm-reloc-property.cc
8096 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
8097 (libgold_a_SOURCES): $(DEFFILES)
8098 * Makefile.in: Regenerate.
8099 * arm-reloc-property.cc: New file.
8100 * arm-reloc-property.h: New file.
8101 * arm-reloc.def: New file.
8102 * arm.cc: Update comments.
8103 (arm-reloc-property.h): New included header.
8104 (arm_reloc_property_table): New global variable.
8105 (Target_arm::do_select_as_default_target): New method definition.
8106 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
8107 arm-reloc-property to targ_extra_obj.
8108 * parameters.cc (set_parameters_target): Call
8109 Target::select_as_default_target().
8110 * target.h (Target::select_as_default_target): New method definition.
8111 (Target::do_select_as_default_target): Same.
8112
546c7457
DK
81132010-02-01 Doug Kwan <dougkwan@google.com>
8114
8115 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
8116 first_output_text_section_.
8117 (Arm_exidx_fixup::first_output_text_section): New method definition.
8118 (Arm_exidx_fixup::first_output_text_section_): New data member.
8119 (Arm_exidx_fixup::process_exidx_section): Record the first text
8120 output section seen.
8121 (Arm_output_section::fix_exidx_coverage): Set correct linked section
8122 and entsize in output section header.
8123
11b861d5
DK
81242010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8125
8126 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
8127 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
8128 (Arm_relocate_functions::thm_alu11): New Method.
8129 (Arm_relocate_functions::thm_pc8): New Method.
8130 (Arm_relocate_functions::thm_pc12): New Method.
8131 (Target_arm::Scan::local): Handle the relocations.
8132 (Target_arm::Scan::global): Likewise.
8133 (Target_arm::Relocate::relocate): Likewise.
8134 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8135
c9a2c125
DK
81362010-01-29 Doug Kwan <dougkwan@google.com>
8137
8138 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
8139 of relocation types as ld.
8140
1521477a
DK
81412010-01-29 Doug Kwan <dougkwan@google.com>
8142
8143 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
8144 to public.
8145 (Arm_relocate_functions::thumb_branch_common): Ditto.
8146 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
8147 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
8148 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
8149 Arm_relocate_functions::jump24): Remove.
8150 (Target_arm::Relocate::relocate): Adjust code to call
8151 Arm_relocation_functions::arm_branch_common and
8152 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 8153 wrappers. Merge switch-cases together to reduce source code size.
1521477a 8154
e7eca48c
DK
81552010-01-29 Doug Kwan <dougkwan@google.com>
8156
8157 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
8158 output_local_symbol_count_needs_update_.
8159 (Arm_relobj::output_local_symbol_count_needs_update,
8160 Arm_relobj::set_output_local_symbol_count_needs_update,
8161 Arm_relobj::update_output_local_symbol_count): New methods.
8162 (Arm_relobj::output_local_symbol_count_needs_update_): New data
8163 member.
8164 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
8165 of pointed function as in a R_ARM_PREL31 relocation.
8166 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
8167 for output local symbol count updating.
8168 (Target_arm::do_relax): Update output local symbol counts in objects
8169 if necessary.
8170 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
8171
02961d7e
ILT
81722010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8173
8174 * arm.cc: Added support for the ARM relocations:
8175 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
8176 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
8177 (Arm_relocate_functions::movw_rel_nc): Renamed (was
8178 movw_prel_nc).
8179 (Arm_relocate_functions::movw_rel): New method.
8180 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
8181 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
8182 thm_movw_prel_nc).
8183 (Arm_relocate_functions::thm_movw_rel): New method.
8184 (Arm_relocate_functions::thm_movt_rel): Renamed (was
8185 thm_movt_prel).
8186 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
8187 relocations.
8188 (Target_arm::Scan::global): Likewise.
8189 (Target_arm::Relocate::relocate): Likewise.
8190 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8191 Likewise.
8192
b10d2873
ILT
81932010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8194
8195 * arm.cc: Added support for ARM group relocations.
8196 (Target_arm::reloc_needs_sym_origin): New method.
8197 (Arm_relocate_functions::calc_grp_kn): New method.
8198 (Arm_relocate_functions::calc_grp_residual): New method.
8199 (Arm_relocate_functions::calc_grp_gn): New method.
8200 (Arm_relocate_functions::arm_grp_alu): New Method.
8201 (Arm_relocate_functions::arm_grp_ldr): New Method.
8202 (Arm_relocate_functions::arm_grp_ldrs): New Method.
8203 (Arm_relocate_functions::arm_grp_ldc): New Method.
8204 (Target_arm::Scan::local): Handle the ARM group relocations.
8205 (Target_arm::Scan::global): Likewise.
8206 (Target_arm::Relocate::relocate): Likewise.
8207 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8208 Likewise.
8209
2b328d4e
DK
82102010-01-26 Doug Kwan <dougkwan@google.com>
8211
8212 * arm.cc (set): Include.
8213 (class Arm_exidx_fixup): Change type of last_input_section_ to const
8214 pointer type.
2e702c99 8215 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
8216 (Arm_output_section::append_text_sections_to_list): New method.
8217 (Arm_output_section::fix_exidx_coverage): Ditto.
8218 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 8219 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
8220 Relobj::set_section_offset() instead of
8221 Sized_relobj::invalidate_section_offset().
2e702c99 8222 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
8223 parameter for section headers. Ignore relocation sections for
8224 unallocated sections and EXIDX sections.
8225 (Target_arm::fix_exidx_coverage): New method.
8226 (Target_arm::output_section_address_less_than): New type.
8227 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
8228 linked text section instead of the EXIDX section.
8229 (Arm_output_section::create_stub_group): Add an assertion to check
8230 that this is not an EXIDX output section.
8231 (Arm_output_section::append_text_sections_to_list): New method.
8232 (Arm_output_section::fix_exidx_coverage): Ditto.
8233 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 8234 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
8235 (Target_arm::do_relax): Fix EXIDX output section coverage in the
8236 first pass.
8237 (Target_arm::fix_exidx_coverage): New method.
8238 * object.h (Relobj::set_output_section): New method.
8239 (Sized_relobj::invalidate_section_offset): Remove method.
8240 (Sized_relobj::do_invalidate_section_offset): Remove method.
8241 (Sized_relobj::do_set_section_offset): Handle offset value -1.
8242
c7f3c371
DK
82432010-01-25 Doug Kwan <dougkwan@google.com>
8244
8245 * arm.cc (Arm_exidx_merged_section::do_output_offset):
8246 Fix warning due to signed and unsigned comparison on a 32-bit host.
8247
8923b24c
DK
82482010-01-22 Doug Kwan <dougkwan@google.com>
8249
8250 * arm.cc (Target_arm::do_relax): Record an output section for section
8251 offset adjustment it contains any stub table that has changed.
8252 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
8253 offsets in an output section if necessary.
8254 * output.cc (Output_section::Output_section): Initialize
8255 section_offsets_need_adjustments_.
8256 (Output_section::add_input_section_for_script): Renamed to
8257 Output_section::add_simple_input_section.
8258 (Output_section::save_states): Add a comment.
8259 (Output_section::discard_states): New method defintion.
8260 (Output_section::adjust_section_offsets): Same.
8261 * output.h (Output_section::add_input_section_for_script): Renamed to
8262 Output_section::add_simple_input_section.
8263 (Output_section::discard_states): New method declaration.
8264 (Output_section::adjust_section_offsets): Same.
8265 (Output_section::section_offsets_need_adjustment,
8266 Output_section::set_section_offsets_need_adjustment): New method
8267 definitions.
8268 (Output_section::section_offsets_need_adjustment_): New data member.
8269 * script-sections.cc
8270 (Output_section_element_input::set_section_address): Adjust code for
8271 renaming of Output_section::add_input_section_for_script.
8272 (Orphan_output_section::set_section_address): Same.
8273
9b2fd367
DK
82742010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8275
8276 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
8277 Fix_v4bx enum values .
8278 * gold/options.h (General_options): New option definitions.
8279 (General_options::fix_v4bx): New method.
8280 (General_options::Fix_v4bx): New enum.
8281 * gold/options.cc (General_options::parse_fix_v4bx): New method.
8282 (General_options::parse_fix_v4bx_interworking): New method.
8283
80d0d023
DK
82842010-01-22 Doug Kwan <dougkwan@google.com>
8285
8286 * arm.cc (Arm_exidx_fixup): New class.
8287
af2cdeae
DK
82882010-01-21 Doug Kwan <dougkwan@google.com>
8289
8290 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
8291 classes.
8292 (Arm_exidx_section_offset_map): New type.
8293
993d07c1
DK
82942010-01-21 Doug Kwan <dougkwan@google.com>
8295
8296 * arm.cc (Arm_exidx_input_section): New class.
8297 (Arm_relobj::exidx_input_section_by_link,
8298 Arm_relobj::exidx_input_section_by_shndx,
8299 Arm_relobj::make_exidx_input_section): New methods.
8300 (read_arm_attributes_section): Remove.
8301 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
8302 information about them.
8303 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
8304 to here.
8305
5ac169d4
DK
83062010-01-20 Doug Kwan <dougkwan@google.com>
8307
8308 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
8309 Input_section_specifier to Section_id.
8310 (Target_arm::new_arm_input_section: Adjust code for change of key
8311 type.
8312 (Target_arm::find_arm_input_section): Ditto.
8313 * gc.h (object.h): Include for Section_id nand Section_id_hash.
8314 (Section_id): Remove.
8315 (Garbage_collection::Section_id_hash): Remove.
8316 * icf.h (object.h): Include for Section_id nand Section_id_hash.
8317 (Section_id): Remove.
8318 (Icf::Section_id_hash): Remove.
8319 * object.h (Section_id, Const_section_id, Section_id_hash,
8320 Const_section_id_hash): New type definitions.
8321 * output.cc (Output_section::add_relaxed_input_section): Change to
8322 use Const_section_id instead of Input_section_specifier as key type.
8323 (Output_section::add_merge_input_section): Ditto.
8324 (Output_section::build_relaxation_map): Change to use Section_id
8325 instead of Input_section_specifier as key type.
2e702c99 8326 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
8327 Ditto.
8328 (Output_section::convert_input_sections_to_relaxed_sections): Change
8329 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 8330 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
8331 (Output_section::find_relaxed_input_section): Ditto.
8332 * output.h (Input_section_specifier): Remove class.
8333 (Output_section::Output_section_data_by_input_section_map): Change
8334 key type to Const_section_id.
8335 (Output_section::Output_relaxed_input_section_by_input_section_map):
8336 Ditto.
8337 (Output_section::Relaxation_map): Change key type to Section_id.
8338
a2162063
ILT
83392010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8340
8341 * gold/arm.cc: Added support for R_ARM_V4BX relocation
8342 (class Arm_v4bx_stub): New class.
8343 (DEF_STUBS): Updated definition to support v4_veneer_bx.
8344 (Stub_factory::make_arm_v4bx_stub): New method.
8345 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
8346 (Stub_table::empty): Handle v4bx stubs.
8347 (Stub_table::add_arm_v4bx_stub): New method.
8348 (Stub_table::find_arm_v4bx_stub): New method.
8349 (Arm_relocate_functions::v4bx): New method.
8350 (Target_arm::fix_v4bx): New method.
8351 (Target_arm::Target_arm): Handle R_ARM_V4BX.
8352 (Stub_table::relocate_stubs): Likewise.
8353 (Stub_table::do_write): Likewise.
8354 (Stub_table::update_data_size_and_addralign): Likewise.
8355 (Stub_table::finalize_stubs): Likewise.
8356 (Target_arm::Scan::local): Likewise.
8357 (Target_arm::Scan::global): Likewise.
8358 (Target_arm::do_finalize_sections): Likewise.
8359 (Target_arm::Relocate::relocate): Likewise.
8360 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8361 Likewise.
8362 (Target_arm::scan_reloc_for_stub): Likewise.
8363 (Target_arm::scan_reloc_section_for_stubs): Likewise.
8364
5696ab0b
ILT
83652010-01-19 Ian Lance Taylor <iant@google.com>
8366
8367 * output.cc (Output_section_headers::do_sized_write): Write large
8368 segment count to sh_info field.
8369 (Output_file_header::do_sized_write): For large segment count,
8370 write PN_XNUM to e_phnum field.
8371
800d0f56
ILT
83722010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8373
8374 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
8375 (Arm_relocate_functions::thm_jump8): New function.
8376 (Arm_relocate_functions::thm_jump11): New function.
8377 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
8378 R_ARM_THM_JUMP11.
8379 (Target_arm::Scan::global): Likewise.
8380 (Target_arm::Relocate::relocate): Likewise.
8381 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8382 Likewise.
8383
41263c05
DK
83842010-01-14 Doug Kwan <dougkwan@google.com>
8385
8386 * arm.cc (map, utility): Include headers.
8387 (Target_arm::apply_cortex_a8_workaround): New method.
8388 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
8389 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
8390 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
8391 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
8392 the --[no-]fix-cortex-a8 command line options.
8393 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
8394 (Target_arm::relocate_stub): Use addend in instruction template.
8395 * options.h (DEFINE_bool): Set the user-set flag.
8396 (General_options): Add --[no-]-fix-cortex options.
8397 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 8398 : Update fast look-up map after conversion.
41263c05 8399
459e9b03
ST
84002010-01-14 Sriraman Tallam <tmsriram@google.com>
8401
8402 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
8403 in the first pass of do_layout.
8404
b521dfe4
DK
84052010-01-13 Doug Kwan <dougkwan@google.com>
8406
8407 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
8408 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
8409 apparent compiler problem of not folding static constant integral
8410 data members of elfcpp::Elf_sizes<32>.
8411
44272192
DK
84122010-01-13 Doug Kwan <dougkwan@google.com>
8413
8414 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
8415 Arm_relobj::section_needs_cortex_a8_stub_scanning,
8416 Arm_relobj::scan_section_for_cortex_a8_erratum,
8417 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
8418 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
8419 sections to scan for relocation stubs into a new method
8420 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
8421 relocation and Cortex-A8 stub scanning.
8422 (Target_arm::do_relax): Force stubs to be after stubbed sections
8423 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 8424 the beginning of a new relaxation pass. Update a comment.
44272192
DK
8425 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
8426
44b71ece
ILT
84272010-01-12 Ian Lance Taylor <iant@google.com>
8428
8429 * target-reloc.h (visibility_error): New inline function.
8430 (relocate_section): Call visibility_error.
8431 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
8432 (MOSTLYCLEANFILES): Likewise.
8433 (protected_4_pic.o, protected_3.err): New targets.
8434 * testsuite/protected_4.cc: New file.
8435
a120bc7f
DK
84362010-01-12 Doug Kwan <dougkwan@google.com>
8437
8438 * arm.cc (Cortex_a8_reloc): New class.
8439 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
8440 and cortex_a8_relocs_info_.
8441 (Target_arm::fix_cortex_a8): New method definition.
8442 (Target_arm::Cortex_a8_relocs_info): New type.
8443 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
8444 New data member declarations.
8445 (Target_arm::scan_reloc_for_stub): Record information about
8446 relocations for THUMB branches that might be exempted from the
8447 Cortex-A8 workaround.
8448 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
8449 at the beginning of a relaxation pass.
8450
20138696
DK
84512010-01-12 Doug Kwan <dougkwan@google.com>
8452
8453 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
8454 (Arm_relobj::Mapping_symbol_position,
8455 Arm_reloj::Mapping_symbol_position_less,
8456 Arm_relobj::Mapping_symbols_info): New types.
8457 (Target_arm::is_mapping_symbol_name): New method definition.
8458 (Arm_relobj::do_count_local_symbols): Save information about mapping
8459 symbols.
8460
089d69dc
DK
84612010-01-11 Doug Kwan <dougkwan@google.com>
8462
8463 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
8464 Arm_relocate_functions::thumb32_branch_upper,
8465 Arm_relocate_functions::thumb32_branch_lower,
8466 Arm_relocate_functions::thumb32_cond_branch_offset,
8467 Arm_relocate_functions::thumb32_cond_branch_upper,
8468 Arm_relocate_functions::thumb32_cond_branch_lower,
8469 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
8470 branch offset encoding.
8471 (Arm_relocate_functions::thumb_branch_common): Use new branch
8472 offset encoding methods to avoid code duplication.
8473 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
8474 (Stub_addend_reader::operator()): Use new branch encoding method
8475 to avoid code duplication.
8476
99e5bff2
DK
84772010-01-11 Doug Kwan <dougkwan@google.com>
8478
8479 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
8480 (Target_arm::do_finalize_sections): Define special EXIDX section
8481 symbols only if referenced.
8482 * gc.h (Garbage_collection::add_reference): New method.
8483 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
8484 code duplication.
8485
98e090bd
ILT
84862010-01-11 Ian Lance Taylor <iant@google.com>
8487
d0a91bd8
ILT
8488 * script.cc (Version_script_info::build_expression_list_lookup):
8489 Change complaing about duplicate wildcard match from error to
8490 warning.
8491
98e090bd
ILT
8492 * script.cc (class Lazy_demangler): Recreate--revert part of patch
8493 of 2009-12-30.
8494 (Version_script_info::Version_script_info): Initialize globs_,
8495 default_version_, default_is_global_, and exact_. Don't
8496 initialize globals_ or locals_.
8497 (Version_script_info::build_lookup_tables): Build local symbols
8498 first.
8499 (Version_script_info::unquote): New function.
8500 (Version_script_info::add_exact_match): New function.
8501 (Version_script_info::build_expression_list_lookup): Remove lookup
8502 parameter. Add is_global parameter. Change all callers. Handle
8503 wildcard pattern specially. Unquote pattern. Call
8504 add_exact_match.
8505 (Version_script_info::get_name_to_match): New function.
8506 (Version_script_info::get_symbol_version): New function.
8507 (Version_script_info::get_symbol_version_helper): Remove.
8508 (Version_script_info::check_unmatched_names): Call unquote.
8509 * script.h (class Version_script_info): Change get_symbol_version
8510 to be non-inline and add is_global parameter; change all callers.
8511 Rewrite symbol_is_local. Update declarations. Define struct
8512 Version_tree_match, Exact, Globs. Don't define struct Lookup.
8513 Remove globals_ and locals_ members. Add exact_, globs_,
8514 default_version_, is_global_.
8515 (Version_script_info::Glob): Remove pattern, add expression and
8516 is_global. Update constructor. Change all callers.
8517 * dynobj.cc (Versions::finalize): Mark the version symbol as the
8518 default version.
8519 (Versions::symbol_section_contents): If a symbol is undefined, or
8520 defined in a dynamic object, set the version index to
8521 VER_NDX_LOCAL.
8522 * symtab.cc (Symbol_table::add_from_relobj): Don't call
8523 symbol_is_local.
8524 (Symbol_table::add_from_pluginobj): Likewise.
8525 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
8526
d56962d3
DK
85272010-01-11 Doug Kwan <dougkwan@google.com>
8528
8529 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
8530 (incremental_dump_LDADD): Add linking option for libintl.
8531 * Makefile.in: Regenerate.
8532
94e6ee91
L
85332010-01-11 H.J. Lu <hongjiu.lu@intel.com>
8534
8535 PR gold/11144
8536 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
8537 instead of -Ds.
8538 * testsuite/Makefile.in: Regenerated.
8539
e96c574b
DK
85402010-01-10 Doug Kwan <dougkwan@google.com>
8541
8542 * options.h (DEFINE_var): Use parentheses around argument varname__
8543 in macro body to avoid any unintended subsequent substitutions.
8544
7198066b
ILT
85452010-01-10 Ian Lance Taylor <iant@google.com>
8546
ba4d53bf
ILT
8547 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
8548 candidates before doing symbol resolution.
8549
7198066b
ILT
8550 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
8551 ODR candidates if only one is weak.
8552
a2beed37
ILT
85532010-01-08 Ian Lance Taylor <iant@google.com>
8554
8555 * script.cc (Version_script_info::build_expression_list_lookup):
8556 Don't warn about ambiguous version, just record the ambiguity.
8557 (Version_script_info::get_symbol_version_helper): Give error if
8558 version is ambiguous.
8559
2fb7225c
DK
85602010-01-08 Doug Kwan <dougkwan@google.com>
8561
8562 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
8563 prev_data_size_ and prev_addralign_. Remove initializer for
8564 deleted data member has_been_changed_.
8565 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
8566 to determine if the table is empty.
8567 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
8568 Remove.
8569 (Stub_table::add_reloc_stub): Define method in class definition
8570 instead of just declaring it there.
8571 (Stub_table::add_cortex_a8_stub): New method definition.
8572 (Stub_table::update_data_size_and_addralign): Ditto.
8573 (Stub_table::finalize_stubs): Ditto.
8574 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
8575 (Stub_table::do_addralign_): Return address alignment in the
8576 (Stub_table::do_reset_address_and_file_offset): Define method in
8577 class definition instead of declaring it there. Set current data
8578 size to be the data size of the previous pass.
8579 (Stub_table::set_final_data_size): Use current data size as the
8580 final data size.
8581 (Stub_table::relocate_stub): Change parameter type of stub from
8582 Reloc_stub pointer to Stub pointer.
8583 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
8584 (Stub_table::Cortex_a8_stub_list): New typedef.
8585 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
8586 Stub_table::prev_addralign_): New data member.
8587 (Arm_relobj::Arm_relobj): Initialize data member
8588 section_has_cortex_a8_workaround_.
8589 (Arm_relobj::section_has_cortex_a8_workaround,
8590 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
8591 definitions.
8592 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
8593 declarations.
8594 (Target_arm::relocate_stub): Change parameter type of stub from
8595 Reloc_stub pointer to Stub pointer.
8596 (Insn_template::size, Insn_template::alignment): Handle
8597 THUMB16_SPECIAL_TYPE.
8598 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
8599 Stub_table::update_data_size_and_addralign,
8600 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
8601 definitions.
8602 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
8603 (Stub_table::do_write): Ditto.
8604 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 8605
880cd20d
ILT
86062010-01-08 Ian Lance Taylor <iant@google.com>
8607
8608 PR 11108
8609 * symtab.h (class Symbol): Remove fields is_target_special_ and
8610 has_plt_offset_. Add field is_defined_in_discarded_section_.
8611 (Symbol::is_defined_in_discarded_section): New function.
8612 (Symbol::set_is_defined_in_discarded_section): New function.
8613 (Symbol::has_plt_offset): Rewrite.
8614 (Symbol::set_plt_offset): Verify that new offset is not -1U.
8615 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
8616 Don't initialize is_target_special_ or has_plt_offset_.
8617 Initialize is_defined_in_discarded_section_.
8618 (Symbol_table::add_from_relobj): If appropriate, set
8619 is_defined_in_discarded_section.
8620 * resolve.cc (Symbol::override_base_with_special): Don't test
8621 is_target_special_. Change has_plt_offset_ to has_plt_offset().
8622 * target-reloc.h (relocate_section): Do special handling for
8623 symbols defined in discarded sections for global symbols as well
8624 as local symbols.
8625
2703e3eb
ILT
86262010-01-08 Ian Lance Taylor <iant@google.com>
8627
8628 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
8629 the SHT_SYMTAB case.
8630
339d40a3
ILT
86312010-01-08 Ian Lance Taylor <iant@google.com>
8632
8633 * object.cc (Sized_relobj::do_layout): Don't get confused if
8634 layout_eh_frame returns NULL.
8635
abecea76
ILT
86362010-01-08 Ian Lance Taylor <iant@google.com>
8637
8638 PR 11084
8639 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
8640 dynamic symbol table, use the normal symbol table.
8641 (Sized_dynobj::do_read_symbols): Remove assertion about type of
8642 symbol table.
8643
6b7dd3f3
ILT
86442010-01-08 Ian Lance Taylor <iant@google.com>
8645
8646 PR 11072
8647 * layout.cc (Layout::include_section): Remove .gnu_debuglink
8648 sections.
8649
36c50e63
L
86502010-01-08 H.J. Lu <hongjiu.lu@intel.com>
8651
8652 * version.cc (print_version): Change to "Copyright 2010".
8653
e291e7b9
ILT
86542010-01-08 Ian Lance Taylor <iant@google.com>
8655
8656 PR 10287
8657 PR 11063
8658 * i386.cc (class Target_i386): Change return type of plt_section
8659 to be non-const.
8660 (class Output_data_plt_i386): Add tls_desc_rel_ field.
8661 (Output_data_plt_i386::Output_data_plt_i386): Initialize
8662 tls_desc_rel_ field.
8663 (Output_data_plt_i386::rel_tls_desc): New function.
8664 (Target_i386::rel_tls_desc_section): New function.
8665 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
8666 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
8667 R_386_TLS_DESC reloc in rel_tls_desc_section.
8668 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
8669 Define struct Tlsdesc_info.
8670 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
8671 (Target_x86_64::do_reloc_symbol_index): New function.
8672 (Target_x86_64::add_tlsdesc_info): New function.
8673 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
8674 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
8675 tlsdesc_rel_ field.
8676 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
8677 all callers.
8678 (Output_data_plt_x86_64::rela_tlsdesc): New function.
8679 (Target_x86_64::rela_tlsdesc_section): New function.
8680 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
8681 handling.
8682 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
8683 (Target_x86_64::do_reloc_addend): New function.
8684 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
8685 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
8686 declarations. Define TARGET_CODE. Add arg field to u1_ union.
8687 (Output_reloc::type): New function.
8688 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
8689 (Output_reloc::is_target_specific): New function.
8690 (Output_reloc::target_arg): New function.
8691 (class Output_reloc) [SHT_RELA]: Add four new constructors for
8692 absolute relocs and target specific relocs.
8693 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
8694 add_target_specific.
8695 (class Output_data_reloc) [SHT_RELA]: Likewise.
8696 * output.cc (Output_reloc::Output_reloc): Add four new versions
8697 for absolute relocs and target specific relocs.
8698 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
8699 (Output_reloc::get_symbol_index): Likewise.
8700 (Output_reloc::local_section_offset): Check that local_sym_index_
8701 is not TARGET_CODE or 0.
8702 (Output_reloc::symbol_value): Likewise.
8703 (Output_reloc::write) [SHT_RELA]: Call target for target specific
8704 reloc.
8705 * target.h (class Target): Add reloc_symbol_index and reloc_addend
8706 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
8707 functions.
8708 * layout.cc (add_target_dynamic_tags): Use output section for
8709 DT_PLTRELSZ and DT_JMPREL.
8710
3a44184e
ILT
87112010-01-07 Ian Lance Taylor <iant@google.com>
8712
8713 PR 11061
8714 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
8715 function.
8716 (class Output_data_reloc_generic): Define.
8717 (class Output_data_reloc_base): Change base class to
8718 Output_data_reloc_generic. Change add() method to call
8719 bump_relative_reloc_count for a relative reloc. Remove
8720 sort_relocs_ field.
8721 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
8722 to sort_relocs().
8723 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
8724 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
8725 appropriate.
8726 * layout.h (class Layout): Update declaration.
8727
ea715a34
ILT
87282010-01-07 Ian Lance Taylor <iant@google.com>
8729
8730 * output.h (class Output_data): Add const version of
8731 output_section and do_output_section.
8732 (class Output_section_data): Add const version of
8733 do_output_section.
8734 (class Output_section): Likewise.
8735 * layout.cc (Layout::add_target_dynamic_tags): New function.
8736 * layout.h (class Layout): Update declarations.
8737 * arm.cc (Target_arm::do_finalize_sections): Use
8738 add_target_dynamic_tags.
8739 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8740 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
8741 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
8742 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8743
659948a4
ILT
87442010-01-07 Ian Lance Taylor <iant@google.com>
8745
8746 PR 11042
8747 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
8748 object as needed.
8749
9d3b86f6
ILT
87502010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
8751 Ian Lance Taylor <iant@google.com>
8752
8753 PR 11019
8754 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
8755 Xindex::read_symtab_xindex.
8756
bb0d3eb0
DK
87572010-01-07 Doug Kwan <dougkwan@google.com>
8758
8759 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
8760 (Insn_template::thumb16_bcond_insn): New method declaration.
8761 (Insn_template): Fix spelling.
8762 (Stub::thumb16_special): New method declaration.
8763 (Stub::do_write): Define virtual method which was previously pure
8764 virtual.
8765 (Stub::do_thumb16_special): New method declaration.
8766 (Stub::do_fixed_endian_write): New template member.
8767 (Reloc_stub::do_write): Remove.
8768 (Reloc_stub::do_fixed_endian_write): Remove.
8769 (Cortex_a8_stub): New class definition.
8770 (Stub_factory::make_cortex_a8_stub): New method definition.
8771 (Stub_factory::Stub_factory): Add missing static storage class
8772 qualifier for elf32_arm_stub_a8_veneer_blx.
8773
ffeef7df
ILT
87742010-01-07 Ian Lance Taylor <iant@google.com>
8775
dc3f80fe
ILT
8776 PR 10980
8777 * options.h (class General_options): Add --warn-unresolved-symbols
8778 and --error-unresolved-symbols.
8779 * errors.cc (Errors::undefined_symbol): Implement
8780 --warn-unresolved-symbols.
8781
ffeef7df
ILT
8782 * options.h (class General_options): Add -z text and -z textoff.
8783 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
8784
f1ec9ded
ST
87852010-01-06 Sriraman Tallam <tmsriram@google.com>
8786
8787 * gc.h (Garbage_collection::Cident_section_map): New typedef.
8788 (Garbage_collection::cident_sections): New function.
8789 (Garbage_collection::add_cident_section): New function.
8790 (Garbage_collection::cident_sections_): New member.
8791 (gc_process_relocs): Add references to sections whose names are C
8792 identifiers.
8793 * gold.h (cident_section_start_prefix): New constant.
8794 (cident_section_stop_prefix): New constant.
8795 (is_cident): New function.
8796 * layout.cc (Layout::define_section_symbols): Replace string constants
8797 with the newly defined constants.
8798 * object.cc (Sized_relobj::do_layout): Track sections whose names are
8799 C identifiers.
8800 * testsuite/Makefile.am: Add gc_orphan_section_test.
8801 * testsuite/Makefile.in: Regenerate.
8802 * testsuite/gc_orphan_section_test.cc: New file.
8803 * testsuite/gc_orphan_section_test.sh: New file.
8804
6eda8c29
ILT
88052010-01-06 Ian Lance Taylor <iant@google.com>
8806
b9674e17
ILT
8807 PR 10980
8808 * options.h (class General_options): Add --warn-shared-textrel.
8809 * layout.cc (Layout::finish_dynamic_section): Implement
8810 --warn-shared-textrel.
8811
6eda8c29
ILT
8812 PR 10980
8813 * options.h (class General_options): Add --warn-multiple-gp.
8814
32dcd44e
ILT
88152010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8816
8817 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
8818 $(THREADSLIB) and $(LIBDL).
8819 * Makefile.in: Rebuild.
8820
a192ba05
ILT
88212010-01-06 Ian Lance Taylor <iant@google.com>
8822
8823 PR 10980
8824 * options.cc (General_options::parse_section_start): New function.
8825 (General_options::section_start): New function.
8826 (General_options::General_options): Initialize all members.
8827 * options.h: Include <map>
8828 (class General_options): Add --section-start. Add section_starts_
8829 member.
8830 * layout.cc (Layout::attach_allocated_section_to_segment): If
8831 --section-start was used, set the address of the segment. Remove
8832 local sort_sections.
8833 (Layout::relaxation_loop_body): If the address of the load segment
8834 has been set by --section-start, don't use it.
8835 * output.h (Output_segment::update_flags_for_output_section): New
8836 function.
8837 * output.cc (Output_segment::add_output_section): Call
8838 update_flags_for_output_section.
8839
dde3f402
ILT
88402010-01-05 Ian Lance Taylor <iant@google.com>
8841
62dfdd4d
ILT
8842 PR 10980
8843 * options.h (class General_options): Add --undefined-version.
8844 * script.cc (struct Version_expression): Add was_matched_by_symbol
8845 field.
8846 (Version_script_info::matched_symbol): New function.
8847 (Version_script_info::get_symbol_version_helper): Call
8848 matched_symbol.
8849 (Version_script_info::check_unmatched_names): New function.
8850 * script.h (class Version_script_info): Update declarations.
8851 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
8852
9c4ae156
ILT
8853 * options.h (class General_options): Use DEFINE_bool_alias for
8854 allow_multiple_definition.
8855 * resolve.cc (Symbol_table::should_override): Don't test
8856 allow_multiple_definition.
8857
dde3f402
ILT
8858 PR 10980
8859 * options.h (class General_options): Add --cref.
8860 * main.cc (main): Print cref table if --cref. Don't close mapfile
8861 until after printing cref table.
8862 * cref.cc: Include "symtab.h".
8863 (class Cref_inputs): Define Cref_table_compare and Cref_table.
8864 (Cref_table_compare::operator()): New function.
8865 (Cref_inputs::gather_cref): New function.
8866 (filecol): New static const.
8867 (Cref_inputs::print_cref): New function.
8868 (Cref::print_cref): New function.
8869 * cref.h: Include <cstdio>.
8870 (class Cref): Update declarations.
8871 * mapfile.h (Mapfile::file): New function.
8872 * object.h (class Object): Define Symbols. Declare virtual
8873 do_get_global_symbols.
8874 (Object::get_global_symbols): New function.
8875 * object.cc (Input_objects::add_object): Pass object to cref_ if
8876 --cref.
8877 (Input_objects::archive_start): Likewise.
8878 (Input_objects::archive_stop): Likewise.
8879 (Input_objects::print_cref): New function.
8880 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
8881 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
8882 --cref.
8883 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
8884 function.
8885 * plugin.h (class Sized_pluginobj): Update declarations.
8886
8781f709
ILT
88872010-01-05 Ian Lance Taylor <iant@google.com>
8888
8889 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
8890 to is_default_version. Rename insdef to insdefault.
8891 (Symbol_table::add_from_relobj): Rename def to is_default_version
8892 and local to is_forced_local.
8893 (Symbol_table::add_from_pluginobj): Likewise.
8894 (Symbol_table::add_from_dynobj): Likewise.
8895 (Symbol_table::define_special_symbol): Rename insdef to
8896 insdefault.
8897
fe35d28d
ILT
88982010-01-04 Ian Lance Taylor <iant@google.com>
8899
30bc8c46
ILT
8900 PR 10980
8901 * options.h (class General_options): Add
8902 --allow-multiple-definition and -z muldefs.
8903 * resolve.cc (Symbol_table::should_override): Don't warn about a
8904 multiple symbol definition if --allow-multiple-definition or -z
8905 muldefs.
8906
7eaea549
ILT
8907 PR 10980
8908 * options.h (class General_options): Add --add-needed and
8909 --copy-dt-needed-entries. Tweak --as-needed help entry.
8910 * object.cc (Input_objects::check_dynamic_dependencies): Give an
8911 error if --copy-dt-needed-entries aka --add-needed is used and
8912 would cause a change in behaviour.
8913
fe35d28d
ILT
8914 PR 10980
8915 * options.h (class General_options): Add -G as a short version of
8916 --shared. Add no-op options -assert, -g, and -i.
8917
55a2bb35
ST
89182010-01-04 Sriraman Tallam <tmsriram@google.com>
8919
8920 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
8921 check for .text or .gnu.linkonce.t sections.
8922 * icf.cc (Icf::find_identical_sections): Ditto.
8923 Change the detection for mangled function name within the section
8924 name.
8925 * icf.h (is_section_foldable_candidate): New function.
8926
719328e1
ILT
89272009-12-30 Ian Lance Taylor <iant@google.com>
8928
8929 PR 10980
8930 * options.h (class General_options): Permit two dashes with
8931 --retain-symbols-file.
8932
d7bb5745
ILT
89332009-12-30 Ian Lance Taylor <iant@google.com>
8934
403a15dd
ILT
8935 PR 10979
8936 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
8937 don't put the file header and segment headers in the text
8938 segment.
8939
eda294df
ILT
8940 PR 10979
8941 * common.cc (Sort_commons::operator()): Stabilize sort when both
8942 entries are NULL.
8943 (Symbol_table::do_allocate_commons_list): When allocating common
8944 symbols, skip a symbol which is no longer common.
8945 * symtab.h (Symbol::is_common): Test whether the symbol comes from
8946 an object before checking its type.
8947 * testsuite/common_test_2.c: New file.
8948 * testsuite/common_test_3.c: New file.
8949 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
8950 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
8951 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
8952 (common_test_2_pic.o, common_test_2.so): New targets.
8953 (common_test_3_pic.o, common_test_3.so): New targets.
8954 * testsuite/Makefile.in: Rebuild.
8955
d7bb5745
ILT
8956 PR 10979
8957 * script.cc (read_input_script): If we see a new SECTIONS clause,
8958 and we have added an input section, give an error.
8959 * layout.h (class Layout): Add have_added_input_section function.
8960 Add have_added_input_section_ field.
8961 * layout.cc (Layout::Layout): Initialize
8962 have_added_input_section_.
8963 (Layout::layout): Set have_added_input_section_.
8964 (Layout::layout_eh_frame): Likewise.
8965
fc59c572
ILT
89662009-12-30 Ian Lance Taylor <iant@google.com>
8967
8968 PR 10931
8969 * options.h (class General_options): Add --sort-common option.
8970 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
8971 * common.cc (Sort_common): Add sort_order parameter to
8972 constructor. Add sort_order_ field.
8973 (Sort_commons::operator): Check sort_order_.
8974 (Symbol_table::allocate_commons): Determine the sort order.
8975 (Symbol_table::do_allocate_commons): Add sort_order parameter.
8976 Change all callers.
8977 (Symbol_table::do_allocate_commons_list): Likewise.
8978
1c74fab0
ILT
89792009-12-30 Ian Lance Taylor <iant@google.com>
8980
8981 PR 10916
8982 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
8983 symbols from this object, don't change the visibility of an
8984 undefined symbol.
8985 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
8986
6affe781
ILT
89872009-12-30 Ian Lance Taylor <iant@google.com>
8988
8989 PR 10861
8990 * script.h (class Version_script_info): Define Language enum.
8991 Update declarations. Define Glob, Exact, and Lookup types. Add
8992 new fields globals_, locals_, and is_finalized_.
8993 * script.cc: Various formatting fixes.
8994 (class Parser_closure): Change language_stack_ from a vector of
8995 std::string to one of Version_script_info::Language. Adjust all
8996 uses accordingly.
8997 (class Lazy_demangler): Remove.
8998 (struct Version_expression): Change language from std::string to
8999 Version_script_info::Language.
9000 (Version_script_info::Version_script_info): New function.
9001 (Version_script_info::~Version_script_info): Don't call clear.
9002 (Version_script_info::finalize): New function.
9003 (Version_script_info::build_lookup_tables): New function.
9004 (Version_script_info::build_expression_list_lookup): New
9005 function.
9006 (Version_script_info::get_symbol_version_helper): Rewrite to use
9007 lookup tables.
9008 (Version_script_info::print_expression_list): Adjust to use
9009 Version_script_info::Language.
9010 (script_push_lex_into_version_mode): Check that the version script
9011 has not been finalized.
9012 (version_script_push_lang): Change language string to
9013 Version_script_info::Language.
9014 * options.cc (Command_line::version_script): New function.
9015 * options.h (class General_options): Add finalize_dynamic_list
9016 function. Change version_script from declaration to definition.
9017 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
9018 * testsuite/version_script.map: Remove duplicate def of foo.
9019 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
9020 version_script.map.
9021 * testsuite/Makefile.in: Rebuild.
9022
818bf354
ILT
90232009-12-30 Ian Lance Taylor <iant@google.com>
9024
9025 PR 10843
9026 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
9027 if the input symbol index is 0, make the output symbol index 0.
9028
ebcc8304
ILT
90292009-12-30 Ian Lance Taylor <iant@google.com>
9030
9031 PR 10670
9032 * options.h (class General_options): Add -x/--discard-all.
9033 * object.cc (Sized_relobj::do_count_local_symbols): Handle
9034 --discard-all. If the local symbol needs a dynamic entry, check
9035 that before handling --discard-locals.
9036
176fe33f
ILT
90372009-12-30 Ian Lance Taylor <iant@google.com>
9038
bb321bb1
ILT
9039 PR 10450
9040 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
9041 flags to PF_R.
9042 (Output_segment::add_output_section): Don't change the flags if
9043 the type is PT_TLS.
9044
176fe33f
ILT
9045 PR 10450
9046 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
9047 GNU hash table if they need a dynamic value. Otherwise, don't add
9048 them if they are defined in a dynamic object or are forced local.
9049
e8cd95c7
ILT
90502009-12-29 Ian Lance Taylor <iant@google.com>
9051
1b81fb71
ILT
9052 PR 10450
9053 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
9054 .gnu.hash table for a 32-bit target.
9055
8d6d383d
ILT
9056 PR 10450
9057 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
9058 regular and a dynamic object only needs a dynamic symbol table
9059 entry if it is externally visible.
9060
e785ec03
ILT
9061 PR 10450
9062 * i386.cc (class Target_i386): Initialize global_offset_table_ in
9063 constructor. Add global_offset_table_ field.
9064 (Target_i386::got_section): Set global_offset_table_.
9065 (Target_i386::do_finalize_sections): Set global_offset_table_
9066 size.
9067 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
9068 in constructor. Add global_offset_table_ field.
9069 (Target_x86_64::got_section): Set global_offset_table_.
9070 (Target_x86_64::do_finalize_sections): Set global_offset_table_
9071 size.
9072
1a2dff53
ILT
9073 * layout.cc (Layout::Layout): Initialize increase_relro_.
9074 (Layout::get_output_section): Add is_relro, is_last_relro, and
9075 is_first_non_relro parameters. Change all callers.
9076 (Layout::choose_output_section): Likewise.
9077 (Layout::add_output_section_data): Likewise.
9078 (Layout::make_output_section): Likewise.
9079 (Layout::set_segment_offsets): Clear increase_relro when using a
9080 linker script.
9081 * layout.h (class Layout): Add increase_relro method. Add
9082 increase_relro_ field. Update declarations.
9083 * output.cc (Output_section::Output_section): Initialize
9084 is_last_relro_ and is_first_non_relro_.
9085 (Output_segment::add_output_section): Group relro sections is
9086 do_sort is true. Handle is_last_relro and is_first_non_relro.
9087 (Output_segment::maximum_alignment): Remove relro handling.
9088 (Output_segment::set_section_addresses): Add increase_relro
9089 parameter. Change all callers. Add initial alignment to align
9090 relro sections on separate page. Remove old relro handling.
9091 (Output_segment::set_section_list_addresses): Remove in_relro
9092 parameter. Change all callers.
9093 (Output_segment::set_offset): Add increase parameter. Change all
9094 callers. Remove old relro handling.
9095 * output.h (class Output_section): Add new methods: is_last_relro,
9096 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
9097 Add is_last_relro_ and is_first_non_relro_ fields.
9098 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
9099 Create separate .got.plt section. Call increase_relro.
9100 * x86_64.cc (Target_x86_64::got_section): Likewise.
9101 * testsuite/relro_script_test.t: Add .got.plt.
9102
f0ba79e2
ILT
9103 PR 10450
9104 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
9105 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
9106 (Layout::finalize): Call set_dynamic_symbol_size.
9107 (Layout::set_dynamic_symbol_size): New function.
9108 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
9109 set_dynamic_symbol_size.
9110
e8cd95c7
ILT
9111 PR 10450
9112 * output.h (class Output_section): Add is_entsize_zero_ field.
9113 * output.cc (Output_section::Output_section): Initialize
9114 is_entsize_zero_.
9115 (Output_section::set_entsize): If two different entsizes are
9116 requested, force it to zero.
9117 (Output_section::add_input_section): Set flags for .debug_str
9118 before updating section flags. Set entsize.
9119 (Output_section::update_flags_for_input_section): Set SHF_MERGE
9120 and SHF_STRING if all input sections have those flags.
9121
3e1b9a8a
RÁE
91222009-12-29 Rafael Espindola <espindola@google.com>
9123
9124 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
9125 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
9126 reporting.
3e1b9a8a 9127
3dcad376
ST
91282009-12-29 Sriraman Tallam <tmsriram@google.com>
9129
9130 * options.cc (General_options::parse_version): Allow -v to exit
9131 without an error if there is nothing to link.
9132
084e2665
ILT
91332009-12-29 Ian Lance Taylor <iant@google.com>
9134
9135 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
9136 using a version of gcc before 4.1.
9137 * configure: Rebuild.
9138
250acde3
CD
91392009-12-28 Chris Demetriou <cgd@google.com>
9140
9141 * attributes.cc (Output_attributes_section_data::do_write): Use
9142 std::vector::front rather than std::vector::data.
9143
99fff23b
ILT
91442009-12-28 Ian Lance Taylor <iant@google.com>
9145
9146 * symtab.h (class Symbol_table): Add enum Defined.
9147 * resolve.cc (Symbol_table::should_override): Add defined
9148 parameter. Change all callers. Test whether object is NULL
9149 before calling a method on it.
9150 (Symbol_table::report_resolve_problem): Add defined parameter.
9151 Change all callers.
9152 (Symbol_table::should_override_with_special): Likewise.
9153 * symtab.cc (Symbol_table::define_in_output_data): Add defined
9154 parameter. Change all callers.
9155 (Symbol_table::do_define_in_output_data): Likewise.
9156 (Symbol_table::define_in_output_segment): Likewise.
9157 (Symbol_table::do_define_in_output_segment): Likewise.
9158 (Symbol_table::define_as_constant): Likewise.
9159 (Symbol_table::do_define_as_constant): Likewise.
9160 * script.h (class Symbol_assignment): Add is_defsym parameter to
9161 constructor; change all callers.
9162 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
9163 parameter. Change all callers. Add is_defsym_ field.
9164 (class Parser_closure): Add parsing_defsym parameter to
9165 constructor; change all callers. Add parsing_defsym accessor
9166 function. Add parsing_defsym_ field.
9167
556bd683
ILT
91682009-12-28 Ian Lance Taylor <iant@google.com>
9169
9170 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 9171 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 9172
1782c879
ILT
91732009-12-23 Ian Lance Taylor <iant@google.com>
9174
9175 * i386.cc (Target_i386::do_calls_non_split): Recognize
9176 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
9177 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
9178 -fsplit-stack prologue when using %r11.
1782c879 9179
329ca2b1
ST
91802009-12-21 Sriraman Tallam <tmsriram@google.com>
9181
9182 * options.cc (General_options::parse_version): Make -v continue and do
9183 the link like GNU ld does.
9184
d675ff46
RÁE
91852009-12-17 Rafael Avila de Espindola <espindola@google.com>
9186
9187 * Makefile.am (CCFILES): Add timer.cc.
9188 (HFILES): Add timer.h.
9189 * configure.ac: Check for sysconf and times.
9190 * main.cc: include timer.h.
9191 (main): Use Timer instead of get_run_time.
9192 * timer.cc: New.
9193 * timer.h: New.
9194 * workqueue.cc: include timer.h.
9195 (Workqueue::find_and_run_task):
9196 Report user, sys and wall time.
9197 * Makefile.in: Regenerate.
9198 * config.in: Regenerate.
9199 * configure: Regenerate.
9200
d6344fb5
DK
92012009-12-16 Doug Kwan <dougkwan@google.com>
9202
9203 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
9204 sections.
9205 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
9206 relaxed input sections.
9207 * output.cc (Output_section::find_relaxed_input_section): Change
9208 return type to Output_relaxed_input_section pointer. Adjust code
9209 for new type of relaxed_input_section_map_.
9210 * output.h (Output_section::find_relaxed_input_section): Change
9211 return type to Output_relaxed_input_section pointer.
9212 (Output_section::Output_relaxed_input_section_by_input_section_map):
9213 New type.
9214 (Output_section::relaxed_input_section_map_): Change type to
9215 Output_section::Output_relaxed_input_section_by_input_section_map.
9216 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
9217 input section.
9218
0e0d5469
ILT
92192009-12-15 Ian Lance Taylor <iant@google.com>
9220
9221 * layout.cc (Layout::create_shstrtab): Only write out after input
9222 sections if we are compressing debug sections.
9223
0649a889
ILT
92242009-12-15 Ian Lance Taylor <iant@google.com>
9225
9226 * archive.cc (Archive::add_symbols): Only look up a symbol without
9227 a version if there is, in fact, a version.
9228
2ea97941
ILT
92292009-12-14 Ian Lance Taylor <iant@google.com>
9230
9231 Revert -Wshadow changes, all changes from:
9232 2009-12-11 Doug Kwan <dougkwan@google.com>
9233 2009-12-11 Nick Clifton <nickc@redhat.com>
9234 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
9235
b0eec2cc
DK
92362009-12-11 Doug Kwan <dougkwan@google.com>
9237
9238 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
9239 due to -Wshadow.
9240 * attributes.cc (Object_attribute::size): Ditto.
9241 (Attributes_section_data::size): Ditto.
9242 (Attributes_section_data::Attributes_section_data): Ditto.
9243 (Output_attributes_section_data::do_write): Ditto.
9244 * attributes.h (Object_attribute::set_type): Ditto.
9245 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
9246
91d6fa6a
NC
92472009-12-11 Nick Clifton <nickc@redhat.com>
9248
9249 * archive.cc: Fix shadowed variable warnings.
9250 * arm.cc: Likewise.
9251 * compressed_output.cc: Likewise.
9252 * compressed_output.h: Likewise.
9253 * configure: Likewise.
9254 * dwarf_reader.cc: Likewise.
9255 * dynobj.cc: Likewise.
9256 * dynobj.h: Likewise.
9257 * ehframe.cc: Likewise.
9258 * ehframe.h: Likewise.
9259 * errors.cc: Likewise.
9260 * expression.cc: Likewise.
9261 * fileread.cc: Likewise.
9262 * fileread.h: Likewise.
9263 * freebsd.h: Likewise.
9264 * i386.cc: Likewise.
9265 * icf.cc: Likewise.
9266 * incremental.h: Likewise.
9267 * layout.cc: Likewise.
9268 * layout.h: Likewise.
9269 * mapfile.cc: Likewise.
9270 * merge.cc: Likewise.
9271 * merge.h: Likewise.
9272 * object.cc: Likewise.
9273 * object.h: Likewise.
9274 * options.h: Likewise.
9275 * output.cc: Likewise.
9276 * output.h: Likewise.
9277 * parameters.cc: Likewise.
9278 * plugin.cc: Likewise.
9279 * powerpc.cc: Likewise.
9280 * reduced_debug_output.cc: Likewise.
9281 * reduced_debug_output.h: Likewise.
9282 * reloc.cc: Likewise.
9283 * reloc.h: Likewise.
9284 * resolve.cc: Likewise.
9285 * script-sections.cc: Likewise.
9286 * script.cc: Likewise.
9287 * script.h: Likewise.
9288 * sparc.cc: Likewise.
9289 * symtab.cc: Likewise.
9290 * symtab.h: Likewise.
9291 * target-select.cc: Likewise.
9292 * target-select.h: Likewise.
9293 * token.h: Likewise.
9294 * workqueue.cc: Likewise.
9295 * workqueue.h: Likewise.
9296 * x86_64.cc: Likewise.
9297
a0351a69
DK
92982009-12-10 Doug Kwan <dougkwan@google.com>
9299
9300 * arm.cc (attributes.h): New include.
9301 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
9302 (Arm_relobj::~Arm_relobj): Delete object pointed by
9303 attributes_section_data_.
9304 (Arm_relobj::attributes_section_data): New method definition.
9305 (Arm_relobj::attributes_section_data_): New data member declaration.
9306 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
9307 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
9308 attributes_section_data_.
9309 (Arm_dynobj::attributes_section_data): New method definition.
9310 (Arm_dynobj::attributes_section_data_): New data member declaration.
9311 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
9312 initialization value of may_use_blx_ to false.
2e702c99 9313 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
9314 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
9315 object attributes to compute results instead of hard-coding.
9316 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
9317 Target_arm::get_secondary_compatible_arch,
9318 Target_arm::set_secondary_compatible_arch
9319 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
9320 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
9321 New method declarations.
9322 (Target_arm::get_aeabi_object_attribute): New method definition.
9323 (Target_arm::attributes_section_data_): New data member declaration.
9324 (read_arm_attributes_section): New template definition.
9325 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
9326 (Arm_dynobj::do_read_symbols): Ditto.
9327 (Target_arm::do_finalize_sections): Merge attributes sections from
9328 input. Check for BLX use after attributes section merging.
9329 Fix __exidx_start and __exidx_end visibility. Create an
9330 .ARM.attributes section if necessary.
9331 (Target_arm::get_secondary_compatible_arch,
9332 Target_arm::set_secondary_compatible_arch,
9333 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
9334 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 9335 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
9336 New method definitions.
9337
b59befec
ILT
93382009-12-09 Ian Lance Taylor <iant@google.com>
9339
9340 * plugin.cc (Plugin::load): Don't cast from void* to a function
9341 pointer.
9342
1276bc89
ILT
93432009-12-09 Ian Lance Taylor <iant@google.com>
9344
9345 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
9346 information fields.
9347
2f2de248
L
93482009-12-09 H.J. Lu <hongjiu.lu@intel.com>
9349
9350 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
9351 Replace two_file_shared_1.so with two_file_shared_2.so.
9352 * testsuite/Makefile.in: Regenerated.
9353
4f787271
DK
93542009-12-08 Doug Kwan <dougkwan@google.com>
9355
9356 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
9357 (HFILES): Add attributes.h and int_encoding.h.
9358 * Makefile.in: Regenerate.
9359 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
9360 function definitions to int_encoding.cc
9361 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
9362 prototypes to int_encoding.h
9363 * reduced_debug_output.cc (int_encoding.h): New include.
9364 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
9365 function definitions to int_encoding.cc
9366 (insert_into_vector, read_from_pointer): Move template definitions to
9367 int_encoding.h
9368 * attributes.cc: New file.
9369 * attributes.h: New file.
9370 * int_encoding.cc: New file.
9371 * int_encoding.h: New file.
9372
20b52f1a
RÁE
93732009-12-07 Rafael Avila de Espindola <espindola@google.com>
9374
9375 PR gold/11055
9376 * incremental-dump.cc (dump_incremental_inputs): New.
9377 (main): Use dump_incremental_inputs.
9378
53d7974c
L
93792009-12-07 H.J. Lu <hongjiu.lu@intel.com>
9380
9381 PR gold/10893
9382 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
9383 checking elfcpp::STT_FUNC.
9384 (Target_i386::Relocate::relocate): Likewise.
9385 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
9386
9387 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
9388 symbols from shared libraries into normal FUNC symbols.
9389
9390 * symtab.h (Symbol): Add is_func and use it.
9391
05a352e6
DK
93922009-12-05 Doug Kwan <dougkwan@google.com>
9393
9394 * arm.cc (Target_arm::arm_info): Initialize new fields
9395 attributes_section and attributes_vendor.
9396 * i386.cc (Target_i386::i386_info): Same.
9397 * object.cc (Sized_relobj::do_layout): Skip attribute section.
9398 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
9399 fields attributes_section and attributes_vendor.
53d7974c 9400 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
9401 * target.h (Target::attributes_section, Target::attributes_vendor,
9402 Target::is_attributes_section, Target::attribute_arg_type,
9403 Target::attributes_order): New method definitions.
9404 (Target::Target_info::attributes_section,
9405 Target::Target_info::attributes_vendor): New fields.
9406 (Target::do_attribute_arg_type, Target::do_attributes_order): New
9407 virtual method definitions.
9408 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
9409 attributes_section and attributes_vendor.
9410 * testsuite/testfile.cc (Target_test::test_target_info): Same.
9411
f4e5969c
DK
94122009-12-05 Doug Kwan <dougkwan@google.com>
9413
9414 * arm.cc: Update comments about interworking and stub generation.
9415 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
9416 considered as non-PIC.
9417 (Arm_relocate_functions::base_abs): Fix formatting.
9418 (Arm_relocate_functions::got_prel): Fix comment. Change interface
9419 of function to use GOT entry address instead of offset.
9420 (Target_arm::Scan::global): Issue an error if a symbol would need a
9421 PLT does not get one because it is untyped. Remove code to create
9422 dynamic symbols for relative branches.
9423 (Target_arm::Relocate::relocate: Use 0 instead of false since function
9424 takes unsigned integer instead of boolean.
9425
1abce4a6
L
94262009-12-05 H.J. Lu <hongjiu.lu@intel.com>
9427
9428 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
9429 (two_file_test_LDADD): Likewise.
9430 (common_test_1_LDADD): Likewise.
9431 (exception_test_LDADD) Likewise.
9432 (weak_test_LDADD): Likewise.
9433 (many_sections_test_LDADD): Likewise.
9434 (initpri1_LDADD): Likewise.
9435 (script_test_1_LDADD): Likewise.
9436 (script_test_2_LDADD): Likewise.
9437 (justsyms_LDADD): Likewise.
9438 (binary_test_LDADD): Likewise.
9439 (large_LDADD): Likewise.
9440 * testsuite/Makefile.in: Regenerated.
9441
adcf2816 94422009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 9443
adcf2816
L
9444 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
9445 (Symbol_table::override_with_special): Likewise.
9446 (Symbol_table::add_from_object): Likewise.
9447
28e67f5d
RÁE
94482009-12-04 Rafael Avila de Espindola <espindola@google.com>
9449
9450 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
9451 Don't set the data_offset twice.
9452
ae10a101
RÁE
94532009-12-04 Rafael Avila de Espindola <espindola@google.com>
9454
9455 * testsuite/Makefile.in: Regenerate.
9456
f59f41f3
DK
94572009-12-03 Doug Kwan <dougkwan@google.com>
9458
9459 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
9460 (Target_arm::do_finalize_sections): Add parameter for symbol table
9461 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
9462 * i386.cc (Target_i386::do_finalize_sections): Add an additional
9463 parameter for symbol table pointer.
9464 * layout.cc (Layout::finalize): Call Target::finalize_sections with
9465 an additional parameter for a pointer to symbol table.
9466 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
9467 parameter for a symbol table pointer.
9468 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
9469 * target.h (Target::finalize_sections, Target::do_finalize_sections):
9470 Ditto.
9471 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
9472 parameter for a symbol table pointer.
9473
ca55d848
RÁE
94742009-12-03 Rafael Avila de Espindola <espindola@google.com>
9475
9476 * incremental.cc (Incremental_inputs_header)
9477 (Incremental_inputs_header_write, Incremental_inputs_entry)
9478 (Incremental_inputs_entry_write): Move ...
9479 * incremental.h (Incremental_inputs_header)
9480 (Incremental_inputs_header_write, Incremental_inputs_entry)
9481 (Incremental_inputs_entry_write): here.
9482
3aec4f9c
RÁE
94832009-12-02 Rafael Avila de Espindola <espindola@google.com>
9484
9485 * incremental.cc (make_sized_incremental_binary): Set the target.
9486 Error if it is incompatible.
9487 * output.h (Output_file): Add filename method.
9488
9c0ae74d
RÁE
94892009-12-02 Rafael Avila de Espindola <espindola@google.com>
9490
9491 * incremental.cc (Incremental_inputs_entry): Remove unused argument
9492 from the get_* methods.
9493
a45500ae
RÁE
94942009-12-02 Rafael Avila de Espindola <espindola@google.com>
9495
9496 * incremental-dump.cc (main): Check that the offeset of a script is 0.
9497 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
9498 Write 0 for the data_offset of scripts.
9499
325e6408
RÁE
95002009-12-02 Rafael Avila de Espindola <espindola@google.com>
9501
9502 * testsuite/Makefile.am: Add the incremental_test.sh test.
9503 * testsuite/incremental_test.sh: New.
9504 * testsuite/incremental_test_1.c: New.
9505 * testsuite/incremental_test_2.c: New.
9506
954c3e2e
RÁE
95072009-12-01 Rafael Avila de Espindola <espindola@google.com>
9508
703d02da 9509 * incremental-dump.cc (main): Fix typos.
954c3e2e 9510
f8086623
RÁE
95112009-11-27 Rafael Avila de Espindola <espindola@google.com>
9512
9513 PR gold/11025
9514 * incremental-dump.cc (main): Use llu to print 64 bit values.
9515
3b0dd6ac
L
95162009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
9517 H.J. Lu <hongjiu.lu@intel.com>
9518
9519 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
9520 $(LIBDL).
9521 (incremental_dump_LDADD): Likewise.
9522 * Makefile.in: Regenerated.
9523
a6d1ef57 95242009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 9525
a6d1ef57
DK
9526 Revert:
9527
9528 2009-11-25 Doug Kwan <dougkwan@google.com>
9529
9530 * arm.cc (Target_arm::Target_arm): Move method definition
9531 outside of class definition. Add code to handle
9532 --target1-rel, --target1-abs and --target2= options.
9533 (Target_arm::get_reloc_reloc_type): Change method to be
9534 non-static and const.
9535 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
9536 New data member declaration.
9537 (Target_arm::Scan::local, Target_arm::Scan::global,
9538 Target_arm::Relocate::relocate,
9539 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9540 Adjust call to Target_arm::get_real_reloc_type.
9541 (Target_arm::get_real_reloc_type): Use command line options
9542 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
9543 * options.h (--target1-rel, --target1-abs, --target2): New
9544 ARM-only options.
9545
50aeb7d4
DK
95462009-11-25 Doug Kwan <dougkwan@google.com>
9547
9548 * arm.cc (Target_arm::Target_arm): Move method definition outside of
9549 class definition. Add code to handle --target1-rel, --target1-abs
9550 and --target2= options.
9551 (Target_arm::get_reloc_reloc_type): Change method to be non-static
9552 and const.
9553 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
9554 member declaration.
9555 (Target_arm::Scan::local, Target_arm::Scan::global,
9556 Target_arm::Relocate::relocate,
9557 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
9558 call to Target_arm::get_real_reloc_type.
9559 (Target_arm::get_real_reloc_type): Use command line options to
9560 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
9561 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
9562 options.
9563
51938283
DK
95642009-11-25 Doug Kwan <dougkwan@google.com>
9565
9566 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
9567 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
9568 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
9569 formatting.
9570 (Arm_relocate_functions::thm_call): Replace body with a call to
9571 Arm_relocate_functions::thumb_branch_common.
9572 (Arm_relocate_functions::thm_jump24,
9573 Arm_relocate_functions::thm_xpc22): New method definitions.
9574 (Arm_relocate_functions::thumb_branch_common): New method definition.
9575 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
9576 operator.
9577 (Target_arm::Relocate::relocate): Adjust call to thm_call.
9578 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
9579
e2b8f3c4
RÁE
95802009-11-24 Rafael Avila de Espindola <espindola@google.com>
9581
9582 * Makefile.am: Build incremental-dump
9583 * Makefile.in: Regenerate.
9584 * incremental-dump.cc: New.
9585 * incremental.cc (Incremental_inputs_header_data,
9586 Incremental_inputs_entry_data): Move to incremental.h
9587 * incremental.h: (Incremental_inputs_header_data,
9588 Incremental_inputs_entry_data): Move from incremental.cc
9589
bcba9aec
RÁE
95902009-11-24 Rafael Avila de Espindola <espindola@google.com>
9591
9592 * incremental.cc (Incremental_inputs_header,
9593 Incremental_inputs_header_write, Incremental_inputs_entry,
9594 Incremental_inputs_entry_write): Add a typedef with the data type.
9595
7c3afe08
RÁE
95962009-11-24 Rafael Avila de Espindola <espindola@google.com>
9597
9598 * incremental.cc (Incremental_inputs_header,
9599 Incremental_inputs_header_write, Incremental_inputs_entry,
9600 Incremental_inputs_entry_write): Update comment about which
9601 type has the filed descriptions.
9602
d204b6e9
DK
96032009-11-15 Doug Kwan <dougkwan@google.com>
9604
9605 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
9606 (Arm_relocate_functions::arm_branch_common): Change method defintion
9607 in class definition to a method declaration and update list of formal
9608 parameters.
9609 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
9610 Arm_relocation_functions::jump24): Adjust call to
9611 Arm_relocate_functions::arm_branch_common. Update list of formal
9612 parameters.
9613 (Arm_relocate_functions::xpc25): New method definition.
9614 (Arm_relocate_functions::arm_branch_common): Move method defintion
9615 out from class definition. Use stubs for mode-switching and extending
9616 branch ranges.
9617 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
9618 specially. Change code to enable use of stubs in ARM branches.
9619
43d12afe
DK
96202009-11-10 Doug Kwan <dougkwan@google.com>
9621
9622 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
9623 in method declaration.
9624 (Target_arm::relocate_stub): New method declaration.
9625 (Target_arm::default_target): Change to return a pointer instead of
9626 a const reference.
9627 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
9628 Target_arm::default_target.
9629 (Arm_Relobj::do_relocate_sections): Remove options paramater in
9630 method definition.
9631 (Target_arm::relocate_section): Adjust view.
9632 (Target_arm::relocate_stub): New method definition.
9633
ac33a407
DK
96342009-11-10 Doug Kwan <dougkwan@google.com>
9635
9636 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
9637 a format warning.
9638 * incremental.cc (open_incremental_binary): Initialized local
9639 variables to avoid warnings.
9640 * object.cc (make_elf_object): Ditto.
9641 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
9642 a format warning.
e1df38aa 9643
88ee28e9
L
9644009-11-09 H.J. Lu <hongjiu.lu@intel.com>
9645
9646 PR gold/10930
9647 * testsuite/plugin_test.c: Include "config.h".
9648
2daedcd6
DK
96492009-11-09 Doug Kwan <dougkwan@google.com>
9650
9651 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
9652 (arm_symbol_value): Remove.
9653 (Arm_relocate_functions::arm_branch_common,
9654 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
9655 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
9656 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
9657 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
9658 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
9659 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
9660 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
9661 Arm_relocate_functions::thm_mobw_abs_nc,
9662 Arm_relocate_functions::thm_mov_abs,
9663 Arm_relocate_functions::movw_prel_nc,
9664 Arm_relocate_functions::thm_movt_abs,
9665 Arm_relocate_functions::movt_prel,
9666 Arm_relocate_functions::thm_movw_prel_nc,
9667 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
9668 (Target_arm::Relocate::relocate): Only decompose address into two
9669 parts if relocation type uses the thumb-bit and pass the actual
9670 bit instead of a flag indicating that the thumb-bit is used. Adjust
9671 calls to methods in Arm_relocate_functions for this change.
9672
1276bc89 96732009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
9674
9675 PR 10925
9676 * reloc.cc: Instantiate
9677 Sized_relobj::initialize_input_to_output_maps and
9678 Sized_relobj:free_input_to_output_maps.
9679
e53ad1b5
ILT
96802009-11-06 Ian Lance Taylor <iant@google.com>
9681
9682 PR 10876
9683 * defstd.cc (in_segment): Set only_if_ref true for "end".
9684
eb44217c
DK
96852009-11-06 Doug Kwan <dougkwan@google.com>
9686
9687 * arm.cc (class Reloc_stub): Correct a comment.
9688 (Target_arm::Target_arm): Initialize arm_input_section_map_.
9689 (Target_arm::scan_section_for_stubs): New method declaration.
9690 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
9691 Change methods from private to protected.
9692 (Target_arm::do_may_relax): New method definition.
9693 (Target_arm::do_relax, Target_arm::group_sections,
9694 Target_arm::scan_reloc_for_stub,
9695 Target_arm::scan_reloc_section_for_stubs): New method declarations.
9696 (Target_arm::arm_input_section_map_): New data member declaration.
9697 (Target_arm::scan_reloc_for_stub,
9698 Target_arm::scan_reloc_section_for_stubs,
9699 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
9700 Target_arm::do_relax): New method definitions.
9701
5d329b7d
ILT
97022009-11-06 Mikolaj Zalewski <mikolaj@google.com>
9703
9704 * configure.ac: Check for (struct stat)::st_mtim
9705 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
9706 * config.in: Regenerate.
9707 * configure: Regenerate.
9708
96a0d71b
ILT
97092009-11-05 Ian Lance Taylor <iant@google.com>
9710
9711 PR 10910
9712 * output.cc (Output_segment::add_output_section): Add missing
9713 return statement.
9714
594c8e5e
ILT
97152009-11-04 Ian Lance Taylor <iant@google.com>
9716
9717 PR 10880
9718 * object.h (class Object): Add is_needed and set_is_needed
9719 methods. Add is_needed_ field. Make bool fields into bitfields.
9720 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
9721 defined in a dynamic object and referenced by a regular object,
9722 set is_needed for the dynamic object.
9723 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
9724 if the file is marked with as_needed and it is not needed.
9725
22b127cc
ILT
97262009-11-04 Ian Lance Taylor <iant@google.com>
9727
9728 PR 10887
9729 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
9730 tags if data is discarded by linker script.
9731 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9732 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
9733 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
9734 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9735
f5c870d2
ILT
97362009-11-04 Ian Lance Taylor <iant@google.com>
9737
9738 * layout.cc (Layout::get_output_section): Add is_interp and
9739 is_dynamic_linker_section parameters. Change all callers.
9740 (Layout::choose_output_section): Likewise.
9741 (Layout::make_output_section): Likewise.
9742 (Layout::add_output_section_data): Add is_dynamic_linker_section
9743 parameter. Change all callers.
9744 * layout.h (class Layout): Update declarations.
9745 * output.h (class Output_section): Add is_interp, set_is_interp,
9746 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
9747 Add is_interp_, is_dynamic_linker_section_ fields. Change
9748 generate_code_fills_at_write_ to a bitfield.
9749 * output.cc (Output_section::Output_sections): Initialize new
9750 fields.
9751 (Output_segment::add_output_section): Add do_sort parameter.
9752 Change all callers.
9753
1ae4d23b
ILT
97542009-11-03 Ian Lance Taylor <iant@google.com>
9755
9756 PR 10860
9757 * options.h (class General_options): Add --warn-common.
9758 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
9759 merging two common symbols.
9760 (Symbol_table::should_override): Handle --warn-common when merging
9761 a common symbol with a defined symbol. Use report_resolve_problem
9762 for multiple definitions.
9763 (Symbol_table::report_resolve_problem): New function.
9764 * symtab.h (class Symbol_table): Declare report_resolve_problem.
9765
55da9579
DK
97662009-11-03 Doug Kwan <dougkwan@google.com>
9767
9768 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
9769 stub_factory_.
9770 (Target_arm::stub_factory): New method definition.
9771 (Target_arm::new_arm_input_section,
9772 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
9773 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 9774 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
9775 New type definitions.
9776 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
9777 member declarations.
9778 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
9779 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
9780 New method definitions.
9781
37a9ac43
ILT
97822009-11-03 Ian Lance Taylor <iant@google.com>
9783
9784 * options.h (class General_options): Add --warn_constructors.
9785
b3d6a3d4
ILT
97862009-11-03 Ian Lance Taylor <iant@google.com>
9787
9788 PR 10893
9789 * defstd.cc (in_section): Add entries for __rel_iplt_start,
9790 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
9791
934b01dd
ILT
97922009-11-03 Ian Lance Taylor <iant@google.com>
9793
9794 PR 10895
9795 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
9796 --msgid-bugs-address.
9797 (install-pdf): New target.
9798 (install-data_yes): Look up one directory to find mkinstalldirs.
9799
03c1939b
L
98002009-11-03 H.J. Lu <hongjiu.lu@intel.com>
9801
9802 * po/Make-in (.po.gmo): Don't generate .gmo files in source
9803 tree.
9804
ebd95253
DK
98052009-10-30 Doug Kwan <dougkwan@google.com>
9806
9807 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
9808
e9bbb538
DK
98092009-10-30 Doug Kwan <dougkwan@google.com>
9810
9811 * arm.cc (Stub_addend_reader): New struct template definition
9812 and partial specializations.
9813 (Stub_addend_reader::operator()): New method definition for a
9814 partially specialized template.
9815
d5b40221
DK
98162009-10-30 Doug Kwan <dougkwan@google.com>
9817
9818 * arm.cc (Arm_relobj::processor_specific_flags): New method
9819 definition.
9820 (Arm_relobj::do_read_symbols): New method declaration.
9821 (Arm_relobj::processor_specific_flags_): New data member declaration.
9822 (Arm_dynobj): New class definition.
9823 (Target_arm::do_finalize_sections): Add input_objects parameter.
9824 (Target_arm::do_adjust_elf_header): New method declaration.
9825 (Target_arm::are_eabi_versions_compatible,
9826 (Target_arm::merge_processor_specific_flags): New method declaration.
9827 (Target_arm::do_make_elf_object): New overloaded method definitions
9828 and declaration.
9829 (Arm_relobj::do_read_symbols): New method definition.
9830 (Arm_dynobj::do_read_symbols): Ditto.
9831 (Target_arm::do_finalize_sections): Add input_objects parameters.
9832 Merge processor-specific flags from all input objects.
9833 (Target_arm::are_eabi_versions_compatible,
9834 Target_arm::merge_processor_specific_flags,
9835 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
9836 New method definitions.
9837 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
9838 Input_objects pointer type parameter.
9839 * layout.cc (Layout::finalize): Pass input objects to target's.
9840 finalize_sections function.
9841 * output.cc (Output_file_header::do_sized_write): Set ELF file
9842 header's processor-specific flags.
9843 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
9844 Input_objects pointer type parameter.
9845 * sparc.cc (Target_sparc::do_finalize_sections): Same.
9846 * target.h (Input_objects): New forward class declaration.
9847 (Target::processor_specific_flags,
9848 Target::are_processor_specific_flags_sect): New method definitions.
9849 (Target::finalize_sections): Add input_objects parameter.
9850 (Target::Target): Initialize processor_specific_flags_ and
9851 are_processor_specific_flags_set_.
9852 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
9853 parameter.
9854 (Target::set_processor_specific_flags): New method definition.
9855 (Target::processor_specific_flags_,
9856 Target::are_processor_specific_flags_set_): New data member
9857 declarations.
9858 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
9859 Input_objects pointer type parameter.
9860
ebabffbd
DK
98612009-10-30 Doug Kwan <dougkwan@google.com>
9862
9863 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
9864
ad0f2072
ILT
98652009-10-28 Ian Lance Taylor <iant@google.com>
9866
9867 * object.h (class Relobj): Drop options parameter from
9868 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
9869 do_scan_relocs, do_relocate. Change all callers.
9870 (class Sized_relobj): Drop options parameters from
9871 do_gc_process_relocs, do_scan_relocs, do_relocate,
9872 do_relocate_sections, relocate_sections, emit_relocs_scan,
9873 emit_relocs_scan_reltype. Change all callers.
9874 (struct Relocate_info): Remove options field and all references to
9875 it.
9876 * reloc.h (class Read_relocs): Remove options constructor
9877 parameter and options_ field. Change all callers.
9878 (class Gc_process_relocs, class Scan_relocs): Likewise.
9879 (class Relocate_task): Likewise.
9880 * target-reloc.h (scan_relocs): Remove options parameter. Change
9881 all callers.
9882 (scan_relocatable_relocs): Likewise.
9883 * target.h (class Sized_target): Remove options parameter from
9884 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
9885 all callers.
9886 * gc.h (gc_process_relocs): Remove options parameter. Change all
9887 callers.
9888 * arm.cc: Update functions to remove options parameters.
9889 * i386.cc: Likewise.
9890 * powerpc.cc: Likewise.
9891 * sparc.cc: Likewise.
9892 * x86_64.cc: Likewise.
9893 * testsuite/testfile.cc: Likewise.
9894
8ffa3667
DK
98952009-10-28 Doug Kwan <dougkwan@google.com>
9896
9897 * arm.cc (Arm_relobj): New class definition.
e1df38aa 9898 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
9899 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
9900 New method definitions.
9901
40f36857
CC
99022009-10-28 Cary Coutant <ccoutant@google.com>
9903
9904 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
9905 (Plugin::cleanup_done_): New member.
9906 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
9907 (Plugin_manager::cleanup_done_): Remove.
9908 (Plugin_manager::add_input_file): Edit error message.
9909 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
9910 (Plugin_manager::cleanup): Remove use of cleanup_done_.
9911
2c849493
ILT
99122009-10-27 Mikolaj Zalewski <mikolajz@google.com>
9913
9914 * fileread.cc: (File_read::View::~View): Use the new
9915 data_ownership_ filed.
9916 (File_read::~File_read): Dispose the new whole_file_view_.
9917 (File_read::open): Mmap the whole file if needed.
9918 (File_read::open): Use whole_file_view_ instead of contents_.
9919 (File_read::find_view): Use whole_file_view_ if applicable.
9920 (File_read::do_read): Use whole_file_view_ instead of contents_.
9921 (File_read::make_view): Use whole_file_view_ instead of contents_,
9922 update File_read::View::View call.
9923 (File_read::find_or_make_view): Update File_read::View::View
9924 call.
9925 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
9926 remove contents_
9927 (File_read::View::Data_ownership): New enum.
9928 (File_read::View::View): Replace bool mapped_ with Data_ownership
9929 argument.
9930 (File_read::View::mapped_): Remove (replaced by data_ownership_).
9931 (File_read::View::data_ownership_): New field.
9932 (File_read::contents_): Remove (replaced by whole_file_view_).
9933 (File_read::whole_file_view_): New field.
9934 * options.h (class General_options): Add --keep-files-mapped.
9935
24998053
CC
99362009-10-27 Cary Coutant <ccoutant@google.com>
9937
9938 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
9939 * testsuite/Makefile.am (plugin_test_5): New test case.
9940 * testsuite/Makefile.in: Regenerate.
9941
72adc4fa
DK
99422009-10-25 Doug Kwan <dougkwan@google.com>
9943
9944 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
9945 from private to protected to allow access by child class.
9946 (Sized_relobj::do_relocate_sections): New method declaration.
9947 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 9948 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
9949 Sized_relobj::relocate_sections. Instantiate template explicitly
9950 for different target sizes and endianity.
9951
07f508a2
DK
99522009-10-24 Doug Kwan <dougkwan@google.com>
9953
9954 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
9955 (Arm_input_section::as_arm_input_section): New method.
9956 (Arm_output_section): New class definition.
9957 (Arm_output_section::create_stub_group,
9958 Arm_output_section::group_sections): New method definitions.
9959
10ad9fe5
DK
99602009-10-22 Doug Kwan <dougkwan@google.com>
9961
9962 * arm.cc (Arm_input_section): New class definition.
9963 (Arm_input_section::init, Arm_input_section:do_write,
9964 Arm_input_section::set_final_data_size,
9965 Arm_input_section::do_reset_address_and_file_offset): New method
9966 definitions.
9967
56ee5e00
DK
99682009-10-21 Doug Kwan <dougkwan@google.com>
9969
9970 * arm.cc (Stub_table, Arm_input_section): New forward class
9971 declarations.
9972 (Stub_table): New class defintion.
9973 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
9974 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
9975 New method definition.
9976
b569affa
DK
99772009-10-21 Doug Kwan <dougkwan@google.com>
9978
9979 * arm.cc: Update copyright comments.
9980 (Target_arm): New forward class template declaration.
9981 (Arm_address): New type.
9982 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
9983 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
9984 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
9985 constants.
9986 (Insn_template): Same.
9987 (DEF_STUBS): New macro.
9988 (Stub_type): New enum type.
9989 (Stub_template): New class definition.
9990 (Stub): Same.
9991 (Reloc_stub): Same.
9992 (Stub_factory): Same.
9993 (Target_arm::Target_arm): Initialize may_use_blx_ and
9994 should_force_pic_veneer_.
9995 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
9996 Target_arm::should_force_pic_veneer,
9997 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
9998 Target_arm::using_thumb_only, Target_arm:;default_target): New
9999 method defintions.
10000 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
10001 New data member declarations.
10002 (Insn_template::size, Insn_template::alignment): New method defintions.
10003 (Stub_template::Stub_template): New method definition.
10004 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
10005 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
10006 (Stub_factory::Stub_factory): New method definition.
10007 * gold.h (string_hash): New template.
10008 * output.h (Input_section_specifier::hash_value): Use
10009 gold::string_hash.
10010 (Input_section_specifier::string_hash): Remove.
10011 * stringpool.cc (Stringpool_template::string_hash): Use
10012 gold::string_hash.
10013
6c172549
DK
100142009-10-20 Doug Kwan <dougkwan@google.com>
10015
10016 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
10017 symbols of relaxed input sections.
10018 * output.h (Output_section::find_relaxed_input_section): Make
10019 method public.
10020
c5617f2f
DK
100212009-10-16 Doug Kwan <dougkwan@google.com>
10022
10023 * dynobj.cc (Versions::Versions): Initialize version_script_.
10024 Only insert base version symbol definition for a shared object
10025 if version script defines any version versions.
10026 (Versions::define_base_version): New method definition.
10027 (Versions::add_def): Check that base version is not needed.
10028 (Versions::add_need): Define base version lazily.
10029 * dynobj.h (Versions::define_base_version): New method declaration.
10030 (Versions::needs_base_version_): New data member declaration.
10031 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
10032 (check_DATA): Add no_version_test.stdout.
10033 (libno_version_test.so, no_version_test.o no_version_test.stdout):
10034 New make rules.
10035 * testsuite/Makefile.in: Regenerate.
10036 * testsuite/no_version_test.c: New file.
10037 * testsuite/no_version_test.sh: Ditto.
10038
3c12dcdb
DK
100392009-10-16 Doug Kwan <dougkwan@google.com>
10040
10041 * expression.cc (class Segment_start_expression): New class definition.
10042 (Segment_start_expression::value): New method definition.
10043 (script_exp_function_segment_start): Return a new
10044 Segment_start_expression.
10045 * gold/script-c.h (script_saw_segment_start_expression): New function
10046 prototype.
10047 * script-sections.cc (Script_sections::Script_sections): Initialize
10048 SAW_SEGMENT_START_EXPRESSION_ to false.
10049 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
10050 and -Tbbs options to specify section addresses if given in
10051 command line and no SEGMENT_START expression is seen in a script.
10052 * script-sections.h (Script_sections::saw_segment_start_expression,
10053 Script_sections::set_saw_segment_start_expression): New method
10054 definition.
10055 (Script_sections::saw_segment_start_expression_): New data member
10056 declaration.
10057 * script.cc (script_saw_segment_start_expression): New function.
10058 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
10059 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
10060 script_test_7.sh and script_test_8.sh.
10061 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
10062 script_test_8.stdout.
10063 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
10064 (script_test_6, script_test_6.stdout, script_test_7,
10065 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
10066 * Makefile.in: Regenerate.
10067 * testsuite/script_test_6.sh: New file.
10068 * testsuite/script_test_6.t: Same.
10069 * testsuite/script_test_7.sh: Same.
10070 * testsuite/script_test_7.t: Same.
10071 * testsuite/script_test_8.sh: Same.
10072
64b1ae37
DK
100732009-10-16 Doug Kwan <dougkwan@google.com>
10074
10075 * output.cc (Output_segment::set_section_list_address): Cast
10076 expressions to unsigned long long type to avoid format warnings.
10077
661be1e2
ILT
100782009-10-15 Ian Lance Taylor <iant@google.com>
10079
12edd763 10080 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 10081 dot assignment to script_sections_.
12edd763
ILT
10082 * script-sections.cc (Script_sections::add_dot_assignment):
10083 Initialize if necessary.
10084
68b6574b
ILT
10085 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
10086 program headers with no load segment if there is a linker script.
10087
661be1e2
ILT
10088 * layout.cc (Layout::set_segment_offsets): Align the file offset
10089 to the segment aligment for -N or -n with no load segment.
10090 * output.cc (Output_segment::add_output_section): Don't crash if
10091 the first section is a TLS section.
10092 (Output_segment::set_section_list_addresses): Print an error
10093 message if the address moves backward in a linker script.
10094 * script-sections.cc
10095 (Output_section_element_input::set_section_addresses): Don't
10096 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
10097 (Orphan_output_section::set_section_addresses): Likewise.
10098
f15f61a7
DK
100992009-10-15 Doug Kwan <dougkwan@google.com>
10100
10101 * layout.cc (Layout::finish_dynamic_section): Generate tags
10102 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
10103 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
10104 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
10105
82bb573a
ILT
101062009-10-14 Ian Lance Taylor <iant@google.com>
10107
10108 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
10109 fields.
10110 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
10111 data_shdr fields of relinfo.
10112 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
10113 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
10114 R_386_TLS_LDO_32, adjust based on section flags.
10115 (Target_i386::Relocate::fix_up_ldo): Remove.
10116
374ad285
ILT
101172009-10-13 Ian Lance Taylor <iant@google.com>
10118
10119 Add support for -pie.
10120 * options.h (class General_options): Add -pie and
10121 --pic-executable.
10122 (General_options::output_is_position_independent): Test -pie.
10123 (General_options::output_is_executable): Return true if not shared
10124 and not relocatable.
10125 (General_options::output_is_pie): Remove.
10126 * options.cc (General_options::finalize): Reject incompatible uses
10127 of -pie.
10128 * gold.cc (queue_middle_tasks): A -pie link is not static.
10129 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
10130 * symtab.cc (Symbol::final_value_is_known): Return false if
10131 output_is_position_independent.
10132 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
10133 output_is_position_independent.
10134 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
10135 output_is_position_independent.
10136 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
10137 output_is_position_independent.
10138 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
10139 two_file_pie_test.
10140 (basic_pie_test.o, basic_pie_test): New targets.
10141 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
10142 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
10143 (two_file_pie_test): New target.
10144 * testsuite/Makefile.in: Rebuild.
10145 * README: Remove note saying that -pie is not supported.
10146
c6585162
ILT
101472009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
10148
10149 * options.h (class General_options): Add -init and -fini.
10150 * layout.cc (Layout::finish_dynamic_section): Emit
10151 given init and fini functions.
10152
032ce4e9
ST
101532009-10-13 Sriraman Tallam <tmsriram@google.com>
10154
10155 * gc.h (gc_process_relocs): Check if icf is enabled using new
10156 function.
10157 * gold.cc (queue_initial_tasks): Likewise.
10158 (queue_middle_tasks): Likewise.
10159 * object.cc (do_layout): Likewise.
10160 * symtab.cc (is_section_folded): Likewise.
10161 * main.cc (main): Likewise.
10162 * reloc.cc (Read_relocs::run): Likewise.
10163 (Sized_relobj::do_scan_relocs): Likewise.
10164 * icf.cc (is_function_ctor_or_dtor): New function.
10165 (Icf::find_identical_sections): Check if function is ctor or dtor when
10166 safe icf is chosen.
10167 * options.h (General_options::icf): Change option to be an enum.
10168 (Icf_status): New enum.
10169 (icf_enabled): New method.
10170 (icf_safe_folding): New method.
10171 (set_icf_status): New method.
10172 (icf_status_): New variable.
10173 * (options.cc) (General_options::finalize): Set icf_status_.
10174 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
10175 icf_test and icf_keep_unique_test to use the --icf enum flag.
10176 * testsuite/icf_safe_test.sh: New file.
e1df38aa 10177 * testsuite/icf_safe_test.cc: New file.
032ce4e9 10178
f345227a
ST
101792009-10-12 Sriraman Tallam <tmsriram@google.com>
10180
10181 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
10182 includes to gc.h and icf.h.
10183 * arm.cc: Include gc.h.
10184 * gold.cc: Likewise.
10185 * i386.cc: Likewise.
10186 * powerpc.cc: Likewise.
10187 * sparc.cc: Likewise.
10188 * x86_64.cc: Likewise.
10189 * gc.h: Include icf.h.
10190
1c7814ed
ILT
101912009-10-11 Ian Lance Taylor <iant@google.com>
10192
10193 * plugin.cc: Include "gold.h" before other header files.
10194
ae3b5189
CD
101952009-10-10 Chris Demetriou <cgd@google.com>
10196
10197 * options.h (Input_file_argument::Input_file_type): New enum.
10198 (Input_file_argument::is_lib_): Replace with...
10199 (Input_file_argument::type_): New member.
10200 (Input_file_argument::Input_file_argument): Take Input_file_type
10201 'type' rather than boolean 'is_lib' as second argument.
10202 (Input_file_argument::is_lib): Use type_.
10203 (Input_file_argument::is_searched_file): New function.
10204 (Input_file_argument::may_need_search): Handle is_searched_file.
10205 * options.cc (General_options::parse_library): Support -l:filename.
10206 (General_options::parse_just_symbols): Update for Input_file_argument
10207 changes.
10208 (Command_line::process): Likewise.
10209 * archive.cc (Archive::get_file_and_offset): Likewise.
10210 * plugin.cc (Plugin_manager::release_input_file): Likewise.
10211 * script.cc (read_script_file, script_add_file): Likewise.
10212 * fileread.cc (Input_file::Input_file): Likewise.
10213 (Input_file::will_search_for): Handle is_searched_file.
10214 (Input_file::open): Likewise.
10215 * readsyms.cc (Read_symbols::get_name): Likewise.
10216 * testsuite/Makefile.am (searched_file_test): New test.
10217 * testsuite/Makefile.in: Regenerate.
10218 * testsuite/searched_file_test.cc: New file.
10219 * testsuite/searched_file_test_lib.cc: New file.
10220
f3048a1d
ILT
102212009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10222 Ian Lance Taylor <iant@google.com>
10223
10224 * descriptor.cc: Include <cstdio> and "binary-io.h".
10225 (Descriptors::open): Open the files in binary mode always.
10226 * script.cc (Lex::get_token): Treat \r as whitespace.
10227
d4780e57
ILT
102282009-10-09 Ian Lance Taylor <iant@google.com>
10229
10230 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
10231
d9a893b8
ILT
102322009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10233 Ian Lance Taylor <iant@google.com>
10234
10235 * configure.ac: Check for readv function also.
10236 * fileread.cc (readv): Define if not HAVE_READV.
10237 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
10238 does not exist.
10239 * config.in: Regenerate.
10240 * configure: Regenerate.
10241
c0a62865
DK
102422009-10-09 Doug Kwan <dougkwan@google.com>
10243
10244 * layout.cc (Layout::make_output_section): Call target hook to make
10245 ordinary output section.
10246 (Layout::finalize): Adjust parameter list of call the
10247 Target::may_relax().
10248 * layout.h (class Layout::section_list): New method.
10249 * merge.h (Output_merge_base::entsize): Change visibility to public.
10250 (Output_merge_base::is_string, Output_merge_base::do_is_string):
10251 New methods.
10252 (Output_merge_string::do_is_string): New method.
10253 * object.cc (Sized_relobj::do_setup): renamed from
10254 Sized_relobj::set_up.
10255 * object.h (Sized_relobj::adjust_shndx,
10256 Sized_relobj::initializ_input_to_output_maps,
10257 Sized_relobj::free_input_to_output_maps): Change visibilities to
10258 protected.
10259 (Sized_relobj::setup): Virtualize.
10260 (Sized_relobj::do_setup): New method declaration.
10261 (Sized_relobj::invalidate_section_offset,
10262 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
10263 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
10264 * options.cc (parse_int): New function.
10265 * options.h (parse_int): New declaration.
10266 (DEFINE_int): New macro.
10267 (stub_group_size): New option.
10268 * output.cc (Output_section::Output_section): Initialize memebers
10269 merge_section_map_, merge_section_by_properties_map_,
10270 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
10271 (Output_section::add_input_section): Handled deferred code-fill
10272 generation and remove an old comment.
10273 (Output_section::add_relaxed_input_section): New method definition.
10274 (Output_section::add_merge_input_section): Use merge section by
10275 properties map to speed to search. Update merge section maps
10276 as appropriate.
10277 (Output_section::build_relaxation_map): New method definition.
10278 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
10279 Same.
10280 (Output_section::relax_input_section): Renamed to
10281 Output_section::convert_input_sections_to_relaxed_sections and change
10282 interface to take a vector of pointers to relaxed sections.
10283 (Output_section::find_merge_section,
10284 Output_section::find_relaxed_input_section): New method definitions.
10285 (Output_section::is_input_address_mapped,
10286 Output_section::output_offset, Output_section::output_address):
10287 Use output section data maps to speed up searching.
10288 (Output_section::find_starting_output_address): Add comments.
10289 (Output_section::do_write,
10290 Output_section::write_to_postprocessing_buffer): Do code-fill
10291 generation as appropriate.
10292 (Output_section::get_input_sections): Invalidate relaxed input section
10293 map.
10294 (Output_section::restore_states): Adjust type of checkpoint .
10295 Invalidate relaxed input section map.
10296 * output.h (Output_merge_base): New class declaration.
10297 (Input_section_specifier): New class defintion.
10298 (class Output_relaxed_input_section) Change base class to
10299 Output_section_data_build.
10300 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
10301 base class initializer.
10302 (Output_section::add_relaxed_input_section): New method declaration.
10303 (Output_section::Input_section): Change visibility to protected.
2e702c99 10304 (Output_section::Input_section::relobj,
c0a62865
DK
10305 Output_section::Input_section::shndx): Handle relaxed input sections.
10306 Output_section::input_sections) Change visibility to protected. Also
10307 define overload to return a non-const pointer.
10308 (Output_section::Merge_section_properties): New class defintion.
10309 (Output_section::Merge_section_by_properties_map,
10310 Output_section::Output_section_data_by_input_section_map,
10311 Output_section::Relaxation_map): New types.
10312 (Output_section::relax_input_section): Rename method to
10313 Output_section::convert_input_sections_to_relaxed_sections and change
10314 interface to take a vector of relaxed section pointers.
10315 (Output_section::find_merge_section,
10316 Output_section::find_relaxed_input_section,
10317 Output_section::build_relaxation_map,
10318 Output_section::convert_input_sections_in_list_to_relaxed_sections):
10319 New method declarations.
10320 (Output_section::merge_section_map_
10321 Output_section::merge_section_by_properties_map_,
10322 Output_section::relaxed_input_section_map_,
10323 Output_section::is_relaxed_input_section_map_valid_,
10324 Output_section::generate_code_fills_at_write_): New data members.
10325 * script-sections.cc
10326 (Output_section_element_input::set_section_addresses): Call
10327 current_data_size and addralign methods of relaxed input sections.
10328 (Orphan_output_section::set_section_addresses): Call current_data_size
10329 and addralign methods of relaxed input sections.
10330 * symtab.cc (Symbol_table::compute_final_value): Extract template
10331 from the body of Symbol_table::sized_finalize_symbol.
10332 (Symbol_table::sized_finalized_symbol): Call
10333 Symbol_table::compute_final_value.
10334 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
10335 (Symbol_table::compute_final_value): New templated method declaration.
10336 * target.cc (Target::do_make_output_section): New method defintion.
10337 * target.h (Target::make_output_section): New method declaration.
10338 (Target::relax): Add more parameters for input objects, symbol table
10339 and layout. Adjust call to do_relax.
10340 (Target::do_make_output_section): New method declaration.
10341 (Target::do_relax): Add parameters for input objects, symbol table
10342 and layout.
10343
d446d6c4
ILT
103442009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10345
10346 * pread.c: Include stdio.h.
10347
bc06c745
ILT
103482009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10349
10350 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
10351 defined.
10352
75aea3d0
ILT
103532009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10354
10355 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
10356 Change read_shndx type to unsigned int.
10357 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
10358 int.
10359 (Sized_dwarf_line_info::read_line_mappings): Likewise.
10360 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
10361 Change read_shndx type to unsigned int.
10362 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
10363 int.
10364 (Sized_dwarf_line_info::read_line_mappings): Likewise.
10365 * layout.cc (Layout::create_symtab_sections): Cast the result of
10366 local_symcount * symsize to off_t in the gold_assert.
10367
be8fcb75
ILT
103682009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10369
10370 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
10371 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
10372 R_ARM_BASE_ABS.
10373 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
10374 (Arm_relocate_functions::thm_abs5): New function.
10375 (Arm_relocate_functions::abs12): New function.
10376 (Arm_relocate_functions::abs16): New function.
10377 (Arm_relocate_functions::base_abs): New function.
10378 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
10379 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
10380 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
10381 R_ARM_BASE_ABS.
10382 (Scan::global): Likewise.
10383 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
10384 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
10385 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
10386 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
10387 R_ARM_BASE_ABS.
10388
c2a122b6
ILT
103892009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10390
10391 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
10392 (Arm_relocate_functions::movt_prel): New function.
10393 (Arm_relocate_functions::thm_movw_prel_nc): New function.
10394 (Arm_relocate_functions::thm_movt_prel): New function.
10395 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
10396 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
10397 (Scan::global, Relocate::relocate): Likewise.
10398 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10399
c4aa1e2d
ILT
104002009-10-09 Mikolaj Zalewski <mikolajz@google.com>
10401
10402 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
10403 Incremental_checker.
10404 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
10405 unsigned int.
10406 (class Incremental_inputs_header): New class.
10407 (Incremental_inputs_header_writer): Edit comment.
10408 (Incremental_inputs_entry): New class.
10409 (Incremental_inputs_entry_writer): Edit comment.
10410 (Sized_incremental_binary::do_find_incremental_inputs_section):
10411 Add *strtab_shndx parameter, fill it.
10412 (Sized_incremental_binary::do_check_inputs): New method.
10413 (Incremental_checker::can_incrementally_link_output_file): Use
10414 Sized_incremental_binary::check_inputs.
10415 (Incremental_inputs::report_command_line): Save command line in
10416 command_line_.
10417 * incremental.h:
10418 (Incremental_binary::find_incremental_inputs_section): New
10419 method.
10420 (Incremental_binary::do_find_incremental_inputs_section): Add
10421 strtab_shndx parameter.
10422 (Incremental_binary::do_check_inputs): New pure virtual method.
10423 (Sized_incremental_binary::do_check_inputs): Declare.
10424 (Incremental_checker::Incremental_checker): Add incremental_inputs
10425 parameter, use it to initialize incremental_inputs_.
10426 (Incremental_checker::incremental_inputs_): New field.
10427 (Incremental_checker::command_line): New method.
10428 (Incremental_checker::inputs): New method.
10429 (Incremental_checker::command_line_): New field.
10430
c549a694
ILT
104312009-10-09 Mikolaj Zalewski <mikolajz@google.com>
10432
10433 * incremental.cc: Include <cstdarg> and "target-select.h".
10434 (vexplain_no_incremental): New function.
10435 (explain_no_incremental): New function.
10436 (Incremental_binary::error): New method.
10437 (Sized_incremental_binary::do_find_incremental_inputs_section): New
10438 method.
10439 (make_sized_incremental_binary): New function.
10440 (open_incremental_binary): New function.
10441 (can_incrementally_link_file): Add checks if output is ELF and has
10442 inputs section.
10443 * incremental.h: Include "elfcpp_file.h" and "output.h".
10444 (Incremental_binary): New class.
10445 (Sized_incremental_binary): New class.
10446 (open_incremental_binary): Declare.
10447 * object.cc (is_elf_object): Use
10448 elfcpp::Elf_recognizer::is_elf_file.
10449 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
10450 * output.h (Output_file::filesize): New method.
10451
fd3c5f0b
ILT
104522009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10453
10454 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
10455 New function.
10456 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
10457 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
10458 function.
10459 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
10460 function.
10461 (Arm_relocate_functions::movw_abs_nc): New function.
10462 (Arm_relocate_functions::movt_abs): New function.
10463 (Arm_relocate_functions::thm_movw_abs_nc): New function.
10464 (Arm_relocate_functions::thm_movt_abs): New function.
10465 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
10466 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
10467 (Scan::global): Likewise.
10468 (Relocate::relocate): Likewise.
10469 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10470
7f5309a5
ILT
104712009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10472
10473 * arm.cc (Arm_relocate_functions::got_prel) New function.
10474 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
10475 (Relocate::relocate): Likewise.
10476 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10477
364c7fa5
ILT
104782009-10-06 Ian Lance Taylor <iant@google.com>
10479
10480 * options.h (class General_options): Define
10481 split_stack_adjust_size parameter.
10482 * object.h (class Object): Add uses_split_stack_ and
10483 has_no_split_stack_ fields. Add uses_split_stack and
10484 has_no_split_stack accessor functions. Declare
10485 handle_split_stack_section.
10486 (class Reloc_symbol_changes): Define.
10487 (class Sized_relobj): Define Function_offsets. Declare
10488 split_stack_adjust, split_stack_adjust_reltype, and
10489 find_functions.
10490 * object.cc (Object::handle_split_stack_section): New function.
10491 (Sized_relobj::do_layout): Call handle_split_stack_section.
10492 * dynobj.cc (Sized_dynobj::do_layout): Call
10493 handle_split_stack_section.
10494 * reloc.cc (Sized_relobj::relocate_sections): Call
10495 split_stack_adjust for executable sections in split_stack
10496 objects. Pass reloc_map to relocate_section.
10497 (Sized_relobj::split_stack_adjust): New function.
10498 (Sized_relobj::split_stack_adjust_reltype): New function.
10499 (Sized_relobj::find_functions): New function.
10500 * target-reloc.h: Include "object.h".
10501 (relocate_section): Add reloc_symbol_changes parameter. Change
10502 all callers.
10503 * target.h (class Target): Add calls_non_split method. Declare
10504 do_calls_non_split virtual method. Declare match_view and
10505 set_view_to_nop.
10506 * target.cc: Include "elfcpp.h".
10507 (Target::do_calls_non_split): New function.
10508 (Target::match_view): New function.
10509 (Target::set_view_to_nop): New function.
10510 * gold.cc (queue_middle_tasks): Give an error if mixing
10511 split-stack and non-split-stack objects with -r.
10512 * i386.cc (Target_i386::relocate_section): Add
10513 reloc_symbol_changes parameter.
10514 (Target_i386::do_calls_non_split): New function.
10515 * x86_64.cc (Target_x86_64::relocate_section): Add
10516 reloc_symbol_changes parameter.
10517 (Target_x86_64::do_calls_non_split): New function.
10518 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
10519 parameter.
10520 * powerpc.cc (Target_powerpc::relocate_section): Add
10521 reloc_symbol_changes parameter.
10522 * sparc.cc (Target_sparc::relocate_section): Add
10523 reloc_symbol_changes parameter.
10524 * configure.ac: Call AM_CONDITIONAL for the default target.
10525 * configure: Rebuild.
10526 * testsuite/Makefile.am (TEST_AS): New variable.
10527 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
10528 (check_DATA): Add split_i386 and split_x86_64 files.
10529 (SPLIT_DEFSYMS): Define.
10530 (split_i386_[1234n].o): New targets.
10531 (split_i386_[124]): New targets.
10532 (split_i386_[1234r].stdout): New targets.
10533 (split_x86_64_[1234n].o): New targets.
10534 (split_x86_64_[124]): New targets.
10535 (split_x86_64_[1234r].stdout): New targets.
10536 (MOSTLYCLEANFILES): Add new executables.
10537 * testsuite/split_i386.sh: New file.
10538 * testsuite/split_x86_64.sh: New file.
10539 * testsuite/split_i386_1.s: New file.
10540 * testsuite/split_i386_2.s: New file.
10541 * testsuite/split_i386_3.s: New file.
10542 * testsuite/split_i386_4.s: New file.
10543 * testsuite/split_i386_n.s: New file.
10544 * testsuite/split_x86_64_1.s: New file.
10545 * testsuite/split_x86_64_2.s: New file.
10546 * testsuite/split_x86_64_3.s: New file.
10547 * testsuite/split_x86_64_4.s: New file.
10548 * testsuite/split_x86_64_n.s: New file.
10549 * testsuite/testfile.cc (Target_test): Update relocation_section
10550 function.
10551 * testsuite/Makefile.in: Rebuild.
10552
e8a9fcda
ILT
105532009-10-06 Ian Lance Taylor <iant@google.com>
10554
10555 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
10556 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
10557 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
10558 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
10559 the address on ldo_addrs_.
10560 (Target_i386::Relocate::fix_up_ldo): New function.
10561
e99daf92
ILT
105622009-10-06 Rafael Espindola <espindola@google.com>
10563
10564 * plugin.cc (add_input_library): New.
10565 (Plugin::load): Add add_input_library to tv.
10566 (Plugin_manager::add_input_file): Add the is_lib argument.
10567 (add_input_file): Update call to Plugin_manager::add_input_file.
10568 (add_input_library): New.
10569 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
10570
966d4097
DK
105712009-09-30 Doug Kwan <dougkwan@google.com>
10572
10573 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
10574 symbol and call Symbol::may_need_copy_reloc to determine if
10575 a copy reloc is needed.
10576 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
10577 nocopyreloc is given in command line.
10578 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
10579 given in command line.
10580 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
10581 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
10582 of the removed Target_i386::may_need_copy_reloc.
10583 * options.h (copyreloc): New option with default value false.
10584 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
10585 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
10586 instead of the removed Target_powerpc::may_need_copy_reloc.
10587 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
10588 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
10589 instead of the removed Target_sparc::may_need_copy_reloc.
10590 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
10591 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
10592 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
10593 instead of the removed Target_x86_64::may_need_copy_reloc.
10594
029ba973
ILT
105952009-09-30 Ian Lance Taylor <iant@google.com>
10596
10597 * object.h (class Object): Remove target_ field, and target,
10598 sized_target, and set_target methods.
10599 (Object::sized_target): Remove.
10600 (class Sized_relobj): Update declarations. Remove sized_target.
10601 * object.cc (Sized_relobj::setup): Remove target parameter.
10602 Change all callers.
10603 (Input_objects::add_object): Don't do anything with the target.
10604 (make_elf_sized_object): Add punconfigured parameter. Change all
10605 callers. Set or test parameter target.
10606 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
10607 Change all callers.
10608 * parameters.cc (Parameters::set_target): Change parameter type to
10609 be non-const.
10610 (Parameters::default_target): Remove.
10611 (set_parameters_target): Change parameter type to be non-const.
10612 (parameters_force_valid_target): New function.
10613 (parameters_clear_target): New function.
10614 * parameters.h (class Parameters): Update declarations. Remove
10615 default_target method. Add sized_target and clear_target
10616 methods. Change target_ to be non-const.
10617 (set_parameters_target): Update declaration.
10618 (parameters_force_valid_target): Declare.
10619 (parameters_clear_target): Declare.
10620 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
10621 as NULL if we aren't searching.
10622 (Add_symbols::run): Don't check for compatible target.
10623 * fileread.cc (Input_file::open_binary): Call
10624 parameters_force_valid_target.
10625 * gold.cc (queue_middle_tasks): Likewise.
10626 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
10627 set_target on object.
10628 * dynobj.h (class Sized_dynobj): Update declarations.
10629 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
10630 make_elf_object returns NULL.
10631 (Archive::include_member): Don't check whether object target is
10632 compatible.
10633 * output.cc (Output_section::add_input_section): Get target from
10634 parameters.
10635 (Output_section::relax_input_section): Likewise.
10636 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
10637 parameters.
10638 (Sized_relobj::do_scan_relocs): Likewise.
10639 (Sized_relobj::relocate_sections): Likewise.
10640 * resolve.cc (Symbol_table::resolve): Likewise.
10641 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
10642 parameter. Change all callers.
10643 (Symbol_table::add_from_object): Get target from parameters.
10644 (Symbol_table::add_from_relobj): Don't check object target.
10645 (Symbol_table::add_from_dynobj): Likewise.
10646 (Symbol_table::define_special_symbol): Get target from
10647 parameters.
10648 * symtab.h (class Symbol_table): Update declaration.
10649 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
10650 parameter. Change all callers. Clear parameter target.
10651 (Binary_test): Test target here.
10652 * testsuite/object_unittest.cc (gold_testsuite): Remove
10653 target_test_pointer parameter. Change all callers.
10654 (Object_test): Test target here.
10655
a6a22b83
ILT
106562009-09-26 Ian Lance Taylor <iant@google.com>
10657
10658 * testsuite/initpri1.c: Don't try to use constructor priorities if
10659 compiling with gcc before 4.3.
10660
6a8f49fe
ILT
106612009-09-22 Mikolaj Zalewski <mikolajz@google.com>
10662
10663 * testsuite/retain_symbols_file_test.sh (check_present): Change
10664 output file name to retain_symbols_file_test.stdout.
10665 (check_absent): Likewise.
10666
8c604651
CS
106672009-09-18 Craig Silverstein <csilvers@google.com>
10668
10669 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
10670 * options.cc: Include <cerrno> and <fstream>.
10671 (General_options::finalize): Parse -retain-symbols-file tag.
10672 * options.h: New flag.
10673 (General_options): New method should_retain_symbol, new
10674 variable symbols_to_retain.
10675 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
10676 should_retain_symbol map.
10677 * testsuite/Makefile.am (retain_symbols_file_test): New test.
10678 * testsuite/Makefile.in: Regenerate.
10679 * testsuite/retain_symbols_file_test.sh: New file.
10680
ca58b19f
NC
106812009-09-18 Nick Clifton <nickc@redhat.com>
10682
10683 * po/es.po: Updated Spanish translation.
10684
20e6d0d6
DK
106852009-09-17 Doug Kwan <dougkwan@google.com>
10686
10687 * debug.h (DEBUG_RELAXATION): New constant.
10688 (DEBUG_ALL): Add DEBUG_RELAXATION.
10689 (debug_string_to_enum): Add relaxation debug option.
10690 * layout.cc
10691 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
10692 Layout::Relaxation_debug_check::read_sections,
10693 Layout::Relaxation_debug_check::read_sections): New method definitions.
10694 (Layout::Layout): Initialize data members
10695 record_output_section_data_from_scrips_,
10696 script_output_section_data_list_ and relaxation_debug_check_.
10697 (Layout::save_segments, Layout::restore_segments,
10698 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
10699 Layout::relaxation_loop_body): New method definitions.
10700 (Layout::finalize): Support relaxation. Move section layout code to
10701 Layout::relaxation_loop_body.
10702 (Layout::set_asection_address_from_script): Move code for orphan
10703 section placement out.
10704 (Layout::place_orphan_sections_in_script): New method definition.
10705 * layout.h (Output_segment_headers, Output_file_header):
10706 New forward class declarations.
10707 (Layout::~Layout): Define.
10708 (Layout::new_output_section_data_from_script): New method definition.
10709 (Layout::place_orphan_sections_in_script): New method declaration.
10710 (Layout::Segment_states): New type declaration.
10711 (Layout::save_segments, Layout::restore_segments,
10712 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
10713 Layout::relaxation_loop_body): New method declarations.
10714 (Layout::Output_section_data_list): New type declaration.
10715 (Layout::Relaxation_debug_check): New class definition.
10716 (Layout::record_output_section_data_from_script_,
10717 Layout::script_output_section_data_list_, Layout::segment_states_,
10718 Layout::relaxation_debug_check_): New data members.
10719 * output.cc: (Output_section_headers::do_size): New method definition.
10720 (Output_section_headers::Output_section_headers): Move size
10721 computation to Output_section_headers::do_size.
10722 (Output_segment_headers::do_size): New method definition.
e1df38aa 10723 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
10724 Output_file_header::do_size and call it.
10725 (Output_file_header::do_size): New method definition.
10726 (Output_data_group::Output_data_group): Adjust call to
10727 Output_section_data.
10728 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
10729 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 10730 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
10731 RELAXED_INPUT_SECTION_CODE.
10732 (Output_section::Output_section): Initialize data member checkpoint_.
10733 (Output_section::~Output_section): Delete checkpoint object pointed
10734 by checkpoint_.
10735 (Output_section::add_input_section): Always add an Input_section if
10736 relaxing.
10737 (Output_section::add_merge_input_section): Add assert.
10738 (Output_section::relax_input_section): New method definition.
10739 (Output_section::set_final_data_size): Set load address to zero for
10740 an unallocated section.
10741 (Output_section::do_address_and_file_offset_have_reset_values):
10742 New method definition.
10743 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
10744 Handle relaxed input section.
10745 (Output_section::sort_attached_input_sections): Checkpoint input
10746 section list lazily.
10747 (Output_section::get_input_sections): Change type of input_sections to
10748 list of Simple_input_section pointers. Checkpoint input section list
10749 lazily. Also handle relaxed input sections.
10750 (Output_section::add_input_section_for_script): Take a reference to
10751 a Simple_input_section object instead of Relobj pointer and section
10752 index as parameter. Handle relaxed input sections.
10753 (Output_section::save_states, Output_section::restore_states): New
10754 method definitions.
10755 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
10756 (Output_data::is_data_size_fixed): New method definition.
10757 (Output_data::reset_addresss_and_file_offset): Do not reset data size
10758 if it is fixed.
10759 (Output_data::address_and_file_offset_have_reset_values): New method
10760 definition.
10761 (Output_data::do_address_and_file_offset_have_reset_values): New method
10762 definition.
10763 (Output_data::set_data_size): Check that data size is not fixed.
10764 (Output_data::fix_data_size): New method definition.
10765 (Output_data::is_data_size_fixed_): New data member.
10766 (Output_section_headers::set_final_data_size): New method definition.
10767 (Output_section_headers::do_size): New method declaration.
10768 (Output_segment_headers::set_final_data_size): New method definition.
10769 (Output_segment_headers::do_size): New method declaration.
10770 (Output_file_header::set_final_data_size)::New method definition.
10771 (Output_file_header::do_size)::New method declaration.
10772 (Output_section_data::Output_section_data): Add new parameter
10773 is_data_size_fixed and use it to fix data size.
10774 (Output_data_const::Output_data_const): Adjust call to base class
10775 constructor and fix data size.
10776 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
10777 base class constructor and fix data size.
10778 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
10779 base class constructor and fix data size.
10780 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
10781 class constructor and fix data size.
10782 (Output_data_group::set_final_data_size): New method definition.
10783 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
10784 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
10785 class constructor and fix data size.
10786 (Output_relaxed_input_section): New class definition.
10787 (Output_section::Simple_input_section): New class definition.
10788 (Output_section::get_input_sections): Adjust parameter list.
10789 (Output_section::add_input_section_for_script): Same.
10790 (Output_section::save_states, Output_section::restore_states,
10791 Output_section::do_address_and_file_offset_have_reset_values,
10792 (Output_section::Input_section::Input_section): Handle
10793 RELAXED_INPUT_SECTION_CODE. Add new overload for
10794 Output_relaxed_input_section.
10795 (Output_section::Input_section::is_input_section,
10796 Output_section::Input_section::set_output_section): Handle relaxed
10797 input section.
10798 (Output_section::Input_section::is_relaxed_input_section,
10799 Output_section::Input_section::output_section_data,
10800 Output_section::Input_section::relaxed_input_section): New method
10801 definitions.
10802 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
10803 value.
10804 (Output_section::Input_section::u1_): Update comments.
10805 (Output_section::Input_section::u2_): Add new union member poris.
10806 (Output_section::Checkpoint_output_section): New classs definition.
10807 (Output_section::relax_input_section): New method declaration.
10808 (Output_section::checkpoint_): New data member.
10809 (Output_segment): Update comments.
10810 (Output_segment::Output_segment): Un-privatize copy constructor.
10811 (Output_segment::operator=): Un-privatize.
10812 * script-sections.cc (Output_section_element::Input_section_list):
10813 Change element type to Output_section::Simple_input_section.
10814 (Output_section_element_dot_assignment::set_section_addresses):
10815 Register output section data for relaxation clean up.
10816 (Output_data_exression::Output_data_expression): Adjust call to base
10817 constructor to fix data size.
10818 (Output_section_element_data::set_section_addresses): Register
10819 Output_data_expression object for relaxation clean up.
10820 (struct Input_section_info): Replace Relobj pointer and section index
10821 pair with Output_section::Simple_input_section and Convert struct to a
10822 class.
10823 (Input_section_sorter::operator()): Adjust access to
e1df38aa 10824 Input_section_info data member to use accessors.
20e6d0d6
DK
10825 (Output_section_element_input::set_section_addresses): Use layout
10826 parameter. Adjust code to use Output_section::Simple_input_section
10827 and Input_secction_info classes. Register filler for relaxation
10828 clean up.
10829 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
10830 and section index pair with Output_section::Simple_input_section
10831 class. Adjust code accordingly.
10832 (Phdrs_element::release_segment): New method definition.
10833 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
10834 segment list.
10835 (Script_sections::release_segments): New method definition.
10836 * gold/script-sections.h (Script_sections::release_segments): New
10837 method declaration.
10838 * gold/target.h (Target::may_relax, Target::relax,
10839 Target::do_may_relax, Target::do_relax): New method definitions.
10840
5e445df6
ILT
108412009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10842
10843 * arm.cc (has_signed_unsigned_overflow): New function.
10844 (Arm_relocate_functions::abs8): New function.
10845 (Target_arm::Scan::local): Handle R_ARM_ABS8.
10846 (Target_arm::Scan::global): Likewise.
10847 (Target_arm::relocate::relocate): Likewise.
10848 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10849 Likewise.
10850
8c604651 108512009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
10852
10853 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
10854 * testsuite/Makefile.in: Regenerate.
10855
1e9cc1c2
NC
108562009-09-11 Nick Clifton <nickc@redhat.com>
10857
10858 * po/gold.pot: Updated by the Translation project.
10859
6a89f575
CC
108602009-09-08 Cary Coutant <ccoutant@google.com>
10861
10862 * output.cc (Output_file::open): Add execute permission to empty file.
10863 * testsuite/Makefile.am (permission_test): New test.
10864 * testsuite/Makefile.in: Regenerate.
10865
fdcac5af
ILT
108662009-09-02 Ian Lance Taylor <iant@google.com>
10867
10868 * output.cc (Output_file::resize): Call map_no_anonymous rather
10869 than map.
10870
44453f85
ILT
108712009-09-01 Mikolaj Zalewski <mikolajz@google.com>
10872
10873 * gold.cc: Include "incremental.h".
10874 (queue_initial_tasks): Call Incremental_checker methods.
10875 * incremental.cc: Include "output.h".
10876 (Incremental_checker::can_incrementally_link_output_file): New
10877 method.
10878 * incremental.h (Incremental_checker): New class.
10879
10880 * output.cc (Output_file::open_for_modification): New method.
10881 (Output_file::map_anonymous): Changed return type to bool. Record
10882 map in base_ field.
10883 (Output_file::map_no_anonymous): New method, broken out of map.
10884 (Output_file::map): Use map_no_anonymous and map_anonymous.
10885 * output.h (class Output_file): Update declarations.
10886
293c1386
CC
108872009-08-24 Cary Coutant <ccoutant@google.com>
10888
10889 * options.h (Command_line::Pre_options): New class.
10890 (Command_line::pre_options): New member.
10891 * options.cc (gold::options::ready_to_register): New variable.
10892 (One_option::register_option): Do nothing if not registering options.
10893 Assert if same short option registered twice.
10894 (General_options::General_options): Turn off option registration when
10895 done constructing.
10896 (Command_line::Pre_options::Pre_options): New constructor.
10897
f773f3d2
CC
108982009-08-24 Cary Coutant <ccoutant@google.com>
10899
06a73cfe
CC
10900 * options.h (General_options::no_keep_memory): Remove incorrect
10901 short option.
f773f3d2 10902
a15af8e2
RW
109032009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10904
10905 * Makefile.am (am__skiplex, am__skipyacc): New.
10906 * Makefile.in: Regenerate.
10907
c462b41b
RW
109082009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10909
14ec8efd
RW
10910 * Makefile.am (AM_CPPFLAGS): Renamed from ...
10911 (INCLUDES): ... this.
10912 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
10913 (AM_CPPFLAGS): Renamed from ...
10914 (INCLUDE): ... this.
10915 * Makefile.in, testsuite/Makefile.in: Regenerate.
10916
81ecdfbb
RW
10917 * Makefile.in: Regenerate.
10918 * aclocal.m4: Likewise.
10919 * config.in: Likewise.
10920 * configure: Likewise.
10921 * testsuite/Makefile.in: Likewise.
10922
c462b41b
RW
10923 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
10924 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
10925 * Makefile.in: Regenerate.
10926 * testsuite/Makefile.in: Regenerate.
10927
2da73f13
CC
109282009-08-19 Cary Coutant <ccoutant@google.com>
10929
10930 * resolve.cc (Symbol_table::resolve): Don't complain about defined
10931 symbols in shared libraries overridden by hidden or internal symbols
10932 in the main program.
10933
2db70501
CD
109342009-08-19 Chris Demetriou <cgd@google.com>
10935
10936 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
10937 checking source file names in error messages.
10938
f733487b
DK
109392009-08-18 Doug Kwan <dougkwan@google.com>
10940
10941 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
10942 an elcpp::Ehdr as parameter. Adjust call to set_target.
10943 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
10944 an elfcpp::Ehdr as parameter.
10945 * object.cc (Object::set_target): Remove the version that looks up
10946 a target and sets it.
10947 (Sized_relobj::setup): Take a Target object instead of
10948 an elfcpp::Ehdr as parameter. Adjust call to set_target.
10949 (make_elf_sized_object): Find target and ask target to
10950 make an ELF object.
10951 * object.h: (Object::set_target): Remove the version that looks up
10952 a target and sets it.
10953 (Sized_relobj::setup): Take a Target object instead of
10954 an elfcpp:Ehdr as parameter.
10955 * target.cc: Include dynobj.h.
10956 (Target::do_make_elf_object_implementation): New.
2e702c99 10957 (Target::do_make_elf_object): New.
f733487b
DK
10958 * target.h (Target::make_elf_object): New template declaration.
10959 (Target::do_make_elf_object): New method declarations.
10960 (Target::do_make_elf_object_implementation): New template declaration.
10961
cc70f101
ILT
109622009-08-14 Ian Lance Taylor <iant@google.com>
10963
10964 * gold.h (FUNCTION_NAME): Define.
10965 (gold_unreachable): Use FUNCTION_NAME.
10966
ef5e0cb1
ST
109672009-08-12 Sriraman Tallam <tmsriram@google.com>
10968
10969 * icf.cc (Icf::find_identical_sections): Issue a warning when a
10970 symbol in the --keep-unique list is not found.
10971
48c187ce
ST
109722009-08-12 Sriraman Tallam <tmsriram@google.com>
10973
10974 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
10975 been maked as --keep-unique.
10976 (Icf::unfold_section): New function.
10977 * icf.h (Icf::unfold_section): New function.
10978 * options.h (General_options::keep_unique): New option.
10979 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
10980 * testsuite/Makefile.in: Regenerate.
10981 * testsuite/icf_keep_unique_test.sh: New file.
10982 * testsuite/icf_keep_unique_test.cc: New file.
10983
645afe0c
CC
109842009-08-12 Cary Coutant <ccoutant@google.com>
10985
10986 PR 10471
10987 * resolve.cc (Symbol_table::resolve): Check for references from
10988 dynamic objects to hidden and internal symbols.
10989 * testsuite/Makefile.am (hidden_test.sh): New test.
10990 * testsuite/Makefile.in: Regenerate.
10991 * testsuite/hidden_test.sh: New script.
10992 * testsuite/hidden_test_1.c: New test source.
10993 * testsuite/hidden_test_main.c: New test source.
10994
11af873f
DK
109952009-08-11 Doug Kwan <dougkwan@google.com>
10996
10997 * arm.cc: Update comments.
10998 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
10999 segment to locate the .ARM.exidx section if present.
11000
b9f7d72d
DK
110012009-08-09 Doug Kwan <dougkwan@google.com>
11002
11003 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
11004 patch.
11005
ddd3c53c
ST
110062009-08-07 Sriraman Tallam <tmsriram@google.com>
11007 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
11008 compiler warnings.
11009
27721062
ST
110102009-08-06 Sriraman Tallam <tmsriram@google.com>
11011
11012 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
11013 valid tls_segment only for non-debug-section relocations.
11014 * testsuite/Makefile.am: Add gc_tls_test.
11015 * testsuite/Makefile.in: Regenerate.
11016 * testsuite/gc_tls_test.cc: New file.
11017 * testsuite/gc_tls_test.sh: New file.
11018
ef15dade 110192009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 11020
ef15dade
ST
11021 * icf.cc: New file.
11022 * icf.h: New file.
11023 * Makefile.am (CCFILES): Add icf.cc.
11024 (HFILES): Add icf.h
11025 * Makefile.in: Regenerate.
11026 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
11027 * gc.h (gc_process_relocs): Populate lists used by icf to contain
11028 section, symbol and addend information for the relocs.
11029 * gold.cc (queue_middle_tasks): Call identical code folding.
11030 * gold.h: Add defines for multimap.
11031 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
11032 to the call of finalize_local_symbols.
11033 * main.cc (main): Create object of class Icf.
11034 * object.cc (Sized_relobj::do_layout): Allow this function to be
11035 called twice during icf.
11036 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
11037 to sections marked as identical by icf.
11038 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
11039 when available.
11040 (Sized_relobj::do_section_entsize): New function.
11041 * object.h (Object::section_entsize): New function.
11042 (Object::do_section_entsize): New pure virtual function.
11043 (Relobj::finalize_local_symbols): Add new parameter.
11044 (Relobj::do_section_entsize): New function.
11045 * options.h (General_options::icf): New option.
11046 (General_options::icf_iterations): New option.
11047 (General_options::print_icf_sections): New option.
11048 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
11049 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
11050 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
11051 icf.
11052 * symtab.cc (Symbol_table::is_section_folded): New function.
11053 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
11054 to sections marked as identical by icf.
11055 * symtab.h (Symbol_table::set_icf): New function.
11056 (Symbol_table::icf): New function.
11057 (Symbol_table::is_section_folded): New function.
11058 (Symbol_table::icf_): New data member.
11059 * target-reloc.h (relocate_section): Ignore sections folded by icf.
11060 * testsuite/Makefile.am: Add commands to build icf_test.
11061 * testsuite/Makefile.in: Regenerate.
11062 * testsuite/icf_test.sh: New file.
11063 * testsuite/icf_test.cc: New file.
11064
c3b65ac4
CD
110652009-07-24 Chris Demetriou <cgd@google.com>
11066
11067 * layout.cc (is_compressible_debug_section): Fix incorrect
11068 comment about compressed section names.
11069
1caf2c51
ILT
110702009-07-20 Ian Lance Taylor <ian@airs.com>
11071
11072 PR 10419
11073 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
11074
1ef4d87f
ILT
110752009-07-16 Ian Lance Taylor <iant@google.com>
11076
11077 PR 10400
11078 * layout.h: #include <map>.
11079 (class Kept_section): Change from struct to class. Add accessors
11080 and setters. Add section size to Comdat_group mapping. Change
11081 Comdat_group to std::map. Add is_comdat_ field. Add
11082 linkonce_size field in union.
11083 (class Layout): Update declaration of find_or_add_kept_section.
11084 Don't declare find_kept_object.
11085 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
11086 parameter. Add object, shndx, is_comdat, and is_group_name
11087 parameters. Change all callers. Adjust for new Kept_section.
11088 (Layout::find_kept_object): Remove.
11089 * object.cc (Sized_relobj::include_section_group): Update use of
11090 Kept_section. Rename secnum to shndx. Only record
11091 Kept_comdat_section if sections are the same size.
11092 (Sized_relobj::include_linkonce_section): Update use of
11093 Kept_section. Only record Kept_comdat_section if sections are the
11094 same size. Set size of linkonce section.
11095 (Sized_relobj::map_to_kept_section): Update call to
11096 get_kept_comdat_section.
11097 * object.h (class Sized_relobj): Rename fields in
11098 Kept_comdat_section to drop trailing underscores; change object
11099 field to Relobj*. Change Kept_comdat_section_table to store
11100 struct rather than pointer.
11101 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
11102 Add kept_object and kept_shndx parameters. Change all callers.
11103 (Sized_relobj::get_kept_comdat_section): Change return type to
11104 bool. Add kept_object and kept_shndx parameters. Change all
11105 callers.
11106 * plugin.cc (Pluginobj::include_comdat_group): Update call to
11107 Layout::find_or_add_kept_section.
11108
37c3b7b0
ILT
111092009-07-09 Ian Lance Taylor <iant@google.com>
11110
11111 * merge.cc (Object_merge_map::initialize_input_to_output_map):
11112 Reserve space in the hash table.
11113
98fa85cb
ILT
111142009-07-06 Mikolaj Zalewski <mikolajz@google.com>
11115
11116 * fileread.cc (File_read::get_mtime): New method.
11117 * fileread.h (Timespec): New structure.
11118 (File_read::get_mtime): New method.
11119 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
11120 Renamed from timestamp_nsec.
11121 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
11122 Elf_Xword.
e1df38aa 11123 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 11124 timestamp_nsec.
e1df38aa 11125 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
11126 (Incremental_inputs::report_obejct): Save mtime; style fix.
11127 (Incremental_inputs::report_script): Save mtime; style fix.
11128 (Incremental_inputs::finalize_inputs): Style fix.
11129 (Incremental_inputs::finalize): Style fix.
11130 (Incremental_inputs::create_input_section_data): Store inputs
11131 mtime.
11132 * incremental.h (Incremental_inputs::report_script): Add mtime
11133 argument.
11134 (Incremental_inputs::Input_info::Input_info): Intialize only one
11135 union member.
11136 (Incremental_inputs::Input_info::archive): Move to nameless
11137 union.
11138 (Incremental_inputs::Input_info::obejct): Move to nameless union.
11139 (Incremental_inputs::Input_info::script): Move to nameless union.
11140 (Incremental_inputs::mtime): New field.
11141 * script.cc (read_input_script): Pass file mtime to
11142 Incremental_input.
11143 * script.h (Script_info::inputs): Style fix.
11144
c9d70757
ILT
111452009-07-01 Ian Lance Taylor <ian@airs.com>
11146
11147 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
11148 instead of 32.
11149
9c547ec3
ILT
111502009-06-24 Ian Lance Taylor <iant@google.com>
11151
11152 PR 10156
11153 * layout.cc (Layout::choose_output_section): If we find an
11154 existing section, update the flags.
11155 (Layout::create_notes): New function, broken out of
11156 Layout::finalize.
11157 (Layout::finalize): Don't create note sections.
11158 (Layout::create_note): Don't crash if linker script discards
11159 section.
11160 (Layout::create_gold_note): Likewise.
11161 (Layout::create_build_id): Likewise. Don't set
11162 after_input_sections on the section.
11163 (Layout::create_executable_stack_info): Remove target parameter.
11164 Change caller.
11165 * layout.h (class Layout): Declare create_notes. Update
11166 declaration of create_executable_stack_info.
11167 * gold.cc (queue_middle_tasks): Call create_notes.
11168 * output.cc (Output_section::update_flags_for_input_section): Move
11169 here from output.h. If SHF_ALLOC flag is newly set, mark address
11170 invalid.
11171 * output.h (Output_data::mark_address_invalid): New function.
11172 (class Output_section): Only declare, not define,
11173 update_flags_for_input_section. Remove set_flags.
11174
55458500
ILT
111752009-06-24 Ian Lance Taylor <iant@google.com>
11176
11177 * script-sections.cc (Output_section_definition::
11178 set_section_addresses): Rename shadowing local load_address to
11179 laddr.
11180
1307d6cd
ILT
111812009-06-24 Ian Lance Taylor <iant@google.com>
11182
11183 PR 10244
11184 * reloc.cc (relocate_sections): Skip empty relocation sections.
11185
ec3f783e
ILT
111862009-06-23 Ian Lance Taylor <iant@google.com>
11187
11188 PR 10156
11189 * layout.cc (Layout::create_note): Use choose_output_section
11190 rather than make_output_section.
11191
459c9f1c
ILT
111922009-06-23 Ian Lance Taylor <iant@google.com>
11193
11194 PR 10237
11195 * options.cc (General_options::parse_V): Set printed_version_.
11196 (General_options::General_options): Initialize printed_version_.
11197 * options.h (class General_options): Add printed_version_ field.
11198 * gold.cc (queue_initial_tasks): If there are no input files,
11199 don't give a fatal error if we printed the version information.
11200 (queue_middle_tasks): If using -r with a shared object, give a
11201 fatal error rather than an ordinary error.
11202
1518dc8f
ILT
112032009-06-23 Ian Lance Taylor <iant@google.com>
11204
11205 PR 10219
11206 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
11207 (Layout::make_output_section): Set have_stabstr_section_ if we see
11208 a .stab*str section.
11209 (Layout::finalize): Call link_stabs_sections.
11210 (Layout::link_stabs_sections): New file.
11211 * layout.h (class Layout): Add have_stabstr_section_ field.
11212 Declare link_stabs_sections.
11213
3d857b98
DK
112142009-06-23 Doug Kwan <dougkwan@google.com>
11215
11216 * Makefile.am (libgold_a_LIBADD): New.
11217 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 11218 * Makefile.in: Regenerate.
3d857b98
DK
11219 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
11220 * configure: Regenerate.
11221 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
11222 * fileread.cc: Include sys/state.h
11223 * gold.h: Declare memmem and strndup if found missing.
11224 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
11225
0639a6f6
ILT
112262009-06-23 Ian Lance Taylor <iant@google.com>
11227
11228 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
11229 * configure: Rebuild.
11230
8d63875c
ILT
112312009-06-23 Ian Lance Taylor <iant@google.com>
11232
11233 PR 10147
11234 * object.cc (Object::section_contents): Don't try to get a view if
11235 the section has length zero.
11236 (Object::handle_gnu_warning_section): If the section is empty, use
11237 the name of the section as the warning.
11238
f7c8a183
ILT
112392009-06-23 Ian Lance Taylor <iant@google.com>
11240
11241 PR 10133
11242 * stringpool.h (class Stringpool_template): Add optimize_ field.
11243 (Stringpool_template::set_optimize): New function.
11244 * stringpool.cc (Stringpool_template::Stringpool_template):
11245 Initialize optimize_ field.
11246 (Stringpool_template::set_string_offsets): Test local optimize
11247 fild rather than parameter.
11248 * layout.cc (Layout::Layout): Call set_optimize on the section
11249 name stringpool.
11250
e6a307ba
ILT
112512009-06-22 Ian Lance Taylor <iant@google.com>
11252
11253 PR 10030
11254 * yyscript.y: Parse TARGET.
11255 * script.cc (script_set_target): New function.
11256 * script-c.h (script_set_target): Declare.
11257 * options.cc (General_options::string_to_object_format): Rename
11258 from string_to_object_format in anonymous namespace. Change
11259 callers.
11260 * options.h (class General_options): Declare
11261 string_to_object_format.
11262
3ee173de
ILT
112632009-06-22 Ian Lance Taylor <iant@google.com>
11264
11265 * script-sections.cc (Script_sections::create_segments): Don't put
11266 program headers in a PT_LOAD segment if -n or -N.
11267
112682009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
11269
11270 PR 10141
11271 * options.h (class General_options): Add -z lazy and -z now. Sort
11272 -z options into alphabetical order.
11273 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
11274
cd6739a1 112752009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
11276
11277 * layout.cc (Layout::make_output_section): Call
11278 Target::new_output_section.
11279 (Layout::attach_allocated_section_to_segment): Put large section
11280 sections in a separate load segment with the large segment flag
11281 set.
11282 (Layout::segment_precedes): Sort large data segments after other
11283 load segments.
11284 (align_file_offset): New static function.
11285 (Layout::set_segment_offsets): Use align_file_offset.
11286 * output.h (class Output_section): Add is_small_section_ and
11287 is_large_section_ fields.
11288 (Output_section::is_small_section): New function.
11289 (Output_section::set_is_small_section): New function.
11290 (Output_section::is_large_section): New function.
11291 (Output_section::set_is_large_section): New function.
11292 (Output_section::is_large_data_section): New function.
11293 (class Output_segment): Add is_large_data_segment_ field.
11294 (Output_segment::is_large_data_segment): New function.
11295 (Output_segment::set_is_large_data_segment): New function.
11296 * output.cc (Output_section::Output_section): Initialize new
11297 fields.
11298 (Output_segment::Output_segment): Likewise.
11299 (Output_segment::add_output_section): Add assertion that large
11300 data sections always go in large data segments. Force small data
11301 sections to the end of the list of data sections. Force small BSS
11302 sections to the start of the list of BSS sections. For large BSS
11303 sections to the end of the list of BSS sections.
11304 * symtab.h (class Symbol): Declare is_common_shndx.
11305 (Symbol::is_defined): Check Symbol::is_common_shndx.
11306 (Symbol::is_common): Likewise.
11307 (class Symbol_table): Define enum Commons_section_type. Update
11308 declarations. Add small_commons_ and large_commons_ fields.
11309 * symtab.cc (Symbol::is_common_shndx): New function.
11310 (Symbol_table::Symbol_table): Initialize new fields.
11311 (Symbol_table::add_from_object): Put small and large common
11312 symbols in the right list.
11313 (Symbol_table::sized_finalized_symbol): Check
11314 Symbol::is_common_shndx.
11315 (Symbol_table::sized_write_globals): Likewise.
11316 * common.cc (Symbol_table::do_allocate_commons): Allocate new
11317 common symbol lists. Don't call do_allocate_commons_list if the
11318 list is empty.
11319 (Symbol_table::do_allocate_commons_list): Remove is_tls
11320 parameter. Add comons_section_type parameter. Change all
11321 callers. Handle small and large common symbols.
11322 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
11323 Symbol::is_common_shndx.
11324 * resolve.cc (symbol_to_bits): Likewise.
11325 * target.h (Target::small_common_shndx): New function.
11326 (Target::small_common_section_flags): New function.
11327 (Target::large_common_shndx): New function.
11328 (Target::large_common_section_flags): New function.
11329 (Target::new_output_section): New function.
11330 (Target::Target_info): Add small_common_shndx, large_common_shndx,
11331 small_common_section_flags, and large_common_section_flags
11332 fields.
11333 (Target::do_new_output_section): New virtual function.
11334 * arm.cc (Target_arm::arm_info): Initialize new fields.
11335 * i386.cc (Target_i386::i386_info): Likewise.
11336 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
11337 Likewise.
11338 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
11339 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
11340 (Target_x86_64::do_new_output_section): New function.
11341 * configure.ac: Define conditional MCMODEL_MEDIUM.
11342 * testsuite/Makefile.am (check_PROGRAMS): Add large.
11343 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
11344 (large_LDFLAGS): Define.
11345 * testsuite/large.c: New file.
11346 * testsuite/testfile.cc (Target_test::test_target_info):
11347 Initialize new fields.
11348 * configure, testsuite/Makefile.in: Rebuild.
11349
bb04269c
DK
113502009-06-05 Doug Kwan <dougkwan@google.com>
11351
11352 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 11353 * Makefile.in: Regenerate.
bb04269c
DK
11354 * i386.cc (class Target_i386): Define new virtual method to
11355 override do_is_local_label_name in parent.
11356 * object.cc (Sized_relobj::do_count_local_symbols): Discard
11357 local symbols if --discard-locals or -X is given.
11358 * options.h (class General_options): Declare new options
11359 '--discard-locals' and '-X' for discarding locals.
11360 * target.h (class Target): Define new methods is_local_label_name.
11361 Declare new virtual method do_is_local_label_name.
11362 * target.cc: New file.
11363 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
11364 (check_SCRIPTS): Add discard_locals_test.sh.
11365 (check_DATA): Add discard_local_tests.syms.
11366 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
11367 (discard_local_tests.syms, discard_locals_test.o): New make rules.
11368 * testsuite/Makefile.in: Regenerate.
11369 * testsuite/discard_locals_test.c: New file.
11370 * testsuite/discard_locals_test.sh: Same.
11371
805bb01c
DK
113722009-06-05 Doug Kwan <dougkwan@google.com>
11373
11374 * object.cc (Sized_relobj::Sized_relobj): Initialize
11375 discarded_eh_frame_shndx_ to -1U.
11376 (Sized_relobj::do_layout): Record index of a discard .eh_frame
11377 section.
11378 (Sized_relobj::do_count_local_symbols): Skip local symbols in
11379 a discarded .eh_frame section.
11380 (Sized_relobj::do_finalize_local_symbols): Ditto.
11381 * object.h (class Sized_relobj): Declare new member
11382 discarded_eh_frame_shndx_.
11383 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
11384 (local_labels_test.o, local_labels_test): New rules.
11385 * testsuite/Makefile.in: Regenerate.
11386
1dcd334d
DK
113872009-06-04 Doug Kwan <dougkwan@google.com>
11388
11389 * layout.cc (Layout::section_name_mapping): Add mapping for
11390 special ARM sections.
11391
96d49306
DK
113922009-06-03 Doug Kwan <dougkwan@google.com>
11393
11394 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
11395 (utils::has_overflow): Same.
11396
dff16297
ILT
113972009-06-03 Ian Lance Taylor <iant@google.com>
11398
11399 * layout.cc (Layout::section_name_mapping): New array, replacing
11400 Layout::linkonce_mapping.
11401 (Layout::section_name_mapping_count): New variable, replacing
11402 Layout::linkonce_mapping_count.
11403 (Layout::linkonce_output_name): Remove.
11404 (Layout::output_section_name): Rewrite.
11405 * layout.h (class Layout): Rename Linkonce_mapping to
11406 Section_name_mapping, linkonce_mapping to section_name_mapping,
11407 linkonce_mapping_count to section_name_mapping_count. Don't
11408 declare linkonce_output_name.
11409
c121c671
DK
114102009-06-03 Doug Kwan <dougkwan@google.com>
11411
11412 * gold/arm.cc (namespace utils): New.
11413 (Target_arm::reloc_is_non_pic): Define new method.
11414 (class Arm_relocate_functions): New.
11415 (Target_arm::Relocate::relocate): Handle relocation types used by
11416 Android.
11417
07800fab
ILT
114182009-06-03 Ian Lance Taylor <iant@google.com>
11419
11420 * arm.cc (Target_arm::scan::global): Use || instead of |.
11421
c121c671
DK
114222009-06-02 Doug Kwan <dougkwan@google.com>
11423
11424 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
11425 issued_non_pic_error_.
11426 (class Target_arm::Scan): Declare new method check_non_pic.
11427 Define new method symbol_needs_plt_entry.
11428 Declare new data member issued_non_pic_error_.
11429 (class Target_arm::Relocate): Declare new method
11430 should_apply_static_reloc.
11431 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
11432 (Target_arm::Scan::check_non_pic): Define new method.
11433 (Target_arm::Scan::local): Handle a small subset of reloc types used
11434 by Android.
11435 (Target_arm::Scan::local): Same.
11436 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
11437
b19b0c6d
ILT
114382009-05-31 Mikolaj Zalewski <mikolajz@google.com>
11439
11440 * incremental.cc (Incremental_inputs::report_command_line): Filter
11441 out --incremental-* options.
11442
94cdfcff
DK
114432009-05-29 Doug Kwan <dougkwan@google.com>
11444
11445 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
11446 template class.
11447 (class Target_arm): Update comment.
11448 (Target_arm::Target_arm): Initialize new data members GOT_,
11449 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
11450 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
11451 and Target_arm::rel_dyn_section.
11452 Declare new_enum Target_arm::Got_type.
11453 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
11454 and DYNBSS_.
11455 Update commments for member do_dynsym_value.
11456 (Target_arm::got_size, Target_arm::plt_section,
11457 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
11458 new methods inside class defintion.
11459 (Target_arm::got_section): Define new method.
11460 (Target_arm::rel_dyn_section): Same.
11461 (Output_data_plt_arm): New template class.
11462 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
11463 (Output_data_plt_arm:do_adjust_output_section): Define new method.
11464 (Output_data_plt_arm::add_entry): Same.
11465 (Output_data_plt_arm::first_plt_entry): Define new
11466 static data member for PLT instruction template.
11467 (Output_data_plt_arm::plt_entry): Same.
11468 (Output_data_plt_arm::do_write): Define new method.
11469 (Target_arm::make_plt_entry): Same.
11470 (Target_arm::do_finalize_sections): Same.
11471 (Target_arm::do_dynsym_value): Same.
11472
4a657b0d
DK
114732009-05-28 Doug Kwan <dougkwan@google.com>
11474
11475 * Makefile.am (TARGETSOURCES): Add arm.cc.
11476 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
11477 * Makefile.in: Regenerate.
11478 * arm.cc: New file.
11479 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
11480
e7ae8c36
DK
114812009-05-26 Doug Kwan <dougkwan@google.com>
11482
11483 * options.cc (General_options::parse_exclude_libs). Fix a comment.
11484 (General_options::check_excluded_libs): Strip off directories in
11485 archive name before matching like GNU ld does.
11486 * testsuite/Makefile.am (MOSTLYCLEANFILES,
11487 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
11488 (exclude_libs_test_LDFLAGS): Add linker option
11489 -Wl,--exclude-libs,libexclude_libs_test_3
11490 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
11491 an explicit archive without using -l.
11492 (alt/libexclude_libs_test_3.a): New make rule.
11493 * testsuite/Makefile.in: Regenerate.
11494 * testsuite/exclude_libs_test.c : Declare lib3_default().
11495 (main): Call it.
11496 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
11497 * exclude_libs_test_3.c: New file.
11498
f12e7348
NC
114992009-05-26 Nick Clifton <nickc@redhat.com>
11500
11501 * po/id.po: New Indonesian translation.
11502 * po/gold.pot: Updated template file.
11503
4daadc0d
ST
115042009-05-22 Sriraman Tallam <tmsriram@google.com>
11505
e1df38aa 11506 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
11507 gc_comdat_test files. Add -Wl,--gc-sections to build
11508 gc_comdat_test.
11509 * testsuite/Makefile.in: Regenerate.
11510 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
11511
531813ad
ST
115122009-05-21 Sriraman Tallam <tmsriram@google.com>
11513
11514 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
11515 kept comdat section was garbage collected.
11516 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
11517 * testsuite/Makefile.in: Regenerate.
11518 * testsuite/gc_comdat_test.sh: New file.
11519 * testsuite/gc_comdat_test_1.cc: New file.
11520 * testsuite/gc_comdat_test_2.cc: New file.
11521
65514900
CC
115222009-05-19 Doug Kwan <dougkwan@google.com>
11523
11524 * archive.cc (Archive::Archive): Move constructor from archive.h
11525 to here. Initialize no_export_.
11526 (Archive::get_elf_object_for_member): Set no_export flag of object.
11527 * archive.h (Archive::Archive): Move constructor body to
11528 archive.cc.
11529 (Archive::no_export): New method.
11530 (Archive::no_export_): New field.
11531 * object.h (Object::Object): Initialize no_export_ to false.
11532 (Object::no_export, Object::set_no_export): New methods.
11533 (Object::no_export_): New field.
11534 * options.cc (General_options::parse_exclude_libs): New method.
11535 (General_options::check_excluded_libs) Same.
11536 * options.h (exclude_libs): New option.
11537 (General_options::check_excluded_libs): New method declaration.
11538 (General_options::excluded_libs_): New field.
11539 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
11540 default or protected visibility if an object has no-export flag set.
11541 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
11542 (check_SCRIPTS): Add exclude_libs_test.sh.
11543 (check_DATA): Add exclude_libs_test.syms.
11544 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
11545 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
11546 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
11547 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
11548 (exclude_libs_test.syms, libexclude_libs_test_1.a,
11549 libexclude_libs_test_2.a): New rules.
11550 * testsuite/Makefile.in: Regenerate.
11551 * testsuite/exclude_libs_test.c: New file.
11552 * testsuite/exclude_libs_test.sh: Ditto.
11553 * testsuite/exclude_libs_test_1.c: Ditto.
11554 * testsuite/exclude_libs_test_2.c: Ditto.
11555
1b77ea50
ILT
115562009-05-15 Ian Lance Taylor <iant@google.com>
11557
11558 * configure.ac: Check for declarations for cases where libiberty.h
11559 checks HAVE_DECL_xxx.
11560 * configure, config.in: Rebuild.
11561
072fe7ce
ILT
115622009-05-15 Mikolaj Zalewski <mikolajz@google.com>
11563
11564 * gold.h (Incremental_argument_list): Remove (invalid) forward
11565 declaration.
11566 * incremental.cc (Incremental_inputs::report_achive): New method.
11567 (Incremental_inputs::report_object): New method.
11568 (Incremental_inputs::report_script): New method.
11569 (Incremental_inputs::finalize_inputs): New method.
11570 (Incremental_inputs::finalize): Call finalize_inputs().
11571 (Incremental_inputs::sized_create_incremental_inputs_section_data):
11572 Create inputs entries.
11573 * incremental.h (Incremental_input_type): New enum.
11574 (Incremental_inputs::Incremental_input): Initialize new fields.
11575 (Incremental_inputs::report_inputs): New method.
11576 (Incremental_inputs::report_achive): New method.
11577 (Incremental_inputs::report_object): New method.
11578 (Incremental_inputs::report_script): New method.
11579 (Incremental_inputs::finalize_inputs): New method.
11580 (Incremental_inputs::Input_info): New struct.
11581 (Incremental_inputs::Input_info_map): New typedef.
11582 (Incremental_inputs::lock_): New field.
11583 (Incremental_inputs::Inputs_): New field.
11584 (Incremental_inputs::Inputs_map): New field.
11585 * main.cc (main): Call Incremental_input::report_inputs.
11586 * options.h (Input_argument_list): Typedef moved from
11587 Input_arguments.
11588 (Input_file_group::Files): Remove, use ::Input_argument_list.
11589 (Input_file_group::Input_argument_list): Remove, use
11590 ::Input_argument_list.
11591 * plugin.cc (Plugin_manager::add_input_file): Add error in
11592 incremental build.
11593 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
11594 functions.
11595 * script.cc (read_input_script): Call
11596 Incremental_input::report_script.
11597 * script.h (Script_info): New class.
11598
b0481b0b
ILT
115992009-04-27 Ian Lance Taylor <iant@google.com>
11600
11601 * x86_64.cc (do_adjust_output_section): Set entsize to
11602 plt_entry_size.
11603
b22a5a41 116042009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
11605
11606 * output.cc (Output_file::close): After short writes, continue
11607 writing from the correct offset in the buffer being written.
11608
40fde488
CD
116092009-04-23 Chris Demetriou <cgd@google.com>
11610
11611 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
11612 * configure: Regenerate.
11613 * config.in: Regenerate.
11614 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
11615 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
11616
3ce2c28e
ILT
116172009-04-21 Mikolaj Zalewski <mikolajz@google.com>
11618
11619 * incremental.cc (Incremental_inputs_header_data): Renamed from
11620 Incremental_input_header_data.
11621 (Incremental_inputs_header_data::data_size): New field.
11622 (Incremental_inputs_header_data::put_input_file_count): Renamed
11623 from input_file_count.
11624 (Incremental_inputs_header_data::put_command_line_offset): Renamed
11625 from command_line_offset.
11626 (Incremental_inputs_header_data::put_reserved): Renamed from
11627 put_reserved.
11628 (Incremental_inputs_entry_data): Renamed from
11629 Incremental_input_entry_data.
11630 (Incremental_inputs_entry_data::data_size): New field.
11631 (Incremental_inputs::report_command_line): New method.
11632 (Incremental_inputs::finalize): New method.
11633 (Incremental_inputs::create_incremental_inputs_data): New method.
11634 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
11635 * incremental.h: New file.
11636 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 11637 (Layout::finalize): Create incremental inputs section in
3ce2c28e 11638 incremental builds.
703d02da 11639 (Layout::create_incremental_info_sections): New method.
3ce2c28e 11640 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
11641 (Layout::create_incremental_info_sections): New method.
11642 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
11643 * main.cc (main): Notify Incremental_input of the command line.
11644
e55bde5e
ILT
116452009-04-01 Ian Lance Taylor <iant@google.com>
11646 Mikolaj Zalewski <mikolajz@google.com>
11647
11648 * gold.h (reserve_unordered_map): Define, three versions, one for
11649 each version of Unordered_map.
11650 * layout.cc (Layout::Layout): Remove options parameter. Add
11651 number_of_input_files parameter. Don't initialize options_.
11652 Initialize number_of_input_files_ and resized_signatures_. Move
11653 sections_are_attached_.
11654 (Layout::layout_group): Reserve space for group_signatures_.
11655 (Layout::find_or_add_kept_section): Change name parameter to be a
11656 reference. Resize signatures_ map when it gets large enough.
11657 (Layout::layout_eh_frame): Use parameters->options() instead of
11658 this->options_.
11659 (Layout::make_output_section): Likewise.
11660 (Layout::attach_allocated_section_to_segment): Likewise.
11661 (Layout::finalize, Layout::create_executable_stack): Likewise.
11662 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
11663 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
11664 * layout.h (class Layout): Update declarations. Remove options_
11665 field. Add number_of_input_files_ and resized_signatures_
11666 fields. Move sections_are_attached_ field.
11667 * main.cc (main): Pass number of input files to Layout
11668 constructor. Don't pass options.
11669
154b857c
ILT
116702009-03-30 Ian Lance Taylor <iant@google.com>
11671
11672 * ffsll.c (ffsll): Correct implementation.
11673
2f35ab9b
ILT
116742009-03-27 Ian Lance Taylor <iant@google.com>
11675
fd03461a
ILT
11676 * ffsll.c: New file.
11677 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
11678 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
11679 * ftruncate.c (ftruncate): Declare before definition.
11680 * mremap.c (mremap): Likewise.
11681 * pread.c (pread): Likewise.
11682 * configure, Makefile.in, config.in: Rebuild.
11683
2f35ab9b
ILT
11684 * mremap.c: New file.
11685 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
11686 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
11687 (mremap): Declare if HAVE_MREMAP is not defined.
11688 * configure, Makefile.in, config.in: Rebuild.
11689
33aea2fd
CC
116902009-03-27 Cary Coutant <ccoutant@google.com>
11691
11692 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
11693 position independent.
11694 * sparc.cc (Target_sparc::check_non_pic): Likewise.
11695 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
11696
6d479619
CC
116972009-03-24 Cary Coutant <ccoutant@google.com>
11698
11699 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
11700 an executable.
11701 (needs_dynamic_reloc): Likewise.
11702
afc06bb8
ILT
117032009-03-24 Ian Lance Taylor <iant@google.com>
11704
11705 * yyscript.y (file_cmd): Recognize EXTERN.
11706 (extern_name_list, extern_name_list_body): New nonterminals.
11707 * script.cc (script_add_extern): Define.
11708 * script-c.h (script_add_extern): Declare.
11709
f6060a4d
ILT
117102009-03-24 Rafael Avila de Espindola <espindola@google.com>
11711
11712 * object.cc (is_elf_object): Define.
11713 * object.h (is_elf_object): Declare.
11714 * archive.cc (Archive::get_elf_object_for_member): Call
11715 is_elf_object.
33aea2fd 11716 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 11717
26736d8e
ILT
117182009-03-24 Elliott Hughes <enh@google.com>
11719
11720 * output.cc (Output_file::map_anonymous): Define.
11721 (Output_file::map): Use map_anonymous. If the regular mmap fails,
11722 try an anonymous one. Report the size if the mmap fails.
11723 * output.h (class Output_file): Declare map_anonymous.
11724
22fd9730
ILT
117252009-03-24 Ian Lance Taylor <iant@google.com>
11726
11727 * target-select.cc (instantiate_target): Don't acquire the lock if
11728 the instantiated_target_ field has already been set.
11729
cb010894
ILT
117302009-03-23 Ian Lance Taylor <iant@google.com>
11731
7f055c20
ILT
11732 * gold-threads.h (class Initialize_lock): Define.
11733 * gold-threads.cc (class Initialize_lock_once): Define.
11734 (initialize_lock_control): New static variable.
11735 (initialize_lock_pointer): New static variable.
11736 (initialize_lock_once): New static function.
11737 (Initialize_lock::Initialize_lock): Define.
11738 (Initialize_lock::initialize): Define.
11739 * target-select.h: Include "gold-threads.h".
11740 (class Target_selector): Add lock_ and initialize_lock_ fields.
11741 Don't define instantiate_target, just declare it.
11742 * target-select.cc (Target_selector::Target_selector): Initialize
11743 new fields.
11744 (Target_selector::instantiate_target): Define.
11745 * descriptors.h: Include "gold-threads.h".
11746 (class Descriptors): Add initialize_lock_ field.
11747 * descriptors.cc (Descriptors::Descriptors): Initialize new
11748 field.
11749 (Descriptors::open): Use initialize_lock_ field
11750 * errors.h (class Errors): Add initialize_lock_ field.
11751 * errors.cc (Errors::Errors): Initialize new field.
11752 (Errors::initialize_lock): Use initialize_lock_ field.
11753 * powerpc.cc (class Target_selector_powerpc): Remove
11754 instantiated_target_ field. In do_recognize call
11755 instantiate_target rather than do_instantiate_target. In
11756 do_instantiate_target just allocate a new target.
11757 * sparc.cc (class Target_selector_sparc): Likewise.
11758
36959681
ILT
11759 * freebsd.h: New file.
11760 * i386.cc: Include "freebsd.h".
11761 (Target_i386): Derive from Target_freebsd rather than
11762 Sized_target.
11763 (Target_selector_i386): Derive from Target_selector_freebsd rather
11764 than Target_selector.
11765 * x86_64.cc: Include "freebsd.h".
11766 (Target_x86_64): Derive from Target_freebsd rather than
11767 Sized_target.
11768 (Target_selector_x86_64): Derive from Target_selector_freebsd
11769 rather than Target_selector.
11770 * target.h (class Target): Add adjust_elf_header and
11771 do_adjust_elf_header.
11772 * output.cc (Output_file_header:: do_sized_write): Call target
11773 adjust_elf_header routine.
11774 * configure.tgt: Set targ_osabi.
11775 * configure.ac: Define GOLD_DEFAULT_OSABI.
11776 * parameters.cc (Parameters::default_target): Pass
11777 GOLD_DEFAULT_OSABI to select_target.
11778 * target-select.h (class Target_selector): Make instantiate_target
11779 protected rather than private.
11780 * Makefile.am (HFILES): Add freebsd.h.
11781 * configure, Makefile.in, config.in: Rebuild.
11782
cb010894
ILT
11783 * merge.cc (do_add_input_section): Correct pend value. Change
11784 message about last entry not being null terminated from error to
11785 warning.
11786
0e879927
ILT
117872009-03-20 Mikolaj Zalewski <mikolajz@google.com>
11788
11789 * incremental.cc: New file.
11790 * Makefile.am (CCFILES): Add incremental.cc.
11791 * Makefile.in: Rebuild.
11792
41105937
PP
117932009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
11794
11795 * layout.cc (Layout::output_section_name): Preserve names
11796 of '.note.' sections.
e1df38aa 11797
60439920
ILT
117982009-03-19 Ian Lance Taylor <iant@google.com>
11799
11800 * descriptors.cc (Descriptors::open): Check that the options are
11801 valid before using them.
11802
0d371ad3
ILT
118032009-03-18 Ian Lance Taylor <iant@google.com>
11804
11805 * script-sections.h: Include <list>.
11806 (class Script_sections): Change Sections_elements from std::vector
11807 to std::list. Typedef public Elements_iterator. Add
11808 orphan_section_placement_, data_segment_align_start_, and
11809 saw_data_segment_align_ fields. Remove data_segment_align_index_
11810 field.
11811 * script-sections.cc (class Orphan_section_placement): New class.
11812 (class Sections_element): Add virtual functions is_relro and
11813 orphan_section_init. Remove virtual function place_orphan_here.
11814 (class Output_section_definition): Add is_relro and
11815 orphan_section_init. Remove place_orphan_here.
11816 (class Orphan_output_section): Likewise.
11817 (Script_sections::Script_sections): Update for field changes.
11818 (Script_sections::data_segment_align): Set saw_data_segment_align_
11819 and data_segment_align_start_, not data_segment_align_index.
11820 (Script_sections::data_segment_relro_end): Check
11821 saw_data_segment_align_. Use data_segment_align_start_ rather
11822 than data_segment_align_index_.
11823 (Script_sections::place_orphan): Rewrite to use
11824 Orphan_section_placement.
11825
9201d894
ILT
118262009-03-17 Ian Lance Taylor <iant@google.com>
11827
9c5b8369
ILT
11828 * archive.cc (Archive::add_symbols): Check for a version attached
11829 to the symbol name in the archive map.
11830 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
11831 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
11832 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
11833 (ver_test_11.a): New target.
11834 * testsuite/Makefile.in: Rebuild.
11835
9201d894
ILT
11836 * configure.ac: Check for chsize and posix_fallocate. Replace
11837 ftruncate.
11838 * ftruncate.c: New file, from gnulib.
11839 * output.cc (posix_fallocate): Define dummy version if not
11840 HAVE_POSIX_FALLOCATE.
11841 (Output_file::map): Call posix_fallocate rather than lseek and
11842 write.
11843 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
11844 * configure, Makefile.in, config.in: Rebuild.
11845
ef4ab7a8 118462009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 11847
ef4ab7a8
PP
11848 * layout.h (Layout::create_note): Add section_name parameter.
11849 * layout.cc (Layout::create_note): Likewise.
11850 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 11851
8c500701
ILT
118522009-03-17 Ian Lance Taylor <iant@google.com>
11853
e85b18e1
ILT
11854 * descriptors.cc: Include "options.h".
11855 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
11856 (Descriptors::open): Always use O_CLOEXEC when opening a new
11857 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
11858 then set FD_CLOEXEC.
11859
9efe6174
ILT
11860 * sparc.cc (class Target_sparc): Add has_got_section.
11861 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
11862 make sure we have a GOT section.
11863
11864 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
11865 (Target_sparc::Scan::local): Likewise.
11866 (Target_sparc::Scan::global): Likewise.
11867 (Target_sparc::Relocate::relocate): Likewise.
11868 (Target_sparc::Relocate::relocate_tls): Likewise.
11869
8c500701
ILT
11870 * symtab.cc (Symbol_table::define_default_version): New function,
11871 broken out of add_from_object.
11872 (Symbol_table::add_from_object): Call define_default_version.
11873 (Symbol_table::define_special_symbol): Add resolve_oldsym
11874 parameter. Change all callers. If the version for a symbol comes
11875 from a version script, resolve it with the symbol with the same
11876 name with no version. Also add the symbol without a version if
11877 appropriate.
11878 (do_define_in_output_data): If resolving with oldsym, don't delete
11879 sym.
11880 (do_define_in_output_segment): Likewise.
11881 (do_define_as_constant): Likewise.
11882 * symtab.h (class Symbol_table): Update declarations.
11883
f1ed28fb
ILT
118842009-03-13 Ian Lance Taylor <iant@google.com>
11885
15f8229b
ILT
11886 * readsyms.cc (Read_symbols::incompatible_warning): New function.
11887 (Read_symbols::requeue): New function.
11888 (Read_symbols::do_read_symbols): If make_elf_object fails because
11889 the target type is not configured, and the file was searched for,
11890 issue a warning and retry with the next directory.
11891 (Add_symbols::run): If the file has an incompatible format, and
11892 it was searched for, requeue the Read_symbols task. On error,
11893 release the object.
11894 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
11895 dirindex parameter to constructor. Change all callers. Declare
11896 incompatible_warning and requeue.
11897 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
11898 input_argument_ and input_group_ fields. Add them to
11899 constructor. Change all callers.
11900 (class Read_script): Add dirindex_ field. Add it to constructor.
11901 Change all callers.
11902 * archive.cc (Archive::setup): Remove input_objects parameter.
11903 Change all callers.
11904 (Archive::get_file_and_offset): Likewise.
11905 (Archive::read_all_symbols): Likewise.
11906 (Archive::read_symbols): Likewise.
11907 (Archive::get_elf_object_for_member): Remove input_objects
11908 parameter. Add punconfigured parameter. Change all callers.
11909 (Archive::add_symbols): Change return type to bool. Check return
11910 value of include_member.
11911 (Archive::include_all_members): Likewise.
11912 (Archive::include_member): Change return type to bool. Return
11913 false if first included object has incompatible target. Set
11914 included_member_ field.
11915 (Add_archive_symbols::run): If add_symbols returns false, requeue
11916 Read_symbols task.
11917 * archive.h (class Archive): Add included_member_ field.
11918 Initialize it in constructor. Add input_file and searched_for
11919 methods. Update declarations.
11920 (class Add_archive_symbols): Add dirpath_, dirindex_, and
11921 input_argument_ fields. Add them to constructor. Change all
11922 callers.
11923 * script.cc: Include "target-select.h".
11924 (class Parser_closure): Add skip_on_incompatible_target_ and
11925 found_incompatible_target_ fields. Add
11926 skip_on_incompatible_target parameter to constructor. Change all
11927 callers. Add methods skip_on_incompatible_target,
11928 clear_skip_on_incompatible_target, found_incompatible_target, and
11929 set_found_incompatible_target.
11930 (read_input_script): Add dirindex parameter. Change all callers.
11931 If parser finds an incompatible target, requeue Read_symbols
11932 task.
11933 (script_set_symbol): Clear skip_on_incompatible_target in
11934 closure.
11935 (script_add_assertion, script_parse_option): Likewise.
11936 (script_start_sections, script_add_phdr): Likewise.
11937 (script_check_output_format): New function.
11938 * script.h (read_input_script): Update declaration.
11939 * script-c.h (script_check_output_format): Declare.
11940 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
11941 (ignore_cmd): Remove OUTPUT_FORMAT.
11942 * fileread.cc (Input_file::Input_file): Add explicit this.
11943 (Input_file::will_search_for): New function.
11944 (Input_file::open): Add pindex parameter. Change all callers.
11945 * fileread.h (class Input_file): Add input_file_argument method.
11946 Declare will_search_for. Update declarations.
11947 * object.cc (make_elf_object): Add punconfigured parameter.
11948 Change all callers.
11949 * object.h (class Object): Make input_file public. Add
11950 searched_for method.
11951 (make_elf_object): Update declaration.
11952 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
11953 restart search.
11954 * dirsearch.h (class Dirsearch): Update declaration.
11955 * options.h (class General_options): Add --warn-search-mismatch.
11956 * parameters.cc (Parameters::is_compatible_target): New function.
11957 * parameters.h (class Parameters): Declare is_compatible_target.
11958 * workqueue.cc (Workqueue::add_blocker): New function.
11959 * workqueue.h (class Workqueue): Declare add_blocker.
11960
f1ed28fb
ILT
11961 * fileread.cc (Input_file::open): Remove options parameter.
11962 Change all callers.
11963 (Input_file::open_binary): Likewise.
11964 * script.cc (read_input_script): Likewise.
11965 * readsyms.h (class Read_symbols): Remove options_ field. Remove
11966 options parameter from constructor. Change all callers.
11967 (class Read_script): Likewise.
11968 * fileread.h (class Input_file): Update declarations.
11969 * script.h (read_input_script): Update declaration.
11970
34dd024a
NC
119712009-03-10 Nick Clifton <nickc@redhat.com>
11972
11973 * po/es.po: New Spanish translation.
11974
6d71b17c
CC
119752009-03-06 Cary Coutant <ccoutant@google.com>
11976
11977 * options.cc (parse_short_option): Keep dash_z from registering itself.
11978
031cdbed
ILT
119792009-03-03 Ian Lance Taylor <iant@google.com>
11980
11981 PR 9918
11982 * target-reloc.h (relocate_section): Pass output_section to
11983 relocate.
11984 * i386.cc (Target_i386::should_apply_static_reloc): Add
11985 output_section parameter. Change all callers.
11986 (Target_i386::Relocate::relocate): Add output_section parameter.
11987 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
11988 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
11989 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
11990 * testsuite/two_file_shared.sh: New script.
11991 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
11992 (check_DATA): Add two_file_shared.dbg.
11993 (two_file_shared.dbg): New target.
11994 * testsuite/Makefile.in: Rebuild.
11995
15d5fa16
ILT
119962009-03-01 Ian Lance Taylor <iant@google.com>
11997
11998 * configure.ac: Check for byteswap.h.
11999 * configure: Rebuild.
12000 * config.in: Rebuild.
12001
8a4c0b0d
ILT
120022009-03-01 Mikolaj Zalewski <mikolajz@google.com>
12003
12004 * layout.cc (Layout::find_or_add_kept_section): New function.
12005 (Layout::add_comdat): Removed.
12006 * layout.h (struct Kept_section): Move out of class Layout.
12007 Remove trailing underscores from field names. Add group_sections
12008 field. Rename group_ field to is_group. Change all uses.
12009 (class Layout): Declare find_or_add_kept_section, not add_comdat.
12010 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
12011 comdat_groups_ field.
12012 (Sized_relobj::include_section_group): Use
12013 find_or_add_kept_section and Kept_section::group_sections.
12014 (Sized_relobj::include_linkonce_section): Likewise.
12015 * object.cc (class Sized_relobj): Don't define Comdat_group or
12016 Comdat_group_table. Remove find_comdat_group and
12017 add_comdat_group. Remove comdat_groups_ field.
12018 * plugin.cc (include_comdat_group): Use
12019 Layout::find_or_add_kept_section.
12020
b4ecf66b
ILT
120212009-02-28 Ian Lance Taylor <iant@google.com>
12022
14359ca0
ILT
12023 * README: --gc-sections and map files are now supported. Document
12024 some build requirements.
12025
b4ecf66b
ILT
12026 PR 6992
12027 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
12028 relocatable link set the value of the section symbol to zero.
12029 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
12030 relocatable link don't include the section address in the local
12031 symbol value.
12032
0602e05a
ILT
120332009-02-27 Ian Lance Taylor <iant@google.com>
12034
fd9d194f
ILT
12035 PR 6811
12036 * options.h (class Search_directory): Add is_system_directory.
12037 (class General_options): Declare is_in_system_directory.
12038 * options.cc (get_relative_sysroot): Make static.
12039 (get_default_sysroot): Make static.
12040 (General_optoins::is_in_system_directory): New function.
12041 * fileread.cc (Input_file::is_in_system_directory): New function.
12042 * fileread.h (class Input_file): Declare is_in_system_directory.
12043 * object.h (class Object): Add is_in_system_directory.
12044 (class Input_objects): Remove system_library_directory_ field.
12045 * object.cc (Input_objects::add_object): Don't set
12046 system_library_directory_.
12047 (input_objects::found_in_system_library_directory): Remove.
12048 * symtab.cc (Symbol_table::write_globals): Remove input_objects
12049 parameter. Change all callers.
12050 (Symbol_table::sized_write_globals): Likewise.
12051 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
12052 Call Object::is_in_system_directory.
12053 * symtab.h (class Symbol_table): Update declarations.
12054
61edd21f
ILT
12055 PR 5990
12056 * descriptors.h (Open_descriptor): Add is_on_stack field.
12057 * descriptors.cc (Descriptors::open): If the descriptor is on the
12058 top of the stack, remove it. Initialize is_on_stack field.
12059 (Descriptors::release): Only add pod to stack if it is not on the
12060 stack already.
12061 (Descriptors::close_some_descriptor): Clear stack_next and
12062 is_on_stack fields.
12063
e29e076a
ILT
12064 PR 7091
12065 * output.cc (Output_section::find_starting_output_address): Rename
12066 from starting_output_address; add PADDR parameter; change return
12067 type.
12068 * output.h (class Output_section): Declare
12069 find_starting_output_address instead of starting_output_address.
12070 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
12071 section symbol for which we can't find a merge section.
12072
0602e05a
ILT
12073 PR 9836
12074 * symtab.cc (Symbol_table::add_from_object): If the visibility is
12075 hidden or internal, force the symbol to be local.
12076 * resolve.cc (Symbol::override_visibility): Define.
12077 (Symbol::override_base): Use override_visibility.
12078 (Symbol_table::resolve): Likewise.
12079 (Symbol::override_base_with_special): Likewise.
12080 (Symbol_table::override_with_special): If the visibility is hidden
12081 or internal, force the symbol to be local.
12082 * symtab.h (class Symbol): Add set_visibility and
12083 override_visibility.
12084 * testsuite/ver_test_1.sh: New file.
12085 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
12086 (check_DATA): Add ver_test_1.syms.
12087 (ver_test_1.syms): New target.
12088 * testsuite/Makefile.in: Rebuild.
12089
401a9a73
CC
120902009-02-25 Cary Coutant <ccoutant@google.com>
12091
12092 * layout.cc (Layout::choose_output_section): Don't rename sections
12093 when using a linker script that has a SECTIONS clause.
12094 * Makefile.in: Regenerate.
12095
12096 * testsuite/Makefile.am (script_test_5.sh): New test case.
12097 * testsuite/Makefile.in: Regenerate.
12098 * testsuite/script_test_5.cc: New file.
12099 * testsuite/script_test_5.sh: New file.
12100 * testsuite/script_test_5.t: New file.
12101
f488e4b0
CC
121022009-02-13 Rafael Avila de Espindola <espindola@google.com>
12103
12104 * archive.cc (Archive::include_member): Update calls to add_symbols.
12105 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
12106 the Layout argument.
12107 * dynobj.h (do_add_symbols): Add the Layout argument.
12108 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
12109 Layout argument.
12110 * object.h (Object::add_symbols): Add the Layout argument.
12111 (Object::do_add_symbols): Add the Layout argument.
12112 (Sized_relobj::do_add_symbols): Add the Layout argument.
12113 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
12114 Unify the two versions.
12115 (Add_plugin_symbols): Remove.
12116 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
12117 (Sized_pluginobj::do_add_symbols): Unify the two versions.
12118 (Add_plugin_symbols): Remove.
12119 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
12120 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
12121 (Add_symbols::run): Make it work with Pulginobj.
12122
89dd1680
ILT
121232009-02-06 Ian Lance Taylor <iant@google.com>
12124
12125 * object.cc (Sized_relobj::do_layout): Make info message start
12126 with lower case letter.
12127
266d0a74
ILT
121282009-02-06 Mikolaj Zalewski <mikolajz@google.com>
12129
602b464e
ILT
12130 * binary.cc: Fix file comment.
12131
266d0a74
ILT
12132 * options.h (enum Incremental_disposition): Define.
12133 (class General_options): Add new options: --incremental,
12134 --incremental_changed, --incremental_unchanged,
12135 --incremental_unknown. Add incremental_disposition_ and
12136 implicit_incremental_ fields.
12137 (General_options::incremental_disposition): New function.
12138 (class Position_dependent_options): Add incremental_disposition
12139 option.
12140 (Position_dependent_options::copy_from_options): Set incremental
12141 dispositions.
12142 * options.cc (General_options::parse_incremental_changed): New
12143 function.
2e702c99
RM
12144 (General_options::parse_incremental_unchanged): New function.
12145 (General_options::parse_incremental_unknown): New function.
12146 (General_options::General_options): Initialize new fields
266d0a74 12147 incremental_disposition_ and implicit_incremental_.
2e702c99 12148 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
12149 without --incremental.
12150
f073bbf7
CD
121512009-02-06 Chris Demetriou <cgd@google.com>
12152
12153 * gold.h (gold_undefined_symbol): Change to take only a Symbol
12154 pointer and to report location as the file name associated with
12155 the symbol.
12156 (gold_undefined_symbol_at_location): New function to replace the
12157 old gold_undefined_symbol functionality.
12158 * target-reloc.h (relocate_section): Update to use
12159 gold_undefined_symbol_at_location.
12160 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
12161 Call gold_undefined_symbol function rather than gold_error.
12162 * errors.h (Errors::undefined_symbol): Take location as a
12163 string, rather than calculating it from a relocation.
12164 * errors.cc (Errors::fatal): Print "fatal error:" before the
12165 formatted message.
12166 (Errors::error, Errors::error_at_location): Print "error: "
12167 before the formatted message.
12168 (Errors::undefined_symbol): Take location as a string, rather
12169 than calculating it from a relocation.
12170 (gold_undefined_symbol_at_location): New function akin to
12171 old gold_undefined_symbol, calculates location from relocation.
12172 (gold_undefined_symbol): Change to take only a Symbol pointer
12173 and to report location as the file name associated with the symbol.
12174 * testsuite/debug_msg.sh: Update for changed error messages.
12175 * testsuite/undef_symbol.sh: Likewise.
12176
8e94a90c
ILT
121772009-02-04 Duncan Sands <baldrick@free.fr>
12178
12179 PR 9812
12180 * reduced_debug_output.h
12181 (Output_reduced_debug_abbrev_section::failed): Use format for
12182 gold_warning.
12183 (Output_reduced_debug_info_section::faild): Likewise.
12184
88a0e15b
ILT
121852009-01-31 Mikolaj Zalewski <mikolajz@google.com>
12186
12187 * script.cc (Lazy_demangler): New class.
2e702c99 12188 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
12189 symbol only once.
12190
5efc7cd2
CC
121912009-01-29 Cary Coutant <ccoutant@google.com>
12192
12193 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
12194 to __tls_get_addr.
12195 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
12196
e0ebcf42
ILT
121972009-01-28 Ian Lance Taylor <iant@google.com>
12198
5efc7cd2 12199 * version.cc (version_string): Bump to 1.9.
75fe7426 12200
e0ebcf42
ILT
12201 * gold.h: Include <cstring> and <stdint.h>.
12202 * version.cc: Include <cstdio>.
12203 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
12204 warning.
12205 * reduced_debug_output.cc (insert_into_vector): Rename from
12206 Insert_into_vector; change all callers. Use Swap_unaligned to
12207 avoid aliasing issue; remove union since it is unnecessary.
12208
8e2813be 122092009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
12210
12211 * Makefile.am (CCFILES): Add gc.cc.
12212 (HFILES): Add gc.h.
12213 * Makefile.in: Regenerate.
12214 * gold.cc (Gc_runner): New class.
12215 (queue_initial_tasks): Call garbage collection related tasks
12216 when corresponding options are invoked.
12217 (queue_middle_gc_tasks): New function.
12218 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
12219 processed early before laying out sections during garbage collection.
12220 * gold.h (queue_middle_gc_tasks): New function.
12221 (is_prefix_of): Move from "layout.cc".
12222 * i386.cc (Target_i386::gc_process_relocs): New function.
12223 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
12224 * main.cc (main): Create object of class "Garbage_collection".
12225 * object.cc (Relobj::copy_symbols_data): New function.
12226 (Relobj::is_section_name_included): New function.
e1df38aa
NC
12227 (Sized_relobj::do_layout): Allow this function to be called twice
12228 during garbage collection and defer layout of section during the
6d03d481
ST
12229 first call.
12230 * object.h (Relobj::get_symbols_data): New function.
12231 (Relobj::is_section_name_included): New function.
12232 (Relobj::copy_symbols_data): New function.
12233 (Relobj::set_symbols_data): New function.
12234 (Relobj::get_relocs_data): New function.
12235 (Relobj::set_relocs_data): New function.
12236 (Relobj::is_output_section_offset_invalid): New pure virtual function.
12237 (Relobj::gc_process_relocs): New function.
12238 (Relobj::do_gc_process_relocs): New pure virtual function.
12239 (Relobj::sd_): New data member.
12240 (Sized_relobj::is_output_section_offset_invalid): New function.
12241 (Sized_relobj::do_gc_process_relocs): New function.
12242 * options.h (General_options::gc_sections): Modify to not be a no-op.
12243 (General_options::print_gc_sections): New option.
12244 * plugin.cc (Plugin_finish::run): Remove function call to
12245 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
12246 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
12247 * reloc.cc (Read_relocs::run): Add task to process relocs and
12248 determine unreferenced sections when doing garbage collection.
12249 (Gc_process_relocs): New class.
12250 (Sized_relobj::do_gc_process_relocs): New function.
12251 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
12252 sections that are garbage collected.
12253 * reloc.h (Gc_process_relocs): New class.
12254 * sparc.cc (Target_sparc::gc_process_relocs): New function.
12255 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
12256 symbols whose corresponding sections are garbage collected.
12257 (Symbol_table::Symbol_table): Add new parameter for the garbage
12258 collection object.
12259 (Symbol_table::gc_mark_undef_symbols): New function.
12260 (Symbol_table::gc_mark_symbol_for_shlib): New function.
12261 (Symbol_table::gc_mark_dyn_syms): New function.
12262 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
12263 as garbage.
12264 (Symbol_table::add_from_object): Likewise.
12265 (Symbol_table::add_from_relobj): When building shared objects, do not
12266 treat externally visible symbols as garbage.
12267 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
12268 table information for static and relocatable links.
12269 * symtab.h (Symbol_table::set_gc): New function.
12270 (Symbol_table::gc): New function.
12271 (Symbol_table::gc_mark_undef_symbols): New function.
12272 (Symbol_table::gc_mark_symbol_for_shlib): New function.
12273 (Symbol_table::gc_mark_dyn_syms): New function.
12274 (Symbol_table::gc_): New data member.
e1df38aa 12275 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
12276 function.
12277 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
12278 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
12279
3b293544
CF
122802009-01-20 Chris Faylor <me.sourceware@sourceware.org>
12281
12282 * options.h (General_options::gc_sections): Define as a no-op for now.
12283 (General_options::no_keep_memory): Ditto.
12284 (General_options::Bshareable): Define.
12285 * options.cc (General_options::finalize): Honor -Bshareable.
12286
83d22aa8
AS
122872009-01-20 Andreas Schwab <schwab@suse.de>
12288
12289 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
12290 read the value in the contents, since we don't use it. Use the
12291 template endianness when writing.
12292 (Relocate::relocate): Use it for R_PPC_REL16_HA.
12293
cd536b21
AS
122942009-01-19 Andreas Schwab <schwab@suse.de>
12295
12296 * configure.tgt (powerpc64-*): Fix targ_obj.
12297
99e9a495
ILT
122982009-01-15 Ian Lance Taylor <iant@google.com>
12299
12300 * object.cc (Sized_relobj::write_local_symbols): Don't write out
12301 local symbols when stripping all symbols.
12302
bbbfea06
CC
123032009-01-14 Cary Coutant <ccoutant@google.com>
12304
99e9a495 12305 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 12306
0f7c0701
CC
123072009-01-14 Cary Coutant <ccoutant@google.com>
12308
12309 * archive.cc (Archive::get_elf_object_for_member): Remove call
12310 to File_read::claim_for_plugin.
12311 * descriptors.cc (Descriptors::open): Remove reference to
12312 is_claimed.
12313 (Descriptors::claim_for_plugin): Remove.
12314 * descriptors.h (Descriptors::claim_for_plugin): Remove.
12315 (Descriptors::is_claimed): Remove.
12316 (claim_descriptor_for_plugin): Remove.
12317 * fileread.cc (File_read::claim_for_plugin): Remove.
12318 * fileread.h (File_read::claim_for_plugin): Remove.
12319 (File_read::descriptor): Reopen descriptor if necessary.
12320 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
12321 (Plugin_manager::all_symbols_read): Add task parameter. Change
12322 all callers.
12323 (Plugin_manager::get_input_file): New function.
12324 (Plugin_manager::release_input_file): New function.
12325 (Pluginobj::Pluginobj): Add filesize parameter and initialize
12326 corresponding data member.
12327 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
12328 and pass to base constructor. Change all callers.
12329 (get_input_file, release_input_file): New functions.
12330 (make_sized_plugin_object): Add filesize parameter. Change all callers.
12331 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
12332 (Plugin_manager::all_symbols_read): Add task parameter.
12333 (Plugin_manager::get_input_file): New function.
12334 (Plugin_manager::release_input_file): New function.
12335 (Plugin_manager::task_): New data member.
12336 (Pluginobj::Pluginobj): Add filesize parameter.
12337 (Pluginobj::filename): New function.
12338 (Pluginobj::descriptor): New function.
12339 (Pluginobj::filesize): New function.
12340 (Pluginobj::filesize_): New data member.
12341 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
12342 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
12343 File_read::claim_for_plugin; use Object::unlock to unlock the file.
12344
12345 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
12346 with archive libraries.
12347 * testsuite/Makefile.in: Regenerate.
12348 * testsuite/plugin_test.c (struct sym_info): New type.
12349 (get_input_file, release_input_file): New static variables.
12350 (onload): Capture new transfer vector entries.
12351 (claim_file_hook): Stop reading at end of file according to filesize.
12352 Factor out parsing of readelf output into separate function.
12353 (all_symbols_read_hook): Exercise get_input_file and release_input_file
12354 APIs and get the source file name from the symbol table. Convert
12355 source file name to corresponding object file name. Print info
12356 message when adding new input files.
12357 (parse_readelf_line): New function.
12358 * testsuite/plugin_test_1.sh: Add checks for new info messages.
12359 * testsuite/plugin_test_2.sh: Likewise.
12360 * testsuite/plugin_test_3.sh: Likewise.
12361 * testsuite/plugin_test_4.sh: New test case.
12362
62a6d109
ILT
123632009-01-07 Ian Lance Taylor <iant@google.com>
12364
12365 * version.cc (version_string): Bump to 1.8.
12366
483620e8
CC
123672008-12-23 Cary Coutant <ccoutant@google.com>
12368
12369 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
12370 * plugin.cc (Plugin_manager::finish): Rename as
12371 layout_deferred_objects. Move cleanup to separate function.
12372 (Plugin_manager::cleanup): New function.
12373 (Plugin_finish::run): Call layout_deferred_objects and cleanup
12374 separately.
12375 * plugin.h (Plugin_manager::finish): Rename as
12376 layout_deferred_objects.
12377 (Plugin_manager::cleanup): New function.
12378 (Plugin_manager::cleanup_done): New field.
12379
d66a9eb3
CC
123802008-12-23 Cary Coutant <ccoutant@google.com>
12381
12382 * plugin.cc (is_visible_from_outside): New function.
12383 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
12384 so we don't return "IR only" status for exported symbols or -r links.
12385
12386 * testsuite/Makefile.am (plugin_test_3): New test case.
12387 * testsuite/Makefile.in: Regenerate.
12388 * testsuite/plugin_test_3.sh: New file.
12389
5995b570
CC
123902008-12-22 Cary Coutant <ccoutant@google.com>
12391
12392 * object.cc (Sized_relobj::layout_section): New function.
12393 (Sized_relobj::do_layout): Defer layout of input sections until after
12394 plugin has provided replacement files.
12395 (Sized_relobj::do_layout_deferred_sections): New function.
12396 * object.h (Relobj::set_section_offset): Remove virtual keyword.
12397 (Relobj::layout_deferred_sections): New function.
12398 (Relobj::do_layout_deferred_sections): New function.
12399 (Sized_relobj::do_layout_deferred_sections): New function.
12400 (Sized_relobj::layout_section): New function.
12401 (Sized_relobj::Deferred_layout): New structure.
12402 (Sized_relobj::deferred_layout_): New field.
12403 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
12404 Change all callers. Layout deferred sections.
12405 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
12406 references.
12407 (Plugin_hook::run): Move code from do_plugin_hook inline.
12408 (Plugin_hook::do_plugin_hook): Remove.
12409 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
12410 (Plugin_manager::finish): Renamed, was cleanup.
12411 (Plugin_manager::should_defer_layout): New function.
12412 (Plugin_manager::add_deferred_layout_object): New function.
12413 (Plugin_manager::Deferred_layout_list): New type.
12414 (Plugin_manager::deferred_layout_objects_): New field.
12415 (Plugin_hook::do_plugin_hook): Remove.
12416
ee769c88
ILT
124172008-12-17 Ian Lance Taylor <iant@google.com>
12418
12419 * options.h (class General_options): Add --no case for
12420 --export-dynamic.
12421
abc8dcba
CC
124222008-12-16 Cary Coutant <ccoutant@google.com>
12423
12424 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
12425 vector.
12426 (Plugin_manager::claim_file): Create plugin object even if
12427 plugin did not call the add_symbols callback.
12428 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
12429 asking for more symbols than were added.
12430 * testsuite/Makefile.am (plugin_test_1): Add test case with
12431 no global symbols.
12432 (empty.syms): New target.
12433 * testsuite/Makefile.in: Regenerate.
12434 * testsuite/plugin_test.c (claim_file_hook): Add new debug
12435 message. Don't call add_symbols if no globals.
12436 (all_symbols_read_hook): Don't provide replacement for empty
12437 claimed file.
12438
b0074644
ILT
124392008-12-12 Ian Lance Taylor <iant@google.com>
12440
68943102
ILT
12441 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
12442 r_type == 0 for a local symbol with r_sym == 0.
12443 (scan_relocatable_relocs): Pass r_sym to
12444 local_non_section_strategy.
12445 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
12446 r_sym parameter.
12447
b0074644
ILT
12448 * configure.ac: Update test for TLS descriptors: they are
12449 supported as of glibc 2.9.
12450 * configure: Rebuild.
12451
c2508178
ILT
124522008-12-11 Ian Lance Taylor <iant@google.com>
12453
12454 PR 7091
12455 * target-reloc.h (Default_scan_relocatable_relocs): For each
12456 function, map r_type == 0 to RELOC_DISCARD.
12457
2756a258
CC
124582008-12-10 Cary Coutant <ccoutant@google.com>
12459
12460 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
12461 object to override a kept COMDAT group from a plugin object.
12462
bb6f53d3
ILT
124632008-12-09 Ian Lance Taylor <iant@google.com>
12464
fbc558e1
ILT
12465 PR 7088
12466 * yyscript.y (file_cmd): Handle INPUT.
12467
bb6f53d3
ILT
12468 * testsuite/initpri1.c: Change all declarations to be full
12469 prototypes by adding void, to avoid compiler warnings.
12470
4674ecfc
CC
124712008-12-05 Rafael Avila de Espindola <espindola@google.com>
12472
12473 * options.cc (General_options::parse_plugin_opt): New.
12474 (General_options::add_plugin): The argument now is just the filename.
12475 (General_options::add_plugin_option): New.
12476 * options.h (plugin_opt): New.
12477 (add_plugin): Change argument name.
12478 (add_plugin_option): New.
12479 * plugin.cc (Plugin::load): Don't parse the plugin option.
12480 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
12481 (Plugin::add_option): New.
12482 (Plugin::args_): Change type.
12483 (Plugin::filename_): New.
12484 (Plugin_manager::add_plugin_option): New.
12485 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
12486 * testsuite/Makefile.in: Regenerate.
12487
fd06b4aa
CC
124882008-12-05 Cary Coutant <ccoutant@google.com>
12489
12490 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
12491 Handle --strip-lto-sections option.
12492 * options.h (strip_lto_sections): New option.
12493
6c52134c
CC
124942008-12-01 Cary Coutant <ccoutant@google.com>
12495
12496 * plugin.cc (ld_plugin_message): Change format parameter to const.
12497 Fix mismatch between new[] and delete.
12498
a45248e0
CC
124992008-11-14 Cary Coutant <ccoutant@google.com>
12500
12501 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
12502 instead of -1U.
12503
c82fbeee
CS
125042008-11-05 Craig Silverstein <csilvers@google.com>
12505
12506 * options.cc (General_options::parse_dynamic_list): New function.
12507 * options.h (General_options): New flags dynamic_list,
12508 dynamic_list_data, dynamic_list_cpp_new, and
12509 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
12510 (General_options::in_dynamic_list): New function.
12511 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
12512 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
12513 (Lex::can_continue_name): Likewise.
12514 (yylex): Likewise.
12515 (read_script_file): New parameter script_options.
12516 (read_dynamic_list): New function.
12517 (Script_options::define_dynamic_list): New function.
12518 (dynamic_list_keyword_parsecodes): New variable.
12519 (dynamic_list_keywords): New variable.
12520 * script.h (Script_options::define_dynamic_list): New function
12521 prototype.
12522 (read_dynamic_list): New function prototype.
12523 * symtab.cc (strprefix): New macro.
12524 (Symbol::should_add_dynsym_entry): Support dynamic_list,
12525 dynamic_list_data, dynamic_list_cpp_new, and
12526 dynamic_list_cpp_typeinfo.
12527 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
12528 (dynamic_list_expr): New rule.
12529 (dynamic_list_nodes): Likewise.
12530 (dynamic_list_node): Likewise.
12531 * testsuite/Makefile.am (dynamic_list): New test.
12532 * testsuite/Makefile.in: Regenerated.
12533 * testsuite/dynamic_list.t: New file.
12534 * testsuite/dynamic_list.sh: New file.
12535
e0bb29a5
CS
125362008-11-05 Craig Silverstein <csilvers@google.com>
12537
12538 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
12539 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
12540 (t11_last): Likewise.
12541 * testsuite/ver_test_6.c (main): Likewise.
12542
4e1e25e0
CC
125432008-10-07 Cary Coutant <ccoutant@google.com>
12544
12545 * options.c (General_options::finalize): Add check for -static and
12546 -shared.
12547 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
12548 is not empty.
12549
92f03fcb
CC
125502008-10-02 Cary Coutant <ccoutant@google.com>
12551
12552 * plugin.cc (make_sized_plugin_object): Fix conditional
12553 compilation to work when not all targets are enabled.
12554
fbd8a257
CC
125552008-09-29 Cary Coutant <ccoutant@google.com>
12556
12557 * archive.cc (Archive::get_file_and_offset): Use filename instead
12558 of name to get library path.
12559 (Archive::include_member): Unlock external member of a thin archive.
12560
12561 * testsuite/Makefile.am (TEST_AR): New variable.
12562 (thin_archive_test_1): New test.
12563 (thin_archive_test_2): New test.
81636b3f
CC
12564 * testsuite/Makefile.in: Regenerate.
12565 * testsuite/thin_archive_main.cc: New file.
12566 * testsuite/thin_archive_test_1.cc: New file.
12567 * testsuite/thin_archive_test_2.cc: New file.
12568 * testsuite/thin_archive_test_3.cc: New file.
12569 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 12570
eff45813
CC
125712008-09-29 Cary Coutant <ccoutant@google.com>
12572
12573 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
12574 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
12575 instead of -1U.
12576 (Sized_relobj::do_finalize_local_symbols): Likewise.
12577 (Sized_relobj::map_to_kept_section): Likewise.
12578 * object.h (Sized_relobj::invalid_address): New constant.
12579 (Sized_relobj::do_output_section_offset): Check for invalid_address
12580 and return -1ULL.
12581 * output.cc (Output_reloc::local_section_offset): Use constant
12582 invalid_address instead of -1U.
12583 (Output_reloc::get_address): Likewise.
12584 (Output_section::output_address): Change -1U to -1ULL.
12585 * output.h (Output_reloc::invalid_address): New constant.
12586 * reloc.cc (Sized_relobj::write_sections): Use constant
12587 invalid_address instead of -1U.
12588 (Sized_relobj::relocate_sections): Likewise.
12589 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
12590 values for merge sections.
12591 * target-reloc.h (relocate_for_relocatable): Use constant
12592 invalid_address instead of -1U.
12593
89fc3421
CC
125942008-09-19 Cary Coutant <ccoutant@google.com>
12595
12596 Add plugin functionality for link-time optimization (LTO).
12597 * configure.ac (plugins): Add --enable-plugins option.
12598 * configure: Regenerate.
12599 * config.in: Regenerate.
12600 * Makefile.am (LIBDL): New variable.
12601 (CCFILES): Add plugin.cc.
12602 (HFILES): Add plugin.h.
12603 (ldadd_var): Add LIBDL.
12604 * Makefile.in: Regenerate.
12605
12606 * archive.cc: Include "plugin.h".
12607 (Archive::setup): Don't preread archive symbols when using a plugin.
12608 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
12609 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
12610 files.
12611 (Archive::include_member): Add symbols from plugin objects.
12612 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
12613 * descriptors.cc (Descriptors::open): Check for file descriptors
12614 abandoned by plugins.
12615 (Descriptors::claim_for_plugin): New function.
12616 * descriptors.h (Descriptors::claim_for_plugin): New function.
12617 (Open_descriptor::is_claimed): New field.
12618 (claim_descriptor_for_plugin): New function.
12619 * fileread.cc (File_read::claim_for_plugin): New function.
12620 * fileread.h (File_read::claim_for_plugin): New function.
12621 (File_read::descriptor): New function.
12622 * gold.cc: Include "plugin.h".
12623 (queue_initial_tasks): Add task to call plugin hooks for generating
12624 new object files.
12625 * main.cc: Include "plugin.h".
12626 (main): Load plugin libraries.
12627 * object.h (Pluginobj): Declare.
12628 (Object::pluginobj): New function.
12629 (Object::do_pluginobj): New function.
12630 (Object::set_target): New function.
12631 * options.cc: Include "plugin.h".
12632 (General_options::parse_plugin): New function.
12633 (General_options::General_options): Initialize plugins_ field.
12634 (General_options::add_plugin): New function.
12635 * options.h (Plugin_manager): Declare.
12636 (General_options): Add --plugin option.
12637 (General_options::has_plugins): New function.
12638 (General_options::plugins): New function.
12639 (General_options::add_plugin): New function.
12640 (General_options::plugins_): New field.
12641 * plugin.cc: New file.
12642 * plugin.h: New file.
12643 * readsyms.cc: Include "plugin.h".
12644 (Read_symbols::do_read_symbols): Check for archive before checking
12645 for ELF file. Call plugin hooks to claim files.
12646 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
12647 from a real object file; force override when processing replacement
12648 files.
12649 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
12650 (Symbol::init_base_object): Likewise.
12651 (Symbol::init_base_output_data): Likewise.
12652 (Symbol::init_base_output_segment): Likewise.
12653 (Symbol::init_base_constant): Likewise.
12654 (Symbol::init_base_undefined): Likewise.
12655 (Symbol::output_section): Assert that object is not a plugin.
12656 (Symbol_table::add_from_pluginobj): New function.
12657 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
12658 undefined.
12659 (Symbol_table::sized_write_globals): Likewise.
12660 (Symbol_table::add_from_pluginobj): Instantiate template.
12661 * symtab.h (Sized_pluginobj): Declare.
12662 (Symbol::in_real_elf): New function.
12663 (Symbol::set_in_real_elf): New function.
12664 (Symbol::in_real_elf_): New field.
12665 (Symbol_table::add_from_pluginobj): New function.
12666
12667 * testsuite/Makefile.am (AM_CFLAGS): New variable.
12668 (LIBDL): New variable.
12669 (LDADD): Add LIBDL.
12670 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
12671 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
12672 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
12673 (MOSTLYCLEANFILES): Likewise.
12674 * testsuite/Makefile.in: Regenerate.
12675 * testsuite/plugin_test.c: New file.
12676 * testsuite/plugin_test_1.sh: New file.
12677 * testsuite/plugin_test_2.sh: New file.
12678
de31bda5
ILT
126792008-09-16 Ian Lance Taylor <iant@google.com>
12680
9c2d0ef9
ILT
12681 * target-reloc.h (relocate_section): Check whether a symbol is
12682 defined by the ABI before reporting an undefined symbol error.
12683 * target.h (Target::is_defined_by_abi): Make parameter const.
12684 (Target::do_is_defined_by_abi): Likewise.
12685 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
12686 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
12687 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
12688 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
12689 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
12690 * testsuite/Makefile.in: Rebuild.
12691
de31bda5
ILT
12692 * fileread.cc (make_view): Add casts to avoid warning.
12693
9fa33bee
AO
126942008-09-16 Alexandre Oliva <aoliva@redhat.com>
12695
12696 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
12697 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
12698
183fd0e3
AO
126992008-09-16 Alexandre Oliva <aoliva@redhat.com>
12700
12701 * options.h (General_options::output_is_executable): New.
12702 (General_options::output_is_pie): New.
12703 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
12704 for shared libraries.
12705 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
12706
7be8330a
CD
127072008-09-11 Chris Demetriou <cgd@google.com>
12708
12709 * options.h (origin): New -z option.
12710 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
12711 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
12712 in DT_FLAGS_1.
12713
a9caad02
CC
127142008-09-05 Cary Coutant <ccoutant@google.com>
12715
12716 * fileread.cc (File_read::make_view): Add check for attempt to map
12717 beyond end of file.
12718
ae6dce4d
CC
127192008-09-05 Cary Coutant <ccoutant@google.com>
12720
12721 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
12722 explicit instantiations.
12723
d7ab2a47
KVH
127242008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
12725
12726 PR gold/6858
12727 * options.cc (General_options::finalize): Allow undefined symbols
12728 in shlibs if linking -shared.
12729
12730 PR gold/6859
12731 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
12732 symbols as not needing a dynsym entry.
12733
1e52a9c1
CS
127342008-08-20 Craig Silverstein <csilvers@google.com>
12735
12736 * fileread.cc (File_read::open): Do not lock the file unless it
12737 was successfully opened.
12738
d85c80a3
CC
127392008-08-14 Cary Coutant <ccoutant@google.com>
12740
12741 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
12742 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
12743 * testsuite/tls_test.cc (struct int128): 128-bit struct
12744 for testing TLS relocs with non-zero addend.
12745 (v12): New TLS variable.
12746 (t12): New test.
12747 (t_last): Add check for v12.
12748 * testsuite/tls_test.h (t12): New function.
12749 * testsuite/tls_test_main.cc (thread_routine): Call new test.
12750
2d924fd9
ILT
127512008-08-13 Ian Lance Taylor <iant@google.com>
12752
12753 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
12754 set tls_segment_ or relro_segment_.
12755 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
12756 when appropriate.
12757 * output.h (Output_section::clear_is_relro): New function.
12758 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
12759 sections specially even when output_data_ is empty.
12760 (Output_segment::maximum_alignment): When first section is relro,
12761 only force alignment for PT_LOAD segments.
12762 * script.cc (script_data_segment_align): New function.
12763 (script_data_segment_relro_end): New function.
12764 * script-c.h (script_data_segment_align): Declare.
12765 (script_data_segment_relro_end): Declare.
12766 * script-sections.h (class Script_sections): Declare
12767 data_segment_align and data_segment_relro_end. Add fields
12768 segment_align_index_ and saw_relro_end_.
12769 * script-sections.cc (class Sections_element): Add set_is_relro
12770 virtual function. Add new bool* parameter to place_orphan_here.
12771 Add get_output_section virtual function.
12772 (class Output_section_definition): Add set_is_relro. Add new
12773 bool* parameter to place_orphan_here. Add get_output_section.
12774 Add is_relro_ field.
12775 (Output_section_definition::Output_section_definition): Initialize
12776 evaluated_address_, evaluated_load_address, evaluated_addralign_,
12777 and is_relro_ fields.
12778 (Output_section_definition::place_orphan_here): Add is_relro
12779 parameter.
12780 (Output_section_definition::set_section_addresses): Set relro for
12781 output section.
12782 (Output_section_definition::alternate_constraint): Likewise.
12783 (class Orphan_output_section): Add new bool* parameter to
12784 place_orphan_here. Add get_output_section.
12785 (Orphan_output_section::place_orphan_here): Add is_relro
12786 parameter.
12787 (Script_sections::Script_sections): Initialize
12788 data_segment_align_index_ and saw_relro_end_.
12789 (Script_sections::data_segment_align): New function.
12790 (Script_sections::data_segment_relro_end): New function.
12791 (Script_sections::place_orphan): Set or clear is_relro.
12792 (Script_sections::set_section_addresses): Force alignment of first
12793 TLS section.
12794 * yyscript.y (exp): Call script_data_segment_align and
12795 script_data_segment_relro_end.
12796 * testsuite/relro_script_test.t: New file.
12797 * testsuite/relro_test.cc (using_script): Declare.
12798 (t1, t2): Test using_script.
12799 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
12800 (relro_script_test_SOURCES): Define.
12801 (relro_script_test_DEPENDENCIES): Define.
12802 (relro_script_test_LDFLAGS): Define.
12803 (relro_script_test_LDADD): Define.
12804 (relro_script_test.so): New target.
12805 * testsuite/Makefile.in: Rebuild.
12806
f827c9a9
CC
128072008-08-06 Cary Coutant <ccoutant@google.com>
12808
12809 * archive.cc (Archive::total_archives, Archive::total_members)
12810 (Archive::total_members_loaded): New variables.
12811 (Archive::setup): Add parameter. Add option to preread
12812 archive symbols.
12813 (Archive::read_armap): Add counter.
12814 (Archive::get_file_and_offset): New function.
12815 (Archive::get_elf_object_for_member): New function.
12816 (Archive::read_all_symbols): New function.
12817 (Archive::read_symbols): New function.
12818 (Archive::add_symbols): Add counters.
12819 (Archive::include_all_members): Use armap to find members if it's
12820 already built.
12821 (Archive::include_member): Skip reading symbols if already read.
12822 Factored code into Archive::get_file_and_offset and
12823 Archive::get_elf_object_for_member. Changed call to
12824 Mapfile::report_include_archive_member.
12825 (Archive::print_stats): New function.
12826 * archive.h: Declare Object and Read_symbols_data classes.
12827 (Archive::Archive): Add initializers for new members.
12828 (Archive::setup): Add parameter.
12829 (Archive::print_stats): New function.
12830 (Archive::total_archives, Archive::total_members)
12831 (Archive::total_members_loaded): New variables.
12832 (Archive::get_file_and_offset): New function.
12833 (Archive::get_elf_object_for_member): New function.
12834 (Archive::read_all_symbols): New function.
12835 (Archive::read_symbols): New function.
12836 (Archive::Archive_member): New class.
12837 (Archive::members_): New member.
12838 (Archive::num_members_): New member.
12839 * main.cc: Include archive.h.
12840 (main): Call Archive::print_stats.
12841 * mapfile.cc (Mapfile::report_include_archive_member): Delete
12842 archive parameter; member_name is now the fully-decorated name.
12843 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
12844 * options.h: (General_options): Add --preread-archive-symbols option.
12845 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
12846 Archive::setup.
12847
de4c45bd
ILT
128482008-08-04 Ian Lance Taylor <iant@google.com>
12849
12850 * symtab.h (Symbol::use_plt_offset): New function.
12851 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
12852 * powerpc.cc (Relocate::relocate): Likewise.
12853 * sparc.cc (Relocate::relocate): Likewise.
12854 * x86_64.cc (Relocate::relocate): Likewise.
12855 * testsuite/weak_plt.sh: New test.
12856 * testsuite/weak_plt_main.cc: New test.
12857 * testsuite/weak_plt_shared.cc: New test.
12858 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
12859 (check_PROGRAMS): Add weak_plt.
12860 (check_DATA): Add weak_plt_shared.so.
12861 (weak_plt_main_pic.o, weak_plt): New targets.
12862 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
12863 * testsuite/Makefile.in: Rebuild.
12864
12865 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
12866 gcctestdir/ld.
12867 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
12868 * testsuite/Makefile.in: Rebuild.
12869
323ee3f4
AM
128702008-08-04 Alan Modra <amodra@bigpond.net.au>
12871
12872 * Makefile.am (POTFILES.in): Set LC_ALL=C.
12873 * Makefile.in: Regenerate.
12874 * po/POTFILES.in: Regenerate.
12875
7c07ecec
ILT
128762008-07-29 Ian Lance Taylor <iant@google.com>
12877
12878 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
12879 symbols before other symbols.
12880 * testsuite/script_test_2.cc (test_addr): Declare.
12881 (test_addr_alias): Declare.
12882 (main): Check that test_addr and test_addr_alias have the right
cd536b21 12883 values.
7c07ecec
ILT
12884 * testsuite/script_test_2.t: Define test_addr_alias and
12885 test_addr.
12886
5778530e
ILT
128872008-07-24 Ian Lance Taylor <iant@google.com>
12888
2a00e4fb
ILT
12889 PR 5990
12890 * descriptors.cc: New file.
12891 * descriptors.h: New file.
12892 * gold-threads.h (class Hold_optional_lock): New class.
12893 * fileread.cc: Include "descriptors.h".
12894 (File_read::~File_read): Release descriptor rather than closing
12895 it.
12896 (File_read::open) [file]: Call open_descriptor rather than open.
12897 Set is_descriptor_opened_.
12898 (File_read::open) [memory]: Assert that descriptor is not open.
12899 (File_read::reopen_descriptor): New function.
12900 (File_read::release): Release descriptor.
12901 (File_read::do_read): Make non-const. Reopen descriptor.
12902 (File_read::read): Make non-const.
12903 (File_read::make_view): Reopen descriptor.
12904 (File_read::do_readv): Likewise.
12905 * fileread.h (class File_read): Add is_descriptor_opened_ field.
12906 Update declarations.
12907 * layout.cc: Include "descriptors.h".
12908 (Layout::create_build_id): Use open_descriptor rather than open.
12909 * output.cc: Include "descriptors.h".
12910 (Output_file::open): Use open_descriptor rather than open.
12911 * archive.cc (Archive::const_iterator): Change Archive to be
12912 non-const.
12913 (Archive::begin, Archive::end): Make non-const.
12914 (Archive::count_members): Likewise.
12915 * archive.h (class Archive): Update declarations.
12916 * object.h (Object::read): Make non-const.
12917 * Makefile.am (CCFILES): Add descriptors.cc.
12918 (HFILES): Add descriptors.h.
12919 * Makefile.in: Rebuild.
12920
801647d1
ILT
12921 PR 6716
12922 * gold.h: Always include <clocale>. Add Solaris workarounds
12923 following code in binutils/sysdep.h.
12924
5edd166e
ILT
12925 PR 6048
12926 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
12927 this->eh_frame_hdr_ is NULL before using it.
12928
c89ad728
ILT
12929 * dynobj.cc (Versions::Versions): Update comment.
12930
aa86f06b
ILT
12931 * dynobj.cc (Versions::Versions): If there is an soname, use it as
12932 the base version name.
12933
5778530e
ILT
12934 * stringpool.cc (Stringpool_template::add_with_length): Set key to
12935 array size plus one.
12936 (Stringpool_template::set_string_offsets): Subtract one from key
12937 before using it as an array index.
12938 (Stringpool_template::get_offset_with_length): Likewise.
12939 (Stringpool_template::write_to_buffer): Likewise.
12940 * stringpool.h (Stringpool_template::get_offset_from_key):
12941 Likewise.
12942
057ead22
ILT
129432008-07-23 Ian Lance Taylor <iant@google.com>
12944
7f649c59
ILT
12945 PR 6658
12946 * object.h (Merged_symbol_value::value): Do our best to handle a
12947 negative addend.
12948
057ead22
ILT
12949 PR 6647
12950 * script.cc (Version_script_info::get_versions): Don't add empty
12951 version tag to return value.
12952 (Version_script_info::get_symbol_version_helper): Change return
12953 type to bool. Add pversion parameter. Change all callers.
12954 (script_register_vers_node): Don't require a non-NULL tag.
12955 * script.h (class Version_script_info): Update declarations.
12956 (Version_script_info::get_symbol_version): Change return type to
12957 bool. Add version parameter. Change all callers.
12958 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
12959 handling. Handle an empty version from a version script.
12960 (Symbol_table::define_special_symbol): Likewise.
12961 * testsuite/ver_test_10.script: New file.
12962 * testsuite/ver_test_10.sh: New file.
12963 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
12964 (check_DATA): Add ver_test_10.syms.
12965 (ver_test_10.syms, ver_test_10.so): New target.
12966 * testsuite/Makefile.in: Rebuild.
12967
58e54ac2
CD
129682008-07-23 Simon Baldwin <simonb@google.com>
12969
12970 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
12971 to zero for undefined symbols from dynamic libraries.
12972
95d14cd3
ILT
129732008-07-23 Ian Lance Taylor <iant@google.com>
12974
12975 * symtab.cc (Symbol_table::resolve): Remove version parameter.
12976 Change all callers.
12977 * symtab.h (class Symbol_table): Update declaration.
12978 * testsuite/ver_test_9.cc: New file.
12979 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
12980 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
12981 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
12982 (ver_test_9.so, ver_test_9.o): New targets.
12983 * testsuite/Makefile.in: Rebuild.
12984
92de84a6
ILT
129852008-07-22 Ian Lance Taylor <iant@google.com>
12986
34810851
ILT
12987 * options.h (class General_options): Define --check-sections.
12988 * layout.cc (Layout::set_segment_offsets): Handle
12989 --check-sections.
12990
af6156ef
ILT
12991 * options.h (class General_options): Define -n/--nmagic and
12992 -N/--omagic.
12993 * options.cc (General_options::finalize): For -n/--nmagic or
12994 -N/--omagic, set -static.
12995 * layout.cc (Layout::attach_allocated_section_to_segment): If
12996 -N/--omagic, don't put read-only and read-write sections in
12997 different segments.
12998 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
12999 finding a read-only segment.
13000 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
13001 don't set the minimum segment alignment to the common page size,
13002 and don't set the file offset to the address modulo the page size.
13003 * script-sections.cc (Script_sections::create_segments): If
13004 -n/--omagic, don't put read-only and read-write sections in
13005 different segments.
13006
92de84a6
ILT
13007 * cref.cc: New file.
13008 * cref.h: New file.
13009 * options.h (class General_options): Add --print-symbol-counts.
13010 * main.cc (main): Issue defined symbol report if requested.
13011 * archive.cc (Archive::interpret_header): Make into a const member
13012 function.
13013 (Archive::add_symbols): Call Input_objects::archive_start and
13014 archive_stop.
13015 (Archive::const_iterator): Define new class.
13016 (Archive::begin, Archive::end): New functions.
13017 (Archive::include_all_members): Rewrite to use iterator.
13018 (Archive::count_members): New function.
13019 * archive.h (class Archive): Update declarations.
13020 (Archive::filename): New function.
13021 * object.cc: Include "cref.h".
13022 (Sized_relobj::Sized_relobj): Initialize defined_count_.
13023 (Sized_relobj::do_get_global_symbol_counts): New function.
13024 (Input_objects::add_object): Add object to cross-referencer.
13025 (Input_objects::archive_start): New function.
13026 (Input_objects::archive_stop): New function.
13027 (Input_objects::print_symbol_counts): New function.
13028 * object.h: Declare Cref and Archive.
13029 (Object::get_global_symbol_counts): New function.
13030 (Object::do_get_global_symbol_counts): New pure virtual function.
13031 (class Sized_relobj): Add defined_count_ field. Update
13032 declarations.
13033 (class Input_objects): Add cref_ field. Update constructor.
13034 Update declarations.
13035 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
13036 defined_count_.
13037 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
13038 symbol counts.
13039 (Sized_dynobj::do_get_global_symbol_counts): New function.
13040 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
13041 defined_count_. Update declarations. Define Symbols typedef.
13042 * symtab.cc (Symbol_table::add_from_relobj): Add defined
13043 parameter. Change all callers.
13044 (Symbol_table::add_from_dynobj): Add sympointers and defined
13045 parameters. Change all callers.
13046 * symtab.h (class Symbol_table): Update declarations.
13047 * Makefile.am (CCFILES): Add cref.cc.
13048 (HFILES): Add cref.h.
13049 * Makefile.in: Rebuild.
13050
3f7c5e1d
CD
130512008-07-22 Simon Baldwin <simonb@google.com>
13052
13053 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
13054 to zero when writing undefined symbols.
13055
e0b64032
ILT
130562008-07-22 Ian Lance Taylor <iant@google.com>
13057
13058 * output.cc (Output_section::add_input_section): Don't try to
13059 merge empty merge sections.
13060
096b02cf
CS
130612008-07-21 Craig Silverstein <csilvers@google.com>
13062
13063 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
13064 Include symbol version in error message.
cd536b21 13065
1d1f116d
CD
130662008-07-20 Chris Demetriou <cgd@google.com>
13067
cd536b21 13068 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
13069 (RANDOM_SEED_CFLAGS): New substituted variable.
13070 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
13071 * configure: Rebuild.
13072 * Makefile.in: Likewise.
13073 * testsuite/Makefile.in: Likewise.
13074
a18f591e
ILT
130752008-07-18 Ian Lance Taylor <iant@google.com>
13076
13077 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
13078 where we see NAME/NULL and NAME/VERSION as separate symbols.
13079 * testsuite/ver_test_main.cc (main): Call t4.
13080 (t4, t4_2a): Define.
13081 * testsuite/ver_test_2.cc (t4_2): Define.
13082 * testsuite/ver_test_2.script: Put t4_2a in VER2.
13083 * testsuite/ver_test_4.cc (t4_2a): Define.
13084 * testsuite/ver_test_4.script: Put t4_2a in VER2.
13085 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
13086
c6e3f6ed
ILT
130872008-07-17 Ian Lance Taylor <iant@google.com>
13088
13089 * dynobj.cc (Versions::add_def): If we give an error about a
13090 missing version, go ahead and create the version anyhow.
13091
ef9beddf
ILT
130922008-07-10 Ian Lance Taylor <iant@google.com>
13093
13094 Handle output sections with more than 0x7fffffff bytes.
13095 * object.h (class Relobj): Change map_to_output_ to
13096 output_sections_, and just keep a section pointer. Change all
13097 uses. Move comdat group support to Sized_relobj.
13098 (Relobj::is_section_specially_mapped): Remove.
13099 (Relobj::output_section): Remove poff parameter. Change all
13100 callers.
13101 (Relobj::output_section_offset): New function.
13102 (Relobj::set_section_offset): Rewrite.
13103 (Relobj::map_to_output): Remove.
13104 (Relobj::output_sections): New function.
13105 (Relobj::do_output_section_offset): New pure virtual function.
13106 (Relobj::do_set_section_offset): Likewise.
13107 (class Sized_relobj): Add section_offsets_ field. Add comdat
13108 group support from Relobj. Update declarations.
13109 (Sized_relobj::get_output_section_offset): New function.
13110 (Sized_relobj::do_output_section_offset): New function.
13111 (Sized_relobj::do_set_section_offset): New function.
13112 * object.cc (Relobj::output_section_address): Remove.
13113 (Sized_relobj::Sized_relobj): Initialize new fields.
13114 (Sized_relobj::include_section_group): Cast find_kept_object to
13115 Sized_relobj.
13116 (Sized_relobj::include_linkonce_section): Likewise.
13117 (Sized_relobj::do_layout): Use separate arrays for output section
13118 and output offset.
13119 (Sized_relobj::do_count_local_symbols): Change map_to_output to
13120 output_sections.
13121 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
13122 output_sections and section_offsets.
13123 (Sized_relobj::write_local_symbols): Likewise.
13124 (map_to_kept_section): Compute output address directly.
13125 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
13126 output_sections and section_offsets.
13127 (Sized_relobj::write_sections): Likewise.
13128 (Sized_relobj::relocate_sections): Likewise.
13129 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
13130 * output.h (class Output_reloc): Update declarations. Change
13131 u2_.relobj to Sized_relobj*.
13132 (class Output_data_reloc): Change add functions to use
13133 Sized_relobj*.
13134 * output.cc (Output_reloc::Output_reloc): Change relobj to
13135 Sized_relobj*.
13136 (Output_reloc::local_section_offset): Change return type to
13137 Elf_Addr. Use get_output_section_offset.
13138 (Output_reloc::get_address): Likewise.
13139 (Output_section::is_input_address_mapped): Don't call
13140 is_section_specially_mapped.
13141 (Output_section::output_offset): Likewise.
13142 (Output_section::output_address): Likewise.
13143 (Output_section::starting_output_address): Likewise.
13144 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
13145 parameter to Sized_relobj*.
13146 (Copy_relocs::need_copy_reloc): Likewise.
13147 (Copy_relocs::save): Likewise.
13148 * copy-relocs.h (class Copy_relocs): Update declarations.
13149 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
13150 Sized_relobj*. Change relobj_ field to Sized_relobj*.
13151 * target-reloc.h (relocate_for_relocatable): Change
13152 offset_in_output_section type to Elf_Addr. Change code that uses
13153 it as well.
13154 * layout.cc (Layout::layout): Always set *off.
13155 * mapfile.cc (Mapfile::print_input_section): Use
13156 output_section_offset.
13157 * i386.cc (Target_i386::copy_reloc): Change object parameter to
13158 Sized_relobj*.
13159 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
13160 * sparc.cc (Target_sparc::copy_reloc): Likewise.
13161 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
13162
5cb66f97
ILT
131632008-07-03 Ian Lance Taylor <iant@google.com>
13164
13165 * layout.cc (Layout::include_section): Do not discard unrecognized
13166 SHT_STRTAB sections.
13167
afe47622
CS
131682008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
13169
13170 * script.cc (Lex::can_continue_name): Make '?' allowable in
13171 version-script names.
13172 * testsuite/version_script.map: Change glob pattern to use '?'
13173
5adf9721
ILT
131742008-06-30 Manish Singh <yosh@gimp.org>
13175
13176 PR 6585
13177 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
13178 Correct typo.
13179
e6fde208
ILT
131802008-06-30 Ian Lance Taylor <iant@google.com>
13181
13182 PR 6660
13183 PR 6682
13184 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
13185 versions]: Don't try to read the value in the contents, since we
13186 don't use it. Use the template endianness when writing.
13187
3f2e6a2d
CC
131882008-06-25 Cary Coutant <ccoutant@google.com>
13189
13190 * fileread.cc (File_read::make_view): Assert on zero-length view.
13191 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
13192 symbol table when there are no symbols to read.
13193
c43d3a48
CS
131942008-06-23 Craig Silverstein <csilvers@google.com>
13195
13196 * version.cc (version_string): Bump to 1.7
13197
5f494ea0
CS
131982008-06-18 Craig Silverstein <csilvers@google.com>
13199
13200 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
13201 constant 0xFFFF to type Valtype.
13202 (Powerpc_relocate_functions::rel16_ha): Likewise.
13203
c42e122e
ILT
132042008-06-17 Ian Lance Taylor <iant@google.com>
13205
f34787f8
ILT
13206 * output.h (Output_section::Input_section): Initialize p2align_ to
13207 zero for Output_section_data constructors.
13208 (Output_section::Input_section::addralign): If not an input
13209 section, return the alignment of the Output_section_data.
13210 * testsuite/copy_test.cc: New file.
13211 * testsuite/copy_test_1.cc: New file.
13212 * testsuite/copy_test_2.cc: New file.
13213 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
13214 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
13215 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
13216 (copy_test_1_pic.o, copy_test_1.so): New targets.
13217 (copy_test_2_pic.o, copy_test_2.so): New targets.
13218 * testsuite/Makefile.in: Rebuild.
13219
c42e122e
ILT
13220 * script-sections.cc (Script_sections::place_orphan): Initialize
13221 local variable exact.
13222
ce3ac18a
DE
132232008-06-13 David Edelsohn <edelsohn@gnu.org>
13224
13225 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
13226
42cacb20
DE
132272008-06-12 David Edelsohn <edelsohn@gnu.org>
13228 David S. Miller <davem@davemloft.net>
13229
13230 * powerpc.cc: New file.
13231 * Makefile.am (TARGETSOURCES): Add powerpc.cc
13232 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
13233 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
13234 * Makefile.in: Rebuild.
13235
7b308235
ILT
132362008-06-09 Ian Lance Taylor <iant@google.com>
13237
13238 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
13239 <exception>.
13240 (throwing, orig_terminate): New static variables.
13241 (terminate_handler): New static function.
13242 (t2): Set terminate handler.
13243
f0b886e3
ILT
132442008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
13245
13246 PR 6584
cd536b21 13247 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
13248 alignment.
13249
3e90f135
CC
132502008-05-30 Cary Coutant <ccoutant@google.com>
13251
13252 * archive.cc (Archive::include_all_members) Correct to step
13253 over symbol table and extended name table in thin archives.
13254
e09ad04a
ILT
132552008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
13256
13257 PR 6407
13258 * target-reloc.h (relocate_for_relocatable): Fix new_offset
13259 calculation.
13260
62b01cb5
ILT
132612008-05-28 Caleb Howe <cshowe@google.com>
13262
13263 * reduced_debug_output.cc: New file.
13264 * reduced_debug_output.h: New file.
92de84a6 13265 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
13266 * options.cc (General_options::finalize): Add strip_debug_non_line
13267 to the strip heirarchy.
13268 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
13269 fields.
13270 * layout.cc: Include "reduced_debug_output.h".
13271 (Layout::Layout): Initialize new fields.
13272 (line_only_debug_sections): New static array.
13273 (is_lines_only_debug_sections): New static inline function.
13274 (Layout::include_section): Handle --strip-debug-non-line.
13275 (Layout::make_output_section): If --strip-debug-non-line, build
13276 new output sections for .debug_abbrev and .debug_info.
13277 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
13278 gold. Warn about possible overflow.
13279 (read_signed_LEB_128): Likewise.
13280 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
13281 (read_signed_LEB_128): Declare.
13282 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
13283 (HFILES): Add reduced_debug_output.h.
13284 * Makefile.in: Rebuild.
13285
7d9e3d98
ILT
132862008-05-21 Ian Lance Taylor <iant@google.com>
13287
13288 * mapfile.cc: New file.
13289 * mapfile.h: New file.
13290 * options.h (class General_options): Add -M/--print-map and -Map.
13291 * options.cc (General_options::finalize): Make -M equivalent to
13292 -Map -.
13293 * main.cc: Include <cstdio> and "mapfile.h".
13294 (main): Open mapfile if requested.
13295 * gold.cc (class Middle_runner): Add mapfile_ field. Update
13296 constructor. Change caller.
13297 (queue_initial_tasks): Add mapfile parameter. Change caller.
13298 (queue_middle_tasks): Likewise.
13299 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
13300 declarations.
13301 * archive.cc: Include "mapfile.h".
13302 (Archive::add_symbols): Add mapfile parameter. Change all
13303 callers. Pass mapfile, symbol, and reason to include_member.
13304 (Archive::include_all_members): Add mapfile parameter. Change all
13305 callers.
13306 (Archive::include_member): Add mapfile, sym, and why parameters.
13307 Change all callers. Report inclusion to map file.
13308 * archive.h: Include "fileread.h".
13309 (class Archive): Update declarations.
13310 (Archive::file): New const method.
13311 (class Add_archive_symbols): Add mapfile_ field. Update
13312 constructor. Change all callers.
13313 * readsyms.h (class Read_symbols): Likewise.
13314 (class Finish_group): Likewise.
13315 (class Read_script): Likewise.
13316 * common.cc: Include "mapfile.h".
13317 (Symbol_table::allocate_commons): Add mapfile parameter. Change
13318 all callers.
13319 (Symbol_table::do_allocate_commons): Likewise.
13320 (Symbol_table::do_allocate_commons_list): Likewise. Report common
13321 symbol allocation to mapfile.
13322 * common.h (class Allocate_commons_task): Add mapfile_ field.
13323 Update constructor. Change all callers.
13324 * symtab.h (class Symbol_table): Update declarations.
13325 * layout.cc: Include "mapfile.h".
13326 (Layout_task_runner::run): Print information to mapfile.
13327 (Layout::create_gold_note): Change Output_data_fixed_space to
13328 Output_data_zero_fill.
13329 (Layout::create_build_id): Likewise.
13330 (Layout::print_to_mapfile): New function.
13331 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
13332 constructor. Change caller.
13333 (class Layout): Declare print_to_mapfile.
13334 * output.cc (Output_section::Input_section::print_to_mapfile): New
13335 function.
13336 (Output_section::add_input_section): If producing a map, always
13337 add to input_sections_ list.
13338 (Output_section::do_print_to_mapfile): New function.
13339 (Output_segment::print_sections_to_mapfile): New function.
13340 (Output_segment::print_section_list_to_mapfile): New function.
13341 * output.h: Include "mapfile.h".
13342 (Output_data::print_to_mapfile): New function.
13343 (Output_data::do_print_to_mapfile): New virtual function.
13344 (Output_segment_headers::do_print_to_mapfile): New function.
13345 (Output_file_header::do_print_to_mapfile): New function.
13346 (Output_data_const::do_print_to_mapfile): New function.
13347 (class Output_data_const_buffer): Add map_name_ field. Update
13348 constructor. Change all callers. Add do_print_to_mapfile
13349 function.
13350 (class Output_data_fixed_space): Likewise.
13351 (class Output_data_space): Likewise.
13352 (class Output_data_zero_fill): New class.
13353 (Output_data_strtab::do_print_to_mapfile): New function.
13354 (Output_data_reloc_base::do_print_to_mapfile): New function.
13355 (Output_relocatable_relocs::do_print_to_mapfile): New function.
13356 (Output_data_group::do_print_to_mapfile): New function.
13357 (Output_data_got::do_print_to_mapfile): New function.
13358 (Output_data_dynamic::do_print_to_mapfile): New function.
13359 (Output_symtab_xindex::do_print_to_mapfile): New function.
13360 (class Output_section): Declare do_print_to_mapflie. Declare
13361 print_to_mapfile in Input_section.
13362 (class Output_segment): Declare new functions.
13363 * object.h (Sized_relobj::symbol_count): New function.
13364 * script-sections.cc
13365 (Output_section_element_dot_assignment::set_section_addresses):
13366 Change Output_data_fixed_space to Output_data_zero_fill.
13367 (Output_data_expression::do_print_to_mapfile): New function.
13368 * script.cc (read_input_script): Add mapfile parameter. Change
13369 all callers.
13370 * script.h (read_input_script): Update declaration.
13371 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
13372 (Eh_frame::do_print_to_mapfile): New function.
13373 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
13374 (Output_merge_string::do_print_to_mapfile): New function.
13375 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
13376 function.
13377 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
13378 function.
13379 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
13380 function.
13381 * Makefile.am (CCFILES): Add mapfile.cc.
13382 (HFILES): Add mapfile.h.
13383 * Makefile.in: Rebuild.
13384
9f1d377b
ILT
133852008-05-19 Ian Lance Taylor <iant@google.com>
13386
13387 * options.h (class General_options): Add -z relro.
13388 * layout.cc (Layout::Layout): Initialize relro_segment_.
13389 (Layout::add_output_section_data): Return the output section.
13390 (Layout::make_output_section): Rcognize relro sections and mark
13391 them appropriately.
13392 (Layout::attach_allocated_section_to_segment): Put relro sections
13393 in a PT_GNU_RELRO segment.
13394 (Layout::create_initial_dynamic_sections): Mark the .dynamic
13395 section as relro.
13396 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
13397 PT_TLS segments.
13398 (Layout::linkonce_mapping): Map d.rel.ro.local to
13399 .data.rel.ro.local.
13400 (Layout::output_section_name): Us .data.rel.ro.local for any
13401 section which begins with that.
13402 * layout.h (class Layout): Update add_output_section_data
13403 declaration. Add relro_segment_ field.
13404 * output.cc (Output_section::Output_section): Initialize is_relro_
13405 and is_relro_local_ fields.
13406 (Output_segment::add_output_section): Group relro sections.
13407 (Output_segment::is_first_section_relro): New function.
13408 (Output_segment::maximum_alignment): If there is a relro section,
13409 align the segment to the common page size.
13410 (Output_segment::set_section_addresses): Track whether we are
13411 looking at relro sections. If the last section is a relro
13412 section, align to the common page size.
13413 (Output_segment::set_section_list_addresses): Add in_relro
13414 parameter. Change all callers. Align to the page size when
13415 moving from relro to non-relro section.
13416 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
13417 segment.
13418 * output.h (class Output_section): Add is_relro_ and
13419 is_relro_local_ fields.
13420 (Output_section::is_relro): New function.
13421 (Output_section::set_is_relro): New function.
13422 (Output_section::is_relro_local): New function.
13423 (Output_section::set_is_relro_local): New function.
13424 (class Output_segment): Update declarations.
13425 * i386.cc (Target_i386::got_section): Mark .got section as relro.
13426 * sparc.cc (Target_sparc::got_section): Likewise.
13427 * x86_64.cc (Target_x86_64::got_section): Likewise.
13428 * testsuite/relro_test_main.cc: New file.
13429 * testsuite/relro_test.cc: New file.
13430 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
13431 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
13432 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
13433 (relro_test.so, relro_test_pic.o): New targets.
13434 * testsuite/Makefile.in: Rebuild.
13435
a984ee1d
ILT
134362008-05-16 Ian Lance Taylor <iant@google.com>
13437
01676dcd
ILT
13438 * output.cc (Output_segment::add_output_section): Remove front
13439 parameter.
13440 * output.h (class Output_segment): Remove
13441 add_initial_output_section and overloaded add_output_section.
13442 Update declaration of remaining add_output_section.
13443 * layout.cc (Layout::create_interp): Call add_output_section
13444 rather than add_initial_output_section.
13445 (Layout::finish_dynamic_section): Likewise.
13446
497897f9
ILT
13447 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
13448 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
13449 know the dynamic type.
13450 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
13451 field. Initialize it in constructor.
13452 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
13453 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
13454 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
13455 reloc.
13456
a984ee1d
ILT
13457 * output.cc (Output_reloc::get_address): Change return type to
13458 Elf_Addr.
13459 * output.h (class Output_reloc): Update get_address declaration.
13460 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
13461 for section addresses.
13462
55ba0940
ILT
134632008-05-09 Ian Lance Taylor <iant@google.com>
13464
13465 PR 6493
13466 * gold.cc (gold_nomem): Use return value of write.
13467
75517b77
ILT
134682008-05-08 Ian Lance Taylor <iant@google.com>
13469
13470 * symtab.c (Symbol::init_base_output_data): Add version
13471 parameter. Change all callers.
13472 (Symbol::init_base_output_segment): Likewise.
13473 (Symbol::init_base_constant): Likewise.
13474 (Symbol::init_base_undefined): Likewise.
13475 (Sized_symbol::init_output_data): Likewise.
13476 (Sized_symbol::init_output_segment): Likewise.
13477 (Sized_symbol::init_constant): Likewise.
13478 (Sized_symbol::init_undefined): Likewise.
13479 (Symbol_table::do_define_in_output_data): If the new symbol has a
13480 version, mark it as the default.
13481 (Symbol_table::do_define_in_output_segment): Likewise.
13482 (Symbol_table::do_define_as_constant): Likewise.
13483 * symtab.h (class Symbol): Update declarations.
13484 (class Sized_symbol): Likewise.
13485 * resolve.cc (Symbol::override_version): New function.
c42e122e 13486 (Symbol::override_base): Call override_version.
75517b77
ILT
13487 (Symbol::override_base_with_special): Likewise.
13488 * testsuite/ver_script_8.script: New file.
13489 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
13490 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
13491 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
13492 (ver_test_8_1.so, ver_test_8_2.so): New targets.
13493
f1f70eae
ILT
134942008-05-06 Ian Lance Taylor <iant@google.com>
13495
f3e9c5c5
ILT
13496 PR 6049
13497 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
13498 functions.
13499 (class General_options): Remove existing --undefined, and add
13500 --no-undefined instead. Add new --undefined as synonym for -u.
13501 * archive.cc (Archive::add_symbols): Check whether symbol was
13502 named with -u.
13503 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
13504 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
13505 all uses. Add IS_UNDEFINED. Update declarations to split
13506 different versions of init_base. Declare init_base_undefined.
13507 (Symbol::is_defined): Handle IS_UNDEFINED.
13508 (Symbol::is_undefined): Likewise.
13509 (Symbol::is_weak_undefined): Call is_undefined.
13510 (Symbol::is_absolute): Handle IS_CONSTANT.
13511 (class Sized_symbol): Update declarations to split different
13512 versions of init. Declare init_undefined.
13513 (class Symbol_table): Declare new functions.
13514 * symtab.cc (Symbol::init_base_object): Rename from init_base.
13515 Change all callers.
13516 (Symbol::init_base_output_data): Likewise.
13517 (Symbol::init_base_output_segment): Likewise.
13518 (Symbol::init_base_constant): Likewise.
13519 (Symbol::init_base_undefined): New function.
13520 (Sized_symbol::init_object): Rename from init. Change all
13521 callers.
13522 (Sized_symbol::init_output_data): Likewise.
13523 (Sized_symbol::init_output_segment): Likewise.
13524 (Sized_symbol::init_constant): Likewise.
13525 (Sized_symbol::init_undefined): New function.
13526 (Symbol_table::add_undefined_symbols_from_command_line): New
13527 function.
13528 (Symbol_table::do_add_undefined_symbols_from_command_line): New
13529 function.
13530 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
13531 (Symbol::output_section): Likewise.
13532 (Symbol::set_output_section): Likewise.
13533 (Symbol_table::sized_finalize_symbol): Likewise.
13534 (Symbol_table::sized_write_globals): Likewise.
13535 * resolve.cc (Symbol_table::should_override): Likewise.
13536 (Symbol::override_base_with_special): Likewise.
13537
8bdcdf2c
ILT
13538 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
13539 symbol, change it to have default visibility.
13540 * testsuite/protected_1.cc: New file.
13541 * testsuite/protected_2.cc: New file.
13542 * testsuite/protected_3.cc: New file.
13543 * testsuite/protected_main_1.cc: New file.
13544 * testsuite/protected_main_2.cc: New file.
13545 * testsuite/protected_main_3.cc: New file.
13546 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
13547 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
13548 (protected_1_LDFLAGS, protected_1_LDADD): Define.
13549 (protected_1.so): New target.
13550 (protected_1_pic.o, protected_2_pic.o): New targets.
13551 (protected_3_pic.o): New target.
13552 (check_PROGRAMS): Add protected_2.
13553 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
13554 (protected_2_LDFLAGS, protected_2_LDADD): Define.
13555 * testsuite/Makefile.in: Rebuild.
13556
2b706932
ILT
13557 * options.h (DEFINE_var): Add set_user_set_##varname__.
13558 (DEFINE_bool_alias): New macro.
13559 (class General_options): Define -Bstatic using DEFINE_bool_alias
13560 rather than DEFINE_special. Add --undefined as an alias for -z
13561 defs.
13562 * options.cc (General_options::parse_Bstatic): Remove.
13563
d82a5bcc
ILT
13564 * options.h (class General_options): Add --fatal-warnings.
13565 * main.cc (main): Implement --fatal-warnings.
13566 * errors.h (Errors::warning_count): New function.
13567
f1f70eae
ILT
13568 * options.h (class General_options): Add -Bsymbolic-functions.
13569 * symtab.h (Symbol::is_preemptible): Check for
13570 -Bsymbolic-functions.
13571
8825ac63
ILT
135722008-05-05 Ian Lance Taylor <iant@google.com>
13573
d98bc257
ILT
13574 * options.h (DEFINE_bool): For DASH_Z, create the negative option
13575 as noVARNAME rather than no-VARNAME.
13576 (class General_options): Add option -z combreloc.
13577 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
13578 get_address.
13579 (Output_reloc::sort_before) [SHT_REL]: New function.
13580 (Output_reloc::sort_before) [SHT_RELA]: New function.
13581 (class Output_data_reloc_base): Add sort_relocs_ field. Define
13582 Sort_relocs_comparison.
13583 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
13584 parameter. Change all callers.
13585 (Output_data_reloc::Output_data_reloc) [both versions]: Add
13586 sort_relocs parameter. Change all callers.
13587 * output.cc (Output_reloc::get_address): New function, broken out
13588 of write_rel.
13589 (Output_reloc::write_rel): Call it.
13590 (Output_reloc::compare): New function.
13591 (Output_data_reloc_base::do_write): Optionally sort relocs.
13592
60b2b4e7
ILT
13593 * configure.ac: If targ_extra_obj is set, link it in.
13594 * configure.tgt: Initialize all variables.
13595 (x86_64*): Set targ_extra_obj and targ_extra_size.
13596 * configure: Rebuild.
13597
8825ac63
ILT
13598 * object.cc (Sized_relobj::include_section_group): Adjust section
13599 indexes read from group data. Build vector to pass to
13600 layout_group.
13601 * layout.cc (Layout::layout_group): Add flags and shndxes
13602 parameters. Remove contents parameter. Change caller. Update
13603 explicit instantiations.
13604 * layout.h (class Layout): Update layout_group declaration.
13605 * output.cc (Output_data_group::Output_data_group): Add flags and
13606 input_shndxes parameters. Remove contents parameter. Change
13607 caller.
13608 (Output_data_group::do_write): Change input_sections_ to
13609 input_shndxes_.
13610 * output.h (class Output_data_group): Update constructor
13611 declaration. Rename input_sections_ to input_shndxes_.
13612 * testsuite/many_sections_test.cc: Add template.
13613
e94cf127
CC
136142008-04-30 Cary Coutant <ccoutant@google.com>
13615
4418b2d5
CC
13616 * target-reloc.h (relocate_section): Fix dead-pointer bug.
13617
e94cf127
CC
13618 * layout.cc (Layout::include_section): Refactored check for debug
13619 info section.
13620 (Layout::add_comdat): Add new parameters. Change type
13621 of signature parameter. Add object and shndx to signatures table.
13622 (Layout::find_kept_object): New function.
13623 * layout.h: Include <cstring>.
13624 (Layout::is_debug_info_section): New function.
13625 (Layout::add_comdat): Add new parameters.
13626 (Layout::find_kept_object): New function.
13627 (Layout::Kept_section): New struct.
13628 (Layout::Signatures): Change type of map range.
13629 * object.cc (Relobj::output_section_address): New function.
13630 (Sized_relobj::include_section_group): Add new parameters. Change
13631 calls to Layout::add_comdat. Change to build table of kept comdat
13632 groups and table mapping discarded sections to kept sections.
13633 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
13634 (Sized_relobj::do_layout): Change calls to include_section_group and
13635 include_linkonce_section.
13636 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
13637 value to zero when section is discarded.
13638 (Sized_relobj::map_to_kept_section): New function.
13639 * object.h (Relobj::output_section_address): New function.
13640 (Relobj::Comdat_group): New type.
13641 (Relobj::find_comdat_group): New function.
13642 (Relobj::Comdat_group_table): New type.
13643 (Relobj::Kept_comdat_section): New type.
13644 (Relobj::Kept_comdat_section_table): New type.
13645 (Relobj::add_comdat_group): New function.
13646 (Relobj::set_kept_comdat_section): New function.
13647 (Relobj::get_kept_comdat_section): New function.
13648 (Relobj::comdat_groups_): New field.
13649 (Relobj::kept_comdat_sections_): New field.
13650 (Symbol_value::input_value): Update comment.
13651 (Sized_relobj::map_to_kept_section) New function.
13652 (Sized_relobj::include_linkonce_section): Add new parameter.
13653 * target-reloc.h (Comdat_behavior): New type.
13654 (get_comdat_behavior): New function.
13655 (relocate_section): Add code to map a discarded section to the
13656 corresponding kept section when applying a relocation.
13657
e4e5049b
CS
136582008-04-30 Craig Silverstein <csilvers@google.com>
13659
13660 * dwarf_reader.cc (next_generation_count): New static var.
13661 (Addr2line_cache_entry): New struct.
13662 (addr2line_cache): New static var.
13663 (Dwarf_line_info::one_addr2line): Added caching.
13664 (Dwarf_line_info::clear_addr2line_cache): New function.
13665 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
13666 cache-size parameter.
13667 (Dwarf_line_info::one_addr2line_cache): New function.
13668 * symtab.cc (Symbol_table::detect_odr_violations): Pass
13669 new cache-size argument to one_addr2line(), and clear cache.
13670
d09e9154
CC
136712008-04-28 Cary Coutant <ccoutant@google.com>
13672
13673 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
13674 R_386_PC8 relocations.
13675
7ef73768
ILT
136762008-04-23 Ian Lance Taylor <iant@google.com>
13677
55438702
ILT
13678 * object.cc (Sized_relobj::include_section_group): Check for
13679 invalid section group.
13680
c165fb93
ILT
13681 * object.cc (make_elf_object): Correct test for 64-bit ELF file
13682 header size.
13683
7ef73768
ILT
13684 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
13685 than read for file header.
13686 * archive.cc (Archive::include_member): Likewise.
13687
6194aaab
L
136882008-04-23 Paolo Bonzini <bonzini@gnu.org>
13689
13690 * aclocal.m4: Regenerate.
13691 * configure: Regenerate.
13692
d491d34e
ILT
136932008-04-19 Ian Lance Taylor <iant@google.com>
13694
5ea2bac6
ILT
13695 * version.cc (version_string): Bump to 1.6.
13696
7bc3e21a
ILT
13697 * testsuite/Makefile.am (many_sections_r_test): New target.
13698 (many_sections_r_test_SOURCES): Remove.
13699 (many_sections_r_test_DEPENDENCIES): Remove.
13700 (many_sections_r_test_LDFLAGS): Remove.
13701 (many_sections_r_test_LDADD): Remove.
13702
7fcd3aa9
ILT
13703 * object.cc (Sized_relobj::do_add_symbols): Always pass
13704 local_symbol_count_ to add_from_relobj.
13705
4c94d6ae
ILT
13706 * testsuite/Makefile.am (many_sections_check.h): Only check one in
13707 every thousand variables.
13708 * testsuite/Makefile.in: Rebuild.
13709
d491d34e
ILT
13710 * object.cc (Xindex::initialize_symtab_xindex): New function.
13711 (Xindex::read_symtab_xindex): New function.
13712 (Xindex::sym_xindex_to_shndx): New function.
13713 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
13714 available.
13715 (Sized_relobj::do_initialize_xindex): New function.
13716 (Sized_relobj::do_read_symbols): Adjust section links.
13717 (Sized_relobj::symbol_section_and_value): Add is_ordinary
13718 parameter. Change all callers.
13719 (Sized_relobj::include_section_group): Adjust section links and
13720 symbol section indexes.
13721 (Sized_relobj::do_layout): Adjust section links.
13722 (Sized_relobj::do_count_local_symbols): Adjust section links and
13723 symbol section indexes.
13724 (Sized_relobj::do_finalize_local_symbols): Distinguish between
13725 ordinary and special symbols.
13726 (Sized_relobj::write_local_symbols): Add symtab_xindex and
13727 dynsym_xindex parameters. Change all callers. Adjust section
13728 links. Use SHN_XINDEX when needed.
13729 (Sized_relobj::get_symbol_location_info): Adjust section links.
13730 Don't get fooled by special symbols.
13731 * object.h (class Xindex): Define.
13732 (class Object): Add xindex_ parameter. Declare virtual functoin
13733 do_initialize_xindex.
13734 (Object::adjust_sym_shndx): New function.
13735 (Object::set_xindex): New protected function.
13736 (class Symbol_value): Add is_ordinary_shndx_ field.
13737 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
13738 (Symbol_value::value): Assert ordinary section.
13739 (Symbol_value::initialize_input_to_output_map): Likewise.
13740 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
13741 Change all callers.
13742 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
13743 all callers.
13744 (class Sized_relobj): Update declarations.
13745 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
13746 parameter. Change all callers.
13747 (Sized_relobj::adjust_shndx): New function.
13748 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
13749 field.
13750 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
13751 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
13752 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
13753 (Sized_dynobj::read_dynsym_section): Adjust section links.
13754 (Sized_dynobj::read_dynamic): Likewise.
13755 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
13756 section links.
13757 (Sized_dynobj::do_initialize_xindex): New function.
13758 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
13759 do_initialize_xindex.
13760 (Sized_dynobj::adjust_shndx): New function.
13761 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
13762 dynsym_xindex_ fields.
13763 (Layout::finalize): Add a call to set_section_indexes before
13764 creating the symtab sections.
13765 (Layout::set_section_indexes): Don't do anything if the section
13766 already has a section index.
13767 (Layout::create_symtab_sections): Add shnum parameter. Change
13768 caller. Create .symtab_shndx section if needed.
13769 (Layout::create_shdrs): Add shstrtab_section parameter. Change
13770 caller.
13771 (Layout::allocated_output_section_count): New function.
13772 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
13773 needed.
13774 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
13775 fields. Update declarations.
13776 (Layout::symtab_xindex): New function.
13777 (Layout::dynsym_xindex): New function.
13778 (class Write_symbols_task): Add layout_ field.
13779 (Write_symbols_task::Write_symbols_task): Add layout parameter.
13780 Change caller.
13781 * output.cc (Output_section_headers::Output_section_headers): Add
13782 shstrtab_section parameter. Change all callers.
13783 (Output_section_headers::do_sized_write): Store overflow values
13784 for section count and section string table section index in
13785 section header zero.
13786 (Output_file_header::do_sized_write): Check for overflow of
13787 section count and section string table section index.
13788 (Output_symtab_xindex::do_write): New function.
13789 (Output_symtab_xindex::endian_do_write): New function.
13790 * output.h (class Output_section_headers): Add shstrtab_section_.
13791 Update declarations.
13792 (class Output_symtab_xindex): Define.
13793 (Output_section::has_out_shndx): New function.
13794 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
13795 field.
13796 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
13797 Change all callers.
13798 (Sized_symbol::init): Likewise.
13799 (Symbol::output_section): Check for ordinary symbol.
13800 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
13801 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
13802 callers.
13803 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
13804 Change all callers. Simplify handling of symbols from sections
13805 not included in the link.
13806 (Symbol_table::add_from_dynobj): Handle ordinary symbol
13807 distinction.
13808 (Weak_alias_sorter::operator()): Assert that symbols are
13809 ordinary.
13810 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
13811 distinction.
13812 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
13813 parameters. Change all callers.
13814 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
13815 symbol distinction. Use SHN_XINDEX when needed.
13816 (Symbol_table::write_section_symbol): Add symtab_xindex
13817 parameter. Change all callers.
13818 (Symbol_table::sized_write_section_symbol): Likewise. Use
13819 SHN_XINDEX when needed.
13820 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
13821 declarations.
13822 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
13823 (Symbol::is_defined): Check is_ordinary.
13824 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
13825 (Symbol::is_absolute, Symbol::is_common): Likewise.
13826 (class Sized_symbol): Update declarations.
13827 (class Symbol_table): Update declarations.
13828 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
13829 parameters. Change all callers.
13830 (Sized_symbol::override): Likewise.
13831 (Symbol_table::override): Likewise.
13832 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
13833 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
13834 is_ordinary, and orig_st_shndx parameters. Change all callers.
13835 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
13836 to be in an ordinary section.
13837 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
13838 object and is_ordinary parameters. Change all callers.
13839 (Sized_dwarf_line_info::read_relocs): Add object parameter.
13840 Change all callers. Don't add undefined or non-ordinary symbols
13841 to reloc_map_.
13842 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
13843 Change all callers.
13844 * dwarf_reader.h (class Sized_dwarf_line_info): Update
13845 declarations.
13846 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
13847 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
13848 (Sized_relobj::relocate_sections): Likewise.
13849 * target-reloc.h (scan_relocs): Adjust section symbol index.
13850 (scan_relocatable_relocs): Likewise.
13851 * i386.cc (Scan::local): Check for ordinary symbols.
13852 * sparc.cc (Scan::local): Likewise.
13853 * x86_64.cc (Scan::local): Likewise.
13854 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
13855 to symbol_section_and_value.
13856 * testsuite/many_sections_test.cc: New file.
13857 * testsuite/Makefile.am (BUILT_SOURCES): Define.
13858 (check_PROGRAMS): Add many_sections_test.
13859 (many_sections_test_SOURCES): Define.
13860 (many_sections_test_DEPENDENCIES): Define.
13861 (many_sections_test_LDFLAGS): Define.
13862 (BUILT_SOURCES): Add many_sections_define.h.
13863 (many_sections_define.h): New target.
13864 (BUILT_SOURCES): Add many_sections_check.h.
13865 (many_sections_check.h): New target.
13866 (check_PROGRAMS): Add many_sections_r_test.
13867 (many_sections_r_test_SOURCES): Define.
13868 (many_sections_r_test_DEPENDENCIES): Define.
13869 (many_sections_r_test_LDFLAGS): Define.
13870 (many_sections_r_test_LDADD): Define.
13871 (many_sections_r_test.o): New target.
13872 * testsuite/Makefile.in: Rebuild.
13873
c5818ff1
CC
138742008-04-17 Cary Coutant <ccoutant@google.com>
13875
13876 * errors.cc (Errors::info): New function.
13877 (gold_info): New function.
13878 * errors.h (Errors::info): New function.
13879 * gold.h (gold_info): New function.
13880 * object.cc (Input_objects::add_object): Print trace output.
13881 * options.cc (options::parse_set): New function.
13882 (General_options::parse_wrap): Deleted.
13883 (General_options::General_options): Deleted initializer.
13884 * options.h (options::String_set): New typedef.
13885 (options::parse_set): New function.
13886 (DEFINE_set): New macro.
13887 (General_options::wrap): Changed to use DEFINE_set. Changed
13888 callers of any_wrap_symbols and is_wrap_symbol.
13889 (General_options::trace, General_options::trace_symbol):
13890 New options.
13891 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
13892 (General_options::wrap_symbols_): Deleted.
13893 * symtab.cc (Symbol_table::add_from_object): Print trace output.
13894
b5be4a7c
DM
138952008-04-17 David S. Miller <davem@davemloft.net>
13896
13897 * options.cc (General_options::parse_V): New function.
13898 * options.h: Add entries for -V and -Qy.
13899
155a0dd7
ILT
139002008-04-17 Ian Lance Taylor <iant@google.com>
13901
13902 * common.cc (Symbol_table::allocate_commons): Remove options
13903 parameter. Change caller.
13904 (Symbol_table::do_allocate_commons): Remove options parameter.
13905 Change caller. Just call do_allocate_commons_list twice.
13906 (Symbol_table::do_allocate_commons_list): New function, broken out
13907 of do_allocate_commons.
13908 * common.h (class Allocate_commons_task): Remove options_ field.
13909 Update constructor.
13910 * symtab.cc (Symbol_table::Symbol_table): Initialize
13911 tls_commons_.
13912 (Symbol_table::add_from_object): Put TLS common symbols on
13913 tls_commons_ list.
13914 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
13915 which are IN_OUTPUT_DATA.
13916 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
13917 allocate_commons and do_allocate_commons declarations. Declare
13918 do_allocate_commons_list.
13919 * gold.cc (queue_middle_tasks): Update creation of
13920 Allocate_commons_task to not pass options.
13921 * testsuite/Makefile.am (INCLUDES): Add -I.. .
13922 (TLS_TEST_C_FLAGS): New variable.
13923 (tls_test_c_pic.o): New target.
13924 (tls_test_shared.so): Link in tls_test_c_pic.o.
13925 (tls_test_c_pic_ie.o): New target.
13926 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
13927 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
13928 (tls_test_c.o): New target.
13929 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
13930 (tls_pic_test_LDADD): Likewise.
13931 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
13932 (tls_shared_gd_to_ie_test_LDADD): Likewise.
13933 (tls_test_c_gnu2.o): New target.
13934 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
13935 tls_test_c_gnu2.o.
13936 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
13937 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
13938 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
13939 * testsuite/tls_test.cc: Include "config.h".
13940 (t_last): Call t11_last.
13941 * testsuite/tls_test.h (t11, t11_last): Declare.
13942 * testsuite/tls_test_c.c: New file.
13943 * testsuite/tls_test_main.cc (thread_routine): Call t11.
13944 * configure.ac: Check for OpenMP support.
13945 * configure, config.in, Makefile.in: Rebuild.
13946 * testsuite/Makefile.in: Rebuild.
13947
edfbb029
CC
139482008-04-16 Cary Coutant <ccoutant@google.com>
13949
13950 * i386.cc (Target_i386::define_tls_base_symbol): New function.
13951 (Target_i386::tls_base_symbol_defined_): New field.
13952 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
13953 (Target_i386::Scan::global): Likewise.
13954 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
13955 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
13956 (Target_x86_64::tls_base_symbol_defined_): New field.
13957 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
13958 (Target_x86_64::Scan::global): Likewise.
13959
f3c69fca
CC
139602008-04-16 Cary Coutant <ccoutant@google.com>
13961
13962 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
13963 (Symbol::needs_plt_entry): Allow weak undefined symbols.
13964 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
13965 building shared libraries.
13966 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
13967 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
13968 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
13969 * testsuite/Makefile.in: Rebuild.
13970 * testsuite/weak_undef.h: New file.
13971 * testsuite/weak_undef_file1.cc: Add extra test cases.
13972 * testsuite/weak_undef_file2.cc: Likewise.
13973 * testsuite/weak_undef_test.cc: Likewise.
13974
7c414435
DM
139752008-04-16 David S. Miller <davem@davemloft.net>
13976
32b769e1
DM
13977 * sparc.cc (Target_sparc::Scan): Change from struct to class.
13978 Add issued_non_pic_error_ field. Declare check_non_pic.
13979 (Target_sparc::Scan::check_non_pic): New function.
13980 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
13981 (Target_sparc::Scan::global): Likewise.
13982
11936fb1
DM
13983 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
13984 * configure: Rebuild.
13985
7c414435
DM
13986 * options.h (DEFINE_enable): New macro.
13987 (new_dtags): New enable option.
13988 (initfirst, interpose, loadfltr, nodefaultlib,
13989 nodelete, nodlopen, nodump): New -z options.
13990 * layout.cc (Layout:finish_dynamic_section): If new
13991 dtags enabled, emit DT_RUNPATH. Also, emit a
13992 DT_FLAGS_1 containing any specified -z flags.
13993
85c7bf8b
ILT
139942008-04-16 Ian Lance Taylor <iant@google.com>
13995
12c0daef
ILT
13996 * copy-relocs.cc: New file.
13997 * copy-relocs.h: New file.
13998 * reloc.cc: Remove Copy_relocs code.
13999 * reloc.h: Likewise.
14000 * reloc-types.h (struct Reloc_types) [both versions]: Add
14001 get_reloc_addend_noerror.
14002 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
14003 variants of add_global which take an addend which must be zero.
14004 * i386.cc: Include "copy-relocs.h".
14005 (class Target_i386): Change type of copy_relocs_ to variable,
14006 update initializer.
14007 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
14008 Change all callers.
14009 (Target_i386::do_finalize_sections): Change handling of
14010 copy_relocs_.
14011 * sparc.cc: Include "copy-relocs.h".
14012 (class Target_sparc): Change type of copy_relocs_ to variable,
14013 update initializer.
14014 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
14015 Change all callers.
14016 (Target_sparc::do_finalize_sections): Change handling of
14017 copy_relocs_.
14018 * x86_64.cc: Include "copy-relocs.h".
14019 (class Target_x86_64): Change type of copy_relocs_ to variable,
14020 update initializer.
14021 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
14022 class. Change all callers.
14023 (Target_x86_64::do_finalize_sections): Change handling of
14024 copy_relocs_.
14025 * Makefile.am (CCFILES): Add copy-relocs.cc.
14026 (HFILES): Add copy-relocs.h.
14027
4f4995b6
ILT
14028 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
14029
85c7bf8b
ILT
14030 * testsuite/script_test_4.sh: Permit leading zeroes.
14031
4f2a9edd
ILT
140322008-04-15 Ian Lance Taylor <iant@google.com>
14033
e6188289
ILT
14034 * script-sections.cc (Script_sections::create_segments): Use
14035 header_size_adjustment even when there is enough room for the
14036 headers.
14037 * testsuite/script_test_4.sh: New file.
14038 * testsuite/script_test_4.t: New file.
14039 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
14040 (check_DATA): Add script_test_4.stdout.
14041 (MOSTLYCLEANFILES): Likewise.
14042 (script_test_4): New target.
14043 (script_test_4.stdout): New target.
14044 * testsuite/Makefile.in: Rebuild.
14045
4f2a9edd
ILT
14046 * sparc.cc: Add definitions for Output_data_plt_sparc class
14047 constants.
14048
f5314dd5
DM
140492008-04-14 David S. Miller <davem@davemloft.net>
14050
14051 * sparc.cc: New file.
14052 * Makefile.am (TARGETSOURCES): Add sparc.cc
14053 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
14054 * configure.tgt: Document targ_extra_size and
14055 targ_extra_big_endian. Add entries for sparc-* and
14056 sparc64-*.
14057 * configure.ac: Handle targ_extra_size and
14058 targ_extra_big_endian.
14059 * Makefile.in: Rebuild.
14060 * configure: Likewise.
14061 * po/POTFILES.in: Likewise.
14062 * po/gold.pot: Likewise.
14063
154e0e9a
ILT
140642008-04-14 Ian Lance Taylor <iant@google.com>
14065
14066 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
14067 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
14068 in the name/type/flags to section mapping. Don't call
14069 allocate_output_section.
14070 (Layout::choose_output_section): Change parameter from adjust_name
14071 to is_input_section. Don't permit input sections after sections
14072 are attached to segments. Don't call allocate_output_section.
14073 (Layout::layout_eh_frame): Call update_flags_for_input_section,
14074 not write_enable_output_section.
14075 (Layout::make_output_section): Don't push to
14076 unattached_section_list_ nor call attach_to_segment. Call
14077 attach_section_to_segment if sections are attached.
14078 (Layout::attach_sections_to_segments): New function.
14079 (Layout::attach_section_to_segment): New function.
14080 (Layout::attach_allocated_section_to_segment): Rename from
14081 attach_to_segment. Remove flags parameter.
14082 (Layout::allocate_output_section): Remove function.
14083 (Layout::write_enable_output_section): Remove function.
14084 * layout.h (class Layout): Update for above changes. Add new
14085 field sections_are_attached_.
14086 * output.h (Output_section::update_flags_for_input_section): New
14087 function.
14088 * output.cc (Output_section::add_input_section): Call
14089 update_flags_for_input_section.
14090 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
14091
009a67a2
CC
140922008-04-11 Cary Coutant <ccoutant@google.com>
14093
14094 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
14095 thought unnecessary.
14096 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
14097
759b1a24
ILT
140982008-04-11 Ian Lance Taylor <iant@google.com>
14099
14100 * output.h (class Output_section_data): Remove inline definition
14101 of set_addralign.
14102 * output.cc (Output_section_data::set_addralign): New function.
14103
c2b45e22
CC
141042008-04-11 Cary Coutant <ccoutant@google.com>
14105
14106 Add support for TLS descriptors for i386 and x86_64.
14107 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
14108 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
14109 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
14110 GOT_TYPE_TLS_DESC.
14111 (Target_i386::got_mod_index_entry): Remove unnecessary code.
14112 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
14113 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
14114 relocations.
14115 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
14116 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
14117 Fix problem with initial-exec relocations.
14118 (Target_i386::Relocate::relocate_tls): Likewise.
14119 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
14120 relaxation.
14121 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
14122 support for section-plus-offset dynamic table entries.
14123 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
14124 (Output_data_dynamic::Dynamic_entry): Add support for
14125 section-plus-offset dynamic table entries.
14126 (Output_data_dynamic::Classification): Likewise.
14127 (Output_data_dynamic::classification_): Renamed offset_.
14128 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
14129 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
14130 (Target_x86_64::make_plt_section): New function.
14131 (Target_x86_64::reserve_tlsdesc_entries): New function.
14132 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
14133 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
14134 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
14135 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
14136 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
14137 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
14138 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
14139 add extra PLT entry for TLS descriptors.
14140 (Output_data_plt_x86_64::got_): New field.
14141 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
14142 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
14143 fields.
14144 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
14145 descriptors.
14146 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
14147 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
14148 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
14149 R_386_TLS_DESC_CALL relocations.
14150 (Target_x86_64::Scan::global): Likewise.
14151 (Target_x86_64::do_finalize_sections): Add dynamic table entries
14152 for TLS descriptors.
14153 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
14154 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
14155 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
14156 GD-to-IE relaxation.
14157 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
14158 and TLS_DESCRIPTORS.
14159 * Makefile.in: Rebuild.
14160 * configure: Rebuild.
14161 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
14162 (tls_test_shared2.so): New target.
14163 (tls_shared_gd_to_ie_test_SOURCES): New variable.
14164 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
14165 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
14166 (tls_shared_gd_to_ie_test_LDADD): New variable.
14167 (tls_shared_gnu2_gd_to_ie_test): New target.
14168 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
14169 New targets.
14170 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
14171 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
14172 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
14173 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
14174 (tls_shared_gnu2_test): New target.
14175 (tls_test_gnu2_shared.so): New target.
14176 (tls_shared_gnu2_test_SOURCES): New variable.
14177 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
14178 (tls_shared_gnu2_test_LDFLAGS): New variable.
14179 (tls_shared_gnu2_test_LDADD): New variable.
14180 * testsuite/Makefile.in: Rebuild.
14181 * testsuite/Makefile.
14182
83bfb6b7
ILT
141832008-04-11 Ian Lance Taylor <iant@google.com>
14184
14185 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
14186 justsyms.t.
14187 * testsuite/Makefile.in: Rebuild.
14188
14189 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
14190 long.
14191 * testsuite/script_test_2.cc (main): Adjust test.
14192
706e1f5e
ILT
141932008-04-11 David S. Miller <davem@davemloft.net>
14194 Ian Lance Taylor <iant@google.com>
14195
14196 * options.h (General_options): Add entries for '-Y' and
14197 '-relax'.
14198 * options.cc (General_options:finalize): If -Y was used, add those
14199 entries to the library path instead of the default "/lib" and
14200 "/usr/lib".
14201
7c98e6bb
DM
142022008-04-11 David S. Miller <davem@davemloft.net>
14203
14204 * testsuite/justsyms.t: Start at 0x100.
14205 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
14206 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
14207 long.
14208 * testsuite/script_test_2.cc: Adjust string and section length
14209 checks.
7c98e6bb 14210
99a37bfd
ILT
142112008-04-09 Ian Lance Taylor <iant@google.com>
14212
2cefc357
ILT
14213 PR gold/5996
14214 * script-sections.cc (Sections_element::allocate_to_segment): Add
14215 orphan parameter.
14216 (Output_section_definition::allocate_to_segment): Likewise.
14217 (Orphan_output_section::allocate_to_segment): Likewise.
14218 (Script_sections::attach_sections_using_phdrs_clause): Don't
14219 propagate non-PT_LOAD segments to orphan sections.
14220 * testsuite/Makefile.am (script_test_3.stdout): Generate using
14221 readelf rather than objdump.
14222 * testsuite/script_test_3.sh: Adjust accordingly. Test that
14223 .interp section and PT_INTERP segment are the same size.
14224 * testsuite/Makefile.in: Rebuild.
14225
99a37bfd
ILT
14226 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
14227 aliases for symbols defined in the same object.
14228 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
14229 (weak_alias_test_SOURCES): New variable.
14230 (weak_alias_test_DEPENDENCIES): New variable.
14231 (weak_alias_test_LDFLAGS): New variable.
14232 (weak_alias_test_LDADD): New variable.
14233 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
14234 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
14235 (weak_alias_test_3.o): New target.
14236 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
14237 * testsuite/weak_alias_test_main.cc: New file.
14238 * testsuite/weak_alias_test_1.cc: New file.
14239 * testsuite/weak_alias_test_2.cc: New file.
14240 * testsuite/weak_alias_test_3.cc: New file.
14241
780e49c5
ILT
142422008-04-08 Ian Lance Taylor <iant@google.com>
14243
cdb0b8f5
ILT
14244 * options.h (class General_options): Add --noinhibit-exec option.
14245 * main.cc (main): Check --noinhibit-exec.
14246
0864d551
ILT
14247 * options.h (class General_options): Define --wrap as a special
14248 option. Add wrap_symbols_ field.
14249 (General_options::any_wrap_symbols): New function.
14250 (General_options::is_wrap_symbol): New function.
14251 * options.cc (General_options::parse_wrap): New function.
14252 (General_options::General_options): Initialize wrap_symbols_.
14253 * symtab.cc (Symbol_table::wrap_symbol): New function.
14254 (Symbol_table::add_from_object): Handle --wrap.
14255 * symtab.h (class Symbol_table): Declare wrap_symbol.
14256 * target.h (Target::wrap_char): New function.
14257 (Target::Target_info): Add wrap_char field.
14258 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
14259 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14260 * testsuite/testfile.cc (Target_test::test_target_info):
14261 Likewise.
14262
789aa6de
ILT
14263 * errors.cc (Errors::undefined_symbol): Mention symbol version if
14264 there is one.
14265
2c38906f
ILT
14266 * layout.h (class Layout): Add added_eh_frame_data_ field.
14267 * layout.cc (Layout::Layout): Initialize new field.
14268 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
14269 output section until we find a section we merged successfully.
14270 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
14271 that the size be non-zero.
14272
780e49c5
ILT
14273 * merge.cc (Object_merge_map::get_output_offset): Remove inline
14274 qualifier.
14275
7fcd0256
ILT
142762008-04-08 Craig Silverstein <csilvers@google.com>
14277
14278 * configure.ac: Export new conditional variable HAVE_ZLIB.
14279 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
14280 on HAVE_ZLIB.
14281 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
14282 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
14283
6835af53
ILT
142842008-04-07 Ian Lance Taylor <iant@google.com>
14285
e24f324c
ILT
14286 * version.cc (version_string): Set to "1.5".
14287
a036edd8
ILT
14288 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
14289 Add issued_non_pic_error_ field. Declare check_non_pic.
14290 (Target_x86_64::Scan::check_non_pic): New function.
14291 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
14292 (Target_x86_64::Scan::global): Likewise.
14293
624f8810
ILT
14294 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
14295 addend parameter. Change caller. Handle merge sections.
14296 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
14297 Address to Addend. Don't add in the result of
14298 local_section_offset, pass down the addend and use the returned
14299 value.
14300 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
14301 Update declarations of local_section_offset and symbol_value.
14302 * testsuite/two_file_test_1.cc (t18): New function.
14303 * testsuite/two_file_test_2.cc (f18): New function.
14304 * testsuite/two_file_test_main.cc (main): Call t18.
14305 * testsuite/two_file_test.h (t18, f18): Declare.
14306
6835af53
ILT
14307 * configure.ac: Don't test for objdump, c++filt, or readelf.
14308 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
14309 conditionals.
14310 (TEST_READELF): New variable.
14311 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
14312 (check_PROGRAMS): Add two_file_strip_test.
14313 (two_file_strip_test): New target.
14314 (check_PROGRAMS): Add two_file_same_shared_strip_test.
14315 (two_file_same_shared_strip_test_SOURCES): New variable.
14316 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
14317 (two_file_same_shared_strip_test_LDFLAGS): New variable.
14318 (two_file_same_shared_strip_test_LDADD): New variable.
14319 (two_file_shared_strip.so): New target.
14320 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
14321 (ver_test_5.syms, ver_test_7.syms): Likewise.
14322 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
14323 (strip_test_3.stdout): Use TEST_OBJDUMP.
14324 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
14325
86925eef
CC
143262008-04-04 Cary Coutant <ccoutant@google.com>
14327
14328 * symtab.h (Symbol::is_weak_undefined): New function.
14329 (Symbol::is_strong_undefined): New function.
14330 (Symbol::is_absolute): New function.
14331 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
14332 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
14333 absolute symbols.
14334 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
14335 (weak_undef_test): New target.
14336 * testsuite/Makefile.in: Rebuild.
14337 * testsuite/weak_undef_file1.cc: New file.
14338 * testsuite/weak_undef_file2.cc: New file.
14339 * testsuite/weak_undef_test.cc: New file.
14340
126f3ece
ILT
143412008-04-03 Craig Silverstein <csilvers@google.com>
14342
14343 * compressed_output.h (class Output_compressed_section): Use
14344 unsigned buffer.
14345 * compressed_output.cc (zlib_compress): Use unsigned buffers,
14346 add zlib header.
14347 (zlib_compressed_suffix): Removed.
14348 (Output_compressed_section::set_final_data_size): Use unsigned
14349 buffers.
14350 * testsuite/Makefile.am (flagstest_compress_debug_sections):
14351 Fix linker invocation.
14352 (flagstest_o_specialfile_and_compress_debug_sections):
14353 Likewise.
14354 * testsuite/Makefile.in: Regenerated.
14355
deae2a14
DM
143562008-04-02 David S. Miller <davem@davemloft.net>
14357
14358 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
14359 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
14360
70752818
ILT
143612008-04-02 Craig Silverstein <csilvers@google.com>
14362
14363 * TODO: New file.
14364
39d0cb0e
ILT
143652008-04-02 Ian Lance Taylor <iant@google.com>
14366
14367 * fileread.cc (File_read::find_view): Add byteshift and vshifted
14368 parameters. Update for new key type to views_. Change all
14369 callers.
14370 (File_read::read): Adjust for byteshift in returned view.
14371 (File_read::add_view): New function, broken out of
14372 find_and_make_view.
14373 (File_read::make_view): New function, broken out of
14374 find_and_make_view.
14375 (File_read::find_or_make_view): Add offset and aligned
14376 parameters. Rewrite accordingly. Change all callers.
14377 (File_read::get_view): Add offset and aligned parameters. Adjust
14378 for byteshift in return value.
14379 (File_read::get_lasting_view): Likewise.
14380 * fileread.h (class File_read): Update declarations.
14381 (class File_read::View): Add byteshift_ field. Add byteshift to
14382 constructor. Add byteshift method.
14383 * archive.h (Archive::clear_uncached_views): New function.
14384 (Archive::get_view): Add aligned parameter. Change all callers.
14385 * object.h (Object::get_view): Add aligned parameter. Change all
14386 callers.
14387 (Object::get_lasting_view): Likewise.
14388
14389 * fileread.cc (File_read::release): Don't call clear_views if
14390 there are multiple objects.
14391 * fileread.h (File_read::clear_uncached_views): New function.
14392 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
14393 on the archive.
14394
a1207466
CC
143952008-03-31 Cary Coutant <ccoutant@google.com>
14396
14397 Add thin archive support.
14398 * archive.cc (Archive::armagt): New const.
14399 (Archive::setup): Remove task parameter and calls to unlock.
14400 (Archive::unlock_nested_archives): New function.
14401 (Archive::read_header): Add nested_off parameter. Change
14402 all callers.
14403 (Archive::interpret_header): Likewise.
14404 (Archive::include_all_members): Change to handle thin
14405 archives.
14406 (Archive::include_member): Likewise.
14407 * archive.h (Archive::Archive): Add new parameters and
14408 initializers.
14409 (Archive::armagt): New const.
14410 (Archive::setup): Remove task parameter.
14411 (Archive::unlock_nested_archives): New function.
14412 (Archive::read_header): Add nested_off parameter.
14413 (Archive::interpret_header): Likewise.
14414 (Archive::Nested_archive_table): New typedef.
14415 (Archive::is_thin_archive_): New field.
14416 (Archive::nested_archives_): New field.
14417 (Archive::options_): New field.
14418 (Archive::dirpath_): New field.
14419 (Archive::task_): New field.
14420 * readsyms.cc (Read_symbols::do_read_symbols): Add check
14421 for thin archives. Pass additional parameters to
14422 Archive::Archive. Unlock the archive file after calling
14423 Archive::setup.
cd536b21 14424
479f6503
ILT
144252008-03-29 Ian Lance Taylor <iant@google.com>
14426
686c8caf
ILT
14427 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
14428 version symbol to be local.
14429 * testsuite/ver_test_4.sh: New file.
14430 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
14431 (check_DATA): Add ver_test_4.syms.
14432 (ver_test_4.syms): New target.
14433 * testsuite/Makefile.in: Rebuild.
14434
ab794b6b
ILT
14435 * output.cc
14436 (Output_section::Input_section_sort_entry::has_priority): New
14437 function.
14438 (Output_section::Input_section_sort_entry::match_file_name): New
14439 function.
14440 (Output_section::Input_section_sort_entry::match_section_name):
14441 Remove.
14442 (Output_section::Input_section_sort_entry::match_section_name_prefix):
14443 Remove.
14444 (Output_section::Input_section_sort_entry::match_section_file):
14445 Remove.
14446 (Output_section::Input_section_sort_compare::operator()): Rewrite
14447 using new Input_section_sort_entry functions. Sort crtbegin and
14448 crtend first. Sort sections with no priority before sections with
14449 a priority.
14450 * testsuite/initpri1.c (d3): Check j != 4.
14451 (cd5): New constructor/destructor function.
14452 (main): Check j != 2.
14453
479f6503
ILT
14454 * symtab.cc (Symbol_table::add_from_object): If we don't use the
14455 new symbol when resolving, don't call set_is_default.
14456 * testsuite/ver_test_7.cc: New file.
14457 * testsuite/ver_test_7.sh: New file.
14458 * testsuite/Makefile.am (ver_test_7.so): New target.
14459 (ver_test_7.o): New target.
14460 (check_SCRIPTS): Add ver_test_7.sh.
14461 (check_DATA): Add ver_test_7.syms.
14462 (ver_test_7.syms): New target.
14463
2fd32231
ILT
144642008-03-28 Ian Lance Taylor <iant@google.com>
14465
14466 * layout.cc (Layout::layout): If we see an input section with a
14467 name that needs sorting, set the must_sort flag for the output
14468 section.
14469 (Layout::make_output_section): If the name of the output section
14470 indicates that it might require sorting, set the may_sort flag.
14471 * output.h (Output_section::may_sort_attached_input_sections): New
14472 function.
14473 (Output_section::set_may_sort_attached_input_sections): New
14474 function.
14475 (Output_section::must_sort_attached_input_sections): New
14476 function.
14477 (Output_section::set_must_sort_attached_input_sections): New
14478 function.
14479 (class Output_section): Declare Input_section_sort_entry. Define
14480 Input_section_sort_compare. Declare
14481 sort_attached_input_sections. Add new fields:
14482 may_sort_attached_input_sections_,
14483 must_sort_attached_input_sections_,
14484 attached_input_sections_are_sorted_.
14485 * output.cc (Output_section::Output_section): Initialize new
14486 fields.
14487 (Output_section::add_input_section): Add an entry to
14488 input_sections_ if may_sort or must_sort are true.
14489 (Output_section::set_final_data_size): Call
14490 sort_attached_input_sections if necessary.
14491 (Output_section::Input_section_sort_entry): Define new class.
14492 (Output_section::Input_section_sort_compare::operator()): New
14493 function.
14494 (Output_section::sort_attached_input_sections): New function.
14495 * configure.ac: Check whether the compiler supports constructor
14496 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
14497 * testsuite/initpri1.c: New file.
14498 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
14499 CONSTRUCTOR_PRIORITY.
14500 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
14501 (initpri1_LDFLAGS): New variable.
14502 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
14503
18e6b24e
ILT
145042008-03-27 Ian Lance Taylor <iant@google.com>
14505
49bdd526
ILT
14506 * common.cc (Sort_commons::operator): Correct sorting algorithm.
14507 * testsuite/common_test_1.c: New file.
14508 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
14509 (common_test_1_SOURCES): New variable.
14510 (common_test_1_DEPENDENCIES): New variable.
14511 (common_test_1_LDFLAGS): New variable.
14512
18e6b24e
ILT
14513 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
14514 and commons_ correctly when NAME/VERSION does not override
14515 NAME/NULL.
14516 * testsuite/ver_test_6.c: New file.
14517 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
14518 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
14519 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
14520
04bf7072
ILT
145212008-03-26 Ian Lance Taylor <iant@google.com>
14522
5871526f
ILT
14523 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
14524 of an undefined symbol from a version script.
14525 * testsuite/Makefile.am (ver_test_5.so): New target.
14526 (ver_test_5.o): New target.
14527 (check_SCRIPTS): Add ver_test_5.sh.
14528 (check_DATA): Add ver_test_5.syms.
14529 (ver_test_5.syms): New target.
14530 * testsuite/ver_test_5.cc: New file.
14531 * testsuite/ver_test_5.script: New file.
14532 * testsuite/ver_test_5.sh: New file.
14533 * Makefile.in, testsuite/Makefile.in: Rebuild.
14534
04bf7072
ILT
14535 PR gold/5986
14536 Fix problems building gold with gcc 4.3.0.
14537 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
14538 (gold_error_at_location, gold_warning_at_location): Use it.
14539 * configure.ac: Check whether we can compile and use a template
14540 function with a printf attribute.
14541 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
14542 when jumping over bytes.
14543 * object.cc: Instantiate Object::read_section_data.
14544 * debug.h: Include <cstring>
14545 * dwarf_reader.cc: Include <algorithm>
14546 * main.cc: Include <cstring>.
14547 * options.cc: Include <cstring>.
14548 * output.cc: Include <cstring>.
14549 * script.cc: Include <cstring>.
14550 * script.h: Include <string>.
14551 * symtab.cc: Include <cstring> and <algorithm>.
14552 * target-select.cc: Include <cstring>.
14553 * version.cc: Include <string>.
14554 * testsuite/testmain.cc: Include <cstdlib>.
14555 * configure, config.in: Rebuild.
14556
874c5b28
ILT
145572008-03-25 Ian Lance Taylor <iant@google.com>
14558
819d6c3a
ILT
14559 * options.cc: Include "../bfd/bfdver.h".
14560 (options::help): Print bug reporting address.
14561
f4b2c6f5
ILT
14562 * version.cc (print_version): Adjust output for current value of
14563 BFD_VERSION_STRING.
14564
14565 * NEWS: New file.
14566
e96caa79
ILT
14567 * options.cc (options::help): Print list of supported targets.
14568 * target-select.h: Include <vector>.
14569 (class Target_selector): Make machine_, size_, and is_big_endian_
14570 fields const. Add bfd_name_ and instantiated_target_ fields.
14571 (Target_selector::Target_selector): Add bfd_name parameter.
14572 (Target_selector::recognize): Make non-virtual, call
14573 do_recognize.
14574 (Target_selector::recognize_by_name): Make non-virtual, call
14575 do_recognize_by_name.
14576 (Target_selector::supported_names): New function.
14577 (Target_selector::bfd_name): New function.
14578 (Target_selector::do_instantiate_target): New pure virtual
14579 function.
14580 (Target_selector::do_recognize): New virtual function.
14581 (Target_selector::do_recognize_by_name): New virtual function.
14582 (Target_selector::instantiate_target): New private function.
14583 (supported_target_names): Declare.
14584 * target-select.cc (Target_selector::Target_selector): Update for
14585 new parameter and fields.
14586 (select_target_by_name): Check that the name matches before
14587 calling recognize_by_name.
14588 (supported_target_names): New function.
14589 * i386.cc (class Target_selector_i386): Update Target_selector
14590 constructor call. Remove recognize and recognize_by_name. Add
14591 do_instantiate_target.
14592 * x86_64.cc (class Target_selector_x86_64): Likewise.
14593 * testsuite/testfile.cc (class Target_selector_test): Update for
14594 changes to Target_selector.
14595
874c5b28
ILT
14596 * README: Rewrite, with some notes on unsupported features.
14597
0a65a3a7
CC
145982008-03-24 Cary Coutant <ccoutant@google.com>
14599
14600 * i386.cc (Target_i386::Got_type): New enum declaration.
14601 (Target_i386::Scan::local): Updated callers of Output_data_got
14602 member functions.
14603 (Target_i386::Scan::global): Likewise.
14604 (Target_i386::Relocate::relocate): Likewise.
14605 (Target_i386::Relocate::relocate_tls): Likewise.
14606 * object.h (Got_offset_list): New class.
14607 (Sized_relobj::local_has_got_offset): Added got_type parameter.
14608 (Sized_relobj::local_got_offset): Likewise.
14609 (Sized_relobj::set_local_got_offset): Likewise.
14610 (Sized_relobj::local_has_tls_got_offset): Removed.
14611 (Sized_relobj::local_tls_got_offset): Removed.
14612 (Sized_relobj::set_local_tls_got_offset): Removed.
14613 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
14614 * output.cc (Output_data_got::add_global): Added got_type parameter.
14615 (Output_data_got::add_global_with_rel): Likewise.
14616 (Output_data_got::add_global_with_rela): Likewise.
14617 (Output_data_got::add_global_pair_with_rel): New function.
14618 (Output_data_got::add_global_pair_with_rela): New function.
14619 (Output_data_got::add_local): Added got_type parameter.
14620 (Output_data_got::add_local_with_rel): Likewise.
14621 (Output_data_got::add_local_with_rela): Likewise.
14622 (Output_data_got::add_local_pair_with_rel): New function.
14623 (Output_data_got::add_local_pair_with_rela): New function.
14624 (Output_data_got::add_global_tls): Removed.
14625 (Output_data_got::add_global_tls_with_rel): Removed.
14626 (Output_data_got::add_global_tls_with_rela): Removed.
14627 (Output_data_got::add_local_tls): Removed.
14628 (Output_data_got::add_local_tls_with_rel): Removed.
14629 (Output_data_got::add_local_tls_with_rela): Removed.
14630 * output.h (Output_data_got::add_global): Added got_type parameter.
14631 (Output_data_got::add_global_with_rel): Likewise.
14632 (Output_data_got::add_global_with_rela): Likewise.
14633 (Output_data_got::add_global_pair_with_rel): New function.
14634 (Output_data_got::add_global_pair_with_rela): New function.
14635 (Output_data_got::add_local): Added got_type parameter.
14636 (Output_data_got::add_local_with_rel): Likewise.
14637 (Output_data_got::add_local_with_rela): Likewise.
14638 (Output_data_got::add_local_pair_with_rel): New function.
14639 (Output_data_got::add_local_pair_with_rela): New function.
14640 (Output_data_got::add_global_tls): Removed.
14641 (Output_data_got::add_global_tls_with_rel): Removed.
14642 (Output_data_got::add_global_tls_with_rela): Removed.
14643 (Output_data_got::add_local_tls): Removed.
14644 (Output_data_got::add_local_tls_with_rel): Removed.
14645 (Output_data_got::add_local_tls_with_rela): Removed.
14646 * resolve.cc (Symbol::override_base_with_special): Removed
14647 reference to has_got_offset_ field.
14648 * symtab.cc (Symbol::init_fields): Replaced initialization
14649 of got_offset_ with got_offsets_. Removed initialization
14650 of has_got_offset_
53fcba31 14651 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
14652 (Symbol::got_offset): Likewise.
14653 (Symbol::set_got_offset): Likewise.
14654 (Symbol::has_tls_got_offset): Removed.
14655 (Symbol::tls_got_offset): Removed.
14656 (Symbol::set_tls_got_offset): Removed.
14657 (Symbol::got_offset_): Removed.
14658 (Symbol::tls_mod_got_offset_): Removed.
14659 (Symbol::tls_pair_got_offset_): Removed.
14660 (Symbol::got_offsets_): New field.
14661 (Symbol::has_got_offset): Removed.
14662 (Symbol::has_tls_mod_got_offset): Removed.
14663 (Symbol::has_tls_pair_got_offset): Removed.
14664 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
14665 (Target_x86_64::Scan::local): Updated callers of Output_data_got
14666 member functions.
14667 (Target_x86_64::Scan::global): Likewise.
14668 (Target_x86_64::Relocate::relocate): Likewise.
14669 (Target_x86_64::Relocate::relocate_tls): Likewise.
14670
bd52eafb
BE
146712008-03-25 Ben Elliston <bje@au.ibm.com>
14672
14673 * yyscript.y: Fix spelling error in comment.
14674
8b105e34
ILT
146752008-03-24 Ian Lance Taylor <iant@google.com>
14676
8ed814a9
ILT
14677 * options.h (class General_options): Define build_id option.
14678 * layout.h (class Layout): Declare write_build_id, create_note,
14679 create_build_id. Add build_id_note_ member.
14680 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
14681 "libiberty.h", "md5.h", "sha1.h".
14682 (Layout::Layout): Initialize eh_frame_data_,
14683 eh_frame_hdr_section_, and build_id_note_.
14684 (Layout::finalize): Call create_build_id.
14685 (Layout::create_note): New function, broken out of
14686 Layout::create_gold_note.
14687 (Layout::create_gold_note): Call create_note.
14688 (Layout::create_build_id): New function.
14689 (Layout::write_build_id): New function.
14690 (Close_task_runner::run): Call write_build_id.
14691
8b105e34
ILT
14692 * x86_64.cc: Correct license to GPLv3.
14693
086a1841
ILT
146942008-03-23 Ian Lance Taylor <iant@google.com>
14695
14696 * options.cc: Include "demangle.h".
14697 (parse_optional_string): New function.
14698 (parse_long_option): Handle takes_optional_argument.
14699 (parse_short_option): Update dash_z initializer. Handle
14700 takes_optional_argument.
14701 (General_options::General_options): Initialize do_demangle_.
14702 (General_options::finalize): Set do_demangle_. Handle demangling
14703 style.
14704 * options.h (parse_optional_string): Declare.
14705 (struct One_option): Add optional_arg field. Update constructor.
14706 Update call constructor calls. Add takes_optional_argument
14707 function.
14708 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
14709 (DEFINE_optional_string): Define.
14710 (General_options::demangle): Change from DEFINE_bool to
14711 DEFINE_optional_string.
14712 (General_options::no_demangle): New function.
14713 (General_options::do_demangle): New function.
14714 (General_options::set_do_demangle): New function.
14715 (General_options::execstack_status_): Move definition to end of
14716 class definition.
14717 (General_options::static_): Likewise.
14718 (General_options::do_demangle_): New field.
14719 * object.cc (big_endian>::get_symbol_location_info): Call
14720 Options::do_demangle, not Options::demangle.
14721 * symtab.cc (demangle): Likewise.
14722
cbb93e63
ILT
147232008-03-22 Ian Lance Taylor <iant@google.com>
14724
14725 * gold.h: Include <cstddef> and <sys/types.h>
14726 * options.h: Include <cstring>.
14727
ec531623
ILT
147282008-03-21 Ian Lance Taylor <iant@google.com>
14729
14730 * Added source code to GNU binutils.
752937aa
NC
14731\f
14732Copyright (C) 2008-2012 Free Software Foundation, Inc.
14733
14734Copying and distribution of this file, with or without modification,
14735are permitted in any medium without royalty provided the copyright
14736notice and this notice are preserved.
14737
14738Local Variables:
14739mode: change-log
14740left-margin: 8
14741fill-column: 74
14742version-control: never
14743End:
This page took 0.992525 seconds and 4 git commands to generate.