fix grammar oddity in the manual
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
94e49e16
CC
12013-11-14 Cary Coutant <ccoutant@google.com>
2
3 * dwp.cc (Dwo_file_entry): New type.
4 (File_list): Use Dwo_file_entry.
5 (Dwo_file::verify): New function.
6 (Dwo_file::verify_dwo_list): New function.
7 (Dwo_file::sized_verify_dwo_list): New function.
8 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
9 list.
10 (Dwp_options): New enum type.
11 (dwp_options): Add --verify-only.
12 (usage): Likewise.
13 (main): Likewise.
14 * dwp.h (gold_info): Add declaration.
15
7cdd7d57
CC
162013-11-14 Cary Coutant <ccoutant@google.com>
17
18 PR gold/14860
19 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
20 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
21 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
22 updating fde_offsets_.
23 (Eh_frame_hdr::lock_): New data member.
24
1d946cb3
CC
252013-11-06 Cary Coutant <ccoutant@google.com>
26
27 PR gold/15758
28 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
29 before reloc sections.
30
908794a9
CC
312013-10-31 Cary Coutant <ccoutant@google.com>
32
33 Restore support for dwp v2 DWARF package file format.
34
35 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
36 tu_length parameter. Adjust all callers.
37 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
38 * dwp.cc: Include dwarf.h.
39 (Section_bounds): New struct type.
40 (Unit_set): New struct type.
41 (Dwo_file::Dwo_file): Initialize new data member.
42 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
43 Combine and rename to...
44 (Dwo_file::read_unit_index): ...this.
45 (Dwo_file::sized_read_compunit_index)
46 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
47 (Dwo_file::sized_read_unit_index): ...this.
48 (Dwo_file::copy_section): Remove section_name, is_str_offsets
49 parameters; add section_id parameter.
50 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
51 (Dwo_file::add_unit_set): ...this.
52 (Dwo_file::shndx_map_): Remove.
53 (Dwo_file::sect_offsets_): New data member.
54 (Dwp_output_file::Dwp_output_file): Initialize new data members.
55 (Dwp_output_file::add_section): Rename to...
56 (Dwp_output_file::add_contribution): ...this.
57 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
58 (Dwp_output_file::add_tu_set): Likewise.
59 (Dwp_output_file::Contribution): New type.
60 (Dwp_output_file::Section::contributions): New data member.
61 (Dwp_output_file::Cu_or_tu_set): Remove.
62 (Dwp_output_file::Section::Section): New ctor.
63 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
64 (Dwp_output_file::Dwp_index::Section_table): New type.
65 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
66 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
67 parameter.
68 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
69 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
70 (Dwp_output_file::Dwp_index::section_table): New member function.
71 (Dwp_output_file::Dwp_index::section_table_end): New member function.
72 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
73 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
74 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
75 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
76 (Dwp_output_file::Dwp_index::section_table_): New data member.
77 (Dwp_output_file::Dwp_index::section_mask_): New data member.
78 (Dwp_output_file::add_output_section): New member function.
79 (Dwp_output_file::write_new_section): New member function.
80 (Dwp_output_file::write_contributions): New member function.
81 (Dwp_output_file::section_id_map_): New data member.
82 (class Dwo_id_info_reader): Remove.
83 (class Unit_reader): New class.
84 (get_dwarf_section_name): New function.
85 (Dwo_file::read_executable): Adjust initializations of class data.
86 (Dwo_file::read): Add support for v2 package file format.
87 (Dwo_file::read_unit_index): Likewise.
88 (Dwo_file::sized_read_unit_index): Likewise.
89 (Dwo_file::copy_section): Likewise.
90 (Dwo_file::add_unit_set): Likewise.
91 (Dwp_output_file::add_output_section): Likewise.
92 (Dwp_output_file::add_contribution): Likewise.
93 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
94 for empty slot.
95 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
96 file format.
97 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
98 slot.
99 (Dwp_output_file::initialize): Remove unused function.
100 (Dwp_output_file::finalize): Add support for v2 package file format.
101 (Dwp_output_file::write_index): Likewise.
102 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
103 function prototype.
104
2500c017
CC
1052013-10-31 Cary Coutant <ccoutant@google.com>
106
107 * configure.ac: Fix check for -fmerge-constants.
108 * configure.ac: Regenerate.
109
dd0845d7
RM
1102013-10-30 Roland McGrath <mcgrathr@google.com>
111
112 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
113 Correct 9-byte nop sequence to match what the assembler generates.
114
b4f7960d
AM
1152013-10-30 Alan Modra <amodra@gmail.com>
116
117 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
118 ppc64_local_entry_offset, ppc64_local_entry_offset,
119 do_read_symbols): New functions.
120 (Powerpc_relobj::e_flags_, st_other_): New vars.
121 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
122 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
123 (Powerpc_relobj::e_flags_): New var.
124 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
125 and adjust for ELFv2.
126 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
127 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
128 (Powerpc_dynobj::do_find_special_sections): Likewise.
129 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
130 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
131 to ELFv2 local entry.
132 (Target_powerpc::do_relax): No thread safe barriers needed for
133 ELFv2.
134 (Output_data_plt_powerpc::initial_plt_entry_size_,
135 plt_entry_size): Delete. Replace all uses with
136 first_plt_entry_offset() and plt_entry_size().
137 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
138 reserved_size parm. Update callers.
139 (Output_data_plt_powerpc::entry_count): Update.
140 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
141 and use Target_powerpc::first_plt_entry_offset().
142 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
143 rename to plt_entry_size.
144 (Output_data_plt_powerpc::add_ifunc_entry,
145 add_local_ifunc_entry): Adjust reloc for ELFv2.
146 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
147 (glink_eh_frame_fde_64v2): New.
148 (Stub_table::plt_call_size): Support ELFv2 sizing.
149 (Output_data_glink::add_eh_frame): Use the new FDE.
150 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
151 (Stub_table::do_write): Write ELFv2 stubs and glink.
152 (Target_powerpc::Relocate::relocate): Replaces nop after call
153 with ld 2,24(1) and adjust local offset destination for ELFv2.
154
f9c6b907
AM
1552013-10-30 Alan Modra <amodra@gmail.com>
156
157 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
158 (Target_powerpc::Scan::global, local): Likewise.
159 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
160 on all ppc64 @h and @ha relocs.
161
e84fe78f
AM
1622013-10-14 Alan Modra <amodra@gmail.com>
163
164 * output.h (Output_data_got::add_constant): Tidy.
165 (Output_data_got::add_constant_pair): New function.
166 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
167 methods used so as to first call reserve_ent().
168
679e4abf
RM
1692013-10-11 Roland McGrath <mcgrathr@google.com>
170
44dcb735
RM
171 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
172 add_got_entry and add_got_entry_pair.
173
13323c49
RM
174 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
175 (HAVE_PUBNAMES): Likewise.
176 * configure: Regenerate.
177
1496b446
RM
178 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
179 * testsuite/Makefile.in: Regenerate.
180
cc84c10b
RM
181 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
182 Remove const from declaration.
183 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
184 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
185 * output.h (Output_file_header): Remove const from member target_
186 and corresponding constructor argument.
187 * output.cc (Output_file_header::Output_file_header): Update prototype.
188 (Output_file_header::do_sized_write): Use this->target_ in place
189 of parameters()->target().
190
52f66a2c
RM
191 * testsuite/undef_symbol.cc (Foo::get_a): New method.
192
2b64b551
RM
193 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
194 * configure: Regenerate.
195 * Makefile.in: Regenerate.
196 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
197 * testsuite/merge_string_literals_2.c: Likewise.
198 * testsuite/Makefile.am
199 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
200 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
201 literal -fmerge-constants.
202 * testsuite/Makefile.in: Regenerate.
203
43819297
RM
204 * i386.cc (Target_i386): Remove unused member dynbss_.
205 * arm.cc (Target_arm): Likewise.
206 * powerpc.cc (Target_powerpc): Likewise.
207 * sparc.cc (Target_sparc): Likewise.
208 * tilegx.cc (Target_tilegx): Likewise.
209 * x86_64.cc (Target_x86_64): Likewise.
210 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
211 type_signature_, type_offset_.
212 * plugin.h (Plugin_hook): Remove unused member layout_.
213 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
214 mapfile_.
215 (Read_member): Remove unused members input_objects_, symtab_,
216 mapfile_, layout_.
217 (Check_library): Remove unused member symtab_.
218 * archive.h (Lib_group): Remove unused member lib_.
219 * archive.cc (Lib_group::Lib_group): Update initializer.
220 * incremental.h (Incremental_binary): Remove unused member target_.
221 (Incremental_script_entry): Removed unused member script_.
222 * layout.h (Write_symbols_task): Remove unused member input_objects_.
223 * icf.h (Icf): Remove unused member num_tracked_relocs.
224
39d9ead7
RM
225 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
226 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
227 its only use.
228 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
229
679e4abf
RM
230 * archive.h: Use struct rather than class for forward declaration
231 of Read_symbols_data.
232
54de2ea6
CC
2332013-10-07 Cary Coutant <ccoutant@google.com>
234
235 PR gold/16010
236 * testsuite/Makefile.am (icf_test): Fix dependencies.
237 (icf_safe_test): Likewise.
238 (icf_safe_so_test): Likewise.
239 (large_symbol_alignment): Add empty _LDADD rule.
240 * testsuite/Makefile.in: Regenerate.
241
b14016f0
L
2422013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
243
244 PR gold/15927
245 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
246 relocation for R_X86_64_32 on x32.
247
eb426534
RM
2482013-08-27 Roland McGrath <mcgrathr@google.com>
249
250 * output.cc (Output_segment::set_section_addresses): Take new
251 Target* argument. If target->isolate_execinstr() and the segment
252 is executable and starts at a target->abi_pagesize() boundary,
253 pad its end out to a target->abi_pagesize() boundary with code fill.
254 * output.h (Output_segment::set_section_addresses): Update decl.
255 * layout.h (Layout::check_output_data_for_reset_values): Take new
256 argument RELAX_OUTPUTS.
257 (Layout): New member relax_output_list_.
258 (Layout::add_relax_output): New method.
259 * layout.cc (Layout::Layout): Update constructor.
260 (Layout::reset_relax_output): New method.
261 (Layout::clean_up_after_relaxation): Call it.
262 (Layout::prepare_for_relaxation): Update caller.
263 (Layout::set_segment_offsets): Update callers of set_section_addresses.
264 Call reset_relax_output before re-processing segments for
265 isolate_execinstr case.
266 (Layout::write_data): Handle relax_output_list_.
267 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
268 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
269
9aff4b7a
NC
2702013-08-23 Yuri Chornoivan <yurchor@ukr.net>
271
272 PR binutils/15834
273 * object.h: Fix typos.
274
93f8221c
RM
2752013-08-16 Roland McGrath <mcgrathr@google.com>
276
277 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
278 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
279
e44c3715
CC
2802013-08-07 Cary Coutant <ccoutant@google.com>
281
282 Revert support for v2 DWP files:
283
284 2013-03-01 Cary Coutant <ccoutant@google.com>
285
286 Add dwp support for v2 DWARF package file format.
287 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
288 tu_length parameter. Adjust all callers.
289 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
290 * dwp.cc: Include dwarf.h.
291 (Section_bounds): New struct type.
292 (Unit_set): New struct type.
293 (Dwo_file::Dwo_file): Initialize new data member.
294 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
295 Combine and rename to...
296 (Dwo_file::read_unit_index): ...this.
297 (Dwo_file::sized_read_compunit_index)
298 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
299 (Dwo_file::sized_read_unit_index): ...this.
300 (Dwo_file::copy_section): Remove section_name, is_str_offsets
301 parameters; add section_id parameter.
302 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
303 (Dwo_file::add_unit_set): ...this.
304 (Dwo_file::shndx_map_): Remove.
305 (Dwo_file::sect_offsets_): New data member.
306 (Dwp_output_file::Dwp_output_file): Initialize new data members.
307 (Dwp_output_file::add_section): Rename to...
308 (Dwp_output_file::add_contribution): ...this.
309 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
310 (Dwp_output_file::add_tu_set): Likewise.
311 (Dwp_output_file::Contribution): New type.
312 (Dwp_output_file::Section::contributions): New data member.
313 (Dwp_output_file::Cu_or_tu_set): Remove.
314 (Dwp_output_file::Section::Section): New ctor.
315 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
316 (Dwp_output_file::Dwp_index::Section_table): New type.
317 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
318 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
319 parameter.
320 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
321 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
322 (Dwp_output_file::Dwp_index::section_table): New member function.
323 (Dwp_output_file::Dwp_index::section_table_end): New member function.
324 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
325 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
326 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
327 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
328 (Dwp_output_file::Dwp_index::section_table_): New data member.
329 (Dwp_output_file::Dwp_index::section_mask_): New data member.
330 (Dwp_output_file::add_output_section): New member function.
331 (Dwp_output_file::write_new_section): New member function.
332 (Dwp_output_file::write_contributions): New member function.
333 (Dwp_output_file::section_id_map_): New data member.
334 (class Dwo_id_info_reader): Remove.
335 (class Unit_reader): New class.
336 (get_dwarf_section_name): New function.
337 (Dwo_file::read_executable): Adjust initializations of class data.
338 (Dwo_file::read): Add support for v2 package file format.
339 (Dwo_file::read_unit_index): Likewise.
340 (Dwo_file::sized_read_unit_index): Likewise.
341 (Dwo_file::copy_section): Likewise.
342 (Dwo_file::add_unit_set): Likewise.
343 (Dwp_output_file::add_output_section): Likewise.
344 (Dwp_output_file::add_contribution): Likewise.
345 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
346 for empty slot.
347 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
348 file format.
349 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
350 slot.
351 (Dwp_output_file::initialize): Remove unused function.
352 (Dwp_output_file::finalize): Add support for v2 package file format.
353 (Dwp_output_file::write_index): Likewise.
354 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
355 function prototype.
356
c6905c28
CC
3572013-07-31 Cary Coutant <ccoutant@google.com>
358
359 * object.cc (Sized_relobj::do_output_section_address): New function.
360 (Sized_relobj): Instantiate explicitly.
361 * object.h (Object::output_section_address): New function.
362 (Object::do_output_section_address): New function.
363 (Sized_relobj::do_output_section_address): New function.
364 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
365
3662013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 367 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
368
369 * parameters.cc (Parameters::entry): Return target-specific entry
370 symbol name.
371 * target.h (Target::entry_symbol_name): New function.
372 (Target_info::entry_symbol_name): New data member.
373
374 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
375 * i386.cc (Target_i386::i386_info): Likewise.
376 (Target_i386_nacl::i386_nacl_info): Likewise.
377 * sparc.cc (Target_sparc::sparc_info): Likewise.
378 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
379 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
380 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
381 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
382
234d4ab8
SA
3832013-07-22 Sterling Augustine <saugustine@google.com>
384
385 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
386 Convert parameter shndx to local variable. Add parameters symtab
387 and symtab_size. Scan over section names. Find relocation
388 section corresponding to current section. Create and initialize
389 reloc_mapper_ and reloc_type_.
390 (Dwarf_pubnames_table::read_header): Add assertion. Change
391 unit_length to off_t. Initialize member unit_length_. Fill in field
392 cu_offset_.
393 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
394 Initialize new fields unit_length_ and cu_offset_.
395 (Dwarf_pubnames_table::read_section): Update prototype.
396 (Dwarf_pubnames_table::cu_offset): New member function.
397 (Dwarf_pubnames_table::subsection_size): Likewise.
398 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
399 New fields.
400 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
401 member functions public.
402 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
403 Update comment. Rework logic. Move repeated parts to...
404 (Gdb_index_info_reader::read_pubtable): ...here. New function.
405 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
406 pubtypes_table_, and stmt_list_offset.
407 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
408 Gdb_index::find_pubtype_offset,
409 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
410 (Gdb_index::pubnames_read): Update prototype and rework logic.
411 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
412 Forward declare.
413 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
414 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
415 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
416 Gdb_index::map_pubtable_to_dies):
417 Declare functions.
418 (Gdb_index::pubnames_read): Update declaration.
419 (Gdb_index::Pubname_offset_map): New type.
420 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
421 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
422 Gdb_index::stmt_list_offset): Declare.
423 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
424 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
425 Gdb_index::pubtypes_offset_): Remove.
426
a3ed37d8
RM
4272013-07-19 Roland McGrath <mcgrathr@google.com>
428
429 * options.h (General_options): Add -Trodata-segment option.
430 * parameters.cc (Parameters::check_rodata_segment): New function.
431 (Parameters::set_target_once): Call it.
432 * parameters.h (Parameters): Declare it (private member function).
433 * layout.cc (load_seg_unusable_for_headers): New function, broken
434 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
435 then validate rodata segment rather than text segment.
436 (relaxation_loop_body): Call that.
437 (is_text_segment): New function. Don't admit a non-executable
438 segment if TARGET->isolate_execinstr().
439 (set_segment_offsets): Call it. Honor -Trodata-segment option.
440
eb5b4ded
CC
4412013-07-15 Shawn Landden <shawnlandden@gmail.com>
442
443 PR gold/15070
444 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
445 * nacl.h (Sniff_file::View::View): Request aligned view.
446
4d5effb9
CC
4472013-07-11 Cary Coutant <ccoutant@google.com>
448
449 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
450 correct BRLT entry size.
451
ba8ca3e7
AM
4522013-07-03 Alan Modra <amodra@gmail.com>
453
454 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
455 comment.
456
267257d2
CC
4572013-07-01 Cary Coutant <ccoutant@google.com>
458
459 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
460 reloc_type_.
461 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
462 (Dwarf_ranges_table::lookup_reloc): New function.
463 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
464 reloc_type_.
465 (Dwarf_ranges_table::lookup_reloc): New function.
466 (Dwarf_ranges_table::reloc_type_): New data member.
467
06f30c9d
CC
4682013-06-27 Jing Yu <jingyu@google.com>
469
470 PR gold/15662
471 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
472 function.
473 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
474 (Target_powerpc::do_relax): Call the above.
475
a2d7bf59
AM
4762013-06-27 Cary Coutant <ccoutant@google.com>
477
478 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
479 on garbage collected .opd section.
480
4812013-06-27 Alan Modra <amodra@gmail.com>
482
483 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
484 is non-zero.
485 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
486 (Target_powerpc::do_function_location): Likewise for loc->shndx.
487
32364e50
CC
4882013-06-14 Cary Coutant <ccoutant@google.com>
489
490 * resolve.cc (Symbol::override_base): Don't override st_type
491 from plugin placeholder symbols.
492 (Symbol_table::resolve): Likewise.
493 (Symbol_table::should_override): Don't complain about TLS mismatch
494 if the TO symbol is a plugin placeholder.
495 * testsuite/Makefile.am (plugin_test_tls): New test.
496 * testsuite/Makefile.in: Regenerate.
497 * testsuite/plugin_test_tls.sh: New test script.
498 * testsuite/two_file_test_2_tls.cc: New test source.
499 * testsuite/two_file_test_tls.cc: New test source.
500
7fb47cc9
CC
5012013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
502
503 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
504 the maximum segment alignment is larger than the page size.
505 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
506 correctly aligns the symbols with large alignemnt.
507 * testsuite/Makefile.in: Regenerate.
508 * testsuite/large_symbol_alignment.cc: New file.
509
6934001a
CC
5102013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
511 Sriraman Tallam <tmsriram@google.com>
512
513 * options.h (sort_section): New option.
514 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
515 Rename from Input_section_sort_section_name_special_ordering_compare.
516 (Input_section_sort_section_name_compare): New struct.
517 * output.cc (Output_section::Input_section_sort_section_name_compare::
518 operator()): New function.
519 (Output_section::sort_attached_input_sections): Use new sort function
520 for .text if --sort-section=name is specified.
521 * layout.cc (Layout::make_output_section):
522 Add sorting by name when --sort-section=name is specified.
523 * testsuite/Makefile.am (text_section_grouping): Test option
524 --sort-section=name.
525 * testsuite/Makefile.in: Regenerate.
526 * testsuite/section_sorting_name.cc: New file.
527 * testsuite/section_sorting_name.sh: New file.
528
93acabad
CC
5292013-05-21 Cary Coutant <ccoutant@google.com>
530
531 * symtab.h (Symbol::is_cxx_vtable): New function.
532 * target-reloc.h (relocate_section): Check for vtable symbol.
533 * testsuite/Makefile.am (missing_key_func.sh): New test case.
534 * testsuite/Makefile.in: Regenerate.
535 * testsuite/missing_key_func.cc: New test source.
536 * testsuite/missing_key_func.sh: New test script.
537
60e8b3fc
CC
5382013-05-21 Cary Coutant <ccoutant@google.com>
539
2b64b551
RM
540 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
541 type of enclosing symbol.
542 (Relocate_info::location): Check symbol type when describing symbol.
543 * object.h (Symbol_location_info): Remove unused line_number;
544 add enclosing_symbol_type.
545 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 546
9df9de2c
CC
5472013-05-13 Cary Coutant <ccoutant@google.com>
548
2b64b551
RM
549 * configure.ac: Export DEFAULT_TARGET.
550 * configure: Regenerate.
551 * Makefile.in: Regenerate.
552 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
553 * testsuite/Makefile.in: Regenerate.
554 * testsuite/debug_msg.sh: Delete duplicate tests.
555 Don't check undef_int error message match for powerpc where the
556 source file and line number aren't available.
9df9de2c 557
bbc5ae17
RM
5582013-05-10 Roland McGrath <mcgrathr@google.com>
559
560 * options.h (General_options): Add --rosegment-gap option.
561 * options.cc (finalize): --rosegment-gap implies --rosegment.
562 * layout.cc (set_segment_offsets): Let user option override
563 target->rosegment_gap().
564
0c6e6c39
RM
5652013-05-10 Roland McGrath <mcgrathr@google.com>
566
567 * options.h (General_options): Remove leading space from help
568 messages for -nostdlib and --rosegment.
569
cde7cb01
MR
5702013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
571
572 PR ld/15365
573 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
574
f31ae5b8
AM
5752013-05-03 Alan Modra <amodra@gmail.com>
576
577 * merge.cc (Output_merge_string::do_add_input_section): Correct
578 scan for number of strings. Rename vars to avoid shadowing.
579 Include missing terminator in input_size_.
580
d3a7cd45
L
5812013-05-01 H.J. Lu <hongjiu.lu@intel.com>
582
583 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
584 Restore empty string handling.
585
6ad3daba
CC
5862013-05-01 Cary Coutant <ccoutant@google.com>
587
588 * stringpool.cc (Stringpool_template::new_key_offset): Fix
589 uninitialized warning.
590
e31908b6
CC
5912013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
592
593 * output.cc (Output_section::add_merge_input_section): Allow
594 to merge sections if the alignment is more than character size.
595 * merge.h (Output_merge_string::Output_merge_string): Remove
596 assert.
597 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
598 only not-null strings. Check the alignment of strings.
599 * stringpool.h
600 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
601 alignment as the argument.
602 (Stringpool_template<Stringpool_char>::addralign_): New class member.
603 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
604 Align non-zero length strings according to the addralign_.
605 (Stringpool_template<Stringpool_char>::set_string_offsets):
606 Updating offsets according to the given alignment.
607 * testsuite/Makefile.am (text_section_grouping): Test if string
608 literals are getting merged.
609 * testsuite/Makefile.in: Regenerate.
610 * testsuite/merge_string_literals_1.c: New file.
611 * testsuite/merge_string_literals_2.c: Ditto.
612 * testsuite/merge_string_literals.sh: Ditto.
613
0e804863
ILT
6142013-04-26 Ian Lance Taylor <iant@google.com>
615
616 * target-reloc.h (relocate_section): If the reloc offset is out of
617 range, pass VIEW as NULL to relocate.relocate.
618 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
619 * i386.cc (Target_i386::Relocate::relocate): Likewise.
620 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
621 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
622 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
623 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
624
e7c5ea40
CC
6252013-04-26 Geoff Pike <gpike@chromium.org>
626
627 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
628 * layout.cc (Hash_task): New class.
629 (Layout::queue_build_id_tasks): New function.
630 (Layout::write_build_id): Handle single-thread portion of build ID
631 computation. (In some cases, all of it is single-threaded.) Replace
632 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
633 functionality in fewer lines of code.
634 * layout.h (Layout::queue_build_id_tasks): New function declaration.
635 * options.h (General_options): make "--build-id" default to tree
636 rather than sha1. Add two new options related to --build-id=tree:
637 --build-id-chunk-size-for-treehash and
638 --build-id-min-file-size-for-treehash.
639 * Makefile.am: add testing of --build-id=tree and related new options
640 (these tests will be invoked by "make check").
641 * Makefile.in: Regenerate.
642
49926cd0
AM
6432013-04-25 Alan Modra <amodra@gmail.com>
644
645 * configure.tgt: Add powerpcle and powerpc64le.
646
a4034750
AM
6472013-04-22 Alan Modra <amodra@gmail.com>
648
649 PR gold/15355
650 * layout.cc (Layout::segment_precedes): Allow more than one
651 segment with the same type and flags.
652
e79c84aa
CC
6532013-04-15 Cary Coutant <ccoutant@google.com>
654
655 * layout.cc (Layout::set_relocatable_section_offsets): Don't
656 allocate space in file for BSS sections.
657
2199fbe7
CC
6582013-04-15 Cary Coutant <ccoutant@google.com>
659
660 * script-sections.cc (Orphan_output_section): Reset address
661 to zero after each orphaned section for relocatable links.
662
502e8a84
CC
6632013-04-15 Cary Coutant <ccoutant@google.com>
664
a4034750
AM
665 * symtab.cc (Symbol_table::sized_write_globals): Subtract
666 section starting address for relocatable link.
667 * testsuite/Makefile.am (script_test_11): New test.
668 * testsuite/Makefile.in: Regenerate.
669 * testsuite/script_test_11.c: New source file.
670 * testsuite/script_test_11.t: New linker script.
502e8a84 671
0cfdc767
AM
6722013-04-13 Alan Modra <amodra@gmail.com>
673
674 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
675 owner when sections are not adjacent and exceed group size.
676 (Target_powerpc::group_sections): Handle corner case.
677 (Target_powerpc::Branch_info::make_stub): Handle case where
678 stub table doesn't exist due to branches in non-exec sections.
679 (Target_powerpc::Relocate::relocate): Likewise.
680
6830ee24
AM
6812013-04-11 Alan Modra <amodra@gmail.com>
682
683 PR gold/15354
684 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
685 .branch_lt to match bfd ld. Adjust comments throughout file.
686
54a3d865
ILT
6872013-04-04 Ian Lance Taylor <iant@google.com>
688
689 GCC PR c++/56840
690 * object.cc (do_layout_deferred_sections): Handle .eh_frame
691 sections before checking whether they are included in the link.
692
9993ba11
ST
6932013-03-29 Sriraman Tallam <tmsriram@google.com>
694
695 * archive.cc (Archive::get_elf_object_for_member): Create the elf
696 object before calling the plugin claim_file handler. Pass the elf
697 object of the archive to the plugin. Delete the elf object if the
698 plugin claims the file.
699
ebacd51e
AM
7002013-03-21 Alan Modra <amodra@gmail.com>
701
702 * layout.cc (Layout::set_segment_offsets): Accept writable .text
703 segment when omagic.
704
117be58f
AM
7052013-03-21 Alan Modra <amodra@gmail.com>
706
707 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
708 comparison warning.
709 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
710 uninitialized" warning.
711
32e2b61d
AM
7122013-03-20 Alan Modra <amodra@gmail.com>
713
714 * symtab.h (Symbol::clear_version): New function.
715 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
716 is_needed by weak references. Clear version for symbols defined
717 in as-needed objects that are not needed.
718
b3ccdeb5
AM
7192013-03-15 Alan Modra <amodra@gmail.com>
720
721 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
722 static and public. Add report_err param. Return false for data refs.
723 (Target_powerpc::rela_dyn_section): New overloaded function.
724 (Target_powerpc::plt_, iplt_): Elucidate.
725 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
726 (Output_data_plt_powerpc::do_write): Don't write .iplt.
727 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
728 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
729 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
730 push_branch and make_plt_entry for ifunc syms when
731 reloc_needs_plt_for_ifunc.
732 (Target_powerpc::Relocate::relocate): Don't use plt entry value
733 for ifunc unless reloc_needs_plt_for_ifunc.
734
ad3d8a2f
AM
7352013-03-15 Alan Modra <amodra@gmail.com>
736
737 * gc.h (gc_process_relocs): Don't look through function descriptors.
738 * icf.cc (get_section_contents): Do so here instead.
739
4d9aa155
AM
7402013-03-13 Alan Modra <amodra@gmail.com>
741
742 * powerpc.cc (is_branch_reloc): Forward declare.
743 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
744 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
745 false for 64-bit, true for 32-bit non-branch relocs.
746 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
747 * testsuite/Makefile.am (icf_test): Use linker map file instead of
748 nm output.
749 (icf_safe_test): Generate linker map file as well as nm output.
750 (icf_safe_so_test): Likewise.
751 * testsuite/Makefile.in: Regenerate.
752 * testsuite/icf_test.sh: Parse linker map file to determine
753 section folding.
754 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
755 * testsuite/icf_safe_so_test.sh: Likewise.
756 (X86_32_or_ARM_specific_safe_fold): Merge into..
757 (arch_specific_safe_fold): ..this.
758 (X86_64_specific_safe_fold): Delete unused function.
759
57420c20
AM
7602013-03-12 Alan Modra <amodra@gmail.com>
761
762 * gc.h (gc_process_relocs): Look through function descriptors
763 to determine shndx, symvalue and addend used by ICF. Tidy
764 variable duplication.
765
dc3714f3
AM
7662013-03-11 Alan Modra <amodra@gmail.com>
767
768 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
769 * layout.cc (Layout_task_runner::run): ..to here.
770 * symtab.h (struct Symbol_location): Extract from..
771 (class Symbol_table): ..here.
772 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
773 * target.h (class Target): Add function_location and
774 do_function_location functions.
775 (class Sized_target): Add do_function_location.
776 * object.h (class Sized_relobj_file): Move find_shdr..
777 (class Object): ..to here.
778 * object.cc: Likewise. Update to suit. Instantiate.
779 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
780 * powerpc.cc (class Powerpc_dynobj): New.
781 (Target_powerpc::do_function_location): New function.
782 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
783 (Powerpc_dynobj::do_read_symbols): New function.
784 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
785
956b03bb
ILT
7862013-03-08 Ian Lance Taylor <iant@google.com>
787
788 * options.cc (General_options::string_to_object_format): Accept
789 "default".
790
4bead2d5
AM
7912013-03-08 Alan Modra <amodra@gmail.com>
792
793 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
794 pointer to Post_fde.
795 (struct Post_fde): Move definition to here..
796 * ehframe.cc (struct Post_fde): ..from here.
797 (Cie::write): Don't alloc Post_fde.
798 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
799
02e60bf7
AM
8002013-03-07 Alan Modra <amodra@gmail.com>
801
802 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
803 relocation referencing .LC0.
804 * testsuite/discard_locals_test.sh: Remove FIXMEs.
805
8343f03a
AM
8062013-03-07 Alan Modra <amodra@gmail.com>
807
808 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
809 always_inline. Add assembly for powerpc to avoid GOT.
810
3366d57c
AM
8112013-03-07 Alan Modra <amodra@gmail.com>
812
813 * testsuite/script_test_10.sh: Don't test .bss section
814 header number.
815
6c77229c
AM
8162013-03-06 Alan Modra <amodra@gmail.com>
817
818 * powerpc.cc (class Powerpc_relobj): Move some member functions.
819 (Target_powerpc::symval_for_branch): Add symtab param. Update
820 all callers. Handle folded sections.
821 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
822 to Powerpc_relobj.
823 (Global_symbol_visitor_opd::operator()): Likewise.
824
a39e4af6
AM
8252013-03-04 Alan Modra <amodra@gmail.com>
826
827 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
828 * testsuite/Makefile.in: Regenerate.
829
d5834edb
CC
8302013-03-01 Cary Coutant <ccoutant@google.com>
831
832 Add dwp support for v2 DWARF package file format.
833 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
834 tu_length parameter. Adjust all callers.
835 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
836 * dwp.cc: Include dwarf.h.
837 (Section_bounds): New struct type.
838 (Unit_set): New struct type.
839 (Dwo_file::Dwo_file): Initialize new data member.
840 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
841 Combine and rename to...
842 (Dwo_file::read_unit_index): ...this.
843 (Dwo_file::sized_read_compunit_index)
844 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
845 (Dwo_file::sized_read_unit_index): ...this.
846 (Dwo_file::copy_section): Remove section_name, is_str_offsets
847 parameters; add section_id parameter.
848 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
849 (Dwo_file::add_unit_set): ...this.
850 (Dwo_file::shndx_map_): Remove.
851 (Dwo_file::sect_offsets_): New data member.
852 (Dwp_output_file::Dwp_output_file): Initialize new data members.
853 (Dwp_output_file::add_section): Rename to...
854 (Dwp_output_file::add_contribution): ...this.
855 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
856 (Dwp_output_file::add_tu_set): Likewise.
857 (Dwp_output_file::Contribution): New type.
858 (Dwp_output_file::Section::contributions): New data member.
859 (Dwp_output_file::Cu_or_tu_set): Remove.
860 (Dwp_output_file::Section::Section): New ctor.
861 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
862 (Dwp_output_file::Dwp_index::Section_table): New type.
863 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
864 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
865 parameter.
866 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
867 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
868 (Dwp_output_file::Dwp_index::section_table): New member function.
869 (Dwp_output_file::Dwp_index::section_table_end): New member function.
870 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
871 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
872 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
873 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
874 (Dwp_output_file::Dwp_index::section_table_): New data member.
875 (Dwp_output_file::Dwp_index::section_mask_): New data member.
876 (Dwp_output_file::add_output_section): New member function.
877 (Dwp_output_file::write_new_section): New member function.
878 (Dwp_output_file::write_contributions): New member function.
879 (Dwp_output_file::section_id_map_): New data member.
880 (class Dwo_id_info_reader): Remove.
881 (class Unit_reader): New class.
882 (get_dwarf_section_name): New function.
883 (Dwo_file::read_executable): Adjust initializations of class data.
884 (Dwo_file::read): Add support for v2 package file format.
885 (Dwo_file::read_unit_index): Likewise.
886 (Dwo_file::sized_read_unit_index): Likewise.
887 (Dwo_file::copy_section): Likewise.
888 (Dwo_file::add_unit_set): Likewise.
889 (Dwp_output_file::add_output_section): Likewise.
890 (Dwp_output_file::add_contribution): Likewise.
891 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
892 for empty slot.
893 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
894 file format.
895 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
896 slot.
897 (Dwp_output_file::initialize): Remove unused function.
898 (Dwp_output_file::finalize): Add support for v2 package file format.
899 (Dwp_output_file::write_index): Likewise.
900 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
901 function prototype.
902
a68a081d
CC
9032013-03-01 Cary Coutant <ccoutant@google.com>
904
905 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
906 function into class definition in header file.
907 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
908 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
909 New function.
910 (Dwarf_info_reader::check_buffer): Move here from .cc file.
911
9d5781f8
AM
9122013-02-28 Alan Modra <amodra@gmail.com>
913
914 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
915 * target.cc (Target::do_plt_fde_location): New function.
916 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
917 accessor function, and constructor param.
918 (struct Post_fde, Post_fdes): Declare.
919 (Cie::write): Add post_fdes param.
920 * ehframe.cc (Fde::write): Use plt_fde_location.
921 (struct Post_fde): Define.
922 (Cie::write): Stash FDEs added post merge mapping.
923 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
924 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
925 (Eh_frame::do_sized_write): Arrange to write post map FDES after
926 other FDEs.
927 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
928 (Target_powerpc::has_glink): New function.
929 (Target_powerpc::do_relax): Add eh_frame info for stubs.
930 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
931 glink_eh_frame_fde_32, default_fde): New data.
932 (Stub_table::eh_frame_added_): New var.
933 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
934 Make const.
935 (Stub_table::add_eh_frame): New function.
936 (Output_data_glink::add_eh_frame): New function.
937 (Target_powerpc::make_glink_section): Call add_eh_frame.
938
214383dd
ILT
9392013-02-15 Ian Lance Taylor <iant@google.com>
940
941 * options.h (DEFINE_uint64_alias): Define.
942 (class General_options): Add -Ttext-segment as an alias for
943 -Ttext.
944
91c2b899
AM
9452013-02-15 Alan Modra <amodra@gmail.com>
946
947 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
948 (Stub_table::do_write): ..here, two places.
949 (Stub_table::plt_call_size): Use it here too.
950
20e2a8aa
ILT
9512013-02-11 Ian Lance Taylor <iant@google.com>
952
953 * descriptors.cc (Descriptors::close_all): New function.
954 * descriptors.h (class Descriptors): Declare close_all.
955 (close_all_descriptors): New inline function.
956 * plugin.cc: Include "descriptors.h".
957 (Plugin_manager::cleanup): Call close_all_descriptors.
958
8952bc69
AM
9592013-02-06 Alan Modra <amodra@gmail.com>
960
961 * README: Update coding style link.
962
29bd8b6b
CC
9632013-01-28 Cary Coutant <ccoutant@google.com>
964
a4034750
AM
965 * dwp.cc (File_list): New typedef.
966 (Dwo_name_info_reader): New class.
967 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
968 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
969 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
970 (Dwo_file::read_executable): New function.
971 (Dwo_file::read): Move common setup code to ...
972 (Dwo_file::make_object): ... here.
973 (dwp_options): Add --exec/-e.
974 (usage): Likewise.
975 (main): Likewise.
29bd8b6b 976
c6ac678d
ST
9772013-01-24 Sriraman Tallam <tmsriram@google.com>
978
979 * layout.cc (Layout::layout): Check for option text_reorder.
980 (Layout::make_output_section): Ditto.
981 * options.h (text_reorder): New option.
982 * output.cc (Input_section_sort_compare): Remove special ordering
983 of section names.
984 (Output_section::
985 Input_section_sort_section_name_special_ordering_compare::
986 operator()): New function.
987 (Output_section::sort_attached_input_sections): Use new sort function
988 for .text.
989 * output.h (Input_section_sort_section_name_special_ordering_compare):
990 New struct.
991 * testsuite/Makefile.am (text_section_grouping): Test option
992 --no-text-reorder
993 * testsuite/Makefile.in: Regenerate.
994 * testsuite/text_section_grouping.sh: Check order of functions without
995 default text reordering.
996
50701cc1
MF
9972013-01-18 Mike Frysinger <vapier@gentoo.org>
998
999 * options.h (General_options): Change default to true for new_dtags.
1000
b1b00fcc
MF
10012013-01-18 Mike Frysinger <vapier@gentoo.org>
1002
1003 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
1004 when enable_new_dtags is false. Only add DT_RUNPATH when
1005 enable_new_dtags is true.
1006
ec5b8187
AM
10072013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
1008
1009 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
1010 used in declaration and definition consistent.
1011 (Target_powerpc::symval_for_branch): Ditto.
1012
a880d4c4
ST
10132013-01-16 Sriraman Tallam <tmsriram@google.com>
1014
1015 * testsuite/plugin_final_layout.cc: Fix comment.
1016
7c381248
ST
10172013-01-16 Sriraman Tallam <tmsriram@google.com>
1018
1019 * layout.cc (Layout::layout): Do not do default sorting for
1020 text sections when section ordering is specified.
1021 (make_output_section): Ditto.
1022 * testsuite/plugin_final_layout.cc: Name the function sections
1023 to catch reordering issues.
1024
e2458743
AM
10252013-01-15 Alan Modra <amodra@gmail.com>
1026
1027 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
1028 plt-thread-safe.
1029
431ed302
AM
10302013-01-15 Alan Modra <amodra@gmail.com>
1031
1032 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
1033 * testsuite/Makefile.in: Regenerate.
1034
0ec6429b
AM
10352013-01-14 Alan Modra <amodra@gmail.com>
1036
1037 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
1038 * testsuite/Makefile.in: Regenerate.
1039
0bf402d5
ILT
10402013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
1041
36af3926 1042 PR bfd/14430
0bf402d5
ILT
1043 Fix mingw gold build with plugins enabled
1044 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
1045 * configure.ac: Export DLOPEN_LIBS and add headers check.
1046 * plugin.cc: Handle non-dlfcn case.
1047 * Makefile.in: Regenerate.
1048 * config.in: Regenerate.
1049 * configure: Regenerate.
1050 * testsuite/Makefile.in: Regenerate.
1051
9e9143bc
ST
10522013-01-09 Sriraman Tallam <tmsriram@google.com>
1053
1054 * output.h (sort_attached_input_sections): Change to be public.
1055 * script-sections.cc
1056 (Output_section_definition::set_section_addresses): Sort
1057 attached input sections according to section order before linker
1058 script assigns section addresses.
1059 (Orphan_output_section::set_section_addresses): Sort
1060 attached input sections according to section order before linker
1061 script assigns section addresses.
1062 * Makefile.am (final_layout.sh): Use a simple linker script to
1063 check if section ordering still works.
1064 * Makefile.in: Regenerate.
1065
679af368
ILT
10662013-01-09 Ben Cheng <bccheng@google.com>
1067
1068 * arm.cc (Target_arm::attributes_accept_div): New function.
1069 (Target_arm::attributes_forbid_div): New function.
1070 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
1071 attribute using the same new functions as what bfd/elf32_arm.c
1072 does.
1073
3136a00e
CC
10742013-01-07 Cary Coutant <ccoutant@google.com>
1075
1076 PR gold/14993
1077 * output.cc (Output_section::add_input_section): For incremental
1078 updates, don't track input sections that are allocated from patch
1079 space.
1080
f2a6224b
L
10812013-01-07 H.J. Lu <hongjiu.lu@intel.com>
1082 Ian Lance Taylor <iant@google.com>
1083
1084 PR gold/14897
1085 * configure.ac (--enable-ld): Removed.
1086 (install_as_default): Set to yes only for --enable-gold=default
1087 or --disable-ld.
1088 * configure: Regenerated.
1089
4f46f626
L
10902013-01-07 H.J. Lu <hongjiu.lu@intel.com>
1091
1092 * options.h (General_options): Add -fuse-ld= for GCC linker
1093 option compatibility.
1094
26e4ef59
CC
10952013-01-04 Cary Coutant <ccoutant@google.com>
1096
1097 * configure.ac: Fix typo restoring CXXFLAGS.
1098 * configure: Regenerate.
1099
3d587466
CC
11002013-01-04 Cary Coutant <ccoutant@google.com>
1101
4f46f626
L
1102 * testsuite/Makefile.am (CXXLINK_S): New macro.
1103 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
1104 * testsuite/Makefile.in: Regenerate.
3d587466 1105
44db6695
L
11062013-01-02 H.J. Lu <hongjiu.lu@intel.com>
1107
1108 * version.cc (print_version): Update copyright year to 2013.
1109
edcac0c1
ILT
11102012-12-20 Ian Lance Taylor <iant@google.com>
1111
1112 * layout.cc (Layout::special_ordering_of_input_section): New
1113 function.
1114 (Layout::layout): If input section requires special ordering, must
1115 sort input sections.
1116 (Layout::make_output_section): May sort .text input sections.
1117 (Layout::is_section_name_prefix_grouped): Remove.
1118 * layout.h (class Layout): Declare
1119 special_ordering_of_input_section. Don't declare
1120 is_section_name_prefix_grouped.
1121 * output.cc (Output_section::add_input_section): Revert last
1122 change.
1123 (Output_section::Input_section_sort::match_file_name): Don't crash
1124 if called on output section data.
1125 (Output_section::Input_section_sort_compare): Sort based on
1126 special ordering.
1127 (Output_section::Input_section_sort_section_order_index_compare):
1128 Revert last patch.
1129 (Output_section::sort_attached_input_sections): Likewise.
1130
28f2a4ac
ST
11312012-12-18 Sriraman Tallam <tmsriram@google.com>
1132
edcac0c1 1133 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
1134 * layout.h (Layout::is_section_name_prefix_grouped): New function.
1135 * output.cc (Output_section::add_input_section): Check if section
1136 name contains special prefix. Keep input sections to sort such
1137 sections.
1138 (Output_section::Input_section_sort_section_order_index_compare
1139 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
1140 (Output_section::sort_attached_input_sections): Add condition to
1141 Input_section_entry constructor call.
28f2a4ac
ST
1142 * testsuite/Makefile.am (text_section_grouping): New test.
1143 * testsuite/Makefile.in: Regenerate.
1144 * testsuite/text_section_grouping.cc: New file.
1145 * testsuite/text_section_grouping.sh: New file.
1146
5bf135a7
NC
11472012-12-17 Nick Clifton <nickc@redhat.com>
1148
1149 * Makefile.am: Add copyright notice.
1150 * NEWS: Likewise.
1151 * README: Likewise.
1152 * configure.ac: Likewise.
1153 * ftruncate.c: Likewise.
1154 * Makefile.in: Regenerate.
1155
59965708
CC
11562012-12-14 Cary Coutant <ccoutant@google.com>
1157
a4034750
AM
1158 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
1159 --no-as-needed flag.
1160 (exception_separate_shared_12_test): Likewise.
1161 (incremental_copy_test): Likewise.
1162 * testsuite/Makefile.in: Regenerate.
59965708 1163
2a77e2ab
CC
11642012-12-14 Cary Coutant <ccoutant@google.com>
1165
1166 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
1167 (Dwp_output_file::Dwp_index::enter_set): Add assert.
1168
e3deeb9c
AM
11692012-12-12 Alan Modra <amodra@gmail.com>
1170
1171 * powerpc.cc (class Track_tls): New.
1172 (class Relocate, class Scan): Inherit Track_tls.
1173 (Target_powerpc::Scan::local, global): Track tls optimization
1174 and avoid creating plt entry for __tls_get_addr if all uses
1175 are optimized away.
1176 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
1177
d8f5a274
AM
11782012-12-12 Alan Modra <amodra@gmail.com>
1179
1180 * options.h (General_options): Add --toc-sort/--no-toc-sort.
1181 Replace no_toc_optimize with toc_optimize.
1182 * output.h (Output_section::input_sections): Provide non-const variant.
1183 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
1184 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
1185 accessors.
1186 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
1187 (class Sort_toc_sections): New.
1188 (Target_powerpc::do_finalize_sections): Sort toc sections.
1189 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
1190
4c8a1de1
RM
11912012-12-10 Roland McGrath <mcgrathr@google.com>
1192
1193 * testsuite/binary_unittest.cc (read_all): New function.
1194 (Sized_binary_test): Use it instead of ::read.
1195 * fileread.cc (do_read): Don't assume pread always reads the whole
1196 amount in a single call.
1197
edc27beb
AM
11982012-12-10 Alan Modra <amodra@gmail.com>
1199
1200 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
1201 Set EM_PPC64 or EM_PPC here.
1202 (Target_selector_powerpc::do_recognize): Delete.
1203
906b9150
AM
12042012-12-10 Alan Modra <amodra@gmail.com>
1205
1206 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
1207 stub_table_.
1208 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
1209
418c15ae
RM
12102012-12-07 Roland McGrath <mcgrathr@google.com>
1211
1212 * testsuite/binary_unittest.cc (Sized_binary_test):
1213 Use open_descriptor rather than ::open.
1214
decdd3bc
AM
12152012-12-07 Alan Modra <amodra@gmail.com>
1216
1217 * powerpc.cc (Stub_table::do_write): Delete redundant Address
1218 typedef and invalid_address constant.
1219 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
1220 instantiate constants.
1221
db399005
ILT
12222012-12-06 Roland McGrath <mcgrathr@google.com>
1223
1224 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
1225 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
1226 * aclocal.m4: Regenerate.
1227 * configure: Regenerate.
1228 * Makefile.in: Regenerate.
1229 * testsuite/Makefile.in: Regenerate.
1230
aba6bc71
AM
12312012-12-07 Alan Modra <amodra@gmail.com>
1232
1233 * options.h (General_options): Add no_toc_optimize.
1234 * powerpc.cc (ok_lo_toc_insn): New function.
1235 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
1236
9e69ed50
AM
12372012-12-06 Alan Modra <amodra@gmail.com>
1238
1239 * options.h (General_options): Add plt_align, plt_static_chain,
1240 plt_thread_safe. Update stub_group_size help text.
1241 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
1242 for new plt_thread_safe_ var.
1243 (use_plt_offset): Correct comments.
1244 (Target_powerpc::do_relax): Look for thread creation symbols to
1245 determine default plt_thread_safe value. Clear plt call stubs
1246 as well as branch stubs each iteration.
1247 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
1248 insn constants.
1249 (l, hi, ha, write_insn): Move earlier.
1250 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
1251 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
1252 plt stubs too.
1253 (Stub_table::update_size): Adjust.
1254 (Stub_table::prev_size, set_prev_size): Delete.
1255 (Stub_table::stub_align): Let --plt-align affect result.
1256 (Stub_table::plt_call_size): Calculate sizes for various stubs.
1257 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
1258 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
1259 (Stub_table::do_write): Support more stub variants.
1260
f43ba157
AM
12612012-12-04 Alan Modra <amodra@gmail.com>
1262
1263 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
1264 (Target_powerpc::do_define_standard_symbols): New function.
1265
34171bc5
AM
12662012-12-03 Alan Modra <amodra@gmail.com>
1267
1268 * output.h: Formatting, whitespace.
1269
dc9589e9 12702012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
1271
1272 * layout.h (Layout::get_executable_sections): Declare.
1273 * layout.cc (Layout::get_executable_sections): New function.
1274 * arm.cc (Target_arm::group_sections): Use it.
1275 (Arm_output_section::group_sections): Delete now redundant test.
1276 * output.cc (Output_reloc::Output_reloc): Add is_relative.
1277 param to handle relative relocs.
1278 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
1279 (Output_data_reloc::add_absolute): Adjust.
1280 (Output_data_reloc::add_relative): New function.
1281 (Output_data::reset_data_size): New function.
1282 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
1283 (Output_section::set_addralign): New function.
1284 (Output_section::checkpoint_set_addralign): New function.
1285 (Output_section::clear_section_offsets_need_adjustment): New function.
1286 (Output_section::input_sections): Make public.
1287 * powerpc.cc (class Output_data_brlt_powerpc): New.
1288 (class Stub_table, class Stub_control): New.
1289 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
1290 stub_table_, set_stub_table, stub_table): New vectors and accessor
1291 functions.
1292 (Target_powerpc::do_may_relax, do_relax, push_branch,
1293 new_stub_table, stub_tables, brlt_section, group_sections,
1294 add_branch_lookup_table, find_branch_lookup_table,
1295 write_branch_lookup_table, make_brlt_section): New functions.
1296 (Target_powerpc::struct Sort_sections, class Branch_info): New.
1297 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
1298 branch_info_): New vars.
1299 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
1300 make call stubs here.
1301 (Output_data_glink): Remove all call stub handling from this class.
1302 (Target_powerpc::Scan::local, global): Save interesting branch
1303 relocs and relocs for ifunc. Adjust calls to plt entry functions.
1304 (Target_powerpc::do_finalize_sections): Only make reg save/restore
1305 functions on final link.
1306 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
1307 Handle long branch destinations too.
1308 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
1309 do_plt_address_for_local): Adjust lookup of plt call stubs.
1310
627b30b7
AM
13112012-11-30 Alan Modra <amodra@gmail.com>
1312
1313 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
1314 relocs against protected symbols when building 32-bit shared libs.
1315
40b469d7
AM
13162012-11-30 Alan Modra <amodra@gmail.com>
1317
1318 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
1319 param. Call got_section() to make .got. Update all callers
1320 and their callers and so on.
1321
bb66a627
AM
13222012-11-30 Alan Modra <amodra@gmail.com>
1323
1324 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
1325 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
1326 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
1327 value if it already exists.
1328
d2cf1c6c
L
13292012-11-19 H.J. Lu <hongjiu.lu@intel.com>
1330
1331 PR gold/14858
1332 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
1333
edccdf7c
RM
13342012-11-14 Roland McGrath <mcgrathr@google.com>
1335
1336 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
1337 than bfc instruction for data sandboxing.
1338
6febeb74
AM
13392012-11-08 Alan Modra <amodra@gmail.com>
1340
1341 * po/POTFILES.in: Regenerate.
1342
0a6f1bf2
AM
13432012-11-05 Alan Modra <amodra@gmail.com>
1344
1345 * configure.ac: Apply 2012-09-10 change to config.in here.
1346 * configure: Regenerate.
1347
26a4e9cb
AM
13482012-11-05 Alan Modra <amodra@gmail.com>
1349
1350 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
1351 (struct Opd_ent): Use "Address" rather than "Offset".
1352 (Output_data_got_powerpc::got_base_offset): Return Valtype.
1353 (Target_powerpc::got_section): Make public.
1354 (Target_powerpc::scan_relocs): Move code setting symbols..
1355 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
1356 Create _SDA_BASE_ only when referenced.
1357
cc928013
RM
13582012-11-02 Roland McGrath <mcgrathr@google.com>
1359
1360 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
1361 from last change.
1362
50ed5eb1
RM
13632012-11-01 Roland McGrath <mcgrathr@google.com>
1364
62fe925a
RM
1365 * target.h (Sized_target::relocate_relocs): Use Elf_Off
1366 for offset_in_output_section parameter.
1367 (Sized_target::relocate_special_relocatable): Likewise.
1368 * arm.cc (Target_arm::relocate_relocs): Likewise.
1369 (Target_arm::relocate_special_relocatable): Likewise.
1370 * i386.cc (Target_i386::relocate_relocs): Likewise.
1371 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
1372 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
1373 * target-reloc.h (relocate_relocs): Likewise.
1374 * testsuite/testfile.cc (Target_test): Likewise.
1375 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
1376 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
1377
1378 * system.h: Move inclusion of <clocale> to after <libintl.h> in
1379 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
1380
1381 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
1382 parameter, which is unused in the [!F_SETFD] case.
1383
50ed5eb1
RM
1384 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
1385 SYMNDX to off_t before comparing it to this->data_size().
1386 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
1387 * incremental.cc (Output_section_incremental_inputs::do_write):
1388 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
1389
2cadc0bf
RM
1390 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
1391
3bfcb652
NC
13922012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
1393
1394 * gold.cc (Target_arm::do_adjust_elf_header): Add the
1395 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
1396 in EABI_VER5.
1397
c1a8d56e
CC
13982012-10-29 Cary Coutant <ccoutant@google.com>
1399
1400 * dwp.cc (usage): Add file and exit status parameters;
1401 add --help and --version options.
1402 (print_version): New function.
1403 (main): Add --help and --version options.
1404
b2490a7b
L
14052012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1406
1407 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
1408 final_layout_sequence.txt.
1409 * testsuite/Makefile.in: Regenerated.
1410
aa543512
L
14112012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1412
1413 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
1414 COMPILE generated by automake.
1415 (LINK1): Likewise.
1416 (CXXCOMPILE1): Likewise.
1417 (CXXLINK1): Likewise.
1418 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
1419 (LINK): Likewise.
1420 (CXXCOMPILE): Likewise.
1421 (CXXLINK): Likewise.
1422 * testsuite/Makefile.in: Regenerated.
1423
d361fafb
L
14242012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1425
1426 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
1427 on bad fwrite return.
1428
598c7410
L
14292012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1430
1431 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
1432 on val.
1433
35c813e2
CC
14342012-10-23 Cary Coutant <ccoutant@google.com>
1435
1436 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
1437 * testsuite/Makefile.in: Regenerate.
1438 * testsuite/dwp_test.h: New source file.
1439 * testsuite/dwp_test_1.cc: New source file.
1440 * testsuite/dwp_test_1.s: New source file.
1441 * testsuite/dwp_test_1.sh: New source file.
1442 * testsuite/dwp_test_1b.cc: New source file.
1443 * testsuite/dwp_test_1b.s: New source file.
1444 * testsuite/dwp_test_2.cc: New source file.
1445 * testsuite/dwp_test_2.s: New source file.
1446 * testsuite/dwp_test_2.sh: New source file.
1447 * testsuite/dwp_test_main.cc: New source file.
1448 * testsuite/dwp_test_main.s: New source file.
1449
77429909
CC
14502012-10-23 Cary Coutant <ccoutant@google.com>
1451
1452 * dwp.h: New header file.
1453 * dwp.cc: New source file.
1454 * gold.h: Move shared declarations to system.h.
1455 * system.h: New header file.
1456 * Makefile.am: Add dwp.
1457 * Makefile.in: Regenerate.
1458
ed5d6712
CC
14592012-10-23 Cary Coutant <ccoutant@google.com>
1460
1461 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
1462 Dwarf_info_reader::read_from_pointer.
1463 (Dwarf_pubnames_table::read_header): Likewise.
1464 (Dwarf_pubnames_table::next_name): Likewise.
1465 (Dwarf_die::read_attributes): Likewise.
1466 (Dwarf_die::skip_attributes): Likewise.
1467 (Dwarf_info_reader::read_from_pointer): New function template.
1468 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
1469 (Dwarf_pubnames_table): Likewise.
1470 (Dwarf_info_reader::read_from_pointer): New function template.
1471 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
1472 Dwarf_pubnames_table ctor.
1473
8787852d
CC
14742012-10-23 Cary Coutant <ccoutant@google.com>
1475
1476 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
1477 abbrev_shndx.
1478 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
1479 abbrev_shndx_.
1480 (Dwarf_info_reader::set_abbrev_shndx): New method.
1481 (Dwarf_info_reader::abbrev_shndx_): New data member.
1482
9fc236f3
CC
14832012-10-23 Cary Coutant <ccoutant@google.com>
1484
1485 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
1486 from object, not parameters.
1487 (Dwarf_info_reader::parse): Likewise.
1488 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
1489 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
1490 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
1491 methods.
1492
effe8365
CC
14932012-10-23 Cary Coutant <ccoutant@google.com>
1494
1495 * fileread.cc (Input_file::Input_file): New constructor.
1496 * fileread.h (class Input_file): Add new constructor.
1497
1698990d
AM
14982012-10-18 Alan Modra <amodra@gmail.com>
1499
1500 PR gold/14727
1501 * object.cc (Relobj::is_section_name_included): Also match
1502 .sdata personality section.
1503
168a4726
AM
15042012-10-18 Alan Modra <amodra@gmail.com>
1505
1506 * target-reloc.h (class Default_comdat_behavior): New, package up..
1507 (get_comdat_behaviour): ..this.
1508 (relocate_section): Add Relocate_comdat_behavior template arg,
1509 adjust code to suit.
1510 * arm.cc (Target_arm::relocate_section): Adjust to suit.
1511 (Target_arm::scan_reloc_section): Likewise.
1512 * i386.cc (Target_i386::relocate_section): Likewise.
1513 * sparc.cc (Target_sparc::relocate_section): Likewise.
1514 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
1515 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
1516 * powerpc.cc (class Relocate_comdat_behavior): New.
1517 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
1518 gold::relocate_section with new template arg.
1519
acc276d8
AM
15202012-10-18 Alan Modra <amodra@gmail.com>
1521
1522 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
1523 dynamic relocs for GOT_TPREL got entries, without symbol if
1524 resolving locally.
1525 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
1526 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
1527 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
1528
e10f9870
AM
15292012-10-17 Alan Modra <amodra@gmail.com>
1530
1531 PR gold/14726
1532 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
1533
ae034989
ST
15342012-10-16 Sriraman Tallam <tmsriram@google.com>
1535
1536 * layout.cc (Layout::include_section): Keep sections marked
1537 SHF_EXCLUDE when doing relocatable links.
1538
f3a0ed29
AM
15392012-10-16 Alan Modra <amodra@gmail.com>
1540
1541 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
1542 (Target_powerpc::do_finalize_sections): Call it.
1543 (Output_data_save_res): New class and supporting functions.
1544 (Target_powerpc::symval_for_branch): Only look up .opd entry for
1545 normal symbols defined in object files.
1546
c6de8ed4
AM
15472012-10-12 Alan Modra <amodra@gmail.com>
1548
1549 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
1550 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
1551 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
1552 section if scan_opd_relocs not yet called.
1553 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
1554
03e25981
AM
15552012-10-12 Alan Modra <amodra@gmail.com>
1556
1557 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
1558 add_local_ifunc_entry): Revert last change.
1559 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
1560
c9824451
AM
15612012-10-05 Alan Modra <amodra@gmail.com>
1562
1563 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
1564 do_plt_address_for_global): New functions.
1565 (Output_data_got_powerpc::do_write): Don't segfault when linking
1566 statically.
1567 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
1568 add_local_ifunc_entry): Return true on adding entry..
1569 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
1570 glink->add_entry call. Remove unused symtab param. Adjust calls.
1571 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
1572 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
1573 set up symbols here.
1574 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
1575 syms here. Do so even when no .iplt. Don't segfault when linking
1576 statically.
1577 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
1578 new variants without reloc param.
1579 (Glink_sym_ent::Glink_sym_ent): Likewise.
1580 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
1581 reloc when refs will resolve to plt call stub.
1582 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
1583 R_PPC_PLTREL24 to resolve locally.
1584 (Target_powerpc::Scan::global): Correct ifunc handling.
1585 (Target_powerpc::Relocate::relocate): Correct local sym glink
1586 lookup. Don't destroy "value" when we have a plt call stub,
1587 and when checking plt call validity.
1588 (Target_powerpc::do_dynsym_value): Simplify.
1589
19fec8c1
AM
15902012-10-05 Alan Modra <amodra@gmail.com>
1591
1592 * i386.cc (Output_data_plt_i386::address_for_global,
1593 address_for_local): Add plt offset to returned value. Adjust uses.
1594 * sparc.cc (Output_data_plt_sparc::address_for_global,
1595 address_for_local): Likewise.
1596 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
1597 address_for_local): Likewise.
1598 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
1599 address_for_local): Likewise.
1600 * target.h (Target::plt_address_for_global, plt_address_for_local):
1601 Update comment.
1602 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
1603 (Output_data_got::Got_entry::write): Nor here.
1604 * output.h: Comment fix.
1605
e867b647
WL
16062012-10-02 Jiong Wang <jiwang@tilera.com>
1607
1608 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
1609 global_offset_table_ value for larget got.
1610 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
1611
e5d5f5ed
AM
16122012-09-29 Alan Modra <amodra@gmail.com>
1613
1614 * powerpc.cc (Target_powerpc::iplt_): New output section.
1615 (Target_powerpc::iplt_section, make_iplt_section,
1616 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
1617 (Target_powerpc::make_plt_entry): Handle ifunc syms.
1618 Target_powerpc::plt_entry_count): Count iplt entries too.
1619 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
1620 reloc section in constructor. New params.
1621 (Target_powerpc::make_plt_section): Create reloc section here instead.
1622 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
1623 functions.
1624 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
1625 (Output_data_glink::add_entry, find_entry): New functions to
1626 deal with local syms.
1627 (Glink_sym_ent): Add support for local syms.
1628 (Output_data_glink::do_write): Handle ifunc plt entries.
1629 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
1630 (Target_powerpc::Scan::local, global): Handle ifunc syms.
1631 (Target_powerpc::Relocate::relocate): Likewise.
1632 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
1633
ec4dbad3
AM
16342012-09-25 Alan Modra <amodra@gmail.com>
1635
1636 * object.h (Sized_relobj_file::adjust_local_symbol,
1637 do_adjust_local_symbol): New functions.
1638 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
1639 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
1640 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
1641 and irregular opd entry spacing.
1642 (Powerpc_relobj::do_read_relocs): Add opd size checks.
1643 (Global_symbol_visitor_opd): New functor.
1644 (Target_powerpc::do_finalize_sections): Omit global symbols defined
1645 on deleted opd entries.
1646
5c0b3823
WL
16472012-09-15 Jiong Wang <jiwang@tilera.com>
1648
1649 * tilegx.cc: New file.
1650 * Makefile.am (TARGETSOURCES): Add tilegx.cc
1651 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
1652 * configure.tgt: Add entries for tilegx*.
1653 * configure.ac: Likewise.
1654 * Makefile.in: Rebuild.
1655 * configure: Likewise.
1656 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
1657 tilegx.
1658
bfdfa4cd
AM
16592012-09-13 Alan Modra <amodra@gmail.com>
1660
1661 * target-reloc.h (scan_relocs): Call scan.local for relocs
1662 against symbols in discarded sections. Pass is_discarded
1663 param.
1664 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
1665 Add is_discarded param.
1666 * powerpc (Target_powerpc::Scan::local): Likewise. Use
1667 is_discarded to flag opd entry as discarded. Don't emit dyn
1668 relocs on such entries.
1669 (Target_powerpc::Scan::global): Similarly detect and handle
1670 such opd entries.
1671 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
1672 opd_ent_. Update all uses.
1673 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
1674 (Target_powerpc::relocate_section): Zero out discarded opd
1675 entry relocs.
1676
d77a0555
ILT
16772012-09-12 Ian Lance Taylor <iant@google.com>
1678
1679 PR gold/14570
1680 * output.cc: Rename Output_data_got template parameter from size
1681 to got_size for all functions. Compile all variants of
1682 Output_data_got.
1683 (Output_data_got::Got_entry::write): Correct use of size for
1684 symbol value. Use local_is_tls rather than casting to
1685 Sized_relobj_file.
1686 * object.h (class Object): Add local_is_tls and do_local_is_tls.
1687 (class Sized_relobj_file): Add do_local_is_tls.
1688 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
1689
815a1205
AM
16902012-09-11 Alan Modra <amodra@gmail.com>
1691
1692 PR gold/14566
1693 * layout.cc (Layout::set_segment_offsets): When using
1694 common-page-size alignment, ensure we are on a new max-page-size
1695 page.
1696 * output.cc (Output_segment::set_section_addresses): Use
1697 abi_pagesize, not common_pagesize for relro boundary.
1698 (Output_segment::set_offset): Likewise.
1699
bd73a62d
AM
17002012-09-11 Alan Modra <amodra@gmail.com>
1701
1702 * output.h (Output_data_got::add_global_tls, add_local_tls,
1703 add_local_tls_pair): New functions.
1704 (Output_data_got::add_local_pair_with_rel): Remove second
1705 reloc param. Expand comment.
1706 (Output_data_got::Got_entry): Rename use_plt_offset_ to
1707 use_plt_or_tls_offset_, similarly for constructor param.
1708 (Output_data_got::Got_entry::write): Add got_index param.
1709 * output.cc (Output_data_got::add_global_tls, add_local_tls,
1710 add_local_tls_pair): New functions.
1711 (Output_data_got::Got_entry::write): Handle tls symbols
1712 with use_plt_or_tls_offset_ set specially.
1713 (Output_data_got::add_local_pair_with_rel): Only one reloc.
1714 (Output_data_got::do_write): Replace iterator with index, pass
1715 index to entry write function.
1716 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
1717 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
1718 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
1719 call.
1720 * i386.cc (Target_i386::Scan::local): Likewise.
1721 * sparc.cc (Target_sparc::Scan::local): Likewise.
1722 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
1723 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
1724 do_tls_offset_for_global): New functions.
1725 (Target_powerpc::Scan::local): Correct TLS relocations and got
1726 entry values.
1727 (Target_powerpc::Scan::global): Don't emit unnecessary
1728 dynamic relocations on TLS GOT entries.
1729
00716ab1
AM
17302012-09-10 Matthias Klose <doko@ubuntu.com>
1731
1732 * config.in: Disable sanity check for kfreebsd.
1733
c891b3f9
SA
17342012-09-10 Sterling Augustine <saugustine@google.com>
1735
1736 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
1737 (Gdb_index::pubtypes_read): New parameter.
1738 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
1739 to calls.
1740 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
1741 pubtypes_object_.
1742
e81fea4d
AM
17432012-09-09 Alan Modra <amodra@gmail.com>
1744
1745 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
1746 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
1747 * gc.h (gc_process_relocs): Call target gc_add_reference.
1748 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
1749 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
1750 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
1751 unnecessary cast.
1752 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
1753 to cater for when we don't need code offset. Update use.
1754 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
1755 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
1756 set_opd_valid): New functions.
1757 (Target_powerpc::do_gc_add_reference): New function.
1758 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
1759 stashed refs.
1760 (Target_powerpc::do_gc_mark_symbol): New function.
1761
d2d60eef
CC
17622012-09-06 Cary Coutant <ccoutant@google.com>
1763
1764 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
1765 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
1766 (Dwarf_die::skip_attributes): Likewise.
1767 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
1768 * testsuite/gdb_index_test.cc (inline_func_1): New function.
1769 (main): Call it.
1770 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
1771
32ed4573
L
17722012-09-05 H.J. Lu <hongjiu.lu@intel.com>
1773
1774 * testsuite/script_test_3.t: Add .got.plt output section
1775 statement.
1776 * testsuite/script_test_4.t: Likewise.
1777
f4baf0d4
AM
17782012-09-05 Alan Modra <amodra@gmail.com>
1779
1780 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
1781 update all uses and lose "enum" when using type.
1782
864a1b56
AM
17832012-09-05 Alan Modra <amodra@gmail.com>
1784
1785 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
1786 * configure: Regenerate.
1787 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
1788 (plugin_final_layout.stdout): Likewise.
1789 (memory_test): Set page sizes to 0x1000.
1790 * testsuite/Makefile.in: Regenerate.
1791 * testsuite/discard_locals_test.sh: Add FIXME comment.
1792 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
1793 * testsuite/pr14265.t: Add .got output section statement.
1794 * testsuite/script_test_2.t: Likewise.
1795 * testsuite/script_test_3.t: Likewise.
1796 * testsuite/script_test_4.t: Likewise.
1797 * testsuite/script_test_5.t: Likewise.
1798 * testsuite/script_test_6.t: Likewise.
1799 * testsuite/script_test_7.t: Likewise.
1800 * testsuite/script_test_9.t: Likewise.
1801
3ea0a085
AM
18022012-09-05 Alan Modra <amodra@gmail.com>
1803
1804 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
1805 (Powerpc_relocate_functions::Status): New typedef.
1806 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
1807 (Target_powerpc::Scan::local): Handle REL64.
1808 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
1809 for REL32 and REL64.
1810 (Target_powerpc::symval_for_branch): New function, extracted from..
1811 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
1812 checks. Report overflow errors.
1813
7404fe1b
AM
18142012-09-05 Alan Modra <amodra@gmail.com>
1815
1816 * object.h (Sized_relobj_file::emit_relocs): Delete.
1817 (Sized_relobj_file::emit_relocs_reltype): Delete.
1818 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
1819 relocate_relocs for --emit-relocs.
1820 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
1821 * output.h: Update comment.
1822 (Output_segment::first_section): New function.
1823 (Output_segment::first_section_load_address): Use first_section.
1824 * output.cc (Output_segment::first_section): New function extracted..
1825 (Output_segment::first_section_load_address): ..from here. Delete.
1826 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
1827 * target.h (Sized_target::relocate_for_relocatable): Likewise.
1828 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
1829 adjust call to target.h function.
1830 * i386.cc (Target_i386): Likewise.
1831 * sparc.cc (Target_sparc): Likewise.
1832 * x86_64.cc (Target_x86_64): Likewise.
1833 * powerpc.cc (Target_powerpc): Likewise.
1834 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
1835 first tls section has section symbol for optimised local dynamic
1836 output relocs.
1837 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
1838 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
1839 optimised tls code.
1840 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
1841 Rename to relocate_relocs. Update error message.
1842
957564c9
AS
18432012-09-04 Andreas Schwab <schwab@linux-m68k.org>
1844
1845 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
1846 --just-symbols.
1847
dd93cd0a
AM
18482012-08-31 Alan Modra <amodra@gmail.com>
1849
1850 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
1851 (Powerpc_relobj::toc_base_offset): New stub function.
1852 (Target_powerpc): Add tp_offset, dtp_offset. Rename
1853 got_mod_index_offset to tlsld_got_offset. Update all refs.
1854 (Target_powerpc::Relocate::enum skip_tls): New.
1855 (Target_powerpc::call_tls_get_addr_): New var.
1856 (Target_powerpc::is_branch_reloc): Move to file scope.
1857 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
1858 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
1859 New functions.
1860 (Target_powerpc::enum Got_type): Delete old values, add new ones.
1861 (powerpc_info): Correct common_pagesize for ppc64.
1862 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
1863 (Powerpc_relocate_functions): Add overflow check enums and functions.
1864 Add non-shift version of rela, rela_ua. Delete all rel public
1865 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
1866 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
1867 addr16_ha3, addr14 functions.
1868 (Output_data_got_powerpc::add_constant_pair): New function.
1869 (Output_data_got_powerpc::got_base_offset): Likewise.
1870 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
1871 (instruction constants): Sort, add some more.
1872 (Output_data_glink::do_write): Add and use Address typedef. Use
1873 object->toc_base_offset() stub for 64-bit.
1874 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
1875 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
1876 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
1877 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
1878 Always treat .opd relocs as against locally defined symbol.
1879 Correct condition for RELATIVE relocs.
1880 (Target_powerpc::do_finalize_sections): Test for NULL sections.
1881 (Target_powerpc::Relocate::relocate): Use plt call stub as value
1882 for 32-bit syms with a plt entry. Correct ppc64 toc base
1883 calculations. Handle TLS relocs, and more. Add overflow
1884 checking and adjust for Powerpc_relocate_functions changes.
1885 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
1886 Reinstate --emit-relocs code with FIXME.
1887
a1373b60
AM
18882012-08-30 Alan Modra <amodra@gmail.com>
1889
1890 * layout.cc (Layout::set_segment_offsets): Set p_align to
1891 abi_pagesize, not common_pagesize.
1892 (Layout::relaxation_loop_body): Similarly use abi_pagesize
1893 to determine whether file header can go in segment.
1894
703d02da
AM
18952012-08-30 Alan Modra <amodra@gmail.com>
1896
1897 * output.h (Output_reloc::Output_reloc <output section>): Add
1898 is_relative param. Adjust calls.
1899 (Output_reloc::add_output_section_relative): New functions.
1900 * output.cc (Output_reloc::Output_reloc <output section>): Handle
1901 is_relative.
1902 (Output_reloc::symbol_value): Handle SECTION_CODE.
1903
16164a6b
ST
19042012-08-24 Sriraman Tallam <tmsriram@google.com>
1905
1906 * gold.cc (queue_middle_tasks): Call layout again when unique
1907 segments for sections is desired.
1908 * layout.cc (Layout::Layout): Initialize new members.
1909 (Layout::get_output_section_flags): New function.
1910 (Layout::choose_output_section): Call get_output_section_flags.
1911 (Layout::layout): Make output section for mapping to a unique segment.
1912 (Layout::insert_section_segment_map): New function.
1913 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 1914 output sections marked so.
16164a6b
ST
1915 (Layout::segment_precedes): Check for unique segments when sorting.
1916 * layout.h (Layout::Unique_segment_info): New struct.
1917 (Layout::Section_segment_map): New typedef.
1918 (Layout::insert_section_segment_map): New function.
1919 (Layout::get_output_section_flags): New function.
1920 (Layout::is_unique_segment_for_sections_specified): New function.
1921 (Layout::set_unique_segment_for_sections_specified): New function.
1922 (Layout::unique_segment_for_sections_specified_): New member.
1923 (Layout::section_segment_map_): New member.
1924 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
1925 Rename is_gc_pass_one to is_pass_one.
1926 Rename is_gc_pass_two to is_pass_two.
1927 Rename is_gc_or_icf to is_two_pass.
1928 Check for which pass based on whether symbols data is present.
1929 Make it two pass when unique segments for sections is desired.
1930 * output.cc (Output_section::Output_section): Initialize new
1931 members.
1932 * output.h (Output_section::is_unique_segment): New function.
1933 (Output_section::set_is_unique_segment): New function.
1934 (Output_section::is_unique_segment_): New member.
1935 (Output_section::extra_segment_flags): New function.
1936 (Output_section::set_extra_segment_flags): New function.
1937 (Output_section::extra_segment_flags_): New member.
1938 (Output_section::segment_alignment): New function.
1939 (Output_section::set_segment_alignment): New function.
1940 (Output_section::segment_alignment_): New member.
1941 (Output_segment::Output_segment): Initialize is_unique_segment_.
1942 (Output_segment::is_unique_segment): New function.
1943 (Output_segment::set_is_unique_segment): New function.
1944 (Output_segment::is_unique_segment_): New member.
1945 * plugin.cc (allow_unique_segment_for_sections): New function.
1946 (unique_segment_for_sections): New function.
1947 (Plugin::load): Add new functions to transfer vector.
1948 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
1949 * Makefile.in: Regenerate.
1950 * testsuite/plugin_final_layout.sh: Check if unique segment
1951 functionality works.
1952 * testsuite/plugin_section_order.c (onload): Check if new interfaces
1953 are available.
1954 (allow_unique_segment_for_sections): New global.
1955 (unique_segment_for_sections): New global.
1956 (claim_file_hook): Call allow_unique_segment_for_sections.
1957 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 1958
1e2bee4f
CC
19592012-08-22 Cary Coutant <ccoutant@google.com>
1960
1961 * layout.cc (Layout::include_section): Don't assert on GROUP
1962 sections with --emit-relocs.
1963
1d5dfe78
CC
19642012-08-21 Cary Coutant <ccoutant@google.com>
1965
1966 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
1967 if --export-dynamic-symbol names an undef symbol.
1968
c9269dff
AM
19692012-08-18 Alan Modra <amodra@gmail.com>
1970
1971 * powerpc.cc: Formatting and white space.
1972 (Powerpc_relobj): Rename got2_section_ to special_.
1973 Add opd_ent_shndx_ and opd_ent_off_ vectors.
1974 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
1975 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
1976 (Target_powerpc): Add Address typedef and invalid_address. Use
1977 throughout.
1978 (Target_powerpc::is_branch_reloc): New function.
1979 (Powerpc_relocate_functions): Add Address typedef, use throughout.
1980 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
1981 for dst_mask, value and addend.
1982 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
1983 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
1984 (Output_data_glink::do_write): Correct toc base. Don't try to use
1985 uint16_t for 24-bit offset. Use get_output_section_offset and
1986 check return.
1987 (Target_powerpc::Scan::local): Handle more relocs.
1988 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
1989 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
1990 Plug in toc restoring insn after plt calls. Translate branches
1991 to function descriptor symbols to corresponding entry point.
1992 (Target_powerpc::relocate_for_relocatable): Check return from
1993 get_output_section_offset.
1994 * symtab.h: Comment typo.
1995
b1759dce
ILT
19962012-08-14 Ian Lance Taylor <iant@google.com>
1997
1998 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
1999 unsupported_relocal_local to call unsupported_reloc_global.
2000
b9b2ae8b
NC
20012012-08-14 Nick Clifton <nickc@redhat.com>
2002
2003 PR ld/14265
2004 * script-sections.cc (Sections_element::output_section_name): Add
2005 keep return parameter.
2006 (Output_section_element::match_name): Add keep return parameter.
2007 Return the value of the keep_ member.
2008 * script-sections.h (class Output_section): Update
2009 output_section_name prototype.
2010 * layout.cc (Layout::keep_input_section): New public member
2011 function.
2012 (Layout::choose_output_section): Pass keep parameter to
2013 output_section_name.
2014 * layout.h (class Layout): Add keep_input_section.
2015 * object.cc (Sized_relobj_file::do_layout): Check for kept input
2016 sections.
2017 * testsuite/Makefile.am: Add a test.
2018 * testsuite/Makefile.in: Regenerate.
2019 * testsuite/pr14265.c: Source file for the test.
2020 * testsuite/pr14265.t: Linker script for the test.
2021 * testsuite/pr14265.sh: Shell script for the test.
2022
921b5322
AM
20232012-08-14 Alan Modra <amodra@gmail.com>
2024
2025 * target.h (Target::output_section_name): New function.
2026 (Target::do_output_section_name): New function.
2027 * layout.cc (Layout::choose_output_section): Call the above.
2028 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
2029
6ce78956
AM
20302012-08-14 Alan Modra <amodra@gmail.com>
2031
2032 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
2033 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
2034 for replace_constant call.
2035 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
2036 (Output_data_glink::do_print_to_mapfile): New function.
2037 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
2038 (Target_powerpc::Relocate::relocate): Likewise.
2039
d1a8cabd
AM
20402012-08-14 Alan Modra <amodra@gmail.com>
2041
2042 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
2043 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
2044 (Output_data_glink::add_entry,find_entry): Remove shndx param.
2045 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
2046 all references to shndx_. Handle special case for R_PPC_PLTREL24
2047 here.
2048 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
2049 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
2050 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
2051 here.
2052 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
2053 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
2054
d83ce4e3
AM
20552012-08-12 Alan Modra <amodra@gmail.com>
2056
2057 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
2058 (glink insn constants): Use uint32_t.
2059 (Output_data_glink::add_entry): Use insert, not [] operator.
2060
cf43a2fe
AM
20612012-08-11 Alan Modra <amodra@gmail.com>
2062
2063 * object.h (Sized_relobj_file::find_shdr): New function.
2064 (Sized_relobj_file::find_special_sections): New function.
2065 * object.cc (Sized_relobj_file::find_shdr): New function.
2066 (Sized_relobj_file::find_eh_frame): Use find_shdr.
2067 (Sized_relobj_file::find_special_sections): New function, split out..
2068 (Sized_relobj_file::do_read_symbols): ..from here.
2069 * output.h (Output_data_got::replace_constant): New function.
2070 (Output_data_got::num_entries): New function.
2071 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
2072 (Output_data_got::got_offset): Protected rather than private.
2073 (Output_data_got::replace_got_entry): New function.
2074 * output.cc (Output_data_got::replace_got_entry): New function.
2075 * powerpc.cc (class Powerpc_relobj): New.
2076 (class Powerpc_relocate_functions): Delete all psymval variants or
2077 convert to value,addend type. Delete pcrela, pcrela_unaligned.
2078 Implement _ha functions using corresponding _hi function.
2079 (Powerpc_relobj::find_special_sections): New function.
2080 (Target_powerpc::do_make_elf_object): New function.
2081 (class Output_data_got_powerpc): New.
2082 (class Output_data_glink): New.
2083 (class Powerpc_scan_relocatable_reloc): New.
2084 Many more changes througout file.
2085
3c892704
NC
20862012-08-09 Nick Clifton <nickc@redhat.com>
2087
2088 * po/vi.po: Updated Vietnamese translation.
2089
82435b3b
ILT
20902012-08-07 Ian Lance Taylor <iant@google.com>
2091
2092 * layout.cc (Layout::add_target_dynamic_tags): If
2093 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
2094 plt_rel.
2095
a6dc81d2
NC
20962012-07-30 Nick Clifton <nickc@redhat.com>
2097
2098 * po/gold.pot: Updated template.
2099 * po/es.po: Updated Spanish translation.
2100
f1415016
CC
21012012-07-18 Cary Coutant <ccoutant@google.com>
2102
2103 PR gold/14344
2104 * configure.ac: Add check for -gpubnames support.
2105 * configure: Regenerate.
2106 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
2107 support; force -gno-pubnames.
2108 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
2109 support.
2110 (gdb_index_test_4): New test.
2111 * testsuite/Makefile.in: Regenerate.
2112 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
2113 * testsuite/gdb_index_test_2.sh: Likewise.
2114 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
2115 * testsuite/gdb_index_test_4.sh: New script.
2116 * testsuite/gdb_index_test_comm.sh: New script with common code;
2117 don't look for space after colon.
2118
b7fd7c37
ST
21192012-07-16 Sriraman Tallam <tmsriram@google.com>
2120
2121 * gold.cc (queue_middle_tasks): Update function order only after
2122 deferred objects due to plugins are processed.
2123
1f3212db
ILT
21242012-07-11 Ian Lance Taylor <iant@google.com>
2125
2126 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
2127 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
2128 (Target_arm::scan_reloc_for_stub): Likewise.
2129 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
2130 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
2131 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
2132 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
2133 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
2134
81c82a68
ILT
21352012-07-10 Dodji Seketeli <dodji@redhat.com>
2136 Ian Lance Taylor <iant@google.com>
2137
2138 PR gold/14309
2139 * configure.ac: Test whether std::tr1::hash<off_t> works.
2140 * gold.h: Add a specialization for std::tr1::hash<off_t> if
2141 needed.
2142 * output.h (class Output_fill): Add virtual destructor.
2143 * configure, config.in: Rebuild.
2144
eabc84f4
RM
21452012-06-22 Roland McGrath <mcgrathr@google.com>
2146
2147 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
2148
370e30b6
RÁE
21492012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
2150
2151 * plugin.cc (Plugin::load): Handle position independent executables.
2152
fb1b895d
CC
21532012-06-06 Cary Coutant <ccoutant@google.com>
2154
2155 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
2156 add .debug_macro.
2157 (lines_only_debug_sections): Likewise.
2158 (gdb_fast_lookup_sections): New static array.
2159 (is_gdb_debug_section): Rename formal parameter.
2160 (is_lines_only_debug_section): Likewise.
2161 (is_gdb_fast_lookup_section): New function.
2162 (Layout::include_section): Check for ".zdebug_" prefix; pass
2163 section name suffix to is_gdb_debug_section, et al.; check for
2164 fast-lookup sections when building .gdb_index.
2165 * options.h (--strip-debug-gdb): Update GDB version number.
2166
7c0640fa
CC
21672012-06-06 Cary Coutant <ccoutant@google.com>
2168
2169 * configure.ac: Add check for fallocate.
2170 * configure: Regenerate.
2171 * config.in: Regenerate.
2172
2173 * options.h (class General_options): Add --mmap-output-file and
2174 --posix-fallocate options.
2175 * output.cc: (posix_fallocate): Remove; replace with...
2176 (gold_fallocate): New function.
2177 (Output_file::map_no_anonymous): Call gold_fallocate.
2178 (Output_file::map): Check --mmap-output-file option.
2179
2a49eb69
DK
21802012-06-05 Jing Yu <jingyu@google.com>
2181
2182 * gold.h (textdomain): Add do {} to empty while(0).
2183 (bindtextdomain): Likewise.
2184
fad072ac
CC
21852012-06-04 Cary Coutant <ccoutant@google.com>
2186
2187 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
2188 has_dynsym_index.
2189
8cc69fb6
ST
21902012-05-25 Sriraman Tallam <tmsriram@google.com>
2191
2192 * symtab.cc (Symbol_table::define_special_symbol):
2193 Initialize *poldsym to prevent uninitialized variable errors.
2194
1be75daa
CC
21952012-05-23 Cary Coutant <ccoutant@google.com>
2196
2197 * layout.cc (Layout::section_name_mapping): Add rules to handle
2198 exact match on .data.rel.ro.local or .data.rel.ro.
2199 (Layout::output_section_name): Check for exact matches.
2200
9b689de0
CC
22012012-05-23 Cary Coutant <ccoutant@google.com>
2202
2203 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
2204 more carefully.
2205
b24fdbf5
CC
22062012-05-22 Cary Coutant <ccoutant@google.com>
2207
2208 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
2209 object before exporting symbol.
2210
e550e1a2
L
22112012-05-21 H.J. Lu <hongjiu.lu@intel.com>
2212
2213 * testsuite/tls_test.cc: Include "config.h" first.
2214 * testsuite/tls_test_c.c: Likewise.
2215
df7b86aa
NC
22162012-05-17 Daniel Richard G. <skunk@iskunk.org>
2217 Nick Clifton <nickc@redhat.com>
2218
2219 PR 14072
2220 * configure.in: Add check that sysdep.h has been included before
2221 any system header files.
2222 * configure: Regenerate.
2223 * config.in: Regenerate.
2224
1007b503
CC
22252012-05-14 Cary Coutant <ccoutant@google.com>
2226
2227 * layout.cc (Layout::make_output_section): Mark .tdata section
2228 as RELRO.
2229 * testsuite/relro_test.cc: Add a TLS variable.
2230
fd885f3a
L
22312012-05-10 H.J. Lu <hongjiu.lu@intel.com>
2232
2233 PR gold/14091
2234 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
2235 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
2236 R_X86_64_64.
2237
80f5885c
CC
22382012-05-08 Cary Coutant <ccoutant@google.com>
2239
2240 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
2241 (lines_only_debug_sections): Likewise.
2242
2e702c99
RM
22432012-05-02 Roland McGrath <mcgrathr@google.com>
2244
2245 * nacl.cc: New file.
2246 * nacl.h: New file.
2247 * Makefile.am (CCFILES, HFILES): Add them.
2248 * Makefile.in: Regenerate.
2249 * i386.cc (Output_data_plt_i386_nacl): New class.
2250 (Output_data_plt_i386_nacl_exec): New class.
2251 (Output_data_plt_i386_nacl_dyn): New class.
2252 (Target_i386_nacl): New class.
2253 (Target_selector_i386_nacl): New class.
2254 (target_selector_i386): Use it instead of Target_selector_i386.
2255 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
2256 (Target_x86_64_nacl): New class.
2257 (Target_selector_x86_64_nacl): New class.
2258 (target_selector_x86_64, target_selector_x32): Use it instead of
2259 Target_selector_x86_64.
2260 * arm.cc (Output_data_plt_arm_nacl): New class.
2261 (Target_arm_nacl): New class.
2262 (Target_selector_arm_nacl): New class.
2263 (target_selector_arm, target_selector_armbe): Use it instead of
2264 Target_selector_arm.
2265
2266 * target-select.cc (select_target): Take new Input_file* and off_t
2267 arguments, pass them on to recognize method of selector.
2268 * object.cc (make_elf_sized_object): Update caller.
2269 * parameters.cc (parameters_force_valid_target): Likewise.
2270 * incremental.cc (make_sized_incremental_binary): Likewise.
2271 * target-select.h: Update decl.
2272 (Target_selector::recognize): Take new Input_file* argument,
2273 pass it on to do_recognize.
2274 (Target_selector::do_recognize): Take new Input_file* argument.
2275 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
2276 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
2277 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
2278 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
2279
2280 * target.h (Target::Target_info): New members isolate_execinstr
2281 and rosegment_gap.
2282 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
2283 * arm.cc (Target_arm::arm_info): Update initializer.
2284 * i386.cc (Target_i386::i386_info): Likewise.
2285 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
2286 * sparc.cc (Target_sparc::sparc_info): Likewise.
2287 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
2288 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2289 * layout.cc (Layout::attach_allocated_section_to_segment):
2290 Take new const Target* argument. If target->isolate_execinstr(), act
2291 like --rosegment.
2292 (Layout::find_first_load_seg): Take new const Target* argument;
2293 if target->isolate_execinstr(), reject PF_X segments.
2294 (Layout::relaxation_loop_body): Update caller.
2295 (Layout::set_segment_offsets): If target->isolate_execinstr(),
2296 reset file offset to zero when we hit LOAD_SEG, and then do a second
2297 loop over the segments before LOAD_SEG to reassign offsets after
2298 addresses have been determined. Handle target->rosegment_gap().
2299 (Layout::attach_section_to_segment): Take new const Target* argument;
2300 pass it to attach_allocated_section_to_segment.
2301 (Layout::make_output_section): Update caller.
2302 (Layout::attach_sections_to_segments): Take new const Target* argument;
2303 pass it to attach_section_to_segment.
2304 * gold.cc (queue_middle_tasks): Update caller.
2305 * layout.h (Layout): Update method decls with new arguments.
2306
2307 * arm.cc (Target_arm::Target_arm): Take optional argument for the
2308 Target_info pointer to use.
2309 (Target_arm::do_make_data_plt): New virtual method.
2310 (Target_arm::make_data_plt): New method that calls it.
2311 (Target_arm::make_plt_entry): Use it.
2312 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
2313 for the section alignment.
2314 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
2315 method.
2316 (Output_data_plt_arm::first_plt_entry_offset): Call it.
2317 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
2318 method.
2319 (Output_data_plt_arm::get_plt_entry_size): Call it.
2320 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
2321 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
2322 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
2323 method.
2324 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
2325 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
2326 method instead of sizeof(plt_entry).
2327 (Output_data_plt_arm::add_entry): Likewise.
2328 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
2329 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
2330 than static method.
2331 (Target_arm::plt_entry_size): Likewise.
2332 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
2333 Move to ...
2334 (Output_data_plt_arm_standard): ... here, new class.
2335 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
2336 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
2337 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
2338
2339 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
2340 Take additional argument for the PLT entry size.
2341 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
2342 Use get_plt_entry_size method rather than plt_entry_size variable.
2343 (Output_data_plt_x86_64::reserve_slot): Likewise.
2344 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
2345 (Output_data_plt_x86_64::add_entry): Likewise.
2346 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
2347 (Output_data_plt_x86_64::address_for_global): Likewise.
2348 (Output_data_plt_x86_64::address_for_local): Likewise.
2349 (Output_data_plt_x86_64::set_final_data_size): Likewise.
2350 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
2351 Make method non-static.
2352 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
2353 method.
2354 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
2355 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
2356 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
2357 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
2358 virtual method.
2359 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
2360 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
2361 virtual method.
2362 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
2363 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
2364 virtual method.
2365 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
2366 (Output_data_plt_x86_64::plt_entry_size)
2367 (Output_data_plt_x86_64::first_plt_entry)
2368 (Output_data_plt_x86_64::plt_entry)
2369 (Output_data_plt_x86_64::tlsdesc_plt_entry)
2370 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
2371 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
2372 (Output_data_plt_x86_64_standard): ... here, new class.
2373 (Target_x86_64::Target_x86_64): Take optional argument for the
2374 Target_info pointer to use.
2375 (Target_x86_64::do_make_data_plt): New virtual method.
2376 (Target_x86_64::make_data_plt): New method to call it.
2377 (Target_x86_64::init_got_plt_for_update): Use that.
2378 Call this->plt_->add_eh_frame method here.
2379 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
2380 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
2381 rather than static method.
2382 (Target_x86_64::plt_entry_size): Likewise.
2383 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
2384 rather than plt_entry_size variable. Move guts of PLT filling to...
2385 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
2386 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
2387 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
2388
2389 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
2390 additional argument for the section alignment.
2391 Don't do add_eh_frame_for_plt here.
2392 (Output_data_plt_i386::first_plt_entry_offset): Make the method
2393 non-static. Use get_plt_entry_size method rather than plt_entry_size
2394 variable.
2395 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
2396 method.
2397 (Output_data_plt_i386::get_plt_entry_size): Call it.
2398 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
2399 (Output_data_plt_i386::add_eh_frame): New method to call it.
2400 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
2401 method.
2402 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
2403 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
2404 method.
2405 (Output_data_plt_i386::fill_plt_entry): New method to call it.
2406 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
2407 method instead of plt_entry_size.
2408 (Output_data_plt_i386::plt_entry_size)
2409 (Output_data_plt_i386::plt_eh_frame_fde_size)
2410 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
2411 (Output_data_plt_i386_standard): ... here, new class.
2412 (Output_data_plt_i386_exec): New class.
2413 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
2414 (Output_data_plt_i386_exec::first_plt_entry): ... here.
2415 (Output_data_plt_i386::exec_plt_entry): Move to ...
2416 (Output_data_plt_i386_exec::plt_entry): ... here.
2417 (Output_data_plt_i386_dyn): New class.
2418 (Output_data_plt_i386::first_plt_entry): Move to ...
2419 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
2420 (Output_data_plt_i386::dyn_plt_entry): Move to ...
2421 (Output_data_plt_i386_dyn::plt_entry): ... here.
2422 (Target_i386::Target_i386): Take optional argument for the Target_info
2423 pointer to use.
2424 (Target_i386::do_make_data_plt): New virtual method.
2425 (Target_i386::make_data_plt): New method to call it.
2426 (Target_i386::make_plt_section): Use that.
2427 Call this->plt_->add_eh_frame method here.
2428 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
2429 rather than plt_entry_size variable.
2430 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
2431 (Output_data_plt_i386::address_for_local): Likewise.
2432 (Output_data_plt_i386::do_write): Likewise.
2433 Move guts of PLT filling to...
2434 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
2435 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
2436 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
2437 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
2438
b9b9f2ee
CC
24392012-05-01 Cary Coutant <ccoutant@google.com>
2440
2441 * dwarf_reader.cc (Dwarf_die::read_attributes)
2442 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
2443 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
2444 * reduced_debug_output.cc
2445 (Output_reduced_debug_info_section::get_die_end): Remove
2446 DW_FORM_GNU_ref_index. Add default case.
2447
57923f48
MW
24482012-04-26 Mark Wielaard <mjw@redhat.com>
2449
2450 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
2451 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
2452 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
2453 DW_AT_high_pc as offset from DW_AT_low_pc.
2454
2455 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
2456 * testsuite/Makefile.in: Regenerate.
2457 * testsuite/gdb_index_test_3.c: New test source file.
2458 * testsuite/gdb_index_test_3.sh: New test source file.
2459
2c54b4f4
ILT
24602012-04-25 Ian Lance Taylor <iant@google.com>
2461
2462 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
2463 pointer.
2464 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
2465 as a class, not a struct.
2466 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
2467 (Target_arm::apply_cortex_a8_workaround): Likewise.
2468 * gc.h: Declare Reloc_types as a struct, not a class.
2469 * object.h: Declare Symbols_data as a struct.
2470 * reloc.h: Declare Read_relocs_data as a struct.
2471 * target.h: Declare Relocate_info as a struct.
2472
a5a5f7a3
DM
24732012-04-24 David S. Miller <davem@davemloft.net>
2474
2475 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
2476 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
2477 and R_SPARC_WPLT30.
2478
f038d496
CC
24792012-04-24 Cary Coutant <ccoutant@google.com>
2480
2481 * incremental-dump.cc (find_input_containing_global): Replace
2482 magic number with symbolic constant.
2483 (dump_incremental_inputs): Update version number.
2484 * incremental.cc (Output_section_incremental_inputs): Update version
2485 number; import symbolic constants from Incremental_inputs_reader.
2486 (Incremental_inputs::create_data_sections): Align relocations
2487 section correctly for 64-bit targets.
2488 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
2489 constants; add padding.
2490 (Output_section_incremental_inputs::write_header): Add assert for
2491 header_size.
2492 (Output_section_incremental_inputs::write_input_files): Add assert
2493 for input_entry_size.
2494 (Output_section_incremental_inputs::write_info_blocks): Add padding;
2495 add assert for object_info_size, input_section_entry_size,
2496 global_sym_entry_size.
2497 * incremental.h (Incremental_inputs_reader): Add symbolic constants
2498 for data structure sizes; use them.
2499 (Incremental_input_entry_reader): Import symbolic constants from
2500 Incremental_inputs_reader; use them.
2501
a4d85145
DM
25022012-04-23 David S. Miller <davem@davemloft.net>
2503
2504 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
2505 and elf_flags_set_.
2506 (Target_sparc::Target_sparc): Initialize new fields.
2507 (Target_sparc::do_make_elf_object): New function.
2508 (Target_sparc::do_adjust_elf_header): New function.
2509
1d509098
CC
25102012-04-23 Cary Coutant <ccoutant@google.com>
2511
2512 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
2513 CU range table of gdb index.
2514
7ebeff7f
DM
25152012-04-20 David S. Miller <davem@davemloft.net>
2516
2517 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
2518 instead of false.
2519
13cf9988
DM
25202012-04-16 David S. Miller <davem@davemloft.net>
2521
2a1079e8
DM
2522 * sparc.cc (Target_sparc::got_address): New function.
2523 (Sparc_relocate_functions::gdop_hix22): New function.
2524 (Sparc_relocate_functions::gdop_lox10): New function.
2525 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
2526 relocs.
2527 (Target_sparc::Scan::local): Likewise if the global symbol is not
2528 preemptible and is not IFUNC.
2529 (Target_sparc::Relocate::relocate): Perform GOTDATA code
2530 transformations for local and non-preemptible non-IFUNC global
2531 symbols.
2532
0bc964fc
DM
2533 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
2534 writing out 64-bit part of ranges.
2535
661d7a80
DM
2536 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
2537 -fpic and -fpie respectively.
2538 * Makefile.in: Regenerate.
2539
8c2bf391
DM
2540 * sparc.cc (class Target_sparc): Add rela_ifunc_.
2541 (Target_sparc::Target_sparc): Initialize new field.
2542 (Target_sparc::do_plt_section_for_global): New function.
2543 (Target_sparc::do_plt_section_for_local): New function.
2544 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
2545 (Target_sparc::make_plt_section): New function, broken out of
2546 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
2547 (Target_sparc::make_plt_entry): Call make_plt_section.
2548 (Target_sparc::make_local_ifunc_plt_entry): New function.
2549 (Target_sparc::rela_ifunc_section): New function.
2550 (Target_sparc::plt_section): Remove const.
2551 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
2552 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
2553 and ifunc_count_ fields.
2554 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
2555 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
2556 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
2557 (Output_data_plt_sparc::rela_ifunc): New function.
2558 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
2559 (Output_data_plt_sparc::has_ifunc_section): New function.
2560 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
2561 (Output_data_plt_sparc::address_for_global): New function.
2562 (Output_data_plt_sparc::address_for_local): New function.
2563 (Output_data_plt_sparc::plt_index_to_offset): New function.
2564 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
2565 and entry_count.
2566 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
2567 entry_count.
2568 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
2569 R_SPARC_JMP_IREL to switch.
2570 (Target_sparc::Scan::check_non_pic): Likewise.
2571 (Target_sparc::Scan::local): Handle IFUNC symbols.
2572 (Target_sparc::Scan::local): Likewise.
2573 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
2574 and plt_address_for_local.
2575 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
2576 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
2577
13cf9988
DM
2578 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
2579 (class Output_data_reloc): Adjust calls to Output_reloc_type.
2580 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
2581 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
2582 global relocs too.
2583 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
2584 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
2585 calls.
2586 * sparc.cc (Target_sparc::Scan::global): Likewise.
2587 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
2588
31821be0
CC
25892012-04-16 Cary Coutant <ccoutant@google.com>
2590
2591 * archive.cc (Library_base::should_include_member): Check for
2592 --export-dynamic-symbol.
2593 * options.h (class General_options): Add --export-dynamic-symbol.
2594 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
2595 --export-dynamic-symbol.
2596 (Symbol_table::gc_mark_undef_symbols): Likewise.
2597 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
2598
2615994e
DM
25992012-04-12 David S. Miller <davem@davemloft.net>
2600
2601 * sparc.cc (Reloc::wdisp10): New relocation method.
2602 (Reloc::h34): Likewise.
2603 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
2604 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
2605 R_SPARC_WDISP10.
2606 (Target_sparc::Scan::local): Likewise.
2607 (Target_sparc::Scan::global): Likewise.
2608 (Target_sparc::Relocate::relocate): Likewise.
2609
6782735d
CC
26102012-04-09 Cary Coutant <ccoutant@google.com>
2611
2612 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
2613 low_pc == 0.
2614
8c7a0b00
ILT
26152012-04-06 Ian Lance Taylor <iant@google.com>
2616
2617 * timer.cc: #include <unistd.h>.
2618
58797674
RM
26192012-04-06 Roland McGrath <mcgrathr@google.com>
2620
2621 * configure.in (AC_CHECK_HEADERS): Add locale.h.
2622 * config.in: Regenerate.
2623 * configure: Regenerate.
2624
44350750
NC
26252012-04-05 Nick Clifton <nickc@redhat.com>
2626
2627 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
2628 (AM_LC_MESSAGES): Add.
2629 * aclocal.m4: Regenerate.
2630 * config.in: Regenerate.
2631 * configure: Regenerate.
2632
c1027032
CC
26332012-03-21 Cary Coutant <ccoutant@google.com>
2634
2635 * Makefile.am: Add gdb-index.cc, gdb-index.h.
2636 * Makefile.in: Regenerate.
2637 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
2638 (Sized_elf_reloc_mapper::symbol_section): New function.
2639 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
2640 (make_elf_reloc_mapper): New function.
2641 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
2642 (Dwarf_abbrev_table::do_read_abbrevs): New function.
2643 (Dwarf_abbrev_table::do_get_abbrev): New function.
2644 (Dwarf_ranges_table::read_ranges_table): New function.
2645 (Dwarf_ranges_table::read_range_list): New function.
2646 (Dwarf_pubnames_table::read_section): New function.
2647 (Dwarf_pubnames_table::read_header): New function.
2648 (Dwarf_pubnames_table::next_name): New function.
2649 (Dwarf_die::Dwarf_die): New function.
2650 (Dwarf_die::read_attributes): New function.
2651 (Dwarf_die::skip_attributes): New function.
2652 (Dwarf_die::set_name): New function.
2653 (Dwarf_die::set_linkage_name): New function.
2654 (Dwarf_die::attribute): New function.
2655 (Dwarf_die::string_attribute): New function.
2656 (Dwarf_die::int_attribute): New function.
2657 (Dwarf_die::uint_attribute): New function.
2658 (Dwarf_die::ref_attribute): New function.
2659 (Dwarf_die::child_offset): New function.
2660 (Dwarf_die::sibling_offset): New function.
2661 (Dwarf_info_reader::check_buffer): New function.
2662 (Dwarf_info_reader::parse): New function.
2663 (Dwarf_info_reader::do_parse): New function.
2664 (Dwarf_info_reader::do_read_string_table): New function.
2665 (Dwarf_info_reader::lookup_reloc): New function.
2666 (Dwarf_info_reader::get_string): New function.
2667 (Dwarf_info_reader::visit_compilation_unit): New function.
2668 (Dwarf_info_reader::visit_type_unit): New function.
2669 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
2670 Sized_elf_reloc_mapper.
2671 (Sized_dwarf_line_info::symbol_section): Remove function.
2672 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
2673 (Sized_dwarf_line_info::read_line_mappings): Remove object
2674 parameter, adjust callers.
2675 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
2676 * dwarf_reader.h: Include <sys/types.h>.
2677 (class Track_relocs): Remove forward declaration.
2678 (class Elf_reloc_mapper): New class.
2679 (class Sized_elf_reloc_mapper): New class.
2680 (class Dwarf_abbrev_table): New class.
2681 (class Dwarf_range_list): New class.
2682 (class Dwarf_ranges_table): New class.
2683 (class Dwarf_pubnames_table): New class.
2684 (class Dwarf_die): New class.
2685 (class Dwarf_info_reader): New class.
2686 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
2687 (Sized_dwarf_line_info::symbol_section): Remove member function.
2688 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
2689 base class.
2690 * gdb-index.cc: New source file.
2691 * gdb-index.h: New source file.
2692 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
2693 and .debug_types sections, call Layout::add_to_gdb_index.
2694 (Sized_relobj_incr::do_section_name): Implement.
2695 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
2696 return type; Implement.
2697 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
2698 return type.
2699 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
2700 parameter list and return type.
2701 (Sized_incr_dynobj::do_section_contents): Likewise.
2702 * layout.cc: Include gdb-index.h.
2703 (Layout::Layout): Initialize gdb_index_data_.
2704 (Layout::init_fixed_output_section): Check for .gdb_index section.
2705 (Layout::add_to_gdb_index): New function. Instantiate.
2706 * layout.h: Add forward declaration for class Gdb_index.
2707 (Layout::add_to_gdb_index): New member function.
2708 (Layout::gdb_index_data_): New data member.
2709 * main.cc: Include gdb-index.h.
2710 (main): Print statistics for gdb index.
2711 * object.cc (Object::section_contents): Move code into
2712 do_section_contents.
2713 (need_decompressed_section): Check for sections needed when building
2714 gdb index.
2715 (build_compressed_section_map): Likewise.
2716 (Sized_relobj_file::do_read_symbols): Need local symbols when building
2717 gdb index.
2718 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
2719 sections; call Layout::add_to_gdb_index.
2720 (Sized_relobj_file::do_decompressed_section_contents): Call
2721 do_section_contents directly.
2722 * object.h (Object::do_section_contents): Adjust parameter list and
2723 return type.
2724 (Object::do_decompressed_section_contents): Call do_section_contents
2725 directly.
2726 (Sized_relobj_file::do_section_contents): Adjust parameter list and
2727 return type.
2728 * options.h (class General_options): Add --gdb-index option.
2729 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
2730 list and return type.
2731 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
2732 * reloc.h (Track_relocs::checkpoint): New function.
2733 (Track_relocs::reset): New function.
2734
2735 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
2736 New test cases.
2737 * testsuite/Makefile.in: Regenerate.
2738 * testsuite/gdb_index_test.cc: New test source file.
2739 * testsuite/gdb_index_test_1.sh: New test source file.
2740 * testsuite/gdb_index_test_2.sh: New test source file.
2741
647f1574
DK
27422012-03-19 Doug Kwan <dougkwan@google.com>
2743
2744 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 2745 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
2746 __exidx_start and __exidx_end. Make symbol table parameter
2747 anonymous as it is not used.
2748 * gold.cc (queue_middle_tasks): Call target hook to define any
2749 target-specific symbols.
2750 * target.h (Target::define_standard_symbols): New method.
2751 (Target::do_define_standard_symbols): Same.
2752 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
2753 * testsuite/Makefile.in: Regenerate.
2754 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
2755 and __exidx_end.
2756 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
2757 relocations are generated for __exidx_start and __exidx_end.
2758
7c6109da
DK
27592012-03-16 Doug Kwan <dougkwan@google.com>
2760
2761 * testsuite/Makefile.am: Disable test initpri3b.
2762 * testsuite/Makefile.in: Regenerate.
2763
7b8957f8
DK
27642012-03-15 Doug Kwan <dougkwan@google.com>
2765
2766 * arm.cc (Target_arm::got_section): Make .got section read-only
2767 if -z now is given.
2768
14dc9ef7
ILT
27692012-03-15 Ian Lance Taylor <iant@google.com>
2770
2771 PR gold/13850
2772 * layout.cc (Layout::make_output_section): Correctly mark
2773 SHT_INIT_ARRAY, et. al., as relro.
2774
fa40b62a
DK
27752012-03-14 Doug Kwan <dougkwan@google.com>
2776
2777 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
2778 dynamic relocations for protected symbols in shared objects.
2779
fd325007
ILT
27802012-03-13 Ian Lance Taylor <iant@google.com>
2781
2782 * resolve.cc (Symbol_table::resolve): When merging common symbols,
2783 keep the larger alignment.
2784
e8dd54e1
CC
27852012-03-12 Cary Coutant <ccoutant@google.com>
2786
2787 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
2788 handling of DW_LNE_define_file.
2789
feb5f3b0
CC
27902012-03-12 Cary Coutant <ccoutant@google.com>
2791
2792 * reduced_debug_output.cc
2793 (Output_reduced_debug_info_section::get_die_end): Add new FORM
2794 codes to switch.
2795
a1fb4256
CC
27962012-02-29 Cary Coutant <ccoutant@google.com>
2797
2798 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
2799
5dd8762a
CC
28002012-02-29 Cary Coutant <ccoutant@google.com>
2801
2802 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
2803 Call Object::decompressed_section_contents.
2804 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
2805 New dtor.
2806 (Sized_dwarf_line_info::buffer_start_): New data member.
2807 * merge.cc (Output_merge_data::do_add_input_section): Call
2808 Object::decompressed_section_contents.
2809 (Output_merge_string::do_add_input_section): Likewise.
2810 * object.cc (need_decompressed_section): New function.
2811 (build_compressed_section_map): Decompress sections needed later.
2812 (Sized_relobj_file::do_decompressed_section_contents): New function.
2813 (Sized_relobj_file::do_discard_decompressed_sections): New function.
2814 * object.h (Object::decompressed_section_contents): New function.
2815 (Object::discard_decompressed_sections): New function.
2816 (Object::do_decompressed_section_contents): New function.
2817 (Object::do_discard_decompressed_sections): New function.
2818 (Compressed_section_info): New type.
2819 (Compressed_section_map): Include decompressed section contents.
2820 (Sized_relobj_file::do_decompressed_section_contents): New function.
2821 (Sized_relobj_file::do_discard_decompressed_sections): New function.
2822
7b5de7ee
CC
28232012-02-16 Cary Coutant <ccoutant@google.com>
2824
2825 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
2826 * testsuite/Makefile.in: Regenerate.
2827
f9fa4a63
CC
28282012-02-14 Cary Coutant <ccoutant@google.com>
2829
2830 * options.cc (General_options::finalize): Disallow -pie and -static.
2831
2c175ebc
DK
28322012-02-03 Doug Kwan <dougkwan@google.com>
2833
2834 * arm.cc (Arm_relocate_functions::abs8,
2835 Arm_relocate_functions::abs16): Use
2836 Bits::has_signed_unsigned_overflow32.
2837 (Arm_relocate_functions::thm_abs8): Correct range of
2838 overflow check.
2839 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
2840 in assertions.
2841
90cff06f
DK
28422012-02-02 Doug Kwan <dougkwan@google.com>
2843
2844 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
2845 position independent outputs, not just shared objects.
2846
63887f3d
L
28472012-01-30 H.J. Lu <hongjiu.lu@intel.com>
2848
2849 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
2850 * configure: Regenerated.
2851
bef2b434
ILT
28522012-01-27 Ian Lance Taylor <iant@google.com>
2853
2854 * reloc.h (Bits): New class with static functions, copied from
2855 namespace utils in arm.cc.
2856 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
2857 instead.
2858
c335b55d
L
28592012-01-27 H.J. Lu <hongjiu.lu@intel.com>
2860
2861 * incremental.cc (write_info_blocks): Correct relocation offset.
2862
41194d9f
L
28632012-01-27 H.J. Lu <hongjiu.lu@intel.com>
2864
2865 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
2866 (Relocate::tls_gd_to_le): Likewise.
2867
1bae613c
L
28682012-01-27 H.J. Lu <hongjiu.lu@intel.com>
2869
2870 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
2871
24482ca0
L
28722012-01-27 H.J. Lu <hongjiu.lu@intel.com>
2873
2874 * configure.ac: Check if -mcmodel=medium works.
2875 * configure: Regenerated.
2876
c2c7840a
CC
28772012-01-24 Cary Coutant <ccoutant@google.com>
2878
2879 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
2880 definition and ...
2881 (read_unsigned_LEB_128_x): ... this new function.
2882 (read_signed_LEB_128): Replaced with inline definition and ...
2883 (read_signed_LEB_128_x): ... this new function.
2884 * int_encoding.h (read_unsigned_LEB_128_x): New function.
2885 (read_unsigned_LEB_128): Add inline definition.
2886 (read_signed_LEB_128_x): New function.
2887 (read_signed_LEB_128): Add inline definition.
2888 * testsuite/Makefile.am (leb128_unittest): New unit test.
2889 * testsuite/Makefile.in: Regenerate.
2890 * testsuite/leb128_unittest.cc: New unit test.
2891
833de760 28922012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
2893
2894 PR gold/13617
2895 * i386.cc (Target_i386::do_code_fill): When using a jmp
2896 instruction, pad with nop instructions.
2897 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
2898
618d6666
L
28992012-01-22 H.J. Lu <hongjiu.lu@intel.com>
2900
2901 * x86_64.cc (gc_process_relocs): Add typename on types used in
2902 template.
2903 (scan_relocs): Likewise.
2904 (relocate_section): Likewise.
2905 (apply_relocation): Likewise.
2906
3660ff06
L
29072012-01-10 H.J. Lu <hongjiu.lu@intel.com>
2908
2909 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
2910 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
2911 under x32.
2912
fc51264f
L
29132012-01-09 H.J. Lu <hongjiu.lu@intel.com>
2914
2915 * x86_64.cc: Initial support for x32.
2916
dd74ae06
CC
29172012-01-03 Cary Coutant <ccoutant@google.com>
2918
2919 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
2920 Use abstract base class for GOT.
2921 * gold/output.h (class Output_data_got_base): New abstract base class.
2922 (class Output_data_got): Derive from new base class, adjust ctors.
2923 (Output_data_got::reserve_slot): Make virtual; rename to
2924 do_reserve_slot; Adjust callers.
2925 * gold/target.h (Sized_target::init_got_plt_for_update): Return
2926 pointer to abstract base class.
2927 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
2928
83896202
ILT
29292011-12-18 Ian Lance Taylor <iant@google.com>
2930
2931 * object.h (Relobj::local_symbol_value): New function.
2932 (Relobj::local_plt_offset): New function.
2933 (Relobj::local_has_got_offset): New function.
2934 (Relobj::local_got_offset): New function.
2935 (Relobj::set_local_got_offset): New function.
2936 (Relobj::do_local_symbol_value): New pure virtual function.
2937 (Relobj::do_local_plt_offset): Likewise.
2938 (Relobj::do_local_has_got_offset): Likewise.
2939 (Relobj::do_local_got_offset): Likewise.
2940 (Relobj::do_set_local_got_offset): Likewise.
2941 (Sized_relobj::do_local_has_got_offset): Rename from
2942 local_has_got_offset.
2943 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
2944 (Sized_relobj::do_set_local_got_offset): Rename from
2945 set_local_got_offset.
2946 (Sized_relobj_file::do_local_plt_offset): Rename from
2947 local_plt_offset.
2948 (Sized_relobj_file::do_local_symbol_value): New function.
2949 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
2950 local_plt_offset.
2951 * output.cc (Output_data_got::Got_entry::write): Change object to
2952 Relobj. Use local_symbol_value.
2953 (Output_data_got::add_global_with_rel): Change rel_dyn to
2954 Output_data_reloc_generic*. Use add_global_generic.
2955 (Output_data_got::add_global_with_rela): Remove. Change all
2956 callers to use add_global_with_rel.
2957 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
2958 Output_data_reloc_generic*. Use add_global_generic.
2959 (Output_data_got::add_global_pair_with_rela): Remove. Change all
2960 callers to use add_global_pair_with_rel.
2961 (Output_data_got::add_local): Change object to Relobj*.
2962 (Output_data_got::add_local_plt): Likewise.
2963 (Output_data_got::add_local_with_rel): Change object to Relobj*,
2964 change rel_dyn to Output_data_reloc_generic*. Use
2965 add_local_generic.
2966 (Output_data_got::add_local_with_rela): Remove. Change all
2967 callers to use all_local_with_rel.
2968 (Output_data_got::add_local_pair_with_rel): Change object to
2969 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
2970 add_output_section_generic.
2971 (Output_data_got::add_local_pair_with_rela): Remove. Change all
2972 callers to use add_local_pair_with_rel.
2973 (Output_data_got::reserve_local): Change object to Relobj*.
2974 * output.h: (class Output_data_reloc_generic): Add pure virtual
2975 declarations for add_global_generic, add_local_generic,
2976 add_output_section_generic.
2977 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
2978 functions for Output_data_reloc_generic. Update declarations for
2979 changes listed in output.cc.
2980 (class Output_data_got): Change template parameter to got_size.
2981 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
2982 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
2983 function.
2984 (Sized_relobj_incr::do_local_plt_offset): New function.
2985 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
2986 add_global_generic.
2987
76677ad0
CC
29882011-12-17 Cary Coutant <ccoutant@google.com>
2989
2990 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
2991 * resolve.cc (Symbol_table::resolve): Likewise.
2992 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
2993 arrays.
2994 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
2995
8b8dd8d5
ILT
29962011-12-16 Ian Lance Taylor <iant@google.com>
2997
2998 * output.h (Output_data_reloc_generic::add): Only call
2999 add_dynamic_reloc if this is a dynamic reloc section.
3000
d55525b9
L
30012011-12-15 H.J. Lu <hongjiu.lu@intel.com>
3002
3003 PR gold/13505
3004 * target-reloc.h (apply_relocation): Replace <64, false> with
3005 <size, big_endian>.
3006
ff81c7c1
NC
30072011-11-25 Nick Clifton <nickc@redhat.com>
3008
3009 * po/it.po: New Italian translation.
3010
628f39be
SA
30112011-11-17 Sterling Augustine <saugustine@google.com>
3012
3013 * script.cc (script_include_directive): Implement.
3014 (read_script_file): New local variables name and search_path. Update
3015 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
3016 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
3017 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
3018
98ef3ea4
SA
30192011-11-11 Sterling Augustine <saugustine@google.com>
3020
3021 * yyscript.y (section_cmd): Add support for INCLUDE directive.
3022 (file_or_sections_cmd): Likewise.
3023
f4a8b6d7
DK
30242011-11-11 Doug Kwan <dougkwan@google.com>
3025
3026 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
3027 if --just-symbols is given.
3028
29ab395d
DK
30292011-11-10 Doug Kwan <dougkwan@google.com>
3030
3031 PR gold/13362
3032 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
3033 when processing data relocs.
3034 * reloc.h (Relocate_functions::rel_unaligned): New method.
3035 (Relocate_functions::pcrel_unaligned): Ditto.
3036 (Relocate_functions::rel32_unaligned): Ditto.
3037 (Relocate_functions::pcrel32_unaligned): Ditto.
3038
2c339f71
DK
30392011-11-09 Doug Kwan <dougkwan@google.com>
3040
3041 PR gold/13362
3042 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
3043 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
3044 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
3045 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
3046 (Relocate_functions::rel_unaligned): New.
3047 (Relocate_functions::rel32_unaligned): New.
3048 * target-reloc.h (relocate_for_relocatable): Add code to handle
3049 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
3050 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
3051 arm_unaligned_reloc_r): New targets.
3052 * testsuite/Makefile.in: Regenerate.
3053 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
3054 linking.
3055
3f3cddf1
ILT
30562011-11-02 Ian Lance Taylor <iant@google.com>
3057
3058 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
3059 NATIVE_LINKER.
3060 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
3061 * options.cc (General_options::finalize): Use library search path
3062 from configure script if specified. If not native and no sysroot,
3063 only search TOOLLIBDIR.
3064 * options.h (Search_directory::Search_directory): Change name to
3065 const std::string&.
3066 (General_options::add_to_library_path_with_sysroot): Change arg to
3067 const std::string&.
3068 * configure, Makefile.in, config.in: Rebuild.
3069
a8e2273b
ILT
30702011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
3071
3072 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
3073 we are working around the ARM1176 Erratum.
3074 * options.h (General_options::fix_arm1176): Add option.
3075 * testsuite/Makefile.am: Add testcases, and keep current ones
3076 working.
3077 * testsuite/Makefile.in: Regenerate.
3078 * testsuite/arm_fix_1176.s: New file.
3079 * testsuite/arm_fix_1176.sh: Likewise.
3080
cd6eab1c
ILT
30812011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
3082
3083 * arm.cc (Target_arm::Target_arm): Remove initialisation of
3084 may_use_blx_.
3085 (Target_arm::may_use_blx): Remove method.
3086 (Target_arm::set_may_use_blx): Likewise.
3087 (Target_arm::may_use_v4t_interworking): New method.
3088 (Target_arm::may_use_v5t_interworking): Likewise.
3089 (Target_arm::may_use_blx_): Remove member variable.
3090 (Arm_relocate_functions::arm_branch_common): Check for v5T
3091 interworking.
3092 (Arm_relocate_functions::thumb_branch_common): Likewise.
3093 (Reloc_stub::stub_type_for_reloc): Likewise.
3094 (Target_arm::do_finalize_sections): Correct interworking checks.
3095 * testsuite/Makefile.am: Add new tests.
3096 * testsuite/Makefile.in: Regenerate.
3097 * testsuite/arm_farcall_arm_arm.s: New test.
3098 * testsuite/arm_farcall_arm_arm.sh: Likewise.
3099 * testsuite/arm_farcall_arm_thumb.s: Likewise.
3100 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
3101 * testsuite/arm_farcall_thumb_arm.s: Likewise.
3102 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
3103 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
3104 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
3105
286adcf4
CC
31062011-10-31 Cary Coutant <ccoutant@google.com>
3107
3108 PR gold/13023
3109 * expression.cc (Expression::eval_with_dot): Add
3110 is_section_dot_assignment parameter.
3111 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
3112 absolute and assigning to dot within a section.
3113 * script-sections.cc
3114 (Output_section_element_assignment::set_section_addresses): Pass
3115 dot_section to set_if_absolute.
3116 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
3117 as is_section_dot_assignment flag to eval_with_dot.
3118 (Output_section_element_dot_assignment::set_section_addresses):
3119 Likewise.
3120 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
3121 parameter. Also set value if relative to dot_section; set the
3122 symbol's output_section.
3123 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
3124 parameter. Adjust all callers.
3125 (Expression::eval_maybe_dot): Likewise.
3126 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
3127 Adjust all callers.
3128 * testsuite/script_test_2.t: Test assignment of an absolute value
3129 to dot within an output section element.
3130
9634ed06
CC
31312011-10-31 Cary Coutant <ccoutant@google.com>
3132
3133 * options.h (class General_options): Add --[no-]gnu-unique options.
3134 * symtab.cc (Symbol_table::sized_write_globals): Convert
3135 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
3136
de4101c7
CC
31372011-10-31 Cary Coutant <ccoutant@google.com>
3138
3139 PR gold/13359
3140 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
3141 unnecessary assertion.
3142 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
3143
7257cc92
ST
31442011-10-31 Sriraman Tallam <tmsriram@google.com>
3145
3146 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
3147 gc_mark_symbol.
3148 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
3149 gc_mark_symbol.
3150 Change to just keep the section associated with symbol.
3151 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
3152 they are externally visible and --export-dynamic is turned on.
3153 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
3154
bfc34b3f
ILT
31552011-10-19 Ian Lance Taylor <iant@google.com>
3156
3157 PR gold/13163
3158 * script-sections.cc
3159 (Output_section_element_dot_assignment::needs_output_section): New
3160 function.
3161
ea0d8c47
ILT
31622011-10-19 Ian Lance Taylor <iant@google.com>
3163
3164 PR gold/13204
3165 * layout.cc (Layout::segment_precedes): Don't assert failure if a
3166 --section-start option was seen.
3167 * options.h (General_options::any_section_start): New function.
3168
abd242a9
DM
31692011-10-18 David S. Miller <davem@davemloft.net>
3170
3171 PR binutils/13301
3172 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
3173 member to track relocation locations that have moved during TLS
3174 reloc optimizations.
3175 (Target_sparc::Relocate::Relocate): Initialize to NULL.
3176 (Target_sparc::Relocate::relocate): Adjust view down by 4
3177 bytes if it matches reloc_adjust_addr_.
3178 (Target_sparc::Relocate::relocate_tls): Always move the
3179 __tls_get_addr call delay slot instruction forward 4 bytes when
3180 performing relaxation.
3181
bab9090f
CC
31822011-10-18 Cary Coutant <ccoutant@google.com>
3183
3184 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
3185 (Output_file::map_no_anonymous): Check for non-zero
3186 return code from posix_fallocate.
3187
f7c5b166
CC
31882011-10-17 Cary Coutant <ccoutant@google.com>
3189
3190 PR gold/13245
3191 * plugin.cc (is_visible_from_outside): Check for symbols
3192 referenced from dynamic objects.
3193 * resolve.cc (Symbol_table::resolve): Don't count references
3194 from dynamic objects as references from real ELF files.
3195 * testsuite/plugin_test_2.sh: Adjust expected result.
3196
b490c0bb
CC
31972011-10-17 Cary Coutant <ccoutant@google.com>
3198
3199 * gold.cc: Include timer.h.
3200 (queue_middle_tasks): Stamp time.
3201 (queue_final_tasks): Likewise.
3202 * main.cc (main): Store timer in parameters. Print timers
3203 for each pass.
3204 * parameters.cc (Parameters::Parameters): Initialize timer_.
3205 (Parameters::set_timer): New function.
3206 (set_parameters_timer): New function.
3207 * parameters.h (Parameters::set_timer): New function.
3208 (Parameters::timer): New function.
3209 (Parameters::timer_): New data member.
3210 (set_parameters_timer): New function.
3211 * timer.cc (Timer::stamp): New function.
3212 (Timer::get_pass_time): New function.
3213 * timer.h (Timer::stamp): New function.
3214 (Timer::get_pass_time): New function.
3215 (Timer::pass_times_): New data member.
3216
f475cf7b
CC
32172011-10-17 Cary Coutant <ccoutant@google.com>
3218
3219 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
3220 task for members of lib groups.
3221
cdd7e244
CC
32222011-10-17 Cary Coutant <ccoutant@google.com>
3223
3224 PR gold/13288
4f95c8b4 3225 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
3226 (File_read::make_view): Move bounds check (replace with assert)...
3227 (File_read::find_or_make_view): ... to here.
3228
dfb45471
CC
32292011-10-12 Cary Coutant <ccoutant@google.com>
3230
4f95c8b4 3231 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
3232 ::read returns less than requested size.
3233
53bbcc1b
CC
32342011-10-10 Cary Coutant <ccoutant@google.com>
3235
4f95c8b4 3236 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
3237 Initialize defined_count_.
3238 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
3239 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
3240 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
3241 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
3242 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 3243 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
3244 member.
3245 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 3246 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
3247 Return zeroes instead of internal error.
3248
397b129b
CC
32492011-10-10 Cary Coutant <ccoutant@google.com>
3250
3251 PR gold/13249
4f95c8b4 3252 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 3253 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 3254 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
3255 (Output_reloc::type_): Adjust size of bit field.
3256 (Output_reloc::use_plt_offset_): New bit field.
3257 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
3258 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
3259 flag. Adjust all callers.
4f95c8b4 3260 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
3261 creating RELATIVE relocations.
3262
d5698657
NC
32632011-10-10 Nick Clifton <nickc@redhat.com>
3264
3265 * po/es.po: Updated Spanish translation.
3266 * po/fi.po: Updated Finnish translation.
3267
6a59a5c2
DN
32682011-10-03 Diego Novillo <dnovillo@google.com>
3269
3270 * options.cc (parse_uint): Fix dereference of RETVAL.
3271
f0558624
ST
32722011-09-29 Sriraman Tallam <tmsriram@google.com>
3273
3274 * layout.h (section_order_map_): New member.
3275 (get_section_order_map): New member function.
3276 * output.cc (Output_section::add_input_section): Check for patterns
3277 only when --section-ordering-file is specified.
3278 * gold.cc (queue_middle_tasks): Delay updating order of sections till
3279 output_sections have been formed.
3280 * layout.cc (Layout_Layout): Initialize section_order_map_.
3281 * plugin.cc (update_section_order): Store order in order_map. Do not
3282 update the order.
3283 * testsuite/Makefile.am: Add test case for plugin_final_layout.
3284 * testsuite/Makefile.in: Regenerate.
3285 * testsuite/plugin_section_order.c: New file.
3286 * testsuite/plugin_final_layout.cc: New file.
3287 * testsuite/plugin_final_layout.sh: New file.
3288
a7dac153
CC
32892011-09-29 Cary Coutant <ccoutant@google.com>
3290
4f95c8b4 3291 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 3292 Check for NULL.
4f95c8b4 3293 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
3294 symbols during incremental update.
3295 (Symbol_table::add_from_dynobj): Likewise.
3296
eebd87a5
ILT
32972011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3298 Ian Lance Taylor <iant@google.com>
3299
3300 * symtab.cc (Symbol_table::define_special_symbol): Always
3301 canonicalize version string.
3302
403a3331
CC
33032011-09-26 Cary Coutant <ccoutant@google.com>
3304
4f95c8b4
CC
3305 * gold.cc (queue_initial_tasks): Move option checks ...
3306 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
3307 some options; make others fatal.
3308
235061c2
CC
33092011-09-26 Cary Coutant <ccoutant@google.com>
3310
3311 gcc PR lto/47247
3312 * plugin.cc (get_symbols_v2): New function.
3313 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
3314 (is_referenced_from_outside): New function.
3315 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
3316 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
3317 (get_symbols): Pass version parameter.
3318 (get_symbols_v2): New function.
3319 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
3320 parameter.
3321 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
3322 (onload): Add LDPT_GET_SYMBOLS_V2.
3323 (all_symbols_read_hook): Use get_symbols_v2; check for
3324 LDPR_PREVAILING_DEF_IRONLY_EXP.
3325 * testsuite/plugin_test_3.sh: Update expected results.
3326
dc87f620
ILT
33272011-09-23 Simon Baldwin <simonb@google.com>
3328
3329 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
3330 configuration options.
3331 * configure: Regenerate.
3332 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
3333 * Makefile.in: Regenerate.
3334 * testsuite/Makefile.in: Regenerate.
3335
a8279f82
ST
33362011-09-19 Sriraman Tallam <tmsriram@google.com>
3337
3338 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
3339
0c9350c8
CC
33402011-09-19 Cary Coutant <ccoutant@google.com>
3341
3342 * incremental.cc (can_incremental_update): Fix typo in comment.
3343 * incremental.h (can_incremental_update): Likewise.
3344
aa06ae28
CC
33452011-09-18 Cary Coutant <ccoutant@google.com>
3346
3347 * incremental.cc (can_incremental_update): New function.
3348 * incremental.h (can_incremental_update): New function.
3349 * layout.cc (Layout::init_fixed_output_section): Call it.
3350 (Layout::make_output_section): Don't allow patch space in .eh_frame.
3351 * object.cc (Sized_relobj_file::do_layout): Call
3352 can_incremental_update.
3353
ebb300b2
CC
33542011-09-13 Cary Coutant <ccoutant@google.com>
3355
3356 * configure.ac: Check for glibc support for gnu_indirect_function
3357 support with static linking, setting automake conditional
3358 IFUNC_STATIC.
3359 * Makefile.in: Regenerate.
3360 * configure: Regenerate.
3361
3362 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
3363 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
3364 for IFUNC_STATIC.
3365 * testsuite/Makefile.in: Regenerate.
3366
1206d0d5
CC
33672011-09-13 Cary Coutant <ccoutant@google.com>
3368
3369 * incremental.cc (Sized_relobj_incr::do_layout): Call
3370 report_comdat_group for kept comdat sections.
3371 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
3372 * testsuite/Makefile.in: Regenerate.
3373 * testsuite/incr_comdat_test_1.cc: New source file.
3374 * testsuite/incr_comdat_test_2_v1.cc: New source file.
3375 * testsuite/incr_comdat_test_2_v2.cc: New source file.
3376 * testsuite/incr_comdat_test_2_v3.cc: New source file.
3377
40b29874
ILT
33782011-09-13 Ian Lance Taylor <iant@google.com>
3379
3380 * object.cc (Sized_relobj_file::do_layout): Remove unused local
3381 variable external_symbols_offset.
3382
1b045aac
ILT
33832011-09-12 Ian Lance Taylor <iant@google.com>
3384
3385 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
3386 triggered if object has no symbols.
3387
24c6c55a
DM
33882011-09-09 David S. Miller <davem@davemloft.net>
3389
3390 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
3391 (Output_fill_debug_line::do_write): Likewise.
3392
66570254
CC
33932011-08-29 Cary Coutant <ccoutant@google.com>
3394
3395 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
3396 casts to match formatting specs.
3397 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
3398
8ea8cd50
CC
33992011-08-26 Cary Coutant <ccoutant@google.com>
3400
3401 * layout.cc (Free_list::allocate): Provide guarantee of minimum
3402 remaining hole size when allocating.
3403 (Layout::make_output_section): Set fill methods for debug sections.
3404 * layout.h (Free_list::Free_list_node): Move from private to
3405 public.
3406 (Free_list::set_min_hole_size): New function.
3407 (Free_list::begin, Free_list::end): New functions.
3408 (Free_list::min_hole_): New data member.
3409 * output.cc: Include dwarf.h.
3410 (Output_fill_debug_info::do_minimum_hole_size): New function.
3411 (Output_fill_debug_info::do_write): New function.
3412 (Output_fill_debug_line::do_minimum_hole_size): New function.
3413 (Output_fill_debug_line::do_write): New function.
3414 (Output_section::Output_section): Initialize new data member.
3415 (Output_section::set_final_data_size): Ensure patch space is larger
3416 than minimum hole size.
3417 (Output_section::do_write): Fill holes in debug sections.
3418 * output.h (Output_fill): New class.
3419 (Output_fill_debug_info): New class.
3420 (Output_fill_debug_line): New class.
3421 (Output_section::set_free_space_fill): New function.
3422 (Output_section::free_space_fill_): New data member.
3423 * testsuite/Makefile.am (incremental_test_3): Add
3424 --incremental-patch option.
3425 (incremental_test_4): Likewise.
3426 (incremental_test_5): Likewise.
3427 (incremental_test_6): Likewise.
3428 (incremental_copy_test): Likewise.
3429 (incremental_common_test_1): Likewise.
3430 * testsuite/Makefile.in: Regenerate.
3431
7cf80422
NC
34322011-08-26 Nick Clifton <nickc@redhat.com>
3433
3434 * po/es.po: Updated Spanish translation.
3435
c3f7b0e5
CC
34362011-08-01 Cary Coutant <ccoutant@google.com>
3437
3438 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
3439 * gold/testsuite/Makefile.in: Regenerate.
3440 * gold/testsuite/justsyms_exec.c: New source file.
3441 * gold/testsuite/justsyms_lib.c: New source file.
3442
9590bf25
CC
34432011-08-01 Cary Coutant <ccoutant@google.com>
3444
3445 * layout.cc (Layout::set_segment_offsets): Don't realign text
3446 segment if -Ttext was specified.
3447 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
3448 file type.
3449 * object.h (Sized_relobj_file::e_type): New function.
3450 (Sized_relobj_file::e_type_): New data member.
3451 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
3452 base address for ET_EXEC files.
3453 * target.cc (Target::do_make_elf_object_implementation): Allow
3454 ET_EXEC files with --just-symbols option.
3455
dcd8d12e
CC
34562011-07-28 Cary Coutant <ccoutant@google.com>
3457
3458 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
3459 Add thread_number parameter.
3460 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
3461 * workqueue-threads.cc
3462 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
3463 current thread if its thread number is greater than desired thread
3464 count.
3465 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
3466 Add thread_number parameter.
3467 (Workqueue::should_cancel_thread): Likewise.
3468 (Workqueue::find_runnable_or_wait): Pass thread_number to
3469 should_cancel_thread.
3470 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
3471 parameter.
3472
804eb480
ST
34732011-07-22 Sriraman Tallam <tmsriram@google.com>
3474
3475 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
3476 only after checking if it cannot be forced local.
3477 * symtab.h (is_externally_visible): Check if the symbol is not forced
3478 local.
3479
f1ddb600
ILT
34802011-07-15 Ian Lance Taylor <iant@google.com>
3481
3482 * options.h (class General_options): Add --print-output-format.
3483 Move -EL next to -EB, for better --help output.
3484 * target-select.cc: Include <cstdio>, "options.h", and
3485 "parameters.h".
3486 (Target_selector::do_target_bfd_name): New function.
3487 (print_output_format): New function.
3488 * target-select.h (class Target_selector): Update declarations.
3489 (Target_selector::target_bfd_name): New function.
3490 (print_output_format): Declare.
3491 * main.cc: Include "target-select.h".
3492 (main): Handle --print-output-format.
3493 * gold.cc: Include "target-select.h".
3494 (queue_initial_tasks): Handle --print-output-format when there are
3495 no input files.
3496 * parameters.cc (parameters_force_valid_target): Give a better
3497 error message if -EB/-EL does not match target.
3498 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
3499 function.
3500
7d172687
ILT
35012011-07-15 Ian Lance Taylor <iant@google.com>
3502
3503 * i386.cc (class Output_data_plt_i386): Add layout_ field.
3504 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
3505 (Output_data_plt_i386::do_write): Write address of .dynamic
3506 section to first entry in .got.plt section.
3507 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
3508 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
3509 Initialize layout_.
3510 (Output_data_plt_x86_64::do_write): Write address of .dynamic
3511 section to first entry in .got.plt section.
3512 * layout.h (Layout::dynamic_section): New function.
3513
e9552f7e
ST
35142011-07-13 Sriraman Tallam <tmsriram@google.com>
3515
3516 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
3517 to claim_file call.
3518 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
3519 input_section_position_, and input_section_glob_.
3520 (read_layout_from_file): Call function section_ordering_specified.
3521 * layout.h (is_section_ordering_specified): New function.
3522 (section_ordering_specified): New function.
3523 (section_ordering_specified_): New boolean member.
3524 * main.cc(main): Call load_plugins after layout object is defined.
3525 * output.cc (Output_section::add_input_section): Use
3526 function section_ordering_specified to check if section ordering is
3527 needed.
3528 * output.cc (Output_section::add_relaxed_input_section): Use
3529 function section_ordering_specified to check if section ordering is
3530 needed.
3531 (Output_section::update_section_layout): New function.
3532 (Output_section::sort_attached_input_sections): Check if input section
3533 must be reordered.
3534 * output.h (Output_section::update_section_layout): New function.
3535 * plugin.cc (get_section_count): New function.
3536 (get_section_type): New function.
3537 (get_section_name): New function.
3538 (get_section_contents): New function.
3539 (update_section_order): New function.
58797674 3540 (allow_section_ordering): New function.
e9552f7e
ST
3541 (Plugin::load): Add the new interfaces to the transfer vector.
3542 (Plugin_manager::load_plugins): New parameter.
3543 (Plugin_manager::all_symbols_read): New parameter.
3544 (Plugin_manager::claim_file): New parameter. Save the elf object for
3545 unclaimed objects.
3546 (Plugin_manager::get_elf_object): New function.
3547 (Plugin_manager::get_view): Change to directly use the bool to check
3548 if get_view is called from claim_file_hook.
3549 * plugin.h (input_objects): New function
3550 (Plugin__manager::load_plugins): New parameter.
3551 (Plugin_manager::claim_file): New parameter.
3552 (Plugin_manager::get_elf_object): New function.
3553 (Plugin_manager::in_claim_file_handler): New function.
3554 (Plugin_manager::in_claim_file_handler_): New member.
3555 (layout): New function.
3556 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
3557 handler with an extra parameter. Make the elf object before calling
3558 claim_file handler.
3559 * testsuite/plugin_test.c (get_section_count): New function pointer.
3560 (get_section_type): New function pointer.
3561 (get_section_name): New function pointer.
3562 (get_section_contents): New function pointer.
3563 (update_section_order): New function pointer.
3564 (allow_section_ordering): New function pointer.
3565 (onload): Check if the new interfaces exist.
3566
9446efde
ILT
35672011-07-13 Ian Lance Taylor <iant@google.com>
3568
3569 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
3570 relro section.
3571 * x86_64.cc (Target_x86_64::got_section): Likewise.
3572 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
3573 (relro_now_test_SOURCES): New variable.
3574 (relro_now_test_DEPENDENCIES): New variable.
3575 (relro_now_test_LDFLAGS): New variable.
3576 (relro_now_test_LDADD): New variable.
3577 (relro_now_test.so): New target.
3578 * testsuite/Makefile.in: Rebuild.
3579
07aa62f2
ILT
35802011-07-12 Ian Lance Taylor <iant@google.com>
3581
3582 PR gold/12980
3583 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
3584 GLOB_DAT relocation rather than a RELATIVE relocation for a
3585 protected symbol when creating a shared library.
3586 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3587 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
3588 * testsuite/protected_main_1.cc (main): Test that protected
3589 function has same address.
3590
e2153196
ILT
35912011-07-11 Ian Lance Taylor <iant@google.com>
3592
3593 PR gold/12979
3594 * options.h (class General_options): Add -Bgroup.
3595 * options.cc (General_options::finalize): If -Bgroup is set,
3596 default to --unresolved-symbols=report-all.
3597 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
3598 * target-reloc.h (issue_undefined_symbol_error): Handle
3599 --unresolved-symbols=report-all.
3600
6daf5215
ILT
36012011-07-08 Ian Lance Taylor <iant@google.com>
3602
3603 PR gold/11985
3604 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
3605 if linker script discards key sections.
3606 (Layout::create_dynamic_symtab): Likewise.
3607 (Layout::assign_local_dynsym_offsets): Likewise.
3608 (Layout::sized_create_version_sections): Likewise.
3609 (Layout::create_interp): Likewise.
3610 (Layout::finish_dynamic_section): Likewise.
3611 (Layout::set_dynamic_symbol_size): Likewise.
3612
beabb2c6
ILT
36132011-07-08 Ian Lance Taylor <iant@google.com>
3614
3615 PR gold/12386
3616 * options.h (class General_options): Add --unresolved-symbols.
3617 * target-reloc.h (issue_undefined_symbol_error): Check
3618 --unresolved-symbols. Add comments.
3619
9c16daf1
ILT
36202011-07-08 Ian Lance Taylor <iant@google.com>
3621
3622 * testsuite/odr_violation2.cc (Ordering::operator()): Make
3623 expression more complex.
3624
191f1a2d
ILT
36252011-07-08 Ian Lance Taylor <iant@google.com>
3626
3627 PR gold/11317
3628 * target-reloc.h (issue_undefined_symbol_error): New inline
3629 function, broken out of relocate_section.
3630 (relocate_section): Call issue_undefined_symbol_error.
3631 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
3632 there is no TLS segment if we are about to issue an undefined
3633 symbol error.
3634 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
3635
62855347
ILT
36362011-07-08 Ian Lance Taylor <iant@google.com>
3637
3638 PR gold/12279
3639 * resolve.cc (Symbol_table::should_override): Add fromtype
3640 parameter. Change all callers. Give error when linking together
3641 TLS and non-TLS symbol.
3642 (Symbol_table::should_override_with_special): Add fromtype
3643 parameter. Change all callers.
3644 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
3645 there is no TLS segment if we have reported some errors.
3646 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
3647
67181c72
ILT
36482011-07-08 Ian Lance Taylor <iant@google.com>
3649
3650 PR gold/12372
3651 * target.h (Target::plt_address_for_global): New function.
3652 (Target::plt_address_for_local): New function.
3653 (Target::plt_section_for_global): Remove.
3654 (Target::plt_section_for_local): Remove.
3655 (Target::do_plt_address_for_global): New virtual function.
3656 (Target::do_plt_address_for_local): New virtual function.
3657 (Target::do_plt_section_for_global): Remove.
3658 (Target::do_plt_section_for_local): Remove.
3659 (Target::register_global_plt_entry): Add Symbol_table and Layout
3660 parameters.
3661 * output.cc (Output_data_got::Got_entry::write): Use
3662 plt_address_for_global and plt_address_for_local.
3663 * layout.cc (Layout::add_target_dynamic_tags): Use size and
3664 address of output section.
3665 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
3666 got_irelative_, and irelative_count_ fields. Update
3667 declarations.
3668 (Output_data_plt_i386::has_irelative_section): New function.
3669 (Output_data_plt_i386::entry_count): Add irelative_count_.
3670 (Output_data_plt_i386::set_final_data_size): Likewise.
3671 (class Target_i386): Add got_irelative_ and rel_irelative_
3672 fields. Update declarations.
3673 (Target_i386::Target_i386): Initialize new fields.
3674 (Target_i386::do_plt_address_for_global): New function replacing
3675 do_plt_section_for_global.
3676 (Target_i386::do_plt_address_for_local): New function replacing
3677 do_plt_section_for_local.
3678 (Target_i386::got_section): Create got_irelative_.
3679 (Target_i386::rel_irelative_section): New function.
3680 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
3681 fields. Don't define __rel_iplt_{start,end}.
3682 (Output_data_plt_i386::add_entry): Add symtab and layout
3683 parameters. Change all callers. Use different PLT and GOT for
3684 IFUNC symbols.
3685 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
3686 layout parameters. Change all callers. Use different PLT and
3687 GOT.
3688 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
3689 (Output_data_plt_i386::rel_irelative): New function.
3690 (Output_data_plt_i386::address_for_global): New function.
3691 (Output_data_plt_i386::address_for_local): New function.
3692 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
3693 IRELATIVE GOT when changing IFUNC GOT entries.
3694 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
3695 reloc.
3696 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
3697 if we didn't create an IRELATIVE GOT.
3698 (Target_i386::Relocate::relocate): Use plt_address_for_global and
3699 plt_address_for_local.
3700 (Target_i386::do_dynsym_value): Use plt_address_for_global.
3701 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
3702 got_irelative_, and irelative_count_ fields. Update
3703 declarations.
3704 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
3705 Initialize new fields. Remove symtab parameter. Change all
3706 callers.
3707 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
3708 irelative_count_.
3709 (Output_data_plt_x86_64::has_irelative_section): New function.
3710 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
3711 (class Target_x86_64): Add got_irelative_ and rel_irelative_
3712 fields. Update declarations.
3713 (Target_x86_64::Target_x86_64): Initialize new fields.
3714 (Target_x86_64::do_plt_address_for_global): New function replacing
3715 do_plt_section_for_global.
3716 (Target_x86_64::do_plt_address_for_local): New function replacing
3717 do_plt_section_for_local.
3718 (Target_x86_64::got_section): Create got_irelative_.
3719 (Target_x86_64::rela_irelative_section): New function.
3720 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
3721 all callers. Don't create __rel_iplt_{start,end}.
3722 (Output_data_plt_x86_64::add_entry): Add symtab and layout
3723 parameters. Change all callers. Use different PLT and GOT for
3724 IFUNC symbols.
3725 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
3726 layout parameters. Change all callers. Use different PLT and
3727 GOT.
3728 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
3729 parameters. Change all callers. Use different PLT and GOT for
3730 IFUNC symbols.
3731 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
3732 (Output_data_plt_x86_64::rela_irelative): New function.
3733 (Output_data_plt_x86_64::address_for_global): New function.
3734 (Output_data_plt_x86_64::address_for_local): New function.
3735 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3736 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
3737 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
3738 (Target_x86_64::register_global_plt_entry): Add symtab and layout
3739 parameters.
3740 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
3741 reloc.
3742 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
3743 symbols if we didn't create an IRELATIVE GOT.
3744 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
3745 plt_address_for_local.
3746 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
3747 * testsuite/ifuncvar1.c: New test file.
3748 * testsuite/ifuncvar2.c: New test file.
3749 * testsuite/ifuncvar3.c: New test file.
3750 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
3751 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
3752 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
3753 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
3754 * testsuite/Makefile.in: Rebuild.
3755
33c15b45
CC
37562011-07-07 Cary Coutant <ccoutant@google.com>
3757
3758 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
3759 (two_file_test_1_ndebug.o): Likewise.
3760 (two_file_test_1b_ndebug.o): Likewise.
3761 (two_file_test_2_ndebug.o): Likewise.
3762 (two_file_test_main_ndebug.o): Likewise.
3763 (incremental_test_2): Link with no-debug versions.
3764
f48b5fb7
CC
37652011-07-06 Cary Coutant <ccoutant@google.com>
3766
3767 * gold/incremental.cc
3768 (Output_section_incremental_inputs::write_info_blocks): Check for
3769 hidden and internal symbols.
3770
221597a5
CC
37712011-07-06 Cary Coutant <ccoutant@google.com>
3772
3773 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
3774 Check disposition for startup file.
3775 (Incremental_inputs::report_command_line): Ignore
3776 --incremental-startup-unchanged option.
3777 * options.cc (General_options::parse_incremental_startup_unchanged):
3778 New function.
3779 (General_options::General_options): Initialize new data member.
3780 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
3781 (General_options): Add --incremental-startup-unchanged option.
3782 (General_options::incremental_startup_disposition): New function.
3783 (General_options::incremental_startup_disposition_): New data member.
3784
e24719f6
CC
37852011-07-06 Cary Coutant <ccoutant@google.com>
3786
3787 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
3788 input file index to Script_info ctor.
3789 (Sized_incremental_binary::do_file_has_changed): Find the
3790 command-line argument for files named in scripts.
3791 * incremental.h (Script_info::Script_info): New ctor
3792 with input file index.
3793 (Script_info::input_file_index): New function.
3794 (Script_info::input_file_index_): New data member.
3795 (Incremental_binary::get_library): Add const.
3796 (Incremental_binary::get_script_info): Add const.
3797 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
3798 * testsuite/Makefile.am (incremental_test_5): New test case.
3799 (incremental_test_6): New test case.
3800 * testsuite/Makefile.in: Regenerate.
3801
8f7c81e8
CC
38022011-07-06 Cary Coutant <ccoutant@google.com>
3803
3804 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
3805 debug output when command lines differ.
3806
9fbd3822
CC
38072011-07-06 Cary Coutant <ccoutant@google.com>
3808
3809 * incremental.cc (Incremental_inputs::report_command_line): Ignore
3810 --incremental-patch option.
3811 * layout.cc (Free_list::allocate): Extend allocation beyond original
3812 end if enabled.
3813 (Layout::make_output_section): Mark sections that should get
3814 patch space.
3815 * options.cc (parse_percent): New function.
3816 * options.h (parse_percent): New function.
3817 (DEFINE_percent): New macro.
3818 (General_options): Add --incremental-patch option.
3819 * output.cc (Output_section::Output_section): Initialize new data
3820 members.
3821 (Output_section::add_input_section): Print section name when out
3822 of patch space.
3823 (Output_section::add_output_section_data): Likewise.
3824 (Output_section::set_final_data_size): Add patch space when
3825 doing --incremental-full.
3826 (Output_section::do_reset_address_and_file_offset): Remove patch
3827 space.
3828 (Output_segment::set_section_list_addresses): Print debug output
3829 only if --incremental-update.
3830 * output.h (Output_section::set_is_patch_space_allowed): New function.
3831 (Output_section::is_patch_space_allowed_): New data member.
3832 (Output_section::patch_space_): New data member.
3833 * parameters.cc (Parameters::incremental_full): New function.
3834 * parameters.h (Parameters::incremental_full): New function
3835 * testsuite/Makefile.am (incremental_test_2): Add test for
3836 --incremental-patch option.
3837 * testsuite/Makefile.in: Regenerate.
3838 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
3839 (t18): Remove function body.
3840
f6cccc2c
DK
38412011-07-05 Doug Kwan <dougkwan@google.com>
3842
3843 PR gold/12771
3844 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
3845 Arm_Address type for relocation result.
3846 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
3847 overflow check.
3848 (Arm_relocate_functions::abs32): Use unaligned access.
3849 (Arm_relocate_functions::rel32): Ditto.
3850 (Arm_relocate_functions::prel31): Ditto.
3851 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
3852 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
3853 static data relocations.
3854 * testsuite/Makefile.in: Regnerate.
3855 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
3856
28a13fec
ILT
38572011-07-05 Ian Lance Taylor <iant@google.com>
3858
3859 PR gold/12392
3860 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
3861 symbols if necessary.
3862 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
3863
24d47b34
ILT
38642011-07-05 Ian Lance Taylor <iant@google.com>
3865
3866 PR gold/12952
3867 * resolve.cc (Symbol::override_base_with_special): Simply override
3868 version with special symbol version, ignoring previous version.
3869
41f9cbbe
ILT
38702011-07-05 Ian Lance Taylor <iant@google.com>
3871
3872 * object.cc (Sized_relobj_file::include_section_group): Add
3873 information to comment about signature location.
3874
886288f1
ILT
38752011-07-02 Ian Lance Taylor <iant@google.com>
3876
3877 PR gold/12957
3878 * options.h (class General_options): Add -f and -F.
3879 * options.cc (General_options::finalize): Fatal error if -f/-F
3880 are used without -shared.
3881 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
3882
ae3a6d4f
ILT
38832011-07-02 Ian Lance Taylor <iant@google.com>
3884
3885 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
3886
21131061
ILT
38872011-07-01 Ian Lance Taylor <iant@google.com>
3888
3889 PR gold/12525
3890 PR gold/12952
3891 * resolve.cc (Symbol::override_base_with_special): Don't override
3892 the version if the overriding symbol has a different name.
3893 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
3894 all callers. If we give an error about an undefined version,
3895 define the base version if necessary.
3896 * dynobj.h (class Versions): Update declaration.
3897 * testsuite/weak_alias_test_5.cc: New file.
3898 * testsuite/weak_alias_test.script: New file.
3899 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
3900 and versioned_alias have the right value, and call t2.
3901 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
3902 weak_alias_test_5.so.
3903 (weak_alias_test_LDADD): Likewise.
3904 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
3905 * testsuite/Makefile.in: Rebuild.
3906
611062c0
ILT
39072011-07-01 Ian Lance Taylor <iant@google.com>
3908
3909 PR gold/12525
3910 * options.h (class General_options): Support -z notext.
3911 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
3912 -Wl,-z,notext.
3913 (two_file_shared_nonpic.so): Likewise.
3914 (two_file_shared_mixed.so): Likewise.
3915 (two_file_shared_mixed_1.so): Likewise.
3916 (weak_undef_lib_nonpic.so): Likewise.
3917 (alt/weak_undef_lib_nonpic.so): Likewise.
3918 (tls_test_shared_nonpic.so): Likewise.
3919 * testsuite/Makefile.in: Rebuild.
3920
328c7c2f
ILT
39212011-07-01 Ian Lance Taylor <iant@google.com>
3922
3923 PR gold/12525
3924 * configure.ac: Test whether static linking works, setting
3925 the automake conditional HAVE_STATIC.
3926 * testsuite/Makefile.am: Disable tests using -static if
3927 HAVE_STATIC is not true.
3928 * configure, testsuite/Makefile.in: Rebuild.
3929
02d7cd44
ILT
39302011-07-01 Ian Lance Taylor <iant@google.com>
3931
3932 PR gold/12525
3933 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
3934 Assert if we see DW_EH_PE_indirect.
3935 * target.h (Target::ehframe_datarel_base): New function.
3936 (Target::do_ehframe_datarel_base): New target function.
3937 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
3938 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
3939 function.
3940
07a60597
ILT
39412011-07-01 Ian Lance Taylor <iant@google.com>
3942
3943 PR gold/12571
3944 * options.h (class General_options): Add
3945 --ld-generated-unwind-info.
3946 * ehframe.cc (Fde::write): Add address parameter. Change all
3947 callers. If associated with PLT, fill in address and size.
3948 (Cie::set_output_offset): Only add merge mapping if there is an
3949 object.
3950 (Cie::write): Add address parameter. Change all callers.
3951 (Eh_frame::add_ehframe_for_plt): New function.
3952 * ehframe.h (class Fde): Update declarations. Move shndx_ and
3953 input_offset_ fields into union u_, with new plt field.
3954 (Fde::Fde): Adjust for new union field.
3955 (Fde::Fde) [Output_data version]: New constructor.
3956 (Fde::add_mapping): Only add merge mapping if there is an object.
3957 (class Cie): Update declarations.
3958 (class Eh_frame): Declare add_ehframe_for_plt.
3959 * layout.cc (Layout::layout_eh_frame): Break out code into
3960 make_eh_frame_section, and call it.
3961 (Layout::make_eh_frame_section): New function.
3962 (Layout::add_eh_frame_for_plt): New function.
3963 * layout.h (class Layout): Update declarations.
3964 * merge.cc (Merge_map::add_mapping): Add assertion.
3965 * i386.cc: Include "dwarf.h".
3966 (class Output_data_plt_i386): Make first_plt_entry,
3967 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
3968 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
3969 and plt_eh_frame_fde.
3970 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
3971 boundary. Call add_eh_frame_for_plt if appropriate.
3972 * x86_64.cc: Include "dwarf.h".
3973 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
3974 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
3975 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
3976 and plt_eh_frame_fde.
3977 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
3978 appropriate.
3979
14788a3f
ILT
39802011-06-29 Ian Lance Taylor <iant@google.com>
3981
3982 PR gold/12629
3983 * object.cc (Sized_relobj_file::layout_section): Change shdr
3984 parameter to be const.
3985 (Sized_relobj_file::layout_eh_frame_section): New function, broken
3986 out of do_layout.
3987 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
3988 appropriate. Call layout_eh_frame_section.
3989 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
3990 sections.
3991 * object.h (class Sized_relobj_file): Update declarations.
3992
6c21fce1
ILT
39932011-06-29 Ian Lance Taylor <iant@google.com>
3994
37e41b03 3995 PR gold/12652
6c21fce1
ILT
3996 * script.cc (Token::integer_value): Accept trailing M/m/K/k
3997 modifier.
3998 (Lex::gather_token): Accept trailing M/m/K/k for integers.
3999
4d5e4e62
ILT
40002011-06-29 Ian Lance Taylor <iant@google.com>
4001
4002 PR gold/12675
4003 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
4004 SHT_X86_64_UNWIND.
4005 * layout.cc (Layout::layout_eh_frame): Likewise.
4006
886f533a
ILT
40072011-06-29 Ian Lance Taylor <iant@google.com>
4008
4009 PR gold/12695
4010 * layout.cc (Layout::symtab_section_shndx): New function.
4011 * layout.h (class Layout): Declare symtab_section_shndx.
4012 * output.cc (Output_section::write_header): Call it.
4013
f3ae1b28
ILT
40142011-06-29 Ian Lance Taylor <iant@google.com>
4015
4016 PR gold/12818
4017 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
4018 symbols which are not used in a relocation.
4019
aecf301f
ILT
40202011-06-28 Ian Lance Taylor <iant@google.com>
4021
4022 PR gold/12898
4023 * layout.cc (Layout::segment_precedes): Don't crash if a linker
4024 script create indistinguishable segments.
4025 (Layout::set_segment_offsets): Use stable_sort when sorting
4026 segments. Pass this to Compare_segments constructor.
4027 * layout.h (class Layout): Make segment_precedes non-static.
4028 (class Compare_segments): Change from struct to class. Add
4029 layout_ field. Add constructor.
4030 * script-sections.cc
4031 (Script_sections::attach_sections_using_phdrs_clause): Rename
4032 local orphan to is_orphan. Don't report failure to put empty
4033 section in segment. On attachment failure, report name of
4034 section, and attach to first PT_LOAD segment.
4035
03ef7571
ILT
40362011-06-28 Ian Lance Taylor <iant@google.com>
4037
4038 PR gold/12934
4039 * target-select.cc (Target_selector::Target_selector): Add
4040 emulation parameter. Change all callers.
4041 (select_target_by_bfd_name): Rename from select_target_by_name.
4042 Change all callers.
4043 (select_target_by_emulation): New function.
4044 (supported_emulation_names): New function.
4045 * target-select.h (class Target_selector): Add emulation_ field.
4046 Update declarations.
4047 (Target_selector::recognize_by_bfd_name): Rename from
4048 recognize_by_name. Change all callers.
4049 (Target_selector::supported_bfd_names): Rename from
4050 supported_names. Change all callers.
4051 (Target_selector::recognize_by_emulation): New function.
4052 (Target_selector::supported_emulations): New function.
4053 (Target_selector::emulation): New function.
4054 (Target_selector::do_recognize_by_bfd_name): Rename from
4055 do_recognize_by_name. Change all callers.
4056 (Target_selector::do_supported_bfd_names): Rename from
4057 do_supported_names. Change all callers.
4058 (Target_selector::do_recognize_by_emulation): New function.
4059 (Target_selector::do_supported_emulations): New function.
4060 (select_target_by_bfd_name): Change name in declaration.
4061 (select_target_by_emulation): Declare.
4062 (supported_emulation_names): Declare.
4063 * parameters.cc (parameters_force_valid_target): Try to find
4064 target based on emulation from -m option.
4065 * options.h (class General_options): Change doc string for -m.
4066 * options.cc (help): Print emulations.
4067 (General_options::parse_V): Likewise.
4068 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
4069 Add emulation parameter. Change all callers.
4070
200b2bb9
ILT
40712011-06-28 Ian Lance Taylor <iant@google.com>
4072
4073 * target.h (class Target): Add osabi_ field.
4074 (Target::osabi): New function.
4075 (Target::set_osabi): New function.
4076 (Target::Target): Initialize osabi_.
4077 (Target::do_adjust_elf_header): Make pure virtual.
4078 (Sized_target::do_adjust_elf_header): Declare.
4079 * target.cc (Sized_target::do_adjust_elf_header): New function.
4080 (class Sized_target): Instantiate all versions.
4081 * freebsd.h (class Target_freebsd): Remove.
4082 (Target_selector_freebsd::do_recognize): Call set_osabi on
4083 Target.
4084 (Target_selector_freebsd::do_recognize_by_name): Likewise.
4085 (Target_selector_freebsd::set_osabi): Remove.
4086 * i386.cc (class Target_i386): Inherit from Sized_target rather
4087 than Target_freebsd.
4088 * x86_64.cc (class Target_x86_64): Likewise.
4089
b3ce541e
ILT
40902011-06-28 Ian Lance Taylor <iant@google.com>
4091
4092 * target.h (Target::can_check_for_function_pointers): Rewrite.
4093 Make non-virtual.
4094 (Target::can_icf_inline_merge_sections): Likewise.
4095 (Target::section_may_have_icf_unsafe_poineters): Likewise.
4096 (Target::Target_info): Add can_icf_inline_merge_sections field.
4097 (Target::do_can_check_for_function_pointers): New virtual
4098 function.
4099 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
4100 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
4101 from can_check_for_function_pointers, move in file.
4102 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
4103 section_may_have_icf_unsafe_poineters, move in file.
4104 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
4105 * i386.cc (Target_i386::do_can_check_for_function_pointers):
4106 Rename from can_check_for_function_pointers, move in file.
4107 (Target_i386::can_icf_inline_merge_sections): Remove.
4108 (Target_i386::i386_info): Initialize
4109 can_icf_inline_merge_sections.
4110 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
4111 Initialize can_icf_inline_merge_sections.
4112 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
4113 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
4114 Rename from can_check_for_function_pointers, move in file.
4115 (Target_x86_64::can_icf_inline_merge_sections): Remove.
4116 (Target_x86_64::x86_64_info): Initialize
4117 can_icf_inline_merge_sections.
4118 * testsuite/testfile.cc (Target_test::test_target_info):
4119 Likewise.
4120 * icf.cc (get_section_contents): Correct formatting.
4121
6d1c4efb
ILT
41222011-06-27 Ian Lance Taylor <iant@google.com>
4123
4124 * symtab.cc (Symbol::versioned_name): New function.
4125 (Symbol_table::add_to_final_symtab): Use versioned_name when
4126 appropriate.
4127 (Symbol_table::sized_write_symbol): Likewise.
4128 * symtab.h (class Symbol): Declare versioned_name.
4129 * stringpool.h (class Stringpool_template): Add variant of add
4130 which takes a std::basic_string.
4131 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
4132 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
4133 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
4134 (ver_test_12.o): New target.
4135 * testsuite/Makefile.in: Rebuild.
4136
57eb9b50
DK
41372011-06-27 Doug Kwan <dougkwan@google.com>
4138
4139 * arm.cc (Arm_relocate_functions::thm_jump8,
4140 Arm_relocate_functions::thm_jump11): Use a wider signed
4141 type to compute offset.
4142 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
4143 arm_thm_jump8.
4144 * testsuite/Makefile.in: Regenerate.
4145 * testsuite/arm_branch_in_range.sh: Check test results of
4146 arm_thm_jump11 and arm_thm_jump8.
4147 * testsuite/arm_thm_jump11.s: New test source file.
4148 * testsuite/arm_thm_jump11.t: New linker script.
4149 * testsuite/arm_thm_jump8.s: New test source file.
4150 * testsuite/arm_thm_jump8.t: New linker script.
4151
487b39df
ILT
41522011-06-24 Ian Lance Taylor <iant@google.com>
4153
4154 * layout.cc: Include "object.h".
4155 (ctors_sections_in_init_array): New static variable.
4156 (Layout::is_ctors_in_init_array): New function.
4157 (Layout::layout): Add entry to ctors_sections_in_init_array if
4158 appropriate.
4159 * layout.h (class Layout): Declare is_ctors_in_init_array.
4160 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
4161 is_ctors_reverse_view is set.
4162 (Sized_relobj_file::write_sections): Add layout parameter. Change
4163 all callers. Set is_ctors_reverse_view field of View_size.
4164 (Sized_relobj_file::reverse_words): New function.
4165 * object.h (Sized_relobj_file::View_size): Add
4166 is_ctors_reverse_view field.
4167 (class Sized_relobj_file): Update declarations.
4168 * testsuite/initpri3.c: New test.
4169 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
4170 initpri3b.
4171 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
4172 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
4173 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
4174 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
4175 * testsuite/Makefile.in: Rebuild.
4176
472076e4
CC
41772011-06-24 Cary Coutant <ccoutant@google.com>
4178
4179 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
4180 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
4181 (debug_msg_cdebug.err): New targets.
4182 * testsuite/Makefile.in: Regenerate.
4183 * testsuite/debug_msg.sh: Check output of link with compressed debug.
4184 Fix checks for link with shared library.
4185
a60af0db
DK
41862011-06-24 Doug Kwan <dougkwan@google.com>
4187
4188 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
4189 skip empty text sections.
4190 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
4191
5393d741
ILT
41922011-06-22 Ian Lance Taylor <iant@google.com>
4193
4194 PR gold/12910
4195 * options.h (class General_options): Add --ctors-in-init-array.
4196 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
4197 friends as SHT_PROGBITS for merging sections.
4198 (Layout::layout): Remove special handling of .init_array and
4199 friends. Don't sort if doing relocatable link. Sort for .ctors
4200 and .dtors if ctors_in_init_array.
4201 (Layout::make_output_section): Force correct section types for
4202 .init_array and friends. Don't sort if doing relocatable link,
4203 Don't sort .ctors and .dtors if ctors_in_init_array.
4204 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
4205 (Layout::output_section_name): Add relobj parameter. Change all
4206 callers. Handle .ctors. and .dtors. in code rather than table.
4207 Handle .ctors and .dtors if ctors_in_init_array.
4208 (Layout::match_file_name): New function, moved from output.cc.
4209 * layout.h (class Layout): Update declarations.
4210 * output.cc: Include "layout.h".
4211 (Input_section_sort_entry::get_priority): New function.
4212 (Input_section_sort_entry::match_file_name): Just call
4213 Layout::match_file_name.
4214 (Output_section::Input_section_sort_init_fini_compare::operator()):
4215 Handle .ctors and .dtors. Sort by explicit priority rather than
4216 by name.
4217 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
4218 * testsuite/initpri2.c: New test.
4219 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
4220 (check_PROGRAMS): Add initpri2.
4221 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
4222 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
4223 * configure, testsuite/Makefile.in: Rebuild.
4224
e1f74f98
ILT
42252011-06-19 Ian Lance Taylor <iant@google.com>
4226
4227 PR gold/12880
4228 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
4229 .interp section to a PT_INTERP segment even if we have seen a
4230 --dynamic-linker option. Don't do it if we have seen a PHDRS
4231 clause in a linker script.
4232 (Layout::finalize): Don't create a .interp section if we've
4233 already create a PT_INTERP segment.
4234 (Layout::create_interp): Always call choose_output_section (revert
4235 patch of 2011-06-17). Don't create PT_INTERP segment.
4236 * script-sections.cc
4237 (Script_sections::create_note_and_tls_segments): Add a .interp
4238 section to a PT_INTERP segment even if we have seen a
4239 --dynamic-linker option.
4240
766f91bb
ILT
42412011-06-18 Ian Lance Taylor <iant@google.com>
4242
4243 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
4244 merely because a non-PT_LOAD segment has a dynamic reloc.
4245
0d212c3a
ILT
42462011-06-18 Ian Lance Taylor <iant@google.com>
4247
4248 * layout.cc (Layout::finish_dynamic_section): Don't create
4249 DT_FLAGS entry if not needed.
4250
911a5072
ILT
42512011-06-18 Ian Lance Taylor <iant@google.com>
4252
4253 PR gold/12745
4254 * layout.cc (Layout::layout_eh_frame): Correct handling of
4255 writable .eh_frame section.
4256
534b4e5f
ILT
42572011-06-17 Ian Lance Taylor <iant@google.com>
4258
4259 PR gold/12893
4260 * resolve.cc (Symbol_table::resolve): Don't give an error if a
4261 symbol is redefined with the exact same object and value.
4262
10b4f102
ILT
42632011-06-17 Ian Lance Taylor <iant@google.com>
4264
4265 PR gold/12880
4266 * layout.h (class Layout): Add interp_segment_ field.
4267 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
4268 (Layout::attach_allocated_section_to_segment): If making shared
4269 library, put .interp section in PT_INTERP segment.
4270 (Layout::finalize): Also call create_interp if -dynamic-linker
4271 option was used.
4272 (Layout::create_interp): Assert that there is no PT_INTERP
4273 segment. If not using a SECTIONS clause, use make_output_section.
4274 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
4275 * script-sections.cc
4276 (Script_sections::create_note_and_tls_segments): If making shared
4277 library, put .interp section in PT_INTERP segment.
4278
a29b0dad
ILT
42792011-06-17 Ian Lance Taylor <iant@google.com>
4280
e588ea8d
ILT
4281 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
4282 when making a shared library.
4283
42842011-06-17 Ian Lance Taylor <iant@google.com>
4285
4286 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
4287 parameter. Change all callers. Don't issue warning about PC32
4288 against locally defined symbol.
a29b0dad 4289
9d3b0698
ILT
42902011-06-16 Ian Lance Taylor <iant@google.com>
4291
4292 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
4293 occurs in same object.
4294
85b0f90c
AM
42952011-06-14 Alan Modra <amodra@gmail.com>
4296
4297 * po/POTFILES.in: Regenerate.
4298
a94907d9
ILT
42992011-06-09 Ian Lance Taylor <iant@google.com>
4300
4301 * script-sections.cc
4302 (Orphan_output_section::set_section_addresses): For a relocatable
4303 link set address to 0.
4304
4fb3a1c3
CC
43052011-06-09 Cary Coutant <ccoutant@google.com>
4306
4307 PR gold/12804
4308 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
4309 used with --compress-debug-sections.
4310 * gold/object.cc (Sized_relobj_file::do_layout): Report
4311 uncompressed size of compressed input sections.
4312
61220854
CC
43132011-06-08 Cary Coutant <ccoutant@google.com>
4314
4315 PR gold/12804
4316 * testsuite/two_file_test_2_v1.cc: Change initialization of
4317 v2 to keep it in .data.
4318
e6455dfb
CC
43192011-06-07 Cary Coutant <ccoutant@google.com>
4320
4321 * common.cc (Symbol_table::do_allocate_commons_list): Call
4322 gold_fallback.
4323 * errors.cc (Errors::fatal): Adjust call to gold_exit.
4324 (Errors::fallback): New function.
4325 (gold_fallback): New function.
4326 * errors.h (Errors::fallback): New function.
4327 * gold.cc (gold_exit): Change status parameter to enum; adjust
4328 all callers.
4329 (queue_initial_tasks): Call gold_fallback.
4330 * gold.h: Include cstdlib.
4331 (Exit_status): New enum type.
4332 (gold_exit): Change status parameter to enum.
4333 (gold_fallback): New function.
4334 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
4335 (Layout::create_symtab_sections): Likewise.
4336 (Layout::create_shdrs): Likewise.
4337 * main.cc (main): Adjust call to gold_exit.
4338 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
4339 (Output_data_got::add_got_entry_pair): Likewise.
4340 (Output_section::add_input_section): Likewise.
4341 (Output_section::add_output_section_data): Likewise.
4342 (Output_segment::set_section_list_addresses): Likewise.
4343 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
4344
fb0e076f
CC
43452011-06-07 Cary Coutant <ccoutant@google.com>
4346
4347 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
4348 for incremental links.
4349 * output.cc (Output_segment::set_section_list_addresses): Remove
4350 FIXME and test for TLS or BSS.
4351
a5ee4d5d
CC
43522011-06-07 Cary Coutant <ccoutant@google.com>
4353
4354 * testsuite/Makefile.am: Add incremental_copy_test,
4355 incremental_common_test_1.
4356 * testsuite/Makefile.in: Regenerate.
4357 * testsuite/common_test_1_v1.c: New source file.
4358 * testsuite/common_test_1_v2.c: New source file.
4359 * testsuite/copy_test_v1.cc: New source file.
4360
5146f448
CC
43612011-06-07 Cary Coutant <ccoutant@google.com>
4362
4363 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
4364 update, allocate common from bss section's free list.
4365 * incremental-dump.cc (dump_incremental_inputs): Print flag for
4366 linker-defined symbols.
4367 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
4368 Skip GOT and PLT entries that are no longer referenced.
4369 (Output_section_incremental_inputs::write_info_blocks): Mark
4370 linker-defined symbols.
4371 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
4372 * output.cc (Output_section::allocate): New function.
4373 * output.h (Output_section::allocate): New function.
4374 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
4375 linker-defined symbols.
4376 (Symbol::override_base_with_special): Copy is_predefined_ flag.
4377 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
4378 (Symbol::init_base_output_data): Likewise.
4379 (Symbol::init_base_output_segment): Likewise.
4380 (Symbol::init_base_constant): Likewise.
4381 (Sized_symbol::init_output_data): Likewise.
4382 (Sized_symbol::init_output_segment): Likewise.
4383 (Sized_symbol::init_constant): Likewise.
4384 (Symbol_table::do_define_in_output_data): Likewise.
4385 (Symbol_table::do_define_in_output_segment): Likewise.
4386 (Symbol_table::do_define_as_constant): Likewise.
4387 * symtab.h (Symbol::is_predefined): New function.
4388 (Symbol::init_base_output_data): Add is_predefined parameter.
4389 (Symbol::init_base_output_segment): Likewise.
4390 (Symbol::init_base_constant): Likewise.
4391 (Symbol::is_predefined_): New data member.
4392 (Sized_symbol::init_output_data): Add is_predefined parameter.
4393 (Sized_symbol::init_output_segment): Likewise.
4394 (Sized_symbol::init_constant): Likewise.
4395 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
4396
26d3c67d
CC
43972011-06-07 Cary Coutant <ccoutant@google.com>
4398
4399 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
4400 instead of emit_copy_reloc.
4401 (Copy_relocs::emit_copy_reloc): Refactor.
4402 (Copy_relocs::make_copy_reloc): New function.
4403 (Copy_relocs::add_copy_reloc): Remove.
4404 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
4405 section.
4406 (Copy_relocs::make_copy_reloc): New function.
4407 (Copy_relocs::add_copy_reloc): Remove.
4408 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
4409 unchanged input files.
4410 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
4411 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
4412 Reserve BSS space for COPY relocations.
4413 (Sized_incremental_binary::do_emit_copy_relocs): New function.
4414 (Output_section_incremental_inputs::write_info_blocks): Record
4415 whether a symbol is copied from a shared object.
4416 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
4417 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
4418 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
4419 (Incremental_input_entry_reader::get_output_symbol_index): Add
4420 is_copy parameter.
4421 (Incremental_binary::emit_copy_relocs): New function.
4422 (Incremental_binary::do_emit_copy_relocs): New function.
4423 (Sized_incremental_binary::Sized_incremental_binary): Initialize
4424 new data member.
4425 (Sized_incremental_binary::add_copy_reloc): New function.
4426 (Sized_incremental_binary::do_emit_copy_relocs): New function.
4427 (Sized_incremental_binary::Copy_reloc): New struct.
4428 (Sized_incremental_binary::Copy_relocs): New typedef.
4429 (Sized_incremental_binary::copy_relocs_): New data member.
4430 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
4431 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
4432 * target.h (Sized_target::emit_copy_reloc): New function.
4433 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
4434
7cdb37d9
CC
44352011-06-02 Cary Coutant <ccoutant@google.com>
4436
4437 PR gold/12163
4438 * gold/archive.cc (Archive::Archive): Initialize new data member.
4439 (Archive::include_all_members): Return if archive has already been
4440 included.
4441 * gold/archive.h (Archive::include_all_members_): New data member.
4442
cc643b88
NC
44432011-06-02 Nick Clifton <nickc@redhat.com>
4444
4445 * dynobj.h: Fix spelling mistake in comment.
4446 * output.cc: Likewise.
4447
f62a3ca7 44482011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 4449 Asier Llano
f62a3ca7
DK
4450
4451 PR gold/12826
cc643b88 4452 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
4453 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
4454 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
4455 redundant arm_exidx_test.so.
4456 * testsuite/Makefile.in: Regenerate.
4457 (check_SCRIPTS): Add pr12826.sh
4458 (check_DATA): Add pr12826.stdout
4459 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
4460 * testsuite/pr12826.sh: New file.
4461 * testsuite/pr12826_1.s: Ditto.
4462 * testsuite/pr12826_1.s: Ditto.
4463
8dbe1edc
ILT
44642011-05-30 Ian Lance Taylor <iant@google.com>
4465
4466 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
4467 sections.
4468
c49875be
ILT
44692011-05-29 Ian Lance Taylor <iant@google.com>
4470
4471 PR gold/12804
4472 * testsuite/Makefile.am: Use different file name for two_file_test
4473 temporary file for each incremental test.
4474 * testsuite/Makefile.in: Rebuild.
4475
69d53f7a
ILT
44762011-05-29 Ian Lance Taylor <iant@google.com>
4477
4478 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
4479 binary input file is empty.
4480
41d0ab5f
ILT
44812011-05-27 Ian Lance Taylor <iant@google.com>
4482
4483 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
4484 (ver_test_9.so): Likewise.
4485 * testsuite/Makefile.in: Rebuild.
4486
89d8a36b
CC
44872011-05-26 Cary Coutant <ccoutant@google.com>
4488
4489 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
4490 * incremental.cc (Incremental_inputs::report_input_section): Fix
4491 comment, indentation.
4492 (Incremental_inputs::report_comdat_group): New function.
4493 (Output_section_incremental_inputs::set_final_data_size): Adjust size
4494 of data for incremental input file entry.
4495 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
4496 group count, COMDAT group signatures.
4497 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
4498 an unchanged input file.
4499 * incremental.h (Incremental_object_entry::Incremental_object_entry):
4500 Initialize new data member.
4501 (Incremental_object_entry::add_comdat_group): New function.
4502 (Incremental_object_entry::get_comdat_group_count): New function.
4503 (Incremental_object_entry::get_comdat_signature_key): New function.
4504 (Incremental_object_entry::groups_): New data member.
4505 (Incremental_inputs::report_comdat_group): New function.
4506 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
4507 data for incremental input file entry.
4508 (Incremental_input_entry_reader::get_comdat_group_count): New function.
4509 (Incremental_input_entry_reader::get_input_section): Adjust size of
4510 data for incremental input file entry.
4511 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
4512 (Incremental_input_entry_reader::get_comdat_group_signature): New
4513 function.
4514 * object.cc (Sized_relobj::include_section_group): Report kept
4515 COMDAT groups for incremental links.
4516
1706a06f
ILT
45172011-05-24 David Meyer <pdox@google.com>
4518
4519 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
4520 with name parameter. Add found_name parameter.
4521 * fileread.cc (Input_file::find_file): Adjust code accordingly.
4522 * dirsearch.h (class Dirsearch): Update declaration.
4523
a10ae760
ILT
45242011-05-24 Ian Lance Taylor <iant@google.com>
4525
4526 * archive.cc (Library_base::should_include_member): Pull in object
4527 from archive if it defines the entry symbol.
4528 * parameters.cc (Parameters::entry): New function.
4529 * parameters.h (class Parameters): Declare entry.
4530 * output.h (class Output_file_header): Remove entry_ field.
4531 * output.cc (Output_file_header::Output_file_header): Remove entry
4532 parameter. Change all callers.
4533 (Output_file_header::entry): Use parameters->entry.
4534 * gold.cc (queue_middle_tasks): Likewise.
4535 * plugin.cc (Plugin_hook::run): Likewise.
4536
aa92d6ed
CC
45372011-05-24 Cary Coutant <ccoutant@google.com>
4538
4539 * gold.cc (queue_initial_tasks): Pass incremental base filename
4540 to Output_file::open_base_file; don't print error message.
4541 * incremental-dump.cc (main): Adjust call to
4542 Output_file::open_for_modification.
4543 * incremental-dump.cc (main): Likewise.
4544 * incremental.cc (Incremental_inputs::report_command_line):
4545 Ignore --incremental-base option when comparing command lines.
4546 Ignore parameter when given as separate argument.
4547 * options.h (class General_options): Add --incremental-base.
4548 * output.cc (Output_file::Output_file):
4549 (Output_file::open_base_file): Add base_name and writable parameters;
4550 read base file into new file; print error message here.
4551 (Output_file::map_no_anonymous): Add writable parameter; adjust all
4552 callers.
4553 * output.h (Output_file::open_for_modification): Rename to...
4554 (Output_file::open_base_file): ...this; add base_name and
4555 writable parameters; adjust all callers.
4556 (Output_file::map_no_anonymous): Add writable parameter; adjust all
4557 callers.
4558 * testsuite/Makefile.am (incremental_test_4): Test
4559 --incremental-base.
4560 * testsuite/Makefile.in: Regenerate.
4561
2eedd706
CC
45622011-05-24 Cary Coutant <ccoutant@google.com>
4563
4564 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
4565 incremental_test_4.
4566 * testsuite/Makefile.in: Regenerate.
4567 * testsuite/two_file_test_1_v1.cc: New test source file.
4568 * testsuite/two_file_test_1b_v1.cc: New test source file.
4569 * testsuite/two_file_test_2_v1.cc: New test source file.
4570
0f1c85a6
CC
45712011-05-24 Cary Coutant <ccoutant@google.com>
4572
4573 * dynobj.h (Dynobj::do_dynobj): New function.
4574 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
4575 flag and soname for shared objects.
4576 * incremental.cc (Incremental_inputs::report_object): Make
4577 either Incremental_object_entry or Incremental_dynobj_entry; add
4578 soname to string table.
4579 (Incremental_inputs::report_input_section): Add assertion.
4580 (Output_section_incremental_inputs::set_final_data_size): Adjust
4581 type of input file entry for shared libraries; adjust size of
4582 shared library info entry.
4583 (Output_section_incremental_inputs::write_input_files): Write
4584 as_needed flag for shared libraries.
4585 (Output_section_incremental_inputs::write_info_blocks): Adjust type
4586 of input file entry for shared libraries; write soname.
4587 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
4588 soname from incremental info.
4589 * incremental.h (enum Incremental_input_flags): Add
4590 INCREMENTAL_INPUT_AS_NEEDED.
4591 (Incremental_input_entry::Incremental_input_entry): Initialize new
4592 data member.
4593 (Incremental_input_entry::set_as_needed): New function.
4594 (Incremental_input_entry::as_needed): New function.
4595 (Incremental_input_entry::do_dynobj_entry): New function.
4596 (Incremental_input_entry::as_needed_): New data member.
4597 (Incremental_object_entry::Incremental_object_entry): Don't check
4598 for shared library.
4599 (Incremental_object_entry::do_type): Likewise.
4600 (class Incremental_dynobj_entry): New class.
4601 (Incremental_input_entry_reader::as_needed): New function.
4602 (Incremental_input_entry_reader::get_soname): New function.
4603 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
4604 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
4605 size of shared library info entry.
58797674 4606 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
4607 incremental link when adding DT_NEEDED entries.
4608 * object.h (Object::Object): Initialize new data member.
4609 (Object::dynobj): New function.
4610 (Object::set_as_needed): New function.
4611 (Object::as_needed): New function.
4612 (Object::do_dynobj): New function.
4613 (Object::as_needed_): New data member.
4614
6fa2a40b
CC
46152011-05-24 Cary Coutant <ccoutant@google.com>
4616
4617 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
4618 info; adjust display of GOT entries.
4619 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
4620 vector of input objects; remove file_status_.
4621 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
4622 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
4623 got_plt reader; call target hooks to reserve GOT entries.
4624 (Output_section_incremental_inputs::set_final_data_size): Adjust size
4625 of input file info header and GOT info entry.
4626 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
4627 relocation info.
4628 (Got_plt_view_info::got_descriptor): Remove.
4629 (Got_plt_view_info::sym_index): New data member.
4630 (Got_plt_view_info::input_index): New data member.
4631 (Local_got_offset_visitor::visit): Write input file index.
4632 (Global_got_offset_visitor::visit): Write 0 for input file index.
4633 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
4634 with sym_index and input_index.
4635 (Output_section_incremental_inputs::write_got_plt): Adjust size of
4636 incremental info GOT entry; replace got_descriptor with input_index.
4637 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
4638 map from input file index to object.
4639 (Sized_relobj_incr::do_layout): Replace direct data member reference
4640 with accessor function.
4641 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
4642 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
4643 Adjust size of input file info header.
4644 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
4645 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
4646 (Incremental_input_entry_reader::get_input_section): Adjust size of
4647 input file info header.
4648 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
4649 of incremental info GOT entry.
4650 (Incremental_got_plt_reader::get_got_desc): Remove.
4651 (Incremental_got_plt_reader::get_got_symndx): New function.
4652 (Incremental_got_plt_reader::get_got_input_index): New function.
4653 (Sized_incremental_binary::Sized_incremental_binary): Remove
4654 file_status_; add input_objects_.
4655 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
4656 (Sized_incremental_binary::set_file_is_unchanged): Remove.
4657 (Sized_incremental_binary::file_is_unchanged): Remove.
4658 (Sized_incremental_binary::set_input_object): New function.
4659 (Sized_incremental_binary::input_object): New function.
4660 (Sized_incremental_binary::file_status_): Remove.
4661 (Sized_incremental_binary::input_objects_): New data member.
4662 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
4663 references.
4664 (Sized_relobj_incr::invalid_address): Move to base class.
4665 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
4666 class.
4667 (Sized_relobj_incr::do_output_section_offset): Likewise.
4668 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
4669 (Sized_relobj_incr::section_offsets_): Likewise.
4670 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
4671 function.
4672 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
4673 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
4674 with accessor function.
4675 (Sized_relobj_file::do_layout): Likewise.
4676 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
4677 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
4678 (Sized_relobj_file::compute_final_local_value): Replace refs to
4679 section_offsets_ with accessor function.
4680 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
4681 * object.h (Relobj::Relobj): Initialize new data members.
4682 (Relobj::add_dyn_reloc): New function.
4683 (Relobj::first_dyn_reloc): New function.
4684 (Relobj::dyn_reloc_count): New function.
4685 (Relobj::first_dyn_reloc_): New data member.
4686 (Relobj::dyn_reloc_count_): New data member.
4687 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
4688 references.
4689 (Sized_relobj::Address): New typedef.
4690 (Sized_relobj::invalid_address): Move here from child class.
4691 (Sized_relobj::Sized_relobj): Initialize new data members.
4692 (Sized_relobj::sized_relobj): New function.
4693 (Sized_relobj::is_output_section_offset_invalid): Move here from
4694 child class.
4695 (Sized_relobj::get_output_section_offset): Likewise.
4696 (Sized_relobj::local_has_got_offset): Likewise.
4697 (Sized_relobj::local_got_offset): Likewise.
4698 (Sized_relobj::set_local_got_offset): Likewise.
4699 (Sized_relobj::do_for_all_local_got_entries): Likewise.
4700 (Sized_relobj::clear_got_offsets): New function.
4701 (Sized_relobj::section_offsets): Move here from child class.
4702 (Sized_relobj::do_output_section_offset): Likewise.
4703 (Sized_relobj::do_set_section_offset): Likewise.
4704 (Sized_relobj::Local_got_offsets): Likewise.
4705 (Sized_relobj::local_got_offsets_): Likewise.
4706 (Sized_relobj::section_offsets_): Likewise.
4707 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
4708 references.
4709 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
4710 class.
4711 (Sized_relobj_file::sized_relobj): New function
4712 (Sized_relobj_file::local_has_got_offset): Move to base class.
4713 (Sized_relobj_file::local_got_offset): Likewise.
4714 (Sized_relobj_file::set_local_got_offset): Likewise.
4715 (Sized_relobj_file::get_output_section_offset): Likewise.
4716 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
4717 (Sized_relobj_file::do_output_section_offset): Likewise.
4718 (Sized_relobj_file::do_set_section_offset): Likewise.
4719 (Sized_relobj_file::Local_got_offsets): Likewise.
4720 (Sized_relobj_file::local_got_offsets_): Likewise.
4721 (Sized_relobj_file::section_offsets_): Likewise.
4722 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
4723 (all constructors).
4724 (set_needs_dynsym_index): Convert relobj to derived class pointer.
4725 (Output_reloc::get_symbol_index): Likewise.
4726 (Output_reloc::local_section_offset): Likewise.
4727 (Output_reloc::get_address): Likewise.
4728 (Output_reloc::symbol_value): Likewise.
4729 (Output_data_got::reserve_slot): Move to class definition.
4730 (Output_data_got::reserve_local): New function.
4731 (Output_data_got::reserve_slot_for_global): Remove.
4732 (Output_data_got::reserve_global): New function.
4733 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
4734 (all constructors, two instantiations).
4735 (Output_reloc::get_relobj): New function (two instantiations).
4736 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
4737 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
4738 (Output_data_reloc::add_global): Adjust type of relobj.
4739 (Output_data_reloc::add_global_relative): Likewise.
4740 (Output_data_reloc::add_symbolless_global_addend): Likewise.
4741 (Output_data_reloc::add_local): Likewise.
4742 (Output_data_reloc::add_local_relative): Likewise.
4743 (Output_data_reloc::add_symbolless_local_addend): Likewise.
4744 (Output_data_reloc::add_local_section): Likewise.
4745 (Output_data_reloc::add_output_section): Likewise.
4746 (Output_data_reloc::add_absolute): Likewise.
4747 (Output_data_reloc::add_target_specific): Likewise.
4748 (Output_data_got::reserve_slot): Move definition here.
4749 (Output_data_got::reserve_local): New function.
4750 (Output_data_got::reserve_global): New function.
4751 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
4752 section_offsets_ with accessor function.
4753 (Sized_relobj_file::write_sections): Likewise.
4754 (Sized_relobj_file::do_relocate_sections): Likewise.
4755 * target.h (Sized_target::reserve_local_got_entry): New function.
4756 (Sized_target::reserve_global_got_entry): New function.
4757 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
4758 (Target_x86_64::reserve_global_got_entry): New function.
4759 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
4760
4829d394
CC
47612011-05-23 Cary Coutant <ccoutant@google.com>
4762
4763 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
4764 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
4765 bit when checking got_type.
4766 * incremental.cc (Sized_incremental_binary::setup_readers):
4767 Store symbol table and string table locations; initialize bit vector
4768 of file status flags.
4769 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
4770 unchanged files.
4771 (Sized_incremental_binary::do_process_got_plt): New function.
4772 (Sized_incremental_binary::get_symtab_view): Use stored locations.
4773 (Output_section_incremental_inputs::set_final_data_size): Record
4774 file index for each input file.
4775 (Output_section_incremental_inputs::write_got_plt): Store file index
4776 instead of input entry offset for each GOT entry.
4777 * incremental.h
4778 (Incremental_input_entry::Incremental_input_entry): Initialize new
4779 data member.
4780 (Incremental_input_entry::set_offset): Store file index.
4781 (Incremental_input_entry::get_file_index): New function.
4782 (Incremental_input_entry::file_index_): New data member.
4783 (Incremental_binary::process_got_plt): New function.
4784 (Incremental_binary::do_process_got_plt): New function.
4785 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
4786 data members.
4787 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
4788 (Sized_incremental_binary::set_file_is_unchanged): New function.
4789 (Sized_incremental_binary::file_is_unchanged): New function.
4790 (Sized_incremental_binary::do_process_got_plt): New function.
4791 (Sized_incremental_binary::file_status_): New data member.
4792 (Sized_incremental_binary::main_symtab_loc_): New data member.
4793 (Sized_incremental_binary::main_strtab_loc_): New data member.
4794 * output.cc (Output_data_got::Got_entry::write): Add case
4795 RESERVED_CODE.
4796 (Output_data_got::add_global): Call add_got_entry.
4797 (Output_data_got::add_global_plt): Likewise.
4798 (Output_data_got::add_global_with_rel): Likewise.
4799 (Output_data_got::add_global_with_rela): Likewise.
4800 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
4801 (Output_data_got::add_global_pair_with_rela): Likewise.
4802 (Output_data_got::add_local): Call add_got_entry.
4803 (Output_data_got::add_local_plt): Likewise.
4804 (Output_data_got::add_local_with_rel): Likewise.
4805 (Output_data_got::add_local_with_rela): Likewise.
4806 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
4807 (Output_data_got::add_local_pair_with_rela): Likewise.
4808 (Output_data_got::reserve_slot): New function.
4809 (Output_data_got::reserve_slot_for_global): New function.
4810 (Output_data_got::add_got_entry): New function.
4811 (Output_data_got::add_got_entry_pair): New function.
4812 (Output_section::add_output_section_data): Edit FIXME.
4813 * output.h
4814 (Output_section_data_build::Output_section_data_build): New
4815 constructor with size parameter.
4816 (Output_data_space::Output_data_space): Likewise.
4817 (Output_data_got::Output_data_got): Initialize new data member; new
4818 constructor with size parameter.
4819 (Output_data_got::add_constant): Call add_got_entry.
4820 (Output_data_got::reserve_slot): New function.
4821 (Output_data_got::reserve_slot_for_global): New function.
4822 (class Output_data_got::Got_entry): Add RESERVED_CODE.
4823 (Output_data_got::add_got_entry): New function.
4824 (Output_data_got::add_got_entry_pair): New function.
4825 (Output_data_got::free_list_): New data member.
4826 * target.h (Sized_target::init_got_plt_for_update): New function.
4827 (Sized_target::register_global_plt_entry): New function.
4828 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4829 Initialize new data member; call init; add constructor with PLT count.
4830 (Output_data_plt_x86_64::init): New function.
4831 (Output_data_plt_x86_64::add_relocation): New function.
4832 (Output_data_plt_x86_64::reserve_slot): New function.
4833 (Output_data_plt_x86_64::free_list_): New data member.
4834 (Target_x86_64::init_got_plt_for_update): New function.
4835 (Target_x86_64::register_global_plt_entry): New function.
4836 (Output_data_plt_x86_64::add_entry): Allocate from free list for
4837 incremental updates.
4838 (Output_data_plt_x86_64::add_relocation): New function.
4839 * testsuite/object_unittest.cc (Object_test): Set default options.
4840
ec69d6da
ILT
48412011-05-16 Ian Lance Taylor <iant@google.com>
4842
4843 * options.h (class General_options): Make -i a synonym for -r.
4844
732e31de
ILT
48452011-05-16 Ian Lance Taylor <iant@google.com>
4846
4847 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
4848
403676b5
CC
48492011-05-10 Cary Coutant <ccoutant@google.com>
4850
4851 * object.cc (Sized_relobj::do_count_local_symbols): Check for
4852 strip_all (-s).
4853
5b7b7d6e
ILT
48542011-05-06 Ian Lance Taylor <iant@google.com>
4855
4856 * layout.cc (Layout::layout): If the output section flags change,
4857 update the ordering.
4858
f0f9babf
CC
48592011-04-25 Cary Coutant <ccoutant@google.com>
4860
4861 * incremental-dump.cc (dump_incremental_inputs): Print local
4862 symbol info for each input file.
4863 * incremental.cc
4864 (Output_section_incremental_inputs::set_final_data_size): Add local
4865 symbol info to input file entries in incremental info.
4866 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4867 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
4868 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
4869 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
4870 implementation.
4871 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
4872 (Sized_incr_relobj::do_relocate): Write the local symbols.
4873 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
4874 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
4875 Adjust size of input file header.
4876 (Incremental_inputs_reader::get_local_symbol_offset): New function.
4877 (Incremental_inputs_reader::get_local_symbol_count): New function.
4878 (Incremental_inputs_reader::get_input_section): Adjust size of input
4879 file header.
4880 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
4881 (Sized_incr_relobj::This): New typedef.
4882 (Sized_incr_relobj::sym_size): New const data member.
4883 (Sized_incr_relobj::Local_symbol): New struct.
4884 (Sized_incr_relobj::do_output_local_symbol_count): New function.
4885 (Sized_incr_relobj::do_local_symbol_offset): New function.
4886 (Sized_incr_relobj::local_symbol_count_): New data member.
4887 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
4888 (Sized_incr_relobj::local_symbol_index_): New data member.
4889 (Sized_incr_relobj::local_symbol_offset_): New data member.
4890 (Sized_incr_relobj::local_dynsym_offset_): New data member.
4891 (Sized_incr_relobj::local_symbols_): New data member.
4892 * object.h (Relobj::output_local_symbol_count): New function.
4893 (Relobj::local_symbol_offset): New function.
4894 (Relobj::do_output_local_symbol_count): New function.
4895 (Relobj::do_local_symbol_offset): New function.
4896 (Sized_relobj::do_output_local_symbol_count): New function.
4897 (Sized_relobj::do_local_symbol_offset): New function.
4898
d0a9ace3
ILT
48992011-04-22 Vladimir Simonov <sv@sw.ru>
4900
4901 * descriptors.cc (set_close_on_exec): New function.
4902 (Descriptors::open): Use set_close_on_exec.
4903 * output.cc (S_ISLNK): Define if not defined.
4904
94a3fc8b
CC
49052011-04-22 Cary Coutant <ccoutant@google.com>
4906
4907 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
4908 global symbol map.
4909 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
4910 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
4911 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
4912 relocations.
4913 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
4914 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
4915 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
4916 * incremental.h
4917 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
4918 function.
4919 (Incremental_binary::apply_incremental_relocs): New function.
4920 (Incremental_binary::do_apply_incremental_relocs): New function.
4921 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
4922 data member.
4923 (Sized_incremental_binary::add_global_symbol): New function.
4924 (Sized_incremental_binary::global_symbol): New function.
4925 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
4926 (Sized_incremental_binary::symbol_map_): New data member.
4927 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
4928 * target.h (Sized_target::apply_relocation): New function.
4929 * target-reloc.h (apply_relocation): New function.
4930 * x86_64.cc (Target_x86_64::apply_relocation): New function.
4931
c87e4302
DK
49322011-04-22 Doug Kwan <dougkwan@google.com>
4933
4934 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
4935 flag of a SHT_ARM_EXIDX section.
2e702c99 4936 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
4937 * testsuite/Makefile.in: Regenerate.
4938 * testsuite/arm_exidx_test.s: New file.
4939 * testsuite/arm_exidx_test.sh: Same.
4940
e7782cf6
CC
49412011-04-20 Cary Coutant <ccoutant@google.com>
4942
4943 PR gold/12689
4944 * archive.h (Incremental_archive_entry::Archive_member):
4945 Initialize arg_serial_ (second constructor).
4946
308ecdc7
ILT
49472011-04-17 Ian Lance Taylor <iant@google.com>
4948
4949 * object.cc (Relocate_info::location): Simplify location string.
4950 * errors.cc (Errors::error_at_location): Don't print program
4951 name.
4952 (Errors::warning_at_location): Likewise.
4953 (Errors::undefined_symbol): Likewise.
4954 * testsuite/debug_msg.sh: Update accordingly.
4955
bec5b579
CC
49562011-04-14 Cary Coutant <ccoutant@google.com>
4957
4958 * gold/layout.cc (Layout::symtab_section_offset): New function.
4959 * gold/layout.h (Layout::symtab_section_offset): New function.
4960 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
4961
88597d34
ILT
49622011-04-12 Ian Lance Taylor <iant@google.com>
4963
4964 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
4965 with MREMAP_MAYMOVE.
4966 * output.h (class Output_file): Add map_is_allocated_ field.
4967 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
4968 not available, provide stubs. If mremap is not available, #define
4969 it to gold_mremap.
4970 (MREMAP_MAYMOVE): Define if not defined.
4971 (Output_file::Output_file): Initialize map_is_allocated_.
4972 (Output_file::resize): Check map_is_allocated_.
4973 (Output_file::map_anonymous): If mmap fails, use malloc.
4974 (Output_file::unmap): Don't do anything for an anonymous map.
4975 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
4976 is not available, provide stubs.
4977 (File_read::View::~View): Use free rather than delete[].
4978 (File_read::make_view): Use malloc rather than new[]. If mmap
4979 fails, use malloc.
4980 (File_read::find_or_make_view): Use malloc rather than new[].
4981 * gold.h: Remove HAVE_REMAP code.
4982 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
4983 exists. Rename mremap to gold_mremap. If mmap is not available
4984 don't do anything.
4985 * configure, config.in: Rebuild.
4986
11e361bc
ILT
49872011-04-11 Ian Lance Taylor <iant@google.com>
4988
4989 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
4990 initialize local variable v.
4991
cdc29364
CC
49922011-04-11 Cary Coutant <ccoutant@google.com>
4993
4994 * archive.cc (Archive::include_member): Adjust call to
4995 report_object.
4996 (Add_archive_symbols::run): Track argument serial numbers.
4997 (Lib_group::include_member): Likewise.
4998 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
4999 * archive.h (Incremental_archive_entry::Archive_member):
5000 Initialize arg_serial_.
5001 (Archive_member::arg_serial_): New data member.
5002 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
5003 (Sized_dynobj::do_add_symbols): Track symbols when doing an
5004 incremental link.
5005 (Sized_dynobj::do_for_all_local_got_entries): New function.
5006 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
5007 function.
5008 * fileread.cc (get_mtime): New function.
5009 * fileread.h (get_mtime): New function.
5010 * gold.cc (queue_initial_tasks): Check for incremental update.
5011 (process_incremental_input): New function.
5012 (queue_middle_tasks): Don't force valid target for incremental
5013 update.
5014 * incremental-dump.cc (find_input_containing_global): Adjust
5015 size of symbol info entry.
5016 (dump_incremental_inputs): Dump argument serial number and
5017 in_system_directory flag; bias shndx by 1; print symbol names
5018 when dumping per-file symbol lists; use new symbol info readers.
5019 * incremental.cc
5020 (Output_section_incremental_inputs:update_data_size): New function.
5021 (Sized_incremental_binary::setup_readers): Setup input readers
5022 for each input file; build maps for files added from libraries
5023 and scripts.
5024 (Sized_incremental_binary::check_input_args): New function.
5025 (Sized_incremental_binary::do_check_inputs): Build map of argument
5026 serial numbers to input arguments.
5027 (Sized_incremental_binary::do_file_has_changed): Rename
5028 do_file_is_unchanged to this; compare file modification times.
5029 (Sized_incremental_binary::do_init_layout): New function.
5030 (Sized_incremental_binary::do_reserve_layout): New function.
5031 (Sized_incremental_binary::do_get_input_reader): Remove.
5032 (Sized_incremental_binary::get_symtab_view): New function.
5033 (Incremental_checker::can_incrementally_link_output_file): Remove.
5034 (Incremental_inputs::report_command_line): Exclude --debug options.
5035 (Incremental_inputs::report_archive_begin): Add parameter; track
5036 argument serial numbers; don't put input file entry for archive
5037 before archive members.
5038 (Incremental_inputs::report_archive_end): Put input file entry
5039 for archive after archive members.
5040 (Incremental_inputs::report_object): Add parameter; track argument
5041 serial numbers and in_system_directory flag.
5042 (Incremental_inputs::report_script): Add parameter; track argument
5043 serial numbers.
5044 (Output_section_incremental_inputs::set_final_data_size): Adjust
5045 size of symbol info entry; check for forwarding symbols.
5046 (Output_section_incremental_inputs::write_input_files): Write
5047 in_system_directory flag and argument serial number.
5048 (Output_section_incremental_inputs::write_info_blocks): Map section
5049 indices between incremental info and original input file; store
5050 input section index for each symbol.
5051 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
5052 change operator() to visit().
5053 (class Global_got_offset_visitor): Likewise.
5054 (class Global_symbol_visitor_got_plt):
5055 (Output_section_incremental_inputs::write_got_plt): Use new visitor
5056 classes.
5057 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
5058 (Sized_incr_relobj::do_read_symbols): New function.
5059 (Sized_incr_relobj::do_layout): New function.
5060 (Sized_incr_relobj::do_layout_deferred_sections): New function.
5061 (Sized_incr_relobj::do_add_symbols): New function.
5062 (Sized_incr_relobj::do_should_include_member): New function.
5063 (Sized_incr_relobj::do_for_all_global_symbols): New function.
5064 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
5065 (Sized_incr_relobj::do_section_size): New function.
5066 (Sized_incr_relobj::do_section_name): New function.
5067 (Sized_incr_relobj::do_section_contents): New function.
5068 (Sized_incr_relobj::do_section_flags): New function.
5069 (Sized_incr_relobj::do_section_entsize): New function.
5070 (Sized_incr_relobj::do_section_address): New function.
5071 (Sized_incr_relobj::do_section_type): New function.
5072 (Sized_incr_relobj::do_section_link): New function.
5073 (Sized_incr_relobj::do_section_info): New function.
5074 (Sized_incr_relobj::do_section_addralign): New function.
5075 (Sized_incr_relobj::do_initialize_xindex): New function.
5076 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
5077 (Sized_incr_relobj::do_read_relocs): New function.
5078 (Sized_incr_relobj::do_gc_process_relocs): New function.
5079 (Sized_incr_relobj::do_scan_relocs): New function.
5080 (Sized_incr_relobj::do_count_local_symbols): New function.
5081 (Sized_incr_relobj::do_finalize_local_symbols): New function.
5082 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
5083 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
5084 (Sized_incr_relobj::do_relocate): New function.
5085 (Sized_incr_relobj::do_set_section_offset): New function.
5086 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
5087 (Sized_incr_dynobj::do_read_symbols): New function.
5088 (Sized_incr_dynobj::do_layout): New function.
5089 (Sized_incr_dynobj::do_add_symbols): New function.
5090 (Sized_incr_dynobj::do_should_include_member): New function.
5091 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
5092 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
5093 (Sized_incr_dynobj::do_section_size): New function.
5094 (Sized_incr_dynobj::do_section_name): New function.
5095 (Sized_incr_dynobj::do_section_contents): New function.
5096 (Sized_incr_dynobj::do_section_flags): New function.
5097 (Sized_incr_dynobj::do_section_entsize): New function.
5098 (Sized_incr_dynobj::do_section_address): New function.
5099 (Sized_incr_dynobj::do_section_type): New function.
5100 (Sized_incr_dynobj::do_section_link): New function.
5101 (Sized_incr_dynobj::do_section_info): New function.
5102 (Sized_incr_dynobj::do_section_addralign): New function.
5103 (Sized_incr_dynobj::do_initialize_xindex): New function.
5104 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
5105 (make_sized_incremental_object): New function.
5106 (Incremental_library::copy_unused_symbols): New function.
5107 (Incremental_library::do_for_all_unused_symbols): New function.
5108 * incremental.h (enum Incremental_input_flags): New type.
5109 (class Incremental_checker): Remove.
5110 (Incremental_input_entry::Incremental_input_entry): Add argument
5111 serial number.
5112 (Incremental_input_entry::arg_serial): New function.
5113 (Incremental_input_entry::set_is_in_system_directory): New function.
5114 (Incremental_input_entry::is_in_system_directory): New function.
5115 (Incremental_input_entry::arg_serial_): New data member.
5116 (Incremental_input_entry::is_in_system_directory_): New data member.
5117 (class Script_info): Move here from script.h.
5118 (Script_info::Script_info): Add filename parameter.
5119 (Script_info::filename): New function.
5120 (Script_info::filename_): New data member.
5121 (Incremental_script_entry::Incremental_script_entry): Add argument
5122 serial number.
5123 (Incremental_object_entry::Incremental_object_entry): Likewise.
5124 (Incremental_object_entry::add_input_section): Build list of input
5125 sections with map to original shndx.
5126 (Incremental_object_entry::get_input_section_index): New function.
5127 (Incremental_object_entry::shndx_): New data member.
5128 (Incremental_object_entry::name_key_): Rename; adjust all refs.
5129 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
5130 (Incremental_archive_entry::Incremental_archive_entry): Add argument
5131 serial number.
5132 (Incremental_inputs::report_archive_begin): Likewise.
5133 (Incremental_inputs::report_object): Likewise.
5134 (Incremental_inputs::report_script): Likewise.
5135 (class Incremental_global_symbol_reader): New class.
5136 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
5137 and store flags and input file type.
5138 (Incremental_input_entry_reader::arg_serial): New function.
5139 (Incremental_input_entry_reader::type): Extract type from flags.
5140 (Incremental_input_entry_reader::is_in_system_directory): New function.
5141 (Incremental_input_entry_reader::get_input_section_count): Call
5142 accessor function for type.
5143 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
5144 function for type; adjust size of global symbol entry.
5145 (Incremental_input_entry_reader::get_global_symbol_count): Call
5146 accessor function for type.
5147 (Incremental_input_entry_reader::get_object_count): Likewise.
5148 (Incremental_input_entry_reader::get_object_offset): Likewise.
5149 (Incremental_input_entry_reader::get_member_count): Likewise.
5150 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
5151 (Incremental_input_entry_reader::get_member_offset): Likewise.
5152 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
5153 (Incremental_input_entry_reader::Global_symbol_info): Remove.
5154 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
5155 (Incremental_input_entry_reader::get_global_symbol_reader): New
5156 function.
5157 (Incremental_input_entry_reader::get_output_symbol_index): New
5158 function.
5159 (Incremental_input_entry_reader::type_): Remove.
5160 (Incremental_input_entry_reader::flags_): New data member.
5161 (Incremental_inputs_reader::input_file_offset): New function.
5162 (Incremental_inputs_reader::input_file_index): New function.
5163 (Incremental_inputs_reader::input_file): Call input_file_offset.
5164 (Incremental_inputs_reader::input_file_at_offset): New function.
5165 (Incremental_relocs_reader::get_r_type): Reformat.
5166 (Incremental_relocs_reader::get_r_shndx): Reformat.
5167 (Incremental_relocs_reader::get_r_offset): Reformat.
5168 (Incremental_relocs_reader::data): New function.
5169 (Incremental_binary::Incremental_binary): Initialize new data members.
5170 (Incremental_binary::check_inputs): Add cmdline parameter.
5171 (Incremental_binary::file_is_unchanged): Remove.
5172 (Input_reader::arg_serial): New function.
5173 (Input_reader::get_unused_symbol_count): New function.
5174 (Input_reader::get_unused_symbol): New function.
5175 (Input_reader::do_arg_serial): New function.
5176 (Input_reader::do_get_unused_symbol_count): New function.
5177 (Input_reader::do_get_unused_symbol): New function.
5178 (Incremental_binary::input_file_count): New function.
5179 (Incremental_binary::get_input_reader): Change signature to use
5180 index instead of filename.
5181 (Incremental_binary::file_has_changed): New function.
5182 (Incremental_binary::get_input_argument): New function.
5183 (Incremental_binary::get_library): New function.
5184 (Incremental_binary::get_script_info): New function.
5185 (Incremental_binary::init_layout): New function.
5186 (Incremental_binary::reserve_layout): New function.
5187 (Incremental_binary::output_file): New function.
5188 (Incremental_binary::do_check_inputs): New function.
5189 (Incremental_binary::do_file_is_unchanged): Remove.
5190 (Incremental_binary::do_file_has_changed): New function.
5191 (Incremental_binary::do_init_layout): New function.
5192 (Incremental_binary::do_reserve_layout): New function.
5193 (Incremental_binary::do_input_file_count): New function.
5194 (Incremental_binary::do_get_input_reader): Change signature.
5195 (Incremental_binary::input_args_map_): New data member.
5196 (Incremental_binary::library_map_): New data member.
5197 (Incremental_binary::script_map_): New data member.
5198 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5199 new data members.
5200 (Sized_incremental_binary::output_section): New function.
5201 (Sized_incremental_binary::inputs_reader): Add const.
5202 (Sized_incremental_binary::symtab_reader): Add const.
5203 (Sized_incremental_binary::relocs_reader): Add const.
5204 (Sized_incremental_binary::got_plt_reader): Add const.
5205 (Sized_incremental_binary::get_symtab_view): New function.
5206 (Sized_incremental_binary::Inputs_reader): New typedef.
5207 (Sized_incremental_binary::Input_entry_reader): New typedef.
5208 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
5209 (Sized_incremental_binary::do_file_is_unchanged): Remove.
5210 (Sized_incremental_binary::do_file_has_changed): New function.
5211 (Sized_incremental_binary::do_init_layout): New function.
5212 (Sized_incremental_binary::do_reserve_layout): New function.
5213 (Sized_input_reader::Inputs_reader): Remove.
5214 (Sized_input_reader::Input_entry_reader): Remove.
5215 (Sized_input_reader::do_arg_serial): New function.
5216 (Sized_input_reader::do_get_unused_symbol_count): New function.
5217 (Sized_input_reader::do_get_unused_symbol): New function.
5218 (Sized_incremental_binary::do_input_file_count): New function.
5219 (Sized_incremental_binary::do_get_input_reader): Change signature;
5220 use index instead of filename.
5221 (Sized_incremental_binary::section_map_): New data member.
5222 (Sized_incremental_binary::input_entry_readers_): New data member.
5223 (class Sized_incr_relobj): New class.
5224 (class Sized_incr_dynobj): New class.
5225 (make_sized_incremental_object): New function.
5226 (class Incremental_library): New class.
5227 * layout.cc (Free_list::num_lists): New static data member.
5228 (Free_list::num_nodes): New static data member.
5229 (Free_list::num_removes): New static data member.
5230 (Free_list::num_remove_visits): New static data member.
5231 (Free_list::num_allocates): New static data member.
5232 (Free_list::num_allocate_visits): New static data member.
5233 (Free_list::init): New function.
5234 (Free_list::remove): New function.
5235 (Free_list::allocate): New function.
5236 (Free_list::dump): New function.
5237 (Free_list::print_stats): New function.
5238 (Layout_task_runner::run): Resize output file for incremental updates.
5239 (Layout::Layout): Initialize new data members.
5240 (Layout::set_incremental_base): New function.
5241 (Layout::init_fixed_output_section): New function.
5242 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
5243 incremental updates.
5244 (Layout::create_gold_note): Do not create gold note section for
5245 incremental updates.
5246 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
5247 for incremental updates.
5248 (Layout::set_section_offsets): For incremental updates, allocate space
5249 from free list.
5250 (Layout::create_symtab_sections): Layout with offsets relative to
5251 start of section; for incremental updates, allocate space from free
5252 list.
5253 (Layout::create_shdrs): For incremental updates, allocate space from
5254 free list.
5255 (Layout::finish_dynamic_section): For incremental updates, do not
5256 check --as-needed (fixed in subsequent patch).
5257 * layout.h (class Free_list): New class.
5258 (Layout::set_incremental_base): New function.
5259 (Layout::incremental_base): New function.
5260 (Layout::init_fixed_output_section): New function.
5261 (Layout::allocate): New function.
5262 (Layout::incremental_base_): New data member.
5263 (Layout::free_list_): New data member.
5264 * main.cc (main): Print Free_list statistics.
5265 * object.cc (Relobj::finalize_incremental_relocs): Add
5266 clear_counts parameter; clear counts only when clear_counts is set.
5267 (Sized_relobj::Sized_relobj): Initialize new base class.
5268 (Sized_relobj::do_layout): Don't report special sections.
5269 (Sized_relobj::do_for_all_local_got_entries): New function.
5270 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
5271 symtab_off to all symbol table offsets.
5272 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
5273 * object.h (class Got_offset_list): Move to top of file.
5274 (Object::Object): Allow case where input_file == NULL.
5275 (Object::~Object): Likewise.
5276 (Object::input_file): Assert that input_file != NULL.
5277 (Object::lock): Allow case where input_file == NULL.
5278 (Object::unlock): Likewise.
5279 (Object::is_locked): Likewise.
5280 (Object::token): Likewise.
5281 (Object::release): Likewise.
5282 (Object::is_incremental): New function.
5283 (Object::get_mtime): New function.
5284 (Object::for_all_local_got_entries): New function.
5285 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
5286 (Object::set_is_in_system_directory): New function.
5287 (Object::is_in_system_directory): New function.
5288 (Object::do_is_incremental): New function.
5289 (Object::do_get_mtime): New function.
5290 (Object::do_for_all_local_got_entries): New function.
5291 (Object::is_in_system_directory_): New data member.
5292 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
5293 (class Sized_relobj_base): New class.
5294 (class Sized_relobj): Derive from Sized_relobj_base.
5295 (class Sized_relobj::Symbols): Redeclare from base class.
5296 (class Sized_relobj::local_got_offset_list): Remove.
5297 (class Sized_relobj::Output_sections): Redeclare from base class.
5298 (class Sized_relobj::do_for_all_local_got_entries): New function.
5299 (class Sized_relobj::write_local_symbols): Add offset parameter.
5300 (class Sized_relobj::local_symbol_offset_): Update comment.
5301 (class Sized_relobj::local_dynsym_offset_): Update comment.
5302 * options.cc (Input_arguments::add_file): Remove const.
5303 * options.h (Input_file_argument::Input_file_argument):
5304 Initialize arg_serial_ (all constructors).
5305 (Input_file_argument::set_arg_serial): New function.
5306 (Input_file_argument::arg_serial): New function.
5307 (Input_file_argument::arg_serial_): New data member.
5308 (Input_arguments::Input_arguments): Initialize file_count_.
5309 (Input_arguments::add_file): Remove const.
5310 (Input_arguments::number_of_input_files): New function.
5311 (Input_arguments::file_count_): New data member.
5312 (Command_line::number_of_input_files): Call
5313 Input_arguments::number_of_input_files.
5314 * output.cc (Output_segment_headers::Output_segment_headers):
5315 Set current size.
5316 (Output_section::Input_section::current_data_size): New function.
5317 (Output_section::Output_section): Initialize new data members.
5318 (Output_section::add_input_section): Don't do merge sections for
5319 an incremental link; allocate space from free list for an
5320 incremental update.
5321 (Output_section::add_output_section_data): Allocate space from
5322 free list for an incremental update.
5323 (Output_section::update_data_size): New function.
5324 (Output_section::set_fixed_layout): New function.
5325 (Output_section::reserve): New function.
5326 (Output_segment::set_section_addresses): Remove const.
5327 (Output_segment::set_section_list_addresses): Remove const; allocate
5328 space from free list for an incremental update.
5329 (Output_segment::set_offset): Adjust size of RELRO segment for an
5330 incremental update.
5331 * output.h (Output_data::current_data_size): Move here from
5332 child classes.
5333 (Output_data::pre_finalize_data_size): New function.
5334 (Output_data::update_data_size): New function.
5335 (Output_section_headers::update_data_size): new function.
5336 (Output_section_data_build::current_data_size): Move to Output_data.
5337 (Output_data_strtab::update_data_size): New function.
5338 (Output_section::current_data_size): Move to Output_data.
5339 (Output_section::set_fixed_layout): New function.
5340 (Output_section::has_fixed_layout): New function.
5341 (Output_section::reserve): New function.
5342 (Output_section::update_data_size): New function.
5343 (Output_section::has_fixed_layout_): New data member.
5344 (Output_section::free_list_): New data member.
5345 (Output_segment::set_section_addresses): Remove const.
5346 (Output_segment::set_section_list_addresses): Remove const.
5347 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
5348 New function.
5349 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
5350 New function.
5351 * readsyms.cc (Read_symbols::do_read_symbols): Add library
5352 parameter when calling Add_symbols constructor; store argument
5353 serial number for members of a lib group.
5354 (Add_symbols::locks): Allow case where token == NULL.
5355 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
5356 (Read_member::~Read_member): New function.
5357 (Read_member::is_runnable): New function.
5358 (Read_member::locks): New function.
5359 (Read_member::run): New function.
5360 (Check_script::~Check_script): New function.
5361 (Check_script::is_runnable): New function.
5362 (Check_script::locks): New function.
5363 (Check_script::run): New function.
5364 (Check_library::~Check_library): New function.
5365 (Check_library::is_runnable): New function.
5366 (Check_library::locks): New function.
5367 (Check_library::run): New function.
5368 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
5369 (Add_symbols::library_): New data member.
5370 (class Read_member): New class.
5371 (class Check_script): New class.
5372 (class Check_library): New class.
5373 * reloc.cc (Read_relocs::is_runnable): Allow case where
5374 token == NULL.
5375 (Read_relocs::locks): Likewise.
5376 (Scan_relocs::locks): Likewise.
5377 (Relocate_task::locks): Likewise.
5378 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
5379 to clear counters.
5380 (Sized_relobj::incremental_relocs_scan): Fix comment.
5381 (Sized_relobj::do_relocate): Pass output file offset to
5382 write_local_symbols.
5383 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
5384 from class declaration.
5385 * script.cc (read_input_script): Allocate Script_info; pass
5386 argument serial number to report_script.
5387 * script.h (class Script_info): Move to incremental.h.
5388 * symtab.cc (Symbol_table::add_from_incrobj): New function.
5389 * symtab.h (Symbol_table::add_from_incrobj): New function.
5390 (Symbol_table::set_file_offset): New function.
5391
b961d0d7
CC
53922011-04-05 Cary Coutant <ccoutant@google.com>
5393
5394 * incremental-dump.cc (dump_incremental_inputs): Change signature
5395 to take a Sized_incremental_binary; change caller. Use readers
5396 in Sized_incremental_binary.
5397 * incremental.cc
5398 (Sized_incremental_binary::find_incremental_inputs_sections):
5399 Rename do_find_incremental_inputs_sections to this.
5400 (Sized_incremental_binary::setup_readers): New function.
5401 (Sized_incremental_binary::do_check_inputs): Check
5402 has_incremental_info_ flag; move setup code to setup_readers;
5403 use input readers.
5404 (Sized_incremental_binary::do_file_is_unchanged): New function.
5405 (Sized_incremental_binary::do_get_input_reader): New function.
5406 * incremental.h (class Incremental_binary): Move to end of file.
5407 (Incremental_binary::file_is_unchanged): New function.
5408 (Incremental_binary::do_file_is_unchanged): New function.
5409 (Incremental_binary::Input_reader): New class.
5410 (Incremental_binary::get_input_reader): New function.
5411 (class Sized_incremental_binary): Move to end of file.
5412 (Sized_incremental_binary::Sized_incremental_binary): Setup the
5413 input section reader classes.
5414 (Sized_incremental_binary::has_incremental_info): New function.
5415 (Sized_incremental_binary::inputs_reader): New function.
5416 (Sized_incremental_binary::symtab_reader): New function.
5417 (Sized_incremental_binary::relocs_reader): New function.
5418 (Sized_incremental_binary::got_plt_reader): New function.
5419 (Sized_incremental_binary::do_file_is_unchanged): New function.
5420 (Sized_incremental_binary::Sized_input_reader): New class.
5421 (Sized_incremental_binary::get_input_reader): New function.
5422 (Sized_incremental_binary::find_incremental_inputs_sections):
5423 Rename do_find_incremental_inputs_sections to this.
5424 (Sized_incremental_binary::setup_readers): New function.
5425 (Sized_incremental_binary::has_incremental_info_): New data member.
5426 (Sized_incremental_binary::inputs_reader_): New data member.
5427 (Sized_incremental_binary::symtab_reader_): New data member.
5428 (Sized_incremental_binary::relocs_reader_): New data member.
5429 (Sized_incremental_binary::got_plt_reader_): New data member.
5430 (Sized_incremental_binary::current_input_file_): New data member.
5431
a869183f
PP
54322011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
5433
5434 PR gold/12640
5435 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
5436 violation.
5437
54382011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
5439
5440 * archive.cc (Archive::include_member): Adjust call to report_object.
5441 (Add_archive_symbols::run): Add script_info to call to
5442 report_archive_begin.
5443 (Lib_group::include_member): Adjust call to report_object.
5444 (Add_lib_group_symbols::run): Adjust call to report_object.
5445 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
5446 blocks. Add object count for script input files.
5447 * incremental.cc (Incremental_inputs::report_archive_begin): Add
5448 script_info parameter; change all callers.
5449 (Incremental_inputs::report_object): Add script_info parameter;
5450 change all callers.
5451 (Incremental_inputs::report_script): Store backpointer to
5452 incremental info entry.
5453 (Output_section_incremental_inputs::set_final_data_size): Record
5454 additional information for scripts.
5455 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5456 * incremental.h (Incremental_script_entry::add_object): New function.
5457 (Incremental_script_entry::get_object_count): New function.
5458 (Incremental_script_entry::get_object): New function.
5459 (Incremental_script_entry::objects_): New data member; adjust
5460 constructor.
5461 (Incremental_inputs::report_archive_begin): Add script_info parameter.
5462 (Incremental_inputs::report_object): Add script_info parameter.
5463 (Incremental_inputs_reader::get_object_count): New function.
5464 (Incremental_inputs_reader::get_object_offset): New function.
5465 * options.cc (Input_arguments::add_file): Return reference to
5466 new input argument.
5467 * options.h (Input_argument::set_script_info): New function.
5468 (Input_argument::script_info): New function.
5469 (Input_argument::script_info_): New data member; adjust all
5470 constructors.
5471 (Input_file_group::add_file): Return reference to new input argument.
5472 (Input_file_lib::add_file): Likewise.
5473 (Input_arguments::add_file): Likewise.
5474 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
5475 * script.cc (Parser_closure::Parser_closure): Add script_info
5476 parameter; adjust all callers.
5477 (Parser_closure::script_info): New function.
5478 (Parser_closure::script_info_): New data member.
5479 (read_input_script): Report scripts earlier to incremental info.
5480 (script_add_file): Set script_info in Input_argument.
5481 (script_add_library): Likewise.
5482 * script.h (Script_options::Script_info): Rewrite class.
5483
a869183f 54842011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
5485
5486 * archive.cc (Library_base::should_include_member): Move
5487 method here from class Archive.
5488 (Archive::Archive): Initialize base class.
5489 (Archive::should_include_member): Move to base class.
5490 (Archive::do_for_all_unused_symbols): New function.
5491 (Add_archive_symbols::run): Remove redundant access to
5492 incremental_inputs.
5493 (Lib_group::Lib_group): Initialize base class.
5494 (Lib_group::do_filename): New function.
5495 (Lib_group::include_member): Pass pointer to Lib_group to
5496 report_object.
5497 (Lib_group::do_for_all_unused_symbols): New function.
5498 (Add_lib_group_symbols::run): Report archive information for
5499 incremental links.
5500 * archive.h (class Library_base): New base class.
5501 (class Archive): Derive from Library_base.
5502 (Archive::filename): Move to base class.
5503 (Archive::set_incremental_info): Likewise.
5504 (Archive::incremental_info): Likewise.
5505 (Archive::Should_include): Likewise.
5506 (Archive::should_include_member): Likewise.
5507 (Archive::Armap_entry): Remove.
5508 (Archive::Unused_symbol_iterator): Remove.
5509 (Archive::unused_symbols_begin): Remove.
5510 (Archive::unused_symbols_end): Remove.
5511 (Archive::do_filename): New function.
5512 (Archive::do_get_mtime): New function.
5513 (Archive::do_for_all_unused_symbols): New function.
5514 (Archive::task_): Move to base class.
5515 (Archive::incremental_info_): Likewise.
5516 (class Lib_group): Derive from Library_base.
5517 (Lib_group::do_filename): New function.
5518 (Lib_group::do_get_mtime): New function.
5519 (Lib_group::do_for_all_unused_symbols): New function.
5520 (Lib_group::task_): Move to base class.
5521 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
5522 function.
5523 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
5524 function.
5525 * incremental.cc (Incremental_inputs::report_archive_begin):
5526 Use Library_base; call library's get_mtime; add incremental inputs
5527 entry before members.
5528 (class Unused_symbol_visitor): New class.
5529 (Incremental_inputs::report_archive_end): Use Library_base; use
5530 visitor class to record unused symbols; don't add incremental inputs
5531 entry after members.
5532 (Incremental_inputs::report_object): Use Library_base.
5533 * incremental.h
5534 (Incremental_archive_entry::Incremental_archive_entry): Remove
5535 unused Archive parameter.
5536 (Incremental_inputs::report_archive_begin): Use Library_base.
5537 (Incremental_inputs::report_archive_end): Likewise.
5538 (Incremental_inputs::report_object): Likewise.
5539 * object.cc (Sized_relobj::do_for_all_global_symbols): New
5540 function.
5541 * object.h (Object::for_all_global_symbols): New function.
5542 (Object::do_for_all_global_symbols): New function.
5543 (Sized_relobj::do_for_all_global_symbols): New function.
5544 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
5545 function.
5546 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
5547 function.
5548
61ab3e40
ILT
55492011-03-27 Ian Lance Taylor <iant@google.com>
5550
5551 * archive.cc (Archive::interpret_header): Return -1 if something
5552 goes wrong. Change callers accordingly.
5553
30e1f9e6
CC
55542011-03-25 Cary Coutant <ccoutant@google.com>
5555
5556 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
5557 * testsuite/Makefile.in: Regenerate.
5558
9370ce59 55592011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
5560
5561 * plugin.cc (get_view): New.
5562 (Plugin::load): Pass get_view to the plugin.
5563 (Plugin_manager::get_view): New.
5564
9312bb0a
ILT
55652011-03-21 Ian Lance Taylor <iant@google.com>
5566
5567 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 5568 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 5569
7e12ba9e
ST
55702011-03-21 Sriraman Tallam <tmsriram@google.com>
5571
5572 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
5573 Change == to -eq.
5574 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
5575 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
5576 Change == to -eq.
5577 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
5578 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
5579
fd7a005d
ILT
55802011-03-14 Ian Lance Taylor <iant@google.com>
5581
5582 * script-sections.cc (Sort_output_sections::script_compare):
5583 Rename from is_before, change return type.
5584 (Sort_output_sections::operator()): Adjust accordingly.
5585
ed16fd1b
ILT
55862011-03-11 Jeffrey Yasskin <jyasskin@google.com>
5587
5588 PR gold/12572
5589 * testsuite/odr_violation2.cc: Add comment to make all error line
5590 numbers double digits.
5591 * testsuite/debug_msg.sh: Adjust expected errors.
5592
71ff8986
ILT
55932011-03-09 Jeffrey Yasskin <jyasskin@google.com>
5594
5595 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
5596 but mark earlier ones as non-canonical
5597 (offset_to_iterator): Update search target and example
5598 (do_addr2line): Return extra lines in a vector*
5599 (format_file_lineno): Extract from do_addr2line
5600 (one_addr2line): Add vector* out-param
5601 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
5602 when a lineno entry appeared last for its instruction
5603 (Dwarf_line_info): Add vector* out-param
5604 * object.cc (Relocate_info): Pass NULL for the vector* out-param
5605 * symtab.cc (Odr_violation_compare): Include the lineno in the
5606 comparison again.
5607 (linenos_from_loc): New. Combine the canonical line for an
5608 address with its other lines.
5609 (True_if_intersect): New. Helper functor to make
5610 std::set_intersection a query.
5611 (detect_odr_violations): Compare sets of lines instead of just
5612 one line for each function. This became less deterministic, but
5613 has fewer false positives.
5614 * symtab.h: Declarations.
5615 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
5616 mix an optimized and non-optimized object in the same binary
5617 (odr_violation2.so): Same.
5618 * testsuite/Makefile.in: Regenerate from Makefile.am.
5619 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
5620 * testsuite/debug_msg.sh: Update line numbers and add
5621 assertions.
5622 * testsuite/odr_violation1.cc: Use OdrDerived, in a
5623 non-optimized context.
5624 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
5625 isn't inlined, and use OdrDerived in an optimized context.
5626 * testsuite/odr_header1.h: Defines OdrDerived, where
5627 optimization will change the
5628 first-instruction-in-the-destructor's file and line number.
5629 * testsuite/odr_header2.h: Defines OdrBase.
5630
a19fefdc
ILT
56312011-03-09 Ian Lance Taylor <iant@google.com>
5632
5633 * fileread.cc (File_read::clear_views): Don't delete the whole
5634 file view.
5635
ecb351e9
ILT
56362011-03-08 Ian Lance Taylor <iant@google.com>
5637
5638 PR gold/12525
5639 * fileread.cc: #include <climits>.
5640 (GOLD_IOV_MAX): Define.
5641 (File_read::read_multiple): Limit number of entries by iov_max.
5642 * fileread.h (class File_read): Always set max_readv_entries to
5643 128.
5644
b821d13c
ILT
56452011-03-07 Ian Lance Taylor <iant@google.com>
5646
5647 PR gold/12525
5648 * options.h (class General_options): Add -dy and -dn.
5649
89243142
CC
56502011-03-02 Cary Coutant <ccoutant@google.com>
5651
5652 * testsuite/script_test_9.t: Add TLS segment.
5653
d0773f31
ILT
56542011-03-02 Simon Baldwin <simonb@google.com>
5655
5656 * configure.ac: Add check for gnu_indirect_function support in
5657 the toolchain building binutils.
5658 * configure: Rebuild.
5659
9370ce59 56602011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
5661
5662 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
5663 plugin only symbols.
5664 (Symbol_table::sized_finalize_symbol) Mark symbol only present
5665 in plugin files as not needed in the symbol table.
5666
4cf7a849
ST
56672011-02-11 Sriraman Tallam <tmsriram@google.com>
5668
5669 * output.cc (Output_section::add_input_section): Delay fill
5670 generation for section ordering.
5671
b578bd7d
ILT
56722011-02-09 Ian Lance Taylor <iant@google.com>
5673
5674 PR gold/12316
5675 * object.h (class Sized_relobj): Remove clear_local_symbols.
5676 * reloc.cc (Sized_relobj::do_relocate): Don't call
5677 clear_local_symbols.
5678
9370ce59 56792011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
5680
5681 * plugin.cc (is_visible_from_outside): Return true for symbols
5682 in the -u option.
5683
55382fb7
ILT
56842011-02-04 Jeffrey Yasskin <jyasskin@google.com>
5685
5686 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
5687 filename.
5688
4e271fff
ST
56892011-02-02 Sriraman Tallam <tmsriram@google.com>
5690
5691 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 5692 to std::string.
4e271fff 5693 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 5694 section_name to be std::string.
4e271fff
ST
5695 (is_function_ctor_or_dtor): Change type of parameter to std::string.
5696
d433c3ac
ILT
56972011-01-25 Ian Lance Taylor <iant@google.com>
5698
5699 * script.cc (script_add_extern): Rewrite to use
5700 add_symbol_reference.
5701
880473a6
DK
57022011-01-25 Doug Kwan <dougkwan@google.com>
5703
d433c3ac 5704 * icf.cc (get_section_contents): Always lock section's object.
880473a6 5705
f30f86fa
ILT
57062011-01-24 Ian Lance Taylor <iant@google.com>
5707
5708 * options.h (class General_options): Accept
5709 --no-detect-odr-violations.
5710
8e51a0b9
ILT
57112011-01-24 Ian Lance Taylor <iant@google.com>
5712
5713 * version.cc (version_string): Bump to 1.11.
5714
0f3b89d8
ILT
57152011-01-24 Ian Lance Taylor <iant@google.com>
5716
5717 * plugin.cc (class Plugin_rescan): Define new class.
5718 (Plugin_manager::claim_file): Set any_claimed_.
5719 (Plugin_manager::save_archive): New function.
5720 (Plugin_manager::save_input_group): New function.
5721 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
5722 necessary.
5723 (Plugin_manager::new_undefined_symbol): New function.
5724 (Plugin_manager::rescan): New function.
5725 (Plugin_manager::rescannable_defines): New function.
5726 (Plugin_manager::add_input_file): Set any_added_.
5727 * plugin.h (class Plugin_manager): define new fields rescannable_,
5728 undefined_symbols_, any_claimed_, and any_added_. Declare
5729 Plugin_rescan as friend. Declare new functions.
5730 (Plugin_manager::Rescannable): Define type.
5731 (Plugin_manager::Rescannable_list): Define type.
5732 (Plugin_manager::Undefined_symbol_list): Define type.
5733 (Plugin_manager::Plugin_manager): Initialize new fields.
5734 * archive.cc (Archive::defines_symbol): New function.
5735 (Add_archive_symbols::run): Pass archive to plugins if any.
5736 * archive.h (class Archive): Declare defines_symbol.
5737 * readsyms.cc (Input_group::~Input_group): New function.
5738 (Finish_group::run): Pass input_group to plugins if any.
5739 * readsyms.h (class Input_group): Declare destructor.
5740 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
5741 any.
5742
3bb951e5
ILT
57432011-01-10 Ian Lance Taylor <iant@google.com>
5744
5745 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
5746 section as relro.
5747 (Layout::set_segment_offsets): Reset increase_relro before calling
5748 set_section_addresses a second time.
5749
0aa45fac
CC
57502011-01-04 Cary Coutant <ccoutant@google.com>
5751
5752 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
5753 sections before NOBITS sections.
5754
0db46eb4
L
57552011-01-01 H.J. Lu <hongjiu.lu@intel.com>
5756
5757 * version.cc (print_version): Update copyright to 2011.
5758
829c9745
CC
57592010-12-23 Cary Coutant <ccoutant@google.com>
5760
5761 * output.h (Output_data_reloc::add_output_section): Pass OD instead
5762 of OS to this->add. Add OD parameter to second form of the function.
5763
7500420b
ILT
57642010-12-20 Ian Lance Taylor <iant@google.com>
5765
5766 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
5767 second of two consecutive entries with same offset.
5768
f8e9a930
RW
57692010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5770
5771 * testsuite/Makefile.am (ifuncmain2static_LDADD)
5772 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
5773 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
5774 to avoid unneeded links against $(LDADD).
5775 * testsuite/Makefile.in: Regenerate.
5776
2fbb4320
ILT
57772010-12-15 Ian Lance Taylor <iant@google.com>
5778
5779 PR gold/12324
5780 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
5781 for R_X86_64_32 and R_X86_64_PC32.
5782 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
5783 ver_matching_def_pic.o.
5784 (ver_matching_def_pic.o): New target.
5785
fedb228d
RW
57862010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5787
5788 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
5789 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
5790 Move definition before File_read::View member definitions.
5791 (File_read::View::~View): Initialize and hold lock before
5792 updating current_mapped_bytes.
5793
9b547ce6
RW
57942010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5795
5796 * dwarf_reader.cc: Remove outdated comment.
5797 * gold-threads.cc: Fix typo in error message.
5798 * archive.cc: Fix typos in comments.
5799 * archive.h: Likewise.
5800 * arm-reloc-property.cc: Likewise.
5801 * arm-reloc-property.h: Likewise.
5802 * arm-reloc.def: Likewise.
5803 * arm.cc: Likewise.
5804 * attributes.h: Likewise.
5805 * cref.cc: Likewise.
5806 * ehframe.cc: Likewise.
5807 * fileread.h: Likewise.
5808 * gold.h: Likewise.
5809 * i386.cc: Likewise.
5810 * icf.cc: Likewise.
5811 * incremental.h: Likewise.
5812 * int_encoding.cc: Likewise.
5813 * layout.h: Likewise.
5814 * main.cc: Likewise.
5815 * merge.h: Likewise.
5816 * object.cc: Likewise.
5817 * object.h: Likewise.
5818 * options.cc: Likewise.
5819 * readsyms.cc: Likewise.
5820 * reduced_debug_output.cc: Likewise.
5821 * reloc.cc: Likewise.
5822 * script-sections.cc: Likewise.
5823 * sparc.cc: Likewise.
5824 * symtab.h: Likewise.
5825 * target-reloc.h: Likewise.
5826 * target.cc: Likewise.
5827 * target.h: Likewise.
5828 * timer.cc: Likewise.
5829 * timer.h: Likewise.
5830 * x86_64.cc: Likewise.
5831
83e17bd5
CC
58322010-12-09 Cary Coutant <ccoutant@google.com>
5833
5834 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
5835 stack.
5836 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
5837 parameter; change all callers.
5838 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
5839 * options.h (warn_execstack): New option.
5840
017257f8
DK
58412010-12-07 Doug Kwan <dougkwan@google.com>
5842
5843 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
5844 like function call relocations.
5845
c20cbc06
ILT
58462010-12-07 Ian Lance Taylor <iant@google.com>
5847
5848 * archive.cc (Archive::get_elf_object_for_member): Permit
5849 punconfigured to be NULL.
5850 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
5851 (Archive::include_member): Pass NULL to get_elf_object_for_member
5852 if we searched for the archive and this is the first included
5853 object.
5854
4dbfafcc
ILT
58552010-12-01 Ian Lance Taylor <iant@google.com>
5856
5857 * dwarf_reader.h (class Sized_dwarf_line_info): Add
5858 track_relocs_type_ field.
5859 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5860 Set track_relocs_type_.
5861 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
5862 contents when using RELA relocs.
5863 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
5864 reloc_map_.
5865 * reloc.cc (Track_relocs::next_addend): New function.
5866 * reloc.h (class Track_relocs): Declare next_addend.
5867
e5e19edd
ILT
58682010-12-01 Ian Lance Taylor <iant@google.com>
5869
5870 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
5871 virtual destructor.
5872
9a5ce24c
ILT
58732010-12-01 Ian Lance Taylor <iant@google.com>
5874
5875 * README: Update compilers known to work and fail.
5876
c7791212
NC
58772010-11-23 Matthias Klose <doko@ubuntu.com>
5878
5879 * configure.in: For --enable-gold, handle value `default' instead of
5880 `both*'. Always install ld as ld.bfd, install as ld if gold is
5881 not the default.
5882 * configure: Regenerate.
5883
0ad220c9
DK
58842010-11-18 Doug Kwan <dougkwan@google.com>
5885
5886 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
5887 and right_alignment to be zero. Store result alignment only if it is
5888 greater than existing alignment.
5889
ab8056e0
CC
58902010-11-16 Cary Coutant <ccoutant@google.com>
5891
5892 PR gold/12220
5893 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5894 Check for ".zdebug_line".
5895
fd064a5b
CC
58962010-11-16 Doug Kwan <dougkwan@google.com>
5897 Cary Coutant <ccoutant@google.com>
5898
5899 * output.h (Output_segment::set_section_addresses): Pass increase_relro
5900 by reference; adjust all callers.
5901 * output.cc (Output_segment::set_section_addresses): Adjust references
5902 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
5903 list is empty.
5904 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
5905 end at page boundary.
5906
6fc6ea19
CC
59072010-11-16 Cary Coutant <ccoutant@google.com>
5908
5909 PR gold/12220
5910 * layout.cc (Layout::choose_output_section): Transform names of
5911 compressed sections even when using a script with a SECTIONS clause.
5912 (Layout::output_section_name): Remove code to transform
5913 compressed debug section names.
5914 * output.cc (Output_section::add_input_section): Use uncompressed
5915 section size when tracking input sections.
5916
95a2c8d6
RS
59172010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
5918
5919 * symtab.h (Symbol::NON_PIC_REF): Remove.
5920 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
5921 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
5922 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
5923 (Symbol::use_plt_offset): Take a flags argument and pass it
5924 directly to needs_dynamic_reloc. Restrict check for undefined
5925 weak symbols to function calls.
5926 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
5927 (Target_arm::Scan::global): Use it.
5928 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
5929 (Target_arm::Relocate::relocate): Likewise.
5930 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
5931 parameter with an r_type parameter. Use get_reference_flags
5932 to get the flags.
5933 (Target_arm::Relocate::relocate): Update accordingly.
5934 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
5935 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
5936 (Target_i386::Scan::global): Likewise.
5937 (Target_i386::Relocate::relocate): Likewise.
5938 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
5939 parameter with an r_type parameter. Use get_reference_flags
5940 to get the flags.
5941 (Target_i386::Relocate::relocate): Update accordingly.
5942 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
5943 (Target_powerpc::Scan::global): Use it.
5944 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
5945 (Target_powerpc::Relocate::relocate): Likewise.
5946 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
5947 (Target_sparc::Scan::global): Use it.
5948 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
5949 (Target_sparc::Relocate::relocate): Likewise.
5950 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
5951 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
5952 (Target_x86_64::Scan::global): Likewise.
5953 (Target_x86_64::Relocate::relocate): Likewise.
5954
f625ae50
DK
59552010-11-08 Doug Kwan <dougkwan@google.com>
5956 Cary Coutant <ccoutant@google.com>
5957
5958 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
5959 (Arm_exidx_merge_section::section_contents_): New data member.
5960 (Arm_input_section::Arm_input_section): Initialize original_contents_.
5961 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 5962 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
5963 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
5964 in parameters instead of calling Object::section_contents without
5965 locking.
5966 (Arm_output_section::group_section): New parameter TASK. Pass it
5967 to callees that need locking objects.
5968 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
5969 to lock EXIDX input sections. Fix a formatting issue. Call
5970 Arm_exidx_merged_section::build_contents to create merged section
5971 contents.
5972 (Arm_output_section::create_stub_group): New parameter TASK. Use it
5973 to lock object of stub table owner.
5974 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
5975 TEXT_SIZE to initialize data member TEXT_SIZE_.
5976 (Arm_exidx_input_section::addralign): Fix typo in comment.
5977 (Arm_exidx_input_section::text_size): New method.
5978 (Target_arm::do_relax): New parameter TASK. Pass it to callees
5979 that require locking objects. Lock objects before scanning for stubs
5980 and updating local symbols.
5981 (Arm_input_section<big_endian>::init): Copy contents of original
5982 input section.
2e702c99 5983 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
5984 original input section instead of calling Object::section_contents
5985 without locking.
5986 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
5987 size without calling Object::section_size().
5988 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
5989 for size. Allocate a buffer for merged EXIDX entries.
5990 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 5991 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
5992 building code to Arm_exidx_merged_section::build_contetns. Write
5993 out contetns in buffer instead of building it on the fly.
5994 (Arm_relobj::make_exidx_input_section): Also pass text section size
5995 to Arm_exidx_input_section constructor.
5996 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
5997 (Arm_dynobj::do_read_symbols): Fix memory leak.
5998 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
5999 * target.h: (class Task): Add forward declaration.
6000 (Target::relax): Add new parameter TASK and pass it to
6001 Target::do_relax().
6002 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
6003
5f9bcf58
CC
60042010-11-05 Cary Coutant <ccoutant@google.com>
6005
6006 PR gold/10708
6007 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
6008 object when reading from the file.
6009 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
6010 second layout pass.
6011 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
6012 when reading section contents.
6013 (get_section_contents): Likewise.
6014 (icf::find_identical_sections): Likewise.
6015 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
6016 object when reading from the file.
6017 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
6018 the object when doing deferred section layout.
6019
e597fa08
NC
60202010-11-03 Nick Clifton <nickc@redhat.com>
6021
6022 PR gold/12001
6023 * script.h (class Symbol_assignment: name): New member. Returns
6024 the name of the symbol.
6025 * scrfipt.cc (Script_options::is_pending_assignment): New member.
6026 Returns true if the given symbol name is on the list of
6027 assignments wating to be processed.
6028 * archive.cc (should_incldue_member): If the symbol is undefined,
6029 check to see if it is on the list of symbols pending assignment.
6030
3f9a3278
ILT
60312010-11-03 Ryan Mansfield <rmansfield@qnx.com>
6032
6033 * script-sections.cc (Script_sections::find_memory_region): Check
6034 for a NULL output section pointer.
6035
d06fb4d1
DK
60362010-10-29 Doug Kwan <dougkwan@google.com>
6037
6038 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
6039 Output_section::add_relaxed_input_section.
6040 * output.cc (Output_section::add_relaxed_input_section): Add new
6041 arguments LAYOUT and NAME. Set section order index.
6042 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6043 Copy section order index.
6044 * output.h (Output_section::add_relaxed_input_section): Add new
6045 arguments LAYOUT and NAME.
6046
90e24de5
ILT
60472010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6048
6049 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 6050 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
6051 * testsuite/Makefile.in: Regenerate.
6052
c9484ea5
DK
60532010-10-20 Doug Kwan <dougkwan@google.com>
6054
6055 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
6056 without SHF_LINK_ORDER flags.
6057 * layout.cc (Layout::choose_output_section): Do not filter
6058 SHF_LINK_ORDER flag in a relocatable link.
6059
5bc2f5be
CC
60602010-10-17 Cary Coutant <ccoutant@google.com>
6061
6062 * output.h (Output_segment::set_section_addresses): Change function
6063 signature. Update all callers.
6064 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
6065 sections.
6066 (Output_segment::set_section_addresses): Align after last TLS
6067 section. Add padding before last relro section instead of after.
6068
0c91cf04
DK
60692010-10-17 Doug Kwan <dougkwan@google.com>
6070
6071 * gold/arm.cc (Target_arm::got_section): Use correct order and set
6072 GOT output section to be writable.
6073
8c21d9d3
CC
60742010-10-14 Cary Coutant <ccoutant@google.com>
6075
6076 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
6077 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
6078 * gold.cc (queue_initial_tasks): Check parameters for incremental link
6079 mode.
6080 * incremental.cc (report_command_line): Ignore all forms of
6081 --incremental.
6082 * layout.cc (Layout::Layout): Check parameters for incremental link
6083 mode.
6084 * options.cc (General_options::parse_incremental): New function.
6085 (General_options::parse_no_incremental): New function.
6086 (General_options::parse_incremental_full): New function.
6087 (General_options::parse_incremental_update): New function.
6088 (General_options::incremental_mode_): New data member.
6089 (General_options::finalize): Check incremental_mode_.
6090 * options.h (General_options): Update help text for --incremental.
6091 Add --no-incremental, --incremental-full, --incremental-update.
6092 (General_options::Incremental_mode): New enum type.
6093 (General_options::incremental_mode): New function.
6094 (General_options::incremental_mode_): New data member.
6095 * parameters.cc (Parameters::incremental_mode_): New data member.
6096 (Parameters::set_options): Set incremental_mode_.
6097 (Parameters::set_incremental_full): New function.
6098 (Parameters::incremental): New function.
6099 (Parameters::incremental_update): New function.
6100 (set_parameters_incremental_full): New function.
6101 * parameters.h (Parameters::set_incremental_full): New function.
6102 (Parameters::incremental): New function.
6103 (Parameters::incremental_update): New function.
6104 (Parameters::incremental_mode_): New data member.
6105 (set_parameters_incremental_full): New function.
6106 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
6107 incremental link mode.
6108 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
6109 (Sized_relobj::do_relocate_sections): Likewise.
6110 * testsuite/Makefile.am (incremental_test): Use --incremental-full
6111 option.
6112 * testsuite/Makefile.in: Regenerate.
6113 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 6114
bb32aa18 61152010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
6116
6117 * script-sections.h (class Script_sections): Make
6118 Sections_elements typedef public.
6119 * script-sections.cc (class Sort_output_sections): Add elements_
6120 field. Add constructor which sets it; change all callers.
6121 (Sort_output_sections::is_before): New function.
6122 (Sort_output_sections::operator()): Call is_before.
6123 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
6124 conditional.
6125 * testsuite/script_test_10.sh: New test. Test script section
6126 order.
6127 * testsuite/script_test_10.t: Likewise.
6128 * testsuite/script_test_10.s: Likewise.
6129 * testsuite/Makefile.am: Wrap the cross linker tests and the
6130 common tests into NATIVE_OR_CROSS_LINKER.
6131 (check_SCRIPTS): Add script_test_10.sh.
6132 (check_DATA): Add script_test_10.stdout.
6133 (script_test_10.o, script_test_10): New targets.
6134 (script_test_10.stdout): New target.
6135 * configure, testsuite/Makefile.in: Regenerate.
6136
3cef7179
ILT
61372010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6138
6139 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
6140 error for the deprecated relocations.
6141 (Target_arm::Scan::global): Likewise.
6142 (Target_arm::Relocate::relocate): Likewise.
6143
7411e9a8
RS
61442010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
6145
6146 * fileread.cc (Input_file::find_file): Initialize *found_name
6147 and *namep when using the fallback search for case 4.
6148
6a9da32a
CC
61492010-10-11 Cary Coutant <ccoutant@google.com>
6150
6151 * options.h (class General_options): Redefine -z lazy as an alias for
6152 the negation of -z now.
6153
ac897c20
ILT
61542010-10-11 Ian Lance Taylor <iant@google.com>
6155
6156 * resolve.cc (symbol_to_bits): Report the value of the unsupported
6157 binding.
6158
ea5cae92
NC
61592010-10-06 Nick Clifton <nickc@redhat.com>
6160
6161 * script-sections.cc(class Memory_region): Remove
6162 current_lma_offset_ field. Rename current_vma_offset_ to
6163 current_offset_. Add last_section_ field.
6164 (Memory_region::get_current_vma_address): Rename to
6165 get_current_address.
6166 (Memory_region::get_current_lma_address): Delete.
6167 (Memory_region::increment_vma_offset): Rename to
6168 increment_offset.
6169 (Memory_region::increment_lma_offset): Delete.
6170 (Memory_region::attributes_compatible): New method. Returns
6171 true if the provided section is compatible with the region.
6172 (Memory_region::get_last_section): New method. Returns the last
6173 section to use the region.
6174 (Memory_region::set_last_section): New method. Stores the last
6175 section to use the region.
6176 (Script_sections::block_in_region): New method. Returns true if
6177 a block of memory is contained within a region.
6178 (Script_sections::find_memory_region): New method. Locates a
6179 memory region to be used to set a VMA or LMA address.
6180 (Output_section_definition::set_section_addresses): Add code to
6181 check for addresses set by memory regions.
6182 (Output_segment::set_section_addresses): Remove memory region
6183 walking code.
6184 (Script_sections::create_segment): Add a warning if a header
6185 segment is created outside of any region.
6186 * script-sections.h (class Script_sections): Add prototypes for
6187 find_memory_region and block_in_region methods.
6188 * testsuite/memory_test.s: Use .long instead of .word.
6189 * testsuite/memory_test.t: Add some more output sections.
6190 * testsuite/memory_test.sh: Update expected output.
6191
a9bfd952
DK
61922010-10-02 Doug Kwan <dougkwan@google.com>
6193
6194 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
6195 defintion to symtab.h
6196 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
6197 declaration to defintion.
6198
bacff3ab
NC
61992010-10-01 Nick Clifton <nickc@redhat.com>
6200
6201 * expression.cc (eval): Replace dummy argument with NULL.
6202 (eval_maybe_dot): Check for a NULL result section pointer.
6203 (Symbol_expression::value): Likewise.
6204 (Dot_expression::value): Likewise.
6205 (BINARY_EXPRESSION): Likewise.
6206 (Max_expression::value): Likewise.
6207 (Min_expression::value): Likewise.
6208 (Absolute_expression::value): Likewise.
6209 (Addr_expression::value_from_output_section): Likewise.
6210 (Loaddddr_expression::value_from_output_section): Likewise.
6211 (Segment_start_expression::value): Likewise.
6212 * script-sections.cc
6213 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
6214 argument with NULL.
6215 (Sections_elememt_dot_assignment::set_section_addresses):
6216 Likewise.
6217 (Output_data_expression::do_write_to_buffer): Likewise.
6218 (Output_section_definition::finalize_symbols): Likewise.
6219 (Output_section_definition::set_section_addresses): Likewise.
6220
f81bc8b5
DK
62212010-09-30 Doug Kwan <dougkwan@google.com>
6222
6223 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
6224
c95e9f27
ST
62252010-09-28 Sriraman Tallam <tmsriram@google.com>
6226
6227 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 6228 function.
c95e9f27
ST
6229 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
6230 virtual function.
6231 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
6232 virtual function.
6233 * icf.cc (get_section_contents): Inline merge sections only when
6234 target allows it.
6235
3cac54d2
RW
62362010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6237
6238 * configure: Regenerate.
6239
2904037a
ILT
62402010-09-17 Ian Lance Taylor <iant@google.com>
6241
6242 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
6243 * testsuite/Makefile.am (memory_test.o): New target.
6244 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
6245 memory_test.t.
6246 * testsuite/Makefile.in: Rebuild.
2904037a 6247
bca7fb63
DK
62482010-09-17 Doug Kwan <dougkwan@google.com>
6249
6250 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
6251 defintion if relocation uses GOT entries of the symbol.
6252 * testsuite/icf_safe_test.sh: Fix test.
6253 * testsuite/icf_safe_so_test.sh: Fix test.
6254
4ef28648
CC
62552010-09-16 Cary Coutant <ccoutant@google.com>
6256
6257 * script_sections.cc (class Memory_region): Remove "NULL" from
6258 vector initializations.
6259
793990de
CC
62602010-09-15 Cary Coutant <ccoutant@google.com>
6261
6262 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
6263 Resolve forwarding symbols.
6264
81e015e2
DK
62652010-09-15 Doug Kwan <dougkwan@google.com>
6266
6267 * gold/testsuite/script_test_3.t: Add ARM special sections.
6268 * gold/testsuite/script_test_4.t: Same.
6269 * gold/testsuite/script_test_5.t: Same.
6270 * gold/testsuite/script_test_6.t: Same.
6271 * gold/testsuite/script_test_7.t: Same.
6272 * gold/testsuite/script_test_7.t: Same.
6273 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
6274
36171d64
CC
62752010-09-14 Cary Coutant <ccoutant@google.com>
6276
6277 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
6278 (Target_x86_64::Relocate::relocate_tls): Replace check for
6279 saw_tls_block_reloc_ with test for executable section.
6280
d89051bd
CC
62812010-09-12 Cary Coutant <ccoutant@google.com>
6282
6283 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
6284 position-independent executables to shared libraries need dynamic
6285 relocations.
6286 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
6287 position-independent executables.
6288 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
6289 * testsuite/Makefile.in: Regenerate.
6290
fca41f0f
NC
62912010-09-10 Nick Clifton <nickc@redhat.com>
6292
6293 PR gold/11997
6294 * testsuite/memory_test.t: Discard any sections that are not
6295 needed.
6296
6695e4b3
L
62972010-09-09 H.J. Lu <hongjiu.lu@intel.com>
6298
6299 PR gold/11996
6300 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
6301 "This::" to work around a bug in gcc 4.2.
6302
6303 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
6304
0f72bf6f
RÁE
63052010-09-09 Rafael Espindola <espindola@google.com>
6306
6307 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
6308 sections with different PF_X flags in the same segment.
6309 (Layout::find_first_load_seg): Search all segments to find the first
6310 one.
6311 * options.h (rosegment): New.
6312
63132010-09-08 Rafael Espindola <espindola@google.com>
a6577478 6314
05a79166 6315 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 6316
aa98ff75
DK
63172010-09-08 Doug Kwan <dougkwan@google.com>
6318
6319 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
6320 (Arm_relobj::do_relocate_sections): Add new parameter for output
6321 file to match the parent.
6322 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
6323 of local symbols instead of input values. Update code to track
6324 changes in gold::relocate_section.
6325 * object.cc (Sized_relobj::compute_final_local_value): New methods.
6326 (Sized_relobj::compute_final_local_value_internal): New methods.
6327 (Sized_relobj::do_finalize_local_symbols): Move code from loop
6328 body into private version of Sized_relobj::compute_final_local_value.
6329 Call the inline method.
6330 * object.h (Symbol_value::Symbol_value): Define destructor. Free
6331 merged symbol value if there is one.
6332 (Symbol_value::has_output_value): New method defintiion.
6333 (Sized_relobj::Compute_final_local_value_status): New enum type.
6334 (Sized_relobj::compute_final_local_value): New methods.
6335 (Sized_relobj::compute_final_local_value_internal): New methods.
6336 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
6337 and arm_cortex_a8.sh.
6338 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
6339 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
6340 New tests.
6341 * Makefile.in: Regenerate.
6342 * testsuite/arm_bl_out_of_range.s: Update test.
6343 * testsuite/thumb_bl_out_of_range.s: Ditto.
6344 * testsuite/thumb_blx_out_of_range.s: Ditto.
6345 * testsuite/arm_branch_out_of_range.sh: New file.
6346 * testsuite/arm_cortex_a8.sh: Ditto.
6347 * testsuite/arm_cortex_a8_b.s: Ditto.
6348 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
6349 * testsuite/arm_cortex_a8_b_local.s: Ditto.
6350 * testsuite/arm_cortex_a8_bl.s: Ditto.
6351 * testsuite/arm_cortex_a8_blx.s: Ditto.
6352 * testsuite/arm_cortex_a8_local.s: Ditto.
6353 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
6354 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
6355
05a79166
L
63562010-09-08 Rafael Espindola <espindola@google.com>
6357
6358 * Makefile.am (memory_test.stdout): Run readelf with -W.
6359 * Makefile.in: Regenerate.
6360 * testsuite/memory_test.sh: Make the regexps accept both 32 and
6361 64 bit output.
6362
33dbc701
RÁE
63632010-09-08 Rafael Espindola <espindola@google.com>
6364
6365 * script-sections.cc (Script_sections::add_memory_region): Convert
6366 field precision to int.
6367 * script.cc (script_set_section_region, script_set_section_region):
6368 Convert field precision to int.
6369
731ca54a
RÁE
63702010-09-08 Rafael Espindola <espindola@google.com>
6371
6372 * arm.cc (do_finalize_sections): Create the __exidx_start and
6373 __exdix_end symbols even when the section is missing.
6374
7f8cd844
NC
63752010-09-08 Nick Clifton <nickc@redhat.com>
6376
6377 * README: Remove claim that MEMORY is not supported.
6378 * expression.cc (script_exp_function_origin)
6379 (script_exp_function_length): Move from here to ...
6380 * script.cc: ... here.
6381 (script_set_section_region, script_add_memory)
6382 (script_parse_memory_attr, script_include_directive): New
6383 functions.
6384 * script-sections.cc
6385 (class Memory_region): New class.
6386 (class Output_section_definition): Add set_memory_region,
6387 set_section_vma, set_section_lma and get_section_name methods.
6388 (class Script_Sections): Add add_memory_region,
6389 find_memory_region, find_memory_region_origin,
6390 find_memory_region_length and set_memory_region methods.
6391 Have set_section_addresses method walk the list of set memory
6392 regions.
6393 Extend the print methos to display memory regions.
6394 * script-sections.h: Add prototypes for new methods.
6395 Add enum for MEMORY region attributes.
6396 * yyscript.y: Add support for parsing MEMORY regions.
6397 * script-c.h: Add prototypes for new functions.
6398 * testsuite/Makefile.am: Add test of MEMORY region functionality.
6399 * testsuite/Makefile.in: Regenerate.
6400 * testsuite/memory_test.sh: New script.
6401 * testsuite/memory_test.s: New assembler source file.
6402 * testsuite/memory_test.t: New linker script.
6403
a4649286
DK
64042010-08-27 Doug Kwan <dougkwan@google.com>
6405
6406 * gold/resolve.cc (Symbol_table::should_override): Let a weak
6407 reference override an existing dynamic weak reference.
6408 * testsuite/Makefile.am: Add new test dyn_weak_ref.
6409 * testsuite/Makefile.in: Regenerate.
6410 * testsuite/dyn_weak_ref.sh: New file.
6411 * testsuite/dyn_weak_ref_1.c: Ditto.
6412 * testsuite/dyn_weak_ref_2.c: Ditto.
6413
b56648ad
ILT
64142010-08-27 Ian Lance Taylor <iant@google.com>
6415
6416 * incremental.h (class Incremental_input_entry): Add virtual
6417 destructor.
6418
809313cb
ILT
64192010-08-27 Ian Lance Taylor <iant@google.com>
6420
6421 * testsuite/start_lib_test_3.c: Mark t3 as used.
6422
11e32464
NC
64232010-08-27 Nick Clifton <nickc@redhat.com>
6424
6425 * options.cc (version_script): Fix small typo in previous
6426 whitespace tidyup.
6427
ca09d69a
NC
64282010-08-25 Nick Clifton <nickc@redhat.com>
6429
6430 * archive.cc: Formatting fixes: Remove whitespace between
6431 typename and following asterisk. Remove whitespace between
6432 function name and opening parenthesis.
6433 * archive.h: Likewise.
6434 * arm.cc: Likewise.
6435 * attributes.cc: Likewise.
6436 * attributes.h: Likewise.
6437 * common.cc: Likewise.
6438 * copy-relocs.cc: Likewise.
6439 * dirsearch.h: Likewise.
6440 * dynobj.cc: Likewise.
6441 * ehframe.cc: Likewise.
6442 * ehframe.h: Likewise.
6443 * expression.cc: Likewise.
6444 * fileread.cc: Likewise.
6445 * fileread.h: Likewise.
6446 * gc.h: Likewise.
6447 * gold-threads.cc: Likewise.
6448 * gold.cc: Likewise.
6449 * i386.cc: Likewise.
6450 * icf.h: Likewise.
6451 * incremental-dump.cc: Likewise.
6452 * incremental.cc: Likewise.
6453 * layout.cc: Likewise.
6454 * layout.h: Likewise.
6455 * main.cc: Likewise.
6456 * merge.cc: Likewise.
6457 * merge.h: Likewise.
6458 * object.cc: Likewise.
6459 * object.h: Likewise.
6460 * options.cc: Likewise.
6461 * options.h: Likewise.
6462 * output.cc: Likewise.
6463 * output.h: Likewise.
6464 * plugin.cc: Likewise.
6465 * plugin.h: Likewise.
6466 * powerpc.cc: Likewise.
6467 * reloc.cc: Likewise.
6468 * script-c.h: Likewise.
6469 * script-sections.cc: Likewise.
6470 * script.cc: Likewise.
6471 * stringpool.cc: Likewise.
6472 * symtab.cc: Likewise.
6473 * symtab.h: Likewise.
6474 * target.cc: Likewise.
6475 * timer.cc: Likewise.
6476 * timer.h: Likewise.
6477 * version.cc: Likewise.
6478 * x86_64.cc: Likewise.
6479
b8fa8750
NC
64802010-08-24 Nick Clifton <nickc@redhat.com>
6481
6482 PR 11899
6483 * layout.cc (segment_precedes): Sort segments by their physical
6484 addresses, if they have been set.
6485
9919d93b
CC
64862010-08-23 Cary Coutant <ccoutant@google.com>
6487
6488 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
6489 symbols data.
6490 (Lib_group::include_member): Unlock object after deleting its
6491 symbols data.
6492 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
6493 the bug fixed here.
6494
97b4be1c
CC
64952010-08-19 Neil Vachharajani <nvachhar@google.com>
6496 Cary Coutant <ccoutant@google.com>
6497
6498 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
6499 constructor, and set_blocker.
6500 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
6501 readsyms_blocker_.
6502 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
6503 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
6504 * testsuite/Makefile.am (start_lib_test): New test case.
6505 * testsuite/Makefile.in: Regenerate.
6506 * testsuite/start_lib_test_main.c: New file.
6507 * testsuite/start_lib_test_1.c: New file.
6508 * testsuite/start_lib_test_2.c: New file.
6509 * testsuite/start_lib_test_3.c: New file.
6510
dd0b1884
ILT
65112010-08-19 Ian Lance Taylor <iant@google.com>
6512
6513 * Makefile.in: Rebuild with automake 1.11.1.
6514 * aclocal.m4: Likewise.
6515 * testsuite/Makefile.in: Likewise.
6516
7223e9ca
ILT
65172010-08-19 Ian Lance Taylor <iant@google.com>
6518
6519 PR 10893
6520 * i386.cc (class Output_data_plt_i386): Update declarations.
6521 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
6522 local_ifuncs_ fields.
6523 (Target_i386::do_plt_section_for_global): New function.
6524 (Target_i386::do_plt_section_for_local): New function.
6525 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
6526 parameter; change all callers. Initialize global_ifuncs_ and
6527 local_ifuncs_. If doing a static link define __rel_iplt_start and
6528 __rel_iplt_end.
6529 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
6530 (Output_data_plt_i386::add_local_ifunc_entry): New function.
6531 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
6532 symbols.
6533 (Target_i386::make_plt_section): New function, broken out of
6534 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
6535 (Target_i386::make_plt_entry): Call make_plt_section.
6536 (Target_i386::make_local_ifunc_plt_entry): New function.
6537 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
6538 (Target_i386::Scan::local): Handle IFUNC symbols. Add
6539 R_386_IRELATIVE to switch.
6540 (Target_i386::Scan::global): Likewise.
6541 (Target_i386::Relocate::relocate): Likewise.
6542 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
6543 switch.
6544 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
6545 (Target_x86_64::do_plt_section_for_global): New function.
6546 (Target_x86_64::do_plt_section_for_local): New function.
6547 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
6548 parameter; change all callers. If doing a static link define
6549 __rela_iplt_start and __rela_iplt_end.
6550 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
6551 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
6552 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
6553 to point to .plt.
6554 (Target_x86_64::make_local_ifunc_plt_entry): New function.
6555 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
6556 switch.
6557 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
6558 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
6559 R_X86_64_IRELATIVE to switch.
6560 (Target_x86_64::Scan::global): Likewise.
6561 (Target_x86_64::Relocate::relocate): Likewise.
6562 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
6563 switch.
6564 * target.h (class Target): Add plt_section_for_global and
6565 plt_section_for_local functions. Add do_plt_section_for_global
6566 and do_plt_section_for_local virtual functions.
6567 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
6568 clarifying comments.
6569 (Symbol::use_plt_offset): Handle IFUNC symbol.
6570 * object.cc (Sized_relobj::Sized_relobj): Initialize
6571 local_plt_offsets_.
6572 (Sized_relobj::local_has_plt_offset): New function.
6573 (Sized_relobj::local_plt_offset): New function.
6574 (Sized_relobj::set_local_plt_offset): New function.
6575 (Sized_relobj::do_count): Handle IFUNC symbol.
6576 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
6577 a bit away from input_shndx_ field. Add set_is_func_symbol and
6578 is_ifunc_symbol functions.
6579 (class Sized_relobj): Update declarations. Remove Tls_got_entry
6580 and Local_tls_got_offsets. Define Local_plt_offsets. Add
6581 local_plt_offsets_ field.
6582 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
6583 * output.h (class Output_section_data): Add non-const
6584 output_section function.
6585 (class Output_data_got): Update declarations.
6586 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
6587 Add use_plt_offset parameter to global and local constructors.
6588 Change all callers. Change local_sym_index_ field to 31 bits.
6589 Change GSYM_CODE and CONSTANT_CODE accordingly.
6590 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
6591 doing a static link don't set sh_link field.
6592 (Output_data_got::Got_entry::write): Use PLT offset if
6593 appropriate.
6594 (Output_data_got::add_global_plt): New function.
6595 (Output_data_got::add_local_plt): New function.
6596 * target-reloc.h (relocate_section): Handle IFUNC symbol.
6597 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
6598 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
6599 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
6600 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
6601 IFUNC conditional.
6602 * testsuite/ifunc-sel.h: New file.
6603 * testsuite/ifuncmain1.c: New file.
6604 * testsuite/ifuncmain1vis.c: New file.
6605 * testsuite/ifuncmod1.c: New file.
6606 * testsuite/ifuncdep2.c: New file.
6607 * testsuite/ifuncmain2.c: New file.
6608 * testsuite/ifuncmain3.c: New file.
6609 * testsuite/ifuncmod3.c: New file.
6610 * testsuite/ifuncmain4.c: New file.
6611 * testsuite/ifuncmain5.c: New file.
6612 * testsuite/ifuncmod5.c: New file.
6613 * testsuite/ifuncmain6pie.c: New file.
6614 * testsuite/ifuncmod6.c: New file.
6615 * testsuite/ifuncmain7.c: New file.
6616 * configure, testsuite/Makefile.in: Rebuild.
6617
56f75c03
ILT
66182010-08-18 Ian Lance Taylor <iant@google.com>
6619
6620 * incremental.cc
6621 (Output_section_incremental_inputs::write_input_files): Add cast
6622 to avoid signed/unsigned comparison warning.
6623 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6624
55455f89
CC
66252010-08-12 Cary Coutant <ccoutant@google.com>
6626
6627 * common.cc (Sort_commons::operator()): Remove unnecessary code.
6628
e2054bcb
ILT
66292010-08-13 Ian Lance Taylor <iant@google.com>
6630
6631 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
6632
74f67560
DK
66332010-08-12 Cary Coutant <ccoutant@google.com>
6634 Doug Kwan <dougkwan@google.com>
6635
6636 * resolve.cc (Symbol_table::should_override): When a weak dynamic
6637 defintion overrides non-weak undef, remember that the original undef
6638 is not weak.
6639 * symtab.cc (Symbol_table::sized_write_global): For undef without
6640 an original weak binding, set binding to global in output.
6641 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
6642 * testsuite/Makefile.in: Regenerate.
6643 * testsuite/strong_ref_weak_def.sh: New file.
6644 * testsuite/strong_ref_weak_def_1.c: Ditto.
6645 * testsuite/strong_ref_weak_def_2.c: Ditto.
6646
d1238d12
CC
66472010-08-12 Cary Coutant <ccoutant@google.com>
6648
6649 * testsuite/incremental_test.sh: Rewrite.
6650 * testsuite/incremental_test_1.c: Rewrite.
6651 * testsuite/incremental_test_2.c: Rewrite.
6652
0e70b911
CC
66532010-08-12 Cary Coutant <ccoutant@google.com>
6654
6655 * arm.cc (Target_arm::got_size): Add const.
6656 (Target_arm::got_entry_count): New function.
6657 (Target_arm::plt_entry_count): New function.
6658 (Target_arm::first_plt_entry_offset): New function.
6659 (Target_arm::plt_entry_size): New function.
6660 (Output_data_plt_arm::entry_count): New function.
6661 (Output_data_plt_arm::first_plt_entry_offset): New function.
6662 (Output_data_plt_arm::get_plt_entry_size): New function.
6663 * i386.cc (Target_i386::got_size): Add const.
6664 (Target_i386::got_entry_count): New function.
6665 (Target_i386::plt_entry_count): New function.
6666 (Target_i386::first_plt_entry_offset): New function.
6667 (Target_i386::plt_entry_size): New function.
6668 (Output_data_plt_i386::entry_count): New function.
6669 (Output_data_plt_i386::first_plt_entry_offset): New function.
6670 (Output_data_plt_i386::get_plt_entry_size): New function.
6671 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
6672 find_incremental_inputs_sections. Dump incremental_got_plt section.
6673 * incremental.cc: Include target.h.
6674 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
6675 parameter. Adjust all callers. Find incremental_got_plt section.
6676 (Incremental_inputs::create_data_sections): Create incremental_got_plt
6677 section.
6678 (Output_section_incremental_inputs::set_final_data_size): Calculate
6679 size of incremental_got_plt section.
6680 (Output_section_incremental_inputs::do_write): Write the
6681 incremental_got_plt section.
6682 (Got_plt_view_info): New struct.
6683 (Local_got_offset_visitor): New class.
6684 (Global_got_offset_visitor): New class.
6685 (Global_symbol_visitor_got_plt): New class.
6686 (Output_section_incremental_inputs::write_got_plt): New function.
6687 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
6688 Add parameter. Adjust all callers.
6689 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
6690 (Incremental_inputs::got_plt_section): New function.
6691 (Incremental_inputs::got_plt_section_): New data member.
6692 (Incremental_got_plt_reader): New class.
6693 * layout.cc (Layout::create_incremental_info_sections): Add the
6694 incremental_got_plt section.
6695 * object.h (Got_offset_list::get_list): New function.
6696 (Got offset_list::for_all_got_offsets): New function.
6697 (Sized_relobj::local_got_offset_list): New function.
6698 * powerpc.cc (Target_powerpc::got_size): Add const.
6699 (Target_powerpc::got_entry_count): New function.
6700 (Target_powerpc::plt_entry_count): New function.
6701 (Target_powerpc::first_plt_entry_offset): New function.
6702 (Target_powerpc::plt_entry_size): New function.
6703 (Output_data_plt_powerpc::entry_count): New function.
6704 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
6705 (Output_data_plt_powerpc::get_plt_entry_size): New function.
6706 * sparc.cc (Target_sparc::got_size): Add const.
6707 (Target_sparc::got_entry_count): New function.
6708 (Target_sparc::plt_entry_count): New function.
6709 (Target_sparc::first_plt_entry_offset): New function.
6710 (Target_sparc::plt_entry_size): New function.
6711 (Output_data_plt_sparc::entry_count): New function.
6712 (Output_data_plt_sparc::first_plt_entry_offset): New function.
6713 (Output_data_plt_sparc::get_plt_entry_size): New function.
6714 * symtab.h (Symbol::got_offset_list): New function.
6715 (Symbol_table::for_all_symbols): New function.
6716 * target.h (Sized_target::got_entry_count): New function.
6717 (Sized_target::plt_entry_count): New function.
6718 (Sized_target::plt_entry_size): New function.
6719 * x86_64.cc (Target_x86_64::got_size): Add const.
6720 (Target_x86_64::got_entry_count): New function.
6721 (Target_x86_64::plt_entry_count): New function.
6722 (Target_x86_64::first_plt_entry_offset): New function.
6723 (Target_x86_64::plt_entry_size): New function.
6724 (Output_data_plt_x86_64::entry_count): New function.
6725 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
6726 (Output_data_plt_x86_64::get_plt_entry_size): New function.
6727
09ec0418
CC
67282010-08-12 Cary Coutant <ccoutant@google.com>
6729
6730 * archive.cc: Include incremental.h.
6731 (Archive::Archive): Initialize incremental_info_.
6732 (Archive::include_member): Record archive members in incremental info.
6733 (Add_archive_symbols::run): Record begin and end of an archive in
6734 incremental info.
6735 (Lib_group::include_member): Record objects in incremental info.
6736 * archive.h (Incremental_archive_entry): Forward declaration.
6737 (Archive::set_incremental_info): New member function.
6738 (Archive::incremental_info): New member function.
6739 (Archive::Unused_symbol_iterator): New class.
6740 (Archive::unused_symbols_begin): New member function.
6741 (Archive::unused_symbols_end): New member function.
6742 (Archive::incremental_info_): New data member.
6743 * incremental-dump.cc (find_input_containing_global): New function.
6744 (dump_incremental_inputs): Dump new incremental info sections.
6745 * incremental.cc: Include symtab.h.
6746 (Output_section_incremental_inputs): New class.
6747 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
6748 new incremental info sections.
6749 (Sized_incremental_binary::do_check_inputs): Likewise.
6750 (Incremental_inputs::report_archive): Remove.
6751 (Incremental_inputs::report_archive_begin): New function.
6752 (Incremental_inputs::report_archive_end): New function.
6753 (Incremental_inputs::report_object): New function.
6754 (Incremental_inputs::finalize_inputs): Remove.
6755 (Incremental_inputs::report_input_section): New function.
6756 (Incremental_inputs::report_script): Rewrite.
6757 (Incremental_inputs::finalize): Do nothing but finalize string table.
6758 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
6759 (Incremental_inputs::sized_create_inputs_section_data): Remove.
6760 (Incremental_inputs::create_data_sections): New function.
6761 (Incremental_inputs::relocs_entsize): New function.
6762 (Output_section_incremental_inputs::set_final_data_size): New function.
6763 (Output_section_incremental_inputs::do_write): New function.
6764 (Output_section_incremental_inputs::write_header): New function.
6765 (Output_section_incremental_inputs::write_input_files): New function.
6766 (Output_section_incremental_inputs::write_info_blocks): New function.
6767 (Output_section_incremental_inputs::write_symtab): New function.
6768 * incremental.h (Incremental_script_entry): Forward declaration.
6769 (Incremental_object_entry): Forward declaration.
6770 (Incremental_archive_entry): Forward declaration.
6771 (Incremental_inputs): Forward declaration.
6772 (Incremental_inputs_header_data): Remove.
6773 (Incremental_inputs_header): Remove.
6774 (Incremental_inputs_header_write): Remove.
6775 (Incremental_inputs_entry_data): Remove.
6776 (Incremental_inputs_entry): Remove.
6777 (Incremental_inputs_entry_write): Remove.
6778 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
6779 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
6780 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
6781 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
6782 Likewise.
6783 (Incremental_input_entry): New class.
6784 (Incremental_script_entry): New class.
6785 (Incremental_object_entry): New class.
6786 (Incremental_archive_entry): New class.
6787 (Incremental_inputs::Incremental_inputs): Initialize new data members.
6788 (Incremental_inputs::report_inputs): Remove.
6789 (Incremental_inputs::report_archive): Remove.
6790 (Incremental_inputs::report_archive_begin): New function.
6791 (Incremental_inputs::report_archive_end): New function.
6792 (Incremental_inputs::report_object): Change prototype.
6793 (Incremental_inputs::report_input_section): New function.
6794 (Incremental_inputs::report_script): Change prototype.
6795 (Incremental_inputs::get_reloc_count): New function.
6796 (Incremental_inputs::set_reloc_count): New function.
6797 (Incremental_inputs::create_data_sections): New function.
6798 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
6799 (Incremental_inputs::inputs_section): New function.
6800 (Incremental_inputs::symtab_section): New function.
6801 (Incremental_inputs::relocs_section): New function.
6802 (Incremental_inputs::get_stringpool): Add const.
6803 (Incremental_inputs::command_line): Add const.
6804 (Incremental_inputs::inputs): Remove.
6805 (Incremental_inputs::command_line_key): New function.
6806 (Incremental_inputs::input_file_count): New function.
6807 (Incremental_inputs::input_files): New function.
6808 (Incremental_inputs::relocs_entsize): New function.
6809 (Incremental_inputs::sized_create_inputs_section_data): Remove.
6810 (Incremental_inputs::finalize_inputs): Remove.
6811 (Incremental_inputs::Input_info): Remove.
6812 (Incremental_inputs::lock_): Remove.
6813 (Incremental_inputs::inputs_): Change type.
6814 (Incremental_inputs::inputs_map_): Remove.
6815 (Incremental_inputs::current_object_entry_): New data member.
6816 (Incremental_inputs::inputs_section_): New data member.
6817 (Incremental_inputs::symtab_section_): New data member.
6818 (Incremental_inputs::relocs_section_): New data member.
6819 (Incremental_inputs::reloc_count_): New data member.
6820 (Incremental_inputs_reader): New class.
6821 (Incremental_symtab_reader): New class.
6822 (Incremental_relocs_reader): New class.
6823 * layout.cc (Layout::finalize): Move finalization of incremental info
6824 and creation of incremental info sections to follow finalization of
6825 symbol table. Set offsets for postprocessing sections.
6826 (Layout::create_incremental_info_sections): Call
6827 Incremental_inputs::create_data_sections. Add incremental symtab
6828 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
6829 sections to layout after input sections.
6830 * layout.h (struct Timespec): Forward declaration.
6831 (Layout::incremental_inputs): Add const.
6832 (Layout::create_incremental_info_sections): Add parameter.
6833 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
6834 * object.cc: Include incremental.h.
6835 (Relobj::finalize_incremental_relocs): New function.
6836 (Sized_relobj::do_layout): Record input sections in incremental info.
6837 * object.h (Object::output_section): New function.
6838 (Object::output_section_offset): Moved from Relobj.
6839 (Object::get_incremental_reloc_base): New function.
6840 (Object::get_incremental_reloc_count): New function.
6841 (Object::do_output_section): New function.
6842 (Object::do_output_section_offset): Moved from Relobj.
6843 (Object::do_get_incremental_reloc_base): New function.
6844 (Object::do_get_incremental_reloc_count): New function.
6845 (Object::Object): Initialize new data members.
6846 (Relobj::output_section): Renamed do_output_section and moved to
6847 protected.
6848 (Relobj::output_section_offset): Moved to Object.
6849 (Relobj::do_get_incremental_reloc_base): New function.
6850 (Relobj::do_get_incremental_reloc_count): New function.
6851 (Relobj::allocate_incremental_reloc_counts): New function.
6852 (Relobj::count_incremental_reloc): New function.
6853 (Relobj::finalize_incremental_relocs): New function.
6854 (Relobj::next_incremental_reloc_index): New function.
6855 (Relobj::reloc_counts_): New data member.
6856 (Relobj::reloc_bases_): New data member.
6857 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
6858 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
6859 (Sized_relobj::incremental_relocs_scan): New function.
6860 (Sized_relobj::incremental_relocs_scan_reltype): New function.
6861 (Sized_relobj::incremental_relocs_write): New function.
6862 (Sized_relobj::incremental_relocs_write_reltype): New function.
6863 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
6864 incremental link.
6865 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
6866 archives and object files elsewhere.
6867 (Add_symbols::run): Report object files here.
6868 (Finish_group::run): Report end of archive at end of group.
6869 * reloc.cc: Include layout.h, incremental.h.
6870 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
6871 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
6872 (Sized_relobj::incremental_relocs_scan): New function.
6873 (Sized_relobj::incremental_relocs_scan_reltype): New function.
6874 (Sized_relobj::do_relocate_sections): Write incremental relocations.
6875 (Sized_relobj::incremental_relocs_write): New function.
6876 (Sized_relobj::incremental_relocs_write_reltype): New function.
6877 * script.cc (read_input_script): Rewrite test for incremental link.
6878 Change call to Incremental_inputs::report_script.
6879 * symtab.h (Symbol_table::first_global_index): New function.
6880 (Symbol_table::output_count): New function.
6881
ce0d1972
DK
68822010-08-12 Doug Kwan <dougkwan@google.com>
6883
6884 * arm.cc (Target_arm::merge_object_attributes): Check command line
6885 options --no-wchar-size-warning and --no-enum-size-warning.
6886 * options.h (General_options): Add ld-compatible options
6887 --no-enum-size-warning and --no-wchar-size-warning.
6888
6e5710ce
ILT
68892010-08-04 Ian Lance Taylor <iant@google.com>
6890
6891 * x86_64.cc (Target_x86_64::Scan::local): Use
6892 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
6893 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
6894 (Target_x86_64::Scan::global): Likewise.
6895 (Target_x86_64::Relocate::relocate): Likewise.
6896 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
6897 Likewise.
6898
fef830db
CC
68992010-08-03 Cary Coutant <ccoutant@google.com>
6900
6901 * merge.cc (Output_merge_string::do_add_input_section): Count strings
6902 to reserve space in merged_strings vector. Keep total input size
6903 for stats.
6904 (Output_merge_string::do_print_merge_stats): Print total input size.
6905 * merge.h (Output_merge_string): Add input_size_ field.
6906 * stringpool.cc (Stringpool_template::string_length): Move
6907 implementations out of Stringpool_template class and place in
6908 stringpool.h.
6909 * stringpool.h (string_length): Move out of Stringpool_template.
6910
1e3811b0
ILT
69112010-08-03 Ian Lance Taylor <iant@google.com>
6912
6913 PR 11712
6914 * layout.cc (relaxation_loop_body): If address of load segment is
6915 set, adjust address to include headers if possible.
6916
7af0c620
ILT
69172010-08-03 Ian Lance Taylor <iant@google.com>
6918
6919 * version.cc (version_string): Bump to 1.10.
6920
22f0da72
ILT
69212010-08-03 Ian Lance Taylor <iant@google.com>
6922
6923 PR 11805
6924 * layout.h (enum Output_section_order): Define.
6925 (class Layout): Update declarations.
6926 * layout.cc (Layout::get_output_section): Add order parameter.
6927 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
6928 is_first_non_relro parameters. Change all callers.
6929 (Layout::choose_output_section): Likewise.
6930 (Layout::add_output_section_data): Likewise.
6931 (Layout::make_output_section): Likewise. Set order.
6932 (Layout::default_section_order): New function.
6933 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
6934 * output.cc (Output_section::Output_section): Initialize order_.
6935 Don't initialize deleted fields.
6936 (Output_segment::Output_segment): Don't initialize deleted
6937 fields.
6938 (Output_segment::add_output_section_to_load): New function
6939 replacing add_output_section. Change all callers to call this or
6940 add_output_section_to_nonload.
6941 (Output_segment::add_output_section_to_nonload): New function.
6942 (Output_segment::remove_output_section): Rewrite.
6943 (Output_segment::add_initial_output_data): Likewise.
6944 (Output_segment::has_any_data_sections): Likewise.
6945 (Output_segment::is_first_section_relro): Likewise.
6946 (Output_segment::maximum_alignment): Likewise.
6947 (Output_segment::has_dynamic_reloc): New function replacing
6948 dynamic_reloc_count. Change all callers.
6949 (Output_segment::has_dynamic_reloc_list): New function replacing
6950 dynamic_reloc_count_list. Change all callers.
6951 (Output_segment::set_section_addresses): Rewrite.
6952 (Output_segment::set_offset): Rewrite.
6953 (Output_segment::find_first_and_last_list): Remove.
6954 (Output_segment::set_tls_offsets): Rewrite.
6955 (Output_segment::first_section_load_address): Likewise.
6956 (Output_segment::output_section_count): Likewise.
6957 (Output_segment::section_with_lowest_load_address): Likewise.
6958 (Output_segment::write_section_headers): Likewise.
6959 (Output_segment::print_sections_to_map): Likewise.
6960 * output.h (class Output_data): Remove dynamic_reloc_count_
6961 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
6962 (Output_data::add_dynamic_reloc): Rewrite.
6963 (Output_data::has_dynamic_reloc): New function.
6964 (Output_data::dynamic_reloc_count): Remove.
6965 (class Output_section): Add order_ field. Remvoe is_relro_local_,
6966 is_last_relro_, is_first_non_relro_, is_interp_,
6967 is_dynamic_linker_section_ fields. Add order and set_order
6968 functions. Remove is_relro_local, set_is_relro_local,
6969 is_last_relro, set_is_last_relro, is_first_non_relro,
6970 set_is_first_non_relro functions, is_interp, set_is_interp,
6971 is_dynamic_linker_section, and set_is_dynamic_linker_section
6972 functions.
6973 (class Output_segment): Change Output_data_list from std::list to
6974 std:;vector. Add output_lists_ field. Remove output_data_ and
6975 output_bss_ fields. Update declarations.
6976
3ff2ccb0
ILT
69772010-08-02 Ian Lance Taylor <iant@google.com>
6978
6979 * arm.cc (Target_arm::gc_process_relocs): Use typename.
6980 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
6981 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
6982
88a4108b
ILT
69832010-08-02 Ian Lance Taylor <iant@google.com>
6984
6985 PR 11855
6986 * script.cc (Script_options::Script_options): Initialize
6987 symbol_definitions_ and symbol_references_.
6988 (Script_options::add_symbol_assignment): Update
6989 symbol_definitions_ and symbol_references_.
6990 (Script_options::add_symbol_reference): New function.
6991 (script_symbol): New function.
6992 * script.h (class Script_options): Add symbol_definitions_ and
6993 symbol_references_ fields.
6994 (Script_options::referenced_const_iterator): New type.
6995 (Script_options::referenced_begin): New function.
6996 (Script_options::referenced_end): New function.
6997 (Script_options::is_referenced): New function.
6998 (Script_options::any_unreferenced): New function.
6999 * script-c.h (script_symbol): Declare.
7000 * yyscript.y (exp): Call script_symbol.
7001 * symtab.cc: Include "script.h".
7002 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
7003 Change all callers. Check symbols referenced by scripts.
7004 (Symbol_table::add_undefined_symbols_from_command_line): Add
7005 layout parameter. Change all callers.
7006 (Symbol_table::do_add_undefined_symbols_from_command_line):
7007 Likewise. Break out loop body. Check symbols referenced by
7008 scripts.
7009 (Symbol_table::add_undefined_symbol_from_command_line): New
7010 function broken out of
7011 do_add_undefined_symbols_from_command_line.
7012 * symtab.h (class Symbol_table): Update declarations.
7013 * archive.cc: Include "layout.h".
7014 (Archive::should_include_member): Add layout parameter. Change
7015 all callers. Check for symbol mentioned in expression.
7016 * archive.h (class Archive): Update declaration.
7017 * object.cc (Sized_relobj::do_should_include_member): Add layout
7018 parameter.
7019 * object.h (Object::should_include_member): Add layout parameter.
7020 Change all callers.
7021 (Object::do_should_include_member): Add layout parameter.
7022 (class Sized_relobj): Update declaration.
7023 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
7024 parameter.
7025 * dynobj.h (class Sized_dynobj): Update declaration.
7026 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
7027 layout parameter.
7028 * plugin.h (class Sized_pluginobj): Update declaration.
7029
5f1ab67a
ILT
70302010-08-02 Ian Lance Taylor <iant@google.com>
7031
7032 PR 11866
7033 * output.cc (Output_segment::set_offset): Search for the first and
7034 last sections rather than assuming that the list is in order.
7035 (Output_segment::find_first_and_last_list): New function.
7036 * output.h (class Output_segment): Update declarations.
7037 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
7038 (relro_strip_test_SOURCES): New variable.
7039 (relro_strip_test_DEPENDENCIES): New variable.
7040 (relro_strip_test_LDFLAGS): New variable.
7041 (relro_strip_test_LDADD): New variable.
7042 (relro_strip_test.so): New target.
7043
a8df5856
ILT
70442010-08-02 Ian Lance Taylor <iant@google.com>
7045
7046 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
7047 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
7048 (Target_i386::got_tlsdesc_section): New function.
7049 (Target_i386::got_section): Create space for GOT entries for
7050 TLSDESC relocations.
7051 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
7052 R_386_TLS_GOTDESC.
7053 (Target_i386::Scan::global): Likewise.
7054 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
7055 using TLSDESC GOT.
7056 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
7057 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
7058 (Target_x86_64::got_tlsdesc_section): New function.
7059 (Target_x86_64::got_section): Create space for GOT entries for
7060 TLSDESC relocations.
7061 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
7062 R_386_TLS_GOTDESC.
7063 (Target_x86_64::Scan::global): Likewise.
7064 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
7065 using TLSDESC GOT.
7066
0c10a0a6
ILT
70672010-08-02 Ian Lance Taylor <iant@google.com>
7068
7069 * testsuite/final_layout.sh: Use dc to convert from hex to
7070 decimal.
7071
41cbeecc
ST
70722010-07-29 Sriraman Tallam <tmsriram@google.com>
7073
7074 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
7075 paramter to the call to gold::gc_process_relocs.
7076 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
7077 paramter to the call to gold::gc_process_relocs.
7078 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
7079 parameter to the call to gold::gc_process_relocs.
7080 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
7081 template parameter to the call to gold::gc_process_relocs.
7082 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
7083 paramter to the call to gold::gc_process_relocs.
7084 * gc.h (get_embedded_addend_size): New function.
7085 (gc_process_relocs): Save the size of the reloc for use by ICF.
7086 * icf.cc (get_section_contents): Get the addend from the text section
7087 for SHT_REL relocation sections.
7088 * icf.h (Icf::Reloc_addend_size_info): New typedef.
7089 (Icf::Reloc_info): Add new member reloc_addend_size_info.
7090 * int_encoding.h (read_from_pointer): New overloaded function.
7091 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
7092 * testsuite/icf_sht_rel_addend_test.sh: New file.
7093 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
7094 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
7095
6ea55b82
RW
70962010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7097
7098 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
7099 * Makefile.in: Regenerate.
7100 * testsuite/Makefile.in: Regenerate.
7101
9691462b
ILT
71022010-07-27 Jeffrey Yasskin <jyasskin@google.com>
7103
7104 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
7105 * gold/testsuite/debug_msg.cc: Likewise.
7106 * gold/testsuite/odr_violation1.cc
7107 * gold/testsuite/odr_violation2.cc
7108
76897331
CC
71092010-07-21 Cary Coutant <ccoutant@google.com>
7110
7111 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
7112 string, and length fields.
7113 (Output_merge_string::Merged_strings_list): New type.
7114 (Output_merge_string::Merged_strings_lists): New typedef.
7115 (Output_merge_string): Replace merged_strings_ with
7116 merged_strings_lists_.
7117 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
7118 Merged_strings_list per input object and section. Don't store pointer
7119 to the string. Don't store length with each merged string entry.
7120 (Output_merge_string::finalize_merged_data): Loop over list of merged
7121 strings lists. Recompute length of each merged string.
7122
78384e8f
CC
71232010-07-15 Cary Coutant <ccoutant@google.com>
7124
7125 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
7126 here.
7127
783659f9
ILT
71282010-07-14 Ian Lance Taylor <iant@google.com>
7129
7130 * descriptors.cc (Descriptors::open): Report correct name in error
7131 message.
7132
131687b4
DK
71332010-07-13 Doug Kwan <dougkwan@google.com>
7134
7135 * arm.cc (Arm_input_section::Arm_input_section): For a
7136 SHT_ARM_EXIDX section, always keeps the input sections.
7137 (Arm_input_section::set_exidx_section_link): New method.
7138 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
7139 has_errors_ to false.
7140 (Arm_exidx_input_section::has_errors,
7141 Arm_exidx_input_section::set_has_errors): New methods.
7142 (Arm_exidx_input_section::has_errors_): New data member.
7143 (Arm_relobj::get_exidx_shndx_list): New method.
7144 (Arm_output_section::append_text_sections_to_list): Do not skip
7145 section without SHF_EXECINSTR.
7146 (Arm_output_section::fix_exidx_coverage): Skip input sections with
7147 errors.
2e702c99 7148 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
7149 section header. Make error messages more verbose. Check for
7150 a non-executable section linked to an EXIDX section.
7151 (Arm_relobj::do_read_symbols): Remove error checking, which has been
7152 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
7153 check that there is no deferred EXIDX section if we exit early.
7154 Instead of not making an EXIDX section in case of an error, make one
7155 and set the has_errors flag of it.
7156 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
7157 in a relocatable link.
7158 (Target_arm::do_relax): Look for the EXIDX output section instead of
7159 assuming that it is called .ARM.exidx.
2e702c99 7160 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
7161 section list. Do not check for SHF_EXECINSTR section flags but
7162 skip any input section with errors.
7163 * output.cc (Output_section::Output_section): Initialize
7164 always_keeps_input_sections_ to false.
7165 (Output_section::add_input_section): Check for
7166 always_keeps_input_sections_.
7167 * output.h (Output_section::always_keeps_input_sections,
7168 Output_section::set_always_keeps_input_sections): New methods.
7169 (Output_section::always_keeps_input_sections): New data member.
7170
69517287
RÁE
71712010-07-13 Rafael Espindola <espindola@google.com>
7172
7173 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
7174 * fileread.h (Input_file): Add try_extra_search_path and find_file.
7175
82742395
ILT
71762010-07-13 Philip Herron <herron.philip@googlemail.com>
7177 Ian Lance Taylor <iant@google.com>
7178
7179 * output.h (Output_section_lookup_maps::add_merge_section):
7180 Correct check of whether value was inserted.
7181 (Output_section_lookup_maps::add_merge_input_section): Likewise.
7182 (Output_section_lookup_maps::add_relaxed_input_section):
7183 Likewise.
7184 * arm.cc (Target_arm::got_section): Remove used local os.
7185 * i386.cc (Target_i386::got_section): Likewise.
7186 * x86_64.cc (Target_x86_64::got_section): Likewise.
7187 * sparc.cc (Target_sparc::got_section): Likewise.
7188 (Target_sparc::relocate): Remove unused local have_got_offset.
7189 * powerpc.cc (Target_powerpc::relocate): Likewise.
7190
f2d707b5
ILT
71912010-07-13 Ian Lance Taylor <iant@google.com>
7192
241531d6
ILT
7193 * compressed_output.cc (zlib_decompress): Fix signature in
7194 !HAVE_ZLIB_H case.
7195
f2d707b5
ILT
7196 * archive.cc (Archive::include_member): Unlock an external member
7197 of a thin archive. Don't bother to delete an object we know is
7198 NULL.
7199
a2e47362
CC
72002010-07-12 Cary Coutant <ccoutant@google.com>
7201
7202 * compressed_output.cc (zlib_decompress): New function.
7203 (get_uncompressed_size): New function.
7204 (decompress_input_section): New function.
7205 * compressed_output.h (get_uncompressed_size): New function.
7206 (decompress_input_section): New function.
7207 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
7208 Handle compressed debug sections.
7209 * layout.cc (is_compressed_debug_section): New function.
7210 (Layout::output_section_name): Map compressed section names to
7211 canonical names.
7212 * layout.h (is_compressed_debug_section): New function.
7213 (is_debug_info_section): Recognize compressed debug sections.
7214 * merge.cc: Include compressed_output.h.
7215 (Output_merge_data::do_add_input_section): Handle compressed
7216 debug sections.
7217 (Output_merge_string::do_add_input_section): Handle compressed
7218 debug sections.
7219 * object.cc: Include compressed_output.h.
7220 (Sized_relobj::Sized_relobj): Initialize new data members.
7221 (build_compressed_section_map): New function.
7222 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
7223 * object.h (Object::section_is_compressed): New method.
7224 (Object::do_section_is_compressed): New method.
7225 (Sized_relobj::Compressed_section_map): New type.
7226 (Sized_relobj::do_section_is_compressed): New method.
7227 (Sized_relobj::compressed_sections_): New data member.
7228 * output.cc (Output_section::add_input_section): Handle compressed
7229 debug sections.
7230 * reloc.cc: Include compressed_output.h.
7231 (Sized_relobj::write_sections): Handle compressed debug sections.
7232
ce279a62
CC
72332010-07-08 Cary Coutant <ccoutant@google.com>
7234
7235 * resolve.cc (Symbol_table::resolve): Remember whether undef was
7236 weak when resolving to a dynamic def.
7237 (Symbol_table::should_override): Add adjust_dyndef flag; set it
7238 for weak undef/dynamic def cases. Adjust callers.
7239 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
7240 undef_binding_weak_.
7241 (Symbol_table::sized_write_globals): Adjust symbol binding.
7242 (Symbol_table::sized_write_symbol): Add binding parameter.
7243 * symtab.h (Symbol::set_undef_binding): New method.
7244 (Symbol::is_undef_binding_weak): New method.
7245 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
7246 (Symbol_table::should_override): Add new parameter.
7247 (Symbol_table::sized_write_symbol): Add new parameter.
7248
7249 * testsuite/weak_undef_file1.cc: Add new test case.
7250 * testsuite/weak_undef_file2.cc: Fix header comment.
7251 * testsuite/weak_undef_test.cc: Add new test case.
7252
b2286c10
DK
72532010-06-29 Doug Kwan <dougkwan@google.com>
7254
7255 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
7256 Initialize USE_SYMBOL_.
7257 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
7258 definition.
7259 (Arm_reloc_property::uses_symbol_): New data member declaration.
7260 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
7261 uses symbol value and symbol is undefined but not weakly undefined.
7262
4802450a
RÁE
72632010-06-28 Rafael Espindola <espindola@google.com>
7264
7265 * plugin.cc (Plugin::load): Use dlerror.
7266
e5ca47ba
ILT
72672010-06-26 Jeffrey Yaskin <jyasskin@google.com>
7268
7269 * symtab.cc (detect_odr_violations): When reporting an ODR
7270 violation, report an object where the symbol is defined.
7271
8a75a161
DK
72722010-06-25 Doug Kwan <dougkwan@google.com>
7273
7274 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
7275 (Target_arm::section_may_have_icf_unsafe_pointers): New method
7276 definition.
7277 (Target_arm::Scan::local_reloc_may_be_function_pointer,
7278 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
7279 target hook to detect function points.
7280 (Target_arm::Scan::possible_function_pointer_reloc): New method.
7281 * icf.h (Icf::check_section_for_function_pointers): Change type of
7282 parameter SECTION_NAME to const reference to std::string. Use
7283 target hook to determine if section may have unsafe pointers.
7284 * target.h (Target::section_may_have_icf_unsafe_pointers): New
7285 method definition.
7286
42218b9f
RÁE
72872010-06-21 Rafael Espindola <espindola@google.com>
7288
7289 * fileread.cc (Input_file::find_fie): New
7290 (Input_file::open): Use Input_file::find_fie.
7291 * fileread.h (Input_file::find_fie): New
7292 * plugin.cc (set_extra_library_path): New.
7293 (Plugin::load): Add set_extra_library_path to the transfer vector.
7294 (Plugin_manager::set_extra_library_path): New.
7295 (Plugin_manager::add_input_file): Use the extra search path if set.
7296 (set_extra_library_path(): New.
7297 * plugin.h (Plugin_manager): Add set_extra_library_path and
7298 extra_search_path_.
7299
a0506cca
CC
73002010-06-19 Cary Coutant <ccoutant@google.com>
7301
7302 * layout.cc (gdb_sections): Add .debug_types.
7303 (lines_only_debug_sections): Likewise.
7304
6508b958
RÁE
73052010-06-18 Rafael Espindola <espindola@google.com>
7306
7307 * plugin.cc (add_input_file,add_input_library)
7308 (Plugin_manager::add_input_file): Make filename arguments const.
7309 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
7310 const.
7311
3e235302
DK
73122010-06-16 Doug Kwan <dougkwan@google.com>
7313
7314 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
7315 .ARM.attributes section if we have not merged any input
7316 attributes sections.
7317
106e8a6c
DK
73182010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7319
7320 * arm.cc: Allow combining objects with no EABI version
7321 information.
7322
91ff43fe
RÁE
73232010-06-15 Rafael Espindola <espindola@google.com>
7324
7325 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
7326
68ed838c
ILT
73272010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7328
7329 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
7330 (struct iovec): Correct !HAVE_READV definition.
7331
f3a2388f
CC
73322010-06-10 Cary Coutant <ccoutant@google.com>
7333
7334 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
7335 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
7336 reloc sections.
7337 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
7338
7339 PR 11683
7340 * symtab.h (Symbol::is_placeholder): New member function.
7341 * target-reloc.h (relocate_section): Check for placeholder symbols.
7342
7343 * testsuite/Makefile.am (plugin_test_8): New test.
7344 (plugin_test_9): New test.
7345 * testsuite/Makefile.in: Regenerate.
7346
e1df38aa
NC
73472010-06-09 Nick Clifton <nickc@redhat.com>
7348
7349 * yyscript.y (input_list_element): Allow strings prefixed with
7350 the '-' character. Treat these as libraries.
7351 * script.cc (script_add_library): New function. Adds a library
7352 specified by "-l<name>" found in an input script.
7353 * script-c.h: Add prototype for script_add_library.
7354
25bbe950
DK
73552010-06-07 Doug Kwan <dougkwan@google.com>
7356
7357 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
7358 Restrict stub-group size to be within long conditional branch
7359 range when working around cortex-A8 erratum.
7360
0f32ea4c
ILT
73612010-06-07 Damien Diederen <dd@crosstwine.com>
7362
7363 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
7364 #ifdef typo.
7365
8fe2a369
ST
73662010-06-03 Sriraman Tallam <tmsriram@google.com>
7367
7368 PR gold/11658
7369 * output.cc
7370 (Output_section::Input_section_sort_entry::compare_section_ordering):
7371 Change to return non-zero correctly.
7372 (Output_section::Input_section_sort_section_order_index_compare
7373 ::operator()): Change to fix ambiguity in comparisons.
7374
6e9ba2ca
ST
73752010-06-01 Sriraman Tallam <tmsriram@google.com>
7376
7377 * gold.h (is_wildcard_string): New function.
7378 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
7379 (Layout::layout_eh_frame): Ditto.
7380 (Layout::find_section_order_index): New method.
7381 (Layout::read_layout_from_file): New method.
7382 * layout.h (Layout::find_section_order_index): New method.
7383 (Layout::read_layout_from_file): New method.
7384 (Layout::input_section_position_): New private member.
7385 (Layout::input_section_glob_): New private member.
7386 * main.cc (main): Call read_layout_from_file here.
7387 * options.h (--section-ordering-file): New option.
7388 * output.cc (Output_section::input_section_order_specified_): New
7389 member.
7390 (Output_section::Output_section): Initialize new member.
7391 (Output_section::add_input_section): Add new parameter.
7392 Keep input sections when --section-ordering-file is used.
7393 (Output_section::set_final_data_size): Sort input sections when
7394 section ordering file is specified.
7395 (Output_section::Input_section_sort_entry): Add new parameter.
7396 Check sorting type.
7397 (Output_section::Input_section_sort_entry::compare_section_ordering):
7398 New method.
7399 (Output_section::Input_section_sort_compare::operator()): Change to
7400 consider section_order_index.
7401 (Output_section::Input_section_sort_init_fini_compare::operator()):
7402 Change to consider section_order_index.
7403 (Output_section::Input_section_sort_section_order_index_compare
7404 ::operator()): New method.
7405 (Output_section::sort_attached_input_sections): Change to sort
7406 according to section order when specified.
e1df38aa
NC
7407 (Output_section::add_input_section<32, true>): Add new parameter.
7408 (Output_section::add_input_section<64, true>): Add new parameter.
7409 (Output_section::add_input_section<32, false>): Add new parameter.
7410 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
7411 * output.h (Output_section::add_input_section): Add new parameter.
7412 (Output_section::input_section_order_specified): New
7413 method.
7414 (Output_section::set_input_section_order_specified): New method.
7415 (Input_section::Input_section): Initialize section_order_index_.
7416 (Input_section::section_order_index): New method.
7417 (Input_section::set_section_order_index): New method.
7418 (Input_section::section_order_index_): New member.
7419 (Input_section::Input_section_sort_section_order_index_compare): New
7420 struct.
7421 (Output_section::input_section_order_specified_): New member.
7422 * script-sections.cc (is_wildcard_string): Delete and move modified
7423 method to gold.h.
7424 (Output_section_element_input::Output_section_element_input): Modify
7425 call to is_wildcard_string.
7426 (Output_section_element_input::Input_section_pattern
7427 ::Input_section_pattern): Ditto.
7428 (Output_section_element_input::Output_section_element_input): Ditto.
7429 * testsuite/Makefile.am (final_layout): New test case.
7430 * testsuite/Makefile.in: Regenerate.
7431 * testsuite/final_layout.cc: New file.
7432 * testsuite/final_layout.sh: New file.
7433
3537c84b
RÁE
74342010-06-01 Rafael Espindola <espindola@google.com>
7435
7436 * plugin.cc (Plugin::load): Pass the output name to the plugin.
7437
105b6afd
RÁE
74382010-06-01 Rafael Espindola <espindola@google.com>
7439
7440 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
7441 visibility of symbols.
7442
29e11421
DK
74432010-05-27 Doug Kwan <dougkwan@google.com>
7444
7445 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
7446 from start of output section instead of address for a local symbol
7447 in a merged or relaxed section when doing a relocatable link.
7448
5e0f337e
RÁE
74492010-05-26 Rafael Espindola <espindola@google.com>
7450
703d02da 7451 PR 11604
5e0f337e
RÁE
7452 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
7453 adding sections the garbage collector removed.
7454 * gold/testsuite/Makefile.am: Add test.
7455 * gold/testsuite/Makefile.in: Regenerate.
7456 * gold/testsuite/plugin_test_7.sh: New.
7457 * gold/testsuite/plugin_test_7_1.c: New.
7458 * gold/testsuite/plugin_test_7_2.c: New.
7459
f4187277
RÁE
74602010-05-26 Rafael Espindola <espindola@google.com>
7461
7462 * script-sections.cc (Output_section_definition::set_section_addresses):
7463 Check for --section-start.
7464
5c388529
DK
74652010-05-26 Doug Kwan <dougkwan@google.com>
7466
7467 * arm.cc (Arm_scan_relocatable_relocs): New class.
7468 (Target_arm::relocate_special_relocatable): New method.
7469 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
7470 (Arm_relocate_functions::thumb_branch_common): Same.
7471 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
7472 instead of Default_scan_relocatable_relocs.
7473 * target-reloc.h (relocate_for_relocatable): Let target handle
7474 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
7475 * target.h (Sized_target::relocate_special_relocatable): New method.
7476
bca1c3ae
ILT
74772010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7478
7479 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
7480
0439c796
DK
74812010-05-23 Doug Kwan <dougkwan@google.com>
7482
7483 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
7484 instead of a cast.
7485 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
7486 with a direct branch, not a conditional branch, to a stub.
7487 * merge.cc (Output_merge_base::record_input_section): New method
7488 defintion.
7489 (Output_merge_data::do_add_input_section): Record input section if
7490 keeps-input-sections flag is set.
7491 (Output_merge_string::do_add_input_section): Ditto.
7492 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
7493 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
7494 INPUT_SECTIONS_.
7495 (Output_merge_base::keeps_input_sections,
7496 Output_merge_base::set_keeps_input_sections,
7497 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
7498 method definitions.
7499 (Output_merge_base::Input_sections): New type declaration.
7500 (Output_merge_base::input_sections_begin,
7501 Output_merge_base::input_sections_end,
7502 Output_merge_base::do_set_keeps_input_sections): New method definitions.
7503 (Output_merge_base::bool keeps_input_sections_,
7504 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
7505 Output_merge_base::input_sections_): New data members.
7506 (Output_merge_data::do_set_keeps_input_sections): New method
7507 defintion.
7508 (Output_merge_string::do_set_keeps_input_sections): Ditto.
7509 * output.cc (Output_section::Input_section::relobj): Move method
7510 defintion from class declaration to here and handle merge sections.
7511 (Output_section::Input_section::shndx): Ditto.
7512 (Output_section::Output_section): Remove initializations of removed
7513 data members and initialize new data member LOOKUP_MAPS_.
7514 (Output_section::add_input_section): Set keeps-input-sections flag
7515 for a newly created merge output section as appropriate. Adjust code
7516 to use Output_section_lookup_maps class.
7517 (Output_section::add_relaxed_input_section): Adjst code for lookup
7518 maps code refactoring.
2e702c99 7519 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
7520 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
7521 class. If adding input section to a newly created merge output
7522 section fails, remove the new merge section.
7523 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 7524 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 7525 (Output_section::find_merge_section): Ditto.
0439c796 7526 (Output_section::build_lookup_maps): New method defintion.
2e702c99 7527 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
7528 Output_section_lookup_maps class.
7529 (Output_section::get_input_sections): Export merge sections. Adjust
7530 code to use Output_section_lookup_maps class.
7531 (Output_section:::add_script_input_section): Adjust code to use
7532 Output_section_lookup_maps class. Update lookup maps for merge
7533 sections also.
7534 (Output_section::discard_states): Use Output_section_lookup_maps.
7535 (Output_section::restore_states): Same.
7536 * output.h (Merge_section_properties): Move class defintion out of
7537 Output_section.
7538 (Output_section_lookup_maps): New class.
7539 (Output_section::Input_section::is_merge_section): New method
7540 defintion.
7541 (Output_section::Input_section::relobj): Move defintion out of class
7542 defintion. Declare method only.
7543 (Output_section::Input_section::shndx): Ditto.
7544 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 7545 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
7546 (Output_section::Merge_section_by_properties_map,
7547 Output_section::Output_section_data_by_input_section_map,
7548 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
7549 Remove types.
2e702c99 7550 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
7551 KEEPS_INPUT_SECTIONS.
7552 (Output_section::build_lookup_maps): New method declaration.
7553 (Output_section::merge_section_map_,
7554 Output_section::merge_section_by_properties_map_,
7555 Output_section::relaxed_input_section_map_,
7556 Output_section::is_relaxed_input_section_map_valid_): Remove data
7557 members.
7558 (Output_section::lookup_maps_): New data member.
7559
76295588
L
75602010-05-21 Doug Kwan <dougkwan@google.com>
7561
7562 PR gold/11619
7563 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
7564 avoid a compilation error.
7565
d103a984
RÁE
75662010-05-19 Rafael Espindola <espindola@google.com>
7567
7568 * script-sections.cc (Output_section_definition::allocate_to_segment):
7569 Update the phdrs_list even when the output section is NULL.
7570 * testsuite/Makefile.am: Add test.
7571 * testsuite/Makefile.in: Regenerate.
7572 * testsuite/script_test_9.cc: New.
7573 * testsuite/script_test_9.sh: New.
7574 * testsuite/script_test_9.t: New.
7575
6625d24e
DK
75762010-05-19 Doug Kwan <dougkwan@google.com>
7577
7578 * arm.cc (Arm_input_section::original_size): New method.
7579 (Arm_input_section::do_addralign): Add a cast.
7580 (Arm_input_section::do_output_offset): Remove static cast.
7581 (Arm_input_section::original_addralign,
7582 Arm_input_section::original_size_): Change type to uint32_t.
7583 (Arm_input_section::init): Add safe casts for section alignment
7584 and size.
7585 (Arm_input_section::set_final_data_size): Do not set address and
7586 offset of stub table.
7587 (Arm_output_section::fix_exidx_coverage): Change use of of
7588 Output_section::Simple_input_section to that of
7589 Output_section::Input_section.
7590 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
7591 except for the first pass.
7592 * output.cc (Output_section::get_input_sections): Change type of
7593 input_sections to std::list<Input_section>.
7594 (Output_section::add_script_input_section): Rename from
7595 Output_section::add_simple_input_section. Change type of SIS
7596 parameter from Simple_input_section to Input_section.
7597 * output.h (Output_section::Simple_input_section): Remove class.
7598 (Output_section::Input_section): Change class visibility to public.
7599 (Output_section::Input_section::addralign): Use stored alignments
7600 for special input sections if set.
7601 (Output_section::Input_section::set_addralign): New method.
7602 (Output_section::get_input_sections): Change parameter type from
7603 list of Simple_input_section to list of Input_section.
7604 (Output_section::add_script_input_section): Rename from
7605 Output_section::add_simple_input_section. Change first parameter's
7606 type from Simple_input_section to Input_section and remove the
7607 second and third parameters.
7608 * script-sections.cc (Input_section::Input_section_list): Change
7609 type to list of Output_section::Input_section/
7610 (Input_section_info::Input_section_info): Change parameter type of
7611 INPUT_SECTION to Output_section::Input_section.
7612 (Input_section_info::input_section): Change return type.
7613 (Input_section_info::input_section_): Change type to
7614 Output_section::Input_section.
7615 (Output_section_element_input::set_section_addresses): Adjust code
7616 to use Output_section::Input_section instead of
7617 Output_section::Simple_input_section. Adjust code for renaming
7618 of Output_section::add_simple_input_section.
7619 (Orphan_output_section::set_section_addresses): Ditto.
7620
e1e82ea4
RW
76212010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7622
7623 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
7624 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
7625
91e75c8a
RÁE
76262010-05-18 Rafael Espindola <espindola@google.com>
7627
7628 * options.cc (General_options::finalize): Handle -nostdlib.
7629 * options.h (nostdlib): New option.
7630 * script.cc (script_add_search_dir): Handle -nostdlib.
7631
da59ad79
DK
76322010-05-12 Doug Kwan <dougkwan@google.com>
7633
7634 * arm.cc (Target_arm::do_finalize_sections): Create an empty
7635 attributes section only if there no attributes section after merging.
7636 (Target_arm::merge_object_attributes): Move value of
e1df38aa 7637 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
7638 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
7639 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
7640 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
7641 and arm_attr_merge_7.stdout.
7642 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
7643 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
7644 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
7645 arm_attr_merge_7b.o): New rules.
7646 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
7647 arm_attr_merge_7
7648 * testsuite/Makefile.in: Regenerate.
7649 * testsuite/arm_attr_merge.sh: New file.
7650 * testsuite/arm_attr_merge_[67][ab].s: Same.
7651
3e01a7fd
NC
76522010-05-05 Nick Clifton <nickc@redhat.com>
7653
7654 * po/es.po: Updated Spanish translation.
7655
7ad2014a
L
76562010-04-27 H.J. Lu <hongjiu.lu@intel.com>
7657
7658 * Makefile.am (install-exec-local): Properly install gold as
7659 default cross linker.
7660 * Makefile.in: Regenerated.
7661
4fda8867
NC
76622010-04-27 H.J. Lu <hongjiu.lu@intel.com>
7663 Nick Clifton <nickc@redhat.com>
7664
7665 * configure.ac (install_as_default): Define and set to false
7666 unless --enable-gold or --enable-gold=both/gold has been
7667 specified.
7668 * configure: Regenerate.
7669
7670 * Makefile.am (install-exec-local): Install the executable as
7671 'ld.gold'. If install_as_default is true then also install it as
7672 'ld'.
7673 * Makefile.in: Regenerated.
7674
bd288ea2
ILT
76752010-04-24 Ian Lance Taylor <iant@google.com>
7676
7677 * layout.cc (Layout::layout_reloc): In relocatable link don't
7678 combine reloc sections for grouped sections.
7679
ef38fd8a
ST
76802010-04-23 Sriraman Tallam <tmsriram@google.com>
7681
7682 * gc.h (gc_process_relocs): Pass information on relocs pointing to
7683 sections that are not ordinary to icf.
7684 * icf.cc (get_section_contents): Handle relocation pointing to section
7685 with no object or shndx information.
7686 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
7687 * testsuite/Makefile.in: Regenerate.
7688 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
7689 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
7690
f6973bdc
ILT
76912010-04-22 Ian Lance Taylor <iant@google.com>
7692
7693 * expression.cc (Expression::Expression_eval_info): Add
7694 result_alignment_pointer field.
7695 (Expression::eval_with_dot): Add result_alignment_pointer
7696 parameter. Change all callers.
7697 (Expression::eval_maybe_dot): Likewise.
7698 (class Binary_expression): Add alignment_pointer parameter to
7699 left_value and right_value. Change all callers.
7700 (BINARY_EXPRESSION): Set result alignment.
7701 (class Trinary_expression): Add alignment_pointer parameter to
7702 arg2_value and arg3_value. Change all callers.
7703 (Trinary_cond::value): Set result alignment.
7704 (Max_expression::value, Min_expression::value): Likewise.
7705 (Align_expression::value): Likewise.
7706 * script-sections.cc (class Sections_element): Add dot_alignment
7707 parameter to set_section_addresses virtual function. Update
7708 instantiations.
7709 (class Output_section_element): Likewise.
7710 (Script_sections::create_segments): Add dot_alignment parameter.
7711 Change all callers.
7712 (Script_sections::create_segments_from_phdrs_clause): Likewise.
7713 (Script_sections::set_phdrs_clause_addresses): Likewise.
7714 * script-sections.h: Update declarations.
7715 * script.h: Update declarations.
7716 * output.h (Output_segment::set_minimum_p_align): Don't decrease
7717 min_p_align.
7718 * testsuite/script_test_3.t: Set large alignment.
7719 * testsuite/script_test_3.sh: Make sure that at least one LOAD
7720 segment has expected alignment.
7721
9c9c98a5
NC
77222010-04-22 Nick Clifton <nickc@redhat.com>
7723
7724 * po/gold.pot: Updated by the Translation project.
7725 * po/vi.po: Updated Vietnamese translation.
7726
2253bfba
L
77272010-04-22 H.J. Lu <hongjiu.lu@intel.com>
7728
7729 * testsuite/Makefile.am (check_PROGRAMS): Add
7730 icf_virtual_function_folding_test.
7731 * testsuite/Makefile.in: Regenerated.
7732
85fdf906
AH
77332010-04-15 Andrew Haley <aph@redhat.com>
7734
7735 * options.h (merge_exidx_entries): New option.
7736 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
7737 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
7738 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
7739 (Target_arm::merge_exidx_entries): New function.
7740 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
7741 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
7742 to Arm_exidx_fixup constructor.
7743 Add new arg, merge_exidx_entries.
7744 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
7745 Arm_output_section::fix_exidx_coverage.
7746
ce97fa81
ST
77472010-04-18 Sriraman Tallam <tmsriram@google.com>
7748
7749 * icf.cc (get_section_contents): Check for preemptible functions.
7750 Ignore addend when appropriate.
7751 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
7752 section folded.
7753 (add_from_relobj): Check for section folded.
7754 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
7755 * symtab.h (should_add_dynsym_entry): Add new parameter.
7756 * target-reloc.h (scan_relocs): Check for section folded.
7757 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
7758 Check reloc types for function pointers in shared objects.
7759 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
7760 case.
7761 (icf_preemptible_functions_test): New test case.
7762 (icf_string_merge_test): New test case.
7763 * testsuite.Makefile.in: Regenerate.
7764 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
7765 bar_glob. Refactor code.
7766 * testsuite/icf_preemptible_functions_test.cc: New file.
7767 * testsuite/icf_preemptible_functions_test.sh: New file.
7768 * testsuite/icf_string_merge_test.cc: New file.
7769 * testsuite/icf_string_merge_test.sh: New file.
7770 * testsuite/icf_virtual_function_folding_test.cc: New file.
7771 * testsuite/icf_virtual_function_folding_test.sh: New file.
7772
04ceb17c
DK
77732010-04-14 Doug Kwan <dougkwan@google.com>
7774
7775 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
7776 for local symbol recounting if we remove a section due to ICF.
7777 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
7778 there are no regular objects in input.
7779
153e7da4
DK
77802010-04-13 Doug Kwan <dougkwan@google.com>
7781
7782 * arm.cc (Arm_input_section::set_final_data_size): Compute
7783 accurate final data size instead of using current data size.
7784
4dbd9faf
DK
77852010-04-09 Doug Kwan <dougkwan@google.com>
7786
7787 * layout.cc (Layout::choose_output_section): Handle script section
7788 types.
7789 (Layout::make_output_section_for_script): Add section type parameter.
7790 Handle script section types.
7791 * layout.h (Layout::make_output_section_for_script): Add section
7792 type parameter.
7793 * output.cc (Output_section::Output_section): Initialize data member
7794 is_noload_.
7795 (Output_section::do_reset_address_and_file_offset): Do not set address
7796 to 0 if section is a NOLOAD section.
7797 * output.h (Output_section::is_noload): New method.
7798 (Output_section::set_is_noload): Ditto.
7799 (Output_section::is_noload_): New data member.
7800 * script-c.h (Script_section_type): New enum type.
7801 (struct Parser_output_section_header): Add new file section_type.
7802 * script-sections.cc (Sections_element::output_section_name): Add
7803 parameter for returning script section type.
7804 (Output_section_definition::output_section_name): Ditto.
7805 (Output_section_definition::section_type)P; New method.
7806 (Output_section_definiton::script_section_type_name): Ditto.
7807 (Output_section_definition::script_section_type_): New data member.
7808 (Output_section_definition::Output_section_definition): Initialize
7809 data member Output_section_definition::script_section_type_.
7810 (Output_section_definition::create_sections): Pass script section type
7811 to Layout::make_output_section_for_script.
7812 (Output_section_definition::output_section_name): Return script
7813 section type to caller.
7814 (Output_section_definition::set_section_address): Do not advance
7815 dot value and load address if section type is NOLOAD. Set address
7816 of NOLOAD sections regardless of section flags.
7817 (Output_section_definition::print): Print section type if it is
7818 not SCRIPT_SECTION_TYPE_NONE.
7819 (Output_section_definition::section_type): New method.
7820 (Output_section_definition::script_section_type_name): Ditto.
7821 (Script_sections::output_section_name): Add new parameter
7822 PSECTION_TYPE for returning script section type. Pass it to
7823 section elements. Handle discard sections.
7824 (Sort_output_sections::operator()): Handle NOLOAD sections.
7825 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 7826 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
7827 returning script section type.
7828 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
7829 INFO and NOLOAD.
7830 * yyscript.y (union): Add new field SECTION_TYPE.
7831 (COPY, DSECT, INFO, NOLOAD): New tokens.
7832 (opt_address_and_section_type): Change type to output_section_header.
7833 (section_type): New non-terminal
7834 (section_header): Handle section type.
2253bfba 7835 (opt_address_and_section_type): Return section type value.
4dbd9faf 7836
721ea635
L
78372010-04-09 H.J. Lu <hongjiu.lu@intel.com>
7838
7839 * testsuite/plugin_common_test_1.c (foo): Add prototype.
7840 * testsuite/plugin_common_test_2.c (foo): Likewise.
7841
6bf924b0
DK
78422010-04-08 Doug Kwan <dougkwan@google.com>
7843
7844 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
7845 Output_merge_data.
7846 * output.cc (Output_section::add_merge_input_section): Simplify
7847 code and return status of Output_merge_base::add_input_section.
e1df38aa 7848 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
7849 returns true.
7850
24af6f92
DK
78512010-04-07 Doug Kwan <dougkwan@google.com>
7852
7853 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
7854 if section is marked as containing instructions but has no mapping
7855 symbols.
7856 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
7857 correct section index.
7858 (Arm_relobj::find_linked_text_section): Ditto.
7859
00698fc5
CC
78602010-04-07 Cary Coutant <ccoutant@google.com>
7861
7862 * archive.cc (include_member): Destroy Read_symbols_data object before
7863 releasing file.
7864 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
7865 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
7866 (Read_symbols_data::~Read_symbols_data) New destructor.
7867 (Section_relocs::Section_relocs) New constructor.
7868 (Section_relocs::~Section_relocs) New destructor.
7869 (Read_relocs_data::Read_relocs_data) New constructor.
7870 (Read_relocs_data::~Read_relocs_data) New destructor.
7871 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
7872 pointers to NULL after deleting.
7873
7296d933
DK
78742010-04-07 Doug Kwan <dougkwan@google.com>
7875
7876 * arm.cc: Replace "endianity" with "endianness" in comments.
7877 (Arm_exidx_cantunwind): Ditto.
7878 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
7879 (Arm_relobj::merge_flags_and_attributes): New method.
7880 (Arm_relobj::merge_flags_and_attributes_): New data member.
7881 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
7882 (Arm_relobj::scan_sections_for_stubs): Ditto.
7883 (Arm_relobj::do_read_symbols): Check to see if we really want to
7884 merge processor-specific flags and attributes. Exit early if
7885 an object is empty except for section names and the undefined symbol.
7886 (Target_arm::do_finalize_sections): Move check for ELF format to
7887 Arm_relobj::do_read_symbols. Merge processor specific flags and
7888 attributes from a regular object only when we have determined that
7889 it is aapropriate. Do not create an .ARM.attributes section in
7890 output if there is no regular input object.
7891 (Target_arm::merge_processor_specific_flags): Check
7892 --warn-mismatch before printing any error.
7893 (Target_arm::merge_object_attributes): Ditto.
7894 * gold.cc (queue_middle_tasks): Handle the case in which there is
7895 no regular object in input.
7896 * options.cc (General_options::parse_EB): New method.
7897 (General_options::parse_EL): Same.
7898 (General_options::General_options): Initialize endianness_.
7899 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
7900 New options.
7901 (General_options::Endianness): New enum.
7902 (General_options::endianness): New method.
7903 (General_options::endianness_): New data member.
7904 * parameters.cc (Parameters::set_options): Check target endianness.
7905 (Parameters::set_target_once): Ditto.
7906 (Parameters::check_target_endianness): New method.
7907 (parameters_force_valid_target): If either -EL or -EB is specified,
7908 use it to define endianness of default target.
7909 * parameters.h (Parameters::check_target_endianness): New method
7910 declaration.
7911 * target.h (class Target): Change "endianity" to "endianness"
7912 in comments.
7913
efc8d4f2
RW
79142010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7915
7916 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
7917 * configure: Regenerate.
7918 * Makefile.in: Regenerate.
7919 * testsuite/Makefile.in: Regenerate.
7920
be234d88
CC
79212010-04-06 Cary Coutant <ccoutant@google.com>
7922
7923 gcc PR lto/42757
7924 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
7925 prevailing definitions of common symbols.
7926 * testsuite/plugin_test_6.sh: New test case.
7927 * testsuite/plugin_common_test_1.c: New test case.
7928 * testsuite/plugin_common_test_2.c: New test case.
7929 * testsuite/Makefile.am (plugin_test_6): New test case.
7930 * testsuite/Makefile.in: Regenerate.
7931
bd32c6bd
NC
79322010-04-06 Nick Clifton <nickc@redhat.com>
7933
7934 * po/vi.po: New Vietnamese translation.
7935
323c532f
DK
79362010-03-30 Doug Kwan <dougkwan@google.com>
7937
7938 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
7939
4fcd97eb
DK
79402010-03-25 Doug Kwan <dougkwan@google.com>
7941
7942 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
7943 to avoid a conversion warning on a 32-bit host.
7944
4ebf39db
ILT
79452010-03-24 Ian Lance Taylor <iant@google.com>
7946
7947 * testsuite/script_test_3.t: Add a TLS segment.
7948 * testsuite/Makefile.am (check_PROGRAMS): Add
7949 tls_phdrs_script_test.
7950 (tls_phdrs_script_test_SOURCES): Define.
7951 (tls_phdrs_script_test_DEPENDENCIES): Define.
7952 (tls_phdrs_script_test_LDFLAGS): Define.
7953 (tls_phdrs_script_test_LDADD): Define.
7954 * testsuite/Makefile.in: Rebuild.
7955
4a599bdd
CC
79562010-03-23 Cary Coutant <ccoutant@google.com>
7957
7958 * fileread.cc (find_or_make_view): Fix comment.
7959
6c93b22c
ILT
79602010-03-23 Ian Lance Taylor <iant@google.com>
7961
7962 * script-sections.cc (class Orphan_section_placement): Define
7963 PLACE_TLS and PLACE_TLS_BSS.
7964 (Orphan_section_placement::Orphan_section_placement): Initialize
7965 new places.
7966 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
7967 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
7968 (tls_script_test_SOURCES): Define.
7969 (tls_script_test_DEPENDENCIES): Define.
7970 (tls_script_test_LDFLAGS): Define.
7971 (tls_script_test_LDADD): Define.
7972 * testsuite/Makefile.in: Rebuild.
7973
a2c7281b
DK
79742010-03-22 Doug Kwan <dougkwan@google.com>
7975
7976 * arm.cc (Arm_relocate_functions::abs8,
7977 Arm_relocate_functions::abs16): Use correct check for overflow
7978 specified in the ARM ELF specs.
7979 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
7980 target of a BLX instruction specially.
7981 (Reloc_stub::stub_type_for_reloc): Ditto.
7982 (Relocate::relocate): Use symbolic names instead of numeric relocation
7983 codes to report error.
7984 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
7985 workaround.
7986 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
7987 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
7988 thumb2_blx_out_of_range.stdout
7989 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
7990 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
7991 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
7992 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
7993 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
7994 thumb2_blx_in_range, thumb2_blx_in_range.o,
7995 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
7996 thumb2_blx_out_of_range.o): New rules.
2e702c99 7997 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
7998 thumb2_blx_in_range and thumb2_blx_out_of_range.
7999 * testsuite/Makefile.in: Regenerate.
8000 * arm_branch_in_range.sh: Add tests for THUMB BLX.
8001 * testsuite/thumb_blx_in_range.s: New file.
8002 * testsuite/thumb_blx_out_of_range.s: New file.
8003
b0193076
RÁE
80042010-03-22 Rafael Espindola <espindola@google.com>
8005
8006 * archive.cc (Should_include): Move to archive.h.
8007 (should_include_member): Make it a member of Archive.
8008 (Lib_group): New.
8009 (Add_lib_group_symbols): New.
8010 * archive.h: Include options.h.
8011 (Archive_member): Moved from Archive.
8012 (Should_include): Moved from archive.cc.
8013 (Lib_group): New.
8014 (Add_lib_group_symbols): New.
8015 * dynobj.cc (do_should_include_member): New.
8016 * dynobj.h (do_should_include_member): New.
8017 * gold.cc (queue_initial_tasks): Update call to queue.
8018 * main.cc (main): Print lib group stats.
8019 * object.cc (do_should_include_member): New.
8020 * object.h: Include archive.h.
8021 (Object::should_include_member): New.
8022 (Object::do_should_include_member): New.
8023 (Sized_relobj::do_should_include_member): New.
8024 * options.cc (General_options::parse_start_lib): New.
8025 (General_options::parse_end_lib): New.
8026 (Input_arguments::add_file): Handle lib groups.
8027 (Input_arguments::start_group): Check we are not in a lib.
8028 (Input_arguments::start_lib): New.
8029 (Input_arguments::end_lib): New.
8030 * options.h (General_options): Add start_lib and end_lib.
8031 (Input_argument::lib_): New.
8032 (Input_argument::lib): New.
8033 (Input_argument::is_lib): New.
8034 (Input_file_lib): New.
8035 (Input_arguments::in_lib_): New.
8036 (Input_arguments::in_lib): New.
8037 (Input_arguments::start_lib): New.
8038 (Input_arguments::end_lib_): New.
8039 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
8040 in unused members as preempted.
8041 (Sized_pluginobj::do_should_include_member): New.
8042 * plugin.h (Sized_pluginobj::do_should_include_member): New.
8043 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
8044 return the blocker.
8045 (Read_symbols::do_whole_lib_group): New.
8046 (Read_symbols::do_lib_group): New.
8047 (Read_symbols::do_read_symbols): Handle lib groups.
8048 (Read_symbols::get_name): Handle lib groups.
8049 * readsyms.h (Read_symbols): Add an archive member pointer.
8050 (Read_symbols::do_whole_lib_group): New.
8051 (Read_symbols::do_lib_group): New.
8052 (Read_symbols::member_): New.
8053 * script.cc (read_input_script): Update call to queue_soon.
8054
d099120c
DK
80552010-03-19 Doug Kwan <dougkwan@google.com>
8056
8057 * arm.cc (Stub_table::Stub_table): Initialize new data members
8058 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
8059 (Stub_table::add_reloc_stub): Assign stub offset and update
8060 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
8061 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
8062 New data members.
2e702c99 8063 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
8064 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
8065 instead of going over all reloc stubs.
2e702c99 8066 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
8067 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
8068 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 8069 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
8070 Stringpool_template::offset_.
8071 * stringpool.h (Stringpool_template::set_no_zero_null): Set
8072 Stringpool_template::offset_ to zero.
8073
1aa37384
DK
80742010-03-15 Doug Kwan <dougkwan@google.com>
8075
8076 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
8077 offset_.
8078 (Stringpool_template::new_key_offset): New method.
8079 (Stringpool_template::add_string): Assign offsets when adding new
8080 strings.
8081 (Stringpool_template::set_string_offsets): Do not set string offsets
8082 when not optimizing.
8083 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
8084 member size_.
2e702c99
RM
8085 (Chunked_vector::clear): Clear size_.
8086 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
8087 (Chunked_vector::size): Return size_.
8088 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 8089 (Chunked_vector::size_): New data member.
1aa37384
DK
8090 (Stringpool_template::set_no_zero_null): Assert string set is empty.
8091 (Stringpool_template::new_key_offset): New method declaration.
8092 (Stringpool_template::offset_): New data member.
8093
b672b057
RÁE
80942010-03-15 Rafael Espindola <espindola@google.com>
8095
8096 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
8097 Add_symbols' constructor.
8098 * readsyms.h (Add_symbols): Remove the input_group member.
8099
b6848d3c
ILT
81002010-03-10 Ian Lance Taylor <iant@google.com>
8101
8102 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
8103 target to ask whether a reference to a symbol requires a stack
8104 split.
8105 * target.h (Target::is_call_to_non_split): New function.
8106 (Target::do_is_call_to_non_split): Declare virtual function.
8107 * target.cc: Include "symtab.h".
8108 (Target::do_is_call_to_non_split): New function.
8109 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
8110
a2a5469e
CC
81112010-03-10 Cary Coutant <ccoutant@google.com>
8112
8113 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
8114 (File_read::open[1]): Remove initial mapping of whole_file_view_.
8115 (File_read::open[2]): Add whole_file_view_ to list of views.
8116 (File_read::make_view): Remove test of whole_file_view_.
8117 (File_read::find_or_make_view): Create whole_file_view_ if
8118 necessary.
8119 (File_read::clear_views): Replace bool parameter with enum;
8120 adjust all callers. Don't delete views with permanent data;
8121 do delete cached views and views from archives if
8122 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
8123 if clearing the corresponding view.
8124 * fileread.h (File_read::Clear_views_mode): New enum.
8125 (File_read::View::is_permanent_view): New method.
8126 (File_read::clear_views): Replace bool parameter
8127 with enum; adjust all callers.
8128 * options.h (General_options): Change keep_files_mapped option;
8129 add map_whole_files.
8130 * readsyms.cc (Add_symbols::run): Delete sd_ object before
8131 releasing the file.
8132 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
8133 the file.
8134
8861f32b
DM
81352010-03-10 David S. Miller <davem@davemloft.net>
8136
8137 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
8138
d62d0f5f
ST
81392010-03-09 Sriraman Tallam <tmsriram@google.com>
8140
8141 * icf.cc (get_section_contents): Add '@' marker after processing the
8142 merge reloc.
8143
9177756d
DK
81442010-03-08 Doug Kwan <dougkwan@google.com>
8145
8146 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
8147 due to a conversion warning.
8148 (Arm_relobj::update_output_local_symbol_count): Check for local
8149 symbol with unset output index.
8150
9e9e071b
ILT
81512010-03-05 Ian Lance Taylor <iant@google.com>
8152
8153 * options.h (class General_options): Add --spare-dynamic-tags.
8154 * output.cc (Output_data_dynamic::set_final_data_size): Implement
8155 --spare-dynamic-tags.
8156
a81ee015
ILT
81572010-03-05 Ian Lance Taylor <iant@google.com>
8158
8159 * incremental.cc: Include "libiberty.h".
8160
44ec90b9
RO
81612010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
8162
8163 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
8164 function, is_info_ member.
8165 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
8166 (Versions::Versions): Update caller.
8167 (Versions::define_base_version): Likewise.
8168 (Versions::add_def): Likewise.
8169
0897ed3b
ST
81702010-03-03 Sriraman Tallam <tmsriram@google.com>
8171
8172 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
8173 (Scan::possible_function_pointer_reloc): New function.
8174 (Scan::local_reloc_may_be_function_pointer): Change to call
8175 possible_function_pointer_reloc.
8176 (Scan::global_reloc_may_be_function_pointer): Ditto.
8177 * icf.h (Icf::check_section_for_function_pointers): Change to reject
8178 relocations in ".data.rel.ro._ZTV" section.
8179 * testsuite/icf_safe_so_test.sh: Change to pass i386.
8180 * testsuite/icf_safe_so_test.cc: Ditto.
8181 * testsuite/icf_safe_test.cc: Ditto.
8182 * testsuite/icf_safe_test.sh: Ditto.
8183
d3bbad62
ILT
81842010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8185 Ian Lance Taylor <iant@google.com>
8186
8187 * target-reloc.h (relocate_section): Check the symbol table index
8188 for -1U before setting the local symbol index.
8189 (scan_relocatable_relocs): If copying the relocation, record that
8190 the local symbol is required.
8191 * object.h (Symbol_value::is_output_symtab_index_set): New
8192 function.
8193 (Symbol_value::may_be_discarded_from_output_symtab): New
8194 function.
8195 (Symbol_value::has_output_symtab_entry): New function.
8196 (Symbol_value::needs_output_symtab_entry): Remove.
8197 (Symbol_value::output_symtab_index): Make sure the symbol index is
8198 set.
8199 (Symbol_value::set_output_symtab_index): Make sure the symbol
8200 index is not set. Make sure the new index is valid.
8201 (Symbol_value::set_must_have_output_symtab_entry): New function.
8202 (Symbol_value::has_output_dynsym_entry): New function.
8203 (Symbol_value::set_output_dynsym_index): Make sure the new index
8204 is valid.
8205 (Sized_relobj::set_must_have_output_symtab_entry): New function.
8206 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
8207 local symbol if permitted.
8208 (Sized_relobj::do_finalize_local_symbols): Call
8209 is_output_symtab_index_set rather than needs_output_symtab_entry.
8210 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
8211 rather than needs_output_symtab_entry. Call
8212 has_output_dynsym_entry rather than needs_output_dynsym_entry.
8213 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
8214 is_output_symtab_index_set rather than needs_output_symtab_entry.
8215 * testsuite/discard_locals_relocatable_test.c: New file.
8216 * testsuite/discard_locals_test.sh: Test -r.
8217 * testsuite/Makefile.am (check_DATA): Add
8218 discard_locals_relocatable_test1.syms,
8219 discard_local_relocatable_test2.syms.
8220 (MOSTLYCLEANFILES): Likewise. Also add
8221 discard_locals_relocatable_test1.lout and
8222 discard_locals_relocatable_test2.out.
8223 (discard_locals_relocatable_test1.syms): New target.
8224 (discard_locals_relocatable_test.o): New target.
8225 (discard_locals_relocatable_test1.out): New target.
8226 (discard_locals_relocatable_test2.syms): New target.
8227 (discard_locals_relocatable_test2.out): New target.
8228 (various): Add missing ../ld-new dependencies.
8229 * testsuite/Makefile.in: Rebuild.
8230
7e8ccf26
NC
82312010-03-03 Nick Clifton <nickc@redhat.com>
8232
8233 * po/fi.po: New Finnish translation.
8234
2a0ff005
DK
82352010-03-01 Doug Kwan <dougkwan@google.com>
8236
8237 * layout.cc (Layout::Layout): Force section types of .init_array*,
8238 .preinit_array* and .fini_array* sections.
8239 * output.cc (Output_section::Input_section_sort_entry::has_priority):
8240 Fix check of return value of std::string::find.().
8241 (Output_section::Input_section_sort_compare::operator()): Remove
8242 comment about .init_array.
8243 (Output_section::Input_section_sort_init_fini_compare::operator()):
8244 New method.
8245 (Output_section::sort_attached_input_sections): Handle .init_array
8246 and .fini_array specially.
8247 * output.h (Output_section::Inut_section_sort_compare): Update
8248 comment.
8249 (Output_section::Input_section_sort_init_fini_compare): New struct.
8250
c3e4ae29
DK
82512010-02-26 Doug Kwan <dougkwan@google.com>
8252
8253 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
8254 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
8255 * testsuite/debug_msg.sh: Avoid matching source line number for
8256 use of global variable undef_int.
8257
2fd9ae7a
DK
82582010-02-26 Doug Kwan <dougkwan@google.com>
8259
8260 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
8261 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
8262 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
8263 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
8264 * options.cc (General_options::General_options): Initialize member
8265 fix_v4bx_.
8266 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
8267 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
8268 and rm_no_fix_v4bx.stdout
8269 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
8270 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
8271 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
8272 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
8273 and arm_no_fix_v4bx.
8274 * Makefile.in: Regenerate.
8275 * testsuite/arm_fix_v4bx.s: New file.
8276 * testsuite/arm_fix_v4bx.sh: Ditto.
8277
67ec7d0b
DK
82782010-02-24 Doug Kwan <dougkwan@google.com>
8279
8280 * arm.cc (Target_arm::got_section): Make the .got section the first
8281 non RELRO section in the data segment.
8282 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
8283 suffixes of section names.
8284
10165461
DK
82852010-02-24 Doug Kwan <dougkwan@google.com>
8286
8287 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
8288 flags and attributes merging if an input file is a binary file.
8289 * fileread.cc (Input_file::open): Record format of original file.
8290 * fileread.h (Input_file::Format): New enum type.
2e702c99 8291 (Input_file::Input_file): Initialize data member format_.
10165461
DK
8292 (Input_file::format): New method definition.
8293 (Input_file::format_):: New data member.
8294
4a54abbb
DK
82952010-02-24 Doug Kwan <dougkwan@google.com>
8296
8297 * arm.cc (Arm_output_data_got): New class.
8298 (ARM_TCB_SIZE): New constant
8299 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
8300 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
8301 If user uses a script with a SECTIONS clause, issue only a warning
8302 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 8303 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
8304 garbage collection.
8305 (Target_arm::got_mode_index_entry): Handle static linking.
8306 (Target_arm::Scan::local): Ditto.
8307 (Target_arm::Scan::global): Ditto.
8308 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
8309 all incorrectly implemented relocations.
e1df38aa 8310 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
8311 Arm_output_section::fix_exidx_coverage.
8312 * layout.cc (Layout::section_name_mapping): Remove trailing dots
8313 from ".ARM.exidx." and ".ARM.extab.".
8314
ca419a6f
ILT
83152010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8316
8317 * arm.cc (Target_arm::do_finalize_sections): Create attribute
8318 section if it does not already exist.
8319 * attributes.cc (Attributes_section_data::Attributes_section_data):
8320 Don't crash if size is zero.
8321
135b9c78
ILT
83222010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8323 Ian Lance Taylor <iant@google.com>
8324
8325 * gold.cc (queue_middle_tasks): If no input files were opened,
8326 exit.
8327 * workqueue.h (Task_function::Task_function): Assert that there is
8328 a blocker.
8329
bb0bfe4f
DK
83302010-02-22 Doug Kwan <dougkwan@google.com>
8331
8332 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
8333 * icf.cc (get_section_contents): Cast snprintf arguments to long long
8334 types to avoid warnings due to different uint64_t implementations
8335 on different hosts.
8336
2a2b6d42
DK
83372010-02-21 Doug Kwan <dougkwan@google.com>
8338
8339 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
8340 handling of the maximum backward branch offset.
2e702c99 8341 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
8342 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
8343 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 8344 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
8345 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
8346 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
8347 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
8348 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
8349 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
8350 thumb_bl_out_of_range thumb_bl_out_of_range.o,
8351 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
8352 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
8353 thumb2_bl_out_of_range.o): New rules.
8354 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
8355 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
8356 thumb2_bl_out_of_range
8357 * testsuite/Makefile.in: Regenerate.
8358 * testsuite/arm_bl_in_range.s: New file.
8359 * testsuite/arm_bl_out_of_range.s: Ditto.
8360 * testsuite/arm_branch_in_range.sh: Ditto.
8361 * testsuite/arm_branch_range.t: Ditto.
8362 * testsuite/thumb2_branch_range.t: Ditto.
8363 * testsuite/thumb_bl_in_range.s: Ditto.
8364 * testsuite/thumb_bl_out_of_range.s: Ditto.
8365 * testsuite/thumb_branch_range.t: Ditto.
8366
b487ad64
ST
83672010-02-20 Sriraman Tallam <tmsriram@google.com>
8368
8369 * gc.h (gc_process_relocs): Change vectors to point to the new list.
8370 Add reloc offset information.
8371 * icf.cc (get_section_contents): Change iterators to point to the new
8372 vectors. Add reloc offset information to the contents.
8373 * icf.h (Icf::Sections_reachable_info): New typedef.
8374 (Icf::Sections_reachable_list): New typedef.
8375 (Icf::Offset_info): New typedef.
8376 (Icf::Reloc_info): New struct typedef.
8377 (Icf::Reloc_info_list): New typedef.
8378 (Icf::symbol_reloc_list): Delete method.
8379 (Icf::addend_reloc_list): Delete method.
8380 (Icf::section_reloc_list): Delete method.
8381 (Icf::reloc_info_list): New method.
8382 (Icf::reloc_info_list_): New member.
8383
f96accdf
DK
83842010-02-19 Doug Kwan <dougkwan@google.com>
8385
8386 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
8387 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
8388 * arm.cc (Arm_relocation_functions): New forward declaration.
8389 (Target_arm::Target_arm): Initialize new data members
8390 got_mod_index_offset_ and tls_base_symbol_defined_.
8391 (Target_arm::Relocate::relocate_tls): New method.
8392 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
8393 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
8394 New methods.
2e702c99 8395 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
8396 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
8397 (Target_arm::got_mod_index_offset_,
8398 Target_arm::tls_base_symbol_defined_): New data members.
8399 (Target_arm::Scan::local, Target::Scan::global,
8400 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
8401 relocations.
8402
c8761b9a
DK
84032010-02-18 Doug Kwan <dougkwan@google.com>
8404
8405 * arm.cc (Arm_relobj::find_linked_text_section): New method.
8406 (Arm_relobj::make_exidx_input_section): Pass section index of linked
8407 text section as a parameter becuase some broken tools may not set
8408 the link in section header.
8409 (Target_arm::has_got_section): New method.
8410 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
8411 without any mapping symbol as data only. Remove warning.
8412 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
8413 link in its section header, try to discover the link by inspecting the
8414 REL31 relocation at the beginning of the section.
8415 (Target_arm::Scan::check_non_pic): Report name of offending relocation
8416 in error message.
8417 (Target_arm::Scan::global): Treat any reference to the symbol
8418 _GLOBAL_OFFSET_TABLE_ as a GOT access.
8419
21bb3914
ST
84202010-02-12 Sriraman Tallam <tmsriram@google.com>
8421
8422 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
8423 (Scan::global_reloc_may_be_function_pointer): New function.
8424 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
8425 (Scan::global_reloc_may_be_function_pointer): New function.
8426 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
8427 (Scan::global_reloc_may_be_function_pointer): New function.
8428 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
8429 (Scan::global_reloc_may_be_function_pointer): New function.
8430 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
8431 (Scan::global_reloc_may_be_function_pointer): New function.
8432 (Scan::possible_function_pointer_reloc): New function.
8433 (Target_x86_64::can_check_for_function_pointers): New function.
8434 * gc.h (gc_process_relocs): Scan relocation types to determine if
8435 function pointers were taken for targets that support it.
8436 * icf.cc (Icf::find_identical_sections): Include functions for
8437 folding in safe ICF whose pointer is not taken.
8438 * icf.h (Secn_fptr_taken_set): New typedef.
8439 (fptr_section_id_): New member.
8440 (section_has_function_pointers): New function.
8441 (set_section_has_function_pointers): New function.
8442 (check_section_for_function_pointers): New function.
8443 * options.h: Fix comment for safe ICF option.
8444 * target.h (can_check_for_function_pointers): New function.
8445 * testsuite/Makefile.am: Add icf_safe_so_test test case.
8446 Modify icf_safe_test for X86-64.
8447 * testsuite/Makefile.in: Regenerate.
8448 * testsuite/icf_safe_so_test.cc: New file.
8449 * testsuite/icf_safe_so_test.sh: New file.
8450 * testsuite/icf_safe_test.cc (kept_func_3): New function.
8451 (main): Change to take pointer to function kept_func_3.
8452 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
8453 folding is done correctly for X86-64.
8454
0da6fa6c
DM
84552010-02-12 David S. Miller <davem@davemloft.net>
8456
8457 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
8458 is_symbolless parameter.
8459 (Output_reloc<SHT_REL>::is_symbolless): New.
8460 (Output_reloc<SHT_REL>::is_symbolless_): New.
8461 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
8462 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
8463 (Output_reloc<SHT_RELA>::is_symbolless): New.
8464 (Output_data_reloc::add_global): Handle is_symbolless.
8465 (Output_data_reloc::add_global_relative): Likewise.
8466 (Output_data_reloc::add_local): Likewise.
8467 (Output_data_reloc::add_local_relative): Likewise.
8468 (Output_data_reloc::add_symbolless_global_addend): New.
8469 (Output_data_reloc::add_symbolless_local_addend): New.
8470 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
8471 is_symbolless.
8472 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
8473 instead of ->is_relative_
8474 (Output_reloc::write): Likewise.
8475 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
8476 (Output_reloc::write_rel): Simplify.
8477
8478 * sparc.cc (Target_sparc::Scan::local): Use
8479 ->add_symbolless_local_addend as needed.
8480 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
8481 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
8482 based upon relocation offset.
8483
e4782e83
DK
84842010-02-11 Doug Kwan <dougkwan@google.com>
8485
8486 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
8487 (Target_arm::Scan::global): Ditto. Also remove a comment before the
8488 beginning of function.
8489 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
8490 and MOVT_ABS relocations. Those are non issued in scanning. Fix
8491 parameter is_32bit in calls to should_apply_static_reloc.
8492 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
8493 (check_DATA): Add arm_abs_global.stdout.
8494 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
8495 arm_abs_global.stdout): New rules.
8496 (MOSTLLYCLEANFILES): Add arm_abs_global
8497 * Makefile.in: Regenerate.
8498 * testsuite/arm_abs_global.s: New file.
8499 * testsuite/arm_abs_global.sh: Ditto.
8500 * testsuite/arm_abs_lib.s: Ditto.
8501
93ceb764
ILT
85022010-02-11 Ian Lance Taylor <iant@google.com>
8503
8504 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
8505 Read_relocs task.
8506 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
8507 Allocate_commons_task first.
8508 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
8509 task, rather than symtab_lock_.
8510 (Gc_process_relocs::~Gc_process_relocs): New function.
8511 (Gc_process_relocs::is_runnable): Check this_blocker_.
8512 (Gc_process_relocs::locks): Use next_blocker_ rather than
8513 blocker_.
8514 (Scan_relocs::~Scan_relocs): New function.
8515 (Scan_relocs::is_runnable): Check this_blocker_ rather than
8516 symtab_lock_.
8517 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
8518 next_blocker_.
8519 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
8520 fields. Add this_blocker_ and next_blocker_ fields. Adjust
8521 constructor accordingly.
8522 (class Gc_process_relocs): Likewise.
8523 (class Scan_relocs): Likewise.
8524 * common.h (class Allocate_commons_task): Remove symtab_lock_
8525 field, and corresponding constructor parameter.
8526 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
8527 symtab_lock_.
8528 (Allocate_commons_task::locks): Likewise.
8529
114dfbe1
ILT
85302010-02-11 Ian Lance Taylor <iant@google.com>
8531
8532 * gold-threads.h (class Once): Define.
8533 (class Initialize_lock): Rewrite as child of Once.
8534 * gold-threads.cc (class Once_initialize): Define.
8535 (once_pointer_control): New static variable.
8536 (once_pointer, once_arg): New static variables.
8537 (c_run_once): New static function.
8538 (Once::Once, Once::run_once, Once::internal_run): New functions.
8539 (class Initialize_lock_once): Remove.
8540 (initialize_lock_control): Remove.
8541 (initialize_lock_pointer): Remove.
8542 (initialize_lock_once): Remove.
8543 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
8544 (Initialize_lock::initialize): Rewrite.
8545 (Initialize_lock::do_run_once): New function.
8546 * archive.cc (Archive::interpret_header): Only clear name if it is
8547 not already empty.
8548 * fileread.cc: Include "gold-threads.h"
8549 (file_counts_lock): New static variable.
8550 (file_counts_initialize_lock): Likewise.
8551 (File_read::release): Only increment counts when using --stats.
8552 Use a lock around the increment.
8553 * parameters.cc (class Set_parameters_target_once): Define.
8554 (set_parameters_target_once): New static variable.
8555 (Parameters::Parameters): Move here from parameters.h.
8556 (Parameters::set_target): Rewrite.
8557 (Parameters::set_target_once): New function.
8558 (Parameters::clear_target): Move here and rewrite.
8559 * parameters.h (class Parameters): Update declarations. Add
8560 set_parameters_target_once_ field.
8561 (Parameters::Parameters): Move to parameters.cc.
8562 (Parameters::clear_target): Likewise.
8563 * readsyms.cc (Read_symbols::do_group): Create a Start_group
8564 task.
8565 (Start_group::~Start_group): New function.
8566 (Start_group::is_runnable): New function.
8567 (Start_group::locks, Start_group::run): New functions.
8568 (Finish_group::run): Change saw_undefined to size_t.
8569 * readsyms.h (class Start_group): Define.
8570 (class Finish_group): Change saw_undefined_ field to size_t.
8571 (Finish_group::Finish_group): Remove saw_undefined and
8572 this_blocker parameters. Change all callers.
8573 (Finish_group::set_saw_undefined): New function.
8574 (Finish_group::set_blocker): New function.
8575 * symtab.h (class Symbol_table): Change saw_undefined to return
8576 size_t. Change saw_undefined_ field to size_t.
8577 * target-select.cc (Set_target_once::do_run_once): New function.
8578 (Target_selector::Target_selector): Initialize set_target_once_
8579 field. Don't initialize lock_ and initialize_lock_ fields.
8580 (Target_selector::instantiate_target): Rewrite.
8581 (Target_selector::set_target): New function.
8582 * target-select.h (class Set_target_once): Define.
8583 (class Target_selector): Update declarations. Make
8584 Set_target_once a friend. Remove lock_ and initialize_lock_
8585 fields. Add set_target_once_ field.
8586
fa17a3f4
ILT
85872010-02-10 Ian Lance Taylor <iant@google.com>
8588
8589 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
8590 queueing any tasks.
8591 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
8592 (queue_middle_tasks): Add all blockers before queueing any tasks.
8593 (queue_final_tasks): Likewise.
8594 * token.h (Task_token::add_blockers): New function.
8595 * object.h (Input_objects::number_of_relobjs): New function.
8596
c7177d31
ILT
85972010-02-10 Ian Lance Taylor <iant@google.com>
8598
5de0e392
ILT
8599 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
8600 shared, not if not position independent.
8601 * x86_64.cc (Relocate::relocate_tls): Likewise.
8602 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
8603 (tls_pie_pic_test): New target.
8604 * testsuite/Makefile.in: Rebuild.
8605
c7177d31
ILT
8606 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
8607 (tls_test_main_pie.o, tls_test_pie.o): New targets.
8608 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
8609 * testsuite/Makefile.in: Rebuild.
8610
684b268a
DM
86112010-02-09 David S. Miller <davem@davemloft.net>
8612
8613 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
8614 R_SPARC_RELATIVE using ->add_local_relative().
8615 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
8616
612a8d3d
DM
8617 * output.h (Output_data_dynamic::add_section_size): New method
8618 that takes two Output_data objects.
8619 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
8620 entry param. Handle it in initializers.
8621 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
8622 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
8623 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
8624 arg.
8625 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
8626 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
8627 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
8628 for dynrel_includes_plt.
8629 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8630 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8631 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
8632 before .rela.plt
8633 (Target_sparc::do_finalize_sections): Update to pass true for
8634 dynrel_includes_plt.
8635 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
8636 output before .rela.plt
8637 (Target_powerpc::do_finalize_sections): Update to pass true for
8638 dynrel_includes_plt when 32-bit.
8639
cb1be87e
DK
86402010-02-08 Doug Kwan <dougkwan@google.com>
8641
8642 * arm.cc (Arm_relobj::simple_input_section_output_address): New
8643 method.
8644 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
8645 Arm_relobj::scan_section_for_cortex_a8_stubs,
8646 Arm_relobj::do_relocation_section): Instead of calling
8647 Output_section::output_address, use faster
8648 Arm_relobj::simple_input_section_output_address.
8649
705b5121
DM
86502010-02-08 David S. Miller <davem@davemloft.net>
8651
8652 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
8653 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
8654 relocation helper function.
8655
024c4466
DM
8656 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
8657 just like R_SPARC_GOT{10,13,22}.
8658 (Target_sparc::Scan::local): Likewise.
8659 (Target_sparc::Relocate:relocate): Likewise.
8660
9109c078
ILT
86612010-02-06 Ian Lance Taylor <iant@google.com>
8662
8663 * configure.ac: Rewrite targetobjs duplicate removal code to use
8664 only shell constructs.
8665 * configure: Rebuild.
8666
cf846138
DK
86672010-02-05 Doug Kwan <dougkwan@google.com>
8668
8669 PR 11247
8670 * arm.cc (Arm_relobj::section_is_scannable): New method.
8671 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
8672 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
8673
6cfaf60b
DK
86742010-02-04 Doug Kwan <dougkwan@google.com>
8675
8676 PR 11247
8677 * arm-reloc-property.cc (cstdio): Include.
8678 * configure.ac (targetobjs): Remove duplicates.
8679 * configure: Regenerate.
8680 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
8681 big and little endian version for a given address size.
8682
5c57f1be
DK
86832010-02-03 Doug Kwan <dougkwan@google.com>
8684
8685 * arm-reloc-property.cc
8686 (Arm_reloc_property_table::reloc_name_in_error_message): New method
8687 definition.
8688 * arm-reloc-property.h
8689 (Arm_reloc_property_table::get_implemented_static_reloc_property):
8690 New method definition.
8691 (Arm_reloc_property_table::reloc_name_in_error_message): New method
8692 declaration.
8693 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
8694 overflow to N.
8695 (GOT_PREL): Change implemented to Y.
8696 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
8697 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
8698 (Arm_relocate_functions::movw_abs_nc): Remove method.
8699 (Arm_relocate_functions::movt_abs): Ditto.
8700 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
8701 (Arm_relocate_functions::thm_movt_abs): Ditto.
8702 (Arm_relocate_functions::movw_rel_nc): Ditto.
8703 (Arm_relocate_functions::movw_rel): Ditto.
8704 (Arm_relocate_functions::movt_rel): Ditto.
8705 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
8706 (Arm_relocate_functions:thm_movw_rel): Ditto.
8707 (Arm_relocate_functions:thm_movt_rel): Ditto.
8708 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
8709 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
8710 New method definitions.
8711 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
8712 (Arm_relocation_functions::arm_grp_ldr): Ditto.
8713 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
8714 (Arm_relocation_functions::arm_grp_ldc): Ditto.
8715 (Target_arm::Relocate::relocate): Check for non-static or
8716 unimplemented relocation code and exit early. Change calls to
8717 Target_arm::reloc_uses_thumb_bit and
8718 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
8719 instead. Refactor code to handle similar relocations to increase
8720 code sharing. Remove check for unsupported relocation code in switch
8721 statement.
8722 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
8723 relocation property table to find out size. Change error message to
8724 print out the name of a relocation code instead of the numeric value.
8725 (Target_arm::scan_reloc_for_stub): Use relocation property table
8726 instead of calling Target_arm::reloc_uses_thumb_bit().
8727
218c5831
DK
87282010-02-02 Doug Kwan <dougkwan@google.com>
8729
8730 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
8731 types of relaxed input section.
8732
0d31c79d
DK
87332010-02-02 Doug Kwan <dougkwan@google.com>
8734
8735 * Makefile.am (HFILES): Add arm-reloc-property.h.
8736 (DEFFILES): New.
2e702c99
RM
8737 (TARGETSOURCES): Add arm-reloc-property.cc
8738 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
8739 (libgold_a_SOURCES): $(DEFFILES)
8740 * Makefile.in: Regenerate.
8741 * arm-reloc-property.cc: New file.
8742 * arm-reloc-property.h: New file.
8743 * arm-reloc.def: New file.
8744 * arm.cc: Update comments.
8745 (arm-reloc-property.h): New included header.
8746 (arm_reloc_property_table): New global variable.
8747 (Target_arm::do_select_as_default_target): New method definition.
8748 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
8749 arm-reloc-property to targ_extra_obj.
8750 * parameters.cc (set_parameters_target): Call
8751 Target::select_as_default_target().
8752 * target.h (Target::select_as_default_target): New method definition.
8753 (Target::do_select_as_default_target): Same.
8754
546c7457
DK
87552010-02-01 Doug Kwan <dougkwan@google.com>
8756
8757 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
8758 first_output_text_section_.
8759 (Arm_exidx_fixup::first_output_text_section): New method definition.
8760 (Arm_exidx_fixup::first_output_text_section_): New data member.
8761 (Arm_exidx_fixup::process_exidx_section): Record the first text
8762 output section seen.
8763 (Arm_output_section::fix_exidx_coverage): Set correct linked section
8764 and entsize in output section header.
8765
11b861d5
DK
87662010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8767
8768 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
8769 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
8770 (Arm_relocate_functions::thm_alu11): New Method.
8771 (Arm_relocate_functions::thm_pc8): New Method.
8772 (Arm_relocate_functions::thm_pc12): New Method.
8773 (Target_arm::Scan::local): Handle the relocations.
8774 (Target_arm::Scan::global): Likewise.
8775 (Target_arm::Relocate::relocate): Likewise.
8776 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8777
c9a2c125
DK
87782010-01-29 Doug Kwan <dougkwan@google.com>
8779
8780 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
8781 of relocation types as ld.
8782
1521477a
DK
87832010-01-29 Doug Kwan <dougkwan@google.com>
8784
8785 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
8786 to public.
8787 (Arm_relocate_functions::thumb_branch_common): Ditto.
8788 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
8789 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
8790 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
8791 Arm_relocate_functions::jump24): Remove.
8792 (Target_arm::Relocate::relocate): Adjust code to call
8793 Arm_relocation_functions::arm_branch_common and
8794 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 8795 wrappers. Merge switch-cases together to reduce source code size.
1521477a 8796
e7eca48c
DK
87972010-01-29 Doug Kwan <dougkwan@google.com>
8798
8799 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
8800 output_local_symbol_count_needs_update_.
8801 (Arm_relobj::output_local_symbol_count_needs_update,
8802 Arm_relobj::set_output_local_symbol_count_needs_update,
8803 Arm_relobj::update_output_local_symbol_count): New methods.
8804 (Arm_relobj::output_local_symbol_count_needs_update_): New data
8805 member.
8806 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
8807 of pointed function as in a R_ARM_PREL31 relocation.
8808 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
8809 for output local symbol count updating.
8810 (Target_arm::do_relax): Update output local symbol counts in objects
8811 if necessary.
8812 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
8813
02961d7e
ILT
88142010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8815
8816 * arm.cc: Added support for the ARM relocations:
8817 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
8818 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
8819 (Arm_relocate_functions::movw_rel_nc): Renamed (was
8820 movw_prel_nc).
8821 (Arm_relocate_functions::movw_rel): New method.
8822 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
8823 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
8824 thm_movw_prel_nc).
8825 (Arm_relocate_functions::thm_movw_rel): New method.
8826 (Arm_relocate_functions::thm_movt_rel): Renamed (was
8827 thm_movt_prel).
8828 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
8829 relocations.
8830 (Target_arm::Scan::global): Likewise.
8831 (Target_arm::Relocate::relocate): Likewise.
8832 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8833 Likewise.
8834
b10d2873
ILT
88352010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8836
8837 * arm.cc: Added support for ARM group relocations.
8838 (Target_arm::reloc_needs_sym_origin): New method.
8839 (Arm_relocate_functions::calc_grp_kn): New method.
8840 (Arm_relocate_functions::calc_grp_residual): New method.
8841 (Arm_relocate_functions::calc_grp_gn): New method.
8842 (Arm_relocate_functions::arm_grp_alu): New Method.
8843 (Arm_relocate_functions::arm_grp_ldr): New Method.
8844 (Arm_relocate_functions::arm_grp_ldrs): New Method.
8845 (Arm_relocate_functions::arm_grp_ldc): New Method.
8846 (Target_arm::Scan::local): Handle the ARM group relocations.
8847 (Target_arm::Scan::global): Likewise.
8848 (Target_arm::Relocate::relocate): Likewise.
8849 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8850 Likewise.
8851
2b328d4e
DK
88522010-01-26 Doug Kwan <dougkwan@google.com>
8853
8854 * arm.cc (set): Include.
8855 (class Arm_exidx_fixup): Change type of last_input_section_ to const
8856 pointer type.
2e702c99 8857 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
8858 (Arm_output_section::append_text_sections_to_list): New method.
8859 (Arm_output_section::fix_exidx_coverage): Ditto.
8860 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 8861 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
8862 Relobj::set_section_offset() instead of
8863 Sized_relobj::invalidate_section_offset().
2e702c99 8864 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
8865 parameter for section headers. Ignore relocation sections for
8866 unallocated sections and EXIDX sections.
8867 (Target_arm::fix_exidx_coverage): New method.
8868 (Target_arm::output_section_address_less_than): New type.
8869 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
8870 linked text section instead of the EXIDX section.
8871 (Arm_output_section::create_stub_group): Add an assertion to check
8872 that this is not an EXIDX output section.
8873 (Arm_output_section::append_text_sections_to_list): New method.
8874 (Arm_output_section::fix_exidx_coverage): Ditto.
8875 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 8876 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
8877 (Target_arm::do_relax): Fix EXIDX output section coverage in the
8878 first pass.
8879 (Target_arm::fix_exidx_coverage): New method.
8880 * object.h (Relobj::set_output_section): New method.
8881 (Sized_relobj::invalidate_section_offset): Remove method.
8882 (Sized_relobj::do_invalidate_section_offset): Remove method.
8883 (Sized_relobj::do_set_section_offset): Handle offset value -1.
8884
c7f3c371
DK
88852010-01-25 Doug Kwan <dougkwan@google.com>
8886
8887 * arm.cc (Arm_exidx_merged_section::do_output_offset):
8888 Fix warning due to signed and unsigned comparison on a 32-bit host.
8889
8923b24c
DK
88902010-01-22 Doug Kwan <dougkwan@google.com>
8891
8892 * arm.cc (Target_arm::do_relax): Record an output section for section
8893 offset adjustment it contains any stub table that has changed.
8894 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
8895 offsets in an output section if necessary.
8896 * output.cc (Output_section::Output_section): Initialize
8897 section_offsets_need_adjustments_.
8898 (Output_section::add_input_section_for_script): Renamed to
8899 Output_section::add_simple_input_section.
8900 (Output_section::save_states): Add a comment.
8901 (Output_section::discard_states): New method defintion.
8902 (Output_section::adjust_section_offsets): Same.
8903 * output.h (Output_section::add_input_section_for_script): Renamed to
8904 Output_section::add_simple_input_section.
8905 (Output_section::discard_states): New method declaration.
8906 (Output_section::adjust_section_offsets): Same.
8907 (Output_section::section_offsets_need_adjustment,
8908 Output_section::set_section_offsets_need_adjustment): New method
8909 definitions.
8910 (Output_section::section_offsets_need_adjustment_): New data member.
8911 * script-sections.cc
8912 (Output_section_element_input::set_section_address): Adjust code for
8913 renaming of Output_section::add_input_section_for_script.
8914 (Orphan_output_section::set_section_address): Same.
8915
9b2fd367
DK
89162010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8917
8918 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
8919 Fix_v4bx enum values .
8920 * gold/options.h (General_options): New option definitions.
8921 (General_options::fix_v4bx): New method.
8922 (General_options::Fix_v4bx): New enum.
8923 * gold/options.cc (General_options::parse_fix_v4bx): New method.
8924 (General_options::parse_fix_v4bx_interworking): New method.
8925
80d0d023
DK
89262010-01-22 Doug Kwan <dougkwan@google.com>
8927
8928 * arm.cc (Arm_exidx_fixup): New class.
8929
af2cdeae
DK
89302010-01-21 Doug Kwan <dougkwan@google.com>
8931
8932 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
8933 classes.
8934 (Arm_exidx_section_offset_map): New type.
8935
993d07c1
DK
89362010-01-21 Doug Kwan <dougkwan@google.com>
8937
8938 * arm.cc (Arm_exidx_input_section): New class.
8939 (Arm_relobj::exidx_input_section_by_link,
8940 Arm_relobj::exidx_input_section_by_shndx,
8941 Arm_relobj::make_exidx_input_section): New methods.
8942 (read_arm_attributes_section): Remove.
8943 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
8944 information about them.
8945 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
8946 to here.
8947
5ac169d4
DK
89482010-01-20 Doug Kwan <dougkwan@google.com>
8949
8950 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
8951 Input_section_specifier to Section_id.
8952 (Target_arm::new_arm_input_section: Adjust code for change of key
8953 type.
8954 (Target_arm::find_arm_input_section): Ditto.
8955 * gc.h (object.h): Include for Section_id nand Section_id_hash.
8956 (Section_id): Remove.
8957 (Garbage_collection::Section_id_hash): Remove.
8958 * icf.h (object.h): Include for Section_id nand Section_id_hash.
8959 (Section_id): Remove.
8960 (Icf::Section_id_hash): Remove.
8961 * object.h (Section_id, Const_section_id, Section_id_hash,
8962 Const_section_id_hash): New type definitions.
8963 * output.cc (Output_section::add_relaxed_input_section): Change to
8964 use Const_section_id instead of Input_section_specifier as key type.
8965 (Output_section::add_merge_input_section): Ditto.
8966 (Output_section::build_relaxation_map): Change to use Section_id
8967 instead of Input_section_specifier as key type.
2e702c99 8968 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
8969 Ditto.
8970 (Output_section::convert_input_sections_to_relaxed_sections): Change
8971 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 8972 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
8973 (Output_section::find_relaxed_input_section): Ditto.
8974 * output.h (Input_section_specifier): Remove class.
8975 (Output_section::Output_section_data_by_input_section_map): Change
8976 key type to Const_section_id.
8977 (Output_section::Output_relaxed_input_section_by_input_section_map):
8978 Ditto.
8979 (Output_section::Relaxation_map): Change key type to Section_id.
8980
a2162063
ILT
89812010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8982
8983 * gold/arm.cc: Added support for R_ARM_V4BX relocation
8984 (class Arm_v4bx_stub): New class.
8985 (DEF_STUBS): Updated definition to support v4_veneer_bx.
8986 (Stub_factory::make_arm_v4bx_stub): New method.
8987 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
8988 (Stub_table::empty): Handle v4bx stubs.
8989 (Stub_table::add_arm_v4bx_stub): New method.
8990 (Stub_table::find_arm_v4bx_stub): New method.
8991 (Arm_relocate_functions::v4bx): New method.
8992 (Target_arm::fix_v4bx): New method.
8993 (Target_arm::Target_arm): Handle R_ARM_V4BX.
8994 (Stub_table::relocate_stubs): Likewise.
8995 (Stub_table::do_write): Likewise.
8996 (Stub_table::update_data_size_and_addralign): Likewise.
8997 (Stub_table::finalize_stubs): Likewise.
8998 (Target_arm::Scan::local): Likewise.
8999 (Target_arm::Scan::global): Likewise.
9000 (Target_arm::do_finalize_sections): Likewise.
9001 (Target_arm::Relocate::relocate): Likewise.
9002 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9003 Likewise.
9004 (Target_arm::scan_reloc_for_stub): Likewise.
9005 (Target_arm::scan_reloc_section_for_stubs): Likewise.
9006
5696ab0b
ILT
90072010-01-19 Ian Lance Taylor <iant@google.com>
9008
9009 * output.cc (Output_section_headers::do_sized_write): Write large
9010 segment count to sh_info field.
9011 (Output_file_header::do_sized_write): For large segment count,
9012 write PN_XNUM to e_phnum field.
9013
800d0f56
ILT
90142010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9015
9016 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
9017 (Arm_relocate_functions::thm_jump8): New function.
9018 (Arm_relocate_functions::thm_jump11): New function.
9019 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
9020 R_ARM_THM_JUMP11.
9021 (Target_arm::Scan::global): Likewise.
9022 (Target_arm::Relocate::relocate): Likewise.
9023 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9024 Likewise.
9025
41263c05
DK
90262010-01-14 Doug Kwan <dougkwan@google.com>
9027
9028 * arm.cc (map, utility): Include headers.
9029 (Target_arm::apply_cortex_a8_workaround): New method.
9030 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
9031 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
9032 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
9033 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
9034 the --[no-]fix-cortex-a8 command line options.
9035 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
9036 (Target_arm::relocate_stub): Use addend in instruction template.
9037 * options.h (DEFINE_bool): Set the user-set flag.
9038 (General_options): Add --[no-]-fix-cortex options.
9039 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 9040 : Update fast look-up map after conversion.
41263c05 9041
459e9b03
ST
90422010-01-14 Sriraman Tallam <tmsriram@google.com>
9043
9044 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
9045 in the first pass of do_layout.
9046
b521dfe4
DK
90472010-01-13 Doug Kwan <dougkwan@google.com>
9048
9049 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
9050 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
9051 apparent compiler problem of not folding static constant integral
9052 data members of elfcpp::Elf_sizes<32>.
9053
44272192
DK
90542010-01-13 Doug Kwan <dougkwan@google.com>
9055
9056 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
9057 Arm_relobj::section_needs_cortex_a8_stub_scanning,
9058 Arm_relobj::scan_section_for_cortex_a8_erratum,
9059 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
9060 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
9061 sections to scan for relocation stubs into a new method
9062 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
9063 relocation and Cortex-A8 stub scanning.
9064 (Target_arm::do_relax): Force stubs to be after stubbed sections
9065 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 9066 the beginning of a new relaxation pass. Update a comment.
44272192
DK
9067 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
9068
44b71ece
ILT
90692010-01-12 Ian Lance Taylor <iant@google.com>
9070
9071 * target-reloc.h (visibility_error): New inline function.
9072 (relocate_section): Call visibility_error.
9073 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
9074 (MOSTLYCLEANFILES): Likewise.
9075 (protected_4_pic.o, protected_3.err): New targets.
9076 * testsuite/protected_4.cc: New file.
9077
a120bc7f
DK
90782010-01-12 Doug Kwan <dougkwan@google.com>
9079
9080 * arm.cc (Cortex_a8_reloc): New class.
9081 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
9082 and cortex_a8_relocs_info_.
9083 (Target_arm::fix_cortex_a8): New method definition.
9084 (Target_arm::Cortex_a8_relocs_info): New type.
9085 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
9086 New data member declarations.
9087 (Target_arm::scan_reloc_for_stub): Record information about
9088 relocations for THUMB branches that might be exempted from the
9089 Cortex-A8 workaround.
9090 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
9091 at the beginning of a relaxation pass.
9092
20138696
DK
90932010-01-12 Doug Kwan <dougkwan@google.com>
9094
9095 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
9096 (Arm_relobj::Mapping_symbol_position,
9097 Arm_reloj::Mapping_symbol_position_less,
9098 Arm_relobj::Mapping_symbols_info): New types.
9099 (Target_arm::is_mapping_symbol_name): New method definition.
9100 (Arm_relobj::do_count_local_symbols): Save information about mapping
9101 symbols.
9102
089d69dc
DK
91032010-01-11 Doug Kwan <dougkwan@google.com>
9104
9105 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
9106 Arm_relocate_functions::thumb32_branch_upper,
9107 Arm_relocate_functions::thumb32_branch_lower,
9108 Arm_relocate_functions::thumb32_cond_branch_offset,
9109 Arm_relocate_functions::thumb32_cond_branch_upper,
9110 Arm_relocate_functions::thumb32_cond_branch_lower,
9111 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
9112 branch offset encoding.
9113 (Arm_relocate_functions::thumb_branch_common): Use new branch
9114 offset encoding methods to avoid code duplication.
9115 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
9116 (Stub_addend_reader::operator()): Use new branch encoding method
9117 to avoid code duplication.
9118
99e5bff2
DK
91192010-01-11 Doug Kwan <dougkwan@google.com>
9120
9121 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
9122 (Target_arm::do_finalize_sections): Define special EXIDX section
9123 symbols only if referenced.
9124 * gc.h (Garbage_collection::add_reference): New method.
9125 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
9126 code duplication.
9127
98e090bd
ILT
91282010-01-11 Ian Lance Taylor <iant@google.com>
9129
d0a91bd8
ILT
9130 * script.cc (Version_script_info::build_expression_list_lookup):
9131 Change complaing about duplicate wildcard match from error to
9132 warning.
9133
98e090bd
ILT
9134 * script.cc (class Lazy_demangler): Recreate--revert part of patch
9135 of 2009-12-30.
9136 (Version_script_info::Version_script_info): Initialize globs_,
9137 default_version_, default_is_global_, and exact_. Don't
9138 initialize globals_ or locals_.
9139 (Version_script_info::build_lookup_tables): Build local symbols
9140 first.
9141 (Version_script_info::unquote): New function.
9142 (Version_script_info::add_exact_match): New function.
9143 (Version_script_info::build_expression_list_lookup): Remove lookup
9144 parameter. Add is_global parameter. Change all callers. Handle
9145 wildcard pattern specially. Unquote pattern. Call
9146 add_exact_match.
9147 (Version_script_info::get_name_to_match): New function.
9148 (Version_script_info::get_symbol_version): New function.
9149 (Version_script_info::get_symbol_version_helper): Remove.
9150 (Version_script_info::check_unmatched_names): Call unquote.
9151 * script.h (class Version_script_info): Change get_symbol_version
9152 to be non-inline and add is_global parameter; change all callers.
9153 Rewrite symbol_is_local. Update declarations. Define struct
9154 Version_tree_match, Exact, Globs. Don't define struct Lookup.
9155 Remove globals_ and locals_ members. Add exact_, globs_,
9156 default_version_, is_global_.
9157 (Version_script_info::Glob): Remove pattern, add expression and
9158 is_global. Update constructor. Change all callers.
9159 * dynobj.cc (Versions::finalize): Mark the version symbol as the
9160 default version.
9161 (Versions::symbol_section_contents): If a symbol is undefined, or
9162 defined in a dynamic object, set the version index to
9163 VER_NDX_LOCAL.
9164 * symtab.cc (Symbol_table::add_from_relobj): Don't call
9165 symbol_is_local.
9166 (Symbol_table::add_from_pluginobj): Likewise.
9167 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
9168
d56962d3
DK
91692010-01-11 Doug Kwan <dougkwan@google.com>
9170
9171 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
9172 (incremental_dump_LDADD): Add linking option for libintl.
9173 * Makefile.in: Regenerate.
9174
94e6ee91
L
91752010-01-11 H.J. Lu <hongjiu.lu@intel.com>
9176
9177 PR gold/11144
9178 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
9179 instead of -Ds.
9180 * testsuite/Makefile.in: Regenerated.
9181
e96c574b
DK
91822010-01-10 Doug Kwan <dougkwan@google.com>
9183
9184 * options.h (DEFINE_var): Use parentheses around argument varname__
9185 in macro body to avoid any unintended subsequent substitutions.
9186
7198066b
ILT
91872010-01-10 Ian Lance Taylor <iant@google.com>
9188
ba4d53bf
ILT
9189 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
9190 candidates before doing symbol resolution.
9191
7198066b
ILT
9192 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
9193 ODR candidates if only one is weak.
9194
a2beed37
ILT
91952010-01-08 Ian Lance Taylor <iant@google.com>
9196
9197 * script.cc (Version_script_info::build_expression_list_lookup):
9198 Don't warn about ambiguous version, just record the ambiguity.
9199 (Version_script_info::get_symbol_version_helper): Give error if
9200 version is ambiguous.
9201
2fb7225c
DK
92022010-01-08 Doug Kwan <dougkwan@google.com>
9203
9204 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
9205 prev_data_size_ and prev_addralign_. Remove initializer for
9206 deleted data member has_been_changed_.
9207 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
9208 to determine if the table is empty.
9209 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
9210 Remove.
9211 (Stub_table::add_reloc_stub): Define method in class definition
9212 instead of just declaring it there.
9213 (Stub_table::add_cortex_a8_stub): New method definition.
9214 (Stub_table::update_data_size_and_addralign): Ditto.
9215 (Stub_table::finalize_stubs): Ditto.
9216 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
9217 (Stub_table::do_addralign_): Return address alignment in the
9218 (Stub_table::do_reset_address_and_file_offset): Define method in
9219 class definition instead of declaring it there. Set current data
9220 size to be the data size of the previous pass.
9221 (Stub_table::set_final_data_size): Use current data size as the
9222 final data size.
9223 (Stub_table::relocate_stub): Change parameter type of stub from
9224 Reloc_stub pointer to Stub pointer.
9225 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
9226 (Stub_table::Cortex_a8_stub_list): New typedef.
9227 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
9228 Stub_table::prev_addralign_): New data member.
9229 (Arm_relobj::Arm_relobj): Initialize data member
9230 section_has_cortex_a8_workaround_.
9231 (Arm_relobj::section_has_cortex_a8_workaround,
9232 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
9233 definitions.
9234 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
9235 declarations.
9236 (Target_arm::relocate_stub): Change parameter type of stub from
9237 Reloc_stub pointer to Stub pointer.
9238 (Insn_template::size, Insn_template::alignment): Handle
9239 THUMB16_SPECIAL_TYPE.
9240 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
9241 Stub_table::update_data_size_and_addralign,
9242 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
9243 definitions.
9244 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
9245 (Stub_table::do_write): Ditto.
9246 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 9247
880cd20d
ILT
92482010-01-08 Ian Lance Taylor <iant@google.com>
9249
9250 PR 11108
9251 * symtab.h (class Symbol): Remove fields is_target_special_ and
9252 has_plt_offset_. Add field is_defined_in_discarded_section_.
9253 (Symbol::is_defined_in_discarded_section): New function.
9254 (Symbol::set_is_defined_in_discarded_section): New function.
9255 (Symbol::has_plt_offset): Rewrite.
9256 (Symbol::set_plt_offset): Verify that new offset is not -1U.
9257 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
9258 Don't initialize is_target_special_ or has_plt_offset_.
9259 Initialize is_defined_in_discarded_section_.
9260 (Symbol_table::add_from_relobj): If appropriate, set
9261 is_defined_in_discarded_section.
9262 * resolve.cc (Symbol::override_base_with_special): Don't test
9263 is_target_special_. Change has_plt_offset_ to has_plt_offset().
9264 * target-reloc.h (relocate_section): Do special handling for
9265 symbols defined in discarded sections for global symbols as well
9266 as local symbols.
9267
2703e3eb
ILT
92682010-01-08 Ian Lance Taylor <iant@google.com>
9269
9270 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
9271 the SHT_SYMTAB case.
9272
339d40a3
ILT
92732010-01-08 Ian Lance Taylor <iant@google.com>
9274
9275 * object.cc (Sized_relobj::do_layout): Don't get confused if
9276 layout_eh_frame returns NULL.
9277
abecea76
ILT
92782010-01-08 Ian Lance Taylor <iant@google.com>
9279
9280 PR 11084
9281 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
9282 dynamic symbol table, use the normal symbol table.
9283 (Sized_dynobj::do_read_symbols): Remove assertion about type of
9284 symbol table.
9285
6b7dd3f3
ILT
92862010-01-08 Ian Lance Taylor <iant@google.com>
9287
9288 PR 11072
9289 * layout.cc (Layout::include_section): Remove .gnu_debuglink
9290 sections.
9291
36c50e63
L
92922010-01-08 H.J. Lu <hongjiu.lu@intel.com>
9293
9294 * version.cc (print_version): Change to "Copyright 2010".
9295
e291e7b9
ILT
92962010-01-08 Ian Lance Taylor <iant@google.com>
9297
9298 PR 10287
9299 PR 11063
9300 * i386.cc (class Target_i386): Change return type of plt_section
9301 to be non-const.
9302 (class Output_data_plt_i386): Add tls_desc_rel_ field.
9303 (Output_data_plt_i386::Output_data_plt_i386): Initialize
9304 tls_desc_rel_ field.
9305 (Output_data_plt_i386::rel_tls_desc): New function.
9306 (Target_i386::rel_tls_desc_section): New function.
9307 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
9308 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
9309 R_386_TLS_DESC reloc in rel_tls_desc_section.
9310 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
9311 Define struct Tlsdesc_info.
9312 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
9313 (Target_x86_64::do_reloc_symbol_index): New function.
9314 (Target_x86_64::add_tlsdesc_info): New function.
9315 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
9316 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
9317 tlsdesc_rel_ field.
9318 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
9319 all callers.
9320 (Output_data_plt_x86_64::rela_tlsdesc): New function.
9321 (Target_x86_64::rela_tlsdesc_section): New function.
9322 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
9323 handling.
9324 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
9325 (Target_x86_64::do_reloc_addend): New function.
9326 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
9327 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
9328 declarations. Define TARGET_CODE. Add arg field to u1_ union.
9329 (Output_reloc::type): New function.
9330 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
9331 (Output_reloc::is_target_specific): New function.
9332 (Output_reloc::target_arg): New function.
9333 (class Output_reloc) [SHT_RELA]: Add four new constructors for
9334 absolute relocs and target specific relocs.
9335 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
9336 add_target_specific.
9337 (class Output_data_reloc) [SHT_RELA]: Likewise.
9338 * output.cc (Output_reloc::Output_reloc): Add four new versions
9339 for absolute relocs and target specific relocs.
9340 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
9341 (Output_reloc::get_symbol_index): Likewise.
9342 (Output_reloc::local_section_offset): Check that local_sym_index_
9343 is not TARGET_CODE or 0.
9344 (Output_reloc::symbol_value): Likewise.
9345 (Output_reloc::write) [SHT_RELA]: Call target for target specific
9346 reloc.
9347 * target.h (class Target): Add reloc_symbol_index and reloc_addend
9348 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
9349 functions.
9350 * layout.cc (add_target_dynamic_tags): Use output section for
9351 DT_PLTRELSZ and DT_JMPREL.
9352
3a44184e
ILT
93532010-01-07 Ian Lance Taylor <iant@google.com>
9354
9355 PR 11061
9356 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
9357 function.
9358 (class Output_data_reloc_generic): Define.
9359 (class Output_data_reloc_base): Change base class to
9360 Output_data_reloc_generic. Change add() method to call
9361 bump_relative_reloc_count for a relative reloc. Remove
9362 sort_relocs_ field.
9363 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
9364 to sort_relocs().
9365 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
9366 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
9367 appropriate.
9368 * layout.h (class Layout): Update declaration.
9369
ea715a34
ILT
93702010-01-07 Ian Lance Taylor <iant@google.com>
9371
9372 * output.h (class Output_data): Add const version of
9373 output_section and do_output_section.
9374 (class Output_section_data): Add const version of
9375 do_output_section.
9376 (class Output_section): Likewise.
9377 * layout.cc (Layout::add_target_dynamic_tags): New function.
9378 * layout.h (class Layout): Update declarations.
9379 * arm.cc (Target_arm::do_finalize_sections): Use
9380 add_target_dynamic_tags.
9381 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9382 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
9383 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
9384 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9385
659948a4
ILT
93862010-01-07 Ian Lance Taylor <iant@google.com>
9387
9388 PR 11042
9389 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
9390 object as needed.
9391
9d3b86f6
ILT
93922010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
9393 Ian Lance Taylor <iant@google.com>
9394
9395 PR 11019
9396 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
9397 Xindex::read_symtab_xindex.
9398
bb0d3eb0
DK
93992010-01-07 Doug Kwan <dougkwan@google.com>
9400
9401 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
9402 (Insn_template::thumb16_bcond_insn): New method declaration.
9403 (Insn_template): Fix spelling.
9404 (Stub::thumb16_special): New method declaration.
9405 (Stub::do_write): Define virtual method which was previously pure
9406 virtual.
9407 (Stub::do_thumb16_special): New method declaration.
9408 (Stub::do_fixed_endian_write): New template member.
9409 (Reloc_stub::do_write): Remove.
9410 (Reloc_stub::do_fixed_endian_write): Remove.
9411 (Cortex_a8_stub): New class definition.
9412 (Stub_factory::make_cortex_a8_stub): New method definition.
9413 (Stub_factory::Stub_factory): Add missing static storage class
9414 qualifier for elf32_arm_stub_a8_veneer_blx.
9415
ffeef7df
ILT
94162010-01-07 Ian Lance Taylor <iant@google.com>
9417
dc3f80fe
ILT
9418 PR 10980
9419 * options.h (class General_options): Add --warn-unresolved-symbols
9420 and --error-unresolved-symbols.
9421 * errors.cc (Errors::undefined_symbol): Implement
9422 --warn-unresolved-symbols.
9423
ffeef7df
ILT
9424 * options.h (class General_options): Add -z text and -z textoff.
9425 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
9426
f1ec9ded
ST
94272010-01-06 Sriraman Tallam <tmsriram@google.com>
9428
9429 * gc.h (Garbage_collection::Cident_section_map): New typedef.
9430 (Garbage_collection::cident_sections): New function.
9431 (Garbage_collection::add_cident_section): New function.
9432 (Garbage_collection::cident_sections_): New member.
9433 (gc_process_relocs): Add references to sections whose names are C
9434 identifiers.
9435 * gold.h (cident_section_start_prefix): New constant.
9436 (cident_section_stop_prefix): New constant.
9437 (is_cident): New function.
9438 * layout.cc (Layout::define_section_symbols): Replace string constants
9439 with the newly defined constants.
9440 * object.cc (Sized_relobj::do_layout): Track sections whose names are
9441 C identifiers.
9442 * testsuite/Makefile.am: Add gc_orphan_section_test.
9443 * testsuite/Makefile.in: Regenerate.
9444 * testsuite/gc_orphan_section_test.cc: New file.
9445 * testsuite/gc_orphan_section_test.sh: New file.
9446
6eda8c29
ILT
94472010-01-06 Ian Lance Taylor <iant@google.com>
9448
b9674e17
ILT
9449 PR 10980
9450 * options.h (class General_options): Add --warn-shared-textrel.
9451 * layout.cc (Layout::finish_dynamic_section): Implement
9452 --warn-shared-textrel.
9453
6eda8c29
ILT
9454 PR 10980
9455 * options.h (class General_options): Add --warn-multiple-gp.
9456
32dcd44e
ILT
94572010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9458
9459 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
9460 $(THREADSLIB) and $(LIBDL).
9461 * Makefile.in: Rebuild.
9462
a192ba05
ILT
94632010-01-06 Ian Lance Taylor <iant@google.com>
9464
9465 PR 10980
9466 * options.cc (General_options::parse_section_start): New function.
9467 (General_options::section_start): New function.
9468 (General_options::General_options): Initialize all members.
9469 * options.h: Include <map>
9470 (class General_options): Add --section-start. Add section_starts_
9471 member.
9472 * layout.cc (Layout::attach_allocated_section_to_segment): If
9473 --section-start was used, set the address of the segment. Remove
9474 local sort_sections.
9475 (Layout::relaxation_loop_body): If the address of the load segment
9476 has been set by --section-start, don't use it.
9477 * output.h (Output_segment::update_flags_for_output_section): New
9478 function.
9479 * output.cc (Output_segment::add_output_section): Call
9480 update_flags_for_output_section.
9481
dde3f402
ILT
94822010-01-05 Ian Lance Taylor <iant@google.com>
9483
62dfdd4d
ILT
9484 PR 10980
9485 * options.h (class General_options): Add --undefined-version.
9486 * script.cc (struct Version_expression): Add was_matched_by_symbol
9487 field.
9488 (Version_script_info::matched_symbol): New function.
9489 (Version_script_info::get_symbol_version_helper): Call
9490 matched_symbol.
9491 (Version_script_info::check_unmatched_names): New function.
9492 * script.h (class Version_script_info): Update declarations.
9493 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
9494
9c4ae156
ILT
9495 * options.h (class General_options): Use DEFINE_bool_alias for
9496 allow_multiple_definition.
9497 * resolve.cc (Symbol_table::should_override): Don't test
9498 allow_multiple_definition.
9499
dde3f402
ILT
9500 PR 10980
9501 * options.h (class General_options): Add --cref.
9502 * main.cc (main): Print cref table if --cref. Don't close mapfile
9503 until after printing cref table.
9504 * cref.cc: Include "symtab.h".
9505 (class Cref_inputs): Define Cref_table_compare and Cref_table.
9506 (Cref_table_compare::operator()): New function.
9507 (Cref_inputs::gather_cref): New function.
9508 (filecol): New static const.
9509 (Cref_inputs::print_cref): New function.
9510 (Cref::print_cref): New function.
9511 * cref.h: Include <cstdio>.
9512 (class Cref): Update declarations.
9513 * mapfile.h (Mapfile::file): New function.
9514 * object.h (class Object): Define Symbols. Declare virtual
9515 do_get_global_symbols.
9516 (Object::get_global_symbols): New function.
9517 * object.cc (Input_objects::add_object): Pass object to cref_ if
9518 --cref.
9519 (Input_objects::archive_start): Likewise.
9520 (Input_objects::archive_stop): Likewise.
9521 (Input_objects::print_cref): New function.
9522 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
9523 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
9524 --cref.
9525 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
9526 function.
9527 * plugin.h (class Sized_pluginobj): Update declarations.
9528
8781f709
ILT
95292010-01-05 Ian Lance Taylor <iant@google.com>
9530
9531 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
9532 to is_default_version. Rename insdef to insdefault.
9533 (Symbol_table::add_from_relobj): Rename def to is_default_version
9534 and local to is_forced_local.
9535 (Symbol_table::add_from_pluginobj): Likewise.
9536 (Symbol_table::add_from_dynobj): Likewise.
9537 (Symbol_table::define_special_symbol): Rename insdef to
9538 insdefault.
9539
fe35d28d
ILT
95402010-01-04 Ian Lance Taylor <iant@google.com>
9541
30bc8c46
ILT
9542 PR 10980
9543 * options.h (class General_options): Add
9544 --allow-multiple-definition and -z muldefs.
9545 * resolve.cc (Symbol_table::should_override): Don't warn about a
9546 multiple symbol definition if --allow-multiple-definition or -z
9547 muldefs.
9548
7eaea549
ILT
9549 PR 10980
9550 * options.h (class General_options): Add --add-needed and
9551 --copy-dt-needed-entries. Tweak --as-needed help entry.
9552 * object.cc (Input_objects::check_dynamic_dependencies): Give an
9553 error if --copy-dt-needed-entries aka --add-needed is used and
9554 would cause a change in behaviour.
9555
fe35d28d
ILT
9556 PR 10980
9557 * options.h (class General_options): Add -G as a short version of
9558 --shared. Add no-op options -assert, -g, and -i.
9559
55a2bb35
ST
95602010-01-04 Sriraman Tallam <tmsriram@google.com>
9561
9562 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
9563 check for .text or .gnu.linkonce.t sections.
9564 * icf.cc (Icf::find_identical_sections): Ditto.
9565 Change the detection for mangled function name within the section
9566 name.
9567 * icf.h (is_section_foldable_candidate): New function.
9568
719328e1
ILT
95692009-12-30 Ian Lance Taylor <iant@google.com>
9570
9571 PR 10980
9572 * options.h (class General_options): Permit two dashes with
9573 --retain-symbols-file.
9574
d7bb5745
ILT
95752009-12-30 Ian Lance Taylor <iant@google.com>
9576
403a15dd
ILT
9577 PR 10979
9578 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
9579 don't put the file header and segment headers in the text
9580 segment.
9581
eda294df
ILT
9582 PR 10979
9583 * common.cc (Sort_commons::operator()): Stabilize sort when both
9584 entries are NULL.
9585 (Symbol_table::do_allocate_commons_list): When allocating common
9586 symbols, skip a symbol which is no longer common.
9587 * symtab.h (Symbol::is_common): Test whether the symbol comes from
9588 an object before checking its type.
9589 * testsuite/common_test_2.c: New file.
9590 * testsuite/common_test_3.c: New file.
9591 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
9592 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
9593 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
9594 (common_test_2_pic.o, common_test_2.so): New targets.
9595 (common_test_3_pic.o, common_test_3.so): New targets.
9596 * testsuite/Makefile.in: Rebuild.
9597
d7bb5745
ILT
9598 PR 10979
9599 * script.cc (read_input_script): If we see a new SECTIONS clause,
9600 and we have added an input section, give an error.
9601 * layout.h (class Layout): Add have_added_input_section function.
9602 Add have_added_input_section_ field.
9603 * layout.cc (Layout::Layout): Initialize
9604 have_added_input_section_.
9605 (Layout::layout): Set have_added_input_section_.
9606 (Layout::layout_eh_frame): Likewise.
9607
fc59c572
ILT
96082009-12-30 Ian Lance Taylor <iant@google.com>
9609
9610 PR 10931
9611 * options.h (class General_options): Add --sort-common option.
9612 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
9613 * common.cc (Sort_common): Add sort_order parameter to
9614 constructor. Add sort_order_ field.
9615 (Sort_commons::operator): Check sort_order_.
9616 (Symbol_table::allocate_commons): Determine the sort order.
9617 (Symbol_table::do_allocate_commons): Add sort_order parameter.
9618 Change all callers.
9619 (Symbol_table::do_allocate_commons_list): Likewise.
9620
1c74fab0
ILT
96212009-12-30 Ian Lance Taylor <iant@google.com>
9622
9623 PR 10916
9624 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
9625 symbols from this object, don't change the visibility of an
9626 undefined symbol.
9627 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
9628
6affe781
ILT
96292009-12-30 Ian Lance Taylor <iant@google.com>
9630
9631 PR 10861
9632 * script.h (class Version_script_info): Define Language enum.
9633 Update declarations. Define Glob, Exact, and Lookup types. Add
9634 new fields globals_, locals_, and is_finalized_.
9635 * script.cc: Various formatting fixes.
9636 (class Parser_closure): Change language_stack_ from a vector of
9637 std::string to one of Version_script_info::Language. Adjust all
9638 uses accordingly.
9639 (class Lazy_demangler): Remove.
9640 (struct Version_expression): Change language from std::string to
9641 Version_script_info::Language.
9642 (Version_script_info::Version_script_info): New function.
9643 (Version_script_info::~Version_script_info): Don't call clear.
9644 (Version_script_info::finalize): New function.
9645 (Version_script_info::build_lookup_tables): New function.
9646 (Version_script_info::build_expression_list_lookup): New
9647 function.
9648 (Version_script_info::get_symbol_version_helper): Rewrite to use
9649 lookup tables.
9650 (Version_script_info::print_expression_list): Adjust to use
9651 Version_script_info::Language.
9652 (script_push_lex_into_version_mode): Check that the version script
9653 has not been finalized.
9654 (version_script_push_lang): Change language string to
9655 Version_script_info::Language.
9656 * options.cc (Command_line::version_script): New function.
9657 * options.h (class General_options): Add finalize_dynamic_list
9658 function. Change version_script from declaration to definition.
9659 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
9660 * testsuite/version_script.map: Remove duplicate def of foo.
9661 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
9662 version_script.map.
9663 * testsuite/Makefile.in: Rebuild.
9664
818bf354
ILT
96652009-12-30 Ian Lance Taylor <iant@google.com>
9666
9667 PR 10843
9668 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
9669 if the input symbol index is 0, make the output symbol index 0.
9670
ebcc8304
ILT
96712009-12-30 Ian Lance Taylor <iant@google.com>
9672
9673 PR 10670
9674 * options.h (class General_options): Add -x/--discard-all.
9675 * object.cc (Sized_relobj::do_count_local_symbols): Handle
9676 --discard-all. If the local symbol needs a dynamic entry, check
9677 that before handling --discard-locals.
9678
176fe33f
ILT
96792009-12-30 Ian Lance Taylor <iant@google.com>
9680
bb321bb1
ILT
9681 PR 10450
9682 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
9683 flags to PF_R.
9684 (Output_segment::add_output_section): Don't change the flags if
9685 the type is PT_TLS.
9686
176fe33f
ILT
9687 PR 10450
9688 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
9689 GNU hash table if they need a dynamic value. Otherwise, don't add
9690 them if they are defined in a dynamic object or are forced local.
9691
e8cd95c7
ILT
96922009-12-29 Ian Lance Taylor <iant@google.com>
9693
1b81fb71
ILT
9694 PR 10450
9695 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
9696 .gnu.hash table for a 32-bit target.
9697
8d6d383d
ILT
9698 PR 10450
9699 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
9700 regular and a dynamic object only needs a dynamic symbol table
9701 entry if it is externally visible.
9702
e785ec03
ILT
9703 PR 10450
9704 * i386.cc (class Target_i386): Initialize global_offset_table_ in
9705 constructor. Add global_offset_table_ field.
9706 (Target_i386::got_section): Set global_offset_table_.
9707 (Target_i386::do_finalize_sections): Set global_offset_table_
9708 size.
9709 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
9710 in constructor. Add global_offset_table_ field.
9711 (Target_x86_64::got_section): Set global_offset_table_.
9712 (Target_x86_64::do_finalize_sections): Set global_offset_table_
9713 size.
9714
1a2dff53
ILT
9715 * layout.cc (Layout::Layout): Initialize increase_relro_.
9716 (Layout::get_output_section): Add is_relro, is_last_relro, and
9717 is_first_non_relro parameters. Change all callers.
9718 (Layout::choose_output_section): Likewise.
9719 (Layout::add_output_section_data): Likewise.
9720 (Layout::make_output_section): Likewise.
9721 (Layout::set_segment_offsets): Clear increase_relro when using a
9722 linker script.
9723 * layout.h (class Layout): Add increase_relro method. Add
9724 increase_relro_ field. Update declarations.
9725 * output.cc (Output_section::Output_section): Initialize
9726 is_last_relro_ and is_first_non_relro_.
9727 (Output_segment::add_output_section): Group relro sections is
9728 do_sort is true. Handle is_last_relro and is_first_non_relro.
9729 (Output_segment::maximum_alignment): Remove relro handling.
9730 (Output_segment::set_section_addresses): Add increase_relro
9731 parameter. Change all callers. Add initial alignment to align
9732 relro sections on separate page. Remove old relro handling.
9733 (Output_segment::set_section_list_addresses): Remove in_relro
9734 parameter. Change all callers.
9735 (Output_segment::set_offset): Add increase parameter. Change all
9736 callers. Remove old relro handling.
9737 * output.h (class Output_section): Add new methods: is_last_relro,
9738 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
9739 Add is_last_relro_ and is_first_non_relro_ fields.
9740 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
9741 Create separate .got.plt section. Call increase_relro.
9742 * x86_64.cc (Target_x86_64::got_section): Likewise.
9743 * testsuite/relro_script_test.t: Add .got.plt.
9744
f0ba79e2
ILT
9745 PR 10450
9746 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
9747 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
9748 (Layout::finalize): Call set_dynamic_symbol_size.
9749 (Layout::set_dynamic_symbol_size): New function.
9750 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
9751 set_dynamic_symbol_size.
9752
e8cd95c7
ILT
9753 PR 10450
9754 * output.h (class Output_section): Add is_entsize_zero_ field.
9755 * output.cc (Output_section::Output_section): Initialize
9756 is_entsize_zero_.
9757 (Output_section::set_entsize): If two different entsizes are
9758 requested, force it to zero.
9759 (Output_section::add_input_section): Set flags for .debug_str
9760 before updating section flags. Set entsize.
9761 (Output_section::update_flags_for_input_section): Set SHF_MERGE
9762 and SHF_STRING if all input sections have those flags.
9763
3e1b9a8a
RÁE
97642009-12-29 Rafael Espindola <espindola@google.com>
9765
9766 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
9767 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
9768 reporting.
3e1b9a8a 9769
3dcad376
ST
97702009-12-29 Sriraman Tallam <tmsriram@google.com>
9771
9772 * options.cc (General_options::parse_version): Allow -v to exit
9773 without an error if there is nothing to link.
9774
084e2665
ILT
97752009-12-29 Ian Lance Taylor <iant@google.com>
9776
9777 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
9778 using a version of gcc before 4.1.
9779 * configure: Rebuild.
9780
250acde3
CD
97812009-12-28 Chris Demetriou <cgd@google.com>
9782
9783 * attributes.cc (Output_attributes_section_data::do_write): Use
9784 std::vector::front rather than std::vector::data.
9785
99fff23b
ILT
97862009-12-28 Ian Lance Taylor <iant@google.com>
9787
9788 * symtab.h (class Symbol_table): Add enum Defined.
9789 * resolve.cc (Symbol_table::should_override): Add defined
9790 parameter. Change all callers. Test whether object is NULL
9791 before calling a method on it.
9792 (Symbol_table::report_resolve_problem): Add defined parameter.
9793 Change all callers.
9794 (Symbol_table::should_override_with_special): Likewise.
9795 * symtab.cc (Symbol_table::define_in_output_data): Add defined
9796 parameter. Change all callers.
9797 (Symbol_table::do_define_in_output_data): Likewise.
9798 (Symbol_table::define_in_output_segment): Likewise.
9799 (Symbol_table::do_define_in_output_segment): Likewise.
9800 (Symbol_table::define_as_constant): Likewise.
9801 (Symbol_table::do_define_as_constant): Likewise.
9802 * script.h (class Symbol_assignment): Add is_defsym parameter to
9803 constructor; change all callers.
9804 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
9805 parameter. Change all callers. Add is_defsym_ field.
9806 (class Parser_closure): Add parsing_defsym parameter to
9807 constructor; change all callers. Add parsing_defsym accessor
9808 function. Add parsing_defsym_ field.
9809
556bd683
ILT
98102009-12-28 Ian Lance Taylor <iant@google.com>
9811
9812 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 9813 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 9814
1782c879
ILT
98152009-12-23 Ian Lance Taylor <iant@google.com>
9816
9817 * i386.cc (Target_i386::do_calls_non_split): Recognize
9818 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
9819 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
9820 -fsplit-stack prologue when using %r11.
1782c879 9821
329ca2b1
ST
98222009-12-21 Sriraman Tallam <tmsriram@google.com>
9823
9824 * options.cc (General_options::parse_version): Make -v continue and do
9825 the link like GNU ld does.
9826
d675ff46
RÁE
98272009-12-17 Rafael Avila de Espindola <espindola@google.com>
9828
9829 * Makefile.am (CCFILES): Add timer.cc.
9830 (HFILES): Add timer.h.
9831 * configure.ac: Check for sysconf and times.
9832 * main.cc: include timer.h.
9833 (main): Use Timer instead of get_run_time.
9834 * timer.cc: New.
9835 * timer.h: New.
9836 * workqueue.cc: include timer.h.
9837 (Workqueue::find_and_run_task):
9838 Report user, sys and wall time.
9839 * Makefile.in: Regenerate.
9840 * config.in: Regenerate.
9841 * configure: Regenerate.
9842
d6344fb5
DK
98432009-12-16 Doug Kwan <dougkwan@google.com>
9844
9845 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
9846 sections.
9847 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
9848 relaxed input sections.
9849 * output.cc (Output_section::find_relaxed_input_section): Change
9850 return type to Output_relaxed_input_section pointer. Adjust code
9851 for new type of relaxed_input_section_map_.
9852 * output.h (Output_section::find_relaxed_input_section): Change
9853 return type to Output_relaxed_input_section pointer.
9854 (Output_section::Output_relaxed_input_section_by_input_section_map):
9855 New type.
9856 (Output_section::relaxed_input_section_map_): Change type to
9857 Output_section::Output_relaxed_input_section_by_input_section_map.
9858 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
9859 input section.
9860
0e0d5469
ILT
98612009-12-15 Ian Lance Taylor <iant@google.com>
9862
9863 * layout.cc (Layout::create_shstrtab): Only write out after input
9864 sections if we are compressing debug sections.
9865
0649a889
ILT
98662009-12-15 Ian Lance Taylor <iant@google.com>
9867
9868 * archive.cc (Archive::add_symbols): Only look up a symbol without
9869 a version if there is, in fact, a version.
9870
2ea97941
ILT
98712009-12-14 Ian Lance Taylor <iant@google.com>
9872
9873 Revert -Wshadow changes, all changes from:
9874 2009-12-11 Doug Kwan <dougkwan@google.com>
9875 2009-12-11 Nick Clifton <nickc@redhat.com>
9876 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
9877
b0eec2cc
DK
98782009-12-11 Doug Kwan <dougkwan@google.com>
9879
9880 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
9881 due to -Wshadow.
9882 * attributes.cc (Object_attribute::size): Ditto.
9883 (Attributes_section_data::size): Ditto.
9884 (Attributes_section_data::Attributes_section_data): Ditto.
9885 (Output_attributes_section_data::do_write): Ditto.
9886 * attributes.h (Object_attribute::set_type): Ditto.
9887 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
9888
91d6fa6a
NC
98892009-12-11 Nick Clifton <nickc@redhat.com>
9890
9891 * archive.cc: Fix shadowed variable warnings.
9892 * arm.cc: Likewise.
9893 * compressed_output.cc: Likewise.
9894 * compressed_output.h: Likewise.
9895 * configure: Likewise.
9896 * dwarf_reader.cc: Likewise.
9897 * dynobj.cc: Likewise.
9898 * dynobj.h: Likewise.
9899 * ehframe.cc: Likewise.
9900 * ehframe.h: Likewise.
9901 * errors.cc: Likewise.
9902 * expression.cc: Likewise.
9903 * fileread.cc: Likewise.
9904 * fileread.h: Likewise.
9905 * freebsd.h: Likewise.
9906 * i386.cc: Likewise.
9907 * icf.cc: Likewise.
9908 * incremental.h: Likewise.
9909 * layout.cc: Likewise.
9910 * layout.h: Likewise.
9911 * mapfile.cc: Likewise.
9912 * merge.cc: Likewise.
9913 * merge.h: Likewise.
9914 * object.cc: Likewise.
9915 * object.h: Likewise.
9916 * options.h: Likewise.
9917 * output.cc: Likewise.
9918 * output.h: Likewise.
9919 * parameters.cc: Likewise.
9920 * plugin.cc: Likewise.
9921 * powerpc.cc: Likewise.
9922 * reduced_debug_output.cc: Likewise.
9923 * reduced_debug_output.h: Likewise.
9924 * reloc.cc: Likewise.
9925 * reloc.h: Likewise.
9926 * resolve.cc: Likewise.
9927 * script-sections.cc: Likewise.
9928 * script.cc: Likewise.
9929 * script.h: Likewise.
9930 * sparc.cc: Likewise.
9931 * symtab.cc: Likewise.
9932 * symtab.h: Likewise.
9933 * target-select.cc: Likewise.
9934 * target-select.h: Likewise.
9935 * token.h: Likewise.
9936 * workqueue.cc: Likewise.
9937 * workqueue.h: Likewise.
9938 * x86_64.cc: Likewise.
9939
a0351a69
DK
99402009-12-10 Doug Kwan <dougkwan@google.com>
9941
9942 * arm.cc (attributes.h): New include.
9943 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
9944 (Arm_relobj::~Arm_relobj): Delete object pointed by
9945 attributes_section_data_.
9946 (Arm_relobj::attributes_section_data): New method definition.
9947 (Arm_relobj::attributes_section_data_): New data member declaration.
9948 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
9949 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
9950 attributes_section_data_.
9951 (Arm_dynobj::attributes_section_data): New method definition.
9952 (Arm_dynobj::attributes_section_data_): New data member declaration.
9953 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
9954 initialization value of may_use_blx_ to false.
2e702c99 9955 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
9956 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
9957 object attributes to compute results instead of hard-coding.
9958 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
9959 Target_arm::get_secondary_compatible_arch,
9960 Target_arm::set_secondary_compatible_arch
9961 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
9962 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
9963 New method declarations.
9964 (Target_arm::get_aeabi_object_attribute): New method definition.
9965 (Target_arm::attributes_section_data_): New data member declaration.
9966 (read_arm_attributes_section): New template definition.
9967 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
9968 (Arm_dynobj::do_read_symbols): Ditto.
9969 (Target_arm::do_finalize_sections): Merge attributes sections from
9970 input. Check for BLX use after attributes section merging.
9971 Fix __exidx_start and __exidx_end visibility. Create an
9972 .ARM.attributes section if necessary.
9973 (Target_arm::get_secondary_compatible_arch,
9974 Target_arm::set_secondary_compatible_arch,
9975 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
9976 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 9977 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
9978 New method definitions.
9979
b59befec
ILT
99802009-12-09 Ian Lance Taylor <iant@google.com>
9981
9982 * plugin.cc (Plugin::load): Don't cast from void* to a function
9983 pointer.
9984
1276bc89
ILT
99852009-12-09 Ian Lance Taylor <iant@google.com>
9986
9987 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
9988 information fields.
9989
2f2de248
L
99902009-12-09 H.J. Lu <hongjiu.lu@intel.com>
9991
9992 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
9993 Replace two_file_shared_1.so with two_file_shared_2.so.
9994 * testsuite/Makefile.in: Regenerated.
9995
4f787271
DK
99962009-12-08 Doug Kwan <dougkwan@google.com>
9997
9998 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
9999 (HFILES): Add attributes.h and int_encoding.h.
10000 * Makefile.in: Regenerate.
10001 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
10002 function definitions to int_encoding.cc
10003 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
10004 prototypes to int_encoding.h
10005 * reduced_debug_output.cc (int_encoding.h): New include.
10006 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
10007 function definitions to int_encoding.cc
10008 (insert_into_vector, read_from_pointer): Move template definitions to
10009 int_encoding.h
10010 * attributes.cc: New file.
10011 * attributes.h: New file.
10012 * int_encoding.cc: New file.
10013 * int_encoding.h: New file.
10014
20b52f1a
RÁE
100152009-12-07 Rafael Avila de Espindola <espindola@google.com>
10016
10017 PR gold/11055
10018 * incremental-dump.cc (dump_incremental_inputs): New.
10019 (main): Use dump_incremental_inputs.
10020
53d7974c
L
100212009-12-07 H.J. Lu <hongjiu.lu@intel.com>
10022
10023 PR gold/10893
10024 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
10025 checking elfcpp::STT_FUNC.
10026 (Target_i386::Relocate::relocate): Likewise.
10027 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
10028
10029 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
10030 symbols from shared libraries into normal FUNC symbols.
10031
10032 * symtab.h (Symbol): Add is_func and use it.
10033
05a352e6
DK
100342009-12-05 Doug Kwan <dougkwan@google.com>
10035
10036 * arm.cc (Target_arm::arm_info): Initialize new fields
10037 attributes_section and attributes_vendor.
10038 * i386.cc (Target_i386::i386_info): Same.
10039 * object.cc (Sized_relobj::do_layout): Skip attribute section.
10040 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
10041 fields attributes_section and attributes_vendor.
53d7974c 10042 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
10043 * target.h (Target::attributes_section, Target::attributes_vendor,
10044 Target::is_attributes_section, Target::attribute_arg_type,
10045 Target::attributes_order): New method definitions.
10046 (Target::Target_info::attributes_section,
10047 Target::Target_info::attributes_vendor): New fields.
10048 (Target::do_attribute_arg_type, Target::do_attributes_order): New
10049 virtual method definitions.
10050 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
10051 attributes_section and attributes_vendor.
10052 * testsuite/testfile.cc (Target_test::test_target_info): Same.
10053
f4e5969c
DK
100542009-12-05 Doug Kwan <dougkwan@google.com>
10055
10056 * arm.cc: Update comments about interworking and stub generation.
10057 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
10058 considered as non-PIC.
10059 (Arm_relocate_functions::base_abs): Fix formatting.
10060 (Arm_relocate_functions::got_prel): Fix comment. Change interface
10061 of function to use GOT entry address instead of offset.
10062 (Target_arm::Scan::global): Issue an error if a symbol would need a
10063 PLT does not get one because it is untyped. Remove code to create
10064 dynamic symbols for relative branches.
10065 (Target_arm::Relocate::relocate: Use 0 instead of false since function
10066 takes unsigned integer instead of boolean.
10067
1abce4a6
L
100682009-12-05 H.J. Lu <hongjiu.lu@intel.com>
10069
10070 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
10071 (two_file_test_LDADD): Likewise.
10072 (common_test_1_LDADD): Likewise.
10073 (exception_test_LDADD) Likewise.
10074 (weak_test_LDADD): Likewise.
10075 (many_sections_test_LDADD): Likewise.
10076 (initpri1_LDADD): Likewise.
10077 (script_test_1_LDADD): Likewise.
10078 (script_test_2_LDADD): Likewise.
10079 (justsyms_LDADD): Likewise.
10080 (binary_test_LDADD): Likewise.
10081 (large_LDADD): Likewise.
10082 * testsuite/Makefile.in: Regenerated.
10083
adcf2816 100842009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 10085
adcf2816
L
10086 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
10087 (Symbol_table::override_with_special): Likewise.
10088 (Symbol_table::add_from_object): Likewise.
10089
28e67f5d
RÁE
100902009-12-04 Rafael Avila de Espindola <espindola@google.com>
10091
10092 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
10093 Don't set the data_offset twice.
10094
ae10a101
RÁE
100952009-12-04 Rafael Avila de Espindola <espindola@google.com>
10096
10097 * testsuite/Makefile.in: Regenerate.
10098
f59f41f3
DK
100992009-12-03 Doug Kwan <dougkwan@google.com>
10100
10101 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
10102 (Target_arm::do_finalize_sections): Add parameter for symbol table
10103 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
10104 * i386.cc (Target_i386::do_finalize_sections): Add an additional
10105 parameter for symbol table pointer.
10106 * layout.cc (Layout::finalize): Call Target::finalize_sections with
10107 an additional parameter for a pointer to symbol table.
10108 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
10109 parameter for a symbol table pointer.
10110 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
10111 * target.h (Target::finalize_sections, Target::do_finalize_sections):
10112 Ditto.
10113 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
10114 parameter for a symbol table pointer.
10115
ca55d848
RÁE
101162009-12-03 Rafael Avila de Espindola <espindola@google.com>
10117
10118 * incremental.cc (Incremental_inputs_header)
10119 (Incremental_inputs_header_write, Incremental_inputs_entry)
10120 (Incremental_inputs_entry_write): Move ...
10121 * incremental.h (Incremental_inputs_header)
10122 (Incremental_inputs_header_write, Incremental_inputs_entry)
10123 (Incremental_inputs_entry_write): here.
10124
3aec4f9c
RÁE
101252009-12-02 Rafael Avila de Espindola <espindola@google.com>
10126
10127 * incremental.cc (make_sized_incremental_binary): Set the target.
10128 Error if it is incompatible.
10129 * output.h (Output_file): Add filename method.
10130
9c0ae74d
RÁE
101312009-12-02 Rafael Avila de Espindola <espindola@google.com>
10132
10133 * incremental.cc (Incremental_inputs_entry): Remove unused argument
10134 from the get_* methods.
10135
a45500ae
RÁE
101362009-12-02 Rafael Avila de Espindola <espindola@google.com>
10137
10138 * incremental-dump.cc (main): Check that the offeset of a script is 0.
10139 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
10140 Write 0 for the data_offset of scripts.
10141
325e6408
RÁE
101422009-12-02 Rafael Avila de Espindola <espindola@google.com>
10143
10144 * testsuite/Makefile.am: Add the incremental_test.sh test.
10145 * testsuite/incremental_test.sh: New.
10146 * testsuite/incremental_test_1.c: New.
10147 * testsuite/incremental_test_2.c: New.
10148
954c3e2e
RÁE
101492009-12-01 Rafael Avila de Espindola <espindola@google.com>
10150
703d02da 10151 * incremental-dump.cc (main): Fix typos.
954c3e2e 10152
f8086623
RÁE
101532009-11-27 Rafael Avila de Espindola <espindola@google.com>
10154
10155 PR gold/11025
10156 * incremental-dump.cc (main): Use llu to print 64 bit values.
10157
3b0dd6ac
L
101582009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
10159 H.J. Lu <hongjiu.lu@intel.com>
10160
10161 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
10162 $(LIBDL).
10163 (incremental_dump_LDADD): Likewise.
10164 * Makefile.in: Regenerated.
10165
a6d1ef57 101662009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 10167
a6d1ef57
DK
10168 Revert:
10169
10170 2009-11-25 Doug Kwan <dougkwan@google.com>
10171
10172 * arm.cc (Target_arm::Target_arm): Move method definition
10173 outside of class definition. Add code to handle
10174 --target1-rel, --target1-abs and --target2= options.
10175 (Target_arm::get_reloc_reloc_type): Change method to be
10176 non-static and const.
10177 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
10178 New data member declaration.
10179 (Target_arm::Scan::local, Target_arm::Scan::global,
10180 Target_arm::Relocate::relocate,
10181 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10182 Adjust call to Target_arm::get_real_reloc_type.
10183 (Target_arm::get_real_reloc_type): Use command line options
10184 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
10185 * options.h (--target1-rel, --target1-abs, --target2): New
10186 ARM-only options.
10187
50aeb7d4
DK
101882009-11-25 Doug Kwan <dougkwan@google.com>
10189
10190 * arm.cc (Target_arm::Target_arm): Move method definition outside of
10191 class definition. Add code to handle --target1-rel, --target1-abs
10192 and --target2= options.
10193 (Target_arm::get_reloc_reloc_type): Change method to be non-static
10194 and const.
10195 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
10196 member declaration.
10197 (Target_arm::Scan::local, Target_arm::Scan::global,
10198 Target_arm::Relocate::relocate,
10199 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
10200 call to Target_arm::get_real_reloc_type.
10201 (Target_arm::get_real_reloc_type): Use command line options to
10202 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
10203 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
10204 options.
10205
51938283
DK
102062009-11-25 Doug Kwan <dougkwan@google.com>
10207
10208 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
10209 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
10210 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
10211 formatting.
10212 (Arm_relocate_functions::thm_call): Replace body with a call to
10213 Arm_relocate_functions::thumb_branch_common.
10214 (Arm_relocate_functions::thm_jump24,
10215 Arm_relocate_functions::thm_xpc22): New method definitions.
10216 (Arm_relocate_functions::thumb_branch_common): New method definition.
10217 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
10218 operator.
10219 (Target_arm::Relocate::relocate): Adjust call to thm_call.
10220 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
10221
e2b8f3c4
RÁE
102222009-11-24 Rafael Avila de Espindola <espindola@google.com>
10223
10224 * Makefile.am: Build incremental-dump
10225 * Makefile.in: Regenerate.
10226 * incremental-dump.cc: New.
10227 * incremental.cc (Incremental_inputs_header_data,
10228 Incremental_inputs_entry_data): Move to incremental.h
10229 * incremental.h: (Incremental_inputs_header_data,
10230 Incremental_inputs_entry_data): Move from incremental.cc
10231
bcba9aec
RÁE
102322009-11-24 Rafael Avila de Espindola <espindola@google.com>
10233
10234 * incremental.cc (Incremental_inputs_header,
10235 Incremental_inputs_header_write, Incremental_inputs_entry,
10236 Incremental_inputs_entry_write): Add a typedef with the data type.
10237
7c3afe08
RÁE
102382009-11-24 Rafael Avila de Espindola <espindola@google.com>
10239
10240 * incremental.cc (Incremental_inputs_header,
10241 Incremental_inputs_header_write, Incremental_inputs_entry,
10242 Incremental_inputs_entry_write): Update comment about which
10243 type has the filed descriptions.
10244
d204b6e9
DK
102452009-11-15 Doug Kwan <dougkwan@google.com>
10246
10247 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
10248 (Arm_relocate_functions::arm_branch_common): Change method defintion
10249 in class definition to a method declaration and update list of formal
10250 parameters.
10251 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
10252 Arm_relocation_functions::jump24): Adjust call to
10253 Arm_relocate_functions::arm_branch_common. Update list of formal
10254 parameters.
10255 (Arm_relocate_functions::xpc25): New method definition.
10256 (Arm_relocate_functions::arm_branch_common): Move method defintion
10257 out from class definition. Use stubs for mode-switching and extending
10258 branch ranges.
10259 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
10260 specially. Change code to enable use of stubs in ARM branches.
10261
43d12afe
DK
102622009-11-10 Doug Kwan <dougkwan@google.com>
10263
10264 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
10265 in method declaration.
10266 (Target_arm::relocate_stub): New method declaration.
10267 (Target_arm::default_target): Change to return a pointer instead of
10268 a const reference.
10269 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
10270 Target_arm::default_target.
10271 (Arm_Relobj::do_relocate_sections): Remove options paramater in
10272 method definition.
10273 (Target_arm::relocate_section): Adjust view.
10274 (Target_arm::relocate_stub): New method definition.
10275
ac33a407
DK
102762009-11-10 Doug Kwan <dougkwan@google.com>
10277
10278 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
10279 a format warning.
10280 * incremental.cc (open_incremental_binary): Initialized local
10281 variables to avoid warnings.
10282 * object.cc (make_elf_object): Ditto.
10283 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
10284 a format warning.
e1df38aa 10285
88ee28e9
L
10286009-11-09 H.J. Lu <hongjiu.lu@intel.com>
10287
10288 PR gold/10930
10289 * testsuite/plugin_test.c: Include "config.h".
10290
2daedcd6
DK
102912009-11-09 Doug Kwan <dougkwan@google.com>
10292
10293 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
10294 (arm_symbol_value): Remove.
10295 (Arm_relocate_functions::arm_branch_common,
10296 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
10297 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
10298 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
10299 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
10300 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
10301 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
10302 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
10303 Arm_relocate_functions::thm_mobw_abs_nc,
10304 Arm_relocate_functions::thm_mov_abs,
10305 Arm_relocate_functions::movw_prel_nc,
10306 Arm_relocate_functions::thm_movt_abs,
10307 Arm_relocate_functions::movt_prel,
10308 Arm_relocate_functions::thm_movw_prel_nc,
10309 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
10310 (Target_arm::Relocate::relocate): Only decompose address into two
10311 parts if relocation type uses the thumb-bit and pass the actual
10312 bit instead of a flag indicating that the thumb-bit is used. Adjust
10313 calls to methods in Arm_relocate_functions for this change.
10314
1276bc89 103152009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
10316
10317 PR 10925
10318 * reloc.cc: Instantiate
10319 Sized_relobj::initialize_input_to_output_maps and
10320 Sized_relobj:free_input_to_output_maps.
10321
e53ad1b5
ILT
103222009-11-06 Ian Lance Taylor <iant@google.com>
10323
10324 PR 10876
10325 * defstd.cc (in_segment): Set only_if_ref true for "end".
10326
eb44217c
DK
103272009-11-06 Doug Kwan <dougkwan@google.com>
10328
10329 * arm.cc (class Reloc_stub): Correct a comment.
10330 (Target_arm::Target_arm): Initialize arm_input_section_map_.
10331 (Target_arm::scan_section_for_stubs): New method declaration.
10332 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
10333 Change methods from private to protected.
10334 (Target_arm::do_may_relax): New method definition.
10335 (Target_arm::do_relax, Target_arm::group_sections,
10336 Target_arm::scan_reloc_for_stub,
10337 Target_arm::scan_reloc_section_for_stubs): New method declarations.
10338 (Target_arm::arm_input_section_map_): New data member declaration.
10339 (Target_arm::scan_reloc_for_stub,
10340 Target_arm::scan_reloc_section_for_stubs,
10341 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
10342 Target_arm::do_relax): New method definitions.
10343
5d329b7d
ILT
103442009-11-06 Mikolaj Zalewski <mikolaj@google.com>
10345
10346 * configure.ac: Check for (struct stat)::st_mtim
10347 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
10348 * config.in: Regenerate.
10349 * configure: Regenerate.
10350
96a0d71b
ILT
103512009-11-05 Ian Lance Taylor <iant@google.com>
10352
10353 PR 10910
10354 * output.cc (Output_segment::add_output_section): Add missing
10355 return statement.
10356
594c8e5e
ILT
103572009-11-04 Ian Lance Taylor <iant@google.com>
10358
10359 PR 10880
10360 * object.h (class Object): Add is_needed and set_is_needed
10361 methods. Add is_needed_ field. Make bool fields into bitfields.
10362 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
10363 defined in a dynamic object and referenced by a regular object,
10364 set is_needed for the dynamic object.
10365 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
10366 if the file is marked with as_needed and it is not needed.
10367
22b127cc
ILT
103682009-11-04 Ian Lance Taylor <iant@google.com>
10369
10370 PR 10887
10371 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
10372 tags if data is discarded by linker script.
10373 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10374 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10375 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10376 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10377
f5c870d2
ILT
103782009-11-04 Ian Lance Taylor <iant@google.com>
10379
10380 * layout.cc (Layout::get_output_section): Add is_interp and
10381 is_dynamic_linker_section parameters. Change all callers.
10382 (Layout::choose_output_section): Likewise.
10383 (Layout::make_output_section): Likewise.
10384 (Layout::add_output_section_data): Add is_dynamic_linker_section
10385 parameter. Change all callers.
10386 * layout.h (class Layout): Update declarations.
10387 * output.h (class Output_section): Add is_interp, set_is_interp,
10388 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
10389 Add is_interp_, is_dynamic_linker_section_ fields. Change
10390 generate_code_fills_at_write_ to a bitfield.
10391 * output.cc (Output_section::Output_sections): Initialize new
10392 fields.
10393 (Output_segment::add_output_section): Add do_sort parameter.
10394 Change all callers.
10395
1ae4d23b
ILT
103962009-11-03 Ian Lance Taylor <iant@google.com>
10397
10398 PR 10860
10399 * options.h (class General_options): Add --warn-common.
10400 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
10401 merging two common symbols.
10402 (Symbol_table::should_override): Handle --warn-common when merging
10403 a common symbol with a defined symbol. Use report_resolve_problem
10404 for multiple definitions.
10405 (Symbol_table::report_resolve_problem): New function.
10406 * symtab.h (class Symbol_table): Declare report_resolve_problem.
10407
55da9579
DK
104082009-11-03 Doug Kwan <dougkwan@google.com>
10409
10410 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
10411 stub_factory_.
10412 (Target_arm::stub_factory): New method definition.
10413 (Target_arm::new_arm_input_section,
10414 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
10415 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 10416 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
10417 New type definitions.
10418 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
10419 member declarations.
10420 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
10421 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
10422 New method definitions.
10423
37a9ac43
ILT
104242009-11-03 Ian Lance Taylor <iant@google.com>
10425
10426 * options.h (class General_options): Add --warn_constructors.
10427
b3d6a3d4
ILT
104282009-11-03 Ian Lance Taylor <iant@google.com>
10429
10430 PR 10893
10431 * defstd.cc (in_section): Add entries for __rel_iplt_start,
10432 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
10433
934b01dd
ILT
104342009-11-03 Ian Lance Taylor <iant@google.com>
10435
10436 PR 10895
10437 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
10438 --msgid-bugs-address.
10439 (install-pdf): New target.
10440 (install-data_yes): Look up one directory to find mkinstalldirs.
10441
03c1939b
L
104422009-11-03 H.J. Lu <hongjiu.lu@intel.com>
10443
10444 * po/Make-in (.po.gmo): Don't generate .gmo files in source
10445 tree.
10446
ebd95253
DK
104472009-10-30 Doug Kwan <dougkwan@google.com>
10448
10449 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
10450
e9bbb538
DK
104512009-10-30 Doug Kwan <dougkwan@google.com>
10452
10453 * arm.cc (Stub_addend_reader): New struct template definition
10454 and partial specializations.
10455 (Stub_addend_reader::operator()): New method definition for a
10456 partially specialized template.
10457
d5b40221
DK
104582009-10-30 Doug Kwan <dougkwan@google.com>
10459
10460 * arm.cc (Arm_relobj::processor_specific_flags): New method
10461 definition.
10462 (Arm_relobj::do_read_symbols): New method declaration.
10463 (Arm_relobj::processor_specific_flags_): New data member declaration.
10464 (Arm_dynobj): New class definition.
10465 (Target_arm::do_finalize_sections): Add input_objects parameter.
10466 (Target_arm::do_adjust_elf_header): New method declaration.
10467 (Target_arm::are_eabi_versions_compatible,
10468 (Target_arm::merge_processor_specific_flags): New method declaration.
10469 (Target_arm::do_make_elf_object): New overloaded method definitions
10470 and declaration.
10471 (Arm_relobj::do_read_symbols): New method definition.
10472 (Arm_dynobj::do_read_symbols): Ditto.
10473 (Target_arm::do_finalize_sections): Add input_objects parameters.
10474 Merge processor-specific flags from all input objects.
10475 (Target_arm::are_eabi_versions_compatible,
10476 Target_arm::merge_processor_specific_flags,
10477 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
10478 New method definitions.
10479 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
10480 Input_objects pointer type parameter.
10481 * layout.cc (Layout::finalize): Pass input objects to target's.
10482 finalize_sections function.
10483 * output.cc (Output_file_header::do_sized_write): Set ELF file
10484 header's processor-specific flags.
10485 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
10486 Input_objects pointer type parameter.
10487 * sparc.cc (Target_sparc::do_finalize_sections): Same.
10488 * target.h (Input_objects): New forward class declaration.
10489 (Target::processor_specific_flags,
10490 Target::are_processor_specific_flags_sect): New method definitions.
10491 (Target::finalize_sections): Add input_objects parameter.
10492 (Target::Target): Initialize processor_specific_flags_ and
10493 are_processor_specific_flags_set_.
10494 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
10495 parameter.
10496 (Target::set_processor_specific_flags): New method definition.
10497 (Target::processor_specific_flags_,
10498 Target::are_processor_specific_flags_set_): New data member
10499 declarations.
10500 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
10501 Input_objects pointer type parameter.
10502
ebabffbd
DK
105032009-10-30 Doug Kwan <dougkwan@google.com>
10504
10505 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
10506
ad0f2072
ILT
105072009-10-28 Ian Lance Taylor <iant@google.com>
10508
10509 * object.h (class Relobj): Drop options parameter from
10510 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
10511 do_scan_relocs, do_relocate. Change all callers.
10512 (class Sized_relobj): Drop options parameters from
10513 do_gc_process_relocs, do_scan_relocs, do_relocate,
10514 do_relocate_sections, relocate_sections, emit_relocs_scan,
10515 emit_relocs_scan_reltype. Change all callers.
10516 (struct Relocate_info): Remove options field and all references to
10517 it.
10518 * reloc.h (class Read_relocs): Remove options constructor
10519 parameter and options_ field. Change all callers.
10520 (class Gc_process_relocs, class Scan_relocs): Likewise.
10521 (class Relocate_task): Likewise.
10522 * target-reloc.h (scan_relocs): Remove options parameter. Change
10523 all callers.
10524 (scan_relocatable_relocs): Likewise.
10525 * target.h (class Sized_target): Remove options parameter from
10526 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
10527 all callers.
10528 * gc.h (gc_process_relocs): Remove options parameter. Change all
10529 callers.
10530 * arm.cc: Update functions to remove options parameters.
10531 * i386.cc: Likewise.
10532 * powerpc.cc: Likewise.
10533 * sparc.cc: Likewise.
10534 * x86_64.cc: Likewise.
10535 * testsuite/testfile.cc: Likewise.
10536
8ffa3667
DK
105372009-10-28 Doug Kwan <dougkwan@google.com>
10538
10539 * arm.cc (Arm_relobj): New class definition.
e1df38aa 10540 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
10541 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
10542 New method definitions.
10543
40f36857
CC
105442009-10-28 Cary Coutant <ccoutant@google.com>
10545
10546 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
10547 (Plugin::cleanup_done_): New member.
10548 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
10549 (Plugin_manager::cleanup_done_): Remove.
10550 (Plugin_manager::add_input_file): Edit error message.
10551 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
10552 (Plugin_manager::cleanup): Remove use of cleanup_done_.
10553
2c849493
ILT
105542009-10-27 Mikolaj Zalewski <mikolajz@google.com>
10555
10556 * fileread.cc: (File_read::View::~View): Use the new
10557 data_ownership_ filed.
10558 (File_read::~File_read): Dispose the new whole_file_view_.
10559 (File_read::open): Mmap the whole file if needed.
10560 (File_read::open): Use whole_file_view_ instead of contents_.
10561 (File_read::find_view): Use whole_file_view_ if applicable.
10562 (File_read::do_read): Use whole_file_view_ instead of contents_.
10563 (File_read::make_view): Use whole_file_view_ instead of contents_,
10564 update File_read::View::View call.
10565 (File_read::find_or_make_view): Update File_read::View::View
10566 call.
10567 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
10568 remove contents_
10569 (File_read::View::Data_ownership): New enum.
10570 (File_read::View::View): Replace bool mapped_ with Data_ownership
10571 argument.
10572 (File_read::View::mapped_): Remove (replaced by data_ownership_).
10573 (File_read::View::data_ownership_): New field.
10574 (File_read::contents_): Remove (replaced by whole_file_view_).
10575 (File_read::whole_file_view_): New field.
10576 * options.h (class General_options): Add --keep-files-mapped.
10577
24998053
CC
105782009-10-27 Cary Coutant <ccoutant@google.com>
10579
10580 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
10581 * testsuite/Makefile.am (plugin_test_5): New test case.
10582 * testsuite/Makefile.in: Regenerate.
10583
72adc4fa
DK
105842009-10-25 Doug Kwan <dougkwan@google.com>
10585
10586 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
10587 from private to protected to allow access by child class.
10588 (Sized_relobj::do_relocate_sections): New method declaration.
10589 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 10590 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
10591 Sized_relobj::relocate_sections. Instantiate template explicitly
10592 for different target sizes and endianity.
10593
07f508a2
DK
105942009-10-24 Doug Kwan <dougkwan@google.com>
10595
10596 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
10597 (Arm_input_section::as_arm_input_section): New method.
10598 (Arm_output_section): New class definition.
10599 (Arm_output_section::create_stub_group,
10600 Arm_output_section::group_sections): New method definitions.
10601
10ad9fe5
DK
106022009-10-22 Doug Kwan <dougkwan@google.com>
10603
10604 * arm.cc (Arm_input_section): New class definition.
10605 (Arm_input_section::init, Arm_input_section:do_write,
10606 Arm_input_section::set_final_data_size,
10607 Arm_input_section::do_reset_address_and_file_offset): New method
10608 definitions.
10609
56ee5e00
DK
106102009-10-21 Doug Kwan <dougkwan@google.com>
10611
10612 * arm.cc (Stub_table, Arm_input_section): New forward class
10613 declarations.
10614 (Stub_table): New class defintion.
10615 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
10616 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
10617 New method definition.
10618
b569affa
DK
106192009-10-21 Doug Kwan <dougkwan@google.com>
10620
10621 * arm.cc: Update copyright comments.
10622 (Target_arm): New forward class template declaration.
10623 (Arm_address): New type.
10624 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
10625 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
10626 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
10627 constants.
10628 (Insn_template): Same.
10629 (DEF_STUBS): New macro.
10630 (Stub_type): New enum type.
10631 (Stub_template): New class definition.
10632 (Stub): Same.
10633 (Reloc_stub): Same.
10634 (Stub_factory): Same.
10635 (Target_arm::Target_arm): Initialize may_use_blx_ and
10636 should_force_pic_veneer_.
10637 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
10638 Target_arm::should_force_pic_veneer,
10639 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
10640 Target_arm::using_thumb_only, Target_arm:;default_target): New
10641 method defintions.
10642 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
10643 New data member declarations.
10644 (Insn_template::size, Insn_template::alignment): New method defintions.
10645 (Stub_template::Stub_template): New method definition.
10646 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
10647 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
10648 (Stub_factory::Stub_factory): New method definition.
10649 * gold.h (string_hash): New template.
10650 * output.h (Input_section_specifier::hash_value): Use
10651 gold::string_hash.
10652 (Input_section_specifier::string_hash): Remove.
10653 * stringpool.cc (Stringpool_template::string_hash): Use
10654 gold::string_hash.
10655
6c172549
DK
106562009-10-20 Doug Kwan <dougkwan@google.com>
10657
10658 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
10659 symbols of relaxed input sections.
10660 * output.h (Output_section::find_relaxed_input_section): Make
10661 method public.
10662
c5617f2f
DK
106632009-10-16 Doug Kwan <dougkwan@google.com>
10664
10665 * dynobj.cc (Versions::Versions): Initialize version_script_.
10666 Only insert base version symbol definition for a shared object
10667 if version script defines any version versions.
10668 (Versions::define_base_version): New method definition.
10669 (Versions::add_def): Check that base version is not needed.
10670 (Versions::add_need): Define base version lazily.
10671 * dynobj.h (Versions::define_base_version): New method declaration.
10672 (Versions::needs_base_version_): New data member declaration.
10673 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
10674 (check_DATA): Add no_version_test.stdout.
10675 (libno_version_test.so, no_version_test.o no_version_test.stdout):
10676 New make rules.
10677 * testsuite/Makefile.in: Regenerate.
10678 * testsuite/no_version_test.c: New file.
10679 * testsuite/no_version_test.sh: Ditto.
10680
3c12dcdb
DK
106812009-10-16 Doug Kwan <dougkwan@google.com>
10682
10683 * expression.cc (class Segment_start_expression): New class definition.
10684 (Segment_start_expression::value): New method definition.
10685 (script_exp_function_segment_start): Return a new
10686 Segment_start_expression.
10687 * gold/script-c.h (script_saw_segment_start_expression): New function
10688 prototype.
10689 * script-sections.cc (Script_sections::Script_sections): Initialize
10690 SAW_SEGMENT_START_EXPRESSION_ to false.
10691 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
10692 and -Tbbs options to specify section addresses if given in
10693 command line and no SEGMENT_START expression is seen in a script.
10694 * script-sections.h (Script_sections::saw_segment_start_expression,
10695 Script_sections::set_saw_segment_start_expression): New method
10696 definition.
10697 (Script_sections::saw_segment_start_expression_): New data member
10698 declaration.
10699 * script.cc (script_saw_segment_start_expression): New function.
10700 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
10701 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
10702 script_test_7.sh and script_test_8.sh.
10703 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
10704 script_test_8.stdout.
10705 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
10706 (script_test_6, script_test_6.stdout, script_test_7,
10707 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
10708 * Makefile.in: Regenerate.
10709 * testsuite/script_test_6.sh: New file.
10710 * testsuite/script_test_6.t: Same.
10711 * testsuite/script_test_7.sh: Same.
10712 * testsuite/script_test_7.t: Same.
10713 * testsuite/script_test_8.sh: Same.
10714
64b1ae37
DK
107152009-10-16 Doug Kwan <dougkwan@google.com>
10716
10717 * output.cc (Output_segment::set_section_list_address): Cast
10718 expressions to unsigned long long type to avoid format warnings.
10719
661be1e2
ILT
107202009-10-15 Ian Lance Taylor <iant@google.com>
10721
12edd763 10722 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 10723 dot assignment to script_sections_.
12edd763
ILT
10724 * script-sections.cc (Script_sections::add_dot_assignment):
10725 Initialize if necessary.
10726
68b6574b
ILT
10727 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
10728 program headers with no load segment if there is a linker script.
10729
661be1e2
ILT
10730 * layout.cc (Layout::set_segment_offsets): Align the file offset
10731 to the segment aligment for -N or -n with no load segment.
10732 * output.cc (Output_segment::add_output_section): Don't crash if
10733 the first section is a TLS section.
10734 (Output_segment::set_section_list_addresses): Print an error
10735 message if the address moves backward in a linker script.
10736 * script-sections.cc
10737 (Output_section_element_input::set_section_addresses): Don't
10738 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
10739 (Orphan_output_section::set_section_addresses): Likewise.
10740
f15f61a7
DK
107412009-10-15 Doug Kwan <dougkwan@google.com>
10742
10743 * layout.cc (Layout::finish_dynamic_section): Generate tags
10744 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
10745 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
10746 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
10747
82bb573a
ILT
107482009-10-14 Ian Lance Taylor <iant@google.com>
10749
10750 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
10751 fields.
10752 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
10753 data_shdr fields of relinfo.
10754 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
10755 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
10756 R_386_TLS_LDO_32, adjust based on section flags.
10757 (Target_i386::Relocate::fix_up_ldo): Remove.
10758
374ad285
ILT
107592009-10-13 Ian Lance Taylor <iant@google.com>
10760
10761 Add support for -pie.
10762 * options.h (class General_options): Add -pie and
10763 --pic-executable.
10764 (General_options::output_is_position_independent): Test -pie.
10765 (General_options::output_is_executable): Return true if not shared
10766 and not relocatable.
10767 (General_options::output_is_pie): Remove.
10768 * options.cc (General_options::finalize): Reject incompatible uses
10769 of -pie.
10770 * gold.cc (queue_middle_tasks): A -pie link is not static.
10771 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
10772 * symtab.cc (Symbol::final_value_is_known): Return false if
10773 output_is_position_independent.
10774 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
10775 output_is_position_independent.
10776 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
10777 output_is_position_independent.
10778 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
10779 output_is_position_independent.
10780 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
10781 two_file_pie_test.
10782 (basic_pie_test.o, basic_pie_test): New targets.
10783 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
10784 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
10785 (two_file_pie_test): New target.
10786 * testsuite/Makefile.in: Rebuild.
10787 * README: Remove note saying that -pie is not supported.
10788
c6585162
ILT
107892009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
10790
10791 * options.h (class General_options): Add -init and -fini.
10792 * layout.cc (Layout::finish_dynamic_section): Emit
10793 given init and fini functions.
10794
032ce4e9
ST
107952009-10-13 Sriraman Tallam <tmsriram@google.com>
10796
10797 * gc.h (gc_process_relocs): Check if icf is enabled using new
10798 function.
10799 * gold.cc (queue_initial_tasks): Likewise.
10800 (queue_middle_tasks): Likewise.
10801 * object.cc (do_layout): Likewise.
10802 * symtab.cc (is_section_folded): Likewise.
10803 * main.cc (main): Likewise.
10804 * reloc.cc (Read_relocs::run): Likewise.
10805 (Sized_relobj::do_scan_relocs): Likewise.
10806 * icf.cc (is_function_ctor_or_dtor): New function.
10807 (Icf::find_identical_sections): Check if function is ctor or dtor when
10808 safe icf is chosen.
10809 * options.h (General_options::icf): Change option to be an enum.
10810 (Icf_status): New enum.
10811 (icf_enabled): New method.
10812 (icf_safe_folding): New method.
10813 (set_icf_status): New method.
10814 (icf_status_): New variable.
10815 * (options.cc) (General_options::finalize): Set icf_status_.
10816 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
10817 icf_test and icf_keep_unique_test to use the --icf enum flag.
10818 * testsuite/icf_safe_test.sh: New file.
e1df38aa 10819 * testsuite/icf_safe_test.cc: New file.
032ce4e9 10820
f345227a
ST
108212009-10-12 Sriraman Tallam <tmsriram@google.com>
10822
10823 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
10824 includes to gc.h and icf.h.
10825 * arm.cc: Include gc.h.
10826 * gold.cc: Likewise.
10827 * i386.cc: Likewise.
10828 * powerpc.cc: Likewise.
10829 * sparc.cc: Likewise.
10830 * x86_64.cc: Likewise.
10831 * gc.h: Include icf.h.
10832
1c7814ed
ILT
108332009-10-11 Ian Lance Taylor <iant@google.com>
10834
10835 * plugin.cc: Include "gold.h" before other header files.
10836
ae3b5189
CD
108372009-10-10 Chris Demetriou <cgd@google.com>
10838
10839 * options.h (Input_file_argument::Input_file_type): New enum.
10840 (Input_file_argument::is_lib_): Replace with...
10841 (Input_file_argument::type_): New member.
10842 (Input_file_argument::Input_file_argument): Take Input_file_type
10843 'type' rather than boolean 'is_lib' as second argument.
10844 (Input_file_argument::is_lib): Use type_.
10845 (Input_file_argument::is_searched_file): New function.
10846 (Input_file_argument::may_need_search): Handle is_searched_file.
10847 * options.cc (General_options::parse_library): Support -l:filename.
10848 (General_options::parse_just_symbols): Update for Input_file_argument
10849 changes.
10850 (Command_line::process): Likewise.
10851 * archive.cc (Archive::get_file_and_offset): Likewise.
10852 * plugin.cc (Plugin_manager::release_input_file): Likewise.
10853 * script.cc (read_script_file, script_add_file): Likewise.
10854 * fileread.cc (Input_file::Input_file): Likewise.
10855 (Input_file::will_search_for): Handle is_searched_file.
10856 (Input_file::open): Likewise.
10857 * readsyms.cc (Read_symbols::get_name): Likewise.
10858 * testsuite/Makefile.am (searched_file_test): New test.
10859 * testsuite/Makefile.in: Regenerate.
10860 * testsuite/searched_file_test.cc: New file.
10861 * testsuite/searched_file_test_lib.cc: New file.
10862
f3048a1d
ILT
108632009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10864 Ian Lance Taylor <iant@google.com>
10865
10866 * descriptor.cc: Include <cstdio> and "binary-io.h".
10867 (Descriptors::open): Open the files in binary mode always.
10868 * script.cc (Lex::get_token): Treat \r as whitespace.
10869
d4780e57
ILT
108702009-10-09 Ian Lance Taylor <iant@google.com>
10871
10872 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
10873
d9a893b8
ILT
108742009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10875 Ian Lance Taylor <iant@google.com>
10876
10877 * configure.ac: Check for readv function also.
10878 * fileread.cc (readv): Define if not HAVE_READV.
10879 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
10880 does not exist.
10881 * config.in: Regenerate.
10882 * configure: Regenerate.
10883
c0a62865
DK
108842009-10-09 Doug Kwan <dougkwan@google.com>
10885
10886 * layout.cc (Layout::make_output_section): Call target hook to make
10887 ordinary output section.
10888 (Layout::finalize): Adjust parameter list of call the
10889 Target::may_relax().
10890 * layout.h (class Layout::section_list): New method.
10891 * merge.h (Output_merge_base::entsize): Change visibility to public.
10892 (Output_merge_base::is_string, Output_merge_base::do_is_string):
10893 New methods.
10894 (Output_merge_string::do_is_string): New method.
10895 * object.cc (Sized_relobj::do_setup): renamed from
10896 Sized_relobj::set_up.
10897 * object.h (Sized_relobj::adjust_shndx,
10898 Sized_relobj::initializ_input_to_output_maps,
10899 Sized_relobj::free_input_to_output_maps): Change visibilities to
10900 protected.
10901 (Sized_relobj::setup): Virtualize.
10902 (Sized_relobj::do_setup): New method declaration.
10903 (Sized_relobj::invalidate_section_offset,
10904 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
10905 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
10906 * options.cc (parse_int): New function.
10907 * options.h (parse_int): New declaration.
10908 (DEFINE_int): New macro.
10909 (stub_group_size): New option.
10910 * output.cc (Output_section::Output_section): Initialize memebers
10911 merge_section_map_, merge_section_by_properties_map_,
10912 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
10913 (Output_section::add_input_section): Handled deferred code-fill
10914 generation and remove an old comment.
10915 (Output_section::add_relaxed_input_section): New method definition.
10916 (Output_section::add_merge_input_section): Use merge section by
10917 properties map to speed to search. Update merge section maps
10918 as appropriate.
10919 (Output_section::build_relaxation_map): New method definition.
10920 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
10921 Same.
10922 (Output_section::relax_input_section): Renamed to
10923 Output_section::convert_input_sections_to_relaxed_sections and change
10924 interface to take a vector of pointers to relaxed sections.
10925 (Output_section::find_merge_section,
10926 Output_section::find_relaxed_input_section): New method definitions.
10927 (Output_section::is_input_address_mapped,
10928 Output_section::output_offset, Output_section::output_address):
10929 Use output section data maps to speed up searching.
10930 (Output_section::find_starting_output_address): Add comments.
10931 (Output_section::do_write,
10932 Output_section::write_to_postprocessing_buffer): Do code-fill
10933 generation as appropriate.
10934 (Output_section::get_input_sections): Invalidate relaxed input section
10935 map.
10936 (Output_section::restore_states): Adjust type of checkpoint .
10937 Invalidate relaxed input section map.
10938 * output.h (Output_merge_base): New class declaration.
10939 (Input_section_specifier): New class defintion.
10940 (class Output_relaxed_input_section) Change base class to
10941 Output_section_data_build.
10942 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
10943 base class initializer.
10944 (Output_section::add_relaxed_input_section): New method declaration.
10945 (Output_section::Input_section): Change visibility to protected.
2e702c99 10946 (Output_section::Input_section::relobj,
c0a62865
DK
10947 Output_section::Input_section::shndx): Handle relaxed input sections.
10948 Output_section::input_sections) Change visibility to protected. Also
10949 define overload to return a non-const pointer.
10950 (Output_section::Merge_section_properties): New class defintion.
10951 (Output_section::Merge_section_by_properties_map,
10952 Output_section::Output_section_data_by_input_section_map,
10953 Output_section::Relaxation_map): New types.
10954 (Output_section::relax_input_section): Rename method to
10955 Output_section::convert_input_sections_to_relaxed_sections and change
10956 interface to take a vector of relaxed section pointers.
10957 (Output_section::find_merge_section,
10958 Output_section::find_relaxed_input_section,
10959 Output_section::build_relaxation_map,
10960 Output_section::convert_input_sections_in_list_to_relaxed_sections):
10961 New method declarations.
10962 (Output_section::merge_section_map_
10963 Output_section::merge_section_by_properties_map_,
10964 Output_section::relaxed_input_section_map_,
10965 Output_section::is_relaxed_input_section_map_valid_,
10966 Output_section::generate_code_fills_at_write_): New data members.
10967 * script-sections.cc
10968 (Output_section_element_input::set_section_addresses): Call
10969 current_data_size and addralign methods of relaxed input sections.
10970 (Orphan_output_section::set_section_addresses): Call current_data_size
10971 and addralign methods of relaxed input sections.
10972 * symtab.cc (Symbol_table::compute_final_value): Extract template
10973 from the body of Symbol_table::sized_finalize_symbol.
10974 (Symbol_table::sized_finalized_symbol): Call
10975 Symbol_table::compute_final_value.
10976 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
10977 (Symbol_table::compute_final_value): New templated method declaration.
10978 * target.cc (Target::do_make_output_section): New method defintion.
10979 * target.h (Target::make_output_section): New method declaration.
10980 (Target::relax): Add more parameters for input objects, symbol table
10981 and layout. Adjust call to do_relax.
10982 (Target::do_make_output_section): New method declaration.
10983 (Target::do_relax): Add parameters for input objects, symbol table
10984 and layout.
10985
d446d6c4
ILT
109862009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10987
10988 * pread.c: Include stdio.h.
10989
bc06c745
ILT
109902009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10991
10992 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
10993 defined.
10994
75aea3d0
ILT
109952009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10996
10997 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
10998 Change read_shndx type to unsigned int.
10999 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
11000 int.
11001 (Sized_dwarf_line_info::read_line_mappings): Likewise.
11002 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
11003 Change read_shndx type to unsigned int.
11004 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
11005 int.
11006 (Sized_dwarf_line_info::read_line_mappings): Likewise.
11007 * layout.cc (Layout::create_symtab_sections): Cast the result of
11008 local_symcount * symsize to off_t in the gold_assert.
11009
be8fcb75
ILT
110102009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11011
11012 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
11013 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
11014 R_ARM_BASE_ABS.
11015 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
11016 (Arm_relocate_functions::thm_abs5): New function.
11017 (Arm_relocate_functions::abs12): New function.
11018 (Arm_relocate_functions::abs16): New function.
11019 (Arm_relocate_functions::base_abs): New function.
11020 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
11021 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
11022 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
11023 R_ARM_BASE_ABS.
11024 (Scan::global): Likewise.
11025 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
11026 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
11027 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
11028 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
11029 R_ARM_BASE_ABS.
11030
c2a122b6
ILT
110312009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11032
11033 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
11034 (Arm_relocate_functions::movt_prel): New function.
11035 (Arm_relocate_functions::thm_movw_prel_nc): New function.
11036 (Arm_relocate_functions::thm_movt_prel): New function.
11037 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
11038 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
11039 (Scan::global, Relocate::relocate): Likewise.
11040 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11041
c4aa1e2d
ILT
110422009-10-09 Mikolaj Zalewski <mikolajz@google.com>
11043
11044 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
11045 Incremental_checker.
11046 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
11047 unsigned int.
11048 (class Incremental_inputs_header): New class.
11049 (Incremental_inputs_header_writer): Edit comment.
11050 (Incremental_inputs_entry): New class.
11051 (Incremental_inputs_entry_writer): Edit comment.
11052 (Sized_incremental_binary::do_find_incremental_inputs_section):
11053 Add *strtab_shndx parameter, fill it.
11054 (Sized_incremental_binary::do_check_inputs): New method.
11055 (Incremental_checker::can_incrementally_link_output_file): Use
11056 Sized_incremental_binary::check_inputs.
11057 (Incremental_inputs::report_command_line): Save command line in
11058 command_line_.
11059 * incremental.h:
11060 (Incremental_binary::find_incremental_inputs_section): New
11061 method.
11062 (Incremental_binary::do_find_incremental_inputs_section): Add
11063 strtab_shndx parameter.
11064 (Incremental_binary::do_check_inputs): New pure virtual method.
11065 (Sized_incremental_binary::do_check_inputs): Declare.
11066 (Incremental_checker::Incremental_checker): Add incremental_inputs
11067 parameter, use it to initialize incremental_inputs_.
11068 (Incremental_checker::incremental_inputs_): New field.
11069 (Incremental_checker::command_line): New method.
11070 (Incremental_checker::inputs): New method.
11071 (Incremental_checker::command_line_): New field.
11072
c549a694
ILT
110732009-10-09 Mikolaj Zalewski <mikolajz@google.com>
11074
11075 * incremental.cc: Include <cstdarg> and "target-select.h".
11076 (vexplain_no_incremental): New function.
11077 (explain_no_incremental): New function.
11078 (Incremental_binary::error): New method.
11079 (Sized_incremental_binary::do_find_incremental_inputs_section): New
11080 method.
11081 (make_sized_incremental_binary): New function.
11082 (open_incremental_binary): New function.
11083 (can_incrementally_link_file): Add checks if output is ELF and has
11084 inputs section.
11085 * incremental.h: Include "elfcpp_file.h" and "output.h".
11086 (Incremental_binary): New class.
11087 (Sized_incremental_binary): New class.
11088 (open_incremental_binary): Declare.
11089 * object.cc (is_elf_object): Use
11090 elfcpp::Elf_recognizer::is_elf_file.
11091 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
11092 * output.h (Output_file::filesize): New method.
11093
fd3c5f0b
ILT
110942009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11095
11096 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
11097 New function.
11098 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
11099 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
11100 function.
11101 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
11102 function.
11103 (Arm_relocate_functions::movw_abs_nc): New function.
11104 (Arm_relocate_functions::movt_abs): New function.
11105 (Arm_relocate_functions::thm_movw_abs_nc): New function.
11106 (Arm_relocate_functions::thm_movt_abs): New function.
11107 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
11108 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
11109 (Scan::global): Likewise.
11110 (Relocate::relocate): Likewise.
11111 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11112
7f5309a5
ILT
111132009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11114
11115 * arm.cc (Arm_relocate_functions::got_prel) New function.
11116 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
11117 (Relocate::relocate): Likewise.
11118 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11119
364c7fa5
ILT
111202009-10-06 Ian Lance Taylor <iant@google.com>
11121
11122 * options.h (class General_options): Define
11123 split_stack_adjust_size parameter.
11124 * object.h (class Object): Add uses_split_stack_ and
11125 has_no_split_stack_ fields. Add uses_split_stack and
11126 has_no_split_stack accessor functions. Declare
11127 handle_split_stack_section.
11128 (class Reloc_symbol_changes): Define.
11129 (class Sized_relobj): Define Function_offsets. Declare
11130 split_stack_adjust, split_stack_adjust_reltype, and
11131 find_functions.
11132 * object.cc (Object::handle_split_stack_section): New function.
11133 (Sized_relobj::do_layout): Call handle_split_stack_section.
11134 * dynobj.cc (Sized_dynobj::do_layout): Call
11135 handle_split_stack_section.
11136 * reloc.cc (Sized_relobj::relocate_sections): Call
11137 split_stack_adjust for executable sections in split_stack
11138 objects. Pass reloc_map to relocate_section.
11139 (Sized_relobj::split_stack_adjust): New function.
11140 (Sized_relobj::split_stack_adjust_reltype): New function.
11141 (Sized_relobj::find_functions): New function.
11142 * target-reloc.h: Include "object.h".
11143 (relocate_section): Add reloc_symbol_changes parameter. Change
11144 all callers.
11145 * target.h (class Target): Add calls_non_split method. Declare
11146 do_calls_non_split virtual method. Declare match_view and
11147 set_view_to_nop.
11148 * target.cc: Include "elfcpp.h".
11149 (Target::do_calls_non_split): New function.
11150 (Target::match_view): New function.
11151 (Target::set_view_to_nop): New function.
11152 * gold.cc (queue_middle_tasks): Give an error if mixing
11153 split-stack and non-split-stack objects with -r.
11154 * i386.cc (Target_i386::relocate_section): Add
11155 reloc_symbol_changes parameter.
11156 (Target_i386::do_calls_non_split): New function.
11157 * x86_64.cc (Target_x86_64::relocate_section): Add
11158 reloc_symbol_changes parameter.
11159 (Target_x86_64::do_calls_non_split): New function.
11160 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
11161 parameter.
11162 * powerpc.cc (Target_powerpc::relocate_section): Add
11163 reloc_symbol_changes parameter.
11164 * sparc.cc (Target_sparc::relocate_section): Add
11165 reloc_symbol_changes parameter.
11166 * configure.ac: Call AM_CONDITIONAL for the default target.
11167 * configure: Rebuild.
11168 * testsuite/Makefile.am (TEST_AS): New variable.
11169 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
11170 (check_DATA): Add split_i386 and split_x86_64 files.
11171 (SPLIT_DEFSYMS): Define.
11172 (split_i386_[1234n].o): New targets.
11173 (split_i386_[124]): New targets.
11174 (split_i386_[1234r].stdout): New targets.
11175 (split_x86_64_[1234n].o): New targets.
11176 (split_x86_64_[124]): New targets.
11177 (split_x86_64_[1234r].stdout): New targets.
11178 (MOSTLYCLEANFILES): Add new executables.
11179 * testsuite/split_i386.sh: New file.
11180 * testsuite/split_x86_64.sh: New file.
11181 * testsuite/split_i386_1.s: New file.
11182 * testsuite/split_i386_2.s: New file.
11183 * testsuite/split_i386_3.s: New file.
11184 * testsuite/split_i386_4.s: New file.
11185 * testsuite/split_i386_n.s: New file.
11186 * testsuite/split_x86_64_1.s: New file.
11187 * testsuite/split_x86_64_2.s: New file.
11188 * testsuite/split_x86_64_3.s: New file.
11189 * testsuite/split_x86_64_4.s: New file.
11190 * testsuite/split_x86_64_n.s: New file.
11191 * testsuite/testfile.cc (Target_test): Update relocation_section
11192 function.
11193 * testsuite/Makefile.in: Rebuild.
11194
e8a9fcda
ILT
111952009-10-06 Ian Lance Taylor <iant@google.com>
11196
11197 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
11198 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
11199 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
11200 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
11201 the address on ldo_addrs_.
11202 (Target_i386::Relocate::fix_up_ldo): New function.
11203
e99daf92
ILT
112042009-10-06 Rafael Espindola <espindola@google.com>
11205
11206 * plugin.cc (add_input_library): New.
11207 (Plugin::load): Add add_input_library to tv.
11208 (Plugin_manager::add_input_file): Add the is_lib argument.
11209 (add_input_file): Update call to Plugin_manager::add_input_file.
11210 (add_input_library): New.
11211 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
11212
966d4097
DK
112132009-09-30 Doug Kwan <dougkwan@google.com>
11214
11215 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
11216 symbol and call Symbol::may_need_copy_reloc to determine if
11217 a copy reloc is needed.
11218 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
11219 nocopyreloc is given in command line.
11220 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
11221 given in command line.
11222 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
11223 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
11224 of the removed Target_i386::may_need_copy_reloc.
11225 * options.h (copyreloc): New option with default value false.
11226 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
11227 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
11228 instead of the removed Target_powerpc::may_need_copy_reloc.
11229 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
11230 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
11231 instead of the removed Target_sparc::may_need_copy_reloc.
11232 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
11233 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
11234 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
11235 instead of the removed Target_x86_64::may_need_copy_reloc.
11236
029ba973
ILT
112372009-09-30 Ian Lance Taylor <iant@google.com>
11238
11239 * object.h (class Object): Remove target_ field, and target,
11240 sized_target, and set_target methods.
11241 (Object::sized_target): Remove.
11242 (class Sized_relobj): Update declarations. Remove sized_target.
11243 * object.cc (Sized_relobj::setup): Remove target parameter.
11244 Change all callers.
11245 (Input_objects::add_object): Don't do anything with the target.
11246 (make_elf_sized_object): Add punconfigured parameter. Change all
11247 callers. Set or test parameter target.
11248 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
11249 Change all callers.
11250 * parameters.cc (Parameters::set_target): Change parameter type to
11251 be non-const.
11252 (Parameters::default_target): Remove.
11253 (set_parameters_target): Change parameter type to be non-const.
11254 (parameters_force_valid_target): New function.
11255 (parameters_clear_target): New function.
11256 * parameters.h (class Parameters): Update declarations. Remove
11257 default_target method. Add sized_target and clear_target
11258 methods. Change target_ to be non-const.
11259 (set_parameters_target): Update declaration.
11260 (parameters_force_valid_target): Declare.
11261 (parameters_clear_target): Declare.
11262 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
11263 as NULL if we aren't searching.
11264 (Add_symbols::run): Don't check for compatible target.
11265 * fileread.cc (Input_file::open_binary): Call
11266 parameters_force_valid_target.
11267 * gold.cc (queue_middle_tasks): Likewise.
11268 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
11269 set_target on object.
11270 * dynobj.h (class Sized_dynobj): Update declarations.
11271 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
11272 make_elf_object returns NULL.
11273 (Archive::include_member): Don't check whether object target is
11274 compatible.
11275 * output.cc (Output_section::add_input_section): Get target from
11276 parameters.
11277 (Output_section::relax_input_section): Likewise.
11278 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
11279 parameters.
11280 (Sized_relobj::do_scan_relocs): Likewise.
11281 (Sized_relobj::relocate_sections): Likewise.
11282 * resolve.cc (Symbol_table::resolve): Likewise.
11283 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
11284 parameter. Change all callers.
11285 (Symbol_table::add_from_object): Get target from parameters.
11286 (Symbol_table::add_from_relobj): Don't check object target.
11287 (Symbol_table::add_from_dynobj): Likewise.
11288 (Symbol_table::define_special_symbol): Get target from
11289 parameters.
11290 * symtab.h (class Symbol_table): Update declaration.
11291 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
11292 parameter. Change all callers. Clear parameter target.
11293 (Binary_test): Test target here.
11294 * testsuite/object_unittest.cc (gold_testsuite): Remove
11295 target_test_pointer parameter. Change all callers.
11296 (Object_test): Test target here.
11297
a6a22b83
ILT
112982009-09-26 Ian Lance Taylor <iant@google.com>
11299
11300 * testsuite/initpri1.c: Don't try to use constructor priorities if
11301 compiling with gcc before 4.3.
11302
6a8f49fe
ILT
113032009-09-22 Mikolaj Zalewski <mikolajz@google.com>
11304
11305 * testsuite/retain_symbols_file_test.sh (check_present): Change
11306 output file name to retain_symbols_file_test.stdout.
11307 (check_absent): Likewise.
11308
8c604651
CS
113092009-09-18 Craig Silverstein <csilvers@google.com>
11310
11311 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
11312 * options.cc: Include <cerrno> and <fstream>.
11313 (General_options::finalize): Parse -retain-symbols-file tag.
11314 * options.h: New flag.
11315 (General_options): New method should_retain_symbol, new
11316 variable symbols_to_retain.
11317 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
11318 should_retain_symbol map.
11319 * testsuite/Makefile.am (retain_symbols_file_test): New test.
11320 * testsuite/Makefile.in: Regenerate.
11321 * testsuite/retain_symbols_file_test.sh: New file.
11322
ca58b19f
NC
113232009-09-18 Nick Clifton <nickc@redhat.com>
11324
11325 * po/es.po: Updated Spanish translation.
11326
20e6d0d6
DK
113272009-09-17 Doug Kwan <dougkwan@google.com>
11328
11329 * debug.h (DEBUG_RELAXATION): New constant.
11330 (DEBUG_ALL): Add DEBUG_RELAXATION.
11331 (debug_string_to_enum): Add relaxation debug option.
11332 * layout.cc
11333 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
11334 Layout::Relaxation_debug_check::read_sections,
11335 Layout::Relaxation_debug_check::read_sections): New method definitions.
11336 (Layout::Layout): Initialize data members
11337 record_output_section_data_from_scrips_,
11338 script_output_section_data_list_ and relaxation_debug_check_.
11339 (Layout::save_segments, Layout::restore_segments,
11340 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
11341 Layout::relaxation_loop_body): New method definitions.
11342 (Layout::finalize): Support relaxation. Move section layout code to
11343 Layout::relaxation_loop_body.
11344 (Layout::set_asection_address_from_script): Move code for orphan
11345 section placement out.
11346 (Layout::place_orphan_sections_in_script): New method definition.
11347 * layout.h (Output_segment_headers, Output_file_header):
11348 New forward class declarations.
11349 (Layout::~Layout): Define.
11350 (Layout::new_output_section_data_from_script): New method definition.
11351 (Layout::place_orphan_sections_in_script): New method declaration.
11352 (Layout::Segment_states): New type declaration.
11353 (Layout::save_segments, Layout::restore_segments,
11354 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
11355 Layout::relaxation_loop_body): New method declarations.
11356 (Layout::Output_section_data_list): New type declaration.
11357 (Layout::Relaxation_debug_check): New class definition.
11358 (Layout::record_output_section_data_from_script_,
11359 Layout::script_output_section_data_list_, Layout::segment_states_,
11360 Layout::relaxation_debug_check_): New data members.
11361 * output.cc: (Output_section_headers::do_size): New method definition.
11362 (Output_section_headers::Output_section_headers): Move size
11363 computation to Output_section_headers::do_size.
11364 (Output_segment_headers::do_size): New method definition.
e1df38aa 11365 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
11366 Output_file_header::do_size and call it.
11367 (Output_file_header::do_size): New method definition.
11368 (Output_data_group::Output_data_group): Adjust call to
11369 Output_section_data.
11370 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
11371 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 11372 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
11373 RELAXED_INPUT_SECTION_CODE.
11374 (Output_section::Output_section): Initialize data member checkpoint_.
11375 (Output_section::~Output_section): Delete checkpoint object pointed
11376 by checkpoint_.
11377 (Output_section::add_input_section): Always add an Input_section if
11378 relaxing.
11379 (Output_section::add_merge_input_section): Add assert.
11380 (Output_section::relax_input_section): New method definition.
11381 (Output_section::set_final_data_size): Set load address to zero for
11382 an unallocated section.
11383 (Output_section::do_address_and_file_offset_have_reset_values):
11384 New method definition.
11385 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
11386 Handle relaxed input section.
11387 (Output_section::sort_attached_input_sections): Checkpoint input
11388 section list lazily.
11389 (Output_section::get_input_sections): Change type of input_sections to
11390 list of Simple_input_section pointers. Checkpoint input section list
11391 lazily. Also handle relaxed input sections.
11392 (Output_section::add_input_section_for_script): Take a reference to
11393 a Simple_input_section object instead of Relobj pointer and section
11394 index as parameter. Handle relaxed input sections.
11395 (Output_section::save_states, Output_section::restore_states): New
11396 method definitions.
11397 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
11398 (Output_data::is_data_size_fixed): New method definition.
11399 (Output_data::reset_addresss_and_file_offset): Do not reset data size
11400 if it is fixed.
11401 (Output_data::address_and_file_offset_have_reset_values): New method
11402 definition.
11403 (Output_data::do_address_and_file_offset_have_reset_values): New method
11404 definition.
11405 (Output_data::set_data_size): Check that data size is not fixed.
11406 (Output_data::fix_data_size): New method definition.
11407 (Output_data::is_data_size_fixed_): New data member.
11408 (Output_section_headers::set_final_data_size): New method definition.
11409 (Output_section_headers::do_size): New method declaration.
11410 (Output_segment_headers::set_final_data_size): New method definition.
11411 (Output_segment_headers::do_size): New method declaration.
11412 (Output_file_header::set_final_data_size)::New method definition.
11413 (Output_file_header::do_size)::New method declaration.
11414 (Output_section_data::Output_section_data): Add new parameter
11415 is_data_size_fixed and use it to fix data size.
11416 (Output_data_const::Output_data_const): Adjust call to base class
11417 constructor and fix data size.
11418 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
11419 base class constructor and fix data size.
11420 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
11421 base class constructor and fix data size.
11422 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
11423 class constructor and fix data size.
11424 (Output_data_group::set_final_data_size): New method definition.
11425 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
11426 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
11427 class constructor and fix data size.
11428 (Output_relaxed_input_section): New class definition.
11429 (Output_section::Simple_input_section): New class definition.
11430 (Output_section::get_input_sections): Adjust parameter list.
11431 (Output_section::add_input_section_for_script): Same.
11432 (Output_section::save_states, Output_section::restore_states,
11433 Output_section::do_address_and_file_offset_have_reset_values,
11434 (Output_section::Input_section::Input_section): Handle
11435 RELAXED_INPUT_SECTION_CODE. Add new overload for
11436 Output_relaxed_input_section.
11437 (Output_section::Input_section::is_input_section,
11438 Output_section::Input_section::set_output_section): Handle relaxed
11439 input section.
11440 (Output_section::Input_section::is_relaxed_input_section,
11441 Output_section::Input_section::output_section_data,
11442 Output_section::Input_section::relaxed_input_section): New method
11443 definitions.
11444 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
11445 value.
11446 (Output_section::Input_section::u1_): Update comments.
11447 (Output_section::Input_section::u2_): Add new union member poris.
11448 (Output_section::Checkpoint_output_section): New classs definition.
11449 (Output_section::relax_input_section): New method declaration.
11450 (Output_section::checkpoint_): New data member.
11451 (Output_segment): Update comments.
11452 (Output_segment::Output_segment): Un-privatize copy constructor.
11453 (Output_segment::operator=): Un-privatize.
11454 * script-sections.cc (Output_section_element::Input_section_list):
11455 Change element type to Output_section::Simple_input_section.
11456 (Output_section_element_dot_assignment::set_section_addresses):
11457 Register output section data for relaxation clean up.
11458 (Output_data_exression::Output_data_expression): Adjust call to base
11459 constructor to fix data size.
11460 (Output_section_element_data::set_section_addresses): Register
11461 Output_data_expression object for relaxation clean up.
11462 (struct Input_section_info): Replace Relobj pointer and section index
11463 pair with Output_section::Simple_input_section and Convert struct to a
11464 class.
11465 (Input_section_sorter::operator()): Adjust access to
e1df38aa 11466 Input_section_info data member to use accessors.
20e6d0d6
DK
11467 (Output_section_element_input::set_section_addresses): Use layout
11468 parameter. Adjust code to use Output_section::Simple_input_section
11469 and Input_secction_info classes. Register filler for relaxation
11470 clean up.
11471 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
11472 and section index pair with Output_section::Simple_input_section
11473 class. Adjust code accordingly.
11474 (Phdrs_element::release_segment): New method definition.
11475 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
11476 segment list.
11477 (Script_sections::release_segments): New method definition.
11478 * gold/script-sections.h (Script_sections::release_segments): New
11479 method declaration.
11480 * gold/target.h (Target::may_relax, Target::relax,
11481 Target::do_may_relax, Target::do_relax): New method definitions.
11482
5e445df6
ILT
114832009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11484
11485 * arm.cc (has_signed_unsigned_overflow): New function.
11486 (Arm_relocate_functions::abs8): New function.
11487 (Target_arm::Scan::local): Handle R_ARM_ABS8.
11488 (Target_arm::Scan::global): Likewise.
11489 (Target_arm::relocate::relocate): Likewise.
11490 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11491 Likewise.
11492
8c604651 114932009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
11494
11495 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
11496 * testsuite/Makefile.in: Regenerate.
11497
1e9cc1c2
NC
114982009-09-11 Nick Clifton <nickc@redhat.com>
11499
11500 * po/gold.pot: Updated by the Translation project.
11501
6a89f575
CC
115022009-09-08 Cary Coutant <ccoutant@google.com>
11503
11504 * output.cc (Output_file::open): Add execute permission to empty file.
11505 * testsuite/Makefile.am (permission_test): New test.
11506 * testsuite/Makefile.in: Regenerate.
11507
fdcac5af
ILT
115082009-09-02 Ian Lance Taylor <iant@google.com>
11509
11510 * output.cc (Output_file::resize): Call map_no_anonymous rather
11511 than map.
11512
44453f85
ILT
115132009-09-01 Mikolaj Zalewski <mikolajz@google.com>
11514
11515 * gold.cc: Include "incremental.h".
11516 (queue_initial_tasks): Call Incremental_checker methods.
11517 * incremental.cc: Include "output.h".
11518 (Incremental_checker::can_incrementally_link_output_file): New
11519 method.
11520 * incremental.h (Incremental_checker): New class.
11521
11522 * output.cc (Output_file::open_for_modification): New method.
11523 (Output_file::map_anonymous): Changed return type to bool. Record
11524 map in base_ field.
11525 (Output_file::map_no_anonymous): New method, broken out of map.
11526 (Output_file::map): Use map_no_anonymous and map_anonymous.
11527 * output.h (class Output_file): Update declarations.
11528
293c1386
CC
115292009-08-24 Cary Coutant <ccoutant@google.com>
11530
11531 * options.h (Command_line::Pre_options): New class.
11532 (Command_line::pre_options): New member.
11533 * options.cc (gold::options::ready_to_register): New variable.
11534 (One_option::register_option): Do nothing if not registering options.
11535 Assert if same short option registered twice.
11536 (General_options::General_options): Turn off option registration when
11537 done constructing.
11538 (Command_line::Pre_options::Pre_options): New constructor.
11539
f773f3d2
CC
115402009-08-24 Cary Coutant <ccoutant@google.com>
11541
06a73cfe
CC
11542 * options.h (General_options::no_keep_memory): Remove incorrect
11543 short option.
f773f3d2 11544
a15af8e2
RW
115452009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
11546
11547 * Makefile.am (am__skiplex, am__skipyacc): New.
11548 * Makefile.in: Regenerate.
11549
c462b41b
RW
115502009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
11551
14ec8efd
RW
11552 * Makefile.am (AM_CPPFLAGS): Renamed from ...
11553 (INCLUDES): ... this.
11554 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
11555 (AM_CPPFLAGS): Renamed from ...
11556 (INCLUDE): ... this.
11557 * Makefile.in, testsuite/Makefile.in: Regenerate.
11558
81ecdfbb
RW
11559 * Makefile.in: Regenerate.
11560 * aclocal.m4: Likewise.
11561 * config.in: Likewise.
11562 * configure: Likewise.
11563 * testsuite/Makefile.in: Likewise.
11564
c462b41b
RW
11565 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
11566 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
11567 * Makefile.in: Regenerate.
11568 * testsuite/Makefile.in: Regenerate.
11569
2da73f13
CC
115702009-08-19 Cary Coutant <ccoutant@google.com>
11571
11572 * resolve.cc (Symbol_table::resolve): Don't complain about defined
11573 symbols in shared libraries overridden by hidden or internal symbols
11574 in the main program.
11575
2db70501
CD
115762009-08-19 Chris Demetriou <cgd@google.com>
11577
11578 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
11579 checking source file names in error messages.
11580
f733487b
DK
115812009-08-18 Doug Kwan <dougkwan@google.com>
11582
11583 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
11584 an elcpp::Ehdr as parameter. Adjust call to set_target.
11585 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
11586 an elfcpp::Ehdr as parameter.
11587 * object.cc (Object::set_target): Remove the version that looks up
11588 a target and sets it.
11589 (Sized_relobj::setup): Take a Target object instead of
11590 an elfcpp::Ehdr as parameter. Adjust call to set_target.
11591 (make_elf_sized_object): Find target and ask target to
11592 make an ELF object.
11593 * object.h: (Object::set_target): Remove the version that looks up
11594 a target and sets it.
11595 (Sized_relobj::setup): Take a Target object instead of
11596 an elfcpp:Ehdr as parameter.
11597 * target.cc: Include dynobj.h.
11598 (Target::do_make_elf_object_implementation): New.
2e702c99 11599 (Target::do_make_elf_object): New.
f733487b
DK
11600 * target.h (Target::make_elf_object): New template declaration.
11601 (Target::do_make_elf_object): New method declarations.
11602 (Target::do_make_elf_object_implementation): New template declaration.
11603
cc70f101
ILT
116042009-08-14 Ian Lance Taylor <iant@google.com>
11605
11606 * gold.h (FUNCTION_NAME): Define.
11607 (gold_unreachable): Use FUNCTION_NAME.
11608
ef5e0cb1
ST
116092009-08-12 Sriraman Tallam <tmsriram@google.com>
11610
11611 * icf.cc (Icf::find_identical_sections): Issue a warning when a
11612 symbol in the --keep-unique list is not found.
11613
48c187ce
ST
116142009-08-12 Sriraman Tallam <tmsriram@google.com>
11615
11616 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
11617 been maked as --keep-unique.
11618 (Icf::unfold_section): New function.
11619 * icf.h (Icf::unfold_section): New function.
11620 * options.h (General_options::keep_unique): New option.
11621 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
11622 * testsuite/Makefile.in: Regenerate.
11623 * testsuite/icf_keep_unique_test.sh: New file.
11624 * testsuite/icf_keep_unique_test.cc: New file.
11625
645afe0c
CC
116262009-08-12 Cary Coutant <ccoutant@google.com>
11627
11628 PR 10471
11629 * resolve.cc (Symbol_table::resolve): Check for references from
11630 dynamic objects to hidden and internal symbols.
11631 * testsuite/Makefile.am (hidden_test.sh): New test.
11632 * testsuite/Makefile.in: Regenerate.
11633 * testsuite/hidden_test.sh: New script.
11634 * testsuite/hidden_test_1.c: New test source.
11635 * testsuite/hidden_test_main.c: New test source.
11636
11af873f
DK
116372009-08-11 Doug Kwan <dougkwan@google.com>
11638
11639 * arm.cc: Update comments.
11640 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
11641 segment to locate the .ARM.exidx section if present.
11642
b9f7d72d
DK
116432009-08-09 Doug Kwan <dougkwan@google.com>
11644
11645 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
11646 patch.
11647
ddd3c53c
ST
116482009-08-07 Sriraman Tallam <tmsriram@google.com>
11649 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
11650 compiler warnings.
11651
27721062
ST
116522009-08-06 Sriraman Tallam <tmsriram@google.com>
11653
11654 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
11655 valid tls_segment only for non-debug-section relocations.
11656 * testsuite/Makefile.am: Add gc_tls_test.
11657 * testsuite/Makefile.in: Regenerate.
11658 * testsuite/gc_tls_test.cc: New file.
11659 * testsuite/gc_tls_test.sh: New file.
11660
ef15dade 116612009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 11662
ef15dade
ST
11663 * icf.cc: New file.
11664 * icf.h: New file.
11665 * Makefile.am (CCFILES): Add icf.cc.
11666 (HFILES): Add icf.h
11667 * Makefile.in: Regenerate.
11668 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
11669 * gc.h (gc_process_relocs): Populate lists used by icf to contain
11670 section, symbol and addend information for the relocs.
11671 * gold.cc (queue_middle_tasks): Call identical code folding.
11672 * gold.h: Add defines for multimap.
11673 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
11674 to the call of finalize_local_symbols.
11675 * main.cc (main): Create object of class Icf.
11676 * object.cc (Sized_relobj::do_layout): Allow this function to be
11677 called twice during icf.
11678 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
11679 to sections marked as identical by icf.
11680 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
11681 when available.
11682 (Sized_relobj::do_section_entsize): New function.
11683 * object.h (Object::section_entsize): New function.
11684 (Object::do_section_entsize): New pure virtual function.
11685 (Relobj::finalize_local_symbols): Add new parameter.
11686 (Relobj::do_section_entsize): New function.
11687 * options.h (General_options::icf): New option.
11688 (General_options::icf_iterations): New option.
11689 (General_options::print_icf_sections): New option.
11690 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
11691 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
11692 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
11693 icf.
11694 * symtab.cc (Symbol_table::is_section_folded): New function.
11695 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
11696 to sections marked as identical by icf.
11697 * symtab.h (Symbol_table::set_icf): New function.
11698 (Symbol_table::icf): New function.
11699 (Symbol_table::is_section_folded): New function.
11700 (Symbol_table::icf_): New data member.
11701 * target-reloc.h (relocate_section): Ignore sections folded by icf.
11702 * testsuite/Makefile.am: Add commands to build icf_test.
11703 * testsuite/Makefile.in: Regenerate.
11704 * testsuite/icf_test.sh: New file.
11705 * testsuite/icf_test.cc: New file.
11706
c3b65ac4
CD
117072009-07-24 Chris Demetriou <cgd@google.com>
11708
11709 * layout.cc (is_compressible_debug_section): Fix incorrect
11710 comment about compressed section names.
11711
1caf2c51
ILT
117122009-07-20 Ian Lance Taylor <ian@airs.com>
11713
11714 PR 10419
11715 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
11716
1ef4d87f
ILT
117172009-07-16 Ian Lance Taylor <iant@google.com>
11718
11719 PR 10400
11720 * layout.h: #include <map>.
11721 (class Kept_section): Change from struct to class. Add accessors
11722 and setters. Add section size to Comdat_group mapping. Change
11723 Comdat_group to std::map. Add is_comdat_ field. Add
11724 linkonce_size field in union.
11725 (class Layout): Update declaration of find_or_add_kept_section.
11726 Don't declare find_kept_object.
11727 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
11728 parameter. Add object, shndx, is_comdat, and is_group_name
11729 parameters. Change all callers. Adjust for new Kept_section.
11730 (Layout::find_kept_object): Remove.
11731 * object.cc (Sized_relobj::include_section_group): Update use of
11732 Kept_section. Rename secnum to shndx. Only record
11733 Kept_comdat_section if sections are the same size.
11734 (Sized_relobj::include_linkonce_section): Update use of
11735 Kept_section. Only record Kept_comdat_section if sections are the
11736 same size. Set size of linkonce section.
11737 (Sized_relobj::map_to_kept_section): Update call to
11738 get_kept_comdat_section.
11739 * object.h (class Sized_relobj): Rename fields in
11740 Kept_comdat_section to drop trailing underscores; change object
11741 field to Relobj*. Change Kept_comdat_section_table to store
11742 struct rather than pointer.
11743 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
11744 Add kept_object and kept_shndx parameters. Change all callers.
11745 (Sized_relobj::get_kept_comdat_section): Change return type to
11746 bool. Add kept_object and kept_shndx parameters. Change all
11747 callers.
11748 * plugin.cc (Pluginobj::include_comdat_group): Update call to
11749 Layout::find_or_add_kept_section.
11750
37c3b7b0
ILT
117512009-07-09 Ian Lance Taylor <iant@google.com>
11752
11753 * merge.cc (Object_merge_map::initialize_input_to_output_map):
11754 Reserve space in the hash table.
11755
98fa85cb
ILT
117562009-07-06 Mikolaj Zalewski <mikolajz@google.com>
11757
11758 * fileread.cc (File_read::get_mtime): New method.
11759 * fileread.h (Timespec): New structure.
11760 (File_read::get_mtime): New method.
11761 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
11762 Renamed from timestamp_nsec.
11763 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
11764 Elf_Xword.
e1df38aa 11765 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 11766 timestamp_nsec.
e1df38aa 11767 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
11768 (Incremental_inputs::report_obejct): Save mtime; style fix.
11769 (Incremental_inputs::report_script): Save mtime; style fix.
11770 (Incremental_inputs::finalize_inputs): Style fix.
11771 (Incremental_inputs::finalize): Style fix.
11772 (Incremental_inputs::create_input_section_data): Store inputs
11773 mtime.
11774 * incremental.h (Incremental_inputs::report_script): Add mtime
11775 argument.
11776 (Incremental_inputs::Input_info::Input_info): Intialize only one
11777 union member.
11778 (Incremental_inputs::Input_info::archive): Move to nameless
11779 union.
11780 (Incremental_inputs::Input_info::obejct): Move to nameless union.
11781 (Incremental_inputs::Input_info::script): Move to nameless union.
11782 (Incremental_inputs::mtime): New field.
11783 * script.cc (read_input_script): Pass file mtime to
11784 Incremental_input.
11785 * script.h (Script_info::inputs): Style fix.
11786
c9d70757
ILT
117872009-07-01 Ian Lance Taylor <ian@airs.com>
11788
11789 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
11790 instead of 32.
11791
9c547ec3
ILT
117922009-06-24 Ian Lance Taylor <iant@google.com>
11793
11794 PR 10156
11795 * layout.cc (Layout::choose_output_section): If we find an
11796 existing section, update the flags.
11797 (Layout::create_notes): New function, broken out of
11798 Layout::finalize.
11799 (Layout::finalize): Don't create note sections.
11800 (Layout::create_note): Don't crash if linker script discards
11801 section.
11802 (Layout::create_gold_note): Likewise.
11803 (Layout::create_build_id): Likewise. Don't set
11804 after_input_sections on the section.
11805 (Layout::create_executable_stack_info): Remove target parameter.
11806 Change caller.
11807 * layout.h (class Layout): Declare create_notes. Update
11808 declaration of create_executable_stack_info.
11809 * gold.cc (queue_middle_tasks): Call create_notes.
11810 * output.cc (Output_section::update_flags_for_input_section): Move
11811 here from output.h. If SHF_ALLOC flag is newly set, mark address
11812 invalid.
11813 * output.h (Output_data::mark_address_invalid): New function.
11814 (class Output_section): Only declare, not define,
11815 update_flags_for_input_section. Remove set_flags.
11816
55458500
ILT
118172009-06-24 Ian Lance Taylor <iant@google.com>
11818
11819 * script-sections.cc (Output_section_definition::
11820 set_section_addresses): Rename shadowing local load_address to
11821 laddr.
11822
1307d6cd
ILT
118232009-06-24 Ian Lance Taylor <iant@google.com>
11824
11825 PR 10244
11826 * reloc.cc (relocate_sections): Skip empty relocation sections.
11827
ec3f783e
ILT
118282009-06-23 Ian Lance Taylor <iant@google.com>
11829
11830 PR 10156
11831 * layout.cc (Layout::create_note): Use choose_output_section
11832 rather than make_output_section.
11833
459c9f1c
ILT
118342009-06-23 Ian Lance Taylor <iant@google.com>
11835
11836 PR 10237
11837 * options.cc (General_options::parse_V): Set printed_version_.
11838 (General_options::General_options): Initialize printed_version_.
11839 * options.h (class General_options): Add printed_version_ field.
11840 * gold.cc (queue_initial_tasks): If there are no input files,
11841 don't give a fatal error if we printed the version information.
11842 (queue_middle_tasks): If using -r with a shared object, give a
11843 fatal error rather than an ordinary error.
11844
1518dc8f
ILT
118452009-06-23 Ian Lance Taylor <iant@google.com>
11846
11847 PR 10219
11848 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
11849 (Layout::make_output_section): Set have_stabstr_section_ if we see
11850 a .stab*str section.
11851 (Layout::finalize): Call link_stabs_sections.
11852 (Layout::link_stabs_sections): New file.
11853 * layout.h (class Layout): Add have_stabstr_section_ field.
11854 Declare link_stabs_sections.
11855
3d857b98
DK
118562009-06-23 Doug Kwan <dougkwan@google.com>
11857
11858 * Makefile.am (libgold_a_LIBADD): New.
11859 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 11860 * Makefile.in: Regenerate.
3d857b98
DK
11861 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
11862 * configure: Regenerate.
11863 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
11864 * fileread.cc: Include sys/state.h
11865 * gold.h: Declare memmem and strndup if found missing.
11866 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
11867
0639a6f6
ILT
118682009-06-23 Ian Lance Taylor <iant@google.com>
11869
11870 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
11871 * configure: Rebuild.
11872
8d63875c
ILT
118732009-06-23 Ian Lance Taylor <iant@google.com>
11874
11875 PR 10147
11876 * object.cc (Object::section_contents): Don't try to get a view if
11877 the section has length zero.
11878 (Object::handle_gnu_warning_section): If the section is empty, use
11879 the name of the section as the warning.
11880
f7c8a183
ILT
118812009-06-23 Ian Lance Taylor <iant@google.com>
11882
11883 PR 10133
11884 * stringpool.h (class Stringpool_template): Add optimize_ field.
11885 (Stringpool_template::set_optimize): New function.
11886 * stringpool.cc (Stringpool_template::Stringpool_template):
11887 Initialize optimize_ field.
11888 (Stringpool_template::set_string_offsets): Test local optimize
11889 fild rather than parameter.
11890 * layout.cc (Layout::Layout): Call set_optimize on the section
11891 name stringpool.
11892
e6a307ba
ILT
118932009-06-22 Ian Lance Taylor <iant@google.com>
11894
11895 PR 10030
11896 * yyscript.y: Parse TARGET.
11897 * script.cc (script_set_target): New function.
11898 * script-c.h (script_set_target): Declare.
11899 * options.cc (General_options::string_to_object_format): Rename
11900 from string_to_object_format in anonymous namespace. Change
11901 callers.
11902 * options.h (class General_options): Declare
11903 string_to_object_format.
11904
3ee173de
ILT
119052009-06-22 Ian Lance Taylor <iant@google.com>
11906
11907 * script-sections.cc (Script_sections::create_segments): Don't put
11908 program headers in a PT_LOAD segment if -n or -N.
11909
119102009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
11911
11912 PR 10141
11913 * options.h (class General_options): Add -z lazy and -z now. Sort
11914 -z options into alphabetical order.
11915 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
11916
cd6739a1 119172009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
11918
11919 * layout.cc (Layout::make_output_section): Call
11920 Target::new_output_section.
11921 (Layout::attach_allocated_section_to_segment): Put large section
11922 sections in a separate load segment with the large segment flag
11923 set.
11924 (Layout::segment_precedes): Sort large data segments after other
11925 load segments.
11926 (align_file_offset): New static function.
11927 (Layout::set_segment_offsets): Use align_file_offset.
11928 * output.h (class Output_section): Add is_small_section_ and
11929 is_large_section_ fields.
11930 (Output_section::is_small_section): New function.
11931 (Output_section::set_is_small_section): New function.
11932 (Output_section::is_large_section): New function.
11933 (Output_section::set_is_large_section): New function.
11934 (Output_section::is_large_data_section): New function.
11935 (class Output_segment): Add is_large_data_segment_ field.
11936 (Output_segment::is_large_data_segment): New function.
11937 (Output_segment::set_is_large_data_segment): New function.
11938 * output.cc (Output_section::Output_section): Initialize new
11939 fields.
11940 (Output_segment::Output_segment): Likewise.
11941 (Output_segment::add_output_section): Add assertion that large
11942 data sections always go in large data segments. Force small data
11943 sections to the end of the list of data sections. Force small BSS
11944 sections to the start of the list of BSS sections. For large BSS
11945 sections to the end of the list of BSS sections.
11946 * symtab.h (class Symbol): Declare is_common_shndx.
11947 (Symbol::is_defined): Check Symbol::is_common_shndx.
11948 (Symbol::is_common): Likewise.
11949 (class Symbol_table): Define enum Commons_section_type. Update
11950 declarations. Add small_commons_ and large_commons_ fields.
11951 * symtab.cc (Symbol::is_common_shndx): New function.
11952 (Symbol_table::Symbol_table): Initialize new fields.
11953 (Symbol_table::add_from_object): Put small and large common
11954 symbols in the right list.
11955 (Symbol_table::sized_finalized_symbol): Check
11956 Symbol::is_common_shndx.
11957 (Symbol_table::sized_write_globals): Likewise.
11958 * common.cc (Symbol_table::do_allocate_commons): Allocate new
11959 common symbol lists. Don't call do_allocate_commons_list if the
11960 list is empty.
11961 (Symbol_table::do_allocate_commons_list): Remove is_tls
11962 parameter. Add comons_section_type parameter. Change all
11963 callers. Handle small and large common symbols.
11964 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
11965 Symbol::is_common_shndx.
11966 * resolve.cc (symbol_to_bits): Likewise.
11967 * target.h (Target::small_common_shndx): New function.
11968 (Target::small_common_section_flags): New function.
11969 (Target::large_common_shndx): New function.
11970 (Target::large_common_section_flags): New function.
11971 (Target::new_output_section): New function.
11972 (Target::Target_info): Add small_common_shndx, large_common_shndx,
11973 small_common_section_flags, and large_common_section_flags
11974 fields.
11975 (Target::do_new_output_section): New virtual function.
11976 * arm.cc (Target_arm::arm_info): Initialize new fields.
11977 * i386.cc (Target_i386::i386_info): Likewise.
11978 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
11979 Likewise.
11980 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
11981 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
11982 (Target_x86_64::do_new_output_section): New function.
11983 * configure.ac: Define conditional MCMODEL_MEDIUM.
11984 * testsuite/Makefile.am (check_PROGRAMS): Add large.
11985 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
11986 (large_LDFLAGS): Define.
11987 * testsuite/large.c: New file.
11988 * testsuite/testfile.cc (Target_test::test_target_info):
11989 Initialize new fields.
11990 * configure, testsuite/Makefile.in: Rebuild.
11991
bb04269c
DK
119922009-06-05 Doug Kwan <dougkwan@google.com>
11993
11994 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 11995 * Makefile.in: Regenerate.
bb04269c
DK
11996 * i386.cc (class Target_i386): Define new virtual method to
11997 override do_is_local_label_name in parent.
11998 * object.cc (Sized_relobj::do_count_local_symbols): Discard
11999 local symbols if --discard-locals or -X is given.
12000 * options.h (class General_options): Declare new options
12001 '--discard-locals' and '-X' for discarding locals.
12002 * target.h (class Target): Define new methods is_local_label_name.
12003 Declare new virtual method do_is_local_label_name.
12004 * target.cc: New file.
12005 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
12006 (check_SCRIPTS): Add discard_locals_test.sh.
12007 (check_DATA): Add discard_local_tests.syms.
12008 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
12009 (discard_local_tests.syms, discard_locals_test.o): New make rules.
12010 * testsuite/Makefile.in: Regenerate.
12011 * testsuite/discard_locals_test.c: New file.
12012 * testsuite/discard_locals_test.sh: Same.
12013
805bb01c
DK
120142009-06-05 Doug Kwan <dougkwan@google.com>
12015
12016 * object.cc (Sized_relobj::Sized_relobj): Initialize
12017 discarded_eh_frame_shndx_ to -1U.
12018 (Sized_relobj::do_layout): Record index of a discard .eh_frame
12019 section.
12020 (Sized_relobj::do_count_local_symbols): Skip local symbols in
12021 a discarded .eh_frame section.
12022 (Sized_relobj::do_finalize_local_symbols): Ditto.
12023 * object.h (class Sized_relobj): Declare new member
12024 discarded_eh_frame_shndx_.
12025 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
12026 (local_labels_test.o, local_labels_test): New rules.
12027 * testsuite/Makefile.in: Regenerate.
12028
1dcd334d
DK
120292009-06-04 Doug Kwan <dougkwan@google.com>
12030
12031 * layout.cc (Layout::section_name_mapping): Add mapping for
12032 special ARM sections.
12033
96d49306
DK
120342009-06-03 Doug Kwan <dougkwan@google.com>
12035
12036 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
12037 (utils::has_overflow): Same.
12038
dff16297
ILT
120392009-06-03 Ian Lance Taylor <iant@google.com>
12040
12041 * layout.cc (Layout::section_name_mapping): New array, replacing
12042 Layout::linkonce_mapping.
12043 (Layout::section_name_mapping_count): New variable, replacing
12044 Layout::linkonce_mapping_count.
12045 (Layout::linkonce_output_name): Remove.
12046 (Layout::output_section_name): Rewrite.
12047 * layout.h (class Layout): Rename Linkonce_mapping to
12048 Section_name_mapping, linkonce_mapping to section_name_mapping,
12049 linkonce_mapping_count to section_name_mapping_count. Don't
12050 declare linkonce_output_name.
12051
c121c671
DK
120522009-06-03 Doug Kwan <dougkwan@google.com>
12053
12054 * gold/arm.cc (namespace utils): New.
12055 (Target_arm::reloc_is_non_pic): Define new method.
12056 (class Arm_relocate_functions): New.
12057 (Target_arm::Relocate::relocate): Handle relocation types used by
12058 Android.
12059
07800fab
ILT
120602009-06-03 Ian Lance Taylor <iant@google.com>
12061
12062 * arm.cc (Target_arm::scan::global): Use || instead of |.
12063
c121c671
DK
120642009-06-02 Doug Kwan <dougkwan@google.com>
12065
12066 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
12067 issued_non_pic_error_.
12068 (class Target_arm::Scan): Declare new method check_non_pic.
12069 Define new method symbol_needs_plt_entry.
12070 Declare new data member issued_non_pic_error_.
12071 (class Target_arm::Relocate): Declare new method
12072 should_apply_static_reloc.
12073 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
12074 (Target_arm::Scan::check_non_pic): Define new method.
12075 (Target_arm::Scan::local): Handle a small subset of reloc types used
12076 by Android.
12077 (Target_arm::Scan::local): Same.
12078 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
12079
b19b0c6d
ILT
120802009-05-31 Mikolaj Zalewski <mikolajz@google.com>
12081
12082 * incremental.cc (Incremental_inputs::report_command_line): Filter
12083 out --incremental-* options.
12084
94cdfcff
DK
120852009-05-29 Doug Kwan <dougkwan@google.com>
12086
12087 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
12088 template class.
12089 (class Target_arm): Update comment.
12090 (Target_arm::Target_arm): Initialize new data members GOT_,
12091 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
12092 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
12093 and Target_arm::rel_dyn_section.
12094 Declare new_enum Target_arm::Got_type.
12095 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
12096 and DYNBSS_.
12097 Update commments for member do_dynsym_value.
12098 (Target_arm::got_size, Target_arm::plt_section,
12099 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
12100 new methods inside class defintion.
12101 (Target_arm::got_section): Define new method.
12102 (Target_arm::rel_dyn_section): Same.
12103 (Output_data_plt_arm): New template class.
12104 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
12105 (Output_data_plt_arm:do_adjust_output_section): Define new method.
12106 (Output_data_plt_arm::add_entry): Same.
12107 (Output_data_plt_arm::first_plt_entry): Define new
12108 static data member for PLT instruction template.
12109 (Output_data_plt_arm::plt_entry): Same.
12110 (Output_data_plt_arm::do_write): Define new method.
12111 (Target_arm::make_plt_entry): Same.
12112 (Target_arm::do_finalize_sections): Same.
12113 (Target_arm::do_dynsym_value): Same.
12114
4a657b0d
DK
121152009-05-28 Doug Kwan <dougkwan@google.com>
12116
12117 * Makefile.am (TARGETSOURCES): Add arm.cc.
12118 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
12119 * Makefile.in: Regenerate.
12120 * arm.cc: New file.
12121 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
12122
e7ae8c36
DK
121232009-05-26 Doug Kwan <dougkwan@google.com>
12124
12125 * options.cc (General_options::parse_exclude_libs). Fix a comment.
12126 (General_options::check_excluded_libs): Strip off directories in
12127 archive name before matching like GNU ld does.
12128 * testsuite/Makefile.am (MOSTLYCLEANFILES,
12129 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
12130 (exclude_libs_test_LDFLAGS): Add linker option
12131 -Wl,--exclude-libs,libexclude_libs_test_3
12132 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
12133 an explicit archive without using -l.
12134 (alt/libexclude_libs_test_3.a): New make rule.
12135 * testsuite/Makefile.in: Regenerate.
12136 * testsuite/exclude_libs_test.c : Declare lib3_default().
12137 (main): Call it.
12138 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
12139 * exclude_libs_test_3.c: New file.
12140
f12e7348
NC
121412009-05-26 Nick Clifton <nickc@redhat.com>
12142
12143 * po/id.po: New Indonesian translation.
12144 * po/gold.pot: Updated template file.
12145
4daadc0d
ST
121462009-05-22 Sriraman Tallam <tmsriram@google.com>
12147
e1df38aa 12148 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
12149 gc_comdat_test files. Add -Wl,--gc-sections to build
12150 gc_comdat_test.
12151 * testsuite/Makefile.in: Regenerate.
12152 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
12153
531813ad
ST
121542009-05-21 Sriraman Tallam <tmsriram@google.com>
12155
12156 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
12157 kept comdat section was garbage collected.
12158 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
12159 * testsuite/Makefile.in: Regenerate.
12160 * testsuite/gc_comdat_test.sh: New file.
12161 * testsuite/gc_comdat_test_1.cc: New file.
12162 * testsuite/gc_comdat_test_2.cc: New file.
12163
65514900
CC
121642009-05-19 Doug Kwan <dougkwan@google.com>
12165
12166 * archive.cc (Archive::Archive): Move constructor from archive.h
12167 to here. Initialize no_export_.
12168 (Archive::get_elf_object_for_member): Set no_export flag of object.
12169 * archive.h (Archive::Archive): Move constructor body to
12170 archive.cc.
12171 (Archive::no_export): New method.
12172 (Archive::no_export_): New field.
12173 * object.h (Object::Object): Initialize no_export_ to false.
12174 (Object::no_export, Object::set_no_export): New methods.
12175 (Object::no_export_): New field.
12176 * options.cc (General_options::parse_exclude_libs): New method.
12177 (General_options::check_excluded_libs) Same.
12178 * options.h (exclude_libs): New option.
12179 (General_options::check_excluded_libs): New method declaration.
12180 (General_options::excluded_libs_): New field.
12181 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
12182 default or protected visibility if an object has no-export flag set.
12183 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
12184 (check_SCRIPTS): Add exclude_libs_test.sh.
12185 (check_DATA): Add exclude_libs_test.syms.
12186 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
12187 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
12188 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
12189 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
12190 (exclude_libs_test.syms, libexclude_libs_test_1.a,
12191 libexclude_libs_test_2.a): New rules.
12192 * testsuite/Makefile.in: Regenerate.
12193 * testsuite/exclude_libs_test.c: New file.
12194 * testsuite/exclude_libs_test.sh: Ditto.
12195 * testsuite/exclude_libs_test_1.c: Ditto.
12196 * testsuite/exclude_libs_test_2.c: Ditto.
12197
1b77ea50
ILT
121982009-05-15 Ian Lance Taylor <iant@google.com>
12199
12200 * configure.ac: Check for declarations for cases where libiberty.h
12201 checks HAVE_DECL_xxx.
12202 * configure, config.in: Rebuild.
12203
072fe7ce
ILT
122042009-05-15 Mikolaj Zalewski <mikolajz@google.com>
12205
12206 * gold.h (Incremental_argument_list): Remove (invalid) forward
12207 declaration.
12208 * incremental.cc (Incremental_inputs::report_achive): New method.
12209 (Incremental_inputs::report_object): New method.
12210 (Incremental_inputs::report_script): New method.
12211 (Incremental_inputs::finalize_inputs): New method.
12212 (Incremental_inputs::finalize): Call finalize_inputs().
12213 (Incremental_inputs::sized_create_incremental_inputs_section_data):
12214 Create inputs entries.
12215 * incremental.h (Incremental_input_type): New enum.
12216 (Incremental_inputs::Incremental_input): Initialize new fields.
12217 (Incremental_inputs::report_inputs): New method.
12218 (Incremental_inputs::report_achive): New method.
12219 (Incremental_inputs::report_object): New method.
12220 (Incremental_inputs::report_script): New method.
12221 (Incremental_inputs::finalize_inputs): New method.
12222 (Incremental_inputs::Input_info): New struct.
12223 (Incremental_inputs::Input_info_map): New typedef.
12224 (Incremental_inputs::lock_): New field.
12225 (Incremental_inputs::Inputs_): New field.
12226 (Incremental_inputs::Inputs_map): New field.
12227 * main.cc (main): Call Incremental_input::report_inputs.
12228 * options.h (Input_argument_list): Typedef moved from
12229 Input_arguments.
12230 (Input_file_group::Files): Remove, use ::Input_argument_list.
12231 (Input_file_group::Input_argument_list): Remove, use
12232 ::Input_argument_list.
12233 * plugin.cc (Plugin_manager::add_input_file): Add error in
12234 incremental build.
12235 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
12236 functions.
12237 * script.cc (read_input_script): Call
12238 Incremental_input::report_script.
12239 * script.h (Script_info): New class.
12240
b0481b0b
ILT
122412009-04-27 Ian Lance Taylor <iant@google.com>
12242
12243 * x86_64.cc (do_adjust_output_section): Set entsize to
12244 plt_entry_size.
12245
b22a5a41 122462009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
12247
12248 * output.cc (Output_file::close): After short writes, continue
12249 writing from the correct offset in the buffer being written.
12250
40fde488
CD
122512009-04-23 Chris Demetriou <cgd@google.com>
12252
12253 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
12254 * configure: Regenerate.
12255 * config.in: Regenerate.
12256 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
12257 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
12258
3ce2c28e
ILT
122592009-04-21 Mikolaj Zalewski <mikolajz@google.com>
12260
12261 * incremental.cc (Incremental_inputs_header_data): Renamed from
12262 Incremental_input_header_data.
12263 (Incremental_inputs_header_data::data_size): New field.
12264 (Incremental_inputs_header_data::put_input_file_count): Renamed
12265 from input_file_count.
12266 (Incremental_inputs_header_data::put_command_line_offset): Renamed
12267 from command_line_offset.
12268 (Incremental_inputs_header_data::put_reserved): Renamed from
12269 put_reserved.
12270 (Incremental_inputs_entry_data): Renamed from
12271 Incremental_input_entry_data.
12272 (Incremental_inputs_entry_data::data_size): New field.
12273 (Incremental_inputs::report_command_line): New method.
12274 (Incremental_inputs::finalize): New method.
12275 (Incremental_inputs::create_incremental_inputs_data): New method.
12276 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
12277 * incremental.h: New file.
12278 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 12279 (Layout::finalize): Create incremental inputs section in
3ce2c28e 12280 incremental builds.
703d02da 12281 (Layout::create_incremental_info_sections): New method.
3ce2c28e 12282 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
12283 (Layout::create_incremental_info_sections): New method.
12284 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
12285 * main.cc (main): Notify Incremental_input of the command line.
12286
e55bde5e
ILT
122872009-04-01 Ian Lance Taylor <iant@google.com>
12288 Mikolaj Zalewski <mikolajz@google.com>
12289
12290 * gold.h (reserve_unordered_map): Define, three versions, one for
12291 each version of Unordered_map.
12292 * layout.cc (Layout::Layout): Remove options parameter. Add
12293 number_of_input_files parameter. Don't initialize options_.
12294 Initialize number_of_input_files_ and resized_signatures_. Move
12295 sections_are_attached_.
12296 (Layout::layout_group): Reserve space for group_signatures_.
12297 (Layout::find_or_add_kept_section): Change name parameter to be a
12298 reference. Resize signatures_ map when it gets large enough.
12299 (Layout::layout_eh_frame): Use parameters->options() instead of
12300 this->options_.
12301 (Layout::make_output_section): Likewise.
12302 (Layout::attach_allocated_section_to_segment): Likewise.
12303 (Layout::finalize, Layout::create_executable_stack): Likewise.
12304 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
12305 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
12306 * layout.h (class Layout): Update declarations. Remove options_
12307 field. Add number_of_input_files_ and resized_signatures_
12308 fields. Move sections_are_attached_ field.
12309 * main.cc (main): Pass number of input files to Layout
12310 constructor. Don't pass options.
12311
154b857c
ILT
123122009-03-30 Ian Lance Taylor <iant@google.com>
12313
12314 * ffsll.c (ffsll): Correct implementation.
12315
2f35ab9b
ILT
123162009-03-27 Ian Lance Taylor <iant@google.com>
12317
fd03461a
ILT
12318 * ffsll.c: New file.
12319 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
12320 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
12321 * ftruncate.c (ftruncate): Declare before definition.
12322 * mremap.c (mremap): Likewise.
12323 * pread.c (pread): Likewise.
12324 * configure, Makefile.in, config.in: Rebuild.
12325
2f35ab9b
ILT
12326 * mremap.c: New file.
12327 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
12328 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
12329 (mremap): Declare if HAVE_MREMAP is not defined.
12330 * configure, Makefile.in, config.in: Rebuild.
12331
33aea2fd
CC
123322009-03-27 Cary Coutant <ccoutant@google.com>
12333
12334 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
12335 position independent.
12336 * sparc.cc (Target_sparc::check_non_pic): Likewise.
12337 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
12338
6d479619
CC
123392009-03-24 Cary Coutant <ccoutant@google.com>
12340
12341 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
12342 an executable.
12343 (needs_dynamic_reloc): Likewise.
12344
afc06bb8
ILT
123452009-03-24 Ian Lance Taylor <iant@google.com>
12346
12347 * yyscript.y (file_cmd): Recognize EXTERN.
12348 (extern_name_list, extern_name_list_body): New nonterminals.
12349 * script.cc (script_add_extern): Define.
12350 * script-c.h (script_add_extern): Declare.
12351
f6060a4d
ILT
123522009-03-24 Rafael Avila de Espindola <espindola@google.com>
12353
12354 * object.cc (is_elf_object): Define.
12355 * object.h (is_elf_object): Declare.
12356 * archive.cc (Archive::get_elf_object_for_member): Call
12357 is_elf_object.
33aea2fd 12358 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 12359
26736d8e
ILT
123602009-03-24 Elliott Hughes <enh@google.com>
12361
12362 * output.cc (Output_file::map_anonymous): Define.
12363 (Output_file::map): Use map_anonymous. If the regular mmap fails,
12364 try an anonymous one. Report the size if the mmap fails.
12365 * output.h (class Output_file): Declare map_anonymous.
12366
22fd9730
ILT
123672009-03-24 Ian Lance Taylor <iant@google.com>
12368
12369 * target-select.cc (instantiate_target): Don't acquire the lock if
12370 the instantiated_target_ field has already been set.
12371
cb010894
ILT
123722009-03-23 Ian Lance Taylor <iant@google.com>
12373
7f055c20
ILT
12374 * gold-threads.h (class Initialize_lock): Define.
12375 * gold-threads.cc (class Initialize_lock_once): Define.
12376 (initialize_lock_control): New static variable.
12377 (initialize_lock_pointer): New static variable.
12378 (initialize_lock_once): New static function.
12379 (Initialize_lock::Initialize_lock): Define.
12380 (Initialize_lock::initialize): Define.
12381 * target-select.h: Include "gold-threads.h".
12382 (class Target_selector): Add lock_ and initialize_lock_ fields.
12383 Don't define instantiate_target, just declare it.
12384 * target-select.cc (Target_selector::Target_selector): Initialize
12385 new fields.
12386 (Target_selector::instantiate_target): Define.
12387 * descriptors.h: Include "gold-threads.h".
12388 (class Descriptors): Add initialize_lock_ field.
12389 * descriptors.cc (Descriptors::Descriptors): Initialize new
12390 field.
12391 (Descriptors::open): Use initialize_lock_ field
12392 * errors.h (class Errors): Add initialize_lock_ field.
12393 * errors.cc (Errors::Errors): Initialize new field.
12394 (Errors::initialize_lock): Use initialize_lock_ field.
12395 * powerpc.cc (class Target_selector_powerpc): Remove
12396 instantiated_target_ field. In do_recognize call
12397 instantiate_target rather than do_instantiate_target. In
12398 do_instantiate_target just allocate a new target.
12399 * sparc.cc (class Target_selector_sparc): Likewise.
12400
36959681
ILT
12401 * freebsd.h: New file.
12402 * i386.cc: Include "freebsd.h".
12403 (Target_i386): Derive from Target_freebsd rather than
12404 Sized_target.
12405 (Target_selector_i386): Derive from Target_selector_freebsd rather
12406 than Target_selector.
12407 * x86_64.cc: Include "freebsd.h".
12408 (Target_x86_64): Derive from Target_freebsd rather than
12409 Sized_target.
12410 (Target_selector_x86_64): Derive from Target_selector_freebsd
12411 rather than Target_selector.
12412 * target.h (class Target): Add adjust_elf_header and
12413 do_adjust_elf_header.
12414 * output.cc (Output_file_header:: do_sized_write): Call target
12415 adjust_elf_header routine.
12416 * configure.tgt: Set targ_osabi.
12417 * configure.ac: Define GOLD_DEFAULT_OSABI.
12418 * parameters.cc (Parameters::default_target): Pass
12419 GOLD_DEFAULT_OSABI to select_target.
12420 * target-select.h (class Target_selector): Make instantiate_target
12421 protected rather than private.
12422 * Makefile.am (HFILES): Add freebsd.h.
12423 * configure, Makefile.in, config.in: Rebuild.
12424
cb010894
ILT
12425 * merge.cc (do_add_input_section): Correct pend value. Change
12426 message about last entry not being null terminated from error to
12427 warning.
12428
0e879927
ILT
124292009-03-20 Mikolaj Zalewski <mikolajz@google.com>
12430
12431 * incremental.cc: New file.
12432 * Makefile.am (CCFILES): Add incremental.cc.
12433 * Makefile.in: Rebuild.
12434
41105937
PP
124352009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
12436
12437 * layout.cc (Layout::output_section_name): Preserve names
12438 of '.note.' sections.
e1df38aa 12439
60439920
ILT
124402009-03-19 Ian Lance Taylor <iant@google.com>
12441
12442 * descriptors.cc (Descriptors::open): Check that the options are
12443 valid before using them.
12444
0d371ad3
ILT
124452009-03-18 Ian Lance Taylor <iant@google.com>
12446
12447 * script-sections.h: Include <list>.
12448 (class Script_sections): Change Sections_elements from std::vector
12449 to std::list. Typedef public Elements_iterator. Add
12450 orphan_section_placement_, data_segment_align_start_, and
12451 saw_data_segment_align_ fields. Remove data_segment_align_index_
12452 field.
12453 * script-sections.cc (class Orphan_section_placement): New class.
12454 (class Sections_element): Add virtual functions is_relro and
12455 orphan_section_init. Remove virtual function place_orphan_here.
12456 (class Output_section_definition): Add is_relro and
12457 orphan_section_init. Remove place_orphan_here.
12458 (class Orphan_output_section): Likewise.
12459 (Script_sections::Script_sections): Update for field changes.
12460 (Script_sections::data_segment_align): Set saw_data_segment_align_
12461 and data_segment_align_start_, not data_segment_align_index.
12462 (Script_sections::data_segment_relro_end): Check
12463 saw_data_segment_align_. Use data_segment_align_start_ rather
12464 than data_segment_align_index_.
12465 (Script_sections::place_orphan): Rewrite to use
12466 Orphan_section_placement.
12467
9201d894
ILT
124682009-03-17 Ian Lance Taylor <iant@google.com>
12469
9c5b8369
ILT
12470 * archive.cc (Archive::add_symbols): Check for a version attached
12471 to the symbol name in the archive map.
12472 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
12473 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
12474 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
12475 (ver_test_11.a): New target.
12476 * testsuite/Makefile.in: Rebuild.
12477
9201d894
ILT
12478 * configure.ac: Check for chsize and posix_fallocate. Replace
12479 ftruncate.
12480 * ftruncate.c: New file, from gnulib.
12481 * output.cc (posix_fallocate): Define dummy version if not
12482 HAVE_POSIX_FALLOCATE.
12483 (Output_file::map): Call posix_fallocate rather than lseek and
12484 write.
12485 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
12486 * configure, Makefile.in, config.in: Rebuild.
12487
ef4ab7a8 124882009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 12489
ef4ab7a8
PP
12490 * layout.h (Layout::create_note): Add section_name parameter.
12491 * layout.cc (Layout::create_note): Likewise.
12492 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 12493
8c500701
ILT
124942009-03-17 Ian Lance Taylor <iant@google.com>
12495
e85b18e1
ILT
12496 * descriptors.cc: Include "options.h".
12497 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
12498 (Descriptors::open): Always use O_CLOEXEC when opening a new
12499 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
12500 then set FD_CLOEXEC.
12501
9efe6174
ILT
12502 * sparc.cc (class Target_sparc): Add has_got_section.
12503 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
12504 make sure we have a GOT section.
12505
12506 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
12507 (Target_sparc::Scan::local): Likewise.
12508 (Target_sparc::Scan::global): Likewise.
12509 (Target_sparc::Relocate::relocate): Likewise.
12510 (Target_sparc::Relocate::relocate_tls): Likewise.
12511
8c500701
ILT
12512 * symtab.cc (Symbol_table::define_default_version): New function,
12513 broken out of add_from_object.
12514 (Symbol_table::add_from_object): Call define_default_version.
12515 (Symbol_table::define_special_symbol): Add resolve_oldsym
12516 parameter. Change all callers. If the version for a symbol comes
12517 from a version script, resolve it with the symbol with the same
12518 name with no version. Also add the symbol without a version if
12519 appropriate.
12520 (do_define_in_output_data): If resolving with oldsym, don't delete
12521 sym.
12522 (do_define_in_output_segment): Likewise.
12523 (do_define_as_constant): Likewise.
12524 * symtab.h (class Symbol_table): Update declarations.
12525
f1ed28fb
ILT
125262009-03-13 Ian Lance Taylor <iant@google.com>
12527
15f8229b
ILT
12528 * readsyms.cc (Read_symbols::incompatible_warning): New function.
12529 (Read_symbols::requeue): New function.
12530 (Read_symbols::do_read_symbols): If make_elf_object fails because
12531 the target type is not configured, and the file was searched for,
12532 issue a warning and retry with the next directory.
12533 (Add_symbols::run): If the file has an incompatible format, and
12534 it was searched for, requeue the Read_symbols task. On error,
12535 release the object.
12536 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
12537 dirindex parameter to constructor. Change all callers. Declare
12538 incompatible_warning and requeue.
12539 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
12540 input_argument_ and input_group_ fields. Add them to
12541 constructor. Change all callers.
12542 (class Read_script): Add dirindex_ field. Add it to constructor.
12543 Change all callers.
12544 * archive.cc (Archive::setup): Remove input_objects parameter.
12545 Change all callers.
12546 (Archive::get_file_and_offset): Likewise.
12547 (Archive::read_all_symbols): Likewise.
12548 (Archive::read_symbols): Likewise.
12549 (Archive::get_elf_object_for_member): Remove input_objects
12550 parameter. Add punconfigured parameter. Change all callers.
12551 (Archive::add_symbols): Change return type to bool. Check return
12552 value of include_member.
12553 (Archive::include_all_members): Likewise.
12554 (Archive::include_member): Change return type to bool. Return
12555 false if first included object has incompatible target. Set
12556 included_member_ field.
12557 (Add_archive_symbols::run): If add_symbols returns false, requeue
12558 Read_symbols task.
12559 * archive.h (class Archive): Add included_member_ field.
12560 Initialize it in constructor. Add input_file and searched_for
12561 methods. Update declarations.
12562 (class Add_archive_symbols): Add dirpath_, dirindex_, and
12563 input_argument_ fields. Add them to constructor. Change all
12564 callers.
12565 * script.cc: Include "target-select.h".
12566 (class Parser_closure): Add skip_on_incompatible_target_ and
12567 found_incompatible_target_ fields. Add
12568 skip_on_incompatible_target parameter to constructor. Change all
12569 callers. Add methods skip_on_incompatible_target,
12570 clear_skip_on_incompatible_target, found_incompatible_target, and
12571 set_found_incompatible_target.
12572 (read_input_script): Add dirindex parameter. Change all callers.
12573 If parser finds an incompatible target, requeue Read_symbols
12574 task.
12575 (script_set_symbol): Clear skip_on_incompatible_target in
12576 closure.
12577 (script_add_assertion, script_parse_option): Likewise.
12578 (script_start_sections, script_add_phdr): Likewise.
12579 (script_check_output_format): New function.
12580 * script.h (read_input_script): Update declaration.
12581 * script-c.h (script_check_output_format): Declare.
12582 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
12583 (ignore_cmd): Remove OUTPUT_FORMAT.
12584 * fileread.cc (Input_file::Input_file): Add explicit this.
12585 (Input_file::will_search_for): New function.
12586 (Input_file::open): Add pindex parameter. Change all callers.
12587 * fileread.h (class Input_file): Add input_file_argument method.
12588 Declare will_search_for. Update declarations.
12589 * object.cc (make_elf_object): Add punconfigured parameter.
12590 Change all callers.
12591 * object.h (class Object): Make input_file public. Add
12592 searched_for method.
12593 (make_elf_object): Update declaration.
12594 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
12595 restart search.
12596 * dirsearch.h (class Dirsearch): Update declaration.
12597 * options.h (class General_options): Add --warn-search-mismatch.
12598 * parameters.cc (Parameters::is_compatible_target): New function.
12599 * parameters.h (class Parameters): Declare is_compatible_target.
12600 * workqueue.cc (Workqueue::add_blocker): New function.
12601 * workqueue.h (class Workqueue): Declare add_blocker.
12602
f1ed28fb
ILT
12603 * fileread.cc (Input_file::open): Remove options parameter.
12604 Change all callers.
12605 (Input_file::open_binary): Likewise.
12606 * script.cc (read_input_script): Likewise.
12607 * readsyms.h (class Read_symbols): Remove options_ field. Remove
12608 options parameter from constructor. Change all callers.
12609 (class Read_script): Likewise.
12610 * fileread.h (class Input_file): Update declarations.
12611 * script.h (read_input_script): Update declaration.
12612
34dd024a
NC
126132009-03-10 Nick Clifton <nickc@redhat.com>
12614
12615 * po/es.po: New Spanish translation.
12616
6d71b17c
CC
126172009-03-06 Cary Coutant <ccoutant@google.com>
12618
12619 * options.cc (parse_short_option): Keep dash_z from registering itself.
12620
031cdbed
ILT
126212009-03-03 Ian Lance Taylor <iant@google.com>
12622
12623 PR 9918
12624 * target-reloc.h (relocate_section): Pass output_section to
12625 relocate.
12626 * i386.cc (Target_i386::should_apply_static_reloc): Add
12627 output_section parameter. Change all callers.
12628 (Target_i386::Relocate::relocate): Add output_section parameter.
12629 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
12630 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
12631 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
12632 * testsuite/two_file_shared.sh: New script.
12633 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
12634 (check_DATA): Add two_file_shared.dbg.
12635 (two_file_shared.dbg): New target.
12636 * testsuite/Makefile.in: Rebuild.
12637
15d5fa16
ILT
126382009-03-01 Ian Lance Taylor <iant@google.com>
12639
12640 * configure.ac: Check for byteswap.h.
12641 * configure: Rebuild.
12642 * config.in: Rebuild.
12643
8a4c0b0d
ILT
126442009-03-01 Mikolaj Zalewski <mikolajz@google.com>
12645
12646 * layout.cc (Layout::find_or_add_kept_section): New function.
12647 (Layout::add_comdat): Removed.
12648 * layout.h (struct Kept_section): Move out of class Layout.
12649 Remove trailing underscores from field names. Add group_sections
12650 field. Rename group_ field to is_group. Change all uses.
12651 (class Layout): Declare find_or_add_kept_section, not add_comdat.
12652 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
12653 comdat_groups_ field.
12654 (Sized_relobj::include_section_group): Use
12655 find_or_add_kept_section and Kept_section::group_sections.
12656 (Sized_relobj::include_linkonce_section): Likewise.
12657 * object.cc (class Sized_relobj): Don't define Comdat_group or
12658 Comdat_group_table. Remove find_comdat_group and
12659 add_comdat_group. Remove comdat_groups_ field.
12660 * plugin.cc (include_comdat_group): Use
12661 Layout::find_or_add_kept_section.
12662
b4ecf66b
ILT
126632009-02-28 Ian Lance Taylor <iant@google.com>
12664
14359ca0
ILT
12665 * README: --gc-sections and map files are now supported. Document
12666 some build requirements.
12667
b4ecf66b
ILT
12668 PR 6992
12669 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
12670 relocatable link set the value of the section symbol to zero.
12671 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
12672 relocatable link don't include the section address in the local
12673 symbol value.
12674
0602e05a
ILT
126752009-02-27 Ian Lance Taylor <iant@google.com>
12676
fd9d194f
ILT
12677 PR 6811
12678 * options.h (class Search_directory): Add is_system_directory.
12679 (class General_options): Declare is_in_system_directory.
12680 * options.cc (get_relative_sysroot): Make static.
12681 (get_default_sysroot): Make static.
12682 (General_optoins::is_in_system_directory): New function.
12683 * fileread.cc (Input_file::is_in_system_directory): New function.
12684 * fileread.h (class Input_file): Declare is_in_system_directory.
12685 * object.h (class Object): Add is_in_system_directory.
12686 (class Input_objects): Remove system_library_directory_ field.
12687 * object.cc (Input_objects::add_object): Don't set
12688 system_library_directory_.
12689 (input_objects::found_in_system_library_directory): Remove.
12690 * symtab.cc (Symbol_table::write_globals): Remove input_objects
12691 parameter. Change all callers.
12692 (Symbol_table::sized_write_globals): Likewise.
12693 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
12694 Call Object::is_in_system_directory.
12695 * symtab.h (class Symbol_table): Update declarations.
12696
61edd21f
ILT
12697 PR 5990
12698 * descriptors.h (Open_descriptor): Add is_on_stack field.
12699 * descriptors.cc (Descriptors::open): If the descriptor is on the
12700 top of the stack, remove it. Initialize is_on_stack field.
12701 (Descriptors::release): Only add pod to stack if it is not on the
12702 stack already.
12703 (Descriptors::close_some_descriptor): Clear stack_next and
12704 is_on_stack fields.
12705
e29e076a
ILT
12706 PR 7091
12707 * output.cc (Output_section::find_starting_output_address): Rename
12708 from starting_output_address; add PADDR parameter; change return
12709 type.
12710 * output.h (class Output_section): Declare
12711 find_starting_output_address instead of starting_output_address.
12712 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
12713 section symbol for which we can't find a merge section.
12714
0602e05a
ILT
12715 PR 9836
12716 * symtab.cc (Symbol_table::add_from_object): If the visibility is
12717 hidden or internal, force the symbol to be local.
12718 * resolve.cc (Symbol::override_visibility): Define.
12719 (Symbol::override_base): Use override_visibility.
12720 (Symbol_table::resolve): Likewise.
12721 (Symbol::override_base_with_special): Likewise.
12722 (Symbol_table::override_with_special): If the visibility is hidden
12723 or internal, force the symbol to be local.
12724 * symtab.h (class Symbol): Add set_visibility and
12725 override_visibility.
12726 * testsuite/ver_test_1.sh: New file.
12727 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
12728 (check_DATA): Add ver_test_1.syms.
12729 (ver_test_1.syms): New target.
12730 * testsuite/Makefile.in: Rebuild.
12731
401a9a73
CC
127322009-02-25 Cary Coutant <ccoutant@google.com>
12733
12734 * layout.cc (Layout::choose_output_section): Don't rename sections
12735 when using a linker script that has a SECTIONS clause.
12736 * Makefile.in: Regenerate.
12737
12738 * testsuite/Makefile.am (script_test_5.sh): New test case.
12739 * testsuite/Makefile.in: Regenerate.
12740 * testsuite/script_test_5.cc: New file.
12741 * testsuite/script_test_5.sh: New file.
12742 * testsuite/script_test_5.t: New file.
12743
f488e4b0
CC
127442009-02-13 Rafael Avila de Espindola <espindola@google.com>
12745
12746 * archive.cc (Archive::include_member): Update calls to add_symbols.
12747 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
12748 the Layout argument.
12749 * dynobj.h (do_add_symbols): Add the Layout argument.
12750 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
12751 Layout argument.
12752 * object.h (Object::add_symbols): Add the Layout argument.
12753 (Object::do_add_symbols): Add the Layout argument.
12754 (Sized_relobj::do_add_symbols): Add the Layout argument.
12755 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
12756 Unify the two versions.
12757 (Add_plugin_symbols): Remove.
12758 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
12759 (Sized_pluginobj::do_add_symbols): Unify the two versions.
12760 (Add_plugin_symbols): Remove.
12761 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
12762 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
12763 (Add_symbols::run): Make it work with Pulginobj.
12764
89dd1680
ILT
127652009-02-06 Ian Lance Taylor <iant@google.com>
12766
12767 * object.cc (Sized_relobj::do_layout): Make info message start
12768 with lower case letter.
12769
266d0a74
ILT
127702009-02-06 Mikolaj Zalewski <mikolajz@google.com>
12771
602b464e
ILT
12772 * binary.cc: Fix file comment.
12773
266d0a74
ILT
12774 * options.h (enum Incremental_disposition): Define.
12775 (class General_options): Add new options: --incremental,
12776 --incremental_changed, --incremental_unchanged,
12777 --incremental_unknown. Add incremental_disposition_ and
12778 implicit_incremental_ fields.
12779 (General_options::incremental_disposition): New function.
12780 (class Position_dependent_options): Add incremental_disposition
12781 option.
12782 (Position_dependent_options::copy_from_options): Set incremental
12783 dispositions.
12784 * options.cc (General_options::parse_incremental_changed): New
12785 function.
2e702c99
RM
12786 (General_options::parse_incremental_unchanged): New function.
12787 (General_options::parse_incremental_unknown): New function.
12788 (General_options::General_options): Initialize new fields
266d0a74 12789 incremental_disposition_ and implicit_incremental_.
2e702c99 12790 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
12791 without --incremental.
12792
f073bbf7
CD
127932009-02-06 Chris Demetriou <cgd@google.com>
12794
12795 * gold.h (gold_undefined_symbol): Change to take only a Symbol
12796 pointer and to report location as the file name associated with
12797 the symbol.
12798 (gold_undefined_symbol_at_location): New function to replace the
12799 old gold_undefined_symbol functionality.
12800 * target-reloc.h (relocate_section): Update to use
12801 gold_undefined_symbol_at_location.
12802 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
12803 Call gold_undefined_symbol function rather than gold_error.
12804 * errors.h (Errors::undefined_symbol): Take location as a
12805 string, rather than calculating it from a relocation.
12806 * errors.cc (Errors::fatal): Print "fatal error:" before the
12807 formatted message.
12808 (Errors::error, Errors::error_at_location): Print "error: "
12809 before the formatted message.
12810 (Errors::undefined_symbol): Take location as a string, rather
12811 than calculating it from a relocation.
12812 (gold_undefined_symbol_at_location): New function akin to
12813 old gold_undefined_symbol, calculates location from relocation.
12814 (gold_undefined_symbol): Change to take only a Symbol pointer
12815 and to report location as the file name associated with the symbol.
12816 * testsuite/debug_msg.sh: Update for changed error messages.
12817 * testsuite/undef_symbol.sh: Likewise.
12818
8e94a90c
ILT
128192009-02-04 Duncan Sands <baldrick@free.fr>
12820
12821 PR 9812
12822 * reduced_debug_output.h
12823 (Output_reduced_debug_abbrev_section::failed): Use format for
12824 gold_warning.
12825 (Output_reduced_debug_info_section::faild): Likewise.
12826
88a0e15b
ILT
128272009-01-31 Mikolaj Zalewski <mikolajz@google.com>
12828
12829 * script.cc (Lazy_demangler): New class.
2e702c99 12830 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
12831 symbol only once.
12832
5efc7cd2
CC
128332009-01-29 Cary Coutant <ccoutant@google.com>
12834
12835 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
12836 to __tls_get_addr.
12837 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
12838
e0ebcf42
ILT
128392009-01-28 Ian Lance Taylor <iant@google.com>
12840
5efc7cd2 12841 * version.cc (version_string): Bump to 1.9.
75fe7426 12842
e0ebcf42
ILT
12843 * gold.h: Include <cstring> and <stdint.h>.
12844 * version.cc: Include <cstdio>.
12845 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
12846 warning.
12847 * reduced_debug_output.cc (insert_into_vector): Rename from
12848 Insert_into_vector; change all callers. Use Swap_unaligned to
12849 avoid aliasing issue; remove union since it is unnecessary.
12850
8e2813be 128512009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
12852
12853 * Makefile.am (CCFILES): Add gc.cc.
12854 (HFILES): Add gc.h.
12855 * Makefile.in: Regenerate.
12856 * gold.cc (Gc_runner): New class.
12857 (queue_initial_tasks): Call garbage collection related tasks
12858 when corresponding options are invoked.
12859 (queue_middle_gc_tasks): New function.
12860 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
12861 processed early before laying out sections during garbage collection.
12862 * gold.h (queue_middle_gc_tasks): New function.
12863 (is_prefix_of): Move from "layout.cc".
12864 * i386.cc (Target_i386::gc_process_relocs): New function.
12865 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
12866 * main.cc (main): Create object of class "Garbage_collection".
12867 * object.cc (Relobj::copy_symbols_data): New function.
12868 (Relobj::is_section_name_included): New function.
e1df38aa
NC
12869 (Sized_relobj::do_layout): Allow this function to be called twice
12870 during garbage collection and defer layout of section during the
6d03d481
ST
12871 first call.
12872 * object.h (Relobj::get_symbols_data): New function.
12873 (Relobj::is_section_name_included): New function.
12874 (Relobj::copy_symbols_data): New function.
12875 (Relobj::set_symbols_data): New function.
12876 (Relobj::get_relocs_data): New function.
12877 (Relobj::set_relocs_data): New function.
12878 (Relobj::is_output_section_offset_invalid): New pure virtual function.
12879 (Relobj::gc_process_relocs): New function.
12880 (Relobj::do_gc_process_relocs): New pure virtual function.
12881 (Relobj::sd_): New data member.
12882 (Sized_relobj::is_output_section_offset_invalid): New function.
12883 (Sized_relobj::do_gc_process_relocs): New function.
12884 * options.h (General_options::gc_sections): Modify to not be a no-op.
12885 (General_options::print_gc_sections): New option.
12886 * plugin.cc (Plugin_finish::run): Remove function call to
12887 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
12888 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
12889 * reloc.cc (Read_relocs::run): Add task to process relocs and
12890 determine unreferenced sections when doing garbage collection.
12891 (Gc_process_relocs): New class.
12892 (Sized_relobj::do_gc_process_relocs): New function.
12893 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
12894 sections that are garbage collected.
12895 * reloc.h (Gc_process_relocs): New class.
12896 * sparc.cc (Target_sparc::gc_process_relocs): New function.
12897 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
12898 symbols whose corresponding sections are garbage collected.
12899 (Symbol_table::Symbol_table): Add new parameter for the garbage
12900 collection object.
12901 (Symbol_table::gc_mark_undef_symbols): New function.
12902 (Symbol_table::gc_mark_symbol_for_shlib): New function.
12903 (Symbol_table::gc_mark_dyn_syms): New function.
12904 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
12905 as garbage.
12906 (Symbol_table::add_from_object): Likewise.
12907 (Symbol_table::add_from_relobj): When building shared objects, do not
12908 treat externally visible symbols as garbage.
12909 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
12910 table information for static and relocatable links.
12911 * symtab.h (Symbol_table::set_gc): New function.
12912 (Symbol_table::gc): New function.
12913 (Symbol_table::gc_mark_undef_symbols): New function.
12914 (Symbol_table::gc_mark_symbol_for_shlib): New function.
12915 (Symbol_table::gc_mark_dyn_syms): New function.
12916 (Symbol_table::gc_): New data member.
e1df38aa 12917 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
12918 function.
12919 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
12920 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
12921
3b293544
CF
129222009-01-20 Chris Faylor <me.sourceware@sourceware.org>
12923
12924 * options.h (General_options::gc_sections): Define as a no-op for now.
12925 (General_options::no_keep_memory): Ditto.
12926 (General_options::Bshareable): Define.
12927 * options.cc (General_options::finalize): Honor -Bshareable.
12928
83d22aa8
AS
129292009-01-20 Andreas Schwab <schwab@suse.de>
12930
12931 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
12932 read the value in the contents, since we don't use it. Use the
12933 template endianness when writing.
12934 (Relocate::relocate): Use it for R_PPC_REL16_HA.
12935
cd536b21
AS
129362009-01-19 Andreas Schwab <schwab@suse.de>
12937
12938 * configure.tgt (powerpc64-*): Fix targ_obj.
12939
99e9a495
ILT
129402009-01-15 Ian Lance Taylor <iant@google.com>
12941
12942 * object.cc (Sized_relobj::write_local_symbols): Don't write out
12943 local symbols when stripping all symbols.
12944
bbbfea06
CC
129452009-01-14 Cary Coutant <ccoutant@google.com>
12946
99e9a495 12947 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 12948
0f7c0701
CC
129492009-01-14 Cary Coutant <ccoutant@google.com>
12950
12951 * archive.cc (Archive::get_elf_object_for_member): Remove call
12952 to File_read::claim_for_plugin.
12953 * descriptors.cc (Descriptors::open): Remove reference to
12954 is_claimed.
12955 (Descriptors::claim_for_plugin): Remove.
12956 * descriptors.h (Descriptors::claim_for_plugin): Remove.
12957 (Descriptors::is_claimed): Remove.
12958 (claim_descriptor_for_plugin): Remove.
12959 * fileread.cc (File_read::claim_for_plugin): Remove.
12960 * fileread.h (File_read::claim_for_plugin): Remove.
12961 (File_read::descriptor): Reopen descriptor if necessary.
12962 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
12963 (Plugin_manager::all_symbols_read): Add task parameter. Change
12964 all callers.
12965 (Plugin_manager::get_input_file): New function.
12966 (Plugin_manager::release_input_file): New function.
12967 (Pluginobj::Pluginobj): Add filesize parameter and initialize
12968 corresponding data member.
12969 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
12970 and pass to base constructor. Change all callers.
12971 (get_input_file, release_input_file): New functions.
12972 (make_sized_plugin_object): Add filesize parameter. Change all callers.
12973 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
12974 (Plugin_manager::all_symbols_read): Add task parameter.
12975 (Plugin_manager::get_input_file): New function.
12976 (Plugin_manager::release_input_file): New function.
12977 (Plugin_manager::task_): New data member.
12978 (Pluginobj::Pluginobj): Add filesize parameter.
12979 (Pluginobj::filename): New function.
12980 (Pluginobj::descriptor): New function.
12981 (Pluginobj::filesize): New function.
12982 (Pluginobj::filesize_): New data member.
12983 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
12984 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
12985 File_read::claim_for_plugin; use Object::unlock to unlock the file.
12986
12987 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
12988 with archive libraries.
12989 * testsuite/Makefile.in: Regenerate.
12990 * testsuite/plugin_test.c (struct sym_info): New type.
12991 (get_input_file, release_input_file): New static variables.
12992 (onload): Capture new transfer vector entries.
12993 (claim_file_hook): Stop reading at end of file according to filesize.
12994 Factor out parsing of readelf output into separate function.
12995 (all_symbols_read_hook): Exercise get_input_file and release_input_file
12996 APIs and get the source file name from the symbol table. Convert
12997 source file name to corresponding object file name. Print info
12998 message when adding new input files.
12999 (parse_readelf_line): New function.
13000 * testsuite/plugin_test_1.sh: Add checks for new info messages.
13001 * testsuite/plugin_test_2.sh: Likewise.
13002 * testsuite/plugin_test_3.sh: Likewise.
13003 * testsuite/plugin_test_4.sh: New test case.
13004
62a6d109
ILT
130052009-01-07 Ian Lance Taylor <iant@google.com>
13006
13007 * version.cc (version_string): Bump to 1.8.
13008
483620e8
CC
130092008-12-23 Cary Coutant <ccoutant@google.com>
13010
13011 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
13012 * plugin.cc (Plugin_manager::finish): Rename as
13013 layout_deferred_objects. Move cleanup to separate function.
13014 (Plugin_manager::cleanup): New function.
13015 (Plugin_finish::run): Call layout_deferred_objects and cleanup
13016 separately.
13017 * plugin.h (Plugin_manager::finish): Rename as
13018 layout_deferred_objects.
13019 (Plugin_manager::cleanup): New function.
13020 (Plugin_manager::cleanup_done): New field.
13021
d66a9eb3
CC
130222008-12-23 Cary Coutant <ccoutant@google.com>
13023
13024 * plugin.cc (is_visible_from_outside): New function.
13025 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
13026 so we don't return "IR only" status for exported symbols or -r links.
13027
13028 * testsuite/Makefile.am (plugin_test_3): New test case.
13029 * testsuite/Makefile.in: Regenerate.
13030 * testsuite/plugin_test_3.sh: New file.
13031
5995b570
CC
130322008-12-22 Cary Coutant <ccoutant@google.com>
13033
13034 * object.cc (Sized_relobj::layout_section): New function.
13035 (Sized_relobj::do_layout): Defer layout of input sections until after
13036 plugin has provided replacement files.
13037 (Sized_relobj::do_layout_deferred_sections): New function.
13038 * object.h (Relobj::set_section_offset): Remove virtual keyword.
13039 (Relobj::layout_deferred_sections): New function.
13040 (Relobj::do_layout_deferred_sections): New function.
13041 (Sized_relobj::do_layout_deferred_sections): New function.
13042 (Sized_relobj::layout_section): New function.
13043 (Sized_relobj::Deferred_layout): New structure.
13044 (Sized_relobj::deferred_layout_): New field.
13045 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
13046 Change all callers. Layout deferred sections.
13047 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
13048 references.
13049 (Plugin_hook::run): Move code from do_plugin_hook inline.
13050 (Plugin_hook::do_plugin_hook): Remove.
13051 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
13052 (Plugin_manager::finish): Renamed, was cleanup.
13053 (Plugin_manager::should_defer_layout): New function.
13054 (Plugin_manager::add_deferred_layout_object): New function.
13055 (Plugin_manager::Deferred_layout_list): New type.
13056 (Plugin_manager::deferred_layout_objects_): New field.
13057 (Plugin_hook::do_plugin_hook): Remove.
13058
ee769c88
ILT
130592008-12-17 Ian Lance Taylor <iant@google.com>
13060
13061 * options.h (class General_options): Add --no case for
13062 --export-dynamic.
13063
abc8dcba
CC
130642008-12-16 Cary Coutant <ccoutant@google.com>
13065
13066 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
13067 vector.
13068 (Plugin_manager::claim_file): Create plugin object even if
13069 plugin did not call the add_symbols callback.
13070 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
13071 asking for more symbols than were added.
13072 * testsuite/Makefile.am (plugin_test_1): Add test case with
13073 no global symbols.
13074 (empty.syms): New target.
13075 * testsuite/Makefile.in: Regenerate.
13076 * testsuite/plugin_test.c (claim_file_hook): Add new debug
13077 message. Don't call add_symbols if no globals.
13078 (all_symbols_read_hook): Don't provide replacement for empty
13079 claimed file.
13080
b0074644
ILT
130812008-12-12 Ian Lance Taylor <iant@google.com>
13082
68943102
ILT
13083 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
13084 r_type == 0 for a local symbol with r_sym == 0.
13085 (scan_relocatable_relocs): Pass r_sym to
13086 local_non_section_strategy.
13087 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
13088 r_sym parameter.
13089
b0074644
ILT
13090 * configure.ac: Update test for TLS descriptors: they are
13091 supported as of glibc 2.9.
13092 * configure: Rebuild.
13093
c2508178
ILT
130942008-12-11 Ian Lance Taylor <iant@google.com>
13095
13096 PR 7091
13097 * target-reloc.h (Default_scan_relocatable_relocs): For each
13098 function, map r_type == 0 to RELOC_DISCARD.
13099
2756a258
CC
131002008-12-10 Cary Coutant <ccoutant@google.com>
13101
13102 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
13103 object to override a kept COMDAT group from a plugin object.
13104
bb6f53d3
ILT
131052008-12-09 Ian Lance Taylor <iant@google.com>
13106
fbc558e1
ILT
13107 PR 7088
13108 * yyscript.y (file_cmd): Handle INPUT.
13109
bb6f53d3
ILT
13110 * testsuite/initpri1.c: Change all declarations to be full
13111 prototypes by adding void, to avoid compiler warnings.
13112
4674ecfc
CC
131132008-12-05 Rafael Avila de Espindola <espindola@google.com>
13114
13115 * options.cc (General_options::parse_plugin_opt): New.
13116 (General_options::add_plugin): The argument now is just the filename.
13117 (General_options::add_plugin_option): New.
13118 * options.h (plugin_opt): New.
13119 (add_plugin): Change argument name.
13120 (add_plugin_option): New.
13121 * plugin.cc (Plugin::load): Don't parse the plugin option.
13122 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
13123 (Plugin::add_option): New.
13124 (Plugin::args_): Change type.
13125 (Plugin::filename_): New.
13126 (Plugin_manager::add_plugin_option): New.
13127 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
13128 * testsuite/Makefile.in: Regenerate.
13129
fd06b4aa
CC
131302008-12-05 Cary Coutant <ccoutant@google.com>
13131
13132 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
13133 Handle --strip-lto-sections option.
13134 * options.h (strip_lto_sections): New option.
13135
6c52134c
CC
131362008-12-01 Cary Coutant <ccoutant@google.com>
13137
13138 * plugin.cc (ld_plugin_message): Change format parameter to const.
13139 Fix mismatch between new[] and delete.
13140
a45248e0
CC
131412008-11-14 Cary Coutant <ccoutant@google.com>
13142
13143 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
13144 instead of -1U.
13145
c82fbeee
CS
131462008-11-05 Craig Silverstein <csilvers@google.com>
13147
13148 * options.cc (General_options::parse_dynamic_list): New function.
13149 * options.h (General_options): New flags dynamic_list,
13150 dynamic_list_data, dynamic_list_cpp_new, and
13151 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
13152 (General_options::in_dynamic_list): New function.
13153 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
13154 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
13155 (Lex::can_continue_name): Likewise.
13156 (yylex): Likewise.
13157 (read_script_file): New parameter script_options.
13158 (read_dynamic_list): New function.
13159 (Script_options::define_dynamic_list): New function.
13160 (dynamic_list_keyword_parsecodes): New variable.
13161 (dynamic_list_keywords): New variable.
13162 * script.h (Script_options::define_dynamic_list): New function
13163 prototype.
13164 (read_dynamic_list): New function prototype.
13165 * symtab.cc (strprefix): New macro.
13166 (Symbol::should_add_dynsym_entry): Support dynamic_list,
13167 dynamic_list_data, dynamic_list_cpp_new, and
13168 dynamic_list_cpp_typeinfo.
13169 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
13170 (dynamic_list_expr): New rule.
13171 (dynamic_list_nodes): Likewise.
13172 (dynamic_list_node): Likewise.
13173 * testsuite/Makefile.am (dynamic_list): New test.
13174 * testsuite/Makefile.in: Regenerated.
13175 * testsuite/dynamic_list.t: New file.
13176 * testsuite/dynamic_list.sh: New file.
13177
e0bb29a5
CS
131782008-11-05 Craig Silverstein <csilvers@google.com>
13179
13180 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
13181 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
13182 (t11_last): Likewise.
13183 * testsuite/ver_test_6.c (main): Likewise.
13184
4e1e25e0
CC
131852008-10-07 Cary Coutant <ccoutant@google.com>
13186
13187 * options.c (General_options::finalize): Add check for -static and
13188 -shared.
13189 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
13190 is not empty.
13191
92f03fcb
CC
131922008-10-02 Cary Coutant <ccoutant@google.com>
13193
13194 * plugin.cc (make_sized_plugin_object): Fix conditional
13195 compilation to work when not all targets are enabled.
13196
fbd8a257
CC
131972008-09-29 Cary Coutant <ccoutant@google.com>
13198
13199 * archive.cc (Archive::get_file_and_offset): Use filename instead
13200 of name to get library path.
13201 (Archive::include_member): Unlock external member of a thin archive.
13202
13203 * testsuite/Makefile.am (TEST_AR): New variable.
13204 (thin_archive_test_1): New test.
13205 (thin_archive_test_2): New test.
81636b3f
CC
13206 * testsuite/Makefile.in: Regenerate.
13207 * testsuite/thin_archive_main.cc: New file.
13208 * testsuite/thin_archive_test_1.cc: New file.
13209 * testsuite/thin_archive_test_2.cc: New file.
13210 * testsuite/thin_archive_test_3.cc: New file.
13211 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 13212
eff45813
CC
132132008-09-29 Cary Coutant <ccoutant@google.com>
13214
13215 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
13216 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
13217 instead of -1U.
13218 (Sized_relobj::do_finalize_local_symbols): Likewise.
13219 (Sized_relobj::map_to_kept_section): Likewise.
13220 * object.h (Sized_relobj::invalid_address): New constant.
13221 (Sized_relobj::do_output_section_offset): Check for invalid_address
13222 and return -1ULL.
13223 * output.cc (Output_reloc::local_section_offset): Use constant
13224 invalid_address instead of -1U.
13225 (Output_reloc::get_address): Likewise.
13226 (Output_section::output_address): Change -1U to -1ULL.
13227 * output.h (Output_reloc::invalid_address): New constant.
13228 * reloc.cc (Sized_relobj::write_sections): Use constant
13229 invalid_address instead of -1U.
13230 (Sized_relobj::relocate_sections): Likewise.
13231 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
13232 values for merge sections.
13233 * target-reloc.h (relocate_for_relocatable): Use constant
13234 invalid_address instead of -1U.
13235
89fc3421
CC
132362008-09-19 Cary Coutant <ccoutant@google.com>
13237
13238 Add plugin functionality for link-time optimization (LTO).
13239 * configure.ac (plugins): Add --enable-plugins option.
13240 * configure: Regenerate.
13241 * config.in: Regenerate.
13242 * Makefile.am (LIBDL): New variable.
13243 (CCFILES): Add plugin.cc.
13244 (HFILES): Add plugin.h.
13245 (ldadd_var): Add LIBDL.
13246 * Makefile.in: Regenerate.
13247
13248 * archive.cc: Include "plugin.h".
13249 (Archive::setup): Don't preread archive symbols when using a plugin.
13250 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
13251 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
13252 files.
13253 (Archive::include_member): Add symbols from plugin objects.
13254 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
13255 * descriptors.cc (Descriptors::open): Check for file descriptors
13256 abandoned by plugins.
13257 (Descriptors::claim_for_plugin): New function.
13258 * descriptors.h (Descriptors::claim_for_plugin): New function.
13259 (Open_descriptor::is_claimed): New field.
13260 (claim_descriptor_for_plugin): New function.
13261 * fileread.cc (File_read::claim_for_plugin): New function.
13262 * fileread.h (File_read::claim_for_plugin): New function.
13263 (File_read::descriptor): New function.
13264 * gold.cc: Include "plugin.h".
13265 (queue_initial_tasks): Add task to call plugin hooks for generating
13266 new object files.
13267 * main.cc: Include "plugin.h".
13268 (main): Load plugin libraries.
13269 * object.h (Pluginobj): Declare.
13270 (Object::pluginobj): New function.
13271 (Object::do_pluginobj): New function.
13272 (Object::set_target): New function.
13273 * options.cc: Include "plugin.h".
13274 (General_options::parse_plugin): New function.
13275 (General_options::General_options): Initialize plugins_ field.
13276 (General_options::add_plugin): New function.
13277 * options.h (Plugin_manager): Declare.
13278 (General_options): Add --plugin option.
13279 (General_options::has_plugins): New function.
13280 (General_options::plugins): New function.
13281 (General_options::add_plugin): New function.
13282 (General_options::plugins_): New field.
13283 * plugin.cc: New file.
13284 * plugin.h: New file.
13285 * readsyms.cc: Include "plugin.h".
13286 (Read_symbols::do_read_symbols): Check for archive before checking
13287 for ELF file. Call plugin hooks to claim files.
13288 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
13289 from a real object file; force override when processing replacement
13290 files.
13291 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
13292 (Symbol::init_base_object): Likewise.
13293 (Symbol::init_base_output_data): Likewise.
13294 (Symbol::init_base_output_segment): Likewise.
13295 (Symbol::init_base_constant): Likewise.
13296 (Symbol::init_base_undefined): Likewise.
13297 (Symbol::output_section): Assert that object is not a plugin.
13298 (Symbol_table::add_from_pluginobj): New function.
13299 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
13300 undefined.
13301 (Symbol_table::sized_write_globals): Likewise.
13302 (Symbol_table::add_from_pluginobj): Instantiate template.
13303 * symtab.h (Sized_pluginobj): Declare.
13304 (Symbol::in_real_elf): New function.
13305 (Symbol::set_in_real_elf): New function.
13306 (Symbol::in_real_elf_): New field.
13307 (Symbol_table::add_from_pluginobj): New function.
13308
13309 * testsuite/Makefile.am (AM_CFLAGS): New variable.
13310 (LIBDL): New variable.
13311 (LDADD): Add LIBDL.
13312 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
13313 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
13314 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
13315 (MOSTLYCLEANFILES): Likewise.
13316 * testsuite/Makefile.in: Regenerate.
13317 * testsuite/plugin_test.c: New file.
13318 * testsuite/plugin_test_1.sh: New file.
13319 * testsuite/plugin_test_2.sh: New file.
13320
de31bda5
ILT
133212008-09-16 Ian Lance Taylor <iant@google.com>
13322
9c2d0ef9
ILT
13323 * target-reloc.h (relocate_section): Check whether a symbol is
13324 defined by the ABI before reporting an undefined symbol error.
13325 * target.h (Target::is_defined_by_abi): Make parameter const.
13326 (Target::do_is_defined_by_abi): Likewise.
13327 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
13328 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
13329 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
13330 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
13331 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
13332 * testsuite/Makefile.in: Rebuild.
13333
de31bda5
ILT
13334 * fileread.cc (make_view): Add casts to avoid warning.
13335
9fa33bee
AO
133362008-09-16 Alexandre Oliva <aoliva@redhat.com>
13337
13338 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
13339 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
13340
183fd0e3
AO
133412008-09-16 Alexandre Oliva <aoliva@redhat.com>
13342
13343 * options.h (General_options::output_is_executable): New.
13344 (General_options::output_is_pie): New.
13345 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
13346 for shared libraries.
13347 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
13348
7be8330a
CD
133492008-09-11 Chris Demetriou <cgd@google.com>
13350
13351 * options.h (origin): New -z option.
13352 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
13353 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
13354 in DT_FLAGS_1.
13355
a9caad02
CC
133562008-09-05 Cary Coutant <ccoutant@google.com>
13357
13358 * fileread.cc (File_read::make_view): Add check for attempt to map
13359 beyond end of file.
13360
ae6dce4d
CC
133612008-09-05 Cary Coutant <ccoutant@google.com>
13362
13363 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
13364 explicit instantiations.
13365
d7ab2a47
KVH
133662008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
13367
13368 PR gold/6858
13369 * options.cc (General_options::finalize): Allow undefined symbols
13370 in shlibs if linking -shared.
13371
13372 PR gold/6859
13373 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
13374 symbols as not needing a dynsym entry.
13375
1e52a9c1
CS
133762008-08-20 Craig Silverstein <csilvers@google.com>
13377
13378 * fileread.cc (File_read::open): Do not lock the file unless it
13379 was successfully opened.
13380
d85c80a3
CC
133812008-08-14 Cary Coutant <ccoutant@google.com>
13382
13383 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
13384 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
13385 * testsuite/tls_test.cc (struct int128): 128-bit struct
13386 for testing TLS relocs with non-zero addend.
13387 (v12): New TLS variable.
13388 (t12): New test.
13389 (t_last): Add check for v12.
13390 * testsuite/tls_test.h (t12): New function.
13391 * testsuite/tls_test_main.cc (thread_routine): Call new test.
13392
2d924fd9
ILT
133932008-08-13 Ian Lance Taylor <iant@google.com>
13394
13395 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
13396 set tls_segment_ or relro_segment_.
13397 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
13398 when appropriate.
13399 * output.h (Output_section::clear_is_relro): New function.
13400 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
13401 sections specially even when output_data_ is empty.
13402 (Output_segment::maximum_alignment): When first section is relro,
13403 only force alignment for PT_LOAD segments.
13404 * script.cc (script_data_segment_align): New function.
13405 (script_data_segment_relro_end): New function.
13406 * script-c.h (script_data_segment_align): Declare.
13407 (script_data_segment_relro_end): Declare.
13408 * script-sections.h (class Script_sections): Declare
13409 data_segment_align and data_segment_relro_end. Add fields
13410 segment_align_index_ and saw_relro_end_.
13411 * script-sections.cc (class Sections_element): Add set_is_relro
13412 virtual function. Add new bool* parameter to place_orphan_here.
13413 Add get_output_section virtual function.
13414 (class Output_section_definition): Add set_is_relro. Add new
13415 bool* parameter to place_orphan_here. Add get_output_section.
13416 Add is_relro_ field.
13417 (Output_section_definition::Output_section_definition): Initialize
13418 evaluated_address_, evaluated_load_address, evaluated_addralign_,
13419 and is_relro_ fields.
13420 (Output_section_definition::place_orphan_here): Add is_relro
13421 parameter.
13422 (Output_section_definition::set_section_addresses): Set relro for
13423 output section.
13424 (Output_section_definition::alternate_constraint): Likewise.
13425 (class Orphan_output_section): Add new bool* parameter to
13426 place_orphan_here. Add get_output_section.
13427 (Orphan_output_section::place_orphan_here): Add is_relro
13428 parameter.
13429 (Script_sections::Script_sections): Initialize
13430 data_segment_align_index_ and saw_relro_end_.
13431 (Script_sections::data_segment_align): New function.
13432 (Script_sections::data_segment_relro_end): New function.
13433 (Script_sections::place_orphan): Set or clear is_relro.
13434 (Script_sections::set_section_addresses): Force alignment of first
13435 TLS section.
13436 * yyscript.y (exp): Call script_data_segment_align and
13437 script_data_segment_relro_end.
13438 * testsuite/relro_script_test.t: New file.
13439 * testsuite/relro_test.cc (using_script): Declare.
13440 (t1, t2): Test using_script.
13441 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
13442 (relro_script_test_SOURCES): Define.
13443 (relro_script_test_DEPENDENCIES): Define.
13444 (relro_script_test_LDFLAGS): Define.
13445 (relro_script_test_LDADD): Define.
13446 (relro_script_test.so): New target.
13447 * testsuite/Makefile.in: Rebuild.
13448
f827c9a9
CC
134492008-08-06 Cary Coutant <ccoutant@google.com>
13450
13451 * archive.cc (Archive::total_archives, Archive::total_members)
13452 (Archive::total_members_loaded): New variables.
13453 (Archive::setup): Add parameter. Add option to preread
13454 archive symbols.
13455 (Archive::read_armap): Add counter.
13456 (Archive::get_file_and_offset): New function.
13457 (Archive::get_elf_object_for_member): New function.
13458 (Archive::read_all_symbols): New function.
13459 (Archive::read_symbols): New function.
13460 (Archive::add_symbols): Add counters.
13461 (Archive::include_all_members): Use armap to find members if it's
13462 already built.
13463 (Archive::include_member): Skip reading symbols if already read.
13464 Factored code into Archive::get_file_and_offset and
13465 Archive::get_elf_object_for_member. Changed call to
13466 Mapfile::report_include_archive_member.
13467 (Archive::print_stats): New function.
13468 * archive.h: Declare Object and Read_symbols_data classes.
13469 (Archive::Archive): Add initializers for new members.
13470 (Archive::setup): Add parameter.
13471 (Archive::print_stats): New function.
13472 (Archive::total_archives, Archive::total_members)
13473 (Archive::total_members_loaded): New variables.
13474 (Archive::get_file_and_offset): New function.
13475 (Archive::get_elf_object_for_member): New function.
13476 (Archive::read_all_symbols): New function.
13477 (Archive::read_symbols): New function.
13478 (Archive::Archive_member): New class.
13479 (Archive::members_): New member.
13480 (Archive::num_members_): New member.
13481 * main.cc: Include archive.h.
13482 (main): Call Archive::print_stats.
13483 * mapfile.cc (Mapfile::report_include_archive_member): Delete
13484 archive parameter; member_name is now the fully-decorated name.
13485 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
13486 * options.h: (General_options): Add --preread-archive-symbols option.
13487 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
13488 Archive::setup.
13489
de4c45bd
ILT
134902008-08-04 Ian Lance Taylor <iant@google.com>
13491
13492 * symtab.h (Symbol::use_plt_offset): New function.
13493 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
13494 * powerpc.cc (Relocate::relocate): Likewise.
13495 * sparc.cc (Relocate::relocate): Likewise.
13496 * x86_64.cc (Relocate::relocate): Likewise.
13497 * testsuite/weak_plt.sh: New test.
13498 * testsuite/weak_plt_main.cc: New test.
13499 * testsuite/weak_plt_shared.cc: New test.
13500 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
13501 (check_PROGRAMS): Add weak_plt.
13502 (check_DATA): Add weak_plt_shared.so.
13503 (weak_plt_main_pic.o, weak_plt): New targets.
13504 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
13505 * testsuite/Makefile.in: Rebuild.
13506
13507 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
13508 gcctestdir/ld.
13509 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
13510 * testsuite/Makefile.in: Rebuild.
13511
323ee3f4
AM
135122008-08-04 Alan Modra <amodra@bigpond.net.au>
13513
13514 * Makefile.am (POTFILES.in): Set LC_ALL=C.
13515 * Makefile.in: Regenerate.
13516 * po/POTFILES.in: Regenerate.
13517
7c07ecec
ILT
135182008-07-29 Ian Lance Taylor <iant@google.com>
13519
13520 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
13521 symbols before other symbols.
13522 * testsuite/script_test_2.cc (test_addr): Declare.
13523 (test_addr_alias): Declare.
13524 (main): Check that test_addr and test_addr_alias have the right
cd536b21 13525 values.
7c07ecec
ILT
13526 * testsuite/script_test_2.t: Define test_addr_alias and
13527 test_addr.
13528
5778530e
ILT
135292008-07-24 Ian Lance Taylor <iant@google.com>
13530
2a00e4fb
ILT
13531 PR 5990
13532 * descriptors.cc: New file.
13533 * descriptors.h: New file.
13534 * gold-threads.h (class Hold_optional_lock): New class.
13535 * fileread.cc: Include "descriptors.h".
13536 (File_read::~File_read): Release descriptor rather than closing
13537 it.
13538 (File_read::open) [file]: Call open_descriptor rather than open.
13539 Set is_descriptor_opened_.
13540 (File_read::open) [memory]: Assert that descriptor is not open.
13541 (File_read::reopen_descriptor): New function.
13542 (File_read::release): Release descriptor.
13543 (File_read::do_read): Make non-const. Reopen descriptor.
13544 (File_read::read): Make non-const.
13545 (File_read::make_view): Reopen descriptor.
13546 (File_read::do_readv): Likewise.
13547 * fileread.h (class File_read): Add is_descriptor_opened_ field.
13548 Update declarations.
13549 * layout.cc: Include "descriptors.h".
13550 (Layout::create_build_id): Use open_descriptor rather than open.
13551 * output.cc: Include "descriptors.h".
13552 (Output_file::open): Use open_descriptor rather than open.
13553 * archive.cc (Archive::const_iterator): Change Archive to be
13554 non-const.
13555 (Archive::begin, Archive::end): Make non-const.
13556 (Archive::count_members): Likewise.
13557 * archive.h (class Archive): Update declarations.
13558 * object.h (Object::read): Make non-const.
13559 * Makefile.am (CCFILES): Add descriptors.cc.
13560 (HFILES): Add descriptors.h.
13561 * Makefile.in: Rebuild.
13562
801647d1
ILT
13563 PR 6716
13564 * gold.h: Always include <clocale>. Add Solaris workarounds
13565 following code in binutils/sysdep.h.
13566
5edd166e
ILT
13567 PR 6048
13568 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
13569 this->eh_frame_hdr_ is NULL before using it.
13570
c89ad728
ILT
13571 * dynobj.cc (Versions::Versions): Update comment.
13572
aa86f06b
ILT
13573 * dynobj.cc (Versions::Versions): If there is an soname, use it as
13574 the base version name.
13575
5778530e
ILT
13576 * stringpool.cc (Stringpool_template::add_with_length): Set key to
13577 array size plus one.
13578 (Stringpool_template::set_string_offsets): Subtract one from key
13579 before using it as an array index.
13580 (Stringpool_template::get_offset_with_length): Likewise.
13581 (Stringpool_template::write_to_buffer): Likewise.
13582 * stringpool.h (Stringpool_template::get_offset_from_key):
13583 Likewise.
13584
057ead22
ILT
135852008-07-23 Ian Lance Taylor <iant@google.com>
13586
7f649c59
ILT
13587 PR 6658
13588 * object.h (Merged_symbol_value::value): Do our best to handle a
13589 negative addend.
13590
057ead22
ILT
13591 PR 6647
13592 * script.cc (Version_script_info::get_versions): Don't add empty
13593 version tag to return value.
13594 (Version_script_info::get_symbol_version_helper): Change return
13595 type to bool. Add pversion parameter. Change all callers.
13596 (script_register_vers_node): Don't require a non-NULL tag.
13597 * script.h (class Version_script_info): Update declarations.
13598 (Version_script_info::get_symbol_version): Change return type to
13599 bool. Add version parameter. Change all callers.
13600 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
13601 handling. Handle an empty version from a version script.
13602 (Symbol_table::define_special_symbol): Likewise.
13603 * testsuite/ver_test_10.script: New file.
13604 * testsuite/ver_test_10.sh: New file.
13605 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
13606 (check_DATA): Add ver_test_10.syms.
13607 (ver_test_10.syms, ver_test_10.so): New target.
13608 * testsuite/Makefile.in: Rebuild.
13609
58e54ac2
CD
136102008-07-23 Simon Baldwin <simonb@google.com>
13611
13612 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
13613 to zero for undefined symbols from dynamic libraries.
13614
95d14cd3
ILT
136152008-07-23 Ian Lance Taylor <iant@google.com>
13616
13617 * symtab.cc (Symbol_table::resolve): Remove version parameter.
13618 Change all callers.
13619 * symtab.h (class Symbol_table): Update declaration.
13620 * testsuite/ver_test_9.cc: New file.
13621 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
13622 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
13623 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
13624 (ver_test_9.so, ver_test_9.o): New targets.
13625 * testsuite/Makefile.in: Rebuild.
13626
92de84a6
ILT
136272008-07-22 Ian Lance Taylor <iant@google.com>
13628
34810851
ILT
13629 * options.h (class General_options): Define --check-sections.
13630 * layout.cc (Layout::set_segment_offsets): Handle
13631 --check-sections.
13632
af6156ef
ILT
13633 * options.h (class General_options): Define -n/--nmagic and
13634 -N/--omagic.
13635 * options.cc (General_options::finalize): For -n/--nmagic or
13636 -N/--omagic, set -static.
13637 * layout.cc (Layout::attach_allocated_section_to_segment): If
13638 -N/--omagic, don't put read-only and read-write sections in
13639 different segments.
13640 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
13641 finding a read-only segment.
13642 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
13643 don't set the minimum segment alignment to the common page size,
13644 and don't set the file offset to the address modulo the page size.
13645 * script-sections.cc (Script_sections::create_segments): If
13646 -n/--omagic, don't put read-only and read-write sections in
13647 different segments.
13648
92de84a6
ILT
13649 * cref.cc: New file.
13650 * cref.h: New file.
13651 * options.h (class General_options): Add --print-symbol-counts.
13652 * main.cc (main): Issue defined symbol report if requested.
13653 * archive.cc (Archive::interpret_header): Make into a const member
13654 function.
13655 (Archive::add_symbols): Call Input_objects::archive_start and
13656 archive_stop.
13657 (Archive::const_iterator): Define new class.
13658 (Archive::begin, Archive::end): New functions.
13659 (Archive::include_all_members): Rewrite to use iterator.
13660 (Archive::count_members): New function.
13661 * archive.h (class Archive): Update declarations.
13662 (Archive::filename): New function.
13663 * object.cc: Include "cref.h".
13664 (Sized_relobj::Sized_relobj): Initialize defined_count_.
13665 (Sized_relobj::do_get_global_symbol_counts): New function.
13666 (Input_objects::add_object): Add object to cross-referencer.
13667 (Input_objects::archive_start): New function.
13668 (Input_objects::archive_stop): New function.
13669 (Input_objects::print_symbol_counts): New function.
13670 * object.h: Declare Cref and Archive.
13671 (Object::get_global_symbol_counts): New function.
13672 (Object::do_get_global_symbol_counts): New pure virtual function.
13673 (class Sized_relobj): Add defined_count_ field. Update
13674 declarations.
13675 (class Input_objects): Add cref_ field. Update constructor.
13676 Update declarations.
13677 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
13678 defined_count_.
13679 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
13680 symbol counts.
13681 (Sized_dynobj::do_get_global_symbol_counts): New function.
13682 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
13683 defined_count_. Update declarations. Define Symbols typedef.
13684 * symtab.cc (Symbol_table::add_from_relobj): Add defined
13685 parameter. Change all callers.
13686 (Symbol_table::add_from_dynobj): Add sympointers and defined
13687 parameters. Change all callers.
13688 * symtab.h (class Symbol_table): Update declarations.
13689 * Makefile.am (CCFILES): Add cref.cc.
13690 (HFILES): Add cref.h.
13691 * Makefile.in: Rebuild.
13692
3f7c5e1d
CD
136932008-07-22 Simon Baldwin <simonb@google.com>
13694
13695 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
13696 to zero when writing undefined symbols.
13697
e0b64032
ILT
136982008-07-22 Ian Lance Taylor <iant@google.com>
13699
13700 * output.cc (Output_section::add_input_section): Don't try to
13701 merge empty merge sections.
13702
096b02cf
CS
137032008-07-21 Craig Silverstein <csilvers@google.com>
13704
13705 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
13706 Include symbol version in error message.
cd536b21 13707
1d1f116d
CD
137082008-07-20 Chris Demetriou <cgd@google.com>
13709
cd536b21 13710 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
13711 (RANDOM_SEED_CFLAGS): New substituted variable.
13712 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
13713 * configure: Rebuild.
13714 * Makefile.in: Likewise.
13715 * testsuite/Makefile.in: Likewise.
13716
a18f591e
ILT
137172008-07-18 Ian Lance Taylor <iant@google.com>
13718
13719 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
13720 where we see NAME/NULL and NAME/VERSION as separate symbols.
13721 * testsuite/ver_test_main.cc (main): Call t4.
13722 (t4, t4_2a): Define.
13723 * testsuite/ver_test_2.cc (t4_2): Define.
13724 * testsuite/ver_test_2.script: Put t4_2a in VER2.
13725 * testsuite/ver_test_4.cc (t4_2a): Define.
13726 * testsuite/ver_test_4.script: Put t4_2a in VER2.
13727 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
13728
c6e3f6ed
ILT
137292008-07-17 Ian Lance Taylor <iant@google.com>
13730
13731 * dynobj.cc (Versions::add_def): If we give an error about a
13732 missing version, go ahead and create the version anyhow.
13733
ef9beddf
ILT
137342008-07-10 Ian Lance Taylor <iant@google.com>
13735
13736 Handle output sections with more than 0x7fffffff bytes.
13737 * object.h (class Relobj): Change map_to_output_ to
13738 output_sections_, and just keep a section pointer. Change all
13739 uses. Move comdat group support to Sized_relobj.
13740 (Relobj::is_section_specially_mapped): Remove.
13741 (Relobj::output_section): Remove poff parameter. Change all
13742 callers.
13743 (Relobj::output_section_offset): New function.
13744 (Relobj::set_section_offset): Rewrite.
13745 (Relobj::map_to_output): Remove.
13746 (Relobj::output_sections): New function.
13747 (Relobj::do_output_section_offset): New pure virtual function.
13748 (Relobj::do_set_section_offset): Likewise.
13749 (class Sized_relobj): Add section_offsets_ field. Add comdat
13750 group support from Relobj. Update declarations.
13751 (Sized_relobj::get_output_section_offset): New function.
13752 (Sized_relobj::do_output_section_offset): New function.
13753 (Sized_relobj::do_set_section_offset): New function.
13754 * object.cc (Relobj::output_section_address): Remove.
13755 (Sized_relobj::Sized_relobj): Initialize new fields.
13756 (Sized_relobj::include_section_group): Cast find_kept_object to
13757 Sized_relobj.
13758 (Sized_relobj::include_linkonce_section): Likewise.
13759 (Sized_relobj::do_layout): Use separate arrays for output section
13760 and output offset.
13761 (Sized_relobj::do_count_local_symbols): Change map_to_output to
13762 output_sections.
13763 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
13764 output_sections and section_offsets.
13765 (Sized_relobj::write_local_symbols): Likewise.
13766 (map_to_kept_section): Compute output address directly.
13767 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
13768 output_sections and section_offsets.
13769 (Sized_relobj::write_sections): Likewise.
13770 (Sized_relobj::relocate_sections): Likewise.
13771 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
13772 * output.h (class Output_reloc): Update declarations. Change
13773 u2_.relobj to Sized_relobj*.
13774 (class Output_data_reloc): Change add functions to use
13775 Sized_relobj*.
13776 * output.cc (Output_reloc::Output_reloc): Change relobj to
13777 Sized_relobj*.
13778 (Output_reloc::local_section_offset): Change return type to
13779 Elf_Addr. Use get_output_section_offset.
13780 (Output_reloc::get_address): Likewise.
13781 (Output_section::is_input_address_mapped): Don't call
13782 is_section_specially_mapped.
13783 (Output_section::output_offset): Likewise.
13784 (Output_section::output_address): Likewise.
13785 (Output_section::starting_output_address): Likewise.
13786 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
13787 parameter to Sized_relobj*.
13788 (Copy_relocs::need_copy_reloc): Likewise.
13789 (Copy_relocs::save): Likewise.
13790 * copy-relocs.h (class Copy_relocs): Update declarations.
13791 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
13792 Sized_relobj*. Change relobj_ field to Sized_relobj*.
13793 * target-reloc.h (relocate_for_relocatable): Change
13794 offset_in_output_section type to Elf_Addr. Change code that uses
13795 it as well.
13796 * layout.cc (Layout::layout): Always set *off.
13797 * mapfile.cc (Mapfile::print_input_section): Use
13798 output_section_offset.
13799 * i386.cc (Target_i386::copy_reloc): Change object parameter to
13800 Sized_relobj*.
13801 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
13802 * sparc.cc (Target_sparc::copy_reloc): Likewise.
13803 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
13804
5cb66f97
ILT
138052008-07-03 Ian Lance Taylor <iant@google.com>
13806
13807 * layout.cc (Layout::include_section): Do not discard unrecognized
13808 SHT_STRTAB sections.
13809
afe47622
CS
138102008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
13811
13812 * script.cc (Lex::can_continue_name): Make '?' allowable in
13813 version-script names.
13814 * testsuite/version_script.map: Change glob pattern to use '?'
13815
5adf9721
ILT
138162008-06-30 Manish Singh <yosh@gimp.org>
13817
13818 PR 6585
13819 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
13820 Correct typo.
13821
e6fde208
ILT
138222008-06-30 Ian Lance Taylor <iant@google.com>
13823
13824 PR 6660
13825 PR 6682
13826 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
13827 versions]: Don't try to read the value in the contents, since we
13828 don't use it. Use the template endianness when writing.
13829
3f2e6a2d
CC
138302008-06-25 Cary Coutant <ccoutant@google.com>
13831
13832 * fileread.cc (File_read::make_view): Assert on zero-length view.
13833 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
13834 symbol table when there are no symbols to read.
13835
c43d3a48
CS
138362008-06-23 Craig Silverstein <csilvers@google.com>
13837
13838 * version.cc (version_string): Bump to 1.7
13839
5f494ea0
CS
138402008-06-18 Craig Silverstein <csilvers@google.com>
13841
13842 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
13843 constant 0xFFFF to type Valtype.
13844 (Powerpc_relocate_functions::rel16_ha): Likewise.
13845
c42e122e
ILT
138462008-06-17 Ian Lance Taylor <iant@google.com>
13847
f34787f8
ILT
13848 * output.h (Output_section::Input_section): Initialize p2align_ to
13849 zero for Output_section_data constructors.
13850 (Output_section::Input_section::addralign): If not an input
13851 section, return the alignment of the Output_section_data.
13852 * testsuite/copy_test.cc: New file.
13853 * testsuite/copy_test_1.cc: New file.
13854 * testsuite/copy_test_2.cc: New file.
13855 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
13856 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
13857 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
13858 (copy_test_1_pic.o, copy_test_1.so): New targets.
13859 (copy_test_2_pic.o, copy_test_2.so): New targets.
13860 * testsuite/Makefile.in: Rebuild.
13861
c42e122e
ILT
13862 * script-sections.cc (Script_sections::place_orphan): Initialize
13863 local variable exact.
13864
ce3ac18a
DE
138652008-06-13 David Edelsohn <edelsohn@gnu.org>
13866
13867 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
13868
42cacb20
DE
138692008-06-12 David Edelsohn <edelsohn@gnu.org>
13870 David S. Miller <davem@davemloft.net>
13871
13872 * powerpc.cc: New file.
13873 * Makefile.am (TARGETSOURCES): Add powerpc.cc
13874 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
13875 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
13876 * Makefile.in: Rebuild.
13877
7b308235
ILT
138782008-06-09 Ian Lance Taylor <iant@google.com>
13879
13880 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
13881 <exception>.
13882 (throwing, orig_terminate): New static variables.
13883 (terminate_handler): New static function.
13884 (t2): Set terminate handler.
13885
f0b886e3
ILT
138862008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
13887
13888 PR 6584
cd536b21 13889 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
13890 alignment.
13891
3e90f135
CC
138922008-05-30 Cary Coutant <ccoutant@google.com>
13893
13894 * archive.cc (Archive::include_all_members) Correct to step
13895 over symbol table and extended name table in thin archives.
13896
e09ad04a
ILT
138972008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
13898
13899 PR 6407
13900 * target-reloc.h (relocate_for_relocatable): Fix new_offset
13901 calculation.
13902
62b01cb5
ILT
139032008-05-28 Caleb Howe <cshowe@google.com>
13904
13905 * reduced_debug_output.cc: New file.
13906 * reduced_debug_output.h: New file.
92de84a6 13907 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
13908 * options.cc (General_options::finalize): Add strip_debug_non_line
13909 to the strip heirarchy.
13910 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
13911 fields.
13912 * layout.cc: Include "reduced_debug_output.h".
13913 (Layout::Layout): Initialize new fields.
13914 (line_only_debug_sections): New static array.
13915 (is_lines_only_debug_sections): New static inline function.
13916 (Layout::include_section): Handle --strip-debug-non-line.
13917 (Layout::make_output_section): If --strip-debug-non-line, build
13918 new output sections for .debug_abbrev and .debug_info.
13919 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
13920 gold. Warn about possible overflow.
13921 (read_signed_LEB_128): Likewise.
13922 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
13923 (read_signed_LEB_128): Declare.
13924 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
13925 (HFILES): Add reduced_debug_output.h.
13926 * Makefile.in: Rebuild.
13927
7d9e3d98
ILT
139282008-05-21 Ian Lance Taylor <iant@google.com>
13929
13930 * mapfile.cc: New file.
13931 * mapfile.h: New file.
13932 * options.h (class General_options): Add -M/--print-map and -Map.
13933 * options.cc (General_options::finalize): Make -M equivalent to
13934 -Map -.
13935 * main.cc: Include <cstdio> and "mapfile.h".
13936 (main): Open mapfile if requested.
13937 * gold.cc (class Middle_runner): Add mapfile_ field. Update
13938 constructor. Change caller.
13939 (queue_initial_tasks): Add mapfile parameter. Change caller.
13940 (queue_middle_tasks): Likewise.
13941 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
13942 declarations.
13943 * archive.cc: Include "mapfile.h".
13944 (Archive::add_symbols): Add mapfile parameter. Change all
13945 callers. Pass mapfile, symbol, and reason to include_member.
13946 (Archive::include_all_members): Add mapfile parameter. Change all
13947 callers.
13948 (Archive::include_member): Add mapfile, sym, and why parameters.
13949 Change all callers. Report inclusion to map file.
13950 * archive.h: Include "fileread.h".
13951 (class Archive): Update declarations.
13952 (Archive::file): New const method.
13953 (class Add_archive_symbols): Add mapfile_ field. Update
13954 constructor. Change all callers.
13955 * readsyms.h (class Read_symbols): Likewise.
13956 (class Finish_group): Likewise.
13957 (class Read_script): Likewise.
13958 * common.cc: Include "mapfile.h".
13959 (Symbol_table::allocate_commons): Add mapfile parameter. Change
13960 all callers.
13961 (Symbol_table::do_allocate_commons): Likewise.
13962 (Symbol_table::do_allocate_commons_list): Likewise. Report common
13963 symbol allocation to mapfile.
13964 * common.h (class Allocate_commons_task): Add mapfile_ field.
13965 Update constructor. Change all callers.
13966 * symtab.h (class Symbol_table): Update declarations.
13967 * layout.cc: Include "mapfile.h".
13968 (Layout_task_runner::run): Print information to mapfile.
13969 (Layout::create_gold_note): Change Output_data_fixed_space to
13970 Output_data_zero_fill.
13971 (Layout::create_build_id): Likewise.
13972 (Layout::print_to_mapfile): New function.
13973 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
13974 constructor. Change caller.
13975 (class Layout): Declare print_to_mapfile.
13976 * output.cc (Output_section::Input_section::print_to_mapfile): New
13977 function.
13978 (Output_section::add_input_section): If producing a map, always
13979 add to input_sections_ list.
13980 (Output_section::do_print_to_mapfile): New function.
13981 (Output_segment::print_sections_to_mapfile): New function.
13982 (Output_segment::print_section_list_to_mapfile): New function.
13983 * output.h: Include "mapfile.h".
13984 (Output_data::print_to_mapfile): New function.
13985 (Output_data::do_print_to_mapfile): New virtual function.
13986 (Output_segment_headers::do_print_to_mapfile): New function.
13987 (Output_file_header::do_print_to_mapfile): New function.
13988 (Output_data_const::do_print_to_mapfile): New function.
13989 (class Output_data_const_buffer): Add map_name_ field. Update
13990 constructor. Change all callers. Add do_print_to_mapfile
13991 function.
13992 (class Output_data_fixed_space): Likewise.
13993 (class Output_data_space): Likewise.
13994 (class Output_data_zero_fill): New class.
13995 (Output_data_strtab::do_print_to_mapfile): New function.
13996 (Output_data_reloc_base::do_print_to_mapfile): New function.
13997 (Output_relocatable_relocs::do_print_to_mapfile): New function.
13998 (Output_data_group::do_print_to_mapfile): New function.
13999 (Output_data_got::do_print_to_mapfile): New function.
14000 (Output_data_dynamic::do_print_to_mapfile): New function.
14001 (Output_symtab_xindex::do_print_to_mapfile): New function.
14002 (class Output_section): Declare do_print_to_mapflie. Declare
14003 print_to_mapfile in Input_section.
14004 (class Output_segment): Declare new functions.
14005 * object.h (Sized_relobj::symbol_count): New function.
14006 * script-sections.cc
14007 (Output_section_element_dot_assignment::set_section_addresses):
14008 Change Output_data_fixed_space to Output_data_zero_fill.
14009 (Output_data_expression::do_print_to_mapfile): New function.
14010 * script.cc (read_input_script): Add mapfile parameter. Change
14011 all callers.
14012 * script.h (read_input_script): Update declaration.
14013 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
14014 (Eh_frame::do_print_to_mapfile): New function.
14015 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
14016 (Output_merge_string::do_print_to_mapfile): New function.
14017 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
14018 function.
14019 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
14020 function.
14021 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
14022 function.
14023 * Makefile.am (CCFILES): Add mapfile.cc.
14024 (HFILES): Add mapfile.h.
14025 * Makefile.in: Rebuild.
14026
9f1d377b
ILT
140272008-05-19 Ian Lance Taylor <iant@google.com>
14028
14029 * options.h (class General_options): Add -z relro.
14030 * layout.cc (Layout::Layout): Initialize relro_segment_.
14031 (Layout::add_output_section_data): Return the output section.
14032 (Layout::make_output_section): Rcognize relro sections and mark
14033 them appropriately.
14034 (Layout::attach_allocated_section_to_segment): Put relro sections
14035 in a PT_GNU_RELRO segment.
14036 (Layout::create_initial_dynamic_sections): Mark the .dynamic
14037 section as relro.
14038 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
14039 PT_TLS segments.
14040 (Layout::linkonce_mapping): Map d.rel.ro.local to
14041 .data.rel.ro.local.
14042 (Layout::output_section_name): Us .data.rel.ro.local for any
14043 section which begins with that.
14044 * layout.h (class Layout): Update add_output_section_data
14045 declaration. Add relro_segment_ field.
14046 * output.cc (Output_section::Output_section): Initialize is_relro_
14047 and is_relro_local_ fields.
14048 (Output_segment::add_output_section): Group relro sections.
14049 (Output_segment::is_first_section_relro): New function.
14050 (Output_segment::maximum_alignment): If there is a relro section,
14051 align the segment to the common page size.
14052 (Output_segment::set_section_addresses): Track whether we are
14053 looking at relro sections. If the last section is a relro
14054 section, align to the common page size.
14055 (Output_segment::set_section_list_addresses): Add in_relro
14056 parameter. Change all callers. Align to the page size when
14057 moving from relro to non-relro section.
14058 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
14059 segment.
14060 * output.h (class Output_section): Add is_relro_ and
14061 is_relro_local_ fields.
14062 (Output_section::is_relro): New function.
14063 (Output_section::set_is_relro): New function.
14064 (Output_section::is_relro_local): New function.
14065 (Output_section::set_is_relro_local): New function.
14066 (class Output_segment): Update declarations.
14067 * i386.cc (Target_i386::got_section): Mark .got section as relro.
14068 * sparc.cc (Target_sparc::got_section): Likewise.
14069 * x86_64.cc (Target_x86_64::got_section): Likewise.
14070 * testsuite/relro_test_main.cc: New file.
14071 * testsuite/relro_test.cc: New file.
14072 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
14073 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
14074 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
14075 (relro_test.so, relro_test_pic.o): New targets.
14076 * testsuite/Makefile.in: Rebuild.
14077
a984ee1d
ILT
140782008-05-16 Ian Lance Taylor <iant@google.com>
14079
01676dcd
ILT
14080 * output.cc (Output_segment::add_output_section): Remove front
14081 parameter.
14082 * output.h (class Output_segment): Remove
14083 add_initial_output_section and overloaded add_output_section.
14084 Update declaration of remaining add_output_section.
14085 * layout.cc (Layout::create_interp): Call add_output_section
14086 rather than add_initial_output_section.
14087 (Layout::finish_dynamic_section): Likewise.
14088
497897f9
ILT
14089 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
14090 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
14091 know the dynamic type.
14092 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
14093 field. Initialize it in constructor.
14094 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
14095 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
14096 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
14097 reloc.
14098
a984ee1d
ILT
14099 * output.cc (Output_reloc::get_address): Change return type to
14100 Elf_Addr.
14101 * output.h (class Output_reloc): Update get_address declaration.
14102 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
14103 for section addresses.
14104
55ba0940
ILT
141052008-05-09 Ian Lance Taylor <iant@google.com>
14106
14107 PR 6493
14108 * gold.cc (gold_nomem): Use return value of write.
14109
75517b77
ILT
141102008-05-08 Ian Lance Taylor <iant@google.com>
14111
14112 * symtab.c (Symbol::init_base_output_data): Add version
14113 parameter. Change all callers.
14114 (Symbol::init_base_output_segment): Likewise.
14115 (Symbol::init_base_constant): Likewise.
14116 (Symbol::init_base_undefined): Likewise.
14117 (Sized_symbol::init_output_data): Likewise.
14118 (Sized_symbol::init_output_segment): Likewise.
14119 (Sized_symbol::init_constant): Likewise.
14120 (Sized_symbol::init_undefined): Likewise.
14121 (Symbol_table::do_define_in_output_data): If the new symbol has a
14122 version, mark it as the default.
14123 (Symbol_table::do_define_in_output_segment): Likewise.
14124 (Symbol_table::do_define_as_constant): Likewise.
14125 * symtab.h (class Symbol): Update declarations.
14126 (class Sized_symbol): Likewise.
14127 * resolve.cc (Symbol::override_version): New function.
c42e122e 14128 (Symbol::override_base): Call override_version.
75517b77
ILT
14129 (Symbol::override_base_with_special): Likewise.
14130 * testsuite/ver_script_8.script: New file.
14131 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
14132 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
14133 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
14134 (ver_test_8_1.so, ver_test_8_2.so): New targets.
14135
f1f70eae
ILT
141362008-05-06 Ian Lance Taylor <iant@google.com>
14137
f3e9c5c5
ILT
14138 PR 6049
14139 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
14140 functions.
14141 (class General_options): Remove existing --undefined, and add
14142 --no-undefined instead. Add new --undefined as synonym for -u.
14143 * archive.cc (Archive::add_symbols): Check whether symbol was
14144 named with -u.
14145 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
14146 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
14147 all uses. Add IS_UNDEFINED. Update declarations to split
14148 different versions of init_base. Declare init_base_undefined.
14149 (Symbol::is_defined): Handle IS_UNDEFINED.
14150 (Symbol::is_undefined): Likewise.
14151 (Symbol::is_weak_undefined): Call is_undefined.
14152 (Symbol::is_absolute): Handle IS_CONSTANT.
14153 (class Sized_symbol): Update declarations to split different
14154 versions of init. Declare init_undefined.
14155 (class Symbol_table): Declare new functions.
14156 * symtab.cc (Symbol::init_base_object): Rename from init_base.
14157 Change all callers.
14158 (Symbol::init_base_output_data): Likewise.
14159 (Symbol::init_base_output_segment): Likewise.
14160 (Symbol::init_base_constant): Likewise.
14161 (Symbol::init_base_undefined): New function.
14162 (Sized_symbol::init_object): Rename from init. Change all
14163 callers.
14164 (Sized_symbol::init_output_data): Likewise.
14165 (Sized_symbol::init_output_segment): Likewise.
14166 (Sized_symbol::init_constant): Likewise.
14167 (Sized_symbol::init_undefined): New function.
14168 (Symbol_table::add_undefined_symbols_from_command_line): New
14169 function.
14170 (Symbol_table::do_add_undefined_symbols_from_command_line): New
14171 function.
14172 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
14173 (Symbol::output_section): Likewise.
14174 (Symbol::set_output_section): Likewise.
14175 (Symbol_table::sized_finalize_symbol): Likewise.
14176 (Symbol_table::sized_write_globals): Likewise.
14177 * resolve.cc (Symbol_table::should_override): Likewise.
14178 (Symbol::override_base_with_special): Likewise.
14179
8bdcdf2c
ILT
14180 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
14181 symbol, change it to have default visibility.
14182 * testsuite/protected_1.cc: New file.
14183 * testsuite/protected_2.cc: New file.
14184 * testsuite/protected_3.cc: New file.
14185 * testsuite/protected_main_1.cc: New file.
14186 * testsuite/protected_main_2.cc: New file.
14187 * testsuite/protected_main_3.cc: New file.
14188 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
14189 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
14190 (protected_1_LDFLAGS, protected_1_LDADD): Define.
14191 (protected_1.so): New target.
14192 (protected_1_pic.o, protected_2_pic.o): New targets.
14193 (protected_3_pic.o): New target.
14194 (check_PROGRAMS): Add protected_2.
14195 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
14196 (protected_2_LDFLAGS, protected_2_LDADD): Define.
14197 * testsuite/Makefile.in: Rebuild.
14198
2b706932
ILT
14199 * options.h (DEFINE_var): Add set_user_set_##varname__.
14200 (DEFINE_bool_alias): New macro.
14201 (class General_options): Define -Bstatic using DEFINE_bool_alias
14202 rather than DEFINE_special. Add --undefined as an alias for -z
14203 defs.
14204 * options.cc (General_options::parse_Bstatic): Remove.
14205
d82a5bcc
ILT
14206 * options.h (class General_options): Add --fatal-warnings.
14207 * main.cc (main): Implement --fatal-warnings.
14208 * errors.h (Errors::warning_count): New function.
14209
f1f70eae
ILT
14210 * options.h (class General_options): Add -Bsymbolic-functions.
14211 * symtab.h (Symbol::is_preemptible): Check for
14212 -Bsymbolic-functions.
14213
8825ac63
ILT
142142008-05-05 Ian Lance Taylor <iant@google.com>
14215
d98bc257
ILT
14216 * options.h (DEFINE_bool): For DASH_Z, create the negative option
14217 as noVARNAME rather than no-VARNAME.
14218 (class General_options): Add option -z combreloc.
14219 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
14220 get_address.
14221 (Output_reloc::sort_before) [SHT_REL]: New function.
14222 (Output_reloc::sort_before) [SHT_RELA]: New function.
14223 (class Output_data_reloc_base): Add sort_relocs_ field. Define
14224 Sort_relocs_comparison.
14225 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
14226 parameter. Change all callers.
14227 (Output_data_reloc::Output_data_reloc) [both versions]: Add
14228 sort_relocs parameter. Change all callers.
14229 * output.cc (Output_reloc::get_address): New function, broken out
14230 of write_rel.
14231 (Output_reloc::write_rel): Call it.
14232 (Output_reloc::compare): New function.
14233 (Output_data_reloc_base::do_write): Optionally sort relocs.
14234
60b2b4e7
ILT
14235 * configure.ac: If targ_extra_obj is set, link it in.
14236 * configure.tgt: Initialize all variables.
14237 (x86_64*): Set targ_extra_obj and targ_extra_size.
14238 * configure: Rebuild.
14239
8825ac63
ILT
14240 * object.cc (Sized_relobj::include_section_group): Adjust section
14241 indexes read from group data. Build vector to pass to
14242 layout_group.
14243 * layout.cc (Layout::layout_group): Add flags and shndxes
14244 parameters. Remove contents parameter. Change caller. Update
14245 explicit instantiations.
14246 * layout.h (class Layout): Update layout_group declaration.
14247 * output.cc (Output_data_group::Output_data_group): Add flags and
14248 input_shndxes parameters. Remove contents parameter. Change
14249 caller.
14250 (Output_data_group::do_write): Change input_sections_ to
14251 input_shndxes_.
14252 * output.h (class Output_data_group): Update constructor
14253 declaration. Rename input_sections_ to input_shndxes_.
14254 * testsuite/many_sections_test.cc: Add template.
14255
e94cf127
CC
142562008-04-30 Cary Coutant <ccoutant@google.com>
14257
4418b2d5
CC
14258 * target-reloc.h (relocate_section): Fix dead-pointer bug.
14259
e94cf127
CC
14260 * layout.cc (Layout::include_section): Refactored check for debug
14261 info section.
14262 (Layout::add_comdat): Add new parameters. Change type
14263 of signature parameter. Add object and shndx to signatures table.
14264 (Layout::find_kept_object): New function.
14265 * layout.h: Include <cstring>.
14266 (Layout::is_debug_info_section): New function.
14267 (Layout::add_comdat): Add new parameters.
14268 (Layout::find_kept_object): New function.
14269 (Layout::Kept_section): New struct.
14270 (Layout::Signatures): Change type of map range.
14271 * object.cc (Relobj::output_section_address): New function.
14272 (Sized_relobj::include_section_group): Add new parameters. Change
14273 calls to Layout::add_comdat. Change to build table of kept comdat
14274 groups and table mapping discarded sections to kept sections.
14275 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
14276 (Sized_relobj::do_layout): Change calls to include_section_group and
14277 include_linkonce_section.
14278 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
14279 value to zero when section is discarded.
14280 (Sized_relobj::map_to_kept_section): New function.
14281 * object.h (Relobj::output_section_address): New function.
14282 (Relobj::Comdat_group): New type.
14283 (Relobj::find_comdat_group): New function.
14284 (Relobj::Comdat_group_table): New type.
14285 (Relobj::Kept_comdat_section): New type.
14286 (Relobj::Kept_comdat_section_table): New type.
14287 (Relobj::add_comdat_group): New function.
14288 (Relobj::set_kept_comdat_section): New function.
14289 (Relobj::get_kept_comdat_section): New function.
14290 (Relobj::comdat_groups_): New field.
14291 (Relobj::kept_comdat_sections_): New field.
14292 (Symbol_value::input_value): Update comment.
14293 (Sized_relobj::map_to_kept_section) New function.
14294 (Sized_relobj::include_linkonce_section): Add new parameter.
14295 * target-reloc.h (Comdat_behavior): New type.
14296 (get_comdat_behavior): New function.
14297 (relocate_section): Add code to map a discarded section to the
14298 corresponding kept section when applying a relocation.
14299
e4e5049b
CS
143002008-04-30 Craig Silverstein <csilvers@google.com>
14301
14302 * dwarf_reader.cc (next_generation_count): New static var.
14303 (Addr2line_cache_entry): New struct.
14304 (addr2line_cache): New static var.
14305 (Dwarf_line_info::one_addr2line): Added caching.
14306 (Dwarf_line_info::clear_addr2line_cache): New function.
14307 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
14308 cache-size parameter.
14309 (Dwarf_line_info::one_addr2line_cache): New function.
14310 * symtab.cc (Symbol_table::detect_odr_violations): Pass
14311 new cache-size argument to one_addr2line(), and clear cache.
14312
d09e9154
CC
143132008-04-28 Cary Coutant <ccoutant@google.com>
14314
14315 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
14316 R_386_PC8 relocations.
14317
7ef73768
ILT
143182008-04-23 Ian Lance Taylor <iant@google.com>
14319
55438702
ILT
14320 * object.cc (Sized_relobj::include_section_group): Check for
14321 invalid section group.
14322
c165fb93
ILT
14323 * object.cc (make_elf_object): Correct test for 64-bit ELF file
14324 header size.
14325
7ef73768
ILT
14326 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
14327 than read for file header.
14328 * archive.cc (Archive::include_member): Likewise.
14329
6194aaab
L
143302008-04-23 Paolo Bonzini <bonzini@gnu.org>
14331
14332 * aclocal.m4: Regenerate.
14333 * configure: Regenerate.
14334
d491d34e
ILT
143352008-04-19 Ian Lance Taylor <iant@google.com>
14336
5ea2bac6
ILT
14337 * version.cc (version_string): Bump to 1.6.
14338
7bc3e21a
ILT
14339 * testsuite/Makefile.am (many_sections_r_test): New target.
14340 (many_sections_r_test_SOURCES): Remove.
14341 (many_sections_r_test_DEPENDENCIES): Remove.
14342 (many_sections_r_test_LDFLAGS): Remove.
14343 (many_sections_r_test_LDADD): Remove.
14344
7fcd3aa9
ILT
14345 * object.cc (Sized_relobj::do_add_symbols): Always pass
14346 local_symbol_count_ to add_from_relobj.
14347
4c94d6ae
ILT
14348 * testsuite/Makefile.am (many_sections_check.h): Only check one in
14349 every thousand variables.
14350 * testsuite/Makefile.in: Rebuild.
14351
d491d34e
ILT
14352 * object.cc (Xindex::initialize_symtab_xindex): New function.
14353 (Xindex::read_symtab_xindex): New function.
14354 (Xindex::sym_xindex_to_shndx): New function.
14355 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
14356 available.
14357 (Sized_relobj::do_initialize_xindex): New function.
14358 (Sized_relobj::do_read_symbols): Adjust section links.
14359 (Sized_relobj::symbol_section_and_value): Add is_ordinary
14360 parameter. Change all callers.
14361 (Sized_relobj::include_section_group): Adjust section links and
14362 symbol section indexes.
14363 (Sized_relobj::do_layout): Adjust section links.
14364 (Sized_relobj::do_count_local_symbols): Adjust section links and
14365 symbol section indexes.
14366 (Sized_relobj::do_finalize_local_symbols): Distinguish between
14367 ordinary and special symbols.
14368 (Sized_relobj::write_local_symbols): Add symtab_xindex and
14369 dynsym_xindex parameters. Change all callers. Adjust section
14370 links. Use SHN_XINDEX when needed.
14371 (Sized_relobj::get_symbol_location_info): Adjust section links.
14372 Don't get fooled by special symbols.
14373 * object.h (class Xindex): Define.
14374 (class Object): Add xindex_ parameter. Declare virtual functoin
14375 do_initialize_xindex.
14376 (Object::adjust_sym_shndx): New function.
14377 (Object::set_xindex): New protected function.
14378 (class Symbol_value): Add is_ordinary_shndx_ field.
14379 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
14380 (Symbol_value::value): Assert ordinary section.
14381 (Symbol_value::initialize_input_to_output_map): Likewise.
14382 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
14383 Change all callers.
14384 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
14385 all callers.
14386 (class Sized_relobj): Update declarations.
14387 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
14388 parameter. Change all callers.
14389 (Sized_relobj::adjust_shndx): New function.
14390 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
14391 field.
14392 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
14393 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
14394 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
14395 (Sized_dynobj::read_dynsym_section): Adjust section links.
14396 (Sized_dynobj::read_dynamic): Likewise.
14397 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
14398 section links.
14399 (Sized_dynobj::do_initialize_xindex): New function.
14400 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
14401 do_initialize_xindex.
14402 (Sized_dynobj::adjust_shndx): New function.
14403 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
14404 dynsym_xindex_ fields.
14405 (Layout::finalize): Add a call to set_section_indexes before
14406 creating the symtab sections.
14407 (Layout::set_section_indexes): Don't do anything if the section
14408 already has a section index.
14409 (Layout::create_symtab_sections): Add shnum parameter. Change
14410 caller. Create .symtab_shndx section if needed.
14411 (Layout::create_shdrs): Add shstrtab_section parameter. Change
14412 caller.
14413 (Layout::allocated_output_section_count): New function.
14414 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
14415 needed.
14416 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
14417 fields. Update declarations.
14418 (Layout::symtab_xindex): New function.
14419 (Layout::dynsym_xindex): New function.
14420 (class Write_symbols_task): Add layout_ field.
14421 (Write_symbols_task::Write_symbols_task): Add layout parameter.
14422 Change caller.
14423 * output.cc (Output_section_headers::Output_section_headers): Add
14424 shstrtab_section parameter. Change all callers.
14425 (Output_section_headers::do_sized_write): Store overflow values
14426 for section count and section string table section index in
14427 section header zero.
14428 (Output_file_header::do_sized_write): Check for overflow of
14429 section count and section string table section index.
14430 (Output_symtab_xindex::do_write): New function.
14431 (Output_symtab_xindex::endian_do_write): New function.
14432 * output.h (class Output_section_headers): Add shstrtab_section_.
14433 Update declarations.
14434 (class Output_symtab_xindex): Define.
14435 (Output_section::has_out_shndx): New function.
14436 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
14437 field.
14438 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
14439 Change all callers.
14440 (Sized_symbol::init): Likewise.
14441 (Symbol::output_section): Check for ordinary symbol.
14442 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
14443 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
14444 callers.
14445 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
14446 Change all callers. Simplify handling of symbols from sections
14447 not included in the link.
14448 (Symbol_table::add_from_dynobj): Handle ordinary symbol
14449 distinction.
14450 (Weak_alias_sorter::operator()): Assert that symbols are
14451 ordinary.
14452 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
14453 distinction.
14454 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
14455 parameters. Change all callers.
14456 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
14457 symbol distinction. Use SHN_XINDEX when needed.
14458 (Symbol_table::write_section_symbol): Add symtab_xindex
14459 parameter. Change all callers.
14460 (Symbol_table::sized_write_section_symbol): Likewise. Use
14461 SHN_XINDEX when needed.
14462 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
14463 declarations.
14464 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
14465 (Symbol::is_defined): Check is_ordinary.
14466 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
14467 (Symbol::is_absolute, Symbol::is_common): Likewise.
14468 (class Sized_symbol): Update declarations.
14469 (class Symbol_table): Update declarations.
14470 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
14471 parameters. Change all callers.
14472 (Sized_symbol::override): Likewise.
14473 (Symbol_table::override): Likewise.
14474 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
14475 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
14476 is_ordinary, and orig_st_shndx parameters. Change all callers.
14477 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
14478 to be in an ordinary section.
14479 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
14480 object and is_ordinary parameters. Change all callers.
14481 (Sized_dwarf_line_info::read_relocs): Add object parameter.
14482 Change all callers. Don't add undefined or non-ordinary symbols
14483 to reloc_map_.
14484 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
14485 Change all callers.
14486 * dwarf_reader.h (class Sized_dwarf_line_info): Update
14487 declarations.
14488 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
14489 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
14490 (Sized_relobj::relocate_sections): Likewise.
14491 * target-reloc.h (scan_relocs): Adjust section symbol index.
14492 (scan_relocatable_relocs): Likewise.
14493 * i386.cc (Scan::local): Check for ordinary symbols.
14494 * sparc.cc (Scan::local): Likewise.
14495 * x86_64.cc (Scan::local): Likewise.
14496 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
14497 to symbol_section_and_value.
14498 * testsuite/many_sections_test.cc: New file.
14499 * testsuite/Makefile.am (BUILT_SOURCES): Define.
14500 (check_PROGRAMS): Add many_sections_test.
14501 (many_sections_test_SOURCES): Define.
14502 (many_sections_test_DEPENDENCIES): Define.
14503 (many_sections_test_LDFLAGS): Define.
14504 (BUILT_SOURCES): Add many_sections_define.h.
14505 (many_sections_define.h): New target.
14506 (BUILT_SOURCES): Add many_sections_check.h.
14507 (many_sections_check.h): New target.
14508 (check_PROGRAMS): Add many_sections_r_test.
14509 (many_sections_r_test_SOURCES): Define.
14510 (many_sections_r_test_DEPENDENCIES): Define.
14511 (many_sections_r_test_LDFLAGS): Define.
14512 (many_sections_r_test_LDADD): Define.
14513 (many_sections_r_test.o): New target.
14514 * testsuite/Makefile.in: Rebuild.
14515
c5818ff1
CC
145162008-04-17 Cary Coutant <ccoutant@google.com>
14517
14518 * errors.cc (Errors::info): New function.
14519 (gold_info): New function.
14520 * errors.h (Errors::info): New function.
14521 * gold.h (gold_info): New function.
14522 * object.cc (Input_objects::add_object): Print trace output.
14523 * options.cc (options::parse_set): New function.
14524 (General_options::parse_wrap): Deleted.
14525 (General_options::General_options): Deleted initializer.
14526 * options.h (options::String_set): New typedef.
14527 (options::parse_set): New function.
14528 (DEFINE_set): New macro.
14529 (General_options::wrap): Changed to use DEFINE_set. Changed
14530 callers of any_wrap_symbols and is_wrap_symbol.
14531 (General_options::trace, General_options::trace_symbol):
14532 New options.
14533 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
14534 (General_options::wrap_symbols_): Deleted.
14535 * symtab.cc (Symbol_table::add_from_object): Print trace output.
14536
b5be4a7c
DM
145372008-04-17 David S. Miller <davem@davemloft.net>
14538
14539 * options.cc (General_options::parse_V): New function.
14540 * options.h: Add entries for -V and -Qy.
14541
155a0dd7
ILT
145422008-04-17 Ian Lance Taylor <iant@google.com>
14543
14544 * common.cc (Symbol_table::allocate_commons): Remove options
14545 parameter. Change caller.
14546 (Symbol_table::do_allocate_commons): Remove options parameter.
14547 Change caller. Just call do_allocate_commons_list twice.
14548 (Symbol_table::do_allocate_commons_list): New function, broken out
14549 of do_allocate_commons.
14550 * common.h (class Allocate_commons_task): Remove options_ field.
14551 Update constructor.
14552 * symtab.cc (Symbol_table::Symbol_table): Initialize
14553 tls_commons_.
14554 (Symbol_table::add_from_object): Put TLS common symbols on
14555 tls_commons_ list.
14556 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
14557 which are IN_OUTPUT_DATA.
14558 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
14559 allocate_commons and do_allocate_commons declarations. Declare
14560 do_allocate_commons_list.
14561 * gold.cc (queue_middle_tasks): Update creation of
14562 Allocate_commons_task to not pass options.
14563 * testsuite/Makefile.am (INCLUDES): Add -I.. .
14564 (TLS_TEST_C_FLAGS): New variable.
14565 (tls_test_c_pic.o): New target.
14566 (tls_test_shared.so): Link in tls_test_c_pic.o.
14567 (tls_test_c_pic_ie.o): New target.
14568 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
14569 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
14570 (tls_test_c.o): New target.
14571 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
14572 (tls_pic_test_LDADD): Likewise.
14573 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
14574 (tls_shared_gd_to_ie_test_LDADD): Likewise.
14575 (tls_test_c_gnu2.o): New target.
14576 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
14577 tls_test_c_gnu2.o.
14578 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
14579 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
14580 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
14581 * testsuite/tls_test.cc: Include "config.h".
14582 (t_last): Call t11_last.
14583 * testsuite/tls_test.h (t11, t11_last): Declare.
14584 * testsuite/tls_test_c.c: New file.
14585 * testsuite/tls_test_main.cc (thread_routine): Call t11.
14586 * configure.ac: Check for OpenMP support.
14587 * configure, config.in, Makefile.in: Rebuild.
14588 * testsuite/Makefile.in: Rebuild.
14589
edfbb029
CC
145902008-04-16 Cary Coutant <ccoutant@google.com>
14591
14592 * i386.cc (Target_i386::define_tls_base_symbol): New function.
14593 (Target_i386::tls_base_symbol_defined_): New field.
14594 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
14595 (Target_i386::Scan::global): Likewise.
14596 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
14597 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
14598 (Target_x86_64::tls_base_symbol_defined_): New field.
14599 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
14600 (Target_x86_64::Scan::global): Likewise.
14601
f3c69fca
CC
146022008-04-16 Cary Coutant <ccoutant@google.com>
14603
14604 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
14605 (Symbol::needs_plt_entry): Allow weak undefined symbols.
14606 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
14607 building shared libraries.
14608 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
14609 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
14610 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
14611 * testsuite/Makefile.in: Rebuild.
14612 * testsuite/weak_undef.h: New file.
14613 * testsuite/weak_undef_file1.cc: Add extra test cases.
14614 * testsuite/weak_undef_file2.cc: Likewise.
14615 * testsuite/weak_undef_test.cc: Likewise.
14616
7c414435
DM
146172008-04-16 David S. Miller <davem@davemloft.net>
14618
32b769e1
DM
14619 * sparc.cc (Target_sparc::Scan): Change from struct to class.
14620 Add issued_non_pic_error_ field. Declare check_non_pic.
14621 (Target_sparc::Scan::check_non_pic): New function.
14622 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
14623 (Target_sparc::Scan::global): Likewise.
14624
11936fb1
DM
14625 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
14626 * configure: Rebuild.
14627
7c414435
DM
14628 * options.h (DEFINE_enable): New macro.
14629 (new_dtags): New enable option.
14630 (initfirst, interpose, loadfltr, nodefaultlib,
14631 nodelete, nodlopen, nodump): New -z options.
14632 * layout.cc (Layout:finish_dynamic_section): If new
14633 dtags enabled, emit DT_RUNPATH. Also, emit a
14634 DT_FLAGS_1 containing any specified -z flags.
14635
85c7bf8b
ILT
146362008-04-16 Ian Lance Taylor <iant@google.com>
14637
12c0daef
ILT
14638 * copy-relocs.cc: New file.
14639 * copy-relocs.h: New file.
14640 * reloc.cc: Remove Copy_relocs code.
14641 * reloc.h: Likewise.
14642 * reloc-types.h (struct Reloc_types) [both versions]: Add
14643 get_reloc_addend_noerror.
14644 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
14645 variants of add_global which take an addend which must be zero.
14646 * i386.cc: Include "copy-relocs.h".
14647 (class Target_i386): Change type of copy_relocs_ to variable,
14648 update initializer.
14649 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
14650 Change all callers.
14651 (Target_i386::do_finalize_sections): Change handling of
14652 copy_relocs_.
14653 * sparc.cc: Include "copy-relocs.h".
14654 (class Target_sparc): Change type of copy_relocs_ to variable,
14655 update initializer.
14656 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
14657 Change all callers.
14658 (Target_sparc::do_finalize_sections): Change handling of
14659 copy_relocs_.
14660 * x86_64.cc: Include "copy-relocs.h".
14661 (class Target_x86_64): Change type of copy_relocs_ to variable,
14662 update initializer.
14663 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
14664 class. Change all callers.
14665 (Target_x86_64::do_finalize_sections): Change handling of
14666 copy_relocs_.
14667 * Makefile.am (CCFILES): Add copy-relocs.cc.
14668 (HFILES): Add copy-relocs.h.
14669
4f4995b6
ILT
14670 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
14671
85c7bf8b
ILT
14672 * testsuite/script_test_4.sh: Permit leading zeroes.
14673
4f2a9edd
ILT
146742008-04-15 Ian Lance Taylor <iant@google.com>
14675
e6188289
ILT
14676 * script-sections.cc (Script_sections::create_segments): Use
14677 header_size_adjustment even when there is enough room for the
14678 headers.
14679 * testsuite/script_test_4.sh: New file.
14680 * testsuite/script_test_4.t: New file.
14681 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
14682 (check_DATA): Add script_test_4.stdout.
14683 (MOSTLYCLEANFILES): Likewise.
14684 (script_test_4): New target.
14685 (script_test_4.stdout): New target.
14686 * testsuite/Makefile.in: Rebuild.
14687
4f2a9edd
ILT
14688 * sparc.cc: Add definitions for Output_data_plt_sparc class
14689 constants.
14690
f5314dd5
DM
146912008-04-14 David S. Miller <davem@davemloft.net>
14692
14693 * sparc.cc: New file.
14694 * Makefile.am (TARGETSOURCES): Add sparc.cc
14695 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
14696 * configure.tgt: Document targ_extra_size and
14697 targ_extra_big_endian. Add entries for sparc-* and
14698 sparc64-*.
14699 * configure.ac: Handle targ_extra_size and
14700 targ_extra_big_endian.
14701 * Makefile.in: Rebuild.
14702 * configure: Likewise.
14703 * po/POTFILES.in: Likewise.
14704 * po/gold.pot: Likewise.
14705
154e0e9a
ILT
147062008-04-14 Ian Lance Taylor <iant@google.com>
14707
14708 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
14709 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
14710 in the name/type/flags to section mapping. Don't call
14711 allocate_output_section.
14712 (Layout::choose_output_section): Change parameter from adjust_name
14713 to is_input_section. Don't permit input sections after sections
14714 are attached to segments. Don't call allocate_output_section.
14715 (Layout::layout_eh_frame): Call update_flags_for_input_section,
14716 not write_enable_output_section.
14717 (Layout::make_output_section): Don't push to
14718 unattached_section_list_ nor call attach_to_segment. Call
14719 attach_section_to_segment if sections are attached.
14720 (Layout::attach_sections_to_segments): New function.
14721 (Layout::attach_section_to_segment): New function.
14722 (Layout::attach_allocated_section_to_segment): Rename from
14723 attach_to_segment. Remove flags parameter.
14724 (Layout::allocate_output_section): Remove function.
14725 (Layout::write_enable_output_section): Remove function.
14726 * layout.h (class Layout): Update for above changes. Add new
14727 field sections_are_attached_.
14728 * output.h (Output_section::update_flags_for_input_section): New
14729 function.
14730 * output.cc (Output_section::add_input_section): Call
14731 update_flags_for_input_section.
14732 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
14733
009a67a2
CC
147342008-04-11 Cary Coutant <ccoutant@google.com>
14735
14736 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
14737 thought unnecessary.
14738 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
14739
759b1a24
ILT
147402008-04-11 Ian Lance Taylor <iant@google.com>
14741
14742 * output.h (class Output_section_data): Remove inline definition
14743 of set_addralign.
14744 * output.cc (Output_section_data::set_addralign): New function.
14745
c2b45e22
CC
147462008-04-11 Cary Coutant <ccoutant@google.com>
14747
14748 Add support for TLS descriptors for i386 and x86_64.
14749 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
14750 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
14751 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
14752 GOT_TYPE_TLS_DESC.
14753 (Target_i386::got_mod_index_entry): Remove unnecessary code.
14754 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
14755 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
14756 relocations.
14757 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
14758 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
14759 Fix problem with initial-exec relocations.
14760 (Target_i386::Relocate::relocate_tls): Likewise.
14761 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
14762 relaxation.
14763 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
14764 support for section-plus-offset dynamic table entries.
14765 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
14766 (Output_data_dynamic::Dynamic_entry): Add support for
14767 section-plus-offset dynamic table entries.
14768 (Output_data_dynamic::Classification): Likewise.
14769 (Output_data_dynamic::classification_): Renamed offset_.
14770 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
14771 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
14772 (Target_x86_64::make_plt_section): New function.
14773 (Target_x86_64::reserve_tlsdesc_entries): New function.
14774 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
14775 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
14776 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
14777 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
14778 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
14779 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
14780 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
14781 add extra PLT entry for TLS descriptors.
14782 (Output_data_plt_x86_64::got_): New field.
14783 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
14784 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
14785 fields.
14786 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
14787 descriptors.
14788 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
14789 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
14790 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
14791 R_386_TLS_DESC_CALL relocations.
14792 (Target_x86_64::Scan::global): Likewise.
14793 (Target_x86_64::do_finalize_sections): Add dynamic table entries
14794 for TLS descriptors.
14795 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
14796 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
14797 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
14798 GD-to-IE relaxation.
14799 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
14800 and TLS_DESCRIPTORS.
14801 * Makefile.in: Rebuild.
14802 * configure: Rebuild.
14803 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
14804 (tls_test_shared2.so): New target.
14805 (tls_shared_gd_to_ie_test_SOURCES): New variable.
14806 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
14807 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
14808 (tls_shared_gd_to_ie_test_LDADD): New variable.
14809 (tls_shared_gnu2_gd_to_ie_test): New target.
14810 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
14811 New targets.
14812 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
14813 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
14814 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
14815 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
14816 (tls_shared_gnu2_test): New target.
14817 (tls_test_gnu2_shared.so): New target.
14818 (tls_shared_gnu2_test_SOURCES): New variable.
14819 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
14820 (tls_shared_gnu2_test_LDFLAGS): New variable.
14821 (tls_shared_gnu2_test_LDADD): New variable.
14822 * testsuite/Makefile.in: Rebuild.
14823 * testsuite/Makefile.
14824
83bfb6b7
ILT
148252008-04-11 Ian Lance Taylor <iant@google.com>
14826
14827 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
14828 justsyms.t.
14829 * testsuite/Makefile.in: Rebuild.
14830
14831 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
14832 long.
14833 * testsuite/script_test_2.cc (main): Adjust test.
14834
706e1f5e
ILT
148352008-04-11 David S. Miller <davem@davemloft.net>
14836 Ian Lance Taylor <iant@google.com>
14837
14838 * options.h (General_options): Add entries for '-Y' and
14839 '-relax'.
14840 * options.cc (General_options:finalize): If -Y was used, add those
14841 entries to the library path instead of the default "/lib" and
14842 "/usr/lib".
14843
7c98e6bb
DM
148442008-04-11 David S. Miller <davem@davemloft.net>
14845
14846 * testsuite/justsyms.t: Start at 0x100.
14847 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
14848 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
14849 long.
14850 * testsuite/script_test_2.cc: Adjust string and section length
14851 checks.
7c98e6bb 14852
99a37bfd
ILT
148532008-04-09 Ian Lance Taylor <iant@google.com>
14854
2cefc357
ILT
14855 PR gold/5996
14856 * script-sections.cc (Sections_element::allocate_to_segment): Add
14857 orphan parameter.
14858 (Output_section_definition::allocate_to_segment): Likewise.
14859 (Orphan_output_section::allocate_to_segment): Likewise.
14860 (Script_sections::attach_sections_using_phdrs_clause): Don't
14861 propagate non-PT_LOAD segments to orphan sections.
14862 * testsuite/Makefile.am (script_test_3.stdout): Generate using
14863 readelf rather than objdump.
14864 * testsuite/script_test_3.sh: Adjust accordingly. Test that
14865 .interp section and PT_INTERP segment are the same size.
14866 * testsuite/Makefile.in: Rebuild.
14867
99a37bfd
ILT
14868 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
14869 aliases for symbols defined in the same object.
14870 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
14871 (weak_alias_test_SOURCES): New variable.
14872 (weak_alias_test_DEPENDENCIES): New variable.
14873 (weak_alias_test_LDFLAGS): New variable.
14874 (weak_alias_test_LDADD): New variable.
14875 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
14876 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
14877 (weak_alias_test_3.o): New target.
14878 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
14879 * testsuite/weak_alias_test_main.cc: New file.
14880 * testsuite/weak_alias_test_1.cc: New file.
14881 * testsuite/weak_alias_test_2.cc: New file.
14882 * testsuite/weak_alias_test_3.cc: New file.
14883
780e49c5
ILT
148842008-04-08 Ian Lance Taylor <iant@google.com>
14885
cdb0b8f5
ILT
14886 * options.h (class General_options): Add --noinhibit-exec option.
14887 * main.cc (main): Check --noinhibit-exec.
14888
0864d551
ILT
14889 * options.h (class General_options): Define --wrap as a special
14890 option. Add wrap_symbols_ field.
14891 (General_options::any_wrap_symbols): New function.
14892 (General_options::is_wrap_symbol): New function.
14893 * options.cc (General_options::parse_wrap): New function.
14894 (General_options::General_options): Initialize wrap_symbols_.
14895 * symtab.cc (Symbol_table::wrap_symbol): New function.
14896 (Symbol_table::add_from_object): Handle --wrap.
14897 * symtab.h (class Symbol_table): Declare wrap_symbol.
14898 * target.h (Target::wrap_char): New function.
14899 (Target::Target_info): Add wrap_char field.
14900 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
14901 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14902 * testsuite/testfile.cc (Target_test::test_target_info):
14903 Likewise.
14904
789aa6de
ILT
14905 * errors.cc (Errors::undefined_symbol): Mention symbol version if
14906 there is one.
14907
2c38906f
ILT
14908 * layout.h (class Layout): Add added_eh_frame_data_ field.
14909 * layout.cc (Layout::Layout): Initialize new field.
14910 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
14911 output section until we find a section we merged successfully.
14912 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
14913 that the size be non-zero.
14914
780e49c5
ILT
14915 * merge.cc (Object_merge_map::get_output_offset): Remove inline
14916 qualifier.
14917
7fcd0256
ILT
149182008-04-08 Craig Silverstein <csilvers@google.com>
14919
14920 * configure.ac: Export new conditional variable HAVE_ZLIB.
14921 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
14922 on HAVE_ZLIB.
14923 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
14924 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
14925
6835af53
ILT
149262008-04-07 Ian Lance Taylor <iant@google.com>
14927
e24f324c
ILT
14928 * version.cc (version_string): Set to "1.5".
14929
a036edd8
ILT
14930 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
14931 Add issued_non_pic_error_ field. Declare check_non_pic.
14932 (Target_x86_64::Scan::check_non_pic): New function.
14933 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
14934 (Target_x86_64::Scan::global): Likewise.
14935
624f8810
ILT
14936 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
14937 addend parameter. Change caller. Handle merge sections.
14938 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
14939 Address to Addend. Don't add in the result of
14940 local_section_offset, pass down the addend and use the returned
14941 value.
14942 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
14943 Update declarations of local_section_offset and symbol_value.
14944 * testsuite/two_file_test_1.cc (t18): New function.
14945 * testsuite/two_file_test_2.cc (f18): New function.
14946 * testsuite/two_file_test_main.cc (main): Call t18.
14947 * testsuite/two_file_test.h (t18, f18): Declare.
14948
6835af53
ILT
14949 * configure.ac: Don't test for objdump, c++filt, or readelf.
14950 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
14951 conditionals.
14952 (TEST_READELF): New variable.
14953 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
14954 (check_PROGRAMS): Add two_file_strip_test.
14955 (two_file_strip_test): New target.
14956 (check_PROGRAMS): Add two_file_same_shared_strip_test.
14957 (two_file_same_shared_strip_test_SOURCES): New variable.
14958 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
14959 (two_file_same_shared_strip_test_LDFLAGS): New variable.
14960 (two_file_same_shared_strip_test_LDADD): New variable.
14961 (two_file_shared_strip.so): New target.
14962 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
14963 (ver_test_5.syms, ver_test_7.syms): Likewise.
14964 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
14965 (strip_test_3.stdout): Use TEST_OBJDUMP.
14966 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
14967
86925eef
CC
149682008-04-04 Cary Coutant <ccoutant@google.com>
14969
14970 * symtab.h (Symbol::is_weak_undefined): New function.
14971 (Symbol::is_strong_undefined): New function.
14972 (Symbol::is_absolute): New function.
14973 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
14974 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
14975 absolute symbols.
14976 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
14977 (weak_undef_test): New target.
14978 * testsuite/Makefile.in: Rebuild.
14979 * testsuite/weak_undef_file1.cc: New file.
14980 * testsuite/weak_undef_file2.cc: New file.
14981 * testsuite/weak_undef_test.cc: New file.
14982
126f3ece
ILT
149832008-04-03 Craig Silverstein <csilvers@google.com>
14984
14985 * compressed_output.h (class Output_compressed_section): Use
14986 unsigned buffer.
14987 * compressed_output.cc (zlib_compress): Use unsigned buffers,
14988 add zlib header.
14989 (zlib_compressed_suffix): Removed.
14990 (Output_compressed_section::set_final_data_size): Use unsigned
14991 buffers.
14992 * testsuite/Makefile.am (flagstest_compress_debug_sections):
14993 Fix linker invocation.
14994 (flagstest_o_specialfile_and_compress_debug_sections):
14995 Likewise.
14996 * testsuite/Makefile.in: Regenerated.
14997
deae2a14
DM
149982008-04-02 David S. Miller <davem@davemloft.net>
14999
15000 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
15001 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
15002
70752818
ILT
150032008-04-02 Craig Silverstein <csilvers@google.com>
15004
15005 * TODO: New file.
15006
39d0cb0e
ILT
150072008-04-02 Ian Lance Taylor <iant@google.com>
15008
15009 * fileread.cc (File_read::find_view): Add byteshift and vshifted
15010 parameters. Update for new key type to views_. Change all
15011 callers.
15012 (File_read::read): Adjust for byteshift in returned view.
15013 (File_read::add_view): New function, broken out of
15014 find_and_make_view.
15015 (File_read::make_view): New function, broken out of
15016 find_and_make_view.
15017 (File_read::find_or_make_view): Add offset and aligned
15018 parameters. Rewrite accordingly. Change all callers.
15019 (File_read::get_view): Add offset and aligned parameters. Adjust
15020 for byteshift in return value.
15021 (File_read::get_lasting_view): Likewise.
15022 * fileread.h (class File_read): Update declarations.
15023 (class File_read::View): Add byteshift_ field. Add byteshift to
15024 constructor. Add byteshift method.
15025 * archive.h (Archive::clear_uncached_views): New function.
15026 (Archive::get_view): Add aligned parameter. Change all callers.
15027 * object.h (Object::get_view): Add aligned parameter. Change all
15028 callers.
15029 (Object::get_lasting_view): Likewise.
15030
15031 * fileread.cc (File_read::release): Don't call clear_views if
15032 there are multiple objects.
15033 * fileread.h (File_read::clear_uncached_views): New function.
15034 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
15035 on the archive.
15036
a1207466
CC
150372008-03-31 Cary Coutant <ccoutant@google.com>
15038
15039 Add thin archive support.
15040 * archive.cc (Archive::armagt): New const.
15041 (Archive::setup): Remove task parameter and calls to unlock.
15042 (Archive::unlock_nested_archives): New function.
15043 (Archive::read_header): Add nested_off parameter. Change
15044 all callers.
15045 (Archive::interpret_header): Likewise.
15046 (Archive::include_all_members): Change to handle thin
15047 archives.
15048 (Archive::include_member): Likewise.
15049 * archive.h (Archive::Archive): Add new parameters and
15050 initializers.
15051 (Archive::armagt): New const.
15052 (Archive::setup): Remove task parameter.
15053 (Archive::unlock_nested_archives): New function.
15054 (Archive::read_header): Add nested_off parameter.
15055 (Archive::interpret_header): Likewise.
15056 (Archive::Nested_archive_table): New typedef.
15057 (Archive::is_thin_archive_): New field.
15058 (Archive::nested_archives_): New field.
15059 (Archive::options_): New field.
15060 (Archive::dirpath_): New field.
15061 (Archive::task_): New field.
15062 * readsyms.cc (Read_symbols::do_read_symbols): Add check
15063 for thin archives. Pass additional parameters to
15064 Archive::Archive. Unlock the archive file after calling
15065 Archive::setup.
cd536b21 15066
479f6503
ILT
150672008-03-29 Ian Lance Taylor <iant@google.com>
15068
686c8caf
ILT
15069 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
15070 version symbol to be local.
15071 * testsuite/ver_test_4.sh: New file.
15072 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
15073 (check_DATA): Add ver_test_4.syms.
15074 (ver_test_4.syms): New target.
15075 * testsuite/Makefile.in: Rebuild.
15076
ab794b6b
ILT
15077 * output.cc
15078 (Output_section::Input_section_sort_entry::has_priority): New
15079 function.
15080 (Output_section::Input_section_sort_entry::match_file_name): New
15081 function.
15082 (Output_section::Input_section_sort_entry::match_section_name):
15083 Remove.
15084 (Output_section::Input_section_sort_entry::match_section_name_prefix):
15085 Remove.
15086 (Output_section::Input_section_sort_entry::match_section_file):
15087 Remove.
15088 (Output_section::Input_section_sort_compare::operator()): Rewrite
15089 using new Input_section_sort_entry functions. Sort crtbegin and
15090 crtend first. Sort sections with no priority before sections with
15091 a priority.
15092 * testsuite/initpri1.c (d3): Check j != 4.
15093 (cd5): New constructor/destructor function.
15094 (main): Check j != 2.
15095
479f6503
ILT
15096 * symtab.cc (Symbol_table::add_from_object): If we don't use the
15097 new symbol when resolving, don't call set_is_default.
15098 * testsuite/ver_test_7.cc: New file.
15099 * testsuite/ver_test_7.sh: New file.
15100 * testsuite/Makefile.am (ver_test_7.so): New target.
15101 (ver_test_7.o): New target.
15102 (check_SCRIPTS): Add ver_test_7.sh.
15103 (check_DATA): Add ver_test_7.syms.
15104 (ver_test_7.syms): New target.
15105
2fd32231
ILT
151062008-03-28 Ian Lance Taylor <iant@google.com>
15107
15108 * layout.cc (Layout::layout): If we see an input section with a
15109 name that needs sorting, set the must_sort flag for the output
15110 section.
15111 (Layout::make_output_section): If the name of the output section
15112 indicates that it might require sorting, set the may_sort flag.
15113 * output.h (Output_section::may_sort_attached_input_sections): New
15114 function.
15115 (Output_section::set_may_sort_attached_input_sections): New
15116 function.
15117 (Output_section::must_sort_attached_input_sections): New
15118 function.
15119 (Output_section::set_must_sort_attached_input_sections): New
15120 function.
15121 (class Output_section): Declare Input_section_sort_entry. Define
15122 Input_section_sort_compare. Declare
15123 sort_attached_input_sections. Add new fields:
15124 may_sort_attached_input_sections_,
15125 must_sort_attached_input_sections_,
15126 attached_input_sections_are_sorted_.
15127 * output.cc (Output_section::Output_section): Initialize new
15128 fields.
15129 (Output_section::add_input_section): Add an entry to
15130 input_sections_ if may_sort or must_sort are true.
15131 (Output_section::set_final_data_size): Call
15132 sort_attached_input_sections if necessary.
15133 (Output_section::Input_section_sort_entry): Define new class.
15134 (Output_section::Input_section_sort_compare::operator()): New
15135 function.
15136 (Output_section::sort_attached_input_sections): New function.
15137 * configure.ac: Check whether the compiler supports constructor
15138 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
15139 * testsuite/initpri1.c: New file.
15140 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
15141 CONSTRUCTOR_PRIORITY.
15142 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
15143 (initpri1_LDFLAGS): New variable.
15144 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15145
18e6b24e
ILT
151462008-03-27 Ian Lance Taylor <iant@google.com>
15147
49bdd526
ILT
15148 * common.cc (Sort_commons::operator): Correct sorting algorithm.
15149 * testsuite/common_test_1.c: New file.
15150 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
15151 (common_test_1_SOURCES): New variable.
15152 (common_test_1_DEPENDENCIES): New variable.
15153 (common_test_1_LDFLAGS): New variable.
15154
18e6b24e
ILT
15155 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
15156 and commons_ correctly when NAME/VERSION does not override
15157 NAME/NULL.
15158 * testsuite/ver_test_6.c: New file.
15159 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
15160 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
15161 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
15162
04bf7072
ILT
151632008-03-26 Ian Lance Taylor <iant@google.com>
15164
5871526f
ILT
15165 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
15166 of an undefined symbol from a version script.
15167 * testsuite/Makefile.am (ver_test_5.so): New target.
15168 (ver_test_5.o): New target.
15169 (check_SCRIPTS): Add ver_test_5.sh.
15170 (check_DATA): Add ver_test_5.syms.
15171 (ver_test_5.syms): New target.
15172 * testsuite/ver_test_5.cc: New file.
15173 * testsuite/ver_test_5.script: New file.
15174 * testsuite/ver_test_5.sh: New file.
15175 * Makefile.in, testsuite/Makefile.in: Rebuild.
15176
04bf7072
ILT
15177 PR gold/5986
15178 Fix problems building gold with gcc 4.3.0.
15179 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
15180 (gold_error_at_location, gold_warning_at_location): Use it.
15181 * configure.ac: Check whether we can compile and use a template
15182 function with a printf attribute.
15183 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
15184 when jumping over bytes.
15185 * object.cc: Instantiate Object::read_section_data.
15186 * debug.h: Include <cstring>
15187 * dwarf_reader.cc: Include <algorithm>
15188 * main.cc: Include <cstring>.
15189 * options.cc: Include <cstring>.
15190 * output.cc: Include <cstring>.
15191 * script.cc: Include <cstring>.
15192 * script.h: Include <string>.
15193 * symtab.cc: Include <cstring> and <algorithm>.
15194 * target-select.cc: Include <cstring>.
15195 * version.cc: Include <string>.
15196 * testsuite/testmain.cc: Include <cstdlib>.
15197 * configure, config.in: Rebuild.
15198
874c5b28
ILT
151992008-03-25 Ian Lance Taylor <iant@google.com>
15200
819d6c3a
ILT
15201 * options.cc: Include "../bfd/bfdver.h".
15202 (options::help): Print bug reporting address.
15203
f4b2c6f5
ILT
15204 * version.cc (print_version): Adjust output for current value of
15205 BFD_VERSION_STRING.
15206
15207 * NEWS: New file.
15208
e96caa79
ILT
15209 * options.cc (options::help): Print list of supported targets.
15210 * target-select.h: Include <vector>.
15211 (class Target_selector): Make machine_, size_, and is_big_endian_
15212 fields const. Add bfd_name_ and instantiated_target_ fields.
15213 (Target_selector::Target_selector): Add bfd_name parameter.
15214 (Target_selector::recognize): Make non-virtual, call
15215 do_recognize.
15216 (Target_selector::recognize_by_name): Make non-virtual, call
15217 do_recognize_by_name.
15218 (Target_selector::supported_names): New function.
15219 (Target_selector::bfd_name): New function.
15220 (Target_selector::do_instantiate_target): New pure virtual
15221 function.
15222 (Target_selector::do_recognize): New virtual function.
15223 (Target_selector::do_recognize_by_name): New virtual function.
15224 (Target_selector::instantiate_target): New private function.
15225 (supported_target_names): Declare.
15226 * target-select.cc (Target_selector::Target_selector): Update for
15227 new parameter and fields.
15228 (select_target_by_name): Check that the name matches before
15229 calling recognize_by_name.
15230 (supported_target_names): New function.
15231 * i386.cc (class Target_selector_i386): Update Target_selector
15232 constructor call. Remove recognize and recognize_by_name. Add
15233 do_instantiate_target.
15234 * x86_64.cc (class Target_selector_x86_64): Likewise.
15235 * testsuite/testfile.cc (class Target_selector_test): Update for
15236 changes to Target_selector.
15237
874c5b28
ILT
15238 * README: Rewrite, with some notes on unsupported features.
15239
0a65a3a7
CC
152402008-03-24 Cary Coutant <ccoutant@google.com>
15241
15242 * i386.cc (Target_i386::Got_type): New enum declaration.
15243 (Target_i386::Scan::local): Updated callers of Output_data_got
15244 member functions.
15245 (Target_i386::Scan::global): Likewise.
15246 (Target_i386::Relocate::relocate): Likewise.
15247 (Target_i386::Relocate::relocate_tls): Likewise.
15248 * object.h (Got_offset_list): New class.
15249 (Sized_relobj::local_has_got_offset): Added got_type parameter.
15250 (Sized_relobj::local_got_offset): Likewise.
15251 (Sized_relobj::set_local_got_offset): Likewise.
15252 (Sized_relobj::local_has_tls_got_offset): Removed.
15253 (Sized_relobj::local_tls_got_offset): Removed.
15254 (Sized_relobj::set_local_tls_got_offset): Removed.
15255 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
15256 * output.cc (Output_data_got::add_global): Added got_type parameter.
15257 (Output_data_got::add_global_with_rel): Likewise.
15258 (Output_data_got::add_global_with_rela): Likewise.
15259 (Output_data_got::add_global_pair_with_rel): New function.
15260 (Output_data_got::add_global_pair_with_rela): New function.
15261 (Output_data_got::add_local): Added got_type parameter.
15262 (Output_data_got::add_local_with_rel): Likewise.
15263 (Output_data_got::add_local_with_rela): Likewise.
15264 (Output_data_got::add_local_pair_with_rel): New function.
15265 (Output_data_got::add_local_pair_with_rela): New function.
15266 (Output_data_got::add_global_tls): Removed.
15267 (Output_data_got::add_global_tls_with_rel): Removed.
15268 (Output_data_got::add_global_tls_with_rela): Removed.
15269 (Output_data_got::add_local_tls): Removed.
15270 (Output_data_got::add_local_tls_with_rel): Removed.
15271 (Output_data_got::add_local_tls_with_rela): Removed.
15272 * output.h (Output_data_got::add_global): Added got_type parameter.
15273 (Output_data_got::add_global_with_rel): Likewise.
15274 (Output_data_got::add_global_with_rela): Likewise.
15275 (Output_data_got::add_global_pair_with_rel): New function.
15276 (Output_data_got::add_global_pair_with_rela): New function.
15277 (Output_data_got::add_local): Added got_type parameter.
15278 (Output_data_got::add_local_with_rel): Likewise.
15279 (Output_data_got::add_local_with_rela): Likewise.
15280 (Output_data_got::add_local_pair_with_rel): New function.
15281 (Output_data_got::add_local_pair_with_rela): New function.
15282 (Output_data_got::add_global_tls): Removed.
15283 (Output_data_got::add_global_tls_with_rel): Removed.
15284 (Output_data_got::add_global_tls_with_rela): Removed.
15285 (Output_data_got::add_local_tls): Removed.
15286 (Output_data_got::add_local_tls_with_rel): Removed.
15287 (Output_data_got::add_local_tls_with_rela): Removed.
15288 * resolve.cc (Symbol::override_base_with_special): Removed
15289 reference to has_got_offset_ field.
15290 * symtab.cc (Symbol::init_fields): Replaced initialization
15291 of got_offset_ with got_offsets_. Removed initialization
15292 of has_got_offset_
53fcba31 15293 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
15294 (Symbol::got_offset): Likewise.
15295 (Symbol::set_got_offset): Likewise.
15296 (Symbol::has_tls_got_offset): Removed.
15297 (Symbol::tls_got_offset): Removed.
15298 (Symbol::set_tls_got_offset): Removed.
15299 (Symbol::got_offset_): Removed.
15300 (Symbol::tls_mod_got_offset_): Removed.
15301 (Symbol::tls_pair_got_offset_): Removed.
15302 (Symbol::got_offsets_): New field.
15303 (Symbol::has_got_offset): Removed.
15304 (Symbol::has_tls_mod_got_offset): Removed.
15305 (Symbol::has_tls_pair_got_offset): Removed.
15306 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
15307 (Target_x86_64::Scan::local): Updated callers of Output_data_got
15308 member functions.
15309 (Target_x86_64::Scan::global): Likewise.
15310 (Target_x86_64::Relocate::relocate): Likewise.
15311 (Target_x86_64::Relocate::relocate_tls): Likewise.
15312
bd52eafb
BE
153132008-03-25 Ben Elliston <bje@au.ibm.com>
15314
15315 * yyscript.y: Fix spelling error in comment.
15316
8b105e34
ILT
153172008-03-24 Ian Lance Taylor <iant@google.com>
15318
8ed814a9
ILT
15319 * options.h (class General_options): Define build_id option.
15320 * layout.h (class Layout): Declare write_build_id, create_note,
15321 create_build_id. Add build_id_note_ member.
15322 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
15323 "libiberty.h", "md5.h", "sha1.h".
15324 (Layout::Layout): Initialize eh_frame_data_,
15325 eh_frame_hdr_section_, and build_id_note_.
15326 (Layout::finalize): Call create_build_id.
15327 (Layout::create_note): New function, broken out of
15328 Layout::create_gold_note.
15329 (Layout::create_gold_note): Call create_note.
15330 (Layout::create_build_id): New function.
15331 (Layout::write_build_id): New function.
15332 (Close_task_runner::run): Call write_build_id.
15333
8b105e34
ILT
15334 * x86_64.cc: Correct license to GPLv3.
15335
086a1841
ILT
153362008-03-23 Ian Lance Taylor <iant@google.com>
15337
15338 * options.cc: Include "demangle.h".
15339 (parse_optional_string): New function.
15340 (parse_long_option): Handle takes_optional_argument.
15341 (parse_short_option): Update dash_z initializer. Handle
15342 takes_optional_argument.
15343 (General_options::General_options): Initialize do_demangle_.
15344 (General_options::finalize): Set do_demangle_. Handle demangling
15345 style.
15346 * options.h (parse_optional_string): Declare.
15347 (struct One_option): Add optional_arg field. Update constructor.
15348 Update call constructor calls. Add takes_optional_argument
15349 function.
15350 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
15351 (DEFINE_optional_string): Define.
15352 (General_options::demangle): Change from DEFINE_bool to
15353 DEFINE_optional_string.
15354 (General_options::no_demangle): New function.
15355 (General_options::do_demangle): New function.
15356 (General_options::set_do_demangle): New function.
15357 (General_options::execstack_status_): Move definition to end of
15358 class definition.
15359 (General_options::static_): Likewise.
15360 (General_options::do_demangle_): New field.
15361 * object.cc (big_endian>::get_symbol_location_info): Call
15362 Options::do_demangle, not Options::demangle.
15363 * symtab.cc (demangle): Likewise.
15364
cbb93e63
ILT
153652008-03-22 Ian Lance Taylor <iant@google.com>
15366
15367 * gold.h: Include <cstddef> and <sys/types.h>
15368 * options.h: Include <cstring>.
15369
ec531623
ILT
153702008-03-21 Ian Lance Taylor <iant@google.com>
15371
15372 * Added source code to GNU binutils.
752937aa 15373\f
0c6e6c39 15374Copyright (C) 2008-2013 Free Software Foundation, Inc.
752937aa
NC
15375
15376Copying and distribution of this file, with or without modification,
15377are permitted in any medium without royalty provided the copyright
15378notice and this notice are preserved.
15379
15380Local Variables:
15381mode: change-log
15382left-margin: 8
15383fill-column: 74
15384version-control: never
15385End:
This page took 1.17318 seconds and 4 git commands to generate.