*** empty log message ***
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
83896202
ILT
12011-12-18 Ian Lance Taylor <iant@google.com>
2
3 * object.h (Relobj::local_symbol_value): New function.
4 (Relobj::local_plt_offset): New function.
5 (Relobj::local_has_got_offset): New function.
6 (Relobj::local_got_offset): New function.
7 (Relobj::set_local_got_offset): New function.
8 (Relobj::do_local_symbol_value): New pure virtual function.
9 (Relobj::do_local_plt_offset): Likewise.
10 (Relobj::do_local_has_got_offset): Likewise.
11 (Relobj::do_local_got_offset): Likewise.
12 (Relobj::do_set_local_got_offset): Likewise.
13 (Sized_relobj::do_local_has_got_offset): Rename from
14 local_has_got_offset.
15 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
16 (Sized_relobj::do_set_local_got_offset): Rename from
17 set_local_got_offset.
18 (Sized_relobj_file::do_local_plt_offset): Rename from
19 local_plt_offset.
20 (Sized_relobj_file::do_local_symbol_value): New function.
21 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
22 local_plt_offset.
23 * output.cc (Output_data_got::Got_entry::write): Change object to
24 Relobj. Use local_symbol_value.
25 (Output_data_got::add_global_with_rel): Change rel_dyn to
26 Output_data_reloc_generic*. Use add_global_generic.
27 (Output_data_got::add_global_with_rela): Remove. Change all
28 callers to use add_global_with_rel.
29 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
30 Output_data_reloc_generic*. Use add_global_generic.
31 (Output_data_got::add_global_pair_with_rela): Remove. Change all
32 callers to use add_global_pair_with_rel.
33 (Output_data_got::add_local): Change object to Relobj*.
34 (Output_data_got::add_local_plt): Likewise.
35 (Output_data_got::add_local_with_rel): Change object to Relobj*,
36 change rel_dyn to Output_data_reloc_generic*. Use
37 add_local_generic.
38 (Output_data_got::add_local_with_rela): Remove. Change all
39 callers to use all_local_with_rel.
40 (Output_data_got::add_local_pair_with_rel): Change object to
41 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
42 add_output_section_generic.
43 (Output_data_got::add_local_pair_with_rela): Remove. Change all
44 callers to use add_local_pair_with_rel.
45 (Output_data_got::reserve_local): Change object to Relobj*.
46 * output.h: (class Output_data_reloc_generic): Add pure virtual
47 declarations for add_global_generic, add_local_generic,
48 add_output_section_generic.
49 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
50 functions for Output_data_reloc_generic. Update declarations for
51 changes listed in output.cc.
52 (class Output_data_got): Change template parameter to got_size.
53 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
54 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
55 function.
56 (Sized_relobj_incr::do_local_plt_offset): New function.
57 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
58 add_global_generic.
59
76677ad0
CC
602011-12-17 Cary Coutant <ccoutant@google.com>
61
62 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
63 * resolve.cc (Symbol_table::resolve): Likewise.
64 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
65 arrays.
66 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
67
8b8dd8d5
ILT
682011-12-16 Ian Lance Taylor <iant@google.com>
69
70 * output.h (Output_data_reloc_generic::add): Only call
71 add_dynamic_reloc if this is a dynamic reloc section.
72
d55525b9
L
732011-12-15 H.J. Lu <hongjiu.lu@intel.com>
74
75 PR gold/13505
76 * target-reloc.h (apply_relocation): Replace <64, false> with
77 <size, big_endian>.
78
ff81c7c1
NC
792011-11-25 Nick Clifton <nickc@redhat.com>
80
81 * po/it.po: New Italian translation.
82
628f39be
SA
832011-11-17 Sterling Augustine <saugustine@google.com>
84
85 * script.cc (script_include_directive): Implement.
86 (read_script_file): New local variables name and search_path. Update
87 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
88 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
89 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
90
98ef3ea4
SA
912011-11-11 Sterling Augustine <saugustine@google.com>
92
93 * yyscript.y (section_cmd): Add support for INCLUDE directive.
94 (file_or_sections_cmd): Likewise.
95
f4a8b6d7
DK
962011-11-11 Doug Kwan <dougkwan@google.com>
97
98 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
99 if --just-symbols is given.
100
29ab395d
DK
1012011-11-10 Doug Kwan <dougkwan@google.com>
102
103 PR gold/13362
104 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
105 when processing data relocs.
106 * reloc.h (Relocate_functions::rel_unaligned): New method.
107 (Relocate_functions::pcrel_unaligned): Ditto.
108 (Relocate_functions::rel32_unaligned): Ditto.
109 (Relocate_functions::pcrel32_unaligned): Ditto.
110
2c339f71
DK
1112011-11-09 Doug Kwan <dougkwan@google.com>
112
113 PR gold/13362
114 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
115 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
116 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
117 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
118 (Relocate_functions::rel_unaligned): New.
119 (Relocate_functions::rel32_unaligned): New.
120 * target-reloc.h (relocate_for_relocatable): Add code to handle
121 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
122 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
123 arm_unaligned_reloc_r): New targets.
124 * testsuite/Makefile.in: Regenerate.
125 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
126 linking.
127
3f3cddf1
ILT
1282011-11-02 Ian Lance Taylor <iant@google.com>
129
130 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
131 NATIVE_LINKER.
132 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
133 * options.cc (General_options::finalize): Use library search path
134 from configure script if specified. If not native and no sysroot,
135 only search TOOLLIBDIR.
136 * options.h (Search_directory::Search_directory): Change name to
137 const std::string&.
138 (General_options::add_to_library_path_with_sysroot): Change arg to
139 const std::string&.
140 * configure, Makefile.in, config.in: Rebuild.
141
a8e2273b
ILT
1422011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
143
144 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
145 we are working around the ARM1176 Erratum.
146 * options.h (General_options::fix_arm1176): Add option.
147 * testsuite/Makefile.am: Add testcases, and keep current ones
148 working.
149 * testsuite/Makefile.in: Regenerate.
150 * testsuite/arm_fix_1176.s: New file.
151 * testsuite/arm_fix_1176.sh: Likewise.
152
cd6eab1c
ILT
1532011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
154
155 * arm.cc (Target_arm::Target_arm): Remove initialisation of
156 may_use_blx_.
157 (Target_arm::may_use_blx): Remove method.
158 (Target_arm::set_may_use_blx): Likewise.
159 (Target_arm::may_use_v4t_interworking): New method.
160 (Target_arm::may_use_v5t_interworking): Likewise.
161 (Target_arm::may_use_blx_): Remove member variable.
162 (Arm_relocate_functions::arm_branch_common): Check for v5T
163 interworking.
164 (Arm_relocate_functions::thumb_branch_common): Likewise.
165 (Reloc_stub::stub_type_for_reloc): Likewise.
166 (Target_arm::do_finalize_sections): Correct interworking checks.
167 * testsuite/Makefile.am: Add new tests.
168 * testsuite/Makefile.in: Regenerate.
169 * testsuite/arm_farcall_arm_arm.s: New test.
170 * testsuite/arm_farcall_arm_arm.sh: Likewise.
171 * testsuite/arm_farcall_arm_thumb.s: Likewise.
172 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
173 * testsuite/arm_farcall_thumb_arm.s: Likewise.
174 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
175 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
176 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
177
286adcf4
CC
1782011-10-31 Cary Coutant <ccoutant@google.com>
179
180 PR gold/13023
181 * expression.cc (Expression::eval_with_dot): Add
182 is_section_dot_assignment parameter.
183 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
184 absolute and assigning to dot within a section.
185 * script-sections.cc
186 (Output_section_element_assignment::set_section_addresses): Pass
187 dot_section to set_if_absolute.
188 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
189 as is_section_dot_assignment flag to eval_with_dot.
190 (Output_section_element_dot_assignment::set_section_addresses):
191 Likewise.
192 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
193 parameter. Also set value if relative to dot_section; set the
194 symbol's output_section.
195 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
196 parameter. Adjust all callers.
197 (Expression::eval_maybe_dot): Likewise.
198 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
199 Adjust all callers.
200 * testsuite/script_test_2.t: Test assignment of an absolute value
201 to dot within an output section element.
202
9634ed06
CC
2032011-10-31 Cary Coutant <ccoutant@google.com>
204
205 * options.h (class General_options): Add --[no-]gnu-unique options.
206 * symtab.cc (Symbol_table::sized_write_globals): Convert
207 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
208
de4101c7
CC
2092011-10-31 Cary Coutant <ccoutant@google.com>
210
211 PR gold/13359
212 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
213 unnecessary assertion.
214 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
215
7257cc92
ST
2162011-10-31 Sriraman Tallam <tmsriram@google.com>
217
218 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
219 gc_mark_symbol.
220 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
221 gc_mark_symbol.
222 Change to just keep the section associated with symbol.
223 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
224 they are externally visible and --export-dynamic is turned on.
225 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
226
bfc34b3f
ILT
2272011-10-19 Ian Lance Taylor <iant@google.com>
228
229 PR gold/13163
230 * script-sections.cc
231 (Output_section_element_dot_assignment::needs_output_section): New
232 function.
233
ea0d8c47
ILT
2342011-10-19 Ian Lance Taylor <iant@google.com>
235
236 PR gold/13204
237 * layout.cc (Layout::segment_precedes): Don't assert failure if a
238 --section-start option was seen.
239 * options.h (General_options::any_section_start): New function.
240
abd242a9
DM
2412011-10-18 David S. Miller <davem@davemloft.net>
242
243 PR binutils/13301
244 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
245 member to track relocation locations that have moved during TLS
246 reloc optimizations.
247 (Target_sparc::Relocate::Relocate): Initialize to NULL.
248 (Target_sparc::Relocate::relocate): Adjust view down by 4
249 bytes if it matches reloc_adjust_addr_.
250 (Target_sparc::Relocate::relocate_tls): Always move the
251 __tls_get_addr call delay slot instruction forward 4 bytes when
252 performing relaxation.
253
bab9090f
CC
2542011-10-18 Cary Coutant <ccoutant@google.com>
255
256 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
257 (Output_file::map_no_anonymous): Check for non-zero
258 return code from posix_fallocate.
259
f7c5b166
CC
2602011-10-17 Cary Coutant <ccoutant@google.com>
261
262 PR gold/13245
263 * plugin.cc (is_visible_from_outside): Check for symbols
264 referenced from dynamic objects.
265 * resolve.cc (Symbol_table::resolve): Don't count references
266 from dynamic objects as references from real ELF files.
267 * testsuite/plugin_test_2.sh: Adjust expected result.
268
b490c0bb
CC
2692011-10-17 Cary Coutant <ccoutant@google.com>
270
271 * gold.cc: Include timer.h.
272 (queue_middle_tasks): Stamp time.
273 (queue_final_tasks): Likewise.
274 * main.cc (main): Store timer in parameters. Print timers
275 for each pass.
276 * parameters.cc (Parameters::Parameters): Initialize timer_.
277 (Parameters::set_timer): New function.
278 (set_parameters_timer): New function.
279 * parameters.h (Parameters::set_timer): New function.
280 (Parameters::timer): New function.
281 (Parameters::timer_): New data member.
282 (set_parameters_timer): New function.
283 * timer.cc (Timer::stamp): New function.
284 (Timer::get_pass_time): New function.
285 * timer.h (Timer::stamp): New function.
286 (Timer::get_pass_time): New function.
287 (Timer::pass_times_): New data member.
288
f475cf7b
CC
2892011-10-17 Cary Coutant <ccoutant@google.com>
290
291 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
292 task for members of lib groups.
293
cdd7e244
CC
2942011-10-17 Cary Coutant <ccoutant@google.com>
295
296 PR gold/13288
4f95c8b4 297 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
298 (File_read::make_view): Move bounds check (replace with assert)...
299 (File_read::find_or_make_view): ... to here.
300
dfb45471
CC
3012011-10-12 Cary Coutant <ccoutant@google.com>
302
4f95c8b4 303 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
304 ::read returns less than requested size.
305
53bbcc1b
CC
3062011-10-10 Cary Coutant <ccoutant@google.com>
307
4f95c8b4 308 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
309 Initialize defined_count_.
310 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
311 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
312 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
313 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
314 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 315 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
316 member.
317 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 318 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
319 Return zeroes instead of internal error.
320
397b129b
CC
3212011-10-10 Cary Coutant <ccoutant@google.com>
322
323 PR gold/13249
4f95c8b4 324 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 325 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 326 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
327 (Output_reloc::type_): Adjust size of bit field.
328 (Output_reloc::use_plt_offset_): New bit field.
329 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
330 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
331 flag. Adjust all callers.
4f95c8b4 332 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
333 creating RELATIVE relocations.
334
d5698657
NC
3352011-10-10 Nick Clifton <nickc@redhat.com>
336
337 * po/es.po: Updated Spanish translation.
338 * po/fi.po: Updated Finnish translation.
339
6a59a5c2
DN
3402011-10-03 Diego Novillo <dnovillo@google.com>
341
342 * options.cc (parse_uint): Fix dereference of RETVAL.
343
f0558624
ST
3442011-09-29 Sriraman Tallam <tmsriram@google.com>
345
346 * layout.h (section_order_map_): New member.
347 (get_section_order_map): New member function.
348 * output.cc (Output_section::add_input_section): Check for patterns
349 only when --section-ordering-file is specified.
350 * gold.cc (queue_middle_tasks): Delay updating order of sections till
351 output_sections have been formed.
352 * layout.cc (Layout_Layout): Initialize section_order_map_.
353 * plugin.cc (update_section_order): Store order in order_map. Do not
354 update the order.
355 * testsuite/Makefile.am: Add test case for plugin_final_layout.
356 * testsuite/Makefile.in: Regenerate.
357 * testsuite/plugin_section_order.c: New file.
358 * testsuite/plugin_final_layout.cc: New file.
359 * testsuite/plugin_final_layout.sh: New file.
360
a7dac153
CC
3612011-09-29 Cary Coutant <ccoutant@google.com>
362
4f95c8b4 363 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 364 Check for NULL.
4f95c8b4 365 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
366 symbols during incremental update.
367 (Symbol_table::add_from_dynobj): Likewise.
368
eebd87a5
ILT
3692011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
370 Ian Lance Taylor <iant@google.com>
371
372 * symtab.cc (Symbol_table::define_special_symbol): Always
373 canonicalize version string.
374
403a3331
CC
3752011-09-26 Cary Coutant <ccoutant@google.com>
376
4f95c8b4
CC
377 * gold.cc (queue_initial_tasks): Move option checks ...
378 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
379 some options; make others fatal.
380
235061c2
CC
3812011-09-26 Cary Coutant <ccoutant@google.com>
382
383 gcc PR lto/47247
384 * plugin.cc (get_symbols_v2): New function.
385 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
386 (is_referenced_from_outside): New function.
387 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
388 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
389 (get_symbols): Pass version parameter.
390 (get_symbols_v2): New function.
391 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
392 parameter.
393 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
394 (onload): Add LDPT_GET_SYMBOLS_V2.
395 (all_symbols_read_hook): Use get_symbols_v2; check for
396 LDPR_PREVAILING_DEF_IRONLY_EXP.
397 * testsuite/plugin_test_3.sh: Update expected results.
398
dc87f620
ILT
3992011-09-23 Simon Baldwin <simonb@google.com>
400
401 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
402 configuration options.
403 * configure: Regenerate.
404 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
405 * Makefile.in: Regenerate.
406 * testsuite/Makefile.in: Regenerate.
407
a8279f82
ST
4082011-09-19 Sriraman Tallam <tmsriram@google.com>
409
410 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
411
0c9350c8
CC
4122011-09-19 Cary Coutant <ccoutant@google.com>
413
414 * incremental.cc (can_incremental_update): Fix typo in comment.
415 * incremental.h (can_incremental_update): Likewise.
416
aa06ae28
CC
4172011-09-18 Cary Coutant <ccoutant@google.com>
418
419 * incremental.cc (can_incremental_update): New function.
420 * incremental.h (can_incremental_update): New function.
421 * layout.cc (Layout::init_fixed_output_section): Call it.
422 (Layout::make_output_section): Don't allow patch space in .eh_frame.
423 * object.cc (Sized_relobj_file::do_layout): Call
424 can_incremental_update.
425
ebb300b2
CC
4262011-09-13 Cary Coutant <ccoutant@google.com>
427
428 * configure.ac: Check for glibc support for gnu_indirect_function
429 support with static linking, setting automake conditional
430 IFUNC_STATIC.
431 * Makefile.in: Regenerate.
432 * configure: Regenerate.
433
434 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
435 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
436 for IFUNC_STATIC.
437 * testsuite/Makefile.in: Regenerate.
438
1206d0d5
CC
4392011-09-13 Cary Coutant <ccoutant@google.com>
440
441 * incremental.cc (Sized_relobj_incr::do_layout): Call
442 report_comdat_group for kept comdat sections.
443 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
444 * testsuite/Makefile.in: Regenerate.
445 * testsuite/incr_comdat_test_1.cc: New source file.
446 * testsuite/incr_comdat_test_2_v1.cc: New source file.
447 * testsuite/incr_comdat_test_2_v2.cc: New source file.
448 * testsuite/incr_comdat_test_2_v3.cc: New source file.
449
40b29874
ILT
4502011-09-13 Ian Lance Taylor <iant@google.com>
451
452 * object.cc (Sized_relobj_file::do_layout): Remove unused local
453 variable external_symbols_offset.
454
1b045aac
ILT
4552011-09-12 Ian Lance Taylor <iant@google.com>
456
457 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
458 triggered if object has no symbols.
459
24c6c55a
DM
4602011-09-09 David S. Miller <davem@davemloft.net>
461
462 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
463 (Output_fill_debug_line::do_write): Likewise.
464
66570254
CC
4652011-08-29 Cary Coutant <ccoutant@google.com>
466
467 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
468 casts to match formatting specs.
469 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
470
8ea8cd50
CC
4712011-08-26 Cary Coutant <ccoutant@google.com>
472
473 * layout.cc (Free_list::allocate): Provide guarantee of minimum
474 remaining hole size when allocating.
475 (Layout::make_output_section): Set fill methods for debug sections.
476 * layout.h (Free_list::Free_list_node): Move from private to
477 public.
478 (Free_list::set_min_hole_size): New function.
479 (Free_list::begin, Free_list::end): New functions.
480 (Free_list::min_hole_): New data member.
481 * output.cc: Include dwarf.h.
482 (Output_fill_debug_info::do_minimum_hole_size): New function.
483 (Output_fill_debug_info::do_write): New function.
484 (Output_fill_debug_line::do_minimum_hole_size): New function.
485 (Output_fill_debug_line::do_write): New function.
486 (Output_section::Output_section): Initialize new data member.
487 (Output_section::set_final_data_size): Ensure patch space is larger
488 than minimum hole size.
489 (Output_section::do_write): Fill holes in debug sections.
490 * output.h (Output_fill): New class.
491 (Output_fill_debug_info): New class.
492 (Output_fill_debug_line): New class.
493 (Output_section::set_free_space_fill): New function.
494 (Output_section::free_space_fill_): New data member.
495 * testsuite/Makefile.am (incremental_test_3): Add
496 --incremental-patch option.
497 (incremental_test_4): Likewise.
498 (incremental_test_5): Likewise.
499 (incremental_test_6): Likewise.
500 (incremental_copy_test): Likewise.
501 (incremental_common_test_1): Likewise.
502 * testsuite/Makefile.in: Regenerate.
503
7cf80422
NC
5042011-08-26 Nick Clifton <nickc@redhat.com>
505
506 * po/es.po: Updated Spanish translation.
507
c3f7b0e5
CC
5082011-08-01 Cary Coutant <ccoutant@google.com>
509
510 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
511 * gold/testsuite/Makefile.in: Regenerate.
512 * gold/testsuite/justsyms_exec.c: New source file.
513 * gold/testsuite/justsyms_lib.c: New source file.
514
9590bf25
CC
5152011-08-01 Cary Coutant <ccoutant@google.com>
516
517 * layout.cc (Layout::set_segment_offsets): Don't realign text
518 segment if -Ttext was specified.
519 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
520 file type.
521 * object.h (Sized_relobj_file::e_type): New function.
522 (Sized_relobj_file::e_type_): New data member.
523 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
524 base address for ET_EXEC files.
525 * target.cc (Target::do_make_elf_object_implementation): Allow
526 ET_EXEC files with --just-symbols option.
527
dcd8d12e
CC
5282011-07-28 Cary Coutant <ccoutant@google.com>
529
530 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
531 Add thread_number parameter.
532 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
533 * workqueue-threads.cc
534 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
535 current thread if its thread number is greater than desired thread
536 count.
537 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
538 Add thread_number parameter.
539 (Workqueue::should_cancel_thread): Likewise.
540 (Workqueue::find_runnable_or_wait): Pass thread_number to
541 should_cancel_thread.
542 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
543 parameter.
544
804eb480
ST
5452011-07-22 Sriraman Tallam <tmsriram@google.com>
546
547 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
548 only after checking if it cannot be forced local.
549 * symtab.h (is_externally_visible): Check if the symbol is not forced
550 local.
551
f1ddb600
ILT
5522011-07-15 Ian Lance Taylor <iant@google.com>
553
554 * options.h (class General_options): Add --print-output-format.
555 Move -EL next to -EB, for better --help output.
556 * target-select.cc: Include <cstdio>, "options.h", and
557 "parameters.h".
558 (Target_selector::do_target_bfd_name): New function.
559 (print_output_format): New function.
560 * target-select.h (class Target_selector): Update declarations.
561 (Target_selector::target_bfd_name): New function.
562 (print_output_format): Declare.
563 * main.cc: Include "target-select.h".
564 (main): Handle --print-output-format.
565 * gold.cc: Include "target-select.h".
566 (queue_initial_tasks): Handle --print-output-format when there are
567 no input files.
568 * parameters.cc (parameters_force_valid_target): Give a better
569 error message if -EB/-EL does not match target.
570 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
571 function.
572
7d172687
ILT
5732011-07-15 Ian Lance Taylor <iant@google.com>
574
575 * i386.cc (class Output_data_plt_i386): Add layout_ field.
576 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
577 (Output_data_plt_i386::do_write): Write address of .dynamic
578 section to first entry in .got.plt section.
579 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
580 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
581 Initialize layout_.
582 (Output_data_plt_x86_64::do_write): Write address of .dynamic
583 section to first entry in .got.plt section.
584 * layout.h (Layout::dynamic_section): New function.
585
e9552f7e
ST
5862011-07-13 Sriraman Tallam <tmsriram@google.com>
587
588 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
589 to claim_file call.
590 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
591 input_section_position_, and input_section_glob_.
592 (read_layout_from_file): Call function section_ordering_specified.
593 * layout.h (is_section_ordering_specified): New function.
594 (section_ordering_specified): New function.
595 (section_ordering_specified_): New boolean member.
596 * main.cc(main): Call load_plugins after layout object is defined.
597 * output.cc (Output_section::add_input_section): Use
598 function section_ordering_specified to check if section ordering is
599 needed.
600 * output.cc (Output_section::add_relaxed_input_section): Use
601 function section_ordering_specified to check if section ordering is
602 needed.
603 (Output_section::update_section_layout): New function.
604 (Output_section::sort_attached_input_sections): Check if input section
605 must be reordered.
606 * output.h (Output_section::update_section_layout): New function.
607 * plugin.cc (get_section_count): New function.
608 (get_section_type): New function.
609 (get_section_name): New function.
610 (get_section_contents): New function.
611 (update_section_order): New function.
612 (allow_section_ordering): New function.
613 (Plugin::load): Add the new interfaces to the transfer vector.
614 (Plugin_manager::load_plugins): New parameter.
615 (Plugin_manager::all_symbols_read): New parameter.
616 (Plugin_manager::claim_file): New parameter. Save the elf object for
617 unclaimed objects.
618 (Plugin_manager::get_elf_object): New function.
619 (Plugin_manager::get_view): Change to directly use the bool to check
620 if get_view is called from claim_file_hook.
621 * plugin.h (input_objects): New function
622 (Plugin__manager::load_plugins): New parameter.
623 (Plugin_manager::claim_file): New parameter.
624 (Plugin_manager::get_elf_object): New function.
625 (Plugin_manager::in_claim_file_handler): New function.
626 (Plugin_manager::in_claim_file_handler_): New member.
627 (layout): New function.
628 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
629 handler with an extra parameter. Make the elf object before calling
630 claim_file handler.
631 * testsuite/plugin_test.c (get_section_count): New function pointer.
632 (get_section_type): New function pointer.
633 (get_section_name): New function pointer.
634 (get_section_contents): New function pointer.
635 (update_section_order): New function pointer.
636 (allow_section_ordering): New function pointer.
637 (onload): Check if the new interfaces exist.
638
9446efde
ILT
6392011-07-13 Ian Lance Taylor <iant@google.com>
640
641 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
642 relro section.
643 * x86_64.cc (Target_x86_64::got_section): Likewise.
644 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
645 (relro_now_test_SOURCES): New variable.
646 (relro_now_test_DEPENDENCIES): New variable.
647 (relro_now_test_LDFLAGS): New variable.
648 (relro_now_test_LDADD): New variable.
649 (relro_now_test.so): New target.
650 * testsuite/Makefile.in: Rebuild.
651
07aa62f2
ILT
6522011-07-12 Ian Lance Taylor <iant@google.com>
653
654 PR gold/12980
655 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
656 GLOB_DAT relocation rather than a RELATIVE relocation for a
657 protected symbol when creating a shared library.
658 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
659 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
660 * testsuite/protected_main_1.cc (main): Test that protected
661 function has same address.
662
e2153196
ILT
6632011-07-11 Ian Lance Taylor <iant@google.com>
664
665 PR gold/12979
666 * options.h (class General_options): Add -Bgroup.
667 * options.cc (General_options::finalize): If -Bgroup is set,
668 default to --unresolved-symbols=report-all.
669 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
670 * target-reloc.h (issue_undefined_symbol_error): Handle
671 --unresolved-symbols=report-all.
672
6daf5215
ILT
6732011-07-08 Ian Lance Taylor <iant@google.com>
674
675 PR gold/11985
676 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
677 if linker script discards key sections.
678 (Layout::create_dynamic_symtab): Likewise.
679 (Layout::assign_local_dynsym_offsets): Likewise.
680 (Layout::sized_create_version_sections): Likewise.
681 (Layout::create_interp): Likewise.
682 (Layout::finish_dynamic_section): Likewise.
683 (Layout::set_dynamic_symbol_size): Likewise.
684
beabb2c6
ILT
6852011-07-08 Ian Lance Taylor <iant@google.com>
686
687 PR gold/12386
688 * options.h (class General_options): Add --unresolved-symbols.
689 * target-reloc.h (issue_undefined_symbol_error): Check
690 --unresolved-symbols. Add comments.
691
9c16daf1
ILT
6922011-07-08 Ian Lance Taylor <iant@google.com>
693
694 * testsuite/odr_violation2.cc (Ordering::operator()): Make
695 expression more complex.
696
191f1a2d
ILT
6972011-07-08 Ian Lance Taylor <iant@google.com>
698
699 PR gold/11317
700 * target-reloc.h (issue_undefined_symbol_error): New inline
701 function, broken out of relocate_section.
702 (relocate_section): Call issue_undefined_symbol_error.
703 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
704 there is no TLS segment if we are about to issue an undefined
705 symbol error.
706 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
707
62855347
ILT
7082011-07-08 Ian Lance Taylor <iant@google.com>
709
710 PR gold/12279
711 * resolve.cc (Symbol_table::should_override): Add fromtype
712 parameter. Change all callers. Give error when linking together
713 TLS and non-TLS symbol.
714 (Symbol_table::should_override_with_special): Add fromtype
715 parameter. Change all callers.
716 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
717 there is no TLS segment if we have reported some errors.
718 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
719
67181c72
ILT
7202011-07-08 Ian Lance Taylor <iant@google.com>
721
722 PR gold/12372
723 * target.h (Target::plt_address_for_global): New function.
724 (Target::plt_address_for_local): New function.
725 (Target::plt_section_for_global): Remove.
726 (Target::plt_section_for_local): Remove.
727 (Target::do_plt_address_for_global): New virtual function.
728 (Target::do_plt_address_for_local): New virtual function.
729 (Target::do_plt_section_for_global): Remove.
730 (Target::do_plt_section_for_local): Remove.
731 (Target::register_global_plt_entry): Add Symbol_table and Layout
732 parameters.
733 * output.cc (Output_data_got::Got_entry::write): Use
734 plt_address_for_global and plt_address_for_local.
735 * layout.cc (Layout::add_target_dynamic_tags): Use size and
736 address of output section.
737 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
738 got_irelative_, and irelative_count_ fields. Update
739 declarations.
740 (Output_data_plt_i386::has_irelative_section): New function.
741 (Output_data_plt_i386::entry_count): Add irelative_count_.
742 (Output_data_plt_i386::set_final_data_size): Likewise.
743 (class Target_i386): Add got_irelative_ and rel_irelative_
744 fields. Update declarations.
745 (Target_i386::Target_i386): Initialize new fields.
746 (Target_i386::do_plt_address_for_global): New function replacing
747 do_plt_section_for_global.
748 (Target_i386::do_plt_address_for_local): New function replacing
749 do_plt_section_for_local.
750 (Target_i386::got_section): Create got_irelative_.
751 (Target_i386::rel_irelative_section): New function.
752 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
753 fields. Don't define __rel_iplt_{start,end}.
754 (Output_data_plt_i386::add_entry): Add symtab and layout
755 parameters. Change all callers. Use different PLT and GOT for
756 IFUNC symbols.
757 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
758 layout parameters. Change all callers. Use different PLT and
759 GOT.
760 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
761 (Output_data_plt_i386::rel_irelative): New function.
762 (Output_data_plt_i386::address_for_global): New function.
763 (Output_data_plt_i386::address_for_local): New function.
764 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
765 IRELATIVE GOT when changing IFUNC GOT entries.
766 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
767 reloc.
768 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
769 if we didn't create an IRELATIVE GOT.
770 (Target_i386::Relocate::relocate): Use plt_address_for_global and
771 plt_address_for_local.
772 (Target_i386::do_dynsym_value): Use plt_address_for_global.
773 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
774 got_irelative_, and irelative_count_ fields. Update
775 declarations.
776 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
777 Initialize new fields. Remove symtab parameter. Change all
778 callers.
779 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
780 irelative_count_.
781 (Output_data_plt_x86_64::has_irelative_section): New function.
782 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
783 (class Target_x86_64): Add got_irelative_ and rel_irelative_
784 fields. Update declarations.
785 (Target_x86_64::Target_x86_64): Initialize new fields.
786 (Target_x86_64::do_plt_address_for_global): New function replacing
787 do_plt_section_for_global.
788 (Target_x86_64::do_plt_address_for_local): New function replacing
789 do_plt_section_for_local.
790 (Target_x86_64::got_section): Create got_irelative_.
791 (Target_x86_64::rela_irelative_section): New function.
792 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
793 all callers. Don't create __rel_iplt_{start,end}.
794 (Output_data_plt_x86_64::add_entry): Add symtab and layout
795 parameters. Change all callers. Use different PLT and GOT for
796 IFUNC symbols.
797 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
798 layout parameters. Change all callers. Use different PLT and
799 GOT.
800 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
801 parameters. Change all callers. Use different PLT and GOT for
802 IFUNC symbols.
803 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
804 (Output_data_plt_x86_64::rela_irelative): New function.
805 (Output_data_plt_x86_64::address_for_global): New function.
806 (Output_data_plt_x86_64::address_for_local): New function.
807 (Output_data_plt_x86_64::set_final_data_size): Likewise.
808 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
809 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
810 (Target_x86_64::register_global_plt_entry): Add symtab and layout
811 parameters.
812 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
813 reloc.
814 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
815 symbols if we didn't create an IRELATIVE GOT.
816 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
817 plt_address_for_local.
818 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
819 * testsuite/ifuncvar1.c: New test file.
820 * testsuite/ifuncvar2.c: New test file.
821 * testsuite/ifuncvar3.c: New test file.
822 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
823 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
824 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
825 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
826 * testsuite/Makefile.in: Rebuild.
827
33c15b45
CC
8282011-07-07 Cary Coutant <ccoutant@google.com>
829
830 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
831 (two_file_test_1_ndebug.o): Likewise.
832 (two_file_test_1b_ndebug.o): Likewise.
833 (two_file_test_2_ndebug.o): Likewise.
834 (two_file_test_main_ndebug.o): Likewise.
835 (incremental_test_2): Link with no-debug versions.
836
f48b5fb7
CC
8372011-07-06 Cary Coutant <ccoutant@google.com>
838
839 * gold/incremental.cc
840 (Output_section_incremental_inputs::write_info_blocks): Check for
841 hidden and internal symbols.
842
221597a5
CC
8432011-07-06 Cary Coutant <ccoutant@google.com>
844
845 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
846 Check disposition for startup file.
847 (Incremental_inputs::report_command_line): Ignore
848 --incremental-startup-unchanged option.
849 * options.cc (General_options::parse_incremental_startup_unchanged):
850 New function.
851 (General_options::General_options): Initialize new data member.
852 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
853 (General_options): Add --incremental-startup-unchanged option.
854 (General_options::incremental_startup_disposition): New function.
855 (General_options::incremental_startup_disposition_): New data member.
856
e24719f6
CC
8572011-07-06 Cary Coutant <ccoutant@google.com>
858
859 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
860 input file index to Script_info ctor.
861 (Sized_incremental_binary::do_file_has_changed): Find the
862 command-line argument for files named in scripts.
863 * incremental.h (Script_info::Script_info): New ctor
864 with input file index.
865 (Script_info::input_file_index): New function.
866 (Script_info::input_file_index_): New data member.
867 (Incremental_binary::get_library): Add const.
868 (Incremental_binary::get_script_info): Add const.
869 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
870 * testsuite/Makefile.am (incremental_test_5): New test case.
871 (incremental_test_6): New test case.
872 * testsuite/Makefile.in: Regenerate.
873
8f7c81e8
CC
8742011-07-06 Cary Coutant <ccoutant@google.com>
875
876 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
877 debug output when command lines differ.
878
9fbd3822
CC
8792011-07-06 Cary Coutant <ccoutant@google.com>
880
881 * incremental.cc (Incremental_inputs::report_command_line): Ignore
882 --incremental-patch option.
883 * layout.cc (Free_list::allocate): Extend allocation beyond original
884 end if enabled.
885 (Layout::make_output_section): Mark sections that should get
886 patch space.
887 * options.cc (parse_percent): New function.
888 * options.h (parse_percent): New function.
889 (DEFINE_percent): New macro.
890 (General_options): Add --incremental-patch option.
891 * output.cc (Output_section::Output_section): Initialize new data
892 members.
893 (Output_section::add_input_section): Print section name when out
894 of patch space.
895 (Output_section::add_output_section_data): Likewise.
896 (Output_section::set_final_data_size): Add patch space when
897 doing --incremental-full.
898 (Output_section::do_reset_address_and_file_offset): Remove patch
899 space.
900 (Output_segment::set_section_list_addresses): Print debug output
901 only if --incremental-update.
902 * output.h (Output_section::set_is_patch_space_allowed): New function.
903 (Output_section::is_patch_space_allowed_): New data member.
904 (Output_section::patch_space_): New data member.
905 * parameters.cc (Parameters::incremental_full): New function.
906 * parameters.h (Parameters::incremental_full): New function
907 * testsuite/Makefile.am (incremental_test_2): Add test for
908 --incremental-patch option.
909 * testsuite/Makefile.in: Regenerate.
910 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
911 (t18): Remove function body.
912
f6cccc2c
DK
9132011-07-05 Doug Kwan <dougkwan@google.com>
914
915 PR gold/12771
916 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
917 Arm_Address type for relocation result.
918 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
919 overflow check.
920 (Arm_relocate_functions::abs32): Use unaligned access.
921 (Arm_relocate_functions::rel32): Ditto.
922 (Arm_relocate_functions::prel31): Ditto.
923 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
924 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
925 static data relocations.
926 * testsuite/Makefile.in: Regnerate.
927 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
928
28a13fec
ILT
9292011-07-05 Ian Lance Taylor <iant@google.com>
930
931 PR gold/12392
932 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
933 symbols if necessary.
934 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
935
24d47b34
ILT
9362011-07-05 Ian Lance Taylor <iant@google.com>
937
938 PR gold/12952
939 * resolve.cc (Symbol::override_base_with_special): Simply override
940 version with special symbol version, ignoring previous version.
941
41f9cbbe
ILT
9422011-07-05 Ian Lance Taylor <iant@google.com>
943
944 * object.cc (Sized_relobj_file::include_section_group): Add
945 information to comment about signature location.
946
886288f1
ILT
9472011-07-02 Ian Lance Taylor <iant@google.com>
948
949 PR gold/12957
950 * options.h (class General_options): Add -f and -F.
951 * options.cc (General_options::finalize): Fatal error if -f/-F
952 are used without -shared.
953 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
954
ae3a6d4f
ILT
9552011-07-02 Ian Lance Taylor <iant@google.com>
956
957 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
958
21131061
ILT
9592011-07-01 Ian Lance Taylor <iant@google.com>
960
961 PR gold/12525
962 PR gold/12952
963 * resolve.cc (Symbol::override_base_with_special): Don't override
964 the version if the overriding symbol has a different name.
965 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
966 all callers. If we give an error about an undefined version,
967 define the base version if necessary.
968 * dynobj.h (class Versions): Update declaration.
969 * testsuite/weak_alias_test_5.cc: New file.
970 * testsuite/weak_alias_test.script: New file.
971 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
972 and versioned_alias have the right value, and call t2.
973 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
974 weak_alias_test_5.so.
975 (weak_alias_test_LDADD): Likewise.
976 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
977 * testsuite/Makefile.in: Rebuild.
978
611062c0
ILT
9792011-07-01 Ian Lance Taylor <iant@google.com>
980
981 PR gold/12525
982 * options.h (class General_options): Support -z notext.
983 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
984 -Wl,-z,notext.
985 (two_file_shared_nonpic.so): Likewise.
986 (two_file_shared_mixed.so): Likewise.
987 (two_file_shared_mixed_1.so): Likewise.
988 (weak_undef_lib_nonpic.so): Likewise.
989 (alt/weak_undef_lib_nonpic.so): Likewise.
990 (tls_test_shared_nonpic.so): Likewise.
991 * testsuite/Makefile.in: Rebuild.
992
328c7c2f
ILT
9932011-07-01 Ian Lance Taylor <iant@google.com>
994
995 PR gold/12525
996 * configure.ac: Test whether static linking works, setting
997 the automake conditional HAVE_STATIC.
998 * testsuite/Makefile.am: Disable tests using -static if
999 HAVE_STATIC is not true.
1000 * configure, testsuite/Makefile.in: Rebuild.
1001
02d7cd44
ILT
10022011-07-01 Ian Lance Taylor <iant@google.com>
1003
1004 PR gold/12525
1005 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
1006 Assert if we see DW_EH_PE_indirect.
1007 * target.h (Target::ehframe_datarel_base): New function.
1008 (Target::do_ehframe_datarel_base): New target function.
1009 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
1010 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
1011 function.
1012
07a60597
ILT
10132011-07-01 Ian Lance Taylor <iant@google.com>
1014
1015 PR gold/12571
1016 * options.h (class General_options): Add
1017 --ld-generated-unwind-info.
1018 * ehframe.cc (Fde::write): Add address parameter. Change all
1019 callers. If associated with PLT, fill in address and size.
1020 (Cie::set_output_offset): Only add merge mapping if there is an
1021 object.
1022 (Cie::write): Add address parameter. Change all callers.
1023 (Eh_frame::add_ehframe_for_plt): New function.
1024 * ehframe.h (class Fde): Update declarations. Move shndx_ and
1025 input_offset_ fields into union u_, with new plt field.
1026 (Fde::Fde): Adjust for new union field.
1027 (Fde::Fde) [Output_data version]: New constructor.
1028 (Fde::add_mapping): Only add merge mapping if there is an object.
1029 (class Cie): Update declarations.
1030 (class Eh_frame): Declare add_ehframe_for_plt.
1031 * layout.cc (Layout::layout_eh_frame): Break out code into
1032 make_eh_frame_section, and call it.
1033 (Layout::make_eh_frame_section): New function.
1034 (Layout::add_eh_frame_for_plt): New function.
1035 * layout.h (class Layout): Update declarations.
1036 * merge.cc (Merge_map::add_mapping): Add assertion.
1037 * i386.cc: Include "dwarf.h".
1038 (class Output_data_plt_i386): Make first_plt_entry,
1039 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
1040 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1041 and plt_eh_frame_fde.
1042 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
1043 boundary. Call add_eh_frame_for_plt if appropriate.
1044 * x86_64.cc: Include "dwarf.h".
1045 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
1046 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
1047 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1048 and plt_eh_frame_fde.
1049 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
1050 appropriate.
1051
14788a3f
ILT
10522011-06-29 Ian Lance Taylor <iant@google.com>
1053
1054 PR gold/12629
1055 * object.cc (Sized_relobj_file::layout_section): Change shdr
1056 parameter to be const.
1057 (Sized_relobj_file::layout_eh_frame_section): New function, broken
1058 out of do_layout.
1059 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
1060 appropriate. Call layout_eh_frame_section.
1061 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
1062 sections.
1063 * object.h (class Sized_relobj_file): Update declarations.
1064
6c21fce1
ILT
10652011-06-29 Ian Lance Taylor <iant@google.com>
1066
37e41b03 1067 PR gold/12652
6c21fce1
ILT
1068 * script.cc (Token::integer_value): Accept trailing M/m/K/k
1069 modifier.
1070 (Lex::gather_token): Accept trailing M/m/K/k for integers.
1071
4d5e4e62
ILT
10722011-06-29 Ian Lance Taylor <iant@google.com>
1073
1074 PR gold/12675
1075 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
1076 SHT_X86_64_UNWIND.
1077 * layout.cc (Layout::layout_eh_frame): Likewise.
1078
886f533a
ILT
10792011-06-29 Ian Lance Taylor <iant@google.com>
1080
1081 PR gold/12695
1082 * layout.cc (Layout::symtab_section_shndx): New function.
1083 * layout.h (class Layout): Declare symtab_section_shndx.
1084 * output.cc (Output_section::write_header): Call it.
1085
f3ae1b28
ILT
10862011-06-29 Ian Lance Taylor <iant@google.com>
1087
1088 PR gold/12818
1089 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
1090 symbols which are not used in a relocation.
1091
aecf301f
ILT
10922011-06-28 Ian Lance Taylor <iant@google.com>
1093
1094 PR gold/12898
1095 * layout.cc (Layout::segment_precedes): Don't crash if a linker
1096 script create indistinguishable segments.
1097 (Layout::set_segment_offsets): Use stable_sort when sorting
1098 segments. Pass this to Compare_segments constructor.
1099 * layout.h (class Layout): Make segment_precedes non-static.
1100 (class Compare_segments): Change from struct to class. Add
1101 layout_ field. Add constructor.
1102 * script-sections.cc
1103 (Script_sections::attach_sections_using_phdrs_clause): Rename
1104 local orphan to is_orphan. Don't report failure to put empty
1105 section in segment. On attachment failure, report name of
1106 section, and attach to first PT_LOAD segment.
1107
03ef7571
ILT
11082011-06-28 Ian Lance Taylor <iant@google.com>
1109
1110 PR gold/12934
1111 * target-select.cc (Target_selector::Target_selector): Add
1112 emulation parameter. Change all callers.
1113 (select_target_by_bfd_name): Rename from select_target_by_name.
1114 Change all callers.
1115 (select_target_by_emulation): New function.
1116 (supported_emulation_names): New function.
1117 * target-select.h (class Target_selector): Add emulation_ field.
1118 Update declarations.
1119 (Target_selector::recognize_by_bfd_name): Rename from
1120 recognize_by_name. Change all callers.
1121 (Target_selector::supported_bfd_names): Rename from
1122 supported_names. Change all callers.
1123 (Target_selector::recognize_by_emulation): New function.
1124 (Target_selector::supported_emulations): New function.
1125 (Target_selector::emulation): New function.
1126 (Target_selector::do_recognize_by_bfd_name): Rename from
1127 do_recognize_by_name. Change all callers.
1128 (Target_selector::do_supported_bfd_names): Rename from
1129 do_supported_names. Change all callers.
1130 (Target_selector::do_recognize_by_emulation): New function.
1131 (Target_selector::do_supported_emulations): New function.
1132 (select_target_by_bfd_name): Change name in declaration.
1133 (select_target_by_emulation): Declare.
1134 (supported_emulation_names): Declare.
1135 * parameters.cc (parameters_force_valid_target): Try to find
1136 target based on emulation from -m option.
1137 * options.h (class General_options): Change doc string for -m.
1138 * options.cc (help): Print emulations.
1139 (General_options::parse_V): Likewise.
1140 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
1141 Add emulation parameter. Change all callers.
1142
200b2bb9
ILT
11432011-06-28 Ian Lance Taylor <iant@google.com>
1144
1145 * target.h (class Target): Add osabi_ field.
1146 (Target::osabi): New function.
1147 (Target::set_osabi): New function.
1148 (Target::Target): Initialize osabi_.
1149 (Target::do_adjust_elf_header): Make pure virtual.
1150 (Sized_target::do_adjust_elf_header): Declare.
1151 * target.cc (Sized_target::do_adjust_elf_header): New function.
1152 (class Sized_target): Instantiate all versions.
1153 * freebsd.h (class Target_freebsd): Remove.
1154 (Target_selector_freebsd::do_recognize): Call set_osabi on
1155 Target.
1156 (Target_selector_freebsd::do_recognize_by_name): Likewise.
1157 (Target_selector_freebsd::set_osabi): Remove.
1158 * i386.cc (class Target_i386): Inherit from Sized_target rather
1159 than Target_freebsd.
1160 * x86_64.cc (class Target_x86_64): Likewise.
1161
b3ce541e
ILT
11622011-06-28 Ian Lance Taylor <iant@google.com>
1163
1164 * target.h (Target::can_check_for_function_pointers): Rewrite.
1165 Make non-virtual.
1166 (Target::can_icf_inline_merge_sections): Likewise.
1167 (Target::section_may_have_icf_unsafe_poineters): Likewise.
1168 (Target::Target_info): Add can_icf_inline_merge_sections field.
1169 (Target::do_can_check_for_function_pointers): New virtual
1170 function.
1171 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
1172 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
1173 from can_check_for_function_pointers, move in file.
1174 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
1175 section_may_have_icf_unsafe_poineters, move in file.
1176 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
1177 * i386.cc (Target_i386::do_can_check_for_function_pointers):
1178 Rename from can_check_for_function_pointers, move in file.
1179 (Target_i386::can_icf_inline_merge_sections): Remove.
1180 (Target_i386::i386_info): Initialize
1181 can_icf_inline_merge_sections.
1182 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
1183 Initialize can_icf_inline_merge_sections.
1184 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
1185 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
1186 Rename from can_check_for_function_pointers, move in file.
1187 (Target_x86_64::can_icf_inline_merge_sections): Remove.
1188 (Target_x86_64::x86_64_info): Initialize
1189 can_icf_inline_merge_sections.
1190 * testsuite/testfile.cc (Target_test::test_target_info):
1191 Likewise.
1192 * icf.cc (get_section_contents): Correct formatting.
1193
6d1c4efb
ILT
11942011-06-27 Ian Lance Taylor <iant@google.com>
1195
1196 * symtab.cc (Symbol::versioned_name): New function.
1197 (Symbol_table::add_to_final_symtab): Use versioned_name when
1198 appropriate.
1199 (Symbol_table::sized_write_symbol): Likewise.
1200 * symtab.h (class Symbol): Declare versioned_name.
1201 * stringpool.h (class Stringpool_template): Add variant of add
1202 which takes a std::basic_string.
1203 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
1204 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
1205 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
1206 (ver_test_12.o): New target.
1207 * testsuite/Makefile.in: Rebuild.
1208
57eb9b50
DK
12092011-06-27 Doug Kwan <dougkwan@google.com>
1210
1211 * arm.cc (Arm_relocate_functions::thm_jump8,
1212 Arm_relocate_functions::thm_jump11): Use a wider signed
1213 type to compute offset.
1214 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
1215 arm_thm_jump8.
1216 * testsuite/Makefile.in: Regenerate.
1217 * testsuite/arm_branch_in_range.sh: Check test results of
1218 arm_thm_jump11 and arm_thm_jump8.
1219 * testsuite/arm_thm_jump11.s: New test source file.
1220 * testsuite/arm_thm_jump11.t: New linker script.
1221 * testsuite/arm_thm_jump8.s: New test source file.
1222 * testsuite/arm_thm_jump8.t: New linker script.
1223
487b39df
ILT
12242011-06-24 Ian Lance Taylor <iant@google.com>
1225
1226 * layout.cc: Include "object.h".
1227 (ctors_sections_in_init_array): New static variable.
1228 (Layout::is_ctors_in_init_array): New function.
1229 (Layout::layout): Add entry to ctors_sections_in_init_array if
1230 appropriate.
1231 * layout.h (class Layout): Declare is_ctors_in_init_array.
1232 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
1233 is_ctors_reverse_view is set.
1234 (Sized_relobj_file::write_sections): Add layout parameter. Change
1235 all callers. Set is_ctors_reverse_view field of View_size.
1236 (Sized_relobj_file::reverse_words): New function.
1237 * object.h (Sized_relobj_file::View_size): Add
1238 is_ctors_reverse_view field.
1239 (class Sized_relobj_file): Update declarations.
1240 * testsuite/initpri3.c: New test.
1241 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
1242 initpri3b.
1243 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
1244 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
1245 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
1246 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
1247 * testsuite/Makefile.in: Rebuild.
1248
472076e4
CC
12492011-06-24 Cary Coutant <ccoutant@google.com>
1250
1251 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
1252 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
1253 (debug_msg_cdebug.err): New targets.
1254 * testsuite/Makefile.in: Regenerate.
1255 * testsuite/debug_msg.sh: Check output of link with compressed debug.
1256 Fix checks for link with shared library.
1257
a60af0db
DK
12582011-06-24 Doug Kwan <dougkwan@google.com>
1259
1260 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
1261 skip empty text sections.
1262 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
1263
5393d741
ILT
12642011-06-22 Ian Lance Taylor <iant@google.com>
1265
1266 PR gold/12910
1267 * options.h (class General_options): Add --ctors-in-init-array.
1268 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
1269 friends as SHT_PROGBITS for merging sections.
1270 (Layout::layout): Remove special handling of .init_array and
1271 friends. Don't sort if doing relocatable link. Sort for .ctors
1272 and .dtors if ctors_in_init_array.
1273 (Layout::make_output_section): Force correct section types for
1274 .init_array and friends. Don't sort if doing relocatable link,
1275 Don't sort .ctors and .dtors if ctors_in_init_array.
1276 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
1277 (Layout::output_section_name): Add relobj parameter. Change all
1278 callers. Handle .ctors. and .dtors. in code rather than table.
1279 Handle .ctors and .dtors if ctors_in_init_array.
1280 (Layout::match_file_name): New function, moved from output.cc.
1281 * layout.h (class Layout): Update declarations.
1282 * output.cc: Include "layout.h".
1283 (Input_section_sort_entry::get_priority): New function.
1284 (Input_section_sort_entry::match_file_name): Just call
1285 Layout::match_file_name.
1286 (Output_section::Input_section_sort_init_fini_compare::operator()):
1287 Handle .ctors and .dtors. Sort by explicit priority rather than
1288 by name.
1289 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
1290 * testsuite/initpri2.c: New test.
1291 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
1292 (check_PROGRAMS): Add initpri2.
1293 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
1294 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
1295 * configure, testsuite/Makefile.in: Rebuild.
1296
e1f74f98
ILT
12972011-06-19 Ian Lance Taylor <iant@google.com>
1298
1299 PR gold/12880
1300 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
1301 .interp section to a PT_INTERP segment even if we have seen a
1302 --dynamic-linker option. Don't do it if we have seen a PHDRS
1303 clause in a linker script.
1304 (Layout::finalize): Don't create a .interp section if we've
1305 already create a PT_INTERP segment.
1306 (Layout::create_interp): Always call choose_output_section (revert
1307 patch of 2011-06-17). Don't create PT_INTERP segment.
1308 * script-sections.cc
1309 (Script_sections::create_note_and_tls_segments): Add a .interp
1310 section to a PT_INTERP segment even if we have seen a
1311 --dynamic-linker option.
1312
766f91bb
ILT
13132011-06-18 Ian Lance Taylor <iant@google.com>
1314
1315 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
1316 merely because a non-PT_LOAD segment has a dynamic reloc.
1317
0d212c3a
ILT
13182011-06-18 Ian Lance Taylor <iant@google.com>
1319
1320 * layout.cc (Layout::finish_dynamic_section): Don't create
1321 DT_FLAGS entry if not needed.
1322
911a5072
ILT
13232011-06-18 Ian Lance Taylor <iant@google.com>
1324
1325 PR gold/12745
1326 * layout.cc (Layout::layout_eh_frame): Correct handling of
1327 writable .eh_frame section.
1328
534b4e5f
ILT
13292011-06-17 Ian Lance Taylor <iant@google.com>
1330
1331 PR gold/12893
1332 * resolve.cc (Symbol_table::resolve): Don't give an error if a
1333 symbol is redefined with the exact same object and value.
1334
10b4f102
ILT
13352011-06-17 Ian Lance Taylor <iant@google.com>
1336
1337 PR gold/12880
1338 * layout.h (class Layout): Add interp_segment_ field.
1339 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
1340 (Layout::attach_allocated_section_to_segment): If making shared
1341 library, put .interp section in PT_INTERP segment.
1342 (Layout::finalize): Also call create_interp if -dynamic-linker
1343 option was used.
1344 (Layout::create_interp): Assert that there is no PT_INTERP
1345 segment. If not using a SECTIONS clause, use make_output_section.
1346 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
1347 * script-sections.cc
1348 (Script_sections::create_note_and_tls_segments): If making shared
1349 library, put .interp section in PT_INTERP segment.
1350
a29b0dad
ILT
13512011-06-17 Ian Lance Taylor <iant@google.com>
1352
e588ea8d
ILT
1353 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
1354 when making a shared library.
1355
13562011-06-17 Ian Lance Taylor <iant@google.com>
1357
1358 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
1359 parameter. Change all callers. Don't issue warning about PC32
1360 against locally defined symbol.
a29b0dad 1361
9d3b0698
ILT
13622011-06-16 Ian Lance Taylor <iant@google.com>
1363
1364 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
1365 occurs in same object.
1366
85b0f90c
AM
13672011-06-14 Alan Modra <amodra@gmail.com>
1368
1369 * po/POTFILES.in: Regenerate.
1370
a94907d9
ILT
13712011-06-09 Ian Lance Taylor <iant@google.com>
1372
1373 * script-sections.cc
1374 (Orphan_output_section::set_section_addresses): For a relocatable
1375 link set address to 0.
1376
4fb3a1c3
CC
13772011-06-09 Cary Coutant <ccoutant@google.com>
1378
1379 PR gold/12804
1380 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
1381 used with --compress-debug-sections.
1382 * gold/object.cc (Sized_relobj_file::do_layout): Report
1383 uncompressed size of compressed input sections.
1384
61220854
CC
13852011-06-08 Cary Coutant <ccoutant@google.com>
1386
1387 PR gold/12804
1388 * testsuite/two_file_test_2_v1.cc: Change initialization of
1389 v2 to keep it in .data.
1390
e6455dfb
CC
13912011-06-07 Cary Coutant <ccoutant@google.com>
1392
1393 * common.cc (Symbol_table::do_allocate_commons_list): Call
1394 gold_fallback.
1395 * errors.cc (Errors::fatal): Adjust call to gold_exit.
1396 (Errors::fallback): New function.
1397 (gold_fallback): New function.
1398 * errors.h (Errors::fallback): New function.
1399 * gold.cc (gold_exit): Change status parameter to enum; adjust
1400 all callers.
1401 (queue_initial_tasks): Call gold_fallback.
1402 * gold.h: Include cstdlib.
1403 (Exit_status): New enum type.
1404 (gold_exit): Change status parameter to enum.
1405 (gold_fallback): New function.
1406 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
1407 (Layout::create_symtab_sections): Likewise.
1408 (Layout::create_shdrs): Likewise.
1409 * main.cc (main): Adjust call to gold_exit.
1410 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
1411 (Output_data_got::add_got_entry_pair): Likewise.
1412 (Output_section::add_input_section): Likewise.
1413 (Output_section::add_output_section_data): Likewise.
1414 (Output_segment::set_section_list_addresses): Likewise.
1415 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
1416
fb0e076f
CC
14172011-06-07 Cary Coutant <ccoutant@google.com>
1418
1419 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
1420 for incremental links.
1421 * output.cc (Output_segment::set_section_list_addresses): Remove
1422 FIXME and test for TLS or BSS.
1423
a5ee4d5d
CC
14242011-06-07 Cary Coutant <ccoutant@google.com>
1425
1426 * testsuite/Makefile.am: Add incremental_copy_test,
1427 incremental_common_test_1.
1428 * testsuite/Makefile.in: Regenerate.
1429 * testsuite/common_test_1_v1.c: New source file.
1430 * testsuite/common_test_1_v2.c: New source file.
1431 * testsuite/copy_test_v1.cc: New source file.
1432
5146f448
CC
14332011-06-07 Cary Coutant <ccoutant@google.com>
1434
1435 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
1436 update, allocate common from bss section's free list.
1437 * incremental-dump.cc (dump_incremental_inputs): Print flag for
1438 linker-defined symbols.
1439 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
1440 Skip GOT and PLT entries that are no longer referenced.
1441 (Output_section_incremental_inputs::write_info_blocks): Mark
1442 linker-defined symbols.
1443 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
1444 * output.cc (Output_section::allocate): New function.
1445 * output.h (Output_section::allocate): New function.
1446 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
1447 linker-defined symbols.
1448 (Symbol::override_base_with_special): Copy is_predefined_ flag.
1449 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
1450 (Symbol::init_base_output_data): Likewise.
1451 (Symbol::init_base_output_segment): Likewise.
1452 (Symbol::init_base_constant): Likewise.
1453 (Sized_symbol::init_output_data): Likewise.
1454 (Sized_symbol::init_output_segment): Likewise.
1455 (Sized_symbol::init_constant): Likewise.
1456 (Symbol_table::do_define_in_output_data): Likewise.
1457 (Symbol_table::do_define_in_output_segment): Likewise.
1458 (Symbol_table::do_define_as_constant): Likewise.
1459 * symtab.h (Symbol::is_predefined): New function.
1460 (Symbol::init_base_output_data): Add is_predefined parameter.
1461 (Symbol::init_base_output_segment): Likewise.
1462 (Symbol::init_base_constant): Likewise.
1463 (Symbol::is_predefined_): New data member.
1464 (Sized_symbol::init_output_data): Add is_predefined parameter.
1465 (Sized_symbol::init_output_segment): Likewise.
1466 (Sized_symbol::init_constant): Likewise.
1467 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
1468
26d3c67d
CC
14692011-06-07 Cary Coutant <ccoutant@google.com>
1470
1471 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
1472 instead of emit_copy_reloc.
1473 (Copy_relocs::emit_copy_reloc): Refactor.
1474 (Copy_relocs::make_copy_reloc): New function.
1475 (Copy_relocs::add_copy_reloc): Remove.
1476 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
1477 section.
1478 (Copy_relocs::make_copy_reloc): New function.
1479 (Copy_relocs::add_copy_reloc): Remove.
1480 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
1481 unchanged input files.
1482 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
1483 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
1484 Reserve BSS space for COPY relocations.
1485 (Sized_incremental_binary::do_emit_copy_relocs): New function.
1486 (Output_section_incremental_inputs::write_info_blocks): Record
1487 whether a symbol is copied from a shared object.
1488 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
1489 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
1490 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
1491 (Incremental_input_entry_reader::get_output_symbol_index): Add
1492 is_copy parameter.
1493 (Incremental_binary::emit_copy_relocs): New function.
1494 (Incremental_binary::do_emit_copy_relocs): New function.
1495 (Sized_incremental_binary::Sized_incremental_binary): Initialize
1496 new data member.
1497 (Sized_incremental_binary::add_copy_reloc): New function.
1498 (Sized_incremental_binary::do_emit_copy_relocs): New function.
1499 (Sized_incremental_binary::Copy_reloc): New struct.
1500 (Sized_incremental_binary::Copy_relocs): New typedef.
1501 (Sized_incremental_binary::copy_relocs_): New data member.
1502 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
1503 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
1504 * target.h (Sized_target::emit_copy_reloc): New function.
1505 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
1506
7cdb37d9
CC
15072011-06-02 Cary Coutant <ccoutant@google.com>
1508
1509 PR gold/12163
1510 * gold/archive.cc (Archive::Archive): Initialize new data member.
1511 (Archive::include_all_members): Return if archive has already been
1512 included.
1513 * gold/archive.h (Archive::include_all_members_): New data member.
1514
cc643b88
NC
15152011-06-02 Nick Clifton <nickc@redhat.com>
1516
1517 * dynobj.h: Fix spelling mistake in comment.
1518 * output.cc: Likewise.
1519
f62a3ca7
DK
15202011-05-31 Doug Kwan <dougkwan@google.com>
1521 Asier Llano
1522
1523 PR gold/12826
cc643b88 1524 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
1525 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
1526 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
1527 redundant arm_exidx_test.so.
1528 * testsuite/Makefile.in: Regenerate.
1529 (check_SCRIPTS): Add pr12826.sh
1530 (check_DATA): Add pr12826.stdout
1531 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
1532 * testsuite/pr12826.sh: New file.
1533 * testsuite/pr12826_1.s: Ditto.
1534 * testsuite/pr12826_1.s: Ditto.
1535
8dbe1edc
ILT
15362011-05-30 Ian Lance Taylor <iant@google.com>
1537
1538 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
1539 sections.
1540
c49875be
ILT
15412011-05-29 Ian Lance Taylor <iant@google.com>
1542
1543 PR gold/12804
1544 * testsuite/Makefile.am: Use different file name for two_file_test
1545 temporary file for each incremental test.
1546 * testsuite/Makefile.in: Rebuild.
1547
69d53f7a
ILT
15482011-05-29 Ian Lance Taylor <iant@google.com>
1549
1550 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
1551 binary input file is empty.
1552
41d0ab5f
ILT
15532011-05-27 Ian Lance Taylor <iant@google.com>
1554
1555 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
1556 (ver_test_9.so): Likewise.
1557 * testsuite/Makefile.in: Rebuild.
1558
89d8a36b
CC
15592011-05-26 Cary Coutant <ccoutant@google.com>
1560
1561 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
1562 * incremental.cc (Incremental_inputs::report_input_section): Fix
1563 comment, indentation.
1564 (Incremental_inputs::report_comdat_group): New function.
1565 (Output_section_incremental_inputs::set_final_data_size): Adjust size
1566 of data for incremental input file entry.
1567 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
1568 group count, COMDAT group signatures.
1569 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
1570 an unchanged input file.
1571 * incremental.h (Incremental_object_entry::Incremental_object_entry):
1572 Initialize new data member.
1573 (Incremental_object_entry::add_comdat_group): New function.
1574 (Incremental_object_entry::get_comdat_group_count): New function.
1575 (Incremental_object_entry::get_comdat_signature_key): New function.
1576 (Incremental_object_entry::groups_): New data member.
1577 (Incremental_inputs::report_comdat_group): New function.
1578 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
1579 data for incremental input file entry.
1580 (Incremental_input_entry_reader::get_comdat_group_count): New function.
1581 (Incremental_input_entry_reader::get_input_section): Adjust size of
1582 data for incremental input file entry.
1583 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
1584 (Incremental_input_entry_reader::get_comdat_group_signature): New
1585 function.
1586 * object.cc (Sized_relobj::include_section_group): Report kept
1587 COMDAT groups for incremental links.
1588
1706a06f
ILT
15892011-05-24 David Meyer <pdox@google.com>
1590
1591 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
1592 with name parameter. Add found_name parameter.
1593 * fileread.cc (Input_file::find_file): Adjust code accordingly.
1594 * dirsearch.h (class Dirsearch): Update declaration.
1595
a10ae760
ILT
15962011-05-24 Ian Lance Taylor <iant@google.com>
1597
1598 * archive.cc (Library_base::should_include_member): Pull in object
1599 from archive if it defines the entry symbol.
1600 * parameters.cc (Parameters::entry): New function.
1601 * parameters.h (class Parameters): Declare entry.
1602 * output.h (class Output_file_header): Remove entry_ field.
1603 * output.cc (Output_file_header::Output_file_header): Remove entry
1604 parameter. Change all callers.
1605 (Output_file_header::entry): Use parameters->entry.
1606 * gold.cc (queue_middle_tasks): Likewise.
1607 * plugin.cc (Plugin_hook::run): Likewise.
1608
aa92d6ed
CC
16092011-05-24 Cary Coutant <ccoutant@google.com>
1610
1611 * gold.cc (queue_initial_tasks): Pass incremental base filename
1612 to Output_file::open_base_file; don't print error message.
1613 * incremental-dump.cc (main): Adjust call to
1614 Output_file::open_for_modification.
1615 * incremental-dump.cc (main): Likewise.
1616 * incremental.cc (Incremental_inputs::report_command_line):
1617 Ignore --incremental-base option when comparing command lines.
1618 Ignore parameter when given as separate argument.
1619 * options.h (class General_options): Add --incremental-base.
1620 * output.cc (Output_file::Output_file):
1621 (Output_file::open_base_file): Add base_name and writable parameters;
1622 read base file into new file; print error message here.
1623 (Output_file::map_no_anonymous): Add writable parameter; adjust all
1624 callers.
1625 * output.h (Output_file::open_for_modification): Rename to...
1626 (Output_file::open_base_file): ...this; add base_name and
1627 writable parameters; adjust all callers.
1628 (Output_file::map_no_anonymous): Add writable parameter; adjust all
1629 callers.
1630 * testsuite/Makefile.am (incremental_test_4): Test
1631 --incremental-base.
1632 * testsuite/Makefile.in: Regenerate.
1633
2eedd706
CC
16342011-05-24 Cary Coutant <ccoutant@google.com>
1635
1636 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
1637 incremental_test_4.
1638 * testsuite/Makefile.in: Regenerate.
1639 * testsuite/two_file_test_1_v1.cc: New test source file.
1640 * testsuite/two_file_test_1b_v1.cc: New test source file.
1641 * testsuite/two_file_test_2_v1.cc: New test source file.
1642
0f1c85a6
CC
16432011-05-24 Cary Coutant <ccoutant@google.com>
1644
1645 * dynobj.h (Dynobj::do_dynobj): New function.
1646 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
1647 flag and soname for shared objects.
1648 * incremental.cc (Incremental_inputs::report_object): Make
1649 either Incremental_object_entry or Incremental_dynobj_entry; add
1650 soname to string table.
1651 (Incremental_inputs::report_input_section): Add assertion.
1652 (Output_section_incremental_inputs::set_final_data_size): Adjust
1653 type of input file entry for shared libraries; adjust size of
1654 shared library info entry.
1655 (Output_section_incremental_inputs::write_input_files): Write
1656 as_needed flag for shared libraries.
1657 (Output_section_incremental_inputs::write_info_blocks): Adjust type
1658 of input file entry for shared libraries; write soname.
1659 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
1660 soname from incremental info.
1661 * incremental.h (enum Incremental_input_flags): Add
1662 INCREMENTAL_INPUT_AS_NEEDED.
1663 (Incremental_input_entry::Incremental_input_entry): Initialize new
1664 data member.
1665 (Incremental_input_entry::set_as_needed): New function.
1666 (Incremental_input_entry::as_needed): New function.
1667 (Incremental_input_entry::do_dynobj_entry): New function.
1668 (Incremental_input_entry::as_needed_): New data member.
1669 (Incremental_object_entry::Incremental_object_entry): Don't check
1670 for shared library.
1671 (Incremental_object_entry::do_type): Likewise.
1672 (class Incremental_dynobj_entry): New class.
1673 (Incremental_input_entry_reader::as_needed): New function.
1674 (Incremental_input_entry_reader::get_soname): New function.
1675 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
1676 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
1677 size of shared library info entry.
1678 * layout.cc (Layout::finish_dynamic_section): Don't test for
1679 incremental link when adding DT_NEEDED entries.
1680 * object.h (Object::Object): Initialize new data member.
1681 (Object::dynobj): New function.
1682 (Object::set_as_needed): New function.
1683 (Object::as_needed): New function.
1684 (Object::do_dynobj): New function.
1685 (Object::as_needed_): New data member.
1686
6fa2a40b
CC
16872011-05-24 Cary Coutant <ccoutant@google.com>
1688
1689 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
1690 info; adjust display of GOT entries.
1691 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
1692 vector of input objects; remove file_status_.
1693 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
1694 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
1695 got_plt reader; call target hooks to reserve GOT entries.
1696 (Output_section_incremental_inputs::set_final_data_size): Adjust size
1697 of input file info header and GOT info entry.
1698 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
1699 relocation info.
1700 (Got_plt_view_info::got_descriptor): Remove.
1701 (Got_plt_view_info::sym_index): New data member.
1702 (Got_plt_view_info::input_index): New data member.
1703 (Local_got_offset_visitor::visit): Write input file index.
1704 (Global_got_offset_visitor::visit): Write 0 for input file index.
1705 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
1706 with sym_index and input_index.
1707 (Output_section_incremental_inputs::write_got_plt): Adjust size of
1708 incremental info GOT entry; replace got_descriptor with input_index.
1709 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
1710 map from input file index to object.
1711 (Sized_relobj_incr::do_layout): Replace direct data member reference
1712 with accessor function.
1713 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
1714 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
1715 Adjust size of input file info header.
1716 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
1717 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
1718 (Incremental_input_entry_reader::get_input_section): Adjust size of
1719 input file info header.
1720 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
1721 of incremental info GOT entry.
1722 (Incremental_got_plt_reader::get_got_desc): Remove.
1723 (Incremental_got_plt_reader::get_got_symndx): New function.
1724 (Incremental_got_plt_reader::get_got_input_index): New function.
1725 (Sized_incremental_binary::Sized_incremental_binary): Remove
1726 file_status_; add input_objects_.
1727 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
1728 (Sized_incremental_binary::set_file_is_unchanged): Remove.
1729 (Sized_incremental_binary::file_is_unchanged): Remove.
1730 (Sized_incremental_binary::set_input_object): New function.
1731 (Sized_incremental_binary::input_object): New function.
1732 (Sized_incremental_binary::file_status_): Remove.
1733 (Sized_incremental_binary::input_objects_): New data member.
1734 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
1735 references.
1736 (Sized_relobj_incr::invalid_address): Move to base class.
1737 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
1738 class.
1739 (Sized_relobj_incr::do_output_section_offset): Likewise.
1740 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
1741 (Sized_relobj_incr::section_offsets_): Likewise.
1742 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
1743 function.
1744 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
1745 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
1746 with accessor function.
1747 (Sized_relobj_file::do_layout): Likewise.
1748 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
1749 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
1750 (Sized_relobj_file::compute_final_local_value): Replace refs to
1751 section_offsets_ with accessor function.
1752 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
1753 * object.h (Relobj::Relobj): Initialize new data members.
1754 (Relobj::add_dyn_reloc): New function.
1755 (Relobj::first_dyn_reloc): New function.
1756 (Relobj::dyn_reloc_count): New function.
1757 (Relobj::first_dyn_reloc_): New data member.
1758 (Relobj::dyn_reloc_count_): New data member.
1759 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
1760 references.
1761 (Sized_relobj::Address): New typedef.
1762 (Sized_relobj::invalid_address): Move here from child class.
1763 (Sized_relobj::Sized_relobj): Initialize new data members.
1764 (Sized_relobj::sized_relobj): New function.
1765 (Sized_relobj::is_output_section_offset_invalid): Move here from
1766 child class.
1767 (Sized_relobj::get_output_section_offset): Likewise.
1768 (Sized_relobj::local_has_got_offset): Likewise.
1769 (Sized_relobj::local_got_offset): Likewise.
1770 (Sized_relobj::set_local_got_offset): Likewise.
1771 (Sized_relobj::do_for_all_local_got_entries): Likewise.
1772 (Sized_relobj::clear_got_offsets): New function.
1773 (Sized_relobj::section_offsets): Move here from child class.
1774 (Sized_relobj::do_output_section_offset): Likewise.
1775 (Sized_relobj::do_set_section_offset): Likewise.
1776 (Sized_relobj::Local_got_offsets): Likewise.
1777 (Sized_relobj::local_got_offsets_): Likewise.
1778 (Sized_relobj::section_offsets_): Likewise.
1779 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
1780 references.
1781 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
1782 class.
1783 (Sized_relobj_file::sized_relobj): New function
1784 (Sized_relobj_file::local_has_got_offset): Move to base class.
1785 (Sized_relobj_file::local_got_offset): Likewise.
1786 (Sized_relobj_file::set_local_got_offset): Likewise.
1787 (Sized_relobj_file::get_output_section_offset): Likewise.
1788 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
1789 (Sized_relobj_file::do_output_section_offset): Likewise.
1790 (Sized_relobj_file::do_set_section_offset): Likewise.
1791 (Sized_relobj_file::Local_got_offsets): Likewise.
1792 (Sized_relobj_file::local_got_offsets_): Likewise.
1793 (Sized_relobj_file::section_offsets_): Likewise.
1794 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
1795 (all constructors).
1796 (set_needs_dynsym_index): Convert relobj to derived class pointer.
1797 (Output_reloc::get_symbol_index): Likewise.
1798 (Output_reloc::local_section_offset): Likewise.
1799 (Output_reloc::get_address): Likewise.
1800 (Output_reloc::symbol_value): Likewise.
1801 (Output_data_got::reserve_slot): Move to class definition.
1802 (Output_data_got::reserve_local): New function.
1803 (Output_data_got::reserve_slot_for_global): Remove.
1804 (Output_data_got::reserve_global): New function.
1805 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
1806 (all constructors, two instantiations).
1807 (Output_reloc::get_relobj): New function (two instantiations).
1808 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
1809 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
1810 (Output_data_reloc::add_global): Adjust type of relobj.
1811 (Output_data_reloc::add_global_relative): Likewise.
1812 (Output_data_reloc::add_symbolless_global_addend): Likewise.
1813 (Output_data_reloc::add_local): Likewise.
1814 (Output_data_reloc::add_local_relative): Likewise.
1815 (Output_data_reloc::add_symbolless_local_addend): Likewise.
1816 (Output_data_reloc::add_local_section): Likewise.
1817 (Output_data_reloc::add_output_section): Likewise.
1818 (Output_data_reloc::add_absolute): Likewise.
1819 (Output_data_reloc::add_target_specific): Likewise.
1820 (Output_data_got::reserve_slot): Move definition here.
1821 (Output_data_got::reserve_local): New function.
1822 (Output_data_got::reserve_global): New function.
1823 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
1824 section_offsets_ with accessor function.
1825 (Sized_relobj_file::write_sections): Likewise.
1826 (Sized_relobj_file::do_relocate_sections): Likewise.
1827 * target.h (Sized_target::reserve_local_got_entry): New function.
1828 (Sized_target::reserve_global_got_entry): New function.
1829 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
1830 (Target_x86_64::reserve_global_got_entry): New function.
1831 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
1832
4829d394
CC
18332011-05-23 Cary Coutant <ccoutant@google.com>
1834
1835 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
1836 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
1837 bit when checking got_type.
1838 * incremental.cc (Sized_incremental_binary::setup_readers):
1839 Store symbol table and string table locations; initialize bit vector
1840 of file status flags.
1841 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
1842 unchanged files.
1843 (Sized_incremental_binary::do_process_got_plt): New function.
1844 (Sized_incremental_binary::get_symtab_view): Use stored locations.
1845 (Output_section_incremental_inputs::set_final_data_size): Record
1846 file index for each input file.
1847 (Output_section_incremental_inputs::write_got_plt): Store file index
1848 instead of input entry offset for each GOT entry.
1849 * incremental.h
1850 (Incremental_input_entry::Incremental_input_entry): Initialize new
1851 data member.
1852 (Incremental_input_entry::set_offset): Store file index.
1853 (Incremental_input_entry::get_file_index): New function.
1854 (Incremental_input_entry::file_index_): New data member.
1855 (Incremental_binary::process_got_plt): New function.
1856 (Incremental_binary::do_process_got_plt): New function.
1857 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
1858 data members.
1859 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
1860 (Sized_incremental_binary::set_file_is_unchanged): New function.
1861 (Sized_incremental_binary::file_is_unchanged): New function.
1862 (Sized_incremental_binary::do_process_got_plt): New function.
1863 (Sized_incremental_binary::file_status_): New data member.
1864 (Sized_incremental_binary::main_symtab_loc_): New data member.
1865 (Sized_incremental_binary::main_strtab_loc_): New data member.
1866 * output.cc (Output_data_got::Got_entry::write): Add case
1867 RESERVED_CODE.
1868 (Output_data_got::add_global): Call add_got_entry.
1869 (Output_data_got::add_global_plt): Likewise.
1870 (Output_data_got::add_global_with_rel): Likewise.
1871 (Output_data_got::add_global_with_rela): Likewise.
1872 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
1873 (Output_data_got::add_global_pair_with_rela): Likewise.
1874 (Output_data_got::add_local): Call add_got_entry.
1875 (Output_data_got::add_local_plt): Likewise.
1876 (Output_data_got::add_local_with_rel): Likewise.
1877 (Output_data_got::add_local_with_rela): Likewise.
1878 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
1879 (Output_data_got::add_local_pair_with_rela): Likewise.
1880 (Output_data_got::reserve_slot): New function.
1881 (Output_data_got::reserve_slot_for_global): New function.
1882 (Output_data_got::add_got_entry): New function.
1883 (Output_data_got::add_got_entry_pair): New function.
1884 (Output_section::add_output_section_data): Edit FIXME.
1885 * output.h
1886 (Output_section_data_build::Output_section_data_build): New
1887 constructor with size parameter.
1888 (Output_data_space::Output_data_space): Likewise.
1889 (Output_data_got::Output_data_got): Initialize new data member; new
1890 constructor with size parameter.
1891 (Output_data_got::add_constant): Call add_got_entry.
1892 (Output_data_got::reserve_slot): New function.
1893 (Output_data_got::reserve_slot_for_global): New function.
1894 (class Output_data_got::Got_entry): Add RESERVED_CODE.
1895 (Output_data_got::add_got_entry): New function.
1896 (Output_data_got::add_got_entry_pair): New function.
1897 (Output_data_got::free_list_): New data member.
1898 * target.h (Sized_target::init_got_plt_for_update): New function.
1899 (Sized_target::register_global_plt_entry): New function.
1900 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
1901 Initialize new data member; call init; add constructor with PLT count.
1902 (Output_data_plt_x86_64::init): New function.
1903 (Output_data_plt_x86_64::add_relocation): New function.
1904 (Output_data_plt_x86_64::reserve_slot): New function.
1905 (Output_data_plt_x86_64::free_list_): New data member.
1906 (Target_x86_64::init_got_plt_for_update): New function.
1907 (Target_x86_64::register_global_plt_entry): New function.
1908 (Output_data_plt_x86_64::add_entry): Allocate from free list for
1909 incremental updates.
1910 (Output_data_plt_x86_64::add_relocation): New function.
1911 * testsuite/object_unittest.cc (Object_test): Set default options.
1912
ec69d6da
ILT
19132011-05-16 Ian Lance Taylor <iant@google.com>
1914
1915 * options.h (class General_options): Make -i a synonym for -r.
1916
732e31de
ILT
19172011-05-16 Ian Lance Taylor <iant@google.com>
1918
1919 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
1920
403676b5
CC
19212011-05-10 Cary Coutant <ccoutant@google.com>
1922
1923 * object.cc (Sized_relobj::do_count_local_symbols): Check for
1924 strip_all (-s).
1925
5b7b7d6e
ILT
19262011-05-06 Ian Lance Taylor <iant@google.com>
1927
1928 * layout.cc (Layout::layout): If the output section flags change,
1929 update the ordering.
1930
f0f9babf
CC
19312011-04-25 Cary Coutant <ccoutant@google.com>
1932
1933 * incremental-dump.cc (dump_incremental_inputs): Print local
1934 symbol info for each input file.
1935 * incremental.cc
1936 (Output_section_incremental_inputs::set_final_data_size): Add local
1937 symbol info to input file entries in incremental info.
1938 (Output_section_incremental_inputs::write_info_blocks): Likewise.
1939 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
1940 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
1941 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
1942 implementation.
1943 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
1944 (Sized_incr_relobj::do_relocate): Write the local symbols.
1945 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
1946 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
1947 Adjust size of input file header.
1948 (Incremental_inputs_reader::get_local_symbol_offset): New function.
1949 (Incremental_inputs_reader::get_local_symbol_count): New function.
1950 (Incremental_inputs_reader::get_input_section): Adjust size of input
1951 file header.
1952 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
1953 (Sized_incr_relobj::This): New typedef.
1954 (Sized_incr_relobj::sym_size): New const data member.
1955 (Sized_incr_relobj::Local_symbol): New struct.
1956 (Sized_incr_relobj::do_output_local_symbol_count): New function.
1957 (Sized_incr_relobj::do_local_symbol_offset): New function.
1958 (Sized_incr_relobj::local_symbol_count_): New data member.
1959 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
1960 (Sized_incr_relobj::local_symbol_index_): New data member.
1961 (Sized_incr_relobj::local_symbol_offset_): New data member.
1962 (Sized_incr_relobj::local_dynsym_offset_): New data member.
1963 (Sized_incr_relobj::local_symbols_): New data member.
1964 * object.h (Relobj::output_local_symbol_count): New function.
1965 (Relobj::local_symbol_offset): New function.
1966 (Relobj::do_output_local_symbol_count): New function.
1967 (Relobj::do_local_symbol_offset): New function.
1968 (Sized_relobj::do_output_local_symbol_count): New function.
1969 (Sized_relobj::do_local_symbol_offset): New function.
1970
d0a9ace3
ILT
19712011-04-22 Vladimir Simonov <sv@sw.ru>
1972
1973 * descriptors.cc (set_close_on_exec): New function.
1974 (Descriptors::open): Use set_close_on_exec.
1975 * output.cc (S_ISLNK): Define if not defined.
1976
94a3fc8b
CC
19772011-04-22 Cary Coutant <ccoutant@google.com>
1978
1979 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
1980 global symbol map.
1981 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
1982 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
1983 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
1984 relocations.
1985 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
1986 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
1987 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
1988 * incremental.h
1989 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
1990 function.
1991 (Incremental_binary::apply_incremental_relocs): New function.
1992 (Incremental_binary::do_apply_incremental_relocs): New function.
1993 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
1994 data member.
1995 (Sized_incremental_binary::add_global_symbol): New function.
1996 (Sized_incremental_binary::global_symbol): New function.
1997 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
1998 (Sized_incremental_binary::symbol_map_): New data member.
1999 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
2000 * target.h (Sized_target::apply_relocation): New function.
2001 * target-reloc.h (apply_relocation): New function.
2002 * x86_64.cc (Target_x86_64::apply_relocation): New function.
2003
c87e4302
DK
20042011-04-22 Doug Kwan <dougkwan@google.com>
2005
2006 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
2007 flag of a SHT_ARM_EXIDX section.
2008 * testsuite/Makefile.am (arm_exidx_test): New test rules.
2009 * testsuite/Makefile.in: Regenerate.
2010 * testsuite/arm_exidx_test.s: New file.
2011 * testsuite/arm_exidx_test.sh: Same.
2012
e7782cf6
CC
20132011-04-20 Cary Coutant <ccoutant@google.com>
2014
2015 PR gold/12689
2016 * archive.h (Incremental_archive_entry::Archive_member):
2017 Initialize arg_serial_ (second constructor).
2018
308ecdc7
ILT
20192011-04-17 Ian Lance Taylor <iant@google.com>
2020
2021 * object.cc (Relocate_info::location): Simplify location string.
2022 * errors.cc (Errors::error_at_location): Don't print program
2023 name.
2024 (Errors::warning_at_location): Likewise.
2025 (Errors::undefined_symbol): Likewise.
2026 * testsuite/debug_msg.sh: Update accordingly.
2027
bec5b579
CC
20282011-04-14 Cary Coutant <ccoutant@google.com>
2029
2030 * gold/layout.cc (Layout::symtab_section_offset): New function.
2031 * gold/layout.h (Layout::symtab_section_offset): New function.
2032 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
2033
88597d34
ILT
20342011-04-12 Ian Lance Taylor <iant@google.com>
2035
2036 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
2037 with MREMAP_MAYMOVE.
2038 * output.h (class Output_file): Add map_is_allocated_ field.
2039 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
2040 not available, provide stubs. If mremap is not available, #define
2041 it to gold_mremap.
2042 (MREMAP_MAYMOVE): Define if not defined.
2043 (Output_file::Output_file): Initialize map_is_allocated_.
2044 (Output_file::resize): Check map_is_allocated_.
2045 (Output_file::map_anonymous): If mmap fails, use malloc.
2046 (Output_file::unmap): Don't do anything for an anonymous map.
2047 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
2048 is not available, provide stubs.
2049 (File_read::View::~View): Use free rather than delete[].
2050 (File_read::make_view): Use malloc rather than new[]. If mmap
2051 fails, use malloc.
2052 (File_read::find_or_make_view): Use malloc rather than new[].
2053 * gold.h: Remove HAVE_REMAP code.
2054 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
2055 exists. Rename mremap to gold_mremap. If mmap is not available
2056 don't do anything.
2057 * configure, config.in: Rebuild.
2058
11e361bc
ILT
20592011-04-11 Ian Lance Taylor <iant@google.com>
2060
2061 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
2062 initialize local variable v.
2063
cdc29364
CC
20642011-04-11 Cary Coutant <ccoutant@google.com>
2065
2066 * archive.cc (Archive::include_member): Adjust call to
2067 report_object.
2068 (Add_archive_symbols::run): Track argument serial numbers.
2069 (Lib_group::include_member): Likewise.
2070 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
2071 * archive.h (Incremental_archive_entry::Archive_member):
2072 Initialize arg_serial_.
2073 (Archive_member::arg_serial_): New data member.
2074 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
2075 (Sized_dynobj::do_add_symbols): Track symbols when doing an
2076 incremental link.
2077 (Sized_dynobj::do_for_all_local_got_entries): New function.
2078 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
2079 function.
2080 * fileread.cc (get_mtime): New function.
2081 * fileread.h (get_mtime): New function.
2082 * gold.cc (queue_initial_tasks): Check for incremental update.
2083 (process_incremental_input): New function.
2084 (queue_middle_tasks): Don't force valid target for incremental
2085 update.
2086 * incremental-dump.cc (find_input_containing_global): Adjust
2087 size of symbol info entry.
2088 (dump_incremental_inputs): Dump argument serial number and
2089 in_system_directory flag; bias shndx by 1; print symbol names
2090 when dumping per-file symbol lists; use new symbol info readers.
2091 * incremental.cc
2092 (Output_section_incremental_inputs:update_data_size): New function.
2093 (Sized_incremental_binary::setup_readers): Setup input readers
2094 for each input file; build maps for files added from libraries
2095 and scripts.
2096 (Sized_incremental_binary::check_input_args): New function.
2097 (Sized_incremental_binary::do_check_inputs): Build map of argument
2098 serial numbers to input arguments.
2099 (Sized_incremental_binary::do_file_has_changed): Rename
2100 do_file_is_unchanged to this; compare file modification times.
2101 (Sized_incremental_binary::do_init_layout): New function.
2102 (Sized_incremental_binary::do_reserve_layout): New function.
2103 (Sized_incremental_binary::do_get_input_reader): Remove.
2104 (Sized_incremental_binary::get_symtab_view): New function.
2105 (Incremental_checker::can_incrementally_link_output_file): Remove.
2106 (Incremental_inputs::report_command_line): Exclude --debug options.
2107 (Incremental_inputs::report_archive_begin): Add parameter; track
2108 argument serial numbers; don't put input file entry for archive
2109 before archive members.
2110 (Incremental_inputs::report_archive_end): Put input file entry
2111 for archive after archive members.
2112 (Incremental_inputs::report_object): Add parameter; track argument
2113 serial numbers and in_system_directory flag.
2114 (Incremental_inputs::report_script): Add parameter; track argument
2115 serial numbers.
2116 (Output_section_incremental_inputs::set_final_data_size): Adjust
2117 size of symbol info entry; check for forwarding symbols.
2118 (Output_section_incremental_inputs::write_input_files): Write
2119 in_system_directory flag and argument serial number.
2120 (Output_section_incremental_inputs::write_info_blocks): Map section
2121 indices between incremental info and original input file; store
2122 input section index for each symbol.
2123 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
2124 change operator() to visit().
2125 (class Global_got_offset_visitor): Likewise.
2126 (class Global_symbol_visitor_got_plt):
2127 (Output_section_incremental_inputs::write_got_plt): Use new visitor
2128 classes.
2129 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
2130 (Sized_incr_relobj::do_read_symbols): New function.
2131 (Sized_incr_relobj::do_layout): New function.
2132 (Sized_incr_relobj::do_layout_deferred_sections): New function.
2133 (Sized_incr_relobj::do_add_symbols): New function.
2134 (Sized_incr_relobj::do_should_include_member): New function.
2135 (Sized_incr_relobj::do_for_all_global_symbols): New function.
2136 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
2137 (Sized_incr_relobj::do_section_size): New function.
2138 (Sized_incr_relobj::do_section_name): New function.
2139 (Sized_incr_relobj::do_section_contents): New function.
2140 (Sized_incr_relobj::do_section_flags): New function.
2141 (Sized_incr_relobj::do_section_entsize): New function.
2142 (Sized_incr_relobj::do_section_address): New function.
2143 (Sized_incr_relobj::do_section_type): New function.
2144 (Sized_incr_relobj::do_section_link): New function.
2145 (Sized_incr_relobj::do_section_info): New function.
2146 (Sized_incr_relobj::do_section_addralign): New function.
2147 (Sized_incr_relobj::do_initialize_xindex): New function.
2148 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
2149 (Sized_incr_relobj::do_read_relocs): New function.
2150 (Sized_incr_relobj::do_gc_process_relocs): New function.
2151 (Sized_incr_relobj::do_scan_relocs): New function.
2152 (Sized_incr_relobj::do_count_local_symbols): New function.
2153 (Sized_incr_relobj::do_finalize_local_symbols): New function.
2154 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
2155 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
2156 (Sized_incr_relobj::do_relocate): New function.
2157 (Sized_incr_relobj::do_set_section_offset): New function.
2158 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
2159 (Sized_incr_dynobj::do_read_symbols): New function.
2160 (Sized_incr_dynobj::do_layout): New function.
2161 (Sized_incr_dynobj::do_add_symbols): New function.
2162 (Sized_incr_dynobj::do_should_include_member): New function.
2163 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
2164 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
2165 (Sized_incr_dynobj::do_section_size): New function.
2166 (Sized_incr_dynobj::do_section_name): New function.
2167 (Sized_incr_dynobj::do_section_contents): New function.
2168 (Sized_incr_dynobj::do_section_flags): New function.
2169 (Sized_incr_dynobj::do_section_entsize): New function.
2170 (Sized_incr_dynobj::do_section_address): New function.
2171 (Sized_incr_dynobj::do_section_type): New function.
2172 (Sized_incr_dynobj::do_section_link): New function.
2173 (Sized_incr_dynobj::do_section_info): New function.
2174 (Sized_incr_dynobj::do_section_addralign): New function.
2175 (Sized_incr_dynobj::do_initialize_xindex): New function.
2176 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
2177 (make_sized_incremental_object): New function.
2178 (Incremental_library::copy_unused_symbols): New function.
2179 (Incremental_library::do_for_all_unused_symbols): New function.
2180 * incremental.h (enum Incremental_input_flags): New type.
2181 (class Incremental_checker): Remove.
2182 (Incremental_input_entry::Incremental_input_entry): Add argument
2183 serial number.
2184 (Incremental_input_entry::arg_serial): New function.
2185 (Incremental_input_entry::set_is_in_system_directory): New function.
2186 (Incremental_input_entry::is_in_system_directory): New function.
2187 (Incremental_input_entry::arg_serial_): New data member.
2188 (Incremental_input_entry::is_in_system_directory_): New data member.
2189 (class Script_info): Move here from script.h.
2190 (Script_info::Script_info): Add filename parameter.
2191 (Script_info::filename): New function.
2192 (Script_info::filename_): New data member.
2193 (Incremental_script_entry::Incremental_script_entry): Add argument
2194 serial number.
2195 (Incremental_object_entry::Incremental_object_entry): Likewise.
2196 (Incremental_object_entry::add_input_section): Build list of input
2197 sections with map to original shndx.
2198 (Incremental_object_entry::get_input_section_index): New function.
2199 (Incremental_object_entry::shndx_): New data member.
2200 (Incremental_object_entry::name_key_): Rename; adjust all refs.
2201 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
2202 (Incremental_archive_entry::Incremental_archive_entry): Add argument
2203 serial number.
2204 (Incremental_inputs::report_archive_begin): Likewise.
2205 (Incremental_inputs::report_object): Likewise.
2206 (Incremental_inputs::report_script): Likewise.
2207 (class Incremental_global_symbol_reader): New class.
2208 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
2209 and store flags and input file type.
2210 (Incremental_input_entry_reader::arg_serial): New function.
2211 (Incremental_input_entry_reader::type): Extract type from flags.
2212 (Incremental_input_entry_reader::is_in_system_directory): New function.
2213 (Incremental_input_entry_reader::get_input_section_count): Call
2214 accessor function for type.
2215 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
2216 function for type; adjust size of global symbol entry.
2217 (Incremental_input_entry_reader::get_global_symbol_count): Call
2218 accessor function for type.
2219 (Incremental_input_entry_reader::get_object_count): Likewise.
2220 (Incremental_input_entry_reader::get_object_offset): Likewise.
2221 (Incremental_input_entry_reader::get_member_count): Likewise.
2222 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
2223 (Incremental_input_entry_reader::get_member_offset): Likewise.
2224 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
2225 (Incremental_input_entry_reader::Global_symbol_info): Remove.
2226 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
2227 (Incremental_input_entry_reader::get_global_symbol_reader): New
2228 function.
2229 (Incremental_input_entry_reader::get_output_symbol_index): New
2230 function.
2231 (Incremental_input_entry_reader::type_): Remove.
2232 (Incremental_input_entry_reader::flags_): New data member.
2233 (Incremental_inputs_reader::input_file_offset): New function.
2234 (Incremental_inputs_reader::input_file_index): New function.
2235 (Incremental_inputs_reader::input_file): Call input_file_offset.
2236 (Incremental_inputs_reader::input_file_at_offset): New function.
2237 (Incremental_relocs_reader::get_r_type): Reformat.
2238 (Incremental_relocs_reader::get_r_shndx): Reformat.
2239 (Incremental_relocs_reader::get_r_offset): Reformat.
2240 (Incremental_relocs_reader::data): New function.
2241 (Incremental_binary::Incremental_binary): Initialize new data members.
2242 (Incremental_binary::check_inputs): Add cmdline parameter.
2243 (Incremental_binary::file_is_unchanged): Remove.
2244 (Input_reader::arg_serial): New function.
2245 (Input_reader::get_unused_symbol_count): New function.
2246 (Input_reader::get_unused_symbol): New function.
2247 (Input_reader::do_arg_serial): New function.
2248 (Input_reader::do_get_unused_symbol_count): New function.
2249 (Input_reader::do_get_unused_symbol): New function.
2250 (Incremental_binary::input_file_count): New function.
2251 (Incremental_binary::get_input_reader): Change signature to use
2252 index instead of filename.
2253 (Incremental_binary::file_has_changed): New function.
2254 (Incremental_binary::get_input_argument): New function.
2255 (Incremental_binary::get_library): New function.
2256 (Incremental_binary::get_script_info): New function.
2257 (Incremental_binary::init_layout): New function.
2258 (Incremental_binary::reserve_layout): New function.
2259 (Incremental_binary::output_file): New function.
2260 (Incremental_binary::do_check_inputs): New function.
2261 (Incremental_binary::do_file_is_unchanged): Remove.
2262 (Incremental_binary::do_file_has_changed): New function.
2263 (Incremental_binary::do_init_layout): New function.
2264 (Incremental_binary::do_reserve_layout): New function.
2265 (Incremental_binary::do_input_file_count): New function.
2266 (Incremental_binary::do_get_input_reader): Change signature.
2267 (Incremental_binary::input_args_map_): New data member.
2268 (Incremental_binary::library_map_): New data member.
2269 (Incremental_binary::script_map_): New data member.
2270 (Sized_incremental_binary::Sized_incremental_binary): Initialize
2271 new data members.
2272 (Sized_incremental_binary::output_section): New function.
2273 (Sized_incremental_binary::inputs_reader): Add const.
2274 (Sized_incremental_binary::symtab_reader): Add const.
2275 (Sized_incremental_binary::relocs_reader): Add const.
2276 (Sized_incremental_binary::got_plt_reader): Add const.
2277 (Sized_incremental_binary::get_symtab_view): New function.
2278 (Sized_incremental_binary::Inputs_reader): New typedef.
2279 (Sized_incremental_binary::Input_entry_reader): New typedef.
2280 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
2281 (Sized_incremental_binary::do_file_is_unchanged): Remove.
2282 (Sized_incremental_binary::do_file_has_changed): New function.
2283 (Sized_incremental_binary::do_init_layout): New function.
2284 (Sized_incremental_binary::do_reserve_layout): New function.
2285 (Sized_input_reader::Inputs_reader): Remove.
2286 (Sized_input_reader::Input_entry_reader): Remove.
2287 (Sized_input_reader::do_arg_serial): New function.
2288 (Sized_input_reader::do_get_unused_symbol_count): New function.
2289 (Sized_input_reader::do_get_unused_symbol): New function.
2290 (Sized_incremental_binary::do_input_file_count): New function.
2291 (Sized_incremental_binary::do_get_input_reader): Change signature;
2292 use index instead of filename.
2293 (Sized_incremental_binary::section_map_): New data member.
2294 (Sized_incremental_binary::input_entry_readers_): New data member.
2295 (class Sized_incr_relobj): New class.
2296 (class Sized_incr_dynobj): New class.
2297 (make_sized_incremental_object): New function.
2298 (class Incremental_library): New class.
2299 * layout.cc (Free_list::num_lists): New static data member.
2300 (Free_list::num_nodes): New static data member.
2301 (Free_list::num_removes): New static data member.
2302 (Free_list::num_remove_visits): New static data member.
2303 (Free_list::num_allocates): New static data member.
2304 (Free_list::num_allocate_visits): New static data member.
2305 (Free_list::init): New function.
2306 (Free_list::remove): New function.
2307 (Free_list::allocate): New function.
2308 (Free_list::dump): New function.
2309 (Free_list::print_stats): New function.
2310 (Layout_task_runner::run): Resize output file for incremental updates.
2311 (Layout::Layout): Initialize new data members.
2312 (Layout::set_incremental_base): New function.
2313 (Layout::init_fixed_output_section): New function.
2314 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
2315 incremental updates.
2316 (Layout::create_gold_note): Do not create gold note section for
2317 incremental updates.
2318 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
2319 for incremental updates.
2320 (Layout::set_section_offsets): For incremental updates, allocate space
2321 from free list.
2322 (Layout::create_symtab_sections): Layout with offsets relative to
2323 start of section; for incremental updates, allocate space from free
2324 list.
2325 (Layout::create_shdrs): For incremental updates, allocate space from
2326 free list.
2327 (Layout::finish_dynamic_section): For incremental updates, do not
2328 check --as-needed (fixed in subsequent patch).
2329 * layout.h (class Free_list): New class.
2330 (Layout::set_incremental_base): New function.
2331 (Layout::incremental_base): New function.
2332 (Layout::init_fixed_output_section): New function.
2333 (Layout::allocate): New function.
2334 (Layout::incremental_base_): New data member.
2335 (Layout::free_list_): New data member.
2336 * main.cc (main): Print Free_list statistics.
2337 * object.cc (Relobj::finalize_incremental_relocs): Add
2338 clear_counts parameter; clear counts only when clear_counts is set.
2339 (Sized_relobj::Sized_relobj): Initialize new base class.
2340 (Sized_relobj::do_layout): Don't report special sections.
2341 (Sized_relobj::do_for_all_local_got_entries): New function.
2342 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
2343 symtab_off to all symbol table offsets.
2344 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
2345 * object.h (class Got_offset_list): Move to top of file.
2346 (Object::Object): Allow case where input_file == NULL.
2347 (Object::~Object): Likewise.
2348 (Object::input_file): Assert that input_file != NULL.
2349 (Object::lock): Allow case where input_file == NULL.
2350 (Object::unlock): Likewise.
2351 (Object::is_locked): Likewise.
2352 (Object::token): Likewise.
2353 (Object::release): Likewise.
2354 (Object::is_incremental): New function.
2355 (Object::get_mtime): New function.
2356 (Object::for_all_local_got_entries): New function.
2357 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
2358 (Object::set_is_in_system_directory): New function.
2359 (Object::is_in_system_directory): New function.
2360 (Object::do_is_incremental): New function.
2361 (Object::do_get_mtime): New function.
2362 (Object::do_for_all_local_got_entries): New function.
2363 (Object::is_in_system_directory_): New data member.
2364 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
2365 (class Sized_relobj_base): New class.
2366 (class Sized_relobj): Derive from Sized_relobj_base.
2367 (class Sized_relobj::Symbols): Redeclare from base class.
2368 (class Sized_relobj::local_got_offset_list): Remove.
2369 (class Sized_relobj::Output_sections): Redeclare from base class.
2370 (class Sized_relobj::do_for_all_local_got_entries): New function.
2371 (class Sized_relobj::write_local_symbols): Add offset parameter.
2372 (class Sized_relobj::local_symbol_offset_): Update comment.
2373 (class Sized_relobj::local_dynsym_offset_): Update comment.
2374 * options.cc (Input_arguments::add_file): Remove const.
2375 * options.h (Input_file_argument::Input_file_argument):
2376 Initialize arg_serial_ (all constructors).
2377 (Input_file_argument::set_arg_serial): New function.
2378 (Input_file_argument::arg_serial): New function.
2379 (Input_file_argument::arg_serial_): New data member.
2380 (Input_arguments::Input_arguments): Initialize file_count_.
2381 (Input_arguments::add_file): Remove const.
2382 (Input_arguments::number_of_input_files): New function.
2383 (Input_arguments::file_count_): New data member.
2384 (Command_line::number_of_input_files): Call
2385 Input_arguments::number_of_input_files.
2386 * output.cc (Output_segment_headers::Output_segment_headers):
2387 Set current size.
2388 (Output_section::Input_section::current_data_size): New function.
2389 (Output_section::Output_section): Initialize new data members.
2390 (Output_section::add_input_section): Don't do merge sections for
2391 an incremental link; allocate space from free list for an
2392 incremental update.
2393 (Output_section::add_output_section_data): Allocate space from
2394 free list for an incremental update.
2395 (Output_section::update_data_size): New function.
2396 (Output_section::set_fixed_layout): New function.
2397 (Output_section::reserve): New function.
2398 (Output_segment::set_section_addresses): Remove const.
2399 (Output_segment::set_section_list_addresses): Remove const; allocate
2400 space from free list for an incremental update.
2401 (Output_segment::set_offset): Adjust size of RELRO segment for an
2402 incremental update.
2403 * output.h (Output_data::current_data_size): Move here from
2404 child classes.
2405 (Output_data::pre_finalize_data_size): New function.
2406 (Output_data::update_data_size): New function.
2407 (Output_section_headers::update_data_size): new function.
2408 (Output_section_data_build::current_data_size): Move to Output_data.
2409 (Output_data_strtab::update_data_size): New function.
2410 (Output_section::current_data_size): Move to Output_data.
2411 (Output_section::set_fixed_layout): New function.
2412 (Output_section::has_fixed_layout): New function.
2413 (Output_section::reserve): New function.
2414 (Output_section::update_data_size): New function.
2415 (Output_section::has_fixed_layout_): New data member.
2416 (Output_section::free_list_): New data member.
2417 (Output_segment::set_section_addresses): Remove const.
2418 (Output_segment::set_section_list_addresses): Remove const.
2419 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
2420 New function.
2421 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
2422 New function.
2423 * readsyms.cc (Read_symbols::do_read_symbols): Add library
2424 parameter when calling Add_symbols constructor; store argument
2425 serial number for members of a lib group.
2426 (Add_symbols::locks): Allow case where token == NULL.
2427 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
2428 (Read_member::~Read_member): New function.
2429 (Read_member::is_runnable): New function.
2430 (Read_member::locks): New function.
2431 (Read_member::run): New function.
2432 (Check_script::~Check_script): New function.
2433 (Check_script::is_runnable): New function.
2434 (Check_script::locks): New function.
2435 (Check_script::run): New function.
2436 (Check_library::~Check_library): New function.
2437 (Check_library::is_runnable): New function.
2438 (Check_library::locks): New function.
2439 (Check_library::run): New function.
2440 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
2441 (Add_symbols::library_): New data member.
2442 (class Read_member): New class.
2443 (class Check_script): New class.
2444 (class Check_library): New class.
2445 * reloc.cc (Read_relocs::is_runnable): Allow case where
2446 token == NULL.
2447 (Read_relocs::locks): Likewise.
2448 (Scan_relocs::locks): Likewise.
2449 (Relocate_task::locks): Likewise.
2450 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
2451 to clear counters.
2452 (Sized_relobj::incremental_relocs_scan): Fix comment.
2453 (Sized_relobj::do_relocate): Pass output file offset to
2454 write_local_symbols.
2455 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
2456 from class declaration.
2457 * script.cc (read_input_script): Allocate Script_info; pass
2458 argument serial number to report_script.
2459 * script.h (class Script_info): Move to incremental.h.
2460 * symtab.cc (Symbol_table::add_from_incrobj): New function.
2461 * symtab.h (Symbol_table::add_from_incrobj): New function.
2462 (Symbol_table::set_file_offset): New function.
2463
b961d0d7
CC
24642011-04-05 Cary Coutant <ccoutant@google.com>
2465
2466 * incremental-dump.cc (dump_incremental_inputs): Change signature
2467 to take a Sized_incremental_binary; change caller. Use readers
2468 in Sized_incremental_binary.
2469 * incremental.cc
2470 (Sized_incremental_binary::find_incremental_inputs_sections):
2471 Rename do_find_incremental_inputs_sections to this.
2472 (Sized_incremental_binary::setup_readers): New function.
2473 (Sized_incremental_binary::do_check_inputs): Check
2474 has_incremental_info_ flag; move setup code to setup_readers;
2475 use input readers.
2476 (Sized_incremental_binary::do_file_is_unchanged): New function.
2477 (Sized_incremental_binary::do_get_input_reader): New function.
2478 * incremental.h (class Incremental_binary): Move to end of file.
2479 (Incremental_binary::file_is_unchanged): New function.
2480 (Incremental_binary::do_file_is_unchanged): New function.
2481 (Incremental_binary::Input_reader): New class.
2482 (Incremental_binary::get_input_reader): New function.
2483 (class Sized_incremental_binary): Move to end of file.
2484 (Sized_incremental_binary::Sized_incremental_binary): Setup the
2485 input section reader classes.
2486 (Sized_incremental_binary::has_incremental_info): New function.
2487 (Sized_incremental_binary::inputs_reader): New function.
2488 (Sized_incremental_binary::symtab_reader): New function.
2489 (Sized_incremental_binary::relocs_reader): New function.
2490 (Sized_incremental_binary::got_plt_reader): New function.
2491 (Sized_incremental_binary::do_file_is_unchanged): New function.
2492 (Sized_incremental_binary::Sized_input_reader): New class.
2493 (Sized_incremental_binary::get_input_reader): New function.
2494 (Sized_incremental_binary::find_incremental_inputs_sections):
2495 Rename do_find_incremental_inputs_sections to this.
2496 (Sized_incremental_binary::setup_readers): New function.
2497 (Sized_incremental_binary::has_incremental_info_): New data member.
2498 (Sized_incremental_binary::inputs_reader_): New data member.
2499 (Sized_incremental_binary::symtab_reader_): New data member.
2500 (Sized_incremental_binary::relocs_reader_): New data member.
2501 (Sized_incremental_binary::got_plt_reader_): New data member.
2502 (Sized_incremental_binary::current_input_file_): New data member.
2503
a869183f
PP
25042011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
2505
2506 PR gold/12640
2507 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
2508 violation.
2509
25102011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
2511
2512 * archive.cc (Archive::include_member): Adjust call to report_object.
2513 (Add_archive_symbols::run): Add script_info to call to
2514 report_archive_begin.
2515 (Lib_group::include_member): Adjust call to report_object.
2516 (Add_lib_group_symbols::run): Adjust call to report_object.
2517 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
2518 blocks. Add object count for script input files.
2519 * incremental.cc (Incremental_inputs::report_archive_begin): Add
2520 script_info parameter; change all callers.
2521 (Incremental_inputs::report_object): Add script_info parameter;
2522 change all callers.
2523 (Incremental_inputs::report_script): Store backpointer to
2524 incremental info entry.
2525 (Output_section_incremental_inputs::set_final_data_size): Record
2526 additional information for scripts.
2527 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2528 * incremental.h (Incremental_script_entry::add_object): New function.
2529 (Incremental_script_entry::get_object_count): New function.
2530 (Incremental_script_entry::get_object): New function.
2531 (Incremental_script_entry::objects_): New data member; adjust
2532 constructor.
2533 (Incremental_inputs::report_archive_begin): Add script_info parameter.
2534 (Incremental_inputs::report_object): Add script_info parameter.
2535 (Incremental_inputs_reader::get_object_count): New function.
2536 (Incremental_inputs_reader::get_object_offset): New function.
2537 * options.cc (Input_arguments::add_file): Return reference to
2538 new input argument.
2539 * options.h (Input_argument::set_script_info): New function.
2540 (Input_argument::script_info): New function.
2541 (Input_argument::script_info_): New data member; adjust all
2542 constructors.
2543 (Input_file_group::add_file): Return reference to new input argument.
2544 (Input_file_lib::add_file): Likewise.
2545 (Input_arguments::add_file): Likewise.
2546 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
2547 * script.cc (Parser_closure::Parser_closure): Add script_info
2548 parameter; adjust all callers.
2549 (Parser_closure::script_info): New function.
2550 (Parser_closure::script_info_): New data member.
2551 (read_input_script): Report scripts earlier to incremental info.
2552 (script_add_file): Set script_info in Input_argument.
2553 (script_add_library): Likewise.
2554 * script.h (Script_options::Script_info): Rewrite class.
2555
a869183f 25562011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
2557
2558 * archive.cc (Library_base::should_include_member): Move
2559 method here from class Archive.
2560 (Archive::Archive): Initialize base class.
2561 (Archive::should_include_member): Move to base class.
2562 (Archive::do_for_all_unused_symbols): New function.
2563 (Add_archive_symbols::run): Remove redundant access to
2564 incremental_inputs.
2565 (Lib_group::Lib_group): Initialize base class.
2566 (Lib_group::do_filename): New function.
2567 (Lib_group::include_member): Pass pointer to Lib_group to
2568 report_object.
2569 (Lib_group::do_for_all_unused_symbols): New function.
2570 (Add_lib_group_symbols::run): Report archive information for
2571 incremental links.
2572 * archive.h (class Library_base): New base class.
2573 (class Archive): Derive from Library_base.
2574 (Archive::filename): Move to base class.
2575 (Archive::set_incremental_info): Likewise.
2576 (Archive::incremental_info): Likewise.
2577 (Archive::Should_include): Likewise.
2578 (Archive::should_include_member): Likewise.
2579 (Archive::Armap_entry): Remove.
2580 (Archive::Unused_symbol_iterator): Remove.
2581 (Archive::unused_symbols_begin): Remove.
2582 (Archive::unused_symbols_end): Remove.
2583 (Archive::do_filename): New function.
2584 (Archive::do_get_mtime): New function.
2585 (Archive::do_for_all_unused_symbols): New function.
2586 (Archive::task_): Move to base class.
2587 (Archive::incremental_info_): Likewise.
2588 (class Lib_group): Derive from Library_base.
2589 (Lib_group::do_filename): New function.
2590 (Lib_group::do_get_mtime): New function.
2591 (Lib_group::do_for_all_unused_symbols): New function.
2592 (Lib_group::task_): Move to base class.
2593 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
2594 function.
2595 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
2596 function.
2597 * incremental.cc (Incremental_inputs::report_archive_begin):
2598 Use Library_base; call library's get_mtime; add incremental inputs
2599 entry before members.
2600 (class Unused_symbol_visitor): New class.
2601 (Incremental_inputs::report_archive_end): Use Library_base; use
2602 visitor class to record unused symbols; don't add incremental inputs
2603 entry after members.
2604 (Incremental_inputs::report_object): Use Library_base.
2605 * incremental.h
2606 (Incremental_archive_entry::Incremental_archive_entry): Remove
2607 unused Archive parameter.
2608 (Incremental_inputs::report_archive_begin): Use Library_base.
2609 (Incremental_inputs::report_archive_end): Likewise.
2610 (Incremental_inputs::report_object): Likewise.
2611 * object.cc (Sized_relobj::do_for_all_global_symbols): New
2612 function.
2613 * object.h (Object::for_all_global_symbols): New function.
2614 (Object::do_for_all_global_symbols): New function.
2615 (Sized_relobj::do_for_all_global_symbols): New function.
2616 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
2617 function.
2618 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
2619 function.
2620
61ab3e40
ILT
26212011-03-27 Ian Lance Taylor <iant@google.com>
2622
2623 * archive.cc (Archive::interpret_header): Return -1 if something
2624 goes wrong. Change callers accordingly.
2625
30e1f9e6
CC
26262011-03-25 Cary Coutant <ccoutant@google.com>
2627
2628 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
2629 * testsuite/Makefile.in: Regenerate.
2630
9370ce59 26312011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
2632
2633 * plugin.cc (get_view): New.
2634 (Plugin::load): Pass get_view to the plugin.
2635 (Plugin_manager::get_view): New.
2636
9312bb0a
ILT
26372011-03-21 Ian Lance Taylor <iant@google.com>
2638
2639 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 2640 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 2641
7e12ba9e
ST
26422011-03-21 Sriraman Tallam <tmsriram@google.com>
2643
2644 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
2645 Change == to -eq.
2646 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
2647 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
2648 Change == to -eq.
2649 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
2650 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
2651
fd7a005d
ILT
26522011-03-14 Ian Lance Taylor <iant@google.com>
2653
2654 * script-sections.cc (Sort_output_sections::script_compare):
2655 Rename from is_before, change return type.
2656 (Sort_output_sections::operator()): Adjust accordingly.
2657
ed16fd1b
ILT
26582011-03-11 Jeffrey Yasskin <jyasskin@google.com>
2659
2660 PR gold/12572
2661 * testsuite/odr_violation2.cc: Add comment to make all error line
2662 numbers double digits.
2663 * testsuite/debug_msg.sh: Adjust expected errors.
2664
71ff8986
ILT
26652011-03-09 Jeffrey Yasskin <jyasskin@google.com>
2666
2667 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
2668 but mark earlier ones as non-canonical
2669 (offset_to_iterator): Update search target and example
2670 (do_addr2line): Return extra lines in a vector*
2671 (format_file_lineno): Extract from do_addr2line
2672 (one_addr2line): Add vector* out-param
2673 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
2674 when a lineno entry appeared last for its instruction
2675 (Dwarf_line_info): Add vector* out-param
2676 * object.cc (Relocate_info): Pass NULL for the vector* out-param
2677 * symtab.cc (Odr_violation_compare): Include the lineno in the
2678 comparison again.
2679 (linenos_from_loc): New. Combine the canonical line for an
2680 address with its other lines.
2681 (True_if_intersect): New. Helper functor to make
2682 std::set_intersection a query.
2683 (detect_odr_violations): Compare sets of lines instead of just
2684 one line for each function. This became less deterministic, but
2685 has fewer false positives.
2686 * symtab.h: Declarations.
2687 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
2688 mix an optimized and non-optimized object in the same binary
2689 (odr_violation2.so): Same.
2690 * testsuite/Makefile.in: Regenerate from Makefile.am.
2691 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
2692 * testsuite/debug_msg.sh: Update line numbers and add
2693 assertions.
2694 * testsuite/odr_violation1.cc: Use OdrDerived, in a
2695 non-optimized context.
2696 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
2697 isn't inlined, and use OdrDerived in an optimized context.
2698 * testsuite/odr_header1.h: Defines OdrDerived, where
2699 optimization will change the
2700 first-instruction-in-the-destructor's file and line number.
2701 * testsuite/odr_header2.h: Defines OdrBase.
2702
a19fefdc
ILT
27032011-03-09 Ian Lance Taylor <iant@google.com>
2704
2705 * fileread.cc (File_read::clear_views): Don't delete the whole
2706 file view.
2707
ecb351e9
ILT
27082011-03-08 Ian Lance Taylor <iant@google.com>
2709
2710 PR gold/12525
2711 * fileread.cc: #include <climits>.
2712 (GOLD_IOV_MAX): Define.
2713 (File_read::read_multiple): Limit number of entries by iov_max.
2714 * fileread.h (class File_read): Always set max_readv_entries to
2715 128.
2716
b821d13c
ILT
27172011-03-07 Ian Lance Taylor <iant@google.com>
2718
2719 PR gold/12525
2720 * options.h (class General_options): Add -dy and -dn.
2721
89243142
CC
27222011-03-02 Cary Coutant <ccoutant@google.com>
2723
2724 * testsuite/script_test_9.t: Add TLS segment.
2725
d0773f31
ILT
27262011-03-02 Simon Baldwin <simonb@google.com>
2727
2728 * configure.ac: Add check for gnu_indirect_function support in
2729 the toolchain building binutils.
2730 * configure: Rebuild.
2731
9370ce59 27322011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
2733
2734 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
2735 plugin only symbols.
2736 (Symbol_table::sized_finalize_symbol) Mark symbol only present
2737 in plugin files as not needed in the symbol table.
2738
4cf7a849
ST
27392011-02-11 Sriraman Tallam <tmsriram@google.com>
2740
2741 * output.cc (Output_section::add_input_section): Delay fill
2742 generation for section ordering.
2743
b578bd7d
ILT
27442011-02-09 Ian Lance Taylor <iant@google.com>
2745
2746 PR gold/12316
2747 * object.h (class Sized_relobj): Remove clear_local_symbols.
2748 * reloc.cc (Sized_relobj::do_relocate): Don't call
2749 clear_local_symbols.
2750
9370ce59 27512011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
2752
2753 * plugin.cc (is_visible_from_outside): Return true for symbols
2754 in the -u option.
2755
55382fb7
ILT
27562011-02-04 Jeffrey Yasskin <jyasskin@google.com>
2757
2758 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
2759 filename.
2760
4e271fff
ST
27612011-02-02 Sriraman Tallam <tmsriram@google.com>
2762
2763 * icf.h (is_section_foldable_candidate): Change type of parameter
2764 to std::string.
2765 * icf.cc (Icf::find_identical_sections): Change type of local variable
2766 section_name to be std::string.
2767 (is_function_ctor_or_dtor): Change type of parameter to std::string.
2768
d433c3ac
ILT
27692011-01-25 Ian Lance Taylor <iant@google.com>
2770
2771 * script.cc (script_add_extern): Rewrite to use
2772 add_symbol_reference.
2773
880473a6
DK
27742011-01-25 Doug Kwan <dougkwan@google.com>
2775
d433c3ac 2776 * icf.cc (get_section_contents): Always lock section's object.
880473a6 2777
f30f86fa
ILT
27782011-01-24 Ian Lance Taylor <iant@google.com>
2779
2780 * options.h (class General_options): Accept
2781 --no-detect-odr-violations.
2782
8e51a0b9
ILT
27832011-01-24 Ian Lance Taylor <iant@google.com>
2784
2785 * version.cc (version_string): Bump to 1.11.
2786
0f3b89d8
ILT
27872011-01-24 Ian Lance Taylor <iant@google.com>
2788
2789 * plugin.cc (class Plugin_rescan): Define new class.
2790 (Plugin_manager::claim_file): Set any_claimed_.
2791 (Plugin_manager::save_archive): New function.
2792 (Plugin_manager::save_input_group): New function.
2793 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
2794 necessary.
2795 (Plugin_manager::new_undefined_symbol): New function.
2796 (Plugin_manager::rescan): New function.
2797 (Plugin_manager::rescannable_defines): New function.
2798 (Plugin_manager::add_input_file): Set any_added_.
2799 * plugin.h (class Plugin_manager): define new fields rescannable_,
2800 undefined_symbols_, any_claimed_, and any_added_. Declare
2801 Plugin_rescan as friend. Declare new functions.
2802 (Plugin_manager::Rescannable): Define type.
2803 (Plugin_manager::Rescannable_list): Define type.
2804 (Plugin_manager::Undefined_symbol_list): Define type.
2805 (Plugin_manager::Plugin_manager): Initialize new fields.
2806 * archive.cc (Archive::defines_symbol): New function.
2807 (Add_archive_symbols::run): Pass archive to plugins if any.
2808 * archive.h (class Archive): Declare defines_symbol.
2809 * readsyms.cc (Input_group::~Input_group): New function.
2810 (Finish_group::run): Pass input_group to plugins if any.
2811 * readsyms.h (class Input_group): Declare destructor.
2812 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
2813 any.
2814
3bb951e5
ILT
28152011-01-10 Ian Lance Taylor <iant@google.com>
2816
2817 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
2818 section as relro.
2819 (Layout::set_segment_offsets): Reset increase_relro before calling
2820 set_section_addresses a second time.
2821
0aa45fac
CC
28222011-01-04 Cary Coutant <ccoutant@google.com>
2823
2824 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
2825 sections before NOBITS sections.
2826
0db46eb4
L
28272011-01-01 H.J. Lu <hongjiu.lu@intel.com>
2828
2829 * version.cc (print_version): Update copyright to 2011.
2830
829c9745
CC
28312010-12-23 Cary Coutant <ccoutant@google.com>
2832
2833 * output.h (Output_data_reloc::add_output_section): Pass OD instead
2834 of OS to this->add. Add OD parameter to second form of the function.
2835
7500420b
ILT
28362010-12-20 Ian Lance Taylor <iant@google.com>
2837
2838 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
2839 second of two consecutive entries with same offset.
2840
f8e9a930
RW
28412010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2842
2843 * testsuite/Makefile.am (ifuncmain2static_LDADD)
2844 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
2845 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
2846 to avoid unneeded links against $(LDADD).
2847 * testsuite/Makefile.in: Regenerate.
2848
2fbb4320
ILT
28492010-12-15 Ian Lance Taylor <iant@google.com>
2850
2851 PR gold/12324
2852 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
2853 for R_X86_64_32 and R_X86_64_PC32.
2854 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
2855 ver_matching_def_pic.o.
2856 (ver_matching_def_pic.o): New target.
2857
fedb228d
RW
28582010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2859
2860 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
2861 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
2862 Move definition before File_read::View member definitions.
2863 (File_read::View::~View): Initialize and hold lock before
2864 updating current_mapped_bytes.
2865
9b547ce6
RW
28662010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2867
2868 * dwarf_reader.cc: Remove outdated comment.
2869 * gold-threads.cc: Fix typo in error message.
2870 * archive.cc: Fix typos in comments.
2871 * archive.h: Likewise.
2872 * arm-reloc-property.cc: Likewise.
2873 * arm-reloc-property.h: Likewise.
2874 * arm-reloc.def: Likewise.
2875 * arm.cc: Likewise.
2876 * attributes.h: Likewise.
2877 * cref.cc: Likewise.
2878 * ehframe.cc: Likewise.
2879 * fileread.h: Likewise.
2880 * gold.h: Likewise.
2881 * i386.cc: Likewise.
2882 * icf.cc: Likewise.
2883 * incremental.h: Likewise.
2884 * int_encoding.cc: Likewise.
2885 * layout.h: Likewise.
2886 * main.cc: Likewise.
2887 * merge.h: Likewise.
2888 * object.cc: Likewise.
2889 * object.h: Likewise.
2890 * options.cc: Likewise.
2891 * readsyms.cc: Likewise.
2892 * reduced_debug_output.cc: Likewise.
2893 * reloc.cc: Likewise.
2894 * script-sections.cc: Likewise.
2895 * sparc.cc: Likewise.
2896 * symtab.h: Likewise.
2897 * target-reloc.h: Likewise.
2898 * target.cc: Likewise.
2899 * target.h: Likewise.
2900 * timer.cc: Likewise.
2901 * timer.h: Likewise.
2902 * x86_64.cc: Likewise.
2903
83e17bd5
CC
29042010-12-09 Cary Coutant <ccoutant@google.com>
2905
2906 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
2907 stack.
2908 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
2909 parameter; change all callers.
2910 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
2911 * options.h (warn_execstack): New option.
2912
017257f8
DK
29132010-12-07 Doug Kwan <dougkwan@google.com>
2914
2915 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
2916 like function call relocations.
2917
c20cbc06
ILT
29182010-12-07 Ian Lance Taylor <iant@google.com>
2919
2920 * archive.cc (Archive::get_elf_object_for_member): Permit
2921 punconfigured to be NULL.
2922 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
2923 (Archive::include_member): Pass NULL to get_elf_object_for_member
2924 if we searched for the archive and this is the first included
2925 object.
2926
4dbfafcc
ILT
29272010-12-01 Ian Lance Taylor <iant@google.com>
2928
2929 * dwarf_reader.h (class Sized_dwarf_line_info): Add
2930 track_relocs_type_ field.
2931 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
2932 Set track_relocs_type_.
2933 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
2934 contents when using RELA relocs.
2935 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
2936 reloc_map_.
2937 * reloc.cc (Track_relocs::next_addend): New function.
2938 * reloc.h (class Track_relocs): Declare next_addend.
2939
e5e19edd
ILT
29402010-12-01 Ian Lance Taylor <iant@google.com>
2941
2942 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
2943 virtual destructor.
2944
9a5ce24c
ILT
29452010-12-01 Ian Lance Taylor <iant@google.com>
2946
2947 * README: Update compilers known to work and fail.
2948
c7791212
NC
29492010-11-23 Matthias Klose <doko@ubuntu.com>
2950
2951 * configure.in: For --enable-gold, handle value `default' instead of
2952 `both*'. Always install ld as ld.bfd, install as ld if gold is
2953 not the default.
2954 * configure: Regenerate.
2955
0ad220c9
DK
29562010-11-18 Doug Kwan <dougkwan@google.com>
2957
2958 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
2959 and right_alignment to be zero. Store result alignment only if it is
2960 greater than existing alignment.
2961
ab8056e0
CC
29622010-11-16 Cary Coutant <ccoutant@google.com>
2963
2964 PR gold/12220
2965 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
2966 Check for ".zdebug_line".
2967
fd064a5b
CC
29682010-11-16 Doug Kwan <dougkwan@google.com>
2969 Cary Coutant <ccoutant@google.com>
2970
2971 * output.h (Output_segment::set_section_addresses): Pass increase_relro
2972 by reference; adjust all callers.
2973 * output.cc (Output_segment::set_section_addresses): Adjust references
2974 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
2975 list is empty.
2976 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
2977 end at page boundary.
2978
6fc6ea19
CC
29792010-11-16 Cary Coutant <ccoutant@google.com>
2980
2981 PR gold/12220
2982 * layout.cc (Layout::choose_output_section): Transform names of
2983 compressed sections even when using a script with a SECTIONS clause.
2984 (Layout::output_section_name): Remove code to transform
2985 compressed debug section names.
2986 * output.cc (Output_section::add_input_section): Use uncompressed
2987 section size when tracking input sections.
2988
95a2c8d6
RS
29892010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
2990
2991 * symtab.h (Symbol::NON_PIC_REF): Remove.
2992 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
2993 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
2994 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
2995 (Symbol::use_plt_offset): Take a flags argument and pass it
2996 directly to needs_dynamic_reloc. Restrict check for undefined
2997 weak symbols to function calls.
2998 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
2999 (Target_arm::Scan::global): Use it.
3000 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
3001 (Target_arm::Relocate::relocate): Likewise.
3002 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
3003 parameter with an r_type parameter. Use get_reference_flags
3004 to get the flags.
3005 (Target_arm::Relocate::relocate): Update accordingly.
3006 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
3007 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
3008 (Target_i386::Scan::global): Likewise.
3009 (Target_i386::Relocate::relocate): Likewise.
3010 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
3011 parameter with an r_type parameter. Use get_reference_flags
3012 to get the flags.
3013 (Target_i386::Relocate::relocate): Update accordingly.
3014 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
3015 (Target_powerpc::Scan::global): Use it.
3016 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
3017 (Target_powerpc::Relocate::relocate): Likewise.
3018 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
3019 (Target_sparc::Scan::global): Use it.
3020 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
3021 (Target_sparc::Relocate::relocate): Likewise.
3022 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
3023 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
3024 (Target_x86_64::Scan::global): Likewise.
3025 (Target_x86_64::Relocate::relocate): Likewise.
3026
f625ae50
DK
30272010-11-08 Doug Kwan <dougkwan@google.com>
3028 Cary Coutant <ccoutant@google.com>
3029
3030 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
3031 (Arm_exidx_merge_section::section_contents_): New data member.
3032 (Arm_input_section::Arm_input_section): Initialize original_contents_.
3033 (Arm_input_section::~Arm_input_section): De-allocate memory.
3034 (Arm_input_section::original_contents_): New data member.
3035 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
3036 in parameters instead of calling Object::section_contents without
3037 locking.
3038 (Arm_output_section::group_section): New parameter TASK. Pass it
3039 to callees that need locking objects.
3040 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
3041 to lock EXIDX input sections. Fix a formatting issue. Call
3042 Arm_exidx_merged_section::build_contents to create merged section
3043 contents.
3044 (Arm_output_section::create_stub_group): New parameter TASK. Use it
3045 to lock object of stub table owner.
3046 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
3047 TEXT_SIZE to initialize data member TEXT_SIZE_.
3048 (Arm_exidx_input_section::addralign): Fix typo in comment.
3049 (Arm_exidx_input_section::text_size): New method.
3050 (Target_arm::do_relax): New parameter TASK. Pass it to callees
3051 that require locking objects. Lock objects before scanning for stubs
3052 and updating local symbols.
3053 (Arm_input_section<big_endian>::init): Copy contents of original
3054 input section.
3055 (Arm_input_section<big_endian>::do_write): Use saved contents of
3056 original input section instead of calling Object::section_contents
3057 without locking.
3058 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
3059 size without calling Object::section_size().
3060 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
3061 for size. Allocate a buffer for merged EXIDX entries.
3062 (Arm_exidx_merged_section::build_contents): New method.
3063 (Arm_exidx_merged_section::do_write): Move merge section contents
3064 building code to Arm_exidx_merged_section::build_contetns. Write
3065 out contetns in buffer instead of building it on the fly.
3066 (Arm_relobj::make_exidx_input_section): Also pass text section size
3067 to Arm_exidx_input_section constructor.
3068 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
3069 (Arm_dynobj::do_read_symbols): Fix memory leak.
3070 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
3071 * target.h: (class Task): Add forward declaration.
3072 (Target::relax): Add new parameter TASK and pass it to
3073 Target::do_relax().
3074 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
3075
5f9bcf58
CC
30762010-11-05 Cary Coutant <ccoutant@google.com>
3077
3078 PR gold/10708
3079 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
3080 object when reading from the file.
3081 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
3082 second layout pass.
3083 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
3084 when reading section contents.
3085 (get_section_contents): Likewise.
3086 (icf::find_identical_sections): Likewise.
3087 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
3088 object when reading from the file.
3089 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
3090 the object when doing deferred section layout.
3091
e597fa08
NC
30922010-11-03 Nick Clifton <nickc@redhat.com>
3093
3094 PR gold/12001
3095 * script.h (class Symbol_assignment: name): New member. Returns
3096 the name of the symbol.
3097 * scrfipt.cc (Script_options::is_pending_assignment): New member.
3098 Returns true if the given symbol name is on the list of
3099 assignments wating to be processed.
3100 * archive.cc (should_incldue_member): If the symbol is undefined,
3101 check to see if it is on the list of symbols pending assignment.
3102
3f9a3278
ILT
31032010-11-03 Ryan Mansfield <rmansfield@qnx.com>
3104
3105 * script-sections.cc (Script_sections::find_memory_region): Check
3106 for a NULL output section pointer.
3107
d06fb4d1
DK
31082010-10-29 Doug Kwan <dougkwan@google.com>
3109
3110 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
3111 Output_section::add_relaxed_input_section.
3112 * output.cc (Output_section::add_relaxed_input_section): Add new
3113 arguments LAYOUT and NAME. Set section order index.
3114 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
3115 Copy section order index.
3116 * output.h (Output_section::add_relaxed_input_section): Add new
3117 arguments LAYOUT and NAME.
3118
90e24de5
ILT
31192010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3120
3121 * testsuite/Makefile.am: Move gcctestdir/ld rule to
3122 NATIVE_OR_CROSS_LINKER.
3123 * testsuite/Makefile.in: Regenerate.
3124
c9484ea5
DK
31252010-10-20 Doug Kwan <dougkwan@google.com>
3126
3127 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
3128 without SHF_LINK_ORDER flags.
3129 * layout.cc (Layout::choose_output_section): Do not filter
3130 SHF_LINK_ORDER flag in a relocatable link.
3131
5bc2f5be
CC
31322010-10-17 Cary Coutant <ccoutant@google.com>
3133
3134 * output.h (Output_segment::set_section_addresses): Change function
3135 signature. Update all callers.
3136 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
3137 sections.
3138 (Output_segment::set_section_addresses): Align after last TLS
3139 section. Add padding before last relro section instead of after.
3140
0c91cf04
DK
31412010-10-17 Doug Kwan <dougkwan@google.com>
3142
3143 * gold/arm.cc (Target_arm::got_section): Use correct order and set
3144 GOT output section to be writable.
3145
8c21d9d3
CC
31462010-10-14 Cary Coutant <ccoutant@google.com>
3147
3148 * debug.h (DEBUG_INCREMENTAL): New flag.
3149 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
3150 * gold.cc (queue_initial_tasks): Check parameters for incremental link
3151 mode.
3152 * incremental.cc (report_command_line): Ignore all forms of
3153 --incremental.
3154 * layout.cc (Layout::Layout): Check parameters for incremental link
3155 mode.
3156 * options.cc (General_options::parse_incremental): New function.
3157 (General_options::parse_no_incremental): New function.
3158 (General_options::parse_incremental_full): New function.
3159 (General_options::parse_incremental_update): New function.
3160 (General_options::incremental_mode_): New data member.
3161 (General_options::finalize): Check incremental_mode_.
3162 * options.h (General_options): Update help text for --incremental.
3163 Add --no-incremental, --incremental-full, --incremental-update.
3164 (General_options::Incremental_mode): New enum type.
3165 (General_options::incremental_mode): New function.
3166 (General_options::incremental_mode_): New data member.
3167 * parameters.cc (Parameters::incremental_mode_): New data member.
3168 (Parameters::set_options): Set incremental_mode_.
3169 (Parameters::set_incremental_full): New function.
3170 (Parameters::incremental): New function.
3171 (Parameters::incremental_update): New function.
3172 (set_parameters_incremental_full): New function.
3173 * parameters.h (Parameters::set_incremental_full): New function.
3174 (Parameters::incremental): New function.
3175 (Parameters::incremental_update): New function.
3176 (Parameters::incremental_mode_): New data member.
3177 (set_parameters_incremental_full): New function.
3178 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
3179 incremental link mode.
3180 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
3181 (Sized_relobj::do_relocate_sections): Likewise.
3182 * testsuite/Makefile.am (incremental_test): Use --incremental-full
3183 option.
3184 * testsuite/Makefile.in: Regenerate.
3185 * testsuite/incremental_test.sh: Filter all forms of --incremental.
3186
bb32aa18 31872010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
3188
3189 * script-sections.h (class Script_sections): Make
3190 Sections_elements typedef public.
3191 * script-sections.cc (class Sort_output_sections): Add elements_
3192 field. Add constructor which sets it; change all callers.
3193 (Sort_output_sections::is_before): New function.
3194 (Sort_output_sections::operator()): Call is_before.
3195 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
3196 conditional.
3197 * testsuite/script_test_10.sh: New test. Test script section
3198 order.
3199 * testsuite/script_test_10.t: Likewise.
3200 * testsuite/script_test_10.s: Likewise.
3201 * testsuite/Makefile.am: Wrap the cross linker tests and the
3202 common tests into NATIVE_OR_CROSS_LINKER.
3203 (check_SCRIPTS): Add script_test_10.sh.
3204 (check_DATA): Add script_test_10.stdout.
3205 (script_test_10.o, script_test_10): New targets.
3206 (script_test_10.stdout): New target.
3207 * configure, testsuite/Makefile.in: Regenerate.
3208
3cef7179
ILT
32092010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3210
3211 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
3212 error for the deprecated relocations.
3213 (Target_arm::Scan::global): Likewise.
3214 (Target_arm::Relocate::relocate): Likewise.
3215
7411e9a8
RS
32162010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
3217
3218 * fileread.cc (Input_file::find_file): Initialize *found_name
3219 and *namep when using the fallback search for case 4.
3220
6a9da32a
CC
32212010-10-11 Cary Coutant <ccoutant@google.com>
3222
3223 * options.h (class General_options): Redefine -z lazy as an alias for
3224 the negation of -z now.
3225
ac897c20
ILT
32262010-10-11 Ian Lance Taylor <iant@google.com>
3227
3228 * resolve.cc (symbol_to_bits): Report the value of the unsupported
3229 binding.
3230
ea5cae92
NC
32312010-10-06 Nick Clifton <nickc@redhat.com>
3232
3233 * script-sections.cc(class Memory_region): Remove
3234 current_lma_offset_ field. Rename current_vma_offset_ to
3235 current_offset_. Add last_section_ field.
3236 (Memory_region::get_current_vma_address): Rename to
3237 get_current_address.
3238 (Memory_region::get_current_lma_address): Delete.
3239 (Memory_region::increment_vma_offset): Rename to
3240 increment_offset.
3241 (Memory_region::increment_lma_offset): Delete.
3242 (Memory_region::attributes_compatible): New method. Returns
3243 true if the provided section is compatible with the region.
3244 (Memory_region::get_last_section): New method. Returns the last
3245 section to use the region.
3246 (Memory_region::set_last_section): New method. Stores the last
3247 section to use the region.
3248 (Script_sections::block_in_region): New method. Returns true if
3249 a block of memory is contained within a region.
3250 (Script_sections::find_memory_region): New method. Locates a
3251 memory region to be used to set a VMA or LMA address.
3252 (Output_section_definition::set_section_addresses): Add code to
3253 check for addresses set by memory regions.
3254 (Output_segment::set_section_addresses): Remove memory region
3255 walking code.
3256 (Script_sections::create_segment): Add a warning if a header
3257 segment is created outside of any region.
3258 * script-sections.h (class Script_sections): Add prototypes for
3259 find_memory_region and block_in_region methods.
3260 * testsuite/memory_test.s: Use .long instead of .word.
3261 * testsuite/memory_test.t: Add some more output sections.
3262 * testsuite/memory_test.sh: Update expected output.
3263
a9bfd952
DK
32642010-10-02 Doug Kwan <dougkwan@google.com>
3265
3266 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
3267 defintion to symtab.h
3268 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
3269 declaration to defintion.
3270
bacff3ab
NC
32712010-10-01 Nick Clifton <nickc@redhat.com>
3272
3273 * expression.cc (eval): Replace dummy argument with NULL.
3274 (eval_maybe_dot): Check for a NULL result section pointer.
3275 (Symbol_expression::value): Likewise.
3276 (Dot_expression::value): Likewise.
3277 (BINARY_EXPRESSION): Likewise.
3278 (Max_expression::value): Likewise.
3279 (Min_expression::value): Likewise.
3280 (Absolute_expression::value): Likewise.
3281 (Addr_expression::value_from_output_section): Likewise.
3282 (Loaddddr_expression::value_from_output_section): Likewise.
3283 (Segment_start_expression::value): Likewise.
3284 * script-sections.cc
3285 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
3286 argument with NULL.
3287 (Sections_elememt_dot_assignment::set_section_addresses):
3288 Likewise.
3289 (Output_data_expression::do_write_to_buffer): Likewise.
3290 (Output_section_definition::finalize_symbols): Likewise.
3291 (Output_section_definition::set_section_addresses): Likewise.
3292
f81bc8b5
DK
32932010-09-30 Doug Kwan <dougkwan@google.com>
3294
3295 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
3296
c95e9f27
ST
32972010-09-28 Sriraman Tallam <tmsriram@google.com>
3298
3299 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 3300 function.
c95e9f27
ST
3301 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
3302 virtual function.
3303 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
3304 virtual function.
3305 * icf.cc (get_section_contents): Inline merge sections only when
3306 target allows it.
3307
3cac54d2
RW
33082010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3309
3310 * configure: Regenerate.
3311
2904037a
ILT
33122010-09-17 Ian Lance Taylor <iant@google.com>
3313
3314 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
3315 * testsuite/Makefile.am (memory_test.o): New target.
3316 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
3317 memory_test.t.
3318 * testsuite/Makefile.in: Rebuild.
2904037a 3319
bca7fb63
DK
33202010-09-17 Doug Kwan <dougkwan@google.com>
3321
3322 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
3323 defintion if relocation uses GOT entries of the symbol.
3324 * testsuite/icf_safe_test.sh: Fix test.
3325 * testsuite/icf_safe_so_test.sh: Fix test.
3326
4ef28648
CC
33272010-09-16 Cary Coutant <ccoutant@google.com>
3328
3329 * script_sections.cc (class Memory_region): Remove "NULL" from
3330 vector initializations.
3331
793990de
CC
33322010-09-15 Cary Coutant <ccoutant@google.com>
3333
3334 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
3335 Resolve forwarding symbols.
3336
81e015e2
DK
33372010-09-15 Doug Kwan <dougkwan@google.com>
3338
3339 * gold/testsuite/script_test_3.t: Add ARM special sections.
3340 * gold/testsuite/script_test_4.t: Same.
3341 * gold/testsuite/script_test_5.t: Same.
3342 * gold/testsuite/script_test_6.t: Same.
3343 * gold/testsuite/script_test_7.t: Same.
3344 * gold/testsuite/script_test_7.t: Same.
3345 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
3346
36171d64
CC
33472010-09-14 Cary Coutant <ccoutant@google.com>
3348
3349 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
3350 (Target_x86_64::Relocate::relocate_tls): Replace check for
3351 saw_tls_block_reloc_ with test for executable section.
3352
d89051bd
CC
33532010-09-12 Cary Coutant <ccoutant@google.com>
3354
3355 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
3356 position-independent executables to shared libraries need dynamic
3357 relocations.
3358 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
3359 position-independent executables.
3360 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
3361 * testsuite/Makefile.in: Regenerate.
3362
fca41f0f
NC
33632010-09-10 Nick Clifton <nickc@redhat.com>
3364
3365 PR gold/11997
3366 * testsuite/memory_test.t: Discard any sections that are not
3367 needed.
3368
6695e4b3
L
33692010-09-09 H.J. Lu <hongjiu.lu@intel.com>
3370
3371 PR gold/11996
3372 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
3373 "This::" to work around a bug in gcc 4.2.
3374
3375 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
3376
0f72bf6f
RÁE
33772010-09-09 Rafael Espindola <espindola@google.com>
3378
3379 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
3380 sections with different PF_X flags in the same segment.
3381 (Layout::find_first_load_seg): Search all segments to find the first
3382 one.
3383 * options.h (rosegment): New.
3384
33852010-09-08 Rafael Espindola <espindola@google.com>
a6577478 3386
05a79166 3387 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 3388
aa98ff75
DK
33892010-09-08 Doug Kwan <dougkwan@google.com>
3390
3391 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
3392 (Arm_relobj::do_relocate_sections): Add new parameter for output
3393 file to match the parent.
3394 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
3395 of local symbols instead of input values. Update code to track
3396 changes in gold::relocate_section.
3397 * object.cc (Sized_relobj::compute_final_local_value): New methods.
3398 (Sized_relobj::compute_final_local_value_internal): New methods.
3399 (Sized_relobj::do_finalize_local_symbols): Move code from loop
3400 body into private version of Sized_relobj::compute_final_local_value.
3401 Call the inline method.
3402 * object.h (Symbol_value::Symbol_value): Define destructor. Free
3403 merged symbol value if there is one.
3404 (Symbol_value::has_output_value): New method defintiion.
3405 (Sized_relobj::Compute_final_local_value_status): New enum type.
3406 (Sized_relobj::compute_final_local_value): New methods.
3407 (Sized_relobj::compute_final_local_value_internal): New methods.
3408 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
3409 and arm_cortex_a8.sh.
3410 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
3411 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
3412 New tests.
3413 * Makefile.in: Regenerate.
3414 * testsuite/arm_bl_out_of_range.s: Update test.
3415 * testsuite/thumb_bl_out_of_range.s: Ditto.
3416 * testsuite/thumb_blx_out_of_range.s: Ditto.
3417 * testsuite/arm_branch_out_of_range.sh: New file.
3418 * testsuite/arm_cortex_a8.sh: Ditto.
3419 * testsuite/arm_cortex_a8_b.s: Ditto.
3420 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
3421 * testsuite/arm_cortex_a8_b_local.s: Ditto.
3422 * testsuite/arm_cortex_a8_bl.s: Ditto.
3423 * testsuite/arm_cortex_a8_blx.s: Ditto.
3424 * testsuite/arm_cortex_a8_local.s: Ditto.
3425 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
3426 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
3427
05a79166
L
34282010-09-08 Rafael Espindola <espindola@google.com>
3429
3430 * Makefile.am (memory_test.stdout): Run readelf with -W.
3431 * Makefile.in: Regenerate.
3432 * testsuite/memory_test.sh: Make the regexps accept both 32 and
3433 64 bit output.
3434
33dbc701
RÁE
34352010-09-08 Rafael Espindola <espindola@google.com>
3436
3437 * script-sections.cc (Script_sections::add_memory_region): Convert
3438 field precision to int.
3439 * script.cc (script_set_section_region, script_set_section_region):
3440 Convert field precision to int.
3441
731ca54a
RÁE
34422010-09-08 Rafael Espindola <espindola@google.com>
3443
3444 * arm.cc (do_finalize_sections): Create the __exidx_start and
3445 __exdix_end symbols even when the section is missing.
3446
7f8cd844
NC
34472010-09-08 Nick Clifton <nickc@redhat.com>
3448
3449 * README: Remove claim that MEMORY is not supported.
3450 * expression.cc (script_exp_function_origin)
3451 (script_exp_function_length): Move from here to ...
3452 * script.cc: ... here.
3453 (script_set_section_region, script_add_memory)
3454 (script_parse_memory_attr, script_include_directive): New
3455 functions.
3456 * script-sections.cc
3457 (class Memory_region): New class.
3458 (class Output_section_definition): Add set_memory_region,
3459 set_section_vma, set_section_lma and get_section_name methods.
3460 (class Script_Sections): Add add_memory_region,
3461 find_memory_region, find_memory_region_origin,
3462 find_memory_region_length and set_memory_region methods.
3463 Have set_section_addresses method walk the list of set memory
3464 regions.
3465 Extend the print methos to display memory regions.
3466 * script-sections.h: Add prototypes for new methods.
3467 Add enum for MEMORY region attributes.
3468 * yyscript.y: Add support for parsing MEMORY regions.
3469 * script-c.h: Add prototypes for new functions.
3470 * testsuite/Makefile.am: Add test of MEMORY region functionality.
3471 * testsuite/Makefile.in: Regenerate.
3472 * testsuite/memory_test.sh: New script.
3473 * testsuite/memory_test.s: New assembler source file.
3474 * testsuite/memory_test.t: New linker script.
3475
a4649286
DK
34762010-08-27 Doug Kwan <dougkwan@google.com>
3477
3478 * gold/resolve.cc (Symbol_table::should_override): Let a weak
3479 reference override an existing dynamic weak reference.
3480 * testsuite/Makefile.am: Add new test dyn_weak_ref.
3481 * testsuite/Makefile.in: Regenerate.
3482 * testsuite/dyn_weak_ref.sh: New file.
3483 * testsuite/dyn_weak_ref_1.c: Ditto.
3484 * testsuite/dyn_weak_ref_2.c: Ditto.
3485
b56648ad
ILT
34862010-08-27 Ian Lance Taylor <iant@google.com>
3487
3488 * incremental.h (class Incremental_input_entry): Add virtual
3489 destructor.
3490
809313cb
ILT
34912010-08-27 Ian Lance Taylor <iant@google.com>
3492
3493 * testsuite/start_lib_test_3.c: Mark t3 as used.
3494
11e32464
NC
34952010-08-27 Nick Clifton <nickc@redhat.com>
3496
3497 * options.cc (version_script): Fix small typo in previous
3498 whitespace tidyup.
3499
ca09d69a
NC
35002010-08-25 Nick Clifton <nickc@redhat.com>
3501
3502 * archive.cc: Formatting fixes: Remove whitespace between
3503 typename and following asterisk. Remove whitespace between
3504 function name and opening parenthesis.
3505 * archive.h: Likewise.
3506 * arm.cc: Likewise.
3507 * attributes.cc: Likewise.
3508 * attributes.h: Likewise.
3509 * common.cc: Likewise.
3510 * copy-relocs.cc: Likewise.
3511 * dirsearch.h: Likewise.
3512 * dynobj.cc: Likewise.
3513 * ehframe.cc: Likewise.
3514 * ehframe.h: Likewise.
3515 * expression.cc: Likewise.
3516 * fileread.cc: Likewise.
3517 * fileread.h: Likewise.
3518 * gc.h: Likewise.
3519 * gold-threads.cc: Likewise.
3520 * gold.cc: Likewise.
3521 * i386.cc: Likewise.
3522 * icf.h: Likewise.
3523 * incremental-dump.cc: Likewise.
3524 * incremental.cc: Likewise.
3525 * layout.cc: Likewise.
3526 * layout.h: Likewise.
3527 * main.cc: Likewise.
3528 * merge.cc: Likewise.
3529 * merge.h: Likewise.
3530 * object.cc: Likewise.
3531 * object.h: Likewise.
3532 * options.cc: Likewise.
3533 * options.h: Likewise.
3534 * output.cc: Likewise.
3535 * output.h: Likewise.
3536 * plugin.cc: Likewise.
3537 * plugin.h: Likewise.
3538 * powerpc.cc: Likewise.
3539 * reloc.cc: Likewise.
3540 * script-c.h: Likewise.
3541 * script-sections.cc: Likewise.
3542 * script.cc: Likewise.
3543 * stringpool.cc: Likewise.
3544 * symtab.cc: Likewise.
3545 * symtab.h: Likewise.
3546 * target.cc: Likewise.
3547 * timer.cc: Likewise.
3548 * timer.h: Likewise.
3549 * version.cc: Likewise.
3550 * x86_64.cc: Likewise.
3551
b8fa8750
NC
35522010-08-24 Nick Clifton <nickc@redhat.com>
3553
3554 PR 11899
3555 * layout.cc (segment_precedes): Sort segments by their physical
3556 addresses, if they have been set.
3557
9919d93b
CC
35582010-08-23 Cary Coutant <ccoutant@google.com>
3559
3560 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
3561 symbols data.
3562 (Lib_group::include_member): Unlock object after deleting its
3563 symbols data.
3564 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
3565 the bug fixed here.
3566
97b4be1c
CC
35672010-08-19 Neil Vachharajani <nvachhar@google.com>
3568 Cary Coutant <ccoutant@google.com>
3569
3570 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
3571 constructor, and set_blocker.
3572 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
3573 readsyms_blocker_.
3574 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
3575 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
3576 * testsuite/Makefile.am (start_lib_test): New test case.
3577 * testsuite/Makefile.in: Regenerate.
3578 * testsuite/start_lib_test_main.c: New file.
3579 * testsuite/start_lib_test_1.c: New file.
3580 * testsuite/start_lib_test_2.c: New file.
3581 * testsuite/start_lib_test_3.c: New file.
3582
dd0b1884
ILT
35832010-08-19 Ian Lance Taylor <iant@google.com>
3584
3585 * Makefile.in: Rebuild with automake 1.11.1.
3586 * aclocal.m4: Likewise.
3587 * testsuite/Makefile.in: Likewise.
3588
7223e9ca
ILT
35892010-08-19 Ian Lance Taylor <iant@google.com>
3590
3591 PR 10893
3592 * i386.cc (class Output_data_plt_i386): Update declarations.
3593 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
3594 local_ifuncs_ fields.
3595 (Target_i386::do_plt_section_for_global): New function.
3596 (Target_i386::do_plt_section_for_local): New function.
3597 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
3598 parameter; change all callers. Initialize global_ifuncs_ and
3599 local_ifuncs_. If doing a static link define __rel_iplt_start and
3600 __rel_iplt_end.
3601 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
3602 (Output_data_plt_i386::add_local_ifunc_entry): New function.
3603 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
3604 symbols.
3605 (Target_i386::make_plt_section): New function, broken out of
3606 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
3607 (Target_i386::make_plt_entry): Call make_plt_section.
3608 (Target_i386::make_local_ifunc_plt_entry): New function.
3609 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
3610 (Target_i386::Scan::local): Handle IFUNC symbols. Add
3611 R_386_IRELATIVE to switch.
3612 (Target_i386::Scan::global): Likewise.
3613 (Target_i386::Relocate::relocate): Likewise.
3614 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
3615 switch.
3616 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
3617 (Target_x86_64::do_plt_section_for_global): New function.
3618 (Target_x86_64::do_plt_section_for_local): New function.
3619 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
3620 parameter; change all callers. If doing a static link define
3621 __rela_iplt_start and __rela_iplt_end.
3622 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
3623 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
3624 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
3625 to point to .plt.
3626 (Target_x86_64::make_local_ifunc_plt_entry): New function.
3627 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
3628 switch.
3629 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
3630 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
3631 R_X86_64_IRELATIVE to switch.
3632 (Target_x86_64::Scan::global): Likewise.
3633 (Target_x86_64::Relocate::relocate): Likewise.
3634 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
3635 switch.
3636 * target.h (class Target): Add plt_section_for_global and
3637 plt_section_for_local functions. Add do_plt_section_for_global
3638 and do_plt_section_for_local virtual functions.
3639 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
3640 clarifying comments.
3641 (Symbol::use_plt_offset): Handle IFUNC symbol.
3642 * object.cc (Sized_relobj::Sized_relobj): Initialize
3643 local_plt_offsets_.
3644 (Sized_relobj::local_has_plt_offset): New function.
3645 (Sized_relobj::local_plt_offset): New function.
3646 (Sized_relobj::set_local_plt_offset): New function.
3647 (Sized_relobj::do_count): Handle IFUNC symbol.
3648 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
3649 a bit away from input_shndx_ field. Add set_is_func_symbol and
3650 is_ifunc_symbol functions.
3651 (class Sized_relobj): Update declarations. Remove Tls_got_entry
3652 and Local_tls_got_offsets. Define Local_plt_offsets. Add
3653 local_plt_offsets_ field.
3654 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
3655 * output.h (class Output_section_data): Add non-const
3656 output_section function.
3657 (class Output_data_got): Update declarations.
3658 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
3659 Add use_plt_offset parameter to global and local constructors.
3660 Change all callers. Change local_sym_index_ field to 31 bits.
3661 Change GSYM_CODE and CONSTANT_CODE accordingly.
3662 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
3663 doing a static link don't set sh_link field.
3664 (Output_data_got::Got_entry::write): Use PLT offset if
3665 appropriate.
3666 (Output_data_got::add_global_plt): New function.
3667 (Output_data_got::add_local_plt): New function.
3668 * target-reloc.h (relocate_section): Handle IFUNC symbol.
3669 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
3670 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
3671 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
3672 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
3673 IFUNC conditional.
3674 * testsuite/ifunc-sel.h: New file.
3675 * testsuite/ifuncmain1.c: New file.
3676 * testsuite/ifuncmain1vis.c: New file.
3677 * testsuite/ifuncmod1.c: New file.
3678 * testsuite/ifuncdep2.c: New file.
3679 * testsuite/ifuncmain2.c: New file.
3680 * testsuite/ifuncmain3.c: New file.
3681 * testsuite/ifuncmod3.c: New file.
3682 * testsuite/ifuncmain4.c: New file.
3683 * testsuite/ifuncmain5.c: New file.
3684 * testsuite/ifuncmod5.c: New file.
3685 * testsuite/ifuncmain6pie.c: New file.
3686 * testsuite/ifuncmod6.c: New file.
3687 * testsuite/ifuncmain7.c: New file.
3688 * configure, testsuite/Makefile.in: Rebuild.
3689
56f75c03
ILT
36902010-08-18 Ian Lance Taylor <iant@google.com>
3691
3692 * incremental.cc
3693 (Output_section_incremental_inputs::write_input_files): Add cast
3694 to avoid signed/unsigned comparison warning.
3695 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3696
55455f89
CC
36972010-08-12 Cary Coutant <ccoutant@google.com>
3698
3699 * common.cc (Sort_commons::operator()): Remove unnecessary code.
3700
e2054bcb
ILT
37012010-08-13 Ian Lance Taylor <iant@google.com>
3702
3703 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
3704
74f67560
DK
37052010-08-12 Cary Coutant <ccoutant@google.com>
3706 Doug Kwan <dougkwan@google.com>
3707
3708 * resolve.cc (Symbol_table::should_override): When a weak dynamic
3709 defintion overrides non-weak undef, remember that the original undef
3710 is not weak.
3711 * symtab.cc (Symbol_table::sized_write_global): For undef without
3712 an original weak binding, set binding to global in output.
3713 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
3714 * testsuite/Makefile.in: Regenerate.
3715 * testsuite/strong_ref_weak_def.sh: New file.
3716 * testsuite/strong_ref_weak_def_1.c: Ditto.
3717 * testsuite/strong_ref_weak_def_2.c: Ditto.
3718
d1238d12
CC
37192010-08-12 Cary Coutant <ccoutant@google.com>
3720
3721 * testsuite/incremental_test.sh: Rewrite.
3722 * testsuite/incremental_test_1.c: Rewrite.
3723 * testsuite/incremental_test_2.c: Rewrite.
3724
0e70b911
CC
37252010-08-12 Cary Coutant <ccoutant@google.com>
3726
3727 * arm.cc (Target_arm::got_size): Add const.
3728 (Target_arm::got_entry_count): New function.
3729 (Target_arm::plt_entry_count): New function.
3730 (Target_arm::first_plt_entry_offset): New function.
3731 (Target_arm::plt_entry_size): New function.
3732 (Output_data_plt_arm::entry_count): New function.
3733 (Output_data_plt_arm::first_plt_entry_offset): New function.
3734 (Output_data_plt_arm::get_plt_entry_size): New function.
3735 * i386.cc (Target_i386::got_size): Add const.
3736 (Target_i386::got_entry_count): New function.
3737 (Target_i386::plt_entry_count): New function.
3738 (Target_i386::first_plt_entry_offset): New function.
3739 (Target_i386::plt_entry_size): New function.
3740 (Output_data_plt_i386::entry_count): New function.
3741 (Output_data_plt_i386::first_plt_entry_offset): New function.
3742 (Output_data_plt_i386::get_plt_entry_size): New function.
3743 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
3744 find_incremental_inputs_sections. Dump incremental_got_plt section.
3745 * incremental.cc: Include target.h.
3746 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
3747 parameter. Adjust all callers. Find incremental_got_plt section.
3748 (Incremental_inputs::create_data_sections): Create incremental_got_plt
3749 section.
3750 (Output_section_incremental_inputs::set_final_data_size): Calculate
3751 size of incremental_got_plt section.
3752 (Output_section_incremental_inputs::do_write): Write the
3753 incremental_got_plt section.
3754 (Got_plt_view_info): New struct.
3755 (Local_got_offset_visitor): New class.
3756 (Global_got_offset_visitor): New class.
3757 (Global_symbol_visitor_got_plt): New class.
3758 (Output_section_incremental_inputs::write_got_plt): New function.
3759 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
3760 Add parameter. Adjust all callers.
3761 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
3762 (Incremental_inputs::got_plt_section): New function.
3763 (Incremental_inputs::got_plt_section_): New data member.
3764 (Incremental_got_plt_reader): New class.
3765 * layout.cc (Layout::create_incremental_info_sections): Add the
3766 incremental_got_plt section.
3767 * object.h (Got_offset_list::get_list): New function.
3768 (Got offset_list::for_all_got_offsets): New function.
3769 (Sized_relobj::local_got_offset_list): New function.
3770 * powerpc.cc (Target_powerpc::got_size): Add const.
3771 (Target_powerpc::got_entry_count): New function.
3772 (Target_powerpc::plt_entry_count): New function.
3773 (Target_powerpc::first_plt_entry_offset): New function.
3774 (Target_powerpc::plt_entry_size): New function.
3775 (Output_data_plt_powerpc::entry_count): New function.
3776 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
3777 (Output_data_plt_powerpc::get_plt_entry_size): New function.
3778 * sparc.cc (Target_sparc::got_size): Add const.
3779 (Target_sparc::got_entry_count): New function.
3780 (Target_sparc::plt_entry_count): New function.
3781 (Target_sparc::first_plt_entry_offset): New function.
3782 (Target_sparc::plt_entry_size): New function.
3783 (Output_data_plt_sparc::entry_count): New function.
3784 (Output_data_plt_sparc::first_plt_entry_offset): New function.
3785 (Output_data_plt_sparc::get_plt_entry_size): New function.
3786 * symtab.h (Symbol::got_offset_list): New function.
3787 (Symbol_table::for_all_symbols): New function.
3788 * target.h (Sized_target::got_entry_count): New function.
3789 (Sized_target::plt_entry_count): New function.
3790 (Sized_target::plt_entry_size): New function.
3791 * x86_64.cc (Target_x86_64::got_size): Add const.
3792 (Target_x86_64::got_entry_count): New function.
3793 (Target_x86_64::plt_entry_count): New function.
3794 (Target_x86_64::first_plt_entry_offset): New function.
3795 (Target_x86_64::plt_entry_size): New function.
3796 (Output_data_plt_x86_64::entry_count): New function.
3797 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
3798 (Output_data_plt_x86_64::get_plt_entry_size): New function.
3799
09ec0418
CC
38002010-08-12 Cary Coutant <ccoutant@google.com>
3801
3802 * archive.cc: Include incremental.h.
3803 (Archive::Archive): Initialize incremental_info_.
3804 (Archive::include_member): Record archive members in incremental info.
3805 (Add_archive_symbols::run): Record begin and end of an archive in
3806 incremental info.
3807 (Lib_group::include_member): Record objects in incremental info.
3808 * archive.h (Incremental_archive_entry): Forward declaration.
3809 (Archive::set_incremental_info): New member function.
3810 (Archive::incremental_info): New member function.
3811 (Archive::Unused_symbol_iterator): New class.
3812 (Archive::unused_symbols_begin): New member function.
3813 (Archive::unused_symbols_end): New member function.
3814 (Archive::incremental_info_): New data member.
3815 * incremental-dump.cc (find_input_containing_global): New function.
3816 (dump_incremental_inputs): Dump new incremental info sections.
3817 * incremental.cc: Include symtab.h.
3818 (Output_section_incremental_inputs): New class.
3819 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
3820 new incremental info sections.
3821 (Sized_incremental_binary::do_check_inputs): Likewise.
3822 (Incremental_inputs::report_archive): Remove.
3823 (Incremental_inputs::report_archive_begin): New function.
3824 (Incremental_inputs::report_archive_end): New function.
3825 (Incremental_inputs::report_object): New function.
3826 (Incremental_inputs::finalize_inputs): Remove.
3827 (Incremental_inputs::report_input_section): New function.
3828 (Incremental_inputs::report_script): Rewrite.
3829 (Incremental_inputs::finalize): Do nothing but finalize string table.
3830 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
3831 (Incremental_inputs::sized_create_inputs_section_data): Remove.
3832 (Incremental_inputs::create_data_sections): New function.
3833 (Incremental_inputs::relocs_entsize): New function.
3834 (Output_section_incremental_inputs::set_final_data_size): New function.
3835 (Output_section_incremental_inputs::do_write): New function.
3836 (Output_section_incremental_inputs::write_header): New function.
3837 (Output_section_incremental_inputs::write_input_files): New function.
3838 (Output_section_incremental_inputs::write_info_blocks): New function.
3839 (Output_section_incremental_inputs::write_symtab): New function.
3840 * incremental.h (Incremental_script_entry): Forward declaration.
3841 (Incremental_object_entry): Forward declaration.
3842 (Incremental_archive_entry): Forward declaration.
3843 (Incremental_inputs): Forward declaration.
3844 (Incremental_inputs_header_data): Remove.
3845 (Incremental_inputs_header): Remove.
3846 (Incremental_inputs_header_write): Remove.
3847 (Incremental_inputs_entry_data): Remove.
3848 (Incremental_inputs_entry): Remove.
3849 (Incremental_inputs_entry_write): Remove.
3850 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
3851 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
3852 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
3853 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
3854 Likewise.
3855 (Incremental_input_entry): New class.
3856 (Incremental_script_entry): New class.
3857 (Incremental_object_entry): New class.
3858 (Incremental_archive_entry): New class.
3859 (Incremental_inputs::Incremental_inputs): Initialize new data members.
3860 (Incremental_inputs::report_inputs): Remove.
3861 (Incremental_inputs::report_archive): Remove.
3862 (Incremental_inputs::report_archive_begin): New function.
3863 (Incremental_inputs::report_archive_end): New function.
3864 (Incremental_inputs::report_object): Change prototype.
3865 (Incremental_inputs::report_input_section): New function.
3866 (Incremental_inputs::report_script): Change prototype.
3867 (Incremental_inputs::get_reloc_count): New function.
3868 (Incremental_inputs::set_reloc_count): New function.
3869 (Incremental_inputs::create_data_sections): New function.
3870 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
3871 (Incremental_inputs::inputs_section): New function.
3872 (Incremental_inputs::symtab_section): New function.
3873 (Incremental_inputs::relocs_section): New function.
3874 (Incremental_inputs::get_stringpool): Add const.
3875 (Incremental_inputs::command_line): Add const.
3876 (Incremental_inputs::inputs): Remove.
3877 (Incremental_inputs::command_line_key): New function.
3878 (Incremental_inputs::input_file_count): New function.
3879 (Incremental_inputs::input_files): New function.
3880 (Incremental_inputs::relocs_entsize): New function.
3881 (Incremental_inputs::sized_create_inputs_section_data): Remove.
3882 (Incremental_inputs::finalize_inputs): Remove.
3883 (Incremental_inputs::Input_info): Remove.
3884 (Incremental_inputs::lock_): Remove.
3885 (Incremental_inputs::inputs_): Change type.
3886 (Incremental_inputs::inputs_map_): Remove.
3887 (Incremental_inputs::current_object_entry_): New data member.
3888 (Incremental_inputs::inputs_section_): New data member.
3889 (Incremental_inputs::symtab_section_): New data member.
3890 (Incremental_inputs::relocs_section_): New data member.
3891 (Incremental_inputs::reloc_count_): New data member.
3892 (Incremental_inputs_reader): New class.
3893 (Incremental_symtab_reader): New class.
3894 (Incremental_relocs_reader): New class.
3895 * layout.cc (Layout::finalize): Move finalization of incremental info
3896 and creation of incremental info sections to follow finalization of
3897 symbol table. Set offsets for postprocessing sections.
3898 (Layout::create_incremental_info_sections): Call
3899 Incremental_inputs::create_data_sections. Add incremental symtab
3900 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
3901 sections to layout after input sections.
3902 * layout.h (struct Timespec): Forward declaration.
3903 (Layout::incremental_inputs): Add const.
3904 (Layout::create_incremental_info_sections): Add parameter.
3905 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
3906 * object.cc: Include incremental.h.
3907 (Relobj::finalize_incremental_relocs): New function.
3908 (Sized_relobj::do_layout): Record input sections in incremental info.
3909 * object.h (Object::output_section): New function.
3910 (Object::output_section_offset): Moved from Relobj.
3911 (Object::get_incremental_reloc_base): New function.
3912 (Object::get_incremental_reloc_count): New function.
3913 (Object::do_output_section): New function.
3914 (Object::do_output_section_offset): Moved from Relobj.
3915 (Object::do_get_incremental_reloc_base): New function.
3916 (Object::do_get_incremental_reloc_count): New function.
3917 (Object::Object): Initialize new data members.
3918 (Relobj::output_section): Renamed do_output_section and moved to
3919 protected.
3920 (Relobj::output_section_offset): Moved to Object.
3921 (Relobj::do_get_incremental_reloc_base): New function.
3922 (Relobj::do_get_incremental_reloc_count): New function.
3923 (Relobj::allocate_incremental_reloc_counts): New function.
3924 (Relobj::count_incremental_reloc): New function.
3925 (Relobj::finalize_incremental_relocs): New function.
3926 (Relobj::next_incremental_reloc_index): New function.
3927 (Relobj::reloc_counts_): New data member.
3928 (Relobj::reloc_bases_): New data member.
3929 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
3930 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
3931 (Sized_relobj::incremental_relocs_scan): New function.
3932 (Sized_relobj::incremental_relocs_scan_reltype): New function.
3933 (Sized_relobj::incremental_relocs_write): New function.
3934 (Sized_relobj::incremental_relocs_write_reltype): New function.
3935 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
3936 incremental link.
3937 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
3938 archives and object files elsewhere.
3939 (Add_symbols::run): Report object files here.
3940 (Finish_group::run): Report end of archive at end of group.
3941 * reloc.cc: Include layout.h, incremental.h.
3942 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
3943 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
3944 (Sized_relobj::incremental_relocs_scan): New function.
3945 (Sized_relobj::incremental_relocs_scan_reltype): New function.
3946 (Sized_relobj::do_relocate_sections): Write incremental relocations.
3947 (Sized_relobj::incremental_relocs_write): New function.
3948 (Sized_relobj::incremental_relocs_write_reltype): New function.
3949 * script.cc (read_input_script): Rewrite test for incremental link.
3950 Change call to Incremental_inputs::report_script.
3951 * symtab.h (Symbol_table::first_global_index): New function.
3952 (Symbol_table::output_count): New function.
3953
ce0d1972
DK
39542010-08-12 Doug Kwan <dougkwan@google.com>
3955
3956 * arm.cc (Target_arm::merge_object_attributes): Check command line
3957 options --no-wchar-size-warning and --no-enum-size-warning.
3958 * options.h (General_options): Add ld-compatible options
3959 --no-enum-size-warning and --no-wchar-size-warning.
3960
6e5710ce
ILT
39612010-08-04 Ian Lance Taylor <iant@google.com>
3962
3963 * x86_64.cc (Target_x86_64::Scan::local): Use
3964 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
3965 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
3966 (Target_x86_64::Scan::global): Likewise.
3967 (Target_x86_64::Relocate::relocate): Likewise.
3968 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
3969 Likewise.
3970
fef830db
CC
39712010-08-03 Cary Coutant <ccoutant@google.com>
3972
3973 * merge.cc (Output_merge_string::do_add_input_section): Count strings
3974 to reserve space in merged_strings vector. Keep total input size
3975 for stats.
3976 (Output_merge_string::do_print_merge_stats): Print total input size.
3977 * merge.h (Output_merge_string): Add input_size_ field.
3978 * stringpool.cc (Stringpool_template::string_length): Move
3979 implementations out of Stringpool_template class and place in
3980 stringpool.h.
3981 * stringpool.h (string_length): Move out of Stringpool_template.
3982
1e3811b0
ILT
39832010-08-03 Ian Lance Taylor <iant@google.com>
3984
3985 PR 11712
3986 * layout.cc (relaxation_loop_body): If address of load segment is
3987 set, adjust address to include headers if possible.
3988
7af0c620
ILT
39892010-08-03 Ian Lance Taylor <iant@google.com>
3990
3991 * version.cc (version_string): Bump to 1.10.
3992
22f0da72
ILT
39932010-08-03 Ian Lance Taylor <iant@google.com>
3994
3995 PR 11805
3996 * layout.h (enum Output_section_order): Define.
3997 (class Layout): Update declarations.
3998 * layout.cc (Layout::get_output_section): Add order parameter.
3999 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
4000 is_first_non_relro parameters. Change all callers.
4001 (Layout::choose_output_section): Likewise.
4002 (Layout::add_output_section_data): Likewise.
4003 (Layout::make_output_section): Likewise. Set order.
4004 (Layout::default_section_order): New function.
4005 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
4006 * output.cc (Output_section::Output_section): Initialize order_.
4007 Don't initialize deleted fields.
4008 (Output_segment::Output_segment): Don't initialize deleted
4009 fields.
4010 (Output_segment::add_output_section_to_load): New function
4011 replacing add_output_section. Change all callers to call this or
4012 add_output_section_to_nonload.
4013 (Output_segment::add_output_section_to_nonload): New function.
4014 (Output_segment::remove_output_section): Rewrite.
4015 (Output_segment::add_initial_output_data): Likewise.
4016 (Output_segment::has_any_data_sections): Likewise.
4017 (Output_segment::is_first_section_relro): Likewise.
4018 (Output_segment::maximum_alignment): Likewise.
4019 (Output_segment::has_dynamic_reloc): New function replacing
4020 dynamic_reloc_count. Change all callers.
4021 (Output_segment::has_dynamic_reloc_list): New function replacing
4022 dynamic_reloc_count_list. Change all callers.
4023 (Output_segment::set_section_addresses): Rewrite.
4024 (Output_segment::set_offset): Rewrite.
4025 (Output_segment::find_first_and_last_list): Remove.
4026 (Output_segment::set_tls_offsets): Rewrite.
4027 (Output_segment::first_section_load_address): Likewise.
4028 (Output_segment::output_section_count): Likewise.
4029 (Output_segment::section_with_lowest_load_address): Likewise.
4030 (Output_segment::write_section_headers): Likewise.
4031 (Output_segment::print_sections_to_map): Likewise.
4032 * output.h (class Output_data): Remove dynamic_reloc_count_
4033 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
4034 (Output_data::add_dynamic_reloc): Rewrite.
4035 (Output_data::has_dynamic_reloc): New function.
4036 (Output_data::dynamic_reloc_count): Remove.
4037 (class Output_section): Add order_ field. Remvoe is_relro_local_,
4038 is_last_relro_, is_first_non_relro_, is_interp_,
4039 is_dynamic_linker_section_ fields. Add order and set_order
4040 functions. Remove is_relro_local, set_is_relro_local,
4041 is_last_relro, set_is_last_relro, is_first_non_relro,
4042 set_is_first_non_relro functions, is_interp, set_is_interp,
4043 is_dynamic_linker_section, and set_is_dynamic_linker_section
4044 functions.
4045 (class Output_segment): Change Output_data_list from std::list to
4046 std:;vector. Add output_lists_ field. Remove output_data_ and
4047 output_bss_ fields. Update declarations.
4048
3ff2ccb0
ILT
40492010-08-02 Ian Lance Taylor <iant@google.com>
4050
4051 * arm.cc (Target_arm::gc_process_relocs): Use typename.
4052 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
4053 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
4054
88a4108b
ILT
40552010-08-02 Ian Lance Taylor <iant@google.com>
4056
4057 PR 11855
4058 * script.cc (Script_options::Script_options): Initialize
4059 symbol_definitions_ and symbol_references_.
4060 (Script_options::add_symbol_assignment): Update
4061 symbol_definitions_ and symbol_references_.
4062 (Script_options::add_symbol_reference): New function.
4063 (script_symbol): New function.
4064 * script.h (class Script_options): Add symbol_definitions_ and
4065 symbol_references_ fields.
4066 (Script_options::referenced_const_iterator): New type.
4067 (Script_options::referenced_begin): New function.
4068 (Script_options::referenced_end): New function.
4069 (Script_options::is_referenced): New function.
4070 (Script_options::any_unreferenced): New function.
4071 * script-c.h (script_symbol): Declare.
4072 * yyscript.y (exp): Call script_symbol.
4073 * symtab.cc: Include "script.h".
4074 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
4075 Change all callers. Check symbols referenced by scripts.
4076 (Symbol_table::add_undefined_symbols_from_command_line): Add
4077 layout parameter. Change all callers.
4078 (Symbol_table::do_add_undefined_symbols_from_command_line):
4079 Likewise. Break out loop body. Check symbols referenced by
4080 scripts.
4081 (Symbol_table::add_undefined_symbol_from_command_line): New
4082 function broken out of
4083 do_add_undefined_symbols_from_command_line.
4084 * symtab.h (class Symbol_table): Update declarations.
4085 * archive.cc: Include "layout.h".
4086 (Archive::should_include_member): Add layout parameter. Change
4087 all callers. Check for symbol mentioned in expression.
4088 * archive.h (class Archive): Update declaration.
4089 * object.cc (Sized_relobj::do_should_include_member): Add layout
4090 parameter.
4091 * object.h (Object::should_include_member): Add layout parameter.
4092 Change all callers.
4093 (Object::do_should_include_member): Add layout parameter.
4094 (class Sized_relobj): Update declaration.
4095 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
4096 parameter.
4097 * dynobj.h (class Sized_dynobj): Update declaration.
4098 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
4099 layout parameter.
4100 * plugin.h (class Sized_pluginobj): Update declaration.
4101
5f1ab67a
ILT
41022010-08-02 Ian Lance Taylor <iant@google.com>
4103
4104 PR 11866
4105 * output.cc (Output_segment::set_offset): Search for the first and
4106 last sections rather than assuming that the list is in order.
4107 (Output_segment::find_first_and_last_list): New function.
4108 * output.h (class Output_segment): Update declarations.
4109 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
4110 (relro_strip_test_SOURCES): New variable.
4111 (relro_strip_test_DEPENDENCIES): New variable.
4112 (relro_strip_test_LDFLAGS): New variable.
4113 (relro_strip_test_LDADD): New variable.
4114 (relro_strip_test.so): New target.
4115
a8df5856
ILT
41162010-08-02 Ian Lance Taylor <iant@google.com>
4117
4118 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
4119 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
4120 (Target_i386::got_tlsdesc_section): New function.
4121 (Target_i386::got_section): Create space for GOT entries for
4122 TLSDESC relocations.
4123 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
4124 R_386_TLS_GOTDESC.
4125 (Target_i386::Scan::global): Likewise.
4126 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
4127 using TLSDESC GOT.
4128 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
4129 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
4130 (Target_x86_64::got_tlsdesc_section): New function.
4131 (Target_x86_64::got_section): Create space for GOT entries for
4132 TLSDESC relocations.
4133 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
4134 R_386_TLS_GOTDESC.
4135 (Target_x86_64::Scan::global): Likewise.
4136 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
4137 using TLSDESC GOT.
4138
0c10a0a6
ILT
41392010-08-02 Ian Lance Taylor <iant@google.com>
4140
4141 * testsuite/final_layout.sh: Use dc to convert from hex to
4142 decimal.
4143
41cbeecc
ST
41442010-07-29 Sriraman Tallam <tmsriram@google.com>
4145
4146 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
4147 paramter to the call to gold::gc_process_relocs.
4148 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
4149 paramter to the call to gold::gc_process_relocs.
4150 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
4151 parameter to the call to gold::gc_process_relocs.
4152 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
4153 template parameter to the call to gold::gc_process_relocs.
4154 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
4155 paramter to the call to gold::gc_process_relocs.
4156 * gc.h (get_embedded_addend_size): New function.
4157 (gc_process_relocs): Save the size of the reloc for use by ICF.
4158 * icf.cc (get_section_contents): Get the addend from the text section
4159 for SHT_REL relocation sections.
4160 * icf.h (Icf::Reloc_addend_size_info): New typedef.
4161 (Icf::Reloc_info): Add new member reloc_addend_size_info.
4162 * int_encoding.h (read_from_pointer): New overloaded function.
4163 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
4164 * testsuite/icf_sht_rel_addend_test.sh: New file.
4165 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
4166 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
4167
6ea55b82
RW
41682010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4169
4170 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
4171 * Makefile.in: Regenerate.
4172 * testsuite/Makefile.in: Regenerate.
4173
9691462b
ILT
41742010-07-27 Jeffrey Yasskin <jyasskin@google.com>
4175
4176 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
4177 * gold/testsuite/debug_msg.cc: Likewise.
4178 * gold/testsuite/odr_violation1.cc
4179 * gold/testsuite/odr_violation2.cc
4180
76897331
CC
41812010-07-21 Cary Coutant <ccoutant@google.com>
4182
4183 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
4184 string, and length fields.
4185 (Output_merge_string::Merged_strings_list): New type.
4186 (Output_merge_string::Merged_strings_lists): New typedef.
4187 (Output_merge_string): Replace merged_strings_ with
4188 merged_strings_lists_.
4189 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
4190 Merged_strings_list per input object and section. Don't store pointer
4191 to the string. Don't store length with each merged string entry.
4192 (Output_merge_string::finalize_merged_data): Loop over list of merged
4193 strings lists. Recompute length of each merged string.
4194
78384e8f
CC
41952010-07-15 Cary Coutant <ccoutant@google.com>
4196
4197 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
4198 here.
4199
783659f9
ILT
42002010-07-14 Ian Lance Taylor <iant@google.com>
4201
4202 * descriptors.cc (Descriptors::open): Report correct name in error
4203 message.
4204
131687b4
DK
42052010-07-13 Doug Kwan <dougkwan@google.com>
4206
4207 * arm.cc (Arm_input_section::Arm_input_section): For a
4208 SHT_ARM_EXIDX section, always keeps the input sections.
4209 (Arm_input_section::set_exidx_section_link): New method.
4210 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
4211 has_errors_ to false.
4212 (Arm_exidx_input_section::has_errors,
4213 Arm_exidx_input_section::set_has_errors): New methods.
4214 (Arm_exidx_input_section::has_errors_): New data member.
4215 (Arm_relobj::get_exidx_shndx_list): New method.
4216 (Arm_output_section::append_text_sections_to_list): Do not skip
4217 section without SHF_EXECINSTR.
4218 (Arm_output_section::fix_exidx_coverage): Skip input sections with
4219 errors.
4220 (Arm_relobj::make_exidx_input_section): Add new parameter for text
4221 section header. Make error messages more verbose. Check for
4222 a non-executable section linked to an EXIDX section.
4223 (Arm_relobj::do_read_symbols): Remove error checking, which has been
4224 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
4225 check that there is no deferred EXIDX section if we exit early.
4226 Instead of not making an EXIDX section in case of an error, make one
4227 and set the has_errors flag of it.
4228 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
4229 in a relocatable link.
4230 (Target_arm::do_relax): Look for the EXIDX output section instead of
4231 assuming that it is called .ARM.exidx.
4232 (Target_arm::fix_exidx_coverage): Add a new parameter for input
4233 section list. Do not check for SHF_EXECINSTR section flags but
4234 skip any input section with errors.
4235 * output.cc (Output_section::Output_section): Initialize
4236 always_keeps_input_sections_ to false.
4237 (Output_section::add_input_section): Check for
4238 always_keeps_input_sections_.
4239 * output.h (Output_section::always_keeps_input_sections,
4240 Output_section::set_always_keeps_input_sections): New methods.
4241 (Output_section::always_keeps_input_sections): New data member.
4242
69517287
RÁE
42432010-07-13 Rafael Espindola <espindola@google.com>
4244
4245 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
4246 * fileread.h (Input_file): Add try_extra_search_path and find_file.
4247
82742395
ILT
42482010-07-13 Philip Herron <herron.philip@googlemail.com>
4249 Ian Lance Taylor <iant@google.com>
4250
4251 * output.h (Output_section_lookup_maps::add_merge_section):
4252 Correct check of whether value was inserted.
4253 (Output_section_lookup_maps::add_merge_input_section): Likewise.
4254 (Output_section_lookup_maps::add_relaxed_input_section):
4255 Likewise.
4256 * arm.cc (Target_arm::got_section): Remove used local os.
4257 * i386.cc (Target_i386::got_section): Likewise.
4258 * x86_64.cc (Target_x86_64::got_section): Likewise.
4259 * sparc.cc (Target_sparc::got_section): Likewise.
4260 (Target_sparc::relocate): Remove unused local have_got_offset.
4261 * powerpc.cc (Target_powerpc::relocate): Likewise.
4262
f2d707b5
ILT
42632010-07-13 Ian Lance Taylor <iant@google.com>
4264
241531d6
ILT
4265 * compressed_output.cc (zlib_decompress): Fix signature in
4266 !HAVE_ZLIB_H case.
4267
f2d707b5
ILT
4268 * archive.cc (Archive::include_member): Unlock an external member
4269 of a thin archive. Don't bother to delete an object we know is
4270 NULL.
4271
a2e47362
CC
42722010-07-12 Cary Coutant <ccoutant@google.com>
4273
4274 * compressed_output.cc (zlib_decompress): New function.
4275 (get_uncompressed_size): New function.
4276 (decompress_input_section): New function.
4277 * compressed_output.h (get_uncompressed_size): New function.
4278 (decompress_input_section): New function.
4279 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
4280 Handle compressed debug sections.
4281 * layout.cc (is_compressed_debug_section): New function.
4282 (Layout::output_section_name): Map compressed section names to
4283 canonical names.
4284 * layout.h (is_compressed_debug_section): New function.
4285 (is_debug_info_section): Recognize compressed debug sections.
4286 * merge.cc: Include compressed_output.h.
4287 (Output_merge_data::do_add_input_section): Handle compressed
4288 debug sections.
4289 (Output_merge_string::do_add_input_section): Handle compressed
4290 debug sections.
4291 * object.cc: Include compressed_output.h.
4292 (Sized_relobj::Sized_relobj): Initialize new data members.
4293 (build_compressed_section_map): New function.
4294 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
4295 * object.h (Object::section_is_compressed): New method.
4296 (Object::do_section_is_compressed): New method.
4297 (Sized_relobj::Compressed_section_map): New type.
4298 (Sized_relobj::do_section_is_compressed): New method.
4299 (Sized_relobj::compressed_sections_): New data member.
4300 * output.cc (Output_section::add_input_section): Handle compressed
4301 debug sections.
4302 * reloc.cc: Include compressed_output.h.
4303 (Sized_relobj::write_sections): Handle compressed debug sections.
4304
ce279a62
CC
43052010-07-08 Cary Coutant <ccoutant@google.com>
4306
4307 * resolve.cc (Symbol_table::resolve): Remember whether undef was
4308 weak when resolving to a dynamic def.
4309 (Symbol_table::should_override): Add adjust_dyndef flag; set it
4310 for weak undef/dynamic def cases. Adjust callers.
4311 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
4312 undef_binding_weak_.
4313 (Symbol_table::sized_write_globals): Adjust symbol binding.
4314 (Symbol_table::sized_write_symbol): Add binding parameter.
4315 * symtab.h (Symbol::set_undef_binding): New method.
4316 (Symbol::is_undef_binding_weak): New method.
4317 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
4318 (Symbol_table::should_override): Add new parameter.
4319 (Symbol_table::sized_write_symbol): Add new parameter.
4320
4321 * testsuite/weak_undef_file1.cc: Add new test case.
4322 * testsuite/weak_undef_file2.cc: Fix header comment.
4323 * testsuite/weak_undef_test.cc: Add new test case.
4324
b2286c10
DK
43252010-06-29 Doug Kwan <dougkwan@google.com>
4326
4327 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
4328 Initialize USE_SYMBOL_.
4329 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
4330 definition.
4331 (Arm_reloc_property::uses_symbol_): New data member declaration.
4332 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
4333 uses symbol value and symbol is undefined but not weakly undefined.
4334
4802450a
RÁE
43352010-06-28 Rafael Espindola <espindola@google.com>
4336
4337 * plugin.cc (Plugin::load): Use dlerror.
4338
e5ca47ba
ILT
43392010-06-26 Jeffrey Yaskin <jyasskin@google.com>
4340
4341 * symtab.cc (detect_odr_violations): When reporting an ODR
4342 violation, report an object where the symbol is defined.
4343
8a75a161
DK
43442010-06-25 Doug Kwan <dougkwan@google.com>
4345
4346 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
4347 (Target_arm::section_may_have_icf_unsafe_pointers): New method
4348 definition.
4349 (Target_arm::Scan::local_reloc_may_be_function_pointer,
4350 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
4351 target hook to detect function points.
4352 (Target_arm::Scan::possible_function_pointer_reloc): New method.
4353 * icf.h (Icf::check_section_for_function_pointers): Change type of
4354 parameter SECTION_NAME to const reference to std::string. Use
4355 target hook to determine if section may have unsafe pointers.
4356 * target.h (Target::section_may_have_icf_unsafe_pointers): New
4357 method definition.
4358
42218b9f
RÁE
43592010-06-21 Rafael Espindola <espindola@google.com>
4360
4361 * fileread.cc (Input_file::find_fie): New
4362 (Input_file::open): Use Input_file::find_fie.
4363 * fileread.h (Input_file::find_fie): New
4364 * plugin.cc (set_extra_library_path): New.
4365 (Plugin::load): Add set_extra_library_path to the transfer vector.
4366 (Plugin_manager::set_extra_library_path): New.
4367 (Plugin_manager::add_input_file): Use the extra search path if set.
4368 (set_extra_library_path(): New.
4369 * plugin.h (Plugin_manager): Add set_extra_library_path and
4370 extra_search_path_.
4371
a0506cca
CC
43722010-06-19 Cary Coutant <ccoutant@google.com>
4373
4374 * layout.cc (gdb_sections): Add .debug_types.
4375 (lines_only_debug_sections): Likewise.
4376
6508b958
RÁE
43772010-06-18 Rafael Espindola <espindola@google.com>
4378
4379 * plugin.cc (add_input_file,add_input_library)
4380 (Plugin_manager::add_input_file): Make filename arguments const.
4381 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
4382 const.
4383
3e235302
DK
43842010-06-16 Doug Kwan <dougkwan@google.com>
4385
4386 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
4387 .ARM.attributes section if we have not merged any input
4388 attributes sections.
4389
106e8a6c
DK
43902010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4391
4392 * arm.cc: Allow combining objects with no EABI version
4393 information.
4394
91ff43fe
RÁE
43952010-06-15 Rafael Espindola <espindola@google.com>
4396
4397 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
4398
68ed838c
ILT
43992010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4400
4401 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
4402 (struct iovec): Correct !HAVE_READV definition.
4403
f3a2388f
CC
44042010-06-10 Cary Coutant <ccoutant@google.com>
4405
4406 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
4407 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
4408 reloc sections.
4409 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
4410
4411 PR 11683
4412 * symtab.h (Symbol::is_placeholder): New member function.
4413 * target-reloc.h (relocate_section): Check for placeholder symbols.
4414
4415 * testsuite/Makefile.am (plugin_test_8): New test.
4416 (plugin_test_9): New test.
4417 * testsuite/Makefile.in: Regenerate.
4418
e1df38aa
NC
44192010-06-09 Nick Clifton <nickc@redhat.com>
4420
4421 * yyscript.y (input_list_element): Allow strings prefixed with
4422 the '-' character. Treat these as libraries.
4423 * script.cc (script_add_library): New function. Adds a library
4424 specified by "-l<name>" found in an input script.
4425 * script-c.h: Add prototype for script_add_library.
4426
25bbe950
DK
44272010-06-07 Doug Kwan <dougkwan@google.com>
4428
4429 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
4430 Restrict stub-group size to be within long conditional branch
4431 range when working around cortex-A8 erratum.
4432
0f32ea4c
ILT
44332010-06-07 Damien Diederen <dd@crosstwine.com>
4434
4435 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
4436 #ifdef typo.
4437
8fe2a369
ST
44382010-06-03 Sriraman Tallam <tmsriram@google.com>
4439
4440 PR gold/11658
4441 * output.cc
4442 (Output_section::Input_section_sort_entry::compare_section_ordering):
4443 Change to return non-zero correctly.
4444 (Output_section::Input_section_sort_section_order_index_compare
4445 ::operator()): Change to fix ambiguity in comparisons.
4446
6e9ba2ca
ST
44472010-06-01 Sriraman Tallam <tmsriram@google.com>
4448
4449 * gold.h (is_wildcard_string): New function.
4450 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
4451 (Layout::layout_eh_frame): Ditto.
4452 (Layout::find_section_order_index): New method.
4453 (Layout::read_layout_from_file): New method.
4454 * layout.h (Layout::find_section_order_index): New method.
4455 (Layout::read_layout_from_file): New method.
4456 (Layout::input_section_position_): New private member.
4457 (Layout::input_section_glob_): New private member.
4458 * main.cc (main): Call read_layout_from_file here.
4459 * options.h (--section-ordering-file): New option.
4460 * output.cc (Output_section::input_section_order_specified_): New
4461 member.
4462 (Output_section::Output_section): Initialize new member.
4463 (Output_section::add_input_section): Add new parameter.
4464 Keep input sections when --section-ordering-file is used.
4465 (Output_section::set_final_data_size): Sort input sections when
4466 section ordering file is specified.
4467 (Output_section::Input_section_sort_entry): Add new parameter.
4468 Check sorting type.
4469 (Output_section::Input_section_sort_entry::compare_section_ordering):
4470 New method.
4471 (Output_section::Input_section_sort_compare::operator()): Change to
4472 consider section_order_index.
4473 (Output_section::Input_section_sort_init_fini_compare::operator()):
4474 Change to consider section_order_index.
4475 (Output_section::Input_section_sort_section_order_index_compare
4476 ::operator()): New method.
4477 (Output_section::sort_attached_input_sections): Change to sort
4478 according to section order when specified.
e1df38aa
NC
4479 (Output_section::add_input_section<32, true>): Add new parameter.
4480 (Output_section::add_input_section<64, true>): Add new parameter.
4481 (Output_section::add_input_section<32, false>): Add new parameter.
4482 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
4483 * output.h (Output_section::add_input_section): Add new parameter.
4484 (Output_section::input_section_order_specified): New
4485 method.
4486 (Output_section::set_input_section_order_specified): New method.
4487 (Input_section::Input_section): Initialize section_order_index_.
4488 (Input_section::section_order_index): New method.
4489 (Input_section::set_section_order_index): New method.
4490 (Input_section::section_order_index_): New member.
4491 (Input_section::Input_section_sort_section_order_index_compare): New
4492 struct.
4493 (Output_section::input_section_order_specified_): New member.
4494 * script-sections.cc (is_wildcard_string): Delete and move modified
4495 method to gold.h.
4496 (Output_section_element_input::Output_section_element_input): Modify
4497 call to is_wildcard_string.
4498 (Output_section_element_input::Input_section_pattern
4499 ::Input_section_pattern): Ditto.
4500 (Output_section_element_input::Output_section_element_input): Ditto.
4501 * testsuite/Makefile.am (final_layout): New test case.
4502 * testsuite/Makefile.in: Regenerate.
4503 * testsuite/final_layout.cc: New file.
4504 * testsuite/final_layout.sh: New file.
4505
3537c84b
RÁE
45062010-06-01 Rafael Espindola <espindola@google.com>
4507
4508 * plugin.cc (Plugin::load): Pass the output name to the plugin.
4509
105b6afd
RÁE
45102010-06-01 Rafael Espindola <espindola@google.com>
4511
4512 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
4513 visibility of symbols.
4514
29e11421
DK
45152010-05-27 Doug Kwan <dougkwan@google.com>
4516
4517 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
4518 from start of output section instead of address for a local symbol
4519 in a merged or relaxed section when doing a relocatable link.
4520
5e0f337e
RÁE
45212010-05-26 Rafael Espindola <espindola@google.com>
4522
4523 PR 11604
4524 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
4525 adding sections the garbage collector removed.
4526 * gold/testsuite/Makefile.am: Add test.
4527 * gold/testsuite/Makefile.in: Regenerate.
4528 * gold/testsuite/plugin_test_7.sh: New.
4529 * gold/testsuite/plugin_test_7_1.c: New.
4530 * gold/testsuite/plugin_test_7_2.c: New.
4531
f4187277
RÁE
45322010-05-26 Rafael Espindola <espindola@google.com>
4533
4534 * script-sections.cc (Output_section_definition::set_section_addresses):
4535 Check for --section-start.
4536
5c388529
DK
45372010-05-26 Doug Kwan <dougkwan@google.com>
4538
4539 * arm.cc (Arm_scan_relocatable_relocs): New class.
4540 (Target_arm::relocate_special_relocatable): New method.
4541 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
4542 (Arm_relocate_functions::thumb_branch_common): Same.
4543 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
4544 instead of Default_scan_relocatable_relocs.
4545 * target-reloc.h (relocate_for_relocatable): Let target handle
4546 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
4547 * target.h (Sized_target::relocate_special_relocatable): New method.
4548
bca1c3ae
ILT
45492010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4550
4551 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
4552
0439c796
DK
45532010-05-23 Doug Kwan <dougkwan@google.com>
4554
4555 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
4556 instead of a cast.
4557 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
4558 with a direct branch, not a conditional branch, to a stub.
4559 * merge.cc (Output_merge_base::record_input_section): New method
4560 defintion.
4561 (Output_merge_data::do_add_input_section): Record input section if
4562 keeps-input-sections flag is set.
4563 (Output_merge_string::do_add_input_section): Ditto.
4564 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
4565 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
4566 INPUT_SECTIONS_.
4567 (Output_merge_base::keeps_input_sections,
4568 Output_merge_base::set_keeps_input_sections,
4569 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
4570 method definitions.
4571 (Output_merge_base::Input_sections): New type declaration.
4572 (Output_merge_base::input_sections_begin,
4573 Output_merge_base::input_sections_end,
4574 Output_merge_base::do_set_keeps_input_sections): New method definitions.
4575 (Output_merge_base::bool keeps_input_sections_,
4576 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
4577 Output_merge_base::input_sections_): New data members.
4578 (Output_merge_data::do_set_keeps_input_sections): New method
4579 defintion.
4580 (Output_merge_string::do_set_keeps_input_sections): Ditto.
4581 * output.cc (Output_section::Input_section::relobj): Move method
4582 defintion from class declaration to here and handle merge sections.
4583 (Output_section::Input_section::shndx): Ditto.
4584 (Output_section::Output_section): Remove initializations of removed
4585 data members and initialize new data member LOOKUP_MAPS_.
4586 (Output_section::add_input_section): Set keeps-input-sections flag
4587 for a newly created merge output section as appropriate. Adjust code
4588 to use Output_section_lookup_maps class.
4589 (Output_section::add_relaxed_input_section): Adjst code for lookup
4590 maps code refactoring.
4591 (Output_section::add_merge_input_section): Add a new parameter
4592 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
4593 class. If adding input section to a newly created merge output
4594 section fails, remove the new merge section.
4595 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 4596 Adjust code for use of the Output_section_lookup_maps class.
0439c796
DK
4597 (Output_section::find_merge_section): Ditto.
4598 (Output_section::build_lookup_maps): New method defintion.
4599 (Output_section::find_relaxed_input_section): Adjust code to use
4600 Output_section_lookup_maps class.
4601 (Output_section::get_input_sections): Export merge sections. Adjust
4602 code to use Output_section_lookup_maps class.
4603 (Output_section:::add_script_input_section): Adjust code to use
4604 Output_section_lookup_maps class. Update lookup maps for merge
4605 sections also.
4606 (Output_section::discard_states): Use Output_section_lookup_maps.
4607 (Output_section::restore_states): Same.
4608 * output.h (Merge_section_properties): Move class defintion out of
4609 Output_section.
4610 (Output_section_lookup_maps): New class.
4611 (Output_section::Input_section::is_merge_section): New method
4612 defintion.
4613 (Output_section::Input_section::relobj): Move defintion out of class
4614 defintion. Declare method only.
4615 (Output_section::Input_section::shndx): Ditto.
4616 (Output_section::Input_section::output_merge_base): New method defintion.
4617 (Output_section::Input_section::u2_.pomb): New union field.
4618 (Output_section::Merge_section_by_properties_map,
4619 Output_section::Output_section_data_by_input_section_map,
4620 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
4621 Remove types.
4622 (Output_section::add_merge_input_section): Add new parameter
4623 KEEPS_INPUT_SECTIONS.
4624 (Output_section::build_lookup_maps): New method declaration.
4625 (Output_section::merge_section_map_,
4626 Output_section::merge_section_by_properties_map_,
4627 Output_section::relaxed_input_section_map_,
4628 Output_section::is_relaxed_input_section_map_valid_): Remove data
4629 members.
4630 (Output_section::lookup_maps_): New data member.
4631
76295588
L
46322010-05-21 Doug Kwan <dougkwan@google.com>
4633
4634 PR gold/11619
4635 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
4636 avoid a compilation error.
4637
d103a984
RÁE
46382010-05-19 Rafael Espindola <espindola@google.com>
4639
4640 * script-sections.cc (Output_section_definition::allocate_to_segment):
4641 Update the phdrs_list even when the output section is NULL.
4642 * testsuite/Makefile.am: Add test.
4643 * testsuite/Makefile.in: Regenerate.
4644 * testsuite/script_test_9.cc: New.
4645 * testsuite/script_test_9.sh: New.
4646 * testsuite/script_test_9.t: New.
4647
6625d24e
DK
46482010-05-19 Doug Kwan <dougkwan@google.com>
4649
4650 * arm.cc (Arm_input_section::original_size): New method.
4651 (Arm_input_section::do_addralign): Add a cast.
4652 (Arm_input_section::do_output_offset): Remove static cast.
4653 (Arm_input_section::original_addralign,
4654 Arm_input_section::original_size_): Change type to uint32_t.
4655 (Arm_input_section::init): Add safe casts for section alignment
4656 and size.
4657 (Arm_input_section::set_final_data_size): Do not set address and
4658 offset of stub table.
4659 (Arm_output_section::fix_exidx_coverage): Change use of of
4660 Output_section::Simple_input_section to that of
4661 Output_section::Input_section.
4662 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
4663 except for the first pass.
4664 * output.cc (Output_section::get_input_sections): Change type of
4665 input_sections to std::list<Input_section>.
4666 (Output_section::add_script_input_section): Rename from
4667 Output_section::add_simple_input_section. Change type of SIS
4668 parameter from Simple_input_section to Input_section.
4669 * output.h (Output_section::Simple_input_section): Remove class.
4670 (Output_section::Input_section): Change class visibility to public.
4671 (Output_section::Input_section::addralign): Use stored alignments
4672 for special input sections if set.
4673 (Output_section::Input_section::set_addralign): New method.
4674 (Output_section::get_input_sections): Change parameter type from
4675 list of Simple_input_section to list of Input_section.
4676 (Output_section::add_script_input_section): Rename from
4677 Output_section::add_simple_input_section. Change first parameter's
4678 type from Simple_input_section to Input_section and remove the
4679 second and third parameters.
4680 * script-sections.cc (Input_section::Input_section_list): Change
4681 type to list of Output_section::Input_section/
4682 (Input_section_info::Input_section_info): Change parameter type of
4683 INPUT_SECTION to Output_section::Input_section.
4684 (Input_section_info::input_section): Change return type.
4685 (Input_section_info::input_section_): Change type to
4686 Output_section::Input_section.
4687 (Output_section_element_input::set_section_addresses): Adjust code
4688 to use Output_section::Input_section instead of
4689 Output_section::Simple_input_section. Adjust code for renaming
4690 of Output_section::add_simple_input_section.
4691 (Orphan_output_section::set_section_addresses): Ditto.
4692
e1e82ea4
RW
46932010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4694
4695 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
4696 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
4697
91e75c8a
RÁE
46982010-05-18 Rafael Espindola <espindola@google.com>
4699
4700 * options.cc (General_options::finalize): Handle -nostdlib.
4701 * options.h (nostdlib): New option.
4702 * script.cc (script_add_search_dir): Handle -nostdlib.
4703
da59ad79
DK
47042010-05-12 Doug Kwan <dougkwan@google.com>
4705
4706 * arm.cc (Target_arm::do_finalize_sections): Create an empty
4707 attributes section only if there no attributes section after merging.
4708 (Target_arm::merge_object_attributes): Move value of
e1df38aa 4709 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
4710 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
4711 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
4712 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
4713 and arm_attr_merge_7.stdout.
4714 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
4715 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
4716 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
4717 arm_attr_merge_7b.o): New rules.
4718 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
4719 arm_attr_merge_7
4720 * testsuite/Makefile.in: Regenerate.
4721 * testsuite/arm_attr_merge.sh: New file.
4722 * testsuite/arm_attr_merge_[67][ab].s: Same.
4723
3e01a7fd
NC
47242010-05-05 Nick Clifton <nickc@redhat.com>
4725
4726 * po/es.po: Updated Spanish translation.
4727
7ad2014a
L
47282010-04-27 H.J. Lu <hongjiu.lu@intel.com>
4729
4730 * Makefile.am (install-exec-local): Properly install gold as
4731 default cross linker.
4732 * Makefile.in: Regenerated.
4733
4fda8867
NC
47342010-04-27 H.J. Lu <hongjiu.lu@intel.com>
4735 Nick Clifton <nickc@redhat.com>
4736
4737 * configure.ac (install_as_default): Define and set to false
4738 unless --enable-gold or --enable-gold=both/gold has been
4739 specified.
4740 * configure: Regenerate.
4741
4742 * Makefile.am (install-exec-local): Install the executable as
4743 'ld.gold'. If install_as_default is true then also install it as
4744 'ld'.
4745 * Makefile.in: Regenerated.
4746
bd288ea2
ILT
47472010-04-24 Ian Lance Taylor <iant@google.com>
4748
4749 * layout.cc (Layout::layout_reloc): In relocatable link don't
4750 combine reloc sections for grouped sections.
4751
ef38fd8a
ST
47522010-04-23 Sriraman Tallam <tmsriram@google.com>
4753
4754 * gc.h (gc_process_relocs): Pass information on relocs pointing to
4755 sections that are not ordinary to icf.
4756 * icf.cc (get_section_contents): Handle relocation pointing to section
4757 with no object or shndx information.
4758 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
4759 * testsuite/Makefile.in: Regenerate.
4760 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
4761 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
4762
f6973bdc
ILT
47632010-04-22 Ian Lance Taylor <iant@google.com>
4764
4765 * expression.cc (Expression::Expression_eval_info): Add
4766 result_alignment_pointer field.
4767 (Expression::eval_with_dot): Add result_alignment_pointer
4768 parameter. Change all callers.
4769 (Expression::eval_maybe_dot): Likewise.
4770 (class Binary_expression): Add alignment_pointer parameter to
4771 left_value and right_value. Change all callers.
4772 (BINARY_EXPRESSION): Set result alignment.
4773 (class Trinary_expression): Add alignment_pointer parameter to
4774 arg2_value and arg3_value. Change all callers.
4775 (Trinary_cond::value): Set result alignment.
4776 (Max_expression::value, Min_expression::value): Likewise.
4777 (Align_expression::value): Likewise.
4778 * script-sections.cc (class Sections_element): Add dot_alignment
4779 parameter to set_section_addresses virtual function. Update
4780 instantiations.
4781 (class Output_section_element): Likewise.
4782 (Script_sections::create_segments): Add dot_alignment parameter.
4783 Change all callers.
4784 (Script_sections::create_segments_from_phdrs_clause): Likewise.
4785 (Script_sections::set_phdrs_clause_addresses): Likewise.
4786 * script-sections.h: Update declarations.
4787 * script.h: Update declarations.
4788 * output.h (Output_segment::set_minimum_p_align): Don't decrease
4789 min_p_align.
4790 * testsuite/script_test_3.t: Set large alignment.
4791 * testsuite/script_test_3.sh: Make sure that at least one LOAD
4792 segment has expected alignment.
4793
9c9c98a5
NC
47942010-04-22 Nick Clifton <nickc@redhat.com>
4795
4796 * po/gold.pot: Updated by the Translation project.
4797 * po/vi.po: Updated Vietnamese translation.
4798
2253bfba
L
47992010-04-22 H.J. Lu <hongjiu.lu@intel.com>
4800
4801 * testsuite/Makefile.am (check_PROGRAMS): Add
4802 icf_virtual_function_folding_test.
4803 * testsuite/Makefile.in: Regenerated.
4804
85fdf906
AH
48052010-04-15 Andrew Haley <aph@redhat.com>
4806
4807 * options.h (merge_exidx_entries): New option.
4808 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
4809 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
4810 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
4811 (Target_arm::merge_exidx_entries): New function.
4812 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
4813 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
4814 to Arm_exidx_fixup constructor.
4815 Add new arg, merge_exidx_entries.
4816 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
4817 Arm_output_section::fix_exidx_coverage.
4818
ce97fa81
ST
48192010-04-18 Sriraman Tallam <tmsriram@google.com>
4820
4821 * icf.cc (get_section_contents): Check for preemptible functions.
4822 Ignore addend when appropriate.
4823 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
4824 section folded.
4825 (add_from_relobj): Check for section folded.
4826 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
4827 * symtab.h (should_add_dynsym_entry): Add new parameter.
4828 * target-reloc.h (scan_relocs): Check for section folded.
4829 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
4830 Check reloc types for function pointers in shared objects.
4831 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
4832 case.
4833 (icf_preemptible_functions_test): New test case.
4834 (icf_string_merge_test): New test case.
4835 * testsuite.Makefile.in: Regenerate.
4836 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
4837 bar_glob. Refactor code.
4838 * testsuite/icf_preemptible_functions_test.cc: New file.
4839 * testsuite/icf_preemptible_functions_test.sh: New file.
4840 * testsuite/icf_string_merge_test.cc: New file.
4841 * testsuite/icf_string_merge_test.sh: New file.
4842 * testsuite/icf_virtual_function_folding_test.cc: New file.
4843 * testsuite/icf_virtual_function_folding_test.sh: New file.
4844
04ceb17c
DK
48452010-04-14 Doug Kwan <dougkwan@google.com>
4846
4847 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
4848 for local symbol recounting if we remove a section due to ICF.
4849 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
4850 there are no regular objects in input.
4851
153e7da4
DK
48522010-04-13 Doug Kwan <dougkwan@google.com>
4853
4854 * arm.cc (Arm_input_section::set_final_data_size): Compute
4855 accurate final data size instead of using current data size.
4856
4dbd9faf
DK
48572010-04-09 Doug Kwan <dougkwan@google.com>
4858
4859 * layout.cc (Layout::choose_output_section): Handle script section
4860 types.
4861 (Layout::make_output_section_for_script): Add section type parameter.
4862 Handle script section types.
4863 * layout.h (Layout::make_output_section_for_script): Add section
4864 type parameter.
4865 * output.cc (Output_section::Output_section): Initialize data member
4866 is_noload_.
4867 (Output_section::do_reset_address_and_file_offset): Do not set address
4868 to 0 if section is a NOLOAD section.
4869 * output.h (Output_section::is_noload): New method.
4870 (Output_section::set_is_noload): Ditto.
4871 (Output_section::is_noload_): New data member.
4872 * script-c.h (Script_section_type): New enum type.
4873 (struct Parser_output_section_header): Add new file section_type.
4874 * script-sections.cc (Sections_element::output_section_name): Add
4875 parameter for returning script section type.
4876 (Output_section_definition::output_section_name): Ditto.
4877 (Output_section_definition::section_type)P; New method.
4878 (Output_section_definiton::script_section_type_name): Ditto.
4879 (Output_section_definition::script_section_type_): New data member.
4880 (Output_section_definition::Output_section_definition): Initialize
4881 data member Output_section_definition::script_section_type_.
4882 (Output_section_definition::create_sections): Pass script section type
4883 to Layout::make_output_section_for_script.
4884 (Output_section_definition::output_section_name): Return script
4885 section type to caller.
4886 (Output_section_definition::set_section_address): Do not advance
4887 dot value and load address if section type is NOLOAD. Set address
4888 of NOLOAD sections regardless of section flags.
4889 (Output_section_definition::print): Print section type if it is
4890 not SCRIPT_SECTION_TYPE_NONE.
4891 (Output_section_definition::section_type): New method.
4892 (Output_section_definition::script_section_type_name): Ditto.
4893 (Script_sections::output_section_name): Add new parameter
4894 PSECTION_TYPE for returning script section type. Pass it to
4895 section elements. Handle discard sections.
4896 (Sort_output_sections::operator()): Handle NOLOAD sections.
4897 * script-sections.h (Script_sections::Section_type): New enum type.
4898 (Script_sections::output_section_name): Add a new parameter for
4899 returning script section type.
4900 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
4901 INFO and NOLOAD.
4902 * yyscript.y (union): Add new field SECTION_TYPE.
4903 (COPY, DSECT, INFO, NOLOAD): New tokens.
4904 (opt_address_and_section_type): Change type to output_section_header.
4905 (section_type): New non-terminal
4906 (section_header): Handle section type.
2253bfba 4907 (opt_address_and_section_type): Return section type value.
4dbd9faf 4908
721ea635
L
49092010-04-09 H.J. Lu <hongjiu.lu@intel.com>
4910
4911 * testsuite/plugin_common_test_1.c (foo): Add prototype.
4912 * testsuite/plugin_common_test_2.c (foo): Likewise.
4913
6bf924b0
DK
49142010-04-08 Doug Kwan <dougkwan@google.com>
4915
4916 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
4917 Output_merge_data.
4918 * output.cc (Output_section::add_merge_input_section): Simplify
4919 code and return status of Output_merge_base::add_input_section.
e1df38aa 4920 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
4921 returns true.
4922
24af6f92
DK
49232010-04-07 Doug Kwan <dougkwan@google.com>
4924
4925 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
4926 if section is marked as containing instructions but has no mapping
4927 symbols.
4928 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
4929 correct section index.
4930 (Arm_relobj::find_linked_text_section): Ditto.
4931
00698fc5
CC
49322010-04-07 Cary Coutant <ccoutant@google.com>
4933
4934 * archive.cc (include_member): Destroy Read_symbols_data object before
4935 releasing file.
4936 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
4937 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
4938 (Read_symbols_data::~Read_symbols_data) New destructor.
4939 (Section_relocs::Section_relocs) New constructor.
4940 (Section_relocs::~Section_relocs) New destructor.
4941 (Read_relocs_data::Read_relocs_data) New constructor.
4942 (Read_relocs_data::~Read_relocs_data) New destructor.
4943 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
4944 pointers to NULL after deleting.
4945
7296d933
DK
49462010-04-07 Doug Kwan <dougkwan@google.com>
4947
4948 * arm.cc: Replace "endianity" with "endianness" in comments.
4949 (Arm_exidx_cantunwind): Ditto.
4950 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
4951 (Arm_relobj::merge_flags_and_attributes): New method.
4952 (Arm_relobj::merge_flags_and_attributes_): New data member.
4953 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
4954 (Arm_relobj::scan_sections_for_stubs): Ditto.
4955 (Arm_relobj::do_read_symbols): Check to see if we really want to
4956 merge processor-specific flags and attributes. Exit early if
4957 an object is empty except for section names and the undefined symbol.
4958 (Target_arm::do_finalize_sections): Move check for ELF format to
4959 Arm_relobj::do_read_symbols. Merge processor specific flags and
4960 attributes from a regular object only when we have determined that
4961 it is aapropriate. Do not create an .ARM.attributes section in
4962 output if there is no regular input object.
4963 (Target_arm::merge_processor_specific_flags): Check
4964 --warn-mismatch before printing any error.
4965 (Target_arm::merge_object_attributes): Ditto.
4966 * gold.cc (queue_middle_tasks): Handle the case in which there is
4967 no regular object in input.
4968 * options.cc (General_options::parse_EB): New method.
4969 (General_options::parse_EL): Same.
4970 (General_options::General_options): Initialize endianness_.
4971 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
4972 New options.
4973 (General_options::Endianness): New enum.
4974 (General_options::endianness): New method.
4975 (General_options::endianness_): New data member.
4976 * parameters.cc (Parameters::set_options): Check target endianness.
4977 (Parameters::set_target_once): Ditto.
4978 (Parameters::check_target_endianness): New method.
4979 (parameters_force_valid_target): If either -EL or -EB is specified,
4980 use it to define endianness of default target.
4981 * parameters.h (Parameters::check_target_endianness): New method
4982 declaration.
4983 * target.h (class Target): Change "endianity" to "endianness"
4984 in comments.
4985
efc8d4f2
RW
49862010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4987
4988 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
4989 * configure: Regenerate.
4990 * Makefile.in: Regenerate.
4991 * testsuite/Makefile.in: Regenerate.
4992
be234d88
CC
49932010-04-06 Cary Coutant <ccoutant@google.com>
4994
4995 gcc PR lto/42757
4996 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
4997 prevailing definitions of common symbols.
4998 * testsuite/plugin_test_6.sh: New test case.
4999 * testsuite/plugin_common_test_1.c: New test case.
5000 * testsuite/plugin_common_test_2.c: New test case.
5001 * testsuite/Makefile.am (plugin_test_6): New test case.
5002 * testsuite/Makefile.in: Regenerate.
5003
bd32c6bd
NC
50042010-04-06 Nick Clifton <nickc@redhat.com>
5005
5006 * po/vi.po: New Vietnamese translation.
5007
323c532f
DK
50082010-03-30 Doug Kwan <dougkwan@google.com>
5009
5010 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
5011
4fcd97eb
DK
50122010-03-25 Doug Kwan <dougkwan@google.com>
5013
5014 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
5015 to avoid a conversion warning on a 32-bit host.
5016
4ebf39db
ILT
50172010-03-24 Ian Lance Taylor <iant@google.com>
5018
5019 * testsuite/script_test_3.t: Add a TLS segment.
5020 * testsuite/Makefile.am (check_PROGRAMS): Add
5021 tls_phdrs_script_test.
5022 (tls_phdrs_script_test_SOURCES): Define.
5023 (tls_phdrs_script_test_DEPENDENCIES): Define.
5024 (tls_phdrs_script_test_LDFLAGS): Define.
5025 (tls_phdrs_script_test_LDADD): Define.
5026 * testsuite/Makefile.in: Rebuild.
5027
4a599bdd
CC
50282010-03-23 Cary Coutant <ccoutant@google.com>
5029
5030 * fileread.cc (find_or_make_view): Fix comment.
5031
6c93b22c
ILT
50322010-03-23 Ian Lance Taylor <iant@google.com>
5033
5034 * script-sections.cc (class Orphan_section_placement): Define
5035 PLACE_TLS and PLACE_TLS_BSS.
5036 (Orphan_section_placement::Orphan_section_placement): Initialize
5037 new places.
5038 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
5039 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
5040 (tls_script_test_SOURCES): Define.
5041 (tls_script_test_DEPENDENCIES): Define.
5042 (tls_script_test_LDFLAGS): Define.
5043 (tls_script_test_LDADD): Define.
5044 * testsuite/Makefile.in: Rebuild.
5045
a2c7281b
DK
50462010-03-22 Doug Kwan <dougkwan@google.com>
5047
5048 * arm.cc (Arm_relocate_functions::abs8,
5049 Arm_relocate_functions::abs16): Use correct check for overflow
5050 specified in the ARM ELF specs.
5051 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
5052 target of a BLX instruction specially.
5053 (Reloc_stub::stub_type_for_reloc): Ditto.
5054 (Relocate::relocate): Use symbolic names instead of numeric relocation
5055 codes to report error.
5056 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
5057 workaround.
5058 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
5059 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
5060 thumb2_blx_out_of_range.stdout
5061 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
5062 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
5063 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
5064 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
5065 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
5066 thumb2_blx_in_range, thumb2_blx_in_range.o,
5067 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
5068 thumb2_blx_out_of_range.o): New rules.
5069 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
5070 thumb2_blx_in_range and thumb2_blx_out_of_range.
5071 * testsuite/Makefile.in: Regenerate.
5072 * arm_branch_in_range.sh: Add tests for THUMB BLX.
5073 * testsuite/thumb_blx_in_range.s: New file.
5074 * testsuite/thumb_blx_out_of_range.s: New file.
5075
b0193076
RÁE
50762010-03-22 Rafael Espindola <espindola@google.com>
5077
5078 * archive.cc (Should_include): Move to archive.h.
5079 (should_include_member): Make it a member of Archive.
5080 (Lib_group): New.
5081 (Add_lib_group_symbols): New.
5082 * archive.h: Include options.h.
5083 (Archive_member): Moved from Archive.
5084 (Should_include): Moved from archive.cc.
5085 (Lib_group): New.
5086 (Add_lib_group_symbols): New.
5087 * dynobj.cc (do_should_include_member): New.
5088 * dynobj.h (do_should_include_member): New.
5089 * gold.cc (queue_initial_tasks): Update call to queue.
5090 * main.cc (main): Print lib group stats.
5091 * object.cc (do_should_include_member): New.
5092 * object.h: Include archive.h.
5093 (Object::should_include_member): New.
5094 (Object::do_should_include_member): New.
5095 (Sized_relobj::do_should_include_member): New.
5096 * options.cc (General_options::parse_start_lib): New.
5097 (General_options::parse_end_lib): New.
5098 (Input_arguments::add_file): Handle lib groups.
5099 (Input_arguments::start_group): Check we are not in a lib.
5100 (Input_arguments::start_lib): New.
5101 (Input_arguments::end_lib): New.
5102 * options.h (General_options): Add start_lib and end_lib.
5103 (Input_argument::lib_): New.
5104 (Input_argument::lib): New.
5105 (Input_argument::is_lib): New.
5106 (Input_file_lib): New.
5107 (Input_arguments::in_lib_): New.
5108 (Input_arguments::in_lib): New.
5109 (Input_arguments::start_lib): New.
5110 (Input_arguments::end_lib_): New.
5111 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
5112 in unused members as preempted.
5113 (Sized_pluginobj::do_should_include_member): New.
5114 * plugin.h (Sized_pluginobj::do_should_include_member): New.
5115 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
5116 return the blocker.
5117 (Read_symbols::do_whole_lib_group): New.
5118 (Read_symbols::do_lib_group): New.
5119 (Read_symbols::do_read_symbols): Handle lib groups.
5120 (Read_symbols::get_name): Handle lib groups.
5121 * readsyms.h (Read_symbols): Add an archive member pointer.
5122 (Read_symbols::do_whole_lib_group): New.
5123 (Read_symbols::do_lib_group): New.
5124 (Read_symbols::member_): New.
5125 * script.cc (read_input_script): Update call to queue_soon.
5126
d099120c
DK
51272010-03-19 Doug Kwan <dougkwan@google.com>
5128
5129 * arm.cc (Stub_table::Stub_table): Initialize new data members
5130 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
5131 (Stub_table::add_reloc_stub): Assign stub offset and update
5132 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
5133 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
5134 New data members.
5135 (Stub_table::update_data_size_and_addralign): Use
5136 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
5137 instead of going over all reloc stubs.
5138 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
5139 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
5140 Stringpool_template::offset_ to size of Stringpool_char.
5141 (Stringpool_template::new_key_offset): Remove code to initialize
5142 Stringpool_template::offset_.
5143 * stringpool.h (Stringpool_template::set_no_zero_null): Set
5144 Stringpool_template::offset_ to zero.
5145
1aa37384
DK
51462010-03-15 Doug Kwan <dougkwan@google.com>
5147
5148 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
5149 offset_.
5150 (Stringpool_template::new_key_offset): New method.
5151 (Stringpool_template::add_string): Assign offsets when adding new
5152 strings.
5153 (Stringpool_template::set_string_offsets): Do not set string offsets
5154 when not optimizing.
5155 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
5156 member size_.
5157 (Chunked_vector::clear): Clear size_.
5158 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
5159 (Chunked_vector::size): Return size_.
5160 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 5161 (Chunked_vector::size_): New data member.
1aa37384
DK
5162 (Stringpool_template::set_no_zero_null): Assert string set is empty.
5163 (Stringpool_template::new_key_offset): New method declaration.
5164 (Stringpool_template::offset_): New data member.
5165
b672b057
RÁE
51662010-03-15 Rafael Espindola <espindola@google.com>
5167
5168 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
5169 Add_symbols' constructor.
5170 * readsyms.h (Add_symbols): Remove the input_group member.
5171
b6848d3c
ILT
51722010-03-10 Ian Lance Taylor <iant@google.com>
5173
5174 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
5175 target to ask whether a reference to a symbol requires a stack
5176 split.
5177 * target.h (Target::is_call_to_non_split): New function.
5178 (Target::do_is_call_to_non_split): Declare virtual function.
5179 * target.cc: Include "symtab.h".
5180 (Target::do_is_call_to_non_split): New function.
5181 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
5182
a2a5469e
CC
51832010-03-10 Cary Coutant <ccoutant@google.com>
5184
5185 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
5186 (File_read::open[1]): Remove initial mapping of whole_file_view_.
5187 (File_read::open[2]): Add whole_file_view_ to list of views.
5188 (File_read::make_view): Remove test of whole_file_view_.
5189 (File_read::find_or_make_view): Create whole_file_view_ if
5190 necessary.
5191 (File_read::clear_views): Replace bool parameter with enum;
5192 adjust all callers. Don't delete views with permanent data;
5193 do delete cached views and views from archives if
5194 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
5195 if clearing the corresponding view.
5196 * fileread.h (File_read::Clear_views_mode): New enum.
5197 (File_read::View::is_permanent_view): New method.
5198 (File_read::clear_views): Replace bool parameter
5199 with enum; adjust all callers.
5200 * options.h (General_options): Change keep_files_mapped option;
5201 add map_whole_files.
5202 * readsyms.cc (Add_symbols::run): Delete sd_ object before
5203 releasing the file.
5204 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
5205 the file.
5206
8861f32b
DM
52072010-03-10 David S. Miller <davem@davemloft.net>
5208
5209 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
5210
d62d0f5f
ST
52112010-03-09 Sriraman Tallam <tmsriram@google.com>
5212
5213 * icf.cc (get_section_contents): Add '@' marker after processing the
5214 merge reloc.
5215
9177756d
DK
52162010-03-08 Doug Kwan <dougkwan@google.com>
5217
5218 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
5219 due to a conversion warning.
5220 (Arm_relobj::update_output_local_symbol_count): Check for local
5221 symbol with unset output index.
5222
9e9e071b
ILT
52232010-03-05 Ian Lance Taylor <iant@google.com>
5224
5225 * options.h (class General_options): Add --spare-dynamic-tags.
5226 * output.cc (Output_data_dynamic::set_final_data_size): Implement
5227 --spare-dynamic-tags.
5228
a81ee015
ILT
52292010-03-05 Ian Lance Taylor <iant@google.com>
5230
5231 * incremental.cc: Include "libiberty.h".
5232
44ec90b9
RO
52332010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
5234
5235 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
5236 function, is_info_ member.
5237 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
5238 (Versions::Versions): Update caller.
5239 (Versions::define_base_version): Likewise.
5240 (Versions::add_def): Likewise.
5241
0897ed3b
ST
52422010-03-03 Sriraman Tallam <tmsriram@google.com>
5243
5244 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
5245 (Scan::possible_function_pointer_reloc): New function.
5246 (Scan::local_reloc_may_be_function_pointer): Change to call
5247 possible_function_pointer_reloc.
5248 (Scan::global_reloc_may_be_function_pointer): Ditto.
5249 * icf.h (Icf::check_section_for_function_pointers): Change to reject
5250 relocations in ".data.rel.ro._ZTV" section.
5251 * testsuite/icf_safe_so_test.sh: Change to pass i386.
5252 * testsuite/icf_safe_so_test.cc: Ditto.
5253 * testsuite/icf_safe_test.cc: Ditto.
5254 * testsuite/icf_safe_test.sh: Ditto.
5255
d3bbad62
ILT
52562010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5257 Ian Lance Taylor <iant@google.com>
5258
5259 * target-reloc.h (relocate_section): Check the symbol table index
5260 for -1U before setting the local symbol index.
5261 (scan_relocatable_relocs): If copying the relocation, record that
5262 the local symbol is required.
5263 * object.h (Symbol_value::is_output_symtab_index_set): New
5264 function.
5265 (Symbol_value::may_be_discarded_from_output_symtab): New
5266 function.
5267 (Symbol_value::has_output_symtab_entry): New function.
5268 (Symbol_value::needs_output_symtab_entry): Remove.
5269 (Symbol_value::output_symtab_index): Make sure the symbol index is
5270 set.
5271 (Symbol_value::set_output_symtab_index): Make sure the symbol
5272 index is not set. Make sure the new index is valid.
5273 (Symbol_value::set_must_have_output_symtab_entry): New function.
5274 (Symbol_value::has_output_dynsym_entry): New function.
5275 (Symbol_value::set_output_dynsym_index): Make sure the new index
5276 is valid.
5277 (Sized_relobj::set_must_have_output_symtab_entry): New function.
5278 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
5279 local symbol if permitted.
5280 (Sized_relobj::do_finalize_local_symbols): Call
5281 is_output_symtab_index_set rather than needs_output_symtab_entry.
5282 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
5283 rather than needs_output_symtab_entry. Call
5284 has_output_dynsym_entry rather than needs_output_dynsym_entry.
5285 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
5286 is_output_symtab_index_set rather than needs_output_symtab_entry.
5287 * testsuite/discard_locals_relocatable_test.c: New file.
5288 * testsuite/discard_locals_test.sh: Test -r.
5289 * testsuite/Makefile.am (check_DATA): Add
5290 discard_locals_relocatable_test1.syms,
5291 discard_local_relocatable_test2.syms.
5292 (MOSTLYCLEANFILES): Likewise. Also add
5293 discard_locals_relocatable_test1.lout and
5294 discard_locals_relocatable_test2.out.
5295 (discard_locals_relocatable_test1.syms): New target.
5296 (discard_locals_relocatable_test.o): New target.
5297 (discard_locals_relocatable_test1.out): New target.
5298 (discard_locals_relocatable_test2.syms): New target.
5299 (discard_locals_relocatable_test2.out): New target.
5300 (various): Add missing ../ld-new dependencies.
5301 * testsuite/Makefile.in: Rebuild.
5302
7e8ccf26
NC
53032010-03-03 Nick Clifton <nickc@redhat.com>
5304
5305 * po/fi.po: New Finnish translation.
5306
2a0ff005
DK
53072010-03-01 Doug Kwan <dougkwan@google.com>
5308
5309 * layout.cc (Layout::Layout): Force section types of .init_array*,
5310 .preinit_array* and .fini_array* sections.
5311 * output.cc (Output_section::Input_section_sort_entry::has_priority):
5312 Fix check of return value of std::string::find.().
5313 (Output_section::Input_section_sort_compare::operator()): Remove
5314 comment about .init_array.
5315 (Output_section::Input_section_sort_init_fini_compare::operator()):
5316 New method.
5317 (Output_section::sort_attached_input_sections): Handle .init_array
5318 and .fini_array specially.
5319 * output.h (Output_section::Inut_section_sort_compare): Update
5320 comment.
5321 (Output_section::Input_section_sort_init_fini_compare): New struct.
5322
c3e4ae29
DK
53232010-02-26 Doug Kwan <dougkwan@google.com>
5324
5325 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
5326 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
5327 * testsuite/debug_msg.sh: Avoid matching source line number for
5328 use of global variable undef_int.
5329
2fd9ae7a
DK
53302010-02-26 Doug Kwan <dougkwan@google.com>
5331
5332 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
5333 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
5334 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
5335 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
5336 * options.cc (General_options::General_options): Initialize member
5337 fix_v4bx_.
5338 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
5339 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
5340 and rm_no_fix_v4bx.stdout
5341 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
5342 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
5343 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
5344 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
5345 and arm_no_fix_v4bx.
5346 * Makefile.in: Regenerate.
5347 * testsuite/arm_fix_v4bx.s: New file.
5348 * testsuite/arm_fix_v4bx.sh: Ditto.
5349
67ec7d0b
DK
53502010-02-24 Doug Kwan <dougkwan@google.com>
5351
5352 * arm.cc (Target_arm::got_section): Make the .got section the first
5353 non RELRO section in the data segment.
5354 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
5355 suffixes of section names.
5356
10165461
DK
53572010-02-24 Doug Kwan <dougkwan@google.com>
5358
5359 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
5360 flags and attributes merging if an input file is a binary file.
5361 * fileread.cc (Input_file::open): Record format of original file.
5362 * fileread.h (Input_file::Format): New enum type.
5363 (Input_file::Input_file): Initialize data member format_.
5364 (Input_file::format): New method definition.
5365 (Input_file::format_):: New data member.
5366
4a54abbb
DK
53672010-02-24 Doug Kwan <dougkwan@google.com>
5368
5369 * arm.cc (Arm_output_data_got): New class.
5370 (ARM_TCB_SIZE): New constant
5371 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
5372 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
5373 If user uses a script with a SECTIONS clause, issue only a warning
5374 for a misplaced EXIDX input section. Otherwise, issue an error.
5375 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
5376 garbage collection.
5377 (Target_arm::got_mode_index_entry): Handle static linking.
5378 (Target_arm::Scan::local): Ditto.
5379 (Target_arm::Scan::global): Ditto.
5380 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
5381 all incorrectly implemented relocations.
e1df38aa 5382 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
5383 Arm_output_section::fix_exidx_coverage.
5384 * layout.cc (Layout::section_name_mapping): Remove trailing dots
5385 from ".ARM.exidx." and ".ARM.extab.".
5386
ca419a6f
ILT
53872010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5388
5389 * arm.cc (Target_arm::do_finalize_sections): Create attribute
5390 section if it does not already exist.
5391 * attributes.cc (Attributes_section_data::Attributes_section_data):
5392 Don't crash if size is zero.
5393
135b9c78
ILT
53942010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5395 Ian Lance Taylor <iant@google.com>
5396
5397 * gold.cc (queue_middle_tasks): If no input files were opened,
5398 exit.
5399 * workqueue.h (Task_function::Task_function): Assert that there is
5400 a blocker.
5401
bb0bfe4f
DK
54022010-02-22 Doug Kwan <dougkwan@google.com>
5403
5404 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
5405 * icf.cc (get_section_contents): Cast snprintf arguments to long long
5406 types to avoid warnings due to different uint64_t implementations
5407 on different hosts.
5408
2a2b6d42
DK
54092010-02-21 Doug Kwan <dougkwan@google.com>
5410
5411 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
5412 handling of the maximum backward branch offset.
5413 (Arm_relocate_functions::thumb_branch_common): Ditto.
5414 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
5415 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 5416 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
5417 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
5418 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
5419 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
5420 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
5421 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
5422 thumb_bl_out_of_range thumb_bl_out_of_range.o,
5423 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
5424 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
5425 thumb2_bl_out_of_range.o): New rules.
5426 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
5427 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
5428 thumb2_bl_out_of_range
5429 * testsuite/Makefile.in: Regenerate.
5430 * testsuite/arm_bl_in_range.s: New file.
5431 * testsuite/arm_bl_out_of_range.s: Ditto.
5432 * testsuite/arm_branch_in_range.sh: Ditto.
5433 * testsuite/arm_branch_range.t: Ditto.
5434 * testsuite/thumb2_branch_range.t: Ditto.
5435 * testsuite/thumb_bl_in_range.s: Ditto.
5436 * testsuite/thumb_bl_out_of_range.s: Ditto.
5437 * testsuite/thumb_branch_range.t: Ditto.
5438
b487ad64
ST
54392010-02-20 Sriraman Tallam <tmsriram@google.com>
5440
5441 * gc.h (gc_process_relocs): Change vectors to point to the new list.
5442 Add reloc offset information.
5443 * icf.cc (get_section_contents): Change iterators to point to the new
5444 vectors. Add reloc offset information to the contents.
5445 * icf.h (Icf::Sections_reachable_info): New typedef.
5446 (Icf::Sections_reachable_list): New typedef.
5447 (Icf::Offset_info): New typedef.
5448 (Icf::Reloc_info): New struct typedef.
5449 (Icf::Reloc_info_list): New typedef.
5450 (Icf::symbol_reloc_list): Delete method.
5451 (Icf::addend_reloc_list): Delete method.
5452 (Icf::section_reloc_list): Delete method.
5453 (Icf::reloc_info_list): New method.
5454 (Icf::reloc_info_list_): New member.
5455
f96accdf
DK
54562010-02-19 Doug Kwan <dougkwan@google.com>
5457
5458 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
5459 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
5460 * arm.cc (Arm_relocation_functions): New forward declaration.
5461 (Target_arm::Target_arm): Initialize new data members
5462 got_mod_index_offset_ and tls_base_symbol_defined_.
5463 (Target_arm::Relocate::relocate_tls): New method.
5464 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
5465 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
5466 New methods.
5467 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
5468 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
5469 (Target_arm::got_mod_index_offset_,
5470 Target_arm::tls_base_symbol_defined_): New data members.
5471 (Target_arm::Scan::local, Target::Scan::global,
5472 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
5473 relocations.
5474
c8761b9a
DK
54752010-02-18 Doug Kwan <dougkwan@google.com>
5476
5477 * arm.cc (Arm_relobj::find_linked_text_section): New method.
5478 (Arm_relobj::make_exidx_input_section): Pass section index of linked
5479 text section as a parameter becuase some broken tools may not set
5480 the link in section header.
5481 (Target_arm::has_got_section): New method.
5482 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
5483 without any mapping symbol as data only. Remove warning.
5484 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
5485 link in its section header, try to discover the link by inspecting the
5486 REL31 relocation at the beginning of the section.
5487 (Target_arm::Scan::check_non_pic): Report name of offending relocation
5488 in error message.
5489 (Target_arm::Scan::global): Treat any reference to the symbol
5490 _GLOBAL_OFFSET_TABLE_ as a GOT access.
5491
21bb3914
ST
54922010-02-12 Sriraman Tallam <tmsriram@google.com>
5493
5494 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
5495 (Scan::global_reloc_may_be_function_pointer): New function.
5496 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
5497 (Scan::global_reloc_may_be_function_pointer): New function.
5498 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
5499 (Scan::global_reloc_may_be_function_pointer): New function.
5500 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
5501 (Scan::global_reloc_may_be_function_pointer): New function.
5502 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
5503 (Scan::global_reloc_may_be_function_pointer): New function.
5504 (Scan::possible_function_pointer_reloc): New function.
5505 (Target_x86_64::can_check_for_function_pointers): New function.
5506 * gc.h (gc_process_relocs): Scan relocation types to determine if
5507 function pointers were taken for targets that support it.
5508 * icf.cc (Icf::find_identical_sections): Include functions for
5509 folding in safe ICF whose pointer is not taken.
5510 * icf.h (Secn_fptr_taken_set): New typedef.
5511 (fptr_section_id_): New member.
5512 (section_has_function_pointers): New function.
5513 (set_section_has_function_pointers): New function.
5514 (check_section_for_function_pointers): New function.
5515 * options.h: Fix comment for safe ICF option.
5516 * target.h (can_check_for_function_pointers): New function.
5517 * testsuite/Makefile.am: Add icf_safe_so_test test case.
5518 Modify icf_safe_test for X86-64.
5519 * testsuite/Makefile.in: Regenerate.
5520 * testsuite/icf_safe_so_test.cc: New file.
5521 * testsuite/icf_safe_so_test.sh: New file.
5522 * testsuite/icf_safe_test.cc (kept_func_3): New function.
5523 (main): Change to take pointer to function kept_func_3.
5524 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
5525 folding is done correctly for X86-64.
5526
0da6fa6c
DM
55272010-02-12 David S. Miller <davem@davemloft.net>
5528
5529 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
5530 is_symbolless parameter.
5531 (Output_reloc<SHT_REL>::is_symbolless): New.
5532 (Output_reloc<SHT_REL>::is_symbolless_): New.
5533 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
5534 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
5535 (Output_reloc<SHT_RELA>::is_symbolless): New.
5536 (Output_data_reloc::add_global): Handle is_symbolless.
5537 (Output_data_reloc::add_global_relative): Likewise.
5538 (Output_data_reloc::add_local): Likewise.
5539 (Output_data_reloc::add_local_relative): Likewise.
5540 (Output_data_reloc::add_symbolless_global_addend): New.
5541 (Output_data_reloc::add_symbolless_local_addend): New.
5542 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
5543 is_symbolless.
5544 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
5545 instead of ->is_relative_
5546 (Output_reloc::write): Likewise.
5547 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
5548 (Output_reloc::write_rel): Simplify.
5549
5550 * sparc.cc (Target_sparc::Scan::local): Use
5551 ->add_symbolless_local_addend as needed.
5552 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
5553 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
5554 based upon relocation offset.
5555
e4782e83
DK
55562010-02-11 Doug Kwan <dougkwan@google.com>
5557
5558 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
5559 (Target_arm::Scan::global): Ditto. Also remove a comment before the
5560 beginning of function.
5561 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
5562 and MOVT_ABS relocations. Those are non issued in scanning. Fix
5563 parameter is_32bit in calls to should_apply_static_reloc.
5564 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
5565 (check_DATA): Add arm_abs_global.stdout.
5566 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
5567 arm_abs_global.stdout): New rules.
5568 (MOSTLLYCLEANFILES): Add arm_abs_global
5569 * Makefile.in: Regenerate.
5570 * testsuite/arm_abs_global.s: New file.
5571 * testsuite/arm_abs_global.sh: Ditto.
5572 * testsuite/arm_abs_lib.s: Ditto.
5573
93ceb764
ILT
55742010-02-11 Ian Lance Taylor <iant@google.com>
5575
5576 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
5577 Read_relocs task.
5578 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
5579 Allocate_commons_task first.
5580 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
5581 task, rather than symtab_lock_.
5582 (Gc_process_relocs::~Gc_process_relocs): New function.
5583 (Gc_process_relocs::is_runnable): Check this_blocker_.
5584 (Gc_process_relocs::locks): Use next_blocker_ rather than
5585 blocker_.
5586 (Scan_relocs::~Scan_relocs): New function.
5587 (Scan_relocs::is_runnable): Check this_blocker_ rather than
5588 symtab_lock_.
5589 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
5590 next_blocker_.
5591 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
5592 fields. Add this_blocker_ and next_blocker_ fields. Adjust
5593 constructor accordingly.
5594 (class Gc_process_relocs): Likewise.
5595 (class Scan_relocs): Likewise.
5596 * common.h (class Allocate_commons_task): Remove symtab_lock_
5597 field, and corresponding constructor parameter.
5598 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
5599 symtab_lock_.
5600 (Allocate_commons_task::locks): Likewise.
5601
114dfbe1
ILT
56022010-02-11 Ian Lance Taylor <iant@google.com>
5603
5604 * gold-threads.h (class Once): Define.
5605 (class Initialize_lock): Rewrite as child of Once.
5606 * gold-threads.cc (class Once_initialize): Define.
5607 (once_pointer_control): New static variable.
5608 (once_pointer, once_arg): New static variables.
5609 (c_run_once): New static function.
5610 (Once::Once, Once::run_once, Once::internal_run): New functions.
5611 (class Initialize_lock_once): Remove.
5612 (initialize_lock_control): Remove.
5613 (initialize_lock_pointer): Remove.
5614 (initialize_lock_once): Remove.
5615 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
5616 (Initialize_lock::initialize): Rewrite.
5617 (Initialize_lock::do_run_once): New function.
5618 * archive.cc (Archive::interpret_header): Only clear name if it is
5619 not already empty.
5620 * fileread.cc: Include "gold-threads.h"
5621 (file_counts_lock): New static variable.
5622 (file_counts_initialize_lock): Likewise.
5623 (File_read::release): Only increment counts when using --stats.
5624 Use a lock around the increment.
5625 * parameters.cc (class Set_parameters_target_once): Define.
5626 (set_parameters_target_once): New static variable.
5627 (Parameters::Parameters): Move here from parameters.h.
5628 (Parameters::set_target): Rewrite.
5629 (Parameters::set_target_once): New function.
5630 (Parameters::clear_target): Move here and rewrite.
5631 * parameters.h (class Parameters): Update declarations. Add
5632 set_parameters_target_once_ field.
5633 (Parameters::Parameters): Move to parameters.cc.
5634 (Parameters::clear_target): Likewise.
5635 * readsyms.cc (Read_symbols::do_group): Create a Start_group
5636 task.
5637 (Start_group::~Start_group): New function.
5638 (Start_group::is_runnable): New function.
5639 (Start_group::locks, Start_group::run): New functions.
5640 (Finish_group::run): Change saw_undefined to size_t.
5641 * readsyms.h (class Start_group): Define.
5642 (class Finish_group): Change saw_undefined_ field to size_t.
5643 (Finish_group::Finish_group): Remove saw_undefined and
5644 this_blocker parameters. Change all callers.
5645 (Finish_group::set_saw_undefined): New function.
5646 (Finish_group::set_blocker): New function.
5647 * symtab.h (class Symbol_table): Change saw_undefined to return
5648 size_t. Change saw_undefined_ field to size_t.
5649 * target-select.cc (Set_target_once::do_run_once): New function.
5650 (Target_selector::Target_selector): Initialize set_target_once_
5651 field. Don't initialize lock_ and initialize_lock_ fields.
5652 (Target_selector::instantiate_target): Rewrite.
5653 (Target_selector::set_target): New function.
5654 * target-select.h (class Set_target_once): Define.
5655 (class Target_selector): Update declarations. Make
5656 Set_target_once a friend. Remove lock_ and initialize_lock_
5657 fields. Add set_target_once_ field.
5658
fa17a3f4
ILT
56592010-02-10 Ian Lance Taylor <iant@google.com>
5660
5661 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
5662 queueing any tasks.
5663 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
5664 (queue_middle_tasks): Add all blockers before queueing any tasks.
5665 (queue_final_tasks): Likewise.
5666 * token.h (Task_token::add_blockers): New function.
5667 * object.h (Input_objects::number_of_relobjs): New function.
5668
c7177d31
ILT
56692010-02-10 Ian Lance Taylor <iant@google.com>
5670
5de0e392
ILT
5671 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
5672 shared, not if not position independent.
5673 * x86_64.cc (Relocate::relocate_tls): Likewise.
5674 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
5675 (tls_pie_pic_test): New target.
5676 * testsuite/Makefile.in: Rebuild.
5677
c7177d31
ILT
5678 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
5679 (tls_test_main_pie.o, tls_test_pie.o): New targets.
5680 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
5681 * testsuite/Makefile.in: Rebuild.
5682
684b268a
DM
56832010-02-09 David S. Miller <davem@davemloft.net>
5684
5685 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
5686 R_SPARC_RELATIVE using ->add_local_relative().
5687 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
5688
612a8d3d
DM
5689 * output.h (Output_data_dynamic::add_section_size): New method
5690 that takes two Output_data objects.
5691 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
5692 entry param. Handle it in initializers.
5693 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
5694 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
5695 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
5696 arg.
5697 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
5698 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
5699 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
5700 for dynrel_includes_plt.
5701 * i386.cc (Target_i386::do_finalize_sections): Likewise.
5702 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5703 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
5704 before .rela.plt
5705 (Target_sparc::do_finalize_sections): Update to pass true for
5706 dynrel_includes_plt.
5707 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
5708 output before .rela.plt
5709 (Target_powerpc::do_finalize_sections): Update to pass true for
5710 dynrel_includes_plt when 32-bit.
5711
cb1be87e
DK
57122010-02-08 Doug Kwan <dougkwan@google.com>
5713
5714 * arm.cc (Arm_relobj::simple_input_section_output_address): New
5715 method.
5716 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
5717 Arm_relobj::scan_section_for_cortex_a8_stubs,
5718 Arm_relobj::do_relocation_section): Instead of calling
5719 Output_section::output_address, use faster
5720 Arm_relobj::simple_input_section_output_address.
5721
705b5121
DM
57222010-02-08 David S. Miller <davem@davemloft.net>
5723
5724 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
5725 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
5726 relocation helper function.
5727
024c4466
DM
5728 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
5729 just like R_SPARC_GOT{10,13,22}.
5730 (Target_sparc::Scan::local): Likewise.
5731 (Target_sparc::Relocate:relocate): Likewise.
5732
9109c078
ILT
57332010-02-06 Ian Lance Taylor <iant@google.com>
5734
5735 * configure.ac: Rewrite targetobjs duplicate removal code to use
5736 only shell constructs.
5737 * configure: Rebuild.
5738
cf846138
DK
57392010-02-05 Doug Kwan <dougkwan@google.com>
5740
5741 PR 11247
5742 * arm.cc (Arm_relobj::section_is_scannable): New method.
5743 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
5744 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
5745
6cfaf60b
DK
57462010-02-04 Doug Kwan <dougkwan@google.com>
5747
5748 PR 11247
5749 * arm-reloc-property.cc (cstdio): Include.
5750 * configure.ac (targetobjs): Remove duplicates.
5751 * configure: Regenerate.
5752 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
5753 big and little endian version for a given address size.
5754
5c57f1be
DK
57552010-02-03 Doug Kwan <dougkwan@google.com>
5756
5757 * arm-reloc-property.cc
5758 (Arm_reloc_property_table::reloc_name_in_error_message): New method
5759 definition.
5760 * arm-reloc-property.h
5761 (Arm_reloc_property_table::get_implemented_static_reloc_property):
5762 New method definition.
5763 (Arm_reloc_property_table::reloc_name_in_error_message): New method
5764 declaration.
5765 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
5766 overflow to N.
5767 (GOT_PREL): Change implemented to Y.
5768 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
5769 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
5770 (Arm_relocate_functions::movw_abs_nc): Remove method.
5771 (Arm_relocate_functions::movt_abs): Ditto.
5772 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
5773 (Arm_relocate_functions::thm_movt_abs): Ditto.
5774 (Arm_relocate_functions::movw_rel_nc): Ditto.
5775 (Arm_relocate_functions::movw_rel): Ditto.
5776 (Arm_relocate_functions::movt_rel): Ditto.
5777 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
5778 (Arm_relocate_functions:thm_movw_rel): Ditto.
5779 (Arm_relocate_functions:thm_movt_rel): Ditto.
5780 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
5781 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
5782 New method definitions.
5783 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
5784 (Arm_relocation_functions::arm_grp_ldr): Ditto.
5785 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
5786 (Arm_relocation_functions::arm_grp_ldc): Ditto.
5787 (Target_arm::Relocate::relocate): Check for non-static or
5788 unimplemented relocation code and exit early. Change calls to
5789 Target_arm::reloc_uses_thumb_bit and
5790 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
5791 instead. Refactor code to handle similar relocations to increase
5792 code sharing. Remove check for unsupported relocation code in switch
5793 statement.
5794 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
5795 relocation property table to find out size. Change error message to
5796 print out the name of a relocation code instead of the numeric value.
5797 (Target_arm::scan_reloc_for_stub): Use relocation property table
5798 instead of calling Target_arm::reloc_uses_thumb_bit().
5799
218c5831
DK
58002010-02-02 Doug Kwan <dougkwan@google.com>
5801
5802 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
5803 types of relaxed input section.
5804
0d31c79d
DK
58052010-02-02 Doug Kwan <dougkwan@google.com>
5806
5807 * Makefile.am (HFILES): Add arm-reloc-property.h.
5808 (DEFFILES): New.
5809 (TARGETSOURCES): Add arm-reloc-property.cc
5810 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
5811 (libgold_a_SOURCES): $(DEFFILES)
5812 * Makefile.in: Regenerate.
5813 * arm-reloc-property.cc: New file.
5814 * arm-reloc-property.h: New file.
5815 * arm-reloc.def: New file.
5816 * arm.cc: Update comments.
5817 (arm-reloc-property.h): New included header.
5818 (arm_reloc_property_table): New global variable.
5819 (Target_arm::do_select_as_default_target): New method definition.
5820 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
5821 arm-reloc-property to targ_extra_obj.
5822 * parameters.cc (set_parameters_target): Call
5823 Target::select_as_default_target().
5824 * target.h (Target::select_as_default_target): New method definition.
5825 (Target::do_select_as_default_target): Same.
5826
546c7457
DK
58272010-02-01 Doug Kwan <dougkwan@google.com>
5828
5829 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
5830 first_output_text_section_.
5831 (Arm_exidx_fixup::first_output_text_section): New method definition.
5832 (Arm_exidx_fixup::first_output_text_section_): New data member.
5833 (Arm_exidx_fixup::process_exidx_section): Record the first text
5834 output section seen.
5835 (Arm_output_section::fix_exidx_coverage): Set correct linked section
5836 and entsize in output section header.
5837
11b861d5
DK
58382010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5839
5840 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
5841 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
5842 (Arm_relocate_functions::thm_alu11): New Method.
5843 (Arm_relocate_functions::thm_pc8): New Method.
5844 (Arm_relocate_functions::thm_pc12): New Method.
5845 (Target_arm::Scan::local): Handle the relocations.
5846 (Target_arm::Scan::global): Likewise.
5847 (Target_arm::Relocate::relocate): Likewise.
5848 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
5849
c9a2c125
DK
58502010-01-29 Doug Kwan <dougkwan@google.com>
5851
5852 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
5853 of relocation types as ld.
5854
1521477a
DK
58552010-01-29 Doug Kwan <dougkwan@google.com>
5856
5857 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
5858 to public.
5859 (Arm_relocate_functions::thumb_branch_common): Ditto.
5860 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
5861 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
5862 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
5863 Arm_relocate_functions::jump24): Remove.
5864 (Target_arm::Relocate::relocate): Adjust code to call
5865 Arm_relocation_functions::arm_branch_common and
5866 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 5867 wrappers. Merge switch-cases together to reduce source code size.
1521477a 5868
e7eca48c
DK
58692010-01-29 Doug Kwan <dougkwan@google.com>
5870
5871 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
5872 output_local_symbol_count_needs_update_.
5873 (Arm_relobj::output_local_symbol_count_needs_update,
5874 Arm_relobj::set_output_local_symbol_count_needs_update,
5875 Arm_relobj::update_output_local_symbol_count): New methods.
5876 (Arm_relobj::output_local_symbol_count_needs_update_): New data
5877 member.
5878 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
5879 of pointed function as in a R_ARM_PREL31 relocation.
5880 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
5881 for output local symbol count updating.
5882 (Target_arm::do_relax): Update output local symbol counts in objects
5883 if necessary.
5884 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
5885
02961d7e
ILT
58862010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5887
5888 * arm.cc: Added support for the ARM relocations:
5889 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
5890 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
5891 (Arm_relocate_functions::movw_rel_nc): Renamed (was
5892 movw_prel_nc).
5893 (Arm_relocate_functions::movw_rel): New method.
5894 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
5895 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
5896 thm_movw_prel_nc).
5897 (Arm_relocate_functions::thm_movw_rel): New method.
5898 (Arm_relocate_functions::thm_movt_rel): Renamed (was
5899 thm_movt_prel).
5900 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
5901 relocations.
5902 (Target_arm::Scan::global): Likewise.
5903 (Target_arm::Relocate::relocate): Likewise.
5904 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5905 Likewise.
5906
b10d2873
ILT
59072010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5908
5909 * arm.cc: Added support for ARM group relocations.
5910 (Target_arm::reloc_needs_sym_origin): New method.
5911 (Arm_relocate_functions::calc_grp_kn): New method.
5912 (Arm_relocate_functions::calc_grp_residual): New method.
5913 (Arm_relocate_functions::calc_grp_gn): New method.
5914 (Arm_relocate_functions::arm_grp_alu): New Method.
5915 (Arm_relocate_functions::arm_grp_ldr): New Method.
5916 (Arm_relocate_functions::arm_grp_ldrs): New Method.
5917 (Arm_relocate_functions::arm_grp_ldc): New Method.
5918 (Target_arm::Scan::local): Handle the ARM group relocations.
5919 (Target_arm::Scan::global): Likewise.
5920 (Target_arm::Relocate::relocate): Likewise.
5921 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5922 Likewise.
5923
2b328d4e
DK
59242010-01-26 Doug Kwan <dougkwan@google.com>
5925
5926 * arm.cc (set): Include.
5927 (class Arm_exidx_fixup): Change type of last_input_section_ to const
5928 pointer type.
5929 (Arm_output_section::Text_section_list): New type.
5930 (Arm_output_section::append_text_sections_to_list): New method.
5931 (Arm_output_section::fix_exidx_coverage): Ditto.
5932 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
5933 (Arm_relobj::convert_input_section_to_relaxed_section): Use
5934 Relobj::set_section_offset() instead of
5935 Sized_relobj::invalidate_section_offset().
5936 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
5937 parameter for section headers. Ignore relocation sections for
5938 unallocated sections and EXIDX sections.
5939 (Target_arm::fix_exidx_coverage): New method.
5940 (Target_arm::output_section_address_less_than): New type.
5941 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
5942 linked text section instead of the EXIDX section.
5943 (Arm_output_section::create_stub_group): Add an assertion to check
5944 that this is not an EXIDX output section.
5945 (Arm_output_section::append_text_sections_to_list): New method.
5946 (Arm_output_section::fix_exidx_coverage): Ditto.
5947 (Arm_relobj::scan_sections_for_stubs): Adjust call to
5948 Arm_relobj::section_needs_reloc_stub_scanning.
5949 (Target_arm::do_relax): Fix EXIDX output section coverage in the
5950 first pass.
5951 (Target_arm::fix_exidx_coverage): New method.
5952 * object.h (Relobj::set_output_section): New method.
5953 (Sized_relobj::invalidate_section_offset): Remove method.
5954 (Sized_relobj::do_invalidate_section_offset): Remove method.
5955 (Sized_relobj::do_set_section_offset): Handle offset value -1.
5956
c7f3c371
DK
59572010-01-25 Doug Kwan <dougkwan@google.com>
5958
5959 * arm.cc (Arm_exidx_merged_section::do_output_offset):
5960 Fix warning due to signed and unsigned comparison on a 32-bit host.
5961
8923b24c
DK
59622010-01-22 Doug Kwan <dougkwan@google.com>
5963
5964 * arm.cc (Target_arm::do_relax): Record an output section for section
5965 offset adjustment it contains any stub table that has changed.
5966 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
5967 offsets in an output section if necessary.
5968 * output.cc (Output_section::Output_section): Initialize
5969 section_offsets_need_adjustments_.
5970 (Output_section::add_input_section_for_script): Renamed to
5971 Output_section::add_simple_input_section.
5972 (Output_section::save_states): Add a comment.
5973 (Output_section::discard_states): New method defintion.
5974 (Output_section::adjust_section_offsets): Same.
5975 * output.h (Output_section::add_input_section_for_script): Renamed to
5976 Output_section::add_simple_input_section.
5977 (Output_section::discard_states): New method declaration.
5978 (Output_section::adjust_section_offsets): Same.
5979 (Output_section::section_offsets_need_adjustment,
5980 Output_section::set_section_offsets_need_adjustment): New method
5981 definitions.
5982 (Output_section::section_offsets_need_adjustment_): New data member.
5983 * script-sections.cc
5984 (Output_section_element_input::set_section_address): Adjust code for
5985 renaming of Output_section::add_input_section_for_script.
5986 (Orphan_output_section::set_section_address): Same.
5987
9b2fd367
DK
59882010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5989
5990 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
5991 Fix_v4bx enum values .
5992 * gold/options.h (General_options): New option definitions.
5993 (General_options::fix_v4bx): New method.
5994 (General_options::Fix_v4bx): New enum.
5995 * gold/options.cc (General_options::parse_fix_v4bx): New method.
5996 (General_options::parse_fix_v4bx_interworking): New method.
5997
80d0d023
DK
59982010-01-22 Doug Kwan <dougkwan@google.com>
5999
6000 * arm.cc (Arm_exidx_fixup): New class.
6001
af2cdeae
DK
60022010-01-21 Doug Kwan <dougkwan@google.com>
6003
6004 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
6005 classes.
6006 (Arm_exidx_section_offset_map): New type.
6007
993d07c1
DK
60082010-01-21 Doug Kwan <dougkwan@google.com>
6009
6010 * arm.cc (Arm_exidx_input_section): New class.
6011 (Arm_relobj::exidx_input_section_by_link,
6012 Arm_relobj::exidx_input_section_by_shndx,
6013 Arm_relobj::make_exidx_input_section): New methods.
6014 (read_arm_attributes_section): Remove.
6015 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
6016 information about them.
6017 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
6018 to here.
6019
5ac169d4
DK
60202010-01-20 Doug Kwan <dougkwan@google.com>
6021
6022 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
6023 Input_section_specifier to Section_id.
6024 (Target_arm::new_arm_input_section: Adjust code for change of key
6025 type.
6026 (Target_arm::find_arm_input_section): Ditto.
6027 * gc.h (object.h): Include for Section_id nand Section_id_hash.
6028 (Section_id): Remove.
6029 (Garbage_collection::Section_id_hash): Remove.
6030 * icf.h (object.h): Include for Section_id nand Section_id_hash.
6031 (Section_id): Remove.
6032 (Icf::Section_id_hash): Remove.
6033 * object.h (Section_id, Const_section_id, Section_id_hash,
6034 Const_section_id_hash): New type definitions.
6035 * output.cc (Output_section::add_relaxed_input_section): Change to
6036 use Const_section_id instead of Input_section_specifier as key type.
6037 (Output_section::add_merge_input_section): Ditto.
6038 (Output_section::build_relaxation_map): Change to use Section_id
6039 instead of Input_section_specifier as key type.
6040 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6041 Ditto.
6042 (Output_section::convert_input_sections_to_relaxed_sections): Change
6043 to use Const_section_id instead of Input_section_specifier as key type.
6044 (Output_section::find_merge_section): Ditto.
6045 (Output_section::find_relaxed_input_section): Ditto.
6046 * output.h (Input_section_specifier): Remove class.
6047 (Output_section::Output_section_data_by_input_section_map): Change
6048 key type to Const_section_id.
6049 (Output_section::Output_relaxed_input_section_by_input_section_map):
6050 Ditto.
6051 (Output_section::Relaxation_map): Change key type to Section_id.
6052
a2162063
ILT
60532010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6054
6055 * gold/arm.cc: Added support for R_ARM_V4BX relocation
6056 (class Arm_v4bx_stub): New class.
6057 (DEF_STUBS): Updated definition to support v4_veneer_bx.
6058 (Stub_factory::make_arm_v4bx_stub): New method.
6059 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
6060 (Stub_table::empty): Handle v4bx stubs.
6061 (Stub_table::add_arm_v4bx_stub): New method.
6062 (Stub_table::find_arm_v4bx_stub): New method.
6063 (Arm_relocate_functions::v4bx): New method.
6064 (Target_arm::fix_v4bx): New method.
6065 (Target_arm::Target_arm): Handle R_ARM_V4BX.
6066 (Stub_table::relocate_stubs): Likewise.
6067 (Stub_table::do_write): Likewise.
6068 (Stub_table::update_data_size_and_addralign): Likewise.
6069 (Stub_table::finalize_stubs): Likewise.
6070 (Target_arm::Scan::local): Likewise.
6071 (Target_arm::Scan::global): Likewise.
6072 (Target_arm::do_finalize_sections): Likewise.
6073 (Target_arm::Relocate::relocate): Likewise.
6074 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6075 Likewise.
6076 (Target_arm::scan_reloc_for_stub): Likewise.
6077 (Target_arm::scan_reloc_section_for_stubs): Likewise.
6078
5696ab0b
ILT
60792010-01-19 Ian Lance Taylor <iant@google.com>
6080
6081 * output.cc (Output_section_headers::do_sized_write): Write large
6082 segment count to sh_info field.
6083 (Output_file_header::do_sized_write): For large segment count,
6084 write PN_XNUM to e_phnum field.
6085
800d0f56
ILT
60862010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6087
6088 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
6089 (Arm_relocate_functions::thm_jump8): New function.
6090 (Arm_relocate_functions::thm_jump11): New function.
6091 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
6092 R_ARM_THM_JUMP11.
6093 (Target_arm::Scan::global): Likewise.
6094 (Target_arm::Relocate::relocate): Likewise.
6095 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6096 Likewise.
6097
41263c05
DK
60982010-01-14 Doug Kwan <dougkwan@google.com>
6099
6100 * arm.cc (map, utility): Include headers.
6101 (Target_arm::apply_cortex_a8_workaround): New method.
6102 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
6103 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
6104 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
6105 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
6106 the --[no-]fix-cortex-a8 command line options.
6107 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
6108 (Target_arm::relocate_stub): Use addend in instruction template.
6109 * options.h (DEFINE_bool): Set the user-set flag.
6110 (General_options): Add --[no-]-fix-cortex options.
6111 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 6112 : Update fast look-up map after conversion.
41263c05 6113
459e9b03
ST
61142010-01-14 Sriraman Tallam <tmsriram@google.com>
6115
6116 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
6117 in the first pass of do_layout.
6118
b521dfe4
DK
61192010-01-13 Doug Kwan <dougkwan@google.com>
6120
6121 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
6122 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
6123 apparent compiler problem of not folding static constant integral
6124 data members of elfcpp::Elf_sizes<32>.
6125
44272192
DK
61262010-01-13 Doug Kwan <dougkwan@google.com>
6127
6128 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
6129 Arm_relobj::section_needs_cortex_a8_stub_scanning,
6130 Arm_relobj::scan_section_for_cortex_a8_erratum,
6131 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
6132 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
6133 sections to scan for relocation stubs into a new method
6134 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
6135 relocation and Cortex-A8 stub scanning.
6136 (Target_arm::do_relax): Force stubs to be after stubbed sections
6137 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 6138 the beginning of a new relaxation pass. Update a comment.
44272192
DK
6139 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
6140
44b71ece
ILT
61412010-01-12 Ian Lance Taylor <iant@google.com>
6142
6143 * target-reloc.h (visibility_error): New inline function.
6144 (relocate_section): Call visibility_error.
6145 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
6146 (MOSTLYCLEANFILES): Likewise.
6147 (protected_4_pic.o, protected_3.err): New targets.
6148 * testsuite/protected_4.cc: New file.
6149
a120bc7f
DK
61502010-01-12 Doug Kwan <dougkwan@google.com>
6151
6152 * arm.cc (Cortex_a8_reloc): New class.
6153 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
6154 and cortex_a8_relocs_info_.
6155 (Target_arm::fix_cortex_a8): New method definition.
6156 (Target_arm::Cortex_a8_relocs_info): New type.
6157 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
6158 New data member declarations.
6159 (Target_arm::scan_reloc_for_stub): Record information about
6160 relocations for THUMB branches that might be exempted from the
6161 Cortex-A8 workaround.
6162 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
6163 at the beginning of a relaxation pass.
6164
20138696
DK
61652010-01-12 Doug Kwan <dougkwan@google.com>
6166
6167 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
6168 (Arm_relobj::Mapping_symbol_position,
6169 Arm_reloj::Mapping_symbol_position_less,
6170 Arm_relobj::Mapping_symbols_info): New types.
6171 (Target_arm::is_mapping_symbol_name): New method definition.
6172 (Arm_relobj::do_count_local_symbols): Save information about mapping
6173 symbols.
6174
089d69dc
DK
61752010-01-11 Doug Kwan <dougkwan@google.com>
6176
6177 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
6178 Arm_relocate_functions::thumb32_branch_upper,
6179 Arm_relocate_functions::thumb32_branch_lower,
6180 Arm_relocate_functions::thumb32_cond_branch_offset,
6181 Arm_relocate_functions::thumb32_cond_branch_upper,
6182 Arm_relocate_functions::thumb32_cond_branch_lower,
6183 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
6184 branch offset encoding.
6185 (Arm_relocate_functions::thumb_branch_common): Use new branch
6186 offset encoding methods to avoid code duplication.
6187 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
6188 (Stub_addend_reader::operator()): Use new branch encoding method
6189 to avoid code duplication.
6190
99e5bff2
DK
61912010-01-11 Doug Kwan <dougkwan@google.com>
6192
6193 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
6194 (Target_arm::do_finalize_sections): Define special EXIDX section
6195 symbols only if referenced.
6196 * gc.h (Garbage_collection::add_reference): New method.
6197 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
6198 code duplication.
6199
98e090bd
ILT
62002010-01-11 Ian Lance Taylor <iant@google.com>
6201
d0a91bd8
ILT
6202 * script.cc (Version_script_info::build_expression_list_lookup):
6203 Change complaing about duplicate wildcard match from error to
6204 warning.
6205
98e090bd
ILT
6206 * script.cc (class Lazy_demangler): Recreate--revert part of patch
6207 of 2009-12-30.
6208 (Version_script_info::Version_script_info): Initialize globs_,
6209 default_version_, default_is_global_, and exact_. Don't
6210 initialize globals_ or locals_.
6211 (Version_script_info::build_lookup_tables): Build local symbols
6212 first.
6213 (Version_script_info::unquote): New function.
6214 (Version_script_info::add_exact_match): New function.
6215 (Version_script_info::build_expression_list_lookup): Remove lookup
6216 parameter. Add is_global parameter. Change all callers. Handle
6217 wildcard pattern specially. Unquote pattern. Call
6218 add_exact_match.
6219 (Version_script_info::get_name_to_match): New function.
6220 (Version_script_info::get_symbol_version): New function.
6221 (Version_script_info::get_symbol_version_helper): Remove.
6222 (Version_script_info::check_unmatched_names): Call unquote.
6223 * script.h (class Version_script_info): Change get_symbol_version
6224 to be non-inline and add is_global parameter; change all callers.
6225 Rewrite symbol_is_local. Update declarations. Define struct
6226 Version_tree_match, Exact, Globs. Don't define struct Lookup.
6227 Remove globals_ and locals_ members. Add exact_, globs_,
6228 default_version_, is_global_.
6229 (Version_script_info::Glob): Remove pattern, add expression and
6230 is_global. Update constructor. Change all callers.
6231 * dynobj.cc (Versions::finalize): Mark the version symbol as the
6232 default version.
6233 (Versions::symbol_section_contents): If a symbol is undefined, or
6234 defined in a dynamic object, set the version index to
6235 VER_NDX_LOCAL.
6236 * symtab.cc (Symbol_table::add_from_relobj): Don't call
6237 symbol_is_local.
6238 (Symbol_table::add_from_pluginobj): Likewise.
6239 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
6240
d56962d3
DK
62412010-01-11 Doug Kwan <dougkwan@google.com>
6242
6243 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
6244 (incremental_dump_LDADD): Add linking option for libintl.
6245 * Makefile.in: Regenerate.
6246
94e6ee91
L
62472010-01-11 H.J. Lu <hongjiu.lu@intel.com>
6248
6249 PR gold/11144
6250 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
6251 instead of -Ds.
6252 * testsuite/Makefile.in: Regenerated.
6253
e96c574b
DK
62542010-01-10 Doug Kwan <dougkwan@google.com>
6255
6256 * options.h (DEFINE_var): Use parentheses around argument varname__
6257 in macro body to avoid any unintended subsequent substitutions.
6258
7198066b
ILT
62592010-01-10 Ian Lance Taylor <iant@google.com>
6260
ba4d53bf
ILT
6261 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
6262 candidates before doing symbol resolution.
6263
7198066b
ILT
6264 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
6265 ODR candidates if only one is weak.
6266
a2beed37
ILT
62672010-01-08 Ian Lance Taylor <iant@google.com>
6268
6269 * script.cc (Version_script_info::build_expression_list_lookup):
6270 Don't warn about ambiguous version, just record the ambiguity.
6271 (Version_script_info::get_symbol_version_helper): Give error if
6272 version is ambiguous.
6273
2fb7225c
DK
62742010-01-08 Doug Kwan <dougkwan@google.com>
6275
6276 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
6277 prev_data_size_ and prev_addralign_. Remove initializer for
6278 deleted data member has_been_changed_.
6279 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
6280 to determine if the table is empty.
6281 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
6282 Remove.
6283 (Stub_table::add_reloc_stub): Define method in class definition
6284 instead of just declaring it there.
6285 (Stub_table::add_cortex_a8_stub): New method definition.
6286 (Stub_table::update_data_size_and_addralign): Ditto.
6287 (Stub_table::finalize_stubs): Ditto.
6288 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
6289 (Stub_table::do_addralign_): Return address alignment in the
6290 (Stub_table::do_reset_address_and_file_offset): Define method in
6291 class definition instead of declaring it there. Set current data
6292 size to be the data size of the previous pass.
6293 (Stub_table::set_final_data_size): Use current data size as the
6294 final data size.
6295 (Stub_table::relocate_stub): Change parameter type of stub from
6296 Reloc_stub pointer to Stub pointer.
6297 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
6298 (Stub_table::Cortex_a8_stub_list): New typedef.
6299 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
6300 Stub_table::prev_addralign_): New data member.
6301 (Arm_relobj::Arm_relobj): Initialize data member
6302 section_has_cortex_a8_workaround_.
6303 (Arm_relobj::section_has_cortex_a8_workaround,
6304 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
6305 definitions.
6306 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
6307 declarations.
6308 (Target_arm::relocate_stub): Change parameter type of stub from
6309 Reloc_stub pointer to Stub pointer.
6310 (Insn_template::size, Insn_template::alignment): Handle
6311 THUMB16_SPECIAL_TYPE.
6312 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
6313 Stub_table::update_data_size_and_addralign,
6314 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
6315 definitions.
6316 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
6317 (Stub_table::do_write): Ditto.
6318 (Target_arm::do_relax): Adjust code for changes in Stub_table.
6319
880cd20d
ILT
63202010-01-08 Ian Lance Taylor <iant@google.com>
6321
6322 PR 11108
6323 * symtab.h (class Symbol): Remove fields is_target_special_ and
6324 has_plt_offset_. Add field is_defined_in_discarded_section_.
6325 (Symbol::is_defined_in_discarded_section): New function.
6326 (Symbol::set_is_defined_in_discarded_section): New function.
6327 (Symbol::has_plt_offset): Rewrite.
6328 (Symbol::set_plt_offset): Verify that new offset is not -1U.
6329 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
6330 Don't initialize is_target_special_ or has_plt_offset_.
6331 Initialize is_defined_in_discarded_section_.
6332 (Symbol_table::add_from_relobj): If appropriate, set
6333 is_defined_in_discarded_section.
6334 * resolve.cc (Symbol::override_base_with_special): Don't test
6335 is_target_special_. Change has_plt_offset_ to has_plt_offset().
6336 * target-reloc.h (relocate_section): Do special handling for
6337 symbols defined in discarded sections for global symbols as well
6338 as local symbols.
6339
2703e3eb
ILT
63402010-01-08 Ian Lance Taylor <iant@google.com>
6341
6342 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
6343 the SHT_SYMTAB case.
6344
339d40a3
ILT
63452010-01-08 Ian Lance Taylor <iant@google.com>
6346
6347 * object.cc (Sized_relobj::do_layout): Don't get confused if
6348 layout_eh_frame returns NULL.
6349
abecea76
ILT
63502010-01-08 Ian Lance Taylor <iant@google.com>
6351
6352 PR 11084
6353 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
6354 dynamic symbol table, use the normal symbol table.
6355 (Sized_dynobj::do_read_symbols): Remove assertion about type of
6356 symbol table.
6357
6b7dd3f3
ILT
63582010-01-08 Ian Lance Taylor <iant@google.com>
6359
6360 PR 11072
6361 * layout.cc (Layout::include_section): Remove .gnu_debuglink
6362 sections.
6363
36c50e63
L
63642010-01-08 H.J. Lu <hongjiu.lu@intel.com>
6365
6366 * version.cc (print_version): Change to "Copyright 2010".
6367
e291e7b9
ILT
63682010-01-08 Ian Lance Taylor <iant@google.com>
6369
6370 PR 10287
6371 PR 11063
6372 * i386.cc (class Target_i386): Change return type of plt_section
6373 to be non-const.
6374 (class Output_data_plt_i386): Add tls_desc_rel_ field.
6375 (Output_data_plt_i386::Output_data_plt_i386): Initialize
6376 tls_desc_rel_ field.
6377 (Output_data_plt_i386::rel_tls_desc): New function.
6378 (Target_i386::rel_tls_desc_section): New function.
6379 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
6380 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
6381 R_386_TLS_DESC reloc in rel_tls_desc_section.
6382 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
6383 Define struct Tlsdesc_info.
6384 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
6385 (Target_x86_64::do_reloc_symbol_index): New function.
6386 (Target_x86_64::add_tlsdesc_info): New function.
6387 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
6388 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
6389 tlsdesc_rel_ field.
6390 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
6391 all callers.
6392 (Output_data_plt_x86_64::rela_tlsdesc): New function.
6393 (Target_x86_64::rela_tlsdesc_section): New function.
6394 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
6395 handling.
6396 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
6397 (Target_x86_64::do_reloc_addend): New function.
6398 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
6399 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
6400 declarations. Define TARGET_CODE. Add arg field to u1_ union.
6401 (Output_reloc::type): New function.
6402 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
6403 (Output_reloc::is_target_specific): New function.
6404 (Output_reloc::target_arg): New function.
6405 (class Output_reloc) [SHT_RELA]: Add four new constructors for
6406 absolute relocs and target specific relocs.
6407 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
6408 add_target_specific.
6409 (class Output_data_reloc) [SHT_RELA]: Likewise.
6410 * output.cc (Output_reloc::Output_reloc): Add four new versions
6411 for absolute relocs and target specific relocs.
6412 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
6413 (Output_reloc::get_symbol_index): Likewise.
6414 (Output_reloc::local_section_offset): Check that local_sym_index_
6415 is not TARGET_CODE or 0.
6416 (Output_reloc::symbol_value): Likewise.
6417 (Output_reloc::write) [SHT_RELA]: Call target for target specific
6418 reloc.
6419 * target.h (class Target): Add reloc_symbol_index and reloc_addend
6420 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
6421 functions.
6422 * layout.cc (add_target_dynamic_tags): Use output section for
6423 DT_PLTRELSZ and DT_JMPREL.
6424
3a44184e
ILT
64252010-01-07 Ian Lance Taylor <iant@google.com>
6426
6427 PR 11061
6428 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
6429 function.
6430 (class Output_data_reloc_generic): Define.
6431 (class Output_data_reloc_base): Change base class to
6432 Output_data_reloc_generic. Change add() method to call
6433 bump_relative_reloc_count for a relative reloc. Remove
6434 sort_relocs_ field.
6435 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
6436 to sort_relocs().
6437 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
6438 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
6439 appropriate.
6440 * layout.h (class Layout): Update declaration.
6441
ea715a34
ILT
64422010-01-07 Ian Lance Taylor <iant@google.com>
6443
6444 * output.h (class Output_data): Add const version of
6445 output_section and do_output_section.
6446 (class Output_section_data): Add const version of
6447 do_output_section.
6448 (class Output_section): Likewise.
6449 * layout.cc (Layout::add_target_dynamic_tags): New function.
6450 * layout.h (class Layout): Update declarations.
6451 * arm.cc (Target_arm::do_finalize_sections): Use
6452 add_target_dynamic_tags.
6453 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6454 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
6455 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
6456 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6457
659948a4
ILT
64582010-01-07 Ian Lance Taylor <iant@google.com>
6459
6460 PR 11042
6461 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
6462 object as needed.
6463
9d3b86f6
ILT
64642010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
6465 Ian Lance Taylor <iant@google.com>
6466
6467 PR 11019
6468 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
6469 Xindex::read_symtab_xindex.
6470
bb0d3eb0
DK
64712010-01-07 Doug Kwan <dougkwan@google.com>
6472
6473 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
6474 (Insn_template::thumb16_bcond_insn): New method declaration.
6475 (Insn_template): Fix spelling.
6476 (Stub::thumb16_special): New method declaration.
6477 (Stub::do_write): Define virtual method which was previously pure
6478 virtual.
6479 (Stub::do_thumb16_special): New method declaration.
6480 (Stub::do_fixed_endian_write): New template member.
6481 (Reloc_stub::do_write): Remove.
6482 (Reloc_stub::do_fixed_endian_write): Remove.
6483 (Cortex_a8_stub): New class definition.
6484 (Stub_factory::make_cortex_a8_stub): New method definition.
6485 (Stub_factory::Stub_factory): Add missing static storage class
6486 qualifier for elf32_arm_stub_a8_veneer_blx.
6487
ffeef7df
ILT
64882010-01-07 Ian Lance Taylor <iant@google.com>
6489
dc3f80fe
ILT
6490 PR 10980
6491 * options.h (class General_options): Add --warn-unresolved-symbols
6492 and --error-unresolved-symbols.
6493 * errors.cc (Errors::undefined_symbol): Implement
6494 --warn-unresolved-symbols.
6495
ffeef7df
ILT
6496 * options.h (class General_options): Add -z text and -z textoff.
6497 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
6498
f1ec9ded
ST
64992010-01-06 Sriraman Tallam <tmsriram@google.com>
6500
6501 * gc.h (Garbage_collection::Cident_section_map): New typedef.
6502 (Garbage_collection::cident_sections): New function.
6503 (Garbage_collection::add_cident_section): New function.
6504 (Garbage_collection::cident_sections_): New member.
6505 (gc_process_relocs): Add references to sections whose names are C
6506 identifiers.
6507 * gold.h (cident_section_start_prefix): New constant.
6508 (cident_section_stop_prefix): New constant.
6509 (is_cident): New function.
6510 * layout.cc (Layout::define_section_symbols): Replace string constants
6511 with the newly defined constants.
6512 * object.cc (Sized_relobj::do_layout): Track sections whose names are
6513 C identifiers.
6514 * testsuite/Makefile.am: Add gc_orphan_section_test.
6515 * testsuite/Makefile.in: Regenerate.
6516 * testsuite/gc_orphan_section_test.cc: New file.
6517 * testsuite/gc_orphan_section_test.sh: New file.
6518
6eda8c29
ILT
65192010-01-06 Ian Lance Taylor <iant@google.com>
6520
b9674e17
ILT
6521 PR 10980
6522 * options.h (class General_options): Add --warn-shared-textrel.
6523 * layout.cc (Layout::finish_dynamic_section): Implement
6524 --warn-shared-textrel.
6525
6eda8c29
ILT
6526 PR 10980
6527 * options.h (class General_options): Add --warn-multiple-gp.
6528
32dcd44e
ILT
65292010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6530
6531 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
6532 $(THREADSLIB) and $(LIBDL).
6533 * Makefile.in: Rebuild.
6534
a192ba05
ILT
65352010-01-06 Ian Lance Taylor <iant@google.com>
6536
6537 PR 10980
6538 * options.cc (General_options::parse_section_start): New function.
6539 (General_options::section_start): New function.
6540 (General_options::General_options): Initialize all members.
6541 * options.h: Include <map>
6542 (class General_options): Add --section-start. Add section_starts_
6543 member.
6544 * layout.cc (Layout::attach_allocated_section_to_segment): If
6545 --section-start was used, set the address of the segment. Remove
6546 local sort_sections.
6547 (Layout::relaxation_loop_body): If the address of the load segment
6548 has been set by --section-start, don't use it.
6549 * output.h (Output_segment::update_flags_for_output_section): New
6550 function.
6551 * output.cc (Output_segment::add_output_section): Call
6552 update_flags_for_output_section.
6553
dde3f402
ILT
65542010-01-05 Ian Lance Taylor <iant@google.com>
6555
62dfdd4d
ILT
6556 PR 10980
6557 * options.h (class General_options): Add --undefined-version.
6558 * script.cc (struct Version_expression): Add was_matched_by_symbol
6559 field.
6560 (Version_script_info::matched_symbol): New function.
6561 (Version_script_info::get_symbol_version_helper): Call
6562 matched_symbol.
6563 (Version_script_info::check_unmatched_names): New function.
6564 * script.h (class Version_script_info): Update declarations.
6565 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
6566
9c4ae156
ILT
6567 * options.h (class General_options): Use DEFINE_bool_alias for
6568 allow_multiple_definition.
6569 * resolve.cc (Symbol_table::should_override): Don't test
6570 allow_multiple_definition.
6571
dde3f402
ILT
6572 PR 10980
6573 * options.h (class General_options): Add --cref.
6574 * main.cc (main): Print cref table if --cref. Don't close mapfile
6575 until after printing cref table.
6576 * cref.cc: Include "symtab.h".
6577 (class Cref_inputs): Define Cref_table_compare and Cref_table.
6578 (Cref_table_compare::operator()): New function.
6579 (Cref_inputs::gather_cref): New function.
6580 (filecol): New static const.
6581 (Cref_inputs::print_cref): New function.
6582 (Cref::print_cref): New function.
6583 * cref.h: Include <cstdio>.
6584 (class Cref): Update declarations.
6585 * mapfile.h (Mapfile::file): New function.
6586 * object.h (class Object): Define Symbols. Declare virtual
6587 do_get_global_symbols.
6588 (Object::get_global_symbols): New function.
6589 * object.cc (Input_objects::add_object): Pass object to cref_ if
6590 --cref.
6591 (Input_objects::archive_start): Likewise.
6592 (Input_objects::archive_stop): Likewise.
6593 (Input_objects::print_cref): New function.
6594 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
6595 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
6596 --cref.
6597 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
6598 function.
6599 * plugin.h (class Sized_pluginobj): Update declarations.
6600
8781f709
ILT
66012010-01-05 Ian Lance Taylor <iant@google.com>
6602
6603 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
6604 to is_default_version. Rename insdef to insdefault.
6605 (Symbol_table::add_from_relobj): Rename def to is_default_version
6606 and local to is_forced_local.
6607 (Symbol_table::add_from_pluginobj): Likewise.
6608 (Symbol_table::add_from_dynobj): Likewise.
6609 (Symbol_table::define_special_symbol): Rename insdef to
6610 insdefault.
6611
fe35d28d
ILT
66122010-01-04 Ian Lance Taylor <iant@google.com>
6613
30bc8c46
ILT
6614 PR 10980
6615 * options.h (class General_options): Add
6616 --allow-multiple-definition and -z muldefs.
6617 * resolve.cc (Symbol_table::should_override): Don't warn about a
6618 multiple symbol definition if --allow-multiple-definition or -z
6619 muldefs.
6620
7eaea549
ILT
6621 PR 10980
6622 * options.h (class General_options): Add --add-needed and
6623 --copy-dt-needed-entries. Tweak --as-needed help entry.
6624 * object.cc (Input_objects::check_dynamic_dependencies): Give an
6625 error if --copy-dt-needed-entries aka --add-needed is used and
6626 would cause a change in behaviour.
6627
fe35d28d
ILT
6628 PR 10980
6629 * options.h (class General_options): Add -G as a short version of
6630 --shared. Add no-op options -assert, -g, and -i.
6631
55a2bb35
ST
66322010-01-04 Sriraman Tallam <tmsriram@google.com>
6633
6634 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
6635 check for .text or .gnu.linkonce.t sections.
6636 * icf.cc (Icf::find_identical_sections): Ditto.
6637 Change the detection for mangled function name within the section
6638 name.
6639 * icf.h (is_section_foldable_candidate): New function.
6640
719328e1
ILT
66412009-12-30 Ian Lance Taylor <iant@google.com>
6642
6643 PR 10980
6644 * options.h (class General_options): Permit two dashes with
6645 --retain-symbols-file.
6646
d7bb5745
ILT
66472009-12-30 Ian Lance Taylor <iant@google.com>
6648
403a15dd
ILT
6649 PR 10979
6650 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
6651 don't put the file header and segment headers in the text
6652 segment.
6653
eda294df
ILT
6654 PR 10979
6655 * common.cc (Sort_commons::operator()): Stabilize sort when both
6656 entries are NULL.
6657 (Symbol_table::do_allocate_commons_list): When allocating common
6658 symbols, skip a symbol which is no longer common.
6659 * symtab.h (Symbol::is_common): Test whether the symbol comes from
6660 an object before checking its type.
6661 * testsuite/common_test_2.c: New file.
6662 * testsuite/common_test_3.c: New file.
6663 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
6664 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
6665 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
6666 (common_test_2_pic.o, common_test_2.so): New targets.
6667 (common_test_3_pic.o, common_test_3.so): New targets.
6668 * testsuite/Makefile.in: Rebuild.
6669
d7bb5745
ILT
6670 PR 10979
6671 * script.cc (read_input_script): If we see a new SECTIONS clause,
6672 and we have added an input section, give an error.
6673 * layout.h (class Layout): Add have_added_input_section function.
6674 Add have_added_input_section_ field.
6675 * layout.cc (Layout::Layout): Initialize
6676 have_added_input_section_.
6677 (Layout::layout): Set have_added_input_section_.
6678 (Layout::layout_eh_frame): Likewise.
6679
fc59c572
ILT
66802009-12-30 Ian Lance Taylor <iant@google.com>
6681
6682 PR 10931
6683 * options.h (class General_options): Add --sort-common option.
6684 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
6685 * common.cc (Sort_common): Add sort_order parameter to
6686 constructor. Add sort_order_ field.
6687 (Sort_commons::operator): Check sort_order_.
6688 (Symbol_table::allocate_commons): Determine the sort order.
6689 (Symbol_table::do_allocate_commons): Add sort_order parameter.
6690 Change all callers.
6691 (Symbol_table::do_allocate_commons_list): Likewise.
6692
1c74fab0
ILT
66932009-12-30 Ian Lance Taylor <iant@google.com>
6694
6695 PR 10916
6696 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
6697 symbols from this object, don't change the visibility of an
6698 undefined symbol.
6699 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
6700
6affe781
ILT
67012009-12-30 Ian Lance Taylor <iant@google.com>
6702
6703 PR 10861
6704 * script.h (class Version_script_info): Define Language enum.
6705 Update declarations. Define Glob, Exact, and Lookup types. Add
6706 new fields globals_, locals_, and is_finalized_.
6707 * script.cc: Various formatting fixes.
6708 (class Parser_closure): Change language_stack_ from a vector of
6709 std::string to one of Version_script_info::Language. Adjust all
6710 uses accordingly.
6711 (class Lazy_demangler): Remove.
6712 (struct Version_expression): Change language from std::string to
6713 Version_script_info::Language.
6714 (Version_script_info::Version_script_info): New function.
6715 (Version_script_info::~Version_script_info): Don't call clear.
6716 (Version_script_info::finalize): New function.
6717 (Version_script_info::build_lookup_tables): New function.
6718 (Version_script_info::build_expression_list_lookup): New
6719 function.
6720 (Version_script_info::get_symbol_version_helper): Rewrite to use
6721 lookup tables.
6722 (Version_script_info::print_expression_list): Adjust to use
6723 Version_script_info::Language.
6724 (script_push_lex_into_version_mode): Check that the version script
6725 has not been finalized.
6726 (version_script_push_lang): Change language string to
6727 Version_script_info::Language.
6728 * options.cc (Command_line::version_script): New function.
6729 * options.h (class General_options): Add finalize_dynamic_list
6730 function. Change version_script from declaration to definition.
6731 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
6732 * testsuite/version_script.map: Remove duplicate def of foo.
6733 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
6734 version_script.map.
6735 * testsuite/Makefile.in: Rebuild.
6736
818bf354
ILT
67372009-12-30 Ian Lance Taylor <iant@google.com>
6738
6739 PR 10843
6740 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
6741 if the input symbol index is 0, make the output symbol index 0.
6742
ebcc8304
ILT
67432009-12-30 Ian Lance Taylor <iant@google.com>
6744
6745 PR 10670
6746 * options.h (class General_options): Add -x/--discard-all.
6747 * object.cc (Sized_relobj::do_count_local_symbols): Handle
6748 --discard-all. If the local symbol needs a dynamic entry, check
6749 that before handling --discard-locals.
6750
176fe33f
ILT
67512009-12-30 Ian Lance Taylor <iant@google.com>
6752
bb321bb1
ILT
6753 PR 10450
6754 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
6755 flags to PF_R.
6756 (Output_segment::add_output_section): Don't change the flags if
6757 the type is PT_TLS.
6758
176fe33f
ILT
6759 PR 10450
6760 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
6761 GNU hash table if they need a dynamic value. Otherwise, don't add
6762 them if they are defined in a dynamic object or are forced local.
6763
e8cd95c7
ILT
67642009-12-29 Ian Lance Taylor <iant@google.com>
6765
1b81fb71
ILT
6766 PR 10450
6767 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
6768 .gnu.hash table for a 32-bit target.
6769
8d6d383d
ILT
6770 PR 10450
6771 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
6772 regular and a dynamic object only needs a dynamic symbol table
6773 entry if it is externally visible.
6774
e785ec03
ILT
6775 PR 10450
6776 * i386.cc (class Target_i386): Initialize global_offset_table_ in
6777 constructor. Add global_offset_table_ field.
6778 (Target_i386::got_section): Set global_offset_table_.
6779 (Target_i386::do_finalize_sections): Set global_offset_table_
6780 size.
6781 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
6782 in constructor. Add global_offset_table_ field.
6783 (Target_x86_64::got_section): Set global_offset_table_.
6784 (Target_x86_64::do_finalize_sections): Set global_offset_table_
6785 size.
6786
1a2dff53
ILT
6787 * layout.cc (Layout::Layout): Initialize increase_relro_.
6788 (Layout::get_output_section): Add is_relro, is_last_relro, and
6789 is_first_non_relro parameters. Change all callers.
6790 (Layout::choose_output_section): Likewise.
6791 (Layout::add_output_section_data): Likewise.
6792 (Layout::make_output_section): Likewise.
6793 (Layout::set_segment_offsets): Clear increase_relro when using a
6794 linker script.
6795 * layout.h (class Layout): Add increase_relro method. Add
6796 increase_relro_ field. Update declarations.
6797 * output.cc (Output_section::Output_section): Initialize
6798 is_last_relro_ and is_first_non_relro_.
6799 (Output_segment::add_output_section): Group relro sections is
6800 do_sort is true. Handle is_last_relro and is_first_non_relro.
6801 (Output_segment::maximum_alignment): Remove relro handling.
6802 (Output_segment::set_section_addresses): Add increase_relro
6803 parameter. Change all callers. Add initial alignment to align
6804 relro sections on separate page. Remove old relro handling.
6805 (Output_segment::set_section_list_addresses): Remove in_relro
6806 parameter. Change all callers.
6807 (Output_segment::set_offset): Add increase parameter. Change all
6808 callers. Remove old relro handling.
6809 * output.h (class Output_section): Add new methods: is_last_relro,
6810 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
6811 Add is_last_relro_ and is_first_non_relro_ fields.
6812 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
6813 Create separate .got.plt section. Call increase_relro.
6814 * x86_64.cc (Target_x86_64::got_section): Likewise.
6815 * testsuite/relro_script_test.t: Add .got.plt.
6816
f0ba79e2
ILT
6817 PR 10450
6818 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
6819 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
6820 (Layout::finalize): Call set_dynamic_symbol_size.
6821 (Layout::set_dynamic_symbol_size): New function.
6822 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
6823 set_dynamic_symbol_size.
6824
e8cd95c7
ILT
6825 PR 10450
6826 * output.h (class Output_section): Add is_entsize_zero_ field.
6827 * output.cc (Output_section::Output_section): Initialize
6828 is_entsize_zero_.
6829 (Output_section::set_entsize): If two different entsizes are
6830 requested, force it to zero.
6831 (Output_section::add_input_section): Set flags for .debug_str
6832 before updating section flags. Set entsize.
6833 (Output_section::update_flags_for_input_section): Set SHF_MERGE
6834 and SHF_STRING if all input sections have those flags.
6835
3e1b9a8a
RÁE
68362009-12-29 Rafael Espindola <espindola@google.com>
6837
6838 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
6839 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
6840 reporting.
3e1b9a8a 6841
3dcad376
ST
68422009-12-29 Sriraman Tallam <tmsriram@google.com>
6843
6844 * options.cc (General_options::parse_version): Allow -v to exit
6845 without an error if there is nothing to link.
6846
084e2665
ILT
68472009-12-29 Ian Lance Taylor <iant@google.com>
6848
6849 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
6850 using a version of gcc before 4.1.
6851 * configure: Rebuild.
6852
250acde3
CD
68532009-12-28 Chris Demetriou <cgd@google.com>
6854
6855 * attributes.cc (Output_attributes_section_data::do_write): Use
6856 std::vector::front rather than std::vector::data.
6857
99fff23b
ILT
68582009-12-28 Ian Lance Taylor <iant@google.com>
6859
6860 * symtab.h (class Symbol_table): Add enum Defined.
6861 * resolve.cc (Symbol_table::should_override): Add defined
6862 parameter. Change all callers. Test whether object is NULL
6863 before calling a method on it.
6864 (Symbol_table::report_resolve_problem): Add defined parameter.
6865 Change all callers.
6866 (Symbol_table::should_override_with_special): Likewise.
6867 * symtab.cc (Symbol_table::define_in_output_data): Add defined
6868 parameter. Change all callers.
6869 (Symbol_table::do_define_in_output_data): Likewise.
6870 (Symbol_table::define_in_output_segment): Likewise.
6871 (Symbol_table::do_define_in_output_segment): Likewise.
6872 (Symbol_table::define_as_constant): Likewise.
6873 (Symbol_table::do_define_as_constant): Likewise.
6874 * script.h (class Symbol_assignment): Add is_defsym parameter to
6875 constructor; change all callers.
6876 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
6877 parameter. Change all callers. Add is_defsym_ field.
6878 (class Parser_closure): Add parsing_defsym parameter to
6879 constructor; change all callers. Add parsing_defsym accessor
6880 function. Add parsing_defsym_ field.
6881
556bd683
ILT
68822009-12-28 Ian Lance Taylor <iant@google.com>
6883
6884 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 6885 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 6886
1782c879
ILT
68872009-12-23 Ian Lance Taylor <iant@google.com>
6888
6889 * i386.cc (Target_i386::do_calls_non_split): Recognize
6890 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
6891 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
6892 -fsplit-stack prologue when using %r11.
1782c879 6893
329ca2b1
ST
68942009-12-21 Sriraman Tallam <tmsriram@google.com>
6895
6896 * options.cc (General_options::parse_version): Make -v continue and do
6897 the link like GNU ld does.
6898
d675ff46
RÁE
68992009-12-17 Rafael Avila de Espindola <espindola@google.com>
6900
6901 * Makefile.am (CCFILES): Add timer.cc.
6902 (HFILES): Add timer.h.
6903 * configure.ac: Check for sysconf and times.
6904 * main.cc: include timer.h.
6905 (main): Use Timer instead of get_run_time.
6906 * timer.cc: New.
6907 * timer.h: New.
6908 * workqueue.cc: include timer.h.
6909 (Workqueue::find_and_run_task):
6910 Report user, sys and wall time.
6911 * Makefile.in: Regenerate.
6912 * config.in: Regenerate.
6913 * configure: Regenerate.
6914
d6344fb5
DK
69152009-12-16 Doug Kwan <dougkwan@google.com>
6916
6917 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
6918 sections.
6919 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
6920 relaxed input sections.
6921 * output.cc (Output_section::find_relaxed_input_section): Change
6922 return type to Output_relaxed_input_section pointer. Adjust code
6923 for new type of relaxed_input_section_map_.
6924 * output.h (Output_section::find_relaxed_input_section): Change
6925 return type to Output_relaxed_input_section pointer.
6926 (Output_section::Output_relaxed_input_section_by_input_section_map):
6927 New type.
6928 (Output_section::relaxed_input_section_map_): Change type to
6929 Output_section::Output_relaxed_input_section_by_input_section_map.
6930 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
6931 input section.
6932
0e0d5469
ILT
69332009-12-15 Ian Lance Taylor <iant@google.com>
6934
6935 * layout.cc (Layout::create_shstrtab): Only write out after input
6936 sections if we are compressing debug sections.
6937
0649a889
ILT
69382009-12-15 Ian Lance Taylor <iant@google.com>
6939
6940 * archive.cc (Archive::add_symbols): Only look up a symbol without
6941 a version if there is, in fact, a version.
6942
2ea97941
ILT
69432009-12-14 Ian Lance Taylor <iant@google.com>
6944
6945 Revert -Wshadow changes, all changes from:
6946 2009-12-11 Doug Kwan <dougkwan@google.com>
6947 2009-12-11 Nick Clifton <nickc@redhat.com>
6948 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
6949
b0eec2cc
DK
69502009-12-11 Doug Kwan <dougkwan@google.com>
6951
6952 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
6953 due to -Wshadow.
6954 * attributes.cc (Object_attribute::size): Ditto.
6955 (Attributes_section_data::size): Ditto.
6956 (Attributes_section_data::Attributes_section_data): Ditto.
6957 (Output_attributes_section_data::do_write): Ditto.
6958 * attributes.h (Object_attribute::set_type): Ditto.
6959 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
6960
91d6fa6a
NC
69612009-12-11 Nick Clifton <nickc@redhat.com>
6962
6963 * archive.cc: Fix shadowed variable warnings.
6964 * arm.cc: Likewise.
6965 * compressed_output.cc: Likewise.
6966 * compressed_output.h: Likewise.
6967 * configure: Likewise.
6968 * dwarf_reader.cc: Likewise.
6969 * dynobj.cc: Likewise.
6970 * dynobj.h: Likewise.
6971 * ehframe.cc: Likewise.
6972 * ehframe.h: Likewise.
6973 * errors.cc: Likewise.
6974 * expression.cc: Likewise.
6975 * fileread.cc: Likewise.
6976 * fileread.h: Likewise.
6977 * freebsd.h: Likewise.
6978 * i386.cc: Likewise.
6979 * icf.cc: Likewise.
6980 * incremental.h: Likewise.
6981 * layout.cc: Likewise.
6982 * layout.h: Likewise.
6983 * mapfile.cc: Likewise.
6984 * merge.cc: Likewise.
6985 * merge.h: Likewise.
6986 * object.cc: Likewise.
6987 * object.h: Likewise.
6988 * options.h: Likewise.
6989 * output.cc: Likewise.
6990 * output.h: Likewise.
6991 * parameters.cc: Likewise.
6992 * plugin.cc: Likewise.
6993 * powerpc.cc: Likewise.
6994 * reduced_debug_output.cc: Likewise.
6995 * reduced_debug_output.h: Likewise.
6996 * reloc.cc: Likewise.
6997 * reloc.h: Likewise.
6998 * resolve.cc: Likewise.
6999 * script-sections.cc: Likewise.
7000 * script.cc: Likewise.
7001 * script.h: Likewise.
7002 * sparc.cc: Likewise.
7003 * symtab.cc: Likewise.
7004 * symtab.h: Likewise.
7005 * target-select.cc: Likewise.
7006 * target-select.h: Likewise.
7007 * token.h: Likewise.
7008 * workqueue.cc: Likewise.
7009 * workqueue.h: Likewise.
7010 * x86_64.cc: Likewise.
7011
a0351a69
DK
70122009-12-10 Doug Kwan <dougkwan@google.com>
7013
7014 * arm.cc (attributes.h): New include.
7015 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
7016 (Arm_relobj::~Arm_relobj): Delete object pointed by
7017 attributes_section_data_.
7018 (Arm_relobj::attributes_section_data): New method definition.
7019 (Arm_relobj::attributes_section_data_): New data member declaration.
7020 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
7021 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
7022 attributes_section_data_.
7023 (Arm_dynobj::attributes_section_data): New method definition.
7024 (Arm_dynobj::attributes_section_data_): New data member declaration.
7025 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
7026 initialization value of may_use_blx_ to false.
7027 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
7028 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
7029 object attributes to compute results instead of hard-coding.
7030 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
7031 Target_arm::get_secondary_compatible_arch,
7032 Target_arm::set_secondary_compatible_arch
7033 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7034 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
7035 New method declarations.
7036 (Target_arm::get_aeabi_object_attribute): New method definition.
7037 (Target_arm::attributes_section_data_): New data member declaration.
7038 (read_arm_attributes_section): New template definition.
7039 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
7040 (Arm_dynobj::do_read_symbols): Ditto.
7041 (Target_arm::do_finalize_sections): Merge attributes sections from
7042 input. Check for BLX use after attributes section merging.
7043 Fix __exidx_start and __exidx_end visibility. Create an
7044 .ARM.attributes section if necessary.
7045 (Target_arm::get_secondary_compatible_arch,
7046 Target_arm::set_secondary_compatible_arch,
7047 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7048 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 7049 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
7050 New method definitions.
7051
b59befec
ILT
70522009-12-09 Ian Lance Taylor <iant@google.com>
7053
7054 * plugin.cc (Plugin::load): Don't cast from void* to a function
7055 pointer.
7056
1276bc89
ILT
70572009-12-09 Ian Lance Taylor <iant@google.com>
7058
7059 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
7060 information fields.
7061
2f2de248
L
70622009-12-09 H.J. Lu <hongjiu.lu@intel.com>
7063
7064 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
7065 Replace two_file_shared_1.so with two_file_shared_2.so.
7066 * testsuite/Makefile.in: Regenerated.
7067
4f787271
DK
70682009-12-08 Doug Kwan <dougkwan@google.com>
7069
7070 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
7071 (HFILES): Add attributes.h and int_encoding.h.
7072 * Makefile.in: Regenerate.
7073 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
7074 function definitions to int_encoding.cc
7075 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
7076 prototypes to int_encoding.h
7077 * reduced_debug_output.cc (int_encoding.h): New include.
7078 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
7079 function definitions to int_encoding.cc
7080 (insert_into_vector, read_from_pointer): Move template definitions to
7081 int_encoding.h
7082 * attributes.cc: New file.
7083 * attributes.h: New file.
7084 * int_encoding.cc: New file.
7085 * int_encoding.h: New file.
7086
20b52f1a
RÁE
70872009-12-07 Rafael Avila de Espindola <espindola@google.com>
7088
7089 PR gold/11055
7090 * incremental-dump.cc (dump_incremental_inputs): New.
7091 (main): Use dump_incremental_inputs.
7092
53d7974c
L
70932009-12-07 H.J. Lu <hongjiu.lu@intel.com>
7094
7095 PR gold/10893
7096 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
7097 checking elfcpp::STT_FUNC.
7098 (Target_i386::Relocate::relocate): Likewise.
7099 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
7100
7101 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
7102 symbols from shared libraries into normal FUNC symbols.
7103
7104 * symtab.h (Symbol): Add is_func and use it.
7105
05a352e6
DK
71062009-12-05 Doug Kwan <dougkwan@google.com>
7107
7108 * arm.cc (Target_arm::arm_info): Initialize new fields
7109 attributes_section and attributes_vendor.
7110 * i386.cc (Target_i386::i386_info): Same.
7111 * object.cc (Sized_relobj::do_layout): Skip attribute section.
7112 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
7113 fields attributes_section and attributes_vendor.
53d7974c 7114 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
7115 * target.h (Target::attributes_section, Target::attributes_vendor,
7116 Target::is_attributes_section, Target::attribute_arg_type,
7117 Target::attributes_order): New method definitions.
7118 (Target::Target_info::attributes_section,
7119 Target::Target_info::attributes_vendor): New fields.
7120 (Target::do_attribute_arg_type, Target::do_attributes_order): New
7121 virtual method definitions.
7122 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
7123 attributes_section and attributes_vendor.
7124 * testsuite/testfile.cc (Target_test::test_target_info): Same.
7125
f4e5969c
DK
71262009-12-05 Doug Kwan <dougkwan@google.com>
7127
7128 * arm.cc: Update comments about interworking and stub generation.
7129 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
7130 considered as non-PIC.
7131 (Arm_relocate_functions::base_abs): Fix formatting.
7132 (Arm_relocate_functions::got_prel): Fix comment. Change interface
7133 of function to use GOT entry address instead of offset.
7134 (Target_arm::Scan::global): Issue an error if a symbol would need a
7135 PLT does not get one because it is untyped. Remove code to create
7136 dynamic symbols for relative branches.
7137 (Target_arm::Relocate::relocate: Use 0 instead of false since function
7138 takes unsigned integer instead of boolean.
7139
1abce4a6
L
71402009-12-05 H.J. Lu <hongjiu.lu@intel.com>
7141
7142 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
7143 (two_file_test_LDADD): Likewise.
7144 (common_test_1_LDADD): Likewise.
7145 (exception_test_LDADD) Likewise.
7146 (weak_test_LDADD): Likewise.
7147 (many_sections_test_LDADD): Likewise.
7148 (initpri1_LDADD): Likewise.
7149 (script_test_1_LDADD): Likewise.
7150 (script_test_2_LDADD): Likewise.
7151 (justsyms_LDADD): Likewise.
7152 (binary_test_LDADD): Likewise.
7153 (large_LDADD): Likewise.
7154 * testsuite/Makefile.in: Regenerated.
7155
adcf2816 71562009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 7157
adcf2816
L
7158 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
7159 (Symbol_table::override_with_special): Likewise.
7160 (Symbol_table::add_from_object): Likewise.
7161
28e67f5d
RÁE
71622009-12-04 Rafael Avila de Espindola <espindola@google.com>
7163
7164 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
7165 Don't set the data_offset twice.
7166
ae10a101
RÁE
71672009-12-04 Rafael Avila de Espindola <espindola@google.com>
7168
7169 * testsuite/Makefile.in: Regenerate.
7170
f59f41f3
DK
71712009-12-03 Doug Kwan <dougkwan@google.com>
7172
7173 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
7174 (Target_arm::do_finalize_sections): Add parameter for symbol table
7175 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
7176 * i386.cc (Target_i386::do_finalize_sections): Add an additional
7177 parameter for symbol table pointer.
7178 * layout.cc (Layout::finalize): Call Target::finalize_sections with
7179 an additional parameter for a pointer to symbol table.
7180 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
7181 parameter for a symbol table pointer.
7182 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
7183 * target.h (Target::finalize_sections, Target::do_finalize_sections):
7184 Ditto.
7185 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
7186 parameter for a symbol table pointer.
7187
ca55d848
RÁE
71882009-12-03 Rafael Avila de Espindola <espindola@google.com>
7189
7190 * incremental.cc (Incremental_inputs_header)
7191 (Incremental_inputs_header_write, Incremental_inputs_entry)
7192 (Incremental_inputs_entry_write): Move ...
7193 * incremental.h (Incremental_inputs_header)
7194 (Incremental_inputs_header_write, Incremental_inputs_entry)
7195 (Incremental_inputs_entry_write): here.
7196
3aec4f9c
RÁE
71972009-12-02 Rafael Avila de Espindola <espindola@google.com>
7198
7199 * incremental.cc (make_sized_incremental_binary): Set the target.
7200 Error if it is incompatible.
7201 * output.h (Output_file): Add filename method.
7202
9c0ae74d
RÁE
72032009-12-02 Rafael Avila de Espindola <espindola@google.com>
7204
7205 * incremental.cc (Incremental_inputs_entry): Remove unused argument
7206 from the get_* methods.
7207
a45500ae
RÁE
72082009-12-02 Rafael Avila de Espindola <espindola@google.com>
7209
7210 * incremental-dump.cc (main): Check that the offeset of a script is 0.
7211 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
7212 Write 0 for the data_offset of scripts.
7213
325e6408
RÁE
72142009-12-02 Rafael Avila de Espindola <espindola@google.com>
7215
7216 * testsuite/Makefile.am: Add the incremental_test.sh test.
7217 * testsuite/incremental_test.sh: New.
7218 * testsuite/incremental_test_1.c: New.
7219 * testsuite/incremental_test_2.c: New.
7220
954c3e2e
RÁE
72212009-12-01 Rafael Avila de Espindola <espindola@google.com>
7222
7223 * incremental-dump.cc (main): Fix typos.
7224
f8086623
RÁE
72252009-11-27 Rafael Avila de Espindola <espindola@google.com>
7226
7227 PR gold/11025
7228 * incremental-dump.cc (main): Use llu to print 64 bit values.
7229
3b0dd6ac
L
72302009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
7231 H.J. Lu <hongjiu.lu@intel.com>
7232
7233 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
7234 $(LIBDL).
7235 (incremental_dump_LDADD): Likewise.
7236 * Makefile.in: Regenerated.
7237
a6d1ef57 72382009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 7239
a6d1ef57
DK
7240 Revert:
7241
7242 2009-11-25 Doug Kwan <dougkwan@google.com>
7243
7244 * arm.cc (Target_arm::Target_arm): Move method definition
7245 outside of class definition. Add code to handle
7246 --target1-rel, --target1-abs and --target2= options.
7247 (Target_arm::get_reloc_reloc_type): Change method to be
7248 non-static and const.
7249 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
7250 New data member declaration.
7251 (Target_arm::Scan::local, Target_arm::Scan::global,
7252 Target_arm::Relocate::relocate,
7253 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7254 Adjust call to Target_arm::get_real_reloc_type.
7255 (Target_arm::get_real_reloc_type): Use command line options
7256 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
7257 * options.h (--target1-rel, --target1-abs, --target2): New
7258 ARM-only options.
7259
50aeb7d4
DK
72602009-11-25 Doug Kwan <dougkwan@google.com>
7261
7262 * arm.cc (Target_arm::Target_arm): Move method definition outside of
7263 class definition. Add code to handle --target1-rel, --target1-abs
7264 and --target2= options.
7265 (Target_arm::get_reloc_reloc_type): Change method to be non-static
7266 and const.
7267 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
7268 member declaration.
7269 (Target_arm::Scan::local, Target_arm::Scan::global,
7270 Target_arm::Relocate::relocate,
7271 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
7272 call to Target_arm::get_real_reloc_type.
7273 (Target_arm::get_real_reloc_type): Use command line options to
7274 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
7275 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
7276 options.
7277
51938283
DK
72782009-11-25 Doug Kwan <dougkwan@google.com>
7279
7280 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
7281 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
7282 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
7283 formatting.
7284 (Arm_relocate_functions::thm_call): Replace body with a call to
7285 Arm_relocate_functions::thumb_branch_common.
7286 (Arm_relocate_functions::thm_jump24,
7287 Arm_relocate_functions::thm_xpc22): New method definitions.
7288 (Arm_relocate_functions::thumb_branch_common): New method definition.
7289 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
7290 operator.
7291 (Target_arm::Relocate::relocate): Adjust call to thm_call.
7292 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
7293
e2b8f3c4
RÁE
72942009-11-24 Rafael Avila de Espindola <espindola@google.com>
7295
7296 * Makefile.am: Build incremental-dump
7297 * Makefile.in: Regenerate.
7298 * incremental-dump.cc: New.
7299 * incremental.cc (Incremental_inputs_header_data,
7300 Incremental_inputs_entry_data): Move to incremental.h
7301 * incremental.h: (Incremental_inputs_header_data,
7302 Incremental_inputs_entry_data): Move from incremental.cc
7303
bcba9aec
RÁE
73042009-11-24 Rafael Avila de Espindola <espindola@google.com>
7305
7306 * incremental.cc (Incremental_inputs_header,
7307 Incremental_inputs_header_write, Incremental_inputs_entry,
7308 Incremental_inputs_entry_write): Add a typedef with the data type.
7309
7c3afe08
RÁE
73102009-11-24 Rafael Avila de Espindola <espindola@google.com>
7311
7312 * incremental.cc (Incremental_inputs_header,
7313 Incremental_inputs_header_write, Incremental_inputs_entry,
7314 Incremental_inputs_entry_write): Update comment about which
7315 type has the filed descriptions.
7316
d204b6e9
DK
73172009-11-15 Doug Kwan <dougkwan@google.com>
7318
7319 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
7320 (Arm_relocate_functions::arm_branch_common): Change method defintion
7321 in class definition to a method declaration and update list of formal
7322 parameters.
7323 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
7324 Arm_relocation_functions::jump24): Adjust call to
7325 Arm_relocate_functions::arm_branch_common. Update list of formal
7326 parameters.
7327 (Arm_relocate_functions::xpc25): New method definition.
7328 (Arm_relocate_functions::arm_branch_common): Move method defintion
7329 out from class definition. Use stubs for mode-switching and extending
7330 branch ranges.
7331 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
7332 specially. Change code to enable use of stubs in ARM branches.
7333
43d12afe
DK
73342009-11-10 Doug Kwan <dougkwan@google.com>
7335
7336 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
7337 in method declaration.
7338 (Target_arm::relocate_stub): New method declaration.
7339 (Target_arm::default_target): Change to return a pointer instead of
7340 a const reference.
7341 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
7342 Target_arm::default_target.
7343 (Arm_Relobj::do_relocate_sections): Remove options paramater in
7344 method definition.
7345 (Target_arm::relocate_section): Adjust view.
7346 (Target_arm::relocate_stub): New method definition.
7347
ac33a407
DK
73482009-11-10 Doug Kwan <dougkwan@google.com>
7349
7350 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
7351 a format warning.
7352 * incremental.cc (open_incremental_binary): Initialized local
7353 variables to avoid warnings.
7354 * object.cc (make_elf_object): Ditto.
7355 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
7356 a format warning.
e1df38aa 7357
88ee28e9
L
7358009-11-09 H.J. Lu <hongjiu.lu@intel.com>
7359
7360 PR gold/10930
7361 * testsuite/plugin_test.c: Include "config.h".
7362
2daedcd6
DK
73632009-11-09 Doug Kwan <dougkwan@google.com>
7364
7365 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
7366 (arm_symbol_value): Remove.
7367 (Arm_relocate_functions::arm_branch_common,
7368 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
7369 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
7370 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
7371 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
7372 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
7373 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
7374 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
7375 Arm_relocate_functions::thm_mobw_abs_nc,
7376 Arm_relocate_functions::thm_mov_abs,
7377 Arm_relocate_functions::movw_prel_nc,
7378 Arm_relocate_functions::thm_movt_abs,
7379 Arm_relocate_functions::movt_prel,
7380 Arm_relocate_functions::thm_movw_prel_nc,
7381 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
7382 (Target_arm::Relocate::relocate): Only decompose address into two
7383 parts if relocation type uses the thumb-bit and pass the actual
7384 bit instead of a flag indicating that the thumb-bit is used. Adjust
7385 calls to methods in Arm_relocate_functions for this change.
7386
1276bc89 73872009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
7388
7389 PR 10925
7390 * reloc.cc: Instantiate
7391 Sized_relobj::initialize_input_to_output_maps and
7392 Sized_relobj:free_input_to_output_maps.
7393
e53ad1b5
ILT
73942009-11-06 Ian Lance Taylor <iant@google.com>
7395
7396 PR 10876
7397 * defstd.cc (in_segment): Set only_if_ref true for "end".
7398
eb44217c
DK
73992009-11-06 Doug Kwan <dougkwan@google.com>
7400
7401 * arm.cc (class Reloc_stub): Correct a comment.
7402 (Target_arm::Target_arm): Initialize arm_input_section_map_.
7403 (Target_arm::scan_section_for_stubs): New method declaration.
7404 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
7405 Change methods from private to protected.
7406 (Target_arm::do_may_relax): New method definition.
7407 (Target_arm::do_relax, Target_arm::group_sections,
7408 Target_arm::scan_reloc_for_stub,
7409 Target_arm::scan_reloc_section_for_stubs): New method declarations.
7410 (Target_arm::arm_input_section_map_): New data member declaration.
7411 (Target_arm::scan_reloc_for_stub,
7412 Target_arm::scan_reloc_section_for_stubs,
7413 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
7414 Target_arm::do_relax): New method definitions.
7415
5d329b7d
ILT
74162009-11-06 Mikolaj Zalewski <mikolaj@google.com>
7417
7418 * configure.ac: Check for (struct stat)::st_mtim
7419 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
7420 * config.in: Regenerate.
7421 * configure: Regenerate.
7422
96a0d71b
ILT
74232009-11-05 Ian Lance Taylor <iant@google.com>
7424
7425 PR 10910
7426 * output.cc (Output_segment::add_output_section): Add missing
7427 return statement.
7428
594c8e5e
ILT
74292009-11-04 Ian Lance Taylor <iant@google.com>
7430
7431 PR 10880
7432 * object.h (class Object): Add is_needed and set_is_needed
7433 methods. Add is_needed_ field. Make bool fields into bitfields.
7434 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
7435 defined in a dynamic object and referenced by a regular object,
7436 set is_needed for the dynamic object.
7437 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
7438 if the file is marked with as_needed and it is not needed.
7439
22b127cc
ILT
74402009-11-04 Ian Lance Taylor <iant@google.com>
7441
7442 PR 10887
7443 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
7444 tags if data is discarded by linker script.
7445 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7446 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
7447 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
7448 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7449
f5c870d2
ILT
74502009-11-04 Ian Lance Taylor <iant@google.com>
7451
7452 * layout.cc (Layout::get_output_section): Add is_interp and
7453 is_dynamic_linker_section parameters. Change all callers.
7454 (Layout::choose_output_section): Likewise.
7455 (Layout::make_output_section): Likewise.
7456 (Layout::add_output_section_data): Add is_dynamic_linker_section
7457 parameter. Change all callers.
7458 * layout.h (class Layout): Update declarations.
7459 * output.h (class Output_section): Add is_interp, set_is_interp,
7460 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
7461 Add is_interp_, is_dynamic_linker_section_ fields. Change
7462 generate_code_fills_at_write_ to a bitfield.
7463 * output.cc (Output_section::Output_sections): Initialize new
7464 fields.
7465 (Output_segment::add_output_section): Add do_sort parameter.
7466 Change all callers.
7467
1ae4d23b
ILT
74682009-11-03 Ian Lance Taylor <iant@google.com>
7469
7470 PR 10860
7471 * options.h (class General_options): Add --warn-common.
7472 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
7473 merging two common symbols.
7474 (Symbol_table::should_override): Handle --warn-common when merging
7475 a common symbol with a defined symbol. Use report_resolve_problem
7476 for multiple definitions.
7477 (Symbol_table::report_resolve_problem): New function.
7478 * symtab.h (class Symbol_table): Declare report_resolve_problem.
7479
55da9579
DK
74802009-11-03 Doug Kwan <dougkwan@google.com>
7481
7482 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
7483 stub_factory_.
7484 (Target_arm::stub_factory): New method definition.
7485 (Target_arm::new_arm_input_section,
7486 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
7487 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 7488 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
7489 New type definitions.
7490 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
7491 member declarations.
7492 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
7493 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
7494 New method definitions.
7495
37a9ac43
ILT
74962009-11-03 Ian Lance Taylor <iant@google.com>
7497
7498 * options.h (class General_options): Add --warn_constructors.
7499
b3d6a3d4
ILT
75002009-11-03 Ian Lance Taylor <iant@google.com>
7501
7502 PR 10893
7503 * defstd.cc (in_section): Add entries for __rel_iplt_start,
7504 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
7505
934b01dd
ILT
75062009-11-03 Ian Lance Taylor <iant@google.com>
7507
7508 PR 10895
7509 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
7510 --msgid-bugs-address.
7511 (install-pdf): New target.
7512 (install-data_yes): Look up one directory to find mkinstalldirs.
7513
03c1939b
L
75142009-11-03 H.J. Lu <hongjiu.lu@intel.com>
7515
7516 * po/Make-in (.po.gmo): Don't generate .gmo files in source
7517 tree.
7518
ebd95253
DK
75192009-10-30 Doug Kwan <dougkwan@google.com>
7520
7521 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
7522
e9bbb538
DK
75232009-10-30 Doug Kwan <dougkwan@google.com>
7524
7525 * arm.cc (Stub_addend_reader): New struct template definition
7526 and partial specializations.
7527 (Stub_addend_reader::operator()): New method definition for a
7528 partially specialized template.
7529
d5b40221
DK
75302009-10-30 Doug Kwan <dougkwan@google.com>
7531
7532 * arm.cc (Arm_relobj::processor_specific_flags): New method
7533 definition.
7534 (Arm_relobj::do_read_symbols): New method declaration.
7535 (Arm_relobj::processor_specific_flags_): New data member declaration.
7536 (Arm_dynobj): New class definition.
7537 (Target_arm::do_finalize_sections): Add input_objects parameter.
7538 (Target_arm::do_adjust_elf_header): New method declaration.
7539 (Target_arm::are_eabi_versions_compatible,
7540 (Target_arm::merge_processor_specific_flags): New method declaration.
7541 (Target_arm::do_make_elf_object): New overloaded method definitions
7542 and declaration.
7543 (Arm_relobj::do_read_symbols): New method definition.
7544 (Arm_dynobj::do_read_symbols): Ditto.
7545 (Target_arm::do_finalize_sections): Add input_objects parameters.
7546 Merge processor-specific flags from all input objects.
7547 (Target_arm::are_eabi_versions_compatible,
7548 Target_arm::merge_processor_specific_flags,
7549 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
7550 New method definitions.
7551 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
7552 Input_objects pointer type parameter.
7553 * layout.cc (Layout::finalize): Pass input objects to target's.
7554 finalize_sections function.
7555 * output.cc (Output_file_header::do_sized_write): Set ELF file
7556 header's processor-specific flags.
7557 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
7558 Input_objects pointer type parameter.
7559 * sparc.cc (Target_sparc::do_finalize_sections): Same.
7560 * target.h (Input_objects): New forward class declaration.
7561 (Target::processor_specific_flags,
7562 Target::are_processor_specific_flags_sect): New method definitions.
7563 (Target::finalize_sections): Add input_objects parameter.
7564 (Target::Target): Initialize processor_specific_flags_ and
7565 are_processor_specific_flags_set_.
7566 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
7567 parameter.
7568 (Target::set_processor_specific_flags): New method definition.
7569 (Target::processor_specific_flags_,
7570 Target::are_processor_specific_flags_set_): New data member
7571 declarations.
7572 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
7573 Input_objects pointer type parameter.
7574
ebabffbd
DK
75752009-10-30 Doug Kwan <dougkwan@google.com>
7576
7577 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
7578
ad0f2072
ILT
75792009-10-28 Ian Lance Taylor <iant@google.com>
7580
7581 * object.h (class Relobj): Drop options parameter from
7582 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
7583 do_scan_relocs, do_relocate. Change all callers.
7584 (class Sized_relobj): Drop options parameters from
7585 do_gc_process_relocs, do_scan_relocs, do_relocate,
7586 do_relocate_sections, relocate_sections, emit_relocs_scan,
7587 emit_relocs_scan_reltype. Change all callers.
7588 (struct Relocate_info): Remove options field and all references to
7589 it.
7590 * reloc.h (class Read_relocs): Remove options constructor
7591 parameter and options_ field. Change all callers.
7592 (class Gc_process_relocs, class Scan_relocs): Likewise.
7593 (class Relocate_task): Likewise.
7594 * target-reloc.h (scan_relocs): Remove options parameter. Change
7595 all callers.
7596 (scan_relocatable_relocs): Likewise.
7597 * target.h (class Sized_target): Remove options parameter from
7598 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
7599 all callers.
7600 * gc.h (gc_process_relocs): Remove options parameter. Change all
7601 callers.
7602 * arm.cc: Update functions to remove options parameters.
7603 * i386.cc: Likewise.
7604 * powerpc.cc: Likewise.
7605 * sparc.cc: Likewise.
7606 * x86_64.cc: Likewise.
7607 * testsuite/testfile.cc: Likewise.
7608
8ffa3667
DK
76092009-10-28 Doug Kwan <dougkwan@google.com>
7610
7611 * arm.cc (Arm_relobj): New class definition.
e1df38aa 7612 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
7613 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
7614 New method definitions.
7615
40f36857
CC
76162009-10-28 Cary Coutant <ccoutant@google.com>
7617
7618 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
7619 (Plugin::cleanup_done_): New member.
7620 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
7621 (Plugin_manager::cleanup_done_): Remove.
7622 (Plugin_manager::add_input_file): Edit error message.
7623 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
7624 (Plugin_manager::cleanup): Remove use of cleanup_done_.
7625
2c849493
ILT
76262009-10-27 Mikolaj Zalewski <mikolajz@google.com>
7627
7628 * fileread.cc: (File_read::View::~View): Use the new
7629 data_ownership_ filed.
7630 (File_read::~File_read): Dispose the new whole_file_view_.
7631 (File_read::open): Mmap the whole file if needed.
7632 (File_read::open): Use whole_file_view_ instead of contents_.
7633 (File_read::find_view): Use whole_file_view_ if applicable.
7634 (File_read::do_read): Use whole_file_view_ instead of contents_.
7635 (File_read::make_view): Use whole_file_view_ instead of contents_,
7636 update File_read::View::View call.
7637 (File_read::find_or_make_view): Update File_read::View::View
7638 call.
7639 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
7640 remove contents_
7641 (File_read::View::Data_ownership): New enum.
7642 (File_read::View::View): Replace bool mapped_ with Data_ownership
7643 argument.
7644 (File_read::View::mapped_): Remove (replaced by data_ownership_).
7645 (File_read::View::data_ownership_): New field.
7646 (File_read::contents_): Remove (replaced by whole_file_view_).
7647 (File_read::whole_file_view_): New field.
7648 * options.h (class General_options): Add --keep-files-mapped.
7649
24998053
CC
76502009-10-27 Cary Coutant <ccoutant@google.com>
7651
7652 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
7653 * testsuite/Makefile.am (plugin_test_5): New test case.
7654 * testsuite/Makefile.in: Regenerate.
7655
72adc4fa
DK
76562009-10-25 Doug Kwan <dougkwan@google.com>
7657
7658 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
7659 from private to protected to allow access by child class.
7660 (Sized_relobj::do_relocate_sections): New method declaration.
7661 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 7662 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
7663 Sized_relobj::relocate_sections. Instantiate template explicitly
7664 for different target sizes and endianity.
7665
07f508a2
DK
76662009-10-24 Doug Kwan <dougkwan@google.com>
7667
7668 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
7669 (Arm_input_section::as_arm_input_section): New method.
7670 (Arm_output_section): New class definition.
7671 (Arm_output_section::create_stub_group,
7672 Arm_output_section::group_sections): New method definitions.
7673
10ad9fe5
DK
76742009-10-22 Doug Kwan <dougkwan@google.com>
7675
7676 * arm.cc (Arm_input_section): New class definition.
7677 (Arm_input_section::init, Arm_input_section:do_write,
7678 Arm_input_section::set_final_data_size,
7679 Arm_input_section::do_reset_address_and_file_offset): New method
7680 definitions.
7681
56ee5e00
DK
76822009-10-21 Doug Kwan <dougkwan@google.com>
7683
7684 * arm.cc (Stub_table, Arm_input_section): New forward class
7685 declarations.
7686 (Stub_table): New class defintion.
7687 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
7688 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
7689 New method definition.
7690
b569affa
DK
76912009-10-21 Doug Kwan <dougkwan@google.com>
7692
7693 * arm.cc: Update copyright comments.
7694 (Target_arm): New forward class template declaration.
7695 (Arm_address): New type.
7696 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
7697 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
7698 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
7699 constants.
7700 (Insn_template): Same.
7701 (DEF_STUBS): New macro.
7702 (Stub_type): New enum type.
7703 (Stub_template): New class definition.
7704 (Stub): Same.
7705 (Reloc_stub): Same.
7706 (Stub_factory): Same.
7707 (Target_arm::Target_arm): Initialize may_use_blx_ and
7708 should_force_pic_veneer_.
7709 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
7710 Target_arm::should_force_pic_veneer,
7711 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
7712 Target_arm::using_thumb_only, Target_arm:;default_target): New
7713 method defintions.
7714 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
7715 New data member declarations.
7716 (Insn_template::size, Insn_template::alignment): New method defintions.
7717 (Stub_template::Stub_template): New method definition.
7718 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
7719 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
7720 (Stub_factory::Stub_factory): New method definition.
7721 * gold.h (string_hash): New template.
7722 * output.h (Input_section_specifier::hash_value): Use
7723 gold::string_hash.
7724 (Input_section_specifier::string_hash): Remove.
7725 * stringpool.cc (Stringpool_template::string_hash): Use
7726 gold::string_hash.
7727
6c172549
DK
77282009-10-20 Doug Kwan <dougkwan@google.com>
7729
7730 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
7731 symbols of relaxed input sections.
7732 * output.h (Output_section::find_relaxed_input_section): Make
7733 method public.
7734
c5617f2f
DK
77352009-10-16 Doug Kwan <dougkwan@google.com>
7736
7737 * dynobj.cc (Versions::Versions): Initialize version_script_.
7738 Only insert base version symbol definition for a shared object
7739 if version script defines any version versions.
7740 (Versions::define_base_version): New method definition.
7741 (Versions::add_def): Check that base version is not needed.
7742 (Versions::add_need): Define base version lazily.
7743 * dynobj.h (Versions::define_base_version): New method declaration.
7744 (Versions::needs_base_version_): New data member declaration.
7745 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
7746 (check_DATA): Add no_version_test.stdout.
7747 (libno_version_test.so, no_version_test.o no_version_test.stdout):
7748 New make rules.
7749 * testsuite/Makefile.in: Regenerate.
7750 * testsuite/no_version_test.c: New file.
7751 * testsuite/no_version_test.sh: Ditto.
7752
3c12dcdb
DK
77532009-10-16 Doug Kwan <dougkwan@google.com>
7754
7755 * expression.cc (class Segment_start_expression): New class definition.
7756 (Segment_start_expression::value): New method definition.
7757 (script_exp_function_segment_start): Return a new
7758 Segment_start_expression.
7759 * gold/script-c.h (script_saw_segment_start_expression): New function
7760 prototype.
7761 * script-sections.cc (Script_sections::Script_sections): Initialize
7762 SAW_SEGMENT_START_EXPRESSION_ to false.
7763 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
7764 and -Tbbs options to specify section addresses if given in
7765 command line and no SEGMENT_START expression is seen in a script.
7766 * script-sections.h (Script_sections::saw_segment_start_expression,
7767 Script_sections::set_saw_segment_start_expression): New method
7768 definition.
7769 (Script_sections::saw_segment_start_expression_): New data member
7770 declaration.
7771 * script.cc (script_saw_segment_start_expression): New function.
7772 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
7773 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
7774 script_test_7.sh and script_test_8.sh.
7775 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
7776 script_test_8.stdout.
7777 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
7778 (script_test_6, script_test_6.stdout, script_test_7,
7779 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
7780 * Makefile.in: Regenerate.
7781 * testsuite/script_test_6.sh: New file.
7782 * testsuite/script_test_6.t: Same.
7783 * testsuite/script_test_7.sh: Same.
7784 * testsuite/script_test_7.t: Same.
7785 * testsuite/script_test_8.sh: Same.
7786
64b1ae37
DK
77872009-10-16 Doug Kwan <dougkwan@google.com>
7788
7789 * output.cc (Output_segment::set_section_list_address): Cast
7790 expressions to unsigned long long type to avoid format warnings.
7791
661be1e2
ILT
77922009-10-15 Ian Lance Taylor <iant@google.com>
7793
12edd763 7794 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 7795 dot assignment to script_sections_.
12edd763
ILT
7796 * script-sections.cc (Script_sections::add_dot_assignment):
7797 Initialize if necessary.
7798
68b6574b
ILT
7799 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
7800 program headers with no load segment if there is a linker script.
7801
661be1e2
ILT
7802 * layout.cc (Layout::set_segment_offsets): Align the file offset
7803 to the segment aligment for -N or -n with no load segment.
7804 * output.cc (Output_segment::add_output_section): Don't crash if
7805 the first section is a TLS section.
7806 (Output_segment::set_section_list_addresses): Print an error
7807 message if the address moves backward in a linker script.
7808 * script-sections.cc
7809 (Output_section_element_input::set_section_addresses): Don't
7810 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
7811 (Orphan_output_section::set_section_addresses): Likewise.
7812
f15f61a7
DK
78132009-10-15 Doug Kwan <dougkwan@google.com>
7814
7815 * layout.cc (Layout::finish_dynamic_section): Generate tags
7816 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
7817 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
7818 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
7819
82bb573a
ILT
78202009-10-14 Ian Lance Taylor <iant@google.com>
7821
7822 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
7823 fields.
7824 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
7825 data_shdr fields of relinfo.
7826 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
7827 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
7828 R_386_TLS_LDO_32, adjust based on section flags.
7829 (Target_i386::Relocate::fix_up_ldo): Remove.
7830
374ad285
ILT
78312009-10-13 Ian Lance Taylor <iant@google.com>
7832
7833 Add support for -pie.
7834 * options.h (class General_options): Add -pie and
7835 --pic-executable.
7836 (General_options::output_is_position_independent): Test -pie.
7837 (General_options::output_is_executable): Return true if not shared
7838 and not relocatable.
7839 (General_options::output_is_pie): Remove.
7840 * options.cc (General_options::finalize): Reject incompatible uses
7841 of -pie.
7842 * gold.cc (queue_middle_tasks): A -pie link is not static.
7843 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
7844 * symtab.cc (Symbol::final_value_is_known): Return false if
7845 output_is_position_independent.
7846 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
7847 output_is_position_independent.
7848 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
7849 output_is_position_independent.
7850 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
7851 output_is_position_independent.
7852 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
7853 two_file_pie_test.
7854 (basic_pie_test.o, basic_pie_test): New targets.
7855 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
7856 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
7857 (two_file_pie_test): New target.
7858 * testsuite/Makefile.in: Rebuild.
7859 * README: Remove note saying that -pie is not supported.
7860
c6585162
ILT
78612009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
7862
7863 * options.h (class General_options): Add -init and -fini.
7864 * layout.cc (Layout::finish_dynamic_section): Emit
7865 given init and fini functions.
7866
032ce4e9
ST
78672009-10-13 Sriraman Tallam <tmsriram@google.com>
7868
7869 * gc.h (gc_process_relocs): Check if icf is enabled using new
7870 function.
7871 * gold.cc (queue_initial_tasks): Likewise.
7872 (queue_middle_tasks): Likewise.
7873 * object.cc (do_layout): Likewise.
7874 * symtab.cc (is_section_folded): Likewise.
7875 * main.cc (main): Likewise.
7876 * reloc.cc (Read_relocs::run): Likewise.
7877 (Sized_relobj::do_scan_relocs): Likewise.
7878 * icf.cc (is_function_ctor_or_dtor): New function.
7879 (Icf::find_identical_sections): Check if function is ctor or dtor when
7880 safe icf is chosen.
7881 * options.h (General_options::icf): Change option to be an enum.
7882 (Icf_status): New enum.
7883 (icf_enabled): New method.
7884 (icf_safe_folding): New method.
7885 (set_icf_status): New method.
7886 (icf_status_): New variable.
7887 * (options.cc) (General_options::finalize): Set icf_status_.
7888 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
7889 icf_test and icf_keep_unique_test to use the --icf enum flag.
7890 * testsuite/icf_safe_test.sh: New file.
e1df38aa 7891 * testsuite/icf_safe_test.cc: New file.
032ce4e9 7892
f345227a
ST
78932009-10-12 Sriraman Tallam <tmsriram@google.com>
7894
7895 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
7896 includes to gc.h and icf.h.
7897 * arm.cc: Include gc.h.
7898 * gold.cc: Likewise.
7899 * i386.cc: Likewise.
7900 * powerpc.cc: Likewise.
7901 * sparc.cc: Likewise.
7902 * x86_64.cc: Likewise.
7903 * gc.h: Include icf.h.
7904
1c7814ed
ILT
79052009-10-11 Ian Lance Taylor <iant@google.com>
7906
7907 * plugin.cc: Include "gold.h" before other header files.
7908
ae3b5189
CD
79092009-10-10 Chris Demetriou <cgd@google.com>
7910
7911 * options.h (Input_file_argument::Input_file_type): New enum.
7912 (Input_file_argument::is_lib_): Replace with...
7913 (Input_file_argument::type_): New member.
7914 (Input_file_argument::Input_file_argument): Take Input_file_type
7915 'type' rather than boolean 'is_lib' as second argument.
7916 (Input_file_argument::is_lib): Use type_.
7917 (Input_file_argument::is_searched_file): New function.
7918 (Input_file_argument::may_need_search): Handle is_searched_file.
7919 * options.cc (General_options::parse_library): Support -l:filename.
7920 (General_options::parse_just_symbols): Update for Input_file_argument
7921 changes.
7922 (Command_line::process): Likewise.
7923 * archive.cc (Archive::get_file_and_offset): Likewise.
7924 * plugin.cc (Plugin_manager::release_input_file): Likewise.
7925 * script.cc (read_script_file, script_add_file): Likewise.
7926 * fileread.cc (Input_file::Input_file): Likewise.
7927 (Input_file::will_search_for): Handle is_searched_file.
7928 (Input_file::open): Likewise.
7929 * readsyms.cc (Read_symbols::get_name): Likewise.
7930 * testsuite/Makefile.am (searched_file_test): New test.
7931 * testsuite/Makefile.in: Regenerate.
7932 * testsuite/searched_file_test.cc: New file.
7933 * testsuite/searched_file_test_lib.cc: New file.
7934
f3048a1d
ILT
79352009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7936 Ian Lance Taylor <iant@google.com>
7937
7938 * descriptor.cc: Include <cstdio> and "binary-io.h".
7939 (Descriptors::open): Open the files in binary mode always.
7940 * script.cc (Lex::get_token): Treat \r as whitespace.
7941
d4780e57
ILT
79422009-10-09 Ian Lance Taylor <iant@google.com>
7943
7944 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
7945
d9a893b8
ILT
79462009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7947 Ian Lance Taylor <iant@google.com>
7948
7949 * configure.ac: Check for readv function also.
7950 * fileread.cc (readv): Define if not HAVE_READV.
7951 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
7952 does not exist.
7953 * config.in: Regenerate.
7954 * configure: Regenerate.
7955
c0a62865
DK
79562009-10-09 Doug Kwan <dougkwan@google.com>
7957
7958 * layout.cc (Layout::make_output_section): Call target hook to make
7959 ordinary output section.
7960 (Layout::finalize): Adjust parameter list of call the
7961 Target::may_relax().
7962 * layout.h (class Layout::section_list): New method.
7963 * merge.h (Output_merge_base::entsize): Change visibility to public.
7964 (Output_merge_base::is_string, Output_merge_base::do_is_string):
7965 New methods.
7966 (Output_merge_string::do_is_string): New method.
7967 * object.cc (Sized_relobj::do_setup): renamed from
7968 Sized_relobj::set_up.
7969 * object.h (Sized_relobj::adjust_shndx,
7970 Sized_relobj::initializ_input_to_output_maps,
7971 Sized_relobj::free_input_to_output_maps): Change visibilities to
7972 protected.
7973 (Sized_relobj::setup): Virtualize.
7974 (Sized_relobj::do_setup): New method declaration.
7975 (Sized_relobj::invalidate_section_offset,
7976 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
7977 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
7978 * options.cc (parse_int): New function.
7979 * options.h (parse_int): New declaration.
7980 (DEFINE_int): New macro.
7981 (stub_group_size): New option.
7982 * output.cc (Output_section::Output_section): Initialize memebers
7983 merge_section_map_, merge_section_by_properties_map_,
7984 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
7985 (Output_section::add_input_section): Handled deferred code-fill
7986 generation and remove an old comment.
7987 (Output_section::add_relaxed_input_section): New method definition.
7988 (Output_section::add_merge_input_section): Use merge section by
7989 properties map to speed to search. Update merge section maps
7990 as appropriate.
7991 (Output_section::build_relaxation_map): New method definition.
7992 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7993 Same.
7994 (Output_section::relax_input_section): Renamed to
7995 Output_section::convert_input_sections_to_relaxed_sections and change
7996 interface to take a vector of pointers to relaxed sections.
7997 (Output_section::find_merge_section,
7998 Output_section::find_relaxed_input_section): New method definitions.
7999 (Output_section::is_input_address_mapped,
8000 Output_section::output_offset, Output_section::output_address):
8001 Use output section data maps to speed up searching.
8002 (Output_section::find_starting_output_address): Add comments.
8003 (Output_section::do_write,
8004 Output_section::write_to_postprocessing_buffer): Do code-fill
8005 generation as appropriate.
8006 (Output_section::get_input_sections): Invalidate relaxed input section
8007 map.
8008 (Output_section::restore_states): Adjust type of checkpoint .
8009 Invalidate relaxed input section map.
8010 * output.h (Output_merge_base): New class declaration.
8011 (Input_section_specifier): New class defintion.
8012 (class Output_relaxed_input_section) Change base class to
8013 Output_section_data_build.
8014 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
8015 base class initializer.
8016 (Output_section::add_relaxed_input_section): New method declaration.
8017 (Output_section::Input_section): Change visibility to protected.
8018 (Output_section::Input_section::relobj,
8019 Output_section::Input_section::shndx): Handle relaxed input sections.
8020 Output_section::input_sections) Change visibility to protected. Also
8021 define overload to return a non-const pointer.
8022 (Output_section::Merge_section_properties): New class defintion.
8023 (Output_section::Merge_section_by_properties_map,
8024 Output_section::Output_section_data_by_input_section_map,
8025 Output_section::Relaxation_map): New types.
8026 (Output_section::relax_input_section): Rename method to
8027 Output_section::convert_input_sections_to_relaxed_sections and change
8028 interface to take a vector of relaxed section pointers.
8029 (Output_section::find_merge_section,
8030 Output_section::find_relaxed_input_section,
8031 Output_section::build_relaxation_map,
8032 Output_section::convert_input_sections_in_list_to_relaxed_sections):
8033 New method declarations.
8034 (Output_section::merge_section_map_
8035 Output_section::merge_section_by_properties_map_,
8036 Output_section::relaxed_input_section_map_,
8037 Output_section::is_relaxed_input_section_map_valid_,
8038 Output_section::generate_code_fills_at_write_): New data members.
8039 * script-sections.cc
8040 (Output_section_element_input::set_section_addresses): Call
8041 current_data_size and addralign methods of relaxed input sections.
8042 (Orphan_output_section::set_section_addresses): Call current_data_size
8043 and addralign methods of relaxed input sections.
8044 * symtab.cc (Symbol_table::compute_final_value): Extract template
8045 from the body of Symbol_table::sized_finalize_symbol.
8046 (Symbol_table::sized_finalized_symbol): Call
8047 Symbol_table::compute_final_value.
8048 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
8049 (Symbol_table::compute_final_value): New templated method declaration.
8050 * target.cc (Target::do_make_output_section): New method defintion.
8051 * target.h (Target::make_output_section): New method declaration.
8052 (Target::relax): Add more parameters for input objects, symbol table
8053 and layout. Adjust call to do_relax.
8054 (Target::do_make_output_section): New method declaration.
8055 (Target::do_relax): Add parameters for input objects, symbol table
8056 and layout.
8057
d446d6c4
ILT
80582009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8059
8060 * pread.c: Include stdio.h.
8061
bc06c745
ILT
80622009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8063
8064 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
8065 defined.
8066
75aea3d0
ILT
80672009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8068
8069 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8070 Change read_shndx type to unsigned int.
8071 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
8072 int.
8073 (Sized_dwarf_line_info::read_line_mappings): Likewise.
8074 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
8075 Change read_shndx type to unsigned int.
8076 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
8077 int.
8078 (Sized_dwarf_line_info::read_line_mappings): Likewise.
8079 * layout.cc (Layout::create_symtab_sections): Cast the result of
8080 local_symcount * symsize to off_t in the gold_assert.
8081
be8fcb75
ILT
80822009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8083
8084 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
8085 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
8086 R_ARM_BASE_ABS.
8087 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
8088 (Arm_relocate_functions::thm_abs5): New function.
8089 (Arm_relocate_functions::abs12): New function.
8090 (Arm_relocate_functions::abs16): New function.
8091 (Arm_relocate_functions::base_abs): New function.
8092 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
8093 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
8094 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
8095 R_ARM_BASE_ABS.
8096 (Scan::global): Likewise.
8097 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
8098 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
8099 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
8100 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
8101 R_ARM_BASE_ABS.
8102
c2a122b6
ILT
81032009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8104
8105 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
8106 (Arm_relocate_functions::movt_prel): New function.
8107 (Arm_relocate_functions::thm_movw_prel_nc): New function.
8108 (Arm_relocate_functions::thm_movt_prel): New function.
8109 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
8110 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
8111 (Scan::global, Relocate::relocate): Likewise.
8112 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8113
c4aa1e2d
ILT
81142009-10-09 Mikolaj Zalewski <mikolajz@google.com>
8115
8116 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
8117 Incremental_checker.
8118 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
8119 unsigned int.
8120 (class Incremental_inputs_header): New class.
8121 (Incremental_inputs_header_writer): Edit comment.
8122 (Incremental_inputs_entry): New class.
8123 (Incremental_inputs_entry_writer): Edit comment.
8124 (Sized_incremental_binary::do_find_incremental_inputs_section):
8125 Add *strtab_shndx parameter, fill it.
8126 (Sized_incremental_binary::do_check_inputs): New method.
8127 (Incremental_checker::can_incrementally_link_output_file): Use
8128 Sized_incremental_binary::check_inputs.
8129 (Incremental_inputs::report_command_line): Save command line in
8130 command_line_.
8131 * incremental.h:
8132 (Incremental_binary::find_incremental_inputs_section): New
8133 method.
8134 (Incremental_binary::do_find_incremental_inputs_section): Add
8135 strtab_shndx parameter.
8136 (Incremental_binary::do_check_inputs): New pure virtual method.
8137 (Sized_incremental_binary::do_check_inputs): Declare.
8138 (Incremental_checker::Incremental_checker): Add incremental_inputs
8139 parameter, use it to initialize incremental_inputs_.
8140 (Incremental_checker::incremental_inputs_): New field.
8141 (Incremental_checker::command_line): New method.
8142 (Incremental_checker::inputs): New method.
8143 (Incremental_checker::command_line_): New field.
8144
c549a694
ILT
81452009-10-09 Mikolaj Zalewski <mikolajz@google.com>
8146
8147 * incremental.cc: Include <cstdarg> and "target-select.h".
8148 (vexplain_no_incremental): New function.
8149 (explain_no_incremental): New function.
8150 (Incremental_binary::error): New method.
8151 (Sized_incremental_binary::do_find_incremental_inputs_section): New
8152 method.
8153 (make_sized_incremental_binary): New function.
8154 (open_incremental_binary): New function.
8155 (can_incrementally_link_file): Add checks if output is ELF and has
8156 inputs section.
8157 * incremental.h: Include "elfcpp_file.h" and "output.h".
8158 (Incremental_binary): New class.
8159 (Sized_incremental_binary): New class.
8160 (open_incremental_binary): Declare.
8161 * object.cc (is_elf_object): Use
8162 elfcpp::Elf_recognizer::is_elf_file.
8163 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
8164 * output.h (Output_file::filesize): New method.
8165
fd3c5f0b
ILT
81662009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8167
8168 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
8169 New function.
8170 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
8171 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
8172 function.
8173 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
8174 function.
8175 (Arm_relocate_functions::movw_abs_nc): New function.
8176 (Arm_relocate_functions::movt_abs): New function.
8177 (Arm_relocate_functions::thm_movw_abs_nc): New function.
8178 (Arm_relocate_functions::thm_movt_abs): New function.
8179 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
8180 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
8181 (Scan::global): Likewise.
8182 (Relocate::relocate): Likewise.
8183 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8184
7f5309a5
ILT
81852009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8186
8187 * arm.cc (Arm_relocate_functions::got_prel) New function.
8188 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
8189 (Relocate::relocate): Likewise.
8190 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8191
364c7fa5
ILT
81922009-10-06 Ian Lance Taylor <iant@google.com>
8193
8194 * options.h (class General_options): Define
8195 split_stack_adjust_size parameter.
8196 * object.h (class Object): Add uses_split_stack_ and
8197 has_no_split_stack_ fields. Add uses_split_stack and
8198 has_no_split_stack accessor functions. Declare
8199 handle_split_stack_section.
8200 (class Reloc_symbol_changes): Define.
8201 (class Sized_relobj): Define Function_offsets. Declare
8202 split_stack_adjust, split_stack_adjust_reltype, and
8203 find_functions.
8204 * object.cc (Object::handle_split_stack_section): New function.
8205 (Sized_relobj::do_layout): Call handle_split_stack_section.
8206 * dynobj.cc (Sized_dynobj::do_layout): Call
8207 handle_split_stack_section.
8208 * reloc.cc (Sized_relobj::relocate_sections): Call
8209 split_stack_adjust for executable sections in split_stack
8210 objects. Pass reloc_map to relocate_section.
8211 (Sized_relobj::split_stack_adjust): New function.
8212 (Sized_relobj::split_stack_adjust_reltype): New function.
8213 (Sized_relobj::find_functions): New function.
8214 * target-reloc.h: Include "object.h".
8215 (relocate_section): Add reloc_symbol_changes parameter. Change
8216 all callers.
8217 * target.h (class Target): Add calls_non_split method. Declare
8218 do_calls_non_split virtual method. Declare match_view and
8219 set_view_to_nop.
8220 * target.cc: Include "elfcpp.h".
8221 (Target::do_calls_non_split): New function.
8222 (Target::match_view): New function.
8223 (Target::set_view_to_nop): New function.
8224 * gold.cc (queue_middle_tasks): Give an error if mixing
8225 split-stack and non-split-stack objects with -r.
8226 * i386.cc (Target_i386::relocate_section): Add
8227 reloc_symbol_changes parameter.
8228 (Target_i386::do_calls_non_split): New function.
8229 * x86_64.cc (Target_x86_64::relocate_section): Add
8230 reloc_symbol_changes parameter.
8231 (Target_x86_64::do_calls_non_split): New function.
8232 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
8233 parameter.
8234 * powerpc.cc (Target_powerpc::relocate_section): Add
8235 reloc_symbol_changes parameter.
8236 * sparc.cc (Target_sparc::relocate_section): Add
8237 reloc_symbol_changes parameter.
8238 * configure.ac: Call AM_CONDITIONAL for the default target.
8239 * configure: Rebuild.
8240 * testsuite/Makefile.am (TEST_AS): New variable.
8241 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
8242 (check_DATA): Add split_i386 and split_x86_64 files.
8243 (SPLIT_DEFSYMS): Define.
8244 (split_i386_[1234n].o): New targets.
8245 (split_i386_[124]): New targets.
8246 (split_i386_[1234r].stdout): New targets.
8247 (split_x86_64_[1234n].o): New targets.
8248 (split_x86_64_[124]): New targets.
8249 (split_x86_64_[1234r].stdout): New targets.
8250 (MOSTLYCLEANFILES): Add new executables.
8251 * testsuite/split_i386.sh: New file.
8252 * testsuite/split_x86_64.sh: New file.
8253 * testsuite/split_i386_1.s: New file.
8254 * testsuite/split_i386_2.s: New file.
8255 * testsuite/split_i386_3.s: New file.
8256 * testsuite/split_i386_4.s: New file.
8257 * testsuite/split_i386_n.s: New file.
8258 * testsuite/split_x86_64_1.s: New file.
8259 * testsuite/split_x86_64_2.s: New file.
8260 * testsuite/split_x86_64_3.s: New file.
8261 * testsuite/split_x86_64_4.s: New file.
8262 * testsuite/split_x86_64_n.s: New file.
8263 * testsuite/testfile.cc (Target_test): Update relocation_section
8264 function.
8265 * testsuite/Makefile.in: Rebuild.
8266
e8a9fcda
ILT
82672009-10-06 Ian Lance Taylor <iant@google.com>
8268
8269 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
8270 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
8271 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
8272 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
8273 the address on ldo_addrs_.
8274 (Target_i386::Relocate::fix_up_ldo): New function.
8275
e99daf92
ILT
82762009-10-06 Rafael Espindola <espindola@google.com>
8277
8278 * plugin.cc (add_input_library): New.
8279 (Plugin::load): Add add_input_library to tv.
8280 (Plugin_manager::add_input_file): Add the is_lib argument.
8281 (add_input_file): Update call to Plugin_manager::add_input_file.
8282 (add_input_library): New.
8283 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
8284
966d4097
DK
82852009-09-30 Doug Kwan <dougkwan@google.com>
8286
8287 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
8288 symbol and call Symbol::may_need_copy_reloc to determine if
8289 a copy reloc is needed.
8290 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
8291 nocopyreloc is given in command line.
8292 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
8293 given in command line.
8294 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
8295 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
8296 of the removed Target_i386::may_need_copy_reloc.
8297 * options.h (copyreloc): New option with default value false.
8298 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
8299 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
8300 instead of the removed Target_powerpc::may_need_copy_reloc.
8301 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
8302 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
8303 instead of the removed Target_sparc::may_need_copy_reloc.
8304 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
8305 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
8306 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
8307 instead of the removed Target_x86_64::may_need_copy_reloc.
8308
029ba973
ILT
83092009-09-30 Ian Lance Taylor <iant@google.com>
8310
8311 * object.h (class Object): Remove target_ field, and target,
8312 sized_target, and set_target methods.
8313 (Object::sized_target): Remove.
8314 (class Sized_relobj): Update declarations. Remove sized_target.
8315 * object.cc (Sized_relobj::setup): Remove target parameter.
8316 Change all callers.
8317 (Input_objects::add_object): Don't do anything with the target.
8318 (make_elf_sized_object): Add punconfigured parameter. Change all
8319 callers. Set or test parameter target.
8320 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
8321 Change all callers.
8322 * parameters.cc (Parameters::set_target): Change parameter type to
8323 be non-const.
8324 (Parameters::default_target): Remove.
8325 (set_parameters_target): Change parameter type to be non-const.
8326 (parameters_force_valid_target): New function.
8327 (parameters_clear_target): New function.
8328 * parameters.h (class Parameters): Update declarations. Remove
8329 default_target method. Add sized_target and clear_target
8330 methods. Change target_ to be non-const.
8331 (set_parameters_target): Update declaration.
8332 (parameters_force_valid_target): Declare.
8333 (parameters_clear_target): Declare.
8334 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
8335 as NULL if we aren't searching.
8336 (Add_symbols::run): Don't check for compatible target.
8337 * fileread.cc (Input_file::open_binary): Call
8338 parameters_force_valid_target.
8339 * gold.cc (queue_middle_tasks): Likewise.
8340 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
8341 set_target on object.
8342 * dynobj.h (class Sized_dynobj): Update declarations.
8343 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
8344 make_elf_object returns NULL.
8345 (Archive::include_member): Don't check whether object target is
8346 compatible.
8347 * output.cc (Output_section::add_input_section): Get target from
8348 parameters.
8349 (Output_section::relax_input_section): Likewise.
8350 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
8351 parameters.
8352 (Sized_relobj::do_scan_relocs): Likewise.
8353 (Sized_relobj::relocate_sections): Likewise.
8354 * resolve.cc (Symbol_table::resolve): Likewise.
8355 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
8356 parameter. Change all callers.
8357 (Symbol_table::add_from_object): Get target from parameters.
8358 (Symbol_table::add_from_relobj): Don't check object target.
8359 (Symbol_table::add_from_dynobj): Likewise.
8360 (Symbol_table::define_special_symbol): Get target from
8361 parameters.
8362 * symtab.h (class Symbol_table): Update declaration.
8363 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
8364 parameter. Change all callers. Clear parameter target.
8365 (Binary_test): Test target here.
8366 * testsuite/object_unittest.cc (gold_testsuite): Remove
8367 target_test_pointer parameter. Change all callers.
8368 (Object_test): Test target here.
8369
a6a22b83
ILT
83702009-09-26 Ian Lance Taylor <iant@google.com>
8371
8372 * testsuite/initpri1.c: Don't try to use constructor priorities if
8373 compiling with gcc before 4.3.
8374
6a8f49fe
ILT
83752009-09-22 Mikolaj Zalewski <mikolajz@google.com>
8376
8377 * testsuite/retain_symbols_file_test.sh (check_present): Change
8378 output file name to retain_symbols_file_test.stdout.
8379 (check_absent): Likewise.
8380
8c604651
CS
83812009-09-18 Craig Silverstein <csilvers@google.com>
8382
8383 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
8384 * options.cc: Include <cerrno> and <fstream>.
8385 (General_options::finalize): Parse -retain-symbols-file tag.
8386 * options.h: New flag.
8387 (General_options): New method should_retain_symbol, new
8388 variable symbols_to_retain.
8389 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
8390 should_retain_symbol map.
8391 * testsuite/Makefile.am (retain_symbols_file_test): New test.
8392 * testsuite/Makefile.in: Regenerate.
8393 * testsuite/retain_symbols_file_test.sh: New file.
8394
ca58b19f
NC
83952009-09-18 Nick Clifton <nickc@redhat.com>
8396
8397 * po/es.po: Updated Spanish translation.
8398
20e6d0d6
DK
83992009-09-17 Doug Kwan <dougkwan@google.com>
8400
8401 * debug.h (DEBUG_RELAXATION): New constant.
8402 (DEBUG_ALL): Add DEBUG_RELAXATION.
8403 (debug_string_to_enum): Add relaxation debug option.
8404 * layout.cc
8405 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
8406 Layout::Relaxation_debug_check::read_sections,
8407 Layout::Relaxation_debug_check::read_sections): New method definitions.
8408 (Layout::Layout): Initialize data members
8409 record_output_section_data_from_scrips_,
8410 script_output_section_data_list_ and relaxation_debug_check_.
8411 (Layout::save_segments, Layout::restore_segments,
8412 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
8413 Layout::relaxation_loop_body): New method definitions.
8414 (Layout::finalize): Support relaxation. Move section layout code to
8415 Layout::relaxation_loop_body.
8416 (Layout::set_asection_address_from_script): Move code for orphan
8417 section placement out.
8418 (Layout::place_orphan_sections_in_script): New method definition.
8419 * layout.h (Output_segment_headers, Output_file_header):
8420 New forward class declarations.
8421 (Layout::~Layout): Define.
8422 (Layout::new_output_section_data_from_script): New method definition.
8423 (Layout::place_orphan_sections_in_script): New method declaration.
8424 (Layout::Segment_states): New type declaration.
8425 (Layout::save_segments, Layout::restore_segments,
8426 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
8427 Layout::relaxation_loop_body): New method declarations.
8428 (Layout::Output_section_data_list): New type declaration.
8429 (Layout::Relaxation_debug_check): New class definition.
8430 (Layout::record_output_section_data_from_script_,
8431 Layout::script_output_section_data_list_, Layout::segment_states_,
8432 Layout::relaxation_debug_check_): New data members.
8433 * output.cc: (Output_section_headers::do_size): New method definition.
8434 (Output_section_headers::Output_section_headers): Move size
8435 computation to Output_section_headers::do_size.
8436 (Output_segment_headers::do_size): New method definition.
e1df38aa 8437 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
8438 Output_file_header::do_size and call it.
8439 (Output_file_header::do_size): New method definition.
8440 (Output_data_group::Output_data_group): Adjust call to
8441 Output_section_data.
8442 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
8443 (Output_symtab_xindex::do_write): Add array bound check.
8444 (Output_section::Input_section::print_to_mapfile): Handle
8445 RELAXED_INPUT_SECTION_CODE.
8446 (Output_section::Output_section): Initialize data member checkpoint_.
8447 (Output_section::~Output_section): Delete checkpoint object pointed
8448 by checkpoint_.
8449 (Output_section::add_input_section): Always add an Input_section if
8450 relaxing.
8451 (Output_section::add_merge_input_section): Add assert.
8452 (Output_section::relax_input_section): New method definition.
8453 (Output_section::set_final_data_size): Set load address to zero for
8454 an unallocated section.
8455 (Output_section::do_address_and_file_offset_have_reset_values):
8456 New method definition.
8457 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
8458 Handle relaxed input section.
8459 (Output_section::sort_attached_input_sections): Checkpoint input
8460 section list lazily.
8461 (Output_section::get_input_sections): Change type of input_sections to
8462 list of Simple_input_section pointers. Checkpoint input section list
8463 lazily. Also handle relaxed input sections.
8464 (Output_section::add_input_section_for_script): Take a reference to
8465 a Simple_input_section object instead of Relobj pointer and section
8466 index as parameter. Handle relaxed input sections.
8467 (Output_section::save_states, Output_section::restore_states): New
8468 method definitions.
8469 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
8470 (Output_data::is_data_size_fixed): New method definition.
8471 (Output_data::reset_addresss_and_file_offset): Do not reset data size
8472 if it is fixed.
8473 (Output_data::address_and_file_offset_have_reset_values): New method
8474 definition.
8475 (Output_data::do_address_and_file_offset_have_reset_values): New method
8476 definition.
8477 (Output_data::set_data_size): Check that data size is not fixed.
8478 (Output_data::fix_data_size): New method definition.
8479 (Output_data::is_data_size_fixed_): New data member.
8480 (Output_section_headers::set_final_data_size): New method definition.
8481 (Output_section_headers::do_size): New method declaration.
8482 (Output_segment_headers::set_final_data_size): New method definition.
8483 (Output_segment_headers::do_size): New method declaration.
8484 (Output_file_header::set_final_data_size)::New method definition.
8485 (Output_file_header::do_size)::New method declaration.
8486 (Output_section_data::Output_section_data): Add new parameter
8487 is_data_size_fixed and use it to fix data size.
8488 (Output_data_const::Output_data_const): Adjust call to base class
8489 constructor and fix data size.
8490 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
8491 base class constructor and fix data size.
8492 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
8493 base class constructor and fix data size.
8494 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
8495 class constructor and fix data size.
8496 (Output_data_group::set_final_data_size): New method definition.
8497 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
8498 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
8499 class constructor and fix data size.
8500 (Output_relaxed_input_section): New class definition.
8501 (Output_section::Simple_input_section): New class definition.
8502 (Output_section::get_input_sections): Adjust parameter list.
8503 (Output_section::add_input_section_for_script): Same.
8504 (Output_section::save_states, Output_section::restore_states,
8505 Output_section::do_address_and_file_offset_have_reset_values,
8506 (Output_section::Input_section::Input_section): Handle
8507 RELAXED_INPUT_SECTION_CODE. Add new overload for
8508 Output_relaxed_input_section.
8509 (Output_section::Input_section::is_input_section,
8510 Output_section::Input_section::set_output_section): Handle relaxed
8511 input section.
8512 (Output_section::Input_section::is_relaxed_input_section,
8513 Output_section::Input_section::output_section_data,
8514 Output_section::Input_section::relaxed_input_section): New method
8515 definitions.
8516 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
8517 value.
8518 (Output_section::Input_section::u1_): Update comments.
8519 (Output_section::Input_section::u2_): Add new union member poris.
8520 (Output_section::Checkpoint_output_section): New classs definition.
8521 (Output_section::relax_input_section): New method declaration.
8522 (Output_section::checkpoint_): New data member.
8523 (Output_segment): Update comments.
8524 (Output_segment::Output_segment): Un-privatize copy constructor.
8525 (Output_segment::operator=): Un-privatize.
8526 * script-sections.cc (Output_section_element::Input_section_list):
8527 Change element type to Output_section::Simple_input_section.
8528 (Output_section_element_dot_assignment::set_section_addresses):
8529 Register output section data for relaxation clean up.
8530 (Output_data_exression::Output_data_expression): Adjust call to base
8531 constructor to fix data size.
8532 (Output_section_element_data::set_section_addresses): Register
8533 Output_data_expression object for relaxation clean up.
8534 (struct Input_section_info): Replace Relobj pointer and section index
8535 pair with Output_section::Simple_input_section and Convert struct to a
8536 class.
8537 (Input_section_sorter::operator()): Adjust access to
e1df38aa 8538 Input_section_info data member to use accessors.
20e6d0d6
DK
8539 (Output_section_element_input::set_section_addresses): Use layout
8540 parameter. Adjust code to use Output_section::Simple_input_section
8541 and Input_secction_info classes. Register filler for relaxation
8542 clean up.
8543 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
8544 and section index pair with Output_section::Simple_input_section
8545 class. Adjust code accordingly.
8546 (Phdrs_element::release_segment): New method definition.
8547 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
8548 segment list.
8549 (Script_sections::release_segments): New method definition.
8550 * gold/script-sections.h (Script_sections::release_segments): New
8551 method declaration.
8552 * gold/target.h (Target::may_relax, Target::relax,
8553 Target::do_may_relax, Target::do_relax): New method definitions.
8554
5e445df6
ILT
85552009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8556
8557 * arm.cc (has_signed_unsigned_overflow): New function.
8558 (Arm_relocate_functions::abs8): New function.
8559 (Target_arm::Scan::local): Handle R_ARM_ABS8.
8560 (Target_arm::Scan::global): Likewise.
8561 (Target_arm::relocate::relocate): Likewise.
8562 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8563 Likewise.
8564
8c604651 85652009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
8566
8567 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
8568 * testsuite/Makefile.in: Regenerate.
8569
1e9cc1c2
NC
85702009-09-11 Nick Clifton <nickc@redhat.com>
8571
8572 * po/gold.pot: Updated by the Translation project.
8573
6a89f575
CC
85742009-09-08 Cary Coutant <ccoutant@google.com>
8575
8576 * output.cc (Output_file::open): Add execute permission to empty file.
8577 * testsuite/Makefile.am (permission_test): New test.
8578 * testsuite/Makefile.in: Regenerate.
8579
fdcac5af
ILT
85802009-09-02 Ian Lance Taylor <iant@google.com>
8581
8582 * output.cc (Output_file::resize): Call map_no_anonymous rather
8583 than map.
8584
44453f85
ILT
85852009-09-01 Mikolaj Zalewski <mikolajz@google.com>
8586
8587 * gold.cc: Include "incremental.h".
8588 (queue_initial_tasks): Call Incremental_checker methods.
8589 * incremental.cc: Include "output.h".
8590 (Incremental_checker::can_incrementally_link_output_file): New
8591 method.
8592 * incremental.h (Incremental_checker): New class.
8593
8594 * output.cc (Output_file::open_for_modification): New method.
8595 (Output_file::map_anonymous): Changed return type to bool. Record
8596 map in base_ field.
8597 (Output_file::map_no_anonymous): New method, broken out of map.
8598 (Output_file::map): Use map_no_anonymous and map_anonymous.
8599 * output.h (class Output_file): Update declarations.
8600
293c1386
CC
86012009-08-24 Cary Coutant <ccoutant@google.com>
8602
8603 * options.h (Command_line::Pre_options): New class.
8604 (Command_line::pre_options): New member.
8605 * options.cc (gold::options::ready_to_register): New variable.
8606 (One_option::register_option): Do nothing if not registering options.
8607 Assert if same short option registered twice.
8608 (General_options::General_options): Turn off option registration when
8609 done constructing.
8610 (Command_line::Pre_options::Pre_options): New constructor.
8611
f773f3d2
CC
86122009-08-24 Cary Coutant <ccoutant@google.com>
8613
06a73cfe
CC
8614 * options.h (General_options::no_keep_memory): Remove incorrect
8615 short option.
f773f3d2 8616
a15af8e2
RW
86172009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8618
8619 * Makefile.am (am__skiplex, am__skipyacc): New.
8620 * Makefile.in: Regenerate.
8621
c462b41b
RW
86222009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8623
14ec8efd
RW
8624 * Makefile.am (AM_CPPFLAGS): Renamed from ...
8625 (INCLUDES): ... this.
8626 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
8627 (AM_CPPFLAGS): Renamed from ...
8628 (INCLUDE): ... this.
8629 * Makefile.in, testsuite/Makefile.in: Regenerate.
8630
81ecdfbb
RW
8631 * Makefile.in: Regenerate.
8632 * aclocal.m4: Likewise.
8633 * config.in: Likewise.
8634 * configure: Likewise.
8635 * testsuite/Makefile.in: Likewise.
8636
c462b41b
RW
8637 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
8638 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
8639 * Makefile.in: Regenerate.
8640 * testsuite/Makefile.in: Regenerate.
8641
2da73f13
CC
86422009-08-19 Cary Coutant <ccoutant@google.com>
8643
8644 * resolve.cc (Symbol_table::resolve): Don't complain about defined
8645 symbols in shared libraries overridden by hidden or internal symbols
8646 in the main program.
8647
2db70501
CD
86482009-08-19 Chris Demetriou <cgd@google.com>
8649
8650 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
8651 checking source file names in error messages.
8652
f733487b
DK
86532009-08-18 Doug Kwan <dougkwan@google.com>
8654
8655 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
8656 an elcpp::Ehdr as parameter. Adjust call to set_target.
8657 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
8658 an elfcpp::Ehdr as parameter.
8659 * object.cc (Object::set_target): Remove the version that looks up
8660 a target and sets it.
8661 (Sized_relobj::setup): Take a Target object instead of
8662 an elfcpp::Ehdr as parameter. Adjust call to set_target.
8663 (make_elf_sized_object): Find target and ask target to
8664 make an ELF object.
8665 * object.h: (Object::set_target): Remove the version that looks up
8666 a target and sets it.
8667 (Sized_relobj::setup): Take a Target object instead of
8668 an elfcpp:Ehdr as parameter.
8669 * target.cc: Include dynobj.h.
8670 (Target::do_make_elf_object_implementation): New.
8671 (Target::do_make_elf_object): New.
8672 * target.h (Target::make_elf_object): New template declaration.
8673 (Target::do_make_elf_object): New method declarations.
8674 (Target::do_make_elf_object_implementation): New template declaration.
8675
cc70f101
ILT
86762009-08-14 Ian Lance Taylor <iant@google.com>
8677
8678 * gold.h (FUNCTION_NAME): Define.
8679 (gold_unreachable): Use FUNCTION_NAME.
8680
ef5e0cb1
ST
86812009-08-12 Sriraman Tallam <tmsriram@google.com>
8682
8683 * icf.cc (Icf::find_identical_sections): Issue a warning when a
8684 symbol in the --keep-unique list is not found.
8685
48c187ce
ST
86862009-08-12 Sriraman Tallam <tmsriram@google.com>
8687
8688 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
8689 been maked as --keep-unique.
8690 (Icf::unfold_section): New function.
8691 * icf.h (Icf::unfold_section): New function.
8692 * options.h (General_options::keep_unique): New option.
8693 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
8694 * testsuite/Makefile.in: Regenerate.
8695 * testsuite/icf_keep_unique_test.sh: New file.
8696 * testsuite/icf_keep_unique_test.cc: New file.
8697
645afe0c
CC
86982009-08-12 Cary Coutant <ccoutant@google.com>
8699
8700 PR 10471
8701 * resolve.cc (Symbol_table::resolve): Check for references from
8702 dynamic objects to hidden and internal symbols.
8703 * testsuite/Makefile.am (hidden_test.sh): New test.
8704 * testsuite/Makefile.in: Regenerate.
8705 * testsuite/hidden_test.sh: New script.
8706 * testsuite/hidden_test_1.c: New test source.
8707 * testsuite/hidden_test_main.c: New test source.
8708
11af873f
DK
87092009-08-11 Doug Kwan <dougkwan@google.com>
8710
8711 * arm.cc: Update comments.
8712 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
8713 segment to locate the .ARM.exidx section if present.
8714
b9f7d72d
DK
87152009-08-09 Doug Kwan <dougkwan@google.com>
8716
8717 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
8718 patch.
8719
ddd3c53c
ST
87202009-08-07 Sriraman Tallam <tmsriram@google.com>
8721 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
8722 compiler warnings.
8723
27721062
ST
87242009-08-06 Sriraman Tallam <tmsriram@google.com>
8725
8726 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
8727 valid tls_segment only for non-debug-section relocations.
8728 * testsuite/Makefile.am: Add gc_tls_test.
8729 * testsuite/Makefile.in: Regenerate.
8730 * testsuite/gc_tls_test.cc: New file.
8731 * testsuite/gc_tls_test.sh: New file.
8732
ef15dade 87332009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 8734
ef15dade
ST
8735 * icf.cc: New file.
8736 * icf.h: New file.
8737 * Makefile.am (CCFILES): Add icf.cc.
8738 (HFILES): Add icf.h
8739 * Makefile.in: Regenerate.
8740 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
8741 * gc.h (gc_process_relocs): Populate lists used by icf to contain
8742 section, symbol and addend information for the relocs.
8743 * gold.cc (queue_middle_tasks): Call identical code folding.
8744 * gold.h: Add defines for multimap.
8745 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
8746 to the call of finalize_local_symbols.
8747 * main.cc (main): Create object of class Icf.
8748 * object.cc (Sized_relobj::do_layout): Allow this function to be
8749 called twice during icf.
8750 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
8751 to sections marked as identical by icf.
8752 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
8753 when available.
8754 (Sized_relobj::do_section_entsize): New function.
8755 * object.h (Object::section_entsize): New function.
8756 (Object::do_section_entsize): New pure virtual function.
8757 (Relobj::finalize_local_symbols): Add new parameter.
8758 (Relobj::do_section_entsize): New function.
8759 * options.h (General_options::icf): New option.
8760 (General_options::icf_iterations): New option.
8761 (General_options::print_icf_sections): New option.
8762 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
8763 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
8764 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
8765 icf.
8766 * symtab.cc (Symbol_table::is_section_folded): New function.
8767 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
8768 to sections marked as identical by icf.
8769 * symtab.h (Symbol_table::set_icf): New function.
8770 (Symbol_table::icf): New function.
8771 (Symbol_table::is_section_folded): New function.
8772 (Symbol_table::icf_): New data member.
8773 * target-reloc.h (relocate_section): Ignore sections folded by icf.
8774 * testsuite/Makefile.am: Add commands to build icf_test.
8775 * testsuite/Makefile.in: Regenerate.
8776 * testsuite/icf_test.sh: New file.
8777 * testsuite/icf_test.cc: New file.
8778
c3b65ac4
CD
87792009-07-24 Chris Demetriou <cgd@google.com>
8780
8781 * layout.cc (is_compressible_debug_section): Fix incorrect
8782 comment about compressed section names.
8783
1caf2c51
ILT
87842009-07-20 Ian Lance Taylor <ian@airs.com>
8785
8786 PR 10419
8787 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
8788
1ef4d87f
ILT
87892009-07-16 Ian Lance Taylor <iant@google.com>
8790
8791 PR 10400
8792 * layout.h: #include <map>.
8793 (class Kept_section): Change from struct to class. Add accessors
8794 and setters. Add section size to Comdat_group mapping. Change
8795 Comdat_group to std::map. Add is_comdat_ field. Add
8796 linkonce_size field in union.
8797 (class Layout): Update declaration of find_or_add_kept_section.
8798 Don't declare find_kept_object.
8799 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
8800 parameter. Add object, shndx, is_comdat, and is_group_name
8801 parameters. Change all callers. Adjust for new Kept_section.
8802 (Layout::find_kept_object): Remove.
8803 * object.cc (Sized_relobj::include_section_group): Update use of
8804 Kept_section. Rename secnum to shndx. Only record
8805 Kept_comdat_section if sections are the same size.
8806 (Sized_relobj::include_linkonce_section): Update use of
8807 Kept_section. Only record Kept_comdat_section if sections are the
8808 same size. Set size of linkonce section.
8809 (Sized_relobj::map_to_kept_section): Update call to
8810 get_kept_comdat_section.
8811 * object.h (class Sized_relobj): Rename fields in
8812 Kept_comdat_section to drop trailing underscores; change object
8813 field to Relobj*. Change Kept_comdat_section_table to store
8814 struct rather than pointer.
8815 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
8816 Add kept_object and kept_shndx parameters. Change all callers.
8817 (Sized_relobj::get_kept_comdat_section): Change return type to
8818 bool. Add kept_object and kept_shndx parameters. Change all
8819 callers.
8820 * plugin.cc (Pluginobj::include_comdat_group): Update call to
8821 Layout::find_or_add_kept_section.
8822
37c3b7b0
ILT
88232009-07-09 Ian Lance Taylor <iant@google.com>
8824
8825 * merge.cc (Object_merge_map::initialize_input_to_output_map):
8826 Reserve space in the hash table.
8827
98fa85cb
ILT
88282009-07-06 Mikolaj Zalewski <mikolajz@google.com>
8829
8830 * fileread.cc (File_read::get_mtime): New method.
8831 * fileread.h (Timespec): New structure.
8832 (File_read::get_mtime): New method.
8833 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
8834 Renamed from timestamp_nsec.
8835 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
8836 Elf_Xword.
e1df38aa 8837 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 8838 timestamp_nsec.
e1df38aa 8839 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
8840 (Incremental_inputs::report_obejct): Save mtime; style fix.
8841 (Incremental_inputs::report_script): Save mtime; style fix.
8842 (Incremental_inputs::finalize_inputs): Style fix.
8843 (Incremental_inputs::finalize): Style fix.
8844 (Incremental_inputs::create_input_section_data): Store inputs
8845 mtime.
8846 * incremental.h (Incremental_inputs::report_script): Add mtime
8847 argument.
8848 (Incremental_inputs::Input_info::Input_info): Intialize only one
8849 union member.
8850 (Incremental_inputs::Input_info::archive): Move to nameless
8851 union.
8852 (Incremental_inputs::Input_info::obejct): Move to nameless union.
8853 (Incremental_inputs::Input_info::script): Move to nameless union.
8854 (Incremental_inputs::mtime): New field.
8855 * script.cc (read_input_script): Pass file mtime to
8856 Incremental_input.
8857 * script.h (Script_info::inputs): Style fix.
8858
c9d70757
ILT
88592009-07-01 Ian Lance Taylor <ian@airs.com>
8860
8861 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
8862 instead of 32.
8863
9c547ec3
ILT
88642009-06-24 Ian Lance Taylor <iant@google.com>
8865
8866 PR 10156
8867 * layout.cc (Layout::choose_output_section): If we find an
8868 existing section, update the flags.
8869 (Layout::create_notes): New function, broken out of
8870 Layout::finalize.
8871 (Layout::finalize): Don't create note sections.
8872 (Layout::create_note): Don't crash if linker script discards
8873 section.
8874 (Layout::create_gold_note): Likewise.
8875 (Layout::create_build_id): Likewise. Don't set
8876 after_input_sections on the section.
8877 (Layout::create_executable_stack_info): Remove target parameter.
8878 Change caller.
8879 * layout.h (class Layout): Declare create_notes. Update
8880 declaration of create_executable_stack_info.
8881 * gold.cc (queue_middle_tasks): Call create_notes.
8882 * output.cc (Output_section::update_flags_for_input_section): Move
8883 here from output.h. If SHF_ALLOC flag is newly set, mark address
8884 invalid.
8885 * output.h (Output_data::mark_address_invalid): New function.
8886 (class Output_section): Only declare, not define,
8887 update_flags_for_input_section. Remove set_flags.
8888
55458500
ILT
88892009-06-24 Ian Lance Taylor <iant@google.com>
8890
8891 * script-sections.cc (Output_section_definition::
8892 set_section_addresses): Rename shadowing local load_address to
8893 laddr.
8894
1307d6cd
ILT
88952009-06-24 Ian Lance Taylor <iant@google.com>
8896
8897 PR 10244
8898 * reloc.cc (relocate_sections): Skip empty relocation sections.
8899
ec3f783e
ILT
89002009-06-23 Ian Lance Taylor <iant@google.com>
8901
8902 PR 10156
8903 * layout.cc (Layout::create_note): Use choose_output_section
8904 rather than make_output_section.
8905
459c9f1c
ILT
89062009-06-23 Ian Lance Taylor <iant@google.com>
8907
8908 PR 10237
8909 * options.cc (General_options::parse_V): Set printed_version_.
8910 (General_options::General_options): Initialize printed_version_.
8911 * options.h (class General_options): Add printed_version_ field.
8912 * gold.cc (queue_initial_tasks): If there are no input files,
8913 don't give a fatal error if we printed the version information.
8914 (queue_middle_tasks): If using -r with a shared object, give a
8915 fatal error rather than an ordinary error.
8916
1518dc8f
ILT
89172009-06-23 Ian Lance Taylor <iant@google.com>
8918
8919 PR 10219
8920 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
8921 (Layout::make_output_section): Set have_stabstr_section_ if we see
8922 a .stab*str section.
8923 (Layout::finalize): Call link_stabs_sections.
8924 (Layout::link_stabs_sections): New file.
8925 * layout.h (class Layout): Add have_stabstr_section_ field.
8926 Declare link_stabs_sections.
8927
3d857b98
DK
89282009-06-23 Doug Kwan <dougkwan@google.com>
8929
8930 * Makefile.am (libgold_a_LIBADD): New.
8931 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
8932 * Makefile.in: Regenerate.
8933 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
8934 * configure: Regenerate.
8935 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
8936 * fileread.cc: Include sys/state.h
8937 * gold.h: Declare memmem and strndup if found missing.
8938 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
8939
0639a6f6
ILT
89402009-06-23 Ian Lance Taylor <iant@google.com>
8941
8942 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
8943 * configure: Rebuild.
8944
8d63875c
ILT
89452009-06-23 Ian Lance Taylor <iant@google.com>
8946
8947 PR 10147
8948 * object.cc (Object::section_contents): Don't try to get a view if
8949 the section has length zero.
8950 (Object::handle_gnu_warning_section): If the section is empty, use
8951 the name of the section as the warning.
8952
f7c8a183
ILT
89532009-06-23 Ian Lance Taylor <iant@google.com>
8954
8955 PR 10133
8956 * stringpool.h (class Stringpool_template): Add optimize_ field.
8957 (Stringpool_template::set_optimize): New function.
8958 * stringpool.cc (Stringpool_template::Stringpool_template):
8959 Initialize optimize_ field.
8960 (Stringpool_template::set_string_offsets): Test local optimize
8961 fild rather than parameter.
8962 * layout.cc (Layout::Layout): Call set_optimize on the section
8963 name stringpool.
8964
e6a307ba
ILT
89652009-06-22 Ian Lance Taylor <iant@google.com>
8966
8967 PR 10030
8968 * yyscript.y: Parse TARGET.
8969 * script.cc (script_set_target): New function.
8970 * script-c.h (script_set_target): Declare.
8971 * options.cc (General_options::string_to_object_format): Rename
8972 from string_to_object_format in anonymous namespace. Change
8973 callers.
8974 * options.h (class General_options): Declare
8975 string_to_object_format.
8976
3ee173de
ILT
89772009-06-22 Ian Lance Taylor <iant@google.com>
8978
8979 * script-sections.cc (Script_sections::create_segments): Don't put
8980 program headers in a PT_LOAD segment if -n or -N.
8981
89822009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
8983
8984 PR 10141
8985 * options.h (class General_options): Add -z lazy and -z now. Sort
8986 -z options into alphabetical order.
8987 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
8988
cd6739a1 89892009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
8990
8991 * layout.cc (Layout::make_output_section): Call
8992 Target::new_output_section.
8993 (Layout::attach_allocated_section_to_segment): Put large section
8994 sections in a separate load segment with the large segment flag
8995 set.
8996 (Layout::segment_precedes): Sort large data segments after other
8997 load segments.
8998 (align_file_offset): New static function.
8999 (Layout::set_segment_offsets): Use align_file_offset.
9000 * output.h (class Output_section): Add is_small_section_ and
9001 is_large_section_ fields.
9002 (Output_section::is_small_section): New function.
9003 (Output_section::set_is_small_section): New function.
9004 (Output_section::is_large_section): New function.
9005 (Output_section::set_is_large_section): New function.
9006 (Output_section::is_large_data_section): New function.
9007 (class Output_segment): Add is_large_data_segment_ field.
9008 (Output_segment::is_large_data_segment): New function.
9009 (Output_segment::set_is_large_data_segment): New function.
9010 * output.cc (Output_section::Output_section): Initialize new
9011 fields.
9012 (Output_segment::Output_segment): Likewise.
9013 (Output_segment::add_output_section): Add assertion that large
9014 data sections always go in large data segments. Force small data
9015 sections to the end of the list of data sections. Force small BSS
9016 sections to the start of the list of BSS sections. For large BSS
9017 sections to the end of the list of BSS sections.
9018 * symtab.h (class Symbol): Declare is_common_shndx.
9019 (Symbol::is_defined): Check Symbol::is_common_shndx.
9020 (Symbol::is_common): Likewise.
9021 (class Symbol_table): Define enum Commons_section_type. Update
9022 declarations. Add small_commons_ and large_commons_ fields.
9023 * symtab.cc (Symbol::is_common_shndx): New function.
9024 (Symbol_table::Symbol_table): Initialize new fields.
9025 (Symbol_table::add_from_object): Put small and large common
9026 symbols in the right list.
9027 (Symbol_table::sized_finalized_symbol): Check
9028 Symbol::is_common_shndx.
9029 (Symbol_table::sized_write_globals): Likewise.
9030 * common.cc (Symbol_table::do_allocate_commons): Allocate new
9031 common symbol lists. Don't call do_allocate_commons_list if the
9032 list is empty.
9033 (Symbol_table::do_allocate_commons_list): Remove is_tls
9034 parameter. Add comons_section_type parameter. Change all
9035 callers. Handle small and large common symbols.
9036 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
9037 Symbol::is_common_shndx.
9038 * resolve.cc (symbol_to_bits): Likewise.
9039 * target.h (Target::small_common_shndx): New function.
9040 (Target::small_common_section_flags): New function.
9041 (Target::large_common_shndx): New function.
9042 (Target::large_common_section_flags): New function.
9043 (Target::new_output_section): New function.
9044 (Target::Target_info): Add small_common_shndx, large_common_shndx,
9045 small_common_section_flags, and large_common_section_flags
9046 fields.
9047 (Target::do_new_output_section): New virtual function.
9048 * arm.cc (Target_arm::arm_info): Initialize new fields.
9049 * i386.cc (Target_i386::i386_info): Likewise.
9050 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
9051 Likewise.
9052 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
9053 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
9054 (Target_x86_64::do_new_output_section): New function.
9055 * configure.ac: Define conditional MCMODEL_MEDIUM.
9056 * testsuite/Makefile.am (check_PROGRAMS): Add large.
9057 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
9058 (large_LDFLAGS): Define.
9059 * testsuite/large.c: New file.
9060 * testsuite/testfile.cc (Target_test::test_target_info):
9061 Initialize new fields.
9062 * configure, testsuite/Makefile.in: Rebuild.
9063
bb04269c
DK
90642009-06-05 Doug Kwan <dougkwan@google.com>
9065
9066 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 9067 * Makefile.in: Regenerate.
bb04269c
DK
9068 * i386.cc (class Target_i386): Define new virtual method to
9069 override do_is_local_label_name in parent.
9070 * object.cc (Sized_relobj::do_count_local_symbols): Discard
9071 local symbols if --discard-locals or -X is given.
9072 * options.h (class General_options): Declare new options
9073 '--discard-locals' and '-X' for discarding locals.
9074 * target.h (class Target): Define new methods is_local_label_name.
9075 Declare new virtual method do_is_local_label_name.
9076 * target.cc: New file.
9077 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
9078 (check_SCRIPTS): Add discard_locals_test.sh.
9079 (check_DATA): Add discard_local_tests.syms.
9080 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
9081 (discard_local_tests.syms, discard_locals_test.o): New make rules.
9082 * testsuite/Makefile.in: Regenerate.
9083 * testsuite/discard_locals_test.c: New file.
9084 * testsuite/discard_locals_test.sh: Same.
9085
805bb01c
DK
90862009-06-05 Doug Kwan <dougkwan@google.com>
9087
9088 * object.cc (Sized_relobj::Sized_relobj): Initialize
9089 discarded_eh_frame_shndx_ to -1U.
9090 (Sized_relobj::do_layout): Record index of a discard .eh_frame
9091 section.
9092 (Sized_relobj::do_count_local_symbols): Skip local symbols in
9093 a discarded .eh_frame section.
9094 (Sized_relobj::do_finalize_local_symbols): Ditto.
9095 * object.h (class Sized_relobj): Declare new member
9096 discarded_eh_frame_shndx_.
9097 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
9098 (local_labels_test.o, local_labels_test): New rules.
9099 * testsuite/Makefile.in: Regenerate.
9100
1dcd334d
DK
91012009-06-04 Doug Kwan <dougkwan@google.com>
9102
9103 * layout.cc (Layout::section_name_mapping): Add mapping for
9104 special ARM sections.
9105
96d49306
DK
91062009-06-03 Doug Kwan <dougkwan@google.com>
9107
9108 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
9109 (utils::has_overflow): Same.
9110
dff16297
ILT
91112009-06-03 Ian Lance Taylor <iant@google.com>
9112
9113 * layout.cc (Layout::section_name_mapping): New array, replacing
9114 Layout::linkonce_mapping.
9115 (Layout::section_name_mapping_count): New variable, replacing
9116 Layout::linkonce_mapping_count.
9117 (Layout::linkonce_output_name): Remove.
9118 (Layout::output_section_name): Rewrite.
9119 * layout.h (class Layout): Rename Linkonce_mapping to
9120 Section_name_mapping, linkonce_mapping to section_name_mapping,
9121 linkonce_mapping_count to section_name_mapping_count. Don't
9122 declare linkonce_output_name.
9123
c121c671
DK
91242009-06-03 Doug Kwan <dougkwan@google.com>
9125
9126 * gold/arm.cc (namespace utils): New.
9127 (Target_arm::reloc_is_non_pic): Define new method.
9128 (class Arm_relocate_functions): New.
9129 (Target_arm::Relocate::relocate): Handle relocation types used by
9130 Android.
9131
07800fab
ILT
91322009-06-03 Ian Lance Taylor <iant@google.com>
9133
9134 * arm.cc (Target_arm::scan::global): Use || instead of |.
9135
c121c671
DK
91362009-06-02 Doug Kwan <dougkwan@google.com>
9137
9138 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
9139 issued_non_pic_error_.
9140 (class Target_arm::Scan): Declare new method check_non_pic.
9141 Define new method symbol_needs_plt_entry.
9142 Declare new data member issued_non_pic_error_.
9143 (class Target_arm::Relocate): Declare new method
9144 should_apply_static_reloc.
9145 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
9146 (Target_arm::Scan::check_non_pic): Define new method.
9147 (Target_arm::Scan::local): Handle a small subset of reloc types used
9148 by Android.
9149 (Target_arm::Scan::local): Same.
9150 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
9151
b19b0c6d
ILT
91522009-05-31 Mikolaj Zalewski <mikolajz@google.com>
9153
9154 * incremental.cc (Incremental_inputs::report_command_line): Filter
9155 out --incremental-* options.
9156
94cdfcff
DK
91572009-05-29 Doug Kwan <dougkwan@google.com>
9158
9159 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
9160 template class.
9161 (class Target_arm): Update comment.
9162 (Target_arm::Target_arm): Initialize new data members GOT_,
9163 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
9164 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
9165 and Target_arm::rel_dyn_section.
9166 Declare new_enum Target_arm::Got_type.
9167 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
9168 and DYNBSS_.
9169 Update commments for member do_dynsym_value.
9170 (Target_arm::got_size, Target_arm::plt_section,
9171 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
9172 new methods inside class defintion.
9173 (Target_arm::got_section): Define new method.
9174 (Target_arm::rel_dyn_section): Same.
9175 (Output_data_plt_arm): New template class.
9176 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
9177 (Output_data_plt_arm:do_adjust_output_section): Define new method.
9178 (Output_data_plt_arm::add_entry): Same.
9179 (Output_data_plt_arm::first_plt_entry): Define new
9180 static data member for PLT instruction template.
9181 (Output_data_plt_arm::plt_entry): Same.
9182 (Output_data_plt_arm::do_write): Define new method.
9183 (Target_arm::make_plt_entry): Same.
9184 (Target_arm::do_finalize_sections): Same.
9185 (Target_arm::do_dynsym_value): Same.
9186
4a657b0d
DK
91872009-05-28 Doug Kwan <dougkwan@google.com>
9188
9189 * Makefile.am (TARGETSOURCES): Add arm.cc.
9190 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
9191 * Makefile.in: Regenerate.
9192 * arm.cc: New file.
9193 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
9194
e7ae8c36
DK
91952009-05-26 Doug Kwan <dougkwan@google.com>
9196
9197 * options.cc (General_options::parse_exclude_libs). Fix a comment.
9198 (General_options::check_excluded_libs): Strip off directories in
9199 archive name before matching like GNU ld does.
9200 * testsuite/Makefile.am (MOSTLYCLEANFILES,
9201 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
9202 (exclude_libs_test_LDFLAGS): Add linker option
9203 -Wl,--exclude-libs,libexclude_libs_test_3
9204 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
9205 an explicit archive without using -l.
9206 (alt/libexclude_libs_test_3.a): New make rule.
9207 * testsuite/Makefile.in: Regenerate.
9208 * testsuite/exclude_libs_test.c : Declare lib3_default().
9209 (main): Call it.
9210 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
9211 * exclude_libs_test_3.c: New file.
9212
f12e7348
NC
92132009-05-26 Nick Clifton <nickc@redhat.com>
9214
9215 * po/id.po: New Indonesian translation.
9216 * po/gold.pot: Updated template file.
9217
4daadc0d
ST
92182009-05-22 Sriraman Tallam <tmsriram@google.com>
9219
e1df38aa 9220 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
9221 gc_comdat_test files. Add -Wl,--gc-sections to build
9222 gc_comdat_test.
9223 * testsuite/Makefile.in: Regenerate.
9224 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
9225
531813ad
ST
92262009-05-21 Sriraman Tallam <tmsriram@google.com>
9227
9228 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
9229 kept comdat section was garbage collected.
9230 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
9231 * testsuite/Makefile.in: Regenerate.
9232 * testsuite/gc_comdat_test.sh: New file.
9233 * testsuite/gc_comdat_test_1.cc: New file.
9234 * testsuite/gc_comdat_test_2.cc: New file.
9235
65514900
CC
92362009-05-19 Doug Kwan <dougkwan@google.com>
9237
9238 * archive.cc (Archive::Archive): Move constructor from archive.h
9239 to here. Initialize no_export_.
9240 (Archive::get_elf_object_for_member): Set no_export flag of object.
9241 * archive.h (Archive::Archive): Move constructor body to
9242 archive.cc.
9243 (Archive::no_export): New method.
9244 (Archive::no_export_): New field.
9245 * object.h (Object::Object): Initialize no_export_ to false.
9246 (Object::no_export, Object::set_no_export): New methods.
9247 (Object::no_export_): New field.
9248 * options.cc (General_options::parse_exclude_libs): New method.
9249 (General_options::check_excluded_libs) Same.
9250 * options.h (exclude_libs): New option.
9251 (General_options::check_excluded_libs): New method declaration.
9252 (General_options::excluded_libs_): New field.
9253 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
9254 default or protected visibility if an object has no-export flag set.
9255 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
9256 (check_SCRIPTS): Add exclude_libs_test.sh.
9257 (check_DATA): Add exclude_libs_test.syms.
9258 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
9259 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
9260 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
9261 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
9262 (exclude_libs_test.syms, libexclude_libs_test_1.a,
9263 libexclude_libs_test_2.a): New rules.
9264 * testsuite/Makefile.in: Regenerate.
9265 * testsuite/exclude_libs_test.c: New file.
9266 * testsuite/exclude_libs_test.sh: Ditto.
9267 * testsuite/exclude_libs_test_1.c: Ditto.
9268 * testsuite/exclude_libs_test_2.c: Ditto.
9269
1b77ea50
ILT
92702009-05-15 Ian Lance Taylor <iant@google.com>
9271
9272 * configure.ac: Check for declarations for cases where libiberty.h
9273 checks HAVE_DECL_xxx.
9274 * configure, config.in: Rebuild.
9275
072fe7ce
ILT
92762009-05-15 Mikolaj Zalewski <mikolajz@google.com>
9277
9278 * gold.h (Incremental_argument_list): Remove (invalid) forward
9279 declaration.
9280 * incremental.cc (Incremental_inputs::report_achive): New method.
9281 (Incremental_inputs::report_object): New method.
9282 (Incremental_inputs::report_script): New method.
9283 (Incremental_inputs::finalize_inputs): New method.
9284 (Incremental_inputs::finalize): Call finalize_inputs().
9285 (Incremental_inputs::sized_create_incremental_inputs_section_data):
9286 Create inputs entries.
9287 * incremental.h (Incremental_input_type): New enum.
9288 (Incremental_inputs::Incremental_input): Initialize new fields.
9289 (Incremental_inputs::report_inputs): New method.
9290 (Incremental_inputs::report_achive): New method.
9291 (Incremental_inputs::report_object): New method.
9292 (Incremental_inputs::report_script): New method.
9293 (Incremental_inputs::finalize_inputs): New method.
9294 (Incremental_inputs::Input_info): New struct.
9295 (Incremental_inputs::Input_info_map): New typedef.
9296 (Incremental_inputs::lock_): New field.
9297 (Incremental_inputs::Inputs_): New field.
9298 (Incremental_inputs::Inputs_map): New field.
9299 * main.cc (main): Call Incremental_input::report_inputs.
9300 * options.h (Input_argument_list): Typedef moved from
9301 Input_arguments.
9302 (Input_file_group::Files): Remove, use ::Input_argument_list.
9303 (Input_file_group::Input_argument_list): Remove, use
9304 ::Input_argument_list.
9305 * plugin.cc (Plugin_manager::add_input_file): Add error in
9306 incremental build.
9307 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
9308 functions.
9309 * script.cc (read_input_script): Call
9310 Incremental_input::report_script.
9311 * script.h (Script_info): New class.
9312
b0481b0b
ILT
93132009-04-27 Ian Lance Taylor <iant@google.com>
9314
9315 * x86_64.cc (do_adjust_output_section): Set entsize to
9316 plt_entry_size.
9317
b22a5a41 93182009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
9319
9320 * output.cc (Output_file::close): After short writes, continue
9321 writing from the correct offset in the buffer being written.
9322
40fde488
CD
93232009-04-23 Chris Demetriou <cgd@google.com>
9324
9325 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
9326 * configure: Regenerate.
9327 * config.in: Regenerate.
9328 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
9329 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
9330
3ce2c28e
ILT
93312009-04-21 Mikolaj Zalewski <mikolajz@google.com>
9332
9333 * incremental.cc (Incremental_inputs_header_data): Renamed from
9334 Incremental_input_header_data.
9335 (Incremental_inputs_header_data::data_size): New field.
9336 (Incremental_inputs_header_data::put_input_file_count): Renamed
9337 from input_file_count.
9338 (Incremental_inputs_header_data::put_command_line_offset): Renamed
9339 from command_line_offset.
9340 (Incremental_inputs_header_data::put_reserved): Renamed from
9341 put_reserved.
9342 (Incremental_inputs_entry_data): Renamed from
9343 Incremental_input_entry_data.
9344 (Incremental_inputs_entry_data::data_size): New field.
9345 (Incremental_inputs::report_command_line): New method.
9346 (Incremental_inputs::finalize): New method.
9347 (Incremental_inputs::create_incremental_inputs_data): New method.
9348 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
9349 * incremental.h: New file.
9350 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
9351 (Layout::finalize): Create incremental inputs section in
9352 incremental builds.
9353 (Layout::create_incremental_info_sections): New method.
9354 * layout.h (Layout::incremental_inputs): New method.
9355 (Layout::create_incremental_info_sections): New method.
9356 (Layout::incremental_inputs_): New field.
9357 * main.cc (main): Notify Incremental_input of the command line.
9358
e55bde5e
ILT
93592009-04-01 Ian Lance Taylor <iant@google.com>
9360 Mikolaj Zalewski <mikolajz@google.com>
9361
9362 * gold.h (reserve_unordered_map): Define, three versions, one for
9363 each version of Unordered_map.
9364 * layout.cc (Layout::Layout): Remove options parameter. Add
9365 number_of_input_files parameter. Don't initialize options_.
9366 Initialize number_of_input_files_ and resized_signatures_. Move
9367 sections_are_attached_.
9368 (Layout::layout_group): Reserve space for group_signatures_.
9369 (Layout::find_or_add_kept_section): Change name parameter to be a
9370 reference. Resize signatures_ map when it gets large enough.
9371 (Layout::layout_eh_frame): Use parameters->options() instead of
9372 this->options_.
9373 (Layout::make_output_section): Likewise.
9374 (Layout::attach_allocated_section_to_segment): Likewise.
9375 (Layout::finalize, Layout::create_executable_stack): Likewise.
9376 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
9377 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
9378 * layout.h (class Layout): Update declarations. Remove options_
9379 field. Add number_of_input_files_ and resized_signatures_
9380 fields. Move sections_are_attached_ field.
9381 * main.cc (main): Pass number of input files to Layout
9382 constructor. Don't pass options.
9383
154b857c
ILT
93842009-03-30 Ian Lance Taylor <iant@google.com>
9385
9386 * ffsll.c (ffsll): Correct implementation.
9387
2f35ab9b
ILT
93882009-03-27 Ian Lance Taylor <iant@google.com>
9389
fd03461a
ILT
9390 * ffsll.c: New file.
9391 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
9392 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
9393 * ftruncate.c (ftruncate): Declare before definition.
9394 * mremap.c (mremap): Likewise.
9395 * pread.c (pread): Likewise.
9396 * configure, Makefile.in, config.in: Rebuild.
9397
2f35ab9b
ILT
9398 * mremap.c: New file.
9399 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
9400 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
9401 (mremap): Declare if HAVE_MREMAP is not defined.
9402 * configure, Makefile.in, config.in: Rebuild.
9403
33aea2fd
CC
94042009-03-27 Cary Coutant <ccoutant@google.com>
9405
9406 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
9407 position independent.
9408 * sparc.cc (Target_sparc::check_non_pic): Likewise.
9409 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
9410
6d479619
CC
94112009-03-24 Cary Coutant <ccoutant@google.com>
9412
9413 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
9414 an executable.
9415 (needs_dynamic_reloc): Likewise.
9416
afc06bb8
ILT
94172009-03-24 Ian Lance Taylor <iant@google.com>
9418
9419 * yyscript.y (file_cmd): Recognize EXTERN.
9420 (extern_name_list, extern_name_list_body): New nonterminals.
9421 * script.cc (script_add_extern): Define.
9422 * script-c.h (script_add_extern): Declare.
9423
f6060a4d
ILT
94242009-03-24 Rafael Avila de Espindola <espindola@google.com>
9425
9426 * object.cc (is_elf_object): Define.
9427 * object.h (is_elf_object): Declare.
9428 * archive.cc (Archive::get_elf_object_for_member): Call
9429 is_elf_object.
33aea2fd 9430 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 9431
26736d8e
ILT
94322009-03-24 Elliott Hughes <enh@google.com>
9433
9434 * output.cc (Output_file::map_anonymous): Define.
9435 (Output_file::map): Use map_anonymous. If the regular mmap fails,
9436 try an anonymous one. Report the size if the mmap fails.
9437 * output.h (class Output_file): Declare map_anonymous.
9438
22fd9730
ILT
94392009-03-24 Ian Lance Taylor <iant@google.com>
9440
9441 * target-select.cc (instantiate_target): Don't acquire the lock if
9442 the instantiated_target_ field has already been set.
9443
cb010894
ILT
94442009-03-23 Ian Lance Taylor <iant@google.com>
9445
7f055c20
ILT
9446 * gold-threads.h (class Initialize_lock): Define.
9447 * gold-threads.cc (class Initialize_lock_once): Define.
9448 (initialize_lock_control): New static variable.
9449 (initialize_lock_pointer): New static variable.
9450 (initialize_lock_once): New static function.
9451 (Initialize_lock::Initialize_lock): Define.
9452 (Initialize_lock::initialize): Define.
9453 * target-select.h: Include "gold-threads.h".
9454 (class Target_selector): Add lock_ and initialize_lock_ fields.
9455 Don't define instantiate_target, just declare it.
9456 * target-select.cc (Target_selector::Target_selector): Initialize
9457 new fields.
9458 (Target_selector::instantiate_target): Define.
9459 * descriptors.h: Include "gold-threads.h".
9460 (class Descriptors): Add initialize_lock_ field.
9461 * descriptors.cc (Descriptors::Descriptors): Initialize new
9462 field.
9463 (Descriptors::open): Use initialize_lock_ field
9464 * errors.h (class Errors): Add initialize_lock_ field.
9465 * errors.cc (Errors::Errors): Initialize new field.
9466 (Errors::initialize_lock): Use initialize_lock_ field.
9467 * powerpc.cc (class Target_selector_powerpc): Remove
9468 instantiated_target_ field. In do_recognize call
9469 instantiate_target rather than do_instantiate_target. In
9470 do_instantiate_target just allocate a new target.
9471 * sparc.cc (class Target_selector_sparc): Likewise.
9472
36959681
ILT
9473 * freebsd.h: New file.
9474 * i386.cc: Include "freebsd.h".
9475 (Target_i386): Derive from Target_freebsd rather than
9476 Sized_target.
9477 (Target_selector_i386): Derive from Target_selector_freebsd rather
9478 than Target_selector.
9479 * x86_64.cc: Include "freebsd.h".
9480 (Target_x86_64): Derive from Target_freebsd rather than
9481 Sized_target.
9482 (Target_selector_x86_64): Derive from Target_selector_freebsd
9483 rather than Target_selector.
9484 * target.h (class Target): Add adjust_elf_header and
9485 do_adjust_elf_header.
9486 * output.cc (Output_file_header:: do_sized_write): Call target
9487 adjust_elf_header routine.
9488 * configure.tgt: Set targ_osabi.
9489 * configure.ac: Define GOLD_DEFAULT_OSABI.
9490 * parameters.cc (Parameters::default_target): Pass
9491 GOLD_DEFAULT_OSABI to select_target.
9492 * target-select.h (class Target_selector): Make instantiate_target
9493 protected rather than private.
9494 * Makefile.am (HFILES): Add freebsd.h.
9495 * configure, Makefile.in, config.in: Rebuild.
9496
cb010894
ILT
9497 * merge.cc (do_add_input_section): Correct pend value. Change
9498 message about last entry not being null terminated from error to
9499 warning.
9500
0e879927
ILT
95012009-03-20 Mikolaj Zalewski <mikolajz@google.com>
9502
9503 * incremental.cc: New file.
9504 * Makefile.am (CCFILES): Add incremental.cc.
9505 * Makefile.in: Rebuild.
9506
41105937
PP
95072009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
9508
9509 * layout.cc (Layout::output_section_name): Preserve names
9510 of '.note.' sections.
e1df38aa 9511
60439920
ILT
95122009-03-19 Ian Lance Taylor <iant@google.com>
9513
9514 * descriptors.cc (Descriptors::open): Check that the options are
9515 valid before using them.
9516
0d371ad3
ILT
95172009-03-18 Ian Lance Taylor <iant@google.com>
9518
9519 * script-sections.h: Include <list>.
9520 (class Script_sections): Change Sections_elements from std::vector
9521 to std::list. Typedef public Elements_iterator. Add
9522 orphan_section_placement_, data_segment_align_start_, and
9523 saw_data_segment_align_ fields. Remove data_segment_align_index_
9524 field.
9525 * script-sections.cc (class Orphan_section_placement): New class.
9526 (class Sections_element): Add virtual functions is_relro and
9527 orphan_section_init. Remove virtual function place_orphan_here.
9528 (class Output_section_definition): Add is_relro and
9529 orphan_section_init. Remove place_orphan_here.
9530 (class Orphan_output_section): Likewise.
9531 (Script_sections::Script_sections): Update for field changes.
9532 (Script_sections::data_segment_align): Set saw_data_segment_align_
9533 and data_segment_align_start_, not data_segment_align_index.
9534 (Script_sections::data_segment_relro_end): Check
9535 saw_data_segment_align_. Use data_segment_align_start_ rather
9536 than data_segment_align_index_.
9537 (Script_sections::place_orphan): Rewrite to use
9538 Orphan_section_placement.
9539
9201d894
ILT
95402009-03-17 Ian Lance Taylor <iant@google.com>
9541
9c5b8369
ILT
9542 * archive.cc (Archive::add_symbols): Check for a version attached
9543 to the symbol name in the archive map.
9544 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
9545 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
9546 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
9547 (ver_test_11.a): New target.
9548 * testsuite/Makefile.in: Rebuild.
9549
9201d894
ILT
9550 * configure.ac: Check for chsize and posix_fallocate. Replace
9551 ftruncate.
9552 * ftruncate.c: New file, from gnulib.
9553 * output.cc (posix_fallocate): Define dummy version if not
9554 HAVE_POSIX_FALLOCATE.
9555 (Output_file::map): Call posix_fallocate rather than lseek and
9556 write.
9557 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
9558 * configure, Makefile.in, config.in: Rebuild.
9559
ef4ab7a8 95602009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 9561
ef4ab7a8
PP
9562 * layout.h (Layout::create_note): Add section_name parameter.
9563 * layout.cc (Layout::create_note): Likewise.
9564 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 9565
8c500701
ILT
95662009-03-17 Ian Lance Taylor <iant@google.com>
9567
e85b18e1
ILT
9568 * descriptors.cc: Include "options.h".
9569 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
9570 (Descriptors::open): Always use O_CLOEXEC when opening a new
9571 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
9572 then set FD_CLOEXEC.
9573
9efe6174
ILT
9574 * sparc.cc (class Target_sparc): Add has_got_section.
9575 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
9576 make sure we have a GOT section.
9577
9578 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
9579 (Target_sparc::Scan::local): Likewise.
9580 (Target_sparc::Scan::global): Likewise.
9581 (Target_sparc::Relocate::relocate): Likewise.
9582 (Target_sparc::Relocate::relocate_tls): Likewise.
9583
8c500701
ILT
9584 * symtab.cc (Symbol_table::define_default_version): New function,
9585 broken out of add_from_object.
9586 (Symbol_table::add_from_object): Call define_default_version.
9587 (Symbol_table::define_special_symbol): Add resolve_oldsym
9588 parameter. Change all callers. If the version for a symbol comes
9589 from a version script, resolve it with the symbol with the same
9590 name with no version. Also add the symbol without a version if
9591 appropriate.
9592 (do_define_in_output_data): If resolving with oldsym, don't delete
9593 sym.
9594 (do_define_in_output_segment): Likewise.
9595 (do_define_as_constant): Likewise.
9596 * symtab.h (class Symbol_table): Update declarations.
9597
f1ed28fb
ILT
95982009-03-13 Ian Lance Taylor <iant@google.com>
9599
15f8229b
ILT
9600 * readsyms.cc (Read_symbols::incompatible_warning): New function.
9601 (Read_symbols::requeue): New function.
9602 (Read_symbols::do_read_symbols): If make_elf_object fails because
9603 the target type is not configured, and the file was searched for,
9604 issue a warning and retry with the next directory.
9605 (Add_symbols::run): If the file has an incompatible format, and
9606 it was searched for, requeue the Read_symbols task. On error,
9607 release the object.
9608 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
9609 dirindex parameter to constructor. Change all callers. Declare
9610 incompatible_warning and requeue.
9611 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
9612 input_argument_ and input_group_ fields. Add them to
9613 constructor. Change all callers.
9614 (class Read_script): Add dirindex_ field. Add it to constructor.
9615 Change all callers.
9616 * archive.cc (Archive::setup): Remove input_objects parameter.
9617 Change all callers.
9618 (Archive::get_file_and_offset): Likewise.
9619 (Archive::read_all_symbols): Likewise.
9620 (Archive::read_symbols): Likewise.
9621 (Archive::get_elf_object_for_member): Remove input_objects
9622 parameter. Add punconfigured parameter. Change all callers.
9623 (Archive::add_symbols): Change return type to bool. Check return
9624 value of include_member.
9625 (Archive::include_all_members): Likewise.
9626 (Archive::include_member): Change return type to bool. Return
9627 false if first included object has incompatible target. Set
9628 included_member_ field.
9629 (Add_archive_symbols::run): If add_symbols returns false, requeue
9630 Read_symbols task.
9631 * archive.h (class Archive): Add included_member_ field.
9632 Initialize it in constructor. Add input_file and searched_for
9633 methods. Update declarations.
9634 (class Add_archive_symbols): Add dirpath_, dirindex_, and
9635 input_argument_ fields. Add them to constructor. Change all
9636 callers.
9637 * script.cc: Include "target-select.h".
9638 (class Parser_closure): Add skip_on_incompatible_target_ and
9639 found_incompatible_target_ fields. Add
9640 skip_on_incompatible_target parameter to constructor. Change all
9641 callers. Add methods skip_on_incompatible_target,
9642 clear_skip_on_incompatible_target, found_incompatible_target, and
9643 set_found_incompatible_target.
9644 (read_input_script): Add dirindex parameter. Change all callers.
9645 If parser finds an incompatible target, requeue Read_symbols
9646 task.
9647 (script_set_symbol): Clear skip_on_incompatible_target in
9648 closure.
9649 (script_add_assertion, script_parse_option): Likewise.
9650 (script_start_sections, script_add_phdr): Likewise.
9651 (script_check_output_format): New function.
9652 * script.h (read_input_script): Update declaration.
9653 * script-c.h (script_check_output_format): Declare.
9654 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
9655 (ignore_cmd): Remove OUTPUT_FORMAT.
9656 * fileread.cc (Input_file::Input_file): Add explicit this.
9657 (Input_file::will_search_for): New function.
9658 (Input_file::open): Add pindex parameter. Change all callers.
9659 * fileread.h (class Input_file): Add input_file_argument method.
9660 Declare will_search_for. Update declarations.
9661 * object.cc (make_elf_object): Add punconfigured parameter.
9662 Change all callers.
9663 * object.h (class Object): Make input_file public. Add
9664 searched_for method.
9665 (make_elf_object): Update declaration.
9666 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
9667 restart search.
9668 * dirsearch.h (class Dirsearch): Update declaration.
9669 * options.h (class General_options): Add --warn-search-mismatch.
9670 * parameters.cc (Parameters::is_compatible_target): New function.
9671 * parameters.h (class Parameters): Declare is_compatible_target.
9672 * workqueue.cc (Workqueue::add_blocker): New function.
9673 * workqueue.h (class Workqueue): Declare add_blocker.
9674
f1ed28fb
ILT
9675 * fileread.cc (Input_file::open): Remove options parameter.
9676 Change all callers.
9677 (Input_file::open_binary): Likewise.
9678 * script.cc (read_input_script): Likewise.
9679 * readsyms.h (class Read_symbols): Remove options_ field. Remove
9680 options parameter from constructor. Change all callers.
9681 (class Read_script): Likewise.
9682 * fileread.h (class Input_file): Update declarations.
9683 * script.h (read_input_script): Update declaration.
9684
34dd024a
NC
96852009-03-10 Nick Clifton <nickc@redhat.com>
9686
9687 * po/es.po: New Spanish translation.
9688
6d71b17c
CC
96892009-03-06 Cary Coutant <ccoutant@google.com>
9690
9691 * options.cc (parse_short_option): Keep dash_z from registering itself.
9692
031cdbed
ILT
96932009-03-03 Ian Lance Taylor <iant@google.com>
9694
9695 PR 9918
9696 * target-reloc.h (relocate_section): Pass output_section to
9697 relocate.
9698 * i386.cc (Target_i386::should_apply_static_reloc): Add
9699 output_section parameter. Change all callers.
9700 (Target_i386::Relocate::relocate): Add output_section parameter.
9701 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
9702 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
9703 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
9704 * testsuite/two_file_shared.sh: New script.
9705 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
9706 (check_DATA): Add two_file_shared.dbg.
9707 (two_file_shared.dbg): New target.
9708 * testsuite/Makefile.in: Rebuild.
9709
15d5fa16
ILT
97102009-03-01 Ian Lance Taylor <iant@google.com>
9711
9712 * configure.ac: Check for byteswap.h.
9713 * configure: Rebuild.
9714 * config.in: Rebuild.
9715
8a4c0b0d
ILT
97162009-03-01 Mikolaj Zalewski <mikolajz@google.com>
9717
9718 * layout.cc (Layout::find_or_add_kept_section): New function.
9719 (Layout::add_comdat): Removed.
9720 * layout.h (struct Kept_section): Move out of class Layout.
9721 Remove trailing underscores from field names. Add group_sections
9722 field. Rename group_ field to is_group. Change all uses.
9723 (class Layout): Declare find_or_add_kept_section, not add_comdat.
9724 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
9725 comdat_groups_ field.
9726 (Sized_relobj::include_section_group): Use
9727 find_or_add_kept_section and Kept_section::group_sections.
9728 (Sized_relobj::include_linkonce_section): Likewise.
9729 * object.cc (class Sized_relobj): Don't define Comdat_group or
9730 Comdat_group_table. Remove find_comdat_group and
9731 add_comdat_group. Remove comdat_groups_ field.
9732 * plugin.cc (include_comdat_group): Use
9733 Layout::find_or_add_kept_section.
9734
b4ecf66b
ILT
97352009-02-28 Ian Lance Taylor <iant@google.com>
9736
14359ca0
ILT
9737 * README: --gc-sections and map files are now supported. Document
9738 some build requirements.
9739
b4ecf66b
ILT
9740 PR 6992
9741 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
9742 relocatable link set the value of the section symbol to zero.
9743 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
9744 relocatable link don't include the section address in the local
9745 symbol value.
9746
0602e05a
ILT
97472009-02-27 Ian Lance Taylor <iant@google.com>
9748
fd9d194f
ILT
9749 PR 6811
9750 * options.h (class Search_directory): Add is_system_directory.
9751 (class General_options): Declare is_in_system_directory.
9752 * options.cc (get_relative_sysroot): Make static.
9753 (get_default_sysroot): Make static.
9754 (General_optoins::is_in_system_directory): New function.
9755 * fileread.cc (Input_file::is_in_system_directory): New function.
9756 * fileread.h (class Input_file): Declare is_in_system_directory.
9757 * object.h (class Object): Add is_in_system_directory.
9758 (class Input_objects): Remove system_library_directory_ field.
9759 * object.cc (Input_objects::add_object): Don't set
9760 system_library_directory_.
9761 (input_objects::found_in_system_library_directory): Remove.
9762 * symtab.cc (Symbol_table::write_globals): Remove input_objects
9763 parameter. Change all callers.
9764 (Symbol_table::sized_write_globals): Likewise.
9765 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
9766 Call Object::is_in_system_directory.
9767 * symtab.h (class Symbol_table): Update declarations.
9768
61edd21f
ILT
9769 PR 5990
9770 * descriptors.h (Open_descriptor): Add is_on_stack field.
9771 * descriptors.cc (Descriptors::open): If the descriptor is on the
9772 top of the stack, remove it. Initialize is_on_stack field.
9773 (Descriptors::release): Only add pod to stack if it is not on the
9774 stack already.
9775 (Descriptors::close_some_descriptor): Clear stack_next and
9776 is_on_stack fields.
9777
e29e076a
ILT
9778 PR 7091
9779 * output.cc (Output_section::find_starting_output_address): Rename
9780 from starting_output_address; add PADDR parameter; change return
9781 type.
9782 * output.h (class Output_section): Declare
9783 find_starting_output_address instead of starting_output_address.
9784 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
9785 section symbol for which we can't find a merge section.
9786
0602e05a
ILT
9787 PR 9836
9788 * symtab.cc (Symbol_table::add_from_object): If the visibility is
9789 hidden or internal, force the symbol to be local.
9790 * resolve.cc (Symbol::override_visibility): Define.
9791 (Symbol::override_base): Use override_visibility.
9792 (Symbol_table::resolve): Likewise.
9793 (Symbol::override_base_with_special): Likewise.
9794 (Symbol_table::override_with_special): If the visibility is hidden
9795 or internal, force the symbol to be local.
9796 * symtab.h (class Symbol): Add set_visibility and
9797 override_visibility.
9798 * testsuite/ver_test_1.sh: New file.
9799 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
9800 (check_DATA): Add ver_test_1.syms.
9801 (ver_test_1.syms): New target.
9802 * testsuite/Makefile.in: Rebuild.
9803
401a9a73
CC
98042009-02-25 Cary Coutant <ccoutant@google.com>
9805
9806 * layout.cc (Layout::choose_output_section): Don't rename sections
9807 when using a linker script that has a SECTIONS clause.
9808 * Makefile.in: Regenerate.
9809
9810 * testsuite/Makefile.am (script_test_5.sh): New test case.
9811 * testsuite/Makefile.in: Regenerate.
9812 * testsuite/script_test_5.cc: New file.
9813 * testsuite/script_test_5.sh: New file.
9814 * testsuite/script_test_5.t: New file.
9815
f488e4b0
CC
98162009-02-13 Rafael Avila de Espindola <espindola@google.com>
9817
9818 * archive.cc (Archive::include_member): Update calls to add_symbols.
9819 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
9820 the Layout argument.
9821 * dynobj.h (do_add_symbols): Add the Layout argument.
9822 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
9823 Layout argument.
9824 * object.h (Object::add_symbols): Add the Layout argument.
9825 (Object::do_add_symbols): Add the Layout argument.
9826 (Sized_relobj::do_add_symbols): Add the Layout argument.
9827 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
9828 Unify the two versions.
9829 (Add_plugin_symbols): Remove.
9830 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
9831 (Sized_pluginobj::do_add_symbols): Unify the two versions.
9832 (Add_plugin_symbols): Remove.
9833 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
9834 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
9835 (Add_symbols::run): Make it work with Pulginobj.
9836
89dd1680
ILT
98372009-02-06 Ian Lance Taylor <iant@google.com>
9838
9839 * object.cc (Sized_relobj::do_layout): Make info message start
9840 with lower case letter.
9841
266d0a74
ILT
98422009-02-06 Mikolaj Zalewski <mikolajz@google.com>
9843
602b464e
ILT
9844 * binary.cc: Fix file comment.
9845
266d0a74
ILT
9846 * options.h (enum Incremental_disposition): Define.
9847 (class General_options): Add new options: --incremental,
9848 --incremental_changed, --incremental_unchanged,
9849 --incremental_unknown. Add incremental_disposition_ and
9850 implicit_incremental_ fields.
9851 (General_options::incremental_disposition): New function.
9852 (class Position_dependent_options): Add incremental_disposition
9853 option.
9854 (Position_dependent_options::copy_from_options): Set incremental
9855 dispositions.
9856 * options.cc (General_options::parse_incremental_changed): New
9857 function.
9858 (General_options::parse_incremental_unchanged): New function.
9859 (General_options::parse_incremental_unknown): New function.
9860 (General_options::General_options): Initialize new fields
9861 incremental_disposition_ and implicit_incremental_.
9862 (General_options::finalize): Check for uasge of --incremental-*
9863 without --incremental.
9864
f073bbf7
CD
98652009-02-06 Chris Demetriou <cgd@google.com>
9866
9867 * gold.h (gold_undefined_symbol): Change to take only a Symbol
9868 pointer and to report location as the file name associated with
9869 the symbol.
9870 (gold_undefined_symbol_at_location): New function to replace the
9871 old gold_undefined_symbol functionality.
9872 * target-reloc.h (relocate_section): Update to use
9873 gold_undefined_symbol_at_location.
9874 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
9875 Call gold_undefined_symbol function rather than gold_error.
9876 * errors.h (Errors::undefined_symbol): Take location as a
9877 string, rather than calculating it from a relocation.
9878 * errors.cc (Errors::fatal): Print "fatal error:" before the
9879 formatted message.
9880 (Errors::error, Errors::error_at_location): Print "error: "
9881 before the formatted message.
9882 (Errors::undefined_symbol): Take location as a string, rather
9883 than calculating it from a relocation.
9884 (gold_undefined_symbol_at_location): New function akin to
9885 old gold_undefined_symbol, calculates location from relocation.
9886 (gold_undefined_symbol): Change to take only a Symbol pointer
9887 and to report location as the file name associated with the symbol.
9888 * testsuite/debug_msg.sh: Update for changed error messages.
9889 * testsuite/undef_symbol.sh: Likewise.
9890
8e94a90c
ILT
98912009-02-04 Duncan Sands <baldrick@free.fr>
9892
9893 PR 9812
9894 * reduced_debug_output.h
9895 (Output_reduced_debug_abbrev_section::failed): Use format for
9896 gold_warning.
9897 (Output_reduced_debug_info_section::faild): Likewise.
9898
88a0e15b
ILT
98992009-01-31 Mikolaj Zalewski <mikolajz@google.com>
9900
9901 * script.cc (Lazy_demangler): New class.
9902 (Version_script_info::get_symbol_version_helper): Demangle a
9903 symbol only once.
9904
5efc7cd2
CC
99052009-01-29 Cary Coutant <ccoutant@google.com>
9906
9907 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
9908 to __tls_get_addr.
9909 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
9910
e0ebcf42
ILT
99112009-01-28 Ian Lance Taylor <iant@google.com>
9912
5efc7cd2 9913 * version.cc (version_string): Bump to 1.9.
75fe7426 9914
e0ebcf42
ILT
9915 * gold.h: Include <cstring> and <stdint.h>.
9916 * version.cc: Include <cstdio>.
9917 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
9918 warning.
9919 * reduced_debug_output.cc (insert_into_vector): Rename from
9920 Insert_into_vector; change all callers. Use Swap_unaligned to
9921 avoid aliasing issue; remove union since it is unnecessary.
9922
8e2813be 99232009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
9924
9925 * Makefile.am (CCFILES): Add gc.cc.
9926 (HFILES): Add gc.h.
9927 * Makefile.in: Regenerate.
9928 * gold.cc (Gc_runner): New class.
9929 (queue_initial_tasks): Call garbage collection related tasks
9930 when corresponding options are invoked.
9931 (queue_middle_gc_tasks): New function.
9932 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
9933 processed early before laying out sections during garbage collection.
9934 * gold.h (queue_middle_gc_tasks): New function.
9935 (is_prefix_of): Move from "layout.cc".
9936 * i386.cc (Target_i386::gc_process_relocs): New function.
9937 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
9938 * main.cc (main): Create object of class "Garbage_collection".
9939 * object.cc (Relobj::copy_symbols_data): New function.
9940 (Relobj::is_section_name_included): New function.
e1df38aa
NC
9941 (Sized_relobj::do_layout): Allow this function to be called twice
9942 during garbage collection and defer layout of section during the
6d03d481
ST
9943 first call.
9944 * object.h (Relobj::get_symbols_data): New function.
9945 (Relobj::is_section_name_included): New function.
9946 (Relobj::copy_symbols_data): New function.
9947 (Relobj::set_symbols_data): New function.
9948 (Relobj::get_relocs_data): New function.
9949 (Relobj::set_relocs_data): New function.
9950 (Relobj::is_output_section_offset_invalid): New pure virtual function.
9951 (Relobj::gc_process_relocs): New function.
9952 (Relobj::do_gc_process_relocs): New pure virtual function.
9953 (Relobj::sd_): New data member.
9954 (Sized_relobj::is_output_section_offset_invalid): New function.
9955 (Sized_relobj::do_gc_process_relocs): New function.
9956 * options.h (General_options::gc_sections): Modify to not be a no-op.
9957 (General_options::print_gc_sections): New option.
9958 * plugin.cc (Plugin_finish::run): Remove function call to
9959 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
9960 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
9961 * reloc.cc (Read_relocs::run): Add task to process relocs and
9962 determine unreferenced sections when doing garbage collection.
9963 (Gc_process_relocs): New class.
9964 (Sized_relobj::do_gc_process_relocs): New function.
9965 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
9966 sections that are garbage collected.
9967 * reloc.h (Gc_process_relocs): New class.
9968 * sparc.cc (Target_sparc::gc_process_relocs): New function.
9969 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
9970 symbols whose corresponding sections are garbage collected.
9971 (Symbol_table::Symbol_table): Add new parameter for the garbage
9972 collection object.
9973 (Symbol_table::gc_mark_undef_symbols): New function.
9974 (Symbol_table::gc_mark_symbol_for_shlib): New function.
9975 (Symbol_table::gc_mark_dyn_syms): New function.
9976 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
9977 as garbage.
9978 (Symbol_table::add_from_object): Likewise.
9979 (Symbol_table::add_from_relobj): When building shared objects, do not
9980 treat externally visible symbols as garbage.
9981 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
9982 table information for static and relocatable links.
9983 * symtab.h (Symbol_table::set_gc): New function.
9984 (Symbol_table::gc): New function.
9985 (Symbol_table::gc_mark_undef_symbols): New function.
9986 (Symbol_table::gc_mark_symbol_for_shlib): New function.
9987 (Symbol_table::gc_mark_dyn_syms): New function.
9988 (Symbol_table::gc_): New data member.
e1df38aa 9989 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
9990 function.
9991 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
9992 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
9993
3b293544
CF
99942009-01-20 Chris Faylor <me.sourceware@sourceware.org>
9995
9996 * options.h (General_options::gc_sections): Define as a no-op for now.
9997 (General_options::no_keep_memory): Ditto.
9998 (General_options::Bshareable): Define.
9999 * options.cc (General_options::finalize): Honor -Bshareable.
10000
83d22aa8
AS
100012009-01-20 Andreas Schwab <schwab@suse.de>
10002
10003 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
10004 read the value in the contents, since we don't use it. Use the
10005 template endianness when writing.
10006 (Relocate::relocate): Use it for R_PPC_REL16_HA.
10007
cd536b21
AS
100082009-01-19 Andreas Schwab <schwab@suse.de>
10009
10010 * configure.tgt (powerpc64-*): Fix targ_obj.
10011
99e9a495
ILT
100122009-01-15 Ian Lance Taylor <iant@google.com>
10013
10014 * object.cc (Sized_relobj::write_local_symbols): Don't write out
10015 local symbols when stripping all symbols.
10016
bbbfea06
CC
100172009-01-14 Cary Coutant <ccoutant@google.com>
10018
99e9a495 10019 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 10020
0f7c0701
CC
100212009-01-14 Cary Coutant <ccoutant@google.com>
10022
10023 * archive.cc (Archive::get_elf_object_for_member): Remove call
10024 to File_read::claim_for_plugin.
10025 * descriptors.cc (Descriptors::open): Remove reference to
10026 is_claimed.
10027 (Descriptors::claim_for_plugin): Remove.
10028 * descriptors.h (Descriptors::claim_for_plugin): Remove.
10029 (Descriptors::is_claimed): Remove.
10030 (claim_descriptor_for_plugin): Remove.
10031 * fileread.cc (File_read::claim_for_plugin): Remove.
10032 * fileread.h (File_read::claim_for_plugin): Remove.
10033 (File_read::descriptor): Reopen descriptor if necessary.
10034 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
10035 (Plugin_manager::all_symbols_read): Add task parameter. Change
10036 all callers.
10037 (Plugin_manager::get_input_file): New function.
10038 (Plugin_manager::release_input_file): New function.
10039 (Pluginobj::Pluginobj): Add filesize parameter and initialize
10040 corresponding data member.
10041 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
10042 and pass to base constructor. Change all callers.
10043 (get_input_file, release_input_file): New functions.
10044 (make_sized_plugin_object): Add filesize parameter. Change all callers.
10045 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
10046 (Plugin_manager::all_symbols_read): Add task parameter.
10047 (Plugin_manager::get_input_file): New function.
10048 (Plugin_manager::release_input_file): New function.
10049 (Plugin_manager::task_): New data member.
10050 (Pluginobj::Pluginobj): Add filesize parameter.
10051 (Pluginobj::filename): New function.
10052 (Pluginobj::descriptor): New function.
10053 (Pluginobj::filesize): New function.
10054 (Pluginobj::filesize_): New data member.
10055 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
10056 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
10057 File_read::claim_for_plugin; use Object::unlock to unlock the file.
10058
10059 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
10060 with archive libraries.
10061 * testsuite/Makefile.in: Regenerate.
10062 * testsuite/plugin_test.c (struct sym_info): New type.
10063 (get_input_file, release_input_file): New static variables.
10064 (onload): Capture new transfer vector entries.
10065 (claim_file_hook): Stop reading at end of file according to filesize.
10066 Factor out parsing of readelf output into separate function.
10067 (all_symbols_read_hook): Exercise get_input_file and release_input_file
10068 APIs and get the source file name from the symbol table. Convert
10069 source file name to corresponding object file name. Print info
10070 message when adding new input files.
10071 (parse_readelf_line): New function.
10072 * testsuite/plugin_test_1.sh: Add checks for new info messages.
10073 * testsuite/plugin_test_2.sh: Likewise.
10074 * testsuite/plugin_test_3.sh: Likewise.
10075 * testsuite/plugin_test_4.sh: New test case.
10076
62a6d109
ILT
100772009-01-07 Ian Lance Taylor <iant@google.com>
10078
10079 * version.cc (version_string): Bump to 1.8.
10080
483620e8
CC
100812008-12-23 Cary Coutant <ccoutant@google.com>
10082
10083 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
10084 * plugin.cc (Plugin_manager::finish): Rename as
10085 layout_deferred_objects. Move cleanup to separate function.
10086 (Plugin_manager::cleanup): New function.
10087 (Plugin_finish::run): Call layout_deferred_objects and cleanup
10088 separately.
10089 * plugin.h (Plugin_manager::finish): Rename as
10090 layout_deferred_objects.
10091 (Plugin_manager::cleanup): New function.
10092 (Plugin_manager::cleanup_done): New field.
10093
d66a9eb3
CC
100942008-12-23 Cary Coutant <ccoutant@google.com>
10095
10096 * plugin.cc (is_visible_from_outside): New function.
10097 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
10098 so we don't return "IR only" status for exported symbols or -r links.
10099
10100 * testsuite/Makefile.am (plugin_test_3): New test case.
10101 * testsuite/Makefile.in: Regenerate.
10102 * testsuite/plugin_test_3.sh: New file.
10103
5995b570
CC
101042008-12-22 Cary Coutant <ccoutant@google.com>
10105
10106 * object.cc (Sized_relobj::layout_section): New function.
10107 (Sized_relobj::do_layout): Defer layout of input sections until after
10108 plugin has provided replacement files.
10109 (Sized_relobj::do_layout_deferred_sections): New function.
10110 * object.h (Relobj::set_section_offset): Remove virtual keyword.
10111 (Relobj::layout_deferred_sections): New function.
10112 (Relobj::do_layout_deferred_sections): New function.
10113 (Sized_relobj::do_layout_deferred_sections): New function.
10114 (Sized_relobj::layout_section): New function.
10115 (Sized_relobj::Deferred_layout): New structure.
10116 (Sized_relobj::deferred_layout_): New field.
10117 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
10118 Change all callers. Layout deferred sections.
10119 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
10120 references.
10121 (Plugin_hook::run): Move code from do_plugin_hook inline.
10122 (Plugin_hook::do_plugin_hook): Remove.
10123 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
10124 (Plugin_manager::finish): Renamed, was cleanup.
10125 (Plugin_manager::should_defer_layout): New function.
10126 (Plugin_manager::add_deferred_layout_object): New function.
10127 (Plugin_manager::Deferred_layout_list): New type.
10128 (Plugin_manager::deferred_layout_objects_): New field.
10129 (Plugin_hook::do_plugin_hook): Remove.
10130
ee769c88
ILT
101312008-12-17 Ian Lance Taylor <iant@google.com>
10132
10133 * options.h (class General_options): Add --no case for
10134 --export-dynamic.
10135
abc8dcba
CC
101362008-12-16 Cary Coutant <ccoutant@google.com>
10137
10138 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
10139 vector.
10140 (Plugin_manager::claim_file): Create plugin object even if
10141 plugin did not call the add_symbols callback.
10142 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
10143 asking for more symbols than were added.
10144 * testsuite/Makefile.am (plugin_test_1): Add test case with
10145 no global symbols.
10146 (empty.syms): New target.
10147 * testsuite/Makefile.in: Regenerate.
10148 * testsuite/plugin_test.c (claim_file_hook): Add new debug
10149 message. Don't call add_symbols if no globals.
10150 (all_symbols_read_hook): Don't provide replacement for empty
10151 claimed file.
10152
b0074644
ILT
101532008-12-12 Ian Lance Taylor <iant@google.com>
10154
68943102
ILT
10155 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
10156 r_type == 0 for a local symbol with r_sym == 0.
10157 (scan_relocatable_relocs): Pass r_sym to
10158 local_non_section_strategy.
10159 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
10160 r_sym parameter.
10161
b0074644
ILT
10162 * configure.ac: Update test for TLS descriptors: they are
10163 supported as of glibc 2.9.
10164 * configure: Rebuild.
10165
c2508178
ILT
101662008-12-11 Ian Lance Taylor <iant@google.com>
10167
10168 PR 7091
10169 * target-reloc.h (Default_scan_relocatable_relocs): For each
10170 function, map r_type == 0 to RELOC_DISCARD.
10171
2756a258
CC
101722008-12-10 Cary Coutant <ccoutant@google.com>
10173
10174 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
10175 object to override a kept COMDAT group from a plugin object.
10176
bb6f53d3
ILT
101772008-12-09 Ian Lance Taylor <iant@google.com>
10178
fbc558e1
ILT
10179 PR 7088
10180 * yyscript.y (file_cmd): Handle INPUT.
10181
bb6f53d3
ILT
10182 * testsuite/initpri1.c: Change all declarations to be full
10183 prototypes by adding void, to avoid compiler warnings.
10184
4674ecfc
CC
101852008-12-05 Rafael Avila de Espindola <espindola@google.com>
10186
10187 * options.cc (General_options::parse_plugin_opt): New.
10188 (General_options::add_plugin): The argument now is just the filename.
10189 (General_options::add_plugin_option): New.
10190 * options.h (plugin_opt): New.
10191 (add_plugin): Change argument name.
10192 (add_plugin_option): New.
10193 * plugin.cc (Plugin::load): Don't parse the plugin option.
10194 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
10195 (Plugin::add_option): New.
10196 (Plugin::args_): Change type.
10197 (Plugin::filename_): New.
10198 (Plugin_manager::add_plugin_option): New.
10199 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
10200 * testsuite/Makefile.in: Regenerate.
10201
fd06b4aa
CC
102022008-12-05 Cary Coutant <ccoutant@google.com>
10203
10204 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
10205 Handle --strip-lto-sections option.
10206 * options.h (strip_lto_sections): New option.
10207
6c52134c
CC
102082008-12-01 Cary Coutant <ccoutant@google.com>
10209
10210 * plugin.cc (ld_plugin_message): Change format parameter to const.
10211 Fix mismatch between new[] and delete.
10212
a45248e0
CC
102132008-11-14 Cary Coutant <ccoutant@google.com>
10214
10215 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
10216 instead of -1U.
10217
c82fbeee
CS
102182008-11-05 Craig Silverstein <csilvers@google.com>
10219
10220 * options.cc (General_options::parse_dynamic_list): New function.
10221 * options.h (General_options): New flags dynamic_list,
10222 dynamic_list_data, dynamic_list_cpp_new, and
10223 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
10224 (General_options::in_dynamic_list): New function.
10225 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
10226 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
10227 (Lex::can_continue_name): Likewise.
10228 (yylex): Likewise.
10229 (read_script_file): New parameter script_options.
10230 (read_dynamic_list): New function.
10231 (Script_options::define_dynamic_list): New function.
10232 (dynamic_list_keyword_parsecodes): New variable.
10233 (dynamic_list_keywords): New variable.
10234 * script.h (Script_options::define_dynamic_list): New function
10235 prototype.
10236 (read_dynamic_list): New function prototype.
10237 * symtab.cc (strprefix): New macro.
10238 (Symbol::should_add_dynsym_entry): Support dynamic_list,
10239 dynamic_list_data, dynamic_list_cpp_new, and
10240 dynamic_list_cpp_typeinfo.
10241 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
10242 (dynamic_list_expr): New rule.
10243 (dynamic_list_nodes): Likewise.
10244 (dynamic_list_node): Likewise.
10245 * testsuite/Makefile.am (dynamic_list): New test.
10246 * testsuite/Makefile.in: Regenerated.
10247 * testsuite/dynamic_list.t: New file.
10248 * testsuite/dynamic_list.sh: New file.
10249
e0bb29a5
CS
102502008-11-05 Craig Silverstein <csilvers@google.com>
10251
10252 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
10253 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
10254 (t11_last): Likewise.
10255 * testsuite/ver_test_6.c (main): Likewise.
10256
4e1e25e0
CC
102572008-10-07 Cary Coutant <ccoutant@google.com>
10258
10259 * options.c (General_options::finalize): Add check for -static and
10260 -shared.
10261 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
10262 is not empty.
10263
92f03fcb
CC
102642008-10-02 Cary Coutant <ccoutant@google.com>
10265
10266 * plugin.cc (make_sized_plugin_object): Fix conditional
10267 compilation to work when not all targets are enabled.
10268
fbd8a257
CC
102692008-09-29 Cary Coutant <ccoutant@google.com>
10270
10271 * archive.cc (Archive::get_file_and_offset): Use filename instead
10272 of name to get library path.
10273 (Archive::include_member): Unlock external member of a thin archive.
10274
10275 * testsuite/Makefile.am (TEST_AR): New variable.
10276 (thin_archive_test_1): New test.
10277 (thin_archive_test_2): New test.
81636b3f
CC
10278 * testsuite/Makefile.in: Regenerate.
10279 * testsuite/thin_archive_main.cc: New file.
10280 * testsuite/thin_archive_test_1.cc: New file.
10281 * testsuite/thin_archive_test_2.cc: New file.
10282 * testsuite/thin_archive_test_3.cc: New file.
10283 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 10284
eff45813
CC
102852008-09-29 Cary Coutant <ccoutant@google.com>
10286
10287 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
10288 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
10289 instead of -1U.
10290 (Sized_relobj::do_finalize_local_symbols): Likewise.
10291 (Sized_relobj::map_to_kept_section): Likewise.
10292 * object.h (Sized_relobj::invalid_address): New constant.
10293 (Sized_relobj::do_output_section_offset): Check for invalid_address
10294 and return -1ULL.
10295 * output.cc (Output_reloc::local_section_offset): Use constant
10296 invalid_address instead of -1U.
10297 (Output_reloc::get_address): Likewise.
10298 (Output_section::output_address): Change -1U to -1ULL.
10299 * output.h (Output_reloc::invalid_address): New constant.
10300 * reloc.cc (Sized_relobj::write_sections): Use constant
10301 invalid_address instead of -1U.
10302 (Sized_relobj::relocate_sections): Likewise.
10303 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
10304 values for merge sections.
10305 * target-reloc.h (relocate_for_relocatable): Use constant
10306 invalid_address instead of -1U.
10307
89fc3421
CC
103082008-09-19 Cary Coutant <ccoutant@google.com>
10309
10310 Add plugin functionality for link-time optimization (LTO).
10311 * configure.ac (plugins): Add --enable-plugins option.
10312 * configure: Regenerate.
10313 * config.in: Regenerate.
10314 * Makefile.am (LIBDL): New variable.
10315 (CCFILES): Add plugin.cc.
10316 (HFILES): Add plugin.h.
10317 (ldadd_var): Add LIBDL.
10318 * Makefile.in: Regenerate.
10319
10320 * archive.cc: Include "plugin.h".
10321 (Archive::setup): Don't preread archive symbols when using a plugin.
10322 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
10323 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
10324 files.
10325 (Archive::include_member): Add symbols from plugin objects.
10326 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
10327 * descriptors.cc (Descriptors::open): Check for file descriptors
10328 abandoned by plugins.
10329 (Descriptors::claim_for_plugin): New function.
10330 * descriptors.h (Descriptors::claim_for_plugin): New function.
10331 (Open_descriptor::is_claimed): New field.
10332 (claim_descriptor_for_plugin): New function.
10333 * fileread.cc (File_read::claim_for_plugin): New function.
10334 * fileread.h (File_read::claim_for_plugin): New function.
10335 (File_read::descriptor): New function.
10336 * gold.cc: Include "plugin.h".
10337 (queue_initial_tasks): Add task to call plugin hooks for generating
10338 new object files.
10339 * main.cc: Include "plugin.h".
10340 (main): Load plugin libraries.
10341 * object.h (Pluginobj): Declare.
10342 (Object::pluginobj): New function.
10343 (Object::do_pluginobj): New function.
10344 (Object::set_target): New function.
10345 * options.cc: Include "plugin.h".
10346 (General_options::parse_plugin): New function.
10347 (General_options::General_options): Initialize plugins_ field.
10348 (General_options::add_plugin): New function.
10349 * options.h (Plugin_manager): Declare.
10350 (General_options): Add --plugin option.
10351 (General_options::has_plugins): New function.
10352 (General_options::plugins): New function.
10353 (General_options::add_plugin): New function.
10354 (General_options::plugins_): New field.
10355 * plugin.cc: New file.
10356 * plugin.h: New file.
10357 * readsyms.cc: Include "plugin.h".
10358 (Read_symbols::do_read_symbols): Check for archive before checking
10359 for ELF file. Call plugin hooks to claim files.
10360 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
10361 from a real object file; force override when processing replacement
10362 files.
10363 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
10364 (Symbol::init_base_object): Likewise.
10365 (Symbol::init_base_output_data): Likewise.
10366 (Symbol::init_base_output_segment): Likewise.
10367 (Symbol::init_base_constant): Likewise.
10368 (Symbol::init_base_undefined): Likewise.
10369 (Symbol::output_section): Assert that object is not a plugin.
10370 (Symbol_table::add_from_pluginobj): New function.
10371 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
10372 undefined.
10373 (Symbol_table::sized_write_globals): Likewise.
10374 (Symbol_table::add_from_pluginobj): Instantiate template.
10375 * symtab.h (Sized_pluginobj): Declare.
10376 (Symbol::in_real_elf): New function.
10377 (Symbol::set_in_real_elf): New function.
10378 (Symbol::in_real_elf_): New field.
10379 (Symbol_table::add_from_pluginobj): New function.
10380
10381 * testsuite/Makefile.am (AM_CFLAGS): New variable.
10382 (LIBDL): New variable.
10383 (LDADD): Add LIBDL.
10384 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
10385 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
10386 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
10387 (MOSTLYCLEANFILES): Likewise.
10388 * testsuite/Makefile.in: Regenerate.
10389 * testsuite/plugin_test.c: New file.
10390 * testsuite/plugin_test_1.sh: New file.
10391 * testsuite/plugin_test_2.sh: New file.
10392
de31bda5
ILT
103932008-09-16 Ian Lance Taylor <iant@google.com>
10394
9c2d0ef9
ILT
10395 * target-reloc.h (relocate_section): Check whether a symbol is
10396 defined by the ABI before reporting an undefined symbol error.
10397 * target.h (Target::is_defined_by_abi): Make parameter const.
10398 (Target::do_is_defined_by_abi): Likewise.
10399 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
10400 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
10401 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
10402 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
10403 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
10404 * testsuite/Makefile.in: Rebuild.
10405
de31bda5
ILT
10406 * fileread.cc (make_view): Add casts to avoid warning.
10407
9fa33bee
AO
104082008-09-16 Alexandre Oliva <aoliva@redhat.com>
10409
10410 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
10411 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
10412
183fd0e3
AO
104132008-09-16 Alexandre Oliva <aoliva@redhat.com>
10414
10415 * options.h (General_options::output_is_executable): New.
10416 (General_options::output_is_pie): New.
10417 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
10418 for shared libraries.
10419 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
10420
7be8330a
CD
104212008-09-11 Chris Demetriou <cgd@google.com>
10422
10423 * options.h (origin): New -z option.
10424 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
10425 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
10426 in DT_FLAGS_1.
10427
a9caad02
CC
104282008-09-05 Cary Coutant <ccoutant@google.com>
10429
10430 * fileread.cc (File_read::make_view): Add check for attempt to map
10431 beyond end of file.
10432
ae6dce4d
CC
104332008-09-05 Cary Coutant <ccoutant@google.com>
10434
10435 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
10436 explicit instantiations.
10437
d7ab2a47
KVH
104382008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
10439
10440 PR gold/6858
10441 * options.cc (General_options::finalize): Allow undefined symbols
10442 in shlibs if linking -shared.
10443
10444 PR gold/6859
10445 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
10446 symbols as not needing a dynsym entry.
10447
1e52a9c1
CS
104482008-08-20 Craig Silverstein <csilvers@google.com>
10449
10450 * fileread.cc (File_read::open): Do not lock the file unless it
10451 was successfully opened.
10452
d85c80a3
CC
104532008-08-14 Cary Coutant <ccoutant@google.com>
10454
10455 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
10456 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
10457 * testsuite/tls_test.cc (struct int128): 128-bit struct
10458 for testing TLS relocs with non-zero addend.
10459 (v12): New TLS variable.
10460 (t12): New test.
10461 (t_last): Add check for v12.
10462 * testsuite/tls_test.h (t12): New function.
10463 * testsuite/tls_test_main.cc (thread_routine): Call new test.
10464
2d924fd9
ILT
104652008-08-13 Ian Lance Taylor <iant@google.com>
10466
10467 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
10468 set tls_segment_ or relro_segment_.
10469 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
10470 when appropriate.
10471 * output.h (Output_section::clear_is_relro): New function.
10472 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
10473 sections specially even when output_data_ is empty.
10474 (Output_segment::maximum_alignment): When first section is relro,
10475 only force alignment for PT_LOAD segments.
10476 * script.cc (script_data_segment_align): New function.
10477 (script_data_segment_relro_end): New function.
10478 * script-c.h (script_data_segment_align): Declare.
10479 (script_data_segment_relro_end): Declare.
10480 * script-sections.h (class Script_sections): Declare
10481 data_segment_align and data_segment_relro_end. Add fields
10482 segment_align_index_ and saw_relro_end_.
10483 * script-sections.cc (class Sections_element): Add set_is_relro
10484 virtual function. Add new bool* parameter to place_orphan_here.
10485 Add get_output_section virtual function.
10486 (class Output_section_definition): Add set_is_relro. Add new
10487 bool* parameter to place_orphan_here. Add get_output_section.
10488 Add is_relro_ field.
10489 (Output_section_definition::Output_section_definition): Initialize
10490 evaluated_address_, evaluated_load_address, evaluated_addralign_,
10491 and is_relro_ fields.
10492 (Output_section_definition::place_orphan_here): Add is_relro
10493 parameter.
10494 (Output_section_definition::set_section_addresses): Set relro for
10495 output section.
10496 (Output_section_definition::alternate_constraint): Likewise.
10497 (class Orphan_output_section): Add new bool* parameter to
10498 place_orphan_here. Add get_output_section.
10499 (Orphan_output_section::place_orphan_here): Add is_relro
10500 parameter.
10501 (Script_sections::Script_sections): Initialize
10502 data_segment_align_index_ and saw_relro_end_.
10503 (Script_sections::data_segment_align): New function.
10504 (Script_sections::data_segment_relro_end): New function.
10505 (Script_sections::place_orphan): Set or clear is_relro.
10506 (Script_sections::set_section_addresses): Force alignment of first
10507 TLS section.
10508 * yyscript.y (exp): Call script_data_segment_align and
10509 script_data_segment_relro_end.
10510 * testsuite/relro_script_test.t: New file.
10511 * testsuite/relro_test.cc (using_script): Declare.
10512 (t1, t2): Test using_script.
10513 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
10514 (relro_script_test_SOURCES): Define.
10515 (relro_script_test_DEPENDENCIES): Define.
10516 (relro_script_test_LDFLAGS): Define.
10517 (relro_script_test_LDADD): Define.
10518 (relro_script_test.so): New target.
10519 * testsuite/Makefile.in: Rebuild.
10520
f827c9a9
CC
105212008-08-06 Cary Coutant <ccoutant@google.com>
10522
10523 * archive.cc (Archive::total_archives, Archive::total_members)
10524 (Archive::total_members_loaded): New variables.
10525 (Archive::setup): Add parameter. Add option to preread
10526 archive symbols.
10527 (Archive::read_armap): Add counter.
10528 (Archive::get_file_and_offset): New function.
10529 (Archive::get_elf_object_for_member): New function.
10530 (Archive::read_all_symbols): New function.
10531 (Archive::read_symbols): New function.
10532 (Archive::add_symbols): Add counters.
10533 (Archive::include_all_members): Use armap to find members if it's
10534 already built.
10535 (Archive::include_member): Skip reading symbols if already read.
10536 Factored code into Archive::get_file_and_offset and
10537 Archive::get_elf_object_for_member. Changed call to
10538 Mapfile::report_include_archive_member.
10539 (Archive::print_stats): New function.
10540 * archive.h: Declare Object and Read_symbols_data classes.
10541 (Archive::Archive): Add initializers for new members.
10542 (Archive::setup): Add parameter.
10543 (Archive::print_stats): New function.
10544 (Archive::total_archives, Archive::total_members)
10545 (Archive::total_members_loaded): New variables.
10546 (Archive::get_file_and_offset): New function.
10547 (Archive::get_elf_object_for_member): New function.
10548 (Archive::read_all_symbols): New function.
10549 (Archive::read_symbols): New function.
10550 (Archive::Archive_member): New class.
10551 (Archive::members_): New member.
10552 (Archive::num_members_): New member.
10553 * main.cc: Include archive.h.
10554 (main): Call Archive::print_stats.
10555 * mapfile.cc (Mapfile::report_include_archive_member): Delete
10556 archive parameter; member_name is now the fully-decorated name.
10557 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
10558 * options.h: (General_options): Add --preread-archive-symbols option.
10559 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
10560 Archive::setup.
10561
de4c45bd
ILT
105622008-08-04 Ian Lance Taylor <iant@google.com>
10563
10564 * symtab.h (Symbol::use_plt_offset): New function.
10565 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
10566 * powerpc.cc (Relocate::relocate): Likewise.
10567 * sparc.cc (Relocate::relocate): Likewise.
10568 * x86_64.cc (Relocate::relocate): Likewise.
10569 * testsuite/weak_plt.sh: New test.
10570 * testsuite/weak_plt_main.cc: New test.
10571 * testsuite/weak_plt_shared.cc: New test.
10572 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
10573 (check_PROGRAMS): Add weak_plt.
10574 (check_DATA): Add weak_plt_shared.so.
10575 (weak_plt_main_pic.o, weak_plt): New targets.
10576 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
10577 * testsuite/Makefile.in: Rebuild.
10578
10579 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
10580 gcctestdir/ld.
10581 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
10582 * testsuite/Makefile.in: Rebuild.
10583
323ee3f4
AM
105842008-08-04 Alan Modra <amodra@bigpond.net.au>
10585
10586 * Makefile.am (POTFILES.in): Set LC_ALL=C.
10587 * Makefile.in: Regenerate.
10588 * po/POTFILES.in: Regenerate.
10589
7c07ecec
ILT
105902008-07-29 Ian Lance Taylor <iant@google.com>
10591
10592 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
10593 symbols before other symbols.
10594 * testsuite/script_test_2.cc (test_addr): Declare.
10595 (test_addr_alias): Declare.
10596 (main): Check that test_addr and test_addr_alias have the right
cd536b21 10597 values.
7c07ecec
ILT
10598 * testsuite/script_test_2.t: Define test_addr_alias and
10599 test_addr.
10600
5778530e
ILT
106012008-07-24 Ian Lance Taylor <iant@google.com>
10602
2a00e4fb
ILT
10603 PR 5990
10604 * descriptors.cc: New file.
10605 * descriptors.h: New file.
10606 * gold-threads.h (class Hold_optional_lock): New class.
10607 * fileread.cc: Include "descriptors.h".
10608 (File_read::~File_read): Release descriptor rather than closing
10609 it.
10610 (File_read::open) [file]: Call open_descriptor rather than open.
10611 Set is_descriptor_opened_.
10612 (File_read::open) [memory]: Assert that descriptor is not open.
10613 (File_read::reopen_descriptor): New function.
10614 (File_read::release): Release descriptor.
10615 (File_read::do_read): Make non-const. Reopen descriptor.
10616 (File_read::read): Make non-const.
10617 (File_read::make_view): Reopen descriptor.
10618 (File_read::do_readv): Likewise.
10619 * fileread.h (class File_read): Add is_descriptor_opened_ field.
10620 Update declarations.
10621 * layout.cc: Include "descriptors.h".
10622 (Layout::create_build_id): Use open_descriptor rather than open.
10623 * output.cc: Include "descriptors.h".
10624 (Output_file::open): Use open_descriptor rather than open.
10625 * archive.cc (Archive::const_iterator): Change Archive to be
10626 non-const.
10627 (Archive::begin, Archive::end): Make non-const.
10628 (Archive::count_members): Likewise.
10629 * archive.h (class Archive): Update declarations.
10630 * object.h (Object::read): Make non-const.
10631 * Makefile.am (CCFILES): Add descriptors.cc.
10632 (HFILES): Add descriptors.h.
10633 * Makefile.in: Rebuild.
10634
801647d1
ILT
10635 PR 6716
10636 * gold.h: Always include <clocale>. Add Solaris workarounds
10637 following code in binutils/sysdep.h.
10638
5edd166e
ILT
10639 PR 6048
10640 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
10641 this->eh_frame_hdr_ is NULL before using it.
10642
c89ad728
ILT
10643 * dynobj.cc (Versions::Versions): Update comment.
10644
aa86f06b
ILT
10645 * dynobj.cc (Versions::Versions): If there is an soname, use it as
10646 the base version name.
10647
5778530e
ILT
10648 * stringpool.cc (Stringpool_template::add_with_length): Set key to
10649 array size plus one.
10650 (Stringpool_template::set_string_offsets): Subtract one from key
10651 before using it as an array index.
10652 (Stringpool_template::get_offset_with_length): Likewise.
10653 (Stringpool_template::write_to_buffer): Likewise.
10654 * stringpool.h (Stringpool_template::get_offset_from_key):
10655 Likewise.
10656
057ead22
ILT
106572008-07-23 Ian Lance Taylor <iant@google.com>
10658
7f649c59
ILT
10659 PR 6658
10660 * object.h (Merged_symbol_value::value): Do our best to handle a
10661 negative addend.
10662
057ead22
ILT
10663 PR 6647
10664 * script.cc (Version_script_info::get_versions): Don't add empty
10665 version tag to return value.
10666 (Version_script_info::get_symbol_version_helper): Change return
10667 type to bool. Add pversion parameter. Change all callers.
10668 (script_register_vers_node): Don't require a non-NULL tag.
10669 * script.h (class Version_script_info): Update declarations.
10670 (Version_script_info::get_symbol_version): Change return type to
10671 bool. Add version parameter. Change all callers.
10672 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
10673 handling. Handle an empty version from a version script.
10674 (Symbol_table::define_special_symbol): Likewise.
10675 * testsuite/ver_test_10.script: New file.
10676 * testsuite/ver_test_10.sh: New file.
10677 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
10678 (check_DATA): Add ver_test_10.syms.
10679 (ver_test_10.syms, ver_test_10.so): New target.
10680 * testsuite/Makefile.in: Rebuild.
10681
58e54ac2
CD
106822008-07-23 Simon Baldwin <simonb@google.com>
10683
10684 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
10685 to zero for undefined symbols from dynamic libraries.
10686
95d14cd3
ILT
106872008-07-23 Ian Lance Taylor <iant@google.com>
10688
10689 * symtab.cc (Symbol_table::resolve): Remove version parameter.
10690 Change all callers.
10691 * symtab.h (class Symbol_table): Update declaration.
10692 * testsuite/ver_test_9.cc: New file.
10693 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
10694 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
10695 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
10696 (ver_test_9.so, ver_test_9.o): New targets.
10697 * testsuite/Makefile.in: Rebuild.
10698
92de84a6
ILT
106992008-07-22 Ian Lance Taylor <iant@google.com>
10700
34810851
ILT
10701 * options.h (class General_options): Define --check-sections.
10702 * layout.cc (Layout::set_segment_offsets): Handle
10703 --check-sections.
10704
af6156ef
ILT
10705 * options.h (class General_options): Define -n/--nmagic and
10706 -N/--omagic.
10707 * options.cc (General_options::finalize): For -n/--nmagic or
10708 -N/--omagic, set -static.
10709 * layout.cc (Layout::attach_allocated_section_to_segment): If
10710 -N/--omagic, don't put read-only and read-write sections in
10711 different segments.
10712 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
10713 finding a read-only segment.
10714 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
10715 don't set the minimum segment alignment to the common page size,
10716 and don't set the file offset to the address modulo the page size.
10717 * script-sections.cc (Script_sections::create_segments): If
10718 -n/--omagic, don't put read-only and read-write sections in
10719 different segments.
10720
92de84a6
ILT
10721 * cref.cc: New file.
10722 * cref.h: New file.
10723 * options.h (class General_options): Add --print-symbol-counts.
10724 * main.cc (main): Issue defined symbol report if requested.
10725 * archive.cc (Archive::interpret_header): Make into a const member
10726 function.
10727 (Archive::add_symbols): Call Input_objects::archive_start and
10728 archive_stop.
10729 (Archive::const_iterator): Define new class.
10730 (Archive::begin, Archive::end): New functions.
10731 (Archive::include_all_members): Rewrite to use iterator.
10732 (Archive::count_members): New function.
10733 * archive.h (class Archive): Update declarations.
10734 (Archive::filename): New function.
10735 * object.cc: Include "cref.h".
10736 (Sized_relobj::Sized_relobj): Initialize defined_count_.
10737 (Sized_relobj::do_get_global_symbol_counts): New function.
10738 (Input_objects::add_object): Add object to cross-referencer.
10739 (Input_objects::archive_start): New function.
10740 (Input_objects::archive_stop): New function.
10741 (Input_objects::print_symbol_counts): New function.
10742 * object.h: Declare Cref and Archive.
10743 (Object::get_global_symbol_counts): New function.
10744 (Object::do_get_global_symbol_counts): New pure virtual function.
10745 (class Sized_relobj): Add defined_count_ field. Update
10746 declarations.
10747 (class Input_objects): Add cref_ field. Update constructor.
10748 Update declarations.
10749 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
10750 defined_count_.
10751 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
10752 symbol counts.
10753 (Sized_dynobj::do_get_global_symbol_counts): New function.
10754 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
10755 defined_count_. Update declarations. Define Symbols typedef.
10756 * symtab.cc (Symbol_table::add_from_relobj): Add defined
10757 parameter. Change all callers.
10758 (Symbol_table::add_from_dynobj): Add sympointers and defined
10759 parameters. Change all callers.
10760 * symtab.h (class Symbol_table): Update declarations.
10761 * Makefile.am (CCFILES): Add cref.cc.
10762 (HFILES): Add cref.h.
10763 * Makefile.in: Rebuild.
10764
3f7c5e1d
CD
107652008-07-22 Simon Baldwin <simonb@google.com>
10766
10767 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
10768 to zero when writing undefined symbols.
10769
e0b64032
ILT
107702008-07-22 Ian Lance Taylor <iant@google.com>
10771
10772 * output.cc (Output_section::add_input_section): Don't try to
10773 merge empty merge sections.
10774
096b02cf
CS
107752008-07-21 Craig Silverstein <csilvers@google.com>
10776
10777 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
10778 Include symbol version in error message.
cd536b21 10779
1d1f116d
CD
107802008-07-20 Chris Demetriou <cgd@google.com>
10781
cd536b21 10782 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
10783 (RANDOM_SEED_CFLAGS): New substituted variable.
10784 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
10785 * configure: Rebuild.
10786 * Makefile.in: Likewise.
10787 * testsuite/Makefile.in: Likewise.
10788
a18f591e
ILT
107892008-07-18 Ian Lance Taylor <iant@google.com>
10790
10791 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
10792 where we see NAME/NULL and NAME/VERSION as separate symbols.
10793 * testsuite/ver_test_main.cc (main): Call t4.
10794 (t4, t4_2a): Define.
10795 * testsuite/ver_test_2.cc (t4_2): Define.
10796 * testsuite/ver_test_2.script: Put t4_2a in VER2.
10797 * testsuite/ver_test_4.cc (t4_2a): Define.
10798 * testsuite/ver_test_4.script: Put t4_2a in VER2.
10799 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
10800
c6e3f6ed
ILT
108012008-07-17 Ian Lance Taylor <iant@google.com>
10802
10803 * dynobj.cc (Versions::add_def): If we give an error about a
10804 missing version, go ahead and create the version anyhow.
10805
ef9beddf
ILT
108062008-07-10 Ian Lance Taylor <iant@google.com>
10807
10808 Handle output sections with more than 0x7fffffff bytes.
10809 * object.h (class Relobj): Change map_to_output_ to
10810 output_sections_, and just keep a section pointer. Change all
10811 uses. Move comdat group support to Sized_relobj.
10812 (Relobj::is_section_specially_mapped): Remove.
10813 (Relobj::output_section): Remove poff parameter. Change all
10814 callers.
10815 (Relobj::output_section_offset): New function.
10816 (Relobj::set_section_offset): Rewrite.
10817 (Relobj::map_to_output): Remove.
10818 (Relobj::output_sections): New function.
10819 (Relobj::do_output_section_offset): New pure virtual function.
10820 (Relobj::do_set_section_offset): Likewise.
10821 (class Sized_relobj): Add section_offsets_ field. Add comdat
10822 group support from Relobj. Update declarations.
10823 (Sized_relobj::get_output_section_offset): New function.
10824 (Sized_relobj::do_output_section_offset): New function.
10825 (Sized_relobj::do_set_section_offset): New function.
10826 * object.cc (Relobj::output_section_address): Remove.
10827 (Sized_relobj::Sized_relobj): Initialize new fields.
10828 (Sized_relobj::include_section_group): Cast find_kept_object to
10829 Sized_relobj.
10830 (Sized_relobj::include_linkonce_section): Likewise.
10831 (Sized_relobj::do_layout): Use separate arrays for output section
10832 and output offset.
10833 (Sized_relobj::do_count_local_symbols): Change map_to_output to
10834 output_sections.
10835 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
10836 output_sections and section_offsets.
10837 (Sized_relobj::write_local_symbols): Likewise.
10838 (map_to_kept_section): Compute output address directly.
10839 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
10840 output_sections and section_offsets.
10841 (Sized_relobj::write_sections): Likewise.
10842 (Sized_relobj::relocate_sections): Likewise.
10843 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
10844 * output.h (class Output_reloc): Update declarations. Change
10845 u2_.relobj to Sized_relobj*.
10846 (class Output_data_reloc): Change add functions to use
10847 Sized_relobj*.
10848 * output.cc (Output_reloc::Output_reloc): Change relobj to
10849 Sized_relobj*.
10850 (Output_reloc::local_section_offset): Change return type to
10851 Elf_Addr. Use get_output_section_offset.
10852 (Output_reloc::get_address): Likewise.
10853 (Output_section::is_input_address_mapped): Don't call
10854 is_section_specially_mapped.
10855 (Output_section::output_offset): Likewise.
10856 (Output_section::output_address): Likewise.
10857 (Output_section::starting_output_address): Likewise.
10858 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
10859 parameter to Sized_relobj*.
10860 (Copy_relocs::need_copy_reloc): Likewise.
10861 (Copy_relocs::save): Likewise.
10862 * copy-relocs.h (class Copy_relocs): Update declarations.
10863 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
10864 Sized_relobj*. Change relobj_ field to Sized_relobj*.
10865 * target-reloc.h (relocate_for_relocatable): Change
10866 offset_in_output_section type to Elf_Addr. Change code that uses
10867 it as well.
10868 * layout.cc (Layout::layout): Always set *off.
10869 * mapfile.cc (Mapfile::print_input_section): Use
10870 output_section_offset.
10871 * i386.cc (Target_i386::copy_reloc): Change object parameter to
10872 Sized_relobj*.
10873 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
10874 * sparc.cc (Target_sparc::copy_reloc): Likewise.
10875 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
10876
5cb66f97
ILT
108772008-07-03 Ian Lance Taylor <iant@google.com>
10878
10879 * layout.cc (Layout::include_section): Do not discard unrecognized
10880 SHT_STRTAB sections.
10881
afe47622
CS
108822008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
10883
10884 * script.cc (Lex::can_continue_name): Make '?' allowable in
10885 version-script names.
10886 * testsuite/version_script.map: Change glob pattern to use '?'
10887
5adf9721
ILT
108882008-06-30 Manish Singh <yosh@gimp.org>
10889
10890 PR 6585
10891 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
10892 Correct typo.
10893
e6fde208
ILT
108942008-06-30 Ian Lance Taylor <iant@google.com>
10895
10896 PR 6660
10897 PR 6682
10898 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
10899 versions]: Don't try to read the value in the contents, since we
10900 don't use it. Use the template endianness when writing.
10901
3f2e6a2d
CC
109022008-06-25 Cary Coutant <ccoutant@google.com>
10903
10904 * fileread.cc (File_read::make_view): Assert on zero-length view.
10905 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
10906 symbol table when there are no symbols to read.
10907
c43d3a48
CS
109082008-06-23 Craig Silverstein <csilvers@google.com>
10909
10910 * version.cc (version_string): Bump to 1.7
10911
5f494ea0
CS
109122008-06-18 Craig Silverstein <csilvers@google.com>
10913
10914 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
10915 constant 0xFFFF to type Valtype.
10916 (Powerpc_relocate_functions::rel16_ha): Likewise.
10917
c42e122e
ILT
109182008-06-17 Ian Lance Taylor <iant@google.com>
10919
f34787f8
ILT
10920 * output.h (Output_section::Input_section): Initialize p2align_ to
10921 zero for Output_section_data constructors.
10922 (Output_section::Input_section::addralign): If not an input
10923 section, return the alignment of the Output_section_data.
10924 * testsuite/copy_test.cc: New file.
10925 * testsuite/copy_test_1.cc: New file.
10926 * testsuite/copy_test_2.cc: New file.
10927 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
10928 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
10929 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
10930 (copy_test_1_pic.o, copy_test_1.so): New targets.
10931 (copy_test_2_pic.o, copy_test_2.so): New targets.
10932 * testsuite/Makefile.in: Rebuild.
10933
c42e122e
ILT
10934 * script-sections.cc (Script_sections::place_orphan): Initialize
10935 local variable exact.
10936
ce3ac18a
DE
109372008-06-13 David Edelsohn <edelsohn@gnu.org>
10938
10939 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
10940
42cacb20
DE
109412008-06-12 David Edelsohn <edelsohn@gnu.org>
10942 David S. Miller <davem@davemloft.net>
10943
10944 * powerpc.cc: New file.
10945 * Makefile.am (TARGETSOURCES): Add powerpc.cc
10946 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
10947 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
10948 * Makefile.in: Rebuild.
10949
7b308235
ILT
109502008-06-09 Ian Lance Taylor <iant@google.com>
10951
10952 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
10953 <exception>.
10954 (throwing, orig_terminate): New static variables.
10955 (terminate_handler): New static function.
10956 (t2): Set terminate handler.
10957
f0b886e3
ILT
109582008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
10959
10960 PR 6584
cd536b21 10961 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
10962 alignment.
10963
3e90f135
CC
109642008-05-30 Cary Coutant <ccoutant@google.com>
10965
10966 * archive.cc (Archive::include_all_members) Correct to step
10967 over symbol table and extended name table in thin archives.
10968
e09ad04a
ILT
109692008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
10970
10971 PR 6407
10972 * target-reloc.h (relocate_for_relocatable): Fix new_offset
10973 calculation.
10974
62b01cb5
ILT
109752008-05-28 Caleb Howe <cshowe@google.com>
10976
10977 * reduced_debug_output.cc: New file.
10978 * reduced_debug_output.h: New file.
92de84a6 10979 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
10980 * options.cc (General_options::finalize): Add strip_debug_non_line
10981 to the strip heirarchy.
10982 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
10983 fields.
10984 * layout.cc: Include "reduced_debug_output.h".
10985 (Layout::Layout): Initialize new fields.
10986 (line_only_debug_sections): New static array.
10987 (is_lines_only_debug_sections): New static inline function.
10988 (Layout::include_section): Handle --strip-debug-non-line.
10989 (Layout::make_output_section): If --strip-debug-non-line, build
10990 new output sections for .debug_abbrev and .debug_info.
10991 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
10992 gold. Warn about possible overflow.
10993 (read_signed_LEB_128): Likewise.
10994 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
10995 (read_signed_LEB_128): Declare.
10996 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
10997 (HFILES): Add reduced_debug_output.h.
10998 * Makefile.in: Rebuild.
10999
7d9e3d98
ILT
110002008-05-21 Ian Lance Taylor <iant@google.com>
11001
11002 * mapfile.cc: New file.
11003 * mapfile.h: New file.
11004 * options.h (class General_options): Add -M/--print-map and -Map.
11005 * options.cc (General_options::finalize): Make -M equivalent to
11006 -Map -.
11007 * main.cc: Include <cstdio> and "mapfile.h".
11008 (main): Open mapfile if requested.
11009 * gold.cc (class Middle_runner): Add mapfile_ field. Update
11010 constructor. Change caller.
11011 (queue_initial_tasks): Add mapfile parameter. Change caller.
11012 (queue_middle_tasks): Likewise.
11013 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
11014 declarations.
11015 * archive.cc: Include "mapfile.h".
11016 (Archive::add_symbols): Add mapfile parameter. Change all
11017 callers. Pass mapfile, symbol, and reason to include_member.
11018 (Archive::include_all_members): Add mapfile parameter. Change all
11019 callers.
11020 (Archive::include_member): Add mapfile, sym, and why parameters.
11021 Change all callers. Report inclusion to map file.
11022 * archive.h: Include "fileread.h".
11023 (class Archive): Update declarations.
11024 (Archive::file): New const method.
11025 (class Add_archive_symbols): Add mapfile_ field. Update
11026 constructor. Change all callers.
11027 * readsyms.h (class Read_symbols): Likewise.
11028 (class Finish_group): Likewise.
11029 (class Read_script): Likewise.
11030 * common.cc: Include "mapfile.h".
11031 (Symbol_table::allocate_commons): Add mapfile parameter. Change
11032 all callers.
11033 (Symbol_table::do_allocate_commons): Likewise.
11034 (Symbol_table::do_allocate_commons_list): Likewise. Report common
11035 symbol allocation to mapfile.
11036 * common.h (class Allocate_commons_task): Add mapfile_ field.
11037 Update constructor. Change all callers.
11038 * symtab.h (class Symbol_table): Update declarations.
11039 * layout.cc: Include "mapfile.h".
11040 (Layout_task_runner::run): Print information to mapfile.
11041 (Layout::create_gold_note): Change Output_data_fixed_space to
11042 Output_data_zero_fill.
11043 (Layout::create_build_id): Likewise.
11044 (Layout::print_to_mapfile): New function.
11045 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
11046 constructor. Change caller.
11047 (class Layout): Declare print_to_mapfile.
11048 * output.cc (Output_section::Input_section::print_to_mapfile): New
11049 function.
11050 (Output_section::add_input_section): If producing a map, always
11051 add to input_sections_ list.
11052 (Output_section::do_print_to_mapfile): New function.
11053 (Output_segment::print_sections_to_mapfile): New function.
11054 (Output_segment::print_section_list_to_mapfile): New function.
11055 * output.h: Include "mapfile.h".
11056 (Output_data::print_to_mapfile): New function.
11057 (Output_data::do_print_to_mapfile): New virtual function.
11058 (Output_segment_headers::do_print_to_mapfile): New function.
11059 (Output_file_header::do_print_to_mapfile): New function.
11060 (Output_data_const::do_print_to_mapfile): New function.
11061 (class Output_data_const_buffer): Add map_name_ field. Update
11062 constructor. Change all callers. Add do_print_to_mapfile
11063 function.
11064 (class Output_data_fixed_space): Likewise.
11065 (class Output_data_space): Likewise.
11066 (class Output_data_zero_fill): New class.
11067 (Output_data_strtab::do_print_to_mapfile): New function.
11068 (Output_data_reloc_base::do_print_to_mapfile): New function.
11069 (Output_relocatable_relocs::do_print_to_mapfile): New function.
11070 (Output_data_group::do_print_to_mapfile): New function.
11071 (Output_data_got::do_print_to_mapfile): New function.
11072 (Output_data_dynamic::do_print_to_mapfile): New function.
11073 (Output_symtab_xindex::do_print_to_mapfile): New function.
11074 (class Output_section): Declare do_print_to_mapflie. Declare
11075 print_to_mapfile in Input_section.
11076 (class Output_segment): Declare new functions.
11077 * object.h (Sized_relobj::symbol_count): New function.
11078 * script-sections.cc
11079 (Output_section_element_dot_assignment::set_section_addresses):
11080 Change Output_data_fixed_space to Output_data_zero_fill.
11081 (Output_data_expression::do_print_to_mapfile): New function.
11082 * script.cc (read_input_script): Add mapfile parameter. Change
11083 all callers.
11084 * script.h (read_input_script): Update declaration.
11085 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
11086 (Eh_frame::do_print_to_mapfile): New function.
11087 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
11088 (Output_merge_string::do_print_to_mapfile): New function.
11089 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
11090 function.
11091 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
11092 function.
11093 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
11094 function.
11095 * Makefile.am (CCFILES): Add mapfile.cc.
11096 (HFILES): Add mapfile.h.
11097 * Makefile.in: Rebuild.
11098
9f1d377b
ILT
110992008-05-19 Ian Lance Taylor <iant@google.com>
11100
11101 * options.h (class General_options): Add -z relro.
11102 * layout.cc (Layout::Layout): Initialize relro_segment_.
11103 (Layout::add_output_section_data): Return the output section.
11104 (Layout::make_output_section): Rcognize relro sections and mark
11105 them appropriately.
11106 (Layout::attach_allocated_section_to_segment): Put relro sections
11107 in a PT_GNU_RELRO segment.
11108 (Layout::create_initial_dynamic_sections): Mark the .dynamic
11109 section as relro.
11110 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
11111 PT_TLS segments.
11112 (Layout::linkonce_mapping): Map d.rel.ro.local to
11113 .data.rel.ro.local.
11114 (Layout::output_section_name): Us .data.rel.ro.local for any
11115 section which begins with that.
11116 * layout.h (class Layout): Update add_output_section_data
11117 declaration. Add relro_segment_ field.
11118 * output.cc (Output_section::Output_section): Initialize is_relro_
11119 and is_relro_local_ fields.
11120 (Output_segment::add_output_section): Group relro sections.
11121 (Output_segment::is_first_section_relro): New function.
11122 (Output_segment::maximum_alignment): If there is a relro section,
11123 align the segment to the common page size.
11124 (Output_segment::set_section_addresses): Track whether we are
11125 looking at relro sections. If the last section is a relro
11126 section, align to the common page size.
11127 (Output_segment::set_section_list_addresses): Add in_relro
11128 parameter. Change all callers. Align to the page size when
11129 moving from relro to non-relro section.
11130 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
11131 segment.
11132 * output.h (class Output_section): Add is_relro_ and
11133 is_relro_local_ fields.
11134 (Output_section::is_relro): New function.
11135 (Output_section::set_is_relro): New function.
11136 (Output_section::is_relro_local): New function.
11137 (Output_section::set_is_relro_local): New function.
11138 (class Output_segment): Update declarations.
11139 * i386.cc (Target_i386::got_section): Mark .got section as relro.
11140 * sparc.cc (Target_sparc::got_section): Likewise.
11141 * x86_64.cc (Target_x86_64::got_section): Likewise.
11142 * testsuite/relro_test_main.cc: New file.
11143 * testsuite/relro_test.cc: New file.
11144 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
11145 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
11146 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
11147 (relro_test.so, relro_test_pic.o): New targets.
11148 * testsuite/Makefile.in: Rebuild.
11149
a984ee1d
ILT
111502008-05-16 Ian Lance Taylor <iant@google.com>
11151
01676dcd
ILT
11152 * output.cc (Output_segment::add_output_section): Remove front
11153 parameter.
11154 * output.h (class Output_segment): Remove
11155 add_initial_output_section and overloaded add_output_section.
11156 Update declaration of remaining add_output_section.
11157 * layout.cc (Layout::create_interp): Call add_output_section
11158 rather than add_initial_output_section.
11159 (Layout::finish_dynamic_section): Likewise.
11160
497897f9
ILT
11161 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
11162 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
11163 know the dynamic type.
11164 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
11165 field. Initialize it in constructor.
11166 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
11167 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
11168 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
11169 reloc.
11170
a984ee1d
ILT
11171 * output.cc (Output_reloc::get_address): Change return type to
11172 Elf_Addr.
11173 * output.h (class Output_reloc): Update get_address declaration.
11174 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
11175 for section addresses.
11176
55ba0940
ILT
111772008-05-09 Ian Lance Taylor <iant@google.com>
11178
11179 PR 6493
11180 * gold.cc (gold_nomem): Use return value of write.
11181
75517b77
ILT
111822008-05-08 Ian Lance Taylor <iant@google.com>
11183
11184 * symtab.c (Symbol::init_base_output_data): Add version
11185 parameter. Change all callers.
11186 (Symbol::init_base_output_segment): Likewise.
11187 (Symbol::init_base_constant): Likewise.
11188 (Symbol::init_base_undefined): Likewise.
11189 (Sized_symbol::init_output_data): Likewise.
11190 (Sized_symbol::init_output_segment): Likewise.
11191 (Sized_symbol::init_constant): Likewise.
11192 (Sized_symbol::init_undefined): Likewise.
11193 (Symbol_table::do_define_in_output_data): If the new symbol has a
11194 version, mark it as the default.
11195 (Symbol_table::do_define_in_output_segment): Likewise.
11196 (Symbol_table::do_define_as_constant): Likewise.
11197 * symtab.h (class Symbol): Update declarations.
11198 (class Sized_symbol): Likewise.
11199 * resolve.cc (Symbol::override_version): New function.
c42e122e 11200 (Symbol::override_base): Call override_version.
75517b77
ILT
11201 (Symbol::override_base_with_special): Likewise.
11202 * testsuite/ver_script_8.script: New file.
11203 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
11204 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
11205 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
11206 (ver_test_8_1.so, ver_test_8_2.so): New targets.
11207
f1f70eae
ILT
112082008-05-06 Ian Lance Taylor <iant@google.com>
11209
f3e9c5c5
ILT
11210 PR 6049
11211 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
11212 functions.
11213 (class General_options): Remove existing --undefined, and add
11214 --no-undefined instead. Add new --undefined as synonym for -u.
11215 * archive.cc (Archive::add_symbols): Check whether symbol was
11216 named with -u.
11217 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
11218 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
11219 all uses. Add IS_UNDEFINED. Update declarations to split
11220 different versions of init_base. Declare init_base_undefined.
11221 (Symbol::is_defined): Handle IS_UNDEFINED.
11222 (Symbol::is_undefined): Likewise.
11223 (Symbol::is_weak_undefined): Call is_undefined.
11224 (Symbol::is_absolute): Handle IS_CONSTANT.
11225 (class Sized_symbol): Update declarations to split different
11226 versions of init. Declare init_undefined.
11227 (class Symbol_table): Declare new functions.
11228 * symtab.cc (Symbol::init_base_object): Rename from init_base.
11229 Change all callers.
11230 (Symbol::init_base_output_data): Likewise.
11231 (Symbol::init_base_output_segment): Likewise.
11232 (Symbol::init_base_constant): Likewise.
11233 (Symbol::init_base_undefined): New function.
11234 (Sized_symbol::init_object): Rename from init. Change all
11235 callers.
11236 (Sized_symbol::init_output_data): Likewise.
11237 (Sized_symbol::init_output_segment): Likewise.
11238 (Sized_symbol::init_constant): Likewise.
11239 (Sized_symbol::init_undefined): New function.
11240 (Symbol_table::add_undefined_symbols_from_command_line): New
11241 function.
11242 (Symbol_table::do_add_undefined_symbols_from_command_line): New
11243 function.
11244 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
11245 (Symbol::output_section): Likewise.
11246 (Symbol::set_output_section): Likewise.
11247 (Symbol_table::sized_finalize_symbol): Likewise.
11248 (Symbol_table::sized_write_globals): Likewise.
11249 * resolve.cc (Symbol_table::should_override): Likewise.
11250 (Symbol::override_base_with_special): Likewise.
11251
8bdcdf2c
ILT
11252 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
11253 symbol, change it to have default visibility.
11254 * testsuite/protected_1.cc: New file.
11255 * testsuite/protected_2.cc: New file.
11256 * testsuite/protected_3.cc: New file.
11257 * testsuite/protected_main_1.cc: New file.
11258 * testsuite/protected_main_2.cc: New file.
11259 * testsuite/protected_main_3.cc: New file.
11260 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
11261 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
11262 (protected_1_LDFLAGS, protected_1_LDADD): Define.
11263 (protected_1.so): New target.
11264 (protected_1_pic.o, protected_2_pic.o): New targets.
11265 (protected_3_pic.o): New target.
11266 (check_PROGRAMS): Add protected_2.
11267 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
11268 (protected_2_LDFLAGS, protected_2_LDADD): Define.
11269 * testsuite/Makefile.in: Rebuild.
11270
2b706932
ILT
11271 * options.h (DEFINE_var): Add set_user_set_##varname__.
11272 (DEFINE_bool_alias): New macro.
11273 (class General_options): Define -Bstatic using DEFINE_bool_alias
11274 rather than DEFINE_special. Add --undefined as an alias for -z
11275 defs.
11276 * options.cc (General_options::parse_Bstatic): Remove.
11277
d82a5bcc
ILT
11278 * options.h (class General_options): Add --fatal-warnings.
11279 * main.cc (main): Implement --fatal-warnings.
11280 * errors.h (Errors::warning_count): New function.
11281
f1f70eae
ILT
11282 * options.h (class General_options): Add -Bsymbolic-functions.
11283 * symtab.h (Symbol::is_preemptible): Check for
11284 -Bsymbolic-functions.
11285
8825ac63
ILT
112862008-05-05 Ian Lance Taylor <iant@google.com>
11287
d98bc257
ILT
11288 * options.h (DEFINE_bool): For DASH_Z, create the negative option
11289 as noVARNAME rather than no-VARNAME.
11290 (class General_options): Add option -z combreloc.
11291 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
11292 get_address.
11293 (Output_reloc::sort_before) [SHT_REL]: New function.
11294 (Output_reloc::sort_before) [SHT_RELA]: New function.
11295 (class Output_data_reloc_base): Add sort_relocs_ field. Define
11296 Sort_relocs_comparison.
11297 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
11298 parameter. Change all callers.
11299 (Output_data_reloc::Output_data_reloc) [both versions]: Add
11300 sort_relocs parameter. Change all callers.
11301 * output.cc (Output_reloc::get_address): New function, broken out
11302 of write_rel.
11303 (Output_reloc::write_rel): Call it.
11304 (Output_reloc::compare): New function.
11305 (Output_data_reloc_base::do_write): Optionally sort relocs.
11306
60b2b4e7
ILT
11307 * configure.ac: If targ_extra_obj is set, link it in.
11308 * configure.tgt: Initialize all variables.
11309 (x86_64*): Set targ_extra_obj and targ_extra_size.
11310 * configure: Rebuild.
11311
8825ac63
ILT
11312 * object.cc (Sized_relobj::include_section_group): Adjust section
11313 indexes read from group data. Build vector to pass to
11314 layout_group.
11315 * layout.cc (Layout::layout_group): Add flags and shndxes
11316 parameters. Remove contents parameter. Change caller. Update
11317 explicit instantiations.
11318 * layout.h (class Layout): Update layout_group declaration.
11319 * output.cc (Output_data_group::Output_data_group): Add flags and
11320 input_shndxes parameters. Remove contents parameter. Change
11321 caller.
11322 (Output_data_group::do_write): Change input_sections_ to
11323 input_shndxes_.
11324 * output.h (class Output_data_group): Update constructor
11325 declaration. Rename input_sections_ to input_shndxes_.
11326 * testsuite/many_sections_test.cc: Add template.
11327
e94cf127
CC
113282008-04-30 Cary Coutant <ccoutant@google.com>
11329
4418b2d5
CC
11330 * target-reloc.h (relocate_section): Fix dead-pointer bug.
11331
e94cf127
CC
11332 * layout.cc (Layout::include_section): Refactored check for debug
11333 info section.
11334 (Layout::add_comdat): Add new parameters. Change type
11335 of signature parameter. Add object and shndx to signatures table.
11336 (Layout::find_kept_object): New function.
11337 * layout.h: Include <cstring>.
11338 (Layout::is_debug_info_section): New function.
11339 (Layout::add_comdat): Add new parameters.
11340 (Layout::find_kept_object): New function.
11341 (Layout::Kept_section): New struct.
11342 (Layout::Signatures): Change type of map range.
11343 * object.cc (Relobj::output_section_address): New function.
11344 (Sized_relobj::include_section_group): Add new parameters. Change
11345 calls to Layout::add_comdat. Change to build table of kept comdat
11346 groups and table mapping discarded sections to kept sections.
11347 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
11348 (Sized_relobj::do_layout): Change calls to include_section_group and
11349 include_linkonce_section.
11350 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
11351 value to zero when section is discarded.
11352 (Sized_relobj::map_to_kept_section): New function.
11353 * object.h (Relobj::output_section_address): New function.
11354 (Relobj::Comdat_group): New type.
11355 (Relobj::find_comdat_group): New function.
11356 (Relobj::Comdat_group_table): New type.
11357 (Relobj::Kept_comdat_section): New type.
11358 (Relobj::Kept_comdat_section_table): New type.
11359 (Relobj::add_comdat_group): New function.
11360 (Relobj::set_kept_comdat_section): New function.
11361 (Relobj::get_kept_comdat_section): New function.
11362 (Relobj::comdat_groups_): New field.
11363 (Relobj::kept_comdat_sections_): New field.
11364 (Symbol_value::input_value): Update comment.
11365 (Sized_relobj::map_to_kept_section) New function.
11366 (Sized_relobj::include_linkonce_section): Add new parameter.
11367 * target-reloc.h (Comdat_behavior): New type.
11368 (get_comdat_behavior): New function.
11369 (relocate_section): Add code to map a discarded section to the
11370 corresponding kept section when applying a relocation.
11371
e4e5049b
CS
113722008-04-30 Craig Silverstein <csilvers@google.com>
11373
11374 * dwarf_reader.cc (next_generation_count): New static var.
11375 (Addr2line_cache_entry): New struct.
11376 (addr2line_cache): New static var.
11377 (Dwarf_line_info::one_addr2line): Added caching.
11378 (Dwarf_line_info::clear_addr2line_cache): New function.
11379 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
11380 cache-size parameter.
11381 (Dwarf_line_info::one_addr2line_cache): New function.
11382 * symtab.cc (Symbol_table::detect_odr_violations): Pass
11383 new cache-size argument to one_addr2line(), and clear cache.
11384
d09e9154
CC
113852008-04-28 Cary Coutant <ccoutant@google.com>
11386
11387 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
11388 R_386_PC8 relocations.
11389
7ef73768
ILT
113902008-04-23 Ian Lance Taylor <iant@google.com>
11391
55438702
ILT
11392 * object.cc (Sized_relobj::include_section_group): Check for
11393 invalid section group.
11394
c165fb93
ILT
11395 * object.cc (make_elf_object): Correct test for 64-bit ELF file
11396 header size.
11397
7ef73768
ILT
11398 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
11399 than read for file header.
11400 * archive.cc (Archive::include_member): Likewise.
11401
6194aaab
L
114022008-04-23 Paolo Bonzini <bonzini@gnu.org>
11403
11404 * aclocal.m4: Regenerate.
11405 * configure: Regenerate.
11406
d491d34e
ILT
114072008-04-19 Ian Lance Taylor <iant@google.com>
11408
5ea2bac6
ILT
11409 * version.cc (version_string): Bump to 1.6.
11410
7bc3e21a
ILT
11411 * testsuite/Makefile.am (many_sections_r_test): New target.
11412 (many_sections_r_test_SOURCES): Remove.
11413 (many_sections_r_test_DEPENDENCIES): Remove.
11414 (many_sections_r_test_LDFLAGS): Remove.
11415 (many_sections_r_test_LDADD): Remove.
11416
7fcd3aa9
ILT
11417 * object.cc (Sized_relobj::do_add_symbols): Always pass
11418 local_symbol_count_ to add_from_relobj.
11419
4c94d6ae
ILT
11420 * testsuite/Makefile.am (many_sections_check.h): Only check one in
11421 every thousand variables.
11422 * testsuite/Makefile.in: Rebuild.
11423
d491d34e
ILT
11424 * object.cc (Xindex::initialize_symtab_xindex): New function.
11425 (Xindex::read_symtab_xindex): New function.
11426 (Xindex::sym_xindex_to_shndx): New function.
11427 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
11428 available.
11429 (Sized_relobj::do_initialize_xindex): New function.
11430 (Sized_relobj::do_read_symbols): Adjust section links.
11431 (Sized_relobj::symbol_section_and_value): Add is_ordinary
11432 parameter. Change all callers.
11433 (Sized_relobj::include_section_group): Adjust section links and
11434 symbol section indexes.
11435 (Sized_relobj::do_layout): Adjust section links.
11436 (Sized_relobj::do_count_local_symbols): Adjust section links and
11437 symbol section indexes.
11438 (Sized_relobj::do_finalize_local_symbols): Distinguish between
11439 ordinary and special symbols.
11440 (Sized_relobj::write_local_symbols): Add symtab_xindex and
11441 dynsym_xindex parameters. Change all callers. Adjust section
11442 links. Use SHN_XINDEX when needed.
11443 (Sized_relobj::get_symbol_location_info): Adjust section links.
11444 Don't get fooled by special symbols.
11445 * object.h (class Xindex): Define.
11446 (class Object): Add xindex_ parameter. Declare virtual functoin
11447 do_initialize_xindex.
11448 (Object::adjust_sym_shndx): New function.
11449 (Object::set_xindex): New protected function.
11450 (class Symbol_value): Add is_ordinary_shndx_ field.
11451 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
11452 (Symbol_value::value): Assert ordinary section.
11453 (Symbol_value::initialize_input_to_output_map): Likewise.
11454 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
11455 Change all callers.
11456 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
11457 all callers.
11458 (class Sized_relobj): Update declarations.
11459 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
11460 parameter. Change all callers.
11461 (Sized_relobj::adjust_shndx): New function.
11462 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
11463 field.
11464 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
11465 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
11466 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
11467 (Sized_dynobj::read_dynsym_section): Adjust section links.
11468 (Sized_dynobj::read_dynamic): Likewise.
11469 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
11470 section links.
11471 (Sized_dynobj::do_initialize_xindex): New function.
11472 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
11473 do_initialize_xindex.
11474 (Sized_dynobj::adjust_shndx): New function.
11475 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
11476 dynsym_xindex_ fields.
11477 (Layout::finalize): Add a call to set_section_indexes before
11478 creating the symtab sections.
11479 (Layout::set_section_indexes): Don't do anything if the section
11480 already has a section index.
11481 (Layout::create_symtab_sections): Add shnum parameter. Change
11482 caller. Create .symtab_shndx section if needed.
11483 (Layout::create_shdrs): Add shstrtab_section parameter. Change
11484 caller.
11485 (Layout::allocated_output_section_count): New function.
11486 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
11487 needed.
11488 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
11489 fields. Update declarations.
11490 (Layout::symtab_xindex): New function.
11491 (Layout::dynsym_xindex): New function.
11492 (class Write_symbols_task): Add layout_ field.
11493 (Write_symbols_task::Write_symbols_task): Add layout parameter.
11494 Change caller.
11495 * output.cc (Output_section_headers::Output_section_headers): Add
11496 shstrtab_section parameter. Change all callers.
11497 (Output_section_headers::do_sized_write): Store overflow values
11498 for section count and section string table section index in
11499 section header zero.
11500 (Output_file_header::do_sized_write): Check for overflow of
11501 section count and section string table section index.
11502 (Output_symtab_xindex::do_write): New function.
11503 (Output_symtab_xindex::endian_do_write): New function.
11504 * output.h (class Output_section_headers): Add shstrtab_section_.
11505 Update declarations.
11506 (class Output_symtab_xindex): Define.
11507 (Output_section::has_out_shndx): New function.
11508 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
11509 field.
11510 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
11511 Change all callers.
11512 (Sized_symbol::init): Likewise.
11513 (Symbol::output_section): Check for ordinary symbol.
11514 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
11515 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
11516 callers.
11517 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
11518 Change all callers. Simplify handling of symbols from sections
11519 not included in the link.
11520 (Symbol_table::add_from_dynobj): Handle ordinary symbol
11521 distinction.
11522 (Weak_alias_sorter::operator()): Assert that symbols are
11523 ordinary.
11524 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
11525 distinction.
11526 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
11527 parameters. Change all callers.
11528 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
11529 symbol distinction. Use SHN_XINDEX when needed.
11530 (Symbol_table::write_section_symbol): Add symtab_xindex
11531 parameter. Change all callers.
11532 (Symbol_table::sized_write_section_symbol): Likewise. Use
11533 SHN_XINDEX when needed.
11534 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
11535 declarations.
11536 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
11537 (Symbol::is_defined): Check is_ordinary.
11538 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
11539 (Symbol::is_absolute, Symbol::is_common): Likewise.
11540 (class Sized_symbol): Update declarations.
11541 (class Symbol_table): Update declarations.
11542 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
11543 parameters. Change all callers.
11544 (Sized_symbol::override): Likewise.
11545 (Symbol_table::override): Likewise.
11546 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
11547 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
11548 is_ordinary, and orig_st_shndx parameters. Change all callers.
11549 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
11550 to be in an ordinary section.
11551 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
11552 object and is_ordinary parameters. Change all callers.
11553 (Sized_dwarf_line_info::read_relocs): Add object parameter.
11554 Change all callers. Don't add undefined or non-ordinary symbols
11555 to reloc_map_.
11556 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
11557 Change all callers.
11558 * dwarf_reader.h (class Sized_dwarf_line_info): Update
11559 declarations.
11560 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
11561 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
11562 (Sized_relobj::relocate_sections): Likewise.
11563 * target-reloc.h (scan_relocs): Adjust section symbol index.
11564 (scan_relocatable_relocs): Likewise.
11565 * i386.cc (Scan::local): Check for ordinary symbols.
11566 * sparc.cc (Scan::local): Likewise.
11567 * x86_64.cc (Scan::local): Likewise.
11568 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
11569 to symbol_section_and_value.
11570 * testsuite/many_sections_test.cc: New file.
11571 * testsuite/Makefile.am (BUILT_SOURCES): Define.
11572 (check_PROGRAMS): Add many_sections_test.
11573 (many_sections_test_SOURCES): Define.
11574 (many_sections_test_DEPENDENCIES): Define.
11575 (many_sections_test_LDFLAGS): Define.
11576 (BUILT_SOURCES): Add many_sections_define.h.
11577 (many_sections_define.h): New target.
11578 (BUILT_SOURCES): Add many_sections_check.h.
11579 (many_sections_check.h): New target.
11580 (check_PROGRAMS): Add many_sections_r_test.
11581 (many_sections_r_test_SOURCES): Define.
11582 (many_sections_r_test_DEPENDENCIES): Define.
11583 (many_sections_r_test_LDFLAGS): Define.
11584 (many_sections_r_test_LDADD): Define.
11585 (many_sections_r_test.o): New target.
11586 * testsuite/Makefile.in: Rebuild.
11587
c5818ff1
CC
115882008-04-17 Cary Coutant <ccoutant@google.com>
11589
11590 * errors.cc (Errors::info): New function.
11591 (gold_info): New function.
11592 * errors.h (Errors::info): New function.
11593 * gold.h (gold_info): New function.
11594 * object.cc (Input_objects::add_object): Print trace output.
11595 * options.cc (options::parse_set): New function.
11596 (General_options::parse_wrap): Deleted.
11597 (General_options::General_options): Deleted initializer.
11598 * options.h (options::String_set): New typedef.
11599 (options::parse_set): New function.
11600 (DEFINE_set): New macro.
11601 (General_options::wrap): Changed to use DEFINE_set. Changed
11602 callers of any_wrap_symbols and is_wrap_symbol.
11603 (General_options::trace, General_options::trace_symbol):
11604 New options.
11605 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
11606 (General_options::wrap_symbols_): Deleted.
11607 * symtab.cc (Symbol_table::add_from_object): Print trace output.
11608
b5be4a7c
DM
116092008-04-17 David S. Miller <davem@davemloft.net>
11610
11611 * options.cc (General_options::parse_V): New function.
11612 * options.h: Add entries for -V and -Qy.
11613
155a0dd7
ILT
116142008-04-17 Ian Lance Taylor <iant@google.com>
11615
11616 * common.cc (Symbol_table::allocate_commons): Remove options
11617 parameter. Change caller.
11618 (Symbol_table::do_allocate_commons): Remove options parameter.
11619 Change caller. Just call do_allocate_commons_list twice.
11620 (Symbol_table::do_allocate_commons_list): New function, broken out
11621 of do_allocate_commons.
11622 * common.h (class Allocate_commons_task): Remove options_ field.
11623 Update constructor.
11624 * symtab.cc (Symbol_table::Symbol_table): Initialize
11625 tls_commons_.
11626 (Symbol_table::add_from_object): Put TLS common symbols on
11627 tls_commons_ list.
11628 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
11629 which are IN_OUTPUT_DATA.
11630 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
11631 allocate_commons and do_allocate_commons declarations. Declare
11632 do_allocate_commons_list.
11633 * gold.cc (queue_middle_tasks): Update creation of
11634 Allocate_commons_task to not pass options.
11635 * testsuite/Makefile.am (INCLUDES): Add -I.. .
11636 (TLS_TEST_C_FLAGS): New variable.
11637 (tls_test_c_pic.o): New target.
11638 (tls_test_shared.so): Link in tls_test_c_pic.o.
11639 (tls_test_c_pic_ie.o): New target.
11640 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
11641 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
11642 (tls_test_c.o): New target.
11643 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
11644 (tls_pic_test_LDADD): Likewise.
11645 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
11646 (tls_shared_gd_to_ie_test_LDADD): Likewise.
11647 (tls_test_c_gnu2.o): New target.
11648 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
11649 tls_test_c_gnu2.o.
11650 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
11651 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
11652 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
11653 * testsuite/tls_test.cc: Include "config.h".
11654 (t_last): Call t11_last.
11655 * testsuite/tls_test.h (t11, t11_last): Declare.
11656 * testsuite/tls_test_c.c: New file.
11657 * testsuite/tls_test_main.cc (thread_routine): Call t11.
11658 * configure.ac: Check for OpenMP support.
11659 * configure, config.in, Makefile.in: Rebuild.
11660 * testsuite/Makefile.in: Rebuild.
11661
edfbb029
CC
116622008-04-16 Cary Coutant <ccoutant@google.com>
11663
11664 * i386.cc (Target_i386::define_tls_base_symbol): New function.
11665 (Target_i386::tls_base_symbol_defined_): New field.
11666 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
11667 (Target_i386::Scan::global): Likewise.
11668 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
11669 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
11670 (Target_x86_64::tls_base_symbol_defined_): New field.
11671 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
11672 (Target_x86_64::Scan::global): Likewise.
11673
f3c69fca
CC
116742008-04-16 Cary Coutant <ccoutant@google.com>
11675
11676 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
11677 (Symbol::needs_plt_entry): Allow weak undefined symbols.
11678 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
11679 building shared libraries.
11680 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
11681 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
11682 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
11683 * testsuite/Makefile.in: Rebuild.
11684 * testsuite/weak_undef.h: New file.
11685 * testsuite/weak_undef_file1.cc: Add extra test cases.
11686 * testsuite/weak_undef_file2.cc: Likewise.
11687 * testsuite/weak_undef_test.cc: Likewise.
11688
7c414435
DM
116892008-04-16 David S. Miller <davem@davemloft.net>
11690
32b769e1
DM
11691 * sparc.cc (Target_sparc::Scan): Change from struct to class.
11692 Add issued_non_pic_error_ field. Declare check_non_pic.
11693 (Target_sparc::Scan::check_non_pic): New function.
11694 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
11695 (Target_sparc::Scan::global): Likewise.
11696
11936fb1
DM
11697 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
11698 * configure: Rebuild.
11699
7c414435
DM
11700 * options.h (DEFINE_enable): New macro.
11701 (new_dtags): New enable option.
11702 (initfirst, interpose, loadfltr, nodefaultlib,
11703 nodelete, nodlopen, nodump): New -z options.
11704 * layout.cc (Layout:finish_dynamic_section): If new
11705 dtags enabled, emit DT_RUNPATH. Also, emit a
11706 DT_FLAGS_1 containing any specified -z flags.
11707
85c7bf8b
ILT
117082008-04-16 Ian Lance Taylor <iant@google.com>
11709
12c0daef
ILT
11710 * copy-relocs.cc: New file.
11711 * copy-relocs.h: New file.
11712 * reloc.cc: Remove Copy_relocs code.
11713 * reloc.h: Likewise.
11714 * reloc-types.h (struct Reloc_types) [both versions]: Add
11715 get_reloc_addend_noerror.
11716 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
11717 variants of add_global which take an addend which must be zero.
11718 * i386.cc: Include "copy-relocs.h".
11719 (class Target_i386): Change type of copy_relocs_ to variable,
11720 update initializer.
11721 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
11722 Change all callers.
11723 (Target_i386::do_finalize_sections): Change handling of
11724 copy_relocs_.
11725 * sparc.cc: Include "copy-relocs.h".
11726 (class Target_sparc): Change type of copy_relocs_ to variable,
11727 update initializer.
11728 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
11729 Change all callers.
11730 (Target_sparc::do_finalize_sections): Change handling of
11731 copy_relocs_.
11732 * x86_64.cc: Include "copy-relocs.h".
11733 (class Target_x86_64): Change type of copy_relocs_ to variable,
11734 update initializer.
11735 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
11736 class. Change all callers.
11737 (Target_x86_64::do_finalize_sections): Change handling of
11738 copy_relocs_.
11739 * Makefile.am (CCFILES): Add copy-relocs.cc.
11740 (HFILES): Add copy-relocs.h.
11741
4f4995b6
ILT
11742 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
11743
85c7bf8b
ILT
11744 * testsuite/script_test_4.sh: Permit leading zeroes.
11745
4f2a9edd
ILT
117462008-04-15 Ian Lance Taylor <iant@google.com>
11747
e6188289
ILT
11748 * script-sections.cc (Script_sections::create_segments): Use
11749 header_size_adjustment even when there is enough room for the
11750 headers.
11751 * testsuite/script_test_4.sh: New file.
11752 * testsuite/script_test_4.t: New file.
11753 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
11754 (check_DATA): Add script_test_4.stdout.
11755 (MOSTLYCLEANFILES): Likewise.
11756 (script_test_4): New target.
11757 (script_test_4.stdout): New target.
11758 * testsuite/Makefile.in: Rebuild.
11759
4f2a9edd
ILT
11760 * sparc.cc: Add definitions for Output_data_plt_sparc class
11761 constants.
11762
f5314dd5
DM
117632008-04-14 David S. Miller <davem@davemloft.net>
11764
11765 * sparc.cc: New file.
11766 * Makefile.am (TARGETSOURCES): Add sparc.cc
11767 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
11768 * configure.tgt: Document targ_extra_size and
11769 targ_extra_big_endian. Add entries for sparc-* and
11770 sparc64-*.
11771 * configure.ac: Handle targ_extra_size and
11772 targ_extra_big_endian.
11773 * Makefile.in: Rebuild.
11774 * configure: Likewise.
11775 * po/POTFILES.in: Likewise.
11776 * po/gold.pot: Likewise.
11777
154e0e9a
ILT
117782008-04-14 Ian Lance Taylor <iant@google.com>
11779
11780 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
11781 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
11782 in the name/type/flags to section mapping. Don't call
11783 allocate_output_section.
11784 (Layout::choose_output_section): Change parameter from adjust_name
11785 to is_input_section. Don't permit input sections after sections
11786 are attached to segments. Don't call allocate_output_section.
11787 (Layout::layout_eh_frame): Call update_flags_for_input_section,
11788 not write_enable_output_section.
11789 (Layout::make_output_section): Don't push to
11790 unattached_section_list_ nor call attach_to_segment. Call
11791 attach_section_to_segment if sections are attached.
11792 (Layout::attach_sections_to_segments): New function.
11793 (Layout::attach_section_to_segment): New function.
11794 (Layout::attach_allocated_section_to_segment): Rename from
11795 attach_to_segment. Remove flags parameter.
11796 (Layout::allocate_output_section): Remove function.
11797 (Layout::write_enable_output_section): Remove function.
11798 * layout.h (class Layout): Update for above changes. Add new
11799 field sections_are_attached_.
11800 * output.h (Output_section::update_flags_for_input_section): New
11801 function.
11802 * output.cc (Output_section::add_input_section): Call
11803 update_flags_for_input_section.
11804 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
11805
009a67a2
CC
118062008-04-11 Cary Coutant <ccoutant@google.com>
11807
11808 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
11809 thought unnecessary.
11810 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
11811
759b1a24
ILT
118122008-04-11 Ian Lance Taylor <iant@google.com>
11813
11814 * output.h (class Output_section_data): Remove inline definition
11815 of set_addralign.
11816 * output.cc (Output_section_data::set_addralign): New function.
11817
c2b45e22
CC
118182008-04-11 Cary Coutant <ccoutant@google.com>
11819
11820 Add support for TLS descriptors for i386 and x86_64.
11821 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
11822 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
11823 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
11824 GOT_TYPE_TLS_DESC.
11825 (Target_i386::got_mod_index_entry): Remove unnecessary code.
11826 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
11827 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
11828 relocations.
11829 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
11830 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
11831 Fix problem with initial-exec relocations.
11832 (Target_i386::Relocate::relocate_tls): Likewise.
11833 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
11834 relaxation.
11835 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
11836 support for section-plus-offset dynamic table entries.
11837 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
11838 (Output_data_dynamic::Dynamic_entry): Add support for
11839 section-plus-offset dynamic table entries.
11840 (Output_data_dynamic::Classification): Likewise.
11841 (Output_data_dynamic::classification_): Renamed offset_.
11842 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
11843 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
11844 (Target_x86_64::make_plt_section): New function.
11845 (Target_x86_64::reserve_tlsdesc_entries): New function.
11846 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
11847 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
11848 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
11849 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
11850 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
11851 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
11852 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
11853 add extra PLT entry for TLS descriptors.
11854 (Output_data_plt_x86_64::got_): New field.
11855 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
11856 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
11857 fields.
11858 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
11859 descriptors.
11860 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
11861 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
11862 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
11863 R_386_TLS_DESC_CALL relocations.
11864 (Target_x86_64::Scan::global): Likewise.
11865 (Target_x86_64::do_finalize_sections): Add dynamic table entries
11866 for TLS descriptors.
11867 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
11868 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
11869 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
11870 GD-to-IE relaxation.
11871 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
11872 and TLS_DESCRIPTORS.
11873 * Makefile.in: Rebuild.
11874 * configure: Rebuild.
11875 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
11876 (tls_test_shared2.so): New target.
11877 (tls_shared_gd_to_ie_test_SOURCES): New variable.
11878 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
11879 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
11880 (tls_shared_gd_to_ie_test_LDADD): New variable.
11881 (tls_shared_gnu2_gd_to_ie_test): New target.
11882 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
11883 New targets.
11884 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
11885 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
11886 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
11887 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
11888 (tls_shared_gnu2_test): New target.
11889 (tls_test_gnu2_shared.so): New target.
11890 (tls_shared_gnu2_test_SOURCES): New variable.
11891 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
11892 (tls_shared_gnu2_test_LDFLAGS): New variable.
11893 (tls_shared_gnu2_test_LDADD): New variable.
11894 * testsuite/Makefile.in: Rebuild.
11895 * testsuite/Makefile.
11896
83bfb6b7
ILT
118972008-04-11 Ian Lance Taylor <iant@google.com>
11898
11899 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
11900 justsyms.t.
11901 * testsuite/Makefile.in: Rebuild.
11902
11903 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
11904 long.
11905 * testsuite/script_test_2.cc (main): Adjust test.
11906
706e1f5e
ILT
119072008-04-11 David S. Miller <davem@davemloft.net>
11908 Ian Lance Taylor <iant@google.com>
11909
11910 * options.h (General_options): Add entries for '-Y' and
11911 '-relax'.
11912 * options.cc (General_options:finalize): If -Y was used, add those
11913 entries to the library path instead of the default "/lib" and
11914 "/usr/lib".
11915
7c98e6bb
DM
119162008-04-11 David S. Miller <davem@davemloft.net>
11917
11918 * testsuite/justsyms.t: Start at 0x100.
11919 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
11920 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
11921 long.
11922 * testsuite/script_test_2.cc: Adjust string and section length
11923 checks.
7c98e6bb 11924
99a37bfd
ILT
119252008-04-09 Ian Lance Taylor <iant@google.com>
11926
2cefc357
ILT
11927 PR gold/5996
11928 * script-sections.cc (Sections_element::allocate_to_segment): Add
11929 orphan parameter.
11930 (Output_section_definition::allocate_to_segment): Likewise.
11931 (Orphan_output_section::allocate_to_segment): Likewise.
11932 (Script_sections::attach_sections_using_phdrs_clause): Don't
11933 propagate non-PT_LOAD segments to orphan sections.
11934 * testsuite/Makefile.am (script_test_3.stdout): Generate using
11935 readelf rather than objdump.
11936 * testsuite/script_test_3.sh: Adjust accordingly. Test that
11937 .interp section and PT_INTERP segment are the same size.
11938 * testsuite/Makefile.in: Rebuild.
11939
99a37bfd
ILT
11940 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
11941 aliases for symbols defined in the same object.
11942 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
11943 (weak_alias_test_SOURCES): New variable.
11944 (weak_alias_test_DEPENDENCIES): New variable.
11945 (weak_alias_test_LDFLAGS): New variable.
11946 (weak_alias_test_LDADD): New variable.
11947 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
11948 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
11949 (weak_alias_test_3.o): New target.
11950 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
11951 * testsuite/weak_alias_test_main.cc: New file.
11952 * testsuite/weak_alias_test_1.cc: New file.
11953 * testsuite/weak_alias_test_2.cc: New file.
11954 * testsuite/weak_alias_test_3.cc: New file.
11955
780e49c5
ILT
119562008-04-08 Ian Lance Taylor <iant@google.com>
11957
cdb0b8f5
ILT
11958 * options.h (class General_options): Add --noinhibit-exec option.
11959 * main.cc (main): Check --noinhibit-exec.
11960
0864d551
ILT
11961 * options.h (class General_options): Define --wrap as a special
11962 option. Add wrap_symbols_ field.
11963 (General_options::any_wrap_symbols): New function.
11964 (General_options::is_wrap_symbol): New function.
11965 * options.cc (General_options::parse_wrap): New function.
11966 (General_options::General_options): Initialize wrap_symbols_.
11967 * symtab.cc (Symbol_table::wrap_symbol): New function.
11968 (Symbol_table::add_from_object): Handle --wrap.
11969 * symtab.h (class Symbol_table): Declare wrap_symbol.
11970 * target.h (Target::wrap_char): New function.
11971 (Target::Target_info): Add wrap_char field.
11972 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
11973 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
11974 * testsuite/testfile.cc (Target_test::test_target_info):
11975 Likewise.
11976
789aa6de
ILT
11977 * errors.cc (Errors::undefined_symbol): Mention symbol version if
11978 there is one.
11979
2c38906f
ILT
11980 * layout.h (class Layout): Add added_eh_frame_data_ field.
11981 * layout.cc (Layout::Layout): Initialize new field.
11982 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
11983 output section until we find a section we merged successfully.
11984 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
11985 that the size be non-zero.
11986
780e49c5
ILT
11987 * merge.cc (Object_merge_map::get_output_offset): Remove inline
11988 qualifier.
11989
7fcd0256
ILT
119902008-04-08 Craig Silverstein <csilvers@google.com>
11991
11992 * configure.ac: Export new conditional variable HAVE_ZLIB.
11993 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
11994 on HAVE_ZLIB.
11995 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
11996 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
11997
6835af53
ILT
119982008-04-07 Ian Lance Taylor <iant@google.com>
11999
e24f324c
ILT
12000 * version.cc (version_string): Set to "1.5".
12001
a036edd8
ILT
12002 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
12003 Add issued_non_pic_error_ field. Declare check_non_pic.
12004 (Target_x86_64::Scan::check_non_pic): New function.
12005 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
12006 (Target_x86_64::Scan::global): Likewise.
12007
624f8810
ILT
12008 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
12009 addend parameter. Change caller. Handle merge sections.
12010 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
12011 Address to Addend. Don't add in the result of
12012 local_section_offset, pass down the addend and use the returned
12013 value.
12014 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
12015 Update declarations of local_section_offset and symbol_value.
12016 * testsuite/two_file_test_1.cc (t18): New function.
12017 * testsuite/two_file_test_2.cc (f18): New function.
12018 * testsuite/two_file_test_main.cc (main): Call t18.
12019 * testsuite/two_file_test.h (t18, f18): Declare.
12020
6835af53
ILT
12021 * configure.ac: Don't test for objdump, c++filt, or readelf.
12022 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
12023 conditionals.
12024 (TEST_READELF): New variable.
12025 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
12026 (check_PROGRAMS): Add two_file_strip_test.
12027 (two_file_strip_test): New target.
12028 (check_PROGRAMS): Add two_file_same_shared_strip_test.
12029 (two_file_same_shared_strip_test_SOURCES): New variable.
12030 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
12031 (two_file_same_shared_strip_test_LDFLAGS): New variable.
12032 (two_file_same_shared_strip_test_LDADD): New variable.
12033 (two_file_shared_strip.so): New target.
12034 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
12035 (ver_test_5.syms, ver_test_7.syms): Likewise.
12036 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
12037 (strip_test_3.stdout): Use TEST_OBJDUMP.
12038 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12039
86925eef
CC
120402008-04-04 Cary Coutant <ccoutant@google.com>
12041
12042 * symtab.h (Symbol::is_weak_undefined): New function.
12043 (Symbol::is_strong_undefined): New function.
12044 (Symbol::is_absolute): New function.
12045 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
12046 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
12047 absolute symbols.
12048 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
12049 (weak_undef_test): New target.
12050 * testsuite/Makefile.in: Rebuild.
12051 * testsuite/weak_undef_file1.cc: New file.
12052 * testsuite/weak_undef_file2.cc: New file.
12053 * testsuite/weak_undef_test.cc: New file.
12054
126f3ece
ILT
120552008-04-03 Craig Silverstein <csilvers@google.com>
12056
12057 * compressed_output.h (class Output_compressed_section): Use
12058 unsigned buffer.
12059 * compressed_output.cc (zlib_compress): Use unsigned buffers,
12060 add zlib header.
12061 (zlib_compressed_suffix): Removed.
12062 (Output_compressed_section::set_final_data_size): Use unsigned
12063 buffers.
12064 * testsuite/Makefile.am (flagstest_compress_debug_sections):
12065 Fix linker invocation.
12066 (flagstest_o_specialfile_and_compress_debug_sections):
12067 Likewise.
12068 * testsuite/Makefile.in: Regenerated.
12069
deae2a14
DM
120702008-04-02 David S. Miller <davem@davemloft.net>
12071
12072 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
12073 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
12074
70752818
ILT
120752008-04-02 Craig Silverstein <csilvers@google.com>
12076
12077 * TODO: New file.
12078
39d0cb0e
ILT
120792008-04-02 Ian Lance Taylor <iant@google.com>
12080
12081 * fileread.cc (File_read::find_view): Add byteshift and vshifted
12082 parameters. Update for new key type to views_. Change all
12083 callers.
12084 (File_read::read): Adjust for byteshift in returned view.
12085 (File_read::add_view): New function, broken out of
12086 find_and_make_view.
12087 (File_read::make_view): New function, broken out of
12088 find_and_make_view.
12089 (File_read::find_or_make_view): Add offset and aligned
12090 parameters. Rewrite accordingly. Change all callers.
12091 (File_read::get_view): Add offset and aligned parameters. Adjust
12092 for byteshift in return value.
12093 (File_read::get_lasting_view): Likewise.
12094 * fileread.h (class File_read): Update declarations.
12095 (class File_read::View): Add byteshift_ field. Add byteshift to
12096 constructor. Add byteshift method.
12097 * archive.h (Archive::clear_uncached_views): New function.
12098 (Archive::get_view): Add aligned parameter. Change all callers.
12099 * object.h (Object::get_view): Add aligned parameter. Change all
12100 callers.
12101 (Object::get_lasting_view): Likewise.
12102
12103 * fileread.cc (File_read::release): Don't call clear_views if
12104 there are multiple objects.
12105 * fileread.h (File_read::clear_uncached_views): New function.
12106 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
12107 on the archive.
12108
a1207466
CC
121092008-03-31 Cary Coutant <ccoutant@google.com>
12110
12111 Add thin archive support.
12112 * archive.cc (Archive::armagt): New const.
12113 (Archive::setup): Remove task parameter and calls to unlock.
12114 (Archive::unlock_nested_archives): New function.
12115 (Archive::read_header): Add nested_off parameter. Change
12116 all callers.
12117 (Archive::interpret_header): Likewise.
12118 (Archive::include_all_members): Change to handle thin
12119 archives.
12120 (Archive::include_member): Likewise.
12121 * archive.h (Archive::Archive): Add new parameters and
12122 initializers.
12123 (Archive::armagt): New const.
12124 (Archive::setup): Remove task parameter.
12125 (Archive::unlock_nested_archives): New function.
12126 (Archive::read_header): Add nested_off parameter.
12127 (Archive::interpret_header): Likewise.
12128 (Archive::Nested_archive_table): New typedef.
12129 (Archive::is_thin_archive_): New field.
12130 (Archive::nested_archives_): New field.
12131 (Archive::options_): New field.
12132 (Archive::dirpath_): New field.
12133 (Archive::task_): New field.
12134 * readsyms.cc (Read_symbols::do_read_symbols): Add check
12135 for thin archives. Pass additional parameters to
12136 Archive::Archive. Unlock the archive file after calling
12137 Archive::setup.
cd536b21 12138
479f6503
ILT
121392008-03-29 Ian Lance Taylor <iant@google.com>
12140
686c8caf
ILT
12141 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
12142 version symbol to be local.
12143 * testsuite/ver_test_4.sh: New file.
12144 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
12145 (check_DATA): Add ver_test_4.syms.
12146 (ver_test_4.syms): New target.
12147 * testsuite/Makefile.in: Rebuild.
12148
ab794b6b
ILT
12149 * output.cc
12150 (Output_section::Input_section_sort_entry::has_priority): New
12151 function.
12152 (Output_section::Input_section_sort_entry::match_file_name): New
12153 function.
12154 (Output_section::Input_section_sort_entry::match_section_name):
12155 Remove.
12156 (Output_section::Input_section_sort_entry::match_section_name_prefix):
12157 Remove.
12158 (Output_section::Input_section_sort_entry::match_section_file):
12159 Remove.
12160 (Output_section::Input_section_sort_compare::operator()): Rewrite
12161 using new Input_section_sort_entry functions. Sort crtbegin and
12162 crtend first. Sort sections with no priority before sections with
12163 a priority.
12164 * testsuite/initpri1.c (d3): Check j != 4.
12165 (cd5): New constructor/destructor function.
12166 (main): Check j != 2.
12167
479f6503
ILT
12168 * symtab.cc (Symbol_table::add_from_object): If we don't use the
12169 new symbol when resolving, don't call set_is_default.
12170 * testsuite/ver_test_7.cc: New file.
12171 * testsuite/ver_test_7.sh: New file.
12172 * testsuite/Makefile.am (ver_test_7.so): New target.
12173 (ver_test_7.o): New target.
12174 (check_SCRIPTS): Add ver_test_7.sh.
12175 (check_DATA): Add ver_test_7.syms.
12176 (ver_test_7.syms): New target.
12177
2fd32231
ILT
121782008-03-28 Ian Lance Taylor <iant@google.com>
12179
12180 * layout.cc (Layout::layout): If we see an input section with a
12181 name that needs sorting, set the must_sort flag for the output
12182 section.
12183 (Layout::make_output_section): If the name of the output section
12184 indicates that it might require sorting, set the may_sort flag.
12185 * output.h (Output_section::may_sort_attached_input_sections): New
12186 function.
12187 (Output_section::set_may_sort_attached_input_sections): New
12188 function.
12189 (Output_section::must_sort_attached_input_sections): New
12190 function.
12191 (Output_section::set_must_sort_attached_input_sections): New
12192 function.
12193 (class Output_section): Declare Input_section_sort_entry. Define
12194 Input_section_sort_compare. Declare
12195 sort_attached_input_sections. Add new fields:
12196 may_sort_attached_input_sections_,
12197 must_sort_attached_input_sections_,
12198 attached_input_sections_are_sorted_.
12199 * output.cc (Output_section::Output_section): Initialize new
12200 fields.
12201 (Output_section::add_input_section): Add an entry to
12202 input_sections_ if may_sort or must_sort are true.
12203 (Output_section::set_final_data_size): Call
12204 sort_attached_input_sections if necessary.
12205 (Output_section::Input_section_sort_entry): Define new class.
12206 (Output_section::Input_section_sort_compare::operator()): New
12207 function.
12208 (Output_section::sort_attached_input_sections): New function.
12209 * configure.ac: Check whether the compiler supports constructor
12210 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
12211 * testsuite/initpri1.c: New file.
12212 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
12213 CONSTRUCTOR_PRIORITY.
12214 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
12215 (initpri1_LDFLAGS): New variable.
12216 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12217
18e6b24e
ILT
122182008-03-27 Ian Lance Taylor <iant@google.com>
12219
49bdd526
ILT
12220 * common.cc (Sort_commons::operator): Correct sorting algorithm.
12221 * testsuite/common_test_1.c: New file.
12222 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
12223 (common_test_1_SOURCES): New variable.
12224 (common_test_1_DEPENDENCIES): New variable.
12225 (common_test_1_LDFLAGS): New variable.
12226
18e6b24e
ILT
12227 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
12228 and commons_ correctly when NAME/VERSION does not override
12229 NAME/NULL.
12230 * testsuite/ver_test_6.c: New file.
12231 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
12232 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
12233 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
12234
04bf7072
ILT
122352008-03-26 Ian Lance Taylor <iant@google.com>
12236
5871526f
ILT
12237 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
12238 of an undefined symbol from a version script.
12239 * testsuite/Makefile.am (ver_test_5.so): New target.
12240 (ver_test_5.o): New target.
12241 (check_SCRIPTS): Add ver_test_5.sh.
12242 (check_DATA): Add ver_test_5.syms.
12243 (ver_test_5.syms): New target.
12244 * testsuite/ver_test_5.cc: New file.
12245 * testsuite/ver_test_5.script: New file.
12246 * testsuite/ver_test_5.sh: New file.
12247 * Makefile.in, testsuite/Makefile.in: Rebuild.
12248
04bf7072
ILT
12249 PR gold/5986
12250 Fix problems building gold with gcc 4.3.0.
12251 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
12252 (gold_error_at_location, gold_warning_at_location): Use it.
12253 * configure.ac: Check whether we can compile and use a template
12254 function with a printf attribute.
12255 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
12256 when jumping over bytes.
12257 * object.cc: Instantiate Object::read_section_data.
12258 * debug.h: Include <cstring>
12259 * dwarf_reader.cc: Include <algorithm>
12260 * main.cc: Include <cstring>.
12261 * options.cc: Include <cstring>.
12262 * output.cc: Include <cstring>.
12263 * script.cc: Include <cstring>.
12264 * script.h: Include <string>.
12265 * symtab.cc: Include <cstring> and <algorithm>.
12266 * target-select.cc: Include <cstring>.
12267 * version.cc: Include <string>.
12268 * testsuite/testmain.cc: Include <cstdlib>.
12269 * configure, config.in: Rebuild.
12270
874c5b28
ILT
122712008-03-25 Ian Lance Taylor <iant@google.com>
12272
819d6c3a
ILT
12273 * options.cc: Include "../bfd/bfdver.h".
12274 (options::help): Print bug reporting address.
12275
f4b2c6f5
ILT
12276 * version.cc (print_version): Adjust output for current value of
12277 BFD_VERSION_STRING.
12278
12279 * NEWS: New file.
12280
e96caa79
ILT
12281 * options.cc (options::help): Print list of supported targets.
12282 * target-select.h: Include <vector>.
12283 (class Target_selector): Make machine_, size_, and is_big_endian_
12284 fields const. Add bfd_name_ and instantiated_target_ fields.
12285 (Target_selector::Target_selector): Add bfd_name parameter.
12286 (Target_selector::recognize): Make non-virtual, call
12287 do_recognize.
12288 (Target_selector::recognize_by_name): Make non-virtual, call
12289 do_recognize_by_name.
12290 (Target_selector::supported_names): New function.
12291 (Target_selector::bfd_name): New function.
12292 (Target_selector::do_instantiate_target): New pure virtual
12293 function.
12294 (Target_selector::do_recognize): New virtual function.
12295 (Target_selector::do_recognize_by_name): New virtual function.
12296 (Target_selector::instantiate_target): New private function.
12297 (supported_target_names): Declare.
12298 * target-select.cc (Target_selector::Target_selector): Update for
12299 new parameter and fields.
12300 (select_target_by_name): Check that the name matches before
12301 calling recognize_by_name.
12302 (supported_target_names): New function.
12303 * i386.cc (class Target_selector_i386): Update Target_selector
12304 constructor call. Remove recognize and recognize_by_name. Add
12305 do_instantiate_target.
12306 * x86_64.cc (class Target_selector_x86_64): Likewise.
12307 * testsuite/testfile.cc (class Target_selector_test): Update for
12308 changes to Target_selector.
12309
874c5b28
ILT
12310 * README: Rewrite, with some notes on unsupported features.
12311
0a65a3a7
CC
123122008-03-24 Cary Coutant <ccoutant@google.com>
12313
12314 * i386.cc (Target_i386::Got_type): New enum declaration.
12315 (Target_i386::Scan::local): Updated callers of Output_data_got
12316 member functions.
12317 (Target_i386::Scan::global): Likewise.
12318 (Target_i386::Relocate::relocate): Likewise.
12319 (Target_i386::Relocate::relocate_tls): Likewise.
12320 * object.h (Got_offset_list): New class.
12321 (Sized_relobj::local_has_got_offset): Added got_type parameter.
12322 (Sized_relobj::local_got_offset): Likewise.
12323 (Sized_relobj::set_local_got_offset): Likewise.
12324 (Sized_relobj::local_has_tls_got_offset): Removed.
12325 (Sized_relobj::local_tls_got_offset): Removed.
12326 (Sized_relobj::set_local_tls_got_offset): Removed.
12327 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
12328 * output.cc (Output_data_got::add_global): Added got_type parameter.
12329 (Output_data_got::add_global_with_rel): Likewise.
12330 (Output_data_got::add_global_with_rela): Likewise.
12331 (Output_data_got::add_global_pair_with_rel): New function.
12332 (Output_data_got::add_global_pair_with_rela): New function.
12333 (Output_data_got::add_local): Added got_type parameter.
12334 (Output_data_got::add_local_with_rel): Likewise.
12335 (Output_data_got::add_local_with_rela): Likewise.
12336 (Output_data_got::add_local_pair_with_rel): New function.
12337 (Output_data_got::add_local_pair_with_rela): New function.
12338 (Output_data_got::add_global_tls): Removed.
12339 (Output_data_got::add_global_tls_with_rel): Removed.
12340 (Output_data_got::add_global_tls_with_rela): Removed.
12341 (Output_data_got::add_local_tls): Removed.
12342 (Output_data_got::add_local_tls_with_rel): Removed.
12343 (Output_data_got::add_local_tls_with_rela): Removed.
12344 * output.h (Output_data_got::add_global): Added got_type parameter.
12345 (Output_data_got::add_global_with_rel): Likewise.
12346 (Output_data_got::add_global_with_rela): Likewise.
12347 (Output_data_got::add_global_pair_with_rel): New function.
12348 (Output_data_got::add_global_pair_with_rela): New function.
12349 (Output_data_got::add_local): Added got_type parameter.
12350 (Output_data_got::add_local_with_rel): Likewise.
12351 (Output_data_got::add_local_with_rela): Likewise.
12352 (Output_data_got::add_local_pair_with_rel): New function.
12353 (Output_data_got::add_local_pair_with_rela): New function.
12354 (Output_data_got::add_global_tls): Removed.
12355 (Output_data_got::add_global_tls_with_rel): Removed.
12356 (Output_data_got::add_global_tls_with_rela): Removed.
12357 (Output_data_got::add_local_tls): Removed.
12358 (Output_data_got::add_local_tls_with_rel): Removed.
12359 (Output_data_got::add_local_tls_with_rela): Removed.
12360 * resolve.cc (Symbol::override_base_with_special): Removed
12361 reference to has_got_offset_ field.
12362 * symtab.cc (Symbol::init_fields): Replaced initialization
12363 of got_offset_ with got_offsets_. Removed initialization
12364 of has_got_offset_
53fcba31 12365 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
12366 (Symbol::got_offset): Likewise.
12367 (Symbol::set_got_offset): Likewise.
12368 (Symbol::has_tls_got_offset): Removed.
12369 (Symbol::tls_got_offset): Removed.
12370 (Symbol::set_tls_got_offset): Removed.
12371 (Symbol::got_offset_): Removed.
12372 (Symbol::tls_mod_got_offset_): Removed.
12373 (Symbol::tls_pair_got_offset_): Removed.
12374 (Symbol::got_offsets_): New field.
12375 (Symbol::has_got_offset): Removed.
12376 (Symbol::has_tls_mod_got_offset): Removed.
12377 (Symbol::has_tls_pair_got_offset): Removed.
12378 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
12379 (Target_x86_64::Scan::local): Updated callers of Output_data_got
12380 member functions.
12381 (Target_x86_64::Scan::global): Likewise.
12382 (Target_x86_64::Relocate::relocate): Likewise.
12383 (Target_x86_64::Relocate::relocate_tls): Likewise.
12384
bd52eafb
BE
123852008-03-25 Ben Elliston <bje@au.ibm.com>
12386
12387 * yyscript.y: Fix spelling error in comment.
12388
8b105e34
ILT
123892008-03-24 Ian Lance Taylor <iant@google.com>
12390
8ed814a9
ILT
12391 * options.h (class General_options): Define build_id option.
12392 * layout.h (class Layout): Declare write_build_id, create_note,
12393 create_build_id. Add build_id_note_ member.
12394 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
12395 "libiberty.h", "md5.h", "sha1.h".
12396 (Layout::Layout): Initialize eh_frame_data_,
12397 eh_frame_hdr_section_, and build_id_note_.
12398 (Layout::finalize): Call create_build_id.
12399 (Layout::create_note): New function, broken out of
12400 Layout::create_gold_note.
12401 (Layout::create_gold_note): Call create_note.
12402 (Layout::create_build_id): New function.
12403 (Layout::write_build_id): New function.
12404 (Close_task_runner::run): Call write_build_id.
12405
8b105e34
ILT
12406 * x86_64.cc: Correct license to GPLv3.
12407
086a1841
ILT
124082008-03-23 Ian Lance Taylor <iant@google.com>
12409
12410 * options.cc: Include "demangle.h".
12411 (parse_optional_string): New function.
12412 (parse_long_option): Handle takes_optional_argument.
12413 (parse_short_option): Update dash_z initializer. Handle
12414 takes_optional_argument.
12415 (General_options::General_options): Initialize do_demangle_.
12416 (General_options::finalize): Set do_demangle_. Handle demangling
12417 style.
12418 * options.h (parse_optional_string): Declare.
12419 (struct One_option): Add optional_arg field. Update constructor.
12420 Update call constructor calls. Add takes_optional_argument
12421 function.
12422 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
12423 (DEFINE_optional_string): Define.
12424 (General_options::demangle): Change from DEFINE_bool to
12425 DEFINE_optional_string.
12426 (General_options::no_demangle): New function.
12427 (General_options::do_demangle): New function.
12428 (General_options::set_do_demangle): New function.
12429 (General_options::execstack_status_): Move definition to end of
12430 class definition.
12431 (General_options::static_): Likewise.
12432 (General_options::do_demangle_): New field.
12433 * object.cc (big_endian>::get_symbol_location_info): Call
12434 Options::do_demangle, not Options::demangle.
12435 * symtab.cc (demangle): Likewise.
12436
cbb93e63
ILT
124372008-03-22 Ian Lance Taylor <iant@google.com>
12438
12439 * gold.h: Include <cstddef> and <sys/types.h>
12440 * options.h: Include <cstring>.
12441
ec531623
ILT
124422008-03-21 Ian Lance Taylor <iant@google.com>
12443
12444 * Added source code to GNU binutils.
This page took 0.721962 seconds and 4 git commands to generate.