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