* largefile.m4: New file.
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
eb44217c
DK
12009-11-06 Doug Kwan <dougkwan@google.com>
2
3 * arm.cc (class Reloc_stub): Correct a comment.
4 (Target_arm::Target_arm): Initialize arm_input_section_map_.
5 (Target_arm::scan_section_for_stubs): New method declaration.
6 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
7 Change methods from private to protected.
8 (Target_arm::do_may_relax): New method definition.
9 (Target_arm::do_relax, Target_arm::group_sections,
10 Target_arm::scan_reloc_for_stub,
11 Target_arm::scan_reloc_section_for_stubs): New method declarations.
12 (Target_arm::arm_input_section_map_): New data member declaration.
13 (Target_arm::scan_reloc_for_stub,
14 Target_arm::scan_reloc_section_for_stubs,
15 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
16 Target_arm::do_relax): New method definitions.
17
5d329b7d
ILT
182009-11-06 Mikolaj Zalewski <mikolaj@google.com>
19
20 * configure.ac: Check for (struct stat)::st_mtim
21 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
22 * config.in: Regenerate.
23 * configure: Regenerate.
24
96a0d71b
ILT
252009-11-05 Ian Lance Taylor <iant@google.com>
26
27 PR 10910
28 * output.cc (Output_segment::add_output_section): Add missing
29 return statement.
30
594c8e5e
ILT
312009-11-04 Ian Lance Taylor <iant@google.com>
32
33 PR 10880
34 * object.h (class Object): Add is_needed and set_is_needed
35 methods. Add is_needed_ field. Make bool fields into bitfields.
36 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
37 defined in a dynamic object and referenced by a regular object,
38 set is_needed for the dynamic object.
39 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
40 if the file is marked with as_needed and it is not needed.
41
22b127cc
ILT
422009-11-04 Ian Lance Taylor <iant@google.com>
43
44 PR 10887
45 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
46 tags if data is discarded by linker script.
47 * i386.cc (Target_i386::do_finalize_sections): Likewise.
48 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
49 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
50 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
51
f5c870d2
ILT
522009-11-04 Ian Lance Taylor <iant@google.com>
53
54 * layout.cc (Layout::get_output_section): Add is_interp and
55 is_dynamic_linker_section parameters. Change all callers.
56 (Layout::choose_output_section): Likewise.
57 (Layout::make_output_section): Likewise.
58 (Layout::add_output_section_data): Add is_dynamic_linker_section
59 parameter. Change all callers.
60 * layout.h (class Layout): Update declarations.
61 * output.h (class Output_section): Add is_interp, set_is_interp,
62 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
63 Add is_interp_, is_dynamic_linker_section_ fields. Change
64 generate_code_fills_at_write_ to a bitfield.
65 * output.cc (Output_section::Output_sections): Initialize new
66 fields.
67 (Output_segment::add_output_section): Add do_sort parameter.
68 Change all callers.
69
1ae4d23b
ILT
702009-11-03 Ian Lance Taylor <iant@google.com>
71
72 PR 10860
73 * options.h (class General_options): Add --warn-common.
74 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
75 merging two common symbols.
76 (Symbol_table::should_override): Handle --warn-common when merging
77 a common symbol with a defined symbol. Use report_resolve_problem
78 for multiple definitions.
79 (Symbol_table::report_resolve_problem): New function.
80 * symtab.h (class Symbol_table): Declare report_resolve_problem.
81
55da9579
DK
822009-11-03 Doug Kwan <dougkwan@google.com>
83
84 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
85 stub_factory_.
86 (Target_arm::stub_factory): New method definition.
87 (Target_arm::new_arm_input_section,
88 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
89 Target_arm::reloc_uses_thumb_bit): New method declarations.
90 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
91 New type definitions.
92 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
93 member declarations.
94 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
95 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
96 New method definitions.
97
37a9ac43
ILT
982009-11-03 Ian Lance Taylor <iant@google.com>
99
100 * options.h (class General_options): Add --warn_constructors.
101
b3d6a3d4
ILT
1022009-11-03 Ian Lance Taylor <iant@google.com>
103
104 PR 10893
105 * defstd.cc (in_section): Add entries for __rel_iplt_start,
106 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
107
934b01dd
ILT
1082009-11-03 Ian Lance Taylor <iant@google.com>
109
110 PR 10895
111 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
112 --msgid-bugs-address.
113 (install-pdf): New target.
114 (install-data_yes): Look up one directory to find mkinstalldirs.
115
03c1939b
L
1162009-11-03 H.J. Lu <hongjiu.lu@intel.com>
117
118 * po/Make-in (.po.gmo): Don't generate .gmo files in source
119 tree.
120
ebd95253
DK
1212009-10-30 Doug Kwan <dougkwan@google.com>
122
123 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
124
e9bbb538
DK
1252009-10-30 Doug Kwan <dougkwan@google.com>
126
127 * arm.cc (Stub_addend_reader): New struct template definition
128 and partial specializations.
129 (Stub_addend_reader::operator()): New method definition for a
130 partially specialized template.
131
d5b40221
DK
1322009-10-30 Doug Kwan <dougkwan@google.com>
133
134 * arm.cc (Arm_relobj::processor_specific_flags): New method
135 definition.
136 (Arm_relobj::do_read_symbols): New method declaration.
137 (Arm_relobj::processor_specific_flags_): New data member declaration.
138 (Arm_dynobj): New class definition.
139 (Target_arm::do_finalize_sections): Add input_objects parameter.
140 (Target_arm::do_adjust_elf_header): New method declaration.
141 (Target_arm::are_eabi_versions_compatible,
142 (Target_arm::merge_processor_specific_flags): New method declaration.
143 (Target_arm::do_make_elf_object): New overloaded method definitions
144 and declaration.
145 (Arm_relobj::do_read_symbols): New method definition.
146 (Arm_dynobj::do_read_symbols): Ditto.
147 (Target_arm::do_finalize_sections): Add input_objects parameters.
148 Merge processor-specific flags from all input objects.
149 (Target_arm::are_eabi_versions_compatible,
150 Target_arm::merge_processor_specific_flags,
151 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
152 New method definitions.
153 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
154 Input_objects pointer type parameter.
155 * layout.cc (Layout::finalize): Pass input objects to target's.
156 finalize_sections function.
157 * output.cc (Output_file_header::do_sized_write): Set ELF file
158 header's processor-specific flags.
159 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
160 Input_objects pointer type parameter.
161 * sparc.cc (Target_sparc::do_finalize_sections): Same.
162 * target.h (Input_objects): New forward class declaration.
163 (Target::processor_specific_flags,
164 Target::are_processor_specific_flags_sect): New method definitions.
165 (Target::finalize_sections): Add input_objects parameter.
166 (Target::Target): Initialize processor_specific_flags_ and
167 are_processor_specific_flags_set_.
168 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
169 parameter.
170 (Target::set_processor_specific_flags): New method definition.
171 (Target::processor_specific_flags_,
172 Target::are_processor_specific_flags_set_): New data member
173 declarations.
174 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
175 Input_objects pointer type parameter.
176
ebabffbd
DK
1772009-10-30 Doug Kwan <dougkwan@google.com>
178
179 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
180
ad0f2072
ILT
1812009-10-28 Ian Lance Taylor <iant@google.com>
182
183 * object.h (class Relobj): Drop options parameter from
184 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
185 do_scan_relocs, do_relocate. Change all callers.
186 (class Sized_relobj): Drop options parameters from
187 do_gc_process_relocs, do_scan_relocs, do_relocate,
188 do_relocate_sections, relocate_sections, emit_relocs_scan,
189 emit_relocs_scan_reltype. Change all callers.
190 (struct Relocate_info): Remove options field and all references to
191 it.
192 * reloc.h (class Read_relocs): Remove options constructor
193 parameter and options_ field. Change all callers.
194 (class Gc_process_relocs, class Scan_relocs): Likewise.
195 (class Relocate_task): Likewise.
196 * target-reloc.h (scan_relocs): Remove options parameter. Change
197 all callers.
198 (scan_relocatable_relocs): Likewise.
199 * target.h (class Sized_target): Remove options parameter from
200 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
201 all callers.
202 * gc.h (gc_process_relocs): Remove options parameter. Change all
203 callers.
204 * arm.cc: Update functions to remove options parameters.
205 * i386.cc: Likewise.
206 * powerpc.cc: Likewise.
207 * sparc.cc: Likewise.
208 * x86_64.cc: Likewise.
209 * testsuite/testfile.cc: Likewise.
210
8ffa3667
DK
2112009-10-28 Doug Kwan <dougkwan@google.com>
212
213 * arm.cc (Arm_relobj): New class definition.
214 (Arm_relobj::scan_sections_for_stubs,
215 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
216 New method definitions.
217
40f36857
CC
2182009-10-28 Cary Coutant <ccoutant@google.com>
219
220 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
221 (Plugin::cleanup_done_): New member.
222 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
223 (Plugin_manager::cleanup_done_): Remove.
224 (Plugin_manager::add_input_file): Edit error message.
225 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
226 (Plugin_manager::cleanup): Remove use of cleanup_done_.
227
2c849493
ILT
2282009-10-27 Mikolaj Zalewski <mikolajz@google.com>
229
230 * fileread.cc: (File_read::View::~View): Use the new
231 data_ownership_ filed.
232 (File_read::~File_read): Dispose the new whole_file_view_.
233 (File_read::open): Mmap the whole file if needed.
234 (File_read::open): Use whole_file_view_ instead of contents_.
235 (File_read::find_view): Use whole_file_view_ if applicable.
236 (File_read::do_read): Use whole_file_view_ instead of contents_.
237 (File_read::make_view): Use whole_file_view_ instead of contents_,
238 update File_read::View::View call.
239 (File_read::find_or_make_view): Update File_read::View::View
240 call.
241 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
242 remove contents_
243 (File_read::View::Data_ownership): New enum.
244 (File_read::View::View): Replace bool mapped_ with Data_ownership
245 argument.
246 (File_read::View::mapped_): Remove (replaced by data_ownership_).
247 (File_read::View::data_ownership_): New field.
248 (File_read::contents_): Remove (replaced by whole_file_view_).
249 (File_read::whole_file_view_): New field.
250 * options.h (class General_options): Add --keep-files-mapped.
251
24998053
CC
2522009-10-27 Cary Coutant <ccoutant@google.com>
253
254 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
255 * testsuite/Makefile.am (plugin_test_5): New test case.
256 * testsuite/Makefile.in: Regenerate.
257
72adc4fa
DK
2582009-10-25 Doug Kwan <dougkwan@google.com>
259
260 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
261 from private to protected to allow access by child class.
262 (Sized_relobj::do_relocate_sections): New method declaration.
263 (Sized_relobj::relocate_sections): Virtualize.
264 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
265 Sized_relobj::relocate_sections. Instantiate template explicitly
266 for different target sizes and endianity.
267
07f508a2
DK
2682009-10-24 Doug Kwan <dougkwan@google.com>
269
270 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
271 (Arm_input_section::as_arm_input_section): New method.
272 (Arm_output_section): New class definition.
273 (Arm_output_section::create_stub_group,
274 Arm_output_section::group_sections): New method definitions.
275
10ad9fe5
DK
2762009-10-22 Doug Kwan <dougkwan@google.com>
277
278 * arm.cc (Arm_input_section): New class definition.
279 (Arm_input_section::init, Arm_input_section:do_write,
280 Arm_input_section::set_final_data_size,
281 Arm_input_section::do_reset_address_and_file_offset): New method
282 definitions.
283
56ee5e00
DK
2842009-10-21 Doug Kwan <dougkwan@google.com>
285
286 * arm.cc (Stub_table, Arm_input_section): New forward class
287 declarations.
288 (Stub_table): New class defintion.
289 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
290 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
291 New method definition.
292
b569affa
DK
2932009-10-21 Doug Kwan <dougkwan@google.com>
294
295 * arm.cc: Update copyright comments.
296 (Target_arm): New forward class template declaration.
297 (Arm_address): New type.
298 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
299 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
300 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
301 constants.
302 (Insn_template): Same.
303 (DEF_STUBS): New macro.
304 (Stub_type): New enum type.
305 (Stub_template): New class definition.
306 (Stub): Same.
307 (Reloc_stub): Same.
308 (Stub_factory): Same.
309 (Target_arm::Target_arm): Initialize may_use_blx_ and
310 should_force_pic_veneer_.
311 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
312 Target_arm::should_force_pic_veneer,
313 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
314 Target_arm::using_thumb_only, Target_arm:;default_target): New
315 method defintions.
316 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
317 New data member declarations.
318 (Insn_template::size, Insn_template::alignment): New method defintions.
319 (Stub_template::Stub_template): New method definition.
320 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
321 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
322 (Stub_factory::Stub_factory): New method definition.
323 * gold.h (string_hash): New template.
324 * output.h (Input_section_specifier::hash_value): Use
325 gold::string_hash.
326 (Input_section_specifier::string_hash): Remove.
327 * stringpool.cc (Stringpool_template::string_hash): Use
328 gold::string_hash.
329
6c172549
DK
3302009-10-20 Doug Kwan <dougkwan@google.com>
331
332 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
333 symbols of relaxed input sections.
334 * output.h (Output_section::find_relaxed_input_section): Make
335 method public.
336
c5617f2f
DK
3372009-10-16 Doug Kwan <dougkwan@google.com>
338
339 * dynobj.cc (Versions::Versions): Initialize version_script_.
340 Only insert base version symbol definition for a shared object
341 if version script defines any version versions.
342 (Versions::define_base_version): New method definition.
343 (Versions::add_def): Check that base version is not needed.
344 (Versions::add_need): Define base version lazily.
345 * dynobj.h (Versions::define_base_version): New method declaration.
346 (Versions::needs_base_version_): New data member declaration.
347 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
348 (check_DATA): Add no_version_test.stdout.
349 (libno_version_test.so, no_version_test.o no_version_test.stdout):
350 New make rules.
351 * testsuite/Makefile.in: Regenerate.
352 * testsuite/no_version_test.c: New file.
353 * testsuite/no_version_test.sh: Ditto.
354
3c12dcdb
DK
3552009-10-16 Doug Kwan <dougkwan@google.com>
356
357 * expression.cc (class Segment_start_expression): New class definition.
358 (Segment_start_expression::value): New method definition.
359 (script_exp_function_segment_start): Return a new
360 Segment_start_expression.
361 * gold/script-c.h (script_saw_segment_start_expression): New function
362 prototype.
363 * script-sections.cc (Script_sections::Script_sections): Initialize
364 SAW_SEGMENT_START_EXPRESSION_ to false.
365 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
366 and -Tbbs options to specify section addresses if given in
367 command line and no SEGMENT_START expression is seen in a script.
368 * script-sections.h (Script_sections::saw_segment_start_expression,
369 Script_sections::set_saw_segment_start_expression): New method
370 definition.
371 (Script_sections::saw_segment_start_expression_): New data member
372 declaration.
373 * script.cc (script_saw_segment_start_expression): New function.
374 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
375 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
376 script_test_7.sh and script_test_8.sh.
377 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
378 script_test_8.stdout.
379 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
380 (script_test_6, script_test_6.stdout, script_test_7,
381 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
382 * Makefile.in: Regenerate.
383 * testsuite/script_test_6.sh: New file.
384 * testsuite/script_test_6.t: Same.
385 * testsuite/script_test_7.sh: Same.
386 * testsuite/script_test_7.t: Same.
387 * testsuite/script_test_8.sh: Same.
388
64b1ae37
DK
3892009-10-16 Doug Kwan <dougkwan@google.com>
390
391 * output.cc (Output_segment::set_section_list_address): Cast
392 expressions to unsigned long long type to avoid format warnings.
393
661be1e2
ILT
3942009-10-15 Ian Lance Taylor <iant@google.com>
395
12edd763 396 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 397 dot assignment to script_sections_.
12edd763
ILT
398 * script-sections.cc (Script_sections::add_dot_assignment):
399 Initialize if necessary.
400
68b6574b
ILT
401 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
402 program headers with no load segment if there is a linker script.
403
661be1e2
ILT
404 * layout.cc (Layout::set_segment_offsets): Align the file offset
405 to the segment aligment for -N or -n with no load segment.
406 * output.cc (Output_segment::add_output_section): Don't crash if
407 the first section is a TLS section.
408 (Output_segment::set_section_list_addresses): Print an error
409 message if the address moves backward in a linker script.
410 * script-sections.cc
411 (Output_section_element_input::set_section_addresses): Don't
412 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
413 (Orphan_output_section::set_section_addresses): Likewise.
414
f15f61a7
DK
4152009-10-15 Doug Kwan <dougkwan@google.com>
416
417 * layout.cc (Layout::finish_dynamic_section): Generate tags
418 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
419 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
420 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
421
82bb573a
ILT
4222009-10-14 Ian Lance Taylor <iant@google.com>
423
424 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
425 fields.
426 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
427 data_shdr fields of relinfo.
428 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
429 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
430 R_386_TLS_LDO_32, adjust based on section flags.
431 (Target_i386::Relocate::fix_up_ldo): Remove.
432
374ad285
ILT
4332009-10-13 Ian Lance Taylor <iant@google.com>
434
435 Add support for -pie.
436 * options.h (class General_options): Add -pie and
437 --pic-executable.
438 (General_options::output_is_position_independent): Test -pie.
439 (General_options::output_is_executable): Return true if not shared
440 and not relocatable.
441 (General_options::output_is_pie): Remove.
442 * options.cc (General_options::finalize): Reject incompatible uses
443 of -pie.
444 * gold.cc (queue_middle_tasks): A -pie link is not static.
445 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
446 * symtab.cc (Symbol::final_value_is_known): Return false if
447 output_is_position_independent.
448 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
449 output_is_position_independent.
450 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
451 output_is_position_independent.
452 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
453 output_is_position_independent.
454 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
455 two_file_pie_test.
456 (basic_pie_test.o, basic_pie_test): New targets.
457 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
458 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
459 (two_file_pie_test): New target.
460 * testsuite/Makefile.in: Rebuild.
461 * README: Remove note saying that -pie is not supported.
462
c6585162
ILT
4632009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
464
465 * options.h (class General_options): Add -init and -fini.
466 * layout.cc (Layout::finish_dynamic_section): Emit
467 given init and fini functions.
468
032ce4e9
ST
4692009-10-13 Sriraman Tallam <tmsriram@google.com>
470
471 * gc.h (gc_process_relocs): Check if icf is enabled using new
472 function.
473 * gold.cc (queue_initial_tasks): Likewise.
474 (queue_middle_tasks): Likewise.
475 * object.cc (do_layout): Likewise.
476 * symtab.cc (is_section_folded): Likewise.
477 * main.cc (main): Likewise.
478 * reloc.cc (Read_relocs::run): Likewise.
479 (Sized_relobj::do_scan_relocs): Likewise.
480 * icf.cc (is_function_ctor_or_dtor): New function.
481 (Icf::find_identical_sections): Check if function is ctor or dtor when
482 safe icf is chosen.
483 * options.h (General_options::icf): Change option to be an enum.
484 (Icf_status): New enum.
485 (icf_enabled): New method.
486 (icf_safe_folding): New method.
487 (set_icf_status): New method.
488 (icf_status_): New variable.
489 * (options.cc) (General_options::finalize): Set icf_status_.
490 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
491 icf_test and icf_keep_unique_test to use the --icf enum flag.
492 * testsuite/icf_safe_test.sh: New file.
493 * testsuite/icf_safe_test.cc: New file.
494
f345227a
ST
4952009-10-12 Sriraman Tallam <tmsriram@google.com>
496
497 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
498 includes to gc.h and icf.h.
499 * arm.cc: Include gc.h.
500 * gold.cc: Likewise.
501 * i386.cc: Likewise.
502 * powerpc.cc: Likewise.
503 * sparc.cc: Likewise.
504 * x86_64.cc: Likewise.
505 * gc.h: Include icf.h.
506
1c7814ed
ILT
5072009-10-11 Ian Lance Taylor <iant@google.com>
508
509 * plugin.cc: Include "gold.h" before other header files.
510
ae3b5189
CD
5112009-10-10 Chris Demetriou <cgd@google.com>
512
513 * options.h (Input_file_argument::Input_file_type): New enum.
514 (Input_file_argument::is_lib_): Replace with...
515 (Input_file_argument::type_): New member.
516 (Input_file_argument::Input_file_argument): Take Input_file_type
517 'type' rather than boolean 'is_lib' as second argument.
518 (Input_file_argument::is_lib): Use type_.
519 (Input_file_argument::is_searched_file): New function.
520 (Input_file_argument::may_need_search): Handle is_searched_file.
521 * options.cc (General_options::parse_library): Support -l:filename.
522 (General_options::parse_just_symbols): Update for Input_file_argument
523 changes.
524 (Command_line::process): Likewise.
525 * archive.cc (Archive::get_file_and_offset): Likewise.
526 * plugin.cc (Plugin_manager::release_input_file): Likewise.
527 * script.cc (read_script_file, script_add_file): Likewise.
528 * fileread.cc (Input_file::Input_file): Likewise.
529 (Input_file::will_search_for): Handle is_searched_file.
530 (Input_file::open): Likewise.
531 * readsyms.cc (Read_symbols::get_name): Likewise.
532 * testsuite/Makefile.am (searched_file_test): New test.
533 * testsuite/Makefile.in: Regenerate.
534 * testsuite/searched_file_test.cc: New file.
535 * testsuite/searched_file_test_lib.cc: New file.
536
f3048a1d
ILT
5372009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
538 Ian Lance Taylor <iant@google.com>
539
540 * descriptor.cc: Include <cstdio> and "binary-io.h".
541 (Descriptors::open): Open the files in binary mode always.
542 * script.cc (Lex::get_token): Treat \r as whitespace.
543
d4780e57
ILT
5442009-10-09 Ian Lance Taylor <iant@google.com>
545
546 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
547
d9a893b8
ILT
5482009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
549 Ian Lance Taylor <iant@google.com>
550
551 * configure.ac: Check for readv function also.
552 * fileread.cc (readv): Define if not HAVE_READV.
553 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
554 does not exist.
555 * config.in: Regenerate.
556 * configure: Regenerate.
557
c0a62865
DK
5582009-10-09 Doug Kwan <dougkwan@google.com>
559
560 * layout.cc (Layout::make_output_section): Call target hook to make
561 ordinary output section.
562 (Layout::finalize): Adjust parameter list of call the
563 Target::may_relax().
564 * layout.h (class Layout::section_list): New method.
565 * merge.h (Output_merge_base::entsize): Change visibility to public.
566 (Output_merge_base::is_string, Output_merge_base::do_is_string):
567 New methods.
568 (Output_merge_string::do_is_string): New method.
569 * object.cc (Sized_relobj::do_setup): renamed from
570 Sized_relobj::set_up.
571 * object.h (Sized_relobj::adjust_shndx,
572 Sized_relobj::initializ_input_to_output_maps,
573 Sized_relobj::free_input_to_output_maps): Change visibilities to
574 protected.
575 (Sized_relobj::setup): Virtualize.
576 (Sized_relobj::do_setup): New method declaration.
577 (Sized_relobj::invalidate_section_offset,
578 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
579 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
580 * options.cc (parse_int): New function.
581 * options.h (parse_int): New declaration.
582 (DEFINE_int): New macro.
583 (stub_group_size): New option.
584 * output.cc (Output_section::Output_section): Initialize memebers
585 merge_section_map_, merge_section_by_properties_map_,
586 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
587 (Output_section::add_input_section): Handled deferred code-fill
588 generation and remove an old comment.
589 (Output_section::add_relaxed_input_section): New method definition.
590 (Output_section::add_merge_input_section): Use merge section by
591 properties map to speed to search. Update merge section maps
592 as appropriate.
593 (Output_section::build_relaxation_map): New method definition.
594 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
595 Same.
596 (Output_section::relax_input_section): Renamed to
597 Output_section::convert_input_sections_to_relaxed_sections and change
598 interface to take a vector of pointers to relaxed sections.
599 (Output_section::find_merge_section,
600 Output_section::find_relaxed_input_section): New method definitions.
601 (Output_section::is_input_address_mapped,
602 Output_section::output_offset, Output_section::output_address):
603 Use output section data maps to speed up searching.
604 (Output_section::find_starting_output_address): Add comments.
605 (Output_section::do_write,
606 Output_section::write_to_postprocessing_buffer): Do code-fill
607 generation as appropriate.
608 (Output_section::get_input_sections): Invalidate relaxed input section
609 map.
610 (Output_section::restore_states): Adjust type of checkpoint .
611 Invalidate relaxed input section map.
612 * output.h (Output_merge_base): New class declaration.
613 (Input_section_specifier): New class defintion.
614 (class Output_relaxed_input_section) Change base class to
615 Output_section_data_build.
616 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
617 base class initializer.
618 (Output_section::add_relaxed_input_section): New method declaration.
619 (Output_section::Input_section): Change visibility to protected.
620 (Output_section::Input_section::relobj,
621 Output_section::Input_section::shndx): Handle relaxed input sections.
622 Output_section::input_sections) Change visibility to protected. Also
623 define overload to return a non-const pointer.
624 (Output_section::Merge_section_properties): New class defintion.
625 (Output_section::Merge_section_by_properties_map,
626 Output_section::Output_section_data_by_input_section_map,
627 Output_section::Relaxation_map): New types.
628 (Output_section::relax_input_section): Rename method to
629 Output_section::convert_input_sections_to_relaxed_sections and change
630 interface to take a vector of relaxed section pointers.
631 (Output_section::find_merge_section,
632 Output_section::find_relaxed_input_section,
633 Output_section::build_relaxation_map,
634 Output_section::convert_input_sections_in_list_to_relaxed_sections):
635 New method declarations.
636 (Output_section::merge_section_map_
637 Output_section::merge_section_by_properties_map_,
638 Output_section::relaxed_input_section_map_,
639 Output_section::is_relaxed_input_section_map_valid_,
640 Output_section::generate_code_fills_at_write_): New data members.
641 * script-sections.cc
642 (Output_section_element_input::set_section_addresses): Call
643 current_data_size and addralign methods of relaxed input sections.
644 (Orphan_output_section::set_section_addresses): Call current_data_size
645 and addralign methods of relaxed input sections.
646 * symtab.cc (Symbol_table::compute_final_value): Extract template
647 from the body of Symbol_table::sized_finalize_symbol.
648 (Symbol_table::sized_finalized_symbol): Call
649 Symbol_table::compute_final_value.
650 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
651 (Symbol_table::compute_final_value): New templated method declaration.
652 * target.cc (Target::do_make_output_section): New method defintion.
653 * target.h (Target::make_output_section): New method declaration.
654 (Target::relax): Add more parameters for input objects, symbol table
655 and layout. Adjust call to do_relax.
656 (Target::do_make_output_section): New method declaration.
657 (Target::do_relax): Add parameters for input objects, symbol table
658 and layout.
659
d446d6c4
ILT
6602009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
661
662 * pread.c: Include stdio.h.
663
bc06c745
ILT
6642009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
665
666 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
667 defined.
668
75aea3d0
ILT
6692009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
670
671 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
672 Change read_shndx type to unsigned int.
673 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
674 int.
675 (Sized_dwarf_line_info::read_line_mappings): Likewise.
676 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
677 Change read_shndx type to unsigned int.
678 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
679 int.
680 (Sized_dwarf_line_info::read_line_mappings): Likewise.
681 * layout.cc (Layout::create_symtab_sections): Cast the result of
682 local_symcount * symsize to off_t in the gold_assert.
683
be8fcb75
ILT
6842009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
685
686 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
687 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
688 R_ARM_BASE_ABS.
689 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
690 (Arm_relocate_functions::thm_abs5): New function.
691 (Arm_relocate_functions::abs12): New function.
692 (Arm_relocate_functions::abs16): New function.
693 (Arm_relocate_functions::base_abs): New function.
694 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
695 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
696 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
697 R_ARM_BASE_ABS.
698 (Scan::global): Likewise.
699 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
700 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
701 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
702 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
703 R_ARM_BASE_ABS.
704
c2a122b6
ILT
7052009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
706
707 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
708 (Arm_relocate_functions::movt_prel): New function.
709 (Arm_relocate_functions::thm_movw_prel_nc): New function.
710 (Arm_relocate_functions::thm_movt_prel): New function.
711 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
712 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
713 (Scan::global, Relocate::relocate): Likewise.
714 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
715
c4aa1e2d
ILT
7162009-10-09 Mikolaj Zalewski <mikolajz@google.com>
717
718 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
719 Incremental_checker.
720 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
721 unsigned int.
722 (class Incremental_inputs_header): New class.
723 (Incremental_inputs_header_writer): Edit comment.
724 (Incremental_inputs_entry): New class.
725 (Incremental_inputs_entry_writer): Edit comment.
726 (Sized_incremental_binary::do_find_incremental_inputs_section):
727 Add *strtab_shndx parameter, fill it.
728 (Sized_incremental_binary::do_check_inputs): New method.
729 (Incremental_checker::can_incrementally_link_output_file): Use
730 Sized_incremental_binary::check_inputs.
731 (Incremental_inputs::report_command_line): Save command line in
732 command_line_.
733 * incremental.h:
734 (Incremental_binary::find_incremental_inputs_section): New
735 method.
736 (Incremental_binary::do_find_incremental_inputs_section): Add
737 strtab_shndx parameter.
738 (Incremental_binary::do_check_inputs): New pure virtual method.
739 (Sized_incremental_binary::do_check_inputs): Declare.
740 (Incremental_checker::Incremental_checker): Add incremental_inputs
741 parameter, use it to initialize incremental_inputs_.
742 (Incremental_checker::incremental_inputs_): New field.
743 (Incremental_checker::command_line): New method.
744 (Incremental_checker::inputs): New method.
745 (Incremental_checker::command_line_): New field.
746
c549a694
ILT
7472009-10-09 Mikolaj Zalewski <mikolajz@google.com>
748
749 * incremental.cc: Include <cstdarg> and "target-select.h".
750 (vexplain_no_incremental): New function.
751 (explain_no_incremental): New function.
752 (Incremental_binary::error): New method.
753 (Sized_incremental_binary::do_find_incremental_inputs_section): New
754 method.
755 (make_sized_incremental_binary): New function.
756 (open_incremental_binary): New function.
757 (can_incrementally_link_file): Add checks if output is ELF and has
758 inputs section.
759 * incremental.h: Include "elfcpp_file.h" and "output.h".
760 (Incremental_binary): New class.
761 (Sized_incremental_binary): New class.
762 (open_incremental_binary): Declare.
763 * object.cc (is_elf_object): Use
764 elfcpp::Elf_recognizer::is_elf_file.
765 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
766 * output.h (Output_file::filesize): New method.
767
fd3c5f0b
ILT
7682009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
769
770 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
771 New function.
772 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
773 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
774 function.
775 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
776 function.
777 (Arm_relocate_functions::movw_abs_nc): New function.
778 (Arm_relocate_functions::movt_abs): New function.
779 (Arm_relocate_functions::thm_movw_abs_nc): New function.
780 (Arm_relocate_functions::thm_movt_abs): New function.
781 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
782 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
783 (Scan::global): Likewise.
784 (Relocate::relocate): Likewise.
785 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
786
7f5309a5
ILT
7872009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
788
789 * arm.cc (Arm_relocate_functions::got_prel) New function.
790 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
791 (Relocate::relocate): Likewise.
792 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
793
364c7fa5
ILT
7942009-10-06 Ian Lance Taylor <iant@google.com>
795
796 * options.h (class General_options): Define
797 split_stack_adjust_size parameter.
798 * object.h (class Object): Add uses_split_stack_ and
799 has_no_split_stack_ fields. Add uses_split_stack and
800 has_no_split_stack accessor functions. Declare
801 handle_split_stack_section.
802 (class Reloc_symbol_changes): Define.
803 (class Sized_relobj): Define Function_offsets. Declare
804 split_stack_adjust, split_stack_adjust_reltype, and
805 find_functions.
806 * object.cc (Object::handle_split_stack_section): New function.
807 (Sized_relobj::do_layout): Call handle_split_stack_section.
808 * dynobj.cc (Sized_dynobj::do_layout): Call
809 handle_split_stack_section.
810 * reloc.cc (Sized_relobj::relocate_sections): Call
811 split_stack_adjust for executable sections in split_stack
812 objects. Pass reloc_map to relocate_section.
813 (Sized_relobj::split_stack_adjust): New function.
814 (Sized_relobj::split_stack_adjust_reltype): New function.
815 (Sized_relobj::find_functions): New function.
816 * target-reloc.h: Include "object.h".
817 (relocate_section): Add reloc_symbol_changes parameter. Change
818 all callers.
819 * target.h (class Target): Add calls_non_split method. Declare
820 do_calls_non_split virtual method. Declare match_view and
821 set_view_to_nop.
822 * target.cc: Include "elfcpp.h".
823 (Target::do_calls_non_split): New function.
824 (Target::match_view): New function.
825 (Target::set_view_to_nop): New function.
826 * gold.cc (queue_middle_tasks): Give an error if mixing
827 split-stack and non-split-stack objects with -r.
828 * i386.cc (Target_i386::relocate_section): Add
829 reloc_symbol_changes parameter.
830 (Target_i386::do_calls_non_split): New function.
831 * x86_64.cc (Target_x86_64::relocate_section): Add
832 reloc_symbol_changes parameter.
833 (Target_x86_64::do_calls_non_split): New function.
834 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
835 parameter.
836 * powerpc.cc (Target_powerpc::relocate_section): Add
837 reloc_symbol_changes parameter.
838 * sparc.cc (Target_sparc::relocate_section): Add
839 reloc_symbol_changes parameter.
840 * configure.ac: Call AM_CONDITIONAL for the default target.
841 * configure: Rebuild.
842 * testsuite/Makefile.am (TEST_AS): New variable.
843 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
844 (check_DATA): Add split_i386 and split_x86_64 files.
845 (SPLIT_DEFSYMS): Define.
846 (split_i386_[1234n].o): New targets.
847 (split_i386_[124]): New targets.
848 (split_i386_[1234r].stdout): New targets.
849 (split_x86_64_[1234n].o): New targets.
850 (split_x86_64_[124]): New targets.
851 (split_x86_64_[1234r].stdout): New targets.
852 (MOSTLYCLEANFILES): Add new executables.
853 * testsuite/split_i386.sh: New file.
854 * testsuite/split_x86_64.sh: New file.
855 * testsuite/split_i386_1.s: New file.
856 * testsuite/split_i386_2.s: New file.
857 * testsuite/split_i386_3.s: New file.
858 * testsuite/split_i386_4.s: New file.
859 * testsuite/split_i386_n.s: New file.
860 * testsuite/split_x86_64_1.s: New file.
861 * testsuite/split_x86_64_2.s: New file.
862 * testsuite/split_x86_64_3.s: New file.
863 * testsuite/split_x86_64_4.s: New file.
864 * testsuite/split_x86_64_n.s: New file.
865 * testsuite/testfile.cc (Target_test): Update relocation_section
866 function.
867 * testsuite/Makefile.in: Rebuild.
868
e8a9fcda
ILT
8692009-10-06 Ian Lance Taylor <iant@google.com>
870
871 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
872 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
873 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
874 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
875 the address on ldo_addrs_.
876 (Target_i386::Relocate::fix_up_ldo): New function.
877
e99daf92
ILT
8782009-10-06 Rafael Espindola <espindola@google.com>
879
880 * plugin.cc (add_input_library): New.
881 (Plugin::load): Add add_input_library to tv.
882 (Plugin_manager::add_input_file): Add the is_lib argument.
883 (add_input_file): Update call to Plugin_manager::add_input_file.
884 (add_input_library): New.
885 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
886
966d4097
DK
8872009-09-30 Doug Kwan <dougkwan@google.com>
888
889 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
890 symbol and call Symbol::may_need_copy_reloc to determine if
891 a copy reloc is needed.
892 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
893 nocopyreloc is given in command line.
894 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
895 given in command line.
896 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
897 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
898 of the removed Target_i386::may_need_copy_reloc.
899 * options.h (copyreloc): New option with default value false.
900 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
901 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
902 instead of the removed Target_powerpc::may_need_copy_reloc.
903 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
904 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
905 instead of the removed Target_sparc::may_need_copy_reloc.
906 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
907 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
908 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
909 instead of the removed Target_x86_64::may_need_copy_reloc.
910
029ba973
ILT
9112009-09-30 Ian Lance Taylor <iant@google.com>
912
913 * object.h (class Object): Remove target_ field, and target,
914 sized_target, and set_target methods.
915 (Object::sized_target): Remove.
916 (class Sized_relobj): Update declarations. Remove sized_target.
917 * object.cc (Sized_relobj::setup): Remove target parameter.
918 Change all callers.
919 (Input_objects::add_object): Don't do anything with the target.
920 (make_elf_sized_object): Add punconfigured parameter. Change all
921 callers. Set or test parameter target.
922 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
923 Change all callers.
924 * parameters.cc (Parameters::set_target): Change parameter type to
925 be non-const.
926 (Parameters::default_target): Remove.
927 (set_parameters_target): Change parameter type to be non-const.
928 (parameters_force_valid_target): New function.
929 (parameters_clear_target): New function.
930 * parameters.h (class Parameters): Update declarations. Remove
931 default_target method. Add sized_target and clear_target
932 methods. Change target_ to be non-const.
933 (set_parameters_target): Update declaration.
934 (parameters_force_valid_target): Declare.
935 (parameters_clear_target): Declare.
936 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
937 as NULL if we aren't searching.
938 (Add_symbols::run): Don't check for compatible target.
939 * fileread.cc (Input_file::open_binary): Call
940 parameters_force_valid_target.
941 * gold.cc (queue_middle_tasks): Likewise.
942 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
943 set_target on object.
944 * dynobj.h (class Sized_dynobj): Update declarations.
945 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
946 make_elf_object returns NULL.
947 (Archive::include_member): Don't check whether object target is
948 compatible.
949 * output.cc (Output_section::add_input_section): Get target from
950 parameters.
951 (Output_section::relax_input_section): Likewise.
952 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
953 parameters.
954 (Sized_relobj::do_scan_relocs): Likewise.
955 (Sized_relobj::relocate_sections): Likewise.
956 * resolve.cc (Symbol_table::resolve): Likewise.
957 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
958 parameter. Change all callers.
959 (Symbol_table::add_from_object): Get target from parameters.
960 (Symbol_table::add_from_relobj): Don't check object target.
961 (Symbol_table::add_from_dynobj): Likewise.
962 (Symbol_table::define_special_symbol): Get target from
963 parameters.
964 * symtab.h (class Symbol_table): Update declaration.
965 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
966 parameter. Change all callers. Clear parameter target.
967 (Binary_test): Test target here.
968 * testsuite/object_unittest.cc (gold_testsuite): Remove
969 target_test_pointer parameter. Change all callers.
970 (Object_test): Test target here.
971
a6a22b83
ILT
9722009-09-26 Ian Lance Taylor <iant@google.com>
973
974 * testsuite/initpri1.c: Don't try to use constructor priorities if
975 compiling with gcc before 4.3.
976
6a8f49fe
ILT
9772009-09-22 Mikolaj Zalewski <mikolajz@google.com>
978
979 * testsuite/retain_symbols_file_test.sh (check_present): Change
980 output file name to retain_symbols_file_test.stdout.
981 (check_absent): Likewise.
982
8c604651
CS
9832009-09-18 Craig Silverstein <csilvers@google.com>
984
985 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
986 * options.cc: Include <cerrno> and <fstream>.
987 (General_options::finalize): Parse -retain-symbols-file tag.
988 * options.h: New flag.
989 (General_options): New method should_retain_symbol, new
990 variable symbols_to_retain.
991 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
992 should_retain_symbol map.
993 * testsuite/Makefile.am (retain_symbols_file_test): New test.
994 * testsuite/Makefile.in: Regenerate.
995 * testsuite/retain_symbols_file_test.sh: New file.
996
ca58b19f
NC
9972009-09-18 Nick Clifton <nickc@redhat.com>
998
999 * po/es.po: Updated Spanish translation.
1000
20e6d0d6
DK
10012009-09-17 Doug Kwan <dougkwan@google.com>
1002
1003 * debug.h (DEBUG_RELAXATION): New constant.
1004 (DEBUG_ALL): Add DEBUG_RELAXATION.
1005 (debug_string_to_enum): Add relaxation debug option.
1006 * layout.cc
1007 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
1008 Layout::Relaxation_debug_check::read_sections,
1009 Layout::Relaxation_debug_check::read_sections): New method definitions.
1010 (Layout::Layout): Initialize data members
1011 record_output_section_data_from_scrips_,
1012 script_output_section_data_list_ and relaxation_debug_check_.
1013 (Layout::save_segments, Layout::restore_segments,
1014 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
1015 Layout::relaxation_loop_body): New method definitions.
1016 (Layout::finalize): Support relaxation. Move section layout code to
1017 Layout::relaxation_loop_body.
1018 (Layout::set_asection_address_from_script): Move code for orphan
1019 section placement out.
1020 (Layout::place_orphan_sections_in_script): New method definition.
1021 * layout.h (Output_segment_headers, Output_file_header):
1022 New forward class declarations.
1023 (Layout::~Layout): Define.
1024 (Layout::new_output_section_data_from_script): New method definition.
1025 (Layout::place_orphan_sections_in_script): New method declaration.
1026 (Layout::Segment_states): New type declaration.
1027 (Layout::save_segments, Layout::restore_segments,
1028 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
1029 Layout::relaxation_loop_body): New method declarations.
1030 (Layout::Output_section_data_list): New type declaration.
1031 (Layout::Relaxation_debug_check): New class definition.
1032 (Layout::record_output_section_data_from_script_,
1033 Layout::script_output_section_data_list_, Layout::segment_states_,
1034 Layout::relaxation_debug_check_): New data members.
1035 * output.cc: (Output_section_headers::do_size): New method definition.
1036 (Output_section_headers::Output_section_headers): Move size
1037 computation to Output_section_headers::do_size.
1038 (Output_segment_headers::do_size): New method definition.
1039 (Output_file_header::Output_file_header): Move size computation to
1040 Output_file_header::do_size and call it.
1041 (Output_file_header::do_size): New method definition.
1042 (Output_data_group::Output_data_group): Adjust call to
1043 Output_section_data.
1044 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
1045 (Output_symtab_xindex::do_write): Add array bound check.
1046 (Output_section::Input_section::print_to_mapfile): Handle
1047 RELAXED_INPUT_SECTION_CODE.
1048 (Output_section::Output_section): Initialize data member checkpoint_.
1049 (Output_section::~Output_section): Delete checkpoint object pointed
1050 by checkpoint_.
1051 (Output_section::add_input_section): Always add an Input_section if
1052 relaxing.
1053 (Output_section::add_merge_input_section): Add assert.
1054 (Output_section::relax_input_section): New method definition.
1055 (Output_section::set_final_data_size): Set load address to zero for
1056 an unallocated section.
1057 (Output_section::do_address_and_file_offset_have_reset_values):
1058 New method definition.
1059 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
1060 Handle relaxed input section.
1061 (Output_section::sort_attached_input_sections): Checkpoint input
1062 section list lazily.
1063 (Output_section::get_input_sections): Change type of input_sections to
1064 list of Simple_input_section pointers. Checkpoint input section list
1065 lazily. Also handle relaxed input sections.
1066 (Output_section::add_input_section_for_script): Take a reference to
1067 a Simple_input_section object instead of Relobj pointer and section
1068 index as parameter. Handle relaxed input sections.
1069 (Output_section::save_states, Output_section::restore_states): New
1070 method definitions.
1071 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
1072 (Output_data::is_data_size_fixed): New method definition.
1073 (Output_data::reset_addresss_and_file_offset): Do not reset data size
1074 if it is fixed.
1075 (Output_data::address_and_file_offset_have_reset_values): New method
1076 definition.
1077 (Output_data::do_address_and_file_offset_have_reset_values): New method
1078 definition.
1079 (Output_data::set_data_size): Check that data size is not fixed.
1080 (Output_data::fix_data_size): New method definition.
1081 (Output_data::is_data_size_fixed_): New data member.
1082 (Output_section_headers::set_final_data_size): New method definition.
1083 (Output_section_headers::do_size): New method declaration.
1084 (Output_segment_headers::set_final_data_size): New method definition.
1085 (Output_segment_headers::do_size): New method declaration.
1086 (Output_file_header::set_final_data_size)::New method definition.
1087 (Output_file_header::do_size)::New method declaration.
1088 (Output_section_data::Output_section_data): Add new parameter
1089 is_data_size_fixed and use it to fix data size.
1090 (Output_data_const::Output_data_const): Adjust call to base class
1091 constructor and fix data size.
1092 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
1093 base class constructor and fix data size.
1094 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
1095 base class constructor and fix data size.
1096 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
1097 class constructor and fix data size.
1098 (Output_data_group::set_final_data_size): New method definition.
1099 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
1100 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
1101 class constructor and fix data size.
1102 (Output_relaxed_input_section): New class definition.
1103 (Output_section::Simple_input_section): New class definition.
1104 (Output_section::get_input_sections): Adjust parameter list.
1105 (Output_section::add_input_section_for_script): Same.
1106 (Output_section::save_states, Output_section::restore_states,
1107 Output_section::do_address_and_file_offset_have_reset_values,
1108 (Output_section::Input_section::Input_section): Handle
1109 RELAXED_INPUT_SECTION_CODE. Add new overload for
1110 Output_relaxed_input_section.
1111 (Output_section::Input_section::is_input_section,
1112 Output_section::Input_section::set_output_section): Handle relaxed
1113 input section.
1114 (Output_section::Input_section::is_relaxed_input_section,
1115 Output_section::Input_section::output_section_data,
1116 Output_section::Input_section::relaxed_input_section): New method
1117 definitions.
1118 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
1119 value.
1120 (Output_section::Input_section::u1_): Update comments.
1121 (Output_section::Input_section::u2_): Add new union member poris.
1122 (Output_section::Checkpoint_output_section): New classs definition.
1123 (Output_section::relax_input_section): New method declaration.
1124 (Output_section::checkpoint_): New data member.
1125 (Output_segment): Update comments.
1126 (Output_segment::Output_segment): Un-privatize copy constructor.
1127 (Output_segment::operator=): Un-privatize.
1128 * script-sections.cc (Output_section_element::Input_section_list):
1129 Change element type to Output_section::Simple_input_section.
1130 (Output_section_element_dot_assignment::set_section_addresses):
1131 Register output section data for relaxation clean up.
1132 (Output_data_exression::Output_data_expression): Adjust call to base
1133 constructor to fix data size.
1134 (Output_section_element_data::set_section_addresses): Register
1135 Output_data_expression object for relaxation clean up.
1136 (struct Input_section_info): Replace Relobj pointer and section index
1137 pair with Output_section::Simple_input_section and Convert struct to a
1138 class.
1139 (Input_section_sorter::operator()): Adjust access to
1140 Input_section_info data member to use accessors.
1141 (Output_section_element_input::set_section_addresses): Use layout
1142 parameter. Adjust code to use Output_section::Simple_input_section
1143 and Input_secction_info classes. Register filler for relaxation
1144 clean up.
1145 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
1146 and section index pair with Output_section::Simple_input_section
1147 class. Adjust code accordingly.
1148 (Phdrs_element::release_segment): New method definition.
1149 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
1150 segment list.
1151 (Script_sections::release_segments): New method definition.
1152 * gold/script-sections.h (Script_sections::release_segments): New
1153 method declaration.
1154 * gold/target.h (Target::may_relax, Target::relax,
1155 Target::do_may_relax, Target::do_relax): New method definitions.
1156
5e445df6
ILT
11572009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1158
1159 * arm.cc (has_signed_unsigned_overflow): New function.
1160 (Arm_relocate_functions::abs8): New function.
1161 (Target_arm::Scan::local): Handle R_ARM_ABS8.
1162 (Target_arm::Scan::global): Likewise.
1163 (Target_arm::relocate::relocate): Likewise.
1164 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
1165 Likewise.
1166
8c604651 11672009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
1168
1169 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
1170 * testsuite/Makefile.in: Regenerate.
1171
1e9cc1c2
NC
11722009-09-11 Nick Clifton <nickc@redhat.com>
1173
1174 * po/gold.pot: Updated by the Translation project.
1175
6a89f575
CC
11762009-09-08 Cary Coutant <ccoutant@google.com>
1177
1178 * output.cc (Output_file::open): Add execute permission to empty file.
1179 * testsuite/Makefile.am (permission_test): New test.
1180 * testsuite/Makefile.in: Regenerate.
1181
fdcac5af
ILT
11822009-09-02 Ian Lance Taylor <iant@google.com>
1183
1184 * output.cc (Output_file::resize): Call map_no_anonymous rather
1185 than map.
1186
44453f85
ILT
11872009-09-01 Mikolaj Zalewski <mikolajz@google.com>
1188
1189 * gold.cc: Include "incremental.h".
1190 (queue_initial_tasks): Call Incremental_checker methods.
1191 * incremental.cc: Include "output.h".
1192 (Incremental_checker::can_incrementally_link_output_file): New
1193 method.
1194 * incremental.h (Incremental_checker): New class.
1195
1196 * output.cc (Output_file::open_for_modification): New method.
1197 (Output_file::map_anonymous): Changed return type to bool. Record
1198 map in base_ field.
1199 (Output_file::map_no_anonymous): New method, broken out of map.
1200 (Output_file::map): Use map_no_anonymous and map_anonymous.
1201 * output.h (class Output_file): Update declarations.
1202
293c1386
CC
12032009-08-24 Cary Coutant <ccoutant@google.com>
1204
1205 * options.h (Command_line::Pre_options): New class.
1206 (Command_line::pre_options): New member.
1207 * options.cc (gold::options::ready_to_register): New variable.
1208 (One_option::register_option): Do nothing if not registering options.
1209 Assert if same short option registered twice.
1210 (General_options::General_options): Turn off option registration when
1211 done constructing.
1212 (Command_line::Pre_options::Pre_options): New constructor.
1213
f773f3d2
CC
12142009-08-24 Cary Coutant <ccoutant@google.com>
1215
06a73cfe
CC
1216 * options.h (General_options::no_keep_memory): Remove incorrect
1217 short option.
f773f3d2 1218
a15af8e2
RW
12192009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1220
1221 * Makefile.am (am__skiplex, am__skipyacc): New.
1222 * Makefile.in: Regenerate.
1223
c462b41b
RW
12242009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1225
14ec8efd
RW
1226 * Makefile.am (AM_CPPFLAGS): Renamed from ...
1227 (INCLUDES): ... this.
1228 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
1229 (AM_CPPFLAGS): Renamed from ...
1230 (INCLUDE): ... this.
1231 * Makefile.in, testsuite/Makefile.in: Regenerate.
1232
81ecdfbb
RW
1233 * Makefile.in: Regenerate.
1234 * aclocal.m4: Likewise.
1235 * config.in: Likewise.
1236 * configure: Likewise.
1237 * testsuite/Makefile.in: Likewise.
1238
c462b41b
RW
1239 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
1240 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
1241 * Makefile.in: Regenerate.
1242 * testsuite/Makefile.in: Regenerate.
1243
2da73f13
CC
12442009-08-19 Cary Coutant <ccoutant@google.com>
1245
1246 * resolve.cc (Symbol_table::resolve): Don't complain about defined
1247 symbols in shared libraries overridden by hidden or internal symbols
1248 in the main program.
1249
2db70501
CD
12502009-08-19 Chris Demetriou <cgd@google.com>
1251
1252 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
1253 checking source file names in error messages.
1254
f733487b
DK
12552009-08-18 Doug Kwan <dougkwan@google.com>
1256
1257 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
1258 an elcpp::Ehdr as parameter. Adjust call to set_target.
1259 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
1260 an elfcpp::Ehdr as parameter.
1261 * object.cc (Object::set_target): Remove the version that looks up
1262 a target and sets it.
1263 (Sized_relobj::setup): Take a Target object instead of
1264 an elfcpp::Ehdr as parameter. Adjust call to set_target.
1265 (make_elf_sized_object): Find target and ask target to
1266 make an ELF object.
1267 * object.h: (Object::set_target): Remove the version that looks up
1268 a target and sets it.
1269 (Sized_relobj::setup): Take a Target object instead of
1270 an elfcpp:Ehdr as parameter.
1271 * target.cc: Include dynobj.h.
1272 (Target::do_make_elf_object_implementation): New.
1273 (Target::do_make_elf_object): New.
1274 * target.h (Target::make_elf_object): New template declaration.
1275 (Target::do_make_elf_object): New method declarations.
1276 (Target::do_make_elf_object_implementation): New template declaration.
1277
cc70f101
ILT
12782009-08-14 Ian Lance Taylor <iant@google.com>
1279
1280 * gold.h (FUNCTION_NAME): Define.
1281 (gold_unreachable): Use FUNCTION_NAME.
1282
ef5e0cb1
ST
12832009-08-12 Sriraman Tallam <tmsriram@google.com>
1284
1285 * icf.cc (Icf::find_identical_sections): Issue a warning when a
1286 symbol in the --keep-unique list is not found.
1287
48c187ce
ST
12882009-08-12 Sriraman Tallam <tmsriram@google.com>
1289
1290 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
1291 been maked as --keep-unique.
1292 (Icf::unfold_section): New function.
1293 * icf.h (Icf::unfold_section): New function.
1294 * options.h (General_options::keep_unique): New option.
1295 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
1296 * testsuite/Makefile.in: Regenerate.
1297 * testsuite/icf_keep_unique_test.sh: New file.
1298 * testsuite/icf_keep_unique_test.cc: New file.
1299
645afe0c
CC
13002009-08-12 Cary Coutant <ccoutant@google.com>
1301
1302 PR 10471
1303 * resolve.cc (Symbol_table::resolve): Check for references from
1304 dynamic objects to hidden and internal symbols.
1305 * testsuite/Makefile.am (hidden_test.sh): New test.
1306 * testsuite/Makefile.in: Regenerate.
1307 * testsuite/hidden_test.sh: New script.
1308 * testsuite/hidden_test_1.c: New test source.
1309 * testsuite/hidden_test_main.c: New test source.
1310
11af873f
DK
13112009-08-11 Doug Kwan <dougkwan@google.com>
1312
1313 * arm.cc: Update comments.
1314 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
1315 segment to locate the .ARM.exidx section if present.
1316
b9f7d72d
DK
13172009-08-09 Doug Kwan <dougkwan@google.com>
1318
1319 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
1320 patch.
1321
ddd3c53c
ST
13222009-08-07 Sriraman Tallam <tmsriram@google.com>
1323 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
1324 compiler warnings.
1325
27721062
ST
13262009-08-06 Sriraman Tallam <tmsriram@google.com>
1327
1328 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
1329 valid tls_segment only for non-debug-section relocations.
1330 * testsuite/Makefile.am: Add gc_tls_test.
1331 * testsuite/Makefile.in: Regenerate.
1332 * testsuite/gc_tls_test.cc: New file.
1333 * testsuite/gc_tls_test.sh: New file.
1334
ef15dade
ST
13352009-08-05 Sriraman Tallam <tmsriram@google.com>
1336
1337 * icf.cc: New file.
1338 * icf.h: New file.
1339 * Makefile.am (CCFILES): Add icf.cc.
1340 (HFILES): Add icf.h
1341 * Makefile.in: Regenerate.
1342 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
1343 * gc.h (gc_process_relocs): Populate lists used by icf to contain
1344 section, symbol and addend information for the relocs.
1345 * gold.cc (queue_middle_tasks): Call identical code folding.
1346 * gold.h: Add defines for multimap.
1347 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
1348 to the call of finalize_local_symbols.
1349 * main.cc (main): Create object of class Icf.
1350 * object.cc (Sized_relobj::do_layout): Allow this function to be
1351 called twice during icf.
1352 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
1353 to sections marked as identical by icf.
1354 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
1355 when available.
1356 (Sized_relobj::do_section_entsize): New function.
1357 * object.h (Object::section_entsize): New function.
1358 (Object::do_section_entsize): New pure virtual function.
1359 (Relobj::finalize_local_symbols): Add new parameter.
1360 (Relobj::do_section_entsize): New function.
1361 * options.h (General_options::icf): New option.
1362 (General_options::icf_iterations): New option.
1363 (General_options::print_icf_sections): New option.
1364 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
1365 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
1366 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
1367 icf.
1368 * symtab.cc (Symbol_table::is_section_folded): New function.
1369 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
1370 to sections marked as identical by icf.
1371 * symtab.h (Symbol_table::set_icf): New function.
1372 (Symbol_table::icf): New function.
1373 (Symbol_table::is_section_folded): New function.
1374 (Symbol_table::icf_): New data member.
1375 * target-reloc.h (relocate_section): Ignore sections folded by icf.
1376 * testsuite/Makefile.am: Add commands to build icf_test.
1377 * testsuite/Makefile.in: Regenerate.
1378 * testsuite/icf_test.sh: New file.
1379 * testsuite/icf_test.cc: New file.
1380
c3b65ac4
CD
13812009-07-24 Chris Demetriou <cgd@google.com>
1382
1383 * layout.cc (is_compressible_debug_section): Fix incorrect
1384 comment about compressed section names.
1385
1caf2c51
ILT
13862009-07-20 Ian Lance Taylor <ian@airs.com>
1387
1388 PR 10419
1389 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
1390
1ef4d87f
ILT
13912009-07-16 Ian Lance Taylor <iant@google.com>
1392
1393 PR 10400
1394 * layout.h: #include <map>.
1395 (class Kept_section): Change from struct to class. Add accessors
1396 and setters. Add section size to Comdat_group mapping. Change
1397 Comdat_group to std::map. Add is_comdat_ field. Add
1398 linkonce_size field in union.
1399 (class Layout): Update declaration of find_or_add_kept_section.
1400 Don't declare find_kept_object.
1401 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
1402 parameter. Add object, shndx, is_comdat, and is_group_name
1403 parameters. Change all callers. Adjust for new Kept_section.
1404 (Layout::find_kept_object): Remove.
1405 * object.cc (Sized_relobj::include_section_group): Update use of
1406 Kept_section. Rename secnum to shndx. Only record
1407 Kept_comdat_section if sections are the same size.
1408 (Sized_relobj::include_linkonce_section): Update use of
1409 Kept_section. Only record Kept_comdat_section if sections are the
1410 same size. Set size of linkonce section.
1411 (Sized_relobj::map_to_kept_section): Update call to
1412 get_kept_comdat_section.
1413 * object.h (class Sized_relobj): Rename fields in
1414 Kept_comdat_section to drop trailing underscores; change object
1415 field to Relobj*. Change Kept_comdat_section_table to store
1416 struct rather than pointer.
1417 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
1418 Add kept_object and kept_shndx parameters. Change all callers.
1419 (Sized_relobj::get_kept_comdat_section): Change return type to
1420 bool. Add kept_object and kept_shndx parameters. Change all
1421 callers.
1422 * plugin.cc (Pluginobj::include_comdat_group): Update call to
1423 Layout::find_or_add_kept_section.
1424
37c3b7b0
ILT
14252009-07-09 Ian Lance Taylor <iant@google.com>
1426
1427 * merge.cc (Object_merge_map::initialize_input_to_output_map):
1428 Reserve space in the hash table.
1429
98fa85cb
ILT
14302009-07-06 Mikolaj Zalewski <mikolajz@google.com>
1431
1432 * fileread.cc (File_read::get_mtime): New method.
1433 * fileread.h (Timespec): New structure.
1434 (File_read::get_mtime): New method.
1435 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
1436 Renamed from timestamp_nsec.
1437 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
1438 Elf_Xword.
1439 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
1440 timestamp_nsec.
1441 (Incremental_inputs::report_archive): Save mtime; style fix.
1442 (Incremental_inputs::report_obejct): Save mtime; style fix.
1443 (Incremental_inputs::report_script): Save mtime; style fix.
1444 (Incremental_inputs::finalize_inputs): Style fix.
1445 (Incremental_inputs::finalize): Style fix.
1446 (Incremental_inputs::create_input_section_data): Store inputs
1447 mtime.
1448 * incremental.h (Incremental_inputs::report_script): Add mtime
1449 argument.
1450 (Incremental_inputs::Input_info::Input_info): Intialize only one
1451 union member.
1452 (Incremental_inputs::Input_info::archive): Move to nameless
1453 union.
1454 (Incremental_inputs::Input_info::obejct): Move to nameless union.
1455 (Incremental_inputs::Input_info::script): Move to nameless union.
1456 (Incremental_inputs::mtime): New field.
1457 * script.cc (read_input_script): Pass file mtime to
1458 Incremental_input.
1459 * script.h (Script_info::inputs): Style fix.
1460
c9d70757
ILT
14612009-07-01 Ian Lance Taylor <ian@airs.com>
1462
1463 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
1464 instead of 32.
1465
9c547ec3
ILT
14662009-06-24 Ian Lance Taylor <iant@google.com>
1467
1468 PR 10156
1469 * layout.cc (Layout::choose_output_section): If we find an
1470 existing section, update the flags.
1471 (Layout::create_notes): New function, broken out of
1472 Layout::finalize.
1473 (Layout::finalize): Don't create note sections.
1474 (Layout::create_note): Don't crash if linker script discards
1475 section.
1476 (Layout::create_gold_note): Likewise.
1477 (Layout::create_build_id): Likewise. Don't set
1478 after_input_sections on the section.
1479 (Layout::create_executable_stack_info): Remove target parameter.
1480 Change caller.
1481 * layout.h (class Layout): Declare create_notes. Update
1482 declaration of create_executable_stack_info.
1483 * gold.cc (queue_middle_tasks): Call create_notes.
1484 * output.cc (Output_section::update_flags_for_input_section): Move
1485 here from output.h. If SHF_ALLOC flag is newly set, mark address
1486 invalid.
1487 * output.h (Output_data::mark_address_invalid): New function.
1488 (class Output_section): Only declare, not define,
1489 update_flags_for_input_section. Remove set_flags.
1490
55458500
ILT
14912009-06-24 Ian Lance Taylor <iant@google.com>
1492
1493 * script-sections.cc (Output_section_definition::
1494 set_section_addresses): Rename shadowing local load_address to
1495 laddr.
1496
1307d6cd
ILT
14972009-06-24 Ian Lance Taylor <iant@google.com>
1498
1499 PR 10244
1500 * reloc.cc (relocate_sections): Skip empty relocation sections.
1501
ec3f783e
ILT
15022009-06-23 Ian Lance Taylor <iant@google.com>
1503
1504 PR 10156
1505 * layout.cc (Layout::create_note): Use choose_output_section
1506 rather than make_output_section.
1507
459c9f1c
ILT
15082009-06-23 Ian Lance Taylor <iant@google.com>
1509
1510 PR 10237
1511 * options.cc (General_options::parse_V): Set printed_version_.
1512 (General_options::General_options): Initialize printed_version_.
1513 * options.h (class General_options): Add printed_version_ field.
1514 * gold.cc (queue_initial_tasks): If there are no input files,
1515 don't give a fatal error if we printed the version information.
1516 (queue_middle_tasks): If using -r with a shared object, give a
1517 fatal error rather than an ordinary error.
1518
1518dc8f
ILT
15192009-06-23 Ian Lance Taylor <iant@google.com>
1520
1521 PR 10219
1522 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
1523 (Layout::make_output_section): Set have_stabstr_section_ if we see
1524 a .stab*str section.
1525 (Layout::finalize): Call link_stabs_sections.
1526 (Layout::link_stabs_sections): New file.
1527 * layout.h (class Layout): Add have_stabstr_section_ field.
1528 Declare link_stabs_sections.
1529
3d857b98
DK
15302009-06-23 Doug Kwan <dougkwan@google.com>
1531
1532 * Makefile.am (libgold_a_LIBADD): New.
1533 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
1534 * Makefile.in: Regenerate.
1535 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
1536 * configure: Regenerate.
1537 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
1538 * fileread.cc: Include sys/state.h
1539 * gold.h: Declare memmem and strndup if found missing.
1540 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
1541
0639a6f6
ILT
15422009-06-23 Ian Lance Taylor <iant@google.com>
1543
1544 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
1545 * configure: Rebuild.
1546
8d63875c
ILT
15472009-06-23 Ian Lance Taylor <iant@google.com>
1548
1549 PR 10147
1550 * object.cc (Object::section_contents): Don't try to get a view if
1551 the section has length zero.
1552 (Object::handle_gnu_warning_section): If the section is empty, use
1553 the name of the section as the warning.
1554
f7c8a183
ILT
15552009-06-23 Ian Lance Taylor <iant@google.com>
1556
1557 PR 10133
1558 * stringpool.h (class Stringpool_template): Add optimize_ field.
1559 (Stringpool_template::set_optimize): New function.
1560 * stringpool.cc (Stringpool_template::Stringpool_template):
1561 Initialize optimize_ field.
1562 (Stringpool_template::set_string_offsets): Test local optimize
1563 fild rather than parameter.
1564 * layout.cc (Layout::Layout): Call set_optimize on the section
1565 name stringpool.
1566
e6a307ba
ILT
15672009-06-22 Ian Lance Taylor <iant@google.com>
1568
1569 PR 10030
1570 * yyscript.y: Parse TARGET.
1571 * script.cc (script_set_target): New function.
1572 * script-c.h (script_set_target): Declare.
1573 * options.cc (General_options::string_to_object_format): Rename
1574 from string_to_object_format in anonymous namespace. Change
1575 callers.
1576 * options.h (class General_options): Declare
1577 string_to_object_format.
1578
3ee173de
ILT
15792009-06-22 Ian Lance Taylor <iant@google.com>
1580
1581 * script-sections.cc (Script_sections::create_segments): Don't put
1582 program headers in a PT_LOAD segment if -n or -N.
1583
15842009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
1585
1586 PR 10141
1587 * options.h (class General_options): Add -z lazy and -z now. Sort
1588 -z options into alphabetical order.
1589 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
1590
cd6739a1 15912009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
1592
1593 * layout.cc (Layout::make_output_section): Call
1594 Target::new_output_section.
1595 (Layout::attach_allocated_section_to_segment): Put large section
1596 sections in a separate load segment with the large segment flag
1597 set.
1598 (Layout::segment_precedes): Sort large data segments after other
1599 load segments.
1600 (align_file_offset): New static function.
1601 (Layout::set_segment_offsets): Use align_file_offset.
1602 * output.h (class Output_section): Add is_small_section_ and
1603 is_large_section_ fields.
1604 (Output_section::is_small_section): New function.
1605 (Output_section::set_is_small_section): New function.
1606 (Output_section::is_large_section): New function.
1607 (Output_section::set_is_large_section): New function.
1608 (Output_section::is_large_data_section): New function.
1609 (class Output_segment): Add is_large_data_segment_ field.
1610 (Output_segment::is_large_data_segment): New function.
1611 (Output_segment::set_is_large_data_segment): New function.
1612 * output.cc (Output_section::Output_section): Initialize new
1613 fields.
1614 (Output_segment::Output_segment): Likewise.
1615 (Output_segment::add_output_section): Add assertion that large
1616 data sections always go in large data segments. Force small data
1617 sections to the end of the list of data sections. Force small BSS
1618 sections to the start of the list of BSS sections. For large BSS
1619 sections to the end of the list of BSS sections.
1620 * symtab.h (class Symbol): Declare is_common_shndx.
1621 (Symbol::is_defined): Check Symbol::is_common_shndx.
1622 (Symbol::is_common): Likewise.
1623 (class Symbol_table): Define enum Commons_section_type. Update
1624 declarations. Add small_commons_ and large_commons_ fields.
1625 * symtab.cc (Symbol::is_common_shndx): New function.
1626 (Symbol_table::Symbol_table): Initialize new fields.
1627 (Symbol_table::add_from_object): Put small and large common
1628 symbols in the right list.
1629 (Symbol_table::sized_finalized_symbol): Check
1630 Symbol::is_common_shndx.
1631 (Symbol_table::sized_write_globals): Likewise.
1632 * common.cc (Symbol_table::do_allocate_commons): Allocate new
1633 common symbol lists. Don't call do_allocate_commons_list if the
1634 list is empty.
1635 (Symbol_table::do_allocate_commons_list): Remove is_tls
1636 parameter. Add comons_section_type parameter. Change all
1637 callers. Handle small and large common symbols.
1638 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
1639 Symbol::is_common_shndx.
1640 * resolve.cc (symbol_to_bits): Likewise.
1641 * target.h (Target::small_common_shndx): New function.
1642 (Target::small_common_section_flags): New function.
1643 (Target::large_common_shndx): New function.
1644 (Target::large_common_section_flags): New function.
1645 (Target::new_output_section): New function.
1646 (Target::Target_info): Add small_common_shndx, large_common_shndx,
1647 small_common_section_flags, and large_common_section_flags
1648 fields.
1649 (Target::do_new_output_section): New virtual function.
1650 * arm.cc (Target_arm::arm_info): Initialize new fields.
1651 * i386.cc (Target_i386::i386_info): Likewise.
1652 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
1653 Likewise.
1654 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
1655 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
1656 (Target_x86_64::do_new_output_section): New function.
1657 * configure.ac: Define conditional MCMODEL_MEDIUM.
1658 * testsuite/Makefile.am (check_PROGRAMS): Add large.
1659 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
1660 (large_LDFLAGS): Define.
1661 * testsuite/large.c: New file.
1662 * testsuite/testfile.cc (Target_test::test_target_info):
1663 Initialize new fields.
1664 * configure, testsuite/Makefile.in: Rebuild.
1665
bb04269c
DK
16662009-06-05 Doug Kwan <dougkwan@google.com>
1667
1668 * Makefile.am (CCFILES): Add target.cc.
1669 * Makefile.in: Regenerate.
1670 * i386.cc (class Target_i386): Define new virtual method to
1671 override do_is_local_label_name in parent.
1672 * object.cc (Sized_relobj::do_count_local_symbols): Discard
1673 local symbols if --discard-locals or -X is given.
1674 * options.h (class General_options): Declare new options
1675 '--discard-locals' and '-X' for discarding locals.
1676 * target.h (class Target): Define new methods is_local_label_name.
1677 Declare new virtual method do_is_local_label_name.
1678 * target.cc: New file.
1679 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
1680 (check_SCRIPTS): Add discard_locals_test.sh.
1681 (check_DATA): Add discard_local_tests.syms.
1682 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
1683 (discard_local_tests.syms, discard_locals_test.o): New make rules.
1684 * testsuite/Makefile.in: Regenerate.
1685 * testsuite/discard_locals_test.c: New file.
1686 * testsuite/discard_locals_test.sh: Same.
1687
805bb01c
DK
16882009-06-05 Doug Kwan <dougkwan@google.com>
1689
1690 * object.cc (Sized_relobj::Sized_relobj): Initialize
1691 discarded_eh_frame_shndx_ to -1U.
1692 (Sized_relobj::do_layout): Record index of a discard .eh_frame
1693 section.
1694 (Sized_relobj::do_count_local_symbols): Skip local symbols in
1695 a discarded .eh_frame section.
1696 (Sized_relobj::do_finalize_local_symbols): Ditto.
1697 * object.h (class Sized_relobj): Declare new member
1698 discarded_eh_frame_shndx_.
1699 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
1700 (local_labels_test.o, local_labels_test): New rules.
1701 * testsuite/Makefile.in: Regenerate.
1702
1dcd334d
DK
17032009-06-04 Doug Kwan <dougkwan@google.com>
1704
1705 * layout.cc (Layout::section_name_mapping): Add mapping for
1706 special ARM sections.
1707
96d49306
DK
17082009-06-03 Doug Kwan <dougkwan@google.com>
1709
1710 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
1711 (utils::has_overflow): Same.
1712
dff16297
ILT
17132009-06-03 Ian Lance Taylor <iant@google.com>
1714
1715 * layout.cc (Layout::section_name_mapping): New array, replacing
1716 Layout::linkonce_mapping.
1717 (Layout::section_name_mapping_count): New variable, replacing
1718 Layout::linkonce_mapping_count.
1719 (Layout::linkonce_output_name): Remove.
1720 (Layout::output_section_name): Rewrite.
1721 * layout.h (class Layout): Rename Linkonce_mapping to
1722 Section_name_mapping, linkonce_mapping to section_name_mapping,
1723 linkonce_mapping_count to section_name_mapping_count. Don't
1724 declare linkonce_output_name.
1725
c121c671
DK
17262009-06-03 Doug Kwan <dougkwan@google.com>
1727
1728 * gold/arm.cc (namespace utils): New.
1729 (Target_arm::reloc_is_non_pic): Define new method.
1730 (class Arm_relocate_functions): New.
1731 (Target_arm::Relocate::relocate): Handle relocation types used by
1732 Android.
1733
07800fab
ILT
17342009-06-03 Ian Lance Taylor <iant@google.com>
1735
1736 * arm.cc (Target_arm::scan::global): Use || instead of |.
1737
c121c671
DK
17382009-06-02 Doug Kwan <dougkwan@google.com>
1739
1740 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
1741 issued_non_pic_error_.
1742 (class Target_arm::Scan): Declare new method check_non_pic.
1743 Define new method symbol_needs_plt_entry.
1744 Declare new data member issued_non_pic_error_.
1745 (class Target_arm::Relocate): Declare new method
1746 should_apply_static_reloc.
1747 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
1748 (Target_arm::Scan::check_non_pic): Define new method.
1749 (Target_arm::Scan::local): Handle a small subset of reloc types used
1750 by Android.
1751 (Target_arm::Scan::local): Same.
1752 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
1753
b19b0c6d
ILT
17542009-05-31 Mikolaj Zalewski <mikolajz@google.com>
1755
1756 * incremental.cc (Incremental_inputs::report_command_line): Filter
1757 out --incremental-* options.
1758
94cdfcff
DK
17592009-05-29 Doug Kwan <dougkwan@google.com>
1760
1761 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
1762 template class.
1763 (class Target_arm): Update comment.
1764 (Target_arm::Target_arm): Initialize new data members GOT_,
1765 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
1766 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
1767 and Target_arm::rel_dyn_section.
1768 Declare new_enum Target_arm::Got_type.
1769 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
1770 and DYNBSS_.
1771 Update commments for member do_dynsym_value.
1772 (Target_arm::got_size, Target_arm::plt_section,
1773 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
1774 new methods inside class defintion.
1775 (Target_arm::got_section): Define new method.
1776 (Target_arm::rel_dyn_section): Same.
1777 (Output_data_plt_arm): New template class.
1778 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
1779 (Output_data_plt_arm:do_adjust_output_section): Define new method.
1780 (Output_data_plt_arm::add_entry): Same.
1781 (Output_data_plt_arm::first_plt_entry): Define new
1782 static data member for PLT instruction template.
1783 (Output_data_plt_arm::plt_entry): Same.
1784 (Output_data_plt_arm::do_write): Define new method.
1785 (Target_arm::make_plt_entry): Same.
1786 (Target_arm::do_finalize_sections): Same.
1787 (Target_arm::do_dynsym_value): Same.
1788
4a657b0d
DK
17892009-05-28 Doug Kwan <dougkwan@google.com>
1790
1791 * Makefile.am (TARGETSOURCES): Add arm.cc.
1792 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
1793 * Makefile.in: Regenerate.
1794 * arm.cc: New file.
1795 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
1796
e7ae8c36
DK
17972009-05-26 Doug Kwan <dougkwan@google.com>
1798
1799 * options.cc (General_options::parse_exclude_libs). Fix a comment.
1800 (General_options::check_excluded_libs): Strip off directories in
1801 archive name before matching like GNU ld does.
1802 * testsuite/Makefile.am (MOSTLYCLEANFILES,
1803 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
1804 (exclude_libs_test_LDFLAGS): Add linker option
1805 -Wl,--exclude-libs,libexclude_libs_test_3
1806 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
1807 an explicit archive without using -l.
1808 (alt/libexclude_libs_test_3.a): New make rule.
1809 * testsuite/Makefile.in: Regenerate.
1810 * testsuite/exclude_libs_test.c : Declare lib3_default().
1811 (main): Call it.
1812 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
1813 * exclude_libs_test_3.c: New file.
1814
f12e7348
NC
18152009-05-26 Nick Clifton <nickc@redhat.com>
1816
1817 * po/id.po: New Indonesian translation.
1818 * po/gold.pot: Updated template file.
1819
4daadc0d
ST
18202009-05-22 Sriraman Tallam <tmsriram@google.com>
1821
1822 * testsuite/Makefile.am: Add -ffunction-sections to compile
1823 gc_comdat_test files. Add -Wl,--gc-sections to build
1824 gc_comdat_test.
1825 * testsuite/Makefile.in: Regenerate.
1826 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
1827
531813ad
ST
18282009-05-21 Sriraman Tallam <tmsriram@google.com>
1829
1830 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
1831 kept comdat section was garbage collected.
1832 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
1833 * testsuite/Makefile.in: Regenerate.
1834 * testsuite/gc_comdat_test.sh: New file.
1835 * testsuite/gc_comdat_test_1.cc: New file.
1836 * testsuite/gc_comdat_test_2.cc: New file.
1837
65514900
CC
18382009-05-19 Doug Kwan <dougkwan@google.com>
1839
1840 * archive.cc (Archive::Archive): Move constructor from archive.h
1841 to here. Initialize no_export_.
1842 (Archive::get_elf_object_for_member): Set no_export flag of object.
1843 * archive.h (Archive::Archive): Move constructor body to
1844 archive.cc.
1845 (Archive::no_export): New method.
1846 (Archive::no_export_): New field.
1847 * object.h (Object::Object): Initialize no_export_ to false.
1848 (Object::no_export, Object::set_no_export): New methods.
1849 (Object::no_export_): New field.
1850 * options.cc (General_options::parse_exclude_libs): New method.
1851 (General_options::check_excluded_libs) Same.
1852 * options.h (exclude_libs): New option.
1853 (General_options::check_excluded_libs): New method declaration.
1854 (General_options::excluded_libs_): New field.
1855 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
1856 default or protected visibility if an object has no-export flag set.
1857 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
1858 (check_SCRIPTS): Add exclude_libs_test.sh.
1859 (check_DATA): Add exclude_libs_test.syms.
1860 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
1861 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
1862 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
1863 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
1864 (exclude_libs_test.syms, libexclude_libs_test_1.a,
1865 libexclude_libs_test_2.a): New rules.
1866 * testsuite/Makefile.in: Regenerate.
1867 * testsuite/exclude_libs_test.c: New file.
1868 * testsuite/exclude_libs_test.sh: Ditto.
1869 * testsuite/exclude_libs_test_1.c: Ditto.
1870 * testsuite/exclude_libs_test_2.c: Ditto.
1871
1b77ea50
ILT
18722009-05-15 Ian Lance Taylor <iant@google.com>
1873
1874 * configure.ac: Check for declarations for cases where libiberty.h
1875 checks HAVE_DECL_xxx.
1876 * configure, config.in: Rebuild.
1877
072fe7ce
ILT
18782009-05-15 Mikolaj Zalewski <mikolajz@google.com>
1879
1880 * gold.h (Incremental_argument_list): Remove (invalid) forward
1881 declaration.
1882 * incremental.cc (Incremental_inputs::report_achive): New method.
1883 (Incremental_inputs::report_object): New method.
1884 (Incremental_inputs::report_script): New method.
1885 (Incremental_inputs::finalize_inputs): New method.
1886 (Incremental_inputs::finalize): Call finalize_inputs().
1887 (Incremental_inputs::sized_create_incremental_inputs_section_data):
1888 Create inputs entries.
1889 * incremental.h (Incremental_input_type): New enum.
1890 (Incremental_inputs::Incremental_input): Initialize new fields.
1891 (Incremental_inputs::report_inputs): New method.
1892 (Incremental_inputs::report_achive): New method.
1893 (Incremental_inputs::report_object): New method.
1894 (Incremental_inputs::report_script): New method.
1895 (Incremental_inputs::finalize_inputs): New method.
1896 (Incremental_inputs::Input_info): New struct.
1897 (Incremental_inputs::Input_info_map): New typedef.
1898 (Incremental_inputs::lock_): New field.
1899 (Incremental_inputs::Inputs_): New field.
1900 (Incremental_inputs::Inputs_map): New field.
1901 * main.cc (main): Call Incremental_input::report_inputs.
1902 * options.h (Input_argument_list): Typedef moved from
1903 Input_arguments.
1904 (Input_file_group::Files): Remove, use ::Input_argument_list.
1905 (Input_file_group::Input_argument_list): Remove, use
1906 ::Input_argument_list.
1907 * plugin.cc (Plugin_manager::add_input_file): Add error in
1908 incremental build.
1909 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
1910 functions.
1911 * script.cc (read_input_script): Call
1912 Incremental_input::report_script.
1913 * script.h (Script_info): New class.
1914
b0481b0b
ILT
19152009-04-27 Ian Lance Taylor <iant@google.com>
1916
1917 * x86_64.cc (do_adjust_output_section): Set entsize to
1918 plt_entry_size.
1919
b22a5a41 19202009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
1921
1922 * output.cc (Output_file::close): After short writes, continue
1923 writing from the correct offset in the buffer being written.
1924
40fde488
CD
19252009-04-23 Chris Demetriou <cgd@google.com>
1926
1927 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
1928 * configure: Regenerate.
1929 * config.in: Regenerate.
1930 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
1931 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
1932
3ce2c28e
ILT
19332009-04-21 Mikolaj Zalewski <mikolajz@google.com>
1934
1935 * incremental.cc (Incremental_inputs_header_data): Renamed from
1936 Incremental_input_header_data.
1937 (Incremental_inputs_header_data::data_size): New field.
1938 (Incremental_inputs_header_data::put_input_file_count): Renamed
1939 from input_file_count.
1940 (Incremental_inputs_header_data::put_command_line_offset): Renamed
1941 from command_line_offset.
1942 (Incremental_inputs_header_data::put_reserved): Renamed from
1943 put_reserved.
1944 (Incremental_inputs_entry_data): Renamed from
1945 Incremental_input_entry_data.
1946 (Incremental_inputs_entry_data::data_size): New field.
1947 (Incremental_inputs::report_command_line): New method.
1948 (Incremental_inputs::finalize): New method.
1949 (Incremental_inputs::create_incremental_inputs_data): New method.
1950 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
1951 * incremental.h: New file.
1952 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
1953 (Layout::finalize): Create incremental inputs section in
1954 incremental builds.
1955 (Layout::create_incremental_info_sections): New method.
1956 * layout.h (Layout::incremental_inputs): New method.
1957 (Layout::create_incremental_info_sections): New method.
1958 (Layout::incremental_inputs_): New field.
1959 * main.cc (main): Notify Incremental_input of the command line.
1960
e55bde5e
ILT
19612009-04-01 Ian Lance Taylor <iant@google.com>
1962 Mikolaj Zalewski <mikolajz@google.com>
1963
1964 * gold.h (reserve_unordered_map): Define, three versions, one for
1965 each version of Unordered_map.
1966 * layout.cc (Layout::Layout): Remove options parameter. Add
1967 number_of_input_files parameter. Don't initialize options_.
1968 Initialize number_of_input_files_ and resized_signatures_. Move
1969 sections_are_attached_.
1970 (Layout::layout_group): Reserve space for group_signatures_.
1971 (Layout::find_or_add_kept_section): Change name parameter to be a
1972 reference. Resize signatures_ map when it gets large enough.
1973 (Layout::layout_eh_frame): Use parameters->options() instead of
1974 this->options_.
1975 (Layout::make_output_section): Likewise.
1976 (Layout::attach_allocated_section_to_segment): Likewise.
1977 (Layout::finalize, Layout::create_executable_stack): Likewise.
1978 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
1979 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
1980 * layout.h (class Layout): Update declarations. Remove options_
1981 field. Add number_of_input_files_ and resized_signatures_
1982 fields. Move sections_are_attached_ field.
1983 * main.cc (main): Pass number of input files to Layout
1984 constructor. Don't pass options.
1985
154b857c
ILT
19862009-03-30 Ian Lance Taylor <iant@google.com>
1987
1988 * ffsll.c (ffsll): Correct implementation.
1989
2f35ab9b
ILT
19902009-03-27 Ian Lance Taylor <iant@google.com>
1991
fd03461a
ILT
1992 * ffsll.c: New file.
1993 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
1994 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
1995 * ftruncate.c (ftruncate): Declare before definition.
1996 * mremap.c (mremap): Likewise.
1997 * pread.c (pread): Likewise.
1998 * configure, Makefile.in, config.in: Rebuild.
1999
2f35ab9b
ILT
2000 * mremap.c: New file.
2001 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
2002 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
2003 (mremap): Declare if HAVE_MREMAP is not defined.
2004 * configure, Makefile.in, config.in: Rebuild.
2005
33aea2fd
CC
20062009-03-27 Cary Coutant <ccoutant@google.com>
2007
2008 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
2009 position independent.
2010 * sparc.cc (Target_sparc::check_non_pic): Likewise.
2011 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
2012
6d479619
CC
20132009-03-24 Cary Coutant <ccoutant@google.com>
2014
2015 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
2016 an executable.
2017 (needs_dynamic_reloc): Likewise.
2018
afc06bb8
ILT
20192009-03-24 Ian Lance Taylor <iant@google.com>
2020
2021 * yyscript.y (file_cmd): Recognize EXTERN.
2022 (extern_name_list, extern_name_list_body): New nonterminals.
2023 * script.cc (script_add_extern): Define.
2024 * script-c.h (script_add_extern): Declare.
2025
f6060a4d
ILT
20262009-03-24 Rafael Avila de Espindola <espindola@google.com>
2027
2028 * object.cc (is_elf_object): Define.
2029 * object.h (is_elf_object): Declare.
2030 * archive.cc (Archive::get_elf_object_for_member): Call
2031 is_elf_object.
33aea2fd 2032 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 2033
26736d8e
ILT
20342009-03-24 Elliott Hughes <enh@google.com>
2035
2036 * output.cc (Output_file::map_anonymous): Define.
2037 (Output_file::map): Use map_anonymous. If the regular mmap fails,
2038 try an anonymous one. Report the size if the mmap fails.
2039 * output.h (class Output_file): Declare map_anonymous.
2040
22fd9730
ILT
20412009-03-24 Ian Lance Taylor <iant@google.com>
2042
2043 * target-select.cc (instantiate_target): Don't acquire the lock if
2044 the instantiated_target_ field has already been set.
2045
cb010894
ILT
20462009-03-23 Ian Lance Taylor <iant@google.com>
2047
7f055c20
ILT
2048 * gold-threads.h (class Initialize_lock): Define.
2049 * gold-threads.cc (class Initialize_lock_once): Define.
2050 (initialize_lock_control): New static variable.
2051 (initialize_lock_pointer): New static variable.
2052 (initialize_lock_once): New static function.
2053 (Initialize_lock::Initialize_lock): Define.
2054 (Initialize_lock::initialize): Define.
2055 * target-select.h: Include "gold-threads.h".
2056 (class Target_selector): Add lock_ and initialize_lock_ fields.
2057 Don't define instantiate_target, just declare it.
2058 * target-select.cc (Target_selector::Target_selector): Initialize
2059 new fields.
2060 (Target_selector::instantiate_target): Define.
2061 * descriptors.h: Include "gold-threads.h".
2062 (class Descriptors): Add initialize_lock_ field.
2063 * descriptors.cc (Descriptors::Descriptors): Initialize new
2064 field.
2065 (Descriptors::open): Use initialize_lock_ field
2066 * errors.h (class Errors): Add initialize_lock_ field.
2067 * errors.cc (Errors::Errors): Initialize new field.
2068 (Errors::initialize_lock): Use initialize_lock_ field.
2069 * powerpc.cc (class Target_selector_powerpc): Remove
2070 instantiated_target_ field. In do_recognize call
2071 instantiate_target rather than do_instantiate_target. In
2072 do_instantiate_target just allocate a new target.
2073 * sparc.cc (class Target_selector_sparc): Likewise.
2074
36959681
ILT
2075 * freebsd.h: New file.
2076 * i386.cc: Include "freebsd.h".
2077 (Target_i386): Derive from Target_freebsd rather than
2078 Sized_target.
2079 (Target_selector_i386): Derive from Target_selector_freebsd rather
2080 than Target_selector.
2081 * x86_64.cc: Include "freebsd.h".
2082 (Target_x86_64): Derive from Target_freebsd rather than
2083 Sized_target.
2084 (Target_selector_x86_64): Derive from Target_selector_freebsd
2085 rather than Target_selector.
2086 * target.h (class Target): Add adjust_elf_header and
2087 do_adjust_elf_header.
2088 * output.cc (Output_file_header:: do_sized_write): Call target
2089 adjust_elf_header routine.
2090 * configure.tgt: Set targ_osabi.
2091 * configure.ac: Define GOLD_DEFAULT_OSABI.
2092 * parameters.cc (Parameters::default_target): Pass
2093 GOLD_DEFAULT_OSABI to select_target.
2094 * target-select.h (class Target_selector): Make instantiate_target
2095 protected rather than private.
2096 * Makefile.am (HFILES): Add freebsd.h.
2097 * configure, Makefile.in, config.in: Rebuild.
2098
cb010894
ILT
2099 * merge.cc (do_add_input_section): Correct pend value. Change
2100 message about last entry not being null terminated from error to
2101 warning.
2102
0e879927
ILT
21032009-03-20 Mikolaj Zalewski <mikolajz@google.com>
2104
2105 * incremental.cc: New file.
2106 * Makefile.am (CCFILES): Add incremental.cc.
2107 * Makefile.in: Rebuild.
2108
41105937
PP
21092009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
2110
2111 * layout.cc (Layout::output_section_name): Preserve names
2112 of '.note.' sections.
2113
60439920
ILT
21142009-03-19 Ian Lance Taylor <iant@google.com>
2115
2116 * descriptors.cc (Descriptors::open): Check that the options are
2117 valid before using them.
2118
0d371ad3
ILT
21192009-03-18 Ian Lance Taylor <iant@google.com>
2120
2121 * script-sections.h: Include <list>.
2122 (class Script_sections): Change Sections_elements from std::vector
2123 to std::list. Typedef public Elements_iterator. Add
2124 orphan_section_placement_, data_segment_align_start_, and
2125 saw_data_segment_align_ fields. Remove data_segment_align_index_
2126 field.
2127 * script-sections.cc (class Orphan_section_placement): New class.
2128 (class Sections_element): Add virtual functions is_relro and
2129 orphan_section_init. Remove virtual function place_orphan_here.
2130 (class Output_section_definition): Add is_relro and
2131 orphan_section_init. Remove place_orphan_here.
2132 (class Orphan_output_section): Likewise.
2133 (Script_sections::Script_sections): Update for field changes.
2134 (Script_sections::data_segment_align): Set saw_data_segment_align_
2135 and data_segment_align_start_, not data_segment_align_index.
2136 (Script_sections::data_segment_relro_end): Check
2137 saw_data_segment_align_. Use data_segment_align_start_ rather
2138 than data_segment_align_index_.
2139 (Script_sections::place_orphan): Rewrite to use
2140 Orphan_section_placement.
2141
9201d894
ILT
21422009-03-17 Ian Lance Taylor <iant@google.com>
2143
9c5b8369
ILT
2144 * archive.cc (Archive::add_symbols): Check for a version attached
2145 to the symbol name in the archive map.
2146 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
2147 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
2148 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
2149 (ver_test_11.a): New target.
2150 * testsuite/Makefile.in: Rebuild.
2151
9201d894
ILT
2152 * configure.ac: Check for chsize and posix_fallocate. Replace
2153 ftruncate.
2154 * ftruncate.c: New file, from gnulib.
2155 * output.cc (posix_fallocate): Define dummy version if not
2156 HAVE_POSIX_FALLOCATE.
2157 (Output_file::map): Call posix_fallocate rather than lseek and
2158 write.
2159 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
2160 * configure, Makefile.in, config.in: Rebuild.
2161
ef4ab7a8
PP
21622009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
2163
2164 * layout.h (Layout::create_note): Add section_name parameter.
2165 * layout.cc (Layout::create_note): Likewise.
2166 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
2167
8c500701
ILT
21682009-03-17 Ian Lance Taylor <iant@google.com>
2169
e85b18e1
ILT
2170 * descriptors.cc: Include "options.h".
2171 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
2172 (Descriptors::open): Always use O_CLOEXEC when opening a new
2173 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
2174 then set FD_CLOEXEC.
2175
9efe6174
ILT
2176 * sparc.cc (class Target_sparc): Add has_got_section.
2177 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
2178 make sure we have a GOT section.
2179
2180 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
2181 (Target_sparc::Scan::local): Likewise.
2182 (Target_sparc::Scan::global): Likewise.
2183 (Target_sparc::Relocate::relocate): Likewise.
2184 (Target_sparc::Relocate::relocate_tls): Likewise.
2185
8c500701
ILT
2186 * symtab.cc (Symbol_table::define_default_version): New function,
2187 broken out of add_from_object.
2188 (Symbol_table::add_from_object): Call define_default_version.
2189 (Symbol_table::define_special_symbol): Add resolve_oldsym
2190 parameter. Change all callers. If the version for a symbol comes
2191 from a version script, resolve it with the symbol with the same
2192 name with no version. Also add the symbol without a version if
2193 appropriate.
2194 (do_define_in_output_data): If resolving with oldsym, don't delete
2195 sym.
2196 (do_define_in_output_segment): Likewise.
2197 (do_define_as_constant): Likewise.
2198 * symtab.h (class Symbol_table): Update declarations.
2199
f1ed28fb
ILT
22002009-03-13 Ian Lance Taylor <iant@google.com>
2201
15f8229b
ILT
2202 * readsyms.cc (Read_symbols::incompatible_warning): New function.
2203 (Read_symbols::requeue): New function.
2204 (Read_symbols::do_read_symbols): If make_elf_object fails because
2205 the target type is not configured, and the file was searched for,
2206 issue a warning and retry with the next directory.
2207 (Add_symbols::run): If the file has an incompatible format, and
2208 it was searched for, requeue the Read_symbols task. On error,
2209 release the object.
2210 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
2211 dirindex parameter to constructor. Change all callers. Declare
2212 incompatible_warning and requeue.
2213 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
2214 input_argument_ and input_group_ fields. Add them to
2215 constructor. Change all callers.
2216 (class Read_script): Add dirindex_ field. Add it to constructor.
2217 Change all callers.
2218 * archive.cc (Archive::setup): Remove input_objects parameter.
2219 Change all callers.
2220 (Archive::get_file_and_offset): Likewise.
2221 (Archive::read_all_symbols): Likewise.
2222 (Archive::read_symbols): Likewise.
2223 (Archive::get_elf_object_for_member): Remove input_objects
2224 parameter. Add punconfigured parameter. Change all callers.
2225 (Archive::add_symbols): Change return type to bool. Check return
2226 value of include_member.
2227 (Archive::include_all_members): Likewise.
2228 (Archive::include_member): Change return type to bool. Return
2229 false if first included object has incompatible target. Set
2230 included_member_ field.
2231 (Add_archive_symbols::run): If add_symbols returns false, requeue
2232 Read_symbols task.
2233 * archive.h (class Archive): Add included_member_ field.
2234 Initialize it in constructor. Add input_file and searched_for
2235 methods. Update declarations.
2236 (class Add_archive_symbols): Add dirpath_, dirindex_, and
2237 input_argument_ fields. Add them to constructor. Change all
2238 callers.
2239 * script.cc: Include "target-select.h".
2240 (class Parser_closure): Add skip_on_incompatible_target_ and
2241 found_incompatible_target_ fields. Add
2242 skip_on_incompatible_target parameter to constructor. Change all
2243 callers. Add methods skip_on_incompatible_target,
2244 clear_skip_on_incompatible_target, found_incompatible_target, and
2245 set_found_incompatible_target.
2246 (read_input_script): Add dirindex parameter. Change all callers.
2247 If parser finds an incompatible target, requeue Read_symbols
2248 task.
2249 (script_set_symbol): Clear skip_on_incompatible_target in
2250 closure.
2251 (script_add_assertion, script_parse_option): Likewise.
2252 (script_start_sections, script_add_phdr): Likewise.
2253 (script_check_output_format): New function.
2254 * script.h (read_input_script): Update declaration.
2255 * script-c.h (script_check_output_format): Declare.
2256 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
2257 (ignore_cmd): Remove OUTPUT_FORMAT.
2258 * fileread.cc (Input_file::Input_file): Add explicit this.
2259 (Input_file::will_search_for): New function.
2260 (Input_file::open): Add pindex parameter. Change all callers.
2261 * fileread.h (class Input_file): Add input_file_argument method.
2262 Declare will_search_for. Update declarations.
2263 * object.cc (make_elf_object): Add punconfigured parameter.
2264 Change all callers.
2265 * object.h (class Object): Make input_file public. Add
2266 searched_for method.
2267 (make_elf_object): Update declaration.
2268 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
2269 restart search.
2270 * dirsearch.h (class Dirsearch): Update declaration.
2271 * options.h (class General_options): Add --warn-search-mismatch.
2272 * parameters.cc (Parameters::is_compatible_target): New function.
2273 * parameters.h (class Parameters): Declare is_compatible_target.
2274 * workqueue.cc (Workqueue::add_blocker): New function.
2275 * workqueue.h (class Workqueue): Declare add_blocker.
2276
f1ed28fb
ILT
2277 * fileread.cc (Input_file::open): Remove options parameter.
2278 Change all callers.
2279 (Input_file::open_binary): Likewise.
2280 * script.cc (read_input_script): Likewise.
2281 * readsyms.h (class Read_symbols): Remove options_ field. Remove
2282 options parameter from constructor. Change all callers.
2283 (class Read_script): Likewise.
2284 * fileread.h (class Input_file): Update declarations.
2285 * script.h (read_input_script): Update declaration.
2286
34dd024a
NC
22872009-03-10 Nick Clifton <nickc@redhat.com>
2288
2289 * po/es.po: New Spanish translation.
2290
6d71b17c
CC
22912009-03-06 Cary Coutant <ccoutant@google.com>
2292
2293 * options.cc (parse_short_option): Keep dash_z from registering itself.
2294
031cdbed
ILT
22952009-03-03 Ian Lance Taylor <iant@google.com>
2296
2297 PR 9918
2298 * target-reloc.h (relocate_section): Pass output_section to
2299 relocate.
2300 * i386.cc (Target_i386::should_apply_static_reloc): Add
2301 output_section parameter. Change all callers.
2302 (Target_i386::Relocate::relocate): Add output_section parameter.
2303 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
2304 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
2305 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
2306 * testsuite/two_file_shared.sh: New script.
2307 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
2308 (check_DATA): Add two_file_shared.dbg.
2309 (two_file_shared.dbg): New target.
2310 * testsuite/Makefile.in: Rebuild.
2311
15d5fa16
ILT
23122009-03-01 Ian Lance Taylor <iant@google.com>
2313
2314 * configure.ac: Check for byteswap.h.
2315 * configure: Rebuild.
2316 * config.in: Rebuild.
2317
8a4c0b0d
ILT
23182009-03-01 Mikolaj Zalewski <mikolajz@google.com>
2319
2320 * layout.cc (Layout::find_or_add_kept_section): New function.
2321 (Layout::add_comdat): Removed.
2322 * layout.h (struct Kept_section): Move out of class Layout.
2323 Remove trailing underscores from field names. Add group_sections
2324 field. Rename group_ field to is_group. Change all uses.
2325 (class Layout): Declare find_or_add_kept_section, not add_comdat.
2326 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
2327 comdat_groups_ field.
2328 (Sized_relobj::include_section_group): Use
2329 find_or_add_kept_section and Kept_section::group_sections.
2330 (Sized_relobj::include_linkonce_section): Likewise.
2331 * object.cc (class Sized_relobj): Don't define Comdat_group or
2332 Comdat_group_table. Remove find_comdat_group and
2333 add_comdat_group. Remove comdat_groups_ field.
2334 * plugin.cc (include_comdat_group): Use
2335 Layout::find_or_add_kept_section.
2336
b4ecf66b
ILT
23372009-02-28 Ian Lance Taylor <iant@google.com>
2338
14359ca0
ILT
2339 * README: --gc-sections and map files are now supported. Document
2340 some build requirements.
2341
b4ecf66b
ILT
2342 PR 6992
2343 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
2344 relocatable link set the value of the section symbol to zero.
2345 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
2346 relocatable link don't include the section address in the local
2347 symbol value.
2348
0602e05a
ILT
23492009-02-27 Ian Lance Taylor <iant@google.com>
2350
fd9d194f
ILT
2351 PR 6811
2352 * options.h (class Search_directory): Add is_system_directory.
2353 (class General_options): Declare is_in_system_directory.
2354 * options.cc (get_relative_sysroot): Make static.
2355 (get_default_sysroot): Make static.
2356 (General_optoins::is_in_system_directory): New function.
2357 * fileread.cc (Input_file::is_in_system_directory): New function.
2358 * fileread.h (class Input_file): Declare is_in_system_directory.
2359 * object.h (class Object): Add is_in_system_directory.
2360 (class Input_objects): Remove system_library_directory_ field.
2361 * object.cc (Input_objects::add_object): Don't set
2362 system_library_directory_.
2363 (input_objects::found_in_system_library_directory): Remove.
2364 * symtab.cc (Symbol_table::write_globals): Remove input_objects
2365 parameter. Change all callers.
2366 (Symbol_table::sized_write_globals): Likewise.
2367 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
2368 Call Object::is_in_system_directory.
2369 * symtab.h (class Symbol_table): Update declarations.
2370
61edd21f
ILT
2371 PR 5990
2372 * descriptors.h (Open_descriptor): Add is_on_stack field.
2373 * descriptors.cc (Descriptors::open): If the descriptor is on the
2374 top of the stack, remove it. Initialize is_on_stack field.
2375 (Descriptors::release): Only add pod to stack if it is not on the
2376 stack already.
2377 (Descriptors::close_some_descriptor): Clear stack_next and
2378 is_on_stack fields.
2379
e29e076a
ILT
2380 PR 7091
2381 * output.cc (Output_section::find_starting_output_address): Rename
2382 from starting_output_address; add PADDR parameter; change return
2383 type.
2384 * output.h (class Output_section): Declare
2385 find_starting_output_address instead of starting_output_address.
2386 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
2387 section symbol for which we can't find a merge section.
2388
0602e05a
ILT
2389 PR 9836
2390 * symtab.cc (Symbol_table::add_from_object): If the visibility is
2391 hidden or internal, force the symbol to be local.
2392 * resolve.cc (Symbol::override_visibility): Define.
2393 (Symbol::override_base): Use override_visibility.
2394 (Symbol_table::resolve): Likewise.
2395 (Symbol::override_base_with_special): Likewise.
2396 (Symbol_table::override_with_special): If the visibility is hidden
2397 or internal, force the symbol to be local.
2398 * symtab.h (class Symbol): Add set_visibility and
2399 override_visibility.
2400 * testsuite/ver_test_1.sh: New file.
2401 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
2402 (check_DATA): Add ver_test_1.syms.
2403 (ver_test_1.syms): New target.
2404 * testsuite/Makefile.in: Rebuild.
2405
401a9a73
CC
24062009-02-25 Cary Coutant <ccoutant@google.com>
2407
2408 * layout.cc (Layout::choose_output_section): Don't rename sections
2409 when using a linker script that has a SECTIONS clause.
2410 * Makefile.in: Regenerate.
2411
2412 * testsuite/Makefile.am (script_test_5.sh): New test case.
2413 * testsuite/Makefile.in: Regenerate.
2414 * testsuite/script_test_5.cc: New file.
2415 * testsuite/script_test_5.sh: New file.
2416 * testsuite/script_test_5.t: New file.
2417
f488e4b0
CC
24182009-02-13 Rafael Avila de Espindola <espindola@google.com>
2419
2420 * archive.cc (Archive::include_member): Update calls to add_symbols.
2421 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
2422 the Layout argument.
2423 * dynobj.h (do_add_symbols): Add the Layout argument.
2424 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
2425 Layout argument.
2426 * object.h (Object::add_symbols): Add the Layout argument.
2427 (Object::do_add_symbols): Add the Layout argument.
2428 (Sized_relobj::do_add_symbols): Add the Layout argument.
2429 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
2430 Unify the two versions.
2431 (Add_plugin_symbols): Remove.
2432 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
2433 (Sized_pluginobj::do_add_symbols): Unify the two versions.
2434 (Add_plugin_symbols): Remove.
2435 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
2436 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
2437 (Add_symbols::run): Make it work with Pulginobj.
2438
89dd1680
ILT
24392009-02-06 Ian Lance Taylor <iant@google.com>
2440
2441 * object.cc (Sized_relobj::do_layout): Make info message start
2442 with lower case letter.
2443
266d0a74
ILT
24442009-02-06 Mikolaj Zalewski <mikolajz@google.com>
2445
602b464e
ILT
2446 * binary.cc: Fix file comment.
2447
266d0a74
ILT
2448 * options.h (enum Incremental_disposition): Define.
2449 (class General_options): Add new options: --incremental,
2450 --incremental_changed, --incremental_unchanged,
2451 --incremental_unknown. Add incremental_disposition_ and
2452 implicit_incremental_ fields.
2453 (General_options::incremental_disposition): New function.
2454 (class Position_dependent_options): Add incremental_disposition
2455 option.
2456 (Position_dependent_options::copy_from_options): Set incremental
2457 dispositions.
2458 * options.cc (General_options::parse_incremental_changed): New
2459 function.
2460 (General_options::parse_incremental_unchanged): New function.
2461 (General_options::parse_incremental_unknown): New function.
2462 (General_options::General_options): Initialize new fields
2463 incremental_disposition_ and implicit_incremental_.
2464 (General_options::finalize): Check for uasge of --incremental-*
2465 without --incremental.
2466
f073bbf7
CD
24672009-02-06 Chris Demetriou <cgd@google.com>
2468
2469 * gold.h (gold_undefined_symbol): Change to take only a Symbol
2470 pointer and to report location as the file name associated with
2471 the symbol.
2472 (gold_undefined_symbol_at_location): New function to replace the
2473 old gold_undefined_symbol functionality.
2474 * target-reloc.h (relocate_section): Update to use
2475 gold_undefined_symbol_at_location.
2476 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
2477 Call gold_undefined_symbol function rather than gold_error.
2478 * errors.h (Errors::undefined_symbol): Take location as a
2479 string, rather than calculating it from a relocation.
2480 * errors.cc (Errors::fatal): Print "fatal error:" before the
2481 formatted message.
2482 (Errors::error, Errors::error_at_location): Print "error: "
2483 before the formatted message.
2484 (Errors::undefined_symbol): Take location as a string, rather
2485 than calculating it from a relocation.
2486 (gold_undefined_symbol_at_location): New function akin to
2487 old gold_undefined_symbol, calculates location from relocation.
2488 (gold_undefined_symbol): Change to take only a Symbol pointer
2489 and to report location as the file name associated with the symbol.
2490 * testsuite/debug_msg.sh: Update for changed error messages.
2491 * testsuite/undef_symbol.sh: Likewise.
2492
8e94a90c
ILT
24932009-02-04 Duncan Sands <baldrick@free.fr>
2494
2495 PR 9812
2496 * reduced_debug_output.h
2497 (Output_reduced_debug_abbrev_section::failed): Use format for
2498 gold_warning.
2499 (Output_reduced_debug_info_section::faild): Likewise.
2500
88a0e15b
ILT
25012009-01-31 Mikolaj Zalewski <mikolajz@google.com>
2502
2503 * script.cc (Lazy_demangler): New class.
2504 (Version_script_info::get_symbol_version_helper): Demangle a
2505 symbol only once.
2506
5efc7cd2
CC
25072009-01-29 Cary Coutant <ccoutant@google.com>
2508
2509 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
2510 to __tls_get_addr.
2511 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
2512
e0ebcf42
ILT
25132009-01-28 Ian Lance Taylor <iant@google.com>
2514
5efc7cd2 2515 * version.cc (version_string): Bump to 1.9.
75fe7426 2516
e0ebcf42
ILT
2517 * gold.h: Include <cstring> and <stdint.h>.
2518 * version.cc: Include <cstdio>.
2519 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
2520 warning.
2521 * reduced_debug_output.cc (insert_into_vector): Rename from
2522 Insert_into_vector; change all callers. Use Swap_unaligned to
2523 avoid aliasing issue; remove union since it is unnecessary.
2524
8e2813be 25252009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
2526
2527 * Makefile.am (CCFILES): Add gc.cc.
2528 (HFILES): Add gc.h.
2529 * Makefile.in: Regenerate.
2530 * gold.cc (Gc_runner): New class.
2531 (queue_initial_tasks): Call garbage collection related tasks
2532 when corresponding options are invoked.
2533 (queue_middle_gc_tasks): New function.
2534 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
2535 processed early before laying out sections during garbage collection.
2536 * gold.h (queue_middle_gc_tasks): New function.
2537 (is_prefix_of): Move from "layout.cc".
2538 * i386.cc (Target_i386::gc_process_relocs): New function.
2539 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
2540 * main.cc (main): Create object of class "Garbage_collection".
2541 * object.cc (Relobj::copy_symbols_data): New function.
2542 (Relobj::is_section_name_included): New function.
2543 (Sized_relobj::do_layout): Allow this function to be called twice
2544 during garbage collection and defer layout of section during the
2545 first call.
2546 * object.h (Relobj::get_symbols_data): New function.
2547 (Relobj::is_section_name_included): New function.
2548 (Relobj::copy_symbols_data): New function.
2549 (Relobj::set_symbols_data): New function.
2550 (Relobj::get_relocs_data): New function.
2551 (Relobj::set_relocs_data): New function.
2552 (Relobj::is_output_section_offset_invalid): New pure virtual function.
2553 (Relobj::gc_process_relocs): New function.
2554 (Relobj::do_gc_process_relocs): New pure virtual function.
2555 (Relobj::sd_): New data member.
2556 (Sized_relobj::is_output_section_offset_invalid): New function.
2557 (Sized_relobj::do_gc_process_relocs): New function.
2558 * options.h (General_options::gc_sections): Modify to not be a no-op.
2559 (General_options::print_gc_sections): New option.
2560 * plugin.cc (Plugin_finish::run): Remove function call to
2561 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
2562 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
2563 * reloc.cc (Read_relocs::run): Add task to process relocs and
2564 determine unreferenced sections when doing garbage collection.
2565 (Gc_process_relocs): New class.
2566 (Sized_relobj::do_gc_process_relocs): New function.
2567 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
2568 sections that are garbage collected.
2569 * reloc.h (Gc_process_relocs): New class.
2570 * sparc.cc (Target_sparc::gc_process_relocs): New function.
2571 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
2572 symbols whose corresponding sections are garbage collected.
2573 (Symbol_table::Symbol_table): Add new parameter for the garbage
2574 collection object.
2575 (Symbol_table::gc_mark_undef_symbols): New function.
2576 (Symbol_table::gc_mark_symbol_for_shlib): New function.
2577 (Symbol_table::gc_mark_dyn_syms): New function.
2578 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
2579 as garbage.
2580 (Symbol_table::add_from_object): Likewise.
2581 (Symbol_table::add_from_relobj): When building shared objects, do not
2582 treat externally visible symbols as garbage.
2583 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
2584 table information for static and relocatable links.
2585 * symtab.h (Symbol_table::set_gc): New function.
2586 (Symbol_table::gc): New function.
2587 (Symbol_table::gc_mark_undef_symbols): New function.
2588 (Symbol_table::gc_mark_symbol_for_shlib): New function.
2589 (Symbol_table::gc_mark_dyn_syms): New function.
2590 (Symbol_table::gc_): New data member.
2591 * target.h (Sized_target::gc_process_relocs): New pure virtual
2592 function.
2593 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
2594 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
2595
3b293544
CF
25962009-01-20 Chris Faylor <me.sourceware@sourceware.org>
2597
2598 * options.h (General_options::gc_sections): Define as a no-op for now.
2599 (General_options::no_keep_memory): Ditto.
2600 (General_options::Bshareable): Define.
2601 * options.cc (General_options::finalize): Honor -Bshareable.
2602
83d22aa8
AS
26032009-01-20 Andreas Schwab <schwab@suse.de>
2604
2605 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
2606 read the value in the contents, since we don't use it. Use the
2607 template endianness when writing.
2608 (Relocate::relocate): Use it for R_PPC_REL16_HA.
2609
cd536b21
AS
26102009-01-19 Andreas Schwab <schwab@suse.de>
2611
2612 * configure.tgt (powerpc64-*): Fix targ_obj.
2613
99e9a495
ILT
26142009-01-15 Ian Lance Taylor <iant@google.com>
2615
2616 * object.cc (Sized_relobj::write_local_symbols): Don't write out
2617 local symbols when stripping all symbols.
2618
bbbfea06
CC
26192009-01-14 Cary Coutant <ccoutant@google.com>
2620
99e9a495 2621 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 2622
0f7c0701
CC
26232009-01-14 Cary Coutant <ccoutant@google.com>
2624
2625 * archive.cc (Archive::get_elf_object_for_member): Remove call
2626 to File_read::claim_for_plugin.
2627 * descriptors.cc (Descriptors::open): Remove reference to
2628 is_claimed.
2629 (Descriptors::claim_for_plugin): Remove.
2630 * descriptors.h (Descriptors::claim_for_plugin): Remove.
2631 (Descriptors::is_claimed): Remove.
2632 (claim_descriptor_for_plugin): Remove.
2633 * fileread.cc (File_read::claim_for_plugin): Remove.
2634 * fileread.h (File_read::claim_for_plugin): Remove.
2635 (File_read::descriptor): Reopen descriptor if necessary.
2636 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
2637 (Plugin_manager::all_symbols_read): Add task parameter. Change
2638 all callers.
2639 (Plugin_manager::get_input_file): New function.
2640 (Plugin_manager::release_input_file): New function.
2641 (Pluginobj::Pluginobj): Add filesize parameter and initialize
2642 corresponding data member.
2643 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
2644 and pass to base constructor. Change all callers.
2645 (get_input_file, release_input_file): New functions.
2646 (make_sized_plugin_object): Add filesize parameter. Change all callers.
2647 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
2648 (Plugin_manager::all_symbols_read): Add task parameter.
2649 (Plugin_manager::get_input_file): New function.
2650 (Plugin_manager::release_input_file): New function.
2651 (Plugin_manager::task_): New data member.
2652 (Pluginobj::Pluginobj): Add filesize parameter.
2653 (Pluginobj::filename): New function.
2654 (Pluginobj::descriptor): New function.
2655 (Pluginobj::filesize): New function.
2656 (Pluginobj::filesize_): New data member.
2657 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
2658 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
2659 File_read::claim_for_plugin; use Object::unlock to unlock the file.
2660
2661 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
2662 with archive libraries.
2663 * testsuite/Makefile.in: Regenerate.
2664 * testsuite/plugin_test.c (struct sym_info): New type.
2665 (get_input_file, release_input_file): New static variables.
2666 (onload): Capture new transfer vector entries.
2667 (claim_file_hook): Stop reading at end of file according to filesize.
2668 Factor out parsing of readelf output into separate function.
2669 (all_symbols_read_hook): Exercise get_input_file and release_input_file
2670 APIs and get the source file name from the symbol table. Convert
2671 source file name to corresponding object file name. Print info
2672 message when adding new input files.
2673 (parse_readelf_line): New function.
2674 * testsuite/plugin_test_1.sh: Add checks for new info messages.
2675 * testsuite/plugin_test_2.sh: Likewise.
2676 * testsuite/plugin_test_3.sh: Likewise.
2677 * testsuite/plugin_test_4.sh: New test case.
2678
62a6d109
ILT
26792009-01-07 Ian Lance Taylor <iant@google.com>
2680
2681 * version.cc (version_string): Bump to 1.8.
2682
483620e8
CC
26832008-12-23 Cary Coutant <ccoutant@google.com>
2684
2685 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
2686 * plugin.cc (Plugin_manager::finish): Rename as
2687 layout_deferred_objects. Move cleanup to separate function.
2688 (Plugin_manager::cleanup): New function.
2689 (Plugin_finish::run): Call layout_deferred_objects and cleanup
2690 separately.
2691 * plugin.h (Plugin_manager::finish): Rename as
2692 layout_deferred_objects.
2693 (Plugin_manager::cleanup): New function.
2694 (Plugin_manager::cleanup_done): New field.
2695
d66a9eb3
CC
26962008-12-23 Cary Coutant <ccoutant@google.com>
2697
2698 * plugin.cc (is_visible_from_outside): New function.
2699 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
2700 so we don't return "IR only" status for exported symbols or -r links.
2701
2702 * testsuite/Makefile.am (plugin_test_3): New test case.
2703 * testsuite/Makefile.in: Regenerate.
2704 * testsuite/plugin_test_3.sh: New file.
2705
5995b570
CC
27062008-12-22 Cary Coutant <ccoutant@google.com>
2707
2708 * object.cc (Sized_relobj::layout_section): New function.
2709 (Sized_relobj::do_layout): Defer layout of input sections until after
2710 plugin has provided replacement files.
2711 (Sized_relobj::do_layout_deferred_sections): New function.
2712 * object.h (Relobj::set_section_offset): Remove virtual keyword.
2713 (Relobj::layout_deferred_sections): New function.
2714 (Relobj::do_layout_deferred_sections): New function.
2715 (Sized_relobj::do_layout_deferred_sections): New function.
2716 (Sized_relobj::layout_section): New function.
2717 (Sized_relobj::Deferred_layout): New structure.
2718 (Sized_relobj::deferred_layout_): New field.
2719 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
2720 Change all callers. Layout deferred sections.
2721 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
2722 references.
2723 (Plugin_hook::run): Move code from do_plugin_hook inline.
2724 (Plugin_hook::do_plugin_hook): Remove.
2725 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
2726 (Plugin_manager::finish): Renamed, was cleanup.
2727 (Plugin_manager::should_defer_layout): New function.
2728 (Plugin_manager::add_deferred_layout_object): New function.
2729 (Plugin_manager::Deferred_layout_list): New type.
2730 (Plugin_manager::deferred_layout_objects_): New field.
2731 (Plugin_hook::do_plugin_hook): Remove.
2732
ee769c88
ILT
27332008-12-17 Ian Lance Taylor <iant@google.com>
2734
2735 * options.h (class General_options): Add --no case for
2736 --export-dynamic.
2737
abc8dcba
CC
27382008-12-16 Cary Coutant <ccoutant@google.com>
2739
2740 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
2741 vector.
2742 (Plugin_manager::claim_file): Create plugin object even if
2743 plugin did not call the add_symbols callback.
2744 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
2745 asking for more symbols than were added.
2746 * testsuite/Makefile.am (plugin_test_1): Add test case with
2747 no global symbols.
2748 (empty.syms): New target.
2749 * testsuite/Makefile.in: Regenerate.
2750 * testsuite/plugin_test.c (claim_file_hook): Add new debug
2751 message. Don't call add_symbols if no globals.
2752 (all_symbols_read_hook): Don't provide replacement for empty
2753 claimed file.
2754
b0074644
ILT
27552008-12-12 Ian Lance Taylor <iant@google.com>
2756
68943102
ILT
2757 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
2758 r_type == 0 for a local symbol with r_sym == 0.
2759 (scan_relocatable_relocs): Pass r_sym to
2760 local_non_section_strategy.
2761 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
2762 r_sym parameter.
2763
b0074644
ILT
2764 * configure.ac: Update test for TLS descriptors: they are
2765 supported as of glibc 2.9.
2766 * configure: Rebuild.
2767
c2508178
ILT
27682008-12-11 Ian Lance Taylor <iant@google.com>
2769
2770 PR 7091
2771 * target-reloc.h (Default_scan_relocatable_relocs): For each
2772 function, map r_type == 0 to RELOC_DISCARD.
2773
2756a258
CC
27742008-12-10 Cary Coutant <ccoutant@google.com>
2775
2776 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
2777 object to override a kept COMDAT group from a plugin object.
2778
bb6f53d3
ILT
27792008-12-09 Ian Lance Taylor <iant@google.com>
2780
fbc558e1
ILT
2781 PR 7088
2782 * yyscript.y (file_cmd): Handle INPUT.
2783
bb6f53d3
ILT
2784 * testsuite/initpri1.c: Change all declarations to be full
2785 prototypes by adding void, to avoid compiler warnings.
2786
4674ecfc
CC
27872008-12-05 Rafael Avila de Espindola <espindola@google.com>
2788
2789 * options.cc (General_options::parse_plugin_opt): New.
2790 (General_options::add_plugin): The argument now is just the filename.
2791 (General_options::add_plugin_option): New.
2792 * options.h (plugin_opt): New.
2793 (add_plugin): Change argument name.
2794 (add_plugin_option): New.
2795 * plugin.cc (Plugin::load): Don't parse the plugin option.
2796 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
2797 (Plugin::add_option): New.
2798 (Plugin::args_): Change type.
2799 (Plugin::filename_): New.
2800 (Plugin_manager::add_plugin_option): New.
2801 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
2802 * testsuite/Makefile.in: Regenerate.
2803
fd06b4aa
CC
28042008-12-05 Cary Coutant <ccoutant@google.com>
2805
2806 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
2807 Handle --strip-lto-sections option.
2808 * options.h (strip_lto_sections): New option.
2809
6c52134c
CC
28102008-12-01 Cary Coutant <ccoutant@google.com>
2811
2812 * plugin.cc (ld_plugin_message): Change format parameter to const.
2813 Fix mismatch between new[] and delete.
2814
a45248e0
CC
28152008-11-14 Cary Coutant <ccoutant@google.com>
2816
2817 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
2818 instead of -1U.
2819
c82fbeee
CS
28202008-11-05 Craig Silverstein <csilvers@google.com>
2821
2822 * options.cc (General_options::parse_dynamic_list): New function.
2823 * options.h (General_options): New flags dynamic_list,
2824 dynamic_list_data, dynamic_list_cpp_new, and
2825 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
2826 (General_options::in_dynamic_list): New function.
2827 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
2828 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
2829 (Lex::can_continue_name): Likewise.
2830 (yylex): Likewise.
2831 (read_script_file): New parameter script_options.
2832 (read_dynamic_list): New function.
2833 (Script_options::define_dynamic_list): New function.
2834 (dynamic_list_keyword_parsecodes): New variable.
2835 (dynamic_list_keywords): New variable.
2836 * script.h (Script_options::define_dynamic_list): New function
2837 prototype.
2838 (read_dynamic_list): New function prototype.
2839 * symtab.cc (strprefix): New macro.
2840 (Symbol::should_add_dynsym_entry): Support dynamic_list,
2841 dynamic_list_data, dynamic_list_cpp_new, and
2842 dynamic_list_cpp_typeinfo.
2843 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
2844 (dynamic_list_expr): New rule.
2845 (dynamic_list_nodes): Likewise.
2846 (dynamic_list_node): Likewise.
2847 * testsuite/Makefile.am (dynamic_list): New test.
2848 * testsuite/Makefile.in: Regenerated.
2849 * testsuite/dynamic_list.t: New file.
2850 * testsuite/dynamic_list.sh: New file.
2851
e0bb29a5
CS
28522008-11-05 Craig Silverstein <csilvers@google.com>
2853
2854 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
2855 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
2856 (t11_last): Likewise.
2857 * testsuite/ver_test_6.c (main): Likewise.
2858
4e1e25e0
CC
28592008-10-07 Cary Coutant <ccoutant@google.com>
2860
2861 * options.c (General_options::finalize): Add check for -static and
2862 -shared.
2863 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
2864 is not empty.
2865
92f03fcb
CC
28662008-10-02 Cary Coutant <ccoutant@google.com>
2867
2868 * plugin.cc (make_sized_plugin_object): Fix conditional
2869 compilation to work when not all targets are enabled.
2870
fbd8a257
CC
28712008-09-29 Cary Coutant <ccoutant@google.com>
2872
2873 * archive.cc (Archive::get_file_and_offset): Use filename instead
2874 of name to get library path.
2875 (Archive::include_member): Unlock external member of a thin archive.
2876
2877 * testsuite/Makefile.am (TEST_AR): New variable.
2878 (thin_archive_test_1): New test.
2879 (thin_archive_test_2): New test.
81636b3f
CC
2880 * testsuite/Makefile.in: Regenerate.
2881 * testsuite/thin_archive_main.cc: New file.
2882 * testsuite/thin_archive_test_1.cc: New file.
2883 * testsuite/thin_archive_test_2.cc: New file.
2884 * testsuite/thin_archive_test_3.cc: New file.
2885 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 2886
eff45813
CC
28872008-09-29 Cary Coutant <ccoutant@google.com>
2888
2889 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
2890 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
2891 instead of -1U.
2892 (Sized_relobj::do_finalize_local_symbols): Likewise.
2893 (Sized_relobj::map_to_kept_section): Likewise.
2894 * object.h (Sized_relobj::invalid_address): New constant.
2895 (Sized_relobj::do_output_section_offset): Check for invalid_address
2896 and return -1ULL.
2897 * output.cc (Output_reloc::local_section_offset): Use constant
2898 invalid_address instead of -1U.
2899 (Output_reloc::get_address): Likewise.
2900 (Output_section::output_address): Change -1U to -1ULL.
2901 * output.h (Output_reloc::invalid_address): New constant.
2902 * reloc.cc (Sized_relobj::write_sections): Use constant
2903 invalid_address instead of -1U.
2904 (Sized_relobj::relocate_sections): Likewise.
2905 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
2906 values for merge sections.
2907 * target-reloc.h (relocate_for_relocatable): Use constant
2908 invalid_address instead of -1U.
2909
89fc3421
CC
29102008-09-19 Cary Coutant <ccoutant@google.com>
2911
2912 Add plugin functionality for link-time optimization (LTO).
2913 * configure.ac (plugins): Add --enable-plugins option.
2914 * configure: Regenerate.
2915 * config.in: Regenerate.
2916 * Makefile.am (LIBDL): New variable.
2917 (CCFILES): Add plugin.cc.
2918 (HFILES): Add plugin.h.
2919 (ldadd_var): Add LIBDL.
2920 * Makefile.in: Regenerate.
2921
2922 * archive.cc: Include "plugin.h".
2923 (Archive::setup): Don't preread archive symbols when using a plugin.
2924 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
2925 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
2926 files.
2927 (Archive::include_member): Add symbols from plugin objects.
2928 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
2929 * descriptors.cc (Descriptors::open): Check for file descriptors
2930 abandoned by plugins.
2931 (Descriptors::claim_for_plugin): New function.
2932 * descriptors.h (Descriptors::claim_for_plugin): New function.
2933 (Open_descriptor::is_claimed): New field.
2934 (claim_descriptor_for_plugin): New function.
2935 * fileread.cc (File_read::claim_for_plugin): New function.
2936 * fileread.h (File_read::claim_for_plugin): New function.
2937 (File_read::descriptor): New function.
2938 * gold.cc: Include "plugin.h".
2939 (queue_initial_tasks): Add task to call plugin hooks for generating
2940 new object files.
2941 * main.cc: Include "plugin.h".
2942 (main): Load plugin libraries.
2943 * object.h (Pluginobj): Declare.
2944 (Object::pluginobj): New function.
2945 (Object::do_pluginobj): New function.
2946 (Object::set_target): New function.
2947 * options.cc: Include "plugin.h".
2948 (General_options::parse_plugin): New function.
2949 (General_options::General_options): Initialize plugins_ field.
2950 (General_options::add_plugin): New function.
2951 * options.h (Plugin_manager): Declare.
2952 (General_options): Add --plugin option.
2953 (General_options::has_plugins): New function.
2954 (General_options::plugins): New function.
2955 (General_options::add_plugin): New function.
2956 (General_options::plugins_): New field.
2957 * plugin.cc: New file.
2958 * plugin.h: New file.
2959 * readsyms.cc: Include "plugin.h".
2960 (Read_symbols::do_read_symbols): Check for archive before checking
2961 for ELF file. Call plugin hooks to claim files.
2962 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
2963 from a real object file; force override when processing replacement
2964 files.
2965 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
2966 (Symbol::init_base_object): Likewise.
2967 (Symbol::init_base_output_data): Likewise.
2968 (Symbol::init_base_output_segment): Likewise.
2969 (Symbol::init_base_constant): Likewise.
2970 (Symbol::init_base_undefined): Likewise.
2971 (Symbol::output_section): Assert that object is not a plugin.
2972 (Symbol_table::add_from_pluginobj): New function.
2973 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
2974 undefined.
2975 (Symbol_table::sized_write_globals): Likewise.
2976 (Symbol_table::add_from_pluginobj): Instantiate template.
2977 * symtab.h (Sized_pluginobj): Declare.
2978 (Symbol::in_real_elf): New function.
2979 (Symbol::set_in_real_elf): New function.
2980 (Symbol::in_real_elf_): New field.
2981 (Symbol_table::add_from_pluginobj): New function.
2982
2983 * testsuite/Makefile.am (AM_CFLAGS): New variable.
2984 (LIBDL): New variable.
2985 (LDADD): Add LIBDL.
2986 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
2987 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
2988 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
2989 (MOSTLYCLEANFILES): Likewise.
2990 * testsuite/Makefile.in: Regenerate.
2991 * testsuite/plugin_test.c: New file.
2992 * testsuite/plugin_test_1.sh: New file.
2993 * testsuite/plugin_test_2.sh: New file.
2994
de31bda5
ILT
29952008-09-16 Ian Lance Taylor <iant@google.com>
2996
9c2d0ef9
ILT
2997 * target-reloc.h (relocate_section): Check whether a symbol is
2998 defined by the ABI before reporting an undefined symbol error.
2999 * target.h (Target::is_defined_by_abi): Make parameter const.
3000 (Target::do_is_defined_by_abi): Likewise.
3001 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
3002 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
3003 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
3004 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
3005 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
3006 * testsuite/Makefile.in: Rebuild.
3007
de31bda5
ILT
3008 * fileread.cc (make_view): Add casts to avoid warning.
3009
9fa33bee
AO
30102008-09-16 Alexandre Oliva <aoliva@redhat.com>
3011
3012 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
3013 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
3014
183fd0e3
AO
30152008-09-16 Alexandre Oliva <aoliva@redhat.com>
3016
3017 * options.h (General_options::output_is_executable): New.
3018 (General_options::output_is_pie): New.
3019 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
3020 for shared libraries.
3021 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
3022
7be8330a
CD
30232008-09-11 Chris Demetriou <cgd@google.com>
3024
3025 * options.h (origin): New -z option.
3026 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
3027 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
3028 in DT_FLAGS_1.
3029
a9caad02
CC
30302008-09-05 Cary Coutant <ccoutant@google.com>
3031
3032 * fileread.cc (File_read::make_view): Add check for attempt to map
3033 beyond end of file.
3034
ae6dce4d
CC
30352008-09-05 Cary Coutant <ccoutant@google.com>
3036
3037 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
3038 explicit instantiations.
3039
d7ab2a47
KVH
30402008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
3041
3042 PR gold/6858
3043 * options.cc (General_options::finalize): Allow undefined symbols
3044 in shlibs if linking -shared.
3045
3046 PR gold/6859
3047 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
3048 symbols as not needing a dynsym entry.
3049
1e52a9c1
CS
30502008-08-20 Craig Silverstein <csilvers@google.com>
3051
3052 * fileread.cc (File_read::open): Do not lock the file unless it
3053 was successfully opened.
3054
d85c80a3
CC
30552008-08-14 Cary Coutant <ccoutant@google.com>
3056
3057 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
3058 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
3059 * testsuite/tls_test.cc (struct int128): 128-bit struct
3060 for testing TLS relocs with non-zero addend.
3061 (v12): New TLS variable.
3062 (t12): New test.
3063 (t_last): Add check for v12.
3064 * testsuite/tls_test.h (t12): New function.
3065 * testsuite/tls_test_main.cc (thread_routine): Call new test.
3066
2d924fd9
ILT
30672008-08-13 Ian Lance Taylor <iant@google.com>
3068
3069 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
3070 set tls_segment_ or relro_segment_.
3071 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
3072 when appropriate.
3073 * output.h (Output_section::clear_is_relro): New function.
3074 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
3075 sections specially even when output_data_ is empty.
3076 (Output_segment::maximum_alignment): When first section is relro,
3077 only force alignment for PT_LOAD segments.
3078 * script.cc (script_data_segment_align): New function.
3079 (script_data_segment_relro_end): New function.
3080 * script-c.h (script_data_segment_align): Declare.
3081 (script_data_segment_relro_end): Declare.
3082 * script-sections.h (class Script_sections): Declare
3083 data_segment_align and data_segment_relro_end. Add fields
3084 segment_align_index_ and saw_relro_end_.
3085 * script-sections.cc (class Sections_element): Add set_is_relro
3086 virtual function. Add new bool* parameter to place_orphan_here.
3087 Add get_output_section virtual function.
3088 (class Output_section_definition): Add set_is_relro. Add new
3089 bool* parameter to place_orphan_here. Add get_output_section.
3090 Add is_relro_ field.
3091 (Output_section_definition::Output_section_definition): Initialize
3092 evaluated_address_, evaluated_load_address, evaluated_addralign_,
3093 and is_relro_ fields.
3094 (Output_section_definition::place_orphan_here): Add is_relro
3095 parameter.
3096 (Output_section_definition::set_section_addresses): Set relro for
3097 output section.
3098 (Output_section_definition::alternate_constraint): Likewise.
3099 (class Orphan_output_section): Add new bool* parameter to
3100 place_orphan_here. Add get_output_section.
3101 (Orphan_output_section::place_orphan_here): Add is_relro
3102 parameter.
3103 (Script_sections::Script_sections): Initialize
3104 data_segment_align_index_ and saw_relro_end_.
3105 (Script_sections::data_segment_align): New function.
3106 (Script_sections::data_segment_relro_end): New function.
3107 (Script_sections::place_orphan): Set or clear is_relro.
3108 (Script_sections::set_section_addresses): Force alignment of first
3109 TLS section.
3110 * yyscript.y (exp): Call script_data_segment_align and
3111 script_data_segment_relro_end.
3112 * testsuite/relro_script_test.t: New file.
3113 * testsuite/relro_test.cc (using_script): Declare.
3114 (t1, t2): Test using_script.
3115 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
3116 (relro_script_test_SOURCES): Define.
3117 (relro_script_test_DEPENDENCIES): Define.
3118 (relro_script_test_LDFLAGS): Define.
3119 (relro_script_test_LDADD): Define.
3120 (relro_script_test.so): New target.
3121 * testsuite/Makefile.in: Rebuild.
3122
f827c9a9
CC
31232008-08-06 Cary Coutant <ccoutant@google.com>
3124
3125 * archive.cc (Archive::total_archives, Archive::total_members)
3126 (Archive::total_members_loaded): New variables.
3127 (Archive::setup): Add parameter. Add option to preread
3128 archive symbols.
3129 (Archive::read_armap): Add counter.
3130 (Archive::get_file_and_offset): New function.
3131 (Archive::get_elf_object_for_member): New function.
3132 (Archive::read_all_symbols): New function.
3133 (Archive::read_symbols): New function.
3134 (Archive::add_symbols): Add counters.
3135 (Archive::include_all_members): Use armap to find members if it's
3136 already built.
3137 (Archive::include_member): Skip reading symbols if already read.
3138 Factored code into Archive::get_file_and_offset and
3139 Archive::get_elf_object_for_member. Changed call to
3140 Mapfile::report_include_archive_member.
3141 (Archive::print_stats): New function.
3142 * archive.h: Declare Object and Read_symbols_data classes.
3143 (Archive::Archive): Add initializers for new members.
3144 (Archive::setup): Add parameter.
3145 (Archive::print_stats): New function.
3146 (Archive::total_archives, Archive::total_members)
3147 (Archive::total_members_loaded): New variables.
3148 (Archive::get_file_and_offset): New function.
3149 (Archive::get_elf_object_for_member): New function.
3150 (Archive::read_all_symbols): New function.
3151 (Archive::read_symbols): New function.
3152 (Archive::Archive_member): New class.
3153 (Archive::members_): New member.
3154 (Archive::num_members_): New member.
3155 * main.cc: Include archive.h.
3156 (main): Call Archive::print_stats.
3157 * mapfile.cc (Mapfile::report_include_archive_member): Delete
3158 archive parameter; member_name is now the fully-decorated name.
3159 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
3160 * options.h: (General_options): Add --preread-archive-symbols option.
3161 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
3162 Archive::setup.
3163
de4c45bd
ILT
31642008-08-04 Ian Lance Taylor <iant@google.com>
3165
3166 * symtab.h (Symbol::use_plt_offset): New function.
3167 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
3168 * powerpc.cc (Relocate::relocate): Likewise.
3169 * sparc.cc (Relocate::relocate): Likewise.
3170 * x86_64.cc (Relocate::relocate): Likewise.
3171 * testsuite/weak_plt.sh: New test.
3172 * testsuite/weak_plt_main.cc: New test.
3173 * testsuite/weak_plt_shared.cc: New test.
3174 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
3175 (check_PROGRAMS): Add weak_plt.
3176 (check_DATA): Add weak_plt_shared.so.
3177 (weak_plt_main_pic.o, weak_plt): New targets.
3178 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
3179 * testsuite/Makefile.in: Rebuild.
3180
3181 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
3182 gcctestdir/ld.
3183 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
3184 * testsuite/Makefile.in: Rebuild.
3185
323ee3f4
AM
31862008-08-04 Alan Modra <amodra@bigpond.net.au>
3187
3188 * Makefile.am (POTFILES.in): Set LC_ALL=C.
3189 * Makefile.in: Regenerate.
3190 * po/POTFILES.in: Regenerate.
3191
7c07ecec
ILT
31922008-07-29 Ian Lance Taylor <iant@google.com>
3193
3194 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
3195 symbols before other symbols.
3196 * testsuite/script_test_2.cc (test_addr): Declare.
3197 (test_addr_alias): Declare.
3198 (main): Check that test_addr and test_addr_alias have the right
cd536b21 3199 values.
7c07ecec
ILT
3200 * testsuite/script_test_2.t: Define test_addr_alias and
3201 test_addr.
3202
5778530e
ILT
32032008-07-24 Ian Lance Taylor <iant@google.com>
3204
2a00e4fb
ILT
3205 PR 5990
3206 * descriptors.cc: New file.
3207 * descriptors.h: New file.
3208 * gold-threads.h (class Hold_optional_lock): New class.
3209 * fileread.cc: Include "descriptors.h".
3210 (File_read::~File_read): Release descriptor rather than closing
3211 it.
3212 (File_read::open) [file]: Call open_descriptor rather than open.
3213 Set is_descriptor_opened_.
3214 (File_read::open) [memory]: Assert that descriptor is not open.
3215 (File_read::reopen_descriptor): New function.
3216 (File_read::release): Release descriptor.
3217 (File_read::do_read): Make non-const. Reopen descriptor.
3218 (File_read::read): Make non-const.
3219 (File_read::make_view): Reopen descriptor.
3220 (File_read::do_readv): Likewise.
3221 * fileread.h (class File_read): Add is_descriptor_opened_ field.
3222 Update declarations.
3223 * layout.cc: Include "descriptors.h".
3224 (Layout::create_build_id): Use open_descriptor rather than open.
3225 * output.cc: Include "descriptors.h".
3226 (Output_file::open): Use open_descriptor rather than open.
3227 * archive.cc (Archive::const_iterator): Change Archive to be
3228 non-const.
3229 (Archive::begin, Archive::end): Make non-const.
3230 (Archive::count_members): Likewise.
3231 * archive.h (class Archive): Update declarations.
3232 * object.h (Object::read): Make non-const.
3233 * Makefile.am (CCFILES): Add descriptors.cc.
3234 (HFILES): Add descriptors.h.
3235 * Makefile.in: Rebuild.
3236
801647d1
ILT
3237 PR 6716
3238 * gold.h: Always include <clocale>. Add Solaris workarounds
3239 following code in binutils/sysdep.h.
3240
5edd166e
ILT
3241 PR 6048
3242 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
3243 this->eh_frame_hdr_ is NULL before using it.
3244
c89ad728
ILT
3245 * dynobj.cc (Versions::Versions): Update comment.
3246
aa86f06b
ILT
3247 * dynobj.cc (Versions::Versions): If there is an soname, use it as
3248 the base version name.
3249
5778530e
ILT
3250 * stringpool.cc (Stringpool_template::add_with_length): Set key to
3251 array size plus one.
3252 (Stringpool_template::set_string_offsets): Subtract one from key
3253 before using it as an array index.
3254 (Stringpool_template::get_offset_with_length): Likewise.
3255 (Stringpool_template::write_to_buffer): Likewise.
3256 * stringpool.h (Stringpool_template::get_offset_from_key):
3257 Likewise.
3258
057ead22
ILT
32592008-07-23 Ian Lance Taylor <iant@google.com>
3260
7f649c59
ILT
3261 PR 6658
3262 * object.h (Merged_symbol_value::value): Do our best to handle a
3263 negative addend.
3264
057ead22
ILT
3265 PR 6647
3266 * script.cc (Version_script_info::get_versions): Don't add empty
3267 version tag to return value.
3268 (Version_script_info::get_symbol_version_helper): Change return
3269 type to bool. Add pversion parameter. Change all callers.
3270 (script_register_vers_node): Don't require a non-NULL tag.
3271 * script.h (class Version_script_info): Update declarations.
3272 (Version_script_info::get_symbol_version): Change return type to
3273 bool. Add version parameter. Change all callers.
3274 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
3275 handling. Handle an empty version from a version script.
3276 (Symbol_table::define_special_symbol): Likewise.
3277 * testsuite/ver_test_10.script: New file.
3278 * testsuite/ver_test_10.sh: New file.
3279 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
3280 (check_DATA): Add ver_test_10.syms.
3281 (ver_test_10.syms, ver_test_10.so): New target.
3282 * testsuite/Makefile.in: Rebuild.
3283
58e54ac2
CD
32842008-07-23 Simon Baldwin <simonb@google.com>
3285
3286 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
3287 to zero for undefined symbols from dynamic libraries.
3288
95d14cd3
ILT
32892008-07-23 Ian Lance Taylor <iant@google.com>
3290
3291 * symtab.cc (Symbol_table::resolve): Remove version parameter.
3292 Change all callers.
3293 * symtab.h (class Symbol_table): Update declaration.
3294 * testsuite/ver_test_9.cc: New file.
3295 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
3296 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
3297 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
3298 (ver_test_9.so, ver_test_9.o): New targets.
3299 * testsuite/Makefile.in: Rebuild.
3300
92de84a6
ILT
33012008-07-22 Ian Lance Taylor <iant@google.com>
3302
34810851
ILT
3303 * options.h (class General_options): Define --check-sections.
3304 * layout.cc (Layout::set_segment_offsets): Handle
3305 --check-sections.
3306
af6156ef
ILT
3307 * options.h (class General_options): Define -n/--nmagic and
3308 -N/--omagic.
3309 * options.cc (General_options::finalize): For -n/--nmagic or
3310 -N/--omagic, set -static.
3311 * layout.cc (Layout::attach_allocated_section_to_segment): If
3312 -N/--omagic, don't put read-only and read-write sections in
3313 different segments.
3314 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
3315 finding a read-only segment.
3316 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
3317 don't set the minimum segment alignment to the common page size,
3318 and don't set the file offset to the address modulo the page size.
3319 * script-sections.cc (Script_sections::create_segments): If
3320 -n/--omagic, don't put read-only and read-write sections in
3321 different segments.
3322
92de84a6
ILT
3323 * cref.cc: New file.
3324 * cref.h: New file.
3325 * options.h (class General_options): Add --print-symbol-counts.
3326 * main.cc (main): Issue defined symbol report if requested.
3327 * archive.cc (Archive::interpret_header): Make into a const member
3328 function.
3329 (Archive::add_symbols): Call Input_objects::archive_start and
3330 archive_stop.
3331 (Archive::const_iterator): Define new class.
3332 (Archive::begin, Archive::end): New functions.
3333 (Archive::include_all_members): Rewrite to use iterator.
3334 (Archive::count_members): New function.
3335 * archive.h (class Archive): Update declarations.
3336 (Archive::filename): New function.
3337 * object.cc: Include "cref.h".
3338 (Sized_relobj::Sized_relobj): Initialize defined_count_.
3339 (Sized_relobj::do_get_global_symbol_counts): New function.
3340 (Input_objects::add_object): Add object to cross-referencer.
3341 (Input_objects::archive_start): New function.
3342 (Input_objects::archive_stop): New function.
3343 (Input_objects::print_symbol_counts): New function.
3344 * object.h: Declare Cref and Archive.
3345 (Object::get_global_symbol_counts): New function.
3346 (Object::do_get_global_symbol_counts): New pure virtual function.
3347 (class Sized_relobj): Add defined_count_ field. Update
3348 declarations.
3349 (class Input_objects): Add cref_ field. Update constructor.
3350 Update declarations.
3351 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
3352 defined_count_.
3353 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
3354 symbol counts.
3355 (Sized_dynobj::do_get_global_symbol_counts): New function.
3356 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
3357 defined_count_. Update declarations. Define Symbols typedef.
3358 * symtab.cc (Symbol_table::add_from_relobj): Add defined
3359 parameter. Change all callers.
3360 (Symbol_table::add_from_dynobj): Add sympointers and defined
3361 parameters. Change all callers.
3362 * symtab.h (class Symbol_table): Update declarations.
3363 * Makefile.am (CCFILES): Add cref.cc.
3364 (HFILES): Add cref.h.
3365 * Makefile.in: Rebuild.
3366
3f7c5e1d
CD
33672008-07-22 Simon Baldwin <simonb@google.com>
3368
3369 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
3370 to zero when writing undefined symbols.
3371
e0b64032
ILT
33722008-07-22 Ian Lance Taylor <iant@google.com>
3373
3374 * output.cc (Output_section::add_input_section): Don't try to
3375 merge empty merge sections.
3376
096b02cf
CS
33772008-07-21 Craig Silverstein <csilvers@google.com>
3378
3379 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
3380 Include symbol version in error message.
cd536b21 3381
1d1f116d
CD
33822008-07-20 Chris Demetriou <cgd@google.com>
3383
cd536b21 3384 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
3385 (RANDOM_SEED_CFLAGS): New substituted variable.
3386 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
3387 * configure: Rebuild.
3388 * Makefile.in: Likewise.
3389 * testsuite/Makefile.in: Likewise.
3390
a18f591e
ILT
33912008-07-18 Ian Lance Taylor <iant@google.com>
3392
3393 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
3394 where we see NAME/NULL and NAME/VERSION as separate symbols.
3395 * testsuite/ver_test_main.cc (main): Call t4.
3396 (t4, t4_2a): Define.
3397 * testsuite/ver_test_2.cc (t4_2): Define.
3398 * testsuite/ver_test_2.script: Put t4_2a in VER2.
3399 * testsuite/ver_test_4.cc (t4_2a): Define.
3400 * testsuite/ver_test_4.script: Put t4_2a in VER2.
3401 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
3402
c6e3f6ed
ILT
34032008-07-17 Ian Lance Taylor <iant@google.com>
3404
3405 * dynobj.cc (Versions::add_def): If we give an error about a
3406 missing version, go ahead and create the version anyhow.
3407
ef9beddf
ILT
34082008-07-10 Ian Lance Taylor <iant@google.com>
3409
3410 Handle output sections with more than 0x7fffffff bytes.
3411 * object.h (class Relobj): Change map_to_output_ to
3412 output_sections_, and just keep a section pointer. Change all
3413 uses. Move comdat group support to Sized_relobj.
3414 (Relobj::is_section_specially_mapped): Remove.
3415 (Relobj::output_section): Remove poff parameter. Change all
3416 callers.
3417 (Relobj::output_section_offset): New function.
3418 (Relobj::set_section_offset): Rewrite.
3419 (Relobj::map_to_output): Remove.
3420 (Relobj::output_sections): New function.
3421 (Relobj::do_output_section_offset): New pure virtual function.
3422 (Relobj::do_set_section_offset): Likewise.
3423 (class Sized_relobj): Add section_offsets_ field. Add comdat
3424 group support from Relobj. Update declarations.
3425 (Sized_relobj::get_output_section_offset): New function.
3426 (Sized_relobj::do_output_section_offset): New function.
3427 (Sized_relobj::do_set_section_offset): New function.
3428 * object.cc (Relobj::output_section_address): Remove.
3429 (Sized_relobj::Sized_relobj): Initialize new fields.
3430 (Sized_relobj::include_section_group): Cast find_kept_object to
3431 Sized_relobj.
3432 (Sized_relobj::include_linkonce_section): Likewise.
3433 (Sized_relobj::do_layout): Use separate arrays for output section
3434 and output offset.
3435 (Sized_relobj::do_count_local_symbols): Change map_to_output to
3436 output_sections.
3437 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
3438 output_sections and section_offsets.
3439 (Sized_relobj::write_local_symbols): Likewise.
3440 (map_to_kept_section): Compute output address directly.
3441 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
3442 output_sections and section_offsets.
3443 (Sized_relobj::write_sections): Likewise.
3444 (Sized_relobj::relocate_sections): Likewise.
3445 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
3446 * output.h (class Output_reloc): Update declarations. Change
3447 u2_.relobj to Sized_relobj*.
3448 (class Output_data_reloc): Change add functions to use
3449 Sized_relobj*.
3450 * output.cc (Output_reloc::Output_reloc): Change relobj to
3451 Sized_relobj*.
3452 (Output_reloc::local_section_offset): Change return type to
3453 Elf_Addr. Use get_output_section_offset.
3454 (Output_reloc::get_address): Likewise.
3455 (Output_section::is_input_address_mapped): Don't call
3456 is_section_specially_mapped.
3457 (Output_section::output_offset): Likewise.
3458 (Output_section::output_address): Likewise.
3459 (Output_section::starting_output_address): Likewise.
3460 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
3461 parameter to Sized_relobj*.
3462 (Copy_relocs::need_copy_reloc): Likewise.
3463 (Copy_relocs::save): Likewise.
3464 * copy-relocs.h (class Copy_relocs): Update declarations.
3465 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
3466 Sized_relobj*. Change relobj_ field to Sized_relobj*.
3467 * target-reloc.h (relocate_for_relocatable): Change
3468 offset_in_output_section type to Elf_Addr. Change code that uses
3469 it as well.
3470 * layout.cc (Layout::layout): Always set *off.
3471 * mapfile.cc (Mapfile::print_input_section): Use
3472 output_section_offset.
3473 * i386.cc (Target_i386::copy_reloc): Change object parameter to
3474 Sized_relobj*.
3475 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
3476 * sparc.cc (Target_sparc::copy_reloc): Likewise.
3477 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
3478
5cb66f97
ILT
34792008-07-03 Ian Lance Taylor <iant@google.com>
3480
3481 * layout.cc (Layout::include_section): Do not discard unrecognized
3482 SHT_STRTAB sections.
3483
afe47622
CS
34842008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
3485
3486 * script.cc (Lex::can_continue_name): Make '?' allowable in
3487 version-script names.
3488 * testsuite/version_script.map: Change glob pattern to use '?'
3489
5adf9721
ILT
34902008-06-30 Manish Singh <yosh@gimp.org>
3491
3492 PR 6585
3493 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
3494 Correct typo.
3495
e6fde208
ILT
34962008-06-30 Ian Lance Taylor <iant@google.com>
3497
3498 PR 6660
3499 PR 6682
3500 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
3501 versions]: Don't try to read the value in the contents, since we
3502 don't use it. Use the template endianness when writing.
3503
3f2e6a2d
CC
35042008-06-25 Cary Coutant <ccoutant@google.com>
3505
3506 * fileread.cc (File_read::make_view): Assert on zero-length view.
3507 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
3508 symbol table when there are no symbols to read.
3509
c43d3a48
CS
35102008-06-23 Craig Silverstein <csilvers@google.com>
3511
3512 * version.cc (version_string): Bump to 1.7
3513
5f494ea0
CS
35142008-06-18 Craig Silverstein <csilvers@google.com>
3515
3516 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
3517 constant 0xFFFF to type Valtype.
3518 (Powerpc_relocate_functions::rel16_ha): Likewise.
3519
c42e122e
ILT
35202008-06-17 Ian Lance Taylor <iant@google.com>
3521
f34787f8
ILT
3522 * output.h (Output_section::Input_section): Initialize p2align_ to
3523 zero for Output_section_data constructors.
3524 (Output_section::Input_section::addralign): If not an input
3525 section, return the alignment of the Output_section_data.
3526 * testsuite/copy_test.cc: New file.
3527 * testsuite/copy_test_1.cc: New file.
3528 * testsuite/copy_test_2.cc: New file.
3529 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
3530 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
3531 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
3532 (copy_test_1_pic.o, copy_test_1.so): New targets.
3533 (copy_test_2_pic.o, copy_test_2.so): New targets.
3534 * testsuite/Makefile.in: Rebuild.
3535
c42e122e
ILT
3536 * script-sections.cc (Script_sections::place_orphan): Initialize
3537 local variable exact.
3538
ce3ac18a
DE
35392008-06-13 David Edelsohn <edelsohn@gnu.org>
3540
3541 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
3542
42cacb20
DE
35432008-06-12 David Edelsohn <edelsohn@gnu.org>
3544 David S. Miller <davem@davemloft.net>
3545
3546 * powerpc.cc: New file.
3547 * Makefile.am (TARGETSOURCES): Add powerpc.cc
3548 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
3549 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
3550 * Makefile.in: Rebuild.
3551
7b308235
ILT
35522008-06-09 Ian Lance Taylor <iant@google.com>
3553
3554 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
3555 <exception>.
3556 (throwing, orig_terminate): New static variables.
3557 (terminate_handler): New static function.
3558 (t2): Set terminate handler.
3559
f0b886e3
ILT
35602008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
3561
3562 PR 6584
cd536b21 3563 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
3564 alignment.
3565
3e90f135
CC
35662008-05-30 Cary Coutant <ccoutant@google.com>
3567
3568 * archive.cc (Archive::include_all_members) Correct to step
3569 over symbol table and extended name table in thin archives.
3570
e09ad04a
ILT
35712008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
3572
3573 PR 6407
3574 * target-reloc.h (relocate_for_relocatable): Fix new_offset
3575 calculation.
3576
62b01cb5
ILT
35772008-05-28 Caleb Howe <cshowe@google.com>
3578
3579 * reduced_debug_output.cc: New file.
3580 * reduced_debug_output.h: New file.
92de84a6 3581 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
3582 * options.cc (General_options::finalize): Add strip_debug_non_line
3583 to the strip heirarchy.
3584 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
3585 fields.
3586 * layout.cc: Include "reduced_debug_output.h".
3587 (Layout::Layout): Initialize new fields.
3588 (line_only_debug_sections): New static array.
3589 (is_lines_only_debug_sections): New static inline function.
3590 (Layout::include_section): Handle --strip-debug-non-line.
3591 (Layout::make_output_section): If --strip-debug-non-line, build
3592 new output sections for .debug_abbrev and .debug_info.
3593 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
3594 gold. Warn about possible overflow.
3595 (read_signed_LEB_128): Likewise.
3596 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
3597 (read_signed_LEB_128): Declare.
3598 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
3599 (HFILES): Add reduced_debug_output.h.
3600 * Makefile.in: Rebuild.
3601
7d9e3d98
ILT
36022008-05-21 Ian Lance Taylor <iant@google.com>
3603
3604 * mapfile.cc: New file.
3605 * mapfile.h: New file.
3606 * options.h (class General_options): Add -M/--print-map and -Map.
3607 * options.cc (General_options::finalize): Make -M equivalent to
3608 -Map -.
3609 * main.cc: Include <cstdio> and "mapfile.h".
3610 (main): Open mapfile if requested.
3611 * gold.cc (class Middle_runner): Add mapfile_ field. Update
3612 constructor. Change caller.
3613 (queue_initial_tasks): Add mapfile parameter. Change caller.
3614 (queue_middle_tasks): Likewise.
3615 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
3616 declarations.
3617 * archive.cc: Include "mapfile.h".
3618 (Archive::add_symbols): Add mapfile parameter. Change all
3619 callers. Pass mapfile, symbol, and reason to include_member.
3620 (Archive::include_all_members): Add mapfile parameter. Change all
3621 callers.
3622 (Archive::include_member): Add mapfile, sym, and why parameters.
3623 Change all callers. Report inclusion to map file.
3624 * archive.h: Include "fileread.h".
3625 (class Archive): Update declarations.
3626 (Archive::file): New const method.
3627 (class Add_archive_symbols): Add mapfile_ field. Update
3628 constructor. Change all callers.
3629 * readsyms.h (class Read_symbols): Likewise.
3630 (class Finish_group): Likewise.
3631 (class Read_script): Likewise.
3632 * common.cc: Include "mapfile.h".
3633 (Symbol_table::allocate_commons): Add mapfile parameter. Change
3634 all callers.
3635 (Symbol_table::do_allocate_commons): Likewise.
3636 (Symbol_table::do_allocate_commons_list): Likewise. Report common
3637 symbol allocation to mapfile.
3638 * common.h (class Allocate_commons_task): Add mapfile_ field.
3639 Update constructor. Change all callers.
3640 * symtab.h (class Symbol_table): Update declarations.
3641 * layout.cc: Include "mapfile.h".
3642 (Layout_task_runner::run): Print information to mapfile.
3643 (Layout::create_gold_note): Change Output_data_fixed_space to
3644 Output_data_zero_fill.
3645 (Layout::create_build_id): Likewise.
3646 (Layout::print_to_mapfile): New function.
3647 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
3648 constructor. Change caller.
3649 (class Layout): Declare print_to_mapfile.
3650 * output.cc (Output_section::Input_section::print_to_mapfile): New
3651 function.
3652 (Output_section::add_input_section): If producing a map, always
3653 add to input_sections_ list.
3654 (Output_section::do_print_to_mapfile): New function.
3655 (Output_segment::print_sections_to_mapfile): New function.
3656 (Output_segment::print_section_list_to_mapfile): New function.
3657 * output.h: Include "mapfile.h".
3658 (Output_data::print_to_mapfile): New function.
3659 (Output_data::do_print_to_mapfile): New virtual function.
3660 (Output_segment_headers::do_print_to_mapfile): New function.
3661 (Output_file_header::do_print_to_mapfile): New function.
3662 (Output_data_const::do_print_to_mapfile): New function.
3663 (class Output_data_const_buffer): Add map_name_ field. Update
3664 constructor. Change all callers. Add do_print_to_mapfile
3665 function.
3666 (class Output_data_fixed_space): Likewise.
3667 (class Output_data_space): Likewise.
3668 (class Output_data_zero_fill): New class.
3669 (Output_data_strtab::do_print_to_mapfile): New function.
3670 (Output_data_reloc_base::do_print_to_mapfile): New function.
3671 (Output_relocatable_relocs::do_print_to_mapfile): New function.
3672 (Output_data_group::do_print_to_mapfile): New function.
3673 (Output_data_got::do_print_to_mapfile): New function.
3674 (Output_data_dynamic::do_print_to_mapfile): New function.
3675 (Output_symtab_xindex::do_print_to_mapfile): New function.
3676 (class Output_section): Declare do_print_to_mapflie. Declare
3677 print_to_mapfile in Input_section.
3678 (class Output_segment): Declare new functions.
3679 * object.h (Sized_relobj::symbol_count): New function.
3680 * script-sections.cc
3681 (Output_section_element_dot_assignment::set_section_addresses):
3682 Change Output_data_fixed_space to Output_data_zero_fill.
3683 (Output_data_expression::do_print_to_mapfile): New function.
3684 * script.cc (read_input_script): Add mapfile parameter. Change
3685 all callers.
3686 * script.h (read_input_script): Update declaration.
3687 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
3688 (Eh_frame::do_print_to_mapfile): New function.
3689 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
3690 (Output_merge_string::do_print_to_mapfile): New function.
3691 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
3692 function.
3693 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
3694 function.
3695 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
3696 function.
3697 * Makefile.am (CCFILES): Add mapfile.cc.
3698 (HFILES): Add mapfile.h.
3699 * Makefile.in: Rebuild.
3700
9f1d377b
ILT
37012008-05-19 Ian Lance Taylor <iant@google.com>
3702
3703 * options.h (class General_options): Add -z relro.
3704 * layout.cc (Layout::Layout): Initialize relro_segment_.
3705 (Layout::add_output_section_data): Return the output section.
3706 (Layout::make_output_section): Rcognize relro sections and mark
3707 them appropriately.
3708 (Layout::attach_allocated_section_to_segment): Put relro sections
3709 in a PT_GNU_RELRO segment.
3710 (Layout::create_initial_dynamic_sections): Mark the .dynamic
3711 section as relro.
3712 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
3713 PT_TLS segments.
3714 (Layout::linkonce_mapping): Map d.rel.ro.local to
3715 .data.rel.ro.local.
3716 (Layout::output_section_name): Us .data.rel.ro.local for any
3717 section which begins with that.
3718 * layout.h (class Layout): Update add_output_section_data
3719 declaration. Add relro_segment_ field.
3720 * output.cc (Output_section::Output_section): Initialize is_relro_
3721 and is_relro_local_ fields.
3722 (Output_segment::add_output_section): Group relro sections.
3723 (Output_segment::is_first_section_relro): New function.
3724 (Output_segment::maximum_alignment): If there is a relro section,
3725 align the segment to the common page size.
3726 (Output_segment::set_section_addresses): Track whether we are
3727 looking at relro sections. If the last section is a relro
3728 section, align to the common page size.
3729 (Output_segment::set_section_list_addresses): Add in_relro
3730 parameter. Change all callers. Align to the page size when
3731 moving from relro to non-relro section.
3732 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
3733 segment.
3734 * output.h (class Output_section): Add is_relro_ and
3735 is_relro_local_ fields.
3736 (Output_section::is_relro): New function.
3737 (Output_section::set_is_relro): New function.
3738 (Output_section::is_relro_local): New function.
3739 (Output_section::set_is_relro_local): New function.
3740 (class Output_segment): Update declarations.
3741 * i386.cc (Target_i386::got_section): Mark .got section as relro.
3742 * sparc.cc (Target_sparc::got_section): Likewise.
3743 * x86_64.cc (Target_x86_64::got_section): Likewise.
3744 * testsuite/relro_test_main.cc: New file.
3745 * testsuite/relro_test.cc: New file.
3746 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
3747 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
3748 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
3749 (relro_test.so, relro_test_pic.o): New targets.
3750 * testsuite/Makefile.in: Rebuild.
3751
a984ee1d
ILT
37522008-05-16 Ian Lance Taylor <iant@google.com>
3753
01676dcd
ILT
3754 * output.cc (Output_segment::add_output_section): Remove front
3755 parameter.
3756 * output.h (class Output_segment): Remove
3757 add_initial_output_section and overloaded add_output_section.
3758 Update declaration of remaining add_output_section.
3759 * layout.cc (Layout::create_interp): Call add_output_section
3760 rather than add_initial_output_section.
3761 (Layout::finish_dynamic_section): Likewise.
3762
497897f9
ILT
3763 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
3764 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
3765 know the dynamic type.
3766 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
3767 field. Initialize it in constructor.
3768 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
3769 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
3770 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
3771 reloc.
3772
a984ee1d
ILT
3773 * output.cc (Output_reloc::get_address): Change return type to
3774 Elf_Addr.
3775 * output.h (class Output_reloc): Update get_address declaration.
3776 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
3777 for section addresses.
3778
55ba0940
ILT
37792008-05-09 Ian Lance Taylor <iant@google.com>
3780
3781 PR 6493
3782 * gold.cc (gold_nomem): Use return value of write.
3783
75517b77
ILT
37842008-05-08 Ian Lance Taylor <iant@google.com>
3785
3786 * symtab.c (Symbol::init_base_output_data): Add version
3787 parameter. Change all callers.
3788 (Symbol::init_base_output_segment): Likewise.
3789 (Symbol::init_base_constant): Likewise.
3790 (Symbol::init_base_undefined): Likewise.
3791 (Sized_symbol::init_output_data): Likewise.
3792 (Sized_symbol::init_output_segment): Likewise.
3793 (Sized_symbol::init_constant): Likewise.
3794 (Sized_symbol::init_undefined): Likewise.
3795 (Symbol_table::do_define_in_output_data): If the new symbol has a
3796 version, mark it as the default.
3797 (Symbol_table::do_define_in_output_segment): Likewise.
3798 (Symbol_table::do_define_as_constant): Likewise.
3799 * symtab.h (class Symbol): Update declarations.
3800 (class Sized_symbol): Likewise.
3801 * resolve.cc (Symbol::override_version): New function.
c42e122e 3802 (Symbol::override_base): Call override_version.
75517b77
ILT
3803 (Symbol::override_base_with_special): Likewise.
3804 * testsuite/ver_script_8.script: New file.
3805 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
3806 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
3807 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
3808 (ver_test_8_1.so, ver_test_8_2.so): New targets.
3809
f1f70eae
ILT
38102008-05-06 Ian Lance Taylor <iant@google.com>
3811
f3e9c5c5
ILT
3812 PR 6049
3813 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
3814 functions.
3815 (class General_options): Remove existing --undefined, and add
3816 --no-undefined instead. Add new --undefined as synonym for -u.
3817 * archive.cc (Archive::add_symbols): Check whether symbol was
3818 named with -u.
3819 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
3820 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
3821 all uses. Add IS_UNDEFINED. Update declarations to split
3822 different versions of init_base. Declare init_base_undefined.
3823 (Symbol::is_defined): Handle IS_UNDEFINED.
3824 (Symbol::is_undefined): Likewise.
3825 (Symbol::is_weak_undefined): Call is_undefined.
3826 (Symbol::is_absolute): Handle IS_CONSTANT.
3827 (class Sized_symbol): Update declarations to split different
3828 versions of init. Declare init_undefined.
3829 (class Symbol_table): Declare new functions.
3830 * symtab.cc (Symbol::init_base_object): Rename from init_base.
3831 Change all callers.
3832 (Symbol::init_base_output_data): Likewise.
3833 (Symbol::init_base_output_segment): Likewise.
3834 (Symbol::init_base_constant): Likewise.
3835 (Symbol::init_base_undefined): New function.
3836 (Sized_symbol::init_object): Rename from init. Change all
3837 callers.
3838 (Sized_symbol::init_output_data): Likewise.
3839 (Sized_symbol::init_output_segment): Likewise.
3840 (Sized_symbol::init_constant): Likewise.
3841 (Sized_symbol::init_undefined): New function.
3842 (Symbol_table::add_undefined_symbols_from_command_line): New
3843 function.
3844 (Symbol_table::do_add_undefined_symbols_from_command_line): New
3845 function.
3846 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
3847 (Symbol::output_section): Likewise.
3848 (Symbol::set_output_section): Likewise.
3849 (Symbol_table::sized_finalize_symbol): Likewise.
3850 (Symbol_table::sized_write_globals): Likewise.
3851 * resolve.cc (Symbol_table::should_override): Likewise.
3852 (Symbol::override_base_with_special): Likewise.
3853
8bdcdf2c
ILT
3854 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
3855 symbol, change it to have default visibility.
3856 * testsuite/protected_1.cc: New file.
3857 * testsuite/protected_2.cc: New file.
3858 * testsuite/protected_3.cc: New file.
3859 * testsuite/protected_main_1.cc: New file.
3860 * testsuite/protected_main_2.cc: New file.
3861 * testsuite/protected_main_3.cc: New file.
3862 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
3863 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
3864 (protected_1_LDFLAGS, protected_1_LDADD): Define.
3865 (protected_1.so): New target.
3866 (protected_1_pic.o, protected_2_pic.o): New targets.
3867 (protected_3_pic.o): New target.
3868 (check_PROGRAMS): Add protected_2.
3869 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
3870 (protected_2_LDFLAGS, protected_2_LDADD): Define.
3871 * testsuite/Makefile.in: Rebuild.
3872
2b706932
ILT
3873 * options.h (DEFINE_var): Add set_user_set_##varname__.
3874 (DEFINE_bool_alias): New macro.
3875 (class General_options): Define -Bstatic using DEFINE_bool_alias
3876 rather than DEFINE_special. Add --undefined as an alias for -z
3877 defs.
3878 * options.cc (General_options::parse_Bstatic): Remove.
3879
d82a5bcc
ILT
3880 * options.h (class General_options): Add --fatal-warnings.
3881 * main.cc (main): Implement --fatal-warnings.
3882 * errors.h (Errors::warning_count): New function.
3883
f1f70eae
ILT
3884 * options.h (class General_options): Add -Bsymbolic-functions.
3885 * symtab.h (Symbol::is_preemptible): Check for
3886 -Bsymbolic-functions.
3887
8825ac63
ILT
38882008-05-05 Ian Lance Taylor <iant@google.com>
3889
d98bc257
ILT
3890 * options.h (DEFINE_bool): For DASH_Z, create the negative option
3891 as noVARNAME rather than no-VARNAME.
3892 (class General_options): Add option -z combreloc.
3893 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
3894 get_address.
3895 (Output_reloc::sort_before) [SHT_REL]: New function.
3896 (Output_reloc::sort_before) [SHT_RELA]: New function.
3897 (class Output_data_reloc_base): Add sort_relocs_ field. Define
3898 Sort_relocs_comparison.
3899 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
3900 parameter. Change all callers.
3901 (Output_data_reloc::Output_data_reloc) [both versions]: Add
3902 sort_relocs parameter. Change all callers.
3903 * output.cc (Output_reloc::get_address): New function, broken out
3904 of write_rel.
3905 (Output_reloc::write_rel): Call it.
3906 (Output_reloc::compare): New function.
3907 (Output_data_reloc_base::do_write): Optionally sort relocs.
3908
60b2b4e7
ILT
3909 * configure.ac: If targ_extra_obj is set, link it in.
3910 * configure.tgt: Initialize all variables.
3911 (x86_64*): Set targ_extra_obj and targ_extra_size.
3912 * configure: Rebuild.
3913
8825ac63
ILT
3914 * object.cc (Sized_relobj::include_section_group): Adjust section
3915 indexes read from group data. Build vector to pass to
3916 layout_group.
3917 * layout.cc (Layout::layout_group): Add flags and shndxes
3918 parameters. Remove contents parameter. Change caller. Update
3919 explicit instantiations.
3920 * layout.h (class Layout): Update layout_group declaration.
3921 * output.cc (Output_data_group::Output_data_group): Add flags and
3922 input_shndxes parameters. Remove contents parameter. Change
3923 caller.
3924 (Output_data_group::do_write): Change input_sections_ to
3925 input_shndxes_.
3926 * output.h (class Output_data_group): Update constructor
3927 declaration. Rename input_sections_ to input_shndxes_.
3928 * testsuite/many_sections_test.cc: Add template.
3929
e94cf127
CC
39302008-04-30 Cary Coutant <ccoutant@google.com>
3931
4418b2d5
CC
3932 * target-reloc.h (relocate_section): Fix dead-pointer bug.
3933
e94cf127
CC
3934 * layout.cc (Layout::include_section): Refactored check for debug
3935 info section.
3936 (Layout::add_comdat): Add new parameters. Change type
3937 of signature parameter. Add object and shndx to signatures table.
3938 (Layout::find_kept_object): New function.
3939 * layout.h: Include <cstring>.
3940 (Layout::is_debug_info_section): New function.
3941 (Layout::add_comdat): Add new parameters.
3942 (Layout::find_kept_object): New function.
3943 (Layout::Kept_section): New struct.
3944 (Layout::Signatures): Change type of map range.
3945 * object.cc (Relobj::output_section_address): New function.
3946 (Sized_relobj::include_section_group): Add new parameters. Change
3947 calls to Layout::add_comdat. Change to build table of kept comdat
3948 groups and table mapping discarded sections to kept sections.
3949 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
3950 (Sized_relobj::do_layout): Change calls to include_section_group and
3951 include_linkonce_section.
3952 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
3953 value to zero when section is discarded.
3954 (Sized_relobj::map_to_kept_section): New function.
3955 * object.h (Relobj::output_section_address): New function.
3956 (Relobj::Comdat_group): New type.
3957 (Relobj::find_comdat_group): New function.
3958 (Relobj::Comdat_group_table): New type.
3959 (Relobj::Kept_comdat_section): New type.
3960 (Relobj::Kept_comdat_section_table): New type.
3961 (Relobj::add_comdat_group): New function.
3962 (Relobj::set_kept_comdat_section): New function.
3963 (Relobj::get_kept_comdat_section): New function.
3964 (Relobj::comdat_groups_): New field.
3965 (Relobj::kept_comdat_sections_): New field.
3966 (Symbol_value::input_value): Update comment.
3967 (Sized_relobj::map_to_kept_section) New function.
3968 (Sized_relobj::include_linkonce_section): Add new parameter.
3969 * target-reloc.h (Comdat_behavior): New type.
3970 (get_comdat_behavior): New function.
3971 (relocate_section): Add code to map a discarded section to the
3972 corresponding kept section when applying a relocation.
3973
e4e5049b
CS
39742008-04-30 Craig Silverstein <csilvers@google.com>
3975
3976 * dwarf_reader.cc (next_generation_count): New static var.
3977 (Addr2line_cache_entry): New struct.
3978 (addr2line_cache): New static var.
3979 (Dwarf_line_info::one_addr2line): Added caching.
3980 (Dwarf_line_info::clear_addr2line_cache): New function.
3981 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
3982 cache-size parameter.
3983 (Dwarf_line_info::one_addr2line_cache): New function.
3984 * symtab.cc (Symbol_table::detect_odr_violations): Pass
3985 new cache-size argument to one_addr2line(), and clear cache.
3986
d09e9154
CC
39872008-04-28 Cary Coutant <ccoutant@google.com>
3988
3989 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
3990 R_386_PC8 relocations.
3991
7ef73768
ILT
39922008-04-23 Ian Lance Taylor <iant@google.com>
3993
55438702
ILT
3994 * object.cc (Sized_relobj::include_section_group): Check for
3995 invalid section group.
3996
c165fb93
ILT
3997 * object.cc (make_elf_object): Correct test for 64-bit ELF file
3998 header size.
3999
7ef73768
ILT
4000 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
4001 than read for file header.
4002 * archive.cc (Archive::include_member): Likewise.
4003
6194aaab
L
40042008-04-23 Paolo Bonzini <bonzini@gnu.org>
4005
4006 * aclocal.m4: Regenerate.
4007 * configure: Regenerate.
4008
d491d34e
ILT
40092008-04-19 Ian Lance Taylor <iant@google.com>
4010
5ea2bac6
ILT
4011 * version.cc (version_string): Bump to 1.6.
4012
7bc3e21a
ILT
4013 * testsuite/Makefile.am (many_sections_r_test): New target.
4014 (many_sections_r_test_SOURCES): Remove.
4015 (many_sections_r_test_DEPENDENCIES): Remove.
4016 (many_sections_r_test_LDFLAGS): Remove.
4017 (many_sections_r_test_LDADD): Remove.
4018
7fcd3aa9
ILT
4019 * object.cc (Sized_relobj::do_add_symbols): Always pass
4020 local_symbol_count_ to add_from_relobj.
4021
4c94d6ae
ILT
4022 * testsuite/Makefile.am (many_sections_check.h): Only check one in
4023 every thousand variables.
4024 * testsuite/Makefile.in: Rebuild.
4025
d491d34e
ILT
4026 * object.cc (Xindex::initialize_symtab_xindex): New function.
4027 (Xindex::read_symtab_xindex): New function.
4028 (Xindex::sym_xindex_to_shndx): New function.
4029 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
4030 available.
4031 (Sized_relobj::do_initialize_xindex): New function.
4032 (Sized_relobj::do_read_symbols): Adjust section links.
4033 (Sized_relobj::symbol_section_and_value): Add is_ordinary
4034 parameter. Change all callers.
4035 (Sized_relobj::include_section_group): Adjust section links and
4036 symbol section indexes.
4037 (Sized_relobj::do_layout): Adjust section links.
4038 (Sized_relobj::do_count_local_symbols): Adjust section links and
4039 symbol section indexes.
4040 (Sized_relobj::do_finalize_local_symbols): Distinguish between
4041 ordinary and special symbols.
4042 (Sized_relobj::write_local_symbols): Add symtab_xindex and
4043 dynsym_xindex parameters. Change all callers. Adjust section
4044 links. Use SHN_XINDEX when needed.
4045 (Sized_relobj::get_symbol_location_info): Adjust section links.
4046 Don't get fooled by special symbols.
4047 * object.h (class Xindex): Define.
4048 (class Object): Add xindex_ parameter. Declare virtual functoin
4049 do_initialize_xindex.
4050 (Object::adjust_sym_shndx): New function.
4051 (Object::set_xindex): New protected function.
4052 (class Symbol_value): Add is_ordinary_shndx_ field.
4053 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
4054 (Symbol_value::value): Assert ordinary section.
4055 (Symbol_value::initialize_input_to_output_map): Likewise.
4056 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
4057 Change all callers.
4058 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
4059 all callers.
4060 (class Sized_relobj): Update declarations.
4061 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
4062 parameter. Change all callers.
4063 (Sized_relobj::adjust_shndx): New function.
4064 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
4065 field.
4066 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
4067 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
4068 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
4069 (Sized_dynobj::read_dynsym_section): Adjust section links.
4070 (Sized_dynobj::read_dynamic): Likewise.
4071 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
4072 section links.
4073 (Sized_dynobj::do_initialize_xindex): New function.
4074 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
4075 do_initialize_xindex.
4076 (Sized_dynobj::adjust_shndx): New function.
4077 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
4078 dynsym_xindex_ fields.
4079 (Layout::finalize): Add a call to set_section_indexes before
4080 creating the symtab sections.
4081 (Layout::set_section_indexes): Don't do anything if the section
4082 already has a section index.
4083 (Layout::create_symtab_sections): Add shnum parameter. Change
4084 caller. Create .symtab_shndx section if needed.
4085 (Layout::create_shdrs): Add shstrtab_section parameter. Change
4086 caller.
4087 (Layout::allocated_output_section_count): New function.
4088 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
4089 needed.
4090 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
4091 fields. Update declarations.
4092 (Layout::symtab_xindex): New function.
4093 (Layout::dynsym_xindex): New function.
4094 (class Write_symbols_task): Add layout_ field.
4095 (Write_symbols_task::Write_symbols_task): Add layout parameter.
4096 Change caller.
4097 * output.cc (Output_section_headers::Output_section_headers): Add
4098 shstrtab_section parameter. Change all callers.
4099 (Output_section_headers::do_sized_write): Store overflow values
4100 for section count and section string table section index in
4101 section header zero.
4102 (Output_file_header::do_sized_write): Check for overflow of
4103 section count and section string table section index.
4104 (Output_symtab_xindex::do_write): New function.
4105 (Output_symtab_xindex::endian_do_write): New function.
4106 * output.h (class Output_section_headers): Add shstrtab_section_.
4107 Update declarations.
4108 (class Output_symtab_xindex): Define.
4109 (Output_section::has_out_shndx): New function.
4110 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
4111 field.
4112 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
4113 Change all callers.
4114 (Sized_symbol::init): Likewise.
4115 (Symbol::output_section): Check for ordinary symbol.
4116 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
4117 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
4118 callers.
4119 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
4120 Change all callers. Simplify handling of symbols from sections
4121 not included in the link.
4122 (Symbol_table::add_from_dynobj): Handle ordinary symbol
4123 distinction.
4124 (Weak_alias_sorter::operator()): Assert that symbols are
4125 ordinary.
4126 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
4127 distinction.
4128 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
4129 parameters. Change all callers.
4130 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
4131 symbol distinction. Use SHN_XINDEX when needed.
4132 (Symbol_table::write_section_symbol): Add symtab_xindex
4133 parameter. Change all callers.
4134 (Symbol_table::sized_write_section_symbol): Likewise. Use
4135 SHN_XINDEX when needed.
4136 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
4137 declarations.
4138 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
4139 (Symbol::is_defined): Check is_ordinary.
4140 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
4141 (Symbol::is_absolute, Symbol::is_common): Likewise.
4142 (class Sized_symbol): Update declarations.
4143 (class Symbol_table): Update declarations.
4144 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
4145 parameters. Change all callers.
4146 (Sized_symbol::override): Likewise.
4147 (Symbol_table::override): Likewise.
4148 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
4149 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
4150 is_ordinary, and orig_st_shndx parameters. Change all callers.
4151 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
4152 to be in an ordinary section.
4153 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
4154 object and is_ordinary parameters. Change all callers.
4155 (Sized_dwarf_line_info::read_relocs): Add object parameter.
4156 Change all callers. Don't add undefined or non-ordinary symbols
4157 to reloc_map_.
4158 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
4159 Change all callers.
4160 * dwarf_reader.h (class Sized_dwarf_line_info): Update
4161 declarations.
4162 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
4163 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
4164 (Sized_relobj::relocate_sections): Likewise.
4165 * target-reloc.h (scan_relocs): Adjust section symbol index.
4166 (scan_relocatable_relocs): Likewise.
4167 * i386.cc (Scan::local): Check for ordinary symbols.
4168 * sparc.cc (Scan::local): Likewise.
4169 * x86_64.cc (Scan::local): Likewise.
4170 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
4171 to symbol_section_and_value.
4172 * testsuite/many_sections_test.cc: New file.
4173 * testsuite/Makefile.am (BUILT_SOURCES): Define.
4174 (check_PROGRAMS): Add many_sections_test.
4175 (many_sections_test_SOURCES): Define.
4176 (many_sections_test_DEPENDENCIES): Define.
4177 (many_sections_test_LDFLAGS): Define.
4178 (BUILT_SOURCES): Add many_sections_define.h.
4179 (many_sections_define.h): New target.
4180 (BUILT_SOURCES): Add many_sections_check.h.
4181 (many_sections_check.h): New target.
4182 (check_PROGRAMS): Add many_sections_r_test.
4183 (many_sections_r_test_SOURCES): Define.
4184 (many_sections_r_test_DEPENDENCIES): Define.
4185 (many_sections_r_test_LDFLAGS): Define.
4186 (many_sections_r_test_LDADD): Define.
4187 (many_sections_r_test.o): New target.
4188 * testsuite/Makefile.in: Rebuild.
4189
c5818ff1
CC
41902008-04-17 Cary Coutant <ccoutant@google.com>
4191
4192 * errors.cc (Errors::info): New function.
4193 (gold_info): New function.
4194 * errors.h (Errors::info): New function.
4195 * gold.h (gold_info): New function.
4196 * object.cc (Input_objects::add_object): Print trace output.
4197 * options.cc (options::parse_set): New function.
4198 (General_options::parse_wrap): Deleted.
4199 (General_options::General_options): Deleted initializer.
4200 * options.h (options::String_set): New typedef.
4201 (options::parse_set): New function.
4202 (DEFINE_set): New macro.
4203 (General_options::wrap): Changed to use DEFINE_set. Changed
4204 callers of any_wrap_symbols and is_wrap_symbol.
4205 (General_options::trace, General_options::trace_symbol):
4206 New options.
4207 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
4208 (General_options::wrap_symbols_): Deleted.
4209 * symtab.cc (Symbol_table::add_from_object): Print trace output.
4210
b5be4a7c
DM
42112008-04-17 David S. Miller <davem@davemloft.net>
4212
4213 * options.cc (General_options::parse_V): New function.
4214 * options.h: Add entries for -V and -Qy.
4215
155a0dd7
ILT
42162008-04-17 Ian Lance Taylor <iant@google.com>
4217
4218 * common.cc (Symbol_table::allocate_commons): Remove options
4219 parameter. Change caller.
4220 (Symbol_table::do_allocate_commons): Remove options parameter.
4221 Change caller. Just call do_allocate_commons_list twice.
4222 (Symbol_table::do_allocate_commons_list): New function, broken out
4223 of do_allocate_commons.
4224 * common.h (class Allocate_commons_task): Remove options_ field.
4225 Update constructor.
4226 * symtab.cc (Symbol_table::Symbol_table): Initialize
4227 tls_commons_.
4228 (Symbol_table::add_from_object): Put TLS common symbols on
4229 tls_commons_ list.
4230 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
4231 which are IN_OUTPUT_DATA.
4232 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
4233 allocate_commons and do_allocate_commons declarations. Declare
4234 do_allocate_commons_list.
4235 * gold.cc (queue_middle_tasks): Update creation of
4236 Allocate_commons_task to not pass options.
4237 * testsuite/Makefile.am (INCLUDES): Add -I.. .
4238 (TLS_TEST_C_FLAGS): New variable.
4239 (tls_test_c_pic.o): New target.
4240 (tls_test_shared.so): Link in tls_test_c_pic.o.
4241 (tls_test_c_pic_ie.o): New target.
4242 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
4243 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
4244 (tls_test_c.o): New target.
4245 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
4246 (tls_pic_test_LDADD): Likewise.
4247 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
4248 (tls_shared_gd_to_ie_test_LDADD): Likewise.
4249 (tls_test_c_gnu2.o): New target.
4250 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
4251 tls_test_c_gnu2.o.
4252 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
4253 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
4254 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
4255 * testsuite/tls_test.cc: Include "config.h".
4256 (t_last): Call t11_last.
4257 * testsuite/tls_test.h (t11, t11_last): Declare.
4258 * testsuite/tls_test_c.c: New file.
4259 * testsuite/tls_test_main.cc (thread_routine): Call t11.
4260 * configure.ac: Check for OpenMP support.
4261 * configure, config.in, Makefile.in: Rebuild.
4262 * testsuite/Makefile.in: Rebuild.
4263
edfbb029
CC
42642008-04-16 Cary Coutant <ccoutant@google.com>
4265
4266 * i386.cc (Target_i386::define_tls_base_symbol): New function.
4267 (Target_i386::tls_base_symbol_defined_): New field.
4268 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
4269 (Target_i386::Scan::global): Likewise.
4270 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
4271 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
4272 (Target_x86_64::tls_base_symbol_defined_): New field.
4273 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
4274 (Target_x86_64::Scan::global): Likewise.
4275
f3c69fca
CC
42762008-04-16 Cary Coutant <ccoutant@google.com>
4277
4278 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
4279 (Symbol::needs_plt_entry): Allow weak undefined symbols.
4280 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
4281 building shared libraries.
4282 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
4283 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
4284 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
4285 * testsuite/Makefile.in: Rebuild.
4286 * testsuite/weak_undef.h: New file.
4287 * testsuite/weak_undef_file1.cc: Add extra test cases.
4288 * testsuite/weak_undef_file2.cc: Likewise.
4289 * testsuite/weak_undef_test.cc: Likewise.
4290
7c414435
DM
42912008-04-16 David S. Miller <davem@davemloft.net>
4292
32b769e1
DM
4293 * sparc.cc (Target_sparc::Scan): Change from struct to class.
4294 Add issued_non_pic_error_ field. Declare check_non_pic.
4295 (Target_sparc::Scan::check_non_pic): New function.
4296 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
4297 (Target_sparc::Scan::global): Likewise.
4298
11936fb1
DM
4299 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
4300 * configure: Rebuild.
4301
7c414435
DM
4302 * options.h (DEFINE_enable): New macro.
4303 (new_dtags): New enable option.
4304 (initfirst, interpose, loadfltr, nodefaultlib,
4305 nodelete, nodlopen, nodump): New -z options.
4306 * layout.cc (Layout:finish_dynamic_section): If new
4307 dtags enabled, emit DT_RUNPATH. Also, emit a
4308 DT_FLAGS_1 containing any specified -z flags.
4309
85c7bf8b
ILT
43102008-04-16 Ian Lance Taylor <iant@google.com>
4311
12c0daef
ILT
4312 * copy-relocs.cc: New file.
4313 * copy-relocs.h: New file.
4314 * reloc.cc: Remove Copy_relocs code.
4315 * reloc.h: Likewise.
4316 * reloc-types.h (struct Reloc_types) [both versions]: Add
4317 get_reloc_addend_noerror.
4318 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
4319 variants of add_global which take an addend which must be zero.
4320 * i386.cc: Include "copy-relocs.h".
4321 (class Target_i386): Change type of copy_relocs_ to variable,
4322 update initializer.
4323 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
4324 Change all callers.
4325 (Target_i386::do_finalize_sections): Change handling of
4326 copy_relocs_.
4327 * sparc.cc: Include "copy-relocs.h".
4328 (class Target_sparc): Change type of copy_relocs_ to variable,
4329 update initializer.
4330 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
4331 Change all callers.
4332 (Target_sparc::do_finalize_sections): Change handling of
4333 copy_relocs_.
4334 * x86_64.cc: Include "copy-relocs.h".
4335 (class Target_x86_64): Change type of copy_relocs_ to variable,
4336 update initializer.
4337 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
4338 class. Change all callers.
4339 (Target_x86_64::do_finalize_sections): Change handling of
4340 copy_relocs_.
4341 * Makefile.am (CCFILES): Add copy-relocs.cc.
4342 (HFILES): Add copy-relocs.h.
4343
4f4995b6
ILT
4344 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
4345
85c7bf8b
ILT
4346 * testsuite/script_test_4.sh: Permit leading zeroes.
4347
4f2a9edd
ILT
43482008-04-15 Ian Lance Taylor <iant@google.com>
4349
e6188289
ILT
4350 * script-sections.cc (Script_sections::create_segments): Use
4351 header_size_adjustment even when there is enough room for the
4352 headers.
4353 * testsuite/script_test_4.sh: New file.
4354 * testsuite/script_test_4.t: New file.
4355 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
4356 (check_DATA): Add script_test_4.stdout.
4357 (MOSTLYCLEANFILES): Likewise.
4358 (script_test_4): New target.
4359 (script_test_4.stdout): New target.
4360 * testsuite/Makefile.in: Rebuild.
4361
4f2a9edd
ILT
4362 * sparc.cc: Add definitions for Output_data_plt_sparc class
4363 constants.
4364
f5314dd5
DM
43652008-04-14 David S. Miller <davem@davemloft.net>
4366
4367 * sparc.cc: New file.
4368 * Makefile.am (TARGETSOURCES): Add sparc.cc
4369 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
4370 * configure.tgt: Document targ_extra_size and
4371 targ_extra_big_endian. Add entries for sparc-* and
4372 sparc64-*.
4373 * configure.ac: Handle targ_extra_size and
4374 targ_extra_big_endian.
4375 * Makefile.in: Rebuild.
4376 * configure: Likewise.
4377 * po/POTFILES.in: Likewise.
4378 * po/gold.pot: Likewise.
4379
154e0e9a
ILT
43802008-04-14 Ian Lance Taylor <iant@google.com>
4381
4382 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
4383 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
4384 in the name/type/flags to section mapping. Don't call
4385 allocate_output_section.
4386 (Layout::choose_output_section): Change parameter from adjust_name
4387 to is_input_section. Don't permit input sections after sections
4388 are attached to segments. Don't call allocate_output_section.
4389 (Layout::layout_eh_frame): Call update_flags_for_input_section,
4390 not write_enable_output_section.
4391 (Layout::make_output_section): Don't push to
4392 unattached_section_list_ nor call attach_to_segment. Call
4393 attach_section_to_segment if sections are attached.
4394 (Layout::attach_sections_to_segments): New function.
4395 (Layout::attach_section_to_segment): New function.
4396 (Layout::attach_allocated_section_to_segment): Rename from
4397 attach_to_segment. Remove flags parameter.
4398 (Layout::allocate_output_section): Remove function.
4399 (Layout::write_enable_output_section): Remove function.
4400 * layout.h (class Layout): Update for above changes. Add new
4401 field sections_are_attached_.
4402 * output.h (Output_section::update_flags_for_input_section): New
4403 function.
4404 * output.cc (Output_section::add_input_section): Call
4405 update_flags_for_input_section.
4406 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
4407
009a67a2
CC
44082008-04-11 Cary Coutant <ccoutant@google.com>
4409
4410 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
4411 thought unnecessary.
4412 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
4413
759b1a24
ILT
44142008-04-11 Ian Lance Taylor <iant@google.com>
4415
4416 * output.h (class Output_section_data): Remove inline definition
4417 of set_addralign.
4418 * output.cc (Output_section_data::set_addralign): New function.
4419
c2b45e22
CC
44202008-04-11 Cary Coutant <ccoutant@google.com>
4421
4422 Add support for TLS descriptors for i386 and x86_64.
4423 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
4424 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
4425 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
4426 GOT_TYPE_TLS_DESC.
4427 (Target_i386::got_mod_index_entry): Remove unnecessary code.
4428 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
4429 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
4430 relocations.
4431 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
4432 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
4433 Fix problem with initial-exec relocations.
4434 (Target_i386::Relocate::relocate_tls): Likewise.
4435 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
4436 relaxation.
4437 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
4438 support for section-plus-offset dynamic table entries.
4439 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
4440 (Output_data_dynamic::Dynamic_entry): Add support for
4441 section-plus-offset dynamic table entries.
4442 (Output_data_dynamic::Classification): Likewise.
4443 (Output_data_dynamic::classification_): Renamed offset_.
4444 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
4445 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
4446 (Target_x86_64::make_plt_section): New function.
4447 (Target_x86_64::reserve_tlsdesc_entries): New function.
4448 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
4449 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
4450 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
4451 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
4452 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
4453 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
4454 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
4455 add extra PLT entry for TLS descriptors.
4456 (Output_data_plt_x86_64::got_): New field.
4457 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
4458 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
4459 fields.
4460 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
4461 descriptors.
4462 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
4463 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
4464 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
4465 R_386_TLS_DESC_CALL relocations.
4466 (Target_x86_64::Scan::global): Likewise.
4467 (Target_x86_64::do_finalize_sections): Add dynamic table entries
4468 for TLS descriptors.
4469 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
4470 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
4471 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
4472 GD-to-IE relaxation.
4473 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
4474 and TLS_DESCRIPTORS.
4475 * Makefile.in: Rebuild.
4476 * configure: Rebuild.
4477 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
4478 (tls_test_shared2.so): New target.
4479 (tls_shared_gd_to_ie_test_SOURCES): New variable.
4480 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
4481 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
4482 (tls_shared_gd_to_ie_test_LDADD): New variable.
4483 (tls_shared_gnu2_gd_to_ie_test): New target.
4484 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
4485 New targets.
4486 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
4487 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
4488 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
4489 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
4490 (tls_shared_gnu2_test): New target.
4491 (tls_test_gnu2_shared.so): New target.
4492 (tls_shared_gnu2_test_SOURCES): New variable.
4493 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
4494 (tls_shared_gnu2_test_LDFLAGS): New variable.
4495 (tls_shared_gnu2_test_LDADD): New variable.
4496 * testsuite/Makefile.in: Rebuild.
4497 * testsuite/Makefile.
4498
83bfb6b7
ILT
44992008-04-11 Ian Lance Taylor <iant@google.com>
4500
4501 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
4502 justsyms.t.
4503 * testsuite/Makefile.in: Rebuild.
4504
4505 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
4506 long.
4507 * testsuite/script_test_2.cc (main): Adjust test.
4508
706e1f5e
ILT
45092008-04-11 David S. Miller <davem@davemloft.net>
4510 Ian Lance Taylor <iant@google.com>
4511
4512 * options.h (General_options): Add entries for '-Y' and
4513 '-relax'.
4514 * options.cc (General_options:finalize): If -Y was used, add those
4515 entries to the library path instead of the default "/lib" and
4516 "/usr/lib".
4517
7c98e6bb
DM
45182008-04-11 David S. Miller <davem@davemloft.net>
4519
4520 * testsuite/justsyms.t: Start at 0x100.
4521 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
4522 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
4523 long.
4524 * testsuite/script_test_2.cc: Adjust string and section length
4525 checks.
7c98e6bb 4526
99a37bfd
ILT
45272008-04-09 Ian Lance Taylor <iant@google.com>
4528
2cefc357
ILT
4529 PR gold/5996
4530 * script-sections.cc (Sections_element::allocate_to_segment): Add
4531 orphan parameter.
4532 (Output_section_definition::allocate_to_segment): Likewise.
4533 (Orphan_output_section::allocate_to_segment): Likewise.
4534 (Script_sections::attach_sections_using_phdrs_clause): Don't
4535 propagate non-PT_LOAD segments to orphan sections.
4536 * testsuite/Makefile.am (script_test_3.stdout): Generate using
4537 readelf rather than objdump.
4538 * testsuite/script_test_3.sh: Adjust accordingly. Test that
4539 .interp section and PT_INTERP segment are the same size.
4540 * testsuite/Makefile.in: Rebuild.
4541
99a37bfd
ILT
4542 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
4543 aliases for symbols defined in the same object.
4544 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
4545 (weak_alias_test_SOURCES): New variable.
4546 (weak_alias_test_DEPENDENCIES): New variable.
4547 (weak_alias_test_LDFLAGS): New variable.
4548 (weak_alias_test_LDADD): New variable.
4549 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
4550 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
4551 (weak_alias_test_3.o): New target.
4552 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
4553 * testsuite/weak_alias_test_main.cc: New file.
4554 * testsuite/weak_alias_test_1.cc: New file.
4555 * testsuite/weak_alias_test_2.cc: New file.
4556 * testsuite/weak_alias_test_3.cc: New file.
4557
780e49c5
ILT
45582008-04-08 Ian Lance Taylor <iant@google.com>
4559
cdb0b8f5
ILT
4560 * options.h (class General_options): Add --noinhibit-exec option.
4561 * main.cc (main): Check --noinhibit-exec.
4562
0864d551
ILT
4563 * options.h (class General_options): Define --wrap as a special
4564 option. Add wrap_symbols_ field.
4565 (General_options::any_wrap_symbols): New function.
4566 (General_options::is_wrap_symbol): New function.
4567 * options.cc (General_options::parse_wrap): New function.
4568 (General_options::General_options): Initialize wrap_symbols_.
4569 * symtab.cc (Symbol_table::wrap_symbol): New function.
4570 (Symbol_table::add_from_object): Handle --wrap.
4571 * symtab.h (class Symbol_table): Declare wrap_symbol.
4572 * target.h (Target::wrap_char): New function.
4573 (Target::Target_info): Add wrap_char field.
4574 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
4575 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4576 * testsuite/testfile.cc (Target_test::test_target_info):
4577 Likewise.
4578
789aa6de
ILT
4579 * errors.cc (Errors::undefined_symbol): Mention symbol version if
4580 there is one.
4581
2c38906f
ILT
4582 * layout.h (class Layout): Add added_eh_frame_data_ field.
4583 * layout.cc (Layout::Layout): Initialize new field.
4584 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
4585 output section until we find a section we merged successfully.
4586 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
4587 that the size be non-zero.
4588
780e49c5
ILT
4589 * merge.cc (Object_merge_map::get_output_offset): Remove inline
4590 qualifier.
4591
7fcd0256
ILT
45922008-04-08 Craig Silverstein <csilvers@google.com>
4593
4594 * configure.ac: Export new conditional variable HAVE_ZLIB.
4595 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
4596 on HAVE_ZLIB.
4597 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
4598 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
4599
6835af53
ILT
46002008-04-07 Ian Lance Taylor <iant@google.com>
4601
e24f324c
ILT
4602 * version.cc (version_string): Set to "1.5".
4603
a036edd8
ILT
4604 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
4605 Add issued_non_pic_error_ field. Declare check_non_pic.
4606 (Target_x86_64::Scan::check_non_pic): New function.
4607 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
4608 (Target_x86_64::Scan::global): Likewise.
4609
624f8810
ILT
4610 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
4611 addend parameter. Change caller. Handle merge sections.
4612 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
4613 Address to Addend. Don't add in the result of
4614 local_section_offset, pass down the addend and use the returned
4615 value.
4616 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
4617 Update declarations of local_section_offset and symbol_value.
4618 * testsuite/two_file_test_1.cc (t18): New function.
4619 * testsuite/two_file_test_2.cc (f18): New function.
4620 * testsuite/two_file_test_main.cc (main): Call t18.
4621 * testsuite/two_file_test.h (t18, f18): Declare.
4622
6835af53
ILT
4623 * configure.ac: Don't test for objdump, c++filt, or readelf.
4624 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
4625 conditionals.
4626 (TEST_READELF): New variable.
4627 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
4628 (check_PROGRAMS): Add two_file_strip_test.
4629 (two_file_strip_test): New target.
4630 (check_PROGRAMS): Add two_file_same_shared_strip_test.
4631 (two_file_same_shared_strip_test_SOURCES): New variable.
4632 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
4633 (two_file_same_shared_strip_test_LDFLAGS): New variable.
4634 (two_file_same_shared_strip_test_LDADD): New variable.
4635 (two_file_shared_strip.so): New target.
4636 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
4637 (ver_test_5.syms, ver_test_7.syms): Likewise.
4638 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
4639 (strip_test_3.stdout): Use TEST_OBJDUMP.
4640 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
4641
86925eef
CC
46422008-04-04 Cary Coutant <ccoutant@google.com>
4643
4644 * symtab.h (Symbol::is_weak_undefined): New function.
4645 (Symbol::is_strong_undefined): New function.
4646 (Symbol::is_absolute): New function.
4647 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
4648 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
4649 absolute symbols.
4650 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
4651 (weak_undef_test): New target.
4652 * testsuite/Makefile.in: Rebuild.
4653 * testsuite/weak_undef_file1.cc: New file.
4654 * testsuite/weak_undef_file2.cc: New file.
4655 * testsuite/weak_undef_test.cc: New file.
4656
126f3ece
ILT
46572008-04-03 Craig Silverstein <csilvers@google.com>
4658
4659 * compressed_output.h (class Output_compressed_section): Use
4660 unsigned buffer.
4661 * compressed_output.cc (zlib_compress): Use unsigned buffers,
4662 add zlib header.
4663 (zlib_compressed_suffix): Removed.
4664 (Output_compressed_section::set_final_data_size): Use unsigned
4665 buffers.
4666 * testsuite/Makefile.am (flagstest_compress_debug_sections):
4667 Fix linker invocation.
4668 (flagstest_o_specialfile_and_compress_debug_sections):
4669 Likewise.
4670 * testsuite/Makefile.in: Regenerated.
4671
deae2a14
DM
46722008-04-02 David S. Miller <davem@davemloft.net>
4673
4674 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
4675 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
4676
70752818
ILT
46772008-04-02 Craig Silverstein <csilvers@google.com>
4678
4679 * TODO: New file.
4680
39d0cb0e
ILT
46812008-04-02 Ian Lance Taylor <iant@google.com>
4682
4683 * fileread.cc (File_read::find_view): Add byteshift and vshifted
4684 parameters. Update for new key type to views_. Change all
4685 callers.
4686 (File_read::read): Adjust for byteshift in returned view.
4687 (File_read::add_view): New function, broken out of
4688 find_and_make_view.
4689 (File_read::make_view): New function, broken out of
4690 find_and_make_view.
4691 (File_read::find_or_make_view): Add offset and aligned
4692 parameters. Rewrite accordingly. Change all callers.
4693 (File_read::get_view): Add offset and aligned parameters. Adjust
4694 for byteshift in return value.
4695 (File_read::get_lasting_view): Likewise.
4696 * fileread.h (class File_read): Update declarations.
4697 (class File_read::View): Add byteshift_ field. Add byteshift to
4698 constructor. Add byteshift method.
4699 * archive.h (Archive::clear_uncached_views): New function.
4700 (Archive::get_view): Add aligned parameter. Change all callers.
4701 * object.h (Object::get_view): Add aligned parameter. Change all
4702 callers.
4703 (Object::get_lasting_view): Likewise.
4704
4705 * fileread.cc (File_read::release): Don't call clear_views if
4706 there are multiple objects.
4707 * fileread.h (File_read::clear_uncached_views): New function.
4708 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
4709 on the archive.
4710
a1207466
CC
47112008-03-31 Cary Coutant <ccoutant@google.com>
4712
4713 Add thin archive support.
4714 * archive.cc (Archive::armagt): New const.
4715 (Archive::setup): Remove task parameter and calls to unlock.
4716 (Archive::unlock_nested_archives): New function.
4717 (Archive::read_header): Add nested_off parameter. Change
4718 all callers.
4719 (Archive::interpret_header): Likewise.
4720 (Archive::include_all_members): Change to handle thin
4721 archives.
4722 (Archive::include_member): Likewise.
4723 * archive.h (Archive::Archive): Add new parameters and
4724 initializers.
4725 (Archive::armagt): New const.
4726 (Archive::setup): Remove task parameter.
4727 (Archive::unlock_nested_archives): New function.
4728 (Archive::read_header): Add nested_off parameter.
4729 (Archive::interpret_header): Likewise.
4730 (Archive::Nested_archive_table): New typedef.
4731 (Archive::is_thin_archive_): New field.
4732 (Archive::nested_archives_): New field.
4733 (Archive::options_): New field.
4734 (Archive::dirpath_): New field.
4735 (Archive::task_): New field.
4736 * readsyms.cc (Read_symbols::do_read_symbols): Add check
4737 for thin archives. Pass additional parameters to
4738 Archive::Archive. Unlock the archive file after calling
4739 Archive::setup.
cd536b21 4740
479f6503
ILT
47412008-03-29 Ian Lance Taylor <iant@google.com>
4742
686c8caf
ILT
4743 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
4744 version symbol to be local.
4745 * testsuite/ver_test_4.sh: New file.
4746 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
4747 (check_DATA): Add ver_test_4.syms.
4748 (ver_test_4.syms): New target.
4749 * testsuite/Makefile.in: Rebuild.
4750
ab794b6b
ILT
4751 * output.cc
4752 (Output_section::Input_section_sort_entry::has_priority): New
4753 function.
4754 (Output_section::Input_section_sort_entry::match_file_name): New
4755 function.
4756 (Output_section::Input_section_sort_entry::match_section_name):
4757 Remove.
4758 (Output_section::Input_section_sort_entry::match_section_name_prefix):
4759 Remove.
4760 (Output_section::Input_section_sort_entry::match_section_file):
4761 Remove.
4762 (Output_section::Input_section_sort_compare::operator()): Rewrite
4763 using new Input_section_sort_entry functions. Sort crtbegin and
4764 crtend first. Sort sections with no priority before sections with
4765 a priority.
4766 * testsuite/initpri1.c (d3): Check j != 4.
4767 (cd5): New constructor/destructor function.
4768 (main): Check j != 2.
4769
479f6503
ILT
4770 * symtab.cc (Symbol_table::add_from_object): If we don't use the
4771 new symbol when resolving, don't call set_is_default.
4772 * testsuite/ver_test_7.cc: New file.
4773 * testsuite/ver_test_7.sh: New file.
4774 * testsuite/Makefile.am (ver_test_7.so): New target.
4775 (ver_test_7.o): New target.
4776 (check_SCRIPTS): Add ver_test_7.sh.
4777 (check_DATA): Add ver_test_7.syms.
4778 (ver_test_7.syms): New target.
4779
2fd32231
ILT
47802008-03-28 Ian Lance Taylor <iant@google.com>
4781
4782 * layout.cc (Layout::layout): If we see an input section with a
4783 name that needs sorting, set the must_sort flag for the output
4784 section.
4785 (Layout::make_output_section): If the name of the output section
4786 indicates that it might require sorting, set the may_sort flag.
4787 * output.h (Output_section::may_sort_attached_input_sections): New
4788 function.
4789 (Output_section::set_may_sort_attached_input_sections): New
4790 function.
4791 (Output_section::must_sort_attached_input_sections): New
4792 function.
4793 (Output_section::set_must_sort_attached_input_sections): New
4794 function.
4795 (class Output_section): Declare Input_section_sort_entry. Define
4796 Input_section_sort_compare. Declare
4797 sort_attached_input_sections. Add new fields:
4798 may_sort_attached_input_sections_,
4799 must_sort_attached_input_sections_,
4800 attached_input_sections_are_sorted_.
4801 * output.cc (Output_section::Output_section): Initialize new
4802 fields.
4803 (Output_section::add_input_section): Add an entry to
4804 input_sections_ if may_sort or must_sort are true.
4805 (Output_section::set_final_data_size): Call
4806 sort_attached_input_sections if necessary.
4807 (Output_section::Input_section_sort_entry): Define new class.
4808 (Output_section::Input_section_sort_compare::operator()): New
4809 function.
4810 (Output_section::sort_attached_input_sections): New function.
4811 * configure.ac: Check whether the compiler supports constructor
4812 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
4813 * testsuite/initpri1.c: New file.
4814 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
4815 CONSTRUCTOR_PRIORITY.
4816 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
4817 (initpri1_LDFLAGS): New variable.
4818 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
4819
18e6b24e
ILT
48202008-03-27 Ian Lance Taylor <iant@google.com>
4821
49bdd526
ILT
4822 * common.cc (Sort_commons::operator): Correct sorting algorithm.
4823 * testsuite/common_test_1.c: New file.
4824 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
4825 (common_test_1_SOURCES): New variable.
4826 (common_test_1_DEPENDENCIES): New variable.
4827 (common_test_1_LDFLAGS): New variable.
4828
18e6b24e
ILT
4829 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
4830 and commons_ correctly when NAME/VERSION does not override
4831 NAME/NULL.
4832 * testsuite/ver_test_6.c: New file.
4833 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
4834 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
4835 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
4836
04bf7072
ILT
48372008-03-26 Ian Lance Taylor <iant@google.com>
4838
5871526f
ILT
4839 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
4840 of an undefined symbol from a version script.
4841 * testsuite/Makefile.am (ver_test_5.so): New target.
4842 (ver_test_5.o): New target.
4843 (check_SCRIPTS): Add ver_test_5.sh.
4844 (check_DATA): Add ver_test_5.syms.
4845 (ver_test_5.syms): New target.
4846 * testsuite/ver_test_5.cc: New file.
4847 * testsuite/ver_test_5.script: New file.
4848 * testsuite/ver_test_5.sh: New file.
4849 * Makefile.in, testsuite/Makefile.in: Rebuild.
4850
04bf7072
ILT
4851 PR gold/5986
4852 Fix problems building gold with gcc 4.3.0.
4853 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
4854 (gold_error_at_location, gold_warning_at_location): Use it.
4855 * configure.ac: Check whether we can compile and use a template
4856 function with a printf attribute.
4857 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
4858 when jumping over bytes.
4859 * object.cc: Instantiate Object::read_section_data.
4860 * debug.h: Include <cstring>
4861 * dwarf_reader.cc: Include <algorithm>
4862 * main.cc: Include <cstring>.
4863 * options.cc: Include <cstring>.
4864 * output.cc: Include <cstring>.
4865 * script.cc: Include <cstring>.
4866 * script.h: Include <string>.
4867 * symtab.cc: Include <cstring> and <algorithm>.
4868 * target-select.cc: Include <cstring>.
4869 * version.cc: Include <string>.
4870 * testsuite/testmain.cc: Include <cstdlib>.
4871 * configure, config.in: Rebuild.
4872
874c5b28
ILT
48732008-03-25 Ian Lance Taylor <iant@google.com>
4874
819d6c3a
ILT
4875 * options.cc: Include "../bfd/bfdver.h".
4876 (options::help): Print bug reporting address.
4877
f4b2c6f5
ILT
4878 * version.cc (print_version): Adjust output for current value of
4879 BFD_VERSION_STRING.
4880
4881 * NEWS: New file.
4882
e96caa79
ILT
4883 * options.cc (options::help): Print list of supported targets.
4884 * target-select.h: Include <vector>.
4885 (class Target_selector): Make machine_, size_, and is_big_endian_
4886 fields const. Add bfd_name_ and instantiated_target_ fields.
4887 (Target_selector::Target_selector): Add bfd_name parameter.
4888 (Target_selector::recognize): Make non-virtual, call
4889 do_recognize.
4890 (Target_selector::recognize_by_name): Make non-virtual, call
4891 do_recognize_by_name.
4892 (Target_selector::supported_names): New function.
4893 (Target_selector::bfd_name): New function.
4894 (Target_selector::do_instantiate_target): New pure virtual
4895 function.
4896 (Target_selector::do_recognize): New virtual function.
4897 (Target_selector::do_recognize_by_name): New virtual function.
4898 (Target_selector::instantiate_target): New private function.
4899 (supported_target_names): Declare.
4900 * target-select.cc (Target_selector::Target_selector): Update for
4901 new parameter and fields.
4902 (select_target_by_name): Check that the name matches before
4903 calling recognize_by_name.
4904 (supported_target_names): New function.
4905 * i386.cc (class Target_selector_i386): Update Target_selector
4906 constructor call. Remove recognize and recognize_by_name. Add
4907 do_instantiate_target.
4908 * x86_64.cc (class Target_selector_x86_64): Likewise.
4909 * testsuite/testfile.cc (class Target_selector_test): Update for
4910 changes to Target_selector.
4911
874c5b28
ILT
4912 * README: Rewrite, with some notes on unsupported features.
4913
0a65a3a7
CC
49142008-03-24 Cary Coutant <ccoutant@google.com>
4915
4916 * i386.cc (Target_i386::Got_type): New enum declaration.
4917 (Target_i386::Scan::local): Updated callers of Output_data_got
4918 member functions.
4919 (Target_i386::Scan::global): Likewise.
4920 (Target_i386::Relocate::relocate): Likewise.
4921 (Target_i386::Relocate::relocate_tls): Likewise.
4922 * object.h (Got_offset_list): New class.
4923 (Sized_relobj::local_has_got_offset): Added got_type parameter.
4924 (Sized_relobj::local_got_offset): Likewise.
4925 (Sized_relobj::set_local_got_offset): Likewise.
4926 (Sized_relobj::local_has_tls_got_offset): Removed.
4927 (Sized_relobj::local_tls_got_offset): Removed.
4928 (Sized_relobj::set_local_tls_got_offset): Removed.
4929 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
4930 * output.cc (Output_data_got::add_global): Added got_type parameter.
4931 (Output_data_got::add_global_with_rel): Likewise.
4932 (Output_data_got::add_global_with_rela): Likewise.
4933 (Output_data_got::add_global_pair_with_rel): New function.
4934 (Output_data_got::add_global_pair_with_rela): New function.
4935 (Output_data_got::add_local): Added got_type parameter.
4936 (Output_data_got::add_local_with_rel): Likewise.
4937 (Output_data_got::add_local_with_rela): Likewise.
4938 (Output_data_got::add_local_pair_with_rel): New function.
4939 (Output_data_got::add_local_pair_with_rela): New function.
4940 (Output_data_got::add_global_tls): Removed.
4941 (Output_data_got::add_global_tls_with_rel): Removed.
4942 (Output_data_got::add_global_tls_with_rela): Removed.
4943 (Output_data_got::add_local_tls): Removed.
4944 (Output_data_got::add_local_tls_with_rel): Removed.
4945 (Output_data_got::add_local_tls_with_rela): Removed.
4946 * output.h (Output_data_got::add_global): Added got_type parameter.
4947 (Output_data_got::add_global_with_rel): Likewise.
4948 (Output_data_got::add_global_with_rela): Likewise.
4949 (Output_data_got::add_global_pair_with_rel): New function.
4950 (Output_data_got::add_global_pair_with_rela): New function.
4951 (Output_data_got::add_local): Added got_type parameter.
4952 (Output_data_got::add_local_with_rel): Likewise.
4953 (Output_data_got::add_local_with_rela): Likewise.
4954 (Output_data_got::add_local_pair_with_rel): New function.
4955 (Output_data_got::add_local_pair_with_rela): New function.
4956 (Output_data_got::add_global_tls): Removed.
4957 (Output_data_got::add_global_tls_with_rel): Removed.
4958 (Output_data_got::add_global_tls_with_rela): Removed.
4959 (Output_data_got::add_local_tls): Removed.
4960 (Output_data_got::add_local_tls_with_rel): Removed.
4961 (Output_data_got::add_local_tls_with_rela): Removed.
4962 * resolve.cc (Symbol::override_base_with_special): Removed
4963 reference to has_got_offset_ field.
4964 * symtab.cc (Symbol::init_fields): Replaced initialization
4965 of got_offset_ with got_offsets_. Removed initialization
4966 of has_got_offset_
53fcba31 4967 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
4968 (Symbol::got_offset): Likewise.
4969 (Symbol::set_got_offset): Likewise.
4970 (Symbol::has_tls_got_offset): Removed.
4971 (Symbol::tls_got_offset): Removed.
4972 (Symbol::set_tls_got_offset): Removed.
4973 (Symbol::got_offset_): Removed.
4974 (Symbol::tls_mod_got_offset_): Removed.
4975 (Symbol::tls_pair_got_offset_): Removed.
4976 (Symbol::got_offsets_): New field.
4977 (Symbol::has_got_offset): Removed.
4978 (Symbol::has_tls_mod_got_offset): Removed.
4979 (Symbol::has_tls_pair_got_offset): Removed.
4980 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
4981 (Target_x86_64::Scan::local): Updated callers of Output_data_got
4982 member functions.
4983 (Target_x86_64::Scan::global): Likewise.
4984 (Target_x86_64::Relocate::relocate): Likewise.
4985 (Target_x86_64::Relocate::relocate_tls): Likewise.
4986
bd52eafb
BE
49872008-03-25 Ben Elliston <bje@au.ibm.com>
4988
4989 * yyscript.y: Fix spelling error in comment.
4990
8b105e34
ILT
49912008-03-24 Ian Lance Taylor <iant@google.com>
4992
8ed814a9
ILT
4993 * options.h (class General_options): Define build_id option.
4994 * layout.h (class Layout): Declare write_build_id, create_note,
4995 create_build_id. Add build_id_note_ member.
4996 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
4997 "libiberty.h", "md5.h", "sha1.h".
4998 (Layout::Layout): Initialize eh_frame_data_,
4999 eh_frame_hdr_section_, and build_id_note_.
5000 (Layout::finalize): Call create_build_id.
5001 (Layout::create_note): New function, broken out of
5002 Layout::create_gold_note.
5003 (Layout::create_gold_note): Call create_note.
5004 (Layout::create_build_id): New function.
5005 (Layout::write_build_id): New function.
5006 (Close_task_runner::run): Call write_build_id.
5007
8b105e34
ILT
5008 * x86_64.cc: Correct license to GPLv3.
5009
086a1841
ILT
50102008-03-23 Ian Lance Taylor <iant@google.com>
5011
5012 * options.cc: Include "demangle.h".
5013 (parse_optional_string): New function.
5014 (parse_long_option): Handle takes_optional_argument.
5015 (parse_short_option): Update dash_z initializer. Handle
5016 takes_optional_argument.
5017 (General_options::General_options): Initialize do_demangle_.
5018 (General_options::finalize): Set do_demangle_. Handle demangling
5019 style.
5020 * options.h (parse_optional_string): Declare.
5021 (struct One_option): Add optional_arg field. Update constructor.
5022 Update call constructor calls. Add takes_optional_argument
5023 function.
5024 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
5025 (DEFINE_optional_string): Define.
5026 (General_options::demangle): Change from DEFINE_bool to
5027 DEFINE_optional_string.
5028 (General_options::no_demangle): New function.
5029 (General_options::do_demangle): New function.
5030 (General_options::set_do_demangle): New function.
5031 (General_options::execstack_status_): Move definition to end of
5032 class definition.
5033 (General_options::static_): Likewise.
5034 (General_options::do_demangle_): New field.
5035 * object.cc (big_endian>::get_symbol_location_info): Call
5036 Options::do_demangle, not Options::demangle.
5037 * symtab.cc (demangle): Likewise.
5038
cbb93e63
ILT
50392008-03-22 Ian Lance Taylor <iant@google.com>
5040
5041 * gold.h: Include <cstddef> and <sys/types.h>
5042 * options.h: Include <cstring>.
5043
ec531623
ILT
50442008-03-21 Ian Lance Taylor <iant@google.com>
5045
5046 * Added source code to GNU binutils.
This page took 0.308594 seconds and 4 git commands to generate.