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