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