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