Do not overwrite so_list's so_name in solib_map_sections
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
54a3d865
ILT
12013-04-04 Ian Lance Taylor <iant@google.com>
2
3 GCC PR c++/56840
4 * object.cc (do_layout_deferred_sections): Handle .eh_frame
5 sections before checking whether they are included in the link.
6
9993ba11
ST
72013-03-29 Sriraman Tallam <tmsriram@google.com>
8
9 * archive.cc (Archive::get_elf_object_for_member): Create the elf
10 object before calling the plugin claim_file handler. Pass the elf
11 object of the archive to the plugin. Delete the elf object if the
12 plugin claims the file.
13
ebacd51e
AM
142013-03-21 Alan Modra <amodra@gmail.com>
15
16 * layout.cc (Layout::set_segment_offsets): Accept writable .text
17 segment when omagic.
18
117be58f
AM
192013-03-21 Alan Modra <amodra@gmail.com>
20
21 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
22 comparison warning.
23 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
24 uninitialized" warning.
25
32e2b61d
AM
262013-03-20 Alan Modra <amodra@gmail.com>
27
28 * symtab.h (Symbol::clear_version): New function.
29 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
30 is_needed by weak references. Clear version for symbols defined
31 in as-needed objects that are not needed.
32
b3ccdeb5
AM
332013-03-15 Alan Modra <amodra@gmail.com>
34
35 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
36 static and public. Add report_err param. Return false for data refs.
37 (Target_powerpc::rela_dyn_section): New overloaded function.
38 (Target_powerpc::plt_, iplt_): Elucidate.
39 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
40 (Output_data_plt_powerpc::do_write): Don't write .iplt.
41 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
42 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
43 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
44 push_branch and make_plt_entry for ifunc syms when
45 reloc_needs_plt_for_ifunc.
46 (Target_powerpc::Relocate::relocate): Don't use plt entry value
47 for ifunc unless reloc_needs_plt_for_ifunc.
48
ad3d8a2f
AM
492013-03-15 Alan Modra <amodra@gmail.com>
50
51 * gc.h (gc_process_relocs): Don't look through function descriptors.
52 * icf.cc (get_section_contents): Do so here instead.
53
4d9aa155
AM
542013-03-13 Alan Modra <amodra@gmail.com>
55
56 * powerpc.cc (is_branch_reloc): Forward declare.
57 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
58 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
59 false for 64-bit, true for 32-bit non-branch relocs.
60 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
61 * testsuite/Makefile.am (icf_test): Use linker map file instead of
62 nm output.
63 (icf_safe_test): Generate linker map file as well as nm output.
64 (icf_safe_so_test): Likewise.
65 * testsuite/Makefile.in: Regenerate.
66 * testsuite/icf_test.sh: Parse linker map file to determine
67 section folding.
68 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
69 * testsuite/icf_safe_so_test.sh: Likewise.
70 (X86_32_or_ARM_specific_safe_fold): Merge into..
71 (arch_specific_safe_fold): ..this.
72 (X86_64_specific_safe_fold): Delete unused function.
73
57420c20
AM
742013-03-12 Alan Modra <amodra@gmail.com>
75
76 * gc.h (gc_process_relocs): Look through function descriptors
77 to determine shndx, symvalue and addend used by ICF. Tidy
78 variable duplication.
79
dc3714f3
AM
802013-03-11 Alan Modra <amodra@gmail.com>
81
82 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
83 * layout.cc (Layout_task_runner::run): ..to here.
84 * symtab.h (struct Symbol_location): Extract from..
85 (class Symbol_table): ..here.
86 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
87 * target.h (class Target): Add function_location and
88 do_function_location functions.
89 (class Sized_target): Add do_function_location.
90 * object.h (class Sized_relobj_file): Move find_shdr..
91 (class Object): ..to here.
92 * object.cc: Likewise. Update to suit. Instantiate.
93 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
94 * powerpc.cc (class Powerpc_dynobj): New.
95 (Target_powerpc::do_function_location): New function.
96 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
97 (Powerpc_dynobj::do_read_symbols): New function.
98 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
99
956b03bb
ILT
1002013-03-08 Ian Lance Taylor <iant@google.com>
101
102 * options.cc (General_options::string_to_object_format): Accept
103 "default".
104
4bead2d5
AM
1052013-03-08 Alan Modra <amodra@gmail.com>
106
107 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
108 pointer to Post_fde.
109 (struct Post_fde): Move definition to here..
110 * ehframe.cc (struct Post_fde): ..from here.
111 (Cie::write): Don't alloc Post_fde.
112 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
113
02e60bf7
AM
1142013-03-07 Alan Modra <amodra@gmail.com>
115
116 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
117 relocation referencing .LC0.
118 * testsuite/discard_locals_test.sh: Remove FIXMEs.
119
8343f03a
AM
1202013-03-07 Alan Modra <amodra@gmail.com>
121
122 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
123 always_inline. Add assembly for powerpc to avoid GOT.
124
3366d57c
AM
1252013-03-07 Alan Modra <amodra@gmail.com>
126
127 * testsuite/script_test_10.sh: Don't test .bss section
128 header number.
129
6c77229c
AM
1302013-03-06 Alan Modra <amodra@gmail.com>
131
132 * powerpc.cc (class Powerpc_relobj): Move some member functions.
133 (Target_powerpc::symval_for_branch): Add symtab param. Update
134 all callers. Handle folded sections.
135 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
136 to Powerpc_relobj.
137 (Global_symbol_visitor_opd::operator()): Likewise.
138
a39e4af6
AM
1392013-03-04 Alan Modra <amodra@gmail.com>
140
141 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
142 * testsuite/Makefile.in: Regenerate.
143
d5834edb
CC
1442013-03-01 Cary Coutant <ccoutant@google.com>
145
146 Add dwp support for v2 DWARF package file format.
147 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
148 tu_length parameter. Adjust all callers.
149 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
150 * dwp.cc: Include dwarf.h.
151 (Section_bounds): New struct type.
152 (Unit_set): New struct type.
153 (Dwo_file::Dwo_file): Initialize new data member.
154 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
155 Combine and rename to...
156 (Dwo_file::read_unit_index): ...this.
157 (Dwo_file::sized_read_compunit_index)
158 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
159 (Dwo_file::sized_read_unit_index): ...this.
160 (Dwo_file::copy_section): Remove section_name, is_str_offsets
161 parameters; add section_id parameter.
162 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
163 (Dwo_file::add_unit_set): ...this.
164 (Dwo_file::shndx_map_): Remove.
165 (Dwo_file::sect_offsets_): New data member.
166 (Dwp_output_file::Dwp_output_file): Initialize new data members.
167 (Dwp_output_file::add_section): Rename to...
168 (Dwp_output_file::add_contribution): ...this.
169 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
170 (Dwp_output_file::add_tu_set): Likewise.
171 (Dwp_output_file::Contribution): New type.
172 (Dwp_output_file::Section::contributions): New data member.
173 (Dwp_output_file::Cu_or_tu_set): Remove.
174 (Dwp_output_file::Section::Section): New ctor.
175 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
176 (Dwp_output_file::Dwp_index::Section_table): New type.
177 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
178 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
179 parameter.
180 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
181 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
182 (Dwp_output_file::Dwp_index::section_table): New member function.
183 (Dwp_output_file::Dwp_index::section_table_end): New member function.
184 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
185 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
186 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
187 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
188 (Dwp_output_file::Dwp_index::section_table_): New data member.
189 (Dwp_output_file::Dwp_index::section_mask_): New data member.
190 (Dwp_output_file::add_output_section): New member function.
191 (Dwp_output_file::write_new_section): New member function.
192 (Dwp_output_file::write_contributions): New member function.
193 (Dwp_output_file::section_id_map_): New data member.
194 (class Dwo_id_info_reader): Remove.
195 (class Unit_reader): New class.
196 (get_dwarf_section_name): New function.
197 (Dwo_file::read_executable): Adjust initializations of class data.
198 (Dwo_file::read): Add support for v2 package file format.
199 (Dwo_file::read_unit_index): Likewise.
200 (Dwo_file::sized_read_unit_index): Likewise.
201 (Dwo_file::copy_section): Likewise.
202 (Dwo_file::add_unit_set): Likewise.
203 (Dwp_output_file::add_output_section): Likewise.
204 (Dwp_output_file::add_contribution): Likewise.
205 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
206 for empty slot.
207 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
208 file format.
209 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
210 slot.
211 (Dwp_output_file::initialize): Remove unused function.
212 (Dwp_output_file::finalize): Add support for v2 package file format.
213 (Dwp_output_file::write_index): Likewise.
214 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
215 function prototype.
216
a68a081d
CC
2172013-03-01 Cary Coutant <ccoutant@google.com>
218
219 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
220 function into class definition in header file.
221 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
222 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
223 New function.
224 (Dwarf_info_reader::check_buffer): Move here from .cc file.
225
9d5781f8
AM
2262013-02-28 Alan Modra <amodra@gmail.com>
227
228 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
229 * target.cc (Target::do_plt_fde_location): New function.
230 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
231 accessor function, and constructor param.
232 (struct Post_fde, Post_fdes): Declare.
233 (Cie::write): Add post_fdes param.
234 * ehframe.cc (Fde::write): Use plt_fde_location.
235 (struct Post_fde): Define.
236 (Cie::write): Stash FDEs added post merge mapping.
237 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
238 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
239 (Eh_frame::do_sized_write): Arrange to write post map FDES after
240 other FDEs.
241 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
242 (Target_powerpc::has_glink): New function.
243 (Target_powerpc::do_relax): Add eh_frame info for stubs.
244 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
245 glink_eh_frame_fde_32, default_fde): New data.
246 (Stub_table::eh_frame_added_): New var.
247 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
248 Make const.
249 (Stub_table::add_eh_frame): New function.
250 (Output_data_glink::add_eh_frame): New function.
251 (Target_powerpc::make_glink_section): Call add_eh_frame.
252
214383dd
ILT
2532013-02-15 Ian Lance Taylor <iant@google.com>
254
255 * options.h (DEFINE_uint64_alias): Define.
256 (class General_options): Add -Ttext-segment as an alias for
257 -Ttext.
258
91c2b899
AM
2592013-02-15 Alan Modra <amodra@gmail.com>
260
261 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
262 (Stub_table::do_write): ..here, two places.
263 (Stub_table::plt_call_size): Use it here too.
264
20e2a8aa
ILT
2652013-02-11 Ian Lance Taylor <iant@google.com>
266
267 * descriptors.cc (Descriptors::close_all): New function.
268 * descriptors.h (class Descriptors): Declare close_all.
269 (close_all_descriptors): New inline function.
270 * plugin.cc: Include "descriptors.h".
271 (Plugin_manager::cleanup): Call close_all_descriptors.
272
8952bc69
AM
2732013-02-06 Alan Modra <amodra@gmail.com>
274
275 * README: Update coding style link.
276
29bd8b6b
CC
2772013-01-28 Cary Coutant <ccoutant@google.com>
278
279 * dwp.cc (File_list): New typedef.
280 (Dwo_name_info_reader): New class.
281 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
282 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
283 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
284 (Dwo_file::read_executable): New function.
285 (Dwo_file::read): Move common setup code to ...
286 (Dwo_file::make_object): ... here.
287 (dwp_options): Add --exec/-e.
288 (usage): Likewise.
289 (main): Likewise.
290
c6ac678d
ST
2912013-01-24 Sriraman Tallam <tmsriram@google.com>
292
293 * layout.cc (Layout::layout): Check for option text_reorder.
294 (Layout::make_output_section): Ditto.
295 * options.h (text_reorder): New option.
296 * output.cc (Input_section_sort_compare): Remove special ordering
297 of section names.
298 (Output_section::
299 Input_section_sort_section_name_special_ordering_compare::
300 operator()): New function.
301 (Output_section::sort_attached_input_sections): Use new sort function
302 for .text.
303 * output.h (Input_section_sort_section_name_special_ordering_compare):
304 New struct.
305 * testsuite/Makefile.am (text_section_grouping): Test option
306 --no-text-reorder
307 * testsuite/Makefile.in: Regenerate.
308 * testsuite/text_section_grouping.sh: Check order of functions without
309 default text reordering.
310
50701cc1
MF
3112013-01-18 Mike Frysinger <vapier@gentoo.org>
312
313 * options.h (General_options): Change default to true for new_dtags.
314
b1b00fcc
MF
3152013-01-18 Mike Frysinger <vapier@gentoo.org>
316
317 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
318 when enable_new_dtags is false. Only add DT_RUNPATH when
319 enable_new_dtags is true.
320
ec5b8187
AM
3212013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
322
323 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
324 used in declaration and definition consistent.
325 (Target_powerpc::symval_for_branch): Ditto.
326
a880d4c4
ST
3272013-01-16 Sriraman Tallam <tmsriram@google.com>
328
329 * testsuite/plugin_final_layout.cc: Fix comment.
330
7c381248
ST
3312013-01-16 Sriraman Tallam <tmsriram@google.com>
332
333 * layout.cc (Layout::layout): Do not do default sorting for
334 text sections when section ordering is specified.
335 (make_output_section): Ditto.
336 * testsuite/plugin_final_layout.cc: Name the function sections
337 to catch reordering issues.
338
e2458743
AM
3392013-01-15 Alan Modra <amodra@gmail.com>
340
341 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
342 plt-thread-safe.
343
431ed302
AM
3442013-01-15 Alan Modra <amodra@gmail.com>
345
346 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
347 * testsuite/Makefile.in: Regenerate.
348
0ec6429b
AM
3492013-01-14 Alan Modra <amodra@gmail.com>
350
351 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
352 * testsuite/Makefile.in: Regenerate.
353
0bf402d5
ILT
3542013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
355
36af3926 356 PR bfd/14430
0bf402d5
ILT
357 Fix mingw gold build with plugins enabled
358 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
359 * configure.ac: Export DLOPEN_LIBS and add headers check.
360 * plugin.cc: Handle non-dlfcn case.
361 * Makefile.in: Regenerate.
362 * config.in: Regenerate.
363 * configure: Regenerate.
364 * testsuite/Makefile.in: Regenerate.
365
9e9143bc
ST
3662013-01-09 Sriraman Tallam <tmsriram@google.com>
367
368 * output.h (sort_attached_input_sections): Change to be public.
369 * script-sections.cc
370 (Output_section_definition::set_section_addresses): Sort
371 attached input sections according to section order before linker
372 script assigns section addresses.
373 (Orphan_output_section::set_section_addresses): Sort
374 attached input sections according to section order before linker
375 script assigns section addresses.
376 * Makefile.am (final_layout.sh): Use a simple linker script to
377 check if section ordering still works.
378 * Makefile.in: Regenerate.
379
679af368
ILT
3802013-01-09 Ben Cheng <bccheng@google.com>
381
382 * arm.cc (Target_arm::attributes_accept_div): New function.
383 (Target_arm::attributes_forbid_div): New function.
384 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
385 attribute using the same new functions as what bfd/elf32_arm.c
386 does.
387
3136a00e
CC
3882013-01-07 Cary Coutant <ccoutant@google.com>
389
390 PR gold/14993
391 * output.cc (Output_section::add_input_section): For incremental
392 updates, don't track input sections that are allocated from patch
393 space.
394
f2a6224b
L
3952013-01-07 H.J. Lu <hongjiu.lu@intel.com>
396 Ian Lance Taylor <iant@google.com>
397
398 PR gold/14897
399 * configure.ac (--enable-ld): Removed.
400 (install_as_default): Set to yes only for --enable-gold=default
401 or --disable-ld.
402 * configure: Regenerated.
403
4f46f626
L
4042013-01-07 H.J. Lu <hongjiu.lu@intel.com>
405
406 * options.h (General_options): Add -fuse-ld= for GCC linker
407 option compatibility.
408
26e4ef59
CC
4092013-01-04 Cary Coutant <ccoutant@google.com>
410
411 * configure.ac: Fix typo restoring CXXFLAGS.
412 * configure: Regenerate.
413
3d587466
CC
4142013-01-04 Cary Coutant <ccoutant@google.com>
415
4f46f626
L
416 * testsuite/Makefile.am (CXXLINK_S): New macro.
417 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
418 * testsuite/Makefile.in: Regenerate.
3d587466 419
44db6695
L
4202013-01-02 H.J. Lu <hongjiu.lu@intel.com>
421
422 * version.cc (print_version): Update copyright year to 2013.
423
edcac0c1
ILT
4242012-12-20 Ian Lance Taylor <iant@google.com>
425
426 * layout.cc (Layout::special_ordering_of_input_section): New
427 function.
428 (Layout::layout): If input section requires special ordering, must
429 sort input sections.
430 (Layout::make_output_section): May sort .text input sections.
431 (Layout::is_section_name_prefix_grouped): Remove.
432 * layout.h (class Layout): Declare
433 special_ordering_of_input_section. Don't declare
434 is_section_name_prefix_grouped.
435 * output.cc (Output_section::add_input_section): Revert last
436 change.
437 (Output_section::Input_section_sort::match_file_name): Don't crash
438 if called on output section data.
439 (Output_section::Input_section_sort_compare): Sort based on
440 special ordering.
441 (Output_section::Input_section_sort_section_order_index_compare):
442 Revert last patch.
443 (Output_section::sort_attached_input_sections): Likewise.
444
28f2a4ac
ST
4452012-12-18 Sriraman Tallam <tmsriram@google.com>
446
edcac0c1 447 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
448 * layout.h (Layout::is_section_name_prefix_grouped): New function.
449 * output.cc (Output_section::add_input_section): Check if section
450 name contains special prefix. Keep input sections to sort such
451 sections.
452 (Output_section::Input_section_sort_section_order_index_compare
453 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
454 (Output_section::sort_attached_input_sections): Add condition to
455 Input_section_entry constructor call.
28f2a4ac
ST
456 * testsuite/Makefile.am (text_section_grouping): New test.
457 * testsuite/Makefile.in: Regenerate.
458 * testsuite/text_section_grouping.cc: New file.
459 * testsuite/text_section_grouping.sh: New file.
460
5bf135a7
NC
4612012-12-17 Nick Clifton <nickc@redhat.com>
462
463 * Makefile.am: Add copyright notice.
464 * NEWS: Likewise.
465 * README: Likewise.
466 * configure.ac: Likewise.
467 * ftruncate.c: Likewise.
468 * Makefile.in: Regenerate.
469
59965708
CC
4702012-12-14 Cary Coutant <ccoutant@google.com>
471
472 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
473 --no-as-needed flag.
474 (exception_separate_shared_12_test): Likewise.
475 (incremental_copy_test): Likewise.
476 * testsuite/Makefile.in: Regenerate.
477
2a77e2ab
CC
4782012-12-14 Cary Coutant <ccoutant@google.com>
479
480 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
481 (Dwp_output_file::Dwp_index::enter_set): Add assert.
482
e3deeb9c
AM
4832012-12-12 Alan Modra <amodra@gmail.com>
484
485 * powerpc.cc (class Track_tls): New.
486 (class Relocate, class Scan): Inherit Track_tls.
487 (Target_powerpc::Scan::local, global): Track tls optimization
488 and avoid creating plt entry for __tls_get_addr if all uses
489 are optimized away.
490 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
491
d8f5a274
AM
4922012-12-12 Alan Modra <amodra@gmail.com>
493
494 * options.h (General_options): Add --toc-sort/--no-toc-sort.
495 Replace no_toc_optimize with toc_optimize.
496 * output.h (Output_section::input_sections): Provide non-const variant.
497 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
498 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
499 accessors.
500 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
501 (class Sort_toc_sections): New.
502 (Target_powerpc::do_finalize_sections): Sort toc sections.
503 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
504
4c8a1de1
RM
5052012-12-10 Roland McGrath <mcgrathr@google.com>
506
507 * testsuite/binary_unittest.cc (read_all): New function.
508 (Sized_binary_test): Use it instead of ::read.
509 * fileread.cc (do_read): Don't assume pread always reads the whole
510 amount in a single call.
511
edc27beb
AM
5122012-12-10 Alan Modra <amodra@gmail.com>
513
514 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
515 Set EM_PPC64 or EM_PPC here.
516 (Target_selector_powerpc::do_recognize): Delete.
517
906b9150
AM
5182012-12-10 Alan Modra <amodra@gmail.com>
519
520 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
521 stub_table_.
522 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
523
418c15ae
RM
5242012-12-07 Roland McGrath <mcgrathr@google.com>
525
526 * testsuite/binary_unittest.cc (Sized_binary_test):
527 Use open_descriptor rather than ::open.
528
decdd3bc
AM
5292012-12-07 Alan Modra <amodra@gmail.com>
530
531 * powerpc.cc (Stub_table::do_write): Delete redundant Address
532 typedef and invalid_address constant.
533 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
534 instantiate constants.
535
db399005
ILT
5362012-12-06 Roland McGrath <mcgrathr@google.com>
537
538 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
539 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
540 * aclocal.m4: Regenerate.
541 * configure: Regenerate.
542 * Makefile.in: Regenerate.
543 * testsuite/Makefile.in: Regenerate.
544
aba6bc71
AM
5452012-12-07 Alan Modra <amodra@gmail.com>
546
547 * options.h (General_options): Add no_toc_optimize.
548 * powerpc.cc (ok_lo_toc_insn): New function.
549 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
550
9e69ed50
AM
5512012-12-06 Alan Modra <amodra@gmail.com>
552
553 * options.h (General_options): Add plt_align, plt_static_chain,
554 plt_thread_safe. Update stub_group_size help text.
555 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
556 for new plt_thread_safe_ var.
557 (use_plt_offset): Correct comments.
558 (Target_powerpc::do_relax): Look for thread creation symbols to
559 determine default plt_thread_safe value. Clear plt call stubs
560 as well as branch stubs each iteration.
561 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
562 insn constants.
563 (l, hi, ha, write_insn): Move earlier.
564 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
565 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
566 plt stubs too.
567 (Stub_table::update_size): Adjust.
568 (Stub_table::prev_size, set_prev_size): Delete.
569 (Stub_table::stub_align): Let --plt-align affect result.
570 (Stub_table::plt_call_size): Calculate sizes for various stubs.
571 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
572 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
573 (Stub_table::do_write): Support more stub variants.
574
f43ba157
AM
5752012-12-04 Alan Modra <amodra@gmail.com>
576
577 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
578 (Target_powerpc::do_define_standard_symbols): New function.
579
34171bc5
AM
5802012-12-03 Alan Modra <amodra@gmail.com>
581
582 * output.h: Formatting, whitespace.
583
dc9589e9 5842012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
585
586 * layout.h (Layout::get_executable_sections): Declare.
587 * layout.cc (Layout::get_executable_sections): New function.
588 * arm.cc (Target_arm::group_sections): Use it.
589 (Arm_output_section::group_sections): Delete now redundant test.
590 * output.cc (Output_reloc::Output_reloc): Add is_relative.
591 param to handle relative relocs.
592 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
593 (Output_data_reloc::add_absolute): Adjust.
594 (Output_data_reloc::add_relative): New function.
595 (Output_data::reset_data_size): New function.
596 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
597 (Output_section::set_addralign): New function.
598 (Output_section::checkpoint_set_addralign): New function.
599 (Output_section::clear_section_offsets_need_adjustment): New function.
600 (Output_section::input_sections): Make public.
601 * powerpc.cc (class Output_data_brlt_powerpc): New.
602 (class Stub_table, class Stub_control): New.
603 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
604 stub_table_, set_stub_table, stub_table): New vectors and accessor
605 functions.
606 (Target_powerpc::do_may_relax, do_relax, push_branch,
607 new_stub_table, stub_tables, brlt_section, group_sections,
608 add_branch_lookup_table, find_branch_lookup_table,
609 write_branch_lookup_table, make_brlt_section): New functions.
610 (Target_powerpc::struct Sort_sections, class Branch_info): New.
611 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
612 branch_info_): New vars.
613 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
614 make call stubs here.
615 (Output_data_glink): Remove all call stub handling from this class.
616 (Target_powerpc::Scan::local, global): Save interesting branch
617 relocs and relocs for ifunc. Adjust calls to plt entry functions.
618 (Target_powerpc::do_finalize_sections): Only make reg save/restore
619 functions on final link.
620 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
621 Handle long branch destinations too.
622 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
623 do_plt_address_for_local): Adjust lookup of plt call stubs.
624
627b30b7
AM
6252012-11-30 Alan Modra <amodra@gmail.com>
626
627 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
628 relocs against protected symbols when building 32-bit shared libs.
629
40b469d7
AM
6302012-11-30 Alan Modra <amodra@gmail.com>
631
632 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
633 param. Call got_section() to make .got. Update all callers
634 and their callers and so on.
635
bb66a627
AM
6362012-11-30 Alan Modra <amodra@gmail.com>
637
638 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
639 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
640 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
641 value if it already exists.
642
d2cf1c6c
L
6432012-11-19 H.J. Lu <hongjiu.lu@intel.com>
644
645 PR gold/14858
646 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
647
edccdf7c
RM
6482012-11-14 Roland McGrath <mcgrathr@google.com>
649
650 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
651 than bfc instruction for data sandboxing.
652
6febeb74
AM
6532012-11-08 Alan Modra <amodra@gmail.com>
654
655 * po/POTFILES.in: Regenerate.
656
0a6f1bf2
AM
6572012-11-05 Alan Modra <amodra@gmail.com>
658
659 * configure.ac: Apply 2012-09-10 change to config.in here.
660 * configure: Regenerate.
661
26a4e9cb
AM
6622012-11-05 Alan Modra <amodra@gmail.com>
663
664 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
665 (struct Opd_ent): Use "Address" rather than "Offset".
666 (Output_data_got_powerpc::got_base_offset): Return Valtype.
667 (Target_powerpc::got_section): Make public.
668 (Target_powerpc::scan_relocs): Move code setting symbols..
669 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
670 Create _SDA_BASE_ only when referenced.
671
cc928013
RM
6722012-11-02 Roland McGrath <mcgrathr@google.com>
673
674 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
675 from last change.
676
50ed5eb1
RM
6772012-11-01 Roland McGrath <mcgrathr@google.com>
678
62fe925a
RM
679 * target.h (Sized_target::relocate_relocs): Use Elf_Off
680 for offset_in_output_section parameter.
681 (Sized_target::relocate_special_relocatable): Likewise.
682 * arm.cc (Target_arm::relocate_relocs): Likewise.
683 (Target_arm::relocate_special_relocatable): Likewise.
684 * i386.cc (Target_i386::relocate_relocs): Likewise.
685 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
686 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
687 * target-reloc.h (relocate_relocs): Likewise.
688 * testsuite/testfile.cc (Target_test): Likewise.
689 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
690 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
691
692 * system.h: Move inclusion of <clocale> to after <libintl.h> in
693 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
694
695 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
696 parameter, which is unused in the [!F_SETFD] case.
697
50ed5eb1
RM
698 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
699 SYMNDX to off_t before comparing it to this->data_size().
700 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
701 * incremental.cc (Output_section_incremental_inputs::do_write):
702 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
703
2cadc0bf
RM
704 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
705
3bfcb652
NC
7062012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
707
708 * gold.cc (Target_arm::do_adjust_elf_header): Add the
709 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
710 in EABI_VER5.
711
c1a8d56e
CC
7122012-10-29 Cary Coutant <ccoutant@google.com>
713
714 * dwp.cc (usage): Add file and exit status parameters;
715 add --help and --version options.
716 (print_version): New function.
717 (main): Add --help and --version options.
718
b2490a7b
L
7192012-10-25 H.J. Lu <hongjiu.lu@intel.com>
720
721 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
722 final_layout_sequence.txt.
723 * testsuite/Makefile.in: Regenerated.
724
aa543512
L
7252012-10-25 H.J. Lu <hongjiu.lu@intel.com>
726
727 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
728 COMPILE generated by automake.
729 (LINK1): Likewise.
730 (CXXCOMPILE1): Likewise.
731 (CXXLINK1): Likewise.
732 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
733 (LINK): Likewise.
734 (CXXCOMPILE): Likewise.
735 (CXXLINK): Likewise.
736 * testsuite/Makefile.in: Regenerated.
737
d361fafb
L
7382012-10-25 H.J. Lu <hongjiu.lu@intel.com>
739
740 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
741 on bad fwrite return.
742
598c7410
L
7432012-10-25 H.J. Lu <hongjiu.lu@intel.com>
744
745 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
746 on val.
747
35c813e2
CC
7482012-10-23 Cary Coutant <ccoutant@google.com>
749
750 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
751 * testsuite/Makefile.in: Regenerate.
752 * testsuite/dwp_test.h: New source file.
753 * testsuite/dwp_test_1.cc: New source file.
754 * testsuite/dwp_test_1.s: New source file.
755 * testsuite/dwp_test_1.sh: New source file.
756 * testsuite/dwp_test_1b.cc: New source file.
757 * testsuite/dwp_test_1b.s: New source file.
758 * testsuite/dwp_test_2.cc: New source file.
759 * testsuite/dwp_test_2.s: New source file.
760 * testsuite/dwp_test_2.sh: New source file.
761 * testsuite/dwp_test_main.cc: New source file.
762 * testsuite/dwp_test_main.s: New source file.
763
77429909
CC
7642012-10-23 Cary Coutant <ccoutant@google.com>
765
766 * dwp.h: New header file.
767 * dwp.cc: New source file.
768 * gold.h: Move shared declarations to system.h.
769 * system.h: New header file.
770 * Makefile.am: Add dwp.
771 * Makefile.in: Regenerate.
772
ed5d6712
CC
7732012-10-23 Cary Coutant <ccoutant@google.com>
774
775 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
776 Dwarf_info_reader::read_from_pointer.
777 (Dwarf_pubnames_table::read_header): Likewise.
778 (Dwarf_pubnames_table::next_name): Likewise.
779 (Dwarf_die::read_attributes): Likewise.
780 (Dwarf_die::skip_attributes): Likewise.
781 (Dwarf_info_reader::read_from_pointer): New function template.
782 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
783 (Dwarf_pubnames_table): Likewise.
784 (Dwarf_info_reader::read_from_pointer): New function template.
785 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
786 Dwarf_pubnames_table ctor.
787
8787852d
CC
7882012-10-23 Cary Coutant <ccoutant@google.com>
789
790 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
791 abbrev_shndx.
792 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
793 abbrev_shndx_.
794 (Dwarf_info_reader::set_abbrev_shndx): New method.
795 (Dwarf_info_reader::abbrev_shndx_): New data member.
796
9fc236f3
CC
7972012-10-23 Cary Coutant <ccoutant@google.com>
798
799 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
800 from object, not parameters.
801 (Dwarf_info_reader::parse): Likewise.
802 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
803 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
804 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
805 methods.
806
effe8365
CC
8072012-10-23 Cary Coutant <ccoutant@google.com>
808
809 * fileread.cc (Input_file::Input_file): New constructor.
810 * fileread.h (class Input_file): Add new constructor.
811
1698990d
AM
8122012-10-18 Alan Modra <amodra@gmail.com>
813
814 PR gold/14727
815 * object.cc (Relobj::is_section_name_included): Also match
816 .sdata personality section.
817
168a4726
AM
8182012-10-18 Alan Modra <amodra@gmail.com>
819
820 * target-reloc.h (class Default_comdat_behavior): New, package up..
821 (get_comdat_behaviour): ..this.
822 (relocate_section): Add Relocate_comdat_behavior template arg,
823 adjust code to suit.
824 * arm.cc (Target_arm::relocate_section): Adjust to suit.
825 (Target_arm::scan_reloc_section): Likewise.
826 * i386.cc (Target_i386::relocate_section): Likewise.
827 * sparc.cc (Target_sparc::relocate_section): Likewise.
828 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
829 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
830 * powerpc.cc (class Relocate_comdat_behavior): New.
831 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
832 gold::relocate_section with new template arg.
833
acc276d8
AM
8342012-10-18 Alan Modra <amodra@gmail.com>
835
836 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
837 dynamic relocs for GOT_TPREL got entries, without symbol if
838 resolving locally.
839 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
840 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
841 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
842
e10f9870
AM
8432012-10-17 Alan Modra <amodra@gmail.com>
844
845 PR gold/14726
846 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
847
ae034989
ST
8482012-10-16 Sriraman Tallam <tmsriram@google.com>
849
850 * layout.cc (Layout::include_section): Keep sections marked
851 SHF_EXCLUDE when doing relocatable links.
852
f3a0ed29
AM
8532012-10-16 Alan Modra <amodra@gmail.com>
854
855 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
856 (Target_powerpc::do_finalize_sections): Call it.
857 (Output_data_save_res): New class and supporting functions.
858 (Target_powerpc::symval_for_branch): Only look up .opd entry for
859 normal symbols defined in object files.
860
c6de8ed4
AM
8612012-10-12 Alan Modra <amodra@gmail.com>
862
863 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
864 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
865 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
866 section if scan_opd_relocs not yet called.
867 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
868
03e25981
AM
8692012-10-12 Alan Modra <amodra@gmail.com>
870
871 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
872 add_local_ifunc_entry): Revert last change.
873 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
874
c9824451
AM
8752012-10-05 Alan Modra <amodra@gmail.com>
876
877 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
878 do_plt_address_for_global): New functions.
879 (Output_data_got_powerpc::do_write): Don't segfault when linking
880 statically.
881 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
882 add_local_ifunc_entry): Return true on adding entry..
883 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
884 glink->add_entry call. Remove unused symtab param. Adjust calls.
885 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
886 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
887 set up symbols here.
888 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
889 syms here. Do so even when no .iplt. Don't segfault when linking
890 statically.
891 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
892 new variants without reloc param.
893 (Glink_sym_ent::Glink_sym_ent): Likewise.
894 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
895 reloc when refs will resolve to plt call stub.
896 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
897 R_PPC_PLTREL24 to resolve locally.
898 (Target_powerpc::Scan::global): Correct ifunc handling.
899 (Target_powerpc::Relocate::relocate): Correct local sym glink
900 lookup. Don't destroy "value" when we have a plt call stub,
901 and when checking plt call validity.
902 (Target_powerpc::do_dynsym_value): Simplify.
903
19fec8c1
AM
9042012-10-05 Alan Modra <amodra@gmail.com>
905
906 * i386.cc (Output_data_plt_i386::address_for_global,
907 address_for_local): Add plt offset to returned value. Adjust uses.
908 * sparc.cc (Output_data_plt_sparc::address_for_global,
909 address_for_local): Likewise.
910 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
911 address_for_local): Likewise.
912 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
913 address_for_local): Likewise.
914 * target.h (Target::plt_address_for_global, plt_address_for_local):
915 Update comment.
916 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
917 (Output_data_got::Got_entry::write): Nor here.
918 * output.h: Comment fix.
919
e867b647
WL
9202012-10-02 Jiong Wang <jiwang@tilera.com>
921
922 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
923 global_offset_table_ value for larget got.
924 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
925
e5d5f5ed
AM
9262012-09-29 Alan Modra <amodra@gmail.com>
927
928 * powerpc.cc (Target_powerpc::iplt_): New output section.
929 (Target_powerpc::iplt_section, make_iplt_section,
930 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
931 (Target_powerpc::make_plt_entry): Handle ifunc syms.
932 Target_powerpc::plt_entry_count): Count iplt entries too.
933 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
934 reloc section in constructor. New params.
935 (Target_powerpc::make_plt_section): Create reloc section here instead.
936 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
937 functions.
938 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
939 (Output_data_glink::add_entry, find_entry): New functions to
940 deal with local syms.
941 (Glink_sym_ent): Add support for local syms.
942 (Output_data_glink::do_write): Handle ifunc plt entries.
943 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
944 (Target_powerpc::Scan::local, global): Handle ifunc syms.
945 (Target_powerpc::Relocate::relocate): Likewise.
946 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
947
ec4dbad3
AM
9482012-09-25 Alan Modra <amodra@gmail.com>
949
950 * object.h (Sized_relobj_file::adjust_local_symbol,
951 do_adjust_local_symbol): New functions.
952 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
953 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
954 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
955 and irregular opd entry spacing.
956 (Powerpc_relobj::do_read_relocs): Add opd size checks.
957 (Global_symbol_visitor_opd): New functor.
958 (Target_powerpc::do_finalize_sections): Omit global symbols defined
959 on deleted opd entries.
960
5c0b3823
WL
9612012-09-15 Jiong Wang <jiwang@tilera.com>
962
963 * tilegx.cc: New file.
964 * Makefile.am (TARGETSOURCES): Add tilegx.cc
965 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
966 * configure.tgt: Add entries for tilegx*.
967 * configure.ac: Likewise.
968 * Makefile.in: Rebuild.
969 * configure: Likewise.
970 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
971 tilegx.
972
bfdfa4cd
AM
9732012-09-13 Alan Modra <amodra@gmail.com>
974
975 * target-reloc.h (scan_relocs): Call scan.local for relocs
976 against symbols in discarded sections. Pass is_discarded
977 param.
978 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
979 Add is_discarded param.
980 * powerpc (Target_powerpc::Scan::local): Likewise. Use
981 is_discarded to flag opd entry as discarded. Don't emit dyn
982 relocs on such entries.
983 (Target_powerpc::Scan::global): Similarly detect and handle
984 such opd entries.
985 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
986 opd_ent_. Update all uses.
987 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
988 (Target_powerpc::relocate_section): Zero out discarded opd
989 entry relocs.
990
d77a0555
ILT
9912012-09-12 Ian Lance Taylor <iant@google.com>
992
993 PR gold/14570
994 * output.cc: Rename Output_data_got template parameter from size
995 to got_size for all functions. Compile all variants of
996 Output_data_got.
997 (Output_data_got::Got_entry::write): Correct use of size for
998 symbol value. Use local_is_tls rather than casting to
999 Sized_relobj_file.
1000 * object.h (class Object): Add local_is_tls and do_local_is_tls.
1001 (class Sized_relobj_file): Add do_local_is_tls.
1002 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
1003
815a1205
AM
10042012-09-11 Alan Modra <amodra@gmail.com>
1005
1006 PR gold/14566
1007 * layout.cc (Layout::set_segment_offsets): When using
1008 common-page-size alignment, ensure we are on a new max-page-size
1009 page.
1010 * output.cc (Output_segment::set_section_addresses): Use
1011 abi_pagesize, not common_pagesize for relro boundary.
1012 (Output_segment::set_offset): Likewise.
1013
bd73a62d
AM
10142012-09-11 Alan Modra <amodra@gmail.com>
1015
1016 * output.h (Output_data_got::add_global_tls, add_local_tls,
1017 add_local_tls_pair): New functions.
1018 (Output_data_got::add_local_pair_with_rel): Remove second
1019 reloc param. Expand comment.
1020 (Output_data_got::Got_entry): Rename use_plt_offset_ to
1021 use_plt_or_tls_offset_, similarly for constructor param.
1022 (Output_data_got::Got_entry::write): Add got_index param.
1023 * output.cc (Output_data_got::add_global_tls, add_local_tls,
1024 add_local_tls_pair): New functions.
1025 (Output_data_got::Got_entry::write): Handle tls symbols
1026 with use_plt_or_tls_offset_ set specially.
1027 (Output_data_got::add_local_pair_with_rel): Only one reloc.
1028 (Output_data_got::do_write): Replace iterator with index, pass
1029 index to entry write function.
1030 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
1031 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
1032 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
1033 call.
1034 * i386.cc (Target_i386::Scan::local): Likewise.
1035 * sparc.cc (Target_sparc::Scan::local): Likewise.
1036 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
1037 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
1038 do_tls_offset_for_global): New functions.
1039 (Target_powerpc::Scan::local): Correct TLS relocations and got
1040 entry values.
1041 (Target_powerpc::Scan::global): Don't emit unnecessary
1042 dynamic relocations on TLS GOT entries.
1043
00716ab1
AM
10442012-09-10 Matthias Klose <doko@ubuntu.com>
1045
1046 * config.in: Disable sanity check for kfreebsd.
1047
c891b3f9
SA
10482012-09-10 Sterling Augustine <saugustine@google.com>
1049
1050 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
1051 (Gdb_index::pubtypes_read): New parameter.
1052 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
1053 to calls.
1054 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
1055 pubtypes_object_.
1056
e81fea4d
AM
10572012-09-09 Alan Modra <amodra@gmail.com>
1058
1059 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
1060 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
1061 * gc.h (gc_process_relocs): Call target gc_add_reference.
1062 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
1063 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
1064 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
1065 unnecessary cast.
1066 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
1067 to cater for when we don't need code offset. Update use.
1068 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
1069 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
1070 set_opd_valid): New functions.
1071 (Target_powerpc::do_gc_add_reference): New function.
1072 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
1073 stashed refs.
1074 (Target_powerpc::do_gc_mark_symbol): New function.
1075
d2d60eef
CC
10762012-09-06 Cary Coutant <ccoutant@google.com>
1077
1078 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
1079 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
1080 (Dwarf_die::skip_attributes): Likewise.
1081 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
1082 * testsuite/gdb_index_test.cc (inline_func_1): New function.
1083 (main): Call it.
1084 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
1085
32ed4573
L
10862012-09-05 H.J. Lu <hongjiu.lu@intel.com>
1087
1088 * testsuite/script_test_3.t: Add .got.plt output section
1089 statement.
1090 * testsuite/script_test_4.t: Likewise.
1091
f4baf0d4
AM
10922012-09-05 Alan Modra <amodra@gmail.com>
1093
1094 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
1095 update all uses and lose "enum" when using type.
1096
864a1b56
AM
10972012-09-05 Alan Modra <amodra@gmail.com>
1098
1099 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
1100 * configure: Regenerate.
1101 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
1102 (plugin_final_layout.stdout): Likewise.
1103 (memory_test): Set page sizes to 0x1000.
1104 * testsuite/Makefile.in: Regenerate.
1105 * testsuite/discard_locals_test.sh: Add FIXME comment.
1106 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
1107 * testsuite/pr14265.t: Add .got output section statement.
1108 * testsuite/script_test_2.t: Likewise.
1109 * testsuite/script_test_3.t: Likewise.
1110 * testsuite/script_test_4.t: Likewise.
1111 * testsuite/script_test_5.t: Likewise.
1112 * testsuite/script_test_6.t: Likewise.
1113 * testsuite/script_test_7.t: Likewise.
1114 * testsuite/script_test_9.t: Likewise.
1115
3ea0a085
AM
11162012-09-05 Alan Modra <amodra@gmail.com>
1117
1118 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
1119 (Powerpc_relocate_functions::Status): New typedef.
1120 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
1121 (Target_powerpc::Scan::local): Handle REL64.
1122 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
1123 for REL32 and REL64.
1124 (Target_powerpc::symval_for_branch): New function, extracted from..
1125 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
1126 checks. Report overflow errors.
1127
7404fe1b
AM
11282012-09-05 Alan Modra <amodra@gmail.com>
1129
1130 * object.h (Sized_relobj_file::emit_relocs): Delete.
1131 (Sized_relobj_file::emit_relocs_reltype): Delete.
1132 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
1133 relocate_relocs for --emit-relocs.
1134 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
1135 * output.h: Update comment.
1136 (Output_segment::first_section): New function.
1137 (Output_segment::first_section_load_address): Use first_section.
1138 * output.cc (Output_segment::first_section): New function extracted..
1139 (Output_segment::first_section_load_address): ..from here. Delete.
1140 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
1141 * target.h (Sized_target::relocate_for_relocatable): Likewise.
1142 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
1143 adjust call to target.h function.
1144 * i386.cc (Target_i386): Likewise.
1145 * sparc.cc (Target_sparc): Likewise.
1146 * x86_64.cc (Target_x86_64): Likewise.
1147 * powerpc.cc (Target_powerpc): Likewise.
1148 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
1149 first tls section has section symbol for optimised local dynamic
1150 output relocs.
1151 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
1152 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
1153 optimised tls code.
1154 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
1155 Rename to relocate_relocs. Update error message.
1156
957564c9
AS
11572012-09-04 Andreas Schwab <schwab@linux-m68k.org>
1158
1159 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
1160 --just-symbols.
1161
dd93cd0a
AM
11622012-08-31 Alan Modra <amodra@gmail.com>
1163
1164 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
1165 (Powerpc_relobj::toc_base_offset): New stub function.
1166 (Target_powerpc): Add tp_offset, dtp_offset. Rename
1167 got_mod_index_offset to tlsld_got_offset. Update all refs.
1168 (Target_powerpc::Relocate::enum skip_tls): New.
1169 (Target_powerpc::call_tls_get_addr_): New var.
1170 (Target_powerpc::is_branch_reloc): Move to file scope.
1171 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
1172 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
1173 New functions.
1174 (Target_powerpc::enum Got_type): Delete old values, add new ones.
1175 (powerpc_info): Correct common_pagesize for ppc64.
1176 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
1177 (Powerpc_relocate_functions): Add overflow check enums and functions.
1178 Add non-shift version of rela, rela_ua. Delete all rel public
1179 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
1180 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
1181 addr16_ha3, addr14 functions.
1182 (Output_data_got_powerpc::add_constant_pair): New function.
1183 (Output_data_got_powerpc::got_base_offset): Likewise.
1184 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
1185 (instruction constants): Sort, add some more.
1186 (Output_data_glink::do_write): Add and use Address typedef. Use
1187 object->toc_base_offset() stub for 64-bit.
1188 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
1189 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
1190 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
1191 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
1192 Always treat .opd relocs as against locally defined symbol.
1193 Correct condition for RELATIVE relocs.
1194 (Target_powerpc::do_finalize_sections): Test for NULL sections.
1195 (Target_powerpc::Relocate::relocate): Use plt call stub as value
1196 for 32-bit syms with a plt entry. Correct ppc64 toc base
1197 calculations. Handle TLS relocs, and more. Add overflow
1198 checking and adjust for Powerpc_relocate_functions changes.
1199 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
1200 Reinstate --emit-relocs code with FIXME.
1201
a1373b60
AM
12022012-08-30 Alan Modra <amodra@gmail.com>
1203
1204 * layout.cc (Layout::set_segment_offsets): Set p_align to
1205 abi_pagesize, not common_pagesize.
1206 (Layout::relaxation_loop_body): Similarly use abi_pagesize
1207 to determine whether file header can go in segment.
1208
703d02da
AM
12092012-08-30 Alan Modra <amodra@gmail.com>
1210
1211 * output.h (Output_reloc::Output_reloc <output section>): Add
1212 is_relative param. Adjust calls.
1213 (Output_reloc::add_output_section_relative): New functions.
1214 * output.cc (Output_reloc::Output_reloc <output section>): Handle
1215 is_relative.
1216 (Output_reloc::symbol_value): Handle SECTION_CODE.
1217
16164a6b
ST
12182012-08-24 Sriraman Tallam <tmsriram@google.com>
1219
1220 * gold.cc (queue_middle_tasks): Call layout again when unique
1221 segments for sections is desired.
1222 * layout.cc (Layout::Layout): Initialize new members.
1223 (Layout::get_output_section_flags): New function.
1224 (Layout::choose_output_section): Call get_output_section_flags.
1225 (Layout::layout): Make output section for mapping to a unique segment.
1226 (Layout::insert_section_segment_map): New function.
1227 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 1228 output sections marked so.
16164a6b
ST
1229 (Layout::segment_precedes): Check for unique segments when sorting.
1230 * layout.h (Layout::Unique_segment_info): New struct.
1231 (Layout::Section_segment_map): New typedef.
1232 (Layout::insert_section_segment_map): New function.
1233 (Layout::get_output_section_flags): New function.
1234 (Layout::is_unique_segment_for_sections_specified): New function.
1235 (Layout::set_unique_segment_for_sections_specified): New function.
1236 (Layout::unique_segment_for_sections_specified_): New member.
1237 (Layout::section_segment_map_): New member.
1238 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
1239 Rename is_gc_pass_one to is_pass_one.
1240 Rename is_gc_pass_two to is_pass_two.
1241 Rename is_gc_or_icf to is_two_pass.
1242 Check for which pass based on whether symbols data is present.
1243 Make it two pass when unique segments for sections is desired.
1244 * output.cc (Output_section::Output_section): Initialize new
1245 members.
1246 * output.h (Output_section::is_unique_segment): New function.
1247 (Output_section::set_is_unique_segment): New function.
1248 (Output_section::is_unique_segment_): New member.
1249 (Output_section::extra_segment_flags): New function.
1250 (Output_section::set_extra_segment_flags): New function.
1251 (Output_section::extra_segment_flags_): New member.
1252 (Output_section::segment_alignment): New function.
1253 (Output_section::set_segment_alignment): New function.
1254 (Output_section::segment_alignment_): New member.
1255 (Output_segment::Output_segment): Initialize is_unique_segment_.
1256 (Output_segment::is_unique_segment): New function.
1257 (Output_segment::set_is_unique_segment): New function.
1258 (Output_segment::is_unique_segment_): New member.
1259 * plugin.cc (allow_unique_segment_for_sections): New function.
1260 (unique_segment_for_sections): New function.
1261 (Plugin::load): Add new functions to transfer vector.
1262 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
1263 * Makefile.in: Regenerate.
1264 * testsuite/plugin_final_layout.sh: Check if unique segment
1265 functionality works.
1266 * testsuite/plugin_section_order.c (onload): Check if new interfaces
1267 are available.
1268 (allow_unique_segment_for_sections): New global.
1269 (unique_segment_for_sections): New global.
1270 (claim_file_hook): Call allow_unique_segment_for_sections.
1271 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 1272
1e2bee4f
CC
12732012-08-22 Cary Coutant <ccoutant@google.com>
1274
1275 * layout.cc (Layout::include_section): Don't assert on GROUP
1276 sections with --emit-relocs.
1277
1d5dfe78
CC
12782012-08-21 Cary Coutant <ccoutant@google.com>
1279
1280 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
1281 if --export-dynamic-symbol names an undef symbol.
1282
c9269dff
AM
12832012-08-18 Alan Modra <amodra@gmail.com>
1284
1285 * powerpc.cc: Formatting and white space.
1286 (Powerpc_relobj): Rename got2_section_ to special_.
1287 Add opd_ent_shndx_ and opd_ent_off_ vectors.
1288 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
1289 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
1290 (Target_powerpc): Add Address typedef and invalid_address. Use
1291 throughout.
1292 (Target_powerpc::is_branch_reloc): New function.
1293 (Powerpc_relocate_functions): Add Address typedef, use throughout.
1294 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
1295 for dst_mask, value and addend.
1296 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
1297 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
1298 (Output_data_glink::do_write): Correct toc base. Don't try to use
1299 uint16_t for 24-bit offset. Use get_output_section_offset and
1300 check return.
1301 (Target_powerpc::Scan::local): Handle more relocs.
1302 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
1303 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
1304 Plug in toc restoring insn after plt calls. Translate branches
1305 to function descriptor symbols to corresponding entry point.
1306 (Target_powerpc::relocate_for_relocatable): Check return from
1307 get_output_section_offset.
1308 * symtab.h: Comment typo.
1309
b1759dce
ILT
13102012-08-14 Ian Lance Taylor <iant@google.com>
1311
1312 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
1313 unsupported_relocal_local to call unsupported_reloc_global.
1314
b9b2ae8b
NC
13152012-08-14 Nick Clifton <nickc@redhat.com>
1316
1317 PR ld/14265
1318 * script-sections.cc (Sections_element::output_section_name): Add
1319 keep return parameter.
1320 (Output_section_element::match_name): Add keep return parameter.
1321 Return the value of the keep_ member.
1322 * script-sections.h (class Output_section): Update
1323 output_section_name prototype.
1324 * layout.cc (Layout::keep_input_section): New public member
1325 function.
1326 (Layout::choose_output_section): Pass keep parameter to
1327 output_section_name.
1328 * layout.h (class Layout): Add keep_input_section.
1329 * object.cc (Sized_relobj_file::do_layout): Check for kept input
1330 sections.
1331 * testsuite/Makefile.am: Add a test.
1332 * testsuite/Makefile.in: Regenerate.
1333 * testsuite/pr14265.c: Source file for the test.
1334 * testsuite/pr14265.t: Linker script for the test.
1335 * testsuite/pr14265.sh: Shell script for the test.
1336
921b5322
AM
13372012-08-14 Alan Modra <amodra@gmail.com>
1338
1339 * target.h (Target::output_section_name): New function.
1340 (Target::do_output_section_name): New function.
1341 * layout.cc (Layout::choose_output_section): Call the above.
1342 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
1343
6ce78956
AM
13442012-08-14 Alan Modra <amodra@gmail.com>
1345
1346 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
1347 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
1348 for replace_constant call.
1349 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
1350 (Output_data_glink::do_print_to_mapfile): New function.
1351 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
1352 (Target_powerpc::Relocate::relocate): Likewise.
1353
d1a8cabd
AM
13542012-08-14 Alan Modra <amodra@gmail.com>
1355
1356 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
1357 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
1358 (Output_data_glink::add_entry,find_entry): Remove shndx param.
1359 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
1360 all references to shndx_. Handle special case for R_PPC_PLTREL24
1361 here.
1362 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
1363 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
1364 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
1365 here.
1366 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
1367 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
1368
d83ce4e3
AM
13692012-08-12 Alan Modra <amodra@gmail.com>
1370
1371 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
1372 (glink insn constants): Use uint32_t.
1373 (Output_data_glink::add_entry): Use insert, not [] operator.
1374
cf43a2fe
AM
13752012-08-11 Alan Modra <amodra@gmail.com>
1376
1377 * object.h (Sized_relobj_file::find_shdr): New function.
1378 (Sized_relobj_file::find_special_sections): New function.
1379 * object.cc (Sized_relobj_file::find_shdr): New function.
1380 (Sized_relobj_file::find_eh_frame): Use find_shdr.
1381 (Sized_relobj_file::find_special_sections): New function, split out..
1382 (Sized_relobj_file::do_read_symbols): ..from here.
1383 * output.h (Output_data_got::replace_constant): New function.
1384 (Output_data_got::num_entries): New function.
1385 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
1386 (Output_data_got::got_offset): Protected rather than private.
1387 (Output_data_got::replace_got_entry): New function.
1388 * output.cc (Output_data_got::replace_got_entry): New function.
1389 * powerpc.cc (class Powerpc_relobj): New.
1390 (class Powerpc_relocate_functions): Delete all psymval variants or
1391 convert to value,addend type. Delete pcrela, pcrela_unaligned.
1392 Implement _ha functions using corresponding _hi function.
1393 (Powerpc_relobj::find_special_sections): New function.
1394 (Target_powerpc::do_make_elf_object): New function.
1395 (class Output_data_got_powerpc): New.
1396 (class Output_data_glink): New.
1397 (class Powerpc_scan_relocatable_reloc): New.
1398 Many more changes througout file.
1399
3c892704
NC
14002012-08-09 Nick Clifton <nickc@redhat.com>
1401
1402 * po/vi.po: Updated Vietnamese translation.
1403
82435b3b
ILT
14042012-08-07 Ian Lance Taylor <iant@google.com>
1405
1406 * layout.cc (Layout::add_target_dynamic_tags): If
1407 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
1408 plt_rel.
1409
a6dc81d2
NC
14102012-07-30 Nick Clifton <nickc@redhat.com>
1411
1412 * po/gold.pot: Updated template.
1413 * po/es.po: Updated Spanish translation.
1414
f1415016
CC
14152012-07-18 Cary Coutant <ccoutant@google.com>
1416
1417 PR gold/14344
1418 * configure.ac: Add check for -gpubnames support.
1419 * configure: Regenerate.
1420 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
1421 support; force -gno-pubnames.
1422 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
1423 support.
1424 (gdb_index_test_4): New test.
1425 * testsuite/Makefile.in: Regenerate.
1426 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
1427 * testsuite/gdb_index_test_2.sh: Likewise.
1428 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
1429 * testsuite/gdb_index_test_4.sh: New script.
1430 * testsuite/gdb_index_test_comm.sh: New script with common code;
1431 don't look for space after colon.
1432
b7fd7c37
ST
14332012-07-16 Sriraman Tallam <tmsriram@google.com>
1434
1435 * gold.cc (queue_middle_tasks): Update function order only after
1436 deferred objects due to plugins are processed.
1437
1f3212db
ILT
14382012-07-11 Ian Lance Taylor <iant@google.com>
1439
1440 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
1441 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
1442 (Target_arm::scan_reloc_for_stub): Likewise.
1443 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
1444 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
1445 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
1446 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
1447 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
1448
81c82a68
ILT
14492012-07-10 Dodji Seketeli <dodji@redhat.com>
1450 Ian Lance Taylor <iant@google.com>
1451
1452 PR gold/14309
1453 * configure.ac: Test whether std::tr1::hash<off_t> works.
1454 * gold.h: Add a specialization for std::tr1::hash<off_t> if
1455 needed.
1456 * output.h (class Output_fill): Add virtual destructor.
1457 * configure, config.in: Rebuild.
1458
eabc84f4
RM
14592012-06-22 Roland McGrath <mcgrathr@google.com>
1460
1461 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
1462
370e30b6
RÁE
14632012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
1464
1465 * plugin.cc (Plugin::load): Handle position independent executables.
1466
fb1b895d
CC
14672012-06-06 Cary Coutant <ccoutant@google.com>
1468
1469 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
1470 add .debug_macro.
1471 (lines_only_debug_sections): Likewise.
1472 (gdb_fast_lookup_sections): New static array.
1473 (is_gdb_debug_section): Rename formal parameter.
1474 (is_lines_only_debug_section): Likewise.
1475 (is_gdb_fast_lookup_section): New function.
1476 (Layout::include_section): Check for ".zdebug_" prefix; pass
1477 section name suffix to is_gdb_debug_section, et al.; check for
1478 fast-lookup sections when building .gdb_index.
1479 * options.h (--strip-debug-gdb): Update GDB version number.
1480
7c0640fa
CC
14812012-06-06 Cary Coutant <ccoutant@google.com>
1482
1483 * configure.ac: Add check for fallocate.
1484 * configure: Regenerate.
1485 * config.in: Regenerate.
1486
1487 * options.h (class General_options): Add --mmap-output-file and
1488 --posix-fallocate options.
1489 * output.cc: (posix_fallocate): Remove; replace with...
1490 (gold_fallocate): New function.
1491 (Output_file::map_no_anonymous): Call gold_fallocate.
1492 (Output_file::map): Check --mmap-output-file option.
1493
2a49eb69
DK
14942012-06-05 Jing Yu <jingyu@google.com>
1495
1496 * gold.h (textdomain): Add do {} to empty while(0).
1497 (bindtextdomain): Likewise.
1498
fad072ac
CC
14992012-06-04 Cary Coutant <ccoutant@google.com>
1500
1501 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
1502 has_dynsym_index.
1503
8cc69fb6
ST
15042012-05-25 Sriraman Tallam <tmsriram@google.com>
1505
1506 * symtab.cc (Symbol_table::define_special_symbol):
1507 Initialize *poldsym to prevent uninitialized variable errors.
1508
1be75daa
CC
15092012-05-23 Cary Coutant <ccoutant@google.com>
1510
1511 * layout.cc (Layout::section_name_mapping): Add rules to handle
1512 exact match on .data.rel.ro.local or .data.rel.ro.
1513 (Layout::output_section_name): Check for exact matches.
1514
9b689de0
CC
15152012-05-23 Cary Coutant <ccoutant@google.com>
1516
1517 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
1518 more carefully.
1519
b24fdbf5
CC
15202012-05-22 Cary Coutant <ccoutant@google.com>
1521
1522 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
1523 object before exporting symbol.
1524
e550e1a2
L
15252012-05-21 H.J. Lu <hongjiu.lu@intel.com>
1526
1527 * testsuite/tls_test.cc: Include "config.h" first.
1528 * testsuite/tls_test_c.c: Likewise.
1529
df7b86aa
NC
15302012-05-17 Daniel Richard G. <skunk@iskunk.org>
1531 Nick Clifton <nickc@redhat.com>
1532
1533 PR 14072
1534 * configure.in: Add check that sysdep.h has been included before
1535 any system header files.
1536 * configure: Regenerate.
1537 * config.in: Regenerate.
1538
1007b503
CC
15392012-05-14 Cary Coutant <ccoutant@google.com>
1540
1541 * layout.cc (Layout::make_output_section): Mark .tdata section
1542 as RELRO.
1543 * testsuite/relro_test.cc: Add a TLS variable.
1544
fd885f3a
L
15452012-05-10 H.J. Lu <hongjiu.lu@intel.com>
1546
1547 PR gold/14091
1548 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
1549 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
1550 R_X86_64_64.
1551
80f5885c
CC
15522012-05-08 Cary Coutant <ccoutant@google.com>
1553
1554 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
1555 (lines_only_debug_sections): Likewise.
1556
2e702c99
RM
15572012-05-02 Roland McGrath <mcgrathr@google.com>
1558
1559 * nacl.cc: New file.
1560 * nacl.h: New file.
1561 * Makefile.am (CCFILES, HFILES): Add them.
1562 * Makefile.in: Regenerate.
1563 * i386.cc (Output_data_plt_i386_nacl): New class.
1564 (Output_data_plt_i386_nacl_exec): New class.
1565 (Output_data_plt_i386_nacl_dyn): New class.
1566 (Target_i386_nacl): New class.
1567 (Target_selector_i386_nacl): New class.
1568 (target_selector_i386): Use it instead of Target_selector_i386.
1569 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
1570 (Target_x86_64_nacl): New class.
1571 (Target_selector_x86_64_nacl): New class.
1572 (target_selector_x86_64, target_selector_x32): Use it instead of
1573 Target_selector_x86_64.
1574 * arm.cc (Output_data_plt_arm_nacl): New class.
1575 (Target_arm_nacl): New class.
1576 (Target_selector_arm_nacl): New class.
1577 (target_selector_arm, target_selector_armbe): Use it instead of
1578 Target_selector_arm.
1579
1580 * target-select.cc (select_target): Take new Input_file* and off_t
1581 arguments, pass them on to recognize method of selector.
1582 * object.cc (make_elf_sized_object): Update caller.
1583 * parameters.cc (parameters_force_valid_target): Likewise.
1584 * incremental.cc (make_sized_incremental_binary): Likewise.
1585 * target-select.h: Update decl.
1586 (Target_selector::recognize): Take new Input_file* argument,
1587 pass it on to do_recognize.
1588 (Target_selector::do_recognize): Take new Input_file* argument.
1589 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
1590 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
1591 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
1592 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
1593
1594 * target.h (Target::Target_info): New members isolate_execinstr
1595 and rosegment_gap.
1596 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
1597 * arm.cc (Target_arm::arm_info): Update initializer.
1598 * i386.cc (Target_i386::i386_info): Likewise.
1599 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
1600 * sparc.cc (Target_sparc::sparc_info): Likewise.
1601 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
1602 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1603 * layout.cc (Layout::attach_allocated_section_to_segment):
1604 Take new const Target* argument. If target->isolate_execinstr(), act
1605 like --rosegment.
1606 (Layout::find_first_load_seg): Take new const Target* argument;
1607 if target->isolate_execinstr(), reject PF_X segments.
1608 (Layout::relaxation_loop_body): Update caller.
1609 (Layout::set_segment_offsets): If target->isolate_execinstr(),
1610 reset file offset to zero when we hit LOAD_SEG, and then do a second
1611 loop over the segments before LOAD_SEG to reassign offsets after
1612 addresses have been determined. Handle target->rosegment_gap().
1613 (Layout::attach_section_to_segment): Take new const Target* argument;
1614 pass it to attach_allocated_section_to_segment.
1615 (Layout::make_output_section): Update caller.
1616 (Layout::attach_sections_to_segments): Take new const Target* argument;
1617 pass it to attach_section_to_segment.
1618 * gold.cc (queue_middle_tasks): Update caller.
1619 * layout.h (Layout): Update method decls with new arguments.
1620
1621 * arm.cc (Target_arm::Target_arm): Take optional argument for the
1622 Target_info pointer to use.
1623 (Target_arm::do_make_data_plt): New virtual method.
1624 (Target_arm::make_data_plt): New method that calls it.
1625 (Target_arm::make_plt_entry): Use it.
1626 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
1627 for the section alignment.
1628 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
1629 method.
1630 (Output_data_plt_arm::first_plt_entry_offset): Call it.
1631 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
1632 method.
1633 (Output_data_plt_arm::get_plt_entry_size): Call it.
1634 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
1635 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
1636 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
1637 method.
1638 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
1639 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
1640 method instead of sizeof(plt_entry).
1641 (Output_data_plt_arm::add_entry): Likewise.
1642 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
1643 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
1644 than static method.
1645 (Target_arm::plt_entry_size): Likewise.
1646 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
1647 Move to ...
1648 (Output_data_plt_arm_standard): ... here, new class.
1649 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
1650 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
1651 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
1652
1653 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
1654 Take additional argument for the PLT entry size.
1655 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
1656 Use get_plt_entry_size method rather than plt_entry_size variable.
1657 (Output_data_plt_x86_64::reserve_slot): Likewise.
1658 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
1659 (Output_data_plt_x86_64::add_entry): Likewise.
1660 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
1661 (Output_data_plt_x86_64::address_for_global): Likewise.
1662 (Output_data_plt_x86_64::address_for_local): Likewise.
1663 (Output_data_plt_x86_64::set_final_data_size): Likewise.
1664 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
1665 Make method non-static.
1666 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
1667 method.
1668 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
1669 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
1670 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
1671 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
1672 virtual method.
1673 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
1674 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
1675 virtual method.
1676 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
1677 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
1678 virtual method.
1679 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
1680 (Output_data_plt_x86_64::plt_entry_size)
1681 (Output_data_plt_x86_64::first_plt_entry)
1682 (Output_data_plt_x86_64::plt_entry)
1683 (Output_data_plt_x86_64::tlsdesc_plt_entry)
1684 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
1685 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
1686 (Output_data_plt_x86_64_standard): ... here, new class.
1687 (Target_x86_64::Target_x86_64): Take optional argument for the
1688 Target_info pointer to use.
1689 (Target_x86_64::do_make_data_plt): New virtual method.
1690 (Target_x86_64::make_data_plt): New method to call it.
1691 (Target_x86_64::init_got_plt_for_update): Use that.
1692 Call this->plt_->add_eh_frame method here.
1693 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
1694 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
1695 rather than static method.
1696 (Target_x86_64::plt_entry_size): Likewise.
1697 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
1698 rather than plt_entry_size variable. Move guts of PLT filling to...
1699 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
1700 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
1701 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
1702
1703 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
1704 additional argument for the section alignment.
1705 Don't do add_eh_frame_for_plt here.
1706 (Output_data_plt_i386::first_plt_entry_offset): Make the method
1707 non-static. Use get_plt_entry_size method rather than plt_entry_size
1708 variable.
1709 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
1710 method.
1711 (Output_data_plt_i386::get_plt_entry_size): Call it.
1712 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
1713 (Output_data_plt_i386::add_eh_frame): New method to call it.
1714 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
1715 method.
1716 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
1717 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
1718 method.
1719 (Output_data_plt_i386::fill_plt_entry): New method to call it.
1720 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
1721 method instead of plt_entry_size.
1722 (Output_data_plt_i386::plt_entry_size)
1723 (Output_data_plt_i386::plt_eh_frame_fde_size)
1724 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
1725 (Output_data_plt_i386_standard): ... here, new class.
1726 (Output_data_plt_i386_exec): New class.
1727 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
1728 (Output_data_plt_i386_exec::first_plt_entry): ... here.
1729 (Output_data_plt_i386::exec_plt_entry): Move to ...
1730 (Output_data_plt_i386_exec::plt_entry): ... here.
1731 (Output_data_plt_i386_dyn): New class.
1732 (Output_data_plt_i386::first_plt_entry): Move to ...
1733 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
1734 (Output_data_plt_i386::dyn_plt_entry): Move to ...
1735 (Output_data_plt_i386_dyn::plt_entry): ... here.
1736 (Target_i386::Target_i386): Take optional argument for the Target_info
1737 pointer to use.
1738 (Target_i386::do_make_data_plt): New virtual method.
1739 (Target_i386::make_data_plt): New method to call it.
1740 (Target_i386::make_plt_section): Use that.
1741 Call this->plt_->add_eh_frame method here.
1742 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
1743 rather than plt_entry_size variable.
1744 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
1745 (Output_data_plt_i386::address_for_local): Likewise.
1746 (Output_data_plt_i386::do_write): Likewise.
1747 Move guts of PLT filling to...
1748 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
1749 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
1750 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
1751 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
1752
b9b9f2ee
CC
17532012-05-01 Cary Coutant <ccoutant@google.com>
1754
1755 * dwarf_reader.cc (Dwarf_die::read_attributes)
1756 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
1757 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
1758 * reduced_debug_output.cc
1759 (Output_reduced_debug_info_section::get_die_end): Remove
1760 DW_FORM_GNU_ref_index. Add default case.
1761
57923f48
MW
17622012-04-26 Mark Wielaard <mjw@redhat.com>
1763
1764 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
1765 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
1766 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
1767 DW_AT_high_pc as offset from DW_AT_low_pc.
1768
1769 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
1770 * testsuite/Makefile.in: Regenerate.
1771 * testsuite/gdb_index_test_3.c: New test source file.
1772 * testsuite/gdb_index_test_3.sh: New test source file.
1773
2c54b4f4
ILT
17742012-04-25 Ian Lance Taylor <iant@google.com>
1775
1776 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
1777 pointer.
1778 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
1779 as a class, not a struct.
1780 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
1781 (Target_arm::apply_cortex_a8_workaround): Likewise.
1782 * gc.h: Declare Reloc_types as a struct, not a class.
1783 * object.h: Declare Symbols_data as a struct.
1784 * reloc.h: Declare Read_relocs_data as a struct.
1785 * target.h: Declare Relocate_info as a struct.
1786
a5a5f7a3
DM
17872012-04-24 David S. Miller <davem@davemloft.net>
1788
1789 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
1790 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
1791 and R_SPARC_WPLT30.
1792
f038d496
CC
17932012-04-24 Cary Coutant <ccoutant@google.com>
1794
1795 * incremental-dump.cc (find_input_containing_global): Replace
1796 magic number with symbolic constant.
1797 (dump_incremental_inputs): Update version number.
1798 * incremental.cc (Output_section_incremental_inputs): Update version
1799 number; import symbolic constants from Incremental_inputs_reader.
1800 (Incremental_inputs::create_data_sections): Align relocations
1801 section correctly for 64-bit targets.
1802 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
1803 constants; add padding.
1804 (Output_section_incremental_inputs::write_header): Add assert for
1805 header_size.
1806 (Output_section_incremental_inputs::write_input_files): Add assert
1807 for input_entry_size.
1808 (Output_section_incremental_inputs::write_info_blocks): Add padding;
1809 add assert for object_info_size, input_section_entry_size,
1810 global_sym_entry_size.
1811 * incremental.h (Incremental_inputs_reader): Add symbolic constants
1812 for data structure sizes; use them.
1813 (Incremental_input_entry_reader): Import symbolic constants from
1814 Incremental_inputs_reader; use them.
1815
a4d85145
DM
18162012-04-23 David S. Miller <davem@davemloft.net>
1817
1818 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
1819 and elf_flags_set_.
1820 (Target_sparc::Target_sparc): Initialize new fields.
1821 (Target_sparc::do_make_elf_object): New function.
1822 (Target_sparc::do_adjust_elf_header): New function.
1823
1d509098
CC
18242012-04-23 Cary Coutant <ccoutant@google.com>
1825
1826 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
1827 CU range table of gdb index.
1828
7ebeff7f
DM
18292012-04-20 David S. Miller <davem@davemloft.net>
1830
1831 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
1832 instead of false.
1833
13cf9988
DM
18342012-04-16 David S. Miller <davem@davemloft.net>
1835
2a1079e8
DM
1836 * sparc.cc (Target_sparc::got_address): New function.
1837 (Sparc_relocate_functions::gdop_hix22): New function.
1838 (Sparc_relocate_functions::gdop_lox10): New function.
1839 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
1840 relocs.
1841 (Target_sparc::Scan::local): Likewise if the global symbol is not
1842 preemptible and is not IFUNC.
1843 (Target_sparc::Relocate::relocate): Perform GOTDATA code
1844 transformations for local and non-preemptible non-IFUNC global
1845 symbols.
1846
0bc964fc
DM
1847 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
1848 writing out 64-bit part of ranges.
1849
661d7a80
DM
1850 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
1851 -fpic and -fpie respectively.
1852 * Makefile.in: Regenerate.
1853
8c2bf391
DM
1854 * sparc.cc (class Target_sparc): Add rela_ifunc_.
1855 (Target_sparc::Target_sparc): Initialize new field.
1856 (Target_sparc::do_plt_section_for_global): New function.
1857 (Target_sparc::do_plt_section_for_local): New function.
1858 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
1859 (Target_sparc::make_plt_section): New function, broken out of
1860 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
1861 (Target_sparc::make_plt_entry): Call make_plt_section.
1862 (Target_sparc::make_local_ifunc_plt_entry): New function.
1863 (Target_sparc::rela_ifunc_section): New function.
1864 (Target_sparc::plt_section): Remove const.
1865 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
1866 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
1867 and ifunc_count_ fields.
1868 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
1869 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
1870 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
1871 (Output_data_plt_sparc::rela_ifunc): New function.
1872 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
1873 (Output_data_plt_sparc::has_ifunc_section): New function.
1874 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
1875 (Output_data_plt_sparc::address_for_global): New function.
1876 (Output_data_plt_sparc::address_for_local): New function.
1877 (Output_data_plt_sparc::plt_index_to_offset): New function.
1878 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
1879 and entry_count.
1880 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
1881 entry_count.
1882 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
1883 R_SPARC_JMP_IREL to switch.
1884 (Target_sparc::Scan::check_non_pic): Likewise.
1885 (Target_sparc::Scan::local): Handle IFUNC symbols.
1886 (Target_sparc::Scan::local): Likewise.
1887 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
1888 and plt_address_for_local.
1889 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
1890 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
1891
13cf9988
DM
1892 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
1893 (class Output_data_reloc): Adjust calls to Output_reloc_type.
1894 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
1895 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
1896 global relocs too.
1897 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
1898 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
1899 calls.
1900 * sparc.cc (Target_sparc::Scan::global): Likewise.
1901 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
1902
31821be0
CC
19032012-04-16 Cary Coutant <ccoutant@google.com>
1904
1905 * archive.cc (Library_base::should_include_member): Check for
1906 --export-dynamic-symbol.
1907 * options.h (class General_options): Add --export-dynamic-symbol.
1908 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
1909 --export-dynamic-symbol.
1910 (Symbol_table::gc_mark_undef_symbols): Likewise.
1911 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
1912
2615994e
DM
19132012-04-12 David S. Miller <davem@davemloft.net>
1914
1915 * sparc.cc (Reloc::wdisp10): New relocation method.
1916 (Reloc::h34): Likewise.
1917 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
1918 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
1919 R_SPARC_WDISP10.
1920 (Target_sparc::Scan::local): Likewise.
1921 (Target_sparc::Scan::global): Likewise.
1922 (Target_sparc::Relocate::relocate): Likewise.
1923
6782735d
CC
19242012-04-09 Cary Coutant <ccoutant@google.com>
1925
1926 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
1927 low_pc == 0.
1928
8c7a0b00
ILT
19292012-04-06 Ian Lance Taylor <iant@google.com>
1930
1931 * timer.cc: #include <unistd.h>.
1932
58797674
RM
19332012-04-06 Roland McGrath <mcgrathr@google.com>
1934
1935 * configure.in (AC_CHECK_HEADERS): Add locale.h.
1936 * config.in: Regenerate.
1937 * configure: Regenerate.
1938
44350750
NC
19392012-04-05 Nick Clifton <nickc@redhat.com>
1940
1941 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
1942 (AM_LC_MESSAGES): Add.
1943 * aclocal.m4: Regenerate.
1944 * config.in: Regenerate.
1945 * configure: Regenerate.
1946
c1027032
CC
19472012-03-21 Cary Coutant <ccoutant@google.com>
1948
1949 * Makefile.am: Add gdb-index.cc, gdb-index.h.
1950 * Makefile.in: Regenerate.
1951 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
1952 (Sized_elf_reloc_mapper::symbol_section): New function.
1953 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
1954 (make_elf_reloc_mapper): New function.
1955 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
1956 (Dwarf_abbrev_table::do_read_abbrevs): New function.
1957 (Dwarf_abbrev_table::do_get_abbrev): New function.
1958 (Dwarf_ranges_table::read_ranges_table): New function.
1959 (Dwarf_ranges_table::read_range_list): New function.
1960 (Dwarf_pubnames_table::read_section): New function.
1961 (Dwarf_pubnames_table::read_header): New function.
1962 (Dwarf_pubnames_table::next_name): New function.
1963 (Dwarf_die::Dwarf_die): New function.
1964 (Dwarf_die::read_attributes): New function.
1965 (Dwarf_die::skip_attributes): New function.
1966 (Dwarf_die::set_name): New function.
1967 (Dwarf_die::set_linkage_name): New function.
1968 (Dwarf_die::attribute): New function.
1969 (Dwarf_die::string_attribute): New function.
1970 (Dwarf_die::int_attribute): New function.
1971 (Dwarf_die::uint_attribute): New function.
1972 (Dwarf_die::ref_attribute): New function.
1973 (Dwarf_die::child_offset): New function.
1974 (Dwarf_die::sibling_offset): New function.
1975 (Dwarf_info_reader::check_buffer): New function.
1976 (Dwarf_info_reader::parse): New function.
1977 (Dwarf_info_reader::do_parse): New function.
1978 (Dwarf_info_reader::do_read_string_table): New function.
1979 (Dwarf_info_reader::lookup_reloc): New function.
1980 (Dwarf_info_reader::get_string): New function.
1981 (Dwarf_info_reader::visit_compilation_unit): New function.
1982 (Dwarf_info_reader::visit_type_unit): New function.
1983 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
1984 Sized_elf_reloc_mapper.
1985 (Sized_dwarf_line_info::symbol_section): Remove function.
1986 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
1987 (Sized_dwarf_line_info::read_line_mappings): Remove object
1988 parameter, adjust callers.
1989 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
1990 * dwarf_reader.h: Include <sys/types.h>.
1991 (class Track_relocs): Remove forward declaration.
1992 (class Elf_reloc_mapper): New class.
1993 (class Sized_elf_reloc_mapper): New class.
1994 (class Dwarf_abbrev_table): New class.
1995 (class Dwarf_range_list): New class.
1996 (class Dwarf_ranges_table): New class.
1997 (class Dwarf_pubnames_table): New class.
1998 (class Dwarf_die): New class.
1999 (class Dwarf_info_reader): New class.
2000 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
2001 (Sized_dwarf_line_info::symbol_section): Remove member function.
2002 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
2003 base class.
2004 * gdb-index.cc: New source file.
2005 * gdb-index.h: New source file.
2006 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
2007 and .debug_types sections, call Layout::add_to_gdb_index.
2008 (Sized_relobj_incr::do_section_name): Implement.
2009 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
2010 return type; Implement.
2011 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
2012 return type.
2013 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
2014 parameter list and return type.
2015 (Sized_incr_dynobj::do_section_contents): Likewise.
2016 * layout.cc: Include gdb-index.h.
2017 (Layout::Layout): Initialize gdb_index_data_.
2018 (Layout::init_fixed_output_section): Check for .gdb_index section.
2019 (Layout::add_to_gdb_index): New function. Instantiate.
2020 * layout.h: Add forward declaration for class Gdb_index.
2021 (Layout::add_to_gdb_index): New member function.
2022 (Layout::gdb_index_data_): New data member.
2023 * main.cc: Include gdb-index.h.
2024 (main): Print statistics for gdb index.
2025 * object.cc (Object::section_contents): Move code into
2026 do_section_contents.
2027 (need_decompressed_section): Check for sections needed when building
2028 gdb index.
2029 (build_compressed_section_map): Likewise.
2030 (Sized_relobj_file::do_read_symbols): Need local symbols when building
2031 gdb index.
2032 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
2033 sections; call Layout::add_to_gdb_index.
2034 (Sized_relobj_file::do_decompressed_section_contents): Call
2035 do_section_contents directly.
2036 * object.h (Object::do_section_contents): Adjust parameter list and
2037 return type.
2038 (Object::do_decompressed_section_contents): Call do_section_contents
2039 directly.
2040 (Sized_relobj_file::do_section_contents): Adjust parameter list and
2041 return type.
2042 * options.h (class General_options): Add --gdb-index option.
2043 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
2044 list and return type.
2045 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
2046 * reloc.h (Track_relocs::checkpoint): New function.
2047 (Track_relocs::reset): New function.
2048
2049 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
2050 New test cases.
2051 * testsuite/Makefile.in: Regenerate.
2052 * testsuite/gdb_index_test.cc: New test source file.
2053 * testsuite/gdb_index_test_1.sh: New test source file.
2054 * testsuite/gdb_index_test_2.sh: New test source file.
2055
647f1574
DK
20562012-03-19 Doug Kwan <dougkwan@google.com>
2057
2058 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 2059 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
2060 __exidx_start and __exidx_end. Make symbol table parameter
2061 anonymous as it is not used.
2062 * gold.cc (queue_middle_tasks): Call target hook to define any
2063 target-specific symbols.
2064 * target.h (Target::define_standard_symbols): New method.
2065 (Target::do_define_standard_symbols): Same.
2066 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
2067 * testsuite/Makefile.in: Regenerate.
2068 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
2069 and __exidx_end.
2070 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
2071 relocations are generated for __exidx_start and __exidx_end.
2072
7c6109da
DK
20732012-03-16 Doug Kwan <dougkwan@google.com>
2074
2075 * testsuite/Makefile.am: Disable test initpri3b.
2076 * testsuite/Makefile.in: Regenerate.
2077
7b8957f8
DK
20782012-03-15 Doug Kwan <dougkwan@google.com>
2079
2080 * arm.cc (Target_arm::got_section): Make .got section read-only
2081 if -z now is given.
2082
14dc9ef7
ILT
20832012-03-15 Ian Lance Taylor <iant@google.com>
2084
2085 PR gold/13850
2086 * layout.cc (Layout::make_output_section): Correctly mark
2087 SHT_INIT_ARRAY, et. al., as relro.
2088
fa40b62a
DK
20892012-03-14 Doug Kwan <dougkwan@google.com>
2090
2091 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
2092 dynamic relocations for protected symbols in shared objects.
2093
fd325007
ILT
20942012-03-13 Ian Lance Taylor <iant@google.com>
2095
2096 * resolve.cc (Symbol_table::resolve): When merging common symbols,
2097 keep the larger alignment.
2098
e8dd54e1
CC
20992012-03-12 Cary Coutant <ccoutant@google.com>
2100
2101 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
2102 handling of DW_LNE_define_file.
2103
feb5f3b0
CC
21042012-03-12 Cary Coutant <ccoutant@google.com>
2105
2106 * reduced_debug_output.cc
2107 (Output_reduced_debug_info_section::get_die_end): Add new FORM
2108 codes to switch.
2109
a1fb4256
CC
21102012-02-29 Cary Coutant <ccoutant@google.com>
2111
2112 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
2113
5dd8762a
CC
21142012-02-29 Cary Coutant <ccoutant@google.com>
2115
2116 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
2117 Call Object::decompressed_section_contents.
2118 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
2119 New dtor.
2120 (Sized_dwarf_line_info::buffer_start_): New data member.
2121 * merge.cc (Output_merge_data::do_add_input_section): Call
2122 Object::decompressed_section_contents.
2123 (Output_merge_string::do_add_input_section): Likewise.
2124 * object.cc (need_decompressed_section): New function.
2125 (build_compressed_section_map): Decompress sections needed later.
2126 (Sized_relobj_file::do_decompressed_section_contents): New function.
2127 (Sized_relobj_file::do_discard_decompressed_sections): New function.
2128 * object.h (Object::decompressed_section_contents): New function.
2129 (Object::discard_decompressed_sections): New function.
2130 (Object::do_decompressed_section_contents): New function.
2131 (Object::do_discard_decompressed_sections): New function.
2132 (Compressed_section_info): New type.
2133 (Compressed_section_map): Include decompressed section contents.
2134 (Sized_relobj_file::do_decompressed_section_contents): New function.
2135 (Sized_relobj_file::do_discard_decompressed_sections): New function.
2136
7b5de7ee
CC
21372012-02-16 Cary Coutant <ccoutant@google.com>
2138
2139 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
2140 * testsuite/Makefile.in: Regenerate.
2141
f9fa4a63
CC
21422012-02-14 Cary Coutant <ccoutant@google.com>
2143
2144 * options.cc (General_options::finalize): Disallow -pie and -static.
2145
2c175ebc
DK
21462012-02-03 Doug Kwan <dougkwan@google.com>
2147
2148 * arm.cc (Arm_relocate_functions::abs8,
2149 Arm_relocate_functions::abs16): Use
2150 Bits::has_signed_unsigned_overflow32.
2151 (Arm_relocate_functions::thm_abs8): Correct range of
2152 overflow check.
2153 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
2154 in assertions.
2155
90cff06f
DK
21562012-02-02 Doug Kwan <dougkwan@google.com>
2157
2158 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
2159 position independent outputs, not just shared objects.
2160
63887f3d
L
21612012-01-30 H.J. Lu <hongjiu.lu@intel.com>
2162
2163 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
2164 * configure: Regenerated.
2165
bef2b434
ILT
21662012-01-27 Ian Lance Taylor <iant@google.com>
2167
2168 * reloc.h (Bits): New class with static functions, copied from
2169 namespace utils in arm.cc.
2170 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
2171 instead.
2172
c335b55d
L
21732012-01-27 H.J. Lu <hongjiu.lu@intel.com>
2174
2175 * incremental.cc (write_info_blocks): Correct relocation offset.
2176
41194d9f
L
21772012-01-27 H.J. Lu <hongjiu.lu@intel.com>
2178
2179 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
2180 (Relocate::tls_gd_to_le): Likewise.
2181
1bae613c
L
21822012-01-27 H.J. Lu <hongjiu.lu@intel.com>
2183
2184 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
2185
24482ca0
L
21862012-01-27 H.J. Lu <hongjiu.lu@intel.com>
2187
2188 * configure.ac: Check if -mcmodel=medium works.
2189 * configure: Regenerated.
2190
c2c7840a
CC
21912012-01-24 Cary Coutant <ccoutant@google.com>
2192
2193 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
2194 definition and ...
2195 (read_unsigned_LEB_128_x): ... this new function.
2196 (read_signed_LEB_128): Replaced with inline definition and ...
2197 (read_signed_LEB_128_x): ... this new function.
2198 * int_encoding.h (read_unsigned_LEB_128_x): New function.
2199 (read_unsigned_LEB_128): Add inline definition.
2200 (read_signed_LEB_128_x): New function.
2201 (read_signed_LEB_128): Add inline definition.
2202 * testsuite/Makefile.am (leb128_unittest): New unit test.
2203 * testsuite/Makefile.in: Regenerate.
2204 * testsuite/leb128_unittest.cc: New unit test.
2205
833de760 22062012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
2207
2208 PR gold/13617
2209 * i386.cc (Target_i386::do_code_fill): When using a jmp
2210 instruction, pad with nop instructions.
2211 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
2212
618d6666
L
22132012-01-22 H.J. Lu <hongjiu.lu@intel.com>
2214
2215 * x86_64.cc (gc_process_relocs): Add typename on types used in
2216 template.
2217 (scan_relocs): Likewise.
2218 (relocate_section): Likewise.
2219 (apply_relocation): Likewise.
2220
3660ff06
L
22212012-01-10 H.J. Lu <hongjiu.lu@intel.com>
2222
2223 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
2224 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
2225 under x32.
2226
fc51264f
L
22272012-01-09 H.J. Lu <hongjiu.lu@intel.com>
2228
2229 * x86_64.cc: Initial support for x32.
2230
dd74ae06
CC
22312012-01-03 Cary Coutant <ccoutant@google.com>
2232
2233 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
2234 Use abstract base class for GOT.
2235 * gold/output.h (class Output_data_got_base): New abstract base class.
2236 (class Output_data_got): Derive from new base class, adjust ctors.
2237 (Output_data_got::reserve_slot): Make virtual; rename to
2238 do_reserve_slot; Adjust callers.
2239 * gold/target.h (Sized_target::init_got_plt_for_update): Return
2240 pointer to abstract base class.
2241 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
2242
83896202
ILT
22432011-12-18 Ian Lance Taylor <iant@google.com>
2244
2245 * object.h (Relobj::local_symbol_value): New function.
2246 (Relobj::local_plt_offset): New function.
2247 (Relobj::local_has_got_offset): New function.
2248 (Relobj::local_got_offset): New function.
2249 (Relobj::set_local_got_offset): New function.
2250 (Relobj::do_local_symbol_value): New pure virtual function.
2251 (Relobj::do_local_plt_offset): Likewise.
2252 (Relobj::do_local_has_got_offset): Likewise.
2253 (Relobj::do_local_got_offset): Likewise.
2254 (Relobj::do_set_local_got_offset): Likewise.
2255 (Sized_relobj::do_local_has_got_offset): Rename from
2256 local_has_got_offset.
2257 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
2258 (Sized_relobj::do_set_local_got_offset): Rename from
2259 set_local_got_offset.
2260 (Sized_relobj_file::do_local_plt_offset): Rename from
2261 local_plt_offset.
2262 (Sized_relobj_file::do_local_symbol_value): New function.
2263 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
2264 local_plt_offset.
2265 * output.cc (Output_data_got::Got_entry::write): Change object to
2266 Relobj. Use local_symbol_value.
2267 (Output_data_got::add_global_with_rel): Change rel_dyn to
2268 Output_data_reloc_generic*. Use add_global_generic.
2269 (Output_data_got::add_global_with_rela): Remove. Change all
2270 callers to use add_global_with_rel.
2271 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
2272 Output_data_reloc_generic*. Use add_global_generic.
2273 (Output_data_got::add_global_pair_with_rela): Remove. Change all
2274 callers to use add_global_pair_with_rel.
2275 (Output_data_got::add_local): Change object to Relobj*.
2276 (Output_data_got::add_local_plt): Likewise.
2277 (Output_data_got::add_local_with_rel): Change object to Relobj*,
2278 change rel_dyn to Output_data_reloc_generic*. Use
2279 add_local_generic.
2280 (Output_data_got::add_local_with_rela): Remove. Change all
2281 callers to use all_local_with_rel.
2282 (Output_data_got::add_local_pair_with_rel): Change object to
2283 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
2284 add_output_section_generic.
2285 (Output_data_got::add_local_pair_with_rela): Remove. Change all
2286 callers to use add_local_pair_with_rel.
2287 (Output_data_got::reserve_local): Change object to Relobj*.
2288 * output.h: (class Output_data_reloc_generic): Add pure virtual
2289 declarations for add_global_generic, add_local_generic,
2290 add_output_section_generic.
2291 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
2292 functions for Output_data_reloc_generic. Update declarations for
2293 changes listed in output.cc.
2294 (class Output_data_got): Change template parameter to got_size.
2295 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
2296 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
2297 function.
2298 (Sized_relobj_incr::do_local_plt_offset): New function.
2299 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
2300 add_global_generic.
2301
76677ad0
CC
23022011-12-17 Cary Coutant <ccoutant@google.com>
2303
2304 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
2305 * resolve.cc (Symbol_table::resolve): Likewise.
2306 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
2307 arrays.
2308 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
2309
8b8dd8d5
ILT
23102011-12-16 Ian Lance Taylor <iant@google.com>
2311
2312 * output.h (Output_data_reloc_generic::add): Only call
2313 add_dynamic_reloc if this is a dynamic reloc section.
2314
d55525b9
L
23152011-12-15 H.J. Lu <hongjiu.lu@intel.com>
2316
2317 PR gold/13505
2318 * target-reloc.h (apply_relocation): Replace <64, false> with
2319 <size, big_endian>.
2320
ff81c7c1
NC
23212011-11-25 Nick Clifton <nickc@redhat.com>
2322
2323 * po/it.po: New Italian translation.
2324
628f39be
SA
23252011-11-17 Sterling Augustine <saugustine@google.com>
2326
2327 * script.cc (script_include_directive): Implement.
2328 (read_script_file): New local variables name and search_path. Update
2329 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
2330 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
2331 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
2332
98ef3ea4
SA
23332011-11-11 Sterling Augustine <saugustine@google.com>
2334
2335 * yyscript.y (section_cmd): Add support for INCLUDE directive.
2336 (file_or_sections_cmd): Likewise.
2337
f4a8b6d7
DK
23382011-11-11 Doug Kwan <dougkwan@google.com>
2339
2340 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
2341 if --just-symbols is given.
2342
29ab395d
DK
23432011-11-10 Doug Kwan <dougkwan@google.com>
2344
2345 PR gold/13362
2346 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
2347 when processing data relocs.
2348 * reloc.h (Relocate_functions::rel_unaligned): New method.
2349 (Relocate_functions::pcrel_unaligned): Ditto.
2350 (Relocate_functions::rel32_unaligned): Ditto.
2351 (Relocate_functions::pcrel32_unaligned): Ditto.
2352
2c339f71
DK
23532011-11-09 Doug Kwan <dougkwan@google.com>
2354
2355 PR gold/13362
2356 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
2357 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
2358 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
2359 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
2360 (Relocate_functions::rel_unaligned): New.
2361 (Relocate_functions::rel32_unaligned): New.
2362 * target-reloc.h (relocate_for_relocatable): Add code to handle
2363 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
2364 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
2365 arm_unaligned_reloc_r): New targets.
2366 * testsuite/Makefile.in: Regenerate.
2367 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
2368 linking.
2369
3f3cddf1
ILT
23702011-11-02 Ian Lance Taylor <iant@google.com>
2371
2372 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
2373 NATIVE_LINKER.
2374 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
2375 * options.cc (General_options::finalize): Use library search path
2376 from configure script if specified. If not native and no sysroot,
2377 only search TOOLLIBDIR.
2378 * options.h (Search_directory::Search_directory): Change name to
2379 const std::string&.
2380 (General_options::add_to_library_path_with_sysroot): Change arg to
2381 const std::string&.
2382 * configure, Makefile.in, config.in: Rebuild.
2383
a8e2273b
ILT
23842011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
2385
2386 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
2387 we are working around the ARM1176 Erratum.
2388 * options.h (General_options::fix_arm1176): Add option.
2389 * testsuite/Makefile.am: Add testcases, and keep current ones
2390 working.
2391 * testsuite/Makefile.in: Regenerate.
2392 * testsuite/arm_fix_1176.s: New file.
2393 * testsuite/arm_fix_1176.sh: Likewise.
2394
cd6eab1c
ILT
23952011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
2396
2397 * arm.cc (Target_arm::Target_arm): Remove initialisation of
2398 may_use_blx_.
2399 (Target_arm::may_use_blx): Remove method.
2400 (Target_arm::set_may_use_blx): Likewise.
2401 (Target_arm::may_use_v4t_interworking): New method.
2402 (Target_arm::may_use_v5t_interworking): Likewise.
2403 (Target_arm::may_use_blx_): Remove member variable.
2404 (Arm_relocate_functions::arm_branch_common): Check for v5T
2405 interworking.
2406 (Arm_relocate_functions::thumb_branch_common): Likewise.
2407 (Reloc_stub::stub_type_for_reloc): Likewise.
2408 (Target_arm::do_finalize_sections): Correct interworking checks.
2409 * testsuite/Makefile.am: Add new tests.
2410 * testsuite/Makefile.in: Regenerate.
2411 * testsuite/arm_farcall_arm_arm.s: New test.
2412 * testsuite/arm_farcall_arm_arm.sh: Likewise.
2413 * testsuite/arm_farcall_arm_thumb.s: Likewise.
2414 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
2415 * testsuite/arm_farcall_thumb_arm.s: Likewise.
2416 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
2417 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
2418 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
2419
286adcf4
CC
24202011-10-31 Cary Coutant <ccoutant@google.com>
2421
2422 PR gold/13023
2423 * expression.cc (Expression::eval_with_dot): Add
2424 is_section_dot_assignment parameter.
2425 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
2426 absolute and assigning to dot within a section.
2427 * script-sections.cc
2428 (Output_section_element_assignment::set_section_addresses): Pass
2429 dot_section to set_if_absolute.
2430 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
2431 as is_section_dot_assignment flag to eval_with_dot.
2432 (Output_section_element_dot_assignment::set_section_addresses):
2433 Likewise.
2434 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
2435 parameter. Also set value if relative to dot_section; set the
2436 symbol's output_section.
2437 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
2438 parameter. Adjust all callers.
2439 (Expression::eval_maybe_dot): Likewise.
2440 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
2441 Adjust all callers.
2442 * testsuite/script_test_2.t: Test assignment of an absolute value
2443 to dot within an output section element.
2444
9634ed06
CC
24452011-10-31 Cary Coutant <ccoutant@google.com>
2446
2447 * options.h (class General_options): Add --[no-]gnu-unique options.
2448 * symtab.cc (Symbol_table::sized_write_globals): Convert
2449 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
2450
de4101c7
CC
24512011-10-31 Cary Coutant <ccoutant@google.com>
2452
2453 PR gold/13359
2454 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
2455 unnecessary assertion.
2456 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
2457
7257cc92
ST
24582011-10-31 Sriraman Tallam <tmsriram@google.com>
2459
2460 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
2461 gc_mark_symbol.
2462 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
2463 gc_mark_symbol.
2464 Change to just keep the section associated with symbol.
2465 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
2466 they are externally visible and --export-dynamic is turned on.
2467 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
2468
bfc34b3f
ILT
24692011-10-19 Ian Lance Taylor <iant@google.com>
2470
2471 PR gold/13163
2472 * script-sections.cc
2473 (Output_section_element_dot_assignment::needs_output_section): New
2474 function.
2475
ea0d8c47
ILT
24762011-10-19 Ian Lance Taylor <iant@google.com>
2477
2478 PR gold/13204
2479 * layout.cc (Layout::segment_precedes): Don't assert failure if a
2480 --section-start option was seen.
2481 * options.h (General_options::any_section_start): New function.
2482
abd242a9
DM
24832011-10-18 David S. Miller <davem@davemloft.net>
2484
2485 PR binutils/13301
2486 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
2487 member to track relocation locations that have moved during TLS
2488 reloc optimizations.
2489 (Target_sparc::Relocate::Relocate): Initialize to NULL.
2490 (Target_sparc::Relocate::relocate): Adjust view down by 4
2491 bytes if it matches reloc_adjust_addr_.
2492 (Target_sparc::Relocate::relocate_tls): Always move the
2493 __tls_get_addr call delay slot instruction forward 4 bytes when
2494 performing relaxation.
2495
bab9090f
CC
24962011-10-18 Cary Coutant <ccoutant@google.com>
2497
2498 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
2499 (Output_file::map_no_anonymous): Check for non-zero
2500 return code from posix_fallocate.
2501
f7c5b166
CC
25022011-10-17 Cary Coutant <ccoutant@google.com>
2503
2504 PR gold/13245
2505 * plugin.cc (is_visible_from_outside): Check for symbols
2506 referenced from dynamic objects.
2507 * resolve.cc (Symbol_table::resolve): Don't count references
2508 from dynamic objects as references from real ELF files.
2509 * testsuite/plugin_test_2.sh: Adjust expected result.
2510
b490c0bb
CC
25112011-10-17 Cary Coutant <ccoutant@google.com>
2512
2513 * gold.cc: Include timer.h.
2514 (queue_middle_tasks): Stamp time.
2515 (queue_final_tasks): Likewise.
2516 * main.cc (main): Store timer in parameters. Print timers
2517 for each pass.
2518 * parameters.cc (Parameters::Parameters): Initialize timer_.
2519 (Parameters::set_timer): New function.
2520 (set_parameters_timer): New function.
2521 * parameters.h (Parameters::set_timer): New function.
2522 (Parameters::timer): New function.
2523 (Parameters::timer_): New data member.
2524 (set_parameters_timer): New function.
2525 * timer.cc (Timer::stamp): New function.
2526 (Timer::get_pass_time): New function.
2527 * timer.h (Timer::stamp): New function.
2528 (Timer::get_pass_time): New function.
2529 (Timer::pass_times_): New data member.
2530
f475cf7b
CC
25312011-10-17 Cary Coutant <ccoutant@google.com>
2532
2533 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
2534 task for members of lib groups.
2535
cdd7e244
CC
25362011-10-17 Cary Coutant <ccoutant@google.com>
2537
2538 PR gold/13288
4f95c8b4 2539 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
2540 (File_read::make_view): Move bounds check (replace with assert)...
2541 (File_read::find_or_make_view): ... to here.
2542
dfb45471
CC
25432011-10-12 Cary Coutant <ccoutant@google.com>
2544
4f95c8b4 2545 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
2546 ::read returns less than requested size.
2547
53bbcc1b
CC
25482011-10-10 Cary Coutant <ccoutant@google.com>
2549
4f95c8b4 2550 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
2551 Initialize defined_count_.
2552 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
2553 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
2554 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
2555 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
2556 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 2557 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
2558 member.
2559 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 2560 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
2561 Return zeroes instead of internal error.
2562
397b129b
CC
25632011-10-10 Cary Coutant <ccoutant@google.com>
2564
2565 PR gold/13249
4f95c8b4 2566 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 2567 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 2568 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
2569 (Output_reloc::type_): Adjust size of bit field.
2570 (Output_reloc::use_plt_offset_): New bit field.
2571 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
2572 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
2573 flag. Adjust all callers.
4f95c8b4 2574 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
2575 creating RELATIVE relocations.
2576
d5698657
NC
25772011-10-10 Nick Clifton <nickc@redhat.com>
2578
2579 * po/es.po: Updated Spanish translation.
2580 * po/fi.po: Updated Finnish translation.
2581
6a59a5c2
DN
25822011-10-03 Diego Novillo <dnovillo@google.com>
2583
2584 * options.cc (parse_uint): Fix dereference of RETVAL.
2585
f0558624
ST
25862011-09-29 Sriraman Tallam <tmsriram@google.com>
2587
2588 * layout.h (section_order_map_): New member.
2589 (get_section_order_map): New member function.
2590 * output.cc (Output_section::add_input_section): Check for patterns
2591 only when --section-ordering-file is specified.
2592 * gold.cc (queue_middle_tasks): Delay updating order of sections till
2593 output_sections have been formed.
2594 * layout.cc (Layout_Layout): Initialize section_order_map_.
2595 * plugin.cc (update_section_order): Store order in order_map. Do not
2596 update the order.
2597 * testsuite/Makefile.am: Add test case for plugin_final_layout.
2598 * testsuite/Makefile.in: Regenerate.
2599 * testsuite/plugin_section_order.c: New file.
2600 * testsuite/plugin_final_layout.cc: New file.
2601 * testsuite/plugin_final_layout.sh: New file.
2602
a7dac153
CC
26032011-09-29 Cary Coutant <ccoutant@google.com>
2604
4f95c8b4 2605 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 2606 Check for NULL.
4f95c8b4 2607 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
2608 symbols during incremental update.
2609 (Symbol_table::add_from_dynobj): Likewise.
2610
eebd87a5
ILT
26112011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2612 Ian Lance Taylor <iant@google.com>
2613
2614 * symtab.cc (Symbol_table::define_special_symbol): Always
2615 canonicalize version string.
2616
403a3331
CC
26172011-09-26 Cary Coutant <ccoutant@google.com>
2618
4f95c8b4
CC
2619 * gold.cc (queue_initial_tasks): Move option checks ...
2620 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
2621 some options; make others fatal.
2622
235061c2
CC
26232011-09-26 Cary Coutant <ccoutant@google.com>
2624
2625 gcc PR lto/47247
2626 * plugin.cc (get_symbols_v2): New function.
2627 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
2628 (is_referenced_from_outside): New function.
2629 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
2630 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
2631 (get_symbols): Pass version parameter.
2632 (get_symbols_v2): New function.
2633 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
2634 parameter.
2635 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
2636 (onload): Add LDPT_GET_SYMBOLS_V2.
2637 (all_symbols_read_hook): Use get_symbols_v2; check for
2638 LDPR_PREVAILING_DEF_IRONLY_EXP.
2639 * testsuite/plugin_test_3.sh: Update expected results.
2640
dc87f620
ILT
26412011-09-23 Simon Baldwin <simonb@google.com>
2642
2643 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
2644 configuration options.
2645 * configure: Regenerate.
2646 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
2647 * Makefile.in: Regenerate.
2648 * testsuite/Makefile.in: Regenerate.
2649
a8279f82
ST
26502011-09-19 Sriraman Tallam <tmsriram@google.com>
2651
2652 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
2653
0c9350c8
CC
26542011-09-19 Cary Coutant <ccoutant@google.com>
2655
2656 * incremental.cc (can_incremental_update): Fix typo in comment.
2657 * incremental.h (can_incremental_update): Likewise.
2658
aa06ae28
CC
26592011-09-18 Cary Coutant <ccoutant@google.com>
2660
2661 * incremental.cc (can_incremental_update): New function.
2662 * incremental.h (can_incremental_update): New function.
2663 * layout.cc (Layout::init_fixed_output_section): Call it.
2664 (Layout::make_output_section): Don't allow patch space in .eh_frame.
2665 * object.cc (Sized_relobj_file::do_layout): Call
2666 can_incremental_update.
2667
ebb300b2
CC
26682011-09-13 Cary Coutant <ccoutant@google.com>
2669
2670 * configure.ac: Check for glibc support for gnu_indirect_function
2671 support with static linking, setting automake conditional
2672 IFUNC_STATIC.
2673 * Makefile.in: Regenerate.
2674 * configure: Regenerate.
2675
2676 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
2677 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
2678 for IFUNC_STATIC.
2679 * testsuite/Makefile.in: Regenerate.
2680
1206d0d5
CC
26812011-09-13 Cary Coutant <ccoutant@google.com>
2682
2683 * incremental.cc (Sized_relobj_incr::do_layout): Call
2684 report_comdat_group for kept comdat sections.
2685 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
2686 * testsuite/Makefile.in: Regenerate.
2687 * testsuite/incr_comdat_test_1.cc: New source file.
2688 * testsuite/incr_comdat_test_2_v1.cc: New source file.
2689 * testsuite/incr_comdat_test_2_v2.cc: New source file.
2690 * testsuite/incr_comdat_test_2_v3.cc: New source file.
2691
40b29874
ILT
26922011-09-13 Ian Lance Taylor <iant@google.com>
2693
2694 * object.cc (Sized_relobj_file::do_layout): Remove unused local
2695 variable external_symbols_offset.
2696
1b045aac
ILT
26972011-09-12 Ian Lance Taylor <iant@google.com>
2698
2699 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
2700 triggered if object has no symbols.
2701
24c6c55a
DM
27022011-09-09 David S. Miller <davem@davemloft.net>
2703
2704 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
2705 (Output_fill_debug_line::do_write): Likewise.
2706
66570254
CC
27072011-08-29 Cary Coutant <ccoutant@google.com>
2708
2709 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
2710 casts to match formatting specs.
2711 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
2712
8ea8cd50
CC
27132011-08-26 Cary Coutant <ccoutant@google.com>
2714
2715 * layout.cc (Free_list::allocate): Provide guarantee of minimum
2716 remaining hole size when allocating.
2717 (Layout::make_output_section): Set fill methods for debug sections.
2718 * layout.h (Free_list::Free_list_node): Move from private to
2719 public.
2720 (Free_list::set_min_hole_size): New function.
2721 (Free_list::begin, Free_list::end): New functions.
2722 (Free_list::min_hole_): New data member.
2723 * output.cc: Include dwarf.h.
2724 (Output_fill_debug_info::do_minimum_hole_size): New function.
2725 (Output_fill_debug_info::do_write): New function.
2726 (Output_fill_debug_line::do_minimum_hole_size): New function.
2727 (Output_fill_debug_line::do_write): New function.
2728 (Output_section::Output_section): Initialize new data member.
2729 (Output_section::set_final_data_size): Ensure patch space is larger
2730 than minimum hole size.
2731 (Output_section::do_write): Fill holes in debug sections.
2732 * output.h (Output_fill): New class.
2733 (Output_fill_debug_info): New class.
2734 (Output_fill_debug_line): New class.
2735 (Output_section::set_free_space_fill): New function.
2736 (Output_section::free_space_fill_): New data member.
2737 * testsuite/Makefile.am (incremental_test_3): Add
2738 --incremental-patch option.
2739 (incremental_test_4): Likewise.
2740 (incremental_test_5): Likewise.
2741 (incremental_test_6): Likewise.
2742 (incremental_copy_test): Likewise.
2743 (incremental_common_test_1): Likewise.
2744 * testsuite/Makefile.in: Regenerate.
2745
7cf80422
NC
27462011-08-26 Nick Clifton <nickc@redhat.com>
2747
2748 * po/es.po: Updated Spanish translation.
2749
c3f7b0e5
CC
27502011-08-01 Cary Coutant <ccoutant@google.com>
2751
2752 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
2753 * gold/testsuite/Makefile.in: Regenerate.
2754 * gold/testsuite/justsyms_exec.c: New source file.
2755 * gold/testsuite/justsyms_lib.c: New source file.
2756
9590bf25
CC
27572011-08-01 Cary Coutant <ccoutant@google.com>
2758
2759 * layout.cc (Layout::set_segment_offsets): Don't realign text
2760 segment if -Ttext was specified.
2761 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
2762 file type.
2763 * object.h (Sized_relobj_file::e_type): New function.
2764 (Sized_relobj_file::e_type_): New data member.
2765 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
2766 base address for ET_EXEC files.
2767 * target.cc (Target::do_make_elf_object_implementation): Allow
2768 ET_EXEC files with --just-symbols option.
2769
dcd8d12e
CC
27702011-07-28 Cary Coutant <ccoutant@google.com>
2771
2772 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
2773 Add thread_number parameter.
2774 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
2775 * workqueue-threads.cc
2776 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
2777 current thread if its thread number is greater than desired thread
2778 count.
2779 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
2780 Add thread_number parameter.
2781 (Workqueue::should_cancel_thread): Likewise.
2782 (Workqueue::find_runnable_or_wait): Pass thread_number to
2783 should_cancel_thread.
2784 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
2785 parameter.
2786
804eb480
ST
27872011-07-22 Sriraman Tallam <tmsriram@google.com>
2788
2789 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
2790 only after checking if it cannot be forced local.
2791 * symtab.h (is_externally_visible): Check if the symbol is not forced
2792 local.
2793
f1ddb600
ILT
27942011-07-15 Ian Lance Taylor <iant@google.com>
2795
2796 * options.h (class General_options): Add --print-output-format.
2797 Move -EL next to -EB, for better --help output.
2798 * target-select.cc: Include <cstdio>, "options.h", and
2799 "parameters.h".
2800 (Target_selector::do_target_bfd_name): New function.
2801 (print_output_format): New function.
2802 * target-select.h (class Target_selector): Update declarations.
2803 (Target_selector::target_bfd_name): New function.
2804 (print_output_format): Declare.
2805 * main.cc: Include "target-select.h".
2806 (main): Handle --print-output-format.
2807 * gold.cc: Include "target-select.h".
2808 (queue_initial_tasks): Handle --print-output-format when there are
2809 no input files.
2810 * parameters.cc (parameters_force_valid_target): Give a better
2811 error message if -EB/-EL does not match target.
2812 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
2813 function.
2814
7d172687
ILT
28152011-07-15 Ian Lance Taylor <iant@google.com>
2816
2817 * i386.cc (class Output_data_plt_i386): Add layout_ field.
2818 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
2819 (Output_data_plt_i386::do_write): Write address of .dynamic
2820 section to first entry in .got.plt section.
2821 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
2822 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
2823 Initialize layout_.
2824 (Output_data_plt_x86_64::do_write): Write address of .dynamic
2825 section to first entry in .got.plt section.
2826 * layout.h (Layout::dynamic_section): New function.
2827
e9552f7e
ST
28282011-07-13 Sriraman Tallam <tmsriram@google.com>
2829
2830 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
2831 to claim_file call.
2832 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
2833 input_section_position_, and input_section_glob_.
2834 (read_layout_from_file): Call function section_ordering_specified.
2835 * layout.h (is_section_ordering_specified): New function.
2836 (section_ordering_specified): New function.
2837 (section_ordering_specified_): New boolean member.
2838 * main.cc(main): Call load_plugins after layout object is defined.
2839 * output.cc (Output_section::add_input_section): Use
2840 function section_ordering_specified to check if section ordering is
2841 needed.
2842 * output.cc (Output_section::add_relaxed_input_section): Use
2843 function section_ordering_specified to check if section ordering is
2844 needed.
2845 (Output_section::update_section_layout): New function.
2846 (Output_section::sort_attached_input_sections): Check if input section
2847 must be reordered.
2848 * output.h (Output_section::update_section_layout): New function.
2849 * plugin.cc (get_section_count): New function.
2850 (get_section_type): New function.
2851 (get_section_name): New function.
2852 (get_section_contents): New function.
2853 (update_section_order): New function.
58797674 2854 (allow_section_ordering): New function.
e9552f7e
ST
2855 (Plugin::load): Add the new interfaces to the transfer vector.
2856 (Plugin_manager::load_plugins): New parameter.
2857 (Plugin_manager::all_symbols_read): New parameter.
2858 (Plugin_manager::claim_file): New parameter. Save the elf object for
2859 unclaimed objects.
2860 (Plugin_manager::get_elf_object): New function.
2861 (Plugin_manager::get_view): Change to directly use the bool to check
2862 if get_view is called from claim_file_hook.
2863 * plugin.h (input_objects): New function
2864 (Plugin__manager::load_plugins): New parameter.
2865 (Plugin_manager::claim_file): New parameter.
2866 (Plugin_manager::get_elf_object): New function.
2867 (Plugin_manager::in_claim_file_handler): New function.
2868 (Plugin_manager::in_claim_file_handler_): New member.
2869 (layout): New function.
2870 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
2871 handler with an extra parameter. Make the elf object before calling
2872 claim_file handler.
2873 * testsuite/plugin_test.c (get_section_count): New function pointer.
2874 (get_section_type): New function pointer.
2875 (get_section_name): New function pointer.
2876 (get_section_contents): New function pointer.
2877 (update_section_order): New function pointer.
2878 (allow_section_ordering): New function pointer.
2879 (onload): Check if the new interfaces exist.
2880
9446efde
ILT
28812011-07-13 Ian Lance Taylor <iant@google.com>
2882
2883 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
2884 relro section.
2885 * x86_64.cc (Target_x86_64::got_section): Likewise.
2886 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
2887 (relro_now_test_SOURCES): New variable.
2888 (relro_now_test_DEPENDENCIES): New variable.
2889 (relro_now_test_LDFLAGS): New variable.
2890 (relro_now_test_LDADD): New variable.
2891 (relro_now_test.so): New target.
2892 * testsuite/Makefile.in: Rebuild.
2893
07aa62f2
ILT
28942011-07-12 Ian Lance Taylor <iant@google.com>
2895
2896 PR gold/12980
2897 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
2898 GLOB_DAT relocation rather than a RELATIVE relocation for a
2899 protected symbol when creating a shared library.
2900 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
2901 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
2902 * testsuite/protected_main_1.cc (main): Test that protected
2903 function has same address.
2904
e2153196
ILT
29052011-07-11 Ian Lance Taylor <iant@google.com>
2906
2907 PR gold/12979
2908 * options.h (class General_options): Add -Bgroup.
2909 * options.cc (General_options::finalize): If -Bgroup is set,
2910 default to --unresolved-symbols=report-all.
2911 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
2912 * target-reloc.h (issue_undefined_symbol_error): Handle
2913 --unresolved-symbols=report-all.
2914
6daf5215
ILT
29152011-07-08 Ian Lance Taylor <iant@google.com>
2916
2917 PR gold/11985
2918 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
2919 if linker script discards key sections.
2920 (Layout::create_dynamic_symtab): Likewise.
2921 (Layout::assign_local_dynsym_offsets): Likewise.
2922 (Layout::sized_create_version_sections): Likewise.
2923 (Layout::create_interp): Likewise.
2924 (Layout::finish_dynamic_section): Likewise.
2925 (Layout::set_dynamic_symbol_size): Likewise.
2926
beabb2c6
ILT
29272011-07-08 Ian Lance Taylor <iant@google.com>
2928
2929 PR gold/12386
2930 * options.h (class General_options): Add --unresolved-symbols.
2931 * target-reloc.h (issue_undefined_symbol_error): Check
2932 --unresolved-symbols. Add comments.
2933
9c16daf1
ILT
29342011-07-08 Ian Lance Taylor <iant@google.com>
2935
2936 * testsuite/odr_violation2.cc (Ordering::operator()): Make
2937 expression more complex.
2938
191f1a2d
ILT
29392011-07-08 Ian Lance Taylor <iant@google.com>
2940
2941 PR gold/11317
2942 * target-reloc.h (issue_undefined_symbol_error): New inline
2943 function, broken out of relocate_section.
2944 (relocate_section): Call issue_undefined_symbol_error.
2945 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
2946 there is no TLS segment if we are about to issue an undefined
2947 symbol error.
2948 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
2949
62855347
ILT
29502011-07-08 Ian Lance Taylor <iant@google.com>
2951
2952 PR gold/12279
2953 * resolve.cc (Symbol_table::should_override): Add fromtype
2954 parameter. Change all callers. Give error when linking together
2955 TLS and non-TLS symbol.
2956 (Symbol_table::should_override_with_special): Add fromtype
2957 parameter. Change all callers.
2958 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
2959 there is no TLS segment if we have reported some errors.
2960 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
2961
67181c72
ILT
29622011-07-08 Ian Lance Taylor <iant@google.com>
2963
2964 PR gold/12372
2965 * target.h (Target::plt_address_for_global): New function.
2966 (Target::plt_address_for_local): New function.
2967 (Target::plt_section_for_global): Remove.
2968 (Target::plt_section_for_local): Remove.
2969 (Target::do_plt_address_for_global): New virtual function.
2970 (Target::do_plt_address_for_local): New virtual function.
2971 (Target::do_plt_section_for_global): Remove.
2972 (Target::do_plt_section_for_local): Remove.
2973 (Target::register_global_plt_entry): Add Symbol_table and Layout
2974 parameters.
2975 * output.cc (Output_data_got::Got_entry::write): Use
2976 plt_address_for_global and plt_address_for_local.
2977 * layout.cc (Layout::add_target_dynamic_tags): Use size and
2978 address of output section.
2979 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
2980 got_irelative_, and irelative_count_ fields. Update
2981 declarations.
2982 (Output_data_plt_i386::has_irelative_section): New function.
2983 (Output_data_plt_i386::entry_count): Add irelative_count_.
2984 (Output_data_plt_i386::set_final_data_size): Likewise.
2985 (class Target_i386): Add got_irelative_ and rel_irelative_
2986 fields. Update declarations.
2987 (Target_i386::Target_i386): Initialize new fields.
2988 (Target_i386::do_plt_address_for_global): New function replacing
2989 do_plt_section_for_global.
2990 (Target_i386::do_plt_address_for_local): New function replacing
2991 do_plt_section_for_local.
2992 (Target_i386::got_section): Create got_irelative_.
2993 (Target_i386::rel_irelative_section): New function.
2994 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
2995 fields. Don't define __rel_iplt_{start,end}.
2996 (Output_data_plt_i386::add_entry): Add symtab and layout
2997 parameters. Change all callers. Use different PLT and GOT for
2998 IFUNC symbols.
2999 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
3000 layout parameters. Change all callers. Use different PLT and
3001 GOT.
3002 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
3003 (Output_data_plt_i386::rel_irelative): New function.
3004 (Output_data_plt_i386::address_for_global): New function.
3005 (Output_data_plt_i386::address_for_local): New function.
3006 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
3007 IRELATIVE GOT when changing IFUNC GOT entries.
3008 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
3009 reloc.
3010 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
3011 if we didn't create an IRELATIVE GOT.
3012 (Target_i386::Relocate::relocate): Use plt_address_for_global and
3013 plt_address_for_local.
3014 (Target_i386::do_dynsym_value): Use plt_address_for_global.
3015 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
3016 got_irelative_, and irelative_count_ fields. Update
3017 declarations.
3018 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
3019 Initialize new fields. Remove symtab parameter. Change all
3020 callers.
3021 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
3022 irelative_count_.
3023 (Output_data_plt_x86_64::has_irelative_section): New function.
3024 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
3025 (class Target_x86_64): Add got_irelative_ and rel_irelative_
3026 fields. Update declarations.
3027 (Target_x86_64::Target_x86_64): Initialize new fields.
3028 (Target_x86_64::do_plt_address_for_global): New function replacing
3029 do_plt_section_for_global.
3030 (Target_x86_64::do_plt_address_for_local): New function replacing
3031 do_plt_section_for_local.
3032 (Target_x86_64::got_section): Create got_irelative_.
3033 (Target_x86_64::rela_irelative_section): New function.
3034 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
3035 all callers. Don't create __rel_iplt_{start,end}.
3036 (Output_data_plt_x86_64::add_entry): Add symtab and layout
3037 parameters. Change all callers. Use different PLT and GOT for
3038 IFUNC symbols.
3039 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
3040 layout parameters. Change all callers. Use different PLT and
3041 GOT.
3042 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
3043 parameters. Change all callers. Use different PLT and GOT for
3044 IFUNC symbols.
3045 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
3046 (Output_data_plt_x86_64::rela_irelative): New function.
3047 (Output_data_plt_x86_64::address_for_global): New function.
3048 (Output_data_plt_x86_64::address_for_local): New function.
3049 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3050 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
3051 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
3052 (Target_x86_64::register_global_plt_entry): Add symtab and layout
3053 parameters.
3054 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
3055 reloc.
3056 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
3057 symbols if we didn't create an IRELATIVE GOT.
3058 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
3059 plt_address_for_local.
3060 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
3061 * testsuite/ifuncvar1.c: New test file.
3062 * testsuite/ifuncvar2.c: New test file.
3063 * testsuite/ifuncvar3.c: New test file.
3064 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
3065 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
3066 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
3067 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
3068 * testsuite/Makefile.in: Rebuild.
3069
33c15b45
CC
30702011-07-07 Cary Coutant <ccoutant@google.com>
3071
3072 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
3073 (two_file_test_1_ndebug.o): Likewise.
3074 (two_file_test_1b_ndebug.o): Likewise.
3075 (two_file_test_2_ndebug.o): Likewise.
3076 (two_file_test_main_ndebug.o): Likewise.
3077 (incremental_test_2): Link with no-debug versions.
3078
f48b5fb7
CC
30792011-07-06 Cary Coutant <ccoutant@google.com>
3080
3081 * gold/incremental.cc
3082 (Output_section_incremental_inputs::write_info_blocks): Check for
3083 hidden and internal symbols.
3084
221597a5
CC
30852011-07-06 Cary Coutant <ccoutant@google.com>
3086
3087 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
3088 Check disposition for startup file.
3089 (Incremental_inputs::report_command_line): Ignore
3090 --incremental-startup-unchanged option.
3091 * options.cc (General_options::parse_incremental_startup_unchanged):
3092 New function.
3093 (General_options::General_options): Initialize new data member.
3094 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
3095 (General_options): Add --incremental-startup-unchanged option.
3096 (General_options::incremental_startup_disposition): New function.
3097 (General_options::incremental_startup_disposition_): New data member.
3098
e24719f6
CC
30992011-07-06 Cary Coutant <ccoutant@google.com>
3100
3101 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
3102 input file index to Script_info ctor.
3103 (Sized_incremental_binary::do_file_has_changed): Find the
3104 command-line argument for files named in scripts.
3105 * incremental.h (Script_info::Script_info): New ctor
3106 with input file index.
3107 (Script_info::input_file_index): New function.
3108 (Script_info::input_file_index_): New data member.
3109 (Incremental_binary::get_library): Add const.
3110 (Incremental_binary::get_script_info): Add const.
3111 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
3112 * testsuite/Makefile.am (incremental_test_5): New test case.
3113 (incremental_test_6): New test case.
3114 * testsuite/Makefile.in: Regenerate.
3115
8f7c81e8
CC
31162011-07-06 Cary Coutant <ccoutant@google.com>
3117
3118 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
3119 debug output when command lines differ.
3120
9fbd3822
CC
31212011-07-06 Cary Coutant <ccoutant@google.com>
3122
3123 * incremental.cc (Incremental_inputs::report_command_line): Ignore
3124 --incremental-patch option.
3125 * layout.cc (Free_list::allocate): Extend allocation beyond original
3126 end if enabled.
3127 (Layout::make_output_section): Mark sections that should get
3128 patch space.
3129 * options.cc (parse_percent): New function.
3130 * options.h (parse_percent): New function.
3131 (DEFINE_percent): New macro.
3132 (General_options): Add --incremental-patch option.
3133 * output.cc (Output_section::Output_section): Initialize new data
3134 members.
3135 (Output_section::add_input_section): Print section name when out
3136 of patch space.
3137 (Output_section::add_output_section_data): Likewise.
3138 (Output_section::set_final_data_size): Add patch space when
3139 doing --incremental-full.
3140 (Output_section::do_reset_address_and_file_offset): Remove patch
3141 space.
3142 (Output_segment::set_section_list_addresses): Print debug output
3143 only if --incremental-update.
3144 * output.h (Output_section::set_is_patch_space_allowed): New function.
3145 (Output_section::is_patch_space_allowed_): New data member.
3146 (Output_section::patch_space_): New data member.
3147 * parameters.cc (Parameters::incremental_full): New function.
3148 * parameters.h (Parameters::incremental_full): New function
3149 * testsuite/Makefile.am (incremental_test_2): Add test for
3150 --incremental-patch option.
3151 * testsuite/Makefile.in: Regenerate.
3152 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
3153 (t18): Remove function body.
3154
f6cccc2c
DK
31552011-07-05 Doug Kwan <dougkwan@google.com>
3156
3157 PR gold/12771
3158 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
3159 Arm_Address type for relocation result.
3160 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
3161 overflow check.
3162 (Arm_relocate_functions::abs32): Use unaligned access.
3163 (Arm_relocate_functions::rel32): Ditto.
3164 (Arm_relocate_functions::prel31): Ditto.
3165 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
3166 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
3167 static data relocations.
3168 * testsuite/Makefile.in: Regnerate.
3169 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
3170
28a13fec
ILT
31712011-07-05 Ian Lance Taylor <iant@google.com>
3172
3173 PR gold/12392
3174 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
3175 symbols if necessary.
3176 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
3177
24d47b34
ILT
31782011-07-05 Ian Lance Taylor <iant@google.com>
3179
3180 PR gold/12952
3181 * resolve.cc (Symbol::override_base_with_special): Simply override
3182 version with special symbol version, ignoring previous version.
3183
41f9cbbe
ILT
31842011-07-05 Ian Lance Taylor <iant@google.com>
3185
3186 * object.cc (Sized_relobj_file::include_section_group): Add
3187 information to comment about signature location.
3188
886288f1
ILT
31892011-07-02 Ian Lance Taylor <iant@google.com>
3190
3191 PR gold/12957
3192 * options.h (class General_options): Add -f and -F.
3193 * options.cc (General_options::finalize): Fatal error if -f/-F
3194 are used without -shared.
3195 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
3196
ae3a6d4f
ILT
31972011-07-02 Ian Lance Taylor <iant@google.com>
3198
3199 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
3200
21131061
ILT
32012011-07-01 Ian Lance Taylor <iant@google.com>
3202
3203 PR gold/12525
3204 PR gold/12952
3205 * resolve.cc (Symbol::override_base_with_special): Don't override
3206 the version if the overriding symbol has a different name.
3207 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
3208 all callers. If we give an error about an undefined version,
3209 define the base version if necessary.
3210 * dynobj.h (class Versions): Update declaration.
3211 * testsuite/weak_alias_test_5.cc: New file.
3212 * testsuite/weak_alias_test.script: New file.
3213 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
3214 and versioned_alias have the right value, and call t2.
3215 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
3216 weak_alias_test_5.so.
3217 (weak_alias_test_LDADD): Likewise.
3218 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
3219 * testsuite/Makefile.in: Rebuild.
3220
611062c0
ILT
32212011-07-01 Ian Lance Taylor <iant@google.com>
3222
3223 PR gold/12525
3224 * options.h (class General_options): Support -z notext.
3225 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
3226 -Wl,-z,notext.
3227 (two_file_shared_nonpic.so): Likewise.
3228 (two_file_shared_mixed.so): Likewise.
3229 (two_file_shared_mixed_1.so): Likewise.
3230 (weak_undef_lib_nonpic.so): Likewise.
3231 (alt/weak_undef_lib_nonpic.so): Likewise.
3232 (tls_test_shared_nonpic.so): Likewise.
3233 * testsuite/Makefile.in: Rebuild.
3234
328c7c2f
ILT
32352011-07-01 Ian Lance Taylor <iant@google.com>
3236
3237 PR gold/12525
3238 * configure.ac: Test whether static linking works, setting
3239 the automake conditional HAVE_STATIC.
3240 * testsuite/Makefile.am: Disable tests using -static if
3241 HAVE_STATIC is not true.
3242 * configure, testsuite/Makefile.in: Rebuild.
3243
02d7cd44
ILT
32442011-07-01 Ian Lance Taylor <iant@google.com>
3245
3246 PR gold/12525
3247 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
3248 Assert if we see DW_EH_PE_indirect.
3249 * target.h (Target::ehframe_datarel_base): New function.
3250 (Target::do_ehframe_datarel_base): New target function.
3251 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
3252 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
3253 function.
3254
07a60597
ILT
32552011-07-01 Ian Lance Taylor <iant@google.com>
3256
3257 PR gold/12571
3258 * options.h (class General_options): Add
3259 --ld-generated-unwind-info.
3260 * ehframe.cc (Fde::write): Add address parameter. Change all
3261 callers. If associated with PLT, fill in address and size.
3262 (Cie::set_output_offset): Only add merge mapping if there is an
3263 object.
3264 (Cie::write): Add address parameter. Change all callers.
3265 (Eh_frame::add_ehframe_for_plt): New function.
3266 * ehframe.h (class Fde): Update declarations. Move shndx_ and
3267 input_offset_ fields into union u_, with new plt field.
3268 (Fde::Fde): Adjust for new union field.
3269 (Fde::Fde) [Output_data version]: New constructor.
3270 (Fde::add_mapping): Only add merge mapping if there is an object.
3271 (class Cie): Update declarations.
3272 (class Eh_frame): Declare add_ehframe_for_plt.
3273 * layout.cc (Layout::layout_eh_frame): Break out code into
3274 make_eh_frame_section, and call it.
3275 (Layout::make_eh_frame_section): New function.
3276 (Layout::add_eh_frame_for_plt): New function.
3277 * layout.h (class Layout): Update declarations.
3278 * merge.cc (Merge_map::add_mapping): Add assertion.
3279 * i386.cc: Include "dwarf.h".
3280 (class Output_data_plt_i386): Make first_plt_entry,
3281 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
3282 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
3283 and plt_eh_frame_fde.
3284 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
3285 boundary. Call add_eh_frame_for_plt if appropriate.
3286 * x86_64.cc: Include "dwarf.h".
3287 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
3288 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
3289 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
3290 and plt_eh_frame_fde.
3291 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
3292 appropriate.
3293
14788a3f
ILT
32942011-06-29 Ian Lance Taylor <iant@google.com>
3295
3296 PR gold/12629
3297 * object.cc (Sized_relobj_file::layout_section): Change shdr
3298 parameter to be const.
3299 (Sized_relobj_file::layout_eh_frame_section): New function, broken
3300 out of do_layout.
3301 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
3302 appropriate. Call layout_eh_frame_section.
3303 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
3304 sections.
3305 * object.h (class Sized_relobj_file): Update declarations.
3306
6c21fce1
ILT
33072011-06-29 Ian Lance Taylor <iant@google.com>
3308
37e41b03 3309 PR gold/12652
6c21fce1
ILT
3310 * script.cc (Token::integer_value): Accept trailing M/m/K/k
3311 modifier.
3312 (Lex::gather_token): Accept trailing M/m/K/k for integers.
3313
4d5e4e62
ILT
33142011-06-29 Ian Lance Taylor <iant@google.com>
3315
3316 PR gold/12675
3317 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
3318 SHT_X86_64_UNWIND.
3319 * layout.cc (Layout::layout_eh_frame): Likewise.
3320
886f533a
ILT
33212011-06-29 Ian Lance Taylor <iant@google.com>
3322
3323 PR gold/12695
3324 * layout.cc (Layout::symtab_section_shndx): New function.
3325 * layout.h (class Layout): Declare symtab_section_shndx.
3326 * output.cc (Output_section::write_header): Call it.
3327
f3ae1b28
ILT
33282011-06-29 Ian Lance Taylor <iant@google.com>
3329
3330 PR gold/12818
3331 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
3332 symbols which are not used in a relocation.
3333
aecf301f
ILT
33342011-06-28 Ian Lance Taylor <iant@google.com>
3335
3336 PR gold/12898
3337 * layout.cc (Layout::segment_precedes): Don't crash if a linker
3338 script create indistinguishable segments.
3339 (Layout::set_segment_offsets): Use stable_sort when sorting
3340 segments. Pass this to Compare_segments constructor.
3341 * layout.h (class Layout): Make segment_precedes non-static.
3342 (class Compare_segments): Change from struct to class. Add
3343 layout_ field. Add constructor.
3344 * script-sections.cc
3345 (Script_sections::attach_sections_using_phdrs_clause): Rename
3346 local orphan to is_orphan. Don't report failure to put empty
3347 section in segment. On attachment failure, report name of
3348 section, and attach to first PT_LOAD segment.
3349
03ef7571
ILT
33502011-06-28 Ian Lance Taylor <iant@google.com>
3351
3352 PR gold/12934
3353 * target-select.cc (Target_selector::Target_selector): Add
3354 emulation parameter. Change all callers.
3355 (select_target_by_bfd_name): Rename from select_target_by_name.
3356 Change all callers.
3357 (select_target_by_emulation): New function.
3358 (supported_emulation_names): New function.
3359 * target-select.h (class Target_selector): Add emulation_ field.
3360 Update declarations.
3361 (Target_selector::recognize_by_bfd_name): Rename from
3362 recognize_by_name. Change all callers.
3363 (Target_selector::supported_bfd_names): Rename from
3364 supported_names. Change all callers.
3365 (Target_selector::recognize_by_emulation): New function.
3366 (Target_selector::supported_emulations): New function.
3367 (Target_selector::emulation): New function.
3368 (Target_selector::do_recognize_by_bfd_name): Rename from
3369 do_recognize_by_name. Change all callers.
3370 (Target_selector::do_supported_bfd_names): Rename from
3371 do_supported_names. Change all callers.
3372 (Target_selector::do_recognize_by_emulation): New function.
3373 (Target_selector::do_supported_emulations): New function.
3374 (select_target_by_bfd_name): Change name in declaration.
3375 (select_target_by_emulation): Declare.
3376 (supported_emulation_names): Declare.
3377 * parameters.cc (parameters_force_valid_target): Try to find
3378 target based on emulation from -m option.
3379 * options.h (class General_options): Change doc string for -m.
3380 * options.cc (help): Print emulations.
3381 (General_options::parse_V): Likewise.
3382 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
3383 Add emulation parameter. Change all callers.
3384
200b2bb9
ILT
33852011-06-28 Ian Lance Taylor <iant@google.com>
3386
3387 * target.h (class Target): Add osabi_ field.
3388 (Target::osabi): New function.
3389 (Target::set_osabi): New function.
3390 (Target::Target): Initialize osabi_.
3391 (Target::do_adjust_elf_header): Make pure virtual.
3392 (Sized_target::do_adjust_elf_header): Declare.
3393 * target.cc (Sized_target::do_adjust_elf_header): New function.
3394 (class Sized_target): Instantiate all versions.
3395 * freebsd.h (class Target_freebsd): Remove.
3396 (Target_selector_freebsd::do_recognize): Call set_osabi on
3397 Target.
3398 (Target_selector_freebsd::do_recognize_by_name): Likewise.
3399 (Target_selector_freebsd::set_osabi): Remove.
3400 * i386.cc (class Target_i386): Inherit from Sized_target rather
3401 than Target_freebsd.
3402 * x86_64.cc (class Target_x86_64): Likewise.
3403
b3ce541e
ILT
34042011-06-28 Ian Lance Taylor <iant@google.com>
3405
3406 * target.h (Target::can_check_for_function_pointers): Rewrite.
3407 Make non-virtual.
3408 (Target::can_icf_inline_merge_sections): Likewise.
3409 (Target::section_may_have_icf_unsafe_poineters): Likewise.
3410 (Target::Target_info): Add can_icf_inline_merge_sections field.
3411 (Target::do_can_check_for_function_pointers): New virtual
3412 function.
3413 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
3414 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
3415 from can_check_for_function_pointers, move in file.
3416 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
3417 section_may_have_icf_unsafe_poineters, move in file.
3418 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
3419 * i386.cc (Target_i386::do_can_check_for_function_pointers):
3420 Rename from can_check_for_function_pointers, move in file.
3421 (Target_i386::can_icf_inline_merge_sections): Remove.
3422 (Target_i386::i386_info): Initialize
3423 can_icf_inline_merge_sections.
3424 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
3425 Initialize can_icf_inline_merge_sections.
3426 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
3427 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
3428 Rename from can_check_for_function_pointers, move in file.
3429 (Target_x86_64::can_icf_inline_merge_sections): Remove.
3430 (Target_x86_64::x86_64_info): Initialize
3431 can_icf_inline_merge_sections.
3432 * testsuite/testfile.cc (Target_test::test_target_info):
3433 Likewise.
3434 * icf.cc (get_section_contents): Correct formatting.
3435
6d1c4efb
ILT
34362011-06-27 Ian Lance Taylor <iant@google.com>
3437
3438 * symtab.cc (Symbol::versioned_name): New function.
3439 (Symbol_table::add_to_final_symtab): Use versioned_name when
3440 appropriate.
3441 (Symbol_table::sized_write_symbol): Likewise.
3442 * symtab.h (class Symbol): Declare versioned_name.
3443 * stringpool.h (class Stringpool_template): Add variant of add
3444 which takes a std::basic_string.
3445 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
3446 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
3447 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
3448 (ver_test_12.o): New target.
3449 * testsuite/Makefile.in: Rebuild.
3450
57eb9b50
DK
34512011-06-27 Doug Kwan <dougkwan@google.com>
3452
3453 * arm.cc (Arm_relocate_functions::thm_jump8,
3454 Arm_relocate_functions::thm_jump11): Use a wider signed
3455 type to compute offset.
3456 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
3457 arm_thm_jump8.
3458 * testsuite/Makefile.in: Regenerate.
3459 * testsuite/arm_branch_in_range.sh: Check test results of
3460 arm_thm_jump11 and arm_thm_jump8.
3461 * testsuite/arm_thm_jump11.s: New test source file.
3462 * testsuite/arm_thm_jump11.t: New linker script.
3463 * testsuite/arm_thm_jump8.s: New test source file.
3464 * testsuite/arm_thm_jump8.t: New linker script.
3465
487b39df
ILT
34662011-06-24 Ian Lance Taylor <iant@google.com>
3467
3468 * layout.cc: Include "object.h".
3469 (ctors_sections_in_init_array): New static variable.
3470 (Layout::is_ctors_in_init_array): New function.
3471 (Layout::layout): Add entry to ctors_sections_in_init_array if
3472 appropriate.
3473 * layout.h (class Layout): Declare is_ctors_in_init_array.
3474 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
3475 is_ctors_reverse_view is set.
3476 (Sized_relobj_file::write_sections): Add layout parameter. Change
3477 all callers. Set is_ctors_reverse_view field of View_size.
3478 (Sized_relobj_file::reverse_words): New function.
3479 * object.h (Sized_relobj_file::View_size): Add
3480 is_ctors_reverse_view field.
3481 (class Sized_relobj_file): Update declarations.
3482 * testsuite/initpri3.c: New test.
3483 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
3484 initpri3b.
3485 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
3486 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
3487 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
3488 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
3489 * testsuite/Makefile.in: Rebuild.
3490
472076e4
CC
34912011-06-24 Cary Coutant <ccoutant@google.com>
3492
3493 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
3494 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
3495 (debug_msg_cdebug.err): New targets.
3496 * testsuite/Makefile.in: Regenerate.
3497 * testsuite/debug_msg.sh: Check output of link with compressed debug.
3498 Fix checks for link with shared library.
3499
a60af0db
DK
35002011-06-24 Doug Kwan <dougkwan@google.com>
3501
3502 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
3503 skip empty text sections.
3504 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
3505
5393d741
ILT
35062011-06-22 Ian Lance Taylor <iant@google.com>
3507
3508 PR gold/12910
3509 * options.h (class General_options): Add --ctors-in-init-array.
3510 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
3511 friends as SHT_PROGBITS for merging sections.
3512 (Layout::layout): Remove special handling of .init_array and
3513 friends. Don't sort if doing relocatable link. Sort for .ctors
3514 and .dtors if ctors_in_init_array.
3515 (Layout::make_output_section): Force correct section types for
3516 .init_array and friends. Don't sort if doing relocatable link,
3517 Don't sort .ctors and .dtors if ctors_in_init_array.
3518 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
3519 (Layout::output_section_name): Add relobj parameter. Change all
3520 callers. Handle .ctors. and .dtors. in code rather than table.
3521 Handle .ctors and .dtors if ctors_in_init_array.
3522 (Layout::match_file_name): New function, moved from output.cc.
3523 * layout.h (class Layout): Update declarations.
3524 * output.cc: Include "layout.h".
3525 (Input_section_sort_entry::get_priority): New function.
3526 (Input_section_sort_entry::match_file_name): Just call
3527 Layout::match_file_name.
3528 (Output_section::Input_section_sort_init_fini_compare::operator()):
3529 Handle .ctors and .dtors. Sort by explicit priority rather than
3530 by name.
3531 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
3532 * testsuite/initpri2.c: New test.
3533 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
3534 (check_PROGRAMS): Add initpri2.
3535 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
3536 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
3537 * configure, testsuite/Makefile.in: Rebuild.
3538
e1f74f98
ILT
35392011-06-19 Ian Lance Taylor <iant@google.com>
3540
3541 PR gold/12880
3542 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
3543 .interp section to a PT_INTERP segment even if we have seen a
3544 --dynamic-linker option. Don't do it if we have seen a PHDRS
3545 clause in a linker script.
3546 (Layout::finalize): Don't create a .interp section if we've
3547 already create a PT_INTERP segment.
3548 (Layout::create_interp): Always call choose_output_section (revert
3549 patch of 2011-06-17). Don't create PT_INTERP segment.
3550 * script-sections.cc
3551 (Script_sections::create_note_and_tls_segments): Add a .interp
3552 section to a PT_INTERP segment even if we have seen a
3553 --dynamic-linker option.
3554
766f91bb
ILT
35552011-06-18 Ian Lance Taylor <iant@google.com>
3556
3557 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
3558 merely because a non-PT_LOAD segment has a dynamic reloc.
3559
0d212c3a
ILT
35602011-06-18 Ian Lance Taylor <iant@google.com>
3561
3562 * layout.cc (Layout::finish_dynamic_section): Don't create
3563 DT_FLAGS entry if not needed.
3564
911a5072
ILT
35652011-06-18 Ian Lance Taylor <iant@google.com>
3566
3567 PR gold/12745
3568 * layout.cc (Layout::layout_eh_frame): Correct handling of
3569 writable .eh_frame section.
3570
534b4e5f
ILT
35712011-06-17 Ian Lance Taylor <iant@google.com>
3572
3573 PR gold/12893
3574 * resolve.cc (Symbol_table::resolve): Don't give an error if a
3575 symbol is redefined with the exact same object and value.
3576
10b4f102
ILT
35772011-06-17 Ian Lance Taylor <iant@google.com>
3578
3579 PR gold/12880
3580 * layout.h (class Layout): Add interp_segment_ field.
3581 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
3582 (Layout::attach_allocated_section_to_segment): If making shared
3583 library, put .interp section in PT_INTERP segment.
3584 (Layout::finalize): Also call create_interp if -dynamic-linker
3585 option was used.
3586 (Layout::create_interp): Assert that there is no PT_INTERP
3587 segment. If not using a SECTIONS clause, use make_output_section.
3588 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
3589 * script-sections.cc
3590 (Script_sections::create_note_and_tls_segments): If making shared
3591 library, put .interp section in PT_INTERP segment.
3592
a29b0dad
ILT
35932011-06-17 Ian Lance Taylor <iant@google.com>
3594
e588ea8d
ILT
3595 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
3596 when making a shared library.
3597
35982011-06-17 Ian Lance Taylor <iant@google.com>
3599
3600 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
3601 parameter. Change all callers. Don't issue warning about PC32
3602 against locally defined symbol.
a29b0dad 3603
9d3b0698
ILT
36042011-06-16 Ian Lance Taylor <iant@google.com>
3605
3606 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
3607 occurs in same object.
3608
85b0f90c
AM
36092011-06-14 Alan Modra <amodra@gmail.com>
3610
3611 * po/POTFILES.in: Regenerate.
3612
a94907d9
ILT
36132011-06-09 Ian Lance Taylor <iant@google.com>
3614
3615 * script-sections.cc
3616 (Orphan_output_section::set_section_addresses): For a relocatable
3617 link set address to 0.
3618
4fb3a1c3
CC
36192011-06-09 Cary Coutant <ccoutant@google.com>
3620
3621 PR gold/12804
3622 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
3623 used with --compress-debug-sections.
3624 * gold/object.cc (Sized_relobj_file::do_layout): Report
3625 uncompressed size of compressed input sections.
3626
61220854
CC
36272011-06-08 Cary Coutant <ccoutant@google.com>
3628
3629 PR gold/12804
3630 * testsuite/two_file_test_2_v1.cc: Change initialization of
3631 v2 to keep it in .data.
3632
e6455dfb
CC
36332011-06-07 Cary Coutant <ccoutant@google.com>
3634
3635 * common.cc (Symbol_table::do_allocate_commons_list): Call
3636 gold_fallback.
3637 * errors.cc (Errors::fatal): Adjust call to gold_exit.
3638 (Errors::fallback): New function.
3639 (gold_fallback): New function.
3640 * errors.h (Errors::fallback): New function.
3641 * gold.cc (gold_exit): Change status parameter to enum; adjust
3642 all callers.
3643 (queue_initial_tasks): Call gold_fallback.
3644 * gold.h: Include cstdlib.
3645 (Exit_status): New enum type.
3646 (gold_exit): Change status parameter to enum.
3647 (gold_fallback): New function.
3648 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
3649 (Layout::create_symtab_sections): Likewise.
3650 (Layout::create_shdrs): Likewise.
3651 * main.cc (main): Adjust call to gold_exit.
3652 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
3653 (Output_data_got::add_got_entry_pair): Likewise.
3654 (Output_section::add_input_section): Likewise.
3655 (Output_section::add_output_section_data): Likewise.
3656 (Output_segment::set_section_list_addresses): Likewise.
3657 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
3658
fb0e076f
CC
36592011-06-07 Cary Coutant <ccoutant@google.com>
3660
3661 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
3662 for incremental links.
3663 * output.cc (Output_segment::set_section_list_addresses): Remove
3664 FIXME and test for TLS or BSS.
3665
a5ee4d5d
CC
36662011-06-07 Cary Coutant <ccoutant@google.com>
3667
3668 * testsuite/Makefile.am: Add incremental_copy_test,
3669 incremental_common_test_1.
3670 * testsuite/Makefile.in: Regenerate.
3671 * testsuite/common_test_1_v1.c: New source file.
3672 * testsuite/common_test_1_v2.c: New source file.
3673 * testsuite/copy_test_v1.cc: New source file.
3674
5146f448
CC
36752011-06-07 Cary Coutant <ccoutant@google.com>
3676
3677 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
3678 update, allocate common from bss section's free list.
3679 * incremental-dump.cc (dump_incremental_inputs): Print flag for
3680 linker-defined symbols.
3681 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
3682 Skip GOT and PLT entries that are no longer referenced.
3683 (Output_section_incremental_inputs::write_info_blocks): Mark
3684 linker-defined symbols.
3685 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
3686 * output.cc (Output_section::allocate): New function.
3687 * output.h (Output_section::allocate): New function.
3688 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
3689 linker-defined symbols.
3690 (Symbol::override_base_with_special): Copy is_predefined_ flag.
3691 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
3692 (Symbol::init_base_output_data): Likewise.
3693 (Symbol::init_base_output_segment): Likewise.
3694 (Symbol::init_base_constant): Likewise.
3695 (Sized_symbol::init_output_data): Likewise.
3696 (Sized_symbol::init_output_segment): Likewise.
3697 (Sized_symbol::init_constant): Likewise.
3698 (Symbol_table::do_define_in_output_data): Likewise.
3699 (Symbol_table::do_define_in_output_segment): Likewise.
3700 (Symbol_table::do_define_as_constant): Likewise.
3701 * symtab.h (Symbol::is_predefined): New function.
3702 (Symbol::init_base_output_data): Add is_predefined parameter.
3703 (Symbol::init_base_output_segment): Likewise.
3704 (Symbol::init_base_constant): Likewise.
3705 (Symbol::is_predefined_): New data member.
3706 (Sized_symbol::init_output_data): Add is_predefined parameter.
3707 (Sized_symbol::init_output_segment): Likewise.
3708 (Sized_symbol::init_constant): Likewise.
3709 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
3710
26d3c67d
CC
37112011-06-07 Cary Coutant <ccoutant@google.com>
3712
3713 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
3714 instead of emit_copy_reloc.
3715 (Copy_relocs::emit_copy_reloc): Refactor.
3716 (Copy_relocs::make_copy_reloc): New function.
3717 (Copy_relocs::add_copy_reloc): Remove.
3718 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
3719 section.
3720 (Copy_relocs::make_copy_reloc): New function.
3721 (Copy_relocs::add_copy_reloc): Remove.
3722 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
3723 unchanged input files.
3724 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
3725 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
3726 Reserve BSS space for COPY relocations.
3727 (Sized_incremental_binary::do_emit_copy_relocs): New function.
3728 (Output_section_incremental_inputs::write_info_blocks): Record
3729 whether a symbol is copied from a shared object.
3730 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
3731 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
3732 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
3733 (Incremental_input_entry_reader::get_output_symbol_index): Add
3734 is_copy parameter.
3735 (Incremental_binary::emit_copy_relocs): New function.
3736 (Incremental_binary::do_emit_copy_relocs): New function.
3737 (Sized_incremental_binary::Sized_incremental_binary): Initialize
3738 new data member.
3739 (Sized_incremental_binary::add_copy_reloc): New function.
3740 (Sized_incremental_binary::do_emit_copy_relocs): New function.
3741 (Sized_incremental_binary::Copy_reloc): New struct.
3742 (Sized_incremental_binary::Copy_relocs): New typedef.
3743 (Sized_incremental_binary::copy_relocs_): New data member.
3744 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
3745 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
3746 * target.h (Sized_target::emit_copy_reloc): New function.
3747 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
3748
7cdb37d9
CC
37492011-06-02 Cary Coutant <ccoutant@google.com>
3750
3751 PR gold/12163
3752 * gold/archive.cc (Archive::Archive): Initialize new data member.
3753 (Archive::include_all_members): Return if archive has already been
3754 included.
3755 * gold/archive.h (Archive::include_all_members_): New data member.
3756
cc643b88
NC
37572011-06-02 Nick Clifton <nickc@redhat.com>
3758
3759 * dynobj.h: Fix spelling mistake in comment.
3760 * output.cc: Likewise.
3761
f62a3ca7 37622011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 3763 Asier Llano
f62a3ca7
DK
3764
3765 PR gold/12826
cc643b88 3766 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
3767 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
3768 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
3769 redundant arm_exidx_test.so.
3770 * testsuite/Makefile.in: Regenerate.
3771 (check_SCRIPTS): Add pr12826.sh
3772 (check_DATA): Add pr12826.stdout
3773 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
3774 * testsuite/pr12826.sh: New file.
3775 * testsuite/pr12826_1.s: Ditto.
3776 * testsuite/pr12826_1.s: Ditto.
3777
8dbe1edc
ILT
37782011-05-30 Ian Lance Taylor <iant@google.com>
3779
3780 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
3781 sections.
3782
c49875be
ILT
37832011-05-29 Ian Lance Taylor <iant@google.com>
3784
3785 PR gold/12804
3786 * testsuite/Makefile.am: Use different file name for two_file_test
3787 temporary file for each incremental test.
3788 * testsuite/Makefile.in: Rebuild.
3789
69d53f7a
ILT
37902011-05-29 Ian Lance Taylor <iant@google.com>
3791
3792 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
3793 binary input file is empty.
3794
41d0ab5f
ILT
37952011-05-27 Ian Lance Taylor <iant@google.com>
3796
3797 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
3798 (ver_test_9.so): Likewise.
3799 * testsuite/Makefile.in: Rebuild.
3800
89d8a36b
CC
38012011-05-26 Cary Coutant <ccoutant@google.com>
3802
3803 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
3804 * incremental.cc (Incremental_inputs::report_input_section): Fix
3805 comment, indentation.
3806 (Incremental_inputs::report_comdat_group): New function.
3807 (Output_section_incremental_inputs::set_final_data_size): Adjust size
3808 of data for incremental input file entry.
3809 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
3810 group count, COMDAT group signatures.
3811 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
3812 an unchanged input file.
3813 * incremental.h (Incremental_object_entry::Incremental_object_entry):
3814 Initialize new data member.
3815 (Incremental_object_entry::add_comdat_group): New function.
3816 (Incremental_object_entry::get_comdat_group_count): New function.
3817 (Incremental_object_entry::get_comdat_signature_key): New function.
3818 (Incremental_object_entry::groups_): New data member.
3819 (Incremental_inputs::report_comdat_group): New function.
3820 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
3821 data for incremental input file entry.
3822 (Incremental_input_entry_reader::get_comdat_group_count): New function.
3823 (Incremental_input_entry_reader::get_input_section): Adjust size of
3824 data for incremental input file entry.
3825 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
3826 (Incremental_input_entry_reader::get_comdat_group_signature): New
3827 function.
3828 * object.cc (Sized_relobj::include_section_group): Report kept
3829 COMDAT groups for incremental links.
3830
1706a06f
ILT
38312011-05-24 David Meyer <pdox@google.com>
3832
3833 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
3834 with name parameter. Add found_name parameter.
3835 * fileread.cc (Input_file::find_file): Adjust code accordingly.
3836 * dirsearch.h (class Dirsearch): Update declaration.
3837
a10ae760
ILT
38382011-05-24 Ian Lance Taylor <iant@google.com>
3839
3840 * archive.cc (Library_base::should_include_member): Pull in object
3841 from archive if it defines the entry symbol.
3842 * parameters.cc (Parameters::entry): New function.
3843 * parameters.h (class Parameters): Declare entry.
3844 * output.h (class Output_file_header): Remove entry_ field.
3845 * output.cc (Output_file_header::Output_file_header): Remove entry
3846 parameter. Change all callers.
3847 (Output_file_header::entry): Use parameters->entry.
3848 * gold.cc (queue_middle_tasks): Likewise.
3849 * plugin.cc (Plugin_hook::run): Likewise.
3850
aa92d6ed
CC
38512011-05-24 Cary Coutant <ccoutant@google.com>
3852
3853 * gold.cc (queue_initial_tasks): Pass incremental base filename
3854 to Output_file::open_base_file; don't print error message.
3855 * incremental-dump.cc (main): Adjust call to
3856 Output_file::open_for_modification.
3857 * incremental-dump.cc (main): Likewise.
3858 * incremental.cc (Incremental_inputs::report_command_line):
3859 Ignore --incremental-base option when comparing command lines.
3860 Ignore parameter when given as separate argument.
3861 * options.h (class General_options): Add --incremental-base.
3862 * output.cc (Output_file::Output_file):
3863 (Output_file::open_base_file): Add base_name and writable parameters;
3864 read base file into new file; print error message here.
3865 (Output_file::map_no_anonymous): Add writable parameter; adjust all
3866 callers.
3867 * output.h (Output_file::open_for_modification): Rename to...
3868 (Output_file::open_base_file): ...this; add base_name and
3869 writable parameters; adjust all callers.
3870 (Output_file::map_no_anonymous): Add writable parameter; adjust all
3871 callers.
3872 * testsuite/Makefile.am (incremental_test_4): Test
3873 --incremental-base.
3874 * testsuite/Makefile.in: Regenerate.
3875
2eedd706
CC
38762011-05-24 Cary Coutant <ccoutant@google.com>
3877
3878 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
3879 incremental_test_4.
3880 * testsuite/Makefile.in: Regenerate.
3881 * testsuite/two_file_test_1_v1.cc: New test source file.
3882 * testsuite/two_file_test_1b_v1.cc: New test source file.
3883 * testsuite/two_file_test_2_v1.cc: New test source file.
3884
0f1c85a6
CC
38852011-05-24 Cary Coutant <ccoutant@google.com>
3886
3887 * dynobj.h (Dynobj::do_dynobj): New function.
3888 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
3889 flag and soname for shared objects.
3890 * incremental.cc (Incremental_inputs::report_object): Make
3891 either Incremental_object_entry or Incremental_dynobj_entry; add
3892 soname to string table.
3893 (Incremental_inputs::report_input_section): Add assertion.
3894 (Output_section_incremental_inputs::set_final_data_size): Adjust
3895 type of input file entry for shared libraries; adjust size of
3896 shared library info entry.
3897 (Output_section_incremental_inputs::write_input_files): Write
3898 as_needed flag for shared libraries.
3899 (Output_section_incremental_inputs::write_info_blocks): Adjust type
3900 of input file entry for shared libraries; write soname.
3901 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
3902 soname from incremental info.
3903 * incremental.h (enum Incremental_input_flags): Add
3904 INCREMENTAL_INPUT_AS_NEEDED.
3905 (Incremental_input_entry::Incremental_input_entry): Initialize new
3906 data member.
3907 (Incremental_input_entry::set_as_needed): New function.
3908 (Incremental_input_entry::as_needed): New function.
3909 (Incremental_input_entry::do_dynobj_entry): New function.
3910 (Incremental_input_entry::as_needed_): New data member.
3911 (Incremental_object_entry::Incremental_object_entry): Don't check
3912 for shared library.
3913 (Incremental_object_entry::do_type): Likewise.
3914 (class Incremental_dynobj_entry): New class.
3915 (Incremental_input_entry_reader::as_needed): New function.
3916 (Incremental_input_entry_reader::get_soname): New function.
3917 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
3918 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
3919 size of shared library info entry.
58797674 3920 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
3921 incremental link when adding DT_NEEDED entries.
3922 * object.h (Object::Object): Initialize new data member.
3923 (Object::dynobj): New function.
3924 (Object::set_as_needed): New function.
3925 (Object::as_needed): New function.
3926 (Object::do_dynobj): New function.
3927 (Object::as_needed_): New data member.
3928
6fa2a40b
CC
39292011-05-24 Cary Coutant <ccoutant@google.com>
3930
3931 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
3932 info; adjust display of GOT entries.
3933 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
3934 vector of input objects; remove file_status_.
3935 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
3936 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
3937 got_plt reader; call target hooks to reserve GOT entries.
3938 (Output_section_incremental_inputs::set_final_data_size): Adjust size
3939 of input file info header and GOT info entry.
3940 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
3941 relocation info.
3942 (Got_plt_view_info::got_descriptor): Remove.
3943 (Got_plt_view_info::sym_index): New data member.
3944 (Got_plt_view_info::input_index): New data member.
3945 (Local_got_offset_visitor::visit): Write input file index.
3946 (Global_got_offset_visitor::visit): Write 0 for input file index.
3947 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
3948 with sym_index and input_index.
3949 (Output_section_incremental_inputs::write_got_plt): Adjust size of
3950 incremental info GOT entry; replace got_descriptor with input_index.
3951 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
3952 map from input file index to object.
3953 (Sized_relobj_incr::do_layout): Replace direct data member reference
3954 with accessor function.
3955 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
3956 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
3957 Adjust size of input file info header.
3958 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
3959 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
3960 (Incremental_input_entry_reader::get_input_section): Adjust size of
3961 input file info header.
3962 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
3963 of incremental info GOT entry.
3964 (Incremental_got_plt_reader::get_got_desc): Remove.
3965 (Incremental_got_plt_reader::get_got_symndx): New function.
3966 (Incremental_got_plt_reader::get_got_input_index): New function.
3967 (Sized_incremental_binary::Sized_incremental_binary): Remove
3968 file_status_; add input_objects_.
3969 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
3970 (Sized_incremental_binary::set_file_is_unchanged): Remove.
3971 (Sized_incremental_binary::file_is_unchanged): Remove.
3972 (Sized_incremental_binary::set_input_object): New function.
3973 (Sized_incremental_binary::input_object): New function.
3974 (Sized_incremental_binary::file_status_): Remove.
3975 (Sized_incremental_binary::input_objects_): New data member.
3976 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
3977 references.
3978 (Sized_relobj_incr::invalid_address): Move to base class.
3979 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
3980 class.
3981 (Sized_relobj_incr::do_output_section_offset): Likewise.
3982 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
3983 (Sized_relobj_incr::section_offsets_): Likewise.
3984 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
3985 function.
3986 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
3987 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
3988 with accessor function.
3989 (Sized_relobj_file::do_layout): Likewise.
3990 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
3991 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
3992 (Sized_relobj_file::compute_final_local_value): Replace refs to
3993 section_offsets_ with accessor function.
3994 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
3995 * object.h (Relobj::Relobj): Initialize new data members.
3996 (Relobj::add_dyn_reloc): New function.
3997 (Relobj::first_dyn_reloc): New function.
3998 (Relobj::dyn_reloc_count): New function.
3999 (Relobj::first_dyn_reloc_): New data member.
4000 (Relobj::dyn_reloc_count_): New data member.
4001 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
4002 references.
4003 (Sized_relobj::Address): New typedef.
4004 (Sized_relobj::invalid_address): Move here from child class.
4005 (Sized_relobj::Sized_relobj): Initialize new data members.
4006 (Sized_relobj::sized_relobj): New function.
4007 (Sized_relobj::is_output_section_offset_invalid): Move here from
4008 child class.
4009 (Sized_relobj::get_output_section_offset): Likewise.
4010 (Sized_relobj::local_has_got_offset): Likewise.
4011 (Sized_relobj::local_got_offset): Likewise.
4012 (Sized_relobj::set_local_got_offset): Likewise.
4013 (Sized_relobj::do_for_all_local_got_entries): Likewise.
4014 (Sized_relobj::clear_got_offsets): New function.
4015 (Sized_relobj::section_offsets): Move here from child class.
4016 (Sized_relobj::do_output_section_offset): Likewise.
4017 (Sized_relobj::do_set_section_offset): Likewise.
4018 (Sized_relobj::Local_got_offsets): Likewise.
4019 (Sized_relobj::local_got_offsets_): Likewise.
4020 (Sized_relobj::section_offsets_): Likewise.
4021 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
4022 references.
4023 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
4024 class.
4025 (Sized_relobj_file::sized_relobj): New function
4026 (Sized_relobj_file::local_has_got_offset): Move to base class.
4027 (Sized_relobj_file::local_got_offset): Likewise.
4028 (Sized_relobj_file::set_local_got_offset): Likewise.
4029 (Sized_relobj_file::get_output_section_offset): Likewise.
4030 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
4031 (Sized_relobj_file::do_output_section_offset): Likewise.
4032 (Sized_relobj_file::do_set_section_offset): Likewise.
4033 (Sized_relobj_file::Local_got_offsets): Likewise.
4034 (Sized_relobj_file::local_got_offsets_): Likewise.
4035 (Sized_relobj_file::section_offsets_): Likewise.
4036 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
4037 (all constructors).
4038 (set_needs_dynsym_index): Convert relobj to derived class pointer.
4039 (Output_reloc::get_symbol_index): Likewise.
4040 (Output_reloc::local_section_offset): Likewise.
4041 (Output_reloc::get_address): Likewise.
4042 (Output_reloc::symbol_value): Likewise.
4043 (Output_data_got::reserve_slot): Move to class definition.
4044 (Output_data_got::reserve_local): New function.
4045 (Output_data_got::reserve_slot_for_global): Remove.
4046 (Output_data_got::reserve_global): New function.
4047 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
4048 (all constructors, two instantiations).
4049 (Output_reloc::get_relobj): New function (two instantiations).
4050 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
4051 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
4052 (Output_data_reloc::add_global): Adjust type of relobj.
4053 (Output_data_reloc::add_global_relative): Likewise.
4054 (Output_data_reloc::add_symbolless_global_addend): Likewise.
4055 (Output_data_reloc::add_local): Likewise.
4056 (Output_data_reloc::add_local_relative): Likewise.
4057 (Output_data_reloc::add_symbolless_local_addend): Likewise.
4058 (Output_data_reloc::add_local_section): Likewise.
4059 (Output_data_reloc::add_output_section): Likewise.
4060 (Output_data_reloc::add_absolute): Likewise.
4061 (Output_data_reloc::add_target_specific): Likewise.
4062 (Output_data_got::reserve_slot): Move definition here.
4063 (Output_data_got::reserve_local): New function.
4064 (Output_data_got::reserve_global): New function.
4065 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
4066 section_offsets_ with accessor function.
4067 (Sized_relobj_file::write_sections): Likewise.
4068 (Sized_relobj_file::do_relocate_sections): Likewise.
4069 * target.h (Sized_target::reserve_local_got_entry): New function.
4070 (Sized_target::reserve_global_got_entry): New function.
4071 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
4072 (Target_x86_64::reserve_global_got_entry): New function.
4073 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
4074
4829d394
CC
40752011-05-23 Cary Coutant <ccoutant@google.com>
4076
4077 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
4078 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
4079 bit when checking got_type.
4080 * incremental.cc (Sized_incremental_binary::setup_readers):
4081 Store symbol table and string table locations; initialize bit vector
4082 of file status flags.
4083 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
4084 unchanged files.
4085 (Sized_incremental_binary::do_process_got_plt): New function.
4086 (Sized_incremental_binary::get_symtab_view): Use stored locations.
4087 (Output_section_incremental_inputs::set_final_data_size): Record
4088 file index for each input file.
4089 (Output_section_incremental_inputs::write_got_plt): Store file index
4090 instead of input entry offset for each GOT entry.
4091 * incremental.h
4092 (Incremental_input_entry::Incremental_input_entry): Initialize new
4093 data member.
4094 (Incremental_input_entry::set_offset): Store file index.
4095 (Incremental_input_entry::get_file_index): New function.
4096 (Incremental_input_entry::file_index_): New data member.
4097 (Incremental_binary::process_got_plt): New function.
4098 (Incremental_binary::do_process_got_plt): New function.
4099 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
4100 data members.
4101 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
4102 (Sized_incremental_binary::set_file_is_unchanged): New function.
4103 (Sized_incremental_binary::file_is_unchanged): New function.
4104 (Sized_incremental_binary::do_process_got_plt): New function.
4105 (Sized_incremental_binary::file_status_): New data member.
4106 (Sized_incremental_binary::main_symtab_loc_): New data member.
4107 (Sized_incremental_binary::main_strtab_loc_): New data member.
4108 * output.cc (Output_data_got::Got_entry::write): Add case
4109 RESERVED_CODE.
4110 (Output_data_got::add_global): Call add_got_entry.
4111 (Output_data_got::add_global_plt): Likewise.
4112 (Output_data_got::add_global_with_rel): Likewise.
4113 (Output_data_got::add_global_with_rela): Likewise.
4114 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
4115 (Output_data_got::add_global_pair_with_rela): Likewise.
4116 (Output_data_got::add_local): Call add_got_entry.
4117 (Output_data_got::add_local_plt): Likewise.
4118 (Output_data_got::add_local_with_rel): Likewise.
4119 (Output_data_got::add_local_with_rela): Likewise.
4120 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
4121 (Output_data_got::add_local_pair_with_rela): Likewise.
4122 (Output_data_got::reserve_slot): New function.
4123 (Output_data_got::reserve_slot_for_global): New function.
4124 (Output_data_got::add_got_entry): New function.
4125 (Output_data_got::add_got_entry_pair): New function.
4126 (Output_section::add_output_section_data): Edit FIXME.
4127 * output.h
4128 (Output_section_data_build::Output_section_data_build): New
4129 constructor with size parameter.
4130 (Output_data_space::Output_data_space): Likewise.
4131 (Output_data_got::Output_data_got): Initialize new data member; new
4132 constructor with size parameter.
4133 (Output_data_got::add_constant): Call add_got_entry.
4134 (Output_data_got::reserve_slot): New function.
4135 (Output_data_got::reserve_slot_for_global): New function.
4136 (class Output_data_got::Got_entry): Add RESERVED_CODE.
4137 (Output_data_got::add_got_entry): New function.
4138 (Output_data_got::add_got_entry_pair): New function.
4139 (Output_data_got::free_list_): New data member.
4140 * target.h (Sized_target::init_got_plt_for_update): New function.
4141 (Sized_target::register_global_plt_entry): New function.
4142 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4143 Initialize new data member; call init; add constructor with PLT count.
4144 (Output_data_plt_x86_64::init): New function.
4145 (Output_data_plt_x86_64::add_relocation): New function.
4146 (Output_data_plt_x86_64::reserve_slot): New function.
4147 (Output_data_plt_x86_64::free_list_): New data member.
4148 (Target_x86_64::init_got_plt_for_update): New function.
4149 (Target_x86_64::register_global_plt_entry): New function.
4150 (Output_data_plt_x86_64::add_entry): Allocate from free list for
4151 incremental updates.
4152 (Output_data_plt_x86_64::add_relocation): New function.
4153 * testsuite/object_unittest.cc (Object_test): Set default options.
4154
ec69d6da
ILT
41552011-05-16 Ian Lance Taylor <iant@google.com>
4156
4157 * options.h (class General_options): Make -i a synonym for -r.
4158
732e31de
ILT
41592011-05-16 Ian Lance Taylor <iant@google.com>
4160
4161 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
4162
403676b5
CC
41632011-05-10 Cary Coutant <ccoutant@google.com>
4164
4165 * object.cc (Sized_relobj::do_count_local_symbols): Check for
4166 strip_all (-s).
4167
5b7b7d6e
ILT
41682011-05-06 Ian Lance Taylor <iant@google.com>
4169
4170 * layout.cc (Layout::layout): If the output section flags change,
4171 update the ordering.
4172
f0f9babf
CC
41732011-04-25 Cary Coutant <ccoutant@google.com>
4174
4175 * incremental-dump.cc (dump_incremental_inputs): Print local
4176 symbol info for each input file.
4177 * incremental.cc
4178 (Output_section_incremental_inputs::set_final_data_size): Add local
4179 symbol info to input file entries in incremental info.
4180 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4181 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
4182 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
4183 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
4184 implementation.
4185 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
4186 (Sized_incr_relobj::do_relocate): Write the local symbols.
4187 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
4188 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
4189 Adjust size of input file header.
4190 (Incremental_inputs_reader::get_local_symbol_offset): New function.
4191 (Incremental_inputs_reader::get_local_symbol_count): New function.
4192 (Incremental_inputs_reader::get_input_section): Adjust size of input
4193 file header.
4194 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
4195 (Sized_incr_relobj::This): New typedef.
4196 (Sized_incr_relobj::sym_size): New const data member.
4197 (Sized_incr_relobj::Local_symbol): New struct.
4198 (Sized_incr_relobj::do_output_local_symbol_count): New function.
4199 (Sized_incr_relobj::do_local_symbol_offset): New function.
4200 (Sized_incr_relobj::local_symbol_count_): New data member.
4201 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
4202 (Sized_incr_relobj::local_symbol_index_): New data member.
4203 (Sized_incr_relobj::local_symbol_offset_): New data member.
4204 (Sized_incr_relobj::local_dynsym_offset_): New data member.
4205 (Sized_incr_relobj::local_symbols_): New data member.
4206 * object.h (Relobj::output_local_symbol_count): New function.
4207 (Relobj::local_symbol_offset): New function.
4208 (Relobj::do_output_local_symbol_count): New function.
4209 (Relobj::do_local_symbol_offset): New function.
4210 (Sized_relobj::do_output_local_symbol_count): New function.
4211 (Sized_relobj::do_local_symbol_offset): New function.
4212
d0a9ace3
ILT
42132011-04-22 Vladimir Simonov <sv@sw.ru>
4214
4215 * descriptors.cc (set_close_on_exec): New function.
4216 (Descriptors::open): Use set_close_on_exec.
4217 * output.cc (S_ISLNK): Define if not defined.
4218
94a3fc8b
CC
42192011-04-22 Cary Coutant <ccoutant@google.com>
4220
4221 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
4222 global symbol map.
4223 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
4224 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
4225 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
4226 relocations.
4227 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
4228 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
4229 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
4230 * incremental.h
4231 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
4232 function.
4233 (Incremental_binary::apply_incremental_relocs): New function.
4234 (Incremental_binary::do_apply_incremental_relocs): New function.
4235 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
4236 data member.
4237 (Sized_incremental_binary::add_global_symbol): New function.
4238 (Sized_incremental_binary::global_symbol): New function.
4239 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
4240 (Sized_incremental_binary::symbol_map_): New data member.
4241 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
4242 * target.h (Sized_target::apply_relocation): New function.
4243 * target-reloc.h (apply_relocation): New function.
4244 * x86_64.cc (Target_x86_64::apply_relocation): New function.
4245
c87e4302
DK
42462011-04-22 Doug Kwan <dougkwan@google.com>
4247
4248 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
4249 flag of a SHT_ARM_EXIDX section.
2e702c99 4250 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
4251 * testsuite/Makefile.in: Regenerate.
4252 * testsuite/arm_exidx_test.s: New file.
4253 * testsuite/arm_exidx_test.sh: Same.
4254
e7782cf6
CC
42552011-04-20 Cary Coutant <ccoutant@google.com>
4256
4257 PR gold/12689
4258 * archive.h (Incremental_archive_entry::Archive_member):
4259 Initialize arg_serial_ (second constructor).
4260
308ecdc7
ILT
42612011-04-17 Ian Lance Taylor <iant@google.com>
4262
4263 * object.cc (Relocate_info::location): Simplify location string.
4264 * errors.cc (Errors::error_at_location): Don't print program
4265 name.
4266 (Errors::warning_at_location): Likewise.
4267 (Errors::undefined_symbol): Likewise.
4268 * testsuite/debug_msg.sh: Update accordingly.
4269
bec5b579
CC
42702011-04-14 Cary Coutant <ccoutant@google.com>
4271
4272 * gold/layout.cc (Layout::symtab_section_offset): New function.
4273 * gold/layout.h (Layout::symtab_section_offset): New function.
4274 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
4275
88597d34
ILT
42762011-04-12 Ian Lance Taylor <iant@google.com>
4277
4278 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
4279 with MREMAP_MAYMOVE.
4280 * output.h (class Output_file): Add map_is_allocated_ field.
4281 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
4282 not available, provide stubs. If mremap is not available, #define
4283 it to gold_mremap.
4284 (MREMAP_MAYMOVE): Define if not defined.
4285 (Output_file::Output_file): Initialize map_is_allocated_.
4286 (Output_file::resize): Check map_is_allocated_.
4287 (Output_file::map_anonymous): If mmap fails, use malloc.
4288 (Output_file::unmap): Don't do anything for an anonymous map.
4289 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
4290 is not available, provide stubs.
4291 (File_read::View::~View): Use free rather than delete[].
4292 (File_read::make_view): Use malloc rather than new[]. If mmap
4293 fails, use malloc.
4294 (File_read::find_or_make_view): Use malloc rather than new[].
4295 * gold.h: Remove HAVE_REMAP code.
4296 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
4297 exists. Rename mremap to gold_mremap. If mmap is not available
4298 don't do anything.
4299 * configure, config.in: Rebuild.
4300
11e361bc
ILT
43012011-04-11 Ian Lance Taylor <iant@google.com>
4302
4303 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
4304 initialize local variable v.
4305
cdc29364
CC
43062011-04-11 Cary Coutant <ccoutant@google.com>
4307
4308 * archive.cc (Archive::include_member): Adjust call to
4309 report_object.
4310 (Add_archive_symbols::run): Track argument serial numbers.
4311 (Lib_group::include_member): Likewise.
4312 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
4313 * archive.h (Incremental_archive_entry::Archive_member):
4314 Initialize arg_serial_.
4315 (Archive_member::arg_serial_): New data member.
4316 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
4317 (Sized_dynobj::do_add_symbols): Track symbols when doing an
4318 incremental link.
4319 (Sized_dynobj::do_for_all_local_got_entries): New function.
4320 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
4321 function.
4322 * fileread.cc (get_mtime): New function.
4323 * fileread.h (get_mtime): New function.
4324 * gold.cc (queue_initial_tasks): Check for incremental update.
4325 (process_incremental_input): New function.
4326 (queue_middle_tasks): Don't force valid target for incremental
4327 update.
4328 * incremental-dump.cc (find_input_containing_global): Adjust
4329 size of symbol info entry.
4330 (dump_incremental_inputs): Dump argument serial number and
4331 in_system_directory flag; bias shndx by 1; print symbol names
4332 when dumping per-file symbol lists; use new symbol info readers.
4333 * incremental.cc
4334 (Output_section_incremental_inputs:update_data_size): New function.
4335 (Sized_incremental_binary::setup_readers): Setup input readers
4336 for each input file; build maps for files added from libraries
4337 and scripts.
4338 (Sized_incremental_binary::check_input_args): New function.
4339 (Sized_incremental_binary::do_check_inputs): Build map of argument
4340 serial numbers to input arguments.
4341 (Sized_incremental_binary::do_file_has_changed): Rename
4342 do_file_is_unchanged to this; compare file modification times.
4343 (Sized_incremental_binary::do_init_layout): New function.
4344 (Sized_incremental_binary::do_reserve_layout): New function.
4345 (Sized_incremental_binary::do_get_input_reader): Remove.
4346 (Sized_incremental_binary::get_symtab_view): New function.
4347 (Incremental_checker::can_incrementally_link_output_file): Remove.
4348 (Incremental_inputs::report_command_line): Exclude --debug options.
4349 (Incremental_inputs::report_archive_begin): Add parameter; track
4350 argument serial numbers; don't put input file entry for archive
4351 before archive members.
4352 (Incremental_inputs::report_archive_end): Put input file entry
4353 for archive after archive members.
4354 (Incremental_inputs::report_object): Add parameter; track argument
4355 serial numbers and in_system_directory flag.
4356 (Incremental_inputs::report_script): Add parameter; track argument
4357 serial numbers.
4358 (Output_section_incremental_inputs::set_final_data_size): Adjust
4359 size of symbol info entry; check for forwarding symbols.
4360 (Output_section_incremental_inputs::write_input_files): Write
4361 in_system_directory flag and argument serial number.
4362 (Output_section_incremental_inputs::write_info_blocks): Map section
4363 indices between incremental info and original input file; store
4364 input section index for each symbol.
4365 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
4366 change operator() to visit().
4367 (class Global_got_offset_visitor): Likewise.
4368 (class Global_symbol_visitor_got_plt):
4369 (Output_section_incremental_inputs::write_got_plt): Use new visitor
4370 classes.
4371 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
4372 (Sized_incr_relobj::do_read_symbols): New function.
4373 (Sized_incr_relobj::do_layout): New function.
4374 (Sized_incr_relobj::do_layout_deferred_sections): New function.
4375 (Sized_incr_relobj::do_add_symbols): New function.
4376 (Sized_incr_relobj::do_should_include_member): New function.
4377 (Sized_incr_relobj::do_for_all_global_symbols): New function.
4378 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
4379 (Sized_incr_relobj::do_section_size): New function.
4380 (Sized_incr_relobj::do_section_name): New function.
4381 (Sized_incr_relobj::do_section_contents): New function.
4382 (Sized_incr_relobj::do_section_flags): New function.
4383 (Sized_incr_relobj::do_section_entsize): New function.
4384 (Sized_incr_relobj::do_section_address): New function.
4385 (Sized_incr_relobj::do_section_type): New function.
4386 (Sized_incr_relobj::do_section_link): New function.
4387 (Sized_incr_relobj::do_section_info): New function.
4388 (Sized_incr_relobj::do_section_addralign): New function.
4389 (Sized_incr_relobj::do_initialize_xindex): New function.
4390 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
4391 (Sized_incr_relobj::do_read_relocs): New function.
4392 (Sized_incr_relobj::do_gc_process_relocs): New function.
4393 (Sized_incr_relobj::do_scan_relocs): New function.
4394 (Sized_incr_relobj::do_count_local_symbols): New function.
4395 (Sized_incr_relobj::do_finalize_local_symbols): New function.
4396 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
4397 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
4398 (Sized_incr_relobj::do_relocate): New function.
4399 (Sized_incr_relobj::do_set_section_offset): New function.
4400 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
4401 (Sized_incr_dynobj::do_read_symbols): New function.
4402 (Sized_incr_dynobj::do_layout): New function.
4403 (Sized_incr_dynobj::do_add_symbols): New function.
4404 (Sized_incr_dynobj::do_should_include_member): New function.
4405 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
4406 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
4407 (Sized_incr_dynobj::do_section_size): New function.
4408 (Sized_incr_dynobj::do_section_name): New function.
4409 (Sized_incr_dynobj::do_section_contents): New function.
4410 (Sized_incr_dynobj::do_section_flags): New function.
4411 (Sized_incr_dynobj::do_section_entsize): New function.
4412 (Sized_incr_dynobj::do_section_address): New function.
4413 (Sized_incr_dynobj::do_section_type): New function.
4414 (Sized_incr_dynobj::do_section_link): New function.
4415 (Sized_incr_dynobj::do_section_info): New function.
4416 (Sized_incr_dynobj::do_section_addralign): New function.
4417 (Sized_incr_dynobj::do_initialize_xindex): New function.
4418 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
4419 (make_sized_incremental_object): New function.
4420 (Incremental_library::copy_unused_symbols): New function.
4421 (Incremental_library::do_for_all_unused_symbols): New function.
4422 * incremental.h (enum Incremental_input_flags): New type.
4423 (class Incremental_checker): Remove.
4424 (Incremental_input_entry::Incremental_input_entry): Add argument
4425 serial number.
4426 (Incremental_input_entry::arg_serial): New function.
4427 (Incremental_input_entry::set_is_in_system_directory): New function.
4428 (Incremental_input_entry::is_in_system_directory): New function.
4429 (Incremental_input_entry::arg_serial_): New data member.
4430 (Incremental_input_entry::is_in_system_directory_): New data member.
4431 (class Script_info): Move here from script.h.
4432 (Script_info::Script_info): Add filename parameter.
4433 (Script_info::filename): New function.
4434 (Script_info::filename_): New data member.
4435 (Incremental_script_entry::Incremental_script_entry): Add argument
4436 serial number.
4437 (Incremental_object_entry::Incremental_object_entry): Likewise.
4438 (Incremental_object_entry::add_input_section): Build list of input
4439 sections with map to original shndx.
4440 (Incremental_object_entry::get_input_section_index): New function.
4441 (Incremental_object_entry::shndx_): New data member.
4442 (Incremental_object_entry::name_key_): Rename; adjust all refs.
4443 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
4444 (Incremental_archive_entry::Incremental_archive_entry): Add argument
4445 serial number.
4446 (Incremental_inputs::report_archive_begin): Likewise.
4447 (Incremental_inputs::report_object): Likewise.
4448 (Incremental_inputs::report_script): Likewise.
4449 (class Incremental_global_symbol_reader): New class.
4450 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
4451 and store flags and input file type.
4452 (Incremental_input_entry_reader::arg_serial): New function.
4453 (Incremental_input_entry_reader::type): Extract type from flags.
4454 (Incremental_input_entry_reader::is_in_system_directory): New function.
4455 (Incremental_input_entry_reader::get_input_section_count): Call
4456 accessor function for type.
4457 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
4458 function for type; adjust size of global symbol entry.
4459 (Incremental_input_entry_reader::get_global_symbol_count): Call
4460 accessor function for type.
4461 (Incremental_input_entry_reader::get_object_count): Likewise.
4462 (Incremental_input_entry_reader::get_object_offset): Likewise.
4463 (Incremental_input_entry_reader::get_member_count): Likewise.
4464 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
4465 (Incremental_input_entry_reader::get_member_offset): Likewise.
4466 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
4467 (Incremental_input_entry_reader::Global_symbol_info): Remove.
4468 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
4469 (Incremental_input_entry_reader::get_global_symbol_reader): New
4470 function.
4471 (Incremental_input_entry_reader::get_output_symbol_index): New
4472 function.
4473 (Incremental_input_entry_reader::type_): Remove.
4474 (Incremental_input_entry_reader::flags_): New data member.
4475 (Incremental_inputs_reader::input_file_offset): New function.
4476 (Incremental_inputs_reader::input_file_index): New function.
4477 (Incremental_inputs_reader::input_file): Call input_file_offset.
4478 (Incremental_inputs_reader::input_file_at_offset): New function.
4479 (Incremental_relocs_reader::get_r_type): Reformat.
4480 (Incremental_relocs_reader::get_r_shndx): Reformat.
4481 (Incremental_relocs_reader::get_r_offset): Reformat.
4482 (Incremental_relocs_reader::data): New function.
4483 (Incremental_binary::Incremental_binary): Initialize new data members.
4484 (Incremental_binary::check_inputs): Add cmdline parameter.
4485 (Incremental_binary::file_is_unchanged): Remove.
4486 (Input_reader::arg_serial): New function.
4487 (Input_reader::get_unused_symbol_count): New function.
4488 (Input_reader::get_unused_symbol): New function.
4489 (Input_reader::do_arg_serial): New function.
4490 (Input_reader::do_get_unused_symbol_count): New function.
4491 (Input_reader::do_get_unused_symbol): New function.
4492 (Incremental_binary::input_file_count): New function.
4493 (Incremental_binary::get_input_reader): Change signature to use
4494 index instead of filename.
4495 (Incremental_binary::file_has_changed): New function.
4496 (Incremental_binary::get_input_argument): New function.
4497 (Incremental_binary::get_library): New function.
4498 (Incremental_binary::get_script_info): New function.
4499 (Incremental_binary::init_layout): New function.
4500 (Incremental_binary::reserve_layout): New function.
4501 (Incremental_binary::output_file): New function.
4502 (Incremental_binary::do_check_inputs): New function.
4503 (Incremental_binary::do_file_is_unchanged): Remove.
4504 (Incremental_binary::do_file_has_changed): New function.
4505 (Incremental_binary::do_init_layout): New function.
4506 (Incremental_binary::do_reserve_layout): New function.
4507 (Incremental_binary::do_input_file_count): New function.
4508 (Incremental_binary::do_get_input_reader): Change signature.
4509 (Incremental_binary::input_args_map_): New data member.
4510 (Incremental_binary::library_map_): New data member.
4511 (Incremental_binary::script_map_): New data member.
4512 (Sized_incremental_binary::Sized_incremental_binary): Initialize
4513 new data members.
4514 (Sized_incremental_binary::output_section): New function.
4515 (Sized_incremental_binary::inputs_reader): Add const.
4516 (Sized_incremental_binary::symtab_reader): Add const.
4517 (Sized_incremental_binary::relocs_reader): Add const.
4518 (Sized_incremental_binary::got_plt_reader): Add const.
4519 (Sized_incremental_binary::get_symtab_view): New function.
4520 (Sized_incremental_binary::Inputs_reader): New typedef.
4521 (Sized_incremental_binary::Input_entry_reader): New typedef.
4522 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
4523 (Sized_incremental_binary::do_file_is_unchanged): Remove.
4524 (Sized_incremental_binary::do_file_has_changed): New function.
4525 (Sized_incremental_binary::do_init_layout): New function.
4526 (Sized_incremental_binary::do_reserve_layout): New function.
4527 (Sized_input_reader::Inputs_reader): Remove.
4528 (Sized_input_reader::Input_entry_reader): Remove.
4529 (Sized_input_reader::do_arg_serial): New function.
4530 (Sized_input_reader::do_get_unused_symbol_count): New function.
4531 (Sized_input_reader::do_get_unused_symbol): New function.
4532 (Sized_incremental_binary::do_input_file_count): New function.
4533 (Sized_incremental_binary::do_get_input_reader): Change signature;
4534 use index instead of filename.
4535 (Sized_incremental_binary::section_map_): New data member.
4536 (Sized_incremental_binary::input_entry_readers_): New data member.
4537 (class Sized_incr_relobj): New class.
4538 (class Sized_incr_dynobj): New class.
4539 (make_sized_incremental_object): New function.
4540 (class Incremental_library): New class.
4541 * layout.cc (Free_list::num_lists): New static data member.
4542 (Free_list::num_nodes): New static data member.
4543 (Free_list::num_removes): New static data member.
4544 (Free_list::num_remove_visits): New static data member.
4545 (Free_list::num_allocates): New static data member.
4546 (Free_list::num_allocate_visits): New static data member.
4547 (Free_list::init): New function.
4548 (Free_list::remove): New function.
4549 (Free_list::allocate): New function.
4550 (Free_list::dump): New function.
4551 (Free_list::print_stats): New function.
4552 (Layout_task_runner::run): Resize output file for incremental updates.
4553 (Layout::Layout): Initialize new data members.
4554 (Layout::set_incremental_base): New function.
4555 (Layout::init_fixed_output_section): New function.
4556 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
4557 incremental updates.
4558 (Layout::create_gold_note): Do not create gold note section for
4559 incremental updates.
4560 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
4561 for incremental updates.
4562 (Layout::set_section_offsets): For incremental updates, allocate space
4563 from free list.
4564 (Layout::create_symtab_sections): Layout with offsets relative to
4565 start of section; for incremental updates, allocate space from free
4566 list.
4567 (Layout::create_shdrs): For incremental updates, allocate space from
4568 free list.
4569 (Layout::finish_dynamic_section): For incremental updates, do not
4570 check --as-needed (fixed in subsequent patch).
4571 * layout.h (class Free_list): New class.
4572 (Layout::set_incremental_base): New function.
4573 (Layout::incremental_base): New function.
4574 (Layout::init_fixed_output_section): New function.
4575 (Layout::allocate): New function.
4576 (Layout::incremental_base_): New data member.
4577 (Layout::free_list_): New data member.
4578 * main.cc (main): Print Free_list statistics.
4579 * object.cc (Relobj::finalize_incremental_relocs): Add
4580 clear_counts parameter; clear counts only when clear_counts is set.
4581 (Sized_relobj::Sized_relobj): Initialize new base class.
4582 (Sized_relobj::do_layout): Don't report special sections.
4583 (Sized_relobj::do_for_all_local_got_entries): New function.
4584 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
4585 symtab_off to all symbol table offsets.
4586 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
4587 * object.h (class Got_offset_list): Move to top of file.
4588 (Object::Object): Allow case where input_file == NULL.
4589 (Object::~Object): Likewise.
4590 (Object::input_file): Assert that input_file != NULL.
4591 (Object::lock): Allow case where input_file == NULL.
4592 (Object::unlock): Likewise.
4593 (Object::is_locked): Likewise.
4594 (Object::token): Likewise.
4595 (Object::release): Likewise.
4596 (Object::is_incremental): New function.
4597 (Object::get_mtime): New function.
4598 (Object::for_all_local_got_entries): New function.
4599 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
4600 (Object::set_is_in_system_directory): New function.
4601 (Object::is_in_system_directory): New function.
4602 (Object::do_is_incremental): New function.
4603 (Object::do_get_mtime): New function.
4604 (Object::do_for_all_local_got_entries): New function.
4605 (Object::is_in_system_directory_): New data member.
4606 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
4607 (class Sized_relobj_base): New class.
4608 (class Sized_relobj): Derive from Sized_relobj_base.
4609 (class Sized_relobj::Symbols): Redeclare from base class.
4610 (class Sized_relobj::local_got_offset_list): Remove.
4611 (class Sized_relobj::Output_sections): Redeclare from base class.
4612 (class Sized_relobj::do_for_all_local_got_entries): New function.
4613 (class Sized_relobj::write_local_symbols): Add offset parameter.
4614 (class Sized_relobj::local_symbol_offset_): Update comment.
4615 (class Sized_relobj::local_dynsym_offset_): Update comment.
4616 * options.cc (Input_arguments::add_file): Remove const.
4617 * options.h (Input_file_argument::Input_file_argument):
4618 Initialize arg_serial_ (all constructors).
4619 (Input_file_argument::set_arg_serial): New function.
4620 (Input_file_argument::arg_serial): New function.
4621 (Input_file_argument::arg_serial_): New data member.
4622 (Input_arguments::Input_arguments): Initialize file_count_.
4623 (Input_arguments::add_file): Remove const.
4624 (Input_arguments::number_of_input_files): New function.
4625 (Input_arguments::file_count_): New data member.
4626 (Command_line::number_of_input_files): Call
4627 Input_arguments::number_of_input_files.
4628 * output.cc (Output_segment_headers::Output_segment_headers):
4629 Set current size.
4630 (Output_section::Input_section::current_data_size): New function.
4631 (Output_section::Output_section): Initialize new data members.
4632 (Output_section::add_input_section): Don't do merge sections for
4633 an incremental link; allocate space from free list for an
4634 incremental update.
4635 (Output_section::add_output_section_data): Allocate space from
4636 free list for an incremental update.
4637 (Output_section::update_data_size): New function.
4638 (Output_section::set_fixed_layout): New function.
4639 (Output_section::reserve): New function.
4640 (Output_segment::set_section_addresses): Remove const.
4641 (Output_segment::set_section_list_addresses): Remove const; allocate
4642 space from free list for an incremental update.
4643 (Output_segment::set_offset): Adjust size of RELRO segment for an
4644 incremental update.
4645 * output.h (Output_data::current_data_size): Move here from
4646 child classes.
4647 (Output_data::pre_finalize_data_size): New function.
4648 (Output_data::update_data_size): New function.
4649 (Output_section_headers::update_data_size): new function.
4650 (Output_section_data_build::current_data_size): Move to Output_data.
4651 (Output_data_strtab::update_data_size): New function.
4652 (Output_section::current_data_size): Move to Output_data.
4653 (Output_section::set_fixed_layout): New function.
4654 (Output_section::has_fixed_layout): New function.
4655 (Output_section::reserve): New function.
4656 (Output_section::update_data_size): New function.
4657 (Output_section::has_fixed_layout_): New data member.
4658 (Output_section::free_list_): New data member.
4659 (Output_segment::set_section_addresses): Remove const.
4660 (Output_segment::set_section_list_addresses): Remove const.
4661 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
4662 New function.
4663 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
4664 New function.
4665 * readsyms.cc (Read_symbols::do_read_symbols): Add library
4666 parameter when calling Add_symbols constructor; store argument
4667 serial number for members of a lib group.
4668 (Add_symbols::locks): Allow case where token == NULL.
4669 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
4670 (Read_member::~Read_member): New function.
4671 (Read_member::is_runnable): New function.
4672 (Read_member::locks): New function.
4673 (Read_member::run): New function.
4674 (Check_script::~Check_script): New function.
4675 (Check_script::is_runnable): New function.
4676 (Check_script::locks): New function.
4677 (Check_script::run): New function.
4678 (Check_library::~Check_library): New function.
4679 (Check_library::is_runnable): New function.
4680 (Check_library::locks): New function.
4681 (Check_library::run): New function.
4682 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
4683 (Add_symbols::library_): New data member.
4684 (class Read_member): New class.
4685 (class Check_script): New class.
4686 (class Check_library): New class.
4687 * reloc.cc (Read_relocs::is_runnable): Allow case where
4688 token == NULL.
4689 (Read_relocs::locks): Likewise.
4690 (Scan_relocs::locks): Likewise.
4691 (Relocate_task::locks): Likewise.
4692 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
4693 to clear counters.
4694 (Sized_relobj::incremental_relocs_scan): Fix comment.
4695 (Sized_relobj::do_relocate): Pass output file offset to
4696 write_local_symbols.
4697 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
4698 from class declaration.
4699 * script.cc (read_input_script): Allocate Script_info; pass
4700 argument serial number to report_script.
4701 * script.h (class Script_info): Move to incremental.h.
4702 * symtab.cc (Symbol_table::add_from_incrobj): New function.
4703 * symtab.h (Symbol_table::add_from_incrobj): New function.
4704 (Symbol_table::set_file_offset): New function.
4705
b961d0d7
CC
47062011-04-05 Cary Coutant <ccoutant@google.com>
4707
4708 * incremental-dump.cc (dump_incremental_inputs): Change signature
4709 to take a Sized_incremental_binary; change caller. Use readers
4710 in Sized_incremental_binary.
4711 * incremental.cc
4712 (Sized_incremental_binary::find_incremental_inputs_sections):
4713 Rename do_find_incremental_inputs_sections to this.
4714 (Sized_incremental_binary::setup_readers): New function.
4715 (Sized_incremental_binary::do_check_inputs): Check
4716 has_incremental_info_ flag; move setup code to setup_readers;
4717 use input readers.
4718 (Sized_incremental_binary::do_file_is_unchanged): New function.
4719 (Sized_incremental_binary::do_get_input_reader): New function.
4720 * incremental.h (class Incremental_binary): Move to end of file.
4721 (Incremental_binary::file_is_unchanged): New function.
4722 (Incremental_binary::do_file_is_unchanged): New function.
4723 (Incremental_binary::Input_reader): New class.
4724 (Incremental_binary::get_input_reader): New function.
4725 (class Sized_incremental_binary): Move to end of file.
4726 (Sized_incremental_binary::Sized_incremental_binary): Setup the
4727 input section reader classes.
4728 (Sized_incremental_binary::has_incremental_info): New function.
4729 (Sized_incremental_binary::inputs_reader): New function.
4730 (Sized_incremental_binary::symtab_reader): New function.
4731 (Sized_incremental_binary::relocs_reader): New function.
4732 (Sized_incremental_binary::got_plt_reader): New function.
4733 (Sized_incremental_binary::do_file_is_unchanged): New function.
4734 (Sized_incremental_binary::Sized_input_reader): New class.
4735 (Sized_incremental_binary::get_input_reader): New function.
4736 (Sized_incremental_binary::find_incremental_inputs_sections):
4737 Rename do_find_incremental_inputs_sections to this.
4738 (Sized_incremental_binary::setup_readers): New function.
4739 (Sized_incremental_binary::has_incremental_info_): New data member.
4740 (Sized_incremental_binary::inputs_reader_): New data member.
4741 (Sized_incremental_binary::symtab_reader_): New data member.
4742 (Sized_incremental_binary::relocs_reader_): New data member.
4743 (Sized_incremental_binary::got_plt_reader_): New data member.
4744 (Sized_incremental_binary::current_input_file_): New data member.
4745
a869183f
PP
47462011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
4747
4748 PR gold/12640
4749 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
4750 violation.
4751
47522011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
4753
4754 * archive.cc (Archive::include_member): Adjust call to report_object.
4755 (Add_archive_symbols::run): Add script_info to call to
4756 report_archive_begin.
4757 (Lib_group::include_member): Adjust call to report_object.
4758 (Add_lib_group_symbols::run): Adjust call to report_object.
4759 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
4760 blocks. Add object count for script input files.
4761 * incremental.cc (Incremental_inputs::report_archive_begin): Add
4762 script_info parameter; change all callers.
4763 (Incremental_inputs::report_object): Add script_info parameter;
4764 change all callers.
4765 (Incremental_inputs::report_script): Store backpointer to
4766 incremental info entry.
4767 (Output_section_incremental_inputs::set_final_data_size): Record
4768 additional information for scripts.
4769 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4770 * incremental.h (Incremental_script_entry::add_object): New function.
4771 (Incremental_script_entry::get_object_count): New function.
4772 (Incremental_script_entry::get_object): New function.
4773 (Incremental_script_entry::objects_): New data member; adjust
4774 constructor.
4775 (Incremental_inputs::report_archive_begin): Add script_info parameter.
4776 (Incremental_inputs::report_object): Add script_info parameter.
4777 (Incremental_inputs_reader::get_object_count): New function.
4778 (Incremental_inputs_reader::get_object_offset): New function.
4779 * options.cc (Input_arguments::add_file): Return reference to
4780 new input argument.
4781 * options.h (Input_argument::set_script_info): New function.
4782 (Input_argument::script_info): New function.
4783 (Input_argument::script_info_): New data member; adjust all
4784 constructors.
4785 (Input_file_group::add_file): Return reference to new input argument.
4786 (Input_file_lib::add_file): Likewise.
4787 (Input_arguments::add_file): Likewise.
4788 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
4789 * script.cc (Parser_closure::Parser_closure): Add script_info
4790 parameter; adjust all callers.
4791 (Parser_closure::script_info): New function.
4792 (Parser_closure::script_info_): New data member.
4793 (read_input_script): Report scripts earlier to incremental info.
4794 (script_add_file): Set script_info in Input_argument.
4795 (script_add_library): Likewise.
4796 * script.h (Script_options::Script_info): Rewrite class.
4797
a869183f 47982011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
4799
4800 * archive.cc (Library_base::should_include_member): Move
4801 method here from class Archive.
4802 (Archive::Archive): Initialize base class.
4803 (Archive::should_include_member): Move to base class.
4804 (Archive::do_for_all_unused_symbols): New function.
4805 (Add_archive_symbols::run): Remove redundant access to
4806 incremental_inputs.
4807 (Lib_group::Lib_group): Initialize base class.
4808 (Lib_group::do_filename): New function.
4809 (Lib_group::include_member): Pass pointer to Lib_group to
4810 report_object.
4811 (Lib_group::do_for_all_unused_symbols): New function.
4812 (Add_lib_group_symbols::run): Report archive information for
4813 incremental links.
4814 * archive.h (class Library_base): New base class.
4815 (class Archive): Derive from Library_base.
4816 (Archive::filename): Move to base class.
4817 (Archive::set_incremental_info): Likewise.
4818 (Archive::incremental_info): Likewise.
4819 (Archive::Should_include): Likewise.
4820 (Archive::should_include_member): Likewise.
4821 (Archive::Armap_entry): Remove.
4822 (Archive::Unused_symbol_iterator): Remove.
4823 (Archive::unused_symbols_begin): Remove.
4824 (Archive::unused_symbols_end): Remove.
4825 (Archive::do_filename): New function.
4826 (Archive::do_get_mtime): New function.
4827 (Archive::do_for_all_unused_symbols): New function.
4828 (Archive::task_): Move to base class.
4829 (Archive::incremental_info_): Likewise.
4830 (class Lib_group): Derive from Library_base.
4831 (Lib_group::do_filename): New function.
4832 (Lib_group::do_get_mtime): New function.
4833 (Lib_group::do_for_all_unused_symbols): New function.
4834 (Lib_group::task_): Move to base class.
4835 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
4836 function.
4837 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
4838 function.
4839 * incremental.cc (Incremental_inputs::report_archive_begin):
4840 Use Library_base; call library's get_mtime; add incremental inputs
4841 entry before members.
4842 (class Unused_symbol_visitor): New class.
4843 (Incremental_inputs::report_archive_end): Use Library_base; use
4844 visitor class to record unused symbols; don't add incremental inputs
4845 entry after members.
4846 (Incremental_inputs::report_object): Use Library_base.
4847 * incremental.h
4848 (Incremental_archive_entry::Incremental_archive_entry): Remove
4849 unused Archive parameter.
4850 (Incremental_inputs::report_archive_begin): Use Library_base.
4851 (Incremental_inputs::report_archive_end): Likewise.
4852 (Incremental_inputs::report_object): Likewise.
4853 * object.cc (Sized_relobj::do_for_all_global_symbols): New
4854 function.
4855 * object.h (Object::for_all_global_symbols): New function.
4856 (Object::do_for_all_global_symbols): New function.
4857 (Sized_relobj::do_for_all_global_symbols): New function.
4858 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
4859 function.
4860 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
4861 function.
4862
61ab3e40
ILT
48632011-03-27 Ian Lance Taylor <iant@google.com>
4864
4865 * archive.cc (Archive::interpret_header): Return -1 if something
4866 goes wrong. Change callers accordingly.
4867
30e1f9e6
CC
48682011-03-25 Cary Coutant <ccoutant@google.com>
4869
4870 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
4871 * testsuite/Makefile.in: Regenerate.
4872
9370ce59 48732011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
4874
4875 * plugin.cc (get_view): New.
4876 (Plugin::load): Pass get_view to the plugin.
4877 (Plugin_manager::get_view): New.
4878
9312bb0a
ILT
48792011-03-21 Ian Lance Taylor <iant@google.com>
4880
4881 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 4882 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 4883
7e12ba9e
ST
48842011-03-21 Sriraman Tallam <tmsriram@google.com>
4885
4886 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
4887 Change == to -eq.
4888 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
4889 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
4890 Change == to -eq.
4891 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
4892 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
4893
fd7a005d
ILT
48942011-03-14 Ian Lance Taylor <iant@google.com>
4895
4896 * script-sections.cc (Sort_output_sections::script_compare):
4897 Rename from is_before, change return type.
4898 (Sort_output_sections::operator()): Adjust accordingly.
4899
ed16fd1b
ILT
49002011-03-11 Jeffrey Yasskin <jyasskin@google.com>
4901
4902 PR gold/12572
4903 * testsuite/odr_violation2.cc: Add comment to make all error line
4904 numbers double digits.
4905 * testsuite/debug_msg.sh: Adjust expected errors.
4906
71ff8986
ILT
49072011-03-09 Jeffrey Yasskin <jyasskin@google.com>
4908
4909 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
4910 but mark earlier ones as non-canonical
4911 (offset_to_iterator): Update search target and example
4912 (do_addr2line): Return extra lines in a vector*
4913 (format_file_lineno): Extract from do_addr2line
4914 (one_addr2line): Add vector* out-param
4915 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
4916 when a lineno entry appeared last for its instruction
4917 (Dwarf_line_info): Add vector* out-param
4918 * object.cc (Relocate_info): Pass NULL for the vector* out-param
4919 * symtab.cc (Odr_violation_compare): Include the lineno in the
4920 comparison again.
4921 (linenos_from_loc): New. Combine the canonical line for an
4922 address with its other lines.
4923 (True_if_intersect): New. Helper functor to make
4924 std::set_intersection a query.
4925 (detect_odr_violations): Compare sets of lines instead of just
4926 one line for each function. This became less deterministic, but
4927 has fewer false positives.
4928 * symtab.h: Declarations.
4929 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
4930 mix an optimized and non-optimized object in the same binary
4931 (odr_violation2.so): Same.
4932 * testsuite/Makefile.in: Regenerate from Makefile.am.
4933 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
4934 * testsuite/debug_msg.sh: Update line numbers and add
4935 assertions.
4936 * testsuite/odr_violation1.cc: Use OdrDerived, in a
4937 non-optimized context.
4938 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
4939 isn't inlined, and use OdrDerived in an optimized context.
4940 * testsuite/odr_header1.h: Defines OdrDerived, where
4941 optimization will change the
4942 first-instruction-in-the-destructor's file and line number.
4943 * testsuite/odr_header2.h: Defines OdrBase.
4944
a19fefdc
ILT
49452011-03-09 Ian Lance Taylor <iant@google.com>
4946
4947 * fileread.cc (File_read::clear_views): Don't delete the whole
4948 file view.
4949
ecb351e9
ILT
49502011-03-08 Ian Lance Taylor <iant@google.com>
4951
4952 PR gold/12525
4953 * fileread.cc: #include <climits>.
4954 (GOLD_IOV_MAX): Define.
4955 (File_read::read_multiple): Limit number of entries by iov_max.
4956 * fileread.h (class File_read): Always set max_readv_entries to
4957 128.
4958
b821d13c
ILT
49592011-03-07 Ian Lance Taylor <iant@google.com>
4960
4961 PR gold/12525
4962 * options.h (class General_options): Add -dy and -dn.
4963
89243142
CC
49642011-03-02 Cary Coutant <ccoutant@google.com>
4965
4966 * testsuite/script_test_9.t: Add TLS segment.
4967
d0773f31
ILT
49682011-03-02 Simon Baldwin <simonb@google.com>
4969
4970 * configure.ac: Add check for gnu_indirect_function support in
4971 the toolchain building binutils.
4972 * configure: Rebuild.
4973
9370ce59 49742011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
4975
4976 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
4977 plugin only symbols.
4978 (Symbol_table::sized_finalize_symbol) Mark symbol only present
4979 in plugin files as not needed in the symbol table.
4980
4cf7a849
ST
49812011-02-11 Sriraman Tallam <tmsriram@google.com>
4982
4983 * output.cc (Output_section::add_input_section): Delay fill
4984 generation for section ordering.
4985
b578bd7d
ILT
49862011-02-09 Ian Lance Taylor <iant@google.com>
4987
4988 PR gold/12316
4989 * object.h (class Sized_relobj): Remove clear_local_symbols.
4990 * reloc.cc (Sized_relobj::do_relocate): Don't call
4991 clear_local_symbols.
4992
9370ce59 49932011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
4994
4995 * plugin.cc (is_visible_from_outside): Return true for symbols
4996 in the -u option.
4997
55382fb7
ILT
49982011-02-04 Jeffrey Yasskin <jyasskin@google.com>
4999
5000 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
5001 filename.
5002
4e271fff
ST
50032011-02-02 Sriraman Tallam <tmsriram@google.com>
5004
5005 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 5006 to std::string.
4e271fff 5007 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 5008 section_name to be std::string.
4e271fff
ST
5009 (is_function_ctor_or_dtor): Change type of parameter to std::string.
5010
d433c3ac
ILT
50112011-01-25 Ian Lance Taylor <iant@google.com>
5012
5013 * script.cc (script_add_extern): Rewrite to use
5014 add_symbol_reference.
5015
880473a6
DK
50162011-01-25 Doug Kwan <dougkwan@google.com>
5017
d433c3ac 5018 * icf.cc (get_section_contents): Always lock section's object.
880473a6 5019
f30f86fa
ILT
50202011-01-24 Ian Lance Taylor <iant@google.com>
5021
5022 * options.h (class General_options): Accept
5023 --no-detect-odr-violations.
5024
8e51a0b9
ILT
50252011-01-24 Ian Lance Taylor <iant@google.com>
5026
5027 * version.cc (version_string): Bump to 1.11.
5028
0f3b89d8
ILT
50292011-01-24 Ian Lance Taylor <iant@google.com>
5030
5031 * plugin.cc (class Plugin_rescan): Define new class.
5032 (Plugin_manager::claim_file): Set any_claimed_.
5033 (Plugin_manager::save_archive): New function.
5034 (Plugin_manager::save_input_group): New function.
5035 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
5036 necessary.
5037 (Plugin_manager::new_undefined_symbol): New function.
5038 (Plugin_manager::rescan): New function.
5039 (Plugin_manager::rescannable_defines): New function.
5040 (Plugin_manager::add_input_file): Set any_added_.
5041 * plugin.h (class Plugin_manager): define new fields rescannable_,
5042 undefined_symbols_, any_claimed_, and any_added_. Declare
5043 Plugin_rescan as friend. Declare new functions.
5044 (Plugin_manager::Rescannable): Define type.
5045 (Plugin_manager::Rescannable_list): Define type.
5046 (Plugin_manager::Undefined_symbol_list): Define type.
5047 (Plugin_manager::Plugin_manager): Initialize new fields.
5048 * archive.cc (Archive::defines_symbol): New function.
5049 (Add_archive_symbols::run): Pass archive to plugins if any.
5050 * archive.h (class Archive): Declare defines_symbol.
5051 * readsyms.cc (Input_group::~Input_group): New function.
5052 (Finish_group::run): Pass input_group to plugins if any.
5053 * readsyms.h (class Input_group): Declare destructor.
5054 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
5055 any.
5056
3bb951e5
ILT
50572011-01-10 Ian Lance Taylor <iant@google.com>
5058
5059 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
5060 section as relro.
5061 (Layout::set_segment_offsets): Reset increase_relro before calling
5062 set_section_addresses a second time.
5063
0aa45fac
CC
50642011-01-04 Cary Coutant <ccoutant@google.com>
5065
5066 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
5067 sections before NOBITS sections.
5068
0db46eb4
L
50692011-01-01 H.J. Lu <hongjiu.lu@intel.com>
5070
5071 * version.cc (print_version): Update copyright to 2011.
5072
829c9745
CC
50732010-12-23 Cary Coutant <ccoutant@google.com>
5074
5075 * output.h (Output_data_reloc::add_output_section): Pass OD instead
5076 of OS to this->add. Add OD parameter to second form of the function.
5077
7500420b
ILT
50782010-12-20 Ian Lance Taylor <iant@google.com>
5079
5080 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
5081 second of two consecutive entries with same offset.
5082
f8e9a930
RW
50832010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5084
5085 * testsuite/Makefile.am (ifuncmain2static_LDADD)
5086 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
5087 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
5088 to avoid unneeded links against $(LDADD).
5089 * testsuite/Makefile.in: Regenerate.
5090
2fbb4320
ILT
50912010-12-15 Ian Lance Taylor <iant@google.com>
5092
5093 PR gold/12324
5094 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
5095 for R_X86_64_32 and R_X86_64_PC32.
5096 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
5097 ver_matching_def_pic.o.
5098 (ver_matching_def_pic.o): New target.
5099
fedb228d
RW
51002010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5101
5102 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
5103 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
5104 Move definition before File_read::View member definitions.
5105 (File_read::View::~View): Initialize and hold lock before
5106 updating current_mapped_bytes.
5107
9b547ce6
RW
51082010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5109
5110 * dwarf_reader.cc: Remove outdated comment.
5111 * gold-threads.cc: Fix typo in error message.
5112 * archive.cc: Fix typos in comments.
5113 * archive.h: Likewise.
5114 * arm-reloc-property.cc: Likewise.
5115 * arm-reloc-property.h: Likewise.
5116 * arm-reloc.def: Likewise.
5117 * arm.cc: Likewise.
5118 * attributes.h: Likewise.
5119 * cref.cc: Likewise.
5120 * ehframe.cc: Likewise.
5121 * fileread.h: Likewise.
5122 * gold.h: Likewise.
5123 * i386.cc: Likewise.
5124 * icf.cc: Likewise.
5125 * incremental.h: Likewise.
5126 * int_encoding.cc: Likewise.
5127 * layout.h: Likewise.
5128 * main.cc: Likewise.
5129 * merge.h: Likewise.
5130 * object.cc: Likewise.
5131 * object.h: Likewise.
5132 * options.cc: Likewise.
5133 * readsyms.cc: Likewise.
5134 * reduced_debug_output.cc: Likewise.
5135 * reloc.cc: Likewise.
5136 * script-sections.cc: Likewise.
5137 * sparc.cc: Likewise.
5138 * symtab.h: Likewise.
5139 * target-reloc.h: Likewise.
5140 * target.cc: Likewise.
5141 * target.h: Likewise.
5142 * timer.cc: Likewise.
5143 * timer.h: Likewise.
5144 * x86_64.cc: Likewise.
5145
83e17bd5
CC
51462010-12-09 Cary Coutant <ccoutant@google.com>
5147
5148 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
5149 stack.
5150 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
5151 parameter; change all callers.
5152 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
5153 * options.h (warn_execstack): New option.
5154
017257f8
DK
51552010-12-07 Doug Kwan <dougkwan@google.com>
5156
5157 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
5158 like function call relocations.
5159
c20cbc06
ILT
51602010-12-07 Ian Lance Taylor <iant@google.com>
5161
5162 * archive.cc (Archive::get_elf_object_for_member): Permit
5163 punconfigured to be NULL.
5164 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
5165 (Archive::include_member): Pass NULL to get_elf_object_for_member
5166 if we searched for the archive and this is the first included
5167 object.
5168
4dbfafcc
ILT
51692010-12-01 Ian Lance Taylor <iant@google.com>
5170
5171 * dwarf_reader.h (class Sized_dwarf_line_info): Add
5172 track_relocs_type_ field.
5173 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5174 Set track_relocs_type_.
5175 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
5176 contents when using RELA relocs.
5177 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
5178 reloc_map_.
5179 * reloc.cc (Track_relocs::next_addend): New function.
5180 * reloc.h (class Track_relocs): Declare next_addend.
5181
e5e19edd
ILT
51822010-12-01 Ian Lance Taylor <iant@google.com>
5183
5184 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
5185 virtual destructor.
5186
9a5ce24c
ILT
51872010-12-01 Ian Lance Taylor <iant@google.com>
5188
5189 * README: Update compilers known to work and fail.
5190
c7791212
NC
51912010-11-23 Matthias Klose <doko@ubuntu.com>
5192
5193 * configure.in: For --enable-gold, handle value `default' instead of
5194 `both*'. Always install ld as ld.bfd, install as ld if gold is
5195 not the default.
5196 * configure: Regenerate.
5197
0ad220c9
DK
51982010-11-18 Doug Kwan <dougkwan@google.com>
5199
5200 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
5201 and right_alignment to be zero. Store result alignment only if it is
5202 greater than existing alignment.
5203
ab8056e0
CC
52042010-11-16 Cary Coutant <ccoutant@google.com>
5205
5206 PR gold/12220
5207 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5208 Check for ".zdebug_line".
5209
fd064a5b
CC
52102010-11-16 Doug Kwan <dougkwan@google.com>
5211 Cary Coutant <ccoutant@google.com>
5212
5213 * output.h (Output_segment::set_section_addresses): Pass increase_relro
5214 by reference; adjust all callers.
5215 * output.cc (Output_segment::set_section_addresses): Adjust references
5216 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
5217 list is empty.
5218 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
5219 end at page boundary.
5220
6fc6ea19
CC
52212010-11-16 Cary Coutant <ccoutant@google.com>
5222
5223 PR gold/12220
5224 * layout.cc (Layout::choose_output_section): Transform names of
5225 compressed sections even when using a script with a SECTIONS clause.
5226 (Layout::output_section_name): Remove code to transform
5227 compressed debug section names.
5228 * output.cc (Output_section::add_input_section): Use uncompressed
5229 section size when tracking input sections.
5230
95a2c8d6
RS
52312010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
5232
5233 * symtab.h (Symbol::NON_PIC_REF): Remove.
5234 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
5235 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
5236 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
5237 (Symbol::use_plt_offset): Take a flags argument and pass it
5238 directly to needs_dynamic_reloc. Restrict check for undefined
5239 weak symbols to function calls.
5240 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
5241 (Target_arm::Scan::global): Use it.
5242 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
5243 (Target_arm::Relocate::relocate): Likewise.
5244 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
5245 parameter with an r_type parameter. Use get_reference_flags
5246 to get the flags.
5247 (Target_arm::Relocate::relocate): Update accordingly.
5248 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
5249 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
5250 (Target_i386::Scan::global): Likewise.
5251 (Target_i386::Relocate::relocate): Likewise.
5252 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
5253 parameter with an r_type parameter. Use get_reference_flags
5254 to get the flags.
5255 (Target_i386::Relocate::relocate): Update accordingly.
5256 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
5257 (Target_powerpc::Scan::global): Use it.
5258 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
5259 (Target_powerpc::Relocate::relocate): Likewise.
5260 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
5261 (Target_sparc::Scan::global): Use it.
5262 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
5263 (Target_sparc::Relocate::relocate): Likewise.
5264 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
5265 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
5266 (Target_x86_64::Scan::global): Likewise.
5267 (Target_x86_64::Relocate::relocate): Likewise.
5268
f625ae50
DK
52692010-11-08 Doug Kwan <dougkwan@google.com>
5270 Cary Coutant <ccoutant@google.com>
5271
5272 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
5273 (Arm_exidx_merge_section::section_contents_): New data member.
5274 (Arm_input_section::Arm_input_section): Initialize original_contents_.
5275 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 5276 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
5277 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
5278 in parameters instead of calling Object::section_contents without
5279 locking.
5280 (Arm_output_section::group_section): New parameter TASK. Pass it
5281 to callees that need locking objects.
5282 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
5283 to lock EXIDX input sections. Fix a formatting issue. Call
5284 Arm_exidx_merged_section::build_contents to create merged section
5285 contents.
5286 (Arm_output_section::create_stub_group): New parameter TASK. Use it
5287 to lock object of stub table owner.
5288 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
5289 TEXT_SIZE to initialize data member TEXT_SIZE_.
5290 (Arm_exidx_input_section::addralign): Fix typo in comment.
5291 (Arm_exidx_input_section::text_size): New method.
5292 (Target_arm::do_relax): New parameter TASK. Pass it to callees
5293 that require locking objects. Lock objects before scanning for stubs
5294 and updating local symbols.
5295 (Arm_input_section<big_endian>::init): Copy contents of original
5296 input section.
2e702c99 5297 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
5298 original input section instead of calling Object::section_contents
5299 without locking.
5300 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
5301 size without calling Object::section_size().
5302 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
5303 for size. Allocate a buffer for merged EXIDX entries.
5304 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 5305 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
5306 building code to Arm_exidx_merged_section::build_contetns. Write
5307 out contetns in buffer instead of building it on the fly.
5308 (Arm_relobj::make_exidx_input_section): Also pass text section size
5309 to Arm_exidx_input_section constructor.
5310 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
5311 (Arm_dynobj::do_read_symbols): Fix memory leak.
5312 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
5313 * target.h: (class Task): Add forward declaration.
5314 (Target::relax): Add new parameter TASK and pass it to
5315 Target::do_relax().
5316 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
5317
5f9bcf58
CC
53182010-11-05 Cary Coutant <ccoutant@google.com>
5319
5320 PR gold/10708
5321 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
5322 object when reading from the file.
5323 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
5324 second layout pass.
5325 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
5326 when reading section contents.
5327 (get_section_contents): Likewise.
5328 (icf::find_identical_sections): Likewise.
5329 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
5330 object when reading from the file.
5331 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
5332 the object when doing deferred section layout.
5333
e597fa08
NC
53342010-11-03 Nick Clifton <nickc@redhat.com>
5335
5336 PR gold/12001
5337 * script.h (class Symbol_assignment: name): New member. Returns
5338 the name of the symbol.
5339 * scrfipt.cc (Script_options::is_pending_assignment): New member.
5340 Returns true if the given symbol name is on the list of
5341 assignments wating to be processed.
5342 * archive.cc (should_incldue_member): If the symbol is undefined,
5343 check to see if it is on the list of symbols pending assignment.
5344
3f9a3278
ILT
53452010-11-03 Ryan Mansfield <rmansfield@qnx.com>
5346
5347 * script-sections.cc (Script_sections::find_memory_region): Check
5348 for a NULL output section pointer.
5349
d06fb4d1
DK
53502010-10-29 Doug Kwan <dougkwan@google.com>
5351
5352 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
5353 Output_section::add_relaxed_input_section.
5354 * output.cc (Output_section::add_relaxed_input_section): Add new
5355 arguments LAYOUT and NAME. Set section order index.
5356 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5357 Copy section order index.
5358 * output.h (Output_section::add_relaxed_input_section): Add new
5359 arguments LAYOUT and NAME.
5360
90e24de5
ILT
53612010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5362
5363 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 5364 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
5365 * testsuite/Makefile.in: Regenerate.
5366
c9484ea5
DK
53672010-10-20 Doug Kwan <dougkwan@google.com>
5368
5369 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
5370 without SHF_LINK_ORDER flags.
5371 * layout.cc (Layout::choose_output_section): Do not filter
5372 SHF_LINK_ORDER flag in a relocatable link.
5373
5bc2f5be
CC
53742010-10-17 Cary Coutant <ccoutant@google.com>
5375
5376 * output.h (Output_segment::set_section_addresses): Change function
5377 signature. Update all callers.
5378 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
5379 sections.
5380 (Output_segment::set_section_addresses): Align after last TLS
5381 section. Add padding before last relro section instead of after.
5382
0c91cf04
DK
53832010-10-17 Doug Kwan <dougkwan@google.com>
5384
5385 * gold/arm.cc (Target_arm::got_section): Use correct order and set
5386 GOT output section to be writable.
5387
8c21d9d3
CC
53882010-10-14 Cary Coutant <ccoutant@google.com>
5389
5390 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
5391 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
5392 * gold.cc (queue_initial_tasks): Check parameters for incremental link
5393 mode.
5394 * incremental.cc (report_command_line): Ignore all forms of
5395 --incremental.
5396 * layout.cc (Layout::Layout): Check parameters for incremental link
5397 mode.
5398 * options.cc (General_options::parse_incremental): New function.
5399 (General_options::parse_no_incremental): New function.
5400 (General_options::parse_incremental_full): New function.
5401 (General_options::parse_incremental_update): New function.
5402 (General_options::incremental_mode_): New data member.
5403 (General_options::finalize): Check incremental_mode_.
5404 * options.h (General_options): Update help text for --incremental.
5405 Add --no-incremental, --incremental-full, --incremental-update.
5406 (General_options::Incremental_mode): New enum type.
5407 (General_options::incremental_mode): New function.
5408 (General_options::incremental_mode_): New data member.
5409 * parameters.cc (Parameters::incremental_mode_): New data member.
5410 (Parameters::set_options): Set incremental_mode_.
5411 (Parameters::set_incremental_full): New function.
5412 (Parameters::incremental): New function.
5413 (Parameters::incremental_update): New function.
5414 (set_parameters_incremental_full): New function.
5415 * parameters.h (Parameters::set_incremental_full): New function.
5416 (Parameters::incremental): New function.
5417 (Parameters::incremental_update): New function.
5418 (Parameters::incremental_mode_): New data member.
5419 (set_parameters_incremental_full): New function.
5420 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
5421 incremental link mode.
5422 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
5423 (Sized_relobj::do_relocate_sections): Likewise.
5424 * testsuite/Makefile.am (incremental_test): Use --incremental-full
5425 option.
5426 * testsuite/Makefile.in: Regenerate.
5427 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 5428
bb32aa18 54292010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
5430
5431 * script-sections.h (class Script_sections): Make
5432 Sections_elements typedef public.
5433 * script-sections.cc (class Sort_output_sections): Add elements_
5434 field. Add constructor which sets it; change all callers.
5435 (Sort_output_sections::is_before): New function.
5436 (Sort_output_sections::operator()): Call is_before.
5437 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
5438 conditional.
5439 * testsuite/script_test_10.sh: New test. Test script section
5440 order.
5441 * testsuite/script_test_10.t: Likewise.
5442 * testsuite/script_test_10.s: Likewise.
5443 * testsuite/Makefile.am: Wrap the cross linker tests and the
5444 common tests into NATIVE_OR_CROSS_LINKER.
5445 (check_SCRIPTS): Add script_test_10.sh.
5446 (check_DATA): Add script_test_10.stdout.
5447 (script_test_10.o, script_test_10): New targets.
5448 (script_test_10.stdout): New target.
5449 * configure, testsuite/Makefile.in: Regenerate.
5450
3cef7179
ILT
54512010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5452
5453 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
5454 error for the deprecated relocations.
5455 (Target_arm::Scan::global): Likewise.
5456 (Target_arm::Relocate::relocate): Likewise.
5457
7411e9a8
RS
54582010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
5459
5460 * fileread.cc (Input_file::find_file): Initialize *found_name
5461 and *namep when using the fallback search for case 4.
5462
6a9da32a
CC
54632010-10-11 Cary Coutant <ccoutant@google.com>
5464
5465 * options.h (class General_options): Redefine -z lazy as an alias for
5466 the negation of -z now.
5467
ac897c20
ILT
54682010-10-11 Ian Lance Taylor <iant@google.com>
5469
5470 * resolve.cc (symbol_to_bits): Report the value of the unsupported
5471 binding.
5472
ea5cae92
NC
54732010-10-06 Nick Clifton <nickc@redhat.com>
5474
5475 * script-sections.cc(class Memory_region): Remove
5476 current_lma_offset_ field. Rename current_vma_offset_ to
5477 current_offset_. Add last_section_ field.
5478 (Memory_region::get_current_vma_address): Rename to
5479 get_current_address.
5480 (Memory_region::get_current_lma_address): Delete.
5481 (Memory_region::increment_vma_offset): Rename to
5482 increment_offset.
5483 (Memory_region::increment_lma_offset): Delete.
5484 (Memory_region::attributes_compatible): New method. Returns
5485 true if the provided section is compatible with the region.
5486 (Memory_region::get_last_section): New method. Returns the last
5487 section to use the region.
5488 (Memory_region::set_last_section): New method. Stores the last
5489 section to use the region.
5490 (Script_sections::block_in_region): New method. Returns true if
5491 a block of memory is contained within a region.
5492 (Script_sections::find_memory_region): New method. Locates a
5493 memory region to be used to set a VMA or LMA address.
5494 (Output_section_definition::set_section_addresses): Add code to
5495 check for addresses set by memory regions.
5496 (Output_segment::set_section_addresses): Remove memory region
5497 walking code.
5498 (Script_sections::create_segment): Add a warning if a header
5499 segment is created outside of any region.
5500 * script-sections.h (class Script_sections): Add prototypes for
5501 find_memory_region and block_in_region methods.
5502 * testsuite/memory_test.s: Use .long instead of .word.
5503 * testsuite/memory_test.t: Add some more output sections.
5504 * testsuite/memory_test.sh: Update expected output.
5505
a9bfd952
DK
55062010-10-02 Doug Kwan <dougkwan@google.com>
5507
5508 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
5509 defintion to symtab.h
5510 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
5511 declaration to defintion.
5512
bacff3ab
NC
55132010-10-01 Nick Clifton <nickc@redhat.com>
5514
5515 * expression.cc (eval): Replace dummy argument with NULL.
5516 (eval_maybe_dot): Check for a NULL result section pointer.
5517 (Symbol_expression::value): Likewise.
5518 (Dot_expression::value): Likewise.
5519 (BINARY_EXPRESSION): Likewise.
5520 (Max_expression::value): Likewise.
5521 (Min_expression::value): Likewise.
5522 (Absolute_expression::value): Likewise.
5523 (Addr_expression::value_from_output_section): Likewise.
5524 (Loaddddr_expression::value_from_output_section): Likewise.
5525 (Segment_start_expression::value): Likewise.
5526 * script-sections.cc
5527 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
5528 argument with NULL.
5529 (Sections_elememt_dot_assignment::set_section_addresses):
5530 Likewise.
5531 (Output_data_expression::do_write_to_buffer): Likewise.
5532 (Output_section_definition::finalize_symbols): Likewise.
5533 (Output_section_definition::set_section_addresses): Likewise.
5534
f81bc8b5
DK
55352010-09-30 Doug Kwan <dougkwan@google.com>
5536
5537 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
5538
c95e9f27
ST
55392010-09-28 Sriraman Tallam <tmsriram@google.com>
5540
5541 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 5542 function.
c95e9f27
ST
5543 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
5544 virtual function.
5545 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
5546 virtual function.
5547 * icf.cc (get_section_contents): Inline merge sections only when
5548 target allows it.
5549
3cac54d2
RW
55502010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5551
5552 * configure: Regenerate.
5553
2904037a
ILT
55542010-09-17 Ian Lance Taylor <iant@google.com>
5555
5556 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
5557 * testsuite/Makefile.am (memory_test.o): New target.
5558 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
5559 memory_test.t.
5560 * testsuite/Makefile.in: Rebuild.
2904037a 5561
bca7fb63
DK
55622010-09-17 Doug Kwan <dougkwan@google.com>
5563
5564 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
5565 defintion if relocation uses GOT entries of the symbol.
5566 * testsuite/icf_safe_test.sh: Fix test.
5567 * testsuite/icf_safe_so_test.sh: Fix test.
5568
4ef28648
CC
55692010-09-16 Cary Coutant <ccoutant@google.com>
5570
5571 * script_sections.cc (class Memory_region): Remove "NULL" from
5572 vector initializations.
5573
793990de
CC
55742010-09-15 Cary Coutant <ccoutant@google.com>
5575
5576 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
5577 Resolve forwarding symbols.
5578
81e015e2
DK
55792010-09-15 Doug Kwan <dougkwan@google.com>
5580
5581 * gold/testsuite/script_test_3.t: Add ARM special sections.
5582 * gold/testsuite/script_test_4.t: Same.
5583 * gold/testsuite/script_test_5.t: Same.
5584 * gold/testsuite/script_test_6.t: Same.
5585 * gold/testsuite/script_test_7.t: Same.
5586 * gold/testsuite/script_test_7.t: Same.
5587 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
5588
36171d64
CC
55892010-09-14 Cary Coutant <ccoutant@google.com>
5590
5591 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
5592 (Target_x86_64::Relocate::relocate_tls): Replace check for
5593 saw_tls_block_reloc_ with test for executable section.
5594
d89051bd
CC
55952010-09-12 Cary Coutant <ccoutant@google.com>
5596
5597 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
5598 position-independent executables to shared libraries need dynamic
5599 relocations.
5600 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
5601 position-independent executables.
5602 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
5603 * testsuite/Makefile.in: Regenerate.
5604
fca41f0f
NC
56052010-09-10 Nick Clifton <nickc@redhat.com>
5606
5607 PR gold/11997
5608 * testsuite/memory_test.t: Discard any sections that are not
5609 needed.
5610
6695e4b3
L
56112010-09-09 H.J. Lu <hongjiu.lu@intel.com>
5612
5613 PR gold/11996
5614 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
5615 "This::" to work around a bug in gcc 4.2.
5616
5617 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
5618
0f72bf6f
RÁE
56192010-09-09 Rafael Espindola <espindola@google.com>
5620
5621 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
5622 sections with different PF_X flags in the same segment.
5623 (Layout::find_first_load_seg): Search all segments to find the first
5624 one.
5625 * options.h (rosegment): New.
5626
56272010-09-08 Rafael Espindola <espindola@google.com>
a6577478 5628
05a79166 5629 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 5630
aa98ff75
DK
56312010-09-08 Doug Kwan <dougkwan@google.com>
5632
5633 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
5634 (Arm_relobj::do_relocate_sections): Add new parameter for output
5635 file to match the parent.
5636 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
5637 of local symbols instead of input values. Update code to track
5638 changes in gold::relocate_section.
5639 * object.cc (Sized_relobj::compute_final_local_value): New methods.
5640 (Sized_relobj::compute_final_local_value_internal): New methods.
5641 (Sized_relobj::do_finalize_local_symbols): Move code from loop
5642 body into private version of Sized_relobj::compute_final_local_value.
5643 Call the inline method.
5644 * object.h (Symbol_value::Symbol_value): Define destructor. Free
5645 merged symbol value if there is one.
5646 (Symbol_value::has_output_value): New method defintiion.
5647 (Sized_relobj::Compute_final_local_value_status): New enum type.
5648 (Sized_relobj::compute_final_local_value): New methods.
5649 (Sized_relobj::compute_final_local_value_internal): New methods.
5650 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
5651 and arm_cortex_a8.sh.
5652 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
5653 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
5654 New tests.
5655 * Makefile.in: Regenerate.
5656 * testsuite/arm_bl_out_of_range.s: Update test.
5657 * testsuite/thumb_bl_out_of_range.s: Ditto.
5658 * testsuite/thumb_blx_out_of_range.s: Ditto.
5659 * testsuite/arm_branch_out_of_range.sh: New file.
5660 * testsuite/arm_cortex_a8.sh: Ditto.
5661 * testsuite/arm_cortex_a8_b.s: Ditto.
5662 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
5663 * testsuite/arm_cortex_a8_b_local.s: Ditto.
5664 * testsuite/arm_cortex_a8_bl.s: Ditto.
5665 * testsuite/arm_cortex_a8_blx.s: Ditto.
5666 * testsuite/arm_cortex_a8_local.s: Ditto.
5667 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
5668 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
5669
05a79166
L
56702010-09-08 Rafael Espindola <espindola@google.com>
5671
5672 * Makefile.am (memory_test.stdout): Run readelf with -W.
5673 * Makefile.in: Regenerate.
5674 * testsuite/memory_test.sh: Make the regexps accept both 32 and
5675 64 bit output.
5676
33dbc701
RÁE
56772010-09-08 Rafael Espindola <espindola@google.com>
5678
5679 * script-sections.cc (Script_sections::add_memory_region): Convert
5680 field precision to int.
5681 * script.cc (script_set_section_region, script_set_section_region):
5682 Convert field precision to int.
5683
731ca54a
RÁE
56842010-09-08 Rafael Espindola <espindola@google.com>
5685
5686 * arm.cc (do_finalize_sections): Create the __exidx_start and
5687 __exdix_end symbols even when the section is missing.
5688
7f8cd844
NC
56892010-09-08 Nick Clifton <nickc@redhat.com>
5690
5691 * README: Remove claim that MEMORY is not supported.
5692 * expression.cc (script_exp_function_origin)
5693 (script_exp_function_length): Move from here to ...
5694 * script.cc: ... here.
5695 (script_set_section_region, script_add_memory)
5696 (script_parse_memory_attr, script_include_directive): New
5697 functions.
5698 * script-sections.cc
5699 (class Memory_region): New class.
5700 (class Output_section_definition): Add set_memory_region,
5701 set_section_vma, set_section_lma and get_section_name methods.
5702 (class Script_Sections): Add add_memory_region,
5703 find_memory_region, find_memory_region_origin,
5704 find_memory_region_length and set_memory_region methods.
5705 Have set_section_addresses method walk the list of set memory
5706 regions.
5707 Extend the print methos to display memory regions.
5708 * script-sections.h: Add prototypes for new methods.
5709 Add enum for MEMORY region attributes.
5710 * yyscript.y: Add support for parsing MEMORY regions.
5711 * script-c.h: Add prototypes for new functions.
5712 * testsuite/Makefile.am: Add test of MEMORY region functionality.
5713 * testsuite/Makefile.in: Regenerate.
5714 * testsuite/memory_test.sh: New script.
5715 * testsuite/memory_test.s: New assembler source file.
5716 * testsuite/memory_test.t: New linker script.
5717
a4649286
DK
57182010-08-27 Doug Kwan <dougkwan@google.com>
5719
5720 * gold/resolve.cc (Symbol_table::should_override): Let a weak
5721 reference override an existing dynamic weak reference.
5722 * testsuite/Makefile.am: Add new test dyn_weak_ref.
5723 * testsuite/Makefile.in: Regenerate.
5724 * testsuite/dyn_weak_ref.sh: New file.
5725 * testsuite/dyn_weak_ref_1.c: Ditto.
5726 * testsuite/dyn_weak_ref_2.c: Ditto.
5727
b56648ad
ILT
57282010-08-27 Ian Lance Taylor <iant@google.com>
5729
5730 * incremental.h (class Incremental_input_entry): Add virtual
5731 destructor.
5732
809313cb
ILT
57332010-08-27 Ian Lance Taylor <iant@google.com>
5734
5735 * testsuite/start_lib_test_3.c: Mark t3 as used.
5736
11e32464
NC
57372010-08-27 Nick Clifton <nickc@redhat.com>
5738
5739 * options.cc (version_script): Fix small typo in previous
5740 whitespace tidyup.
5741
ca09d69a
NC
57422010-08-25 Nick Clifton <nickc@redhat.com>
5743
5744 * archive.cc: Formatting fixes: Remove whitespace between
5745 typename and following asterisk. Remove whitespace between
5746 function name and opening parenthesis.
5747 * archive.h: Likewise.
5748 * arm.cc: Likewise.
5749 * attributes.cc: Likewise.
5750 * attributes.h: Likewise.
5751 * common.cc: Likewise.
5752 * copy-relocs.cc: Likewise.
5753 * dirsearch.h: Likewise.
5754 * dynobj.cc: Likewise.
5755 * ehframe.cc: Likewise.
5756 * ehframe.h: Likewise.
5757 * expression.cc: Likewise.
5758 * fileread.cc: Likewise.
5759 * fileread.h: Likewise.
5760 * gc.h: Likewise.
5761 * gold-threads.cc: Likewise.
5762 * gold.cc: Likewise.
5763 * i386.cc: Likewise.
5764 * icf.h: Likewise.
5765 * incremental-dump.cc: Likewise.
5766 * incremental.cc: Likewise.
5767 * layout.cc: Likewise.
5768 * layout.h: Likewise.
5769 * main.cc: Likewise.
5770 * merge.cc: Likewise.
5771 * merge.h: Likewise.
5772 * object.cc: Likewise.
5773 * object.h: Likewise.
5774 * options.cc: Likewise.
5775 * options.h: Likewise.
5776 * output.cc: Likewise.
5777 * output.h: Likewise.
5778 * plugin.cc: Likewise.
5779 * plugin.h: Likewise.
5780 * powerpc.cc: Likewise.
5781 * reloc.cc: Likewise.
5782 * script-c.h: Likewise.
5783 * script-sections.cc: Likewise.
5784 * script.cc: Likewise.
5785 * stringpool.cc: Likewise.
5786 * symtab.cc: Likewise.
5787 * symtab.h: Likewise.
5788 * target.cc: Likewise.
5789 * timer.cc: Likewise.
5790 * timer.h: Likewise.
5791 * version.cc: Likewise.
5792 * x86_64.cc: Likewise.
5793
b8fa8750
NC
57942010-08-24 Nick Clifton <nickc@redhat.com>
5795
5796 PR 11899
5797 * layout.cc (segment_precedes): Sort segments by their physical
5798 addresses, if they have been set.
5799
9919d93b
CC
58002010-08-23 Cary Coutant <ccoutant@google.com>
5801
5802 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
5803 symbols data.
5804 (Lib_group::include_member): Unlock object after deleting its
5805 symbols data.
5806 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
5807 the bug fixed here.
5808
97b4be1c
CC
58092010-08-19 Neil Vachharajani <nvachhar@google.com>
5810 Cary Coutant <ccoutant@google.com>
5811
5812 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
5813 constructor, and set_blocker.
5814 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
5815 readsyms_blocker_.
5816 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
5817 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
5818 * testsuite/Makefile.am (start_lib_test): New test case.
5819 * testsuite/Makefile.in: Regenerate.
5820 * testsuite/start_lib_test_main.c: New file.
5821 * testsuite/start_lib_test_1.c: New file.
5822 * testsuite/start_lib_test_2.c: New file.
5823 * testsuite/start_lib_test_3.c: New file.
5824
dd0b1884
ILT
58252010-08-19 Ian Lance Taylor <iant@google.com>
5826
5827 * Makefile.in: Rebuild with automake 1.11.1.
5828 * aclocal.m4: Likewise.
5829 * testsuite/Makefile.in: Likewise.
5830
7223e9ca
ILT
58312010-08-19 Ian Lance Taylor <iant@google.com>
5832
5833 PR 10893
5834 * i386.cc (class Output_data_plt_i386): Update declarations.
5835 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
5836 local_ifuncs_ fields.
5837 (Target_i386::do_plt_section_for_global): New function.
5838 (Target_i386::do_plt_section_for_local): New function.
5839 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
5840 parameter; change all callers. Initialize global_ifuncs_ and
5841 local_ifuncs_. If doing a static link define __rel_iplt_start and
5842 __rel_iplt_end.
5843 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
5844 (Output_data_plt_i386::add_local_ifunc_entry): New function.
5845 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
5846 symbols.
5847 (Target_i386::make_plt_section): New function, broken out of
5848 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
5849 (Target_i386::make_plt_entry): Call make_plt_section.
5850 (Target_i386::make_local_ifunc_plt_entry): New function.
5851 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
5852 (Target_i386::Scan::local): Handle IFUNC symbols. Add
5853 R_386_IRELATIVE to switch.
5854 (Target_i386::Scan::global): Likewise.
5855 (Target_i386::Relocate::relocate): Likewise.
5856 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
5857 switch.
5858 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
5859 (Target_x86_64::do_plt_section_for_global): New function.
5860 (Target_x86_64::do_plt_section_for_local): New function.
5861 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
5862 parameter; change all callers. If doing a static link define
5863 __rela_iplt_start and __rela_iplt_end.
5864 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
5865 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
5866 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
5867 to point to .plt.
5868 (Target_x86_64::make_local_ifunc_plt_entry): New function.
5869 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
5870 switch.
5871 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
5872 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
5873 R_X86_64_IRELATIVE to switch.
5874 (Target_x86_64::Scan::global): Likewise.
5875 (Target_x86_64::Relocate::relocate): Likewise.
5876 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
5877 switch.
5878 * target.h (class Target): Add plt_section_for_global and
5879 plt_section_for_local functions. Add do_plt_section_for_global
5880 and do_plt_section_for_local virtual functions.
5881 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
5882 clarifying comments.
5883 (Symbol::use_plt_offset): Handle IFUNC symbol.
5884 * object.cc (Sized_relobj::Sized_relobj): Initialize
5885 local_plt_offsets_.
5886 (Sized_relobj::local_has_plt_offset): New function.
5887 (Sized_relobj::local_plt_offset): New function.
5888 (Sized_relobj::set_local_plt_offset): New function.
5889 (Sized_relobj::do_count): Handle IFUNC symbol.
5890 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
5891 a bit away from input_shndx_ field. Add set_is_func_symbol and
5892 is_ifunc_symbol functions.
5893 (class Sized_relobj): Update declarations. Remove Tls_got_entry
5894 and Local_tls_got_offsets. Define Local_plt_offsets. Add
5895 local_plt_offsets_ field.
5896 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
5897 * output.h (class Output_section_data): Add non-const
5898 output_section function.
5899 (class Output_data_got): Update declarations.
5900 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
5901 Add use_plt_offset parameter to global and local constructors.
5902 Change all callers. Change local_sym_index_ field to 31 bits.
5903 Change GSYM_CODE and CONSTANT_CODE accordingly.
5904 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
5905 doing a static link don't set sh_link field.
5906 (Output_data_got::Got_entry::write): Use PLT offset if
5907 appropriate.
5908 (Output_data_got::add_global_plt): New function.
5909 (Output_data_got::add_local_plt): New function.
5910 * target-reloc.h (relocate_section): Handle IFUNC symbol.
5911 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
5912 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
5913 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
5914 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
5915 IFUNC conditional.
5916 * testsuite/ifunc-sel.h: New file.
5917 * testsuite/ifuncmain1.c: New file.
5918 * testsuite/ifuncmain1vis.c: New file.
5919 * testsuite/ifuncmod1.c: New file.
5920 * testsuite/ifuncdep2.c: New file.
5921 * testsuite/ifuncmain2.c: New file.
5922 * testsuite/ifuncmain3.c: New file.
5923 * testsuite/ifuncmod3.c: New file.
5924 * testsuite/ifuncmain4.c: New file.
5925 * testsuite/ifuncmain5.c: New file.
5926 * testsuite/ifuncmod5.c: New file.
5927 * testsuite/ifuncmain6pie.c: New file.
5928 * testsuite/ifuncmod6.c: New file.
5929 * testsuite/ifuncmain7.c: New file.
5930 * configure, testsuite/Makefile.in: Rebuild.
5931
56f75c03
ILT
59322010-08-18 Ian Lance Taylor <iant@google.com>
5933
5934 * incremental.cc
5935 (Output_section_incremental_inputs::write_input_files): Add cast
5936 to avoid signed/unsigned comparison warning.
5937 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5938
55455f89
CC
59392010-08-12 Cary Coutant <ccoutant@google.com>
5940
5941 * common.cc (Sort_commons::operator()): Remove unnecessary code.
5942
e2054bcb
ILT
59432010-08-13 Ian Lance Taylor <iant@google.com>
5944
5945 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
5946
74f67560
DK
59472010-08-12 Cary Coutant <ccoutant@google.com>
5948 Doug Kwan <dougkwan@google.com>
5949
5950 * resolve.cc (Symbol_table::should_override): When a weak dynamic
5951 defintion overrides non-weak undef, remember that the original undef
5952 is not weak.
5953 * symtab.cc (Symbol_table::sized_write_global): For undef without
5954 an original weak binding, set binding to global in output.
5955 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
5956 * testsuite/Makefile.in: Regenerate.
5957 * testsuite/strong_ref_weak_def.sh: New file.
5958 * testsuite/strong_ref_weak_def_1.c: Ditto.
5959 * testsuite/strong_ref_weak_def_2.c: Ditto.
5960
d1238d12
CC
59612010-08-12 Cary Coutant <ccoutant@google.com>
5962
5963 * testsuite/incremental_test.sh: Rewrite.
5964 * testsuite/incremental_test_1.c: Rewrite.
5965 * testsuite/incremental_test_2.c: Rewrite.
5966
0e70b911
CC
59672010-08-12 Cary Coutant <ccoutant@google.com>
5968
5969 * arm.cc (Target_arm::got_size): Add const.
5970 (Target_arm::got_entry_count): New function.
5971 (Target_arm::plt_entry_count): New function.
5972 (Target_arm::first_plt_entry_offset): New function.
5973 (Target_arm::plt_entry_size): New function.
5974 (Output_data_plt_arm::entry_count): New function.
5975 (Output_data_plt_arm::first_plt_entry_offset): New function.
5976 (Output_data_plt_arm::get_plt_entry_size): New function.
5977 * i386.cc (Target_i386::got_size): Add const.
5978 (Target_i386::got_entry_count): New function.
5979 (Target_i386::plt_entry_count): New function.
5980 (Target_i386::first_plt_entry_offset): New function.
5981 (Target_i386::plt_entry_size): New function.
5982 (Output_data_plt_i386::entry_count): New function.
5983 (Output_data_plt_i386::first_plt_entry_offset): New function.
5984 (Output_data_plt_i386::get_plt_entry_size): New function.
5985 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
5986 find_incremental_inputs_sections. Dump incremental_got_plt section.
5987 * incremental.cc: Include target.h.
5988 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
5989 parameter. Adjust all callers. Find incremental_got_plt section.
5990 (Incremental_inputs::create_data_sections): Create incremental_got_plt
5991 section.
5992 (Output_section_incremental_inputs::set_final_data_size): Calculate
5993 size of incremental_got_plt section.
5994 (Output_section_incremental_inputs::do_write): Write the
5995 incremental_got_plt section.
5996 (Got_plt_view_info): New struct.
5997 (Local_got_offset_visitor): New class.
5998 (Global_got_offset_visitor): New class.
5999 (Global_symbol_visitor_got_plt): New class.
6000 (Output_section_incremental_inputs::write_got_plt): New function.
6001 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
6002 Add parameter. Adjust all callers.
6003 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
6004 (Incremental_inputs::got_plt_section): New function.
6005 (Incremental_inputs::got_plt_section_): New data member.
6006 (Incremental_got_plt_reader): New class.
6007 * layout.cc (Layout::create_incremental_info_sections): Add the
6008 incremental_got_plt section.
6009 * object.h (Got_offset_list::get_list): New function.
6010 (Got offset_list::for_all_got_offsets): New function.
6011 (Sized_relobj::local_got_offset_list): New function.
6012 * powerpc.cc (Target_powerpc::got_size): Add const.
6013 (Target_powerpc::got_entry_count): New function.
6014 (Target_powerpc::plt_entry_count): New function.
6015 (Target_powerpc::first_plt_entry_offset): New function.
6016 (Target_powerpc::plt_entry_size): New function.
6017 (Output_data_plt_powerpc::entry_count): New function.
6018 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
6019 (Output_data_plt_powerpc::get_plt_entry_size): New function.
6020 * sparc.cc (Target_sparc::got_size): Add const.
6021 (Target_sparc::got_entry_count): New function.
6022 (Target_sparc::plt_entry_count): New function.
6023 (Target_sparc::first_plt_entry_offset): New function.
6024 (Target_sparc::plt_entry_size): New function.
6025 (Output_data_plt_sparc::entry_count): New function.
6026 (Output_data_plt_sparc::first_plt_entry_offset): New function.
6027 (Output_data_plt_sparc::get_plt_entry_size): New function.
6028 * symtab.h (Symbol::got_offset_list): New function.
6029 (Symbol_table::for_all_symbols): New function.
6030 * target.h (Sized_target::got_entry_count): New function.
6031 (Sized_target::plt_entry_count): New function.
6032 (Sized_target::plt_entry_size): New function.
6033 * x86_64.cc (Target_x86_64::got_size): Add const.
6034 (Target_x86_64::got_entry_count): New function.
6035 (Target_x86_64::plt_entry_count): New function.
6036 (Target_x86_64::first_plt_entry_offset): New function.
6037 (Target_x86_64::plt_entry_size): New function.
6038 (Output_data_plt_x86_64::entry_count): New function.
6039 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
6040 (Output_data_plt_x86_64::get_plt_entry_size): New function.
6041
09ec0418
CC
60422010-08-12 Cary Coutant <ccoutant@google.com>
6043
6044 * archive.cc: Include incremental.h.
6045 (Archive::Archive): Initialize incremental_info_.
6046 (Archive::include_member): Record archive members in incremental info.
6047 (Add_archive_symbols::run): Record begin and end of an archive in
6048 incremental info.
6049 (Lib_group::include_member): Record objects in incremental info.
6050 * archive.h (Incremental_archive_entry): Forward declaration.
6051 (Archive::set_incremental_info): New member function.
6052 (Archive::incremental_info): New member function.
6053 (Archive::Unused_symbol_iterator): New class.
6054 (Archive::unused_symbols_begin): New member function.
6055 (Archive::unused_symbols_end): New member function.
6056 (Archive::incremental_info_): New data member.
6057 * incremental-dump.cc (find_input_containing_global): New function.
6058 (dump_incremental_inputs): Dump new incremental info sections.
6059 * incremental.cc: Include symtab.h.
6060 (Output_section_incremental_inputs): New class.
6061 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
6062 new incremental info sections.
6063 (Sized_incremental_binary::do_check_inputs): Likewise.
6064 (Incremental_inputs::report_archive): Remove.
6065 (Incremental_inputs::report_archive_begin): New function.
6066 (Incremental_inputs::report_archive_end): New function.
6067 (Incremental_inputs::report_object): New function.
6068 (Incremental_inputs::finalize_inputs): Remove.
6069 (Incremental_inputs::report_input_section): New function.
6070 (Incremental_inputs::report_script): Rewrite.
6071 (Incremental_inputs::finalize): Do nothing but finalize string table.
6072 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
6073 (Incremental_inputs::sized_create_inputs_section_data): Remove.
6074 (Incremental_inputs::create_data_sections): New function.
6075 (Incremental_inputs::relocs_entsize): New function.
6076 (Output_section_incremental_inputs::set_final_data_size): New function.
6077 (Output_section_incremental_inputs::do_write): New function.
6078 (Output_section_incremental_inputs::write_header): New function.
6079 (Output_section_incremental_inputs::write_input_files): New function.
6080 (Output_section_incremental_inputs::write_info_blocks): New function.
6081 (Output_section_incremental_inputs::write_symtab): New function.
6082 * incremental.h (Incremental_script_entry): Forward declaration.
6083 (Incremental_object_entry): Forward declaration.
6084 (Incremental_archive_entry): Forward declaration.
6085 (Incremental_inputs): Forward declaration.
6086 (Incremental_inputs_header_data): Remove.
6087 (Incremental_inputs_header): Remove.
6088 (Incremental_inputs_header_write): Remove.
6089 (Incremental_inputs_entry_data): Remove.
6090 (Incremental_inputs_entry): Remove.
6091 (Incremental_inputs_entry_write): Remove.
6092 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
6093 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
6094 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
6095 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
6096 Likewise.
6097 (Incremental_input_entry): New class.
6098 (Incremental_script_entry): New class.
6099 (Incremental_object_entry): New class.
6100 (Incremental_archive_entry): New class.
6101 (Incremental_inputs::Incremental_inputs): Initialize new data members.
6102 (Incremental_inputs::report_inputs): Remove.
6103 (Incremental_inputs::report_archive): Remove.
6104 (Incremental_inputs::report_archive_begin): New function.
6105 (Incremental_inputs::report_archive_end): New function.
6106 (Incremental_inputs::report_object): Change prototype.
6107 (Incremental_inputs::report_input_section): New function.
6108 (Incremental_inputs::report_script): Change prototype.
6109 (Incremental_inputs::get_reloc_count): New function.
6110 (Incremental_inputs::set_reloc_count): New function.
6111 (Incremental_inputs::create_data_sections): New function.
6112 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
6113 (Incremental_inputs::inputs_section): New function.
6114 (Incremental_inputs::symtab_section): New function.
6115 (Incremental_inputs::relocs_section): New function.
6116 (Incremental_inputs::get_stringpool): Add const.
6117 (Incremental_inputs::command_line): Add const.
6118 (Incremental_inputs::inputs): Remove.
6119 (Incremental_inputs::command_line_key): New function.
6120 (Incremental_inputs::input_file_count): New function.
6121 (Incremental_inputs::input_files): New function.
6122 (Incremental_inputs::relocs_entsize): New function.
6123 (Incremental_inputs::sized_create_inputs_section_data): Remove.
6124 (Incremental_inputs::finalize_inputs): Remove.
6125 (Incremental_inputs::Input_info): Remove.
6126 (Incremental_inputs::lock_): Remove.
6127 (Incremental_inputs::inputs_): Change type.
6128 (Incremental_inputs::inputs_map_): Remove.
6129 (Incremental_inputs::current_object_entry_): New data member.
6130 (Incremental_inputs::inputs_section_): New data member.
6131 (Incremental_inputs::symtab_section_): New data member.
6132 (Incremental_inputs::relocs_section_): New data member.
6133 (Incremental_inputs::reloc_count_): New data member.
6134 (Incremental_inputs_reader): New class.
6135 (Incremental_symtab_reader): New class.
6136 (Incremental_relocs_reader): New class.
6137 * layout.cc (Layout::finalize): Move finalization of incremental info
6138 and creation of incremental info sections to follow finalization of
6139 symbol table. Set offsets for postprocessing sections.
6140 (Layout::create_incremental_info_sections): Call
6141 Incremental_inputs::create_data_sections. Add incremental symtab
6142 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
6143 sections to layout after input sections.
6144 * layout.h (struct Timespec): Forward declaration.
6145 (Layout::incremental_inputs): Add const.
6146 (Layout::create_incremental_info_sections): Add parameter.
6147 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
6148 * object.cc: Include incremental.h.
6149 (Relobj::finalize_incremental_relocs): New function.
6150 (Sized_relobj::do_layout): Record input sections in incremental info.
6151 * object.h (Object::output_section): New function.
6152 (Object::output_section_offset): Moved from Relobj.
6153 (Object::get_incremental_reloc_base): New function.
6154 (Object::get_incremental_reloc_count): New function.
6155 (Object::do_output_section): New function.
6156 (Object::do_output_section_offset): Moved from Relobj.
6157 (Object::do_get_incremental_reloc_base): New function.
6158 (Object::do_get_incremental_reloc_count): New function.
6159 (Object::Object): Initialize new data members.
6160 (Relobj::output_section): Renamed do_output_section and moved to
6161 protected.
6162 (Relobj::output_section_offset): Moved to Object.
6163 (Relobj::do_get_incremental_reloc_base): New function.
6164 (Relobj::do_get_incremental_reloc_count): New function.
6165 (Relobj::allocate_incremental_reloc_counts): New function.
6166 (Relobj::count_incremental_reloc): New function.
6167 (Relobj::finalize_incremental_relocs): New function.
6168 (Relobj::next_incremental_reloc_index): New function.
6169 (Relobj::reloc_counts_): New data member.
6170 (Relobj::reloc_bases_): New data member.
6171 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
6172 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
6173 (Sized_relobj::incremental_relocs_scan): New function.
6174 (Sized_relobj::incremental_relocs_scan_reltype): New function.
6175 (Sized_relobj::incremental_relocs_write): New function.
6176 (Sized_relobj::incremental_relocs_write_reltype): New function.
6177 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
6178 incremental link.
6179 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
6180 archives and object files elsewhere.
6181 (Add_symbols::run): Report object files here.
6182 (Finish_group::run): Report end of archive at end of group.
6183 * reloc.cc: Include layout.h, incremental.h.
6184 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
6185 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
6186 (Sized_relobj::incremental_relocs_scan): New function.
6187 (Sized_relobj::incremental_relocs_scan_reltype): New function.
6188 (Sized_relobj::do_relocate_sections): Write incremental relocations.
6189 (Sized_relobj::incremental_relocs_write): New function.
6190 (Sized_relobj::incremental_relocs_write_reltype): New function.
6191 * script.cc (read_input_script): Rewrite test for incremental link.
6192 Change call to Incremental_inputs::report_script.
6193 * symtab.h (Symbol_table::first_global_index): New function.
6194 (Symbol_table::output_count): New function.
6195
ce0d1972
DK
61962010-08-12 Doug Kwan <dougkwan@google.com>
6197
6198 * arm.cc (Target_arm::merge_object_attributes): Check command line
6199 options --no-wchar-size-warning and --no-enum-size-warning.
6200 * options.h (General_options): Add ld-compatible options
6201 --no-enum-size-warning and --no-wchar-size-warning.
6202
6e5710ce
ILT
62032010-08-04 Ian Lance Taylor <iant@google.com>
6204
6205 * x86_64.cc (Target_x86_64::Scan::local): Use
6206 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
6207 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
6208 (Target_x86_64::Scan::global): Likewise.
6209 (Target_x86_64::Relocate::relocate): Likewise.
6210 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
6211 Likewise.
6212
fef830db
CC
62132010-08-03 Cary Coutant <ccoutant@google.com>
6214
6215 * merge.cc (Output_merge_string::do_add_input_section): Count strings
6216 to reserve space in merged_strings vector. Keep total input size
6217 for stats.
6218 (Output_merge_string::do_print_merge_stats): Print total input size.
6219 * merge.h (Output_merge_string): Add input_size_ field.
6220 * stringpool.cc (Stringpool_template::string_length): Move
6221 implementations out of Stringpool_template class and place in
6222 stringpool.h.
6223 * stringpool.h (string_length): Move out of Stringpool_template.
6224
1e3811b0
ILT
62252010-08-03 Ian Lance Taylor <iant@google.com>
6226
6227 PR 11712
6228 * layout.cc (relaxation_loop_body): If address of load segment is
6229 set, adjust address to include headers if possible.
6230
7af0c620
ILT
62312010-08-03 Ian Lance Taylor <iant@google.com>
6232
6233 * version.cc (version_string): Bump to 1.10.
6234
22f0da72
ILT
62352010-08-03 Ian Lance Taylor <iant@google.com>
6236
6237 PR 11805
6238 * layout.h (enum Output_section_order): Define.
6239 (class Layout): Update declarations.
6240 * layout.cc (Layout::get_output_section): Add order parameter.
6241 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
6242 is_first_non_relro parameters. Change all callers.
6243 (Layout::choose_output_section): Likewise.
6244 (Layout::add_output_section_data): Likewise.
6245 (Layout::make_output_section): Likewise. Set order.
6246 (Layout::default_section_order): New function.
6247 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
6248 * output.cc (Output_section::Output_section): Initialize order_.
6249 Don't initialize deleted fields.
6250 (Output_segment::Output_segment): Don't initialize deleted
6251 fields.
6252 (Output_segment::add_output_section_to_load): New function
6253 replacing add_output_section. Change all callers to call this or
6254 add_output_section_to_nonload.
6255 (Output_segment::add_output_section_to_nonload): New function.
6256 (Output_segment::remove_output_section): Rewrite.
6257 (Output_segment::add_initial_output_data): Likewise.
6258 (Output_segment::has_any_data_sections): Likewise.
6259 (Output_segment::is_first_section_relro): Likewise.
6260 (Output_segment::maximum_alignment): Likewise.
6261 (Output_segment::has_dynamic_reloc): New function replacing
6262 dynamic_reloc_count. Change all callers.
6263 (Output_segment::has_dynamic_reloc_list): New function replacing
6264 dynamic_reloc_count_list. Change all callers.
6265 (Output_segment::set_section_addresses): Rewrite.
6266 (Output_segment::set_offset): Rewrite.
6267 (Output_segment::find_first_and_last_list): Remove.
6268 (Output_segment::set_tls_offsets): Rewrite.
6269 (Output_segment::first_section_load_address): Likewise.
6270 (Output_segment::output_section_count): Likewise.
6271 (Output_segment::section_with_lowest_load_address): Likewise.
6272 (Output_segment::write_section_headers): Likewise.
6273 (Output_segment::print_sections_to_map): Likewise.
6274 * output.h (class Output_data): Remove dynamic_reloc_count_
6275 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
6276 (Output_data::add_dynamic_reloc): Rewrite.
6277 (Output_data::has_dynamic_reloc): New function.
6278 (Output_data::dynamic_reloc_count): Remove.
6279 (class Output_section): Add order_ field. Remvoe is_relro_local_,
6280 is_last_relro_, is_first_non_relro_, is_interp_,
6281 is_dynamic_linker_section_ fields. Add order and set_order
6282 functions. Remove is_relro_local, set_is_relro_local,
6283 is_last_relro, set_is_last_relro, is_first_non_relro,
6284 set_is_first_non_relro functions, is_interp, set_is_interp,
6285 is_dynamic_linker_section, and set_is_dynamic_linker_section
6286 functions.
6287 (class Output_segment): Change Output_data_list from std::list to
6288 std:;vector. Add output_lists_ field. Remove output_data_ and
6289 output_bss_ fields. Update declarations.
6290
3ff2ccb0
ILT
62912010-08-02 Ian Lance Taylor <iant@google.com>
6292
6293 * arm.cc (Target_arm::gc_process_relocs): Use typename.
6294 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
6295 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
6296
88a4108b
ILT
62972010-08-02 Ian Lance Taylor <iant@google.com>
6298
6299 PR 11855
6300 * script.cc (Script_options::Script_options): Initialize
6301 symbol_definitions_ and symbol_references_.
6302 (Script_options::add_symbol_assignment): Update
6303 symbol_definitions_ and symbol_references_.
6304 (Script_options::add_symbol_reference): New function.
6305 (script_symbol): New function.
6306 * script.h (class Script_options): Add symbol_definitions_ and
6307 symbol_references_ fields.
6308 (Script_options::referenced_const_iterator): New type.
6309 (Script_options::referenced_begin): New function.
6310 (Script_options::referenced_end): New function.
6311 (Script_options::is_referenced): New function.
6312 (Script_options::any_unreferenced): New function.
6313 * script-c.h (script_symbol): Declare.
6314 * yyscript.y (exp): Call script_symbol.
6315 * symtab.cc: Include "script.h".
6316 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
6317 Change all callers. Check symbols referenced by scripts.
6318 (Symbol_table::add_undefined_symbols_from_command_line): Add
6319 layout parameter. Change all callers.
6320 (Symbol_table::do_add_undefined_symbols_from_command_line):
6321 Likewise. Break out loop body. Check symbols referenced by
6322 scripts.
6323 (Symbol_table::add_undefined_symbol_from_command_line): New
6324 function broken out of
6325 do_add_undefined_symbols_from_command_line.
6326 * symtab.h (class Symbol_table): Update declarations.
6327 * archive.cc: Include "layout.h".
6328 (Archive::should_include_member): Add layout parameter. Change
6329 all callers. Check for symbol mentioned in expression.
6330 * archive.h (class Archive): Update declaration.
6331 * object.cc (Sized_relobj::do_should_include_member): Add layout
6332 parameter.
6333 * object.h (Object::should_include_member): Add layout parameter.
6334 Change all callers.
6335 (Object::do_should_include_member): Add layout parameter.
6336 (class Sized_relobj): Update declaration.
6337 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
6338 parameter.
6339 * dynobj.h (class Sized_dynobj): Update declaration.
6340 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
6341 layout parameter.
6342 * plugin.h (class Sized_pluginobj): Update declaration.
6343
5f1ab67a
ILT
63442010-08-02 Ian Lance Taylor <iant@google.com>
6345
6346 PR 11866
6347 * output.cc (Output_segment::set_offset): Search for the first and
6348 last sections rather than assuming that the list is in order.
6349 (Output_segment::find_first_and_last_list): New function.
6350 * output.h (class Output_segment): Update declarations.
6351 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
6352 (relro_strip_test_SOURCES): New variable.
6353 (relro_strip_test_DEPENDENCIES): New variable.
6354 (relro_strip_test_LDFLAGS): New variable.
6355 (relro_strip_test_LDADD): New variable.
6356 (relro_strip_test.so): New target.
6357
a8df5856
ILT
63582010-08-02 Ian Lance Taylor <iant@google.com>
6359
6360 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
6361 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
6362 (Target_i386::got_tlsdesc_section): New function.
6363 (Target_i386::got_section): Create space for GOT entries for
6364 TLSDESC relocations.
6365 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
6366 R_386_TLS_GOTDESC.
6367 (Target_i386::Scan::global): Likewise.
6368 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
6369 using TLSDESC GOT.
6370 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
6371 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
6372 (Target_x86_64::got_tlsdesc_section): New function.
6373 (Target_x86_64::got_section): Create space for GOT entries for
6374 TLSDESC relocations.
6375 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
6376 R_386_TLS_GOTDESC.
6377 (Target_x86_64::Scan::global): Likewise.
6378 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
6379 using TLSDESC GOT.
6380
0c10a0a6
ILT
63812010-08-02 Ian Lance Taylor <iant@google.com>
6382
6383 * testsuite/final_layout.sh: Use dc to convert from hex to
6384 decimal.
6385
41cbeecc
ST
63862010-07-29 Sriraman Tallam <tmsriram@google.com>
6387
6388 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
6389 paramter to the call to gold::gc_process_relocs.
6390 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
6391 paramter to the call to gold::gc_process_relocs.
6392 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
6393 parameter to the call to gold::gc_process_relocs.
6394 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
6395 template parameter to the call to gold::gc_process_relocs.
6396 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
6397 paramter to the call to gold::gc_process_relocs.
6398 * gc.h (get_embedded_addend_size): New function.
6399 (gc_process_relocs): Save the size of the reloc for use by ICF.
6400 * icf.cc (get_section_contents): Get the addend from the text section
6401 for SHT_REL relocation sections.
6402 * icf.h (Icf::Reloc_addend_size_info): New typedef.
6403 (Icf::Reloc_info): Add new member reloc_addend_size_info.
6404 * int_encoding.h (read_from_pointer): New overloaded function.
6405 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
6406 * testsuite/icf_sht_rel_addend_test.sh: New file.
6407 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
6408 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
6409
6ea55b82
RW
64102010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6411
6412 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
6413 * Makefile.in: Regenerate.
6414 * testsuite/Makefile.in: Regenerate.
6415
9691462b
ILT
64162010-07-27 Jeffrey Yasskin <jyasskin@google.com>
6417
6418 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
6419 * gold/testsuite/debug_msg.cc: Likewise.
6420 * gold/testsuite/odr_violation1.cc
6421 * gold/testsuite/odr_violation2.cc
6422
76897331
CC
64232010-07-21 Cary Coutant <ccoutant@google.com>
6424
6425 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
6426 string, and length fields.
6427 (Output_merge_string::Merged_strings_list): New type.
6428 (Output_merge_string::Merged_strings_lists): New typedef.
6429 (Output_merge_string): Replace merged_strings_ with
6430 merged_strings_lists_.
6431 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
6432 Merged_strings_list per input object and section. Don't store pointer
6433 to the string. Don't store length with each merged string entry.
6434 (Output_merge_string::finalize_merged_data): Loop over list of merged
6435 strings lists. Recompute length of each merged string.
6436
78384e8f
CC
64372010-07-15 Cary Coutant <ccoutant@google.com>
6438
6439 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
6440 here.
6441
783659f9
ILT
64422010-07-14 Ian Lance Taylor <iant@google.com>
6443
6444 * descriptors.cc (Descriptors::open): Report correct name in error
6445 message.
6446
131687b4
DK
64472010-07-13 Doug Kwan <dougkwan@google.com>
6448
6449 * arm.cc (Arm_input_section::Arm_input_section): For a
6450 SHT_ARM_EXIDX section, always keeps the input sections.
6451 (Arm_input_section::set_exidx_section_link): New method.
6452 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
6453 has_errors_ to false.
6454 (Arm_exidx_input_section::has_errors,
6455 Arm_exidx_input_section::set_has_errors): New methods.
6456 (Arm_exidx_input_section::has_errors_): New data member.
6457 (Arm_relobj::get_exidx_shndx_list): New method.
6458 (Arm_output_section::append_text_sections_to_list): Do not skip
6459 section without SHF_EXECINSTR.
6460 (Arm_output_section::fix_exidx_coverage): Skip input sections with
6461 errors.
2e702c99 6462 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
6463 section header. Make error messages more verbose. Check for
6464 a non-executable section linked to an EXIDX section.
6465 (Arm_relobj::do_read_symbols): Remove error checking, which has been
6466 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
6467 check that there is no deferred EXIDX section if we exit early.
6468 Instead of not making an EXIDX section in case of an error, make one
6469 and set the has_errors flag of it.
6470 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
6471 in a relocatable link.
6472 (Target_arm::do_relax): Look for the EXIDX output section instead of
6473 assuming that it is called .ARM.exidx.
2e702c99 6474 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
6475 section list. Do not check for SHF_EXECINSTR section flags but
6476 skip any input section with errors.
6477 * output.cc (Output_section::Output_section): Initialize
6478 always_keeps_input_sections_ to false.
6479 (Output_section::add_input_section): Check for
6480 always_keeps_input_sections_.
6481 * output.h (Output_section::always_keeps_input_sections,
6482 Output_section::set_always_keeps_input_sections): New methods.
6483 (Output_section::always_keeps_input_sections): New data member.
6484
69517287
RÁE
64852010-07-13 Rafael Espindola <espindola@google.com>
6486
6487 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
6488 * fileread.h (Input_file): Add try_extra_search_path and find_file.
6489
82742395
ILT
64902010-07-13 Philip Herron <herron.philip@googlemail.com>
6491 Ian Lance Taylor <iant@google.com>
6492
6493 * output.h (Output_section_lookup_maps::add_merge_section):
6494 Correct check of whether value was inserted.
6495 (Output_section_lookup_maps::add_merge_input_section): Likewise.
6496 (Output_section_lookup_maps::add_relaxed_input_section):
6497 Likewise.
6498 * arm.cc (Target_arm::got_section): Remove used local os.
6499 * i386.cc (Target_i386::got_section): Likewise.
6500 * x86_64.cc (Target_x86_64::got_section): Likewise.
6501 * sparc.cc (Target_sparc::got_section): Likewise.
6502 (Target_sparc::relocate): Remove unused local have_got_offset.
6503 * powerpc.cc (Target_powerpc::relocate): Likewise.
6504
f2d707b5
ILT
65052010-07-13 Ian Lance Taylor <iant@google.com>
6506
241531d6
ILT
6507 * compressed_output.cc (zlib_decompress): Fix signature in
6508 !HAVE_ZLIB_H case.
6509
f2d707b5
ILT
6510 * archive.cc (Archive::include_member): Unlock an external member
6511 of a thin archive. Don't bother to delete an object we know is
6512 NULL.
6513
a2e47362
CC
65142010-07-12 Cary Coutant <ccoutant@google.com>
6515
6516 * compressed_output.cc (zlib_decompress): New function.
6517 (get_uncompressed_size): New function.
6518 (decompress_input_section): New function.
6519 * compressed_output.h (get_uncompressed_size): New function.
6520 (decompress_input_section): New function.
6521 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
6522 Handle compressed debug sections.
6523 * layout.cc (is_compressed_debug_section): New function.
6524 (Layout::output_section_name): Map compressed section names to
6525 canonical names.
6526 * layout.h (is_compressed_debug_section): New function.
6527 (is_debug_info_section): Recognize compressed debug sections.
6528 * merge.cc: Include compressed_output.h.
6529 (Output_merge_data::do_add_input_section): Handle compressed
6530 debug sections.
6531 (Output_merge_string::do_add_input_section): Handle compressed
6532 debug sections.
6533 * object.cc: Include compressed_output.h.
6534 (Sized_relobj::Sized_relobj): Initialize new data members.
6535 (build_compressed_section_map): New function.
6536 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
6537 * object.h (Object::section_is_compressed): New method.
6538 (Object::do_section_is_compressed): New method.
6539 (Sized_relobj::Compressed_section_map): New type.
6540 (Sized_relobj::do_section_is_compressed): New method.
6541 (Sized_relobj::compressed_sections_): New data member.
6542 * output.cc (Output_section::add_input_section): Handle compressed
6543 debug sections.
6544 * reloc.cc: Include compressed_output.h.
6545 (Sized_relobj::write_sections): Handle compressed debug sections.
6546
ce279a62
CC
65472010-07-08 Cary Coutant <ccoutant@google.com>
6548
6549 * resolve.cc (Symbol_table::resolve): Remember whether undef was
6550 weak when resolving to a dynamic def.
6551 (Symbol_table::should_override): Add adjust_dyndef flag; set it
6552 for weak undef/dynamic def cases. Adjust callers.
6553 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
6554 undef_binding_weak_.
6555 (Symbol_table::sized_write_globals): Adjust symbol binding.
6556 (Symbol_table::sized_write_symbol): Add binding parameter.
6557 * symtab.h (Symbol::set_undef_binding): New method.
6558 (Symbol::is_undef_binding_weak): New method.
6559 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
6560 (Symbol_table::should_override): Add new parameter.
6561 (Symbol_table::sized_write_symbol): Add new parameter.
6562
6563 * testsuite/weak_undef_file1.cc: Add new test case.
6564 * testsuite/weak_undef_file2.cc: Fix header comment.
6565 * testsuite/weak_undef_test.cc: Add new test case.
6566
b2286c10
DK
65672010-06-29 Doug Kwan <dougkwan@google.com>
6568
6569 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
6570 Initialize USE_SYMBOL_.
6571 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
6572 definition.
6573 (Arm_reloc_property::uses_symbol_): New data member declaration.
6574 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
6575 uses symbol value and symbol is undefined but not weakly undefined.
6576
4802450a
RÁE
65772010-06-28 Rafael Espindola <espindola@google.com>
6578
6579 * plugin.cc (Plugin::load): Use dlerror.
6580
e5ca47ba
ILT
65812010-06-26 Jeffrey Yaskin <jyasskin@google.com>
6582
6583 * symtab.cc (detect_odr_violations): When reporting an ODR
6584 violation, report an object where the symbol is defined.
6585
8a75a161
DK
65862010-06-25 Doug Kwan <dougkwan@google.com>
6587
6588 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
6589 (Target_arm::section_may_have_icf_unsafe_pointers): New method
6590 definition.
6591 (Target_arm::Scan::local_reloc_may_be_function_pointer,
6592 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
6593 target hook to detect function points.
6594 (Target_arm::Scan::possible_function_pointer_reloc): New method.
6595 * icf.h (Icf::check_section_for_function_pointers): Change type of
6596 parameter SECTION_NAME to const reference to std::string. Use
6597 target hook to determine if section may have unsafe pointers.
6598 * target.h (Target::section_may_have_icf_unsafe_pointers): New
6599 method definition.
6600
42218b9f
RÁE
66012010-06-21 Rafael Espindola <espindola@google.com>
6602
6603 * fileread.cc (Input_file::find_fie): New
6604 (Input_file::open): Use Input_file::find_fie.
6605 * fileread.h (Input_file::find_fie): New
6606 * plugin.cc (set_extra_library_path): New.
6607 (Plugin::load): Add set_extra_library_path to the transfer vector.
6608 (Plugin_manager::set_extra_library_path): New.
6609 (Plugin_manager::add_input_file): Use the extra search path if set.
6610 (set_extra_library_path(): New.
6611 * plugin.h (Plugin_manager): Add set_extra_library_path and
6612 extra_search_path_.
6613
a0506cca
CC
66142010-06-19 Cary Coutant <ccoutant@google.com>
6615
6616 * layout.cc (gdb_sections): Add .debug_types.
6617 (lines_only_debug_sections): Likewise.
6618
6508b958
RÁE
66192010-06-18 Rafael Espindola <espindola@google.com>
6620
6621 * plugin.cc (add_input_file,add_input_library)
6622 (Plugin_manager::add_input_file): Make filename arguments const.
6623 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
6624 const.
6625
3e235302
DK
66262010-06-16 Doug Kwan <dougkwan@google.com>
6627
6628 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
6629 .ARM.attributes section if we have not merged any input
6630 attributes sections.
6631
106e8a6c
DK
66322010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6633
6634 * arm.cc: Allow combining objects with no EABI version
6635 information.
6636
91ff43fe
RÁE
66372010-06-15 Rafael Espindola <espindola@google.com>
6638
6639 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
6640
68ed838c
ILT
66412010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6642
6643 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
6644 (struct iovec): Correct !HAVE_READV definition.
6645
f3a2388f
CC
66462010-06-10 Cary Coutant <ccoutant@google.com>
6647
6648 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
6649 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
6650 reloc sections.
6651 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
6652
6653 PR 11683
6654 * symtab.h (Symbol::is_placeholder): New member function.
6655 * target-reloc.h (relocate_section): Check for placeholder symbols.
6656
6657 * testsuite/Makefile.am (plugin_test_8): New test.
6658 (plugin_test_9): New test.
6659 * testsuite/Makefile.in: Regenerate.
6660
e1df38aa
NC
66612010-06-09 Nick Clifton <nickc@redhat.com>
6662
6663 * yyscript.y (input_list_element): Allow strings prefixed with
6664 the '-' character. Treat these as libraries.
6665 * script.cc (script_add_library): New function. Adds a library
6666 specified by "-l<name>" found in an input script.
6667 * script-c.h: Add prototype for script_add_library.
6668
25bbe950
DK
66692010-06-07 Doug Kwan <dougkwan@google.com>
6670
6671 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
6672 Restrict stub-group size to be within long conditional branch
6673 range when working around cortex-A8 erratum.
6674
0f32ea4c
ILT
66752010-06-07 Damien Diederen <dd@crosstwine.com>
6676
6677 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
6678 #ifdef typo.
6679
8fe2a369
ST
66802010-06-03 Sriraman Tallam <tmsriram@google.com>
6681
6682 PR gold/11658
6683 * output.cc
6684 (Output_section::Input_section_sort_entry::compare_section_ordering):
6685 Change to return non-zero correctly.
6686 (Output_section::Input_section_sort_section_order_index_compare
6687 ::operator()): Change to fix ambiguity in comparisons.
6688
6e9ba2ca
ST
66892010-06-01 Sriraman Tallam <tmsriram@google.com>
6690
6691 * gold.h (is_wildcard_string): New function.
6692 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
6693 (Layout::layout_eh_frame): Ditto.
6694 (Layout::find_section_order_index): New method.
6695 (Layout::read_layout_from_file): New method.
6696 * layout.h (Layout::find_section_order_index): New method.
6697 (Layout::read_layout_from_file): New method.
6698 (Layout::input_section_position_): New private member.
6699 (Layout::input_section_glob_): New private member.
6700 * main.cc (main): Call read_layout_from_file here.
6701 * options.h (--section-ordering-file): New option.
6702 * output.cc (Output_section::input_section_order_specified_): New
6703 member.
6704 (Output_section::Output_section): Initialize new member.
6705 (Output_section::add_input_section): Add new parameter.
6706 Keep input sections when --section-ordering-file is used.
6707 (Output_section::set_final_data_size): Sort input sections when
6708 section ordering file is specified.
6709 (Output_section::Input_section_sort_entry): Add new parameter.
6710 Check sorting type.
6711 (Output_section::Input_section_sort_entry::compare_section_ordering):
6712 New method.
6713 (Output_section::Input_section_sort_compare::operator()): Change to
6714 consider section_order_index.
6715 (Output_section::Input_section_sort_init_fini_compare::operator()):
6716 Change to consider section_order_index.
6717 (Output_section::Input_section_sort_section_order_index_compare
6718 ::operator()): New method.
6719 (Output_section::sort_attached_input_sections): Change to sort
6720 according to section order when specified.
e1df38aa
NC
6721 (Output_section::add_input_section<32, true>): Add new parameter.
6722 (Output_section::add_input_section<64, true>): Add new parameter.
6723 (Output_section::add_input_section<32, false>): Add new parameter.
6724 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
6725 * output.h (Output_section::add_input_section): Add new parameter.
6726 (Output_section::input_section_order_specified): New
6727 method.
6728 (Output_section::set_input_section_order_specified): New method.
6729 (Input_section::Input_section): Initialize section_order_index_.
6730 (Input_section::section_order_index): New method.
6731 (Input_section::set_section_order_index): New method.
6732 (Input_section::section_order_index_): New member.
6733 (Input_section::Input_section_sort_section_order_index_compare): New
6734 struct.
6735 (Output_section::input_section_order_specified_): New member.
6736 * script-sections.cc (is_wildcard_string): Delete and move modified
6737 method to gold.h.
6738 (Output_section_element_input::Output_section_element_input): Modify
6739 call to is_wildcard_string.
6740 (Output_section_element_input::Input_section_pattern
6741 ::Input_section_pattern): Ditto.
6742 (Output_section_element_input::Output_section_element_input): Ditto.
6743 * testsuite/Makefile.am (final_layout): New test case.
6744 * testsuite/Makefile.in: Regenerate.
6745 * testsuite/final_layout.cc: New file.
6746 * testsuite/final_layout.sh: New file.
6747
3537c84b
RÁE
67482010-06-01 Rafael Espindola <espindola@google.com>
6749
6750 * plugin.cc (Plugin::load): Pass the output name to the plugin.
6751
105b6afd
RÁE
67522010-06-01 Rafael Espindola <espindola@google.com>
6753
6754 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
6755 visibility of symbols.
6756
29e11421
DK
67572010-05-27 Doug Kwan <dougkwan@google.com>
6758
6759 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
6760 from start of output section instead of address for a local symbol
6761 in a merged or relaxed section when doing a relocatable link.
6762
5e0f337e
RÁE
67632010-05-26 Rafael Espindola <espindola@google.com>
6764
703d02da 6765 PR 11604
5e0f337e
RÁE
6766 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
6767 adding sections the garbage collector removed.
6768 * gold/testsuite/Makefile.am: Add test.
6769 * gold/testsuite/Makefile.in: Regenerate.
6770 * gold/testsuite/plugin_test_7.sh: New.
6771 * gold/testsuite/plugin_test_7_1.c: New.
6772 * gold/testsuite/plugin_test_7_2.c: New.
6773
f4187277
RÁE
67742010-05-26 Rafael Espindola <espindola@google.com>
6775
6776 * script-sections.cc (Output_section_definition::set_section_addresses):
6777 Check for --section-start.
6778
5c388529
DK
67792010-05-26 Doug Kwan <dougkwan@google.com>
6780
6781 * arm.cc (Arm_scan_relocatable_relocs): New class.
6782 (Target_arm::relocate_special_relocatable): New method.
6783 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
6784 (Arm_relocate_functions::thumb_branch_common): Same.
6785 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
6786 instead of Default_scan_relocatable_relocs.
6787 * target-reloc.h (relocate_for_relocatable): Let target handle
6788 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
6789 * target.h (Sized_target::relocate_special_relocatable): New method.
6790
bca1c3ae
ILT
67912010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6792
6793 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
6794
0439c796
DK
67952010-05-23 Doug Kwan <dougkwan@google.com>
6796
6797 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
6798 instead of a cast.
6799 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
6800 with a direct branch, not a conditional branch, to a stub.
6801 * merge.cc (Output_merge_base::record_input_section): New method
6802 defintion.
6803 (Output_merge_data::do_add_input_section): Record input section if
6804 keeps-input-sections flag is set.
6805 (Output_merge_string::do_add_input_section): Ditto.
6806 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
6807 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
6808 INPUT_SECTIONS_.
6809 (Output_merge_base::keeps_input_sections,
6810 Output_merge_base::set_keeps_input_sections,
6811 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
6812 method definitions.
6813 (Output_merge_base::Input_sections): New type declaration.
6814 (Output_merge_base::input_sections_begin,
6815 Output_merge_base::input_sections_end,
6816 Output_merge_base::do_set_keeps_input_sections): New method definitions.
6817 (Output_merge_base::bool keeps_input_sections_,
6818 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
6819 Output_merge_base::input_sections_): New data members.
6820 (Output_merge_data::do_set_keeps_input_sections): New method
6821 defintion.
6822 (Output_merge_string::do_set_keeps_input_sections): Ditto.
6823 * output.cc (Output_section::Input_section::relobj): Move method
6824 defintion from class declaration to here and handle merge sections.
6825 (Output_section::Input_section::shndx): Ditto.
6826 (Output_section::Output_section): Remove initializations of removed
6827 data members and initialize new data member LOOKUP_MAPS_.
6828 (Output_section::add_input_section): Set keeps-input-sections flag
6829 for a newly created merge output section as appropriate. Adjust code
6830 to use Output_section_lookup_maps class.
6831 (Output_section::add_relaxed_input_section): Adjst code for lookup
6832 maps code refactoring.
2e702c99 6833 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
6834 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
6835 class. If adding input section to a newly created merge output
6836 section fails, remove the new merge section.
6837 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 6838 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 6839 (Output_section::find_merge_section): Ditto.
0439c796 6840 (Output_section::build_lookup_maps): New method defintion.
2e702c99 6841 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
6842 Output_section_lookup_maps class.
6843 (Output_section::get_input_sections): Export merge sections. Adjust
6844 code to use Output_section_lookup_maps class.
6845 (Output_section:::add_script_input_section): Adjust code to use
6846 Output_section_lookup_maps class. Update lookup maps for merge
6847 sections also.
6848 (Output_section::discard_states): Use Output_section_lookup_maps.
6849 (Output_section::restore_states): Same.
6850 * output.h (Merge_section_properties): Move class defintion out of
6851 Output_section.
6852 (Output_section_lookup_maps): New class.
6853 (Output_section::Input_section::is_merge_section): New method
6854 defintion.
6855 (Output_section::Input_section::relobj): Move defintion out of class
6856 defintion. Declare method only.
6857 (Output_section::Input_section::shndx): Ditto.
6858 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 6859 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
6860 (Output_section::Merge_section_by_properties_map,
6861 Output_section::Output_section_data_by_input_section_map,
6862 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
6863 Remove types.
2e702c99 6864 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
6865 KEEPS_INPUT_SECTIONS.
6866 (Output_section::build_lookup_maps): New method declaration.
6867 (Output_section::merge_section_map_,
6868 Output_section::merge_section_by_properties_map_,
6869 Output_section::relaxed_input_section_map_,
6870 Output_section::is_relaxed_input_section_map_valid_): Remove data
6871 members.
6872 (Output_section::lookup_maps_): New data member.
6873
76295588
L
68742010-05-21 Doug Kwan <dougkwan@google.com>
6875
6876 PR gold/11619
6877 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
6878 avoid a compilation error.
6879
d103a984
RÁE
68802010-05-19 Rafael Espindola <espindola@google.com>
6881
6882 * script-sections.cc (Output_section_definition::allocate_to_segment):
6883 Update the phdrs_list even when the output section is NULL.
6884 * testsuite/Makefile.am: Add test.
6885 * testsuite/Makefile.in: Regenerate.
6886 * testsuite/script_test_9.cc: New.
6887 * testsuite/script_test_9.sh: New.
6888 * testsuite/script_test_9.t: New.
6889
6625d24e
DK
68902010-05-19 Doug Kwan <dougkwan@google.com>
6891
6892 * arm.cc (Arm_input_section::original_size): New method.
6893 (Arm_input_section::do_addralign): Add a cast.
6894 (Arm_input_section::do_output_offset): Remove static cast.
6895 (Arm_input_section::original_addralign,
6896 Arm_input_section::original_size_): Change type to uint32_t.
6897 (Arm_input_section::init): Add safe casts for section alignment
6898 and size.
6899 (Arm_input_section::set_final_data_size): Do not set address and
6900 offset of stub table.
6901 (Arm_output_section::fix_exidx_coverage): Change use of of
6902 Output_section::Simple_input_section to that of
6903 Output_section::Input_section.
6904 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
6905 except for the first pass.
6906 * output.cc (Output_section::get_input_sections): Change type of
6907 input_sections to std::list<Input_section>.
6908 (Output_section::add_script_input_section): Rename from
6909 Output_section::add_simple_input_section. Change type of SIS
6910 parameter from Simple_input_section to Input_section.
6911 * output.h (Output_section::Simple_input_section): Remove class.
6912 (Output_section::Input_section): Change class visibility to public.
6913 (Output_section::Input_section::addralign): Use stored alignments
6914 for special input sections if set.
6915 (Output_section::Input_section::set_addralign): New method.
6916 (Output_section::get_input_sections): Change parameter type from
6917 list of Simple_input_section to list of Input_section.
6918 (Output_section::add_script_input_section): Rename from
6919 Output_section::add_simple_input_section. Change first parameter's
6920 type from Simple_input_section to Input_section and remove the
6921 second and third parameters.
6922 * script-sections.cc (Input_section::Input_section_list): Change
6923 type to list of Output_section::Input_section/
6924 (Input_section_info::Input_section_info): Change parameter type of
6925 INPUT_SECTION to Output_section::Input_section.
6926 (Input_section_info::input_section): Change return type.
6927 (Input_section_info::input_section_): Change type to
6928 Output_section::Input_section.
6929 (Output_section_element_input::set_section_addresses): Adjust code
6930 to use Output_section::Input_section instead of
6931 Output_section::Simple_input_section. Adjust code for renaming
6932 of Output_section::add_simple_input_section.
6933 (Orphan_output_section::set_section_addresses): Ditto.
6934
e1e82ea4
RW
69352010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6936
6937 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
6938 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
6939
91e75c8a
RÁE
69402010-05-18 Rafael Espindola <espindola@google.com>
6941
6942 * options.cc (General_options::finalize): Handle -nostdlib.
6943 * options.h (nostdlib): New option.
6944 * script.cc (script_add_search_dir): Handle -nostdlib.
6945
da59ad79
DK
69462010-05-12 Doug Kwan <dougkwan@google.com>
6947
6948 * arm.cc (Target_arm::do_finalize_sections): Create an empty
6949 attributes section only if there no attributes section after merging.
6950 (Target_arm::merge_object_attributes): Move value of
e1df38aa 6951 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
6952 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
6953 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
6954 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
6955 and arm_attr_merge_7.stdout.
6956 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
6957 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
6958 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
6959 arm_attr_merge_7b.o): New rules.
6960 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
6961 arm_attr_merge_7
6962 * testsuite/Makefile.in: Regenerate.
6963 * testsuite/arm_attr_merge.sh: New file.
6964 * testsuite/arm_attr_merge_[67][ab].s: Same.
6965
3e01a7fd
NC
69662010-05-05 Nick Clifton <nickc@redhat.com>
6967
6968 * po/es.po: Updated Spanish translation.
6969
7ad2014a
L
69702010-04-27 H.J. Lu <hongjiu.lu@intel.com>
6971
6972 * Makefile.am (install-exec-local): Properly install gold as
6973 default cross linker.
6974 * Makefile.in: Regenerated.
6975
4fda8867
NC
69762010-04-27 H.J. Lu <hongjiu.lu@intel.com>
6977 Nick Clifton <nickc@redhat.com>
6978
6979 * configure.ac (install_as_default): Define and set to false
6980 unless --enable-gold or --enable-gold=both/gold has been
6981 specified.
6982 * configure: Regenerate.
6983
6984 * Makefile.am (install-exec-local): Install the executable as
6985 'ld.gold'. If install_as_default is true then also install it as
6986 'ld'.
6987 * Makefile.in: Regenerated.
6988
bd288ea2
ILT
69892010-04-24 Ian Lance Taylor <iant@google.com>
6990
6991 * layout.cc (Layout::layout_reloc): In relocatable link don't
6992 combine reloc sections for grouped sections.
6993
ef38fd8a
ST
69942010-04-23 Sriraman Tallam <tmsriram@google.com>
6995
6996 * gc.h (gc_process_relocs): Pass information on relocs pointing to
6997 sections that are not ordinary to icf.
6998 * icf.cc (get_section_contents): Handle relocation pointing to section
6999 with no object or shndx information.
7000 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
7001 * testsuite/Makefile.in: Regenerate.
7002 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
7003 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
7004
f6973bdc
ILT
70052010-04-22 Ian Lance Taylor <iant@google.com>
7006
7007 * expression.cc (Expression::Expression_eval_info): Add
7008 result_alignment_pointer field.
7009 (Expression::eval_with_dot): Add result_alignment_pointer
7010 parameter. Change all callers.
7011 (Expression::eval_maybe_dot): Likewise.
7012 (class Binary_expression): Add alignment_pointer parameter to
7013 left_value and right_value. Change all callers.
7014 (BINARY_EXPRESSION): Set result alignment.
7015 (class Trinary_expression): Add alignment_pointer parameter to
7016 arg2_value and arg3_value. Change all callers.
7017 (Trinary_cond::value): Set result alignment.
7018 (Max_expression::value, Min_expression::value): Likewise.
7019 (Align_expression::value): Likewise.
7020 * script-sections.cc (class Sections_element): Add dot_alignment
7021 parameter to set_section_addresses virtual function. Update
7022 instantiations.
7023 (class Output_section_element): Likewise.
7024 (Script_sections::create_segments): Add dot_alignment parameter.
7025 Change all callers.
7026 (Script_sections::create_segments_from_phdrs_clause): Likewise.
7027 (Script_sections::set_phdrs_clause_addresses): Likewise.
7028 * script-sections.h: Update declarations.
7029 * script.h: Update declarations.
7030 * output.h (Output_segment::set_minimum_p_align): Don't decrease
7031 min_p_align.
7032 * testsuite/script_test_3.t: Set large alignment.
7033 * testsuite/script_test_3.sh: Make sure that at least one LOAD
7034 segment has expected alignment.
7035
9c9c98a5
NC
70362010-04-22 Nick Clifton <nickc@redhat.com>
7037
7038 * po/gold.pot: Updated by the Translation project.
7039 * po/vi.po: Updated Vietnamese translation.
7040
2253bfba
L
70412010-04-22 H.J. Lu <hongjiu.lu@intel.com>
7042
7043 * testsuite/Makefile.am (check_PROGRAMS): Add
7044 icf_virtual_function_folding_test.
7045 * testsuite/Makefile.in: Regenerated.
7046
85fdf906
AH
70472010-04-15 Andrew Haley <aph@redhat.com>
7048
7049 * options.h (merge_exidx_entries): New option.
7050 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
7051 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
7052 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
7053 (Target_arm::merge_exidx_entries): New function.
7054 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
7055 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
7056 to Arm_exidx_fixup constructor.
7057 Add new arg, merge_exidx_entries.
7058 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
7059 Arm_output_section::fix_exidx_coverage.
7060
ce97fa81
ST
70612010-04-18 Sriraman Tallam <tmsriram@google.com>
7062
7063 * icf.cc (get_section_contents): Check for preemptible functions.
7064 Ignore addend when appropriate.
7065 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
7066 section folded.
7067 (add_from_relobj): Check for section folded.
7068 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
7069 * symtab.h (should_add_dynsym_entry): Add new parameter.
7070 * target-reloc.h (scan_relocs): Check for section folded.
7071 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
7072 Check reloc types for function pointers in shared objects.
7073 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
7074 case.
7075 (icf_preemptible_functions_test): New test case.
7076 (icf_string_merge_test): New test case.
7077 * testsuite.Makefile.in: Regenerate.
7078 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
7079 bar_glob. Refactor code.
7080 * testsuite/icf_preemptible_functions_test.cc: New file.
7081 * testsuite/icf_preemptible_functions_test.sh: New file.
7082 * testsuite/icf_string_merge_test.cc: New file.
7083 * testsuite/icf_string_merge_test.sh: New file.
7084 * testsuite/icf_virtual_function_folding_test.cc: New file.
7085 * testsuite/icf_virtual_function_folding_test.sh: New file.
7086
04ceb17c
DK
70872010-04-14 Doug Kwan <dougkwan@google.com>
7088
7089 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
7090 for local symbol recounting if we remove a section due to ICF.
7091 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
7092 there are no regular objects in input.
7093
153e7da4
DK
70942010-04-13 Doug Kwan <dougkwan@google.com>
7095
7096 * arm.cc (Arm_input_section::set_final_data_size): Compute
7097 accurate final data size instead of using current data size.
7098
4dbd9faf
DK
70992010-04-09 Doug Kwan <dougkwan@google.com>
7100
7101 * layout.cc (Layout::choose_output_section): Handle script section
7102 types.
7103 (Layout::make_output_section_for_script): Add section type parameter.
7104 Handle script section types.
7105 * layout.h (Layout::make_output_section_for_script): Add section
7106 type parameter.
7107 * output.cc (Output_section::Output_section): Initialize data member
7108 is_noload_.
7109 (Output_section::do_reset_address_and_file_offset): Do not set address
7110 to 0 if section is a NOLOAD section.
7111 * output.h (Output_section::is_noload): New method.
7112 (Output_section::set_is_noload): Ditto.
7113 (Output_section::is_noload_): New data member.
7114 * script-c.h (Script_section_type): New enum type.
7115 (struct Parser_output_section_header): Add new file section_type.
7116 * script-sections.cc (Sections_element::output_section_name): Add
7117 parameter for returning script section type.
7118 (Output_section_definition::output_section_name): Ditto.
7119 (Output_section_definition::section_type)P; New method.
7120 (Output_section_definiton::script_section_type_name): Ditto.
7121 (Output_section_definition::script_section_type_): New data member.
7122 (Output_section_definition::Output_section_definition): Initialize
7123 data member Output_section_definition::script_section_type_.
7124 (Output_section_definition::create_sections): Pass script section type
7125 to Layout::make_output_section_for_script.
7126 (Output_section_definition::output_section_name): Return script
7127 section type to caller.
7128 (Output_section_definition::set_section_address): Do not advance
7129 dot value and load address if section type is NOLOAD. Set address
7130 of NOLOAD sections regardless of section flags.
7131 (Output_section_definition::print): Print section type if it is
7132 not SCRIPT_SECTION_TYPE_NONE.
7133 (Output_section_definition::section_type): New method.
7134 (Output_section_definition::script_section_type_name): Ditto.
7135 (Script_sections::output_section_name): Add new parameter
7136 PSECTION_TYPE for returning script section type. Pass it to
7137 section elements. Handle discard sections.
7138 (Sort_output_sections::operator()): Handle NOLOAD sections.
7139 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 7140 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
7141 returning script section type.
7142 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
7143 INFO and NOLOAD.
7144 * yyscript.y (union): Add new field SECTION_TYPE.
7145 (COPY, DSECT, INFO, NOLOAD): New tokens.
7146 (opt_address_and_section_type): Change type to output_section_header.
7147 (section_type): New non-terminal
7148 (section_header): Handle section type.
2253bfba 7149 (opt_address_and_section_type): Return section type value.
4dbd9faf 7150
721ea635
L
71512010-04-09 H.J. Lu <hongjiu.lu@intel.com>
7152
7153 * testsuite/plugin_common_test_1.c (foo): Add prototype.
7154 * testsuite/plugin_common_test_2.c (foo): Likewise.
7155
6bf924b0
DK
71562010-04-08 Doug Kwan <dougkwan@google.com>
7157
7158 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
7159 Output_merge_data.
7160 * output.cc (Output_section::add_merge_input_section): Simplify
7161 code and return status of Output_merge_base::add_input_section.
e1df38aa 7162 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
7163 returns true.
7164
24af6f92
DK
71652010-04-07 Doug Kwan <dougkwan@google.com>
7166
7167 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
7168 if section is marked as containing instructions but has no mapping
7169 symbols.
7170 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
7171 correct section index.
7172 (Arm_relobj::find_linked_text_section): Ditto.
7173
00698fc5
CC
71742010-04-07 Cary Coutant <ccoutant@google.com>
7175
7176 * archive.cc (include_member): Destroy Read_symbols_data object before
7177 releasing file.
7178 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
7179 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
7180 (Read_symbols_data::~Read_symbols_data) New destructor.
7181 (Section_relocs::Section_relocs) New constructor.
7182 (Section_relocs::~Section_relocs) New destructor.
7183 (Read_relocs_data::Read_relocs_data) New constructor.
7184 (Read_relocs_data::~Read_relocs_data) New destructor.
7185 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
7186 pointers to NULL after deleting.
7187
7296d933
DK
71882010-04-07 Doug Kwan <dougkwan@google.com>
7189
7190 * arm.cc: Replace "endianity" with "endianness" in comments.
7191 (Arm_exidx_cantunwind): Ditto.
7192 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
7193 (Arm_relobj::merge_flags_and_attributes): New method.
7194 (Arm_relobj::merge_flags_and_attributes_): New data member.
7195 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
7196 (Arm_relobj::scan_sections_for_stubs): Ditto.
7197 (Arm_relobj::do_read_symbols): Check to see if we really want to
7198 merge processor-specific flags and attributes. Exit early if
7199 an object is empty except for section names and the undefined symbol.
7200 (Target_arm::do_finalize_sections): Move check for ELF format to
7201 Arm_relobj::do_read_symbols. Merge processor specific flags and
7202 attributes from a regular object only when we have determined that
7203 it is aapropriate. Do not create an .ARM.attributes section in
7204 output if there is no regular input object.
7205 (Target_arm::merge_processor_specific_flags): Check
7206 --warn-mismatch before printing any error.
7207 (Target_arm::merge_object_attributes): Ditto.
7208 * gold.cc (queue_middle_tasks): Handle the case in which there is
7209 no regular object in input.
7210 * options.cc (General_options::parse_EB): New method.
7211 (General_options::parse_EL): Same.
7212 (General_options::General_options): Initialize endianness_.
7213 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
7214 New options.
7215 (General_options::Endianness): New enum.
7216 (General_options::endianness): New method.
7217 (General_options::endianness_): New data member.
7218 * parameters.cc (Parameters::set_options): Check target endianness.
7219 (Parameters::set_target_once): Ditto.
7220 (Parameters::check_target_endianness): New method.
7221 (parameters_force_valid_target): If either -EL or -EB is specified,
7222 use it to define endianness of default target.
7223 * parameters.h (Parameters::check_target_endianness): New method
7224 declaration.
7225 * target.h (class Target): Change "endianity" to "endianness"
7226 in comments.
7227
efc8d4f2
RW
72282010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7229
7230 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
7231 * configure: Regenerate.
7232 * Makefile.in: Regenerate.
7233 * testsuite/Makefile.in: Regenerate.
7234
be234d88
CC
72352010-04-06 Cary Coutant <ccoutant@google.com>
7236
7237 gcc PR lto/42757
7238 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
7239 prevailing definitions of common symbols.
7240 * testsuite/plugin_test_6.sh: New test case.
7241 * testsuite/plugin_common_test_1.c: New test case.
7242 * testsuite/plugin_common_test_2.c: New test case.
7243 * testsuite/Makefile.am (plugin_test_6): New test case.
7244 * testsuite/Makefile.in: Regenerate.
7245
bd32c6bd
NC
72462010-04-06 Nick Clifton <nickc@redhat.com>
7247
7248 * po/vi.po: New Vietnamese translation.
7249
323c532f
DK
72502010-03-30 Doug Kwan <dougkwan@google.com>
7251
7252 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
7253
4fcd97eb
DK
72542010-03-25 Doug Kwan <dougkwan@google.com>
7255
7256 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
7257 to avoid a conversion warning on a 32-bit host.
7258
4ebf39db
ILT
72592010-03-24 Ian Lance Taylor <iant@google.com>
7260
7261 * testsuite/script_test_3.t: Add a TLS segment.
7262 * testsuite/Makefile.am (check_PROGRAMS): Add
7263 tls_phdrs_script_test.
7264 (tls_phdrs_script_test_SOURCES): Define.
7265 (tls_phdrs_script_test_DEPENDENCIES): Define.
7266 (tls_phdrs_script_test_LDFLAGS): Define.
7267 (tls_phdrs_script_test_LDADD): Define.
7268 * testsuite/Makefile.in: Rebuild.
7269
4a599bdd
CC
72702010-03-23 Cary Coutant <ccoutant@google.com>
7271
7272 * fileread.cc (find_or_make_view): Fix comment.
7273
6c93b22c
ILT
72742010-03-23 Ian Lance Taylor <iant@google.com>
7275
7276 * script-sections.cc (class Orphan_section_placement): Define
7277 PLACE_TLS and PLACE_TLS_BSS.
7278 (Orphan_section_placement::Orphan_section_placement): Initialize
7279 new places.
7280 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
7281 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
7282 (tls_script_test_SOURCES): Define.
7283 (tls_script_test_DEPENDENCIES): Define.
7284 (tls_script_test_LDFLAGS): Define.
7285 (tls_script_test_LDADD): Define.
7286 * testsuite/Makefile.in: Rebuild.
7287
a2c7281b
DK
72882010-03-22 Doug Kwan <dougkwan@google.com>
7289
7290 * arm.cc (Arm_relocate_functions::abs8,
7291 Arm_relocate_functions::abs16): Use correct check for overflow
7292 specified in the ARM ELF specs.
7293 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
7294 target of a BLX instruction specially.
7295 (Reloc_stub::stub_type_for_reloc): Ditto.
7296 (Relocate::relocate): Use symbolic names instead of numeric relocation
7297 codes to report error.
7298 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
7299 workaround.
7300 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
7301 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
7302 thumb2_blx_out_of_range.stdout
7303 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
7304 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
7305 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
7306 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
7307 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
7308 thumb2_blx_in_range, thumb2_blx_in_range.o,
7309 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
7310 thumb2_blx_out_of_range.o): New rules.
2e702c99 7311 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
7312 thumb2_blx_in_range and thumb2_blx_out_of_range.
7313 * testsuite/Makefile.in: Regenerate.
7314 * arm_branch_in_range.sh: Add tests for THUMB BLX.
7315 * testsuite/thumb_blx_in_range.s: New file.
7316 * testsuite/thumb_blx_out_of_range.s: New file.
7317
b0193076
RÁE
73182010-03-22 Rafael Espindola <espindola@google.com>
7319
7320 * archive.cc (Should_include): Move to archive.h.
7321 (should_include_member): Make it a member of Archive.
7322 (Lib_group): New.
7323 (Add_lib_group_symbols): New.
7324 * archive.h: Include options.h.
7325 (Archive_member): Moved from Archive.
7326 (Should_include): Moved from archive.cc.
7327 (Lib_group): New.
7328 (Add_lib_group_symbols): New.
7329 * dynobj.cc (do_should_include_member): New.
7330 * dynobj.h (do_should_include_member): New.
7331 * gold.cc (queue_initial_tasks): Update call to queue.
7332 * main.cc (main): Print lib group stats.
7333 * object.cc (do_should_include_member): New.
7334 * object.h: Include archive.h.
7335 (Object::should_include_member): New.
7336 (Object::do_should_include_member): New.
7337 (Sized_relobj::do_should_include_member): New.
7338 * options.cc (General_options::parse_start_lib): New.
7339 (General_options::parse_end_lib): New.
7340 (Input_arguments::add_file): Handle lib groups.
7341 (Input_arguments::start_group): Check we are not in a lib.
7342 (Input_arguments::start_lib): New.
7343 (Input_arguments::end_lib): New.
7344 * options.h (General_options): Add start_lib and end_lib.
7345 (Input_argument::lib_): New.
7346 (Input_argument::lib): New.
7347 (Input_argument::is_lib): New.
7348 (Input_file_lib): New.
7349 (Input_arguments::in_lib_): New.
7350 (Input_arguments::in_lib): New.
7351 (Input_arguments::start_lib): New.
7352 (Input_arguments::end_lib_): New.
7353 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
7354 in unused members as preempted.
7355 (Sized_pluginobj::do_should_include_member): New.
7356 * plugin.h (Sized_pluginobj::do_should_include_member): New.
7357 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
7358 return the blocker.
7359 (Read_symbols::do_whole_lib_group): New.
7360 (Read_symbols::do_lib_group): New.
7361 (Read_symbols::do_read_symbols): Handle lib groups.
7362 (Read_symbols::get_name): Handle lib groups.
7363 * readsyms.h (Read_symbols): Add an archive member pointer.
7364 (Read_symbols::do_whole_lib_group): New.
7365 (Read_symbols::do_lib_group): New.
7366 (Read_symbols::member_): New.
7367 * script.cc (read_input_script): Update call to queue_soon.
7368
d099120c
DK
73692010-03-19 Doug Kwan <dougkwan@google.com>
7370
7371 * arm.cc (Stub_table::Stub_table): Initialize new data members
7372 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
7373 (Stub_table::add_reloc_stub): Assign stub offset and update
7374 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
7375 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
7376 New data members.
2e702c99 7377 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
7378 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
7379 instead of going over all reloc stubs.
2e702c99 7380 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
7381 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
7382 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 7383 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
7384 Stringpool_template::offset_.
7385 * stringpool.h (Stringpool_template::set_no_zero_null): Set
7386 Stringpool_template::offset_ to zero.
7387
1aa37384
DK
73882010-03-15 Doug Kwan <dougkwan@google.com>
7389
7390 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
7391 offset_.
7392 (Stringpool_template::new_key_offset): New method.
7393 (Stringpool_template::add_string): Assign offsets when adding new
7394 strings.
7395 (Stringpool_template::set_string_offsets): Do not set string offsets
7396 when not optimizing.
7397 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
7398 member size_.
2e702c99
RM
7399 (Chunked_vector::clear): Clear size_.
7400 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
7401 (Chunked_vector::size): Return size_.
7402 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 7403 (Chunked_vector::size_): New data member.
1aa37384
DK
7404 (Stringpool_template::set_no_zero_null): Assert string set is empty.
7405 (Stringpool_template::new_key_offset): New method declaration.
7406 (Stringpool_template::offset_): New data member.
7407
b672b057
RÁE
74082010-03-15 Rafael Espindola <espindola@google.com>
7409
7410 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
7411 Add_symbols' constructor.
7412 * readsyms.h (Add_symbols): Remove the input_group member.
7413
b6848d3c
ILT
74142010-03-10 Ian Lance Taylor <iant@google.com>
7415
7416 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
7417 target to ask whether a reference to a symbol requires a stack
7418 split.
7419 * target.h (Target::is_call_to_non_split): New function.
7420 (Target::do_is_call_to_non_split): Declare virtual function.
7421 * target.cc: Include "symtab.h".
7422 (Target::do_is_call_to_non_split): New function.
7423 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
7424
a2a5469e
CC
74252010-03-10 Cary Coutant <ccoutant@google.com>
7426
7427 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
7428 (File_read::open[1]): Remove initial mapping of whole_file_view_.
7429 (File_read::open[2]): Add whole_file_view_ to list of views.
7430 (File_read::make_view): Remove test of whole_file_view_.
7431 (File_read::find_or_make_view): Create whole_file_view_ if
7432 necessary.
7433 (File_read::clear_views): Replace bool parameter with enum;
7434 adjust all callers. Don't delete views with permanent data;
7435 do delete cached views and views from archives if
7436 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
7437 if clearing the corresponding view.
7438 * fileread.h (File_read::Clear_views_mode): New enum.
7439 (File_read::View::is_permanent_view): New method.
7440 (File_read::clear_views): Replace bool parameter
7441 with enum; adjust all callers.
7442 * options.h (General_options): Change keep_files_mapped option;
7443 add map_whole_files.
7444 * readsyms.cc (Add_symbols::run): Delete sd_ object before
7445 releasing the file.
7446 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
7447 the file.
7448
8861f32b
DM
74492010-03-10 David S. Miller <davem@davemloft.net>
7450
7451 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
7452
d62d0f5f
ST
74532010-03-09 Sriraman Tallam <tmsriram@google.com>
7454
7455 * icf.cc (get_section_contents): Add '@' marker after processing the
7456 merge reloc.
7457
9177756d
DK
74582010-03-08 Doug Kwan <dougkwan@google.com>
7459
7460 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
7461 due to a conversion warning.
7462 (Arm_relobj::update_output_local_symbol_count): Check for local
7463 symbol with unset output index.
7464
9e9e071b
ILT
74652010-03-05 Ian Lance Taylor <iant@google.com>
7466
7467 * options.h (class General_options): Add --spare-dynamic-tags.
7468 * output.cc (Output_data_dynamic::set_final_data_size): Implement
7469 --spare-dynamic-tags.
7470
a81ee015
ILT
74712010-03-05 Ian Lance Taylor <iant@google.com>
7472
7473 * incremental.cc: Include "libiberty.h".
7474
44ec90b9
RO
74752010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
7476
7477 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
7478 function, is_info_ member.
7479 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
7480 (Versions::Versions): Update caller.
7481 (Versions::define_base_version): Likewise.
7482 (Versions::add_def): Likewise.
7483
0897ed3b
ST
74842010-03-03 Sriraman Tallam <tmsriram@google.com>
7485
7486 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
7487 (Scan::possible_function_pointer_reloc): New function.
7488 (Scan::local_reloc_may_be_function_pointer): Change to call
7489 possible_function_pointer_reloc.
7490 (Scan::global_reloc_may_be_function_pointer): Ditto.
7491 * icf.h (Icf::check_section_for_function_pointers): Change to reject
7492 relocations in ".data.rel.ro._ZTV" section.
7493 * testsuite/icf_safe_so_test.sh: Change to pass i386.
7494 * testsuite/icf_safe_so_test.cc: Ditto.
7495 * testsuite/icf_safe_test.cc: Ditto.
7496 * testsuite/icf_safe_test.sh: Ditto.
7497
d3bbad62
ILT
74982010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7499 Ian Lance Taylor <iant@google.com>
7500
7501 * target-reloc.h (relocate_section): Check the symbol table index
7502 for -1U before setting the local symbol index.
7503 (scan_relocatable_relocs): If copying the relocation, record that
7504 the local symbol is required.
7505 * object.h (Symbol_value::is_output_symtab_index_set): New
7506 function.
7507 (Symbol_value::may_be_discarded_from_output_symtab): New
7508 function.
7509 (Symbol_value::has_output_symtab_entry): New function.
7510 (Symbol_value::needs_output_symtab_entry): Remove.
7511 (Symbol_value::output_symtab_index): Make sure the symbol index is
7512 set.
7513 (Symbol_value::set_output_symtab_index): Make sure the symbol
7514 index is not set. Make sure the new index is valid.
7515 (Symbol_value::set_must_have_output_symtab_entry): New function.
7516 (Symbol_value::has_output_dynsym_entry): New function.
7517 (Symbol_value::set_output_dynsym_index): Make sure the new index
7518 is valid.
7519 (Sized_relobj::set_must_have_output_symtab_entry): New function.
7520 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
7521 local symbol if permitted.
7522 (Sized_relobj::do_finalize_local_symbols): Call
7523 is_output_symtab_index_set rather than needs_output_symtab_entry.
7524 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
7525 rather than needs_output_symtab_entry. Call
7526 has_output_dynsym_entry rather than needs_output_dynsym_entry.
7527 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
7528 is_output_symtab_index_set rather than needs_output_symtab_entry.
7529 * testsuite/discard_locals_relocatable_test.c: New file.
7530 * testsuite/discard_locals_test.sh: Test -r.
7531 * testsuite/Makefile.am (check_DATA): Add
7532 discard_locals_relocatable_test1.syms,
7533 discard_local_relocatable_test2.syms.
7534 (MOSTLYCLEANFILES): Likewise. Also add
7535 discard_locals_relocatable_test1.lout and
7536 discard_locals_relocatable_test2.out.
7537 (discard_locals_relocatable_test1.syms): New target.
7538 (discard_locals_relocatable_test.o): New target.
7539 (discard_locals_relocatable_test1.out): New target.
7540 (discard_locals_relocatable_test2.syms): New target.
7541 (discard_locals_relocatable_test2.out): New target.
7542 (various): Add missing ../ld-new dependencies.
7543 * testsuite/Makefile.in: Rebuild.
7544
7e8ccf26
NC
75452010-03-03 Nick Clifton <nickc@redhat.com>
7546
7547 * po/fi.po: New Finnish translation.
7548
2a0ff005
DK
75492010-03-01 Doug Kwan <dougkwan@google.com>
7550
7551 * layout.cc (Layout::Layout): Force section types of .init_array*,
7552 .preinit_array* and .fini_array* sections.
7553 * output.cc (Output_section::Input_section_sort_entry::has_priority):
7554 Fix check of return value of std::string::find.().
7555 (Output_section::Input_section_sort_compare::operator()): Remove
7556 comment about .init_array.
7557 (Output_section::Input_section_sort_init_fini_compare::operator()):
7558 New method.
7559 (Output_section::sort_attached_input_sections): Handle .init_array
7560 and .fini_array specially.
7561 * output.h (Output_section::Inut_section_sort_compare): Update
7562 comment.
7563 (Output_section::Input_section_sort_init_fini_compare): New struct.
7564
c3e4ae29
DK
75652010-02-26 Doug Kwan <dougkwan@google.com>
7566
7567 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
7568 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
7569 * testsuite/debug_msg.sh: Avoid matching source line number for
7570 use of global variable undef_int.
7571
2fd9ae7a
DK
75722010-02-26 Doug Kwan <dougkwan@google.com>
7573
7574 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
7575 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
7576 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
7577 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
7578 * options.cc (General_options::General_options): Initialize member
7579 fix_v4bx_.
7580 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
7581 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
7582 and rm_no_fix_v4bx.stdout
7583 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
7584 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
7585 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
7586 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
7587 and arm_no_fix_v4bx.
7588 * Makefile.in: Regenerate.
7589 * testsuite/arm_fix_v4bx.s: New file.
7590 * testsuite/arm_fix_v4bx.sh: Ditto.
7591
67ec7d0b
DK
75922010-02-24 Doug Kwan <dougkwan@google.com>
7593
7594 * arm.cc (Target_arm::got_section): Make the .got section the first
7595 non RELRO section in the data segment.
7596 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
7597 suffixes of section names.
7598
10165461
DK
75992010-02-24 Doug Kwan <dougkwan@google.com>
7600
7601 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
7602 flags and attributes merging if an input file is a binary file.
7603 * fileread.cc (Input_file::open): Record format of original file.
7604 * fileread.h (Input_file::Format): New enum type.
2e702c99 7605 (Input_file::Input_file): Initialize data member format_.
10165461
DK
7606 (Input_file::format): New method definition.
7607 (Input_file::format_):: New data member.
7608
4a54abbb
DK
76092010-02-24 Doug Kwan <dougkwan@google.com>
7610
7611 * arm.cc (Arm_output_data_got): New class.
7612 (ARM_TCB_SIZE): New constant
7613 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
7614 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
7615 If user uses a script with a SECTIONS clause, issue only a warning
7616 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 7617 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
7618 garbage collection.
7619 (Target_arm::got_mode_index_entry): Handle static linking.
7620 (Target_arm::Scan::local): Ditto.
7621 (Target_arm::Scan::global): Ditto.
7622 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
7623 all incorrectly implemented relocations.
e1df38aa 7624 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
7625 Arm_output_section::fix_exidx_coverage.
7626 * layout.cc (Layout::section_name_mapping): Remove trailing dots
7627 from ".ARM.exidx." and ".ARM.extab.".
7628
ca419a6f
ILT
76292010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7630
7631 * arm.cc (Target_arm::do_finalize_sections): Create attribute
7632 section if it does not already exist.
7633 * attributes.cc (Attributes_section_data::Attributes_section_data):
7634 Don't crash if size is zero.
7635
135b9c78
ILT
76362010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7637 Ian Lance Taylor <iant@google.com>
7638
7639 * gold.cc (queue_middle_tasks): If no input files were opened,
7640 exit.
7641 * workqueue.h (Task_function::Task_function): Assert that there is
7642 a blocker.
7643
bb0bfe4f
DK
76442010-02-22 Doug Kwan <dougkwan@google.com>
7645
7646 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
7647 * icf.cc (get_section_contents): Cast snprintf arguments to long long
7648 types to avoid warnings due to different uint64_t implementations
7649 on different hosts.
7650
2a2b6d42
DK
76512010-02-21 Doug Kwan <dougkwan@google.com>
7652
7653 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
7654 handling of the maximum backward branch offset.
2e702c99 7655 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
7656 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
7657 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 7658 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
7659 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
7660 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
7661 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
7662 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
7663 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
7664 thumb_bl_out_of_range thumb_bl_out_of_range.o,
7665 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
7666 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
7667 thumb2_bl_out_of_range.o): New rules.
7668 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
7669 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
7670 thumb2_bl_out_of_range
7671 * testsuite/Makefile.in: Regenerate.
7672 * testsuite/arm_bl_in_range.s: New file.
7673 * testsuite/arm_bl_out_of_range.s: Ditto.
7674 * testsuite/arm_branch_in_range.sh: Ditto.
7675 * testsuite/arm_branch_range.t: Ditto.
7676 * testsuite/thumb2_branch_range.t: Ditto.
7677 * testsuite/thumb_bl_in_range.s: Ditto.
7678 * testsuite/thumb_bl_out_of_range.s: Ditto.
7679 * testsuite/thumb_branch_range.t: Ditto.
7680
b487ad64
ST
76812010-02-20 Sriraman Tallam <tmsriram@google.com>
7682
7683 * gc.h (gc_process_relocs): Change vectors to point to the new list.
7684 Add reloc offset information.
7685 * icf.cc (get_section_contents): Change iterators to point to the new
7686 vectors. Add reloc offset information to the contents.
7687 * icf.h (Icf::Sections_reachable_info): New typedef.
7688 (Icf::Sections_reachable_list): New typedef.
7689 (Icf::Offset_info): New typedef.
7690 (Icf::Reloc_info): New struct typedef.
7691 (Icf::Reloc_info_list): New typedef.
7692 (Icf::symbol_reloc_list): Delete method.
7693 (Icf::addend_reloc_list): Delete method.
7694 (Icf::section_reloc_list): Delete method.
7695 (Icf::reloc_info_list): New method.
7696 (Icf::reloc_info_list_): New member.
7697
f96accdf
DK
76982010-02-19 Doug Kwan <dougkwan@google.com>
7699
7700 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
7701 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
7702 * arm.cc (Arm_relocation_functions): New forward declaration.
7703 (Target_arm::Target_arm): Initialize new data members
7704 got_mod_index_offset_ and tls_base_symbol_defined_.
7705 (Target_arm::Relocate::relocate_tls): New method.
7706 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
7707 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
7708 New methods.
2e702c99 7709 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
7710 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
7711 (Target_arm::got_mod_index_offset_,
7712 Target_arm::tls_base_symbol_defined_): New data members.
7713 (Target_arm::Scan::local, Target::Scan::global,
7714 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
7715 relocations.
7716
c8761b9a
DK
77172010-02-18 Doug Kwan <dougkwan@google.com>
7718
7719 * arm.cc (Arm_relobj::find_linked_text_section): New method.
7720 (Arm_relobj::make_exidx_input_section): Pass section index of linked
7721 text section as a parameter becuase some broken tools may not set
7722 the link in section header.
7723 (Target_arm::has_got_section): New method.
7724 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
7725 without any mapping symbol as data only. Remove warning.
7726 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
7727 link in its section header, try to discover the link by inspecting the
7728 REL31 relocation at the beginning of the section.
7729 (Target_arm::Scan::check_non_pic): Report name of offending relocation
7730 in error message.
7731 (Target_arm::Scan::global): Treat any reference to the symbol
7732 _GLOBAL_OFFSET_TABLE_ as a GOT access.
7733
21bb3914
ST
77342010-02-12 Sriraman Tallam <tmsriram@google.com>
7735
7736 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
7737 (Scan::global_reloc_may_be_function_pointer): New function.
7738 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
7739 (Scan::global_reloc_may_be_function_pointer): New function.
7740 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
7741 (Scan::global_reloc_may_be_function_pointer): New function.
7742 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
7743 (Scan::global_reloc_may_be_function_pointer): New function.
7744 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
7745 (Scan::global_reloc_may_be_function_pointer): New function.
7746 (Scan::possible_function_pointer_reloc): New function.
7747 (Target_x86_64::can_check_for_function_pointers): New function.
7748 * gc.h (gc_process_relocs): Scan relocation types to determine if
7749 function pointers were taken for targets that support it.
7750 * icf.cc (Icf::find_identical_sections): Include functions for
7751 folding in safe ICF whose pointer is not taken.
7752 * icf.h (Secn_fptr_taken_set): New typedef.
7753 (fptr_section_id_): New member.
7754 (section_has_function_pointers): New function.
7755 (set_section_has_function_pointers): New function.
7756 (check_section_for_function_pointers): New function.
7757 * options.h: Fix comment for safe ICF option.
7758 * target.h (can_check_for_function_pointers): New function.
7759 * testsuite/Makefile.am: Add icf_safe_so_test test case.
7760 Modify icf_safe_test for X86-64.
7761 * testsuite/Makefile.in: Regenerate.
7762 * testsuite/icf_safe_so_test.cc: New file.
7763 * testsuite/icf_safe_so_test.sh: New file.
7764 * testsuite/icf_safe_test.cc (kept_func_3): New function.
7765 (main): Change to take pointer to function kept_func_3.
7766 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
7767 folding is done correctly for X86-64.
7768
0da6fa6c
DM
77692010-02-12 David S. Miller <davem@davemloft.net>
7770
7771 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
7772 is_symbolless parameter.
7773 (Output_reloc<SHT_REL>::is_symbolless): New.
7774 (Output_reloc<SHT_REL>::is_symbolless_): New.
7775 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
7776 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
7777 (Output_reloc<SHT_RELA>::is_symbolless): New.
7778 (Output_data_reloc::add_global): Handle is_symbolless.
7779 (Output_data_reloc::add_global_relative): Likewise.
7780 (Output_data_reloc::add_local): Likewise.
7781 (Output_data_reloc::add_local_relative): Likewise.
7782 (Output_data_reloc::add_symbolless_global_addend): New.
7783 (Output_data_reloc::add_symbolless_local_addend): New.
7784 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
7785 is_symbolless.
7786 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
7787 instead of ->is_relative_
7788 (Output_reloc::write): Likewise.
7789 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
7790 (Output_reloc::write_rel): Simplify.
7791
7792 * sparc.cc (Target_sparc::Scan::local): Use
7793 ->add_symbolless_local_addend as needed.
7794 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
7795 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
7796 based upon relocation offset.
7797
e4782e83
DK
77982010-02-11 Doug Kwan <dougkwan@google.com>
7799
7800 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
7801 (Target_arm::Scan::global): Ditto. Also remove a comment before the
7802 beginning of function.
7803 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
7804 and MOVT_ABS relocations. Those are non issued in scanning. Fix
7805 parameter is_32bit in calls to should_apply_static_reloc.
7806 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
7807 (check_DATA): Add arm_abs_global.stdout.
7808 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
7809 arm_abs_global.stdout): New rules.
7810 (MOSTLLYCLEANFILES): Add arm_abs_global
7811 * Makefile.in: Regenerate.
7812 * testsuite/arm_abs_global.s: New file.
7813 * testsuite/arm_abs_global.sh: Ditto.
7814 * testsuite/arm_abs_lib.s: Ditto.
7815
93ceb764
ILT
78162010-02-11 Ian Lance Taylor <iant@google.com>
7817
7818 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
7819 Read_relocs task.
7820 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
7821 Allocate_commons_task first.
7822 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
7823 task, rather than symtab_lock_.
7824 (Gc_process_relocs::~Gc_process_relocs): New function.
7825 (Gc_process_relocs::is_runnable): Check this_blocker_.
7826 (Gc_process_relocs::locks): Use next_blocker_ rather than
7827 blocker_.
7828 (Scan_relocs::~Scan_relocs): New function.
7829 (Scan_relocs::is_runnable): Check this_blocker_ rather than
7830 symtab_lock_.
7831 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
7832 next_blocker_.
7833 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
7834 fields. Add this_blocker_ and next_blocker_ fields. Adjust
7835 constructor accordingly.
7836 (class Gc_process_relocs): Likewise.
7837 (class Scan_relocs): Likewise.
7838 * common.h (class Allocate_commons_task): Remove symtab_lock_
7839 field, and corresponding constructor parameter.
7840 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
7841 symtab_lock_.
7842 (Allocate_commons_task::locks): Likewise.
7843
114dfbe1
ILT
78442010-02-11 Ian Lance Taylor <iant@google.com>
7845
7846 * gold-threads.h (class Once): Define.
7847 (class Initialize_lock): Rewrite as child of Once.
7848 * gold-threads.cc (class Once_initialize): Define.
7849 (once_pointer_control): New static variable.
7850 (once_pointer, once_arg): New static variables.
7851 (c_run_once): New static function.
7852 (Once::Once, Once::run_once, Once::internal_run): New functions.
7853 (class Initialize_lock_once): Remove.
7854 (initialize_lock_control): Remove.
7855 (initialize_lock_pointer): Remove.
7856 (initialize_lock_once): Remove.
7857 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
7858 (Initialize_lock::initialize): Rewrite.
7859 (Initialize_lock::do_run_once): New function.
7860 * archive.cc (Archive::interpret_header): Only clear name if it is
7861 not already empty.
7862 * fileread.cc: Include "gold-threads.h"
7863 (file_counts_lock): New static variable.
7864 (file_counts_initialize_lock): Likewise.
7865 (File_read::release): Only increment counts when using --stats.
7866 Use a lock around the increment.
7867 * parameters.cc (class Set_parameters_target_once): Define.
7868 (set_parameters_target_once): New static variable.
7869 (Parameters::Parameters): Move here from parameters.h.
7870 (Parameters::set_target): Rewrite.
7871 (Parameters::set_target_once): New function.
7872 (Parameters::clear_target): Move here and rewrite.
7873 * parameters.h (class Parameters): Update declarations. Add
7874 set_parameters_target_once_ field.
7875 (Parameters::Parameters): Move to parameters.cc.
7876 (Parameters::clear_target): Likewise.
7877 * readsyms.cc (Read_symbols::do_group): Create a Start_group
7878 task.
7879 (Start_group::~Start_group): New function.
7880 (Start_group::is_runnable): New function.
7881 (Start_group::locks, Start_group::run): New functions.
7882 (Finish_group::run): Change saw_undefined to size_t.
7883 * readsyms.h (class Start_group): Define.
7884 (class Finish_group): Change saw_undefined_ field to size_t.
7885 (Finish_group::Finish_group): Remove saw_undefined and
7886 this_blocker parameters. Change all callers.
7887 (Finish_group::set_saw_undefined): New function.
7888 (Finish_group::set_blocker): New function.
7889 * symtab.h (class Symbol_table): Change saw_undefined to return
7890 size_t. Change saw_undefined_ field to size_t.
7891 * target-select.cc (Set_target_once::do_run_once): New function.
7892 (Target_selector::Target_selector): Initialize set_target_once_
7893 field. Don't initialize lock_ and initialize_lock_ fields.
7894 (Target_selector::instantiate_target): Rewrite.
7895 (Target_selector::set_target): New function.
7896 * target-select.h (class Set_target_once): Define.
7897 (class Target_selector): Update declarations. Make
7898 Set_target_once a friend. Remove lock_ and initialize_lock_
7899 fields. Add set_target_once_ field.
7900
fa17a3f4
ILT
79012010-02-10 Ian Lance Taylor <iant@google.com>
7902
7903 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
7904 queueing any tasks.
7905 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
7906 (queue_middle_tasks): Add all blockers before queueing any tasks.
7907 (queue_final_tasks): Likewise.
7908 * token.h (Task_token::add_blockers): New function.
7909 * object.h (Input_objects::number_of_relobjs): New function.
7910
c7177d31
ILT
79112010-02-10 Ian Lance Taylor <iant@google.com>
7912
5de0e392
ILT
7913 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
7914 shared, not if not position independent.
7915 * x86_64.cc (Relocate::relocate_tls): Likewise.
7916 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
7917 (tls_pie_pic_test): New target.
7918 * testsuite/Makefile.in: Rebuild.
7919
c7177d31
ILT
7920 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
7921 (tls_test_main_pie.o, tls_test_pie.o): New targets.
7922 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
7923 * testsuite/Makefile.in: Rebuild.
7924
684b268a
DM
79252010-02-09 David S. Miller <davem@davemloft.net>
7926
7927 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
7928 R_SPARC_RELATIVE using ->add_local_relative().
7929 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
7930
612a8d3d
DM
7931 * output.h (Output_data_dynamic::add_section_size): New method
7932 that takes two Output_data objects.
7933 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
7934 entry param. Handle it in initializers.
7935 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
7936 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
7937 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
7938 arg.
7939 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
7940 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
7941 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
7942 for dynrel_includes_plt.
7943 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7944 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7945 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
7946 before .rela.plt
7947 (Target_sparc::do_finalize_sections): Update to pass true for
7948 dynrel_includes_plt.
7949 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
7950 output before .rela.plt
7951 (Target_powerpc::do_finalize_sections): Update to pass true for
7952 dynrel_includes_plt when 32-bit.
7953
cb1be87e
DK
79542010-02-08 Doug Kwan <dougkwan@google.com>
7955
7956 * arm.cc (Arm_relobj::simple_input_section_output_address): New
7957 method.
7958 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
7959 Arm_relobj::scan_section_for_cortex_a8_stubs,
7960 Arm_relobj::do_relocation_section): Instead of calling
7961 Output_section::output_address, use faster
7962 Arm_relobj::simple_input_section_output_address.
7963
705b5121
DM
79642010-02-08 David S. Miller <davem@davemloft.net>
7965
7966 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
7967 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
7968 relocation helper function.
7969
024c4466
DM
7970 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
7971 just like R_SPARC_GOT{10,13,22}.
7972 (Target_sparc::Scan::local): Likewise.
7973 (Target_sparc::Relocate:relocate): Likewise.
7974
9109c078
ILT
79752010-02-06 Ian Lance Taylor <iant@google.com>
7976
7977 * configure.ac: Rewrite targetobjs duplicate removal code to use
7978 only shell constructs.
7979 * configure: Rebuild.
7980
cf846138
DK
79812010-02-05 Doug Kwan <dougkwan@google.com>
7982
7983 PR 11247
7984 * arm.cc (Arm_relobj::section_is_scannable): New method.
7985 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
7986 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
7987
6cfaf60b
DK
79882010-02-04 Doug Kwan <dougkwan@google.com>
7989
7990 PR 11247
7991 * arm-reloc-property.cc (cstdio): Include.
7992 * configure.ac (targetobjs): Remove duplicates.
7993 * configure: Regenerate.
7994 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
7995 big and little endian version for a given address size.
7996
5c57f1be
DK
79972010-02-03 Doug Kwan <dougkwan@google.com>
7998
7999 * arm-reloc-property.cc
8000 (Arm_reloc_property_table::reloc_name_in_error_message): New method
8001 definition.
8002 * arm-reloc-property.h
8003 (Arm_reloc_property_table::get_implemented_static_reloc_property):
8004 New method definition.
8005 (Arm_reloc_property_table::reloc_name_in_error_message): New method
8006 declaration.
8007 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
8008 overflow to N.
8009 (GOT_PREL): Change implemented to Y.
8010 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
8011 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
8012 (Arm_relocate_functions::movw_abs_nc): Remove method.
8013 (Arm_relocate_functions::movt_abs): Ditto.
8014 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
8015 (Arm_relocate_functions::thm_movt_abs): Ditto.
8016 (Arm_relocate_functions::movw_rel_nc): Ditto.
8017 (Arm_relocate_functions::movw_rel): Ditto.
8018 (Arm_relocate_functions::movt_rel): Ditto.
8019 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
8020 (Arm_relocate_functions:thm_movw_rel): Ditto.
8021 (Arm_relocate_functions:thm_movt_rel): Ditto.
8022 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
8023 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
8024 New method definitions.
8025 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
8026 (Arm_relocation_functions::arm_grp_ldr): Ditto.
8027 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
8028 (Arm_relocation_functions::arm_grp_ldc): Ditto.
8029 (Target_arm::Relocate::relocate): Check for non-static or
8030 unimplemented relocation code and exit early. Change calls to
8031 Target_arm::reloc_uses_thumb_bit and
8032 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
8033 instead. Refactor code to handle similar relocations to increase
8034 code sharing. Remove check for unsupported relocation code in switch
8035 statement.
8036 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
8037 relocation property table to find out size. Change error message to
8038 print out the name of a relocation code instead of the numeric value.
8039 (Target_arm::scan_reloc_for_stub): Use relocation property table
8040 instead of calling Target_arm::reloc_uses_thumb_bit().
8041
218c5831
DK
80422010-02-02 Doug Kwan <dougkwan@google.com>
8043
8044 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
8045 types of relaxed input section.
8046
0d31c79d
DK
80472010-02-02 Doug Kwan <dougkwan@google.com>
8048
8049 * Makefile.am (HFILES): Add arm-reloc-property.h.
8050 (DEFFILES): New.
2e702c99
RM
8051 (TARGETSOURCES): Add arm-reloc-property.cc
8052 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
8053 (libgold_a_SOURCES): $(DEFFILES)
8054 * Makefile.in: Regenerate.
8055 * arm-reloc-property.cc: New file.
8056 * arm-reloc-property.h: New file.
8057 * arm-reloc.def: New file.
8058 * arm.cc: Update comments.
8059 (arm-reloc-property.h): New included header.
8060 (arm_reloc_property_table): New global variable.
8061 (Target_arm::do_select_as_default_target): New method definition.
8062 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
8063 arm-reloc-property to targ_extra_obj.
8064 * parameters.cc (set_parameters_target): Call
8065 Target::select_as_default_target().
8066 * target.h (Target::select_as_default_target): New method definition.
8067 (Target::do_select_as_default_target): Same.
8068
546c7457
DK
80692010-02-01 Doug Kwan <dougkwan@google.com>
8070
8071 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
8072 first_output_text_section_.
8073 (Arm_exidx_fixup::first_output_text_section): New method definition.
8074 (Arm_exidx_fixup::first_output_text_section_): New data member.
8075 (Arm_exidx_fixup::process_exidx_section): Record the first text
8076 output section seen.
8077 (Arm_output_section::fix_exidx_coverage): Set correct linked section
8078 and entsize in output section header.
8079
11b861d5
DK
80802010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8081
8082 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
8083 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
8084 (Arm_relocate_functions::thm_alu11): New Method.
8085 (Arm_relocate_functions::thm_pc8): New Method.
8086 (Arm_relocate_functions::thm_pc12): New Method.
8087 (Target_arm::Scan::local): Handle the relocations.
8088 (Target_arm::Scan::global): Likewise.
8089 (Target_arm::Relocate::relocate): Likewise.
8090 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8091
c9a2c125
DK
80922010-01-29 Doug Kwan <dougkwan@google.com>
8093
8094 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
8095 of relocation types as ld.
8096
1521477a
DK
80972010-01-29 Doug Kwan <dougkwan@google.com>
8098
8099 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
8100 to public.
8101 (Arm_relocate_functions::thumb_branch_common): Ditto.
8102 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
8103 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
8104 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
8105 Arm_relocate_functions::jump24): Remove.
8106 (Target_arm::Relocate::relocate): Adjust code to call
8107 Arm_relocation_functions::arm_branch_common and
8108 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 8109 wrappers. Merge switch-cases together to reduce source code size.
1521477a 8110
e7eca48c
DK
81112010-01-29 Doug Kwan <dougkwan@google.com>
8112
8113 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
8114 output_local_symbol_count_needs_update_.
8115 (Arm_relobj::output_local_symbol_count_needs_update,
8116 Arm_relobj::set_output_local_symbol_count_needs_update,
8117 Arm_relobj::update_output_local_symbol_count): New methods.
8118 (Arm_relobj::output_local_symbol_count_needs_update_): New data
8119 member.
8120 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
8121 of pointed function as in a R_ARM_PREL31 relocation.
8122 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
8123 for output local symbol count updating.
8124 (Target_arm::do_relax): Update output local symbol counts in objects
8125 if necessary.
8126 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
8127
02961d7e
ILT
81282010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8129
8130 * arm.cc: Added support for the ARM relocations:
8131 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
8132 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
8133 (Arm_relocate_functions::movw_rel_nc): Renamed (was
8134 movw_prel_nc).
8135 (Arm_relocate_functions::movw_rel): New method.
8136 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
8137 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
8138 thm_movw_prel_nc).
8139 (Arm_relocate_functions::thm_movw_rel): New method.
8140 (Arm_relocate_functions::thm_movt_rel): Renamed (was
8141 thm_movt_prel).
8142 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
8143 relocations.
8144 (Target_arm::Scan::global): Likewise.
8145 (Target_arm::Relocate::relocate): Likewise.
8146 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8147 Likewise.
8148
b10d2873
ILT
81492010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8150
8151 * arm.cc: Added support for ARM group relocations.
8152 (Target_arm::reloc_needs_sym_origin): New method.
8153 (Arm_relocate_functions::calc_grp_kn): New method.
8154 (Arm_relocate_functions::calc_grp_residual): New method.
8155 (Arm_relocate_functions::calc_grp_gn): New method.
8156 (Arm_relocate_functions::arm_grp_alu): New Method.
8157 (Arm_relocate_functions::arm_grp_ldr): New Method.
8158 (Arm_relocate_functions::arm_grp_ldrs): New Method.
8159 (Arm_relocate_functions::arm_grp_ldc): New Method.
8160 (Target_arm::Scan::local): Handle the ARM group relocations.
8161 (Target_arm::Scan::global): Likewise.
8162 (Target_arm::Relocate::relocate): Likewise.
8163 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8164 Likewise.
8165
2b328d4e
DK
81662010-01-26 Doug Kwan <dougkwan@google.com>
8167
8168 * arm.cc (set): Include.
8169 (class Arm_exidx_fixup): Change type of last_input_section_ to const
8170 pointer type.
2e702c99 8171 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
8172 (Arm_output_section::append_text_sections_to_list): New method.
8173 (Arm_output_section::fix_exidx_coverage): Ditto.
8174 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 8175 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
8176 Relobj::set_section_offset() instead of
8177 Sized_relobj::invalidate_section_offset().
2e702c99 8178 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
8179 parameter for section headers. Ignore relocation sections for
8180 unallocated sections and EXIDX sections.
8181 (Target_arm::fix_exidx_coverage): New method.
8182 (Target_arm::output_section_address_less_than): New type.
8183 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
8184 linked text section instead of the EXIDX section.
8185 (Arm_output_section::create_stub_group): Add an assertion to check
8186 that this is not an EXIDX output section.
8187 (Arm_output_section::append_text_sections_to_list): New method.
8188 (Arm_output_section::fix_exidx_coverage): Ditto.
8189 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 8190 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
8191 (Target_arm::do_relax): Fix EXIDX output section coverage in the
8192 first pass.
8193 (Target_arm::fix_exidx_coverage): New method.
8194 * object.h (Relobj::set_output_section): New method.
8195 (Sized_relobj::invalidate_section_offset): Remove method.
8196 (Sized_relobj::do_invalidate_section_offset): Remove method.
8197 (Sized_relobj::do_set_section_offset): Handle offset value -1.
8198
c7f3c371
DK
81992010-01-25 Doug Kwan <dougkwan@google.com>
8200
8201 * arm.cc (Arm_exidx_merged_section::do_output_offset):
8202 Fix warning due to signed and unsigned comparison on a 32-bit host.
8203
8923b24c
DK
82042010-01-22 Doug Kwan <dougkwan@google.com>
8205
8206 * arm.cc (Target_arm::do_relax): Record an output section for section
8207 offset adjustment it contains any stub table that has changed.
8208 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
8209 offsets in an output section if necessary.
8210 * output.cc (Output_section::Output_section): Initialize
8211 section_offsets_need_adjustments_.
8212 (Output_section::add_input_section_for_script): Renamed to
8213 Output_section::add_simple_input_section.
8214 (Output_section::save_states): Add a comment.
8215 (Output_section::discard_states): New method defintion.
8216 (Output_section::adjust_section_offsets): Same.
8217 * output.h (Output_section::add_input_section_for_script): Renamed to
8218 Output_section::add_simple_input_section.
8219 (Output_section::discard_states): New method declaration.
8220 (Output_section::adjust_section_offsets): Same.
8221 (Output_section::section_offsets_need_adjustment,
8222 Output_section::set_section_offsets_need_adjustment): New method
8223 definitions.
8224 (Output_section::section_offsets_need_adjustment_): New data member.
8225 * script-sections.cc
8226 (Output_section_element_input::set_section_address): Adjust code for
8227 renaming of Output_section::add_input_section_for_script.
8228 (Orphan_output_section::set_section_address): Same.
8229
9b2fd367
DK
82302010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8231
8232 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
8233 Fix_v4bx enum values .
8234 * gold/options.h (General_options): New option definitions.
8235 (General_options::fix_v4bx): New method.
8236 (General_options::Fix_v4bx): New enum.
8237 * gold/options.cc (General_options::parse_fix_v4bx): New method.
8238 (General_options::parse_fix_v4bx_interworking): New method.
8239
80d0d023
DK
82402010-01-22 Doug Kwan <dougkwan@google.com>
8241
8242 * arm.cc (Arm_exidx_fixup): New class.
8243
af2cdeae
DK
82442010-01-21 Doug Kwan <dougkwan@google.com>
8245
8246 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
8247 classes.
8248 (Arm_exidx_section_offset_map): New type.
8249
993d07c1
DK
82502010-01-21 Doug Kwan <dougkwan@google.com>
8251
8252 * arm.cc (Arm_exidx_input_section): New class.
8253 (Arm_relobj::exidx_input_section_by_link,
8254 Arm_relobj::exidx_input_section_by_shndx,
8255 Arm_relobj::make_exidx_input_section): New methods.
8256 (read_arm_attributes_section): Remove.
8257 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
8258 information about them.
8259 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
8260 to here.
8261
5ac169d4
DK
82622010-01-20 Doug Kwan <dougkwan@google.com>
8263
8264 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
8265 Input_section_specifier to Section_id.
8266 (Target_arm::new_arm_input_section: Adjust code for change of key
8267 type.
8268 (Target_arm::find_arm_input_section): Ditto.
8269 * gc.h (object.h): Include for Section_id nand Section_id_hash.
8270 (Section_id): Remove.
8271 (Garbage_collection::Section_id_hash): Remove.
8272 * icf.h (object.h): Include for Section_id nand Section_id_hash.
8273 (Section_id): Remove.
8274 (Icf::Section_id_hash): Remove.
8275 * object.h (Section_id, Const_section_id, Section_id_hash,
8276 Const_section_id_hash): New type definitions.
8277 * output.cc (Output_section::add_relaxed_input_section): Change to
8278 use Const_section_id instead of Input_section_specifier as key type.
8279 (Output_section::add_merge_input_section): Ditto.
8280 (Output_section::build_relaxation_map): Change to use Section_id
8281 instead of Input_section_specifier as key type.
2e702c99 8282 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
8283 Ditto.
8284 (Output_section::convert_input_sections_to_relaxed_sections): Change
8285 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 8286 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
8287 (Output_section::find_relaxed_input_section): Ditto.
8288 * output.h (Input_section_specifier): Remove class.
8289 (Output_section::Output_section_data_by_input_section_map): Change
8290 key type to Const_section_id.
8291 (Output_section::Output_relaxed_input_section_by_input_section_map):
8292 Ditto.
8293 (Output_section::Relaxation_map): Change key type to Section_id.
8294
a2162063
ILT
82952010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8296
8297 * gold/arm.cc: Added support for R_ARM_V4BX relocation
8298 (class Arm_v4bx_stub): New class.
8299 (DEF_STUBS): Updated definition to support v4_veneer_bx.
8300 (Stub_factory::make_arm_v4bx_stub): New method.
8301 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
8302 (Stub_table::empty): Handle v4bx stubs.
8303 (Stub_table::add_arm_v4bx_stub): New method.
8304 (Stub_table::find_arm_v4bx_stub): New method.
8305 (Arm_relocate_functions::v4bx): New method.
8306 (Target_arm::fix_v4bx): New method.
8307 (Target_arm::Target_arm): Handle R_ARM_V4BX.
8308 (Stub_table::relocate_stubs): Likewise.
8309 (Stub_table::do_write): Likewise.
8310 (Stub_table::update_data_size_and_addralign): Likewise.
8311 (Stub_table::finalize_stubs): Likewise.
8312 (Target_arm::Scan::local): Likewise.
8313 (Target_arm::Scan::global): Likewise.
8314 (Target_arm::do_finalize_sections): Likewise.
8315 (Target_arm::Relocate::relocate): Likewise.
8316 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8317 Likewise.
8318 (Target_arm::scan_reloc_for_stub): Likewise.
8319 (Target_arm::scan_reloc_section_for_stubs): Likewise.
8320
5696ab0b
ILT
83212010-01-19 Ian Lance Taylor <iant@google.com>
8322
8323 * output.cc (Output_section_headers::do_sized_write): Write large
8324 segment count to sh_info field.
8325 (Output_file_header::do_sized_write): For large segment count,
8326 write PN_XNUM to e_phnum field.
8327
800d0f56
ILT
83282010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8329
8330 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
8331 (Arm_relocate_functions::thm_jump8): New function.
8332 (Arm_relocate_functions::thm_jump11): New function.
8333 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
8334 R_ARM_THM_JUMP11.
8335 (Target_arm::Scan::global): Likewise.
8336 (Target_arm::Relocate::relocate): Likewise.
8337 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8338 Likewise.
8339
41263c05
DK
83402010-01-14 Doug Kwan <dougkwan@google.com>
8341
8342 * arm.cc (map, utility): Include headers.
8343 (Target_arm::apply_cortex_a8_workaround): New method.
8344 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
8345 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
8346 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
8347 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
8348 the --[no-]fix-cortex-a8 command line options.
8349 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
8350 (Target_arm::relocate_stub): Use addend in instruction template.
8351 * options.h (DEFINE_bool): Set the user-set flag.
8352 (General_options): Add --[no-]-fix-cortex options.
8353 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 8354 : Update fast look-up map after conversion.
41263c05 8355
459e9b03
ST
83562010-01-14 Sriraman Tallam <tmsriram@google.com>
8357
8358 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
8359 in the first pass of do_layout.
8360
b521dfe4
DK
83612010-01-13 Doug Kwan <dougkwan@google.com>
8362
8363 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
8364 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
8365 apparent compiler problem of not folding static constant integral
8366 data members of elfcpp::Elf_sizes<32>.
8367
44272192
DK
83682010-01-13 Doug Kwan <dougkwan@google.com>
8369
8370 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
8371 Arm_relobj::section_needs_cortex_a8_stub_scanning,
8372 Arm_relobj::scan_section_for_cortex_a8_erratum,
8373 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
8374 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
8375 sections to scan for relocation stubs into a new method
8376 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
8377 relocation and Cortex-A8 stub scanning.
8378 (Target_arm::do_relax): Force stubs to be after stubbed sections
8379 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 8380 the beginning of a new relaxation pass. Update a comment.
44272192
DK
8381 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
8382
44b71ece
ILT
83832010-01-12 Ian Lance Taylor <iant@google.com>
8384
8385 * target-reloc.h (visibility_error): New inline function.
8386 (relocate_section): Call visibility_error.
8387 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
8388 (MOSTLYCLEANFILES): Likewise.
8389 (protected_4_pic.o, protected_3.err): New targets.
8390 * testsuite/protected_4.cc: New file.
8391
a120bc7f
DK
83922010-01-12 Doug Kwan <dougkwan@google.com>
8393
8394 * arm.cc (Cortex_a8_reloc): New class.
8395 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
8396 and cortex_a8_relocs_info_.
8397 (Target_arm::fix_cortex_a8): New method definition.
8398 (Target_arm::Cortex_a8_relocs_info): New type.
8399 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
8400 New data member declarations.
8401 (Target_arm::scan_reloc_for_stub): Record information about
8402 relocations for THUMB branches that might be exempted from the
8403 Cortex-A8 workaround.
8404 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
8405 at the beginning of a relaxation pass.
8406
20138696
DK
84072010-01-12 Doug Kwan <dougkwan@google.com>
8408
8409 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
8410 (Arm_relobj::Mapping_symbol_position,
8411 Arm_reloj::Mapping_symbol_position_less,
8412 Arm_relobj::Mapping_symbols_info): New types.
8413 (Target_arm::is_mapping_symbol_name): New method definition.
8414 (Arm_relobj::do_count_local_symbols): Save information about mapping
8415 symbols.
8416
089d69dc
DK
84172010-01-11 Doug Kwan <dougkwan@google.com>
8418
8419 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
8420 Arm_relocate_functions::thumb32_branch_upper,
8421 Arm_relocate_functions::thumb32_branch_lower,
8422 Arm_relocate_functions::thumb32_cond_branch_offset,
8423 Arm_relocate_functions::thumb32_cond_branch_upper,
8424 Arm_relocate_functions::thumb32_cond_branch_lower,
8425 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
8426 branch offset encoding.
8427 (Arm_relocate_functions::thumb_branch_common): Use new branch
8428 offset encoding methods to avoid code duplication.
8429 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
8430 (Stub_addend_reader::operator()): Use new branch encoding method
8431 to avoid code duplication.
8432
99e5bff2
DK
84332010-01-11 Doug Kwan <dougkwan@google.com>
8434
8435 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
8436 (Target_arm::do_finalize_sections): Define special EXIDX section
8437 symbols only if referenced.
8438 * gc.h (Garbage_collection::add_reference): New method.
8439 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
8440 code duplication.
8441
98e090bd
ILT
84422010-01-11 Ian Lance Taylor <iant@google.com>
8443
d0a91bd8
ILT
8444 * script.cc (Version_script_info::build_expression_list_lookup):
8445 Change complaing about duplicate wildcard match from error to
8446 warning.
8447
98e090bd
ILT
8448 * script.cc (class Lazy_demangler): Recreate--revert part of patch
8449 of 2009-12-30.
8450 (Version_script_info::Version_script_info): Initialize globs_,
8451 default_version_, default_is_global_, and exact_. Don't
8452 initialize globals_ or locals_.
8453 (Version_script_info::build_lookup_tables): Build local symbols
8454 first.
8455 (Version_script_info::unquote): New function.
8456 (Version_script_info::add_exact_match): New function.
8457 (Version_script_info::build_expression_list_lookup): Remove lookup
8458 parameter. Add is_global parameter. Change all callers. Handle
8459 wildcard pattern specially. Unquote pattern. Call
8460 add_exact_match.
8461 (Version_script_info::get_name_to_match): New function.
8462 (Version_script_info::get_symbol_version): New function.
8463 (Version_script_info::get_symbol_version_helper): Remove.
8464 (Version_script_info::check_unmatched_names): Call unquote.
8465 * script.h (class Version_script_info): Change get_symbol_version
8466 to be non-inline and add is_global parameter; change all callers.
8467 Rewrite symbol_is_local. Update declarations. Define struct
8468 Version_tree_match, Exact, Globs. Don't define struct Lookup.
8469 Remove globals_ and locals_ members. Add exact_, globs_,
8470 default_version_, is_global_.
8471 (Version_script_info::Glob): Remove pattern, add expression and
8472 is_global. Update constructor. Change all callers.
8473 * dynobj.cc (Versions::finalize): Mark the version symbol as the
8474 default version.
8475 (Versions::symbol_section_contents): If a symbol is undefined, or
8476 defined in a dynamic object, set the version index to
8477 VER_NDX_LOCAL.
8478 * symtab.cc (Symbol_table::add_from_relobj): Don't call
8479 symbol_is_local.
8480 (Symbol_table::add_from_pluginobj): Likewise.
8481 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
8482
d56962d3
DK
84832010-01-11 Doug Kwan <dougkwan@google.com>
8484
8485 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
8486 (incremental_dump_LDADD): Add linking option for libintl.
8487 * Makefile.in: Regenerate.
8488
94e6ee91
L
84892010-01-11 H.J. Lu <hongjiu.lu@intel.com>
8490
8491 PR gold/11144
8492 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
8493 instead of -Ds.
8494 * testsuite/Makefile.in: Regenerated.
8495
e96c574b
DK
84962010-01-10 Doug Kwan <dougkwan@google.com>
8497
8498 * options.h (DEFINE_var): Use parentheses around argument varname__
8499 in macro body to avoid any unintended subsequent substitutions.
8500
7198066b
ILT
85012010-01-10 Ian Lance Taylor <iant@google.com>
8502
ba4d53bf
ILT
8503 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
8504 candidates before doing symbol resolution.
8505
7198066b
ILT
8506 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
8507 ODR candidates if only one is weak.
8508
a2beed37
ILT
85092010-01-08 Ian Lance Taylor <iant@google.com>
8510
8511 * script.cc (Version_script_info::build_expression_list_lookup):
8512 Don't warn about ambiguous version, just record the ambiguity.
8513 (Version_script_info::get_symbol_version_helper): Give error if
8514 version is ambiguous.
8515
2fb7225c
DK
85162010-01-08 Doug Kwan <dougkwan@google.com>
8517
8518 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
8519 prev_data_size_ and prev_addralign_. Remove initializer for
8520 deleted data member has_been_changed_.
8521 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
8522 to determine if the table is empty.
8523 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
8524 Remove.
8525 (Stub_table::add_reloc_stub): Define method in class definition
8526 instead of just declaring it there.
8527 (Stub_table::add_cortex_a8_stub): New method definition.
8528 (Stub_table::update_data_size_and_addralign): Ditto.
8529 (Stub_table::finalize_stubs): Ditto.
8530 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
8531 (Stub_table::do_addralign_): Return address alignment in the
8532 (Stub_table::do_reset_address_and_file_offset): Define method in
8533 class definition instead of declaring it there. Set current data
8534 size to be the data size of the previous pass.
8535 (Stub_table::set_final_data_size): Use current data size as the
8536 final data size.
8537 (Stub_table::relocate_stub): Change parameter type of stub from
8538 Reloc_stub pointer to Stub pointer.
8539 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
8540 (Stub_table::Cortex_a8_stub_list): New typedef.
8541 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
8542 Stub_table::prev_addralign_): New data member.
8543 (Arm_relobj::Arm_relobj): Initialize data member
8544 section_has_cortex_a8_workaround_.
8545 (Arm_relobj::section_has_cortex_a8_workaround,
8546 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
8547 definitions.
8548 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
8549 declarations.
8550 (Target_arm::relocate_stub): Change parameter type of stub from
8551 Reloc_stub pointer to Stub pointer.
8552 (Insn_template::size, Insn_template::alignment): Handle
8553 THUMB16_SPECIAL_TYPE.
8554 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
8555 Stub_table::update_data_size_and_addralign,
8556 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
8557 definitions.
8558 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
8559 (Stub_table::do_write): Ditto.
8560 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 8561
880cd20d
ILT
85622010-01-08 Ian Lance Taylor <iant@google.com>
8563
8564 PR 11108
8565 * symtab.h (class Symbol): Remove fields is_target_special_ and
8566 has_plt_offset_. Add field is_defined_in_discarded_section_.
8567 (Symbol::is_defined_in_discarded_section): New function.
8568 (Symbol::set_is_defined_in_discarded_section): New function.
8569 (Symbol::has_plt_offset): Rewrite.
8570 (Symbol::set_plt_offset): Verify that new offset is not -1U.
8571 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
8572 Don't initialize is_target_special_ or has_plt_offset_.
8573 Initialize is_defined_in_discarded_section_.
8574 (Symbol_table::add_from_relobj): If appropriate, set
8575 is_defined_in_discarded_section.
8576 * resolve.cc (Symbol::override_base_with_special): Don't test
8577 is_target_special_. Change has_plt_offset_ to has_plt_offset().
8578 * target-reloc.h (relocate_section): Do special handling for
8579 symbols defined in discarded sections for global symbols as well
8580 as local symbols.
8581
2703e3eb
ILT
85822010-01-08 Ian Lance Taylor <iant@google.com>
8583
8584 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
8585 the SHT_SYMTAB case.
8586
339d40a3
ILT
85872010-01-08 Ian Lance Taylor <iant@google.com>
8588
8589 * object.cc (Sized_relobj::do_layout): Don't get confused if
8590 layout_eh_frame returns NULL.
8591
abecea76
ILT
85922010-01-08 Ian Lance Taylor <iant@google.com>
8593
8594 PR 11084
8595 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
8596 dynamic symbol table, use the normal symbol table.
8597 (Sized_dynobj::do_read_symbols): Remove assertion about type of
8598 symbol table.
8599
6b7dd3f3
ILT
86002010-01-08 Ian Lance Taylor <iant@google.com>
8601
8602 PR 11072
8603 * layout.cc (Layout::include_section): Remove .gnu_debuglink
8604 sections.
8605
36c50e63
L
86062010-01-08 H.J. Lu <hongjiu.lu@intel.com>
8607
8608 * version.cc (print_version): Change to "Copyright 2010".
8609
e291e7b9
ILT
86102010-01-08 Ian Lance Taylor <iant@google.com>
8611
8612 PR 10287
8613 PR 11063
8614 * i386.cc (class Target_i386): Change return type of plt_section
8615 to be non-const.
8616 (class Output_data_plt_i386): Add tls_desc_rel_ field.
8617 (Output_data_plt_i386::Output_data_plt_i386): Initialize
8618 tls_desc_rel_ field.
8619 (Output_data_plt_i386::rel_tls_desc): New function.
8620 (Target_i386::rel_tls_desc_section): New function.
8621 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
8622 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
8623 R_386_TLS_DESC reloc in rel_tls_desc_section.
8624 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
8625 Define struct Tlsdesc_info.
8626 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
8627 (Target_x86_64::do_reloc_symbol_index): New function.
8628 (Target_x86_64::add_tlsdesc_info): New function.
8629 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
8630 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
8631 tlsdesc_rel_ field.
8632 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
8633 all callers.
8634 (Output_data_plt_x86_64::rela_tlsdesc): New function.
8635 (Target_x86_64::rela_tlsdesc_section): New function.
8636 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
8637 handling.
8638 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
8639 (Target_x86_64::do_reloc_addend): New function.
8640 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
8641 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
8642 declarations. Define TARGET_CODE. Add arg field to u1_ union.
8643 (Output_reloc::type): New function.
8644 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
8645 (Output_reloc::is_target_specific): New function.
8646 (Output_reloc::target_arg): New function.
8647 (class Output_reloc) [SHT_RELA]: Add four new constructors for
8648 absolute relocs and target specific relocs.
8649 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
8650 add_target_specific.
8651 (class Output_data_reloc) [SHT_RELA]: Likewise.
8652 * output.cc (Output_reloc::Output_reloc): Add four new versions
8653 for absolute relocs and target specific relocs.
8654 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
8655 (Output_reloc::get_symbol_index): Likewise.
8656 (Output_reloc::local_section_offset): Check that local_sym_index_
8657 is not TARGET_CODE or 0.
8658 (Output_reloc::symbol_value): Likewise.
8659 (Output_reloc::write) [SHT_RELA]: Call target for target specific
8660 reloc.
8661 * target.h (class Target): Add reloc_symbol_index and reloc_addend
8662 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
8663 functions.
8664 * layout.cc (add_target_dynamic_tags): Use output section for
8665 DT_PLTRELSZ and DT_JMPREL.
8666
3a44184e
ILT
86672010-01-07 Ian Lance Taylor <iant@google.com>
8668
8669 PR 11061
8670 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
8671 function.
8672 (class Output_data_reloc_generic): Define.
8673 (class Output_data_reloc_base): Change base class to
8674 Output_data_reloc_generic. Change add() method to call
8675 bump_relative_reloc_count for a relative reloc. Remove
8676 sort_relocs_ field.
8677 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
8678 to sort_relocs().
8679 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
8680 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
8681 appropriate.
8682 * layout.h (class Layout): Update declaration.
8683
ea715a34
ILT
86842010-01-07 Ian Lance Taylor <iant@google.com>
8685
8686 * output.h (class Output_data): Add const version of
8687 output_section and do_output_section.
8688 (class Output_section_data): Add const version of
8689 do_output_section.
8690 (class Output_section): Likewise.
8691 * layout.cc (Layout::add_target_dynamic_tags): New function.
8692 * layout.h (class Layout): Update declarations.
8693 * arm.cc (Target_arm::do_finalize_sections): Use
8694 add_target_dynamic_tags.
8695 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8696 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
8697 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
8698 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8699
659948a4
ILT
87002010-01-07 Ian Lance Taylor <iant@google.com>
8701
8702 PR 11042
8703 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
8704 object as needed.
8705
9d3b86f6
ILT
87062010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
8707 Ian Lance Taylor <iant@google.com>
8708
8709 PR 11019
8710 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
8711 Xindex::read_symtab_xindex.
8712
bb0d3eb0
DK
87132010-01-07 Doug Kwan <dougkwan@google.com>
8714
8715 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
8716 (Insn_template::thumb16_bcond_insn): New method declaration.
8717 (Insn_template): Fix spelling.
8718 (Stub::thumb16_special): New method declaration.
8719 (Stub::do_write): Define virtual method which was previously pure
8720 virtual.
8721 (Stub::do_thumb16_special): New method declaration.
8722 (Stub::do_fixed_endian_write): New template member.
8723 (Reloc_stub::do_write): Remove.
8724 (Reloc_stub::do_fixed_endian_write): Remove.
8725 (Cortex_a8_stub): New class definition.
8726 (Stub_factory::make_cortex_a8_stub): New method definition.
8727 (Stub_factory::Stub_factory): Add missing static storage class
8728 qualifier for elf32_arm_stub_a8_veneer_blx.
8729
ffeef7df
ILT
87302010-01-07 Ian Lance Taylor <iant@google.com>
8731
dc3f80fe
ILT
8732 PR 10980
8733 * options.h (class General_options): Add --warn-unresolved-symbols
8734 and --error-unresolved-symbols.
8735 * errors.cc (Errors::undefined_symbol): Implement
8736 --warn-unresolved-symbols.
8737
ffeef7df
ILT
8738 * options.h (class General_options): Add -z text and -z textoff.
8739 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
8740
f1ec9ded
ST
87412010-01-06 Sriraman Tallam <tmsriram@google.com>
8742
8743 * gc.h (Garbage_collection::Cident_section_map): New typedef.
8744 (Garbage_collection::cident_sections): New function.
8745 (Garbage_collection::add_cident_section): New function.
8746 (Garbage_collection::cident_sections_): New member.
8747 (gc_process_relocs): Add references to sections whose names are C
8748 identifiers.
8749 * gold.h (cident_section_start_prefix): New constant.
8750 (cident_section_stop_prefix): New constant.
8751 (is_cident): New function.
8752 * layout.cc (Layout::define_section_symbols): Replace string constants
8753 with the newly defined constants.
8754 * object.cc (Sized_relobj::do_layout): Track sections whose names are
8755 C identifiers.
8756 * testsuite/Makefile.am: Add gc_orphan_section_test.
8757 * testsuite/Makefile.in: Regenerate.
8758 * testsuite/gc_orphan_section_test.cc: New file.
8759 * testsuite/gc_orphan_section_test.sh: New file.
8760
6eda8c29
ILT
87612010-01-06 Ian Lance Taylor <iant@google.com>
8762
b9674e17
ILT
8763 PR 10980
8764 * options.h (class General_options): Add --warn-shared-textrel.
8765 * layout.cc (Layout::finish_dynamic_section): Implement
8766 --warn-shared-textrel.
8767
6eda8c29
ILT
8768 PR 10980
8769 * options.h (class General_options): Add --warn-multiple-gp.
8770
32dcd44e
ILT
87712010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8772
8773 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
8774 $(THREADSLIB) and $(LIBDL).
8775 * Makefile.in: Rebuild.
8776
a192ba05
ILT
87772010-01-06 Ian Lance Taylor <iant@google.com>
8778
8779 PR 10980
8780 * options.cc (General_options::parse_section_start): New function.
8781 (General_options::section_start): New function.
8782 (General_options::General_options): Initialize all members.
8783 * options.h: Include <map>
8784 (class General_options): Add --section-start. Add section_starts_
8785 member.
8786 * layout.cc (Layout::attach_allocated_section_to_segment): If
8787 --section-start was used, set the address of the segment. Remove
8788 local sort_sections.
8789 (Layout::relaxation_loop_body): If the address of the load segment
8790 has been set by --section-start, don't use it.
8791 * output.h (Output_segment::update_flags_for_output_section): New
8792 function.
8793 * output.cc (Output_segment::add_output_section): Call
8794 update_flags_for_output_section.
8795
dde3f402
ILT
87962010-01-05 Ian Lance Taylor <iant@google.com>
8797
62dfdd4d
ILT
8798 PR 10980
8799 * options.h (class General_options): Add --undefined-version.
8800 * script.cc (struct Version_expression): Add was_matched_by_symbol
8801 field.
8802 (Version_script_info::matched_symbol): New function.
8803 (Version_script_info::get_symbol_version_helper): Call
8804 matched_symbol.
8805 (Version_script_info::check_unmatched_names): New function.
8806 * script.h (class Version_script_info): Update declarations.
8807 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
8808
9c4ae156
ILT
8809 * options.h (class General_options): Use DEFINE_bool_alias for
8810 allow_multiple_definition.
8811 * resolve.cc (Symbol_table::should_override): Don't test
8812 allow_multiple_definition.
8813
dde3f402
ILT
8814 PR 10980
8815 * options.h (class General_options): Add --cref.
8816 * main.cc (main): Print cref table if --cref. Don't close mapfile
8817 until after printing cref table.
8818 * cref.cc: Include "symtab.h".
8819 (class Cref_inputs): Define Cref_table_compare and Cref_table.
8820 (Cref_table_compare::operator()): New function.
8821 (Cref_inputs::gather_cref): New function.
8822 (filecol): New static const.
8823 (Cref_inputs::print_cref): New function.
8824 (Cref::print_cref): New function.
8825 * cref.h: Include <cstdio>.
8826 (class Cref): Update declarations.
8827 * mapfile.h (Mapfile::file): New function.
8828 * object.h (class Object): Define Symbols. Declare virtual
8829 do_get_global_symbols.
8830 (Object::get_global_symbols): New function.
8831 * object.cc (Input_objects::add_object): Pass object to cref_ if
8832 --cref.
8833 (Input_objects::archive_start): Likewise.
8834 (Input_objects::archive_stop): Likewise.
8835 (Input_objects::print_cref): New function.
8836 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
8837 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
8838 --cref.
8839 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
8840 function.
8841 * plugin.h (class Sized_pluginobj): Update declarations.
8842
8781f709
ILT
88432010-01-05 Ian Lance Taylor <iant@google.com>
8844
8845 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
8846 to is_default_version. Rename insdef to insdefault.
8847 (Symbol_table::add_from_relobj): Rename def to is_default_version
8848 and local to is_forced_local.
8849 (Symbol_table::add_from_pluginobj): Likewise.
8850 (Symbol_table::add_from_dynobj): Likewise.
8851 (Symbol_table::define_special_symbol): Rename insdef to
8852 insdefault.
8853
fe35d28d
ILT
88542010-01-04 Ian Lance Taylor <iant@google.com>
8855
30bc8c46
ILT
8856 PR 10980
8857 * options.h (class General_options): Add
8858 --allow-multiple-definition and -z muldefs.
8859 * resolve.cc (Symbol_table::should_override): Don't warn about a
8860 multiple symbol definition if --allow-multiple-definition or -z
8861 muldefs.
8862
7eaea549
ILT
8863 PR 10980
8864 * options.h (class General_options): Add --add-needed and
8865 --copy-dt-needed-entries. Tweak --as-needed help entry.
8866 * object.cc (Input_objects::check_dynamic_dependencies): Give an
8867 error if --copy-dt-needed-entries aka --add-needed is used and
8868 would cause a change in behaviour.
8869
fe35d28d
ILT
8870 PR 10980
8871 * options.h (class General_options): Add -G as a short version of
8872 --shared. Add no-op options -assert, -g, and -i.
8873
55a2bb35
ST
88742010-01-04 Sriraman Tallam <tmsriram@google.com>
8875
8876 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
8877 check for .text or .gnu.linkonce.t sections.
8878 * icf.cc (Icf::find_identical_sections): Ditto.
8879 Change the detection for mangled function name within the section
8880 name.
8881 * icf.h (is_section_foldable_candidate): New function.
8882
719328e1
ILT
88832009-12-30 Ian Lance Taylor <iant@google.com>
8884
8885 PR 10980
8886 * options.h (class General_options): Permit two dashes with
8887 --retain-symbols-file.
8888
d7bb5745
ILT
88892009-12-30 Ian Lance Taylor <iant@google.com>
8890
403a15dd
ILT
8891 PR 10979
8892 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
8893 don't put the file header and segment headers in the text
8894 segment.
8895
eda294df
ILT
8896 PR 10979
8897 * common.cc (Sort_commons::operator()): Stabilize sort when both
8898 entries are NULL.
8899 (Symbol_table::do_allocate_commons_list): When allocating common
8900 symbols, skip a symbol which is no longer common.
8901 * symtab.h (Symbol::is_common): Test whether the symbol comes from
8902 an object before checking its type.
8903 * testsuite/common_test_2.c: New file.
8904 * testsuite/common_test_3.c: New file.
8905 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
8906 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
8907 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
8908 (common_test_2_pic.o, common_test_2.so): New targets.
8909 (common_test_3_pic.o, common_test_3.so): New targets.
8910 * testsuite/Makefile.in: Rebuild.
8911
d7bb5745
ILT
8912 PR 10979
8913 * script.cc (read_input_script): If we see a new SECTIONS clause,
8914 and we have added an input section, give an error.
8915 * layout.h (class Layout): Add have_added_input_section function.
8916 Add have_added_input_section_ field.
8917 * layout.cc (Layout::Layout): Initialize
8918 have_added_input_section_.
8919 (Layout::layout): Set have_added_input_section_.
8920 (Layout::layout_eh_frame): Likewise.
8921
fc59c572
ILT
89222009-12-30 Ian Lance Taylor <iant@google.com>
8923
8924 PR 10931
8925 * options.h (class General_options): Add --sort-common option.
8926 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
8927 * common.cc (Sort_common): Add sort_order parameter to
8928 constructor. Add sort_order_ field.
8929 (Sort_commons::operator): Check sort_order_.
8930 (Symbol_table::allocate_commons): Determine the sort order.
8931 (Symbol_table::do_allocate_commons): Add sort_order parameter.
8932 Change all callers.
8933 (Symbol_table::do_allocate_commons_list): Likewise.
8934
1c74fab0
ILT
89352009-12-30 Ian Lance Taylor <iant@google.com>
8936
8937 PR 10916
8938 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
8939 symbols from this object, don't change the visibility of an
8940 undefined symbol.
8941 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
8942
6affe781
ILT
89432009-12-30 Ian Lance Taylor <iant@google.com>
8944
8945 PR 10861
8946 * script.h (class Version_script_info): Define Language enum.
8947 Update declarations. Define Glob, Exact, and Lookup types. Add
8948 new fields globals_, locals_, and is_finalized_.
8949 * script.cc: Various formatting fixes.
8950 (class Parser_closure): Change language_stack_ from a vector of
8951 std::string to one of Version_script_info::Language. Adjust all
8952 uses accordingly.
8953 (class Lazy_demangler): Remove.
8954 (struct Version_expression): Change language from std::string to
8955 Version_script_info::Language.
8956 (Version_script_info::Version_script_info): New function.
8957 (Version_script_info::~Version_script_info): Don't call clear.
8958 (Version_script_info::finalize): New function.
8959 (Version_script_info::build_lookup_tables): New function.
8960 (Version_script_info::build_expression_list_lookup): New
8961 function.
8962 (Version_script_info::get_symbol_version_helper): Rewrite to use
8963 lookup tables.
8964 (Version_script_info::print_expression_list): Adjust to use
8965 Version_script_info::Language.
8966 (script_push_lex_into_version_mode): Check that the version script
8967 has not been finalized.
8968 (version_script_push_lang): Change language string to
8969 Version_script_info::Language.
8970 * options.cc (Command_line::version_script): New function.
8971 * options.h (class General_options): Add finalize_dynamic_list
8972 function. Change version_script from declaration to definition.
8973 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
8974 * testsuite/version_script.map: Remove duplicate def of foo.
8975 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
8976 version_script.map.
8977 * testsuite/Makefile.in: Rebuild.
8978
818bf354
ILT
89792009-12-30 Ian Lance Taylor <iant@google.com>
8980
8981 PR 10843
8982 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
8983 if the input symbol index is 0, make the output symbol index 0.
8984
ebcc8304
ILT
89852009-12-30 Ian Lance Taylor <iant@google.com>
8986
8987 PR 10670
8988 * options.h (class General_options): Add -x/--discard-all.
8989 * object.cc (Sized_relobj::do_count_local_symbols): Handle
8990 --discard-all. If the local symbol needs a dynamic entry, check
8991 that before handling --discard-locals.
8992
176fe33f
ILT
89932009-12-30 Ian Lance Taylor <iant@google.com>
8994
bb321bb1
ILT
8995 PR 10450
8996 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
8997 flags to PF_R.
8998 (Output_segment::add_output_section): Don't change the flags if
8999 the type is PT_TLS.
9000
176fe33f
ILT
9001 PR 10450
9002 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
9003 GNU hash table if they need a dynamic value. Otherwise, don't add
9004 them if they are defined in a dynamic object or are forced local.
9005
e8cd95c7
ILT
90062009-12-29 Ian Lance Taylor <iant@google.com>
9007
1b81fb71
ILT
9008 PR 10450
9009 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
9010 .gnu.hash table for a 32-bit target.
9011
8d6d383d
ILT
9012 PR 10450
9013 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
9014 regular and a dynamic object only needs a dynamic symbol table
9015 entry if it is externally visible.
9016
e785ec03
ILT
9017 PR 10450
9018 * i386.cc (class Target_i386): Initialize global_offset_table_ in
9019 constructor. Add global_offset_table_ field.
9020 (Target_i386::got_section): Set global_offset_table_.
9021 (Target_i386::do_finalize_sections): Set global_offset_table_
9022 size.
9023 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
9024 in constructor. Add global_offset_table_ field.
9025 (Target_x86_64::got_section): Set global_offset_table_.
9026 (Target_x86_64::do_finalize_sections): Set global_offset_table_
9027 size.
9028
1a2dff53
ILT
9029 * layout.cc (Layout::Layout): Initialize increase_relro_.
9030 (Layout::get_output_section): Add is_relro, is_last_relro, and
9031 is_first_non_relro parameters. Change all callers.
9032 (Layout::choose_output_section): Likewise.
9033 (Layout::add_output_section_data): Likewise.
9034 (Layout::make_output_section): Likewise.
9035 (Layout::set_segment_offsets): Clear increase_relro when using a
9036 linker script.
9037 * layout.h (class Layout): Add increase_relro method. Add
9038 increase_relro_ field. Update declarations.
9039 * output.cc (Output_section::Output_section): Initialize
9040 is_last_relro_ and is_first_non_relro_.
9041 (Output_segment::add_output_section): Group relro sections is
9042 do_sort is true. Handle is_last_relro and is_first_non_relro.
9043 (Output_segment::maximum_alignment): Remove relro handling.
9044 (Output_segment::set_section_addresses): Add increase_relro
9045 parameter. Change all callers. Add initial alignment to align
9046 relro sections on separate page. Remove old relro handling.
9047 (Output_segment::set_section_list_addresses): Remove in_relro
9048 parameter. Change all callers.
9049 (Output_segment::set_offset): Add increase parameter. Change all
9050 callers. Remove old relro handling.
9051 * output.h (class Output_section): Add new methods: is_last_relro,
9052 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
9053 Add is_last_relro_ and is_first_non_relro_ fields.
9054 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
9055 Create separate .got.plt section. Call increase_relro.
9056 * x86_64.cc (Target_x86_64::got_section): Likewise.
9057 * testsuite/relro_script_test.t: Add .got.plt.
9058
f0ba79e2
ILT
9059 PR 10450
9060 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
9061 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
9062 (Layout::finalize): Call set_dynamic_symbol_size.
9063 (Layout::set_dynamic_symbol_size): New function.
9064 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
9065 set_dynamic_symbol_size.
9066
e8cd95c7
ILT
9067 PR 10450
9068 * output.h (class Output_section): Add is_entsize_zero_ field.
9069 * output.cc (Output_section::Output_section): Initialize
9070 is_entsize_zero_.
9071 (Output_section::set_entsize): If two different entsizes are
9072 requested, force it to zero.
9073 (Output_section::add_input_section): Set flags for .debug_str
9074 before updating section flags. Set entsize.
9075 (Output_section::update_flags_for_input_section): Set SHF_MERGE
9076 and SHF_STRING if all input sections have those flags.
9077
3e1b9a8a
RÁE
90782009-12-29 Rafael Espindola <espindola@google.com>
9079
9080 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
9081 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
9082 reporting.
3e1b9a8a 9083
3dcad376
ST
90842009-12-29 Sriraman Tallam <tmsriram@google.com>
9085
9086 * options.cc (General_options::parse_version): Allow -v to exit
9087 without an error if there is nothing to link.
9088
084e2665
ILT
90892009-12-29 Ian Lance Taylor <iant@google.com>
9090
9091 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
9092 using a version of gcc before 4.1.
9093 * configure: Rebuild.
9094
250acde3
CD
90952009-12-28 Chris Demetriou <cgd@google.com>
9096
9097 * attributes.cc (Output_attributes_section_data::do_write): Use
9098 std::vector::front rather than std::vector::data.
9099
99fff23b
ILT
91002009-12-28 Ian Lance Taylor <iant@google.com>
9101
9102 * symtab.h (class Symbol_table): Add enum Defined.
9103 * resolve.cc (Symbol_table::should_override): Add defined
9104 parameter. Change all callers. Test whether object is NULL
9105 before calling a method on it.
9106 (Symbol_table::report_resolve_problem): Add defined parameter.
9107 Change all callers.
9108 (Symbol_table::should_override_with_special): Likewise.
9109 * symtab.cc (Symbol_table::define_in_output_data): Add defined
9110 parameter. Change all callers.
9111 (Symbol_table::do_define_in_output_data): Likewise.
9112 (Symbol_table::define_in_output_segment): Likewise.
9113 (Symbol_table::do_define_in_output_segment): Likewise.
9114 (Symbol_table::define_as_constant): Likewise.
9115 (Symbol_table::do_define_as_constant): Likewise.
9116 * script.h (class Symbol_assignment): Add is_defsym parameter to
9117 constructor; change all callers.
9118 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
9119 parameter. Change all callers. Add is_defsym_ field.
9120 (class Parser_closure): Add parsing_defsym parameter to
9121 constructor; change all callers. Add parsing_defsym accessor
9122 function. Add parsing_defsym_ field.
9123
556bd683
ILT
91242009-12-28 Ian Lance Taylor <iant@google.com>
9125
9126 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 9127 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 9128
1782c879
ILT
91292009-12-23 Ian Lance Taylor <iant@google.com>
9130
9131 * i386.cc (Target_i386::do_calls_non_split): Recognize
9132 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
9133 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
9134 -fsplit-stack prologue when using %r11.
1782c879 9135
329ca2b1
ST
91362009-12-21 Sriraman Tallam <tmsriram@google.com>
9137
9138 * options.cc (General_options::parse_version): Make -v continue and do
9139 the link like GNU ld does.
9140
d675ff46
RÁE
91412009-12-17 Rafael Avila de Espindola <espindola@google.com>
9142
9143 * Makefile.am (CCFILES): Add timer.cc.
9144 (HFILES): Add timer.h.
9145 * configure.ac: Check for sysconf and times.
9146 * main.cc: include timer.h.
9147 (main): Use Timer instead of get_run_time.
9148 * timer.cc: New.
9149 * timer.h: New.
9150 * workqueue.cc: include timer.h.
9151 (Workqueue::find_and_run_task):
9152 Report user, sys and wall time.
9153 * Makefile.in: Regenerate.
9154 * config.in: Regenerate.
9155 * configure: Regenerate.
9156
d6344fb5
DK
91572009-12-16 Doug Kwan <dougkwan@google.com>
9158
9159 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
9160 sections.
9161 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
9162 relaxed input sections.
9163 * output.cc (Output_section::find_relaxed_input_section): Change
9164 return type to Output_relaxed_input_section pointer. Adjust code
9165 for new type of relaxed_input_section_map_.
9166 * output.h (Output_section::find_relaxed_input_section): Change
9167 return type to Output_relaxed_input_section pointer.
9168 (Output_section::Output_relaxed_input_section_by_input_section_map):
9169 New type.
9170 (Output_section::relaxed_input_section_map_): Change type to
9171 Output_section::Output_relaxed_input_section_by_input_section_map.
9172 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
9173 input section.
9174
0e0d5469
ILT
91752009-12-15 Ian Lance Taylor <iant@google.com>
9176
9177 * layout.cc (Layout::create_shstrtab): Only write out after input
9178 sections if we are compressing debug sections.
9179
0649a889
ILT
91802009-12-15 Ian Lance Taylor <iant@google.com>
9181
9182 * archive.cc (Archive::add_symbols): Only look up a symbol without
9183 a version if there is, in fact, a version.
9184
2ea97941
ILT
91852009-12-14 Ian Lance Taylor <iant@google.com>
9186
9187 Revert -Wshadow changes, all changes from:
9188 2009-12-11 Doug Kwan <dougkwan@google.com>
9189 2009-12-11 Nick Clifton <nickc@redhat.com>
9190 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
9191
b0eec2cc
DK
91922009-12-11 Doug Kwan <dougkwan@google.com>
9193
9194 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
9195 due to -Wshadow.
9196 * attributes.cc (Object_attribute::size): Ditto.
9197 (Attributes_section_data::size): Ditto.
9198 (Attributes_section_data::Attributes_section_data): Ditto.
9199 (Output_attributes_section_data::do_write): Ditto.
9200 * attributes.h (Object_attribute::set_type): Ditto.
9201 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
9202
91d6fa6a
NC
92032009-12-11 Nick Clifton <nickc@redhat.com>
9204
9205 * archive.cc: Fix shadowed variable warnings.
9206 * arm.cc: Likewise.
9207 * compressed_output.cc: Likewise.
9208 * compressed_output.h: Likewise.
9209 * configure: Likewise.
9210 * dwarf_reader.cc: Likewise.
9211 * dynobj.cc: Likewise.
9212 * dynobj.h: Likewise.
9213 * ehframe.cc: Likewise.
9214 * ehframe.h: Likewise.
9215 * errors.cc: Likewise.
9216 * expression.cc: Likewise.
9217 * fileread.cc: Likewise.
9218 * fileread.h: Likewise.
9219 * freebsd.h: Likewise.
9220 * i386.cc: Likewise.
9221 * icf.cc: Likewise.
9222 * incremental.h: Likewise.
9223 * layout.cc: Likewise.
9224 * layout.h: Likewise.
9225 * mapfile.cc: Likewise.
9226 * merge.cc: Likewise.
9227 * merge.h: Likewise.
9228 * object.cc: Likewise.
9229 * object.h: Likewise.
9230 * options.h: Likewise.
9231 * output.cc: Likewise.
9232 * output.h: Likewise.
9233 * parameters.cc: Likewise.
9234 * plugin.cc: Likewise.
9235 * powerpc.cc: Likewise.
9236 * reduced_debug_output.cc: Likewise.
9237 * reduced_debug_output.h: Likewise.
9238 * reloc.cc: Likewise.
9239 * reloc.h: Likewise.
9240 * resolve.cc: Likewise.
9241 * script-sections.cc: Likewise.
9242 * script.cc: Likewise.
9243 * script.h: Likewise.
9244 * sparc.cc: Likewise.
9245 * symtab.cc: Likewise.
9246 * symtab.h: Likewise.
9247 * target-select.cc: Likewise.
9248 * target-select.h: Likewise.
9249 * token.h: Likewise.
9250 * workqueue.cc: Likewise.
9251 * workqueue.h: Likewise.
9252 * x86_64.cc: Likewise.
9253
a0351a69
DK
92542009-12-10 Doug Kwan <dougkwan@google.com>
9255
9256 * arm.cc (attributes.h): New include.
9257 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
9258 (Arm_relobj::~Arm_relobj): Delete object pointed by
9259 attributes_section_data_.
9260 (Arm_relobj::attributes_section_data): New method definition.
9261 (Arm_relobj::attributes_section_data_): New data member declaration.
9262 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
9263 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
9264 attributes_section_data_.
9265 (Arm_dynobj::attributes_section_data): New method definition.
9266 (Arm_dynobj::attributes_section_data_): New data member declaration.
9267 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
9268 initialization value of may_use_blx_ to false.
2e702c99 9269 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
9270 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
9271 object attributes to compute results instead of hard-coding.
9272 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
9273 Target_arm::get_secondary_compatible_arch,
9274 Target_arm::set_secondary_compatible_arch
9275 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
9276 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
9277 New method declarations.
9278 (Target_arm::get_aeabi_object_attribute): New method definition.
9279 (Target_arm::attributes_section_data_): New data member declaration.
9280 (read_arm_attributes_section): New template definition.
9281 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
9282 (Arm_dynobj::do_read_symbols): Ditto.
9283 (Target_arm::do_finalize_sections): Merge attributes sections from
9284 input. Check for BLX use after attributes section merging.
9285 Fix __exidx_start and __exidx_end visibility. Create an
9286 .ARM.attributes section if necessary.
9287 (Target_arm::get_secondary_compatible_arch,
9288 Target_arm::set_secondary_compatible_arch,
9289 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
9290 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 9291 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
9292 New method definitions.
9293
b59befec
ILT
92942009-12-09 Ian Lance Taylor <iant@google.com>
9295
9296 * plugin.cc (Plugin::load): Don't cast from void* to a function
9297 pointer.
9298
1276bc89
ILT
92992009-12-09 Ian Lance Taylor <iant@google.com>
9300
9301 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
9302 information fields.
9303
2f2de248
L
93042009-12-09 H.J. Lu <hongjiu.lu@intel.com>
9305
9306 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
9307 Replace two_file_shared_1.so with two_file_shared_2.so.
9308 * testsuite/Makefile.in: Regenerated.
9309
4f787271
DK
93102009-12-08 Doug Kwan <dougkwan@google.com>
9311
9312 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
9313 (HFILES): Add attributes.h and int_encoding.h.
9314 * Makefile.in: Regenerate.
9315 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
9316 function definitions to int_encoding.cc
9317 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
9318 prototypes to int_encoding.h
9319 * reduced_debug_output.cc (int_encoding.h): New include.
9320 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
9321 function definitions to int_encoding.cc
9322 (insert_into_vector, read_from_pointer): Move template definitions to
9323 int_encoding.h
9324 * attributes.cc: New file.
9325 * attributes.h: New file.
9326 * int_encoding.cc: New file.
9327 * int_encoding.h: New file.
9328
20b52f1a
RÁE
93292009-12-07 Rafael Avila de Espindola <espindola@google.com>
9330
9331 PR gold/11055
9332 * incremental-dump.cc (dump_incremental_inputs): New.
9333 (main): Use dump_incremental_inputs.
9334
53d7974c
L
93352009-12-07 H.J. Lu <hongjiu.lu@intel.com>
9336
9337 PR gold/10893
9338 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
9339 checking elfcpp::STT_FUNC.
9340 (Target_i386::Relocate::relocate): Likewise.
9341 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
9342
9343 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
9344 symbols from shared libraries into normal FUNC symbols.
9345
9346 * symtab.h (Symbol): Add is_func and use it.
9347
05a352e6
DK
93482009-12-05 Doug Kwan <dougkwan@google.com>
9349
9350 * arm.cc (Target_arm::arm_info): Initialize new fields
9351 attributes_section and attributes_vendor.
9352 * i386.cc (Target_i386::i386_info): Same.
9353 * object.cc (Sized_relobj::do_layout): Skip attribute section.
9354 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
9355 fields attributes_section and attributes_vendor.
53d7974c 9356 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
9357 * target.h (Target::attributes_section, Target::attributes_vendor,
9358 Target::is_attributes_section, Target::attribute_arg_type,
9359 Target::attributes_order): New method definitions.
9360 (Target::Target_info::attributes_section,
9361 Target::Target_info::attributes_vendor): New fields.
9362 (Target::do_attribute_arg_type, Target::do_attributes_order): New
9363 virtual method definitions.
9364 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
9365 attributes_section and attributes_vendor.
9366 * testsuite/testfile.cc (Target_test::test_target_info): Same.
9367
f4e5969c
DK
93682009-12-05 Doug Kwan <dougkwan@google.com>
9369
9370 * arm.cc: Update comments about interworking and stub generation.
9371 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
9372 considered as non-PIC.
9373 (Arm_relocate_functions::base_abs): Fix formatting.
9374 (Arm_relocate_functions::got_prel): Fix comment. Change interface
9375 of function to use GOT entry address instead of offset.
9376 (Target_arm::Scan::global): Issue an error if a symbol would need a
9377 PLT does not get one because it is untyped. Remove code to create
9378 dynamic symbols for relative branches.
9379 (Target_arm::Relocate::relocate: Use 0 instead of false since function
9380 takes unsigned integer instead of boolean.
9381
1abce4a6
L
93822009-12-05 H.J. Lu <hongjiu.lu@intel.com>
9383
9384 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
9385 (two_file_test_LDADD): Likewise.
9386 (common_test_1_LDADD): Likewise.
9387 (exception_test_LDADD) Likewise.
9388 (weak_test_LDADD): Likewise.
9389 (many_sections_test_LDADD): Likewise.
9390 (initpri1_LDADD): Likewise.
9391 (script_test_1_LDADD): Likewise.
9392 (script_test_2_LDADD): Likewise.
9393 (justsyms_LDADD): Likewise.
9394 (binary_test_LDADD): Likewise.
9395 (large_LDADD): Likewise.
9396 * testsuite/Makefile.in: Regenerated.
9397
adcf2816 93982009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 9399
adcf2816
L
9400 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
9401 (Symbol_table::override_with_special): Likewise.
9402 (Symbol_table::add_from_object): Likewise.
9403
28e67f5d
RÁE
94042009-12-04 Rafael Avila de Espindola <espindola@google.com>
9405
9406 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
9407 Don't set the data_offset twice.
9408
ae10a101
RÁE
94092009-12-04 Rafael Avila de Espindola <espindola@google.com>
9410
9411 * testsuite/Makefile.in: Regenerate.
9412
f59f41f3
DK
94132009-12-03 Doug Kwan <dougkwan@google.com>
9414
9415 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
9416 (Target_arm::do_finalize_sections): Add parameter for symbol table
9417 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
9418 * i386.cc (Target_i386::do_finalize_sections): Add an additional
9419 parameter for symbol table pointer.
9420 * layout.cc (Layout::finalize): Call Target::finalize_sections with
9421 an additional parameter for a pointer to symbol table.
9422 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
9423 parameter for a symbol table pointer.
9424 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
9425 * target.h (Target::finalize_sections, Target::do_finalize_sections):
9426 Ditto.
9427 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
9428 parameter for a symbol table pointer.
9429
ca55d848
RÁE
94302009-12-03 Rafael Avila de Espindola <espindola@google.com>
9431
9432 * incremental.cc (Incremental_inputs_header)
9433 (Incremental_inputs_header_write, Incremental_inputs_entry)
9434 (Incremental_inputs_entry_write): Move ...
9435 * incremental.h (Incremental_inputs_header)
9436 (Incremental_inputs_header_write, Incremental_inputs_entry)
9437 (Incremental_inputs_entry_write): here.
9438
3aec4f9c
RÁE
94392009-12-02 Rafael Avila de Espindola <espindola@google.com>
9440
9441 * incremental.cc (make_sized_incremental_binary): Set the target.
9442 Error if it is incompatible.
9443 * output.h (Output_file): Add filename method.
9444
9c0ae74d
RÁE
94452009-12-02 Rafael Avila de Espindola <espindola@google.com>
9446
9447 * incremental.cc (Incremental_inputs_entry): Remove unused argument
9448 from the get_* methods.
9449
a45500ae
RÁE
94502009-12-02 Rafael Avila de Espindola <espindola@google.com>
9451
9452 * incremental-dump.cc (main): Check that the offeset of a script is 0.
9453 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
9454 Write 0 for the data_offset of scripts.
9455
325e6408
RÁE
94562009-12-02 Rafael Avila de Espindola <espindola@google.com>
9457
9458 * testsuite/Makefile.am: Add the incremental_test.sh test.
9459 * testsuite/incremental_test.sh: New.
9460 * testsuite/incremental_test_1.c: New.
9461 * testsuite/incremental_test_2.c: New.
9462
954c3e2e
RÁE
94632009-12-01 Rafael Avila de Espindola <espindola@google.com>
9464
703d02da 9465 * incremental-dump.cc (main): Fix typos.
954c3e2e 9466
f8086623
RÁE
94672009-11-27 Rafael Avila de Espindola <espindola@google.com>
9468
9469 PR gold/11025
9470 * incremental-dump.cc (main): Use llu to print 64 bit values.
9471
3b0dd6ac
L
94722009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
9473 H.J. Lu <hongjiu.lu@intel.com>
9474
9475 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
9476 $(LIBDL).
9477 (incremental_dump_LDADD): Likewise.
9478 * Makefile.in: Regenerated.
9479
a6d1ef57 94802009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 9481
a6d1ef57
DK
9482 Revert:
9483
9484 2009-11-25 Doug Kwan <dougkwan@google.com>
9485
9486 * arm.cc (Target_arm::Target_arm): Move method definition
9487 outside of class definition. Add code to handle
9488 --target1-rel, --target1-abs and --target2= options.
9489 (Target_arm::get_reloc_reloc_type): Change method to be
9490 non-static and const.
9491 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
9492 New data member declaration.
9493 (Target_arm::Scan::local, Target_arm::Scan::global,
9494 Target_arm::Relocate::relocate,
9495 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9496 Adjust call to Target_arm::get_real_reloc_type.
9497 (Target_arm::get_real_reloc_type): Use command line options
9498 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
9499 * options.h (--target1-rel, --target1-abs, --target2): New
9500 ARM-only options.
9501
50aeb7d4
DK
95022009-11-25 Doug Kwan <dougkwan@google.com>
9503
9504 * arm.cc (Target_arm::Target_arm): Move method definition outside of
9505 class definition. Add code to handle --target1-rel, --target1-abs
9506 and --target2= options.
9507 (Target_arm::get_reloc_reloc_type): Change method to be non-static
9508 and const.
9509 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
9510 member declaration.
9511 (Target_arm::Scan::local, Target_arm::Scan::global,
9512 Target_arm::Relocate::relocate,
9513 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
9514 call to Target_arm::get_real_reloc_type.
9515 (Target_arm::get_real_reloc_type): Use command line options to
9516 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
9517 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
9518 options.
9519
51938283
DK
95202009-11-25 Doug Kwan <dougkwan@google.com>
9521
9522 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
9523 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
9524 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
9525 formatting.
9526 (Arm_relocate_functions::thm_call): Replace body with a call to
9527 Arm_relocate_functions::thumb_branch_common.
9528 (Arm_relocate_functions::thm_jump24,
9529 Arm_relocate_functions::thm_xpc22): New method definitions.
9530 (Arm_relocate_functions::thumb_branch_common): New method definition.
9531 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
9532 operator.
9533 (Target_arm::Relocate::relocate): Adjust call to thm_call.
9534 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
9535
e2b8f3c4
RÁE
95362009-11-24 Rafael Avila de Espindola <espindola@google.com>
9537
9538 * Makefile.am: Build incremental-dump
9539 * Makefile.in: Regenerate.
9540 * incremental-dump.cc: New.
9541 * incremental.cc (Incremental_inputs_header_data,
9542 Incremental_inputs_entry_data): Move to incremental.h
9543 * incremental.h: (Incremental_inputs_header_data,
9544 Incremental_inputs_entry_data): Move from incremental.cc
9545
bcba9aec
RÁE
95462009-11-24 Rafael Avila de Espindola <espindola@google.com>
9547
9548 * incremental.cc (Incremental_inputs_header,
9549 Incremental_inputs_header_write, Incremental_inputs_entry,
9550 Incremental_inputs_entry_write): Add a typedef with the data type.
9551
7c3afe08
RÁE
95522009-11-24 Rafael Avila de Espindola <espindola@google.com>
9553
9554 * incremental.cc (Incremental_inputs_header,
9555 Incremental_inputs_header_write, Incremental_inputs_entry,
9556 Incremental_inputs_entry_write): Update comment about which
9557 type has the filed descriptions.
9558
d204b6e9
DK
95592009-11-15 Doug Kwan <dougkwan@google.com>
9560
9561 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
9562 (Arm_relocate_functions::arm_branch_common): Change method defintion
9563 in class definition to a method declaration and update list of formal
9564 parameters.
9565 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
9566 Arm_relocation_functions::jump24): Adjust call to
9567 Arm_relocate_functions::arm_branch_common. Update list of formal
9568 parameters.
9569 (Arm_relocate_functions::xpc25): New method definition.
9570 (Arm_relocate_functions::arm_branch_common): Move method defintion
9571 out from class definition. Use stubs for mode-switching and extending
9572 branch ranges.
9573 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
9574 specially. Change code to enable use of stubs in ARM branches.
9575
43d12afe
DK
95762009-11-10 Doug Kwan <dougkwan@google.com>
9577
9578 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
9579 in method declaration.
9580 (Target_arm::relocate_stub): New method declaration.
9581 (Target_arm::default_target): Change to return a pointer instead of
9582 a const reference.
9583 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
9584 Target_arm::default_target.
9585 (Arm_Relobj::do_relocate_sections): Remove options paramater in
9586 method definition.
9587 (Target_arm::relocate_section): Adjust view.
9588 (Target_arm::relocate_stub): New method definition.
9589
ac33a407
DK
95902009-11-10 Doug Kwan <dougkwan@google.com>
9591
9592 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
9593 a format warning.
9594 * incremental.cc (open_incremental_binary): Initialized local
9595 variables to avoid warnings.
9596 * object.cc (make_elf_object): Ditto.
9597 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
9598 a format warning.
e1df38aa 9599
88ee28e9
L
9600009-11-09 H.J. Lu <hongjiu.lu@intel.com>
9601
9602 PR gold/10930
9603 * testsuite/plugin_test.c: Include "config.h".
9604
2daedcd6
DK
96052009-11-09 Doug Kwan <dougkwan@google.com>
9606
9607 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
9608 (arm_symbol_value): Remove.
9609 (Arm_relocate_functions::arm_branch_common,
9610 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
9611 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
9612 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
9613 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
9614 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
9615 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
9616 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
9617 Arm_relocate_functions::thm_mobw_abs_nc,
9618 Arm_relocate_functions::thm_mov_abs,
9619 Arm_relocate_functions::movw_prel_nc,
9620 Arm_relocate_functions::thm_movt_abs,
9621 Arm_relocate_functions::movt_prel,
9622 Arm_relocate_functions::thm_movw_prel_nc,
9623 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
9624 (Target_arm::Relocate::relocate): Only decompose address into two
9625 parts if relocation type uses the thumb-bit and pass the actual
9626 bit instead of a flag indicating that the thumb-bit is used. Adjust
9627 calls to methods in Arm_relocate_functions for this change.
9628
1276bc89 96292009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
9630
9631 PR 10925
9632 * reloc.cc: Instantiate
9633 Sized_relobj::initialize_input_to_output_maps and
9634 Sized_relobj:free_input_to_output_maps.
9635
e53ad1b5
ILT
96362009-11-06 Ian Lance Taylor <iant@google.com>
9637
9638 PR 10876
9639 * defstd.cc (in_segment): Set only_if_ref true for "end".
9640
eb44217c
DK
96412009-11-06 Doug Kwan <dougkwan@google.com>
9642
9643 * arm.cc (class Reloc_stub): Correct a comment.
9644 (Target_arm::Target_arm): Initialize arm_input_section_map_.
9645 (Target_arm::scan_section_for_stubs): New method declaration.
9646 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
9647 Change methods from private to protected.
9648 (Target_arm::do_may_relax): New method definition.
9649 (Target_arm::do_relax, Target_arm::group_sections,
9650 Target_arm::scan_reloc_for_stub,
9651 Target_arm::scan_reloc_section_for_stubs): New method declarations.
9652 (Target_arm::arm_input_section_map_): New data member declaration.
9653 (Target_arm::scan_reloc_for_stub,
9654 Target_arm::scan_reloc_section_for_stubs,
9655 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
9656 Target_arm::do_relax): New method definitions.
9657
5d329b7d
ILT
96582009-11-06 Mikolaj Zalewski <mikolaj@google.com>
9659
9660 * configure.ac: Check for (struct stat)::st_mtim
9661 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
9662 * config.in: Regenerate.
9663 * configure: Regenerate.
9664
96a0d71b
ILT
96652009-11-05 Ian Lance Taylor <iant@google.com>
9666
9667 PR 10910
9668 * output.cc (Output_segment::add_output_section): Add missing
9669 return statement.
9670
594c8e5e
ILT
96712009-11-04 Ian Lance Taylor <iant@google.com>
9672
9673 PR 10880
9674 * object.h (class Object): Add is_needed and set_is_needed
9675 methods. Add is_needed_ field. Make bool fields into bitfields.
9676 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
9677 defined in a dynamic object and referenced by a regular object,
9678 set is_needed for the dynamic object.
9679 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
9680 if the file is marked with as_needed and it is not needed.
9681
22b127cc
ILT
96822009-11-04 Ian Lance Taylor <iant@google.com>
9683
9684 PR 10887
9685 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
9686 tags if data is discarded by linker script.
9687 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9688 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
9689 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
9690 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9691
f5c870d2
ILT
96922009-11-04 Ian Lance Taylor <iant@google.com>
9693
9694 * layout.cc (Layout::get_output_section): Add is_interp and
9695 is_dynamic_linker_section parameters. Change all callers.
9696 (Layout::choose_output_section): Likewise.
9697 (Layout::make_output_section): Likewise.
9698 (Layout::add_output_section_data): Add is_dynamic_linker_section
9699 parameter. Change all callers.
9700 * layout.h (class Layout): Update declarations.
9701 * output.h (class Output_section): Add is_interp, set_is_interp,
9702 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
9703 Add is_interp_, is_dynamic_linker_section_ fields. Change
9704 generate_code_fills_at_write_ to a bitfield.
9705 * output.cc (Output_section::Output_sections): Initialize new
9706 fields.
9707 (Output_segment::add_output_section): Add do_sort parameter.
9708 Change all callers.
9709
1ae4d23b
ILT
97102009-11-03 Ian Lance Taylor <iant@google.com>
9711
9712 PR 10860
9713 * options.h (class General_options): Add --warn-common.
9714 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
9715 merging two common symbols.
9716 (Symbol_table::should_override): Handle --warn-common when merging
9717 a common symbol with a defined symbol. Use report_resolve_problem
9718 for multiple definitions.
9719 (Symbol_table::report_resolve_problem): New function.
9720 * symtab.h (class Symbol_table): Declare report_resolve_problem.
9721
55da9579
DK
97222009-11-03 Doug Kwan <dougkwan@google.com>
9723
9724 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
9725 stub_factory_.
9726 (Target_arm::stub_factory): New method definition.
9727 (Target_arm::new_arm_input_section,
9728 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
9729 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 9730 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
9731 New type definitions.
9732 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
9733 member declarations.
9734 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
9735 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
9736 New method definitions.
9737
37a9ac43
ILT
97382009-11-03 Ian Lance Taylor <iant@google.com>
9739
9740 * options.h (class General_options): Add --warn_constructors.
9741
b3d6a3d4
ILT
97422009-11-03 Ian Lance Taylor <iant@google.com>
9743
9744 PR 10893
9745 * defstd.cc (in_section): Add entries for __rel_iplt_start,
9746 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
9747
934b01dd
ILT
97482009-11-03 Ian Lance Taylor <iant@google.com>
9749
9750 PR 10895
9751 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
9752 --msgid-bugs-address.
9753 (install-pdf): New target.
9754 (install-data_yes): Look up one directory to find mkinstalldirs.
9755
03c1939b
L
97562009-11-03 H.J. Lu <hongjiu.lu@intel.com>
9757
9758 * po/Make-in (.po.gmo): Don't generate .gmo files in source
9759 tree.
9760
ebd95253
DK
97612009-10-30 Doug Kwan <dougkwan@google.com>
9762
9763 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
9764
e9bbb538
DK
97652009-10-30 Doug Kwan <dougkwan@google.com>
9766
9767 * arm.cc (Stub_addend_reader): New struct template definition
9768 and partial specializations.
9769 (Stub_addend_reader::operator()): New method definition for a
9770 partially specialized template.
9771
d5b40221
DK
97722009-10-30 Doug Kwan <dougkwan@google.com>
9773
9774 * arm.cc (Arm_relobj::processor_specific_flags): New method
9775 definition.
9776 (Arm_relobj::do_read_symbols): New method declaration.
9777 (Arm_relobj::processor_specific_flags_): New data member declaration.
9778 (Arm_dynobj): New class definition.
9779 (Target_arm::do_finalize_sections): Add input_objects parameter.
9780 (Target_arm::do_adjust_elf_header): New method declaration.
9781 (Target_arm::are_eabi_versions_compatible,
9782 (Target_arm::merge_processor_specific_flags): New method declaration.
9783 (Target_arm::do_make_elf_object): New overloaded method definitions
9784 and declaration.
9785 (Arm_relobj::do_read_symbols): New method definition.
9786 (Arm_dynobj::do_read_symbols): Ditto.
9787 (Target_arm::do_finalize_sections): Add input_objects parameters.
9788 Merge processor-specific flags from all input objects.
9789 (Target_arm::are_eabi_versions_compatible,
9790 Target_arm::merge_processor_specific_flags,
9791 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
9792 New method definitions.
9793 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
9794 Input_objects pointer type parameter.
9795 * layout.cc (Layout::finalize): Pass input objects to target's.
9796 finalize_sections function.
9797 * output.cc (Output_file_header::do_sized_write): Set ELF file
9798 header's processor-specific flags.
9799 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
9800 Input_objects pointer type parameter.
9801 * sparc.cc (Target_sparc::do_finalize_sections): Same.
9802 * target.h (Input_objects): New forward class declaration.
9803 (Target::processor_specific_flags,
9804 Target::are_processor_specific_flags_sect): New method definitions.
9805 (Target::finalize_sections): Add input_objects parameter.
9806 (Target::Target): Initialize processor_specific_flags_ and
9807 are_processor_specific_flags_set_.
9808 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
9809 parameter.
9810 (Target::set_processor_specific_flags): New method definition.
9811 (Target::processor_specific_flags_,
9812 Target::are_processor_specific_flags_set_): New data member
9813 declarations.
9814 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
9815 Input_objects pointer type parameter.
9816
ebabffbd
DK
98172009-10-30 Doug Kwan <dougkwan@google.com>
9818
9819 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
9820
ad0f2072
ILT
98212009-10-28 Ian Lance Taylor <iant@google.com>
9822
9823 * object.h (class Relobj): Drop options parameter from
9824 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
9825 do_scan_relocs, do_relocate. Change all callers.
9826 (class Sized_relobj): Drop options parameters from
9827 do_gc_process_relocs, do_scan_relocs, do_relocate,
9828 do_relocate_sections, relocate_sections, emit_relocs_scan,
9829 emit_relocs_scan_reltype. Change all callers.
9830 (struct Relocate_info): Remove options field and all references to
9831 it.
9832 * reloc.h (class Read_relocs): Remove options constructor
9833 parameter and options_ field. Change all callers.
9834 (class Gc_process_relocs, class Scan_relocs): Likewise.
9835 (class Relocate_task): Likewise.
9836 * target-reloc.h (scan_relocs): Remove options parameter. Change
9837 all callers.
9838 (scan_relocatable_relocs): Likewise.
9839 * target.h (class Sized_target): Remove options parameter from
9840 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
9841 all callers.
9842 * gc.h (gc_process_relocs): Remove options parameter. Change all
9843 callers.
9844 * arm.cc: Update functions to remove options parameters.
9845 * i386.cc: Likewise.
9846 * powerpc.cc: Likewise.
9847 * sparc.cc: Likewise.
9848 * x86_64.cc: Likewise.
9849 * testsuite/testfile.cc: Likewise.
9850
8ffa3667
DK
98512009-10-28 Doug Kwan <dougkwan@google.com>
9852
9853 * arm.cc (Arm_relobj): New class definition.
e1df38aa 9854 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
9855 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
9856 New method definitions.
9857
40f36857
CC
98582009-10-28 Cary Coutant <ccoutant@google.com>
9859
9860 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
9861 (Plugin::cleanup_done_): New member.
9862 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
9863 (Plugin_manager::cleanup_done_): Remove.
9864 (Plugin_manager::add_input_file): Edit error message.
9865 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
9866 (Plugin_manager::cleanup): Remove use of cleanup_done_.
9867
2c849493
ILT
98682009-10-27 Mikolaj Zalewski <mikolajz@google.com>
9869
9870 * fileread.cc: (File_read::View::~View): Use the new
9871 data_ownership_ filed.
9872 (File_read::~File_read): Dispose the new whole_file_view_.
9873 (File_read::open): Mmap the whole file if needed.
9874 (File_read::open): Use whole_file_view_ instead of contents_.
9875 (File_read::find_view): Use whole_file_view_ if applicable.
9876 (File_read::do_read): Use whole_file_view_ instead of contents_.
9877 (File_read::make_view): Use whole_file_view_ instead of contents_,
9878 update File_read::View::View call.
9879 (File_read::find_or_make_view): Update File_read::View::View
9880 call.
9881 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
9882 remove contents_
9883 (File_read::View::Data_ownership): New enum.
9884 (File_read::View::View): Replace bool mapped_ with Data_ownership
9885 argument.
9886 (File_read::View::mapped_): Remove (replaced by data_ownership_).
9887 (File_read::View::data_ownership_): New field.
9888 (File_read::contents_): Remove (replaced by whole_file_view_).
9889 (File_read::whole_file_view_): New field.
9890 * options.h (class General_options): Add --keep-files-mapped.
9891
24998053
CC
98922009-10-27 Cary Coutant <ccoutant@google.com>
9893
9894 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
9895 * testsuite/Makefile.am (plugin_test_5): New test case.
9896 * testsuite/Makefile.in: Regenerate.
9897
72adc4fa
DK
98982009-10-25 Doug Kwan <dougkwan@google.com>
9899
9900 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
9901 from private to protected to allow access by child class.
9902 (Sized_relobj::do_relocate_sections): New method declaration.
9903 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 9904 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
9905 Sized_relobj::relocate_sections. Instantiate template explicitly
9906 for different target sizes and endianity.
9907
07f508a2
DK
99082009-10-24 Doug Kwan <dougkwan@google.com>
9909
9910 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
9911 (Arm_input_section::as_arm_input_section): New method.
9912 (Arm_output_section): New class definition.
9913 (Arm_output_section::create_stub_group,
9914 Arm_output_section::group_sections): New method definitions.
9915
10ad9fe5
DK
99162009-10-22 Doug Kwan <dougkwan@google.com>
9917
9918 * arm.cc (Arm_input_section): New class definition.
9919 (Arm_input_section::init, Arm_input_section:do_write,
9920 Arm_input_section::set_final_data_size,
9921 Arm_input_section::do_reset_address_and_file_offset): New method
9922 definitions.
9923
56ee5e00
DK
99242009-10-21 Doug Kwan <dougkwan@google.com>
9925
9926 * arm.cc (Stub_table, Arm_input_section): New forward class
9927 declarations.
9928 (Stub_table): New class defintion.
9929 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
9930 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
9931 New method definition.
9932
b569affa
DK
99332009-10-21 Doug Kwan <dougkwan@google.com>
9934
9935 * arm.cc: Update copyright comments.
9936 (Target_arm): New forward class template declaration.
9937 (Arm_address): New type.
9938 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
9939 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
9940 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
9941 constants.
9942 (Insn_template): Same.
9943 (DEF_STUBS): New macro.
9944 (Stub_type): New enum type.
9945 (Stub_template): New class definition.
9946 (Stub): Same.
9947 (Reloc_stub): Same.
9948 (Stub_factory): Same.
9949 (Target_arm::Target_arm): Initialize may_use_blx_ and
9950 should_force_pic_veneer_.
9951 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
9952 Target_arm::should_force_pic_veneer,
9953 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
9954 Target_arm::using_thumb_only, Target_arm:;default_target): New
9955 method defintions.
9956 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
9957 New data member declarations.
9958 (Insn_template::size, Insn_template::alignment): New method defintions.
9959 (Stub_template::Stub_template): New method definition.
9960 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
9961 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
9962 (Stub_factory::Stub_factory): New method definition.
9963 * gold.h (string_hash): New template.
9964 * output.h (Input_section_specifier::hash_value): Use
9965 gold::string_hash.
9966 (Input_section_specifier::string_hash): Remove.
9967 * stringpool.cc (Stringpool_template::string_hash): Use
9968 gold::string_hash.
9969
6c172549
DK
99702009-10-20 Doug Kwan <dougkwan@google.com>
9971
9972 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
9973 symbols of relaxed input sections.
9974 * output.h (Output_section::find_relaxed_input_section): Make
9975 method public.
9976
c5617f2f
DK
99772009-10-16 Doug Kwan <dougkwan@google.com>
9978
9979 * dynobj.cc (Versions::Versions): Initialize version_script_.
9980 Only insert base version symbol definition for a shared object
9981 if version script defines any version versions.
9982 (Versions::define_base_version): New method definition.
9983 (Versions::add_def): Check that base version is not needed.
9984 (Versions::add_need): Define base version lazily.
9985 * dynobj.h (Versions::define_base_version): New method declaration.
9986 (Versions::needs_base_version_): New data member declaration.
9987 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
9988 (check_DATA): Add no_version_test.stdout.
9989 (libno_version_test.so, no_version_test.o no_version_test.stdout):
9990 New make rules.
9991 * testsuite/Makefile.in: Regenerate.
9992 * testsuite/no_version_test.c: New file.
9993 * testsuite/no_version_test.sh: Ditto.
9994
3c12dcdb
DK
99952009-10-16 Doug Kwan <dougkwan@google.com>
9996
9997 * expression.cc (class Segment_start_expression): New class definition.
9998 (Segment_start_expression::value): New method definition.
9999 (script_exp_function_segment_start): Return a new
10000 Segment_start_expression.
10001 * gold/script-c.h (script_saw_segment_start_expression): New function
10002 prototype.
10003 * script-sections.cc (Script_sections::Script_sections): Initialize
10004 SAW_SEGMENT_START_EXPRESSION_ to false.
10005 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
10006 and -Tbbs options to specify section addresses if given in
10007 command line and no SEGMENT_START expression is seen in a script.
10008 * script-sections.h (Script_sections::saw_segment_start_expression,
10009 Script_sections::set_saw_segment_start_expression): New method
10010 definition.
10011 (Script_sections::saw_segment_start_expression_): New data member
10012 declaration.
10013 * script.cc (script_saw_segment_start_expression): New function.
10014 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
10015 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
10016 script_test_7.sh and script_test_8.sh.
10017 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
10018 script_test_8.stdout.
10019 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
10020 (script_test_6, script_test_6.stdout, script_test_7,
10021 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
10022 * Makefile.in: Regenerate.
10023 * testsuite/script_test_6.sh: New file.
10024 * testsuite/script_test_6.t: Same.
10025 * testsuite/script_test_7.sh: Same.
10026 * testsuite/script_test_7.t: Same.
10027 * testsuite/script_test_8.sh: Same.
10028
64b1ae37
DK
100292009-10-16 Doug Kwan <dougkwan@google.com>
10030
10031 * output.cc (Output_segment::set_section_list_address): Cast
10032 expressions to unsigned long long type to avoid format warnings.
10033
661be1e2
ILT
100342009-10-15 Ian Lance Taylor <iant@google.com>
10035
12edd763 10036 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 10037 dot assignment to script_sections_.
12edd763
ILT
10038 * script-sections.cc (Script_sections::add_dot_assignment):
10039 Initialize if necessary.
10040
68b6574b
ILT
10041 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
10042 program headers with no load segment if there is a linker script.
10043
661be1e2
ILT
10044 * layout.cc (Layout::set_segment_offsets): Align the file offset
10045 to the segment aligment for -N or -n with no load segment.
10046 * output.cc (Output_segment::add_output_section): Don't crash if
10047 the first section is a TLS section.
10048 (Output_segment::set_section_list_addresses): Print an error
10049 message if the address moves backward in a linker script.
10050 * script-sections.cc
10051 (Output_section_element_input::set_section_addresses): Don't
10052 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
10053 (Orphan_output_section::set_section_addresses): Likewise.
10054
f15f61a7
DK
100552009-10-15 Doug Kwan <dougkwan@google.com>
10056
10057 * layout.cc (Layout::finish_dynamic_section): Generate tags
10058 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
10059 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
10060 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
10061
82bb573a
ILT
100622009-10-14 Ian Lance Taylor <iant@google.com>
10063
10064 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
10065 fields.
10066 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
10067 data_shdr fields of relinfo.
10068 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
10069 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
10070 R_386_TLS_LDO_32, adjust based on section flags.
10071 (Target_i386::Relocate::fix_up_ldo): Remove.
10072
374ad285
ILT
100732009-10-13 Ian Lance Taylor <iant@google.com>
10074
10075 Add support for -pie.
10076 * options.h (class General_options): Add -pie and
10077 --pic-executable.
10078 (General_options::output_is_position_independent): Test -pie.
10079 (General_options::output_is_executable): Return true if not shared
10080 and not relocatable.
10081 (General_options::output_is_pie): Remove.
10082 * options.cc (General_options::finalize): Reject incompatible uses
10083 of -pie.
10084 * gold.cc (queue_middle_tasks): A -pie link is not static.
10085 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
10086 * symtab.cc (Symbol::final_value_is_known): Return false if
10087 output_is_position_independent.
10088 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
10089 output_is_position_independent.
10090 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
10091 output_is_position_independent.
10092 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
10093 output_is_position_independent.
10094 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
10095 two_file_pie_test.
10096 (basic_pie_test.o, basic_pie_test): New targets.
10097 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
10098 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
10099 (two_file_pie_test): New target.
10100 * testsuite/Makefile.in: Rebuild.
10101 * README: Remove note saying that -pie is not supported.
10102
c6585162
ILT
101032009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
10104
10105 * options.h (class General_options): Add -init and -fini.
10106 * layout.cc (Layout::finish_dynamic_section): Emit
10107 given init and fini functions.
10108
032ce4e9
ST
101092009-10-13 Sriraman Tallam <tmsriram@google.com>
10110
10111 * gc.h (gc_process_relocs): Check if icf is enabled using new
10112 function.
10113 * gold.cc (queue_initial_tasks): Likewise.
10114 (queue_middle_tasks): Likewise.
10115 * object.cc (do_layout): Likewise.
10116 * symtab.cc (is_section_folded): Likewise.
10117 * main.cc (main): Likewise.
10118 * reloc.cc (Read_relocs::run): Likewise.
10119 (Sized_relobj::do_scan_relocs): Likewise.
10120 * icf.cc (is_function_ctor_or_dtor): New function.
10121 (Icf::find_identical_sections): Check if function is ctor or dtor when
10122 safe icf is chosen.
10123 * options.h (General_options::icf): Change option to be an enum.
10124 (Icf_status): New enum.
10125 (icf_enabled): New method.
10126 (icf_safe_folding): New method.
10127 (set_icf_status): New method.
10128 (icf_status_): New variable.
10129 * (options.cc) (General_options::finalize): Set icf_status_.
10130 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
10131 icf_test and icf_keep_unique_test to use the --icf enum flag.
10132 * testsuite/icf_safe_test.sh: New file.
e1df38aa 10133 * testsuite/icf_safe_test.cc: New file.
032ce4e9 10134
f345227a
ST
101352009-10-12 Sriraman Tallam <tmsriram@google.com>
10136
10137 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
10138 includes to gc.h and icf.h.
10139 * arm.cc: Include gc.h.
10140 * gold.cc: Likewise.
10141 * i386.cc: Likewise.
10142 * powerpc.cc: Likewise.
10143 * sparc.cc: Likewise.
10144 * x86_64.cc: Likewise.
10145 * gc.h: Include icf.h.
10146
1c7814ed
ILT
101472009-10-11 Ian Lance Taylor <iant@google.com>
10148
10149 * plugin.cc: Include "gold.h" before other header files.
10150
ae3b5189
CD
101512009-10-10 Chris Demetriou <cgd@google.com>
10152
10153 * options.h (Input_file_argument::Input_file_type): New enum.
10154 (Input_file_argument::is_lib_): Replace with...
10155 (Input_file_argument::type_): New member.
10156 (Input_file_argument::Input_file_argument): Take Input_file_type
10157 'type' rather than boolean 'is_lib' as second argument.
10158 (Input_file_argument::is_lib): Use type_.
10159 (Input_file_argument::is_searched_file): New function.
10160 (Input_file_argument::may_need_search): Handle is_searched_file.
10161 * options.cc (General_options::parse_library): Support -l:filename.
10162 (General_options::parse_just_symbols): Update for Input_file_argument
10163 changes.
10164 (Command_line::process): Likewise.
10165 * archive.cc (Archive::get_file_and_offset): Likewise.
10166 * plugin.cc (Plugin_manager::release_input_file): Likewise.
10167 * script.cc (read_script_file, script_add_file): Likewise.
10168 * fileread.cc (Input_file::Input_file): Likewise.
10169 (Input_file::will_search_for): Handle is_searched_file.
10170 (Input_file::open): Likewise.
10171 * readsyms.cc (Read_symbols::get_name): Likewise.
10172 * testsuite/Makefile.am (searched_file_test): New test.
10173 * testsuite/Makefile.in: Regenerate.
10174 * testsuite/searched_file_test.cc: New file.
10175 * testsuite/searched_file_test_lib.cc: New file.
10176
f3048a1d
ILT
101772009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10178 Ian Lance Taylor <iant@google.com>
10179
10180 * descriptor.cc: Include <cstdio> and "binary-io.h".
10181 (Descriptors::open): Open the files in binary mode always.
10182 * script.cc (Lex::get_token): Treat \r as whitespace.
10183
d4780e57
ILT
101842009-10-09 Ian Lance Taylor <iant@google.com>
10185
10186 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
10187
d9a893b8
ILT
101882009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10189 Ian Lance Taylor <iant@google.com>
10190
10191 * configure.ac: Check for readv function also.
10192 * fileread.cc (readv): Define if not HAVE_READV.
10193 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
10194 does not exist.
10195 * config.in: Regenerate.
10196 * configure: Regenerate.
10197
c0a62865
DK
101982009-10-09 Doug Kwan <dougkwan@google.com>
10199
10200 * layout.cc (Layout::make_output_section): Call target hook to make
10201 ordinary output section.
10202 (Layout::finalize): Adjust parameter list of call the
10203 Target::may_relax().
10204 * layout.h (class Layout::section_list): New method.
10205 * merge.h (Output_merge_base::entsize): Change visibility to public.
10206 (Output_merge_base::is_string, Output_merge_base::do_is_string):
10207 New methods.
10208 (Output_merge_string::do_is_string): New method.
10209 * object.cc (Sized_relobj::do_setup): renamed from
10210 Sized_relobj::set_up.
10211 * object.h (Sized_relobj::adjust_shndx,
10212 Sized_relobj::initializ_input_to_output_maps,
10213 Sized_relobj::free_input_to_output_maps): Change visibilities to
10214 protected.
10215 (Sized_relobj::setup): Virtualize.
10216 (Sized_relobj::do_setup): New method declaration.
10217 (Sized_relobj::invalidate_section_offset,
10218 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
10219 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
10220 * options.cc (parse_int): New function.
10221 * options.h (parse_int): New declaration.
10222 (DEFINE_int): New macro.
10223 (stub_group_size): New option.
10224 * output.cc (Output_section::Output_section): Initialize memebers
10225 merge_section_map_, merge_section_by_properties_map_,
10226 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
10227 (Output_section::add_input_section): Handled deferred code-fill
10228 generation and remove an old comment.
10229 (Output_section::add_relaxed_input_section): New method definition.
10230 (Output_section::add_merge_input_section): Use merge section by
10231 properties map to speed to search. Update merge section maps
10232 as appropriate.
10233 (Output_section::build_relaxation_map): New method definition.
10234 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
10235 Same.
10236 (Output_section::relax_input_section): Renamed to
10237 Output_section::convert_input_sections_to_relaxed_sections and change
10238 interface to take a vector of pointers to relaxed sections.
10239 (Output_section::find_merge_section,
10240 Output_section::find_relaxed_input_section): New method definitions.
10241 (Output_section::is_input_address_mapped,
10242 Output_section::output_offset, Output_section::output_address):
10243 Use output section data maps to speed up searching.
10244 (Output_section::find_starting_output_address): Add comments.
10245 (Output_section::do_write,
10246 Output_section::write_to_postprocessing_buffer): Do code-fill
10247 generation as appropriate.
10248 (Output_section::get_input_sections): Invalidate relaxed input section
10249 map.
10250 (Output_section::restore_states): Adjust type of checkpoint .
10251 Invalidate relaxed input section map.
10252 * output.h (Output_merge_base): New class declaration.
10253 (Input_section_specifier): New class defintion.
10254 (class Output_relaxed_input_section) Change base class to
10255 Output_section_data_build.
10256 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
10257 base class initializer.
10258 (Output_section::add_relaxed_input_section): New method declaration.
10259 (Output_section::Input_section): Change visibility to protected.
2e702c99 10260 (Output_section::Input_section::relobj,
c0a62865
DK
10261 Output_section::Input_section::shndx): Handle relaxed input sections.
10262 Output_section::input_sections) Change visibility to protected. Also
10263 define overload to return a non-const pointer.
10264 (Output_section::Merge_section_properties): New class defintion.
10265 (Output_section::Merge_section_by_properties_map,
10266 Output_section::Output_section_data_by_input_section_map,
10267 Output_section::Relaxation_map): New types.
10268 (Output_section::relax_input_section): Rename method to
10269 Output_section::convert_input_sections_to_relaxed_sections and change
10270 interface to take a vector of relaxed section pointers.
10271 (Output_section::find_merge_section,
10272 Output_section::find_relaxed_input_section,
10273 Output_section::build_relaxation_map,
10274 Output_section::convert_input_sections_in_list_to_relaxed_sections):
10275 New method declarations.
10276 (Output_section::merge_section_map_
10277 Output_section::merge_section_by_properties_map_,
10278 Output_section::relaxed_input_section_map_,
10279 Output_section::is_relaxed_input_section_map_valid_,
10280 Output_section::generate_code_fills_at_write_): New data members.
10281 * script-sections.cc
10282 (Output_section_element_input::set_section_addresses): Call
10283 current_data_size and addralign methods of relaxed input sections.
10284 (Orphan_output_section::set_section_addresses): Call current_data_size
10285 and addralign methods of relaxed input sections.
10286 * symtab.cc (Symbol_table::compute_final_value): Extract template
10287 from the body of Symbol_table::sized_finalize_symbol.
10288 (Symbol_table::sized_finalized_symbol): Call
10289 Symbol_table::compute_final_value.
10290 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
10291 (Symbol_table::compute_final_value): New templated method declaration.
10292 * target.cc (Target::do_make_output_section): New method defintion.
10293 * target.h (Target::make_output_section): New method declaration.
10294 (Target::relax): Add more parameters for input objects, symbol table
10295 and layout. Adjust call to do_relax.
10296 (Target::do_make_output_section): New method declaration.
10297 (Target::do_relax): Add parameters for input objects, symbol table
10298 and layout.
10299
d446d6c4
ILT
103002009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10301
10302 * pread.c: Include stdio.h.
10303
bc06c745
ILT
103042009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10305
10306 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
10307 defined.
10308
75aea3d0
ILT
103092009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10310
10311 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
10312 Change read_shndx type to unsigned int.
10313 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
10314 int.
10315 (Sized_dwarf_line_info::read_line_mappings): Likewise.
10316 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
10317 Change read_shndx type to unsigned int.
10318 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
10319 int.
10320 (Sized_dwarf_line_info::read_line_mappings): Likewise.
10321 * layout.cc (Layout::create_symtab_sections): Cast the result of
10322 local_symcount * symsize to off_t in the gold_assert.
10323
be8fcb75
ILT
103242009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10325
10326 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
10327 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
10328 R_ARM_BASE_ABS.
10329 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
10330 (Arm_relocate_functions::thm_abs5): New function.
10331 (Arm_relocate_functions::abs12): New function.
10332 (Arm_relocate_functions::abs16): New function.
10333 (Arm_relocate_functions::base_abs): New function.
10334 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
10335 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
10336 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
10337 R_ARM_BASE_ABS.
10338 (Scan::global): Likewise.
10339 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
10340 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
10341 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
10342 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
10343 R_ARM_BASE_ABS.
10344
c2a122b6
ILT
103452009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10346
10347 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
10348 (Arm_relocate_functions::movt_prel): New function.
10349 (Arm_relocate_functions::thm_movw_prel_nc): New function.
10350 (Arm_relocate_functions::thm_movt_prel): New function.
10351 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
10352 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
10353 (Scan::global, Relocate::relocate): Likewise.
10354 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10355
c4aa1e2d
ILT
103562009-10-09 Mikolaj Zalewski <mikolajz@google.com>
10357
10358 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
10359 Incremental_checker.
10360 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
10361 unsigned int.
10362 (class Incremental_inputs_header): New class.
10363 (Incremental_inputs_header_writer): Edit comment.
10364 (Incremental_inputs_entry): New class.
10365 (Incremental_inputs_entry_writer): Edit comment.
10366 (Sized_incremental_binary::do_find_incremental_inputs_section):
10367 Add *strtab_shndx parameter, fill it.
10368 (Sized_incremental_binary::do_check_inputs): New method.
10369 (Incremental_checker::can_incrementally_link_output_file): Use
10370 Sized_incremental_binary::check_inputs.
10371 (Incremental_inputs::report_command_line): Save command line in
10372 command_line_.
10373 * incremental.h:
10374 (Incremental_binary::find_incremental_inputs_section): New
10375 method.
10376 (Incremental_binary::do_find_incremental_inputs_section): Add
10377 strtab_shndx parameter.
10378 (Incremental_binary::do_check_inputs): New pure virtual method.
10379 (Sized_incremental_binary::do_check_inputs): Declare.
10380 (Incremental_checker::Incremental_checker): Add incremental_inputs
10381 parameter, use it to initialize incremental_inputs_.
10382 (Incremental_checker::incremental_inputs_): New field.
10383 (Incremental_checker::command_line): New method.
10384 (Incremental_checker::inputs): New method.
10385 (Incremental_checker::command_line_): New field.
10386
c549a694
ILT
103872009-10-09 Mikolaj Zalewski <mikolajz@google.com>
10388
10389 * incremental.cc: Include <cstdarg> and "target-select.h".
10390 (vexplain_no_incremental): New function.
10391 (explain_no_incremental): New function.
10392 (Incremental_binary::error): New method.
10393 (Sized_incremental_binary::do_find_incremental_inputs_section): New
10394 method.
10395 (make_sized_incremental_binary): New function.
10396 (open_incremental_binary): New function.
10397 (can_incrementally_link_file): Add checks if output is ELF and has
10398 inputs section.
10399 * incremental.h: Include "elfcpp_file.h" and "output.h".
10400 (Incremental_binary): New class.
10401 (Sized_incremental_binary): New class.
10402 (open_incremental_binary): Declare.
10403 * object.cc (is_elf_object): Use
10404 elfcpp::Elf_recognizer::is_elf_file.
10405 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
10406 * output.h (Output_file::filesize): New method.
10407
fd3c5f0b
ILT
104082009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10409
10410 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
10411 New function.
10412 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
10413 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
10414 function.
10415 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
10416 function.
10417 (Arm_relocate_functions::movw_abs_nc): New function.
10418 (Arm_relocate_functions::movt_abs): New function.
10419 (Arm_relocate_functions::thm_movw_abs_nc): New function.
10420 (Arm_relocate_functions::thm_movt_abs): New function.
10421 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
10422 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
10423 (Scan::global): Likewise.
10424 (Relocate::relocate): Likewise.
10425 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10426
7f5309a5
ILT
104272009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10428
10429 * arm.cc (Arm_relocate_functions::got_prel) New function.
10430 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
10431 (Relocate::relocate): Likewise.
10432 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10433
364c7fa5
ILT
104342009-10-06 Ian Lance Taylor <iant@google.com>
10435
10436 * options.h (class General_options): Define
10437 split_stack_adjust_size parameter.
10438 * object.h (class Object): Add uses_split_stack_ and
10439 has_no_split_stack_ fields. Add uses_split_stack and
10440 has_no_split_stack accessor functions. Declare
10441 handle_split_stack_section.
10442 (class Reloc_symbol_changes): Define.
10443 (class Sized_relobj): Define Function_offsets. Declare
10444 split_stack_adjust, split_stack_adjust_reltype, and
10445 find_functions.
10446 * object.cc (Object::handle_split_stack_section): New function.
10447 (Sized_relobj::do_layout): Call handle_split_stack_section.
10448 * dynobj.cc (Sized_dynobj::do_layout): Call
10449 handle_split_stack_section.
10450 * reloc.cc (Sized_relobj::relocate_sections): Call
10451 split_stack_adjust for executable sections in split_stack
10452 objects. Pass reloc_map to relocate_section.
10453 (Sized_relobj::split_stack_adjust): New function.
10454 (Sized_relobj::split_stack_adjust_reltype): New function.
10455 (Sized_relobj::find_functions): New function.
10456 * target-reloc.h: Include "object.h".
10457 (relocate_section): Add reloc_symbol_changes parameter. Change
10458 all callers.
10459 * target.h (class Target): Add calls_non_split method. Declare
10460 do_calls_non_split virtual method. Declare match_view and
10461 set_view_to_nop.
10462 * target.cc: Include "elfcpp.h".
10463 (Target::do_calls_non_split): New function.
10464 (Target::match_view): New function.
10465 (Target::set_view_to_nop): New function.
10466 * gold.cc (queue_middle_tasks): Give an error if mixing
10467 split-stack and non-split-stack objects with -r.
10468 * i386.cc (Target_i386::relocate_section): Add
10469 reloc_symbol_changes parameter.
10470 (Target_i386::do_calls_non_split): New function.
10471 * x86_64.cc (Target_x86_64::relocate_section): Add
10472 reloc_symbol_changes parameter.
10473 (Target_x86_64::do_calls_non_split): New function.
10474 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
10475 parameter.
10476 * powerpc.cc (Target_powerpc::relocate_section): Add
10477 reloc_symbol_changes parameter.
10478 * sparc.cc (Target_sparc::relocate_section): Add
10479 reloc_symbol_changes parameter.
10480 * configure.ac: Call AM_CONDITIONAL for the default target.
10481 * configure: Rebuild.
10482 * testsuite/Makefile.am (TEST_AS): New variable.
10483 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
10484 (check_DATA): Add split_i386 and split_x86_64 files.
10485 (SPLIT_DEFSYMS): Define.
10486 (split_i386_[1234n].o): New targets.
10487 (split_i386_[124]): New targets.
10488 (split_i386_[1234r].stdout): New targets.
10489 (split_x86_64_[1234n].o): New targets.
10490 (split_x86_64_[124]): New targets.
10491 (split_x86_64_[1234r].stdout): New targets.
10492 (MOSTLYCLEANFILES): Add new executables.
10493 * testsuite/split_i386.sh: New file.
10494 * testsuite/split_x86_64.sh: New file.
10495 * testsuite/split_i386_1.s: New file.
10496 * testsuite/split_i386_2.s: New file.
10497 * testsuite/split_i386_3.s: New file.
10498 * testsuite/split_i386_4.s: New file.
10499 * testsuite/split_i386_n.s: New file.
10500 * testsuite/split_x86_64_1.s: New file.
10501 * testsuite/split_x86_64_2.s: New file.
10502 * testsuite/split_x86_64_3.s: New file.
10503 * testsuite/split_x86_64_4.s: New file.
10504 * testsuite/split_x86_64_n.s: New file.
10505 * testsuite/testfile.cc (Target_test): Update relocation_section
10506 function.
10507 * testsuite/Makefile.in: Rebuild.
10508
e8a9fcda
ILT
105092009-10-06 Ian Lance Taylor <iant@google.com>
10510
10511 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
10512 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
10513 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
10514 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
10515 the address on ldo_addrs_.
10516 (Target_i386::Relocate::fix_up_ldo): New function.
10517
e99daf92
ILT
105182009-10-06 Rafael Espindola <espindola@google.com>
10519
10520 * plugin.cc (add_input_library): New.
10521 (Plugin::load): Add add_input_library to tv.
10522 (Plugin_manager::add_input_file): Add the is_lib argument.
10523 (add_input_file): Update call to Plugin_manager::add_input_file.
10524 (add_input_library): New.
10525 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
10526
966d4097
DK
105272009-09-30 Doug Kwan <dougkwan@google.com>
10528
10529 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
10530 symbol and call Symbol::may_need_copy_reloc to determine if
10531 a copy reloc is needed.
10532 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
10533 nocopyreloc is given in command line.
10534 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
10535 given in command line.
10536 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
10537 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
10538 of the removed Target_i386::may_need_copy_reloc.
10539 * options.h (copyreloc): New option with default value false.
10540 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
10541 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
10542 instead of the removed Target_powerpc::may_need_copy_reloc.
10543 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
10544 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
10545 instead of the removed Target_sparc::may_need_copy_reloc.
10546 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
10547 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
10548 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
10549 instead of the removed Target_x86_64::may_need_copy_reloc.
10550
029ba973
ILT
105512009-09-30 Ian Lance Taylor <iant@google.com>
10552
10553 * object.h (class Object): Remove target_ field, and target,
10554 sized_target, and set_target methods.
10555 (Object::sized_target): Remove.
10556 (class Sized_relobj): Update declarations. Remove sized_target.
10557 * object.cc (Sized_relobj::setup): Remove target parameter.
10558 Change all callers.
10559 (Input_objects::add_object): Don't do anything with the target.
10560 (make_elf_sized_object): Add punconfigured parameter. Change all
10561 callers. Set or test parameter target.
10562 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
10563 Change all callers.
10564 * parameters.cc (Parameters::set_target): Change parameter type to
10565 be non-const.
10566 (Parameters::default_target): Remove.
10567 (set_parameters_target): Change parameter type to be non-const.
10568 (parameters_force_valid_target): New function.
10569 (parameters_clear_target): New function.
10570 * parameters.h (class Parameters): Update declarations. Remove
10571 default_target method. Add sized_target and clear_target
10572 methods. Change target_ to be non-const.
10573 (set_parameters_target): Update declaration.
10574 (parameters_force_valid_target): Declare.
10575 (parameters_clear_target): Declare.
10576 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
10577 as NULL if we aren't searching.
10578 (Add_symbols::run): Don't check for compatible target.
10579 * fileread.cc (Input_file::open_binary): Call
10580 parameters_force_valid_target.
10581 * gold.cc (queue_middle_tasks): Likewise.
10582 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
10583 set_target on object.
10584 * dynobj.h (class Sized_dynobj): Update declarations.
10585 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
10586 make_elf_object returns NULL.
10587 (Archive::include_member): Don't check whether object target is
10588 compatible.
10589 * output.cc (Output_section::add_input_section): Get target from
10590 parameters.
10591 (Output_section::relax_input_section): Likewise.
10592 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
10593 parameters.
10594 (Sized_relobj::do_scan_relocs): Likewise.
10595 (Sized_relobj::relocate_sections): Likewise.
10596 * resolve.cc (Symbol_table::resolve): Likewise.
10597 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
10598 parameter. Change all callers.
10599 (Symbol_table::add_from_object): Get target from parameters.
10600 (Symbol_table::add_from_relobj): Don't check object target.
10601 (Symbol_table::add_from_dynobj): Likewise.
10602 (Symbol_table::define_special_symbol): Get target from
10603 parameters.
10604 * symtab.h (class Symbol_table): Update declaration.
10605 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
10606 parameter. Change all callers. Clear parameter target.
10607 (Binary_test): Test target here.
10608 * testsuite/object_unittest.cc (gold_testsuite): Remove
10609 target_test_pointer parameter. Change all callers.
10610 (Object_test): Test target here.
10611
a6a22b83
ILT
106122009-09-26 Ian Lance Taylor <iant@google.com>
10613
10614 * testsuite/initpri1.c: Don't try to use constructor priorities if
10615 compiling with gcc before 4.3.
10616
6a8f49fe
ILT
106172009-09-22 Mikolaj Zalewski <mikolajz@google.com>
10618
10619 * testsuite/retain_symbols_file_test.sh (check_present): Change
10620 output file name to retain_symbols_file_test.stdout.
10621 (check_absent): Likewise.
10622
8c604651
CS
106232009-09-18 Craig Silverstein <csilvers@google.com>
10624
10625 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
10626 * options.cc: Include <cerrno> and <fstream>.
10627 (General_options::finalize): Parse -retain-symbols-file tag.
10628 * options.h: New flag.
10629 (General_options): New method should_retain_symbol, new
10630 variable symbols_to_retain.
10631 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
10632 should_retain_symbol map.
10633 * testsuite/Makefile.am (retain_symbols_file_test): New test.
10634 * testsuite/Makefile.in: Regenerate.
10635 * testsuite/retain_symbols_file_test.sh: New file.
10636
ca58b19f
NC
106372009-09-18 Nick Clifton <nickc@redhat.com>
10638
10639 * po/es.po: Updated Spanish translation.
10640
20e6d0d6
DK
106412009-09-17 Doug Kwan <dougkwan@google.com>
10642
10643 * debug.h (DEBUG_RELAXATION): New constant.
10644 (DEBUG_ALL): Add DEBUG_RELAXATION.
10645 (debug_string_to_enum): Add relaxation debug option.
10646 * layout.cc
10647 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
10648 Layout::Relaxation_debug_check::read_sections,
10649 Layout::Relaxation_debug_check::read_sections): New method definitions.
10650 (Layout::Layout): Initialize data members
10651 record_output_section_data_from_scrips_,
10652 script_output_section_data_list_ and relaxation_debug_check_.
10653 (Layout::save_segments, Layout::restore_segments,
10654 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
10655 Layout::relaxation_loop_body): New method definitions.
10656 (Layout::finalize): Support relaxation. Move section layout code to
10657 Layout::relaxation_loop_body.
10658 (Layout::set_asection_address_from_script): Move code for orphan
10659 section placement out.
10660 (Layout::place_orphan_sections_in_script): New method definition.
10661 * layout.h (Output_segment_headers, Output_file_header):
10662 New forward class declarations.
10663 (Layout::~Layout): Define.
10664 (Layout::new_output_section_data_from_script): New method definition.
10665 (Layout::place_orphan_sections_in_script): New method declaration.
10666 (Layout::Segment_states): New type declaration.
10667 (Layout::save_segments, Layout::restore_segments,
10668 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
10669 Layout::relaxation_loop_body): New method declarations.
10670 (Layout::Output_section_data_list): New type declaration.
10671 (Layout::Relaxation_debug_check): New class definition.
10672 (Layout::record_output_section_data_from_script_,
10673 Layout::script_output_section_data_list_, Layout::segment_states_,
10674 Layout::relaxation_debug_check_): New data members.
10675 * output.cc: (Output_section_headers::do_size): New method definition.
10676 (Output_section_headers::Output_section_headers): Move size
10677 computation to Output_section_headers::do_size.
10678 (Output_segment_headers::do_size): New method definition.
e1df38aa 10679 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
10680 Output_file_header::do_size and call it.
10681 (Output_file_header::do_size): New method definition.
10682 (Output_data_group::Output_data_group): Adjust call to
10683 Output_section_data.
10684 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
10685 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 10686 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
10687 RELAXED_INPUT_SECTION_CODE.
10688 (Output_section::Output_section): Initialize data member checkpoint_.
10689 (Output_section::~Output_section): Delete checkpoint object pointed
10690 by checkpoint_.
10691 (Output_section::add_input_section): Always add an Input_section if
10692 relaxing.
10693 (Output_section::add_merge_input_section): Add assert.
10694 (Output_section::relax_input_section): New method definition.
10695 (Output_section::set_final_data_size): Set load address to zero for
10696 an unallocated section.
10697 (Output_section::do_address_and_file_offset_have_reset_values):
10698 New method definition.
10699 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
10700 Handle relaxed input section.
10701 (Output_section::sort_attached_input_sections): Checkpoint input
10702 section list lazily.
10703 (Output_section::get_input_sections): Change type of input_sections to
10704 list of Simple_input_section pointers. Checkpoint input section list
10705 lazily. Also handle relaxed input sections.
10706 (Output_section::add_input_section_for_script): Take a reference to
10707 a Simple_input_section object instead of Relobj pointer and section
10708 index as parameter. Handle relaxed input sections.
10709 (Output_section::save_states, Output_section::restore_states): New
10710 method definitions.
10711 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
10712 (Output_data::is_data_size_fixed): New method definition.
10713 (Output_data::reset_addresss_and_file_offset): Do not reset data size
10714 if it is fixed.
10715 (Output_data::address_and_file_offset_have_reset_values): New method
10716 definition.
10717 (Output_data::do_address_and_file_offset_have_reset_values): New method
10718 definition.
10719 (Output_data::set_data_size): Check that data size is not fixed.
10720 (Output_data::fix_data_size): New method definition.
10721 (Output_data::is_data_size_fixed_): New data member.
10722 (Output_section_headers::set_final_data_size): New method definition.
10723 (Output_section_headers::do_size): New method declaration.
10724 (Output_segment_headers::set_final_data_size): New method definition.
10725 (Output_segment_headers::do_size): New method declaration.
10726 (Output_file_header::set_final_data_size)::New method definition.
10727 (Output_file_header::do_size)::New method declaration.
10728 (Output_section_data::Output_section_data): Add new parameter
10729 is_data_size_fixed and use it to fix data size.
10730 (Output_data_const::Output_data_const): Adjust call to base class
10731 constructor and fix data size.
10732 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
10733 base class constructor and fix data size.
10734 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
10735 base class constructor and fix data size.
10736 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
10737 class constructor and fix data size.
10738 (Output_data_group::set_final_data_size): New method definition.
10739 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
10740 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
10741 class constructor and fix data size.
10742 (Output_relaxed_input_section): New class definition.
10743 (Output_section::Simple_input_section): New class definition.
10744 (Output_section::get_input_sections): Adjust parameter list.
10745 (Output_section::add_input_section_for_script): Same.
10746 (Output_section::save_states, Output_section::restore_states,
10747 Output_section::do_address_and_file_offset_have_reset_values,
10748 (Output_section::Input_section::Input_section): Handle
10749 RELAXED_INPUT_SECTION_CODE. Add new overload for
10750 Output_relaxed_input_section.
10751 (Output_section::Input_section::is_input_section,
10752 Output_section::Input_section::set_output_section): Handle relaxed
10753 input section.
10754 (Output_section::Input_section::is_relaxed_input_section,
10755 Output_section::Input_section::output_section_data,
10756 Output_section::Input_section::relaxed_input_section): New method
10757 definitions.
10758 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
10759 value.
10760 (Output_section::Input_section::u1_): Update comments.
10761 (Output_section::Input_section::u2_): Add new union member poris.
10762 (Output_section::Checkpoint_output_section): New classs definition.
10763 (Output_section::relax_input_section): New method declaration.
10764 (Output_section::checkpoint_): New data member.
10765 (Output_segment): Update comments.
10766 (Output_segment::Output_segment): Un-privatize copy constructor.
10767 (Output_segment::operator=): Un-privatize.
10768 * script-sections.cc (Output_section_element::Input_section_list):
10769 Change element type to Output_section::Simple_input_section.
10770 (Output_section_element_dot_assignment::set_section_addresses):
10771 Register output section data for relaxation clean up.
10772 (Output_data_exression::Output_data_expression): Adjust call to base
10773 constructor to fix data size.
10774 (Output_section_element_data::set_section_addresses): Register
10775 Output_data_expression object for relaxation clean up.
10776 (struct Input_section_info): Replace Relobj pointer and section index
10777 pair with Output_section::Simple_input_section and Convert struct to a
10778 class.
10779 (Input_section_sorter::operator()): Adjust access to
e1df38aa 10780 Input_section_info data member to use accessors.
20e6d0d6
DK
10781 (Output_section_element_input::set_section_addresses): Use layout
10782 parameter. Adjust code to use Output_section::Simple_input_section
10783 and Input_secction_info classes. Register filler for relaxation
10784 clean up.
10785 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
10786 and section index pair with Output_section::Simple_input_section
10787 class. Adjust code accordingly.
10788 (Phdrs_element::release_segment): New method definition.
10789 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
10790 segment list.
10791 (Script_sections::release_segments): New method definition.
10792 * gold/script-sections.h (Script_sections::release_segments): New
10793 method declaration.
10794 * gold/target.h (Target::may_relax, Target::relax,
10795 Target::do_may_relax, Target::do_relax): New method definitions.
10796
5e445df6
ILT
107972009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10798
10799 * arm.cc (has_signed_unsigned_overflow): New function.
10800 (Arm_relocate_functions::abs8): New function.
10801 (Target_arm::Scan::local): Handle R_ARM_ABS8.
10802 (Target_arm::Scan::global): Likewise.
10803 (Target_arm::relocate::relocate): Likewise.
10804 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10805 Likewise.
10806
8c604651 108072009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
10808
10809 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
10810 * testsuite/Makefile.in: Regenerate.
10811
1e9cc1c2
NC
108122009-09-11 Nick Clifton <nickc@redhat.com>
10813
10814 * po/gold.pot: Updated by the Translation project.
10815
6a89f575
CC
108162009-09-08 Cary Coutant <ccoutant@google.com>
10817
10818 * output.cc (Output_file::open): Add execute permission to empty file.
10819 * testsuite/Makefile.am (permission_test): New test.
10820 * testsuite/Makefile.in: Regenerate.
10821
fdcac5af
ILT
108222009-09-02 Ian Lance Taylor <iant@google.com>
10823
10824 * output.cc (Output_file::resize): Call map_no_anonymous rather
10825 than map.
10826
44453f85
ILT
108272009-09-01 Mikolaj Zalewski <mikolajz@google.com>
10828
10829 * gold.cc: Include "incremental.h".
10830 (queue_initial_tasks): Call Incremental_checker methods.
10831 * incremental.cc: Include "output.h".
10832 (Incremental_checker::can_incrementally_link_output_file): New
10833 method.
10834 * incremental.h (Incremental_checker): New class.
10835
10836 * output.cc (Output_file::open_for_modification): New method.
10837 (Output_file::map_anonymous): Changed return type to bool. Record
10838 map in base_ field.
10839 (Output_file::map_no_anonymous): New method, broken out of map.
10840 (Output_file::map): Use map_no_anonymous and map_anonymous.
10841 * output.h (class Output_file): Update declarations.
10842
293c1386
CC
108432009-08-24 Cary Coutant <ccoutant@google.com>
10844
10845 * options.h (Command_line::Pre_options): New class.
10846 (Command_line::pre_options): New member.
10847 * options.cc (gold::options::ready_to_register): New variable.
10848 (One_option::register_option): Do nothing if not registering options.
10849 Assert if same short option registered twice.
10850 (General_options::General_options): Turn off option registration when
10851 done constructing.
10852 (Command_line::Pre_options::Pre_options): New constructor.
10853
f773f3d2
CC
108542009-08-24 Cary Coutant <ccoutant@google.com>
10855
06a73cfe
CC
10856 * options.h (General_options::no_keep_memory): Remove incorrect
10857 short option.
f773f3d2 10858
a15af8e2
RW
108592009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10860
10861 * Makefile.am (am__skiplex, am__skipyacc): New.
10862 * Makefile.in: Regenerate.
10863
c462b41b
RW
108642009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10865
14ec8efd
RW
10866 * Makefile.am (AM_CPPFLAGS): Renamed from ...
10867 (INCLUDES): ... this.
10868 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
10869 (AM_CPPFLAGS): Renamed from ...
10870 (INCLUDE): ... this.
10871 * Makefile.in, testsuite/Makefile.in: Regenerate.
10872
81ecdfbb
RW
10873 * Makefile.in: Regenerate.
10874 * aclocal.m4: Likewise.
10875 * config.in: Likewise.
10876 * configure: Likewise.
10877 * testsuite/Makefile.in: Likewise.
10878
c462b41b
RW
10879 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
10880 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
10881 * Makefile.in: Regenerate.
10882 * testsuite/Makefile.in: Regenerate.
10883
2da73f13
CC
108842009-08-19 Cary Coutant <ccoutant@google.com>
10885
10886 * resolve.cc (Symbol_table::resolve): Don't complain about defined
10887 symbols in shared libraries overridden by hidden or internal symbols
10888 in the main program.
10889
2db70501
CD
108902009-08-19 Chris Demetriou <cgd@google.com>
10891
10892 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
10893 checking source file names in error messages.
10894
f733487b
DK
108952009-08-18 Doug Kwan <dougkwan@google.com>
10896
10897 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
10898 an elcpp::Ehdr as parameter. Adjust call to set_target.
10899 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
10900 an elfcpp::Ehdr as parameter.
10901 * object.cc (Object::set_target): Remove the version that looks up
10902 a target and sets it.
10903 (Sized_relobj::setup): Take a Target object instead of
10904 an elfcpp::Ehdr as parameter. Adjust call to set_target.
10905 (make_elf_sized_object): Find target and ask target to
10906 make an ELF object.
10907 * object.h: (Object::set_target): Remove the version that looks up
10908 a target and sets it.
10909 (Sized_relobj::setup): Take a Target object instead of
10910 an elfcpp:Ehdr as parameter.
10911 * target.cc: Include dynobj.h.
10912 (Target::do_make_elf_object_implementation): New.
2e702c99 10913 (Target::do_make_elf_object): New.
f733487b
DK
10914 * target.h (Target::make_elf_object): New template declaration.
10915 (Target::do_make_elf_object): New method declarations.
10916 (Target::do_make_elf_object_implementation): New template declaration.
10917
cc70f101
ILT
109182009-08-14 Ian Lance Taylor <iant@google.com>
10919
10920 * gold.h (FUNCTION_NAME): Define.
10921 (gold_unreachable): Use FUNCTION_NAME.
10922
ef5e0cb1
ST
109232009-08-12 Sriraman Tallam <tmsriram@google.com>
10924
10925 * icf.cc (Icf::find_identical_sections): Issue a warning when a
10926 symbol in the --keep-unique list is not found.
10927
48c187ce
ST
109282009-08-12 Sriraman Tallam <tmsriram@google.com>
10929
10930 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
10931 been maked as --keep-unique.
10932 (Icf::unfold_section): New function.
10933 * icf.h (Icf::unfold_section): New function.
10934 * options.h (General_options::keep_unique): New option.
10935 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
10936 * testsuite/Makefile.in: Regenerate.
10937 * testsuite/icf_keep_unique_test.sh: New file.
10938 * testsuite/icf_keep_unique_test.cc: New file.
10939
645afe0c
CC
109402009-08-12 Cary Coutant <ccoutant@google.com>
10941
10942 PR 10471
10943 * resolve.cc (Symbol_table::resolve): Check for references from
10944 dynamic objects to hidden and internal symbols.
10945 * testsuite/Makefile.am (hidden_test.sh): New test.
10946 * testsuite/Makefile.in: Regenerate.
10947 * testsuite/hidden_test.sh: New script.
10948 * testsuite/hidden_test_1.c: New test source.
10949 * testsuite/hidden_test_main.c: New test source.
10950
11af873f
DK
109512009-08-11 Doug Kwan <dougkwan@google.com>
10952
10953 * arm.cc: Update comments.
10954 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
10955 segment to locate the .ARM.exidx section if present.
10956
b9f7d72d
DK
109572009-08-09 Doug Kwan <dougkwan@google.com>
10958
10959 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
10960 patch.
10961
ddd3c53c
ST
109622009-08-07 Sriraman Tallam <tmsriram@google.com>
10963 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
10964 compiler warnings.
10965
27721062
ST
109662009-08-06 Sriraman Tallam <tmsriram@google.com>
10967
10968 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
10969 valid tls_segment only for non-debug-section relocations.
10970 * testsuite/Makefile.am: Add gc_tls_test.
10971 * testsuite/Makefile.in: Regenerate.
10972 * testsuite/gc_tls_test.cc: New file.
10973 * testsuite/gc_tls_test.sh: New file.
10974
ef15dade 109752009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 10976
ef15dade
ST
10977 * icf.cc: New file.
10978 * icf.h: New file.
10979 * Makefile.am (CCFILES): Add icf.cc.
10980 (HFILES): Add icf.h
10981 * Makefile.in: Regenerate.
10982 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
10983 * gc.h (gc_process_relocs): Populate lists used by icf to contain
10984 section, symbol and addend information for the relocs.
10985 * gold.cc (queue_middle_tasks): Call identical code folding.
10986 * gold.h: Add defines for multimap.
10987 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
10988 to the call of finalize_local_symbols.
10989 * main.cc (main): Create object of class Icf.
10990 * object.cc (Sized_relobj::do_layout): Allow this function to be
10991 called twice during icf.
10992 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
10993 to sections marked as identical by icf.
10994 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
10995 when available.
10996 (Sized_relobj::do_section_entsize): New function.
10997 * object.h (Object::section_entsize): New function.
10998 (Object::do_section_entsize): New pure virtual function.
10999 (Relobj::finalize_local_symbols): Add new parameter.
11000 (Relobj::do_section_entsize): New function.
11001 * options.h (General_options::icf): New option.
11002 (General_options::icf_iterations): New option.
11003 (General_options::print_icf_sections): New option.
11004 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
11005 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
11006 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
11007 icf.
11008 * symtab.cc (Symbol_table::is_section_folded): New function.
11009 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
11010 to sections marked as identical by icf.
11011 * symtab.h (Symbol_table::set_icf): New function.
11012 (Symbol_table::icf): New function.
11013 (Symbol_table::is_section_folded): New function.
11014 (Symbol_table::icf_): New data member.
11015 * target-reloc.h (relocate_section): Ignore sections folded by icf.
11016 * testsuite/Makefile.am: Add commands to build icf_test.
11017 * testsuite/Makefile.in: Regenerate.
11018 * testsuite/icf_test.sh: New file.
11019 * testsuite/icf_test.cc: New file.
11020
c3b65ac4
CD
110212009-07-24 Chris Demetriou <cgd@google.com>
11022
11023 * layout.cc (is_compressible_debug_section): Fix incorrect
11024 comment about compressed section names.
11025
1caf2c51
ILT
110262009-07-20 Ian Lance Taylor <ian@airs.com>
11027
11028 PR 10419
11029 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
11030
1ef4d87f
ILT
110312009-07-16 Ian Lance Taylor <iant@google.com>
11032
11033 PR 10400
11034 * layout.h: #include <map>.
11035 (class Kept_section): Change from struct to class. Add accessors
11036 and setters. Add section size to Comdat_group mapping. Change
11037 Comdat_group to std::map. Add is_comdat_ field. Add
11038 linkonce_size field in union.
11039 (class Layout): Update declaration of find_or_add_kept_section.
11040 Don't declare find_kept_object.
11041 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
11042 parameter. Add object, shndx, is_comdat, and is_group_name
11043 parameters. Change all callers. Adjust for new Kept_section.
11044 (Layout::find_kept_object): Remove.
11045 * object.cc (Sized_relobj::include_section_group): Update use of
11046 Kept_section. Rename secnum to shndx. Only record
11047 Kept_comdat_section if sections are the same size.
11048 (Sized_relobj::include_linkonce_section): Update use of
11049 Kept_section. Only record Kept_comdat_section if sections are the
11050 same size. Set size of linkonce section.
11051 (Sized_relobj::map_to_kept_section): Update call to
11052 get_kept_comdat_section.
11053 * object.h (class Sized_relobj): Rename fields in
11054 Kept_comdat_section to drop trailing underscores; change object
11055 field to Relobj*. Change Kept_comdat_section_table to store
11056 struct rather than pointer.
11057 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
11058 Add kept_object and kept_shndx parameters. Change all callers.
11059 (Sized_relobj::get_kept_comdat_section): Change return type to
11060 bool. Add kept_object and kept_shndx parameters. Change all
11061 callers.
11062 * plugin.cc (Pluginobj::include_comdat_group): Update call to
11063 Layout::find_or_add_kept_section.
11064
37c3b7b0
ILT
110652009-07-09 Ian Lance Taylor <iant@google.com>
11066
11067 * merge.cc (Object_merge_map::initialize_input_to_output_map):
11068 Reserve space in the hash table.
11069
98fa85cb
ILT
110702009-07-06 Mikolaj Zalewski <mikolajz@google.com>
11071
11072 * fileread.cc (File_read::get_mtime): New method.
11073 * fileread.h (Timespec): New structure.
11074 (File_read::get_mtime): New method.
11075 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
11076 Renamed from timestamp_nsec.
11077 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
11078 Elf_Xword.
e1df38aa 11079 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 11080 timestamp_nsec.
e1df38aa 11081 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
11082 (Incremental_inputs::report_obejct): Save mtime; style fix.
11083 (Incremental_inputs::report_script): Save mtime; style fix.
11084 (Incremental_inputs::finalize_inputs): Style fix.
11085 (Incremental_inputs::finalize): Style fix.
11086 (Incremental_inputs::create_input_section_data): Store inputs
11087 mtime.
11088 * incremental.h (Incremental_inputs::report_script): Add mtime
11089 argument.
11090 (Incremental_inputs::Input_info::Input_info): Intialize only one
11091 union member.
11092 (Incremental_inputs::Input_info::archive): Move to nameless
11093 union.
11094 (Incremental_inputs::Input_info::obejct): Move to nameless union.
11095 (Incremental_inputs::Input_info::script): Move to nameless union.
11096 (Incremental_inputs::mtime): New field.
11097 * script.cc (read_input_script): Pass file mtime to
11098 Incremental_input.
11099 * script.h (Script_info::inputs): Style fix.
11100
c9d70757
ILT
111012009-07-01 Ian Lance Taylor <ian@airs.com>
11102
11103 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
11104 instead of 32.
11105
9c547ec3
ILT
111062009-06-24 Ian Lance Taylor <iant@google.com>
11107
11108 PR 10156
11109 * layout.cc (Layout::choose_output_section): If we find an
11110 existing section, update the flags.
11111 (Layout::create_notes): New function, broken out of
11112 Layout::finalize.
11113 (Layout::finalize): Don't create note sections.
11114 (Layout::create_note): Don't crash if linker script discards
11115 section.
11116 (Layout::create_gold_note): Likewise.
11117 (Layout::create_build_id): Likewise. Don't set
11118 after_input_sections on the section.
11119 (Layout::create_executable_stack_info): Remove target parameter.
11120 Change caller.
11121 * layout.h (class Layout): Declare create_notes. Update
11122 declaration of create_executable_stack_info.
11123 * gold.cc (queue_middle_tasks): Call create_notes.
11124 * output.cc (Output_section::update_flags_for_input_section): Move
11125 here from output.h. If SHF_ALLOC flag is newly set, mark address
11126 invalid.
11127 * output.h (Output_data::mark_address_invalid): New function.
11128 (class Output_section): Only declare, not define,
11129 update_flags_for_input_section. Remove set_flags.
11130
55458500
ILT
111312009-06-24 Ian Lance Taylor <iant@google.com>
11132
11133 * script-sections.cc (Output_section_definition::
11134 set_section_addresses): Rename shadowing local load_address to
11135 laddr.
11136
1307d6cd
ILT
111372009-06-24 Ian Lance Taylor <iant@google.com>
11138
11139 PR 10244
11140 * reloc.cc (relocate_sections): Skip empty relocation sections.
11141
ec3f783e
ILT
111422009-06-23 Ian Lance Taylor <iant@google.com>
11143
11144 PR 10156
11145 * layout.cc (Layout::create_note): Use choose_output_section
11146 rather than make_output_section.
11147
459c9f1c
ILT
111482009-06-23 Ian Lance Taylor <iant@google.com>
11149
11150 PR 10237
11151 * options.cc (General_options::parse_V): Set printed_version_.
11152 (General_options::General_options): Initialize printed_version_.
11153 * options.h (class General_options): Add printed_version_ field.
11154 * gold.cc (queue_initial_tasks): If there are no input files,
11155 don't give a fatal error if we printed the version information.
11156 (queue_middle_tasks): If using -r with a shared object, give a
11157 fatal error rather than an ordinary error.
11158
1518dc8f
ILT
111592009-06-23 Ian Lance Taylor <iant@google.com>
11160
11161 PR 10219
11162 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
11163 (Layout::make_output_section): Set have_stabstr_section_ if we see
11164 a .stab*str section.
11165 (Layout::finalize): Call link_stabs_sections.
11166 (Layout::link_stabs_sections): New file.
11167 * layout.h (class Layout): Add have_stabstr_section_ field.
11168 Declare link_stabs_sections.
11169
3d857b98
DK
111702009-06-23 Doug Kwan <dougkwan@google.com>
11171
11172 * Makefile.am (libgold_a_LIBADD): New.
11173 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 11174 * Makefile.in: Regenerate.
3d857b98
DK
11175 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
11176 * configure: Regenerate.
11177 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
11178 * fileread.cc: Include sys/state.h
11179 * gold.h: Declare memmem and strndup if found missing.
11180 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
11181
0639a6f6
ILT
111822009-06-23 Ian Lance Taylor <iant@google.com>
11183
11184 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
11185 * configure: Rebuild.
11186
8d63875c
ILT
111872009-06-23 Ian Lance Taylor <iant@google.com>
11188
11189 PR 10147
11190 * object.cc (Object::section_contents): Don't try to get a view if
11191 the section has length zero.
11192 (Object::handle_gnu_warning_section): If the section is empty, use
11193 the name of the section as the warning.
11194
f7c8a183
ILT
111952009-06-23 Ian Lance Taylor <iant@google.com>
11196
11197 PR 10133
11198 * stringpool.h (class Stringpool_template): Add optimize_ field.
11199 (Stringpool_template::set_optimize): New function.
11200 * stringpool.cc (Stringpool_template::Stringpool_template):
11201 Initialize optimize_ field.
11202 (Stringpool_template::set_string_offsets): Test local optimize
11203 fild rather than parameter.
11204 * layout.cc (Layout::Layout): Call set_optimize on the section
11205 name stringpool.
11206
e6a307ba
ILT
112072009-06-22 Ian Lance Taylor <iant@google.com>
11208
11209 PR 10030
11210 * yyscript.y: Parse TARGET.
11211 * script.cc (script_set_target): New function.
11212 * script-c.h (script_set_target): Declare.
11213 * options.cc (General_options::string_to_object_format): Rename
11214 from string_to_object_format in anonymous namespace. Change
11215 callers.
11216 * options.h (class General_options): Declare
11217 string_to_object_format.
11218
3ee173de
ILT
112192009-06-22 Ian Lance Taylor <iant@google.com>
11220
11221 * script-sections.cc (Script_sections::create_segments): Don't put
11222 program headers in a PT_LOAD segment if -n or -N.
11223
112242009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
11225
11226 PR 10141
11227 * options.h (class General_options): Add -z lazy and -z now. Sort
11228 -z options into alphabetical order.
11229 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
11230
cd6739a1 112312009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
11232
11233 * layout.cc (Layout::make_output_section): Call
11234 Target::new_output_section.
11235 (Layout::attach_allocated_section_to_segment): Put large section
11236 sections in a separate load segment with the large segment flag
11237 set.
11238 (Layout::segment_precedes): Sort large data segments after other
11239 load segments.
11240 (align_file_offset): New static function.
11241 (Layout::set_segment_offsets): Use align_file_offset.
11242 * output.h (class Output_section): Add is_small_section_ and
11243 is_large_section_ fields.
11244 (Output_section::is_small_section): New function.
11245 (Output_section::set_is_small_section): New function.
11246 (Output_section::is_large_section): New function.
11247 (Output_section::set_is_large_section): New function.
11248 (Output_section::is_large_data_section): New function.
11249 (class Output_segment): Add is_large_data_segment_ field.
11250 (Output_segment::is_large_data_segment): New function.
11251 (Output_segment::set_is_large_data_segment): New function.
11252 * output.cc (Output_section::Output_section): Initialize new
11253 fields.
11254 (Output_segment::Output_segment): Likewise.
11255 (Output_segment::add_output_section): Add assertion that large
11256 data sections always go in large data segments. Force small data
11257 sections to the end of the list of data sections. Force small BSS
11258 sections to the start of the list of BSS sections. For large BSS
11259 sections to the end of the list of BSS sections.
11260 * symtab.h (class Symbol): Declare is_common_shndx.
11261 (Symbol::is_defined): Check Symbol::is_common_shndx.
11262 (Symbol::is_common): Likewise.
11263 (class Symbol_table): Define enum Commons_section_type. Update
11264 declarations. Add small_commons_ and large_commons_ fields.
11265 * symtab.cc (Symbol::is_common_shndx): New function.
11266 (Symbol_table::Symbol_table): Initialize new fields.
11267 (Symbol_table::add_from_object): Put small and large common
11268 symbols in the right list.
11269 (Symbol_table::sized_finalized_symbol): Check
11270 Symbol::is_common_shndx.
11271 (Symbol_table::sized_write_globals): Likewise.
11272 * common.cc (Symbol_table::do_allocate_commons): Allocate new
11273 common symbol lists. Don't call do_allocate_commons_list if the
11274 list is empty.
11275 (Symbol_table::do_allocate_commons_list): Remove is_tls
11276 parameter. Add comons_section_type parameter. Change all
11277 callers. Handle small and large common symbols.
11278 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
11279 Symbol::is_common_shndx.
11280 * resolve.cc (symbol_to_bits): Likewise.
11281 * target.h (Target::small_common_shndx): New function.
11282 (Target::small_common_section_flags): New function.
11283 (Target::large_common_shndx): New function.
11284 (Target::large_common_section_flags): New function.
11285 (Target::new_output_section): New function.
11286 (Target::Target_info): Add small_common_shndx, large_common_shndx,
11287 small_common_section_flags, and large_common_section_flags
11288 fields.
11289 (Target::do_new_output_section): New virtual function.
11290 * arm.cc (Target_arm::arm_info): Initialize new fields.
11291 * i386.cc (Target_i386::i386_info): Likewise.
11292 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
11293 Likewise.
11294 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
11295 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
11296 (Target_x86_64::do_new_output_section): New function.
11297 * configure.ac: Define conditional MCMODEL_MEDIUM.
11298 * testsuite/Makefile.am (check_PROGRAMS): Add large.
11299 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
11300 (large_LDFLAGS): Define.
11301 * testsuite/large.c: New file.
11302 * testsuite/testfile.cc (Target_test::test_target_info):
11303 Initialize new fields.
11304 * configure, testsuite/Makefile.in: Rebuild.
11305
bb04269c
DK
113062009-06-05 Doug Kwan <dougkwan@google.com>
11307
11308 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 11309 * Makefile.in: Regenerate.
bb04269c
DK
11310 * i386.cc (class Target_i386): Define new virtual method to
11311 override do_is_local_label_name in parent.
11312 * object.cc (Sized_relobj::do_count_local_symbols): Discard
11313 local symbols if --discard-locals or -X is given.
11314 * options.h (class General_options): Declare new options
11315 '--discard-locals' and '-X' for discarding locals.
11316 * target.h (class Target): Define new methods is_local_label_name.
11317 Declare new virtual method do_is_local_label_name.
11318 * target.cc: New file.
11319 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
11320 (check_SCRIPTS): Add discard_locals_test.sh.
11321 (check_DATA): Add discard_local_tests.syms.
11322 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
11323 (discard_local_tests.syms, discard_locals_test.o): New make rules.
11324 * testsuite/Makefile.in: Regenerate.
11325 * testsuite/discard_locals_test.c: New file.
11326 * testsuite/discard_locals_test.sh: Same.
11327
805bb01c
DK
113282009-06-05 Doug Kwan <dougkwan@google.com>
11329
11330 * object.cc (Sized_relobj::Sized_relobj): Initialize
11331 discarded_eh_frame_shndx_ to -1U.
11332 (Sized_relobj::do_layout): Record index of a discard .eh_frame
11333 section.
11334 (Sized_relobj::do_count_local_symbols): Skip local symbols in
11335 a discarded .eh_frame section.
11336 (Sized_relobj::do_finalize_local_symbols): Ditto.
11337 * object.h (class Sized_relobj): Declare new member
11338 discarded_eh_frame_shndx_.
11339 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
11340 (local_labels_test.o, local_labels_test): New rules.
11341 * testsuite/Makefile.in: Regenerate.
11342
1dcd334d
DK
113432009-06-04 Doug Kwan <dougkwan@google.com>
11344
11345 * layout.cc (Layout::section_name_mapping): Add mapping for
11346 special ARM sections.
11347
96d49306
DK
113482009-06-03 Doug Kwan <dougkwan@google.com>
11349
11350 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
11351 (utils::has_overflow): Same.
11352
dff16297
ILT
113532009-06-03 Ian Lance Taylor <iant@google.com>
11354
11355 * layout.cc (Layout::section_name_mapping): New array, replacing
11356 Layout::linkonce_mapping.
11357 (Layout::section_name_mapping_count): New variable, replacing
11358 Layout::linkonce_mapping_count.
11359 (Layout::linkonce_output_name): Remove.
11360 (Layout::output_section_name): Rewrite.
11361 * layout.h (class Layout): Rename Linkonce_mapping to
11362 Section_name_mapping, linkonce_mapping to section_name_mapping,
11363 linkonce_mapping_count to section_name_mapping_count. Don't
11364 declare linkonce_output_name.
11365
c121c671
DK
113662009-06-03 Doug Kwan <dougkwan@google.com>
11367
11368 * gold/arm.cc (namespace utils): New.
11369 (Target_arm::reloc_is_non_pic): Define new method.
11370 (class Arm_relocate_functions): New.
11371 (Target_arm::Relocate::relocate): Handle relocation types used by
11372 Android.
11373
07800fab
ILT
113742009-06-03 Ian Lance Taylor <iant@google.com>
11375
11376 * arm.cc (Target_arm::scan::global): Use || instead of |.
11377
c121c671
DK
113782009-06-02 Doug Kwan <dougkwan@google.com>
11379
11380 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
11381 issued_non_pic_error_.
11382 (class Target_arm::Scan): Declare new method check_non_pic.
11383 Define new method symbol_needs_plt_entry.
11384 Declare new data member issued_non_pic_error_.
11385 (class Target_arm::Relocate): Declare new method
11386 should_apply_static_reloc.
11387 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
11388 (Target_arm::Scan::check_non_pic): Define new method.
11389 (Target_arm::Scan::local): Handle a small subset of reloc types used
11390 by Android.
11391 (Target_arm::Scan::local): Same.
11392 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
11393
b19b0c6d
ILT
113942009-05-31 Mikolaj Zalewski <mikolajz@google.com>
11395
11396 * incremental.cc (Incremental_inputs::report_command_line): Filter
11397 out --incremental-* options.
11398
94cdfcff
DK
113992009-05-29 Doug Kwan <dougkwan@google.com>
11400
11401 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
11402 template class.
11403 (class Target_arm): Update comment.
11404 (Target_arm::Target_arm): Initialize new data members GOT_,
11405 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
11406 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
11407 and Target_arm::rel_dyn_section.
11408 Declare new_enum Target_arm::Got_type.
11409 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
11410 and DYNBSS_.
11411 Update commments for member do_dynsym_value.
11412 (Target_arm::got_size, Target_arm::plt_section,
11413 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
11414 new methods inside class defintion.
11415 (Target_arm::got_section): Define new method.
11416 (Target_arm::rel_dyn_section): Same.
11417 (Output_data_plt_arm): New template class.
11418 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
11419 (Output_data_plt_arm:do_adjust_output_section): Define new method.
11420 (Output_data_plt_arm::add_entry): Same.
11421 (Output_data_plt_arm::first_plt_entry): Define new
11422 static data member for PLT instruction template.
11423 (Output_data_plt_arm::plt_entry): Same.
11424 (Output_data_plt_arm::do_write): Define new method.
11425 (Target_arm::make_plt_entry): Same.
11426 (Target_arm::do_finalize_sections): Same.
11427 (Target_arm::do_dynsym_value): Same.
11428
4a657b0d
DK
114292009-05-28 Doug Kwan <dougkwan@google.com>
11430
11431 * Makefile.am (TARGETSOURCES): Add arm.cc.
11432 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
11433 * Makefile.in: Regenerate.
11434 * arm.cc: New file.
11435 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
11436
e7ae8c36
DK
114372009-05-26 Doug Kwan <dougkwan@google.com>
11438
11439 * options.cc (General_options::parse_exclude_libs). Fix a comment.
11440 (General_options::check_excluded_libs): Strip off directories in
11441 archive name before matching like GNU ld does.
11442 * testsuite/Makefile.am (MOSTLYCLEANFILES,
11443 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
11444 (exclude_libs_test_LDFLAGS): Add linker option
11445 -Wl,--exclude-libs,libexclude_libs_test_3
11446 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
11447 an explicit archive without using -l.
11448 (alt/libexclude_libs_test_3.a): New make rule.
11449 * testsuite/Makefile.in: Regenerate.
11450 * testsuite/exclude_libs_test.c : Declare lib3_default().
11451 (main): Call it.
11452 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
11453 * exclude_libs_test_3.c: New file.
11454
f12e7348
NC
114552009-05-26 Nick Clifton <nickc@redhat.com>
11456
11457 * po/id.po: New Indonesian translation.
11458 * po/gold.pot: Updated template file.
11459
4daadc0d
ST
114602009-05-22 Sriraman Tallam <tmsriram@google.com>
11461
e1df38aa 11462 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
11463 gc_comdat_test files. Add -Wl,--gc-sections to build
11464 gc_comdat_test.
11465 * testsuite/Makefile.in: Regenerate.
11466 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
11467
531813ad
ST
114682009-05-21 Sriraman Tallam <tmsriram@google.com>
11469
11470 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
11471 kept comdat section was garbage collected.
11472 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
11473 * testsuite/Makefile.in: Regenerate.
11474 * testsuite/gc_comdat_test.sh: New file.
11475 * testsuite/gc_comdat_test_1.cc: New file.
11476 * testsuite/gc_comdat_test_2.cc: New file.
11477
65514900
CC
114782009-05-19 Doug Kwan <dougkwan@google.com>
11479
11480 * archive.cc (Archive::Archive): Move constructor from archive.h
11481 to here. Initialize no_export_.
11482 (Archive::get_elf_object_for_member): Set no_export flag of object.
11483 * archive.h (Archive::Archive): Move constructor body to
11484 archive.cc.
11485 (Archive::no_export): New method.
11486 (Archive::no_export_): New field.
11487 * object.h (Object::Object): Initialize no_export_ to false.
11488 (Object::no_export, Object::set_no_export): New methods.
11489 (Object::no_export_): New field.
11490 * options.cc (General_options::parse_exclude_libs): New method.
11491 (General_options::check_excluded_libs) Same.
11492 * options.h (exclude_libs): New option.
11493 (General_options::check_excluded_libs): New method declaration.
11494 (General_options::excluded_libs_): New field.
11495 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
11496 default or protected visibility if an object has no-export flag set.
11497 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
11498 (check_SCRIPTS): Add exclude_libs_test.sh.
11499 (check_DATA): Add exclude_libs_test.syms.
11500 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
11501 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
11502 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
11503 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
11504 (exclude_libs_test.syms, libexclude_libs_test_1.a,
11505 libexclude_libs_test_2.a): New rules.
11506 * testsuite/Makefile.in: Regenerate.
11507 * testsuite/exclude_libs_test.c: New file.
11508 * testsuite/exclude_libs_test.sh: Ditto.
11509 * testsuite/exclude_libs_test_1.c: Ditto.
11510 * testsuite/exclude_libs_test_2.c: Ditto.
11511
1b77ea50
ILT
115122009-05-15 Ian Lance Taylor <iant@google.com>
11513
11514 * configure.ac: Check for declarations for cases where libiberty.h
11515 checks HAVE_DECL_xxx.
11516 * configure, config.in: Rebuild.
11517
072fe7ce
ILT
115182009-05-15 Mikolaj Zalewski <mikolajz@google.com>
11519
11520 * gold.h (Incremental_argument_list): Remove (invalid) forward
11521 declaration.
11522 * incremental.cc (Incremental_inputs::report_achive): New method.
11523 (Incremental_inputs::report_object): New method.
11524 (Incremental_inputs::report_script): New method.
11525 (Incremental_inputs::finalize_inputs): New method.
11526 (Incremental_inputs::finalize): Call finalize_inputs().
11527 (Incremental_inputs::sized_create_incremental_inputs_section_data):
11528 Create inputs entries.
11529 * incremental.h (Incremental_input_type): New enum.
11530 (Incremental_inputs::Incremental_input): Initialize new fields.
11531 (Incremental_inputs::report_inputs): New method.
11532 (Incremental_inputs::report_achive): New method.
11533 (Incremental_inputs::report_object): New method.
11534 (Incremental_inputs::report_script): New method.
11535 (Incremental_inputs::finalize_inputs): New method.
11536 (Incremental_inputs::Input_info): New struct.
11537 (Incremental_inputs::Input_info_map): New typedef.
11538 (Incremental_inputs::lock_): New field.
11539 (Incremental_inputs::Inputs_): New field.
11540 (Incremental_inputs::Inputs_map): New field.
11541 * main.cc (main): Call Incremental_input::report_inputs.
11542 * options.h (Input_argument_list): Typedef moved from
11543 Input_arguments.
11544 (Input_file_group::Files): Remove, use ::Input_argument_list.
11545 (Input_file_group::Input_argument_list): Remove, use
11546 ::Input_argument_list.
11547 * plugin.cc (Plugin_manager::add_input_file): Add error in
11548 incremental build.
11549 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
11550 functions.
11551 * script.cc (read_input_script): Call
11552 Incremental_input::report_script.
11553 * script.h (Script_info): New class.
11554
b0481b0b
ILT
115552009-04-27 Ian Lance Taylor <iant@google.com>
11556
11557 * x86_64.cc (do_adjust_output_section): Set entsize to
11558 plt_entry_size.
11559
b22a5a41 115602009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
11561
11562 * output.cc (Output_file::close): After short writes, continue
11563 writing from the correct offset in the buffer being written.
11564
40fde488
CD
115652009-04-23 Chris Demetriou <cgd@google.com>
11566
11567 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
11568 * configure: Regenerate.
11569 * config.in: Regenerate.
11570 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
11571 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
11572
3ce2c28e
ILT
115732009-04-21 Mikolaj Zalewski <mikolajz@google.com>
11574
11575 * incremental.cc (Incremental_inputs_header_data): Renamed from
11576 Incremental_input_header_data.
11577 (Incremental_inputs_header_data::data_size): New field.
11578 (Incremental_inputs_header_data::put_input_file_count): Renamed
11579 from input_file_count.
11580 (Incremental_inputs_header_data::put_command_line_offset): Renamed
11581 from command_line_offset.
11582 (Incremental_inputs_header_data::put_reserved): Renamed from
11583 put_reserved.
11584 (Incremental_inputs_entry_data): Renamed from
11585 Incremental_input_entry_data.
11586 (Incremental_inputs_entry_data::data_size): New field.
11587 (Incremental_inputs::report_command_line): New method.
11588 (Incremental_inputs::finalize): New method.
11589 (Incremental_inputs::create_incremental_inputs_data): New method.
11590 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
11591 * incremental.h: New file.
11592 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 11593 (Layout::finalize): Create incremental inputs section in
3ce2c28e 11594 incremental builds.
703d02da 11595 (Layout::create_incremental_info_sections): New method.
3ce2c28e 11596 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
11597 (Layout::create_incremental_info_sections): New method.
11598 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
11599 * main.cc (main): Notify Incremental_input of the command line.
11600
e55bde5e
ILT
116012009-04-01 Ian Lance Taylor <iant@google.com>
11602 Mikolaj Zalewski <mikolajz@google.com>
11603
11604 * gold.h (reserve_unordered_map): Define, three versions, one for
11605 each version of Unordered_map.
11606 * layout.cc (Layout::Layout): Remove options parameter. Add
11607 number_of_input_files parameter. Don't initialize options_.
11608 Initialize number_of_input_files_ and resized_signatures_. Move
11609 sections_are_attached_.
11610 (Layout::layout_group): Reserve space for group_signatures_.
11611 (Layout::find_or_add_kept_section): Change name parameter to be a
11612 reference. Resize signatures_ map when it gets large enough.
11613 (Layout::layout_eh_frame): Use parameters->options() instead of
11614 this->options_.
11615 (Layout::make_output_section): Likewise.
11616 (Layout::attach_allocated_section_to_segment): Likewise.
11617 (Layout::finalize, Layout::create_executable_stack): Likewise.
11618 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
11619 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
11620 * layout.h (class Layout): Update declarations. Remove options_
11621 field. Add number_of_input_files_ and resized_signatures_
11622 fields. Move sections_are_attached_ field.
11623 * main.cc (main): Pass number of input files to Layout
11624 constructor. Don't pass options.
11625
154b857c
ILT
116262009-03-30 Ian Lance Taylor <iant@google.com>
11627
11628 * ffsll.c (ffsll): Correct implementation.
11629
2f35ab9b
ILT
116302009-03-27 Ian Lance Taylor <iant@google.com>
11631
fd03461a
ILT
11632 * ffsll.c: New file.
11633 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
11634 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
11635 * ftruncate.c (ftruncate): Declare before definition.
11636 * mremap.c (mremap): Likewise.
11637 * pread.c (pread): Likewise.
11638 * configure, Makefile.in, config.in: Rebuild.
11639
2f35ab9b
ILT
11640 * mremap.c: New file.
11641 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
11642 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
11643 (mremap): Declare if HAVE_MREMAP is not defined.
11644 * configure, Makefile.in, config.in: Rebuild.
11645
33aea2fd
CC
116462009-03-27 Cary Coutant <ccoutant@google.com>
11647
11648 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
11649 position independent.
11650 * sparc.cc (Target_sparc::check_non_pic): Likewise.
11651 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
11652
6d479619
CC
116532009-03-24 Cary Coutant <ccoutant@google.com>
11654
11655 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
11656 an executable.
11657 (needs_dynamic_reloc): Likewise.
11658
afc06bb8
ILT
116592009-03-24 Ian Lance Taylor <iant@google.com>
11660
11661 * yyscript.y (file_cmd): Recognize EXTERN.
11662 (extern_name_list, extern_name_list_body): New nonterminals.
11663 * script.cc (script_add_extern): Define.
11664 * script-c.h (script_add_extern): Declare.
11665
f6060a4d
ILT
116662009-03-24 Rafael Avila de Espindola <espindola@google.com>
11667
11668 * object.cc (is_elf_object): Define.
11669 * object.h (is_elf_object): Declare.
11670 * archive.cc (Archive::get_elf_object_for_member): Call
11671 is_elf_object.
33aea2fd 11672 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 11673
26736d8e
ILT
116742009-03-24 Elliott Hughes <enh@google.com>
11675
11676 * output.cc (Output_file::map_anonymous): Define.
11677 (Output_file::map): Use map_anonymous. If the regular mmap fails,
11678 try an anonymous one. Report the size if the mmap fails.
11679 * output.h (class Output_file): Declare map_anonymous.
11680
22fd9730
ILT
116812009-03-24 Ian Lance Taylor <iant@google.com>
11682
11683 * target-select.cc (instantiate_target): Don't acquire the lock if
11684 the instantiated_target_ field has already been set.
11685
cb010894
ILT
116862009-03-23 Ian Lance Taylor <iant@google.com>
11687
7f055c20
ILT
11688 * gold-threads.h (class Initialize_lock): Define.
11689 * gold-threads.cc (class Initialize_lock_once): Define.
11690 (initialize_lock_control): New static variable.
11691 (initialize_lock_pointer): New static variable.
11692 (initialize_lock_once): New static function.
11693 (Initialize_lock::Initialize_lock): Define.
11694 (Initialize_lock::initialize): Define.
11695 * target-select.h: Include "gold-threads.h".
11696 (class Target_selector): Add lock_ and initialize_lock_ fields.
11697 Don't define instantiate_target, just declare it.
11698 * target-select.cc (Target_selector::Target_selector): Initialize
11699 new fields.
11700 (Target_selector::instantiate_target): Define.
11701 * descriptors.h: Include "gold-threads.h".
11702 (class Descriptors): Add initialize_lock_ field.
11703 * descriptors.cc (Descriptors::Descriptors): Initialize new
11704 field.
11705 (Descriptors::open): Use initialize_lock_ field
11706 * errors.h (class Errors): Add initialize_lock_ field.
11707 * errors.cc (Errors::Errors): Initialize new field.
11708 (Errors::initialize_lock): Use initialize_lock_ field.
11709 * powerpc.cc (class Target_selector_powerpc): Remove
11710 instantiated_target_ field. In do_recognize call
11711 instantiate_target rather than do_instantiate_target. In
11712 do_instantiate_target just allocate a new target.
11713 * sparc.cc (class Target_selector_sparc): Likewise.
11714
36959681
ILT
11715 * freebsd.h: New file.
11716 * i386.cc: Include "freebsd.h".
11717 (Target_i386): Derive from Target_freebsd rather than
11718 Sized_target.
11719 (Target_selector_i386): Derive from Target_selector_freebsd rather
11720 than Target_selector.
11721 * x86_64.cc: Include "freebsd.h".
11722 (Target_x86_64): Derive from Target_freebsd rather than
11723 Sized_target.
11724 (Target_selector_x86_64): Derive from Target_selector_freebsd
11725 rather than Target_selector.
11726 * target.h (class Target): Add adjust_elf_header and
11727 do_adjust_elf_header.
11728 * output.cc (Output_file_header:: do_sized_write): Call target
11729 adjust_elf_header routine.
11730 * configure.tgt: Set targ_osabi.
11731 * configure.ac: Define GOLD_DEFAULT_OSABI.
11732 * parameters.cc (Parameters::default_target): Pass
11733 GOLD_DEFAULT_OSABI to select_target.
11734 * target-select.h (class Target_selector): Make instantiate_target
11735 protected rather than private.
11736 * Makefile.am (HFILES): Add freebsd.h.
11737 * configure, Makefile.in, config.in: Rebuild.
11738
cb010894
ILT
11739 * merge.cc (do_add_input_section): Correct pend value. Change
11740 message about last entry not being null terminated from error to
11741 warning.
11742
0e879927
ILT
117432009-03-20 Mikolaj Zalewski <mikolajz@google.com>
11744
11745 * incremental.cc: New file.
11746 * Makefile.am (CCFILES): Add incremental.cc.
11747 * Makefile.in: Rebuild.
11748
41105937
PP
117492009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
11750
11751 * layout.cc (Layout::output_section_name): Preserve names
11752 of '.note.' sections.
e1df38aa 11753
60439920
ILT
117542009-03-19 Ian Lance Taylor <iant@google.com>
11755
11756 * descriptors.cc (Descriptors::open): Check that the options are
11757 valid before using them.
11758
0d371ad3
ILT
117592009-03-18 Ian Lance Taylor <iant@google.com>
11760
11761 * script-sections.h: Include <list>.
11762 (class Script_sections): Change Sections_elements from std::vector
11763 to std::list. Typedef public Elements_iterator. Add
11764 orphan_section_placement_, data_segment_align_start_, and
11765 saw_data_segment_align_ fields. Remove data_segment_align_index_
11766 field.
11767 * script-sections.cc (class Orphan_section_placement): New class.
11768 (class Sections_element): Add virtual functions is_relro and
11769 orphan_section_init. Remove virtual function place_orphan_here.
11770 (class Output_section_definition): Add is_relro and
11771 orphan_section_init. Remove place_orphan_here.
11772 (class Orphan_output_section): Likewise.
11773 (Script_sections::Script_sections): Update for field changes.
11774 (Script_sections::data_segment_align): Set saw_data_segment_align_
11775 and data_segment_align_start_, not data_segment_align_index.
11776 (Script_sections::data_segment_relro_end): Check
11777 saw_data_segment_align_. Use data_segment_align_start_ rather
11778 than data_segment_align_index_.
11779 (Script_sections::place_orphan): Rewrite to use
11780 Orphan_section_placement.
11781
9201d894
ILT
117822009-03-17 Ian Lance Taylor <iant@google.com>
11783
9c5b8369
ILT
11784 * archive.cc (Archive::add_symbols): Check for a version attached
11785 to the symbol name in the archive map.
11786 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
11787 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
11788 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
11789 (ver_test_11.a): New target.
11790 * testsuite/Makefile.in: Rebuild.
11791
9201d894
ILT
11792 * configure.ac: Check for chsize and posix_fallocate. Replace
11793 ftruncate.
11794 * ftruncate.c: New file, from gnulib.
11795 * output.cc (posix_fallocate): Define dummy version if not
11796 HAVE_POSIX_FALLOCATE.
11797 (Output_file::map): Call posix_fallocate rather than lseek and
11798 write.
11799 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
11800 * configure, Makefile.in, config.in: Rebuild.
11801
ef4ab7a8 118022009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 11803
ef4ab7a8
PP
11804 * layout.h (Layout::create_note): Add section_name parameter.
11805 * layout.cc (Layout::create_note): Likewise.
11806 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 11807
8c500701
ILT
118082009-03-17 Ian Lance Taylor <iant@google.com>
11809
e85b18e1
ILT
11810 * descriptors.cc: Include "options.h".
11811 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
11812 (Descriptors::open): Always use O_CLOEXEC when opening a new
11813 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
11814 then set FD_CLOEXEC.
11815
9efe6174
ILT
11816 * sparc.cc (class Target_sparc): Add has_got_section.
11817 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
11818 make sure we have a GOT section.
11819
11820 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
11821 (Target_sparc::Scan::local): Likewise.
11822 (Target_sparc::Scan::global): Likewise.
11823 (Target_sparc::Relocate::relocate): Likewise.
11824 (Target_sparc::Relocate::relocate_tls): Likewise.
11825
8c500701
ILT
11826 * symtab.cc (Symbol_table::define_default_version): New function,
11827 broken out of add_from_object.
11828 (Symbol_table::add_from_object): Call define_default_version.
11829 (Symbol_table::define_special_symbol): Add resolve_oldsym
11830 parameter. Change all callers. If the version for a symbol comes
11831 from a version script, resolve it with the symbol with the same
11832 name with no version. Also add the symbol without a version if
11833 appropriate.
11834 (do_define_in_output_data): If resolving with oldsym, don't delete
11835 sym.
11836 (do_define_in_output_segment): Likewise.
11837 (do_define_as_constant): Likewise.
11838 * symtab.h (class Symbol_table): Update declarations.
11839
f1ed28fb
ILT
118402009-03-13 Ian Lance Taylor <iant@google.com>
11841
15f8229b
ILT
11842 * readsyms.cc (Read_symbols::incompatible_warning): New function.
11843 (Read_symbols::requeue): New function.
11844 (Read_symbols::do_read_symbols): If make_elf_object fails because
11845 the target type is not configured, and the file was searched for,
11846 issue a warning and retry with the next directory.
11847 (Add_symbols::run): If the file has an incompatible format, and
11848 it was searched for, requeue the Read_symbols task. On error,
11849 release the object.
11850 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
11851 dirindex parameter to constructor. Change all callers. Declare
11852 incompatible_warning and requeue.
11853 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
11854 input_argument_ and input_group_ fields. Add them to
11855 constructor. Change all callers.
11856 (class Read_script): Add dirindex_ field. Add it to constructor.
11857 Change all callers.
11858 * archive.cc (Archive::setup): Remove input_objects parameter.
11859 Change all callers.
11860 (Archive::get_file_and_offset): Likewise.
11861 (Archive::read_all_symbols): Likewise.
11862 (Archive::read_symbols): Likewise.
11863 (Archive::get_elf_object_for_member): Remove input_objects
11864 parameter. Add punconfigured parameter. Change all callers.
11865 (Archive::add_symbols): Change return type to bool. Check return
11866 value of include_member.
11867 (Archive::include_all_members): Likewise.
11868 (Archive::include_member): Change return type to bool. Return
11869 false if first included object has incompatible target. Set
11870 included_member_ field.
11871 (Add_archive_symbols::run): If add_symbols returns false, requeue
11872 Read_symbols task.
11873 * archive.h (class Archive): Add included_member_ field.
11874 Initialize it in constructor. Add input_file and searched_for
11875 methods. Update declarations.
11876 (class Add_archive_symbols): Add dirpath_, dirindex_, and
11877 input_argument_ fields. Add them to constructor. Change all
11878 callers.
11879 * script.cc: Include "target-select.h".
11880 (class Parser_closure): Add skip_on_incompatible_target_ and
11881 found_incompatible_target_ fields. Add
11882 skip_on_incompatible_target parameter to constructor. Change all
11883 callers. Add methods skip_on_incompatible_target,
11884 clear_skip_on_incompatible_target, found_incompatible_target, and
11885 set_found_incompatible_target.
11886 (read_input_script): Add dirindex parameter. Change all callers.
11887 If parser finds an incompatible target, requeue Read_symbols
11888 task.
11889 (script_set_symbol): Clear skip_on_incompatible_target in
11890 closure.
11891 (script_add_assertion, script_parse_option): Likewise.
11892 (script_start_sections, script_add_phdr): Likewise.
11893 (script_check_output_format): New function.
11894 * script.h (read_input_script): Update declaration.
11895 * script-c.h (script_check_output_format): Declare.
11896 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
11897 (ignore_cmd): Remove OUTPUT_FORMAT.
11898 * fileread.cc (Input_file::Input_file): Add explicit this.
11899 (Input_file::will_search_for): New function.
11900 (Input_file::open): Add pindex parameter. Change all callers.
11901 * fileread.h (class Input_file): Add input_file_argument method.
11902 Declare will_search_for. Update declarations.
11903 * object.cc (make_elf_object): Add punconfigured parameter.
11904 Change all callers.
11905 * object.h (class Object): Make input_file public. Add
11906 searched_for method.
11907 (make_elf_object): Update declaration.
11908 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
11909 restart search.
11910 * dirsearch.h (class Dirsearch): Update declaration.
11911 * options.h (class General_options): Add --warn-search-mismatch.
11912 * parameters.cc (Parameters::is_compatible_target): New function.
11913 * parameters.h (class Parameters): Declare is_compatible_target.
11914 * workqueue.cc (Workqueue::add_blocker): New function.
11915 * workqueue.h (class Workqueue): Declare add_blocker.
11916
f1ed28fb
ILT
11917 * fileread.cc (Input_file::open): Remove options parameter.
11918 Change all callers.
11919 (Input_file::open_binary): Likewise.
11920 * script.cc (read_input_script): Likewise.
11921 * readsyms.h (class Read_symbols): Remove options_ field. Remove
11922 options parameter from constructor. Change all callers.
11923 (class Read_script): Likewise.
11924 * fileread.h (class Input_file): Update declarations.
11925 * script.h (read_input_script): Update declaration.
11926
34dd024a
NC
119272009-03-10 Nick Clifton <nickc@redhat.com>
11928
11929 * po/es.po: New Spanish translation.
11930
6d71b17c
CC
119312009-03-06 Cary Coutant <ccoutant@google.com>
11932
11933 * options.cc (parse_short_option): Keep dash_z from registering itself.
11934
031cdbed
ILT
119352009-03-03 Ian Lance Taylor <iant@google.com>
11936
11937 PR 9918
11938 * target-reloc.h (relocate_section): Pass output_section to
11939 relocate.
11940 * i386.cc (Target_i386::should_apply_static_reloc): Add
11941 output_section parameter. Change all callers.
11942 (Target_i386::Relocate::relocate): Add output_section parameter.
11943 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
11944 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
11945 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
11946 * testsuite/two_file_shared.sh: New script.
11947 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
11948 (check_DATA): Add two_file_shared.dbg.
11949 (two_file_shared.dbg): New target.
11950 * testsuite/Makefile.in: Rebuild.
11951
15d5fa16
ILT
119522009-03-01 Ian Lance Taylor <iant@google.com>
11953
11954 * configure.ac: Check for byteswap.h.
11955 * configure: Rebuild.
11956 * config.in: Rebuild.
11957
8a4c0b0d
ILT
119582009-03-01 Mikolaj Zalewski <mikolajz@google.com>
11959
11960 * layout.cc (Layout::find_or_add_kept_section): New function.
11961 (Layout::add_comdat): Removed.
11962 * layout.h (struct Kept_section): Move out of class Layout.
11963 Remove trailing underscores from field names. Add group_sections
11964 field. Rename group_ field to is_group. Change all uses.
11965 (class Layout): Declare find_or_add_kept_section, not add_comdat.
11966 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
11967 comdat_groups_ field.
11968 (Sized_relobj::include_section_group): Use
11969 find_or_add_kept_section and Kept_section::group_sections.
11970 (Sized_relobj::include_linkonce_section): Likewise.
11971 * object.cc (class Sized_relobj): Don't define Comdat_group or
11972 Comdat_group_table. Remove find_comdat_group and
11973 add_comdat_group. Remove comdat_groups_ field.
11974 * plugin.cc (include_comdat_group): Use
11975 Layout::find_or_add_kept_section.
11976
b4ecf66b
ILT
119772009-02-28 Ian Lance Taylor <iant@google.com>
11978
14359ca0
ILT
11979 * README: --gc-sections and map files are now supported. Document
11980 some build requirements.
11981
b4ecf66b
ILT
11982 PR 6992
11983 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
11984 relocatable link set the value of the section symbol to zero.
11985 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
11986 relocatable link don't include the section address in the local
11987 symbol value.
11988
0602e05a
ILT
119892009-02-27 Ian Lance Taylor <iant@google.com>
11990
fd9d194f
ILT
11991 PR 6811
11992 * options.h (class Search_directory): Add is_system_directory.
11993 (class General_options): Declare is_in_system_directory.
11994 * options.cc (get_relative_sysroot): Make static.
11995 (get_default_sysroot): Make static.
11996 (General_optoins::is_in_system_directory): New function.
11997 * fileread.cc (Input_file::is_in_system_directory): New function.
11998 * fileread.h (class Input_file): Declare is_in_system_directory.
11999 * object.h (class Object): Add is_in_system_directory.
12000 (class Input_objects): Remove system_library_directory_ field.
12001 * object.cc (Input_objects::add_object): Don't set
12002 system_library_directory_.
12003 (input_objects::found_in_system_library_directory): Remove.
12004 * symtab.cc (Symbol_table::write_globals): Remove input_objects
12005 parameter. Change all callers.
12006 (Symbol_table::sized_write_globals): Likewise.
12007 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
12008 Call Object::is_in_system_directory.
12009 * symtab.h (class Symbol_table): Update declarations.
12010
61edd21f
ILT
12011 PR 5990
12012 * descriptors.h (Open_descriptor): Add is_on_stack field.
12013 * descriptors.cc (Descriptors::open): If the descriptor is on the
12014 top of the stack, remove it. Initialize is_on_stack field.
12015 (Descriptors::release): Only add pod to stack if it is not on the
12016 stack already.
12017 (Descriptors::close_some_descriptor): Clear stack_next and
12018 is_on_stack fields.
12019
e29e076a
ILT
12020 PR 7091
12021 * output.cc (Output_section::find_starting_output_address): Rename
12022 from starting_output_address; add PADDR parameter; change return
12023 type.
12024 * output.h (class Output_section): Declare
12025 find_starting_output_address instead of starting_output_address.
12026 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
12027 section symbol for which we can't find a merge section.
12028
0602e05a
ILT
12029 PR 9836
12030 * symtab.cc (Symbol_table::add_from_object): If the visibility is
12031 hidden or internal, force the symbol to be local.
12032 * resolve.cc (Symbol::override_visibility): Define.
12033 (Symbol::override_base): Use override_visibility.
12034 (Symbol_table::resolve): Likewise.
12035 (Symbol::override_base_with_special): Likewise.
12036 (Symbol_table::override_with_special): If the visibility is hidden
12037 or internal, force the symbol to be local.
12038 * symtab.h (class Symbol): Add set_visibility and
12039 override_visibility.
12040 * testsuite/ver_test_1.sh: New file.
12041 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
12042 (check_DATA): Add ver_test_1.syms.
12043 (ver_test_1.syms): New target.
12044 * testsuite/Makefile.in: Rebuild.
12045
401a9a73
CC
120462009-02-25 Cary Coutant <ccoutant@google.com>
12047
12048 * layout.cc (Layout::choose_output_section): Don't rename sections
12049 when using a linker script that has a SECTIONS clause.
12050 * Makefile.in: Regenerate.
12051
12052 * testsuite/Makefile.am (script_test_5.sh): New test case.
12053 * testsuite/Makefile.in: Regenerate.
12054 * testsuite/script_test_5.cc: New file.
12055 * testsuite/script_test_5.sh: New file.
12056 * testsuite/script_test_5.t: New file.
12057
f488e4b0
CC
120582009-02-13 Rafael Avila de Espindola <espindola@google.com>
12059
12060 * archive.cc (Archive::include_member): Update calls to add_symbols.
12061 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
12062 the Layout argument.
12063 * dynobj.h (do_add_symbols): Add the Layout argument.
12064 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
12065 Layout argument.
12066 * object.h (Object::add_symbols): Add the Layout argument.
12067 (Object::do_add_symbols): Add the Layout argument.
12068 (Sized_relobj::do_add_symbols): Add the Layout argument.
12069 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
12070 Unify the two versions.
12071 (Add_plugin_symbols): Remove.
12072 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
12073 (Sized_pluginobj::do_add_symbols): Unify the two versions.
12074 (Add_plugin_symbols): Remove.
12075 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
12076 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
12077 (Add_symbols::run): Make it work with Pulginobj.
12078
89dd1680
ILT
120792009-02-06 Ian Lance Taylor <iant@google.com>
12080
12081 * object.cc (Sized_relobj::do_layout): Make info message start
12082 with lower case letter.
12083
266d0a74
ILT
120842009-02-06 Mikolaj Zalewski <mikolajz@google.com>
12085
602b464e
ILT
12086 * binary.cc: Fix file comment.
12087
266d0a74
ILT
12088 * options.h (enum Incremental_disposition): Define.
12089 (class General_options): Add new options: --incremental,
12090 --incremental_changed, --incremental_unchanged,
12091 --incremental_unknown. Add incremental_disposition_ and
12092 implicit_incremental_ fields.
12093 (General_options::incremental_disposition): New function.
12094 (class Position_dependent_options): Add incremental_disposition
12095 option.
12096 (Position_dependent_options::copy_from_options): Set incremental
12097 dispositions.
12098 * options.cc (General_options::parse_incremental_changed): New
12099 function.
2e702c99
RM
12100 (General_options::parse_incremental_unchanged): New function.
12101 (General_options::parse_incremental_unknown): New function.
12102 (General_options::General_options): Initialize new fields
266d0a74 12103 incremental_disposition_ and implicit_incremental_.
2e702c99 12104 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
12105 without --incremental.
12106
f073bbf7
CD
121072009-02-06 Chris Demetriou <cgd@google.com>
12108
12109 * gold.h (gold_undefined_symbol): Change to take only a Symbol
12110 pointer and to report location as the file name associated with
12111 the symbol.
12112 (gold_undefined_symbol_at_location): New function to replace the
12113 old gold_undefined_symbol functionality.
12114 * target-reloc.h (relocate_section): Update to use
12115 gold_undefined_symbol_at_location.
12116 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
12117 Call gold_undefined_symbol function rather than gold_error.
12118 * errors.h (Errors::undefined_symbol): Take location as a
12119 string, rather than calculating it from a relocation.
12120 * errors.cc (Errors::fatal): Print "fatal error:" before the
12121 formatted message.
12122 (Errors::error, Errors::error_at_location): Print "error: "
12123 before the formatted message.
12124 (Errors::undefined_symbol): Take location as a string, rather
12125 than calculating it from a relocation.
12126 (gold_undefined_symbol_at_location): New function akin to
12127 old gold_undefined_symbol, calculates location from relocation.
12128 (gold_undefined_symbol): Change to take only a Symbol pointer
12129 and to report location as the file name associated with the symbol.
12130 * testsuite/debug_msg.sh: Update for changed error messages.
12131 * testsuite/undef_symbol.sh: Likewise.
12132
8e94a90c
ILT
121332009-02-04 Duncan Sands <baldrick@free.fr>
12134
12135 PR 9812
12136 * reduced_debug_output.h
12137 (Output_reduced_debug_abbrev_section::failed): Use format for
12138 gold_warning.
12139 (Output_reduced_debug_info_section::faild): Likewise.
12140
88a0e15b
ILT
121412009-01-31 Mikolaj Zalewski <mikolajz@google.com>
12142
12143 * script.cc (Lazy_demangler): New class.
2e702c99 12144 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
12145 symbol only once.
12146
5efc7cd2
CC
121472009-01-29 Cary Coutant <ccoutant@google.com>
12148
12149 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
12150 to __tls_get_addr.
12151 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
12152
e0ebcf42
ILT
121532009-01-28 Ian Lance Taylor <iant@google.com>
12154
5efc7cd2 12155 * version.cc (version_string): Bump to 1.9.
75fe7426 12156
e0ebcf42
ILT
12157 * gold.h: Include <cstring> and <stdint.h>.
12158 * version.cc: Include <cstdio>.
12159 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
12160 warning.
12161 * reduced_debug_output.cc (insert_into_vector): Rename from
12162 Insert_into_vector; change all callers. Use Swap_unaligned to
12163 avoid aliasing issue; remove union since it is unnecessary.
12164
8e2813be 121652009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
12166
12167 * Makefile.am (CCFILES): Add gc.cc.
12168 (HFILES): Add gc.h.
12169 * Makefile.in: Regenerate.
12170 * gold.cc (Gc_runner): New class.
12171 (queue_initial_tasks): Call garbage collection related tasks
12172 when corresponding options are invoked.
12173 (queue_middle_gc_tasks): New function.
12174 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
12175 processed early before laying out sections during garbage collection.
12176 * gold.h (queue_middle_gc_tasks): New function.
12177 (is_prefix_of): Move from "layout.cc".
12178 * i386.cc (Target_i386::gc_process_relocs): New function.
12179 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
12180 * main.cc (main): Create object of class "Garbage_collection".
12181 * object.cc (Relobj::copy_symbols_data): New function.
12182 (Relobj::is_section_name_included): New function.
e1df38aa
NC
12183 (Sized_relobj::do_layout): Allow this function to be called twice
12184 during garbage collection and defer layout of section during the
6d03d481
ST
12185 first call.
12186 * object.h (Relobj::get_symbols_data): New function.
12187 (Relobj::is_section_name_included): New function.
12188 (Relobj::copy_symbols_data): New function.
12189 (Relobj::set_symbols_data): New function.
12190 (Relobj::get_relocs_data): New function.
12191 (Relobj::set_relocs_data): New function.
12192 (Relobj::is_output_section_offset_invalid): New pure virtual function.
12193 (Relobj::gc_process_relocs): New function.
12194 (Relobj::do_gc_process_relocs): New pure virtual function.
12195 (Relobj::sd_): New data member.
12196 (Sized_relobj::is_output_section_offset_invalid): New function.
12197 (Sized_relobj::do_gc_process_relocs): New function.
12198 * options.h (General_options::gc_sections): Modify to not be a no-op.
12199 (General_options::print_gc_sections): New option.
12200 * plugin.cc (Plugin_finish::run): Remove function call to
12201 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
12202 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
12203 * reloc.cc (Read_relocs::run): Add task to process relocs and
12204 determine unreferenced sections when doing garbage collection.
12205 (Gc_process_relocs): New class.
12206 (Sized_relobj::do_gc_process_relocs): New function.
12207 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
12208 sections that are garbage collected.
12209 * reloc.h (Gc_process_relocs): New class.
12210 * sparc.cc (Target_sparc::gc_process_relocs): New function.
12211 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
12212 symbols whose corresponding sections are garbage collected.
12213 (Symbol_table::Symbol_table): Add new parameter for the garbage
12214 collection object.
12215 (Symbol_table::gc_mark_undef_symbols): New function.
12216 (Symbol_table::gc_mark_symbol_for_shlib): New function.
12217 (Symbol_table::gc_mark_dyn_syms): New function.
12218 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
12219 as garbage.
12220 (Symbol_table::add_from_object): Likewise.
12221 (Symbol_table::add_from_relobj): When building shared objects, do not
12222 treat externally visible symbols as garbage.
12223 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
12224 table information for static and relocatable links.
12225 * symtab.h (Symbol_table::set_gc): New function.
12226 (Symbol_table::gc): New function.
12227 (Symbol_table::gc_mark_undef_symbols): New function.
12228 (Symbol_table::gc_mark_symbol_for_shlib): New function.
12229 (Symbol_table::gc_mark_dyn_syms): New function.
12230 (Symbol_table::gc_): New data member.
e1df38aa 12231 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
12232 function.
12233 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
12234 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
12235
3b293544
CF
122362009-01-20 Chris Faylor <me.sourceware@sourceware.org>
12237
12238 * options.h (General_options::gc_sections): Define as a no-op for now.
12239 (General_options::no_keep_memory): Ditto.
12240 (General_options::Bshareable): Define.
12241 * options.cc (General_options::finalize): Honor -Bshareable.
12242
83d22aa8
AS
122432009-01-20 Andreas Schwab <schwab@suse.de>
12244
12245 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
12246 read the value in the contents, since we don't use it. Use the
12247 template endianness when writing.
12248 (Relocate::relocate): Use it for R_PPC_REL16_HA.
12249
cd536b21
AS
122502009-01-19 Andreas Schwab <schwab@suse.de>
12251
12252 * configure.tgt (powerpc64-*): Fix targ_obj.
12253
99e9a495
ILT
122542009-01-15 Ian Lance Taylor <iant@google.com>
12255
12256 * object.cc (Sized_relobj::write_local_symbols): Don't write out
12257 local symbols when stripping all symbols.
12258
bbbfea06
CC
122592009-01-14 Cary Coutant <ccoutant@google.com>
12260
99e9a495 12261 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 12262
0f7c0701
CC
122632009-01-14 Cary Coutant <ccoutant@google.com>
12264
12265 * archive.cc (Archive::get_elf_object_for_member): Remove call
12266 to File_read::claim_for_plugin.
12267 * descriptors.cc (Descriptors::open): Remove reference to
12268 is_claimed.
12269 (Descriptors::claim_for_plugin): Remove.
12270 * descriptors.h (Descriptors::claim_for_plugin): Remove.
12271 (Descriptors::is_claimed): Remove.
12272 (claim_descriptor_for_plugin): Remove.
12273 * fileread.cc (File_read::claim_for_plugin): Remove.
12274 * fileread.h (File_read::claim_for_plugin): Remove.
12275 (File_read::descriptor): Reopen descriptor if necessary.
12276 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
12277 (Plugin_manager::all_symbols_read): Add task parameter. Change
12278 all callers.
12279 (Plugin_manager::get_input_file): New function.
12280 (Plugin_manager::release_input_file): New function.
12281 (Pluginobj::Pluginobj): Add filesize parameter and initialize
12282 corresponding data member.
12283 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
12284 and pass to base constructor. Change all callers.
12285 (get_input_file, release_input_file): New functions.
12286 (make_sized_plugin_object): Add filesize parameter. Change all callers.
12287 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
12288 (Plugin_manager::all_symbols_read): Add task parameter.
12289 (Plugin_manager::get_input_file): New function.
12290 (Plugin_manager::release_input_file): New function.
12291 (Plugin_manager::task_): New data member.
12292 (Pluginobj::Pluginobj): Add filesize parameter.
12293 (Pluginobj::filename): New function.
12294 (Pluginobj::descriptor): New function.
12295 (Pluginobj::filesize): New function.
12296 (Pluginobj::filesize_): New data member.
12297 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
12298 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
12299 File_read::claim_for_plugin; use Object::unlock to unlock the file.
12300
12301 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
12302 with archive libraries.
12303 * testsuite/Makefile.in: Regenerate.
12304 * testsuite/plugin_test.c (struct sym_info): New type.
12305 (get_input_file, release_input_file): New static variables.
12306 (onload): Capture new transfer vector entries.
12307 (claim_file_hook): Stop reading at end of file according to filesize.
12308 Factor out parsing of readelf output into separate function.
12309 (all_symbols_read_hook): Exercise get_input_file and release_input_file
12310 APIs and get the source file name from the symbol table. Convert
12311 source file name to corresponding object file name. Print info
12312 message when adding new input files.
12313 (parse_readelf_line): New function.
12314 * testsuite/plugin_test_1.sh: Add checks for new info messages.
12315 * testsuite/plugin_test_2.sh: Likewise.
12316 * testsuite/plugin_test_3.sh: Likewise.
12317 * testsuite/plugin_test_4.sh: New test case.
12318
62a6d109
ILT
123192009-01-07 Ian Lance Taylor <iant@google.com>
12320
12321 * version.cc (version_string): Bump to 1.8.
12322
483620e8
CC
123232008-12-23 Cary Coutant <ccoutant@google.com>
12324
12325 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
12326 * plugin.cc (Plugin_manager::finish): Rename as
12327 layout_deferred_objects. Move cleanup to separate function.
12328 (Plugin_manager::cleanup): New function.
12329 (Plugin_finish::run): Call layout_deferred_objects and cleanup
12330 separately.
12331 * plugin.h (Plugin_manager::finish): Rename as
12332 layout_deferred_objects.
12333 (Plugin_manager::cleanup): New function.
12334 (Plugin_manager::cleanup_done): New field.
12335
d66a9eb3
CC
123362008-12-23 Cary Coutant <ccoutant@google.com>
12337
12338 * plugin.cc (is_visible_from_outside): New function.
12339 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
12340 so we don't return "IR only" status for exported symbols or -r links.
12341
12342 * testsuite/Makefile.am (plugin_test_3): New test case.
12343 * testsuite/Makefile.in: Regenerate.
12344 * testsuite/plugin_test_3.sh: New file.
12345
5995b570
CC
123462008-12-22 Cary Coutant <ccoutant@google.com>
12347
12348 * object.cc (Sized_relobj::layout_section): New function.
12349 (Sized_relobj::do_layout): Defer layout of input sections until after
12350 plugin has provided replacement files.
12351 (Sized_relobj::do_layout_deferred_sections): New function.
12352 * object.h (Relobj::set_section_offset): Remove virtual keyword.
12353 (Relobj::layout_deferred_sections): New function.
12354 (Relobj::do_layout_deferred_sections): New function.
12355 (Sized_relobj::do_layout_deferred_sections): New function.
12356 (Sized_relobj::layout_section): New function.
12357 (Sized_relobj::Deferred_layout): New structure.
12358 (Sized_relobj::deferred_layout_): New field.
12359 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
12360 Change all callers. Layout deferred sections.
12361 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
12362 references.
12363 (Plugin_hook::run): Move code from do_plugin_hook inline.
12364 (Plugin_hook::do_plugin_hook): Remove.
12365 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
12366 (Plugin_manager::finish): Renamed, was cleanup.
12367 (Plugin_manager::should_defer_layout): New function.
12368 (Plugin_manager::add_deferred_layout_object): New function.
12369 (Plugin_manager::Deferred_layout_list): New type.
12370 (Plugin_manager::deferred_layout_objects_): New field.
12371 (Plugin_hook::do_plugin_hook): Remove.
12372
ee769c88
ILT
123732008-12-17 Ian Lance Taylor <iant@google.com>
12374
12375 * options.h (class General_options): Add --no case for
12376 --export-dynamic.
12377
abc8dcba
CC
123782008-12-16 Cary Coutant <ccoutant@google.com>
12379
12380 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
12381 vector.
12382 (Plugin_manager::claim_file): Create plugin object even if
12383 plugin did not call the add_symbols callback.
12384 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
12385 asking for more symbols than were added.
12386 * testsuite/Makefile.am (plugin_test_1): Add test case with
12387 no global symbols.
12388 (empty.syms): New target.
12389 * testsuite/Makefile.in: Regenerate.
12390 * testsuite/plugin_test.c (claim_file_hook): Add new debug
12391 message. Don't call add_symbols if no globals.
12392 (all_symbols_read_hook): Don't provide replacement for empty
12393 claimed file.
12394
b0074644
ILT
123952008-12-12 Ian Lance Taylor <iant@google.com>
12396
68943102
ILT
12397 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
12398 r_type == 0 for a local symbol with r_sym == 0.
12399 (scan_relocatable_relocs): Pass r_sym to
12400 local_non_section_strategy.
12401 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
12402 r_sym parameter.
12403
b0074644
ILT
12404 * configure.ac: Update test for TLS descriptors: they are
12405 supported as of glibc 2.9.
12406 * configure: Rebuild.
12407
c2508178
ILT
124082008-12-11 Ian Lance Taylor <iant@google.com>
12409
12410 PR 7091
12411 * target-reloc.h (Default_scan_relocatable_relocs): For each
12412 function, map r_type == 0 to RELOC_DISCARD.
12413
2756a258
CC
124142008-12-10 Cary Coutant <ccoutant@google.com>
12415
12416 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
12417 object to override a kept COMDAT group from a plugin object.
12418
bb6f53d3
ILT
124192008-12-09 Ian Lance Taylor <iant@google.com>
12420
fbc558e1
ILT
12421 PR 7088
12422 * yyscript.y (file_cmd): Handle INPUT.
12423
bb6f53d3
ILT
12424 * testsuite/initpri1.c: Change all declarations to be full
12425 prototypes by adding void, to avoid compiler warnings.
12426
4674ecfc
CC
124272008-12-05 Rafael Avila de Espindola <espindola@google.com>
12428
12429 * options.cc (General_options::parse_plugin_opt): New.
12430 (General_options::add_plugin): The argument now is just the filename.
12431 (General_options::add_plugin_option): New.
12432 * options.h (plugin_opt): New.
12433 (add_plugin): Change argument name.
12434 (add_plugin_option): New.
12435 * plugin.cc (Plugin::load): Don't parse the plugin option.
12436 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
12437 (Plugin::add_option): New.
12438 (Plugin::args_): Change type.
12439 (Plugin::filename_): New.
12440 (Plugin_manager::add_plugin_option): New.
12441 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
12442 * testsuite/Makefile.in: Regenerate.
12443
fd06b4aa
CC
124442008-12-05 Cary Coutant <ccoutant@google.com>
12445
12446 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
12447 Handle --strip-lto-sections option.
12448 * options.h (strip_lto_sections): New option.
12449
6c52134c
CC
124502008-12-01 Cary Coutant <ccoutant@google.com>
12451
12452 * plugin.cc (ld_plugin_message): Change format parameter to const.
12453 Fix mismatch between new[] and delete.
12454
a45248e0
CC
124552008-11-14 Cary Coutant <ccoutant@google.com>
12456
12457 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
12458 instead of -1U.
12459
c82fbeee
CS
124602008-11-05 Craig Silverstein <csilvers@google.com>
12461
12462 * options.cc (General_options::parse_dynamic_list): New function.
12463 * options.h (General_options): New flags dynamic_list,
12464 dynamic_list_data, dynamic_list_cpp_new, and
12465 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
12466 (General_options::in_dynamic_list): New function.
12467 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
12468 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
12469 (Lex::can_continue_name): Likewise.
12470 (yylex): Likewise.
12471 (read_script_file): New parameter script_options.
12472 (read_dynamic_list): New function.
12473 (Script_options::define_dynamic_list): New function.
12474 (dynamic_list_keyword_parsecodes): New variable.
12475 (dynamic_list_keywords): New variable.
12476 * script.h (Script_options::define_dynamic_list): New function
12477 prototype.
12478 (read_dynamic_list): New function prototype.
12479 * symtab.cc (strprefix): New macro.
12480 (Symbol::should_add_dynsym_entry): Support dynamic_list,
12481 dynamic_list_data, dynamic_list_cpp_new, and
12482 dynamic_list_cpp_typeinfo.
12483 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
12484 (dynamic_list_expr): New rule.
12485 (dynamic_list_nodes): Likewise.
12486 (dynamic_list_node): Likewise.
12487 * testsuite/Makefile.am (dynamic_list): New test.
12488 * testsuite/Makefile.in: Regenerated.
12489 * testsuite/dynamic_list.t: New file.
12490 * testsuite/dynamic_list.sh: New file.
12491
e0bb29a5
CS
124922008-11-05 Craig Silverstein <csilvers@google.com>
12493
12494 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
12495 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
12496 (t11_last): Likewise.
12497 * testsuite/ver_test_6.c (main): Likewise.
12498
4e1e25e0
CC
124992008-10-07 Cary Coutant <ccoutant@google.com>
12500
12501 * options.c (General_options::finalize): Add check for -static and
12502 -shared.
12503 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
12504 is not empty.
12505
92f03fcb
CC
125062008-10-02 Cary Coutant <ccoutant@google.com>
12507
12508 * plugin.cc (make_sized_plugin_object): Fix conditional
12509 compilation to work when not all targets are enabled.
12510
fbd8a257
CC
125112008-09-29 Cary Coutant <ccoutant@google.com>
12512
12513 * archive.cc (Archive::get_file_and_offset): Use filename instead
12514 of name to get library path.
12515 (Archive::include_member): Unlock external member of a thin archive.
12516
12517 * testsuite/Makefile.am (TEST_AR): New variable.
12518 (thin_archive_test_1): New test.
12519 (thin_archive_test_2): New test.
81636b3f
CC
12520 * testsuite/Makefile.in: Regenerate.
12521 * testsuite/thin_archive_main.cc: New file.
12522 * testsuite/thin_archive_test_1.cc: New file.
12523 * testsuite/thin_archive_test_2.cc: New file.
12524 * testsuite/thin_archive_test_3.cc: New file.
12525 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 12526
eff45813
CC
125272008-09-29 Cary Coutant <ccoutant@google.com>
12528
12529 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
12530 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
12531 instead of -1U.
12532 (Sized_relobj::do_finalize_local_symbols): Likewise.
12533 (Sized_relobj::map_to_kept_section): Likewise.
12534 * object.h (Sized_relobj::invalid_address): New constant.
12535 (Sized_relobj::do_output_section_offset): Check for invalid_address
12536 and return -1ULL.
12537 * output.cc (Output_reloc::local_section_offset): Use constant
12538 invalid_address instead of -1U.
12539 (Output_reloc::get_address): Likewise.
12540 (Output_section::output_address): Change -1U to -1ULL.
12541 * output.h (Output_reloc::invalid_address): New constant.
12542 * reloc.cc (Sized_relobj::write_sections): Use constant
12543 invalid_address instead of -1U.
12544 (Sized_relobj::relocate_sections): Likewise.
12545 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
12546 values for merge sections.
12547 * target-reloc.h (relocate_for_relocatable): Use constant
12548 invalid_address instead of -1U.
12549
89fc3421
CC
125502008-09-19 Cary Coutant <ccoutant@google.com>
12551
12552 Add plugin functionality for link-time optimization (LTO).
12553 * configure.ac (plugins): Add --enable-plugins option.
12554 * configure: Regenerate.
12555 * config.in: Regenerate.
12556 * Makefile.am (LIBDL): New variable.
12557 (CCFILES): Add plugin.cc.
12558 (HFILES): Add plugin.h.
12559 (ldadd_var): Add LIBDL.
12560 * Makefile.in: Regenerate.
12561
12562 * archive.cc: Include "plugin.h".
12563 (Archive::setup): Don't preread archive symbols when using a plugin.
12564 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
12565 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
12566 files.
12567 (Archive::include_member): Add symbols from plugin objects.
12568 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
12569 * descriptors.cc (Descriptors::open): Check for file descriptors
12570 abandoned by plugins.
12571 (Descriptors::claim_for_plugin): New function.
12572 * descriptors.h (Descriptors::claim_for_plugin): New function.
12573 (Open_descriptor::is_claimed): New field.
12574 (claim_descriptor_for_plugin): New function.
12575 * fileread.cc (File_read::claim_for_plugin): New function.
12576 * fileread.h (File_read::claim_for_plugin): New function.
12577 (File_read::descriptor): New function.
12578 * gold.cc: Include "plugin.h".
12579 (queue_initial_tasks): Add task to call plugin hooks for generating
12580 new object files.
12581 * main.cc: Include "plugin.h".
12582 (main): Load plugin libraries.
12583 * object.h (Pluginobj): Declare.
12584 (Object::pluginobj): New function.
12585 (Object::do_pluginobj): New function.
12586 (Object::set_target): New function.
12587 * options.cc: Include "plugin.h".
12588 (General_options::parse_plugin): New function.
12589 (General_options::General_options): Initialize plugins_ field.
12590 (General_options::add_plugin): New function.
12591 * options.h (Plugin_manager): Declare.
12592 (General_options): Add --plugin option.
12593 (General_options::has_plugins): New function.
12594 (General_options::plugins): New function.
12595 (General_options::add_plugin): New function.
12596 (General_options::plugins_): New field.
12597 * plugin.cc: New file.
12598 * plugin.h: New file.
12599 * readsyms.cc: Include "plugin.h".
12600 (Read_symbols::do_read_symbols): Check for archive before checking
12601 for ELF file. Call plugin hooks to claim files.
12602 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
12603 from a real object file; force override when processing replacement
12604 files.
12605 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
12606 (Symbol::init_base_object): Likewise.
12607 (Symbol::init_base_output_data): Likewise.
12608 (Symbol::init_base_output_segment): Likewise.
12609 (Symbol::init_base_constant): Likewise.
12610 (Symbol::init_base_undefined): Likewise.
12611 (Symbol::output_section): Assert that object is not a plugin.
12612 (Symbol_table::add_from_pluginobj): New function.
12613 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
12614 undefined.
12615 (Symbol_table::sized_write_globals): Likewise.
12616 (Symbol_table::add_from_pluginobj): Instantiate template.
12617 * symtab.h (Sized_pluginobj): Declare.
12618 (Symbol::in_real_elf): New function.
12619 (Symbol::set_in_real_elf): New function.
12620 (Symbol::in_real_elf_): New field.
12621 (Symbol_table::add_from_pluginobj): New function.
12622
12623 * testsuite/Makefile.am (AM_CFLAGS): New variable.
12624 (LIBDL): New variable.
12625 (LDADD): Add LIBDL.
12626 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
12627 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
12628 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
12629 (MOSTLYCLEANFILES): Likewise.
12630 * testsuite/Makefile.in: Regenerate.
12631 * testsuite/plugin_test.c: New file.
12632 * testsuite/plugin_test_1.sh: New file.
12633 * testsuite/plugin_test_2.sh: New file.
12634
de31bda5
ILT
126352008-09-16 Ian Lance Taylor <iant@google.com>
12636
9c2d0ef9
ILT
12637 * target-reloc.h (relocate_section): Check whether a symbol is
12638 defined by the ABI before reporting an undefined symbol error.
12639 * target.h (Target::is_defined_by_abi): Make parameter const.
12640 (Target::do_is_defined_by_abi): Likewise.
12641 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
12642 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
12643 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
12644 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
12645 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
12646 * testsuite/Makefile.in: Rebuild.
12647
de31bda5
ILT
12648 * fileread.cc (make_view): Add casts to avoid warning.
12649
9fa33bee
AO
126502008-09-16 Alexandre Oliva <aoliva@redhat.com>
12651
12652 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
12653 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
12654
183fd0e3
AO
126552008-09-16 Alexandre Oliva <aoliva@redhat.com>
12656
12657 * options.h (General_options::output_is_executable): New.
12658 (General_options::output_is_pie): New.
12659 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
12660 for shared libraries.
12661 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
12662
7be8330a
CD
126632008-09-11 Chris Demetriou <cgd@google.com>
12664
12665 * options.h (origin): New -z option.
12666 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
12667 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
12668 in DT_FLAGS_1.
12669
a9caad02
CC
126702008-09-05 Cary Coutant <ccoutant@google.com>
12671
12672 * fileread.cc (File_read::make_view): Add check for attempt to map
12673 beyond end of file.
12674
ae6dce4d
CC
126752008-09-05 Cary Coutant <ccoutant@google.com>
12676
12677 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
12678 explicit instantiations.
12679
d7ab2a47
KVH
126802008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
12681
12682 PR gold/6858
12683 * options.cc (General_options::finalize): Allow undefined symbols
12684 in shlibs if linking -shared.
12685
12686 PR gold/6859
12687 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
12688 symbols as not needing a dynsym entry.
12689
1e52a9c1
CS
126902008-08-20 Craig Silverstein <csilvers@google.com>
12691
12692 * fileread.cc (File_read::open): Do not lock the file unless it
12693 was successfully opened.
12694
d85c80a3
CC
126952008-08-14 Cary Coutant <ccoutant@google.com>
12696
12697 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
12698 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
12699 * testsuite/tls_test.cc (struct int128): 128-bit struct
12700 for testing TLS relocs with non-zero addend.
12701 (v12): New TLS variable.
12702 (t12): New test.
12703 (t_last): Add check for v12.
12704 * testsuite/tls_test.h (t12): New function.
12705 * testsuite/tls_test_main.cc (thread_routine): Call new test.
12706
2d924fd9
ILT
127072008-08-13 Ian Lance Taylor <iant@google.com>
12708
12709 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
12710 set tls_segment_ or relro_segment_.
12711 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
12712 when appropriate.
12713 * output.h (Output_section::clear_is_relro): New function.
12714 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
12715 sections specially even when output_data_ is empty.
12716 (Output_segment::maximum_alignment): When first section is relro,
12717 only force alignment for PT_LOAD segments.
12718 * script.cc (script_data_segment_align): New function.
12719 (script_data_segment_relro_end): New function.
12720 * script-c.h (script_data_segment_align): Declare.
12721 (script_data_segment_relro_end): Declare.
12722 * script-sections.h (class Script_sections): Declare
12723 data_segment_align and data_segment_relro_end. Add fields
12724 segment_align_index_ and saw_relro_end_.
12725 * script-sections.cc (class Sections_element): Add set_is_relro
12726 virtual function. Add new bool* parameter to place_orphan_here.
12727 Add get_output_section virtual function.
12728 (class Output_section_definition): Add set_is_relro. Add new
12729 bool* parameter to place_orphan_here. Add get_output_section.
12730 Add is_relro_ field.
12731 (Output_section_definition::Output_section_definition): Initialize
12732 evaluated_address_, evaluated_load_address, evaluated_addralign_,
12733 and is_relro_ fields.
12734 (Output_section_definition::place_orphan_here): Add is_relro
12735 parameter.
12736 (Output_section_definition::set_section_addresses): Set relro for
12737 output section.
12738 (Output_section_definition::alternate_constraint): Likewise.
12739 (class Orphan_output_section): Add new bool* parameter to
12740 place_orphan_here. Add get_output_section.
12741 (Orphan_output_section::place_orphan_here): Add is_relro
12742 parameter.
12743 (Script_sections::Script_sections): Initialize
12744 data_segment_align_index_ and saw_relro_end_.
12745 (Script_sections::data_segment_align): New function.
12746 (Script_sections::data_segment_relro_end): New function.
12747 (Script_sections::place_orphan): Set or clear is_relro.
12748 (Script_sections::set_section_addresses): Force alignment of first
12749 TLS section.
12750 * yyscript.y (exp): Call script_data_segment_align and
12751 script_data_segment_relro_end.
12752 * testsuite/relro_script_test.t: New file.
12753 * testsuite/relro_test.cc (using_script): Declare.
12754 (t1, t2): Test using_script.
12755 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
12756 (relro_script_test_SOURCES): Define.
12757 (relro_script_test_DEPENDENCIES): Define.
12758 (relro_script_test_LDFLAGS): Define.
12759 (relro_script_test_LDADD): Define.
12760 (relro_script_test.so): New target.
12761 * testsuite/Makefile.in: Rebuild.
12762
f827c9a9
CC
127632008-08-06 Cary Coutant <ccoutant@google.com>
12764
12765 * archive.cc (Archive::total_archives, Archive::total_members)
12766 (Archive::total_members_loaded): New variables.
12767 (Archive::setup): Add parameter. Add option to preread
12768 archive symbols.
12769 (Archive::read_armap): Add counter.
12770 (Archive::get_file_and_offset): New function.
12771 (Archive::get_elf_object_for_member): New function.
12772 (Archive::read_all_symbols): New function.
12773 (Archive::read_symbols): New function.
12774 (Archive::add_symbols): Add counters.
12775 (Archive::include_all_members): Use armap to find members if it's
12776 already built.
12777 (Archive::include_member): Skip reading symbols if already read.
12778 Factored code into Archive::get_file_and_offset and
12779 Archive::get_elf_object_for_member. Changed call to
12780 Mapfile::report_include_archive_member.
12781 (Archive::print_stats): New function.
12782 * archive.h: Declare Object and Read_symbols_data classes.
12783 (Archive::Archive): Add initializers for new members.
12784 (Archive::setup): Add parameter.
12785 (Archive::print_stats): New function.
12786 (Archive::total_archives, Archive::total_members)
12787 (Archive::total_members_loaded): New variables.
12788 (Archive::get_file_and_offset): New function.
12789 (Archive::get_elf_object_for_member): New function.
12790 (Archive::read_all_symbols): New function.
12791 (Archive::read_symbols): New function.
12792 (Archive::Archive_member): New class.
12793 (Archive::members_): New member.
12794 (Archive::num_members_): New member.
12795 * main.cc: Include archive.h.
12796 (main): Call Archive::print_stats.
12797 * mapfile.cc (Mapfile::report_include_archive_member): Delete
12798 archive parameter; member_name is now the fully-decorated name.
12799 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
12800 * options.h: (General_options): Add --preread-archive-symbols option.
12801 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
12802 Archive::setup.
12803
de4c45bd
ILT
128042008-08-04 Ian Lance Taylor <iant@google.com>
12805
12806 * symtab.h (Symbol::use_plt_offset): New function.
12807 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
12808 * powerpc.cc (Relocate::relocate): Likewise.
12809 * sparc.cc (Relocate::relocate): Likewise.
12810 * x86_64.cc (Relocate::relocate): Likewise.
12811 * testsuite/weak_plt.sh: New test.
12812 * testsuite/weak_plt_main.cc: New test.
12813 * testsuite/weak_plt_shared.cc: New test.
12814 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
12815 (check_PROGRAMS): Add weak_plt.
12816 (check_DATA): Add weak_plt_shared.so.
12817 (weak_plt_main_pic.o, weak_plt): New targets.
12818 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
12819 * testsuite/Makefile.in: Rebuild.
12820
12821 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
12822 gcctestdir/ld.
12823 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
12824 * testsuite/Makefile.in: Rebuild.
12825
323ee3f4
AM
128262008-08-04 Alan Modra <amodra@bigpond.net.au>
12827
12828 * Makefile.am (POTFILES.in): Set LC_ALL=C.
12829 * Makefile.in: Regenerate.
12830 * po/POTFILES.in: Regenerate.
12831
7c07ecec
ILT
128322008-07-29 Ian Lance Taylor <iant@google.com>
12833
12834 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
12835 symbols before other symbols.
12836 * testsuite/script_test_2.cc (test_addr): Declare.
12837 (test_addr_alias): Declare.
12838 (main): Check that test_addr and test_addr_alias have the right
cd536b21 12839 values.
7c07ecec
ILT
12840 * testsuite/script_test_2.t: Define test_addr_alias and
12841 test_addr.
12842
5778530e
ILT
128432008-07-24 Ian Lance Taylor <iant@google.com>
12844
2a00e4fb
ILT
12845 PR 5990
12846 * descriptors.cc: New file.
12847 * descriptors.h: New file.
12848 * gold-threads.h (class Hold_optional_lock): New class.
12849 * fileread.cc: Include "descriptors.h".
12850 (File_read::~File_read): Release descriptor rather than closing
12851 it.
12852 (File_read::open) [file]: Call open_descriptor rather than open.
12853 Set is_descriptor_opened_.
12854 (File_read::open) [memory]: Assert that descriptor is not open.
12855 (File_read::reopen_descriptor): New function.
12856 (File_read::release): Release descriptor.
12857 (File_read::do_read): Make non-const. Reopen descriptor.
12858 (File_read::read): Make non-const.
12859 (File_read::make_view): Reopen descriptor.
12860 (File_read::do_readv): Likewise.
12861 * fileread.h (class File_read): Add is_descriptor_opened_ field.
12862 Update declarations.
12863 * layout.cc: Include "descriptors.h".
12864 (Layout::create_build_id): Use open_descriptor rather than open.
12865 * output.cc: Include "descriptors.h".
12866 (Output_file::open): Use open_descriptor rather than open.
12867 * archive.cc (Archive::const_iterator): Change Archive to be
12868 non-const.
12869 (Archive::begin, Archive::end): Make non-const.
12870 (Archive::count_members): Likewise.
12871 * archive.h (class Archive): Update declarations.
12872 * object.h (Object::read): Make non-const.
12873 * Makefile.am (CCFILES): Add descriptors.cc.
12874 (HFILES): Add descriptors.h.
12875 * Makefile.in: Rebuild.
12876
801647d1
ILT
12877 PR 6716
12878 * gold.h: Always include <clocale>. Add Solaris workarounds
12879 following code in binutils/sysdep.h.
12880
5edd166e
ILT
12881 PR 6048
12882 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
12883 this->eh_frame_hdr_ is NULL before using it.
12884
c89ad728
ILT
12885 * dynobj.cc (Versions::Versions): Update comment.
12886
aa86f06b
ILT
12887 * dynobj.cc (Versions::Versions): If there is an soname, use it as
12888 the base version name.
12889
5778530e
ILT
12890 * stringpool.cc (Stringpool_template::add_with_length): Set key to
12891 array size plus one.
12892 (Stringpool_template::set_string_offsets): Subtract one from key
12893 before using it as an array index.
12894 (Stringpool_template::get_offset_with_length): Likewise.
12895 (Stringpool_template::write_to_buffer): Likewise.
12896 * stringpool.h (Stringpool_template::get_offset_from_key):
12897 Likewise.
12898
057ead22
ILT
128992008-07-23 Ian Lance Taylor <iant@google.com>
12900
7f649c59
ILT
12901 PR 6658
12902 * object.h (Merged_symbol_value::value): Do our best to handle a
12903 negative addend.
12904
057ead22
ILT
12905 PR 6647
12906 * script.cc (Version_script_info::get_versions): Don't add empty
12907 version tag to return value.
12908 (Version_script_info::get_symbol_version_helper): Change return
12909 type to bool. Add pversion parameter. Change all callers.
12910 (script_register_vers_node): Don't require a non-NULL tag.
12911 * script.h (class Version_script_info): Update declarations.
12912 (Version_script_info::get_symbol_version): Change return type to
12913 bool. Add version parameter. Change all callers.
12914 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
12915 handling. Handle an empty version from a version script.
12916 (Symbol_table::define_special_symbol): Likewise.
12917 * testsuite/ver_test_10.script: New file.
12918 * testsuite/ver_test_10.sh: New file.
12919 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
12920 (check_DATA): Add ver_test_10.syms.
12921 (ver_test_10.syms, ver_test_10.so): New target.
12922 * testsuite/Makefile.in: Rebuild.
12923
58e54ac2
CD
129242008-07-23 Simon Baldwin <simonb@google.com>
12925
12926 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
12927 to zero for undefined symbols from dynamic libraries.
12928
95d14cd3
ILT
129292008-07-23 Ian Lance Taylor <iant@google.com>
12930
12931 * symtab.cc (Symbol_table::resolve): Remove version parameter.
12932 Change all callers.
12933 * symtab.h (class Symbol_table): Update declaration.
12934 * testsuite/ver_test_9.cc: New file.
12935 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
12936 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
12937 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
12938 (ver_test_9.so, ver_test_9.o): New targets.
12939 * testsuite/Makefile.in: Rebuild.
12940
92de84a6
ILT
129412008-07-22 Ian Lance Taylor <iant@google.com>
12942
34810851
ILT
12943 * options.h (class General_options): Define --check-sections.
12944 * layout.cc (Layout::set_segment_offsets): Handle
12945 --check-sections.
12946
af6156ef
ILT
12947 * options.h (class General_options): Define -n/--nmagic and
12948 -N/--omagic.
12949 * options.cc (General_options::finalize): For -n/--nmagic or
12950 -N/--omagic, set -static.
12951 * layout.cc (Layout::attach_allocated_section_to_segment): If
12952 -N/--omagic, don't put read-only and read-write sections in
12953 different segments.
12954 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
12955 finding a read-only segment.
12956 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
12957 don't set the minimum segment alignment to the common page size,
12958 and don't set the file offset to the address modulo the page size.
12959 * script-sections.cc (Script_sections::create_segments): If
12960 -n/--omagic, don't put read-only and read-write sections in
12961 different segments.
12962
92de84a6
ILT
12963 * cref.cc: New file.
12964 * cref.h: New file.
12965 * options.h (class General_options): Add --print-symbol-counts.
12966 * main.cc (main): Issue defined symbol report if requested.
12967 * archive.cc (Archive::interpret_header): Make into a const member
12968 function.
12969 (Archive::add_symbols): Call Input_objects::archive_start and
12970 archive_stop.
12971 (Archive::const_iterator): Define new class.
12972 (Archive::begin, Archive::end): New functions.
12973 (Archive::include_all_members): Rewrite to use iterator.
12974 (Archive::count_members): New function.
12975 * archive.h (class Archive): Update declarations.
12976 (Archive::filename): New function.
12977 * object.cc: Include "cref.h".
12978 (Sized_relobj::Sized_relobj): Initialize defined_count_.
12979 (Sized_relobj::do_get_global_symbol_counts): New function.
12980 (Input_objects::add_object): Add object to cross-referencer.
12981 (Input_objects::archive_start): New function.
12982 (Input_objects::archive_stop): New function.
12983 (Input_objects::print_symbol_counts): New function.
12984 * object.h: Declare Cref and Archive.
12985 (Object::get_global_symbol_counts): New function.
12986 (Object::do_get_global_symbol_counts): New pure virtual function.
12987 (class Sized_relobj): Add defined_count_ field. Update
12988 declarations.
12989 (class Input_objects): Add cref_ field. Update constructor.
12990 Update declarations.
12991 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
12992 defined_count_.
12993 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
12994 symbol counts.
12995 (Sized_dynobj::do_get_global_symbol_counts): New function.
12996 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
12997 defined_count_. Update declarations. Define Symbols typedef.
12998 * symtab.cc (Symbol_table::add_from_relobj): Add defined
12999 parameter. Change all callers.
13000 (Symbol_table::add_from_dynobj): Add sympointers and defined
13001 parameters. Change all callers.
13002 * symtab.h (class Symbol_table): Update declarations.
13003 * Makefile.am (CCFILES): Add cref.cc.
13004 (HFILES): Add cref.h.
13005 * Makefile.in: Rebuild.
13006
3f7c5e1d
CD
130072008-07-22 Simon Baldwin <simonb@google.com>
13008
13009 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
13010 to zero when writing undefined symbols.
13011
e0b64032
ILT
130122008-07-22 Ian Lance Taylor <iant@google.com>
13013
13014 * output.cc (Output_section::add_input_section): Don't try to
13015 merge empty merge sections.
13016
096b02cf
CS
130172008-07-21 Craig Silverstein <csilvers@google.com>
13018
13019 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
13020 Include symbol version in error message.
cd536b21 13021
1d1f116d
CD
130222008-07-20 Chris Demetriou <cgd@google.com>
13023
cd536b21 13024 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
13025 (RANDOM_SEED_CFLAGS): New substituted variable.
13026 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
13027 * configure: Rebuild.
13028 * Makefile.in: Likewise.
13029 * testsuite/Makefile.in: Likewise.
13030
a18f591e
ILT
130312008-07-18 Ian Lance Taylor <iant@google.com>
13032
13033 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
13034 where we see NAME/NULL and NAME/VERSION as separate symbols.
13035 * testsuite/ver_test_main.cc (main): Call t4.
13036 (t4, t4_2a): Define.
13037 * testsuite/ver_test_2.cc (t4_2): Define.
13038 * testsuite/ver_test_2.script: Put t4_2a in VER2.
13039 * testsuite/ver_test_4.cc (t4_2a): Define.
13040 * testsuite/ver_test_4.script: Put t4_2a in VER2.
13041 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
13042
c6e3f6ed
ILT
130432008-07-17 Ian Lance Taylor <iant@google.com>
13044
13045 * dynobj.cc (Versions::add_def): If we give an error about a
13046 missing version, go ahead and create the version anyhow.
13047
ef9beddf
ILT
130482008-07-10 Ian Lance Taylor <iant@google.com>
13049
13050 Handle output sections with more than 0x7fffffff bytes.
13051 * object.h (class Relobj): Change map_to_output_ to
13052 output_sections_, and just keep a section pointer. Change all
13053 uses. Move comdat group support to Sized_relobj.
13054 (Relobj::is_section_specially_mapped): Remove.
13055 (Relobj::output_section): Remove poff parameter. Change all
13056 callers.
13057 (Relobj::output_section_offset): New function.
13058 (Relobj::set_section_offset): Rewrite.
13059 (Relobj::map_to_output): Remove.
13060 (Relobj::output_sections): New function.
13061 (Relobj::do_output_section_offset): New pure virtual function.
13062 (Relobj::do_set_section_offset): Likewise.
13063 (class Sized_relobj): Add section_offsets_ field. Add comdat
13064 group support from Relobj. Update declarations.
13065 (Sized_relobj::get_output_section_offset): New function.
13066 (Sized_relobj::do_output_section_offset): New function.
13067 (Sized_relobj::do_set_section_offset): New function.
13068 * object.cc (Relobj::output_section_address): Remove.
13069 (Sized_relobj::Sized_relobj): Initialize new fields.
13070 (Sized_relobj::include_section_group): Cast find_kept_object to
13071 Sized_relobj.
13072 (Sized_relobj::include_linkonce_section): Likewise.
13073 (Sized_relobj::do_layout): Use separate arrays for output section
13074 and output offset.
13075 (Sized_relobj::do_count_local_symbols): Change map_to_output to
13076 output_sections.
13077 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
13078 output_sections and section_offsets.
13079 (Sized_relobj::write_local_symbols): Likewise.
13080 (map_to_kept_section): Compute output address directly.
13081 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
13082 output_sections and section_offsets.
13083 (Sized_relobj::write_sections): Likewise.
13084 (Sized_relobj::relocate_sections): Likewise.
13085 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
13086 * output.h (class Output_reloc): Update declarations. Change
13087 u2_.relobj to Sized_relobj*.
13088 (class Output_data_reloc): Change add functions to use
13089 Sized_relobj*.
13090 * output.cc (Output_reloc::Output_reloc): Change relobj to
13091 Sized_relobj*.
13092 (Output_reloc::local_section_offset): Change return type to
13093 Elf_Addr. Use get_output_section_offset.
13094 (Output_reloc::get_address): Likewise.
13095 (Output_section::is_input_address_mapped): Don't call
13096 is_section_specially_mapped.
13097 (Output_section::output_offset): Likewise.
13098 (Output_section::output_address): Likewise.
13099 (Output_section::starting_output_address): Likewise.
13100 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
13101 parameter to Sized_relobj*.
13102 (Copy_relocs::need_copy_reloc): Likewise.
13103 (Copy_relocs::save): Likewise.
13104 * copy-relocs.h (class Copy_relocs): Update declarations.
13105 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
13106 Sized_relobj*. Change relobj_ field to Sized_relobj*.
13107 * target-reloc.h (relocate_for_relocatable): Change
13108 offset_in_output_section type to Elf_Addr. Change code that uses
13109 it as well.
13110 * layout.cc (Layout::layout): Always set *off.
13111 * mapfile.cc (Mapfile::print_input_section): Use
13112 output_section_offset.
13113 * i386.cc (Target_i386::copy_reloc): Change object parameter to
13114 Sized_relobj*.
13115 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
13116 * sparc.cc (Target_sparc::copy_reloc): Likewise.
13117 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
13118
5cb66f97
ILT
131192008-07-03 Ian Lance Taylor <iant@google.com>
13120
13121 * layout.cc (Layout::include_section): Do not discard unrecognized
13122 SHT_STRTAB sections.
13123
afe47622
CS
131242008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
13125
13126 * script.cc (Lex::can_continue_name): Make '?' allowable in
13127 version-script names.
13128 * testsuite/version_script.map: Change glob pattern to use '?'
13129
5adf9721
ILT
131302008-06-30 Manish Singh <yosh@gimp.org>
13131
13132 PR 6585
13133 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
13134 Correct typo.
13135
e6fde208
ILT
131362008-06-30 Ian Lance Taylor <iant@google.com>
13137
13138 PR 6660
13139 PR 6682
13140 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
13141 versions]: Don't try to read the value in the contents, since we
13142 don't use it. Use the template endianness when writing.
13143
3f2e6a2d
CC
131442008-06-25 Cary Coutant <ccoutant@google.com>
13145
13146 * fileread.cc (File_read::make_view): Assert on zero-length view.
13147 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
13148 symbol table when there are no symbols to read.
13149
c43d3a48
CS
131502008-06-23 Craig Silverstein <csilvers@google.com>
13151
13152 * version.cc (version_string): Bump to 1.7
13153
5f494ea0
CS
131542008-06-18 Craig Silverstein <csilvers@google.com>
13155
13156 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
13157 constant 0xFFFF to type Valtype.
13158 (Powerpc_relocate_functions::rel16_ha): Likewise.
13159
c42e122e
ILT
131602008-06-17 Ian Lance Taylor <iant@google.com>
13161
f34787f8
ILT
13162 * output.h (Output_section::Input_section): Initialize p2align_ to
13163 zero for Output_section_data constructors.
13164 (Output_section::Input_section::addralign): If not an input
13165 section, return the alignment of the Output_section_data.
13166 * testsuite/copy_test.cc: New file.
13167 * testsuite/copy_test_1.cc: New file.
13168 * testsuite/copy_test_2.cc: New file.
13169 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
13170 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
13171 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
13172 (copy_test_1_pic.o, copy_test_1.so): New targets.
13173 (copy_test_2_pic.o, copy_test_2.so): New targets.
13174 * testsuite/Makefile.in: Rebuild.
13175
c42e122e
ILT
13176 * script-sections.cc (Script_sections::place_orphan): Initialize
13177 local variable exact.
13178
ce3ac18a
DE
131792008-06-13 David Edelsohn <edelsohn@gnu.org>
13180
13181 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
13182
42cacb20
DE
131832008-06-12 David Edelsohn <edelsohn@gnu.org>
13184 David S. Miller <davem@davemloft.net>
13185
13186 * powerpc.cc: New file.
13187 * Makefile.am (TARGETSOURCES): Add powerpc.cc
13188 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
13189 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
13190 * Makefile.in: Rebuild.
13191
7b308235
ILT
131922008-06-09 Ian Lance Taylor <iant@google.com>
13193
13194 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
13195 <exception>.
13196 (throwing, orig_terminate): New static variables.
13197 (terminate_handler): New static function.
13198 (t2): Set terminate handler.
13199
f0b886e3
ILT
132002008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
13201
13202 PR 6584
cd536b21 13203 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
13204 alignment.
13205
3e90f135
CC
132062008-05-30 Cary Coutant <ccoutant@google.com>
13207
13208 * archive.cc (Archive::include_all_members) Correct to step
13209 over symbol table and extended name table in thin archives.
13210
e09ad04a
ILT
132112008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
13212
13213 PR 6407
13214 * target-reloc.h (relocate_for_relocatable): Fix new_offset
13215 calculation.
13216
62b01cb5
ILT
132172008-05-28 Caleb Howe <cshowe@google.com>
13218
13219 * reduced_debug_output.cc: New file.
13220 * reduced_debug_output.h: New file.
92de84a6 13221 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
13222 * options.cc (General_options::finalize): Add strip_debug_non_line
13223 to the strip heirarchy.
13224 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
13225 fields.
13226 * layout.cc: Include "reduced_debug_output.h".
13227 (Layout::Layout): Initialize new fields.
13228 (line_only_debug_sections): New static array.
13229 (is_lines_only_debug_sections): New static inline function.
13230 (Layout::include_section): Handle --strip-debug-non-line.
13231 (Layout::make_output_section): If --strip-debug-non-line, build
13232 new output sections for .debug_abbrev and .debug_info.
13233 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
13234 gold. Warn about possible overflow.
13235 (read_signed_LEB_128): Likewise.
13236 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
13237 (read_signed_LEB_128): Declare.
13238 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
13239 (HFILES): Add reduced_debug_output.h.
13240 * Makefile.in: Rebuild.
13241
7d9e3d98
ILT
132422008-05-21 Ian Lance Taylor <iant@google.com>
13243
13244 * mapfile.cc: New file.
13245 * mapfile.h: New file.
13246 * options.h (class General_options): Add -M/--print-map and -Map.
13247 * options.cc (General_options::finalize): Make -M equivalent to
13248 -Map -.
13249 * main.cc: Include <cstdio> and "mapfile.h".
13250 (main): Open mapfile if requested.
13251 * gold.cc (class Middle_runner): Add mapfile_ field. Update
13252 constructor. Change caller.
13253 (queue_initial_tasks): Add mapfile parameter. Change caller.
13254 (queue_middle_tasks): Likewise.
13255 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
13256 declarations.
13257 * archive.cc: Include "mapfile.h".
13258 (Archive::add_symbols): Add mapfile parameter. Change all
13259 callers. Pass mapfile, symbol, and reason to include_member.
13260 (Archive::include_all_members): Add mapfile parameter. Change all
13261 callers.
13262 (Archive::include_member): Add mapfile, sym, and why parameters.
13263 Change all callers. Report inclusion to map file.
13264 * archive.h: Include "fileread.h".
13265 (class Archive): Update declarations.
13266 (Archive::file): New const method.
13267 (class Add_archive_symbols): Add mapfile_ field. Update
13268 constructor. Change all callers.
13269 * readsyms.h (class Read_symbols): Likewise.
13270 (class Finish_group): Likewise.
13271 (class Read_script): Likewise.
13272 * common.cc: Include "mapfile.h".
13273 (Symbol_table::allocate_commons): Add mapfile parameter. Change
13274 all callers.
13275 (Symbol_table::do_allocate_commons): Likewise.
13276 (Symbol_table::do_allocate_commons_list): Likewise. Report common
13277 symbol allocation to mapfile.
13278 * common.h (class Allocate_commons_task): Add mapfile_ field.
13279 Update constructor. Change all callers.
13280 * symtab.h (class Symbol_table): Update declarations.
13281 * layout.cc: Include "mapfile.h".
13282 (Layout_task_runner::run): Print information to mapfile.
13283 (Layout::create_gold_note): Change Output_data_fixed_space to
13284 Output_data_zero_fill.
13285 (Layout::create_build_id): Likewise.
13286 (Layout::print_to_mapfile): New function.
13287 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
13288 constructor. Change caller.
13289 (class Layout): Declare print_to_mapfile.
13290 * output.cc (Output_section::Input_section::print_to_mapfile): New
13291 function.
13292 (Output_section::add_input_section): If producing a map, always
13293 add to input_sections_ list.
13294 (Output_section::do_print_to_mapfile): New function.
13295 (Output_segment::print_sections_to_mapfile): New function.
13296 (Output_segment::print_section_list_to_mapfile): New function.
13297 * output.h: Include "mapfile.h".
13298 (Output_data::print_to_mapfile): New function.
13299 (Output_data::do_print_to_mapfile): New virtual function.
13300 (Output_segment_headers::do_print_to_mapfile): New function.
13301 (Output_file_header::do_print_to_mapfile): New function.
13302 (Output_data_const::do_print_to_mapfile): New function.
13303 (class Output_data_const_buffer): Add map_name_ field. Update
13304 constructor. Change all callers. Add do_print_to_mapfile
13305 function.
13306 (class Output_data_fixed_space): Likewise.
13307 (class Output_data_space): Likewise.
13308 (class Output_data_zero_fill): New class.
13309 (Output_data_strtab::do_print_to_mapfile): New function.
13310 (Output_data_reloc_base::do_print_to_mapfile): New function.
13311 (Output_relocatable_relocs::do_print_to_mapfile): New function.
13312 (Output_data_group::do_print_to_mapfile): New function.
13313 (Output_data_got::do_print_to_mapfile): New function.
13314 (Output_data_dynamic::do_print_to_mapfile): New function.
13315 (Output_symtab_xindex::do_print_to_mapfile): New function.
13316 (class Output_section): Declare do_print_to_mapflie. Declare
13317 print_to_mapfile in Input_section.
13318 (class Output_segment): Declare new functions.
13319 * object.h (Sized_relobj::symbol_count): New function.
13320 * script-sections.cc
13321 (Output_section_element_dot_assignment::set_section_addresses):
13322 Change Output_data_fixed_space to Output_data_zero_fill.
13323 (Output_data_expression::do_print_to_mapfile): New function.
13324 * script.cc (read_input_script): Add mapfile parameter. Change
13325 all callers.
13326 * script.h (read_input_script): Update declaration.
13327 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
13328 (Eh_frame::do_print_to_mapfile): New function.
13329 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
13330 (Output_merge_string::do_print_to_mapfile): New function.
13331 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
13332 function.
13333 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
13334 function.
13335 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
13336 function.
13337 * Makefile.am (CCFILES): Add mapfile.cc.
13338 (HFILES): Add mapfile.h.
13339 * Makefile.in: Rebuild.
13340
9f1d377b
ILT
133412008-05-19 Ian Lance Taylor <iant@google.com>
13342
13343 * options.h (class General_options): Add -z relro.
13344 * layout.cc (Layout::Layout): Initialize relro_segment_.
13345 (Layout::add_output_section_data): Return the output section.
13346 (Layout::make_output_section): Rcognize relro sections and mark
13347 them appropriately.
13348 (Layout::attach_allocated_section_to_segment): Put relro sections
13349 in a PT_GNU_RELRO segment.
13350 (Layout::create_initial_dynamic_sections): Mark the .dynamic
13351 section as relro.
13352 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
13353 PT_TLS segments.
13354 (Layout::linkonce_mapping): Map d.rel.ro.local to
13355 .data.rel.ro.local.
13356 (Layout::output_section_name): Us .data.rel.ro.local for any
13357 section which begins with that.
13358 * layout.h (class Layout): Update add_output_section_data
13359 declaration. Add relro_segment_ field.
13360 * output.cc (Output_section::Output_section): Initialize is_relro_
13361 and is_relro_local_ fields.
13362 (Output_segment::add_output_section): Group relro sections.
13363 (Output_segment::is_first_section_relro): New function.
13364 (Output_segment::maximum_alignment): If there is a relro section,
13365 align the segment to the common page size.
13366 (Output_segment::set_section_addresses): Track whether we are
13367 looking at relro sections. If the last section is a relro
13368 section, align to the common page size.
13369 (Output_segment::set_section_list_addresses): Add in_relro
13370 parameter. Change all callers. Align to the page size when
13371 moving from relro to non-relro section.
13372 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
13373 segment.
13374 * output.h (class Output_section): Add is_relro_ and
13375 is_relro_local_ fields.
13376 (Output_section::is_relro): New function.
13377 (Output_section::set_is_relro): New function.
13378 (Output_section::is_relro_local): New function.
13379 (Output_section::set_is_relro_local): New function.
13380 (class Output_segment): Update declarations.
13381 * i386.cc (Target_i386::got_section): Mark .got section as relro.
13382 * sparc.cc (Target_sparc::got_section): Likewise.
13383 * x86_64.cc (Target_x86_64::got_section): Likewise.
13384 * testsuite/relro_test_main.cc: New file.
13385 * testsuite/relro_test.cc: New file.
13386 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
13387 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
13388 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
13389 (relro_test.so, relro_test_pic.o): New targets.
13390 * testsuite/Makefile.in: Rebuild.
13391
a984ee1d
ILT
133922008-05-16 Ian Lance Taylor <iant@google.com>
13393
01676dcd
ILT
13394 * output.cc (Output_segment::add_output_section): Remove front
13395 parameter.
13396 * output.h (class Output_segment): Remove
13397 add_initial_output_section and overloaded add_output_section.
13398 Update declaration of remaining add_output_section.
13399 * layout.cc (Layout::create_interp): Call add_output_section
13400 rather than add_initial_output_section.
13401 (Layout::finish_dynamic_section): Likewise.
13402
497897f9
ILT
13403 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
13404 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
13405 know the dynamic type.
13406 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
13407 field. Initialize it in constructor.
13408 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
13409 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
13410 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
13411 reloc.
13412
a984ee1d
ILT
13413 * output.cc (Output_reloc::get_address): Change return type to
13414 Elf_Addr.
13415 * output.h (class Output_reloc): Update get_address declaration.
13416 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
13417 for section addresses.
13418
55ba0940
ILT
134192008-05-09 Ian Lance Taylor <iant@google.com>
13420
13421 PR 6493
13422 * gold.cc (gold_nomem): Use return value of write.
13423
75517b77
ILT
134242008-05-08 Ian Lance Taylor <iant@google.com>
13425
13426 * symtab.c (Symbol::init_base_output_data): Add version
13427 parameter. Change all callers.
13428 (Symbol::init_base_output_segment): Likewise.
13429 (Symbol::init_base_constant): Likewise.
13430 (Symbol::init_base_undefined): Likewise.
13431 (Sized_symbol::init_output_data): Likewise.
13432 (Sized_symbol::init_output_segment): Likewise.
13433 (Sized_symbol::init_constant): Likewise.
13434 (Sized_symbol::init_undefined): Likewise.
13435 (Symbol_table::do_define_in_output_data): If the new symbol has a
13436 version, mark it as the default.
13437 (Symbol_table::do_define_in_output_segment): Likewise.
13438 (Symbol_table::do_define_as_constant): Likewise.
13439 * symtab.h (class Symbol): Update declarations.
13440 (class Sized_symbol): Likewise.
13441 * resolve.cc (Symbol::override_version): New function.
c42e122e 13442 (Symbol::override_base): Call override_version.
75517b77
ILT
13443 (Symbol::override_base_with_special): Likewise.
13444 * testsuite/ver_script_8.script: New file.
13445 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
13446 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
13447 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
13448 (ver_test_8_1.so, ver_test_8_2.so): New targets.
13449
f1f70eae
ILT
134502008-05-06 Ian Lance Taylor <iant@google.com>
13451
f3e9c5c5
ILT
13452 PR 6049
13453 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
13454 functions.
13455 (class General_options): Remove existing --undefined, and add
13456 --no-undefined instead. Add new --undefined as synonym for -u.
13457 * archive.cc (Archive::add_symbols): Check whether symbol was
13458 named with -u.
13459 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
13460 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
13461 all uses. Add IS_UNDEFINED. Update declarations to split
13462 different versions of init_base. Declare init_base_undefined.
13463 (Symbol::is_defined): Handle IS_UNDEFINED.
13464 (Symbol::is_undefined): Likewise.
13465 (Symbol::is_weak_undefined): Call is_undefined.
13466 (Symbol::is_absolute): Handle IS_CONSTANT.
13467 (class Sized_symbol): Update declarations to split different
13468 versions of init. Declare init_undefined.
13469 (class Symbol_table): Declare new functions.
13470 * symtab.cc (Symbol::init_base_object): Rename from init_base.
13471 Change all callers.
13472 (Symbol::init_base_output_data): Likewise.
13473 (Symbol::init_base_output_segment): Likewise.
13474 (Symbol::init_base_constant): Likewise.
13475 (Symbol::init_base_undefined): New function.
13476 (Sized_symbol::init_object): Rename from init. Change all
13477 callers.
13478 (Sized_symbol::init_output_data): Likewise.
13479 (Sized_symbol::init_output_segment): Likewise.
13480 (Sized_symbol::init_constant): Likewise.
13481 (Sized_symbol::init_undefined): New function.
13482 (Symbol_table::add_undefined_symbols_from_command_line): New
13483 function.
13484 (Symbol_table::do_add_undefined_symbols_from_command_line): New
13485 function.
13486 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
13487 (Symbol::output_section): Likewise.
13488 (Symbol::set_output_section): Likewise.
13489 (Symbol_table::sized_finalize_symbol): Likewise.
13490 (Symbol_table::sized_write_globals): Likewise.
13491 * resolve.cc (Symbol_table::should_override): Likewise.
13492 (Symbol::override_base_with_special): Likewise.
13493
8bdcdf2c
ILT
13494 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
13495 symbol, change it to have default visibility.
13496 * testsuite/protected_1.cc: New file.
13497 * testsuite/protected_2.cc: New file.
13498 * testsuite/protected_3.cc: New file.
13499 * testsuite/protected_main_1.cc: New file.
13500 * testsuite/protected_main_2.cc: New file.
13501 * testsuite/protected_main_3.cc: New file.
13502 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
13503 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
13504 (protected_1_LDFLAGS, protected_1_LDADD): Define.
13505 (protected_1.so): New target.
13506 (protected_1_pic.o, protected_2_pic.o): New targets.
13507 (protected_3_pic.o): New target.
13508 (check_PROGRAMS): Add protected_2.
13509 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
13510 (protected_2_LDFLAGS, protected_2_LDADD): Define.
13511 * testsuite/Makefile.in: Rebuild.
13512
2b706932
ILT
13513 * options.h (DEFINE_var): Add set_user_set_##varname__.
13514 (DEFINE_bool_alias): New macro.
13515 (class General_options): Define -Bstatic using DEFINE_bool_alias
13516 rather than DEFINE_special. Add --undefined as an alias for -z
13517 defs.
13518 * options.cc (General_options::parse_Bstatic): Remove.
13519
d82a5bcc
ILT
13520 * options.h (class General_options): Add --fatal-warnings.
13521 * main.cc (main): Implement --fatal-warnings.
13522 * errors.h (Errors::warning_count): New function.
13523
f1f70eae
ILT
13524 * options.h (class General_options): Add -Bsymbolic-functions.
13525 * symtab.h (Symbol::is_preemptible): Check for
13526 -Bsymbolic-functions.
13527
8825ac63
ILT
135282008-05-05 Ian Lance Taylor <iant@google.com>
13529
d98bc257
ILT
13530 * options.h (DEFINE_bool): For DASH_Z, create the negative option
13531 as noVARNAME rather than no-VARNAME.
13532 (class General_options): Add option -z combreloc.
13533 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
13534 get_address.
13535 (Output_reloc::sort_before) [SHT_REL]: New function.
13536 (Output_reloc::sort_before) [SHT_RELA]: New function.
13537 (class Output_data_reloc_base): Add sort_relocs_ field. Define
13538 Sort_relocs_comparison.
13539 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
13540 parameter. Change all callers.
13541 (Output_data_reloc::Output_data_reloc) [both versions]: Add
13542 sort_relocs parameter. Change all callers.
13543 * output.cc (Output_reloc::get_address): New function, broken out
13544 of write_rel.
13545 (Output_reloc::write_rel): Call it.
13546 (Output_reloc::compare): New function.
13547 (Output_data_reloc_base::do_write): Optionally sort relocs.
13548
60b2b4e7
ILT
13549 * configure.ac: If targ_extra_obj is set, link it in.
13550 * configure.tgt: Initialize all variables.
13551 (x86_64*): Set targ_extra_obj and targ_extra_size.
13552 * configure: Rebuild.
13553
8825ac63
ILT
13554 * object.cc (Sized_relobj::include_section_group): Adjust section
13555 indexes read from group data. Build vector to pass to
13556 layout_group.
13557 * layout.cc (Layout::layout_group): Add flags and shndxes
13558 parameters. Remove contents parameter. Change caller. Update
13559 explicit instantiations.
13560 * layout.h (class Layout): Update layout_group declaration.
13561 * output.cc (Output_data_group::Output_data_group): Add flags and
13562 input_shndxes parameters. Remove contents parameter. Change
13563 caller.
13564 (Output_data_group::do_write): Change input_sections_ to
13565 input_shndxes_.
13566 * output.h (class Output_data_group): Update constructor
13567 declaration. Rename input_sections_ to input_shndxes_.
13568 * testsuite/many_sections_test.cc: Add template.
13569
e94cf127
CC
135702008-04-30 Cary Coutant <ccoutant@google.com>
13571
4418b2d5
CC
13572 * target-reloc.h (relocate_section): Fix dead-pointer bug.
13573
e94cf127
CC
13574 * layout.cc (Layout::include_section): Refactored check for debug
13575 info section.
13576 (Layout::add_comdat): Add new parameters. Change type
13577 of signature parameter. Add object and shndx to signatures table.
13578 (Layout::find_kept_object): New function.
13579 * layout.h: Include <cstring>.
13580 (Layout::is_debug_info_section): New function.
13581 (Layout::add_comdat): Add new parameters.
13582 (Layout::find_kept_object): New function.
13583 (Layout::Kept_section): New struct.
13584 (Layout::Signatures): Change type of map range.
13585 * object.cc (Relobj::output_section_address): New function.
13586 (Sized_relobj::include_section_group): Add new parameters. Change
13587 calls to Layout::add_comdat. Change to build table of kept comdat
13588 groups and table mapping discarded sections to kept sections.
13589 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
13590 (Sized_relobj::do_layout): Change calls to include_section_group and
13591 include_linkonce_section.
13592 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
13593 value to zero when section is discarded.
13594 (Sized_relobj::map_to_kept_section): New function.
13595 * object.h (Relobj::output_section_address): New function.
13596 (Relobj::Comdat_group): New type.
13597 (Relobj::find_comdat_group): New function.
13598 (Relobj::Comdat_group_table): New type.
13599 (Relobj::Kept_comdat_section): New type.
13600 (Relobj::Kept_comdat_section_table): New type.
13601 (Relobj::add_comdat_group): New function.
13602 (Relobj::set_kept_comdat_section): New function.
13603 (Relobj::get_kept_comdat_section): New function.
13604 (Relobj::comdat_groups_): New field.
13605 (Relobj::kept_comdat_sections_): New field.
13606 (Symbol_value::input_value): Update comment.
13607 (Sized_relobj::map_to_kept_section) New function.
13608 (Sized_relobj::include_linkonce_section): Add new parameter.
13609 * target-reloc.h (Comdat_behavior): New type.
13610 (get_comdat_behavior): New function.
13611 (relocate_section): Add code to map a discarded section to the
13612 corresponding kept section when applying a relocation.
13613
e4e5049b
CS
136142008-04-30 Craig Silverstein <csilvers@google.com>
13615
13616 * dwarf_reader.cc (next_generation_count): New static var.
13617 (Addr2line_cache_entry): New struct.
13618 (addr2line_cache): New static var.
13619 (Dwarf_line_info::one_addr2line): Added caching.
13620 (Dwarf_line_info::clear_addr2line_cache): New function.
13621 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
13622 cache-size parameter.
13623 (Dwarf_line_info::one_addr2line_cache): New function.
13624 * symtab.cc (Symbol_table::detect_odr_violations): Pass
13625 new cache-size argument to one_addr2line(), and clear cache.
13626
d09e9154
CC
136272008-04-28 Cary Coutant <ccoutant@google.com>
13628
13629 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
13630 R_386_PC8 relocations.
13631
7ef73768
ILT
136322008-04-23 Ian Lance Taylor <iant@google.com>
13633
55438702
ILT
13634 * object.cc (Sized_relobj::include_section_group): Check for
13635 invalid section group.
13636
c165fb93
ILT
13637 * object.cc (make_elf_object): Correct test for 64-bit ELF file
13638 header size.
13639
7ef73768
ILT
13640 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
13641 than read for file header.
13642 * archive.cc (Archive::include_member): Likewise.
13643
6194aaab
L
136442008-04-23 Paolo Bonzini <bonzini@gnu.org>
13645
13646 * aclocal.m4: Regenerate.
13647 * configure: Regenerate.
13648
d491d34e
ILT
136492008-04-19 Ian Lance Taylor <iant@google.com>
13650
5ea2bac6
ILT
13651 * version.cc (version_string): Bump to 1.6.
13652
7bc3e21a
ILT
13653 * testsuite/Makefile.am (many_sections_r_test): New target.
13654 (many_sections_r_test_SOURCES): Remove.
13655 (many_sections_r_test_DEPENDENCIES): Remove.
13656 (many_sections_r_test_LDFLAGS): Remove.
13657 (many_sections_r_test_LDADD): Remove.
13658
7fcd3aa9
ILT
13659 * object.cc (Sized_relobj::do_add_symbols): Always pass
13660 local_symbol_count_ to add_from_relobj.
13661
4c94d6ae
ILT
13662 * testsuite/Makefile.am (many_sections_check.h): Only check one in
13663 every thousand variables.
13664 * testsuite/Makefile.in: Rebuild.
13665
d491d34e
ILT
13666 * object.cc (Xindex::initialize_symtab_xindex): New function.
13667 (Xindex::read_symtab_xindex): New function.
13668 (Xindex::sym_xindex_to_shndx): New function.
13669 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
13670 available.
13671 (Sized_relobj::do_initialize_xindex): New function.
13672 (Sized_relobj::do_read_symbols): Adjust section links.
13673 (Sized_relobj::symbol_section_and_value): Add is_ordinary
13674 parameter. Change all callers.
13675 (Sized_relobj::include_section_group): Adjust section links and
13676 symbol section indexes.
13677 (Sized_relobj::do_layout): Adjust section links.
13678 (Sized_relobj::do_count_local_symbols): Adjust section links and
13679 symbol section indexes.
13680 (Sized_relobj::do_finalize_local_symbols): Distinguish between
13681 ordinary and special symbols.
13682 (Sized_relobj::write_local_symbols): Add symtab_xindex and
13683 dynsym_xindex parameters. Change all callers. Adjust section
13684 links. Use SHN_XINDEX when needed.
13685 (Sized_relobj::get_symbol_location_info): Adjust section links.
13686 Don't get fooled by special symbols.
13687 * object.h (class Xindex): Define.
13688 (class Object): Add xindex_ parameter. Declare virtual functoin
13689 do_initialize_xindex.
13690 (Object::adjust_sym_shndx): New function.
13691 (Object::set_xindex): New protected function.
13692 (class Symbol_value): Add is_ordinary_shndx_ field.
13693 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
13694 (Symbol_value::value): Assert ordinary section.
13695 (Symbol_value::initialize_input_to_output_map): Likewise.
13696 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
13697 Change all callers.
13698 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
13699 all callers.
13700 (class Sized_relobj): Update declarations.
13701 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
13702 parameter. Change all callers.
13703 (Sized_relobj::adjust_shndx): New function.
13704 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
13705 field.
13706 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
13707 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
13708 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
13709 (Sized_dynobj::read_dynsym_section): Adjust section links.
13710 (Sized_dynobj::read_dynamic): Likewise.
13711 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
13712 section links.
13713 (Sized_dynobj::do_initialize_xindex): New function.
13714 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
13715 do_initialize_xindex.
13716 (Sized_dynobj::adjust_shndx): New function.
13717 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
13718 dynsym_xindex_ fields.
13719 (Layout::finalize): Add a call to set_section_indexes before
13720 creating the symtab sections.
13721 (Layout::set_section_indexes): Don't do anything if the section
13722 already has a section index.
13723 (Layout::create_symtab_sections): Add shnum parameter. Change
13724 caller. Create .symtab_shndx section if needed.
13725 (Layout::create_shdrs): Add shstrtab_section parameter. Change
13726 caller.
13727 (Layout::allocated_output_section_count): New function.
13728 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
13729 needed.
13730 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
13731 fields. Update declarations.
13732 (Layout::symtab_xindex): New function.
13733 (Layout::dynsym_xindex): New function.
13734 (class Write_symbols_task): Add layout_ field.
13735 (Write_symbols_task::Write_symbols_task): Add layout parameter.
13736 Change caller.
13737 * output.cc (Output_section_headers::Output_section_headers): Add
13738 shstrtab_section parameter. Change all callers.
13739 (Output_section_headers::do_sized_write): Store overflow values
13740 for section count and section string table section index in
13741 section header zero.
13742 (Output_file_header::do_sized_write): Check for overflow of
13743 section count and section string table section index.
13744 (Output_symtab_xindex::do_write): New function.
13745 (Output_symtab_xindex::endian_do_write): New function.
13746 * output.h (class Output_section_headers): Add shstrtab_section_.
13747 Update declarations.
13748 (class Output_symtab_xindex): Define.
13749 (Output_section::has_out_shndx): New function.
13750 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
13751 field.
13752 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
13753 Change all callers.
13754 (Sized_symbol::init): Likewise.
13755 (Symbol::output_section): Check for ordinary symbol.
13756 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
13757 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
13758 callers.
13759 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
13760 Change all callers. Simplify handling of symbols from sections
13761 not included in the link.
13762 (Symbol_table::add_from_dynobj): Handle ordinary symbol
13763 distinction.
13764 (Weak_alias_sorter::operator()): Assert that symbols are
13765 ordinary.
13766 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
13767 distinction.
13768 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
13769 parameters. Change all callers.
13770 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
13771 symbol distinction. Use SHN_XINDEX when needed.
13772 (Symbol_table::write_section_symbol): Add symtab_xindex
13773 parameter. Change all callers.
13774 (Symbol_table::sized_write_section_symbol): Likewise. Use
13775 SHN_XINDEX when needed.
13776 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
13777 declarations.
13778 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
13779 (Symbol::is_defined): Check is_ordinary.
13780 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
13781 (Symbol::is_absolute, Symbol::is_common): Likewise.
13782 (class Sized_symbol): Update declarations.
13783 (class Symbol_table): Update declarations.
13784 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
13785 parameters. Change all callers.
13786 (Sized_symbol::override): Likewise.
13787 (Symbol_table::override): Likewise.
13788 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
13789 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
13790 is_ordinary, and orig_st_shndx parameters. Change all callers.
13791 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
13792 to be in an ordinary section.
13793 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
13794 object and is_ordinary parameters. Change all callers.
13795 (Sized_dwarf_line_info::read_relocs): Add object parameter.
13796 Change all callers. Don't add undefined or non-ordinary symbols
13797 to reloc_map_.
13798 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
13799 Change all callers.
13800 * dwarf_reader.h (class Sized_dwarf_line_info): Update
13801 declarations.
13802 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
13803 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
13804 (Sized_relobj::relocate_sections): Likewise.
13805 * target-reloc.h (scan_relocs): Adjust section symbol index.
13806 (scan_relocatable_relocs): Likewise.
13807 * i386.cc (Scan::local): Check for ordinary symbols.
13808 * sparc.cc (Scan::local): Likewise.
13809 * x86_64.cc (Scan::local): Likewise.
13810 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
13811 to symbol_section_and_value.
13812 * testsuite/many_sections_test.cc: New file.
13813 * testsuite/Makefile.am (BUILT_SOURCES): Define.
13814 (check_PROGRAMS): Add many_sections_test.
13815 (many_sections_test_SOURCES): Define.
13816 (many_sections_test_DEPENDENCIES): Define.
13817 (many_sections_test_LDFLAGS): Define.
13818 (BUILT_SOURCES): Add many_sections_define.h.
13819 (many_sections_define.h): New target.
13820 (BUILT_SOURCES): Add many_sections_check.h.
13821 (many_sections_check.h): New target.
13822 (check_PROGRAMS): Add many_sections_r_test.
13823 (many_sections_r_test_SOURCES): Define.
13824 (many_sections_r_test_DEPENDENCIES): Define.
13825 (many_sections_r_test_LDFLAGS): Define.
13826 (many_sections_r_test_LDADD): Define.
13827 (many_sections_r_test.o): New target.
13828 * testsuite/Makefile.in: Rebuild.
13829
c5818ff1
CC
138302008-04-17 Cary Coutant <ccoutant@google.com>
13831
13832 * errors.cc (Errors::info): New function.
13833 (gold_info): New function.
13834 * errors.h (Errors::info): New function.
13835 * gold.h (gold_info): New function.
13836 * object.cc (Input_objects::add_object): Print trace output.
13837 * options.cc (options::parse_set): New function.
13838 (General_options::parse_wrap): Deleted.
13839 (General_options::General_options): Deleted initializer.
13840 * options.h (options::String_set): New typedef.
13841 (options::parse_set): New function.
13842 (DEFINE_set): New macro.
13843 (General_options::wrap): Changed to use DEFINE_set. Changed
13844 callers of any_wrap_symbols and is_wrap_symbol.
13845 (General_options::trace, General_options::trace_symbol):
13846 New options.
13847 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
13848 (General_options::wrap_symbols_): Deleted.
13849 * symtab.cc (Symbol_table::add_from_object): Print trace output.
13850
b5be4a7c
DM
138512008-04-17 David S. Miller <davem@davemloft.net>
13852
13853 * options.cc (General_options::parse_V): New function.
13854 * options.h: Add entries for -V and -Qy.
13855
155a0dd7
ILT
138562008-04-17 Ian Lance Taylor <iant@google.com>
13857
13858 * common.cc (Symbol_table::allocate_commons): Remove options
13859 parameter. Change caller.
13860 (Symbol_table::do_allocate_commons): Remove options parameter.
13861 Change caller. Just call do_allocate_commons_list twice.
13862 (Symbol_table::do_allocate_commons_list): New function, broken out
13863 of do_allocate_commons.
13864 * common.h (class Allocate_commons_task): Remove options_ field.
13865 Update constructor.
13866 * symtab.cc (Symbol_table::Symbol_table): Initialize
13867 tls_commons_.
13868 (Symbol_table::add_from_object): Put TLS common symbols on
13869 tls_commons_ list.
13870 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
13871 which are IN_OUTPUT_DATA.
13872 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
13873 allocate_commons and do_allocate_commons declarations. Declare
13874 do_allocate_commons_list.
13875 * gold.cc (queue_middle_tasks): Update creation of
13876 Allocate_commons_task to not pass options.
13877 * testsuite/Makefile.am (INCLUDES): Add -I.. .
13878 (TLS_TEST_C_FLAGS): New variable.
13879 (tls_test_c_pic.o): New target.
13880 (tls_test_shared.so): Link in tls_test_c_pic.o.
13881 (tls_test_c_pic_ie.o): New target.
13882 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
13883 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
13884 (tls_test_c.o): New target.
13885 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
13886 (tls_pic_test_LDADD): Likewise.
13887 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
13888 (tls_shared_gd_to_ie_test_LDADD): Likewise.
13889 (tls_test_c_gnu2.o): New target.
13890 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
13891 tls_test_c_gnu2.o.
13892 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
13893 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
13894 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
13895 * testsuite/tls_test.cc: Include "config.h".
13896 (t_last): Call t11_last.
13897 * testsuite/tls_test.h (t11, t11_last): Declare.
13898 * testsuite/tls_test_c.c: New file.
13899 * testsuite/tls_test_main.cc (thread_routine): Call t11.
13900 * configure.ac: Check for OpenMP support.
13901 * configure, config.in, Makefile.in: Rebuild.
13902 * testsuite/Makefile.in: Rebuild.
13903
edfbb029
CC
139042008-04-16 Cary Coutant <ccoutant@google.com>
13905
13906 * i386.cc (Target_i386::define_tls_base_symbol): New function.
13907 (Target_i386::tls_base_symbol_defined_): New field.
13908 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
13909 (Target_i386::Scan::global): Likewise.
13910 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
13911 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
13912 (Target_x86_64::tls_base_symbol_defined_): New field.
13913 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
13914 (Target_x86_64::Scan::global): Likewise.
13915
f3c69fca
CC
139162008-04-16 Cary Coutant <ccoutant@google.com>
13917
13918 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
13919 (Symbol::needs_plt_entry): Allow weak undefined symbols.
13920 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
13921 building shared libraries.
13922 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
13923 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
13924 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
13925 * testsuite/Makefile.in: Rebuild.
13926 * testsuite/weak_undef.h: New file.
13927 * testsuite/weak_undef_file1.cc: Add extra test cases.
13928 * testsuite/weak_undef_file2.cc: Likewise.
13929 * testsuite/weak_undef_test.cc: Likewise.
13930
7c414435
DM
139312008-04-16 David S. Miller <davem@davemloft.net>
13932
32b769e1
DM
13933 * sparc.cc (Target_sparc::Scan): Change from struct to class.
13934 Add issued_non_pic_error_ field. Declare check_non_pic.
13935 (Target_sparc::Scan::check_non_pic): New function.
13936 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
13937 (Target_sparc::Scan::global): Likewise.
13938
11936fb1
DM
13939 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
13940 * configure: Rebuild.
13941
7c414435
DM
13942 * options.h (DEFINE_enable): New macro.
13943 (new_dtags): New enable option.
13944 (initfirst, interpose, loadfltr, nodefaultlib,
13945 nodelete, nodlopen, nodump): New -z options.
13946 * layout.cc (Layout:finish_dynamic_section): If new
13947 dtags enabled, emit DT_RUNPATH. Also, emit a
13948 DT_FLAGS_1 containing any specified -z flags.
13949
85c7bf8b
ILT
139502008-04-16 Ian Lance Taylor <iant@google.com>
13951
12c0daef
ILT
13952 * copy-relocs.cc: New file.
13953 * copy-relocs.h: New file.
13954 * reloc.cc: Remove Copy_relocs code.
13955 * reloc.h: Likewise.
13956 * reloc-types.h (struct Reloc_types) [both versions]: Add
13957 get_reloc_addend_noerror.
13958 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
13959 variants of add_global which take an addend which must be zero.
13960 * i386.cc: Include "copy-relocs.h".
13961 (class Target_i386): Change type of copy_relocs_ to variable,
13962 update initializer.
13963 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
13964 Change all callers.
13965 (Target_i386::do_finalize_sections): Change handling of
13966 copy_relocs_.
13967 * sparc.cc: Include "copy-relocs.h".
13968 (class Target_sparc): Change type of copy_relocs_ to variable,
13969 update initializer.
13970 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
13971 Change all callers.
13972 (Target_sparc::do_finalize_sections): Change handling of
13973 copy_relocs_.
13974 * x86_64.cc: Include "copy-relocs.h".
13975 (class Target_x86_64): Change type of copy_relocs_ to variable,
13976 update initializer.
13977 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
13978 class. Change all callers.
13979 (Target_x86_64::do_finalize_sections): Change handling of
13980 copy_relocs_.
13981 * Makefile.am (CCFILES): Add copy-relocs.cc.
13982 (HFILES): Add copy-relocs.h.
13983
4f4995b6
ILT
13984 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
13985
85c7bf8b
ILT
13986 * testsuite/script_test_4.sh: Permit leading zeroes.
13987
4f2a9edd
ILT
139882008-04-15 Ian Lance Taylor <iant@google.com>
13989
e6188289
ILT
13990 * script-sections.cc (Script_sections::create_segments): Use
13991 header_size_adjustment even when there is enough room for the
13992 headers.
13993 * testsuite/script_test_4.sh: New file.
13994 * testsuite/script_test_4.t: New file.
13995 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
13996 (check_DATA): Add script_test_4.stdout.
13997 (MOSTLYCLEANFILES): Likewise.
13998 (script_test_4): New target.
13999 (script_test_4.stdout): New target.
14000 * testsuite/Makefile.in: Rebuild.
14001
4f2a9edd
ILT
14002 * sparc.cc: Add definitions for Output_data_plt_sparc class
14003 constants.
14004
f5314dd5
DM
140052008-04-14 David S. Miller <davem@davemloft.net>
14006
14007 * sparc.cc: New file.
14008 * Makefile.am (TARGETSOURCES): Add sparc.cc
14009 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
14010 * configure.tgt: Document targ_extra_size and
14011 targ_extra_big_endian. Add entries for sparc-* and
14012 sparc64-*.
14013 * configure.ac: Handle targ_extra_size and
14014 targ_extra_big_endian.
14015 * Makefile.in: Rebuild.
14016 * configure: Likewise.
14017 * po/POTFILES.in: Likewise.
14018 * po/gold.pot: Likewise.
14019
154e0e9a
ILT
140202008-04-14 Ian Lance Taylor <iant@google.com>
14021
14022 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
14023 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
14024 in the name/type/flags to section mapping. Don't call
14025 allocate_output_section.
14026 (Layout::choose_output_section): Change parameter from adjust_name
14027 to is_input_section. Don't permit input sections after sections
14028 are attached to segments. Don't call allocate_output_section.
14029 (Layout::layout_eh_frame): Call update_flags_for_input_section,
14030 not write_enable_output_section.
14031 (Layout::make_output_section): Don't push to
14032 unattached_section_list_ nor call attach_to_segment. Call
14033 attach_section_to_segment if sections are attached.
14034 (Layout::attach_sections_to_segments): New function.
14035 (Layout::attach_section_to_segment): New function.
14036 (Layout::attach_allocated_section_to_segment): Rename from
14037 attach_to_segment. Remove flags parameter.
14038 (Layout::allocate_output_section): Remove function.
14039 (Layout::write_enable_output_section): Remove function.
14040 * layout.h (class Layout): Update for above changes. Add new
14041 field sections_are_attached_.
14042 * output.h (Output_section::update_flags_for_input_section): New
14043 function.
14044 * output.cc (Output_section::add_input_section): Call
14045 update_flags_for_input_section.
14046 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
14047
009a67a2
CC
140482008-04-11 Cary Coutant <ccoutant@google.com>
14049
14050 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
14051 thought unnecessary.
14052 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
14053
759b1a24
ILT
140542008-04-11 Ian Lance Taylor <iant@google.com>
14055
14056 * output.h (class Output_section_data): Remove inline definition
14057 of set_addralign.
14058 * output.cc (Output_section_data::set_addralign): New function.
14059
c2b45e22
CC
140602008-04-11 Cary Coutant <ccoutant@google.com>
14061
14062 Add support for TLS descriptors for i386 and x86_64.
14063 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
14064 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
14065 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
14066 GOT_TYPE_TLS_DESC.
14067 (Target_i386::got_mod_index_entry): Remove unnecessary code.
14068 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
14069 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
14070 relocations.
14071 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
14072 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
14073 Fix problem with initial-exec relocations.
14074 (Target_i386::Relocate::relocate_tls): Likewise.
14075 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
14076 relaxation.
14077 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
14078 support for section-plus-offset dynamic table entries.
14079 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
14080 (Output_data_dynamic::Dynamic_entry): Add support for
14081 section-plus-offset dynamic table entries.
14082 (Output_data_dynamic::Classification): Likewise.
14083 (Output_data_dynamic::classification_): Renamed offset_.
14084 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
14085 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
14086 (Target_x86_64::make_plt_section): New function.
14087 (Target_x86_64::reserve_tlsdesc_entries): New function.
14088 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
14089 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
14090 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
14091 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
14092 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
14093 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
14094 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
14095 add extra PLT entry for TLS descriptors.
14096 (Output_data_plt_x86_64::got_): New field.
14097 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
14098 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
14099 fields.
14100 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
14101 descriptors.
14102 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
14103 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
14104 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
14105 R_386_TLS_DESC_CALL relocations.
14106 (Target_x86_64::Scan::global): Likewise.
14107 (Target_x86_64::do_finalize_sections): Add dynamic table entries
14108 for TLS descriptors.
14109 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
14110 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
14111 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
14112 GD-to-IE relaxation.
14113 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
14114 and TLS_DESCRIPTORS.
14115 * Makefile.in: Rebuild.
14116 * configure: Rebuild.
14117 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
14118 (tls_test_shared2.so): New target.
14119 (tls_shared_gd_to_ie_test_SOURCES): New variable.
14120 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
14121 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
14122 (tls_shared_gd_to_ie_test_LDADD): New variable.
14123 (tls_shared_gnu2_gd_to_ie_test): New target.
14124 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
14125 New targets.
14126 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
14127 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
14128 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
14129 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
14130 (tls_shared_gnu2_test): New target.
14131 (tls_test_gnu2_shared.so): New target.
14132 (tls_shared_gnu2_test_SOURCES): New variable.
14133 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
14134 (tls_shared_gnu2_test_LDFLAGS): New variable.
14135 (tls_shared_gnu2_test_LDADD): New variable.
14136 * testsuite/Makefile.in: Rebuild.
14137 * testsuite/Makefile.
14138
83bfb6b7
ILT
141392008-04-11 Ian Lance Taylor <iant@google.com>
14140
14141 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
14142 justsyms.t.
14143 * testsuite/Makefile.in: Rebuild.
14144
14145 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
14146 long.
14147 * testsuite/script_test_2.cc (main): Adjust test.
14148
706e1f5e
ILT
141492008-04-11 David S. Miller <davem@davemloft.net>
14150 Ian Lance Taylor <iant@google.com>
14151
14152 * options.h (General_options): Add entries for '-Y' and
14153 '-relax'.
14154 * options.cc (General_options:finalize): If -Y was used, add those
14155 entries to the library path instead of the default "/lib" and
14156 "/usr/lib".
14157
7c98e6bb
DM
141582008-04-11 David S. Miller <davem@davemloft.net>
14159
14160 * testsuite/justsyms.t: Start at 0x100.
14161 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
14162 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
14163 long.
14164 * testsuite/script_test_2.cc: Adjust string and section length
14165 checks.
7c98e6bb 14166
99a37bfd
ILT
141672008-04-09 Ian Lance Taylor <iant@google.com>
14168
2cefc357
ILT
14169 PR gold/5996
14170 * script-sections.cc (Sections_element::allocate_to_segment): Add
14171 orphan parameter.
14172 (Output_section_definition::allocate_to_segment): Likewise.
14173 (Orphan_output_section::allocate_to_segment): Likewise.
14174 (Script_sections::attach_sections_using_phdrs_clause): Don't
14175 propagate non-PT_LOAD segments to orphan sections.
14176 * testsuite/Makefile.am (script_test_3.stdout): Generate using
14177 readelf rather than objdump.
14178 * testsuite/script_test_3.sh: Adjust accordingly. Test that
14179 .interp section and PT_INTERP segment are the same size.
14180 * testsuite/Makefile.in: Rebuild.
14181
99a37bfd
ILT
14182 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
14183 aliases for symbols defined in the same object.
14184 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
14185 (weak_alias_test_SOURCES): New variable.
14186 (weak_alias_test_DEPENDENCIES): New variable.
14187 (weak_alias_test_LDFLAGS): New variable.
14188 (weak_alias_test_LDADD): New variable.
14189 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
14190 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
14191 (weak_alias_test_3.o): New target.
14192 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
14193 * testsuite/weak_alias_test_main.cc: New file.
14194 * testsuite/weak_alias_test_1.cc: New file.
14195 * testsuite/weak_alias_test_2.cc: New file.
14196 * testsuite/weak_alias_test_3.cc: New file.
14197
780e49c5
ILT
141982008-04-08 Ian Lance Taylor <iant@google.com>
14199
cdb0b8f5
ILT
14200 * options.h (class General_options): Add --noinhibit-exec option.
14201 * main.cc (main): Check --noinhibit-exec.
14202
0864d551
ILT
14203 * options.h (class General_options): Define --wrap as a special
14204 option. Add wrap_symbols_ field.
14205 (General_options::any_wrap_symbols): New function.
14206 (General_options::is_wrap_symbol): New function.
14207 * options.cc (General_options::parse_wrap): New function.
14208 (General_options::General_options): Initialize wrap_symbols_.
14209 * symtab.cc (Symbol_table::wrap_symbol): New function.
14210 (Symbol_table::add_from_object): Handle --wrap.
14211 * symtab.h (class Symbol_table): Declare wrap_symbol.
14212 * target.h (Target::wrap_char): New function.
14213 (Target::Target_info): Add wrap_char field.
14214 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
14215 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14216 * testsuite/testfile.cc (Target_test::test_target_info):
14217 Likewise.
14218
789aa6de
ILT
14219 * errors.cc (Errors::undefined_symbol): Mention symbol version if
14220 there is one.
14221
2c38906f
ILT
14222 * layout.h (class Layout): Add added_eh_frame_data_ field.
14223 * layout.cc (Layout::Layout): Initialize new field.
14224 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
14225 output section until we find a section we merged successfully.
14226 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
14227 that the size be non-zero.
14228
780e49c5
ILT
14229 * merge.cc (Object_merge_map::get_output_offset): Remove inline
14230 qualifier.
14231
7fcd0256
ILT
142322008-04-08 Craig Silverstein <csilvers@google.com>
14233
14234 * configure.ac: Export new conditional variable HAVE_ZLIB.
14235 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
14236 on HAVE_ZLIB.
14237 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
14238 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
14239
6835af53
ILT
142402008-04-07 Ian Lance Taylor <iant@google.com>
14241
e24f324c
ILT
14242 * version.cc (version_string): Set to "1.5".
14243
a036edd8
ILT
14244 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
14245 Add issued_non_pic_error_ field. Declare check_non_pic.
14246 (Target_x86_64::Scan::check_non_pic): New function.
14247 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
14248 (Target_x86_64::Scan::global): Likewise.
14249
624f8810
ILT
14250 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
14251 addend parameter. Change caller. Handle merge sections.
14252 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
14253 Address to Addend. Don't add in the result of
14254 local_section_offset, pass down the addend and use the returned
14255 value.
14256 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
14257 Update declarations of local_section_offset and symbol_value.
14258 * testsuite/two_file_test_1.cc (t18): New function.
14259 * testsuite/two_file_test_2.cc (f18): New function.
14260 * testsuite/two_file_test_main.cc (main): Call t18.
14261 * testsuite/two_file_test.h (t18, f18): Declare.
14262
6835af53
ILT
14263 * configure.ac: Don't test for objdump, c++filt, or readelf.
14264 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
14265 conditionals.
14266 (TEST_READELF): New variable.
14267 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
14268 (check_PROGRAMS): Add two_file_strip_test.
14269 (two_file_strip_test): New target.
14270 (check_PROGRAMS): Add two_file_same_shared_strip_test.
14271 (two_file_same_shared_strip_test_SOURCES): New variable.
14272 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
14273 (two_file_same_shared_strip_test_LDFLAGS): New variable.
14274 (two_file_same_shared_strip_test_LDADD): New variable.
14275 (two_file_shared_strip.so): New target.
14276 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
14277 (ver_test_5.syms, ver_test_7.syms): Likewise.
14278 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
14279 (strip_test_3.stdout): Use TEST_OBJDUMP.
14280 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
14281
86925eef
CC
142822008-04-04 Cary Coutant <ccoutant@google.com>
14283
14284 * symtab.h (Symbol::is_weak_undefined): New function.
14285 (Symbol::is_strong_undefined): New function.
14286 (Symbol::is_absolute): New function.
14287 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
14288 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
14289 absolute symbols.
14290 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
14291 (weak_undef_test): New target.
14292 * testsuite/Makefile.in: Rebuild.
14293 * testsuite/weak_undef_file1.cc: New file.
14294 * testsuite/weak_undef_file2.cc: New file.
14295 * testsuite/weak_undef_test.cc: New file.
14296
126f3ece
ILT
142972008-04-03 Craig Silverstein <csilvers@google.com>
14298
14299 * compressed_output.h (class Output_compressed_section): Use
14300 unsigned buffer.
14301 * compressed_output.cc (zlib_compress): Use unsigned buffers,
14302 add zlib header.
14303 (zlib_compressed_suffix): Removed.
14304 (Output_compressed_section::set_final_data_size): Use unsigned
14305 buffers.
14306 * testsuite/Makefile.am (flagstest_compress_debug_sections):
14307 Fix linker invocation.
14308 (flagstest_o_specialfile_and_compress_debug_sections):
14309 Likewise.
14310 * testsuite/Makefile.in: Regenerated.
14311
deae2a14
DM
143122008-04-02 David S. Miller <davem@davemloft.net>
14313
14314 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
14315 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
14316
70752818
ILT
143172008-04-02 Craig Silverstein <csilvers@google.com>
14318
14319 * TODO: New file.
14320
39d0cb0e
ILT
143212008-04-02 Ian Lance Taylor <iant@google.com>
14322
14323 * fileread.cc (File_read::find_view): Add byteshift and vshifted
14324 parameters. Update for new key type to views_. Change all
14325 callers.
14326 (File_read::read): Adjust for byteshift in returned view.
14327 (File_read::add_view): New function, broken out of
14328 find_and_make_view.
14329 (File_read::make_view): New function, broken out of
14330 find_and_make_view.
14331 (File_read::find_or_make_view): Add offset and aligned
14332 parameters. Rewrite accordingly. Change all callers.
14333 (File_read::get_view): Add offset and aligned parameters. Adjust
14334 for byteshift in return value.
14335 (File_read::get_lasting_view): Likewise.
14336 * fileread.h (class File_read): Update declarations.
14337 (class File_read::View): Add byteshift_ field. Add byteshift to
14338 constructor. Add byteshift method.
14339 * archive.h (Archive::clear_uncached_views): New function.
14340 (Archive::get_view): Add aligned parameter. Change all callers.
14341 * object.h (Object::get_view): Add aligned parameter. Change all
14342 callers.
14343 (Object::get_lasting_view): Likewise.
14344
14345 * fileread.cc (File_read::release): Don't call clear_views if
14346 there are multiple objects.
14347 * fileread.h (File_read::clear_uncached_views): New function.
14348 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
14349 on the archive.
14350
a1207466
CC
143512008-03-31 Cary Coutant <ccoutant@google.com>
14352
14353 Add thin archive support.
14354 * archive.cc (Archive::armagt): New const.
14355 (Archive::setup): Remove task parameter and calls to unlock.
14356 (Archive::unlock_nested_archives): New function.
14357 (Archive::read_header): Add nested_off parameter. Change
14358 all callers.
14359 (Archive::interpret_header): Likewise.
14360 (Archive::include_all_members): Change to handle thin
14361 archives.
14362 (Archive::include_member): Likewise.
14363 * archive.h (Archive::Archive): Add new parameters and
14364 initializers.
14365 (Archive::armagt): New const.
14366 (Archive::setup): Remove task parameter.
14367 (Archive::unlock_nested_archives): New function.
14368 (Archive::read_header): Add nested_off parameter.
14369 (Archive::interpret_header): Likewise.
14370 (Archive::Nested_archive_table): New typedef.
14371 (Archive::is_thin_archive_): New field.
14372 (Archive::nested_archives_): New field.
14373 (Archive::options_): New field.
14374 (Archive::dirpath_): New field.
14375 (Archive::task_): New field.
14376 * readsyms.cc (Read_symbols::do_read_symbols): Add check
14377 for thin archives. Pass additional parameters to
14378 Archive::Archive. Unlock the archive file after calling
14379 Archive::setup.
cd536b21 14380
479f6503
ILT
143812008-03-29 Ian Lance Taylor <iant@google.com>
14382
686c8caf
ILT
14383 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
14384 version symbol to be local.
14385 * testsuite/ver_test_4.sh: New file.
14386 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
14387 (check_DATA): Add ver_test_4.syms.
14388 (ver_test_4.syms): New target.
14389 * testsuite/Makefile.in: Rebuild.
14390
ab794b6b
ILT
14391 * output.cc
14392 (Output_section::Input_section_sort_entry::has_priority): New
14393 function.
14394 (Output_section::Input_section_sort_entry::match_file_name): New
14395 function.
14396 (Output_section::Input_section_sort_entry::match_section_name):
14397 Remove.
14398 (Output_section::Input_section_sort_entry::match_section_name_prefix):
14399 Remove.
14400 (Output_section::Input_section_sort_entry::match_section_file):
14401 Remove.
14402 (Output_section::Input_section_sort_compare::operator()): Rewrite
14403 using new Input_section_sort_entry functions. Sort crtbegin and
14404 crtend first. Sort sections with no priority before sections with
14405 a priority.
14406 * testsuite/initpri1.c (d3): Check j != 4.
14407 (cd5): New constructor/destructor function.
14408 (main): Check j != 2.
14409
479f6503
ILT
14410 * symtab.cc (Symbol_table::add_from_object): If we don't use the
14411 new symbol when resolving, don't call set_is_default.
14412 * testsuite/ver_test_7.cc: New file.
14413 * testsuite/ver_test_7.sh: New file.
14414 * testsuite/Makefile.am (ver_test_7.so): New target.
14415 (ver_test_7.o): New target.
14416 (check_SCRIPTS): Add ver_test_7.sh.
14417 (check_DATA): Add ver_test_7.syms.
14418 (ver_test_7.syms): New target.
14419
2fd32231
ILT
144202008-03-28 Ian Lance Taylor <iant@google.com>
14421
14422 * layout.cc (Layout::layout): If we see an input section with a
14423 name that needs sorting, set the must_sort flag for the output
14424 section.
14425 (Layout::make_output_section): If the name of the output section
14426 indicates that it might require sorting, set the may_sort flag.
14427 * output.h (Output_section::may_sort_attached_input_sections): New
14428 function.
14429 (Output_section::set_may_sort_attached_input_sections): New
14430 function.
14431 (Output_section::must_sort_attached_input_sections): New
14432 function.
14433 (Output_section::set_must_sort_attached_input_sections): New
14434 function.
14435 (class Output_section): Declare Input_section_sort_entry. Define
14436 Input_section_sort_compare. Declare
14437 sort_attached_input_sections. Add new fields:
14438 may_sort_attached_input_sections_,
14439 must_sort_attached_input_sections_,
14440 attached_input_sections_are_sorted_.
14441 * output.cc (Output_section::Output_section): Initialize new
14442 fields.
14443 (Output_section::add_input_section): Add an entry to
14444 input_sections_ if may_sort or must_sort are true.
14445 (Output_section::set_final_data_size): Call
14446 sort_attached_input_sections if necessary.
14447 (Output_section::Input_section_sort_entry): Define new class.
14448 (Output_section::Input_section_sort_compare::operator()): New
14449 function.
14450 (Output_section::sort_attached_input_sections): New function.
14451 * configure.ac: Check whether the compiler supports constructor
14452 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
14453 * testsuite/initpri1.c: New file.
14454 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
14455 CONSTRUCTOR_PRIORITY.
14456 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
14457 (initpri1_LDFLAGS): New variable.
14458 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
14459
18e6b24e
ILT
144602008-03-27 Ian Lance Taylor <iant@google.com>
14461
49bdd526
ILT
14462 * common.cc (Sort_commons::operator): Correct sorting algorithm.
14463 * testsuite/common_test_1.c: New file.
14464 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
14465 (common_test_1_SOURCES): New variable.
14466 (common_test_1_DEPENDENCIES): New variable.
14467 (common_test_1_LDFLAGS): New variable.
14468
18e6b24e
ILT
14469 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
14470 and commons_ correctly when NAME/VERSION does not override
14471 NAME/NULL.
14472 * testsuite/ver_test_6.c: New file.
14473 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
14474 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
14475 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
14476
04bf7072
ILT
144772008-03-26 Ian Lance Taylor <iant@google.com>
14478
5871526f
ILT
14479 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
14480 of an undefined symbol from a version script.
14481 * testsuite/Makefile.am (ver_test_5.so): New target.
14482 (ver_test_5.o): New target.
14483 (check_SCRIPTS): Add ver_test_5.sh.
14484 (check_DATA): Add ver_test_5.syms.
14485 (ver_test_5.syms): New target.
14486 * testsuite/ver_test_5.cc: New file.
14487 * testsuite/ver_test_5.script: New file.
14488 * testsuite/ver_test_5.sh: New file.
14489 * Makefile.in, testsuite/Makefile.in: Rebuild.
14490
04bf7072
ILT
14491 PR gold/5986
14492 Fix problems building gold with gcc 4.3.0.
14493 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
14494 (gold_error_at_location, gold_warning_at_location): Use it.
14495 * configure.ac: Check whether we can compile and use a template
14496 function with a printf attribute.
14497 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
14498 when jumping over bytes.
14499 * object.cc: Instantiate Object::read_section_data.
14500 * debug.h: Include <cstring>
14501 * dwarf_reader.cc: Include <algorithm>
14502 * main.cc: Include <cstring>.
14503 * options.cc: Include <cstring>.
14504 * output.cc: Include <cstring>.
14505 * script.cc: Include <cstring>.
14506 * script.h: Include <string>.
14507 * symtab.cc: Include <cstring> and <algorithm>.
14508 * target-select.cc: Include <cstring>.
14509 * version.cc: Include <string>.
14510 * testsuite/testmain.cc: Include <cstdlib>.
14511 * configure, config.in: Rebuild.
14512
874c5b28
ILT
145132008-03-25 Ian Lance Taylor <iant@google.com>
14514
819d6c3a
ILT
14515 * options.cc: Include "../bfd/bfdver.h".
14516 (options::help): Print bug reporting address.
14517
f4b2c6f5
ILT
14518 * version.cc (print_version): Adjust output for current value of
14519 BFD_VERSION_STRING.
14520
14521 * NEWS: New file.
14522
e96caa79
ILT
14523 * options.cc (options::help): Print list of supported targets.
14524 * target-select.h: Include <vector>.
14525 (class Target_selector): Make machine_, size_, and is_big_endian_
14526 fields const. Add bfd_name_ and instantiated_target_ fields.
14527 (Target_selector::Target_selector): Add bfd_name parameter.
14528 (Target_selector::recognize): Make non-virtual, call
14529 do_recognize.
14530 (Target_selector::recognize_by_name): Make non-virtual, call
14531 do_recognize_by_name.
14532 (Target_selector::supported_names): New function.
14533 (Target_selector::bfd_name): New function.
14534 (Target_selector::do_instantiate_target): New pure virtual
14535 function.
14536 (Target_selector::do_recognize): New virtual function.
14537 (Target_selector::do_recognize_by_name): New virtual function.
14538 (Target_selector::instantiate_target): New private function.
14539 (supported_target_names): Declare.
14540 * target-select.cc (Target_selector::Target_selector): Update for
14541 new parameter and fields.
14542 (select_target_by_name): Check that the name matches before
14543 calling recognize_by_name.
14544 (supported_target_names): New function.
14545 * i386.cc (class Target_selector_i386): Update Target_selector
14546 constructor call. Remove recognize and recognize_by_name. Add
14547 do_instantiate_target.
14548 * x86_64.cc (class Target_selector_x86_64): Likewise.
14549 * testsuite/testfile.cc (class Target_selector_test): Update for
14550 changes to Target_selector.
14551
874c5b28
ILT
14552 * README: Rewrite, with some notes on unsupported features.
14553
0a65a3a7
CC
145542008-03-24 Cary Coutant <ccoutant@google.com>
14555
14556 * i386.cc (Target_i386::Got_type): New enum declaration.
14557 (Target_i386::Scan::local): Updated callers of Output_data_got
14558 member functions.
14559 (Target_i386::Scan::global): Likewise.
14560 (Target_i386::Relocate::relocate): Likewise.
14561 (Target_i386::Relocate::relocate_tls): Likewise.
14562 * object.h (Got_offset_list): New class.
14563 (Sized_relobj::local_has_got_offset): Added got_type parameter.
14564 (Sized_relobj::local_got_offset): Likewise.
14565 (Sized_relobj::set_local_got_offset): Likewise.
14566 (Sized_relobj::local_has_tls_got_offset): Removed.
14567 (Sized_relobj::local_tls_got_offset): Removed.
14568 (Sized_relobj::set_local_tls_got_offset): Removed.
14569 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
14570 * output.cc (Output_data_got::add_global): Added got_type parameter.
14571 (Output_data_got::add_global_with_rel): Likewise.
14572 (Output_data_got::add_global_with_rela): Likewise.
14573 (Output_data_got::add_global_pair_with_rel): New function.
14574 (Output_data_got::add_global_pair_with_rela): New function.
14575 (Output_data_got::add_local): Added got_type parameter.
14576 (Output_data_got::add_local_with_rel): Likewise.
14577 (Output_data_got::add_local_with_rela): Likewise.
14578 (Output_data_got::add_local_pair_with_rel): New function.
14579 (Output_data_got::add_local_pair_with_rela): New function.
14580 (Output_data_got::add_global_tls): Removed.
14581 (Output_data_got::add_global_tls_with_rel): Removed.
14582 (Output_data_got::add_global_tls_with_rela): Removed.
14583 (Output_data_got::add_local_tls): Removed.
14584 (Output_data_got::add_local_tls_with_rel): Removed.
14585 (Output_data_got::add_local_tls_with_rela): Removed.
14586 * output.h (Output_data_got::add_global): Added got_type parameter.
14587 (Output_data_got::add_global_with_rel): Likewise.
14588 (Output_data_got::add_global_with_rela): Likewise.
14589 (Output_data_got::add_global_pair_with_rel): New function.
14590 (Output_data_got::add_global_pair_with_rela): New function.
14591 (Output_data_got::add_local): Added got_type parameter.
14592 (Output_data_got::add_local_with_rel): Likewise.
14593 (Output_data_got::add_local_with_rela): Likewise.
14594 (Output_data_got::add_local_pair_with_rel): New function.
14595 (Output_data_got::add_local_pair_with_rela): New function.
14596 (Output_data_got::add_global_tls): Removed.
14597 (Output_data_got::add_global_tls_with_rel): Removed.
14598 (Output_data_got::add_global_tls_with_rela): Removed.
14599 (Output_data_got::add_local_tls): Removed.
14600 (Output_data_got::add_local_tls_with_rel): Removed.
14601 (Output_data_got::add_local_tls_with_rela): Removed.
14602 * resolve.cc (Symbol::override_base_with_special): Removed
14603 reference to has_got_offset_ field.
14604 * symtab.cc (Symbol::init_fields): Replaced initialization
14605 of got_offset_ with got_offsets_. Removed initialization
14606 of has_got_offset_
53fcba31 14607 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
14608 (Symbol::got_offset): Likewise.
14609 (Symbol::set_got_offset): Likewise.
14610 (Symbol::has_tls_got_offset): Removed.
14611 (Symbol::tls_got_offset): Removed.
14612 (Symbol::set_tls_got_offset): Removed.
14613 (Symbol::got_offset_): Removed.
14614 (Symbol::tls_mod_got_offset_): Removed.
14615 (Symbol::tls_pair_got_offset_): Removed.
14616 (Symbol::got_offsets_): New field.
14617 (Symbol::has_got_offset): Removed.
14618 (Symbol::has_tls_mod_got_offset): Removed.
14619 (Symbol::has_tls_pair_got_offset): Removed.
14620 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
14621 (Target_x86_64::Scan::local): Updated callers of Output_data_got
14622 member functions.
14623 (Target_x86_64::Scan::global): Likewise.
14624 (Target_x86_64::Relocate::relocate): Likewise.
14625 (Target_x86_64::Relocate::relocate_tls): Likewise.
14626
bd52eafb
BE
146272008-03-25 Ben Elliston <bje@au.ibm.com>
14628
14629 * yyscript.y: Fix spelling error in comment.
14630
8b105e34
ILT
146312008-03-24 Ian Lance Taylor <iant@google.com>
14632
8ed814a9
ILT
14633 * options.h (class General_options): Define build_id option.
14634 * layout.h (class Layout): Declare write_build_id, create_note,
14635 create_build_id. Add build_id_note_ member.
14636 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
14637 "libiberty.h", "md5.h", "sha1.h".
14638 (Layout::Layout): Initialize eh_frame_data_,
14639 eh_frame_hdr_section_, and build_id_note_.
14640 (Layout::finalize): Call create_build_id.
14641 (Layout::create_note): New function, broken out of
14642 Layout::create_gold_note.
14643 (Layout::create_gold_note): Call create_note.
14644 (Layout::create_build_id): New function.
14645 (Layout::write_build_id): New function.
14646 (Close_task_runner::run): Call write_build_id.
14647
8b105e34
ILT
14648 * x86_64.cc: Correct license to GPLv3.
14649
086a1841
ILT
146502008-03-23 Ian Lance Taylor <iant@google.com>
14651
14652 * options.cc: Include "demangle.h".
14653 (parse_optional_string): New function.
14654 (parse_long_option): Handle takes_optional_argument.
14655 (parse_short_option): Update dash_z initializer. Handle
14656 takes_optional_argument.
14657 (General_options::General_options): Initialize do_demangle_.
14658 (General_options::finalize): Set do_demangle_. Handle demangling
14659 style.
14660 * options.h (parse_optional_string): Declare.
14661 (struct One_option): Add optional_arg field. Update constructor.
14662 Update call constructor calls. Add takes_optional_argument
14663 function.
14664 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
14665 (DEFINE_optional_string): Define.
14666 (General_options::demangle): Change from DEFINE_bool to
14667 DEFINE_optional_string.
14668 (General_options::no_demangle): New function.
14669 (General_options::do_demangle): New function.
14670 (General_options::set_do_demangle): New function.
14671 (General_options::execstack_status_): Move definition to end of
14672 class definition.
14673 (General_options::static_): Likewise.
14674 (General_options::do_demangle_): New field.
14675 * object.cc (big_endian>::get_symbol_location_info): Call
14676 Options::do_demangle, not Options::demangle.
14677 * symtab.cc (demangle): Likewise.
14678
cbb93e63
ILT
146792008-03-22 Ian Lance Taylor <iant@google.com>
14680
14681 * gold.h: Include <cstddef> and <sys/types.h>
14682 * options.h: Include <cstring>.
14683
ec531623
ILT
146842008-03-21 Ian Lance Taylor <iant@google.com>
14685
14686 * Added source code to GNU binutils.
752937aa
NC
14687\f
14688Copyright (C) 2008-2012 Free Software Foundation, Inc.
14689
14690Copying and distribution of this file, with or without modification,
14691are permitted in any medium without royalty provided the copyright
14692notice and this notice are preserved.
14693
14694Local Variables:
14695mode: change-log
14696left-margin: 8
14697fill-column: 74
14698version-control: never
14699End:
This page took 0.894766 seconds and 4 git commands to generate.