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