2010-02-18 Doug Kwan <dougkwan@google.com>
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
c8761b9a
DK
12010-02-18 Doug Kwan <dougkwan@google.com>
2
3 * arm.cc (Arm_relobj::find_linked_text_section): New method.
4 (Arm_relobj::make_exidx_input_section): Pass section index of linked
5 text section as a parameter becuase some broken tools may not set
6 the link in section header.
7 (Target_arm::has_got_section): New method.
8 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
9 without any mapping symbol as data only. Remove warning.
10 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
11 link in its section header, try to discover the link by inspecting the
12 REL31 relocation at the beginning of the section.
13 (Target_arm::Scan::check_non_pic): Report name of offending relocation
14 in error message.
15 (Target_arm::Scan::global): Treat any reference to the symbol
16 _GLOBAL_OFFSET_TABLE_ as a GOT access.
17
21bb3914
ST
182010-02-12 Sriraman Tallam <tmsriram@google.com>
19
20 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
21 (Scan::global_reloc_may_be_function_pointer): New function.
22 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
23 (Scan::global_reloc_may_be_function_pointer): New function.
24 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
25 (Scan::global_reloc_may_be_function_pointer): New function.
26 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
27 (Scan::global_reloc_may_be_function_pointer): New function.
28 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
29 (Scan::global_reloc_may_be_function_pointer): New function.
30 (Scan::possible_function_pointer_reloc): New function.
31 (Target_x86_64::can_check_for_function_pointers): New function.
32 * gc.h (gc_process_relocs): Scan relocation types to determine if
33 function pointers were taken for targets that support it.
34 * icf.cc (Icf::find_identical_sections): Include functions for
35 folding in safe ICF whose pointer is not taken.
36 * icf.h (Secn_fptr_taken_set): New typedef.
37 (fptr_section_id_): New member.
38 (section_has_function_pointers): New function.
39 (set_section_has_function_pointers): New function.
40 (check_section_for_function_pointers): New function.
41 * options.h: Fix comment for safe ICF option.
42 * target.h (can_check_for_function_pointers): New function.
43 * testsuite/Makefile.am: Add icf_safe_so_test test case.
44 Modify icf_safe_test for X86-64.
45 * testsuite/Makefile.in: Regenerate.
46 * testsuite/icf_safe_so_test.cc: New file.
47 * testsuite/icf_safe_so_test.sh: New file.
48 * testsuite/icf_safe_test.cc (kept_func_3): New function.
49 (main): Change to take pointer to function kept_func_3.
50 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
51 folding is done correctly for X86-64.
52
0da6fa6c
DM
532010-02-12 David S. Miller <davem@davemloft.net>
54
55 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
56 is_symbolless parameter.
57 (Output_reloc<SHT_REL>::is_symbolless): New.
58 (Output_reloc<SHT_REL>::is_symbolless_): New.
59 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
60 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
61 (Output_reloc<SHT_RELA>::is_symbolless): New.
62 (Output_data_reloc::add_global): Handle is_symbolless.
63 (Output_data_reloc::add_global_relative): Likewise.
64 (Output_data_reloc::add_local): Likewise.
65 (Output_data_reloc::add_local_relative): Likewise.
66 (Output_data_reloc::add_symbolless_global_addend): New.
67 (Output_data_reloc::add_symbolless_local_addend): New.
68 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
69 is_symbolless.
70 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
71 instead of ->is_relative_
72 (Output_reloc::write): Likewise.
73 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
74 (Output_reloc::write_rel): Simplify.
75
76 * sparc.cc (Target_sparc::Scan::local): Use
77 ->add_symbolless_local_addend as needed.
78 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
79 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
80 based upon relocation offset.
81
e4782e83
DK
822010-02-11 Doug Kwan <dougkwan@google.com>
83
84 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
85 (Target_arm::Scan::global): Ditto. Also remove a comment before the
86 beginning of function.
87 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
88 and MOVT_ABS relocations. Those are non issued in scanning. Fix
89 parameter is_32bit in calls to should_apply_static_reloc.
90 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
91 (check_DATA): Add arm_abs_global.stdout.
92 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
93 arm_abs_global.stdout): New rules.
94 (MOSTLLYCLEANFILES): Add arm_abs_global
95 * Makefile.in: Regenerate.
96 * testsuite/arm_abs_global.s: New file.
97 * testsuite/arm_abs_global.sh: Ditto.
98 * testsuite/arm_abs_lib.s: Ditto.
99
93ceb764
ILT
1002010-02-11 Ian Lance Taylor <iant@google.com>
101
102 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
103 Read_relocs task.
104 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
105 Allocate_commons_task first.
106 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
107 task, rather than symtab_lock_.
108 (Gc_process_relocs::~Gc_process_relocs): New function.
109 (Gc_process_relocs::is_runnable): Check this_blocker_.
110 (Gc_process_relocs::locks): Use next_blocker_ rather than
111 blocker_.
112 (Scan_relocs::~Scan_relocs): New function.
113 (Scan_relocs::is_runnable): Check this_blocker_ rather than
114 symtab_lock_.
115 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
116 next_blocker_.
117 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
118 fields. Add this_blocker_ and next_blocker_ fields. Adjust
119 constructor accordingly.
120 (class Gc_process_relocs): Likewise.
121 (class Scan_relocs): Likewise.
122 * common.h (class Allocate_commons_task): Remove symtab_lock_
123 field, and corresponding constructor parameter.
124 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
125 symtab_lock_.
126 (Allocate_commons_task::locks): Likewise.
127
114dfbe1
ILT
1282010-02-11 Ian Lance Taylor <iant@google.com>
129
130 * gold-threads.h (class Once): Define.
131 (class Initialize_lock): Rewrite as child of Once.
132 * gold-threads.cc (class Once_initialize): Define.
133 (once_pointer_control): New static variable.
134 (once_pointer, once_arg): New static variables.
135 (c_run_once): New static function.
136 (Once::Once, Once::run_once, Once::internal_run): New functions.
137 (class Initialize_lock_once): Remove.
138 (initialize_lock_control): Remove.
139 (initialize_lock_pointer): Remove.
140 (initialize_lock_once): Remove.
141 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
142 (Initialize_lock::initialize): Rewrite.
143 (Initialize_lock::do_run_once): New function.
144 * archive.cc (Archive::interpret_header): Only clear name if it is
145 not already empty.
146 * fileread.cc: Include "gold-threads.h"
147 (file_counts_lock): New static variable.
148 (file_counts_initialize_lock): Likewise.
149 (File_read::release): Only increment counts when using --stats.
150 Use a lock around the increment.
151 * parameters.cc (class Set_parameters_target_once): Define.
152 (set_parameters_target_once): New static variable.
153 (Parameters::Parameters): Move here from parameters.h.
154 (Parameters::set_target): Rewrite.
155 (Parameters::set_target_once): New function.
156 (Parameters::clear_target): Move here and rewrite.
157 * parameters.h (class Parameters): Update declarations. Add
158 set_parameters_target_once_ field.
159 (Parameters::Parameters): Move to parameters.cc.
160 (Parameters::clear_target): Likewise.
161 * readsyms.cc (Read_symbols::do_group): Create a Start_group
162 task.
163 (Start_group::~Start_group): New function.
164 (Start_group::is_runnable): New function.
165 (Start_group::locks, Start_group::run): New functions.
166 (Finish_group::run): Change saw_undefined to size_t.
167 * readsyms.h (class Start_group): Define.
168 (class Finish_group): Change saw_undefined_ field to size_t.
169 (Finish_group::Finish_group): Remove saw_undefined and
170 this_blocker parameters. Change all callers.
171 (Finish_group::set_saw_undefined): New function.
172 (Finish_group::set_blocker): New function.
173 * symtab.h (class Symbol_table): Change saw_undefined to return
174 size_t. Change saw_undefined_ field to size_t.
175 * target-select.cc (Set_target_once::do_run_once): New function.
176 (Target_selector::Target_selector): Initialize set_target_once_
177 field. Don't initialize lock_ and initialize_lock_ fields.
178 (Target_selector::instantiate_target): Rewrite.
179 (Target_selector::set_target): New function.
180 * target-select.h (class Set_target_once): Define.
181 (class Target_selector): Update declarations. Make
182 Set_target_once a friend. Remove lock_ and initialize_lock_
183 fields. Add set_target_once_ field.
184
fa17a3f4
ILT
1852010-02-10 Ian Lance Taylor <iant@google.com>
186
187 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
188 queueing any tasks.
189 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
190 (queue_middle_tasks): Add all blockers before queueing any tasks.
191 (queue_final_tasks): Likewise.
192 * token.h (Task_token::add_blockers): New function.
193 * object.h (Input_objects::number_of_relobjs): New function.
194
c7177d31
ILT
1952010-02-10 Ian Lance Taylor <iant@google.com>
196
5de0e392
ILT
197 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
198 shared, not if not position independent.
199 * x86_64.cc (Relocate::relocate_tls): Likewise.
200 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
201 (tls_pie_pic_test): New target.
202 * testsuite/Makefile.in: Rebuild.
203
c7177d31
ILT
204 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
205 (tls_test_main_pie.o, tls_test_pie.o): New targets.
206 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
207 * testsuite/Makefile.in: Rebuild.
208
684b268a
DM
2092010-02-09 David S. Miller <davem@davemloft.net>
210
211 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
212 R_SPARC_RELATIVE using ->add_local_relative().
213 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
214
612a8d3d
DM
215 * output.h (Output_data_dynamic::add_section_size): New method
216 that takes two Output_data objects.
217 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
218 entry param. Handle it in initializers.
219 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
220 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
221 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
222 arg.
223 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
224 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
225 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
226 for dynrel_includes_plt.
227 * i386.cc (Target_i386::do_finalize_sections): Likewise.
228 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
229 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
230 before .rela.plt
231 (Target_sparc::do_finalize_sections): Update to pass true for
232 dynrel_includes_plt.
233 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
234 output before .rela.plt
235 (Target_powerpc::do_finalize_sections): Update to pass true for
236 dynrel_includes_plt when 32-bit.
237
cb1be87e
DK
2382010-02-08 Doug Kwan <dougkwan@google.com>
239
240 * arm.cc (Arm_relobj::simple_input_section_output_address): New
241 method.
242 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
243 Arm_relobj::scan_section_for_cortex_a8_stubs,
244 Arm_relobj::do_relocation_section): Instead of calling
245 Output_section::output_address, use faster
246 Arm_relobj::simple_input_section_output_address.
247
705b5121
DM
2482010-02-08 David S. Miller <davem@davemloft.net>
249
250 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
251 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
252 relocation helper function.
253
024c4466
DM
254 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
255 just like R_SPARC_GOT{10,13,22}.
256 (Target_sparc::Scan::local): Likewise.
257 (Target_sparc::Relocate:relocate): Likewise.
258
9109c078
ILT
2592010-02-06 Ian Lance Taylor <iant@google.com>
260
261 * configure.ac: Rewrite targetobjs duplicate removal code to use
262 only shell constructs.
263 * configure: Rebuild.
264
cf846138
DK
2652010-02-05 Doug Kwan <dougkwan@google.com>
266
267 PR 11247
268 * arm.cc (Arm_relobj::section_is_scannable): New method.
269 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
270 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
271
6cfaf60b
DK
2722010-02-04 Doug Kwan <dougkwan@google.com>
273
274 PR 11247
275 * arm-reloc-property.cc (cstdio): Include.
276 * configure.ac (targetobjs): Remove duplicates.
277 * configure: Regenerate.
278 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
279 big and little endian version for a given address size.
280
5c57f1be
DK
2812010-02-03 Doug Kwan <dougkwan@google.com>
282
283 * arm-reloc-property.cc
284 (Arm_reloc_property_table::reloc_name_in_error_message): New method
285 definition.
286 * arm-reloc-property.h
287 (Arm_reloc_property_table::get_implemented_static_reloc_property):
288 New method definition.
289 (Arm_reloc_property_table::reloc_name_in_error_message): New method
290 declaration.
291 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
292 overflow to N.
293 (GOT_PREL): Change implemented to Y.
294 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
295 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
296 (Arm_relocate_functions::movw_abs_nc): Remove method.
297 (Arm_relocate_functions::movt_abs): Ditto.
298 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
299 (Arm_relocate_functions::thm_movt_abs): Ditto.
300 (Arm_relocate_functions::movw_rel_nc): Ditto.
301 (Arm_relocate_functions::movw_rel): Ditto.
302 (Arm_relocate_functions::movt_rel): Ditto.
303 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
304 (Arm_relocate_functions:thm_movw_rel): Ditto.
305 (Arm_relocate_functions:thm_movt_rel): Ditto.
306 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
307 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
308 New method definitions.
309 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
310 (Arm_relocation_functions::arm_grp_ldr): Ditto.
311 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
312 (Arm_relocation_functions::arm_grp_ldc): Ditto.
313 (Target_arm::Relocate::relocate): Check for non-static or
314 unimplemented relocation code and exit early. Change calls to
315 Target_arm::reloc_uses_thumb_bit and
316 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
317 instead. Refactor code to handle similar relocations to increase
318 code sharing. Remove check for unsupported relocation code in switch
319 statement.
320 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
321 relocation property table to find out size. Change error message to
322 print out the name of a relocation code instead of the numeric value.
323 (Target_arm::scan_reloc_for_stub): Use relocation property table
324 instead of calling Target_arm::reloc_uses_thumb_bit().
325
218c5831
DK
3262010-02-02 Doug Kwan <dougkwan@google.com>
327
328 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
329 types of relaxed input section.
330
0d31c79d
DK
3312010-02-02 Doug Kwan <dougkwan@google.com>
332
333 * Makefile.am (HFILES): Add arm-reloc-property.h.
334 (DEFFILES): New.
335 (TARGETSOURCES): Add arm-reloc-property.cc
336 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
337 (libgold_a_SOURCES): $(DEFFILES)
338 * Makefile.in: Regenerate.
339 * arm-reloc-property.cc: New file.
340 * arm-reloc-property.h: New file.
341 * arm-reloc.def: New file.
342 * arm.cc: Update comments.
343 (arm-reloc-property.h): New included header.
344 (arm_reloc_property_table): New global variable.
345 (Target_arm::do_select_as_default_target): New method definition.
346 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
347 arm-reloc-property to targ_extra_obj.
348 * parameters.cc (set_parameters_target): Call
349 Target::select_as_default_target().
350 * target.h (Target::select_as_default_target): New method definition.
351 (Target::do_select_as_default_target): Same.
352
546c7457
DK
3532010-02-01 Doug Kwan <dougkwan@google.com>
354
355 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
356 first_output_text_section_.
357 (Arm_exidx_fixup::first_output_text_section): New method definition.
358 (Arm_exidx_fixup::first_output_text_section_): New data member.
359 (Arm_exidx_fixup::process_exidx_section): Record the first text
360 output section seen.
361 (Arm_output_section::fix_exidx_coverage): Set correct linked section
362 and entsize in output section header.
363
11b861d5
DK
3642010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
365
366 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
367 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
368 (Arm_relocate_functions::thm_alu11): New Method.
369 (Arm_relocate_functions::thm_pc8): New Method.
370 (Arm_relocate_functions::thm_pc12): New Method.
371 (Target_arm::Scan::local): Handle the relocations.
372 (Target_arm::Scan::global): Likewise.
373 (Target_arm::Relocate::relocate): Likewise.
374 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
375
c9a2c125
DK
3762010-01-29 Doug Kwan <dougkwan@google.com>
377
378 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
379 of relocation types as ld.
380
1521477a
DK
3812010-01-29 Doug Kwan <dougkwan@google.com>
382
383 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
384 to public.
385 (Arm_relocate_functions::thumb_branch_common): Ditto.
386 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
387 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
388 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
389 Arm_relocate_functions::jump24): Remove.
390 (Target_arm::Relocate::relocate): Adjust code to call
391 Arm_relocation_functions::arm_branch_common and
392 Arm_relocation_functions::thumb_branch_common instead of their removed
393 wrappers. Merge switch-cases together to reduce source code size.
394
e7eca48c
DK
3952010-01-29 Doug Kwan <dougkwan@google.com>
396
397 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
398 output_local_symbol_count_needs_update_.
399 (Arm_relobj::output_local_symbol_count_needs_update,
400 Arm_relobj::set_output_local_symbol_count_needs_update,
401 Arm_relobj::update_output_local_symbol_count): New methods.
402 (Arm_relobj::output_local_symbol_count_needs_update_): New data
403 member.
404 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
405 of pointed function as in a R_ARM_PREL31 relocation.
406 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
407 for output local symbol count updating.
408 (Target_arm::do_relax): Update output local symbol counts in objects
409 if necessary.
410 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
411
02961d7e
ILT
4122010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
413
414 * arm.cc: Added support for the ARM relocations:
415 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
416 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
417 (Arm_relocate_functions::movw_rel_nc): Renamed (was
418 movw_prel_nc).
419 (Arm_relocate_functions::movw_rel): New method.
420 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
421 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
422 thm_movw_prel_nc).
423 (Arm_relocate_functions::thm_movw_rel): New method.
424 (Arm_relocate_functions::thm_movt_rel): Renamed (was
425 thm_movt_prel).
426 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
427 relocations.
428 (Target_arm::Scan::global): Likewise.
429 (Target_arm::Relocate::relocate): Likewise.
430 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
431 Likewise.
432
b10d2873
ILT
4332010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
434
435 * arm.cc: Added support for ARM group relocations.
436 (Target_arm::reloc_needs_sym_origin): New method.
437 (Arm_relocate_functions::calc_grp_kn): New method.
438 (Arm_relocate_functions::calc_grp_residual): New method.
439 (Arm_relocate_functions::calc_grp_gn): New method.
440 (Arm_relocate_functions::arm_grp_alu): New Method.
441 (Arm_relocate_functions::arm_grp_ldr): New Method.
442 (Arm_relocate_functions::arm_grp_ldrs): New Method.
443 (Arm_relocate_functions::arm_grp_ldc): New Method.
444 (Target_arm::Scan::local): Handle the ARM group relocations.
445 (Target_arm::Scan::global): Likewise.
446 (Target_arm::Relocate::relocate): Likewise.
447 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
448 Likewise.
449
2b328d4e
DK
4502010-01-26 Doug Kwan <dougkwan@google.com>
451
452 * arm.cc (set): Include.
453 (class Arm_exidx_fixup): Change type of last_input_section_ to const
454 pointer type.
455 (Arm_output_section::Text_section_list): New type.
456 (Arm_output_section::append_text_sections_to_list): New method.
457 (Arm_output_section::fix_exidx_coverage): Ditto.
458 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
459 (Arm_relobj::convert_input_section_to_relaxed_section): Use
460 Relobj::set_section_offset() instead of
461 Sized_relobj::invalidate_section_offset().
462 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
463 parameter for section headers. Ignore relocation sections for
464 unallocated sections and EXIDX sections.
465 (Target_arm::fix_exidx_coverage): New method.
466 (Target_arm::output_section_address_less_than): New type.
467 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
468 linked text section instead of the EXIDX section.
469 (Arm_output_section::create_stub_group): Add an assertion to check
470 that this is not an EXIDX output section.
471 (Arm_output_section::append_text_sections_to_list): New method.
472 (Arm_output_section::fix_exidx_coverage): Ditto.
473 (Arm_relobj::scan_sections_for_stubs): Adjust call to
474 Arm_relobj::section_needs_reloc_stub_scanning.
475 (Target_arm::do_relax): Fix EXIDX output section coverage in the
476 first pass.
477 (Target_arm::fix_exidx_coverage): New method.
478 * object.h (Relobj::set_output_section): New method.
479 (Sized_relobj::invalidate_section_offset): Remove method.
480 (Sized_relobj::do_invalidate_section_offset): Remove method.
481 (Sized_relobj::do_set_section_offset): Handle offset value -1.
482
c7f3c371
DK
4832010-01-25 Doug Kwan <dougkwan@google.com>
484
485 * arm.cc (Arm_exidx_merged_section::do_output_offset):
486 Fix warning due to signed and unsigned comparison on a 32-bit host.
487
8923b24c
DK
4882010-01-22 Doug Kwan <dougkwan@google.com>
489
490 * arm.cc (Target_arm::do_relax): Record an output section for section
491 offset adjustment it contains any stub table that has changed.
492 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
493 offsets in an output section if necessary.
494 * output.cc (Output_section::Output_section): Initialize
495 section_offsets_need_adjustments_.
496 (Output_section::add_input_section_for_script): Renamed to
497 Output_section::add_simple_input_section.
498 (Output_section::save_states): Add a comment.
499 (Output_section::discard_states): New method defintion.
500 (Output_section::adjust_section_offsets): Same.
501 * output.h (Output_section::add_input_section_for_script): Renamed to
502 Output_section::add_simple_input_section.
503 (Output_section::discard_states): New method declaration.
504 (Output_section::adjust_section_offsets): Same.
505 (Output_section::section_offsets_need_adjustment,
506 Output_section::set_section_offsets_need_adjustment): New method
507 definitions.
508 (Output_section::section_offsets_need_adjustment_): New data member.
509 * script-sections.cc
510 (Output_section_element_input::set_section_address): Adjust code for
511 renaming of Output_section::add_input_section_for_script.
512 (Orphan_output_section::set_section_address): Same.
513
9b2fd367
DK
5142010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
515
516 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
517 Fix_v4bx enum values .
518 * gold/options.h (General_options): New option definitions.
519 (General_options::fix_v4bx): New method.
520 (General_options::Fix_v4bx): New enum.
521 * gold/options.cc (General_options::parse_fix_v4bx): New method.
522 (General_options::parse_fix_v4bx_interworking): New method.
523
80d0d023
DK
5242010-01-22 Doug Kwan <dougkwan@google.com>
525
526 * arm.cc (Arm_exidx_fixup): New class.
527
af2cdeae
DK
5282010-01-21 Doug Kwan <dougkwan@google.com>
529
530 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
531 classes.
532 (Arm_exidx_section_offset_map): New type.
533
993d07c1
DK
5342010-01-21 Doug Kwan <dougkwan@google.com>
535
536 * arm.cc (Arm_exidx_input_section): New class.
537 (Arm_relobj::exidx_input_section_by_link,
538 Arm_relobj::exidx_input_section_by_shndx,
539 Arm_relobj::make_exidx_input_section): New methods.
540 (read_arm_attributes_section): Remove.
541 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
542 information about them.
543 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
544 to here.
545
5ac169d4
DK
5462010-01-20 Doug Kwan <dougkwan@google.com>
547
548 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
549 Input_section_specifier to Section_id.
550 (Target_arm::new_arm_input_section: Adjust code for change of key
551 type.
552 (Target_arm::find_arm_input_section): Ditto.
553 * gc.h (object.h): Include for Section_id nand Section_id_hash.
554 (Section_id): Remove.
555 (Garbage_collection::Section_id_hash): Remove.
556 * icf.h (object.h): Include for Section_id nand Section_id_hash.
557 (Section_id): Remove.
558 (Icf::Section_id_hash): Remove.
559 * object.h (Section_id, Const_section_id, Section_id_hash,
560 Const_section_id_hash): New type definitions.
561 * output.cc (Output_section::add_relaxed_input_section): Change to
562 use Const_section_id instead of Input_section_specifier as key type.
563 (Output_section::add_merge_input_section): Ditto.
564 (Output_section::build_relaxation_map): Change to use Section_id
565 instead of Input_section_specifier as key type.
566 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
567 Ditto.
568 (Output_section::convert_input_sections_to_relaxed_sections): Change
569 to use Const_section_id instead of Input_section_specifier as key type.
570 (Output_section::find_merge_section): Ditto.
571 (Output_section::find_relaxed_input_section): Ditto.
572 * output.h (Input_section_specifier): Remove class.
573 (Output_section::Output_section_data_by_input_section_map): Change
574 key type to Const_section_id.
575 (Output_section::Output_relaxed_input_section_by_input_section_map):
576 Ditto.
577 (Output_section::Relaxation_map): Change key type to Section_id.
578
a2162063
ILT
5792010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
580
581 * gold/arm.cc: Added support for R_ARM_V4BX relocation
582 (class Arm_v4bx_stub): New class.
583 (DEF_STUBS): Updated definition to support v4_veneer_bx.
584 (Stub_factory::make_arm_v4bx_stub): New method.
585 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
586 (Stub_table::empty): Handle v4bx stubs.
587 (Stub_table::add_arm_v4bx_stub): New method.
588 (Stub_table::find_arm_v4bx_stub): New method.
589 (Arm_relocate_functions::v4bx): New method.
590 (Target_arm::fix_v4bx): New method.
591 (Target_arm::Target_arm): Handle R_ARM_V4BX.
592 (Stub_table::relocate_stubs): Likewise.
593 (Stub_table::do_write): Likewise.
594 (Stub_table::update_data_size_and_addralign): Likewise.
595 (Stub_table::finalize_stubs): Likewise.
596 (Target_arm::Scan::local): Likewise.
597 (Target_arm::Scan::global): Likewise.
598 (Target_arm::do_finalize_sections): Likewise.
599 (Target_arm::Relocate::relocate): Likewise.
600 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
601 Likewise.
602 (Target_arm::scan_reloc_for_stub): Likewise.
603 (Target_arm::scan_reloc_section_for_stubs): Likewise.
604
5696ab0b
ILT
6052010-01-19 Ian Lance Taylor <iant@google.com>
606
607 * output.cc (Output_section_headers::do_sized_write): Write large
608 segment count to sh_info field.
609 (Output_file_header::do_sized_write): For large segment count,
610 write PN_XNUM to e_phnum field.
611
800d0f56
ILT
6122010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
613
614 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
615 (Arm_relocate_functions::thm_jump8): New function.
616 (Arm_relocate_functions::thm_jump11): New function.
617 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
618 R_ARM_THM_JUMP11.
619 (Target_arm::Scan::global): Likewise.
620 (Target_arm::Relocate::relocate): Likewise.
621 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
622 Likewise.
623
41263c05
DK
6242010-01-14 Doug Kwan <dougkwan@google.com>
625
626 * arm.cc (map, utility): Include headers.
627 (Target_arm::apply_cortex_a8_workaround): New method.
628 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
629 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
630 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
631 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
632 the --[no-]fix-cortex-a8 command line options.
633 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
634 (Target_arm::relocate_stub): Use addend in instruction template.
635 * options.h (DEFINE_bool): Set the user-set flag.
636 (General_options): Add --[no-]-fix-cortex options.
637 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
638 : Update fast look-up map after conversion.
639
459e9b03
ST
6402010-01-14 Sriraman Tallam <tmsriram@google.com>
641
642 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
643 in the first pass of do_layout.
644
b521dfe4
DK
6452010-01-13 Doug Kwan <dougkwan@google.com>
646
647 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
648 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
649 apparent compiler problem of not folding static constant integral
650 data members of elfcpp::Elf_sizes<32>.
651
44272192
DK
6522010-01-13 Doug Kwan <dougkwan@google.com>
653
654 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
655 Arm_relobj::section_needs_cortex_a8_stub_scanning,
656 Arm_relobj::scan_section_for_cortex_a8_erratum,
657 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
658 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
659 sections to scan for relocation stubs into a new method
660 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
661 relocation and Cortex-A8 stub scanning.
662 (Target_arm::do_relax): Force stubs to be after stubbed sections
663 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
664 the beginning of a new relaxation pass. Update a comment.
665 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
666
44b71ece
ILT
6672010-01-12 Ian Lance Taylor <iant@google.com>
668
669 * target-reloc.h (visibility_error): New inline function.
670 (relocate_section): Call visibility_error.
671 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
672 (MOSTLYCLEANFILES): Likewise.
673 (protected_4_pic.o, protected_3.err): New targets.
674 * testsuite/protected_4.cc: New file.
675
a120bc7f
DK
6762010-01-12 Doug Kwan <dougkwan@google.com>
677
678 * arm.cc (Cortex_a8_reloc): New class.
679 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
680 and cortex_a8_relocs_info_.
681 (Target_arm::fix_cortex_a8): New method definition.
682 (Target_arm::Cortex_a8_relocs_info): New type.
683 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
684 New data member declarations.
685 (Target_arm::scan_reloc_for_stub): Record information about
686 relocations for THUMB branches that might be exempted from the
687 Cortex-A8 workaround.
688 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
689 at the beginning of a relaxation pass.
690
20138696
DK
6912010-01-12 Doug Kwan <dougkwan@google.com>
692
693 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
694 (Arm_relobj::Mapping_symbol_position,
695 Arm_reloj::Mapping_symbol_position_less,
696 Arm_relobj::Mapping_symbols_info): New types.
697 (Target_arm::is_mapping_symbol_name): New method definition.
698 (Arm_relobj::do_count_local_symbols): Save information about mapping
699 symbols.
700
089d69dc
DK
7012010-01-11 Doug Kwan <dougkwan@google.com>
702
703 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
704 Arm_relocate_functions::thumb32_branch_upper,
705 Arm_relocate_functions::thumb32_branch_lower,
706 Arm_relocate_functions::thumb32_cond_branch_offset,
707 Arm_relocate_functions::thumb32_cond_branch_upper,
708 Arm_relocate_functions::thumb32_cond_branch_lower,
709 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
710 branch offset encoding.
711 (Arm_relocate_functions::thumb_branch_common): Use new branch
712 offset encoding methods to avoid code duplication.
713 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
714 (Stub_addend_reader::operator()): Use new branch encoding method
715 to avoid code duplication.
716
99e5bff2
DK
7172010-01-11 Doug Kwan <dougkwan@google.com>
718
719 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
720 (Target_arm::do_finalize_sections): Define special EXIDX section
721 symbols only if referenced.
722 * gc.h (Garbage_collection::add_reference): New method.
723 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
724 code duplication.
725
98e090bd
ILT
7262010-01-11 Ian Lance Taylor <iant@google.com>
727
d0a91bd8
ILT
728 * script.cc (Version_script_info::build_expression_list_lookup):
729 Change complaing about duplicate wildcard match from error to
730 warning.
731
98e090bd
ILT
732 * script.cc (class Lazy_demangler): Recreate--revert part of patch
733 of 2009-12-30.
734 (Version_script_info::Version_script_info): Initialize globs_,
735 default_version_, default_is_global_, and exact_. Don't
736 initialize globals_ or locals_.
737 (Version_script_info::build_lookup_tables): Build local symbols
738 first.
739 (Version_script_info::unquote): New function.
740 (Version_script_info::add_exact_match): New function.
741 (Version_script_info::build_expression_list_lookup): Remove lookup
742 parameter. Add is_global parameter. Change all callers. Handle
743 wildcard pattern specially. Unquote pattern. Call
744 add_exact_match.
745 (Version_script_info::get_name_to_match): New function.
746 (Version_script_info::get_symbol_version): New function.
747 (Version_script_info::get_symbol_version_helper): Remove.
748 (Version_script_info::check_unmatched_names): Call unquote.
749 * script.h (class Version_script_info): Change get_symbol_version
750 to be non-inline and add is_global parameter; change all callers.
751 Rewrite symbol_is_local. Update declarations. Define struct
752 Version_tree_match, Exact, Globs. Don't define struct Lookup.
753 Remove globals_ and locals_ members. Add exact_, globs_,
754 default_version_, is_global_.
755 (Version_script_info::Glob): Remove pattern, add expression and
756 is_global. Update constructor. Change all callers.
757 * dynobj.cc (Versions::finalize): Mark the version symbol as the
758 default version.
759 (Versions::symbol_section_contents): If a symbol is undefined, or
760 defined in a dynamic object, set the version index to
761 VER_NDX_LOCAL.
762 * symtab.cc (Symbol_table::add_from_relobj): Don't call
763 symbol_is_local.
764 (Symbol_table::add_from_pluginobj): Likewise.
765 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
766
d56962d3
DK
7672010-01-11 Doug Kwan <dougkwan@google.com>
768
769 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
770 (incremental_dump_LDADD): Add linking option for libintl.
771 * Makefile.in: Regenerate.
772
94e6ee91
L
7732010-01-11 H.J. Lu <hongjiu.lu@intel.com>
774
775 PR gold/11144
776 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
777 instead of -Ds.
778 * testsuite/Makefile.in: Regenerated.
779
e96c574b
DK
7802010-01-10 Doug Kwan <dougkwan@google.com>
781
782 * options.h (DEFINE_var): Use parentheses around argument varname__
783 in macro body to avoid any unintended subsequent substitutions.
784
7198066b
ILT
7852010-01-10 Ian Lance Taylor <iant@google.com>
786
ba4d53bf
ILT
787 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
788 candidates before doing symbol resolution.
789
7198066b
ILT
790 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
791 ODR candidates if only one is weak.
792
a2beed37
ILT
7932010-01-08 Ian Lance Taylor <iant@google.com>
794
795 * script.cc (Version_script_info::build_expression_list_lookup):
796 Don't warn about ambiguous version, just record the ambiguity.
797 (Version_script_info::get_symbol_version_helper): Give error if
798 version is ambiguous.
799
2fb7225c
DK
8002010-01-08 Doug Kwan <dougkwan@google.com>
801
802 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
803 prev_data_size_ and prev_addralign_. Remove initializer for
804 deleted data member has_been_changed_.
805 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
806 to determine if the table is empty.
807 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
808 Remove.
809 (Stub_table::add_reloc_stub): Define method in class definition
810 instead of just declaring it there.
811 (Stub_table::add_cortex_a8_stub): New method definition.
812 (Stub_table::update_data_size_and_addralign): Ditto.
813 (Stub_table::finalize_stubs): Ditto.
814 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
815 (Stub_table::do_addralign_): Return address alignment in the
816 (Stub_table::do_reset_address_and_file_offset): Define method in
817 class definition instead of declaring it there. Set current data
818 size to be the data size of the previous pass.
819 (Stub_table::set_final_data_size): Use current data size as the
820 final data size.
821 (Stub_table::relocate_stub): Change parameter type of stub from
822 Reloc_stub pointer to Stub pointer.
823 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
824 (Stub_table::Cortex_a8_stub_list): New typedef.
825 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
826 Stub_table::prev_addralign_): New data member.
827 (Arm_relobj::Arm_relobj): Initialize data member
828 section_has_cortex_a8_workaround_.
829 (Arm_relobj::section_has_cortex_a8_workaround,
830 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
831 definitions.
832 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
833 declarations.
834 (Target_arm::relocate_stub): Change parameter type of stub from
835 Reloc_stub pointer to Stub pointer.
836 (Insn_template::size, Insn_template::alignment): Handle
837 THUMB16_SPECIAL_TYPE.
838 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
839 Stub_table::update_data_size_and_addralign,
840 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
841 definitions.
842 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
843 (Stub_table::do_write): Ditto.
844 (Target_arm::do_relax): Adjust code for changes in Stub_table.
845
880cd20d
ILT
8462010-01-08 Ian Lance Taylor <iant@google.com>
847
848 PR 11108
849 * symtab.h (class Symbol): Remove fields is_target_special_ and
850 has_plt_offset_. Add field is_defined_in_discarded_section_.
851 (Symbol::is_defined_in_discarded_section): New function.
852 (Symbol::set_is_defined_in_discarded_section): New function.
853 (Symbol::has_plt_offset): Rewrite.
854 (Symbol::set_plt_offset): Verify that new offset is not -1U.
855 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
856 Don't initialize is_target_special_ or has_plt_offset_.
857 Initialize is_defined_in_discarded_section_.
858 (Symbol_table::add_from_relobj): If appropriate, set
859 is_defined_in_discarded_section.
860 * resolve.cc (Symbol::override_base_with_special): Don't test
861 is_target_special_. Change has_plt_offset_ to has_plt_offset().
862 * target-reloc.h (relocate_section): Do special handling for
863 symbols defined in discarded sections for global symbols as well
864 as local symbols.
865
2703e3eb
ILT
8662010-01-08 Ian Lance Taylor <iant@google.com>
867
868 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
869 the SHT_SYMTAB case.
870
339d40a3
ILT
8712010-01-08 Ian Lance Taylor <iant@google.com>
872
873 * object.cc (Sized_relobj::do_layout): Don't get confused if
874 layout_eh_frame returns NULL.
875
abecea76
ILT
8762010-01-08 Ian Lance Taylor <iant@google.com>
877
878 PR 11084
879 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
880 dynamic symbol table, use the normal symbol table.
881 (Sized_dynobj::do_read_symbols): Remove assertion about type of
882 symbol table.
883
6b7dd3f3
ILT
8842010-01-08 Ian Lance Taylor <iant@google.com>
885
886 PR 11072
887 * layout.cc (Layout::include_section): Remove .gnu_debuglink
888 sections.
889
36c50e63
L
8902010-01-08 H.J. Lu <hongjiu.lu@intel.com>
891
892 * version.cc (print_version): Change to "Copyright 2010".
893
e291e7b9
ILT
8942010-01-08 Ian Lance Taylor <iant@google.com>
895
896 PR 10287
897 PR 11063
898 * i386.cc (class Target_i386): Change return type of plt_section
899 to be non-const.
900 (class Output_data_plt_i386): Add tls_desc_rel_ field.
901 (Output_data_plt_i386::Output_data_plt_i386): Initialize
902 tls_desc_rel_ field.
903 (Output_data_plt_i386::rel_tls_desc): New function.
904 (Target_i386::rel_tls_desc_section): New function.
905 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
906 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
907 R_386_TLS_DESC reloc in rel_tls_desc_section.
908 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
909 Define struct Tlsdesc_info.
910 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
911 (Target_x86_64::do_reloc_symbol_index): New function.
912 (Target_x86_64::add_tlsdesc_info): New function.
913 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
914 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
915 tlsdesc_rel_ field.
916 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
917 all callers.
918 (Output_data_plt_x86_64::rela_tlsdesc): New function.
919 (Target_x86_64::rela_tlsdesc_section): New function.
920 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
921 handling.
922 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
923 (Target_x86_64::do_reloc_addend): New function.
924 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
925 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
926 declarations. Define TARGET_CODE. Add arg field to u1_ union.
927 (Output_reloc::type): New function.
928 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
929 (Output_reloc::is_target_specific): New function.
930 (Output_reloc::target_arg): New function.
931 (class Output_reloc) [SHT_RELA]: Add four new constructors for
932 absolute relocs and target specific relocs.
933 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
934 add_target_specific.
935 (class Output_data_reloc) [SHT_RELA]: Likewise.
936 * output.cc (Output_reloc::Output_reloc): Add four new versions
937 for absolute relocs and target specific relocs.
938 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
939 (Output_reloc::get_symbol_index): Likewise.
940 (Output_reloc::local_section_offset): Check that local_sym_index_
941 is not TARGET_CODE or 0.
942 (Output_reloc::symbol_value): Likewise.
943 (Output_reloc::write) [SHT_RELA]: Call target for target specific
944 reloc.
945 * target.h (class Target): Add reloc_symbol_index and reloc_addend
946 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
947 functions.
948 * layout.cc (add_target_dynamic_tags): Use output section for
949 DT_PLTRELSZ and DT_JMPREL.
950
3a44184e
ILT
9512010-01-07 Ian Lance Taylor <iant@google.com>
952
953 PR 11061
954 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
955 function.
956 (class Output_data_reloc_generic): Define.
957 (class Output_data_reloc_base): Change base class to
958 Output_data_reloc_generic. Change add() method to call
959 bump_relative_reloc_count for a relative reloc. Remove
960 sort_relocs_ field.
961 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
962 to sort_relocs().
963 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
964 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
965 appropriate.
966 * layout.h (class Layout): Update declaration.
967
ea715a34
ILT
9682010-01-07 Ian Lance Taylor <iant@google.com>
969
970 * output.h (class Output_data): Add const version of
971 output_section and do_output_section.
972 (class Output_section_data): Add const version of
973 do_output_section.
974 (class Output_section): Likewise.
975 * layout.cc (Layout::add_target_dynamic_tags): New function.
976 * layout.h (class Layout): Update declarations.
977 * arm.cc (Target_arm::do_finalize_sections): Use
978 add_target_dynamic_tags.
979 * i386.cc (Target_i386::do_finalize_sections): Likewise.
980 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
981 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
982 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
983
659948a4
ILT
9842010-01-07 Ian Lance Taylor <iant@google.com>
985
986 PR 11042
987 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
988 object as needed.
989
9d3b86f6
ILT
9902010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
991 Ian Lance Taylor <iant@google.com>
992
993 PR 11019
994 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
995 Xindex::read_symtab_xindex.
996
bb0d3eb0
DK
9972010-01-07 Doug Kwan <dougkwan@google.com>
998
999 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
1000 (Insn_template::thumb16_bcond_insn): New method declaration.
1001 (Insn_template): Fix spelling.
1002 (Stub::thumb16_special): New method declaration.
1003 (Stub::do_write): Define virtual method which was previously pure
1004 virtual.
1005 (Stub::do_thumb16_special): New method declaration.
1006 (Stub::do_fixed_endian_write): New template member.
1007 (Reloc_stub::do_write): Remove.
1008 (Reloc_stub::do_fixed_endian_write): Remove.
1009 (Cortex_a8_stub): New class definition.
1010 (Stub_factory::make_cortex_a8_stub): New method definition.
1011 (Stub_factory::Stub_factory): Add missing static storage class
1012 qualifier for elf32_arm_stub_a8_veneer_blx.
1013
ffeef7df
ILT
10142010-01-07 Ian Lance Taylor <iant@google.com>
1015
dc3f80fe
ILT
1016 PR 10980
1017 * options.h (class General_options): Add --warn-unresolved-symbols
1018 and --error-unresolved-symbols.
1019 * errors.cc (Errors::undefined_symbol): Implement
1020 --warn-unresolved-symbols.
1021
ffeef7df
ILT
1022 * options.h (class General_options): Add -z text and -z textoff.
1023 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
1024
f1ec9ded
ST
10252010-01-06 Sriraman Tallam <tmsriram@google.com>
1026
1027 * gc.h (Garbage_collection::Cident_section_map): New typedef.
1028 (Garbage_collection::cident_sections): New function.
1029 (Garbage_collection::add_cident_section): New function.
1030 (Garbage_collection::cident_sections_): New member.
1031 (gc_process_relocs): Add references to sections whose names are C
1032 identifiers.
1033 * gold.h (cident_section_start_prefix): New constant.
1034 (cident_section_stop_prefix): New constant.
1035 (is_cident): New function.
1036 * layout.cc (Layout::define_section_symbols): Replace string constants
1037 with the newly defined constants.
1038 * object.cc (Sized_relobj::do_layout): Track sections whose names are
1039 C identifiers.
1040 * testsuite/Makefile.am: Add gc_orphan_section_test.
1041 * testsuite/Makefile.in: Regenerate.
1042 * testsuite/gc_orphan_section_test.cc: New file.
1043 * testsuite/gc_orphan_section_test.sh: New file.
1044
6eda8c29
ILT
10452010-01-06 Ian Lance Taylor <iant@google.com>
1046
b9674e17
ILT
1047 PR 10980
1048 * options.h (class General_options): Add --warn-shared-textrel.
1049 * layout.cc (Layout::finish_dynamic_section): Implement
1050 --warn-shared-textrel.
1051
6eda8c29
ILT
1052 PR 10980
1053 * options.h (class General_options): Add --warn-multiple-gp.
1054
32dcd44e
ILT
10552010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1056
1057 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
1058 $(THREADSLIB) and $(LIBDL).
1059 * Makefile.in: Rebuild.
1060
a192ba05
ILT
10612010-01-06 Ian Lance Taylor <iant@google.com>
1062
1063 PR 10980
1064 * options.cc (General_options::parse_section_start): New function.
1065 (General_options::section_start): New function.
1066 (General_options::General_options): Initialize all members.
1067 * options.h: Include <map>
1068 (class General_options): Add --section-start. Add section_starts_
1069 member.
1070 * layout.cc (Layout::attach_allocated_section_to_segment): If
1071 --section-start was used, set the address of the segment. Remove
1072 local sort_sections.
1073 (Layout::relaxation_loop_body): If the address of the load segment
1074 has been set by --section-start, don't use it.
1075 * output.h (Output_segment::update_flags_for_output_section): New
1076 function.
1077 * output.cc (Output_segment::add_output_section): Call
1078 update_flags_for_output_section.
1079
dde3f402
ILT
10802010-01-05 Ian Lance Taylor <iant@google.com>
1081
62dfdd4d
ILT
1082 PR 10980
1083 * options.h (class General_options): Add --undefined-version.
1084 * script.cc (struct Version_expression): Add was_matched_by_symbol
1085 field.
1086 (Version_script_info::matched_symbol): New function.
1087 (Version_script_info::get_symbol_version_helper): Call
1088 matched_symbol.
1089 (Version_script_info::check_unmatched_names): New function.
1090 * script.h (class Version_script_info): Update declarations.
1091 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
1092
9c4ae156
ILT
1093 * options.h (class General_options): Use DEFINE_bool_alias for
1094 allow_multiple_definition.
1095 * resolve.cc (Symbol_table::should_override): Don't test
1096 allow_multiple_definition.
1097
dde3f402
ILT
1098 PR 10980
1099 * options.h (class General_options): Add --cref.
1100 * main.cc (main): Print cref table if --cref. Don't close mapfile
1101 until after printing cref table.
1102 * cref.cc: Include "symtab.h".
1103 (class Cref_inputs): Define Cref_table_compare and Cref_table.
1104 (Cref_table_compare::operator()): New function.
1105 (Cref_inputs::gather_cref): New function.
1106 (filecol): New static const.
1107 (Cref_inputs::print_cref): New function.
1108 (Cref::print_cref): New function.
1109 * cref.h: Include <cstdio>.
1110 (class Cref): Update declarations.
1111 * mapfile.h (Mapfile::file): New function.
1112 * object.h (class Object): Define Symbols. Declare virtual
1113 do_get_global_symbols.
1114 (Object::get_global_symbols): New function.
1115 * object.cc (Input_objects::add_object): Pass object to cref_ if
1116 --cref.
1117 (Input_objects::archive_start): Likewise.
1118 (Input_objects::archive_stop): Likewise.
1119 (Input_objects::print_cref): New function.
1120 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
1121 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
1122 --cref.
1123 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
1124 function.
1125 * plugin.h (class Sized_pluginobj): Update declarations.
1126
8781f709
ILT
11272010-01-05 Ian Lance Taylor <iant@google.com>
1128
1129 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
1130 to is_default_version. Rename insdef to insdefault.
1131 (Symbol_table::add_from_relobj): Rename def to is_default_version
1132 and local to is_forced_local.
1133 (Symbol_table::add_from_pluginobj): Likewise.
1134 (Symbol_table::add_from_dynobj): Likewise.
1135 (Symbol_table::define_special_symbol): Rename insdef to
1136 insdefault.
1137
fe35d28d
ILT
11382010-01-04 Ian Lance Taylor <iant@google.com>
1139
30bc8c46
ILT
1140 PR 10980
1141 * options.h (class General_options): Add
1142 --allow-multiple-definition and -z muldefs.
1143 * resolve.cc (Symbol_table::should_override): Don't warn about a
1144 multiple symbol definition if --allow-multiple-definition or -z
1145 muldefs.
1146
7eaea549
ILT
1147 PR 10980
1148 * options.h (class General_options): Add --add-needed and
1149 --copy-dt-needed-entries. Tweak --as-needed help entry.
1150 * object.cc (Input_objects::check_dynamic_dependencies): Give an
1151 error if --copy-dt-needed-entries aka --add-needed is used and
1152 would cause a change in behaviour.
1153
fe35d28d
ILT
1154 PR 10980
1155 * options.h (class General_options): Add -G as a short version of
1156 --shared. Add no-op options -assert, -g, and -i.
1157
55a2bb35
ST
11582010-01-04 Sriraman Tallam <tmsriram@google.com>
1159
1160 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
1161 check for .text or .gnu.linkonce.t sections.
1162 * icf.cc (Icf::find_identical_sections): Ditto.
1163 Change the detection for mangled function name within the section
1164 name.
1165 * icf.h (is_section_foldable_candidate): New function.
1166
719328e1
ILT
11672009-12-30 Ian Lance Taylor <iant@google.com>
1168
1169 PR 10980
1170 * options.h (class General_options): Permit two dashes with
1171 --retain-symbols-file.
1172
d7bb5745
ILT
11732009-12-30 Ian Lance Taylor <iant@google.com>
1174
403a15dd
ILT
1175 PR 10979
1176 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
1177 don't put the file header and segment headers in the text
1178 segment.
1179
eda294df
ILT
1180 PR 10979
1181 * common.cc (Sort_commons::operator()): Stabilize sort when both
1182 entries are NULL.
1183 (Symbol_table::do_allocate_commons_list): When allocating common
1184 symbols, skip a symbol which is no longer common.
1185 * symtab.h (Symbol::is_common): Test whether the symbol comes from
1186 an object before checking its type.
1187 * testsuite/common_test_2.c: New file.
1188 * testsuite/common_test_3.c: New file.
1189 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
1190 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
1191 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
1192 (common_test_2_pic.o, common_test_2.so): New targets.
1193 (common_test_3_pic.o, common_test_3.so): New targets.
1194 * testsuite/Makefile.in: Rebuild.
1195
d7bb5745
ILT
1196 PR 10979
1197 * script.cc (read_input_script): If we see a new SECTIONS clause,
1198 and we have added an input section, give an error.
1199 * layout.h (class Layout): Add have_added_input_section function.
1200 Add have_added_input_section_ field.
1201 * layout.cc (Layout::Layout): Initialize
1202 have_added_input_section_.
1203 (Layout::layout): Set have_added_input_section_.
1204 (Layout::layout_eh_frame): Likewise.
1205
fc59c572
ILT
12062009-12-30 Ian Lance Taylor <iant@google.com>
1207
1208 PR 10931
1209 * options.h (class General_options): Add --sort-common option.
1210 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
1211 * common.cc (Sort_common): Add sort_order parameter to
1212 constructor. Add sort_order_ field.
1213 (Sort_commons::operator): Check sort_order_.
1214 (Symbol_table::allocate_commons): Determine the sort order.
1215 (Symbol_table::do_allocate_commons): Add sort_order parameter.
1216 Change all callers.
1217 (Symbol_table::do_allocate_commons_list): Likewise.
1218
1c74fab0
ILT
12192009-12-30 Ian Lance Taylor <iant@google.com>
1220
1221 PR 10916
1222 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
1223 symbols from this object, don't change the visibility of an
1224 undefined symbol.
1225 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
1226
6affe781
ILT
12272009-12-30 Ian Lance Taylor <iant@google.com>
1228
1229 PR 10861
1230 * script.h (class Version_script_info): Define Language enum.
1231 Update declarations. Define Glob, Exact, and Lookup types. Add
1232 new fields globals_, locals_, and is_finalized_.
1233 * script.cc: Various formatting fixes.
1234 (class Parser_closure): Change language_stack_ from a vector of
1235 std::string to one of Version_script_info::Language. Adjust all
1236 uses accordingly.
1237 (class Lazy_demangler): Remove.
1238 (struct Version_expression): Change language from std::string to
1239 Version_script_info::Language.
1240 (Version_script_info::Version_script_info): New function.
1241 (Version_script_info::~Version_script_info): Don't call clear.
1242 (Version_script_info::finalize): New function.
1243 (Version_script_info::build_lookup_tables): New function.
1244 (Version_script_info::build_expression_list_lookup): New
1245 function.
1246 (Version_script_info::get_symbol_version_helper): Rewrite to use
1247 lookup tables.
1248 (Version_script_info::print_expression_list): Adjust to use
1249 Version_script_info::Language.
1250 (script_push_lex_into_version_mode): Check that the version script
1251 has not been finalized.
1252 (version_script_push_lang): Change language string to
1253 Version_script_info::Language.
1254 * options.cc (Command_line::version_script): New function.
1255 * options.h (class General_options): Add finalize_dynamic_list
1256 function. Change version_script from declaration to definition.
1257 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
1258 * testsuite/version_script.map: Remove duplicate def of foo.
1259 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
1260 version_script.map.
1261 * testsuite/Makefile.in: Rebuild.
1262
818bf354
ILT
12632009-12-30 Ian Lance Taylor <iant@google.com>
1264
1265 PR 10843
1266 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
1267 if the input symbol index is 0, make the output symbol index 0.
1268
ebcc8304
ILT
12692009-12-30 Ian Lance Taylor <iant@google.com>
1270
1271 PR 10670
1272 * options.h (class General_options): Add -x/--discard-all.
1273 * object.cc (Sized_relobj::do_count_local_symbols): Handle
1274 --discard-all. If the local symbol needs a dynamic entry, check
1275 that before handling --discard-locals.
1276
176fe33f
ILT
12772009-12-30 Ian Lance Taylor <iant@google.com>
1278
bb321bb1
ILT
1279 PR 10450
1280 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
1281 flags to PF_R.
1282 (Output_segment::add_output_section): Don't change the flags if
1283 the type is PT_TLS.
1284
176fe33f
ILT
1285 PR 10450
1286 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
1287 GNU hash table if they need a dynamic value. Otherwise, don't add
1288 them if they are defined in a dynamic object or are forced local.
1289
e8cd95c7
ILT
12902009-12-29 Ian Lance Taylor <iant@google.com>
1291
1b81fb71
ILT
1292 PR 10450
1293 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
1294 .gnu.hash table for a 32-bit target.
1295
8d6d383d
ILT
1296 PR 10450
1297 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
1298 regular and a dynamic object only needs a dynamic symbol table
1299 entry if it is externally visible.
1300
e785ec03
ILT
1301 PR 10450
1302 * i386.cc (class Target_i386): Initialize global_offset_table_ in
1303 constructor. Add global_offset_table_ field.
1304 (Target_i386::got_section): Set global_offset_table_.
1305 (Target_i386::do_finalize_sections): Set global_offset_table_
1306 size.
1307 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
1308 in constructor. Add global_offset_table_ field.
1309 (Target_x86_64::got_section): Set global_offset_table_.
1310 (Target_x86_64::do_finalize_sections): Set global_offset_table_
1311 size.
1312
1a2dff53
ILT
1313 * layout.cc (Layout::Layout): Initialize increase_relro_.
1314 (Layout::get_output_section): Add is_relro, is_last_relro, and
1315 is_first_non_relro parameters. Change all callers.
1316 (Layout::choose_output_section): Likewise.
1317 (Layout::add_output_section_data): Likewise.
1318 (Layout::make_output_section): Likewise.
1319 (Layout::set_segment_offsets): Clear increase_relro when using a
1320 linker script.
1321 * layout.h (class Layout): Add increase_relro method. Add
1322 increase_relro_ field. Update declarations.
1323 * output.cc (Output_section::Output_section): Initialize
1324 is_last_relro_ and is_first_non_relro_.
1325 (Output_segment::add_output_section): Group relro sections is
1326 do_sort is true. Handle is_last_relro and is_first_non_relro.
1327 (Output_segment::maximum_alignment): Remove relro handling.
1328 (Output_segment::set_section_addresses): Add increase_relro
1329 parameter. Change all callers. Add initial alignment to align
1330 relro sections on separate page. Remove old relro handling.
1331 (Output_segment::set_section_list_addresses): Remove in_relro
1332 parameter. Change all callers.
1333 (Output_segment::set_offset): Add increase parameter. Change all
1334 callers. Remove old relro handling.
1335 * output.h (class Output_section): Add new methods: is_last_relro,
1336 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
1337 Add is_last_relro_ and is_first_non_relro_ fields.
1338 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
1339 Create separate .got.plt section. Call increase_relro.
1340 * x86_64.cc (Target_x86_64::got_section): Likewise.
1341 * testsuite/relro_script_test.t: Add .got.plt.
1342
f0ba79e2
ILT
1343 PR 10450
1344 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
1345 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
1346 (Layout::finalize): Call set_dynamic_symbol_size.
1347 (Layout::set_dynamic_symbol_size): New function.
1348 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
1349 set_dynamic_symbol_size.
1350
e8cd95c7
ILT
1351 PR 10450
1352 * output.h (class Output_section): Add is_entsize_zero_ field.
1353 * output.cc (Output_section::Output_section): Initialize
1354 is_entsize_zero_.
1355 (Output_section::set_entsize): If two different entsizes are
1356 requested, force it to zero.
1357 (Output_section::add_input_section): Set flags for .debug_str
1358 before updating section flags. Set entsize.
1359 (Output_section::update_flags_for_input_section): Set SHF_MERGE
1360 and SHF_STRING if all input sections have those flags.
1361
3e1b9a8a
RÁE
13622009-12-29 Rafael Espindola <espindola@google.com>
1363
1364 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
1365 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
1366 reporting.
3e1b9a8a 1367
3dcad376
ST
13682009-12-29 Sriraman Tallam <tmsriram@google.com>
1369
1370 * options.cc (General_options::parse_version): Allow -v to exit
1371 without an error if there is nothing to link.
1372
084e2665
ILT
13732009-12-29 Ian Lance Taylor <iant@google.com>
1374
1375 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
1376 using a version of gcc before 4.1.
1377 * configure: Rebuild.
1378
250acde3
CD
13792009-12-28 Chris Demetriou <cgd@google.com>
1380
1381 * attributes.cc (Output_attributes_section_data::do_write): Use
1382 std::vector::front rather than std::vector::data.
1383
99fff23b
ILT
13842009-12-28 Ian Lance Taylor <iant@google.com>
1385
1386 * symtab.h (class Symbol_table): Add enum Defined.
1387 * resolve.cc (Symbol_table::should_override): Add defined
1388 parameter. Change all callers. Test whether object is NULL
1389 before calling a method on it.
1390 (Symbol_table::report_resolve_problem): Add defined parameter.
1391 Change all callers.
1392 (Symbol_table::should_override_with_special): Likewise.
1393 * symtab.cc (Symbol_table::define_in_output_data): Add defined
1394 parameter. Change all callers.
1395 (Symbol_table::do_define_in_output_data): Likewise.
1396 (Symbol_table::define_in_output_segment): Likewise.
1397 (Symbol_table::do_define_in_output_segment): Likewise.
1398 (Symbol_table::define_as_constant): Likewise.
1399 (Symbol_table::do_define_as_constant): Likewise.
1400 * script.h (class Symbol_assignment): Add is_defsym parameter to
1401 constructor; change all callers.
1402 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
1403 parameter. Change all callers. Add is_defsym_ field.
1404 (class Parser_closure): Add parsing_defsym parameter to
1405 constructor; change all callers. Add parsing_defsym accessor
1406 function. Add parsing_defsym_ field.
1407
556bd683
ILT
14082009-12-28 Ian Lance Taylor <iant@google.com>
1409
1410 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 1411 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 1412
1782c879
ILT
14132009-12-23 Ian Lance Taylor <iant@google.com>
1414
1415 * i386.cc (Target_i386::do_calls_non_split): Recognize
1416 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
1417 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
1418 -fsplit-stack prologue when using %r11.
1782c879 1419
329ca2b1
ST
14202009-12-21 Sriraman Tallam <tmsriram@google.com>
1421
1422 * options.cc (General_options::parse_version): Make -v continue and do
1423 the link like GNU ld does.
1424
d675ff46
RÁE
14252009-12-17 Rafael Avila de Espindola <espindola@google.com>
1426
1427 * Makefile.am (CCFILES): Add timer.cc.
1428 (HFILES): Add timer.h.
1429 * configure.ac: Check for sysconf and times.
1430 * main.cc: include timer.h.
1431 (main): Use Timer instead of get_run_time.
1432 * timer.cc: New.
1433 * timer.h: New.
1434 * workqueue.cc: include timer.h.
1435 (Workqueue::find_and_run_task):
1436 Report user, sys and wall time.
1437 * Makefile.in: Regenerate.
1438 * config.in: Regenerate.
1439 * configure: Regenerate.
1440
d6344fb5
DK
14412009-12-16 Doug Kwan <dougkwan@google.com>
1442
1443 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
1444 sections.
1445 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
1446 relaxed input sections.
1447 * output.cc (Output_section::find_relaxed_input_section): Change
1448 return type to Output_relaxed_input_section pointer. Adjust code
1449 for new type of relaxed_input_section_map_.
1450 * output.h (Output_section::find_relaxed_input_section): Change
1451 return type to Output_relaxed_input_section pointer.
1452 (Output_section::Output_relaxed_input_section_by_input_section_map):
1453 New type.
1454 (Output_section::relaxed_input_section_map_): Change type to
1455 Output_section::Output_relaxed_input_section_by_input_section_map.
1456 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
1457 input section.
1458
0e0d5469
ILT
14592009-12-15 Ian Lance Taylor <iant@google.com>
1460
1461 * layout.cc (Layout::create_shstrtab): Only write out after input
1462 sections if we are compressing debug sections.
1463
0649a889
ILT
14642009-12-15 Ian Lance Taylor <iant@google.com>
1465
1466 * archive.cc (Archive::add_symbols): Only look up a symbol without
1467 a version if there is, in fact, a version.
1468
2ea97941
ILT
14692009-12-14 Ian Lance Taylor <iant@google.com>
1470
1471 Revert -Wshadow changes, all changes from:
1472 2009-12-11 Doug Kwan <dougkwan@google.com>
1473 2009-12-11 Nick Clifton <nickc@redhat.com>
1474 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
1475
b0eec2cc
DK
14762009-12-11 Doug Kwan <dougkwan@google.com>
1477
1478 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
1479 due to -Wshadow.
1480 * attributes.cc (Object_attribute::size): Ditto.
1481 (Attributes_section_data::size): Ditto.
1482 (Attributes_section_data::Attributes_section_data): Ditto.
1483 (Output_attributes_section_data::do_write): Ditto.
1484 * attributes.h (Object_attribute::set_type): Ditto.
1485 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
1486
91d6fa6a
NC
14872009-12-11 Nick Clifton <nickc@redhat.com>
1488
1489 * archive.cc: Fix shadowed variable warnings.
1490 * arm.cc: Likewise.
1491 * compressed_output.cc: Likewise.
1492 * compressed_output.h: Likewise.
1493 * configure: Likewise.
1494 * dwarf_reader.cc: Likewise.
1495 * dynobj.cc: Likewise.
1496 * dynobj.h: Likewise.
1497 * ehframe.cc: Likewise.
1498 * ehframe.h: Likewise.
1499 * errors.cc: Likewise.
1500 * expression.cc: Likewise.
1501 * fileread.cc: Likewise.
1502 * fileread.h: Likewise.
1503 * freebsd.h: Likewise.
1504 * i386.cc: Likewise.
1505 * icf.cc: Likewise.
1506 * incremental.h: Likewise.
1507 * layout.cc: Likewise.
1508 * layout.h: Likewise.
1509 * mapfile.cc: Likewise.
1510 * merge.cc: Likewise.
1511 * merge.h: Likewise.
1512 * object.cc: Likewise.
1513 * object.h: Likewise.
1514 * options.h: Likewise.
1515 * output.cc: Likewise.
1516 * output.h: Likewise.
1517 * parameters.cc: Likewise.
1518 * plugin.cc: Likewise.
1519 * powerpc.cc: Likewise.
1520 * reduced_debug_output.cc: Likewise.
1521 * reduced_debug_output.h: Likewise.
1522 * reloc.cc: Likewise.
1523 * reloc.h: Likewise.
1524 * resolve.cc: Likewise.
1525 * script-sections.cc: Likewise.
1526 * script.cc: Likewise.
1527 * script.h: Likewise.
1528 * sparc.cc: Likewise.
1529 * symtab.cc: Likewise.
1530 * symtab.h: Likewise.
1531 * target-select.cc: Likewise.
1532 * target-select.h: Likewise.
1533 * token.h: Likewise.
1534 * workqueue.cc: Likewise.
1535 * workqueue.h: Likewise.
1536 * x86_64.cc: Likewise.
1537
a0351a69
DK
15382009-12-10 Doug Kwan <dougkwan@google.com>
1539
1540 * arm.cc (attributes.h): New include.
1541 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
1542 (Arm_relobj::~Arm_relobj): Delete object pointed by
1543 attributes_section_data_.
1544 (Arm_relobj::attributes_section_data): New method definition.
1545 (Arm_relobj::attributes_section_data_): New data member declaration.
1546 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
1547 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
1548 attributes_section_data_.
1549 (Arm_dynobj::attributes_section_data): New method definition.
1550 (Arm_dynobj::attributes_section_data_): New data member declaration.
1551 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
1552 initialization value of may_use_blx_ to false.
1553 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
1554 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
1555 object attributes to compute results instead of hard-coding.
1556 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
1557 Target_arm::get_secondary_compatible_arch,
1558 Target_arm::set_secondary_compatible_arch
1559 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
1560 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
1561 New method declarations.
1562 (Target_arm::get_aeabi_object_attribute): New method definition.
1563 (Target_arm::attributes_section_data_): New data member declaration.
1564 (read_arm_attributes_section): New template definition.
1565 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
1566 (Arm_dynobj::do_read_symbols): Ditto.
1567 (Target_arm::do_finalize_sections): Merge attributes sections from
1568 input. Check for BLX use after attributes section merging.
1569 Fix __exidx_start and __exidx_end visibility. Create an
1570 .ARM.attributes section if necessary.
1571 (Target_arm::get_secondary_compatible_arch,
1572 Target_arm::set_secondary_compatible_arch,
1573 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
1574 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
1575 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
1576 New method definitions.
1577
b59befec
ILT
15782009-12-09 Ian Lance Taylor <iant@google.com>
1579
1580 * plugin.cc (Plugin::load): Don't cast from void* to a function
1581 pointer.
1582
1276bc89
ILT
15832009-12-09 Ian Lance Taylor <iant@google.com>
1584
1585 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
1586 information fields.
1587
2f2de248
L
15882009-12-09 H.J. Lu <hongjiu.lu@intel.com>
1589
1590 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
1591 Replace two_file_shared_1.so with two_file_shared_2.so.
1592 * testsuite/Makefile.in: Regenerated.
1593
4f787271
DK
15942009-12-08 Doug Kwan <dougkwan@google.com>
1595
1596 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
1597 (HFILES): Add attributes.h and int_encoding.h.
1598 * Makefile.in: Regenerate.
1599 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
1600 function definitions to int_encoding.cc
1601 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
1602 prototypes to int_encoding.h
1603 * reduced_debug_output.cc (int_encoding.h): New include.
1604 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
1605 function definitions to int_encoding.cc
1606 (insert_into_vector, read_from_pointer): Move template definitions to
1607 int_encoding.h
1608 * attributes.cc: New file.
1609 * attributes.h: New file.
1610 * int_encoding.cc: New file.
1611 * int_encoding.h: New file.
1612
20b52f1a
RÁE
16132009-12-07 Rafael Avila de Espindola <espindola@google.com>
1614
1615 PR gold/11055
1616 * incremental-dump.cc (dump_incremental_inputs): New.
1617 (main): Use dump_incremental_inputs.
1618
53d7974c
L
16192009-12-07 H.J. Lu <hongjiu.lu@intel.com>
1620
1621 PR gold/10893
1622 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
1623 checking elfcpp::STT_FUNC.
1624 (Target_i386::Relocate::relocate): Likewise.
1625 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
1626
1627 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
1628 symbols from shared libraries into normal FUNC symbols.
1629
1630 * symtab.h (Symbol): Add is_func and use it.
1631
05a352e6
DK
16322009-12-05 Doug Kwan <dougkwan@google.com>
1633
1634 * arm.cc (Target_arm::arm_info): Initialize new fields
1635 attributes_section and attributes_vendor.
1636 * i386.cc (Target_i386::i386_info): Same.
1637 * object.cc (Sized_relobj::do_layout): Skip attribute section.
1638 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
1639 fields attributes_section and attributes_vendor.
53d7974c 1640 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
1641 * target.h (Target::attributes_section, Target::attributes_vendor,
1642 Target::is_attributes_section, Target::attribute_arg_type,
1643 Target::attributes_order): New method definitions.
1644 (Target::Target_info::attributes_section,
1645 Target::Target_info::attributes_vendor): New fields.
1646 (Target::do_attribute_arg_type, Target::do_attributes_order): New
1647 virtual method definitions.
1648 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
1649 attributes_section and attributes_vendor.
1650 * testsuite/testfile.cc (Target_test::test_target_info): Same.
1651
f4e5969c
DK
16522009-12-05 Doug Kwan <dougkwan@google.com>
1653
1654 * arm.cc: Update comments about interworking and stub generation.
1655 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
1656 considered as non-PIC.
1657 (Arm_relocate_functions::base_abs): Fix formatting.
1658 (Arm_relocate_functions::got_prel): Fix comment. Change interface
1659 of function to use GOT entry address instead of offset.
1660 (Target_arm::Scan::global): Issue an error if a symbol would need a
1661 PLT does not get one because it is untyped. Remove code to create
1662 dynamic symbols for relative branches.
1663 (Target_arm::Relocate::relocate: Use 0 instead of false since function
1664 takes unsigned integer instead of boolean.
1665
1abce4a6
L
16662009-12-05 H.J. Lu <hongjiu.lu@intel.com>
1667
1668 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
1669 (two_file_test_LDADD): Likewise.
1670 (common_test_1_LDADD): Likewise.
1671 (exception_test_LDADD) Likewise.
1672 (weak_test_LDADD): Likewise.
1673 (many_sections_test_LDADD): Likewise.
1674 (initpri1_LDADD): Likewise.
1675 (script_test_1_LDADD): Likewise.
1676 (script_test_2_LDADD): Likewise.
1677 (justsyms_LDADD): Likewise.
1678 (binary_test_LDADD): Likewise.
1679 (large_LDADD): Likewise.
1680 * testsuite/Makefile.in: Regenerated.
1681
adcf2816 16822009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 1683
adcf2816
L
1684 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
1685 (Symbol_table::override_with_special): Likewise.
1686 (Symbol_table::add_from_object): Likewise.
1687
28e67f5d
RÁE
16882009-12-04 Rafael Avila de Espindola <espindola@google.com>
1689
1690 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
1691 Don't set the data_offset twice.
1692
ae10a101
RÁE
16932009-12-04 Rafael Avila de Espindola <espindola@google.com>
1694
1695 * testsuite/Makefile.in: Regenerate.
1696
f59f41f3
DK
16972009-12-03 Doug Kwan <dougkwan@google.com>
1698
1699 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
1700 (Target_arm::do_finalize_sections): Add parameter for symbol table
1701 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
1702 * i386.cc (Target_i386::do_finalize_sections): Add an additional
1703 parameter for symbol table pointer.
1704 * layout.cc (Layout::finalize): Call Target::finalize_sections with
1705 an additional parameter for a pointer to symbol table.
1706 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
1707 parameter for a symbol table pointer.
1708 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
1709 * target.h (Target::finalize_sections, Target::do_finalize_sections):
1710 Ditto.
1711 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
1712 parameter for a symbol table pointer.
1713
ca55d848
RÁE
17142009-12-03 Rafael Avila de Espindola <espindola@google.com>
1715
1716 * incremental.cc (Incremental_inputs_header)
1717 (Incremental_inputs_header_write, Incremental_inputs_entry)
1718 (Incremental_inputs_entry_write): Move ...
1719 * incremental.h (Incremental_inputs_header)
1720 (Incremental_inputs_header_write, Incremental_inputs_entry)
1721 (Incremental_inputs_entry_write): here.
1722
3aec4f9c
RÁE
17232009-12-02 Rafael Avila de Espindola <espindola@google.com>
1724
1725 * incremental.cc (make_sized_incremental_binary): Set the target.
1726 Error if it is incompatible.
1727 * output.h (Output_file): Add filename method.
1728
9c0ae74d
RÁE
17292009-12-02 Rafael Avila de Espindola <espindola@google.com>
1730
1731 * incremental.cc (Incremental_inputs_entry): Remove unused argument
1732 from the get_* methods.
1733
a45500ae
RÁE
17342009-12-02 Rafael Avila de Espindola <espindola@google.com>
1735
1736 * incremental-dump.cc (main): Check that the offeset of a script is 0.
1737 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
1738 Write 0 for the data_offset of scripts.
1739
325e6408
RÁE
17402009-12-02 Rafael Avila de Espindola <espindola@google.com>
1741
1742 * testsuite/Makefile.am: Add the incremental_test.sh test.
1743 * testsuite/incremental_test.sh: New.
1744 * testsuite/incremental_test_1.c: New.
1745 * testsuite/incremental_test_2.c: New.
1746
954c3e2e
RÁE
17472009-12-01 Rafael Avila de Espindola <espindola@google.com>
1748
1749 * incremental-dump.cc (main): Fix typos.
1750
f8086623
RÁE
17512009-11-27 Rafael Avila de Espindola <espindola@google.com>
1752
1753 PR gold/11025
1754 * incremental-dump.cc (main): Use llu to print 64 bit values.
1755
3b0dd6ac
L
17562009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
1757 H.J. Lu <hongjiu.lu@intel.com>
1758
1759 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
1760 $(LIBDL).
1761 (incremental_dump_LDADD): Likewise.
1762 * Makefile.in: Regenerated.
1763
a6d1ef57
DK
17642009-11-25 Doug Kwan <dougkwan@google.com>
1765
1766 Revert:
1767
1768 2009-11-25 Doug Kwan <dougkwan@google.com>
1769
1770 * arm.cc (Target_arm::Target_arm): Move method definition
1771 outside of class definition. Add code to handle
1772 --target1-rel, --target1-abs and --target2= options.
1773 (Target_arm::get_reloc_reloc_type): Change method to be
1774 non-static and const.
1775 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
1776 New data member declaration.
1777 (Target_arm::Scan::local, Target_arm::Scan::global,
1778 Target_arm::Relocate::relocate,
1779 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
1780 Adjust call to Target_arm::get_real_reloc_type.
1781 (Target_arm::get_real_reloc_type): Use command line options
1782 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
1783 * options.h (--target1-rel, --target1-abs, --target2): New
1784 ARM-only options.
1785
50aeb7d4
DK
17862009-11-25 Doug Kwan <dougkwan@google.com>
1787
1788 * arm.cc (Target_arm::Target_arm): Move method definition outside of
1789 class definition. Add code to handle --target1-rel, --target1-abs
1790 and --target2= options.
1791 (Target_arm::get_reloc_reloc_type): Change method to be non-static
1792 and const.
1793 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
1794 member declaration.
1795 (Target_arm::Scan::local, Target_arm::Scan::global,
1796 Target_arm::Relocate::relocate,
1797 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
1798 call to Target_arm::get_real_reloc_type.
1799 (Target_arm::get_real_reloc_type): Use command line options to
1800 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
1801 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
1802 options.
1803
51938283
DK
18042009-11-25 Doug Kwan <dougkwan@google.com>
1805
1806 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
1807 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
1808 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
1809 formatting.
1810 (Arm_relocate_functions::thm_call): Replace body with a call to
1811 Arm_relocate_functions::thumb_branch_common.
1812 (Arm_relocate_functions::thm_jump24,
1813 Arm_relocate_functions::thm_xpc22): New method definitions.
1814 (Arm_relocate_functions::thumb_branch_common): New method definition.
1815 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
1816 operator.
1817 (Target_arm::Relocate::relocate): Adjust call to thm_call.
1818 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
1819
e2b8f3c4
RÁE
18202009-11-24 Rafael Avila de Espindola <espindola@google.com>
1821
1822 * Makefile.am: Build incremental-dump
1823 * Makefile.in: Regenerate.
1824 * incremental-dump.cc: New.
1825 * incremental.cc (Incremental_inputs_header_data,
1826 Incremental_inputs_entry_data): Move to incremental.h
1827 * incremental.h: (Incremental_inputs_header_data,
1828 Incremental_inputs_entry_data): Move from incremental.cc
1829
bcba9aec
RÁE
18302009-11-24 Rafael Avila de Espindola <espindola@google.com>
1831
1832 * incremental.cc (Incremental_inputs_header,
1833 Incremental_inputs_header_write, Incremental_inputs_entry,
1834 Incremental_inputs_entry_write): Add a typedef with the data type.
1835
7c3afe08
RÁE
18362009-11-24 Rafael Avila de Espindola <espindola@google.com>
1837
1838 * incremental.cc (Incremental_inputs_header,
1839 Incremental_inputs_header_write, Incremental_inputs_entry,
1840 Incremental_inputs_entry_write): Update comment about which
1841 type has the filed descriptions.
1842
d204b6e9
DK
18432009-11-15 Doug Kwan <dougkwan@google.com>
1844
1845 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
1846 (Arm_relocate_functions::arm_branch_common): Change method defintion
1847 in class definition to a method declaration and update list of formal
1848 parameters.
1849 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
1850 Arm_relocation_functions::jump24): Adjust call to
1851 Arm_relocate_functions::arm_branch_common. Update list of formal
1852 parameters.
1853 (Arm_relocate_functions::xpc25): New method definition.
1854 (Arm_relocate_functions::arm_branch_common): Move method defintion
1855 out from class definition. Use stubs for mode-switching and extending
1856 branch ranges.
1857 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
1858 specially. Change code to enable use of stubs in ARM branches.
1859
43d12afe
DK
18602009-11-10 Doug Kwan <dougkwan@google.com>
1861
1862 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
1863 in method declaration.
1864 (Target_arm::relocate_stub): New method declaration.
1865 (Target_arm::default_target): Change to return a pointer instead of
1866 a const reference.
1867 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
1868 Target_arm::default_target.
1869 (Arm_Relobj::do_relocate_sections): Remove options paramater in
1870 method definition.
1871 (Target_arm::relocate_section): Adjust view.
1872 (Target_arm::relocate_stub): New method definition.
1873
ac33a407
DK
18742009-11-10 Doug Kwan <dougkwan@google.com>
1875
1876 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
1877 a format warning.
1878 * incremental.cc (open_incremental_binary): Initialized local
1879 variables to avoid warnings.
1880 * object.cc (make_elf_object): Ditto.
1881 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
1882 a format warning.
1883
88ee28e9
L
1884009-11-09 H.J. Lu <hongjiu.lu@intel.com>
1885
1886 PR gold/10930
1887 * testsuite/plugin_test.c: Include "config.h".
1888
2daedcd6
DK
18892009-11-09 Doug Kwan <dougkwan@google.com>
1890
1891 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
1892 (arm_symbol_value): Remove.
1893 (Arm_relocate_functions::arm_branch_common,
1894 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
1895 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
1896 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
1897 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
1898 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
1899 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
1900 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
1901 Arm_relocate_functions::thm_mobw_abs_nc,
1902 Arm_relocate_functions::thm_mov_abs,
1903 Arm_relocate_functions::movw_prel_nc,
1904 Arm_relocate_functions::thm_movt_abs,
1905 Arm_relocate_functions::movt_prel,
1906 Arm_relocate_functions::thm_movw_prel_nc,
1907 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
1908 (Target_arm::Relocate::relocate): Only decompose address into two
1909 parts if relocation type uses the thumb-bit and pass the actual
1910 bit instead of a flag indicating that the thumb-bit is used. Adjust
1911 calls to methods in Arm_relocate_functions for this change.
1912
1276bc89 19132009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
1914
1915 PR 10925
1916 * reloc.cc: Instantiate
1917 Sized_relobj::initialize_input_to_output_maps and
1918 Sized_relobj:free_input_to_output_maps.
1919
e53ad1b5
ILT
19202009-11-06 Ian Lance Taylor <iant@google.com>
1921
1922 PR 10876
1923 * defstd.cc (in_segment): Set only_if_ref true for "end".
1924
eb44217c
DK
19252009-11-06 Doug Kwan <dougkwan@google.com>
1926
1927 * arm.cc (class Reloc_stub): Correct a comment.
1928 (Target_arm::Target_arm): Initialize arm_input_section_map_.
1929 (Target_arm::scan_section_for_stubs): New method declaration.
1930 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
1931 Change methods from private to protected.
1932 (Target_arm::do_may_relax): New method definition.
1933 (Target_arm::do_relax, Target_arm::group_sections,
1934 Target_arm::scan_reloc_for_stub,
1935 Target_arm::scan_reloc_section_for_stubs): New method declarations.
1936 (Target_arm::arm_input_section_map_): New data member declaration.
1937 (Target_arm::scan_reloc_for_stub,
1938 Target_arm::scan_reloc_section_for_stubs,
1939 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
1940 Target_arm::do_relax): New method definitions.
1941
5d329b7d
ILT
19422009-11-06 Mikolaj Zalewski <mikolaj@google.com>
1943
1944 * configure.ac: Check for (struct stat)::st_mtim
1945 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
1946 * config.in: Regenerate.
1947 * configure: Regenerate.
1948
96a0d71b
ILT
19492009-11-05 Ian Lance Taylor <iant@google.com>
1950
1951 PR 10910
1952 * output.cc (Output_segment::add_output_section): Add missing
1953 return statement.
1954
594c8e5e
ILT
19552009-11-04 Ian Lance Taylor <iant@google.com>
1956
1957 PR 10880
1958 * object.h (class Object): Add is_needed and set_is_needed
1959 methods. Add is_needed_ field. Make bool fields into bitfields.
1960 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
1961 defined in a dynamic object and referenced by a regular object,
1962 set is_needed for the dynamic object.
1963 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
1964 if the file is marked with as_needed and it is not needed.
1965
22b127cc
ILT
19662009-11-04 Ian Lance Taylor <iant@google.com>
1967
1968 PR 10887
1969 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
1970 tags if data is discarded by linker script.
1971 * i386.cc (Target_i386::do_finalize_sections): Likewise.
1972 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
1973 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
1974 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
1975
f5c870d2
ILT
19762009-11-04 Ian Lance Taylor <iant@google.com>
1977
1978 * layout.cc (Layout::get_output_section): Add is_interp and
1979 is_dynamic_linker_section parameters. Change all callers.
1980 (Layout::choose_output_section): Likewise.
1981 (Layout::make_output_section): Likewise.
1982 (Layout::add_output_section_data): Add is_dynamic_linker_section
1983 parameter. Change all callers.
1984 * layout.h (class Layout): Update declarations.
1985 * output.h (class Output_section): Add is_interp, set_is_interp,
1986 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
1987 Add is_interp_, is_dynamic_linker_section_ fields. Change
1988 generate_code_fills_at_write_ to a bitfield.
1989 * output.cc (Output_section::Output_sections): Initialize new
1990 fields.
1991 (Output_segment::add_output_section): Add do_sort parameter.
1992 Change all callers.
1993
1ae4d23b
ILT
19942009-11-03 Ian Lance Taylor <iant@google.com>
1995
1996 PR 10860
1997 * options.h (class General_options): Add --warn-common.
1998 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
1999 merging two common symbols.
2000 (Symbol_table::should_override): Handle --warn-common when merging
2001 a common symbol with a defined symbol. Use report_resolve_problem
2002 for multiple definitions.
2003 (Symbol_table::report_resolve_problem): New function.
2004 * symtab.h (class Symbol_table): Declare report_resolve_problem.
2005
55da9579
DK
20062009-11-03 Doug Kwan <dougkwan@google.com>
2007
2008 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
2009 stub_factory_.
2010 (Target_arm::stub_factory): New method definition.
2011 (Target_arm::new_arm_input_section,
2012 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
2013 Target_arm::reloc_uses_thumb_bit): New method declarations.
2014 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
2015 New type definitions.
2016 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
2017 member declarations.
2018 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
2019 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
2020 New method definitions.
2021
37a9ac43
ILT
20222009-11-03 Ian Lance Taylor <iant@google.com>
2023
2024 * options.h (class General_options): Add --warn_constructors.
2025
b3d6a3d4
ILT
20262009-11-03 Ian Lance Taylor <iant@google.com>
2027
2028 PR 10893
2029 * defstd.cc (in_section): Add entries for __rel_iplt_start,
2030 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
2031
934b01dd
ILT
20322009-11-03 Ian Lance Taylor <iant@google.com>
2033
2034 PR 10895
2035 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
2036 --msgid-bugs-address.
2037 (install-pdf): New target.
2038 (install-data_yes): Look up one directory to find mkinstalldirs.
2039
03c1939b
L
20402009-11-03 H.J. Lu <hongjiu.lu@intel.com>
2041
2042 * po/Make-in (.po.gmo): Don't generate .gmo files in source
2043 tree.
2044
ebd95253
DK
20452009-10-30 Doug Kwan <dougkwan@google.com>
2046
2047 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
2048
e9bbb538
DK
20492009-10-30 Doug Kwan <dougkwan@google.com>
2050
2051 * arm.cc (Stub_addend_reader): New struct template definition
2052 and partial specializations.
2053 (Stub_addend_reader::operator()): New method definition for a
2054 partially specialized template.
2055
d5b40221
DK
20562009-10-30 Doug Kwan <dougkwan@google.com>
2057
2058 * arm.cc (Arm_relobj::processor_specific_flags): New method
2059 definition.
2060 (Arm_relobj::do_read_symbols): New method declaration.
2061 (Arm_relobj::processor_specific_flags_): New data member declaration.
2062 (Arm_dynobj): New class definition.
2063 (Target_arm::do_finalize_sections): Add input_objects parameter.
2064 (Target_arm::do_adjust_elf_header): New method declaration.
2065 (Target_arm::are_eabi_versions_compatible,
2066 (Target_arm::merge_processor_specific_flags): New method declaration.
2067 (Target_arm::do_make_elf_object): New overloaded method definitions
2068 and declaration.
2069 (Arm_relobj::do_read_symbols): New method definition.
2070 (Arm_dynobj::do_read_symbols): Ditto.
2071 (Target_arm::do_finalize_sections): Add input_objects parameters.
2072 Merge processor-specific flags from all input objects.
2073 (Target_arm::are_eabi_versions_compatible,
2074 Target_arm::merge_processor_specific_flags,
2075 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
2076 New method definitions.
2077 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
2078 Input_objects pointer type parameter.
2079 * layout.cc (Layout::finalize): Pass input objects to target's.
2080 finalize_sections function.
2081 * output.cc (Output_file_header::do_sized_write): Set ELF file
2082 header's processor-specific flags.
2083 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
2084 Input_objects pointer type parameter.
2085 * sparc.cc (Target_sparc::do_finalize_sections): Same.
2086 * target.h (Input_objects): New forward class declaration.
2087 (Target::processor_specific_flags,
2088 Target::are_processor_specific_flags_sect): New method definitions.
2089 (Target::finalize_sections): Add input_objects parameter.
2090 (Target::Target): Initialize processor_specific_flags_ and
2091 are_processor_specific_flags_set_.
2092 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
2093 parameter.
2094 (Target::set_processor_specific_flags): New method definition.
2095 (Target::processor_specific_flags_,
2096 Target::are_processor_specific_flags_set_): New data member
2097 declarations.
2098 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
2099 Input_objects pointer type parameter.
2100
ebabffbd
DK
21012009-10-30 Doug Kwan <dougkwan@google.com>
2102
2103 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
2104
ad0f2072
ILT
21052009-10-28 Ian Lance Taylor <iant@google.com>
2106
2107 * object.h (class Relobj): Drop options parameter from
2108 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
2109 do_scan_relocs, do_relocate. Change all callers.
2110 (class Sized_relobj): Drop options parameters from
2111 do_gc_process_relocs, do_scan_relocs, do_relocate,
2112 do_relocate_sections, relocate_sections, emit_relocs_scan,
2113 emit_relocs_scan_reltype. Change all callers.
2114 (struct Relocate_info): Remove options field and all references to
2115 it.
2116 * reloc.h (class Read_relocs): Remove options constructor
2117 parameter and options_ field. Change all callers.
2118 (class Gc_process_relocs, class Scan_relocs): Likewise.
2119 (class Relocate_task): Likewise.
2120 * target-reloc.h (scan_relocs): Remove options parameter. Change
2121 all callers.
2122 (scan_relocatable_relocs): Likewise.
2123 * target.h (class Sized_target): Remove options parameter from
2124 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
2125 all callers.
2126 * gc.h (gc_process_relocs): Remove options parameter. Change all
2127 callers.
2128 * arm.cc: Update functions to remove options parameters.
2129 * i386.cc: Likewise.
2130 * powerpc.cc: Likewise.
2131 * sparc.cc: Likewise.
2132 * x86_64.cc: Likewise.
2133 * testsuite/testfile.cc: Likewise.
2134
8ffa3667
DK
21352009-10-28 Doug Kwan <dougkwan@google.com>
2136
2137 * arm.cc (Arm_relobj): New class definition.
2138 (Arm_relobj::scan_sections_for_stubs,
2139 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
2140 New method definitions.
2141
40f36857
CC
21422009-10-28 Cary Coutant <ccoutant@google.com>
2143
2144 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
2145 (Plugin::cleanup_done_): New member.
2146 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
2147 (Plugin_manager::cleanup_done_): Remove.
2148 (Plugin_manager::add_input_file): Edit error message.
2149 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
2150 (Plugin_manager::cleanup): Remove use of cleanup_done_.
2151
2c849493
ILT
21522009-10-27 Mikolaj Zalewski <mikolajz@google.com>
2153
2154 * fileread.cc: (File_read::View::~View): Use the new
2155 data_ownership_ filed.
2156 (File_read::~File_read): Dispose the new whole_file_view_.
2157 (File_read::open): Mmap the whole file if needed.
2158 (File_read::open): Use whole_file_view_ instead of contents_.
2159 (File_read::find_view): Use whole_file_view_ if applicable.
2160 (File_read::do_read): Use whole_file_view_ instead of contents_.
2161 (File_read::make_view): Use whole_file_view_ instead of contents_,
2162 update File_read::View::View call.
2163 (File_read::find_or_make_view): Update File_read::View::View
2164 call.
2165 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
2166 remove contents_
2167 (File_read::View::Data_ownership): New enum.
2168 (File_read::View::View): Replace bool mapped_ with Data_ownership
2169 argument.
2170 (File_read::View::mapped_): Remove (replaced by data_ownership_).
2171 (File_read::View::data_ownership_): New field.
2172 (File_read::contents_): Remove (replaced by whole_file_view_).
2173 (File_read::whole_file_view_): New field.
2174 * options.h (class General_options): Add --keep-files-mapped.
2175
24998053
CC
21762009-10-27 Cary Coutant <ccoutant@google.com>
2177
2178 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
2179 * testsuite/Makefile.am (plugin_test_5): New test case.
2180 * testsuite/Makefile.in: Regenerate.
2181
72adc4fa
DK
21822009-10-25 Doug Kwan <dougkwan@google.com>
2183
2184 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
2185 from private to protected to allow access by child class.
2186 (Sized_relobj::do_relocate_sections): New method declaration.
2187 (Sized_relobj::relocate_sections): Virtualize.
2188 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
2189 Sized_relobj::relocate_sections. Instantiate template explicitly
2190 for different target sizes and endianity.
2191
07f508a2
DK
21922009-10-24 Doug Kwan <dougkwan@google.com>
2193
2194 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
2195 (Arm_input_section::as_arm_input_section): New method.
2196 (Arm_output_section): New class definition.
2197 (Arm_output_section::create_stub_group,
2198 Arm_output_section::group_sections): New method definitions.
2199
10ad9fe5
DK
22002009-10-22 Doug Kwan <dougkwan@google.com>
2201
2202 * arm.cc (Arm_input_section): New class definition.
2203 (Arm_input_section::init, Arm_input_section:do_write,
2204 Arm_input_section::set_final_data_size,
2205 Arm_input_section::do_reset_address_and_file_offset): New method
2206 definitions.
2207
56ee5e00
DK
22082009-10-21 Doug Kwan <dougkwan@google.com>
2209
2210 * arm.cc (Stub_table, Arm_input_section): New forward class
2211 declarations.
2212 (Stub_table): New class defintion.
2213 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
2214 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
2215 New method definition.
2216
b569affa
DK
22172009-10-21 Doug Kwan <dougkwan@google.com>
2218
2219 * arm.cc: Update copyright comments.
2220 (Target_arm): New forward class template declaration.
2221 (Arm_address): New type.
2222 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
2223 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
2224 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
2225 constants.
2226 (Insn_template): Same.
2227 (DEF_STUBS): New macro.
2228 (Stub_type): New enum type.
2229 (Stub_template): New class definition.
2230 (Stub): Same.
2231 (Reloc_stub): Same.
2232 (Stub_factory): Same.
2233 (Target_arm::Target_arm): Initialize may_use_blx_ and
2234 should_force_pic_veneer_.
2235 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
2236 Target_arm::should_force_pic_veneer,
2237 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
2238 Target_arm::using_thumb_only, Target_arm:;default_target): New
2239 method defintions.
2240 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
2241 New data member declarations.
2242 (Insn_template::size, Insn_template::alignment): New method defintions.
2243 (Stub_template::Stub_template): New method definition.
2244 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
2245 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
2246 (Stub_factory::Stub_factory): New method definition.
2247 * gold.h (string_hash): New template.
2248 * output.h (Input_section_specifier::hash_value): Use
2249 gold::string_hash.
2250 (Input_section_specifier::string_hash): Remove.
2251 * stringpool.cc (Stringpool_template::string_hash): Use
2252 gold::string_hash.
2253
6c172549
DK
22542009-10-20 Doug Kwan <dougkwan@google.com>
2255
2256 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
2257 symbols of relaxed input sections.
2258 * output.h (Output_section::find_relaxed_input_section): Make
2259 method public.
2260
c5617f2f
DK
22612009-10-16 Doug Kwan <dougkwan@google.com>
2262
2263 * dynobj.cc (Versions::Versions): Initialize version_script_.
2264 Only insert base version symbol definition for a shared object
2265 if version script defines any version versions.
2266 (Versions::define_base_version): New method definition.
2267 (Versions::add_def): Check that base version is not needed.
2268 (Versions::add_need): Define base version lazily.
2269 * dynobj.h (Versions::define_base_version): New method declaration.
2270 (Versions::needs_base_version_): New data member declaration.
2271 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
2272 (check_DATA): Add no_version_test.stdout.
2273 (libno_version_test.so, no_version_test.o no_version_test.stdout):
2274 New make rules.
2275 * testsuite/Makefile.in: Regenerate.
2276 * testsuite/no_version_test.c: New file.
2277 * testsuite/no_version_test.sh: Ditto.
2278
3c12dcdb
DK
22792009-10-16 Doug Kwan <dougkwan@google.com>
2280
2281 * expression.cc (class Segment_start_expression): New class definition.
2282 (Segment_start_expression::value): New method definition.
2283 (script_exp_function_segment_start): Return a new
2284 Segment_start_expression.
2285 * gold/script-c.h (script_saw_segment_start_expression): New function
2286 prototype.
2287 * script-sections.cc (Script_sections::Script_sections): Initialize
2288 SAW_SEGMENT_START_EXPRESSION_ to false.
2289 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
2290 and -Tbbs options to specify section addresses if given in
2291 command line and no SEGMENT_START expression is seen in a script.
2292 * script-sections.h (Script_sections::saw_segment_start_expression,
2293 Script_sections::set_saw_segment_start_expression): New method
2294 definition.
2295 (Script_sections::saw_segment_start_expression_): New data member
2296 declaration.
2297 * script.cc (script_saw_segment_start_expression): New function.
2298 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
2299 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
2300 script_test_7.sh and script_test_8.sh.
2301 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
2302 script_test_8.stdout.
2303 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
2304 (script_test_6, script_test_6.stdout, script_test_7,
2305 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
2306 * Makefile.in: Regenerate.
2307 * testsuite/script_test_6.sh: New file.
2308 * testsuite/script_test_6.t: Same.
2309 * testsuite/script_test_7.sh: Same.
2310 * testsuite/script_test_7.t: Same.
2311 * testsuite/script_test_8.sh: Same.
2312
64b1ae37
DK
23132009-10-16 Doug Kwan <dougkwan@google.com>
2314
2315 * output.cc (Output_segment::set_section_list_address): Cast
2316 expressions to unsigned long long type to avoid format warnings.
2317
661be1e2
ILT
23182009-10-15 Ian Lance Taylor <iant@google.com>
2319
12edd763 2320 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 2321 dot assignment to script_sections_.
12edd763
ILT
2322 * script-sections.cc (Script_sections::add_dot_assignment):
2323 Initialize if necessary.
2324
68b6574b
ILT
2325 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
2326 program headers with no load segment if there is a linker script.
2327
661be1e2
ILT
2328 * layout.cc (Layout::set_segment_offsets): Align the file offset
2329 to the segment aligment for -N or -n with no load segment.
2330 * output.cc (Output_segment::add_output_section): Don't crash if
2331 the first section is a TLS section.
2332 (Output_segment::set_section_list_addresses): Print an error
2333 message if the address moves backward in a linker script.
2334 * script-sections.cc
2335 (Output_section_element_input::set_section_addresses): Don't
2336 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
2337 (Orphan_output_section::set_section_addresses): Likewise.
2338
f15f61a7
DK
23392009-10-15 Doug Kwan <dougkwan@google.com>
2340
2341 * layout.cc (Layout::finish_dynamic_section): Generate tags
2342 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
2343 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
2344 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
2345
82bb573a
ILT
23462009-10-14 Ian Lance Taylor <iant@google.com>
2347
2348 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
2349 fields.
2350 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
2351 data_shdr fields of relinfo.
2352 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
2353 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
2354 R_386_TLS_LDO_32, adjust based on section flags.
2355 (Target_i386::Relocate::fix_up_ldo): Remove.
2356
374ad285
ILT
23572009-10-13 Ian Lance Taylor <iant@google.com>
2358
2359 Add support for -pie.
2360 * options.h (class General_options): Add -pie and
2361 --pic-executable.
2362 (General_options::output_is_position_independent): Test -pie.
2363 (General_options::output_is_executable): Return true if not shared
2364 and not relocatable.
2365 (General_options::output_is_pie): Remove.
2366 * options.cc (General_options::finalize): Reject incompatible uses
2367 of -pie.
2368 * gold.cc (queue_middle_tasks): A -pie link is not static.
2369 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
2370 * symtab.cc (Symbol::final_value_is_known): Return false if
2371 output_is_position_independent.
2372 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
2373 output_is_position_independent.
2374 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
2375 output_is_position_independent.
2376 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
2377 output_is_position_independent.
2378 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
2379 two_file_pie_test.
2380 (basic_pie_test.o, basic_pie_test): New targets.
2381 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
2382 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
2383 (two_file_pie_test): New target.
2384 * testsuite/Makefile.in: Rebuild.
2385 * README: Remove note saying that -pie is not supported.
2386
c6585162
ILT
23872009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
2388
2389 * options.h (class General_options): Add -init and -fini.
2390 * layout.cc (Layout::finish_dynamic_section): Emit
2391 given init and fini functions.
2392
032ce4e9
ST
23932009-10-13 Sriraman Tallam <tmsriram@google.com>
2394
2395 * gc.h (gc_process_relocs): Check if icf is enabled using new
2396 function.
2397 * gold.cc (queue_initial_tasks): Likewise.
2398 (queue_middle_tasks): Likewise.
2399 * object.cc (do_layout): Likewise.
2400 * symtab.cc (is_section_folded): Likewise.
2401 * main.cc (main): Likewise.
2402 * reloc.cc (Read_relocs::run): Likewise.
2403 (Sized_relobj::do_scan_relocs): Likewise.
2404 * icf.cc (is_function_ctor_or_dtor): New function.
2405 (Icf::find_identical_sections): Check if function is ctor or dtor when
2406 safe icf is chosen.
2407 * options.h (General_options::icf): Change option to be an enum.
2408 (Icf_status): New enum.
2409 (icf_enabled): New method.
2410 (icf_safe_folding): New method.
2411 (set_icf_status): New method.
2412 (icf_status_): New variable.
2413 * (options.cc) (General_options::finalize): Set icf_status_.
2414 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
2415 icf_test and icf_keep_unique_test to use the --icf enum flag.
2416 * testsuite/icf_safe_test.sh: New file.
2417 * testsuite/icf_safe_test.cc: New file.
2418
f345227a
ST
24192009-10-12 Sriraman Tallam <tmsriram@google.com>
2420
2421 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
2422 includes to gc.h and icf.h.
2423 * arm.cc: Include gc.h.
2424 * gold.cc: Likewise.
2425 * i386.cc: Likewise.
2426 * powerpc.cc: Likewise.
2427 * sparc.cc: Likewise.
2428 * x86_64.cc: Likewise.
2429 * gc.h: Include icf.h.
2430
1c7814ed
ILT
24312009-10-11 Ian Lance Taylor <iant@google.com>
2432
2433 * plugin.cc: Include "gold.h" before other header files.
2434
ae3b5189
CD
24352009-10-10 Chris Demetriou <cgd@google.com>
2436
2437 * options.h (Input_file_argument::Input_file_type): New enum.
2438 (Input_file_argument::is_lib_): Replace with...
2439 (Input_file_argument::type_): New member.
2440 (Input_file_argument::Input_file_argument): Take Input_file_type
2441 'type' rather than boolean 'is_lib' as second argument.
2442 (Input_file_argument::is_lib): Use type_.
2443 (Input_file_argument::is_searched_file): New function.
2444 (Input_file_argument::may_need_search): Handle is_searched_file.
2445 * options.cc (General_options::parse_library): Support -l:filename.
2446 (General_options::parse_just_symbols): Update for Input_file_argument
2447 changes.
2448 (Command_line::process): Likewise.
2449 * archive.cc (Archive::get_file_and_offset): Likewise.
2450 * plugin.cc (Plugin_manager::release_input_file): Likewise.
2451 * script.cc (read_script_file, script_add_file): Likewise.
2452 * fileread.cc (Input_file::Input_file): Likewise.
2453 (Input_file::will_search_for): Handle is_searched_file.
2454 (Input_file::open): Likewise.
2455 * readsyms.cc (Read_symbols::get_name): Likewise.
2456 * testsuite/Makefile.am (searched_file_test): New test.
2457 * testsuite/Makefile.in: Regenerate.
2458 * testsuite/searched_file_test.cc: New file.
2459 * testsuite/searched_file_test_lib.cc: New file.
2460
f3048a1d
ILT
24612009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
2462 Ian Lance Taylor <iant@google.com>
2463
2464 * descriptor.cc: Include <cstdio> and "binary-io.h".
2465 (Descriptors::open): Open the files in binary mode always.
2466 * script.cc (Lex::get_token): Treat \r as whitespace.
2467
d4780e57
ILT
24682009-10-09 Ian Lance Taylor <iant@google.com>
2469
2470 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
2471
d9a893b8
ILT
24722009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
2473 Ian Lance Taylor <iant@google.com>
2474
2475 * configure.ac: Check for readv function also.
2476 * fileread.cc (readv): Define if not HAVE_READV.
2477 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
2478 does not exist.
2479 * config.in: Regenerate.
2480 * configure: Regenerate.
2481
c0a62865
DK
24822009-10-09 Doug Kwan <dougkwan@google.com>
2483
2484 * layout.cc (Layout::make_output_section): Call target hook to make
2485 ordinary output section.
2486 (Layout::finalize): Adjust parameter list of call the
2487 Target::may_relax().
2488 * layout.h (class Layout::section_list): New method.
2489 * merge.h (Output_merge_base::entsize): Change visibility to public.
2490 (Output_merge_base::is_string, Output_merge_base::do_is_string):
2491 New methods.
2492 (Output_merge_string::do_is_string): New method.
2493 * object.cc (Sized_relobj::do_setup): renamed from
2494 Sized_relobj::set_up.
2495 * object.h (Sized_relobj::adjust_shndx,
2496 Sized_relobj::initializ_input_to_output_maps,
2497 Sized_relobj::free_input_to_output_maps): Change visibilities to
2498 protected.
2499 (Sized_relobj::setup): Virtualize.
2500 (Sized_relobj::do_setup): New method declaration.
2501 (Sized_relobj::invalidate_section_offset,
2502 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
2503 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
2504 * options.cc (parse_int): New function.
2505 * options.h (parse_int): New declaration.
2506 (DEFINE_int): New macro.
2507 (stub_group_size): New option.
2508 * output.cc (Output_section::Output_section): Initialize memebers
2509 merge_section_map_, merge_section_by_properties_map_,
2510 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
2511 (Output_section::add_input_section): Handled deferred code-fill
2512 generation and remove an old comment.
2513 (Output_section::add_relaxed_input_section): New method definition.
2514 (Output_section::add_merge_input_section): Use merge section by
2515 properties map to speed to search. Update merge section maps
2516 as appropriate.
2517 (Output_section::build_relaxation_map): New method definition.
2518 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
2519 Same.
2520 (Output_section::relax_input_section): Renamed to
2521 Output_section::convert_input_sections_to_relaxed_sections and change
2522 interface to take a vector of pointers to relaxed sections.
2523 (Output_section::find_merge_section,
2524 Output_section::find_relaxed_input_section): New method definitions.
2525 (Output_section::is_input_address_mapped,
2526 Output_section::output_offset, Output_section::output_address):
2527 Use output section data maps to speed up searching.
2528 (Output_section::find_starting_output_address): Add comments.
2529 (Output_section::do_write,
2530 Output_section::write_to_postprocessing_buffer): Do code-fill
2531 generation as appropriate.
2532 (Output_section::get_input_sections): Invalidate relaxed input section
2533 map.
2534 (Output_section::restore_states): Adjust type of checkpoint .
2535 Invalidate relaxed input section map.
2536 * output.h (Output_merge_base): New class declaration.
2537 (Input_section_specifier): New class defintion.
2538 (class Output_relaxed_input_section) Change base class to
2539 Output_section_data_build.
2540 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
2541 base class initializer.
2542 (Output_section::add_relaxed_input_section): New method declaration.
2543 (Output_section::Input_section): Change visibility to protected.
2544 (Output_section::Input_section::relobj,
2545 Output_section::Input_section::shndx): Handle relaxed input sections.
2546 Output_section::input_sections) Change visibility to protected. Also
2547 define overload to return a non-const pointer.
2548 (Output_section::Merge_section_properties): New class defintion.
2549 (Output_section::Merge_section_by_properties_map,
2550 Output_section::Output_section_data_by_input_section_map,
2551 Output_section::Relaxation_map): New types.
2552 (Output_section::relax_input_section): Rename method to
2553 Output_section::convert_input_sections_to_relaxed_sections and change
2554 interface to take a vector of relaxed section pointers.
2555 (Output_section::find_merge_section,
2556 Output_section::find_relaxed_input_section,
2557 Output_section::build_relaxation_map,
2558 Output_section::convert_input_sections_in_list_to_relaxed_sections):
2559 New method declarations.
2560 (Output_section::merge_section_map_
2561 Output_section::merge_section_by_properties_map_,
2562 Output_section::relaxed_input_section_map_,
2563 Output_section::is_relaxed_input_section_map_valid_,
2564 Output_section::generate_code_fills_at_write_): New data members.
2565 * script-sections.cc
2566 (Output_section_element_input::set_section_addresses): Call
2567 current_data_size and addralign methods of relaxed input sections.
2568 (Orphan_output_section::set_section_addresses): Call current_data_size
2569 and addralign methods of relaxed input sections.
2570 * symtab.cc (Symbol_table::compute_final_value): Extract template
2571 from the body of Symbol_table::sized_finalize_symbol.
2572 (Symbol_table::sized_finalized_symbol): Call
2573 Symbol_table::compute_final_value.
2574 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
2575 (Symbol_table::compute_final_value): New templated method declaration.
2576 * target.cc (Target::do_make_output_section): New method defintion.
2577 * target.h (Target::make_output_section): New method declaration.
2578 (Target::relax): Add more parameters for input objects, symbol table
2579 and layout. Adjust call to do_relax.
2580 (Target::do_make_output_section): New method declaration.
2581 (Target::do_relax): Add parameters for input objects, symbol table
2582 and layout.
2583
d446d6c4
ILT
25842009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
2585
2586 * pread.c: Include stdio.h.
2587
bc06c745
ILT
25882009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
2589
2590 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
2591 defined.
2592
75aea3d0
ILT
25932009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
2594
2595 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
2596 Change read_shndx type to unsigned int.
2597 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
2598 int.
2599 (Sized_dwarf_line_info::read_line_mappings): Likewise.
2600 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
2601 Change read_shndx type to unsigned int.
2602 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
2603 int.
2604 (Sized_dwarf_line_info::read_line_mappings): Likewise.
2605 * layout.cc (Layout::create_symtab_sections): Cast the result of
2606 local_symcount * symsize to off_t in the gold_assert.
2607
be8fcb75
ILT
26082009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2609
2610 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
2611 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
2612 R_ARM_BASE_ABS.
2613 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
2614 (Arm_relocate_functions::thm_abs5): New function.
2615 (Arm_relocate_functions::abs12): New function.
2616 (Arm_relocate_functions::abs16): New function.
2617 (Arm_relocate_functions::base_abs): New function.
2618 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
2619 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
2620 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
2621 R_ARM_BASE_ABS.
2622 (Scan::global): Likewise.
2623 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
2624 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
2625 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
2626 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
2627 R_ARM_BASE_ABS.
2628
c2a122b6
ILT
26292009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2630
2631 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
2632 (Arm_relocate_functions::movt_prel): New function.
2633 (Arm_relocate_functions::thm_movw_prel_nc): New function.
2634 (Arm_relocate_functions::thm_movt_prel): New function.
2635 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
2636 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
2637 (Scan::global, Relocate::relocate): Likewise.
2638 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
2639
c4aa1e2d
ILT
26402009-10-09 Mikolaj Zalewski <mikolajz@google.com>
2641
2642 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
2643 Incremental_checker.
2644 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
2645 unsigned int.
2646 (class Incremental_inputs_header): New class.
2647 (Incremental_inputs_header_writer): Edit comment.
2648 (Incremental_inputs_entry): New class.
2649 (Incremental_inputs_entry_writer): Edit comment.
2650 (Sized_incremental_binary::do_find_incremental_inputs_section):
2651 Add *strtab_shndx parameter, fill it.
2652 (Sized_incremental_binary::do_check_inputs): New method.
2653 (Incremental_checker::can_incrementally_link_output_file): Use
2654 Sized_incremental_binary::check_inputs.
2655 (Incremental_inputs::report_command_line): Save command line in
2656 command_line_.
2657 * incremental.h:
2658 (Incremental_binary::find_incremental_inputs_section): New
2659 method.
2660 (Incremental_binary::do_find_incremental_inputs_section): Add
2661 strtab_shndx parameter.
2662 (Incremental_binary::do_check_inputs): New pure virtual method.
2663 (Sized_incremental_binary::do_check_inputs): Declare.
2664 (Incremental_checker::Incremental_checker): Add incremental_inputs
2665 parameter, use it to initialize incremental_inputs_.
2666 (Incremental_checker::incremental_inputs_): New field.
2667 (Incremental_checker::command_line): New method.
2668 (Incremental_checker::inputs): New method.
2669 (Incremental_checker::command_line_): New field.
2670
c549a694
ILT
26712009-10-09 Mikolaj Zalewski <mikolajz@google.com>
2672
2673 * incremental.cc: Include <cstdarg> and "target-select.h".
2674 (vexplain_no_incremental): New function.
2675 (explain_no_incremental): New function.
2676 (Incremental_binary::error): New method.
2677 (Sized_incremental_binary::do_find_incremental_inputs_section): New
2678 method.
2679 (make_sized_incremental_binary): New function.
2680 (open_incremental_binary): New function.
2681 (can_incrementally_link_file): Add checks if output is ELF and has
2682 inputs section.
2683 * incremental.h: Include "elfcpp_file.h" and "output.h".
2684 (Incremental_binary): New class.
2685 (Sized_incremental_binary): New class.
2686 (open_incremental_binary): Declare.
2687 * object.cc (is_elf_object): Use
2688 elfcpp::Elf_recognizer::is_elf_file.
2689 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
2690 * output.h (Output_file::filesize): New method.
2691
fd3c5f0b
ILT
26922009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2693
2694 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
2695 New function.
2696 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
2697 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
2698 function.
2699 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
2700 function.
2701 (Arm_relocate_functions::movw_abs_nc): New function.
2702 (Arm_relocate_functions::movt_abs): New function.
2703 (Arm_relocate_functions::thm_movw_abs_nc): New function.
2704 (Arm_relocate_functions::thm_movt_abs): New function.
2705 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
2706 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
2707 (Scan::global): Likewise.
2708 (Relocate::relocate): Likewise.
2709 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
2710
7f5309a5
ILT
27112009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2712
2713 * arm.cc (Arm_relocate_functions::got_prel) New function.
2714 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
2715 (Relocate::relocate): Likewise.
2716 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
2717
364c7fa5
ILT
27182009-10-06 Ian Lance Taylor <iant@google.com>
2719
2720 * options.h (class General_options): Define
2721 split_stack_adjust_size parameter.
2722 * object.h (class Object): Add uses_split_stack_ and
2723 has_no_split_stack_ fields. Add uses_split_stack and
2724 has_no_split_stack accessor functions. Declare
2725 handle_split_stack_section.
2726 (class Reloc_symbol_changes): Define.
2727 (class Sized_relobj): Define Function_offsets. Declare
2728 split_stack_adjust, split_stack_adjust_reltype, and
2729 find_functions.
2730 * object.cc (Object::handle_split_stack_section): New function.
2731 (Sized_relobj::do_layout): Call handle_split_stack_section.
2732 * dynobj.cc (Sized_dynobj::do_layout): Call
2733 handle_split_stack_section.
2734 * reloc.cc (Sized_relobj::relocate_sections): Call
2735 split_stack_adjust for executable sections in split_stack
2736 objects. Pass reloc_map to relocate_section.
2737 (Sized_relobj::split_stack_adjust): New function.
2738 (Sized_relobj::split_stack_adjust_reltype): New function.
2739 (Sized_relobj::find_functions): New function.
2740 * target-reloc.h: Include "object.h".
2741 (relocate_section): Add reloc_symbol_changes parameter. Change
2742 all callers.
2743 * target.h (class Target): Add calls_non_split method. Declare
2744 do_calls_non_split virtual method. Declare match_view and
2745 set_view_to_nop.
2746 * target.cc: Include "elfcpp.h".
2747 (Target::do_calls_non_split): New function.
2748 (Target::match_view): New function.
2749 (Target::set_view_to_nop): New function.
2750 * gold.cc (queue_middle_tasks): Give an error if mixing
2751 split-stack and non-split-stack objects with -r.
2752 * i386.cc (Target_i386::relocate_section): Add
2753 reloc_symbol_changes parameter.
2754 (Target_i386::do_calls_non_split): New function.
2755 * x86_64.cc (Target_x86_64::relocate_section): Add
2756 reloc_symbol_changes parameter.
2757 (Target_x86_64::do_calls_non_split): New function.
2758 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
2759 parameter.
2760 * powerpc.cc (Target_powerpc::relocate_section): Add
2761 reloc_symbol_changes parameter.
2762 * sparc.cc (Target_sparc::relocate_section): Add
2763 reloc_symbol_changes parameter.
2764 * configure.ac: Call AM_CONDITIONAL for the default target.
2765 * configure: Rebuild.
2766 * testsuite/Makefile.am (TEST_AS): New variable.
2767 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
2768 (check_DATA): Add split_i386 and split_x86_64 files.
2769 (SPLIT_DEFSYMS): Define.
2770 (split_i386_[1234n].o): New targets.
2771 (split_i386_[124]): New targets.
2772 (split_i386_[1234r].stdout): New targets.
2773 (split_x86_64_[1234n].o): New targets.
2774 (split_x86_64_[124]): New targets.
2775 (split_x86_64_[1234r].stdout): New targets.
2776 (MOSTLYCLEANFILES): Add new executables.
2777 * testsuite/split_i386.sh: New file.
2778 * testsuite/split_x86_64.sh: New file.
2779 * testsuite/split_i386_1.s: New file.
2780 * testsuite/split_i386_2.s: New file.
2781 * testsuite/split_i386_3.s: New file.
2782 * testsuite/split_i386_4.s: New file.
2783 * testsuite/split_i386_n.s: New file.
2784 * testsuite/split_x86_64_1.s: New file.
2785 * testsuite/split_x86_64_2.s: New file.
2786 * testsuite/split_x86_64_3.s: New file.
2787 * testsuite/split_x86_64_4.s: New file.
2788 * testsuite/split_x86_64_n.s: New file.
2789 * testsuite/testfile.cc (Target_test): Update relocation_section
2790 function.
2791 * testsuite/Makefile.in: Rebuild.
2792
e8a9fcda
ILT
27932009-10-06 Ian Lance Taylor <iant@google.com>
2794
2795 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
2796 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
2797 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
2798 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
2799 the address on ldo_addrs_.
2800 (Target_i386::Relocate::fix_up_ldo): New function.
2801
e99daf92
ILT
28022009-10-06 Rafael Espindola <espindola@google.com>
2803
2804 * plugin.cc (add_input_library): New.
2805 (Plugin::load): Add add_input_library to tv.
2806 (Plugin_manager::add_input_file): Add the is_lib argument.
2807 (add_input_file): Update call to Plugin_manager::add_input_file.
2808 (add_input_library): New.
2809 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
2810
966d4097
DK
28112009-09-30 Doug Kwan <dougkwan@google.com>
2812
2813 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
2814 symbol and call Symbol::may_need_copy_reloc to determine if
2815 a copy reloc is needed.
2816 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
2817 nocopyreloc is given in command line.
2818 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
2819 given in command line.
2820 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
2821 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
2822 of the removed Target_i386::may_need_copy_reloc.
2823 * options.h (copyreloc): New option with default value false.
2824 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
2825 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
2826 instead of the removed Target_powerpc::may_need_copy_reloc.
2827 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
2828 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
2829 instead of the removed Target_sparc::may_need_copy_reloc.
2830 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
2831 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
2832 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
2833 instead of the removed Target_x86_64::may_need_copy_reloc.
2834
029ba973
ILT
28352009-09-30 Ian Lance Taylor <iant@google.com>
2836
2837 * object.h (class Object): Remove target_ field, and target,
2838 sized_target, and set_target methods.
2839 (Object::sized_target): Remove.
2840 (class Sized_relobj): Update declarations. Remove sized_target.
2841 * object.cc (Sized_relobj::setup): Remove target parameter.
2842 Change all callers.
2843 (Input_objects::add_object): Don't do anything with the target.
2844 (make_elf_sized_object): Add punconfigured parameter. Change all
2845 callers. Set or test parameter target.
2846 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
2847 Change all callers.
2848 * parameters.cc (Parameters::set_target): Change parameter type to
2849 be non-const.
2850 (Parameters::default_target): Remove.
2851 (set_parameters_target): Change parameter type to be non-const.
2852 (parameters_force_valid_target): New function.
2853 (parameters_clear_target): New function.
2854 * parameters.h (class Parameters): Update declarations. Remove
2855 default_target method. Add sized_target and clear_target
2856 methods. Change target_ to be non-const.
2857 (set_parameters_target): Update declaration.
2858 (parameters_force_valid_target): Declare.
2859 (parameters_clear_target): Declare.
2860 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
2861 as NULL if we aren't searching.
2862 (Add_symbols::run): Don't check for compatible target.
2863 * fileread.cc (Input_file::open_binary): Call
2864 parameters_force_valid_target.
2865 * gold.cc (queue_middle_tasks): Likewise.
2866 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
2867 set_target on object.
2868 * dynobj.h (class Sized_dynobj): Update declarations.
2869 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
2870 make_elf_object returns NULL.
2871 (Archive::include_member): Don't check whether object target is
2872 compatible.
2873 * output.cc (Output_section::add_input_section): Get target from
2874 parameters.
2875 (Output_section::relax_input_section): Likewise.
2876 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
2877 parameters.
2878 (Sized_relobj::do_scan_relocs): Likewise.
2879 (Sized_relobj::relocate_sections): Likewise.
2880 * resolve.cc (Symbol_table::resolve): Likewise.
2881 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
2882 parameter. Change all callers.
2883 (Symbol_table::add_from_object): Get target from parameters.
2884 (Symbol_table::add_from_relobj): Don't check object target.
2885 (Symbol_table::add_from_dynobj): Likewise.
2886 (Symbol_table::define_special_symbol): Get target from
2887 parameters.
2888 * symtab.h (class Symbol_table): Update declaration.
2889 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
2890 parameter. Change all callers. Clear parameter target.
2891 (Binary_test): Test target here.
2892 * testsuite/object_unittest.cc (gold_testsuite): Remove
2893 target_test_pointer parameter. Change all callers.
2894 (Object_test): Test target here.
2895
a6a22b83
ILT
28962009-09-26 Ian Lance Taylor <iant@google.com>
2897
2898 * testsuite/initpri1.c: Don't try to use constructor priorities if
2899 compiling with gcc before 4.3.
2900
6a8f49fe
ILT
29012009-09-22 Mikolaj Zalewski <mikolajz@google.com>
2902
2903 * testsuite/retain_symbols_file_test.sh (check_present): Change
2904 output file name to retain_symbols_file_test.stdout.
2905 (check_absent): Likewise.
2906
8c604651
CS
29072009-09-18 Craig Silverstein <csilvers@google.com>
2908
2909 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
2910 * options.cc: Include <cerrno> and <fstream>.
2911 (General_options::finalize): Parse -retain-symbols-file tag.
2912 * options.h: New flag.
2913 (General_options): New method should_retain_symbol, new
2914 variable symbols_to_retain.
2915 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
2916 should_retain_symbol map.
2917 * testsuite/Makefile.am (retain_symbols_file_test): New test.
2918 * testsuite/Makefile.in: Regenerate.
2919 * testsuite/retain_symbols_file_test.sh: New file.
2920
ca58b19f
NC
29212009-09-18 Nick Clifton <nickc@redhat.com>
2922
2923 * po/es.po: Updated Spanish translation.
2924
20e6d0d6
DK
29252009-09-17 Doug Kwan <dougkwan@google.com>
2926
2927 * debug.h (DEBUG_RELAXATION): New constant.
2928 (DEBUG_ALL): Add DEBUG_RELAXATION.
2929 (debug_string_to_enum): Add relaxation debug option.
2930 * layout.cc
2931 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
2932 Layout::Relaxation_debug_check::read_sections,
2933 Layout::Relaxation_debug_check::read_sections): New method definitions.
2934 (Layout::Layout): Initialize data members
2935 record_output_section_data_from_scrips_,
2936 script_output_section_data_list_ and relaxation_debug_check_.
2937 (Layout::save_segments, Layout::restore_segments,
2938 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
2939 Layout::relaxation_loop_body): New method definitions.
2940 (Layout::finalize): Support relaxation. Move section layout code to
2941 Layout::relaxation_loop_body.
2942 (Layout::set_asection_address_from_script): Move code for orphan
2943 section placement out.
2944 (Layout::place_orphan_sections_in_script): New method definition.
2945 * layout.h (Output_segment_headers, Output_file_header):
2946 New forward class declarations.
2947 (Layout::~Layout): Define.
2948 (Layout::new_output_section_data_from_script): New method definition.
2949 (Layout::place_orphan_sections_in_script): New method declaration.
2950 (Layout::Segment_states): New type declaration.
2951 (Layout::save_segments, Layout::restore_segments,
2952 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
2953 Layout::relaxation_loop_body): New method declarations.
2954 (Layout::Output_section_data_list): New type declaration.
2955 (Layout::Relaxation_debug_check): New class definition.
2956 (Layout::record_output_section_data_from_script_,
2957 Layout::script_output_section_data_list_, Layout::segment_states_,
2958 Layout::relaxation_debug_check_): New data members.
2959 * output.cc: (Output_section_headers::do_size): New method definition.
2960 (Output_section_headers::Output_section_headers): Move size
2961 computation to Output_section_headers::do_size.
2962 (Output_segment_headers::do_size): New method definition.
2963 (Output_file_header::Output_file_header): Move size computation to
2964 Output_file_header::do_size and call it.
2965 (Output_file_header::do_size): New method definition.
2966 (Output_data_group::Output_data_group): Adjust call to
2967 Output_section_data.
2968 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
2969 (Output_symtab_xindex::do_write): Add array bound check.
2970 (Output_section::Input_section::print_to_mapfile): Handle
2971 RELAXED_INPUT_SECTION_CODE.
2972 (Output_section::Output_section): Initialize data member checkpoint_.
2973 (Output_section::~Output_section): Delete checkpoint object pointed
2974 by checkpoint_.
2975 (Output_section::add_input_section): Always add an Input_section if
2976 relaxing.
2977 (Output_section::add_merge_input_section): Add assert.
2978 (Output_section::relax_input_section): New method definition.
2979 (Output_section::set_final_data_size): Set load address to zero for
2980 an unallocated section.
2981 (Output_section::do_address_and_file_offset_have_reset_values):
2982 New method definition.
2983 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
2984 Handle relaxed input section.
2985 (Output_section::sort_attached_input_sections): Checkpoint input
2986 section list lazily.
2987 (Output_section::get_input_sections): Change type of input_sections to
2988 list of Simple_input_section pointers. Checkpoint input section list
2989 lazily. Also handle relaxed input sections.
2990 (Output_section::add_input_section_for_script): Take a reference to
2991 a Simple_input_section object instead of Relobj pointer and section
2992 index as parameter. Handle relaxed input sections.
2993 (Output_section::save_states, Output_section::restore_states): New
2994 method definitions.
2995 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
2996 (Output_data::is_data_size_fixed): New method definition.
2997 (Output_data::reset_addresss_and_file_offset): Do not reset data size
2998 if it is fixed.
2999 (Output_data::address_and_file_offset_have_reset_values): New method
3000 definition.
3001 (Output_data::do_address_and_file_offset_have_reset_values): New method
3002 definition.
3003 (Output_data::set_data_size): Check that data size is not fixed.
3004 (Output_data::fix_data_size): New method definition.
3005 (Output_data::is_data_size_fixed_): New data member.
3006 (Output_section_headers::set_final_data_size): New method definition.
3007 (Output_section_headers::do_size): New method declaration.
3008 (Output_segment_headers::set_final_data_size): New method definition.
3009 (Output_segment_headers::do_size): New method declaration.
3010 (Output_file_header::set_final_data_size)::New method definition.
3011 (Output_file_header::do_size)::New method declaration.
3012 (Output_section_data::Output_section_data): Add new parameter
3013 is_data_size_fixed and use it to fix data size.
3014 (Output_data_const::Output_data_const): Adjust call to base class
3015 constructor and fix data size.
3016 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
3017 base class constructor and fix data size.
3018 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
3019 base class constructor and fix data size.
3020 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
3021 class constructor and fix data size.
3022 (Output_data_group::set_final_data_size): New method definition.
3023 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
3024 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
3025 class constructor and fix data size.
3026 (Output_relaxed_input_section): New class definition.
3027 (Output_section::Simple_input_section): New class definition.
3028 (Output_section::get_input_sections): Adjust parameter list.
3029 (Output_section::add_input_section_for_script): Same.
3030 (Output_section::save_states, Output_section::restore_states,
3031 Output_section::do_address_and_file_offset_have_reset_values,
3032 (Output_section::Input_section::Input_section): Handle
3033 RELAXED_INPUT_SECTION_CODE. Add new overload for
3034 Output_relaxed_input_section.
3035 (Output_section::Input_section::is_input_section,
3036 Output_section::Input_section::set_output_section): Handle relaxed
3037 input section.
3038 (Output_section::Input_section::is_relaxed_input_section,
3039 Output_section::Input_section::output_section_data,
3040 Output_section::Input_section::relaxed_input_section): New method
3041 definitions.
3042 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
3043 value.
3044 (Output_section::Input_section::u1_): Update comments.
3045 (Output_section::Input_section::u2_): Add new union member poris.
3046 (Output_section::Checkpoint_output_section): New classs definition.
3047 (Output_section::relax_input_section): New method declaration.
3048 (Output_section::checkpoint_): New data member.
3049 (Output_segment): Update comments.
3050 (Output_segment::Output_segment): Un-privatize copy constructor.
3051 (Output_segment::operator=): Un-privatize.
3052 * script-sections.cc (Output_section_element::Input_section_list):
3053 Change element type to Output_section::Simple_input_section.
3054 (Output_section_element_dot_assignment::set_section_addresses):
3055 Register output section data for relaxation clean up.
3056 (Output_data_exression::Output_data_expression): Adjust call to base
3057 constructor to fix data size.
3058 (Output_section_element_data::set_section_addresses): Register
3059 Output_data_expression object for relaxation clean up.
3060 (struct Input_section_info): Replace Relobj pointer and section index
3061 pair with Output_section::Simple_input_section and Convert struct to a
3062 class.
3063 (Input_section_sorter::operator()): Adjust access to
3064 Input_section_info data member to use accessors.
3065 (Output_section_element_input::set_section_addresses): Use layout
3066 parameter. Adjust code to use Output_section::Simple_input_section
3067 and Input_secction_info classes. Register filler for relaxation
3068 clean up.
3069 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
3070 and section index pair with Output_section::Simple_input_section
3071 class. Adjust code accordingly.
3072 (Phdrs_element::release_segment): New method definition.
3073 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
3074 segment list.
3075 (Script_sections::release_segments): New method definition.
3076 * gold/script-sections.h (Script_sections::release_segments): New
3077 method declaration.
3078 * gold/target.h (Target::may_relax, Target::relax,
3079 Target::do_may_relax, Target::do_relax): New method definitions.
3080
5e445df6
ILT
30812009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3082
3083 * arm.cc (has_signed_unsigned_overflow): New function.
3084 (Arm_relocate_functions::abs8): New function.
3085 (Target_arm::Scan::local): Handle R_ARM_ABS8.
3086 (Target_arm::Scan::global): Likewise.
3087 (Target_arm::relocate::relocate): Likewise.
3088 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
3089 Likewise.
3090
8c604651 30912009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
3092
3093 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
3094 * testsuite/Makefile.in: Regenerate.
3095
1e9cc1c2
NC
30962009-09-11 Nick Clifton <nickc@redhat.com>
3097
3098 * po/gold.pot: Updated by the Translation project.
3099
6a89f575
CC
31002009-09-08 Cary Coutant <ccoutant@google.com>
3101
3102 * output.cc (Output_file::open): Add execute permission to empty file.
3103 * testsuite/Makefile.am (permission_test): New test.
3104 * testsuite/Makefile.in: Regenerate.
3105
fdcac5af
ILT
31062009-09-02 Ian Lance Taylor <iant@google.com>
3107
3108 * output.cc (Output_file::resize): Call map_no_anonymous rather
3109 than map.
3110
44453f85
ILT
31112009-09-01 Mikolaj Zalewski <mikolajz@google.com>
3112
3113 * gold.cc: Include "incremental.h".
3114 (queue_initial_tasks): Call Incremental_checker methods.
3115 * incremental.cc: Include "output.h".
3116 (Incremental_checker::can_incrementally_link_output_file): New
3117 method.
3118 * incremental.h (Incremental_checker): New class.
3119
3120 * output.cc (Output_file::open_for_modification): New method.
3121 (Output_file::map_anonymous): Changed return type to bool. Record
3122 map in base_ field.
3123 (Output_file::map_no_anonymous): New method, broken out of map.
3124 (Output_file::map): Use map_no_anonymous and map_anonymous.
3125 * output.h (class Output_file): Update declarations.
3126
293c1386
CC
31272009-08-24 Cary Coutant <ccoutant@google.com>
3128
3129 * options.h (Command_line::Pre_options): New class.
3130 (Command_line::pre_options): New member.
3131 * options.cc (gold::options::ready_to_register): New variable.
3132 (One_option::register_option): Do nothing if not registering options.
3133 Assert if same short option registered twice.
3134 (General_options::General_options): Turn off option registration when
3135 done constructing.
3136 (Command_line::Pre_options::Pre_options): New constructor.
3137
f773f3d2
CC
31382009-08-24 Cary Coutant <ccoutant@google.com>
3139
06a73cfe
CC
3140 * options.h (General_options::no_keep_memory): Remove incorrect
3141 short option.
f773f3d2 3142
a15af8e2
RW
31432009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3144
3145 * Makefile.am (am__skiplex, am__skipyacc): New.
3146 * Makefile.in: Regenerate.
3147
c462b41b
RW
31482009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3149
14ec8efd
RW
3150 * Makefile.am (AM_CPPFLAGS): Renamed from ...
3151 (INCLUDES): ... this.
3152 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
3153 (AM_CPPFLAGS): Renamed from ...
3154 (INCLUDE): ... this.
3155 * Makefile.in, testsuite/Makefile.in: Regenerate.
3156
81ecdfbb
RW
3157 * Makefile.in: Regenerate.
3158 * aclocal.m4: Likewise.
3159 * config.in: Likewise.
3160 * configure: Likewise.
3161 * testsuite/Makefile.in: Likewise.
3162
c462b41b
RW
3163 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
3164 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
3165 * Makefile.in: Regenerate.
3166 * testsuite/Makefile.in: Regenerate.
3167
2da73f13
CC
31682009-08-19 Cary Coutant <ccoutant@google.com>
3169
3170 * resolve.cc (Symbol_table::resolve): Don't complain about defined
3171 symbols in shared libraries overridden by hidden or internal symbols
3172 in the main program.
3173
2db70501
CD
31742009-08-19 Chris Demetriou <cgd@google.com>
3175
3176 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
3177 checking source file names in error messages.
3178
f733487b
DK
31792009-08-18 Doug Kwan <dougkwan@google.com>
3180
3181 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
3182 an elcpp::Ehdr as parameter. Adjust call to set_target.
3183 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
3184 an elfcpp::Ehdr as parameter.
3185 * object.cc (Object::set_target): Remove the version that looks up
3186 a target and sets it.
3187 (Sized_relobj::setup): Take a Target object instead of
3188 an elfcpp::Ehdr as parameter. Adjust call to set_target.
3189 (make_elf_sized_object): Find target and ask target to
3190 make an ELF object.
3191 * object.h: (Object::set_target): Remove the version that looks up
3192 a target and sets it.
3193 (Sized_relobj::setup): Take a Target object instead of
3194 an elfcpp:Ehdr as parameter.
3195 * target.cc: Include dynobj.h.
3196 (Target::do_make_elf_object_implementation): New.
3197 (Target::do_make_elf_object): New.
3198 * target.h (Target::make_elf_object): New template declaration.
3199 (Target::do_make_elf_object): New method declarations.
3200 (Target::do_make_elf_object_implementation): New template declaration.
3201
cc70f101
ILT
32022009-08-14 Ian Lance Taylor <iant@google.com>
3203
3204 * gold.h (FUNCTION_NAME): Define.
3205 (gold_unreachable): Use FUNCTION_NAME.
3206
ef5e0cb1
ST
32072009-08-12 Sriraman Tallam <tmsriram@google.com>
3208
3209 * icf.cc (Icf::find_identical_sections): Issue a warning when a
3210 symbol in the --keep-unique list is not found.
3211
48c187ce
ST
32122009-08-12 Sriraman Tallam <tmsriram@google.com>
3213
3214 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
3215 been maked as --keep-unique.
3216 (Icf::unfold_section): New function.
3217 * icf.h (Icf::unfold_section): New function.
3218 * options.h (General_options::keep_unique): New option.
3219 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
3220 * testsuite/Makefile.in: Regenerate.
3221 * testsuite/icf_keep_unique_test.sh: New file.
3222 * testsuite/icf_keep_unique_test.cc: New file.
3223
645afe0c
CC
32242009-08-12 Cary Coutant <ccoutant@google.com>
3225
3226 PR 10471
3227 * resolve.cc (Symbol_table::resolve): Check for references from
3228 dynamic objects to hidden and internal symbols.
3229 * testsuite/Makefile.am (hidden_test.sh): New test.
3230 * testsuite/Makefile.in: Regenerate.
3231 * testsuite/hidden_test.sh: New script.
3232 * testsuite/hidden_test_1.c: New test source.
3233 * testsuite/hidden_test_main.c: New test source.
3234
11af873f
DK
32352009-08-11 Doug Kwan <dougkwan@google.com>
3236
3237 * arm.cc: Update comments.
3238 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
3239 segment to locate the .ARM.exidx section if present.
3240
b9f7d72d
DK
32412009-08-09 Doug Kwan <dougkwan@google.com>
3242
3243 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
3244 patch.
3245
ddd3c53c
ST
32462009-08-07 Sriraman Tallam <tmsriram@google.com>
3247 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
3248 compiler warnings.
3249
27721062
ST
32502009-08-06 Sriraman Tallam <tmsriram@google.com>
3251
3252 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
3253 valid tls_segment only for non-debug-section relocations.
3254 * testsuite/Makefile.am: Add gc_tls_test.
3255 * testsuite/Makefile.in: Regenerate.
3256 * testsuite/gc_tls_test.cc: New file.
3257 * testsuite/gc_tls_test.sh: New file.
3258
ef15dade
ST
32592009-08-05 Sriraman Tallam <tmsriram@google.com>
3260
3261 * icf.cc: New file.
3262 * icf.h: New file.
3263 * Makefile.am (CCFILES): Add icf.cc.
3264 (HFILES): Add icf.h
3265 * Makefile.in: Regenerate.
3266 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
3267 * gc.h (gc_process_relocs): Populate lists used by icf to contain
3268 section, symbol and addend information for the relocs.
3269 * gold.cc (queue_middle_tasks): Call identical code folding.
3270 * gold.h: Add defines for multimap.
3271 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
3272 to the call of finalize_local_symbols.
3273 * main.cc (main): Create object of class Icf.
3274 * object.cc (Sized_relobj::do_layout): Allow this function to be
3275 called twice during icf.
3276 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
3277 to sections marked as identical by icf.
3278 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
3279 when available.
3280 (Sized_relobj::do_section_entsize): New function.
3281 * object.h (Object::section_entsize): New function.
3282 (Object::do_section_entsize): New pure virtual function.
3283 (Relobj::finalize_local_symbols): Add new parameter.
3284 (Relobj::do_section_entsize): New function.
3285 * options.h (General_options::icf): New option.
3286 (General_options::icf_iterations): New option.
3287 (General_options::print_icf_sections): New option.
3288 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
3289 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
3290 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
3291 icf.
3292 * symtab.cc (Symbol_table::is_section_folded): New function.
3293 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
3294 to sections marked as identical by icf.
3295 * symtab.h (Symbol_table::set_icf): New function.
3296 (Symbol_table::icf): New function.
3297 (Symbol_table::is_section_folded): New function.
3298 (Symbol_table::icf_): New data member.
3299 * target-reloc.h (relocate_section): Ignore sections folded by icf.
3300 * testsuite/Makefile.am: Add commands to build icf_test.
3301 * testsuite/Makefile.in: Regenerate.
3302 * testsuite/icf_test.sh: New file.
3303 * testsuite/icf_test.cc: New file.
3304
c3b65ac4
CD
33052009-07-24 Chris Demetriou <cgd@google.com>
3306
3307 * layout.cc (is_compressible_debug_section): Fix incorrect
3308 comment about compressed section names.
3309
1caf2c51
ILT
33102009-07-20 Ian Lance Taylor <ian@airs.com>
3311
3312 PR 10419
3313 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
3314
1ef4d87f
ILT
33152009-07-16 Ian Lance Taylor <iant@google.com>
3316
3317 PR 10400
3318 * layout.h: #include <map>.
3319 (class Kept_section): Change from struct to class. Add accessors
3320 and setters. Add section size to Comdat_group mapping. Change
3321 Comdat_group to std::map. Add is_comdat_ field. Add
3322 linkonce_size field in union.
3323 (class Layout): Update declaration of find_or_add_kept_section.
3324 Don't declare find_kept_object.
3325 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
3326 parameter. Add object, shndx, is_comdat, and is_group_name
3327 parameters. Change all callers. Adjust for new Kept_section.
3328 (Layout::find_kept_object): Remove.
3329 * object.cc (Sized_relobj::include_section_group): Update use of
3330 Kept_section. Rename secnum to shndx. Only record
3331 Kept_comdat_section if sections are the same size.
3332 (Sized_relobj::include_linkonce_section): Update use of
3333 Kept_section. Only record Kept_comdat_section if sections are the
3334 same size. Set size of linkonce section.
3335 (Sized_relobj::map_to_kept_section): Update call to
3336 get_kept_comdat_section.
3337 * object.h (class Sized_relobj): Rename fields in
3338 Kept_comdat_section to drop trailing underscores; change object
3339 field to Relobj*. Change Kept_comdat_section_table to store
3340 struct rather than pointer.
3341 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
3342 Add kept_object and kept_shndx parameters. Change all callers.
3343 (Sized_relobj::get_kept_comdat_section): Change return type to
3344 bool. Add kept_object and kept_shndx parameters. Change all
3345 callers.
3346 * plugin.cc (Pluginobj::include_comdat_group): Update call to
3347 Layout::find_or_add_kept_section.
3348
37c3b7b0
ILT
33492009-07-09 Ian Lance Taylor <iant@google.com>
3350
3351 * merge.cc (Object_merge_map::initialize_input_to_output_map):
3352 Reserve space in the hash table.
3353
98fa85cb
ILT
33542009-07-06 Mikolaj Zalewski <mikolajz@google.com>
3355
3356 * fileread.cc (File_read::get_mtime): New method.
3357 * fileread.h (Timespec): New structure.
3358 (File_read::get_mtime): New method.
3359 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
3360 Renamed from timestamp_nsec.
3361 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
3362 Elf_Xword.
3363 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
3364 timestamp_nsec.
3365 (Incremental_inputs::report_archive): Save mtime; style fix.
3366 (Incremental_inputs::report_obejct): Save mtime; style fix.
3367 (Incremental_inputs::report_script): Save mtime; style fix.
3368 (Incremental_inputs::finalize_inputs): Style fix.
3369 (Incremental_inputs::finalize): Style fix.
3370 (Incremental_inputs::create_input_section_data): Store inputs
3371 mtime.
3372 * incremental.h (Incremental_inputs::report_script): Add mtime
3373 argument.
3374 (Incremental_inputs::Input_info::Input_info): Intialize only one
3375 union member.
3376 (Incremental_inputs::Input_info::archive): Move to nameless
3377 union.
3378 (Incremental_inputs::Input_info::obejct): Move to nameless union.
3379 (Incremental_inputs::Input_info::script): Move to nameless union.
3380 (Incremental_inputs::mtime): New field.
3381 * script.cc (read_input_script): Pass file mtime to
3382 Incremental_input.
3383 * script.h (Script_info::inputs): Style fix.
3384
c9d70757
ILT
33852009-07-01 Ian Lance Taylor <ian@airs.com>
3386
3387 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
3388 instead of 32.
3389
9c547ec3
ILT
33902009-06-24 Ian Lance Taylor <iant@google.com>
3391
3392 PR 10156
3393 * layout.cc (Layout::choose_output_section): If we find an
3394 existing section, update the flags.
3395 (Layout::create_notes): New function, broken out of
3396 Layout::finalize.
3397 (Layout::finalize): Don't create note sections.
3398 (Layout::create_note): Don't crash if linker script discards
3399 section.
3400 (Layout::create_gold_note): Likewise.
3401 (Layout::create_build_id): Likewise. Don't set
3402 after_input_sections on the section.
3403 (Layout::create_executable_stack_info): Remove target parameter.
3404 Change caller.
3405 * layout.h (class Layout): Declare create_notes. Update
3406 declaration of create_executable_stack_info.
3407 * gold.cc (queue_middle_tasks): Call create_notes.
3408 * output.cc (Output_section::update_flags_for_input_section): Move
3409 here from output.h. If SHF_ALLOC flag is newly set, mark address
3410 invalid.
3411 * output.h (Output_data::mark_address_invalid): New function.
3412 (class Output_section): Only declare, not define,
3413 update_flags_for_input_section. Remove set_flags.
3414
55458500
ILT
34152009-06-24 Ian Lance Taylor <iant@google.com>
3416
3417 * script-sections.cc (Output_section_definition::
3418 set_section_addresses): Rename shadowing local load_address to
3419 laddr.
3420
1307d6cd
ILT
34212009-06-24 Ian Lance Taylor <iant@google.com>
3422
3423 PR 10244
3424 * reloc.cc (relocate_sections): Skip empty relocation sections.
3425
ec3f783e
ILT
34262009-06-23 Ian Lance Taylor <iant@google.com>
3427
3428 PR 10156
3429 * layout.cc (Layout::create_note): Use choose_output_section
3430 rather than make_output_section.
3431
459c9f1c
ILT
34322009-06-23 Ian Lance Taylor <iant@google.com>
3433
3434 PR 10237
3435 * options.cc (General_options::parse_V): Set printed_version_.
3436 (General_options::General_options): Initialize printed_version_.
3437 * options.h (class General_options): Add printed_version_ field.
3438 * gold.cc (queue_initial_tasks): If there are no input files,
3439 don't give a fatal error if we printed the version information.
3440 (queue_middle_tasks): If using -r with a shared object, give a
3441 fatal error rather than an ordinary error.
3442
1518dc8f
ILT
34432009-06-23 Ian Lance Taylor <iant@google.com>
3444
3445 PR 10219
3446 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
3447 (Layout::make_output_section): Set have_stabstr_section_ if we see
3448 a .stab*str section.
3449 (Layout::finalize): Call link_stabs_sections.
3450 (Layout::link_stabs_sections): New file.
3451 * layout.h (class Layout): Add have_stabstr_section_ field.
3452 Declare link_stabs_sections.
3453
3d857b98
DK
34542009-06-23 Doug Kwan <dougkwan@google.com>
3455
3456 * Makefile.am (libgold_a_LIBADD): New.
3457 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
3458 * Makefile.in: Regenerate.
3459 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
3460 * configure: Regenerate.
3461 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
3462 * fileread.cc: Include sys/state.h
3463 * gold.h: Declare memmem and strndup if found missing.
3464 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
3465
0639a6f6
ILT
34662009-06-23 Ian Lance Taylor <iant@google.com>
3467
3468 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
3469 * configure: Rebuild.
3470
8d63875c
ILT
34712009-06-23 Ian Lance Taylor <iant@google.com>
3472
3473 PR 10147
3474 * object.cc (Object::section_contents): Don't try to get a view if
3475 the section has length zero.
3476 (Object::handle_gnu_warning_section): If the section is empty, use
3477 the name of the section as the warning.
3478
f7c8a183
ILT
34792009-06-23 Ian Lance Taylor <iant@google.com>
3480
3481 PR 10133
3482 * stringpool.h (class Stringpool_template): Add optimize_ field.
3483 (Stringpool_template::set_optimize): New function.
3484 * stringpool.cc (Stringpool_template::Stringpool_template):
3485 Initialize optimize_ field.
3486 (Stringpool_template::set_string_offsets): Test local optimize
3487 fild rather than parameter.
3488 * layout.cc (Layout::Layout): Call set_optimize on the section
3489 name stringpool.
3490
e6a307ba
ILT
34912009-06-22 Ian Lance Taylor <iant@google.com>
3492
3493 PR 10030
3494 * yyscript.y: Parse TARGET.
3495 * script.cc (script_set_target): New function.
3496 * script-c.h (script_set_target): Declare.
3497 * options.cc (General_options::string_to_object_format): Rename
3498 from string_to_object_format in anonymous namespace. Change
3499 callers.
3500 * options.h (class General_options): Declare
3501 string_to_object_format.
3502
3ee173de
ILT
35032009-06-22 Ian Lance Taylor <iant@google.com>
3504
3505 * script-sections.cc (Script_sections::create_segments): Don't put
3506 program headers in a PT_LOAD segment if -n or -N.
3507
35082009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
3509
3510 PR 10141
3511 * options.h (class General_options): Add -z lazy and -z now. Sort
3512 -z options into alphabetical order.
3513 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
3514
cd6739a1 35152009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
3516
3517 * layout.cc (Layout::make_output_section): Call
3518 Target::new_output_section.
3519 (Layout::attach_allocated_section_to_segment): Put large section
3520 sections in a separate load segment with the large segment flag
3521 set.
3522 (Layout::segment_precedes): Sort large data segments after other
3523 load segments.
3524 (align_file_offset): New static function.
3525 (Layout::set_segment_offsets): Use align_file_offset.
3526 * output.h (class Output_section): Add is_small_section_ and
3527 is_large_section_ fields.
3528 (Output_section::is_small_section): New function.
3529 (Output_section::set_is_small_section): New function.
3530 (Output_section::is_large_section): New function.
3531 (Output_section::set_is_large_section): New function.
3532 (Output_section::is_large_data_section): New function.
3533 (class Output_segment): Add is_large_data_segment_ field.
3534 (Output_segment::is_large_data_segment): New function.
3535 (Output_segment::set_is_large_data_segment): New function.
3536 * output.cc (Output_section::Output_section): Initialize new
3537 fields.
3538 (Output_segment::Output_segment): Likewise.
3539 (Output_segment::add_output_section): Add assertion that large
3540 data sections always go in large data segments. Force small data
3541 sections to the end of the list of data sections. Force small BSS
3542 sections to the start of the list of BSS sections. For large BSS
3543 sections to the end of the list of BSS sections.
3544 * symtab.h (class Symbol): Declare is_common_shndx.
3545 (Symbol::is_defined): Check Symbol::is_common_shndx.
3546 (Symbol::is_common): Likewise.
3547 (class Symbol_table): Define enum Commons_section_type. Update
3548 declarations. Add small_commons_ and large_commons_ fields.
3549 * symtab.cc (Symbol::is_common_shndx): New function.
3550 (Symbol_table::Symbol_table): Initialize new fields.
3551 (Symbol_table::add_from_object): Put small and large common
3552 symbols in the right list.
3553 (Symbol_table::sized_finalized_symbol): Check
3554 Symbol::is_common_shndx.
3555 (Symbol_table::sized_write_globals): Likewise.
3556 * common.cc (Symbol_table::do_allocate_commons): Allocate new
3557 common symbol lists. Don't call do_allocate_commons_list if the
3558 list is empty.
3559 (Symbol_table::do_allocate_commons_list): Remove is_tls
3560 parameter. Add comons_section_type parameter. Change all
3561 callers. Handle small and large common symbols.
3562 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
3563 Symbol::is_common_shndx.
3564 * resolve.cc (symbol_to_bits): Likewise.
3565 * target.h (Target::small_common_shndx): New function.
3566 (Target::small_common_section_flags): New function.
3567 (Target::large_common_shndx): New function.
3568 (Target::large_common_section_flags): New function.
3569 (Target::new_output_section): New function.
3570 (Target::Target_info): Add small_common_shndx, large_common_shndx,
3571 small_common_section_flags, and large_common_section_flags
3572 fields.
3573 (Target::do_new_output_section): New virtual function.
3574 * arm.cc (Target_arm::arm_info): Initialize new fields.
3575 * i386.cc (Target_i386::i386_info): Likewise.
3576 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
3577 Likewise.
3578 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
3579 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
3580 (Target_x86_64::do_new_output_section): New function.
3581 * configure.ac: Define conditional MCMODEL_MEDIUM.
3582 * testsuite/Makefile.am (check_PROGRAMS): Add large.
3583 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
3584 (large_LDFLAGS): Define.
3585 * testsuite/large.c: New file.
3586 * testsuite/testfile.cc (Target_test::test_target_info):
3587 Initialize new fields.
3588 * configure, testsuite/Makefile.in: Rebuild.
3589
bb04269c
DK
35902009-06-05 Doug Kwan <dougkwan@google.com>
3591
3592 * Makefile.am (CCFILES): Add target.cc.
3593 * Makefile.in: Regenerate.
3594 * i386.cc (class Target_i386): Define new virtual method to
3595 override do_is_local_label_name in parent.
3596 * object.cc (Sized_relobj::do_count_local_symbols): Discard
3597 local symbols if --discard-locals or -X is given.
3598 * options.h (class General_options): Declare new options
3599 '--discard-locals' and '-X' for discarding locals.
3600 * target.h (class Target): Define new methods is_local_label_name.
3601 Declare new virtual method do_is_local_label_name.
3602 * target.cc: New file.
3603 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
3604 (check_SCRIPTS): Add discard_locals_test.sh.
3605 (check_DATA): Add discard_local_tests.syms.
3606 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
3607 (discard_local_tests.syms, discard_locals_test.o): New make rules.
3608 * testsuite/Makefile.in: Regenerate.
3609 * testsuite/discard_locals_test.c: New file.
3610 * testsuite/discard_locals_test.sh: Same.
3611
805bb01c
DK
36122009-06-05 Doug Kwan <dougkwan@google.com>
3613
3614 * object.cc (Sized_relobj::Sized_relobj): Initialize
3615 discarded_eh_frame_shndx_ to -1U.
3616 (Sized_relobj::do_layout): Record index of a discard .eh_frame
3617 section.
3618 (Sized_relobj::do_count_local_symbols): Skip local symbols in
3619 a discarded .eh_frame section.
3620 (Sized_relobj::do_finalize_local_symbols): Ditto.
3621 * object.h (class Sized_relobj): Declare new member
3622 discarded_eh_frame_shndx_.
3623 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
3624 (local_labels_test.o, local_labels_test): New rules.
3625 * testsuite/Makefile.in: Regenerate.
3626
1dcd334d
DK
36272009-06-04 Doug Kwan <dougkwan@google.com>
3628
3629 * layout.cc (Layout::section_name_mapping): Add mapping for
3630 special ARM sections.
3631
96d49306
DK
36322009-06-03 Doug Kwan <dougkwan@google.com>
3633
3634 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
3635 (utils::has_overflow): Same.
3636
dff16297
ILT
36372009-06-03 Ian Lance Taylor <iant@google.com>
3638
3639 * layout.cc (Layout::section_name_mapping): New array, replacing
3640 Layout::linkonce_mapping.
3641 (Layout::section_name_mapping_count): New variable, replacing
3642 Layout::linkonce_mapping_count.
3643 (Layout::linkonce_output_name): Remove.
3644 (Layout::output_section_name): Rewrite.
3645 * layout.h (class Layout): Rename Linkonce_mapping to
3646 Section_name_mapping, linkonce_mapping to section_name_mapping,
3647 linkonce_mapping_count to section_name_mapping_count. Don't
3648 declare linkonce_output_name.
3649
c121c671
DK
36502009-06-03 Doug Kwan <dougkwan@google.com>
3651
3652 * gold/arm.cc (namespace utils): New.
3653 (Target_arm::reloc_is_non_pic): Define new method.
3654 (class Arm_relocate_functions): New.
3655 (Target_arm::Relocate::relocate): Handle relocation types used by
3656 Android.
3657
07800fab
ILT
36582009-06-03 Ian Lance Taylor <iant@google.com>
3659
3660 * arm.cc (Target_arm::scan::global): Use || instead of |.
3661
c121c671
DK
36622009-06-02 Doug Kwan <dougkwan@google.com>
3663
3664 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
3665 issued_non_pic_error_.
3666 (class Target_arm::Scan): Declare new method check_non_pic.
3667 Define new method symbol_needs_plt_entry.
3668 Declare new data member issued_non_pic_error_.
3669 (class Target_arm::Relocate): Declare new method
3670 should_apply_static_reloc.
3671 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
3672 (Target_arm::Scan::check_non_pic): Define new method.
3673 (Target_arm::Scan::local): Handle a small subset of reloc types used
3674 by Android.
3675 (Target_arm::Scan::local): Same.
3676 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
3677
b19b0c6d
ILT
36782009-05-31 Mikolaj Zalewski <mikolajz@google.com>
3679
3680 * incremental.cc (Incremental_inputs::report_command_line): Filter
3681 out --incremental-* options.
3682
94cdfcff
DK
36832009-05-29 Doug Kwan <dougkwan@google.com>
3684
3685 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
3686 template class.
3687 (class Target_arm): Update comment.
3688 (Target_arm::Target_arm): Initialize new data members GOT_,
3689 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
3690 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
3691 and Target_arm::rel_dyn_section.
3692 Declare new_enum Target_arm::Got_type.
3693 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
3694 and DYNBSS_.
3695 Update commments for member do_dynsym_value.
3696 (Target_arm::got_size, Target_arm::plt_section,
3697 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
3698 new methods inside class defintion.
3699 (Target_arm::got_section): Define new method.
3700 (Target_arm::rel_dyn_section): Same.
3701 (Output_data_plt_arm): New template class.
3702 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
3703 (Output_data_plt_arm:do_adjust_output_section): Define new method.
3704 (Output_data_plt_arm::add_entry): Same.
3705 (Output_data_plt_arm::first_plt_entry): Define new
3706 static data member for PLT instruction template.
3707 (Output_data_plt_arm::plt_entry): Same.
3708 (Output_data_plt_arm::do_write): Define new method.
3709 (Target_arm::make_plt_entry): Same.
3710 (Target_arm::do_finalize_sections): Same.
3711 (Target_arm::do_dynsym_value): Same.
3712
4a657b0d
DK
37132009-05-28 Doug Kwan <dougkwan@google.com>
3714
3715 * Makefile.am (TARGETSOURCES): Add arm.cc.
3716 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
3717 * Makefile.in: Regenerate.
3718 * arm.cc: New file.
3719 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
3720
e7ae8c36
DK
37212009-05-26 Doug Kwan <dougkwan@google.com>
3722
3723 * options.cc (General_options::parse_exclude_libs). Fix a comment.
3724 (General_options::check_excluded_libs): Strip off directories in
3725 archive name before matching like GNU ld does.
3726 * testsuite/Makefile.am (MOSTLYCLEANFILES,
3727 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
3728 (exclude_libs_test_LDFLAGS): Add linker option
3729 -Wl,--exclude-libs,libexclude_libs_test_3
3730 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
3731 an explicit archive without using -l.
3732 (alt/libexclude_libs_test_3.a): New make rule.
3733 * testsuite/Makefile.in: Regenerate.
3734 * testsuite/exclude_libs_test.c : Declare lib3_default().
3735 (main): Call it.
3736 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
3737 * exclude_libs_test_3.c: New file.
3738
f12e7348
NC
37392009-05-26 Nick Clifton <nickc@redhat.com>
3740
3741 * po/id.po: New Indonesian translation.
3742 * po/gold.pot: Updated template file.
3743
4daadc0d
ST
37442009-05-22 Sriraman Tallam <tmsriram@google.com>
3745
3746 * testsuite/Makefile.am: Add -ffunction-sections to compile
3747 gc_comdat_test files. Add -Wl,--gc-sections to build
3748 gc_comdat_test.
3749 * testsuite/Makefile.in: Regenerate.
3750 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
3751
531813ad
ST
37522009-05-21 Sriraman Tallam <tmsriram@google.com>
3753
3754 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
3755 kept comdat section was garbage collected.
3756 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
3757 * testsuite/Makefile.in: Regenerate.
3758 * testsuite/gc_comdat_test.sh: New file.
3759 * testsuite/gc_comdat_test_1.cc: New file.
3760 * testsuite/gc_comdat_test_2.cc: New file.
3761
65514900
CC
37622009-05-19 Doug Kwan <dougkwan@google.com>
3763
3764 * archive.cc (Archive::Archive): Move constructor from archive.h
3765 to here. Initialize no_export_.
3766 (Archive::get_elf_object_for_member): Set no_export flag of object.
3767 * archive.h (Archive::Archive): Move constructor body to
3768 archive.cc.
3769 (Archive::no_export): New method.
3770 (Archive::no_export_): New field.
3771 * object.h (Object::Object): Initialize no_export_ to false.
3772 (Object::no_export, Object::set_no_export): New methods.
3773 (Object::no_export_): New field.
3774 * options.cc (General_options::parse_exclude_libs): New method.
3775 (General_options::check_excluded_libs) Same.
3776 * options.h (exclude_libs): New option.
3777 (General_options::check_excluded_libs): New method declaration.
3778 (General_options::excluded_libs_): New field.
3779 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
3780 default or protected visibility if an object has no-export flag set.
3781 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
3782 (check_SCRIPTS): Add exclude_libs_test.sh.
3783 (check_DATA): Add exclude_libs_test.syms.
3784 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
3785 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
3786 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
3787 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
3788 (exclude_libs_test.syms, libexclude_libs_test_1.a,
3789 libexclude_libs_test_2.a): New rules.
3790 * testsuite/Makefile.in: Regenerate.
3791 * testsuite/exclude_libs_test.c: New file.
3792 * testsuite/exclude_libs_test.sh: Ditto.
3793 * testsuite/exclude_libs_test_1.c: Ditto.
3794 * testsuite/exclude_libs_test_2.c: Ditto.
3795
1b77ea50
ILT
37962009-05-15 Ian Lance Taylor <iant@google.com>
3797
3798 * configure.ac: Check for declarations for cases where libiberty.h
3799 checks HAVE_DECL_xxx.
3800 * configure, config.in: Rebuild.
3801
072fe7ce
ILT
38022009-05-15 Mikolaj Zalewski <mikolajz@google.com>
3803
3804 * gold.h (Incremental_argument_list): Remove (invalid) forward
3805 declaration.
3806 * incremental.cc (Incremental_inputs::report_achive): New method.
3807 (Incremental_inputs::report_object): New method.
3808 (Incremental_inputs::report_script): New method.
3809 (Incremental_inputs::finalize_inputs): New method.
3810 (Incremental_inputs::finalize): Call finalize_inputs().
3811 (Incremental_inputs::sized_create_incremental_inputs_section_data):
3812 Create inputs entries.
3813 * incremental.h (Incremental_input_type): New enum.
3814 (Incremental_inputs::Incremental_input): Initialize new fields.
3815 (Incremental_inputs::report_inputs): New method.
3816 (Incremental_inputs::report_achive): New method.
3817 (Incremental_inputs::report_object): New method.
3818 (Incremental_inputs::report_script): New method.
3819 (Incremental_inputs::finalize_inputs): New method.
3820 (Incremental_inputs::Input_info): New struct.
3821 (Incremental_inputs::Input_info_map): New typedef.
3822 (Incremental_inputs::lock_): New field.
3823 (Incremental_inputs::Inputs_): New field.
3824 (Incremental_inputs::Inputs_map): New field.
3825 * main.cc (main): Call Incremental_input::report_inputs.
3826 * options.h (Input_argument_list): Typedef moved from
3827 Input_arguments.
3828 (Input_file_group::Files): Remove, use ::Input_argument_list.
3829 (Input_file_group::Input_argument_list): Remove, use
3830 ::Input_argument_list.
3831 * plugin.cc (Plugin_manager::add_input_file): Add error in
3832 incremental build.
3833 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
3834 functions.
3835 * script.cc (read_input_script): Call
3836 Incremental_input::report_script.
3837 * script.h (Script_info): New class.
3838
b0481b0b
ILT
38392009-04-27 Ian Lance Taylor <iant@google.com>
3840
3841 * x86_64.cc (do_adjust_output_section): Set entsize to
3842 plt_entry_size.
3843
b22a5a41 38442009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
3845
3846 * output.cc (Output_file::close): After short writes, continue
3847 writing from the correct offset in the buffer being written.
3848
40fde488
CD
38492009-04-23 Chris Demetriou <cgd@google.com>
3850
3851 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
3852 * configure: Regenerate.
3853 * config.in: Regenerate.
3854 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
3855 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
3856
3ce2c28e
ILT
38572009-04-21 Mikolaj Zalewski <mikolajz@google.com>
3858
3859 * incremental.cc (Incremental_inputs_header_data): Renamed from
3860 Incremental_input_header_data.
3861 (Incremental_inputs_header_data::data_size): New field.
3862 (Incremental_inputs_header_data::put_input_file_count): Renamed
3863 from input_file_count.
3864 (Incremental_inputs_header_data::put_command_line_offset): Renamed
3865 from command_line_offset.
3866 (Incremental_inputs_header_data::put_reserved): Renamed from
3867 put_reserved.
3868 (Incremental_inputs_entry_data): Renamed from
3869 Incremental_input_entry_data.
3870 (Incremental_inputs_entry_data::data_size): New field.
3871 (Incremental_inputs::report_command_line): New method.
3872 (Incremental_inputs::finalize): New method.
3873 (Incremental_inputs::create_incremental_inputs_data): New method.
3874 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
3875 * incremental.h: New file.
3876 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
3877 (Layout::finalize): Create incremental inputs section in
3878 incremental builds.
3879 (Layout::create_incremental_info_sections): New method.
3880 * layout.h (Layout::incremental_inputs): New method.
3881 (Layout::create_incremental_info_sections): New method.
3882 (Layout::incremental_inputs_): New field.
3883 * main.cc (main): Notify Incremental_input of the command line.
3884
e55bde5e
ILT
38852009-04-01 Ian Lance Taylor <iant@google.com>
3886 Mikolaj Zalewski <mikolajz@google.com>
3887
3888 * gold.h (reserve_unordered_map): Define, three versions, one for
3889 each version of Unordered_map.
3890 * layout.cc (Layout::Layout): Remove options parameter. Add
3891 number_of_input_files parameter. Don't initialize options_.
3892 Initialize number_of_input_files_ and resized_signatures_. Move
3893 sections_are_attached_.
3894 (Layout::layout_group): Reserve space for group_signatures_.
3895 (Layout::find_or_add_kept_section): Change name parameter to be a
3896 reference. Resize signatures_ map when it gets large enough.
3897 (Layout::layout_eh_frame): Use parameters->options() instead of
3898 this->options_.
3899 (Layout::make_output_section): Likewise.
3900 (Layout::attach_allocated_section_to_segment): Likewise.
3901 (Layout::finalize, Layout::create_executable_stack): Likewise.
3902 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
3903 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
3904 * layout.h (class Layout): Update declarations. Remove options_
3905 field. Add number_of_input_files_ and resized_signatures_
3906 fields. Move sections_are_attached_ field.
3907 * main.cc (main): Pass number of input files to Layout
3908 constructor. Don't pass options.
3909
154b857c
ILT
39102009-03-30 Ian Lance Taylor <iant@google.com>
3911
3912 * ffsll.c (ffsll): Correct implementation.
3913
2f35ab9b
ILT
39142009-03-27 Ian Lance Taylor <iant@google.com>
3915
fd03461a
ILT
3916 * ffsll.c: New file.
3917 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
3918 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
3919 * ftruncate.c (ftruncate): Declare before definition.
3920 * mremap.c (mremap): Likewise.
3921 * pread.c (pread): Likewise.
3922 * configure, Makefile.in, config.in: Rebuild.
3923
2f35ab9b
ILT
3924 * mremap.c: New file.
3925 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
3926 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
3927 (mremap): Declare if HAVE_MREMAP is not defined.
3928 * configure, Makefile.in, config.in: Rebuild.
3929
33aea2fd
CC
39302009-03-27 Cary Coutant <ccoutant@google.com>
3931
3932 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
3933 position independent.
3934 * sparc.cc (Target_sparc::check_non_pic): Likewise.
3935 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
3936
6d479619
CC
39372009-03-24 Cary Coutant <ccoutant@google.com>
3938
3939 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
3940 an executable.
3941 (needs_dynamic_reloc): Likewise.
3942
afc06bb8
ILT
39432009-03-24 Ian Lance Taylor <iant@google.com>
3944
3945 * yyscript.y (file_cmd): Recognize EXTERN.
3946 (extern_name_list, extern_name_list_body): New nonterminals.
3947 * script.cc (script_add_extern): Define.
3948 * script-c.h (script_add_extern): Declare.
3949
f6060a4d
ILT
39502009-03-24 Rafael Avila de Espindola <espindola@google.com>
3951
3952 * object.cc (is_elf_object): Define.
3953 * object.h (is_elf_object): Declare.
3954 * archive.cc (Archive::get_elf_object_for_member): Call
3955 is_elf_object.
33aea2fd 3956 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 3957
26736d8e
ILT
39582009-03-24 Elliott Hughes <enh@google.com>
3959
3960 * output.cc (Output_file::map_anonymous): Define.
3961 (Output_file::map): Use map_anonymous. If the regular mmap fails,
3962 try an anonymous one. Report the size if the mmap fails.
3963 * output.h (class Output_file): Declare map_anonymous.
3964
22fd9730
ILT
39652009-03-24 Ian Lance Taylor <iant@google.com>
3966
3967 * target-select.cc (instantiate_target): Don't acquire the lock if
3968 the instantiated_target_ field has already been set.
3969
cb010894
ILT
39702009-03-23 Ian Lance Taylor <iant@google.com>
3971
7f055c20
ILT
3972 * gold-threads.h (class Initialize_lock): Define.
3973 * gold-threads.cc (class Initialize_lock_once): Define.
3974 (initialize_lock_control): New static variable.
3975 (initialize_lock_pointer): New static variable.
3976 (initialize_lock_once): New static function.
3977 (Initialize_lock::Initialize_lock): Define.
3978 (Initialize_lock::initialize): Define.
3979 * target-select.h: Include "gold-threads.h".
3980 (class Target_selector): Add lock_ and initialize_lock_ fields.
3981 Don't define instantiate_target, just declare it.
3982 * target-select.cc (Target_selector::Target_selector): Initialize
3983 new fields.
3984 (Target_selector::instantiate_target): Define.
3985 * descriptors.h: Include "gold-threads.h".
3986 (class Descriptors): Add initialize_lock_ field.
3987 * descriptors.cc (Descriptors::Descriptors): Initialize new
3988 field.
3989 (Descriptors::open): Use initialize_lock_ field
3990 * errors.h (class Errors): Add initialize_lock_ field.
3991 * errors.cc (Errors::Errors): Initialize new field.
3992 (Errors::initialize_lock): Use initialize_lock_ field.
3993 * powerpc.cc (class Target_selector_powerpc): Remove
3994 instantiated_target_ field. In do_recognize call
3995 instantiate_target rather than do_instantiate_target. In
3996 do_instantiate_target just allocate a new target.
3997 * sparc.cc (class Target_selector_sparc): Likewise.
3998
36959681
ILT
3999 * freebsd.h: New file.
4000 * i386.cc: Include "freebsd.h".
4001 (Target_i386): Derive from Target_freebsd rather than
4002 Sized_target.
4003 (Target_selector_i386): Derive from Target_selector_freebsd rather
4004 than Target_selector.
4005 * x86_64.cc: Include "freebsd.h".
4006 (Target_x86_64): Derive from Target_freebsd rather than
4007 Sized_target.
4008 (Target_selector_x86_64): Derive from Target_selector_freebsd
4009 rather than Target_selector.
4010 * target.h (class Target): Add adjust_elf_header and
4011 do_adjust_elf_header.
4012 * output.cc (Output_file_header:: do_sized_write): Call target
4013 adjust_elf_header routine.
4014 * configure.tgt: Set targ_osabi.
4015 * configure.ac: Define GOLD_DEFAULT_OSABI.
4016 * parameters.cc (Parameters::default_target): Pass
4017 GOLD_DEFAULT_OSABI to select_target.
4018 * target-select.h (class Target_selector): Make instantiate_target
4019 protected rather than private.
4020 * Makefile.am (HFILES): Add freebsd.h.
4021 * configure, Makefile.in, config.in: Rebuild.
4022
cb010894
ILT
4023 * merge.cc (do_add_input_section): Correct pend value. Change
4024 message about last entry not being null terminated from error to
4025 warning.
4026
0e879927
ILT
40272009-03-20 Mikolaj Zalewski <mikolajz@google.com>
4028
4029 * incremental.cc: New file.
4030 * Makefile.am (CCFILES): Add incremental.cc.
4031 * Makefile.in: Rebuild.
4032
41105937
PP
40332009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
4034
4035 * layout.cc (Layout::output_section_name): Preserve names
4036 of '.note.' sections.
4037
60439920
ILT
40382009-03-19 Ian Lance Taylor <iant@google.com>
4039
4040 * descriptors.cc (Descriptors::open): Check that the options are
4041 valid before using them.
4042
0d371ad3
ILT
40432009-03-18 Ian Lance Taylor <iant@google.com>
4044
4045 * script-sections.h: Include <list>.
4046 (class Script_sections): Change Sections_elements from std::vector
4047 to std::list. Typedef public Elements_iterator. Add
4048 orphan_section_placement_, data_segment_align_start_, and
4049 saw_data_segment_align_ fields. Remove data_segment_align_index_
4050 field.
4051 * script-sections.cc (class Orphan_section_placement): New class.
4052 (class Sections_element): Add virtual functions is_relro and
4053 orphan_section_init. Remove virtual function place_orphan_here.
4054 (class Output_section_definition): Add is_relro and
4055 orphan_section_init. Remove place_orphan_here.
4056 (class Orphan_output_section): Likewise.
4057 (Script_sections::Script_sections): Update for field changes.
4058 (Script_sections::data_segment_align): Set saw_data_segment_align_
4059 and data_segment_align_start_, not data_segment_align_index.
4060 (Script_sections::data_segment_relro_end): Check
4061 saw_data_segment_align_. Use data_segment_align_start_ rather
4062 than data_segment_align_index_.
4063 (Script_sections::place_orphan): Rewrite to use
4064 Orphan_section_placement.
4065
9201d894
ILT
40662009-03-17 Ian Lance Taylor <iant@google.com>
4067
9c5b8369
ILT
4068 * archive.cc (Archive::add_symbols): Check for a version attached
4069 to the symbol name in the archive map.
4070 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
4071 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
4072 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
4073 (ver_test_11.a): New target.
4074 * testsuite/Makefile.in: Rebuild.
4075
9201d894
ILT
4076 * configure.ac: Check for chsize and posix_fallocate. Replace
4077 ftruncate.
4078 * ftruncate.c: New file, from gnulib.
4079 * output.cc (posix_fallocate): Define dummy version if not
4080 HAVE_POSIX_FALLOCATE.
4081 (Output_file::map): Call posix_fallocate rather than lseek and
4082 write.
4083 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
4084 * configure, Makefile.in, config.in: Rebuild.
4085
ef4ab7a8
PP
40862009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
4087
4088 * layout.h (Layout::create_note): Add section_name parameter.
4089 * layout.cc (Layout::create_note): Likewise.
4090 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
4091
8c500701
ILT
40922009-03-17 Ian Lance Taylor <iant@google.com>
4093
e85b18e1
ILT
4094 * descriptors.cc: Include "options.h".
4095 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
4096 (Descriptors::open): Always use O_CLOEXEC when opening a new
4097 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
4098 then set FD_CLOEXEC.
4099
9efe6174
ILT
4100 * sparc.cc (class Target_sparc): Add has_got_section.
4101 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
4102 make sure we have a GOT section.
4103
4104 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
4105 (Target_sparc::Scan::local): Likewise.
4106 (Target_sparc::Scan::global): Likewise.
4107 (Target_sparc::Relocate::relocate): Likewise.
4108 (Target_sparc::Relocate::relocate_tls): Likewise.
4109
8c500701
ILT
4110 * symtab.cc (Symbol_table::define_default_version): New function,
4111 broken out of add_from_object.
4112 (Symbol_table::add_from_object): Call define_default_version.
4113 (Symbol_table::define_special_symbol): Add resolve_oldsym
4114 parameter. Change all callers. If the version for a symbol comes
4115 from a version script, resolve it with the symbol with the same
4116 name with no version. Also add the symbol without a version if
4117 appropriate.
4118 (do_define_in_output_data): If resolving with oldsym, don't delete
4119 sym.
4120 (do_define_in_output_segment): Likewise.
4121 (do_define_as_constant): Likewise.
4122 * symtab.h (class Symbol_table): Update declarations.
4123
f1ed28fb
ILT
41242009-03-13 Ian Lance Taylor <iant@google.com>
4125
15f8229b
ILT
4126 * readsyms.cc (Read_symbols::incompatible_warning): New function.
4127 (Read_symbols::requeue): New function.
4128 (Read_symbols::do_read_symbols): If make_elf_object fails because
4129 the target type is not configured, and the file was searched for,
4130 issue a warning and retry with the next directory.
4131 (Add_symbols::run): If the file has an incompatible format, and
4132 it was searched for, requeue the Read_symbols task. On error,
4133 release the object.
4134 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
4135 dirindex parameter to constructor. Change all callers. Declare
4136 incompatible_warning and requeue.
4137 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
4138 input_argument_ and input_group_ fields. Add them to
4139 constructor. Change all callers.
4140 (class Read_script): Add dirindex_ field. Add it to constructor.
4141 Change all callers.
4142 * archive.cc (Archive::setup): Remove input_objects parameter.
4143 Change all callers.
4144 (Archive::get_file_and_offset): Likewise.
4145 (Archive::read_all_symbols): Likewise.
4146 (Archive::read_symbols): Likewise.
4147 (Archive::get_elf_object_for_member): Remove input_objects
4148 parameter. Add punconfigured parameter. Change all callers.
4149 (Archive::add_symbols): Change return type to bool. Check return
4150 value of include_member.
4151 (Archive::include_all_members): Likewise.
4152 (Archive::include_member): Change return type to bool. Return
4153 false if first included object has incompatible target. Set
4154 included_member_ field.
4155 (Add_archive_symbols::run): If add_symbols returns false, requeue
4156 Read_symbols task.
4157 * archive.h (class Archive): Add included_member_ field.
4158 Initialize it in constructor. Add input_file and searched_for
4159 methods. Update declarations.
4160 (class Add_archive_symbols): Add dirpath_, dirindex_, and
4161 input_argument_ fields. Add them to constructor. Change all
4162 callers.
4163 * script.cc: Include "target-select.h".
4164 (class Parser_closure): Add skip_on_incompatible_target_ and
4165 found_incompatible_target_ fields. Add
4166 skip_on_incompatible_target parameter to constructor. Change all
4167 callers. Add methods skip_on_incompatible_target,
4168 clear_skip_on_incompatible_target, found_incompatible_target, and
4169 set_found_incompatible_target.
4170 (read_input_script): Add dirindex parameter. Change all callers.
4171 If parser finds an incompatible target, requeue Read_symbols
4172 task.
4173 (script_set_symbol): Clear skip_on_incompatible_target in
4174 closure.
4175 (script_add_assertion, script_parse_option): Likewise.
4176 (script_start_sections, script_add_phdr): Likewise.
4177 (script_check_output_format): New function.
4178 * script.h (read_input_script): Update declaration.
4179 * script-c.h (script_check_output_format): Declare.
4180 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
4181 (ignore_cmd): Remove OUTPUT_FORMAT.
4182 * fileread.cc (Input_file::Input_file): Add explicit this.
4183 (Input_file::will_search_for): New function.
4184 (Input_file::open): Add pindex parameter. Change all callers.
4185 * fileread.h (class Input_file): Add input_file_argument method.
4186 Declare will_search_for. Update declarations.
4187 * object.cc (make_elf_object): Add punconfigured parameter.
4188 Change all callers.
4189 * object.h (class Object): Make input_file public. Add
4190 searched_for method.
4191 (make_elf_object): Update declaration.
4192 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
4193 restart search.
4194 * dirsearch.h (class Dirsearch): Update declaration.
4195 * options.h (class General_options): Add --warn-search-mismatch.
4196 * parameters.cc (Parameters::is_compatible_target): New function.
4197 * parameters.h (class Parameters): Declare is_compatible_target.
4198 * workqueue.cc (Workqueue::add_blocker): New function.
4199 * workqueue.h (class Workqueue): Declare add_blocker.
4200
f1ed28fb
ILT
4201 * fileread.cc (Input_file::open): Remove options parameter.
4202 Change all callers.
4203 (Input_file::open_binary): Likewise.
4204 * script.cc (read_input_script): Likewise.
4205 * readsyms.h (class Read_symbols): Remove options_ field. Remove
4206 options parameter from constructor. Change all callers.
4207 (class Read_script): Likewise.
4208 * fileread.h (class Input_file): Update declarations.
4209 * script.h (read_input_script): Update declaration.
4210
34dd024a
NC
42112009-03-10 Nick Clifton <nickc@redhat.com>
4212
4213 * po/es.po: New Spanish translation.
4214
6d71b17c
CC
42152009-03-06 Cary Coutant <ccoutant@google.com>
4216
4217 * options.cc (parse_short_option): Keep dash_z from registering itself.
4218
031cdbed
ILT
42192009-03-03 Ian Lance Taylor <iant@google.com>
4220
4221 PR 9918
4222 * target-reloc.h (relocate_section): Pass output_section to
4223 relocate.
4224 * i386.cc (Target_i386::should_apply_static_reloc): Add
4225 output_section parameter. Change all callers.
4226 (Target_i386::Relocate::relocate): Add output_section parameter.
4227 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
4228 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
4229 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
4230 * testsuite/two_file_shared.sh: New script.
4231 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
4232 (check_DATA): Add two_file_shared.dbg.
4233 (two_file_shared.dbg): New target.
4234 * testsuite/Makefile.in: Rebuild.
4235
15d5fa16
ILT
42362009-03-01 Ian Lance Taylor <iant@google.com>
4237
4238 * configure.ac: Check for byteswap.h.
4239 * configure: Rebuild.
4240 * config.in: Rebuild.
4241
8a4c0b0d
ILT
42422009-03-01 Mikolaj Zalewski <mikolajz@google.com>
4243
4244 * layout.cc (Layout::find_or_add_kept_section): New function.
4245 (Layout::add_comdat): Removed.
4246 * layout.h (struct Kept_section): Move out of class Layout.
4247 Remove trailing underscores from field names. Add group_sections
4248 field. Rename group_ field to is_group. Change all uses.
4249 (class Layout): Declare find_or_add_kept_section, not add_comdat.
4250 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
4251 comdat_groups_ field.
4252 (Sized_relobj::include_section_group): Use
4253 find_or_add_kept_section and Kept_section::group_sections.
4254 (Sized_relobj::include_linkonce_section): Likewise.
4255 * object.cc (class Sized_relobj): Don't define Comdat_group or
4256 Comdat_group_table. Remove find_comdat_group and
4257 add_comdat_group. Remove comdat_groups_ field.
4258 * plugin.cc (include_comdat_group): Use
4259 Layout::find_or_add_kept_section.
4260
b4ecf66b
ILT
42612009-02-28 Ian Lance Taylor <iant@google.com>
4262
14359ca0
ILT
4263 * README: --gc-sections and map files are now supported. Document
4264 some build requirements.
4265
b4ecf66b
ILT
4266 PR 6992
4267 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
4268 relocatable link set the value of the section symbol to zero.
4269 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
4270 relocatable link don't include the section address in the local
4271 symbol value.
4272
0602e05a
ILT
42732009-02-27 Ian Lance Taylor <iant@google.com>
4274
fd9d194f
ILT
4275 PR 6811
4276 * options.h (class Search_directory): Add is_system_directory.
4277 (class General_options): Declare is_in_system_directory.
4278 * options.cc (get_relative_sysroot): Make static.
4279 (get_default_sysroot): Make static.
4280 (General_optoins::is_in_system_directory): New function.
4281 * fileread.cc (Input_file::is_in_system_directory): New function.
4282 * fileread.h (class Input_file): Declare is_in_system_directory.
4283 * object.h (class Object): Add is_in_system_directory.
4284 (class Input_objects): Remove system_library_directory_ field.
4285 * object.cc (Input_objects::add_object): Don't set
4286 system_library_directory_.
4287 (input_objects::found_in_system_library_directory): Remove.
4288 * symtab.cc (Symbol_table::write_globals): Remove input_objects
4289 parameter. Change all callers.
4290 (Symbol_table::sized_write_globals): Likewise.
4291 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
4292 Call Object::is_in_system_directory.
4293 * symtab.h (class Symbol_table): Update declarations.
4294
61edd21f
ILT
4295 PR 5990
4296 * descriptors.h (Open_descriptor): Add is_on_stack field.
4297 * descriptors.cc (Descriptors::open): If the descriptor is on the
4298 top of the stack, remove it. Initialize is_on_stack field.
4299 (Descriptors::release): Only add pod to stack if it is not on the
4300 stack already.
4301 (Descriptors::close_some_descriptor): Clear stack_next and
4302 is_on_stack fields.
4303
e29e076a
ILT
4304 PR 7091
4305 * output.cc (Output_section::find_starting_output_address): Rename
4306 from starting_output_address; add PADDR parameter; change return
4307 type.
4308 * output.h (class Output_section): Declare
4309 find_starting_output_address instead of starting_output_address.
4310 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
4311 section symbol for which we can't find a merge section.
4312
0602e05a
ILT
4313 PR 9836
4314 * symtab.cc (Symbol_table::add_from_object): If the visibility is
4315 hidden or internal, force the symbol to be local.
4316 * resolve.cc (Symbol::override_visibility): Define.
4317 (Symbol::override_base): Use override_visibility.
4318 (Symbol_table::resolve): Likewise.
4319 (Symbol::override_base_with_special): Likewise.
4320 (Symbol_table::override_with_special): If the visibility is hidden
4321 or internal, force the symbol to be local.
4322 * symtab.h (class Symbol): Add set_visibility and
4323 override_visibility.
4324 * testsuite/ver_test_1.sh: New file.
4325 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
4326 (check_DATA): Add ver_test_1.syms.
4327 (ver_test_1.syms): New target.
4328 * testsuite/Makefile.in: Rebuild.
4329
401a9a73
CC
43302009-02-25 Cary Coutant <ccoutant@google.com>
4331
4332 * layout.cc (Layout::choose_output_section): Don't rename sections
4333 when using a linker script that has a SECTIONS clause.
4334 * Makefile.in: Regenerate.
4335
4336 * testsuite/Makefile.am (script_test_5.sh): New test case.
4337 * testsuite/Makefile.in: Regenerate.
4338 * testsuite/script_test_5.cc: New file.
4339 * testsuite/script_test_5.sh: New file.
4340 * testsuite/script_test_5.t: New file.
4341
f488e4b0
CC
43422009-02-13 Rafael Avila de Espindola <espindola@google.com>
4343
4344 * archive.cc (Archive::include_member): Update calls to add_symbols.
4345 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
4346 the Layout argument.
4347 * dynobj.h (do_add_symbols): Add the Layout argument.
4348 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
4349 Layout argument.
4350 * object.h (Object::add_symbols): Add the Layout argument.
4351 (Object::do_add_symbols): Add the Layout argument.
4352 (Sized_relobj::do_add_symbols): Add the Layout argument.
4353 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
4354 Unify the two versions.
4355 (Add_plugin_symbols): Remove.
4356 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
4357 (Sized_pluginobj::do_add_symbols): Unify the two versions.
4358 (Add_plugin_symbols): Remove.
4359 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
4360 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
4361 (Add_symbols::run): Make it work with Pulginobj.
4362
89dd1680
ILT
43632009-02-06 Ian Lance Taylor <iant@google.com>
4364
4365 * object.cc (Sized_relobj::do_layout): Make info message start
4366 with lower case letter.
4367
266d0a74
ILT
43682009-02-06 Mikolaj Zalewski <mikolajz@google.com>
4369
602b464e
ILT
4370 * binary.cc: Fix file comment.
4371
266d0a74
ILT
4372 * options.h (enum Incremental_disposition): Define.
4373 (class General_options): Add new options: --incremental,
4374 --incremental_changed, --incremental_unchanged,
4375 --incremental_unknown. Add incremental_disposition_ and
4376 implicit_incremental_ fields.
4377 (General_options::incremental_disposition): New function.
4378 (class Position_dependent_options): Add incremental_disposition
4379 option.
4380 (Position_dependent_options::copy_from_options): Set incremental
4381 dispositions.
4382 * options.cc (General_options::parse_incremental_changed): New
4383 function.
4384 (General_options::parse_incremental_unchanged): New function.
4385 (General_options::parse_incremental_unknown): New function.
4386 (General_options::General_options): Initialize new fields
4387 incremental_disposition_ and implicit_incremental_.
4388 (General_options::finalize): Check for uasge of --incremental-*
4389 without --incremental.
4390
f073bbf7
CD
43912009-02-06 Chris Demetriou <cgd@google.com>
4392
4393 * gold.h (gold_undefined_symbol): Change to take only a Symbol
4394 pointer and to report location as the file name associated with
4395 the symbol.
4396 (gold_undefined_symbol_at_location): New function to replace the
4397 old gold_undefined_symbol functionality.
4398 * target-reloc.h (relocate_section): Update to use
4399 gold_undefined_symbol_at_location.
4400 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
4401 Call gold_undefined_symbol function rather than gold_error.
4402 * errors.h (Errors::undefined_symbol): Take location as a
4403 string, rather than calculating it from a relocation.
4404 * errors.cc (Errors::fatal): Print "fatal error:" before the
4405 formatted message.
4406 (Errors::error, Errors::error_at_location): Print "error: "
4407 before the formatted message.
4408 (Errors::undefined_symbol): Take location as a string, rather
4409 than calculating it from a relocation.
4410 (gold_undefined_symbol_at_location): New function akin to
4411 old gold_undefined_symbol, calculates location from relocation.
4412 (gold_undefined_symbol): Change to take only a Symbol pointer
4413 and to report location as the file name associated with the symbol.
4414 * testsuite/debug_msg.sh: Update for changed error messages.
4415 * testsuite/undef_symbol.sh: Likewise.
4416
8e94a90c
ILT
44172009-02-04 Duncan Sands <baldrick@free.fr>
4418
4419 PR 9812
4420 * reduced_debug_output.h
4421 (Output_reduced_debug_abbrev_section::failed): Use format for
4422 gold_warning.
4423 (Output_reduced_debug_info_section::faild): Likewise.
4424
88a0e15b
ILT
44252009-01-31 Mikolaj Zalewski <mikolajz@google.com>
4426
4427 * script.cc (Lazy_demangler): New class.
4428 (Version_script_info::get_symbol_version_helper): Demangle a
4429 symbol only once.
4430
5efc7cd2
CC
44312009-01-29 Cary Coutant <ccoutant@google.com>
4432
4433 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
4434 to __tls_get_addr.
4435 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
4436
e0ebcf42
ILT
44372009-01-28 Ian Lance Taylor <iant@google.com>
4438
5efc7cd2 4439 * version.cc (version_string): Bump to 1.9.
75fe7426 4440
e0ebcf42
ILT
4441 * gold.h: Include <cstring> and <stdint.h>.
4442 * version.cc: Include <cstdio>.
4443 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
4444 warning.
4445 * reduced_debug_output.cc (insert_into_vector): Rename from
4446 Insert_into_vector; change all callers. Use Swap_unaligned to
4447 avoid aliasing issue; remove union since it is unnecessary.
4448
8e2813be 44492009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
4450
4451 * Makefile.am (CCFILES): Add gc.cc.
4452 (HFILES): Add gc.h.
4453 * Makefile.in: Regenerate.
4454 * gold.cc (Gc_runner): New class.
4455 (queue_initial_tasks): Call garbage collection related tasks
4456 when corresponding options are invoked.
4457 (queue_middle_gc_tasks): New function.
4458 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
4459 processed early before laying out sections during garbage collection.
4460 * gold.h (queue_middle_gc_tasks): New function.
4461 (is_prefix_of): Move from "layout.cc".
4462 * i386.cc (Target_i386::gc_process_relocs): New function.
4463 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
4464 * main.cc (main): Create object of class "Garbage_collection".
4465 * object.cc (Relobj::copy_symbols_data): New function.
4466 (Relobj::is_section_name_included): New function.
4467 (Sized_relobj::do_layout): Allow this function to be called twice
4468 during garbage collection and defer layout of section during the
4469 first call.
4470 * object.h (Relobj::get_symbols_data): New function.
4471 (Relobj::is_section_name_included): New function.
4472 (Relobj::copy_symbols_data): New function.
4473 (Relobj::set_symbols_data): New function.
4474 (Relobj::get_relocs_data): New function.
4475 (Relobj::set_relocs_data): New function.
4476 (Relobj::is_output_section_offset_invalid): New pure virtual function.
4477 (Relobj::gc_process_relocs): New function.
4478 (Relobj::do_gc_process_relocs): New pure virtual function.
4479 (Relobj::sd_): New data member.
4480 (Sized_relobj::is_output_section_offset_invalid): New function.
4481 (Sized_relobj::do_gc_process_relocs): New function.
4482 * options.h (General_options::gc_sections): Modify to not be a no-op.
4483 (General_options::print_gc_sections): New option.
4484 * plugin.cc (Plugin_finish::run): Remove function call to
4485 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
4486 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
4487 * reloc.cc (Read_relocs::run): Add task to process relocs and
4488 determine unreferenced sections when doing garbage collection.
4489 (Gc_process_relocs): New class.
4490 (Sized_relobj::do_gc_process_relocs): New function.
4491 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
4492 sections that are garbage collected.
4493 * reloc.h (Gc_process_relocs): New class.
4494 * sparc.cc (Target_sparc::gc_process_relocs): New function.
4495 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
4496 symbols whose corresponding sections are garbage collected.
4497 (Symbol_table::Symbol_table): Add new parameter for the garbage
4498 collection object.
4499 (Symbol_table::gc_mark_undef_symbols): New function.
4500 (Symbol_table::gc_mark_symbol_for_shlib): New function.
4501 (Symbol_table::gc_mark_dyn_syms): New function.
4502 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
4503 as garbage.
4504 (Symbol_table::add_from_object): Likewise.
4505 (Symbol_table::add_from_relobj): When building shared objects, do not
4506 treat externally visible symbols as garbage.
4507 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
4508 table information for static and relocatable links.
4509 * symtab.h (Symbol_table::set_gc): New function.
4510 (Symbol_table::gc): New function.
4511 (Symbol_table::gc_mark_undef_symbols): New function.
4512 (Symbol_table::gc_mark_symbol_for_shlib): New function.
4513 (Symbol_table::gc_mark_dyn_syms): New function.
4514 (Symbol_table::gc_): New data member.
4515 * target.h (Sized_target::gc_process_relocs): New pure virtual
4516 function.
4517 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
4518 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
4519
3b293544
CF
45202009-01-20 Chris Faylor <me.sourceware@sourceware.org>
4521
4522 * options.h (General_options::gc_sections): Define as a no-op for now.
4523 (General_options::no_keep_memory): Ditto.
4524 (General_options::Bshareable): Define.
4525 * options.cc (General_options::finalize): Honor -Bshareable.
4526
83d22aa8
AS
45272009-01-20 Andreas Schwab <schwab@suse.de>
4528
4529 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
4530 read the value in the contents, since we don't use it. Use the
4531 template endianness when writing.
4532 (Relocate::relocate): Use it for R_PPC_REL16_HA.
4533
cd536b21
AS
45342009-01-19 Andreas Schwab <schwab@suse.de>
4535
4536 * configure.tgt (powerpc64-*): Fix targ_obj.
4537
99e9a495
ILT
45382009-01-15 Ian Lance Taylor <iant@google.com>
4539
4540 * object.cc (Sized_relobj::write_local_symbols): Don't write out
4541 local symbols when stripping all symbols.
4542
bbbfea06
CC
45432009-01-14 Cary Coutant <ccoutant@google.com>
4544
99e9a495 4545 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 4546
0f7c0701
CC
45472009-01-14 Cary Coutant <ccoutant@google.com>
4548
4549 * archive.cc (Archive::get_elf_object_for_member): Remove call
4550 to File_read::claim_for_plugin.
4551 * descriptors.cc (Descriptors::open): Remove reference to
4552 is_claimed.
4553 (Descriptors::claim_for_plugin): Remove.
4554 * descriptors.h (Descriptors::claim_for_plugin): Remove.
4555 (Descriptors::is_claimed): Remove.
4556 (claim_descriptor_for_plugin): Remove.
4557 * fileread.cc (File_read::claim_for_plugin): Remove.
4558 * fileread.h (File_read::claim_for_plugin): Remove.
4559 (File_read::descriptor): Reopen descriptor if necessary.
4560 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
4561 (Plugin_manager::all_symbols_read): Add task parameter. Change
4562 all callers.
4563 (Plugin_manager::get_input_file): New function.
4564 (Plugin_manager::release_input_file): New function.
4565 (Pluginobj::Pluginobj): Add filesize parameter and initialize
4566 corresponding data member.
4567 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
4568 and pass to base constructor. Change all callers.
4569 (get_input_file, release_input_file): New functions.
4570 (make_sized_plugin_object): Add filesize parameter. Change all callers.
4571 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
4572 (Plugin_manager::all_symbols_read): Add task parameter.
4573 (Plugin_manager::get_input_file): New function.
4574 (Plugin_manager::release_input_file): New function.
4575 (Plugin_manager::task_): New data member.
4576 (Pluginobj::Pluginobj): Add filesize parameter.
4577 (Pluginobj::filename): New function.
4578 (Pluginobj::descriptor): New function.
4579 (Pluginobj::filesize): New function.
4580 (Pluginobj::filesize_): New data member.
4581 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
4582 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
4583 File_read::claim_for_plugin; use Object::unlock to unlock the file.
4584
4585 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
4586 with archive libraries.
4587 * testsuite/Makefile.in: Regenerate.
4588 * testsuite/plugin_test.c (struct sym_info): New type.
4589 (get_input_file, release_input_file): New static variables.
4590 (onload): Capture new transfer vector entries.
4591 (claim_file_hook): Stop reading at end of file according to filesize.
4592 Factor out parsing of readelf output into separate function.
4593 (all_symbols_read_hook): Exercise get_input_file and release_input_file
4594 APIs and get the source file name from the symbol table. Convert
4595 source file name to corresponding object file name. Print info
4596 message when adding new input files.
4597 (parse_readelf_line): New function.
4598 * testsuite/plugin_test_1.sh: Add checks for new info messages.
4599 * testsuite/plugin_test_2.sh: Likewise.
4600 * testsuite/plugin_test_3.sh: Likewise.
4601 * testsuite/plugin_test_4.sh: New test case.
4602
62a6d109
ILT
46032009-01-07 Ian Lance Taylor <iant@google.com>
4604
4605 * version.cc (version_string): Bump to 1.8.
4606
483620e8
CC
46072008-12-23 Cary Coutant <ccoutant@google.com>
4608
4609 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
4610 * plugin.cc (Plugin_manager::finish): Rename as
4611 layout_deferred_objects. Move cleanup to separate function.
4612 (Plugin_manager::cleanup): New function.
4613 (Plugin_finish::run): Call layout_deferred_objects and cleanup
4614 separately.
4615 * plugin.h (Plugin_manager::finish): Rename as
4616 layout_deferred_objects.
4617 (Plugin_manager::cleanup): New function.
4618 (Plugin_manager::cleanup_done): New field.
4619
d66a9eb3
CC
46202008-12-23 Cary Coutant <ccoutant@google.com>
4621
4622 * plugin.cc (is_visible_from_outside): New function.
4623 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
4624 so we don't return "IR only" status for exported symbols or -r links.
4625
4626 * testsuite/Makefile.am (plugin_test_3): New test case.
4627 * testsuite/Makefile.in: Regenerate.
4628 * testsuite/plugin_test_3.sh: New file.
4629
5995b570
CC
46302008-12-22 Cary Coutant <ccoutant@google.com>
4631
4632 * object.cc (Sized_relobj::layout_section): New function.
4633 (Sized_relobj::do_layout): Defer layout of input sections until after
4634 plugin has provided replacement files.
4635 (Sized_relobj::do_layout_deferred_sections): New function.
4636 * object.h (Relobj::set_section_offset): Remove virtual keyword.
4637 (Relobj::layout_deferred_sections): New function.
4638 (Relobj::do_layout_deferred_sections): New function.
4639 (Sized_relobj::do_layout_deferred_sections): New function.
4640 (Sized_relobj::layout_section): New function.
4641 (Sized_relobj::Deferred_layout): New structure.
4642 (Sized_relobj::deferred_layout_): New field.
4643 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
4644 Change all callers. Layout deferred sections.
4645 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
4646 references.
4647 (Plugin_hook::run): Move code from do_plugin_hook inline.
4648 (Plugin_hook::do_plugin_hook): Remove.
4649 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
4650 (Plugin_manager::finish): Renamed, was cleanup.
4651 (Plugin_manager::should_defer_layout): New function.
4652 (Plugin_manager::add_deferred_layout_object): New function.
4653 (Plugin_manager::Deferred_layout_list): New type.
4654 (Plugin_manager::deferred_layout_objects_): New field.
4655 (Plugin_hook::do_plugin_hook): Remove.
4656
ee769c88
ILT
46572008-12-17 Ian Lance Taylor <iant@google.com>
4658
4659 * options.h (class General_options): Add --no case for
4660 --export-dynamic.
4661
abc8dcba
CC
46622008-12-16 Cary Coutant <ccoutant@google.com>
4663
4664 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
4665 vector.
4666 (Plugin_manager::claim_file): Create plugin object even if
4667 plugin did not call the add_symbols callback.
4668 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
4669 asking for more symbols than were added.
4670 * testsuite/Makefile.am (plugin_test_1): Add test case with
4671 no global symbols.
4672 (empty.syms): New target.
4673 * testsuite/Makefile.in: Regenerate.
4674 * testsuite/plugin_test.c (claim_file_hook): Add new debug
4675 message. Don't call add_symbols if no globals.
4676 (all_symbols_read_hook): Don't provide replacement for empty
4677 claimed file.
4678
b0074644
ILT
46792008-12-12 Ian Lance Taylor <iant@google.com>
4680
68943102
ILT
4681 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
4682 r_type == 0 for a local symbol with r_sym == 0.
4683 (scan_relocatable_relocs): Pass r_sym to
4684 local_non_section_strategy.
4685 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
4686 r_sym parameter.
4687
b0074644
ILT
4688 * configure.ac: Update test for TLS descriptors: they are
4689 supported as of glibc 2.9.
4690 * configure: Rebuild.
4691
c2508178
ILT
46922008-12-11 Ian Lance Taylor <iant@google.com>
4693
4694 PR 7091
4695 * target-reloc.h (Default_scan_relocatable_relocs): For each
4696 function, map r_type == 0 to RELOC_DISCARD.
4697
2756a258
CC
46982008-12-10 Cary Coutant <ccoutant@google.com>
4699
4700 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
4701 object to override a kept COMDAT group from a plugin object.
4702
bb6f53d3
ILT
47032008-12-09 Ian Lance Taylor <iant@google.com>
4704
fbc558e1
ILT
4705 PR 7088
4706 * yyscript.y (file_cmd): Handle INPUT.
4707
bb6f53d3
ILT
4708 * testsuite/initpri1.c: Change all declarations to be full
4709 prototypes by adding void, to avoid compiler warnings.
4710
4674ecfc
CC
47112008-12-05 Rafael Avila de Espindola <espindola@google.com>
4712
4713 * options.cc (General_options::parse_plugin_opt): New.
4714 (General_options::add_plugin): The argument now is just the filename.
4715 (General_options::add_plugin_option): New.
4716 * options.h (plugin_opt): New.
4717 (add_plugin): Change argument name.
4718 (add_plugin_option): New.
4719 * plugin.cc (Plugin::load): Don't parse the plugin option.
4720 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
4721 (Plugin::add_option): New.
4722 (Plugin::args_): Change type.
4723 (Plugin::filename_): New.
4724 (Plugin_manager::add_plugin_option): New.
4725 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
4726 * testsuite/Makefile.in: Regenerate.
4727
fd06b4aa
CC
47282008-12-05 Cary Coutant <ccoutant@google.com>
4729
4730 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
4731 Handle --strip-lto-sections option.
4732 * options.h (strip_lto_sections): New option.
4733
6c52134c
CC
47342008-12-01 Cary Coutant <ccoutant@google.com>
4735
4736 * plugin.cc (ld_plugin_message): Change format parameter to const.
4737 Fix mismatch between new[] and delete.
4738
a45248e0
CC
47392008-11-14 Cary Coutant <ccoutant@google.com>
4740
4741 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
4742 instead of -1U.
4743
c82fbeee
CS
47442008-11-05 Craig Silverstein <csilvers@google.com>
4745
4746 * options.cc (General_options::parse_dynamic_list): New function.
4747 * options.h (General_options): New flags dynamic_list,
4748 dynamic_list_data, dynamic_list_cpp_new, and
4749 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
4750 (General_options::in_dynamic_list): New function.
4751 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
4752 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
4753 (Lex::can_continue_name): Likewise.
4754 (yylex): Likewise.
4755 (read_script_file): New parameter script_options.
4756 (read_dynamic_list): New function.
4757 (Script_options::define_dynamic_list): New function.
4758 (dynamic_list_keyword_parsecodes): New variable.
4759 (dynamic_list_keywords): New variable.
4760 * script.h (Script_options::define_dynamic_list): New function
4761 prototype.
4762 (read_dynamic_list): New function prototype.
4763 * symtab.cc (strprefix): New macro.
4764 (Symbol::should_add_dynsym_entry): Support dynamic_list,
4765 dynamic_list_data, dynamic_list_cpp_new, and
4766 dynamic_list_cpp_typeinfo.
4767 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
4768 (dynamic_list_expr): New rule.
4769 (dynamic_list_nodes): Likewise.
4770 (dynamic_list_node): Likewise.
4771 * testsuite/Makefile.am (dynamic_list): New test.
4772 * testsuite/Makefile.in: Regenerated.
4773 * testsuite/dynamic_list.t: New file.
4774 * testsuite/dynamic_list.sh: New file.
4775
e0bb29a5
CS
47762008-11-05 Craig Silverstein <csilvers@google.com>
4777
4778 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
4779 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
4780 (t11_last): Likewise.
4781 * testsuite/ver_test_6.c (main): Likewise.
4782
4e1e25e0
CC
47832008-10-07 Cary Coutant <ccoutant@google.com>
4784
4785 * options.c (General_options::finalize): Add check for -static and
4786 -shared.
4787 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
4788 is not empty.
4789
92f03fcb
CC
47902008-10-02 Cary Coutant <ccoutant@google.com>
4791
4792 * plugin.cc (make_sized_plugin_object): Fix conditional
4793 compilation to work when not all targets are enabled.
4794
fbd8a257
CC
47952008-09-29 Cary Coutant <ccoutant@google.com>
4796
4797 * archive.cc (Archive::get_file_and_offset): Use filename instead
4798 of name to get library path.
4799 (Archive::include_member): Unlock external member of a thin archive.
4800
4801 * testsuite/Makefile.am (TEST_AR): New variable.
4802 (thin_archive_test_1): New test.
4803 (thin_archive_test_2): New test.
81636b3f
CC
4804 * testsuite/Makefile.in: Regenerate.
4805 * testsuite/thin_archive_main.cc: New file.
4806 * testsuite/thin_archive_test_1.cc: New file.
4807 * testsuite/thin_archive_test_2.cc: New file.
4808 * testsuite/thin_archive_test_3.cc: New file.
4809 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 4810
eff45813
CC
48112008-09-29 Cary Coutant <ccoutant@google.com>
4812
4813 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
4814 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
4815 instead of -1U.
4816 (Sized_relobj::do_finalize_local_symbols): Likewise.
4817 (Sized_relobj::map_to_kept_section): Likewise.
4818 * object.h (Sized_relobj::invalid_address): New constant.
4819 (Sized_relobj::do_output_section_offset): Check for invalid_address
4820 and return -1ULL.
4821 * output.cc (Output_reloc::local_section_offset): Use constant
4822 invalid_address instead of -1U.
4823 (Output_reloc::get_address): Likewise.
4824 (Output_section::output_address): Change -1U to -1ULL.
4825 * output.h (Output_reloc::invalid_address): New constant.
4826 * reloc.cc (Sized_relobj::write_sections): Use constant
4827 invalid_address instead of -1U.
4828 (Sized_relobj::relocate_sections): Likewise.
4829 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
4830 values for merge sections.
4831 * target-reloc.h (relocate_for_relocatable): Use constant
4832 invalid_address instead of -1U.
4833
89fc3421
CC
48342008-09-19 Cary Coutant <ccoutant@google.com>
4835
4836 Add plugin functionality for link-time optimization (LTO).
4837 * configure.ac (plugins): Add --enable-plugins option.
4838 * configure: Regenerate.
4839 * config.in: Regenerate.
4840 * Makefile.am (LIBDL): New variable.
4841 (CCFILES): Add plugin.cc.
4842 (HFILES): Add plugin.h.
4843 (ldadd_var): Add LIBDL.
4844 * Makefile.in: Regenerate.
4845
4846 * archive.cc: Include "plugin.h".
4847 (Archive::setup): Don't preread archive symbols when using a plugin.
4848 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
4849 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
4850 files.
4851 (Archive::include_member): Add symbols from plugin objects.
4852 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
4853 * descriptors.cc (Descriptors::open): Check for file descriptors
4854 abandoned by plugins.
4855 (Descriptors::claim_for_plugin): New function.
4856 * descriptors.h (Descriptors::claim_for_plugin): New function.
4857 (Open_descriptor::is_claimed): New field.
4858 (claim_descriptor_for_plugin): New function.
4859 * fileread.cc (File_read::claim_for_plugin): New function.
4860 * fileread.h (File_read::claim_for_plugin): New function.
4861 (File_read::descriptor): New function.
4862 * gold.cc: Include "plugin.h".
4863 (queue_initial_tasks): Add task to call plugin hooks for generating
4864 new object files.
4865 * main.cc: Include "plugin.h".
4866 (main): Load plugin libraries.
4867 * object.h (Pluginobj): Declare.
4868 (Object::pluginobj): New function.
4869 (Object::do_pluginobj): New function.
4870 (Object::set_target): New function.
4871 * options.cc: Include "plugin.h".
4872 (General_options::parse_plugin): New function.
4873 (General_options::General_options): Initialize plugins_ field.
4874 (General_options::add_plugin): New function.
4875 * options.h (Plugin_manager): Declare.
4876 (General_options): Add --plugin option.
4877 (General_options::has_plugins): New function.
4878 (General_options::plugins): New function.
4879 (General_options::add_plugin): New function.
4880 (General_options::plugins_): New field.
4881 * plugin.cc: New file.
4882 * plugin.h: New file.
4883 * readsyms.cc: Include "plugin.h".
4884 (Read_symbols::do_read_symbols): Check for archive before checking
4885 for ELF file. Call plugin hooks to claim files.
4886 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
4887 from a real object file; force override when processing replacement
4888 files.
4889 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
4890 (Symbol::init_base_object): Likewise.
4891 (Symbol::init_base_output_data): Likewise.
4892 (Symbol::init_base_output_segment): Likewise.
4893 (Symbol::init_base_constant): Likewise.
4894 (Symbol::init_base_undefined): Likewise.
4895 (Symbol::output_section): Assert that object is not a plugin.
4896 (Symbol_table::add_from_pluginobj): New function.
4897 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
4898 undefined.
4899 (Symbol_table::sized_write_globals): Likewise.
4900 (Symbol_table::add_from_pluginobj): Instantiate template.
4901 * symtab.h (Sized_pluginobj): Declare.
4902 (Symbol::in_real_elf): New function.
4903 (Symbol::set_in_real_elf): New function.
4904 (Symbol::in_real_elf_): New field.
4905 (Symbol_table::add_from_pluginobj): New function.
4906
4907 * testsuite/Makefile.am (AM_CFLAGS): New variable.
4908 (LIBDL): New variable.
4909 (LDADD): Add LIBDL.
4910 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
4911 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
4912 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
4913 (MOSTLYCLEANFILES): Likewise.
4914 * testsuite/Makefile.in: Regenerate.
4915 * testsuite/plugin_test.c: New file.
4916 * testsuite/plugin_test_1.sh: New file.
4917 * testsuite/plugin_test_2.sh: New file.
4918
de31bda5
ILT
49192008-09-16 Ian Lance Taylor <iant@google.com>
4920
9c2d0ef9
ILT
4921 * target-reloc.h (relocate_section): Check whether a symbol is
4922 defined by the ABI before reporting an undefined symbol error.
4923 * target.h (Target::is_defined_by_abi): Make parameter const.
4924 (Target::do_is_defined_by_abi): Likewise.
4925 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
4926 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
4927 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
4928 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
4929 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
4930 * testsuite/Makefile.in: Rebuild.
4931
de31bda5
ILT
4932 * fileread.cc (make_view): Add casts to avoid warning.
4933
9fa33bee
AO
49342008-09-16 Alexandre Oliva <aoliva@redhat.com>
4935
4936 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
4937 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
4938
183fd0e3
AO
49392008-09-16 Alexandre Oliva <aoliva@redhat.com>
4940
4941 * options.h (General_options::output_is_executable): New.
4942 (General_options::output_is_pie): New.
4943 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
4944 for shared libraries.
4945 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
4946
7be8330a
CD
49472008-09-11 Chris Demetriou <cgd@google.com>
4948
4949 * options.h (origin): New -z option.
4950 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
4951 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
4952 in DT_FLAGS_1.
4953
a9caad02
CC
49542008-09-05 Cary Coutant <ccoutant@google.com>
4955
4956 * fileread.cc (File_read::make_view): Add check for attempt to map
4957 beyond end of file.
4958
ae6dce4d
CC
49592008-09-05 Cary Coutant <ccoutant@google.com>
4960
4961 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
4962 explicit instantiations.
4963
d7ab2a47
KVH
49642008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
4965
4966 PR gold/6858
4967 * options.cc (General_options::finalize): Allow undefined symbols
4968 in shlibs if linking -shared.
4969
4970 PR gold/6859
4971 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
4972 symbols as not needing a dynsym entry.
4973
1e52a9c1
CS
49742008-08-20 Craig Silverstein <csilvers@google.com>
4975
4976 * fileread.cc (File_read::open): Do not lock the file unless it
4977 was successfully opened.
4978
d85c80a3
CC
49792008-08-14 Cary Coutant <ccoutant@google.com>
4980
4981 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
4982 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
4983 * testsuite/tls_test.cc (struct int128): 128-bit struct
4984 for testing TLS relocs with non-zero addend.
4985 (v12): New TLS variable.
4986 (t12): New test.
4987 (t_last): Add check for v12.
4988 * testsuite/tls_test.h (t12): New function.
4989 * testsuite/tls_test_main.cc (thread_routine): Call new test.
4990
2d924fd9
ILT
49912008-08-13 Ian Lance Taylor <iant@google.com>
4992
4993 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
4994 set tls_segment_ or relro_segment_.
4995 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
4996 when appropriate.
4997 * output.h (Output_section::clear_is_relro): New function.
4998 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
4999 sections specially even when output_data_ is empty.
5000 (Output_segment::maximum_alignment): When first section is relro,
5001 only force alignment for PT_LOAD segments.
5002 * script.cc (script_data_segment_align): New function.
5003 (script_data_segment_relro_end): New function.
5004 * script-c.h (script_data_segment_align): Declare.
5005 (script_data_segment_relro_end): Declare.
5006 * script-sections.h (class Script_sections): Declare
5007 data_segment_align and data_segment_relro_end. Add fields
5008 segment_align_index_ and saw_relro_end_.
5009 * script-sections.cc (class Sections_element): Add set_is_relro
5010 virtual function. Add new bool* parameter to place_orphan_here.
5011 Add get_output_section virtual function.
5012 (class Output_section_definition): Add set_is_relro. Add new
5013 bool* parameter to place_orphan_here. Add get_output_section.
5014 Add is_relro_ field.
5015 (Output_section_definition::Output_section_definition): Initialize
5016 evaluated_address_, evaluated_load_address, evaluated_addralign_,
5017 and is_relro_ fields.
5018 (Output_section_definition::place_orphan_here): Add is_relro
5019 parameter.
5020 (Output_section_definition::set_section_addresses): Set relro for
5021 output section.
5022 (Output_section_definition::alternate_constraint): Likewise.
5023 (class Orphan_output_section): Add new bool* parameter to
5024 place_orphan_here. Add get_output_section.
5025 (Orphan_output_section::place_orphan_here): Add is_relro
5026 parameter.
5027 (Script_sections::Script_sections): Initialize
5028 data_segment_align_index_ and saw_relro_end_.
5029 (Script_sections::data_segment_align): New function.
5030 (Script_sections::data_segment_relro_end): New function.
5031 (Script_sections::place_orphan): Set or clear is_relro.
5032 (Script_sections::set_section_addresses): Force alignment of first
5033 TLS section.
5034 * yyscript.y (exp): Call script_data_segment_align and
5035 script_data_segment_relro_end.
5036 * testsuite/relro_script_test.t: New file.
5037 * testsuite/relro_test.cc (using_script): Declare.
5038 (t1, t2): Test using_script.
5039 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
5040 (relro_script_test_SOURCES): Define.
5041 (relro_script_test_DEPENDENCIES): Define.
5042 (relro_script_test_LDFLAGS): Define.
5043 (relro_script_test_LDADD): Define.
5044 (relro_script_test.so): New target.
5045 * testsuite/Makefile.in: Rebuild.
5046
f827c9a9
CC
50472008-08-06 Cary Coutant <ccoutant@google.com>
5048
5049 * archive.cc (Archive::total_archives, Archive::total_members)
5050 (Archive::total_members_loaded): New variables.
5051 (Archive::setup): Add parameter. Add option to preread
5052 archive symbols.
5053 (Archive::read_armap): Add counter.
5054 (Archive::get_file_and_offset): New function.
5055 (Archive::get_elf_object_for_member): New function.
5056 (Archive::read_all_symbols): New function.
5057 (Archive::read_symbols): New function.
5058 (Archive::add_symbols): Add counters.
5059 (Archive::include_all_members): Use armap to find members if it's
5060 already built.
5061 (Archive::include_member): Skip reading symbols if already read.
5062 Factored code into Archive::get_file_and_offset and
5063 Archive::get_elf_object_for_member. Changed call to
5064 Mapfile::report_include_archive_member.
5065 (Archive::print_stats): New function.
5066 * archive.h: Declare Object and Read_symbols_data classes.
5067 (Archive::Archive): Add initializers for new members.
5068 (Archive::setup): Add parameter.
5069 (Archive::print_stats): New function.
5070 (Archive::total_archives, Archive::total_members)
5071 (Archive::total_members_loaded): New variables.
5072 (Archive::get_file_and_offset): New function.
5073 (Archive::get_elf_object_for_member): New function.
5074 (Archive::read_all_symbols): New function.
5075 (Archive::read_symbols): New function.
5076 (Archive::Archive_member): New class.
5077 (Archive::members_): New member.
5078 (Archive::num_members_): New member.
5079 * main.cc: Include archive.h.
5080 (main): Call Archive::print_stats.
5081 * mapfile.cc (Mapfile::report_include_archive_member): Delete
5082 archive parameter; member_name is now the fully-decorated name.
5083 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
5084 * options.h: (General_options): Add --preread-archive-symbols option.
5085 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
5086 Archive::setup.
5087
de4c45bd
ILT
50882008-08-04 Ian Lance Taylor <iant@google.com>
5089
5090 * symtab.h (Symbol::use_plt_offset): New function.
5091 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
5092 * powerpc.cc (Relocate::relocate): Likewise.
5093 * sparc.cc (Relocate::relocate): Likewise.
5094 * x86_64.cc (Relocate::relocate): Likewise.
5095 * testsuite/weak_plt.sh: New test.
5096 * testsuite/weak_plt_main.cc: New test.
5097 * testsuite/weak_plt_shared.cc: New test.
5098 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
5099 (check_PROGRAMS): Add weak_plt.
5100 (check_DATA): Add weak_plt_shared.so.
5101 (weak_plt_main_pic.o, weak_plt): New targets.
5102 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
5103 * testsuite/Makefile.in: Rebuild.
5104
5105 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
5106 gcctestdir/ld.
5107 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
5108 * testsuite/Makefile.in: Rebuild.
5109
323ee3f4
AM
51102008-08-04 Alan Modra <amodra@bigpond.net.au>
5111
5112 * Makefile.am (POTFILES.in): Set LC_ALL=C.
5113 * Makefile.in: Regenerate.
5114 * po/POTFILES.in: Regenerate.
5115
7c07ecec
ILT
51162008-07-29 Ian Lance Taylor <iant@google.com>
5117
5118 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
5119 symbols before other symbols.
5120 * testsuite/script_test_2.cc (test_addr): Declare.
5121 (test_addr_alias): Declare.
5122 (main): Check that test_addr and test_addr_alias have the right
cd536b21 5123 values.
7c07ecec
ILT
5124 * testsuite/script_test_2.t: Define test_addr_alias and
5125 test_addr.
5126
5778530e
ILT
51272008-07-24 Ian Lance Taylor <iant@google.com>
5128
2a00e4fb
ILT
5129 PR 5990
5130 * descriptors.cc: New file.
5131 * descriptors.h: New file.
5132 * gold-threads.h (class Hold_optional_lock): New class.
5133 * fileread.cc: Include "descriptors.h".
5134 (File_read::~File_read): Release descriptor rather than closing
5135 it.
5136 (File_read::open) [file]: Call open_descriptor rather than open.
5137 Set is_descriptor_opened_.
5138 (File_read::open) [memory]: Assert that descriptor is not open.
5139 (File_read::reopen_descriptor): New function.
5140 (File_read::release): Release descriptor.
5141 (File_read::do_read): Make non-const. Reopen descriptor.
5142 (File_read::read): Make non-const.
5143 (File_read::make_view): Reopen descriptor.
5144 (File_read::do_readv): Likewise.
5145 * fileread.h (class File_read): Add is_descriptor_opened_ field.
5146 Update declarations.
5147 * layout.cc: Include "descriptors.h".
5148 (Layout::create_build_id): Use open_descriptor rather than open.
5149 * output.cc: Include "descriptors.h".
5150 (Output_file::open): Use open_descriptor rather than open.
5151 * archive.cc (Archive::const_iterator): Change Archive to be
5152 non-const.
5153 (Archive::begin, Archive::end): Make non-const.
5154 (Archive::count_members): Likewise.
5155 * archive.h (class Archive): Update declarations.
5156 * object.h (Object::read): Make non-const.
5157 * Makefile.am (CCFILES): Add descriptors.cc.
5158 (HFILES): Add descriptors.h.
5159 * Makefile.in: Rebuild.
5160
801647d1
ILT
5161 PR 6716
5162 * gold.h: Always include <clocale>. Add Solaris workarounds
5163 following code in binutils/sysdep.h.
5164
5edd166e
ILT
5165 PR 6048
5166 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
5167 this->eh_frame_hdr_ is NULL before using it.
5168
c89ad728
ILT
5169 * dynobj.cc (Versions::Versions): Update comment.
5170
aa86f06b
ILT
5171 * dynobj.cc (Versions::Versions): If there is an soname, use it as
5172 the base version name.
5173
5778530e
ILT
5174 * stringpool.cc (Stringpool_template::add_with_length): Set key to
5175 array size plus one.
5176 (Stringpool_template::set_string_offsets): Subtract one from key
5177 before using it as an array index.
5178 (Stringpool_template::get_offset_with_length): Likewise.
5179 (Stringpool_template::write_to_buffer): Likewise.
5180 * stringpool.h (Stringpool_template::get_offset_from_key):
5181 Likewise.
5182
057ead22
ILT
51832008-07-23 Ian Lance Taylor <iant@google.com>
5184
7f649c59
ILT
5185 PR 6658
5186 * object.h (Merged_symbol_value::value): Do our best to handle a
5187 negative addend.
5188
057ead22
ILT
5189 PR 6647
5190 * script.cc (Version_script_info::get_versions): Don't add empty
5191 version tag to return value.
5192 (Version_script_info::get_symbol_version_helper): Change return
5193 type to bool. Add pversion parameter. Change all callers.
5194 (script_register_vers_node): Don't require a non-NULL tag.
5195 * script.h (class Version_script_info): Update declarations.
5196 (Version_script_info::get_symbol_version): Change return type to
5197 bool. Add version parameter. Change all callers.
5198 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
5199 handling. Handle an empty version from a version script.
5200 (Symbol_table::define_special_symbol): Likewise.
5201 * testsuite/ver_test_10.script: New file.
5202 * testsuite/ver_test_10.sh: New file.
5203 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
5204 (check_DATA): Add ver_test_10.syms.
5205 (ver_test_10.syms, ver_test_10.so): New target.
5206 * testsuite/Makefile.in: Rebuild.
5207
58e54ac2
CD
52082008-07-23 Simon Baldwin <simonb@google.com>
5209
5210 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
5211 to zero for undefined symbols from dynamic libraries.
5212
95d14cd3
ILT
52132008-07-23 Ian Lance Taylor <iant@google.com>
5214
5215 * symtab.cc (Symbol_table::resolve): Remove version parameter.
5216 Change all callers.
5217 * symtab.h (class Symbol_table): Update declaration.
5218 * testsuite/ver_test_9.cc: New file.
5219 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
5220 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
5221 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
5222 (ver_test_9.so, ver_test_9.o): New targets.
5223 * testsuite/Makefile.in: Rebuild.
5224
92de84a6
ILT
52252008-07-22 Ian Lance Taylor <iant@google.com>
5226
34810851
ILT
5227 * options.h (class General_options): Define --check-sections.
5228 * layout.cc (Layout::set_segment_offsets): Handle
5229 --check-sections.
5230
af6156ef
ILT
5231 * options.h (class General_options): Define -n/--nmagic and
5232 -N/--omagic.
5233 * options.cc (General_options::finalize): For -n/--nmagic or
5234 -N/--omagic, set -static.
5235 * layout.cc (Layout::attach_allocated_section_to_segment): If
5236 -N/--omagic, don't put read-only and read-write sections in
5237 different segments.
5238 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
5239 finding a read-only segment.
5240 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
5241 don't set the minimum segment alignment to the common page size,
5242 and don't set the file offset to the address modulo the page size.
5243 * script-sections.cc (Script_sections::create_segments): If
5244 -n/--omagic, don't put read-only and read-write sections in
5245 different segments.
5246
92de84a6
ILT
5247 * cref.cc: New file.
5248 * cref.h: New file.
5249 * options.h (class General_options): Add --print-symbol-counts.
5250 * main.cc (main): Issue defined symbol report if requested.
5251 * archive.cc (Archive::interpret_header): Make into a const member
5252 function.
5253 (Archive::add_symbols): Call Input_objects::archive_start and
5254 archive_stop.
5255 (Archive::const_iterator): Define new class.
5256 (Archive::begin, Archive::end): New functions.
5257 (Archive::include_all_members): Rewrite to use iterator.
5258 (Archive::count_members): New function.
5259 * archive.h (class Archive): Update declarations.
5260 (Archive::filename): New function.
5261 * object.cc: Include "cref.h".
5262 (Sized_relobj::Sized_relobj): Initialize defined_count_.
5263 (Sized_relobj::do_get_global_symbol_counts): New function.
5264 (Input_objects::add_object): Add object to cross-referencer.
5265 (Input_objects::archive_start): New function.
5266 (Input_objects::archive_stop): New function.
5267 (Input_objects::print_symbol_counts): New function.
5268 * object.h: Declare Cref and Archive.
5269 (Object::get_global_symbol_counts): New function.
5270 (Object::do_get_global_symbol_counts): New pure virtual function.
5271 (class Sized_relobj): Add defined_count_ field. Update
5272 declarations.
5273 (class Input_objects): Add cref_ field. Update constructor.
5274 Update declarations.
5275 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
5276 defined_count_.
5277 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
5278 symbol counts.
5279 (Sized_dynobj::do_get_global_symbol_counts): New function.
5280 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
5281 defined_count_. Update declarations. Define Symbols typedef.
5282 * symtab.cc (Symbol_table::add_from_relobj): Add defined
5283 parameter. Change all callers.
5284 (Symbol_table::add_from_dynobj): Add sympointers and defined
5285 parameters. Change all callers.
5286 * symtab.h (class Symbol_table): Update declarations.
5287 * Makefile.am (CCFILES): Add cref.cc.
5288 (HFILES): Add cref.h.
5289 * Makefile.in: Rebuild.
5290
3f7c5e1d
CD
52912008-07-22 Simon Baldwin <simonb@google.com>
5292
5293 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
5294 to zero when writing undefined symbols.
5295
e0b64032
ILT
52962008-07-22 Ian Lance Taylor <iant@google.com>
5297
5298 * output.cc (Output_section::add_input_section): Don't try to
5299 merge empty merge sections.
5300
096b02cf
CS
53012008-07-21 Craig Silverstein <csilvers@google.com>
5302
5303 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
5304 Include symbol version in error message.
cd536b21 5305
1d1f116d
CD
53062008-07-20 Chris Demetriou <cgd@google.com>
5307
cd536b21 5308 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
5309 (RANDOM_SEED_CFLAGS): New substituted variable.
5310 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
5311 * configure: Rebuild.
5312 * Makefile.in: Likewise.
5313 * testsuite/Makefile.in: Likewise.
5314
a18f591e
ILT
53152008-07-18 Ian Lance Taylor <iant@google.com>
5316
5317 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
5318 where we see NAME/NULL and NAME/VERSION as separate symbols.
5319 * testsuite/ver_test_main.cc (main): Call t4.
5320 (t4, t4_2a): Define.
5321 * testsuite/ver_test_2.cc (t4_2): Define.
5322 * testsuite/ver_test_2.script: Put t4_2a in VER2.
5323 * testsuite/ver_test_4.cc (t4_2a): Define.
5324 * testsuite/ver_test_4.script: Put t4_2a in VER2.
5325 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
5326
c6e3f6ed
ILT
53272008-07-17 Ian Lance Taylor <iant@google.com>
5328
5329 * dynobj.cc (Versions::add_def): If we give an error about a
5330 missing version, go ahead and create the version anyhow.
5331
ef9beddf
ILT
53322008-07-10 Ian Lance Taylor <iant@google.com>
5333
5334 Handle output sections with more than 0x7fffffff bytes.
5335 * object.h (class Relobj): Change map_to_output_ to
5336 output_sections_, and just keep a section pointer. Change all
5337 uses. Move comdat group support to Sized_relobj.
5338 (Relobj::is_section_specially_mapped): Remove.
5339 (Relobj::output_section): Remove poff parameter. Change all
5340 callers.
5341 (Relobj::output_section_offset): New function.
5342 (Relobj::set_section_offset): Rewrite.
5343 (Relobj::map_to_output): Remove.
5344 (Relobj::output_sections): New function.
5345 (Relobj::do_output_section_offset): New pure virtual function.
5346 (Relobj::do_set_section_offset): Likewise.
5347 (class Sized_relobj): Add section_offsets_ field. Add comdat
5348 group support from Relobj. Update declarations.
5349 (Sized_relobj::get_output_section_offset): New function.
5350 (Sized_relobj::do_output_section_offset): New function.
5351 (Sized_relobj::do_set_section_offset): New function.
5352 * object.cc (Relobj::output_section_address): Remove.
5353 (Sized_relobj::Sized_relobj): Initialize new fields.
5354 (Sized_relobj::include_section_group): Cast find_kept_object to
5355 Sized_relobj.
5356 (Sized_relobj::include_linkonce_section): Likewise.
5357 (Sized_relobj::do_layout): Use separate arrays for output section
5358 and output offset.
5359 (Sized_relobj::do_count_local_symbols): Change map_to_output to
5360 output_sections.
5361 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
5362 output_sections and section_offsets.
5363 (Sized_relobj::write_local_symbols): Likewise.
5364 (map_to_kept_section): Compute output address directly.
5365 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
5366 output_sections and section_offsets.
5367 (Sized_relobj::write_sections): Likewise.
5368 (Sized_relobj::relocate_sections): Likewise.
5369 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
5370 * output.h (class Output_reloc): Update declarations. Change
5371 u2_.relobj to Sized_relobj*.
5372 (class Output_data_reloc): Change add functions to use
5373 Sized_relobj*.
5374 * output.cc (Output_reloc::Output_reloc): Change relobj to
5375 Sized_relobj*.
5376 (Output_reloc::local_section_offset): Change return type to
5377 Elf_Addr. Use get_output_section_offset.
5378 (Output_reloc::get_address): Likewise.
5379 (Output_section::is_input_address_mapped): Don't call
5380 is_section_specially_mapped.
5381 (Output_section::output_offset): Likewise.
5382 (Output_section::output_address): Likewise.
5383 (Output_section::starting_output_address): Likewise.
5384 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
5385 parameter to Sized_relobj*.
5386 (Copy_relocs::need_copy_reloc): Likewise.
5387 (Copy_relocs::save): Likewise.
5388 * copy-relocs.h (class Copy_relocs): Update declarations.
5389 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
5390 Sized_relobj*. Change relobj_ field to Sized_relobj*.
5391 * target-reloc.h (relocate_for_relocatable): Change
5392 offset_in_output_section type to Elf_Addr. Change code that uses
5393 it as well.
5394 * layout.cc (Layout::layout): Always set *off.
5395 * mapfile.cc (Mapfile::print_input_section): Use
5396 output_section_offset.
5397 * i386.cc (Target_i386::copy_reloc): Change object parameter to
5398 Sized_relobj*.
5399 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
5400 * sparc.cc (Target_sparc::copy_reloc): Likewise.
5401 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
5402
5cb66f97
ILT
54032008-07-03 Ian Lance Taylor <iant@google.com>
5404
5405 * layout.cc (Layout::include_section): Do not discard unrecognized
5406 SHT_STRTAB sections.
5407
afe47622
CS
54082008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
5409
5410 * script.cc (Lex::can_continue_name): Make '?' allowable in
5411 version-script names.
5412 * testsuite/version_script.map: Change glob pattern to use '?'
5413
5adf9721
ILT
54142008-06-30 Manish Singh <yosh@gimp.org>
5415
5416 PR 6585
5417 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
5418 Correct typo.
5419
e6fde208
ILT
54202008-06-30 Ian Lance Taylor <iant@google.com>
5421
5422 PR 6660
5423 PR 6682
5424 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
5425 versions]: Don't try to read the value in the contents, since we
5426 don't use it. Use the template endianness when writing.
5427
3f2e6a2d
CC
54282008-06-25 Cary Coutant <ccoutant@google.com>
5429
5430 * fileread.cc (File_read::make_view): Assert on zero-length view.
5431 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
5432 symbol table when there are no symbols to read.
5433
c43d3a48
CS
54342008-06-23 Craig Silverstein <csilvers@google.com>
5435
5436 * version.cc (version_string): Bump to 1.7
5437
5f494ea0
CS
54382008-06-18 Craig Silverstein <csilvers@google.com>
5439
5440 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
5441 constant 0xFFFF to type Valtype.
5442 (Powerpc_relocate_functions::rel16_ha): Likewise.
5443
c42e122e
ILT
54442008-06-17 Ian Lance Taylor <iant@google.com>
5445
f34787f8
ILT
5446 * output.h (Output_section::Input_section): Initialize p2align_ to
5447 zero for Output_section_data constructors.
5448 (Output_section::Input_section::addralign): If not an input
5449 section, return the alignment of the Output_section_data.
5450 * testsuite/copy_test.cc: New file.
5451 * testsuite/copy_test_1.cc: New file.
5452 * testsuite/copy_test_2.cc: New file.
5453 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
5454 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
5455 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
5456 (copy_test_1_pic.o, copy_test_1.so): New targets.
5457 (copy_test_2_pic.o, copy_test_2.so): New targets.
5458 * testsuite/Makefile.in: Rebuild.
5459
c42e122e
ILT
5460 * script-sections.cc (Script_sections::place_orphan): Initialize
5461 local variable exact.
5462
ce3ac18a
DE
54632008-06-13 David Edelsohn <edelsohn@gnu.org>
5464
5465 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
5466
42cacb20
DE
54672008-06-12 David Edelsohn <edelsohn@gnu.org>
5468 David S. Miller <davem@davemloft.net>
5469
5470 * powerpc.cc: New file.
5471 * Makefile.am (TARGETSOURCES): Add powerpc.cc
5472 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
5473 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
5474 * Makefile.in: Rebuild.
5475
7b308235
ILT
54762008-06-09 Ian Lance Taylor <iant@google.com>
5477
5478 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
5479 <exception>.
5480 (throwing, orig_terminate): New static variables.
5481 (terminate_handler): New static function.
5482 (t2): Set terminate handler.
5483
f0b886e3
ILT
54842008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
5485
5486 PR 6584
cd536b21 5487 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
5488 alignment.
5489
3e90f135
CC
54902008-05-30 Cary Coutant <ccoutant@google.com>
5491
5492 * archive.cc (Archive::include_all_members) Correct to step
5493 over symbol table and extended name table in thin archives.
5494
e09ad04a
ILT
54952008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
5496
5497 PR 6407
5498 * target-reloc.h (relocate_for_relocatable): Fix new_offset
5499 calculation.
5500
62b01cb5
ILT
55012008-05-28 Caleb Howe <cshowe@google.com>
5502
5503 * reduced_debug_output.cc: New file.
5504 * reduced_debug_output.h: New file.
92de84a6 5505 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
5506 * options.cc (General_options::finalize): Add strip_debug_non_line
5507 to the strip heirarchy.
5508 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
5509 fields.
5510 * layout.cc: Include "reduced_debug_output.h".
5511 (Layout::Layout): Initialize new fields.
5512 (line_only_debug_sections): New static array.
5513 (is_lines_only_debug_sections): New static inline function.
5514 (Layout::include_section): Handle --strip-debug-non-line.
5515 (Layout::make_output_section): If --strip-debug-non-line, build
5516 new output sections for .debug_abbrev and .debug_info.
5517 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
5518 gold. Warn about possible overflow.
5519 (read_signed_LEB_128): Likewise.
5520 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
5521 (read_signed_LEB_128): Declare.
5522 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
5523 (HFILES): Add reduced_debug_output.h.
5524 * Makefile.in: Rebuild.
5525
7d9e3d98
ILT
55262008-05-21 Ian Lance Taylor <iant@google.com>
5527
5528 * mapfile.cc: New file.
5529 * mapfile.h: New file.
5530 * options.h (class General_options): Add -M/--print-map and -Map.
5531 * options.cc (General_options::finalize): Make -M equivalent to
5532 -Map -.
5533 * main.cc: Include <cstdio> and "mapfile.h".
5534 (main): Open mapfile if requested.
5535 * gold.cc (class Middle_runner): Add mapfile_ field. Update
5536 constructor. Change caller.
5537 (queue_initial_tasks): Add mapfile parameter. Change caller.
5538 (queue_middle_tasks): Likewise.
5539 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
5540 declarations.
5541 * archive.cc: Include "mapfile.h".
5542 (Archive::add_symbols): Add mapfile parameter. Change all
5543 callers. Pass mapfile, symbol, and reason to include_member.
5544 (Archive::include_all_members): Add mapfile parameter. Change all
5545 callers.
5546 (Archive::include_member): Add mapfile, sym, and why parameters.
5547 Change all callers. Report inclusion to map file.
5548 * archive.h: Include "fileread.h".
5549 (class Archive): Update declarations.
5550 (Archive::file): New const method.
5551 (class Add_archive_symbols): Add mapfile_ field. Update
5552 constructor. Change all callers.
5553 * readsyms.h (class Read_symbols): Likewise.
5554 (class Finish_group): Likewise.
5555 (class Read_script): Likewise.
5556 * common.cc: Include "mapfile.h".
5557 (Symbol_table::allocate_commons): Add mapfile parameter. Change
5558 all callers.
5559 (Symbol_table::do_allocate_commons): Likewise.
5560 (Symbol_table::do_allocate_commons_list): Likewise. Report common
5561 symbol allocation to mapfile.
5562 * common.h (class Allocate_commons_task): Add mapfile_ field.
5563 Update constructor. Change all callers.
5564 * symtab.h (class Symbol_table): Update declarations.
5565 * layout.cc: Include "mapfile.h".
5566 (Layout_task_runner::run): Print information to mapfile.
5567 (Layout::create_gold_note): Change Output_data_fixed_space to
5568 Output_data_zero_fill.
5569 (Layout::create_build_id): Likewise.
5570 (Layout::print_to_mapfile): New function.
5571 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
5572 constructor. Change caller.
5573 (class Layout): Declare print_to_mapfile.
5574 * output.cc (Output_section::Input_section::print_to_mapfile): New
5575 function.
5576 (Output_section::add_input_section): If producing a map, always
5577 add to input_sections_ list.
5578 (Output_section::do_print_to_mapfile): New function.
5579 (Output_segment::print_sections_to_mapfile): New function.
5580 (Output_segment::print_section_list_to_mapfile): New function.
5581 * output.h: Include "mapfile.h".
5582 (Output_data::print_to_mapfile): New function.
5583 (Output_data::do_print_to_mapfile): New virtual function.
5584 (Output_segment_headers::do_print_to_mapfile): New function.
5585 (Output_file_header::do_print_to_mapfile): New function.
5586 (Output_data_const::do_print_to_mapfile): New function.
5587 (class Output_data_const_buffer): Add map_name_ field. Update
5588 constructor. Change all callers. Add do_print_to_mapfile
5589 function.
5590 (class Output_data_fixed_space): Likewise.
5591 (class Output_data_space): Likewise.
5592 (class Output_data_zero_fill): New class.
5593 (Output_data_strtab::do_print_to_mapfile): New function.
5594 (Output_data_reloc_base::do_print_to_mapfile): New function.
5595 (Output_relocatable_relocs::do_print_to_mapfile): New function.
5596 (Output_data_group::do_print_to_mapfile): New function.
5597 (Output_data_got::do_print_to_mapfile): New function.
5598 (Output_data_dynamic::do_print_to_mapfile): New function.
5599 (Output_symtab_xindex::do_print_to_mapfile): New function.
5600 (class Output_section): Declare do_print_to_mapflie. Declare
5601 print_to_mapfile in Input_section.
5602 (class Output_segment): Declare new functions.
5603 * object.h (Sized_relobj::symbol_count): New function.
5604 * script-sections.cc
5605 (Output_section_element_dot_assignment::set_section_addresses):
5606 Change Output_data_fixed_space to Output_data_zero_fill.
5607 (Output_data_expression::do_print_to_mapfile): New function.
5608 * script.cc (read_input_script): Add mapfile parameter. Change
5609 all callers.
5610 * script.h (read_input_script): Update declaration.
5611 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
5612 (Eh_frame::do_print_to_mapfile): New function.
5613 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
5614 (Output_merge_string::do_print_to_mapfile): New function.
5615 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
5616 function.
5617 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
5618 function.
5619 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
5620 function.
5621 * Makefile.am (CCFILES): Add mapfile.cc.
5622 (HFILES): Add mapfile.h.
5623 * Makefile.in: Rebuild.
5624
9f1d377b
ILT
56252008-05-19 Ian Lance Taylor <iant@google.com>
5626
5627 * options.h (class General_options): Add -z relro.
5628 * layout.cc (Layout::Layout): Initialize relro_segment_.
5629 (Layout::add_output_section_data): Return the output section.
5630 (Layout::make_output_section): Rcognize relro sections and mark
5631 them appropriately.
5632 (Layout::attach_allocated_section_to_segment): Put relro sections
5633 in a PT_GNU_RELRO segment.
5634 (Layout::create_initial_dynamic_sections): Mark the .dynamic
5635 section as relro.
5636 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
5637 PT_TLS segments.
5638 (Layout::linkonce_mapping): Map d.rel.ro.local to
5639 .data.rel.ro.local.
5640 (Layout::output_section_name): Us .data.rel.ro.local for any
5641 section which begins with that.
5642 * layout.h (class Layout): Update add_output_section_data
5643 declaration. Add relro_segment_ field.
5644 * output.cc (Output_section::Output_section): Initialize is_relro_
5645 and is_relro_local_ fields.
5646 (Output_segment::add_output_section): Group relro sections.
5647 (Output_segment::is_first_section_relro): New function.
5648 (Output_segment::maximum_alignment): If there is a relro section,
5649 align the segment to the common page size.
5650 (Output_segment::set_section_addresses): Track whether we are
5651 looking at relro sections. If the last section is a relro
5652 section, align to the common page size.
5653 (Output_segment::set_section_list_addresses): Add in_relro
5654 parameter. Change all callers. Align to the page size when
5655 moving from relro to non-relro section.
5656 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
5657 segment.
5658 * output.h (class Output_section): Add is_relro_ and
5659 is_relro_local_ fields.
5660 (Output_section::is_relro): New function.
5661 (Output_section::set_is_relro): New function.
5662 (Output_section::is_relro_local): New function.
5663 (Output_section::set_is_relro_local): New function.
5664 (class Output_segment): Update declarations.
5665 * i386.cc (Target_i386::got_section): Mark .got section as relro.
5666 * sparc.cc (Target_sparc::got_section): Likewise.
5667 * x86_64.cc (Target_x86_64::got_section): Likewise.
5668 * testsuite/relro_test_main.cc: New file.
5669 * testsuite/relro_test.cc: New file.
5670 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
5671 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
5672 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
5673 (relro_test.so, relro_test_pic.o): New targets.
5674 * testsuite/Makefile.in: Rebuild.
5675
a984ee1d
ILT
56762008-05-16 Ian Lance Taylor <iant@google.com>
5677
01676dcd
ILT
5678 * output.cc (Output_segment::add_output_section): Remove front
5679 parameter.
5680 * output.h (class Output_segment): Remove
5681 add_initial_output_section and overloaded add_output_section.
5682 Update declaration of remaining add_output_section.
5683 * layout.cc (Layout::create_interp): Call add_output_section
5684 rather than add_initial_output_section.
5685 (Layout::finish_dynamic_section): Likewise.
5686
497897f9
ILT
5687 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
5688 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
5689 know the dynamic type.
5690 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
5691 field. Initialize it in constructor.
5692 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
5693 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
5694 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
5695 reloc.
5696
a984ee1d
ILT
5697 * output.cc (Output_reloc::get_address): Change return type to
5698 Elf_Addr.
5699 * output.h (class Output_reloc): Update get_address declaration.
5700 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
5701 for section addresses.
5702
55ba0940
ILT
57032008-05-09 Ian Lance Taylor <iant@google.com>
5704
5705 PR 6493
5706 * gold.cc (gold_nomem): Use return value of write.
5707
75517b77
ILT
57082008-05-08 Ian Lance Taylor <iant@google.com>
5709
5710 * symtab.c (Symbol::init_base_output_data): Add version
5711 parameter. Change all callers.
5712 (Symbol::init_base_output_segment): Likewise.
5713 (Symbol::init_base_constant): Likewise.
5714 (Symbol::init_base_undefined): Likewise.
5715 (Sized_symbol::init_output_data): Likewise.
5716 (Sized_symbol::init_output_segment): Likewise.
5717 (Sized_symbol::init_constant): Likewise.
5718 (Sized_symbol::init_undefined): Likewise.
5719 (Symbol_table::do_define_in_output_data): If the new symbol has a
5720 version, mark it as the default.
5721 (Symbol_table::do_define_in_output_segment): Likewise.
5722 (Symbol_table::do_define_as_constant): Likewise.
5723 * symtab.h (class Symbol): Update declarations.
5724 (class Sized_symbol): Likewise.
5725 * resolve.cc (Symbol::override_version): New function.
c42e122e 5726 (Symbol::override_base): Call override_version.
75517b77
ILT
5727 (Symbol::override_base_with_special): Likewise.
5728 * testsuite/ver_script_8.script: New file.
5729 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
5730 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
5731 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
5732 (ver_test_8_1.so, ver_test_8_2.so): New targets.
5733
f1f70eae
ILT
57342008-05-06 Ian Lance Taylor <iant@google.com>
5735
f3e9c5c5
ILT
5736 PR 6049
5737 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
5738 functions.
5739 (class General_options): Remove existing --undefined, and add
5740 --no-undefined instead. Add new --undefined as synonym for -u.
5741 * archive.cc (Archive::add_symbols): Check whether symbol was
5742 named with -u.
5743 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
5744 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
5745 all uses. Add IS_UNDEFINED. Update declarations to split
5746 different versions of init_base. Declare init_base_undefined.
5747 (Symbol::is_defined): Handle IS_UNDEFINED.
5748 (Symbol::is_undefined): Likewise.
5749 (Symbol::is_weak_undefined): Call is_undefined.
5750 (Symbol::is_absolute): Handle IS_CONSTANT.
5751 (class Sized_symbol): Update declarations to split different
5752 versions of init. Declare init_undefined.
5753 (class Symbol_table): Declare new functions.
5754 * symtab.cc (Symbol::init_base_object): Rename from init_base.
5755 Change all callers.
5756 (Symbol::init_base_output_data): Likewise.
5757 (Symbol::init_base_output_segment): Likewise.
5758 (Symbol::init_base_constant): Likewise.
5759 (Symbol::init_base_undefined): New function.
5760 (Sized_symbol::init_object): Rename from init. Change all
5761 callers.
5762 (Sized_symbol::init_output_data): Likewise.
5763 (Sized_symbol::init_output_segment): Likewise.
5764 (Sized_symbol::init_constant): Likewise.
5765 (Sized_symbol::init_undefined): New function.
5766 (Symbol_table::add_undefined_symbols_from_command_line): New
5767 function.
5768 (Symbol_table::do_add_undefined_symbols_from_command_line): New
5769 function.
5770 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
5771 (Symbol::output_section): Likewise.
5772 (Symbol::set_output_section): Likewise.
5773 (Symbol_table::sized_finalize_symbol): Likewise.
5774 (Symbol_table::sized_write_globals): Likewise.
5775 * resolve.cc (Symbol_table::should_override): Likewise.
5776 (Symbol::override_base_with_special): Likewise.
5777
8bdcdf2c
ILT
5778 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
5779 symbol, change it to have default visibility.
5780 * testsuite/protected_1.cc: New file.
5781 * testsuite/protected_2.cc: New file.
5782 * testsuite/protected_3.cc: New file.
5783 * testsuite/protected_main_1.cc: New file.
5784 * testsuite/protected_main_2.cc: New file.
5785 * testsuite/protected_main_3.cc: New file.
5786 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
5787 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
5788 (protected_1_LDFLAGS, protected_1_LDADD): Define.
5789 (protected_1.so): New target.
5790 (protected_1_pic.o, protected_2_pic.o): New targets.
5791 (protected_3_pic.o): New target.
5792 (check_PROGRAMS): Add protected_2.
5793 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
5794 (protected_2_LDFLAGS, protected_2_LDADD): Define.
5795 * testsuite/Makefile.in: Rebuild.
5796
2b706932
ILT
5797 * options.h (DEFINE_var): Add set_user_set_##varname__.
5798 (DEFINE_bool_alias): New macro.
5799 (class General_options): Define -Bstatic using DEFINE_bool_alias
5800 rather than DEFINE_special. Add --undefined as an alias for -z
5801 defs.
5802 * options.cc (General_options::parse_Bstatic): Remove.
5803
d82a5bcc
ILT
5804 * options.h (class General_options): Add --fatal-warnings.
5805 * main.cc (main): Implement --fatal-warnings.
5806 * errors.h (Errors::warning_count): New function.
5807
f1f70eae
ILT
5808 * options.h (class General_options): Add -Bsymbolic-functions.
5809 * symtab.h (Symbol::is_preemptible): Check for
5810 -Bsymbolic-functions.
5811
8825ac63
ILT
58122008-05-05 Ian Lance Taylor <iant@google.com>
5813
d98bc257
ILT
5814 * options.h (DEFINE_bool): For DASH_Z, create the negative option
5815 as noVARNAME rather than no-VARNAME.
5816 (class General_options): Add option -z combreloc.
5817 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
5818 get_address.
5819 (Output_reloc::sort_before) [SHT_REL]: New function.
5820 (Output_reloc::sort_before) [SHT_RELA]: New function.
5821 (class Output_data_reloc_base): Add sort_relocs_ field. Define
5822 Sort_relocs_comparison.
5823 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
5824 parameter. Change all callers.
5825 (Output_data_reloc::Output_data_reloc) [both versions]: Add
5826 sort_relocs parameter. Change all callers.
5827 * output.cc (Output_reloc::get_address): New function, broken out
5828 of write_rel.
5829 (Output_reloc::write_rel): Call it.
5830 (Output_reloc::compare): New function.
5831 (Output_data_reloc_base::do_write): Optionally sort relocs.
5832
60b2b4e7
ILT
5833 * configure.ac: If targ_extra_obj is set, link it in.
5834 * configure.tgt: Initialize all variables.
5835 (x86_64*): Set targ_extra_obj and targ_extra_size.
5836 * configure: Rebuild.
5837
8825ac63
ILT
5838 * object.cc (Sized_relobj::include_section_group): Adjust section
5839 indexes read from group data. Build vector to pass to
5840 layout_group.
5841 * layout.cc (Layout::layout_group): Add flags and shndxes
5842 parameters. Remove contents parameter. Change caller. Update
5843 explicit instantiations.
5844 * layout.h (class Layout): Update layout_group declaration.
5845 * output.cc (Output_data_group::Output_data_group): Add flags and
5846 input_shndxes parameters. Remove contents parameter. Change
5847 caller.
5848 (Output_data_group::do_write): Change input_sections_ to
5849 input_shndxes_.
5850 * output.h (class Output_data_group): Update constructor
5851 declaration. Rename input_sections_ to input_shndxes_.
5852 * testsuite/many_sections_test.cc: Add template.
5853
e94cf127
CC
58542008-04-30 Cary Coutant <ccoutant@google.com>
5855
4418b2d5
CC
5856 * target-reloc.h (relocate_section): Fix dead-pointer bug.
5857
e94cf127
CC
5858 * layout.cc (Layout::include_section): Refactored check for debug
5859 info section.
5860 (Layout::add_comdat): Add new parameters. Change type
5861 of signature parameter. Add object and shndx to signatures table.
5862 (Layout::find_kept_object): New function.
5863 * layout.h: Include <cstring>.
5864 (Layout::is_debug_info_section): New function.
5865 (Layout::add_comdat): Add new parameters.
5866 (Layout::find_kept_object): New function.
5867 (Layout::Kept_section): New struct.
5868 (Layout::Signatures): Change type of map range.
5869 * object.cc (Relobj::output_section_address): New function.
5870 (Sized_relobj::include_section_group): Add new parameters. Change
5871 calls to Layout::add_comdat. Change to build table of kept comdat
5872 groups and table mapping discarded sections to kept sections.
5873 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
5874 (Sized_relobj::do_layout): Change calls to include_section_group and
5875 include_linkonce_section.
5876 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
5877 value to zero when section is discarded.
5878 (Sized_relobj::map_to_kept_section): New function.
5879 * object.h (Relobj::output_section_address): New function.
5880 (Relobj::Comdat_group): New type.
5881 (Relobj::find_comdat_group): New function.
5882 (Relobj::Comdat_group_table): New type.
5883 (Relobj::Kept_comdat_section): New type.
5884 (Relobj::Kept_comdat_section_table): New type.
5885 (Relobj::add_comdat_group): New function.
5886 (Relobj::set_kept_comdat_section): New function.
5887 (Relobj::get_kept_comdat_section): New function.
5888 (Relobj::comdat_groups_): New field.
5889 (Relobj::kept_comdat_sections_): New field.
5890 (Symbol_value::input_value): Update comment.
5891 (Sized_relobj::map_to_kept_section) New function.
5892 (Sized_relobj::include_linkonce_section): Add new parameter.
5893 * target-reloc.h (Comdat_behavior): New type.
5894 (get_comdat_behavior): New function.
5895 (relocate_section): Add code to map a discarded section to the
5896 corresponding kept section when applying a relocation.
5897
e4e5049b
CS
58982008-04-30 Craig Silverstein <csilvers@google.com>
5899
5900 * dwarf_reader.cc (next_generation_count): New static var.
5901 (Addr2line_cache_entry): New struct.
5902 (addr2line_cache): New static var.
5903 (Dwarf_line_info::one_addr2line): Added caching.
5904 (Dwarf_line_info::clear_addr2line_cache): New function.
5905 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
5906 cache-size parameter.
5907 (Dwarf_line_info::one_addr2line_cache): New function.
5908 * symtab.cc (Symbol_table::detect_odr_violations): Pass
5909 new cache-size argument to one_addr2line(), and clear cache.
5910
d09e9154
CC
59112008-04-28 Cary Coutant <ccoutant@google.com>
5912
5913 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
5914 R_386_PC8 relocations.
5915
7ef73768
ILT
59162008-04-23 Ian Lance Taylor <iant@google.com>
5917
55438702
ILT
5918 * object.cc (Sized_relobj::include_section_group): Check for
5919 invalid section group.
5920
c165fb93
ILT
5921 * object.cc (make_elf_object): Correct test for 64-bit ELF file
5922 header size.
5923
7ef73768
ILT
5924 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
5925 than read for file header.
5926 * archive.cc (Archive::include_member): Likewise.
5927
6194aaab
L
59282008-04-23 Paolo Bonzini <bonzini@gnu.org>
5929
5930 * aclocal.m4: Regenerate.
5931 * configure: Regenerate.
5932
d491d34e
ILT
59332008-04-19 Ian Lance Taylor <iant@google.com>
5934
5ea2bac6
ILT
5935 * version.cc (version_string): Bump to 1.6.
5936
7bc3e21a
ILT
5937 * testsuite/Makefile.am (many_sections_r_test): New target.
5938 (many_sections_r_test_SOURCES): Remove.
5939 (many_sections_r_test_DEPENDENCIES): Remove.
5940 (many_sections_r_test_LDFLAGS): Remove.
5941 (many_sections_r_test_LDADD): Remove.
5942
7fcd3aa9
ILT
5943 * object.cc (Sized_relobj::do_add_symbols): Always pass
5944 local_symbol_count_ to add_from_relobj.
5945
4c94d6ae
ILT
5946 * testsuite/Makefile.am (many_sections_check.h): Only check one in
5947 every thousand variables.
5948 * testsuite/Makefile.in: Rebuild.
5949
d491d34e
ILT
5950 * object.cc (Xindex::initialize_symtab_xindex): New function.
5951 (Xindex::read_symtab_xindex): New function.
5952 (Xindex::sym_xindex_to_shndx): New function.
5953 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
5954 available.
5955 (Sized_relobj::do_initialize_xindex): New function.
5956 (Sized_relobj::do_read_symbols): Adjust section links.
5957 (Sized_relobj::symbol_section_and_value): Add is_ordinary
5958 parameter. Change all callers.
5959 (Sized_relobj::include_section_group): Adjust section links and
5960 symbol section indexes.
5961 (Sized_relobj::do_layout): Adjust section links.
5962 (Sized_relobj::do_count_local_symbols): Adjust section links and
5963 symbol section indexes.
5964 (Sized_relobj::do_finalize_local_symbols): Distinguish between
5965 ordinary and special symbols.
5966 (Sized_relobj::write_local_symbols): Add symtab_xindex and
5967 dynsym_xindex parameters. Change all callers. Adjust section
5968 links. Use SHN_XINDEX when needed.
5969 (Sized_relobj::get_symbol_location_info): Adjust section links.
5970 Don't get fooled by special symbols.
5971 * object.h (class Xindex): Define.
5972 (class Object): Add xindex_ parameter. Declare virtual functoin
5973 do_initialize_xindex.
5974 (Object::adjust_sym_shndx): New function.
5975 (Object::set_xindex): New protected function.
5976 (class Symbol_value): Add is_ordinary_shndx_ field.
5977 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
5978 (Symbol_value::value): Assert ordinary section.
5979 (Symbol_value::initialize_input_to_output_map): Likewise.
5980 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
5981 Change all callers.
5982 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
5983 all callers.
5984 (class Sized_relobj): Update declarations.
5985 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
5986 parameter. Change all callers.
5987 (Sized_relobj::adjust_shndx): New function.
5988 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
5989 field.
5990 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
5991 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
5992 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
5993 (Sized_dynobj::read_dynsym_section): Adjust section links.
5994 (Sized_dynobj::read_dynamic): Likewise.
5995 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
5996 section links.
5997 (Sized_dynobj::do_initialize_xindex): New function.
5998 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
5999 do_initialize_xindex.
6000 (Sized_dynobj::adjust_shndx): New function.
6001 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
6002 dynsym_xindex_ fields.
6003 (Layout::finalize): Add a call to set_section_indexes before
6004 creating the symtab sections.
6005 (Layout::set_section_indexes): Don't do anything if the section
6006 already has a section index.
6007 (Layout::create_symtab_sections): Add shnum parameter. Change
6008 caller. Create .symtab_shndx section if needed.
6009 (Layout::create_shdrs): Add shstrtab_section parameter. Change
6010 caller.
6011 (Layout::allocated_output_section_count): New function.
6012 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
6013 needed.
6014 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
6015 fields. Update declarations.
6016 (Layout::symtab_xindex): New function.
6017 (Layout::dynsym_xindex): New function.
6018 (class Write_symbols_task): Add layout_ field.
6019 (Write_symbols_task::Write_symbols_task): Add layout parameter.
6020 Change caller.
6021 * output.cc (Output_section_headers::Output_section_headers): Add
6022 shstrtab_section parameter. Change all callers.
6023 (Output_section_headers::do_sized_write): Store overflow values
6024 for section count and section string table section index in
6025 section header zero.
6026 (Output_file_header::do_sized_write): Check for overflow of
6027 section count and section string table section index.
6028 (Output_symtab_xindex::do_write): New function.
6029 (Output_symtab_xindex::endian_do_write): New function.
6030 * output.h (class Output_section_headers): Add shstrtab_section_.
6031 Update declarations.
6032 (class Output_symtab_xindex): Define.
6033 (Output_section::has_out_shndx): New function.
6034 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
6035 field.
6036 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
6037 Change all callers.
6038 (Sized_symbol::init): Likewise.
6039 (Symbol::output_section): Check for ordinary symbol.
6040 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
6041 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
6042 callers.
6043 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
6044 Change all callers. Simplify handling of symbols from sections
6045 not included in the link.
6046 (Symbol_table::add_from_dynobj): Handle ordinary symbol
6047 distinction.
6048 (Weak_alias_sorter::operator()): Assert that symbols are
6049 ordinary.
6050 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
6051 distinction.
6052 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
6053 parameters. Change all callers.
6054 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
6055 symbol distinction. Use SHN_XINDEX when needed.
6056 (Symbol_table::write_section_symbol): Add symtab_xindex
6057 parameter. Change all callers.
6058 (Symbol_table::sized_write_section_symbol): Likewise. Use
6059 SHN_XINDEX when needed.
6060 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
6061 declarations.
6062 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
6063 (Symbol::is_defined): Check is_ordinary.
6064 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
6065 (Symbol::is_absolute, Symbol::is_common): Likewise.
6066 (class Sized_symbol): Update declarations.
6067 (class Symbol_table): Update declarations.
6068 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
6069 parameters. Change all callers.
6070 (Sized_symbol::override): Likewise.
6071 (Symbol_table::override): Likewise.
6072 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
6073 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
6074 is_ordinary, and orig_st_shndx parameters. Change all callers.
6075 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
6076 to be in an ordinary section.
6077 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
6078 object and is_ordinary parameters. Change all callers.
6079 (Sized_dwarf_line_info::read_relocs): Add object parameter.
6080 Change all callers. Don't add undefined or non-ordinary symbols
6081 to reloc_map_.
6082 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
6083 Change all callers.
6084 * dwarf_reader.h (class Sized_dwarf_line_info): Update
6085 declarations.
6086 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
6087 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
6088 (Sized_relobj::relocate_sections): Likewise.
6089 * target-reloc.h (scan_relocs): Adjust section symbol index.
6090 (scan_relocatable_relocs): Likewise.
6091 * i386.cc (Scan::local): Check for ordinary symbols.
6092 * sparc.cc (Scan::local): Likewise.
6093 * x86_64.cc (Scan::local): Likewise.
6094 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
6095 to symbol_section_and_value.
6096 * testsuite/many_sections_test.cc: New file.
6097 * testsuite/Makefile.am (BUILT_SOURCES): Define.
6098 (check_PROGRAMS): Add many_sections_test.
6099 (many_sections_test_SOURCES): Define.
6100 (many_sections_test_DEPENDENCIES): Define.
6101 (many_sections_test_LDFLAGS): Define.
6102 (BUILT_SOURCES): Add many_sections_define.h.
6103 (many_sections_define.h): New target.
6104 (BUILT_SOURCES): Add many_sections_check.h.
6105 (many_sections_check.h): New target.
6106 (check_PROGRAMS): Add many_sections_r_test.
6107 (many_sections_r_test_SOURCES): Define.
6108 (many_sections_r_test_DEPENDENCIES): Define.
6109 (many_sections_r_test_LDFLAGS): Define.
6110 (many_sections_r_test_LDADD): Define.
6111 (many_sections_r_test.o): New target.
6112 * testsuite/Makefile.in: Rebuild.
6113
c5818ff1
CC
61142008-04-17 Cary Coutant <ccoutant@google.com>
6115
6116 * errors.cc (Errors::info): New function.
6117 (gold_info): New function.
6118 * errors.h (Errors::info): New function.
6119 * gold.h (gold_info): New function.
6120 * object.cc (Input_objects::add_object): Print trace output.
6121 * options.cc (options::parse_set): New function.
6122 (General_options::parse_wrap): Deleted.
6123 (General_options::General_options): Deleted initializer.
6124 * options.h (options::String_set): New typedef.
6125 (options::parse_set): New function.
6126 (DEFINE_set): New macro.
6127 (General_options::wrap): Changed to use DEFINE_set. Changed
6128 callers of any_wrap_symbols and is_wrap_symbol.
6129 (General_options::trace, General_options::trace_symbol):
6130 New options.
6131 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
6132 (General_options::wrap_symbols_): Deleted.
6133 * symtab.cc (Symbol_table::add_from_object): Print trace output.
6134
b5be4a7c
DM
61352008-04-17 David S. Miller <davem@davemloft.net>
6136
6137 * options.cc (General_options::parse_V): New function.
6138 * options.h: Add entries for -V and -Qy.
6139
155a0dd7
ILT
61402008-04-17 Ian Lance Taylor <iant@google.com>
6141
6142 * common.cc (Symbol_table::allocate_commons): Remove options
6143 parameter. Change caller.
6144 (Symbol_table::do_allocate_commons): Remove options parameter.
6145 Change caller. Just call do_allocate_commons_list twice.
6146 (Symbol_table::do_allocate_commons_list): New function, broken out
6147 of do_allocate_commons.
6148 * common.h (class Allocate_commons_task): Remove options_ field.
6149 Update constructor.
6150 * symtab.cc (Symbol_table::Symbol_table): Initialize
6151 tls_commons_.
6152 (Symbol_table::add_from_object): Put TLS common symbols on
6153 tls_commons_ list.
6154 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
6155 which are IN_OUTPUT_DATA.
6156 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
6157 allocate_commons and do_allocate_commons declarations. Declare
6158 do_allocate_commons_list.
6159 * gold.cc (queue_middle_tasks): Update creation of
6160 Allocate_commons_task to not pass options.
6161 * testsuite/Makefile.am (INCLUDES): Add -I.. .
6162 (TLS_TEST_C_FLAGS): New variable.
6163 (tls_test_c_pic.o): New target.
6164 (tls_test_shared.so): Link in tls_test_c_pic.o.
6165 (tls_test_c_pic_ie.o): New target.
6166 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
6167 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
6168 (tls_test_c.o): New target.
6169 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
6170 (tls_pic_test_LDADD): Likewise.
6171 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
6172 (tls_shared_gd_to_ie_test_LDADD): Likewise.
6173 (tls_test_c_gnu2.o): New target.
6174 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
6175 tls_test_c_gnu2.o.
6176 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
6177 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
6178 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
6179 * testsuite/tls_test.cc: Include "config.h".
6180 (t_last): Call t11_last.
6181 * testsuite/tls_test.h (t11, t11_last): Declare.
6182 * testsuite/tls_test_c.c: New file.
6183 * testsuite/tls_test_main.cc (thread_routine): Call t11.
6184 * configure.ac: Check for OpenMP support.
6185 * configure, config.in, Makefile.in: Rebuild.
6186 * testsuite/Makefile.in: Rebuild.
6187
edfbb029
CC
61882008-04-16 Cary Coutant <ccoutant@google.com>
6189
6190 * i386.cc (Target_i386::define_tls_base_symbol): New function.
6191 (Target_i386::tls_base_symbol_defined_): New field.
6192 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
6193 (Target_i386::Scan::global): Likewise.
6194 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
6195 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
6196 (Target_x86_64::tls_base_symbol_defined_): New field.
6197 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
6198 (Target_x86_64::Scan::global): Likewise.
6199
f3c69fca
CC
62002008-04-16 Cary Coutant <ccoutant@google.com>
6201
6202 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
6203 (Symbol::needs_plt_entry): Allow weak undefined symbols.
6204 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
6205 building shared libraries.
6206 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
6207 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
6208 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
6209 * testsuite/Makefile.in: Rebuild.
6210 * testsuite/weak_undef.h: New file.
6211 * testsuite/weak_undef_file1.cc: Add extra test cases.
6212 * testsuite/weak_undef_file2.cc: Likewise.
6213 * testsuite/weak_undef_test.cc: Likewise.
6214
7c414435
DM
62152008-04-16 David S. Miller <davem@davemloft.net>
6216
32b769e1
DM
6217 * sparc.cc (Target_sparc::Scan): Change from struct to class.
6218 Add issued_non_pic_error_ field. Declare check_non_pic.
6219 (Target_sparc::Scan::check_non_pic): New function.
6220 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
6221 (Target_sparc::Scan::global): Likewise.
6222
11936fb1
DM
6223 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
6224 * configure: Rebuild.
6225
7c414435
DM
6226 * options.h (DEFINE_enable): New macro.
6227 (new_dtags): New enable option.
6228 (initfirst, interpose, loadfltr, nodefaultlib,
6229 nodelete, nodlopen, nodump): New -z options.
6230 * layout.cc (Layout:finish_dynamic_section): If new
6231 dtags enabled, emit DT_RUNPATH. Also, emit a
6232 DT_FLAGS_1 containing any specified -z flags.
6233
85c7bf8b
ILT
62342008-04-16 Ian Lance Taylor <iant@google.com>
6235
12c0daef
ILT
6236 * copy-relocs.cc: New file.
6237 * copy-relocs.h: New file.
6238 * reloc.cc: Remove Copy_relocs code.
6239 * reloc.h: Likewise.
6240 * reloc-types.h (struct Reloc_types) [both versions]: Add
6241 get_reloc_addend_noerror.
6242 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
6243 variants of add_global which take an addend which must be zero.
6244 * i386.cc: Include "copy-relocs.h".
6245 (class Target_i386): Change type of copy_relocs_ to variable,
6246 update initializer.
6247 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
6248 Change all callers.
6249 (Target_i386::do_finalize_sections): Change handling of
6250 copy_relocs_.
6251 * sparc.cc: Include "copy-relocs.h".
6252 (class Target_sparc): Change type of copy_relocs_ to variable,
6253 update initializer.
6254 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
6255 Change all callers.
6256 (Target_sparc::do_finalize_sections): Change handling of
6257 copy_relocs_.
6258 * x86_64.cc: Include "copy-relocs.h".
6259 (class Target_x86_64): Change type of copy_relocs_ to variable,
6260 update initializer.
6261 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
6262 class. Change all callers.
6263 (Target_x86_64::do_finalize_sections): Change handling of
6264 copy_relocs_.
6265 * Makefile.am (CCFILES): Add copy-relocs.cc.
6266 (HFILES): Add copy-relocs.h.
6267
4f4995b6
ILT
6268 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
6269
85c7bf8b
ILT
6270 * testsuite/script_test_4.sh: Permit leading zeroes.
6271
4f2a9edd
ILT
62722008-04-15 Ian Lance Taylor <iant@google.com>
6273
e6188289
ILT
6274 * script-sections.cc (Script_sections::create_segments): Use
6275 header_size_adjustment even when there is enough room for the
6276 headers.
6277 * testsuite/script_test_4.sh: New file.
6278 * testsuite/script_test_4.t: New file.
6279 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
6280 (check_DATA): Add script_test_4.stdout.
6281 (MOSTLYCLEANFILES): Likewise.
6282 (script_test_4): New target.
6283 (script_test_4.stdout): New target.
6284 * testsuite/Makefile.in: Rebuild.
6285
4f2a9edd
ILT
6286 * sparc.cc: Add definitions for Output_data_plt_sparc class
6287 constants.
6288
f5314dd5
DM
62892008-04-14 David S. Miller <davem@davemloft.net>
6290
6291 * sparc.cc: New file.
6292 * Makefile.am (TARGETSOURCES): Add sparc.cc
6293 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
6294 * configure.tgt: Document targ_extra_size and
6295 targ_extra_big_endian. Add entries for sparc-* and
6296 sparc64-*.
6297 * configure.ac: Handle targ_extra_size and
6298 targ_extra_big_endian.
6299 * Makefile.in: Rebuild.
6300 * configure: Likewise.
6301 * po/POTFILES.in: Likewise.
6302 * po/gold.pot: Likewise.
6303
154e0e9a
ILT
63042008-04-14 Ian Lance Taylor <iant@google.com>
6305
6306 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
6307 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
6308 in the name/type/flags to section mapping. Don't call
6309 allocate_output_section.
6310 (Layout::choose_output_section): Change parameter from adjust_name
6311 to is_input_section. Don't permit input sections after sections
6312 are attached to segments. Don't call allocate_output_section.
6313 (Layout::layout_eh_frame): Call update_flags_for_input_section,
6314 not write_enable_output_section.
6315 (Layout::make_output_section): Don't push to
6316 unattached_section_list_ nor call attach_to_segment. Call
6317 attach_section_to_segment if sections are attached.
6318 (Layout::attach_sections_to_segments): New function.
6319 (Layout::attach_section_to_segment): New function.
6320 (Layout::attach_allocated_section_to_segment): Rename from
6321 attach_to_segment. Remove flags parameter.
6322 (Layout::allocate_output_section): Remove function.
6323 (Layout::write_enable_output_section): Remove function.
6324 * layout.h (class Layout): Update for above changes. Add new
6325 field sections_are_attached_.
6326 * output.h (Output_section::update_flags_for_input_section): New
6327 function.
6328 * output.cc (Output_section::add_input_section): Call
6329 update_flags_for_input_section.
6330 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
6331
009a67a2
CC
63322008-04-11 Cary Coutant <ccoutant@google.com>
6333
6334 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
6335 thought unnecessary.
6336 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
6337
759b1a24
ILT
63382008-04-11 Ian Lance Taylor <iant@google.com>
6339
6340 * output.h (class Output_section_data): Remove inline definition
6341 of set_addralign.
6342 * output.cc (Output_section_data::set_addralign): New function.
6343
c2b45e22
CC
63442008-04-11 Cary Coutant <ccoutant@google.com>
6345
6346 Add support for TLS descriptors for i386 and x86_64.
6347 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
6348 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
6349 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
6350 GOT_TYPE_TLS_DESC.
6351 (Target_i386::got_mod_index_entry): Remove unnecessary code.
6352 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
6353 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
6354 relocations.
6355 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
6356 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
6357 Fix problem with initial-exec relocations.
6358 (Target_i386::Relocate::relocate_tls): Likewise.
6359 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
6360 relaxation.
6361 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
6362 support for section-plus-offset dynamic table entries.
6363 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
6364 (Output_data_dynamic::Dynamic_entry): Add support for
6365 section-plus-offset dynamic table entries.
6366 (Output_data_dynamic::Classification): Likewise.
6367 (Output_data_dynamic::classification_): Renamed offset_.
6368 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
6369 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
6370 (Target_x86_64::make_plt_section): New function.
6371 (Target_x86_64::reserve_tlsdesc_entries): New function.
6372 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
6373 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
6374 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
6375 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
6376 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
6377 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
6378 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
6379 add extra PLT entry for TLS descriptors.
6380 (Output_data_plt_x86_64::got_): New field.
6381 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
6382 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
6383 fields.
6384 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
6385 descriptors.
6386 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
6387 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
6388 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
6389 R_386_TLS_DESC_CALL relocations.
6390 (Target_x86_64::Scan::global): Likewise.
6391 (Target_x86_64::do_finalize_sections): Add dynamic table entries
6392 for TLS descriptors.
6393 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
6394 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
6395 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
6396 GD-to-IE relaxation.
6397 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
6398 and TLS_DESCRIPTORS.
6399 * Makefile.in: Rebuild.
6400 * configure: Rebuild.
6401 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
6402 (tls_test_shared2.so): New target.
6403 (tls_shared_gd_to_ie_test_SOURCES): New variable.
6404 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
6405 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
6406 (tls_shared_gd_to_ie_test_LDADD): New variable.
6407 (tls_shared_gnu2_gd_to_ie_test): New target.
6408 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
6409 New targets.
6410 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
6411 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
6412 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
6413 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
6414 (tls_shared_gnu2_test): New target.
6415 (tls_test_gnu2_shared.so): New target.
6416 (tls_shared_gnu2_test_SOURCES): New variable.
6417 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
6418 (tls_shared_gnu2_test_LDFLAGS): New variable.
6419 (tls_shared_gnu2_test_LDADD): New variable.
6420 * testsuite/Makefile.in: Rebuild.
6421 * testsuite/Makefile.
6422
83bfb6b7
ILT
64232008-04-11 Ian Lance Taylor <iant@google.com>
6424
6425 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
6426 justsyms.t.
6427 * testsuite/Makefile.in: Rebuild.
6428
6429 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
6430 long.
6431 * testsuite/script_test_2.cc (main): Adjust test.
6432
706e1f5e
ILT
64332008-04-11 David S. Miller <davem@davemloft.net>
6434 Ian Lance Taylor <iant@google.com>
6435
6436 * options.h (General_options): Add entries for '-Y' and
6437 '-relax'.
6438 * options.cc (General_options:finalize): If -Y was used, add those
6439 entries to the library path instead of the default "/lib" and
6440 "/usr/lib".
6441
7c98e6bb
DM
64422008-04-11 David S. Miller <davem@davemloft.net>
6443
6444 * testsuite/justsyms.t: Start at 0x100.
6445 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
6446 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
6447 long.
6448 * testsuite/script_test_2.cc: Adjust string and section length
6449 checks.
7c98e6bb 6450
99a37bfd
ILT
64512008-04-09 Ian Lance Taylor <iant@google.com>
6452
2cefc357
ILT
6453 PR gold/5996
6454 * script-sections.cc (Sections_element::allocate_to_segment): Add
6455 orphan parameter.
6456 (Output_section_definition::allocate_to_segment): Likewise.
6457 (Orphan_output_section::allocate_to_segment): Likewise.
6458 (Script_sections::attach_sections_using_phdrs_clause): Don't
6459 propagate non-PT_LOAD segments to orphan sections.
6460 * testsuite/Makefile.am (script_test_3.stdout): Generate using
6461 readelf rather than objdump.
6462 * testsuite/script_test_3.sh: Adjust accordingly. Test that
6463 .interp section and PT_INTERP segment are the same size.
6464 * testsuite/Makefile.in: Rebuild.
6465
99a37bfd
ILT
6466 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
6467 aliases for symbols defined in the same object.
6468 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
6469 (weak_alias_test_SOURCES): New variable.
6470 (weak_alias_test_DEPENDENCIES): New variable.
6471 (weak_alias_test_LDFLAGS): New variable.
6472 (weak_alias_test_LDADD): New variable.
6473 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
6474 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
6475 (weak_alias_test_3.o): New target.
6476 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
6477 * testsuite/weak_alias_test_main.cc: New file.
6478 * testsuite/weak_alias_test_1.cc: New file.
6479 * testsuite/weak_alias_test_2.cc: New file.
6480 * testsuite/weak_alias_test_3.cc: New file.
6481
780e49c5
ILT
64822008-04-08 Ian Lance Taylor <iant@google.com>
6483
cdb0b8f5
ILT
6484 * options.h (class General_options): Add --noinhibit-exec option.
6485 * main.cc (main): Check --noinhibit-exec.
6486
0864d551
ILT
6487 * options.h (class General_options): Define --wrap as a special
6488 option. Add wrap_symbols_ field.
6489 (General_options::any_wrap_symbols): New function.
6490 (General_options::is_wrap_symbol): New function.
6491 * options.cc (General_options::parse_wrap): New function.
6492 (General_options::General_options): Initialize wrap_symbols_.
6493 * symtab.cc (Symbol_table::wrap_symbol): New function.
6494 (Symbol_table::add_from_object): Handle --wrap.
6495 * symtab.h (class Symbol_table): Declare wrap_symbol.
6496 * target.h (Target::wrap_char): New function.
6497 (Target::Target_info): Add wrap_char field.
6498 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
6499 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
6500 * testsuite/testfile.cc (Target_test::test_target_info):
6501 Likewise.
6502
789aa6de
ILT
6503 * errors.cc (Errors::undefined_symbol): Mention symbol version if
6504 there is one.
6505
2c38906f
ILT
6506 * layout.h (class Layout): Add added_eh_frame_data_ field.
6507 * layout.cc (Layout::Layout): Initialize new field.
6508 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
6509 output section until we find a section we merged successfully.
6510 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
6511 that the size be non-zero.
6512
780e49c5
ILT
6513 * merge.cc (Object_merge_map::get_output_offset): Remove inline
6514 qualifier.
6515
7fcd0256
ILT
65162008-04-08 Craig Silverstein <csilvers@google.com>
6517
6518 * configure.ac: Export new conditional variable HAVE_ZLIB.
6519 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
6520 on HAVE_ZLIB.
6521 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
6522 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
6523
6835af53
ILT
65242008-04-07 Ian Lance Taylor <iant@google.com>
6525
e24f324c
ILT
6526 * version.cc (version_string): Set to "1.5".
6527
a036edd8
ILT
6528 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
6529 Add issued_non_pic_error_ field. Declare check_non_pic.
6530 (Target_x86_64::Scan::check_non_pic): New function.
6531 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
6532 (Target_x86_64::Scan::global): Likewise.
6533
624f8810
ILT
6534 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
6535 addend parameter. Change caller. Handle merge sections.
6536 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
6537 Address to Addend. Don't add in the result of
6538 local_section_offset, pass down the addend and use the returned
6539 value.
6540 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
6541 Update declarations of local_section_offset and symbol_value.
6542 * testsuite/two_file_test_1.cc (t18): New function.
6543 * testsuite/two_file_test_2.cc (f18): New function.
6544 * testsuite/two_file_test_main.cc (main): Call t18.
6545 * testsuite/two_file_test.h (t18, f18): Declare.
6546
6835af53
ILT
6547 * configure.ac: Don't test for objdump, c++filt, or readelf.
6548 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
6549 conditionals.
6550 (TEST_READELF): New variable.
6551 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
6552 (check_PROGRAMS): Add two_file_strip_test.
6553 (two_file_strip_test): New target.
6554 (check_PROGRAMS): Add two_file_same_shared_strip_test.
6555 (two_file_same_shared_strip_test_SOURCES): New variable.
6556 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
6557 (two_file_same_shared_strip_test_LDFLAGS): New variable.
6558 (two_file_same_shared_strip_test_LDADD): New variable.
6559 (two_file_shared_strip.so): New target.
6560 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
6561 (ver_test_5.syms, ver_test_7.syms): Likewise.
6562 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
6563 (strip_test_3.stdout): Use TEST_OBJDUMP.
6564 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
6565
86925eef
CC
65662008-04-04 Cary Coutant <ccoutant@google.com>
6567
6568 * symtab.h (Symbol::is_weak_undefined): New function.
6569 (Symbol::is_strong_undefined): New function.
6570 (Symbol::is_absolute): New function.
6571 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
6572 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
6573 absolute symbols.
6574 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
6575 (weak_undef_test): New target.
6576 * testsuite/Makefile.in: Rebuild.
6577 * testsuite/weak_undef_file1.cc: New file.
6578 * testsuite/weak_undef_file2.cc: New file.
6579 * testsuite/weak_undef_test.cc: New file.
6580
126f3ece
ILT
65812008-04-03 Craig Silverstein <csilvers@google.com>
6582
6583 * compressed_output.h (class Output_compressed_section): Use
6584 unsigned buffer.
6585 * compressed_output.cc (zlib_compress): Use unsigned buffers,
6586 add zlib header.
6587 (zlib_compressed_suffix): Removed.
6588 (Output_compressed_section::set_final_data_size): Use unsigned
6589 buffers.
6590 * testsuite/Makefile.am (flagstest_compress_debug_sections):
6591 Fix linker invocation.
6592 (flagstest_o_specialfile_and_compress_debug_sections):
6593 Likewise.
6594 * testsuite/Makefile.in: Regenerated.
6595
deae2a14
DM
65962008-04-02 David S. Miller <davem@davemloft.net>
6597
6598 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
6599 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
6600
70752818
ILT
66012008-04-02 Craig Silverstein <csilvers@google.com>
6602
6603 * TODO: New file.
6604
39d0cb0e
ILT
66052008-04-02 Ian Lance Taylor <iant@google.com>
6606
6607 * fileread.cc (File_read::find_view): Add byteshift and vshifted
6608 parameters. Update for new key type to views_. Change all
6609 callers.
6610 (File_read::read): Adjust for byteshift in returned view.
6611 (File_read::add_view): New function, broken out of
6612 find_and_make_view.
6613 (File_read::make_view): New function, broken out of
6614 find_and_make_view.
6615 (File_read::find_or_make_view): Add offset and aligned
6616 parameters. Rewrite accordingly. Change all callers.
6617 (File_read::get_view): Add offset and aligned parameters. Adjust
6618 for byteshift in return value.
6619 (File_read::get_lasting_view): Likewise.
6620 * fileread.h (class File_read): Update declarations.
6621 (class File_read::View): Add byteshift_ field. Add byteshift to
6622 constructor. Add byteshift method.
6623 * archive.h (Archive::clear_uncached_views): New function.
6624 (Archive::get_view): Add aligned parameter. Change all callers.
6625 * object.h (Object::get_view): Add aligned parameter. Change all
6626 callers.
6627 (Object::get_lasting_view): Likewise.
6628
6629 * fileread.cc (File_read::release): Don't call clear_views if
6630 there are multiple objects.
6631 * fileread.h (File_read::clear_uncached_views): New function.
6632 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
6633 on the archive.
6634
a1207466
CC
66352008-03-31 Cary Coutant <ccoutant@google.com>
6636
6637 Add thin archive support.
6638 * archive.cc (Archive::armagt): New const.
6639 (Archive::setup): Remove task parameter and calls to unlock.
6640 (Archive::unlock_nested_archives): New function.
6641 (Archive::read_header): Add nested_off parameter. Change
6642 all callers.
6643 (Archive::interpret_header): Likewise.
6644 (Archive::include_all_members): Change to handle thin
6645 archives.
6646 (Archive::include_member): Likewise.
6647 * archive.h (Archive::Archive): Add new parameters and
6648 initializers.
6649 (Archive::armagt): New const.
6650 (Archive::setup): Remove task parameter.
6651 (Archive::unlock_nested_archives): New function.
6652 (Archive::read_header): Add nested_off parameter.
6653 (Archive::interpret_header): Likewise.
6654 (Archive::Nested_archive_table): New typedef.
6655 (Archive::is_thin_archive_): New field.
6656 (Archive::nested_archives_): New field.
6657 (Archive::options_): New field.
6658 (Archive::dirpath_): New field.
6659 (Archive::task_): New field.
6660 * readsyms.cc (Read_symbols::do_read_symbols): Add check
6661 for thin archives. Pass additional parameters to
6662 Archive::Archive. Unlock the archive file after calling
6663 Archive::setup.
cd536b21 6664
479f6503
ILT
66652008-03-29 Ian Lance Taylor <iant@google.com>
6666
686c8caf
ILT
6667 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
6668 version symbol to be local.
6669 * testsuite/ver_test_4.sh: New file.
6670 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
6671 (check_DATA): Add ver_test_4.syms.
6672 (ver_test_4.syms): New target.
6673 * testsuite/Makefile.in: Rebuild.
6674
ab794b6b
ILT
6675 * output.cc
6676 (Output_section::Input_section_sort_entry::has_priority): New
6677 function.
6678 (Output_section::Input_section_sort_entry::match_file_name): New
6679 function.
6680 (Output_section::Input_section_sort_entry::match_section_name):
6681 Remove.
6682 (Output_section::Input_section_sort_entry::match_section_name_prefix):
6683 Remove.
6684 (Output_section::Input_section_sort_entry::match_section_file):
6685 Remove.
6686 (Output_section::Input_section_sort_compare::operator()): Rewrite
6687 using new Input_section_sort_entry functions. Sort crtbegin and
6688 crtend first. Sort sections with no priority before sections with
6689 a priority.
6690 * testsuite/initpri1.c (d3): Check j != 4.
6691 (cd5): New constructor/destructor function.
6692 (main): Check j != 2.
6693
479f6503
ILT
6694 * symtab.cc (Symbol_table::add_from_object): If we don't use the
6695 new symbol when resolving, don't call set_is_default.
6696 * testsuite/ver_test_7.cc: New file.
6697 * testsuite/ver_test_7.sh: New file.
6698 * testsuite/Makefile.am (ver_test_7.so): New target.
6699 (ver_test_7.o): New target.
6700 (check_SCRIPTS): Add ver_test_7.sh.
6701 (check_DATA): Add ver_test_7.syms.
6702 (ver_test_7.syms): New target.
6703
2fd32231
ILT
67042008-03-28 Ian Lance Taylor <iant@google.com>
6705
6706 * layout.cc (Layout::layout): If we see an input section with a
6707 name that needs sorting, set the must_sort flag for the output
6708 section.
6709 (Layout::make_output_section): If the name of the output section
6710 indicates that it might require sorting, set the may_sort flag.
6711 * output.h (Output_section::may_sort_attached_input_sections): New
6712 function.
6713 (Output_section::set_may_sort_attached_input_sections): New
6714 function.
6715 (Output_section::must_sort_attached_input_sections): New
6716 function.
6717 (Output_section::set_must_sort_attached_input_sections): New
6718 function.
6719 (class Output_section): Declare Input_section_sort_entry. Define
6720 Input_section_sort_compare. Declare
6721 sort_attached_input_sections. Add new fields:
6722 may_sort_attached_input_sections_,
6723 must_sort_attached_input_sections_,
6724 attached_input_sections_are_sorted_.
6725 * output.cc (Output_section::Output_section): Initialize new
6726 fields.
6727 (Output_section::add_input_section): Add an entry to
6728 input_sections_ if may_sort or must_sort are true.
6729 (Output_section::set_final_data_size): Call
6730 sort_attached_input_sections if necessary.
6731 (Output_section::Input_section_sort_entry): Define new class.
6732 (Output_section::Input_section_sort_compare::operator()): New
6733 function.
6734 (Output_section::sort_attached_input_sections): New function.
6735 * configure.ac: Check whether the compiler supports constructor
6736 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
6737 * testsuite/initpri1.c: New file.
6738 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
6739 CONSTRUCTOR_PRIORITY.
6740 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
6741 (initpri1_LDFLAGS): New variable.
6742 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
6743
18e6b24e
ILT
67442008-03-27 Ian Lance Taylor <iant@google.com>
6745
49bdd526
ILT
6746 * common.cc (Sort_commons::operator): Correct sorting algorithm.
6747 * testsuite/common_test_1.c: New file.
6748 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
6749 (common_test_1_SOURCES): New variable.
6750 (common_test_1_DEPENDENCIES): New variable.
6751 (common_test_1_LDFLAGS): New variable.
6752
18e6b24e
ILT
6753 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
6754 and commons_ correctly when NAME/VERSION does not override
6755 NAME/NULL.
6756 * testsuite/ver_test_6.c: New file.
6757 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
6758 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
6759 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
6760
04bf7072
ILT
67612008-03-26 Ian Lance Taylor <iant@google.com>
6762
5871526f
ILT
6763 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
6764 of an undefined symbol from a version script.
6765 * testsuite/Makefile.am (ver_test_5.so): New target.
6766 (ver_test_5.o): New target.
6767 (check_SCRIPTS): Add ver_test_5.sh.
6768 (check_DATA): Add ver_test_5.syms.
6769 (ver_test_5.syms): New target.
6770 * testsuite/ver_test_5.cc: New file.
6771 * testsuite/ver_test_5.script: New file.
6772 * testsuite/ver_test_5.sh: New file.
6773 * Makefile.in, testsuite/Makefile.in: Rebuild.
6774
04bf7072
ILT
6775 PR gold/5986
6776 Fix problems building gold with gcc 4.3.0.
6777 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
6778 (gold_error_at_location, gold_warning_at_location): Use it.
6779 * configure.ac: Check whether we can compile and use a template
6780 function with a printf attribute.
6781 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
6782 when jumping over bytes.
6783 * object.cc: Instantiate Object::read_section_data.
6784 * debug.h: Include <cstring>
6785 * dwarf_reader.cc: Include <algorithm>
6786 * main.cc: Include <cstring>.
6787 * options.cc: Include <cstring>.
6788 * output.cc: Include <cstring>.
6789 * script.cc: Include <cstring>.
6790 * script.h: Include <string>.
6791 * symtab.cc: Include <cstring> and <algorithm>.
6792 * target-select.cc: Include <cstring>.
6793 * version.cc: Include <string>.
6794 * testsuite/testmain.cc: Include <cstdlib>.
6795 * configure, config.in: Rebuild.
6796
874c5b28
ILT
67972008-03-25 Ian Lance Taylor <iant@google.com>
6798
819d6c3a
ILT
6799 * options.cc: Include "../bfd/bfdver.h".
6800 (options::help): Print bug reporting address.
6801
f4b2c6f5
ILT
6802 * version.cc (print_version): Adjust output for current value of
6803 BFD_VERSION_STRING.
6804
6805 * NEWS: New file.
6806
e96caa79
ILT
6807 * options.cc (options::help): Print list of supported targets.
6808 * target-select.h: Include <vector>.
6809 (class Target_selector): Make machine_, size_, and is_big_endian_
6810 fields const. Add bfd_name_ and instantiated_target_ fields.
6811 (Target_selector::Target_selector): Add bfd_name parameter.
6812 (Target_selector::recognize): Make non-virtual, call
6813 do_recognize.
6814 (Target_selector::recognize_by_name): Make non-virtual, call
6815 do_recognize_by_name.
6816 (Target_selector::supported_names): New function.
6817 (Target_selector::bfd_name): New function.
6818 (Target_selector::do_instantiate_target): New pure virtual
6819 function.
6820 (Target_selector::do_recognize): New virtual function.
6821 (Target_selector::do_recognize_by_name): New virtual function.
6822 (Target_selector::instantiate_target): New private function.
6823 (supported_target_names): Declare.
6824 * target-select.cc (Target_selector::Target_selector): Update for
6825 new parameter and fields.
6826 (select_target_by_name): Check that the name matches before
6827 calling recognize_by_name.
6828 (supported_target_names): New function.
6829 * i386.cc (class Target_selector_i386): Update Target_selector
6830 constructor call. Remove recognize and recognize_by_name. Add
6831 do_instantiate_target.
6832 * x86_64.cc (class Target_selector_x86_64): Likewise.
6833 * testsuite/testfile.cc (class Target_selector_test): Update for
6834 changes to Target_selector.
6835
874c5b28
ILT
6836 * README: Rewrite, with some notes on unsupported features.
6837
0a65a3a7
CC
68382008-03-24 Cary Coutant <ccoutant@google.com>
6839
6840 * i386.cc (Target_i386::Got_type): New enum declaration.
6841 (Target_i386::Scan::local): Updated callers of Output_data_got
6842 member functions.
6843 (Target_i386::Scan::global): Likewise.
6844 (Target_i386::Relocate::relocate): Likewise.
6845 (Target_i386::Relocate::relocate_tls): Likewise.
6846 * object.h (Got_offset_list): New class.
6847 (Sized_relobj::local_has_got_offset): Added got_type parameter.
6848 (Sized_relobj::local_got_offset): Likewise.
6849 (Sized_relobj::set_local_got_offset): Likewise.
6850 (Sized_relobj::local_has_tls_got_offset): Removed.
6851 (Sized_relobj::local_tls_got_offset): Removed.
6852 (Sized_relobj::set_local_tls_got_offset): Removed.
6853 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
6854 * output.cc (Output_data_got::add_global): Added got_type parameter.
6855 (Output_data_got::add_global_with_rel): Likewise.
6856 (Output_data_got::add_global_with_rela): Likewise.
6857 (Output_data_got::add_global_pair_with_rel): New function.
6858 (Output_data_got::add_global_pair_with_rela): New function.
6859 (Output_data_got::add_local): Added got_type parameter.
6860 (Output_data_got::add_local_with_rel): Likewise.
6861 (Output_data_got::add_local_with_rela): Likewise.
6862 (Output_data_got::add_local_pair_with_rel): New function.
6863 (Output_data_got::add_local_pair_with_rela): New function.
6864 (Output_data_got::add_global_tls): Removed.
6865 (Output_data_got::add_global_tls_with_rel): Removed.
6866 (Output_data_got::add_global_tls_with_rela): Removed.
6867 (Output_data_got::add_local_tls): Removed.
6868 (Output_data_got::add_local_tls_with_rel): Removed.
6869 (Output_data_got::add_local_tls_with_rela): Removed.
6870 * output.h (Output_data_got::add_global): Added got_type parameter.
6871 (Output_data_got::add_global_with_rel): Likewise.
6872 (Output_data_got::add_global_with_rela): Likewise.
6873 (Output_data_got::add_global_pair_with_rel): New function.
6874 (Output_data_got::add_global_pair_with_rela): New function.
6875 (Output_data_got::add_local): Added got_type parameter.
6876 (Output_data_got::add_local_with_rel): Likewise.
6877 (Output_data_got::add_local_with_rela): Likewise.
6878 (Output_data_got::add_local_pair_with_rel): New function.
6879 (Output_data_got::add_local_pair_with_rela): New function.
6880 (Output_data_got::add_global_tls): Removed.
6881 (Output_data_got::add_global_tls_with_rel): Removed.
6882 (Output_data_got::add_global_tls_with_rela): Removed.
6883 (Output_data_got::add_local_tls): Removed.
6884 (Output_data_got::add_local_tls_with_rel): Removed.
6885 (Output_data_got::add_local_tls_with_rela): Removed.
6886 * resolve.cc (Symbol::override_base_with_special): Removed
6887 reference to has_got_offset_ field.
6888 * symtab.cc (Symbol::init_fields): Replaced initialization
6889 of got_offset_ with got_offsets_. Removed initialization
6890 of has_got_offset_
53fcba31 6891 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
6892 (Symbol::got_offset): Likewise.
6893 (Symbol::set_got_offset): Likewise.
6894 (Symbol::has_tls_got_offset): Removed.
6895 (Symbol::tls_got_offset): Removed.
6896 (Symbol::set_tls_got_offset): Removed.
6897 (Symbol::got_offset_): Removed.
6898 (Symbol::tls_mod_got_offset_): Removed.
6899 (Symbol::tls_pair_got_offset_): Removed.
6900 (Symbol::got_offsets_): New field.
6901 (Symbol::has_got_offset): Removed.
6902 (Symbol::has_tls_mod_got_offset): Removed.
6903 (Symbol::has_tls_pair_got_offset): Removed.
6904 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
6905 (Target_x86_64::Scan::local): Updated callers of Output_data_got
6906 member functions.
6907 (Target_x86_64::Scan::global): Likewise.
6908 (Target_x86_64::Relocate::relocate): Likewise.
6909 (Target_x86_64::Relocate::relocate_tls): Likewise.
6910
bd52eafb
BE
69112008-03-25 Ben Elliston <bje@au.ibm.com>
6912
6913 * yyscript.y: Fix spelling error in comment.
6914
8b105e34
ILT
69152008-03-24 Ian Lance Taylor <iant@google.com>
6916
8ed814a9
ILT
6917 * options.h (class General_options): Define build_id option.
6918 * layout.h (class Layout): Declare write_build_id, create_note,
6919 create_build_id. Add build_id_note_ member.
6920 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
6921 "libiberty.h", "md5.h", "sha1.h".
6922 (Layout::Layout): Initialize eh_frame_data_,
6923 eh_frame_hdr_section_, and build_id_note_.
6924 (Layout::finalize): Call create_build_id.
6925 (Layout::create_note): New function, broken out of
6926 Layout::create_gold_note.
6927 (Layout::create_gold_note): Call create_note.
6928 (Layout::create_build_id): New function.
6929 (Layout::write_build_id): New function.
6930 (Close_task_runner::run): Call write_build_id.
6931
8b105e34
ILT
6932 * x86_64.cc: Correct license to GPLv3.
6933
086a1841
ILT
69342008-03-23 Ian Lance Taylor <iant@google.com>
6935
6936 * options.cc: Include "demangle.h".
6937 (parse_optional_string): New function.
6938 (parse_long_option): Handle takes_optional_argument.
6939 (parse_short_option): Update dash_z initializer. Handle
6940 takes_optional_argument.
6941 (General_options::General_options): Initialize do_demangle_.
6942 (General_options::finalize): Set do_demangle_. Handle demangling
6943 style.
6944 * options.h (parse_optional_string): Declare.
6945 (struct One_option): Add optional_arg field. Update constructor.
6946 Update call constructor calls. Add takes_optional_argument
6947 function.
6948 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
6949 (DEFINE_optional_string): Define.
6950 (General_options::demangle): Change from DEFINE_bool to
6951 DEFINE_optional_string.
6952 (General_options::no_demangle): New function.
6953 (General_options::do_demangle): New function.
6954 (General_options::set_do_demangle): New function.
6955 (General_options::execstack_status_): Move definition to end of
6956 class definition.
6957 (General_options::static_): Likewise.
6958 (General_options::do_demangle_): New field.
6959 * object.cc (big_endian>::get_symbol_location_info): Call
6960 Options::do_demangle, not Options::demangle.
6961 * symtab.cc (demangle): Likewise.
6962
cbb93e63
ILT
69632008-03-22 Ian Lance Taylor <iant@google.com>
6964
6965 * gold.h: Include <cstddef> and <sys/types.h>
6966 * options.h: Include <cstring>.
6967
ec531623
ILT
69682008-03-21 Ian Lance Taylor <iant@google.com>
6969
6970 * Added source code to GNU binutils.
This page took 0.429838 seconds and 4 git commands to generate.