gdb/
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
32e2b61d
AM
12013-03-20 Alan Modra <amodra@gmail.com>
2
3 * symtab.h (Symbol::clear_version): New function.
4 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
5 is_needed by weak references. Clear version for symbols defined
6 in as-needed objects that are not needed.
7
b3ccdeb5
AM
82013-03-15 Alan Modra <amodra@gmail.com>
9
10 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
11 static and public. Add report_err param. Return false for data refs.
12 (Target_powerpc::rela_dyn_section): New overloaded function.
13 (Target_powerpc::plt_, iplt_): Elucidate.
14 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
15 (Output_data_plt_powerpc::do_write): Don't write .iplt.
16 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
17 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
18 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
19 push_branch and make_plt_entry for ifunc syms when
20 reloc_needs_plt_for_ifunc.
21 (Target_powerpc::Relocate::relocate): Don't use plt entry value
22 for ifunc unless reloc_needs_plt_for_ifunc.
23
ad3d8a2f
AM
242013-03-15 Alan Modra <amodra@gmail.com>
25
26 * gc.h (gc_process_relocs): Don't look through function descriptors.
27 * icf.cc (get_section_contents): Do so here instead.
28
4d9aa155
AM
292013-03-13 Alan Modra <amodra@gmail.com>
30
31 * powerpc.cc (is_branch_reloc): Forward declare.
32 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
33 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
34 false for 64-bit, true for 32-bit non-branch relocs.
35 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
36 * testsuite/Makefile.am (icf_test): Use linker map file instead of
37 nm output.
38 (icf_safe_test): Generate linker map file as well as nm output.
39 (icf_safe_so_test): Likewise.
40 * testsuite/Makefile.in: Regenerate.
41 * testsuite/icf_test.sh: Parse linker map file to determine
42 section folding.
43 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
44 * testsuite/icf_safe_so_test.sh: Likewise.
45 (X86_32_or_ARM_specific_safe_fold): Merge into..
46 (arch_specific_safe_fold): ..this.
47 (X86_64_specific_safe_fold): Delete unused function.
48
57420c20
AM
492013-03-12 Alan Modra <amodra@gmail.com>
50
51 * gc.h (gc_process_relocs): Look through function descriptors
52 to determine shndx, symvalue and addend used by ICF. Tidy
53 variable duplication.
54
dc3714f3
AM
552013-03-11 Alan Modra <amodra@gmail.com>
56
57 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
58 * layout.cc (Layout_task_runner::run): ..to here.
59 * symtab.h (struct Symbol_location): Extract from..
60 (class Symbol_table): ..here.
61 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
62 * target.h (class Target): Add function_location and
63 do_function_location functions.
64 (class Sized_target): Add do_function_location.
65 * object.h (class Sized_relobj_file): Move find_shdr..
66 (class Object): ..to here.
67 * object.cc: Likewise. Update to suit. Instantiate.
68 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
69 * powerpc.cc (class Powerpc_dynobj): New.
70 (Target_powerpc::do_function_location): New function.
71 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
72 (Powerpc_dynobj::do_read_symbols): New function.
73 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
74
956b03bb
ILT
752013-03-08 Ian Lance Taylor <iant@google.com>
76
77 * options.cc (General_options::string_to_object_format): Accept
78 "default".
79
4bead2d5
AM
802013-03-08 Alan Modra <amodra@gmail.com>
81
82 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
83 pointer to Post_fde.
84 (struct Post_fde): Move definition to here..
85 * ehframe.cc (struct Post_fde): ..from here.
86 (Cie::write): Don't alloc Post_fde.
87 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
88
02e60bf7
AM
892013-03-07 Alan Modra <amodra@gmail.com>
90
91 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
92 relocation referencing .LC0.
93 * testsuite/discard_locals_test.sh: Remove FIXMEs.
94
8343f03a
AM
952013-03-07 Alan Modra <amodra@gmail.com>
96
97 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
98 always_inline. Add assembly for powerpc to avoid GOT.
99
3366d57c
AM
1002013-03-07 Alan Modra <amodra@gmail.com>
101
102 * testsuite/script_test_10.sh: Don't test .bss section
103 header number.
104
6c77229c
AM
1052013-03-06 Alan Modra <amodra@gmail.com>
106
107 * powerpc.cc (class Powerpc_relobj): Move some member functions.
108 (Target_powerpc::symval_for_branch): Add symtab param. Update
109 all callers. Handle folded sections.
110 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
111 to Powerpc_relobj.
112 (Global_symbol_visitor_opd::operator()): Likewise.
113
a39e4af6
AM
1142013-03-04 Alan Modra <amodra@gmail.com>
115
116 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
117 * testsuite/Makefile.in: Regenerate.
118
d5834edb
CC
1192013-03-01 Cary Coutant <ccoutant@google.com>
120
121 Add dwp support for v2 DWARF package file format.
122 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
123 tu_length parameter. Adjust all callers.
124 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
125 * dwp.cc: Include dwarf.h.
126 (Section_bounds): New struct type.
127 (Unit_set): New struct type.
128 (Dwo_file::Dwo_file): Initialize new data member.
129 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
130 Combine and rename to...
131 (Dwo_file::read_unit_index): ...this.
132 (Dwo_file::sized_read_compunit_index)
133 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
134 (Dwo_file::sized_read_unit_index): ...this.
135 (Dwo_file::copy_section): Remove section_name, is_str_offsets
136 parameters; add section_id parameter.
137 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
138 (Dwo_file::add_unit_set): ...this.
139 (Dwo_file::shndx_map_): Remove.
140 (Dwo_file::sect_offsets_): New data member.
141 (Dwp_output_file::Dwp_output_file): Initialize new data members.
142 (Dwp_output_file::add_section): Rename to...
143 (Dwp_output_file::add_contribution): ...this.
144 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
145 (Dwp_output_file::add_tu_set): Likewise.
146 (Dwp_output_file::Contribution): New type.
147 (Dwp_output_file::Section::contributions): New data member.
148 (Dwp_output_file::Cu_or_tu_set): Remove.
149 (Dwp_output_file::Section::Section): New ctor.
150 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
151 (Dwp_output_file::Dwp_index::Section_table): New type.
152 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
153 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
154 parameter.
155 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
156 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
157 (Dwp_output_file::Dwp_index::section_table): New member function.
158 (Dwp_output_file::Dwp_index::section_table_end): New member function.
159 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
160 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
161 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
162 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
163 (Dwp_output_file::Dwp_index::section_table_): New data member.
164 (Dwp_output_file::Dwp_index::section_mask_): New data member.
165 (Dwp_output_file::add_output_section): New member function.
166 (Dwp_output_file::write_new_section): New member function.
167 (Dwp_output_file::write_contributions): New member function.
168 (Dwp_output_file::section_id_map_): New data member.
169 (class Dwo_id_info_reader): Remove.
170 (class Unit_reader): New class.
171 (get_dwarf_section_name): New function.
172 (Dwo_file::read_executable): Adjust initializations of class data.
173 (Dwo_file::read): Add support for v2 package file format.
174 (Dwo_file::read_unit_index): Likewise.
175 (Dwo_file::sized_read_unit_index): Likewise.
176 (Dwo_file::copy_section): Likewise.
177 (Dwo_file::add_unit_set): Likewise.
178 (Dwp_output_file::add_output_section): Likewise.
179 (Dwp_output_file::add_contribution): Likewise.
180 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
181 for empty slot.
182 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
183 file format.
184 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
185 slot.
186 (Dwp_output_file::initialize): Remove unused function.
187 (Dwp_output_file::finalize): Add support for v2 package file format.
188 (Dwp_output_file::write_index): Likewise.
189 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
190 function prototype.
191
a68a081d
CC
1922013-03-01 Cary Coutant <ccoutant@google.com>
193
194 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
195 function into class definition in header file.
196 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
197 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
198 New function.
199 (Dwarf_info_reader::check_buffer): Move here from .cc file.
200
9d5781f8
AM
2012013-02-28 Alan Modra <amodra@gmail.com>
202
203 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
204 * target.cc (Target::do_plt_fde_location): New function.
205 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
206 accessor function, and constructor param.
207 (struct Post_fde, Post_fdes): Declare.
208 (Cie::write): Add post_fdes param.
209 * ehframe.cc (Fde::write): Use plt_fde_location.
210 (struct Post_fde): Define.
211 (Cie::write): Stash FDEs added post merge mapping.
212 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
213 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
214 (Eh_frame::do_sized_write): Arrange to write post map FDES after
215 other FDEs.
216 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
217 (Target_powerpc::has_glink): New function.
218 (Target_powerpc::do_relax): Add eh_frame info for stubs.
219 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
220 glink_eh_frame_fde_32, default_fde): New data.
221 (Stub_table::eh_frame_added_): New var.
222 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
223 Make const.
224 (Stub_table::add_eh_frame): New function.
225 (Output_data_glink::add_eh_frame): New function.
226 (Target_powerpc::make_glink_section): Call add_eh_frame.
227
214383dd
ILT
2282013-02-15 Ian Lance Taylor <iant@google.com>
229
230 * options.h (DEFINE_uint64_alias): Define.
231 (class General_options): Add -Ttext-segment as an alias for
232 -Ttext.
233
91c2b899
AM
2342013-02-15 Alan Modra <amodra@gmail.com>
235
236 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
237 (Stub_table::do_write): ..here, two places.
238 (Stub_table::plt_call_size): Use it here too.
239
20e2a8aa
ILT
2402013-02-11 Ian Lance Taylor <iant@google.com>
241
242 * descriptors.cc (Descriptors::close_all): New function.
243 * descriptors.h (class Descriptors): Declare close_all.
244 (close_all_descriptors): New inline function.
245 * plugin.cc: Include "descriptors.h".
246 (Plugin_manager::cleanup): Call close_all_descriptors.
247
8952bc69
AM
2482013-02-06 Alan Modra <amodra@gmail.com>
249
250 * README: Update coding style link.
251
29bd8b6b
CC
2522013-01-28 Cary Coutant <ccoutant@google.com>
253
254 * dwp.cc (File_list): New typedef.
255 (Dwo_name_info_reader): New class.
256 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
257 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
258 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
259 (Dwo_file::read_executable): New function.
260 (Dwo_file::read): Move common setup code to ...
261 (Dwo_file::make_object): ... here.
262 (dwp_options): Add --exec/-e.
263 (usage): Likewise.
264 (main): Likewise.
265
c6ac678d
ST
2662013-01-24 Sriraman Tallam <tmsriram@google.com>
267
268 * layout.cc (Layout::layout): Check for option text_reorder.
269 (Layout::make_output_section): Ditto.
270 * options.h (text_reorder): New option.
271 * output.cc (Input_section_sort_compare): Remove special ordering
272 of section names.
273 (Output_section::
274 Input_section_sort_section_name_special_ordering_compare::
275 operator()): New function.
276 (Output_section::sort_attached_input_sections): Use new sort function
277 for .text.
278 * output.h (Input_section_sort_section_name_special_ordering_compare):
279 New struct.
280 * testsuite/Makefile.am (text_section_grouping): Test option
281 --no-text-reorder
282 * testsuite/Makefile.in: Regenerate.
283 * testsuite/text_section_grouping.sh: Check order of functions without
284 default text reordering.
285
50701cc1
MF
2862013-01-18 Mike Frysinger <vapier@gentoo.org>
287
288 * options.h (General_options): Change default to true for new_dtags.
289
b1b00fcc
MF
2902013-01-18 Mike Frysinger <vapier@gentoo.org>
291
292 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
293 when enable_new_dtags is false. Only add DT_RUNPATH when
294 enable_new_dtags is true.
295
ec5b8187
AM
2962013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
297
298 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
299 used in declaration and definition consistent.
300 (Target_powerpc::symval_for_branch): Ditto.
301
a880d4c4
ST
3022013-01-16 Sriraman Tallam <tmsriram@google.com>
303
304 * testsuite/plugin_final_layout.cc: Fix comment.
305
7c381248
ST
3062013-01-16 Sriraman Tallam <tmsriram@google.com>
307
308 * layout.cc (Layout::layout): Do not do default sorting for
309 text sections when section ordering is specified.
310 (make_output_section): Ditto.
311 * testsuite/plugin_final_layout.cc: Name the function sections
312 to catch reordering issues.
313
e2458743
AM
3142013-01-15 Alan Modra <amodra@gmail.com>
315
316 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
317 plt-thread-safe.
318
431ed302
AM
3192013-01-15 Alan Modra <amodra@gmail.com>
320
321 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
322 * testsuite/Makefile.in: Regenerate.
323
0ec6429b
AM
3242013-01-14 Alan Modra <amodra@gmail.com>
325
326 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
327 * testsuite/Makefile.in: Regenerate.
328
0bf402d5
ILT
3292013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
330
36af3926 331 PR bfd/14430
0bf402d5
ILT
332 Fix mingw gold build with plugins enabled
333 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
334 * configure.ac: Export DLOPEN_LIBS and add headers check.
335 * plugin.cc: Handle non-dlfcn case.
336 * Makefile.in: Regenerate.
337 * config.in: Regenerate.
338 * configure: Regenerate.
339 * testsuite/Makefile.in: Regenerate.
340
9e9143bc
ST
3412013-01-09 Sriraman Tallam <tmsriram@google.com>
342
343 * output.h (sort_attached_input_sections): Change to be public.
344 * script-sections.cc
345 (Output_section_definition::set_section_addresses): Sort
346 attached input sections according to section order before linker
347 script assigns section addresses.
348 (Orphan_output_section::set_section_addresses): Sort
349 attached input sections according to section order before linker
350 script assigns section addresses.
351 * Makefile.am (final_layout.sh): Use a simple linker script to
352 check if section ordering still works.
353 * Makefile.in: Regenerate.
354
679af368
ILT
3552013-01-09 Ben Cheng <bccheng@google.com>
356
357 * arm.cc (Target_arm::attributes_accept_div): New function.
358 (Target_arm::attributes_forbid_div): New function.
359 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
360 attribute using the same new functions as what bfd/elf32_arm.c
361 does.
362
3136a00e
CC
3632013-01-07 Cary Coutant <ccoutant@google.com>
364
365 PR gold/14993
366 * output.cc (Output_section::add_input_section): For incremental
367 updates, don't track input sections that are allocated from patch
368 space.
369
f2a6224b
L
3702013-01-07 H.J. Lu <hongjiu.lu@intel.com>
371 Ian Lance Taylor <iant@google.com>
372
373 PR gold/14897
374 * configure.ac (--enable-ld): Removed.
375 (install_as_default): Set to yes only for --enable-gold=default
376 or --disable-ld.
377 * configure: Regenerated.
378
4f46f626
L
3792013-01-07 H.J. Lu <hongjiu.lu@intel.com>
380
381 * options.h (General_options): Add -fuse-ld= for GCC linker
382 option compatibility.
383
26e4ef59
CC
3842013-01-04 Cary Coutant <ccoutant@google.com>
385
386 * configure.ac: Fix typo restoring CXXFLAGS.
387 * configure: Regenerate.
388
3d587466
CC
3892013-01-04 Cary Coutant <ccoutant@google.com>
390
4f46f626
L
391 * testsuite/Makefile.am (CXXLINK_S): New macro.
392 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
393 * testsuite/Makefile.in: Regenerate.
3d587466 394
44db6695
L
3952013-01-02 H.J. Lu <hongjiu.lu@intel.com>
396
397 * version.cc (print_version): Update copyright year to 2013.
398
edcac0c1
ILT
3992012-12-20 Ian Lance Taylor <iant@google.com>
400
401 * layout.cc (Layout::special_ordering_of_input_section): New
402 function.
403 (Layout::layout): If input section requires special ordering, must
404 sort input sections.
405 (Layout::make_output_section): May sort .text input sections.
406 (Layout::is_section_name_prefix_grouped): Remove.
407 * layout.h (class Layout): Declare
408 special_ordering_of_input_section. Don't declare
409 is_section_name_prefix_grouped.
410 * output.cc (Output_section::add_input_section): Revert last
411 change.
412 (Output_section::Input_section_sort::match_file_name): Don't crash
413 if called on output section data.
414 (Output_section::Input_section_sort_compare): Sort based on
415 special ordering.
416 (Output_section::Input_section_sort_section_order_index_compare):
417 Revert last patch.
418 (Output_section::sort_attached_input_sections): Likewise.
419
28f2a4ac
ST
4202012-12-18 Sriraman Tallam <tmsriram@google.com>
421
edcac0c1 422 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
423 * layout.h (Layout::is_section_name_prefix_grouped): New function.
424 * output.cc (Output_section::add_input_section): Check if section
425 name contains special prefix. Keep input sections to sort such
426 sections.
427 (Output_section::Input_section_sort_section_order_index_compare
428 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
429 (Output_section::sort_attached_input_sections): Add condition to
430 Input_section_entry constructor call.
28f2a4ac
ST
431 * testsuite/Makefile.am (text_section_grouping): New test.
432 * testsuite/Makefile.in: Regenerate.
433 * testsuite/text_section_grouping.cc: New file.
434 * testsuite/text_section_grouping.sh: New file.
435
5bf135a7
NC
4362012-12-17 Nick Clifton <nickc@redhat.com>
437
438 * Makefile.am: Add copyright notice.
439 * NEWS: Likewise.
440 * README: Likewise.
441 * configure.ac: Likewise.
442 * ftruncate.c: Likewise.
443 * Makefile.in: Regenerate.
444
59965708
CC
4452012-12-14 Cary Coutant <ccoutant@google.com>
446
447 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
448 --no-as-needed flag.
449 (exception_separate_shared_12_test): Likewise.
450 (incremental_copy_test): Likewise.
451 * testsuite/Makefile.in: Regenerate.
452
2a77e2ab
CC
4532012-12-14 Cary Coutant <ccoutant@google.com>
454
455 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
456 (Dwp_output_file::Dwp_index::enter_set): Add assert.
457
e3deeb9c
AM
4582012-12-12 Alan Modra <amodra@gmail.com>
459
460 * powerpc.cc (class Track_tls): New.
461 (class Relocate, class Scan): Inherit Track_tls.
462 (Target_powerpc::Scan::local, global): Track tls optimization
463 and avoid creating plt entry for __tls_get_addr if all uses
464 are optimized away.
465 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
466
d8f5a274
AM
4672012-12-12 Alan Modra <amodra@gmail.com>
468
469 * options.h (General_options): Add --toc-sort/--no-toc-sort.
470 Replace no_toc_optimize with toc_optimize.
471 * output.h (Output_section::input_sections): Provide non-const variant.
472 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
473 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
474 accessors.
475 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
476 (class Sort_toc_sections): New.
477 (Target_powerpc::do_finalize_sections): Sort toc sections.
478 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
479
4c8a1de1
RM
4802012-12-10 Roland McGrath <mcgrathr@google.com>
481
482 * testsuite/binary_unittest.cc (read_all): New function.
483 (Sized_binary_test): Use it instead of ::read.
484 * fileread.cc (do_read): Don't assume pread always reads the whole
485 amount in a single call.
486
edc27beb
AM
4872012-12-10 Alan Modra <amodra@gmail.com>
488
489 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
490 Set EM_PPC64 or EM_PPC here.
491 (Target_selector_powerpc::do_recognize): Delete.
492
906b9150
AM
4932012-12-10 Alan Modra <amodra@gmail.com>
494
495 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
496 stub_table_.
497 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
498
418c15ae
RM
4992012-12-07 Roland McGrath <mcgrathr@google.com>
500
501 * testsuite/binary_unittest.cc (Sized_binary_test):
502 Use open_descriptor rather than ::open.
503
decdd3bc
AM
5042012-12-07 Alan Modra <amodra@gmail.com>
505
506 * powerpc.cc (Stub_table::do_write): Delete redundant Address
507 typedef and invalid_address constant.
508 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
509 instantiate constants.
510
db399005
ILT
5112012-12-06 Roland McGrath <mcgrathr@google.com>
512
513 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
514 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
515 * aclocal.m4: Regenerate.
516 * configure: Regenerate.
517 * Makefile.in: Regenerate.
518 * testsuite/Makefile.in: Regenerate.
519
aba6bc71
AM
5202012-12-07 Alan Modra <amodra@gmail.com>
521
522 * options.h (General_options): Add no_toc_optimize.
523 * powerpc.cc (ok_lo_toc_insn): New function.
524 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
525
9e69ed50
AM
5262012-12-06 Alan Modra <amodra@gmail.com>
527
528 * options.h (General_options): Add plt_align, plt_static_chain,
529 plt_thread_safe. Update stub_group_size help text.
530 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
531 for new plt_thread_safe_ var.
532 (use_plt_offset): Correct comments.
533 (Target_powerpc::do_relax): Look for thread creation symbols to
534 determine default plt_thread_safe value. Clear plt call stubs
535 as well as branch stubs each iteration.
536 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
537 insn constants.
538 (l, hi, ha, write_insn): Move earlier.
539 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
540 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
541 plt stubs too.
542 (Stub_table::update_size): Adjust.
543 (Stub_table::prev_size, set_prev_size): Delete.
544 (Stub_table::stub_align): Let --plt-align affect result.
545 (Stub_table::plt_call_size): Calculate sizes for various stubs.
546 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
547 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
548 (Stub_table::do_write): Support more stub variants.
549
f43ba157
AM
5502012-12-04 Alan Modra <amodra@gmail.com>
551
552 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
553 (Target_powerpc::do_define_standard_symbols): New function.
554
34171bc5
AM
5552012-12-03 Alan Modra <amodra@gmail.com>
556
557 * output.h: Formatting, whitespace.
558
dc9589e9 5592012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
560
561 * layout.h (Layout::get_executable_sections): Declare.
562 * layout.cc (Layout::get_executable_sections): New function.
563 * arm.cc (Target_arm::group_sections): Use it.
564 (Arm_output_section::group_sections): Delete now redundant test.
565 * output.cc (Output_reloc::Output_reloc): Add is_relative.
566 param to handle relative relocs.
567 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
568 (Output_data_reloc::add_absolute): Adjust.
569 (Output_data_reloc::add_relative): New function.
570 (Output_data::reset_data_size): New function.
571 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
572 (Output_section::set_addralign): New function.
573 (Output_section::checkpoint_set_addralign): New function.
574 (Output_section::clear_section_offsets_need_adjustment): New function.
575 (Output_section::input_sections): Make public.
576 * powerpc.cc (class Output_data_brlt_powerpc): New.
577 (class Stub_table, class Stub_control): New.
578 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
579 stub_table_, set_stub_table, stub_table): New vectors and accessor
580 functions.
581 (Target_powerpc::do_may_relax, do_relax, push_branch,
582 new_stub_table, stub_tables, brlt_section, group_sections,
583 add_branch_lookup_table, find_branch_lookup_table,
584 write_branch_lookup_table, make_brlt_section): New functions.
585 (Target_powerpc::struct Sort_sections, class Branch_info): New.
586 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
587 branch_info_): New vars.
588 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
589 make call stubs here.
590 (Output_data_glink): Remove all call stub handling from this class.
591 (Target_powerpc::Scan::local, global): Save interesting branch
592 relocs and relocs for ifunc. Adjust calls to plt entry functions.
593 (Target_powerpc::do_finalize_sections): Only make reg save/restore
594 functions on final link.
595 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
596 Handle long branch destinations too.
597 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
598 do_plt_address_for_local): Adjust lookup of plt call stubs.
599
627b30b7
AM
6002012-11-30 Alan Modra <amodra@gmail.com>
601
602 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
603 relocs against protected symbols when building 32-bit shared libs.
604
40b469d7
AM
6052012-11-30 Alan Modra <amodra@gmail.com>
606
607 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
608 param. Call got_section() to make .got. Update all callers
609 and their callers and so on.
610
bb66a627
AM
6112012-11-30 Alan Modra <amodra@gmail.com>
612
613 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
614 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
615 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
616 value if it already exists.
617
d2cf1c6c
L
6182012-11-19 H.J. Lu <hongjiu.lu@intel.com>
619
620 PR gold/14858
621 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
622
edccdf7c
RM
6232012-11-14 Roland McGrath <mcgrathr@google.com>
624
625 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
626 than bfc instruction for data sandboxing.
627
6febeb74
AM
6282012-11-08 Alan Modra <amodra@gmail.com>
629
630 * po/POTFILES.in: Regenerate.
631
0a6f1bf2
AM
6322012-11-05 Alan Modra <amodra@gmail.com>
633
634 * configure.ac: Apply 2012-09-10 change to config.in here.
635 * configure: Regenerate.
636
26a4e9cb
AM
6372012-11-05 Alan Modra <amodra@gmail.com>
638
639 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
640 (struct Opd_ent): Use "Address" rather than "Offset".
641 (Output_data_got_powerpc::got_base_offset): Return Valtype.
642 (Target_powerpc::got_section): Make public.
643 (Target_powerpc::scan_relocs): Move code setting symbols..
644 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
645 Create _SDA_BASE_ only when referenced.
646
cc928013
RM
6472012-11-02 Roland McGrath <mcgrathr@google.com>
648
649 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
650 from last change.
651
50ed5eb1
RM
6522012-11-01 Roland McGrath <mcgrathr@google.com>
653
62fe925a
RM
654 * target.h (Sized_target::relocate_relocs): Use Elf_Off
655 for offset_in_output_section parameter.
656 (Sized_target::relocate_special_relocatable): Likewise.
657 * arm.cc (Target_arm::relocate_relocs): Likewise.
658 (Target_arm::relocate_special_relocatable): Likewise.
659 * i386.cc (Target_i386::relocate_relocs): Likewise.
660 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
661 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
662 * target-reloc.h (relocate_relocs): Likewise.
663 * testsuite/testfile.cc (Target_test): Likewise.
664 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
665 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
666
667 * system.h: Move inclusion of <clocale> to after <libintl.h> in
668 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
669
670 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
671 parameter, which is unused in the [!F_SETFD] case.
672
50ed5eb1
RM
673 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
674 SYMNDX to off_t before comparing it to this->data_size().
675 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
676 * incremental.cc (Output_section_incremental_inputs::do_write):
677 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
678
2cadc0bf
RM
679 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
680
3bfcb652
NC
6812012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
682
683 * gold.cc (Target_arm::do_adjust_elf_header): Add the
684 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
685 in EABI_VER5.
686
c1a8d56e
CC
6872012-10-29 Cary Coutant <ccoutant@google.com>
688
689 * dwp.cc (usage): Add file and exit status parameters;
690 add --help and --version options.
691 (print_version): New function.
692 (main): Add --help and --version options.
693
b2490a7b
L
6942012-10-25 H.J. Lu <hongjiu.lu@intel.com>
695
696 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
697 final_layout_sequence.txt.
698 * testsuite/Makefile.in: Regenerated.
699
aa543512
L
7002012-10-25 H.J. Lu <hongjiu.lu@intel.com>
701
702 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
703 COMPILE generated by automake.
704 (LINK1): Likewise.
705 (CXXCOMPILE1): Likewise.
706 (CXXLINK1): Likewise.
707 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
708 (LINK): Likewise.
709 (CXXCOMPILE): Likewise.
710 (CXXLINK): Likewise.
711 * testsuite/Makefile.in: Regenerated.
712
d361fafb
L
7132012-10-25 H.J. Lu <hongjiu.lu@intel.com>
714
715 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
716 on bad fwrite return.
717
598c7410
L
7182012-10-25 H.J. Lu <hongjiu.lu@intel.com>
719
720 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
721 on val.
722
35c813e2
CC
7232012-10-23 Cary Coutant <ccoutant@google.com>
724
725 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
726 * testsuite/Makefile.in: Regenerate.
727 * testsuite/dwp_test.h: New source file.
728 * testsuite/dwp_test_1.cc: New source file.
729 * testsuite/dwp_test_1.s: New source file.
730 * testsuite/dwp_test_1.sh: New source file.
731 * testsuite/dwp_test_1b.cc: New source file.
732 * testsuite/dwp_test_1b.s: New source file.
733 * testsuite/dwp_test_2.cc: New source file.
734 * testsuite/dwp_test_2.s: New source file.
735 * testsuite/dwp_test_2.sh: New source file.
736 * testsuite/dwp_test_main.cc: New source file.
737 * testsuite/dwp_test_main.s: New source file.
738
77429909
CC
7392012-10-23 Cary Coutant <ccoutant@google.com>
740
741 * dwp.h: New header file.
742 * dwp.cc: New source file.
743 * gold.h: Move shared declarations to system.h.
744 * system.h: New header file.
745 * Makefile.am: Add dwp.
746 * Makefile.in: Regenerate.
747
ed5d6712
CC
7482012-10-23 Cary Coutant <ccoutant@google.com>
749
750 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
751 Dwarf_info_reader::read_from_pointer.
752 (Dwarf_pubnames_table::read_header): Likewise.
753 (Dwarf_pubnames_table::next_name): Likewise.
754 (Dwarf_die::read_attributes): Likewise.
755 (Dwarf_die::skip_attributes): Likewise.
756 (Dwarf_info_reader::read_from_pointer): New function template.
757 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
758 (Dwarf_pubnames_table): Likewise.
759 (Dwarf_info_reader::read_from_pointer): New function template.
760 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
761 Dwarf_pubnames_table ctor.
762
8787852d
CC
7632012-10-23 Cary Coutant <ccoutant@google.com>
764
765 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
766 abbrev_shndx.
767 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
768 abbrev_shndx_.
769 (Dwarf_info_reader::set_abbrev_shndx): New method.
770 (Dwarf_info_reader::abbrev_shndx_): New data member.
771
9fc236f3
CC
7722012-10-23 Cary Coutant <ccoutant@google.com>
773
774 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
775 from object, not parameters.
776 (Dwarf_info_reader::parse): Likewise.
777 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
778 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
779 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
780 methods.
781
effe8365
CC
7822012-10-23 Cary Coutant <ccoutant@google.com>
783
784 * fileread.cc (Input_file::Input_file): New constructor.
785 * fileread.h (class Input_file): Add new constructor.
786
1698990d
AM
7872012-10-18 Alan Modra <amodra@gmail.com>
788
789 PR gold/14727
790 * object.cc (Relobj::is_section_name_included): Also match
791 .sdata personality section.
792
168a4726
AM
7932012-10-18 Alan Modra <amodra@gmail.com>
794
795 * target-reloc.h (class Default_comdat_behavior): New, package up..
796 (get_comdat_behaviour): ..this.
797 (relocate_section): Add Relocate_comdat_behavior template arg,
798 adjust code to suit.
799 * arm.cc (Target_arm::relocate_section): Adjust to suit.
800 (Target_arm::scan_reloc_section): Likewise.
801 * i386.cc (Target_i386::relocate_section): Likewise.
802 * sparc.cc (Target_sparc::relocate_section): Likewise.
803 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
804 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
805 * powerpc.cc (class Relocate_comdat_behavior): New.
806 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
807 gold::relocate_section with new template arg.
808
acc276d8
AM
8092012-10-18 Alan Modra <amodra@gmail.com>
810
811 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
812 dynamic relocs for GOT_TPREL got entries, without symbol if
813 resolving locally.
814 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
815 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
816 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
817
e10f9870
AM
8182012-10-17 Alan Modra <amodra@gmail.com>
819
820 PR gold/14726
821 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
822
ae034989
ST
8232012-10-16 Sriraman Tallam <tmsriram@google.com>
824
825 * layout.cc (Layout::include_section): Keep sections marked
826 SHF_EXCLUDE when doing relocatable links.
827
f3a0ed29
AM
8282012-10-16 Alan Modra <amodra@gmail.com>
829
830 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
831 (Target_powerpc::do_finalize_sections): Call it.
832 (Output_data_save_res): New class and supporting functions.
833 (Target_powerpc::symval_for_branch): Only look up .opd entry for
834 normal symbols defined in object files.
835
c6de8ed4
AM
8362012-10-12 Alan Modra <amodra@gmail.com>
837
838 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
839 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
840 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
841 section if scan_opd_relocs not yet called.
842 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
843
03e25981
AM
8442012-10-12 Alan Modra <amodra@gmail.com>
845
846 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
847 add_local_ifunc_entry): Revert last change.
848 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
849
c9824451
AM
8502012-10-05 Alan Modra <amodra@gmail.com>
851
852 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
853 do_plt_address_for_global): New functions.
854 (Output_data_got_powerpc::do_write): Don't segfault when linking
855 statically.
856 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
857 add_local_ifunc_entry): Return true on adding entry..
858 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
859 glink->add_entry call. Remove unused symtab param. Adjust calls.
860 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
861 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
862 set up symbols here.
863 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
864 syms here. Do so even when no .iplt. Don't segfault when linking
865 statically.
866 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
867 new variants without reloc param.
868 (Glink_sym_ent::Glink_sym_ent): Likewise.
869 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
870 reloc when refs will resolve to plt call stub.
871 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
872 R_PPC_PLTREL24 to resolve locally.
873 (Target_powerpc::Scan::global): Correct ifunc handling.
874 (Target_powerpc::Relocate::relocate): Correct local sym glink
875 lookup. Don't destroy "value" when we have a plt call stub,
876 and when checking plt call validity.
877 (Target_powerpc::do_dynsym_value): Simplify.
878
19fec8c1
AM
8792012-10-05 Alan Modra <amodra@gmail.com>
880
881 * i386.cc (Output_data_plt_i386::address_for_global,
882 address_for_local): Add plt offset to returned value. Adjust uses.
883 * sparc.cc (Output_data_plt_sparc::address_for_global,
884 address_for_local): Likewise.
885 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
886 address_for_local): Likewise.
887 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
888 address_for_local): Likewise.
889 * target.h (Target::plt_address_for_global, plt_address_for_local):
890 Update comment.
891 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
892 (Output_data_got::Got_entry::write): Nor here.
893 * output.h: Comment fix.
894
e867b647
WL
8952012-10-02 Jiong Wang <jiwang@tilera.com>
896
897 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
898 global_offset_table_ value for larget got.
899 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
900
e5d5f5ed
AM
9012012-09-29 Alan Modra <amodra@gmail.com>
902
903 * powerpc.cc (Target_powerpc::iplt_): New output section.
904 (Target_powerpc::iplt_section, make_iplt_section,
905 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
906 (Target_powerpc::make_plt_entry): Handle ifunc syms.
907 Target_powerpc::plt_entry_count): Count iplt entries too.
908 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
909 reloc section in constructor. New params.
910 (Target_powerpc::make_plt_section): Create reloc section here instead.
911 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
912 functions.
913 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
914 (Output_data_glink::add_entry, find_entry): New functions to
915 deal with local syms.
916 (Glink_sym_ent): Add support for local syms.
917 (Output_data_glink::do_write): Handle ifunc plt entries.
918 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
919 (Target_powerpc::Scan::local, global): Handle ifunc syms.
920 (Target_powerpc::Relocate::relocate): Likewise.
921 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
922
ec4dbad3
AM
9232012-09-25 Alan Modra <amodra@gmail.com>
924
925 * object.h (Sized_relobj_file::adjust_local_symbol,
926 do_adjust_local_symbol): New functions.
927 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
928 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
929 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
930 and irregular opd entry spacing.
931 (Powerpc_relobj::do_read_relocs): Add opd size checks.
932 (Global_symbol_visitor_opd): New functor.
933 (Target_powerpc::do_finalize_sections): Omit global symbols defined
934 on deleted opd entries.
935
5c0b3823
WL
9362012-09-15 Jiong Wang <jiwang@tilera.com>
937
938 * tilegx.cc: New file.
939 * Makefile.am (TARGETSOURCES): Add tilegx.cc
940 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
941 * configure.tgt: Add entries for tilegx*.
942 * configure.ac: Likewise.
943 * Makefile.in: Rebuild.
944 * configure: Likewise.
945 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
946 tilegx.
947
bfdfa4cd
AM
9482012-09-13 Alan Modra <amodra@gmail.com>
949
950 * target-reloc.h (scan_relocs): Call scan.local for relocs
951 against symbols in discarded sections. Pass is_discarded
952 param.
953 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
954 Add is_discarded param.
955 * powerpc (Target_powerpc::Scan::local): Likewise. Use
956 is_discarded to flag opd entry as discarded. Don't emit dyn
957 relocs on such entries.
958 (Target_powerpc::Scan::global): Similarly detect and handle
959 such opd entries.
960 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
961 opd_ent_. Update all uses.
962 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
963 (Target_powerpc::relocate_section): Zero out discarded opd
964 entry relocs.
965
d77a0555
ILT
9662012-09-12 Ian Lance Taylor <iant@google.com>
967
968 PR gold/14570
969 * output.cc: Rename Output_data_got template parameter from size
970 to got_size for all functions. Compile all variants of
971 Output_data_got.
972 (Output_data_got::Got_entry::write): Correct use of size for
973 symbol value. Use local_is_tls rather than casting to
974 Sized_relobj_file.
975 * object.h (class Object): Add local_is_tls and do_local_is_tls.
976 (class Sized_relobj_file): Add do_local_is_tls.
977 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
978
815a1205
AM
9792012-09-11 Alan Modra <amodra@gmail.com>
980
981 PR gold/14566
982 * layout.cc (Layout::set_segment_offsets): When using
983 common-page-size alignment, ensure we are on a new max-page-size
984 page.
985 * output.cc (Output_segment::set_section_addresses): Use
986 abi_pagesize, not common_pagesize for relro boundary.
987 (Output_segment::set_offset): Likewise.
988
bd73a62d
AM
9892012-09-11 Alan Modra <amodra@gmail.com>
990
991 * output.h (Output_data_got::add_global_tls, add_local_tls,
992 add_local_tls_pair): New functions.
993 (Output_data_got::add_local_pair_with_rel): Remove second
994 reloc param. Expand comment.
995 (Output_data_got::Got_entry): Rename use_plt_offset_ to
996 use_plt_or_tls_offset_, similarly for constructor param.
997 (Output_data_got::Got_entry::write): Add got_index param.
998 * output.cc (Output_data_got::add_global_tls, add_local_tls,
999 add_local_tls_pair): New functions.
1000 (Output_data_got::Got_entry::write): Handle tls symbols
1001 with use_plt_or_tls_offset_ set specially.
1002 (Output_data_got::add_local_pair_with_rel): Only one reloc.
1003 (Output_data_got::do_write): Replace iterator with index, pass
1004 index to entry write function.
1005 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
1006 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
1007 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
1008 call.
1009 * i386.cc (Target_i386::Scan::local): Likewise.
1010 * sparc.cc (Target_sparc::Scan::local): Likewise.
1011 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
1012 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
1013 do_tls_offset_for_global): New functions.
1014 (Target_powerpc::Scan::local): Correct TLS relocations and got
1015 entry values.
1016 (Target_powerpc::Scan::global): Don't emit unnecessary
1017 dynamic relocations on TLS GOT entries.
1018
00716ab1
AM
10192012-09-10 Matthias Klose <doko@ubuntu.com>
1020
1021 * config.in: Disable sanity check for kfreebsd.
1022
c891b3f9
SA
10232012-09-10 Sterling Augustine <saugustine@google.com>
1024
1025 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
1026 (Gdb_index::pubtypes_read): New parameter.
1027 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
1028 to calls.
1029 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
1030 pubtypes_object_.
1031
e81fea4d
AM
10322012-09-09 Alan Modra <amodra@gmail.com>
1033
1034 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
1035 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
1036 * gc.h (gc_process_relocs): Call target gc_add_reference.
1037 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
1038 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
1039 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
1040 unnecessary cast.
1041 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
1042 to cater for when we don't need code offset. Update use.
1043 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
1044 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
1045 set_opd_valid): New functions.
1046 (Target_powerpc::do_gc_add_reference): New function.
1047 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
1048 stashed refs.
1049 (Target_powerpc::do_gc_mark_symbol): New function.
1050
d2d60eef
CC
10512012-09-06 Cary Coutant <ccoutant@google.com>
1052
1053 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
1054 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
1055 (Dwarf_die::skip_attributes): Likewise.
1056 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
1057 * testsuite/gdb_index_test.cc (inline_func_1): New function.
1058 (main): Call it.
1059 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
1060
32ed4573
L
10612012-09-05 H.J. Lu <hongjiu.lu@intel.com>
1062
1063 * testsuite/script_test_3.t: Add .got.plt output section
1064 statement.
1065 * testsuite/script_test_4.t: Likewise.
1066
f4baf0d4
AM
10672012-09-05 Alan Modra <amodra@gmail.com>
1068
1069 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
1070 update all uses and lose "enum" when using type.
1071
864a1b56
AM
10722012-09-05 Alan Modra <amodra@gmail.com>
1073
1074 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
1075 * configure: Regenerate.
1076 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
1077 (plugin_final_layout.stdout): Likewise.
1078 (memory_test): Set page sizes to 0x1000.
1079 * testsuite/Makefile.in: Regenerate.
1080 * testsuite/discard_locals_test.sh: Add FIXME comment.
1081 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
1082 * testsuite/pr14265.t: Add .got output section statement.
1083 * testsuite/script_test_2.t: Likewise.
1084 * testsuite/script_test_3.t: Likewise.
1085 * testsuite/script_test_4.t: Likewise.
1086 * testsuite/script_test_5.t: Likewise.
1087 * testsuite/script_test_6.t: Likewise.
1088 * testsuite/script_test_7.t: Likewise.
1089 * testsuite/script_test_9.t: Likewise.
1090
3ea0a085
AM
10912012-09-05 Alan Modra <amodra@gmail.com>
1092
1093 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
1094 (Powerpc_relocate_functions::Status): New typedef.
1095 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
1096 (Target_powerpc::Scan::local): Handle REL64.
1097 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
1098 for REL32 and REL64.
1099 (Target_powerpc::symval_for_branch): New function, extracted from..
1100 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
1101 checks. Report overflow errors.
1102
7404fe1b
AM
11032012-09-05 Alan Modra <amodra@gmail.com>
1104
1105 * object.h (Sized_relobj_file::emit_relocs): Delete.
1106 (Sized_relobj_file::emit_relocs_reltype): Delete.
1107 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
1108 relocate_relocs for --emit-relocs.
1109 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
1110 * output.h: Update comment.
1111 (Output_segment::first_section): New function.
1112 (Output_segment::first_section_load_address): Use first_section.
1113 * output.cc (Output_segment::first_section): New function extracted..
1114 (Output_segment::first_section_load_address): ..from here. Delete.
1115 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
1116 * target.h (Sized_target::relocate_for_relocatable): Likewise.
1117 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
1118 adjust call to target.h function.
1119 * i386.cc (Target_i386): Likewise.
1120 * sparc.cc (Target_sparc): Likewise.
1121 * x86_64.cc (Target_x86_64): Likewise.
1122 * powerpc.cc (Target_powerpc): Likewise.
1123 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
1124 first tls section has section symbol for optimised local dynamic
1125 output relocs.
1126 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
1127 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
1128 optimised tls code.
1129 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
1130 Rename to relocate_relocs. Update error message.
1131
957564c9
AS
11322012-09-04 Andreas Schwab <schwab@linux-m68k.org>
1133
1134 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
1135 --just-symbols.
1136
dd93cd0a
AM
11372012-08-31 Alan Modra <amodra@gmail.com>
1138
1139 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
1140 (Powerpc_relobj::toc_base_offset): New stub function.
1141 (Target_powerpc): Add tp_offset, dtp_offset. Rename
1142 got_mod_index_offset to tlsld_got_offset. Update all refs.
1143 (Target_powerpc::Relocate::enum skip_tls): New.
1144 (Target_powerpc::call_tls_get_addr_): New var.
1145 (Target_powerpc::is_branch_reloc): Move to file scope.
1146 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
1147 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
1148 New functions.
1149 (Target_powerpc::enum Got_type): Delete old values, add new ones.
1150 (powerpc_info): Correct common_pagesize for ppc64.
1151 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
1152 (Powerpc_relocate_functions): Add overflow check enums and functions.
1153 Add non-shift version of rela, rela_ua. Delete all rel public
1154 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
1155 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
1156 addr16_ha3, addr14 functions.
1157 (Output_data_got_powerpc::add_constant_pair): New function.
1158 (Output_data_got_powerpc::got_base_offset): Likewise.
1159 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
1160 (instruction constants): Sort, add some more.
1161 (Output_data_glink::do_write): Add and use Address typedef. Use
1162 object->toc_base_offset() stub for 64-bit.
1163 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
1164 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
1165 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
1166 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
1167 Always treat .opd relocs as against locally defined symbol.
1168 Correct condition for RELATIVE relocs.
1169 (Target_powerpc::do_finalize_sections): Test for NULL sections.
1170 (Target_powerpc::Relocate::relocate): Use plt call stub as value
1171 for 32-bit syms with a plt entry. Correct ppc64 toc base
1172 calculations. Handle TLS relocs, and more. Add overflow
1173 checking and adjust for Powerpc_relocate_functions changes.
1174 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
1175 Reinstate --emit-relocs code with FIXME.
1176
a1373b60
AM
11772012-08-30 Alan Modra <amodra@gmail.com>
1178
1179 * layout.cc (Layout::set_segment_offsets): Set p_align to
1180 abi_pagesize, not common_pagesize.
1181 (Layout::relaxation_loop_body): Similarly use abi_pagesize
1182 to determine whether file header can go in segment.
1183
703d02da
AM
11842012-08-30 Alan Modra <amodra@gmail.com>
1185
1186 * output.h (Output_reloc::Output_reloc <output section>): Add
1187 is_relative param. Adjust calls.
1188 (Output_reloc::add_output_section_relative): New functions.
1189 * output.cc (Output_reloc::Output_reloc <output section>): Handle
1190 is_relative.
1191 (Output_reloc::symbol_value): Handle SECTION_CODE.
1192
16164a6b
ST
11932012-08-24 Sriraman Tallam <tmsriram@google.com>
1194
1195 * gold.cc (queue_middle_tasks): Call layout again when unique
1196 segments for sections is desired.
1197 * layout.cc (Layout::Layout): Initialize new members.
1198 (Layout::get_output_section_flags): New function.
1199 (Layout::choose_output_section): Call get_output_section_flags.
1200 (Layout::layout): Make output section for mapping to a unique segment.
1201 (Layout::insert_section_segment_map): New function.
1202 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 1203 output sections marked so.
16164a6b
ST
1204 (Layout::segment_precedes): Check for unique segments when sorting.
1205 * layout.h (Layout::Unique_segment_info): New struct.
1206 (Layout::Section_segment_map): New typedef.
1207 (Layout::insert_section_segment_map): New function.
1208 (Layout::get_output_section_flags): New function.
1209 (Layout::is_unique_segment_for_sections_specified): New function.
1210 (Layout::set_unique_segment_for_sections_specified): New function.
1211 (Layout::unique_segment_for_sections_specified_): New member.
1212 (Layout::section_segment_map_): New member.
1213 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
1214 Rename is_gc_pass_one to is_pass_one.
1215 Rename is_gc_pass_two to is_pass_two.
1216 Rename is_gc_or_icf to is_two_pass.
1217 Check for which pass based on whether symbols data is present.
1218 Make it two pass when unique segments for sections is desired.
1219 * output.cc (Output_section::Output_section): Initialize new
1220 members.
1221 * output.h (Output_section::is_unique_segment): New function.
1222 (Output_section::set_is_unique_segment): New function.
1223 (Output_section::is_unique_segment_): New member.
1224 (Output_section::extra_segment_flags): New function.
1225 (Output_section::set_extra_segment_flags): New function.
1226 (Output_section::extra_segment_flags_): New member.
1227 (Output_section::segment_alignment): New function.
1228 (Output_section::set_segment_alignment): New function.
1229 (Output_section::segment_alignment_): New member.
1230 (Output_segment::Output_segment): Initialize is_unique_segment_.
1231 (Output_segment::is_unique_segment): New function.
1232 (Output_segment::set_is_unique_segment): New function.
1233 (Output_segment::is_unique_segment_): New member.
1234 * plugin.cc (allow_unique_segment_for_sections): New function.
1235 (unique_segment_for_sections): New function.
1236 (Plugin::load): Add new functions to transfer vector.
1237 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
1238 * Makefile.in: Regenerate.
1239 * testsuite/plugin_final_layout.sh: Check if unique segment
1240 functionality works.
1241 * testsuite/plugin_section_order.c (onload): Check if new interfaces
1242 are available.
1243 (allow_unique_segment_for_sections): New global.
1244 (unique_segment_for_sections): New global.
1245 (claim_file_hook): Call allow_unique_segment_for_sections.
1246 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 1247
1e2bee4f
CC
12482012-08-22 Cary Coutant <ccoutant@google.com>
1249
1250 * layout.cc (Layout::include_section): Don't assert on GROUP
1251 sections with --emit-relocs.
1252
1d5dfe78
CC
12532012-08-21 Cary Coutant <ccoutant@google.com>
1254
1255 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
1256 if --export-dynamic-symbol names an undef symbol.
1257
c9269dff
AM
12582012-08-18 Alan Modra <amodra@gmail.com>
1259
1260 * powerpc.cc: Formatting and white space.
1261 (Powerpc_relobj): Rename got2_section_ to special_.
1262 Add opd_ent_shndx_ and opd_ent_off_ vectors.
1263 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
1264 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
1265 (Target_powerpc): Add Address typedef and invalid_address. Use
1266 throughout.
1267 (Target_powerpc::is_branch_reloc): New function.
1268 (Powerpc_relocate_functions): Add Address typedef, use throughout.
1269 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
1270 for dst_mask, value and addend.
1271 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
1272 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
1273 (Output_data_glink::do_write): Correct toc base. Don't try to use
1274 uint16_t for 24-bit offset. Use get_output_section_offset and
1275 check return.
1276 (Target_powerpc::Scan::local): Handle more relocs.
1277 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
1278 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
1279 Plug in toc restoring insn after plt calls. Translate branches
1280 to function descriptor symbols to corresponding entry point.
1281 (Target_powerpc::relocate_for_relocatable): Check return from
1282 get_output_section_offset.
1283 * symtab.h: Comment typo.
1284
b1759dce
ILT
12852012-08-14 Ian Lance Taylor <iant@google.com>
1286
1287 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
1288 unsupported_relocal_local to call unsupported_reloc_global.
1289
b9b2ae8b
NC
12902012-08-14 Nick Clifton <nickc@redhat.com>
1291
1292 PR ld/14265
1293 * script-sections.cc (Sections_element::output_section_name): Add
1294 keep return parameter.
1295 (Output_section_element::match_name): Add keep return parameter.
1296 Return the value of the keep_ member.
1297 * script-sections.h (class Output_section): Update
1298 output_section_name prototype.
1299 * layout.cc (Layout::keep_input_section): New public member
1300 function.
1301 (Layout::choose_output_section): Pass keep parameter to
1302 output_section_name.
1303 * layout.h (class Layout): Add keep_input_section.
1304 * object.cc (Sized_relobj_file::do_layout): Check for kept input
1305 sections.
1306 * testsuite/Makefile.am: Add a test.
1307 * testsuite/Makefile.in: Regenerate.
1308 * testsuite/pr14265.c: Source file for the test.
1309 * testsuite/pr14265.t: Linker script for the test.
1310 * testsuite/pr14265.sh: Shell script for the test.
1311
921b5322
AM
13122012-08-14 Alan Modra <amodra@gmail.com>
1313
1314 * target.h (Target::output_section_name): New function.
1315 (Target::do_output_section_name): New function.
1316 * layout.cc (Layout::choose_output_section): Call the above.
1317 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
1318
6ce78956
AM
13192012-08-14 Alan Modra <amodra@gmail.com>
1320
1321 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
1322 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
1323 for replace_constant call.
1324 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
1325 (Output_data_glink::do_print_to_mapfile): New function.
1326 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
1327 (Target_powerpc::Relocate::relocate): Likewise.
1328
d1a8cabd
AM
13292012-08-14 Alan Modra <amodra@gmail.com>
1330
1331 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
1332 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
1333 (Output_data_glink::add_entry,find_entry): Remove shndx param.
1334 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
1335 all references to shndx_. Handle special case for R_PPC_PLTREL24
1336 here.
1337 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
1338 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
1339 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
1340 here.
1341 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
1342 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
1343
d83ce4e3
AM
13442012-08-12 Alan Modra <amodra@gmail.com>
1345
1346 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
1347 (glink insn constants): Use uint32_t.
1348 (Output_data_glink::add_entry): Use insert, not [] operator.
1349
cf43a2fe
AM
13502012-08-11 Alan Modra <amodra@gmail.com>
1351
1352 * object.h (Sized_relobj_file::find_shdr): New function.
1353 (Sized_relobj_file::find_special_sections): New function.
1354 * object.cc (Sized_relobj_file::find_shdr): New function.
1355 (Sized_relobj_file::find_eh_frame): Use find_shdr.
1356 (Sized_relobj_file::find_special_sections): New function, split out..
1357 (Sized_relobj_file::do_read_symbols): ..from here.
1358 * output.h (Output_data_got::replace_constant): New function.
1359 (Output_data_got::num_entries): New function.
1360 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
1361 (Output_data_got::got_offset): Protected rather than private.
1362 (Output_data_got::replace_got_entry): New function.
1363 * output.cc (Output_data_got::replace_got_entry): New function.
1364 * powerpc.cc (class Powerpc_relobj): New.
1365 (class Powerpc_relocate_functions): Delete all psymval variants or
1366 convert to value,addend type. Delete pcrela, pcrela_unaligned.
1367 Implement _ha functions using corresponding _hi function.
1368 (Powerpc_relobj::find_special_sections): New function.
1369 (Target_powerpc::do_make_elf_object): New function.
1370 (class Output_data_got_powerpc): New.
1371 (class Output_data_glink): New.
1372 (class Powerpc_scan_relocatable_reloc): New.
1373 Many more changes througout file.
1374
3c892704
NC
13752012-08-09 Nick Clifton <nickc@redhat.com>
1376
1377 * po/vi.po: Updated Vietnamese translation.
1378
82435b3b
ILT
13792012-08-07 Ian Lance Taylor <iant@google.com>
1380
1381 * layout.cc (Layout::add_target_dynamic_tags): If
1382 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
1383 plt_rel.
1384
a6dc81d2
NC
13852012-07-30 Nick Clifton <nickc@redhat.com>
1386
1387 * po/gold.pot: Updated template.
1388 * po/es.po: Updated Spanish translation.
1389
f1415016
CC
13902012-07-18 Cary Coutant <ccoutant@google.com>
1391
1392 PR gold/14344
1393 * configure.ac: Add check for -gpubnames support.
1394 * configure: Regenerate.
1395 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
1396 support; force -gno-pubnames.
1397 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
1398 support.
1399 (gdb_index_test_4): New test.
1400 * testsuite/Makefile.in: Regenerate.
1401 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
1402 * testsuite/gdb_index_test_2.sh: Likewise.
1403 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
1404 * testsuite/gdb_index_test_4.sh: New script.
1405 * testsuite/gdb_index_test_comm.sh: New script with common code;
1406 don't look for space after colon.
1407
b7fd7c37
ST
14082012-07-16 Sriraman Tallam <tmsriram@google.com>
1409
1410 * gold.cc (queue_middle_tasks): Update function order only after
1411 deferred objects due to plugins are processed.
1412
1f3212db
ILT
14132012-07-11 Ian Lance Taylor <iant@google.com>
1414
1415 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
1416 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
1417 (Target_arm::scan_reloc_for_stub): Likewise.
1418 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
1419 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
1420 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
1421 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
1422 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
1423
81c82a68
ILT
14242012-07-10 Dodji Seketeli <dodji@redhat.com>
1425 Ian Lance Taylor <iant@google.com>
1426
1427 PR gold/14309
1428 * configure.ac: Test whether std::tr1::hash<off_t> works.
1429 * gold.h: Add a specialization for std::tr1::hash<off_t> if
1430 needed.
1431 * output.h (class Output_fill): Add virtual destructor.
1432 * configure, config.in: Rebuild.
1433
eabc84f4
RM
14342012-06-22 Roland McGrath <mcgrathr@google.com>
1435
1436 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
1437
370e30b6
RÁE
14382012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
1439
1440 * plugin.cc (Plugin::load): Handle position independent executables.
1441
fb1b895d
CC
14422012-06-06 Cary Coutant <ccoutant@google.com>
1443
1444 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
1445 add .debug_macro.
1446 (lines_only_debug_sections): Likewise.
1447 (gdb_fast_lookup_sections): New static array.
1448 (is_gdb_debug_section): Rename formal parameter.
1449 (is_lines_only_debug_section): Likewise.
1450 (is_gdb_fast_lookup_section): New function.
1451 (Layout::include_section): Check for ".zdebug_" prefix; pass
1452 section name suffix to is_gdb_debug_section, et al.; check for
1453 fast-lookup sections when building .gdb_index.
1454 * options.h (--strip-debug-gdb): Update GDB version number.
1455
7c0640fa
CC
14562012-06-06 Cary Coutant <ccoutant@google.com>
1457
1458 * configure.ac: Add check for fallocate.
1459 * configure: Regenerate.
1460 * config.in: Regenerate.
1461
1462 * options.h (class General_options): Add --mmap-output-file and
1463 --posix-fallocate options.
1464 * output.cc: (posix_fallocate): Remove; replace with...
1465 (gold_fallocate): New function.
1466 (Output_file::map_no_anonymous): Call gold_fallocate.
1467 (Output_file::map): Check --mmap-output-file option.
1468
2a49eb69
DK
14692012-06-05 Jing Yu <jingyu@google.com>
1470
1471 * gold.h (textdomain): Add do {} to empty while(0).
1472 (bindtextdomain): Likewise.
1473
fad072ac
CC
14742012-06-04 Cary Coutant <ccoutant@google.com>
1475
1476 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
1477 has_dynsym_index.
1478
8cc69fb6
ST
14792012-05-25 Sriraman Tallam <tmsriram@google.com>
1480
1481 * symtab.cc (Symbol_table::define_special_symbol):
1482 Initialize *poldsym to prevent uninitialized variable errors.
1483
1be75daa
CC
14842012-05-23 Cary Coutant <ccoutant@google.com>
1485
1486 * layout.cc (Layout::section_name_mapping): Add rules to handle
1487 exact match on .data.rel.ro.local or .data.rel.ro.
1488 (Layout::output_section_name): Check for exact matches.
1489
9b689de0
CC
14902012-05-23 Cary Coutant <ccoutant@google.com>
1491
1492 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
1493 more carefully.
1494
b24fdbf5
CC
14952012-05-22 Cary Coutant <ccoutant@google.com>
1496
1497 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
1498 object before exporting symbol.
1499
e550e1a2
L
15002012-05-21 H.J. Lu <hongjiu.lu@intel.com>
1501
1502 * testsuite/tls_test.cc: Include "config.h" first.
1503 * testsuite/tls_test_c.c: Likewise.
1504
df7b86aa
NC
15052012-05-17 Daniel Richard G. <skunk@iskunk.org>
1506 Nick Clifton <nickc@redhat.com>
1507
1508 PR 14072
1509 * configure.in: Add check that sysdep.h has been included before
1510 any system header files.
1511 * configure: Regenerate.
1512 * config.in: Regenerate.
1513
1007b503
CC
15142012-05-14 Cary Coutant <ccoutant@google.com>
1515
1516 * layout.cc (Layout::make_output_section): Mark .tdata section
1517 as RELRO.
1518 * testsuite/relro_test.cc: Add a TLS variable.
1519
fd885f3a
L
15202012-05-10 H.J. Lu <hongjiu.lu@intel.com>
1521
1522 PR gold/14091
1523 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
1524 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
1525 R_X86_64_64.
1526
80f5885c
CC
15272012-05-08 Cary Coutant <ccoutant@google.com>
1528
1529 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
1530 (lines_only_debug_sections): Likewise.
1531
2e702c99
RM
15322012-05-02 Roland McGrath <mcgrathr@google.com>
1533
1534 * nacl.cc: New file.
1535 * nacl.h: New file.
1536 * Makefile.am (CCFILES, HFILES): Add them.
1537 * Makefile.in: Regenerate.
1538 * i386.cc (Output_data_plt_i386_nacl): New class.
1539 (Output_data_plt_i386_nacl_exec): New class.
1540 (Output_data_plt_i386_nacl_dyn): New class.
1541 (Target_i386_nacl): New class.
1542 (Target_selector_i386_nacl): New class.
1543 (target_selector_i386): Use it instead of Target_selector_i386.
1544 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
1545 (Target_x86_64_nacl): New class.
1546 (Target_selector_x86_64_nacl): New class.
1547 (target_selector_x86_64, target_selector_x32): Use it instead of
1548 Target_selector_x86_64.
1549 * arm.cc (Output_data_plt_arm_nacl): New class.
1550 (Target_arm_nacl): New class.
1551 (Target_selector_arm_nacl): New class.
1552 (target_selector_arm, target_selector_armbe): Use it instead of
1553 Target_selector_arm.
1554
1555 * target-select.cc (select_target): Take new Input_file* and off_t
1556 arguments, pass them on to recognize method of selector.
1557 * object.cc (make_elf_sized_object): Update caller.
1558 * parameters.cc (parameters_force_valid_target): Likewise.
1559 * incremental.cc (make_sized_incremental_binary): Likewise.
1560 * target-select.h: Update decl.
1561 (Target_selector::recognize): Take new Input_file* argument,
1562 pass it on to do_recognize.
1563 (Target_selector::do_recognize): Take new Input_file* argument.
1564 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
1565 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
1566 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
1567 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
1568
1569 * target.h (Target::Target_info): New members isolate_execinstr
1570 and rosegment_gap.
1571 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
1572 * arm.cc (Target_arm::arm_info): Update initializer.
1573 * i386.cc (Target_i386::i386_info): Likewise.
1574 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
1575 * sparc.cc (Target_sparc::sparc_info): Likewise.
1576 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
1577 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1578 * layout.cc (Layout::attach_allocated_section_to_segment):
1579 Take new const Target* argument. If target->isolate_execinstr(), act
1580 like --rosegment.
1581 (Layout::find_first_load_seg): Take new const Target* argument;
1582 if target->isolate_execinstr(), reject PF_X segments.
1583 (Layout::relaxation_loop_body): Update caller.
1584 (Layout::set_segment_offsets): If target->isolate_execinstr(),
1585 reset file offset to zero when we hit LOAD_SEG, and then do a second
1586 loop over the segments before LOAD_SEG to reassign offsets after
1587 addresses have been determined. Handle target->rosegment_gap().
1588 (Layout::attach_section_to_segment): Take new const Target* argument;
1589 pass it to attach_allocated_section_to_segment.
1590 (Layout::make_output_section): Update caller.
1591 (Layout::attach_sections_to_segments): Take new const Target* argument;
1592 pass it to attach_section_to_segment.
1593 * gold.cc (queue_middle_tasks): Update caller.
1594 * layout.h (Layout): Update method decls with new arguments.
1595
1596 * arm.cc (Target_arm::Target_arm): Take optional argument for the
1597 Target_info pointer to use.
1598 (Target_arm::do_make_data_plt): New virtual method.
1599 (Target_arm::make_data_plt): New method that calls it.
1600 (Target_arm::make_plt_entry): Use it.
1601 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
1602 for the section alignment.
1603 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
1604 method.
1605 (Output_data_plt_arm::first_plt_entry_offset): Call it.
1606 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
1607 method.
1608 (Output_data_plt_arm::get_plt_entry_size): Call it.
1609 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
1610 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
1611 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
1612 method.
1613 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
1614 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
1615 method instead of sizeof(plt_entry).
1616 (Output_data_plt_arm::add_entry): Likewise.
1617 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
1618 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
1619 than static method.
1620 (Target_arm::plt_entry_size): Likewise.
1621 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
1622 Move to ...
1623 (Output_data_plt_arm_standard): ... here, new class.
1624 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
1625 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
1626 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
1627
1628 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
1629 Take additional argument for the PLT entry size.
1630 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
1631 Use get_plt_entry_size method rather than plt_entry_size variable.
1632 (Output_data_plt_x86_64::reserve_slot): Likewise.
1633 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
1634 (Output_data_plt_x86_64::add_entry): Likewise.
1635 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
1636 (Output_data_plt_x86_64::address_for_global): Likewise.
1637 (Output_data_plt_x86_64::address_for_local): Likewise.
1638 (Output_data_plt_x86_64::set_final_data_size): Likewise.
1639 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
1640 Make method non-static.
1641 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
1642 method.
1643 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
1644 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
1645 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
1646 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
1647 virtual method.
1648 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
1649 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
1650 virtual method.
1651 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
1652 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
1653 virtual method.
1654 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
1655 (Output_data_plt_x86_64::plt_entry_size)
1656 (Output_data_plt_x86_64::first_plt_entry)
1657 (Output_data_plt_x86_64::plt_entry)
1658 (Output_data_plt_x86_64::tlsdesc_plt_entry)
1659 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
1660 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
1661 (Output_data_plt_x86_64_standard): ... here, new class.
1662 (Target_x86_64::Target_x86_64): Take optional argument for the
1663 Target_info pointer to use.
1664 (Target_x86_64::do_make_data_plt): New virtual method.
1665 (Target_x86_64::make_data_plt): New method to call it.
1666 (Target_x86_64::init_got_plt_for_update): Use that.
1667 Call this->plt_->add_eh_frame method here.
1668 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
1669 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
1670 rather than static method.
1671 (Target_x86_64::plt_entry_size): Likewise.
1672 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
1673 rather than plt_entry_size variable. Move guts of PLT filling to...
1674 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
1675 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
1676 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
1677
1678 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
1679 additional argument for the section alignment.
1680 Don't do add_eh_frame_for_plt here.
1681 (Output_data_plt_i386::first_plt_entry_offset): Make the method
1682 non-static. Use get_plt_entry_size method rather than plt_entry_size
1683 variable.
1684 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
1685 method.
1686 (Output_data_plt_i386::get_plt_entry_size): Call it.
1687 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
1688 (Output_data_plt_i386::add_eh_frame): New method to call it.
1689 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
1690 method.
1691 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
1692 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
1693 method.
1694 (Output_data_plt_i386::fill_plt_entry): New method to call it.
1695 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
1696 method instead of plt_entry_size.
1697 (Output_data_plt_i386::plt_entry_size)
1698 (Output_data_plt_i386::plt_eh_frame_fde_size)
1699 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
1700 (Output_data_plt_i386_standard): ... here, new class.
1701 (Output_data_plt_i386_exec): New class.
1702 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
1703 (Output_data_plt_i386_exec::first_plt_entry): ... here.
1704 (Output_data_plt_i386::exec_plt_entry): Move to ...
1705 (Output_data_plt_i386_exec::plt_entry): ... here.
1706 (Output_data_plt_i386_dyn): New class.
1707 (Output_data_plt_i386::first_plt_entry): Move to ...
1708 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
1709 (Output_data_plt_i386::dyn_plt_entry): Move to ...
1710 (Output_data_plt_i386_dyn::plt_entry): ... here.
1711 (Target_i386::Target_i386): Take optional argument for the Target_info
1712 pointer to use.
1713 (Target_i386::do_make_data_plt): New virtual method.
1714 (Target_i386::make_data_plt): New method to call it.
1715 (Target_i386::make_plt_section): Use that.
1716 Call this->plt_->add_eh_frame method here.
1717 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
1718 rather than plt_entry_size variable.
1719 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
1720 (Output_data_plt_i386::address_for_local): Likewise.
1721 (Output_data_plt_i386::do_write): Likewise.
1722 Move guts of PLT filling to...
1723 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
1724 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
1725 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
1726 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
1727
b9b9f2ee
CC
17282012-05-01 Cary Coutant <ccoutant@google.com>
1729
1730 * dwarf_reader.cc (Dwarf_die::read_attributes)
1731 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
1732 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
1733 * reduced_debug_output.cc
1734 (Output_reduced_debug_info_section::get_die_end): Remove
1735 DW_FORM_GNU_ref_index. Add default case.
1736
57923f48
MW
17372012-04-26 Mark Wielaard <mjw@redhat.com>
1738
1739 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
1740 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
1741 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
1742 DW_AT_high_pc as offset from DW_AT_low_pc.
1743
1744 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
1745 * testsuite/Makefile.in: Regenerate.
1746 * testsuite/gdb_index_test_3.c: New test source file.
1747 * testsuite/gdb_index_test_3.sh: New test source file.
1748
2c54b4f4
ILT
17492012-04-25 Ian Lance Taylor <iant@google.com>
1750
1751 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
1752 pointer.
1753 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
1754 as a class, not a struct.
1755 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
1756 (Target_arm::apply_cortex_a8_workaround): Likewise.
1757 * gc.h: Declare Reloc_types as a struct, not a class.
1758 * object.h: Declare Symbols_data as a struct.
1759 * reloc.h: Declare Read_relocs_data as a struct.
1760 * target.h: Declare Relocate_info as a struct.
1761
a5a5f7a3
DM
17622012-04-24 David S. Miller <davem@davemloft.net>
1763
1764 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
1765 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
1766 and R_SPARC_WPLT30.
1767
f038d496
CC
17682012-04-24 Cary Coutant <ccoutant@google.com>
1769
1770 * incremental-dump.cc (find_input_containing_global): Replace
1771 magic number with symbolic constant.
1772 (dump_incremental_inputs): Update version number.
1773 * incremental.cc (Output_section_incremental_inputs): Update version
1774 number; import symbolic constants from Incremental_inputs_reader.
1775 (Incremental_inputs::create_data_sections): Align relocations
1776 section correctly for 64-bit targets.
1777 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
1778 constants; add padding.
1779 (Output_section_incremental_inputs::write_header): Add assert for
1780 header_size.
1781 (Output_section_incremental_inputs::write_input_files): Add assert
1782 for input_entry_size.
1783 (Output_section_incremental_inputs::write_info_blocks): Add padding;
1784 add assert for object_info_size, input_section_entry_size,
1785 global_sym_entry_size.
1786 * incremental.h (Incremental_inputs_reader): Add symbolic constants
1787 for data structure sizes; use them.
1788 (Incremental_input_entry_reader): Import symbolic constants from
1789 Incremental_inputs_reader; use them.
1790
a4d85145
DM
17912012-04-23 David S. Miller <davem@davemloft.net>
1792
1793 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
1794 and elf_flags_set_.
1795 (Target_sparc::Target_sparc): Initialize new fields.
1796 (Target_sparc::do_make_elf_object): New function.
1797 (Target_sparc::do_adjust_elf_header): New function.
1798
1d509098
CC
17992012-04-23 Cary Coutant <ccoutant@google.com>
1800
1801 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
1802 CU range table of gdb index.
1803
7ebeff7f
DM
18042012-04-20 David S. Miller <davem@davemloft.net>
1805
1806 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
1807 instead of false.
1808
13cf9988
DM
18092012-04-16 David S. Miller <davem@davemloft.net>
1810
2a1079e8
DM
1811 * sparc.cc (Target_sparc::got_address): New function.
1812 (Sparc_relocate_functions::gdop_hix22): New function.
1813 (Sparc_relocate_functions::gdop_lox10): New function.
1814 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
1815 relocs.
1816 (Target_sparc::Scan::local): Likewise if the global symbol is not
1817 preemptible and is not IFUNC.
1818 (Target_sparc::Relocate::relocate): Perform GOTDATA code
1819 transformations for local and non-preemptible non-IFUNC global
1820 symbols.
1821
0bc964fc
DM
1822 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
1823 writing out 64-bit part of ranges.
1824
661d7a80
DM
1825 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
1826 -fpic and -fpie respectively.
1827 * Makefile.in: Regenerate.
1828
8c2bf391
DM
1829 * sparc.cc (class Target_sparc): Add rela_ifunc_.
1830 (Target_sparc::Target_sparc): Initialize new field.
1831 (Target_sparc::do_plt_section_for_global): New function.
1832 (Target_sparc::do_plt_section_for_local): New function.
1833 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
1834 (Target_sparc::make_plt_section): New function, broken out of
1835 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
1836 (Target_sparc::make_plt_entry): Call make_plt_section.
1837 (Target_sparc::make_local_ifunc_plt_entry): New function.
1838 (Target_sparc::rela_ifunc_section): New function.
1839 (Target_sparc::plt_section): Remove const.
1840 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
1841 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
1842 and ifunc_count_ fields.
1843 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
1844 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
1845 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
1846 (Output_data_plt_sparc::rela_ifunc): New function.
1847 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
1848 (Output_data_plt_sparc::has_ifunc_section): New function.
1849 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
1850 (Output_data_plt_sparc::address_for_global): New function.
1851 (Output_data_plt_sparc::address_for_local): New function.
1852 (Output_data_plt_sparc::plt_index_to_offset): New function.
1853 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
1854 and entry_count.
1855 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
1856 entry_count.
1857 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
1858 R_SPARC_JMP_IREL to switch.
1859 (Target_sparc::Scan::check_non_pic): Likewise.
1860 (Target_sparc::Scan::local): Handle IFUNC symbols.
1861 (Target_sparc::Scan::local): Likewise.
1862 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
1863 and plt_address_for_local.
1864 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
1865 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
1866
13cf9988
DM
1867 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
1868 (class Output_data_reloc): Adjust calls to Output_reloc_type.
1869 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
1870 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
1871 global relocs too.
1872 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
1873 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
1874 calls.
1875 * sparc.cc (Target_sparc::Scan::global): Likewise.
1876 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
1877
31821be0
CC
18782012-04-16 Cary Coutant <ccoutant@google.com>
1879
1880 * archive.cc (Library_base::should_include_member): Check for
1881 --export-dynamic-symbol.
1882 * options.h (class General_options): Add --export-dynamic-symbol.
1883 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
1884 --export-dynamic-symbol.
1885 (Symbol_table::gc_mark_undef_symbols): Likewise.
1886 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
1887
2615994e
DM
18882012-04-12 David S. Miller <davem@davemloft.net>
1889
1890 * sparc.cc (Reloc::wdisp10): New relocation method.
1891 (Reloc::h34): Likewise.
1892 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
1893 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
1894 R_SPARC_WDISP10.
1895 (Target_sparc::Scan::local): Likewise.
1896 (Target_sparc::Scan::global): Likewise.
1897 (Target_sparc::Relocate::relocate): Likewise.
1898
6782735d
CC
18992012-04-09 Cary Coutant <ccoutant@google.com>
1900
1901 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
1902 low_pc == 0.
1903
8c7a0b00
ILT
19042012-04-06 Ian Lance Taylor <iant@google.com>
1905
1906 * timer.cc: #include <unistd.h>.
1907
58797674
RM
19082012-04-06 Roland McGrath <mcgrathr@google.com>
1909
1910 * configure.in (AC_CHECK_HEADERS): Add locale.h.
1911 * config.in: Regenerate.
1912 * configure: Regenerate.
1913
44350750
NC
19142012-04-05 Nick Clifton <nickc@redhat.com>
1915
1916 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
1917 (AM_LC_MESSAGES): Add.
1918 * aclocal.m4: Regenerate.
1919 * config.in: Regenerate.
1920 * configure: Regenerate.
1921
c1027032
CC
19222012-03-21 Cary Coutant <ccoutant@google.com>
1923
1924 * Makefile.am: Add gdb-index.cc, gdb-index.h.
1925 * Makefile.in: Regenerate.
1926 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
1927 (Sized_elf_reloc_mapper::symbol_section): New function.
1928 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
1929 (make_elf_reloc_mapper): New function.
1930 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
1931 (Dwarf_abbrev_table::do_read_abbrevs): New function.
1932 (Dwarf_abbrev_table::do_get_abbrev): New function.
1933 (Dwarf_ranges_table::read_ranges_table): New function.
1934 (Dwarf_ranges_table::read_range_list): New function.
1935 (Dwarf_pubnames_table::read_section): New function.
1936 (Dwarf_pubnames_table::read_header): New function.
1937 (Dwarf_pubnames_table::next_name): New function.
1938 (Dwarf_die::Dwarf_die): New function.
1939 (Dwarf_die::read_attributes): New function.
1940 (Dwarf_die::skip_attributes): New function.
1941 (Dwarf_die::set_name): New function.
1942 (Dwarf_die::set_linkage_name): New function.
1943 (Dwarf_die::attribute): New function.
1944 (Dwarf_die::string_attribute): New function.
1945 (Dwarf_die::int_attribute): New function.
1946 (Dwarf_die::uint_attribute): New function.
1947 (Dwarf_die::ref_attribute): New function.
1948 (Dwarf_die::child_offset): New function.
1949 (Dwarf_die::sibling_offset): New function.
1950 (Dwarf_info_reader::check_buffer): New function.
1951 (Dwarf_info_reader::parse): New function.
1952 (Dwarf_info_reader::do_parse): New function.
1953 (Dwarf_info_reader::do_read_string_table): New function.
1954 (Dwarf_info_reader::lookup_reloc): New function.
1955 (Dwarf_info_reader::get_string): New function.
1956 (Dwarf_info_reader::visit_compilation_unit): New function.
1957 (Dwarf_info_reader::visit_type_unit): New function.
1958 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
1959 Sized_elf_reloc_mapper.
1960 (Sized_dwarf_line_info::symbol_section): Remove function.
1961 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
1962 (Sized_dwarf_line_info::read_line_mappings): Remove object
1963 parameter, adjust callers.
1964 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
1965 * dwarf_reader.h: Include <sys/types.h>.
1966 (class Track_relocs): Remove forward declaration.
1967 (class Elf_reloc_mapper): New class.
1968 (class Sized_elf_reloc_mapper): New class.
1969 (class Dwarf_abbrev_table): New class.
1970 (class Dwarf_range_list): New class.
1971 (class Dwarf_ranges_table): New class.
1972 (class Dwarf_pubnames_table): New class.
1973 (class Dwarf_die): New class.
1974 (class Dwarf_info_reader): New class.
1975 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
1976 (Sized_dwarf_line_info::symbol_section): Remove member function.
1977 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
1978 base class.
1979 * gdb-index.cc: New source file.
1980 * gdb-index.h: New source file.
1981 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
1982 and .debug_types sections, call Layout::add_to_gdb_index.
1983 (Sized_relobj_incr::do_section_name): Implement.
1984 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
1985 return type; Implement.
1986 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
1987 return type.
1988 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
1989 parameter list and return type.
1990 (Sized_incr_dynobj::do_section_contents): Likewise.
1991 * layout.cc: Include gdb-index.h.
1992 (Layout::Layout): Initialize gdb_index_data_.
1993 (Layout::init_fixed_output_section): Check for .gdb_index section.
1994 (Layout::add_to_gdb_index): New function. Instantiate.
1995 * layout.h: Add forward declaration for class Gdb_index.
1996 (Layout::add_to_gdb_index): New member function.
1997 (Layout::gdb_index_data_): New data member.
1998 * main.cc: Include gdb-index.h.
1999 (main): Print statistics for gdb index.
2000 * object.cc (Object::section_contents): Move code into
2001 do_section_contents.
2002 (need_decompressed_section): Check for sections needed when building
2003 gdb index.
2004 (build_compressed_section_map): Likewise.
2005 (Sized_relobj_file::do_read_symbols): Need local symbols when building
2006 gdb index.
2007 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
2008 sections; call Layout::add_to_gdb_index.
2009 (Sized_relobj_file::do_decompressed_section_contents): Call
2010 do_section_contents directly.
2011 * object.h (Object::do_section_contents): Adjust parameter list and
2012 return type.
2013 (Object::do_decompressed_section_contents): Call do_section_contents
2014 directly.
2015 (Sized_relobj_file::do_section_contents): Adjust parameter list and
2016 return type.
2017 * options.h (class General_options): Add --gdb-index option.
2018 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
2019 list and return type.
2020 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
2021 * reloc.h (Track_relocs::checkpoint): New function.
2022 (Track_relocs::reset): New function.
2023
2024 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
2025 New test cases.
2026 * testsuite/Makefile.in: Regenerate.
2027 * testsuite/gdb_index_test.cc: New test source file.
2028 * testsuite/gdb_index_test_1.sh: New test source file.
2029 * testsuite/gdb_index_test_2.sh: New test source file.
2030
647f1574
DK
20312012-03-19 Doug Kwan <dougkwan@google.com>
2032
2033 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 2034 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
2035 __exidx_start and __exidx_end. Make symbol table parameter
2036 anonymous as it is not used.
2037 * gold.cc (queue_middle_tasks): Call target hook to define any
2038 target-specific symbols.
2039 * target.h (Target::define_standard_symbols): New method.
2040 (Target::do_define_standard_symbols): Same.
2041 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
2042 * testsuite/Makefile.in: Regenerate.
2043 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
2044 and __exidx_end.
2045 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
2046 relocations are generated for __exidx_start and __exidx_end.
2047
7c6109da
DK
20482012-03-16 Doug Kwan <dougkwan@google.com>
2049
2050 * testsuite/Makefile.am: Disable test initpri3b.
2051 * testsuite/Makefile.in: Regenerate.
2052
7b8957f8
DK
20532012-03-15 Doug Kwan <dougkwan@google.com>
2054
2055 * arm.cc (Target_arm::got_section): Make .got section read-only
2056 if -z now is given.
2057
14dc9ef7
ILT
20582012-03-15 Ian Lance Taylor <iant@google.com>
2059
2060 PR gold/13850
2061 * layout.cc (Layout::make_output_section): Correctly mark
2062 SHT_INIT_ARRAY, et. al., as relro.
2063
fa40b62a
DK
20642012-03-14 Doug Kwan <dougkwan@google.com>
2065
2066 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
2067 dynamic relocations for protected symbols in shared objects.
2068
fd325007
ILT
20692012-03-13 Ian Lance Taylor <iant@google.com>
2070
2071 * resolve.cc (Symbol_table::resolve): When merging common symbols,
2072 keep the larger alignment.
2073
e8dd54e1
CC
20742012-03-12 Cary Coutant <ccoutant@google.com>
2075
2076 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
2077 handling of DW_LNE_define_file.
2078
feb5f3b0
CC
20792012-03-12 Cary Coutant <ccoutant@google.com>
2080
2081 * reduced_debug_output.cc
2082 (Output_reduced_debug_info_section::get_die_end): Add new FORM
2083 codes to switch.
2084
a1fb4256
CC
20852012-02-29 Cary Coutant <ccoutant@google.com>
2086
2087 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
2088
5dd8762a
CC
20892012-02-29 Cary Coutant <ccoutant@google.com>
2090
2091 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
2092 Call Object::decompressed_section_contents.
2093 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
2094 New dtor.
2095 (Sized_dwarf_line_info::buffer_start_): New data member.
2096 * merge.cc (Output_merge_data::do_add_input_section): Call
2097 Object::decompressed_section_contents.
2098 (Output_merge_string::do_add_input_section): Likewise.
2099 * object.cc (need_decompressed_section): New function.
2100 (build_compressed_section_map): Decompress sections needed later.
2101 (Sized_relobj_file::do_decompressed_section_contents): New function.
2102 (Sized_relobj_file::do_discard_decompressed_sections): New function.
2103 * object.h (Object::decompressed_section_contents): New function.
2104 (Object::discard_decompressed_sections): New function.
2105 (Object::do_decompressed_section_contents): New function.
2106 (Object::do_discard_decompressed_sections): New function.
2107 (Compressed_section_info): New type.
2108 (Compressed_section_map): Include decompressed section contents.
2109 (Sized_relobj_file::do_decompressed_section_contents): New function.
2110 (Sized_relobj_file::do_discard_decompressed_sections): New function.
2111
7b5de7ee
CC
21122012-02-16 Cary Coutant <ccoutant@google.com>
2113
2114 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
2115 * testsuite/Makefile.in: Regenerate.
2116
f9fa4a63
CC
21172012-02-14 Cary Coutant <ccoutant@google.com>
2118
2119 * options.cc (General_options::finalize): Disallow -pie and -static.
2120
2c175ebc
DK
21212012-02-03 Doug Kwan <dougkwan@google.com>
2122
2123 * arm.cc (Arm_relocate_functions::abs8,
2124 Arm_relocate_functions::abs16): Use
2125 Bits::has_signed_unsigned_overflow32.
2126 (Arm_relocate_functions::thm_abs8): Correct range of
2127 overflow check.
2128 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
2129 in assertions.
2130
90cff06f
DK
21312012-02-02 Doug Kwan <dougkwan@google.com>
2132
2133 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
2134 position independent outputs, not just shared objects.
2135
63887f3d
L
21362012-01-30 H.J. Lu <hongjiu.lu@intel.com>
2137
2138 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
2139 * configure: Regenerated.
2140
bef2b434
ILT
21412012-01-27 Ian Lance Taylor <iant@google.com>
2142
2143 * reloc.h (Bits): New class with static functions, copied from
2144 namespace utils in arm.cc.
2145 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
2146 instead.
2147
c335b55d
L
21482012-01-27 H.J. Lu <hongjiu.lu@intel.com>
2149
2150 * incremental.cc (write_info_blocks): Correct relocation offset.
2151
41194d9f
L
21522012-01-27 H.J. Lu <hongjiu.lu@intel.com>
2153
2154 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
2155 (Relocate::tls_gd_to_le): Likewise.
2156
1bae613c
L
21572012-01-27 H.J. Lu <hongjiu.lu@intel.com>
2158
2159 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
2160
24482ca0
L
21612012-01-27 H.J. Lu <hongjiu.lu@intel.com>
2162
2163 * configure.ac: Check if -mcmodel=medium works.
2164 * configure: Regenerated.
2165
c2c7840a
CC
21662012-01-24 Cary Coutant <ccoutant@google.com>
2167
2168 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
2169 definition and ...
2170 (read_unsigned_LEB_128_x): ... this new function.
2171 (read_signed_LEB_128): Replaced with inline definition and ...
2172 (read_signed_LEB_128_x): ... this new function.
2173 * int_encoding.h (read_unsigned_LEB_128_x): New function.
2174 (read_unsigned_LEB_128): Add inline definition.
2175 (read_signed_LEB_128_x): New function.
2176 (read_signed_LEB_128): Add inline definition.
2177 * testsuite/Makefile.am (leb128_unittest): New unit test.
2178 * testsuite/Makefile.in: Regenerate.
2179 * testsuite/leb128_unittest.cc: New unit test.
2180
833de760 21812012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
2182
2183 PR gold/13617
2184 * i386.cc (Target_i386::do_code_fill): When using a jmp
2185 instruction, pad with nop instructions.
2186 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
2187
618d6666
L
21882012-01-22 H.J. Lu <hongjiu.lu@intel.com>
2189
2190 * x86_64.cc (gc_process_relocs): Add typename on types used in
2191 template.
2192 (scan_relocs): Likewise.
2193 (relocate_section): Likewise.
2194 (apply_relocation): Likewise.
2195
3660ff06
L
21962012-01-10 H.J. Lu <hongjiu.lu@intel.com>
2197
2198 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
2199 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
2200 under x32.
2201
fc51264f
L
22022012-01-09 H.J. Lu <hongjiu.lu@intel.com>
2203
2204 * x86_64.cc: Initial support for x32.
2205
dd74ae06
CC
22062012-01-03 Cary Coutant <ccoutant@google.com>
2207
2208 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
2209 Use abstract base class for GOT.
2210 * gold/output.h (class Output_data_got_base): New abstract base class.
2211 (class Output_data_got): Derive from new base class, adjust ctors.
2212 (Output_data_got::reserve_slot): Make virtual; rename to
2213 do_reserve_slot; Adjust callers.
2214 * gold/target.h (Sized_target::init_got_plt_for_update): Return
2215 pointer to abstract base class.
2216 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
2217
83896202
ILT
22182011-12-18 Ian Lance Taylor <iant@google.com>
2219
2220 * object.h (Relobj::local_symbol_value): New function.
2221 (Relobj::local_plt_offset): New function.
2222 (Relobj::local_has_got_offset): New function.
2223 (Relobj::local_got_offset): New function.
2224 (Relobj::set_local_got_offset): New function.
2225 (Relobj::do_local_symbol_value): New pure virtual function.
2226 (Relobj::do_local_plt_offset): Likewise.
2227 (Relobj::do_local_has_got_offset): Likewise.
2228 (Relobj::do_local_got_offset): Likewise.
2229 (Relobj::do_set_local_got_offset): Likewise.
2230 (Sized_relobj::do_local_has_got_offset): Rename from
2231 local_has_got_offset.
2232 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
2233 (Sized_relobj::do_set_local_got_offset): Rename from
2234 set_local_got_offset.
2235 (Sized_relobj_file::do_local_plt_offset): Rename from
2236 local_plt_offset.
2237 (Sized_relobj_file::do_local_symbol_value): New function.
2238 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
2239 local_plt_offset.
2240 * output.cc (Output_data_got::Got_entry::write): Change object to
2241 Relobj. Use local_symbol_value.
2242 (Output_data_got::add_global_with_rel): Change rel_dyn to
2243 Output_data_reloc_generic*. Use add_global_generic.
2244 (Output_data_got::add_global_with_rela): Remove. Change all
2245 callers to use add_global_with_rel.
2246 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
2247 Output_data_reloc_generic*. Use add_global_generic.
2248 (Output_data_got::add_global_pair_with_rela): Remove. Change all
2249 callers to use add_global_pair_with_rel.
2250 (Output_data_got::add_local): Change object to Relobj*.
2251 (Output_data_got::add_local_plt): Likewise.
2252 (Output_data_got::add_local_with_rel): Change object to Relobj*,
2253 change rel_dyn to Output_data_reloc_generic*. Use
2254 add_local_generic.
2255 (Output_data_got::add_local_with_rela): Remove. Change all
2256 callers to use all_local_with_rel.
2257 (Output_data_got::add_local_pair_with_rel): Change object to
2258 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
2259 add_output_section_generic.
2260 (Output_data_got::add_local_pair_with_rela): Remove. Change all
2261 callers to use add_local_pair_with_rel.
2262 (Output_data_got::reserve_local): Change object to Relobj*.
2263 * output.h: (class Output_data_reloc_generic): Add pure virtual
2264 declarations for add_global_generic, add_local_generic,
2265 add_output_section_generic.
2266 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
2267 functions for Output_data_reloc_generic. Update declarations for
2268 changes listed in output.cc.
2269 (class Output_data_got): Change template parameter to got_size.
2270 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
2271 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
2272 function.
2273 (Sized_relobj_incr::do_local_plt_offset): New function.
2274 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
2275 add_global_generic.
2276
76677ad0
CC
22772011-12-17 Cary Coutant <ccoutant@google.com>
2278
2279 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
2280 * resolve.cc (Symbol_table::resolve): Likewise.
2281 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
2282 arrays.
2283 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
2284
8b8dd8d5
ILT
22852011-12-16 Ian Lance Taylor <iant@google.com>
2286
2287 * output.h (Output_data_reloc_generic::add): Only call
2288 add_dynamic_reloc if this is a dynamic reloc section.
2289
d55525b9
L
22902011-12-15 H.J. Lu <hongjiu.lu@intel.com>
2291
2292 PR gold/13505
2293 * target-reloc.h (apply_relocation): Replace <64, false> with
2294 <size, big_endian>.
2295
ff81c7c1
NC
22962011-11-25 Nick Clifton <nickc@redhat.com>
2297
2298 * po/it.po: New Italian translation.
2299
628f39be
SA
23002011-11-17 Sterling Augustine <saugustine@google.com>
2301
2302 * script.cc (script_include_directive): Implement.
2303 (read_script_file): New local variables name and search_path. Update
2304 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
2305 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
2306 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
2307
98ef3ea4
SA
23082011-11-11 Sterling Augustine <saugustine@google.com>
2309
2310 * yyscript.y (section_cmd): Add support for INCLUDE directive.
2311 (file_or_sections_cmd): Likewise.
2312
f4a8b6d7
DK
23132011-11-11 Doug Kwan <dougkwan@google.com>
2314
2315 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
2316 if --just-symbols is given.
2317
29ab395d
DK
23182011-11-10 Doug Kwan <dougkwan@google.com>
2319
2320 PR gold/13362
2321 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
2322 when processing data relocs.
2323 * reloc.h (Relocate_functions::rel_unaligned): New method.
2324 (Relocate_functions::pcrel_unaligned): Ditto.
2325 (Relocate_functions::rel32_unaligned): Ditto.
2326 (Relocate_functions::pcrel32_unaligned): Ditto.
2327
2c339f71
DK
23282011-11-09 Doug Kwan <dougkwan@google.com>
2329
2330 PR gold/13362
2331 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
2332 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
2333 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
2334 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
2335 (Relocate_functions::rel_unaligned): New.
2336 (Relocate_functions::rel32_unaligned): New.
2337 * target-reloc.h (relocate_for_relocatable): Add code to handle
2338 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
2339 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
2340 arm_unaligned_reloc_r): New targets.
2341 * testsuite/Makefile.in: Regenerate.
2342 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
2343 linking.
2344
3f3cddf1
ILT
23452011-11-02 Ian Lance Taylor <iant@google.com>
2346
2347 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
2348 NATIVE_LINKER.
2349 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
2350 * options.cc (General_options::finalize): Use library search path
2351 from configure script if specified. If not native and no sysroot,
2352 only search TOOLLIBDIR.
2353 * options.h (Search_directory::Search_directory): Change name to
2354 const std::string&.
2355 (General_options::add_to_library_path_with_sysroot): Change arg to
2356 const std::string&.
2357 * configure, Makefile.in, config.in: Rebuild.
2358
a8e2273b
ILT
23592011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
2360
2361 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
2362 we are working around the ARM1176 Erratum.
2363 * options.h (General_options::fix_arm1176): Add option.
2364 * testsuite/Makefile.am: Add testcases, and keep current ones
2365 working.
2366 * testsuite/Makefile.in: Regenerate.
2367 * testsuite/arm_fix_1176.s: New file.
2368 * testsuite/arm_fix_1176.sh: Likewise.
2369
cd6eab1c
ILT
23702011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
2371
2372 * arm.cc (Target_arm::Target_arm): Remove initialisation of
2373 may_use_blx_.
2374 (Target_arm::may_use_blx): Remove method.
2375 (Target_arm::set_may_use_blx): Likewise.
2376 (Target_arm::may_use_v4t_interworking): New method.
2377 (Target_arm::may_use_v5t_interworking): Likewise.
2378 (Target_arm::may_use_blx_): Remove member variable.
2379 (Arm_relocate_functions::arm_branch_common): Check for v5T
2380 interworking.
2381 (Arm_relocate_functions::thumb_branch_common): Likewise.
2382 (Reloc_stub::stub_type_for_reloc): Likewise.
2383 (Target_arm::do_finalize_sections): Correct interworking checks.
2384 * testsuite/Makefile.am: Add new tests.
2385 * testsuite/Makefile.in: Regenerate.
2386 * testsuite/arm_farcall_arm_arm.s: New test.
2387 * testsuite/arm_farcall_arm_arm.sh: Likewise.
2388 * testsuite/arm_farcall_arm_thumb.s: Likewise.
2389 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
2390 * testsuite/arm_farcall_thumb_arm.s: Likewise.
2391 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
2392 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
2393 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
2394
286adcf4
CC
23952011-10-31 Cary Coutant <ccoutant@google.com>
2396
2397 PR gold/13023
2398 * expression.cc (Expression::eval_with_dot): Add
2399 is_section_dot_assignment parameter.
2400 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
2401 absolute and assigning to dot within a section.
2402 * script-sections.cc
2403 (Output_section_element_assignment::set_section_addresses): Pass
2404 dot_section to set_if_absolute.
2405 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
2406 as is_section_dot_assignment flag to eval_with_dot.
2407 (Output_section_element_dot_assignment::set_section_addresses):
2408 Likewise.
2409 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
2410 parameter. Also set value if relative to dot_section; set the
2411 symbol's output_section.
2412 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
2413 parameter. Adjust all callers.
2414 (Expression::eval_maybe_dot): Likewise.
2415 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
2416 Adjust all callers.
2417 * testsuite/script_test_2.t: Test assignment of an absolute value
2418 to dot within an output section element.
2419
9634ed06
CC
24202011-10-31 Cary Coutant <ccoutant@google.com>
2421
2422 * options.h (class General_options): Add --[no-]gnu-unique options.
2423 * symtab.cc (Symbol_table::sized_write_globals): Convert
2424 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
2425
de4101c7
CC
24262011-10-31 Cary Coutant <ccoutant@google.com>
2427
2428 PR gold/13359
2429 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
2430 unnecessary assertion.
2431 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
2432
7257cc92
ST
24332011-10-31 Sriraman Tallam <tmsriram@google.com>
2434
2435 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
2436 gc_mark_symbol.
2437 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
2438 gc_mark_symbol.
2439 Change to just keep the section associated with symbol.
2440 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
2441 they are externally visible and --export-dynamic is turned on.
2442 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
2443
bfc34b3f
ILT
24442011-10-19 Ian Lance Taylor <iant@google.com>
2445
2446 PR gold/13163
2447 * script-sections.cc
2448 (Output_section_element_dot_assignment::needs_output_section): New
2449 function.
2450
ea0d8c47
ILT
24512011-10-19 Ian Lance Taylor <iant@google.com>
2452
2453 PR gold/13204
2454 * layout.cc (Layout::segment_precedes): Don't assert failure if a
2455 --section-start option was seen.
2456 * options.h (General_options::any_section_start): New function.
2457
abd242a9
DM
24582011-10-18 David S. Miller <davem@davemloft.net>
2459
2460 PR binutils/13301
2461 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
2462 member to track relocation locations that have moved during TLS
2463 reloc optimizations.
2464 (Target_sparc::Relocate::Relocate): Initialize to NULL.
2465 (Target_sparc::Relocate::relocate): Adjust view down by 4
2466 bytes if it matches reloc_adjust_addr_.
2467 (Target_sparc::Relocate::relocate_tls): Always move the
2468 __tls_get_addr call delay slot instruction forward 4 bytes when
2469 performing relaxation.
2470
bab9090f
CC
24712011-10-18 Cary Coutant <ccoutant@google.com>
2472
2473 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
2474 (Output_file::map_no_anonymous): Check for non-zero
2475 return code from posix_fallocate.
2476
f7c5b166
CC
24772011-10-17 Cary Coutant <ccoutant@google.com>
2478
2479 PR gold/13245
2480 * plugin.cc (is_visible_from_outside): Check for symbols
2481 referenced from dynamic objects.
2482 * resolve.cc (Symbol_table::resolve): Don't count references
2483 from dynamic objects as references from real ELF files.
2484 * testsuite/plugin_test_2.sh: Adjust expected result.
2485
b490c0bb
CC
24862011-10-17 Cary Coutant <ccoutant@google.com>
2487
2488 * gold.cc: Include timer.h.
2489 (queue_middle_tasks): Stamp time.
2490 (queue_final_tasks): Likewise.
2491 * main.cc (main): Store timer in parameters. Print timers
2492 for each pass.
2493 * parameters.cc (Parameters::Parameters): Initialize timer_.
2494 (Parameters::set_timer): New function.
2495 (set_parameters_timer): New function.
2496 * parameters.h (Parameters::set_timer): New function.
2497 (Parameters::timer): New function.
2498 (Parameters::timer_): New data member.
2499 (set_parameters_timer): New function.
2500 * timer.cc (Timer::stamp): New function.
2501 (Timer::get_pass_time): New function.
2502 * timer.h (Timer::stamp): New function.
2503 (Timer::get_pass_time): New function.
2504 (Timer::pass_times_): New data member.
2505
f475cf7b
CC
25062011-10-17 Cary Coutant <ccoutant@google.com>
2507
2508 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
2509 task for members of lib groups.
2510
cdd7e244
CC
25112011-10-17 Cary Coutant <ccoutant@google.com>
2512
2513 PR gold/13288
4f95c8b4 2514 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
2515 (File_read::make_view): Move bounds check (replace with assert)...
2516 (File_read::find_or_make_view): ... to here.
2517
dfb45471
CC
25182011-10-12 Cary Coutant <ccoutant@google.com>
2519
4f95c8b4 2520 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
2521 ::read returns less than requested size.
2522
53bbcc1b
CC
25232011-10-10 Cary Coutant <ccoutant@google.com>
2524
4f95c8b4 2525 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
2526 Initialize defined_count_.
2527 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
2528 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
2529 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
2530 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
2531 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 2532 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
2533 member.
2534 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 2535 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
2536 Return zeroes instead of internal error.
2537
397b129b
CC
25382011-10-10 Cary Coutant <ccoutant@google.com>
2539
2540 PR gold/13249
4f95c8b4 2541 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 2542 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 2543 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
2544 (Output_reloc::type_): Adjust size of bit field.
2545 (Output_reloc::use_plt_offset_): New bit field.
2546 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
2547 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
2548 flag. Adjust all callers.
4f95c8b4 2549 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
2550 creating RELATIVE relocations.
2551
d5698657
NC
25522011-10-10 Nick Clifton <nickc@redhat.com>
2553
2554 * po/es.po: Updated Spanish translation.
2555 * po/fi.po: Updated Finnish translation.
2556
6a59a5c2
DN
25572011-10-03 Diego Novillo <dnovillo@google.com>
2558
2559 * options.cc (parse_uint): Fix dereference of RETVAL.
2560
f0558624
ST
25612011-09-29 Sriraman Tallam <tmsriram@google.com>
2562
2563 * layout.h (section_order_map_): New member.
2564 (get_section_order_map): New member function.
2565 * output.cc (Output_section::add_input_section): Check for patterns
2566 only when --section-ordering-file is specified.
2567 * gold.cc (queue_middle_tasks): Delay updating order of sections till
2568 output_sections have been formed.
2569 * layout.cc (Layout_Layout): Initialize section_order_map_.
2570 * plugin.cc (update_section_order): Store order in order_map. Do not
2571 update the order.
2572 * testsuite/Makefile.am: Add test case for plugin_final_layout.
2573 * testsuite/Makefile.in: Regenerate.
2574 * testsuite/plugin_section_order.c: New file.
2575 * testsuite/plugin_final_layout.cc: New file.
2576 * testsuite/plugin_final_layout.sh: New file.
2577
a7dac153
CC
25782011-09-29 Cary Coutant <ccoutant@google.com>
2579
4f95c8b4 2580 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 2581 Check for NULL.
4f95c8b4 2582 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
2583 symbols during incremental update.
2584 (Symbol_table::add_from_dynobj): Likewise.
2585
eebd87a5
ILT
25862011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2587 Ian Lance Taylor <iant@google.com>
2588
2589 * symtab.cc (Symbol_table::define_special_symbol): Always
2590 canonicalize version string.
2591
403a3331
CC
25922011-09-26 Cary Coutant <ccoutant@google.com>
2593
4f95c8b4
CC
2594 * gold.cc (queue_initial_tasks): Move option checks ...
2595 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
2596 some options; make others fatal.
2597
235061c2
CC
25982011-09-26 Cary Coutant <ccoutant@google.com>
2599
2600 gcc PR lto/47247
2601 * plugin.cc (get_symbols_v2): New function.
2602 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
2603 (is_referenced_from_outside): New function.
2604 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
2605 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
2606 (get_symbols): Pass version parameter.
2607 (get_symbols_v2): New function.
2608 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
2609 parameter.
2610 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
2611 (onload): Add LDPT_GET_SYMBOLS_V2.
2612 (all_symbols_read_hook): Use get_symbols_v2; check for
2613 LDPR_PREVAILING_DEF_IRONLY_EXP.
2614 * testsuite/plugin_test_3.sh: Update expected results.
2615
dc87f620
ILT
26162011-09-23 Simon Baldwin <simonb@google.com>
2617
2618 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
2619 configuration options.
2620 * configure: Regenerate.
2621 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
2622 * Makefile.in: Regenerate.
2623 * testsuite/Makefile.in: Regenerate.
2624
a8279f82
ST
26252011-09-19 Sriraman Tallam <tmsriram@google.com>
2626
2627 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
2628
0c9350c8
CC
26292011-09-19 Cary Coutant <ccoutant@google.com>
2630
2631 * incremental.cc (can_incremental_update): Fix typo in comment.
2632 * incremental.h (can_incremental_update): Likewise.
2633
aa06ae28
CC
26342011-09-18 Cary Coutant <ccoutant@google.com>
2635
2636 * incremental.cc (can_incremental_update): New function.
2637 * incremental.h (can_incremental_update): New function.
2638 * layout.cc (Layout::init_fixed_output_section): Call it.
2639 (Layout::make_output_section): Don't allow patch space in .eh_frame.
2640 * object.cc (Sized_relobj_file::do_layout): Call
2641 can_incremental_update.
2642
ebb300b2
CC
26432011-09-13 Cary Coutant <ccoutant@google.com>
2644
2645 * configure.ac: Check for glibc support for gnu_indirect_function
2646 support with static linking, setting automake conditional
2647 IFUNC_STATIC.
2648 * Makefile.in: Regenerate.
2649 * configure: Regenerate.
2650
2651 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
2652 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
2653 for IFUNC_STATIC.
2654 * testsuite/Makefile.in: Regenerate.
2655
1206d0d5
CC
26562011-09-13 Cary Coutant <ccoutant@google.com>
2657
2658 * incremental.cc (Sized_relobj_incr::do_layout): Call
2659 report_comdat_group for kept comdat sections.
2660 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
2661 * testsuite/Makefile.in: Regenerate.
2662 * testsuite/incr_comdat_test_1.cc: New source file.
2663 * testsuite/incr_comdat_test_2_v1.cc: New source file.
2664 * testsuite/incr_comdat_test_2_v2.cc: New source file.
2665 * testsuite/incr_comdat_test_2_v3.cc: New source file.
2666
40b29874
ILT
26672011-09-13 Ian Lance Taylor <iant@google.com>
2668
2669 * object.cc (Sized_relobj_file::do_layout): Remove unused local
2670 variable external_symbols_offset.
2671
1b045aac
ILT
26722011-09-12 Ian Lance Taylor <iant@google.com>
2673
2674 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
2675 triggered if object has no symbols.
2676
24c6c55a
DM
26772011-09-09 David S. Miller <davem@davemloft.net>
2678
2679 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
2680 (Output_fill_debug_line::do_write): Likewise.
2681
66570254
CC
26822011-08-29 Cary Coutant <ccoutant@google.com>
2683
2684 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
2685 casts to match formatting specs.
2686 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
2687
8ea8cd50
CC
26882011-08-26 Cary Coutant <ccoutant@google.com>
2689
2690 * layout.cc (Free_list::allocate): Provide guarantee of minimum
2691 remaining hole size when allocating.
2692 (Layout::make_output_section): Set fill methods for debug sections.
2693 * layout.h (Free_list::Free_list_node): Move from private to
2694 public.
2695 (Free_list::set_min_hole_size): New function.
2696 (Free_list::begin, Free_list::end): New functions.
2697 (Free_list::min_hole_): New data member.
2698 * output.cc: Include dwarf.h.
2699 (Output_fill_debug_info::do_minimum_hole_size): New function.
2700 (Output_fill_debug_info::do_write): New function.
2701 (Output_fill_debug_line::do_minimum_hole_size): New function.
2702 (Output_fill_debug_line::do_write): New function.
2703 (Output_section::Output_section): Initialize new data member.
2704 (Output_section::set_final_data_size): Ensure patch space is larger
2705 than minimum hole size.
2706 (Output_section::do_write): Fill holes in debug sections.
2707 * output.h (Output_fill): New class.
2708 (Output_fill_debug_info): New class.
2709 (Output_fill_debug_line): New class.
2710 (Output_section::set_free_space_fill): New function.
2711 (Output_section::free_space_fill_): New data member.
2712 * testsuite/Makefile.am (incremental_test_3): Add
2713 --incremental-patch option.
2714 (incremental_test_4): Likewise.
2715 (incremental_test_5): Likewise.
2716 (incremental_test_6): Likewise.
2717 (incremental_copy_test): Likewise.
2718 (incremental_common_test_1): Likewise.
2719 * testsuite/Makefile.in: Regenerate.
2720
7cf80422
NC
27212011-08-26 Nick Clifton <nickc@redhat.com>
2722
2723 * po/es.po: Updated Spanish translation.
2724
c3f7b0e5
CC
27252011-08-01 Cary Coutant <ccoutant@google.com>
2726
2727 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
2728 * gold/testsuite/Makefile.in: Regenerate.
2729 * gold/testsuite/justsyms_exec.c: New source file.
2730 * gold/testsuite/justsyms_lib.c: New source file.
2731
9590bf25
CC
27322011-08-01 Cary Coutant <ccoutant@google.com>
2733
2734 * layout.cc (Layout::set_segment_offsets): Don't realign text
2735 segment if -Ttext was specified.
2736 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
2737 file type.
2738 * object.h (Sized_relobj_file::e_type): New function.
2739 (Sized_relobj_file::e_type_): New data member.
2740 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
2741 base address for ET_EXEC files.
2742 * target.cc (Target::do_make_elf_object_implementation): Allow
2743 ET_EXEC files with --just-symbols option.
2744
dcd8d12e
CC
27452011-07-28 Cary Coutant <ccoutant@google.com>
2746
2747 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
2748 Add thread_number parameter.
2749 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
2750 * workqueue-threads.cc
2751 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
2752 current thread if its thread number is greater than desired thread
2753 count.
2754 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
2755 Add thread_number parameter.
2756 (Workqueue::should_cancel_thread): Likewise.
2757 (Workqueue::find_runnable_or_wait): Pass thread_number to
2758 should_cancel_thread.
2759 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
2760 parameter.
2761
804eb480
ST
27622011-07-22 Sriraman Tallam <tmsriram@google.com>
2763
2764 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
2765 only after checking if it cannot be forced local.
2766 * symtab.h (is_externally_visible): Check if the symbol is not forced
2767 local.
2768
f1ddb600
ILT
27692011-07-15 Ian Lance Taylor <iant@google.com>
2770
2771 * options.h (class General_options): Add --print-output-format.
2772 Move -EL next to -EB, for better --help output.
2773 * target-select.cc: Include <cstdio>, "options.h", and
2774 "parameters.h".
2775 (Target_selector::do_target_bfd_name): New function.
2776 (print_output_format): New function.
2777 * target-select.h (class Target_selector): Update declarations.
2778 (Target_selector::target_bfd_name): New function.
2779 (print_output_format): Declare.
2780 * main.cc: Include "target-select.h".
2781 (main): Handle --print-output-format.
2782 * gold.cc: Include "target-select.h".
2783 (queue_initial_tasks): Handle --print-output-format when there are
2784 no input files.
2785 * parameters.cc (parameters_force_valid_target): Give a better
2786 error message if -EB/-EL does not match target.
2787 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
2788 function.
2789
7d172687
ILT
27902011-07-15 Ian Lance Taylor <iant@google.com>
2791
2792 * i386.cc (class Output_data_plt_i386): Add layout_ field.
2793 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
2794 (Output_data_plt_i386::do_write): Write address of .dynamic
2795 section to first entry in .got.plt section.
2796 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
2797 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
2798 Initialize layout_.
2799 (Output_data_plt_x86_64::do_write): Write address of .dynamic
2800 section to first entry in .got.plt section.
2801 * layout.h (Layout::dynamic_section): New function.
2802
e9552f7e
ST
28032011-07-13 Sriraman Tallam <tmsriram@google.com>
2804
2805 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
2806 to claim_file call.
2807 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
2808 input_section_position_, and input_section_glob_.
2809 (read_layout_from_file): Call function section_ordering_specified.
2810 * layout.h (is_section_ordering_specified): New function.
2811 (section_ordering_specified): New function.
2812 (section_ordering_specified_): New boolean member.
2813 * main.cc(main): Call load_plugins after layout object is defined.
2814 * output.cc (Output_section::add_input_section): Use
2815 function section_ordering_specified to check if section ordering is
2816 needed.
2817 * output.cc (Output_section::add_relaxed_input_section): Use
2818 function section_ordering_specified to check if section ordering is
2819 needed.
2820 (Output_section::update_section_layout): New function.
2821 (Output_section::sort_attached_input_sections): Check if input section
2822 must be reordered.
2823 * output.h (Output_section::update_section_layout): New function.
2824 * plugin.cc (get_section_count): New function.
2825 (get_section_type): New function.
2826 (get_section_name): New function.
2827 (get_section_contents): New function.
2828 (update_section_order): New function.
58797674 2829 (allow_section_ordering): New function.
e9552f7e
ST
2830 (Plugin::load): Add the new interfaces to the transfer vector.
2831 (Plugin_manager::load_plugins): New parameter.
2832 (Plugin_manager::all_symbols_read): New parameter.
2833 (Plugin_manager::claim_file): New parameter. Save the elf object for
2834 unclaimed objects.
2835 (Plugin_manager::get_elf_object): New function.
2836 (Plugin_manager::get_view): Change to directly use the bool to check
2837 if get_view is called from claim_file_hook.
2838 * plugin.h (input_objects): New function
2839 (Plugin__manager::load_plugins): New parameter.
2840 (Plugin_manager::claim_file): New parameter.
2841 (Plugin_manager::get_elf_object): New function.
2842 (Plugin_manager::in_claim_file_handler): New function.
2843 (Plugin_manager::in_claim_file_handler_): New member.
2844 (layout): New function.
2845 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
2846 handler with an extra parameter. Make the elf object before calling
2847 claim_file handler.
2848 * testsuite/plugin_test.c (get_section_count): New function pointer.
2849 (get_section_type): New function pointer.
2850 (get_section_name): New function pointer.
2851 (get_section_contents): New function pointer.
2852 (update_section_order): New function pointer.
2853 (allow_section_ordering): New function pointer.
2854 (onload): Check if the new interfaces exist.
2855
9446efde
ILT
28562011-07-13 Ian Lance Taylor <iant@google.com>
2857
2858 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
2859 relro section.
2860 * x86_64.cc (Target_x86_64::got_section): Likewise.
2861 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
2862 (relro_now_test_SOURCES): New variable.
2863 (relro_now_test_DEPENDENCIES): New variable.
2864 (relro_now_test_LDFLAGS): New variable.
2865 (relro_now_test_LDADD): New variable.
2866 (relro_now_test.so): New target.
2867 * testsuite/Makefile.in: Rebuild.
2868
07aa62f2
ILT
28692011-07-12 Ian Lance Taylor <iant@google.com>
2870
2871 PR gold/12980
2872 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
2873 GLOB_DAT relocation rather than a RELATIVE relocation for a
2874 protected symbol when creating a shared library.
2875 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
2876 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
2877 * testsuite/protected_main_1.cc (main): Test that protected
2878 function has same address.
2879
e2153196
ILT
28802011-07-11 Ian Lance Taylor <iant@google.com>
2881
2882 PR gold/12979
2883 * options.h (class General_options): Add -Bgroup.
2884 * options.cc (General_options::finalize): If -Bgroup is set,
2885 default to --unresolved-symbols=report-all.
2886 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
2887 * target-reloc.h (issue_undefined_symbol_error): Handle
2888 --unresolved-symbols=report-all.
2889
6daf5215
ILT
28902011-07-08 Ian Lance Taylor <iant@google.com>
2891
2892 PR gold/11985
2893 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
2894 if linker script discards key sections.
2895 (Layout::create_dynamic_symtab): Likewise.
2896 (Layout::assign_local_dynsym_offsets): Likewise.
2897 (Layout::sized_create_version_sections): Likewise.
2898 (Layout::create_interp): Likewise.
2899 (Layout::finish_dynamic_section): Likewise.
2900 (Layout::set_dynamic_symbol_size): Likewise.
2901
beabb2c6
ILT
29022011-07-08 Ian Lance Taylor <iant@google.com>
2903
2904 PR gold/12386
2905 * options.h (class General_options): Add --unresolved-symbols.
2906 * target-reloc.h (issue_undefined_symbol_error): Check
2907 --unresolved-symbols. Add comments.
2908
9c16daf1
ILT
29092011-07-08 Ian Lance Taylor <iant@google.com>
2910
2911 * testsuite/odr_violation2.cc (Ordering::operator()): Make
2912 expression more complex.
2913
191f1a2d
ILT
29142011-07-08 Ian Lance Taylor <iant@google.com>
2915
2916 PR gold/11317
2917 * target-reloc.h (issue_undefined_symbol_error): New inline
2918 function, broken out of relocate_section.
2919 (relocate_section): Call issue_undefined_symbol_error.
2920 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
2921 there is no TLS segment if we are about to issue an undefined
2922 symbol error.
2923 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
2924
62855347
ILT
29252011-07-08 Ian Lance Taylor <iant@google.com>
2926
2927 PR gold/12279
2928 * resolve.cc (Symbol_table::should_override): Add fromtype
2929 parameter. Change all callers. Give error when linking together
2930 TLS and non-TLS symbol.
2931 (Symbol_table::should_override_with_special): Add fromtype
2932 parameter. Change all callers.
2933 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
2934 there is no TLS segment if we have reported some errors.
2935 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
2936
67181c72
ILT
29372011-07-08 Ian Lance Taylor <iant@google.com>
2938
2939 PR gold/12372
2940 * target.h (Target::plt_address_for_global): New function.
2941 (Target::plt_address_for_local): New function.
2942 (Target::plt_section_for_global): Remove.
2943 (Target::plt_section_for_local): Remove.
2944 (Target::do_plt_address_for_global): New virtual function.
2945 (Target::do_plt_address_for_local): New virtual function.
2946 (Target::do_plt_section_for_global): Remove.
2947 (Target::do_plt_section_for_local): Remove.
2948 (Target::register_global_plt_entry): Add Symbol_table and Layout
2949 parameters.
2950 * output.cc (Output_data_got::Got_entry::write): Use
2951 plt_address_for_global and plt_address_for_local.
2952 * layout.cc (Layout::add_target_dynamic_tags): Use size and
2953 address of output section.
2954 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
2955 got_irelative_, and irelative_count_ fields. Update
2956 declarations.
2957 (Output_data_plt_i386::has_irelative_section): New function.
2958 (Output_data_plt_i386::entry_count): Add irelative_count_.
2959 (Output_data_plt_i386::set_final_data_size): Likewise.
2960 (class Target_i386): Add got_irelative_ and rel_irelative_
2961 fields. Update declarations.
2962 (Target_i386::Target_i386): Initialize new fields.
2963 (Target_i386::do_plt_address_for_global): New function replacing
2964 do_plt_section_for_global.
2965 (Target_i386::do_plt_address_for_local): New function replacing
2966 do_plt_section_for_local.
2967 (Target_i386::got_section): Create got_irelative_.
2968 (Target_i386::rel_irelative_section): New function.
2969 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
2970 fields. Don't define __rel_iplt_{start,end}.
2971 (Output_data_plt_i386::add_entry): Add symtab and layout
2972 parameters. Change all callers. Use different PLT and GOT for
2973 IFUNC symbols.
2974 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
2975 layout parameters. Change all callers. Use different PLT and
2976 GOT.
2977 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
2978 (Output_data_plt_i386::rel_irelative): New function.
2979 (Output_data_plt_i386::address_for_global): New function.
2980 (Output_data_plt_i386::address_for_local): New function.
2981 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
2982 IRELATIVE GOT when changing IFUNC GOT entries.
2983 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
2984 reloc.
2985 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
2986 if we didn't create an IRELATIVE GOT.
2987 (Target_i386::Relocate::relocate): Use plt_address_for_global and
2988 plt_address_for_local.
2989 (Target_i386::do_dynsym_value): Use plt_address_for_global.
2990 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
2991 got_irelative_, and irelative_count_ fields. Update
2992 declarations.
2993 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
2994 Initialize new fields. Remove symtab parameter. Change all
2995 callers.
2996 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
2997 irelative_count_.
2998 (Output_data_plt_x86_64::has_irelative_section): New function.
2999 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
3000 (class Target_x86_64): Add got_irelative_ and rel_irelative_
3001 fields. Update declarations.
3002 (Target_x86_64::Target_x86_64): Initialize new fields.
3003 (Target_x86_64::do_plt_address_for_global): New function replacing
3004 do_plt_section_for_global.
3005 (Target_x86_64::do_plt_address_for_local): New function replacing
3006 do_plt_section_for_local.
3007 (Target_x86_64::got_section): Create got_irelative_.
3008 (Target_x86_64::rela_irelative_section): New function.
3009 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
3010 all callers. Don't create __rel_iplt_{start,end}.
3011 (Output_data_plt_x86_64::add_entry): Add symtab and layout
3012 parameters. Change all callers. Use different PLT and GOT for
3013 IFUNC symbols.
3014 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
3015 layout parameters. Change all callers. Use different PLT and
3016 GOT.
3017 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
3018 parameters. Change all callers. Use different PLT and GOT for
3019 IFUNC symbols.
3020 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
3021 (Output_data_plt_x86_64::rela_irelative): New function.
3022 (Output_data_plt_x86_64::address_for_global): New function.
3023 (Output_data_plt_x86_64::address_for_local): New function.
3024 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3025 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
3026 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
3027 (Target_x86_64::register_global_plt_entry): Add symtab and layout
3028 parameters.
3029 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
3030 reloc.
3031 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
3032 symbols if we didn't create an IRELATIVE GOT.
3033 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
3034 plt_address_for_local.
3035 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
3036 * testsuite/ifuncvar1.c: New test file.
3037 * testsuite/ifuncvar2.c: New test file.
3038 * testsuite/ifuncvar3.c: New test file.
3039 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
3040 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
3041 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
3042 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
3043 * testsuite/Makefile.in: Rebuild.
3044
33c15b45
CC
30452011-07-07 Cary Coutant <ccoutant@google.com>
3046
3047 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
3048 (two_file_test_1_ndebug.o): Likewise.
3049 (two_file_test_1b_ndebug.o): Likewise.
3050 (two_file_test_2_ndebug.o): Likewise.
3051 (two_file_test_main_ndebug.o): Likewise.
3052 (incremental_test_2): Link with no-debug versions.
3053
f48b5fb7
CC
30542011-07-06 Cary Coutant <ccoutant@google.com>
3055
3056 * gold/incremental.cc
3057 (Output_section_incremental_inputs::write_info_blocks): Check for
3058 hidden and internal symbols.
3059
221597a5
CC
30602011-07-06 Cary Coutant <ccoutant@google.com>
3061
3062 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
3063 Check disposition for startup file.
3064 (Incremental_inputs::report_command_line): Ignore
3065 --incremental-startup-unchanged option.
3066 * options.cc (General_options::parse_incremental_startup_unchanged):
3067 New function.
3068 (General_options::General_options): Initialize new data member.
3069 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
3070 (General_options): Add --incremental-startup-unchanged option.
3071 (General_options::incremental_startup_disposition): New function.
3072 (General_options::incremental_startup_disposition_): New data member.
3073
e24719f6
CC
30742011-07-06 Cary Coutant <ccoutant@google.com>
3075
3076 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
3077 input file index to Script_info ctor.
3078 (Sized_incremental_binary::do_file_has_changed): Find the
3079 command-line argument for files named in scripts.
3080 * incremental.h (Script_info::Script_info): New ctor
3081 with input file index.
3082 (Script_info::input_file_index): New function.
3083 (Script_info::input_file_index_): New data member.
3084 (Incremental_binary::get_library): Add const.
3085 (Incremental_binary::get_script_info): Add const.
3086 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
3087 * testsuite/Makefile.am (incremental_test_5): New test case.
3088 (incremental_test_6): New test case.
3089 * testsuite/Makefile.in: Regenerate.
3090
8f7c81e8
CC
30912011-07-06 Cary Coutant <ccoutant@google.com>
3092
3093 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
3094 debug output when command lines differ.
3095
9fbd3822
CC
30962011-07-06 Cary Coutant <ccoutant@google.com>
3097
3098 * incremental.cc (Incremental_inputs::report_command_line): Ignore
3099 --incremental-patch option.
3100 * layout.cc (Free_list::allocate): Extend allocation beyond original
3101 end if enabled.
3102 (Layout::make_output_section): Mark sections that should get
3103 patch space.
3104 * options.cc (parse_percent): New function.
3105 * options.h (parse_percent): New function.
3106 (DEFINE_percent): New macro.
3107 (General_options): Add --incremental-patch option.
3108 * output.cc (Output_section::Output_section): Initialize new data
3109 members.
3110 (Output_section::add_input_section): Print section name when out
3111 of patch space.
3112 (Output_section::add_output_section_data): Likewise.
3113 (Output_section::set_final_data_size): Add patch space when
3114 doing --incremental-full.
3115 (Output_section::do_reset_address_and_file_offset): Remove patch
3116 space.
3117 (Output_segment::set_section_list_addresses): Print debug output
3118 only if --incremental-update.
3119 * output.h (Output_section::set_is_patch_space_allowed): New function.
3120 (Output_section::is_patch_space_allowed_): New data member.
3121 (Output_section::patch_space_): New data member.
3122 * parameters.cc (Parameters::incremental_full): New function.
3123 * parameters.h (Parameters::incremental_full): New function
3124 * testsuite/Makefile.am (incremental_test_2): Add test for
3125 --incremental-patch option.
3126 * testsuite/Makefile.in: Regenerate.
3127 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
3128 (t18): Remove function body.
3129
f6cccc2c
DK
31302011-07-05 Doug Kwan <dougkwan@google.com>
3131
3132 PR gold/12771
3133 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
3134 Arm_Address type for relocation result.
3135 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
3136 overflow check.
3137 (Arm_relocate_functions::abs32): Use unaligned access.
3138 (Arm_relocate_functions::rel32): Ditto.
3139 (Arm_relocate_functions::prel31): Ditto.
3140 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
3141 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
3142 static data relocations.
3143 * testsuite/Makefile.in: Regnerate.
3144 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
3145
28a13fec
ILT
31462011-07-05 Ian Lance Taylor <iant@google.com>
3147
3148 PR gold/12392
3149 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
3150 symbols if necessary.
3151 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
3152
24d47b34
ILT
31532011-07-05 Ian Lance Taylor <iant@google.com>
3154
3155 PR gold/12952
3156 * resolve.cc (Symbol::override_base_with_special): Simply override
3157 version with special symbol version, ignoring previous version.
3158
41f9cbbe
ILT
31592011-07-05 Ian Lance Taylor <iant@google.com>
3160
3161 * object.cc (Sized_relobj_file::include_section_group): Add
3162 information to comment about signature location.
3163
886288f1
ILT
31642011-07-02 Ian Lance Taylor <iant@google.com>
3165
3166 PR gold/12957
3167 * options.h (class General_options): Add -f and -F.
3168 * options.cc (General_options::finalize): Fatal error if -f/-F
3169 are used without -shared.
3170 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
3171
ae3a6d4f
ILT
31722011-07-02 Ian Lance Taylor <iant@google.com>
3173
3174 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
3175
21131061
ILT
31762011-07-01 Ian Lance Taylor <iant@google.com>
3177
3178 PR gold/12525
3179 PR gold/12952
3180 * resolve.cc (Symbol::override_base_with_special): Don't override
3181 the version if the overriding symbol has a different name.
3182 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
3183 all callers. If we give an error about an undefined version,
3184 define the base version if necessary.
3185 * dynobj.h (class Versions): Update declaration.
3186 * testsuite/weak_alias_test_5.cc: New file.
3187 * testsuite/weak_alias_test.script: New file.
3188 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
3189 and versioned_alias have the right value, and call t2.
3190 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
3191 weak_alias_test_5.so.
3192 (weak_alias_test_LDADD): Likewise.
3193 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
3194 * testsuite/Makefile.in: Rebuild.
3195
611062c0
ILT
31962011-07-01 Ian Lance Taylor <iant@google.com>
3197
3198 PR gold/12525
3199 * options.h (class General_options): Support -z notext.
3200 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
3201 -Wl,-z,notext.
3202 (two_file_shared_nonpic.so): Likewise.
3203 (two_file_shared_mixed.so): Likewise.
3204 (two_file_shared_mixed_1.so): Likewise.
3205 (weak_undef_lib_nonpic.so): Likewise.
3206 (alt/weak_undef_lib_nonpic.so): Likewise.
3207 (tls_test_shared_nonpic.so): Likewise.
3208 * testsuite/Makefile.in: Rebuild.
3209
328c7c2f
ILT
32102011-07-01 Ian Lance Taylor <iant@google.com>
3211
3212 PR gold/12525
3213 * configure.ac: Test whether static linking works, setting
3214 the automake conditional HAVE_STATIC.
3215 * testsuite/Makefile.am: Disable tests using -static if
3216 HAVE_STATIC is not true.
3217 * configure, testsuite/Makefile.in: Rebuild.
3218
02d7cd44
ILT
32192011-07-01 Ian Lance Taylor <iant@google.com>
3220
3221 PR gold/12525
3222 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
3223 Assert if we see DW_EH_PE_indirect.
3224 * target.h (Target::ehframe_datarel_base): New function.
3225 (Target::do_ehframe_datarel_base): New target function.
3226 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
3227 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
3228 function.
3229
07a60597
ILT
32302011-07-01 Ian Lance Taylor <iant@google.com>
3231
3232 PR gold/12571
3233 * options.h (class General_options): Add
3234 --ld-generated-unwind-info.
3235 * ehframe.cc (Fde::write): Add address parameter. Change all
3236 callers. If associated with PLT, fill in address and size.
3237 (Cie::set_output_offset): Only add merge mapping if there is an
3238 object.
3239 (Cie::write): Add address parameter. Change all callers.
3240 (Eh_frame::add_ehframe_for_plt): New function.
3241 * ehframe.h (class Fde): Update declarations. Move shndx_ and
3242 input_offset_ fields into union u_, with new plt field.
3243 (Fde::Fde): Adjust for new union field.
3244 (Fde::Fde) [Output_data version]: New constructor.
3245 (Fde::add_mapping): Only add merge mapping if there is an object.
3246 (class Cie): Update declarations.
3247 (class Eh_frame): Declare add_ehframe_for_plt.
3248 * layout.cc (Layout::layout_eh_frame): Break out code into
3249 make_eh_frame_section, and call it.
3250 (Layout::make_eh_frame_section): New function.
3251 (Layout::add_eh_frame_for_plt): New function.
3252 * layout.h (class Layout): Update declarations.
3253 * merge.cc (Merge_map::add_mapping): Add assertion.
3254 * i386.cc: Include "dwarf.h".
3255 (class Output_data_plt_i386): Make first_plt_entry,
3256 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
3257 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
3258 and plt_eh_frame_fde.
3259 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
3260 boundary. Call add_eh_frame_for_plt if appropriate.
3261 * x86_64.cc: Include "dwarf.h".
3262 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
3263 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
3264 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
3265 and plt_eh_frame_fde.
3266 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
3267 appropriate.
3268
14788a3f
ILT
32692011-06-29 Ian Lance Taylor <iant@google.com>
3270
3271 PR gold/12629
3272 * object.cc (Sized_relobj_file::layout_section): Change shdr
3273 parameter to be const.
3274 (Sized_relobj_file::layout_eh_frame_section): New function, broken
3275 out of do_layout.
3276 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
3277 appropriate. Call layout_eh_frame_section.
3278 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
3279 sections.
3280 * object.h (class Sized_relobj_file): Update declarations.
3281
6c21fce1
ILT
32822011-06-29 Ian Lance Taylor <iant@google.com>
3283
37e41b03 3284 PR gold/12652
6c21fce1
ILT
3285 * script.cc (Token::integer_value): Accept trailing M/m/K/k
3286 modifier.
3287 (Lex::gather_token): Accept trailing M/m/K/k for integers.
3288
4d5e4e62
ILT
32892011-06-29 Ian Lance Taylor <iant@google.com>
3290
3291 PR gold/12675
3292 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
3293 SHT_X86_64_UNWIND.
3294 * layout.cc (Layout::layout_eh_frame): Likewise.
3295
886f533a
ILT
32962011-06-29 Ian Lance Taylor <iant@google.com>
3297
3298 PR gold/12695
3299 * layout.cc (Layout::symtab_section_shndx): New function.
3300 * layout.h (class Layout): Declare symtab_section_shndx.
3301 * output.cc (Output_section::write_header): Call it.
3302
f3ae1b28
ILT
33032011-06-29 Ian Lance Taylor <iant@google.com>
3304
3305 PR gold/12818
3306 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
3307 symbols which are not used in a relocation.
3308
aecf301f
ILT
33092011-06-28 Ian Lance Taylor <iant@google.com>
3310
3311 PR gold/12898
3312 * layout.cc (Layout::segment_precedes): Don't crash if a linker
3313 script create indistinguishable segments.
3314 (Layout::set_segment_offsets): Use stable_sort when sorting
3315 segments. Pass this to Compare_segments constructor.
3316 * layout.h (class Layout): Make segment_precedes non-static.
3317 (class Compare_segments): Change from struct to class. Add
3318 layout_ field. Add constructor.
3319 * script-sections.cc
3320 (Script_sections::attach_sections_using_phdrs_clause): Rename
3321 local orphan to is_orphan. Don't report failure to put empty
3322 section in segment. On attachment failure, report name of
3323 section, and attach to first PT_LOAD segment.
3324
03ef7571
ILT
33252011-06-28 Ian Lance Taylor <iant@google.com>
3326
3327 PR gold/12934
3328 * target-select.cc (Target_selector::Target_selector): Add
3329 emulation parameter. Change all callers.
3330 (select_target_by_bfd_name): Rename from select_target_by_name.
3331 Change all callers.
3332 (select_target_by_emulation): New function.
3333 (supported_emulation_names): New function.
3334 * target-select.h (class Target_selector): Add emulation_ field.
3335 Update declarations.
3336 (Target_selector::recognize_by_bfd_name): Rename from
3337 recognize_by_name. Change all callers.
3338 (Target_selector::supported_bfd_names): Rename from
3339 supported_names. Change all callers.
3340 (Target_selector::recognize_by_emulation): New function.
3341 (Target_selector::supported_emulations): New function.
3342 (Target_selector::emulation): New function.
3343 (Target_selector::do_recognize_by_bfd_name): Rename from
3344 do_recognize_by_name. Change all callers.
3345 (Target_selector::do_supported_bfd_names): Rename from
3346 do_supported_names. Change all callers.
3347 (Target_selector::do_recognize_by_emulation): New function.
3348 (Target_selector::do_supported_emulations): New function.
3349 (select_target_by_bfd_name): Change name in declaration.
3350 (select_target_by_emulation): Declare.
3351 (supported_emulation_names): Declare.
3352 * parameters.cc (parameters_force_valid_target): Try to find
3353 target based on emulation from -m option.
3354 * options.h (class General_options): Change doc string for -m.
3355 * options.cc (help): Print emulations.
3356 (General_options::parse_V): Likewise.
3357 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
3358 Add emulation parameter. Change all callers.
3359
200b2bb9
ILT
33602011-06-28 Ian Lance Taylor <iant@google.com>
3361
3362 * target.h (class Target): Add osabi_ field.
3363 (Target::osabi): New function.
3364 (Target::set_osabi): New function.
3365 (Target::Target): Initialize osabi_.
3366 (Target::do_adjust_elf_header): Make pure virtual.
3367 (Sized_target::do_adjust_elf_header): Declare.
3368 * target.cc (Sized_target::do_adjust_elf_header): New function.
3369 (class Sized_target): Instantiate all versions.
3370 * freebsd.h (class Target_freebsd): Remove.
3371 (Target_selector_freebsd::do_recognize): Call set_osabi on
3372 Target.
3373 (Target_selector_freebsd::do_recognize_by_name): Likewise.
3374 (Target_selector_freebsd::set_osabi): Remove.
3375 * i386.cc (class Target_i386): Inherit from Sized_target rather
3376 than Target_freebsd.
3377 * x86_64.cc (class Target_x86_64): Likewise.
3378
b3ce541e
ILT
33792011-06-28 Ian Lance Taylor <iant@google.com>
3380
3381 * target.h (Target::can_check_for_function_pointers): Rewrite.
3382 Make non-virtual.
3383 (Target::can_icf_inline_merge_sections): Likewise.
3384 (Target::section_may_have_icf_unsafe_poineters): Likewise.
3385 (Target::Target_info): Add can_icf_inline_merge_sections field.
3386 (Target::do_can_check_for_function_pointers): New virtual
3387 function.
3388 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
3389 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
3390 from can_check_for_function_pointers, move in file.
3391 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
3392 section_may_have_icf_unsafe_poineters, move in file.
3393 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
3394 * i386.cc (Target_i386::do_can_check_for_function_pointers):
3395 Rename from can_check_for_function_pointers, move in file.
3396 (Target_i386::can_icf_inline_merge_sections): Remove.
3397 (Target_i386::i386_info): Initialize
3398 can_icf_inline_merge_sections.
3399 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
3400 Initialize can_icf_inline_merge_sections.
3401 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
3402 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
3403 Rename from can_check_for_function_pointers, move in file.
3404 (Target_x86_64::can_icf_inline_merge_sections): Remove.
3405 (Target_x86_64::x86_64_info): Initialize
3406 can_icf_inline_merge_sections.
3407 * testsuite/testfile.cc (Target_test::test_target_info):
3408 Likewise.
3409 * icf.cc (get_section_contents): Correct formatting.
3410
6d1c4efb
ILT
34112011-06-27 Ian Lance Taylor <iant@google.com>
3412
3413 * symtab.cc (Symbol::versioned_name): New function.
3414 (Symbol_table::add_to_final_symtab): Use versioned_name when
3415 appropriate.
3416 (Symbol_table::sized_write_symbol): Likewise.
3417 * symtab.h (class Symbol): Declare versioned_name.
3418 * stringpool.h (class Stringpool_template): Add variant of add
3419 which takes a std::basic_string.
3420 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
3421 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
3422 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
3423 (ver_test_12.o): New target.
3424 * testsuite/Makefile.in: Rebuild.
3425
57eb9b50
DK
34262011-06-27 Doug Kwan <dougkwan@google.com>
3427
3428 * arm.cc (Arm_relocate_functions::thm_jump8,
3429 Arm_relocate_functions::thm_jump11): Use a wider signed
3430 type to compute offset.
3431 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
3432 arm_thm_jump8.
3433 * testsuite/Makefile.in: Regenerate.
3434 * testsuite/arm_branch_in_range.sh: Check test results of
3435 arm_thm_jump11 and arm_thm_jump8.
3436 * testsuite/arm_thm_jump11.s: New test source file.
3437 * testsuite/arm_thm_jump11.t: New linker script.
3438 * testsuite/arm_thm_jump8.s: New test source file.
3439 * testsuite/arm_thm_jump8.t: New linker script.
3440
487b39df
ILT
34412011-06-24 Ian Lance Taylor <iant@google.com>
3442
3443 * layout.cc: Include "object.h".
3444 (ctors_sections_in_init_array): New static variable.
3445 (Layout::is_ctors_in_init_array): New function.
3446 (Layout::layout): Add entry to ctors_sections_in_init_array if
3447 appropriate.
3448 * layout.h (class Layout): Declare is_ctors_in_init_array.
3449 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
3450 is_ctors_reverse_view is set.
3451 (Sized_relobj_file::write_sections): Add layout parameter. Change
3452 all callers. Set is_ctors_reverse_view field of View_size.
3453 (Sized_relobj_file::reverse_words): New function.
3454 * object.h (Sized_relobj_file::View_size): Add
3455 is_ctors_reverse_view field.
3456 (class Sized_relobj_file): Update declarations.
3457 * testsuite/initpri3.c: New test.
3458 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
3459 initpri3b.
3460 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
3461 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
3462 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
3463 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
3464 * testsuite/Makefile.in: Rebuild.
3465
472076e4
CC
34662011-06-24 Cary Coutant <ccoutant@google.com>
3467
3468 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
3469 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
3470 (debug_msg_cdebug.err): New targets.
3471 * testsuite/Makefile.in: Regenerate.
3472 * testsuite/debug_msg.sh: Check output of link with compressed debug.
3473 Fix checks for link with shared library.
3474
a60af0db
DK
34752011-06-24 Doug Kwan <dougkwan@google.com>
3476
3477 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
3478 skip empty text sections.
3479 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
3480
5393d741
ILT
34812011-06-22 Ian Lance Taylor <iant@google.com>
3482
3483 PR gold/12910
3484 * options.h (class General_options): Add --ctors-in-init-array.
3485 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
3486 friends as SHT_PROGBITS for merging sections.
3487 (Layout::layout): Remove special handling of .init_array and
3488 friends. Don't sort if doing relocatable link. Sort for .ctors
3489 and .dtors if ctors_in_init_array.
3490 (Layout::make_output_section): Force correct section types for
3491 .init_array and friends. Don't sort if doing relocatable link,
3492 Don't sort .ctors and .dtors if ctors_in_init_array.
3493 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
3494 (Layout::output_section_name): Add relobj parameter. Change all
3495 callers. Handle .ctors. and .dtors. in code rather than table.
3496 Handle .ctors and .dtors if ctors_in_init_array.
3497 (Layout::match_file_name): New function, moved from output.cc.
3498 * layout.h (class Layout): Update declarations.
3499 * output.cc: Include "layout.h".
3500 (Input_section_sort_entry::get_priority): New function.
3501 (Input_section_sort_entry::match_file_name): Just call
3502 Layout::match_file_name.
3503 (Output_section::Input_section_sort_init_fini_compare::operator()):
3504 Handle .ctors and .dtors. Sort by explicit priority rather than
3505 by name.
3506 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
3507 * testsuite/initpri2.c: New test.
3508 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
3509 (check_PROGRAMS): Add initpri2.
3510 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
3511 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
3512 * configure, testsuite/Makefile.in: Rebuild.
3513
e1f74f98
ILT
35142011-06-19 Ian Lance Taylor <iant@google.com>
3515
3516 PR gold/12880
3517 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
3518 .interp section to a PT_INTERP segment even if we have seen a
3519 --dynamic-linker option. Don't do it if we have seen a PHDRS
3520 clause in a linker script.
3521 (Layout::finalize): Don't create a .interp section if we've
3522 already create a PT_INTERP segment.
3523 (Layout::create_interp): Always call choose_output_section (revert
3524 patch of 2011-06-17). Don't create PT_INTERP segment.
3525 * script-sections.cc
3526 (Script_sections::create_note_and_tls_segments): Add a .interp
3527 section to a PT_INTERP segment even if we have seen a
3528 --dynamic-linker option.
3529
766f91bb
ILT
35302011-06-18 Ian Lance Taylor <iant@google.com>
3531
3532 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
3533 merely because a non-PT_LOAD segment has a dynamic reloc.
3534
0d212c3a
ILT
35352011-06-18 Ian Lance Taylor <iant@google.com>
3536
3537 * layout.cc (Layout::finish_dynamic_section): Don't create
3538 DT_FLAGS entry if not needed.
3539
911a5072
ILT
35402011-06-18 Ian Lance Taylor <iant@google.com>
3541
3542 PR gold/12745
3543 * layout.cc (Layout::layout_eh_frame): Correct handling of
3544 writable .eh_frame section.
3545
534b4e5f
ILT
35462011-06-17 Ian Lance Taylor <iant@google.com>
3547
3548 PR gold/12893
3549 * resolve.cc (Symbol_table::resolve): Don't give an error if a
3550 symbol is redefined with the exact same object and value.
3551
10b4f102
ILT
35522011-06-17 Ian Lance Taylor <iant@google.com>
3553
3554 PR gold/12880
3555 * layout.h (class Layout): Add interp_segment_ field.
3556 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
3557 (Layout::attach_allocated_section_to_segment): If making shared
3558 library, put .interp section in PT_INTERP segment.
3559 (Layout::finalize): Also call create_interp if -dynamic-linker
3560 option was used.
3561 (Layout::create_interp): Assert that there is no PT_INTERP
3562 segment. If not using a SECTIONS clause, use make_output_section.
3563 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
3564 * script-sections.cc
3565 (Script_sections::create_note_and_tls_segments): If making shared
3566 library, put .interp section in PT_INTERP segment.
3567
a29b0dad
ILT
35682011-06-17 Ian Lance Taylor <iant@google.com>
3569
e588ea8d
ILT
3570 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
3571 when making a shared library.
3572
35732011-06-17 Ian Lance Taylor <iant@google.com>
3574
3575 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
3576 parameter. Change all callers. Don't issue warning about PC32
3577 against locally defined symbol.
a29b0dad 3578
9d3b0698
ILT
35792011-06-16 Ian Lance Taylor <iant@google.com>
3580
3581 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
3582 occurs in same object.
3583
85b0f90c
AM
35842011-06-14 Alan Modra <amodra@gmail.com>
3585
3586 * po/POTFILES.in: Regenerate.
3587
a94907d9
ILT
35882011-06-09 Ian Lance Taylor <iant@google.com>
3589
3590 * script-sections.cc
3591 (Orphan_output_section::set_section_addresses): For a relocatable
3592 link set address to 0.
3593
4fb3a1c3
CC
35942011-06-09 Cary Coutant <ccoutant@google.com>
3595
3596 PR gold/12804
3597 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
3598 used with --compress-debug-sections.
3599 * gold/object.cc (Sized_relobj_file::do_layout): Report
3600 uncompressed size of compressed input sections.
3601
61220854
CC
36022011-06-08 Cary Coutant <ccoutant@google.com>
3603
3604 PR gold/12804
3605 * testsuite/two_file_test_2_v1.cc: Change initialization of
3606 v2 to keep it in .data.
3607
e6455dfb
CC
36082011-06-07 Cary Coutant <ccoutant@google.com>
3609
3610 * common.cc (Symbol_table::do_allocate_commons_list): Call
3611 gold_fallback.
3612 * errors.cc (Errors::fatal): Adjust call to gold_exit.
3613 (Errors::fallback): New function.
3614 (gold_fallback): New function.
3615 * errors.h (Errors::fallback): New function.
3616 * gold.cc (gold_exit): Change status parameter to enum; adjust
3617 all callers.
3618 (queue_initial_tasks): Call gold_fallback.
3619 * gold.h: Include cstdlib.
3620 (Exit_status): New enum type.
3621 (gold_exit): Change status parameter to enum.
3622 (gold_fallback): New function.
3623 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
3624 (Layout::create_symtab_sections): Likewise.
3625 (Layout::create_shdrs): Likewise.
3626 * main.cc (main): Adjust call to gold_exit.
3627 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
3628 (Output_data_got::add_got_entry_pair): Likewise.
3629 (Output_section::add_input_section): Likewise.
3630 (Output_section::add_output_section_data): Likewise.
3631 (Output_segment::set_section_list_addresses): Likewise.
3632 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
3633
fb0e076f
CC
36342011-06-07 Cary Coutant <ccoutant@google.com>
3635
3636 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
3637 for incremental links.
3638 * output.cc (Output_segment::set_section_list_addresses): Remove
3639 FIXME and test for TLS or BSS.
3640
a5ee4d5d
CC
36412011-06-07 Cary Coutant <ccoutant@google.com>
3642
3643 * testsuite/Makefile.am: Add incremental_copy_test,
3644 incremental_common_test_1.
3645 * testsuite/Makefile.in: Regenerate.
3646 * testsuite/common_test_1_v1.c: New source file.
3647 * testsuite/common_test_1_v2.c: New source file.
3648 * testsuite/copy_test_v1.cc: New source file.
3649
5146f448
CC
36502011-06-07 Cary Coutant <ccoutant@google.com>
3651
3652 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
3653 update, allocate common from bss section's free list.
3654 * incremental-dump.cc (dump_incremental_inputs): Print flag for
3655 linker-defined symbols.
3656 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
3657 Skip GOT and PLT entries that are no longer referenced.
3658 (Output_section_incremental_inputs::write_info_blocks): Mark
3659 linker-defined symbols.
3660 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
3661 * output.cc (Output_section::allocate): New function.
3662 * output.h (Output_section::allocate): New function.
3663 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
3664 linker-defined symbols.
3665 (Symbol::override_base_with_special): Copy is_predefined_ flag.
3666 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
3667 (Symbol::init_base_output_data): Likewise.
3668 (Symbol::init_base_output_segment): Likewise.
3669 (Symbol::init_base_constant): Likewise.
3670 (Sized_symbol::init_output_data): Likewise.
3671 (Sized_symbol::init_output_segment): Likewise.
3672 (Sized_symbol::init_constant): Likewise.
3673 (Symbol_table::do_define_in_output_data): Likewise.
3674 (Symbol_table::do_define_in_output_segment): Likewise.
3675 (Symbol_table::do_define_as_constant): Likewise.
3676 * symtab.h (Symbol::is_predefined): New function.
3677 (Symbol::init_base_output_data): Add is_predefined parameter.
3678 (Symbol::init_base_output_segment): Likewise.
3679 (Symbol::init_base_constant): Likewise.
3680 (Symbol::is_predefined_): New data member.
3681 (Sized_symbol::init_output_data): Add is_predefined parameter.
3682 (Sized_symbol::init_output_segment): Likewise.
3683 (Sized_symbol::init_constant): Likewise.
3684 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
3685
26d3c67d
CC
36862011-06-07 Cary Coutant <ccoutant@google.com>
3687
3688 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
3689 instead of emit_copy_reloc.
3690 (Copy_relocs::emit_copy_reloc): Refactor.
3691 (Copy_relocs::make_copy_reloc): New function.
3692 (Copy_relocs::add_copy_reloc): Remove.
3693 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
3694 section.
3695 (Copy_relocs::make_copy_reloc): New function.
3696 (Copy_relocs::add_copy_reloc): Remove.
3697 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
3698 unchanged input files.
3699 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
3700 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
3701 Reserve BSS space for COPY relocations.
3702 (Sized_incremental_binary::do_emit_copy_relocs): New function.
3703 (Output_section_incremental_inputs::write_info_blocks): Record
3704 whether a symbol is copied from a shared object.
3705 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
3706 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
3707 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
3708 (Incremental_input_entry_reader::get_output_symbol_index): Add
3709 is_copy parameter.
3710 (Incremental_binary::emit_copy_relocs): New function.
3711 (Incremental_binary::do_emit_copy_relocs): New function.
3712 (Sized_incremental_binary::Sized_incremental_binary): Initialize
3713 new data member.
3714 (Sized_incremental_binary::add_copy_reloc): New function.
3715 (Sized_incremental_binary::do_emit_copy_relocs): New function.
3716 (Sized_incremental_binary::Copy_reloc): New struct.
3717 (Sized_incremental_binary::Copy_relocs): New typedef.
3718 (Sized_incremental_binary::copy_relocs_): New data member.
3719 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
3720 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
3721 * target.h (Sized_target::emit_copy_reloc): New function.
3722 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
3723
7cdb37d9
CC
37242011-06-02 Cary Coutant <ccoutant@google.com>
3725
3726 PR gold/12163
3727 * gold/archive.cc (Archive::Archive): Initialize new data member.
3728 (Archive::include_all_members): Return if archive has already been
3729 included.
3730 * gold/archive.h (Archive::include_all_members_): New data member.
3731
cc643b88
NC
37322011-06-02 Nick Clifton <nickc@redhat.com>
3733
3734 * dynobj.h: Fix spelling mistake in comment.
3735 * output.cc: Likewise.
3736
f62a3ca7 37372011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 3738 Asier Llano
f62a3ca7
DK
3739
3740 PR gold/12826
cc643b88 3741 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
3742 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
3743 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
3744 redundant arm_exidx_test.so.
3745 * testsuite/Makefile.in: Regenerate.
3746 (check_SCRIPTS): Add pr12826.sh
3747 (check_DATA): Add pr12826.stdout
3748 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
3749 * testsuite/pr12826.sh: New file.
3750 * testsuite/pr12826_1.s: Ditto.
3751 * testsuite/pr12826_1.s: Ditto.
3752
8dbe1edc
ILT
37532011-05-30 Ian Lance Taylor <iant@google.com>
3754
3755 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
3756 sections.
3757
c49875be
ILT
37582011-05-29 Ian Lance Taylor <iant@google.com>
3759
3760 PR gold/12804
3761 * testsuite/Makefile.am: Use different file name for two_file_test
3762 temporary file for each incremental test.
3763 * testsuite/Makefile.in: Rebuild.
3764
69d53f7a
ILT
37652011-05-29 Ian Lance Taylor <iant@google.com>
3766
3767 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
3768 binary input file is empty.
3769
41d0ab5f
ILT
37702011-05-27 Ian Lance Taylor <iant@google.com>
3771
3772 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
3773 (ver_test_9.so): Likewise.
3774 * testsuite/Makefile.in: Rebuild.
3775
89d8a36b
CC
37762011-05-26 Cary Coutant <ccoutant@google.com>
3777
3778 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
3779 * incremental.cc (Incremental_inputs::report_input_section): Fix
3780 comment, indentation.
3781 (Incremental_inputs::report_comdat_group): New function.
3782 (Output_section_incremental_inputs::set_final_data_size): Adjust size
3783 of data for incremental input file entry.
3784 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
3785 group count, COMDAT group signatures.
3786 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
3787 an unchanged input file.
3788 * incremental.h (Incremental_object_entry::Incremental_object_entry):
3789 Initialize new data member.
3790 (Incremental_object_entry::add_comdat_group): New function.
3791 (Incremental_object_entry::get_comdat_group_count): New function.
3792 (Incremental_object_entry::get_comdat_signature_key): New function.
3793 (Incremental_object_entry::groups_): New data member.
3794 (Incremental_inputs::report_comdat_group): New function.
3795 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
3796 data for incremental input file entry.
3797 (Incremental_input_entry_reader::get_comdat_group_count): New function.
3798 (Incremental_input_entry_reader::get_input_section): Adjust size of
3799 data for incremental input file entry.
3800 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
3801 (Incremental_input_entry_reader::get_comdat_group_signature): New
3802 function.
3803 * object.cc (Sized_relobj::include_section_group): Report kept
3804 COMDAT groups for incremental links.
3805
1706a06f
ILT
38062011-05-24 David Meyer <pdox@google.com>
3807
3808 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
3809 with name parameter. Add found_name parameter.
3810 * fileread.cc (Input_file::find_file): Adjust code accordingly.
3811 * dirsearch.h (class Dirsearch): Update declaration.
3812
a10ae760
ILT
38132011-05-24 Ian Lance Taylor <iant@google.com>
3814
3815 * archive.cc (Library_base::should_include_member): Pull in object
3816 from archive if it defines the entry symbol.
3817 * parameters.cc (Parameters::entry): New function.
3818 * parameters.h (class Parameters): Declare entry.
3819 * output.h (class Output_file_header): Remove entry_ field.
3820 * output.cc (Output_file_header::Output_file_header): Remove entry
3821 parameter. Change all callers.
3822 (Output_file_header::entry): Use parameters->entry.
3823 * gold.cc (queue_middle_tasks): Likewise.
3824 * plugin.cc (Plugin_hook::run): Likewise.
3825
aa92d6ed
CC
38262011-05-24 Cary Coutant <ccoutant@google.com>
3827
3828 * gold.cc (queue_initial_tasks): Pass incremental base filename
3829 to Output_file::open_base_file; don't print error message.
3830 * incremental-dump.cc (main): Adjust call to
3831 Output_file::open_for_modification.
3832 * incremental-dump.cc (main): Likewise.
3833 * incremental.cc (Incremental_inputs::report_command_line):
3834 Ignore --incremental-base option when comparing command lines.
3835 Ignore parameter when given as separate argument.
3836 * options.h (class General_options): Add --incremental-base.
3837 * output.cc (Output_file::Output_file):
3838 (Output_file::open_base_file): Add base_name and writable parameters;
3839 read base file into new file; print error message here.
3840 (Output_file::map_no_anonymous): Add writable parameter; adjust all
3841 callers.
3842 * output.h (Output_file::open_for_modification): Rename to...
3843 (Output_file::open_base_file): ...this; add base_name and
3844 writable parameters; adjust all callers.
3845 (Output_file::map_no_anonymous): Add writable parameter; adjust all
3846 callers.
3847 * testsuite/Makefile.am (incremental_test_4): Test
3848 --incremental-base.
3849 * testsuite/Makefile.in: Regenerate.
3850
2eedd706
CC
38512011-05-24 Cary Coutant <ccoutant@google.com>
3852
3853 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
3854 incremental_test_4.
3855 * testsuite/Makefile.in: Regenerate.
3856 * testsuite/two_file_test_1_v1.cc: New test source file.
3857 * testsuite/two_file_test_1b_v1.cc: New test source file.
3858 * testsuite/two_file_test_2_v1.cc: New test source file.
3859
0f1c85a6
CC
38602011-05-24 Cary Coutant <ccoutant@google.com>
3861
3862 * dynobj.h (Dynobj::do_dynobj): New function.
3863 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
3864 flag and soname for shared objects.
3865 * incremental.cc (Incremental_inputs::report_object): Make
3866 either Incremental_object_entry or Incremental_dynobj_entry; add
3867 soname to string table.
3868 (Incremental_inputs::report_input_section): Add assertion.
3869 (Output_section_incremental_inputs::set_final_data_size): Adjust
3870 type of input file entry for shared libraries; adjust size of
3871 shared library info entry.
3872 (Output_section_incremental_inputs::write_input_files): Write
3873 as_needed flag for shared libraries.
3874 (Output_section_incremental_inputs::write_info_blocks): Adjust type
3875 of input file entry for shared libraries; write soname.
3876 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
3877 soname from incremental info.
3878 * incremental.h (enum Incremental_input_flags): Add
3879 INCREMENTAL_INPUT_AS_NEEDED.
3880 (Incremental_input_entry::Incremental_input_entry): Initialize new
3881 data member.
3882 (Incremental_input_entry::set_as_needed): New function.
3883 (Incremental_input_entry::as_needed): New function.
3884 (Incremental_input_entry::do_dynobj_entry): New function.
3885 (Incremental_input_entry::as_needed_): New data member.
3886 (Incremental_object_entry::Incremental_object_entry): Don't check
3887 for shared library.
3888 (Incremental_object_entry::do_type): Likewise.
3889 (class Incremental_dynobj_entry): New class.
3890 (Incremental_input_entry_reader::as_needed): New function.
3891 (Incremental_input_entry_reader::get_soname): New function.
3892 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
3893 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
3894 size of shared library info entry.
58797674 3895 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
3896 incremental link when adding DT_NEEDED entries.
3897 * object.h (Object::Object): Initialize new data member.
3898 (Object::dynobj): New function.
3899 (Object::set_as_needed): New function.
3900 (Object::as_needed): New function.
3901 (Object::do_dynobj): New function.
3902 (Object::as_needed_): New data member.
3903
6fa2a40b
CC
39042011-05-24 Cary Coutant <ccoutant@google.com>
3905
3906 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
3907 info; adjust display of GOT entries.
3908 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
3909 vector of input objects; remove file_status_.
3910 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
3911 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
3912 got_plt reader; call target hooks to reserve GOT entries.
3913 (Output_section_incremental_inputs::set_final_data_size): Adjust size
3914 of input file info header and GOT info entry.
3915 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
3916 relocation info.
3917 (Got_plt_view_info::got_descriptor): Remove.
3918 (Got_plt_view_info::sym_index): New data member.
3919 (Got_plt_view_info::input_index): New data member.
3920 (Local_got_offset_visitor::visit): Write input file index.
3921 (Global_got_offset_visitor::visit): Write 0 for input file index.
3922 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
3923 with sym_index and input_index.
3924 (Output_section_incremental_inputs::write_got_plt): Adjust size of
3925 incremental info GOT entry; replace got_descriptor with input_index.
3926 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
3927 map from input file index to object.
3928 (Sized_relobj_incr::do_layout): Replace direct data member reference
3929 with accessor function.
3930 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
3931 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
3932 Adjust size of input file info header.
3933 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
3934 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
3935 (Incremental_input_entry_reader::get_input_section): Adjust size of
3936 input file info header.
3937 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
3938 of incremental info GOT entry.
3939 (Incremental_got_plt_reader::get_got_desc): Remove.
3940 (Incremental_got_plt_reader::get_got_symndx): New function.
3941 (Incremental_got_plt_reader::get_got_input_index): New function.
3942 (Sized_incremental_binary::Sized_incremental_binary): Remove
3943 file_status_; add input_objects_.
3944 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
3945 (Sized_incremental_binary::set_file_is_unchanged): Remove.
3946 (Sized_incremental_binary::file_is_unchanged): Remove.
3947 (Sized_incremental_binary::set_input_object): New function.
3948 (Sized_incremental_binary::input_object): New function.
3949 (Sized_incremental_binary::file_status_): Remove.
3950 (Sized_incremental_binary::input_objects_): New data member.
3951 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
3952 references.
3953 (Sized_relobj_incr::invalid_address): Move to base class.
3954 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
3955 class.
3956 (Sized_relobj_incr::do_output_section_offset): Likewise.
3957 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
3958 (Sized_relobj_incr::section_offsets_): Likewise.
3959 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
3960 function.
3961 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
3962 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
3963 with accessor function.
3964 (Sized_relobj_file::do_layout): Likewise.
3965 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
3966 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
3967 (Sized_relobj_file::compute_final_local_value): Replace refs to
3968 section_offsets_ with accessor function.
3969 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
3970 * object.h (Relobj::Relobj): Initialize new data members.
3971 (Relobj::add_dyn_reloc): New function.
3972 (Relobj::first_dyn_reloc): New function.
3973 (Relobj::dyn_reloc_count): New function.
3974 (Relobj::first_dyn_reloc_): New data member.
3975 (Relobj::dyn_reloc_count_): New data member.
3976 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
3977 references.
3978 (Sized_relobj::Address): New typedef.
3979 (Sized_relobj::invalid_address): Move here from child class.
3980 (Sized_relobj::Sized_relobj): Initialize new data members.
3981 (Sized_relobj::sized_relobj): New function.
3982 (Sized_relobj::is_output_section_offset_invalid): Move here from
3983 child class.
3984 (Sized_relobj::get_output_section_offset): Likewise.
3985 (Sized_relobj::local_has_got_offset): Likewise.
3986 (Sized_relobj::local_got_offset): Likewise.
3987 (Sized_relobj::set_local_got_offset): Likewise.
3988 (Sized_relobj::do_for_all_local_got_entries): Likewise.
3989 (Sized_relobj::clear_got_offsets): New function.
3990 (Sized_relobj::section_offsets): Move here from child class.
3991 (Sized_relobj::do_output_section_offset): Likewise.
3992 (Sized_relobj::do_set_section_offset): Likewise.
3993 (Sized_relobj::Local_got_offsets): Likewise.
3994 (Sized_relobj::local_got_offsets_): Likewise.
3995 (Sized_relobj::section_offsets_): Likewise.
3996 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
3997 references.
3998 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
3999 class.
4000 (Sized_relobj_file::sized_relobj): New function
4001 (Sized_relobj_file::local_has_got_offset): Move to base class.
4002 (Sized_relobj_file::local_got_offset): Likewise.
4003 (Sized_relobj_file::set_local_got_offset): Likewise.
4004 (Sized_relobj_file::get_output_section_offset): Likewise.
4005 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
4006 (Sized_relobj_file::do_output_section_offset): Likewise.
4007 (Sized_relobj_file::do_set_section_offset): Likewise.
4008 (Sized_relobj_file::Local_got_offsets): Likewise.
4009 (Sized_relobj_file::local_got_offsets_): Likewise.
4010 (Sized_relobj_file::section_offsets_): Likewise.
4011 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
4012 (all constructors).
4013 (set_needs_dynsym_index): Convert relobj to derived class pointer.
4014 (Output_reloc::get_symbol_index): Likewise.
4015 (Output_reloc::local_section_offset): Likewise.
4016 (Output_reloc::get_address): Likewise.
4017 (Output_reloc::symbol_value): Likewise.
4018 (Output_data_got::reserve_slot): Move to class definition.
4019 (Output_data_got::reserve_local): New function.
4020 (Output_data_got::reserve_slot_for_global): Remove.
4021 (Output_data_got::reserve_global): New function.
4022 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
4023 (all constructors, two instantiations).
4024 (Output_reloc::get_relobj): New function (two instantiations).
4025 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
4026 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
4027 (Output_data_reloc::add_global): Adjust type of relobj.
4028 (Output_data_reloc::add_global_relative): Likewise.
4029 (Output_data_reloc::add_symbolless_global_addend): Likewise.
4030 (Output_data_reloc::add_local): Likewise.
4031 (Output_data_reloc::add_local_relative): Likewise.
4032 (Output_data_reloc::add_symbolless_local_addend): Likewise.
4033 (Output_data_reloc::add_local_section): Likewise.
4034 (Output_data_reloc::add_output_section): Likewise.
4035 (Output_data_reloc::add_absolute): Likewise.
4036 (Output_data_reloc::add_target_specific): Likewise.
4037 (Output_data_got::reserve_slot): Move definition here.
4038 (Output_data_got::reserve_local): New function.
4039 (Output_data_got::reserve_global): New function.
4040 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
4041 section_offsets_ with accessor function.
4042 (Sized_relobj_file::write_sections): Likewise.
4043 (Sized_relobj_file::do_relocate_sections): Likewise.
4044 * target.h (Sized_target::reserve_local_got_entry): New function.
4045 (Sized_target::reserve_global_got_entry): New function.
4046 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
4047 (Target_x86_64::reserve_global_got_entry): New function.
4048 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
4049
4829d394
CC
40502011-05-23 Cary Coutant <ccoutant@google.com>
4051
4052 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
4053 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
4054 bit when checking got_type.
4055 * incremental.cc (Sized_incremental_binary::setup_readers):
4056 Store symbol table and string table locations; initialize bit vector
4057 of file status flags.
4058 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
4059 unchanged files.
4060 (Sized_incremental_binary::do_process_got_plt): New function.
4061 (Sized_incremental_binary::get_symtab_view): Use stored locations.
4062 (Output_section_incremental_inputs::set_final_data_size): Record
4063 file index for each input file.
4064 (Output_section_incremental_inputs::write_got_plt): Store file index
4065 instead of input entry offset for each GOT entry.
4066 * incremental.h
4067 (Incremental_input_entry::Incremental_input_entry): Initialize new
4068 data member.
4069 (Incremental_input_entry::set_offset): Store file index.
4070 (Incremental_input_entry::get_file_index): New function.
4071 (Incremental_input_entry::file_index_): New data member.
4072 (Incremental_binary::process_got_plt): New function.
4073 (Incremental_binary::do_process_got_plt): New function.
4074 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
4075 data members.
4076 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
4077 (Sized_incremental_binary::set_file_is_unchanged): New function.
4078 (Sized_incremental_binary::file_is_unchanged): New function.
4079 (Sized_incremental_binary::do_process_got_plt): New function.
4080 (Sized_incremental_binary::file_status_): New data member.
4081 (Sized_incremental_binary::main_symtab_loc_): New data member.
4082 (Sized_incremental_binary::main_strtab_loc_): New data member.
4083 * output.cc (Output_data_got::Got_entry::write): Add case
4084 RESERVED_CODE.
4085 (Output_data_got::add_global): Call add_got_entry.
4086 (Output_data_got::add_global_plt): Likewise.
4087 (Output_data_got::add_global_with_rel): Likewise.
4088 (Output_data_got::add_global_with_rela): Likewise.
4089 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
4090 (Output_data_got::add_global_pair_with_rela): Likewise.
4091 (Output_data_got::add_local): Call add_got_entry.
4092 (Output_data_got::add_local_plt): Likewise.
4093 (Output_data_got::add_local_with_rel): Likewise.
4094 (Output_data_got::add_local_with_rela): Likewise.
4095 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
4096 (Output_data_got::add_local_pair_with_rela): Likewise.
4097 (Output_data_got::reserve_slot): New function.
4098 (Output_data_got::reserve_slot_for_global): New function.
4099 (Output_data_got::add_got_entry): New function.
4100 (Output_data_got::add_got_entry_pair): New function.
4101 (Output_section::add_output_section_data): Edit FIXME.
4102 * output.h
4103 (Output_section_data_build::Output_section_data_build): New
4104 constructor with size parameter.
4105 (Output_data_space::Output_data_space): Likewise.
4106 (Output_data_got::Output_data_got): Initialize new data member; new
4107 constructor with size parameter.
4108 (Output_data_got::add_constant): Call add_got_entry.
4109 (Output_data_got::reserve_slot): New function.
4110 (Output_data_got::reserve_slot_for_global): New function.
4111 (class Output_data_got::Got_entry): Add RESERVED_CODE.
4112 (Output_data_got::add_got_entry): New function.
4113 (Output_data_got::add_got_entry_pair): New function.
4114 (Output_data_got::free_list_): New data member.
4115 * target.h (Sized_target::init_got_plt_for_update): New function.
4116 (Sized_target::register_global_plt_entry): New function.
4117 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4118 Initialize new data member; call init; add constructor with PLT count.
4119 (Output_data_plt_x86_64::init): New function.
4120 (Output_data_plt_x86_64::add_relocation): New function.
4121 (Output_data_plt_x86_64::reserve_slot): New function.
4122 (Output_data_plt_x86_64::free_list_): New data member.
4123 (Target_x86_64::init_got_plt_for_update): New function.
4124 (Target_x86_64::register_global_plt_entry): New function.
4125 (Output_data_plt_x86_64::add_entry): Allocate from free list for
4126 incremental updates.
4127 (Output_data_plt_x86_64::add_relocation): New function.
4128 * testsuite/object_unittest.cc (Object_test): Set default options.
4129
ec69d6da
ILT
41302011-05-16 Ian Lance Taylor <iant@google.com>
4131
4132 * options.h (class General_options): Make -i a synonym for -r.
4133
732e31de
ILT
41342011-05-16 Ian Lance Taylor <iant@google.com>
4135
4136 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
4137
403676b5
CC
41382011-05-10 Cary Coutant <ccoutant@google.com>
4139
4140 * object.cc (Sized_relobj::do_count_local_symbols): Check for
4141 strip_all (-s).
4142
5b7b7d6e
ILT
41432011-05-06 Ian Lance Taylor <iant@google.com>
4144
4145 * layout.cc (Layout::layout): If the output section flags change,
4146 update the ordering.
4147
f0f9babf
CC
41482011-04-25 Cary Coutant <ccoutant@google.com>
4149
4150 * incremental-dump.cc (dump_incremental_inputs): Print local
4151 symbol info for each input file.
4152 * incremental.cc
4153 (Output_section_incremental_inputs::set_final_data_size): Add local
4154 symbol info to input file entries in incremental info.
4155 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4156 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
4157 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
4158 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
4159 implementation.
4160 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
4161 (Sized_incr_relobj::do_relocate): Write the local symbols.
4162 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
4163 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
4164 Adjust size of input file header.
4165 (Incremental_inputs_reader::get_local_symbol_offset): New function.
4166 (Incremental_inputs_reader::get_local_symbol_count): New function.
4167 (Incremental_inputs_reader::get_input_section): Adjust size of input
4168 file header.
4169 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
4170 (Sized_incr_relobj::This): New typedef.
4171 (Sized_incr_relobj::sym_size): New const data member.
4172 (Sized_incr_relobj::Local_symbol): New struct.
4173 (Sized_incr_relobj::do_output_local_symbol_count): New function.
4174 (Sized_incr_relobj::do_local_symbol_offset): New function.
4175 (Sized_incr_relobj::local_symbol_count_): New data member.
4176 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
4177 (Sized_incr_relobj::local_symbol_index_): New data member.
4178 (Sized_incr_relobj::local_symbol_offset_): New data member.
4179 (Sized_incr_relobj::local_dynsym_offset_): New data member.
4180 (Sized_incr_relobj::local_symbols_): New data member.
4181 * object.h (Relobj::output_local_symbol_count): New function.
4182 (Relobj::local_symbol_offset): New function.
4183 (Relobj::do_output_local_symbol_count): New function.
4184 (Relobj::do_local_symbol_offset): New function.
4185 (Sized_relobj::do_output_local_symbol_count): New function.
4186 (Sized_relobj::do_local_symbol_offset): New function.
4187
d0a9ace3
ILT
41882011-04-22 Vladimir Simonov <sv@sw.ru>
4189
4190 * descriptors.cc (set_close_on_exec): New function.
4191 (Descriptors::open): Use set_close_on_exec.
4192 * output.cc (S_ISLNK): Define if not defined.
4193
94a3fc8b
CC
41942011-04-22 Cary Coutant <ccoutant@google.com>
4195
4196 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
4197 global symbol map.
4198 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
4199 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
4200 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
4201 relocations.
4202 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
4203 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
4204 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
4205 * incremental.h
4206 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
4207 function.
4208 (Incremental_binary::apply_incremental_relocs): New function.
4209 (Incremental_binary::do_apply_incremental_relocs): New function.
4210 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
4211 data member.
4212 (Sized_incremental_binary::add_global_symbol): New function.
4213 (Sized_incremental_binary::global_symbol): New function.
4214 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
4215 (Sized_incremental_binary::symbol_map_): New data member.
4216 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
4217 * target.h (Sized_target::apply_relocation): New function.
4218 * target-reloc.h (apply_relocation): New function.
4219 * x86_64.cc (Target_x86_64::apply_relocation): New function.
4220
c87e4302
DK
42212011-04-22 Doug Kwan <dougkwan@google.com>
4222
4223 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
4224 flag of a SHT_ARM_EXIDX section.
2e702c99 4225 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
4226 * testsuite/Makefile.in: Regenerate.
4227 * testsuite/arm_exidx_test.s: New file.
4228 * testsuite/arm_exidx_test.sh: Same.
4229
e7782cf6
CC
42302011-04-20 Cary Coutant <ccoutant@google.com>
4231
4232 PR gold/12689
4233 * archive.h (Incremental_archive_entry::Archive_member):
4234 Initialize arg_serial_ (second constructor).
4235
308ecdc7
ILT
42362011-04-17 Ian Lance Taylor <iant@google.com>
4237
4238 * object.cc (Relocate_info::location): Simplify location string.
4239 * errors.cc (Errors::error_at_location): Don't print program
4240 name.
4241 (Errors::warning_at_location): Likewise.
4242 (Errors::undefined_symbol): Likewise.
4243 * testsuite/debug_msg.sh: Update accordingly.
4244
bec5b579
CC
42452011-04-14 Cary Coutant <ccoutant@google.com>
4246
4247 * gold/layout.cc (Layout::symtab_section_offset): New function.
4248 * gold/layout.h (Layout::symtab_section_offset): New function.
4249 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
4250
88597d34
ILT
42512011-04-12 Ian Lance Taylor <iant@google.com>
4252
4253 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
4254 with MREMAP_MAYMOVE.
4255 * output.h (class Output_file): Add map_is_allocated_ field.
4256 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
4257 not available, provide stubs. If mremap is not available, #define
4258 it to gold_mremap.
4259 (MREMAP_MAYMOVE): Define if not defined.
4260 (Output_file::Output_file): Initialize map_is_allocated_.
4261 (Output_file::resize): Check map_is_allocated_.
4262 (Output_file::map_anonymous): If mmap fails, use malloc.
4263 (Output_file::unmap): Don't do anything for an anonymous map.
4264 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
4265 is not available, provide stubs.
4266 (File_read::View::~View): Use free rather than delete[].
4267 (File_read::make_view): Use malloc rather than new[]. If mmap
4268 fails, use malloc.
4269 (File_read::find_or_make_view): Use malloc rather than new[].
4270 * gold.h: Remove HAVE_REMAP code.
4271 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
4272 exists. Rename mremap to gold_mremap. If mmap is not available
4273 don't do anything.
4274 * configure, config.in: Rebuild.
4275
11e361bc
ILT
42762011-04-11 Ian Lance Taylor <iant@google.com>
4277
4278 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
4279 initialize local variable v.
4280
cdc29364
CC
42812011-04-11 Cary Coutant <ccoutant@google.com>
4282
4283 * archive.cc (Archive::include_member): Adjust call to
4284 report_object.
4285 (Add_archive_symbols::run): Track argument serial numbers.
4286 (Lib_group::include_member): Likewise.
4287 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
4288 * archive.h (Incremental_archive_entry::Archive_member):
4289 Initialize arg_serial_.
4290 (Archive_member::arg_serial_): New data member.
4291 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
4292 (Sized_dynobj::do_add_symbols): Track symbols when doing an
4293 incremental link.
4294 (Sized_dynobj::do_for_all_local_got_entries): New function.
4295 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
4296 function.
4297 * fileread.cc (get_mtime): New function.
4298 * fileread.h (get_mtime): New function.
4299 * gold.cc (queue_initial_tasks): Check for incremental update.
4300 (process_incremental_input): New function.
4301 (queue_middle_tasks): Don't force valid target for incremental
4302 update.
4303 * incremental-dump.cc (find_input_containing_global): Adjust
4304 size of symbol info entry.
4305 (dump_incremental_inputs): Dump argument serial number and
4306 in_system_directory flag; bias shndx by 1; print symbol names
4307 when dumping per-file symbol lists; use new symbol info readers.
4308 * incremental.cc
4309 (Output_section_incremental_inputs:update_data_size): New function.
4310 (Sized_incremental_binary::setup_readers): Setup input readers
4311 for each input file; build maps for files added from libraries
4312 and scripts.
4313 (Sized_incremental_binary::check_input_args): New function.
4314 (Sized_incremental_binary::do_check_inputs): Build map of argument
4315 serial numbers to input arguments.
4316 (Sized_incremental_binary::do_file_has_changed): Rename
4317 do_file_is_unchanged to this; compare file modification times.
4318 (Sized_incremental_binary::do_init_layout): New function.
4319 (Sized_incremental_binary::do_reserve_layout): New function.
4320 (Sized_incremental_binary::do_get_input_reader): Remove.
4321 (Sized_incremental_binary::get_symtab_view): New function.
4322 (Incremental_checker::can_incrementally_link_output_file): Remove.
4323 (Incremental_inputs::report_command_line): Exclude --debug options.
4324 (Incremental_inputs::report_archive_begin): Add parameter; track
4325 argument serial numbers; don't put input file entry for archive
4326 before archive members.
4327 (Incremental_inputs::report_archive_end): Put input file entry
4328 for archive after archive members.
4329 (Incremental_inputs::report_object): Add parameter; track argument
4330 serial numbers and in_system_directory flag.
4331 (Incremental_inputs::report_script): Add parameter; track argument
4332 serial numbers.
4333 (Output_section_incremental_inputs::set_final_data_size): Adjust
4334 size of symbol info entry; check for forwarding symbols.
4335 (Output_section_incremental_inputs::write_input_files): Write
4336 in_system_directory flag and argument serial number.
4337 (Output_section_incremental_inputs::write_info_blocks): Map section
4338 indices between incremental info and original input file; store
4339 input section index for each symbol.
4340 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
4341 change operator() to visit().
4342 (class Global_got_offset_visitor): Likewise.
4343 (class Global_symbol_visitor_got_plt):
4344 (Output_section_incremental_inputs::write_got_plt): Use new visitor
4345 classes.
4346 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
4347 (Sized_incr_relobj::do_read_symbols): New function.
4348 (Sized_incr_relobj::do_layout): New function.
4349 (Sized_incr_relobj::do_layout_deferred_sections): New function.
4350 (Sized_incr_relobj::do_add_symbols): New function.
4351 (Sized_incr_relobj::do_should_include_member): New function.
4352 (Sized_incr_relobj::do_for_all_global_symbols): New function.
4353 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
4354 (Sized_incr_relobj::do_section_size): New function.
4355 (Sized_incr_relobj::do_section_name): New function.
4356 (Sized_incr_relobj::do_section_contents): New function.
4357 (Sized_incr_relobj::do_section_flags): New function.
4358 (Sized_incr_relobj::do_section_entsize): New function.
4359 (Sized_incr_relobj::do_section_address): New function.
4360 (Sized_incr_relobj::do_section_type): New function.
4361 (Sized_incr_relobj::do_section_link): New function.
4362 (Sized_incr_relobj::do_section_info): New function.
4363 (Sized_incr_relobj::do_section_addralign): New function.
4364 (Sized_incr_relobj::do_initialize_xindex): New function.
4365 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
4366 (Sized_incr_relobj::do_read_relocs): New function.
4367 (Sized_incr_relobj::do_gc_process_relocs): New function.
4368 (Sized_incr_relobj::do_scan_relocs): New function.
4369 (Sized_incr_relobj::do_count_local_symbols): New function.
4370 (Sized_incr_relobj::do_finalize_local_symbols): New function.
4371 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
4372 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
4373 (Sized_incr_relobj::do_relocate): New function.
4374 (Sized_incr_relobj::do_set_section_offset): New function.
4375 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
4376 (Sized_incr_dynobj::do_read_symbols): New function.
4377 (Sized_incr_dynobj::do_layout): New function.
4378 (Sized_incr_dynobj::do_add_symbols): New function.
4379 (Sized_incr_dynobj::do_should_include_member): New function.
4380 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
4381 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
4382 (Sized_incr_dynobj::do_section_size): New function.
4383 (Sized_incr_dynobj::do_section_name): New function.
4384 (Sized_incr_dynobj::do_section_contents): New function.
4385 (Sized_incr_dynobj::do_section_flags): New function.
4386 (Sized_incr_dynobj::do_section_entsize): New function.
4387 (Sized_incr_dynobj::do_section_address): New function.
4388 (Sized_incr_dynobj::do_section_type): New function.
4389 (Sized_incr_dynobj::do_section_link): New function.
4390 (Sized_incr_dynobj::do_section_info): New function.
4391 (Sized_incr_dynobj::do_section_addralign): New function.
4392 (Sized_incr_dynobj::do_initialize_xindex): New function.
4393 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
4394 (make_sized_incremental_object): New function.
4395 (Incremental_library::copy_unused_symbols): New function.
4396 (Incremental_library::do_for_all_unused_symbols): New function.
4397 * incremental.h (enum Incremental_input_flags): New type.
4398 (class Incremental_checker): Remove.
4399 (Incremental_input_entry::Incremental_input_entry): Add argument
4400 serial number.
4401 (Incremental_input_entry::arg_serial): New function.
4402 (Incremental_input_entry::set_is_in_system_directory): New function.
4403 (Incremental_input_entry::is_in_system_directory): New function.
4404 (Incremental_input_entry::arg_serial_): New data member.
4405 (Incremental_input_entry::is_in_system_directory_): New data member.
4406 (class Script_info): Move here from script.h.
4407 (Script_info::Script_info): Add filename parameter.
4408 (Script_info::filename): New function.
4409 (Script_info::filename_): New data member.
4410 (Incremental_script_entry::Incremental_script_entry): Add argument
4411 serial number.
4412 (Incremental_object_entry::Incremental_object_entry): Likewise.
4413 (Incremental_object_entry::add_input_section): Build list of input
4414 sections with map to original shndx.
4415 (Incremental_object_entry::get_input_section_index): New function.
4416 (Incremental_object_entry::shndx_): New data member.
4417 (Incremental_object_entry::name_key_): Rename; adjust all refs.
4418 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
4419 (Incremental_archive_entry::Incremental_archive_entry): Add argument
4420 serial number.
4421 (Incremental_inputs::report_archive_begin): Likewise.
4422 (Incremental_inputs::report_object): Likewise.
4423 (Incremental_inputs::report_script): Likewise.
4424 (class Incremental_global_symbol_reader): New class.
4425 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
4426 and store flags and input file type.
4427 (Incremental_input_entry_reader::arg_serial): New function.
4428 (Incremental_input_entry_reader::type): Extract type from flags.
4429 (Incremental_input_entry_reader::is_in_system_directory): New function.
4430 (Incremental_input_entry_reader::get_input_section_count): Call
4431 accessor function for type.
4432 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
4433 function for type; adjust size of global symbol entry.
4434 (Incremental_input_entry_reader::get_global_symbol_count): Call
4435 accessor function for type.
4436 (Incremental_input_entry_reader::get_object_count): Likewise.
4437 (Incremental_input_entry_reader::get_object_offset): Likewise.
4438 (Incremental_input_entry_reader::get_member_count): Likewise.
4439 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
4440 (Incremental_input_entry_reader::get_member_offset): Likewise.
4441 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
4442 (Incremental_input_entry_reader::Global_symbol_info): Remove.
4443 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
4444 (Incremental_input_entry_reader::get_global_symbol_reader): New
4445 function.
4446 (Incremental_input_entry_reader::get_output_symbol_index): New
4447 function.
4448 (Incremental_input_entry_reader::type_): Remove.
4449 (Incremental_input_entry_reader::flags_): New data member.
4450 (Incremental_inputs_reader::input_file_offset): New function.
4451 (Incremental_inputs_reader::input_file_index): New function.
4452 (Incremental_inputs_reader::input_file): Call input_file_offset.
4453 (Incremental_inputs_reader::input_file_at_offset): New function.
4454 (Incremental_relocs_reader::get_r_type): Reformat.
4455 (Incremental_relocs_reader::get_r_shndx): Reformat.
4456 (Incremental_relocs_reader::get_r_offset): Reformat.
4457 (Incremental_relocs_reader::data): New function.
4458 (Incremental_binary::Incremental_binary): Initialize new data members.
4459 (Incremental_binary::check_inputs): Add cmdline parameter.
4460 (Incremental_binary::file_is_unchanged): Remove.
4461 (Input_reader::arg_serial): New function.
4462 (Input_reader::get_unused_symbol_count): New function.
4463 (Input_reader::get_unused_symbol): New function.
4464 (Input_reader::do_arg_serial): New function.
4465 (Input_reader::do_get_unused_symbol_count): New function.
4466 (Input_reader::do_get_unused_symbol): New function.
4467 (Incremental_binary::input_file_count): New function.
4468 (Incremental_binary::get_input_reader): Change signature to use
4469 index instead of filename.
4470 (Incremental_binary::file_has_changed): New function.
4471 (Incremental_binary::get_input_argument): New function.
4472 (Incremental_binary::get_library): New function.
4473 (Incremental_binary::get_script_info): New function.
4474 (Incremental_binary::init_layout): New function.
4475 (Incremental_binary::reserve_layout): New function.
4476 (Incremental_binary::output_file): New function.
4477 (Incremental_binary::do_check_inputs): New function.
4478 (Incremental_binary::do_file_is_unchanged): Remove.
4479 (Incremental_binary::do_file_has_changed): New function.
4480 (Incremental_binary::do_init_layout): New function.
4481 (Incremental_binary::do_reserve_layout): New function.
4482 (Incremental_binary::do_input_file_count): New function.
4483 (Incremental_binary::do_get_input_reader): Change signature.
4484 (Incremental_binary::input_args_map_): New data member.
4485 (Incremental_binary::library_map_): New data member.
4486 (Incremental_binary::script_map_): New data member.
4487 (Sized_incremental_binary::Sized_incremental_binary): Initialize
4488 new data members.
4489 (Sized_incremental_binary::output_section): New function.
4490 (Sized_incremental_binary::inputs_reader): Add const.
4491 (Sized_incremental_binary::symtab_reader): Add const.
4492 (Sized_incremental_binary::relocs_reader): Add const.
4493 (Sized_incremental_binary::got_plt_reader): Add const.
4494 (Sized_incremental_binary::get_symtab_view): New function.
4495 (Sized_incremental_binary::Inputs_reader): New typedef.
4496 (Sized_incremental_binary::Input_entry_reader): New typedef.
4497 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
4498 (Sized_incremental_binary::do_file_is_unchanged): Remove.
4499 (Sized_incremental_binary::do_file_has_changed): New function.
4500 (Sized_incremental_binary::do_init_layout): New function.
4501 (Sized_incremental_binary::do_reserve_layout): New function.
4502 (Sized_input_reader::Inputs_reader): Remove.
4503 (Sized_input_reader::Input_entry_reader): Remove.
4504 (Sized_input_reader::do_arg_serial): New function.
4505 (Sized_input_reader::do_get_unused_symbol_count): New function.
4506 (Sized_input_reader::do_get_unused_symbol): New function.
4507 (Sized_incremental_binary::do_input_file_count): New function.
4508 (Sized_incremental_binary::do_get_input_reader): Change signature;
4509 use index instead of filename.
4510 (Sized_incremental_binary::section_map_): New data member.
4511 (Sized_incremental_binary::input_entry_readers_): New data member.
4512 (class Sized_incr_relobj): New class.
4513 (class Sized_incr_dynobj): New class.
4514 (make_sized_incremental_object): New function.
4515 (class Incremental_library): New class.
4516 * layout.cc (Free_list::num_lists): New static data member.
4517 (Free_list::num_nodes): New static data member.
4518 (Free_list::num_removes): New static data member.
4519 (Free_list::num_remove_visits): New static data member.
4520 (Free_list::num_allocates): New static data member.
4521 (Free_list::num_allocate_visits): New static data member.
4522 (Free_list::init): New function.
4523 (Free_list::remove): New function.
4524 (Free_list::allocate): New function.
4525 (Free_list::dump): New function.
4526 (Free_list::print_stats): New function.
4527 (Layout_task_runner::run): Resize output file for incremental updates.
4528 (Layout::Layout): Initialize new data members.
4529 (Layout::set_incremental_base): New function.
4530 (Layout::init_fixed_output_section): New function.
4531 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
4532 incremental updates.
4533 (Layout::create_gold_note): Do not create gold note section for
4534 incremental updates.
4535 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
4536 for incremental updates.
4537 (Layout::set_section_offsets): For incremental updates, allocate space
4538 from free list.
4539 (Layout::create_symtab_sections): Layout with offsets relative to
4540 start of section; for incremental updates, allocate space from free
4541 list.
4542 (Layout::create_shdrs): For incremental updates, allocate space from
4543 free list.
4544 (Layout::finish_dynamic_section): For incremental updates, do not
4545 check --as-needed (fixed in subsequent patch).
4546 * layout.h (class Free_list): New class.
4547 (Layout::set_incremental_base): New function.
4548 (Layout::incremental_base): New function.
4549 (Layout::init_fixed_output_section): New function.
4550 (Layout::allocate): New function.
4551 (Layout::incremental_base_): New data member.
4552 (Layout::free_list_): New data member.
4553 * main.cc (main): Print Free_list statistics.
4554 * object.cc (Relobj::finalize_incremental_relocs): Add
4555 clear_counts parameter; clear counts only when clear_counts is set.
4556 (Sized_relobj::Sized_relobj): Initialize new base class.
4557 (Sized_relobj::do_layout): Don't report special sections.
4558 (Sized_relobj::do_for_all_local_got_entries): New function.
4559 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
4560 symtab_off to all symbol table offsets.
4561 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
4562 * object.h (class Got_offset_list): Move to top of file.
4563 (Object::Object): Allow case where input_file == NULL.
4564 (Object::~Object): Likewise.
4565 (Object::input_file): Assert that input_file != NULL.
4566 (Object::lock): Allow case where input_file == NULL.
4567 (Object::unlock): Likewise.
4568 (Object::is_locked): Likewise.
4569 (Object::token): Likewise.
4570 (Object::release): Likewise.
4571 (Object::is_incremental): New function.
4572 (Object::get_mtime): New function.
4573 (Object::for_all_local_got_entries): New function.
4574 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
4575 (Object::set_is_in_system_directory): New function.
4576 (Object::is_in_system_directory): New function.
4577 (Object::do_is_incremental): New function.
4578 (Object::do_get_mtime): New function.
4579 (Object::do_for_all_local_got_entries): New function.
4580 (Object::is_in_system_directory_): New data member.
4581 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
4582 (class Sized_relobj_base): New class.
4583 (class Sized_relobj): Derive from Sized_relobj_base.
4584 (class Sized_relobj::Symbols): Redeclare from base class.
4585 (class Sized_relobj::local_got_offset_list): Remove.
4586 (class Sized_relobj::Output_sections): Redeclare from base class.
4587 (class Sized_relobj::do_for_all_local_got_entries): New function.
4588 (class Sized_relobj::write_local_symbols): Add offset parameter.
4589 (class Sized_relobj::local_symbol_offset_): Update comment.
4590 (class Sized_relobj::local_dynsym_offset_): Update comment.
4591 * options.cc (Input_arguments::add_file): Remove const.
4592 * options.h (Input_file_argument::Input_file_argument):
4593 Initialize arg_serial_ (all constructors).
4594 (Input_file_argument::set_arg_serial): New function.
4595 (Input_file_argument::arg_serial): New function.
4596 (Input_file_argument::arg_serial_): New data member.
4597 (Input_arguments::Input_arguments): Initialize file_count_.
4598 (Input_arguments::add_file): Remove const.
4599 (Input_arguments::number_of_input_files): New function.
4600 (Input_arguments::file_count_): New data member.
4601 (Command_line::number_of_input_files): Call
4602 Input_arguments::number_of_input_files.
4603 * output.cc (Output_segment_headers::Output_segment_headers):
4604 Set current size.
4605 (Output_section::Input_section::current_data_size): New function.
4606 (Output_section::Output_section): Initialize new data members.
4607 (Output_section::add_input_section): Don't do merge sections for
4608 an incremental link; allocate space from free list for an
4609 incremental update.
4610 (Output_section::add_output_section_data): Allocate space from
4611 free list for an incremental update.
4612 (Output_section::update_data_size): New function.
4613 (Output_section::set_fixed_layout): New function.
4614 (Output_section::reserve): New function.
4615 (Output_segment::set_section_addresses): Remove const.
4616 (Output_segment::set_section_list_addresses): Remove const; allocate
4617 space from free list for an incremental update.
4618 (Output_segment::set_offset): Adjust size of RELRO segment for an
4619 incremental update.
4620 * output.h (Output_data::current_data_size): Move here from
4621 child classes.
4622 (Output_data::pre_finalize_data_size): New function.
4623 (Output_data::update_data_size): New function.
4624 (Output_section_headers::update_data_size): new function.
4625 (Output_section_data_build::current_data_size): Move to Output_data.
4626 (Output_data_strtab::update_data_size): New function.
4627 (Output_section::current_data_size): Move to Output_data.
4628 (Output_section::set_fixed_layout): New function.
4629 (Output_section::has_fixed_layout): New function.
4630 (Output_section::reserve): New function.
4631 (Output_section::update_data_size): New function.
4632 (Output_section::has_fixed_layout_): New data member.
4633 (Output_section::free_list_): New data member.
4634 (Output_segment::set_section_addresses): Remove const.
4635 (Output_segment::set_section_list_addresses): Remove const.
4636 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
4637 New function.
4638 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
4639 New function.
4640 * readsyms.cc (Read_symbols::do_read_symbols): Add library
4641 parameter when calling Add_symbols constructor; store argument
4642 serial number for members of a lib group.
4643 (Add_symbols::locks): Allow case where token == NULL.
4644 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
4645 (Read_member::~Read_member): New function.
4646 (Read_member::is_runnable): New function.
4647 (Read_member::locks): New function.
4648 (Read_member::run): New function.
4649 (Check_script::~Check_script): New function.
4650 (Check_script::is_runnable): New function.
4651 (Check_script::locks): New function.
4652 (Check_script::run): New function.
4653 (Check_library::~Check_library): New function.
4654 (Check_library::is_runnable): New function.
4655 (Check_library::locks): New function.
4656 (Check_library::run): New function.
4657 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
4658 (Add_symbols::library_): New data member.
4659 (class Read_member): New class.
4660 (class Check_script): New class.
4661 (class Check_library): New class.
4662 * reloc.cc (Read_relocs::is_runnable): Allow case where
4663 token == NULL.
4664 (Read_relocs::locks): Likewise.
4665 (Scan_relocs::locks): Likewise.
4666 (Relocate_task::locks): Likewise.
4667 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
4668 to clear counters.
4669 (Sized_relobj::incremental_relocs_scan): Fix comment.
4670 (Sized_relobj::do_relocate): Pass output file offset to
4671 write_local_symbols.
4672 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
4673 from class declaration.
4674 * script.cc (read_input_script): Allocate Script_info; pass
4675 argument serial number to report_script.
4676 * script.h (class Script_info): Move to incremental.h.
4677 * symtab.cc (Symbol_table::add_from_incrobj): New function.
4678 * symtab.h (Symbol_table::add_from_incrobj): New function.
4679 (Symbol_table::set_file_offset): New function.
4680
b961d0d7
CC
46812011-04-05 Cary Coutant <ccoutant@google.com>
4682
4683 * incremental-dump.cc (dump_incremental_inputs): Change signature
4684 to take a Sized_incremental_binary; change caller. Use readers
4685 in Sized_incremental_binary.
4686 * incremental.cc
4687 (Sized_incremental_binary::find_incremental_inputs_sections):
4688 Rename do_find_incremental_inputs_sections to this.
4689 (Sized_incremental_binary::setup_readers): New function.
4690 (Sized_incremental_binary::do_check_inputs): Check
4691 has_incremental_info_ flag; move setup code to setup_readers;
4692 use input readers.
4693 (Sized_incremental_binary::do_file_is_unchanged): New function.
4694 (Sized_incremental_binary::do_get_input_reader): New function.
4695 * incremental.h (class Incremental_binary): Move to end of file.
4696 (Incremental_binary::file_is_unchanged): New function.
4697 (Incremental_binary::do_file_is_unchanged): New function.
4698 (Incremental_binary::Input_reader): New class.
4699 (Incremental_binary::get_input_reader): New function.
4700 (class Sized_incremental_binary): Move to end of file.
4701 (Sized_incremental_binary::Sized_incremental_binary): Setup the
4702 input section reader classes.
4703 (Sized_incremental_binary::has_incremental_info): New function.
4704 (Sized_incremental_binary::inputs_reader): New function.
4705 (Sized_incremental_binary::symtab_reader): New function.
4706 (Sized_incremental_binary::relocs_reader): New function.
4707 (Sized_incremental_binary::got_plt_reader): New function.
4708 (Sized_incremental_binary::do_file_is_unchanged): New function.
4709 (Sized_incremental_binary::Sized_input_reader): New class.
4710 (Sized_incremental_binary::get_input_reader): New function.
4711 (Sized_incremental_binary::find_incremental_inputs_sections):
4712 Rename do_find_incremental_inputs_sections to this.
4713 (Sized_incremental_binary::setup_readers): New function.
4714 (Sized_incremental_binary::has_incremental_info_): New data member.
4715 (Sized_incremental_binary::inputs_reader_): New data member.
4716 (Sized_incremental_binary::symtab_reader_): New data member.
4717 (Sized_incremental_binary::relocs_reader_): New data member.
4718 (Sized_incremental_binary::got_plt_reader_): New data member.
4719 (Sized_incremental_binary::current_input_file_): New data member.
4720
a869183f
PP
47212011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
4722
4723 PR gold/12640
4724 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
4725 violation.
4726
47272011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
4728
4729 * archive.cc (Archive::include_member): Adjust call to report_object.
4730 (Add_archive_symbols::run): Add script_info to call to
4731 report_archive_begin.
4732 (Lib_group::include_member): Adjust call to report_object.
4733 (Add_lib_group_symbols::run): Adjust call to report_object.
4734 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
4735 blocks. Add object count for script input files.
4736 * incremental.cc (Incremental_inputs::report_archive_begin): Add
4737 script_info parameter; change all callers.
4738 (Incremental_inputs::report_object): Add script_info parameter;
4739 change all callers.
4740 (Incremental_inputs::report_script): Store backpointer to
4741 incremental info entry.
4742 (Output_section_incremental_inputs::set_final_data_size): Record
4743 additional information for scripts.
4744 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4745 * incremental.h (Incremental_script_entry::add_object): New function.
4746 (Incremental_script_entry::get_object_count): New function.
4747 (Incremental_script_entry::get_object): New function.
4748 (Incremental_script_entry::objects_): New data member; adjust
4749 constructor.
4750 (Incremental_inputs::report_archive_begin): Add script_info parameter.
4751 (Incremental_inputs::report_object): Add script_info parameter.
4752 (Incremental_inputs_reader::get_object_count): New function.
4753 (Incremental_inputs_reader::get_object_offset): New function.
4754 * options.cc (Input_arguments::add_file): Return reference to
4755 new input argument.
4756 * options.h (Input_argument::set_script_info): New function.
4757 (Input_argument::script_info): New function.
4758 (Input_argument::script_info_): New data member; adjust all
4759 constructors.
4760 (Input_file_group::add_file): Return reference to new input argument.
4761 (Input_file_lib::add_file): Likewise.
4762 (Input_arguments::add_file): Likewise.
4763 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
4764 * script.cc (Parser_closure::Parser_closure): Add script_info
4765 parameter; adjust all callers.
4766 (Parser_closure::script_info): New function.
4767 (Parser_closure::script_info_): New data member.
4768 (read_input_script): Report scripts earlier to incremental info.
4769 (script_add_file): Set script_info in Input_argument.
4770 (script_add_library): Likewise.
4771 * script.h (Script_options::Script_info): Rewrite class.
4772
a869183f 47732011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
4774
4775 * archive.cc (Library_base::should_include_member): Move
4776 method here from class Archive.
4777 (Archive::Archive): Initialize base class.
4778 (Archive::should_include_member): Move to base class.
4779 (Archive::do_for_all_unused_symbols): New function.
4780 (Add_archive_symbols::run): Remove redundant access to
4781 incremental_inputs.
4782 (Lib_group::Lib_group): Initialize base class.
4783 (Lib_group::do_filename): New function.
4784 (Lib_group::include_member): Pass pointer to Lib_group to
4785 report_object.
4786 (Lib_group::do_for_all_unused_symbols): New function.
4787 (Add_lib_group_symbols::run): Report archive information for
4788 incremental links.
4789 * archive.h (class Library_base): New base class.
4790 (class Archive): Derive from Library_base.
4791 (Archive::filename): Move to base class.
4792 (Archive::set_incremental_info): Likewise.
4793 (Archive::incremental_info): Likewise.
4794 (Archive::Should_include): Likewise.
4795 (Archive::should_include_member): Likewise.
4796 (Archive::Armap_entry): Remove.
4797 (Archive::Unused_symbol_iterator): Remove.
4798 (Archive::unused_symbols_begin): Remove.
4799 (Archive::unused_symbols_end): Remove.
4800 (Archive::do_filename): New function.
4801 (Archive::do_get_mtime): New function.
4802 (Archive::do_for_all_unused_symbols): New function.
4803 (Archive::task_): Move to base class.
4804 (Archive::incremental_info_): Likewise.
4805 (class Lib_group): Derive from Library_base.
4806 (Lib_group::do_filename): New function.
4807 (Lib_group::do_get_mtime): New function.
4808 (Lib_group::do_for_all_unused_symbols): New function.
4809 (Lib_group::task_): Move to base class.
4810 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
4811 function.
4812 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
4813 function.
4814 * incremental.cc (Incremental_inputs::report_archive_begin):
4815 Use Library_base; call library's get_mtime; add incremental inputs
4816 entry before members.
4817 (class Unused_symbol_visitor): New class.
4818 (Incremental_inputs::report_archive_end): Use Library_base; use
4819 visitor class to record unused symbols; don't add incremental inputs
4820 entry after members.
4821 (Incremental_inputs::report_object): Use Library_base.
4822 * incremental.h
4823 (Incremental_archive_entry::Incremental_archive_entry): Remove
4824 unused Archive parameter.
4825 (Incremental_inputs::report_archive_begin): Use Library_base.
4826 (Incremental_inputs::report_archive_end): Likewise.
4827 (Incremental_inputs::report_object): Likewise.
4828 * object.cc (Sized_relobj::do_for_all_global_symbols): New
4829 function.
4830 * object.h (Object::for_all_global_symbols): New function.
4831 (Object::do_for_all_global_symbols): New function.
4832 (Sized_relobj::do_for_all_global_symbols): New function.
4833 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
4834 function.
4835 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
4836 function.
4837
61ab3e40
ILT
48382011-03-27 Ian Lance Taylor <iant@google.com>
4839
4840 * archive.cc (Archive::interpret_header): Return -1 if something
4841 goes wrong. Change callers accordingly.
4842
30e1f9e6
CC
48432011-03-25 Cary Coutant <ccoutant@google.com>
4844
4845 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
4846 * testsuite/Makefile.in: Regenerate.
4847
9370ce59 48482011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
4849
4850 * plugin.cc (get_view): New.
4851 (Plugin::load): Pass get_view to the plugin.
4852 (Plugin_manager::get_view): New.
4853
9312bb0a
ILT
48542011-03-21 Ian Lance Taylor <iant@google.com>
4855
4856 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 4857 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 4858
7e12ba9e
ST
48592011-03-21 Sriraman Tallam <tmsriram@google.com>
4860
4861 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
4862 Change == to -eq.
4863 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
4864 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
4865 Change == to -eq.
4866 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
4867 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
4868
fd7a005d
ILT
48692011-03-14 Ian Lance Taylor <iant@google.com>
4870
4871 * script-sections.cc (Sort_output_sections::script_compare):
4872 Rename from is_before, change return type.
4873 (Sort_output_sections::operator()): Adjust accordingly.
4874
ed16fd1b
ILT
48752011-03-11 Jeffrey Yasskin <jyasskin@google.com>
4876
4877 PR gold/12572
4878 * testsuite/odr_violation2.cc: Add comment to make all error line
4879 numbers double digits.
4880 * testsuite/debug_msg.sh: Adjust expected errors.
4881
71ff8986
ILT
48822011-03-09 Jeffrey Yasskin <jyasskin@google.com>
4883
4884 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
4885 but mark earlier ones as non-canonical
4886 (offset_to_iterator): Update search target and example
4887 (do_addr2line): Return extra lines in a vector*
4888 (format_file_lineno): Extract from do_addr2line
4889 (one_addr2line): Add vector* out-param
4890 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
4891 when a lineno entry appeared last for its instruction
4892 (Dwarf_line_info): Add vector* out-param
4893 * object.cc (Relocate_info): Pass NULL for the vector* out-param
4894 * symtab.cc (Odr_violation_compare): Include the lineno in the
4895 comparison again.
4896 (linenos_from_loc): New. Combine the canonical line for an
4897 address with its other lines.
4898 (True_if_intersect): New. Helper functor to make
4899 std::set_intersection a query.
4900 (detect_odr_violations): Compare sets of lines instead of just
4901 one line for each function. This became less deterministic, but
4902 has fewer false positives.
4903 * symtab.h: Declarations.
4904 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
4905 mix an optimized and non-optimized object in the same binary
4906 (odr_violation2.so): Same.
4907 * testsuite/Makefile.in: Regenerate from Makefile.am.
4908 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
4909 * testsuite/debug_msg.sh: Update line numbers and add
4910 assertions.
4911 * testsuite/odr_violation1.cc: Use OdrDerived, in a
4912 non-optimized context.
4913 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
4914 isn't inlined, and use OdrDerived in an optimized context.
4915 * testsuite/odr_header1.h: Defines OdrDerived, where
4916 optimization will change the
4917 first-instruction-in-the-destructor's file and line number.
4918 * testsuite/odr_header2.h: Defines OdrBase.
4919
a19fefdc
ILT
49202011-03-09 Ian Lance Taylor <iant@google.com>
4921
4922 * fileread.cc (File_read::clear_views): Don't delete the whole
4923 file view.
4924
ecb351e9
ILT
49252011-03-08 Ian Lance Taylor <iant@google.com>
4926
4927 PR gold/12525
4928 * fileread.cc: #include <climits>.
4929 (GOLD_IOV_MAX): Define.
4930 (File_read::read_multiple): Limit number of entries by iov_max.
4931 * fileread.h (class File_read): Always set max_readv_entries to
4932 128.
4933
b821d13c
ILT
49342011-03-07 Ian Lance Taylor <iant@google.com>
4935
4936 PR gold/12525
4937 * options.h (class General_options): Add -dy and -dn.
4938
89243142
CC
49392011-03-02 Cary Coutant <ccoutant@google.com>
4940
4941 * testsuite/script_test_9.t: Add TLS segment.
4942
d0773f31
ILT
49432011-03-02 Simon Baldwin <simonb@google.com>
4944
4945 * configure.ac: Add check for gnu_indirect_function support in
4946 the toolchain building binutils.
4947 * configure: Rebuild.
4948
9370ce59 49492011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
4950
4951 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
4952 plugin only symbols.
4953 (Symbol_table::sized_finalize_symbol) Mark symbol only present
4954 in plugin files as not needed in the symbol table.
4955
4cf7a849
ST
49562011-02-11 Sriraman Tallam <tmsriram@google.com>
4957
4958 * output.cc (Output_section::add_input_section): Delay fill
4959 generation for section ordering.
4960
b578bd7d
ILT
49612011-02-09 Ian Lance Taylor <iant@google.com>
4962
4963 PR gold/12316
4964 * object.h (class Sized_relobj): Remove clear_local_symbols.
4965 * reloc.cc (Sized_relobj::do_relocate): Don't call
4966 clear_local_symbols.
4967
9370ce59 49682011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
4969
4970 * plugin.cc (is_visible_from_outside): Return true for symbols
4971 in the -u option.
4972
55382fb7
ILT
49732011-02-04 Jeffrey Yasskin <jyasskin@google.com>
4974
4975 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
4976 filename.
4977
4e271fff
ST
49782011-02-02 Sriraman Tallam <tmsriram@google.com>
4979
4980 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 4981 to std::string.
4e271fff 4982 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 4983 section_name to be std::string.
4e271fff
ST
4984 (is_function_ctor_or_dtor): Change type of parameter to std::string.
4985
d433c3ac
ILT
49862011-01-25 Ian Lance Taylor <iant@google.com>
4987
4988 * script.cc (script_add_extern): Rewrite to use
4989 add_symbol_reference.
4990
880473a6
DK
49912011-01-25 Doug Kwan <dougkwan@google.com>
4992
d433c3ac 4993 * icf.cc (get_section_contents): Always lock section's object.
880473a6 4994
f30f86fa
ILT
49952011-01-24 Ian Lance Taylor <iant@google.com>
4996
4997 * options.h (class General_options): Accept
4998 --no-detect-odr-violations.
4999
8e51a0b9
ILT
50002011-01-24 Ian Lance Taylor <iant@google.com>
5001
5002 * version.cc (version_string): Bump to 1.11.
5003
0f3b89d8
ILT
50042011-01-24 Ian Lance Taylor <iant@google.com>
5005
5006 * plugin.cc (class Plugin_rescan): Define new class.
5007 (Plugin_manager::claim_file): Set any_claimed_.
5008 (Plugin_manager::save_archive): New function.
5009 (Plugin_manager::save_input_group): New function.
5010 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
5011 necessary.
5012 (Plugin_manager::new_undefined_symbol): New function.
5013 (Plugin_manager::rescan): New function.
5014 (Plugin_manager::rescannable_defines): New function.
5015 (Plugin_manager::add_input_file): Set any_added_.
5016 * plugin.h (class Plugin_manager): define new fields rescannable_,
5017 undefined_symbols_, any_claimed_, and any_added_. Declare
5018 Plugin_rescan as friend. Declare new functions.
5019 (Plugin_manager::Rescannable): Define type.
5020 (Plugin_manager::Rescannable_list): Define type.
5021 (Plugin_manager::Undefined_symbol_list): Define type.
5022 (Plugin_manager::Plugin_manager): Initialize new fields.
5023 * archive.cc (Archive::defines_symbol): New function.
5024 (Add_archive_symbols::run): Pass archive to plugins if any.
5025 * archive.h (class Archive): Declare defines_symbol.
5026 * readsyms.cc (Input_group::~Input_group): New function.
5027 (Finish_group::run): Pass input_group to plugins if any.
5028 * readsyms.h (class Input_group): Declare destructor.
5029 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
5030 any.
5031
3bb951e5
ILT
50322011-01-10 Ian Lance Taylor <iant@google.com>
5033
5034 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
5035 section as relro.
5036 (Layout::set_segment_offsets): Reset increase_relro before calling
5037 set_section_addresses a second time.
5038
0aa45fac
CC
50392011-01-04 Cary Coutant <ccoutant@google.com>
5040
5041 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
5042 sections before NOBITS sections.
5043
0db46eb4
L
50442011-01-01 H.J. Lu <hongjiu.lu@intel.com>
5045
5046 * version.cc (print_version): Update copyright to 2011.
5047
829c9745
CC
50482010-12-23 Cary Coutant <ccoutant@google.com>
5049
5050 * output.h (Output_data_reloc::add_output_section): Pass OD instead
5051 of OS to this->add. Add OD parameter to second form of the function.
5052
7500420b
ILT
50532010-12-20 Ian Lance Taylor <iant@google.com>
5054
5055 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
5056 second of two consecutive entries with same offset.
5057
f8e9a930
RW
50582010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5059
5060 * testsuite/Makefile.am (ifuncmain2static_LDADD)
5061 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
5062 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
5063 to avoid unneeded links against $(LDADD).
5064 * testsuite/Makefile.in: Regenerate.
5065
2fbb4320
ILT
50662010-12-15 Ian Lance Taylor <iant@google.com>
5067
5068 PR gold/12324
5069 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
5070 for R_X86_64_32 and R_X86_64_PC32.
5071 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
5072 ver_matching_def_pic.o.
5073 (ver_matching_def_pic.o): New target.
5074
fedb228d
RW
50752010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5076
5077 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
5078 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
5079 Move definition before File_read::View member definitions.
5080 (File_read::View::~View): Initialize and hold lock before
5081 updating current_mapped_bytes.
5082
9b547ce6
RW
50832010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5084
5085 * dwarf_reader.cc: Remove outdated comment.
5086 * gold-threads.cc: Fix typo in error message.
5087 * archive.cc: Fix typos in comments.
5088 * archive.h: Likewise.
5089 * arm-reloc-property.cc: Likewise.
5090 * arm-reloc-property.h: Likewise.
5091 * arm-reloc.def: Likewise.
5092 * arm.cc: Likewise.
5093 * attributes.h: Likewise.
5094 * cref.cc: Likewise.
5095 * ehframe.cc: Likewise.
5096 * fileread.h: Likewise.
5097 * gold.h: Likewise.
5098 * i386.cc: Likewise.
5099 * icf.cc: Likewise.
5100 * incremental.h: Likewise.
5101 * int_encoding.cc: Likewise.
5102 * layout.h: Likewise.
5103 * main.cc: Likewise.
5104 * merge.h: Likewise.
5105 * object.cc: Likewise.
5106 * object.h: Likewise.
5107 * options.cc: Likewise.
5108 * readsyms.cc: Likewise.
5109 * reduced_debug_output.cc: Likewise.
5110 * reloc.cc: Likewise.
5111 * script-sections.cc: Likewise.
5112 * sparc.cc: Likewise.
5113 * symtab.h: Likewise.
5114 * target-reloc.h: Likewise.
5115 * target.cc: Likewise.
5116 * target.h: Likewise.
5117 * timer.cc: Likewise.
5118 * timer.h: Likewise.
5119 * x86_64.cc: Likewise.
5120
83e17bd5
CC
51212010-12-09 Cary Coutant <ccoutant@google.com>
5122
5123 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
5124 stack.
5125 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
5126 parameter; change all callers.
5127 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
5128 * options.h (warn_execstack): New option.
5129
017257f8
DK
51302010-12-07 Doug Kwan <dougkwan@google.com>
5131
5132 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
5133 like function call relocations.
5134
c20cbc06
ILT
51352010-12-07 Ian Lance Taylor <iant@google.com>
5136
5137 * archive.cc (Archive::get_elf_object_for_member): Permit
5138 punconfigured to be NULL.
5139 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
5140 (Archive::include_member): Pass NULL to get_elf_object_for_member
5141 if we searched for the archive and this is the first included
5142 object.
5143
4dbfafcc
ILT
51442010-12-01 Ian Lance Taylor <iant@google.com>
5145
5146 * dwarf_reader.h (class Sized_dwarf_line_info): Add
5147 track_relocs_type_ field.
5148 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5149 Set track_relocs_type_.
5150 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
5151 contents when using RELA relocs.
5152 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
5153 reloc_map_.
5154 * reloc.cc (Track_relocs::next_addend): New function.
5155 * reloc.h (class Track_relocs): Declare next_addend.
5156
e5e19edd
ILT
51572010-12-01 Ian Lance Taylor <iant@google.com>
5158
5159 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
5160 virtual destructor.
5161
9a5ce24c
ILT
51622010-12-01 Ian Lance Taylor <iant@google.com>
5163
5164 * README: Update compilers known to work and fail.
5165
c7791212
NC
51662010-11-23 Matthias Klose <doko@ubuntu.com>
5167
5168 * configure.in: For --enable-gold, handle value `default' instead of
5169 `both*'. Always install ld as ld.bfd, install as ld if gold is
5170 not the default.
5171 * configure: Regenerate.
5172
0ad220c9
DK
51732010-11-18 Doug Kwan <dougkwan@google.com>
5174
5175 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
5176 and right_alignment to be zero. Store result alignment only if it is
5177 greater than existing alignment.
5178
ab8056e0
CC
51792010-11-16 Cary Coutant <ccoutant@google.com>
5180
5181 PR gold/12220
5182 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5183 Check for ".zdebug_line".
5184
fd064a5b
CC
51852010-11-16 Doug Kwan <dougkwan@google.com>
5186 Cary Coutant <ccoutant@google.com>
5187
5188 * output.h (Output_segment::set_section_addresses): Pass increase_relro
5189 by reference; adjust all callers.
5190 * output.cc (Output_segment::set_section_addresses): Adjust references
5191 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
5192 list is empty.
5193 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
5194 end at page boundary.
5195
6fc6ea19
CC
51962010-11-16 Cary Coutant <ccoutant@google.com>
5197
5198 PR gold/12220
5199 * layout.cc (Layout::choose_output_section): Transform names of
5200 compressed sections even when using a script with a SECTIONS clause.
5201 (Layout::output_section_name): Remove code to transform
5202 compressed debug section names.
5203 * output.cc (Output_section::add_input_section): Use uncompressed
5204 section size when tracking input sections.
5205
95a2c8d6
RS
52062010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
5207
5208 * symtab.h (Symbol::NON_PIC_REF): Remove.
5209 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
5210 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
5211 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
5212 (Symbol::use_plt_offset): Take a flags argument and pass it
5213 directly to needs_dynamic_reloc. Restrict check for undefined
5214 weak symbols to function calls.
5215 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
5216 (Target_arm::Scan::global): Use it.
5217 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
5218 (Target_arm::Relocate::relocate): Likewise.
5219 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
5220 parameter with an r_type parameter. Use get_reference_flags
5221 to get the flags.
5222 (Target_arm::Relocate::relocate): Update accordingly.
5223 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
5224 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
5225 (Target_i386::Scan::global): Likewise.
5226 (Target_i386::Relocate::relocate): Likewise.
5227 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
5228 parameter with an r_type parameter. Use get_reference_flags
5229 to get the flags.
5230 (Target_i386::Relocate::relocate): Update accordingly.
5231 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
5232 (Target_powerpc::Scan::global): Use it.
5233 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
5234 (Target_powerpc::Relocate::relocate): Likewise.
5235 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
5236 (Target_sparc::Scan::global): Use it.
5237 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
5238 (Target_sparc::Relocate::relocate): Likewise.
5239 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
5240 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
5241 (Target_x86_64::Scan::global): Likewise.
5242 (Target_x86_64::Relocate::relocate): Likewise.
5243
f625ae50
DK
52442010-11-08 Doug Kwan <dougkwan@google.com>
5245 Cary Coutant <ccoutant@google.com>
5246
5247 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
5248 (Arm_exidx_merge_section::section_contents_): New data member.
5249 (Arm_input_section::Arm_input_section): Initialize original_contents_.
5250 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 5251 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
5252 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
5253 in parameters instead of calling Object::section_contents without
5254 locking.
5255 (Arm_output_section::group_section): New parameter TASK. Pass it
5256 to callees that need locking objects.
5257 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
5258 to lock EXIDX input sections. Fix a formatting issue. Call
5259 Arm_exidx_merged_section::build_contents to create merged section
5260 contents.
5261 (Arm_output_section::create_stub_group): New parameter TASK. Use it
5262 to lock object of stub table owner.
5263 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
5264 TEXT_SIZE to initialize data member TEXT_SIZE_.
5265 (Arm_exidx_input_section::addralign): Fix typo in comment.
5266 (Arm_exidx_input_section::text_size): New method.
5267 (Target_arm::do_relax): New parameter TASK. Pass it to callees
5268 that require locking objects. Lock objects before scanning for stubs
5269 and updating local symbols.
5270 (Arm_input_section<big_endian>::init): Copy contents of original
5271 input section.
2e702c99 5272 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
5273 original input section instead of calling Object::section_contents
5274 without locking.
5275 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
5276 size without calling Object::section_size().
5277 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
5278 for size. Allocate a buffer for merged EXIDX entries.
5279 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 5280 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
5281 building code to Arm_exidx_merged_section::build_contetns. Write
5282 out contetns in buffer instead of building it on the fly.
5283 (Arm_relobj::make_exidx_input_section): Also pass text section size
5284 to Arm_exidx_input_section constructor.
5285 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
5286 (Arm_dynobj::do_read_symbols): Fix memory leak.
5287 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
5288 * target.h: (class Task): Add forward declaration.
5289 (Target::relax): Add new parameter TASK and pass it to
5290 Target::do_relax().
5291 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
5292
5f9bcf58
CC
52932010-11-05 Cary Coutant <ccoutant@google.com>
5294
5295 PR gold/10708
5296 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
5297 object when reading from the file.
5298 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
5299 second layout pass.
5300 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
5301 when reading section contents.
5302 (get_section_contents): Likewise.
5303 (icf::find_identical_sections): Likewise.
5304 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
5305 object when reading from the file.
5306 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
5307 the object when doing deferred section layout.
5308
e597fa08
NC
53092010-11-03 Nick Clifton <nickc@redhat.com>
5310
5311 PR gold/12001
5312 * script.h (class Symbol_assignment: name): New member. Returns
5313 the name of the symbol.
5314 * scrfipt.cc (Script_options::is_pending_assignment): New member.
5315 Returns true if the given symbol name is on the list of
5316 assignments wating to be processed.
5317 * archive.cc (should_incldue_member): If the symbol is undefined,
5318 check to see if it is on the list of symbols pending assignment.
5319
3f9a3278
ILT
53202010-11-03 Ryan Mansfield <rmansfield@qnx.com>
5321
5322 * script-sections.cc (Script_sections::find_memory_region): Check
5323 for a NULL output section pointer.
5324
d06fb4d1
DK
53252010-10-29 Doug Kwan <dougkwan@google.com>
5326
5327 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
5328 Output_section::add_relaxed_input_section.
5329 * output.cc (Output_section::add_relaxed_input_section): Add new
5330 arguments LAYOUT and NAME. Set section order index.
5331 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5332 Copy section order index.
5333 * output.h (Output_section::add_relaxed_input_section): Add new
5334 arguments LAYOUT and NAME.
5335
90e24de5
ILT
53362010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5337
5338 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 5339 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
5340 * testsuite/Makefile.in: Regenerate.
5341
c9484ea5
DK
53422010-10-20 Doug Kwan <dougkwan@google.com>
5343
5344 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
5345 without SHF_LINK_ORDER flags.
5346 * layout.cc (Layout::choose_output_section): Do not filter
5347 SHF_LINK_ORDER flag in a relocatable link.
5348
5bc2f5be
CC
53492010-10-17 Cary Coutant <ccoutant@google.com>
5350
5351 * output.h (Output_segment::set_section_addresses): Change function
5352 signature. Update all callers.
5353 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
5354 sections.
5355 (Output_segment::set_section_addresses): Align after last TLS
5356 section. Add padding before last relro section instead of after.
5357
0c91cf04
DK
53582010-10-17 Doug Kwan <dougkwan@google.com>
5359
5360 * gold/arm.cc (Target_arm::got_section): Use correct order and set
5361 GOT output section to be writable.
5362
8c21d9d3
CC
53632010-10-14 Cary Coutant <ccoutant@google.com>
5364
5365 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
5366 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
5367 * gold.cc (queue_initial_tasks): Check parameters for incremental link
5368 mode.
5369 * incremental.cc (report_command_line): Ignore all forms of
5370 --incremental.
5371 * layout.cc (Layout::Layout): Check parameters for incremental link
5372 mode.
5373 * options.cc (General_options::parse_incremental): New function.
5374 (General_options::parse_no_incremental): New function.
5375 (General_options::parse_incremental_full): New function.
5376 (General_options::parse_incremental_update): New function.
5377 (General_options::incremental_mode_): New data member.
5378 (General_options::finalize): Check incremental_mode_.
5379 * options.h (General_options): Update help text for --incremental.
5380 Add --no-incremental, --incremental-full, --incremental-update.
5381 (General_options::Incremental_mode): New enum type.
5382 (General_options::incremental_mode): New function.
5383 (General_options::incremental_mode_): New data member.
5384 * parameters.cc (Parameters::incremental_mode_): New data member.
5385 (Parameters::set_options): Set incremental_mode_.
5386 (Parameters::set_incremental_full): New function.
5387 (Parameters::incremental): New function.
5388 (Parameters::incremental_update): New function.
5389 (set_parameters_incremental_full): New function.
5390 * parameters.h (Parameters::set_incremental_full): New function.
5391 (Parameters::incremental): New function.
5392 (Parameters::incremental_update): New function.
5393 (Parameters::incremental_mode_): New data member.
5394 (set_parameters_incremental_full): New function.
5395 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
5396 incremental link mode.
5397 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
5398 (Sized_relobj::do_relocate_sections): Likewise.
5399 * testsuite/Makefile.am (incremental_test): Use --incremental-full
5400 option.
5401 * testsuite/Makefile.in: Regenerate.
5402 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 5403
bb32aa18 54042010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
5405
5406 * script-sections.h (class Script_sections): Make
5407 Sections_elements typedef public.
5408 * script-sections.cc (class Sort_output_sections): Add elements_
5409 field. Add constructor which sets it; change all callers.
5410 (Sort_output_sections::is_before): New function.
5411 (Sort_output_sections::operator()): Call is_before.
5412 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
5413 conditional.
5414 * testsuite/script_test_10.sh: New test. Test script section
5415 order.
5416 * testsuite/script_test_10.t: Likewise.
5417 * testsuite/script_test_10.s: Likewise.
5418 * testsuite/Makefile.am: Wrap the cross linker tests and the
5419 common tests into NATIVE_OR_CROSS_LINKER.
5420 (check_SCRIPTS): Add script_test_10.sh.
5421 (check_DATA): Add script_test_10.stdout.
5422 (script_test_10.o, script_test_10): New targets.
5423 (script_test_10.stdout): New target.
5424 * configure, testsuite/Makefile.in: Regenerate.
5425
3cef7179
ILT
54262010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5427
5428 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
5429 error for the deprecated relocations.
5430 (Target_arm::Scan::global): Likewise.
5431 (Target_arm::Relocate::relocate): Likewise.
5432
7411e9a8
RS
54332010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
5434
5435 * fileread.cc (Input_file::find_file): Initialize *found_name
5436 and *namep when using the fallback search for case 4.
5437
6a9da32a
CC
54382010-10-11 Cary Coutant <ccoutant@google.com>
5439
5440 * options.h (class General_options): Redefine -z lazy as an alias for
5441 the negation of -z now.
5442
ac897c20
ILT
54432010-10-11 Ian Lance Taylor <iant@google.com>
5444
5445 * resolve.cc (symbol_to_bits): Report the value of the unsupported
5446 binding.
5447
ea5cae92
NC
54482010-10-06 Nick Clifton <nickc@redhat.com>
5449
5450 * script-sections.cc(class Memory_region): Remove
5451 current_lma_offset_ field. Rename current_vma_offset_ to
5452 current_offset_. Add last_section_ field.
5453 (Memory_region::get_current_vma_address): Rename to
5454 get_current_address.
5455 (Memory_region::get_current_lma_address): Delete.
5456 (Memory_region::increment_vma_offset): Rename to
5457 increment_offset.
5458 (Memory_region::increment_lma_offset): Delete.
5459 (Memory_region::attributes_compatible): New method. Returns
5460 true if the provided section is compatible with the region.
5461 (Memory_region::get_last_section): New method. Returns the last
5462 section to use the region.
5463 (Memory_region::set_last_section): New method. Stores the last
5464 section to use the region.
5465 (Script_sections::block_in_region): New method. Returns true if
5466 a block of memory is contained within a region.
5467 (Script_sections::find_memory_region): New method. Locates a
5468 memory region to be used to set a VMA or LMA address.
5469 (Output_section_definition::set_section_addresses): Add code to
5470 check for addresses set by memory regions.
5471 (Output_segment::set_section_addresses): Remove memory region
5472 walking code.
5473 (Script_sections::create_segment): Add a warning if a header
5474 segment is created outside of any region.
5475 * script-sections.h (class Script_sections): Add prototypes for
5476 find_memory_region and block_in_region methods.
5477 * testsuite/memory_test.s: Use .long instead of .word.
5478 * testsuite/memory_test.t: Add some more output sections.
5479 * testsuite/memory_test.sh: Update expected output.
5480
a9bfd952
DK
54812010-10-02 Doug Kwan <dougkwan@google.com>
5482
5483 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
5484 defintion to symtab.h
5485 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
5486 declaration to defintion.
5487
bacff3ab
NC
54882010-10-01 Nick Clifton <nickc@redhat.com>
5489
5490 * expression.cc (eval): Replace dummy argument with NULL.
5491 (eval_maybe_dot): Check for a NULL result section pointer.
5492 (Symbol_expression::value): Likewise.
5493 (Dot_expression::value): Likewise.
5494 (BINARY_EXPRESSION): Likewise.
5495 (Max_expression::value): Likewise.
5496 (Min_expression::value): Likewise.
5497 (Absolute_expression::value): Likewise.
5498 (Addr_expression::value_from_output_section): Likewise.
5499 (Loaddddr_expression::value_from_output_section): Likewise.
5500 (Segment_start_expression::value): Likewise.
5501 * script-sections.cc
5502 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
5503 argument with NULL.
5504 (Sections_elememt_dot_assignment::set_section_addresses):
5505 Likewise.
5506 (Output_data_expression::do_write_to_buffer): Likewise.
5507 (Output_section_definition::finalize_symbols): Likewise.
5508 (Output_section_definition::set_section_addresses): Likewise.
5509
f81bc8b5
DK
55102010-09-30 Doug Kwan <dougkwan@google.com>
5511
5512 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
5513
c95e9f27
ST
55142010-09-28 Sriraman Tallam <tmsriram@google.com>
5515
5516 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 5517 function.
c95e9f27
ST
5518 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
5519 virtual function.
5520 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
5521 virtual function.
5522 * icf.cc (get_section_contents): Inline merge sections only when
5523 target allows it.
5524
3cac54d2
RW
55252010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5526
5527 * configure: Regenerate.
5528
2904037a
ILT
55292010-09-17 Ian Lance Taylor <iant@google.com>
5530
5531 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
5532 * testsuite/Makefile.am (memory_test.o): New target.
5533 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
5534 memory_test.t.
5535 * testsuite/Makefile.in: Rebuild.
2904037a 5536
bca7fb63
DK
55372010-09-17 Doug Kwan <dougkwan@google.com>
5538
5539 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
5540 defintion if relocation uses GOT entries of the symbol.
5541 * testsuite/icf_safe_test.sh: Fix test.
5542 * testsuite/icf_safe_so_test.sh: Fix test.
5543
4ef28648
CC
55442010-09-16 Cary Coutant <ccoutant@google.com>
5545
5546 * script_sections.cc (class Memory_region): Remove "NULL" from
5547 vector initializations.
5548
793990de
CC
55492010-09-15 Cary Coutant <ccoutant@google.com>
5550
5551 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
5552 Resolve forwarding symbols.
5553
81e015e2
DK
55542010-09-15 Doug Kwan <dougkwan@google.com>
5555
5556 * gold/testsuite/script_test_3.t: Add ARM special sections.
5557 * gold/testsuite/script_test_4.t: Same.
5558 * gold/testsuite/script_test_5.t: Same.
5559 * gold/testsuite/script_test_6.t: Same.
5560 * gold/testsuite/script_test_7.t: Same.
5561 * gold/testsuite/script_test_7.t: Same.
5562 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
5563
36171d64
CC
55642010-09-14 Cary Coutant <ccoutant@google.com>
5565
5566 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
5567 (Target_x86_64::Relocate::relocate_tls): Replace check for
5568 saw_tls_block_reloc_ with test for executable section.
5569
d89051bd
CC
55702010-09-12 Cary Coutant <ccoutant@google.com>
5571
5572 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
5573 position-independent executables to shared libraries need dynamic
5574 relocations.
5575 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
5576 position-independent executables.
5577 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
5578 * testsuite/Makefile.in: Regenerate.
5579
fca41f0f
NC
55802010-09-10 Nick Clifton <nickc@redhat.com>
5581
5582 PR gold/11997
5583 * testsuite/memory_test.t: Discard any sections that are not
5584 needed.
5585
6695e4b3
L
55862010-09-09 H.J. Lu <hongjiu.lu@intel.com>
5587
5588 PR gold/11996
5589 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
5590 "This::" to work around a bug in gcc 4.2.
5591
5592 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
5593
0f72bf6f
RÁE
55942010-09-09 Rafael Espindola <espindola@google.com>
5595
5596 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
5597 sections with different PF_X flags in the same segment.
5598 (Layout::find_first_load_seg): Search all segments to find the first
5599 one.
5600 * options.h (rosegment): New.
5601
56022010-09-08 Rafael Espindola <espindola@google.com>
a6577478 5603
05a79166 5604 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 5605
aa98ff75
DK
56062010-09-08 Doug Kwan <dougkwan@google.com>
5607
5608 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
5609 (Arm_relobj::do_relocate_sections): Add new parameter for output
5610 file to match the parent.
5611 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
5612 of local symbols instead of input values. Update code to track
5613 changes in gold::relocate_section.
5614 * object.cc (Sized_relobj::compute_final_local_value): New methods.
5615 (Sized_relobj::compute_final_local_value_internal): New methods.
5616 (Sized_relobj::do_finalize_local_symbols): Move code from loop
5617 body into private version of Sized_relobj::compute_final_local_value.
5618 Call the inline method.
5619 * object.h (Symbol_value::Symbol_value): Define destructor. Free
5620 merged symbol value if there is one.
5621 (Symbol_value::has_output_value): New method defintiion.
5622 (Sized_relobj::Compute_final_local_value_status): New enum type.
5623 (Sized_relobj::compute_final_local_value): New methods.
5624 (Sized_relobj::compute_final_local_value_internal): New methods.
5625 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
5626 and arm_cortex_a8.sh.
5627 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
5628 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
5629 New tests.
5630 * Makefile.in: Regenerate.
5631 * testsuite/arm_bl_out_of_range.s: Update test.
5632 * testsuite/thumb_bl_out_of_range.s: Ditto.
5633 * testsuite/thumb_blx_out_of_range.s: Ditto.
5634 * testsuite/arm_branch_out_of_range.sh: New file.
5635 * testsuite/arm_cortex_a8.sh: Ditto.
5636 * testsuite/arm_cortex_a8_b.s: Ditto.
5637 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
5638 * testsuite/arm_cortex_a8_b_local.s: Ditto.
5639 * testsuite/arm_cortex_a8_bl.s: Ditto.
5640 * testsuite/arm_cortex_a8_blx.s: Ditto.
5641 * testsuite/arm_cortex_a8_local.s: Ditto.
5642 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
5643 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
5644
05a79166
L
56452010-09-08 Rafael Espindola <espindola@google.com>
5646
5647 * Makefile.am (memory_test.stdout): Run readelf with -W.
5648 * Makefile.in: Regenerate.
5649 * testsuite/memory_test.sh: Make the regexps accept both 32 and
5650 64 bit output.
5651
33dbc701
RÁE
56522010-09-08 Rafael Espindola <espindola@google.com>
5653
5654 * script-sections.cc (Script_sections::add_memory_region): Convert
5655 field precision to int.
5656 * script.cc (script_set_section_region, script_set_section_region):
5657 Convert field precision to int.
5658
731ca54a
RÁE
56592010-09-08 Rafael Espindola <espindola@google.com>
5660
5661 * arm.cc (do_finalize_sections): Create the __exidx_start and
5662 __exdix_end symbols even when the section is missing.
5663
7f8cd844
NC
56642010-09-08 Nick Clifton <nickc@redhat.com>
5665
5666 * README: Remove claim that MEMORY is not supported.
5667 * expression.cc (script_exp_function_origin)
5668 (script_exp_function_length): Move from here to ...
5669 * script.cc: ... here.
5670 (script_set_section_region, script_add_memory)
5671 (script_parse_memory_attr, script_include_directive): New
5672 functions.
5673 * script-sections.cc
5674 (class Memory_region): New class.
5675 (class Output_section_definition): Add set_memory_region,
5676 set_section_vma, set_section_lma and get_section_name methods.
5677 (class Script_Sections): Add add_memory_region,
5678 find_memory_region, find_memory_region_origin,
5679 find_memory_region_length and set_memory_region methods.
5680 Have set_section_addresses method walk the list of set memory
5681 regions.
5682 Extend the print methos to display memory regions.
5683 * script-sections.h: Add prototypes for new methods.
5684 Add enum for MEMORY region attributes.
5685 * yyscript.y: Add support for parsing MEMORY regions.
5686 * script-c.h: Add prototypes for new functions.
5687 * testsuite/Makefile.am: Add test of MEMORY region functionality.
5688 * testsuite/Makefile.in: Regenerate.
5689 * testsuite/memory_test.sh: New script.
5690 * testsuite/memory_test.s: New assembler source file.
5691 * testsuite/memory_test.t: New linker script.
5692
a4649286
DK
56932010-08-27 Doug Kwan <dougkwan@google.com>
5694
5695 * gold/resolve.cc (Symbol_table::should_override): Let a weak
5696 reference override an existing dynamic weak reference.
5697 * testsuite/Makefile.am: Add new test dyn_weak_ref.
5698 * testsuite/Makefile.in: Regenerate.
5699 * testsuite/dyn_weak_ref.sh: New file.
5700 * testsuite/dyn_weak_ref_1.c: Ditto.
5701 * testsuite/dyn_weak_ref_2.c: Ditto.
5702
b56648ad
ILT
57032010-08-27 Ian Lance Taylor <iant@google.com>
5704
5705 * incremental.h (class Incremental_input_entry): Add virtual
5706 destructor.
5707
809313cb
ILT
57082010-08-27 Ian Lance Taylor <iant@google.com>
5709
5710 * testsuite/start_lib_test_3.c: Mark t3 as used.
5711
11e32464
NC
57122010-08-27 Nick Clifton <nickc@redhat.com>
5713
5714 * options.cc (version_script): Fix small typo in previous
5715 whitespace tidyup.
5716
ca09d69a
NC
57172010-08-25 Nick Clifton <nickc@redhat.com>
5718
5719 * archive.cc: Formatting fixes: Remove whitespace between
5720 typename and following asterisk. Remove whitespace between
5721 function name and opening parenthesis.
5722 * archive.h: Likewise.
5723 * arm.cc: Likewise.
5724 * attributes.cc: Likewise.
5725 * attributes.h: Likewise.
5726 * common.cc: Likewise.
5727 * copy-relocs.cc: Likewise.
5728 * dirsearch.h: Likewise.
5729 * dynobj.cc: Likewise.
5730 * ehframe.cc: Likewise.
5731 * ehframe.h: Likewise.
5732 * expression.cc: Likewise.
5733 * fileread.cc: Likewise.
5734 * fileread.h: Likewise.
5735 * gc.h: Likewise.
5736 * gold-threads.cc: Likewise.
5737 * gold.cc: Likewise.
5738 * i386.cc: Likewise.
5739 * icf.h: Likewise.
5740 * incremental-dump.cc: Likewise.
5741 * incremental.cc: Likewise.
5742 * layout.cc: Likewise.
5743 * layout.h: Likewise.
5744 * main.cc: Likewise.
5745 * merge.cc: Likewise.
5746 * merge.h: Likewise.
5747 * object.cc: Likewise.
5748 * object.h: Likewise.
5749 * options.cc: Likewise.
5750 * options.h: Likewise.
5751 * output.cc: Likewise.
5752 * output.h: Likewise.
5753 * plugin.cc: Likewise.
5754 * plugin.h: Likewise.
5755 * powerpc.cc: Likewise.
5756 * reloc.cc: Likewise.
5757 * script-c.h: Likewise.
5758 * script-sections.cc: Likewise.
5759 * script.cc: Likewise.
5760 * stringpool.cc: Likewise.
5761 * symtab.cc: Likewise.
5762 * symtab.h: Likewise.
5763 * target.cc: Likewise.
5764 * timer.cc: Likewise.
5765 * timer.h: Likewise.
5766 * version.cc: Likewise.
5767 * x86_64.cc: Likewise.
5768
b8fa8750
NC
57692010-08-24 Nick Clifton <nickc@redhat.com>
5770
5771 PR 11899
5772 * layout.cc (segment_precedes): Sort segments by their physical
5773 addresses, if they have been set.
5774
9919d93b
CC
57752010-08-23 Cary Coutant <ccoutant@google.com>
5776
5777 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
5778 symbols data.
5779 (Lib_group::include_member): Unlock object after deleting its
5780 symbols data.
5781 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
5782 the bug fixed here.
5783
97b4be1c
CC
57842010-08-19 Neil Vachharajani <nvachhar@google.com>
5785 Cary Coutant <ccoutant@google.com>
5786
5787 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
5788 constructor, and set_blocker.
5789 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
5790 readsyms_blocker_.
5791 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
5792 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
5793 * testsuite/Makefile.am (start_lib_test): New test case.
5794 * testsuite/Makefile.in: Regenerate.
5795 * testsuite/start_lib_test_main.c: New file.
5796 * testsuite/start_lib_test_1.c: New file.
5797 * testsuite/start_lib_test_2.c: New file.
5798 * testsuite/start_lib_test_3.c: New file.
5799
dd0b1884
ILT
58002010-08-19 Ian Lance Taylor <iant@google.com>
5801
5802 * Makefile.in: Rebuild with automake 1.11.1.
5803 * aclocal.m4: Likewise.
5804 * testsuite/Makefile.in: Likewise.
5805
7223e9ca
ILT
58062010-08-19 Ian Lance Taylor <iant@google.com>
5807
5808 PR 10893
5809 * i386.cc (class Output_data_plt_i386): Update declarations.
5810 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
5811 local_ifuncs_ fields.
5812 (Target_i386::do_plt_section_for_global): New function.
5813 (Target_i386::do_plt_section_for_local): New function.
5814 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
5815 parameter; change all callers. Initialize global_ifuncs_ and
5816 local_ifuncs_. If doing a static link define __rel_iplt_start and
5817 __rel_iplt_end.
5818 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
5819 (Output_data_plt_i386::add_local_ifunc_entry): New function.
5820 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
5821 symbols.
5822 (Target_i386::make_plt_section): New function, broken out of
5823 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
5824 (Target_i386::make_plt_entry): Call make_plt_section.
5825 (Target_i386::make_local_ifunc_plt_entry): New function.
5826 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
5827 (Target_i386::Scan::local): Handle IFUNC symbols. Add
5828 R_386_IRELATIVE to switch.
5829 (Target_i386::Scan::global): Likewise.
5830 (Target_i386::Relocate::relocate): Likewise.
5831 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
5832 switch.
5833 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
5834 (Target_x86_64::do_plt_section_for_global): New function.
5835 (Target_x86_64::do_plt_section_for_local): New function.
5836 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
5837 parameter; change all callers. If doing a static link define
5838 __rela_iplt_start and __rela_iplt_end.
5839 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
5840 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
5841 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
5842 to point to .plt.
5843 (Target_x86_64::make_local_ifunc_plt_entry): New function.
5844 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
5845 switch.
5846 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
5847 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
5848 R_X86_64_IRELATIVE to switch.
5849 (Target_x86_64::Scan::global): Likewise.
5850 (Target_x86_64::Relocate::relocate): Likewise.
5851 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
5852 switch.
5853 * target.h (class Target): Add plt_section_for_global and
5854 plt_section_for_local functions. Add do_plt_section_for_global
5855 and do_plt_section_for_local virtual functions.
5856 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
5857 clarifying comments.
5858 (Symbol::use_plt_offset): Handle IFUNC symbol.
5859 * object.cc (Sized_relobj::Sized_relobj): Initialize
5860 local_plt_offsets_.
5861 (Sized_relobj::local_has_plt_offset): New function.
5862 (Sized_relobj::local_plt_offset): New function.
5863 (Sized_relobj::set_local_plt_offset): New function.
5864 (Sized_relobj::do_count): Handle IFUNC symbol.
5865 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
5866 a bit away from input_shndx_ field. Add set_is_func_symbol and
5867 is_ifunc_symbol functions.
5868 (class Sized_relobj): Update declarations. Remove Tls_got_entry
5869 and Local_tls_got_offsets. Define Local_plt_offsets. Add
5870 local_plt_offsets_ field.
5871 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
5872 * output.h (class Output_section_data): Add non-const
5873 output_section function.
5874 (class Output_data_got): Update declarations.
5875 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
5876 Add use_plt_offset parameter to global and local constructors.
5877 Change all callers. Change local_sym_index_ field to 31 bits.
5878 Change GSYM_CODE and CONSTANT_CODE accordingly.
5879 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
5880 doing a static link don't set sh_link field.
5881 (Output_data_got::Got_entry::write): Use PLT offset if
5882 appropriate.
5883 (Output_data_got::add_global_plt): New function.
5884 (Output_data_got::add_local_plt): New function.
5885 * target-reloc.h (relocate_section): Handle IFUNC symbol.
5886 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
5887 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
5888 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
5889 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
5890 IFUNC conditional.
5891 * testsuite/ifunc-sel.h: New file.
5892 * testsuite/ifuncmain1.c: New file.
5893 * testsuite/ifuncmain1vis.c: New file.
5894 * testsuite/ifuncmod1.c: New file.
5895 * testsuite/ifuncdep2.c: New file.
5896 * testsuite/ifuncmain2.c: New file.
5897 * testsuite/ifuncmain3.c: New file.
5898 * testsuite/ifuncmod3.c: New file.
5899 * testsuite/ifuncmain4.c: New file.
5900 * testsuite/ifuncmain5.c: New file.
5901 * testsuite/ifuncmod5.c: New file.
5902 * testsuite/ifuncmain6pie.c: New file.
5903 * testsuite/ifuncmod6.c: New file.
5904 * testsuite/ifuncmain7.c: New file.
5905 * configure, testsuite/Makefile.in: Rebuild.
5906
56f75c03
ILT
59072010-08-18 Ian Lance Taylor <iant@google.com>
5908
5909 * incremental.cc
5910 (Output_section_incremental_inputs::write_input_files): Add cast
5911 to avoid signed/unsigned comparison warning.
5912 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5913
55455f89
CC
59142010-08-12 Cary Coutant <ccoutant@google.com>
5915
5916 * common.cc (Sort_commons::operator()): Remove unnecessary code.
5917
e2054bcb
ILT
59182010-08-13 Ian Lance Taylor <iant@google.com>
5919
5920 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
5921
74f67560
DK
59222010-08-12 Cary Coutant <ccoutant@google.com>
5923 Doug Kwan <dougkwan@google.com>
5924
5925 * resolve.cc (Symbol_table::should_override): When a weak dynamic
5926 defintion overrides non-weak undef, remember that the original undef
5927 is not weak.
5928 * symtab.cc (Symbol_table::sized_write_global): For undef without
5929 an original weak binding, set binding to global in output.
5930 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
5931 * testsuite/Makefile.in: Regenerate.
5932 * testsuite/strong_ref_weak_def.sh: New file.
5933 * testsuite/strong_ref_weak_def_1.c: Ditto.
5934 * testsuite/strong_ref_weak_def_2.c: Ditto.
5935
d1238d12
CC
59362010-08-12 Cary Coutant <ccoutant@google.com>
5937
5938 * testsuite/incremental_test.sh: Rewrite.
5939 * testsuite/incremental_test_1.c: Rewrite.
5940 * testsuite/incremental_test_2.c: Rewrite.
5941
0e70b911
CC
59422010-08-12 Cary Coutant <ccoutant@google.com>
5943
5944 * arm.cc (Target_arm::got_size): Add const.
5945 (Target_arm::got_entry_count): New function.
5946 (Target_arm::plt_entry_count): New function.
5947 (Target_arm::first_plt_entry_offset): New function.
5948 (Target_arm::plt_entry_size): New function.
5949 (Output_data_plt_arm::entry_count): New function.
5950 (Output_data_plt_arm::first_plt_entry_offset): New function.
5951 (Output_data_plt_arm::get_plt_entry_size): New function.
5952 * i386.cc (Target_i386::got_size): Add const.
5953 (Target_i386::got_entry_count): New function.
5954 (Target_i386::plt_entry_count): New function.
5955 (Target_i386::first_plt_entry_offset): New function.
5956 (Target_i386::plt_entry_size): New function.
5957 (Output_data_plt_i386::entry_count): New function.
5958 (Output_data_plt_i386::first_plt_entry_offset): New function.
5959 (Output_data_plt_i386::get_plt_entry_size): New function.
5960 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
5961 find_incremental_inputs_sections. Dump incremental_got_plt section.
5962 * incremental.cc: Include target.h.
5963 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
5964 parameter. Adjust all callers. Find incremental_got_plt section.
5965 (Incremental_inputs::create_data_sections): Create incremental_got_plt
5966 section.
5967 (Output_section_incremental_inputs::set_final_data_size): Calculate
5968 size of incremental_got_plt section.
5969 (Output_section_incremental_inputs::do_write): Write the
5970 incremental_got_plt section.
5971 (Got_plt_view_info): New struct.
5972 (Local_got_offset_visitor): New class.
5973 (Global_got_offset_visitor): New class.
5974 (Global_symbol_visitor_got_plt): New class.
5975 (Output_section_incremental_inputs::write_got_plt): New function.
5976 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
5977 Add parameter. Adjust all callers.
5978 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
5979 (Incremental_inputs::got_plt_section): New function.
5980 (Incremental_inputs::got_plt_section_): New data member.
5981 (Incremental_got_plt_reader): New class.
5982 * layout.cc (Layout::create_incremental_info_sections): Add the
5983 incremental_got_plt section.
5984 * object.h (Got_offset_list::get_list): New function.
5985 (Got offset_list::for_all_got_offsets): New function.
5986 (Sized_relobj::local_got_offset_list): New function.
5987 * powerpc.cc (Target_powerpc::got_size): Add const.
5988 (Target_powerpc::got_entry_count): New function.
5989 (Target_powerpc::plt_entry_count): New function.
5990 (Target_powerpc::first_plt_entry_offset): New function.
5991 (Target_powerpc::plt_entry_size): New function.
5992 (Output_data_plt_powerpc::entry_count): New function.
5993 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
5994 (Output_data_plt_powerpc::get_plt_entry_size): New function.
5995 * sparc.cc (Target_sparc::got_size): Add const.
5996 (Target_sparc::got_entry_count): New function.
5997 (Target_sparc::plt_entry_count): New function.
5998 (Target_sparc::first_plt_entry_offset): New function.
5999 (Target_sparc::plt_entry_size): New function.
6000 (Output_data_plt_sparc::entry_count): New function.
6001 (Output_data_plt_sparc::first_plt_entry_offset): New function.
6002 (Output_data_plt_sparc::get_plt_entry_size): New function.
6003 * symtab.h (Symbol::got_offset_list): New function.
6004 (Symbol_table::for_all_symbols): New function.
6005 * target.h (Sized_target::got_entry_count): New function.
6006 (Sized_target::plt_entry_count): New function.
6007 (Sized_target::plt_entry_size): New function.
6008 * x86_64.cc (Target_x86_64::got_size): Add const.
6009 (Target_x86_64::got_entry_count): New function.
6010 (Target_x86_64::plt_entry_count): New function.
6011 (Target_x86_64::first_plt_entry_offset): New function.
6012 (Target_x86_64::plt_entry_size): New function.
6013 (Output_data_plt_x86_64::entry_count): New function.
6014 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
6015 (Output_data_plt_x86_64::get_plt_entry_size): New function.
6016
09ec0418
CC
60172010-08-12 Cary Coutant <ccoutant@google.com>
6018
6019 * archive.cc: Include incremental.h.
6020 (Archive::Archive): Initialize incremental_info_.
6021 (Archive::include_member): Record archive members in incremental info.
6022 (Add_archive_symbols::run): Record begin and end of an archive in
6023 incremental info.
6024 (Lib_group::include_member): Record objects in incremental info.
6025 * archive.h (Incremental_archive_entry): Forward declaration.
6026 (Archive::set_incremental_info): New member function.
6027 (Archive::incremental_info): New member function.
6028 (Archive::Unused_symbol_iterator): New class.
6029 (Archive::unused_symbols_begin): New member function.
6030 (Archive::unused_symbols_end): New member function.
6031 (Archive::incremental_info_): New data member.
6032 * incremental-dump.cc (find_input_containing_global): New function.
6033 (dump_incremental_inputs): Dump new incremental info sections.
6034 * incremental.cc: Include symtab.h.
6035 (Output_section_incremental_inputs): New class.
6036 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
6037 new incremental info sections.
6038 (Sized_incremental_binary::do_check_inputs): Likewise.
6039 (Incremental_inputs::report_archive): Remove.
6040 (Incremental_inputs::report_archive_begin): New function.
6041 (Incremental_inputs::report_archive_end): New function.
6042 (Incremental_inputs::report_object): New function.
6043 (Incremental_inputs::finalize_inputs): Remove.
6044 (Incremental_inputs::report_input_section): New function.
6045 (Incremental_inputs::report_script): Rewrite.
6046 (Incremental_inputs::finalize): Do nothing but finalize string table.
6047 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
6048 (Incremental_inputs::sized_create_inputs_section_data): Remove.
6049 (Incremental_inputs::create_data_sections): New function.
6050 (Incremental_inputs::relocs_entsize): New function.
6051 (Output_section_incremental_inputs::set_final_data_size): New function.
6052 (Output_section_incremental_inputs::do_write): New function.
6053 (Output_section_incremental_inputs::write_header): New function.
6054 (Output_section_incremental_inputs::write_input_files): New function.
6055 (Output_section_incremental_inputs::write_info_blocks): New function.
6056 (Output_section_incremental_inputs::write_symtab): New function.
6057 * incremental.h (Incremental_script_entry): Forward declaration.
6058 (Incremental_object_entry): Forward declaration.
6059 (Incremental_archive_entry): Forward declaration.
6060 (Incremental_inputs): Forward declaration.
6061 (Incremental_inputs_header_data): Remove.
6062 (Incremental_inputs_header): Remove.
6063 (Incremental_inputs_header_write): Remove.
6064 (Incremental_inputs_entry_data): Remove.
6065 (Incremental_inputs_entry): Remove.
6066 (Incremental_inputs_entry_write): Remove.
6067 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
6068 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
6069 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
6070 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
6071 Likewise.
6072 (Incremental_input_entry): New class.
6073 (Incremental_script_entry): New class.
6074 (Incremental_object_entry): New class.
6075 (Incremental_archive_entry): New class.
6076 (Incremental_inputs::Incremental_inputs): Initialize new data members.
6077 (Incremental_inputs::report_inputs): Remove.
6078 (Incremental_inputs::report_archive): Remove.
6079 (Incremental_inputs::report_archive_begin): New function.
6080 (Incremental_inputs::report_archive_end): New function.
6081 (Incremental_inputs::report_object): Change prototype.
6082 (Incremental_inputs::report_input_section): New function.
6083 (Incremental_inputs::report_script): Change prototype.
6084 (Incremental_inputs::get_reloc_count): New function.
6085 (Incremental_inputs::set_reloc_count): New function.
6086 (Incremental_inputs::create_data_sections): New function.
6087 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
6088 (Incremental_inputs::inputs_section): New function.
6089 (Incremental_inputs::symtab_section): New function.
6090 (Incremental_inputs::relocs_section): New function.
6091 (Incremental_inputs::get_stringpool): Add const.
6092 (Incremental_inputs::command_line): Add const.
6093 (Incremental_inputs::inputs): Remove.
6094 (Incremental_inputs::command_line_key): New function.
6095 (Incremental_inputs::input_file_count): New function.
6096 (Incremental_inputs::input_files): New function.
6097 (Incremental_inputs::relocs_entsize): New function.
6098 (Incremental_inputs::sized_create_inputs_section_data): Remove.
6099 (Incremental_inputs::finalize_inputs): Remove.
6100 (Incremental_inputs::Input_info): Remove.
6101 (Incremental_inputs::lock_): Remove.
6102 (Incremental_inputs::inputs_): Change type.
6103 (Incremental_inputs::inputs_map_): Remove.
6104 (Incremental_inputs::current_object_entry_): New data member.
6105 (Incremental_inputs::inputs_section_): New data member.
6106 (Incremental_inputs::symtab_section_): New data member.
6107 (Incremental_inputs::relocs_section_): New data member.
6108 (Incremental_inputs::reloc_count_): New data member.
6109 (Incremental_inputs_reader): New class.
6110 (Incremental_symtab_reader): New class.
6111 (Incremental_relocs_reader): New class.
6112 * layout.cc (Layout::finalize): Move finalization of incremental info
6113 and creation of incremental info sections to follow finalization of
6114 symbol table. Set offsets for postprocessing sections.
6115 (Layout::create_incremental_info_sections): Call
6116 Incremental_inputs::create_data_sections. Add incremental symtab
6117 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
6118 sections to layout after input sections.
6119 * layout.h (struct Timespec): Forward declaration.
6120 (Layout::incremental_inputs): Add const.
6121 (Layout::create_incremental_info_sections): Add parameter.
6122 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
6123 * object.cc: Include incremental.h.
6124 (Relobj::finalize_incremental_relocs): New function.
6125 (Sized_relobj::do_layout): Record input sections in incremental info.
6126 * object.h (Object::output_section): New function.
6127 (Object::output_section_offset): Moved from Relobj.
6128 (Object::get_incremental_reloc_base): New function.
6129 (Object::get_incremental_reloc_count): New function.
6130 (Object::do_output_section): New function.
6131 (Object::do_output_section_offset): Moved from Relobj.
6132 (Object::do_get_incremental_reloc_base): New function.
6133 (Object::do_get_incremental_reloc_count): New function.
6134 (Object::Object): Initialize new data members.
6135 (Relobj::output_section): Renamed do_output_section and moved to
6136 protected.
6137 (Relobj::output_section_offset): Moved to Object.
6138 (Relobj::do_get_incremental_reloc_base): New function.
6139 (Relobj::do_get_incremental_reloc_count): New function.
6140 (Relobj::allocate_incremental_reloc_counts): New function.
6141 (Relobj::count_incremental_reloc): New function.
6142 (Relobj::finalize_incremental_relocs): New function.
6143 (Relobj::next_incremental_reloc_index): New function.
6144 (Relobj::reloc_counts_): New data member.
6145 (Relobj::reloc_bases_): New data member.
6146 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
6147 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
6148 (Sized_relobj::incremental_relocs_scan): New function.
6149 (Sized_relobj::incremental_relocs_scan_reltype): New function.
6150 (Sized_relobj::incremental_relocs_write): New function.
6151 (Sized_relobj::incremental_relocs_write_reltype): New function.
6152 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
6153 incremental link.
6154 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
6155 archives and object files elsewhere.
6156 (Add_symbols::run): Report object files here.
6157 (Finish_group::run): Report end of archive at end of group.
6158 * reloc.cc: Include layout.h, incremental.h.
6159 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
6160 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
6161 (Sized_relobj::incremental_relocs_scan): New function.
6162 (Sized_relobj::incremental_relocs_scan_reltype): New function.
6163 (Sized_relobj::do_relocate_sections): Write incremental relocations.
6164 (Sized_relobj::incremental_relocs_write): New function.
6165 (Sized_relobj::incremental_relocs_write_reltype): New function.
6166 * script.cc (read_input_script): Rewrite test for incremental link.
6167 Change call to Incremental_inputs::report_script.
6168 * symtab.h (Symbol_table::first_global_index): New function.
6169 (Symbol_table::output_count): New function.
6170
ce0d1972
DK
61712010-08-12 Doug Kwan <dougkwan@google.com>
6172
6173 * arm.cc (Target_arm::merge_object_attributes): Check command line
6174 options --no-wchar-size-warning and --no-enum-size-warning.
6175 * options.h (General_options): Add ld-compatible options
6176 --no-enum-size-warning and --no-wchar-size-warning.
6177
6e5710ce
ILT
61782010-08-04 Ian Lance Taylor <iant@google.com>
6179
6180 * x86_64.cc (Target_x86_64::Scan::local): Use
6181 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
6182 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
6183 (Target_x86_64::Scan::global): Likewise.
6184 (Target_x86_64::Relocate::relocate): Likewise.
6185 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
6186 Likewise.
6187
fef830db
CC
61882010-08-03 Cary Coutant <ccoutant@google.com>
6189
6190 * merge.cc (Output_merge_string::do_add_input_section): Count strings
6191 to reserve space in merged_strings vector. Keep total input size
6192 for stats.
6193 (Output_merge_string::do_print_merge_stats): Print total input size.
6194 * merge.h (Output_merge_string): Add input_size_ field.
6195 * stringpool.cc (Stringpool_template::string_length): Move
6196 implementations out of Stringpool_template class and place in
6197 stringpool.h.
6198 * stringpool.h (string_length): Move out of Stringpool_template.
6199
1e3811b0
ILT
62002010-08-03 Ian Lance Taylor <iant@google.com>
6201
6202 PR 11712
6203 * layout.cc (relaxation_loop_body): If address of load segment is
6204 set, adjust address to include headers if possible.
6205
7af0c620
ILT
62062010-08-03 Ian Lance Taylor <iant@google.com>
6207
6208 * version.cc (version_string): Bump to 1.10.
6209
22f0da72
ILT
62102010-08-03 Ian Lance Taylor <iant@google.com>
6211
6212 PR 11805
6213 * layout.h (enum Output_section_order): Define.
6214 (class Layout): Update declarations.
6215 * layout.cc (Layout::get_output_section): Add order parameter.
6216 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
6217 is_first_non_relro parameters. Change all callers.
6218 (Layout::choose_output_section): Likewise.
6219 (Layout::add_output_section_data): Likewise.
6220 (Layout::make_output_section): Likewise. Set order.
6221 (Layout::default_section_order): New function.
6222 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
6223 * output.cc (Output_section::Output_section): Initialize order_.
6224 Don't initialize deleted fields.
6225 (Output_segment::Output_segment): Don't initialize deleted
6226 fields.
6227 (Output_segment::add_output_section_to_load): New function
6228 replacing add_output_section. Change all callers to call this or
6229 add_output_section_to_nonload.
6230 (Output_segment::add_output_section_to_nonload): New function.
6231 (Output_segment::remove_output_section): Rewrite.
6232 (Output_segment::add_initial_output_data): Likewise.
6233 (Output_segment::has_any_data_sections): Likewise.
6234 (Output_segment::is_first_section_relro): Likewise.
6235 (Output_segment::maximum_alignment): Likewise.
6236 (Output_segment::has_dynamic_reloc): New function replacing
6237 dynamic_reloc_count. Change all callers.
6238 (Output_segment::has_dynamic_reloc_list): New function replacing
6239 dynamic_reloc_count_list. Change all callers.
6240 (Output_segment::set_section_addresses): Rewrite.
6241 (Output_segment::set_offset): Rewrite.
6242 (Output_segment::find_first_and_last_list): Remove.
6243 (Output_segment::set_tls_offsets): Rewrite.
6244 (Output_segment::first_section_load_address): Likewise.
6245 (Output_segment::output_section_count): Likewise.
6246 (Output_segment::section_with_lowest_load_address): Likewise.
6247 (Output_segment::write_section_headers): Likewise.
6248 (Output_segment::print_sections_to_map): Likewise.
6249 * output.h (class Output_data): Remove dynamic_reloc_count_
6250 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
6251 (Output_data::add_dynamic_reloc): Rewrite.
6252 (Output_data::has_dynamic_reloc): New function.
6253 (Output_data::dynamic_reloc_count): Remove.
6254 (class Output_section): Add order_ field. Remvoe is_relro_local_,
6255 is_last_relro_, is_first_non_relro_, is_interp_,
6256 is_dynamic_linker_section_ fields. Add order and set_order
6257 functions. Remove is_relro_local, set_is_relro_local,
6258 is_last_relro, set_is_last_relro, is_first_non_relro,
6259 set_is_first_non_relro functions, is_interp, set_is_interp,
6260 is_dynamic_linker_section, and set_is_dynamic_linker_section
6261 functions.
6262 (class Output_segment): Change Output_data_list from std::list to
6263 std:;vector. Add output_lists_ field. Remove output_data_ and
6264 output_bss_ fields. Update declarations.
6265
3ff2ccb0
ILT
62662010-08-02 Ian Lance Taylor <iant@google.com>
6267
6268 * arm.cc (Target_arm::gc_process_relocs): Use typename.
6269 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
6270 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
6271
88a4108b
ILT
62722010-08-02 Ian Lance Taylor <iant@google.com>
6273
6274 PR 11855
6275 * script.cc (Script_options::Script_options): Initialize
6276 symbol_definitions_ and symbol_references_.
6277 (Script_options::add_symbol_assignment): Update
6278 symbol_definitions_ and symbol_references_.
6279 (Script_options::add_symbol_reference): New function.
6280 (script_symbol): New function.
6281 * script.h (class Script_options): Add symbol_definitions_ and
6282 symbol_references_ fields.
6283 (Script_options::referenced_const_iterator): New type.
6284 (Script_options::referenced_begin): New function.
6285 (Script_options::referenced_end): New function.
6286 (Script_options::is_referenced): New function.
6287 (Script_options::any_unreferenced): New function.
6288 * script-c.h (script_symbol): Declare.
6289 * yyscript.y (exp): Call script_symbol.
6290 * symtab.cc: Include "script.h".
6291 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
6292 Change all callers. Check symbols referenced by scripts.
6293 (Symbol_table::add_undefined_symbols_from_command_line): Add
6294 layout parameter. Change all callers.
6295 (Symbol_table::do_add_undefined_symbols_from_command_line):
6296 Likewise. Break out loop body. Check symbols referenced by
6297 scripts.
6298 (Symbol_table::add_undefined_symbol_from_command_line): New
6299 function broken out of
6300 do_add_undefined_symbols_from_command_line.
6301 * symtab.h (class Symbol_table): Update declarations.
6302 * archive.cc: Include "layout.h".
6303 (Archive::should_include_member): Add layout parameter. Change
6304 all callers. Check for symbol mentioned in expression.
6305 * archive.h (class Archive): Update declaration.
6306 * object.cc (Sized_relobj::do_should_include_member): Add layout
6307 parameter.
6308 * object.h (Object::should_include_member): Add layout parameter.
6309 Change all callers.
6310 (Object::do_should_include_member): Add layout parameter.
6311 (class Sized_relobj): Update declaration.
6312 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
6313 parameter.
6314 * dynobj.h (class Sized_dynobj): Update declaration.
6315 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
6316 layout parameter.
6317 * plugin.h (class Sized_pluginobj): Update declaration.
6318
5f1ab67a
ILT
63192010-08-02 Ian Lance Taylor <iant@google.com>
6320
6321 PR 11866
6322 * output.cc (Output_segment::set_offset): Search for the first and
6323 last sections rather than assuming that the list is in order.
6324 (Output_segment::find_first_and_last_list): New function.
6325 * output.h (class Output_segment): Update declarations.
6326 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
6327 (relro_strip_test_SOURCES): New variable.
6328 (relro_strip_test_DEPENDENCIES): New variable.
6329 (relro_strip_test_LDFLAGS): New variable.
6330 (relro_strip_test_LDADD): New variable.
6331 (relro_strip_test.so): New target.
6332
a8df5856
ILT
63332010-08-02 Ian Lance Taylor <iant@google.com>
6334
6335 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
6336 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
6337 (Target_i386::got_tlsdesc_section): New function.
6338 (Target_i386::got_section): Create space for GOT entries for
6339 TLSDESC relocations.
6340 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
6341 R_386_TLS_GOTDESC.
6342 (Target_i386::Scan::global): Likewise.
6343 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
6344 using TLSDESC GOT.
6345 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
6346 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
6347 (Target_x86_64::got_tlsdesc_section): New function.
6348 (Target_x86_64::got_section): Create space for GOT entries for
6349 TLSDESC relocations.
6350 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
6351 R_386_TLS_GOTDESC.
6352 (Target_x86_64::Scan::global): Likewise.
6353 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
6354 using TLSDESC GOT.
6355
0c10a0a6
ILT
63562010-08-02 Ian Lance Taylor <iant@google.com>
6357
6358 * testsuite/final_layout.sh: Use dc to convert from hex to
6359 decimal.
6360
41cbeecc
ST
63612010-07-29 Sriraman Tallam <tmsriram@google.com>
6362
6363 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
6364 paramter to the call to gold::gc_process_relocs.
6365 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
6366 paramter to the call to gold::gc_process_relocs.
6367 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
6368 parameter to the call to gold::gc_process_relocs.
6369 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
6370 template parameter to the call to gold::gc_process_relocs.
6371 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
6372 paramter to the call to gold::gc_process_relocs.
6373 * gc.h (get_embedded_addend_size): New function.
6374 (gc_process_relocs): Save the size of the reloc for use by ICF.
6375 * icf.cc (get_section_contents): Get the addend from the text section
6376 for SHT_REL relocation sections.
6377 * icf.h (Icf::Reloc_addend_size_info): New typedef.
6378 (Icf::Reloc_info): Add new member reloc_addend_size_info.
6379 * int_encoding.h (read_from_pointer): New overloaded function.
6380 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
6381 * testsuite/icf_sht_rel_addend_test.sh: New file.
6382 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
6383 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
6384
6ea55b82
RW
63852010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6386
6387 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
6388 * Makefile.in: Regenerate.
6389 * testsuite/Makefile.in: Regenerate.
6390
9691462b
ILT
63912010-07-27 Jeffrey Yasskin <jyasskin@google.com>
6392
6393 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
6394 * gold/testsuite/debug_msg.cc: Likewise.
6395 * gold/testsuite/odr_violation1.cc
6396 * gold/testsuite/odr_violation2.cc
6397
76897331
CC
63982010-07-21 Cary Coutant <ccoutant@google.com>
6399
6400 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
6401 string, and length fields.
6402 (Output_merge_string::Merged_strings_list): New type.
6403 (Output_merge_string::Merged_strings_lists): New typedef.
6404 (Output_merge_string): Replace merged_strings_ with
6405 merged_strings_lists_.
6406 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
6407 Merged_strings_list per input object and section. Don't store pointer
6408 to the string. Don't store length with each merged string entry.
6409 (Output_merge_string::finalize_merged_data): Loop over list of merged
6410 strings lists. Recompute length of each merged string.
6411
78384e8f
CC
64122010-07-15 Cary Coutant <ccoutant@google.com>
6413
6414 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
6415 here.
6416
783659f9
ILT
64172010-07-14 Ian Lance Taylor <iant@google.com>
6418
6419 * descriptors.cc (Descriptors::open): Report correct name in error
6420 message.
6421
131687b4
DK
64222010-07-13 Doug Kwan <dougkwan@google.com>
6423
6424 * arm.cc (Arm_input_section::Arm_input_section): For a
6425 SHT_ARM_EXIDX section, always keeps the input sections.
6426 (Arm_input_section::set_exidx_section_link): New method.
6427 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
6428 has_errors_ to false.
6429 (Arm_exidx_input_section::has_errors,
6430 Arm_exidx_input_section::set_has_errors): New methods.
6431 (Arm_exidx_input_section::has_errors_): New data member.
6432 (Arm_relobj::get_exidx_shndx_list): New method.
6433 (Arm_output_section::append_text_sections_to_list): Do not skip
6434 section without SHF_EXECINSTR.
6435 (Arm_output_section::fix_exidx_coverage): Skip input sections with
6436 errors.
2e702c99 6437 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
6438 section header. Make error messages more verbose. Check for
6439 a non-executable section linked to an EXIDX section.
6440 (Arm_relobj::do_read_symbols): Remove error checking, which has been
6441 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
6442 check that there is no deferred EXIDX section if we exit early.
6443 Instead of not making an EXIDX section in case of an error, make one
6444 and set the has_errors flag of it.
6445 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
6446 in a relocatable link.
6447 (Target_arm::do_relax): Look for the EXIDX output section instead of
6448 assuming that it is called .ARM.exidx.
2e702c99 6449 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
6450 section list. Do not check for SHF_EXECINSTR section flags but
6451 skip any input section with errors.
6452 * output.cc (Output_section::Output_section): Initialize
6453 always_keeps_input_sections_ to false.
6454 (Output_section::add_input_section): Check for
6455 always_keeps_input_sections_.
6456 * output.h (Output_section::always_keeps_input_sections,
6457 Output_section::set_always_keeps_input_sections): New methods.
6458 (Output_section::always_keeps_input_sections): New data member.
6459
69517287
RÁE
64602010-07-13 Rafael Espindola <espindola@google.com>
6461
6462 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
6463 * fileread.h (Input_file): Add try_extra_search_path and find_file.
6464
82742395
ILT
64652010-07-13 Philip Herron <herron.philip@googlemail.com>
6466 Ian Lance Taylor <iant@google.com>
6467
6468 * output.h (Output_section_lookup_maps::add_merge_section):
6469 Correct check of whether value was inserted.
6470 (Output_section_lookup_maps::add_merge_input_section): Likewise.
6471 (Output_section_lookup_maps::add_relaxed_input_section):
6472 Likewise.
6473 * arm.cc (Target_arm::got_section): Remove used local os.
6474 * i386.cc (Target_i386::got_section): Likewise.
6475 * x86_64.cc (Target_x86_64::got_section): Likewise.
6476 * sparc.cc (Target_sparc::got_section): Likewise.
6477 (Target_sparc::relocate): Remove unused local have_got_offset.
6478 * powerpc.cc (Target_powerpc::relocate): Likewise.
6479
f2d707b5
ILT
64802010-07-13 Ian Lance Taylor <iant@google.com>
6481
241531d6
ILT
6482 * compressed_output.cc (zlib_decompress): Fix signature in
6483 !HAVE_ZLIB_H case.
6484
f2d707b5
ILT
6485 * archive.cc (Archive::include_member): Unlock an external member
6486 of a thin archive. Don't bother to delete an object we know is
6487 NULL.
6488
a2e47362
CC
64892010-07-12 Cary Coutant <ccoutant@google.com>
6490
6491 * compressed_output.cc (zlib_decompress): New function.
6492 (get_uncompressed_size): New function.
6493 (decompress_input_section): New function.
6494 * compressed_output.h (get_uncompressed_size): New function.
6495 (decompress_input_section): New function.
6496 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
6497 Handle compressed debug sections.
6498 * layout.cc (is_compressed_debug_section): New function.
6499 (Layout::output_section_name): Map compressed section names to
6500 canonical names.
6501 * layout.h (is_compressed_debug_section): New function.
6502 (is_debug_info_section): Recognize compressed debug sections.
6503 * merge.cc: Include compressed_output.h.
6504 (Output_merge_data::do_add_input_section): Handle compressed
6505 debug sections.
6506 (Output_merge_string::do_add_input_section): Handle compressed
6507 debug sections.
6508 * object.cc: Include compressed_output.h.
6509 (Sized_relobj::Sized_relobj): Initialize new data members.
6510 (build_compressed_section_map): New function.
6511 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
6512 * object.h (Object::section_is_compressed): New method.
6513 (Object::do_section_is_compressed): New method.
6514 (Sized_relobj::Compressed_section_map): New type.
6515 (Sized_relobj::do_section_is_compressed): New method.
6516 (Sized_relobj::compressed_sections_): New data member.
6517 * output.cc (Output_section::add_input_section): Handle compressed
6518 debug sections.
6519 * reloc.cc: Include compressed_output.h.
6520 (Sized_relobj::write_sections): Handle compressed debug sections.
6521
ce279a62
CC
65222010-07-08 Cary Coutant <ccoutant@google.com>
6523
6524 * resolve.cc (Symbol_table::resolve): Remember whether undef was
6525 weak when resolving to a dynamic def.
6526 (Symbol_table::should_override): Add adjust_dyndef flag; set it
6527 for weak undef/dynamic def cases. Adjust callers.
6528 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
6529 undef_binding_weak_.
6530 (Symbol_table::sized_write_globals): Adjust symbol binding.
6531 (Symbol_table::sized_write_symbol): Add binding parameter.
6532 * symtab.h (Symbol::set_undef_binding): New method.
6533 (Symbol::is_undef_binding_weak): New method.
6534 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
6535 (Symbol_table::should_override): Add new parameter.
6536 (Symbol_table::sized_write_symbol): Add new parameter.
6537
6538 * testsuite/weak_undef_file1.cc: Add new test case.
6539 * testsuite/weak_undef_file2.cc: Fix header comment.
6540 * testsuite/weak_undef_test.cc: Add new test case.
6541
b2286c10
DK
65422010-06-29 Doug Kwan <dougkwan@google.com>
6543
6544 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
6545 Initialize USE_SYMBOL_.
6546 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
6547 definition.
6548 (Arm_reloc_property::uses_symbol_): New data member declaration.
6549 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
6550 uses symbol value and symbol is undefined but not weakly undefined.
6551
4802450a
RÁE
65522010-06-28 Rafael Espindola <espindola@google.com>
6553
6554 * plugin.cc (Plugin::load): Use dlerror.
6555
e5ca47ba
ILT
65562010-06-26 Jeffrey Yaskin <jyasskin@google.com>
6557
6558 * symtab.cc (detect_odr_violations): When reporting an ODR
6559 violation, report an object where the symbol is defined.
6560
8a75a161
DK
65612010-06-25 Doug Kwan <dougkwan@google.com>
6562
6563 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
6564 (Target_arm::section_may_have_icf_unsafe_pointers): New method
6565 definition.
6566 (Target_arm::Scan::local_reloc_may_be_function_pointer,
6567 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
6568 target hook to detect function points.
6569 (Target_arm::Scan::possible_function_pointer_reloc): New method.
6570 * icf.h (Icf::check_section_for_function_pointers): Change type of
6571 parameter SECTION_NAME to const reference to std::string. Use
6572 target hook to determine if section may have unsafe pointers.
6573 * target.h (Target::section_may_have_icf_unsafe_pointers): New
6574 method definition.
6575
42218b9f
RÁE
65762010-06-21 Rafael Espindola <espindola@google.com>
6577
6578 * fileread.cc (Input_file::find_fie): New
6579 (Input_file::open): Use Input_file::find_fie.
6580 * fileread.h (Input_file::find_fie): New
6581 * plugin.cc (set_extra_library_path): New.
6582 (Plugin::load): Add set_extra_library_path to the transfer vector.
6583 (Plugin_manager::set_extra_library_path): New.
6584 (Plugin_manager::add_input_file): Use the extra search path if set.
6585 (set_extra_library_path(): New.
6586 * plugin.h (Plugin_manager): Add set_extra_library_path and
6587 extra_search_path_.
6588
a0506cca
CC
65892010-06-19 Cary Coutant <ccoutant@google.com>
6590
6591 * layout.cc (gdb_sections): Add .debug_types.
6592 (lines_only_debug_sections): Likewise.
6593
6508b958
RÁE
65942010-06-18 Rafael Espindola <espindola@google.com>
6595
6596 * plugin.cc (add_input_file,add_input_library)
6597 (Plugin_manager::add_input_file): Make filename arguments const.
6598 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
6599 const.
6600
3e235302
DK
66012010-06-16 Doug Kwan <dougkwan@google.com>
6602
6603 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
6604 .ARM.attributes section if we have not merged any input
6605 attributes sections.
6606
106e8a6c
DK
66072010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6608
6609 * arm.cc: Allow combining objects with no EABI version
6610 information.
6611
91ff43fe
RÁE
66122010-06-15 Rafael Espindola <espindola@google.com>
6613
6614 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
6615
68ed838c
ILT
66162010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6617
6618 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
6619 (struct iovec): Correct !HAVE_READV definition.
6620
f3a2388f
CC
66212010-06-10 Cary Coutant <ccoutant@google.com>
6622
6623 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
6624 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
6625 reloc sections.
6626 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
6627
6628 PR 11683
6629 * symtab.h (Symbol::is_placeholder): New member function.
6630 * target-reloc.h (relocate_section): Check for placeholder symbols.
6631
6632 * testsuite/Makefile.am (plugin_test_8): New test.
6633 (plugin_test_9): New test.
6634 * testsuite/Makefile.in: Regenerate.
6635
e1df38aa
NC
66362010-06-09 Nick Clifton <nickc@redhat.com>
6637
6638 * yyscript.y (input_list_element): Allow strings prefixed with
6639 the '-' character. Treat these as libraries.
6640 * script.cc (script_add_library): New function. Adds a library
6641 specified by "-l<name>" found in an input script.
6642 * script-c.h: Add prototype for script_add_library.
6643
25bbe950
DK
66442010-06-07 Doug Kwan <dougkwan@google.com>
6645
6646 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
6647 Restrict stub-group size to be within long conditional branch
6648 range when working around cortex-A8 erratum.
6649
0f32ea4c
ILT
66502010-06-07 Damien Diederen <dd@crosstwine.com>
6651
6652 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
6653 #ifdef typo.
6654
8fe2a369
ST
66552010-06-03 Sriraman Tallam <tmsriram@google.com>
6656
6657 PR gold/11658
6658 * output.cc
6659 (Output_section::Input_section_sort_entry::compare_section_ordering):
6660 Change to return non-zero correctly.
6661 (Output_section::Input_section_sort_section_order_index_compare
6662 ::operator()): Change to fix ambiguity in comparisons.
6663
6e9ba2ca
ST
66642010-06-01 Sriraman Tallam <tmsriram@google.com>
6665
6666 * gold.h (is_wildcard_string): New function.
6667 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
6668 (Layout::layout_eh_frame): Ditto.
6669 (Layout::find_section_order_index): New method.
6670 (Layout::read_layout_from_file): New method.
6671 * layout.h (Layout::find_section_order_index): New method.
6672 (Layout::read_layout_from_file): New method.
6673 (Layout::input_section_position_): New private member.
6674 (Layout::input_section_glob_): New private member.
6675 * main.cc (main): Call read_layout_from_file here.
6676 * options.h (--section-ordering-file): New option.
6677 * output.cc (Output_section::input_section_order_specified_): New
6678 member.
6679 (Output_section::Output_section): Initialize new member.
6680 (Output_section::add_input_section): Add new parameter.
6681 Keep input sections when --section-ordering-file is used.
6682 (Output_section::set_final_data_size): Sort input sections when
6683 section ordering file is specified.
6684 (Output_section::Input_section_sort_entry): Add new parameter.
6685 Check sorting type.
6686 (Output_section::Input_section_sort_entry::compare_section_ordering):
6687 New method.
6688 (Output_section::Input_section_sort_compare::operator()): Change to
6689 consider section_order_index.
6690 (Output_section::Input_section_sort_init_fini_compare::operator()):
6691 Change to consider section_order_index.
6692 (Output_section::Input_section_sort_section_order_index_compare
6693 ::operator()): New method.
6694 (Output_section::sort_attached_input_sections): Change to sort
6695 according to section order when specified.
e1df38aa
NC
6696 (Output_section::add_input_section<32, true>): Add new parameter.
6697 (Output_section::add_input_section<64, true>): Add new parameter.
6698 (Output_section::add_input_section<32, false>): Add new parameter.
6699 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
6700 * output.h (Output_section::add_input_section): Add new parameter.
6701 (Output_section::input_section_order_specified): New
6702 method.
6703 (Output_section::set_input_section_order_specified): New method.
6704 (Input_section::Input_section): Initialize section_order_index_.
6705 (Input_section::section_order_index): New method.
6706 (Input_section::set_section_order_index): New method.
6707 (Input_section::section_order_index_): New member.
6708 (Input_section::Input_section_sort_section_order_index_compare): New
6709 struct.
6710 (Output_section::input_section_order_specified_): New member.
6711 * script-sections.cc (is_wildcard_string): Delete and move modified
6712 method to gold.h.
6713 (Output_section_element_input::Output_section_element_input): Modify
6714 call to is_wildcard_string.
6715 (Output_section_element_input::Input_section_pattern
6716 ::Input_section_pattern): Ditto.
6717 (Output_section_element_input::Output_section_element_input): Ditto.
6718 * testsuite/Makefile.am (final_layout): New test case.
6719 * testsuite/Makefile.in: Regenerate.
6720 * testsuite/final_layout.cc: New file.
6721 * testsuite/final_layout.sh: New file.
6722
3537c84b
RÁE
67232010-06-01 Rafael Espindola <espindola@google.com>
6724
6725 * plugin.cc (Plugin::load): Pass the output name to the plugin.
6726
105b6afd
RÁE
67272010-06-01 Rafael Espindola <espindola@google.com>
6728
6729 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
6730 visibility of symbols.
6731
29e11421
DK
67322010-05-27 Doug Kwan <dougkwan@google.com>
6733
6734 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
6735 from start of output section instead of address for a local symbol
6736 in a merged or relaxed section when doing a relocatable link.
6737
5e0f337e
RÁE
67382010-05-26 Rafael Espindola <espindola@google.com>
6739
703d02da 6740 PR 11604
5e0f337e
RÁE
6741 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
6742 adding sections the garbage collector removed.
6743 * gold/testsuite/Makefile.am: Add test.
6744 * gold/testsuite/Makefile.in: Regenerate.
6745 * gold/testsuite/plugin_test_7.sh: New.
6746 * gold/testsuite/plugin_test_7_1.c: New.
6747 * gold/testsuite/plugin_test_7_2.c: New.
6748
f4187277
RÁE
67492010-05-26 Rafael Espindola <espindola@google.com>
6750
6751 * script-sections.cc (Output_section_definition::set_section_addresses):
6752 Check for --section-start.
6753
5c388529
DK
67542010-05-26 Doug Kwan <dougkwan@google.com>
6755
6756 * arm.cc (Arm_scan_relocatable_relocs): New class.
6757 (Target_arm::relocate_special_relocatable): New method.
6758 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
6759 (Arm_relocate_functions::thumb_branch_common): Same.
6760 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
6761 instead of Default_scan_relocatable_relocs.
6762 * target-reloc.h (relocate_for_relocatable): Let target handle
6763 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
6764 * target.h (Sized_target::relocate_special_relocatable): New method.
6765
bca1c3ae
ILT
67662010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6767
6768 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
6769
0439c796
DK
67702010-05-23 Doug Kwan <dougkwan@google.com>
6771
6772 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
6773 instead of a cast.
6774 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
6775 with a direct branch, not a conditional branch, to a stub.
6776 * merge.cc (Output_merge_base::record_input_section): New method
6777 defintion.
6778 (Output_merge_data::do_add_input_section): Record input section if
6779 keeps-input-sections flag is set.
6780 (Output_merge_string::do_add_input_section): Ditto.
6781 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
6782 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
6783 INPUT_SECTIONS_.
6784 (Output_merge_base::keeps_input_sections,
6785 Output_merge_base::set_keeps_input_sections,
6786 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
6787 method definitions.
6788 (Output_merge_base::Input_sections): New type declaration.
6789 (Output_merge_base::input_sections_begin,
6790 Output_merge_base::input_sections_end,
6791 Output_merge_base::do_set_keeps_input_sections): New method definitions.
6792 (Output_merge_base::bool keeps_input_sections_,
6793 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
6794 Output_merge_base::input_sections_): New data members.
6795 (Output_merge_data::do_set_keeps_input_sections): New method
6796 defintion.
6797 (Output_merge_string::do_set_keeps_input_sections): Ditto.
6798 * output.cc (Output_section::Input_section::relobj): Move method
6799 defintion from class declaration to here and handle merge sections.
6800 (Output_section::Input_section::shndx): Ditto.
6801 (Output_section::Output_section): Remove initializations of removed
6802 data members and initialize new data member LOOKUP_MAPS_.
6803 (Output_section::add_input_section): Set keeps-input-sections flag
6804 for a newly created merge output section as appropriate. Adjust code
6805 to use Output_section_lookup_maps class.
6806 (Output_section::add_relaxed_input_section): Adjst code for lookup
6807 maps code refactoring.
2e702c99 6808 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
6809 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
6810 class. If adding input section to a newly created merge output
6811 section fails, remove the new merge section.
6812 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 6813 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 6814 (Output_section::find_merge_section): Ditto.
0439c796 6815 (Output_section::build_lookup_maps): New method defintion.
2e702c99 6816 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
6817 Output_section_lookup_maps class.
6818 (Output_section::get_input_sections): Export merge sections. Adjust
6819 code to use Output_section_lookup_maps class.
6820 (Output_section:::add_script_input_section): Adjust code to use
6821 Output_section_lookup_maps class. Update lookup maps for merge
6822 sections also.
6823 (Output_section::discard_states): Use Output_section_lookup_maps.
6824 (Output_section::restore_states): Same.
6825 * output.h (Merge_section_properties): Move class defintion out of
6826 Output_section.
6827 (Output_section_lookup_maps): New class.
6828 (Output_section::Input_section::is_merge_section): New method
6829 defintion.
6830 (Output_section::Input_section::relobj): Move defintion out of class
6831 defintion. Declare method only.
6832 (Output_section::Input_section::shndx): Ditto.
6833 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 6834 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
6835 (Output_section::Merge_section_by_properties_map,
6836 Output_section::Output_section_data_by_input_section_map,
6837 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
6838 Remove types.
2e702c99 6839 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
6840 KEEPS_INPUT_SECTIONS.
6841 (Output_section::build_lookup_maps): New method declaration.
6842 (Output_section::merge_section_map_,
6843 Output_section::merge_section_by_properties_map_,
6844 Output_section::relaxed_input_section_map_,
6845 Output_section::is_relaxed_input_section_map_valid_): Remove data
6846 members.
6847 (Output_section::lookup_maps_): New data member.
6848
76295588
L
68492010-05-21 Doug Kwan <dougkwan@google.com>
6850
6851 PR gold/11619
6852 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
6853 avoid a compilation error.
6854
d103a984
RÁE
68552010-05-19 Rafael Espindola <espindola@google.com>
6856
6857 * script-sections.cc (Output_section_definition::allocate_to_segment):
6858 Update the phdrs_list even when the output section is NULL.
6859 * testsuite/Makefile.am: Add test.
6860 * testsuite/Makefile.in: Regenerate.
6861 * testsuite/script_test_9.cc: New.
6862 * testsuite/script_test_9.sh: New.
6863 * testsuite/script_test_9.t: New.
6864
6625d24e
DK
68652010-05-19 Doug Kwan <dougkwan@google.com>
6866
6867 * arm.cc (Arm_input_section::original_size): New method.
6868 (Arm_input_section::do_addralign): Add a cast.
6869 (Arm_input_section::do_output_offset): Remove static cast.
6870 (Arm_input_section::original_addralign,
6871 Arm_input_section::original_size_): Change type to uint32_t.
6872 (Arm_input_section::init): Add safe casts for section alignment
6873 and size.
6874 (Arm_input_section::set_final_data_size): Do not set address and
6875 offset of stub table.
6876 (Arm_output_section::fix_exidx_coverage): Change use of of
6877 Output_section::Simple_input_section to that of
6878 Output_section::Input_section.
6879 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
6880 except for the first pass.
6881 * output.cc (Output_section::get_input_sections): Change type of
6882 input_sections to std::list<Input_section>.
6883 (Output_section::add_script_input_section): Rename from
6884 Output_section::add_simple_input_section. Change type of SIS
6885 parameter from Simple_input_section to Input_section.
6886 * output.h (Output_section::Simple_input_section): Remove class.
6887 (Output_section::Input_section): Change class visibility to public.
6888 (Output_section::Input_section::addralign): Use stored alignments
6889 for special input sections if set.
6890 (Output_section::Input_section::set_addralign): New method.
6891 (Output_section::get_input_sections): Change parameter type from
6892 list of Simple_input_section to list of Input_section.
6893 (Output_section::add_script_input_section): Rename from
6894 Output_section::add_simple_input_section. Change first parameter's
6895 type from Simple_input_section to Input_section and remove the
6896 second and third parameters.
6897 * script-sections.cc (Input_section::Input_section_list): Change
6898 type to list of Output_section::Input_section/
6899 (Input_section_info::Input_section_info): Change parameter type of
6900 INPUT_SECTION to Output_section::Input_section.
6901 (Input_section_info::input_section): Change return type.
6902 (Input_section_info::input_section_): Change type to
6903 Output_section::Input_section.
6904 (Output_section_element_input::set_section_addresses): Adjust code
6905 to use Output_section::Input_section instead of
6906 Output_section::Simple_input_section. Adjust code for renaming
6907 of Output_section::add_simple_input_section.
6908 (Orphan_output_section::set_section_addresses): Ditto.
6909
e1e82ea4
RW
69102010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6911
6912 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
6913 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
6914
91e75c8a
RÁE
69152010-05-18 Rafael Espindola <espindola@google.com>
6916
6917 * options.cc (General_options::finalize): Handle -nostdlib.
6918 * options.h (nostdlib): New option.
6919 * script.cc (script_add_search_dir): Handle -nostdlib.
6920
da59ad79
DK
69212010-05-12 Doug Kwan <dougkwan@google.com>
6922
6923 * arm.cc (Target_arm::do_finalize_sections): Create an empty
6924 attributes section only if there no attributes section after merging.
6925 (Target_arm::merge_object_attributes): Move value of
e1df38aa 6926 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
6927 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
6928 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
6929 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
6930 and arm_attr_merge_7.stdout.
6931 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
6932 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
6933 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
6934 arm_attr_merge_7b.o): New rules.
6935 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
6936 arm_attr_merge_7
6937 * testsuite/Makefile.in: Regenerate.
6938 * testsuite/arm_attr_merge.sh: New file.
6939 * testsuite/arm_attr_merge_[67][ab].s: Same.
6940
3e01a7fd
NC
69412010-05-05 Nick Clifton <nickc@redhat.com>
6942
6943 * po/es.po: Updated Spanish translation.
6944
7ad2014a
L
69452010-04-27 H.J. Lu <hongjiu.lu@intel.com>
6946
6947 * Makefile.am (install-exec-local): Properly install gold as
6948 default cross linker.
6949 * Makefile.in: Regenerated.
6950
4fda8867
NC
69512010-04-27 H.J. Lu <hongjiu.lu@intel.com>
6952 Nick Clifton <nickc@redhat.com>
6953
6954 * configure.ac (install_as_default): Define and set to false
6955 unless --enable-gold or --enable-gold=both/gold has been
6956 specified.
6957 * configure: Regenerate.
6958
6959 * Makefile.am (install-exec-local): Install the executable as
6960 'ld.gold'. If install_as_default is true then also install it as
6961 'ld'.
6962 * Makefile.in: Regenerated.
6963
bd288ea2
ILT
69642010-04-24 Ian Lance Taylor <iant@google.com>
6965
6966 * layout.cc (Layout::layout_reloc): In relocatable link don't
6967 combine reloc sections for grouped sections.
6968
ef38fd8a
ST
69692010-04-23 Sriraman Tallam <tmsriram@google.com>
6970
6971 * gc.h (gc_process_relocs): Pass information on relocs pointing to
6972 sections that are not ordinary to icf.
6973 * icf.cc (get_section_contents): Handle relocation pointing to section
6974 with no object or shndx information.
6975 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
6976 * testsuite/Makefile.in: Regenerate.
6977 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
6978 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
6979
f6973bdc
ILT
69802010-04-22 Ian Lance Taylor <iant@google.com>
6981
6982 * expression.cc (Expression::Expression_eval_info): Add
6983 result_alignment_pointer field.
6984 (Expression::eval_with_dot): Add result_alignment_pointer
6985 parameter. Change all callers.
6986 (Expression::eval_maybe_dot): Likewise.
6987 (class Binary_expression): Add alignment_pointer parameter to
6988 left_value and right_value. Change all callers.
6989 (BINARY_EXPRESSION): Set result alignment.
6990 (class Trinary_expression): Add alignment_pointer parameter to
6991 arg2_value and arg3_value. Change all callers.
6992 (Trinary_cond::value): Set result alignment.
6993 (Max_expression::value, Min_expression::value): Likewise.
6994 (Align_expression::value): Likewise.
6995 * script-sections.cc (class Sections_element): Add dot_alignment
6996 parameter to set_section_addresses virtual function. Update
6997 instantiations.
6998 (class Output_section_element): Likewise.
6999 (Script_sections::create_segments): Add dot_alignment parameter.
7000 Change all callers.
7001 (Script_sections::create_segments_from_phdrs_clause): Likewise.
7002 (Script_sections::set_phdrs_clause_addresses): Likewise.
7003 * script-sections.h: Update declarations.
7004 * script.h: Update declarations.
7005 * output.h (Output_segment::set_minimum_p_align): Don't decrease
7006 min_p_align.
7007 * testsuite/script_test_3.t: Set large alignment.
7008 * testsuite/script_test_3.sh: Make sure that at least one LOAD
7009 segment has expected alignment.
7010
9c9c98a5
NC
70112010-04-22 Nick Clifton <nickc@redhat.com>
7012
7013 * po/gold.pot: Updated by the Translation project.
7014 * po/vi.po: Updated Vietnamese translation.
7015
2253bfba
L
70162010-04-22 H.J. Lu <hongjiu.lu@intel.com>
7017
7018 * testsuite/Makefile.am (check_PROGRAMS): Add
7019 icf_virtual_function_folding_test.
7020 * testsuite/Makefile.in: Regenerated.
7021
85fdf906
AH
70222010-04-15 Andrew Haley <aph@redhat.com>
7023
7024 * options.h (merge_exidx_entries): New option.
7025 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
7026 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
7027 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
7028 (Target_arm::merge_exidx_entries): New function.
7029 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
7030 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
7031 to Arm_exidx_fixup constructor.
7032 Add new arg, merge_exidx_entries.
7033 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
7034 Arm_output_section::fix_exidx_coverage.
7035
ce97fa81
ST
70362010-04-18 Sriraman Tallam <tmsriram@google.com>
7037
7038 * icf.cc (get_section_contents): Check for preemptible functions.
7039 Ignore addend when appropriate.
7040 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
7041 section folded.
7042 (add_from_relobj): Check for section folded.
7043 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
7044 * symtab.h (should_add_dynsym_entry): Add new parameter.
7045 * target-reloc.h (scan_relocs): Check for section folded.
7046 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
7047 Check reloc types for function pointers in shared objects.
7048 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
7049 case.
7050 (icf_preemptible_functions_test): New test case.
7051 (icf_string_merge_test): New test case.
7052 * testsuite.Makefile.in: Regenerate.
7053 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
7054 bar_glob. Refactor code.
7055 * testsuite/icf_preemptible_functions_test.cc: New file.
7056 * testsuite/icf_preemptible_functions_test.sh: New file.
7057 * testsuite/icf_string_merge_test.cc: New file.
7058 * testsuite/icf_string_merge_test.sh: New file.
7059 * testsuite/icf_virtual_function_folding_test.cc: New file.
7060 * testsuite/icf_virtual_function_folding_test.sh: New file.
7061
04ceb17c
DK
70622010-04-14 Doug Kwan <dougkwan@google.com>
7063
7064 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
7065 for local symbol recounting if we remove a section due to ICF.
7066 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
7067 there are no regular objects in input.
7068
153e7da4
DK
70692010-04-13 Doug Kwan <dougkwan@google.com>
7070
7071 * arm.cc (Arm_input_section::set_final_data_size): Compute
7072 accurate final data size instead of using current data size.
7073
4dbd9faf
DK
70742010-04-09 Doug Kwan <dougkwan@google.com>
7075
7076 * layout.cc (Layout::choose_output_section): Handle script section
7077 types.
7078 (Layout::make_output_section_for_script): Add section type parameter.
7079 Handle script section types.
7080 * layout.h (Layout::make_output_section_for_script): Add section
7081 type parameter.
7082 * output.cc (Output_section::Output_section): Initialize data member
7083 is_noload_.
7084 (Output_section::do_reset_address_and_file_offset): Do not set address
7085 to 0 if section is a NOLOAD section.
7086 * output.h (Output_section::is_noload): New method.
7087 (Output_section::set_is_noload): Ditto.
7088 (Output_section::is_noload_): New data member.
7089 * script-c.h (Script_section_type): New enum type.
7090 (struct Parser_output_section_header): Add new file section_type.
7091 * script-sections.cc (Sections_element::output_section_name): Add
7092 parameter for returning script section type.
7093 (Output_section_definition::output_section_name): Ditto.
7094 (Output_section_definition::section_type)P; New method.
7095 (Output_section_definiton::script_section_type_name): Ditto.
7096 (Output_section_definition::script_section_type_): New data member.
7097 (Output_section_definition::Output_section_definition): Initialize
7098 data member Output_section_definition::script_section_type_.
7099 (Output_section_definition::create_sections): Pass script section type
7100 to Layout::make_output_section_for_script.
7101 (Output_section_definition::output_section_name): Return script
7102 section type to caller.
7103 (Output_section_definition::set_section_address): Do not advance
7104 dot value and load address if section type is NOLOAD. Set address
7105 of NOLOAD sections regardless of section flags.
7106 (Output_section_definition::print): Print section type if it is
7107 not SCRIPT_SECTION_TYPE_NONE.
7108 (Output_section_definition::section_type): New method.
7109 (Output_section_definition::script_section_type_name): Ditto.
7110 (Script_sections::output_section_name): Add new parameter
7111 PSECTION_TYPE for returning script section type. Pass it to
7112 section elements. Handle discard sections.
7113 (Sort_output_sections::operator()): Handle NOLOAD sections.
7114 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 7115 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
7116 returning script section type.
7117 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
7118 INFO and NOLOAD.
7119 * yyscript.y (union): Add new field SECTION_TYPE.
7120 (COPY, DSECT, INFO, NOLOAD): New tokens.
7121 (opt_address_and_section_type): Change type to output_section_header.
7122 (section_type): New non-terminal
7123 (section_header): Handle section type.
2253bfba 7124 (opt_address_and_section_type): Return section type value.
4dbd9faf 7125
721ea635
L
71262010-04-09 H.J. Lu <hongjiu.lu@intel.com>
7127
7128 * testsuite/plugin_common_test_1.c (foo): Add prototype.
7129 * testsuite/plugin_common_test_2.c (foo): Likewise.
7130
6bf924b0
DK
71312010-04-08 Doug Kwan <dougkwan@google.com>
7132
7133 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
7134 Output_merge_data.
7135 * output.cc (Output_section::add_merge_input_section): Simplify
7136 code and return status of Output_merge_base::add_input_section.
e1df38aa 7137 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
7138 returns true.
7139
24af6f92
DK
71402010-04-07 Doug Kwan <dougkwan@google.com>
7141
7142 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
7143 if section is marked as containing instructions but has no mapping
7144 symbols.
7145 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
7146 correct section index.
7147 (Arm_relobj::find_linked_text_section): Ditto.
7148
00698fc5
CC
71492010-04-07 Cary Coutant <ccoutant@google.com>
7150
7151 * archive.cc (include_member): Destroy Read_symbols_data object before
7152 releasing file.
7153 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
7154 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
7155 (Read_symbols_data::~Read_symbols_data) New destructor.
7156 (Section_relocs::Section_relocs) New constructor.
7157 (Section_relocs::~Section_relocs) New destructor.
7158 (Read_relocs_data::Read_relocs_data) New constructor.
7159 (Read_relocs_data::~Read_relocs_data) New destructor.
7160 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
7161 pointers to NULL after deleting.
7162
7296d933
DK
71632010-04-07 Doug Kwan <dougkwan@google.com>
7164
7165 * arm.cc: Replace "endianity" with "endianness" in comments.
7166 (Arm_exidx_cantunwind): Ditto.
7167 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
7168 (Arm_relobj::merge_flags_and_attributes): New method.
7169 (Arm_relobj::merge_flags_and_attributes_): New data member.
7170 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
7171 (Arm_relobj::scan_sections_for_stubs): Ditto.
7172 (Arm_relobj::do_read_symbols): Check to see if we really want to
7173 merge processor-specific flags and attributes. Exit early if
7174 an object is empty except for section names and the undefined symbol.
7175 (Target_arm::do_finalize_sections): Move check for ELF format to
7176 Arm_relobj::do_read_symbols. Merge processor specific flags and
7177 attributes from a regular object only when we have determined that
7178 it is aapropriate. Do not create an .ARM.attributes section in
7179 output if there is no regular input object.
7180 (Target_arm::merge_processor_specific_flags): Check
7181 --warn-mismatch before printing any error.
7182 (Target_arm::merge_object_attributes): Ditto.
7183 * gold.cc (queue_middle_tasks): Handle the case in which there is
7184 no regular object in input.
7185 * options.cc (General_options::parse_EB): New method.
7186 (General_options::parse_EL): Same.
7187 (General_options::General_options): Initialize endianness_.
7188 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
7189 New options.
7190 (General_options::Endianness): New enum.
7191 (General_options::endianness): New method.
7192 (General_options::endianness_): New data member.
7193 * parameters.cc (Parameters::set_options): Check target endianness.
7194 (Parameters::set_target_once): Ditto.
7195 (Parameters::check_target_endianness): New method.
7196 (parameters_force_valid_target): If either -EL or -EB is specified,
7197 use it to define endianness of default target.
7198 * parameters.h (Parameters::check_target_endianness): New method
7199 declaration.
7200 * target.h (class Target): Change "endianity" to "endianness"
7201 in comments.
7202
efc8d4f2
RW
72032010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7204
7205 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
7206 * configure: Regenerate.
7207 * Makefile.in: Regenerate.
7208 * testsuite/Makefile.in: Regenerate.
7209
be234d88
CC
72102010-04-06 Cary Coutant <ccoutant@google.com>
7211
7212 gcc PR lto/42757
7213 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
7214 prevailing definitions of common symbols.
7215 * testsuite/plugin_test_6.sh: New test case.
7216 * testsuite/plugin_common_test_1.c: New test case.
7217 * testsuite/plugin_common_test_2.c: New test case.
7218 * testsuite/Makefile.am (plugin_test_6): New test case.
7219 * testsuite/Makefile.in: Regenerate.
7220
bd32c6bd
NC
72212010-04-06 Nick Clifton <nickc@redhat.com>
7222
7223 * po/vi.po: New Vietnamese translation.
7224
323c532f
DK
72252010-03-30 Doug Kwan <dougkwan@google.com>
7226
7227 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
7228
4fcd97eb
DK
72292010-03-25 Doug Kwan <dougkwan@google.com>
7230
7231 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
7232 to avoid a conversion warning on a 32-bit host.
7233
4ebf39db
ILT
72342010-03-24 Ian Lance Taylor <iant@google.com>
7235
7236 * testsuite/script_test_3.t: Add a TLS segment.
7237 * testsuite/Makefile.am (check_PROGRAMS): Add
7238 tls_phdrs_script_test.
7239 (tls_phdrs_script_test_SOURCES): Define.
7240 (tls_phdrs_script_test_DEPENDENCIES): Define.
7241 (tls_phdrs_script_test_LDFLAGS): Define.
7242 (tls_phdrs_script_test_LDADD): Define.
7243 * testsuite/Makefile.in: Rebuild.
7244
4a599bdd
CC
72452010-03-23 Cary Coutant <ccoutant@google.com>
7246
7247 * fileread.cc (find_or_make_view): Fix comment.
7248
6c93b22c
ILT
72492010-03-23 Ian Lance Taylor <iant@google.com>
7250
7251 * script-sections.cc (class Orphan_section_placement): Define
7252 PLACE_TLS and PLACE_TLS_BSS.
7253 (Orphan_section_placement::Orphan_section_placement): Initialize
7254 new places.
7255 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
7256 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
7257 (tls_script_test_SOURCES): Define.
7258 (tls_script_test_DEPENDENCIES): Define.
7259 (tls_script_test_LDFLAGS): Define.
7260 (tls_script_test_LDADD): Define.
7261 * testsuite/Makefile.in: Rebuild.
7262
a2c7281b
DK
72632010-03-22 Doug Kwan <dougkwan@google.com>
7264
7265 * arm.cc (Arm_relocate_functions::abs8,
7266 Arm_relocate_functions::abs16): Use correct check for overflow
7267 specified in the ARM ELF specs.
7268 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
7269 target of a BLX instruction specially.
7270 (Reloc_stub::stub_type_for_reloc): Ditto.
7271 (Relocate::relocate): Use symbolic names instead of numeric relocation
7272 codes to report error.
7273 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
7274 workaround.
7275 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
7276 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
7277 thumb2_blx_out_of_range.stdout
7278 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
7279 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
7280 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
7281 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
7282 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
7283 thumb2_blx_in_range, thumb2_blx_in_range.o,
7284 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
7285 thumb2_blx_out_of_range.o): New rules.
2e702c99 7286 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
7287 thumb2_blx_in_range and thumb2_blx_out_of_range.
7288 * testsuite/Makefile.in: Regenerate.
7289 * arm_branch_in_range.sh: Add tests for THUMB BLX.
7290 * testsuite/thumb_blx_in_range.s: New file.
7291 * testsuite/thumb_blx_out_of_range.s: New file.
7292
b0193076
RÁE
72932010-03-22 Rafael Espindola <espindola@google.com>
7294
7295 * archive.cc (Should_include): Move to archive.h.
7296 (should_include_member): Make it a member of Archive.
7297 (Lib_group): New.
7298 (Add_lib_group_symbols): New.
7299 * archive.h: Include options.h.
7300 (Archive_member): Moved from Archive.
7301 (Should_include): Moved from archive.cc.
7302 (Lib_group): New.
7303 (Add_lib_group_symbols): New.
7304 * dynobj.cc (do_should_include_member): New.
7305 * dynobj.h (do_should_include_member): New.
7306 * gold.cc (queue_initial_tasks): Update call to queue.
7307 * main.cc (main): Print lib group stats.
7308 * object.cc (do_should_include_member): New.
7309 * object.h: Include archive.h.
7310 (Object::should_include_member): New.
7311 (Object::do_should_include_member): New.
7312 (Sized_relobj::do_should_include_member): New.
7313 * options.cc (General_options::parse_start_lib): New.
7314 (General_options::parse_end_lib): New.
7315 (Input_arguments::add_file): Handle lib groups.
7316 (Input_arguments::start_group): Check we are not in a lib.
7317 (Input_arguments::start_lib): New.
7318 (Input_arguments::end_lib): New.
7319 * options.h (General_options): Add start_lib and end_lib.
7320 (Input_argument::lib_): New.
7321 (Input_argument::lib): New.
7322 (Input_argument::is_lib): New.
7323 (Input_file_lib): New.
7324 (Input_arguments::in_lib_): New.
7325 (Input_arguments::in_lib): New.
7326 (Input_arguments::start_lib): New.
7327 (Input_arguments::end_lib_): New.
7328 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
7329 in unused members as preempted.
7330 (Sized_pluginobj::do_should_include_member): New.
7331 * plugin.h (Sized_pluginobj::do_should_include_member): New.
7332 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
7333 return the blocker.
7334 (Read_symbols::do_whole_lib_group): New.
7335 (Read_symbols::do_lib_group): New.
7336 (Read_symbols::do_read_symbols): Handle lib groups.
7337 (Read_symbols::get_name): Handle lib groups.
7338 * readsyms.h (Read_symbols): Add an archive member pointer.
7339 (Read_symbols::do_whole_lib_group): New.
7340 (Read_symbols::do_lib_group): New.
7341 (Read_symbols::member_): New.
7342 * script.cc (read_input_script): Update call to queue_soon.
7343
d099120c
DK
73442010-03-19 Doug Kwan <dougkwan@google.com>
7345
7346 * arm.cc (Stub_table::Stub_table): Initialize new data members
7347 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
7348 (Stub_table::add_reloc_stub): Assign stub offset and update
7349 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
7350 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
7351 New data members.
2e702c99 7352 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
7353 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
7354 instead of going over all reloc stubs.
2e702c99 7355 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
7356 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
7357 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 7358 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
7359 Stringpool_template::offset_.
7360 * stringpool.h (Stringpool_template::set_no_zero_null): Set
7361 Stringpool_template::offset_ to zero.
7362
1aa37384
DK
73632010-03-15 Doug Kwan <dougkwan@google.com>
7364
7365 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
7366 offset_.
7367 (Stringpool_template::new_key_offset): New method.
7368 (Stringpool_template::add_string): Assign offsets when adding new
7369 strings.
7370 (Stringpool_template::set_string_offsets): Do not set string offsets
7371 when not optimizing.
7372 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
7373 member size_.
2e702c99
RM
7374 (Chunked_vector::clear): Clear size_.
7375 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
7376 (Chunked_vector::size): Return size_.
7377 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 7378 (Chunked_vector::size_): New data member.
1aa37384
DK
7379 (Stringpool_template::set_no_zero_null): Assert string set is empty.
7380 (Stringpool_template::new_key_offset): New method declaration.
7381 (Stringpool_template::offset_): New data member.
7382
b672b057
RÁE
73832010-03-15 Rafael Espindola <espindola@google.com>
7384
7385 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
7386 Add_symbols' constructor.
7387 * readsyms.h (Add_symbols): Remove the input_group member.
7388
b6848d3c
ILT
73892010-03-10 Ian Lance Taylor <iant@google.com>
7390
7391 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
7392 target to ask whether a reference to a symbol requires a stack
7393 split.
7394 * target.h (Target::is_call_to_non_split): New function.
7395 (Target::do_is_call_to_non_split): Declare virtual function.
7396 * target.cc: Include "symtab.h".
7397 (Target::do_is_call_to_non_split): New function.
7398 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
7399
a2a5469e
CC
74002010-03-10 Cary Coutant <ccoutant@google.com>
7401
7402 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
7403 (File_read::open[1]): Remove initial mapping of whole_file_view_.
7404 (File_read::open[2]): Add whole_file_view_ to list of views.
7405 (File_read::make_view): Remove test of whole_file_view_.
7406 (File_read::find_or_make_view): Create whole_file_view_ if
7407 necessary.
7408 (File_read::clear_views): Replace bool parameter with enum;
7409 adjust all callers. Don't delete views with permanent data;
7410 do delete cached views and views from archives if
7411 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
7412 if clearing the corresponding view.
7413 * fileread.h (File_read::Clear_views_mode): New enum.
7414 (File_read::View::is_permanent_view): New method.
7415 (File_read::clear_views): Replace bool parameter
7416 with enum; adjust all callers.
7417 * options.h (General_options): Change keep_files_mapped option;
7418 add map_whole_files.
7419 * readsyms.cc (Add_symbols::run): Delete sd_ object before
7420 releasing the file.
7421 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
7422 the file.
7423
8861f32b
DM
74242010-03-10 David S. Miller <davem@davemloft.net>
7425
7426 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
7427
d62d0f5f
ST
74282010-03-09 Sriraman Tallam <tmsriram@google.com>
7429
7430 * icf.cc (get_section_contents): Add '@' marker after processing the
7431 merge reloc.
7432
9177756d
DK
74332010-03-08 Doug Kwan <dougkwan@google.com>
7434
7435 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
7436 due to a conversion warning.
7437 (Arm_relobj::update_output_local_symbol_count): Check for local
7438 symbol with unset output index.
7439
9e9e071b
ILT
74402010-03-05 Ian Lance Taylor <iant@google.com>
7441
7442 * options.h (class General_options): Add --spare-dynamic-tags.
7443 * output.cc (Output_data_dynamic::set_final_data_size): Implement
7444 --spare-dynamic-tags.
7445
a81ee015
ILT
74462010-03-05 Ian Lance Taylor <iant@google.com>
7447
7448 * incremental.cc: Include "libiberty.h".
7449
44ec90b9
RO
74502010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
7451
7452 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
7453 function, is_info_ member.
7454 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
7455 (Versions::Versions): Update caller.
7456 (Versions::define_base_version): Likewise.
7457 (Versions::add_def): Likewise.
7458
0897ed3b
ST
74592010-03-03 Sriraman Tallam <tmsriram@google.com>
7460
7461 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
7462 (Scan::possible_function_pointer_reloc): New function.
7463 (Scan::local_reloc_may_be_function_pointer): Change to call
7464 possible_function_pointer_reloc.
7465 (Scan::global_reloc_may_be_function_pointer): Ditto.
7466 * icf.h (Icf::check_section_for_function_pointers): Change to reject
7467 relocations in ".data.rel.ro._ZTV" section.
7468 * testsuite/icf_safe_so_test.sh: Change to pass i386.
7469 * testsuite/icf_safe_so_test.cc: Ditto.
7470 * testsuite/icf_safe_test.cc: Ditto.
7471 * testsuite/icf_safe_test.sh: Ditto.
7472
d3bbad62
ILT
74732010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7474 Ian Lance Taylor <iant@google.com>
7475
7476 * target-reloc.h (relocate_section): Check the symbol table index
7477 for -1U before setting the local symbol index.
7478 (scan_relocatable_relocs): If copying the relocation, record that
7479 the local symbol is required.
7480 * object.h (Symbol_value::is_output_symtab_index_set): New
7481 function.
7482 (Symbol_value::may_be_discarded_from_output_symtab): New
7483 function.
7484 (Symbol_value::has_output_symtab_entry): New function.
7485 (Symbol_value::needs_output_symtab_entry): Remove.
7486 (Symbol_value::output_symtab_index): Make sure the symbol index is
7487 set.
7488 (Symbol_value::set_output_symtab_index): Make sure the symbol
7489 index is not set. Make sure the new index is valid.
7490 (Symbol_value::set_must_have_output_symtab_entry): New function.
7491 (Symbol_value::has_output_dynsym_entry): New function.
7492 (Symbol_value::set_output_dynsym_index): Make sure the new index
7493 is valid.
7494 (Sized_relobj::set_must_have_output_symtab_entry): New function.
7495 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
7496 local symbol if permitted.
7497 (Sized_relobj::do_finalize_local_symbols): Call
7498 is_output_symtab_index_set rather than needs_output_symtab_entry.
7499 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
7500 rather than needs_output_symtab_entry. Call
7501 has_output_dynsym_entry rather than needs_output_dynsym_entry.
7502 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
7503 is_output_symtab_index_set rather than needs_output_symtab_entry.
7504 * testsuite/discard_locals_relocatable_test.c: New file.
7505 * testsuite/discard_locals_test.sh: Test -r.
7506 * testsuite/Makefile.am (check_DATA): Add
7507 discard_locals_relocatable_test1.syms,
7508 discard_local_relocatable_test2.syms.
7509 (MOSTLYCLEANFILES): Likewise. Also add
7510 discard_locals_relocatable_test1.lout and
7511 discard_locals_relocatable_test2.out.
7512 (discard_locals_relocatable_test1.syms): New target.
7513 (discard_locals_relocatable_test.o): New target.
7514 (discard_locals_relocatable_test1.out): New target.
7515 (discard_locals_relocatable_test2.syms): New target.
7516 (discard_locals_relocatable_test2.out): New target.
7517 (various): Add missing ../ld-new dependencies.
7518 * testsuite/Makefile.in: Rebuild.
7519
7e8ccf26
NC
75202010-03-03 Nick Clifton <nickc@redhat.com>
7521
7522 * po/fi.po: New Finnish translation.
7523
2a0ff005
DK
75242010-03-01 Doug Kwan <dougkwan@google.com>
7525
7526 * layout.cc (Layout::Layout): Force section types of .init_array*,
7527 .preinit_array* and .fini_array* sections.
7528 * output.cc (Output_section::Input_section_sort_entry::has_priority):
7529 Fix check of return value of std::string::find.().
7530 (Output_section::Input_section_sort_compare::operator()): Remove
7531 comment about .init_array.
7532 (Output_section::Input_section_sort_init_fini_compare::operator()):
7533 New method.
7534 (Output_section::sort_attached_input_sections): Handle .init_array
7535 and .fini_array specially.
7536 * output.h (Output_section::Inut_section_sort_compare): Update
7537 comment.
7538 (Output_section::Input_section_sort_init_fini_compare): New struct.
7539
c3e4ae29
DK
75402010-02-26 Doug Kwan <dougkwan@google.com>
7541
7542 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
7543 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
7544 * testsuite/debug_msg.sh: Avoid matching source line number for
7545 use of global variable undef_int.
7546
2fd9ae7a
DK
75472010-02-26 Doug Kwan <dougkwan@google.com>
7548
7549 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
7550 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
7551 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
7552 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
7553 * options.cc (General_options::General_options): Initialize member
7554 fix_v4bx_.
7555 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
7556 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
7557 and rm_no_fix_v4bx.stdout
7558 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
7559 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
7560 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
7561 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
7562 and arm_no_fix_v4bx.
7563 * Makefile.in: Regenerate.
7564 * testsuite/arm_fix_v4bx.s: New file.
7565 * testsuite/arm_fix_v4bx.sh: Ditto.
7566
67ec7d0b
DK
75672010-02-24 Doug Kwan <dougkwan@google.com>
7568
7569 * arm.cc (Target_arm::got_section): Make the .got section the first
7570 non RELRO section in the data segment.
7571 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
7572 suffixes of section names.
7573
10165461
DK
75742010-02-24 Doug Kwan <dougkwan@google.com>
7575
7576 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
7577 flags and attributes merging if an input file is a binary file.
7578 * fileread.cc (Input_file::open): Record format of original file.
7579 * fileread.h (Input_file::Format): New enum type.
2e702c99 7580 (Input_file::Input_file): Initialize data member format_.
10165461
DK
7581 (Input_file::format): New method definition.
7582 (Input_file::format_):: New data member.
7583
4a54abbb
DK
75842010-02-24 Doug Kwan <dougkwan@google.com>
7585
7586 * arm.cc (Arm_output_data_got): New class.
7587 (ARM_TCB_SIZE): New constant
7588 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
7589 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
7590 If user uses a script with a SECTIONS clause, issue only a warning
7591 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 7592 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
7593 garbage collection.
7594 (Target_arm::got_mode_index_entry): Handle static linking.
7595 (Target_arm::Scan::local): Ditto.
7596 (Target_arm::Scan::global): Ditto.
7597 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
7598 all incorrectly implemented relocations.
e1df38aa 7599 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
7600 Arm_output_section::fix_exidx_coverage.
7601 * layout.cc (Layout::section_name_mapping): Remove trailing dots
7602 from ".ARM.exidx." and ".ARM.extab.".
7603
ca419a6f
ILT
76042010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7605
7606 * arm.cc (Target_arm::do_finalize_sections): Create attribute
7607 section if it does not already exist.
7608 * attributes.cc (Attributes_section_data::Attributes_section_data):
7609 Don't crash if size is zero.
7610
135b9c78
ILT
76112010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7612 Ian Lance Taylor <iant@google.com>
7613
7614 * gold.cc (queue_middle_tasks): If no input files were opened,
7615 exit.
7616 * workqueue.h (Task_function::Task_function): Assert that there is
7617 a blocker.
7618
bb0bfe4f
DK
76192010-02-22 Doug Kwan <dougkwan@google.com>
7620
7621 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
7622 * icf.cc (get_section_contents): Cast snprintf arguments to long long
7623 types to avoid warnings due to different uint64_t implementations
7624 on different hosts.
7625
2a2b6d42
DK
76262010-02-21 Doug Kwan <dougkwan@google.com>
7627
7628 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
7629 handling of the maximum backward branch offset.
2e702c99 7630 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
7631 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
7632 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 7633 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
7634 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
7635 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
7636 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
7637 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
7638 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
7639 thumb_bl_out_of_range thumb_bl_out_of_range.o,
7640 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
7641 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
7642 thumb2_bl_out_of_range.o): New rules.
7643 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
7644 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
7645 thumb2_bl_out_of_range
7646 * testsuite/Makefile.in: Regenerate.
7647 * testsuite/arm_bl_in_range.s: New file.
7648 * testsuite/arm_bl_out_of_range.s: Ditto.
7649 * testsuite/arm_branch_in_range.sh: Ditto.
7650 * testsuite/arm_branch_range.t: Ditto.
7651 * testsuite/thumb2_branch_range.t: Ditto.
7652 * testsuite/thumb_bl_in_range.s: Ditto.
7653 * testsuite/thumb_bl_out_of_range.s: Ditto.
7654 * testsuite/thumb_branch_range.t: Ditto.
7655
b487ad64
ST
76562010-02-20 Sriraman Tallam <tmsriram@google.com>
7657
7658 * gc.h (gc_process_relocs): Change vectors to point to the new list.
7659 Add reloc offset information.
7660 * icf.cc (get_section_contents): Change iterators to point to the new
7661 vectors. Add reloc offset information to the contents.
7662 * icf.h (Icf::Sections_reachable_info): New typedef.
7663 (Icf::Sections_reachable_list): New typedef.
7664 (Icf::Offset_info): New typedef.
7665 (Icf::Reloc_info): New struct typedef.
7666 (Icf::Reloc_info_list): New typedef.
7667 (Icf::symbol_reloc_list): Delete method.
7668 (Icf::addend_reloc_list): Delete method.
7669 (Icf::section_reloc_list): Delete method.
7670 (Icf::reloc_info_list): New method.
7671 (Icf::reloc_info_list_): New member.
7672
f96accdf
DK
76732010-02-19 Doug Kwan <dougkwan@google.com>
7674
7675 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
7676 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
7677 * arm.cc (Arm_relocation_functions): New forward declaration.
7678 (Target_arm::Target_arm): Initialize new data members
7679 got_mod_index_offset_ and tls_base_symbol_defined_.
7680 (Target_arm::Relocate::relocate_tls): New method.
7681 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
7682 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
7683 New methods.
2e702c99 7684 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
7685 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
7686 (Target_arm::got_mod_index_offset_,
7687 Target_arm::tls_base_symbol_defined_): New data members.
7688 (Target_arm::Scan::local, Target::Scan::global,
7689 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
7690 relocations.
7691
c8761b9a
DK
76922010-02-18 Doug Kwan <dougkwan@google.com>
7693
7694 * arm.cc (Arm_relobj::find_linked_text_section): New method.
7695 (Arm_relobj::make_exidx_input_section): Pass section index of linked
7696 text section as a parameter becuase some broken tools may not set
7697 the link in section header.
7698 (Target_arm::has_got_section): New method.
7699 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
7700 without any mapping symbol as data only. Remove warning.
7701 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
7702 link in its section header, try to discover the link by inspecting the
7703 REL31 relocation at the beginning of the section.
7704 (Target_arm::Scan::check_non_pic): Report name of offending relocation
7705 in error message.
7706 (Target_arm::Scan::global): Treat any reference to the symbol
7707 _GLOBAL_OFFSET_TABLE_ as a GOT access.
7708
21bb3914
ST
77092010-02-12 Sriraman Tallam <tmsriram@google.com>
7710
7711 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
7712 (Scan::global_reloc_may_be_function_pointer): New function.
7713 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
7714 (Scan::global_reloc_may_be_function_pointer): New function.
7715 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
7716 (Scan::global_reloc_may_be_function_pointer): New function.
7717 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
7718 (Scan::global_reloc_may_be_function_pointer): New function.
7719 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
7720 (Scan::global_reloc_may_be_function_pointer): New function.
7721 (Scan::possible_function_pointer_reloc): New function.
7722 (Target_x86_64::can_check_for_function_pointers): New function.
7723 * gc.h (gc_process_relocs): Scan relocation types to determine if
7724 function pointers were taken for targets that support it.
7725 * icf.cc (Icf::find_identical_sections): Include functions for
7726 folding in safe ICF whose pointer is not taken.
7727 * icf.h (Secn_fptr_taken_set): New typedef.
7728 (fptr_section_id_): New member.
7729 (section_has_function_pointers): New function.
7730 (set_section_has_function_pointers): New function.
7731 (check_section_for_function_pointers): New function.
7732 * options.h: Fix comment for safe ICF option.
7733 * target.h (can_check_for_function_pointers): New function.
7734 * testsuite/Makefile.am: Add icf_safe_so_test test case.
7735 Modify icf_safe_test for X86-64.
7736 * testsuite/Makefile.in: Regenerate.
7737 * testsuite/icf_safe_so_test.cc: New file.
7738 * testsuite/icf_safe_so_test.sh: New file.
7739 * testsuite/icf_safe_test.cc (kept_func_3): New function.
7740 (main): Change to take pointer to function kept_func_3.
7741 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
7742 folding is done correctly for X86-64.
7743
0da6fa6c
DM
77442010-02-12 David S. Miller <davem@davemloft.net>
7745
7746 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
7747 is_symbolless parameter.
7748 (Output_reloc<SHT_REL>::is_symbolless): New.
7749 (Output_reloc<SHT_REL>::is_symbolless_): New.
7750 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
7751 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
7752 (Output_reloc<SHT_RELA>::is_symbolless): New.
7753 (Output_data_reloc::add_global): Handle is_symbolless.
7754 (Output_data_reloc::add_global_relative): Likewise.
7755 (Output_data_reloc::add_local): Likewise.
7756 (Output_data_reloc::add_local_relative): Likewise.
7757 (Output_data_reloc::add_symbolless_global_addend): New.
7758 (Output_data_reloc::add_symbolless_local_addend): New.
7759 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
7760 is_symbolless.
7761 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
7762 instead of ->is_relative_
7763 (Output_reloc::write): Likewise.
7764 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
7765 (Output_reloc::write_rel): Simplify.
7766
7767 * sparc.cc (Target_sparc::Scan::local): Use
7768 ->add_symbolless_local_addend as needed.
7769 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
7770 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
7771 based upon relocation offset.
7772
e4782e83
DK
77732010-02-11 Doug Kwan <dougkwan@google.com>
7774
7775 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
7776 (Target_arm::Scan::global): Ditto. Also remove a comment before the
7777 beginning of function.
7778 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
7779 and MOVT_ABS relocations. Those are non issued in scanning. Fix
7780 parameter is_32bit in calls to should_apply_static_reloc.
7781 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
7782 (check_DATA): Add arm_abs_global.stdout.
7783 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
7784 arm_abs_global.stdout): New rules.
7785 (MOSTLLYCLEANFILES): Add arm_abs_global
7786 * Makefile.in: Regenerate.
7787 * testsuite/arm_abs_global.s: New file.
7788 * testsuite/arm_abs_global.sh: Ditto.
7789 * testsuite/arm_abs_lib.s: Ditto.
7790
93ceb764
ILT
77912010-02-11 Ian Lance Taylor <iant@google.com>
7792
7793 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
7794 Read_relocs task.
7795 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
7796 Allocate_commons_task first.
7797 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
7798 task, rather than symtab_lock_.
7799 (Gc_process_relocs::~Gc_process_relocs): New function.
7800 (Gc_process_relocs::is_runnable): Check this_blocker_.
7801 (Gc_process_relocs::locks): Use next_blocker_ rather than
7802 blocker_.
7803 (Scan_relocs::~Scan_relocs): New function.
7804 (Scan_relocs::is_runnable): Check this_blocker_ rather than
7805 symtab_lock_.
7806 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
7807 next_blocker_.
7808 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
7809 fields. Add this_blocker_ and next_blocker_ fields. Adjust
7810 constructor accordingly.
7811 (class Gc_process_relocs): Likewise.
7812 (class Scan_relocs): Likewise.
7813 * common.h (class Allocate_commons_task): Remove symtab_lock_
7814 field, and corresponding constructor parameter.
7815 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
7816 symtab_lock_.
7817 (Allocate_commons_task::locks): Likewise.
7818
114dfbe1
ILT
78192010-02-11 Ian Lance Taylor <iant@google.com>
7820
7821 * gold-threads.h (class Once): Define.
7822 (class Initialize_lock): Rewrite as child of Once.
7823 * gold-threads.cc (class Once_initialize): Define.
7824 (once_pointer_control): New static variable.
7825 (once_pointer, once_arg): New static variables.
7826 (c_run_once): New static function.
7827 (Once::Once, Once::run_once, Once::internal_run): New functions.
7828 (class Initialize_lock_once): Remove.
7829 (initialize_lock_control): Remove.
7830 (initialize_lock_pointer): Remove.
7831 (initialize_lock_once): Remove.
7832 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
7833 (Initialize_lock::initialize): Rewrite.
7834 (Initialize_lock::do_run_once): New function.
7835 * archive.cc (Archive::interpret_header): Only clear name if it is
7836 not already empty.
7837 * fileread.cc: Include "gold-threads.h"
7838 (file_counts_lock): New static variable.
7839 (file_counts_initialize_lock): Likewise.
7840 (File_read::release): Only increment counts when using --stats.
7841 Use a lock around the increment.
7842 * parameters.cc (class Set_parameters_target_once): Define.
7843 (set_parameters_target_once): New static variable.
7844 (Parameters::Parameters): Move here from parameters.h.
7845 (Parameters::set_target): Rewrite.
7846 (Parameters::set_target_once): New function.
7847 (Parameters::clear_target): Move here and rewrite.
7848 * parameters.h (class Parameters): Update declarations. Add
7849 set_parameters_target_once_ field.
7850 (Parameters::Parameters): Move to parameters.cc.
7851 (Parameters::clear_target): Likewise.
7852 * readsyms.cc (Read_symbols::do_group): Create a Start_group
7853 task.
7854 (Start_group::~Start_group): New function.
7855 (Start_group::is_runnable): New function.
7856 (Start_group::locks, Start_group::run): New functions.
7857 (Finish_group::run): Change saw_undefined to size_t.
7858 * readsyms.h (class Start_group): Define.
7859 (class Finish_group): Change saw_undefined_ field to size_t.
7860 (Finish_group::Finish_group): Remove saw_undefined and
7861 this_blocker parameters. Change all callers.
7862 (Finish_group::set_saw_undefined): New function.
7863 (Finish_group::set_blocker): New function.
7864 * symtab.h (class Symbol_table): Change saw_undefined to return
7865 size_t. Change saw_undefined_ field to size_t.
7866 * target-select.cc (Set_target_once::do_run_once): New function.
7867 (Target_selector::Target_selector): Initialize set_target_once_
7868 field. Don't initialize lock_ and initialize_lock_ fields.
7869 (Target_selector::instantiate_target): Rewrite.
7870 (Target_selector::set_target): New function.
7871 * target-select.h (class Set_target_once): Define.
7872 (class Target_selector): Update declarations. Make
7873 Set_target_once a friend. Remove lock_ and initialize_lock_
7874 fields. Add set_target_once_ field.
7875
fa17a3f4
ILT
78762010-02-10 Ian Lance Taylor <iant@google.com>
7877
7878 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
7879 queueing any tasks.
7880 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
7881 (queue_middle_tasks): Add all blockers before queueing any tasks.
7882 (queue_final_tasks): Likewise.
7883 * token.h (Task_token::add_blockers): New function.
7884 * object.h (Input_objects::number_of_relobjs): New function.
7885
c7177d31
ILT
78862010-02-10 Ian Lance Taylor <iant@google.com>
7887
5de0e392
ILT
7888 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
7889 shared, not if not position independent.
7890 * x86_64.cc (Relocate::relocate_tls): Likewise.
7891 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
7892 (tls_pie_pic_test): New target.
7893 * testsuite/Makefile.in: Rebuild.
7894
c7177d31
ILT
7895 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
7896 (tls_test_main_pie.o, tls_test_pie.o): New targets.
7897 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
7898 * testsuite/Makefile.in: Rebuild.
7899
684b268a
DM
79002010-02-09 David S. Miller <davem@davemloft.net>
7901
7902 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
7903 R_SPARC_RELATIVE using ->add_local_relative().
7904 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
7905
612a8d3d
DM
7906 * output.h (Output_data_dynamic::add_section_size): New method
7907 that takes two Output_data objects.
7908 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
7909 entry param. Handle it in initializers.
7910 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
7911 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
7912 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
7913 arg.
7914 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
7915 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
7916 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
7917 for dynrel_includes_plt.
7918 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7919 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7920 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
7921 before .rela.plt
7922 (Target_sparc::do_finalize_sections): Update to pass true for
7923 dynrel_includes_plt.
7924 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
7925 output before .rela.plt
7926 (Target_powerpc::do_finalize_sections): Update to pass true for
7927 dynrel_includes_plt when 32-bit.
7928
cb1be87e
DK
79292010-02-08 Doug Kwan <dougkwan@google.com>
7930
7931 * arm.cc (Arm_relobj::simple_input_section_output_address): New
7932 method.
7933 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
7934 Arm_relobj::scan_section_for_cortex_a8_stubs,
7935 Arm_relobj::do_relocation_section): Instead of calling
7936 Output_section::output_address, use faster
7937 Arm_relobj::simple_input_section_output_address.
7938
705b5121
DM
79392010-02-08 David S. Miller <davem@davemloft.net>
7940
7941 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
7942 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
7943 relocation helper function.
7944
024c4466
DM
7945 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
7946 just like R_SPARC_GOT{10,13,22}.
7947 (Target_sparc::Scan::local): Likewise.
7948 (Target_sparc::Relocate:relocate): Likewise.
7949
9109c078
ILT
79502010-02-06 Ian Lance Taylor <iant@google.com>
7951
7952 * configure.ac: Rewrite targetobjs duplicate removal code to use
7953 only shell constructs.
7954 * configure: Rebuild.
7955
cf846138
DK
79562010-02-05 Doug Kwan <dougkwan@google.com>
7957
7958 PR 11247
7959 * arm.cc (Arm_relobj::section_is_scannable): New method.
7960 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
7961 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
7962
6cfaf60b
DK
79632010-02-04 Doug Kwan <dougkwan@google.com>
7964
7965 PR 11247
7966 * arm-reloc-property.cc (cstdio): Include.
7967 * configure.ac (targetobjs): Remove duplicates.
7968 * configure: Regenerate.
7969 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
7970 big and little endian version for a given address size.
7971
5c57f1be
DK
79722010-02-03 Doug Kwan <dougkwan@google.com>
7973
7974 * arm-reloc-property.cc
7975 (Arm_reloc_property_table::reloc_name_in_error_message): New method
7976 definition.
7977 * arm-reloc-property.h
7978 (Arm_reloc_property_table::get_implemented_static_reloc_property):
7979 New method definition.
7980 (Arm_reloc_property_table::reloc_name_in_error_message): New method
7981 declaration.
7982 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
7983 overflow to N.
7984 (GOT_PREL): Change implemented to Y.
7985 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
7986 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
7987 (Arm_relocate_functions::movw_abs_nc): Remove method.
7988 (Arm_relocate_functions::movt_abs): Ditto.
7989 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
7990 (Arm_relocate_functions::thm_movt_abs): Ditto.
7991 (Arm_relocate_functions::movw_rel_nc): Ditto.
7992 (Arm_relocate_functions::movw_rel): Ditto.
7993 (Arm_relocate_functions::movt_rel): Ditto.
7994 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
7995 (Arm_relocate_functions:thm_movw_rel): Ditto.
7996 (Arm_relocate_functions:thm_movt_rel): Ditto.
7997 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
7998 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
7999 New method definitions.
8000 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
8001 (Arm_relocation_functions::arm_grp_ldr): Ditto.
8002 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
8003 (Arm_relocation_functions::arm_grp_ldc): Ditto.
8004 (Target_arm::Relocate::relocate): Check for non-static or
8005 unimplemented relocation code and exit early. Change calls to
8006 Target_arm::reloc_uses_thumb_bit and
8007 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
8008 instead. Refactor code to handle similar relocations to increase
8009 code sharing. Remove check for unsupported relocation code in switch
8010 statement.
8011 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
8012 relocation property table to find out size. Change error message to
8013 print out the name of a relocation code instead of the numeric value.
8014 (Target_arm::scan_reloc_for_stub): Use relocation property table
8015 instead of calling Target_arm::reloc_uses_thumb_bit().
8016
218c5831
DK
80172010-02-02 Doug Kwan <dougkwan@google.com>
8018
8019 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
8020 types of relaxed input section.
8021
0d31c79d
DK
80222010-02-02 Doug Kwan <dougkwan@google.com>
8023
8024 * Makefile.am (HFILES): Add arm-reloc-property.h.
8025 (DEFFILES): New.
2e702c99
RM
8026 (TARGETSOURCES): Add arm-reloc-property.cc
8027 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
8028 (libgold_a_SOURCES): $(DEFFILES)
8029 * Makefile.in: Regenerate.
8030 * arm-reloc-property.cc: New file.
8031 * arm-reloc-property.h: New file.
8032 * arm-reloc.def: New file.
8033 * arm.cc: Update comments.
8034 (arm-reloc-property.h): New included header.
8035 (arm_reloc_property_table): New global variable.
8036 (Target_arm::do_select_as_default_target): New method definition.
8037 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
8038 arm-reloc-property to targ_extra_obj.
8039 * parameters.cc (set_parameters_target): Call
8040 Target::select_as_default_target().
8041 * target.h (Target::select_as_default_target): New method definition.
8042 (Target::do_select_as_default_target): Same.
8043
546c7457
DK
80442010-02-01 Doug Kwan <dougkwan@google.com>
8045
8046 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
8047 first_output_text_section_.
8048 (Arm_exidx_fixup::first_output_text_section): New method definition.
8049 (Arm_exidx_fixup::first_output_text_section_): New data member.
8050 (Arm_exidx_fixup::process_exidx_section): Record the first text
8051 output section seen.
8052 (Arm_output_section::fix_exidx_coverage): Set correct linked section
8053 and entsize in output section header.
8054
11b861d5
DK
80552010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8056
8057 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
8058 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
8059 (Arm_relocate_functions::thm_alu11): New Method.
8060 (Arm_relocate_functions::thm_pc8): New Method.
8061 (Arm_relocate_functions::thm_pc12): New Method.
8062 (Target_arm::Scan::local): Handle the relocations.
8063 (Target_arm::Scan::global): Likewise.
8064 (Target_arm::Relocate::relocate): Likewise.
8065 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8066
c9a2c125
DK
80672010-01-29 Doug Kwan <dougkwan@google.com>
8068
8069 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
8070 of relocation types as ld.
8071
1521477a
DK
80722010-01-29 Doug Kwan <dougkwan@google.com>
8073
8074 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
8075 to public.
8076 (Arm_relocate_functions::thumb_branch_common): Ditto.
8077 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
8078 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
8079 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
8080 Arm_relocate_functions::jump24): Remove.
8081 (Target_arm::Relocate::relocate): Adjust code to call
8082 Arm_relocation_functions::arm_branch_common and
8083 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 8084 wrappers. Merge switch-cases together to reduce source code size.
1521477a 8085
e7eca48c
DK
80862010-01-29 Doug Kwan <dougkwan@google.com>
8087
8088 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
8089 output_local_symbol_count_needs_update_.
8090 (Arm_relobj::output_local_symbol_count_needs_update,
8091 Arm_relobj::set_output_local_symbol_count_needs_update,
8092 Arm_relobj::update_output_local_symbol_count): New methods.
8093 (Arm_relobj::output_local_symbol_count_needs_update_): New data
8094 member.
8095 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
8096 of pointed function as in a R_ARM_PREL31 relocation.
8097 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
8098 for output local symbol count updating.
8099 (Target_arm::do_relax): Update output local symbol counts in objects
8100 if necessary.
8101 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
8102
02961d7e
ILT
81032010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8104
8105 * arm.cc: Added support for the ARM relocations:
8106 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
8107 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
8108 (Arm_relocate_functions::movw_rel_nc): Renamed (was
8109 movw_prel_nc).
8110 (Arm_relocate_functions::movw_rel): New method.
8111 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
8112 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
8113 thm_movw_prel_nc).
8114 (Arm_relocate_functions::thm_movw_rel): New method.
8115 (Arm_relocate_functions::thm_movt_rel): Renamed (was
8116 thm_movt_prel).
8117 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
8118 relocations.
8119 (Target_arm::Scan::global): Likewise.
8120 (Target_arm::Relocate::relocate): Likewise.
8121 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8122 Likewise.
8123
b10d2873
ILT
81242010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8125
8126 * arm.cc: Added support for ARM group relocations.
8127 (Target_arm::reloc_needs_sym_origin): New method.
8128 (Arm_relocate_functions::calc_grp_kn): New method.
8129 (Arm_relocate_functions::calc_grp_residual): New method.
8130 (Arm_relocate_functions::calc_grp_gn): New method.
8131 (Arm_relocate_functions::arm_grp_alu): New Method.
8132 (Arm_relocate_functions::arm_grp_ldr): New Method.
8133 (Arm_relocate_functions::arm_grp_ldrs): New Method.
8134 (Arm_relocate_functions::arm_grp_ldc): New Method.
8135 (Target_arm::Scan::local): Handle the ARM group relocations.
8136 (Target_arm::Scan::global): Likewise.
8137 (Target_arm::Relocate::relocate): Likewise.
8138 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8139 Likewise.
8140
2b328d4e
DK
81412010-01-26 Doug Kwan <dougkwan@google.com>
8142
8143 * arm.cc (set): Include.
8144 (class Arm_exidx_fixup): Change type of last_input_section_ to const
8145 pointer type.
2e702c99 8146 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
8147 (Arm_output_section::append_text_sections_to_list): New method.
8148 (Arm_output_section::fix_exidx_coverage): Ditto.
8149 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 8150 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
8151 Relobj::set_section_offset() instead of
8152 Sized_relobj::invalidate_section_offset().
2e702c99 8153 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
8154 parameter for section headers. Ignore relocation sections for
8155 unallocated sections and EXIDX sections.
8156 (Target_arm::fix_exidx_coverage): New method.
8157 (Target_arm::output_section_address_less_than): New type.
8158 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
8159 linked text section instead of the EXIDX section.
8160 (Arm_output_section::create_stub_group): Add an assertion to check
8161 that this is not an EXIDX output section.
8162 (Arm_output_section::append_text_sections_to_list): New method.
8163 (Arm_output_section::fix_exidx_coverage): Ditto.
8164 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 8165 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
8166 (Target_arm::do_relax): Fix EXIDX output section coverage in the
8167 first pass.
8168 (Target_arm::fix_exidx_coverage): New method.
8169 * object.h (Relobj::set_output_section): New method.
8170 (Sized_relobj::invalidate_section_offset): Remove method.
8171 (Sized_relobj::do_invalidate_section_offset): Remove method.
8172 (Sized_relobj::do_set_section_offset): Handle offset value -1.
8173
c7f3c371
DK
81742010-01-25 Doug Kwan <dougkwan@google.com>
8175
8176 * arm.cc (Arm_exidx_merged_section::do_output_offset):
8177 Fix warning due to signed and unsigned comparison on a 32-bit host.
8178
8923b24c
DK
81792010-01-22 Doug Kwan <dougkwan@google.com>
8180
8181 * arm.cc (Target_arm::do_relax): Record an output section for section
8182 offset adjustment it contains any stub table that has changed.
8183 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
8184 offsets in an output section if necessary.
8185 * output.cc (Output_section::Output_section): Initialize
8186 section_offsets_need_adjustments_.
8187 (Output_section::add_input_section_for_script): Renamed to
8188 Output_section::add_simple_input_section.
8189 (Output_section::save_states): Add a comment.
8190 (Output_section::discard_states): New method defintion.
8191 (Output_section::adjust_section_offsets): Same.
8192 * output.h (Output_section::add_input_section_for_script): Renamed to
8193 Output_section::add_simple_input_section.
8194 (Output_section::discard_states): New method declaration.
8195 (Output_section::adjust_section_offsets): Same.
8196 (Output_section::section_offsets_need_adjustment,
8197 Output_section::set_section_offsets_need_adjustment): New method
8198 definitions.
8199 (Output_section::section_offsets_need_adjustment_): New data member.
8200 * script-sections.cc
8201 (Output_section_element_input::set_section_address): Adjust code for
8202 renaming of Output_section::add_input_section_for_script.
8203 (Orphan_output_section::set_section_address): Same.
8204
9b2fd367
DK
82052010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8206
8207 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
8208 Fix_v4bx enum values .
8209 * gold/options.h (General_options): New option definitions.
8210 (General_options::fix_v4bx): New method.
8211 (General_options::Fix_v4bx): New enum.
8212 * gold/options.cc (General_options::parse_fix_v4bx): New method.
8213 (General_options::parse_fix_v4bx_interworking): New method.
8214
80d0d023
DK
82152010-01-22 Doug Kwan <dougkwan@google.com>
8216
8217 * arm.cc (Arm_exidx_fixup): New class.
8218
af2cdeae
DK
82192010-01-21 Doug Kwan <dougkwan@google.com>
8220
8221 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
8222 classes.
8223 (Arm_exidx_section_offset_map): New type.
8224
993d07c1
DK
82252010-01-21 Doug Kwan <dougkwan@google.com>
8226
8227 * arm.cc (Arm_exidx_input_section): New class.
8228 (Arm_relobj::exidx_input_section_by_link,
8229 Arm_relobj::exidx_input_section_by_shndx,
8230 Arm_relobj::make_exidx_input_section): New methods.
8231 (read_arm_attributes_section): Remove.
8232 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
8233 information about them.
8234 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
8235 to here.
8236
5ac169d4
DK
82372010-01-20 Doug Kwan <dougkwan@google.com>
8238
8239 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
8240 Input_section_specifier to Section_id.
8241 (Target_arm::new_arm_input_section: Adjust code for change of key
8242 type.
8243 (Target_arm::find_arm_input_section): Ditto.
8244 * gc.h (object.h): Include for Section_id nand Section_id_hash.
8245 (Section_id): Remove.
8246 (Garbage_collection::Section_id_hash): Remove.
8247 * icf.h (object.h): Include for Section_id nand Section_id_hash.
8248 (Section_id): Remove.
8249 (Icf::Section_id_hash): Remove.
8250 * object.h (Section_id, Const_section_id, Section_id_hash,
8251 Const_section_id_hash): New type definitions.
8252 * output.cc (Output_section::add_relaxed_input_section): Change to
8253 use Const_section_id instead of Input_section_specifier as key type.
8254 (Output_section::add_merge_input_section): Ditto.
8255 (Output_section::build_relaxation_map): Change to use Section_id
8256 instead of Input_section_specifier as key type.
2e702c99 8257 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
8258 Ditto.
8259 (Output_section::convert_input_sections_to_relaxed_sections): Change
8260 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 8261 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
8262 (Output_section::find_relaxed_input_section): Ditto.
8263 * output.h (Input_section_specifier): Remove class.
8264 (Output_section::Output_section_data_by_input_section_map): Change
8265 key type to Const_section_id.
8266 (Output_section::Output_relaxed_input_section_by_input_section_map):
8267 Ditto.
8268 (Output_section::Relaxation_map): Change key type to Section_id.
8269
a2162063
ILT
82702010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8271
8272 * gold/arm.cc: Added support for R_ARM_V4BX relocation
8273 (class Arm_v4bx_stub): New class.
8274 (DEF_STUBS): Updated definition to support v4_veneer_bx.
8275 (Stub_factory::make_arm_v4bx_stub): New method.
8276 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
8277 (Stub_table::empty): Handle v4bx stubs.
8278 (Stub_table::add_arm_v4bx_stub): New method.
8279 (Stub_table::find_arm_v4bx_stub): New method.
8280 (Arm_relocate_functions::v4bx): New method.
8281 (Target_arm::fix_v4bx): New method.
8282 (Target_arm::Target_arm): Handle R_ARM_V4BX.
8283 (Stub_table::relocate_stubs): Likewise.
8284 (Stub_table::do_write): Likewise.
8285 (Stub_table::update_data_size_and_addralign): Likewise.
8286 (Stub_table::finalize_stubs): Likewise.
8287 (Target_arm::Scan::local): Likewise.
8288 (Target_arm::Scan::global): Likewise.
8289 (Target_arm::do_finalize_sections): Likewise.
8290 (Target_arm::Relocate::relocate): Likewise.
8291 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8292 Likewise.
8293 (Target_arm::scan_reloc_for_stub): Likewise.
8294 (Target_arm::scan_reloc_section_for_stubs): Likewise.
8295
5696ab0b
ILT
82962010-01-19 Ian Lance Taylor <iant@google.com>
8297
8298 * output.cc (Output_section_headers::do_sized_write): Write large
8299 segment count to sh_info field.
8300 (Output_file_header::do_sized_write): For large segment count,
8301 write PN_XNUM to e_phnum field.
8302
800d0f56
ILT
83032010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8304
8305 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
8306 (Arm_relocate_functions::thm_jump8): New function.
8307 (Arm_relocate_functions::thm_jump11): New function.
8308 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
8309 R_ARM_THM_JUMP11.
8310 (Target_arm::Scan::global): Likewise.
8311 (Target_arm::Relocate::relocate): Likewise.
8312 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8313 Likewise.
8314
41263c05
DK
83152010-01-14 Doug Kwan <dougkwan@google.com>
8316
8317 * arm.cc (map, utility): Include headers.
8318 (Target_arm::apply_cortex_a8_workaround): New method.
8319 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
8320 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
8321 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
8322 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
8323 the --[no-]fix-cortex-a8 command line options.
8324 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
8325 (Target_arm::relocate_stub): Use addend in instruction template.
8326 * options.h (DEFINE_bool): Set the user-set flag.
8327 (General_options): Add --[no-]-fix-cortex options.
8328 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 8329 : Update fast look-up map after conversion.
41263c05 8330
459e9b03
ST
83312010-01-14 Sriraman Tallam <tmsriram@google.com>
8332
8333 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
8334 in the first pass of do_layout.
8335
b521dfe4
DK
83362010-01-13 Doug Kwan <dougkwan@google.com>
8337
8338 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
8339 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
8340 apparent compiler problem of not folding static constant integral
8341 data members of elfcpp::Elf_sizes<32>.
8342
44272192
DK
83432010-01-13 Doug Kwan <dougkwan@google.com>
8344
8345 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
8346 Arm_relobj::section_needs_cortex_a8_stub_scanning,
8347 Arm_relobj::scan_section_for_cortex_a8_erratum,
8348 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
8349 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
8350 sections to scan for relocation stubs into a new method
8351 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
8352 relocation and Cortex-A8 stub scanning.
8353 (Target_arm::do_relax): Force stubs to be after stubbed sections
8354 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 8355 the beginning of a new relaxation pass. Update a comment.
44272192
DK
8356 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
8357
44b71ece
ILT
83582010-01-12 Ian Lance Taylor <iant@google.com>
8359
8360 * target-reloc.h (visibility_error): New inline function.
8361 (relocate_section): Call visibility_error.
8362 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
8363 (MOSTLYCLEANFILES): Likewise.
8364 (protected_4_pic.o, protected_3.err): New targets.
8365 * testsuite/protected_4.cc: New file.
8366
a120bc7f
DK
83672010-01-12 Doug Kwan <dougkwan@google.com>
8368
8369 * arm.cc (Cortex_a8_reloc): New class.
8370 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
8371 and cortex_a8_relocs_info_.
8372 (Target_arm::fix_cortex_a8): New method definition.
8373 (Target_arm::Cortex_a8_relocs_info): New type.
8374 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
8375 New data member declarations.
8376 (Target_arm::scan_reloc_for_stub): Record information about
8377 relocations for THUMB branches that might be exempted from the
8378 Cortex-A8 workaround.
8379 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
8380 at the beginning of a relaxation pass.
8381
20138696
DK
83822010-01-12 Doug Kwan <dougkwan@google.com>
8383
8384 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
8385 (Arm_relobj::Mapping_symbol_position,
8386 Arm_reloj::Mapping_symbol_position_less,
8387 Arm_relobj::Mapping_symbols_info): New types.
8388 (Target_arm::is_mapping_symbol_name): New method definition.
8389 (Arm_relobj::do_count_local_symbols): Save information about mapping
8390 symbols.
8391
089d69dc
DK
83922010-01-11 Doug Kwan <dougkwan@google.com>
8393
8394 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
8395 Arm_relocate_functions::thumb32_branch_upper,
8396 Arm_relocate_functions::thumb32_branch_lower,
8397 Arm_relocate_functions::thumb32_cond_branch_offset,
8398 Arm_relocate_functions::thumb32_cond_branch_upper,
8399 Arm_relocate_functions::thumb32_cond_branch_lower,
8400 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
8401 branch offset encoding.
8402 (Arm_relocate_functions::thumb_branch_common): Use new branch
8403 offset encoding methods to avoid code duplication.
8404 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
8405 (Stub_addend_reader::operator()): Use new branch encoding method
8406 to avoid code duplication.
8407
99e5bff2
DK
84082010-01-11 Doug Kwan <dougkwan@google.com>
8409
8410 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
8411 (Target_arm::do_finalize_sections): Define special EXIDX section
8412 symbols only if referenced.
8413 * gc.h (Garbage_collection::add_reference): New method.
8414 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
8415 code duplication.
8416
98e090bd
ILT
84172010-01-11 Ian Lance Taylor <iant@google.com>
8418
d0a91bd8
ILT
8419 * script.cc (Version_script_info::build_expression_list_lookup):
8420 Change complaing about duplicate wildcard match from error to
8421 warning.
8422
98e090bd
ILT
8423 * script.cc (class Lazy_demangler): Recreate--revert part of patch
8424 of 2009-12-30.
8425 (Version_script_info::Version_script_info): Initialize globs_,
8426 default_version_, default_is_global_, and exact_. Don't
8427 initialize globals_ or locals_.
8428 (Version_script_info::build_lookup_tables): Build local symbols
8429 first.
8430 (Version_script_info::unquote): New function.
8431 (Version_script_info::add_exact_match): New function.
8432 (Version_script_info::build_expression_list_lookup): Remove lookup
8433 parameter. Add is_global parameter. Change all callers. Handle
8434 wildcard pattern specially. Unquote pattern. Call
8435 add_exact_match.
8436 (Version_script_info::get_name_to_match): New function.
8437 (Version_script_info::get_symbol_version): New function.
8438 (Version_script_info::get_symbol_version_helper): Remove.
8439 (Version_script_info::check_unmatched_names): Call unquote.
8440 * script.h (class Version_script_info): Change get_symbol_version
8441 to be non-inline and add is_global parameter; change all callers.
8442 Rewrite symbol_is_local. Update declarations. Define struct
8443 Version_tree_match, Exact, Globs. Don't define struct Lookup.
8444 Remove globals_ and locals_ members. Add exact_, globs_,
8445 default_version_, is_global_.
8446 (Version_script_info::Glob): Remove pattern, add expression and
8447 is_global. Update constructor. Change all callers.
8448 * dynobj.cc (Versions::finalize): Mark the version symbol as the
8449 default version.
8450 (Versions::symbol_section_contents): If a symbol is undefined, or
8451 defined in a dynamic object, set the version index to
8452 VER_NDX_LOCAL.
8453 * symtab.cc (Symbol_table::add_from_relobj): Don't call
8454 symbol_is_local.
8455 (Symbol_table::add_from_pluginobj): Likewise.
8456 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
8457
d56962d3
DK
84582010-01-11 Doug Kwan <dougkwan@google.com>
8459
8460 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
8461 (incremental_dump_LDADD): Add linking option for libintl.
8462 * Makefile.in: Regenerate.
8463
94e6ee91
L
84642010-01-11 H.J. Lu <hongjiu.lu@intel.com>
8465
8466 PR gold/11144
8467 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
8468 instead of -Ds.
8469 * testsuite/Makefile.in: Regenerated.
8470
e96c574b
DK
84712010-01-10 Doug Kwan <dougkwan@google.com>
8472
8473 * options.h (DEFINE_var): Use parentheses around argument varname__
8474 in macro body to avoid any unintended subsequent substitutions.
8475
7198066b
ILT
84762010-01-10 Ian Lance Taylor <iant@google.com>
8477
ba4d53bf
ILT
8478 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
8479 candidates before doing symbol resolution.
8480
7198066b
ILT
8481 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
8482 ODR candidates if only one is weak.
8483
a2beed37
ILT
84842010-01-08 Ian Lance Taylor <iant@google.com>
8485
8486 * script.cc (Version_script_info::build_expression_list_lookup):
8487 Don't warn about ambiguous version, just record the ambiguity.
8488 (Version_script_info::get_symbol_version_helper): Give error if
8489 version is ambiguous.
8490
2fb7225c
DK
84912010-01-08 Doug Kwan <dougkwan@google.com>
8492
8493 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
8494 prev_data_size_ and prev_addralign_. Remove initializer for
8495 deleted data member has_been_changed_.
8496 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
8497 to determine if the table is empty.
8498 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
8499 Remove.
8500 (Stub_table::add_reloc_stub): Define method in class definition
8501 instead of just declaring it there.
8502 (Stub_table::add_cortex_a8_stub): New method definition.
8503 (Stub_table::update_data_size_and_addralign): Ditto.
8504 (Stub_table::finalize_stubs): Ditto.
8505 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
8506 (Stub_table::do_addralign_): Return address alignment in the
8507 (Stub_table::do_reset_address_and_file_offset): Define method in
8508 class definition instead of declaring it there. Set current data
8509 size to be the data size of the previous pass.
8510 (Stub_table::set_final_data_size): Use current data size as the
8511 final data size.
8512 (Stub_table::relocate_stub): Change parameter type of stub from
8513 Reloc_stub pointer to Stub pointer.
8514 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
8515 (Stub_table::Cortex_a8_stub_list): New typedef.
8516 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
8517 Stub_table::prev_addralign_): New data member.
8518 (Arm_relobj::Arm_relobj): Initialize data member
8519 section_has_cortex_a8_workaround_.
8520 (Arm_relobj::section_has_cortex_a8_workaround,
8521 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
8522 definitions.
8523 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
8524 declarations.
8525 (Target_arm::relocate_stub): Change parameter type of stub from
8526 Reloc_stub pointer to Stub pointer.
8527 (Insn_template::size, Insn_template::alignment): Handle
8528 THUMB16_SPECIAL_TYPE.
8529 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
8530 Stub_table::update_data_size_and_addralign,
8531 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
8532 definitions.
8533 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
8534 (Stub_table::do_write): Ditto.
8535 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 8536
880cd20d
ILT
85372010-01-08 Ian Lance Taylor <iant@google.com>
8538
8539 PR 11108
8540 * symtab.h (class Symbol): Remove fields is_target_special_ and
8541 has_plt_offset_. Add field is_defined_in_discarded_section_.
8542 (Symbol::is_defined_in_discarded_section): New function.
8543 (Symbol::set_is_defined_in_discarded_section): New function.
8544 (Symbol::has_plt_offset): Rewrite.
8545 (Symbol::set_plt_offset): Verify that new offset is not -1U.
8546 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
8547 Don't initialize is_target_special_ or has_plt_offset_.
8548 Initialize is_defined_in_discarded_section_.
8549 (Symbol_table::add_from_relobj): If appropriate, set
8550 is_defined_in_discarded_section.
8551 * resolve.cc (Symbol::override_base_with_special): Don't test
8552 is_target_special_. Change has_plt_offset_ to has_plt_offset().
8553 * target-reloc.h (relocate_section): Do special handling for
8554 symbols defined in discarded sections for global symbols as well
8555 as local symbols.
8556
2703e3eb
ILT
85572010-01-08 Ian Lance Taylor <iant@google.com>
8558
8559 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
8560 the SHT_SYMTAB case.
8561
339d40a3
ILT
85622010-01-08 Ian Lance Taylor <iant@google.com>
8563
8564 * object.cc (Sized_relobj::do_layout): Don't get confused if
8565 layout_eh_frame returns NULL.
8566
abecea76
ILT
85672010-01-08 Ian Lance Taylor <iant@google.com>
8568
8569 PR 11084
8570 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
8571 dynamic symbol table, use the normal symbol table.
8572 (Sized_dynobj::do_read_symbols): Remove assertion about type of
8573 symbol table.
8574
6b7dd3f3
ILT
85752010-01-08 Ian Lance Taylor <iant@google.com>
8576
8577 PR 11072
8578 * layout.cc (Layout::include_section): Remove .gnu_debuglink
8579 sections.
8580
36c50e63
L
85812010-01-08 H.J. Lu <hongjiu.lu@intel.com>
8582
8583 * version.cc (print_version): Change to "Copyright 2010".
8584
e291e7b9
ILT
85852010-01-08 Ian Lance Taylor <iant@google.com>
8586
8587 PR 10287
8588 PR 11063
8589 * i386.cc (class Target_i386): Change return type of plt_section
8590 to be non-const.
8591 (class Output_data_plt_i386): Add tls_desc_rel_ field.
8592 (Output_data_plt_i386::Output_data_plt_i386): Initialize
8593 tls_desc_rel_ field.
8594 (Output_data_plt_i386::rel_tls_desc): New function.
8595 (Target_i386::rel_tls_desc_section): New function.
8596 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
8597 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
8598 R_386_TLS_DESC reloc in rel_tls_desc_section.
8599 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
8600 Define struct Tlsdesc_info.
8601 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
8602 (Target_x86_64::do_reloc_symbol_index): New function.
8603 (Target_x86_64::add_tlsdesc_info): New function.
8604 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
8605 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
8606 tlsdesc_rel_ field.
8607 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
8608 all callers.
8609 (Output_data_plt_x86_64::rela_tlsdesc): New function.
8610 (Target_x86_64::rela_tlsdesc_section): New function.
8611 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
8612 handling.
8613 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
8614 (Target_x86_64::do_reloc_addend): New function.
8615 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
8616 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
8617 declarations. Define TARGET_CODE. Add arg field to u1_ union.
8618 (Output_reloc::type): New function.
8619 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
8620 (Output_reloc::is_target_specific): New function.
8621 (Output_reloc::target_arg): New function.
8622 (class Output_reloc) [SHT_RELA]: Add four new constructors for
8623 absolute relocs and target specific relocs.
8624 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
8625 add_target_specific.
8626 (class Output_data_reloc) [SHT_RELA]: Likewise.
8627 * output.cc (Output_reloc::Output_reloc): Add four new versions
8628 for absolute relocs and target specific relocs.
8629 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
8630 (Output_reloc::get_symbol_index): Likewise.
8631 (Output_reloc::local_section_offset): Check that local_sym_index_
8632 is not TARGET_CODE or 0.
8633 (Output_reloc::symbol_value): Likewise.
8634 (Output_reloc::write) [SHT_RELA]: Call target for target specific
8635 reloc.
8636 * target.h (class Target): Add reloc_symbol_index and reloc_addend
8637 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
8638 functions.
8639 * layout.cc (add_target_dynamic_tags): Use output section for
8640 DT_PLTRELSZ and DT_JMPREL.
8641
3a44184e
ILT
86422010-01-07 Ian Lance Taylor <iant@google.com>
8643
8644 PR 11061
8645 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
8646 function.
8647 (class Output_data_reloc_generic): Define.
8648 (class Output_data_reloc_base): Change base class to
8649 Output_data_reloc_generic. Change add() method to call
8650 bump_relative_reloc_count for a relative reloc. Remove
8651 sort_relocs_ field.
8652 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
8653 to sort_relocs().
8654 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
8655 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
8656 appropriate.
8657 * layout.h (class Layout): Update declaration.
8658
ea715a34
ILT
86592010-01-07 Ian Lance Taylor <iant@google.com>
8660
8661 * output.h (class Output_data): Add const version of
8662 output_section and do_output_section.
8663 (class Output_section_data): Add const version of
8664 do_output_section.
8665 (class Output_section): Likewise.
8666 * layout.cc (Layout::add_target_dynamic_tags): New function.
8667 * layout.h (class Layout): Update declarations.
8668 * arm.cc (Target_arm::do_finalize_sections): Use
8669 add_target_dynamic_tags.
8670 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8671 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
8672 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
8673 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8674
659948a4
ILT
86752010-01-07 Ian Lance Taylor <iant@google.com>
8676
8677 PR 11042
8678 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
8679 object as needed.
8680
9d3b86f6
ILT
86812010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
8682 Ian Lance Taylor <iant@google.com>
8683
8684 PR 11019
8685 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
8686 Xindex::read_symtab_xindex.
8687
bb0d3eb0
DK
86882010-01-07 Doug Kwan <dougkwan@google.com>
8689
8690 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
8691 (Insn_template::thumb16_bcond_insn): New method declaration.
8692 (Insn_template): Fix spelling.
8693 (Stub::thumb16_special): New method declaration.
8694 (Stub::do_write): Define virtual method which was previously pure
8695 virtual.
8696 (Stub::do_thumb16_special): New method declaration.
8697 (Stub::do_fixed_endian_write): New template member.
8698 (Reloc_stub::do_write): Remove.
8699 (Reloc_stub::do_fixed_endian_write): Remove.
8700 (Cortex_a8_stub): New class definition.
8701 (Stub_factory::make_cortex_a8_stub): New method definition.
8702 (Stub_factory::Stub_factory): Add missing static storage class
8703 qualifier for elf32_arm_stub_a8_veneer_blx.
8704
ffeef7df
ILT
87052010-01-07 Ian Lance Taylor <iant@google.com>
8706
dc3f80fe
ILT
8707 PR 10980
8708 * options.h (class General_options): Add --warn-unresolved-symbols
8709 and --error-unresolved-symbols.
8710 * errors.cc (Errors::undefined_symbol): Implement
8711 --warn-unresolved-symbols.
8712
ffeef7df
ILT
8713 * options.h (class General_options): Add -z text and -z textoff.
8714 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
8715
f1ec9ded
ST
87162010-01-06 Sriraman Tallam <tmsriram@google.com>
8717
8718 * gc.h (Garbage_collection::Cident_section_map): New typedef.
8719 (Garbage_collection::cident_sections): New function.
8720 (Garbage_collection::add_cident_section): New function.
8721 (Garbage_collection::cident_sections_): New member.
8722 (gc_process_relocs): Add references to sections whose names are C
8723 identifiers.
8724 * gold.h (cident_section_start_prefix): New constant.
8725 (cident_section_stop_prefix): New constant.
8726 (is_cident): New function.
8727 * layout.cc (Layout::define_section_symbols): Replace string constants
8728 with the newly defined constants.
8729 * object.cc (Sized_relobj::do_layout): Track sections whose names are
8730 C identifiers.
8731 * testsuite/Makefile.am: Add gc_orphan_section_test.
8732 * testsuite/Makefile.in: Regenerate.
8733 * testsuite/gc_orphan_section_test.cc: New file.
8734 * testsuite/gc_orphan_section_test.sh: New file.
8735
6eda8c29
ILT
87362010-01-06 Ian Lance Taylor <iant@google.com>
8737
b9674e17
ILT
8738 PR 10980
8739 * options.h (class General_options): Add --warn-shared-textrel.
8740 * layout.cc (Layout::finish_dynamic_section): Implement
8741 --warn-shared-textrel.
8742
6eda8c29
ILT
8743 PR 10980
8744 * options.h (class General_options): Add --warn-multiple-gp.
8745
32dcd44e
ILT
87462010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8747
8748 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
8749 $(THREADSLIB) and $(LIBDL).
8750 * Makefile.in: Rebuild.
8751
a192ba05
ILT
87522010-01-06 Ian Lance Taylor <iant@google.com>
8753
8754 PR 10980
8755 * options.cc (General_options::parse_section_start): New function.
8756 (General_options::section_start): New function.
8757 (General_options::General_options): Initialize all members.
8758 * options.h: Include <map>
8759 (class General_options): Add --section-start. Add section_starts_
8760 member.
8761 * layout.cc (Layout::attach_allocated_section_to_segment): If
8762 --section-start was used, set the address of the segment. Remove
8763 local sort_sections.
8764 (Layout::relaxation_loop_body): If the address of the load segment
8765 has been set by --section-start, don't use it.
8766 * output.h (Output_segment::update_flags_for_output_section): New
8767 function.
8768 * output.cc (Output_segment::add_output_section): Call
8769 update_flags_for_output_section.
8770
dde3f402
ILT
87712010-01-05 Ian Lance Taylor <iant@google.com>
8772
62dfdd4d
ILT
8773 PR 10980
8774 * options.h (class General_options): Add --undefined-version.
8775 * script.cc (struct Version_expression): Add was_matched_by_symbol
8776 field.
8777 (Version_script_info::matched_symbol): New function.
8778 (Version_script_info::get_symbol_version_helper): Call
8779 matched_symbol.
8780 (Version_script_info::check_unmatched_names): New function.
8781 * script.h (class Version_script_info): Update declarations.
8782 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
8783
9c4ae156
ILT
8784 * options.h (class General_options): Use DEFINE_bool_alias for
8785 allow_multiple_definition.
8786 * resolve.cc (Symbol_table::should_override): Don't test
8787 allow_multiple_definition.
8788
dde3f402
ILT
8789 PR 10980
8790 * options.h (class General_options): Add --cref.
8791 * main.cc (main): Print cref table if --cref. Don't close mapfile
8792 until after printing cref table.
8793 * cref.cc: Include "symtab.h".
8794 (class Cref_inputs): Define Cref_table_compare and Cref_table.
8795 (Cref_table_compare::operator()): New function.
8796 (Cref_inputs::gather_cref): New function.
8797 (filecol): New static const.
8798 (Cref_inputs::print_cref): New function.
8799 (Cref::print_cref): New function.
8800 * cref.h: Include <cstdio>.
8801 (class Cref): Update declarations.
8802 * mapfile.h (Mapfile::file): New function.
8803 * object.h (class Object): Define Symbols. Declare virtual
8804 do_get_global_symbols.
8805 (Object::get_global_symbols): New function.
8806 * object.cc (Input_objects::add_object): Pass object to cref_ if
8807 --cref.
8808 (Input_objects::archive_start): Likewise.
8809 (Input_objects::archive_stop): Likewise.
8810 (Input_objects::print_cref): New function.
8811 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
8812 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
8813 --cref.
8814 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
8815 function.
8816 * plugin.h (class Sized_pluginobj): Update declarations.
8817
8781f709
ILT
88182010-01-05 Ian Lance Taylor <iant@google.com>
8819
8820 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
8821 to is_default_version. Rename insdef to insdefault.
8822 (Symbol_table::add_from_relobj): Rename def to is_default_version
8823 and local to is_forced_local.
8824 (Symbol_table::add_from_pluginobj): Likewise.
8825 (Symbol_table::add_from_dynobj): Likewise.
8826 (Symbol_table::define_special_symbol): Rename insdef to
8827 insdefault.
8828
fe35d28d
ILT
88292010-01-04 Ian Lance Taylor <iant@google.com>
8830
30bc8c46
ILT
8831 PR 10980
8832 * options.h (class General_options): Add
8833 --allow-multiple-definition and -z muldefs.
8834 * resolve.cc (Symbol_table::should_override): Don't warn about a
8835 multiple symbol definition if --allow-multiple-definition or -z
8836 muldefs.
8837
7eaea549
ILT
8838 PR 10980
8839 * options.h (class General_options): Add --add-needed and
8840 --copy-dt-needed-entries. Tweak --as-needed help entry.
8841 * object.cc (Input_objects::check_dynamic_dependencies): Give an
8842 error if --copy-dt-needed-entries aka --add-needed is used and
8843 would cause a change in behaviour.
8844
fe35d28d
ILT
8845 PR 10980
8846 * options.h (class General_options): Add -G as a short version of
8847 --shared. Add no-op options -assert, -g, and -i.
8848
55a2bb35
ST
88492010-01-04 Sriraman Tallam <tmsriram@google.com>
8850
8851 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
8852 check for .text or .gnu.linkonce.t sections.
8853 * icf.cc (Icf::find_identical_sections): Ditto.
8854 Change the detection for mangled function name within the section
8855 name.
8856 * icf.h (is_section_foldable_candidate): New function.
8857
719328e1
ILT
88582009-12-30 Ian Lance Taylor <iant@google.com>
8859
8860 PR 10980
8861 * options.h (class General_options): Permit two dashes with
8862 --retain-symbols-file.
8863
d7bb5745
ILT
88642009-12-30 Ian Lance Taylor <iant@google.com>
8865
403a15dd
ILT
8866 PR 10979
8867 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
8868 don't put the file header and segment headers in the text
8869 segment.
8870
eda294df
ILT
8871 PR 10979
8872 * common.cc (Sort_commons::operator()): Stabilize sort when both
8873 entries are NULL.
8874 (Symbol_table::do_allocate_commons_list): When allocating common
8875 symbols, skip a symbol which is no longer common.
8876 * symtab.h (Symbol::is_common): Test whether the symbol comes from
8877 an object before checking its type.
8878 * testsuite/common_test_2.c: New file.
8879 * testsuite/common_test_3.c: New file.
8880 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
8881 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
8882 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
8883 (common_test_2_pic.o, common_test_2.so): New targets.
8884 (common_test_3_pic.o, common_test_3.so): New targets.
8885 * testsuite/Makefile.in: Rebuild.
8886
d7bb5745
ILT
8887 PR 10979
8888 * script.cc (read_input_script): If we see a new SECTIONS clause,
8889 and we have added an input section, give an error.
8890 * layout.h (class Layout): Add have_added_input_section function.
8891 Add have_added_input_section_ field.
8892 * layout.cc (Layout::Layout): Initialize
8893 have_added_input_section_.
8894 (Layout::layout): Set have_added_input_section_.
8895 (Layout::layout_eh_frame): Likewise.
8896
fc59c572
ILT
88972009-12-30 Ian Lance Taylor <iant@google.com>
8898
8899 PR 10931
8900 * options.h (class General_options): Add --sort-common option.
8901 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
8902 * common.cc (Sort_common): Add sort_order parameter to
8903 constructor. Add sort_order_ field.
8904 (Sort_commons::operator): Check sort_order_.
8905 (Symbol_table::allocate_commons): Determine the sort order.
8906 (Symbol_table::do_allocate_commons): Add sort_order parameter.
8907 Change all callers.
8908 (Symbol_table::do_allocate_commons_list): Likewise.
8909
1c74fab0
ILT
89102009-12-30 Ian Lance Taylor <iant@google.com>
8911
8912 PR 10916
8913 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
8914 symbols from this object, don't change the visibility of an
8915 undefined symbol.
8916 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
8917
6affe781
ILT
89182009-12-30 Ian Lance Taylor <iant@google.com>
8919
8920 PR 10861
8921 * script.h (class Version_script_info): Define Language enum.
8922 Update declarations. Define Glob, Exact, and Lookup types. Add
8923 new fields globals_, locals_, and is_finalized_.
8924 * script.cc: Various formatting fixes.
8925 (class Parser_closure): Change language_stack_ from a vector of
8926 std::string to one of Version_script_info::Language. Adjust all
8927 uses accordingly.
8928 (class Lazy_demangler): Remove.
8929 (struct Version_expression): Change language from std::string to
8930 Version_script_info::Language.
8931 (Version_script_info::Version_script_info): New function.
8932 (Version_script_info::~Version_script_info): Don't call clear.
8933 (Version_script_info::finalize): New function.
8934 (Version_script_info::build_lookup_tables): New function.
8935 (Version_script_info::build_expression_list_lookup): New
8936 function.
8937 (Version_script_info::get_symbol_version_helper): Rewrite to use
8938 lookup tables.
8939 (Version_script_info::print_expression_list): Adjust to use
8940 Version_script_info::Language.
8941 (script_push_lex_into_version_mode): Check that the version script
8942 has not been finalized.
8943 (version_script_push_lang): Change language string to
8944 Version_script_info::Language.
8945 * options.cc (Command_line::version_script): New function.
8946 * options.h (class General_options): Add finalize_dynamic_list
8947 function. Change version_script from declaration to definition.
8948 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
8949 * testsuite/version_script.map: Remove duplicate def of foo.
8950 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
8951 version_script.map.
8952 * testsuite/Makefile.in: Rebuild.
8953
818bf354
ILT
89542009-12-30 Ian Lance Taylor <iant@google.com>
8955
8956 PR 10843
8957 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
8958 if the input symbol index is 0, make the output symbol index 0.
8959
ebcc8304
ILT
89602009-12-30 Ian Lance Taylor <iant@google.com>
8961
8962 PR 10670
8963 * options.h (class General_options): Add -x/--discard-all.
8964 * object.cc (Sized_relobj::do_count_local_symbols): Handle
8965 --discard-all. If the local symbol needs a dynamic entry, check
8966 that before handling --discard-locals.
8967
176fe33f
ILT
89682009-12-30 Ian Lance Taylor <iant@google.com>
8969
bb321bb1
ILT
8970 PR 10450
8971 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
8972 flags to PF_R.
8973 (Output_segment::add_output_section): Don't change the flags if
8974 the type is PT_TLS.
8975
176fe33f
ILT
8976 PR 10450
8977 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
8978 GNU hash table if they need a dynamic value. Otherwise, don't add
8979 them if they are defined in a dynamic object or are forced local.
8980
e8cd95c7
ILT
89812009-12-29 Ian Lance Taylor <iant@google.com>
8982
1b81fb71
ILT
8983 PR 10450
8984 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
8985 .gnu.hash table for a 32-bit target.
8986
8d6d383d
ILT
8987 PR 10450
8988 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
8989 regular and a dynamic object only needs a dynamic symbol table
8990 entry if it is externally visible.
8991
e785ec03
ILT
8992 PR 10450
8993 * i386.cc (class Target_i386): Initialize global_offset_table_ in
8994 constructor. Add global_offset_table_ field.
8995 (Target_i386::got_section): Set global_offset_table_.
8996 (Target_i386::do_finalize_sections): Set global_offset_table_
8997 size.
8998 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
8999 in constructor. Add global_offset_table_ field.
9000 (Target_x86_64::got_section): Set global_offset_table_.
9001 (Target_x86_64::do_finalize_sections): Set global_offset_table_
9002 size.
9003
1a2dff53
ILT
9004 * layout.cc (Layout::Layout): Initialize increase_relro_.
9005 (Layout::get_output_section): Add is_relro, is_last_relro, and
9006 is_first_non_relro parameters. Change all callers.
9007 (Layout::choose_output_section): Likewise.
9008 (Layout::add_output_section_data): Likewise.
9009 (Layout::make_output_section): Likewise.
9010 (Layout::set_segment_offsets): Clear increase_relro when using a
9011 linker script.
9012 * layout.h (class Layout): Add increase_relro method. Add
9013 increase_relro_ field. Update declarations.
9014 * output.cc (Output_section::Output_section): Initialize
9015 is_last_relro_ and is_first_non_relro_.
9016 (Output_segment::add_output_section): Group relro sections is
9017 do_sort is true. Handle is_last_relro and is_first_non_relro.
9018 (Output_segment::maximum_alignment): Remove relro handling.
9019 (Output_segment::set_section_addresses): Add increase_relro
9020 parameter. Change all callers. Add initial alignment to align
9021 relro sections on separate page. Remove old relro handling.
9022 (Output_segment::set_section_list_addresses): Remove in_relro
9023 parameter. Change all callers.
9024 (Output_segment::set_offset): Add increase parameter. Change all
9025 callers. Remove old relro handling.
9026 * output.h (class Output_section): Add new methods: is_last_relro,
9027 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
9028 Add is_last_relro_ and is_first_non_relro_ fields.
9029 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
9030 Create separate .got.plt section. Call increase_relro.
9031 * x86_64.cc (Target_x86_64::got_section): Likewise.
9032 * testsuite/relro_script_test.t: Add .got.plt.
9033
f0ba79e2
ILT
9034 PR 10450
9035 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
9036 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
9037 (Layout::finalize): Call set_dynamic_symbol_size.
9038 (Layout::set_dynamic_symbol_size): New function.
9039 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
9040 set_dynamic_symbol_size.
9041
e8cd95c7
ILT
9042 PR 10450
9043 * output.h (class Output_section): Add is_entsize_zero_ field.
9044 * output.cc (Output_section::Output_section): Initialize
9045 is_entsize_zero_.
9046 (Output_section::set_entsize): If two different entsizes are
9047 requested, force it to zero.
9048 (Output_section::add_input_section): Set flags for .debug_str
9049 before updating section flags. Set entsize.
9050 (Output_section::update_flags_for_input_section): Set SHF_MERGE
9051 and SHF_STRING if all input sections have those flags.
9052
3e1b9a8a
RÁE
90532009-12-29 Rafael Espindola <espindola@google.com>
9054
9055 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
9056 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
9057 reporting.
3e1b9a8a 9058
3dcad376
ST
90592009-12-29 Sriraman Tallam <tmsriram@google.com>
9060
9061 * options.cc (General_options::parse_version): Allow -v to exit
9062 without an error if there is nothing to link.
9063
084e2665
ILT
90642009-12-29 Ian Lance Taylor <iant@google.com>
9065
9066 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
9067 using a version of gcc before 4.1.
9068 * configure: Rebuild.
9069
250acde3
CD
90702009-12-28 Chris Demetriou <cgd@google.com>
9071
9072 * attributes.cc (Output_attributes_section_data::do_write): Use
9073 std::vector::front rather than std::vector::data.
9074
99fff23b
ILT
90752009-12-28 Ian Lance Taylor <iant@google.com>
9076
9077 * symtab.h (class Symbol_table): Add enum Defined.
9078 * resolve.cc (Symbol_table::should_override): Add defined
9079 parameter. Change all callers. Test whether object is NULL
9080 before calling a method on it.
9081 (Symbol_table::report_resolve_problem): Add defined parameter.
9082 Change all callers.
9083 (Symbol_table::should_override_with_special): Likewise.
9084 * symtab.cc (Symbol_table::define_in_output_data): Add defined
9085 parameter. Change all callers.
9086 (Symbol_table::do_define_in_output_data): Likewise.
9087 (Symbol_table::define_in_output_segment): Likewise.
9088 (Symbol_table::do_define_in_output_segment): Likewise.
9089 (Symbol_table::define_as_constant): Likewise.
9090 (Symbol_table::do_define_as_constant): Likewise.
9091 * script.h (class Symbol_assignment): Add is_defsym parameter to
9092 constructor; change all callers.
9093 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
9094 parameter. Change all callers. Add is_defsym_ field.
9095 (class Parser_closure): Add parsing_defsym parameter to
9096 constructor; change all callers. Add parsing_defsym accessor
9097 function. Add parsing_defsym_ field.
9098
556bd683
ILT
90992009-12-28 Ian Lance Taylor <iant@google.com>
9100
9101 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 9102 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 9103
1782c879
ILT
91042009-12-23 Ian Lance Taylor <iant@google.com>
9105
9106 * i386.cc (Target_i386::do_calls_non_split): Recognize
9107 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
9108 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
9109 -fsplit-stack prologue when using %r11.
1782c879 9110
329ca2b1
ST
91112009-12-21 Sriraman Tallam <tmsriram@google.com>
9112
9113 * options.cc (General_options::parse_version): Make -v continue and do
9114 the link like GNU ld does.
9115
d675ff46
RÁE
91162009-12-17 Rafael Avila de Espindola <espindola@google.com>
9117
9118 * Makefile.am (CCFILES): Add timer.cc.
9119 (HFILES): Add timer.h.
9120 * configure.ac: Check for sysconf and times.
9121 * main.cc: include timer.h.
9122 (main): Use Timer instead of get_run_time.
9123 * timer.cc: New.
9124 * timer.h: New.
9125 * workqueue.cc: include timer.h.
9126 (Workqueue::find_and_run_task):
9127 Report user, sys and wall time.
9128 * Makefile.in: Regenerate.
9129 * config.in: Regenerate.
9130 * configure: Regenerate.
9131
d6344fb5
DK
91322009-12-16 Doug Kwan <dougkwan@google.com>
9133
9134 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
9135 sections.
9136 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
9137 relaxed input sections.
9138 * output.cc (Output_section::find_relaxed_input_section): Change
9139 return type to Output_relaxed_input_section pointer. Adjust code
9140 for new type of relaxed_input_section_map_.
9141 * output.h (Output_section::find_relaxed_input_section): Change
9142 return type to Output_relaxed_input_section pointer.
9143 (Output_section::Output_relaxed_input_section_by_input_section_map):
9144 New type.
9145 (Output_section::relaxed_input_section_map_): Change type to
9146 Output_section::Output_relaxed_input_section_by_input_section_map.
9147 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
9148 input section.
9149
0e0d5469
ILT
91502009-12-15 Ian Lance Taylor <iant@google.com>
9151
9152 * layout.cc (Layout::create_shstrtab): Only write out after input
9153 sections if we are compressing debug sections.
9154
0649a889
ILT
91552009-12-15 Ian Lance Taylor <iant@google.com>
9156
9157 * archive.cc (Archive::add_symbols): Only look up a symbol without
9158 a version if there is, in fact, a version.
9159
2ea97941
ILT
91602009-12-14 Ian Lance Taylor <iant@google.com>
9161
9162 Revert -Wshadow changes, all changes from:
9163 2009-12-11 Doug Kwan <dougkwan@google.com>
9164 2009-12-11 Nick Clifton <nickc@redhat.com>
9165 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
9166
b0eec2cc
DK
91672009-12-11 Doug Kwan <dougkwan@google.com>
9168
9169 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
9170 due to -Wshadow.
9171 * attributes.cc (Object_attribute::size): Ditto.
9172 (Attributes_section_data::size): Ditto.
9173 (Attributes_section_data::Attributes_section_data): Ditto.
9174 (Output_attributes_section_data::do_write): Ditto.
9175 * attributes.h (Object_attribute::set_type): Ditto.
9176 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
9177
91d6fa6a
NC
91782009-12-11 Nick Clifton <nickc@redhat.com>
9179
9180 * archive.cc: Fix shadowed variable warnings.
9181 * arm.cc: Likewise.
9182 * compressed_output.cc: Likewise.
9183 * compressed_output.h: Likewise.
9184 * configure: Likewise.
9185 * dwarf_reader.cc: Likewise.
9186 * dynobj.cc: Likewise.
9187 * dynobj.h: Likewise.
9188 * ehframe.cc: Likewise.
9189 * ehframe.h: Likewise.
9190 * errors.cc: Likewise.
9191 * expression.cc: Likewise.
9192 * fileread.cc: Likewise.
9193 * fileread.h: Likewise.
9194 * freebsd.h: Likewise.
9195 * i386.cc: Likewise.
9196 * icf.cc: Likewise.
9197 * incremental.h: Likewise.
9198 * layout.cc: Likewise.
9199 * layout.h: Likewise.
9200 * mapfile.cc: Likewise.
9201 * merge.cc: Likewise.
9202 * merge.h: Likewise.
9203 * object.cc: Likewise.
9204 * object.h: Likewise.
9205 * options.h: Likewise.
9206 * output.cc: Likewise.
9207 * output.h: Likewise.
9208 * parameters.cc: Likewise.
9209 * plugin.cc: Likewise.
9210 * powerpc.cc: Likewise.
9211 * reduced_debug_output.cc: Likewise.
9212 * reduced_debug_output.h: Likewise.
9213 * reloc.cc: Likewise.
9214 * reloc.h: Likewise.
9215 * resolve.cc: Likewise.
9216 * script-sections.cc: Likewise.
9217 * script.cc: Likewise.
9218 * script.h: Likewise.
9219 * sparc.cc: Likewise.
9220 * symtab.cc: Likewise.
9221 * symtab.h: Likewise.
9222 * target-select.cc: Likewise.
9223 * target-select.h: Likewise.
9224 * token.h: Likewise.
9225 * workqueue.cc: Likewise.
9226 * workqueue.h: Likewise.
9227 * x86_64.cc: Likewise.
9228
a0351a69
DK
92292009-12-10 Doug Kwan <dougkwan@google.com>
9230
9231 * arm.cc (attributes.h): New include.
9232 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
9233 (Arm_relobj::~Arm_relobj): Delete object pointed by
9234 attributes_section_data_.
9235 (Arm_relobj::attributes_section_data): New method definition.
9236 (Arm_relobj::attributes_section_data_): New data member declaration.
9237 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
9238 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
9239 attributes_section_data_.
9240 (Arm_dynobj::attributes_section_data): New method definition.
9241 (Arm_dynobj::attributes_section_data_): New data member declaration.
9242 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
9243 initialization value of may_use_blx_ to false.
2e702c99 9244 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
9245 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
9246 object attributes to compute results instead of hard-coding.
9247 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
9248 Target_arm::get_secondary_compatible_arch,
9249 Target_arm::set_secondary_compatible_arch
9250 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
9251 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
9252 New method declarations.
9253 (Target_arm::get_aeabi_object_attribute): New method definition.
9254 (Target_arm::attributes_section_data_): New data member declaration.
9255 (read_arm_attributes_section): New template definition.
9256 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
9257 (Arm_dynobj::do_read_symbols): Ditto.
9258 (Target_arm::do_finalize_sections): Merge attributes sections from
9259 input. Check for BLX use after attributes section merging.
9260 Fix __exidx_start and __exidx_end visibility. Create an
9261 .ARM.attributes section if necessary.
9262 (Target_arm::get_secondary_compatible_arch,
9263 Target_arm::set_secondary_compatible_arch,
9264 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
9265 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 9266 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
9267 New method definitions.
9268
b59befec
ILT
92692009-12-09 Ian Lance Taylor <iant@google.com>
9270
9271 * plugin.cc (Plugin::load): Don't cast from void* to a function
9272 pointer.
9273
1276bc89
ILT
92742009-12-09 Ian Lance Taylor <iant@google.com>
9275
9276 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
9277 information fields.
9278
2f2de248
L
92792009-12-09 H.J. Lu <hongjiu.lu@intel.com>
9280
9281 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
9282 Replace two_file_shared_1.so with two_file_shared_2.so.
9283 * testsuite/Makefile.in: Regenerated.
9284
4f787271
DK
92852009-12-08 Doug Kwan <dougkwan@google.com>
9286
9287 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
9288 (HFILES): Add attributes.h and int_encoding.h.
9289 * Makefile.in: Regenerate.
9290 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
9291 function definitions to int_encoding.cc
9292 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
9293 prototypes to int_encoding.h
9294 * reduced_debug_output.cc (int_encoding.h): New include.
9295 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
9296 function definitions to int_encoding.cc
9297 (insert_into_vector, read_from_pointer): Move template definitions to
9298 int_encoding.h
9299 * attributes.cc: New file.
9300 * attributes.h: New file.
9301 * int_encoding.cc: New file.
9302 * int_encoding.h: New file.
9303
20b52f1a
RÁE
93042009-12-07 Rafael Avila de Espindola <espindola@google.com>
9305
9306 PR gold/11055
9307 * incremental-dump.cc (dump_incremental_inputs): New.
9308 (main): Use dump_incremental_inputs.
9309
53d7974c
L
93102009-12-07 H.J. Lu <hongjiu.lu@intel.com>
9311
9312 PR gold/10893
9313 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
9314 checking elfcpp::STT_FUNC.
9315 (Target_i386::Relocate::relocate): Likewise.
9316 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
9317
9318 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
9319 symbols from shared libraries into normal FUNC symbols.
9320
9321 * symtab.h (Symbol): Add is_func and use it.
9322
05a352e6
DK
93232009-12-05 Doug Kwan <dougkwan@google.com>
9324
9325 * arm.cc (Target_arm::arm_info): Initialize new fields
9326 attributes_section and attributes_vendor.
9327 * i386.cc (Target_i386::i386_info): Same.
9328 * object.cc (Sized_relobj::do_layout): Skip attribute section.
9329 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
9330 fields attributes_section and attributes_vendor.
53d7974c 9331 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
9332 * target.h (Target::attributes_section, Target::attributes_vendor,
9333 Target::is_attributes_section, Target::attribute_arg_type,
9334 Target::attributes_order): New method definitions.
9335 (Target::Target_info::attributes_section,
9336 Target::Target_info::attributes_vendor): New fields.
9337 (Target::do_attribute_arg_type, Target::do_attributes_order): New
9338 virtual method definitions.
9339 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
9340 attributes_section and attributes_vendor.
9341 * testsuite/testfile.cc (Target_test::test_target_info): Same.
9342
f4e5969c
DK
93432009-12-05 Doug Kwan <dougkwan@google.com>
9344
9345 * arm.cc: Update comments about interworking and stub generation.
9346 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
9347 considered as non-PIC.
9348 (Arm_relocate_functions::base_abs): Fix formatting.
9349 (Arm_relocate_functions::got_prel): Fix comment. Change interface
9350 of function to use GOT entry address instead of offset.
9351 (Target_arm::Scan::global): Issue an error if a symbol would need a
9352 PLT does not get one because it is untyped. Remove code to create
9353 dynamic symbols for relative branches.
9354 (Target_arm::Relocate::relocate: Use 0 instead of false since function
9355 takes unsigned integer instead of boolean.
9356
1abce4a6
L
93572009-12-05 H.J. Lu <hongjiu.lu@intel.com>
9358
9359 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
9360 (two_file_test_LDADD): Likewise.
9361 (common_test_1_LDADD): Likewise.
9362 (exception_test_LDADD) Likewise.
9363 (weak_test_LDADD): Likewise.
9364 (many_sections_test_LDADD): Likewise.
9365 (initpri1_LDADD): Likewise.
9366 (script_test_1_LDADD): Likewise.
9367 (script_test_2_LDADD): Likewise.
9368 (justsyms_LDADD): Likewise.
9369 (binary_test_LDADD): Likewise.
9370 (large_LDADD): Likewise.
9371 * testsuite/Makefile.in: Regenerated.
9372
adcf2816 93732009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 9374
adcf2816
L
9375 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
9376 (Symbol_table::override_with_special): Likewise.
9377 (Symbol_table::add_from_object): Likewise.
9378
28e67f5d
RÁE
93792009-12-04 Rafael Avila de Espindola <espindola@google.com>
9380
9381 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
9382 Don't set the data_offset twice.
9383
ae10a101
RÁE
93842009-12-04 Rafael Avila de Espindola <espindola@google.com>
9385
9386 * testsuite/Makefile.in: Regenerate.
9387
f59f41f3
DK
93882009-12-03 Doug Kwan <dougkwan@google.com>
9389
9390 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
9391 (Target_arm::do_finalize_sections): Add parameter for symbol table
9392 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
9393 * i386.cc (Target_i386::do_finalize_sections): Add an additional
9394 parameter for symbol table pointer.
9395 * layout.cc (Layout::finalize): Call Target::finalize_sections with
9396 an additional parameter for a pointer to symbol table.
9397 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
9398 parameter for a symbol table pointer.
9399 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
9400 * target.h (Target::finalize_sections, Target::do_finalize_sections):
9401 Ditto.
9402 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
9403 parameter for a symbol table pointer.
9404
ca55d848
RÁE
94052009-12-03 Rafael Avila de Espindola <espindola@google.com>
9406
9407 * incremental.cc (Incremental_inputs_header)
9408 (Incremental_inputs_header_write, Incremental_inputs_entry)
9409 (Incremental_inputs_entry_write): Move ...
9410 * incremental.h (Incremental_inputs_header)
9411 (Incremental_inputs_header_write, Incremental_inputs_entry)
9412 (Incremental_inputs_entry_write): here.
9413
3aec4f9c
RÁE
94142009-12-02 Rafael Avila de Espindola <espindola@google.com>
9415
9416 * incremental.cc (make_sized_incremental_binary): Set the target.
9417 Error if it is incompatible.
9418 * output.h (Output_file): Add filename method.
9419
9c0ae74d
RÁE
94202009-12-02 Rafael Avila de Espindola <espindola@google.com>
9421
9422 * incremental.cc (Incremental_inputs_entry): Remove unused argument
9423 from the get_* methods.
9424
a45500ae
RÁE
94252009-12-02 Rafael Avila de Espindola <espindola@google.com>
9426
9427 * incremental-dump.cc (main): Check that the offeset of a script is 0.
9428 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
9429 Write 0 for the data_offset of scripts.
9430
325e6408
RÁE
94312009-12-02 Rafael Avila de Espindola <espindola@google.com>
9432
9433 * testsuite/Makefile.am: Add the incremental_test.sh test.
9434 * testsuite/incremental_test.sh: New.
9435 * testsuite/incremental_test_1.c: New.
9436 * testsuite/incremental_test_2.c: New.
9437
954c3e2e
RÁE
94382009-12-01 Rafael Avila de Espindola <espindola@google.com>
9439
703d02da 9440 * incremental-dump.cc (main): Fix typos.
954c3e2e 9441
f8086623
RÁE
94422009-11-27 Rafael Avila de Espindola <espindola@google.com>
9443
9444 PR gold/11025
9445 * incremental-dump.cc (main): Use llu to print 64 bit values.
9446
3b0dd6ac
L
94472009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
9448 H.J. Lu <hongjiu.lu@intel.com>
9449
9450 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
9451 $(LIBDL).
9452 (incremental_dump_LDADD): Likewise.
9453 * Makefile.in: Regenerated.
9454
a6d1ef57 94552009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 9456
a6d1ef57
DK
9457 Revert:
9458
9459 2009-11-25 Doug Kwan <dougkwan@google.com>
9460
9461 * arm.cc (Target_arm::Target_arm): Move method definition
9462 outside of class definition. Add code to handle
9463 --target1-rel, --target1-abs and --target2= options.
9464 (Target_arm::get_reloc_reloc_type): Change method to be
9465 non-static and const.
9466 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
9467 New data member declaration.
9468 (Target_arm::Scan::local, Target_arm::Scan::global,
9469 Target_arm::Relocate::relocate,
9470 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9471 Adjust call to Target_arm::get_real_reloc_type.
9472 (Target_arm::get_real_reloc_type): Use command line options
9473 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
9474 * options.h (--target1-rel, --target1-abs, --target2): New
9475 ARM-only options.
9476
50aeb7d4
DK
94772009-11-25 Doug Kwan <dougkwan@google.com>
9478
9479 * arm.cc (Target_arm::Target_arm): Move method definition outside of
9480 class definition. Add code to handle --target1-rel, --target1-abs
9481 and --target2= options.
9482 (Target_arm::get_reloc_reloc_type): Change method to be non-static
9483 and const.
9484 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
9485 member declaration.
9486 (Target_arm::Scan::local, Target_arm::Scan::global,
9487 Target_arm::Relocate::relocate,
9488 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
9489 call to Target_arm::get_real_reloc_type.
9490 (Target_arm::get_real_reloc_type): Use command line options to
9491 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
9492 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
9493 options.
9494
51938283
DK
94952009-11-25 Doug Kwan <dougkwan@google.com>
9496
9497 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
9498 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
9499 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
9500 formatting.
9501 (Arm_relocate_functions::thm_call): Replace body with a call to
9502 Arm_relocate_functions::thumb_branch_common.
9503 (Arm_relocate_functions::thm_jump24,
9504 Arm_relocate_functions::thm_xpc22): New method definitions.
9505 (Arm_relocate_functions::thumb_branch_common): New method definition.
9506 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
9507 operator.
9508 (Target_arm::Relocate::relocate): Adjust call to thm_call.
9509 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
9510
e2b8f3c4
RÁE
95112009-11-24 Rafael Avila de Espindola <espindola@google.com>
9512
9513 * Makefile.am: Build incremental-dump
9514 * Makefile.in: Regenerate.
9515 * incremental-dump.cc: New.
9516 * incremental.cc (Incremental_inputs_header_data,
9517 Incremental_inputs_entry_data): Move to incremental.h
9518 * incremental.h: (Incremental_inputs_header_data,
9519 Incremental_inputs_entry_data): Move from incremental.cc
9520
bcba9aec
RÁE
95212009-11-24 Rafael Avila de Espindola <espindola@google.com>
9522
9523 * incremental.cc (Incremental_inputs_header,
9524 Incremental_inputs_header_write, Incremental_inputs_entry,
9525 Incremental_inputs_entry_write): Add a typedef with the data type.
9526
7c3afe08
RÁE
95272009-11-24 Rafael Avila de Espindola <espindola@google.com>
9528
9529 * incremental.cc (Incremental_inputs_header,
9530 Incremental_inputs_header_write, Incremental_inputs_entry,
9531 Incremental_inputs_entry_write): Update comment about which
9532 type has the filed descriptions.
9533
d204b6e9
DK
95342009-11-15 Doug Kwan <dougkwan@google.com>
9535
9536 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
9537 (Arm_relocate_functions::arm_branch_common): Change method defintion
9538 in class definition to a method declaration and update list of formal
9539 parameters.
9540 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
9541 Arm_relocation_functions::jump24): Adjust call to
9542 Arm_relocate_functions::arm_branch_common. Update list of formal
9543 parameters.
9544 (Arm_relocate_functions::xpc25): New method definition.
9545 (Arm_relocate_functions::arm_branch_common): Move method defintion
9546 out from class definition. Use stubs for mode-switching and extending
9547 branch ranges.
9548 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
9549 specially. Change code to enable use of stubs in ARM branches.
9550
43d12afe
DK
95512009-11-10 Doug Kwan <dougkwan@google.com>
9552
9553 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
9554 in method declaration.
9555 (Target_arm::relocate_stub): New method declaration.
9556 (Target_arm::default_target): Change to return a pointer instead of
9557 a const reference.
9558 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
9559 Target_arm::default_target.
9560 (Arm_Relobj::do_relocate_sections): Remove options paramater in
9561 method definition.
9562 (Target_arm::relocate_section): Adjust view.
9563 (Target_arm::relocate_stub): New method definition.
9564
ac33a407
DK
95652009-11-10 Doug Kwan <dougkwan@google.com>
9566
9567 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
9568 a format warning.
9569 * incremental.cc (open_incremental_binary): Initialized local
9570 variables to avoid warnings.
9571 * object.cc (make_elf_object): Ditto.
9572 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
9573 a format warning.
e1df38aa 9574
88ee28e9
L
9575009-11-09 H.J. Lu <hongjiu.lu@intel.com>
9576
9577 PR gold/10930
9578 * testsuite/plugin_test.c: Include "config.h".
9579
2daedcd6
DK
95802009-11-09 Doug Kwan <dougkwan@google.com>
9581
9582 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
9583 (arm_symbol_value): Remove.
9584 (Arm_relocate_functions::arm_branch_common,
9585 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
9586 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
9587 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
9588 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
9589 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
9590 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
9591 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
9592 Arm_relocate_functions::thm_mobw_abs_nc,
9593 Arm_relocate_functions::thm_mov_abs,
9594 Arm_relocate_functions::movw_prel_nc,
9595 Arm_relocate_functions::thm_movt_abs,
9596 Arm_relocate_functions::movt_prel,
9597 Arm_relocate_functions::thm_movw_prel_nc,
9598 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
9599 (Target_arm::Relocate::relocate): Only decompose address into two
9600 parts if relocation type uses the thumb-bit and pass the actual
9601 bit instead of a flag indicating that the thumb-bit is used. Adjust
9602 calls to methods in Arm_relocate_functions for this change.
9603
1276bc89 96042009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
9605
9606 PR 10925
9607 * reloc.cc: Instantiate
9608 Sized_relobj::initialize_input_to_output_maps and
9609 Sized_relobj:free_input_to_output_maps.
9610
e53ad1b5
ILT
96112009-11-06 Ian Lance Taylor <iant@google.com>
9612
9613 PR 10876
9614 * defstd.cc (in_segment): Set only_if_ref true for "end".
9615
eb44217c
DK
96162009-11-06 Doug Kwan <dougkwan@google.com>
9617
9618 * arm.cc (class Reloc_stub): Correct a comment.
9619 (Target_arm::Target_arm): Initialize arm_input_section_map_.
9620 (Target_arm::scan_section_for_stubs): New method declaration.
9621 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
9622 Change methods from private to protected.
9623 (Target_arm::do_may_relax): New method definition.
9624 (Target_arm::do_relax, Target_arm::group_sections,
9625 Target_arm::scan_reloc_for_stub,
9626 Target_arm::scan_reloc_section_for_stubs): New method declarations.
9627 (Target_arm::arm_input_section_map_): New data member declaration.
9628 (Target_arm::scan_reloc_for_stub,
9629 Target_arm::scan_reloc_section_for_stubs,
9630 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
9631 Target_arm::do_relax): New method definitions.
9632
5d329b7d
ILT
96332009-11-06 Mikolaj Zalewski <mikolaj@google.com>
9634
9635 * configure.ac: Check for (struct stat)::st_mtim
9636 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
9637 * config.in: Regenerate.
9638 * configure: Regenerate.
9639
96a0d71b
ILT
96402009-11-05 Ian Lance Taylor <iant@google.com>
9641
9642 PR 10910
9643 * output.cc (Output_segment::add_output_section): Add missing
9644 return statement.
9645
594c8e5e
ILT
96462009-11-04 Ian Lance Taylor <iant@google.com>
9647
9648 PR 10880
9649 * object.h (class Object): Add is_needed and set_is_needed
9650 methods. Add is_needed_ field. Make bool fields into bitfields.
9651 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
9652 defined in a dynamic object and referenced by a regular object,
9653 set is_needed for the dynamic object.
9654 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
9655 if the file is marked with as_needed and it is not needed.
9656
22b127cc
ILT
96572009-11-04 Ian Lance Taylor <iant@google.com>
9658
9659 PR 10887
9660 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
9661 tags if data is discarded by linker script.
9662 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9663 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
9664 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
9665 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9666
f5c870d2
ILT
96672009-11-04 Ian Lance Taylor <iant@google.com>
9668
9669 * layout.cc (Layout::get_output_section): Add is_interp and
9670 is_dynamic_linker_section parameters. Change all callers.
9671 (Layout::choose_output_section): Likewise.
9672 (Layout::make_output_section): Likewise.
9673 (Layout::add_output_section_data): Add is_dynamic_linker_section
9674 parameter. Change all callers.
9675 * layout.h (class Layout): Update declarations.
9676 * output.h (class Output_section): Add is_interp, set_is_interp,
9677 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
9678 Add is_interp_, is_dynamic_linker_section_ fields. Change
9679 generate_code_fills_at_write_ to a bitfield.
9680 * output.cc (Output_section::Output_sections): Initialize new
9681 fields.
9682 (Output_segment::add_output_section): Add do_sort parameter.
9683 Change all callers.
9684
1ae4d23b
ILT
96852009-11-03 Ian Lance Taylor <iant@google.com>
9686
9687 PR 10860
9688 * options.h (class General_options): Add --warn-common.
9689 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
9690 merging two common symbols.
9691 (Symbol_table::should_override): Handle --warn-common when merging
9692 a common symbol with a defined symbol. Use report_resolve_problem
9693 for multiple definitions.
9694 (Symbol_table::report_resolve_problem): New function.
9695 * symtab.h (class Symbol_table): Declare report_resolve_problem.
9696
55da9579
DK
96972009-11-03 Doug Kwan <dougkwan@google.com>
9698
9699 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
9700 stub_factory_.
9701 (Target_arm::stub_factory): New method definition.
9702 (Target_arm::new_arm_input_section,
9703 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
9704 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 9705 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
9706 New type definitions.
9707 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
9708 member declarations.
9709 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
9710 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
9711 New method definitions.
9712
37a9ac43
ILT
97132009-11-03 Ian Lance Taylor <iant@google.com>
9714
9715 * options.h (class General_options): Add --warn_constructors.
9716
b3d6a3d4
ILT
97172009-11-03 Ian Lance Taylor <iant@google.com>
9718
9719 PR 10893
9720 * defstd.cc (in_section): Add entries for __rel_iplt_start,
9721 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
9722
934b01dd
ILT
97232009-11-03 Ian Lance Taylor <iant@google.com>
9724
9725 PR 10895
9726 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
9727 --msgid-bugs-address.
9728 (install-pdf): New target.
9729 (install-data_yes): Look up one directory to find mkinstalldirs.
9730
03c1939b
L
97312009-11-03 H.J. Lu <hongjiu.lu@intel.com>
9732
9733 * po/Make-in (.po.gmo): Don't generate .gmo files in source
9734 tree.
9735
ebd95253
DK
97362009-10-30 Doug Kwan <dougkwan@google.com>
9737
9738 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
9739
e9bbb538
DK
97402009-10-30 Doug Kwan <dougkwan@google.com>
9741
9742 * arm.cc (Stub_addend_reader): New struct template definition
9743 and partial specializations.
9744 (Stub_addend_reader::operator()): New method definition for a
9745 partially specialized template.
9746
d5b40221
DK
97472009-10-30 Doug Kwan <dougkwan@google.com>
9748
9749 * arm.cc (Arm_relobj::processor_specific_flags): New method
9750 definition.
9751 (Arm_relobj::do_read_symbols): New method declaration.
9752 (Arm_relobj::processor_specific_flags_): New data member declaration.
9753 (Arm_dynobj): New class definition.
9754 (Target_arm::do_finalize_sections): Add input_objects parameter.
9755 (Target_arm::do_adjust_elf_header): New method declaration.
9756 (Target_arm::are_eabi_versions_compatible,
9757 (Target_arm::merge_processor_specific_flags): New method declaration.
9758 (Target_arm::do_make_elf_object): New overloaded method definitions
9759 and declaration.
9760 (Arm_relobj::do_read_symbols): New method definition.
9761 (Arm_dynobj::do_read_symbols): Ditto.
9762 (Target_arm::do_finalize_sections): Add input_objects parameters.
9763 Merge processor-specific flags from all input objects.
9764 (Target_arm::are_eabi_versions_compatible,
9765 Target_arm::merge_processor_specific_flags,
9766 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
9767 New method definitions.
9768 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
9769 Input_objects pointer type parameter.
9770 * layout.cc (Layout::finalize): Pass input objects to target's.
9771 finalize_sections function.
9772 * output.cc (Output_file_header::do_sized_write): Set ELF file
9773 header's processor-specific flags.
9774 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
9775 Input_objects pointer type parameter.
9776 * sparc.cc (Target_sparc::do_finalize_sections): Same.
9777 * target.h (Input_objects): New forward class declaration.
9778 (Target::processor_specific_flags,
9779 Target::are_processor_specific_flags_sect): New method definitions.
9780 (Target::finalize_sections): Add input_objects parameter.
9781 (Target::Target): Initialize processor_specific_flags_ and
9782 are_processor_specific_flags_set_.
9783 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
9784 parameter.
9785 (Target::set_processor_specific_flags): New method definition.
9786 (Target::processor_specific_flags_,
9787 Target::are_processor_specific_flags_set_): New data member
9788 declarations.
9789 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
9790 Input_objects pointer type parameter.
9791
ebabffbd
DK
97922009-10-30 Doug Kwan <dougkwan@google.com>
9793
9794 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
9795
ad0f2072
ILT
97962009-10-28 Ian Lance Taylor <iant@google.com>
9797
9798 * object.h (class Relobj): Drop options parameter from
9799 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
9800 do_scan_relocs, do_relocate. Change all callers.
9801 (class Sized_relobj): Drop options parameters from
9802 do_gc_process_relocs, do_scan_relocs, do_relocate,
9803 do_relocate_sections, relocate_sections, emit_relocs_scan,
9804 emit_relocs_scan_reltype. Change all callers.
9805 (struct Relocate_info): Remove options field and all references to
9806 it.
9807 * reloc.h (class Read_relocs): Remove options constructor
9808 parameter and options_ field. Change all callers.
9809 (class Gc_process_relocs, class Scan_relocs): Likewise.
9810 (class Relocate_task): Likewise.
9811 * target-reloc.h (scan_relocs): Remove options parameter. Change
9812 all callers.
9813 (scan_relocatable_relocs): Likewise.
9814 * target.h (class Sized_target): Remove options parameter from
9815 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
9816 all callers.
9817 * gc.h (gc_process_relocs): Remove options parameter. Change all
9818 callers.
9819 * arm.cc: Update functions to remove options parameters.
9820 * i386.cc: Likewise.
9821 * powerpc.cc: Likewise.
9822 * sparc.cc: Likewise.
9823 * x86_64.cc: Likewise.
9824 * testsuite/testfile.cc: Likewise.
9825
8ffa3667
DK
98262009-10-28 Doug Kwan <dougkwan@google.com>
9827
9828 * arm.cc (Arm_relobj): New class definition.
e1df38aa 9829 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
9830 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
9831 New method definitions.
9832
40f36857
CC
98332009-10-28 Cary Coutant <ccoutant@google.com>
9834
9835 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
9836 (Plugin::cleanup_done_): New member.
9837 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
9838 (Plugin_manager::cleanup_done_): Remove.
9839 (Plugin_manager::add_input_file): Edit error message.
9840 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
9841 (Plugin_manager::cleanup): Remove use of cleanup_done_.
9842
2c849493
ILT
98432009-10-27 Mikolaj Zalewski <mikolajz@google.com>
9844
9845 * fileread.cc: (File_read::View::~View): Use the new
9846 data_ownership_ filed.
9847 (File_read::~File_read): Dispose the new whole_file_view_.
9848 (File_read::open): Mmap the whole file if needed.
9849 (File_read::open): Use whole_file_view_ instead of contents_.
9850 (File_read::find_view): Use whole_file_view_ if applicable.
9851 (File_read::do_read): Use whole_file_view_ instead of contents_.
9852 (File_read::make_view): Use whole_file_view_ instead of contents_,
9853 update File_read::View::View call.
9854 (File_read::find_or_make_view): Update File_read::View::View
9855 call.
9856 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
9857 remove contents_
9858 (File_read::View::Data_ownership): New enum.
9859 (File_read::View::View): Replace bool mapped_ with Data_ownership
9860 argument.
9861 (File_read::View::mapped_): Remove (replaced by data_ownership_).
9862 (File_read::View::data_ownership_): New field.
9863 (File_read::contents_): Remove (replaced by whole_file_view_).
9864 (File_read::whole_file_view_): New field.
9865 * options.h (class General_options): Add --keep-files-mapped.
9866
24998053
CC
98672009-10-27 Cary Coutant <ccoutant@google.com>
9868
9869 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
9870 * testsuite/Makefile.am (plugin_test_5): New test case.
9871 * testsuite/Makefile.in: Regenerate.
9872
72adc4fa
DK
98732009-10-25 Doug Kwan <dougkwan@google.com>
9874
9875 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
9876 from private to protected to allow access by child class.
9877 (Sized_relobj::do_relocate_sections): New method declaration.
9878 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 9879 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
9880 Sized_relobj::relocate_sections. Instantiate template explicitly
9881 for different target sizes and endianity.
9882
07f508a2
DK
98832009-10-24 Doug Kwan <dougkwan@google.com>
9884
9885 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
9886 (Arm_input_section::as_arm_input_section): New method.
9887 (Arm_output_section): New class definition.
9888 (Arm_output_section::create_stub_group,
9889 Arm_output_section::group_sections): New method definitions.
9890
10ad9fe5
DK
98912009-10-22 Doug Kwan <dougkwan@google.com>
9892
9893 * arm.cc (Arm_input_section): New class definition.
9894 (Arm_input_section::init, Arm_input_section:do_write,
9895 Arm_input_section::set_final_data_size,
9896 Arm_input_section::do_reset_address_and_file_offset): New method
9897 definitions.
9898
56ee5e00
DK
98992009-10-21 Doug Kwan <dougkwan@google.com>
9900
9901 * arm.cc (Stub_table, Arm_input_section): New forward class
9902 declarations.
9903 (Stub_table): New class defintion.
9904 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
9905 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
9906 New method definition.
9907
b569affa
DK
99082009-10-21 Doug Kwan <dougkwan@google.com>
9909
9910 * arm.cc: Update copyright comments.
9911 (Target_arm): New forward class template declaration.
9912 (Arm_address): New type.
9913 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
9914 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
9915 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
9916 constants.
9917 (Insn_template): Same.
9918 (DEF_STUBS): New macro.
9919 (Stub_type): New enum type.
9920 (Stub_template): New class definition.
9921 (Stub): Same.
9922 (Reloc_stub): Same.
9923 (Stub_factory): Same.
9924 (Target_arm::Target_arm): Initialize may_use_blx_ and
9925 should_force_pic_veneer_.
9926 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
9927 Target_arm::should_force_pic_veneer,
9928 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
9929 Target_arm::using_thumb_only, Target_arm:;default_target): New
9930 method defintions.
9931 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
9932 New data member declarations.
9933 (Insn_template::size, Insn_template::alignment): New method defintions.
9934 (Stub_template::Stub_template): New method definition.
9935 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
9936 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
9937 (Stub_factory::Stub_factory): New method definition.
9938 * gold.h (string_hash): New template.
9939 * output.h (Input_section_specifier::hash_value): Use
9940 gold::string_hash.
9941 (Input_section_specifier::string_hash): Remove.
9942 * stringpool.cc (Stringpool_template::string_hash): Use
9943 gold::string_hash.
9944
6c172549
DK
99452009-10-20 Doug Kwan <dougkwan@google.com>
9946
9947 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
9948 symbols of relaxed input sections.
9949 * output.h (Output_section::find_relaxed_input_section): Make
9950 method public.
9951
c5617f2f
DK
99522009-10-16 Doug Kwan <dougkwan@google.com>
9953
9954 * dynobj.cc (Versions::Versions): Initialize version_script_.
9955 Only insert base version symbol definition for a shared object
9956 if version script defines any version versions.
9957 (Versions::define_base_version): New method definition.
9958 (Versions::add_def): Check that base version is not needed.
9959 (Versions::add_need): Define base version lazily.
9960 * dynobj.h (Versions::define_base_version): New method declaration.
9961 (Versions::needs_base_version_): New data member declaration.
9962 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
9963 (check_DATA): Add no_version_test.stdout.
9964 (libno_version_test.so, no_version_test.o no_version_test.stdout):
9965 New make rules.
9966 * testsuite/Makefile.in: Regenerate.
9967 * testsuite/no_version_test.c: New file.
9968 * testsuite/no_version_test.sh: Ditto.
9969
3c12dcdb
DK
99702009-10-16 Doug Kwan <dougkwan@google.com>
9971
9972 * expression.cc (class Segment_start_expression): New class definition.
9973 (Segment_start_expression::value): New method definition.
9974 (script_exp_function_segment_start): Return a new
9975 Segment_start_expression.
9976 * gold/script-c.h (script_saw_segment_start_expression): New function
9977 prototype.
9978 * script-sections.cc (Script_sections::Script_sections): Initialize
9979 SAW_SEGMENT_START_EXPRESSION_ to false.
9980 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
9981 and -Tbbs options to specify section addresses if given in
9982 command line and no SEGMENT_START expression is seen in a script.
9983 * script-sections.h (Script_sections::saw_segment_start_expression,
9984 Script_sections::set_saw_segment_start_expression): New method
9985 definition.
9986 (Script_sections::saw_segment_start_expression_): New data member
9987 declaration.
9988 * script.cc (script_saw_segment_start_expression): New function.
9989 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
9990 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
9991 script_test_7.sh and script_test_8.sh.
9992 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
9993 script_test_8.stdout.
9994 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
9995 (script_test_6, script_test_6.stdout, script_test_7,
9996 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
9997 * Makefile.in: Regenerate.
9998 * testsuite/script_test_6.sh: New file.
9999 * testsuite/script_test_6.t: Same.
10000 * testsuite/script_test_7.sh: Same.
10001 * testsuite/script_test_7.t: Same.
10002 * testsuite/script_test_8.sh: Same.
10003
64b1ae37
DK
100042009-10-16 Doug Kwan <dougkwan@google.com>
10005
10006 * output.cc (Output_segment::set_section_list_address): Cast
10007 expressions to unsigned long long type to avoid format warnings.
10008
661be1e2
ILT
100092009-10-15 Ian Lance Taylor <iant@google.com>
10010
12edd763 10011 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 10012 dot assignment to script_sections_.
12edd763
ILT
10013 * script-sections.cc (Script_sections::add_dot_assignment):
10014 Initialize if necessary.
10015
68b6574b
ILT
10016 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
10017 program headers with no load segment if there is a linker script.
10018
661be1e2
ILT
10019 * layout.cc (Layout::set_segment_offsets): Align the file offset
10020 to the segment aligment for -N or -n with no load segment.
10021 * output.cc (Output_segment::add_output_section): Don't crash if
10022 the first section is a TLS section.
10023 (Output_segment::set_section_list_addresses): Print an error
10024 message if the address moves backward in a linker script.
10025 * script-sections.cc
10026 (Output_section_element_input::set_section_addresses): Don't
10027 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
10028 (Orphan_output_section::set_section_addresses): Likewise.
10029
f15f61a7
DK
100302009-10-15 Doug Kwan <dougkwan@google.com>
10031
10032 * layout.cc (Layout::finish_dynamic_section): Generate tags
10033 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
10034 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
10035 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
10036
82bb573a
ILT
100372009-10-14 Ian Lance Taylor <iant@google.com>
10038
10039 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
10040 fields.
10041 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
10042 data_shdr fields of relinfo.
10043 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
10044 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
10045 R_386_TLS_LDO_32, adjust based on section flags.
10046 (Target_i386::Relocate::fix_up_ldo): Remove.
10047
374ad285
ILT
100482009-10-13 Ian Lance Taylor <iant@google.com>
10049
10050 Add support for -pie.
10051 * options.h (class General_options): Add -pie and
10052 --pic-executable.
10053 (General_options::output_is_position_independent): Test -pie.
10054 (General_options::output_is_executable): Return true if not shared
10055 and not relocatable.
10056 (General_options::output_is_pie): Remove.
10057 * options.cc (General_options::finalize): Reject incompatible uses
10058 of -pie.
10059 * gold.cc (queue_middle_tasks): A -pie link is not static.
10060 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
10061 * symtab.cc (Symbol::final_value_is_known): Return false if
10062 output_is_position_independent.
10063 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
10064 output_is_position_independent.
10065 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
10066 output_is_position_independent.
10067 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
10068 output_is_position_independent.
10069 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
10070 two_file_pie_test.
10071 (basic_pie_test.o, basic_pie_test): New targets.
10072 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
10073 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
10074 (two_file_pie_test): New target.
10075 * testsuite/Makefile.in: Rebuild.
10076 * README: Remove note saying that -pie is not supported.
10077
c6585162
ILT
100782009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
10079
10080 * options.h (class General_options): Add -init and -fini.
10081 * layout.cc (Layout::finish_dynamic_section): Emit
10082 given init and fini functions.
10083
032ce4e9
ST
100842009-10-13 Sriraman Tallam <tmsriram@google.com>
10085
10086 * gc.h (gc_process_relocs): Check if icf is enabled using new
10087 function.
10088 * gold.cc (queue_initial_tasks): Likewise.
10089 (queue_middle_tasks): Likewise.
10090 * object.cc (do_layout): Likewise.
10091 * symtab.cc (is_section_folded): Likewise.
10092 * main.cc (main): Likewise.
10093 * reloc.cc (Read_relocs::run): Likewise.
10094 (Sized_relobj::do_scan_relocs): Likewise.
10095 * icf.cc (is_function_ctor_or_dtor): New function.
10096 (Icf::find_identical_sections): Check if function is ctor or dtor when
10097 safe icf is chosen.
10098 * options.h (General_options::icf): Change option to be an enum.
10099 (Icf_status): New enum.
10100 (icf_enabled): New method.
10101 (icf_safe_folding): New method.
10102 (set_icf_status): New method.
10103 (icf_status_): New variable.
10104 * (options.cc) (General_options::finalize): Set icf_status_.
10105 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
10106 icf_test and icf_keep_unique_test to use the --icf enum flag.
10107 * testsuite/icf_safe_test.sh: New file.
e1df38aa 10108 * testsuite/icf_safe_test.cc: New file.
032ce4e9 10109
f345227a
ST
101102009-10-12 Sriraman Tallam <tmsriram@google.com>
10111
10112 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
10113 includes to gc.h and icf.h.
10114 * arm.cc: Include gc.h.
10115 * gold.cc: Likewise.
10116 * i386.cc: Likewise.
10117 * powerpc.cc: Likewise.
10118 * sparc.cc: Likewise.
10119 * x86_64.cc: Likewise.
10120 * gc.h: Include icf.h.
10121
1c7814ed
ILT
101222009-10-11 Ian Lance Taylor <iant@google.com>
10123
10124 * plugin.cc: Include "gold.h" before other header files.
10125
ae3b5189
CD
101262009-10-10 Chris Demetriou <cgd@google.com>
10127
10128 * options.h (Input_file_argument::Input_file_type): New enum.
10129 (Input_file_argument::is_lib_): Replace with...
10130 (Input_file_argument::type_): New member.
10131 (Input_file_argument::Input_file_argument): Take Input_file_type
10132 'type' rather than boolean 'is_lib' as second argument.
10133 (Input_file_argument::is_lib): Use type_.
10134 (Input_file_argument::is_searched_file): New function.
10135 (Input_file_argument::may_need_search): Handle is_searched_file.
10136 * options.cc (General_options::parse_library): Support -l:filename.
10137 (General_options::parse_just_symbols): Update for Input_file_argument
10138 changes.
10139 (Command_line::process): Likewise.
10140 * archive.cc (Archive::get_file_and_offset): Likewise.
10141 * plugin.cc (Plugin_manager::release_input_file): Likewise.
10142 * script.cc (read_script_file, script_add_file): Likewise.
10143 * fileread.cc (Input_file::Input_file): Likewise.
10144 (Input_file::will_search_for): Handle is_searched_file.
10145 (Input_file::open): Likewise.
10146 * readsyms.cc (Read_symbols::get_name): Likewise.
10147 * testsuite/Makefile.am (searched_file_test): New test.
10148 * testsuite/Makefile.in: Regenerate.
10149 * testsuite/searched_file_test.cc: New file.
10150 * testsuite/searched_file_test_lib.cc: New file.
10151
f3048a1d
ILT
101522009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10153 Ian Lance Taylor <iant@google.com>
10154
10155 * descriptor.cc: Include <cstdio> and "binary-io.h".
10156 (Descriptors::open): Open the files in binary mode always.
10157 * script.cc (Lex::get_token): Treat \r as whitespace.
10158
d4780e57
ILT
101592009-10-09 Ian Lance Taylor <iant@google.com>
10160
10161 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
10162
d9a893b8
ILT
101632009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10164 Ian Lance Taylor <iant@google.com>
10165
10166 * configure.ac: Check for readv function also.
10167 * fileread.cc (readv): Define if not HAVE_READV.
10168 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
10169 does not exist.
10170 * config.in: Regenerate.
10171 * configure: Regenerate.
10172
c0a62865
DK
101732009-10-09 Doug Kwan <dougkwan@google.com>
10174
10175 * layout.cc (Layout::make_output_section): Call target hook to make
10176 ordinary output section.
10177 (Layout::finalize): Adjust parameter list of call the
10178 Target::may_relax().
10179 * layout.h (class Layout::section_list): New method.
10180 * merge.h (Output_merge_base::entsize): Change visibility to public.
10181 (Output_merge_base::is_string, Output_merge_base::do_is_string):
10182 New methods.
10183 (Output_merge_string::do_is_string): New method.
10184 * object.cc (Sized_relobj::do_setup): renamed from
10185 Sized_relobj::set_up.
10186 * object.h (Sized_relobj::adjust_shndx,
10187 Sized_relobj::initializ_input_to_output_maps,
10188 Sized_relobj::free_input_to_output_maps): Change visibilities to
10189 protected.
10190 (Sized_relobj::setup): Virtualize.
10191 (Sized_relobj::do_setup): New method declaration.
10192 (Sized_relobj::invalidate_section_offset,
10193 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
10194 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
10195 * options.cc (parse_int): New function.
10196 * options.h (parse_int): New declaration.
10197 (DEFINE_int): New macro.
10198 (stub_group_size): New option.
10199 * output.cc (Output_section::Output_section): Initialize memebers
10200 merge_section_map_, merge_section_by_properties_map_,
10201 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
10202 (Output_section::add_input_section): Handled deferred code-fill
10203 generation and remove an old comment.
10204 (Output_section::add_relaxed_input_section): New method definition.
10205 (Output_section::add_merge_input_section): Use merge section by
10206 properties map to speed to search. Update merge section maps
10207 as appropriate.
10208 (Output_section::build_relaxation_map): New method definition.
10209 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
10210 Same.
10211 (Output_section::relax_input_section): Renamed to
10212 Output_section::convert_input_sections_to_relaxed_sections and change
10213 interface to take a vector of pointers to relaxed sections.
10214 (Output_section::find_merge_section,
10215 Output_section::find_relaxed_input_section): New method definitions.
10216 (Output_section::is_input_address_mapped,
10217 Output_section::output_offset, Output_section::output_address):
10218 Use output section data maps to speed up searching.
10219 (Output_section::find_starting_output_address): Add comments.
10220 (Output_section::do_write,
10221 Output_section::write_to_postprocessing_buffer): Do code-fill
10222 generation as appropriate.
10223 (Output_section::get_input_sections): Invalidate relaxed input section
10224 map.
10225 (Output_section::restore_states): Adjust type of checkpoint .
10226 Invalidate relaxed input section map.
10227 * output.h (Output_merge_base): New class declaration.
10228 (Input_section_specifier): New class defintion.
10229 (class Output_relaxed_input_section) Change base class to
10230 Output_section_data_build.
10231 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
10232 base class initializer.
10233 (Output_section::add_relaxed_input_section): New method declaration.
10234 (Output_section::Input_section): Change visibility to protected.
2e702c99 10235 (Output_section::Input_section::relobj,
c0a62865
DK
10236 Output_section::Input_section::shndx): Handle relaxed input sections.
10237 Output_section::input_sections) Change visibility to protected. Also
10238 define overload to return a non-const pointer.
10239 (Output_section::Merge_section_properties): New class defintion.
10240 (Output_section::Merge_section_by_properties_map,
10241 Output_section::Output_section_data_by_input_section_map,
10242 Output_section::Relaxation_map): New types.
10243 (Output_section::relax_input_section): Rename method to
10244 Output_section::convert_input_sections_to_relaxed_sections and change
10245 interface to take a vector of relaxed section pointers.
10246 (Output_section::find_merge_section,
10247 Output_section::find_relaxed_input_section,
10248 Output_section::build_relaxation_map,
10249 Output_section::convert_input_sections_in_list_to_relaxed_sections):
10250 New method declarations.
10251 (Output_section::merge_section_map_
10252 Output_section::merge_section_by_properties_map_,
10253 Output_section::relaxed_input_section_map_,
10254 Output_section::is_relaxed_input_section_map_valid_,
10255 Output_section::generate_code_fills_at_write_): New data members.
10256 * script-sections.cc
10257 (Output_section_element_input::set_section_addresses): Call
10258 current_data_size and addralign methods of relaxed input sections.
10259 (Orphan_output_section::set_section_addresses): Call current_data_size
10260 and addralign methods of relaxed input sections.
10261 * symtab.cc (Symbol_table::compute_final_value): Extract template
10262 from the body of Symbol_table::sized_finalize_symbol.
10263 (Symbol_table::sized_finalized_symbol): Call
10264 Symbol_table::compute_final_value.
10265 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
10266 (Symbol_table::compute_final_value): New templated method declaration.
10267 * target.cc (Target::do_make_output_section): New method defintion.
10268 * target.h (Target::make_output_section): New method declaration.
10269 (Target::relax): Add more parameters for input objects, symbol table
10270 and layout. Adjust call to do_relax.
10271 (Target::do_make_output_section): New method declaration.
10272 (Target::do_relax): Add parameters for input objects, symbol table
10273 and layout.
10274
d446d6c4
ILT
102752009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10276
10277 * pread.c: Include stdio.h.
10278
bc06c745
ILT
102792009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10280
10281 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
10282 defined.
10283
75aea3d0
ILT
102842009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10285
10286 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
10287 Change read_shndx type to unsigned int.
10288 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
10289 int.
10290 (Sized_dwarf_line_info::read_line_mappings): Likewise.
10291 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
10292 Change read_shndx type to unsigned int.
10293 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
10294 int.
10295 (Sized_dwarf_line_info::read_line_mappings): Likewise.
10296 * layout.cc (Layout::create_symtab_sections): Cast the result of
10297 local_symcount * symsize to off_t in the gold_assert.
10298
be8fcb75
ILT
102992009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10300
10301 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
10302 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
10303 R_ARM_BASE_ABS.
10304 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
10305 (Arm_relocate_functions::thm_abs5): New function.
10306 (Arm_relocate_functions::abs12): New function.
10307 (Arm_relocate_functions::abs16): New function.
10308 (Arm_relocate_functions::base_abs): New function.
10309 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
10310 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
10311 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
10312 R_ARM_BASE_ABS.
10313 (Scan::global): Likewise.
10314 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
10315 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
10316 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
10317 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
10318 R_ARM_BASE_ABS.
10319
c2a122b6
ILT
103202009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10321
10322 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
10323 (Arm_relocate_functions::movt_prel): New function.
10324 (Arm_relocate_functions::thm_movw_prel_nc): New function.
10325 (Arm_relocate_functions::thm_movt_prel): New function.
10326 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
10327 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
10328 (Scan::global, Relocate::relocate): Likewise.
10329 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10330
c4aa1e2d
ILT
103312009-10-09 Mikolaj Zalewski <mikolajz@google.com>
10332
10333 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
10334 Incremental_checker.
10335 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
10336 unsigned int.
10337 (class Incremental_inputs_header): New class.
10338 (Incremental_inputs_header_writer): Edit comment.
10339 (Incremental_inputs_entry): New class.
10340 (Incremental_inputs_entry_writer): Edit comment.
10341 (Sized_incremental_binary::do_find_incremental_inputs_section):
10342 Add *strtab_shndx parameter, fill it.
10343 (Sized_incremental_binary::do_check_inputs): New method.
10344 (Incremental_checker::can_incrementally_link_output_file): Use
10345 Sized_incremental_binary::check_inputs.
10346 (Incremental_inputs::report_command_line): Save command line in
10347 command_line_.
10348 * incremental.h:
10349 (Incremental_binary::find_incremental_inputs_section): New
10350 method.
10351 (Incremental_binary::do_find_incremental_inputs_section): Add
10352 strtab_shndx parameter.
10353 (Incremental_binary::do_check_inputs): New pure virtual method.
10354 (Sized_incremental_binary::do_check_inputs): Declare.
10355 (Incremental_checker::Incremental_checker): Add incremental_inputs
10356 parameter, use it to initialize incremental_inputs_.
10357 (Incremental_checker::incremental_inputs_): New field.
10358 (Incremental_checker::command_line): New method.
10359 (Incremental_checker::inputs): New method.
10360 (Incremental_checker::command_line_): New field.
10361
c549a694
ILT
103622009-10-09 Mikolaj Zalewski <mikolajz@google.com>
10363
10364 * incremental.cc: Include <cstdarg> and "target-select.h".
10365 (vexplain_no_incremental): New function.
10366 (explain_no_incremental): New function.
10367 (Incremental_binary::error): New method.
10368 (Sized_incremental_binary::do_find_incremental_inputs_section): New
10369 method.
10370 (make_sized_incremental_binary): New function.
10371 (open_incremental_binary): New function.
10372 (can_incrementally_link_file): Add checks if output is ELF and has
10373 inputs section.
10374 * incremental.h: Include "elfcpp_file.h" and "output.h".
10375 (Incremental_binary): New class.
10376 (Sized_incremental_binary): New class.
10377 (open_incremental_binary): Declare.
10378 * object.cc (is_elf_object): Use
10379 elfcpp::Elf_recognizer::is_elf_file.
10380 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
10381 * output.h (Output_file::filesize): New method.
10382
fd3c5f0b
ILT
103832009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10384
10385 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
10386 New function.
10387 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
10388 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
10389 function.
10390 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
10391 function.
10392 (Arm_relocate_functions::movw_abs_nc): New function.
10393 (Arm_relocate_functions::movt_abs): New function.
10394 (Arm_relocate_functions::thm_movw_abs_nc): New function.
10395 (Arm_relocate_functions::thm_movt_abs): New function.
10396 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
10397 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
10398 (Scan::global): Likewise.
10399 (Relocate::relocate): Likewise.
10400 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10401
7f5309a5
ILT
104022009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10403
10404 * arm.cc (Arm_relocate_functions::got_prel) New function.
10405 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
10406 (Relocate::relocate): Likewise.
10407 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10408
364c7fa5
ILT
104092009-10-06 Ian Lance Taylor <iant@google.com>
10410
10411 * options.h (class General_options): Define
10412 split_stack_adjust_size parameter.
10413 * object.h (class Object): Add uses_split_stack_ and
10414 has_no_split_stack_ fields. Add uses_split_stack and
10415 has_no_split_stack accessor functions. Declare
10416 handle_split_stack_section.
10417 (class Reloc_symbol_changes): Define.
10418 (class Sized_relobj): Define Function_offsets. Declare
10419 split_stack_adjust, split_stack_adjust_reltype, and
10420 find_functions.
10421 * object.cc (Object::handle_split_stack_section): New function.
10422 (Sized_relobj::do_layout): Call handle_split_stack_section.
10423 * dynobj.cc (Sized_dynobj::do_layout): Call
10424 handle_split_stack_section.
10425 * reloc.cc (Sized_relobj::relocate_sections): Call
10426 split_stack_adjust for executable sections in split_stack
10427 objects. Pass reloc_map to relocate_section.
10428 (Sized_relobj::split_stack_adjust): New function.
10429 (Sized_relobj::split_stack_adjust_reltype): New function.
10430 (Sized_relobj::find_functions): New function.
10431 * target-reloc.h: Include "object.h".
10432 (relocate_section): Add reloc_symbol_changes parameter. Change
10433 all callers.
10434 * target.h (class Target): Add calls_non_split method. Declare
10435 do_calls_non_split virtual method. Declare match_view and
10436 set_view_to_nop.
10437 * target.cc: Include "elfcpp.h".
10438 (Target::do_calls_non_split): New function.
10439 (Target::match_view): New function.
10440 (Target::set_view_to_nop): New function.
10441 * gold.cc (queue_middle_tasks): Give an error if mixing
10442 split-stack and non-split-stack objects with -r.
10443 * i386.cc (Target_i386::relocate_section): Add
10444 reloc_symbol_changes parameter.
10445 (Target_i386::do_calls_non_split): New function.
10446 * x86_64.cc (Target_x86_64::relocate_section): Add
10447 reloc_symbol_changes parameter.
10448 (Target_x86_64::do_calls_non_split): New function.
10449 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
10450 parameter.
10451 * powerpc.cc (Target_powerpc::relocate_section): Add
10452 reloc_symbol_changes parameter.
10453 * sparc.cc (Target_sparc::relocate_section): Add
10454 reloc_symbol_changes parameter.
10455 * configure.ac: Call AM_CONDITIONAL for the default target.
10456 * configure: Rebuild.
10457 * testsuite/Makefile.am (TEST_AS): New variable.
10458 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
10459 (check_DATA): Add split_i386 and split_x86_64 files.
10460 (SPLIT_DEFSYMS): Define.
10461 (split_i386_[1234n].o): New targets.
10462 (split_i386_[124]): New targets.
10463 (split_i386_[1234r].stdout): New targets.
10464 (split_x86_64_[1234n].o): New targets.
10465 (split_x86_64_[124]): New targets.
10466 (split_x86_64_[1234r].stdout): New targets.
10467 (MOSTLYCLEANFILES): Add new executables.
10468 * testsuite/split_i386.sh: New file.
10469 * testsuite/split_x86_64.sh: New file.
10470 * testsuite/split_i386_1.s: New file.
10471 * testsuite/split_i386_2.s: New file.
10472 * testsuite/split_i386_3.s: New file.
10473 * testsuite/split_i386_4.s: New file.
10474 * testsuite/split_i386_n.s: New file.
10475 * testsuite/split_x86_64_1.s: New file.
10476 * testsuite/split_x86_64_2.s: New file.
10477 * testsuite/split_x86_64_3.s: New file.
10478 * testsuite/split_x86_64_4.s: New file.
10479 * testsuite/split_x86_64_n.s: New file.
10480 * testsuite/testfile.cc (Target_test): Update relocation_section
10481 function.
10482 * testsuite/Makefile.in: Rebuild.
10483
e8a9fcda
ILT
104842009-10-06 Ian Lance Taylor <iant@google.com>
10485
10486 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
10487 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
10488 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
10489 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
10490 the address on ldo_addrs_.
10491 (Target_i386::Relocate::fix_up_ldo): New function.
10492
e99daf92
ILT
104932009-10-06 Rafael Espindola <espindola@google.com>
10494
10495 * plugin.cc (add_input_library): New.
10496 (Plugin::load): Add add_input_library to tv.
10497 (Plugin_manager::add_input_file): Add the is_lib argument.
10498 (add_input_file): Update call to Plugin_manager::add_input_file.
10499 (add_input_library): New.
10500 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
10501
966d4097
DK
105022009-09-30 Doug Kwan <dougkwan@google.com>
10503
10504 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
10505 symbol and call Symbol::may_need_copy_reloc to determine if
10506 a copy reloc is needed.
10507 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
10508 nocopyreloc is given in command line.
10509 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
10510 given in command line.
10511 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
10512 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
10513 of the removed Target_i386::may_need_copy_reloc.
10514 * options.h (copyreloc): New option with default value false.
10515 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
10516 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
10517 instead of the removed Target_powerpc::may_need_copy_reloc.
10518 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
10519 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
10520 instead of the removed Target_sparc::may_need_copy_reloc.
10521 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
10522 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
10523 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
10524 instead of the removed Target_x86_64::may_need_copy_reloc.
10525
029ba973
ILT
105262009-09-30 Ian Lance Taylor <iant@google.com>
10527
10528 * object.h (class Object): Remove target_ field, and target,
10529 sized_target, and set_target methods.
10530 (Object::sized_target): Remove.
10531 (class Sized_relobj): Update declarations. Remove sized_target.
10532 * object.cc (Sized_relobj::setup): Remove target parameter.
10533 Change all callers.
10534 (Input_objects::add_object): Don't do anything with the target.
10535 (make_elf_sized_object): Add punconfigured parameter. Change all
10536 callers. Set or test parameter target.
10537 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
10538 Change all callers.
10539 * parameters.cc (Parameters::set_target): Change parameter type to
10540 be non-const.
10541 (Parameters::default_target): Remove.
10542 (set_parameters_target): Change parameter type to be non-const.
10543 (parameters_force_valid_target): New function.
10544 (parameters_clear_target): New function.
10545 * parameters.h (class Parameters): Update declarations. Remove
10546 default_target method. Add sized_target and clear_target
10547 methods. Change target_ to be non-const.
10548 (set_parameters_target): Update declaration.
10549 (parameters_force_valid_target): Declare.
10550 (parameters_clear_target): Declare.
10551 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
10552 as NULL if we aren't searching.
10553 (Add_symbols::run): Don't check for compatible target.
10554 * fileread.cc (Input_file::open_binary): Call
10555 parameters_force_valid_target.
10556 * gold.cc (queue_middle_tasks): Likewise.
10557 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
10558 set_target on object.
10559 * dynobj.h (class Sized_dynobj): Update declarations.
10560 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
10561 make_elf_object returns NULL.
10562 (Archive::include_member): Don't check whether object target is
10563 compatible.
10564 * output.cc (Output_section::add_input_section): Get target from
10565 parameters.
10566 (Output_section::relax_input_section): Likewise.
10567 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
10568 parameters.
10569 (Sized_relobj::do_scan_relocs): Likewise.
10570 (Sized_relobj::relocate_sections): Likewise.
10571 * resolve.cc (Symbol_table::resolve): Likewise.
10572 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
10573 parameter. Change all callers.
10574 (Symbol_table::add_from_object): Get target from parameters.
10575 (Symbol_table::add_from_relobj): Don't check object target.
10576 (Symbol_table::add_from_dynobj): Likewise.
10577 (Symbol_table::define_special_symbol): Get target from
10578 parameters.
10579 * symtab.h (class Symbol_table): Update declaration.
10580 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
10581 parameter. Change all callers. Clear parameter target.
10582 (Binary_test): Test target here.
10583 * testsuite/object_unittest.cc (gold_testsuite): Remove
10584 target_test_pointer parameter. Change all callers.
10585 (Object_test): Test target here.
10586
a6a22b83
ILT
105872009-09-26 Ian Lance Taylor <iant@google.com>
10588
10589 * testsuite/initpri1.c: Don't try to use constructor priorities if
10590 compiling with gcc before 4.3.
10591
6a8f49fe
ILT
105922009-09-22 Mikolaj Zalewski <mikolajz@google.com>
10593
10594 * testsuite/retain_symbols_file_test.sh (check_present): Change
10595 output file name to retain_symbols_file_test.stdout.
10596 (check_absent): Likewise.
10597
8c604651
CS
105982009-09-18 Craig Silverstein <csilvers@google.com>
10599
10600 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
10601 * options.cc: Include <cerrno> and <fstream>.
10602 (General_options::finalize): Parse -retain-symbols-file tag.
10603 * options.h: New flag.
10604 (General_options): New method should_retain_symbol, new
10605 variable symbols_to_retain.
10606 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
10607 should_retain_symbol map.
10608 * testsuite/Makefile.am (retain_symbols_file_test): New test.
10609 * testsuite/Makefile.in: Regenerate.
10610 * testsuite/retain_symbols_file_test.sh: New file.
10611
ca58b19f
NC
106122009-09-18 Nick Clifton <nickc@redhat.com>
10613
10614 * po/es.po: Updated Spanish translation.
10615
20e6d0d6
DK
106162009-09-17 Doug Kwan <dougkwan@google.com>
10617
10618 * debug.h (DEBUG_RELAXATION): New constant.
10619 (DEBUG_ALL): Add DEBUG_RELAXATION.
10620 (debug_string_to_enum): Add relaxation debug option.
10621 * layout.cc
10622 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
10623 Layout::Relaxation_debug_check::read_sections,
10624 Layout::Relaxation_debug_check::read_sections): New method definitions.
10625 (Layout::Layout): Initialize data members
10626 record_output_section_data_from_scrips_,
10627 script_output_section_data_list_ and relaxation_debug_check_.
10628 (Layout::save_segments, Layout::restore_segments,
10629 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
10630 Layout::relaxation_loop_body): New method definitions.
10631 (Layout::finalize): Support relaxation. Move section layout code to
10632 Layout::relaxation_loop_body.
10633 (Layout::set_asection_address_from_script): Move code for orphan
10634 section placement out.
10635 (Layout::place_orphan_sections_in_script): New method definition.
10636 * layout.h (Output_segment_headers, Output_file_header):
10637 New forward class declarations.
10638 (Layout::~Layout): Define.
10639 (Layout::new_output_section_data_from_script): New method definition.
10640 (Layout::place_orphan_sections_in_script): New method declaration.
10641 (Layout::Segment_states): New type declaration.
10642 (Layout::save_segments, Layout::restore_segments,
10643 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
10644 Layout::relaxation_loop_body): New method declarations.
10645 (Layout::Output_section_data_list): New type declaration.
10646 (Layout::Relaxation_debug_check): New class definition.
10647 (Layout::record_output_section_data_from_script_,
10648 Layout::script_output_section_data_list_, Layout::segment_states_,
10649 Layout::relaxation_debug_check_): New data members.
10650 * output.cc: (Output_section_headers::do_size): New method definition.
10651 (Output_section_headers::Output_section_headers): Move size
10652 computation to Output_section_headers::do_size.
10653 (Output_segment_headers::do_size): New method definition.
e1df38aa 10654 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
10655 Output_file_header::do_size and call it.
10656 (Output_file_header::do_size): New method definition.
10657 (Output_data_group::Output_data_group): Adjust call to
10658 Output_section_data.
10659 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
10660 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 10661 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
10662 RELAXED_INPUT_SECTION_CODE.
10663 (Output_section::Output_section): Initialize data member checkpoint_.
10664 (Output_section::~Output_section): Delete checkpoint object pointed
10665 by checkpoint_.
10666 (Output_section::add_input_section): Always add an Input_section if
10667 relaxing.
10668 (Output_section::add_merge_input_section): Add assert.
10669 (Output_section::relax_input_section): New method definition.
10670 (Output_section::set_final_data_size): Set load address to zero for
10671 an unallocated section.
10672 (Output_section::do_address_and_file_offset_have_reset_values):
10673 New method definition.
10674 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
10675 Handle relaxed input section.
10676 (Output_section::sort_attached_input_sections): Checkpoint input
10677 section list lazily.
10678 (Output_section::get_input_sections): Change type of input_sections to
10679 list of Simple_input_section pointers. Checkpoint input section list
10680 lazily. Also handle relaxed input sections.
10681 (Output_section::add_input_section_for_script): Take a reference to
10682 a Simple_input_section object instead of Relobj pointer and section
10683 index as parameter. Handle relaxed input sections.
10684 (Output_section::save_states, Output_section::restore_states): New
10685 method definitions.
10686 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
10687 (Output_data::is_data_size_fixed): New method definition.
10688 (Output_data::reset_addresss_and_file_offset): Do not reset data size
10689 if it is fixed.
10690 (Output_data::address_and_file_offset_have_reset_values): New method
10691 definition.
10692 (Output_data::do_address_and_file_offset_have_reset_values): New method
10693 definition.
10694 (Output_data::set_data_size): Check that data size is not fixed.
10695 (Output_data::fix_data_size): New method definition.
10696 (Output_data::is_data_size_fixed_): New data member.
10697 (Output_section_headers::set_final_data_size): New method definition.
10698 (Output_section_headers::do_size): New method declaration.
10699 (Output_segment_headers::set_final_data_size): New method definition.
10700 (Output_segment_headers::do_size): New method declaration.
10701 (Output_file_header::set_final_data_size)::New method definition.
10702 (Output_file_header::do_size)::New method declaration.
10703 (Output_section_data::Output_section_data): Add new parameter
10704 is_data_size_fixed and use it to fix data size.
10705 (Output_data_const::Output_data_const): Adjust call to base class
10706 constructor and fix data size.
10707 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
10708 base class constructor and fix data size.
10709 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
10710 base class constructor and fix data size.
10711 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
10712 class constructor and fix data size.
10713 (Output_data_group::set_final_data_size): New method definition.
10714 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
10715 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
10716 class constructor and fix data size.
10717 (Output_relaxed_input_section): New class definition.
10718 (Output_section::Simple_input_section): New class definition.
10719 (Output_section::get_input_sections): Adjust parameter list.
10720 (Output_section::add_input_section_for_script): Same.
10721 (Output_section::save_states, Output_section::restore_states,
10722 Output_section::do_address_and_file_offset_have_reset_values,
10723 (Output_section::Input_section::Input_section): Handle
10724 RELAXED_INPUT_SECTION_CODE. Add new overload for
10725 Output_relaxed_input_section.
10726 (Output_section::Input_section::is_input_section,
10727 Output_section::Input_section::set_output_section): Handle relaxed
10728 input section.
10729 (Output_section::Input_section::is_relaxed_input_section,
10730 Output_section::Input_section::output_section_data,
10731 Output_section::Input_section::relaxed_input_section): New method
10732 definitions.
10733 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
10734 value.
10735 (Output_section::Input_section::u1_): Update comments.
10736 (Output_section::Input_section::u2_): Add new union member poris.
10737 (Output_section::Checkpoint_output_section): New classs definition.
10738 (Output_section::relax_input_section): New method declaration.
10739 (Output_section::checkpoint_): New data member.
10740 (Output_segment): Update comments.
10741 (Output_segment::Output_segment): Un-privatize copy constructor.
10742 (Output_segment::operator=): Un-privatize.
10743 * script-sections.cc (Output_section_element::Input_section_list):
10744 Change element type to Output_section::Simple_input_section.
10745 (Output_section_element_dot_assignment::set_section_addresses):
10746 Register output section data for relaxation clean up.
10747 (Output_data_exression::Output_data_expression): Adjust call to base
10748 constructor to fix data size.
10749 (Output_section_element_data::set_section_addresses): Register
10750 Output_data_expression object for relaxation clean up.
10751 (struct Input_section_info): Replace Relobj pointer and section index
10752 pair with Output_section::Simple_input_section and Convert struct to a
10753 class.
10754 (Input_section_sorter::operator()): Adjust access to
e1df38aa 10755 Input_section_info data member to use accessors.
20e6d0d6
DK
10756 (Output_section_element_input::set_section_addresses): Use layout
10757 parameter. Adjust code to use Output_section::Simple_input_section
10758 and Input_secction_info classes. Register filler for relaxation
10759 clean up.
10760 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
10761 and section index pair with Output_section::Simple_input_section
10762 class. Adjust code accordingly.
10763 (Phdrs_element::release_segment): New method definition.
10764 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
10765 segment list.
10766 (Script_sections::release_segments): New method definition.
10767 * gold/script-sections.h (Script_sections::release_segments): New
10768 method declaration.
10769 * gold/target.h (Target::may_relax, Target::relax,
10770 Target::do_may_relax, Target::do_relax): New method definitions.
10771
5e445df6
ILT
107722009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10773
10774 * arm.cc (has_signed_unsigned_overflow): New function.
10775 (Arm_relocate_functions::abs8): New function.
10776 (Target_arm::Scan::local): Handle R_ARM_ABS8.
10777 (Target_arm::Scan::global): Likewise.
10778 (Target_arm::relocate::relocate): Likewise.
10779 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10780 Likewise.
10781
8c604651 107822009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
10783
10784 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
10785 * testsuite/Makefile.in: Regenerate.
10786
1e9cc1c2
NC
107872009-09-11 Nick Clifton <nickc@redhat.com>
10788
10789 * po/gold.pot: Updated by the Translation project.
10790
6a89f575
CC
107912009-09-08 Cary Coutant <ccoutant@google.com>
10792
10793 * output.cc (Output_file::open): Add execute permission to empty file.
10794 * testsuite/Makefile.am (permission_test): New test.
10795 * testsuite/Makefile.in: Regenerate.
10796
fdcac5af
ILT
107972009-09-02 Ian Lance Taylor <iant@google.com>
10798
10799 * output.cc (Output_file::resize): Call map_no_anonymous rather
10800 than map.
10801
44453f85
ILT
108022009-09-01 Mikolaj Zalewski <mikolajz@google.com>
10803
10804 * gold.cc: Include "incremental.h".
10805 (queue_initial_tasks): Call Incremental_checker methods.
10806 * incremental.cc: Include "output.h".
10807 (Incremental_checker::can_incrementally_link_output_file): New
10808 method.
10809 * incremental.h (Incremental_checker): New class.
10810
10811 * output.cc (Output_file::open_for_modification): New method.
10812 (Output_file::map_anonymous): Changed return type to bool. Record
10813 map in base_ field.
10814 (Output_file::map_no_anonymous): New method, broken out of map.
10815 (Output_file::map): Use map_no_anonymous and map_anonymous.
10816 * output.h (class Output_file): Update declarations.
10817
293c1386
CC
108182009-08-24 Cary Coutant <ccoutant@google.com>
10819
10820 * options.h (Command_line::Pre_options): New class.
10821 (Command_line::pre_options): New member.
10822 * options.cc (gold::options::ready_to_register): New variable.
10823 (One_option::register_option): Do nothing if not registering options.
10824 Assert if same short option registered twice.
10825 (General_options::General_options): Turn off option registration when
10826 done constructing.
10827 (Command_line::Pre_options::Pre_options): New constructor.
10828
f773f3d2
CC
108292009-08-24 Cary Coutant <ccoutant@google.com>
10830
06a73cfe
CC
10831 * options.h (General_options::no_keep_memory): Remove incorrect
10832 short option.
f773f3d2 10833
a15af8e2
RW
108342009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10835
10836 * Makefile.am (am__skiplex, am__skipyacc): New.
10837 * Makefile.in: Regenerate.
10838
c462b41b
RW
108392009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10840
14ec8efd
RW
10841 * Makefile.am (AM_CPPFLAGS): Renamed from ...
10842 (INCLUDES): ... this.
10843 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
10844 (AM_CPPFLAGS): Renamed from ...
10845 (INCLUDE): ... this.
10846 * Makefile.in, testsuite/Makefile.in: Regenerate.
10847
81ecdfbb
RW
10848 * Makefile.in: Regenerate.
10849 * aclocal.m4: Likewise.
10850 * config.in: Likewise.
10851 * configure: Likewise.
10852 * testsuite/Makefile.in: Likewise.
10853
c462b41b
RW
10854 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
10855 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
10856 * Makefile.in: Regenerate.
10857 * testsuite/Makefile.in: Regenerate.
10858
2da73f13
CC
108592009-08-19 Cary Coutant <ccoutant@google.com>
10860
10861 * resolve.cc (Symbol_table::resolve): Don't complain about defined
10862 symbols in shared libraries overridden by hidden or internal symbols
10863 in the main program.
10864
2db70501
CD
108652009-08-19 Chris Demetriou <cgd@google.com>
10866
10867 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
10868 checking source file names in error messages.
10869
f733487b
DK
108702009-08-18 Doug Kwan <dougkwan@google.com>
10871
10872 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
10873 an elcpp::Ehdr as parameter. Adjust call to set_target.
10874 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
10875 an elfcpp::Ehdr as parameter.
10876 * object.cc (Object::set_target): Remove the version that looks up
10877 a target and sets it.
10878 (Sized_relobj::setup): Take a Target object instead of
10879 an elfcpp::Ehdr as parameter. Adjust call to set_target.
10880 (make_elf_sized_object): Find target and ask target to
10881 make an ELF object.
10882 * object.h: (Object::set_target): Remove the version that looks up
10883 a target and sets it.
10884 (Sized_relobj::setup): Take a Target object instead of
10885 an elfcpp:Ehdr as parameter.
10886 * target.cc: Include dynobj.h.
10887 (Target::do_make_elf_object_implementation): New.
2e702c99 10888 (Target::do_make_elf_object): New.
f733487b
DK
10889 * target.h (Target::make_elf_object): New template declaration.
10890 (Target::do_make_elf_object): New method declarations.
10891 (Target::do_make_elf_object_implementation): New template declaration.
10892
cc70f101
ILT
108932009-08-14 Ian Lance Taylor <iant@google.com>
10894
10895 * gold.h (FUNCTION_NAME): Define.
10896 (gold_unreachable): Use FUNCTION_NAME.
10897
ef5e0cb1
ST
108982009-08-12 Sriraman Tallam <tmsriram@google.com>
10899
10900 * icf.cc (Icf::find_identical_sections): Issue a warning when a
10901 symbol in the --keep-unique list is not found.
10902
48c187ce
ST
109032009-08-12 Sriraman Tallam <tmsriram@google.com>
10904
10905 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
10906 been maked as --keep-unique.
10907 (Icf::unfold_section): New function.
10908 * icf.h (Icf::unfold_section): New function.
10909 * options.h (General_options::keep_unique): New option.
10910 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
10911 * testsuite/Makefile.in: Regenerate.
10912 * testsuite/icf_keep_unique_test.sh: New file.
10913 * testsuite/icf_keep_unique_test.cc: New file.
10914
645afe0c
CC
109152009-08-12 Cary Coutant <ccoutant@google.com>
10916
10917 PR 10471
10918 * resolve.cc (Symbol_table::resolve): Check for references from
10919 dynamic objects to hidden and internal symbols.
10920 * testsuite/Makefile.am (hidden_test.sh): New test.
10921 * testsuite/Makefile.in: Regenerate.
10922 * testsuite/hidden_test.sh: New script.
10923 * testsuite/hidden_test_1.c: New test source.
10924 * testsuite/hidden_test_main.c: New test source.
10925
11af873f
DK
109262009-08-11 Doug Kwan <dougkwan@google.com>
10927
10928 * arm.cc: Update comments.
10929 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
10930 segment to locate the .ARM.exidx section if present.
10931
b9f7d72d
DK
109322009-08-09 Doug Kwan <dougkwan@google.com>
10933
10934 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
10935 patch.
10936
ddd3c53c
ST
109372009-08-07 Sriraman Tallam <tmsriram@google.com>
10938 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
10939 compiler warnings.
10940
27721062
ST
109412009-08-06 Sriraman Tallam <tmsriram@google.com>
10942
10943 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
10944 valid tls_segment only for non-debug-section relocations.
10945 * testsuite/Makefile.am: Add gc_tls_test.
10946 * testsuite/Makefile.in: Regenerate.
10947 * testsuite/gc_tls_test.cc: New file.
10948 * testsuite/gc_tls_test.sh: New file.
10949
ef15dade 109502009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 10951
ef15dade
ST
10952 * icf.cc: New file.
10953 * icf.h: New file.
10954 * Makefile.am (CCFILES): Add icf.cc.
10955 (HFILES): Add icf.h
10956 * Makefile.in: Regenerate.
10957 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
10958 * gc.h (gc_process_relocs): Populate lists used by icf to contain
10959 section, symbol and addend information for the relocs.
10960 * gold.cc (queue_middle_tasks): Call identical code folding.
10961 * gold.h: Add defines for multimap.
10962 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
10963 to the call of finalize_local_symbols.
10964 * main.cc (main): Create object of class Icf.
10965 * object.cc (Sized_relobj::do_layout): Allow this function to be
10966 called twice during icf.
10967 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
10968 to sections marked as identical by icf.
10969 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
10970 when available.
10971 (Sized_relobj::do_section_entsize): New function.
10972 * object.h (Object::section_entsize): New function.
10973 (Object::do_section_entsize): New pure virtual function.
10974 (Relobj::finalize_local_symbols): Add new parameter.
10975 (Relobj::do_section_entsize): New function.
10976 * options.h (General_options::icf): New option.
10977 (General_options::icf_iterations): New option.
10978 (General_options::print_icf_sections): New option.
10979 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
10980 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
10981 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
10982 icf.
10983 * symtab.cc (Symbol_table::is_section_folded): New function.
10984 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
10985 to sections marked as identical by icf.
10986 * symtab.h (Symbol_table::set_icf): New function.
10987 (Symbol_table::icf): New function.
10988 (Symbol_table::is_section_folded): New function.
10989 (Symbol_table::icf_): New data member.
10990 * target-reloc.h (relocate_section): Ignore sections folded by icf.
10991 * testsuite/Makefile.am: Add commands to build icf_test.
10992 * testsuite/Makefile.in: Regenerate.
10993 * testsuite/icf_test.sh: New file.
10994 * testsuite/icf_test.cc: New file.
10995
c3b65ac4
CD
109962009-07-24 Chris Demetriou <cgd@google.com>
10997
10998 * layout.cc (is_compressible_debug_section): Fix incorrect
10999 comment about compressed section names.
11000
1caf2c51
ILT
110012009-07-20 Ian Lance Taylor <ian@airs.com>
11002
11003 PR 10419
11004 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
11005
1ef4d87f
ILT
110062009-07-16 Ian Lance Taylor <iant@google.com>
11007
11008 PR 10400
11009 * layout.h: #include <map>.
11010 (class Kept_section): Change from struct to class. Add accessors
11011 and setters. Add section size to Comdat_group mapping. Change
11012 Comdat_group to std::map. Add is_comdat_ field. Add
11013 linkonce_size field in union.
11014 (class Layout): Update declaration of find_or_add_kept_section.
11015 Don't declare find_kept_object.
11016 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
11017 parameter. Add object, shndx, is_comdat, and is_group_name
11018 parameters. Change all callers. Adjust for new Kept_section.
11019 (Layout::find_kept_object): Remove.
11020 * object.cc (Sized_relobj::include_section_group): Update use of
11021 Kept_section. Rename secnum to shndx. Only record
11022 Kept_comdat_section if sections are the same size.
11023 (Sized_relobj::include_linkonce_section): Update use of
11024 Kept_section. Only record Kept_comdat_section if sections are the
11025 same size. Set size of linkonce section.
11026 (Sized_relobj::map_to_kept_section): Update call to
11027 get_kept_comdat_section.
11028 * object.h (class Sized_relobj): Rename fields in
11029 Kept_comdat_section to drop trailing underscores; change object
11030 field to Relobj*. Change Kept_comdat_section_table to store
11031 struct rather than pointer.
11032 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
11033 Add kept_object and kept_shndx parameters. Change all callers.
11034 (Sized_relobj::get_kept_comdat_section): Change return type to
11035 bool. Add kept_object and kept_shndx parameters. Change all
11036 callers.
11037 * plugin.cc (Pluginobj::include_comdat_group): Update call to
11038 Layout::find_or_add_kept_section.
11039
37c3b7b0
ILT
110402009-07-09 Ian Lance Taylor <iant@google.com>
11041
11042 * merge.cc (Object_merge_map::initialize_input_to_output_map):
11043 Reserve space in the hash table.
11044
98fa85cb
ILT
110452009-07-06 Mikolaj Zalewski <mikolajz@google.com>
11046
11047 * fileread.cc (File_read::get_mtime): New method.
11048 * fileread.h (Timespec): New structure.
11049 (File_read::get_mtime): New method.
11050 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
11051 Renamed from timestamp_nsec.
11052 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
11053 Elf_Xword.
e1df38aa 11054 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 11055 timestamp_nsec.
e1df38aa 11056 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
11057 (Incremental_inputs::report_obejct): Save mtime; style fix.
11058 (Incremental_inputs::report_script): Save mtime; style fix.
11059 (Incremental_inputs::finalize_inputs): Style fix.
11060 (Incremental_inputs::finalize): Style fix.
11061 (Incremental_inputs::create_input_section_data): Store inputs
11062 mtime.
11063 * incremental.h (Incremental_inputs::report_script): Add mtime
11064 argument.
11065 (Incremental_inputs::Input_info::Input_info): Intialize only one
11066 union member.
11067 (Incremental_inputs::Input_info::archive): Move to nameless
11068 union.
11069 (Incremental_inputs::Input_info::obejct): Move to nameless union.
11070 (Incremental_inputs::Input_info::script): Move to nameless union.
11071 (Incremental_inputs::mtime): New field.
11072 * script.cc (read_input_script): Pass file mtime to
11073 Incremental_input.
11074 * script.h (Script_info::inputs): Style fix.
11075
c9d70757
ILT
110762009-07-01 Ian Lance Taylor <ian@airs.com>
11077
11078 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
11079 instead of 32.
11080
9c547ec3
ILT
110812009-06-24 Ian Lance Taylor <iant@google.com>
11082
11083 PR 10156
11084 * layout.cc (Layout::choose_output_section): If we find an
11085 existing section, update the flags.
11086 (Layout::create_notes): New function, broken out of
11087 Layout::finalize.
11088 (Layout::finalize): Don't create note sections.
11089 (Layout::create_note): Don't crash if linker script discards
11090 section.
11091 (Layout::create_gold_note): Likewise.
11092 (Layout::create_build_id): Likewise. Don't set
11093 after_input_sections on the section.
11094 (Layout::create_executable_stack_info): Remove target parameter.
11095 Change caller.
11096 * layout.h (class Layout): Declare create_notes. Update
11097 declaration of create_executable_stack_info.
11098 * gold.cc (queue_middle_tasks): Call create_notes.
11099 * output.cc (Output_section::update_flags_for_input_section): Move
11100 here from output.h. If SHF_ALLOC flag is newly set, mark address
11101 invalid.
11102 * output.h (Output_data::mark_address_invalid): New function.
11103 (class Output_section): Only declare, not define,
11104 update_flags_for_input_section. Remove set_flags.
11105
55458500
ILT
111062009-06-24 Ian Lance Taylor <iant@google.com>
11107
11108 * script-sections.cc (Output_section_definition::
11109 set_section_addresses): Rename shadowing local load_address to
11110 laddr.
11111
1307d6cd
ILT
111122009-06-24 Ian Lance Taylor <iant@google.com>
11113
11114 PR 10244
11115 * reloc.cc (relocate_sections): Skip empty relocation sections.
11116
ec3f783e
ILT
111172009-06-23 Ian Lance Taylor <iant@google.com>
11118
11119 PR 10156
11120 * layout.cc (Layout::create_note): Use choose_output_section
11121 rather than make_output_section.
11122
459c9f1c
ILT
111232009-06-23 Ian Lance Taylor <iant@google.com>
11124
11125 PR 10237
11126 * options.cc (General_options::parse_V): Set printed_version_.
11127 (General_options::General_options): Initialize printed_version_.
11128 * options.h (class General_options): Add printed_version_ field.
11129 * gold.cc (queue_initial_tasks): If there are no input files,
11130 don't give a fatal error if we printed the version information.
11131 (queue_middle_tasks): If using -r with a shared object, give a
11132 fatal error rather than an ordinary error.
11133
1518dc8f
ILT
111342009-06-23 Ian Lance Taylor <iant@google.com>
11135
11136 PR 10219
11137 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
11138 (Layout::make_output_section): Set have_stabstr_section_ if we see
11139 a .stab*str section.
11140 (Layout::finalize): Call link_stabs_sections.
11141 (Layout::link_stabs_sections): New file.
11142 * layout.h (class Layout): Add have_stabstr_section_ field.
11143 Declare link_stabs_sections.
11144
3d857b98
DK
111452009-06-23 Doug Kwan <dougkwan@google.com>
11146
11147 * Makefile.am (libgold_a_LIBADD): New.
11148 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 11149 * Makefile.in: Regenerate.
3d857b98
DK
11150 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
11151 * configure: Regenerate.
11152 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
11153 * fileread.cc: Include sys/state.h
11154 * gold.h: Declare memmem and strndup if found missing.
11155 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
11156
0639a6f6
ILT
111572009-06-23 Ian Lance Taylor <iant@google.com>
11158
11159 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
11160 * configure: Rebuild.
11161
8d63875c
ILT
111622009-06-23 Ian Lance Taylor <iant@google.com>
11163
11164 PR 10147
11165 * object.cc (Object::section_contents): Don't try to get a view if
11166 the section has length zero.
11167 (Object::handle_gnu_warning_section): If the section is empty, use
11168 the name of the section as the warning.
11169
f7c8a183
ILT
111702009-06-23 Ian Lance Taylor <iant@google.com>
11171
11172 PR 10133
11173 * stringpool.h (class Stringpool_template): Add optimize_ field.
11174 (Stringpool_template::set_optimize): New function.
11175 * stringpool.cc (Stringpool_template::Stringpool_template):
11176 Initialize optimize_ field.
11177 (Stringpool_template::set_string_offsets): Test local optimize
11178 fild rather than parameter.
11179 * layout.cc (Layout::Layout): Call set_optimize on the section
11180 name stringpool.
11181
e6a307ba
ILT
111822009-06-22 Ian Lance Taylor <iant@google.com>
11183
11184 PR 10030
11185 * yyscript.y: Parse TARGET.
11186 * script.cc (script_set_target): New function.
11187 * script-c.h (script_set_target): Declare.
11188 * options.cc (General_options::string_to_object_format): Rename
11189 from string_to_object_format in anonymous namespace. Change
11190 callers.
11191 * options.h (class General_options): Declare
11192 string_to_object_format.
11193
3ee173de
ILT
111942009-06-22 Ian Lance Taylor <iant@google.com>
11195
11196 * script-sections.cc (Script_sections::create_segments): Don't put
11197 program headers in a PT_LOAD segment if -n or -N.
11198
111992009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
11200
11201 PR 10141
11202 * options.h (class General_options): Add -z lazy and -z now. Sort
11203 -z options into alphabetical order.
11204 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
11205
cd6739a1 112062009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
11207
11208 * layout.cc (Layout::make_output_section): Call
11209 Target::new_output_section.
11210 (Layout::attach_allocated_section_to_segment): Put large section
11211 sections in a separate load segment with the large segment flag
11212 set.
11213 (Layout::segment_precedes): Sort large data segments after other
11214 load segments.
11215 (align_file_offset): New static function.
11216 (Layout::set_segment_offsets): Use align_file_offset.
11217 * output.h (class Output_section): Add is_small_section_ and
11218 is_large_section_ fields.
11219 (Output_section::is_small_section): New function.
11220 (Output_section::set_is_small_section): New function.
11221 (Output_section::is_large_section): New function.
11222 (Output_section::set_is_large_section): New function.
11223 (Output_section::is_large_data_section): New function.
11224 (class Output_segment): Add is_large_data_segment_ field.
11225 (Output_segment::is_large_data_segment): New function.
11226 (Output_segment::set_is_large_data_segment): New function.
11227 * output.cc (Output_section::Output_section): Initialize new
11228 fields.
11229 (Output_segment::Output_segment): Likewise.
11230 (Output_segment::add_output_section): Add assertion that large
11231 data sections always go in large data segments. Force small data
11232 sections to the end of the list of data sections. Force small BSS
11233 sections to the start of the list of BSS sections. For large BSS
11234 sections to the end of the list of BSS sections.
11235 * symtab.h (class Symbol): Declare is_common_shndx.
11236 (Symbol::is_defined): Check Symbol::is_common_shndx.
11237 (Symbol::is_common): Likewise.
11238 (class Symbol_table): Define enum Commons_section_type. Update
11239 declarations. Add small_commons_ and large_commons_ fields.
11240 * symtab.cc (Symbol::is_common_shndx): New function.
11241 (Symbol_table::Symbol_table): Initialize new fields.
11242 (Symbol_table::add_from_object): Put small and large common
11243 symbols in the right list.
11244 (Symbol_table::sized_finalized_symbol): Check
11245 Symbol::is_common_shndx.
11246 (Symbol_table::sized_write_globals): Likewise.
11247 * common.cc (Symbol_table::do_allocate_commons): Allocate new
11248 common symbol lists. Don't call do_allocate_commons_list if the
11249 list is empty.
11250 (Symbol_table::do_allocate_commons_list): Remove is_tls
11251 parameter. Add comons_section_type parameter. Change all
11252 callers. Handle small and large common symbols.
11253 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
11254 Symbol::is_common_shndx.
11255 * resolve.cc (symbol_to_bits): Likewise.
11256 * target.h (Target::small_common_shndx): New function.
11257 (Target::small_common_section_flags): New function.
11258 (Target::large_common_shndx): New function.
11259 (Target::large_common_section_flags): New function.
11260 (Target::new_output_section): New function.
11261 (Target::Target_info): Add small_common_shndx, large_common_shndx,
11262 small_common_section_flags, and large_common_section_flags
11263 fields.
11264 (Target::do_new_output_section): New virtual function.
11265 * arm.cc (Target_arm::arm_info): Initialize new fields.
11266 * i386.cc (Target_i386::i386_info): Likewise.
11267 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
11268 Likewise.
11269 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
11270 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
11271 (Target_x86_64::do_new_output_section): New function.
11272 * configure.ac: Define conditional MCMODEL_MEDIUM.
11273 * testsuite/Makefile.am (check_PROGRAMS): Add large.
11274 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
11275 (large_LDFLAGS): Define.
11276 * testsuite/large.c: New file.
11277 * testsuite/testfile.cc (Target_test::test_target_info):
11278 Initialize new fields.
11279 * configure, testsuite/Makefile.in: Rebuild.
11280
bb04269c
DK
112812009-06-05 Doug Kwan <dougkwan@google.com>
11282
11283 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 11284 * Makefile.in: Regenerate.
bb04269c
DK
11285 * i386.cc (class Target_i386): Define new virtual method to
11286 override do_is_local_label_name in parent.
11287 * object.cc (Sized_relobj::do_count_local_symbols): Discard
11288 local symbols if --discard-locals or -X is given.
11289 * options.h (class General_options): Declare new options
11290 '--discard-locals' and '-X' for discarding locals.
11291 * target.h (class Target): Define new methods is_local_label_name.
11292 Declare new virtual method do_is_local_label_name.
11293 * target.cc: New file.
11294 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
11295 (check_SCRIPTS): Add discard_locals_test.sh.
11296 (check_DATA): Add discard_local_tests.syms.
11297 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
11298 (discard_local_tests.syms, discard_locals_test.o): New make rules.
11299 * testsuite/Makefile.in: Regenerate.
11300 * testsuite/discard_locals_test.c: New file.
11301 * testsuite/discard_locals_test.sh: Same.
11302
805bb01c
DK
113032009-06-05 Doug Kwan <dougkwan@google.com>
11304
11305 * object.cc (Sized_relobj::Sized_relobj): Initialize
11306 discarded_eh_frame_shndx_ to -1U.
11307 (Sized_relobj::do_layout): Record index of a discard .eh_frame
11308 section.
11309 (Sized_relobj::do_count_local_symbols): Skip local symbols in
11310 a discarded .eh_frame section.
11311 (Sized_relobj::do_finalize_local_symbols): Ditto.
11312 * object.h (class Sized_relobj): Declare new member
11313 discarded_eh_frame_shndx_.
11314 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
11315 (local_labels_test.o, local_labels_test): New rules.
11316 * testsuite/Makefile.in: Regenerate.
11317
1dcd334d
DK
113182009-06-04 Doug Kwan <dougkwan@google.com>
11319
11320 * layout.cc (Layout::section_name_mapping): Add mapping for
11321 special ARM sections.
11322
96d49306
DK
113232009-06-03 Doug Kwan <dougkwan@google.com>
11324
11325 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
11326 (utils::has_overflow): Same.
11327
dff16297
ILT
113282009-06-03 Ian Lance Taylor <iant@google.com>
11329
11330 * layout.cc (Layout::section_name_mapping): New array, replacing
11331 Layout::linkonce_mapping.
11332 (Layout::section_name_mapping_count): New variable, replacing
11333 Layout::linkonce_mapping_count.
11334 (Layout::linkonce_output_name): Remove.
11335 (Layout::output_section_name): Rewrite.
11336 * layout.h (class Layout): Rename Linkonce_mapping to
11337 Section_name_mapping, linkonce_mapping to section_name_mapping,
11338 linkonce_mapping_count to section_name_mapping_count. Don't
11339 declare linkonce_output_name.
11340
c121c671
DK
113412009-06-03 Doug Kwan <dougkwan@google.com>
11342
11343 * gold/arm.cc (namespace utils): New.
11344 (Target_arm::reloc_is_non_pic): Define new method.
11345 (class Arm_relocate_functions): New.
11346 (Target_arm::Relocate::relocate): Handle relocation types used by
11347 Android.
11348
07800fab
ILT
113492009-06-03 Ian Lance Taylor <iant@google.com>
11350
11351 * arm.cc (Target_arm::scan::global): Use || instead of |.
11352
c121c671
DK
113532009-06-02 Doug Kwan <dougkwan@google.com>
11354
11355 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
11356 issued_non_pic_error_.
11357 (class Target_arm::Scan): Declare new method check_non_pic.
11358 Define new method symbol_needs_plt_entry.
11359 Declare new data member issued_non_pic_error_.
11360 (class Target_arm::Relocate): Declare new method
11361 should_apply_static_reloc.
11362 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
11363 (Target_arm::Scan::check_non_pic): Define new method.
11364 (Target_arm::Scan::local): Handle a small subset of reloc types used
11365 by Android.
11366 (Target_arm::Scan::local): Same.
11367 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
11368
b19b0c6d
ILT
113692009-05-31 Mikolaj Zalewski <mikolajz@google.com>
11370
11371 * incremental.cc (Incremental_inputs::report_command_line): Filter
11372 out --incremental-* options.
11373
94cdfcff
DK
113742009-05-29 Doug Kwan <dougkwan@google.com>
11375
11376 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
11377 template class.
11378 (class Target_arm): Update comment.
11379 (Target_arm::Target_arm): Initialize new data members GOT_,
11380 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
11381 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
11382 and Target_arm::rel_dyn_section.
11383 Declare new_enum Target_arm::Got_type.
11384 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
11385 and DYNBSS_.
11386 Update commments for member do_dynsym_value.
11387 (Target_arm::got_size, Target_arm::plt_section,
11388 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
11389 new methods inside class defintion.
11390 (Target_arm::got_section): Define new method.
11391 (Target_arm::rel_dyn_section): Same.
11392 (Output_data_plt_arm): New template class.
11393 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
11394 (Output_data_plt_arm:do_adjust_output_section): Define new method.
11395 (Output_data_plt_arm::add_entry): Same.
11396 (Output_data_plt_arm::first_plt_entry): Define new
11397 static data member for PLT instruction template.
11398 (Output_data_plt_arm::plt_entry): Same.
11399 (Output_data_plt_arm::do_write): Define new method.
11400 (Target_arm::make_plt_entry): Same.
11401 (Target_arm::do_finalize_sections): Same.
11402 (Target_arm::do_dynsym_value): Same.
11403
4a657b0d
DK
114042009-05-28 Doug Kwan <dougkwan@google.com>
11405
11406 * Makefile.am (TARGETSOURCES): Add arm.cc.
11407 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
11408 * Makefile.in: Regenerate.
11409 * arm.cc: New file.
11410 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
11411
e7ae8c36
DK
114122009-05-26 Doug Kwan <dougkwan@google.com>
11413
11414 * options.cc (General_options::parse_exclude_libs). Fix a comment.
11415 (General_options::check_excluded_libs): Strip off directories in
11416 archive name before matching like GNU ld does.
11417 * testsuite/Makefile.am (MOSTLYCLEANFILES,
11418 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
11419 (exclude_libs_test_LDFLAGS): Add linker option
11420 -Wl,--exclude-libs,libexclude_libs_test_3
11421 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
11422 an explicit archive without using -l.
11423 (alt/libexclude_libs_test_3.a): New make rule.
11424 * testsuite/Makefile.in: Regenerate.
11425 * testsuite/exclude_libs_test.c : Declare lib3_default().
11426 (main): Call it.
11427 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
11428 * exclude_libs_test_3.c: New file.
11429
f12e7348
NC
114302009-05-26 Nick Clifton <nickc@redhat.com>
11431
11432 * po/id.po: New Indonesian translation.
11433 * po/gold.pot: Updated template file.
11434
4daadc0d
ST
114352009-05-22 Sriraman Tallam <tmsriram@google.com>
11436
e1df38aa 11437 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
11438 gc_comdat_test files. Add -Wl,--gc-sections to build
11439 gc_comdat_test.
11440 * testsuite/Makefile.in: Regenerate.
11441 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
11442
531813ad
ST
114432009-05-21 Sriraman Tallam <tmsriram@google.com>
11444
11445 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
11446 kept comdat section was garbage collected.
11447 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
11448 * testsuite/Makefile.in: Regenerate.
11449 * testsuite/gc_comdat_test.sh: New file.
11450 * testsuite/gc_comdat_test_1.cc: New file.
11451 * testsuite/gc_comdat_test_2.cc: New file.
11452
65514900
CC
114532009-05-19 Doug Kwan <dougkwan@google.com>
11454
11455 * archive.cc (Archive::Archive): Move constructor from archive.h
11456 to here. Initialize no_export_.
11457 (Archive::get_elf_object_for_member): Set no_export flag of object.
11458 * archive.h (Archive::Archive): Move constructor body to
11459 archive.cc.
11460 (Archive::no_export): New method.
11461 (Archive::no_export_): New field.
11462 * object.h (Object::Object): Initialize no_export_ to false.
11463 (Object::no_export, Object::set_no_export): New methods.
11464 (Object::no_export_): New field.
11465 * options.cc (General_options::parse_exclude_libs): New method.
11466 (General_options::check_excluded_libs) Same.
11467 * options.h (exclude_libs): New option.
11468 (General_options::check_excluded_libs): New method declaration.
11469 (General_options::excluded_libs_): New field.
11470 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
11471 default or protected visibility if an object has no-export flag set.
11472 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
11473 (check_SCRIPTS): Add exclude_libs_test.sh.
11474 (check_DATA): Add exclude_libs_test.syms.
11475 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
11476 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
11477 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
11478 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
11479 (exclude_libs_test.syms, libexclude_libs_test_1.a,
11480 libexclude_libs_test_2.a): New rules.
11481 * testsuite/Makefile.in: Regenerate.
11482 * testsuite/exclude_libs_test.c: New file.
11483 * testsuite/exclude_libs_test.sh: Ditto.
11484 * testsuite/exclude_libs_test_1.c: Ditto.
11485 * testsuite/exclude_libs_test_2.c: Ditto.
11486
1b77ea50
ILT
114872009-05-15 Ian Lance Taylor <iant@google.com>
11488
11489 * configure.ac: Check for declarations for cases where libiberty.h
11490 checks HAVE_DECL_xxx.
11491 * configure, config.in: Rebuild.
11492
072fe7ce
ILT
114932009-05-15 Mikolaj Zalewski <mikolajz@google.com>
11494
11495 * gold.h (Incremental_argument_list): Remove (invalid) forward
11496 declaration.
11497 * incremental.cc (Incremental_inputs::report_achive): New method.
11498 (Incremental_inputs::report_object): New method.
11499 (Incremental_inputs::report_script): New method.
11500 (Incremental_inputs::finalize_inputs): New method.
11501 (Incremental_inputs::finalize): Call finalize_inputs().
11502 (Incremental_inputs::sized_create_incremental_inputs_section_data):
11503 Create inputs entries.
11504 * incremental.h (Incremental_input_type): New enum.
11505 (Incremental_inputs::Incremental_input): Initialize new fields.
11506 (Incremental_inputs::report_inputs): New method.
11507 (Incremental_inputs::report_achive): New method.
11508 (Incremental_inputs::report_object): New method.
11509 (Incremental_inputs::report_script): New method.
11510 (Incremental_inputs::finalize_inputs): New method.
11511 (Incremental_inputs::Input_info): New struct.
11512 (Incremental_inputs::Input_info_map): New typedef.
11513 (Incremental_inputs::lock_): New field.
11514 (Incremental_inputs::Inputs_): New field.
11515 (Incremental_inputs::Inputs_map): New field.
11516 * main.cc (main): Call Incremental_input::report_inputs.
11517 * options.h (Input_argument_list): Typedef moved from
11518 Input_arguments.
11519 (Input_file_group::Files): Remove, use ::Input_argument_list.
11520 (Input_file_group::Input_argument_list): Remove, use
11521 ::Input_argument_list.
11522 * plugin.cc (Plugin_manager::add_input_file): Add error in
11523 incremental build.
11524 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
11525 functions.
11526 * script.cc (read_input_script): Call
11527 Incremental_input::report_script.
11528 * script.h (Script_info): New class.
11529
b0481b0b
ILT
115302009-04-27 Ian Lance Taylor <iant@google.com>
11531
11532 * x86_64.cc (do_adjust_output_section): Set entsize to
11533 plt_entry_size.
11534
b22a5a41 115352009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
11536
11537 * output.cc (Output_file::close): After short writes, continue
11538 writing from the correct offset in the buffer being written.
11539
40fde488
CD
115402009-04-23 Chris Demetriou <cgd@google.com>
11541
11542 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
11543 * configure: Regenerate.
11544 * config.in: Regenerate.
11545 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
11546 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
11547
3ce2c28e
ILT
115482009-04-21 Mikolaj Zalewski <mikolajz@google.com>
11549
11550 * incremental.cc (Incremental_inputs_header_data): Renamed from
11551 Incremental_input_header_data.
11552 (Incremental_inputs_header_data::data_size): New field.
11553 (Incremental_inputs_header_data::put_input_file_count): Renamed
11554 from input_file_count.
11555 (Incremental_inputs_header_data::put_command_line_offset): Renamed
11556 from command_line_offset.
11557 (Incremental_inputs_header_data::put_reserved): Renamed from
11558 put_reserved.
11559 (Incremental_inputs_entry_data): Renamed from
11560 Incremental_input_entry_data.
11561 (Incremental_inputs_entry_data::data_size): New field.
11562 (Incremental_inputs::report_command_line): New method.
11563 (Incremental_inputs::finalize): New method.
11564 (Incremental_inputs::create_incremental_inputs_data): New method.
11565 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
11566 * incremental.h: New file.
11567 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 11568 (Layout::finalize): Create incremental inputs section in
3ce2c28e 11569 incremental builds.
703d02da 11570 (Layout::create_incremental_info_sections): New method.
3ce2c28e 11571 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
11572 (Layout::create_incremental_info_sections): New method.
11573 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
11574 * main.cc (main): Notify Incremental_input of the command line.
11575
e55bde5e
ILT
115762009-04-01 Ian Lance Taylor <iant@google.com>
11577 Mikolaj Zalewski <mikolajz@google.com>
11578
11579 * gold.h (reserve_unordered_map): Define, three versions, one for
11580 each version of Unordered_map.
11581 * layout.cc (Layout::Layout): Remove options parameter. Add
11582 number_of_input_files parameter. Don't initialize options_.
11583 Initialize number_of_input_files_ and resized_signatures_. Move
11584 sections_are_attached_.
11585 (Layout::layout_group): Reserve space for group_signatures_.
11586 (Layout::find_or_add_kept_section): Change name parameter to be a
11587 reference. Resize signatures_ map when it gets large enough.
11588 (Layout::layout_eh_frame): Use parameters->options() instead of
11589 this->options_.
11590 (Layout::make_output_section): Likewise.
11591 (Layout::attach_allocated_section_to_segment): Likewise.
11592 (Layout::finalize, Layout::create_executable_stack): Likewise.
11593 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
11594 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
11595 * layout.h (class Layout): Update declarations. Remove options_
11596 field. Add number_of_input_files_ and resized_signatures_
11597 fields. Move sections_are_attached_ field.
11598 * main.cc (main): Pass number of input files to Layout
11599 constructor. Don't pass options.
11600
154b857c
ILT
116012009-03-30 Ian Lance Taylor <iant@google.com>
11602
11603 * ffsll.c (ffsll): Correct implementation.
11604
2f35ab9b
ILT
116052009-03-27 Ian Lance Taylor <iant@google.com>
11606
fd03461a
ILT
11607 * ffsll.c: New file.
11608 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
11609 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
11610 * ftruncate.c (ftruncate): Declare before definition.
11611 * mremap.c (mremap): Likewise.
11612 * pread.c (pread): Likewise.
11613 * configure, Makefile.in, config.in: Rebuild.
11614
2f35ab9b
ILT
11615 * mremap.c: New file.
11616 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
11617 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
11618 (mremap): Declare if HAVE_MREMAP is not defined.
11619 * configure, Makefile.in, config.in: Rebuild.
11620
33aea2fd
CC
116212009-03-27 Cary Coutant <ccoutant@google.com>
11622
11623 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
11624 position independent.
11625 * sparc.cc (Target_sparc::check_non_pic): Likewise.
11626 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
11627
6d479619
CC
116282009-03-24 Cary Coutant <ccoutant@google.com>
11629
11630 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
11631 an executable.
11632 (needs_dynamic_reloc): Likewise.
11633
afc06bb8
ILT
116342009-03-24 Ian Lance Taylor <iant@google.com>
11635
11636 * yyscript.y (file_cmd): Recognize EXTERN.
11637 (extern_name_list, extern_name_list_body): New nonterminals.
11638 * script.cc (script_add_extern): Define.
11639 * script-c.h (script_add_extern): Declare.
11640
f6060a4d
ILT
116412009-03-24 Rafael Avila de Espindola <espindola@google.com>
11642
11643 * object.cc (is_elf_object): Define.
11644 * object.h (is_elf_object): Declare.
11645 * archive.cc (Archive::get_elf_object_for_member): Call
11646 is_elf_object.
33aea2fd 11647 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 11648
26736d8e
ILT
116492009-03-24 Elliott Hughes <enh@google.com>
11650
11651 * output.cc (Output_file::map_anonymous): Define.
11652 (Output_file::map): Use map_anonymous. If the regular mmap fails,
11653 try an anonymous one. Report the size if the mmap fails.
11654 * output.h (class Output_file): Declare map_anonymous.
11655
22fd9730
ILT
116562009-03-24 Ian Lance Taylor <iant@google.com>
11657
11658 * target-select.cc (instantiate_target): Don't acquire the lock if
11659 the instantiated_target_ field has already been set.
11660
cb010894
ILT
116612009-03-23 Ian Lance Taylor <iant@google.com>
11662
7f055c20
ILT
11663 * gold-threads.h (class Initialize_lock): Define.
11664 * gold-threads.cc (class Initialize_lock_once): Define.
11665 (initialize_lock_control): New static variable.
11666 (initialize_lock_pointer): New static variable.
11667 (initialize_lock_once): New static function.
11668 (Initialize_lock::Initialize_lock): Define.
11669 (Initialize_lock::initialize): Define.
11670 * target-select.h: Include "gold-threads.h".
11671 (class Target_selector): Add lock_ and initialize_lock_ fields.
11672 Don't define instantiate_target, just declare it.
11673 * target-select.cc (Target_selector::Target_selector): Initialize
11674 new fields.
11675 (Target_selector::instantiate_target): Define.
11676 * descriptors.h: Include "gold-threads.h".
11677 (class Descriptors): Add initialize_lock_ field.
11678 * descriptors.cc (Descriptors::Descriptors): Initialize new
11679 field.
11680 (Descriptors::open): Use initialize_lock_ field
11681 * errors.h (class Errors): Add initialize_lock_ field.
11682 * errors.cc (Errors::Errors): Initialize new field.
11683 (Errors::initialize_lock): Use initialize_lock_ field.
11684 * powerpc.cc (class Target_selector_powerpc): Remove
11685 instantiated_target_ field. In do_recognize call
11686 instantiate_target rather than do_instantiate_target. In
11687 do_instantiate_target just allocate a new target.
11688 * sparc.cc (class Target_selector_sparc): Likewise.
11689
36959681
ILT
11690 * freebsd.h: New file.
11691 * i386.cc: Include "freebsd.h".
11692 (Target_i386): Derive from Target_freebsd rather than
11693 Sized_target.
11694 (Target_selector_i386): Derive from Target_selector_freebsd rather
11695 than Target_selector.
11696 * x86_64.cc: Include "freebsd.h".
11697 (Target_x86_64): Derive from Target_freebsd rather than
11698 Sized_target.
11699 (Target_selector_x86_64): Derive from Target_selector_freebsd
11700 rather than Target_selector.
11701 * target.h (class Target): Add adjust_elf_header and
11702 do_adjust_elf_header.
11703 * output.cc (Output_file_header:: do_sized_write): Call target
11704 adjust_elf_header routine.
11705 * configure.tgt: Set targ_osabi.
11706 * configure.ac: Define GOLD_DEFAULT_OSABI.
11707 * parameters.cc (Parameters::default_target): Pass
11708 GOLD_DEFAULT_OSABI to select_target.
11709 * target-select.h (class Target_selector): Make instantiate_target
11710 protected rather than private.
11711 * Makefile.am (HFILES): Add freebsd.h.
11712 * configure, Makefile.in, config.in: Rebuild.
11713
cb010894
ILT
11714 * merge.cc (do_add_input_section): Correct pend value. Change
11715 message about last entry not being null terminated from error to
11716 warning.
11717
0e879927
ILT
117182009-03-20 Mikolaj Zalewski <mikolajz@google.com>
11719
11720 * incremental.cc: New file.
11721 * Makefile.am (CCFILES): Add incremental.cc.
11722 * Makefile.in: Rebuild.
11723
41105937
PP
117242009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
11725
11726 * layout.cc (Layout::output_section_name): Preserve names
11727 of '.note.' sections.
e1df38aa 11728
60439920
ILT
117292009-03-19 Ian Lance Taylor <iant@google.com>
11730
11731 * descriptors.cc (Descriptors::open): Check that the options are
11732 valid before using them.
11733
0d371ad3
ILT
117342009-03-18 Ian Lance Taylor <iant@google.com>
11735
11736 * script-sections.h: Include <list>.
11737 (class Script_sections): Change Sections_elements from std::vector
11738 to std::list. Typedef public Elements_iterator. Add
11739 orphan_section_placement_, data_segment_align_start_, and
11740 saw_data_segment_align_ fields. Remove data_segment_align_index_
11741 field.
11742 * script-sections.cc (class Orphan_section_placement): New class.
11743 (class Sections_element): Add virtual functions is_relro and
11744 orphan_section_init. Remove virtual function place_orphan_here.
11745 (class Output_section_definition): Add is_relro and
11746 orphan_section_init. Remove place_orphan_here.
11747 (class Orphan_output_section): Likewise.
11748 (Script_sections::Script_sections): Update for field changes.
11749 (Script_sections::data_segment_align): Set saw_data_segment_align_
11750 and data_segment_align_start_, not data_segment_align_index.
11751 (Script_sections::data_segment_relro_end): Check
11752 saw_data_segment_align_. Use data_segment_align_start_ rather
11753 than data_segment_align_index_.
11754 (Script_sections::place_orphan): Rewrite to use
11755 Orphan_section_placement.
11756
9201d894
ILT
117572009-03-17 Ian Lance Taylor <iant@google.com>
11758
9c5b8369
ILT
11759 * archive.cc (Archive::add_symbols): Check for a version attached
11760 to the symbol name in the archive map.
11761 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
11762 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
11763 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
11764 (ver_test_11.a): New target.
11765 * testsuite/Makefile.in: Rebuild.
11766
9201d894
ILT
11767 * configure.ac: Check for chsize and posix_fallocate. Replace
11768 ftruncate.
11769 * ftruncate.c: New file, from gnulib.
11770 * output.cc (posix_fallocate): Define dummy version if not
11771 HAVE_POSIX_FALLOCATE.
11772 (Output_file::map): Call posix_fallocate rather than lseek and
11773 write.
11774 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
11775 * configure, Makefile.in, config.in: Rebuild.
11776
ef4ab7a8 117772009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 11778
ef4ab7a8
PP
11779 * layout.h (Layout::create_note): Add section_name parameter.
11780 * layout.cc (Layout::create_note): Likewise.
11781 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 11782
8c500701
ILT
117832009-03-17 Ian Lance Taylor <iant@google.com>
11784
e85b18e1
ILT
11785 * descriptors.cc: Include "options.h".
11786 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
11787 (Descriptors::open): Always use O_CLOEXEC when opening a new
11788 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
11789 then set FD_CLOEXEC.
11790
9efe6174
ILT
11791 * sparc.cc (class Target_sparc): Add has_got_section.
11792 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
11793 make sure we have a GOT section.
11794
11795 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
11796 (Target_sparc::Scan::local): Likewise.
11797 (Target_sparc::Scan::global): Likewise.
11798 (Target_sparc::Relocate::relocate): Likewise.
11799 (Target_sparc::Relocate::relocate_tls): Likewise.
11800
8c500701
ILT
11801 * symtab.cc (Symbol_table::define_default_version): New function,
11802 broken out of add_from_object.
11803 (Symbol_table::add_from_object): Call define_default_version.
11804 (Symbol_table::define_special_symbol): Add resolve_oldsym
11805 parameter. Change all callers. If the version for a symbol comes
11806 from a version script, resolve it with the symbol with the same
11807 name with no version. Also add the symbol without a version if
11808 appropriate.
11809 (do_define_in_output_data): If resolving with oldsym, don't delete
11810 sym.
11811 (do_define_in_output_segment): Likewise.
11812 (do_define_as_constant): Likewise.
11813 * symtab.h (class Symbol_table): Update declarations.
11814
f1ed28fb
ILT
118152009-03-13 Ian Lance Taylor <iant@google.com>
11816
15f8229b
ILT
11817 * readsyms.cc (Read_symbols::incompatible_warning): New function.
11818 (Read_symbols::requeue): New function.
11819 (Read_symbols::do_read_symbols): If make_elf_object fails because
11820 the target type is not configured, and the file was searched for,
11821 issue a warning and retry with the next directory.
11822 (Add_symbols::run): If the file has an incompatible format, and
11823 it was searched for, requeue the Read_symbols task. On error,
11824 release the object.
11825 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
11826 dirindex parameter to constructor. Change all callers. Declare
11827 incompatible_warning and requeue.
11828 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
11829 input_argument_ and input_group_ fields. Add them to
11830 constructor. Change all callers.
11831 (class Read_script): Add dirindex_ field. Add it to constructor.
11832 Change all callers.
11833 * archive.cc (Archive::setup): Remove input_objects parameter.
11834 Change all callers.
11835 (Archive::get_file_and_offset): Likewise.
11836 (Archive::read_all_symbols): Likewise.
11837 (Archive::read_symbols): Likewise.
11838 (Archive::get_elf_object_for_member): Remove input_objects
11839 parameter. Add punconfigured parameter. Change all callers.
11840 (Archive::add_symbols): Change return type to bool. Check return
11841 value of include_member.
11842 (Archive::include_all_members): Likewise.
11843 (Archive::include_member): Change return type to bool. Return
11844 false if first included object has incompatible target. Set
11845 included_member_ field.
11846 (Add_archive_symbols::run): If add_symbols returns false, requeue
11847 Read_symbols task.
11848 * archive.h (class Archive): Add included_member_ field.
11849 Initialize it in constructor. Add input_file and searched_for
11850 methods. Update declarations.
11851 (class Add_archive_symbols): Add dirpath_, dirindex_, and
11852 input_argument_ fields. Add them to constructor. Change all
11853 callers.
11854 * script.cc: Include "target-select.h".
11855 (class Parser_closure): Add skip_on_incompatible_target_ and
11856 found_incompatible_target_ fields. Add
11857 skip_on_incompatible_target parameter to constructor. Change all
11858 callers. Add methods skip_on_incompatible_target,
11859 clear_skip_on_incompatible_target, found_incompatible_target, and
11860 set_found_incompatible_target.
11861 (read_input_script): Add dirindex parameter. Change all callers.
11862 If parser finds an incompatible target, requeue Read_symbols
11863 task.
11864 (script_set_symbol): Clear skip_on_incompatible_target in
11865 closure.
11866 (script_add_assertion, script_parse_option): Likewise.
11867 (script_start_sections, script_add_phdr): Likewise.
11868 (script_check_output_format): New function.
11869 * script.h (read_input_script): Update declaration.
11870 * script-c.h (script_check_output_format): Declare.
11871 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
11872 (ignore_cmd): Remove OUTPUT_FORMAT.
11873 * fileread.cc (Input_file::Input_file): Add explicit this.
11874 (Input_file::will_search_for): New function.
11875 (Input_file::open): Add pindex parameter. Change all callers.
11876 * fileread.h (class Input_file): Add input_file_argument method.
11877 Declare will_search_for. Update declarations.
11878 * object.cc (make_elf_object): Add punconfigured parameter.
11879 Change all callers.
11880 * object.h (class Object): Make input_file public. Add
11881 searched_for method.
11882 (make_elf_object): Update declaration.
11883 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
11884 restart search.
11885 * dirsearch.h (class Dirsearch): Update declaration.
11886 * options.h (class General_options): Add --warn-search-mismatch.
11887 * parameters.cc (Parameters::is_compatible_target): New function.
11888 * parameters.h (class Parameters): Declare is_compatible_target.
11889 * workqueue.cc (Workqueue::add_blocker): New function.
11890 * workqueue.h (class Workqueue): Declare add_blocker.
11891
f1ed28fb
ILT
11892 * fileread.cc (Input_file::open): Remove options parameter.
11893 Change all callers.
11894 (Input_file::open_binary): Likewise.
11895 * script.cc (read_input_script): Likewise.
11896 * readsyms.h (class Read_symbols): Remove options_ field. Remove
11897 options parameter from constructor. Change all callers.
11898 (class Read_script): Likewise.
11899 * fileread.h (class Input_file): Update declarations.
11900 * script.h (read_input_script): Update declaration.
11901
34dd024a
NC
119022009-03-10 Nick Clifton <nickc@redhat.com>
11903
11904 * po/es.po: New Spanish translation.
11905
6d71b17c
CC
119062009-03-06 Cary Coutant <ccoutant@google.com>
11907
11908 * options.cc (parse_short_option): Keep dash_z from registering itself.
11909
031cdbed
ILT
119102009-03-03 Ian Lance Taylor <iant@google.com>
11911
11912 PR 9918
11913 * target-reloc.h (relocate_section): Pass output_section to
11914 relocate.
11915 * i386.cc (Target_i386::should_apply_static_reloc): Add
11916 output_section parameter. Change all callers.
11917 (Target_i386::Relocate::relocate): Add output_section parameter.
11918 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
11919 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
11920 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
11921 * testsuite/two_file_shared.sh: New script.
11922 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
11923 (check_DATA): Add two_file_shared.dbg.
11924 (two_file_shared.dbg): New target.
11925 * testsuite/Makefile.in: Rebuild.
11926
15d5fa16
ILT
119272009-03-01 Ian Lance Taylor <iant@google.com>
11928
11929 * configure.ac: Check for byteswap.h.
11930 * configure: Rebuild.
11931 * config.in: Rebuild.
11932
8a4c0b0d
ILT
119332009-03-01 Mikolaj Zalewski <mikolajz@google.com>
11934
11935 * layout.cc (Layout::find_or_add_kept_section): New function.
11936 (Layout::add_comdat): Removed.
11937 * layout.h (struct Kept_section): Move out of class Layout.
11938 Remove trailing underscores from field names. Add group_sections
11939 field. Rename group_ field to is_group. Change all uses.
11940 (class Layout): Declare find_or_add_kept_section, not add_comdat.
11941 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
11942 comdat_groups_ field.
11943 (Sized_relobj::include_section_group): Use
11944 find_or_add_kept_section and Kept_section::group_sections.
11945 (Sized_relobj::include_linkonce_section): Likewise.
11946 * object.cc (class Sized_relobj): Don't define Comdat_group or
11947 Comdat_group_table. Remove find_comdat_group and
11948 add_comdat_group. Remove comdat_groups_ field.
11949 * plugin.cc (include_comdat_group): Use
11950 Layout::find_or_add_kept_section.
11951
b4ecf66b
ILT
119522009-02-28 Ian Lance Taylor <iant@google.com>
11953
14359ca0
ILT
11954 * README: --gc-sections and map files are now supported. Document
11955 some build requirements.
11956
b4ecf66b
ILT
11957 PR 6992
11958 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
11959 relocatable link set the value of the section symbol to zero.
11960 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
11961 relocatable link don't include the section address in the local
11962 symbol value.
11963
0602e05a
ILT
119642009-02-27 Ian Lance Taylor <iant@google.com>
11965
fd9d194f
ILT
11966 PR 6811
11967 * options.h (class Search_directory): Add is_system_directory.
11968 (class General_options): Declare is_in_system_directory.
11969 * options.cc (get_relative_sysroot): Make static.
11970 (get_default_sysroot): Make static.
11971 (General_optoins::is_in_system_directory): New function.
11972 * fileread.cc (Input_file::is_in_system_directory): New function.
11973 * fileread.h (class Input_file): Declare is_in_system_directory.
11974 * object.h (class Object): Add is_in_system_directory.
11975 (class Input_objects): Remove system_library_directory_ field.
11976 * object.cc (Input_objects::add_object): Don't set
11977 system_library_directory_.
11978 (input_objects::found_in_system_library_directory): Remove.
11979 * symtab.cc (Symbol_table::write_globals): Remove input_objects
11980 parameter. Change all callers.
11981 (Symbol_table::sized_write_globals): Likewise.
11982 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
11983 Call Object::is_in_system_directory.
11984 * symtab.h (class Symbol_table): Update declarations.
11985
61edd21f
ILT
11986 PR 5990
11987 * descriptors.h (Open_descriptor): Add is_on_stack field.
11988 * descriptors.cc (Descriptors::open): If the descriptor is on the
11989 top of the stack, remove it. Initialize is_on_stack field.
11990 (Descriptors::release): Only add pod to stack if it is not on the
11991 stack already.
11992 (Descriptors::close_some_descriptor): Clear stack_next and
11993 is_on_stack fields.
11994
e29e076a
ILT
11995 PR 7091
11996 * output.cc (Output_section::find_starting_output_address): Rename
11997 from starting_output_address; add PADDR parameter; change return
11998 type.
11999 * output.h (class Output_section): Declare
12000 find_starting_output_address instead of starting_output_address.
12001 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
12002 section symbol for which we can't find a merge section.
12003
0602e05a
ILT
12004 PR 9836
12005 * symtab.cc (Symbol_table::add_from_object): If the visibility is
12006 hidden or internal, force the symbol to be local.
12007 * resolve.cc (Symbol::override_visibility): Define.
12008 (Symbol::override_base): Use override_visibility.
12009 (Symbol_table::resolve): Likewise.
12010 (Symbol::override_base_with_special): Likewise.
12011 (Symbol_table::override_with_special): If the visibility is hidden
12012 or internal, force the symbol to be local.
12013 * symtab.h (class Symbol): Add set_visibility and
12014 override_visibility.
12015 * testsuite/ver_test_1.sh: New file.
12016 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
12017 (check_DATA): Add ver_test_1.syms.
12018 (ver_test_1.syms): New target.
12019 * testsuite/Makefile.in: Rebuild.
12020
401a9a73
CC
120212009-02-25 Cary Coutant <ccoutant@google.com>
12022
12023 * layout.cc (Layout::choose_output_section): Don't rename sections
12024 when using a linker script that has a SECTIONS clause.
12025 * Makefile.in: Regenerate.
12026
12027 * testsuite/Makefile.am (script_test_5.sh): New test case.
12028 * testsuite/Makefile.in: Regenerate.
12029 * testsuite/script_test_5.cc: New file.
12030 * testsuite/script_test_5.sh: New file.
12031 * testsuite/script_test_5.t: New file.
12032
f488e4b0
CC
120332009-02-13 Rafael Avila de Espindola <espindola@google.com>
12034
12035 * archive.cc (Archive::include_member): Update calls to add_symbols.
12036 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
12037 the Layout argument.
12038 * dynobj.h (do_add_symbols): Add the Layout argument.
12039 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
12040 Layout argument.
12041 * object.h (Object::add_symbols): Add the Layout argument.
12042 (Object::do_add_symbols): Add the Layout argument.
12043 (Sized_relobj::do_add_symbols): Add the Layout argument.
12044 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
12045 Unify the two versions.
12046 (Add_plugin_symbols): Remove.
12047 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
12048 (Sized_pluginobj::do_add_symbols): Unify the two versions.
12049 (Add_plugin_symbols): Remove.
12050 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
12051 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
12052 (Add_symbols::run): Make it work with Pulginobj.
12053
89dd1680
ILT
120542009-02-06 Ian Lance Taylor <iant@google.com>
12055
12056 * object.cc (Sized_relobj::do_layout): Make info message start
12057 with lower case letter.
12058
266d0a74
ILT
120592009-02-06 Mikolaj Zalewski <mikolajz@google.com>
12060
602b464e
ILT
12061 * binary.cc: Fix file comment.
12062
266d0a74
ILT
12063 * options.h (enum Incremental_disposition): Define.
12064 (class General_options): Add new options: --incremental,
12065 --incremental_changed, --incremental_unchanged,
12066 --incremental_unknown. Add incremental_disposition_ and
12067 implicit_incremental_ fields.
12068 (General_options::incremental_disposition): New function.
12069 (class Position_dependent_options): Add incremental_disposition
12070 option.
12071 (Position_dependent_options::copy_from_options): Set incremental
12072 dispositions.
12073 * options.cc (General_options::parse_incremental_changed): New
12074 function.
2e702c99
RM
12075 (General_options::parse_incremental_unchanged): New function.
12076 (General_options::parse_incremental_unknown): New function.
12077 (General_options::General_options): Initialize new fields
266d0a74 12078 incremental_disposition_ and implicit_incremental_.
2e702c99 12079 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
12080 without --incremental.
12081
f073bbf7
CD
120822009-02-06 Chris Demetriou <cgd@google.com>
12083
12084 * gold.h (gold_undefined_symbol): Change to take only a Symbol
12085 pointer and to report location as the file name associated with
12086 the symbol.
12087 (gold_undefined_symbol_at_location): New function to replace the
12088 old gold_undefined_symbol functionality.
12089 * target-reloc.h (relocate_section): Update to use
12090 gold_undefined_symbol_at_location.
12091 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
12092 Call gold_undefined_symbol function rather than gold_error.
12093 * errors.h (Errors::undefined_symbol): Take location as a
12094 string, rather than calculating it from a relocation.
12095 * errors.cc (Errors::fatal): Print "fatal error:" before the
12096 formatted message.
12097 (Errors::error, Errors::error_at_location): Print "error: "
12098 before the formatted message.
12099 (Errors::undefined_symbol): Take location as a string, rather
12100 than calculating it from a relocation.
12101 (gold_undefined_symbol_at_location): New function akin to
12102 old gold_undefined_symbol, calculates location from relocation.
12103 (gold_undefined_symbol): Change to take only a Symbol pointer
12104 and to report location as the file name associated with the symbol.
12105 * testsuite/debug_msg.sh: Update for changed error messages.
12106 * testsuite/undef_symbol.sh: Likewise.
12107
8e94a90c
ILT
121082009-02-04 Duncan Sands <baldrick@free.fr>
12109
12110 PR 9812
12111 * reduced_debug_output.h
12112 (Output_reduced_debug_abbrev_section::failed): Use format for
12113 gold_warning.
12114 (Output_reduced_debug_info_section::faild): Likewise.
12115
88a0e15b
ILT
121162009-01-31 Mikolaj Zalewski <mikolajz@google.com>
12117
12118 * script.cc (Lazy_demangler): New class.
2e702c99 12119 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
12120 symbol only once.
12121
5efc7cd2
CC
121222009-01-29 Cary Coutant <ccoutant@google.com>
12123
12124 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
12125 to __tls_get_addr.
12126 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
12127
e0ebcf42
ILT
121282009-01-28 Ian Lance Taylor <iant@google.com>
12129
5efc7cd2 12130 * version.cc (version_string): Bump to 1.9.
75fe7426 12131
e0ebcf42
ILT
12132 * gold.h: Include <cstring> and <stdint.h>.
12133 * version.cc: Include <cstdio>.
12134 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
12135 warning.
12136 * reduced_debug_output.cc (insert_into_vector): Rename from
12137 Insert_into_vector; change all callers. Use Swap_unaligned to
12138 avoid aliasing issue; remove union since it is unnecessary.
12139
8e2813be 121402009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
12141
12142 * Makefile.am (CCFILES): Add gc.cc.
12143 (HFILES): Add gc.h.
12144 * Makefile.in: Regenerate.
12145 * gold.cc (Gc_runner): New class.
12146 (queue_initial_tasks): Call garbage collection related tasks
12147 when corresponding options are invoked.
12148 (queue_middle_gc_tasks): New function.
12149 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
12150 processed early before laying out sections during garbage collection.
12151 * gold.h (queue_middle_gc_tasks): New function.
12152 (is_prefix_of): Move from "layout.cc".
12153 * i386.cc (Target_i386::gc_process_relocs): New function.
12154 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
12155 * main.cc (main): Create object of class "Garbage_collection".
12156 * object.cc (Relobj::copy_symbols_data): New function.
12157 (Relobj::is_section_name_included): New function.
e1df38aa
NC
12158 (Sized_relobj::do_layout): Allow this function to be called twice
12159 during garbage collection and defer layout of section during the
6d03d481
ST
12160 first call.
12161 * object.h (Relobj::get_symbols_data): New function.
12162 (Relobj::is_section_name_included): New function.
12163 (Relobj::copy_symbols_data): New function.
12164 (Relobj::set_symbols_data): New function.
12165 (Relobj::get_relocs_data): New function.
12166 (Relobj::set_relocs_data): New function.
12167 (Relobj::is_output_section_offset_invalid): New pure virtual function.
12168 (Relobj::gc_process_relocs): New function.
12169 (Relobj::do_gc_process_relocs): New pure virtual function.
12170 (Relobj::sd_): New data member.
12171 (Sized_relobj::is_output_section_offset_invalid): New function.
12172 (Sized_relobj::do_gc_process_relocs): New function.
12173 * options.h (General_options::gc_sections): Modify to not be a no-op.
12174 (General_options::print_gc_sections): New option.
12175 * plugin.cc (Plugin_finish::run): Remove function call to
12176 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
12177 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
12178 * reloc.cc (Read_relocs::run): Add task to process relocs and
12179 determine unreferenced sections when doing garbage collection.
12180 (Gc_process_relocs): New class.
12181 (Sized_relobj::do_gc_process_relocs): New function.
12182 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
12183 sections that are garbage collected.
12184 * reloc.h (Gc_process_relocs): New class.
12185 * sparc.cc (Target_sparc::gc_process_relocs): New function.
12186 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
12187 symbols whose corresponding sections are garbage collected.
12188 (Symbol_table::Symbol_table): Add new parameter for the garbage
12189 collection object.
12190 (Symbol_table::gc_mark_undef_symbols): New function.
12191 (Symbol_table::gc_mark_symbol_for_shlib): New function.
12192 (Symbol_table::gc_mark_dyn_syms): New function.
12193 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
12194 as garbage.
12195 (Symbol_table::add_from_object): Likewise.
12196 (Symbol_table::add_from_relobj): When building shared objects, do not
12197 treat externally visible symbols as garbage.
12198 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
12199 table information for static and relocatable links.
12200 * symtab.h (Symbol_table::set_gc): New function.
12201 (Symbol_table::gc): New function.
12202 (Symbol_table::gc_mark_undef_symbols): New function.
12203 (Symbol_table::gc_mark_symbol_for_shlib): New function.
12204 (Symbol_table::gc_mark_dyn_syms): New function.
12205 (Symbol_table::gc_): New data member.
e1df38aa 12206 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
12207 function.
12208 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
12209 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
12210
3b293544
CF
122112009-01-20 Chris Faylor <me.sourceware@sourceware.org>
12212
12213 * options.h (General_options::gc_sections): Define as a no-op for now.
12214 (General_options::no_keep_memory): Ditto.
12215 (General_options::Bshareable): Define.
12216 * options.cc (General_options::finalize): Honor -Bshareable.
12217
83d22aa8
AS
122182009-01-20 Andreas Schwab <schwab@suse.de>
12219
12220 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
12221 read the value in the contents, since we don't use it. Use the
12222 template endianness when writing.
12223 (Relocate::relocate): Use it for R_PPC_REL16_HA.
12224
cd536b21
AS
122252009-01-19 Andreas Schwab <schwab@suse.de>
12226
12227 * configure.tgt (powerpc64-*): Fix targ_obj.
12228
99e9a495
ILT
122292009-01-15 Ian Lance Taylor <iant@google.com>
12230
12231 * object.cc (Sized_relobj::write_local_symbols): Don't write out
12232 local symbols when stripping all symbols.
12233
bbbfea06
CC
122342009-01-14 Cary Coutant <ccoutant@google.com>
12235
99e9a495 12236 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 12237
0f7c0701
CC
122382009-01-14 Cary Coutant <ccoutant@google.com>
12239
12240 * archive.cc (Archive::get_elf_object_for_member): Remove call
12241 to File_read::claim_for_plugin.
12242 * descriptors.cc (Descriptors::open): Remove reference to
12243 is_claimed.
12244 (Descriptors::claim_for_plugin): Remove.
12245 * descriptors.h (Descriptors::claim_for_plugin): Remove.
12246 (Descriptors::is_claimed): Remove.
12247 (claim_descriptor_for_plugin): Remove.
12248 * fileread.cc (File_read::claim_for_plugin): Remove.
12249 * fileread.h (File_read::claim_for_plugin): Remove.
12250 (File_read::descriptor): Reopen descriptor if necessary.
12251 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
12252 (Plugin_manager::all_symbols_read): Add task parameter. Change
12253 all callers.
12254 (Plugin_manager::get_input_file): New function.
12255 (Plugin_manager::release_input_file): New function.
12256 (Pluginobj::Pluginobj): Add filesize parameter and initialize
12257 corresponding data member.
12258 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
12259 and pass to base constructor. Change all callers.
12260 (get_input_file, release_input_file): New functions.
12261 (make_sized_plugin_object): Add filesize parameter. Change all callers.
12262 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
12263 (Plugin_manager::all_symbols_read): Add task parameter.
12264 (Plugin_manager::get_input_file): New function.
12265 (Plugin_manager::release_input_file): New function.
12266 (Plugin_manager::task_): New data member.
12267 (Pluginobj::Pluginobj): Add filesize parameter.
12268 (Pluginobj::filename): New function.
12269 (Pluginobj::descriptor): New function.
12270 (Pluginobj::filesize): New function.
12271 (Pluginobj::filesize_): New data member.
12272 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
12273 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
12274 File_read::claim_for_plugin; use Object::unlock to unlock the file.
12275
12276 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
12277 with archive libraries.
12278 * testsuite/Makefile.in: Regenerate.
12279 * testsuite/plugin_test.c (struct sym_info): New type.
12280 (get_input_file, release_input_file): New static variables.
12281 (onload): Capture new transfer vector entries.
12282 (claim_file_hook): Stop reading at end of file according to filesize.
12283 Factor out parsing of readelf output into separate function.
12284 (all_symbols_read_hook): Exercise get_input_file and release_input_file
12285 APIs and get the source file name from the symbol table. Convert
12286 source file name to corresponding object file name. Print info
12287 message when adding new input files.
12288 (parse_readelf_line): New function.
12289 * testsuite/plugin_test_1.sh: Add checks for new info messages.
12290 * testsuite/plugin_test_2.sh: Likewise.
12291 * testsuite/plugin_test_3.sh: Likewise.
12292 * testsuite/plugin_test_4.sh: New test case.
12293
62a6d109
ILT
122942009-01-07 Ian Lance Taylor <iant@google.com>
12295
12296 * version.cc (version_string): Bump to 1.8.
12297
483620e8
CC
122982008-12-23 Cary Coutant <ccoutant@google.com>
12299
12300 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
12301 * plugin.cc (Plugin_manager::finish): Rename as
12302 layout_deferred_objects. Move cleanup to separate function.
12303 (Plugin_manager::cleanup): New function.
12304 (Plugin_finish::run): Call layout_deferred_objects and cleanup
12305 separately.
12306 * plugin.h (Plugin_manager::finish): Rename as
12307 layout_deferred_objects.
12308 (Plugin_manager::cleanup): New function.
12309 (Plugin_manager::cleanup_done): New field.
12310
d66a9eb3
CC
123112008-12-23 Cary Coutant <ccoutant@google.com>
12312
12313 * plugin.cc (is_visible_from_outside): New function.
12314 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
12315 so we don't return "IR only" status for exported symbols or -r links.
12316
12317 * testsuite/Makefile.am (plugin_test_3): New test case.
12318 * testsuite/Makefile.in: Regenerate.
12319 * testsuite/plugin_test_3.sh: New file.
12320
5995b570
CC
123212008-12-22 Cary Coutant <ccoutant@google.com>
12322
12323 * object.cc (Sized_relobj::layout_section): New function.
12324 (Sized_relobj::do_layout): Defer layout of input sections until after
12325 plugin has provided replacement files.
12326 (Sized_relobj::do_layout_deferred_sections): New function.
12327 * object.h (Relobj::set_section_offset): Remove virtual keyword.
12328 (Relobj::layout_deferred_sections): New function.
12329 (Relobj::do_layout_deferred_sections): New function.
12330 (Sized_relobj::do_layout_deferred_sections): New function.
12331 (Sized_relobj::layout_section): New function.
12332 (Sized_relobj::Deferred_layout): New structure.
12333 (Sized_relobj::deferred_layout_): New field.
12334 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
12335 Change all callers. Layout deferred sections.
12336 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
12337 references.
12338 (Plugin_hook::run): Move code from do_plugin_hook inline.
12339 (Plugin_hook::do_plugin_hook): Remove.
12340 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
12341 (Plugin_manager::finish): Renamed, was cleanup.
12342 (Plugin_manager::should_defer_layout): New function.
12343 (Plugin_manager::add_deferred_layout_object): New function.
12344 (Plugin_manager::Deferred_layout_list): New type.
12345 (Plugin_manager::deferred_layout_objects_): New field.
12346 (Plugin_hook::do_plugin_hook): Remove.
12347
ee769c88
ILT
123482008-12-17 Ian Lance Taylor <iant@google.com>
12349
12350 * options.h (class General_options): Add --no case for
12351 --export-dynamic.
12352
abc8dcba
CC
123532008-12-16 Cary Coutant <ccoutant@google.com>
12354
12355 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
12356 vector.
12357 (Plugin_manager::claim_file): Create plugin object even if
12358 plugin did not call the add_symbols callback.
12359 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
12360 asking for more symbols than were added.
12361 * testsuite/Makefile.am (plugin_test_1): Add test case with
12362 no global symbols.
12363 (empty.syms): New target.
12364 * testsuite/Makefile.in: Regenerate.
12365 * testsuite/plugin_test.c (claim_file_hook): Add new debug
12366 message. Don't call add_symbols if no globals.
12367 (all_symbols_read_hook): Don't provide replacement for empty
12368 claimed file.
12369
b0074644
ILT
123702008-12-12 Ian Lance Taylor <iant@google.com>
12371
68943102
ILT
12372 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
12373 r_type == 0 for a local symbol with r_sym == 0.
12374 (scan_relocatable_relocs): Pass r_sym to
12375 local_non_section_strategy.
12376 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
12377 r_sym parameter.
12378
b0074644
ILT
12379 * configure.ac: Update test for TLS descriptors: they are
12380 supported as of glibc 2.9.
12381 * configure: Rebuild.
12382
c2508178
ILT
123832008-12-11 Ian Lance Taylor <iant@google.com>
12384
12385 PR 7091
12386 * target-reloc.h (Default_scan_relocatable_relocs): For each
12387 function, map r_type == 0 to RELOC_DISCARD.
12388
2756a258
CC
123892008-12-10 Cary Coutant <ccoutant@google.com>
12390
12391 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
12392 object to override a kept COMDAT group from a plugin object.
12393
bb6f53d3
ILT
123942008-12-09 Ian Lance Taylor <iant@google.com>
12395
fbc558e1
ILT
12396 PR 7088
12397 * yyscript.y (file_cmd): Handle INPUT.
12398
bb6f53d3
ILT
12399 * testsuite/initpri1.c: Change all declarations to be full
12400 prototypes by adding void, to avoid compiler warnings.
12401
4674ecfc
CC
124022008-12-05 Rafael Avila de Espindola <espindola@google.com>
12403
12404 * options.cc (General_options::parse_plugin_opt): New.
12405 (General_options::add_plugin): The argument now is just the filename.
12406 (General_options::add_plugin_option): New.
12407 * options.h (plugin_opt): New.
12408 (add_plugin): Change argument name.
12409 (add_plugin_option): New.
12410 * plugin.cc (Plugin::load): Don't parse the plugin option.
12411 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
12412 (Plugin::add_option): New.
12413 (Plugin::args_): Change type.
12414 (Plugin::filename_): New.
12415 (Plugin_manager::add_plugin_option): New.
12416 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
12417 * testsuite/Makefile.in: Regenerate.
12418
fd06b4aa
CC
124192008-12-05 Cary Coutant <ccoutant@google.com>
12420
12421 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
12422 Handle --strip-lto-sections option.
12423 * options.h (strip_lto_sections): New option.
12424
6c52134c
CC
124252008-12-01 Cary Coutant <ccoutant@google.com>
12426
12427 * plugin.cc (ld_plugin_message): Change format parameter to const.
12428 Fix mismatch between new[] and delete.
12429
a45248e0
CC
124302008-11-14 Cary Coutant <ccoutant@google.com>
12431
12432 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
12433 instead of -1U.
12434
c82fbeee
CS
124352008-11-05 Craig Silverstein <csilvers@google.com>
12436
12437 * options.cc (General_options::parse_dynamic_list): New function.
12438 * options.h (General_options): New flags dynamic_list,
12439 dynamic_list_data, dynamic_list_cpp_new, and
12440 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
12441 (General_options::in_dynamic_list): New function.
12442 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
12443 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
12444 (Lex::can_continue_name): Likewise.
12445 (yylex): Likewise.
12446 (read_script_file): New parameter script_options.
12447 (read_dynamic_list): New function.
12448 (Script_options::define_dynamic_list): New function.
12449 (dynamic_list_keyword_parsecodes): New variable.
12450 (dynamic_list_keywords): New variable.
12451 * script.h (Script_options::define_dynamic_list): New function
12452 prototype.
12453 (read_dynamic_list): New function prototype.
12454 * symtab.cc (strprefix): New macro.
12455 (Symbol::should_add_dynsym_entry): Support dynamic_list,
12456 dynamic_list_data, dynamic_list_cpp_new, and
12457 dynamic_list_cpp_typeinfo.
12458 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
12459 (dynamic_list_expr): New rule.
12460 (dynamic_list_nodes): Likewise.
12461 (dynamic_list_node): Likewise.
12462 * testsuite/Makefile.am (dynamic_list): New test.
12463 * testsuite/Makefile.in: Regenerated.
12464 * testsuite/dynamic_list.t: New file.
12465 * testsuite/dynamic_list.sh: New file.
12466
e0bb29a5
CS
124672008-11-05 Craig Silverstein <csilvers@google.com>
12468
12469 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
12470 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
12471 (t11_last): Likewise.
12472 * testsuite/ver_test_6.c (main): Likewise.
12473
4e1e25e0
CC
124742008-10-07 Cary Coutant <ccoutant@google.com>
12475
12476 * options.c (General_options::finalize): Add check for -static and
12477 -shared.
12478 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
12479 is not empty.
12480
92f03fcb
CC
124812008-10-02 Cary Coutant <ccoutant@google.com>
12482
12483 * plugin.cc (make_sized_plugin_object): Fix conditional
12484 compilation to work when not all targets are enabled.
12485
fbd8a257
CC
124862008-09-29 Cary Coutant <ccoutant@google.com>
12487
12488 * archive.cc (Archive::get_file_and_offset): Use filename instead
12489 of name to get library path.
12490 (Archive::include_member): Unlock external member of a thin archive.
12491
12492 * testsuite/Makefile.am (TEST_AR): New variable.
12493 (thin_archive_test_1): New test.
12494 (thin_archive_test_2): New test.
81636b3f
CC
12495 * testsuite/Makefile.in: Regenerate.
12496 * testsuite/thin_archive_main.cc: New file.
12497 * testsuite/thin_archive_test_1.cc: New file.
12498 * testsuite/thin_archive_test_2.cc: New file.
12499 * testsuite/thin_archive_test_3.cc: New file.
12500 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 12501
eff45813
CC
125022008-09-29 Cary Coutant <ccoutant@google.com>
12503
12504 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
12505 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
12506 instead of -1U.
12507 (Sized_relobj::do_finalize_local_symbols): Likewise.
12508 (Sized_relobj::map_to_kept_section): Likewise.
12509 * object.h (Sized_relobj::invalid_address): New constant.
12510 (Sized_relobj::do_output_section_offset): Check for invalid_address
12511 and return -1ULL.
12512 * output.cc (Output_reloc::local_section_offset): Use constant
12513 invalid_address instead of -1U.
12514 (Output_reloc::get_address): Likewise.
12515 (Output_section::output_address): Change -1U to -1ULL.
12516 * output.h (Output_reloc::invalid_address): New constant.
12517 * reloc.cc (Sized_relobj::write_sections): Use constant
12518 invalid_address instead of -1U.
12519 (Sized_relobj::relocate_sections): Likewise.
12520 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
12521 values for merge sections.
12522 * target-reloc.h (relocate_for_relocatable): Use constant
12523 invalid_address instead of -1U.
12524
89fc3421
CC
125252008-09-19 Cary Coutant <ccoutant@google.com>
12526
12527 Add plugin functionality for link-time optimization (LTO).
12528 * configure.ac (plugins): Add --enable-plugins option.
12529 * configure: Regenerate.
12530 * config.in: Regenerate.
12531 * Makefile.am (LIBDL): New variable.
12532 (CCFILES): Add plugin.cc.
12533 (HFILES): Add plugin.h.
12534 (ldadd_var): Add LIBDL.
12535 * Makefile.in: Regenerate.
12536
12537 * archive.cc: Include "plugin.h".
12538 (Archive::setup): Don't preread archive symbols when using a plugin.
12539 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
12540 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
12541 files.
12542 (Archive::include_member): Add symbols from plugin objects.
12543 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
12544 * descriptors.cc (Descriptors::open): Check for file descriptors
12545 abandoned by plugins.
12546 (Descriptors::claim_for_plugin): New function.
12547 * descriptors.h (Descriptors::claim_for_plugin): New function.
12548 (Open_descriptor::is_claimed): New field.
12549 (claim_descriptor_for_plugin): New function.
12550 * fileread.cc (File_read::claim_for_plugin): New function.
12551 * fileread.h (File_read::claim_for_plugin): New function.
12552 (File_read::descriptor): New function.
12553 * gold.cc: Include "plugin.h".
12554 (queue_initial_tasks): Add task to call plugin hooks for generating
12555 new object files.
12556 * main.cc: Include "plugin.h".
12557 (main): Load plugin libraries.
12558 * object.h (Pluginobj): Declare.
12559 (Object::pluginobj): New function.
12560 (Object::do_pluginobj): New function.
12561 (Object::set_target): New function.
12562 * options.cc: Include "plugin.h".
12563 (General_options::parse_plugin): New function.
12564 (General_options::General_options): Initialize plugins_ field.
12565 (General_options::add_plugin): New function.
12566 * options.h (Plugin_manager): Declare.
12567 (General_options): Add --plugin option.
12568 (General_options::has_plugins): New function.
12569 (General_options::plugins): New function.
12570 (General_options::add_plugin): New function.
12571 (General_options::plugins_): New field.
12572 * plugin.cc: New file.
12573 * plugin.h: New file.
12574 * readsyms.cc: Include "plugin.h".
12575 (Read_symbols::do_read_symbols): Check for archive before checking
12576 for ELF file. Call plugin hooks to claim files.
12577 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
12578 from a real object file; force override when processing replacement
12579 files.
12580 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
12581 (Symbol::init_base_object): Likewise.
12582 (Symbol::init_base_output_data): Likewise.
12583 (Symbol::init_base_output_segment): Likewise.
12584 (Symbol::init_base_constant): Likewise.
12585 (Symbol::init_base_undefined): Likewise.
12586 (Symbol::output_section): Assert that object is not a plugin.
12587 (Symbol_table::add_from_pluginobj): New function.
12588 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
12589 undefined.
12590 (Symbol_table::sized_write_globals): Likewise.
12591 (Symbol_table::add_from_pluginobj): Instantiate template.
12592 * symtab.h (Sized_pluginobj): Declare.
12593 (Symbol::in_real_elf): New function.
12594 (Symbol::set_in_real_elf): New function.
12595 (Symbol::in_real_elf_): New field.
12596 (Symbol_table::add_from_pluginobj): New function.
12597
12598 * testsuite/Makefile.am (AM_CFLAGS): New variable.
12599 (LIBDL): New variable.
12600 (LDADD): Add LIBDL.
12601 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
12602 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
12603 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
12604 (MOSTLYCLEANFILES): Likewise.
12605 * testsuite/Makefile.in: Regenerate.
12606 * testsuite/plugin_test.c: New file.
12607 * testsuite/plugin_test_1.sh: New file.
12608 * testsuite/plugin_test_2.sh: New file.
12609
de31bda5
ILT
126102008-09-16 Ian Lance Taylor <iant@google.com>
12611
9c2d0ef9
ILT
12612 * target-reloc.h (relocate_section): Check whether a symbol is
12613 defined by the ABI before reporting an undefined symbol error.
12614 * target.h (Target::is_defined_by_abi): Make parameter const.
12615 (Target::do_is_defined_by_abi): Likewise.
12616 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
12617 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
12618 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
12619 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
12620 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
12621 * testsuite/Makefile.in: Rebuild.
12622
de31bda5
ILT
12623 * fileread.cc (make_view): Add casts to avoid warning.
12624
9fa33bee
AO
126252008-09-16 Alexandre Oliva <aoliva@redhat.com>
12626
12627 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
12628 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
12629
183fd0e3
AO
126302008-09-16 Alexandre Oliva <aoliva@redhat.com>
12631
12632 * options.h (General_options::output_is_executable): New.
12633 (General_options::output_is_pie): New.
12634 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
12635 for shared libraries.
12636 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
12637
7be8330a
CD
126382008-09-11 Chris Demetriou <cgd@google.com>
12639
12640 * options.h (origin): New -z option.
12641 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
12642 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
12643 in DT_FLAGS_1.
12644
a9caad02
CC
126452008-09-05 Cary Coutant <ccoutant@google.com>
12646
12647 * fileread.cc (File_read::make_view): Add check for attempt to map
12648 beyond end of file.
12649
ae6dce4d
CC
126502008-09-05 Cary Coutant <ccoutant@google.com>
12651
12652 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
12653 explicit instantiations.
12654
d7ab2a47
KVH
126552008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
12656
12657 PR gold/6858
12658 * options.cc (General_options::finalize): Allow undefined symbols
12659 in shlibs if linking -shared.
12660
12661 PR gold/6859
12662 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
12663 symbols as not needing a dynsym entry.
12664
1e52a9c1
CS
126652008-08-20 Craig Silverstein <csilvers@google.com>
12666
12667 * fileread.cc (File_read::open): Do not lock the file unless it
12668 was successfully opened.
12669
d85c80a3
CC
126702008-08-14 Cary Coutant <ccoutant@google.com>
12671
12672 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
12673 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
12674 * testsuite/tls_test.cc (struct int128): 128-bit struct
12675 for testing TLS relocs with non-zero addend.
12676 (v12): New TLS variable.
12677 (t12): New test.
12678 (t_last): Add check for v12.
12679 * testsuite/tls_test.h (t12): New function.
12680 * testsuite/tls_test_main.cc (thread_routine): Call new test.
12681
2d924fd9
ILT
126822008-08-13 Ian Lance Taylor <iant@google.com>
12683
12684 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
12685 set tls_segment_ or relro_segment_.
12686 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
12687 when appropriate.
12688 * output.h (Output_section::clear_is_relro): New function.
12689 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
12690 sections specially even when output_data_ is empty.
12691 (Output_segment::maximum_alignment): When first section is relro,
12692 only force alignment for PT_LOAD segments.
12693 * script.cc (script_data_segment_align): New function.
12694 (script_data_segment_relro_end): New function.
12695 * script-c.h (script_data_segment_align): Declare.
12696 (script_data_segment_relro_end): Declare.
12697 * script-sections.h (class Script_sections): Declare
12698 data_segment_align and data_segment_relro_end. Add fields
12699 segment_align_index_ and saw_relro_end_.
12700 * script-sections.cc (class Sections_element): Add set_is_relro
12701 virtual function. Add new bool* parameter to place_orphan_here.
12702 Add get_output_section virtual function.
12703 (class Output_section_definition): Add set_is_relro. Add new
12704 bool* parameter to place_orphan_here. Add get_output_section.
12705 Add is_relro_ field.
12706 (Output_section_definition::Output_section_definition): Initialize
12707 evaluated_address_, evaluated_load_address, evaluated_addralign_,
12708 and is_relro_ fields.
12709 (Output_section_definition::place_orphan_here): Add is_relro
12710 parameter.
12711 (Output_section_definition::set_section_addresses): Set relro for
12712 output section.
12713 (Output_section_definition::alternate_constraint): Likewise.
12714 (class Orphan_output_section): Add new bool* parameter to
12715 place_orphan_here. Add get_output_section.
12716 (Orphan_output_section::place_orphan_here): Add is_relro
12717 parameter.
12718 (Script_sections::Script_sections): Initialize
12719 data_segment_align_index_ and saw_relro_end_.
12720 (Script_sections::data_segment_align): New function.
12721 (Script_sections::data_segment_relro_end): New function.
12722 (Script_sections::place_orphan): Set or clear is_relro.
12723 (Script_sections::set_section_addresses): Force alignment of first
12724 TLS section.
12725 * yyscript.y (exp): Call script_data_segment_align and
12726 script_data_segment_relro_end.
12727 * testsuite/relro_script_test.t: New file.
12728 * testsuite/relro_test.cc (using_script): Declare.
12729 (t1, t2): Test using_script.
12730 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
12731 (relro_script_test_SOURCES): Define.
12732 (relro_script_test_DEPENDENCIES): Define.
12733 (relro_script_test_LDFLAGS): Define.
12734 (relro_script_test_LDADD): Define.
12735 (relro_script_test.so): New target.
12736 * testsuite/Makefile.in: Rebuild.
12737
f827c9a9
CC
127382008-08-06 Cary Coutant <ccoutant@google.com>
12739
12740 * archive.cc (Archive::total_archives, Archive::total_members)
12741 (Archive::total_members_loaded): New variables.
12742 (Archive::setup): Add parameter. Add option to preread
12743 archive symbols.
12744 (Archive::read_armap): Add counter.
12745 (Archive::get_file_and_offset): New function.
12746 (Archive::get_elf_object_for_member): New function.
12747 (Archive::read_all_symbols): New function.
12748 (Archive::read_symbols): New function.
12749 (Archive::add_symbols): Add counters.
12750 (Archive::include_all_members): Use armap to find members if it's
12751 already built.
12752 (Archive::include_member): Skip reading symbols if already read.
12753 Factored code into Archive::get_file_and_offset and
12754 Archive::get_elf_object_for_member. Changed call to
12755 Mapfile::report_include_archive_member.
12756 (Archive::print_stats): New function.
12757 * archive.h: Declare Object and Read_symbols_data classes.
12758 (Archive::Archive): Add initializers for new members.
12759 (Archive::setup): Add parameter.
12760 (Archive::print_stats): New function.
12761 (Archive::total_archives, Archive::total_members)
12762 (Archive::total_members_loaded): New variables.
12763 (Archive::get_file_and_offset): New function.
12764 (Archive::get_elf_object_for_member): New function.
12765 (Archive::read_all_symbols): New function.
12766 (Archive::read_symbols): New function.
12767 (Archive::Archive_member): New class.
12768 (Archive::members_): New member.
12769 (Archive::num_members_): New member.
12770 * main.cc: Include archive.h.
12771 (main): Call Archive::print_stats.
12772 * mapfile.cc (Mapfile::report_include_archive_member): Delete
12773 archive parameter; member_name is now the fully-decorated name.
12774 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
12775 * options.h: (General_options): Add --preread-archive-symbols option.
12776 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
12777 Archive::setup.
12778
de4c45bd
ILT
127792008-08-04 Ian Lance Taylor <iant@google.com>
12780
12781 * symtab.h (Symbol::use_plt_offset): New function.
12782 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
12783 * powerpc.cc (Relocate::relocate): Likewise.
12784 * sparc.cc (Relocate::relocate): Likewise.
12785 * x86_64.cc (Relocate::relocate): Likewise.
12786 * testsuite/weak_plt.sh: New test.
12787 * testsuite/weak_plt_main.cc: New test.
12788 * testsuite/weak_plt_shared.cc: New test.
12789 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
12790 (check_PROGRAMS): Add weak_plt.
12791 (check_DATA): Add weak_plt_shared.so.
12792 (weak_plt_main_pic.o, weak_plt): New targets.
12793 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
12794 * testsuite/Makefile.in: Rebuild.
12795
12796 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
12797 gcctestdir/ld.
12798 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
12799 * testsuite/Makefile.in: Rebuild.
12800
323ee3f4
AM
128012008-08-04 Alan Modra <amodra@bigpond.net.au>
12802
12803 * Makefile.am (POTFILES.in): Set LC_ALL=C.
12804 * Makefile.in: Regenerate.
12805 * po/POTFILES.in: Regenerate.
12806
7c07ecec
ILT
128072008-07-29 Ian Lance Taylor <iant@google.com>
12808
12809 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
12810 symbols before other symbols.
12811 * testsuite/script_test_2.cc (test_addr): Declare.
12812 (test_addr_alias): Declare.
12813 (main): Check that test_addr and test_addr_alias have the right
cd536b21 12814 values.
7c07ecec
ILT
12815 * testsuite/script_test_2.t: Define test_addr_alias and
12816 test_addr.
12817
5778530e
ILT
128182008-07-24 Ian Lance Taylor <iant@google.com>
12819
2a00e4fb
ILT
12820 PR 5990
12821 * descriptors.cc: New file.
12822 * descriptors.h: New file.
12823 * gold-threads.h (class Hold_optional_lock): New class.
12824 * fileread.cc: Include "descriptors.h".
12825 (File_read::~File_read): Release descriptor rather than closing
12826 it.
12827 (File_read::open) [file]: Call open_descriptor rather than open.
12828 Set is_descriptor_opened_.
12829 (File_read::open) [memory]: Assert that descriptor is not open.
12830 (File_read::reopen_descriptor): New function.
12831 (File_read::release): Release descriptor.
12832 (File_read::do_read): Make non-const. Reopen descriptor.
12833 (File_read::read): Make non-const.
12834 (File_read::make_view): Reopen descriptor.
12835 (File_read::do_readv): Likewise.
12836 * fileread.h (class File_read): Add is_descriptor_opened_ field.
12837 Update declarations.
12838 * layout.cc: Include "descriptors.h".
12839 (Layout::create_build_id): Use open_descriptor rather than open.
12840 * output.cc: Include "descriptors.h".
12841 (Output_file::open): Use open_descriptor rather than open.
12842 * archive.cc (Archive::const_iterator): Change Archive to be
12843 non-const.
12844 (Archive::begin, Archive::end): Make non-const.
12845 (Archive::count_members): Likewise.
12846 * archive.h (class Archive): Update declarations.
12847 * object.h (Object::read): Make non-const.
12848 * Makefile.am (CCFILES): Add descriptors.cc.
12849 (HFILES): Add descriptors.h.
12850 * Makefile.in: Rebuild.
12851
801647d1
ILT
12852 PR 6716
12853 * gold.h: Always include <clocale>. Add Solaris workarounds
12854 following code in binutils/sysdep.h.
12855
5edd166e
ILT
12856 PR 6048
12857 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
12858 this->eh_frame_hdr_ is NULL before using it.
12859
c89ad728
ILT
12860 * dynobj.cc (Versions::Versions): Update comment.
12861
aa86f06b
ILT
12862 * dynobj.cc (Versions::Versions): If there is an soname, use it as
12863 the base version name.
12864
5778530e
ILT
12865 * stringpool.cc (Stringpool_template::add_with_length): Set key to
12866 array size plus one.
12867 (Stringpool_template::set_string_offsets): Subtract one from key
12868 before using it as an array index.
12869 (Stringpool_template::get_offset_with_length): Likewise.
12870 (Stringpool_template::write_to_buffer): Likewise.
12871 * stringpool.h (Stringpool_template::get_offset_from_key):
12872 Likewise.
12873
057ead22
ILT
128742008-07-23 Ian Lance Taylor <iant@google.com>
12875
7f649c59
ILT
12876 PR 6658
12877 * object.h (Merged_symbol_value::value): Do our best to handle a
12878 negative addend.
12879
057ead22
ILT
12880 PR 6647
12881 * script.cc (Version_script_info::get_versions): Don't add empty
12882 version tag to return value.
12883 (Version_script_info::get_symbol_version_helper): Change return
12884 type to bool. Add pversion parameter. Change all callers.
12885 (script_register_vers_node): Don't require a non-NULL tag.
12886 * script.h (class Version_script_info): Update declarations.
12887 (Version_script_info::get_symbol_version): Change return type to
12888 bool. Add version parameter. Change all callers.
12889 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
12890 handling. Handle an empty version from a version script.
12891 (Symbol_table::define_special_symbol): Likewise.
12892 * testsuite/ver_test_10.script: New file.
12893 * testsuite/ver_test_10.sh: New file.
12894 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
12895 (check_DATA): Add ver_test_10.syms.
12896 (ver_test_10.syms, ver_test_10.so): New target.
12897 * testsuite/Makefile.in: Rebuild.
12898
58e54ac2
CD
128992008-07-23 Simon Baldwin <simonb@google.com>
12900
12901 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
12902 to zero for undefined symbols from dynamic libraries.
12903
95d14cd3
ILT
129042008-07-23 Ian Lance Taylor <iant@google.com>
12905
12906 * symtab.cc (Symbol_table::resolve): Remove version parameter.
12907 Change all callers.
12908 * symtab.h (class Symbol_table): Update declaration.
12909 * testsuite/ver_test_9.cc: New file.
12910 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
12911 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
12912 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
12913 (ver_test_9.so, ver_test_9.o): New targets.
12914 * testsuite/Makefile.in: Rebuild.
12915
92de84a6
ILT
129162008-07-22 Ian Lance Taylor <iant@google.com>
12917
34810851
ILT
12918 * options.h (class General_options): Define --check-sections.
12919 * layout.cc (Layout::set_segment_offsets): Handle
12920 --check-sections.
12921
af6156ef
ILT
12922 * options.h (class General_options): Define -n/--nmagic and
12923 -N/--omagic.
12924 * options.cc (General_options::finalize): For -n/--nmagic or
12925 -N/--omagic, set -static.
12926 * layout.cc (Layout::attach_allocated_section_to_segment): If
12927 -N/--omagic, don't put read-only and read-write sections in
12928 different segments.
12929 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
12930 finding a read-only segment.
12931 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
12932 don't set the minimum segment alignment to the common page size,
12933 and don't set the file offset to the address modulo the page size.
12934 * script-sections.cc (Script_sections::create_segments): If
12935 -n/--omagic, don't put read-only and read-write sections in
12936 different segments.
12937
92de84a6
ILT
12938 * cref.cc: New file.
12939 * cref.h: New file.
12940 * options.h (class General_options): Add --print-symbol-counts.
12941 * main.cc (main): Issue defined symbol report if requested.
12942 * archive.cc (Archive::interpret_header): Make into a const member
12943 function.
12944 (Archive::add_symbols): Call Input_objects::archive_start and
12945 archive_stop.
12946 (Archive::const_iterator): Define new class.
12947 (Archive::begin, Archive::end): New functions.
12948 (Archive::include_all_members): Rewrite to use iterator.
12949 (Archive::count_members): New function.
12950 * archive.h (class Archive): Update declarations.
12951 (Archive::filename): New function.
12952 * object.cc: Include "cref.h".
12953 (Sized_relobj::Sized_relobj): Initialize defined_count_.
12954 (Sized_relobj::do_get_global_symbol_counts): New function.
12955 (Input_objects::add_object): Add object to cross-referencer.
12956 (Input_objects::archive_start): New function.
12957 (Input_objects::archive_stop): New function.
12958 (Input_objects::print_symbol_counts): New function.
12959 * object.h: Declare Cref and Archive.
12960 (Object::get_global_symbol_counts): New function.
12961 (Object::do_get_global_symbol_counts): New pure virtual function.
12962 (class Sized_relobj): Add defined_count_ field. Update
12963 declarations.
12964 (class Input_objects): Add cref_ field. Update constructor.
12965 Update declarations.
12966 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
12967 defined_count_.
12968 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
12969 symbol counts.
12970 (Sized_dynobj::do_get_global_symbol_counts): New function.
12971 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
12972 defined_count_. Update declarations. Define Symbols typedef.
12973 * symtab.cc (Symbol_table::add_from_relobj): Add defined
12974 parameter. Change all callers.
12975 (Symbol_table::add_from_dynobj): Add sympointers and defined
12976 parameters. Change all callers.
12977 * symtab.h (class Symbol_table): Update declarations.
12978 * Makefile.am (CCFILES): Add cref.cc.
12979 (HFILES): Add cref.h.
12980 * Makefile.in: Rebuild.
12981
3f7c5e1d
CD
129822008-07-22 Simon Baldwin <simonb@google.com>
12983
12984 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
12985 to zero when writing undefined symbols.
12986
e0b64032
ILT
129872008-07-22 Ian Lance Taylor <iant@google.com>
12988
12989 * output.cc (Output_section::add_input_section): Don't try to
12990 merge empty merge sections.
12991
096b02cf
CS
129922008-07-21 Craig Silverstein <csilvers@google.com>
12993
12994 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
12995 Include symbol version in error message.
cd536b21 12996
1d1f116d
CD
129972008-07-20 Chris Demetriou <cgd@google.com>
12998
cd536b21 12999 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
13000 (RANDOM_SEED_CFLAGS): New substituted variable.
13001 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
13002 * configure: Rebuild.
13003 * Makefile.in: Likewise.
13004 * testsuite/Makefile.in: Likewise.
13005
a18f591e
ILT
130062008-07-18 Ian Lance Taylor <iant@google.com>
13007
13008 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
13009 where we see NAME/NULL and NAME/VERSION as separate symbols.
13010 * testsuite/ver_test_main.cc (main): Call t4.
13011 (t4, t4_2a): Define.
13012 * testsuite/ver_test_2.cc (t4_2): Define.
13013 * testsuite/ver_test_2.script: Put t4_2a in VER2.
13014 * testsuite/ver_test_4.cc (t4_2a): Define.
13015 * testsuite/ver_test_4.script: Put t4_2a in VER2.
13016 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
13017
c6e3f6ed
ILT
130182008-07-17 Ian Lance Taylor <iant@google.com>
13019
13020 * dynobj.cc (Versions::add_def): If we give an error about a
13021 missing version, go ahead and create the version anyhow.
13022
ef9beddf
ILT
130232008-07-10 Ian Lance Taylor <iant@google.com>
13024
13025 Handle output sections with more than 0x7fffffff bytes.
13026 * object.h (class Relobj): Change map_to_output_ to
13027 output_sections_, and just keep a section pointer. Change all
13028 uses. Move comdat group support to Sized_relobj.
13029 (Relobj::is_section_specially_mapped): Remove.
13030 (Relobj::output_section): Remove poff parameter. Change all
13031 callers.
13032 (Relobj::output_section_offset): New function.
13033 (Relobj::set_section_offset): Rewrite.
13034 (Relobj::map_to_output): Remove.
13035 (Relobj::output_sections): New function.
13036 (Relobj::do_output_section_offset): New pure virtual function.
13037 (Relobj::do_set_section_offset): Likewise.
13038 (class Sized_relobj): Add section_offsets_ field. Add comdat
13039 group support from Relobj. Update declarations.
13040 (Sized_relobj::get_output_section_offset): New function.
13041 (Sized_relobj::do_output_section_offset): New function.
13042 (Sized_relobj::do_set_section_offset): New function.
13043 * object.cc (Relobj::output_section_address): Remove.
13044 (Sized_relobj::Sized_relobj): Initialize new fields.
13045 (Sized_relobj::include_section_group): Cast find_kept_object to
13046 Sized_relobj.
13047 (Sized_relobj::include_linkonce_section): Likewise.
13048 (Sized_relobj::do_layout): Use separate arrays for output section
13049 and output offset.
13050 (Sized_relobj::do_count_local_symbols): Change map_to_output to
13051 output_sections.
13052 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
13053 output_sections and section_offsets.
13054 (Sized_relobj::write_local_symbols): Likewise.
13055 (map_to_kept_section): Compute output address directly.
13056 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
13057 output_sections and section_offsets.
13058 (Sized_relobj::write_sections): Likewise.
13059 (Sized_relobj::relocate_sections): Likewise.
13060 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
13061 * output.h (class Output_reloc): Update declarations. Change
13062 u2_.relobj to Sized_relobj*.
13063 (class Output_data_reloc): Change add functions to use
13064 Sized_relobj*.
13065 * output.cc (Output_reloc::Output_reloc): Change relobj to
13066 Sized_relobj*.
13067 (Output_reloc::local_section_offset): Change return type to
13068 Elf_Addr. Use get_output_section_offset.
13069 (Output_reloc::get_address): Likewise.
13070 (Output_section::is_input_address_mapped): Don't call
13071 is_section_specially_mapped.
13072 (Output_section::output_offset): Likewise.
13073 (Output_section::output_address): Likewise.
13074 (Output_section::starting_output_address): Likewise.
13075 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
13076 parameter to Sized_relobj*.
13077 (Copy_relocs::need_copy_reloc): Likewise.
13078 (Copy_relocs::save): Likewise.
13079 * copy-relocs.h (class Copy_relocs): Update declarations.
13080 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
13081 Sized_relobj*. Change relobj_ field to Sized_relobj*.
13082 * target-reloc.h (relocate_for_relocatable): Change
13083 offset_in_output_section type to Elf_Addr. Change code that uses
13084 it as well.
13085 * layout.cc (Layout::layout): Always set *off.
13086 * mapfile.cc (Mapfile::print_input_section): Use
13087 output_section_offset.
13088 * i386.cc (Target_i386::copy_reloc): Change object parameter to
13089 Sized_relobj*.
13090 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
13091 * sparc.cc (Target_sparc::copy_reloc): Likewise.
13092 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
13093
5cb66f97
ILT
130942008-07-03 Ian Lance Taylor <iant@google.com>
13095
13096 * layout.cc (Layout::include_section): Do not discard unrecognized
13097 SHT_STRTAB sections.
13098
afe47622
CS
130992008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
13100
13101 * script.cc (Lex::can_continue_name): Make '?' allowable in
13102 version-script names.
13103 * testsuite/version_script.map: Change glob pattern to use '?'
13104
5adf9721
ILT
131052008-06-30 Manish Singh <yosh@gimp.org>
13106
13107 PR 6585
13108 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
13109 Correct typo.
13110
e6fde208
ILT
131112008-06-30 Ian Lance Taylor <iant@google.com>
13112
13113 PR 6660
13114 PR 6682
13115 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
13116 versions]: Don't try to read the value in the contents, since we
13117 don't use it. Use the template endianness when writing.
13118
3f2e6a2d
CC
131192008-06-25 Cary Coutant <ccoutant@google.com>
13120
13121 * fileread.cc (File_read::make_view): Assert on zero-length view.
13122 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
13123 symbol table when there are no symbols to read.
13124
c43d3a48
CS
131252008-06-23 Craig Silverstein <csilvers@google.com>
13126
13127 * version.cc (version_string): Bump to 1.7
13128
5f494ea0
CS
131292008-06-18 Craig Silverstein <csilvers@google.com>
13130
13131 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
13132 constant 0xFFFF to type Valtype.
13133 (Powerpc_relocate_functions::rel16_ha): Likewise.
13134
c42e122e
ILT
131352008-06-17 Ian Lance Taylor <iant@google.com>
13136
f34787f8
ILT
13137 * output.h (Output_section::Input_section): Initialize p2align_ to
13138 zero for Output_section_data constructors.
13139 (Output_section::Input_section::addralign): If not an input
13140 section, return the alignment of the Output_section_data.
13141 * testsuite/copy_test.cc: New file.
13142 * testsuite/copy_test_1.cc: New file.
13143 * testsuite/copy_test_2.cc: New file.
13144 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
13145 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
13146 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
13147 (copy_test_1_pic.o, copy_test_1.so): New targets.
13148 (copy_test_2_pic.o, copy_test_2.so): New targets.
13149 * testsuite/Makefile.in: Rebuild.
13150
c42e122e
ILT
13151 * script-sections.cc (Script_sections::place_orphan): Initialize
13152 local variable exact.
13153
ce3ac18a
DE
131542008-06-13 David Edelsohn <edelsohn@gnu.org>
13155
13156 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
13157
42cacb20
DE
131582008-06-12 David Edelsohn <edelsohn@gnu.org>
13159 David S. Miller <davem@davemloft.net>
13160
13161 * powerpc.cc: New file.
13162 * Makefile.am (TARGETSOURCES): Add powerpc.cc
13163 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
13164 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
13165 * Makefile.in: Rebuild.
13166
7b308235
ILT
131672008-06-09 Ian Lance Taylor <iant@google.com>
13168
13169 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
13170 <exception>.
13171 (throwing, orig_terminate): New static variables.
13172 (terminate_handler): New static function.
13173 (t2): Set terminate handler.
13174
f0b886e3
ILT
131752008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
13176
13177 PR 6584
cd536b21 13178 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
13179 alignment.
13180
3e90f135
CC
131812008-05-30 Cary Coutant <ccoutant@google.com>
13182
13183 * archive.cc (Archive::include_all_members) Correct to step
13184 over symbol table and extended name table in thin archives.
13185
e09ad04a
ILT
131862008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
13187
13188 PR 6407
13189 * target-reloc.h (relocate_for_relocatable): Fix new_offset
13190 calculation.
13191
62b01cb5
ILT
131922008-05-28 Caleb Howe <cshowe@google.com>
13193
13194 * reduced_debug_output.cc: New file.
13195 * reduced_debug_output.h: New file.
92de84a6 13196 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
13197 * options.cc (General_options::finalize): Add strip_debug_non_line
13198 to the strip heirarchy.
13199 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
13200 fields.
13201 * layout.cc: Include "reduced_debug_output.h".
13202 (Layout::Layout): Initialize new fields.
13203 (line_only_debug_sections): New static array.
13204 (is_lines_only_debug_sections): New static inline function.
13205 (Layout::include_section): Handle --strip-debug-non-line.
13206 (Layout::make_output_section): If --strip-debug-non-line, build
13207 new output sections for .debug_abbrev and .debug_info.
13208 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
13209 gold. Warn about possible overflow.
13210 (read_signed_LEB_128): Likewise.
13211 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
13212 (read_signed_LEB_128): Declare.
13213 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
13214 (HFILES): Add reduced_debug_output.h.
13215 * Makefile.in: Rebuild.
13216
7d9e3d98
ILT
132172008-05-21 Ian Lance Taylor <iant@google.com>
13218
13219 * mapfile.cc: New file.
13220 * mapfile.h: New file.
13221 * options.h (class General_options): Add -M/--print-map and -Map.
13222 * options.cc (General_options::finalize): Make -M equivalent to
13223 -Map -.
13224 * main.cc: Include <cstdio> and "mapfile.h".
13225 (main): Open mapfile if requested.
13226 * gold.cc (class Middle_runner): Add mapfile_ field. Update
13227 constructor. Change caller.
13228 (queue_initial_tasks): Add mapfile parameter. Change caller.
13229 (queue_middle_tasks): Likewise.
13230 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
13231 declarations.
13232 * archive.cc: Include "mapfile.h".
13233 (Archive::add_symbols): Add mapfile parameter. Change all
13234 callers. Pass mapfile, symbol, and reason to include_member.
13235 (Archive::include_all_members): Add mapfile parameter. Change all
13236 callers.
13237 (Archive::include_member): Add mapfile, sym, and why parameters.
13238 Change all callers. Report inclusion to map file.
13239 * archive.h: Include "fileread.h".
13240 (class Archive): Update declarations.
13241 (Archive::file): New const method.
13242 (class Add_archive_symbols): Add mapfile_ field. Update
13243 constructor. Change all callers.
13244 * readsyms.h (class Read_symbols): Likewise.
13245 (class Finish_group): Likewise.
13246 (class Read_script): Likewise.
13247 * common.cc: Include "mapfile.h".
13248 (Symbol_table::allocate_commons): Add mapfile parameter. Change
13249 all callers.
13250 (Symbol_table::do_allocate_commons): Likewise.
13251 (Symbol_table::do_allocate_commons_list): Likewise. Report common
13252 symbol allocation to mapfile.
13253 * common.h (class Allocate_commons_task): Add mapfile_ field.
13254 Update constructor. Change all callers.
13255 * symtab.h (class Symbol_table): Update declarations.
13256 * layout.cc: Include "mapfile.h".
13257 (Layout_task_runner::run): Print information to mapfile.
13258 (Layout::create_gold_note): Change Output_data_fixed_space to
13259 Output_data_zero_fill.
13260 (Layout::create_build_id): Likewise.
13261 (Layout::print_to_mapfile): New function.
13262 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
13263 constructor. Change caller.
13264 (class Layout): Declare print_to_mapfile.
13265 * output.cc (Output_section::Input_section::print_to_mapfile): New
13266 function.
13267 (Output_section::add_input_section): If producing a map, always
13268 add to input_sections_ list.
13269 (Output_section::do_print_to_mapfile): New function.
13270 (Output_segment::print_sections_to_mapfile): New function.
13271 (Output_segment::print_section_list_to_mapfile): New function.
13272 * output.h: Include "mapfile.h".
13273 (Output_data::print_to_mapfile): New function.
13274 (Output_data::do_print_to_mapfile): New virtual function.
13275 (Output_segment_headers::do_print_to_mapfile): New function.
13276 (Output_file_header::do_print_to_mapfile): New function.
13277 (Output_data_const::do_print_to_mapfile): New function.
13278 (class Output_data_const_buffer): Add map_name_ field. Update
13279 constructor. Change all callers. Add do_print_to_mapfile
13280 function.
13281 (class Output_data_fixed_space): Likewise.
13282 (class Output_data_space): Likewise.
13283 (class Output_data_zero_fill): New class.
13284 (Output_data_strtab::do_print_to_mapfile): New function.
13285 (Output_data_reloc_base::do_print_to_mapfile): New function.
13286 (Output_relocatable_relocs::do_print_to_mapfile): New function.
13287 (Output_data_group::do_print_to_mapfile): New function.
13288 (Output_data_got::do_print_to_mapfile): New function.
13289 (Output_data_dynamic::do_print_to_mapfile): New function.
13290 (Output_symtab_xindex::do_print_to_mapfile): New function.
13291 (class Output_section): Declare do_print_to_mapflie. Declare
13292 print_to_mapfile in Input_section.
13293 (class Output_segment): Declare new functions.
13294 * object.h (Sized_relobj::symbol_count): New function.
13295 * script-sections.cc
13296 (Output_section_element_dot_assignment::set_section_addresses):
13297 Change Output_data_fixed_space to Output_data_zero_fill.
13298 (Output_data_expression::do_print_to_mapfile): New function.
13299 * script.cc (read_input_script): Add mapfile parameter. Change
13300 all callers.
13301 * script.h (read_input_script): Update declaration.
13302 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
13303 (Eh_frame::do_print_to_mapfile): New function.
13304 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
13305 (Output_merge_string::do_print_to_mapfile): New function.
13306 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
13307 function.
13308 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
13309 function.
13310 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
13311 function.
13312 * Makefile.am (CCFILES): Add mapfile.cc.
13313 (HFILES): Add mapfile.h.
13314 * Makefile.in: Rebuild.
13315
9f1d377b
ILT
133162008-05-19 Ian Lance Taylor <iant@google.com>
13317
13318 * options.h (class General_options): Add -z relro.
13319 * layout.cc (Layout::Layout): Initialize relro_segment_.
13320 (Layout::add_output_section_data): Return the output section.
13321 (Layout::make_output_section): Rcognize relro sections and mark
13322 them appropriately.
13323 (Layout::attach_allocated_section_to_segment): Put relro sections
13324 in a PT_GNU_RELRO segment.
13325 (Layout::create_initial_dynamic_sections): Mark the .dynamic
13326 section as relro.
13327 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
13328 PT_TLS segments.
13329 (Layout::linkonce_mapping): Map d.rel.ro.local to
13330 .data.rel.ro.local.
13331 (Layout::output_section_name): Us .data.rel.ro.local for any
13332 section which begins with that.
13333 * layout.h (class Layout): Update add_output_section_data
13334 declaration. Add relro_segment_ field.
13335 * output.cc (Output_section::Output_section): Initialize is_relro_
13336 and is_relro_local_ fields.
13337 (Output_segment::add_output_section): Group relro sections.
13338 (Output_segment::is_first_section_relro): New function.
13339 (Output_segment::maximum_alignment): If there is a relro section,
13340 align the segment to the common page size.
13341 (Output_segment::set_section_addresses): Track whether we are
13342 looking at relro sections. If the last section is a relro
13343 section, align to the common page size.
13344 (Output_segment::set_section_list_addresses): Add in_relro
13345 parameter. Change all callers. Align to the page size when
13346 moving from relro to non-relro section.
13347 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
13348 segment.
13349 * output.h (class Output_section): Add is_relro_ and
13350 is_relro_local_ fields.
13351 (Output_section::is_relro): New function.
13352 (Output_section::set_is_relro): New function.
13353 (Output_section::is_relro_local): New function.
13354 (Output_section::set_is_relro_local): New function.
13355 (class Output_segment): Update declarations.
13356 * i386.cc (Target_i386::got_section): Mark .got section as relro.
13357 * sparc.cc (Target_sparc::got_section): Likewise.
13358 * x86_64.cc (Target_x86_64::got_section): Likewise.
13359 * testsuite/relro_test_main.cc: New file.
13360 * testsuite/relro_test.cc: New file.
13361 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
13362 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
13363 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
13364 (relro_test.so, relro_test_pic.o): New targets.
13365 * testsuite/Makefile.in: Rebuild.
13366
a984ee1d
ILT
133672008-05-16 Ian Lance Taylor <iant@google.com>
13368
01676dcd
ILT
13369 * output.cc (Output_segment::add_output_section): Remove front
13370 parameter.
13371 * output.h (class Output_segment): Remove
13372 add_initial_output_section and overloaded add_output_section.
13373 Update declaration of remaining add_output_section.
13374 * layout.cc (Layout::create_interp): Call add_output_section
13375 rather than add_initial_output_section.
13376 (Layout::finish_dynamic_section): Likewise.
13377
497897f9
ILT
13378 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
13379 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
13380 know the dynamic type.
13381 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
13382 field. Initialize it in constructor.
13383 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
13384 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
13385 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
13386 reloc.
13387
a984ee1d
ILT
13388 * output.cc (Output_reloc::get_address): Change return type to
13389 Elf_Addr.
13390 * output.h (class Output_reloc): Update get_address declaration.
13391 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
13392 for section addresses.
13393
55ba0940
ILT
133942008-05-09 Ian Lance Taylor <iant@google.com>
13395
13396 PR 6493
13397 * gold.cc (gold_nomem): Use return value of write.
13398
75517b77
ILT
133992008-05-08 Ian Lance Taylor <iant@google.com>
13400
13401 * symtab.c (Symbol::init_base_output_data): Add version
13402 parameter. Change all callers.
13403 (Symbol::init_base_output_segment): Likewise.
13404 (Symbol::init_base_constant): Likewise.
13405 (Symbol::init_base_undefined): Likewise.
13406 (Sized_symbol::init_output_data): Likewise.
13407 (Sized_symbol::init_output_segment): Likewise.
13408 (Sized_symbol::init_constant): Likewise.
13409 (Sized_symbol::init_undefined): Likewise.
13410 (Symbol_table::do_define_in_output_data): If the new symbol has a
13411 version, mark it as the default.
13412 (Symbol_table::do_define_in_output_segment): Likewise.
13413 (Symbol_table::do_define_as_constant): Likewise.
13414 * symtab.h (class Symbol): Update declarations.
13415 (class Sized_symbol): Likewise.
13416 * resolve.cc (Symbol::override_version): New function.
c42e122e 13417 (Symbol::override_base): Call override_version.
75517b77
ILT
13418 (Symbol::override_base_with_special): Likewise.
13419 * testsuite/ver_script_8.script: New file.
13420 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
13421 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
13422 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
13423 (ver_test_8_1.so, ver_test_8_2.so): New targets.
13424
f1f70eae
ILT
134252008-05-06 Ian Lance Taylor <iant@google.com>
13426
f3e9c5c5
ILT
13427 PR 6049
13428 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
13429 functions.
13430 (class General_options): Remove existing --undefined, and add
13431 --no-undefined instead. Add new --undefined as synonym for -u.
13432 * archive.cc (Archive::add_symbols): Check whether symbol was
13433 named with -u.
13434 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
13435 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
13436 all uses. Add IS_UNDEFINED. Update declarations to split
13437 different versions of init_base. Declare init_base_undefined.
13438 (Symbol::is_defined): Handle IS_UNDEFINED.
13439 (Symbol::is_undefined): Likewise.
13440 (Symbol::is_weak_undefined): Call is_undefined.
13441 (Symbol::is_absolute): Handle IS_CONSTANT.
13442 (class Sized_symbol): Update declarations to split different
13443 versions of init. Declare init_undefined.
13444 (class Symbol_table): Declare new functions.
13445 * symtab.cc (Symbol::init_base_object): Rename from init_base.
13446 Change all callers.
13447 (Symbol::init_base_output_data): Likewise.
13448 (Symbol::init_base_output_segment): Likewise.
13449 (Symbol::init_base_constant): Likewise.
13450 (Symbol::init_base_undefined): New function.
13451 (Sized_symbol::init_object): Rename from init. Change all
13452 callers.
13453 (Sized_symbol::init_output_data): Likewise.
13454 (Sized_symbol::init_output_segment): Likewise.
13455 (Sized_symbol::init_constant): Likewise.
13456 (Sized_symbol::init_undefined): New function.
13457 (Symbol_table::add_undefined_symbols_from_command_line): New
13458 function.
13459 (Symbol_table::do_add_undefined_symbols_from_command_line): New
13460 function.
13461 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
13462 (Symbol::output_section): Likewise.
13463 (Symbol::set_output_section): Likewise.
13464 (Symbol_table::sized_finalize_symbol): Likewise.
13465 (Symbol_table::sized_write_globals): Likewise.
13466 * resolve.cc (Symbol_table::should_override): Likewise.
13467 (Symbol::override_base_with_special): Likewise.
13468
8bdcdf2c
ILT
13469 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
13470 symbol, change it to have default visibility.
13471 * testsuite/protected_1.cc: New file.
13472 * testsuite/protected_2.cc: New file.
13473 * testsuite/protected_3.cc: New file.
13474 * testsuite/protected_main_1.cc: New file.
13475 * testsuite/protected_main_2.cc: New file.
13476 * testsuite/protected_main_3.cc: New file.
13477 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
13478 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
13479 (protected_1_LDFLAGS, protected_1_LDADD): Define.
13480 (protected_1.so): New target.
13481 (protected_1_pic.o, protected_2_pic.o): New targets.
13482 (protected_3_pic.o): New target.
13483 (check_PROGRAMS): Add protected_2.
13484 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
13485 (protected_2_LDFLAGS, protected_2_LDADD): Define.
13486 * testsuite/Makefile.in: Rebuild.
13487
2b706932
ILT
13488 * options.h (DEFINE_var): Add set_user_set_##varname__.
13489 (DEFINE_bool_alias): New macro.
13490 (class General_options): Define -Bstatic using DEFINE_bool_alias
13491 rather than DEFINE_special. Add --undefined as an alias for -z
13492 defs.
13493 * options.cc (General_options::parse_Bstatic): Remove.
13494
d82a5bcc
ILT
13495 * options.h (class General_options): Add --fatal-warnings.
13496 * main.cc (main): Implement --fatal-warnings.
13497 * errors.h (Errors::warning_count): New function.
13498
f1f70eae
ILT
13499 * options.h (class General_options): Add -Bsymbolic-functions.
13500 * symtab.h (Symbol::is_preemptible): Check for
13501 -Bsymbolic-functions.
13502
8825ac63
ILT
135032008-05-05 Ian Lance Taylor <iant@google.com>
13504
d98bc257
ILT
13505 * options.h (DEFINE_bool): For DASH_Z, create the negative option
13506 as noVARNAME rather than no-VARNAME.
13507 (class General_options): Add option -z combreloc.
13508 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
13509 get_address.
13510 (Output_reloc::sort_before) [SHT_REL]: New function.
13511 (Output_reloc::sort_before) [SHT_RELA]: New function.
13512 (class Output_data_reloc_base): Add sort_relocs_ field. Define
13513 Sort_relocs_comparison.
13514 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
13515 parameter. Change all callers.
13516 (Output_data_reloc::Output_data_reloc) [both versions]: Add
13517 sort_relocs parameter. Change all callers.
13518 * output.cc (Output_reloc::get_address): New function, broken out
13519 of write_rel.
13520 (Output_reloc::write_rel): Call it.
13521 (Output_reloc::compare): New function.
13522 (Output_data_reloc_base::do_write): Optionally sort relocs.
13523
60b2b4e7
ILT
13524 * configure.ac: If targ_extra_obj is set, link it in.
13525 * configure.tgt: Initialize all variables.
13526 (x86_64*): Set targ_extra_obj and targ_extra_size.
13527 * configure: Rebuild.
13528
8825ac63
ILT
13529 * object.cc (Sized_relobj::include_section_group): Adjust section
13530 indexes read from group data. Build vector to pass to
13531 layout_group.
13532 * layout.cc (Layout::layout_group): Add flags and shndxes
13533 parameters. Remove contents parameter. Change caller. Update
13534 explicit instantiations.
13535 * layout.h (class Layout): Update layout_group declaration.
13536 * output.cc (Output_data_group::Output_data_group): Add flags and
13537 input_shndxes parameters. Remove contents parameter. Change
13538 caller.
13539 (Output_data_group::do_write): Change input_sections_ to
13540 input_shndxes_.
13541 * output.h (class Output_data_group): Update constructor
13542 declaration. Rename input_sections_ to input_shndxes_.
13543 * testsuite/many_sections_test.cc: Add template.
13544
e94cf127
CC
135452008-04-30 Cary Coutant <ccoutant@google.com>
13546
4418b2d5
CC
13547 * target-reloc.h (relocate_section): Fix dead-pointer bug.
13548
e94cf127
CC
13549 * layout.cc (Layout::include_section): Refactored check for debug
13550 info section.
13551 (Layout::add_comdat): Add new parameters. Change type
13552 of signature parameter. Add object and shndx to signatures table.
13553 (Layout::find_kept_object): New function.
13554 * layout.h: Include <cstring>.
13555 (Layout::is_debug_info_section): New function.
13556 (Layout::add_comdat): Add new parameters.
13557 (Layout::find_kept_object): New function.
13558 (Layout::Kept_section): New struct.
13559 (Layout::Signatures): Change type of map range.
13560 * object.cc (Relobj::output_section_address): New function.
13561 (Sized_relobj::include_section_group): Add new parameters. Change
13562 calls to Layout::add_comdat. Change to build table of kept comdat
13563 groups and table mapping discarded sections to kept sections.
13564 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
13565 (Sized_relobj::do_layout): Change calls to include_section_group and
13566 include_linkonce_section.
13567 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
13568 value to zero when section is discarded.
13569 (Sized_relobj::map_to_kept_section): New function.
13570 * object.h (Relobj::output_section_address): New function.
13571 (Relobj::Comdat_group): New type.
13572 (Relobj::find_comdat_group): New function.
13573 (Relobj::Comdat_group_table): New type.
13574 (Relobj::Kept_comdat_section): New type.
13575 (Relobj::Kept_comdat_section_table): New type.
13576 (Relobj::add_comdat_group): New function.
13577 (Relobj::set_kept_comdat_section): New function.
13578 (Relobj::get_kept_comdat_section): New function.
13579 (Relobj::comdat_groups_): New field.
13580 (Relobj::kept_comdat_sections_): New field.
13581 (Symbol_value::input_value): Update comment.
13582 (Sized_relobj::map_to_kept_section) New function.
13583 (Sized_relobj::include_linkonce_section): Add new parameter.
13584 * target-reloc.h (Comdat_behavior): New type.
13585 (get_comdat_behavior): New function.
13586 (relocate_section): Add code to map a discarded section to the
13587 corresponding kept section when applying a relocation.
13588
e4e5049b
CS
135892008-04-30 Craig Silverstein <csilvers@google.com>
13590
13591 * dwarf_reader.cc (next_generation_count): New static var.
13592 (Addr2line_cache_entry): New struct.
13593 (addr2line_cache): New static var.
13594 (Dwarf_line_info::one_addr2line): Added caching.
13595 (Dwarf_line_info::clear_addr2line_cache): New function.
13596 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
13597 cache-size parameter.
13598 (Dwarf_line_info::one_addr2line_cache): New function.
13599 * symtab.cc (Symbol_table::detect_odr_violations): Pass
13600 new cache-size argument to one_addr2line(), and clear cache.
13601
d09e9154
CC
136022008-04-28 Cary Coutant <ccoutant@google.com>
13603
13604 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
13605 R_386_PC8 relocations.
13606
7ef73768
ILT
136072008-04-23 Ian Lance Taylor <iant@google.com>
13608
55438702
ILT
13609 * object.cc (Sized_relobj::include_section_group): Check for
13610 invalid section group.
13611
c165fb93
ILT
13612 * object.cc (make_elf_object): Correct test for 64-bit ELF file
13613 header size.
13614
7ef73768
ILT
13615 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
13616 than read for file header.
13617 * archive.cc (Archive::include_member): Likewise.
13618
6194aaab
L
136192008-04-23 Paolo Bonzini <bonzini@gnu.org>
13620
13621 * aclocal.m4: Regenerate.
13622 * configure: Regenerate.
13623
d491d34e
ILT
136242008-04-19 Ian Lance Taylor <iant@google.com>
13625
5ea2bac6
ILT
13626 * version.cc (version_string): Bump to 1.6.
13627
7bc3e21a
ILT
13628 * testsuite/Makefile.am (many_sections_r_test): New target.
13629 (many_sections_r_test_SOURCES): Remove.
13630 (many_sections_r_test_DEPENDENCIES): Remove.
13631 (many_sections_r_test_LDFLAGS): Remove.
13632 (many_sections_r_test_LDADD): Remove.
13633
7fcd3aa9
ILT
13634 * object.cc (Sized_relobj::do_add_symbols): Always pass
13635 local_symbol_count_ to add_from_relobj.
13636
4c94d6ae
ILT
13637 * testsuite/Makefile.am (many_sections_check.h): Only check one in
13638 every thousand variables.
13639 * testsuite/Makefile.in: Rebuild.
13640
d491d34e
ILT
13641 * object.cc (Xindex::initialize_symtab_xindex): New function.
13642 (Xindex::read_symtab_xindex): New function.
13643 (Xindex::sym_xindex_to_shndx): New function.
13644 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
13645 available.
13646 (Sized_relobj::do_initialize_xindex): New function.
13647 (Sized_relobj::do_read_symbols): Adjust section links.
13648 (Sized_relobj::symbol_section_and_value): Add is_ordinary
13649 parameter. Change all callers.
13650 (Sized_relobj::include_section_group): Adjust section links and
13651 symbol section indexes.
13652 (Sized_relobj::do_layout): Adjust section links.
13653 (Sized_relobj::do_count_local_symbols): Adjust section links and
13654 symbol section indexes.
13655 (Sized_relobj::do_finalize_local_symbols): Distinguish between
13656 ordinary and special symbols.
13657 (Sized_relobj::write_local_symbols): Add symtab_xindex and
13658 dynsym_xindex parameters. Change all callers. Adjust section
13659 links. Use SHN_XINDEX when needed.
13660 (Sized_relobj::get_symbol_location_info): Adjust section links.
13661 Don't get fooled by special symbols.
13662 * object.h (class Xindex): Define.
13663 (class Object): Add xindex_ parameter. Declare virtual functoin
13664 do_initialize_xindex.
13665 (Object::adjust_sym_shndx): New function.
13666 (Object::set_xindex): New protected function.
13667 (class Symbol_value): Add is_ordinary_shndx_ field.
13668 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
13669 (Symbol_value::value): Assert ordinary section.
13670 (Symbol_value::initialize_input_to_output_map): Likewise.
13671 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
13672 Change all callers.
13673 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
13674 all callers.
13675 (class Sized_relobj): Update declarations.
13676 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
13677 parameter. Change all callers.
13678 (Sized_relobj::adjust_shndx): New function.
13679 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
13680 field.
13681 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
13682 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
13683 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
13684 (Sized_dynobj::read_dynsym_section): Adjust section links.
13685 (Sized_dynobj::read_dynamic): Likewise.
13686 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
13687 section links.
13688 (Sized_dynobj::do_initialize_xindex): New function.
13689 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
13690 do_initialize_xindex.
13691 (Sized_dynobj::adjust_shndx): New function.
13692 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
13693 dynsym_xindex_ fields.
13694 (Layout::finalize): Add a call to set_section_indexes before
13695 creating the symtab sections.
13696 (Layout::set_section_indexes): Don't do anything if the section
13697 already has a section index.
13698 (Layout::create_symtab_sections): Add shnum parameter. Change
13699 caller. Create .symtab_shndx section if needed.
13700 (Layout::create_shdrs): Add shstrtab_section parameter. Change
13701 caller.
13702 (Layout::allocated_output_section_count): New function.
13703 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
13704 needed.
13705 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
13706 fields. Update declarations.
13707 (Layout::symtab_xindex): New function.
13708 (Layout::dynsym_xindex): New function.
13709 (class Write_symbols_task): Add layout_ field.
13710 (Write_symbols_task::Write_symbols_task): Add layout parameter.
13711 Change caller.
13712 * output.cc (Output_section_headers::Output_section_headers): Add
13713 shstrtab_section parameter. Change all callers.
13714 (Output_section_headers::do_sized_write): Store overflow values
13715 for section count and section string table section index in
13716 section header zero.
13717 (Output_file_header::do_sized_write): Check for overflow of
13718 section count and section string table section index.
13719 (Output_symtab_xindex::do_write): New function.
13720 (Output_symtab_xindex::endian_do_write): New function.
13721 * output.h (class Output_section_headers): Add shstrtab_section_.
13722 Update declarations.
13723 (class Output_symtab_xindex): Define.
13724 (Output_section::has_out_shndx): New function.
13725 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
13726 field.
13727 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
13728 Change all callers.
13729 (Sized_symbol::init): Likewise.
13730 (Symbol::output_section): Check for ordinary symbol.
13731 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
13732 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
13733 callers.
13734 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
13735 Change all callers. Simplify handling of symbols from sections
13736 not included in the link.
13737 (Symbol_table::add_from_dynobj): Handle ordinary symbol
13738 distinction.
13739 (Weak_alias_sorter::operator()): Assert that symbols are
13740 ordinary.
13741 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
13742 distinction.
13743 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
13744 parameters. Change all callers.
13745 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
13746 symbol distinction. Use SHN_XINDEX when needed.
13747 (Symbol_table::write_section_symbol): Add symtab_xindex
13748 parameter. Change all callers.
13749 (Symbol_table::sized_write_section_symbol): Likewise. Use
13750 SHN_XINDEX when needed.
13751 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
13752 declarations.
13753 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
13754 (Symbol::is_defined): Check is_ordinary.
13755 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
13756 (Symbol::is_absolute, Symbol::is_common): Likewise.
13757 (class Sized_symbol): Update declarations.
13758 (class Symbol_table): Update declarations.
13759 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
13760 parameters. Change all callers.
13761 (Sized_symbol::override): Likewise.
13762 (Symbol_table::override): Likewise.
13763 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
13764 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
13765 is_ordinary, and orig_st_shndx parameters. Change all callers.
13766 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
13767 to be in an ordinary section.
13768 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
13769 object and is_ordinary parameters. Change all callers.
13770 (Sized_dwarf_line_info::read_relocs): Add object parameter.
13771 Change all callers. Don't add undefined or non-ordinary symbols
13772 to reloc_map_.
13773 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
13774 Change all callers.
13775 * dwarf_reader.h (class Sized_dwarf_line_info): Update
13776 declarations.
13777 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
13778 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
13779 (Sized_relobj::relocate_sections): Likewise.
13780 * target-reloc.h (scan_relocs): Adjust section symbol index.
13781 (scan_relocatable_relocs): Likewise.
13782 * i386.cc (Scan::local): Check for ordinary symbols.
13783 * sparc.cc (Scan::local): Likewise.
13784 * x86_64.cc (Scan::local): Likewise.
13785 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
13786 to symbol_section_and_value.
13787 * testsuite/many_sections_test.cc: New file.
13788 * testsuite/Makefile.am (BUILT_SOURCES): Define.
13789 (check_PROGRAMS): Add many_sections_test.
13790 (many_sections_test_SOURCES): Define.
13791 (many_sections_test_DEPENDENCIES): Define.
13792 (many_sections_test_LDFLAGS): Define.
13793 (BUILT_SOURCES): Add many_sections_define.h.
13794 (many_sections_define.h): New target.
13795 (BUILT_SOURCES): Add many_sections_check.h.
13796 (many_sections_check.h): New target.
13797 (check_PROGRAMS): Add many_sections_r_test.
13798 (many_sections_r_test_SOURCES): Define.
13799 (many_sections_r_test_DEPENDENCIES): Define.
13800 (many_sections_r_test_LDFLAGS): Define.
13801 (many_sections_r_test_LDADD): Define.
13802 (many_sections_r_test.o): New target.
13803 * testsuite/Makefile.in: Rebuild.
13804
c5818ff1
CC
138052008-04-17 Cary Coutant <ccoutant@google.com>
13806
13807 * errors.cc (Errors::info): New function.
13808 (gold_info): New function.
13809 * errors.h (Errors::info): New function.
13810 * gold.h (gold_info): New function.
13811 * object.cc (Input_objects::add_object): Print trace output.
13812 * options.cc (options::parse_set): New function.
13813 (General_options::parse_wrap): Deleted.
13814 (General_options::General_options): Deleted initializer.
13815 * options.h (options::String_set): New typedef.
13816 (options::parse_set): New function.
13817 (DEFINE_set): New macro.
13818 (General_options::wrap): Changed to use DEFINE_set. Changed
13819 callers of any_wrap_symbols and is_wrap_symbol.
13820 (General_options::trace, General_options::trace_symbol):
13821 New options.
13822 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
13823 (General_options::wrap_symbols_): Deleted.
13824 * symtab.cc (Symbol_table::add_from_object): Print trace output.
13825
b5be4a7c
DM
138262008-04-17 David S. Miller <davem@davemloft.net>
13827
13828 * options.cc (General_options::parse_V): New function.
13829 * options.h: Add entries for -V and -Qy.
13830
155a0dd7
ILT
138312008-04-17 Ian Lance Taylor <iant@google.com>
13832
13833 * common.cc (Symbol_table::allocate_commons): Remove options
13834 parameter. Change caller.
13835 (Symbol_table::do_allocate_commons): Remove options parameter.
13836 Change caller. Just call do_allocate_commons_list twice.
13837 (Symbol_table::do_allocate_commons_list): New function, broken out
13838 of do_allocate_commons.
13839 * common.h (class Allocate_commons_task): Remove options_ field.
13840 Update constructor.
13841 * symtab.cc (Symbol_table::Symbol_table): Initialize
13842 tls_commons_.
13843 (Symbol_table::add_from_object): Put TLS common symbols on
13844 tls_commons_ list.
13845 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
13846 which are IN_OUTPUT_DATA.
13847 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
13848 allocate_commons and do_allocate_commons declarations. Declare
13849 do_allocate_commons_list.
13850 * gold.cc (queue_middle_tasks): Update creation of
13851 Allocate_commons_task to not pass options.
13852 * testsuite/Makefile.am (INCLUDES): Add -I.. .
13853 (TLS_TEST_C_FLAGS): New variable.
13854 (tls_test_c_pic.o): New target.
13855 (tls_test_shared.so): Link in tls_test_c_pic.o.
13856 (tls_test_c_pic_ie.o): New target.
13857 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
13858 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
13859 (tls_test_c.o): New target.
13860 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
13861 (tls_pic_test_LDADD): Likewise.
13862 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
13863 (tls_shared_gd_to_ie_test_LDADD): Likewise.
13864 (tls_test_c_gnu2.o): New target.
13865 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
13866 tls_test_c_gnu2.o.
13867 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
13868 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
13869 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
13870 * testsuite/tls_test.cc: Include "config.h".
13871 (t_last): Call t11_last.
13872 * testsuite/tls_test.h (t11, t11_last): Declare.
13873 * testsuite/tls_test_c.c: New file.
13874 * testsuite/tls_test_main.cc (thread_routine): Call t11.
13875 * configure.ac: Check for OpenMP support.
13876 * configure, config.in, Makefile.in: Rebuild.
13877 * testsuite/Makefile.in: Rebuild.
13878
edfbb029
CC
138792008-04-16 Cary Coutant <ccoutant@google.com>
13880
13881 * i386.cc (Target_i386::define_tls_base_symbol): New function.
13882 (Target_i386::tls_base_symbol_defined_): New field.
13883 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
13884 (Target_i386::Scan::global): Likewise.
13885 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
13886 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
13887 (Target_x86_64::tls_base_symbol_defined_): New field.
13888 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
13889 (Target_x86_64::Scan::global): Likewise.
13890
f3c69fca
CC
138912008-04-16 Cary Coutant <ccoutant@google.com>
13892
13893 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
13894 (Symbol::needs_plt_entry): Allow weak undefined symbols.
13895 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
13896 building shared libraries.
13897 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
13898 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
13899 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
13900 * testsuite/Makefile.in: Rebuild.
13901 * testsuite/weak_undef.h: New file.
13902 * testsuite/weak_undef_file1.cc: Add extra test cases.
13903 * testsuite/weak_undef_file2.cc: Likewise.
13904 * testsuite/weak_undef_test.cc: Likewise.
13905
7c414435
DM
139062008-04-16 David S. Miller <davem@davemloft.net>
13907
32b769e1
DM
13908 * sparc.cc (Target_sparc::Scan): Change from struct to class.
13909 Add issued_non_pic_error_ field. Declare check_non_pic.
13910 (Target_sparc::Scan::check_non_pic): New function.
13911 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
13912 (Target_sparc::Scan::global): Likewise.
13913
11936fb1
DM
13914 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
13915 * configure: Rebuild.
13916
7c414435
DM
13917 * options.h (DEFINE_enable): New macro.
13918 (new_dtags): New enable option.
13919 (initfirst, interpose, loadfltr, nodefaultlib,
13920 nodelete, nodlopen, nodump): New -z options.
13921 * layout.cc (Layout:finish_dynamic_section): If new
13922 dtags enabled, emit DT_RUNPATH. Also, emit a
13923 DT_FLAGS_1 containing any specified -z flags.
13924
85c7bf8b
ILT
139252008-04-16 Ian Lance Taylor <iant@google.com>
13926
12c0daef
ILT
13927 * copy-relocs.cc: New file.
13928 * copy-relocs.h: New file.
13929 * reloc.cc: Remove Copy_relocs code.
13930 * reloc.h: Likewise.
13931 * reloc-types.h (struct Reloc_types) [both versions]: Add
13932 get_reloc_addend_noerror.
13933 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
13934 variants of add_global which take an addend which must be zero.
13935 * i386.cc: Include "copy-relocs.h".
13936 (class Target_i386): Change type of copy_relocs_ to variable,
13937 update initializer.
13938 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
13939 Change all callers.
13940 (Target_i386::do_finalize_sections): Change handling of
13941 copy_relocs_.
13942 * sparc.cc: Include "copy-relocs.h".
13943 (class Target_sparc): Change type of copy_relocs_ to variable,
13944 update initializer.
13945 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
13946 Change all callers.
13947 (Target_sparc::do_finalize_sections): Change handling of
13948 copy_relocs_.
13949 * x86_64.cc: Include "copy-relocs.h".
13950 (class Target_x86_64): Change type of copy_relocs_ to variable,
13951 update initializer.
13952 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
13953 class. Change all callers.
13954 (Target_x86_64::do_finalize_sections): Change handling of
13955 copy_relocs_.
13956 * Makefile.am (CCFILES): Add copy-relocs.cc.
13957 (HFILES): Add copy-relocs.h.
13958
4f4995b6
ILT
13959 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
13960
85c7bf8b
ILT
13961 * testsuite/script_test_4.sh: Permit leading zeroes.
13962
4f2a9edd
ILT
139632008-04-15 Ian Lance Taylor <iant@google.com>
13964
e6188289
ILT
13965 * script-sections.cc (Script_sections::create_segments): Use
13966 header_size_adjustment even when there is enough room for the
13967 headers.
13968 * testsuite/script_test_4.sh: New file.
13969 * testsuite/script_test_4.t: New file.
13970 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
13971 (check_DATA): Add script_test_4.stdout.
13972 (MOSTLYCLEANFILES): Likewise.
13973 (script_test_4): New target.
13974 (script_test_4.stdout): New target.
13975 * testsuite/Makefile.in: Rebuild.
13976
4f2a9edd
ILT
13977 * sparc.cc: Add definitions for Output_data_plt_sparc class
13978 constants.
13979
f5314dd5
DM
139802008-04-14 David S. Miller <davem@davemloft.net>
13981
13982 * sparc.cc: New file.
13983 * Makefile.am (TARGETSOURCES): Add sparc.cc
13984 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
13985 * configure.tgt: Document targ_extra_size and
13986 targ_extra_big_endian. Add entries for sparc-* and
13987 sparc64-*.
13988 * configure.ac: Handle targ_extra_size and
13989 targ_extra_big_endian.
13990 * Makefile.in: Rebuild.
13991 * configure: Likewise.
13992 * po/POTFILES.in: Likewise.
13993 * po/gold.pot: Likewise.
13994
154e0e9a
ILT
139952008-04-14 Ian Lance Taylor <iant@google.com>
13996
13997 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
13998 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
13999 in the name/type/flags to section mapping. Don't call
14000 allocate_output_section.
14001 (Layout::choose_output_section): Change parameter from adjust_name
14002 to is_input_section. Don't permit input sections after sections
14003 are attached to segments. Don't call allocate_output_section.
14004 (Layout::layout_eh_frame): Call update_flags_for_input_section,
14005 not write_enable_output_section.
14006 (Layout::make_output_section): Don't push to
14007 unattached_section_list_ nor call attach_to_segment. Call
14008 attach_section_to_segment if sections are attached.
14009 (Layout::attach_sections_to_segments): New function.
14010 (Layout::attach_section_to_segment): New function.
14011 (Layout::attach_allocated_section_to_segment): Rename from
14012 attach_to_segment. Remove flags parameter.
14013 (Layout::allocate_output_section): Remove function.
14014 (Layout::write_enable_output_section): Remove function.
14015 * layout.h (class Layout): Update for above changes. Add new
14016 field sections_are_attached_.
14017 * output.h (Output_section::update_flags_for_input_section): New
14018 function.
14019 * output.cc (Output_section::add_input_section): Call
14020 update_flags_for_input_section.
14021 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
14022
009a67a2
CC
140232008-04-11 Cary Coutant <ccoutant@google.com>
14024
14025 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
14026 thought unnecessary.
14027 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
14028
759b1a24
ILT
140292008-04-11 Ian Lance Taylor <iant@google.com>
14030
14031 * output.h (class Output_section_data): Remove inline definition
14032 of set_addralign.
14033 * output.cc (Output_section_data::set_addralign): New function.
14034
c2b45e22
CC
140352008-04-11 Cary Coutant <ccoutant@google.com>
14036
14037 Add support for TLS descriptors for i386 and x86_64.
14038 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
14039 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
14040 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
14041 GOT_TYPE_TLS_DESC.
14042 (Target_i386::got_mod_index_entry): Remove unnecessary code.
14043 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
14044 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
14045 relocations.
14046 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
14047 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
14048 Fix problem with initial-exec relocations.
14049 (Target_i386::Relocate::relocate_tls): Likewise.
14050 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
14051 relaxation.
14052 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
14053 support for section-plus-offset dynamic table entries.
14054 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
14055 (Output_data_dynamic::Dynamic_entry): Add support for
14056 section-plus-offset dynamic table entries.
14057 (Output_data_dynamic::Classification): Likewise.
14058 (Output_data_dynamic::classification_): Renamed offset_.
14059 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
14060 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
14061 (Target_x86_64::make_plt_section): New function.
14062 (Target_x86_64::reserve_tlsdesc_entries): New function.
14063 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
14064 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
14065 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
14066 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
14067 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
14068 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
14069 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
14070 add extra PLT entry for TLS descriptors.
14071 (Output_data_plt_x86_64::got_): New field.
14072 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
14073 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
14074 fields.
14075 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
14076 descriptors.
14077 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
14078 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
14079 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
14080 R_386_TLS_DESC_CALL relocations.
14081 (Target_x86_64::Scan::global): Likewise.
14082 (Target_x86_64::do_finalize_sections): Add dynamic table entries
14083 for TLS descriptors.
14084 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
14085 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
14086 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
14087 GD-to-IE relaxation.
14088 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
14089 and TLS_DESCRIPTORS.
14090 * Makefile.in: Rebuild.
14091 * configure: Rebuild.
14092 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
14093 (tls_test_shared2.so): New target.
14094 (tls_shared_gd_to_ie_test_SOURCES): New variable.
14095 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
14096 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
14097 (tls_shared_gd_to_ie_test_LDADD): New variable.
14098 (tls_shared_gnu2_gd_to_ie_test): New target.
14099 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
14100 New targets.
14101 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
14102 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
14103 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
14104 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
14105 (tls_shared_gnu2_test): New target.
14106 (tls_test_gnu2_shared.so): New target.
14107 (tls_shared_gnu2_test_SOURCES): New variable.
14108 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
14109 (tls_shared_gnu2_test_LDFLAGS): New variable.
14110 (tls_shared_gnu2_test_LDADD): New variable.
14111 * testsuite/Makefile.in: Rebuild.
14112 * testsuite/Makefile.
14113
83bfb6b7
ILT
141142008-04-11 Ian Lance Taylor <iant@google.com>
14115
14116 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
14117 justsyms.t.
14118 * testsuite/Makefile.in: Rebuild.
14119
14120 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
14121 long.
14122 * testsuite/script_test_2.cc (main): Adjust test.
14123
706e1f5e
ILT
141242008-04-11 David S. Miller <davem@davemloft.net>
14125 Ian Lance Taylor <iant@google.com>
14126
14127 * options.h (General_options): Add entries for '-Y' and
14128 '-relax'.
14129 * options.cc (General_options:finalize): If -Y was used, add those
14130 entries to the library path instead of the default "/lib" and
14131 "/usr/lib".
14132
7c98e6bb
DM
141332008-04-11 David S. Miller <davem@davemloft.net>
14134
14135 * testsuite/justsyms.t: Start at 0x100.
14136 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
14137 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
14138 long.
14139 * testsuite/script_test_2.cc: Adjust string and section length
14140 checks.
7c98e6bb 14141
99a37bfd
ILT
141422008-04-09 Ian Lance Taylor <iant@google.com>
14143
2cefc357
ILT
14144 PR gold/5996
14145 * script-sections.cc (Sections_element::allocate_to_segment): Add
14146 orphan parameter.
14147 (Output_section_definition::allocate_to_segment): Likewise.
14148 (Orphan_output_section::allocate_to_segment): Likewise.
14149 (Script_sections::attach_sections_using_phdrs_clause): Don't
14150 propagate non-PT_LOAD segments to orphan sections.
14151 * testsuite/Makefile.am (script_test_3.stdout): Generate using
14152 readelf rather than objdump.
14153 * testsuite/script_test_3.sh: Adjust accordingly. Test that
14154 .interp section and PT_INTERP segment are the same size.
14155 * testsuite/Makefile.in: Rebuild.
14156
99a37bfd
ILT
14157 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
14158 aliases for symbols defined in the same object.
14159 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
14160 (weak_alias_test_SOURCES): New variable.
14161 (weak_alias_test_DEPENDENCIES): New variable.
14162 (weak_alias_test_LDFLAGS): New variable.
14163 (weak_alias_test_LDADD): New variable.
14164 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
14165 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
14166 (weak_alias_test_3.o): New target.
14167 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
14168 * testsuite/weak_alias_test_main.cc: New file.
14169 * testsuite/weak_alias_test_1.cc: New file.
14170 * testsuite/weak_alias_test_2.cc: New file.
14171 * testsuite/weak_alias_test_3.cc: New file.
14172
780e49c5
ILT
141732008-04-08 Ian Lance Taylor <iant@google.com>
14174
cdb0b8f5
ILT
14175 * options.h (class General_options): Add --noinhibit-exec option.
14176 * main.cc (main): Check --noinhibit-exec.
14177
0864d551
ILT
14178 * options.h (class General_options): Define --wrap as a special
14179 option. Add wrap_symbols_ field.
14180 (General_options::any_wrap_symbols): New function.
14181 (General_options::is_wrap_symbol): New function.
14182 * options.cc (General_options::parse_wrap): New function.
14183 (General_options::General_options): Initialize wrap_symbols_.
14184 * symtab.cc (Symbol_table::wrap_symbol): New function.
14185 (Symbol_table::add_from_object): Handle --wrap.
14186 * symtab.h (class Symbol_table): Declare wrap_symbol.
14187 * target.h (Target::wrap_char): New function.
14188 (Target::Target_info): Add wrap_char field.
14189 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
14190 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14191 * testsuite/testfile.cc (Target_test::test_target_info):
14192 Likewise.
14193
789aa6de
ILT
14194 * errors.cc (Errors::undefined_symbol): Mention symbol version if
14195 there is one.
14196
2c38906f
ILT
14197 * layout.h (class Layout): Add added_eh_frame_data_ field.
14198 * layout.cc (Layout::Layout): Initialize new field.
14199 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
14200 output section until we find a section we merged successfully.
14201 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
14202 that the size be non-zero.
14203
780e49c5
ILT
14204 * merge.cc (Object_merge_map::get_output_offset): Remove inline
14205 qualifier.
14206
7fcd0256
ILT
142072008-04-08 Craig Silverstein <csilvers@google.com>
14208
14209 * configure.ac: Export new conditional variable HAVE_ZLIB.
14210 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
14211 on HAVE_ZLIB.
14212 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
14213 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
14214
6835af53
ILT
142152008-04-07 Ian Lance Taylor <iant@google.com>
14216
e24f324c
ILT
14217 * version.cc (version_string): Set to "1.5".
14218
a036edd8
ILT
14219 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
14220 Add issued_non_pic_error_ field. Declare check_non_pic.
14221 (Target_x86_64::Scan::check_non_pic): New function.
14222 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
14223 (Target_x86_64::Scan::global): Likewise.
14224
624f8810
ILT
14225 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
14226 addend parameter. Change caller. Handle merge sections.
14227 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
14228 Address to Addend. Don't add in the result of
14229 local_section_offset, pass down the addend and use the returned
14230 value.
14231 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
14232 Update declarations of local_section_offset and symbol_value.
14233 * testsuite/two_file_test_1.cc (t18): New function.
14234 * testsuite/two_file_test_2.cc (f18): New function.
14235 * testsuite/two_file_test_main.cc (main): Call t18.
14236 * testsuite/two_file_test.h (t18, f18): Declare.
14237
6835af53
ILT
14238 * configure.ac: Don't test for objdump, c++filt, or readelf.
14239 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
14240 conditionals.
14241 (TEST_READELF): New variable.
14242 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
14243 (check_PROGRAMS): Add two_file_strip_test.
14244 (two_file_strip_test): New target.
14245 (check_PROGRAMS): Add two_file_same_shared_strip_test.
14246 (two_file_same_shared_strip_test_SOURCES): New variable.
14247 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
14248 (two_file_same_shared_strip_test_LDFLAGS): New variable.
14249 (two_file_same_shared_strip_test_LDADD): New variable.
14250 (two_file_shared_strip.so): New target.
14251 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
14252 (ver_test_5.syms, ver_test_7.syms): Likewise.
14253 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
14254 (strip_test_3.stdout): Use TEST_OBJDUMP.
14255 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
14256
86925eef
CC
142572008-04-04 Cary Coutant <ccoutant@google.com>
14258
14259 * symtab.h (Symbol::is_weak_undefined): New function.
14260 (Symbol::is_strong_undefined): New function.
14261 (Symbol::is_absolute): New function.
14262 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
14263 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
14264 absolute symbols.
14265 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
14266 (weak_undef_test): New target.
14267 * testsuite/Makefile.in: Rebuild.
14268 * testsuite/weak_undef_file1.cc: New file.
14269 * testsuite/weak_undef_file2.cc: New file.
14270 * testsuite/weak_undef_test.cc: New file.
14271
126f3ece
ILT
142722008-04-03 Craig Silverstein <csilvers@google.com>
14273
14274 * compressed_output.h (class Output_compressed_section): Use
14275 unsigned buffer.
14276 * compressed_output.cc (zlib_compress): Use unsigned buffers,
14277 add zlib header.
14278 (zlib_compressed_suffix): Removed.
14279 (Output_compressed_section::set_final_data_size): Use unsigned
14280 buffers.
14281 * testsuite/Makefile.am (flagstest_compress_debug_sections):
14282 Fix linker invocation.
14283 (flagstest_o_specialfile_and_compress_debug_sections):
14284 Likewise.
14285 * testsuite/Makefile.in: Regenerated.
14286
deae2a14
DM
142872008-04-02 David S. Miller <davem@davemloft.net>
14288
14289 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
14290 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
14291
70752818
ILT
142922008-04-02 Craig Silverstein <csilvers@google.com>
14293
14294 * TODO: New file.
14295
39d0cb0e
ILT
142962008-04-02 Ian Lance Taylor <iant@google.com>
14297
14298 * fileread.cc (File_read::find_view): Add byteshift and vshifted
14299 parameters. Update for new key type to views_. Change all
14300 callers.
14301 (File_read::read): Adjust for byteshift in returned view.
14302 (File_read::add_view): New function, broken out of
14303 find_and_make_view.
14304 (File_read::make_view): New function, broken out of
14305 find_and_make_view.
14306 (File_read::find_or_make_view): Add offset and aligned
14307 parameters. Rewrite accordingly. Change all callers.
14308 (File_read::get_view): Add offset and aligned parameters. Adjust
14309 for byteshift in return value.
14310 (File_read::get_lasting_view): Likewise.
14311 * fileread.h (class File_read): Update declarations.
14312 (class File_read::View): Add byteshift_ field. Add byteshift to
14313 constructor. Add byteshift method.
14314 * archive.h (Archive::clear_uncached_views): New function.
14315 (Archive::get_view): Add aligned parameter. Change all callers.
14316 * object.h (Object::get_view): Add aligned parameter. Change all
14317 callers.
14318 (Object::get_lasting_view): Likewise.
14319
14320 * fileread.cc (File_read::release): Don't call clear_views if
14321 there are multiple objects.
14322 * fileread.h (File_read::clear_uncached_views): New function.
14323 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
14324 on the archive.
14325
a1207466
CC
143262008-03-31 Cary Coutant <ccoutant@google.com>
14327
14328 Add thin archive support.
14329 * archive.cc (Archive::armagt): New const.
14330 (Archive::setup): Remove task parameter and calls to unlock.
14331 (Archive::unlock_nested_archives): New function.
14332 (Archive::read_header): Add nested_off parameter. Change
14333 all callers.
14334 (Archive::interpret_header): Likewise.
14335 (Archive::include_all_members): Change to handle thin
14336 archives.
14337 (Archive::include_member): Likewise.
14338 * archive.h (Archive::Archive): Add new parameters and
14339 initializers.
14340 (Archive::armagt): New const.
14341 (Archive::setup): Remove task parameter.
14342 (Archive::unlock_nested_archives): New function.
14343 (Archive::read_header): Add nested_off parameter.
14344 (Archive::interpret_header): Likewise.
14345 (Archive::Nested_archive_table): New typedef.
14346 (Archive::is_thin_archive_): New field.
14347 (Archive::nested_archives_): New field.
14348 (Archive::options_): New field.
14349 (Archive::dirpath_): New field.
14350 (Archive::task_): New field.
14351 * readsyms.cc (Read_symbols::do_read_symbols): Add check
14352 for thin archives. Pass additional parameters to
14353 Archive::Archive. Unlock the archive file after calling
14354 Archive::setup.
cd536b21 14355
479f6503
ILT
143562008-03-29 Ian Lance Taylor <iant@google.com>
14357
686c8caf
ILT
14358 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
14359 version symbol to be local.
14360 * testsuite/ver_test_4.sh: New file.
14361 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
14362 (check_DATA): Add ver_test_4.syms.
14363 (ver_test_4.syms): New target.
14364 * testsuite/Makefile.in: Rebuild.
14365
ab794b6b
ILT
14366 * output.cc
14367 (Output_section::Input_section_sort_entry::has_priority): New
14368 function.
14369 (Output_section::Input_section_sort_entry::match_file_name): New
14370 function.
14371 (Output_section::Input_section_sort_entry::match_section_name):
14372 Remove.
14373 (Output_section::Input_section_sort_entry::match_section_name_prefix):
14374 Remove.
14375 (Output_section::Input_section_sort_entry::match_section_file):
14376 Remove.
14377 (Output_section::Input_section_sort_compare::operator()): Rewrite
14378 using new Input_section_sort_entry functions. Sort crtbegin and
14379 crtend first. Sort sections with no priority before sections with
14380 a priority.
14381 * testsuite/initpri1.c (d3): Check j != 4.
14382 (cd5): New constructor/destructor function.
14383 (main): Check j != 2.
14384
479f6503
ILT
14385 * symtab.cc (Symbol_table::add_from_object): If we don't use the
14386 new symbol when resolving, don't call set_is_default.
14387 * testsuite/ver_test_7.cc: New file.
14388 * testsuite/ver_test_7.sh: New file.
14389 * testsuite/Makefile.am (ver_test_7.so): New target.
14390 (ver_test_7.o): New target.
14391 (check_SCRIPTS): Add ver_test_7.sh.
14392 (check_DATA): Add ver_test_7.syms.
14393 (ver_test_7.syms): New target.
14394
2fd32231
ILT
143952008-03-28 Ian Lance Taylor <iant@google.com>
14396
14397 * layout.cc (Layout::layout): If we see an input section with a
14398 name that needs sorting, set the must_sort flag for the output
14399 section.
14400 (Layout::make_output_section): If the name of the output section
14401 indicates that it might require sorting, set the may_sort flag.
14402 * output.h (Output_section::may_sort_attached_input_sections): New
14403 function.
14404 (Output_section::set_may_sort_attached_input_sections): New
14405 function.
14406 (Output_section::must_sort_attached_input_sections): New
14407 function.
14408 (Output_section::set_must_sort_attached_input_sections): New
14409 function.
14410 (class Output_section): Declare Input_section_sort_entry. Define
14411 Input_section_sort_compare. Declare
14412 sort_attached_input_sections. Add new fields:
14413 may_sort_attached_input_sections_,
14414 must_sort_attached_input_sections_,
14415 attached_input_sections_are_sorted_.
14416 * output.cc (Output_section::Output_section): Initialize new
14417 fields.
14418 (Output_section::add_input_section): Add an entry to
14419 input_sections_ if may_sort or must_sort are true.
14420 (Output_section::set_final_data_size): Call
14421 sort_attached_input_sections if necessary.
14422 (Output_section::Input_section_sort_entry): Define new class.
14423 (Output_section::Input_section_sort_compare::operator()): New
14424 function.
14425 (Output_section::sort_attached_input_sections): New function.
14426 * configure.ac: Check whether the compiler supports constructor
14427 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
14428 * testsuite/initpri1.c: New file.
14429 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
14430 CONSTRUCTOR_PRIORITY.
14431 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
14432 (initpri1_LDFLAGS): New variable.
14433 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
14434
18e6b24e
ILT
144352008-03-27 Ian Lance Taylor <iant@google.com>
14436
49bdd526
ILT
14437 * common.cc (Sort_commons::operator): Correct sorting algorithm.
14438 * testsuite/common_test_1.c: New file.
14439 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
14440 (common_test_1_SOURCES): New variable.
14441 (common_test_1_DEPENDENCIES): New variable.
14442 (common_test_1_LDFLAGS): New variable.
14443
18e6b24e
ILT
14444 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
14445 and commons_ correctly when NAME/VERSION does not override
14446 NAME/NULL.
14447 * testsuite/ver_test_6.c: New file.
14448 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
14449 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
14450 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
14451
04bf7072
ILT
144522008-03-26 Ian Lance Taylor <iant@google.com>
14453
5871526f
ILT
14454 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
14455 of an undefined symbol from a version script.
14456 * testsuite/Makefile.am (ver_test_5.so): New target.
14457 (ver_test_5.o): New target.
14458 (check_SCRIPTS): Add ver_test_5.sh.
14459 (check_DATA): Add ver_test_5.syms.
14460 (ver_test_5.syms): New target.
14461 * testsuite/ver_test_5.cc: New file.
14462 * testsuite/ver_test_5.script: New file.
14463 * testsuite/ver_test_5.sh: New file.
14464 * Makefile.in, testsuite/Makefile.in: Rebuild.
14465
04bf7072
ILT
14466 PR gold/5986
14467 Fix problems building gold with gcc 4.3.0.
14468 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
14469 (gold_error_at_location, gold_warning_at_location): Use it.
14470 * configure.ac: Check whether we can compile and use a template
14471 function with a printf attribute.
14472 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
14473 when jumping over bytes.
14474 * object.cc: Instantiate Object::read_section_data.
14475 * debug.h: Include <cstring>
14476 * dwarf_reader.cc: Include <algorithm>
14477 * main.cc: Include <cstring>.
14478 * options.cc: Include <cstring>.
14479 * output.cc: Include <cstring>.
14480 * script.cc: Include <cstring>.
14481 * script.h: Include <string>.
14482 * symtab.cc: Include <cstring> and <algorithm>.
14483 * target-select.cc: Include <cstring>.
14484 * version.cc: Include <string>.
14485 * testsuite/testmain.cc: Include <cstdlib>.
14486 * configure, config.in: Rebuild.
14487
874c5b28
ILT
144882008-03-25 Ian Lance Taylor <iant@google.com>
14489
819d6c3a
ILT
14490 * options.cc: Include "../bfd/bfdver.h".
14491 (options::help): Print bug reporting address.
14492
f4b2c6f5
ILT
14493 * version.cc (print_version): Adjust output for current value of
14494 BFD_VERSION_STRING.
14495
14496 * NEWS: New file.
14497
e96caa79
ILT
14498 * options.cc (options::help): Print list of supported targets.
14499 * target-select.h: Include <vector>.
14500 (class Target_selector): Make machine_, size_, and is_big_endian_
14501 fields const. Add bfd_name_ and instantiated_target_ fields.
14502 (Target_selector::Target_selector): Add bfd_name parameter.
14503 (Target_selector::recognize): Make non-virtual, call
14504 do_recognize.
14505 (Target_selector::recognize_by_name): Make non-virtual, call
14506 do_recognize_by_name.
14507 (Target_selector::supported_names): New function.
14508 (Target_selector::bfd_name): New function.
14509 (Target_selector::do_instantiate_target): New pure virtual
14510 function.
14511 (Target_selector::do_recognize): New virtual function.
14512 (Target_selector::do_recognize_by_name): New virtual function.
14513 (Target_selector::instantiate_target): New private function.
14514 (supported_target_names): Declare.
14515 * target-select.cc (Target_selector::Target_selector): Update for
14516 new parameter and fields.
14517 (select_target_by_name): Check that the name matches before
14518 calling recognize_by_name.
14519 (supported_target_names): New function.
14520 * i386.cc (class Target_selector_i386): Update Target_selector
14521 constructor call. Remove recognize and recognize_by_name. Add
14522 do_instantiate_target.
14523 * x86_64.cc (class Target_selector_x86_64): Likewise.
14524 * testsuite/testfile.cc (class Target_selector_test): Update for
14525 changes to Target_selector.
14526
874c5b28
ILT
14527 * README: Rewrite, with some notes on unsupported features.
14528
0a65a3a7
CC
145292008-03-24 Cary Coutant <ccoutant@google.com>
14530
14531 * i386.cc (Target_i386::Got_type): New enum declaration.
14532 (Target_i386::Scan::local): Updated callers of Output_data_got
14533 member functions.
14534 (Target_i386::Scan::global): Likewise.
14535 (Target_i386::Relocate::relocate): Likewise.
14536 (Target_i386::Relocate::relocate_tls): Likewise.
14537 * object.h (Got_offset_list): New class.
14538 (Sized_relobj::local_has_got_offset): Added got_type parameter.
14539 (Sized_relobj::local_got_offset): Likewise.
14540 (Sized_relobj::set_local_got_offset): Likewise.
14541 (Sized_relobj::local_has_tls_got_offset): Removed.
14542 (Sized_relobj::local_tls_got_offset): Removed.
14543 (Sized_relobj::set_local_tls_got_offset): Removed.
14544 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
14545 * output.cc (Output_data_got::add_global): Added got_type parameter.
14546 (Output_data_got::add_global_with_rel): Likewise.
14547 (Output_data_got::add_global_with_rela): Likewise.
14548 (Output_data_got::add_global_pair_with_rel): New function.
14549 (Output_data_got::add_global_pair_with_rela): New function.
14550 (Output_data_got::add_local): Added got_type parameter.
14551 (Output_data_got::add_local_with_rel): Likewise.
14552 (Output_data_got::add_local_with_rela): Likewise.
14553 (Output_data_got::add_local_pair_with_rel): New function.
14554 (Output_data_got::add_local_pair_with_rela): New function.
14555 (Output_data_got::add_global_tls): Removed.
14556 (Output_data_got::add_global_tls_with_rel): Removed.
14557 (Output_data_got::add_global_tls_with_rela): Removed.
14558 (Output_data_got::add_local_tls): Removed.
14559 (Output_data_got::add_local_tls_with_rel): Removed.
14560 (Output_data_got::add_local_tls_with_rela): Removed.
14561 * output.h (Output_data_got::add_global): Added got_type parameter.
14562 (Output_data_got::add_global_with_rel): Likewise.
14563 (Output_data_got::add_global_with_rela): Likewise.
14564 (Output_data_got::add_global_pair_with_rel): New function.
14565 (Output_data_got::add_global_pair_with_rela): New function.
14566 (Output_data_got::add_local): Added got_type parameter.
14567 (Output_data_got::add_local_with_rel): Likewise.
14568 (Output_data_got::add_local_with_rela): Likewise.
14569 (Output_data_got::add_local_pair_with_rel): New function.
14570 (Output_data_got::add_local_pair_with_rela): New function.
14571 (Output_data_got::add_global_tls): Removed.
14572 (Output_data_got::add_global_tls_with_rel): Removed.
14573 (Output_data_got::add_global_tls_with_rela): Removed.
14574 (Output_data_got::add_local_tls): Removed.
14575 (Output_data_got::add_local_tls_with_rel): Removed.
14576 (Output_data_got::add_local_tls_with_rela): Removed.
14577 * resolve.cc (Symbol::override_base_with_special): Removed
14578 reference to has_got_offset_ field.
14579 * symtab.cc (Symbol::init_fields): Replaced initialization
14580 of got_offset_ with got_offsets_. Removed initialization
14581 of has_got_offset_
53fcba31 14582 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
14583 (Symbol::got_offset): Likewise.
14584 (Symbol::set_got_offset): Likewise.
14585 (Symbol::has_tls_got_offset): Removed.
14586 (Symbol::tls_got_offset): Removed.
14587 (Symbol::set_tls_got_offset): Removed.
14588 (Symbol::got_offset_): Removed.
14589 (Symbol::tls_mod_got_offset_): Removed.
14590 (Symbol::tls_pair_got_offset_): Removed.
14591 (Symbol::got_offsets_): New field.
14592 (Symbol::has_got_offset): Removed.
14593 (Symbol::has_tls_mod_got_offset): Removed.
14594 (Symbol::has_tls_pair_got_offset): Removed.
14595 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
14596 (Target_x86_64::Scan::local): Updated callers of Output_data_got
14597 member functions.
14598 (Target_x86_64::Scan::global): Likewise.
14599 (Target_x86_64::Relocate::relocate): Likewise.
14600 (Target_x86_64::Relocate::relocate_tls): Likewise.
14601
bd52eafb
BE
146022008-03-25 Ben Elliston <bje@au.ibm.com>
14603
14604 * yyscript.y: Fix spelling error in comment.
14605
8b105e34
ILT
146062008-03-24 Ian Lance Taylor <iant@google.com>
14607
8ed814a9
ILT
14608 * options.h (class General_options): Define build_id option.
14609 * layout.h (class Layout): Declare write_build_id, create_note,
14610 create_build_id. Add build_id_note_ member.
14611 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
14612 "libiberty.h", "md5.h", "sha1.h".
14613 (Layout::Layout): Initialize eh_frame_data_,
14614 eh_frame_hdr_section_, and build_id_note_.
14615 (Layout::finalize): Call create_build_id.
14616 (Layout::create_note): New function, broken out of
14617 Layout::create_gold_note.
14618 (Layout::create_gold_note): Call create_note.
14619 (Layout::create_build_id): New function.
14620 (Layout::write_build_id): New function.
14621 (Close_task_runner::run): Call write_build_id.
14622
8b105e34
ILT
14623 * x86_64.cc: Correct license to GPLv3.
14624
086a1841
ILT
146252008-03-23 Ian Lance Taylor <iant@google.com>
14626
14627 * options.cc: Include "demangle.h".
14628 (parse_optional_string): New function.
14629 (parse_long_option): Handle takes_optional_argument.
14630 (parse_short_option): Update dash_z initializer. Handle
14631 takes_optional_argument.
14632 (General_options::General_options): Initialize do_demangle_.
14633 (General_options::finalize): Set do_demangle_. Handle demangling
14634 style.
14635 * options.h (parse_optional_string): Declare.
14636 (struct One_option): Add optional_arg field. Update constructor.
14637 Update call constructor calls. Add takes_optional_argument
14638 function.
14639 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
14640 (DEFINE_optional_string): Define.
14641 (General_options::demangle): Change from DEFINE_bool to
14642 DEFINE_optional_string.
14643 (General_options::no_demangle): New function.
14644 (General_options::do_demangle): New function.
14645 (General_options::set_do_demangle): New function.
14646 (General_options::execstack_status_): Move definition to end of
14647 class definition.
14648 (General_options::static_): Likewise.
14649 (General_options::do_demangle_): New field.
14650 * object.cc (big_endian>::get_symbol_location_info): Call
14651 Options::do_demangle, not Options::demangle.
14652 * symtab.cc (demangle): Likewise.
14653
cbb93e63
ILT
146542008-03-22 Ian Lance Taylor <iant@google.com>
14655
14656 * gold.h: Include <cstddef> and <sys/types.h>
14657 * options.h: Include <cstring>.
14658
ec531623
ILT
146592008-03-21 Ian Lance Taylor <iant@google.com>
14660
14661 * Added source code to GNU binutils.
752937aa
NC
14662\f
14663Copyright (C) 2008-2012 Free Software Foundation, Inc.
14664
14665Copying and distribution of this file, with or without modification,
14666are permitted in any medium without royalty provided the copyright
14667notice and this notice are preserved.
14668
14669Local Variables:
14670mode: change-log
14671left-margin: 8
14672fill-column: 74
14673version-control: never
14674End:
This page took 0.903505 seconds and 4 git commands to generate.