]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gold/ChangeLog
* gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
[thirdparty/binutils-gdb.git] / gold / ChangeLog
CommitLineData
97b4be1c
CC
12010-08-19 Neil Vachharajani <nvachhar@google.com>
2 Cary Coutant <ccoutant@google.com>
3
4 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
5 constructor, and set_blocker.
6 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
7 readsyms_blocker_.
8 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
9 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
10 * testsuite/Makefile.am (start_lib_test): New test case.
11 * testsuite/Makefile.in: Regenerate.
12 * testsuite/start_lib_test_main.c: New file.
13 * testsuite/start_lib_test_1.c: New file.
14 * testsuite/start_lib_test_2.c: New file.
15 * testsuite/start_lib_test_3.c: New file.
16
dd0b1884
ILT
172010-08-19 Ian Lance Taylor <iant@google.com>
18
19 * Makefile.in: Rebuild with automake 1.11.1.
20 * aclocal.m4: Likewise.
21 * testsuite/Makefile.in: Likewise.
22
7223e9ca
ILT
232010-08-19 Ian Lance Taylor <iant@google.com>
24
25 PR 10893
26 * i386.cc (class Output_data_plt_i386): Update declarations.
27 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
28 local_ifuncs_ fields.
29 (Target_i386::do_plt_section_for_global): New function.
30 (Target_i386::do_plt_section_for_local): New function.
31 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
32 parameter; change all callers. Initialize global_ifuncs_ and
33 local_ifuncs_. If doing a static link define __rel_iplt_start and
34 __rel_iplt_end.
35 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
36 (Output_data_plt_i386::add_local_ifunc_entry): New function.
37 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
38 symbols.
39 (Target_i386::make_plt_section): New function, broken out of
40 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
41 (Target_i386::make_plt_entry): Call make_plt_section.
42 (Target_i386::make_local_ifunc_plt_entry): New function.
43 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
44 (Target_i386::Scan::local): Handle IFUNC symbols. Add
45 R_386_IRELATIVE to switch.
46 (Target_i386::Scan::global): Likewise.
47 (Target_i386::Relocate::relocate): Likewise.
48 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
49 switch.
50 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
51 (Target_x86_64::do_plt_section_for_global): New function.
52 (Target_x86_64::do_plt_section_for_local): New function.
53 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
54 parameter; change all callers. If doing a static link define
55 __rela_iplt_start and __rela_iplt_end.
56 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
57 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
58 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
59 to point to .plt.
60 (Target_x86_64::make_local_ifunc_plt_entry): New function.
61 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
62 switch.
63 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
64 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
65 R_X86_64_IRELATIVE to switch.
66 (Target_x86_64::Scan::global): Likewise.
67 (Target_x86_64::Relocate::relocate): Likewise.
68 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
69 switch.
70 * target.h (class Target): Add plt_section_for_global and
71 plt_section_for_local functions. Add do_plt_section_for_global
72 and do_plt_section_for_local virtual functions.
73 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
74 clarifying comments.
75 (Symbol::use_plt_offset): Handle IFUNC symbol.
76 * object.cc (Sized_relobj::Sized_relobj): Initialize
77 local_plt_offsets_.
78 (Sized_relobj::local_has_plt_offset): New function.
79 (Sized_relobj::local_plt_offset): New function.
80 (Sized_relobj::set_local_plt_offset): New function.
81 (Sized_relobj::do_count): Handle IFUNC symbol.
82 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
83 a bit away from input_shndx_ field. Add set_is_func_symbol and
84 is_ifunc_symbol functions.
85 (class Sized_relobj): Update declarations. Remove Tls_got_entry
86 and Local_tls_got_offsets. Define Local_plt_offsets. Add
87 local_plt_offsets_ field.
88 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
89 * output.h (class Output_section_data): Add non-const
90 output_section function.
91 (class Output_data_got): Update declarations.
92 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
93 Add use_plt_offset parameter to global and local constructors.
94 Change all callers. Change local_sym_index_ field to 31 bits.
95 Change GSYM_CODE and CONSTANT_CODE accordingly.
96 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
97 doing a static link don't set sh_link field.
98 (Output_data_got::Got_entry::write): Use PLT offset if
99 appropriate.
100 (Output_data_got::add_global_plt): New function.
101 (Output_data_got::add_local_plt): New function.
102 * target-reloc.h (relocate_section): Handle IFUNC symbol.
103 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
104 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
105 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
106 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
107 IFUNC conditional.
108 * testsuite/ifunc-sel.h: New file.
109 * testsuite/ifuncmain1.c: New file.
110 * testsuite/ifuncmain1vis.c: New file.
111 * testsuite/ifuncmod1.c: New file.
112 * testsuite/ifuncdep2.c: New file.
113 * testsuite/ifuncmain2.c: New file.
114 * testsuite/ifuncmain3.c: New file.
115 * testsuite/ifuncmod3.c: New file.
116 * testsuite/ifuncmain4.c: New file.
117 * testsuite/ifuncmain5.c: New file.
118 * testsuite/ifuncmod5.c: New file.
119 * testsuite/ifuncmain6pie.c: New file.
120 * testsuite/ifuncmod6.c: New file.
121 * testsuite/ifuncmain7.c: New file.
122 * configure, testsuite/Makefile.in: Rebuild.
123
56f75c03
ILT
1242010-08-18 Ian Lance Taylor <iant@google.com>
125
126 * incremental.cc
127 (Output_section_incremental_inputs::write_input_files): Add cast
128 to avoid signed/unsigned comparison warning.
129 (Output_section_incremental_inputs::write_info_blocks): Likewise.
130
55455f89
CC
1312010-08-12 Cary Coutant <ccoutant@google.com>
132
133 * common.cc (Sort_commons::operator()): Remove unnecessary code.
134
e2054bcb
ILT
1352010-08-13 Ian Lance Taylor <iant@google.com>
136
137 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
138
74f67560
DK
1392010-08-12 Cary Coutant <ccoutant@google.com>
140 Doug Kwan <dougkwan@google.com>
141
142 * resolve.cc (Symbol_table::should_override): When a weak dynamic
143 defintion overrides non-weak undef, remember that the original undef
144 is not weak.
145 * symtab.cc (Symbol_table::sized_write_global): For undef without
146 an original weak binding, set binding to global in output.
147 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
148 * testsuite/Makefile.in: Regenerate.
149 * testsuite/strong_ref_weak_def.sh: New file.
150 * testsuite/strong_ref_weak_def_1.c: Ditto.
151 * testsuite/strong_ref_weak_def_2.c: Ditto.
152
d1238d12
CC
1532010-08-12 Cary Coutant <ccoutant@google.com>
154
155 * testsuite/incremental_test.sh: Rewrite.
156 * testsuite/incremental_test_1.c: Rewrite.
157 * testsuite/incremental_test_2.c: Rewrite.
158
0e70b911
CC
1592010-08-12 Cary Coutant <ccoutant@google.com>
160
161 * arm.cc (Target_arm::got_size): Add const.
162 (Target_arm::got_entry_count): New function.
163 (Target_arm::plt_entry_count): New function.
164 (Target_arm::first_plt_entry_offset): New function.
165 (Target_arm::plt_entry_size): New function.
166 (Output_data_plt_arm::entry_count): New function.
167 (Output_data_plt_arm::first_plt_entry_offset): New function.
168 (Output_data_plt_arm::get_plt_entry_size): New function.
169 * i386.cc (Target_i386::got_size): Add const.
170 (Target_i386::got_entry_count): New function.
171 (Target_i386::plt_entry_count): New function.
172 (Target_i386::first_plt_entry_offset): New function.
173 (Target_i386::plt_entry_size): New function.
174 (Output_data_plt_i386::entry_count): New function.
175 (Output_data_plt_i386::first_plt_entry_offset): New function.
176 (Output_data_plt_i386::get_plt_entry_size): New function.
177 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
178 find_incremental_inputs_sections. Dump incremental_got_plt section.
179 * incremental.cc: Include target.h.
180 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
181 parameter. Adjust all callers. Find incremental_got_plt section.
182 (Incremental_inputs::create_data_sections): Create incremental_got_plt
183 section.
184 (Output_section_incremental_inputs::set_final_data_size): Calculate
185 size of incremental_got_plt section.
186 (Output_section_incremental_inputs::do_write): Write the
187 incremental_got_plt section.
188 (Got_plt_view_info): New struct.
189 (Local_got_offset_visitor): New class.
190 (Global_got_offset_visitor): New class.
191 (Global_symbol_visitor_got_plt): New class.
192 (Output_section_incremental_inputs::write_got_plt): New function.
193 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
194 Add parameter. Adjust all callers.
195 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
196 (Incremental_inputs::got_plt_section): New function.
197 (Incremental_inputs::got_plt_section_): New data member.
198 (Incremental_got_plt_reader): New class.
199 * layout.cc (Layout::create_incremental_info_sections): Add the
200 incremental_got_plt section.
201 * object.h (Got_offset_list::get_list): New function.
202 (Got offset_list::for_all_got_offsets): New function.
203 (Sized_relobj::local_got_offset_list): New function.
204 * powerpc.cc (Target_powerpc::got_size): Add const.
205 (Target_powerpc::got_entry_count): New function.
206 (Target_powerpc::plt_entry_count): New function.
207 (Target_powerpc::first_plt_entry_offset): New function.
208 (Target_powerpc::plt_entry_size): New function.
209 (Output_data_plt_powerpc::entry_count): New function.
210 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
211 (Output_data_plt_powerpc::get_plt_entry_size): New function.
212 * sparc.cc (Target_sparc::got_size): Add const.
213 (Target_sparc::got_entry_count): New function.
214 (Target_sparc::plt_entry_count): New function.
215 (Target_sparc::first_plt_entry_offset): New function.
216 (Target_sparc::plt_entry_size): New function.
217 (Output_data_plt_sparc::entry_count): New function.
218 (Output_data_plt_sparc::first_plt_entry_offset): New function.
219 (Output_data_plt_sparc::get_plt_entry_size): New function.
220 * symtab.h (Symbol::got_offset_list): New function.
221 (Symbol_table::for_all_symbols): New function.
222 * target.h (Sized_target::got_entry_count): New function.
223 (Sized_target::plt_entry_count): New function.
224 (Sized_target::plt_entry_size): New function.
225 * x86_64.cc (Target_x86_64::got_size): Add const.
226 (Target_x86_64::got_entry_count): New function.
227 (Target_x86_64::plt_entry_count): New function.
228 (Target_x86_64::first_plt_entry_offset): New function.
229 (Target_x86_64::plt_entry_size): New function.
230 (Output_data_plt_x86_64::entry_count): New function.
231 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
232 (Output_data_plt_x86_64::get_plt_entry_size): New function.
233
09ec0418
CC
2342010-08-12 Cary Coutant <ccoutant@google.com>
235
236 * archive.cc: Include incremental.h.
237 (Archive::Archive): Initialize incremental_info_.
238 (Archive::include_member): Record archive members in incremental info.
239 (Add_archive_symbols::run): Record begin and end of an archive in
240 incremental info.
241 (Lib_group::include_member): Record objects in incremental info.
242 * archive.h (Incremental_archive_entry): Forward declaration.
243 (Archive::set_incremental_info): New member function.
244 (Archive::incremental_info): New member function.
245 (Archive::Unused_symbol_iterator): New class.
246 (Archive::unused_symbols_begin): New member function.
247 (Archive::unused_symbols_end): New member function.
248 (Archive::incremental_info_): New data member.
249 * incremental-dump.cc (find_input_containing_global): New function.
250 (dump_incremental_inputs): Dump new incremental info sections.
251 * incremental.cc: Include symtab.h.
252 (Output_section_incremental_inputs): New class.
253 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
254 new incremental info sections.
255 (Sized_incremental_binary::do_check_inputs): Likewise.
256 (Incremental_inputs::report_archive): Remove.
257 (Incremental_inputs::report_archive_begin): New function.
258 (Incremental_inputs::report_archive_end): New function.
259 (Incremental_inputs::report_object): New function.
260 (Incremental_inputs::finalize_inputs): Remove.
261 (Incremental_inputs::report_input_section): New function.
262 (Incremental_inputs::report_script): Rewrite.
263 (Incremental_inputs::finalize): Do nothing but finalize string table.
264 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
265 (Incremental_inputs::sized_create_inputs_section_data): Remove.
266 (Incremental_inputs::create_data_sections): New function.
267 (Incremental_inputs::relocs_entsize): New function.
268 (Output_section_incremental_inputs::set_final_data_size): New function.
269 (Output_section_incremental_inputs::do_write): New function.
270 (Output_section_incremental_inputs::write_header): New function.
271 (Output_section_incremental_inputs::write_input_files): New function.
272 (Output_section_incremental_inputs::write_info_blocks): New function.
273 (Output_section_incremental_inputs::write_symtab): New function.
274 * incremental.h (Incremental_script_entry): Forward declaration.
275 (Incremental_object_entry): Forward declaration.
276 (Incremental_archive_entry): Forward declaration.
277 (Incremental_inputs): Forward declaration.
278 (Incremental_inputs_header_data): Remove.
279 (Incremental_inputs_header): Remove.
280 (Incremental_inputs_header_write): Remove.
281 (Incremental_inputs_entry_data): Remove.
282 (Incremental_inputs_entry): Remove.
283 (Incremental_inputs_entry_write): Remove.
284 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
285 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
286 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
287 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
288 Likewise.
289 (Incremental_input_entry): New class.
290 (Incremental_script_entry): New class.
291 (Incremental_object_entry): New class.
292 (Incremental_archive_entry): New class.
293 (Incremental_inputs::Incremental_inputs): Initialize new data members.
294 (Incremental_inputs::report_inputs): Remove.
295 (Incremental_inputs::report_archive): Remove.
296 (Incremental_inputs::report_archive_begin): New function.
297 (Incremental_inputs::report_archive_end): New function.
298 (Incremental_inputs::report_object): Change prototype.
299 (Incremental_inputs::report_input_section): New function.
300 (Incremental_inputs::report_script): Change prototype.
301 (Incremental_inputs::get_reloc_count): New function.
302 (Incremental_inputs::set_reloc_count): New function.
303 (Incremental_inputs::create_data_sections): New function.
304 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
305 (Incremental_inputs::inputs_section): New function.
306 (Incremental_inputs::symtab_section): New function.
307 (Incremental_inputs::relocs_section): New function.
308 (Incremental_inputs::get_stringpool): Add const.
309 (Incremental_inputs::command_line): Add const.
310 (Incremental_inputs::inputs): Remove.
311 (Incremental_inputs::command_line_key): New function.
312 (Incremental_inputs::input_file_count): New function.
313 (Incremental_inputs::input_files): New function.
314 (Incremental_inputs::relocs_entsize): New function.
315 (Incremental_inputs::sized_create_inputs_section_data): Remove.
316 (Incremental_inputs::finalize_inputs): Remove.
317 (Incremental_inputs::Input_info): Remove.
318 (Incremental_inputs::lock_): Remove.
319 (Incremental_inputs::inputs_): Change type.
320 (Incremental_inputs::inputs_map_): Remove.
321 (Incremental_inputs::current_object_entry_): New data member.
322 (Incremental_inputs::inputs_section_): New data member.
323 (Incremental_inputs::symtab_section_): New data member.
324 (Incremental_inputs::relocs_section_): New data member.
325 (Incremental_inputs::reloc_count_): New data member.
326 (Incremental_inputs_reader): New class.
327 (Incremental_symtab_reader): New class.
328 (Incremental_relocs_reader): New class.
329 * layout.cc (Layout::finalize): Move finalization of incremental info
330 and creation of incremental info sections to follow finalization of
331 symbol table. Set offsets for postprocessing sections.
332 (Layout::create_incremental_info_sections): Call
333 Incremental_inputs::create_data_sections. Add incremental symtab
334 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
335 sections to layout after input sections.
336 * layout.h (struct Timespec): Forward declaration.
337 (Layout::incremental_inputs): Add const.
338 (Layout::create_incremental_info_sections): Add parameter.
339 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
340 * object.cc: Include incremental.h.
341 (Relobj::finalize_incremental_relocs): New function.
342 (Sized_relobj::do_layout): Record input sections in incremental info.
343 * object.h (Object::output_section): New function.
344 (Object::output_section_offset): Moved from Relobj.
345 (Object::get_incremental_reloc_base): New function.
346 (Object::get_incremental_reloc_count): New function.
347 (Object::do_output_section): New function.
348 (Object::do_output_section_offset): Moved from Relobj.
349 (Object::do_get_incremental_reloc_base): New function.
350 (Object::do_get_incremental_reloc_count): New function.
351 (Object::Object): Initialize new data members.
352 (Relobj::output_section): Renamed do_output_section and moved to
353 protected.
354 (Relobj::output_section_offset): Moved to Object.
355 (Relobj::do_get_incremental_reloc_base): New function.
356 (Relobj::do_get_incremental_reloc_count): New function.
357 (Relobj::allocate_incremental_reloc_counts): New function.
358 (Relobj::count_incremental_reloc): New function.
359 (Relobj::finalize_incremental_relocs): New function.
360 (Relobj::next_incremental_reloc_index): New function.
361 (Relobj::reloc_counts_): New data member.
362 (Relobj::reloc_bases_): New data member.
363 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
364 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
365 (Sized_relobj::incremental_relocs_scan): New function.
366 (Sized_relobj::incremental_relocs_scan_reltype): New function.
367 (Sized_relobj::incremental_relocs_write): New function.
368 (Sized_relobj::incremental_relocs_write_reltype): New function.
369 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
370 incremental link.
371 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
372 archives and object files elsewhere.
373 (Add_symbols::run): Report object files here.
374 (Finish_group::run): Report end of archive at end of group.
375 * reloc.cc: Include layout.h, incremental.h.
376 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
377 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
378 (Sized_relobj::incremental_relocs_scan): New function.
379 (Sized_relobj::incremental_relocs_scan_reltype): New function.
380 (Sized_relobj::do_relocate_sections): Write incremental relocations.
381 (Sized_relobj::incremental_relocs_write): New function.
382 (Sized_relobj::incremental_relocs_write_reltype): New function.
383 * script.cc (read_input_script): Rewrite test for incremental link.
384 Change call to Incremental_inputs::report_script.
385 * symtab.h (Symbol_table::first_global_index): New function.
386 (Symbol_table::output_count): New function.
387
ce0d1972
DK
3882010-08-12 Doug Kwan <dougkwan@google.com>
389
390 * arm.cc (Target_arm::merge_object_attributes): Check command line
391 options --no-wchar-size-warning and --no-enum-size-warning.
392 * options.h (General_options): Add ld-compatible options
393 --no-enum-size-warning and --no-wchar-size-warning.
394
6e5710ce
ILT
3952010-08-04 Ian Lance Taylor <iant@google.com>
396
397 * x86_64.cc (Target_x86_64::Scan::local): Use
398 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
399 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
400 (Target_x86_64::Scan::global): Likewise.
401 (Target_x86_64::Relocate::relocate): Likewise.
402 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
403 Likewise.
404
fef830db
CC
4052010-08-03 Cary Coutant <ccoutant@google.com>
406
407 * merge.cc (Output_merge_string::do_add_input_section): Count strings
408 to reserve space in merged_strings vector. Keep total input size
409 for stats.
410 (Output_merge_string::do_print_merge_stats): Print total input size.
411 * merge.h (Output_merge_string): Add input_size_ field.
412 * stringpool.cc (Stringpool_template::string_length): Move
413 implementations out of Stringpool_template class and place in
414 stringpool.h.
415 * stringpool.h (string_length): Move out of Stringpool_template.
416
1e3811b0
ILT
4172010-08-03 Ian Lance Taylor <iant@google.com>
418
419 PR 11712
420 * layout.cc (relaxation_loop_body): If address of load segment is
421 set, adjust address to include headers if possible.
422
7af0c620
ILT
4232010-08-03 Ian Lance Taylor <iant@google.com>
424
425 * version.cc (version_string): Bump to 1.10.
426
22f0da72
ILT
4272010-08-03 Ian Lance Taylor <iant@google.com>
428
429 PR 11805
430 * layout.h (enum Output_section_order): Define.
431 (class Layout): Update declarations.
432 * layout.cc (Layout::get_output_section): Add order parameter.
433 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
434 is_first_non_relro parameters. Change all callers.
435 (Layout::choose_output_section): Likewise.
436 (Layout::add_output_section_data): Likewise.
437 (Layout::make_output_section): Likewise. Set order.
438 (Layout::default_section_order): New function.
439 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
440 * output.cc (Output_section::Output_section): Initialize order_.
441 Don't initialize deleted fields.
442 (Output_segment::Output_segment): Don't initialize deleted
443 fields.
444 (Output_segment::add_output_section_to_load): New function
445 replacing add_output_section. Change all callers to call this or
446 add_output_section_to_nonload.
447 (Output_segment::add_output_section_to_nonload): New function.
448 (Output_segment::remove_output_section): Rewrite.
449 (Output_segment::add_initial_output_data): Likewise.
450 (Output_segment::has_any_data_sections): Likewise.
451 (Output_segment::is_first_section_relro): Likewise.
452 (Output_segment::maximum_alignment): Likewise.
453 (Output_segment::has_dynamic_reloc): New function replacing
454 dynamic_reloc_count. Change all callers.
455 (Output_segment::has_dynamic_reloc_list): New function replacing
456 dynamic_reloc_count_list. Change all callers.
457 (Output_segment::set_section_addresses): Rewrite.
458 (Output_segment::set_offset): Rewrite.
459 (Output_segment::find_first_and_last_list): Remove.
460 (Output_segment::set_tls_offsets): Rewrite.
461 (Output_segment::first_section_load_address): Likewise.
462 (Output_segment::output_section_count): Likewise.
463 (Output_segment::section_with_lowest_load_address): Likewise.
464 (Output_segment::write_section_headers): Likewise.
465 (Output_segment::print_sections_to_map): Likewise.
466 * output.h (class Output_data): Remove dynamic_reloc_count_
467 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
468 (Output_data::add_dynamic_reloc): Rewrite.
469 (Output_data::has_dynamic_reloc): New function.
470 (Output_data::dynamic_reloc_count): Remove.
471 (class Output_section): Add order_ field. Remvoe is_relro_local_,
472 is_last_relro_, is_first_non_relro_, is_interp_,
473 is_dynamic_linker_section_ fields. Add order and set_order
474 functions. Remove is_relro_local, set_is_relro_local,
475 is_last_relro, set_is_last_relro, is_first_non_relro,
476 set_is_first_non_relro functions, is_interp, set_is_interp,
477 is_dynamic_linker_section, and set_is_dynamic_linker_section
478 functions.
479 (class Output_segment): Change Output_data_list from std::list to
480 std:;vector. Add output_lists_ field. Remove output_data_ and
481 output_bss_ fields. Update declarations.
482
3ff2ccb0
ILT
4832010-08-02 Ian Lance Taylor <iant@google.com>
484
485 * arm.cc (Target_arm::gc_process_relocs): Use typename.
486 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
487 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
488
88a4108b
ILT
4892010-08-02 Ian Lance Taylor <iant@google.com>
490
491 PR 11855
492 * script.cc (Script_options::Script_options): Initialize
493 symbol_definitions_ and symbol_references_.
494 (Script_options::add_symbol_assignment): Update
495 symbol_definitions_ and symbol_references_.
496 (Script_options::add_symbol_reference): New function.
497 (script_symbol): New function.
498 * script.h (class Script_options): Add symbol_definitions_ and
499 symbol_references_ fields.
500 (Script_options::referenced_const_iterator): New type.
501 (Script_options::referenced_begin): New function.
502 (Script_options::referenced_end): New function.
503 (Script_options::is_referenced): New function.
504 (Script_options::any_unreferenced): New function.
505 * script-c.h (script_symbol): Declare.
506 * yyscript.y (exp): Call script_symbol.
507 * symtab.cc: Include "script.h".
508 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
509 Change all callers. Check symbols referenced by scripts.
510 (Symbol_table::add_undefined_symbols_from_command_line): Add
511 layout parameter. Change all callers.
512 (Symbol_table::do_add_undefined_symbols_from_command_line):
513 Likewise. Break out loop body. Check symbols referenced by
514 scripts.
515 (Symbol_table::add_undefined_symbol_from_command_line): New
516 function broken out of
517 do_add_undefined_symbols_from_command_line.
518 * symtab.h (class Symbol_table): Update declarations.
519 * archive.cc: Include "layout.h".
520 (Archive::should_include_member): Add layout parameter. Change
521 all callers. Check for symbol mentioned in expression.
522 * archive.h (class Archive): Update declaration.
523 * object.cc (Sized_relobj::do_should_include_member): Add layout
524 parameter.
525 * object.h (Object::should_include_member): Add layout parameter.
526 Change all callers.
527 (Object::do_should_include_member): Add layout parameter.
528 (class Sized_relobj): Update declaration.
529 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
530 parameter.
531 * dynobj.h (class Sized_dynobj): Update declaration.
532 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
533 layout parameter.
534 * plugin.h (class Sized_pluginobj): Update declaration.
535
5f1ab67a
ILT
5362010-08-02 Ian Lance Taylor <iant@google.com>
537
538 PR 11866
539 * output.cc (Output_segment::set_offset): Search for the first and
540 last sections rather than assuming that the list is in order.
541 (Output_segment::find_first_and_last_list): New function.
542 * output.h (class Output_segment): Update declarations.
543 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
544 (relro_strip_test_SOURCES): New variable.
545 (relro_strip_test_DEPENDENCIES): New variable.
546 (relro_strip_test_LDFLAGS): New variable.
547 (relro_strip_test_LDADD): New variable.
548 (relro_strip_test.so): New target.
549
a8df5856
ILT
5502010-08-02 Ian Lance Taylor <iant@google.com>
551
552 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
553 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
554 (Target_i386::got_tlsdesc_section): New function.
555 (Target_i386::got_section): Create space for GOT entries for
556 TLSDESC relocations.
557 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
558 R_386_TLS_GOTDESC.
559 (Target_i386::Scan::global): Likewise.
560 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
561 using TLSDESC GOT.
562 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
563 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
564 (Target_x86_64::got_tlsdesc_section): New function.
565 (Target_x86_64::got_section): Create space for GOT entries for
566 TLSDESC relocations.
567 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
568 R_386_TLS_GOTDESC.
569 (Target_x86_64::Scan::global): Likewise.
570 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
571 using TLSDESC GOT.
572
0c10a0a6
ILT
5732010-08-02 Ian Lance Taylor <iant@google.com>
574
575 * testsuite/final_layout.sh: Use dc to convert from hex to
576 decimal.
577
41cbeecc
ST
5782010-07-29 Sriraman Tallam <tmsriram@google.com>
579
580 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
581 paramter to the call to gold::gc_process_relocs.
582 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
583 paramter to the call to gold::gc_process_relocs.
584 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
585 parameter to the call to gold::gc_process_relocs.
586 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
587 template parameter to the call to gold::gc_process_relocs.
588 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
589 paramter to the call to gold::gc_process_relocs.
590 * gc.h (get_embedded_addend_size): New function.
591 (gc_process_relocs): Save the size of the reloc for use by ICF.
592 * icf.cc (get_section_contents): Get the addend from the text section
593 for SHT_REL relocation sections.
594 * icf.h (Icf::Reloc_addend_size_info): New typedef.
595 (Icf::Reloc_info): Add new member reloc_addend_size_info.
596 * int_encoding.h (read_from_pointer): New overloaded function.
597 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
598 * testsuite/icf_sht_rel_addend_test.sh: New file.
599 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
600 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
601
6ea55b82
RW
6022010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
603
604 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
605 * Makefile.in: Regenerate.
606 * testsuite/Makefile.in: Regenerate.
607
9691462b
ILT
6082010-07-27 Jeffrey Yasskin <jyasskin@google.com>
609
610 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
611 * gold/testsuite/debug_msg.cc: Likewise.
612 * gold/testsuite/odr_violation1.cc
613 * gold/testsuite/odr_violation2.cc
614
76897331
CC
6152010-07-21 Cary Coutant <ccoutant@google.com>
616
617 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
618 string, and length fields.
619 (Output_merge_string::Merged_strings_list): New type.
620 (Output_merge_string::Merged_strings_lists): New typedef.
621 (Output_merge_string): Replace merged_strings_ with
622 merged_strings_lists_.
623 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
624 Merged_strings_list per input object and section. Don't store pointer
625 to the string. Don't store length with each merged string entry.
626 (Output_merge_string::finalize_merged_data): Loop over list of merged
627 strings lists. Recompute length of each merged string.
628
78384e8f
CC
6292010-07-15 Cary Coutant <ccoutant@google.com>
630
631 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
632 here.
633
783659f9
ILT
6342010-07-14 Ian Lance Taylor <iant@google.com>
635
636 * descriptors.cc (Descriptors::open): Report correct name in error
637 message.
638
131687b4
DK
6392010-07-13 Doug Kwan <dougkwan@google.com>
640
641 * arm.cc (Arm_input_section::Arm_input_section): For a
642 SHT_ARM_EXIDX section, always keeps the input sections.
643 (Arm_input_section::set_exidx_section_link): New method.
644 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
645 has_errors_ to false.
646 (Arm_exidx_input_section::has_errors,
647 Arm_exidx_input_section::set_has_errors): New methods.
648 (Arm_exidx_input_section::has_errors_): New data member.
649 (Arm_relobj::get_exidx_shndx_list): New method.
650 (Arm_output_section::append_text_sections_to_list): Do not skip
651 section without SHF_EXECINSTR.
652 (Arm_output_section::fix_exidx_coverage): Skip input sections with
653 errors.
654 (Arm_relobj::make_exidx_input_section): Add new parameter for text
655 section header. Make error messages more verbose. Check for
656 a non-executable section linked to an EXIDX section.
657 (Arm_relobj::do_read_symbols): Remove error checking, which has been
658 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
659 check that there is no deferred EXIDX section if we exit early.
660 Instead of not making an EXIDX section in case of an error, make one
661 and set the has_errors flag of it.
662 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
663 in a relocatable link.
664 (Target_arm::do_relax): Look for the EXIDX output section instead of
665 assuming that it is called .ARM.exidx.
666 (Target_arm::fix_exidx_coverage): Add a new parameter for input
667 section list. Do not check for SHF_EXECINSTR section flags but
668 skip any input section with errors.
669 * output.cc (Output_section::Output_section): Initialize
670 always_keeps_input_sections_ to false.
671 (Output_section::add_input_section): Check for
672 always_keeps_input_sections_.
673 * output.h (Output_section::always_keeps_input_sections,
674 Output_section::set_always_keeps_input_sections): New methods.
675 (Output_section::always_keeps_input_sections): New data member.
676
69517287
RÁE
6772010-07-13 Rafael Espindola <espindola@google.com>
678
679 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
680 * fileread.h (Input_file): Add try_extra_search_path and find_file.
681
82742395
ILT
6822010-07-13 Philip Herron <herron.philip@googlemail.com>
683 Ian Lance Taylor <iant@google.com>
684
685 * output.h (Output_section_lookup_maps::add_merge_section):
686 Correct check of whether value was inserted.
687 (Output_section_lookup_maps::add_merge_input_section): Likewise.
688 (Output_section_lookup_maps::add_relaxed_input_section):
689 Likewise.
690 * arm.cc (Target_arm::got_section): Remove used local os.
691 * i386.cc (Target_i386::got_section): Likewise.
692 * x86_64.cc (Target_x86_64::got_section): Likewise.
693 * sparc.cc (Target_sparc::got_section): Likewise.
694 (Target_sparc::relocate): Remove unused local have_got_offset.
695 * powerpc.cc (Target_powerpc::relocate): Likewise.
696
f2d707b5
ILT
6972010-07-13 Ian Lance Taylor <iant@google.com>
698
241531d6
ILT
699 * compressed_output.cc (zlib_decompress): Fix signature in
700 !HAVE_ZLIB_H case.
701
f2d707b5
ILT
702 * archive.cc (Archive::include_member): Unlock an external member
703 of a thin archive. Don't bother to delete an object we know is
704 NULL.
705
a2e47362
CC
7062010-07-12 Cary Coutant <ccoutant@google.com>
707
708 * compressed_output.cc (zlib_decompress): New function.
709 (get_uncompressed_size): New function.
710 (decompress_input_section): New function.
711 * compressed_output.h (get_uncompressed_size): New function.
712 (decompress_input_section): New function.
713 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
714 Handle compressed debug sections.
715 * layout.cc (is_compressed_debug_section): New function.
716 (Layout::output_section_name): Map compressed section names to
717 canonical names.
718 * layout.h (is_compressed_debug_section): New function.
719 (is_debug_info_section): Recognize compressed debug sections.
720 * merge.cc: Include compressed_output.h.
721 (Output_merge_data::do_add_input_section): Handle compressed
722 debug sections.
723 (Output_merge_string::do_add_input_section): Handle compressed
724 debug sections.
725 * object.cc: Include compressed_output.h.
726 (Sized_relobj::Sized_relobj): Initialize new data members.
727 (build_compressed_section_map): New function.
728 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
729 * object.h (Object::section_is_compressed): New method.
730 (Object::do_section_is_compressed): New method.
731 (Sized_relobj::Compressed_section_map): New type.
732 (Sized_relobj::do_section_is_compressed): New method.
733 (Sized_relobj::compressed_sections_): New data member.
734 * output.cc (Output_section::add_input_section): Handle compressed
735 debug sections.
736 * reloc.cc: Include compressed_output.h.
737 (Sized_relobj::write_sections): Handle compressed debug sections.
738
ce279a62
CC
7392010-07-08 Cary Coutant <ccoutant@google.com>
740
741 * resolve.cc (Symbol_table::resolve): Remember whether undef was
742 weak when resolving to a dynamic def.
743 (Symbol_table::should_override): Add adjust_dyndef flag; set it
744 for weak undef/dynamic def cases. Adjust callers.
745 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
746 undef_binding_weak_.
747 (Symbol_table::sized_write_globals): Adjust symbol binding.
748 (Symbol_table::sized_write_symbol): Add binding parameter.
749 * symtab.h (Symbol::set_undef_binding): New method.
750 (Symbol::is_undef_binding_weak): New method.
751 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
752 (Symbol_table::should_override): Add new parameter.
753 (Symbol_table::sized_write_symbol): Add new parameter.
754
755 * testsuite/weak_undef_file1.cc: Add new test case.
756 * testsuite/weak_undef_file2.cc: Fix header comment.
757 * testsuite/weak_undef_test.cc: Add new test case.
758
b2286c10
DK
7592010-06-29 Doug Kwan <dougkwan@google.com>
760
761 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
762 Initialize USE_SYMBOL_.
763 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
764 definition.
765 (Arm_reloc_property::uses_symbol_): New data member declaration.
766 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
767 uses symbol value and symbol is undefined but not weakly undefined.
768
4802450a
RÁE
7692010-06-28 Rafael Espindola <espindola@google.com>
770
771 * plugin.cc (Plugin::load): Use dlerror.
772
e5ca47ba
ILT
7732010-06-26 Jeffrey Yaskin <jyasskin@google.com>
774
775 * symtab.cc (detect_odr_violations): When reporting an ODR
776 violation, report an object where the symbol is defined.
777
8a75a161
DK
7782010-06-25 Doug Kwan <dougkwan@google.com>
779
780 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
781 (Target_arm::section_may_have_icf_unsafe_pointers): New method
782 definition.
783 (Target_arm::Scan::local_reloc_may_be_function_pointer,
784 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
785 target hook to detect function points.
786 (Target_arm::Scan::possible_function_pointer_reloc): New method.
787 * icf.h (Icf::check_section_for_function_pointers): Change type of
788 parameter SECTION_NAME to const reference to std::string. Use
789 target hook to determine if section may have unsafe pointers.
790 * target.h (Target::section_may_have_icf_unsafe_pointers): New
791 method definition.
792
42218b9f
RÁE
7932010-06-21 Rafael Espindola <espindola@google.com>
794
795 * fileread.cc (Input_file::find_fie): New
796 (Input_file::open): Use Input_file::find_fie.
797 * fileread.h (Input_file::find_fie): New
798 * plugin.cc (set_extra_library_path): New.
799 (Plugin::load): Add set_extra_library_path to the transfer vector.
800 (Plugin_manager::set_extra_library_path): New.
801 (Plugin_manager::add_input_file): Use the extra search path if set.
802 (set_extra_library_path(): New.
803 * plugin.h (Plugin_manager): Add set_extra_library_path and
804 extra_search_path_.
805
a0506cca
CC
8062010-06-19 Cary Coutant <ccoutant@google.com>
807
808 * layout.cc (gdb_sections): Add .debug_types.
809 (lines_only_debug_sections): Likewise.
810
6508b958
RÁE
8112010-06-18 Rafael Espindola <espindola@google.com>
812
813 * plugin.cc (add_input_file,add_input_library)
814 (Plugin_manager::add_input_file): Make filename arguments const.
815 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
816 const.
817
3e235302
DK
8182010-06-16 Doug Kwan <dougkwan@google.com>
819
820 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
821 .ARM.attributes section if we have not merged any input
822 attributes sections.
823
106e8a6c
DK
8242010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
825
826 * arm.cc: Allow combining objects with no EABI version
827 information.
828
91ff43fe
RÁE
8292010-06-15 Rafael Espindola <espindola@google.com>
830
831 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
832
68ed838c
ILT
8332010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
834
835 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
836 (struct iovec): Correct !HAVE_READV definition.
837
f3a2388f
CC
8382010-06-10 Cary Coutant <ccoutant@google.com>
839
840 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
841 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
842 reloc sections.
843 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
844
845 PR 11683
846 * symtab.h (Symbol::is_placeholder): New member function.
847 * target-reloc.h (relocate_section): Check for placeholder symbols.
848
849 * testsuite/Makefile.am (plugin_test_8): New test.
850 (plugin_test_9): New test.
851 * testsuite/Makefile.in: Regenerate.
852
e1df38aa
NC
8532010-06-09 Nick Clifton <nickc@redhat.com>
854
855 * yyscript.y (input_list_element): Allow strings prefixed with
856 the '-' character. Treat these as libraries.
857 * script.cc (script_add_library): New function. Adds a library
858 specified by "-l<name>" found in an input script.
859 * script-c.h: Add prototype for script_add_library.
860
25bbe950
DK
8612010-06-07 Doug Kwan <dougkwan@google.com>
862
863 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
864 Restrict stub-group size to be within long conditional branch
865 range when working around cortex-A8 erratum.
866
0f32ea4c
ILT
8672010-06-07 Damien Diederen <dd@crosstwine.com>
868
869 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
870 #ifdef typo.
871
8fe2a369
ST
8722010-06-03 Sriraman Tallam <tmsriram@google.com>
873
874 PR gold/11658
875 * output.cc
876 (Output_section::Input_section_sort_entry::compare_section_ordering):
877 Change to return non-zero correctly.
878 (Output_section::Input_section_sort_section_order_index_compare
879 ::operator()): Change to fix ambiguity in comparisons.
880
6e9ba2ca
ST
8812010-06-01 Sriraman Tallam <tmsriram@google.com>
882
883 * gold.h (is_wildcard_string): New function.
884 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
885 (Layout::layout_eh_frame): Ditto.
886 (Layout::find_section_order_index): New method.
887 (Layout::read_layout_from_file): New method.
888 * layout.h (Layout::find_section_order_index): New method.
889 (Layout::read_layout_from_file): New method.
890 (Layout::input_section_position_): New private member.
891 (Layout::input_section_glob_): New private member.
892 * main.cc (main): Call read_layout_from_file here.
893 * options.h (--section-ordering-file): New option.
894 * output.cc (Output_section::input_section_order_specified_): New
895 member.
896 (Output_section::Output_section): Initialize new member.
897 (Output_section::add_input_section): Add new parameter.
898 Keep input sections when --section-ordering-file is used.
899 (Output_section::set_final_data_size): Sort input sections when
900 section ordering file is specified.
901 (Output_section::Input_section_sort_entry): Add new parameter.
902 Check sorting type.
903 (Output_section::Input_section_sort_entry::compare_section_ordering):
904 New method.
905 (Output_section::Input_section_sort_compare::operator()): Change to
906 consider section_order_index.
907 (Output_section::Input_section_sort_init_fini_compare::operator()):
908 Change to consider section_order_index.
909 (Output_section::Input_section_sort_section_order_index_compare
910 ::operator()): New method.
911 (Output_section::sort_attached_input_sections): Change to sort
912 according to section order when specified.
e1df38aa
NC
913 (Output_section::add_input_section<32, true>): Add new parameter.
914 (Output_section::add_input_section<64, true>): Add new parameter.
915 (Output_section::add_input_section<32, false>): Add new parameter.
916 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
917 * output.h (Output_section::add_input_section): Add new parameter.
918 (Output_section::input_section_order_specified): New
919 method.
920 (Output_section::set_input_section_order_specified): New method.
921 (Input_section::Input_section): Initialize section_order_index_.
922 (Input_section::section_order_index): New method.
923 (Input_section::set_section_order_index): New method.
924 (Input_section::section_order_index_): New member.
925 (Input_section::Input_section_sort_section_order_index_compare): New
926 struct.
927 (Output_section::input_section_order_specified_): New member.
928 * script-sections.cc (is_wildcard_string): Delete and move modified
929 method to gold.h.
930 (Output_section_element_input::Output_section_element_input): Modify
931 call to is_wildcard_string.
932 (Output_section_element_input::Input_section_pattern
933 ::Input_section_pattern): Ditto.
934 (Output_section_element_input::Output_section_element_input): Ditto.
935 * testsuite/Makefile.am (final_layout): New test case.
936 * testsuite/Makefile.in: Regenerate.
937 * testsuite/final_layout.cc: New file.
938 * testsuite/final_layout.sh: New file.
939
3537c84b
RÁE
9402010-06-01 Rafael Espindola <espindola@google.com>
941
942 * plugin.cc (Plugin::load): Pass the output name to the plugin.
943
105b6afd
RÁE
9442010-06-01 Rafael Espindola <espindola@google.com>
945
946 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
947 visibility of symbols.
948
29e11421
DK
9492010-05-27 Doug Kwan <dougkwan@google.com>
950
951 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
952 from start of output section instead of address for a local symbol
953 in a merged or relaxed section when doing a relocatable link.
954
5e0f337e
RÁE
9552010-05-26 Rafael Espindola <espindola@google.com>
956
957 PR 11604
958 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
959 adding sections the garbage collector removed.
960 * gold/testsuite/Makefile.am: Add test.
961 * gold/testsuite/Makefile.in: Regenerate.
962 * gold/testsuite/plugin_test_7.sh: New.
963 * gold/testsuite/plugin_test_7_1.c: New.
964 * gold/testsuite/plugin_test_7_2.c: New.
965
f4187277
RÁE
9662010-05-26 Rafael Espindola <espindola@google.com>
967
968 * script-sections.cc (Output_section_definition::set_section_addresses):
969 Check for --section-start.
970
5c388529
DK
9712010-05-26 Doug Kwan <dougkwan@google.com>
972
973 * arm.cc (Arm_scan_relocatable_relocs): New class.
974 (Target_arm::relocate_special_relocatable): New method.
975 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
976 (Arm_relocate_functions::thumb_branch_common): Same.
977 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
978 instead of Default_scan_relocatable_relocs.
979 * target-reloc.h (relocate_for_relocatable): Let target handle
980 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
981 * target.h (Sized_target::relocate_special_relocatable): New method.
982
bca1c3ae
ILT
9832010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
984
985 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
986
0439c796
DK
9872010-05-23 Doug Kwan <dougkwan@google.com>
988
989 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
990 instead of a cast.
991 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
992 with a direct branch, not a conditional branch, to a stub.
993 * merge.cc (Output_merge_base::record_input_section): New method
994 defintion.
995 (Output_merge_data::do_add_input_section): Record input section if
996 keeps-input-sections flag is set.
997 (Output_merge_string::do_add_input_section): Ditto.
998 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
999 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
1000 INPUT_SECTIONS_.
1001 (Output_merge_base::keeps_input_sections,
1002 Output_merge_base::set_keeps_input_sections,
1003 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
1004 method definitions.
1005 (Output_merge_base::Input_sections): New type declaration.
1006 (Output_merge_base::input_sections_begin,
1007 Output_merge_base::input_sections_end,
1008 Output_merge_base::do_set_keeps_input_sections): New method definitions.
1009 (Output_merge_base::bool keeps_input_sections_,
1010 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
1011 Output_merge_base::input_sections_): New data members.
1012 (Output_merge_data::do_set_keeps_input_sections): New method
1013 defintion.
1014 (Output_merge_string::do_set_keeps_input_sections): Ditto.
1015 * output.cc (Output_section::Input_section::relobj): Move method
1016 defintion from class declaration to here and handle merge sections.
1017 (Output_section::Input_section::shndx): Ditto.
1018 (Output_section::Output_section): Remove initializations of removed
1019 data members and initialize new data member LOOKUP_MAPS_.
1020 (Output_section::add_input_section): Set keeps-input-sections flag
1021 for a newly created merge output section as appropriate. Adjust code
1022 to use Output_section_lookup_maps class.
1023 (Output_section::add_relaxed_input_section): Adjst code for lookup
1024 maps code refactoring.
1025 (Output_section::add_merge_input_section): Add a new parameter
1026 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
1027 class. If adding input section to a newly created merge output
1028 section fails, remove the new merge section.
1029 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 1030 Adjust code for use of the Output_section_lookup_maps class.
0439c796
DK
1031 (Output_section::find_merge_section): Ditto.
1032 (Output_section::build_lookup_maps): New method defintion.
1033 (Output_section::find_relaxed_input_section): Adjust code to use
1034 Output_section_lookup_maps class.
1035 (Output_section::get_input_sections): Export merge sections. Adjust
1036 code to use Output_section_lookup_maps class.
1037 (Output_section:::add_script_input_section): Adjust code to use
1038 Output_section_lookup_maps class. Update lookup maps for merge
1039 sections also.
1040 (Output_section::discard_states): Use Output_section_lookup_maps.
1041 (Output_section::restore_states): Same.
1042 * output.h (Merge_section_properties): Move class defintion out of
1043 Output_section.
1044 (Output_section_lookup_maps): New class.
1045 (Output_section::Input_section::is_merge_section): New method
1046 defintion.
1047 (Output_section::Input_section::relobj): Move defintion out of class
1048 defintion. Declare method only.
1049 (Output_section::Input_section::shndx): Ditto.
1050 (Output_section::Input_section::output_merge_base): New method defintion.
1051 (Output_section::Input_section::u2_.pomb): New union field.
1052 (Output_section::Merge_section_by_properties_map,
1053 Output_section::Output_section_data_by_input_section_map,
1054 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
1055 Remove types.
1056 (Output_section::add_merge_input_section): Add new parameter
1057 KEEPS_INPUT_SECTIONS.
1058 (Output_section::build_lookup_maps): New method declaration.
1059 (Output_section::merge_section_map_,
1060 Output_section::merge_section_by_properties_map_,
1061 Output_section::relaxed_input_section_map_,
1062 Output_section::is_relaxed_input_section_map_valid_): Remove data
1063 members.
1064 (Output_section::lookup_maps_): New data member.
1065
76295588
L
10662010-05-21 Doug Kwan <dougkwan@google.com>
1067
1068 PR gold/11619
1069 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
1070 avoid a compilation error.
1071
d103a984
RÁE
10722010-05-19 Rafael Espindola <espindola@google.com>
1073
1074 * script-sections.cc (Output_section_definition::allocate_to_segment):
1075 Update the phdrs_list even when the output section is NULL.
1076 * testsuite/Makefile.am: Add test.
1077 * testsuite/Makefile.in: Regenerate.
1078 * testsuite/script_test_9.cc: New.
1079 * testsuite/script_test_9.sh: New.
1080 * testsuite/script_test_9.t: New.
1081
6625d24e
DK
10822010-05-19 Doug Kwan <dougkwan@google.com>
1083
1084 * arm.cc (Arm_input_section::original_size): New method.
1085 (Arm_input_section::do_addralign): Add a cast.
1086 (Arm_input_section::do_output_offset): Remove static cast.
1087 (Arm_input_section::original_addralign,
1088 Arm_input_section::original_size_): Change type to uint32_t.
1089 (Arm_input_section::init): Add safe casts for section alignment
1090 and size.
1091 (Arm_input_section::set_final_data_size): Do not set address and
1092 offset of stub table.
1093 (Arm_output_section::fix_exidx_coverage): Change use of of
1094 Output_section::Simple_input_section to that of
1095 Output_section::Input_section.
1096 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
1097 except for the first pass.
1098 * output.cc (Output_section::get_input_sections): Change type of
1099 input_sections to std::list<Input_section>.
1100 (Output_section::add_script_input_section): Rename from
1101 Output_section::add_simple_input_section. Change type of SIS
1102 parameter from Simple_input_section to Input_section.
1103 * output.h (Output_section::Simple_input_section): Remove class.
1104 (Output_section::Input_section): Change class visibility to public.
1105 (Output_section::Input_section::addralign): Use stored alignments
1106 for special input sections if set.
1107 (Output_section::Input_section::set_addralign): New method.
1108 (Output_section::get_input_sections): Change parameter type from
1109 list of Simple_input_section to list of Input_section.
1110 (Output_section::add_script_input_section): Rename from
1111 Output_section::add_simple_input_section. Change first parameter's
1112 type from Simple_input_section to Input_section and remove the
1113 second and third parameters.
1114 * script-sections.cc (Input_section::Input_section_list): Change
1115 type to list of Output_section::Input_section/
1116 (Input_section_info::Input_section_info): Change parameter type of
1117 INPUT_SECTION to Output_section::Input_section.
1118 (Input_section_info::input_section): Change return type.
1119 (Input_section_info::input_section_): Change type to
1120 Output_section::Input_section.
1121 (Output_section_element_input::set_section_addresses): Adjust code
1122 to use Output_section::Input_section instead of
1123 Output_section::Simple_input_section. Adjust code for renaming
1124 of Output_section::add_simple_input_section.
1125 (Orphan_output_section::set_section_addresses): Ditto.
1126
e1e82ea4
RW
11272010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1128
1129 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
1130 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
1131
91e75c8a
RÁE
11322010-05-18 Rafael Espindola <espindola@google.com>
1133
1134 * options.cc (General_options::finalize): Handle -nostdlib.
1135 * options.h (nostdlib): New option.
1136 * script.cc (script_add_search_dir): Handle -nostdlib.
1137
da59ad79
DK
11382010-05-12 Doug Kwan <dougkwan@google.com>
1139
1140 * arm.cc (Target_arm::do_finalize_sections): Create an empty
1141 attributes section only if there no attributes section after merging.
1142 (Target_arm::merge_object_attributes): Move value of
e1df38aa 1143 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
1144 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
1145 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
1146 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
1147 and arm_attr_merge_7.stdout.
1148 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
1149 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
1150 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
1151 arm_attr_merge_7b.o): New rules.
1152 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
1153 arm_attr_merge_7
1154 * testsuite/Makefile.in: Regenerate.
1155 * testsuite/arm_attr_merge.sh: New file.
1156 * testsuite/arm_attr_merge_[67][ab].s: Same.
1157
3e01a7fd
NC
11582010-05-05 Nick Clifton <nickc@redhat.com>
1159
1160 * po/es.po: Updated Spanish translation.
1161
7ad2014a
L
11622010-04-27 H.J. Lu <hongjiu.lu@intel.com>
1163
1164 * Makefile.am (install-exec-local): Properly install gold as
1165 default cross linker.
1166 * Makefile.in: Regenerated.
1167
4fda8867
NC
11682010-04-27 H.J. Lu <hongjiu.lu@intel.com>
1169 Nick Clifton <nickc@redhat.com>
1170
1171 * configure.ac (install_as_default): Define and set to false
1172 unless --enable-gold or --enable-gold=both/gold has been
1173 specified.
1174 * configure: Regenerate.
1175
1176 * Makefile.am (install-exec-local): Install the executable as
1177 'ld.gold'. If install_as_default is true then also install it as
1178 'ld'.
1179 * Makefile.in: Regenerated.
1180
bd288ea2
ILT
11812010-04-24 Ian Lance Taylor <iant@google.com>
1182
1183 * layout.cc (Layout::layout_reloc): In relocatable link don't
1184 combine reloc sections for grouped sections.
1185
ef38fd8a
ST
11862010-04-23 Sriraman Tallam <tmsriram@google.com>
1187
1188 * gc.h (gc_process_relocs): Pass information on relocs pointing to
1189 sections that are not ordinary to icf.
1190 * icf.cc (get_section_contents): Handle relocation pointing to section
1191 with no object or shndx information.
1192 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
1193 * testsuite/Makefile.in: Regenerate.
1194 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
1195 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
1196
f6973bdc
ILT
11972010-04-22 Ian Lance Taylor <iant@google.com>
1198
1199 * expression.cc (Expression::Expression_eval_info): Add
1200 result_alignment_pointer field.
1201 (Expression::eval_with_dot): Add result_alignment_pointer
1202 parameter. Change all callers.
1203 (Expression::eval_maybe_dot): Likewise.
1204 (class Binary_expression): Add alignment_pointer parameter to
1205 left_value and right_value. Change all callers.
1206 (BINARY_EXPRESSION): Set result alignment.
1207 (class Trinary_expression): Add alignment_pointer parameter to
1208 arg2_value and arg3_value. Change all callers.
1209 (Trinary_cond::value): Set result alignment.
1210 (Max_expression::value, Min_expression::value): Likewise.
1211 (Align_expression::value): Likewise.
1212 * script-sections.cc (class Sections_element): Add dot_alignment
1213 parameter to set_section_addresses virtual function. Update
1214 instantiations.
1215 (class Output_section_element): Likewise.
1216 (Script_sections::create_segments): Add dot_alignment parameter.
1217 Change all callers.
1218 (Script_sections::create_segments_from_phdrs_clause): Likewise.
1219 (Script_sections::set_phdrs_clause_addresses): Likewise.
1220 * script-sections.h: Update declarations.
1221 * script.h: Update declarations.
1222 * output.h (Output_segment::set_minimum_p_align): Don't decrease
1223 min_p_align.
1224 * testsuite/script_test_3.t: Set large alignment.
1225 * testsuite/script_test_3.sh: Make sure that at least one LOAD
1226 segment has expected alignment.
1227
9c9c98a5
NC
12282010-04-22 Nick Clifton <nickc@redhat.com>
1229
1230 * po/gold.pot: Updated by the Translation project.
1231 * po/vi.po: Updated Vietnamese translation.
1232
2253bfba
L
12332010-04-22 H.J. Lu <hongjiu.lu@intel.com>
1234
1235 * testsuite/Makefile.am (check_PROGRAMS): Add
1236 icf_virtual_function_folding_test.
1237 * testsuite/Makefile.in: Regenerated.
1238
85fdf906
AH
12392010-04-15 Andrew Haley <aph@redhat.com>
1240
1241 * options.h (merge_exidx_entries): New option.
1242 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
1243 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
1244 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
1245 (Target_arm::merge_exidx_entries): New function.
1246 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
1247 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
1248 to Arm_exidx_fixup constructor.
1249 Add new arg, merge_exidx_entries.
1250 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
1251 Arm_output_section::fix_exidx_coverage.
1252
ce97fa81
ST
12532010-04-18 Sriraman Tallam <tmsriram@google.com>
1254
1255 * icf.cc (get_section_contents): Check for preemptible functions.
1256 Ignore addend when appropriate.
1257 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
1258 section folded.
1259 (add_from_relobj): Check for section folded.
1260 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
1261 * symtab.h (should_add_dynsym_entry): Add new parameter.
1262 * target-reloc.h (scan_relocs): Check for section folded.
1263 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
1264 Check reloc types for function pointers in shared objects.
1265 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
1266 case.
1267 (icf_preemptible_functions_test): New test case.
1268 (icf_string_merge_test): New test case.
1269 * testsuite.Makefile.in: Regenerate.
1270 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
1271 bar_glob. Refactor code.
1272 * testsuite/icf_preemptible_functions_test.cc: New file.
1273 * testsuite/icf_preemptible_functions_test.sh: New file.
1274 * testsuite/icf_string_merge_test.cc: New file.
1275 * testsuite/icf_string_merge_test.sh: New file.
1276 * testsuite/icf_virtual_function_folding_test.cc: New file.
1277 * testsuite/icf_virtual_function_folding_test.sh: New file.
1278
04ceb17c
DK
12792010-04-14 Doug Kwan <dougkwan@google.com>
1280
1281 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
1282 for local symbol recounting if we remove a section due to ICF.
1283 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
1284 there are no regular objects in input.
1285
153e7da4
DK
12862010-04-13 Doug Kwan <dougkwan@google.com>
1287
1288 * arm.cc (Arm_input_section::set_final_data_size): Compute
1289 accurate final data size instead of using current data size.
1290
4dbd9faf
DK
12912010-04-09 Doug Kwan <dougkwan@google.com>
1292
1293 * layout.cc (Layout::choose_output_section): Handle script section
1294 types.
1295 (Layout::make_output_section_for_script): Add section type parameter.
1296 Handle script section types.
1297 * layout.h (Layout::make_output_section_for_script): Add section
1298 type parameter.
1299 * output.cc (Output_section::Output_section): Initialize data member
1300 is_noload_.
1301 (Output_section::do_reset_address_and_file_offset): Do not set address
1302 to 0 if section is a NOLOAD section.
1303 * output.h (Output_section::is_noload): New method.
1304 (Output_section::set_is_noload): Ditto.
1305 (Output_section::is_noload_): New data member.
1306 * script-c.h (Script_section_type): New enum type.
1307 (struct Parser_output_section_header): Add new file section_type.
1308 * script-sections.cc (Sections_element::output_section_name): Add
1309 parameter for returning script section type.
1310 (Output_section_definition::output_section_name): Ditto.
1311 (Output_section_definition::section_type)P; New method.
1312 (Output_section_definiton::script_section_type_name): Ditto.
1313 (Output_section_definition::script_section_type_): New data member.
1314 (Output_section_definition::Output_section_definition): Initialize
1315 data member Output_section_definition::script_section_type_.
1316 (Output_section_definition::create_sections): Pass script section type
1317 to Layout::make_output_section_for_script.
1318 (Output_section_definition::output_section_name): Return script
1319 section type to caller.
1320 (Output_section_definition::set_section_address): Do not advance
1321 dot value and load address if section type is NOLOAD. Set address
1322 of NOLOAD sections regardless of section flags.
1323 (Output_section_definition::print): Print section type if it is
1324 not SCRIPT_SECTION_TYPE_NONE.
1325 (Output_section_definition::section_type): New method.
1326 (Output_section_definition::script_section_type_name): Ditto.
1327 (Script_sections::output_section_name): Add new parameter
1328 PSECTION_TYPE for returning script section type. Pass it to
1329 section elements. Handle discard sections.
1330 (Sort_output_sections::operator()): Handle NOLOAD sections.
1331 * script-sections.h (Script_sections::Section_type): New enum type.
1332 (Script_sections::output_section_name): Add a new parameter for
1333 returning script section type.
1334 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
1335 INFO and NOLOAD.
1336 * yyscript.y (union): Add new field SECTION_TYPE.
1337 (COPY, DSECT, INFO, NOLOAD): New tokens.
1338 (opt_address_and_section_type): Change type to output_section_header.
1339 (section_type): New non-terminal
1340 (section_header): Handle section type.
2253bfba 1341 (opt_address_and_section_type): Return section type value.
4dbd9faf 1342
721ea635
L
13432010-04-09 H.J. Lu <hongjiu.lu@intel.com>
1344
1345 * testsuite/plugin_common_test_1.c (foo): Add prototype.
1346 * testsuite/plugin_common_test_2.c (foo): Likewise.
1347
6bf924b0
DK
13482010-04-08 Doug Kwan <dougkwan@google.com>
1349
1350 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
1351 Output_merge_data.
1352 * output.cc (Output_section::add_merge_input_section): Simplify
1353 code and return status of Output_merge_base::add_input_section.
e1df38aa 1354 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
1355 returns true.
1356
24af6f92
DK
13572010-04-07 Doug Kwan <dougkwan@google.com>
1358
1359 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
1360 if section is marked as containing instructions but has no mapping
1361 symbols.
1362 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
1363 correct section index.
1364 (Arm_relobj::find_linked_text_section): Ditto.
1365
00698fc5
CC
13662010-04-07 Cary Coutant <ccoutant@google.com>
1367
1368 * archive.cc (include_member): Destroy Read_symbols_data object before
1369 releasing file.
1370 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
1371 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
1372 (Read_symbols_data::~Read_symbols_data) New destructor.
1373 (Section_relocs::Section_relocs) New constructor.
1374 (Section_relocs::~Section_relocs) New destructor.
1375 (Read_relocs_data::Read_relocs_data) New constructor.
1376 (Read_relocs_data::~Read_relocs_data) New destructor.
1377 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
1378 pointers to NULL after deleting.
1379
7296d933
DK
13802010-04-07 Doug Kwan <dougkwan@google.com>
1381
1382 * arm.cc: Replace "endianity" with "endianness" in comments.
1383 (Arm_exidx_cantunwind): Ditto.
1384 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
1385 (Arm_relobj::merge_flags_and_attributes): New method.
1386 (Arm_relobj::merge_flags_and_attributes_): New data member.
1387 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
1388 (Arm_relobj::scan_sections_for_stubs): Ditto.
1389 (Arm_relobj::do_read_symbols): Check to see if we really want to
1390 merge processor-specific flags and attributes. Exit early if
1391 an object is empty except for section names and the undefined symbol.
1392 (Target_arm::do_finalize_sections): Move check for ELF format to
1393 Arm_relobj::do_read_symbols. Merge processor specific flags and
1394 attributes from a regular object only when we have determined that
1395 it is aapropriate. Do not create an .ARM.attributes section in
1396 output if there is no regular input object.
1397 (Target_arm::merge_processor_specific_flags): Check
1398 --warn-mismatch before printing any error.
1399 (Target_arm::merge_object_attributes): Ditto.
1400 * gold.cc (queue_middle_tasks): Handle the case in which there is
1401 no regular object in input.
1402 * options.cc (General_options::parse_EB): New method.
1403 (General_options::parse_EL): Same.
1404 (General_options::General_options): Initialize endianness_.
1405 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
1406 New options.
1407 (General_options::Endianness): New enum.
1408 (General_options::endianness): New method.
1409 (General_options::endianness_): New data member.
1410 * parameters.cc (Parameters::set_options): Check target endianness.
1411 (Parameters::set_target_once): Ditto.
1412 (Parameters::check_target_endianness): New method.
1413 (parameters_force_valid_target): If either -EL or -EB is specified,
1414 use it to define endianness of default target.
1415 * parameters.h (Parameters::check_target_endianness): New method
1416 declaration.
1417 * target.h (class Target): Change "endianity" to "endianness"
1418 in comments.
1419
efc8d4f2
RW
14202010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1421
1422 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
1423 * configure: Regenerate.
1424 * Makefile.in: Regenerate.
1425 * testsuite/Makefile.in: Regenerate.
1426
be234d88
CC
14272010-04-06 Cary Coutant <ccoutant@google.com>
1428
1429 gcc PR lto/42757
1430 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
1431 prevailing definitions of common symbols.
1432 * testsuite/plugin_test_6.sh: New test case.
1433 * testsuite/plugin_common_test_1.c: New test case.
1434 * testsuite/plugin_common_test_2.c: New test case.
1435 * testsuite/Makefile.am (plugin_test_6): New test case.
1436 * testsuite/Makefile.in: Regenerate.
1437
bd32c6bd
NC
14382010-04-06 Nick Clifton <nickc@redhat.com>
1439
1440 * po/vi.po: New Vietnamese translation.
1441
323c532f
DK
14422010-03-30 Doug Kwan <dougkwan@google.com>
1443
1444 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
1445
4fcd97eb
DK
14462010-03-25 Doug Kwan <dougkwan@google.com>
1447
1448 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
1449 to avoid a conversion warning on a 32-bit host.
1450
4ebf39db
ILT
14512010-03-24 Ian Lance Taylor <iant@google.com>
1452
1453 * testsuite/script_test_3.t: Add a TLS segment.
1454 * testsuite/Makefile.am (check_PROGRAMS): Add
1455 tls_phdrs_script_test.
1456 (tls_phdrs_script_test_SOURCES): Define.
1457 (tls_phdrs_script_test_DEPENDENCIES): Define.
1458 (tls_phdrs_script_test_LDFLAGS): Define.
1459 (tls_phdrs_script_test_LDADD): Define.
1460 * testsuite/Makefile.in: Rebuild.
1461
4a599bdd
CC
14622010-03-23 Cary Coutant <ccoutant@google.com>
1463
1464 * fileread.cc (find_or_make_view): Fix comment.
1465
6c93b22c
ILT
14662010-03-23 Ian Lance Taylor <iant@google.com>
1467
1468 * script-sections.cc (class Orphan_section_placement): Define
1469 PLACE_TLS and PLACE_TLS_BSS.
1470 (Orphan_section_placement::Orphan_section_placement): Initialize
1471 new places.
1472 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
1473 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
1474 (tls_script_test_SOURCES): Define.
1475 (tls_script_test_DEPENDENCIES): Define.
1476 (tls_script_test_LDFLAGS): Define.
1477 (tls_script_test_LDADD): Define.
1478 * testsuite/Makefile.in: Rebuild.
1479
a2c7281b
DK
14802010-03-22 Doug Kwan <dougkwan@google.com>
1481
1482 * arm.cc (Arm_relocate_functions::abs8,
1483 Arm_relocate_functions::abs16): Use correct check for overflow
1484 specified in the ARM ELF specs.
1485 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
1486 target of a BLX instruction specially.
1487 (Reloc_stub::stub_type_for_reloc): Ditto.
1488 (Relocate::relocate): Use symbolic names instead of numeric relocation
1489 codes to report error.
1490 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
1491 workaround.
1492 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
1493 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
1494 thumb2_blx_out_of_range.stdout
1495 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
1496 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
1497 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
1498 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
1499 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
1500 thumb2_blx_in_range, thumb2_blx_in_range.o,
1501 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
1502 thumb2_blx_out_of_range.o): New rules.
1503 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
1504 thumb2_blx_in_range and thumb2_blx_out_of_range.
1505 * testsuite/Makefile.in: Regenerate.
1506 * arm_branch_in_range.sh: Add tests for THUMB BLX.
1507 * testsuite/thumb_blx_in_range.s: New file.
1508 * testsuite/thumb_blx_out_of_range.s: New file.
1509
b0193076
RÁE
15102010-03-22 Rafael Espindola <espindola@google.com>
1511
1512 * archive.cc (Should_include): Move to archive.h.
1513 (should_include_member): Make it a member of Archive.
1514 (Lib_group): New.
1515 (Add_lib_group_symbols): New.
1516 * archive.h: Include options.h.
1517 (Archive_member): Moved from Archive.
1518 (Should_include): Moved from archive.cc.
1519 (Lib_group): New.
1520 (Add_lib_group_symbols): New.
1521 * dynobj.cc (do_should_include_member): New.
1522 * dynobj.h (do_should_include_member): New.
1523 * gold.cc (queue_initial_tasks): Update call to queue.
1524 * main.cc (main): Print lib group stats.
1525 * object.cc (do_should_include_member): New.
1526 * object.h: Include archive.h.
1527 (Object::should_include_member): New.
1528 (Object::do_should_include_member): New.
1529 (Sized_relobj::do_should_include_member): New.
1530 * options.cc (General_options::parse_start_lib): New.
1531 (General_options::parse_end_lib): New.
1532 (Input_arguments::add_file): Handle lib groups.
1533 (Input_arguments::start_group): Check we are not in a lib.
1534 (Input_arguments::start_lib): New.
1535 (Input_arguments::end_lib): New.
1536 * options.h (General_options): Add start_lib and end_lib.
1537 (Input_argument::lib_): New.
1538 (Input_argument::lib): New.
1539 (Input_argument::is_lib): New.
1540 (Input_file_lib): New.
1541 (Input_arguments::in_lib_): New.
1542 (Input_arguments::in_lib): New.
1543 (Input_arguments::start_lib): New.
1544 (Input_arguments::end_lib_): New.
1545 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
1546 in unused members as preempted.
1547 (Sized_pluginobj::do_should_include_member): New.
1548 * plugin.h (Sized_pluginobj::do_should_include_member): New.
1549 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
1550 return the blocker.
1551 (Read_symbols::do_whole_lib_group): New.
1552 (Read_symbols::do_lib_group): New.
1553 (Read_symbols::do_read_symbols): Handle lib groups.
1554 (Read_symbols::get_name): Handle lib groups.
1555 * readsyms.h (Read_symbols): Add an archive member pointer.
1556 (Read_symbols::do_whole_lib_group): New.
1557 (Read_symbols::do_lib_group): New.
1558 (Read_symbols::member_): New.
1559 * script.cc (read_input_script): Update call to queue_soon.
1560
d099120c
DK
15612010-03-19 Doug Kwan <dougkwan@google.com>
1562
1563 * arm.cc (Stub_table::Stub_table): Initialize new data members
1564 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
1565 (Stub_table::add_reloc_stub): Assign stub offset and update
1566 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
1567 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
1568 New data members.
1569 (Stub_table::update_data_size_and_addralign): Use
1570 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
1571 instead of going over all reloc stubs.
1572 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
1573 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
1574 Stringpool_template::offset_ to size of Stringpool_char.
1575 (Stringpool_template::new_key_offset): Remove code to initialize
1576 Stringpool_template::offset_.
1577 * stringpool.h (Stringpool_template::set_no_zero_null): Set
1578 Stringpool_template::offset_ to zero.
1579
1aa37384
DK
15802010-03-15 Doug Kwan <dougkwan@google.com>
1581
1582 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
1583 offset_.
1584 (Stringpool_template::new_key_offset): New method.
1585 (Stringpool_template::add_string): Assign offsets when adding new
1586 strings.
1587 (Stringpool_template::set_string_offsets): Do not set string offsets
1588 when not optimizing.
1589 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
1590 member size_.
1591 (Chunked_vector::clear): Clear size_.
1592 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
1593 (Chunked_vector::size): Return size_.
1594 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 1595 (Chunked_vector::size_): New data member.
1aa37384
DK
1596 (Stringpool_template::set_no_zero_null): Assert string set is empty.
1597 (Stringpool_template::new_key_offset): New method declaration.
1598 (Stringpool_template::offset_): New data member.
1599
b672b057
RÁE
16002010-03-15 Rafael Espindola <espindola@google.com>
1601
1602 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
1603 Add_symbols' constructor.
1604 * readsyms.h (Add_symbols): Remove the input_group member.
1605
b6848d3c
ILT
16062010-03-10 Ian Lance Taylor <iant@google.com>
1607
1608 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
1609 target to ask whether a reference to a symbol requires a stack
1610 split.
1611 * target.h (Target::is_call_to_non_split): New function.
1612 (Target::do_is_call_to_non_split): Declare virtual function.
1613 * target.cc: Include "symtab.h".
1614 (Target::do_is_call_to_non_split): New function.
1615 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
1616
a2a5469e
CC
16172010-03-10 Cary Coutant <ccoutant@google.com>
1618
1619 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
1620 (File_read::open[1]): Remove initial mapping of whole_file_view_.
1621 (File_read::open[2]): Add whole_file_view_ to list of views.
1622 (File_read::make_view): Remove test of whole_file_view_.
1623 (File_read::find_or_make_view): Create whole_file_view_ if
1624 necessary.
1625 (File_read::clear_views): Replace bool parameter with enum;
1626 adjust all callers. Don't delete views with permanent data;
1627 do delete cached views and views from archives if
1628 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
1629 if clearing the corresponding view.
1630 * fileread.h (File_read::Clear_views_mode): New enum.
1631 (File_read::View::is_permanent_view): New method.
1632 (File_read::clear_views): Replace bool parameter
1633 with enum; adjust all callers.
1634 * options.h (General_options): Change keep_files_mapped option;
1635 add map_whole_files.
1636 * readsyms.cc (Add_symbols::run): Delete sd_ object before
1637 releasing the file.
1638 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
1639 the file.
1640
8861f32b
DM
16412010-03-10 David S. Miller <davem@davemloft.net>
1642
1643 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
1644
d62d0f5f
ST
16452010-03-09 Sriraman Tallam <tmsriram@google.com>
1646
1647 * icf.cc (get_section_contents): Add '@' marker after processing the
1648 merge reloc.
1649
9177756d
DK
16502010-03-08 Doug Kwan <dougkwan@google.com>
1651
1652 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
1653 due to a conversion warning.
1654 (Arm_relobj::update_output_local_symbol_count): Check for local
1655 symbol with unset output index.
1656
9e9e071b
ILT
16572010-03-05 Ian Lance Taylor <iant@google.com>
1658
1659 * options.h (class General_options): Add --spare-dynamic-tags.
1660 * output.cc (Output_data_dynamic::set_final_data_size): Implement
1661 --spare-dynamic-tags.
1662
a81ee015
ILT
16632010-03-05 Ian Lance Taylor <iant@google.com>
1664
1665 * incremental.cc: Include "libiberty.h".
1666
44ec90b9
RO
16672010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1668
1669 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
1670 function, is_info_ member.
1671 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
1672 (Versions::Versions): Update caller.
1673 (Versions::define_base_version): Likewise.
1674 (Versions::add_def): Likewise.
1675
0897ed3b
ST
16762010-03-03 Sriraman Tallam <tmsriram@google.com>
1677
1678 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
1679 (Scan::possible_function_pointer_reloc): New function.
1680 (Scan::local_reloc_may_be_function_pointer): Change to call
1681 possible_function_pointer_reloc.
1682 (Scan::global_reloc_may_be_function_pointer): Ditto.
1683 * icf.h (Icf::check_section_for_function_pointers): Change to reject
1684 relocations in ".data.rel.ro._ZTV" section.
1685 * testsuite/icf_safe_so_test.sh: Change to pass i386.
1686 * testsuite/icf_safe_so_test.cc: Ditto.
1687 * testsuite/icf_safe_test.cc: Ditto.
1688 * testsuite/icf_safe_test.sh: Ditto.
1689
d3bbad62
ILT
16902010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1691 Ian Lance Taylor <iant@google.com>
1692
1693 * target-reloc.h (relocate_section): Check the symbol table index
1694 for -1U before setting the local symbol index.
1695 (scan_relocatable_relocs): If copying the relocation, record that
1696 the local symbol is required.
1697 * object.h (Symbol_value::is_output_symtab_index_set): New
1698 function.
1699 (Symbol_value::may_be_discarded_from_output_symtab): New
1700 function.
1701 (Symbol_value::has_output_symtab_entry): New function.
1702 (Symbol_value::needs_output_symtab_entry): Remove.
1703 (Symbol_value::output_symtab_index): Make sure the symbol index is
1704 set.
1705 (Symbol_value::set_output_symtab_index): Make sure the symbol
1706 index is not set. Make sure the new index is valid.
1707 (Symbol_value::set_must_have_output_symtab_entry): New function.
1708 (Symbol_value::has_output_dynsym_entry): New function.
1709 (Symbol_value::set_output_dynsym_index): Make sure the new index
1710 is valid.
1711 (Sized_relobj::set_must_have_output_symtab_entry): New function.
1712 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
1713 local symbol if permitted.
1714 (Sized_relobj::do_finalize_local_symbols): Call
1715 is_output_symtab_index_set rather than needs_output_symtab_entry.
1716 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
1717 rather than needs_output_symtab_entry. Call
1718 has_output_dynsym_entry rather than needs_output_dynsym_entry.
1719 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
1720 is_output_symtab_index_set rather than needs_output_symtab_entry.
1721 * testsuite/discard_locals_relocatable_test.c: New file.
1722 * testsuite/discard_locals_test.sh: Test -r.
1723 * testsuite/Makefile.am (check_DATA): Add
1724 discard_locals_relocatable_test1.syms,
1725 discard_local_relocatable_test2.syms.
1726 (MOSTLYCLEANFILES): Likewise. Also add
1727 discard_locals_relocatable_test1.lout and
1728 discard_locals_relocatable_test2.out.
1729 (discard_locals_relocatable_test1.syms): New target.
1730 (discard_locals_relocatable_test.o): New target.
1731 (discard_locals_relocatable_test1.out): New target.
1732 (discard_locals_relocatable_test2.syms): New target.
1733 (discard_locals_relocatable_test2.out): New target.
1734 (various): Add missing ../ld-new dependencies.
1735 * testsuite/Makefile.in: Rebuild.
1736
7e8ccf26
NC
17372010-03-03 Nick Clifton <nickc@redhat.com>
1738
1739 * po/fi.po: New Finnish translation.
1740
2a0ff005
DK
17412010-03-01 Doug Kwan <dougkwan@google.com>
1742
1743 * layout.cc (Layout::Layout): Force section types of .init_array*,
1744 .preinit_array* and .fini_array* sections.
1745 * output.cc (Output_section::Input_section_sort_entry::has_priority):
1746 Fix check of return value of std::string::find.().
1747 (Output_section::Input_section_sort_compare::operator()): Remove
1748 comment about .init_array.
1749 (Output_section::Input_section_sort_init_fini_compare::operator()):
1750 New method.
1751 (Output_section::sort_attached_input_sections): Handle .init_array
1752 and .fini_array specially.
1753 * output.h (Output_section::Inut_section_sort_compare): Update
1754 comment.
1755 (Output_section::Input_section_sort_init_fini_compare): New struct.
1756
c3e4ae29
DK
17572010-02-26 Doug Kwan <dougkwan@google.com>
1758
1759 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
1760 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
1761 * testsuite/debug_msg.sh: Avoid matching source line number for
1762 use of global variable undef_int.
1763
2fd9ae7a
DK
17642010-02-26 Doug Kwan <dougkwan@google.com>
1765
1766 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
1767 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
1768 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
1769 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
1770 * options.cc (General_options::General_options): Initialize member
1771 fix_v4bx_.
1772 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
1773 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
1774 and rm_no_fix_v4bx.stdout
1775 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
1776 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
1777 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
1778 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
1779 and arm_no_fix_v4bx.
1780 * Makefile.in: Regenerate.
1781 * testsuite/arm_fix_v4bx.s: New file.
1782 * testsuite/arm_fix_v4bx.sh: Ditto.
1783
67ec7d0b
DK
17842010-02-24 Doug Kwan <dougkwan@google.com>
1785
1786 * arm.cc (Target_arm::got_section): Make the .got section the first
1787 non RELRO section in the data segment.
1788 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
1789 suffixes of section names.
1790
10165461
DK
17912010-02-24 Doug Kwan <dougkwan@google.com>
1792
1793 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
1794 flags and attributes merging if an input file is a binary file.
1795 * fileread.cc (Input_file::open): Record format of original file.
1796 * fileread.h (Input_file::Format): New enum type.
1797 (Input_file::Input_file): Initialize data member format_.
1798 (Input_file::format): New method definition.
1799 (Input_file::format_):: New data member.
1800
4a54abbb
DK
18012010-02-24 Doug Kwan <dougkwan@google.com>
1802
1803 * arm.cc (Arm_output_data_got): New class.
1804 (ARM_TCB_SIZE): New constant
1805 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
1806 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
1807 If user uses a script with a SECTIONS clause, issue only a warning
1808 for a misplaced EXIDX input section. Otherwise, issue an error.
1809 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
1810 garbage collection.
1811 (Target_arm::got_mode_index_entry): Handle static linking.
1812 (Target_arm::Scan::local): Ditto.
1813 (Target_arm::Scan::global): Ditto.
1814 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
1815 all incorrectly implemented relocations.
e1df38aa 1816 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
1817 Arm_output_section::fix_exidx_coverage.
1818 * layout.cc (Layout::section_name_mapping): Remove trailing dots
1819 from ".ARM.exidx." and ".ARM.extab.".
1820
ca419a6f
ILT
18212010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1822
1823 * arm.cc (Target_arm::do_finalize_sections): Create attribute
1824 section if it does not already exist.
1825 * attributes.cc (Attributes_section_data::Attributes_section_data):
1826 Don't crash if size is zero.
1827
135b9c78
ILT
18282010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1829 Ian Lance Taylor <iant@google.com>
1830
1831 * gold.cc (queue_middle_tasks): If no input files were opened,
1832 exit.
1833 * workqueue.h (Task_function::Task_function): Assert that there is
1834 a blocker.
1835
bb0bfe4f
DK
18362010-02-22 Doug Kwan <dougkwan@google.com>
1837
1838 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
1839 * icf.cc (get_section_contents): Cast snprintf arguments to long long
1840 types to avoid warnings due to different uint64_t implementations
1841 on different hosts.
1842
2a2b6d42
DK
18432010-02-21 Doug Kwan <dougkwan@google.com>
1844
1845 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
1846 handling of the maximum backward branch offset.
1847 (Arm_relocate_functions::thumb_branch_common): Ditto.
1848 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
1849 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 1850 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
1851 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
1852 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
1853 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
1854 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
1855 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
1856 thumb_bl_out_of_range thumb_bl_out_of_range.o,
1857 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
1858 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
1859 thumb2_bl_out_of_range.o): New rules.
1860 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
1861 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
1862 thumb2_bl_out_of_range
1863 * testsuite/Makefile.in: Regenerate.
1864 * testsuite/arm_bl_in_range.s: New file.
1865 * testsuite/arm_bl_out_of_range.s: Ditto.
1866 * testsuite/arm_branch_in_range.sh: Ditto.
1867 * testsuite/arm_branch_range.t: Ditto.
1868 * testsuite/thumb2_branch_range.t: Ditto.
1869 * testsuite/thumb_bl_in_range.s: Ditto.
1870 * testsuite/thumb_bl_out_of_range.s: Ditto.
1871 * testsuite/thumb_branch_range.t: Ditto.
1872
b487ad64
ST
18732010-02-20 Sriraman Tallam <tmsriram@google.com>
1874
1875 * gc.h (gc_process_relocs): Change vectors to point to the new list.
1876 Add reloc offset information.
1877 * icf.cc (get_section_contents): Change iterators to point to the new
1878 vectors. Add reloc offset information to the contents.
1879 * icf.h (Icf::Sections_reachable_info): New typedef.
1880 (Icf::Sections_reachable_list): New typedef.
1881 (Icf::Offset_info): New typedef.
1882 (Icf::Reloc_info): New struct typedef.
1883 (Icf::Reloc_info_list): New typedef.
1884 (Icf::symbol_reloc_list): Delete method.
1885 (Icf::addend_reloc_list): Delete method.
1886 (Icf::section_reloc_list): Delete method.
1887 (Icf::reloc_info_list): New method.
1888 (Icf::reloc_info_list_): New member.
1889
f96accdf
DK
18902010-02-19 Doug Kwan <dougkwan@google.com>
1891
1892 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
1893 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
1894 * arm.cc (Arm_relocation_functions): New forward declaration.
1895 (Target_arm::Target_arm): Initialize new data members
1896 got_mod_index_offset_ and tls_base_symbol_defined_.
1897 (Target_arm::Relocate::relocate_tls): New method.
1898 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
1899 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
1900 New methods.
1901 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
1902 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
1903 (Target_arm::got_mod_index_offset_,
1904 Target_arm::tls_base_symbol_defined_): New data members.
1905 (Target_arm::Scan::local, Target::Scan::global,
1906 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
1907 relocations.
1908
c8761b9a
DK
19092010-02-18 Doug Kwan <dougkwan@google.com>
1910
1911 * arm.cc (Arm_relobj::find_linked_text_section): New method.
1912 (Arm_relobj::make_exidx_input_section): Pass section index of linked
1913 text section as a parameter becuase some broken tools may not set
1914 the link in section header.
1915 (Target_arm::has_got_section): New method.
1916 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
1917 without any mapping symbol as data only. Remove warning.
1918 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
1919 link in its section header, try to discover the link by inspecting the
1920 REL31 relocation at the beginning of the section.
1921 (Target_arm::Scan::check_non_pic): Report name of offending relocation
1922 in error message.
1923 (Target_arm::Scan::global): Treat any reference to the symbol
1924 _GLOBAL_OFFSET_TABLE_ as a GOT access.
1925
21bb3914
ST
19262010-02-12 Sriraman Tallam <tmsriram@google.com>
1927
1928 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
1929 (Scan::global_reloc_may_be_function_pointer): New function.
1930 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
1931 (Scan::global_reloc_may_be_function_pointer): New function.
1932 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
1933 (Scan::global_reloc_may_be_function_pointer): New function.
1934 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
1935 (Scan::global_reloc_may_be_function_pointer): New function.
1936 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
1937 (Scan::global_reloc_may_be_function_pointer): New function.
1938 (Scan::possible_function_pointer_reloc): New function.
1939 (Target_x86_64::can_check_for_function_pointers): New function.
1940 * gc.h (gc_process_relocs): Scan relocation types to determine if
1941 function pointers were taken for targets that support it.
1942 * icf.cc (Icf::find_identical_sections): Include functions for
1943 folding in safe ICF whose pointer is not taken.
1944 * icf.h (Secn_fptr_taken_set): New typedef.
1945 (fptr_section_id_): New member.
1946 (section_has_function_pointers): New function.
1947 (set_section_has_function_pointers): New function.
1948 (check_section_for_function_pointers): New function.
1949 * options.h: Fix comment for safe ICF option.
1950 * target.h (can_check_for_function_pointers): New function.
1951 * testsuite/Makefile.am: Add icf_safe_so_test test case.
1952 Modify icf_safe_test for X86-64.
1953 * testsuite/Makefile.in: Regenerate.
1954 * testsuite/icf_safe_so_test.cc: New file.
1955 * testsuite/icf_safe_so_test.sh: New file.
1956 * testsuite/icf_safe_test.cc (kept_func_3): New function.
1957 (main): Change to take pointer to function kept_func_3.
1958 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
1959 folding is done correctly for X86-64.
1960
0da6fa6c
DM
19612010-02-12 David S. Miller <davem@davemloft.net>
1962
1963 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
1964 is_symbolless parameter.
1965 (Output_reloc<SHT_REL>::is_symbolless): New.
1966 (Output_reloc<SHT_REL>::is_symbolless_): New.
1967 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
1968 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
1969 (Output_reloc<SHT_RELA>::is_symbolless): New.
1970 (Output_data_reloc::add_global): Handle is_symbolless.
1971 (Output_data_reloc::add_global_relative): Likewise.
1972 (Output_data_reloc::add_local): Likewise.
1973 (Output_data_reloc::add_local_relative): Likewise.
1974 (Output_data_reloc::add_symbolless_global_addend): New.
1975 (Output_data_reloc::add_symbolless_local_addend): New.
1976 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
1977 is_symbolless.
1978 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
1979 instead of ->is_relative_
1980 (Output_reloc::write): Likewise.
1981 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
1982 (Output_reloc::write_rel): Simplify.
1983
1984 * sparc.cc (Target_sparc::Scan::local): Use
1985 ->add_symbolless_local_addend as needed.
1986 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
1987 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
1988 based upon relocation offset.
1989
e4782e83
DK
19902010-02-11 Doug Kwan <dougkwan@google.com>
1991
1992 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
1993 (Target_arm::Scan::global): Ditto. Also remove a comment before the
1994 beginning of function.
1995 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
1996 and MOVT_ABS relocations. Those are non issued in scanning. Fix
1997 parameter is_32bit in calls to should_apply_static_reloc.
1998 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
1999 (check_DATA): Add arm_abs_global.stdout.
2000 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
2001 arm_abs_global.stdout): New rules.
2002 (MOSTLLYCLEANFILES): Add arm_abs_global
2003 * Makefile.in: Regenerate.
2004 * testsuite/arm_abs_global.s: New file.
2005 * testsuite/arm_abs_global.sh: Ditto.
2006 * testsuite/arm_abs_lib.s: Ditto.
2007
93ceb764
ILT
20082010-02-11 Ian Lance Taylor <iant@google.com>
2009
2010 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
2011 Read_relocs task.
2012 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
2013 Allocate_commons_task first.
2014 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
2015 task, rather than symtab_lock_.
2016 (Gc_process_relocs::~Gc_process_relocs): New function.
2017 (Gc_process_relocs::is_runnable): Check this_blocker_.
2018 (Gc_process_relocs::locks): Use next_blocker_ rather than
2019 blocker_.
2020 (Scan_relocs::~Scan_relocs): New function.
2021 (Scan_relocs::is_runnable): Check this_blocker_ rather than
2022 symtab_lock_.
2023 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
2024 next_blocker_.
2025 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
2026 fields. Add this_blocker_ and next_blocker_ fields. Adjust
2027 constructor accordingly.
2028 (class Gc_process_relocs): Likewise.
2029 (class Scan_relocs): Likewise.
2030 * common.h (class Allocate_commons_task): Remove symtab_lock_
2031 field, and corresponding constructor parameter.
2032 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
2033 symtab_lock_.
2034 (Allocate_commons_task::locks): Likewise.
2035
114dfbe1
ILT
20362010-02-11 Ian Lance Taylor <iant@google.com>
2037
2038 * gold-threads.h (class Once): Define.
2039 (class Initialize_lock): Rewrite as child of Once.
2040 * gold-threads.cc (class Once_initialize): Define.
2041 (once_pointer_control): New static variable.
2042 (once_pointer, once_arg): New static variables.
2043 (c_run_once): New static function.
2044 (Once::Once, Once::run_once, Once::internal_run): New functions.
2045 (class Initialize_lock_once): Remove.
2046 (initialize_lock_control): Remove.
2047 (initialize_lock_pointer): Remove.
2048 (initialize_lock_once): Remove.
2049 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
2050 (Initialize_lock::initialize): Rewrite.
2051 (Initialize_lock::do_run_once): New function.
2052 * archive.cc (Archive::interpret_header): Only clear name if it is
2053 not already empty.
2054 * fileread.cc: Include "gold-threads.h"
2055 (file_counts_lock): New static variable.
2056 (file_counts_initialize_lock): Likewise.
2057 (File_read::release): Only increment counts when using --stats.
2058 Use a lock around the increment.
2059 * parameters.cc (class Set_parameters_target_once): Define.
2060 (set_parameters_target_once): New static variable.
2061 (Parameters::Parameters): Move here from parameters.h.
2062 (Parameters::set_target): Rewrite.
2063 (Parameters::set_target_once): New function.
2064 (Parameters::clear_target): Move here and rewrite.
2065 * parameters.h (class Parameters): Update declarations. Add
2066 set_parameters_target_once_ field.
2067 (Parameters::Parameters): Move to parameters.cc.
2068 (Parameters::clear_target): Likewise.
2069 * readsyms.cc (Read_symbols::do_group): Create a Start_group
2070 task.
2071 (Start_group::~Start_group): New function.
2072 (Start_group::is_runnable): New function.
2073 (Start_group::locks, Start_group::run): New functions.
2074 (Finish_group::run): Change saw_undefined to size_t.
2075 * readsyms.h (class Start_group): Define.
2076 (class Finish_group): Change saw_undefined_ field to size_t.
2077 (Finish_group::Finish_group): Remove saw_undefined and
2078 this_blocker parameters. Change all callers.
2079 (Finish_group::set_saw_undefined): New function.
2080 (Finish_group::set_blocker): New function.
2081 * symtab.h (class Symbol_table): Change saw_undefined to return
2082 size_t. Change saw_undefined_ field to size_t.
2083 * target-select.cc (Set_target_once::do_run_once): New function.
2084 (Target_selector::Target_selector): Initialize set_target_once_
2085 field. Don't initialize lock_ and initialize_lock_ fields.
2086 (Target_selector::instantiate_target): Rewrite.
2087 (Target_selector::set_target): New function.
2088 * target-select.h (class Set_target_once): Define.
2089 (class Target_selector): Update declarations. Make
2090 Set_target_once a friend. Remove lock_ and initialize_lock_
2091 fields. Add set_target_once_ field.
2092
fa17a3f4
ILT
20932010-02-10 Ian Lance Taylor <iant@google.com>
2094
2095 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
2096 queueing any tasks.
2097 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
2098 (queue_middle_tasks): Add all blockers before queueing any tasks.
2099 (queue_final_tasks): Likewise.
2100 * token.h (Task_token::add_blockers): New function.
2101 * object.h (Input_objects::number_of_relobjs): New function.
2102
c7177d31
ILT
21032010-02-10 Ian Lance Taylor <iant@google.com>
2104
5de0e392
ILT
2105 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
2106 shared, not if not position independent.
2107 * x86_64.cc (Relocate::relocate_tls): Likewise.
2108 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
2109 (tls_pie_pic_test): New target.
2110 * testsuite/Makefile.in: Rebuild.
2111
c7177d31
ILT
2112 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
2113 (tls_test_main_pie.o, tls_test_pie.o): New targets.
2114 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
2115 * testsuite/Makefile.in: Rebuild.
2116
684b268a
DM
21172010-02-09 David S. Miller <davem@davemloft.net>
2118
2119 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
2120 R_SPARC_RELATIVE using ->add_local_relative().
2121 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
2122
612a8d3d
DM
2123 * output.h (Output_data_dynamic::add_section_size): New method
2124 that takes two Output_data objects.
2125 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
2126 entry param. Handle it in initializers.
2127 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
2128 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
2129 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
2130 arg.
2131 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
2132 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
2133 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
2134 for dynrel_includes_plt.
2135 * i386.cc (Target_i386::do_finalize_sections): Likewise.
2136 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
2137 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
2138 before .rela.plt
2139 (Target_sparc::do_finalize_sections): Update to pass true for
2140 dynrel_includes_plt.
2141 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
2142 output before .rela.plt
2143 (Target_powerpc::do_finalize_sections): Update to pass true for
2144 dynrel_includes_plt when 32-bit.
2145
cb1be87e
DK
21462010-02-08 Doug Kwan <dougkwan@google.com>
2147
2148 * arm.cc (Arm_relobj::simple_input_section_output_address): New
2149 method.
2150 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
2151 Arm_relobj::scan_section_for_cortex_a8_stubs,
2152 Arm_relobj::do_relocation_section): Instead of calling
2153 Output_section::output_address, use faster
2154 Arm_relobj::simple_input_section_output_address.
2155
705b5121
DM
21562010-02-08 David S. Miller <davem@davemloft.net>
2157
2158 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
2159 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
2160 relocation helper function.
2161
024c4466
DM
2162 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
2163 just like R_SPARC_GOT{10,13,22}.
2164 (Target_sparc::Scan::local): Likewise.
2165 (Target_sparc::Relocate:relocate): Likewise.
2166
9109c078
ILT
21672010-02-06 Ian Lance Taylor <iant@google.com>
2168
2169 * configure.ac: Rewrite targetobjs duplicate removal code to use
2170 only shell constructs.
2171 * configure: Rebuild.
2172
cf846138
DK
21732010-02-05 Doug Kwan <dougkwan@google.com>
2174
2175 PR 11247
2176 * arm.cc (Arm_relobj::section_is_scannable): New method.
2177 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
2178 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
2179
6cfaf60b
DK
21802010-02-04 Doug Kwan <dougkwan@google.com>
2181
2182 PR 11247
2183 * arm-reloc-property.cc (cstdio): Include.
2184 * configure.ac (targetobjs): Remove duplicates.
2185 * configure: Regenerate.
2186 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
2187 big and little endian version for a given address size.
2188
5c57f1be
DK
21892010-02-03 Doug Kwan <dougkwan@google.com>
2190
2191 * arm-reloc-property.cc
2192 (Arm_reloc_property_table::reloc_name_in_error_message): New method
2193 definition.
2194 * arm-reloc-property.h
2195 (Arm_reloc_property_table::get_implemented_static_reloc_property):
2196 New method definition.
2197 (Arm_reloc_property_table::reloc_name_in_error_message): New method
2198 declaration.
2199 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
2200 overflow to N.
2201 (GOT_PREL): Change implemented to Y.
2202 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
2203 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
2204 (Arm_relocate_functions::movw_abs_nc): Remove method.
2205 (Arm_relocate_functions::movt_abs): Ditto.
2206 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
2207 (Arm_relocate_functions::thm_movt_abs): Ditto.
2208 (Arm_relocate_functions::movw_rel_nc): Ditto.
2209 (Arm_relocate_functions::movw_rel): Ditto.
2210 (Arm_relocate_functions::movt_rel): Ditto.
2211 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
2212 (Arm_relocate_functions:thm_movw_rel): Ditto.
2213 (Arm_relocate_functions:thm_movt_rel): Ditto.
2214 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
2215 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
2216 New method definitions.
2217 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
2218 (Arm_relocation_functions::arm_grp_ldr): Ditto.
2219 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
2220 (Arm_relocation_functions::arm_grp_ldc): Ditto.
2221 (Target_arm::Relocate::relocate): Check for non-static or
2222 unimplemented relocation code and exit early. Change calls to
2223 Target_arm::reloc_uses_thumb_bit and
2224 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
2225 instead. Refactor code to handle similar relocations to increase
2226 code sharing. Remove check for unsupported relocation code in switch
2227 statement.
2228 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
2229 relocation property table to find out size. Change error message to
2230 print out the name of a relocation code instead of the numeric value.
2231 (Target_arm::scan_reloc_for_stub): Use relocation property table
2232 instead of calling Target_arm::reloc_uses_thumb_bit().
2233
218c5831
DK
22342010-02-02 Doug Kwan <dougkwan@google.com>
2235
2236 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
2237 types of relaxed input section.
2238
0d31c79d
DK
22392010-02-02 Doug Kwan <dougkwan@google.com>
2240
2241 * Makefile.am (HFILES): Add arm-reloc-property.h.
2242 (DEFFILES): New.
2243 (TARGETSOURCES): Add arm-reloc-property.cc
2244 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
2245 (libgold_a_SOURCES): $(DEFFILES)
2246 * Makefile.in: Regenerate.
2247 * arm-reloc-property.cc: New file.
2248 * arm-reloc-property.h: New file.
2249 * arm-reloc.def: New file.
2250 * arm.cc: Update comments.
2251 (arm-reloc-property.h): New included header.
2252 (arm_reloc_property_table): New global variable.
2253 (Target_arm::do_select_as_default_target): New method definition.
2254 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
2255 arm-reloc-property to targ_extra_obj.
2256 * parameters.cc (set_parameters_target): Call
2257 Target::select_as_default_target().
2258 * target.h (Target::select_as_default_target): New method definition.
2259 (Target::do_select_as_default_target): Same.
2260
546c7457
DK
22612010-02-01 Doug Kwan <dougkwan@google.com>
2262
2263 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
2264 first_output_text_section_.
2265 (Arm_exidx_fixup::first_output_text_section): New method definition.
2266 (Arm_exidx_fixup::first_output_text_section_): New data member.
2267 (Arm_exidx_fixup::process_exidx_section): Record the first text
2268 output section seen.
2269 (Arm_output_section::fix_exidx_coverage): Set correct linked section
2270 and entsize in output section header.
2271
11b861d5
DK
22722010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2273
2274 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
2275 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
2276 (Arm_relocate_functions::thm_alu11): New Method.
2277 (Arm_relocate_functions::thm_pc8): New Method.
2278 (Arm_relocate_functions::thm_pc12): New Method.
2279 (Target_arm::Scan::local): Handle the relocations.
2280 (Target_arm::Scan::global): Likewise.
2281 (Target_arm::Relocate::relocate): Likewise.
2282 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
2283
c9a2c125
DK
22842010-01-29 Doug Kwan <dougkwan@google.com>
2285
2286 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
2287 of relocation types as ld.
2288
1521477a
DK
22892010-01-29 Doug Kwan <dougkwan@google.com>
2290
2291 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
2292 to public.
2293 (Arm_relocate_functions::thumb_branch_common): Ditto.
2294 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
2295 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
2296 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
2297 Arm_relocate_functions::jump24): Remove.
2298 (Target_arm::Relocate::relocate): Adjust code to call
2299 Arm_relocation_functions::arm_branch_common and
2300 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 2301 wrappers. Merge switch-cases together to reduce source code size.
1521477a 2302
e7eca48c
DK
23032010-01-29 Doug Kwan <dougkwan@google.com>
2304
2305 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
2306 output_local_symbol_count_needs_update_.
2307 (Arm_relobj::output_local_symbol_count_needs_update,
2308 Arm_relobj::set_output_local_symbol_count_needs_update,
2309 Arm_relobj::update_output_local_symbol_count): New methods.
2310 (Arm_relobj::output_local_symbol_count_needs_update_): New data
2311 member.
2312 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
2313 of pointed function as in a R_ARM_PREL31 relocation.
2314 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
2315 for output local symbol count updating.
2316 (Target_arm::do_relax): Update output local symbol counts in objects
2317 if necessary.
2318 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
2319
02961d7e
ILT
23202010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2321
2322 * arm.cc: Added support for the ARM relocations:
2323 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
2324 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
2325 (Arm_relocate_functions::movw_rel_nc): Renamed (was
2326 movw_prel_nc).
2327 (Arm_relocate_functions::movw_rel): New method.
2328 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
2329 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
2330 thm_movw_prel_nc).
2331 (Arm_relocate_functions::thm_movw_rel): New method.
2332 (Arm_relocate_functions::thm_movt_rel): Renamed (was
2333 thm_movt_prel).
2334 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
2335 relocations.
2336 (Target_arm::Scan::global): Likewise.
2337 (Target_arm::Relocate::relocate): Likewise.
2338 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
2339 Likewise.
2340
b10d2873
ILT
23412010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2342
2343 * arm.cc: Added support for ARM group relocations.
2344 (Target_arm::reloc_needs_sym_origin): New method.
2345 (Arm_relocate_functions::calc_grp_kn): New method.
2346 (Arm_relocate_functions::calc_grp_residual): New method.
2347 (Arm_relocate_functions::calc_grp_gn): New method.
2348 (Arm_relocate_functions::arm_grp_alu): New Method.
2349 (Arm_relocate_functions::arm_grp_ldr): New Method.
2350 (Arm_relocate_functions::arm_grp_ldrs): New Method.
2351 (Arm_relocate_functions::arm_grp_ldc): New Method.
2352 (Target_arm::Scan::local): Handle the ARM group relocations.
2353 (Target_arm::Scan::global): Likewise.
2354 (Target_arm::Relocate::relocate): Likewise.
2355 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
2356 Likewise.
2357
2b328d4e
DK
23582010-01-26 Doug Kwan <dougkwan@google.com>
2359
2360 * arm.cc (set): Include.
2361 (class Arm_exidx_fixup): Change type of last_input_section_ to const
2362 pointer type.
2363 (Arm_output_section::Text_section_list): New type.
2364 (Arm_output_section::append_text_sections_to_list): New method.
2365 (Arm_output_section::fix_exidx_coverage): Ditto.
2366 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2367 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2368 Relobj::set_section_offset() instead of
2369 Sized_relobj::invalidate_section_offset().
2370 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2371 parameter for section headers. Ignore relocation sections for
2372 unallocated sections and EXIDX sections.
2373 (Target_arm::fix_exidx_coverage): New method.
2374 (Target_arm::output_section_address_less_than): New type.
2375 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
2376 linked text section instead of the EXIDX section.
2377 (Arm_output_section::create_stub_group): Add an assertion to check
2378 that this is not an EXIDX output section.
2379 (Arm_output_section::append_text_sections_to_list): New method.
2380 (Arm_output_section::fix_exidx_coverage): Ditto.
2381 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2382 Arm_relobj::section_needs_reloc_stub_scanning.
2383 (Target_arm::do_relax): Fix EXIDX output section coverage in the
2384 first pass.
2385 (Target_arm::fix_exidx_coverage): New method.
2386 * object.h (Relobj::set_output_section): New method.
2387 (Sized_relobj::invalidate_section_offset): Remove method.
2388 (Sized_relobj::do_invalidate_section_offset): Remove method.
2389 (Sized_relobj::do_set_section_offset): Handle offset value -1.
2390
c7f3c371
DK
23912010-01-25 Doug Kwan <dougkwan@google.com>
2392
2393 * arm.cc (Arm_exidx_merged_section::do_output_offset):
2394 Fix warning due to signed and unsigned comparison on a 32-bit host.
2395
8923b24c
DK
23962010-01-22 Doug Kwan <dougkwan@google.com>
2397
2398 * arm.cc (Target_arm::do_relax): Record an output section for section
2399 offset adjustment it contains any stub table that has changed.
2400 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
2401 offsets in an output section if necessary.
2402 * output.cc (Output_section::Output_section): Initialize
2403 section_offsets_need_adjustments_.
2404 (Output_section::add_input_section_for_script): Renamed to
2405 Output_section::add_simple_input_section.
2406 (Output_section::save_states): Add a comment.
2407 (Output_section::discard_states): New method defintion.
2408 (Output_section::adjust_section_offsets): Same.
2409 * output.h (Output_section::add_input_section_for_script): Renamed to
2410 Output_section::add_simple_input_section.
2411 (Output_section::discard_states): New method declaration.
2412 (Output_section::adjust_section_offsets): Same.
2413 (Output_section::section_offsets_need_adjustment,
2414 Output_section::set_section_offsets_need_adjustment): New method
2415 definitions.
2416 (Output_section::section_offsets_need_adjustment_): New data member.
2417 * script-sections.cc
2418 (Output_section_element_input::set_section_address): Adjust code for
2419 renaming of Output_section::add_input_section_for_script.
2420 (Orphan_output_section::set_section_address): Same.
2421
9b2fd367
DK
24222010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2423
2424 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
2425 Fix_v4bx enum values .
2426 * gold/options.h (General_options): New option definitions.
2427 (General_options::fix_v4bx): New method.
2428 (General_options::Fix_v4bx): New enum.
2429 * gold/options.cc (General_options::parse_fix_v4bx): New method.
2430 (General_options::parse_fix_v4bx_interworking): New method.
2431
80d0d023
DK
24322010-01-22 Doug Kwan <dougkwan@google.com>
2433
2434 * arm.cc (Arm_exidx_fixup): New class.
2435
af2cdeae
DK
24362010-01-21 Doug Kwan <dougkwan@google.com>
2437
2438 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
2439 classes.
2440 (Arm_exidx_section_offset_map): New type.
2441
993d07c1
DK
24422010-01-21 Doug Kwan <dougkwan@google.com>
2443
2444 * arm.cc (Arm_exidx_input_section): New class.
2445 (Arm_relobj::exidx_input_section_by_link,
2446 Arm_relobj::exidx_input_section_by_shndx,
2447 Arm_relobj::make_exidx_input_section): New methods.
2448 (read_arm_attributes_section): Remove.
2449 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
2450 information about them.
2451 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
2452 to here.
2453
5ac169d4
DK
24542010-01-20 Doug Kwan <dougkwan@google.com>
2455
2456 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
2457 Input_section_specifier to Section_id.
2458 (Target_arm::new_arm_input_section: Adjust code for change of key
2459 type.
2460 (Target_arm::find_arm_input_section): Ditto.
2461 * gc.h (object.h): Include for Section_id nand Section_id_hash.
2462 (Section_id): Remove.
2463 (Garbage_collection::Section_id_hash): Remove.
2464 * icf.h (object.h): Include for Section_id nand Section_id_hash.
2465 (Section_id): Remove.
2466 (Icf::Section_id_hash): Remove.
2467 * object.h (Section_id, Const_section_id, Section_id_hash,
2468 Const_section_id_hash): New type definitions.
2469 * output.cc (Output_section::add_relaxed_input_section): Change to
2470 use Const_section_id instead of Input_section_specifier as key type.
2471 (Output_section::add_merge_input_section): Ditto.
2472 (Output_section::build_relaxation_map): Change to use Section_id
2473 instead of Input_section_specifier as key type.
2474 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
2475 Ditto.
2476 (Output_section::convert_input_sections_to_relaxed_sections): Change
2477 to use Const_section_id instead of Input_section_specifier as key type.
2478 (Output_section::find_merge_section): Ditto.
2479 (Output_section::find_relaxed_input_section): Ditto.
2480 * output.h (Input_section_specifier): Remove class.
2481 (Output_section::Output_section_data_by_input_section_map): Change
2482 key type to Const_section_id.
2483 (Output_section::Output_relaxed_input_section_by_input_section_map):
2484 Ditto.
2485 (Output_section::Relaxation_map): Change key type to Section_id.
2486
a2162063
ILT
24872010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2488
2489 * gold/arm.cc: Added support for R_ARM_V4BX relocation
2490 (class Arm_v4bx_stub): New class.
2491 (DEF_STUBS): Updated definition to support v4_veneer_bx.
2492 (Stub_factory::make_arm_v4bx_stub): New method.
2493 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
2494 (Stub_table::empty): Handle v4bx stubs.
2495 (Stub_table::add_arm_v4bx_stub): New method.
2496 (Stub_table::find_arm_v4bx_stub): New method.
2497 (Arm_relocate_functions::v4bx): New method.
2498 (Target_arm::fix_v4bx): New method.
2499 (Target_arm::Target_arm): Handle R_ARM_V4BX.
2500 (Stub_table::relocate_stubs): Likewise.
2501 (Stub_table::do_write): Likewise.
2502 (Stub_table::update_data_size_and_addralign): Likewise.
2503 (Stub_table::finalize_stubs): Likewise.
2504 (Target_arm::Scan::local): Likewise.
2505 (Target_arm::Scan::global): Likewise.
2506 (Target_arm::do_finalize_sections): Likewise.
2507 (Target_arm::Relocate::relocate): Likewise.
2508 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
2509 Likewise.
2510 (Target_arm::scan_reloc_for_stub): Likewise.
2511 (Target_arm::scan_reloc_section_for_stubs): Likewise.
2512
5696ab0b
ILT
25132010-01-19 Ian Lance Taylor <iant@google.com>
2514
2515 * output.cc (Output_section_headers::do_sized_write): Write large
2516 segment count to sh_info field.
2517 (Output_file_header::do_sized_write): For large segment count,
2518 write PN_XNUM to e_phnum field.
2519
800d0f56
ILT
25202010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2521
2522 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
2523 (Arm_relocate_functions::thm_jump8): New function.
2524 (Arm_relocate_functions::thm_jump11): New function.
2525 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
2526 R_ARM_THM_JUMP11.
2527 (Target_arm::Scan::global): Likewise.
2528 (Target_arm::Relocate::relocate): Likewise.
2529 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
2530 Likewise.
2531
41263c05
DK
25322010-01-14 Doug Kwan <dougkwan@google.com>
2533
2534 * arm.cc (map, utility): Include headers.
2535 (Target_arm::apply_cortex_a8_workaround): New method.
2536 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
2537 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
2538 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
2539 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
2540 the --[no-]fix-cortex-a8 command line options.
2541 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
2542 (Target_arm::relocate_stub): Use addend in instruction template.
2543 * options.h (DEFINE_bool): Set the user-set flag.
2544 (General_options): Add --[no-]-fix-cortex options.
2545 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 2546 : Update fast look-up map after conversion.
41263c05 2547
459e9b03
ST
25482010-01-14 Sriraman Tallam <tmsriram@google.com>
2549
2550 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
2551 in the first pass of do_layout.
2552
b521dfe4
DK
25532010-01-13 Doug Kwan <dougkwan@google.com>
2554
2555 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
2556 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
2557 apparent compiler problem of not folding static constant integral
2558 data members of elfcpp::Elf_sizes<32>.
2559
44272192
DK
25602010-01-13 Doug Kwan <dougkwan@google.com>
2561
2562 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
2563 Arm_relobj::section_needs_cortex_a8_stub_scanning,
2564 Arm_relobj::scan_section_for_cortex_a8_erratum,
2565 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
2566 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
2567 sections to scan for relocation stubs into a new method
2568 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
2569 relocation and Cortex-A8 stub scanning.
2570 (Target_arm::do_relax): Force stubs to be after stubbed sections
2571 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 2572 the beginning of a new relaxation pass. Update a comment.
44272192
DK
2573 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
2574
44b71ece
ILT
25752010-01-12 Ian Lance Taylor <iant@google.com>
2576
2577 * target-reloc.h (visibility_error): New inline function.
2578 (relocate_section): Call visibility_error.
2579 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
2580 (MOSTLYCLEANFILES): Likewise.
2581 (protected_4_pic.o, protected_3.err): New targets.
2582 * testsuite/protected_4.cc: New file.
2583
a120bc7f
DK
25842010-01-12 Doug Kwan <dougkwan@google.com>
2585
2586 * arm.cc (Cortex_a8_reloc): New class.
2587 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
2588 and cortex_a8_relocs_info_.
2589 (Target_arm::fix_cortex_a8): New method definition.
2590 (Target_arm::Cortex_a8_relocs_info): New type.
2591 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
2592 New data member declarations.
2593 (Target_arm::scan_reloc_for_stub): Record information about
2594 relocations for THUMB branches that might be exempted from the
2595 Cortex-A8 workaround.
2596 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
2597 at the beginning of a relaxation pass.
2598
20138696
DK
25992010-01-12 Doug Kwan <dougkwan@google.com>
2600
2601 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
2602 (Arm_relobj::Mapping_symbol_position,
2603 Arm_reloj::Mapping_symbol_position_less,
2604 Arm_relobj::Mapping_symbols_info): New types.
2605 (Target_arm::is_mapping_symbol_name): New method definition.
2606 (Arm_relobj::do_count_local_symbols): Save information about mapping
2607 symbols.
2608
089d69dc
DK
26092010-01-11 Doug Kwan <dougkwan@google.com>
2610
2611 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
2612 Arm_relocate_functions::thumb32_branch_upper,
2613 Arm_relocate_functions::thumb32_branch_lower,
2614 Arm_relocate_functions::thumb32_cond_branch_offset,
2615 Arm_relocate_functions::thumb32_cond_branch_upper,
2616 Arm_relocate_functions::thumb32_cond_branch_lower,
2617 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
2618 branch offset encoding.
2619 (Arm_relocate_functions::thumb_branch_common): Use new branch
2620 offset encoding methods to avoid code duplication.
2621 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
2622 (Stub_addend_reader::operator()): Use new branch encoding method
2623 to avoid code duplication.
2624
99e5bff2
DK
26252010-01-11 Doug Kwan <dougkwan@google.com>
2626
2627 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
2628 (Target_arm::do_finalize_sections): Define special EXIDX section
2629 symbols only if referenced.
2630 * gc.h (Garbage_collection::add_reference): New method.
2631 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
2632 code duplication.
2633
98e090bd
ILT
26342010-01-11 Ian Lance Taylor <iant@google.com>
2635
d0a91bd8
ILT
2636 * script.cc (Version_script_info::build_expression_list_lookup):
2637 Change complaing about duplicate wildcard match from error to
2638 warning.
2639
98e090bd
ILT
2640 * script.cc (class Lazy_demangler): Recreate--revert part of patch
2641 of 2009-12-30.
2642 (Version_script_info::Version_script_info): Initialize globs_,
2643 default_version_, default_is_global_, and exact_. Don't
2644 initialize globals_ or locals_.
2645 (Version_script_info::build_lookup_tables): Build local symbols
2646 first.
2647 (Version_script_info::unquote): New function.
2648 (Version_script_info::add_exact_match): New function.
2649 (Version_script_info::build_expression_list_lookup): Remove lookup
2650 parameter. Add is_global parameter. Change all callers. Handle
2651 wildcard pattern specially. Unquote pattern. Call
2652 add_exact_match.
2653 (Version_script_info::get_name_to_match): New function.
2654 (Version_script_info::get_symbol_version): New function.
2655 (Version_script_info::get_symbol_version_helper): Remove.
2656 (Version_script_info::check_unmatched_names): Call unquote.
2657 * script.h (class Version_script_info): Change get_symbol_version
2658 to be non-inline and add is_global parameter; change all callers.
2659 Rewrite symbol_is_local. Update declarations. Define struct
2660 Version_tree_match, Exact, Globs. Don't define struct Lookup.
2661 Remove globals_ and locals_ members. Add exact_, globs_,
2662 default_version_, is_global_.
2663 (Version_script_info::Glob): Remove pattern, add expression and
2664 is_global. Update constructor. Change all callers.
2665 * dynobj.cc (Versions::finalize): Mark the version symbol as the
2666 default version.
2667 (Versions::symbol_section_contents): If a symbol is undefined, or
2668 defined in a dynamic object, set the version index to
2669 VER_NDX_LOCAL.
2670 * symtab.cc (Symbol_table::add_from_relobj): Don't call
2671 symbol_is_local.
2672 (Symbol_table::add_from_pluginobj): Likewise.
2673 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
2674
d56962d3
DK
26752010-01-11 Doug Kwan <dougkwan@google.com>
2676
2677 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
2678 (incremental_dump_LDADD): Add linking option for libintl.
2679 * Makefile.in: Regenerate.
2680
94e6ee91
L
26812010-01-11 H.J. Lu <hongjiu.lu@intel.com>
2682
2683 PR gold/11144
2684 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
2685 instead of -Ds.
2686 * testsuite/Makefile.in: Regenerated.
2687
e96c574b
DK
26882010-01-10 Doug Kwan <dougkwan@google.com>
2689
2690 * options.h (DEFINE_var): Use parentheses around argument varname__
2691 in macro body to avoid any unintended subsequent substitutions.
2692
7198066b
ILT
26932010-01-10 Ian Lance Taylor <iant@google.com>
2694
ba4d53bf
ILT
2695 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
2696 candidates before doing symbol resolution.
2697
7198066b
ILT
2698 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
2699 ODR candidates if only one is weak.
2700
a2beed37
ILT
27012010-01-08 Ian Lance Taylor <iant@google.com>
2702
2703 * script.cc (Version_script_info::build_expression_list_lookup):
2704 Don't warn about ambiguous version, just record the ambiguity.
2705 (Version_script_info::get_symbol_version_helper): Give error if
2706 version is ambiguous.
2707
2fb7225c
DK
27082010-01-08 Doug Kwan <dougkwan@google.com>
2709
2710 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
2711 prev_data_size_ and prev_addralign_. Remove initializer for
2712 deleted data member has_been_changed_.
2713 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
2714 to determine if the table is empty.
2715 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
2716 Remove.
2717 (Stub_table::add_reloc_stub): Define method in class definition
2718 instead of just declaring it there.
2719 (Stub_table::add_cortex_a8_stub): New method definition.
2720 (Stub_table::update_data_size_and_addralign): Ditto.
2721 (Stub_table::finalize_stubs): Ditto.
2722 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
2723 (Stub_table::do_addralign_): Return address alignment in the
2724 (Stub_table::do_reset_address_and_file_offset): Define method in
2725 class definition instead of declaring it there. Set current data
2726 size to be the data size of the previous pass.
2727 (Stub_table::set_final_data_size): Use current data size as the
2728 final data size.
2729 (Stub_table::relocate_stub): Change parameter type of stub from
2730 Reloc_stub pointer to Stub pointer.
2731 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
2732 (Stub_table::Cortex_a8_stub_list): New typedef.
2733 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
2734 Stub_table::prev_addralign_): New data member.
2735 (Arm_relobj::Arm_relobj): Initialize data member
2736 section_has_cortex_a8_workaround_.
2737 (Arm_relobj::section_has_cortex_a8_workaround,
2738 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
2739 definitions.
2740 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
2741 declarations.
2742 (Target_arm::relocate_stub): Change parameter type of stub from
2743 Reloc_stub pointer to Stub pointer.
2744 (Insn_template::size, Insn_template::alignment): Handle
2745 THUMB16_SPECIAL_TYPE.
2746 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
2747 Stub_table::update_data_size_and_addralign,
2748 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
2749 definitions.
2750 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
2751 (Stub_table::do_write): Ditto.
2752 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2753
880cd20d
ILT
27542010-01-08 Ian Lance Taylor <iant@google.com>
2755
2756 PR 11108
2757 * symtab.h (class Symbol): Remove fields is_target_special_ and
2758 has_plt_offset_. Add field is_defined_in_discarded_section_.
2759 (Symbol::is_defined_in_discarded_section): New function.
2760 (Symbol::set_is_defined_in_discarded_section): New function.
2761 (Symbol::has_plt_offset): Rewrite.
2762 (Symbol::set_plt_offset): Verify that new offset is not -1U.
2763 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
2764 Don't initialize is_target_special_ or has_plt_offset_.
2765 Initialize is_defined_in_discarded_section_.
2766 (Symbol_table::add_from_relobj): If appropriate, set
2767 is_defined_in_discarded_section.
2768 * resolve.cc (Symbol::override_base_with_special): Don't test
2769 is_target_special_. Change has_plt_offset_ to has_plt_offset().
2770 * target-reloc.h (relocate_section): Do special handling for
2771 symbols defined in discarded sections for global symbols as well
2772 as local symbols.
2773
2703e3eb
ILT
27742010-01-08 Ian Lance Taylor <iant@google.com>
2775
2776 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
2777 the SHT_SYMTAB case.
2778
339d40a3
ILT
27792010-01-08 Ian Lance Taylor <iant@google.com>
2780
2781 * object.cc (Sized_relobj::do_layout): Don't get confused if
2782 layout_eh_frame returns NULL.
2783
abecea76
ILT
27842010-01-08 Ian Lance Taylor <iant@google.com>
2785
2786 PR 11084
2787 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
2788 dynamic symbol table, use the normal symbol table.
2789 (Sized_dynobj::do_read_symbols): Remove assertion about type of
2790 symbol table.
2791
6b7dd3f3
ILT
27922010-01-08 Ian Lance Taylor <iant@google.com>
2793
2794 PR 11072
2795 * layout.cc (Layout::include_section): Remove .gnu_debuglink
2796 sections.
2797
36c50e63
L
27982010-01-08 H.J. Lu <hongjiu.lu@intel.com>
2799
2800 * version.cc (print_version): Change to "Copyright 2010".
2801
e291e7b9
ILT
28022010-01-08 Ian Lance Taylor <iant@google.com>
2803
2804 PR 10287
2805 PR 11063
2806 * i386.cc (class Target_i386): Change return type of plt_section
2807 to be non-const.
2808 (class Output_data_plt_i386): Add tls_desc_rel_ field.
2809 (Output_data_plt_i386::Output_data_plt_i386): Initialize
2810 tls_desc_rel_ field.
2811 (Output_data_plt_i386::rel_tls_desc): New function.
2812 (Target_i386::rel_tls_desc_section): New function.
2813 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
2814 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
2815 R_386_TLS_DESC reloc in rel_tls_desc_section.
2816 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
2817 Define struct Tlsdesc_info.
2818 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
2819 (Target_x86_64::do_reloc_symbol_index): New function.
2820 (Target_x86_64::add_tlsdesc_info): New function.
2821 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
2822 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
2823 tlsdesc_rel_ field.
2824 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
2825 all callers.
2826 (Output_data_plt_x86_64::rela_tlsdesc): New function.
2827 (Target_x86_64::rela_tlsdesc_section): New function.
2828 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
2829 handling.
2830 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
2831 (Target_x86_64::do_reloc_addend): New function.
2832 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
2833 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
2834 declarations. Define TARGET_CODE. Add arg field to u1_ union.
2835 (Output_reloc::type): New function.
2836 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
2837 (Output_reloc::is_target_specific): New function.
2838 (Output_reloc::target_arg): New function.
2839 (class Output_reloc) [SHT_RELA]: Add four new constructors for
2840 absolute relocs and target specific relocs.
2841 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
2842 add_target_specific.
2843 (class Output_data_reloc) [SHT_RELA]: Likewise.
2844 * output.cc (Output_reloc::Output_reloc): Add four new versions
2845 for absolute relocs and target specific relocs.
2846 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
2847 (Output_reloc::get_symbol_index): Likewise.
2848 (Output_reloc::local_section_offset): Check that local_sym_index_
2849 is not TARGET_CODE or 0.
2850 (Output_reloc::symbol_value): Likewise.
2851 (Output_reloc::write) [SHT_RELA]: Call target for target specific
2852 reloc.
2853 * target.h (class Target): Add reloc_symbol_index and reloc_addend
2854 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
2855 functions.
2856 * layout.cc (add_target_dynamic_tags): Use output section for
2857 DT_PLTRELSZ and DT_JMPREL.
2858
3a44184e
ILT
28592010-01-07 Ian Lance Taylor <iant@google.com>
2860
2861 PR 11061
2862 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
2863 function.
2864 (class Output_data_reloc_generic): Define.
2865 (class Output_data_reloc_base): Change base class to
2866 Output_data_reloc_generic. Change add() method to call
2867 bump_relative_reloc_count for a relative reloc. Remove
2868 sort_relocs_ field.
2869 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
2870 to sort_relocs().
2871 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
2872 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
2873 appropriate.
2874 * layout.h (class Layout): Update declaration.
2875
ea715a34
ILT
28762010-01-07 Ian Lance Taylor <iant@google.com>
2877
2878 * output.h (class Output_data): Add const version of
2879 output_section and do_output_section.
2880 (class Output_section_data): Add const version of
2881 do_output_section.
2882 (class Output_section): Likewise.
2883 * layout.cc (Layout::add_target_dynamic_tags): New function.
2884 * layout.h (class Layout): Update declarations.
2885 * arm.cc (Target_arm::do_finalize_sections): Use
2886 add_target_dynamic_tags.
2887 * i386.cc (Target_i386::do_finalize_sections): Likewise.
2888 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
2889 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
2890 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
2891
659948a4
ILT
28922010-01-07 Ian Lance Taylor <iant@google.com>
2893
2894 PR 11042
2895 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
2896 object as needed.
2897
9d3b86f6
ILT
28982010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
2899 Ian Lance Taylor <iant@google.com>
2900
2901 PR 11019
2902 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
2903 Xindex::read_symtab_xindex.
2904
bb0d3eb0
DK
29052010-01-07 Doug Kwan <dougkwan@google.com>
2906
2907 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
2908 (Insn_template::thumb16_bcond_insn): New method declaration.
2909 (Insn_template): Fix spelling.
2910 (Stub::thumb16_special): New method declaration.
2911 (Stub::do_write): Define virtual method which was previously pure
2912 virtual.
2913 (Stub::do_thumb16_special): New method declaration.
2914 (Stub::do_fixed_endian_write): New template member.
2915 (Reloc_stub::do_write): Remove.
2916 (Reloc_stub::do_fixed_endian_write): Remove.
2917 (Cortex_a8_stub): New class definition.
2918 (Stub_factory::make_cortex_a8_stub): New method definition.
2919 (Stub_factory::Stub_factory): Add missing static storage class
2920 qualifier for elf32_arm_stub_a8_veneer_blx.
2921
ffeef7df
ILT
29222010-01-07 Ian Lance Taylor <iant@google.com>
2923
dc3f80fe
ILT
2924 PR 10980
2925 * options.h (class General_options): Add --warn-unresolved-symbols
2926 and --error-unresolved-symbols.
2927 * errors.cc (Errors::undefined_symbol): Implement
2928 --warn-unresolved-symbols.
2929
ffeef7df
ILT
2930 * options.h (class General_options): Add -z text and -z textoff.
2931 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
2932
f1ec9ded
ST
29332010-01-06 Sriraman Tallam <tmsriram@google.com>
2934
2935 * gc.h (Garbage_collection::Cident_section_map): New typedef.
2936 (Garbage_collection::cident_sections): New function.
2937 (Garbage_collection::add_cident_section): New function.
2938 (Garbage_collection::cident_sections_): New member.
2939 (gc_process_relocs): Add references to sections whose names are C
2940 identifiers.
2941 * gold.h (cident_section_start_prefix): New constant.
2942 (cident_section_stop_prefix): New constant.
2943 (is_cident): New function.
2944 * layout.cc (Layout::define_section_symbols): Replace string constants
2945 with the newly defined constants.
2946 * object.cc (Sized_relobj::do_layout): Track sections whose names are
2947 C identifiers.
2948 * testsuite/Makefile.am: Add gc_orphan_section_test.
2949 * testsuite/Makefile.in: Regenerate.
2950 * testsuite/gc_orphan_section_test.cc: New file.
2951 * testsuite/gc_orphan_section_test.sh: New file.
2952
6eda8c29
ILT
29532010-01-06 Ian Lance Taylor <iant@google.com>
2954
b9674e17
ILT
2955 PR 10980
2956 * options.h (class General_options): Add --warn-shared-textrel.
2957 * layout.cc (Layout::finish_dynamic_section): Implement
2958 --warn-shared-textrel.
2959
6eda8c29
ILT
2960 PR 10980
2961 * options.h (class General_options): Add --warn-multiple-gp.
2962
32dcd44e
ILT
29632010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2964
2965 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
2966 $(THREADSLIB) and $(LIBDL).
2967 * Makefile.in: Rebuild.
2968
a192ba05
ILT
29692010-01-06 Ian Lance Taylor <iant@google.com>
2970
2971 PR 10980
2972 * options.cc (General_options::parse_section_start): New function.
2973 (General_options::section_start): New function.
2974 (General_options::General_options): Initialize all members.
2975 * options.h: Include <map>
2976 (class General_options): Add --section-start. Add section_starts_
2977 member.
2978 * layout.cc (Layout::attach_allocated_section_to_segment): If
2979 --section-start was used, set the address of the segment. Remove
2980 local sort_sections.
2981 (Layout::relaxation_loop_body): If the address of the load segment
2982 has been set by --section-start, don't use it.
2983 * output.h (Output_segment::update_flags_for_output_section): New
2984 function.
2985 * output.cc (Output_segment::add_output_section): Call
2986 update_flags_for_output_section.
2987
dde3f402
ILT
29882010-01-05 Ian Lance Taylor <iant@google.com>
2989
62dfdd4d
ILT
2990 PR 10980
2991 * options.h (class General_options): Add --undefined-version.
2992 * script.cc (struct Version_expression): Add was_matched_by_symbol
2993 field.
2994 (Version_script_info::matched_symbol): New function.
2995 (Version_script_info::get_symbol_version_helper): Call
2996 matched_symbol.
2997 (Version_script_info::check_unmatched_names): New function.
2998 * script.h (class Version_script_info): Update declarations.
2999 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
3000
9c4ae156
ILT
3001 * options.h (class General_options): Use DEFINE_bool_alias for
3002 allow_multiple_definition.
3003 * resolve.cc (Symbol_table::should_override): Don't test
3004 allow_multiple_definition.
3005
dde3f402
ILT
3006 PR 10980
3007 * options.h (class General_options): Add --cref.
3008 * main.cc (main): Print cref table if --cref. Don't close mapfile
3009 until after printing cref table.
3010 * cref.cc: Include "symtab.h".
3011 (class Cref_inputs): Define Cref_table_compare and Cref_table.
3012 (Cref_table_compare::operator()): New function.
3013 (Cref_inputs::gather_cref): New function.
3014 (filecol): New static const.
3015 (Cref_inputs::print_cref): New function.
3016 (Cref::print_cref): New function.
3017 * cref.h: Include <cstdio>.
3018 (class Cref): Update declarations.
3019 * mapfile.h (Mapfile::file): New function.
3020 * object.h (class Object): Define Symbols. Declare virtual
3021 do_get_global_symbols.
3022 (Object::get_global_symbols): New function.
3023 * object.cc (Input_objects::add_object): Pass object to cref_ if
3024 --cref.
3025 (Input_objects::archive_start): Likewise.
3026 (Input_objects::archive_stop): Likewise.
3027 (Input_objects::print_cref): New function.
3028 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
3029 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
3030 --cref.
3031 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
3032 function.
3033 * plugin.h (class Sized_pluginobj): Update declarations.
3034
8781f709
ILT
30352010-01-05 Ian Lance Taylor <iant@google.com>
3036
3037 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
3038 to is_default_version. Rename insdef to insdefault.
3039 (Symbol_table::add_from_relobj): Rename def to is_default_version
3040 and local to is_forced_local.
3041 (Symbol_table::add_from_pluginobj): Likewise.
3042 (Symbol_table::add_from_dynobj): Likewise.
3043 (Symbol_table::define_special_symbol): Rename insdef to
3044 insdefault.
3045
fe35d28d
ILT
30462010-01-04 Ian Lance Taylor <iant@google.com>
3047
30bc8c46
ILT
3048 PR 10980
3049 * options.h (class General_options): Add
3050 --allow-multiple-definition and -z muldefs.
3051 * resolve.cc (Symbol_table::should_override): Don't warn about a
3052 multiple symbol definition if --allow-multiple-definition or -z
3053 muldefs.
3054
7eaea549
ILT
3055 PR 10980
3056 * options.h (class General_options): Add --add-needed and
3057 --copy-dt-needed-entries. Tweak --as-needed help entry.
3058 * object.cc (Input_objects::check_dynamic_dependencies): Give an
3059 error if --copy-dt-needed-entries aka --add-needed is used and
3060 would cause a change in behaviour.
3061
fe35d28d
ILT
3062 PR 10980
3063 * options.h (class General_options): Add -G as a short version of
3064 --shared. Add no-op options -assert, -g, and -i.
3065
55a2bb35
ST
30662010-01-04 Sriraman Tallam <tmsriram@google.com>
3067
3068 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
3069 check for .text or .gnu.linkonce.t sections.
3070 * icf.cc (Icf::find_identical_sections): Ditto.
3071 Change the detection for mangled function name within the section
3072 name.
3073 * icf.h (is_section_foldable_candidate): New function.
3074
719328e1
ILT
30752009-12-30 Ian Lance Taylor <iant@google.com>
3076
3077 PR 10980
3078 * options.h (class General_options): Permit two dashes with
3079 --retain-symbols-file.
3080
d7bb5745
ILT
30812009-12-30 Ian Lance Taylor <iant@google.com>
3082
403a15dd
ILT
3083 PR 10979
3084 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
3085 don't put the file header and segment headers in the text
3086 segment.
3087
eda294df
ILT
3088 PR 10979
3089 * common.cc (Sort_commons::operator()): Stabilize sort when both
3090 entries are NULL.
3091 (Symbol_table::do_allocate_commons_list): When allocating common
3092 symbols, skip a symbol which is no longer common.
3093 * symtab.h (Symbol::is_common): Test whether the symbol comes from
3094 an object before checking its type.
3095 * testsuite/common_test_2.c: New file.
3096 * testsuite/common_test_3.c: New file.
3097 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
3098 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
3099 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
3100 (common_test_2_pic.o, common_test_2.so): New targets.
3101 (common_test_3_pic.o, common_test_3.so): New targets.
3102 * testsuite/Makefile.in: Rebuild.
3103
d7bb5745
ILT
3104 PR 10979
3105 * script.cc (read_input_script): If we see a new SECTIONS clause,
3106 and we have added an input section, give an error.
3107 * layout.h (class Layout): Add have_added_input_section function.
3108 Add have_added_input_section_ field.
3109 * layout.cc (Layout::Layout): Initialize
3110 have_added_input_section_.
3111 (Layout::layout): Set have_added_input_section_.
3112 (Layout::layout_eh_frame): Likewise.
3113
fc59c572
ILT
31142009-12-30 Ian Lance Taylor <iant@google.com>
3115
3116 PR 10931
3117 * options.h (class General_options): Add --sort-common option.
3118 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
3119 * common.cc (Sort_common): Add sort_order parameter to
3120 constructor. Add sort_order_ field.
3121 (Sort_commons::operator): Check sort_order_.
3122 (Symbol_table::allocate_commons): Determine the sort order.
3123 (Symbol_table::do_allocate_commons): Add sort_order parameter.
3124 Change all callers.
3125 (Symbol_table::do_allocate_commons_list): Likewise.
3126
1c74fab0
ILT
31272009-12-30 Ian Lance Taylor <iant@google.com>
3128
3129 PR 10916
3130 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
3131 symbols from this object, don't change the visibility of an
3132 undefined symbol.
3133 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
3134
6affe781
ILT
31352009-12-30 Ian Lance Taylor <iant@google.com>
3136
3137 PR 10861
3138 * script.h (class Version_script_info): Define Language enum.
3139 Update declarations. Define Glob, Exact, and Lookup types. Add
3140 new fields globals_, locals_, and is_finalized_.
3141 * script.cc: Various formatting fixes.
3142 (class Parser_closure): Change language_stack_ from a vector of
3143 std::string to one of Version_script_info::Language. Adjust all
3144 uses accordingly.
3145 (class Lazy_demangler): Remove.
3146 (struct Version_expression): Change language from std::string to
3147 Version_script_info::Language.
3148 (Version_script_info::Version_script_info): New function.
3149 (Version_script_info::~Version_script_info): Don't call clear.
3150 (Version_script_info::finalize): New function.
3151 (Version_script_info::build_lookup_tables): New function.
3152 (Version_script_info::build_expression_list_lookup): New
3153 function.
3154 (Version_script_info::get_symbol_version_helper): Rewrite to use
3155 lookup tables.
3156 (Version_script_info::print_expression_list): Adjust to use
3157 Version_script_info::Language.
3158 (script_push_lex_into_version_mode): Check that the version script
3159 has not been finalized.
3160 (version_script_push_lang): Change language string to
3161 Version_script_info::Language.
3162 * options.cc (Command_line::version_script): New function.
3163 * options.h (class General_options): Add finalize_dynamic_list
3164 function. Change version_script from declaration to definition.
3165 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
3166 * testsuite/version_script.map: Remove duplicate def of foo.
3167 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
3168 version_script.map.
3169 * testsuite/Makefile.in: Rebuild.
3170
818bf354
ILT
31712009-12-30 Ian Lance Taylor <iant@google.com>
3172
3173 PR 10843
3174 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
3175 if the input symbol index is 0, make the output symbol index 0.
3176
ebcc8304
ILT
31772009-12-30 Ian Lance Taylor <iant@google.com>
3178
3179 PR 10670
3180 * options.h (class General_options): Add -x/--discard-all.
3181 * object.cc (Sized_relobj::do_count_local_symbols): Handle
3182 --discard-all. If the local symbol needs a dynamic entry, check
3183 that before handling --discard-locals.
3184
176fe33f
ILT
31852009-12-30 Ian Lance Taylor <iant@google.com>
3186
bb321bb1
ILT
3187 PR 10450
3188 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
3189 flags to PF_R.
3190 (Output_segment::add_output_section): Don't change the flags if
3191 the type is PT_TLS.
3192
176fe33f
ILT
3193 PR 10450
3194 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
3195 GNU hash table if they need a dynamic value. Otherwise, don't add
3196 them if they are defined in a dynamic object or are forced local.
3197
e8cd95c7
ILT
31982009-12-29 Ian Lance Taylor <iant@google.com>
3199
1b81fb71
ILT
3200 PR 10450
3201 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
3202 .gnu.hash table for a 32-bit target.
3203
8d6d383d
ILT
3204 PR 10450
3205 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
3206 regular and a dynamic object only needs a dynamic symbol table
3207 entry if it is externally visible.
3208
e785ec03
ILT
3209 PR 10450
3210 * i386.cc (class Target_i386): Initialize global_offset_table_ in
3211 constructor. Add global_offset_table_ field.
3212 (Target_i386::got_section): Set global_offset_table_.
3213 (Target_i386::do_finalize_sections): Set global_offset_table_
3214 size.
3215 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
3216 in constructor. Add global_offset_table_ field.
3217 (Target_x86_64::got_section): Set global_offset_table_.
3218 (Target_x86_64::do_finalize_sections): Set global_offset_table_
3219 size.
3220
1a2dff53
ILT
3221 * layout.cc (Layout::Layout): Initialize increase_relro_.
3222 (Layout::get_output_section): Add is_relro, is_last_relro, and
3223 is_first_non_relro parameters. Change all callers.
3224 (Layout::choose_output_section): Likewise.
3225 (Layout::add_output_section_data): Likewise.
3226 (Layout::make_output_section): Likewise.
3227 (Layout::set_segment_offsets): Clear increase_relro when using a
3228 linker script.
3229 * layout.h (class Layout): Add increase_relro method. Add
3230 increase_relro_ field. Update declarations.
3231 * output.cc (Output_section::Output_section): Initialize
3232 is_last_relro_ and is_first_non_relro_.
3233 (Output_segment::add_output_section): Group relro sections is
3234 do_sort is true. Handle is_last_relro and is_first_non_relro.
3235 (Output_segment::maximum_alignment): Remove relro handling.
3236 (Output_segment::set_section_addresses): Add increase_relro
3237 parameter. Change all callers. Add initial alignment to align
3238 relro sections on separate page. Remove old relro handling.
3239 (Output_segment::set_section_list_addresses): Remove in_relro
3240 parameter. Change all callers.
3241 (Output_segment::set_offset): Add increase parameter. Change all
3242 callers. Remove old relro handling.
3243 * output.h (class Output_section): Add new methods: is_last_relro,
3244 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
3245 Add is_last_relro_ and is_first_non_relro_ fields.
3246 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
3247 Create separate .got.plt section. Call increase_relro.
3248 * x86_64.cc (Target_x86_64::got_section): Likewise.
3249 * testsuite/relro_script_test.t: Add .got.plt.
3250
f0ba79e2
ILT
3251 PR 10450
3252 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
3253 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
3254 (Layout::finalize): Call set_dynamic_symbol_size.
3255 (Layout::set_dynamic_symbol_size): New function.
3256 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
3257 set_dynamic_symbol_size.
3258
e8cd95c7
ILT
3259 PR 10450
3260 * output.h (class Output_section): Add is_entsize_zero_ field.
3261 * output.cc (Output_section::Output_section): Initialize
3262 is_entsize_zero_.
3263 (Output_section::set_entsize): If two different entsizes are
3264 requested, force it to zero.
3265 (Output_section::add_input_section): Set flags for .debug_str
3266 before updating section flags. Set entsize.
3267 (Output_section::update_flags_for_input_section): Set SHF_MERGE
3268 and SHF_STRING if all input sections have those flags.
3269
3e1b9a8a
RÁE
32702009-12-29 Rafael Espindola <espindola@google.com>
3271
3272 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
3273 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
3274 reporting.
3e1b9a8a 3275
3dcad376
ST
32762009-12-29 Sriraman Tallam <tmsriram@google.com>
3277
3278 * options.cc (General_options::parse_version): Allow -v to exit
3279 without an error if there is nothing to link.
3280
084e2665
ILT
32812009-12-29 Ian Lance Taylor <iant@google.com>
3282
3283 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
3284 using a version of gcc before 4.1.
3285 * configure: Rebuild.
3286
250acde3
CD
32872009-12-28 Chris Demetriou <cgd@google.com>
3288
3289 * attributes.cc (Output_attributes_section_data::do_write): Use
3290 std::vector::front rather than std::vector::data.
3291
99fff23b
ILT
32922009-12-28 Ian Lance Taylor <iant@google.com>
3293
3294 * symtab.h (class Symbol_table): Add enum Defined.
3295 * resolve.cc (Symbol_table::should_override): Add defined
3296 parameter. Change all callers. Test whether object is NULL
3297 before calling a method on it.
3298 (Symbol_table::report_resolve_problem): Add defined parameter.
3299 Change all callers.
3300 (Symbol_table::should_override_with_special): Likewise.
3301 * symtab.cc (Symbol_table::define_in_output_data): Add defined
3302 parameter. Change all callers.
3303 (Symbol_table::do_define_in_output_data): Likewise.
3304 (Symbol_table::define_in_output_segment): Likewise.
3305 (Symbol_table::do_define_in_output_segment): Likewise.
3306 (Symbol_table::define_as_constant): Likewise.
3307 (Symbol_table::do_define_as_constant): Likewise.
3308 * script.h (class Symbol_assignment): Add is_defsym parameter to
3309 constructor; change all callers.
3310 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
3311 parameter. Change all callers. Add is_defsym_ field.
3312 (class Parser_closure): Add parsing_defsym parameter to
3313 constructor; change all callers. Add parsing_defsym accessor
3314 function. Add parsing_defsym_ field.
3315
556bd683
ILT
33162009-12-28 Ian Lance Taylor <iant@google.com>
3317
3318 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 3319 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 3320
1782c879
ILT
33212009-12-23 Ian Lance Taylor <iant@google.com>
3322
3323 * i386.cc (Target_i386::do_calls_non_split): Recognize
3324 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
3325 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
3326 -fsplit-stack prologue when using %r11.
1782c879 3327
329ca2b1
ST
33282009-12-21 Sriraman Tallam <tmsriram@google.com>
3329
3330 * options.cc (General_options::parse_version): Make -v continue and do
3331 the link like GNU ld does.
3332
d675ff46
RÁE
33332009-12-17 Rafael Avila de Espindola <espindola@google.com>
3334
3335 * Makefile.am (CCFILES): Add timer.cc.
3336 (HFILES): Add timer.h.
3337 * configure.ac: Check for sysconf and times.
3338 * main.cc: include timer.h.
3339 (main): Use Timer instead of get_run_time.
3340 * timer.cc: New.
3341 * timer.h: New.
3342 * workqueue.cc: include timer.h.
3343 (Workqueue::find_and_run_task):
3344 Report user, sys and wall time.
3345 * Makefile.in: Regenerate.
3346 * config.in: Regenerate.
3347 * configure: Regenerate.
3348
d6344fb5
DK
33492009-12-16 Doug Kwan <dougkwan@google.com>
3350
3351 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
3352 sections.
3353 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
3354 relaxed input sections.
3355 * output.cc (Output_section::find_relaxed_input_section): Change
3356 return type to Output_relaxed_input_section pointer. Adjust code
3357 for new type of relaxed_input_section_map_.
3358 * output.h (Output_section::find_relaxed_input_section): Change
3359 return type to Output_relaxed_input_section pointer.
3360 (Output_section::Output_relaxed_input_section_by_input_section_map):
3361 New type.
3362 (Output_section::relaxed_input_section_map_): Change type to
3363 Output_section::Output_relaxed_input_section_by_input_section_map.
3364 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
3365 input section.
3366
0e0d5469
ILT
33672009-12-15 Ian Lance Taylor <iant@google.com>
3368
3369 * layout.cc (Layout::create_shstrtab): Only write out after input
3370 sections if we are compressing debug sections.
3371
0649a889
ILT
33722009-12-15 Ian Lance Taylor <iant@google.com>
3373
3374 * archive.cc (Archive::add_symbols): Only look up a symbol without
3375 a version if there is, in fact, a version.
3376
2ea97941
ILT
33772009-12-14 Ian Lance Taylor <iant@google.com>
3378
3379 Revert -Wshadow changes, all changes from:
3380 2009-12-11 Doug Kwan <dougkwan@google.com>
3381 2009-12-11 Nick Clifton <nickc@redhat.com>
3382 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
3383
b0eec2cc
DK
33842009-12-11 Doug Kwan <dougkwan@google.com>
3385
3386 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
3387 due to -Wshadow.
3388 * attributes.cc (Object_attribute::size): Ditto.
3389 (Attributes_section_data::size): Ditto.
3390 (Attributes_section_data::Attributes_section_data): Ditto.
3391 (Output_attributes_section_data::do_write): Ditto.
3392 * attributes.h (Object_attribute::set_type): Ditto.
3393 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
3394
91d6fa6a
NC
33952009-12-11 Nick Clifton <nickc@redhat.com>
3396
3397 * archive.cc: Fix shadowed variable warnings.
3398 * arm.cc: Likewise.
3399 * compressed_output.cc: Likewise.
3400 * compressed_output.h: Likewise.
3401 * configure: Likewise.
3402 * dwarf_reader.cc: Likewise.
3403 * dynobj.cc: Likewise.
3404 * dynobj.h: Likewise.
3405 * ehframe.cc: Likewise.
3406 * ehframe.h: Likewise.
3407 * errors.cc: Likewise.
3408 * expression.cc: Likewise.
3409 * fileread.cc: Likewise.
3410 * fileread.h: Likewise.
3411 * freebsd.h: Likewise.
3412 * i386.cc: Likewise.
3413 * icf.cc: Likewise.
3414 * incremental.h: Likewise.
3415 * layout.cc: Likewise.
3416 * layout.h: Likewise.
3417 * mapfile.cc: Likewise.
3418 * merge.cc: Likewise.
3419 * merge.h: Likewise.
3420 * object.cc: Likewise.
3421 * object.h: Likewise.
3422 * options.h: Likewise.
3423 * output.cc: Likewise.
3424 * output.h: Likewise.
3425 * parameters.cc: Likewise.
3426 * plugin.cc: Likewise.
3427 * powerpc.cc: Likewise.
3428 * reduced_debug_output.cc: Likewise.
3429 * reduced_debug_output.h: Likewise.
3430 * reloc.cc: Likewise.
3431 * reloc.h: Likewise.
3432 * resolve.cc: Likewise.
3433 * script-sections.cc: Likewise.
3434 * script.cc: Likewise.
3435 * script.h: Likewise.
3436 * sparc.cc: Likewise.
3437 * symtab.cc: Likewise.
3438 * symtab.h: Likewise.
3439 * target-select.cc: Likewise.
3440 * target-select.h: Likewise.
3441 * token.h: Likewise.
3442 * workqueue.cc: Likewise.
3443 * workqueue.h: Likewise.
3444 * x86_64.cc: Likewise.
3445
a0351a69
DK
34462009-12-10 Doug Kwan <dougkwan@google.com>
3447
3448 * arm.cc (attributes.h): New include.
3449 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
3450 (Arm_relobj::~Arm_relobj): Delete object pointed by
3451 attributes_section_data_.
3452 (Arm_relobj::attributes_section_data): New method definition.
3453 (Arm_relobj::attributes_section_data_): New data member declaration.
3454 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
3455 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
3456 attributes_section_data_.
3457 (Arm_dynobj::attributes_section_data): New method definition.
3458 (Arm_dynobj::attributes_section_data_): New data member declaration.
3459 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
3460 initialization value of may_use_blx_ to false.
3461 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
3462 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
3463 object attributes to compute results instead of hard-coding.
3464 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
3465 Target_arm::get_secondary_compatible_arch,
3466 Target_arm::set_secondary_compatible_arch
3467 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
3468 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
3469 New method declarations.
3470 (Target_arm::get_aeabi_object_attribute): New method definition.
3471 (Target_arm::attributes_section_data_): New data member declaration.
3472 (read_arm_attributes_section): New template definition.
3473 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
3474 (Arm_dynobj::do_read_symbols): Ditto.
3475 (Target_arm::do_finalize_sections): Merge attributes sections from
3476 input. Check for BLX use after attributes section merging.
3477 Fix __exidx_start and __exidx_end visibility. Create an
3478 .ARM.attributes section if necessary.
3479 (Target_arm::get_secondary_compatible_arch,
3480 Target_arm::set_secondary_compatible_arch,
3481 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
3482 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 3483 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
3484 New method definitions.
3485
b59befec
ILT
34862009-12-09 Ian Lance Taylor <iant@google.com>
3487
3488 * plugin.cc (Plugin::load): Don't cast from void* to a function
3489 pointer.
3490
1276bc89
ILT
34912009-12-09 Ian Lance Taylor <iant@google.com>
3492
3493 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
3494 information fields.
3495
2f2de248
L
34962009-12-09 H.J. Lu <hongjiu.lu@intel.com>
3497
3498 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
3499 Replace two_file_shared_1.so with two_file_shared_2.so.
3500 * testsuite/Makefile.in: Regenerated.
3501
4f787271
DK
35022009-12-08 Doug Kwan <dougkwan@google.com>
3503
3504 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
3505 (HFILES): Add attributes.h and int_encoding.h.
3506 * Makefile.in: Regenerate.
3507 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
3508 function definitions to int_encoding.cc
3509 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
3510 prototypes to int_encoding.h
3511 * reduced_debug_output.cc (int_encoding.h): New include.
3512 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
3513 function definitions to int_encoding.cc
3514 (insert_into_vector, read_from_pointer): Move template definitions to
3515 int_encoding.h
3516 * attributes.cc: New file.
3517 * attributes.h: New file.
3518 * int_encoding.cc: New file.
3519 * int_encoding.h: New file.
3520
20b52f1a
RÁE
35212009-12-07 Rafael Avila de Espindola <espindola@google.com>
3522
3523 PR gold/11055
3524 * incremental-dump.cc (dump_incremental_inputs): New.
3525 (main): Use dump_incremental_inputs.
3526
53d7974c
L
35272009-12-07 H.J. Lu <hongjiu.lu@intel.com>
3528
3529 PR gold/10893
3530 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
3531 checking elfcpp::STT_FUNC.
3532 (Target_i386::Relocate::relocate): Likewise.
3533 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3534
3535 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
3536 symbols from shared libraries into normal FUNC symbols.
3537
3538 * symtab.h (Symbol): Add is_func and use it.
3539
05a352e6
DK
35402009-12-05 Doug Kwan <dougkwan@google.com>
3541
3542 * arm.cc (Target_arm::arm_info): Initialize new fields
3543 attributes_section and attributes_vendor.
3544 * i386.cc (Target_i386::i386_info): Same.
3545 * object.cc (Sized_relobj::do_layout): Skip attribute section.
3546 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
3547 fields attributes_section and attributes_vendor.
53d7974c 3548 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
3549 * target.h (Target::attributes_section, Target::attributes_vendor,
3550 Target::is_attributes_section, Target::attribute_arg_type,
3551 Target::attributes_order): New method definitions.
3552 (Target::Target_info::attributes_section,
3553 Target::Target_info::attributes_vendor): New fields.
3554 (Target::do_attribute_arg_type, Target::do_attributes_order): New
3555 virtual method definitions.
3556 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
3557 attributes_section and attributes_vendor.
3558 * testsuite/testfile.cc (Target_test::test_target_info): Same.
3559
f4e5969c
DK
35602009-12-05 Doug Kwan <dougkwan@google.com>
3561
3562 * arm.cc: Update comments about interworking and stub generation.
3563 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
3564 considered as non-PIC.
3565 (Arm_relocate_functions::base_abs): Fix formatting.
3566 (Arm_relocate_functions::got_prel): Fix comment. Change interface
3567 of function to use GOT entry address instead of offset.
3568 (Target_arm::Scan::global): Issue an error if a symbol would need a
3569 PLT does not get one because it is untyped. Remove code to create
3570 dynamic symbols for relative branches.
3571 (Target_arm::Relocate::relocate: Use 0 instead of false since function
3572 takes unsigned integer instead of boolean.
3573
1abce4a6
L
35742009-12-05 H.J. Lu <hongjiu.lu@intel.com>
3575
3576 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
3577 (two_file_test_LDADD): Likewise.
3578 (common_test_1_LDADD): Likewise.
3579 (exception_test_LDADD) Likewise.
3580 (weak_test_LDADD): Likewise.
3581 (many_sections_test_LDADD): Likewise.
3582 (initpri1_LDADD): Likewise.
3583 (script_test_1_LDADD): Likewise.
3584 (script_test_2_LDADD): Likewise.
3585 (justsyms_LDADD): Likewise.
3586 (binary_test_LDADD): Likewise.
3587 (large_LDADD): Likewise.
3588 * testsuite/Makefile.in: Regenerated.
3589
adcf2816 35902009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 3591
adcf2816
L
3592 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
3593 (Symbol_table::override_with_special): Likewise.
3594 (Symbol_table::add_from_object): Likewise.
3595
28e67f5d
RÁE
35962009-12-04 Rafael Avila de Espindola <espindola@google.com>
3597
3598 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
3599 Don't set the data_offset twice.
3600
ae10a101
RÁE
36012009-12-04 Rafael Avila de Espindola <espindola@google.com>
3602
3603 * testsuite/Makefile.in: Regenerate.
3604
f59f41f3
DK
36052009-12-03 Doug Kwan <dougkwan@google.com>
3606
3607 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
3608 (Target_arm::do_finalize_sections): Add parameter for symbol table
3609 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
3610 * i386.cc (Target_i386::do_finalize_sections): Add an additional
3611 parameter for symbol table pointer.
3612 * layout.cc (Layout::finalize): Call Target::finalize_sections with
3613 an additional parameter for a pointer to symbol table.
3614 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
3615 parameter for a symbol table pointer.
3616 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
3617 * target.h (Target::finalize_sections, Target::do_finalize_sections):
3618 Ditto.
3619 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
3620 parameter for a symbol table pointer.
3621
ca55d848
RÁE
36222009-12-03 Rafael Avila de Espindola <espindola@google.com>
3623
3624 * incremental.cc (Incremental_inputs_header)
3625 (Incremental_inputs_header_write, Incremental_inputs_entry)
3626 (Incremental_inputs_entry_write): Move ...
3627 * incremental.h (Incremental_inputs_header)
3628 (Incremental_inputs_header_write, Incremental_inputs_entry)
3629 (Incremental_inputs_entry_write): here.
3630
3aec4f9c
RÁE
36312009-12-02 Rafael Avila de Espindola <espindola@google.com>
3632
3633 * incremental.cc (make_sized_incremental_binary): Set the target.
3634 Error if it is incompatible.
3635 * output.h (Output_file): Add filename method.
3636
9c0ae74d
RÁE
36372009-12-02 Rafael Avila de Espindola <espindola@google.com>
3638
3639 * incremental.cc (Incremental_inputs_entry): Remove unused argument
3640 from the get_* methods.
3641
a45500ae
RÁE
36422009-12-02 Rafael Avila de Espindola <espindola@google.com>
3643
3644 * incremental-dump.cc (main): Check that the offeset of a script is 0.
3645 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
3646 Write 0 for the data_offset of scripts.
3647
325e6408
RÁE
36482009-12-02 Rafael Avila de Espindola <espindola@google.com>
3649
3650 * testsuite/Makefile.am: Add the incremental_test.sh test.
3651 * testsuite/incremental_test.sh: New.
3652 * testsuite/incremental_test_1.c: New.
3653 * testsuite/incremental_test_2.c: New.
3654
954c3e2e
RÁE
36552009-12-01 Rafael Avila de Espindola <espindola@google.com>
3656
3657 * incremental-dump.cc (main): Fix typos.
3658
f8086623
RÁE
36592009-11-27 Rafael Avila de Espindola <espindola@google.com>
3660
3661 PR gold/11025
3662 * incremental-dump.cc (main): Use llu to print 64 bit values.
3663
3b0dd6ac
L
36642009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
3665 H.J. Lu <hongjiu.lu@intel.com>
3666
3667 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
3668 $(LIBDL).
3669 (incremental_dump_LDADD): Likewise.
3670 * Makefile.in: Regenerated.
3671
a6d1ef57 36722009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 3673
a6d1ef57
DK
3674 Revert:
3675
3676 2009-11-25 Doug Kwan <dougkwan@google.com>
3677
3678 * arm.cc (Target_arm::Target_arm): Move method definition
3679 outside of class definition. Add code to handle
3680 --target1-rel, --target1-abs and --target2= options.
3681 (Target_arm::get_reloc_reloc_type): Change method to be
3682 non-static and const.
3683 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
3684 New data member declaration.
3685 (Target_arm::Scan::local, Target_arm::Scan::global,
3686 Target_arm::Relocate::relocate,
3687 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
3688 Adjust call to Target_arm::get_real_reloc_type.
3689 (Target_arm::get_real_reloc_type): Use command line options
3690 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
3691 * options.h (--target1-rel, --target1-abs, --target2): New
3692 ARM-only options.
3693
50aeb7d4
DK
36942009-11-25 Doug Kwan <dougkwan@google.com>
3695
3696 * arm.cc (Target_arm::Target_arm): Move method definition outside of
3697 class definition. Add code to handle --target1-rel, --target1-abs
3698 and --target2= options.
3699 (Target_arm::get_reloc_reloc_type): Change method to be non-static
3700 and const.
3701 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
3702 member declaration.
3703 (Target_arm::Scan::local, Target_arm::Scan::global,
3704 Target_arm::Relocate::relocate,
3705 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
3706 call to Target_arm::get_real_reloc_type.
3707 (Target_arm::get_real_reloc_type): Use command line options to
3708 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
3709 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
3710 options.
3711
51938283
DK
37122009-11-25 Doug Kwan <dougkwan@google.com>
3713
3714 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
3715 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
3716 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
3717 formatting.
3718 (Arm_relocate_functions::thm_call): Replace body with a call to
3719 Arm_relocate_functions::thumb_branch_common.
3720 (Arm_relocate_functions::thm_jump24,
3721 Arm_relocate_functions::thm_xpc22): New method definitions.
3722 (Arm_relocate_functions::thumb_branch_common): New method definition.
3723 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
3724 operator.
3725 (Target_arm::Relocate::relocate): Adjust call to thm_call.
3726 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
3727
e2b8f3c4
RÁE
37282009-11-24 Rafael Avila de Espindola <espindola@google.com>
3729
3730 * Makefile.am: Build incremental-dump
3731 * Makefile.in: Regenerate.
3732 * incremental-dump.cc: New.
3733 * incremental.cc (Incremental_inputs_header_data,
3734 Incremental_inputs_entry_data): Move to incremental.h
3735 * incremental.h: (Incremental_inputs_header_data,
3736 Incremental_inputs_entry_data): Move from incremental.cc
3737
bcba9aec
RÁE
37382009-11-24 Rafael Avila de Espindola <espindola@google.com>
3739
3740 * incremental.cc (Incremental_inputs_header,
3741 Incremental_inputs_header_write, Incremental_inputs_entry,
3742 Incremental_inputs_entry_write): Add a typedef with the data type.
3743
7c3afe08
RÁE
37442009-11-24 Rafael Avila de Espindola <espindola@google.com>
3745
3746 * incremental.cc (Incremental_inputs_header,
3747 Incremental_inputs_header_write, Incremental_inputs_entry,
3748 Incremental_inputs_entry_write): Update comment about which
3749 type has the filed descriptions.
3750
d204b6e9
DK
37512009-11-15 Doug Kwan <dougkwan@google.com>
3752
3753 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
3754 (Arm_relocate_functions::arm_branch_common): Change method defintion
3755 in class definition to a method declaration and update list of formal
3756 parameters.
3757 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
3758 Arm_relocation_functions::jump24): Adjust call to
3759 Arm_relocate_functions::arm_branch_common. Update list of formal
3760 parameters.
3761 (Arm_relocate_functions::xpc25): New method definition.
3762 (Arm_relocate_functions::arm_branch_common): Move method defintion
3763 out from class definition. Use stubs for mode-switching and extending
3764 branch ranges.
3765 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
3766 specially. Change code to enable use of stubs in ARM branches.
3767
43d12afe
DK
37682009-11-10 Doug Kwan <dougkwan@google.com>
3769
3770 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
3771 in method declaration.
3772 (Target_arm::relocate_stub): New method declaration.
3773 (Target_arm::default_target): Change to return a pointer instead of
3774 a const reference.
3775 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
3776 Target_arm::default_target.
3777 (Arm_Relobj::do_relocate_sections): Remove options paramater in
3778 method definition.
3779 (Target_arm::relocate_section): Adjust view.
3780 (Target_arm::relocate_stub): New method definition.
3781
ac33a407
DK
37822009-11-10 Doug Kwan <dougkwan@google.com>
3783
3784 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
3785 a format warning.
3786 * incremental.cc (open_incremental_binary): Initialized local
3787 variables to avoid warnings.
3788 * object.cc (make_elf_object): Ditto.
3789 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
3790 a format warning.
e1df38aa 3791
88ee28e9
L
3792009-11-09 H.J. Lu <hongjiu.lu@intel.com>
3793
3794 PR gold/10930
3795 * testsuite/plugin_test.c: Include "config.h".
3796
2daedcd6
DK
37972009-11-09 Doug Kwan <dougkwan@google.com>
3798
3799 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
3800 (arm_symbol_value): Remove.
3801 (Arm_relocate_functions::arm_branch_common,
3802 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
3803 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
3804 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
3805 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
3806 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
3807 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
3808 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
3809 Arm_relocate_functions::thm_mobw_abs_nc,
3810 Arm_relocate_functions::thm_mov_abs,
3811 Arm_relocate_functions::movw_prel_nc,
3812 Arm_relocate_functions::thm_movt_abs,
3813 Arm_relocate_functions::movt_prel,
3814 Arm_relocate_functions::thm_movw_prel_nc,
3815 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
3816 (Target_arm::Relocate::relocate): Only decompose address into two
3817 parts if relocation type uses the thumb-bit and pass the actual
3818 bit instead of a flag indicating that the thumb-bit is used. Adjust
3819 calls to methods in Arm_relocate_functions for this change.
3820
1276bc89 38212009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
3822
3823 PR 10925
3824 * reloc.cc: Instantiate
3825 Sized_relobj::initialize_input_to_output_maps and
3826 Sized_relobj:free_input_to_output_maps.
3827
e53ad1b5
ILT
38282009-11-06 Ian Lance Taylor <iant@google.com>
3829
3830 PR 10876
3831 * defstd.cc (in_segment): Set only_if_ref true for "end".
3832
eb44217c
DK
38332009-11-06 Doug Kwan <dougkwan@google.com>
3834
3835 * arm.cc (class Reloc_stub): Correct a comment.
3836 (Target_arm::Target_arm): Initialize arm_input_section_map_.
3837 (Target_arm::scan_section_for_stubs): New method declaration.
3838 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
3839 Change methods from private to protected.
3840 (Target_arm::do_may_relax): New method definition.
3841 (Target_arm::do_relax, Target_arm::group_sections,
3842 Target_arm::scan_reloc_for_stub,
3843 Target_arm::scan_reloc_section_for_stubs): New method declarations.
3844 (Target_arm::arm_input_section_map_): New data member declaration.
3845 (Target_arm::scan_reloc_for_stub,
3846 Target_arm::scan_reloc_section_for_stubs,
3847 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
3848 Target_arm::do_relax): New method definitions.
3849
5d329b7d
ILT
38502009-11-06 Mikolaj Zalewski <mikolaj@google.com>
3851
3852 * configure.ac: Check for (struct stat)::st_mtim
3853 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
3854 * config.in: Regenerate.
3855 * configure: Regenerate.
3856
96a0d71b
ILT
38572009-11-05 Ian Lance Taylor <iant@google.com>
3858
3859 PR 10910
3860 * output.cc (Output_segment::add_output_section): Add missing
3861 return statement.
3862
594c8e5e
ILT
38632009-11-04 Ian Lance Taylor <iant@google.com>
3864
3865 PR 10880
3866 * object.h (class Object): Add is_needed and set_is_needed
3867 methods. Add is_needed_ field. Make bool fields into bitfields.
3868 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
3869 defined in a dynamic object and referenced by a regular object,
3870 set is_needed for the dynamic object.
3871 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
3872 if the file is marked with as_needed and it is not needed.
3873
22b127cc
ILT
38742009-11-04 Ian Lance Taylor <iant@google.com>
3875
3876 PR 10887
3877 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
3878 tags if data is discarded by linker script.
3879 * i386.cc (Target_i386::do_finalize_sections): Likewise.
3880 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
3881 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
3882 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
3883
f5c870d2
ILT
38842009-11-04 Ian Lance Taylor <iant@google.com>
3885
3886 * layout.cc (Layout::get_output_section): Add is_interp and
3887 is_dynamic_linker_section parameters. Change all callers.
3888 (Layout::choose_output_section): Likewise.
3889 (Layout::make_output_section): Likewise.
3890 (Layout::add_output_section_data): Add is_dynamic_linker_section
3891 parameter. Change all callers.
3892 * layout.h (class Layout): Update declarations.
3893 * output.h (class Output_section): Add is_interp, set_is_interp,
3894 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
3895 Add is_interp_, is_dynamic_linker_section_ fields. Change
3896 generate_code_fills_at_write_ to a bitfield.
3897 * output.cc (Output_section::Output_sections): Initialize new
3898 fields.
3899 (Output_segment::add_output_section): Add do_sort parameter.
3900 Change all callers.
3901
1ae4d23b
ILT
39022009-11-03 Ian Lance Taylor <iant@google.com>
3903
3904 PR 10860
3905 * options.h (class General_options): Add --warn-common.
3906 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
3907 merging two common symbols.
3908 (Symbol_table::should_override): Handle --warn-common when merging
3909 a common symbol with a defined symbol. Use report_resolve_problem
3910 for multiple definitions.
3911 (Symbol_table::report_resolve_problem): New function.
3912 * symtab.h (class Symbol_table): Declare report_resolve_problem.
3913
55da9579
DK
39142009-11-03 Doug Kwan <dougkwan@google.com>
3915
3916 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
3917 stub_factory_.
3918 (Target_arm::stub_factory): New method definition.
3919 (Target_arm::new_arm_input_section,
3920 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
3921 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 3922 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
3923 New type definitions.
3924 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
3925 member declarations.
3926 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
3927 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
3928 New method definitions.
3929
37a9ac43
ILT
39302009-11-03 Ian Lance Taylor <iant@google.com>
3931
3932 * options.h (class General_options): Add --warn_constructors.
3933
b3d6a3d4
ILT
39342009-11-03 Ian Lance Taylor <iant@google.com>
3935
3936 PR 10893
3937 * defstd.cc (in_section): Add entries for __rel_iplt_start,
3938 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
3939
934b01dd
ILT
39402009-11-03 Ian Lance Taylor <iant@google.com>
3941
3942 PR 10895
3943 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
3944 --msgid-bugs-address.
3945 (install-pdf): New target.
3946 (install-data_yes): Look up one directory to find mkinstalldirs.
3947
03c1939b
L
39482009-11-03 H.J. Lu <hongjiu.lu@intel.com>
3949
3950 * po/Make-in (.po.gmo): Don't generate .gmo files in source
3951 tree.
3952
ebd95253
DK
39532009-10-30 Doug Kwan <dougkwan@google.com>
3954
3955 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
3956
e9bbb538
DK
39572009-10-30 Doug Kwan <dougkwan@google.com>
3958
3959 * arm.cc (Stub_addend_reader): New struct template definition
3960 and partial specializations.
3961 (Stub_addend_reader::operator()): New method definition for a
3962 partially specialized template.
3963
d5b40221
DK
39642009-10-30 Doug Kwan <dougkwan@google.com>
3965
3966 * arm.cc (Arm_relobj::processor_specific_flags): New method
3967 definition.
3968 (Arm_relobj::do_read_symbols): New method declaration.
3969 (Arm_relobj::processor_specific_flags_): New data member declaration.
3970 (Arm_dynobj): New class definition.
3971 (Target_arm::do_finalize_sections): Add input_objects parameter.
3972 (Target_arm::do_adjust_elf_header): New method declaration.
3973 (Target_arm::are_eabi_versions_compatible,
3974 (Target_arm::merge_processor_specific_flags): New method declaration.
3975 (Target_arm::do_make_elf_object): New overloaded method definitions
3976 and declaration.
3977 (Arm_relobj::do_read_symbols): New method definition.
3978 (Arm_dynobj::do_read_symbols): Ditto.
3979 (Target_arm::do_finalize_sections): Add input_objects parameters.
3980 Merge processor-specific flags from all input objects.
3981 (Target_arm::are_eabi_versions_compatible,
3982 Target_arm::merge_processor_specific_flags,
3983 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
3984 New method definitions.
3985 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
3986 Input_objects pointer type parameter.
3987 * layout.cc (Layout::finalize): Pass input objects to target's.
3988 finalize_sections function.
3989 * output.cc (Output_file_header::do_sized_write): Set ELF file
3990 header's processor-specific flags.
3991 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
3992 Input_objects pointer type parameter.
3993 * sparc.cc (Target_sparc::do_finalize_sections): Same.
3994 * target.h (Input_objects): New forward class declaration.
3995 (Target::processor_specific_flags,
3996 Target::are_processor_specific_flags_sect): New method definitions.
3997 (Target::finalize_sections): Add input_objects parameter.
3998 (Target::Target): Initialize processor_specific_flags_ and
3999 are_processor_specific_flags_set_.
4000 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
4001 parameter.
4002 (Target::set_processor_specific_flags): New method definition.
4003 (Target::processor_specific_flags_,
4004 Target::are_processor_specific_flags_set_): New data member
4005 declarations.
4006 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
4007 Input_objects pointer type parameter.
4008
ebabffbd
DK
40092009-10-30 Doug Kwan <dougkwan@google.com>
4010
4011 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
4012
ad0f2072
ILT
40132009-10-28 Ian Lance Taylor <iant@google.com>
4014
4015 * object.h (class Relobj): Drop options parameter from
4016 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
4017 do_scan_relocs, do_relocate. Change all callers.
4018 (class Sized_relobj): Drop options parameters from
4019 do_gc_process_relocs, do_scan_relocs, do_relocate,
4020 do_relocate_sections, relocate_sections, emit_relocs_scan,
4021 emit_relocs_scan_reltype. Change all callers.
4022 (struct Relocate_info): Remove options field and all references to
4023 it.
4024 * reloc.h (class Read_relocs): Remove options constructor
4025 parameter and options_ field. Change all callers.
4026 (class Gc_process_relocs, class Scan_relocs): Likewise.
4027 (class Relocate_task): Likewise.
4028 * target-reloc.h (scan_relocs): Remove options parameter. Change
4029 all callers.
4030 (scan_relocatable_relocs): Likewise.
4031 * target.h (class Sized_target): Remove options parameter from
4032 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
4033 all callers.
4034 * gc.h (gc_process_relocs): Remove options parameter. Change all
4035 callers.
4036 * arm.cc: Update functions to remove options parameters.
4037 * i386.cc: Likewise.
4038 * powerpc.cc: Likewise.
4039 * sparc.cc: Likewise.
4040 * x86_64.cc: Likewise.
4041 * testsuite/testfile.cc: Likewise.
4042
8ffa3667
DK
40432009-10-28 Doug Kwan <dougkwan@google.com>
4044
4045 * arm.cc (Arm_relobj): New class definition.
e1df38aa 4046 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
4047 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
4048 New method definitions.
4049
40f36857
CC
40502009-10-28 Cary Coutant <ccoutant@google.com>
4051
4052 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
4053 (Plugin::cleanup_done_): New member.
4054 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
4055 (Plugin_manager::cleanup_done_): Remove.
4056 (Plugin_manager::add_input_file): Edit error message.
4057 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
4058 (Plugin_manager::cleanup): Remove use of cleanup_done_.
4059
2c849493
ILT
40602009-10-27 Mikolaj Zalewski <mikolajz@google.com>
4061
4062 * fileread.cc: (File_read::View::~View): Use the new
4063 data_ownership_ filed.
4064 (File_read::~File_read): Dispose the new whole_file_view_.
4065 (File_read::open): Mmap the whole file if needed.
4066 (File_read::open): Use whole_file_view_ instead of contents_.
4067 (File_read::find_view): Use whole_file_view_ if applicable.
4068 (File_read::do_read): Use whole_file_view_ instead of contents_.
4069 (File_read::make_view): Use whole_file_view_ instead of contents_,
4070 update File_read::View::View call.
4071 (File_read::find_or_make_view): Update File_read::View::View
4072 call.
4073 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
4074 remove contents_
4075 (File_read::View::Data_ownership): New enum.
4076 (File_read::View::View): Replace bool mapped_ with Data_ownership
4077 argument.
4078 (File_read::View::mapped_): Remove (replaced by data_ownership_).
4079 (File_read::View::data_ownership_): New field.
4080 (File_read::contents_): Remove (replaced by whole_file_view_).
4081 (File_read::whole_file_view_): New field.
4082 * options.h (class General_options): Add --keep-files-mapped.
4083
24998053
CC
40842009-10-27 Cary Coutant <ccoutant@google.com>
4085
4086 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
4087 * testsuite/Makefile.am (plugin_test_5): New test case.
4088 * testsuite/Makefile.in: Regenerate.
4089
72adc4fa
DK
40902009-10-25 Doug Kwan <dougkwan@google.com>
4091
4092 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
4093 from private to protected to allow access by child class.
4094 (Sized_relobj::do_relocate_sections): New method declaration.
4095 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 4096 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
4097 Sized_relobj::relocate_sections. Instantiate template explicitly
4098 for different target sizes and endianity.
4099
07f508a2
DK
41002009-10-24 Doug Kwan <dougkwan@google.com>
4101
4102 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
4103 (Arm_input_section::as_arm_input_section): New method.
4104 (Arm_output_section): New class definition.
4105 (Arm_output_section::create_stub_group,
4106 Arm_output_section::group_sections): New method definitions.
4107
10ad9fe5
DK
41082009-10-22 Doug Kwan <dougkwan@google.com>
4109
4110 * arm.cc (Arm_input_section): New class definition.
4111 (Arm_input_section::init, Arm_input_section:do_write,
4112 Arm_input_section::set_final_data_size,
4113 Arm_input_section::do_reset_address_and_file_offset): New method
4114 definitions.
4115
56ee5e00
DK
41162009-10-21 Doug Kwan <dougkwan@google.com>
4117
4118 * arm.cc (Stub_table, Arm_input_section): New forward class
4119 declarations.
4120 (Stub_table): New class defintion.
4121 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
4122 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
4123 New method definition.
4124
b569affa
DK
41252009-10-21 Doug Kwan <dougkwan@google.com>
4126
4127 * arm.cc: Update copyright comments.
4128 (Target_arm): New forward class template declaration.
4129 (Arm_address): New type.
4130 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
4131 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
4132 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
4133 constants.
4134 (Insn_template): Same.
4135 (DEF_STUBS): New macro.
4136 (Stub_type): New enum type.
4137 (Stub_template): New class definition.
4138 (Stub): Same.
4139 (Reloc_stub): Same.
4140 (Stub_factory): Same.
4141 (Target_arm::Target_arm): Initialize may_use_blx_ and
4142 should_force_pic_veneer_.
4143 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
4144 Target_arm::should_force_pic_veneer,
4145 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
4146 Target_arm::using_thumb_only, Target_arm:;default_target): New
4147 method defintions.
4148 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
4149 New data member declarations.
4150 (Insn_template::size, Insn_template::alignment): New method defintions.
4151 (Stub_template::Stub_template): New method definition.
4152 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
4153 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
4154 (Stub_factory::Stub_factory): New method definition.
4155 * gold.h (string_hash): New template.
4156 * output.h (Input_section_specifier::hash_value): Use
4157 gold::string_hash.
4158 (Input_section_specifier::string_hash): Remove.
4159 * stringpool.cc (Stringpool_template::string_hash): Use
4160 gold::string_hash.
4161
6c172549
DK
41622009-10-20 Doug Kwan <dougkwan@google.com>
4163
4164 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
4165 symbols of relaxed input sections.
4166 * output.h (Output_section::find_relaxed_input_section): Make
4167 method public.
4168
c5617f2f
DK
41692009-10-16 Doug Kwan <dougkwan@google.com>
4170
4171 * dynobj.cc (Versions::Versions): Initialize version_script_.
4172 Only insert base version symbol definition for a shared object
4173 if version script defines any version versions.
4174 (Versions::define_base_version): New method definition.
4175 (Versions::add_def): Check that base version is not needed.
4176 (Versions::add_need): Define base version lazily.
4177 * dynobj.h (Versions::define_base_version): New method declaration.
4178 (Versions::needs_base_version_): New data member declaration.
4179 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
4180 (check_DATA): Add no_version_test.stdout.
4181 (libno_version_test.so, no_version_test.o no_version_test.stdout):
4182 New make rules.
4183 * testsuite/Makefile.in: Regenerate.
4184 * testsuite/no_version_test.c: New file.
4185 * testsuite/no_version_test.sh: Ditto.
4186
3c12dcdb
DK
41872009-10-16 Doug Kwan <dougkwan@google.com>
4188
4189 * expression.cc (class Segment_start_expression): New class definition.
4190 (Segment_start_expression::value): New method definition.
4191 (script_exp_function_segment_start): Return a new
4192 Segment_start_expression.
4193 * gold/script-c.h (script_saw_segment_start_expression): New function
4194 prototype.
4195 * script-sections.cc (Script_sections::Script_sections): Initialize
4196 SAW_SEGMENT_START_EXPRESSION_ to false.
4197 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
4198 and -Tbbs options to specify section addresses if given in
4199 command line and no SEGMENT_START expression is seen in a script.
4200 * script-sections.h (Script_sections::saw_segment_start_expression,
4201 Script_sections::set_saw_segment_start_expression): New method
4202 definition.
4203 (Script_sections::saw_segment_start_expression_): New data member
4204 declaration.
4205 * script.cc (script_saw_segment_start_expression): New function.
4206 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
4207 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
4208 script_test_7.sh and script_test_8.sh.
4209 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
4210 script_test_8.stdout.
4211 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
4212 (script_test_6, script_test_6.stdout, script_test_7,
4213 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
4214 * Makefile.in: Regenerate.
4215 * testsuite/script_test_6.sh: New file.
4216 * testsuite/script_test_6.t: Same.
4217 * testsuite/script_test_7.sh: Same.
4218 * testsuite/script_test_7.t: Same.
4219 * testsuite/script_test_8.sh: Same.
4220
64b1ae37
DK
42212009-10-16 Doug Kwan <dougkwan@google.com>
4222
4223 * output.cc (Output_segment::set_section_list_address): Cast
4224 expressions to unsigned long long type to avoid format warnings.
4225
661be1e2
ILT
42262009-10-15 Ian Lance Taylor <iant@google.com>
4227
12edd763 4228 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 4229 dot assignment to script_sections_.
12edd763
ILT
4230 * script-sections.cc (Script_sections::add_dot_assignment):
4231 Initialize if necessary.
4232
68b6574b
ILT
4233 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
4234 program headers with no load segment if there is a linker script.
4235
661be1e2
ILT
4236 * layout.cc (Layout::set_segment_offsets): Align the file offset
4237 to the segment aligment for -N or -n with no load segment.
4238 * output.cc (Output_segment::add_output_section): Don't crash if
4239 the first section is a TLS section.
4240 (Output_segment::set_section_list_addresses): Print an error
4241 message if the address moves backward in a linker script.
4242 * script-sections.cc
4243 (Output_section_element_input::set_section_addresses): Don't
4244 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
4245 (Orphan_output_section::set_section_addresses): Likewise.
4246
f15f61a7
DK
42472009-10-15 Doug Kwan <dougkwan@google.com>
4248
4249 * layout.cc (Layout::finish_dynamic_section): Generate tags
4250 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
4251 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
4252 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
4253
82bb573a
ILT
42542009-10-14 Ian Lance Taylor <iant@google.com>
4255
4256 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
4257 fields.
4258 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
4259 data_shdr fields of relinfo.
4260 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
4261 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
4262 R_386_TLS_LDO_32, adjust based on section flags.
4263 (Target_i386::Relocate::fix_up_ldo): Remove.
4264
374ad285
ILT
42652009-10-13 Ian Lance Taylor <iant@google.com>
4266
4267 Add support for -pie.
4268 * options.h (class General_options): Add -pie and
4269 --pic-executable.
4270 (General_options::output_is_position_independent): Test -pie.
4271 (General_options::output_is_executable): Return true if not shared
4272 and not relocatable.
4273 (General_options::output_is_pie): Remove.
4274 * options.cc (General_options::finalize): Reject incompatible uses
4275 of -pie.
4276 * gold.cc (queue_middle_tasks): A -pie link is not static.
4277 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
4278 * symtab.cc (Symbol::final_value_is_known): Return false if
4279 output_is_position_independent.
4280 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
4281 output_is_position_independent.
4282 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
4283 output_is_position_independent.
4284 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
4285 output_is_position_independent.
4286 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
4287 two_file_pie_test.
4288 (basic_pie_test.o, basic_pie_test): New targets.
4289 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
4290 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
4291 (two_file_pie_test): New target.
4292 * testsuite/Makefile.in: Rebuild.
4293 * README: Remove note saying that -pie is not supported.
4294
c6585162
ILT
42952009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
4296
4297 * options.h (class General_options): Add -init and -fini.
4298 * layout.cc (Layout::finish_dynamic_section): Emit
4299 given init and fini functions.
4300
032ce4e9
ST
43012009-10-13 Sriraman Tallam <tmsriram@google.com>
4302
4303 * gc.h (gc_process_relocs): Check if icf is enabled using new
4304 function.
4305 * gold.cc (queue_initial_tasks): Likewise.
4306 (queue_middle_tasks): Likewise.
4307 * object.cc (do_layout): Likewise.
4308 * symtab.cc (is_section_folded): Likewise.
4309 * main.cc (main): Likewise.
4310 * reloc.cc (Read_relocs::run): Likewise.
4311 (Sized_relobj::do_scan_relocs): Likewise.
4312 * icf.cc (is_function_ctor_or_dtor): New function.
4313 (Icf::find_identical_sections): Check if function is ctor or dtor when
4314 safe icf is chosen.
4315 * options.h (General_options::icf): Change option to be an enum.
4316 (Icf_status): New enum.
4317 (icf_enabled): New method.
4318 (icf_safe_folding): New method.
4319 (set_icf_status): New method.
4320 (icf_status_): New variable.
4321 * (options.cc) (General_options::finalize): Set icf_status_.
4322 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
4323 icf_test and icf_keep_unique_test to use the --icf enum flag.
4324 * testsuite/icf_safe_test.sh: New file.
e1df38aa 4325 * testsuite/icf_safe_test.cc: New file.
032ce4e9 4326
f345227a
ST
43272009-10-12 Sriraman Tallam <tmsriram@google.com>
4328
4329 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
4330 includes to gc.h and icf.h.
4331 * arm.cc: Include gc.h.
4332 * gold.cc: Likewise.
4333 * i386.cc: Likewise.
4334 * powerpc.cc: Likewise.
4335 * sparc.cc: Likewise.
4336 * x86_64.cc: Likewise.
4337 * gc.h: Include icf.h.
4338
1c7814ed
ILT
43392009-10-11 Ian Lance Taylor <iant@google.com>
4340
4341 * plugin.cc: Include "gold.h" before other header files.
4342
ae3b5189
CD
43432009-10-10 Chris Demetriou <cgd@google.com>
4344
4345 * options.h (Input_file_argument::Input_file_type): New enum.
4346 (Input_file_argument::is_lib_): Replace with...
4347 (Input_file_argument::type_): New member.
4348 (Input_file_argument::Input_file_argument): Take Input_file_type
4349 'type' rather than boolean 'is_lib' as second argument.
4350 (Input_file_argument::is_lib): Use type_.
4351 (Input_file_argument::is_searched_file): New function.
4352 (Input_file_argument::may_need_search): Handle is_searched_file.
4353 * options.cc (General_options::parse_library): Support -l:filename.
4354 (General_options::parse_just_symbols): Update for Input_file_argument
4355 changes.
4356 (Command_line::process): Likewise.
4357 * archive.cc (Archive::get_file_and_offset): Likewise.
4358 * plugin.cc (Plugin_manager::release_input_file): Likewise.
4359 * script.cc (read_script_file, script_add_file): Likewise.
4360 * fileread.cc (Input_file::Input_file): Likewise.
4361 (Input_file::will_search_for): Handle is_searched_file.
4362 (Input_file::open): Likewise.
4363 * readsyms.cc (Read_symbols::get_name): Likewise.
4364 * testsuite/Makefile.am (searched_file_test): New test.
4365 * testsuite/Makefile.in: Regenerate.
4366 * testsuite/searched_file_test.cc: New file.
4367 * testsuite/searched_file_test_lib.cc: New file.
4368
f3048a1d
ILT
43692009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
4370 Ian Lance Taylor <iant@google.com>
4371
4372 * descriptor.cc: Include <cstdio> and "binary-io.h".
4373 (Descriptors::open): Open the files in binary mode always.
4374 * script.cc (Lex::get_token): Treat \r as whitespace.
4375
d4780e57
ILT
43762009-10-09 Ian Lance Taylor <iant@google.com>
4377
4378 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
4379
d9a893b8
ILT
43802009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
4381 Ian Lance Taylor <iant@google.com>
4382
4383 * configure.ac: Check for readv function also.
4384 * fileread.cc (readv): Define if not HAVE_READV.
4385 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
4386 does not exist.
4387 * config.in: Regenerate.
4388 * configure: Regenerate.
4389
c0a62865
DK
43902009-10-09 Doug Kwan <dougkwan@google.com>
4391
4392 * layout.cc (Layout::make_output_section): Call target hook to make
4393 ordinary output section.
4394 (Layout::finalize): Adjust parameter list of call the
4395 Target::may_relax().
4396 * layout.h (class Layout::section_list): New method.
4397 * merge.h (Output_merge_base::entsize): Change visibility to public.
4398 (Output_merge_base::is_string, Output_merge_base::do_is_string):
4399 New methods.
4400 (Output_merge_string::do_is_string): New method.
4401 * object.cc (Sized_relobj::do_setup): renamed from
4402 Sized_relobj::set_up.
4403 * object.h (Sized_relobj::adjust_shndx,
4404 Sized_relobj::initializ_input_to_output_maps,
4405 Sized_relobj::free_input_to_output_maps): Change visibilities to
4406 protected.
4407 (Sized_relobj::setup): Virtualize.
4408 (Sized_relobj::do_setup): New method declaration.
4409 (Sized_relobj::invalidate_section_offset,
4410 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
4411 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
4412 * options.cc (parse_int): New function.
4413 * options.h (parse_int): New declaration.
4414 (DEFINE_int): New macro.
4415 (stub_group_size): New option.
4416 * output.cc (Output_section::Output_section): Initialize memebers
4417 merge_section_map_, merge_section_by_properties_map_,
4418 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
4419 (Output_section::add_input_section): Handled deferred code-fill
4420 generation and remove an old comment.
4421 (Output_section::add_relaxed_input_section): New method definition.
4422 (Output_section::add_merge_input_section): Use merge section by
4423 properties map to speed to search. Update merge section maps
4424 as appropriate.
4425 (Output_section::build_relaxation_map): New method definition.
4426 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
4427 Same.
4428 (Output_section::relax_input_section): Renamed to
4429 Output_section::convert_input_sections_to_relaxed_sections and change
4430 interface to take a vector of pointers to relaxed sections.
4431 (Output_section::find_merge_section,
4432 Output_section::find_relaxed_input_section): New method definitions.
4433 (Output_section::is_input_address_mapped,
4434 Output_section::output_offset, Output_section::output_address):
4435 Use output section data maps to speed up searching.
4436 (Output_section::find_starting_output_address): Add comments.
4437 (Output_section::do_write,
4438 Output_section::write_to_postprocessing_buffer): Do code-fill
4439 generation as appropriate.
4440 (Output_section::get_input_sections): Invalidate relaxed input section
4441 map.
4442 (Output_section::restore_states): Adjust type of checkpoint .
4443 Invalidate relaxed input section map.
4444 * output.h (Output_merge_base): New class declaration.
4445 (Input_section_specifier): New class defintion.
4446 (class Output_relaxed_input_section) Change base class to
4447 Output_section_data_build.
4448 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
4449 base class initializer.
4450 (Output_section::add_relaxed_input_section): New method declaration.
4451 (Output_section::Input_section): Change visibility to protected.
4452 (Output_section::Input_section::relobj,
4453 Output_section::Input_section::shndx): Handle relaxed input sections.
4454 Output_section::input_sections) Change visibility to protected. Also
4455 define overload to return a non-const pointer.
4456 (Output_section::Merge_section_properties): New class defintion.
4457 (Output_section::Merge_section_by_properties_map,
4458 Output_section::Output_section_data_by_input_section_map,
4459 Output_section::Relaxation_map): New types.
4460 (Output_section::relax_input_section): Rename method to
4461 Output_section::convert_input_sections_to_relaxed_sections and change
4462 interface to take a vector of relaxed section pointers.
4463 (Output_section::find_merge_section,
4464 Output_section::find_relaxed_input_section,
4465 Output_section::build_relaxation_map,
4466 Output_section::convert_input_sections_in_list_to_relaxed_sections):
4467 New method declarations.
4468 (Output_section::merge_section_map_
4469 Output_section::merge_section_by_properties_map_,
4470 Output_section::relaxed_input_section_map_,
4471 Output_section::is_relaxed_input_section_map_valid_,
4472 Output_section::generate_code_fills_at_write_): New data members.
4473 * script-sections.cc
4474 (Output_section_element_input::set_section_addresses): Call
4475 current_data_size and addralign methods of relaxed input sections.
4476 (Orphan_output_section::set_section_addresses): Call current_data_size
4477 and addralign methods of relaxed input sections.
4478 * symtab.cc (Symbol_table::compute_final_value): Extract template
4479 from the body of Symbol_table::sized_finalize_symbol.
4480 (Symbol_table::sized_finalized_symbol): Call
4481 Symbol_table::compute_final_value.
4482 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
4483 (Symbol_table::compute_final_value): New templated method declaration.
4484 * target.cc (Target::do_make_output_section): New method defintion.
4485 * target.h (Target::make_output_section): New method declaration.
4486 (Target::relax): Add more parameters for input objects, symbol table
4487 and layout. Adjust call to do_relax.
4488 (Target::do_make_output_section): New method declaration.
4489 (Target::do_relax): Add parameters for input objects, symbol table
4490 and layout.
4491
d446d6c4
ILT
44922009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
4493
4494 * pread.c: Include stdio.h.
4495
bc06c745
ILT
44962009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
4497
4498 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
4499 defined.
4500
75aea3d0
ILT
45012009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
4502
4503 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4504 Change read_shndx type to unsigned int.
4505 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
4506 int.
4507 (Sized_dwarf_line_info::read_line_mappings): Likewise.
4508 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
4509 Change read_shndx type to unsigned int.
4510 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
4511 int.
4512 (Sized_dwarf_line_info::read_line_mappings): Likewise.
4513 * layout.cc (Layout::create_symtab_sections): Cast the result of
4514 local_symcount * symsize to off_t in the gold_assert.
4515
be8fcb75
ILT
45162009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4517
4518 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
4519 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
4520 R_ARM_BASE_ABS.
4521 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
4522 (Arm_relocate_functions::thm_abs5): New function.
4523 (Arm_relocate_functions::abs12): New function.
4524 (Arm_relocate_functions::abs16): New function.
4525 (Arm_relocate_functions::base_abs): New function.
4526 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
4527 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
4528 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
4529 R_ARM_BASE_ABS.
4530 (Scan::global): Likewise.
4531 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
4532 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
4533 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
4534 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
4535 R_ARM_BASE_ABS.
4536
c2a122b6
ILT
45372009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4538
4539 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
4540 (Arm_relocate_functions::movt_prel): New function.
4541 (Arm_relocate_functions::thm_movw_prel_nc): New function.
4542 (Arm_relocate_functions::thm_movt_prel): New function.
4543 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
4544 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
4545 (Scan::global, Relocate::relocate): Likewise.
4546 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
4547
c4aa1e2d
ILT
45482009-10-09 Mikolaj Zalewski <mikolajz@google.com>
4549
4550 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
4551 Incremental_checker.
4552 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
4553 unsigned int.
4554 (class Incremental_inputs_header): New class.
4555 (Incremental_inputs_header_writer): Edit comment.
4556 (Incremental_inputs_entry): New class.
4557 (Incremental_inputs_entry_writer): Edit comment.
4558 (Sized_incremental_binary::do_find_incremental_inputs_section):
4559 Add *strtab_shndx parameter, fill it.
4560 (Sized_incremental_binary::do_check_inputs): New method.
4561 (Incremental_checker::can_incrementally_link_output_file): Use
4562 Sized_incremental_binary::check_inputs.
4563 (Incremental_inputs::report_command_line): Save command line in
4564 command_line_.
4565 * incremental.h:
4566 (Incremental_binary::find_incremental_inputs_section): New
4567 method.
4568 (Incremental_binary::do_find_incremental_inputs_section): Add
4569 strtab_shndx parameter.
4570 (Incremental_binary::do_check_inputs): New pure virtual method.
4571 (Sized_incremental_binary::do_check_inputs): Declare.
4572 (Incremental_checker::Incremental_checker): Add incremental_inputs
4573 parameter, use it to initialize incremental_inputs_.
4574 (Incremental_checker::incremental_inputs_): New field.
4575 (Incremental_checker::command_line): New method.
4576 (Incremental_checker::inputs): New method.
4577 (Incremental_checker::command_line_): New field.
4578
c549a694
ILT
45792009-10-09 Mikolaj Zalewski <mikolajz@google.com>
4580
4581 * incremental.cc: Include <cstdarg> and "target-select.h".
4582 (vexplain_no_incremental): New function.
4583 (explain_no_incremental): New function.
4584 (Incremental_binary::error): New method.
4585 (Sized_incremental_binary::do_find_incremental_inputs_section): New
4586 method.
4587 (make_sized_incremental_binary): New function.
4588 (open_incremental_binary): New function.
4589 (can_incrementally_link_file): Add checks if output is ELF and has
4590 inputs section.
4591 * incremental.h: Include "elfcpp_file.h" and "output.h".
4592 (Incremental_binary): New class.
4593 (Sized_incremental_binary): New class.
4594 (open_incremental_binary): Declare.
4595 * object.cc (is_elf_object): Use
4596 elfcpp::Elf_recognizer::is_elf_file.
4597 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
4598 * output.h (Output_file::filesize): New method.
4599
fd3c5f0b
ILT
46002009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4601
4602 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
4603 New function.
4604 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
4605 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
4606 function.
4607 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
4608 function.
4609 (Arm_relocate_functions::movw_abs_nc): New function.
4610 (Arm_relocate_functions::movt_abs): New function.
4611 (Arm_relocate_functions::thm_movw_abs_nc): New function.
4612 (Arm_relocate_functions::thm_movt_abs): New function.
4613 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
4614 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
4615 (Scan::global): Likewise.
4616 (Relocate::relocate): Likewise.
4617 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
4618
7f5309a5
ILT
46192009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4620
4621 * arm.cc (Arm_relocate_functions::got_prel) New function.
4622 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
4623 (Relocate::relocate): Likewise.
4624 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
4625
364c7fa5
ILT
46262009-10-06 Ian Lance Taylor <iant@google.com>
4627
4628 * options.h (class General_options): Define
4629 split_stack_adjust_size parameter.
4630 * object.h (class Object): Add uses_split_stack_ and
4631 has_no_split_stack_ fields. Add uses_split_stack and
4632 has_no_split_stack accessor functions. Declare
4633 handle_split_stack_section.
4634 (class Reloc_symbol_changes): Define.
4635 (class Sized_relobj): Define Function_offsets. Declare
4636 split_stack_adjust, split_stack_adjust_reltype, and
4637 find_functions.
4638 * object.cc (Object::handle_split_stack_section): New function.
4639 (Sized_relobj::do_layout): Call handle_split_stack_section.
4640 * dynobj.cc (Sized_dynobj::do_layout): Call
4641 handle_split_stack_section.
4642 * reloc.cc (Sized_relobj::relocate_sections): Call
4643 split_stack_adjust for executable sections in split_stack
4644 objects. Pass reloc_map to relocate_section.
4645 (Sized_relobj::split_stack_adjust): New function.
4646 (Sized_relobj::split_stack_adjust_reltype): New function.
4647 (Sized_relobj::find_functions): New function.
4648 * target-reloc.h: Include "object.h".
4649 (relocate_section): Add reloc_symbol_changes parameter. Change
4650 all callers.
4651 * target.h (class Target): Add calls_non_split method. Declare
4652 do_calls_non_split virtual method. Declare match_view and
4653 set_view_to_nop.
4654 * target.cc: Include "elfcpp.h".
4655 (Target::do_calls_non_split): New function.
4656 (Target::match_view): New function.
4657 (Target::set_view_to_nop): New function.
4658 * gold.cc (queue_middle_tasks): Give an error if mixing
4659 split-stack and non-split-stack objects with -r.
4660 * i386.cc (Target_i386::relocate_section): Add
4661 reloc_symbol_changes parameter.
4662 (Target_i386::do_calls_non_split): New function.
4663 * x86_64.cc (Target_x86_64::relocate_section): Add
4664 reloc_symbol_changes parameter.
4665 (Target_x86_64::do_calls_non_split): New function.
4666 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
4667 parameter.
4668 * powerpc.cc (Target_powerpc::relocate_section): Add
4669 reloc_symbol_changes parameter.
4670 * sparc.cc (Target_sparc::relocate_section): Add
4671 reloc_symbol_changes parameter.
4672 * configure.ac: Call AM_CONDITIONAL for the default target.
4673 * configure: Rebuild.
4674 * testsuite/Makefile.am (TEST_AS): New variable.
4675 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
4676 (check_DATA): Add split_i386 and split_x86_64 files.
4677 (SPLIT_DEFSYMS): Define.
4678 (split_i386_[1234n].o): New targets.
4679 (split_i386_[124]): New targets.
4680 (split_i386_[1234r].stdout): New targets.
4681 (split_x86_64_[1234n].o): New targets.
4682 (split_x86_64_[124]): New targets.
4683 (split_x86_64_[1234r].stdout): New targets.
4684 (MOSTLYCLEANFILES): Add new executables.
4685 * testsuite/split_i386.sh: New file.
4686 * testsuite/split_x86_64.sh: New file.
4687 * testsuite/split_i386_1.s: New file.
4688 * testsuite/split_i386_2.s: New file.
4689 * testsuite/split_i386_3.s: New file.
4690 * testsuite/split_i386_4.s: New file.
4691 * testsuite/split_i386_n.s: New file.
4692 * testsuite/split_x86_64_1.s: New file.
4693 * testsuite/split_x86_64_2.s: New file.
4694 * testsuite/split_x86_64_3.s: New file.
4695 * testsuite/split_x86_64_4.s: New file.
4696 * testsuite/split_x86_64_n.s: New file.
4697 * testsuite/testfile.cc (Target_test): Update relocation_section
4698 function.
4699 * testsuite/Makefile.in: Rebuild.
4700
e8a9fcda
ILT
47012009-10-06 Ian Lance Taylor <iant@google.com>
4702
4703 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
4704 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
4705 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
4706 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
4707 the address on ldo_addrs_.
4708 (Target_i386::Relocate::fix_up_ldo): New function.
4709
e99daf92
ILT
47102009-10-06 Rafael Espindola <espindola@google.com>
4711
4712 * plugin.cc (add_input_library): New.
4713 (Plugin::load): Add add_input_library to tv.
4714 (Plugin_manager::add_input_file): Add the is_lib argument.
4715 (add_input_file): Update call to Plugin_manager::add_input_file.
4716 (add_input_library): New.
4717 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
4718
966d4097
DK
47192009-09-30 Doug Kwan <dougkwan@google.com>
4720
4721 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
4722 symbol and call Symbol::may_need_copy_reloc to determine if
4723 a copy reloc is needed.
4724 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
4725 nocopyreloc is given in command line.
4726 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
4727 given in command line.
4728 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
4729 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
4730 of the removed Target_i386::may_need_copy_reloc.
4731 * options.h (copyreloc): New option with default value false.
4732 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
4733 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
4734 instead of the removed Target_powerpc::may_need_copy_reloc.
4735 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
4736 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
4737 instead of the removed Target_sparc::may_need_copy_reloc.
4738 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
4739 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
4740 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
4741 instead of the removed Target_x86_64::may_need_copy_reloc.
4742
029ba973
ILT
47432009-09-30 Ian Lance Taylor <iant@google.com>
4744
4745 * object.h (class Object): Remove target_ field, and target,
4746 sized_target, and set_target methods.
4747 (Object::sized_target): Remove.
4748 (class Sized_relobj): Update declarations. Remove sized_target.
4749 * object.cc (Sized_relobj::setup): Remove target parameter.
4750 Change all callers.
4751 (Input_objects::add_object): Don't do anything with the target.
4752 (make_elf_sized_object): Add punconfigured parameter. Change all
4753 callers. Set or test parameter target.
4754 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
4755 Change all callers.
4756 * parameters.cc (Parameters::set_target): Change parameter type to
4757 be non-const.
4758 (Parameters::default_target): Remove.
4759 (set_parameters_target): Change parameter type to be non-const.
4760 (parameters_force_valid_target): New function.
4761 (parameters_clear_target): New function.
4762 * parameters.h (class Parameters): Update declarations. Remove
4763 default_target method. Add sized_target and clear_target
4764 methods. Change target_ to be non-const.
4765 (set_parameters_target): Update declaration.
4766 (parameters_force_valid_target): Declare.
4767 (parameters_clear_target): Declare.
4768 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
4769 as NULL if we aren't searching.
4770 (Add_symbols::run): Don't check for compatible target.
4771 * fileread.cc (Input_file::open_binary): Call
4772 parameters_force_valid_target.
4773 * gold.cc (queue_middle_tasks): Likewise.
4774 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
4775 set_target on object.
4776 * dynobj.h (class Sized_dynobj): Update declarations.
4777 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
4778 make_elf_object returns NULL.
4779 (Archive::include_member): Don't check whether object target is
4780 compatible.
4781 * output.cc (Output_section::add_input_section): Get target from
4782 parameters.
4783 (Output_section::relax_input_section): Likewise.
4784 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
4785 parameters.
4786 (Sized_relobj::do_scan_relocs): Likewise.
4787 (Sized_relobj::relocate_sections): Likewise.
4788 * resolve.cc (Symbol_table::resolve): Likewise.
4789 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
4790 parameter. Change all callers.
4791 (Symbol_table::add_from_object): Get target from parameters.
4792 (Symbol_table::add_from_relobj): Don't check object target.
4793 (Symbol_table::add_from_dynobj): Likewise.
4794 (Symbol_table::define_special_symbol): Get target from
4795 parameters.
4796 * symtab.h (class Symbol_table): Update declaration.
4797 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
4798 parameter. Change all callers. Clear parameter target.
4799 (Binary_test): Test target here.
4800 * testsuite/object_unittest.cc (gold_testsuite): Remove
4801 target_test_pointer parameter. Change all callers.
4802 (Object_test): Test target here.
4803
a6a22b83
ILT
48042009-09-26 Ian Lance Taylor <iant@google.com>
4805
4806 * testsuite/initpri1.c: Don't try to use constructor priorities if
4807 compiling with gcc before 4.3.
4808
6a8f49fe
ILT
48092009-09-22 Mikolaj Zalewski <mikolajz@google.com>
4810
4811 * testsuite/retain_symbols_file_test.sh (check_present): Change
4812 output file name to retain_symbols_file_test.stdout.
4813 (check_absent): Likewise.
4814
8c604651
CS
48152009-09-18 Craig Silverstein <csilvers@google.com>
4816
4817 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
4818 * options.cc: Include <cerrno> and <fstream>.
4819 (General_options::finalize): Parse -retain-symbols-file tag.
4820 * options.h: New flag.
4821 (General_options): New method should_retain_symbol, new
4822 variable symbols_to_retain.
4823 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
4824 should_retain_symbol map.
4825 * testsuite/Makefile.am (retain_symbols_file_test): New test.
4826 * testsuite/Makefile.in: Regenerate.
4827 * testsuite/retain_symbols_file_test.sh: New file.
4828
ca58b19f
NC
48292009-09-18 Nick Clifton <nickc@redhat.com>
4830
4831 * po/es.po: Updated Spanish translation.
4832
20e6d0d6
DK
48332009-09-17 Doug Kwan <dougkwan@google.com>
4834
4835 * debug.h (DEBUG_RELAXATION): New constant.
4836 (DEBUG_ALL): Add DEBUG_RELAXATION.
4837 (debug_string_to_enum): Add relaxation debug option.
4838 * layout.cc
4839 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
4840 Layout::Relaxation_debug_check::read_sections,
4841 Layout::Relaxation_debug_check::read_sections): New method definitions.
4842 (Layout::Layout): Initialize data members
4843 record_output_section_data_from_scrips_,
4844 script_output_section_data_list_ and relaxation_debug_check_.
4845 (Layout::save_segments, Layout::restore_segments,
4846 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
4847 Layout::relaxation_loop_body): New method definitions.
4848 (Layout::finalize): Support relaxation. Move section layout code to
4849 Layout::relaxation_loop_body.
4850 (Layout::set_asection_address_from_script): Move code for orphan
4851 section placement out.
4852 (Layout::place_orphan_sections_in_script): New method definition.
4853 * layout.h (Output_segment_headers, Output_file_header):
4854 New forward class declarations.
4855 (Layout::~Layout): Define.
4856 (Layout::new_output_section_data_from_script): New method definition.
4857 (Layout::place_orphan_sections_in_script): New method declaration.
4858 (Layout::Segment_states): New type declaration.
4859 (Layout::save_segments, Layout::restore_segments,
4860 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
4861 Layout::relaxation_loop_body): New method declarations.
4862 (Layout::Output_section_data_list): New type declaration.
4863 (Layout::Relaxation_debug_check): New class definition.
4864 (Layout::record_output_section_data_from_script_,
4865 Layout::script_output_section_data_list_, Layout::segment_states_,
4866 Layout::relaxation_debug_check_): New data members.
4867 * output.cc: (Output_section_headers::do_size): New method definition.
4868 (Output_section_headers::Output_section_headers): Move size
4869 computation to Output_section_headers::do_size.
4870 (Output_segment_headers::do_size): New method definition.
e1df38aa 4871 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
4872 Output_file_header::do_size and call it.
4873 (Output_file_header::do_size): New method definition.
4874 (Output_data_group::Output_data_group): Adjust call to
4875 Output_section_data.
4876 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
4877 (Output_symtab_xindex::do_write): Add array bound check.
4878 (Output_section::Input_section::print_to_mapfile): Handle
4879 RELAXED_INPUT_SECTION_CODE.
4880 (Output_section::Output_section): Initialize data member checkpoint_.
4881 (Output_section::~Output_section): Delete checkpoint object pointed
4882 by checkpoint_.
4883 (Output_section::add_input_section): Always add an Input_section if
4884 relaxing.
4885 (Output_section::add_merge_input_section): Add assert.
4886 (Output_section::relax_input_section): New method definition.
4887 (Output_section::set_final_data_size): Set load address to zero for
4888 an unallocated section.
4889 (Output_section::do_address_and_file_offset_have_reset_values):
4890 New method definition.
4891 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
4892 Handle relaxed input section.
4893 (Output_section::sort_attached_input_sections): Checkpoint input
4894 section list lazily.
4895 (Output_section::get_input_sections): Change type of input_sections to
4896 list of Simple_input_section pointers. Checkpoint input section list
4897 lazily. Also handle relaxed input sections.
4898 (Output_section::add_input_section_for_script): Take a reference to
4899 a Simple_input_section object instead of Relobj pointer and section
4900 index as parameter. Handle relaxed input sections.
4901 (Output_section::save_states, Output_section::restore_states): New
4902 method definitions.
4903 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
4904 (Output_data::is_data_size_fixed): New method definition.
4905 (Output_data::reset_addresss_and_file_offset): Do not reset data size
4906 if it is fixed.
4907 (Output_data::address_and_file_offset_have_reset_values): New method
4908 definition.
4909 (Output_data::do_address_and_file_offset_have_reset_values): New method
4910 definition.
4911 (Output_data::set_data_size): Check that data size is not fixed.
4912 (Output_data::fix_data_size): New method definition.
4913 (Output_data::is_data_size_fixed_): New data member.
4914 (Output_section_headers::set_final_data_size): New method definition.
4915 (Output_section_headers::do_size): New method declaration.
4916 (Output_segment_headers::set_final_data_size): New method definition.
4917 (Output_segment_headers::do_size): New method declaration.
4918 (Output_file_header::set_final_data_size)::New method definition.
4919 (Output_file_header::do_size)::New method declaration.
4920 (Output_section_data::Output_section_data): Add new parameter
4921 is_data_size_fixed and use it to fix data size.
4922 (Output_data_const::Output_data_const): Adjust call to base class
4923 constructor and fix data size.
4924 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
4925 base class constructor and fix data size.
4926 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
4927 base class constructor and fix data size.
4928 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
4929 class constructor and fix data size.
4930 (Output_data_group::set_final_data_size): New method definition.
4931 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
4932 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
4933 class constructor and fix data size.
4934 (Output_relaxed_input_section): New class definition.
4935 (Output_section::Simple_input_section): New class definition.
4936 (Output_section::get_input_sections): Adjust parameter list.
4937 (Output_section::add_input_section_for_script): Same.
4938 (Output_section::save_states, Output_section::restore_states,
4939 Output_section::do_address_and_file_offset_have_reset_values,
4940 (Output_section::Input_section::Input_section): Handle
4941 RELAXED_INPUT_SECTION_CODE. Add new overload for
4942 Output_relaxed_input_section.
4943 (Output_section::Input_section::is_input_section,
4944 Output_section::Input_section::set_output_section): Handle relaxed
4945 input section.
4946 (Output_section::Input_section::is_relaxed_input_section,
4947 Output_section::Input_section::output_section_data,
4948 Output_section::Input_section::relaxed_input_section): New method
4949 definitions.
4950 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
4951 value.
4952 (Output_section::Input_section::u1_): Update comments.
4953 (Output_section::Input_section::u2_): Add new union member poris.
4954 (Output_section::Checkpoint_output_section): New classs definition.
4955 (Output_section::relax_input_section): New method declaration.
4956 (Output_section::checkpoint_): New data member.
4957 (Output_segment): Update comments.
4958 (Output_segment::Output_segment): Un-privatize copy constructor.
4959 (Output_segment::operator=): Un-privatize.
4960 * script-sections.cc (Output_section_element::Input_section_list):
4961 Change element type to Output_section::Simple_input_section.
4962 (Output_section_element_dot_assignment::set_section_addresses):
4963 Register output section data for relaxation clean up.
4964 (Output_data_exression::Output_data_expression): Adjust call to base
4965 constructor to fix data size.
4966 (Output_section_element_data::set_section_addresses): Register
4967 Output_data_expression object for relaxation clean up.
4968 (struct Input_section_info): Replace Relobj pointer and section index
4969 pair with Output_section::Simple_input_section and Convert struct to a
4970 class.
4971 (Input_section_sorter::operator()): Adjust access to
e1df38aa 4972 Input_section_info data member to use accessors.
20e6d0d6
DK
4973 (Output_section_element_input::set_section_addresses): Use layout
4974 parameter. Adjust code to use Output_section::Simple_input_section
4975 and Input_secction_info classes. Register filler for relaxation
4976 clean up.
4977 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
4978 and section index pair with Output_section::Simple_input_section
4979 class. Adjust code accordingly.
4980 (Phdrs_element::release_segment): New method definition.
4981 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
4982 segment list.
4983 (Script_sections::release_segments): New method definition.
4984 * gold/script-sections.h (Script_sections::release_segments): New
4985 method declaration.
4986 * gold/target.h (Target::may_relax, Target::relax,
4987 Target::do_may_relax, Target::do_relax): New method definitions.
4988
5e445df6
ILT
49892009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4990
4991 * arm.cc (has_signed_unsigned_overflow): New function.
4992 (Arm_relocate_functions::abs8): New function.
4993 (Target_arm::Scan::local): Handle R_ARM_ABS8.
4994 (Target_arm::Scan::global): Likewise.
4995 (Target_arm::relocate::relocate): Likewise.
4996 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4997 Likewise.
4998
8c604651 49992009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
5000
5001 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
5002 * testsuite/Makefile.in: Regenerate.
5003
1e9cc1c2
NC
50042009-09-11 Nick Clifton <nickc@redhat.com>
5005
5006 * po/gold.pot: Updated by the Translation project.
5007
6a89f575
CC
50082009-09-08 Cary Coutant <ccoutant@google.com>
5009
5010 * output.cc (Output_file::open): Add execute permission to empty file.
5011 * testsuite/Makefile.am (permission_test): New test.
5012 * testsuite/Makefile.in: Regenerate.
5013
fdcac5af
ILT
50142009-09-02 Ian Lance Taylor <iant@google.com>
5015
5016 * output.cc (Output_file::resize): Call map_no_anonymous rather
5017 than map.
5018
44453f85
ILT
50192009-09-01 Mikolaj Zalewski <mikolajz@google.com>
5020
5021 * gold.cc: Include "incremental.h".
5022 (queue_initial_tasks): Call Incremental_checker methods.
5023 * incremental.cc: Include "output.h".
5024 (Incremental_checker::can_incrementally_link_output_file): New
5025 method.
5026 * incremental.h (Incremental_checker): New class.
5027
5028 * output.cc (Output_file::open_for_modification): New method.
5029 (Output_file::map_anonymous): Changed return type to bool. Record
5030 map in base_ field.
5031 (Output_file::map_no_anonymous): New method, broken out of map.
5032 (Output_file::map): Use map_no_anonymous and map_anonymous.
5033 * output.h (class Output_file): Update declarations.
5034
293c1386
CC
50352009-08-24 Cary Coutant <ccoutant@google.com>
5036
5037 * options.h (Command_line::Pre_options): New class.
5038 (Command_line::pre_options): New member.
5039 * options.cc (gold::options::ready_to_register): New variable.
5040 (One_option::register_option): Do nothing if not registering options.
5041 Assert if same short option registered twice.
5042 (General_options::General_options): Turn off option registration when
5043 done constructing.
5044 (Command_line::Pre_options::Pre_options): New constructor.
5045
f773f3d2
CC
50462009-08-24 Cary Coutant <ccoutant@google.com>
5047
06a73cfe
CC
5048 * options.h (General_options::no_keep_memory): Remove incorrect
5049 short option.
f773f3d2 5050
a15af8e2
RW
50512009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5052
5053 * Makefile.am (am__skiplex, am__skipyacc): New.
5054 * Makefile.in: Regenerate.
5055
c462b41b
RW
50562009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5057
14ec8efd
RW
5058 * Makefile.am (AM_CPPFLAGS): Renamed from ...
5059 (INCLUDES): ... this.
5060 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
5061 (AM_CPPFLAGS): Renamed from ...
5062 (INCLUDE): ... this.
5063 * Makefile.in, testsuite/Makefile.in: Regenerate.
5064
81ecdfbb
RW
5065 * Makefile.in: Regenerate.
5066 * aclocal.m4: Likewise.
5067 * config.in: Likewise.
5068 * configure: Likewise.
5069 * testsuite/Makefile.in: Likewise.
5070
c462b41b
RW
5071 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
5072 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
5073 * Makefile.in: Regenerate.
5074 * testsuite/Makefile.in: Regenerate.
5075
2da73f13
CC
50762009-08-19 Cary Coutant <ccoutant@google.com>
5077
5078 * resolve.cc (Symbol_table::resolve): Don't complain about defined
5079 symbols in shared libraries overridden by hidden or internal symbols
5080 in the main program.
5081
2db70501
CD
50822009-08-19 Chris Demetriou <cgd@google.com>
5083
5084 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
5085 checking source file names in error messages.
5086
f733487b
DK
50872009-08-18 Doug Kwan <dougkwan@google.com>
5088
5089 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
5090 an elcpp::Ehdr as parameter. Adjust call to set_target.
5091 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
5092 an elfcpp::Ehdr as parameter.
5093 * object.cc (Object::set_target): Remove the version that looks up
5094 a target and sets it.
5095 (Sized_relobj::setup): Take a Target object instead of
5096 an elfcpp::Ehdr as parameter. Adjust call to set_target.
5097 (make_elf_sized_object): Find target and ask target to
5098 make an ELF object.
5099 * object.h: (Object::set_target): Remove the version that looks up
5100 a target and sets it.
5101 (Sized_relobj::setup): Take a Target object instead of
5102 an elfcpp:Ehdr as parameter.
5103 * target.cc: Include dynobj.h.
5104 (Target::do_make_elf_object_implementation): New.
5105 (Target::do_make_elf_object): New.
5106 * target.h (Target::make_elf_object): New template declaration.
5107 (Target::do_make_elf_object): New method declarations.
5108 (Target::do_make_elf_object_implementation): New template declaration.
5109
cc70f101
ILT
51102009-08-14 Ian Lance Taylor <iant@google.com>
5111
5112 * gold.h (FUNCTION_NAME): Define.
5113 (gold_unreachable): Use FUNCTION_NAME.
5114
ef5e0cb1
ST
51152009-08-12 Sriraman Tallam <tmsriram@google.com>
5116
5117 * icf.cc (Icf::find_identical_sections): Issue a warning when a
5118 symbol in the --keep-unique list is not found.
5119
48c187ce
ST
51202009-08-12 Sriraman Tallam <tmsriram@google.com>
5121
5122 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
5123 been maked as --keep-unique.
5124 (Icf::unfold_section): New function.
5125 * icf.h (Icf::unfold_section): New function.
5126 * options.h (General_options::keep_unique): New option.
5127 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
5128 * testsuite/Makefile.in: Regenerate.
5129 * testsuite/icf_keep_unique_test.sh: New file.
5130 * testsuite/icf_keep_unique_test.cc: New file.
5131
645afe0c
CC
51322009-08-12 Cary Coutant <ccoutant@google.com>
5133
5134 PR 10471
5135 * resolve.cc (Symbol_table::resolve): Check for references from
5136 dynamic objects to hidden and internal symbols.
5137 * testsuite/Makefile.am (hidden_test.sh): New test.
5138 * testsuite/Makefile.in: Regenerate.
5139 * testsuite/hidden_test.sh: New script.
5140 * testsuite/hidden_test_1.c: New test source.
5141 * testsuite/hidden_test_main.c: New test source.
5142
11af873f
DK
51432009-08-11 Doug Kwan <dougkwan@google.com>
5144
5145 * arm.cc: Update comments.
5146 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
5147 segment to locate the .ARM.exidx section if present.
5148
b9f7d72d
DK
51492009-08-09 Doug Kwan <dougkwan@google.com>
5150
5151 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
5152 patch.
5153
ddd3c53c
ST
51542009-08-07 Sriraman Tallam <tmsriram@google.com>
5155 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
5156 compiler warnings.
5157
27721062
ST
51582009-08-06 Sriraman Tallam <tmsriram@google.com>
5159
5160 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
5161 valid tls_segment only for non-debug-section relocations.
5162 * testsuite/Makefile.am: Add gc_tls_test.
5163 * testsuite/Makefile.in: Regenerate.
5164 * testsuite/gc_tls_test.cc: New file.
5165 * testsuite/gc_tls_test.sh: New file.
5166
ef15dade 51672009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 5168
ef15dade
ST
5169 * icf.cc: New file.
5170 * icf.h: New file.
5171 * Makefile.am (CCFILES): Add icf.cc.
5172 (HFILES): Add icf.h
5173 * Makefile.in: Regenerate.
5174 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
5175 * gc.h (gc_process_relocs): Populate lists used by icf to contain
5176 section, symbol and addend information for the relocs.
5177 * gold.cc (queue_middle_tasks): Call identical code folding.
5178 * gold.h: Add defines for multimap.
5179 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
5180 to the call of finalize_local_symbols.
5181 * main.cc (main): Create object of class Icf.
5182 * object.cc (Sized_relobj::do_layout): Allow this function to be
5183 called twice during icf.
5184 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
5185 to sections marked as identical by icf.
5186 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
5187 when available.
5188 (Sized_relobj::do_section_entsize): New function.
5189 * object.h (Object::section_entsize): New function.
5190 (Object::do_section_entsize): New pure virtual function.
5191 (Relobj::finalize_local_symbols): Add new parameter.
5192 (Relobj::do_section_entsize): New function.
5193 * options.h (General_options::icf): New option.
5194 (General_options::icf_iterations): New option.
5195 (General_options::print_icf_sections): New option.
5196 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
5197 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
5198 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
5199 icf.
5200 * symtab.cc (Symbol_table::is_section_folded): New function.
5201 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
5202 to sections marked as identical by icf.
5203 * symtab.h (Symbol_table::set_icf): New function.
5204 (Symbol_table::icf): New function.
5205 (Symbol_table::is_section_folded): New function.
5206 (Symbol_table::icf_): New data member.
5207 * target-reloc.h (relocate_section): Ignore sections folded by icf.
5208 * testsuite/Makefile.am: Add commands to build icf_test.
5209 * testsuite/Makefile.in: Regenerate.
5210 * testsuite/icf_test.sh: New file.
5211 * testsuite/icf_test.cc: New file.
5212
c3b65ac4
CD
52132009-07-24 Chris Demetriou <cgd@google.com>
5214
5215 * layout.cc (is_compressible_debug_section): Fix incorrect
5216 comment about compressed section names.
5217
1caf2c51
ILT
52182009-07-20 Ian Lance Taylor <ian@airs.com>
5219
5220 PR 10419
5221 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
5222
1ef4d87f
ILT
52232009-07-16 Ian Lance Taylor <iant@google.com>
5224
5225 PR 10400
5226 * layout.h: #include <map>.
5227 (class Kept_section): Change from struct to class. Add accessors
5228 and setters. Add section size to Comdat_group mapping. Change
5229 Comdat_group to std::map. Add is_comdat_ field. Add
5230 linkonce_size field in union.
5231 (class Layout): Update declaration of find_or_add_kept_section.
5232 Don't declare find_kept_object.
5233 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
5234 parameter. Add object, shndx, is_comdat, and is_group_name
5235 parameters. Change all callers. Adjust for new Kept_section.
5236 (Layout::find_kept_object): Remove.
5237 * object.cc (Sized_relobj::include_section_group): Update use of
5238 Kept_section. Rename secnum to shndx. Only record
5239 Kept_comdat_section if sections are the same size.
5240 (Sized_relobj::include_linkonce_section): Update use of
5241 Kept_section. Only record Kept_comdat_section if sections are the
5242 same size. Set size of linkonce section.
5243 (Sized_relobj::map_to_kept_section): Update call to
5244 get_kept_comdat_section.
5245 * object.h (class Sized_relobj): Rename fields in
5246 Kept_comdat_section to drop trailing underscores; change object
5247 field to Relobj*. Change Kept_comdat_section_table to store
5248 struct rather than pointer.
5249 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
5250 Add kept_object and kept_shndx parameters. Change all callers.
5251 (Sized_relobj::get_kept_comdat_section): Change return type to
5252 bool. Add kept_object and kept_shndx parameters. Change all
5253 callers.
5254 * plugin.cc (Pluginobj::include_comdat_group): Update call to
5255 Layout::find_or_add_kept_section.
5256
37c3b7b0
ILT
52572009-07-09 Ian Lance Taylor <iant@google.com>
5258
5259 * merge.cc (Object_merge_map::initialize_input_to_output_map):
5260 Reserve space in the hash table.
5261
98fa85cb
ILT
52622009-07-06 Mikolaj Zalewski <mikolajz@google.com>
5263
5264 * fileread.cc (File_read::get_mtime): New method.
5265 * fileread.h (Timespec): New structure.
5266 (File_read::get_mtime): New method.
5267 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
5268 Renamed from timestamp_nsec.
5269 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
5270 Elf_Xword.
e1df38aa 5271 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 5272 timestamp_nsec.
e1df38aa 5273 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
5274 (Incremental_inputs::report_obejct): Save mtime; style fix.
5275 (Incremental_inputs::report_script): Save mtime; style fix.
5276 (Incremental_inputs::finalize_inputs): Style fix.
5277 (Incremental_inputs::finalize): Style fix.
5278 (Incremental_inputs::create_input_section_data): Store inputs
5279 mtime.
5280 * incremental.h (Incremental_inputs::report_script): Add mtime
5281 argument.
5282 (Incremental_inputs::Input_info::Input_info): Intialize only one
5283 union member.
5284 (Incremental_inputs::Input_info::archive): Move to nameless
5285 union.
5286 (Incremental_inputs::Input_info::obejct): Move to nameless union.
5287 (Incremental_inputs::Input_info::script): Move to nameless union.
5288 (Incremental_inputs::mtime): New field.
5289 * script.cc (read_input_script): Pass file mtime to
5290 Incremental_input.
5291 * script.h (Script_info::inputs): Style fix.
5292
c9d70757
ILT
52932009-07-01 Ian Lance Taylor <ian@airs.com>
5294
5295 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
5296 instead of 32.
5297
9c547ec3
ILT
52982009-06-24 Ian Lance Taylor <iant@google.com>
5299
5300 PR 10156
5301 * layout.cc (Layout::choose_output_section): If we find an
5302 existing section, update the flags.
5303 (Layout::create_notes): New function, broken out of
5304 Layout::finalize.
5305 (Layout::finalize): Don't create note sections.
5306 (Layout::create_note): Don't crash if linker script discards
5307 section.
5308 (Layout::create_gold_note): Likewise.
5309 (Layout::create_build_id): Likewise. Don't set
5310 after_input_sections on the section.
5311 (Layout::create_executable_stack_info): Remove target parameter.
5312 Change caller.
5313 * layout.h (class Layout): Declare create_notes. Update
5314 declaration of create_executable_stack_info.
5315 * gold.cc (queue_middle_tasks): Call create_notes.
5316 * output.cc (Output_section::update_flags_for_input_section): Move
5317 here from output.h. If SHF_ALLOC flag is newly set, mark address
5318 invalid.
5319 * output.h (Output_data::mark_address_invalid): New function.
5320 (class Output_section): Only declare, not define,
5321 update_flags_for_input_section. Remove set_flags.
5322
55458500
ILT
53232009-06-24 Ian Lance Taylor <iant@google.com>
5324
5325 * script-sections.cc (Output_section_definition::
5326 set_section_addresses): Rename shadowing local load_address to
5327 laddr.
5328
1307d6cd
ILT
53292009-06-24 Ian Lance Taylor <iant@google.com>
5330
5331 PR 10244
5332 * reloc.cc (relocate_sections): Skip empty relocation sections.
5333
ec3f783e
ILT
53342009-06-23 Ian Lance Taylor <iant@google.com>
5335
5336 PR 10156
5337 * layout.cc (Layout::create_note): Use choose_output_section
5338 rather than make_output_section.
5339
459c9f1c
ILT
53402009-06-23 Ian Lance Taylor <iant@google.com>
5341
5342 PR 10237
5343 * options.cc (General_options::parse_V): Set printed_version_.
5344 (General_options::General_options): Initialize printed_version_.
5345 * options.h (class General_options): Add printed_version_ field.
5346 * gold.cc (queue_initial_tasks): If there are no input files,
5347 don't give a fatal error if we printed the version information.
5348 (queue_middle_tasks): If using -r with a shared object, give a
5349 fatal error rather than an ordinary error.
5350
1518dc8f
ILT
53512009-06-23 Ian Lance Taylor <iant@google.com>
5352
5353 PR 10219
5354 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
5355 (Layout::make_output_section): Set have_stabstr_section_ if we see
5356 a .stab*str section.
5357 (Layout::finalize): Call link_stabs_sections.
5358 (Layout::link_stabs_sections): New file.
5359 * layout.h (class Layout): Add have_stabstr_section_ field.
5360 Declare link_stabs_sections.
5361
3d857b98
DK
53622009-06-23 Doug Kwan <dougkwan@google.com>
5363
5364 * Makefile.am (libgold_a_LIBADD): New.
5365 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
5366 * Makefile.in: Regenerate.
5367 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
5368 * configure: Regenerate.
5369 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
5370 * fileread.cc: Include sys/state.h
5371 * gold.h: Declare memmem and strndup if found missing.
5372 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
5373
0639a6f6
ILT
53742009-06-23 Ian Lance Taylor <iant@google.com>
5375
5376 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
5377 * configure: Rebuild.
5378
8d63875c
ILT
53792009-06-23 Ian Lance Taylor <iant@google.com>
5380
5381 PR 10147
5382 * object.cc (Object::section_contents): Don't try to get a view if
5383 the section has length zero.
5384 (Object::handle_gnu_warning_section): If the section is empty, use
5385 the name of the section as the warning.
5386
f7c8a183
ILT
53872009-06-23 Ian Lance Taylor <iant@google.com>
5388
5389 PR 10133
5390 * stringpool.h (class Stringpool_template): Add optimize_ field.
5391 (Stringpool_template::set_optimize): New function.
5392 * stringpool.cc (Stringpool_template::Stringpool_template):
5393 Initialize optimize_ field.
5394 (Stringpool_template::set_string_offsets): Test local optimize
5395 fild rather than parameter.
5396 * layout.cc (Layout::Layout): Call set_optimize on the section
5397 name stringpool.
5398
e6a307ba
ILT
53992009-06-22 Ian Lance Taylor <iant@google.com>
5400
5401 PR 10030
5402 * yyscript.y: Parse TARGET.
5403 * script.cc (script_set_target): New function.
5404 * script-c.h (script_set_target): Declare.
5405 * options.cc (General_options::string_to_object_format): Rename
5406 from string_to_object_format in anonymous namespace. Change
5407 callers.
5408 * options.h (class General_options): Declare
5409 string_to_object_format.
5410
3ee173de
ILT
54112009-06-22 Ian Lance Taylor <iant@google.com>
5412
5413 * script-sections.cc (Script_sections::create_segments): Don't put
5414 program headers in a PT_LOAD segment if -n or -N.
5415
54162009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
5417
5418 PR 10141
5419 * options.h (class General_options): Add -z lazy and -z now. Sort
5420 -z options into alphabetical order.
5421 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
5422
cd6739a1 54232009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
5424
5425 * layout.cc (Layout::make_output_section): Call
5426 Target::new_output_section.
5427 (Layout::attach_allocated_section_to_segment): Put large section
5428 sections in a separate load segment with the large segment flag
5429 set.
5430 (Layout::segment_precedes): Sort large data segments after other
5431 load segments.
5432 (align_file_offset): New static function.
5433 (Layout::set_segment_offsets): Use align_file_offset.
5434 * output.h (class Output_section): Add is_small_section_ and
5435 is_large_section_ fields.
5436 (Output_section::is_small_section): New function.
5437 (Output_section::set_is_small_section): New function.
5438 (Output_section::is_large_section): New function.
5439 (Output_section::set_is_large_section): New function.
5440 (Output_section::is_large_data_section): New function.
5441 (class Output_segment): Add is_large_data_segment_ field.
5442 (Output_segment::is_large_data_segment): New function.
5443 (Output_segment::set_is_large_data_segment): New function.
5444 * output.cc (Output_section::Output_section): Initialize new
5445 fields.
5446 (Output_segment::Output_segment): Likewise.
5447 (Output_segment::add_output_section): Add assertion that large
5448 data sections always go in large data segments. Force small data
5449 sections to the end of the list of data sections. Force small BSS
5450 sections to the start of the list of BSS sections. For large BSS
5451 sections to the end of the list of BSS sections.
5452 * symtab.h (class Symbol): Declare is_common_shndx.
5453 (Symbol::is_defined): Check Symbol::is_common_shndx.
5454 (Symbol::is_common): Likewise.
5455 (class Symbol_table): Define enum Commons_section_type. Update
5456 declarations. Add small_commons_ and large_commons_ fields.
5457 * symtab.cc (Symbol::is_common_shndx): New function.
5458 (Symbol_table::Symbol_table): Initialize new fields.
5459 (Symbol_table::add_from_object): Put small and large common
5460 symbols in the right list.
5461 (Symbol_table::sized_finalized_symbol): Check
5462 Symbol::is_common_shndx.
5463 (Symbol_table::sized_write_globals): Likewise.
5464 * common.cc (Symbol_table::do_allocate_commons): Allocate new
5465 common symbol lists. Don't call do_allocate_commons_list if the
5466 list is empty.
5467 (Symbol_table::do_allocate_commons_list): Remove is_tls
5468 parameter. Add comons_section_type parameter. Change all
5469 callers. Handle small and large common symbols.
5470 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
5471 Symbol::is_common_shndx.
5472 * resolve.cc (symbol_to_bits): Likewise.
5473 * target.h (Target::small_common_shndx): New function.
5474 (Target::small_common_section_flags): New function.
5475 (Target::large_common_shndx): New function.
5476 (Target::large_common_section_flags): New function.
5477 (Target::new_output_section): New function.
5478 (Target::Target_info): Add small_common_shndx, large_common_shndx,
5479 small_common_section_flags, and large_common_section_flags
5480 fields.
5481 (Target::do_new_output_section): New virtual function.
5482 * arm.cc (Target_arm::arm_info): Initialize new fields.
5483 * i386.cc (Target_i386::i386_info): Likewise.
5484 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5485 Likewise.
5486 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
5487 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
5488 (Target_x86_64::do_new_output_section): New function.
5489 * configure.ac: Define conditional MCMODEL_MEDIUM.
5490 * testsuite/Makefile.am (check_PROGRAMS): Add large.
5491 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
5492 (large_LDFLAGS): Define.
5493 * testsuite/large.c: New file.
5494 * testsuite/testfile.cc (Target_test::test_target_info):
5495 Initialize new fields.
5496 * configure, testsuite/Makefile.in: Rebuild.
5497
bb04269c
DK
54982009-06-05 Doug Kwan <dougkwan@google.com>
5499
5500 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 5501 * Makefile.in: Regenerate.
bb04269c
DK
5502 * i386.cc (class Target_i386): Define new virtual method to
5503 override do_is_local_label_name in parent.
5504 * object.cc (Sized_relobj::do_count_local_symbols): Discard
5505 local symbols if --discard-locals or -X is given.
5506 * options.h (class General_options): Declare new options
5507 '--discard-locals' and '-X' for discarding locals.
5508 * target.h (class Target): Define new methods is_local_label_name.
5509 Declare new virtual method do_is_local_label_name.
5510 * target.cc: New file.
5511 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
5512 (check_SCRIPTS): Add discard_locals_test.sh.
5513 (check_DATA): Add discard_local_tests.syms.
5514 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
5515 (discard_local_tests.syms, discard_locals_test.o): New make rules.
5516 * testsuite/Makefile.in: Regenerate.
5517 * testsuite/discard_locals_test.c: New file.
5518 * testsuite/discard_locals_test.sh: Same.
5519
805bb01c
DK
55202009-06-05 Doug Kwan <dougkwan@google.com>
5521
5522 * object.cc (Sized_relobj::Sized_relobj): Initialize
5523 discarded_eh_frame_shndx_ to -1U.
5524 (Sized_relobj::do_layout): Record index of a discard .eh_frame
5525 section.
5526 (Sized_relobj::do_count_local_symbols): Skip local symbols in
5527 a discarded .eh_frame section.
5528 (Sized_relobj::do_finalize_local_symbols): Ditto.
5529 * object.h (class Sized_relobj): Declare new member
5530 discarded_eh_frame_shndx_.
5531 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
5532 (local_labels_test.o, local_labels_test): New rules.
5533 * testsuite/Makefile.in: Regenerate.
5534
1dcd334d
DK
55352009-06-04 Doug Kwan <dougkwan@google.com>
5536
5537 * layout.cc (Layout::section_name_mapping): Add mapping for
5538 special ARM sections.
5539
96d49306
DK
55402009-06-03 Doug Kwan <dougkwan@google.com>
5541
5542 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
5543 (utils::has_overflow): Same.
5544
dff16297
ILT
55452009-06-03 Ian Lance Taylor <iant@google.com>
5546
5547 * layout.cc (Layout::section_name_mapping): New array, replacing
5548 Layout::linkonce_mapping.
5549 (Layout::section_name_mapping_count): New variable, replacing
5550 Layout::linkonce_mapping_count.
5551 (Layout::linkonce_output_name): Remove.
5552 (Layout::output_section_name): Rewrite.
5553 * layout.h (class Layout): Rename Linkonce_mapping to
5554 Section_name_mapping, linkonce_mapping to section_name_mapping,
5555 linkonce_mapping_count to section_name_mapping_count. Don't
5556 declare linkonce_output_name.
5557
c121c671
DK
55582009-06-03 Doug Kwan <dougkwan@google.com>
5559
5560 * gold/arm.cc (namespace utils): New.
5561 (Target_arm::reloc_is_non_pic): Define new method.
5562 (class Arm_relocate_functions): New.
5563 (Target_arm::Relocate::relocate): Handle relocation types used by
5564 Android.
5565
07800fab
ILT
55662009-06-03 Ian Lance Taylor <iant@google.com>
5567
5568 * arm.cc (Target_arm::scan::global): Use || instead of |.
5569
c121c671
DK
55702009-06-02 Doug Kwan <dougkwan@google.com>
5571
5572 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
5573 issued_non_pic_error_.
5574 (class Target_arm::Scan): Declare new method check_non_pic.
5575 Define new method symbol_needs_plt_entry.
5576 Declare new data member issued_non_pic_error_.
5577 (class Target_arm::Relocate): Declare new method
5578 should_apply_static_reloc.
5579 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
5580 (Target_arm::Scan::check_non_pic): Define new method.
5581 (Target_arm::Scan::local): Handle a small subset of reloc types used
5582 by Android.
5583 (Target_arm::Scan::local): Same.
5584 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
5585
b19b0c6d
ILT
55862009-05-31 Mikolaj Zalewski <mikolajz@google.com>
5587
5588 * incremental.cc (Incremental_inputs::report_command_line): Filter
5589 out --incremental-* options.
5590
94cdfcff
DK
55912009-05-29 Doug Kwan <dougkwan@google.com>
5592
5593 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
5594 template class.
5595 (class Target_arm): Update comment.
5596 (Target_arm::Target_arm): Initialize new data members GOT_,
5597 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
5598 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
5599 and Target_arm::rel_dyn_section.
5600 Declare new_enum Target_arm::Got_type.
5601 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
5602 and DYNBSS_.
5603 Update commments for member do_dynsym_value.
5604 (Target_arm::got_size, Target_arm::plt_section,
5605 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
5606 new methods inside class defintion.
5607 (Target_arm::got_section): Define new method.
5608 (Target_arm::rel_dyn_section): Same.
5609 (Output_data_plt_arm): New template class.
5610 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
5611 (Output_data_plt_arm:do_adjust_output_section): Define new method.
5612 (Output_data_plt_arm::add_entry): Same.
5613 (Output_data_plt_arm::first_plt_entry): Define new
5614 static data member for PLT instruction template.
5615 (Output_data_plt_arm::plt_entry): Same.
5616 (Output_data_plt_arm::do_write): Define new method.
5617 (Target_arm::make_plt_entry): Same.
5618 (Target_arm::do_finalize_sections): Same.
5619 (Target_arm::do_dynsym_value): Same.
5620
4a657b0d
DK
56212009-05-28 Doug Kwan <dougkwan@google.com>
5622
5623 * Makefile.am (TARGETSOURCES): Add arm.cc.
5624 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
5625 * Makefile.in: Regenerate.
5626 * arm.cc: New file.
5627 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
5628
e7ae8c36
DK
56292009-05-26 Doug Kwan <dougkwan@google.com>
5630
5631 * options.cc (General_options::parse_exclude_libs). Fix a comment.
5632 (General_options::check_excluded_libs): Strip off directories in
5633 archive name before matching like GNU ld does.
5634 * testsuite/Makefile.am (MOSTLYCLEANFILES,
5635 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
5636 (exclude_libs_test_LDFLAGS): Add linker option
5637 -Wl,--exclude-libs,libexclude_libs_test_3
5638 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
5639 an explicit archive without using -l.
5640 (alt/libexclude_libs_test_3.a): New make rule.
5641 * testsuite/Makefile.in: Regenerate.
5642 * testsuite/exclude_libs_test.c : Declare lib3_default().
5643 (main): Call it.
5644 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
5645 * exclude_libs_test_3.c: New file.
5646
f12e7348
NC
56472009-05-26 Nick Clifton <nickc@redhat.com>
5648
5649 * po/id.po: New Indonesian translation.
5650 * po/gold.pot: Updated template file.
5651
4daadc0d
ST
56522009-05-22 Sriraman Tallam <tmsriram@google.com>
5653
e1df38aa 5654 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
5655 gc_comdat_test files. Add -Wl,--gc-sections to build
5656 gc_comdat_test.
5657 * testsuite/Makefile.in: Regenerate.
5658 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
5659
531813ad
ST
56602009-05-21 Sriraman Tallam <tmsriram@google.com>
5661
5662 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
5663 kept comdat section was garbage collected.
5664 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
5665 * testsuite/Makefile.in: Regenerate.
5666 * testsuite/gc_comdat_test.sh: New file.
5667 * testsuite/gc_comdat_test_1.cc: New file.
5668 * testsuite/gc_comdat_test_2.cc: New file.
5669
65514900
CC
56702009-05-19 Doug Kwan <dougkwan@google.com>
5671
5672 * archive.cc (Archive::Archive): Move constructor from archive.h
5673 to here. Initialize no_export_.
5674 (Archive::get_elf_object_for_member): Set no_export flag of object.
5675 * archive.h (Archive::Archive): Move constructor body to
5676 archive.cc.
5677 (Archive::no_export): New method.
5678 (Archive::no_export_): New field.
5679 * object.h (Object::Object): Initialize no_export_ to false.
5680 (Object::no_export, Object::set_no_export): New methods.
5681 (Object::no_export_): New field.
5682 * options.cc (General_options::parse_exclude_libs): New method.
5683 (General_options::check_excluded_libs) Same.
5684 * options.h (exclude_libs): New option.
5685 (General_options::check_excluded_libs): New method declaration.
5686 (General_options::excluded_libs_): New field.
5687 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
5688 default or protected visibility if an object has no-export flag set.
5689 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
5690 (check_SCRIPTS): Add exclude_libs_test.sh.
5691 (check_DATA): Add exclude_libs_test.syms.
5692 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
5693 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
5694 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
5695 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
5696 (exclude_libs_test.syms, libexclude_libs_test_1.a,
5697 libexclude_libs_test_2.a): New rules.
5698 * testsuite/Makefile.in: Regenerate.
5699 * testsuite/exclude_libs_test.c: New file.
5700 * testsuite/exclude_libs_test.sh: Ditto.
5701 * testsuite/exclude_libs_test_1.c: Ditto.
5702 * testsuite/exclude_libs_test_2.c: Ditto.
5703
1b77ea50
ILT
57042009-05-15 Ian Lance Taylor <iant@google.com>
5705
5706 * configure.ac: Check for declarations for cases where libiberty.h
5707 checks HAVE_DECL_xxx.
5708 * configure, config.in: Rebuild.
5709
072fe7ce
ILT
57102009-05-15 Mikolaj Zalewski <mikolajz@google.com>
5711
5712 * gold.h (Incremental_argument_list): Remove (invalid) forward
5713 declaration.
5714 * incremental.cc (Incremental_inputs::report_achive): New method.
5715 (Incremental_inputs::report_object): New method.
5716 (Incremental_inputs::report_script): New method.
5717 (Incremental_inputs::finalize_inputs): New method.
5718 (Incremental_inputs::finalize): Call finalize_inputs().
5719 (Incremental_inputs::sized_create_incremental_inputs_section_data):
5720 Create inputs entries.
5721 * incremental.h (Incremental_input_type): New enum.
5722 (Incremental_inputs::Incremental_input): Initialize new fields.
5723 (Incremental_inputs::report_inputs): New method.
5724 (Incremental_inputs::report_achive): New method.
5725 (Incremental_inputs::report_object): New method.
5726 (Incremental_inputs::report_script): New method.
5727 (Incremental_inputs::finalize_inputs): New method.
5728 (Incremental_inputs::Input_info): New struct.
5729 (Incremental_inputs::Input_info_map): New typedef.
5730 (Incremental_inputs::lock_): New field.
5731 (Incremental_inputs::Inputs_): New field.
5732 (Incremental_inputs::Inputs_map): New field.
5733 * main.cc (main): Call Incremental_input::report_inputs.
5734 * options.h (Input_argument_list): Typedef moved from
5735 Input_arguments.
5736 (Input_file_group::Files): Remove, use ::Input_argument_list.
5737 (Input_file_group::Input_argument_list): Remove, use
5738 ::Input_argument_list.
5739 * plugin.cc (Plugin_manager::add_input_file): Add error in
5740 incremental build.
5741 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
5742 functions.
5743 * script.cc (read_input_script): Call
5744 Incremental_input::report_script.
5745 * script.h (Script_info): New class.
5746
b0481b0b
ILT
57472009-04-27 Ian Lance Taylor <iant@google.com>
5748
5749 * x86_64.cc (do_adjust_output_section): Set entsize to
5750 plt_entry_size.
5751
b22a5a41 57522009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
5753
5754 * output.cc (Output_file::close): After short writes, continue
5755 writing from the correct offset in the buffer being written.
5756
40fde488
CD
57572009-04-23 Chris Demetriou <cgd@google.com>
5758
5759 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
5760 * configure: Regenerate.
5761 * config.in: Regenerate.
5762 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
5763 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
5764
3ce2c28e
ILT
57652009-04-21 Mikolaj Zalewski <mikolajz@google.com>
5766
5767 * incremental.cc (Incremental_inputs_header_data): Renamed from
5768 Incremental_input_header_data.
5769 (Incremental_inputs_header_data::data_size): New field.
5770 (Incremental_inputs_header_data::put_input_file_count): Renamed
5771 from input_file_count.
5772 (Incremental_inputs_header_data::put_command_line_offset): Renamed
5773 from command_line_offset.
5774 (Incremental_inputs_header_data::put_reserved): Renamed from
5775 put_reserved.
5776 (Incremental_inputs_entry_data): Renamed from
5777 Incremental_input_entry_data.
5778 (Incremental_inputs_entry_data::data_size): New field.
5779 (Incremental_inputs::report_command_line): New method.
5780 (Incremental_inputs::finalize): New method.
5781 (Incremental_inputs::create_incremental_inputs_data): New method.
5782 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
5783 * incremental.h: New file.
5784 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
5785 (Layout::finalize): Create incremental inputs section in
5786 incremental builds.
5787 (Layout::create_incremental_info_sections): New method.
5788 * layout.h (Layout::incremental_inputs): New method.
5789 (Layout::create_incremental_info_sections): New method.
5790 (Layout::incremental_inputs_): New field.
5791 * main.cc (main): Notify Incremental_input of the command line.
5792
e55bde5e
ILT
57932009-04-01 Ian Lance Taylor <iant@google.com>
5794 Mikolaj Zalewski <mikolajz@google.com>
5795
5796 * gold.h (reserve_unordered_map): Define, three versions, one for
5797 each version of Unordered_map.
5798 * layout.cc (Layout::Layout): Remove options parameter. Add
5799 number_of_input_files parameter. Don't initialize options_.
5800 Initialize number_of_input_files_ and resized_signatures_. Move
5801 sections_are_attached_.
5802 (Layout::layout_group): Reserve space for group_signatures_.
5803 (Layout::find_or_add_kept_section): Change name parameter to be a
5804 reference. Resize signatures_ map when it gets large enough.
5805 (Layout::layout_eh_frame): Use parameters->options() instead of
5806 this->options_.
5807 (Layout::make_output_section): Likewise.
5808 (Layout::attach_allocated_section_to_segment): Likewise.
5809 (Layout::finalize, Layout::create_executable_stack): Likewise.
5810 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
5811 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
5812 * layout.h (class Layout): Update declarations. Remove options_
5813 field. Add number_of_input_files_ and resized_signatures_
5814 fields. Move sections_are_attached_ field.
5815 * main.cc (main): Pass number of input files to Layout
5816 constructor. Don't pass options.
5817
154b857c
ILT
58182009-03-30 Ian Lance Taylor <iant@google.com>
5819
5820 * ffsll.c (ffsll): Correct implementation.
5821
2f35ab9b
ILT
58222009-03-27 Ian Lance Taylor <iant@google.com>
5823
fd03461a
ILT
5824 * ffsll.c: New file.
5825 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
5826 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
5827 * ftruncate.c (ftruncate): Declare before definition.
5828 * mremap.c (mremap): Likewise.
5829 * pread.c (pread): Likewise.
5830 * configure, Makefile.in, config.in: Rebuild.
5831
2f35ab9b
ILT
5832 * mremap.c: New file.
5833 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
5834 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
5835 (mremap): Declare if HAVE_MREMAP is not defined.
5836 * configure, Makefile.in, config.in: Rebuild.
5837
33aea2fd
CC
58382009-03-27 Cary Coutant <ccoutant@google.com>
5839
5840 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
5841 position independent.
5842 * sparc.cc (Target_sparc::check_non_pic): Likewise.
5843 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
5844
6d479619
CC
58452009-03-24 Cary Coutant <ccoutant@google.com>
5846
5847 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
5848 an executable.
5849 (needs_dynamic_reloc): Likewise.
5850
afc06bb8
ILT
58512009-03-24 Ian Lance Taylor <iant@google.com>
5852
5853 * yyscript.y (file_cmd): Recognize EXTERN.
5854 (extern_name_list, extern_name_list_body): New nonterminals.
5855 * script.cc (script_add_extern): Define.
5856 * script-c.h (script_add_extern): Declare.
5857
f6060a4d
ILT
58582009-03-24 Rafael Avila de Espindola <espindola@google.com>
5859
5860 * object.cc (is_elf_object): Define.
5861 * object.h (is_elf_object): Declare.
5862 * archive.cc (Archive::get_elf_object_for_member): Call
5863 is_elf_object.
33aea2fd 5864 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 5865
26736d8e
ILT
58662009-03-24 Elliott Hughes <enh@google.com>
5867
5868 * output.cc (Output_file::map_anonymous): Define.
5869 (Output_file::map): Use map_anonymous. If the regular mmap fails,
5870 try an anonymous one. Report the size if the mmap fails.
5871 * output.h (class Output_file): Declare map_anonymous.
5872
22fd9730
ILT
58732009-03-24 Ian Lance Taylor <iant@google.com>
5874
5875 * target-select.cc (instantiate_target): Don't acquire the lock if
5876 the instantiated_target_ field has already been set.
5877
cb010894
ILT
58782009-03-23 Ian Lance Taylor <iant@google.com>
5879
7f055c20
ILT
5880 * gold-threads.h (class Initialize_lock): Define.
5881 * gold-threads.cc (class Initialize_lock_once): Define.
5882 (initialize_lock_control): New static variable.
5883 (initialize_lock_pointer): New static variable.
5884 (initialize_lock_once): New static function.
5885 (Initialize_lock::Initialize_lock): Define.
5886 (Initialize_lock::initialize): Define.
5887 * target-select.h: Include "gold-threads.h".
5888 (class Target_selector): Add lock_ and initialize_lock_ fields.
5889 Don't define instantiate_target, just declare it.
5890 * target-select.cc (Target_selector::Target_selector): Initialize
5891 new fields.
5892 (Target_selector::instantiate_target): Define.
5893 * descriptors.h: Include "gold-threads.h".
5894 (class Descriptors): Add initialize_lock_ field.
5895 * descriptors.cc (Descriptors::Descriptors): Initialize new
5896 field.
5897 (Descriptors::open): Use initialize_lock_ field
5898 * errors.h (class Errors): Add initialize_lock_ field.
5899 * errors.cc (Errors::Errors): Initialize new field.
5900 (Errors::initialize_lock): Use initialize_lock_ field.
5901 * powerpc.cc (class Target_selector_powerpc): Remove
5902 instantiated_target_ field. In do_recognize call
5903 instantiate_target rather than do_instantiate_target. In
5904 do_instantiate_target just allocate a new target.
5905 * sparc.cc (class Target_selector_sparc): Likewise.
5906
36959681
ILT
5907 * freebsd.h: New file.
5908 * i386.cc: Include "freebsd.h".
5909 (Target_i386): Derive from Target_freebsd rather than
5910 Sized_target.
5911 (Target_selector_i386): Derive from Target_selector_freebsd rather
5912 than Target_selector.
5913 * x86_64.cc: Include "freebsd.h".
5914 (Target_x86_64): Derive from Target_freebsd rather than
5915 Sized_target.
5916 (Target_selector_x86_64): Derive from Target_selector_freebsd
5917 rather than Target_selector.
5918 * target.h (class Target): Add adjust_elf_header and
5919 do_adjust_elf_header.
5920 * output.cc (Output_file_header:: do_sized_write): Call target
5921 adjust_elf_header routine.
5922 * configure.tgt: Set targ_osabi.
5923 * configure.ac: Define GOLD_DEFAULT_OSABI.
5924 * parameters.cc (Parameters::default_target): Pass
5925 GOLD_DEFAULT_OSABI to select_target.
5926 * target-select.h (class Target_selector): Make instantiate_target
5927 protected rather than private.
5928 * Makefile.am (HFILES): Add freebsd.h.
5929 * configure, Makefile.in, config.in: Rebuild.
5930
cb010894
ILT
5931 * merge.cc (do_add_input_section): Correct pend value. Change
5932 message about last entry not being null terminated from error to
5933 warning.
5934
0e879927
ILT
59352009-03-20 Mikolaj Zalewski <mikolajz@google.com>
5936
5937 * incremental.cc: New file.
5938 * Makefile.am (CCFILES): Add incremental.cc.
5939 * Makefile.in: Rebuild.
5940
41105937
PP
59412009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
5942
5943 * layout.cc (Layout::output_section_name): Preserve names
5944 of '.note.' sections.
e1df38aa 5945
60439920
ILT
59462009-03-19 Ian Lance Taylor <iant@google.com>
5947
5948 * descriptors.cc (Descriptors::open): Check that the options are
5949 valid before using them.
5950
0d371ad3
ILT
59512009-03-18 Ian Lance Taylor <iant@google.com>
5952
5953 * script-sections.h: Include <list>.
5954 (class Script_sections): Change Sections_elements from std::vector
5955 to std::list. Typedef public Elements_iterator. Add
5956 orphan_section_placement_, data_segment_align_start_, and
5957 saw_data_segment_align_ fields. Remove data_segment_align_index_
5958 field.
5959 * script-sections.cc (class Orphan_section_placement): New class.
5960 (class Sections_element): Add virtual functions is_relro and
5961 orphan_section_init. Remove virtual function place_orphan_here.
5962 (class Output_section_definition): Add is_relro and
5963 orphan_section_init. Remove place_orphan_here.
5964 (class Orphan_output_section): Likewise.
5965 (Script_sections::Script_sections): Update for field changes.
5966 (Script_sections::data_segment_align): Set saw_data_segment_align_
5967 and data_segment_align_start_, not data_segment_align_index.
5968 (Script_sections::data_segment_relro_end): Check
5969 saw_data_segment_align_. Use data_segment_align_start_ rather
5970 than data_segment_align_index_.
5971 (Script_sections::place_orphan): Rewrite to use
5972 Orphan_section_placement.
5973
9201d894
ILT
59742009-03-17 Ian Lance Taylor <iant@google.com>
5975
9c5b8369
ILT
5976 * archive.cc (Archive::add_symbols): Check for a version attached
5977 to the symbol name in the archive map.
5978 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
5979 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
5980 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
5981 (ver_test_11.a): New target.
5982 * testsuite/Makefile.in: Rebuild.
5983
9201d894
ILT
5984 * configure.ac: Check for chsize and posix_fallocate. Replace
5985 ftruncate.
5986 * ftruncate.c: New file, from gnulib.
5987 * output.cc (posix_fallocate): Define dummy version if not
5988 HAVE_POSIX_FALLOCATE.
5989 (Output_file::map): Call posix_fallocate rather than lseek and
5990 write.
5991 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
5992 * configure, Makefile.in, config.in: Rebuild.
5993
ef4ab7a8 59942009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 5995
ef4ab7a8
PP
5996 * layout.h (Layout::create_note): Add section_name parameter.
5997 * layout.cc (Layout::create_note): Likewise.
5998 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 5999
8c500701
ILT
60002009-03-17 Ian Lance Taylor <iant@google.com>
6001
e85b18e1
ILT
6002 * descriptors.cc: Include "options.h".
6003 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
6004 (Descriptors::open): Always use O_CLOEXEC when opening a new
6005 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
6006 then set FD_CLOEXEC.
6007
9efe6174
ILT
6008 * sparc.cc (class Target_sparc): Add has_got_section.
6009 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
6010 make sure we have a GOT section.
6011
6012 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
6013 (Target_sparc::Scan::local): Likewise.
6014 (Target_sparc::Scan::global): Likewise.
6015 (Target_sparc::Relocate::relocate): Likewise.
6016 (Target_sparc::Relocate::relocate_tls): Likewise.
6017
8c500701
ILT
6018 * symtab.cc (Symbol_table::define_default_version): New function,
6019 broken out of add_from_object.
6020 (Symbol_table::add_from_object): Call define_default_version.
6021 (Symbol_table::define_special_symbol): Add resolve_oldsym
6022 parameter. Change all callers. If the version for a symbol comes
6023 from a version script, resolve it with the symbol with the same
6024 name with no version. Also add the symbol without a version if
6025 appropriate.
6026 (do_define_in_output_data): If resolving with oldsym, don't delete
6027 sym.
6028 (do_define_in_output_segment): Likewise.
6029 (do_define_as_constant): Likewise.
6030 * symtab.h (class Symbol_table): Update declarations.
6031
f1ed28fb
ILT
60322009-03-13 Ian Lance Taylor <iant@google.com>
6033
15f8229b
ILT
6034 * readsyms.cc (Read_symbols::incompatible_warning): New function.
6035 (Read_symbols::requeue): New function.
6036 (Read_symbols::do_read_symbols): If make_elf_object fails because
6037 the target type is not configured, and the file was searched for,
6038 issue a warning and retry with the next directory.
6039 (Add_symbols::run): If the file has an incompatible format, and
6040 it was searched for, requeue the Read_symbols task. On error,
6041 release the object.
6042 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
6043 dirindex parameter to constructor. Change all callers. Declare
6044 incompatible_warning and requeue.
6045 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
6046 input_argument_ and input_group_ fields. Add them to
6047 constructor. Change all callers.
6048 (class Read_script): Add dirindex_ field. Add it to constructor.
6049 Change all callers.
6050 * archive.cc (Archive::setup): Remove input_objects parameter.
6051 Change all callers.
6052 (Archive::get_file_and_offset): Likewise.
6053 (Archive::read_all_symbols): Likewise.
6054 (Archive::read_symbols): Likewise.
6055 (Archive::get_elf_object_for_member): Remove input_objects
6056 parameter. Add punconfigured parameter. Change all callers.
6057 (Archive::add_symbols): Change return type to bool. Check return
6058 value of include_member.
6059 (Archive::include_all_members): Likewise.
6060 (Archive::include_member): Change return type to bool. Return
6061 false if first included object has incompatible target. Set
6062 included_member_ field.
6063 (Add_archive_symbols::run): If add_symbols returns false, requeue
6064 Read_symbols task.
6065 * archive.h (class Archive): Add included_member_ field.
6066 Initialize it in constructor. Add input_file and searched_for
6067 methods. Update declarations.
6068 (class Add_archive_symbols): Add dirpath_, dirindex_, and
6069 input_argument_ fields. Add them to constructor. Change all
6070 callers.
6071 * script.cc: Include "target-select.h".
6072 (class Parser_closure): Add skip_on_incompatible_target_ and
6073 found_incompatible_target_ fields. Add
6074 skip_on_incompatible_target parameter to constructor. Change all
6075 callers. Add methods skip_on_incompatible_target,
6076 clear_skip_on_incompatible_target, found_incompatible_target, and
6077 set_found_incompatible_target.
6078 (read_input_script): Add dirindex parameter. Change all callers.
6079 If parser finds an incompatible target, requeue Read_symbols
6080 task.
6081 (script_set_symbol): Clear skip_on_incompatible_target in
6082 closure.
6083 (script_add_assertion, script_parse_option): Likewise.
6084 (script_start_sections, script_add_phdr): Likewise.
6085 (script_check_output_format): New function.
6086 * script.h (read_input_script): Update declaration.
6087 * script-c.h (script_check_output_format): Declare.
6088 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
6089 (ignore_cmd): Remove OUTPUT_FORMAT.
6090 * fileread.cc (Input_file::Input_file): Add explicit this.
6091 (Input_file::will_search_for): New function.
6092 (Input_file::open): Add pindex parameter. Change all callers.
6093 * fileread.h (class Input_file): Add input_file_argument method.
6094 Declare will_search_for. Update declarations.
6095 * object.cc (make_elf_object): Add punconfigured parameter.
6096 Change all callers.
6097 * object.h (class Object): Make input_file public. Add
6098 searched_for method.
6099 (make_elf_object): Update declaration.
6100 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
6101 restart search.
6102 * dirsearch.h (class Dirsearch): Update declaration.
6103 * options.h (class General_options): Add --warn-search-mismatch.
6104 * parameters.cc (Parameters::is_compatible_target): New function.
6105 * parameters.h (class Parameters): Declare is_compatible_target.
6106 * workqueue.cc (Workqueue::add_blocker): New function.
6107 * workqueue.h (class Workqueue): Declare add_blocker.
6108
f1ed28fb
ILT
6109 * fileread.cc (Input_file::open): Remove options parameter.
6110 Change all callers.
6111 (Input_file::open_binary): Likewise.
6112 * script.cc (read_input_script): Likewise.
6113 * readsyms.h (class Read_symbols): Remove options_ field. Remove
6114 options parameter from constructor. Change all callers.
6115 (class Read_script): Likewise.
6116 * fileread.h (class Input_file): Update declarations.
6117 * script.h (read_input_script): Update declaration.
6118
34dd024a
NC
61192009-03-10 Nick Clifton <nickc@redhat.com>
6120
6121 * po/es.po: New Spanish translation.
6122
6d71b17c
CC
61232009-03-06 Cary Coutant <ccoutant@google.com>
6124
6125 * options.cc (parse_short_option): Keep dash_z from registering itself.
6126
031cdbed
ILT
61272009-03-03 Ian Lance Taylor <iant@google.com>
6128
6129 PR 9918
6130 * target-reloc.h (relocate_section): Pass output_section to
6131 relocate.
6132 * i386.cc (Target_i386::should_apply_static_reloc): Add
6133 output_section parameter. Change all callers.
6134 (Target_i386::Relocate::relocate): Add output_section parameter.
6135 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
6136 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
6137 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
6138 * testsuite/two_file_shared.sh: New script.
6139 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
6140 (check_DATA): Add two_file_shared.dbg.
6141 (two_file_shared.dbg): New target.
6142 * testsuite/Makefile.in: Rebuild.
6143
15d5fa16
ILT
61442009-03-01 Ian Lance Taylor <iant@google.com>
6145
6146 * configure.ac: Check for byteswap.h.
6147 * configure: Rebuild.
6148 * config.in: Rebuild.
6149
8a4c0b0d
ILT
61502009-03-01 Mikolaj Zalewski <mikolajz@google.com>
6151
6152 * layout.cc (Layout::find_or_add_kept_section): New function.
6153 (Layout::add_comdat): Removed.
6154 * layout.h (struct Kept_section): Move out of class Layout.
6155 Remove trailing underscores from field names. Add group_sections
6156 field. Rename group_ field to is_group. Change all uses.
6157 (class Layout): Declare find_or_add_kept_section, not add_comdat.
6158 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
6159 comdat_groups_ field.
6160 (Sized_relobj::include_section_group): Use
6161 find_or_add_kept_section and Kept_section::group_sections.
6162 (Sized_relobj::include_linkonce_section): Likewise.
6163 * object.cc (class Sized_relobj): Don't define Comdat_group or
6164 Comdat_group_table. Remove find_comdat_group and
6165 add_comdat_group. Remove comdat_groups_ field.
6166 * plugin.cc (include_comdat_group): Use
6167 Layout::find_or_add_kept_section.
6168
b4ecf66b
ILT
61692009-02-28 Ian Lance Taylor <iant@google.com>
6170
14359ca0
ILT
6171 * README: --gc-sections and map files are now supported. Document
6172 some build requirements.
6173
b4ecf66b
ILT
6174 PR 6992
6175 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
6176 relocatable link set the value of the section symbol to zero.
6177 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
6178 relocatable link don't include the section address in the local
6179 symbol value.
6180
0602e05a
ILT
61812009-02-27 Ian Lance Taylor <iant@google.com>
6182
fd9d194f
ILT
6183 PR 6811
6184 * options.h (class Search_directory): Add is_system_directory.
6185 (class General_options): Declare is_in_system_directory.
6186 * options.cc (get_relative_sysroot): Make static.
6187 (get_default_sysroot): Make static.
6188 (General_optoins::is_in_system_directory): New function.
6189 * fileread.cc (Input_file::is_in_system_directory): New function.
6190 * fileread.h (class Input_file): Declare is_in_system_directory.
6191 * object.h (class Object): Add is_in_system_directory.
6192 (class Input_objects): Remove system_library_directory_ field.
6193 * object.cc (Input_objects::add_object): Don't set
6194 system_library_directory_.
6195 (input_objects::found_in_system_library_directory): Remove.
6196 * symtab.cc (Symbol_table::write_globals): Remove input_objects
6197 parameter. Change all callers.
6198 (Symbol_table::sized_write_globals): Likewise.
6199 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
6200 Call Object::is_in_system_directory.
6201 * symtab.h (class Symbol_table): Update declarations.
6202
61edd21f
ILT
6203 PR 5990
6204 * descriptors.h (Open_descriptor): Add is_on_stack field.
6205 * descriptors.cc (Descriptors::open): If the descriptor is on the
6206 top of the stack, remove it. Initialize is_on_stack field.
6207 (Descriptors::release): Only add pod to stack if it is not on the
6208 stack already.
6209 (Descriptors::close_some_descriptor): Clear stack_next and
6210 is_on_stack fields.
6211
e29e076a
ILT
6212 PR 7091
6213 * output.cc (Output_section::find_starting_output_address): Rename
6214 from starting_output_address; add PADDR parameter; change return
6215 type.
6216 * output.h (class Output_section): Declare
6217 find_starting_output_address instead of starting_output_address.
6218 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
6219 section symbol for which we can't find a merge section.
6220
0602e05a
ILT
6221 PR 9836
6222 * symtab.cc (Symbol_table::add_from_object): If the visibility is
6223 hidden or internal, force the symbol to be local.
6224 * resolve.cc (Symbol::override_visibility): Define.
6225 (Symbol::override_base): Use override_visibility.
6226 (Symbol_table::resolve): Likewise.
6227 (Symbol::override_base_with_special): Likewise.
6228 (Symbol_table::override_with_special): If the visibility is hidden
6229 or internal, force the symbol to be local.
6230 * symtab.h (class Symbol): Add set_visibility and
6231 override_visibility.
6232 * testsuite/ver_test_1.sh: New file.
6233 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
6234 (check_DATA): Add ver_test_1.syms.
6235 (ver_test_1.syms): New target.
6236 * testsuite/Makefile.in: Rebuild.
6237
401a9a73
CC
62382009-02-25 Cary Coutant <ccoutant@google.com>
6239
6240 * layout.cc (Layout::choose_output_section): Don't rename sections
6241 when using a linker script that has a SECTIONS clause.
6242 * Makefile.in: Regenerate.
6243
6244 * testsuite/Makefile.am (script_test_5.sh): New test case.
6245 * testsuite/Makefile.in: Regenerate.
6246 * testsuite/script_test_5.cc: New file.
6247 * testsuite/script_test_5.sh: New file.
6248 * testsuite/script_test_5.t: New file.
6249
f488e4b0
CC
62502009-02-13 Rafael Avila de Espindola <espindola@google.com>
6251
6252 * archive.cc (Archive::include_member): Update calls to add_symbols.
6253 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
6254 the Layout argument.
6255 * dynobj.h (do_add_symbols): Add the Layout argument.
6256 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
6257 Layout argument.
6258 * object.h (Object::add_symbols): Add the Layout argument.
6259 (Object::do_add_symbols): Add the Layout argument.
6260 (Sized_relobj::do_add_symbols): Add the Layout argument.
6261 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
6262 Unify the two versions.
6263 (Add_plugin_symbols): Remove.
6264 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
6265 (Sized_pluginobj::do_add_symbols): Unify the two versions.
6266 (Add_plugin_symbols): Remove.
6267 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
6268 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
6269 (Add_symbols::run): Make it work with Pulginobj.
6270
89dd1680
ILT
62712009-02-06 Ian Lance Taylor <iant@google.com>
6272
6273 * object.cc (Sized_relobj::do_layout): Make info message start
6274 with lower case letter.
6275
266d0a74
ILT
62762009-02-06 Mikolaj Zalewski <mikolajz@google.com>
6277
602b464e
ILT
6278 * binary.cc: Fix file comment.
6279
266d0a74
ILT
6280 * options.h (enum Incremental_disposition): Define.
6281 (class General_options): Add new options: --incremental,
6282 --incremental_changed, --incremental_unchanged,
6283 --incremental_unknown. Add incremental_disposition_ and
6284 implicit_incremental_ fields.
6285 (General_options::incremental_disposition): New function.
6286 (class Position_dependent_options): Add incremental_disposition
6287 option.
6288 (Position_dependent_options::copy_from_options): Set incremental
6289 dispositions.
6290 * options.cc (General_options::parse_incremental_changed): New
6291 function.
6292 (General_options::parse_incremental_unchanged): New function.
6293 (General_options::parse_incremental_unknown): New function.
6294 (General_options::General_options): Initialize new fields
6295 incremental_disposition_ and implicit_incremental_.
6296 (General_options::finalize): Check for uasge of --incremental-*
6297 without --incremental.
6298
f073bbf7
CD
62992009-02-06 Chris Demetriou <cgd@google.com>
6300
6301 * gold.h (gold_undefined_symbol): Change to take only a Symbol
6302 pointer and to report location as the file name associated with
6303 the symbol.
6304 (gold_undefined_symbol_at_location): New function to replace the
6305 old gold_undefined_symbol functionality.
6306 * target-reloc.h (relocate_section): Update to use
6307 gold_undefined_symbol_at_location.
6308 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
6309 Call gold_undefined_symbol function rather than gold_error.
6310 * errors.h (Errors::undefined_symbol): Take location as a
6311 string, rather than calculating it from a relocation.
6312 * errors.cc (Errors::fatal): Print "fatal error:" before the
6313 formatted message.
6314 (Errors::error, Errors::error_at_location): Print "error: "
6315 before the formatted message.
6316 (Errors::undefined_symbol): Take location as a string, rather
6317 than calculating it from a relocation.
6318 (gold_undefined_symbol_at_location): New function akin to
6319 old gold_undefined_symbol, calculates location from relocation.
6320 (gold_undefined_symbol): Change to take only a Symbol pointer
6321 and to report location as the file name associated with the symbol.
6322 * testsuite/debug_msg.sh: Update for changed error messages.
6323 * testsuite/undef_symbol.sh: Likewise.
6324
8e94a90c
ILT
63252009-02-04 Duncan Sands <baldrick@free.fr>
6326
6327 PR 9812
6328 * reduced_debug_output.h
6329 (Output_reduced_debug_abbrev_section::failed): Use format for
6330 gold_warning.
6331 (Output_reduced_debug_info_section::faild): Likewise.
6332
88a0e15b
ILT
63332009-01-31 Mikolaj Zalewski <mikolajz@google.com>
6334
6335 * script.cc (Lazy_demangler): New class.
6336 (Version_script_info::get_symbol_version_helper): Demangle a
6337 symbol only once.
6338
5efc7cd2
CC
63392009-01-29 Cary Coutant <ccoutant@google.com>
6340
6341 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
6342 to __tls_get_addr.
6343 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
6344
e0ebcf42
ILT
63452009-01-28 Ian Lance Taylor <iant@google.com>
6346
5efc7cd2 6347 * version.cc (version_string): Bump to 1.9.
75fe7426 6348
e0ebcf42
ILT
6349 * gold.h: Include <cstring> and <stdint.h>.
6350 * version.cc: Include <cstdio>.
6351 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
6352 warning.
6353 * reduced_debug_output.cc (insert_into_vector): Rename from
6354 Insert_into_vector; change all callers. Use Swap_unaligned to
6355 avoid aliasing issue; remove union since it is unnecessary.
6356
8e2813be 63572009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
6358
6359 * Makefile.am (CCFILES): Add gc.cc.
6360 (HFILES): Add gc.h.
6361 * Makefile.in: Regenerate.
6362 * gold.cc (Gc_runner): New class.
6363 (queue_initial_tasks): Call garbage collection related tasks
6364 when corresponding options are invoked.
6365 (queue_middle_gc_tasks): New function.
6366 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
6367 processed early before laying out sections during garbage collection.
6368 * gold.h (queue_middle_gc_tasks): New function.
6369 (is_prefix_of): Move from "layout.cc".
6370 * i386.cc (Target_i386::gc_process_relocs): New function.
6371 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
6372 * main.cc (main): Create object of class "Garbage_collection".
6373 * object.cc (Relobj::copy_symbols_data): New function.
6374 (Relobj::is_section_name_included): New function.
e1df38aa
NC
6375 (Sized_relobj::do_layout): Allow this function to be called twice
6376 during garbage collection and defer layout of section during the
6d03d481
ST
6377 first call.
6378 * object.h (Relobj::get_symbols_data): New function.
6379 (Relobj::is_section_name_included): New function.
6380 (Relobj::copy_symbols_data): New function.
6381 (Relobj::set_symbols_data): New function.
6382 (Relobj::get_relocs_data): New function.
6383 (Relobj::set_relocs_data): New function.
6384 (Relobj::is_output_section_offset_invalid): New pure virtual function.
6385 (Relobj::gc_process_relocs): New function.
6386 (Relobj::do_gc_process_relocs): New pure virtual function.
6387 (Relobj::sd_): New data member.
6388 (Sized_relobj::is_output_section_offset_invalid): New function.
6389 (Sized_relobj::do_gc_process_relocs): New function.
6390 * options.h (General_options::gc_sections): Modify to not be a no-op.
6391 (General_options::print_gc_sections): New option.
6392 * plugin.cc (Plugin_finish::run): Remove function call to
6393 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
6394 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
6395 * reloc.cc (Read_relocs::run): Add task to process relocs and
6396 determine unreferenced sections when doing garbage collection.
6397 (Gc_process_relocs): New class.
6398 (Sized_relobj::do_gc_process_relocs): New function.
6399 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
6400 sections that are garbage collected.
6401 * reloc.h (Gc_process_relocs): New class.
6402 * sparc.cc (Target_sparc::gc_process_relocs): New function.
6403 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
6404 symbols whose corresponding sections are garbage collected.
6405 (Symbol_table::Symbol_table): Add new parameter for the garbage
6406 collection object.
6407 (Symbol_table::gc_mark_undef_symbols): New function.
6408 (Symbol_table::gc_mark_symbol_for_shlib): New function.
6409 (Symbol_table::gc_mark_dyn_syms): New function.
6410 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
6411 as garbage.
6412 (Symbol_table::add_from_object): Likewise.
6413 (Symbol_table::add_from_relobj): When building shared objects, do not
6414 treat externally visible symbols as garbage.
6415 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
6416 table information for static and relocatable links.
6417 * symtab.h (Symbol_table::set_gc): New function.
6418 (Symbol_table::gc): New function.
6419 (Symbol_table::gc_mark_undef_symbols): New function.
6420 (Symbol_table::gc_mark_symbol_for_shlib): New function.
6421 (Symbol_table::gc_mark_dyn_syms): New function.
6422 (Symbol_table::gc_): New data member.
e1df38aa 6423 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
6424 function.
6425 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
6426 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
6427
3b293544
CF
64282009-01-20 Chris Faylor <me.sourceware@sourceware.org>
6429
6430 * options.h (General_options::gc_sections): Define as a no-op for now.
6431 (General_options::no_keep_memory): Ditto.
6432 (General_options::Bshareable): Define.
6433 * options.cc (General_options::finalize): Honor -Bshareable.
6434
83d22aa8
AS
64352009-01-20 Andreas Schwab <schwab@suse.de>
6436
6437 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
6438 read the value in the contents, since we don't use it. Use the
6439 template endianness when writing.
6440 (Relocate::relocate): Use it for R_PPC_REL16_HA.
6441
cd536b21
AS
64422009-01-19 Andreas Schwab <schwab@suse.de>
6443
6444 * configure.tgt (powerpc64-*): Fix targ_obj.
6445
99e9a495
ILT
64462009-01-15 Ian Lance Taylor <iant@google.com>
6447
6448 * object.cc (Sized_relobj::write_local_symbols): Don't write out
6449 local symbols when stripping all symbols.
6450
bbbfea06
CC
64512009-01-14 Cary Coutant <ccoutant@google.com>
6452
99e9a495 6453 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 6454
0f7c0701
CC
64552009-01-14 Cary Coutant <ccoutant@google.com>
6456
6457 * archive.cc (Archive::get_elf_object_for_member): Remove call
6458 to File_read::claim_for_plugin.
6459 * descriptors.cc (Descriptors::open): Remove reference to
6460 is_claimed.
6461 (Descriptors::claim_for_plugin): Remove.
6462 * descriptors.h (Descriptors::claim_for_plugin): Remove.
6463 (Descriptors::is_claimed): Remove.
6464 (claim_descriptor_for_plugin): Remove.
6465 * fileread.cc (File_read::claim_for_plugin): Remove.
6466 * fileread.h (File_read::claim_for_plugin): Remove.
6467 (File_read::descriptor): Reopen descriptor if necessary.
6468 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
6469 (Plugin_manager::all_symbols_read): Add task parameter. Change
6470 all callers.
6471 (Plugin_manager::get_input_file): New function.
6472 (Plugin_manager::release_input_file): New function.
6473 (Pluginobj::Pluginobj): Add filesize parameter and initialize
6474 corresponding data member.
6475 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
6476 and pass to base constructor. Change all callers.
6477 (get_input_file, release_input_file): New functions.
6478 (make_sized_plugin_object): Add filesize parameter. Change all callers.
6479 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
6480 (Plugin_manager::all_symbols_read): Add task parameter.
6481 (Plugin_manager::get_input_file): New function.
6482 (Plugin_manager::release_input_file): New function.
6483 (Plugin_manager::task_): New data member.
6484 (Pluginobj::Pluginobj): Add filesize parameter.
6485 (Pluginobj::filename): New function.
6486 (Pluginobj::descriptor): New function.
6487 (Pluginobj::filesize): New function.
6488 (Pluginobj::filesize_): New data member.
6489 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
6490 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
6491 File_read::claim_for_plugin; use Object::unlock to unlock the file.
6492
6493 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
6494 with archive libraries.
6495 * testsuite/Makefile.in: Regenerate.
6496 * testsuite/plugin_test.c (struct sym_info): New type.
6497 (get_input_file, release_input_file): New static variables.
6498 (onload): Capture new transfer vector entries.
6499 (claim_file_hook): Stop reading at end of file according to filesize.
6500 Factor out parsing of readelf output into separate function.
6501 (all_symbols_read_hook): Exercise get_input_file and release_input_file
6502 APIs and get the source file name from the symbol table. Convert
6503 source file name to corresponding object file name. Print info
6504 message when adding new input files.
6505 (parse_readelf_line): New function.
6506 * testsuite/plugin_test_1.sh: Add checks for new info messages.
6507 * testsuite/plugin_test_2.sh: Likewise.
6508 * testsuite/plugin_test_3.sh: Likewise.
6509 * testsuite/plugin_test_4.sh: New test case.
6510
62a6d109
ILT
65112009-01-07 Ian Lance Taylor <iant@google.com>
6512
6513 * version.cc (version_string): Bump to 1.8.
6514
483620e8
CC
65152008-12-23 Cary Coutant <ccoutant@google.com>
6516
6517 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
6518 * plugin.cc (Plugin_manager::finish): Rename as
6519 layout_deferred_objects. Move cleanup to separate function.
6520 (Plugin_manager::cleanup): New function.
6521 (Plugin_finish::run): Call layout_deferred_objects and cleanup
6522 separately.
6523 * plugin.h (Plugin_manager::finish): Rename as
6524 layout_deferred_objects.
6525 (Plugin_manager::cleanup): New function.
6526 (Plugin_manager::cleanup_done): New field.
6527
d66a9eb3
CC
65282008-12-23 Cary Coutant <ccoutant@google.com>
6529
6530 * plugin.cc (is_visible_from_outside): New function.
6531 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
6532 so we don't return "IR only" status for exported symbols or -r links.
6533
6534 * testsuite/Makefile.am (plugin_test_3): New test case.
6535 * testsuite/Makefile.in: Regenerate.
6536 * testsuite/plugin_test_3.sh: New file.
6537
5995b570
CC
65382008-12-22 Cary Coutant <ccoutant@google.com>
6539
6540 * object.cc (Sized_relobj::layout_section): New function.
6541 (Sized_relobj::do_layout): Defer layout of input sections until after
6542 plugin has provided replacement files.
6543 (Sized_relobj::do_layout_deferred_sections): New function.
6544 * object.h (Relobj::set_section_offset): Remove virtual keyword.
6545 (Relobj::layout_deferred_sections): New function.
6546 (Relobj::do_layout_deferred_sections): New function.
6547 (Sized_relobj::do_layout_deferred_sections): New function.
6548 (Sized_relobj::layout_section): New function.
6549 (Sized_relobj::Deferred_layout): New structure.
6550 (Sized_relobj::deferred_layout_): New field.
6551 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
6552 Change all callers. Layout deferred sections.
6553 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
6554 references.
6555 (Plugin_hook::run): Move code from do_plugin_hook inline.
6556 (Plugin_hook::do_plugin_hook): Remove.
6557 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
6558 (Plugin_manager::finish): Renamed, was cleanup.
6559 (Plugin_manager::should_defer_layout): New function.
6560 (Plugin_manager::add_deferred_layout_object): New function.
6561 (Plugin_manager::Deferred_layout_list): New type.
6562 (Plugin_manager::deferred_layout_objects_): New field.
6563 (Plugin_hook::do_plugin_hook): Remove.
6564
ee769c88
ILT
65652008-12-17 Ian Lance Taylor <iant@google.com>
6566
6567 * options.h (class General_options): Add --no case for
6568 --export-dynamic.
6569
abc8dcba
CC
65702008-12-16 Cary Coutant <ccoutant@google.com>
6571
6572 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
6573 vector.
6574 (Plugin_manager::claim_file): Create plugin object even if
6575 plugin did not call the add_symbols callback.
6576 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
6577 asking for more symbols than were added.
6578 * testsuite/Makefile.am (plugin_test_1): Add test case with
6579 no global symbols.
6580 (empty.syms): New target.
6581 * testsuite/Makefile.in: Regenerate.
6582 * testsuite/plugin_test.c (claim_file_hook): Add new debug
6583 message. Don't call add_symbols if no globals.
6584 (all_symbols_read_hook): Don't provide replacement for empty
6585 claimed file.
6586
b0074644
ILT
65872008-12-12 Ian Lance Taylor <iant@google.com>
6588
68943102
ILT
6589 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
6590 r_type == 0 for a local symbol with r_sym == 0.
6591 (scan_relocatable_relocs): Pass r_sym to
6592 local_non_section_strategy.
6593 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
6594 r_sym parameter.
6595
b0074644
ILT
6596 * configure.ac: Update test for TLS descriptors: they are
6597 supported as of glibc 2.9.
6598 * configure: Rebuild.
6599
c2508178
ILT
66002008-12-11 Ian Lance Taylor <iant@google.com>
6601
6602 PR 7091
6603 * target-reloc.h (Default_scan_relocatable_relocs): For each
6604 function, map r_type == 0 to RELOC_DISCARD.
6605
2756a258
CC
66062008-12-10 Cary Coutant <ccoutant@google.com>
6607
6608 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
6609 object to override a kept COMDAT group from a plugin object.
6610
bb6f53d3
ILT
66112008-12-09 Ian Lance Taylor <iant@google.com>
6612
fbc558e1
ILT
6613 PR 7088
6614 * yyscript.y (file_cmd): Handle INPUT.
6615
bb6f53d3
ILT
6616 * testsuite/initpri1.c: Change all declarations to be full
6617 prototypes by adding void, to avoid compiler warnings.
6618
4674ecfc
CC
66192008-12-05 Rafael Avila de Espindola <espindola@google.com>
6620
6621 * options.cc (General_options::parse_plugin_opt): New.
6622 (General_options::add_plugin): The argument now is just the filename.
6623 (General_options::add_plugin_option): New.
6624 * options.h (plugin_opt): New.
6625 (add_plugin): Change argument name.
6626 (add_plugin_option): New.
6627 * plugin.cc (Plugin::load): Don't parse the plugin option.
6628 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
6629 (Plugin::add_option): New.
6630 (Plugin::args_): Change type.
6631 (Plugin::filename_): New.
6632 (Plugin_manager::add_plugin_option): New.
6633 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
6634 * testsuite/Makefile.in: Regenerate.
6635
fd06b4aa
CC
66362008-12-05 Cary Coutant <ccoutant@google.com>
6637
6638 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
6639 Handle --strip-lto-sections option.
6640 * options.h (strip_lto_sections): New option.
6641
6c52134c
CC
66422008-12-01 Cary Coutant <ccoutant@google.com>
6643
6644 * plugin.cc (ld_plugin_message): Change format parameter to const.
6645 Fix mismatch between new[] and delete.
6646
a45248e0
CC
66472008-11-14 Cary Coutant <ccoutant@google.com>
6648
6649 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
6650 instead of -1U.
6651
c82fbeee
CS
66522008-11-05 Craig Silverstein <csilvers@google.com>
6653
6654 * options.cc (General_options::parse_dynamic_list): New function.
6655 * options.h (General_options): New flags dynamic_list,
6656 dynamic_list_data, dynamic_list_cpp_new, and
6657 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
6658 (General_options::in_dynamic_list): New function.
6659 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
6660 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
6661 (Lex::can_continue_name): Likewise.
6662 (yylex): Likewise.
6663 (read_script_file): New parameter script_options.
6664 (read_dynamic_list): New function.
6665 (Script_options::define_dynamic_list): New function.
6666 (dynamic_list_keyword_parsecodes): New variable.
6667 (dynamic_list_keywords): New variable.
6668 * script.h (Script_options::define_dynamic_list): New function
6669 prototype.
6670 (read_dynamic_list): New function prototype.
6671 * symtab.cc (strprefix): New macro.
6672 (Symbol::should_add_dynsym_entry): Support dynamic_list,
6673 dynamic_list_data, dynamic_list_cpp_new, and
6674 dynamic_list_cpp_typeinfo.
6675 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
6676 (dynamic_list_expr): New rule.
6677 (dynamic_list_nodes): Likewise.
6678 (dynamic_list_node): Likewise.
6679 * testsuite/Makefile.am (dynamic_list): New test.
6680 * testsuite/Makefile.in: Regenerated.
6681 * testsuite/dynamic_list.t: New file.
6682 * testsuite/dynamic_list.sh: New file.
6683
e0bb29a5
CS
66842008-11-05 Craig Silverstein <csilvers@google.com>
6685
6686 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
6687 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
6688 (t11_last): Likewise.
6689 * testsuite/ver_test_6.c (main): Likewise.
6690
4e1e25e0
CC
66912008-10-07 Cary Coutant <ccoutant@google.com>
6692
6693 * options.c (General_options::finalize): Add check for -static and
6694 -shared.
6695 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
6696 is not empty.
6697
92f03fcb
CC
66982008-10-02 Cary Coutant <ccoutant@google.com>
6699
6700 * plugin.cc (make_sized_plugin_object): Fix conditional
6701 compilation to work when not all targets are enabled.
6702
fbd8a257
CC
67032008-09-29 Cary Coutant <ccoutant@google.com>
6704
6705 * archive.cc (Archive::get_file_and_offset): Use filename instead
6706 of name to get library path.
6707 (Archive::include_member): Unlock external member of a thin archive.
6708
6709 * testsuite/Makefile.am (TEST_AR): New variable.
6710 (thin_archive_test_1): New test.
6711 (thin_archive_test_2): New test.
81636b3f
CC
6712 * testsuite/Makefile.in: Regenerate.
6713 * testsuite/thin_archive_main.cc: New file.
6714 * testsuite/thin_archive_test_1.cc: New file.
6715 * testsuite/thin_archive_test_2.cc: New file.
6716 * testsuite/thin_archive_test_3.cc: New file.
6717 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 6718
eff45813
CC
67192008-09-29 Cary Coutant <ccoutant@google.com>
6720
6721 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
6722 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
6723 instead of -1U.
6724 (Sized_relobj::do_finalize_local_symbols): Likewise.
6725 (Sized_relobj::map_to_kept_section): Likewise.
6726 * object.h (Sized_relobj::invalid_address): New constant.
6727 (Sized_relobj::do_output_section_offset): Check for invalid_address
6728 and return -1ULL.
6729 * output.cc (Output_reloc::local_section_offset): Use constant
6730 invalid_address instead of -1U.
6731 (Output_reloc::get_address): Likewise.
6732 (Output_section::output_address): Change -1U to -1ULL.
6733 * output.h (Output_reloc::invalid_address): New constant.
6734 * reloc.cc (Sized_relobj::write_sections): Use constant
6735 invalid_address instead of -1U.
6736 (Sized_relobj::relocate_sections): Likewise.
6737 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
6738 values for merge sections.
6739 * target-reloc.h (relocate_for_relocatable): Use constant
6740 invalid_address instead of -1U.
6741
89fc3421
CC
67422008-09-19 Cary Coutant <ccoutant@google.com>
6743
6744 Add plugin functionality for link-time optimization (LTO).
6745 * configure.ac (plugins): Add --enable-plugins option.
6746 * configure: Regenerate.
6747 * config.in: Regenerate.
6748 * Makefile.am (LIBDL): New variable.
6749 (CCFILES): Add plugin.cc.
6750 (HFILES): Add plugin.h.
6751 (ldadd_var): Add LIBDL.
6752 * Makefile.in: Regenerate.
6753
6754 * archive.cc: Include "plugin.h".
6755 (Archive::setup): Don't preread archive symbols when using a plugin.
6756 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
6757 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
6758 files.
6759 (Archive::include_member): Add symbols from plugin objects.
6760 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
6761 * descriptors.cc (Descriptors::open): Check for file descriptors
6762 abandoned by plugins.
6763 (Descriptors::claim_for_plugin): New function.
6764 * descriptors.h (Descriptors::claim_for_plugin): New function.
6765 (Open_descriptor::is_claimed): New field.
6766 (claim_descriptor_for_plugin): New function.
6767 * fileread.cc (File_read::claim_for_plugin): New function.
6768 * fileread.h (File_read::claim_for_plugin): New function.
6769 (File_read::descriptor): New function.
6770 * gold.cc: Include "plugin.h".
6771 (queue_initial_tasks): Add task to call plugin hooks for generating
6772 new object files.
6773 * main.cc: Include "plugin.h".
6774 (main): Load plugin libraries.
6775 * object.h (Pluginobj): Declare.
6776 (Object::pluginobj): New function.
6777 (Object::do_pluginobj): New function.
6778 (Object::set_target): New function.
6779 * options.cc: Include "plugin.h".
6780 (General_options::parse_plugin): New function.
6781 (General_options::General_options): Initialize plugins_ field.
6782 (General_options::add_plugin): New function.
6783 * options.h (Plugin_manager): Declare.
6784 (General_options): Add --plugin option.
6785 (General_options::has_plugins): New function.
6786 (General_options::plugins): New function.
6787 (General_options::add_plugin): New function.
6788 (General_options::plugins_): New field.
6789 * plugin.cc: New file.
6790 * plugin.h: New file.
6791 * readsyms.cc: Include "plugin.h".
6792 (Read_symbols::do_read_symbols): Check for archive before checking
6793 for ELF file. Call plugin hooks to claim files.
6794 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
6795 from a real object file; force override when processing replacement
6796 files.
6797 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
6798 (Symbol::init_base_object): Likewise.
6799 (Symbol::init_base_output_data): Likewise.
6800 (Symbol::init_base_output_segment): Likewise.
6801 (Symbol::init_base_constant): Likewise.
6802 (Symbol::init_base_undefined): Likewise.
6803 (Symbol::output_section): Assert that object is not a plugin.
6804 (Symbol_table::add_from_pluginobj): New function.
6805 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
6806 undefined.
6807 (Symbol_table::sized_write_globals): Likewise.
6808 (Symbol_table::add_from_pluginobj): Instantiate template.
6809 * symtab.h (Sized_pluginobj): Declare.
6810 (Symbol::in_real_elf): New function.
6811 (Symbol::set_in_real_elf): New function.
6812 (Symbol::in_real_elf_): New field.
6813 (Symbol_table::add_from_pluginobj): New function.
6814
6815 * testsuite/Makefile.am (AM_CFLAGS): New variable.
6816 (LIBDL): New variable.
6817 (LDADD): Add LIBDL.
6818 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
6819 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
6820 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
6821 (MOSTLYCLEANFILES): Likewise.
6822 * testsuite/Makefile.in: Regenerate.
6823 * testsuite/plugin_test.c: New file.
6824 * testsuite/plugin_test_1.sh: New file.
6825 * testsuite/plugin_test_2.sh: New file.
6826
de31bda5
ILT
68272008-09-16 Ian Lance Taylor <iant@google.com>
6828
9c2d0ef9
ILT
6829 * target-reloc.h (relocate_section): Check whether a symbol is
6830 defined by the ABI before reporting an undefined symbol error.
6831 * target.h (Target::is_defined_by_abi): Make parameter const.
6832 (Target::do_is_defined_by_abi): Likewise.
6833 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
6834 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
6835 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
6836 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
6837 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
6838 * testsuite/Makefile.in: Rebuild.
6839
de31bda5
ILT
6840 * fileread.cc (make_view): Add casts to avoid warning.
6841
9fa33bee
AO
68422008-09-16 Alexandre Oliva <aoliva@redhat.com>
6843
6844 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
6845 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
6846
183fd0e3
AO
68472008-09-16 Alexandre Oliva <aoliva@redhat.com>
6848
6849 * options.h (General_options::output_is_executable): New.
6850 (General_options::output_is_pie): New.
6851 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
6852 for shared libraries.
6853 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
6854
7be8330a
CD
68552008-09-11 Chris Demetriou <cgd@google.com>
6856
6857 * options.h (origin): New -z option.
6858 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
6859 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
6860 in DT_FLAGS_1.
6861
a9caad02
CC
68622008-09-05 Cary Coutant <ccoutant@google.com>
6863
6864 * fileread.cc (File_read::make_view): Add check for attempt to map
6865 beyond end of file.
6866
ae6dce4d
CC
68672008-09-05 Cary Coutant <ccoutant@google.com>
6868
6869 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
6870 explicit instantiations.
6871
d7ab2a47
KVH
68722008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
6873
6874 PR gold/6858
6875 * options.cc (General_options::finalize): Allow undefined symbols
6876 in shlibs if linking -shared.
6877
6878 PR gold/6859
6879 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
6880 symbols as not needing a dynsym entry.
6881
1e52a9c1
CS
68822008-08-20 Craig Silverstein <csilvers@google.com>
6883
6884 * fileread.cc (File_read::open): Do not lock the file unless it
6885 was successfully opened.
6886
d85c80a3
CC
68872008-08-14 Cary Coutant <ccoutant@google.com>
6888
6889 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
6890 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
6891 * testsuite/tls_test.cc (struct int128): 128-bit struct
6892 for testing TLS relocs with non-zero addend.
6893 (v12): New TLS variable.
6894 (t12): New test.
6895 (t_last): Add check for v12.
6896 * testsuite/tls_test.h (t12): New function.
6897 * testsuite/tls_test_main.cc (thread_routine): Call new test.
6898
2d924fd9
ILT
68992008-08-13 Ian Lance Taylor <iant@google.com>
6900
6901 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
6902 set tls_segment_ or relro_segment_.
6903 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
6904 when appropriate.
6905 * output.h (Output_section::clear_is_relro): New function.
6906 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
6907 sections specially even when output_data_ is empty.
6908 (Output_segment::maximum_alignment): When first section is relro,
6909 only force alignment for PT_LOAD segments.
6910 * script.cc (script_data_segment_align): New function.
6911 (script_data_segment_relro_end): New function.
6912 * script-c.h (script_data_segment_align): Declare.
6913 (script_data_segment_relro_end): Declare.
6914 * script-sections.h (class Script_sections): Declare
6915 data_segment_align and data_segment_relro_end. Add fields
6916 segment_align_index_ and saw_relro_end_.
6917 * script-sections.cc (class Sections_element): Add set_is_relro
6918 virtual function. Add new bool* parameter to place_orphan_here.
6919 Add get_output_section virtual function.
6920 (class Output_section_definition): Add set_is_relro. Add new
6921 bool* parameter to place_orphan_here. Add get_output_section.
6922 Add is_relro_ field.
6923 (Output_section_definition::Output_section_definition): Initialize
6924 evaluated_address_, evaluated_load_address, evaluated_addralign_,
6925 and is_relro_ fields.
6926 (Output_section_definition::place_orphan_here): Add is_relro
6927 parameter.
6928 (Output_section_definition::set_section_addresses): Set relro for
6929 output section.
6930 (Output_section_definition::alternate_constraint): Likewise.
6931 (class Orphan_output_section): Add new bool* parameter to
6932 place_orphan_here. Add get_output_section.
6933 (Orphan_output_section::place_orphan_here): Add is_relro
6934 parameter.
6935 (Script_sections::Script_sections): Initialize
6936 data_segment_align_index_ and saw_relro_end_.
6937 (Script_sections::data_segment_align): New function.
6938 (Script_sections::data_segment_relro_end): New function.
6939 (Script_sections::place_orphan): Set or clear is_relro.
6940 (Script_sections::set_section_addresses): Force alignment of first
6941 TLS section.
6942 * yyscript.y (exp): Call script_data_segment_align and
6943 script_data_segment_relro_end.
6944 * testsuite/relro_script_test.t: New file.
6945 * testsuite/relro_test.cc (using_script): Declare.
6946 (t1, t2): Test using_script.
6947 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
6948 (relro_script_test_SOURCES): Define.
6949 (relro_script_test_DEPENDENCIES): Define.
6950 (relro_script_test_LDFLAGS): Define.
6951 (relro_script_test_LDADD): Define.
6952 (relro_script_test.so): New target.
6953 * testsuite/Makefile.in: Rebuild.
6954
f827c9a9
CC
69552008-08-06 Cary Coutant <ccoutant@google.com>
6956
6957 * archive.cc (Archive::total_archives, Archive::total_members)
6958 (Archive::total_members_loaded): New variables.
6959 (Archive::setup): Add parameter. Add option to preread
6960 archive symbols.
6961 (Archive::read_armap): Add counter.
6962 (Archive::get_file_and_offset): New function.
6963 (Archive::get_elf_object_for_member): New function.
6964 (Archive::read_all_symbols): New function.
6965 (Archive::read_symbols): New function.
6966 (Archive::add_symbols): Add counters.
6967 (Archive::include_all_members): Use armap to find members if it's
6968 already built.
6969 (Archive::include_member): Skip reading symbols if already read.
6970 Factored code into Archive::get_file_and_offset and
6971 Archive::get_elf_object_for_member. Changed call to
6972 Mapfile::report_include_archive_member.
6973 (Archive::print_stats): New function.
6974 * archive.h: Declare Object and Read_symbols_data classes.
6975 (Archive::Archive): Add initializers for new members.
6976 (Archive::setup): Add parameter.
6977 (Archive::print_stats): New function.
6978 (Archive::total_archives, Archive::total_members)
6979 (Archive::total_members_loaded): New variables.
6980 (Archive::get_file_and_offset): New function.
6981 (Archive::get_elf_object_for_member): New function.
6982 (Archive::read_all_symbols): New function.
6983 (Archive::read_symbols): New function.
6984 (Archive::Archive_member): New class.
6985 (Archive::members_): New member.
6986 (Archive::num_members_): New member.
6987 * main.cc: Include archive.h.
6988 (main): Call Archive::print_stats.
6989 * mapfile.cc (Mapfile::report_include_archive_member): Delete
6990 archive parameter; member_name is now the fully-decorated name.
6991 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
6992 * options.h: (General_options): Add --preread-archive-symbols option.
6993 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
6994 Archive::setup.
6995
de4c45bd
ILT
69962008-08-04 Ian Lance Taylor <iant@google.com>
6997
6998 * symtab.h (Symbol::use_plt_offset): New function.
6999 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
7000 * powerpc.cc (Relocate::relocate): Likewise.
7001 * sparc.cc (Relocate::relocate): Likewise.
7002 * x86_64.cc (Relocate::relocate): Likewise.
7003 * testsuite/weak_plt.sh: New test.
7004 * testsuite/weak_plt_main.cc: New test.
7005 * testsuite/weak_plt_shared.cc: New test.
7006 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
7007 (check_PROGRAMS): Add weak_plt.
7008 (check_DATA): Add weak_plt_shared.so.
7009 (weak_plt_main_pic.o, weak_plt): New targets.
7010 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
7011 * testsuite/Makefile.in: Rebuild.
7012
7013 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
7014 gcctestdir/ld.
7015 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
7016 * testsuite/Makefile.in: Rebuild.
7017
323ee3f4
AM
70182008-08-04 Alan Modra <amodra@bigpond.net.au>
7019
7020 * Makefile.am (POTFILES.in): Set LC_ALL=C.
7021 * Makefile.in: Regenerate.
7022 * po/POTFILES.in: Regenerate.
7023
7c07ecec
ILT
70242008-07-29 Ian Lance Taylor <iant@google.com>
7025
7026 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
7027 symbols before other symbols.
7028 * testsuite/script_test_2.cc (test_addr): Declare.
7029 (test_addr_alias): Declare.
7030 (main): Check that test_addr and test_addr_alias have the right
cd536b21 7031 values.
7c07ecec
ILT
7032 * testsuite/script_test_2.t: Define test_addr_alias and
7033 test_addr.
7034
5778530e
ILT
70352008-07-24 Ian Lance Taylor <iant@google.com>
7036
2a00e4fb
ILT
7037 PR 5990
7038 * descriptors.cc: New file.
7039 * descriptors.h: New file.
7040 * gold-threads.h (class Hold_optional_lock): New class.
7041 * fileread.cc: Include "descriptors.h".
7042 (File_read::~File_read): Release descriptor rather than closing
7043 it.
7044 (File_read::open) [file]: Call open_descriptor rather than open.
7045 Set is_descriptor_opened_.
7046 (File_read::open) [memory]: Assert that descriptor is not open.
7047 (File_read::reopen_descriptor): New function.
7048 (File_read::release): Release descriptor.
7049 (File_read::do_read): Make non-const. Reopen descriptor.
7050 (File_read::read): Make non-const.
7051 (File_read::make_view): Reopen descriptor.
7052 (File_read::do_readv): Likewise.
7053 * fileread.h (class File_read): Add is_descriptor_opened_ field.
7054 Update declarations.
7055 * layout.cc: Include "descriptors.h".
7056 (Layout::create_build_id): Use open_descriptor rather than open.
7057 * output.cc: Include "descriptors.h".
7058 (Output_file::open): Use open_descriptor rather than open.
7059 * archive.cc (Archive::const_iterator): Change Archive to be
7060 non-const.
7061 (Archive::begin, Archive::end): Make non-const.
7062 (Archive::count_members): Likewise.
7063 * archive.h (class Archive): Update declarations.
7064 * object.h (Object::read): Make non-const.
7065 * Makefile.am (CCFILES): Add descriptors.cc.
7066 (HFILES): Add descriptors.h.
7067 * Makefile.in: Rebuild.
7068
801647d1
ILT
7069 PR 6716
7070 * gold.h: Always include <clocale>. Add Solaris workarounds
7071 following code in binutils/sysdep.h.
7072
5edd166e
ILT
7073 PR 6048
7074 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
7075 this->eh_frame_hdr_ is NULL before using it.
7076
c89ad728
ILT
7077 * dynobj.cc (Versions::Versions): Update comment.
7078
aa86f06b
ILT
7079 * dynobj.cc (Versions::Versions): If there is an soname, use it as
7080 the base version name.
7081
5778530e
ILT
7082 * stringpool.cc (Stringpool_template::add_with_length): Set key to
7083 array size plus one.
7084 (Stringpool_template::set_string_offsets): Subtract one from key
7085 before using it as an array index.
7086 (Stringpool_template::get_offset_with_length): Likewise.
7087 (Stringpool_template::write_to_buffer): Likewise.
7088 * stringpool.h (Stringpool_template::get_offset_from_key):
7089 Likewise.
7090
057ead22
ILT
70912008-07-23 Ian Lance Taylor <iant@google.com>
7092
7f649c59
ILT
7093 PR 6658
7094 * object.h (Merged_symbol_value::value): Do our best to handle a
7095 negative addend.
7096
057ead22
ILT
7097 PR 6647
7098 * script.cc (Version_script_info::get_versions): Don't add empty
7099 version tag to return value.
7100 (Version_script_info::get_symbol_version_helper): Change return
7101 type to bool. Add pversion parameter. Change all callers.
7102 (script_register_vers_node): Don't require a non-NULL tag.
7103 * script.h (class Version_script_info): Update declarations.
7104 (Version_script_info::get_symbol_version): Change return type to
7105 bool. Add version parameter. Change all callers.
7106 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
7107 handling. Handle an empty version from a version script.
7108 (Symbol_table::define_special_symbol): Likewise.
7109 * testsuite/ver_test_10.script: New file.
7110 * testsuite/ver_test_10.sh: New file.
7111 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
7112 (check_DATA): Add ver_test_10.syms.
7113 (ver_test_10.syms, ver_test_10.so): New target.
7114 * testsuite/Makefile.in: Rebuild.
7115
58e54ac2
CD
71162008-07-23 Simon Baldwin <simonb@google.com>
7117
7118 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
7119 to zero for undefined symbols from dynamic libraries.
7120
95d14cd3
ILT
71212008-07-23 Ian Lance Taylor <iant@google.com>
7122
7123 * symtab.cc (Symbol_table::resolve): Remove version parameter.
7124 Change all callers.
7125 * symtab.h (class Symbol_table): Update declaration.
7126 * testsuite/ver_test_9.cc: New file.
7127 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
7128 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
7129 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
7130 (ver_test_9.so, ver_test_9.o): New targets.
7131 * testsuite/Makefile.in: Rebuild.
7132
92de84a6
ILT
71332008-07-22 Ian Lance Taylor <iant@google.com>
7134
34810851
ILT
7135 * options.h (class General_options): Define --check-sections.
7136 * layout.cc (Layout::set_segment_offsets): Handle
7137 --check-sections.
7138
af6156ef
ILT
7139 * options.h (class General_options): Define -n/--nmagic and
7140 -N/--omagic.
7141 * options.cc (General_options::finalize): For -n/--nmagic or
7142 -N/--omagic, set -static.
7143 * layout.cc (Layout::attach_allocated_section_to_segment): If
7144 -N/--omagic, don't put read-only and read-write sections in
7145 different segments.
7146 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
7147 finding a read-only segment.
7148 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
7149 don't set the minimum segment alignment to the common page size,
7150 and don't set the file offset to the address modulo the page size.
7151 * script-sections.cc (Script_sections::create_segments): If
7152 -n/--omagic, don't put read-only and read-write sections in
7153 different segments.
7154
92de84a6
ILT
7155 * cref.cc: New file.
7156 * cref.h: New file.
7157 * options.h (class General_options): Add --print-symbol-counts.
7158 * main.cc (main): Issue defined symbol report if requested.
7159 * archive.cc (Archive::interpret_header): Make into a const member
7160 function.
7161 (Archive::add_symbols): Call Input_objects::archive_start and
7162 archive_stop.
7163 (Archive::const_iterator): Define new class.
7164 (Archive::begin, Archive::end): New functions.
7165 (Archive::include_all_members): Rewrite to use iterator.
7166 (Archive::count_members): New function.
7167 * archive.h (class Archive): Update declarations.
7168 (Archive::filename): New function.
7169 * object.cc: Include "cref.h".
7170 (Sized_relobj::Sized_relobj): Initialize defined_count_.
7171 (Sized_relobj::do_get_global_symbol_counts): New function.
7172 (Input_objects::add_object): Add object to cross-referencer.
7173 (Input_objects::archive_start): New function.
7174 (Input_objects::archive_stop): New function.
7175 (Input_objects::print_symbol_counts): New function.
7176 * object.h: Declare Cref and Archive.
7177 (Object::get_global_symbol_counts): New function.
7178 (Object::do_get_global_symbol_counts): New pure virtual function.
7179 (class Sized_relobj): Add defined_count_ field. Update
7180 declarations.
7181 (class Input_objects): Add cref_ field. Update constructor.
7182 Update declarations.
7183 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
7184 defined_count_.
7185 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
7186 symbol counts.
7187 (Sized_dynobj::do_get_global_symbol_counts): New function.
7188 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
7189 defined_count_. Update declarations. Define Symbols typedef.
7190 * symtab.cc (Symbol_table::add_from_relobj): Add defined
7191 parameter. Change all callers.
7192 (Symbol_table::add_from_dynobj): Add sympointers and defined
7193 parameters. Change all callers.
7194 * symtab.h (class Symbol_table): Update declarations.
7195 * Makefile.am (CCFILES): Add cref.cc.
7196 (HFILES): Add cref.h.
7197 * Makefile.in: Rebuild.
7198
3f7c5e1d
CD
71992008-07-22 Simon Baldwin <simonb@google.com>
7200
7201 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
7202 to zero when writing undefined symbols.
7203
e0b64032
ILT
72042008-07-22 Ian Lance Taylor <iant@google.com>
7205
7206 * output.cc (Output_section::add_input_section): Don't try to
7207 merge empty merge sections.
7208
096b02cf
CS
72092008-07-21 Craig Silverstein <csilvers@google.com>
7210
7211 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
7212 Include symbol version in error message.
cd536b21 7213
1d1f116d
CD
72142008-07-20 Chris Demetriou <cgd@google.com>
7215
cd536b21 7216 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
7217 (RANDOM_SEED_CFLAGS): New substituted variable.
7218 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
7219 * configure: Rebuild.
7220 * Makefile.in: Likewise.
7221 * testsuite/Makefile.in: Likewise.
7222
a18f591e
ILT
72232008-07-18 Ian Lance Taylor <iant@google.com>
7224
7225 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
7226 where we see NAME/NULL and NAME/VERSION as separate symbols.
7227 * testsuite/ver_test_main.cc (main): Call t4.
7228 (t4, t4_2a): Define.
7229 * testsuite/ver_test_2.cc (t4_2): Define.
7230 * testsuite/ver_test_2.script: Put t4_2a in VER2.
7231 * testsuite/ver_test_4.cc (t4_2a): Define.
7232 * testsuite/ver_test_4.script: Put t4_2a in VER2.
7233 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
7234
c6e3f6ed
ILT
72352008-07-17 Ian Lance Taylor <iant@google.com>
7236
7237 * dynobj.cc (Versions::add_def): If we give an error about a
7238 missing version, go ahead and create the version anyhow.
7239
ef9beddf
ILT
72402008-07-10 Ian Lance Taylor <iant@google.com>
7241
7242 Handle output sections with more than 0x7fffffff bytes.
7243 * object.h (class Relobj): Change map_to_output_ to
7244 output_sections_, and just keep a section pointer. Change all
7245 uses. Move comdat group support to Sized_relobj.
7246 (Relobj::is_section_specially_mapped): Remove.
7247 (Relobj::output_section): Remove poff parameter. Change all
7248 callers.
7249 (Relobj::output_section_offset): New function.
7250 (Relobj::set_section_offset): Rewrite.
7251 (Relobj::map_to_output): Remove.
7252 (Relobj::output_sections): New function.
7253 (Relobj::do_output_section_offset): New pure virtual function.
7254 (Relobj::do_set_section_offset): Likewise.
7255 (class Sized_relobj): Add section_offsets_ field. Add comdat
7256 group support from Relobj. Update declarations.
7257 (Sized_relobj::get_output_section_offset): New function.
7258 (Sized_relobj::do_output_section_offset): New function.
7259 (Sized_relobj::do_set_section_offset): New function.
7260 * object.cc (Relobj::output_section_address): Remove.
7261 (Sized_relobj::Sized_relobj): Initialize new fields.
7262 (Sized_relobj::include_section_group): Cast find_kept_object to
7263 Sized_relobj.
7264 (Sized_relobj::include_linkonce_section): Likewise.
7265 (Sized_relobj::do_layout): Use separate arrays for output section
7266 and output offset.
7267 (Sized_relobj::do_count_local_symbols): Change map_to_output to
7268 output_sections.
7269 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
7270 output_sections and section_offsets.
7271 (Sized_relobj::write_local_symbols): Likewise.
7272 (map_to_kept_section): Compute output address directly.
7273 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
7274 output_sections and section_offsets.
7275 (Sized_relobj::write_sections): Likewise.
7276 (Sized_relobj::relocate_sections): Likewise.
7277 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
7278 * output.h (class Output_reloc): Update declarations. Change
7279 u2_.relobj to Sized_relobj*.
7280 (class Output_data_reloc): Change add functions to use
7281 Sized_relobj*.
7282 * output.cc (Output_reloc::Output_reloc): Change relobj to
7283 Sized_relobj*.
7284 (Output_reloc::local_section_offset): Change return type to
7285 Elf_Addr. Use get_output_section_offset.
7286 (Output_reloc::get_address): Likewise.
7287 (Output_section::is_input_address_mapped): Don't call
7288 is_section_specially_mapped.
7289 (Output_section::output_offset): Likewise.
7290 (Output_section::output_address): Likewise.
7291 (Output_section::starting_output_address): Likewise.
7292 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
7293 parameter to Sized_relobj*.
7294 (Copy_relocs::need_copy_reloc): Likewise.
7295 (Copy_relocs::save): Likewise.
7296 * copy-relocs.h (class Copy_relocs): Update declarations.
7297 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
7298 Sized_relobj*. Change relobj_ field to Sized_relobj*.
7299 * target-reloc.h (relocate_for_relocatable): Change
7300 offset_in_output_section type to Elf_Addr. Change code that uses
7301 it as well.
7302 * layout.cc (Layout::layout): Always set *off.
7303 * mapfile.cc (Mapfile::print_input_section): Use
7304 output_section_offset.
7305 * i386.cc (Target_i386::copy_reloc): Change object parameter to
7306 Sized_relobj*.
7307 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
7308 * sparc.cc (Target_sparc::copy_reloc): Likewise.
7309 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
7310
5cb66f97
ILT
73112008-07-03 Ian Lance Taylor <iant@google.com>
7312
7313 * layout.cc (Layout::include_section): Do not discard unrecognized
7314 SHT_STRTAB sections.
7315
afe47622
CS
73162008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
7317
7318 * script.cc (Lex::can_continue_name): Make '?' allowable in
7319 version-script names.
7320 * testsuite/version_script.map: Change glob pattern to use '?'
7321
5adf9721
ILT
73222008-06-30 Manish Singh <yosh@gimp.org>
7323
7324 PR 6585
7325 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
7326 Correct typo.
7327
e6fde208
ILT
73282008-06-30 Ian Lance Taylor <iant@google.com>
7329
7330 PR 6660
7331 PR 6682
7332 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
7333 versions]: Don't try to read the value in the contents, since we
7334 don't use it. Use the template endianness when writing.
7335
3f2e6a2d
CC
73362008-06-25 Cary Coutant <ccoutant@google.com>
7337
7338 * fileread.cc (File_read::make_view): Assert on zero-length view.
7339 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
7340 symbol table when there are no symbols to read.
7341
c43d3a48
CS
73422008-06-23 Craig Silverstein <csilvers@google.com>
7343
7344 * version.cc (version_string): Bump to 1.7
7345
5f494ea0
CS
73462008-06-18 Craig Silverstein <csilvers@google.com>
7347
7348 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
7349 constant 0xFFFF to type Valtype.
7350 (Powerpc_relocate_functions::rel16_ha): Likewise.
7351
c42e122e
ILT
73522008-06-17 Ian Lance Taylor <iant@google.com>
7353
f34787f8
ILT
7354 * output.h (Output_section::Input_section): Initialize p2align_ to
7355 zero for Output_section_data constructors.
7356 (Output_section::Input_section::addralign): If not an input
7357 section, return the alignment of the Output_section_data.
7358 * testsuite/copy_test.cc: New file.
7359 * testsuite/copy_test_1.cc: New file.
7360 * testsuite/copy_test_2.cc: New file.
7361 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
7362 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
7363 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
7364 (copy_test_1_pic.o, copy_test_1.so): New targets.
7365 (copy_test_2_pic.o, copy_test_2.so): New targets.
7366 * testsuite/Makefile.in: Rebuild.
7367
c42e122e
ILT
7368 * script-sections.cc (Script_sections::place_orphan): Initialize
7369 local variable exact.
7370
ce3ac18a
DE
73712008-06-13 David Edelsohn <edelsohn@gnu.org>
7372
7373 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
7374
42cacb20
DE
73752008-06-12 David Edelsohn <edelsohn@gnu.org>
7376 David S. Miller <davem@davemloft.net>
7377
7378 * powerpc.cc: New file.
7379 * Makefile.am (TARGETSOURCES): Add powerpc.cc
7380 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
7381 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
7382 * Makefile.in: Rebuild.
7383
7b308235
ILT
73842008-06-09 Ian Lance Taylor <iant@google.com>
7385
7386 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
7387 <exception>.
7388 (throwing, orig_terminate): New static variables.
7389 (terminate_handler): New static function.
7390 (t2): Set terminate handler.
7391
f0b886e3
ILT
73922008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
7393
7394 PR 6584
cd536b21 7395 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
7396 alignment.
7397
3e90f135
CC
73982008-05-30 Cary Coutant <ccoutant@google.com>
7399
7400 * archive.cc (Archive::include_all_members) Correct to step
7401 over symbol table and extended name table in thin archives.
7402
e09ad04a
ILT
74032008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
7404
7405 PR 6407
7406 * target-reloc.h (relocate_for_relocatable): Fix new_offset
7407 calculation.
7408
62b01cb5
ILT
74092008-05-28 Caleb Howe <cshowe@google.com>
7410
7411 * reduced_debug_output.cc: New file.
7412 * reduced_debug_output.h: New file.
92de84a6 7413 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
7414 * options.cc (General_options::finalize): Add strip_debug_non_line
7415 to the strip heirarchy.
7416 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
7417 fields.
7418 * layout.cc: Include "reduced_debug_output.h".
7419 (Layout::Layout): Initialize new fields.
7420 (line_only_debug_sections): New static array.
7421 (is_lines_only_debug_sections): New static inline function.
7422 (Layout::include_section): Handle --strip-debug-non-line.
7423 (Layout::make_output_section): If --strip-debug-non-line, build
7424 new output sections for .debug_abbrev and .debug_info.
7425 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
7426 gold. Warn about possible overflow.
7427 (read_signed_LEB_128): Likewise.
7428 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
7429 (read_signed_LEB_128): Declare.
7430 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
7431 (HFILES): Add reduced_debug_output.h.
7432 * Makefile.in: Rebuild.
7433
7d9e3d98
ILT
74342008-05-21 Ian Lance Taylor <iant@google.com>
7435
7436 * mapfile.cc: New file.
7437 * mapfile.h: New file.
7438 * options.h (class General_options): Add -M/--print-map and -Map.
7439 * options.cc (General_options::finalize): Make -M equivalent to
7440 -Map -.
7441 * main.cc: Include <cstdio> and "mapfile.h".
7442 (main): Open mapfile if requested.
7443 * gold.cc (class Middle_runner): Add mapfile_ field. Update
7444 constructor. Change caller.
7445 (queue_initial_tasks): Add mapfile parameter. Change caller.
7446 (queue_middle_tasks): Likewise.
7447 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
7448 declarations.
7449 * archive.cc: Include "mapfile.h".
7450 (Archive::add_symbols): Add mapfile parameter. Change all
7451 callers. Pass mapfile, symbol, and reason to include_member.
7452 (Archive::include_all_members): Add mapfile parameter. Change all
7453 callers.
7454 (Archive::include_member): Add mapfile, sym, and why parameters.
7455 Change all callers. Report inclusion to map file.
7456 * archive.h: Include "fileread.h".
7457 (class Archive): Update declarations.
7458 (Archive::file): New const method.
7459 (class Add_archive_symbols): Add mapfile_ field. Update
7460 constructor. Change all callers.
7461 * readsyms.h (class Read_symbols): Likewise.
7462 (class Finish_group): Likewise.
7463 (class Read_script): Likewise.
7464 * common.cc: Include "mapfile.h".
7465 (Symbol_table::allocate_commons): Add mapfile parameter. Change
7466 all callers.
7467 (Symbol_table::do_allocate_commons): Likewise.
7468 (Symbol_table::do_allocate_commons_list): Likewise. Report common
7469 symbol allocation to mapfile.
7470 * common.h (class Allocate_commons_task): Add mapfile_ field.
7471 Update constructor. Change all callers.
7472 * symtab.h (class Symbol_table): Update declarations.
7473 * layout.cc: Include "mapfile.h".
7474 (Layout_task_runner::run): Print information to mapfile.
7475 (Layout::create_gold_note): Change Output_data_fixed_space to
7476 Output_data_zero_fill.
7477 (Layout::create_build_id): Likewise.
7478 (Layout::print_to_mapfile): New function.
7479 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
7480 constructor. Change caller.
7481 (class Layout): Declare print_to_mapfile.
7482 * output.cc (Output_section::Input_section::print_to_mapfile): New
7483 function.
7484 (Output_section::add_input_section): If producing a map, always
7485 add to input_sections_ list.
7486 (Output_section::do_print_to_mapfile): New function.
7487 (Output_segment::print_sections_to_mapfile): New function.
7488 (Output_segment::print_section_list_to_mapfile): New function.
7489 * output.h: Include "mapfile.h".
7490 (Output_data::print_to_mapfile): New function.
7491 (Output_data::do_print_to_mapfile): New virtual function.
7492 (Output_segment_headers::do_print_to_mapfile): New function.
7493 (Output_file_header::do_print_to_mapfile): New function.
7494 (Output_data_const::do_print_to_mapfile): New function.
7495 (class Output_data_const_buffer): Add map_name_ field. Update
7496 constructor. Change all callers. Add do_print_to_mapfile
7497 function.
7498 (class Output_data_fixed_space): Likewise.
7499 (class Output_data_space): Likewise.
7500 (class Output_data_zero_fill): New class.
7501 (Output_data_strtab::do_print_to_mapfile): New function.
7502 (Output_data_reloc_base::do_print_to_mapfile): New function.
7503 (Output_relocatable_relocs::do_print_to_mapfile): New function.
7504 (Output_data_group::do_print_to_mapfile): New function.
7505 (Output_data_got::do_print_to_mapfile): New function.
7506 (Output_data_dynamic::do_print_to_mapfile): New function.
7507 (Output_symtab_xindex::do_print_to_mapfile): New function.
7508 (class Output_section): Declare do_print_to_mapflie. Declare
7509 print_to_mapfile in Input_section.
7510 (class Output_segment): Declare new functions.
7511 * object.h (Sized_relobj::symbol_count): New function.
7512 * script-sections.cc
7513 (Output_section_element_dot_assignment::set_section_addresses):
7514 Change Output_data_fixed_space to Output_data_zero_fill.
7515 (Output_data_expression::do_print_to_mapfile): New function.
7516 * script.cc (read_input_script): Add mapfile parameter. Change
7517 all callers.
7518 * script.h (read_input_script): Update declaration.
7519 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
7520 (Eh_frame::do_print_to_mapfile): New function.
7521 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
7522 (Output_merge_string::do_print_to_mapfile): New function.
7523 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
7524 function.
7525 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
7526 function.
7527 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
7528 function.
7529 * Makefile.am (CCFILES): Add mapfile.cc.
7530 (HFILES): Add mapfile.h.
7531 * Makefile.in: Rebuild.
7532
9f1d377b
ILT
75332008-05-19 Ian Lance Taylor <iant@google.com>
7534
7535 * options.h (class General_options): Add -z relro.
7536 * layout.cc (Layout::Layout): Initialize relro_segment_.
7537 (Layout::add_output_section_data): Return the output section.
7538 (Layout::make_output_section): Rcognize relro sections and mark
7539 them appropriately.
7540 (Layout::attach_allocated_section_to_segment): Put relro sections
7541 in a PT_GNU_RELRO segment.
7542 (Layout::create_initial_dynamic_sections): Mark the .dynamic
7543 section as relro.
7544 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
7545 PT_TLS segments.
7546 (Layout::linkonce_mapping): Map d.rel.ro.local to
7547 .data.rel.ro.local.
7548 (Layout::output_section_name): Us .data.rel.ro.local for any
7549 section which begins with that.
7550 * layout.h (class Layout): Update add_output_section_data
7551 declaration. Add relro_segment_ field.
7552 * output.cc (Output_section::Output_section): Initialize is_relro_
7553 and is_relro_local_ fields.
7554 (Output_segment::add_output_section): Group relro sections.
7555 (Output_segment::is_first_section_relro): New function.
7556 (Output_segment::maximum_alignment): If there is a relro section,
7557 align the segment to the common page size.
7558 (Output_segment::set_section_addresses): Track whether we are
7559 looking at relro sections. If the last section is a relro
7560 section, align to the common page size.
7561 (Output_segment::set_section_list_addresses): Add in_relro
7562 parameter. Change all callers. Align to the page size when
7563 moving from relro to non-relro section.
7564 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
7565 segment.
7566 * output.h (class Output_section): Add is_relro_ and
7567 is_relro_local_ fields.
7568 (Output_section::is_relro): New function.
7569 (Output_section::set_is_relro): New function.
7570 (Output_section::is_relro_local): New function.
7571 (Output_section::set_is_relro_local): New function.
7572 (class Output_segment): Update declarations.
7573 * i386.cc (Target_i386::got_section): Mark .got section as relro.
7574 * sparc.cc (Target_sparc::got_section): Likewise.
7575 * x86_64.cc (Target_x86_64::got_section): Likewise.
7576 * testsuite/relro_test_main.cc: New file.
7577 * testsuite/relro_test.cc: New file.
7578 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
7579 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
7580 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
7581 (relro_test.so, relro_test_pic.o): New targets.
7582 * testsuite/Makefile.in: Rebuild.
7583
a984ee1d
ILT
75842008-05-16 Ian Lance Taylor <iant@google.com>
7585
01676dcd
ILT
7586 * output.cc (Output_segment::add_output_section): Remove front
7587 parameter.
7588 * output.h (class Output_segment): Remove
7589 add_initial_output_section and overloaded add_output_section.
7590 Update declaration of remaining add_output_section.
7591 * layout.cc (Layout::create_interp): Call add_output_section
7592 rather than add_initial_output_section.
7593 (Layout::finish_dynamic_section): Likewise.
7594
497897f9
ILT
7595 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
7596 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
7597 know the dynamic type.
7598 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
7599 field. Initialize it in constructor.
7600 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
7601 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
7602 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
7603 reloc.
7604
a984ee1d
ILT
7605 * output.cc (Output_reloc::get_address): Change return type to
7606 Elf_Addr.
7607 * output.h (class Output_reloc): Update get_address declaration.
7608 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
7609 for section addresses.
7610
55ba0940
ILT
76112008-05-09 Ian Lance Taylor <iant@google.com>
7612
7613 PR 6493
7614 * gold.cc (gold_nomem): Use return value of write.
7615
75517b77
ILT
76162008-05-08 Ian Lance Taylor <iant@google.com>
7617
7618 * symtab.c (Symbol::init_base_output_data): Add version
7619 parameter. Change all callers.
7620 (Symbol::init_base_output_segment): Likewise.
7621 (Symbol::init_base_constant): Likewise.
7622 (Symbol::init_base_undefined): Likewise.
7623 (Sized_symbol::init_output_data): Likewise.
7624 (Sized_symbol::init_output_segment): Likewise.
7625 (Sized_symbol::init_constant): Likewise.
7626 (Sized_symbol::init_undefined): Likewise.
7627 (Symbol_table::do_define_in_output_data): If the new symbol has a
7628 version, mark it as the default.
7629 (Symbol_table::do_define_in_output_segment): Likewise.
7630 (Symbol_table::do_define_as_constant): Likewise.
7631 * symtab.h (class Symbol): Update declarations.
7632 (class Sized_symbol): Likewise.
7633 * resolve.cc (Symbol::override_version): New function.
c42e122e 7634 (Symbol::override_base): Call override_version.
75517b77
ILT
7635 (Symbol::override_base_with_special): Likewise.
7636 * testsuite/ver_script_8.script: New file.
7637 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
7638 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
7639 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
7640 (ver_test_8_1.so, ver_test_8_2.so): New targets.
7641
f1f70eae
ILT
76422008-05-06 Ian Lance Taylor <iant@google.com>
7643
f3e9c5c5
ILT
7644 PR 6049
7645 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
7646 functions.
7647 (class General_options): Remove existing --undefined, and add
7648 --no-undefined instead. Add new --undefined as synonym for -u.
7649 * archive.cc (Archive::add_symbols): Check whether symbol was
7650 named with -u.
7651 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
7652 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
7653 all uses. Add IS_UNDEFINED. Update declarations to split
7654 different versions of init_base. Declare init_base_undefined.
7655 (Symbol::is_defined): Handle IS_UNDEFINED.
7656 (Symbol::is_undefined): Likewise.
7657 (Symbol::is_weak_undefined): Call is_undefined.
7658 (Symbol::is_absolute): Handle IS_CONSTANT.
7659 (class Sized_symbol): Update declarations to split different
7660 versions of init. Declare init_undefined.
7661 (class Symbol_table): Declare new functions.
7662 * symtab.cc (Symbol::init_base_object): Rename from init_base.
7663 Change all callers.
7664 (Symbol::init_base_output_data): Likewise.
7665 (Symbol::init_base_output_segment): Likewise.
7666 (Symbol::init_base_constant): Likewise.
7667 (Symbol::init_base_undefined): New function.
7668 (Sized_symbol::init_object): Rename from init. Change all
7669 callers.
7670 (Sized_symbol::init_output_data): Likewise.
7671 (Sized_symbol::init_output_segment): Likewise.
7672 (Sized_symbol::init_constant): Likewise.
7673 (Sized_symbol::init_undefined): New function.
7674 (Symbol_table::add_undefined_symbols_from_command_line): New
7675 function.
7676 (Symbol_table::do_add_undefined_symbols_from_command_line): New
7677 function.
7678 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
7679 (Symbol::output_section): Likewise.
7680 (Symbol::set_output_section): Likewise.
7681 (Symbol_table::sized_finalize_symbol): Likewise.
7682 (Symbol_table::sized_write_globals): Likewise.
7683 * resolve.cc (Symbol_table::should_override): Likewise.
7684 (Symbol::override_base_with_special): Likewise.
7685
8bdcdf2c
ILT
7686 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
7687 symbol, change it to have default visibility.
7688 * testsuite/protected_1.cc: New file.
7689 * testsuite/protected_2.cc: New file.
7690 * testsuite/protected_3.cc: New file.
7691 * testsuite/protected_main_1.cc: New file.
7692 * testsuite/protected_main_2.cc: New file.
7693 * testsuite/protected_main_3.cc: New file.
7694 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
7695 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
7696 (protected_1_LDFLAGS, protected_1_LDADD): Define.
7697 (protected_1.so): New target.
7698 (protected_1_pic.o, protected_2_pic.o): New targets.
7699 (protected_3_pic.o): New target.
7700 (check_PROGRAMS): Add protected_2.
7701 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
7702 (protected_2_LDFLAGS, protected_2_LDADD): Define.
7703 * testsuite/Makefile.in: Rebuild.
7704
2b706932
ILT
7705 * options.h (DEFINE_var): Add set_user_set_##varname__.
7706 (DEFINE_bool_alias): New macro.
7707 (class General_options): Define -Bstatic using DEFINE_bool_alias
7708 rather than DEFINE_special. Add --undefined as an alias for -z
7709 defs.
7710 * options.cc (General_options::parse_Bstatic): Remove.
7711
d82a5bcc
ILT
7712 * options.h (class General_options): Add --fatal-warnings.
7713 * main.cc (main): Implement --fatal-warnings.
7714 * errors.h (Errors::warning_count): New function.
7715
f1f70eae
ILT
7716 * options.h (class General_options): Add -Bsymbolic-functions.
7717 * symtab.h (Symbol::is_preemptible): Check for
7718 -Bsymbolic-functions.
7719
8825ac63
ILT
77202008-05-05 Ian Lance Taylor <iant@google.com>
7721
d98bc257
ILT
7722 * options.h (DEFINE_bool): For DASH_Z, create the negative option
7723 as noVARNAME rather than no-VARNAME.
7724 (class General_options): Add option -z combreloc.
7725 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
7726 get_address.
7727 (Output_reloc::sort_before) [SHT_REL]: New function.
7728 (Output_reloc::sort_before) [SHT_RELA]: New function.
7729 (class Output_data_reloc_base): Add sort_relocs_ field. Define
7730 Sort_relocs_comparison.
7731 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
7732 parameter. Change all callers.
7733 (Output_data_reloc::Output_data_reloc) [both versions]: Add
7734 sort_relocs parameter. Change all callers.
7735 * output.cc (Output_reloc::get_address): New function, broken out
7736 of write_rel.
7737 (Output_reloc::write_rel): Call it.
7738 (Output_reloc::compare): New function.
7739 (Output_data_reloc_base::do_write): Optionally sort relocs.
7740
60b2b4e7
ILT
7741 * configure.ac: If targ_extra_obj is set, link it in.
7742 * configure.tgt: Initialize all variables.
7743 (x86_64*): Set targ_extra_obj and targ_extra_size.
7744 * configure: Rebuild.
7745
8825ac63
ILT
7746 * object.cc (Sized_relobj::include_section_group): Adjust section
7747 indexes read from group data. Build vector to pass to
7748 layout_group.
7749 * layout.cc (Layout::layout_group): Add flags and shndxes
7750 parameters. Remove contents parameter. Change caller. Update
7751 explicit instantiations.
7752 * layout.h (class Layout): Update layout_group declaration.
7753 * output.cc (Output_data_group::Output_data_group): Add flags and
7754 input_shndxes parameters. Remove contents parameter. Change
7755 caller.
7756 (Output_data_group::do_write): Change input_sections_ to
7757 input_shndxes_.
7758 * output.h (class Output_data_group): Update constructor
7759 declaration. Rename input_sections_ to input_shndxes_.
7760 * testsuite/many_sections_test.cc: Add template.
7761
e94cf127
CC
77622008-04-30 Cary Coutant <ccoutant@google.com>
7763
4418b2d5
CC
7764 * target-reloc.h (relocate_section): Fix dead-pointer bug.
7765
e94cf127
CC
7766 * layout.cc (Layout::include_section): Refactored check for debug
7767 info section.
7768 (Layout::add_comdat): Add new parameters. Change type
7769 of signature parameter. Add object and shndx to signatures table.
7770 (Layout::find_kept_object): New function.
7771 * layout.h: Include <cstring>.
7772 (Layout::is_debug_info_section): New function.
7773 (Layout::add_comdat): Add new parameters.
7774 (Layout::find_kept_object): New function.
7775 (Layout::Kept_section): New struct.
7776 (Layout::Signatures): Change type of map range.
7777 * object.cc (Relobj::output_section_address): New function.
7778 (Sized_relobj::include_section_group): Add new parameters. Change
7779 calls to Layout::add_comdat. Change to build table of kept comdat
7780 groups and table mapping discarded sections to kept sections.
7781 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
7782 (Sized_relobj::do_layout): Change calls to include_section_group and
7783 include_linkonce_section.
7784 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
7785 value to zero when section is discarded.
7786 (Sized_relobj::map_to_kept_section): New function.
7787 * object.h (Relobj::output_section_address): New function.
7788 (Relobj::Comdat_group): New type.
7789 (Relobj::find_comdat_group): New function.
7790 (Relobj::Comdat_group_table): New type.
7791 (Relobj::Kept_comdat_section): New type.
7792 (Relobj::Kept_comdat_section_table): New type.
7793 (Relobj::add_comdat_group): New function.
7794 (Relobj::set_kept_comdat_section): New function.
7795 (Relobj::get_kept_comdat_section): New function.
7796 (Relobj::comdat_groups_): New field.
7797 (Relobj::kept_comdat_sections_): New field.
7798 (Symbol_value::input_value): Update comment.
7799 (Sized_relobj::map_to_kept_section) New function.
7800 (Sized_relobj::include_linkonce_section): Add new parameter.
7801 * target-reloc.h (Comdat_behavior): New type.
7802 (get_comdat_behavior): New function.
7803 (relocate_section): Add code to map a discarded section to the
7804 corresponding kept section when applying a relocation.
7805
e4e5049b
CS
78062008-04-30 Craig Silverstein <csilvers@google.com>
7807
7808 * dwarf_reader.cc (next_generation_count): New static var.
7809 (Addr2line_cache_entry): New struct.
7810 (addr2line_cache): New static var.
7811 (Dwarf_line_info::one_addr2line): Added caching.
7812 (Dwarf_line_info::clear_addr2line_cache): New function.
7813 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
7814 cache-size parameter.
7815 (Dwarf_line_info::one_addr2line_cache): New function.
7816 * symtab.cc (Symbol_table::detect_odr_violations): Pass
7817 new cache-size argument to one_addr2line(), and clear cache.
7818
d09e9154
CC
78192008-04-28 Cary Coutant <ccoutant@google.com>
7820
7821 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
7822 R_386_PC8 relocations.
7823
7ef73768
ILT
78242008-04-23 Ian Lance Taylor <iant@google.com>
7825
55438702
ILT
7826 * object.cc (Sized_relobj::include_section_group): Check for
7827 invalid section group.
7828
c165fb93
ILT
7829 * object.cc (make_elf_object): Correct test for 64-bit ELF file
7830 header size.
7831
7ef73768
ILT
7832 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
7833 than read for file header.
7834 * archive.cc (Archive::include_member): Likewise.
7835
6194aaab
L
78362008-04-23 Paolo Bonzini <bonzini@gnu.org>
7837
7838 * aclocal.m4: Regenerate.
7839 * configure: Regenerate.
7840
d491d34e
ILT
78412008-04-19 Ian Lance Taylor <iant@google.com>
7842
5ea2bac6
ILT
7843 * version.cc (version_string): Bump to 1.6.
7844
7bc3e21a
ILT
7845 * testsuite/Makefile.am (many_sections_r_test): New target.
7846 (many_sections_r_test_SOURCES): Remove.
7847 (many_sections_r_test_DEPENDENCIES): Remove.
7848 (many_sections_r_test_LDFLAGS): Remove.
7849 (many_sections_r_test_LDADD): Remove.
7850
7fcd3aa9
ILT
7851 * object.cc (Sized_relobj::do_add_symbols): Always pass
7852 local_symbol_count_ to add_from_relobj.
7853
4c94d6ae
ILT
7854 * testsuite/Makefile.am (many_sections_check.h): Only check one in
7855 every thousand variables.
7856 * testsuite/Makefile.in: Rebuild.
7857
d491d34e
ILT
7858 * object.cc (Xindex::initialize_symtab_xindex): New function.
7859 (Xindex::read_symtab_xindex): New function.
7860 (Xindex::sym_xindex_to_shndx): New function.
7861 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
7862 available.
7863 (Sized_relobj::do_initialize_xindex): New function.
7864 (Sized_relobj::do_read_symbols): Adjust section links.
7865 (Sized_relobj::symbol_section_and_value): Add is_ordinary
7866 parameter. Change all callers.
7867 (Sized_relobj::include_section_group): Adjust section links and
7868 symbol section indexes.
7869 (Sized_relobj::do_layout): Adjust section links.
7870 (Sized_relobj::do_count_local_symbols): Adjust section links and
7871 symbol section indexes.
7872 (Sized_relobj::do_finalize_local_symbols): Distinguish between
7873 ordinary and special symbols.
7874 (Sized_relobj::write_local_symbols): Add symtab_xindex and
7875 dynsym_xindex parameters. Change all callers. Adjust section
7876 links. Use SHN_XINDEX when needed.
7877 (Sized_relobj::get_symbol_location_info): Adjust section links.
7878 Don't get fooled by special symbols.
7879 * object.h (class Xindex): Define.
7880 (class Object): Add xindex_ parameter. Declare virtual functoin
7881 do_initialize_xindex.
7882 (Object::adjust_sym_shndx): New function.
7883 (Object::set_xindex): New protected function.
7884 (class Symbol_value): Add is_ordinary_shndx_ field.
7885 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
7886 (Symbol_value::value): Assert ordinary section.
7887 (Symbol_value::initialize_input_to_output_map): Likewise.
7888 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
7889 Change all callers.
7890 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
7891 all callers.
7892 (class Sized_relobj): Update declarations.
7893 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
7894 parameter. Change all callers.
7895 (Sized_relobj::adjust_shndx): New function.
7896 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
7897 field.
7898 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
7899 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
7900 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
7901 (Sized_dynobj::read_dynsym_section): Adjust section links.
7902 (Sized_dynobj::read_dynamic): Likewise.
7903 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
7904 section links.
7905 (Sized_dynobj::do_initialize_xindex): New function.
7906 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
7907 do_initialize_xindex.
7908 (Sized_dynobj::adjust_shndx): New function.
7909 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
7910 dynsym_xindex_ fields.
7911 (Layout::finalize): Add a call to set_section_indexes before
7912 creating the symtab sections.
7913 (Layout::set_section_indexes): Don't do anything if the section
7914 already has a section index.
7915 (Layout::create_symtab_sections): Add shnum parameter. Change
7916 caller. Create .symtab_shndx section if needed.
7917 (Layout::create_shdrs): Add shstrtab_section parameter. Change
7918 caller.
7919 (Layout::allocated_output_section_count): New function.
7920 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
7921 needed.
7922 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
7923 fields. Update declarations.
7924 (Layout::symtab_xindex): New function.
7925 (Layout::dynsym_xindex): New function.
7926 (class Write_symbols_task): Add layout_ field.
7927 (Write_symbols_task::Write_symbols_task): Add layout parameter.
7928 Change caller.
7929 * output.cc (Output_section_headers::Output_section_headers): Add
7930 shstrtab_section parameter. Change all callers.
7931 (Output_section_headers::do_sized_write): Store overflow values
7932 for section count and section string table section index in
7933 section header zero.
7934 (Output_file_header::do_sized_write): Check for overflow of
7935 section count and section string table section index.
7936 (Output_symtab_xindex::do_write): New function.
7937 (Output_symtab_xindex::endian_do_write): New function.
7938 * output.h (class Output_section_headers): Add shstrtab_section_.
7939 Update declarations.
7940 (class Output_symtab_xindex): Define.
7941 (Output_section::has_out_shndx): New function.
7942 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
7943 field.
7944 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
7945 Change all callers.
7946 (Sized_symbol::init): Likewise.
7947 (Symbol::output_section): Check for ordinary symbol.
7948 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
7949 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
7950 callers.
7951 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
7952 Change all callers. Simplify handling of symbols from sections
7953 not included in the link.
7954 (Symbol_table::add_from_dynobj): Handle ordinary symbol
7955 distinction.
7956 (Weak_alias_sorter::operator()): Assert that symbols are
7957 ordinary.
7958 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
7959 distinction.
7960 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
7961 parameters. Change all callers.
7962 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
7963 symbol distinction. Use SHN_XINDEX when needed.
7964 (Symbol_table::write_section_symbol): Add symtab_xindex
7965 parameter. Change all callers.
7966 (Symbol_table::sized_write_section_symbol): Likewise. Use
7967 SHN_XINDEX when needed.
7968 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
7969 declarations.
7970 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
7971 (Symbol::is_defined): Check is_ordinary.
7972 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
7973 (Symbol::is_absolute, Symbol::is_common): Likewise.
7974 (class Sized_symbol): Update declarations.
7975 (class Symbol_table): Update declarations.
7976 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
7977 parameters. Change all callers.
7978 (Sized_symbol::override): Likewise.
7979 (Symbol_table::override): Likewise.
7980 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
7981 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
7982 is_ordinary, and orig_st_shndx parameters. Change all callers.
7983 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
7984 to be in an ordinary section.
7985 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
7986 object and is_ordinary parameters. Change all callers.
7987 (Sized_dwarf_line_info::read_relocs): Add object parameter.
7988 Change all callers. Don't add undefined or non-ordinary symbols
7989 to reloc_map_.
7990 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
7991 Change all callers.
7992 * dwarf_reader.h (class Sized_dwarf_line_info): Update
7993 declarations.
7994 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
7995 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
7996 (Sized_relobj::relocate_sections): Likewise.
7997 * target-reloc.h (scan_relocs): Adjust section symbol index.
7998 (scan_relocatable_relocs): Likewise.
7999 * i386.cc (Scan::local): Check for ordinary symbols.
8000 * sparc.cc (Scan::local): Likewise.
8001 * x86_64.cc (Scan::local): Likewise.
8002 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
8003 to symbol_section_and_value.
8004 * testsuite/many_sections_test.cc: New file.
8005 * testsuite/Makefile.am (BUILT_SOURCES): Define.
8006 (check_PROGRAMS): Add many_sections_test.
8007 (many_sections_test_SOURCES): Define.
8008 (many_sections_test_DEPENDENCIES): Define.
8009 (many_sections_test_LDFLAGS): Define.
8010 (BUILT_SOURCES): Add many_sections_define.h.
8011 (many_sections_define.h): New target.
8012 (BUILT_SOURCES): Add many_sections_check.h.
8013 (many_sections_check.h): New target.
8014 (check_PROGRAMS): Add many_sections_r_test.
8015 (many_sections_r_test_SOURCES): Define.
8016 (many_sections_r_test_DEPENDENCIES): Define.
8017 (many_sections_r_test_LDFLAGS): Define.
8018 (many_sections_r_test_LDADD): Define.
8019 (many_sections_r_test.o): New target.
8020 * testsuite/Makefile.in: Rebuild.
8021
c5818ff1
CC
80222008-04-17 Cary Coutant <ccoutant@google.com>
8023
8024 * errors.cc (Errors::info): New function.
8025 (gold_info): New function.
8026 * errors.h (Errors::info): New function.
8027 * gold.h (gold_info): New function.
8028 * object.cc (Input_objects::add_object): Print trace output.
8029 * options.cc (options::parse_set): New function.
8030 (General_options::parse_wrap): Deleted.
8031 (General_options::General_options): Deleted initializer.
8032 * options.h (options::String_set): New typedef.
8033 (options::parse_set): New function.
8034 (DEFINE_set): New macro.
8035 (General_options::wrap): Changed to use DEFINE_set. Changed
8036 callers of any_wrap_symbols and is_wrap_symbol.
8037 (General_options::trace, General_options::trace_symbol):
8038 New options.
8039 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
8040 (General_options::wrap_symbols_): Deleted.
8041 * symtab.cc (Symbol_table::add_from_object): Print trace output.
8042
b5be4a7c
DM
80432008-04-17 David S. Miller <davem@davemloft.net>
8044
8045 * options.cc (General_options::parse_V): New function.
8046 * options.h: Add entries for -V and -Qy.
8047
155a0dd7
ILT
80482008-04-17 Ian Lance Taylor <iant@google.com>
8049
8050 * common.cc (Symbol_table::allocate_commons): Remove options
8051 parameter. Change caller.
8052 (Symbol_table::do_allocate_commons): Remove options parameter.
8053 Change caller. Just call do_allocate_commons_list twice.
8054 (Symbol_table::do_allocate_commons_list): New function, broken out
8055 of do_allocate_commons.
8056 * common.h (class Allocate_commons_task): Remove options_ field.
8057 Update constructor.
8058 * symtab.cc (Symbol_table::Symbol_table): Initialize
8059 tls_commons_.
8060 (Symbol_table::add_from_object): Put TLS common symbols on
8061 tls_commons_ list.
8062 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
8063 which are IN_OUTPUT_DATA.
8064 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
8065 allocate_commons and do_allocate_commons declarations. Declare
8066 do_allocate_commons_list.
8067 * gold.cc (queue_middle_tasks): Update creation of
8068 Allocate_commons_task to not pass options.
8069 * testsuite/Makefile.am (INCLUDES): Add -I.. .
8070 (TLS_TEST_C_FLAGS): New variable.
8071 (tls_test_c_pic.o): New target.
8072 (tls_test_shared.so): Link in tls_test_c_pic.o.
8073 (tls_test_c_pic_ie.o): New target.
8074 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
8075 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
8076 (tls_test_c.o): New target.
8077 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
8078 (tls_pic_test_LDADD): Likewise.
8079 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
8080 (tls_shared_gd_to_ie_test_LDADD): Likewise.
8081 (tls_test_c_gnu2.o): New target.
8082 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
8083 tls_test_c_gnu2.o.
8084 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
8085 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
8086 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
8087 * testsuite/tls_test.cc: Include "config.h".
8088 (t_last): Call t11_last.
8089 * testsuite/tls_test.h (t11, t11_last): Declare.
8090 * testsuite/tls_test_c.c: New file.
8091 * testsuite/tls_test_main.cc (thread_routine): Call t11.
8092 * configure.ac: Check for OpenMP support.
8093 * configure, config.in, Makefile.in: Rebuild.
8094 * testsuite/Makefile.in: Rebuild.
8095
edfbb029
CC
80962008-04-16 Cary Coutant <ccoutant@google.com>
8097
8098 * i386.cc (Target_i386::define_tls_base_symbol): New function.
8099 (Target_i386::tls_base_symbol_defined_): New field.
8100 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
8101 (Target_i386::Scan::global): Likewise.
8102 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
8103 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
8104 (Target_x86_64::tls_base_symbol_defined_): New field.
8105 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
8106 (Target_x86_64::Scan::global): Likewise.
8107
f3c69fca
CC
81082008-04-16 Cary Coutant <ccoutant@google.com>
8109
8110 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
8111 (Symbol::needs_plt_entry): Allow weak undefined symbols.
8112 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
8113 building shared libraries.
8114 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
8115 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
8116 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
8117 * testsuite/Makefile.in: Rebuild.
8118 * testsuite/weak_undef.h: New file.
8119 * testsuite/weak_undef_file1.cc: Add extra test cases.
8120 * testsuite/weak_undef_file2.cc: Likewise.
8121 * testsuite/weak_undef_test.cc: Likewise.
8122
7c414435
DM
81232008-04-16 David S. Miller <davem@davemloft.net>
8124
32b769e1
DM
8125 * sparc.cc (Target_sparc::Scan): Change from struct to class.
8126 Add issued_non_pic_error_ field. Declare check_non_pic.
8127 (Target_sparc::Scan::check_non_pic): New function.
8128 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
8129 (Target_sparc::Scan::global): Likewise.
8130
11936fb1
DM
8131 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
8132 * configure: Rebuild.
8133
7c414435
DM
8134 * options.h (DEFINE_enable): New macro.
8135 (new_dtags): New enable option.
8136 (initfirst, interpose, loadfltr, nodefaultlib,
8137 nodelete, nodlopen, nodump): New -z options.
8138 * layout.cc (Layout:finish_dynamic_section): If new
8139 dtags enabled, emit DT_RUNPATH. Also, emit a
8140 DT_FLAGS_1 containing any specified -z flags.
8141
85c7bf8b
ILT
81422008-04-16 Ian Lance Taylor <iant@google.com>
8143
12c0daef
ILT
8144 * copy-relocs.cc: New file.
8145 * copy-relocs.h: New file.
8146 * reloc.cc: Remove Copy_relocs code.
8147 * reloc.h: Likewise.
8148 * reloc-types.h (struct Reloc_types) [both versions]: Add
8149 get_reloc_addend_noerror.
8150 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
8151 variants of add_global which take an addend which must be zero.
8152 * i386.cc: Include "copy-relocs.h".
8153 (class Target_i386): Change type of copy_relocs_ to variable,
8154 update initializer.
8155 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
8156 Change all callers.
8157 (Target_i386::do_finalize_sections): Change handling of
8158 copy_relocs_.
8159 * sparc.cc: Include "copy-relocs.h".
8160 (class Target_sparc): Change type of copy_relocs_ to variable,
8161 update initializer.
8162 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
8163 Change all callers.
8164 (Target_sparc::do_finalize_sections): Change handling of
8165 copy_relocs_.
8166 * x86_64.cc: Include "copy-relocs.h".
8167 (class Target_x86_64): Change type of copy_relocs_ to variable,
8168 update initializer.
8169 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
8170 class. Change all callers.
8171 (Target_x86_64::do_finalize_sections): Change handling of
8172 copy_relocs_.
8173 * Makefile.am (CCFILES): Add copy-relocs.cc.
8174 (HFILES): Add copy-relocs.h.
8175
4f4995b6
ILT
8176 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
8177
85c7bf8b
ILT
8178 * testsuite/script_test_4.sh: Permit leading zeroes.
8179
4f2a9edd
ILT
81802008-04-15 Ian Lance Taylor <iant@google.com>
8181
e6188289
ILT
8182 * script-sections.cc (Script_sections::create_segments): Use
8183 header_size_adjustment even when there is enough room for the
8184 headers.
8185 * testsuite/script_test_4.sh: New file.
8186 * testsuite/script_test_4.t: New file.
8187 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
8188 (check_DATA): Add script_test_4.stdout.
8189 (MOSTLYCLEANFILES): Likewise.
8190 (script_test_4): New target.
8191 (script_test_4.stdout): New target.
8192 * testsuite/Makefile.in: Rebuild.
8193
4f2a9edd
ILT
8194 * sparc.cc: Add definitions for Output_data_plt_sparc class
8195 constants.
8196
f5314dd5
DM
81972008-04-14 David S. Miller <davem@davemloft.net>
8198
8199 * sparc.cc: New file.
8200 * Makefile.am (TARGETSOURCES): Add sparc.cc
8201 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
8202 * configure.tgt: Document targ_extra_size and
8203 targ_extra_big_endian. Add entries for sparc-* and
8204 sparc64-*.
8205 * configure.ac: Handle targ_extra_size and
8206 targ_extra_big_endian.
8207 * Makefile.in: Rebuild.
8208 * configure: Likewise.
8209 * po/POTFILES.in: Likewise.
8210 * po/gold.pot: Likewise.
8211
154e0e9a
ILT
82122008-04-14 Ian Lance Taylor <iant@google.com>
8213
8214 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
8215 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
8216 in the name/type/flags to section mapping. Don't call
8217 allocate_output_section.
8218 (Layout::choose_output_section): Change parameter from adjust_name
8219 to is_input_section. Don't permit input sections after sections
8220 are attached to segments. Don't call allocate_output_section.
8221 (Layout::layout_eh_frame): Call update_flags_for_input_section,
8222 not write_enable_output_section.
8223 (Layout::make_output_section): Don't push to
8224 unattached_section_list_ nor call attach_to_segment. Call
8225 attach_section_to_segment if sections are attached.
8226 (Layout::attach_sections_to_segments): New function.
8227 (Layout::attach_section_to_segment): New function.
8228 (Layout::attach_allocated_section_to_segment): Rename from
8229 attach_to_segment. Remove flags parameter.
8230 (Layout::allocate_output_section): Remove function.
8231 (Layout::write_enable_output_section): Remove function.
8232 * layout.h (class Layout): Update for above changes. Add new
8233 field sections_are_attached_.
8234 * output.h (Output_section::update_flags_for_input_section): New
8235 function.
8236 * output.cc (Output_section::add_input_section): Call
8237 update_flags_for_input_section.
8238 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
8239
009a67a2
CC
82402008-04-11 Cary Coutant <ccoutant@google.com>
8241
8242 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
8243 thought unnecessary.
8244 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
8245
759b1a24
ILT
82462008-04-11 Ian Lance Taylor <iant@google.com>
8247
8248 * output.h (class Output_section_data): Remove inline definition
8249 of set_addralign.
8250 * output.cc (Output_section_data::set_addralign): New function.
8251
c2b45e22
CC
82522008-04-11 Cary Coutant <ccoutant@google.com>
8253
8254 Add support for TLS descriptors for i386 and x86_64.
8255 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
8256 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
8257 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
8258 GOT_TYPE_TLS_DESC.
8259 (Target_i386::got_mod_index_entry): Remove unnecessary code.
8260 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
8261 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
8262 relocations.
8263 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
8264 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
8265 Fix problem with initial-exec relocations.
8266 (Target_i386::Relocate::relocate_tls): Likewise.
8267 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
8268 relaxation.
8269 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
8270 support for section-plus-offset dynamic table entries.
8271 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
8272 (Output_data_dynamic::Dynamic_entry): Add support for
8273 section-plus-offset dynamic table entries.
8274 (Output_data_dynamic::Classification): Likewise.
8275 (Output_data_dynamic::classification_): Renamed offset_.
8276 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
8277 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
8278 (Target_x86_64::make_plt_section): New function.
8279 (Target_x86_64::reserve_tlsdesc_entries): New function.
8280 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
8281 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
8282 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
8283 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
8284 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
8285 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
8286 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
8287 add extra PLT entry for TLS descriptors.
8288 (Output_data_plt_x86_64::got_): New field.
8289 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
8290 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
8291 fields.
8292 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
8293 descriptors.
8294 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
8295 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
8296 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
8297 R_386_TLS_DESC_CALL relocations.
8298 (Target_x86_64::Scan::global): Likewise.
8299 (Target_x86_64::do_finalize_sections): Add dynamic table entries
8300 for TLS descriptors.
8301 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
8302 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
8303 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
8304 GD-to-IE relaxation.
8305 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
8306 and TLS_DESCRIPTORS.
8307 * Makefile.in: Rebuild.
8308 * configure: Rebuild.
8309 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
8310 (tls_test_shared2.so): New target.
8311 (tls_shared_gd_to_ie_test_SOURCES): New variable.
8312 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
8313 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
8314 (tls_shared_gd_to_ie_test_LDADD): New variable.
8315 (tls_shared_gnu2_gd_to_ie_test): New target.
8316 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
8317 New targets.
8318 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
8319 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
8320 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
8321 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
8322 (tls_shared_gnu2_test): New target.
8323 (tls_test_gnu2_shared.so): New target.
8324 (tls_shared_gnu2_test_SOURCES): New variable.
8325 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
8326 (tls_shared_gnu2_test_LDFLAGS): New variable.
8327 (tls_shared_gnu2_test_LDADD): New variable.
8328 * testsuite/Makefile.in: Rebuild.
8329 * testsuite/Makefile.
8330
83bfb6b7
ILT
83312008-04-11 Ian Lance Taylor <iant@google.com>
8332
8333 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
8334 justsyms.t.
8335 * testsuite/Makefile.in: Rebuild.
8336
8337 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
8338 long.
8339 * testsuite/script_test_2.cc (main): Adjust test.
8340
706e1f5e
ILT
83412008-04-11 David S. Miller <davem@davemloft.net>
8342 Ian Lance Taylor <iant@google.com>
8343
8344 * options.h (General_options): Add entries for '-Y' and
8345 '-relax'.
8346 * options.cc (General_options:finalize): If -Y was used, add those
8347 entries to the library path instead of the default "/lib" and
8348 "/usr/lib".
8349
7c98e6bb
DM
83502008-04-11 David S. Miller <davem@davemloft.net>
8351
8352 * testsuite/justsyms.t: Start at 0x100.
8353 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
8354 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
8355 long.
8356 * testsuite/script_test_2.cc: Adjust string and section length
8357 checks.
7c98e6bb 8358
99a37bfd
ILT
83592008-04-09 Ian Lance Taylor <iant@google.com>
8360
2cefc357
ILT
8361 PR gold/5996
8362 * script-sections.cc (Sections_element::allocate_to_segment): Add
8363 orphan parameter.
8364 (Output_section_definition::allocate_to_segment): Likewise.
8365 (Orphan_output_section::allocate_to_segment): Likewise.
8366 (Script_sections::attach_sections_using_phdrs_clause): Don't
8367 propagate non-PT_LOAD segments to orphan sections.
8368 * testsuite/Makefile.am (script_test_3.stdout): Generate using
8369 readelf rather than objdump.
8370 * testsuite/script_test_3.sh: Adjust accordingly. Test that
8371 .interp section and PT_INTERP segment are the same size.
8372 * testsuite/Makefile.in: Rebuild.
8373
99a37bfd
ILT
8374 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
8375 aliases for symbols defined in the same object.
8376 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
8377 (weak_alias_test_SOURCES): New variable.
8378 (weak_alias_test_DEPENDENCIES): New variable.
8379 (weak_alias_test_LDFLAGS): New variable.
8380 (weak_alias_test_LDADD): New variable.
8381 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
8382 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
8383 (weak_alias_test_3.o): New target.
8384 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
8385 * testsuite/weak_alias_test_main.cc: New file.
8386 * testsuite/weak_alias_test_1.cc: New file.
8387 * testsuite/weak_alias_test_2.cc: New file.
8388 * testsuite/weak_alias_test_3.cc: New file.
8389
780e49c5
ILT
83902008-04-08 Ian Lance Taylor <iant@google.com>
8391
cdb0b8f5
ILT
8392 * options.h (class General_options): Add --noinhibit-exec option.
8393 * main.cc (main): Check --noinhibit-exec.
8394
0864d551
ILT
8395 * options.h (class General_options): Define --wrap as a special
8396 option. Add wrap_symbols_ field.
8397 (General_options::any_wrap_symbols): New function.
8398 (General_options::is_wrap_symbol): New function.
8399 * options.cc (General_options::parse_wrap): New function.
8400 (General_options::General_options): Initialize wrap_symbols_.
8401 * symtab.cc (Symbol_table::wrap_symbol): New function.
8402 (Symbol_table::add_from_object): Handle --wrap.
8403 * symtab.h (class Symbol_table): Declare wrap_symbol.
8404 * target.h (Target::wrap_char): New function.
8405 (Target::Target_info): Add wrap_char field.
8406 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
8407 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
8408 * testsuite/testfile.cc (Target_test::test_target_info):
8409 Likewise.
8410
789aa6de
ILT
8411 * errors.cc (Errors::undefined_symbol): Mention symbol version if
8412 there is one.
8413
2c38906f
ILT
8414 * layout.h (class Layout): Add added_eh_frame_data_ field.
8415 * layout.cc (Layout::Layout): Initialize new field.
8416 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
8417 output section until we find a section we merged successfully.
8418 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
8419 that the size be non-zero.
8420
780e49c5
ILT
8421 * merge.cc (Object_merge_map::get_output_offset): Remove inline
8422 qualifier.
8423
7fcd0256
ILT
84242008-04-08 Craig Silverstein <csilvers@google.com>
8425
8426 * configure.ac: Export new conditional variable HAVE_ZLIB.
8427 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
8428 on HAVE_ZLIB.
8429 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
8430 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
8431
6835af53
ILT
84322008-04-07 Ian Lance Taylor <iant@google.com>
8433
e24f324c
ILT
8434 * version.cc (version_string): Set to "1.5".
8435
a036edd8
ILT
8436 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
8437 Add issued_non_pic_error_ field. Declare check_non_pic.
8438 (Target_x86_64::Scan::check_non_pic): New function.
8439 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
8440 (Target_x86_64::Scan::global): Likewise.
8441
624f8810
ILT
8442 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
8443 addend parameter. Change caller. Handle merge sections.
8444 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
8445 Address to Addend. Don't add in the result of
8446 local_section_offset, pass down the addend and use the returned
8447 value.
8448 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
8449 Update declarations of local_section_offset and symbol_value.
8450 * testsuite/two_file_test_1.cc (t18): New function.
8451 * testsuite/two_file_test_2.cc (f18): New function.
8452 * testsuite/two_file_test_main.cc (main): Call t18.
8453 * testsuite/two_file_test.h (t18, f18): Declare.
8454
6835af53
ILT
8455 * configure.ac: Don't test for objdump, c++filt, or readelf.
8456 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
8457 conditionals.
8458 (TEST_READELF): New variable.
8459 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
8460 (check_PROGRAMS): Add two_file_strip_test.
8461 (two_file_strip_test): New target.
8462 (check_PROGRAMS): Add two_file_same_shared_strip_test.
8463 (two_file_same_shared_strip_test_SOURCES): New variable.
8464 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
8465 (two_file_same_shared_strip_test_LDFLAGS): New variable.
8466 (two_file_same_shared_strip_test_LDADD): New variable.
8467 (two_file_shared_strip.so): New target.
8468 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
8469 (ver_test_5.syms, ver_test_7.syms): Likewise.
8470 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
8471 (strip_test_3.stdout): Use TEST_OBJDUMP.
8472 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
8473
86925eef
CC
84742008-04-04 Cary Coutant <ccoutant@google.com>
8475
8476 * symtab.h (Symbol::is_weak_undefined): New function.
8477 (Symbol::is_strong_undefined): New function.
8478 (Symbol::is_absolute): New function.
8479 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
8480 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
8481 absolute symbols.
8482 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
8483 (weak_undef_test): New target.
8484 * testsuite/Makefile.in: Rebuild.
8485 * testsuite/weak_undef_file1.cc: New file.
8486 * testsuite/weak_undef_file2.cc: New file.
8487 * testsuite/weak_undef_test.cc: New file.
8488
126f3ece
ILT
84892008-04-03 Craig Silverstein <csilvers@google.com>
8490
8491 * compressed_output.h (class Output_compressed_section): Use
8492 unsigned buffer.
8493 * compressed_output.cc (zlib_compress): Use unsigned buffers,
8494 add zlib header.
8495 (zlib_compressed_suffix): Removed.
8496 (Output_compressed_section::set_final_data_size): Use unsigned
8497 buffers.
8498 * testsuite/Makefile.am (flagstest_compress_debug_sections):
8499 Fix linker invocation.
8500 (flagstest_o_specialfile_and_compress_debug_sections):
8501 Likewise.
8502 * testsuite/Makefile.in: Regenerated.
8503
deae2a14
DM
85042008-04-02 David S. Miller <davem@davemloft.net>
8505
8506 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
8507 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
8508
70752818
ILT
85092008-04-02 Craig Silverstein <csilvers@google.com>
8510
8511 * TODO: New file.
8512
39d0cb0e
ILT
85132008-04-02 Ian Lance Taylor <iant@google.com>
8514
8515 * fileread.cc (File_read::find_view): Add byteshift and vshifted
8516 parameters. Update for new key type to views_. Change all
8517 callers.
8518 (File_read::read): Adjust for byteshift in returned view.
8519 (File_read::add_view): New function, broken out of
8520 find_and_make_view.
8521 (File_read::make_view): New function, broken out of
8522 find_and_make_view.
8523 (File_read::find_or_make_view): Add offset and aligned
8524 parameters. Rewrite accordingly. Change all callers.
8525 (File_read::get_view): Add offset and aligned parameters. Adjust
8526 for byteshift in return value.
8527 (File_read::get_lasting_view): Likewise.
8528 * fileread.h (class File_read): Update declarations.
8529 (class File_read::View): Add byteshift_ field. Add byteshift to
8530 constructor. Add byteshift method.
8531 * archive.h (Archive::clear_uncached_views): New function.
8532 (Archive::get_view): Add aligned parameter. Change all callers.
8533 * object.h (Object::get_view): Add aligned parameter. Change all
8534 callers.
8535 (Object::get_lasting_view): Likewise.
8536
8537 * fileread.cc (File_read::release): Don't call clear_views if
8538 there are multiple objects.
8539 * fileread.h (File_read::clear_uncached_views): New function.
8540 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
8541 on the archive.
8542
a1207466
CC
85432008-03-31 Cary Coutant <ccoutant@google.com>
8544
8545 Add thin archive support.
8546 * archive.cc (Archive::armagt): New const.
8547 (Archive::setup): Remove task parameter and calls to unlock.
8548 (Archive::unlock_nested_archives): New function.
8549 (Archive::read_header): Add nested_off parameter. Change
8550 all callers.
8551 (Archive::interpret_header): Likewise.
8552 (Archive::include_all_members): Change to handle thin
8553 archives.
8554 (Archive::include_member): Likewise.
8555 * archive.h (Archive::Archive): Add new parameters and
8556 initializers.
8557 (Archive::armagt): New const.
8558 (Archive::setup): Remove task parameter.
8559 (Archive::unlock_nested_archives): New function.
8560 (Archive::read_header): Add nested_off parameter.
8561 (Archive::interpret_header): Likewise.
8562 (Archive::Nested_archive_table): New typedef.
8563 (Archive::is_thin_archive_): New field.
8564 (Archive::nested_archives_): New field.
8565 (Archive::options_): New field.
8566 (Archive::dirpath_): New field.
8567 (Archive::task_): New field.
8568 * readsyms.cc (Read_symbols::do_read_symbols): Add check
8569 for thin archives. Pass additional parameters to
8570 Archive::Archive. Unlock the archive file after calling
8571 Archive::setup.
cd536b21 8572
479f6503
ILT
85732008-03-29 Ian Lance Taylor <iant@google.com>
8574
686c8caf
ILT
8575 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
8576 version symbol to be local.
8577 * testsuite/ver_test_4.sh: New file.
8578 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
8579 (check_DATA): Add ver_test_4.syms.
8580 (ver_test_4.syms): New target.
8581 * testsuite/Makefile.in: Rebuild.
8582
ab794b6b
ILT
8583 * output.cc
8584 (Output_section::Input_section_sort_entry::has_priority): New
8585 function.
8586 (Output_section::Input_section_sort_entry::match_file_name): New
8587 function.
8588 (Output_section::Input_section_sort_entry::match_section_name):
8589 Remove.
8590 (Output_section::Input_section_sort_entry::match_section_name_prefix):
8591 Remove.
8592 (Output_section::Input_section_sort_entry::match_section_file):
8593 Remove.
8594 (Output_section::Input_section_sort_compare::operator()): Rewrite
8595 using new Input_section_sort_entry functions. Sort crtbegin and
8596 crtend first. Sort sections with no priority before sections with
8597 a priority.
8598 * testsuite/initpri1.c (d3): Check j != 4.
8599 (cd5): New constructor/destructor function.
8600 (main): Check j != 2.
8601
479f6503
ILT
8602 * symtab.cc (Symbol_table::add_from_object): If we don't use the
8603 new symbol when resolving, don't call set_is_default.
8604 * testsuite/ver_test_7.cc: New file.
8605 * testsuite/ver_test_7.sh: New file.
8606 * testsuite/Makefile.am (ver_test_7.so): New target.
8607 (ver_test_7.o): New target.
8608 (check_SCRIPTS): Add ver_test_7.sh.
8609 (check_DATA): Add ver_test_7.syms.
8610 (ver_test_7.syms): New target.
8611
2fd32231
ILT
86122008-03-28 Ian Lance Taylor <iant@google.com>
8613
8614 * layout.cc (Layout::layout): If we see an input section with a
8615 name that needs sorting, set the must_sort flag for the output
8616 section.
8617 (Layout::make_output_section): If the name of the output section
8618 indicates that it might require sorting, set the may_sort flag.
8619 * output.h (Output_section::may_sort_attached_input_sections): New
8620 function.
8621 (Output_section::set_may_sort_attached_input_sections): New
8622 function.
8623 (Output_section::must_sort_attached_input_sections): New
8624 function.
8625 (Output_section::set_must_sort_attached_input_sections): New
8626 function.
8627 (class Output_section): Declare Input_section_sort_entry. Define
8628 Input_section_sort_compare. Declare
8629 sort_attached_input_sections. Add new fields:
8630 may_sort_attached_input_sections_,
8631 must_sort_attached_input_sections_,
8632 attached_input_sections_are_sorted_.
8633 * output.cc (Output_section::Output_section): Initialize new
8634 fields.
8635 (Output_section::add_input_section): Add an entry to
8636 input_sections_ if may_sort or must_sort are true.
8637 (Output_section::set_final_data_size): Call
8638 sort_attached_input_sections if necessary.
8639 (Output_section::Input_section_sort_entry): Define new class.
8640 (Output_section::Input_section_sort_compare::operator()): New
8641 function.
8642 (Output_section::sort_attached_input_sections): New function.
8643 * configure.ac: Check whether the compiler supports constructor
8644 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
8645 * testsuite/initpri1.c: New file.
8646 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
8647 CONSTRUCTOR_PRIORITY.
8648 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
8649 (initpri1_LDFLAGS): New variable.
8650 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
8651
18e6b24e
ILT
86522008-03-27 Ian Lance Taylor <iant@google.com>
8653
49bdd526
ILT
8654 * common.cc (Sort_commons::operator): Correct sorting algorithm.
8655 * testsuite/common_test_1.c: New file.
8656 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
8657 (common_test_1_SOURCES): New variable.
8658 (common_test_1_DEPENDENCIES): New variable.
8659 (common_test_1_LDFLAGS): New variable.
8660
18e6b24e
ILT
8661 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
8662 and commons_ correctly when NAME/VERSION does not override
8663 NAME/NULL.
8664 * testsuite/ver_test_6.c: New file.
8665 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
8666 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
8667 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
8668
04bf7072
ILT
86692008-03-26 Ian Lance Taylor <iant@google.com>
8670
5871526f
ILT
8671 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
8672 of an undefined symbol from a version script.
8673 * testsuite/Makefile.am (ver_test_5.so): New target.
8674 (ver_test_5.o): New target.
8675 (check_SCRIPTS): Add ver_test_5.sh.
8676 (check_DATA): Add ver_test_5.syms.
8677 (ver_test_5.syms): New target.
8678 * testsuite/ver_test_5.cc: New file.
8679 * testsuite/ver_test_5.script: New file.
8680 * testsuite/ver_test_5.sh: New file.
8681 * Makefile.in, testsuite/Makefile.in: Rebuild.
8682
04bf7072
ILT
8683 PR gold/5986
8684 Fix problems building gold with gcc 4.3.0.
8685 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
8686 (gold_error_at_location, gold_warning_at_location): Use it.
8687 * configure.ac: Check whether we can compile and use a template
8688 function with a printf attribute.
8689 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
8690 when jumping over bytes.
8691 * object.cc: Instantiate Object::read_section_data.
8692 * debug.h: Include <cstring>
8693 * dwarf_reader.cc: Include <algorithm>
8694 * main.cc: Include <cstring>.
8695 * options.cc: Include <cstring>.
8696 * output.cc: Include <cstring>.
8697 * script.cc: Include <cstring>.
8698 * script.h: Include <string>.
8699 * symtab.cc: Include <cstring> and <algorithm>.
8700 * target-select.cc: Include <cstring>.
8701 * version.cc: Include <string>.
8702 * testsuite/testmain.cc: Include <cstdlib>.
8703 * configure, config.in: Rebuild.
8704
874c5b28
ILT
87052008-03-25 Ian Lance Taylor <iant@google.com>
8706
819d6c3a
ILT
8707 * options.cc: Include "../bfd/bfdver.h".
8708 (options::help): Print bug reporting address.
8709
f4b2c6f5
ILT
8710 * version.cc (print_version): Adjust output for current value of
8711 BFD_VERSION_STRING.
8712
8713 * NEWS: New file.
8714
e96caa79
ILT
8715 * options.cc (options::help): Print list of supported targets.
8716 * target-select.h: Include <vector>.
8717 (class Target_selector): Make machine_, size_, and is_big_endian_
8718 fields const. Add bfd_name_ and instantiated_target_ fields.
8719 (Target_selector::Target_selector): Add bfd_name parameter.
8720 (Target_selector::recognize): Make non-virtual, call
8721 do_recognize.
8722 (Target_selector::recognize_by_name): Make non-virtual, call
8723 do_recognize_by_name.
8724 (Target_selector::supported_names): New function.
8725 (Target_selector::bfd_name): New function.
8726 (Target_selector::do_instantiate_target): New pure virtual
8727 function.
8728 (Target_selector::do_recognize): New virtual function.
8729 (Target_selector::do_recognize_by_name): New virtual function.
8730 (Target_selector::instantiate_target): New private function.
8731 (supported_target_names): Declare.
8732 * target-select.cc (Target_selector::Target_selector): Update for
8733 new parameter and fields.
8734 (select_target_by_name): Check that the name matches before
8735 calling recognize_by_name.
8736 (supported_target_names): New function.
8737 * i386.cc (class Target_selector_i386): Update Target_selector
8738 constructor call. Remove recognize and recognize_by_name. Add
8739 do_instantiate_target.
8740 * x86_64.cc (class Target_selector_x86_64): Likewise.
8741 * testsuite/testfile.cc (class Target_selector_test): Update for
8742 changes to Target_selector.
8743
874c5b28
ILT
8744 * README: Rewrite, with some notes on unsupported features.
8745
0a65a3a7
CC
87462008-03-24 Cary Coutant <ccoutant@google.com>
8747
8748 * i386.cc (Target_i386::Got_type): New enum declaration.
8749 (Target_i386::Scan::local): Updated callers of Output_data_got
8750 member functions.
8751 (Target_i386::Scan::global): Likewise.
8752 (Target_i386::Relocate::relocate): Likewise.
8753 (Target_i386::Relocate::relocate_tls): Likewise.
8754 * object.h (Got_offset_list): New class.
8755 (Sized_relobj::local_has_got_offset): Added got_type parameter.
8756 (Sized_relobj::local_got_offset): Likewise.
8757 (Sized_relobj::set_local_got_offset): Likewise.
8758 (Sized_relobj::local_has_tls_got_offset): Removed.
8759 (Sized_relobj::local_tls_got_offset): Removed.
8760 (Sized_relobj::set_local_tls_got_offset): Removed.
8761 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
8762 * output.cc (Output_data_got::add_global): Added got_type parameter.
8763 (Output_data_got::add_global_with_rel): Likewise.
8764 (Output_data_got::add_global_with_rela): Likewise.
8765 (Output_data_got::add_global_pair_with_rel): New function.
8766 (Output_data_got::add_global_pair_with_rela): New function.
8767 (Output_data_got::add_local): Added got_type parameter.
8768 (Output_data_got::add_local_with_rel): Likewise.
8769 (Output_data_got::add_local_with_rela): Likewise.
8770 (Output_data_got::add_local_pair_with_rel): New function.
8771 (Output_data_got::add_local_pair_with_rela): New function.
8772 (Output_data_got::add_global_tls): Removed.
8773 (Output_data_got::add_global_tls_with_rel): Removed.
8774 (Output_data_got::add_global_tls_with_rela): Removed.
8775 (Output_data_got::add_local_tls): Removed.
8776 (Output_data_got::add_local_tls_with_rel): Removed.
8777 (Output_data_got::add_local_tls_with_rela): Removed.
8778 * output.h (Output_data_got::add_global): Added got_type parameter.
8779 (Output_data_got::add_global_with_rel): Likewise.
8780 (Output_data_got::add_global_with_rela): Likewise.
8781 (Output_data_got::add_global_pair_with_rel): New function.
8782 (Output_data_got::add_global_pair_with_rela): New function.
8783 (Output_data_got::add_local): Added got_type parameter.
8784 (Output_data_got::add_local_with_rel): Likewise.
8785 (Output_data_got::add_local_with_rela): Likewise.
8786 (Output_data_got::add_local_pair_with_rel): New function.
8787 (Output_data_got::add_local_pair_with_rela): New function.
8788 (Output_data_got::add_global_tls): Removed.
8789 (Output_data_got::add_global_tls_with_rel): Removed.
8790 (Output_data_got::add_global_tls_with_rela): Removed.
8791 (Output_data_got::add_local_tls): Removed.
8792 (Output_data_got::add_local_tls_with_rel): Removed.
8793 (Output_data_got::add_local_tls_with_rela): Removed.
8794 * resolve.cc (Symbol::override_base_with_special): Removed
8795 reference to has_got_offset_ field.
8796 * symtab.cc (Symbol::init_fields): Replaced initialization
8797 of got_offset_ with got_offsets_. Removed initialization
8798 of has_got_offset_
53fcba31 8799 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
8800 (Symbol::got_offset): Likewise.
8801 (Symbol::set_got_offset): Likewise.
8802 (Symbol::has_tls_got_offset): Removed.
8803 (Symbol::tls_got_offset): Removed.
8804 (Symbol::set_tls_got_offset): Removed.
8805 (Symbol::got_offset_): Removed.
8806 (Symbol::tls_mod_got_offset_): Removed.
8807 (Symbol::tls_pair_got_offset_): Removed.
8808 (Symbol::got_offsets_): New field.
8809 (Symbol::has_got_offset): Removed.
8810 (Symbol::has_tls_mod_got_offset): Removed.
8811 (Symbol::has_tls_pair_got_offset): Removed.
8812 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
8813 (Target_x86_64::Scan::local): Updated callers of Output_data_got
8814 member functions.
8815 (Target_x86_64::Scan::global): Likewise.
8816 (Target_x86_64::Relocate::relocate): Likewise.
8817 (Target_x86_64::Relocate::relocate_tls): Likewise.
8818
bd52eafb
BE
88192008-03-25 Ben Elliston <bje@au.ibm.com>
8820
8821 * yyscript.y: Fix spelling error in comment.
8822
8b105e34
ILT
88232008-03-24 Ian Lance Taylor <iant@google.com>
8824
8ed814a9
ILT
8825 * options.h (class General_options): Define build_id option.
8826 * layout.h (class Layout): Declare write_build_id, create_note,
8827 create_build_id. Add build_id_note_ member.
8828 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
8829 "libiberty.h", "md5.h", "sha1.h".
8830 (Layout::Layout): Initialize eh_frame_data_,
8831 eh_frame_hdr_section_, and build_id_note_.
8832 (Layout::finalize): Call create_build_id.
8833 (Layout::create_note): New function, broken out of
8834 Layout::create_gold_note.
8835 (Layout::create_gold_note): Call create_note.
8836 (Layout::create_build_id): New function.
8837 (Layout::write_build_id): New function.
8838 (Close_task_runner::run): Call write_build_id.
8839
8b105e34
ILT
8840 * x86_64.cc: Correct license to GPLv3.
8841
086a1841
ILT
88422008-03-23 Ian Lance Taylor <iant@google.com>
8843
8844 * options.cc: Include "demangle.h".
8845 (parse_optional_string): New function.
8846 (parse_long_option): Handle takes_optional_argument.
8847 (parse_short_option): Update dash_z initializer. Handle
8848 takes_optional_argument.
8849 (General_options::General_options): Initialize do_demangle_.
8850 (General_options::finalize): Set do_demangle_. Handle demangling
8851 style.
8852 * options.h (parse_optional_string): Declare.
8853 (struct One_option): Add optional_arg field. Update constructor.
8854 Update call constructor calls. Add takes_optional_argument
8855 function.
8856 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
8857 (DEFINE_optional_string): Define.
8858 (General_options::demangle): Change from DEFINE_bool to
8859 DEFINE_optional_string.
8860 (General_options::no_demangle): New function.
8861 (General_options::do_demangle): New function.
8862 (General_options::set_do_demangle): New function.
8863 (General_options::execstack_status_): Move definition to end of
8864 class definition.
8865 (General_options::static_): Likewise.
8866 (General_options::do_demangle_): New field.
8867 * object.cc (big_endian>::get_symbol_location_info): Call
8868 Options::do_demangle, not Options::demangle.
8869 * symtab.cc (demangle): Likewise.
8870
cbb93e63
ILT
88712008-03-22 Ian Lance Taylor <iant@google.com>
8872
8873 * gold.h: Include <cstddef> and <sys/types.h>
8874 * options.h: Include <cstring>.
8875
ec531623
ILT
88762008-03-21 Ian Lance Taylor <iant@google.com>
8877
8878 * Added source code to GNU binutils.