PR breakpoints/13568:
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
bef2b434
ILT
12012-01-27 Ian Lance Taylor <iant@google.com>
2
3 * reloc.h (Bits): New class with static functions, copied from
4 namespace utils in arm.cc.
5 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
6 instead.
7
c335b55d
L
82012-01-27 H.J. Lu <hongjiu.lu@intel.com>
9
10 * incremental.cc (write_info_blocks): Correct relocation offset.
11
41194d9f
L
122012-01-27 H.J. Lu <hongjiu.lu@intel.com>
13
14 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
15 (Relocate::tls_gd_to_le): Likewise.
16
1bae613c
L
172012-01-27 H.J. Lu <hongjiu.lu@intel.com>
18
19 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
20
24482ca0
L
212012-01-27 H.J. Lu <hongjiu.lu@intel.com>
22
23 * configure.ac: Check if -mcmodel=medium works.
24 * configure: Regenerated.
25
c2c7840a
CC
262012-01-24 Cary Coutant <ccoutant@google.com>
27
28 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
29 definition and ...
30 (read_unsigned_LEB_128_x): ... this new function.
31 (read_signed_LEB_128): Replaced with inline definition and ...
32 (read_signed_LEB_128_x): ... this new function.
33 * int_encoding.h (read_unsigned_LEB_128_x): New function.
34 (read_unsigned_LEB_128): Add inline definition.
35 (read_signed_LEB_128_x): New function.
36 (read_signed_LEB_128): Add inline definition.
37 * testsuite/Makefile.am (leb128_unittest): New unit test.
38 * testsuite/Makefile.in: Regenerate.
39 * testsuite/leb128_unittest.cc: New unit test.
40
833de760 412012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
42
43 PR gold/13617
44 * i386.cc (Target_i386::do_code_fill): When using a jmp
45 instruction, pad with nop instructions.
46 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
47
618d6666
L
482012-01-22 H.J. Lu <hongjiu.lu@intel.com>
49
50 * x86_64.cc (gc_process_relocs): Add typename on types used in
51 template.
52 (scan_relocs): Likewise.
53 (relocate_section): Likewise.
54 (apply_relocation): Likewise.
55
3660ff06
L
562012-01-10 H.J. Lu <hongjiu.lu@intel.com>
57
58 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
59 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
60 under x32.
61
fc51264f
L
622012-01-09 H.J. Lu <hongjiu.lu@intel.com>
63
64 * x86_64.cc: Initial support for x32.
65
dd74ae06
CC
662012-01-03 Cary Coutant <ccoutant@google.com>
67
68 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
69 Use abstract base class for GOT.
70 * gold/output.h (class Output_data_got_base): New abstract base class.
71 (class Output_data_got): Derive from new base class, adjust ctors.
72 (Output_data_got::reserve_slot): Make virtual; rename to
73 do_reserve_slot; Adjust callers.
74 * gold/target.h (Sized_target::init_got_plt_for_update): Return
75 pointer to abstract base class.
76 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
77
83896202
ILT
782011-12-18 Ian Lance Taylor <iant@google.com>
79
80 * object.h (Relobj::local_symbol_value): New function.
81 (Relobj::local_plt_offset): New function.
82 (Relobj::local_has_got_offset): New function.
83 (Relobj::local_got_offset): New function.
84 (Relobj::set_local_got_offset): New function.
85 (Relobj::do_local_symbol_value): New pure virtual function.
86 (Relobj::do_local_plt_offset): Likewise.
87 (Relobj::do_local_has_got_offset): Likewise.
88 (Relobj::do_local_got_offset): Likewise.
89 (Relobj::do_set_local_got_offset): Likewise.
90 (Sized_relobj::do_local_has_got_offset): Rename from
91 local_has_got_offset.
92 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
93 (Sized_relobj::do_set_local_got_offset): Rename from
94 set_local_got_offset.
95 (Sized_relobj_file::do_local_plt_offset): Rename from
96 local_plt_offset.
97 (Sized_relobj_file::do_local_symbol_value): New function.
98 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
99 local_plt_offset.
100 * output.cc (Output_data_got::Got_entry::write): Change object to
101 Relobj. Use local_symbol_value.
102 (Output_data_got::add_global_with_rel): Change rel_dyn to
103 Output_data_reloc_generic*. Use add_global_generic.
104 (Output_data_got::add_global_with_rela): Remove. Change all
105 callers to use add_global_with_rel.
106 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
107 Output_data_reloc_generic*. Use add_global_generic.
108 (Output_data_got::add_global_pair_with_rela): Remove. Change all
109 callers to use add_global_pair_with_rel.
110 (Output_data_got::add_local): Change object to Relobj*.
111 (Output_data_got::add_local_plt): Likewise.
112 (Output_data_got::add_local_with_rel): Change object to Relobj*,
113 change rel_dyn to Output_data_reloc_generic*. Use
114 add_local_generic.
115 (Output_data_got::add_local_with_rela): Remove. Change all
116 callers to use all_local_with_rel.
117 (Output_data_got::add_local_pair_with_rel): Change object to
118 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
119 add_output_section_generic.
120 (Output_data_got::add_local_pair_with_rela): Remove. Change all
121 callers to use add_local_pair_with_rel.
122 (Output_data_got::reserve_local): Change object to Relobj*.
123 * output.h: (class Output_data_reloc_generic): Add pure virtual
124 declarations for add_global_generic, add_local_generic,
125 add_output_section_generic.
126 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
127 functions for Output_data_reloc_generic. Update declarations for
128 changes listed in output.cc.
129 (class Output_data_got): Change template parameter to got_size.
130 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
131 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
132 function.
133 (Sized_relobj_incr::do_local_plt_offset): New function.
134 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
135 add_global_generic.
136
76677ad0
CC
1372011-12-17 Cary Coutant <ccoutant@google.com>
138
139 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
140 * resolve.cc (Symbol_table::resolve): Likewise.
141 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
142 arrays.
143 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
144
8b8dd8d5
ILT
1452011-12-16 Ian Lance Taylor <iant@google.com>
146
147 * output.h (Output_data_reloc_generic::add): Only call
148 add_dynamic_reloc if this is a dynamic reloc section.
149
d55525b9
L
1502011-12-15 H.J. Lu <hongjiu.lu@intel.com>
151
152 PR gold/13505
153 * target-reloc.h (apply_relocation): Replace <64, false> with
154 <size, big_endian>.
155
ff81c7c1
NC
1562011-11-25 Nick Clifton <nickc@redhat.com>
157
158 * po/it.po: New Italian translation.
159
628f39be
SA
1602011-11-17 Sterling Augustine <saugustine@google.com>
161
162 * script.cc (script_include_directive): Implement.
163 (read_script_file): New local variables name and search_path. Update
164 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
165 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
166 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
167
98ef3ea4
SA
1682011-11-11 Sterling Augustine <saugustine@google.com>
169
170 * yyscript.y (section_cmd): Add support for INCLUDE directive.
171 (file_or_sections_cmd): Likewise.
172
f4a8b6d7
DK
1732011-11-11 Doug Kwan <dougkwan@google.com>
174
175 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
176 if --just-symbols is given.
177
29ab395d
DK
1782011-11-10 Doug Kwan <dougkwan@google.com>
179
180 PR gold/13362
181 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
182 when processing data relocs.
183 * reloc.h (Relocate_functions::rel_unaligned): New method.
184 (Relocate_functions::pcrel_unaligned): Ditto.
185 (Relocate_functions::rel32_unaligned): Ditto.
186 (Relocate_functions::pcrel32_unaligned): Ditto.
187
2c339f71
DK
1882011-11-09 Doug Kwan <dougkwan@google.com>
189
190 PR gold/13362
191 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
192 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
193 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
194 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
195 (Relocate_functions::rel_unaligned): New.
196 (Relocate_functions::rel32_unaligned): New.
197 * target-reloc.h (relocate_for_relocatable): Add code to handle
198 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
199 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
200 arm_unaligned_reloc_r): New targets.
201 * testsuite/Makefile.in: Regenerate.
202 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
203 linking.
204
3f3cddf1
ILT
2052011-11-02 Ian Lance Taylor <iant@google.com>
206
207 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
208 NATIVE_LINKER.
209 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
210 * options.cc (General_options::finalize): Use library search path
211 from configure script if specified. If not native and no sysroot,
212 only search TOOLLIBDIR.
213 * options.h (Search_directory::Search_directory): Change name to
214 const std::string&.
215 (General_options::add_to_library_path_with_sysroot): Change arg to
216 const std::string&.
217 * configure, Makefile.in, config.in: Rebuild.
218
a8e2273b
ILT
2192011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
220
221 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
222 we are working around the ARM1176 Erratum.
223 * options.h (General_options::fix_arm1176): Add option.
224 * testsuite/Makefile.am: Add testcases, and keep current ones
225 working.
226 * testsuite/Makefile.in: Regenerate.
227 * testsuite/arm_fix_1176.s: New file.
228 * testsuite/arm_fix_1176.sh: Likewise.
229
cd6eab1c
ILT
2302011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
231
232 * arm.cc (Target_arm::Target_arm): Remove initialisation of
233 may_use_blx_.
234 (Target_arm::may_use_blx): Remove method.
235 (Target_arm::set_may_use_blx): Likewise.
236 (Target_arm::may_use_v4t_interworking): New method.
237 (Target_arm::may_use_v5t_interworking): Likewise.
238 (Target_arm::may_use_blx_): Remove member variable.
239 (Arm_relocate_functions::arm_branch_common): Check for v5T
240 interworking.
241 (Arm_relocate_functions::thumb_branch_common): Likewise.
242 (Reloc_stub::stub_type_for_reloc): Likewise.
243 (Target_arm::do_finalize_sections): Correct interworking checks.
244 * testsuite/Makefile.am: Add new tests.
245 * testsuite/Makefile.in: Regenerate.
246 * testsuite/arm_farcall_arm_arm.s: New test.
247 * testsuite/arm_farcall_arm_arm.sh: Likewise.
248 * testsuite/arm_farcall_arm_thumb.s: Likewise.
249 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
250 * testsuite/arm_farcall_thumb_arm.s: Likewise.
251 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
252 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
253 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
254
286adcf4
CC
2552011-10-31 Cary Coutant <ccoutant@google.com>
256
257 PR gold/13023
258 * expression.cc (Expression::eval_with_dot): Add
259 is_section_dot_assignment parameter.
260 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
261 absolute and assigning to dot within a section.
262 * script-sections.cc
263 (Output_section_element_assignment::set_section_addresses): Pass
264 dot_section to set_if_absolute.
265 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
266 as is_section_dot_assignment flag to eval_with_dot.
267 (Output_section_element_dot_assignment::set_section_addresses):
268 Likewise.
269 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
270 parameter. Also set value if relative to dot_section; set the
271 symbol's output_section.
272 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
273 parameter. Adjust all callers.
274 (Expression::eval_maybe_dot): Likewise.
275 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
276 Adjust all callers.
277 * testsuite/script_test_2.t: Test assignment of an absolute value
278 to dot within an output section element.
279
9634ed06
CC
2802011-10-31 Cary Coutant <ccoutant@google.com>
281
282 * options.h (class General_options): Add --[no-]gnu-unique options.
283 * symtab.cc (Symbol_table::sized_write_globals): Convert
284 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
285
de4101c7
CC
2862011-10-31 Cary Coutant <ccoutant@google.com>
287
288 PR gold/13359
289 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
290 unnecessary assertion.
291 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
292
7257cc92
ST
2932011-10-31 Sriraman Tallam <tmsriram@google.com>
294
295 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
296 gc_mark_symbol.
297 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
298 gc_mark_symbol.
299 Change to just keep the section associated with symbol.
300 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
301 they are externally visible and --export-dynamic is turned on.
302 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
303
bfc34b3f
ILT
3042011-10-19 Ian Lance Taylor <iant@google.com>
305
306 PR gold/13163
307 * script-sections.cc
308 (Output_section_element_dot_assignment::needs_output_section): New
309 function.
310
ea0d8c47
ILT
3112011-10-19 Ian Lance Taylor <iant@google.com>
312
313 PR gold/13204
314 * layout.cc (Layout::segment_precedes): Don't assert failure if a
315 --section-start option was seen.
316 * options.h (General_options::any_section_start): New function.
317
abd242a9
DM
3182011-10-18 David S. Miller <davem@davemloft.net>
319
320 PR binutils/13301
321 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
322 member to track relocation locations that have moved during TLS
323 reloc optimizations.
324 (Target_sparc::Relocate::Relocate): Initialize to NULL.
325 (Target_sparc::Relocate::relocate): Adjust view down by 4
326 bytes if it matches reloc_adjust_addr_.
327 (Target_sparc::Relocate::relocate_tls): Always move the
328 __tls_get_addr call delay slot instruction forward 4 bytes when
329 performing relaxation.
330
bab9090f
CC
3312011-10-18 Cary Coutant <ccoutant@google.com>
332
333 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
334 (Output_file::map_no_anonymous): Check for non-zero
335 return code from posix_fallocate.
336
f7c5b166
CC
3372011-10-17 Cary Coutant <ccoutant@google.com>
338
339 PR gold/13245
340 * plugin.cc (is_visible_from_outside): Check for symbols
341 referenced from dynamic objects.
342 * resolve.cc (Symbol_table::resolve): Don't count references
343 from dynamic objects as references from real ELF files.
344 * testsuite/plugin_test_2.sh: Adjust expected result.
345
b490c0bb
CC
3462011-10-17 Cary Coutant <ccoutant@google.com>
347
348 * gold.cc: Include timer.h.
349 (queue_middle_tasks): Stamp time.
350 (queue_final_tasks): Likewise.
351 * main.cc (main): Store timer in parameters. Print timers
352 for each pass.
353 * parameters.cc (Parameters::Parameters): Initialize timer_.
354 (Parameters::set_timer): New function.
355 (set_parameters_timer): New function.
356 * parameters.h (Parameters::set_timer): New function.
357 (Parameters::timer): New function.
358 (Parameters::timer_): New data member.
359 (set_parameters_timer): New function.
360 * timer.cc (Timer::stamp): New function.
361 (Timer::get_pass_time): New function.
362 * timer.h (Timer::stamp): New function.
363 (Timer::get_pass_time): New function.
364 (Timer::pass_times_): New data member.
365
f475cf7b
CC
3662011-10-17 Cary Coutant <ccoutant@google.com>
367
368 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
369 task for members of lib groups.
370
cdd7e244
CC
3712011-10-17 Cary Coutant <ccoutant@google.com>
372
373 PR gold/13288
4f95c8b4 374 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
375 (File_read::make_view): Move bounds check (replace with assert)...
376 (File_read::find_or_make_view): ... to here.
377
dfb45471
CC
3782011-10-12 Cary Coutant <ccoutant@google.com>
379
4f95c8b4 380 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
381 ::read returns less than requested size.
382
53bbcc1b
CC
3832011-10-10 Cary Coutant <ccoutant@google.com>
384
4f95c8b4 385 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
386 Initialize defined_count_.
387 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
388 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
389 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
390 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
391 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 392 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
393 member.
394 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 395 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
396 Return zeroes instead of internal error.
397
397b129b
CC
3982011-10-10 Cary Coutant <ccoutant@google.com>
399
400 PR gold/13249
4f95c8b4 401 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 402 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 403 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
404 (Output_reloc::type_): Adjust size of bit field.
405 (Output_reloc::use_plt_offset_): New bit field.
406 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
407 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
408 flag. Adjust all callers.
4f95c8b4 409 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
410 creating RELATIVE relocations.
411
d5698657
NC
4122011-10-10 Nick Clifton <nickc@redhat.com>
413
414 * po/es.po: Updated Spanish translation.
415 * po/fi.po: Updated Finnish translation.
416
6a59a5c2
DN
4172011-10-03 Diego Novillo <dnovillo@google.com>
418
419 * options.cc (parse_uint): Fix dereference of RETVAL.
420
f0558624
ST
4212011-09-29 Sriraman Tallam <tmsriram@google.com>
422
423 * layout.h (section_order_map_): New member.
424 (get_section_order_map): New member function.
425 * output.cc (Output_section::add_input_section): Check for patterns
426 only when --section-ordering-file is specified.
427 * gold.cc (queue_middle_tasks): Delay updating order of sections till
428 output_sections have been formed.
429 * layout.cc (Layout_Layout): Initialize section_order_map_.
430 * plugin.cc (update_section_order): Store order in order_map. Do not
431 update the order.
432 * testsuite/Makefile.am: Add test case for plugin_final_layout.
433 * testsuite/Makefile.in: Regenerate.
434 * testsuite/plugin_section_order.c: New file.
435 * testsuite/plugin_final_layout.cc: New file.
436 * testsuite/plugin_final_layout.sh: New file.
437
a7dac153
CC
4382011-09-29 Cary Coutant <ccoutant@google.com>
439
4f95c8b4 440 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 441 Check for NULL.
4f95c8b4 442 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
443 symbols during incremental update.
444 (Symbol_table::add_from_dynobj): Likewise.
445
eebd87a5
ILT
4462011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
447 Ian Lance Taylor <iant@google.com>
448
449 * symtab.cc (Symbol_table::define_special_symbol): Always
450 canonicalize version string.
451
403a3331
CC
4522011-09-26 Cary Coutant <ccoutant@google.com>
453
4f95c8b4
CC
454 * gold.cc (queue_initial_tasks): Move option checks ...
455 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
456 some options; make others fatal.
457
235061c2
CC
4582011-09-26 Cary Coutant <ccoutant@google.com>
459
460 gcc PR lto/47247
461 * plugin.cc (get_symbols_v2): New function.
462 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
463 (is_referenced_from_outside): New function.
464 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
465 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
466 (get_symbols): Pass version parameter.
467 (get_symbols_v2): New function.
468 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
469 parameter.
470 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
471 (onload): Add LDPT_GET_SYMBOLS_V2.
472 (all_symbols_read_hook): Use get_symbols_v2; check for
473 LDPR_PREVAILING_DEF_IRONLY_EXP.
474 * testsuite/plugin_test_3.sh: Update expected results.
475
dc87f620
ILT
4762011-09-23 Simon Baldwin <simonb@google.com>
477
478 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
479 configuration options.
480 * configure: Regenerate.
481 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
482 * Makefile.in: Regenerate.
483 * testsuite/Makefile.in: Regenerate.
484
a8279f82
ST
4852011-09-19 Sriraman Tallam <tmsriram@google.com>
486
487 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
488
0c9350c8
CC
4892011-09-19 Cary Coutant <ccoutant@google.com>
490
491 * incremental.cc (can_incremental_update): Fix typo in comment.
492 * incremental.h (can_incremental_update): Likewise.
493
aa06ae28
CC
4942011-09-18 Cary Coutant <ccoutant@google.com>
495
496 * incremental.cc (can_incremental_update): New function.
497 * incremental.h (can_incremental_update): New function.
498 * layout.cc (Layout::init_fixed_output_section): Call it.
499 (Layout::make_output_section): Don't allow patch space in .eh_frame.
500 * object.cc (Sized_relobj_file::do_layout): Call
501 can_incremental_update.
502
ebb300b2
CC
5032011-09-13 Cary Coutant <ccoutant@google.com>
504
505 * configure.ac: Check for glibc support for gnu_indirect_function
506 support with static linking, setting automake conditional
507 IFUNC_STATIC.
508 * Makefile.in: Regenerate.
509 * configure: Regenerate.
510
511 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
512 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
513 for IFUNC_STATIC.
514 * testsuite/Makefile.in: Regenerate.
515
1206d0d5
CC
5162011-09-13 Cary Coutant <ccoutant@google.com>
517
518 * incremental.cc (Sized_relobj_incr::do_layout): Call
519 report_comdat_group for kept comdat sections.
520 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
521 * testsuite/Makefile.in: Regenerate.
522 * testsuite/incr_comdat_test_1.cc: New source file.
523 * testsuite/incr_comdat_test_2_v1.cc: New source file.
524 * testsuite/incr_comdat_test_2_v2.cc: New source file.
525 * testsuite/incr_comdat_test_2_v3.cc: New source file.
526
40b29874
ILT
5272011-09-13 Ian Lance Taylor <iant@google.com>
528
529 * object.cc (Sized_relobj_file::do_layout): Remove unused local
530 variable external_symbols_offset.
531
1b045aac
ILT
5322011-09-12 Ian Lance Taylor <iant@google.com>
533
534 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
535 triggered if object has no symbols.
536
24c6c55a
DM
5372011-09-09 David S. Miller <davem@davemloft.net>
538
539 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
540 (Output_fill_debug_line::do_write): Likewise.
541
66570254
CC
5422011-08-29 Cary Coutant <ccoutant@google.com>
543
544 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
545 casts to match formatting specs.
546 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
547
8ea8cd50
CC
5482011-08-26 Cary Coutant <ccoutant@google.com>
549
550 * layout.cc (Free_list::allocate): Provide guarantee of minimum
551 remaining hole size when allocating.
552 (Layout::make_output_section): Set fill methods for debug sections.
553 * layout.h (Free_list::Free_list_node): Move from private to
554 public.
555 (Free_list::set_min_hole_size): New function.
556 (Free_list::begin, Free_list::end): New functions.
557 (Free_list::min_hole_): New data member.
558 * output.cc: Include dwarf.h.
559 (Output_fill_debug_info::do_minimum_hole_size): New function.
560 (Output_fill_debug_info::do_write): New function.
561 (Output_fill_debug_line::do_minimum_hole_size): New function.
562 (Output_fill_debug_line::do_write): New function.
563 (Output_section::Output_section): Initialize new data member.
564 (Output_section::set_final_data_size): Ensure patch space is larger
565 than minimum hole size.
566 (Output_section::do_write): Fill holes in debug sections.
567 * output.h (Output_fill): New class.
568 (Output_fill_debug_info): New class.
569 (Output_fill_debug_line): New class.
570 (Output_section::set_free_space_fill): New function.
571 (Output_section::free_space_fill_): New data member.
572 * testsuite/Makefile.am (incremental_test_3): Add
573 --incremental-patch option.
574 (incremental_test_4): Likewise.
575 (incremental_test_5): Likewise.
576 (incremental_test_6): Likewise.
577 (incremental_copy_test): Likewise.
578 (incremental_common_test_1): Likewise.
579 * testsuite/Makefile.in: Regenerate.
580
7cf80422
NC
5812011-08-26 Nick Clifton <nickc@redhat.com>
582
583 * po/es.po: Updated Spanish translation.
584
c3f7b0e5
CC
5852011-08-01 Cary Coutant <ccoutant@google.com>
586
587 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
588 * gold/testsuite/Makefile.in: Regenerate.
589 * gold/testsuite/justsyms_exec.c: New source file.
590 * gold/testsuite/justsyms_lib.c: New source file.
591
9590bf25
CC
5922011-08-01 Cary Coutant <ccoutant@google.com>
593
594 * layout.cc (Layout::set_segment_offsets): Don't realign text
595 segment if -Ttext was specified.
596 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
597 file type.
598 * object.h (Sized_relobj_file::e_type): New function.
599 (Sized_relobj_file::e_type_): New data member.
600 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
601 base address for ET_EXEC files.
602 * target.cc (Target::do_make_elf_object_implementation): Allow
603 ET_EXEC files with --just-symbols option.
604
dcd8d12e
CC
6052011-07-28 Cary Coutant <ccoutant@google.com>
606
607 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
608 Add thread_number parameter.
609 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
610 * workqueue-threads.cc
611 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
612 current thread if its thread number is greater than desired thread
613 count.
614 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
615 Add thread_number parameter.
616 (Workqueue::should_cancel_thread): Likewise.
617 (Workqueue::find_runnable_or_wait): Pass thread_number to
618 should_cancel_thread.
619 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
620 parameter.
621
804eb480
ST
6222011-07-22 Sriraman Tallam <tmsriram@google.com>
623
624 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
625 only after checking if it cannot be forced local.
626 * symtab.h (is_externally_visible): Check if the symbol is not forced
627 local.
628
f1ddb600
ILT
6292011-07-15 Ian Lance Taylor <iant@google.com>
630
631 * options.h (class General_options): Add --print-output-format.
632 Move -EL next to -EB, for better --help output.
633 * target-select.cc: Include <cstdio>, "options.h", and
634 "parameters.h".
635 (Target_selector::do_target_bfd_name): New function.
636 (print_output_format): New function.
637 * target-select.h (class Target_selector): Update declarations.
638 (Target_selector::target_bfd_name): New function.
639 (print_output_format): Declare.
640 * main.cc: Include "target-select.h".
641 (main): Handle --print-output-format.
642 * gold.cc: Include "target-select.h".
643 (queue_initial_tasks): Handle --print-output-format when there are
644 no input files.
645 * parameters.cc (parameters_force_valid_target): Give a better
646 error message if -EB/-EL does not match target.
647 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
648 function.
649
7d172687
ILT
6502011-07-15 Ian Lance Taylor <iant@google.com>
651
652 * i386.cc (class Output_data_plt_i386): Add layout_ field.
653 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
654 (Output_data_plt_i386::do_write): Write address of .dynamic
655 section to first entry in .got.plt section.
656 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
657 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
658 Initialize layout_.
659 (Output_data_plt_x86_64::do_write): Write address of .dynamic
660 section to first entry in .got.plt section.
661 * layout.h (Layout::dynamic_section): New function.
662
e9552f7e
ST
6632011-07-13 Sriraman Tallam <tmsriram@google.com>
664
665 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
666 to claim_file call.
667 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
668 input_section_position_, and input_section_glob_.
669 (read_layout_from_file): Call function section_ordering_specified.
670 * layout.h (is_section_ordering_specified): New function.
671 (section_ordering_specified): New function.
672 (section_ordering_specified_): New boolean member.
673 * main.cc(main): Call load_plugins after layout object is defined.
674 * output.cc (Output_section::add_input_section): Use
675 function section_ordering_specified to check if section ordering is
676 needed.
677 * output.cc (Output_section::add_relaxed_input_section): Use
678 function section_ordering_specified to check if section ordering is
679 needed.
680 (Output_section::update_section_layout): New function.
681 (Output_section::sort_attached_input_sections): Check if input section
682 must be reordered.
683 * output.h (Output_section::update_section_layout): New function.
684 * plugin.cc (get_section_count): New function.
685 (get_section_type): New function.
686 (get_section_name): New function.
687 (get_section_contents): New function.
688 (update_section_order): New function.
689 (allow_section_ordering): New function.
690 (Plugin::load): Add the new interfaces to the transfer vector.
691 (Plugin_manager::load_plugins): New parameter.
692 (Plugin_manager::all_symbols_read): New parameter.
693 (Plugin_manager::claim_file): New parameter. Save the elf object for
694 unclaimed objects.
695 (Plugin_manager::get_elf_object): New function.
696 (Plugin_manager::get_view): Change to directly use the bool to check
697 if get_view is called from claim_file_hook.
698 * plugin.h (input_objects): New function
699 (Plugin__manager::load_plugins): New parameter.
700 (Plugin_manager::claim_file): New parameter.
701 (Plugin_manager::get_elf_object): New function.
702 (Plugin_manager::in_claim_file_handler): New function.
703 (Plugin_manager::in_claim_file_handler_): New member.
704 (layout): New function.
705 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
706 handler with an extra parameter. Make the elf object before calling
707 claim_file handler.
708 * testsuite/plugin_test.c (get_section_count): New function pointer.
709 (get_section_type): New function pointer.
710 (get_section_name): New function pointer.
711 (get_section_contents): New function pointer.
712 (update_section_order): New function pointer.
713 (allow_section_ordering): New function pointer.
714 (onload): Check if the new interfaces exist.
715
9446efde
ILT
7162011-07-13 Ian Lance Taylor <iant@google.com>
717
718 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
719 relro section.
720 * x86_64.cc (Target_x86_64::got_section): Likewise.
721 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
722 (relro_now_test_SOURCES): New variable.
723 (relro_now_test_DEPENDENCIES): New variable.
724 (relro_now_test_LDFLAGS): New variable.
725 (relro_now_test_LDADD): New variable.
726 (relro_now_test.so): New target.
727 * testsuite/Makefile.in: Rebuild.
728
07aa62f2
ILT
7292011-07-12 Ian Lance Taylor <iant@google.com>
730
731 PR gold/12980
732 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
733 GLOB_DAT relocation rather than a RELATIVE relocation for a
734 protected symbol when creating a shared library.
735 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
736 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
737 * testsuite/protected_main_1.cc (main): Test that protected
738 function has same address.
739
e2153196
ILT
7402011-07-11 Ian Lance Taylor <iant@google.com>
741
742 PR gold/12979
743 * options.h (class General_options): Add -Bgroup.
744 * options.cc (General_options::finalize): If -Bgroup is set,
745 default to --unresolved-symbols=report-all.
746 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
747 * target-reloc.h (issue_undefined_symbol_error): Handle
748 --unresolved-symbols=report-all.
749
6daf5215
ILT
7502011-07-08 Ian Lance Taylor <iant@google.com>
751
752 PR gold/11985
753 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
754 if linker script discards key sections.
755 (Layout::create_dynamic_symtab): Likewise.
756 (Layout::assign_local_dynsym_offsets): Likewise.
757 (Layout::sized_create_version_sections): Likewise.
758 (Layout::create_interp): Likewise.
759 (Layout::finish_dynamic_section): Likewise.
760 (Layout::set_dynamic_symbol_size): Likewise.
761
beabb2c6
ILT
7622011-07-08 Ian Lance Taylor <iant@google.com>
763
764 PR gold/12386
765 * options.h (class General_options): Add --unresolved-symbols.
766 * target-reloc.h (issue_undefined_symbol_error): Check
767 --unresolved-symbols. Add comments.
768
9c16daf1
ILT
7692011-07-08 Ian Lance Taylor <iant@google.com>
770
771 * testsuite/odr_violation2.cc (Ordering::operator()): Make
772 expression more complex.
773
191f1a2d
ILT
7742011-07-08 Ian Lance Taylor <iant@google.com>
775
776 PR gold/11317
777 * target-reloc.h (issue_undefined_symbol_error): New inline
778 function, broken out of relocate_section.
779 (relocate_section): Call issue_undefined_symbol_error.
780 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
781 there is no TLS segment if we are about to issue an undefined
782 symbol error.
783 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
784
62855347
ILT
7852011-07-08 Ian Lance Taylor <iant@google.com>
786
787 PR gold/12279
788 * resolve.cc (Symbol_table::should_override): Add fromtype
789 parameter. Change all callers. Give error when linking together
790 TLS and non-TLS symbol.
791 (Symbol_table::should_override_with_special): Add fromtype
792 parameter. Change all callers.
793 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
794 there is no TLS segment if we have reported some errors.
795 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
796
67181c72
ILT
7972011-07-08 Ian Lance Taylor <iant@google.com>
798
799 PR gold/12372
800 * target.h (Target::plt_address_for_global): New function.
801 (Target::plt_address_for_local): New function.
802 (Target::plt_section_for_global): Remove.
803 (Target::plt_section_for_local): Remove.
804 (Target::do_plt_address_for_global): New virtual function.
805 (Target::do_plt_address_for_local): New virtual function.
806 (Target::do_plt_section_for_global): Remove.
807 (Target::do_plt_section_for_local): Remove.
808 (Target::register_global_plt_entry): Add Symbol_table and Layout
809 parameters.
810 * output.cc (Output_data_got::Got_entry::write): Use
811 plt_address_for_global and plt_address_for_local.
812 * layout.cc (Layout::add_target_dynamic_tags): Use size and
813 address of output section.
814 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
815 got_irelative_, and irelative_count_ fields. Update
816 declarations.
817 (Output_data_plt_i386::has_irelative_section): New function.
818 (Output_data_plt_i386::entry_count): Add irelative_count_.
819 (Output_data_plt_i386::set_final_data_size): Likewise.
820 (class Target_i386): Add got_irelative_ and rel_irelative_
821 fields. Update declarations.
822 (Target_i386::Target_i386): Initialize new fields.
823 (Target_i386::do_plt_address_for_global): New function replacing
824 do_plt_section_for_global.
825 (Target_i386::do_plt_address_for_local): New function replacing
826 do_plt_section_for_local.
827 (Target_i386::got_section): Create got_irelative_.
828 (Target_i386::rel_irelative_section): New function.
829 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
830 fields. Don't define __rel_iplt_{start,end}.
831 (Output_data_plt_i386::add_entry): Add symtab and layout
832 parameters. Change all callers. Use different PLT and GOT for
833 IFUNC symbols.
834 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
835 layout parameters. Change all callers. Use different PLT and
836 GOT.
837 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
838 (Output_data_plt_i386::rel_irelative): New function.
839 (Output_data_plt_i386::address_for_global): New function.
840 (Output_data_plt_i386::address_for_local): New function.
841 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
842 IRELATIVE GOT when changing IFUNC GOT entries.
843 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
844 reloc.
845 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
846 if we didn't create an IRELATIVE GOT.
847 (Target_i386::Relocate::relocate): Use plt_address_for_global and
848 plt_address_for_local.
849 (Target_i386::do_dynsym_value): Use plt_address_for_global.
850 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
851 got_irelative_, and irelative_count_ fields. Update
852 declarations.
853 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
854 Initialize new fields. Remove symtab parameter. Change all
855 callers.
856 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
857 irelative_count_.
858 (Output_data_plt_x86_64::has_irelative_section): New function.
859 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
860 (class Target_x86_64): Add got_irelative_ and rel_irelative_
861 fields. Update declarations.
862 (Target_x86_64::Target_x86_64): Initialize new fields.
863 (Target_x86_64::do_plt_address_for_global): New function replacing
864 do_plt_section_for_global.
865 (Target_x86_64::do_plt_address_for_local): New function replacing
866 do_plt_section_for_local.
867 (Target_x86_64::got_section): Create got_irelative_.
868 (Target_x86_64::rela_irelative_section): New function.
869 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
870 all callers. Don't create __rel_iplt_{start,end}.
871 (Output_data_plt_x86_64::add_entry): Add symtab and layout
872 parameters. Change all callers. Use different PLT and GOT for
873 IFUNC symbols.
874 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
875 layout parameters. Change all callers. Use different PLT and
876 GOT.
877 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
878 parameters. Change all callers. Use different PLT and GOT for
879 IFUNC symbols.
880 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
881 (Output_data_plt_x86_64::rela_irelative): New function.
882 (Output_data_plt_x86_64::address_for_global): New function.
883 (Output_data_plt_x86_64::address_for_local): New function.
884 (Output_data_plt_x86_64::set_final_data_size): Likewise.
885 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
886 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
887 (Target_x86_64::register_global_plt_entry): Add symtab and layout
888 parameters.
889 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
890 reloc.
891 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
892 symbols if we didn't create an IRELATIVE GOT.
893 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
894 plt_address_for_local.
895 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
896 * testsuite/ifuncvar1.c: New test file.
897 * testsuite/ifuncvar2.c: New test file.
898 * testsuite/ifuncvar3.c: New test file.
899 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
900 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
901 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
902 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
903 * testsuite/Makefile.in: Rebuild.
904
33c15b45
CC
9052011-07-07 Cary Coutant <ccoutant@google.com>
906
907 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
908 (two_file_test_1_ndebug.o): Likewise.
909 (two_file_test_1b_ndebug.o): Likewise.
910 (two_file_test_2_ndebug.o): Likewise.
911 (two_file_test_main_ndebug.o): Likewise.
912 (incremental_test_2): Link with no-debug versions.
913
f48b5fb7
CC
9142011-07-06 Cary Coutant <ccoutant@google.com>
915
916 * gold/incremental.cc
917 (Output_section_incremental_inputs::write_info_blocks): Check for
918 hidden and internal symbols.
919
221597a5
CC
9202011-07-06 Cary Coutant <ccoutant@google.com>
921
922 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
923 Check disposition for startup file.
924 (Incremental_inputs::report_command_line): Ignore
925 --incremental-startup-unchanged option.
926 * options.cc (General_options::parse_incremental_startup_unchanged):
927 New function.
928 (General_options::General_options): Initialize new data member.
929 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
930 (General_options): Add --incremental-startup-unchanged option.
931 (General_options::incremental_startup_disposition): New function.
932 (General_options::incremental_startup_disposition_): New data member.
933
e24719f6
CC
9342011-07-06 Cary Coutant <ccoutant@google.com>
935
936 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
937 input file index to Script_info ctor.
938 (Sized_incremental_binary::do_file_has_changed): Find the
939 command-line argument for files named in scripts.
940 * incremental.h (Script_info::Script_info): New ctor
941 with input file index.
942 (Script_info::input_file_index): New function.
943 (Script_info::input_file_index_): New data member.
944 (Incremental_binary::get_library): Add const.
945 (Incremental_binary::get_script_info): Add const.
946 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
947 * testsuite/Makefile.am (incremental_test_5): New test case.
948 (incremental_test_6): New test case.
949 * testsuite/Makefile.in: Regenerate.
950
8f7c81e8
CC
9512011-07-06 Cary Coutant <ccoutant@google.com>
952
953 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
954 debug output when command lines differ.
955
9fbd3822
CC
9562011-07-06 Cary Coutant <ccoutant@google.com>
957
958 * incremental.cc (Incremental_inputs::report_command_line): Ignore
959 --incremental-patch option.
960 * layout.cc (Free_list::allocate): Extend allocation beyond original
961 end if enabled.
962 (Layout::make_output_section): Mark sections that should get
963 patch space.
964 * options.cc (parse_percent): New function.
965 * options.h (parse_percent): New function.
966 (DEFINE_percent): New macro.
967 (General_options): Add --incremental-patch option.
968 * output.cc (Output_section::Output_section): Initialize new data
969 members.
970 (Output_section::add_input_section): Print section name when out
971 of patch space.
972 (Output_section::add_output_section_data): Likewise.
973 (Output_section::set_final_data_size): Add patch space when
974 doing --incremental-full.
975 (Output_section::do_reset_address_and_file_offset): Remove patch
976 space.
977 (Output_segment::set_section_list_addresses): Print debug output
978 only if --incremental-update.
979 * output.h (Output_section::set_is_patch_space_allowed): New function.
980 (Output_section::is_patch_space_allowed_): New data member.
981 (Output_section::patch_space_): New data member.
982 * parameters.cc (Parameters::incremental_full): New function.
983 * parameters.h (Parameters::incremental_full): New function
984 * testsuite/Makefile.am (incremental_test_2): Add test for
985 --incremental-patch option.
986 * testsuite/Makefile.in: Regenerate.
987 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
988 (t18): Remove function body.
989
f6cccc2c
DK
9902011-07-05 Doug Kwan <dougkwan@google.com>
991
992 PR gold/12771
993 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
994 Arm_Address type for relocation result.
995 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
996 overflow check.
997 (Arm_relocate_functions::abs32): Use unaligned access.
998 (Arm_relocate_functions::rel32): Ditto.
999 (Arm_relocate_functions::prel31): Ditto.
1000 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
1001 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
1002 static data relocations.
1003 * testsuite/Makefile.in: Regnerate.
1004 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
1005
28a13fec
ILT
10062011-07-05 Ian Lance Taylor <iant@google.com>
1007
1008 PR gold/12392
1009 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
1010 symbols if necessary.
1011 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
1012
24d47b34
ILT
10132011-07-05 Ian Lance Taylor <iant@google.com>
1014
1015 PR gold/12952
1016 * resolve.cc (Symbol::override_base_with_special): Simply override
1017 version with special symbol version, ignoring previous version.
1018
41f9cbbe
ILT
10192011-07-05 Ian Lance Taylor <iant@google.com>
1020
1021 * object.cc (Sized_relobj_file::include_section_group): Add
1022 information to comment about signature location.
1023
886288f1
ILT
10242011-07-02 Ian Lance Taylor <iant@google.com>
1025
1026 PR gold/12957
1027 * options.h (class General_options): Add -f and -F.
1028 * options.cc (General_options::finalize): Fatal error if -f/-F
1029 are used without -shared.
1030 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
1031
ae3a6d4f
ILT
10322011-07-02 Ian Lance Taylor <iant@google.com>
1033
1034 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
1035
21131061
ILT
10362011-07-01 Ian Lance Taylor <iant@google.com>
1037
1038 PR gold/12525
1039 PR gold/12952
1040 * resolve.cc (Symbol::override_base_with_special): Don't override
1041 the version if the overriding symbol has a different name.
1042 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
1043 all callers. If we give an error about an undefined version,
1044 define the base version if necessary.
1045 * dynobj.h (class Versions): Update declaration.
1046 * testsuite/weak_alias_test_5.cc: New file.
1047 * testsuite/weak_alias_test.script: New file.
1048 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
1049 and versioned_alias have the right value, and call t2.
1050 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
1051 weak_alias_test_5.so.
1052 (weak_alias_test_LDADD): Likewise.
1053 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
1054 * testsuite/Makefile.in: Rebuild.
1055
611062c0
ILT
10562011-07-01 Ian Lance Taylor <iant@google.com>
1057
1058 PR gold/12525
1059 * options.h (class General_options): Support -z notext.
1060 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
1061 -Wl,-z,notext.
1062 (two_file_shared_nonpic.so): Likewise.
1063 (two_file_shared_mixed.so): Likewise.
1064 (two_file_shared_mixed_1.so): Likewise.
1065 (weak_undef_lib_nonpic.so): Likewise.
1066 (alt/weak_undef_lib_nonpic.so): Likewise.
1067 (tls_test_shared_nonpic.so): Likewise.
1068 * testsuite/Makefile.in: Rebuild.
1069
328c7c2f
ILT
10702011-07-01 Ian Lance Taylor <iant@google.com>
1071
1072 PR gold/12525
1073 * configure.ac: Test whether static linking works, setting
1074 the automake conditional HAVE_STATIC.
1075 * testsuite/Makefile.am: Disable tests using -static if
1076 HAVE_STATIC is not true.
1077 * configure, testsuite/Makefile.in: Rebuild.
1078
02d7cd44
ILT
10792011-07-01 Ian Lance Taylor <iant@google.com>
1080
1081 PR gold/12525
1082 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
1083 Assert if we see DW_EH_PE_indirect.
1084 * target.h (Target::ehframe_datarel_base): New function.
1085 (Target::do_ehframe_datarel_base): New target function.
1086 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
1087 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
1088 function.
1089
07a60597
ILT
10902011-07-01 Ian Lance Taylor <iant@google.com>
1091
1092 PR gold/12571
1093 * options.h (class General_options): Add
1094 --ld-generated-unwind-info.
1095 * ehframe.cc (Fde::write): Add address parameter. Change all
1096 callers. If associated with PLT, fill in address and size.
1097 (Cie::set_output_offset): Only add merge mapping if there is an
1098 object.
1099 (Cie::write): Add address parameter. Change all callers.
1100 (Eh_frame::add_ehframe_for_plt): New function.
1101 * ehframe.h (class Fde): Update declarations. Move shndx_ and
1102 input_offset_ fields into union u_, with new plt field.
1103 (Fde::Fde): Adjust for new union field.
1104 (Fde::Fde) [Output_data version]: New constructor.
1105 (Fde::add_mapping): Only add merge mapping if there is an object.
1106 (class Cie): Update declarations.
1107 (class Eh_frame): Declare add_ehframe_for_plt.
1108 * layout.cc (Layout::layout_eh_frame): Break out code into
1109 make_eh_frame_section, and call it.
1110 (Layout::make_eh_frame_section): New function.
1111 (Layout::add_eh_frame_for_plt): New function.
1112 * layout.h (class Layout): Update declarations.
1113 * merge.cc (Merge_map::add_mapping): Add assertion.
1114 * i386.cc: Include "dwarf.h".
1115 (class Output_data_plt_i386): Make first_plt_entry,
1116 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
1117 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1118 and plt_eh_frame_fde.
1119 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
1120 boundary. Call add_eh_frame_for_plt if appropriate.
1121 * x86_64.cc: Include "dwarf.h".
1122 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
1123 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
1124 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1125 and plt_eh_frame_fde.
1126 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
1127 appropriate.
1128
14788a3f
ILT
11292011-06-29 Ian Lance Taylor <iant@google.com>
1130
1131 PR gold/12629
1132 * object.cc (Sized_relobj_file::layout_section): Change shdr
1133 parameter to be const.
1134 (Sized_relobj_file::layout_eh_frame_section): New function, broken
1135 out of do_layout.
1136 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
1137 appropriate. Call layout_eh_frame_section.
1138 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
1139 sections.
1140 * object.h (class Sized_relobj_file): Update declarations.
1141
6c21fce1
ILT
11422011-06-29 Ian Lance Taylor <iant@google.com>
1143
37e41b03 1144 PR gold/12652
6c21fce1
ILT
1145 * script.cc (Token::integer_value): Accept trailing M/m/K/k
1146 modifier.
1147 (Lex::gather_token): Accept trailing M/m/K/k for integers.
1148
4d5e4e62
ILT
11492011-06-29 Ian Lance Taylor <iant@google.com>
1150
1151 PR gold/12675
1152 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
1153 SHT_X86_64_UNWIND.
1154 * layout.cc (Layout::layout_eh_frame): Likewise.
1155
886f533a
ILT
11562011-06-29 Ian Lance Taylor <iant@google.com>
1157
1158 PR gold/12695
1159 * layout.cc (Layout::symtab_section_shndx): New function.
1160 * layout.h (class Layout): Declare symtab_section_shndx.
1161 * output.cc (Output_section::write_header): Call it.
1162
f3ae1b28
ILT
11632011-06-29 Ian Lance Taylor <iant@google.com>
1164
1165 PR gold/12818
1166 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
1167 symbols which are not used in a relocation.
1168
aecf301f
ILT
11692011-06-28 Ian Lance Taylor <iant@google.com>
1170
1171 PR gold/12898
1172 * layout.cc (Layout::segment_precedes): Don't crash if a linker
1173 script create indistinguishable segments.
1174 (Layout::set_segment_offsets): Use stable_sort when sorting
1175 segments. Pass this to Compare_segments constructor.
1176 * layout.h (class Layout): Make segment_precedes non-static.
1177 (class Compare_segments): Change from struct to class. Add
1178 layout_ field. Add constructor.
1179 * script-sections.cc
1180 (Script_sections::attach_sections_using_phdrs_clause): Rename
1181 local orphan to is_orphan. Don't report failure to put empty
1182 section in segment. On attachment failure, report name of
1183 section, and attach to first PT_LOAD segment.
1184
03ef7571
ILT
11852011-06-28 Ian Lance Taylor <iant@google.com>
1186
1187 PR gold/12934
1188 * target-select.cc (Target_selector::Target_selector): Add
1189 emulation parameter. Change all callers.
1190 (select_target_by_bfd_name): Rename from select_target_by_name.
1191 Change all callers.
1192 (select_target_by_emulation): New function.
1193 (supported_emulation_names): New function.
1194 * target-select.h (class Target_selector): Add emulation_ field.
1195 Update declarations.
1196 (Target_selector::recognize_by_bfd_name): Rename from
1197 recognize_by_name. Change all callers.
1198 (Target_selector::supported_bfd_names): Rename from
1199 supported_names. Change all callers.
1200 (Target_selector::recognize_by_emulation): New function.
1201 (Target_selector::supported_emulations): New function.
1202 (Target_selector::emulation): New function.
1203 (Target_selector::do_recognize_by_bfd_name): Rename from
1204 do_recognize_by_name. Change all callers.
1205 (Target_selector::do_supported_bfd_names): Rename from
1206 do_supported_names. Change all callers.
1207 (Target_selector::do_recognize_by_emulation): New function.
1208 (Target_selector::do_supported_emulations): New function.
1209 (select_target_by_bfd_name): Change name in declaration.
1210 (select_target_by_emulation): Declare.
1211 (supported_emulation_names): Declare.
1212 * parameters.cc (parameters_force_valid_target): Try to find
1213 target based on emulation from -m option.
1214 * options.h (class General_options): Change doc string for -m.
1215 * options.cc (help): Print emulations.
1216 (General_options::parse_V): Likewise.
1217 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
1218 Add emulation parameter. Change all callers.
1219
200b2bb9
ILT
12202011-06-28 Ian Lance Taylor <iant@google.com>
1221
1222 * target.h (class Target): Add osabi_ field.
1223 (Target::osabi): New function.
1224 (Target::set_osabi): New function.
1225 (Target::Target): Initialize osabi_.
1226 (Target::do_adjust_elf_header): Make pure virtual.
1227 (Sized_target::do_adjust_elf_header): Declare.
1228 * target.cc (Sized_target::do_adjust_elf_header): New function.
1229 (class Sized_target): Instantiate all versions.
1230 * freebsd.h (class Target_freebsd): Remove.
1231 (Target_selector_freebsd::do_recognize): Call set_osabi on
1232 Target.
1233 (Target_selector_freebsd::do_recognize_by_name): Likewise.
1234 (Target_selector_freebsd::set_osabi): Remove.
1235 * i386.cc (class Target_i386): Inherit from Sized_target rather
1236 than Target_freebsd.
1237 * x86_64.cc (class Target_x86_64): Likewise.
1238
b3ce541e
ILT
12392011-06-28 Ian Lance Taylor <iant@google.com>
1240
1241 * target.h (Target::can_check_for_function_pointers): Rewrite.
1242 Make non-virtual.
1243 (Target::can_icf_inline_merge_sections): Likewise.
1244 (Target::section_may_have_icf_unsafe_poineters): Likewise.
1245 (Target::Target_info): Add can_icf_inline_merge_sections field.
1246 (Target::do_can_check_for_function_pointers): New virtual
1247 function.
1248 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
1249 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
1250 from can_check_for_function_pointers, move in file.
1251 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
1252 section_may_have_icf_unsafe_poineters, move in file.
1253 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
1254 * i386.cc (Target_i386::do_can_check_for_function_pointers):
1255 Rename from can_check_for_function_pointers, move in file.
1256 (Target_i386::can_icf_inline_merge_sections): Remove.
1257 (Target_i386::i386_info): Initialize
1258 can_icf_inline_merge_sections.
1259 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
1260 Initialize can_icf_inline_merge_sections.
1261 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
1262 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
1263 Rename from can_check_for_function_pointers, move in file.
1264 (Target_x86_64::can_icf_inline_merge_sections): Remove.
1265 (Target_x86_64::x86_64_info): Initialize
1266 can_icf_inline_merge_sections.
1267 * testsuite/testfile.cc (Target_test::test_target_info):
1268 Likewise.
1269 * icf.cc (get_section_contents): Correct formatting.
1270
6d1c4efb
ILT
12712011-06-27 Ian Lance Taylor <iant@google.com>
1272
1273 * symtab.cc (Symbol::versioned_name): New function.
1274 (Symbol_table::add_to_final_symtab): Use versioned_name when
1275 appropriate.
1276 (Symbol_table::sized_write_symbol): Likewise.
1277 * symtab.h (class Symbol): Declare versioned_name.
1278 * stringpool.h (class Stringpool_template): Add variant of add
1279 which takes a std::basic_string.
1280 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
1281 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
1282 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
1283 (ver_test_12.o): New target.
1284 * testsuite/Makefile.in: Rebuild.
1285
57eb9b50
DK
12862011-06-27 Doug Kwan <dougkwan@google.com>
1287
1288 * arm.cc (Arm_relocate_functions::thm_jump8,
1289 Arm_relocate_functions::thm_jump11): Use a wider signed
1290 type to compute offset.
1291 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
1292 arm_thm_jump8.
1293 * testsuite/Makefile.in: Regenerate.
1294 * testsuite/arm_branch_in_range.sh: Check test results of
1295 arm_thm_jump11 and arm_thm_jump8.
1296 * testsuite/arm_thm_jump11.s: New test source file.
1297 * testsuite/arm_thm_jump11.t: New linker script.
1298 * testsuite/arm_thm_jump8.s: New test source file.
1299 * testsuite/arm_thm_jump8.t: New linker script.
1300
487b39df
ILT
13012011-06-24 Ian Lance Taylor <iant@google.com>
1302
1303 * layout.cc: Include "object.h".
1304 (ctors_sections_in_init_array): New static variable.
1305 (Layout::is_ctors_in_init_array): New function.
1306 (Layout::layout): Add entry to ctors_sections_in_init_array if
1307 appropriate.
1308 * layout.h (class Layout): Declare is_ctors_in_init_array.
1309 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
1310 is_ctors_reverse_view is set.
1311 (Sized_relobj_file::write_sections): Add layout parameter. Change
1312 all callers. Set is_ctors_reverse_view field of View_size.
1313 (Sized_relobj_file::reverse_words): New function.
1314 * object.h (Sized_relobj_file::View_size): Add
1315 is_ctors_reverse_view field.
1316 (class Sized_relobj_file): Update declarations.
1317 * testsuite/initpri3.c: New test.
1318 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
1319 initpri3b.
1320 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
1321 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
1322 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
1323 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
1324 * testsuite/Makefile.in: Rebuild.
1325
472076e4
CC
13262011-06-24 Cary Coutant <ccoutant@google.com>
1327
1328 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
1329 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
1330 (debug_msg_cdebug.err): New targets.
1331 * testsuite/Makefile.in: Regenerate.
1332 * testsuite/debug_msg.sh: Check output of link with compressed debug.
1333 Fix checks for link with shared library.
1334
a60af0db
DK
13352011-06-24 Doug Kwan <dougkwan@google.com>
1336
1337 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
1338 skip empty text sections.
1339 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
1340
5393d741
ILT
13412011-06-22 Ian Lance Taylor <iant@google.com>
1342
1343 PR gold/12910
1344 * options.h (class General_options): Add --ctors-in-init-array.
1345 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
1346 friends as SHT_PROGBITS for merging sections.
1347 (Layout::layout): Remove special handling of .init_array and
1348 friends. Don't sort if doing relocatable link. Sort for .ctors
1349 and .dtors if ctors_in_init_array.
1350 (Layout::make_output_section): Force correct section types for
1351 .init_array and friends. Don't sort if doing relocatable link,
1352 Don't sort .ctors and .dtors if ctors_in_init_array.
1353 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
1354 (Layout::output_section_name): Add relobj parameter. Change all
1355 callers. Handle .ctors. and .dtors. in code rather than table.
1356 Handle .ctors and .dtors if ctors_in_init_array.
1357 (Layout::match_file_name): New function, moved from output.cc.
1358 * layout.h (class Layout): Update declarations.
1359 * output.cc: Include "layout.h".
1360 (Input_section_sort_entry::get_priority): New function.
1361 (Input_section_sort_entry::match_file_name): Just call
1362 Layout::match_file_name.
1363 (Output_section::Input_section_sort_init_fini_compare::operator()):
1364 Handle .ctors and .dtors. Sort by explicit priority rather than
1365 by name.
1366 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
1367 * testsuite/initpri2.c: New test.
1368 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
1369 (check_PROGRAMS): Add initpri2.
1370 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
1371 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
1372 * configure, testsuite/Makefile.in: Rebuild.
1373
e1f74f98
ILT
13742011-06-19 Ian Lance Taylor <iant@google.com>
1375
1376 PR gold/12880
1377 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
1378 .interp section to a PT_INTERP segment even if we have seen a
1379 --dynamic-linker option. Don't do it if we have seen a PHDRS
1380 clause in a linker script.
1381 (Layout::finalize): Don't create a .interp section if we've
1382 already create a PT_INTERP segment.
1383 (Layout::create_interp): Always call choose_output_section (revert
1384 patch of 2011-06-17). Don't create PT_INTERP segment.
1385 * script-sections.cc
1386 (Script_sections::create_note_and_tls_segments): Add a .interp
1387 section to a PT_INTERP segment even if we have seen a
1388 --dynamic-linker option.
1389
766f91bb
ILT
13902011-06-18 Ian Lance Taylor <iant@google.com>
1391
1392 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
1393 merely because a non-PT_LOAD segment has a dynamic reloc.
1394
0d212c3a
ILT
13952011-06-18 Ian Lance Taylor <iant@google.com>
1396
1397 * layout.cc (Layout::finish_dynamic_section): Don't create
1398 DT_FLAGS entry if not needed.
1399
911a5072
ILT
14002011-06-18 Ian Lance Taylor <iant@google.com>
1401
1402 PR gold/12745
1403 * layout.cc (Layout::layout_eh_frame): Correct handling of
1404 writable .eh_frame section.
1405
534b4e5f
ILT
14062011-06-17 Ian Lance Taylor <iant@google.com>
1407
1408 PR gold/12893
1409 * resolve.cc (Symbol_table::resolve): Don't give an error if a
1410 symbol is redefined with the exact same object and value.
1411
10b4f102
ILT
14122011-06-17 Ian Lance Taylor <iant@google.com>
1413
1414 PR gold/12880
1415 * layout.h (class Layout): Add interp_segment_ field.
1416 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
1417 (Layout::attach_allocated_section_to_segment): If making shared
1418 library, put .interp section in PT_INTERP segment.
1419 (Layout::finalize): Also call create_interp if -dynamic-linker
1420 option was used.
1421 (Layout::create_interp): Assert that there is no PT_INTERP
1422 segment. If not using a SECTIONS clause, use make_output_section.
1423 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
1424 * script-sections.cc
1425 (Script_sections::create_note_and_tls_segments): If making shared
1426 library, put .interp section in PT_INTERP segment.
1427
a29b0dad
ILT
14282011-06-17 Ian Lance Taylor <iant@google.com>
1429
e588ea8d
ILT
1430 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
1431 when making a shared library.
1432
14332011-06-17 Ian Lance Taylor <iant@google.com>
1434
1435 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
1436 parameter. Change all callers. Don't issue warning about PC32
1437 against locally defined symbol.
a29b0dad 1438
9d3b0698
ILT
14392011-06-16 Ian Lance Taylor <iant@google.com>
1440
1441 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
1442 occurs in same object.
1443
85b0f90c
AM
14442011-06-14 Alan Modra <amodra@gmail.com>
1445
1446 * po/POTFILES.in: Regenerate.
1447
a94907d9
ILT
14482011-06-09 Ian Lance Taylor <iant@google.com>
1449
1450 * script-sections.cc
1451 (Orphan_output_section::set_section_addresses): For a relocatable
1452 link set address to 0.
1453
4fb3a1c3
CC
14542011-06-09 Cary Coutant <ccoutant@google.com>
1455
1456 PR gold/12804
1457 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
1458 used with --compress-debug-sections.
1459 * gold/object.cc (Sized_relobj_file::do_layout): Report
1460 uncompressed size of compressed input sections.
1461
61220854
CC
14622011-06-08 Cary Coutant <ccoutant@google.com>
1463
1464 PR gold/12804
1465 * testsuite/two_file_test_2_v1.cc: Change initialization of
1466 v2 to keep it in .data.
1467
e6455dfb
CC
14682011-06-07 Cary Coutant <ccoutant@google.com>
1469
1470 * common.cc (Symbol_table::do_allocate_commons_list): Call
1471 gold_fallback.
1472 * errors.cc (Errors::fatal): Adjust call to gold_exit.
1473 (Errors::fallback): New function.
1474 (gold_fallback): New function.
1475 * errors.h (Errors::fallback): New function.
1476 * gold.cc (gold_exit): Change status parameter to enum; adjust
1477 all callers.
1478 (queue_initial_tasks): Call gold_fallback.
1479 * gold.h: Include cstdlib.
1480 (Exit_status): New enum type.
1481 (gold_exit): Change status parameter to enum.
1482 (gold_fallback): New function.
1483 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
1484 (Layout::create_symtab_sections): Likewise.
1485 (Layout::create_shdrs): Likewise.
1486 * main.cc (main): Adjust call to gold_exit.
1487 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
1488 (Output_data_got::add_got_entry_pair): Likewise.
1489 (Output_section::add_input_section): Likewise.
1490 (Output_section::add_output_section_data): Likewise.
1491 (Output_segment::set_section_list_addresses): Likewise.
1492 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
1493
fb0e076f
CC
14942011-06-07 Cary Coutant <ccoutant@google.com>
1495
1496 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
1497 for incremental links.
1498 * output.cc (Output_segment::set_section_list_addresses): Remove
1499 FIXME and test for TLS or BSS.
1500
a5ee4d5d
CC
15012011-06-07 Cary Coutant <ccoutant@google.com>
1502
1503 * testsuite/Makefile.am: Add incremental_copy_test,
1504 incremental_common_test_1.
1505 * testsuite/Makefile.in: Regenerate.
1506 * testsuite/common_test_1_v1.c: New source file.
1507 * testsuite/common_test_1_v2.c: New source file.
1508 * testsuite/copy_test_v1.cc: New source file.
1509
5146f448
CC
15102011-06-07 Cary Coutant <ccoutant@google.com>
1511
1512 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
1513 update, allocate common from bss section's free list.
1514 * incremental-dump.cc (dump_incremental_inputs): Print flag for
1515 linker-defined symbols.
1516 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
1517 Skip GOT and PLT entries that are no longer referenced.
1518 (Output_section_incremental_inputs::write_info_blocks): Mark
1519 linker-defined symbols.
1520 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
1521 * output.cc (Output_section::allocate): New function.
1522 * output.h (Output_section::allocate): New function.
1523 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
1524 linker-defined symbols.
1525 (Symbol::override_base_with_special): Copy is_predefined_ flag.
1526 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
1527 (Symbol::init_base_output_data): Likewise.
1528 (Symbol::init_base_output_segment): Likewise.
1529 (Symbol::init_base_constant): Likewise.
1530 (Sized_symbol::init_output_data): Likewise.
1531 (Sized_symbol::init_output_segment): Likewise.
1532 (Sized_symbol::init_constant): Likewise.
1533 (Symbol_table::do_define_in_output_data): Likewise.
1534 (Symbol_table::do_define_in_output_segment): Likewise.
1535 (Symbol_table::do_define_as_constant): Likewise.
1536 * symtab.h (Symbol::is_predefined): New function.
1537 (Symbol::init_base_output_data): Add is_predefined parameter.
1538 (Symbol::init_base_output_segment): Likewise.
1539 (Symbol::init_base_constant): Likewise.
1540 (Symbol::is_predefined_): New data member.
1541 (Sized_symbol::init_output_data): Add is_predefined parameter.
1542 (Sized_symbol::init_output_segment): Likewise.
1543 (Sized_symbol::init_constant): Likewise.
1544 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
1545
26d3c67d
CC
15462011-06-07 Cary Coutant <ccoutant@google.com>
1547
1548 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
1549 instead of emit_copy_reloc.
1550 (Copy_relocs::emit_copy_reloc): Refactor.
1551 (Copy_relocs::make_copy_reloc): New function.
1552 (Copy_relocs::add_copy_reloc): Remove.
1553 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
1554 section.
1555 (Copy_relocs::make_copy_reloc): New function.
1556 (Copy_relocs::add_copy_reloc): Remove.
1557 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
1558 unchanged input files.
1559 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
1560 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
1561 Reserve BSS space for COPY relocations.
1562 (Sized_incremental_binary::do_emit_copy_relocs): New function.
1563 (Output_section_incremental_inputs::write_info_blocks): Record
1564 whether a symbol is copied from a shared object.
1565 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
1566 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
1567 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
1568 (Incremental_input_entry_reader::get_output_symbol_index): Add
1569 is_copy parameter.
1570 (Incremental_binary::emit_copy_relocs): New function.
1571 (Incremental_binary::do_emit_copy_relocs): New function.
1572 (Sized_incremental_binary::Sized_incremental_binary): Initialize
1573 new data member.
1574 (Sized_incremental_binary::add_copy_reloc): New function.
1575 (Sized_incremental_binary::do_emit_copy_relocs): New function.
1576 (Sized_incremental_binary::Copy_reloc): New struct.
1577 (Sized_incremental_binary::Copy_relocs): New typedef.
1578 (Sized_incremental_binary::copy_relocs_): New data member.
1579 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
1580 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
1581 * target.h (Sized_target::emit_copy_reloc): New function.
1582 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
1583
7cdb37d9
CC
15842011-06-02 Cary Coutant <ccoutant@google.com>
1585
1586 PR gold/12163
1587 * gold/archive.cc (Archive::Archive): Initialize new data member.
1588 (Archive::include_all_members): Return if archive has already been
1589 included.
1590 * gold/archive.h (Archive::include_all_members_): New data member.
1591
cc643b88
NC
15922011-06-02 Nick Clifton <nickc@redhat.com>
1593
1594 * dynobj.h: Fix spelling mistake in comment.
1595 * output.cc: Likewise.
1596
f62a3ca7
DK
15972011-05-31 Doug Kwan <dougkwan@google.com>
1598 Asier Llano
1599
1600 PR gold/12826
cc643b88 1601 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
1602 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
1603 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
1604 redundant arm_exidx_test.so.
1605 * testsuite/Makefile.in: Regenerate.
1606 (check_SCRIPTS): Add pr12826.sh
1607 (check_DATA): Add pr12826.stdout
1608 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
1609 * testsuite/pr12826.sh: New file.
1610 * testsuite/pr12826_1.s: Ditto.
1611 * testsuite/pr12826_1.s: Ditto.
1612
8dbe1edc
ILT
16132011-05-30 Ian Lance Taylor <iant@google.com>
1614
1615 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
1616 sections.
1617
c49875be
ILT
16182011-05-29 Ian Lance Taylor <iant@google.com>
1619
1620 PR gold/12804
1621 * testsuite/Makefile.am: Use different file name for two_file_test
1622 temporary file for each incremental test.
1623 * testsuite/Makefile.in: Rebuild.
1624
69d53f7a
ILT
16252011-05-29 Ian Lance Taylor <iant@google.com>
1626
1627 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
1628 binary input file is empty.
1629
41d0ab5f
ILT
16302011-05-27 Ian Lance Taylor <iant@google.com>
1631
1632 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
1633 (ver_test_9.so): Likewise.
1634 * testsuite/Makefile.in: Rebuild.
1635
89d8a36b
CC
16362011-05-26 Cary Coutant <ccoutant@google.com>
1637
1638 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
1639 * incremental.cc (Incremental_inputs::report_input_section): Fix
1640 comment, indentation.
1641 (Incremental_inputs::report_comdat_group): New function.
1642 (Output_section_incremental_inputs::set_final_data_size): Adjust size
1643 of data for incremental input file entry.
1644 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
1645 group count, COMDAT group signatures.
1646 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
1647 an unchanged input file.
1648 * incremental.h (Incremental_object_entry::Incremental_object_entry):
1649 Initialize new data member.
1650 (Incremental_object_entry::add_comdat_group): New function.
1651 (Incremental_object_entry::get_comdat_group_count): New function.
1652 (Incremental_object_entry::get_comdat_signature_key): New function.
1653 (Incremental_object_entry::groups_): New data member.
1654 (Incremental_inputs::report_comdat_group): New function.
1655 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
1656 data for incremental input file entry.
1657 (Incremental_input_entry_reader::get_comdat_group_count): New function.
1658 (Incremental_input_entry_reader::get_input_section): Adjust size of
1659 data for incremental input file entry.
1660 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
1661 (Incremental_input_entry_reader::get_comdat_group_signature): New
1662 function.
1663 * object.cc (Sized_relobj::include_section_group): Report kept
1664 COMDAT groups for incremental links.
1665
1706a06f
ILT
16662011-05-24 David Meyer <pdox@google.com>
1667
1668 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
1669 with name parameter. Add found_name parameter.
1670 * fileread.cc (Input_file::find_file): Adjust code accordingly.
1671 * dirsearch.h (class Dirsearch): Update declaration.
1672
a10ae760
ILT
16732011-05-24 Ian Lance Taylor <iant@google.com>
1674
1675 * archive.cc (Library_base::should_include_member): Pull in object
1676 from archive if it defines the entry symbol.
1677 * parameters.cc (Parameters::entry): New function.
1678 * parameters.h (class Parameters): Declare entry.
1679 * output.h (class Output_file_header): Remove entry_ field.
1680 * output.cc (Output_file_header::Output_file_header): Remove entry
1681 parameter. Change all callers.
1682 (Output_file_header::entry): Use parameters->entry.
1683 * gold.cc (queue_middle_tasks): Likewise.
1684 * plugin.cc (Plugin_hook::run): Likewise.
1685
aa92d6ed
CC
16862011-05-24 Cary Coutant <ccoutant@google.com>
1687
1688 * gold.cc (queue_initial_tasks): Pass incremental base filename
1689 to Output_file::open_base_file; don't print error message.
1690 * incremental-dump.cc (main): Adjust call to
1691 Output_file::open_for_modification.
1692 * incremental-dump.cc (main): Likewise.
1693 * incremental.cc (Incremental_inputs::report_command_line):
1694 Ignore --incremental-base option when comparing command lines.
1695 Ignore parameter when given as separate argument.
1696 * options.h (class General_options): Add --incremental-base.
1697 * output.cc (Output_file::Output_file):
1698 (Output_file::open_base_file): Add base_name and writable parameters;
1699 read base file into new file; print error message here.
1700 (Output_file::map_no_anonymous): Add writable parameter; adjust all
1701 callers.
1702 * output.h (Output_file::open_for_modification): Rename to...
1703 (Output_file::open_base_file): ...this; add base_name and
1704 writable parameters; adjust all callers.
1705 (Output_file::map_no_anonymous): Add writable parameter; adjust all
1706 callers.
1707 * testsuite/Makefile.am (incremental_test_4): Test
1708 --incremental-base.
1709 * testsuite/Makefile.in: Regenerate.
1710
2eedd706
CC
17112011-05-24 Cary Coutant <ccoutant@google.com>
1712
1713 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
1714 incremental_test_4.
1715 * testsuite/Makefile.in: Regenerate.
1716 * testsuite/two_file_test_1_v1.cc: New test source file.
1717 * testsuite/two_file_test_1b_v1.cc: New test source file.
1718 * testsuite/two_file_test_2_v1.cc: New test source file.
1719
0f1c85a6
CC
17202011-05-24 Cary Coutant <ccoutant@google.com>
1721
1722 * dynobj.h (Dynobj::do_dynobj): New function.
1723 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
1724 flag and soname for shared objects.
1725 * incremental.cc (Incremental_inputs::report_object): Make
1726 either Incremental_object_entry or Incremental_dynobj_entry; add
1727 soname to string table.
1728 (Incremental_inputs::report_input_section): Add assertion.
1729 (Output_section_incremental_inputs::set_final_data_size): Adjust
1730 type of input file entry for shared libraries; adjust size of
1731 shared library info entry.
1732 (Output_section_incremental_inputs::write_input_files): Write
1733 as_needed flag for shared libraries.
1734 (Output_section_incremental_inputs::write_info_blocks): Adjust type
1735 of input file entry for shared libraries; write soname.
1736 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
1737 soname from incremental info.
1738 * incremental.h (enum Incremental_input_flags): Add
1739 INCREMENTAL_INPUT_AS_NEEDED.
1740 (Incremental_input_entry::Incremental_input_entry): Initialize new
1741 data member.
1742 (Incremental_input_entry::set_as_needed): New function.
1743 (Incremental_input_entry::as_needed): New function.
1744 (Incremental_input_entry::do_dynobj_entry): New function.
1745 (Incremental_input_entry::as_needed_): New data member.
1746 (Incremental_object_entry::Incremental_object_entry): Don't check
1747 for shared library.
1748 (Incremental_object_entry::do_type): Likewise.
1749 (class Incremental_dynobj_entry): New class.
1750 (Incremental_input_entry_reader::as_needed): New function.
1751 (Incremental_input_entry_reader::get_soname): New function.
1752 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
1753 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
1754 size of shared library info entry.
1755 * layout.cc (Layout::finish_dynamic_section): Don't test for
1756 incremental link when adding DT_NEEDED entries.
1757 * object.h (Object::Object): Initialize new data member.
1758 (Object::dynobj): New function.
1759 (Object::set_as_needed): New function.
1760 (Object::as_needed): New function.
1761 (Object::do_dynobj): New function.
1762 (Object::as_needed_): New data member.
1763
6fa2a40b
CC
17642011-05-24 Cary Coutant <ccoutant@google.com>
1765
1766 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
1767 info; adjust display of GOT entries.
1768 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
1769 vector of input objects; remove file_status_.
1770 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
1771 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
1772 got_plt reader; call target hooks to reserve GOT entries.
1773 (Output_section_incremental_inputs::set_final_data_size): Adjust size
1774 of input file info header and GOT info entry.
1775 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
1776 relocation info.
1777 (Got_plt_view_info::got_descriptor): Remove.
1778 (Got_plt_view_info::sym_index): New data member.
1779 (Got_plt_view_info::input_index): New data member.
1780 (Local_got_offset_visitor::visit): Write input file index.
1781 (Global_got_offset_visitor::visit): Write 0 for input file index.
1782 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
1783 with sym_index and input_index.
1784 (Output_section_incremental_inputs::write_got_plt): Adjust size of
1785 incremental info GOT entry; replace got_descriptor with input_index.
1786 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
1787 map from input file index to object.
1788 (Sized_relobj_incr::do_layout): Replace direct data member reference
1789 with accessor function.
1790 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
1791 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
1792 Adjust size of input file info header.
1793 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
1794 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
1795 (Incremental_input_entry_reader::get_input_section): Adjust size of
1796 input file info header.
1797 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
1798 of incremental info GOT entry.
1799 (Incremental_got_plt_reader::get_got_desc): Remove.
1800 (Incremental_got_plt_reader::get_got_symndx): New function.
1801 (Incremental_got_plt_reader::get_got_input_index): New function.
1802 (Sized_incremental_binary::Sized_incremental_binary): Remove
1803 file_status_; add input_objects_.
1804 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
1805 (Sized_incremental_binary::set_file_is_unchanged): Remove.
1806 (Sized_incremental_binary::file_is_unchanged): Remove.
1807 (Sized_incremental_binary::set_input_object): New function.
1808 (Sized_incremental_binary::input_object): New function.
1809 (Sized_incremental_binary::file_status_): Remove.
1810 (Sized_incremental_binary::input_objects_): New data member.
1811 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
1812 references.
1813 (Sized_relobj_incr::invalid_address): Move to base class.
1814 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
1815 class.
1816 (Sized_relobj_incr::do_output_section_offset): Likewise.
1817 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
1818 (Sized_relobj_incr::section_offsets_): Likewise.
1819 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
1820 function.
1821 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
1822 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
1823 with accessor function.
1824 (Sized_relobj_file::do_layout): Likewise.
1825 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
1826 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
1827 (Sized_relobj_file::compute_final_local_value): Replace refs to
1828 section_offsets_ with accessor function.
1829 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
1830 * object.h (Relobj::Relobj): Initialize new data members.
1831 (Relobj::add_dyn_reloc): New function.
1832 (Relobj::first_dyn_reloc): New function.
1833 (Relobj::dyn_reloc_count): New function.
1834 (Relobj::first_dyn_reloc_): New data member.
1835 (Relobj::dyn_reloc_count_): New data member.
1836 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
1837 references.
1838 (Sized_relobj::Address): New typedef.
1839 (Sized_relobj::invalid_address): Move here from child class.
1840 (Sized_relobj::Sized_relobj): Initialize new data members.
1841 (Sized_relobj::sized_relobj): New function.
1842 (Sized_relobj::is_output_section_offset_invalid): Move here from
1843 child class.
1844 (Sized_relobj::get_output_section_offset): Likewise.
1845 (Sized_relobj::local_has_got_offset): Likewise.
1846 (Sized_relobj::local_got_offset): Likewise.
1847 (Sized_relobj::set_local_got_offset): Likewise.
1848 (Sized_relobj::do_for_all_local_got_entries): Likewise.
1849 (Sized_relobj::clear_got_offsets): New function.
1850 (Sized_relobj::section_offsets): Move here from child class.
1851 (Sized_relobj::do_output_section_offset): Likewise.
1852 (Sized_relobj::do_set_section_offset): Likewise.
1853 (Sized_relobj::Local_got_offsets): Likewise.
1854 (Sized_relobj::local_got_offsets_): Likewise.
1855 (Sized_relobj::section_offsets_): Likewise.
1856 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
1857 references.
1858 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
1859 class.
1860 (Sized_relobj_file::sized_relobj): New function
1861 (Sized_relobj_file::local_has_got_offset): Move to base class.
1862 (Sized_relobj_file::local_got_offset): Likewise.
1863 (Sized_relobj_file::set_local_got_offset): Likewise.
1864 (Sized_relobj_file::get_output_section_offset): Likewise.
1865 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
1866 (Sized_relobj_file::do_output_section_offset): Likewise.
1867 (Sized_relobj_file::do_set_section_offset): Likewise.
1868 (Sized_relobj_file::Local_got_offsets): Likewise.
1869 (Sized_relobj_file::local_got_offsets_): Likewise.
1870 (Sized_relobj_file::section_offsets_): Likewise.
1871 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
1872 (all constructors).
1873 (set_needs_dynsym_index): Convert relobj to derived class pointer.
1874 (Output_reloc::get_symbol_index): Likewise.
1875 (Output_reloc::local_section_offset): Likewise.
1876 (Output_reloc::get_address): Likewise.
1877 (Output_reloc::symbol_value): Likewise.
1878 (Output_data_got::reserve_slot): Move to class definition.
1879 (Output_data_got::reserve_local): New function.
1880 (Output_data_got::reserve_slot_for_global): Remove.
1881 (Output_data_got::reserve_global): New function.
1882 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
1883 (all constructors, two instantiations).
1884 (Output_reloc::get_relobj): New function (two instantiations).
1885 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
1886 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
1887 (Output_data_reloc::add_global): Adjust type of relobj.
1888 (Output_data_reloc::add_global_relative): Likewise.
1889 (Output_data_reloc::add_symbolless_global_addend): Likewise.
1890 (Output_data_reloc::add_local): Likewise.
1891 (Output_data_reloc::add_local_relative): Likewise.
1892 (Output_data_reloc::add_symbolless_local_addend): Likewise.
1893 (Output_data_reloc::add_local_section): Likewise.
1894 (Output_data_reloc::add_output_section): Likewise.
1895 (Output_data_reloc::add_absolute): Likewise.
1896 (Output_data_reloc::add_target_specific): Likewise.
1897 (Output_data_got::reserve_slot): Move definition here.
1898 (Output_data_got::reserve_local): New function.
1899 (Output_data_got::reserve_global): New function.
1900 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
1901 section_offsets_ with accessor function.
1902 (Sized_relobj_file::write_sections): Likewise.
1903 (Sized_relobj_file::do_relocate_sections): Likewise.
1904 * target.h (Sized_target::reserve_local_got_entry): New function.
1905 (Sized_target::reserve_global_got_entry): New function.
1906 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
1907 (Target_x86_64::reserve_global_got_entry): New function.
1908 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
1909
4829d394
CC
19102011-05-23 Cary Coutant <ccoutant@google.com>
1911
1912 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
1913 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
1914 bit when checking got_type.
1915 * incremental.cc (Sized_incremental_binary::setup_readers):
1916 Store symbol table and string table locations; initialize bit vector
1917 of file status flags.
1918 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
1919 unchanged files.
1920 (Sized_incremental_binary::do_process_got_plt): New function.
1921 (Sized_incremental_binary::get_symtab_view): Use stored locations.
1922 (Output_section_incremental_inputs::set_final_data_size): Record
1923 file index for each input file.
1924 (Output_section_incremental_inputs::write_got_plt): Store file index
1925 instead of input entry offset for each GOT entry.
1926 * incremental.h
1927 (Incremental_input_entry::Incremental_input_entry): Initialize new
1928 data member.
1929 (Incremental_input_entry::set_offset): Store file index.
1930 (Incremental_input_entry::get_file_index): New function.
1931 (Incremental_input_entry::file_index_): New data member.
1932 (Incremental_binary::process_got_plt): New function.
1933 (Incremental_binary::do_process_got_plt): New function.
1934 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
1935 data members.
1936 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
1937 (Sized_incremental_binary::set_file_is_unchanged): New function.
1938 (Sized_incremental_binary::file_is_unchanged): New function.
1939 (Sized_incremental_binary::do_process_got_plt): New function.
1940 (Sized_incremental_binary::file_status_): New data member.
1941 (Sized_incremental_binary::main_symtab_loc_): New data member.
1942 (Sized_incremental_binary::main_strtab_loc_): New data member.
1943 * output.cc (Output_data_got::Got_entry::write): Add case
1944 RESERVED_CODE.
1945 (Output_data_got::add_global): Call add_got_entry.
1946 (Output_data_got::add_global_plt): Likewise.
1947 (Output_data_got::add_global_with_rel): Likewise.
1948 (Output_data_got::add_global_with_rela): Likewise.
1949 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
1950 (Output_data_got::add_global_pair_with_rela): Likewise.
1951 (Output_data_got::add_local): Call add_got_entry.
1952 (Output_data_got::add_local_plt): Likewise.
1953 (Output_data_got::add_local_with_rel): Likewise.
1954 (Output_data_got::add_local_with_rela): Likewise.
1955 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
1956 (Output_data_got::add_local_pair_with_rela): Likewise.
1957 (Output_data_got::reserve_slot): New function.
1958 (Output_data_got::reserve_slot_for_global): New function.
1959 (Output_data_got::add_got_entry): New function.
1960 (Output_data_got::add_got_entry_pair): New function.
1961 (Output_section::add_output_section_data): Edit FIXME.
1962 * output.h
1963 (Output_section_data_build::Output_section_data_build): New
1964 constructor with size parameter.
1965 (Output_data_space::Output_data_space): Likewise.
1966 (Output_data_got::Output_data_got): Initialize new data member; new
1967 constructor with size parameter.
1968 (Output_data_got::add_constant): Call add_got_entry.
1969 (Output_data_got::reserve_slot): New function.
1970 (Output_data_got::reserve_slot_for_global): New function.
1971 (class Output_data_got::Got_entry): Add RESERVED_CODE.
1972 (Output_data_got::add_got_entry): New function.
1973 (Output_data_got::add_got_entry_pair): New function.
1974 (Output_data_got::free_list_): New data member.
1975 * target.h (Sized_target::init_got_plt_for_update): New function.
1976 (Sized_target::register_global_plt_entry): New function.
1977 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
1978 Initialize new data member; call init; add constructor with PLT count.
1979 (Output_data_plt_x86_64::init): New function.
1980 (Output_data_plt_x86_64::add_relocation): New function.
1981 (Output_data_plt_x86_64::reserve_slot): New function.
1982 (Output_data_plt_x86_64::free_list_): New data member.
1983 (Target_x86_64::init_got_plt_for_update): New function.
1984 (Target_x86_64::register_global_plt_entry): New function.
1985 (Output_data_plt_x86_64::add_entry): Allocate from free list for
1986 incremental updates.
1987 (Output_data_plt_x86_64::add_relocation): New function.
1988 * testsuite/object_unittest.cc (Object_test): Set default options.
1989
ec69d6da
ILT
19902011-05-16 Ian Lance Taylor <iant@google.com>
1991
1992 * options.h (class General_options): Make -i a synonym for -r.
1993
732e31de
ILT
19942011-05-16 Ian Lance Taylor <iant@google.com>
1995
1996 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
1997
403676b5
CC
19982011-05-10 Cary Coutant <ccoutant@google.com>
1999
2000 * object.cc (Sized_relobj::do_count_local_symbols): Check for
2001 strip_all (-s).
2002
5b7b7d6e
ILT
20032011-05-06 Ian Lance Taylor <iant@google.com>
2004
2005 * layout.cc (Layout::layout): If the output section flags change,
2006 update the ordering.
2007
f0f9babf
CC
20082011-04-25 Cary Coutant <ccoutant@google.com>
2009
2010 * incremental-dump.cc (dump_incremental_inputs): Print local
2011 symbol info for each input file.
2012 * incremental.cc
2013 (Output_section_incremental_inputs::set_final_data_size): Add local
2014 symbol info to input file entries in incremental info.
2015 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2016 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
2017 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
2018 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
2019 implementation.
2020 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
2021 (Sized_incr_relobj::do_relocate): Write the local symbols.
2022 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
2023 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
2024 Adjust size of input file header.
2025 (Incremental_inputs_reader::get_local_symbol_offset): New function.
2026 (Incremental_inputs_reader::get_local_symbol_count): New function.
2027 (Incremental_inputs_reader::get_input_section): Adjust size of input
2028 file header.
2029 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
2030 (Sized_incr_relobj::This): New typedef.
2031 (Sized_incr_relobj::sym_size): New const data member.
2032 (Sized_incr_relobj::Local_symbol): New struct.
2033 (Sized_incr_relobj::do_output_local_symbol_count): New function.
2034 (Sized_incr_relobj::do_local_symbol_offset): New function.
2035 (Sized_incr_relobj::local_symbol_count_): New data member.
2036 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
2037 (Sized_incr_relobj::local_symbol_index_): New data member.
2038 (Sized_incr_relobj::local_symbol_offset_): New data member.
2039 (Sized_incr_relobj::local_dynsym_offset_): New data member.
2040 (Sized_incr_relobj::local_symbols_): New data member.
2041 * object.h (Relobj::output_local_symbol_count): New function.
2042 (Relobj::local_symbol_offset): New function.
2043 (Relobj::do_output_local_symbol_count): New function.
2044 (Relobj::do_local_symbol_offset): New function.
2045 (Sized_relobj::do_output_local_symbol_count): New function.
2046 (Sized_relobj::do_local_symbol_offset): New function.
2047
d0a9ace3
ILT
20482011-04-22 Vladimir Simonov <sv@sw.ru>
2049
2050 * descriptors.cc (set_close_on_exec): New function.
2051 (Descriptors::open): Use set_close_on_exec.
2052 * output.cc (S_ISLNK): Define if not defined.
2053
94a3fc8b
CC
20542011-04-22 Cary Coutant <ccoutant@google.com>
2055
2056 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2057 global symbol map.
2058 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2059 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
2060 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
2061 relocations.
2062 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
2063 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
2064 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
2065 * incremental.h
2066 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
2067 function.
2068 (Incremental_binary::apply_incremental_relocs): New function.
2069 (Incremental_binary::do_apply_incremental_relocs): New function.
2070 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2071 data member.
2072 (Sized_incremental_binary::add_global_symbol): New function.
2073 (Sized_incremental_binary::global_symbol): New function.
2074 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2075 (Sized_incremental_binary::symbol_map_): New data member.
2076 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
2077 * target.h (Sized_target::apply_relocation): New function.
2078 * target-reloc.h (apply_relocation): New function.
2079 * x86_64.cc (Target_x86_64::apply_relocation): New function.
2080
c87e4302
DK
20812011-04-22 Doug Kwan <dougkwan@google.com>
2082
2083 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
2084 flag of a SHT_ARM_EXIDX section.
2085 * testsuite/Makefile.am (arm_exidx_test): New test rules.
2086 * testsuite/Makefile.in: Regenerate.
2087 * testsuite/arm_exidx_test.s: New file.
2088 * testsuite/arm_exidx_test.sh: Same.
2089
e7782cf6
CC
20902011-04-20 Cary Coutant <ccoutant@google.com>
2091
2092 PR gold/12689
2093 * archive.h (Incremental_archive_entry::Archive_member):
2094 Initialize arg_serial_ (second constructor).
2095
308ecdc7
ILT
20962011-04-17 Ian Lance Taylor <iant@google.com>
2097
2098 * object.cc (Relocate_info::location): Simplify location string.
2099 * errors.cc (Errors::error_at_location): Don't print program
2100 name.
2101 (Errors::warning_at_location): Likewise.
2102 (Errors::undefined_symbol): Likewise.
2103 * testsuite/debug_msg.sh: Update accordingly.
2104
bec5b579
CC
21052011-04-14 Cary Coutant <ccoutant@google.com>
2106
2107 * gold/layout.cc (Layout::symtab_section_offset): New function.
2108 * gold/layout.h (Layout::symtab_section_offset): New function.
2109 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
2110
88597d34
ILT
21112011-04-12 Ian Lance Taylor <iant@google.com>
2112
2113 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
2114 with MREMAP_MAYMOVE.
2115 * output.h (class Output_file): Add map_is_allocated_ field.
2116 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
2117 not available, provide stubs. If mremap is not available, #define
2118 it to gold_mremap.
2119 (MREMAP_MAYMOVE): Define if not defined.
2120 (Output_file::Output_file): Initialize map_is_allocated_.
2121 (Output_file::resize): Check map_is_allocated_.
2122 (Output_file::map_anonymous): If mmap fails, use malloc.
2123 (Output_file::unmap): Don't do anything for an anonymous map.
2124 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
2125 is not available, provide stubs.
2126 (File_read::View::~View): Use free rather than delete[].
2127 (File_read::make_view): Use malloc rather than new[]. If mmap
2128 fails, use malloc.
2129 (File_read::find_or_make_view): Use malloc rather than new[].
2130 * gold.h: Remove HAVE_REMAP code.
2131 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
2132 exists. Rename mremap to gold_mremap. If mmap is not available
2133 don't do anything.
2134 * configure, config.in: Rebuild.
2135
11e361bc
ILT
21362011-04-11 Ian Lance Taylor <iant@google.com>
2137
2138 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
2139 initialize local variable v.
2140
cdc29364
CC
21412011-04-11 Cary Coutant <ccoutant@google.com>
2142
2143 * archive.cc (Archive::include_member): Adjust call to
2144 report_object.
2145 (Add_archive_symbols::run): Track argument serial numbers.
2146 (Lib_group::include_member): Likewise.
2147 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
2148 * archive.h (Incremental_archive_entry::Archive_member):
2149 Initialize arg_serial_.
2150 (Archive_member::arg_serial_): New data member.
2151 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
2152 (Sized_dynobj::do_add_symbols): Track symbols when doing an
2153 incremental link.
2154 (Sized_dynobj::do_for_all_local_got_entries): New function.
2155 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
2156 function.
2157 * fileread.cc (get_mtime): New function.
2158 * fileread.h (get_mtime): New function.
2159 * gold.cc (queue_initial_tasks): Check for incremental update.
2160 (process_incremental_input): New function.
2161 (queue_middle_tasks): Don't force valid target for incremental
2162 update.
2163 * incremental-dump.cc (find_input_containing_global): Adjust
2164 size of symbol info entry.
2165 (dump_incremental_inputs): Dump argument serial number and
2166 in_system_directory flag; bias shndx by 1; print symbol names
2167 when dumping per-file symbol lists; use new symbol info readers.
2168 * incremental.cc
2169 (Output_section_incremental_inputs:update_data_size): New function.
2170 (Sized_incremental_binary::setup_readers): Setup input readers
2171 for each input file; build maps for files added from libraries
2172 and scripts.
2173 (Sized_incremental_binary::check_input_args): New function.
2174 (Sized_incremental_binary::do_check_inputs): Build map of argument
2175 serial numbers to input arguments.
2176 (Sized_incremental_binary::do_file_has_changed): Rename
2177 do_file_is_unchanged to this; compare file modification times.
2178 (Sized_incremental_binary::do_init_layout): New function.
2179 (Sized_incremental_binary::do_reserve_layout): New function.
2180 (Sized_incremental_binary::do_get_input_reader): Remove.
2181 (Sized_incremental_binary::get_symtab_view): New function.
2182 (Incremental_checker::can_incrementally_link_output_file): Remove.
2183 (Incremental_inputs::report_command_line): Exclude --debug options.
2184 (Incremental_inputs::report_archive_begin): Add parameter; track
2185 argument serial numbers; don't put input file entry for archive
2186 before archive members.
2187 (Incremental_inputs::report_archive_end): Put input file entry
2188 for archive after archive members.
2189 (Incremental_inputs::report_object): Add parameter; track argument
2190 serial numbers and in_system_directory flag.
2191 (Incremental_inputs::report_script): Add parameter; track argument
2192 serial numbers.
2193 (Output_section_incremental_inputs::set_final_data_size): Adjust
2194 size of symbol info entry; check for forwarding symbols.
2195 (Output_section_incremental_inputs::write_input_files): Write
2196 in_system_directory flag and argument serial number.
2197 (Output_section_incremental_inputs::write_info_blocks): Map section
2198 indices between incremental info and original input file; store
2199 input section index for each symbol.
2200 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
2201 change operator() to visit().
2202 (class Global_got_offset_visitor): Likewise.
2203 (class Global_symbol_visitor_got_plt):
2204 (Output_section_incremental_inputs::write_got_plt): Use new visitor
2205 classes.
2206 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
2207 (Sized_incr_relobj::do_read_symbols): New function.
2208 (Sized_incr_relobj::do_layout): New function.
2209 (Sized_incr_relobj::do_layout_deferred_sections): New function.
2210 (Sized_incr_relobj::do_add_symbols): New function.
2211 (Sized_incr_relobj::do_should_include_member): New function.
2212 (Sized_incr_relobj::do_for_all_global_symbols): New function.
2213 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
2214 (Sized_incr_relobj::do_section_size): New function.
2215 (Sized_incr_relobj::do_section_name): New function.
2216 (Sized_incr_relobj::do_section_contents): New function.
2217 (Sized_incr_relobj::do_section_flags): New function.
2218 (Sized_incr_relobj::do_section_entsize): New function.
2219 (Sized_incr_relobj::do_section_address): New function.
2220 (Sized_incr_relobj::do_section_type): New function.
2221 (Sized_incr_relobj::do_section_link): New function.
2222 (Sized_incr_relobj::do_section_info): New function.
2223 (Sized_incr_relobj::do_section_addralign): New function.
2224 (Sized_incr_relobj::do_initialize_xindex): New function.
2225 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
2226 (Sized_incr_relobj::do_read_relocs): New function.
2227 (Sized_incr_relobj::do_gc_process_relocs): New function.
2228 (Sized_incr_relobj::do_scan_relocs): New function.
2229 (Sized_incr_relobj::do_count_local_symbols): New function.
2230 (Sized_incr_relobj::do_finalize_local_symbols): New function.
2231 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
2232 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
2233 (Sized_incr_relobj::do_relocate): New function.
2234 (Sized_incr_relobj::do_set_section_offset): New function.
2235 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
2236 (Sized_incr_dynobj::do_read_symbols): New function.
2237 (Sized_incr_dynobj::do_layout): New function.
2238 (Sized_incr_dynobj::do_add_symbols): New function.
2239 (Sized_incr_dynobj::do_should_include_member): New function.
2240 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
2241 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
2242 (Sized_incr_dynobj::do_section_size): New function.
2243 (Sized_incr_dynobj::do_section_name): New function.
2244 (Sized_incr_dynobj::do_section_contents): New function.
2245 (Sized_incr_dynobj::do_section_flags): New function.
2246 (Sized_incr_dynobj::do_section_entsize): New function.
2247 (Sized_incr_dynobj::do_section_address): New function.
2248 (Sized_incr_dynobj::do_section_type): New function.
2249 (Sized_incr_dynobj::do_section_link): New function.
2250 (Sized_incr_dynobj::do_section_info): New function.
2251 (Sized_incr_dynobj::do_section_addralign): New function.
2252 (Sized_incr_dynobj::do_initialize_xindex): New function.
2253 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
2254 (make_sized_incremental_object): New function.
2255 (Incremental_library::copy_unused_symbols): New function.
2256 (Incremental_library::do_for_all_unused_symbols): New function.
2257 * incremental.h (enum Incremental_input_flags): New type.
2258 (class Incremental_checker): Remove.
2259 (Incremental_input_entry::Incremental_input_entry): Add argument
2260 serial number.
2261 (Incremental_input_entry::arg_serial): New function.
2262 (Incremental_input_entry::set_is_in_system_directory): New function.
2263 (Incremental_input_entry::is_in_system_directory): New function.
2264 (Incremental_input_entry::arg_serial_): New data member.
2265 (Incremental_input_entry::is_in_system_directory_): New data member.
2266 (class Script_info): Move here from script.h.
2267 (Script_info::Script_info): Add filename parameter.
2268 (Script_info::filename): New function.
2269 (Script_info::filename_): New data member.
2270 (Incremental_script_entry::Incremental_script_entry): Add argument
2271 serial number.
2272 (Incremental_object_entry::Incremental_object_entry): Likewise.
2273 (Incremental_object_entry::add_input_section): Build list of input
2274 sections with map to original shndx.
2275 (Incremental_object_entry::get_input_section_index): New function.
2276 (Incremental_object_entry::shndx_): New data member.
2277 (Incremental_object_entry::name_key_): Rename; adjust all refs.
2278 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
2279 (Incremental_archive_entry::Incremental_archive_entry): Add argument
2280 serial number.
2281 (Incremental_inputs::report_archive_begin): Likewise.
2282 (Incremental_inputs::report_object): Likewise.
2283 (Incremental_inputs::report_script): Likewise.
2284 (class Incremental_global_symbol_reader): New class.
2285 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
2286 and store flags and input file type.
2287 (Incremental_input_entry_reader::arg_serial): New function.
2288 (Incremental_input_entry_reader::type): Extract type from flags.
2289 (Incremental_input_entry_reader::is_in_system_directory): New function.
2290 (Incremental_input_entry_reader::get_input_section_count): Call
2291 accessor function for type.
2292 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
2293 function for type; adjust size of global symbol entry.
2294 (Incremental_input_entry_reader::get_global_symbol_count): Call
2295 accessor function for type.
2296 (Incremental_input_entry_reader::get_object_count): Likewise.
2297 (Incremental_input_entry_reader::get_object_offset): Likewise.
2298 (Incremental_input_entry_reader::get_member_count): Likewise.
2299 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
2300 (Incremental_input_entry_reader::get_member_offset): Likewise.
2301 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
2302 (Incremental_input_entry_reader::Global_symbol_info): Remove.
2303 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
2304 (Incremental_input_entry_reader::get_global_symbol_reader): New
2305 function.
2306 (Incremental_input_entry_reader::get_output_symbol_index): New
2307 function.
2308 (Incremental_input_entry_reader::type_): Remove.
2309 (Incremental_input_entry_reader::flags_): New data member.
2310 (Incremental_inputs_reader::input_file_offset): New function.
2311 (Incremental_inputs_reader::input_file_index): New function.
2312 (Incremental_inputs_reader::input_file): Call input_file_offset.
2313 (Incremental_inputs_reader::input_file_at_offset): New function.
2314 (Incremental_relocs_reader::get_r_type): Reformat.
2315 (Incremental_relocs_reader::get_r_shndx): Reformat.
2316 (Incremental_relocs_reader::get_r_offset): Reformat.
2317 (Incremental_relocs_reader::data): New function.
2318 (Incremental_binary::Incremental_binary): Initialize new data members.
2319 (Incremental_binary::check_inputs): Add cmdline parameter.
2320 (Incremental_binary::file_is_unchanged): Remove.
2321 (Input_reader::arg_serial): New function.
2322 (Input_reader::get_unused_symbol_count): New function.
2323 (Input_reader::get_unused_symbol): New function.
2324 (Input_reader::do_arg_serial): New function.
2325 (Input_reader::do_get_unused_symbol_count): New function.
2326 (Input_reader::do_get_unused_symbol): New function.
2327 (Incremental_binary::input_file_count): New function.
2328 (Incremental_binary::get_input_reader): Change signature to use
2329 index instead of filename.
2330 (Incremental_binary::file_has_changed): New function.
2331 (Incremental_binary::get_input_argument): New function.
2332 (Incremental_binary::get_library): New function.
2333 (Incremental_binary::get_script_info): New function.
2334 (Incremental_binary::init_layout): New function.
2335 (Incremental_binary::reserve_layout): New function.
2336 (Incremental_binary::output_file): New function.
2337 (Incremental_binary::do_check_inputs): New function.
2338 (Incremental_binary::do_file_is_unchanged): Remove.
2339 (Incremental_binary::do_file_has_changed): New function.
2340 (Incremental_binary::do_init_layout): New function.
2341 (Incremental_binary::do_reserve_layout): New function.
2342 (Incremental_binary::do_input_file_count): New function.
2343 (Incremental_binary::do_get_input_reader): Change signature.
2344 (Incremental_binary::input_args_map_): New data member.
2345 (Incremental_binary::library_map_): New data member.
2346 (Incremental_binary::script_map_): New data member.
2347 (Sized_incremental_binary::Sized_incremental_binary): Initialize
2348 new data members.
2349 (Sized_incremental_binary::output_section): New function.
2350 (Sized_incremental_binary::inputs_reader): Add const.
2351 (Sized_incremental_binary::symtab_reader): Add const.
2352 (Sized_incremental_binary::relocs_reader): Add const.
2353 (Sized_incremental_binary::got_plt_reader): Add const.
2354 (Sized_incremental_binary::get_symtab_view): New function.
2355 (Sized_incremental_binary::Inputs_reader): New typedef.
2356 (Sized_incremental_binary::Input_entry_reader): New typedef.
2357 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
2358 (Sized_incremental_binary::do_file_is_unchanged): Remove.
2359 (Sized_incremental_binary::do_file_has_changed): New function.
2360 (Sized_incremental_binary::do_init_layout): New function.
2361 (Sized_incremental_binary::do_reserve_layout): New function.
2362 (Sized_input_reader::Inputs_reader): Remove.
2363 (Sized_input_reader::Input_entry_reader): Remove.
2364 (Sized_input_reader::do_arg_serial): New function.
2365 (Sized_input_reader::do_get_unused_symbol_count): New function.
2366 (Sized_input_reader::do_get_unused_symbol): New function.
2367 (Sized_incremental_binary::do_input_file_count): New function.
2368 (Sized_incremental_binary::do_get_input_reader): Change signature;
2369 use index instead of filename.
2370 (Sized_incremental_binary::section_map_): New data member.
2371 (Sized_incremental_binary::input_entry_readers_): New data member.
2372 (class Sized_incr_relobj): New class.
2373 (class Sized_incr_dynobj): New class.
2374 (make_sized_incremental_object): New function.
2375 (class Incremental_library): New class.
2376 * layout.cc (Free_list::num_lists): New static data member.
2377 (Free_list::num_nodes): New static data member.
2378 (Free_list::num_removes): New static data member.
2379 (Free_list::num_remove_visits): New static data member.
2380 (Free_list::num_allocates): New static data member.
2381 (Free_list::num_allocate_visits): New static data member.
2382 (Free_list::init): New function.
2383 (Free_list::remove): New function.
2384 (Free_list::allocate): New function.
2385 (Free_list::dump): New function.
2386 (Free_list::print_stats): New function.
2387 (Layout_task_runner::run): Resize output file for incremental updates.
2388 (Layout::Layout): Initialize new data members.
2389 (Layout::set_incremental_base): New function.
2390 (Layout::init_fixed_output_section): New function.
2391 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
2392 incremental updates.
2393 (Layout::create_gold_note): Do not create gold note section for
2394 incremental updates.
2395 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
2396 for incremental updates.
2397 (Layout::set_section_offsets): For incremental updates, allocate space
2398 from free list.
2399 (Layout::create_symtab_sections): Layout with offsets relative to
2400 start of section; for incremental updates, allocate space from free
2401 list.
2402 (Layout::create_shdrs): For incremental updates, allocate space from
2403 free list.
2404 (Layout::finish_dynamic_section): For incremental updates, do not
2405 check --as-needed (fixed in subsequent patch).
2406 * layout.h (class Free_list): New class.
2407 (Layout::set_incremental_base): New function.
2408 (Layout::incremental_base): New function.
2409 (Layout::init_fixed_output_section): New function.
2410 (Layout::allocate): New function.
2411 (Layout::incremental_base_): New data member.
2412 (Layout::free_list_): New data member.
2413 * main.cc (main): Print Free_list statistics.
2414 * object.cc (Relobj::finalize_incremental_relocs): Add
2415 clear_counts parameter; clear counts only when clear_counts is set.
2416 (Sized_relobj::Sized_relobj): Initialize new base class.
2417 (Sized_relobj::do_layout): Don't report special sections.
2418 (Sized_relobj::do_for_all_local_got_entries): New function.
2419 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
2420 symtab_off to all symbol table offsets.
2421 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
2422 * object.h (class Got_offset_list): Move to top of file.
2423 (Object::Object): Allow case where input_file == NULL.
2424 (Object::~Object): Likewise.
2425 (Object::input_file): Assert that input_file != NULL.
2426 (Object::lock): Allow case where input_file == NULL.
2427 (Object::unlock): Likewise.
2428 (Object::is_locked): Likewise.
2429 (Object::token): Likewise.
2430 (Object::release): Likewise.
2431 (Object::is_incremental): New function.
2432 (Object::get_mtime): New function.
2433 (Object::for_all_local_got_entries): New function.
2434 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
2435 (Object::set_is_in_system_directory): New function.
2436 (Object::is_in_system_directory): New function.
2437 (Object::do_is_incremental): New function.
2438 (Object::do_get_mtime): New function.
2439 (Object::do_for_all_local_got_entries): New function.
2440 (Object::is_in_system_directory_): New data member.
2441 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
2442 (class Sized_relobj_base): New class.
2443 (class Sized_relobj): Derive from Sized_relobj_base.
2444 (class Sized_relobj::Symbols): Redeclare from base class.
2445 (class Sized_relobj::local_got_offset_list): Remove.
2446 (class Sized_relobj::Output_sections): Redeclare from base class.
2447 (class Sized_relobj::do_for_all_local_got_entries): New function.
2448 (class Sized_relobj::write_local_symbols): Add offset parameter.
2449 (class Sized_relobj::local_symbol_offset_): Update comment.
2450 (class Sized_relobj::local_dynsym_offset_): Update comment.
2451 * options.cc (Input_arguments::add_file): Remove const.
2452 * options.h (Input_file_argument::Input_file_argument):
2453 Initialize arg_serial_ (all constructors).
2454 (Input_file_argument::set_arg_serial): New function.
2455 (Input_file_argument::arg_serial): New function.
2456 (Input_file_argument::arg_serial_): New data member.
2457 (Input_arguments::Input_arguments): Initialize file_count_.
2458 (Input_arguments::add_file): Remove const.
2459 (Input_arguments::number_of_input_files): New function.
2460 (Input_arguments::file_count_): New data member.
2461 (Command_line::number_of_input_files): Call
2462 Input_arguments::number_of_input_files.
2463 * output.cc (Output_segment_headers::Output_segment_headers):
2464 Set current size.
2465 (Output_section::Input_section::current_data_size): New function.
2466 (Output_section::Output_section): Initialize new data members.
2467 (Output_section::add_input_section): Don't do merge sections for
2468 an incremental link; allocate space from free list for an
2469 incremental update.
2470 (Output_section::add_output_section_data): Allocate space from
2471 free list for an incremental update.
2472 (Output_section::update_data_size): New function.
2473 (Output_section::set_fixed_layout): New function.
2474 (Output_section::reserve): New function.
2475 (Output_segment::set_section_addresses): Remove const.
2476 (Output_segment::set_section_list_addresses): Remove const; allocate
2477 space from free list for an incremental update.
2478 (Output_segment::set_offset): Adjust size of RELRO segment for an
2479 incremental update.
2480 * output.h (Output_data::current_data_size): Move here from
2481 child classes.
2482 (Output_data::pre_finalize_data_size): New function.
2483 (Output_data::update_data_size): New function.
2484 (Output_section_headers::update_data_size): new function.
2485 (Output_section_data_build::current_data_size): Move to Output_data.
2486 (Output_data_strtab::update_data_size): New function.
2487 (Output_section::current_data_size): Move to Output_data.
2488 (Output_section::set_fixed_layout): New function.
2489 (Output_section::has_fixed_layout): New function.
2490 (Output_section::reserve): New function.
2491 (Output_section::update_data_size): New function.
2492 (Output_section::has_fixed_layout_): New data member.
2493 (Output_section::free_list_): New data member.
2494 (Output_segment::set_section_addresses): Remove const.
2495 (Output_segment::set_section_list_addresses): Remove const.
2496 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
2497 New function.
2498 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
2499 New function.
2500 * readsyms.cc (Read_symbols::do_read_symbols): Add library
2501 parameter when calling Add_symbols constructor; store argument
2502 serial number for members of a lib group.
2503 (Add_symbols::locks): Allow case where token == NULL.
2504 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
2505 (Read_member::~Read_member): New function.
2506 (Read_member::is_runnable): New function.
2507 (Read_member::locks): New function.
2508 (Read_member::run): New function.
2509 (Check_script::~Check_script): New function.
2510 (Check_script::is_runnable): New function.
2511 (Check_script::locks): New function.
2512 (Check_script::run): New function.
2513 (Check_library::~Check_library): New function.
2514 (Check_library::is_runnable): New function.
2515 (Check_library::locks): New function.
2516 (Check_library::run): New function.
2517 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
2518 (Add_symbols::library_): New data member.
2519 (class Read_member): New class.
2520 (class Check_script): New class.
2521 (class Check_library): New class.
2522 * reloc.cc (Read_relocs::is_runnable): Allow case where
2523 token == NULL.
2524 (Read_relocs::locks): Likewise.
2525 (Scan_relocs::locks): Likewise.
2526 (Relocate_task::locks): Likewise.
2527 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
2528 to clear counters.
2529 (Sized_relobj::incremental_relocs_scan): Fix comment.
2530 (Sized_relobj::do_relocate): Pass output file offset to
2531 write_local_symbols.
2532 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
2533 from class declaration.
2534 * script.cc (read_input_script): Allocate Script_info; pass
2535 argument serial number to report_script.
2536 * script.h (class Script_info): Move to incremental.h.
2537 * symtab.cc (Symbol_table::add_from_incrobj): New function.
2538 * symtab.h (Symbol_table::add_from_incrobj): New function.
2539 (Symbol_table::set_file_offset): New function.
2540
b961d0d7
CC
25412011-04-05 Cary Coutant <ccoutant@google.com>
2542
2543 * incremental-dump.cc (dump_incremental_inputs): Change signature
2544 to take a Sized_incremental_binary; change caller. Use readers
2545 in Sized_incremental_binary.
2546 * incremental.cc
2547 (Sized_incremental_binary::find_incremental_inputs_sections):
2548 Rename do_find_incremental_inputs_sections to this.
2549 (Sized_incremental_binary::setup_readers): New function.
2550 (Sized_incremental_binary::do_check_inputs): Check
2551 has_incremental_info_ flag; move setup code to setup_readers;
2552 use input readers.
2553 (Sized_incremental_binary::do_file_is_unchanged): New function.
2554 (Sized_incremental_binary::do_get_input_reader): New function.
2555 * incremental.h (class Incremental_binary): Move to end of file.
2556 (Incremental_binary::file_is_unchanged): New function.
2557 (Incremental_binary::do_file_is_unchanged): New function.
2558 (Incremental_binary::Input_reader): New class.
2559 (Incremental_binary::get_input_reader): New function.
2560 (class Sized_incremental_binary): Move to end of file.
2561 (Sized_incremental_binary::Sized_incremental_binary): Setup the
2562 input section reader classes.
2563 (Sized_incremental_binary::has_incremental_info): New function.
2564 (Sized_incremental_binary::inputs_reader): New function.
2565 (Sized_incremental_binary::symtab_reader): New function.
2566 (Sized_incremental_binary::relocs_reader): New function.
2567 (Sized_incremental_binary::got_plt_reader): New function.
2568 (Sized_incremental_binary::do_file_is_unchanged): New function.
2569 (Sized_incremental_binary::Sized_input_reader): New class.
2570 (Sized_incremental_binary::get_input_reader): New function.
2571 (Sized_incremental_binary::find_incremental_inputs_sections):
2572 Rename do_find_incremental_inputs_sections to this.
2573 (Sized_incremental_binary::setup_readers): New function.
2574 (Sized_incremental_binary::has_incremental_info_): New data member.
2575 (Sized_incremental_binary::inputs_reader_): New data member.
2576 (Sized_incremental_binary::symtab_reader_): New data member.
2577 (Sized_incremental_binary::relocs_reader_): New data member.
2578 (Sized_incremental_binary::got_plt_reader_): New data member.
2579 (Sized_incremental_binary::current_input_file_): New data member.
2580
a869183f
PP
25812011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
2582
2583 PR gold/12640
2584 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
2585 violation.
2586
25872011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
2588
2589 * archive.cc (Archive::include_member): Adjust call to report_object.
2590 (Add_archive_symbols::run): Add script_info to call to
2591 report_archive_begin.
2592 (Lib_group::include_member): Adjust call to report_object.
2593 (Add_lib_group_symbols::run): Adjust call to report_object.
2594 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
2595 blocks. Add object count for script input files.
2596 * incremental.cc (Incremental_inputs::report_archive_begin): Add
2597 script_info parameter; change all callers.
2598 (Incremental_inputs::report_object): Add script_info parameter;
2599 change all callers.
2600 (Incremental_inputs::report_script): Store backpointer to
2601 incremental info entry.
2602 (Output_section_incremental_inputs::set_final_data_size): Record
2603 additional information for scripts.
2604 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2605 * incremental.h (Incremental_script_entry::add_object): New function.
2606 (Incremental_script_entry::get_object_count): New function.
2607 (Incremental_script_entry::get_object): New function.
2608 (Incremental_script_entry::objects_): New data member; adjust
2609 constructor.
2610 (Incremental_inputs::report_archive_begin): Add script_info parameter.
2611 (Incremental_inputs::report_object): Add script_info parameter.
2612 (Incremental_inputs_reader::get_object_count): New function.
2613 (Incremental_inputs_reader::get_object_offset): New function.
2614 * options.cc (Input_arguments::add_file): Return reference to
2615 new input argument.
2616 * options.h (Input_argument::set_script_info): New function.
2617 (Input_argument::script_info): New function.
2618 (Input_argument::script_info_): New data member; adjust all
2619 constructors.
2620 (Input_file_group::add_file): Return reference to new input argument.
2621 (Input_file_lib::add_file): Likewise.
2622 (Input_arguments::add_file): Likewise.
2623 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
2624 * script.cc (Parser_closure::Parser_closure): Add script_info
2625 parameter; adjust all callers.
2626 (Parser_closure::script_info): New function.
2627 (Parser_closure::script_info_): New data member.
2628 (read_input_script): Report scripts earlier to incremental info.
2629 (script_add_file): Set script_info in Input_argument.
2630 (script_add_library): Likewise.
2631 * script.h (Script_options::Script_info): Rewrite class.
2632
a869183f 26332011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
2634
2635 * archive.cc (Library_base::should_include_member): Move
2636 method here from class Archive.
2637 (Archive::Archive): Initialize base class.
2638 (Archive::should_include_member): Move to base class.
2639 (Archive::do_for_all_unused_symbols): New function.
2640 (Add_archive_symbols::run): Remove redundant access to
2641 incremental_inputs.
2642 (Lib_group::Lib_group): Initialize base class.
2643 (Lib_group::do_filename): New function.
2644 (Lib_group::include_member): Pass pointer to Lib_group to
2645 report_object.
2646 (Lib_group::do_for_all_unused_symbols): New function.
2647 (Add_lib_group_symbols::run): Report archive information for
2648 incremental links.
2649 * archive.h (class Library_base): New base class.
2650 (class Archive): Derive from Library_base.
2651 (Archive::filename): Move to base class.
2652 (Archive::set_incremental_info): Likewise.
2653 (Archive::incremental_info): Likewise.
2654 (Archive::Should_include): Likewise.
2655 (Archive::should_include_member): Likewise.
2656 (Archive::Armap_entry): Remove.
2657 (Archive::Unused_symbol_iterator): Remove.
2658 (Archive::unused_symbols_begin): Remove.
2659 (Archive::unused_symbols_end): Remove.
2660 (Archive::do_filename): New function.
2661 (Archive::do_get_mtime): New function.
2662 (Archive::do_for_all_unused_symbols): New function.
2663 (Archive::task_): Move to base class.
2664 (Archive::incremental_info_): Likewise.
2665 (class Lib_group): Derive from Library_base.
2666 (Lib_group::do_filename): New function.
2667 (Lib_group::do_get_mtime): New function.
2668 (Lib_group::do_for_all_unused_symbols): New function.
2669 (Lib_group::task_): Move to base class.
2670 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
2671 function.
2672 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
2673 function.
2674 * incremental.cc (Incremental_inputs::report_archive_begin):
2675 Use Library_base; call library's get_mtime; add incremental inputs
2676 entry before members.
2677 (class Unused_symbol_visitor): New class.
2678 (Incremental_inputs::report_archive_end): Use Library_base; use
2679 visitor class to record unused symbols; don't add incremental inputs
2680 entry after members.
2681 (Incremental_inputs::report_object): Use Library_base.
2682 * incremental.h
2683 (Incremental_archive_entry::Incremental_archive_entry): Remove
2684 unused Archive parameter.
2685 (Incremental_inputs::report_archive_begin): Use Library_base.
2686 (Incremental_inputs::report_archive_end): Likewise.
2687 (Incremental_inputs::report_object): Likewise.
2688 * object.cc (Sized_relobj::do_for_all_global_symbols): New
2689 function.
2690 * object.h (Object::for_all_global_symbols): New function.
2691 (Object::do_for_all_global_symbols): New function.
2692 (Sized_relobj::do_for_all_global_symbols): New function.
2693 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
2694 function.
2695 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
2696 function.
2697
61ab3e40
ILT
26982011-03-27 Ian Lance Taylor <iant@google.com>
2699
2700 * archive.cc (Archive::interpret_header): Return -1 if something
2701 goes wrong. Change callers accordingly.
2702
30e1f9e6
CC
27032011-03-25 Cary Coutant <ccoutant@google.com>
2704
2705 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
2706 * testsuite/Makefile.in: Regenerate.
2707
9370ce59 27082011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
2709
2710 * plugin.cc (get_view): New.
2711 (Plugin::load): Pass get_view to the plugin.
2712 (Plugin_manager::get_view): New.
2713
9312bb0a
ILT
27142011-03-21 Ian Lance Taylor <iant@google.com>
2715
2716 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 2717 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 2718
7e12ba9e
ST
27192011-03-21 Sriraman Tallam <tmsriram@google.com>
2720
2721 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
2722 Change == to -eq.
2723 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
2724 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
2725 Change == to -eq.
2726 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
2727 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
2728
fd7a005d
ILT
27292011-03-14 Ian Lance Taylor <iant@google.com>
2730
2731 * script-sections.cc (Sort_output_sections::script_compare):
2732 Rename from is_before, change return type.
2733 (Sort_output_sections::operator()): Adjust accordingly.
2734
ed16fd1b
ILT
27352011-03-11 Jeffrey Yasskin <jyasskin@google.com>
2736
2737 PR gold/12572
2738 * testsuite/odr_violation2.cc: Add comment to make all error line
2739 numbers double digits.
2740 * testsuite/debug_msg.sh: Adjust expected errors.
2741
71ff8986
ILT
27422011-03-09 Jeffrey Yasskin <jyasskin@google.com>
2743
2744 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
2745 but mark earlier ones as non-canonical
2746 (offset_to_iterator): Update search target and example
2747 (do_addr2line): Return extra lines in a vector*
2748 (format_file_lineno): Extract from do_addr2line
2749 (one_addr2line): Add vector* out-param
2750 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
2751 when a lineno entry appeared last for its instruction
2752 (Dwarf_line_info): Add vector* out-param
2753 * object.cc (Relocate_info): Pass NULL for the vector* out-param
2754 * symtab.cc (Odr_violation_compare): Include the lineno in the
2755 comparison again.
2756 (linenos_from_loc): New. Combine the canonical line for an
2757 address with its other lines.
2758 (True_if_intersect): New. Helper functor to make
2759 std::set_intersection a query.
2760 (detect_odr_violations): Compare sets of lines instead of just
2761 one line for each function. This became less deterministic, but
2762 has fewer false positives.
2763 * symtab.h: Declarations.
2764 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
2765 mix an optimized and non-optimized object in the same binary
2766 (odr_violation2.so): Same.
2767 * testsuite/Makefile.in: Regenerate from Makefile.am.
2768 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
2769 * testsuite/debug_msg.sh: Update line numbers and add
2770 assertions.
2771 * testsuite/odr_violation1.cc: Use OdrDerived, in a
2772 non-optimized context.
2773 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
2774 isn't inlined, and use OdrDerived in an optimized context.
2775 * testsuite/odr_header1.h: Defines OdrDerived, where
2776 optimization will change the
2777 first-instruction-in-the-destructor's file and line number.
2778 * testsuite/odr_header2.h: Defines OdrBase.
2779
a19fefdc
ILT
27802011-03-09 Ian Lance Taylor <iant@google.com>
2781
2782 * fileread.cc (File_read::clear_views): Don't delete the whole
2783 file view.
2784
ecb351e9
ILT
27852011-03-08 Ian Lance Taylor <iant@google.com>
2786
2787 PR gold/12525
2788 * fileread.cc: #include <climits>.
2789 (GOLD_IOV_MAX): Define.
2790 (File_read::read_multiple): Limit number of entries by iov_max.
2791 * fileread.h (class File_read): Always set max_readv_entries to
2792 128.
2793
b821d13c
ILT
27942011-03-07 Ian Lance Taylor <iant@google.com>
2795
2796 PR gold/12525
2797 * options.h (class General_options): Add -dy and -dn.
2798
89243142
CC
27992011-03-02 Cary Coutant <ccoutant@google.com>
2800
2801 * testsuite/script_test_9.t: Add TLS segment.
2802
d0773f31
ILT
28032011-03-02 Simon Baldwin <simonb@google.com>
2804
2805 * configure.ac: Add check for gnu_indirect_function support in
2806 the toolchain building binutils.
2807 * configure: Rebuild.
2808
9370ce59 28092011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
2810
2811 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
2812 plugin only symbols.
2813 (Symbol_table::sized_finalize_symbol) Mark symbol only present
2814 in plugin files as not needed in the symbol table.
2815
4cf7a849
ST
28162011-02-11 Sriraman Tallam <tmsriram@google.com>
2817
2818 * output.cc (Output_section::add_input_section): Delay fill
2819 generation for section ordering.
2820
b578bd7d
ILT
28212011-02-09 Ian Lance Taylor <iant@google.com>
2822
2823 PR gold/12316
2824 * object.h (class Sized_relobj): Remove clear_local_symbols.
2825 * reloc.cc (Sized_relobj::do_relocate): Don't call
2826 clear_local_symbols.
2827
9370ce59 28282011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
2829
2830 * plugin.cc (is_visible_from_outside): Return true for symbols
2831 in the -u option.
2832
55382fb7
ILT
28332011-02-04 Jeffrey Yasskin <jyasskin@google.com>
2834
2835 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
2836 filename.
2837
4e271fff
ST
28382011-02-02 Sriraman Tallam <tmsriram@google.com>
2839
2840 * icf.h (is_section_foldable_candidate): Change type of parameter
2841 to std::string.
2842 * icf.cc (Icf::find_identical_sections): Change type of local variable
2843 section_name to be std::string.
2844 (is_function_ctor_or_dtor): Change type of parameter to std::string.
2845
d433c3ac
ILT
28462011-01-25 Ian Lance Taylor <iant@google.com>
2847
2848 * script.cc (script_add_extern): Rewrite to use
2849 add_symbol_reference.
2850
880473a6
DK
28512011-01-25 Doug Kwan <dougkwan@google.com>
2852
d433c3ac 2853 * icf.cc (get_section_contents): Always lock section's object.
880473a6 2854
f30f86fa
ILT
28552011-01-24 Ian Lance Taylor <iant@google.com>
2856
2857 * options.h (class General_options): Accept
2858 --no-detect-odr-violations.
2859
8e51a0b9
ILT
28602011-01-24 Ian Lance Taylor <iant@google.com>
2861
2862 * version.cc (version_string): Bump to 1.11.
2863
0f3b89d8
ILT
28642011-01-24 Ian Lance Taylor <iant@google.com>
2865
2866 * plugin.cc (class Plugin_rescan): Define new class.
2867 (Plugin_manager::claim_file): Set any_claimed_.
2868 (Plugin_manager::save_archive): New function.
2869 (Plugin_manager::save_input_group): New function.
2870 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
2871 necessary.
2872 (Plugin_manager::new_undefined_symbol): New function.
2873 (Plugin_manager::rescan): New function.
2874 (Plugin_manager::rescannable_defines): New function.
2875 (Plugin_manager::add_input_file): Set any_added_.
2876 * plugin.h (class Plugin_manager): define new fields rescannable_,
2877 undefined_symbols_, any_claimed_, and any_added_. Declare
2878 Plugin_rescan as friend. Declare new functions.
2879 (Plugin_manager::Rescannable): Define type.
2880 (Plugin_manager::Rescannable_list): Define type.
2881 (Plugin_manager::Undefined_symbol_list): Define type.
2882 (Plugin_manager::Plugin_manager): Initialize new fields.
2883 * archive.cc (Archive::defines_symbol): New function.
2884 (Add_archive_symbols::run): Pass archive to plugins if any.
2885 * archive.h (class Archive): Declare defines_symbol.
2886 * readsyms.cc (Input_group::~Input_group): New function.
2887 (Finish_group::run): Pass input_group to plugins if any.
2888 * readsyms.h (class Input_group): Declare destructor.
2889 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
2890 any.
2891
3bb951e5
ILT
28922011-01-10 Ian Lance Taylor <iant@google.com>
2893
2894 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
2895 section as relro.
2896 (Layout::set_segment_offsets): Reset increase_relro before calling
2897 set_section_addresses a second time.
2898
0aa45fac
CC
28992011-01-04 Cary Coutant <ccoutant@google.com>
2900
2901 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
2902 sections before NOBITS sections.
2903
0db46eb4
L
29042011-01-01 H.J. Lu <hongjiu.lu@intel.com>
2905
2906 * version.cc (print_version): Update copyright to 2011.
2907
829c9745
CC
29082010-12-23 Cary Coutant <ccoutant@google.com>
2909
2910 * output.h (Output_data_reloc::add_output_section): Pass OD instead
2911 of OS to this->add. Add OD parameter to second form of the function.
2912
7500420b
ILT
29132010-12-20 Ian Lance Taylor <iant@google.com>
2914
2915 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
2916 second of two consecutive entries with same offset.
2917
f8e9a930
RW
29182010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2919
2920 * testsuite/Makefile.am (ifuncmain2static_LDADD)
2921 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
2922 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
2923 to avoid unneeded links against $(LDADD).
2924 * testsuite/Makefile.in: Regenerate.
2925
2fbb4320
ILT
29262010-12-15 Ian Lance Taylor <iant@google.com>
2927
2928 PR gold/12324
2929 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
2930 for R_X86_64_32 and R_X86_64_PC32.
2931 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
2932 ver_matching_def_pic.o.
2933 (ver_matching_def_pic.o): New target.
2934
fedb228d
RW
29352010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2936
2937 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
2938 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
2939 Move definition before File_read::View member definitions.
2940 (File_read::View::~View): Initialize and hold lock before
2941 updating current_mapped_bytes.
2942
9b547ce6
RW
29432010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2944
2945 * dwarf_reader.cc: Remove outdated comment.
2946 * gold-threads.cc: Fix typo in error message.
2947 * archive.cc: Fix typos in comments.
2948 * archive.h: Likewise.
2949 * arm-reloc-property.cc: Likewise.
2950 * arm-reloc-property.h: Likewise.
2951 * arm-reloc.def: Likewise.
2952 * arm.cc: Likewise.
2953 * attributes.h: Likewise.
2954 * cref.cc: Likewise.
2955 * ehframe.cc: Likewise.
2956 * fileread.h: Likewise.
2957 * gold.h: Likewise.
2958 * i386.cc: Likewise.
2959 * icf.cc: Likewise.
2960 * incremental.h: Likewise.
2961 * int_encoding.cc: Likewise.
2962 * layout.h: Likewise.
2963 * main.cc: Likewise.
2964 * merge.h: Likewise.
2965 * object.cc: Likewise.
2966 * object.h: Likewise.
2967 * options.cc: Likewise.
2968 * readsyms.cc: Likewise.
2969 * reduced_debug_output.cc: Likewise.
2970 * reloc.cc: Likewise.
2971 * script-sections.cc: Likewise.
2972 * sparc.cc: Likewise.
2973 * symtab.h: Likewise.
2974 * target-reloc.h: Likewise.
2975 * target.cc: Likewise.
2976 * target.h: Likewise.
2977 * timer.cc: Likewise.
2978 * timer.h: Likewise.
2979 * x86_64.cc: Likewise.
2980
83e17bd5
CC
29812010-12-09 Cary Coutant <ccoutant@google.com>
2982
2983 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
2984 stack.
2985 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
2986 parameter; change all callers.
2987 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
2988 * options.h (warn_execstack): New option.
2989
017257f8
DK
29902010-12-07 Doug Kwan <dougkwan@google.com>
2991
2992 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
2993 like function call relocations.
2994
c20cbc06
ILT
29952010-12-07 Ian Lance Taylor <iant@google.com>
2996
2997 * archive.cc (Archive::get_elf_object_for_member): Permit
2998 punconfigured to be NULL.
2999 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
3000 (Archive::include_member): Pass NULL to get_elf_object_for_member
3001 if we searched for the archive and this is the first included
3002 object.
3003
4dbfafcc
ILT
30042010-12-01 Ian Lance Taylor <iant@google.com>
3005
3006 * dwarf_reader.h (class Sized_dwarf_line_info): Add
3007 track_relocs_type_ field.
3008 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3009 Set track_relocs_type_.
3010 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
3011 contents when using RELA relocs.
3012 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
3013 reloc_map_.
3014 * reloc.cc (Track_relocs::next_addend): New function.
3015 * reloc.h (class Track_relocs): Declare next_addend.
3016
e5e19edd
ILT
30172010-12-01 Ian Lance Taylor <iant@google.com>
3018
3019 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
3020 virtual destructor.
3021
9a5ce24c
ILT
30222010-12-01 Ian Lance Taylor <iant@google.com>
3023
3024 * README: Update compilers known to work and fail.
3025
c7791212
NC
30262010-11-23 Matthias Klose <doko@ubuntu.com>
3027
3028 * configure.in: For --enable-gold, handle value `default' instead of
3029 `both*'. Always install ld as ld.bfd, install as ld if gold is
3030 not the default.
3031 * configure: Regenerate.
3032
0ad220c9
DK
30332010-11-18 Doug Kwan <dougkwan@google.com>
3034
3035 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
3036 and right_alignment to be zero. Store result alignment only if it is
3037 greater than existing alignment.
3038
ab8056e0
CC
30392010-11-16 Cary Coutant <ccoutant@google.com>
3040
3041 PR gold/12220
3042 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3043 Check for ".zdebug_line".
3044
fd064a5b
CC
30452010-11-16 Doug Kwan <dougkwan@google.com>
3046 Cary Coutant <ccoutant@google.com>
3047
3048 * output.h (Output_segment::set_section_addresses): Pass increase_relro
3049 by reference; adjust all callers.
3050 * output.cc (Output_segment::set_section_addresses): Adjust references
3051 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
3052 list is empty.
3053 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
3054 end at page boundary.
3055
6fc6ea19
CC
30562010-11-16 Cary Coutant <ccoutant@google.com>
3057
3058 PR gold/12220
3059 * layout.cc (Layout::choose_output_section): Transform names of
3060 compressed sections even when using a script with a SECTIONS clause.
3061 (Layout::output_section_name): Remove code to transform
3062 compressed debug section names.
3063 * output.cc (Output_section::add_input_section): Use uncompressed
3064 section size when tracking input sections.
3065
95a2c8d6
RS
30662010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
3067
3068 * symtab.h (Symbol::NON_PIC_REF): Remove.
3069 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
3070 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
3071 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
3072 (Symbol::use_plt_offset): Take a flags argument and pass it
3073 directly to needs_dynamic_reloc. Restrict check for undefined
3074 weak symbols to function calls.
3075 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
3076 (Target_arm::Scan::global): Use it.
3077 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
3078 (Target_arm::Relocate::relocate): Likewise.
3079 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
3080 parameter with an r_type parameter. Use get_reference_flags
3081 to get the flags.
3082 (Target_arm::Relocate::relocate): Update accordingly.
3083 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
3084 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
3085 (Target_i386::Scan::global): Likewise.
3086 (Target_i386::Relocate::relocate): Likewise.
3087 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
3088 parameter with an r_type parameter. Use get_reference_flags
3089 to get the flags.
3090 (Target_i386::Relocate::relocate): Update accordingly.
3091 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
3092 (Target_powerpc::Scan::global): Use it.
3093 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
3094 (Target_powerpc::Relocate::relocate): Likewise.
3095 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
3096 (Target_sparc::Scan::global): Use it.
3097 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
3098 (Target_sparc::Relocate::relocate): Likewise.
3099 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
3100 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
3101 (Target_x86_64::Scan::global): Likewise.
3102 (Target_x86_64::Relocate::relocate): Likewise.
3103
f625ae50
DK
31042010-11-08 Doug Kwan <dougkwan@google.com>
3105 Cary Coutant <ccoutant@google.com>
3106
3107 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
3108 (Arm_exidx_merge_section::section_contents_): New data member.
3109 (Arm_input_section::Arm_input_section): Initialize original_contents_.
3110 (Arm_input_section::~Arm_input_section): De-allocate memory.
3111 (Arm_input_section::original_contents_): New data member.
3112 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
3113 in parameters instead of calling Object::section_contents without
3114 locking.
3115 (Arm_output_section::group_section): New parameter TASK. Pass it
3116 to callees that need locking objects.
3117 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
3118 to lock EXIDX input sections. Fix a formatting issue. Call
3119 Arm_exidx_merged_section::build_contents to create merged section
3120 contents.
3121 (Arm_output_section::create_stub_group): New parameter TASK. Use it
3122 to lock object of stub table owner.
3123 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
3124 TEXT_SIZE to initialize data member TEXT_SIZE_.
3125 (Arm_exidx_input_section::addralign): Fix typo in comment.
3126 (Arm_exidx_input_section::text_size): New method.
3127 (Target_arm::do_relax): New parameter TASK. Pass it to callees
3128 that require locking objects. Lock objects before scanning for stubs
3129 and updating local symbols.
3130 (Arm_input_section<big_endian>::init): Copy contents of original
3131 input section.
3132 (Arm_input_section<big_endian>::do_write): Use saved contents of
3133 original input section instead of calling Object::section_contents
3134 without locking.
3135 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
3136 size without calling Object::section_size().
3137 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
3138 for size. Allocate a buffer for merged EXIDX entries.
3139 (Arm_exidx_merged_section::build_contents): New method.
3140 (Arm_exidx_merged_section::do_write): Move merge section contents
3141 building code to Arm_exidx_merged_section::build_contetns. Write
3142 out contetns in buffer instead of building it on the fly.
3143 (Arm_relobj::make_exidx_input_section): Also pass text section size
3144 to Arm_exidx_input_section constructor.
3145 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
3146 (Arm_dynobj::do_read_symbols): Fix memory leak.
3147 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
3148 * target.h: (class Task): Add forward declaration.
3149 (Target::relax): Add new parameter TASK and pass it to
3150 Target::do_relax().
3151 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
3152
5f9bcf58
CC
31532010-11-05 Cary Coutant <ccoutant@google.com>
3154
3155 PR gold/10708
3156 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
3157 object when reading from the file.
3158 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
3159 second layout pass.
3160 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
3161 when reading section contents.
3162 (get_section_contents): Likewise.
3163 (icf::find_identical_sections): Likewise.
3164 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
3165 object when reading from the file.
3166 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
3167 the object when doing deferred section layout.
3168
e597fa08
NC
31692010-11-03 Nick Clifton <nickc@redhat.com>
3170
3171 PR gold/12001
3172 * script.h (class Symbol_assignment: name): New member. Returns
3173 the name of the symbol.
3174 * scrfipt.cc (Script_options::is_pending_assignment): New member.
3175 Returns true if the given symbol name is on the list of
3176 assignments wating to be processed.
3177 * archive.cc (should_incldue_member): If the symbol is undefined,
3178 check to see if it is on the list of symbols pending assignment.
3179
3f9a3278
ILT
31802010-11-03 Ryan Mansfield <rmansfield@qnx.com>
3181
3182 * script-sections.cc (Script_sections::find_memory_region): Check
3183 for a NULL output section pointer.
3184
d06fb4d1
DK
31852010-10-29 Doug Kwan <dougkwan@google.com>
3186
3187 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
3188 Output_section::add_relaxed_input_section.
3189 * output.cc (Output_section::add_relaxed_input_section): Add new
3190 arguments LAYOUT and NAME. Set section order index.
3191 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
3192 Copy section order index.
3193 * output.h (Output_section::add_relaxed_input_section): Add new
3194 arguments LAYOUT and NAME.
3195
90e24de5
ILT
31962010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3197
3198 * testsuite/Makefile.am: Move gcctestdir/ld rule to
3199 NATIVE_OR_CROSS_LINKER.
3200 * testsuite/Makefile.in: Regenerate.
3201
c9484ea5
DK
32022010-10-20 Doug Kwan <dougkwan@google.com>
3203
3204 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
3205 without SHF_LINK_ORDER flags.
3206 * layout.cc (Layout::choose_output_section): Do not filter
3207 SHF_LINK_ORDER flag in a relocatable link.
3208
5bc2f5be
CC
32092010-10-17 Cary Coutant <ccoutant@google.com>
3210
3211 * output.h (Output_segment::set_section_addresses): Change function
3212 signature. Update all callers.
3213 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
3214 sections.
3215 (Output_segment::set_section_addresses): Align after last TLS
3216 section. Add padding before last relro section instead of after.
3217
0c91cf04
DK
32182010-10-17 Doug Kwan <dougkwan@google.com>
3219
3220 * gold/arm.cc (Target_arm::got_section): Use correct order and set
3221 GOT output section to be writable.
3222
8c21d9d3
CC
32232010-10-14 Cary Coutant <ccoutant@google.com>
3224
3225 * debug.h (DEBUG_INCREMENTAL): New flag.
3226 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
3227 * gold.cc (queue_initial_tasks): Check parameters for incremental link
3228 mode.
3229 * incremental.cc (report_command_line): Ignore all forms of
3230 --incremental.
3231 * layout.cc (Layout::Layout): Check parameters for incremental link
3232 mode.
3233 * options.cc (General_options::parse_incremental): New function.
3234 (General_options::parse_no_incremental): New function.
3235 (General_options::parse_incremental_full): New function.
3236 (General_options::parse_incremental_update): New function.
3237 (General_options::incremental_mode_): New data member.
3238 (General_options::finalize): Check incremental_mode_.
3239 * options.h (General_options): Update help text for --incremental.
3240 Add --no-incremental, --incremental-full, --incremental-update.
3241 (General_options::Incremental_mode): New enum type.
3242 (General_options::incremental_mode): New function.
3243 (General_options::incremental_mode_): New data member.
3244 * parameters.cc (Parameters::incremental_mode_): New data member.
3245 (Parameters::set_options): Set incremental_mode_.
3246 (Parameters::set_incremental_full): New function.
3247 (Parameters::incremental): New function.
3248 (Parameters::incremental_update): New function.
3249 (set_parameters_incremental_full): New function.
3250 * parameters.h (Parameters::set_incremental_full): New function.
3251 (Parameters::incremental): New function.
3252 (Parameters::incremental_update): New function.
3253 (Parameters::incremental_mode_): New data member.
3254 (set_parameters_incremental_full): New function.
3255 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
3256 incremental link mode.
3257 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
3258 (Sized_relobj::do_relocate_sections): Likewise.
3259 * testsuite/Makefile.am (incremental_test): Use --incremental-full
3260 option.
3261 * testsuite/Makefile.in: Regenerate.
3262 * testsuite/incremental_test.sh: Filter all forms of --incremental.
3263
bb32aa18 32642010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
3265
3266 * script-sections.h (class Script_sections): Make
3267 Sections_elements typedef public.
3268 * script-sections.cc (class Sort_output_sections): Add elements_
3269 field. Add constructor which sets it; change all callers.
3270 (Sort_output_sections::is_before): New function.
3271 (Sort_output_sections::operator()): Call is_before.
3272 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
3273 conditional.
3274 * testsuite/script_test_10.sh: New test. Test script section
3275 order.
3276 * testsuite/script_test_10.t: Likewise.
3277 * testsuite/script_test_10.s: Likewise.
3278 * testsuite/Makefile.am: Wrap the cross linker tests and the
3279 common tests into NATIVE_OR_CROSS_LINKER.
3280 (check_SCRIPTS): Add script_test_10.sh.
3281 (check_DATA): Add script_test_10.stdout.
3282 (script_test_10.o, script_test_10): New targets.
3283 (script_test_10.stdout): New target.
3284 * configure, testsuite/Makefile.in: Regenerate.
3285
3cef7179
ILT
32862010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3287
3288 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
3289 error for the deprecated relocations.
3290 (Target_arm::Scan::global): Likewise.
3291 (Target_arm::Relocate::relocate): Likewise.
3292
7411e9a8
RS
32932010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
3294
3295 * fileread.cc (Input_file::find_file): Initialize *found_name
3296 and *namep when using the fallback search for case 4.
3297
6a9da32a
CC
32982010-10-11 Cary Coutant <ccoutant@google.com>
3299
3300 * options.h (class General_options): Redefine -z lazy as an alias for
3301 the negation of -z now.
3302
ac897c20
ILT
33032010-10-11 Ian Lance Taylor <iant@google.com>
3304
3305 * resolve.cc (symbol_to_bits): Report the value of the unsupported
3306 binding.
3307
ea5cae92
NC
33082010-10-06 Nick Clifton <nickc@redhat.com>
3309
3310 * script-sections.cc(class Memory_region): Remove
3311 current_lma_offset_ field. Rename current_vma_offset_ to
3312 current_offset_. Add last_section_ field.
3313 (Memory_region::get_current_vma_address): Rename to
3314 get_current_address.
3315 (Memory_region::get_current_lma_address): Delete.
3316 (Memory_region::increment_vma_offset): Rename to
3317 increment_offset.
3318 (Memory_region::increment_lma_offset): Delete.
3319 (Memory_region::attributes_compatible): New method. Returns
3320 true if the provided section is compatible with the region.
3321 (Memory_region::get_last_section): New method. Returns the last
3322 section to use the region.
3323 (Memory_region::set_last_section): New method. Stores the last
3324 section to use the region.
3325 (Script_sections::block_in_region): New method. Returns true if
3326 a block of memory is contained within a region.
3327 (Script_sections::find_memory_region): New method. Locates a
3328 memory region to be used to set a VMA or LMA address.
3329 (Output_section_definition::set_section_addresses): Add code to
3330 check for addresses set by memory regions.
3331 (Output_segment::set_section_addresses): Remove memory region
3332 walking code.
3333 (Script_sections::create_segment): Add a warning if a header
3334 segment is created outside of any region.
3335 * script-sections.h (class Script_sections): Add prototypes for
3336 find_memory_region and block_in_region methods.
3337 * testsuite/memory_test.s: Use .long instead of .word.
3338 * testsuite/memory_test.t: Add some more output sections.
3339 * testsuite/memory_test.sh: Update expected output.
3340
a9bfd952
DK
33412010-10-02 Doug Kwan <dougkwan@google.com>
3342
3343 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
3344 defintion to symtab.h
3345 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
3346 declaration to defintion.
3347
bacff3ab
NC
33482010-10-01 Nick Clifton <nickc@redhat.com>
3349
3350 * expression.cc (eval): Replace dummy argument with NULL.
3351 (eval_maybe_dot): Check for a NULL result section pointer.
3352 (Symbol_expression::value): Likewise.
3353 (Dot_expression::value): Likewise.
3354 (BINARY_EXPRESSION): Likewise.
3355 (Max_expression::value): Likewise.
3356 (Min_expression::value): Likewise.
3357 (Absolute_expression::value): Likewise.
3358 (Addr_expression::value_from_output_section): Likewise.
3359 (Loaddddr_expression::value_from_output_section): Likewise.
3360 (Segment_start_expression::value): Likewise.
3361 * script-sections.cc
3362 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
3363 argument with NULL.
3364 (Sections_elememt_dot_assignment::set_section_addresses):
3365 Likewise.
3366 (Output_data_expression::do_write_to_buffer): Likewise.
3367 (Output_section_definition::finalize_symbols): Likewise.
3368 (Output_section_definition::set_section_addresses): Likewise.
3369
f81bc8b5
DK
33702010-09-30 Doug Kwan <dougkwan@google.com>
3371
3372 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
3373
c95e9f27
ST
33742010-09-28 Sriraman Tallam <tmsriram@google.com>
3375
3376 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 3377 function.
c95e9f27
ST
3378 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
3379 virtual function.
3380 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
3381 virtual function.
3382 * icf.cc (get_section_contents): Inline merge sections only when
3383 target allows it.
3384
3cac54d2
RW
33852010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3386
3387 * configure: Regenerate.
3388
2904037a
ILT
33892010-09-17 Ian Lance Taylor <iant@google.com>
3390
3391 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
3392 * testsuite/Makefile.am (memory_test.o): New target.
3393 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
3394 memory_test.t.
3395 * testsuite/Makefile.in: Rebuild.
2904037a 3396
bca7fb63
DK
33972010-09-17 Doug Kwan <dougkwan@google.com>
3398
3399 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
3400 defintion if relocation uses GOT entries of the symbol.
3401 * testsuite/icf_safe_test.sh: Fix test.
3402 * testsuite/icf_safe_so_test.sh: Fix test.
3403
4ef28648
CC
34042010-09-16 Cary Coutant <ccoutant@google.com>
3405
3406 * script_sections.cc (class Memory_region): Remove "NULL" from
3407 vector initializations.
3408
793990de
CC
34092010-09-15 Cary Coutant <ccoutant@google.com>
3410
3411 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
3412 Resolve forwarding symbols.
3413
81e015e2
DK
34142010-09-15 Doug Kwan <dougkwan@google.com>
3415
3416 * gold/testsuite/script_test_3.t: Add ARM special sections.
3417 * gold/testsuite/script_test_4.t: Same.
3418 * gold/testsuite/script_test_5.t: Same.
3419 * gold/testsuite/script_test_6.t: Same.
3420 * gold/testsuite/script_test_7.t: Same.
3421 * gold/testsuite/script_test_7.t: Same.
3422 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
3423
36171d64
CC
34242010-09-14 Cary Coutant <ccoutant@google.com>
3425
3426 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
3427 (Target_x86_64::Relocate::relocate_tls): Replace check for
3428 saw_tls_block_reloc_ with test for executable section.
3429
d89051bd
CC
34302010-09-12 Cary Coutant <ccoutant@google.com>
3431
3432 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
3433 position-independent executables to shared libraries need dynamic
3434 relocations.
3435 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
3436 position-independent executables.
3437 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
3438 * testsuite/Makefile.in: Regenerate.
3439
fca41f0f
NC
34402010-09-10 Nick Clifton <nickc@redhat.com>
3441
3442 PR gold/11997
3443 * testsuite/memory_test.t: Discard any sections that are not
3444 needed.
3445
6695e4b3
L
34462010-09-09 H.J. Lu <hongjiu.lu@intel.com>
3447
3448 PR gold/11996
3449 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
3450 "This::" to work around a bug in gcc 4.2.
3451
3452 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
3453
0f72bf6f
RÁE
34542010-09-09 Rafael Espindola <espindola@google.com>
3455
3456 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
3457 sections with different PF_X flags in the same segment.
3458 (Layout::find_first_load_seg): Search all segments to find the first
3459 one.
3460 * options.h (rosegment): New.
3461
34622010-09-08 Rafael Espindola <espindola@google.com>
a6577478 3463
05a79166 3464 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 3465
aa98ff75
DK
34662010-09-08 Doug Kwan <dougkwan@google.com>
3467
3468 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
3469 (Arm_relobj::do_relocate_sections): Add new parameter for output
3470 file to match the parent.
3471 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
3472 of local symbols instead of input values. Update code to track
3473 changes in gold::relocate_section.
3474 * object.cc (Sized_relobj::compute_final_local_value): New methods.
3475 (Sized_relobj::compute_final_local_value_internal): New methods.
3476 (Sized_relobj::do_finalize_local_symbols): Move code from loop
3477 body into private version of Sized_relobj::compute_final_local_value.
3478 Call the inline method.
3479 * object.h (Symbol_value::Symbol_value): Define destructor. Free
3480 merged symbol value if there is one.
3481 (Symbol_value::has_output_value): New method defintiion.
3482 (Sized_relobj::Compute_final_local_value_status): New enum type.
3483 (Sized_relobj::compute_final_local_value): New methods.
3484 (Sized_relobj::compute_final_local_value_internal): New methods.
3485 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
3486 and arm_cortex_a8.sh.
3487 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
3488 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
3489 New tests.
3490 * Makefile.in: Regenerate.
3491 * testsuite/arm_bl_out_of_range.s: Update test.
3492 * testsuite/thumb_bl_out_of_range.s: Ditto.
3493 * testsuite/thumb_blx_out_of_range.s: Ditto.
3494 * testsuite/arm_branch_out_of_range.sh: New file.
3495 * testsuite/arm_cortex_a8.sh: Ditto.
3496 * testsuite/arm_cortex_a8_b.s: Ditto.
3497 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
3498 * testsuite/arm_cortex_a8_b_local.s: Ditto.
3499 * testsuite/arm_cortex_a8_bl.s: Ditto.
3500 * testsuite/arm_cortex_a8_blx.s: Ditto.
3501 * testsuite/arm_cortex_a8_local.s: Ditto.
3502 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
3503 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
3504
05a79166
L
35052010-09-08 Rafael Espindola <espindola@google.com>
3506
3507 * Makefile.am (memory_test.stdout): Run readelf with -W.
3508 * Makefile.in: Regenerate.
3509 * testsuite/memory_test.sh: Make the regexps accept both 32 and
3510 64 bit output.
3511
33dbc701
RÁE
35122010-09-08 Rafael Espindola <espindola@google.com>
3513
3514 * script-sections.cc (Script_sections::add_memory_region): Convert
3515 field precision to int.
3516 * script.cc (script_set_section_region, script_set_section_region):
3517 Convert field precision to int.
3518
731ca54a
RÁE
35192010-09-08 Rafael Espindola <espindola@google.com>
3520
3521 * arm.cc (do_finalize_sections): Create the __exidx_start and
3522 __exdix_end symbols even when the section is missing.
3523
7f8cd844
NC
35242010-09-08 Nick Clifton <nickc@redhat.com>
3525
3526 * README: Remove claim that MEMORY is not supported.
3527 * expression.cc (script_exp_function_origin)
3528 (script_exp_function_length): Move from here to ...
3529 * script.cc: ... here.
3530 (script_set_section_region, script_add_memory)
3531 (script_parse_memory_attr, script_include_directive): New
3532 functions.
3533 * script-sections.cc
3534 (class Memory_region): New class.
3535 (class Output_section_definition): Add set_memory_region,
3536 set_section_vma, set_section_lma and get_section_name methods.
3537 (class Script_Sections): Add add_memory_region,
3538 find_memory_region, find_memory_region_origin,
3539 find_memory_region_length and set_memory_region methods.
3540 Have set_section_addresses method walk the list of set memory
3541 regions.
3542 Extend the print methos to display memory regions.
3543 * script-sections.h: Add prototypes for new methods.
3544 Add enum for MEMORY region attributes.
3545 * yyscript.y: Add support for parsing MEMORY regions.
3546 * script-c.h: Add prototypes for new functions.
3547 * testsuite/Makefile.am: Add test of MEMORY region functionality.
3548 * testsuite/Makefile.in: Regenerate.
3549 * testsuite/memory_test.sh: New script.
3550 * testsuite/memory_test.s: New assembler source file.
3551 * testsuite/memory_test.t: New linker script.
3552
a4649286
DK
35532010-08-27 Doug Kwan <dougkwan@google.com>
3554
3555 * gold/resolve.cc (Symbol_table::should_override): Let a weak
3556 reference override an existing dynamic weak reference.
3557 * testsuite/Makefile.am: Add new test dyn_weak_ref.
3558 * testsuite/Makefile.in: Regenerate.
3559 * testsuite/dyn_weak_ref.sh: New file.
3560 * testsuite/dyn_weak_ref_1.c: Ditto.
3561 * testsuite/dyn_weak_ref_2.c: Ditto.
3562
b56648ad
ILT
35632010-08-27 Ian Lance Taylor <iant@google.com>
3564
3565 * incremental.h (class Incremental_input_entry): Add virtual
3566 destructor.
3567
809313cb
ILT
35682010-08-27 Ian Lance Taylor <iant@google.com>
3569
3570 * testsuite/start_lib_test_3.c: Mark t3 as used.
3571
11e32464
NC
35722010-08-27 Nick Clifton <nickc@redhat.com>
3573
3574 * options.cc (version_script): Fix small typo in previous
3575 whitespace tidyup.
3576
ca09d69a
NC
35772010-08-25 Nick Clifton <nickc@redhat.com>
3578
3579 * archive.cc: Formatting fixes: Remove whitespace between
3580 typename and following asterisk. Remove whitespace between
3581 function name and opening parenthesis.
3582 * archive.h: Likewise.
3583 * arm.cc: Likewise.
3584 * attributes.cc: Likewise.
3585 * attributes.h: Likewise.
3586 * common.cc: Likewise.
3587 * copy-relocs.cc: Likewise.
3588 * dirsearch.h: Likewise.
3589 * dynobj.cc: Likewise.
3590 * ehframe.cc: Likewise.
3591 * ehframe.h: Likewise.
3592 * expression.cc: Likewise.
3593 * fileread.cc: Likewise.
3594 * fileread.h: Likewise.
3595 * gc.h: Likewise.
3596 * gold-threads.cc: Likewise.
3597 * gold.cc: Likewise.
3598 * i386.cc: Likewise.
3599 * icf.h: Likewise.
3600 * incremental-dump.cc: Likewise.
3601 * incremental.cc: Likewise.
3602 * layout.cc: Likewise.
3603 * layout.h: Likewise.
3604 * main.cc: Likewise.
3605 * merge.cc: Likewise.
3606 * merge.h: Likewise.
3607 * object.cc: Likewise.
3608 * object.h: Likewise.
3609 * options.cc: Likewise.
3610 * options.h: Likewise.
3611 * output.cc: Likewise.
3612 * output.h: Likewise.
3613 * plugin.cc: Likewise.
3614 * plugin.h: Likewise.
3615 * powerpc.cc: Likewise.
3616 * reloc.cc: Likewise.
3617 * script-c.h: Likewise.
3618 * script-sections.cc: Likewise.
3619 * script.cc: Likewise.
3620 * stringpool.cc: Likewise.
3621 * symtab.cc: Likewise.
3622 * symtab.h: Likewise.
3623 * target.cc: Likewise.
3624 * timer.cc: Likewise.
3625 * timer.h: Likewise.
3626 * version.cc: Likewise.
3627 * x86_64.cc: Likewise.
3628
b8fa8750
NC
36292010-08-24 Nick Clifton <nickc@redhat.com>
3630
3631 PR 11899
3632 * layout.cc (segment_precedes): Sort segments by their physical
3633 addresses, if they have been set.
3634
9919d93b
CC
36352010-08-23 Cary Coutant <ccoutant@google.com>
3636
3637 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
3638 symbols data.
3639 (Lib_group::include_member): Unlock object after deleting its
3640 symbols data.
3641 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
3642 the bug fixed here.
3643
97b4be1c
CC
36442010-08-19 Neil Vachharajani <nvachhar@google.com>
3645 Cary Coutant <ccoutant@google.com>
3646
3647 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
3648 constructor, and set_blocker.
3649 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
3650 readsyms_blocker_.
3651 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
3652 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
3653 * testsuite/Makefile.am (start_lib_test): New test case.
3654 * testsuite/Makefile.in: Regenerate.
3655 * testsuite/start_lib_test_main.c: New file.
3656 * testsuite/start_lib_test_1.c: New file.
3657 * testsuite/start_lib_test_2.c: New file.
3658 * testsuite/start_lib_test_3.c: New file.
3659
dd0b1884
ILT
36602010-08-19 Ian Lance Taylor <iant@google.com>
3661
3662 * Makefile.in: Rebuild with automake 1.11.1.
3663 * aclocal.m4: Likewise.
3664 * testsuite/Makefile.in: Likewise.
3665
7223e9ca
ILT
36662010-08-19 Ian Lance Taylor <iant@google.com>
3667
3668 PR 10893
3669 * i386.cc (class Output_data_plt_i386): Update declarations.
3670 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
3671 local_ifuncs_ fields.
3672 (Target_i386::do_plt_section_for_global): New function.
3673 (Target_i386::do_plt_section_for_local): New function.
3674 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
3675 parameter; change all callers. Initialize global_ifuncs_ and
3676 local_ifuncs_. If doing a static link define __rel_iplt_start and
3677 __rel_iplt_end.
3678 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
3679 (Output_data_plt_i386::add_local_ifunc_entry): New function.
3680 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
3681 symbols.
3682 (Target_i386::make_plt_section): New function, broken out of
3683 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
3684 (Target_i386::make_plt_entry): Call make_plt_section.
3685 (Target_i386::make_local_ifunc_plt_entry): New function.
3686 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
3687 (Target_i386::Scan::local): Handle IFUNC symbols. Add
3688 R_386_IRELATIVE to switch.
3689 (Target_i386::Scan::global): Likewise.
3690 (Target_i386::Relocate::relocate): Likewise.
3691 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
3692 switch.
3693 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
3694 (Target_x86_64::do_plt_section_for_global): New function.
3695 (Target_x86_64::do_plt_section_for_local): New function.
3696 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
3697 parameter; change all callers. If doing a static link define
3698 __rela_iplt_start and __rela_iplt_end.
3699 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
3700 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
3701 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
3702 to point to .plt.
3703 (Target_x86_64::make_local_ifunc_plt_entry): New function.
3704 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
3705 switch.
3706 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
3707 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
3708 R_X86_64_IRELATIVE to switch.
3709 (Target_x86_64::Scan::global): Likewise.
3710 (Target_x86_64::Relocate::relocate): Likewise.
3711 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
3712 switch.
3713 * target.h (class Target): Add plt_section_for_global and
3714 plt_section_for_local functions. Add do_plt_section_for_global
3715 and do_plt_section_for_local virtual functions.
3716 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
3717 clarifying comments.
3718 (Symbol::use_plt_offset): Handle IFUNC symbol.
3719 * object.cc (Sized_relobj::Sized_relobj): Initialize
3720 local_plt_offsets_.
3721 (Sized_relobj::local_has_plt_offset): New function.
3722 (Sized_relobj::local_plt_offset): New function.
3723 (Sized_relobj::set_local_plt_offset): New function.
3724 (Sized_relobj::do_count): Handle IFUNC symbol.
3725 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
3726 a bit away from input_shndx_ field. Add set_is_func_symbol and
3727 is_ifunc_symbol functions.
3728 (class Sized_relobj): Update declarations. Remove Tls_got_entry
3729 and Local_tls_got_offsets. Define Local_plt_offsets. Add
3730 local_plt_offsets_ field.
3731 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
3732 * output.h (class Output_section_data): Add non-const
3733 output_section function.
3734 (class Output_data_got): Update declarations.
3735 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
3736 Add use_plt_offset parameter to global and local constructors.
3737 Change all callers. Change local_sym_index_ field to 31 bits.
3738 Change GSYM_CODE and CONSTANT_CODE accordingly.
3739 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
3740 doing a static link don't set sh_link field.
3741 (Output_data_got::Got_entry::write): Use PLT offset if
3742 appropriate.
3743 (Output_data_got::add_global_plt): New function.
3744 (Output_data_got::add_local_plt): New function.
3745 * target-reloc.h (relocate_section): Handle IFUNC symbol.
3746 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
3747 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
3748 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
3749 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
3750 IFUNC conditional.
3751 * testsuite/ifunc-sel.h: New file.
3752 * testsuite/ifuncmain1.c: New file.
3753 * testsuite/ifuncmain1vis.c: New file.
3754 * testsuite/ifuncmod1.c: New file.
3755 * testsuite/ifuncdep2.c: New file.
3756 * testsuite/ifuncmain2.c: New file.
3757 * testsuite/ifuncmain3.c: New file.
3758 * testsuite/ifuncmod3.c: New file.
3759 * testsuite/ifuncmain4.c: New file.
3760 * testsuite/ifuncmain5.c: New file.
3761 * testsuite/ifuncmod5.c: New file.
3762 * testsuite/ifuncmain6pie.c: New file.
3763 * testsuite/ifuncmod6.c: New file.
3764 * testsuite/ifuncmain7.c: New file.
3765 * configure, testsuite/Makefile.in: Rebuild.
3766
56f75c03
ILT
37672010-08-18 Ian Lance Taylor <iant@google.com>
3768
3769 * incremental.cc
3770 (Output_section_incremental_inputs::write_input_files): Add cast
3771 to avoid signed/unsigned comparison warning.
3772 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3773
55455f89
CC
37742010-08-12 Cary Coutant <ccoutant@google.com>
3775
3776 * common.cc (Sort_commons::operator()): Remove unnecessary code.
3777
e2054bcb
ILT
37782010-08-13 Ian Lance Taylor <iant@google.com>
3779
3780 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
3781
74f67560
DK
37822010-08-12 Cary Coutant <ccoutant@google.com>
3783 Doug Kwan <dougkwan@google.com>
3784
3785 * resolve.cc (Symbol_table::should_override): When a weak dynamic
3786 defintion overrides non-weak undef, remember that the original undef
3787 is not weak.
3788 * symtab.cc (Symbol_table::sized_write_global): For undef without
3789 an original weak binding, set binding to global in output.
3790 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
3791 * testsuite/Makefile.in: Regenerate.
3792 * testsuite/strong_ref_weak_def.sh: New file.
3793 * testsuite/strong_ref_weak_def_1.c: Ditto.
3794 * testsuite/strong_ref_weak_def_2.c: Ditto.
3795
d1238d12
CC
37962010-08-12 Cary Coutant <ccoutant@google.com>
3797
3798 * testsuite/incremental_test.sh: Rewrite.
3799 * testsuite/incremental_test_1.c: Rewrite.
3800 * testsuite/incremental_test_2.c: Rewrite.
3801
0e70b911
CC
38022010-08-12 Cary Coutant <ccoutant@google.com>
3803
3804 * arm.cc (Target_arm::got_size): Add const.
3805 (Target_arm::got_entry_count): New function.
3806 (Target_arm::plt_entry_count): New function.
3807 (Target_arm::first_plt_entry_offset): New function.
3808 (Target_arm::plt_entry_size): New function.
3809 (Output_data_plt_arm::entry_count): New function.
3810 (Output_data_plt_arm::first_plt_entry_offset): New function.
3811 (Output_data_plt_arm::get_plt_entry_size): New function.
3812 * i386.cc (Target_i386::got_size): Add const.
3813 (Target_i386::got_entry_count): New function.
3814 (Target_i386::plt_entry_count): New function.
3815 (Target_i386::first_plt_entry_offset): New function.
3816 (Target_i386::plt_entry_size): New function.
3817 (Output_data_plt_i386::entry_count): New function.
3818 (Output_data_plt_i386::first_plt_entry_offset): New function.
3819 (Output_data_plt_i386::get_plt_entry_size): New function.
3820 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
3821 find_incremental_inputs_sections. Dump incremental_got_plt section.
3822 * incremental.cc: Include target.h.
3823 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
3824 parameter. Adjust all callers. Find incremental_got_plt section.
3825 (Incremental_inputs::create_data_sections): Create incremental_got_plt
3826 section.
3827 (Output_section_incremental_inputs::set_final_data_size): Calculate
3828 size of incremental_got_plt section.
3829 (Output_section_incremental_inputs::do_write): Write the
3830 incremental_got_plt section.
3831 (Got_plt_view_info): New struct.
3832 (Local_got_offset_visitor): New class.
3833 (Global_got_offset_visitor): New class.
3834 (Global_symbol_visitor_got_plt): New class.
3835 (Output_section_incremental_inputs::write_got_plt): New function.
3836 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
3837 Add parameter. Adjust all callers.
3838 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
3839 (Incremental_inputs::got_plt_section): New function.
3840 (Incremental_inputs::got_plt_section_): New data member.
3841 (Incremental_got_plt_reader): New class.
3842 * layout.cc (Layout::create_incremental_info_sections): Add the
3843 incremental_got_plt section.
3844 * object.h (Got_offset_list::get_list): New function.
3845 (Got offset_list::for_all_got_offsets): New function.
3846 (Sized_relobj::local_got_offset_list): New function.
3847 * powerpc.cc (Target_powerpc::got_size): Add const.
3848 (Target_powerpc::got_entry_count): New function.
3849 (Target_powerpc::plt_entry_count): New function.
3850 (Target_powerpc::first_plt_entry_offset): New function.
3851 (Target_powerpc::plt_entry_size): New function.
3852 (Output_data_plt_powerpc::entry_count): New function.
3853 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
3854 (Output_data_plt_powerpc::get_plt_entry_size): New function.
3855 * sparc.cc (Target_sparc::got_size): Add const.
3856 (Target_sparc::got_entry_count): New function.
3857 (Target_sparc::plt_entry_count): New function.
3858 (Target_sparc::first_plt_entry_offset): New function.
3859 (Target_sparc::plt_entry_size): New function.
3860 (Output_data_plt_sparc::entry_count): New function.
3861 (Output_data_plt_sparc::first_plt_entry_offset): New function.
3862 (Output_data_plt_sparc::get_plt_entry_size): New function.
3863 * symtab.h (Symbol::got_offset_list): New function.
3864 (Symbol_table::for_all_symbols): New function.
3865 * target.h (Sized_target::got_entry_count): New function.
3866 (Sized_target::plt_entry_count): New function.
3867 (Sized_target::plt_entry_size): New function.
3868 * x86_64.cc (Target_x86_64::got_size): Add const.
3869 (Target_x86_64::got_entry_count): New function.
3870 (Target_x86_64::plt_entry_count): New function.
3871 (Target_x86_64::first_plt_entry_offset): New function.
3872 (Target_x86_64::plt_entry_size): New function.
3873 (Output_data_plt_x86_64::entry_count): New function.
3874 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
3875 (Output_data_plt_x86_64::get_plt_entry_size): New function.
3876
09ec0418
CC
38772010-08-12 Cary Coutant <ccoutant@google.com>
3878
3879 * archive.cc: Include incremental.h.
3880 (Archive::Archive): Initialize incremental_info_.
3881 (Archive::include_member): Record archive members in incremental info.
3882 (Add_archive_symbols::run): Record begin and end of an archive in
3883 incremental info.
3884 (Lib_group::include_member): Record objects in incremental info.
3885 * archive.h (Incremental_archive_entry): Forward declaration.
3886 (Archive::set_incremental_info): New member function.
3887 (Archive::incremental_info): New member function.
3888 (Archive::Unused_symbol_iterator): New class.
3889 (Archive::unused_symbols_begin): New member function.
3890 (Archive::unused_symbols_end): New member function.
3891 (Archive::incremental_info_): New data member.
3892 * incremental-dump.cc (find_input_containing_global): New function.
3893 (dump_incremental_inputs): Dump new incremental info sections.
3894 * incremental.cc: Include symtab.h.
3895 (Output_section_incremental_inputs): New class.
3896 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
3897 new incremental info sections.
3898 (Sized_incremental_binary::do_check_inputs): Likewise.
3899 (Incremental_inputs::report_archive): Remove.
3900 (Incremental_inputs::report_archive_begin): New function.
3901 (Incremental_inputs::report_archive_end): New function.
3902 (Incremental_inputs::report_object): New function.
3903 (Incremental_inputs::finalize_inputs): Remove.
3904 (Incremental_inputs::report_input_section): New function.
3905 (Incremental_inputs::report_script): Rewrite.
3906 (Incremental_inputs::finalize): Do nothing but finalize string table.
3907 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
3908 (Incremental_inputs::sized_create_inputs_section_data): Remove.
3909 (Incremental_inputs::create_data_sections): New function.
3910 (Incremental_inputs::relocs_entsize): New function.
3911 (Output_section_incremental_inputs::set_final_data_size): New function.
3912 (Output_section_incremental_inputs::do_write): New function.
3913 (Output_section_incremental_inputs::write_header): New function.
3914 (Output_section_incremental_inputs::write_input_files): New function.
3915 (Output_section_incremental_inputs::write_info_blocks): New function.
3916 (Output_section_incremental_inputs::write_symtab): New function.
3917 * incremental.h (Incremental_script_entry): Forward declaration.
3918 (Incremental_object_entry): Forward declaration.
3919 (Incremental_archive_entry): Forward declaration.
3920 (Incremental_inputs): Forward declaration.
3921 (Incremental_inputs_header_data): Remove.
3922 (Incremental_inputs_header): Remove.
3923 (Incremental_inputs_header_write): Remove.
3924 (Incremental_inputs_entry_data): Remove.
3925 (Incremental_inputs_entry): Remove.
3926 (Incremental_inputs_entry_write): Remove.
3927 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
3928 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
3929 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
3930 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
3931 Likewise.
3932 (Incremental_input_entry): New class.
3933 (Incremental_script_entry): New class.
3934 (Incremental_object_entry): New class.
3935 (Incremental_archive_entry): New class.
3936 (Incremental_inputs::Incremental_inputs): Initialize new data members.
3937 (Incremental_inputs::report_inputs): Remove.
3938 (Incremental_inputs::report_archive): Remove.
3939 (Incremental_inputs::report_archive_begin): New function.
3940 (Incremental_inputs::report_archive_end): New function.
3941 (Incremental_inputs::report_object): Change prototype.
3942 (Incremental_inputs::report_input_section): New function.
3943 (Incremental_inputs::report_script): Change prototype.
3944 (Incremental_inputs::get_reloc_count): New function.
3945 (Incremental_inputs::set_reloc_count): New function.
3946 (Incremental_inputs::create_data_sections): New function.
3947 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
3948 (Incremental_inputs::inputs_section): New function.
3949 (Incremental_inputs::symtab_section): New function.
3950 (Incremental_inputs::relocs_section): New function.
3951 (Incremental_inputs::get_stringpool): Add const.
3952 (Incremental_inputs::command_line): Add const.
3953 (Incremental_inputs::inputs): Remove.
3954 (Incremental_inputs::command_line_key): New function.
3955 (Incremental_inputs::input_file_count): New function.
3956 (Incremental_inputs::input_files): New function.
3957 (Incremental_inputs::relocs_entsize): New function.
3958 (Incremental_inputs::sized_create_inputs_section_data): Remove.
3959 (Incremental_inputs::finalize_inputs): Remove.
3960 (Incremental_inputs::Input_info): Remove.
3961 (Incremental_inputs::lock_): Remove.
3962 (Incremental_inputs::inputs_): Change type.
3963 (Incremental_inputs::inputs_map_): Remove.
3964 (Incremental_inputs::current_object_entry_): New data member.
3965 (Incremental_inputs::inputs_section_): New data member.
3966 (Incremental_inputs::symtab_section_): New data member.
3967 (Incremental_inputs::relocs_section_): New data member.
3968 (Incremental_inputs::reloc_count_): New data member.
3969 (Incremental_inputs_reader): New class.
3970 (Incremental_symtab_reader): New class.
3971 (Incremental_relocs_reader): New class.
3972 * layout.cc (Layout::finalize): Move finalization of incremental info
3973 and creation of incremental info sections to follow finalization of
3974 symbol table. Set offsets for postprocessing sections.
3975 (Layout::create_incremental_info_sections): Call
3976 Incremental_inputs::create_data_sections. Add incremental symtab
3977 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
3978 sections to layout after input sections.
3979 * layout.h (struct Timespec): Forward declaration.
3980 (Layout::incremental_inputs): Add const.
3981 (Layout::create_incremental_info_sections): Add parameter.
3982 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
3983 * object.cc: Include incremental.h.
3984 (Relobj::finalize_incremental_relocs): New function.
3985 (Sized_relobj::do_layout): Record input sections in incremental info.
3986 * object.h (Object::output_section): New function.
3987 (Object::output_section_offset): Moved from Relobj.
3988 (Object::get_incremental_reloc_base): New function.
3989 (Object::get_incremental_reloc_count): New function.
3990 (Object::do_output_section): New function.
3991 (Object::do_output_section_offset): Moved from Relobj.
3992 (Object::do_get_incremental_reloc_base): New function.
3993 (Object::do_get_incremental_reloc_count): New function.
3994 (Object::Object): Initialize new data members.
3995 (Relobj::output_section): Renamed do_output_section and moved to
3996 protected.
3997 (Relobj::output_section_offset): Moved to Object.
3998 (Relobj::do_get_incremental_reloc_base): New function.
3999 (Relobj::do_get_incremental_reloc_count): New function.
4000 (Relobj::allocate_incremental_reloc_counts): New function.
4001 (Relobj::count_incremental_reloc): New function.
4002 (Relobj::finalize_incremental_relocs): New function.
4003 (Relobj::next_incremental_reloc_index): New function.
4004 (Relobj::reloc_counts_): New data member.
4005 (Relobj::reloc_bases_): New data member.
4006 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
4007 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
4008 (Sized_relobj::incremental_relocs_scan): New function.
4009 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4010 (Sized_relobj::incremental_relocs_write): New function.
4011 (Sized_relobj::incremental_relocs_write_reltype): New function.
4012 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
4013 incremental link.
4014 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
4015 archives and object files elsewhere.
4016 (Add_symbols::run): Report object files here.
4017 (Finish_group::run): Report end of archive at end of group.
4018 * reloc.cc: Include layout.h, incremental.h.
4019 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
4020 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
4021 (Sized_relobj::incremental_relocs_scan): New function.
4022 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4023 (Sized_relobj::do_relocate_sections): Write incremental relocations.
4024 (Sized_relobj::incremental_relocs_write): New function.
4025 (Sized_relobj::incremental_relocs_write_reltype): New function.
4026 * script.cc (read_input_script): Rewrite test for incremental link.
4027 Change call to Incremental_inputs::report_script.
4028 * symtab.h (Symbol_table::first_global_index): New function.
4029 (Symbol_table::output_count): New function.
4030
ce0d1972
DK
40312010-08-12 Doug Kwan <dougkwan@google.com>
4032
4033 * arm.cc (Target_arm::merge_object_attributes): Check command line
4034 options --no-wchar-size-warning and --no-enum-size-warning.
4035 * options.h (General_options): Add ld-compatible options
4036 --no-enum-size-warning and --no-wchar-size-warning.
4037
6e5710ce
ILT
40382010-08-04 Ian Lance Taylor <iant@google.com>
4039
4040 * x86_64.cc (Target_x86_64::Scan::local): Use
4041 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
4042 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
4043 (Target_x86_64::Scan::global): Likewise.
4044 (Target_x86_64::Relocate::relocate): Likewise.
4045 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
4046 Likewise.
4047
fef830db
CC
40482010-08-03 Cary Coutant <ccoutant@google.com>
4049
4050 * merge.cc (Output_merge_string::do_add_input_section): Count strings
4051 to reserve space in merged_strings vector. Keep total input size
4052 for stats.
4053 (Output_merge_string::do_print_merge_stats): Print total input size.
4054 * merge.h (Output_merge_string): Add input_size_ field.
4055 * stringpool.cc (Stringpool_template::string_length): Move
4056 implementations out of Stringpool_template class and place in
4057 stringpool.h.
4058 * stringpool.h (string_length): Move out of Stringpool_template.
4059
1e3811b0
ILT
40602010-08-03 Ian Lance Taylor <iant@google.com>
4061
4062 PR 11712
4063 * layout.cc (relaxation_loop_body): If address of load segment is
4064 set, adjust address to include headers if possible.
4065
7af0c620
ILT
40662010-08-03 Ian Lance Taylor <iant@google.com>
4067
4068 * version.cc (version_string): Bump to 1.10.
4069
22f0da72
ILT
40702010-08-03 Ian Lance Taylor <iant@google.com>
4071
4072 PR 11805
4073 * layout.h (enum Output_section_order): Define.
4074 (class Layout): Update declarations.
4075 * layout.cc (Layout::get_output_section): Add order parameter.
4076 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
4077 is_first_non_relro parameters. Change all callers.
4078 (Layout::choose_output_section): Likewise.
4079 (Layout::add_output_section_data): Likewise.
4080 (Layout::make_output_section): Likewise. Set order.
4081 (Layout::default_section_order): New function.
4082 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
4083 * output.cc (Output_section::Output_section): Initialize order_.
4084 Don't initialize deleted fields.
4085 (Output_segment::Output_segment): Don't initialize deleted
4086 fields.
4087 (Output_segment::add_output_section_to_load): New function
4088 replacing add_output_section. Change all callers to call this or
4089 add_output_section_to_nonload.
4090 (Output_segment::add_output_section_to_nonload): New function.
4091 (Output_segment::remove_output_section): Rewrite.
4092 (Output_segment::add_initial_output_data): Likewise.
4093 (Output_segment::has_any_data_sections): Likewise.
4094 (Output_segment::is_first_section_relro): Likewise.
4095 (Output_segment::maximum_alignment): Likewise.
4096 (Output_segment::has_dynamic_reloc): New function replacing
4097 dynamic_reloc_count. Change all callers.
4098 (Output_segment::has_dynamic_reloc_list): New function replacing
4099 dynamic_reloc_count_list. Change all callers.
4100 (Output_segment::set_section_addresses): Rewrite.
4101 (Output_segment::set_offset): Rewrite.
4102 (Output_segment::find_first_and_last_list): Remove.
4103 (Output_segment::set_tls_offsets): Rewrite.
4104 (Output_segment::first_section_load_address): Likewise.
4105 (Output_segment::output_section_count): Likewise.
4106 (Output_segment::section_with_lowest_load_address): Likewise.
4107 (Output_segment::write_section_headers): Likewise.
4108 (Output_segment::print_sections_to_map): Likewise.
4109 * output.h (class Output_data): Remove dynamic_reloc_count_
4110 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
4111 (Output_data::add_dynamic_reloc): Rewrite.
4112 (Output_data::has_dynamic_reloc): New function.
4113 (Output_data::dynamic_reloc_count): Remove.
4114 (class Output_section): Add order_ field. Remvoe is_relro_local_,
4115 is_last_relro_, is_first_non_relro_, is_interp_,
4116 is_dynamic_linker_section_ fields. Add order and set_order
4117 functions. Remove is_relro_local, set_is_relro_local,
4118 is_last_relro, set_is_last_relro, is_first_non_relro,
4119 set_is_first_non_relro functions, is_interp, set_is_interp,
4120 is_dynamic_linker_section, and set_is_dynamic_linker_section
4121 functions.
4122 (class Output_segment): Change Output_data_list from std::list to
4123 std:;vector. Add output_lists_ field. Remove output_data_ and
4124 output_bss_ fields. Update declarations.
4125
3ff2ccb0
ILT
41262010-08-02 Ian Lance Taylor <iant@google.com>
4127
4128 * arm.cc (Target_arm::gc_process_relocs): Use typename.
4129 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
4130 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
4131
88a4108b
ILT
41322010-08-02 Ian Lance Taylor <iant@google.com>
4133
4134 PR 11855
4135 * script.cc (Script_options::Script_options): Initialize
4136 symbol_definitions_ and symbol_references_.
4137 (Script_options::add_symbol_assignment): Update
4138 symbol_definitions_ and symbol_references_.
4139 (Script_options::add_symbol_reference): New function.
4140 (script_symbol): New function.
4141 * script.h (class Script_options): Add symbol_definitions_ and
4142 symbol_references_ fields.
4143 (Script_options::referenced_const_iterator): New type.
4144 (Script_options::referenced_begin): New function.
4145 (Script_options::referenced_end): New function.
4146 (Script_options::is_referenced): New function.
4147 (Script_options::any_unreferenced): New function.
4148 * script-c.h (script_symbol): Declare.
4149 * yyscript.y (exp): Call script_symbol.
4150 * symtab.cc: Include "script.h".
4151 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
4152 Change all callers. Check symbols referenced by scripts.
4153 (Symbol_table::add_undefined_symbols_from_command_line): Add
4154 layout parameter. Change all callers.
4155 (Symbol_table::do_add_undefined_symbols_from_command_line):
4156 Likewise. Break out loop body. Check symbols referenced by
4157 scripts.
4158 (Symbol_table::add_undefined_symbol_from_command_line): New
4159 function broken out of
4160 do_add_undefined_symbols_from_command_line.
4161 * symtab.h (class Symbol_table): Update declarations.
4162 * archive.cc: Include "layout.h".
4163 (Archive::should_include_member): Add layout parameter. Change
4164 all callers. Check for symbol mentioned in expression.
4165 * archive.h (class Archive): Update declaration.
4166 * object.cc (Sized_relobj::do_should_include_member): Add layout
4167 parameter.
4168 * object.h (Object::should_include_member): Add layout parameter.
4169 Change all callers.
4170 (Object::do_should_include_member): Add layout parameter.
4171 (class Sized_relobj): Update declaration.
4172 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
4173 parameter.
4174 * dynobj.h (class Sized_dynobj): Update declaration.
4175 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
4176 layout parameter.
4177 * plugin.h (class Sized_pluginobj): Update declaration.
4178
5f1ab67a
ILT
41792010-08-02 Ian Lance Taylor <iant@google.com>
4180
4181 PR 11866
4182 * output.cc (Output_segment::set_offset): Search for the first and
4183 last sections rather than assuming that the list is in order.
4184 (Output_segment::find_first_and_last_list): New function.
4185 * output.h (class Output_segment): Update declarations.
4186 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
4187 (relro_strip_test_SOURCES): New variable.
4188 (relro_strip_test_DEPENDENCIES): New variable.
4189 (relro_strip_test_LDFLAGS): New variable.
4190 (relro_strip_test_LDADD): New variable.
4191 (relro_strip_test.so): New target.
4192
a8df5856
ILT
41932010-08-02 Ian Lance Taylor <iant@google.com>
4194
4195 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
4196 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
4197 (Target_i386::got_tlsdesc_section): New function.
4198 (Target_i386::got_section): Create space for GOT entries for
4199 TLSDESC relocations.
4200 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
4201 R_386_TLS_GOTDESC.
4202 (Target_i386::Scan::global): Likewise.
4203 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
4204 using TLSDESC GOT.
4205 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
4206 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
4207 (Target_x86_64::got_tlsdesc_section): New function.
4208 (Target_x86_64::got_section): Create space for GOT entries for
4209 TLSDESC relocations.
4210 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
4211 R_386_TLS_GOTDESC.
4212 (Target_x86_64::Scan::global): Likewise.
4213 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
4214 using TLSDESC GOT.
4215
0c10a0a6
ILT
42162010-08-02 Ian Lance Taylor <iant@google.com>
4217
4218 * testsuite/final_layout.sh: Use dc to convert from hex to
4219 decimal.
4220
41cbeecc
ST
42212010-07-29 Sriraman Tallam <tmsriram@google.com>
4222
4223 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
4224 paramter to the call to gold::gc_process_relocs.
4225 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
4226 paramter to the call to gold::gc_process_relocs.
4227 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
4228 parameter to the call to gold::gc_process_relocs.
4229 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
4230 template parameter to the call to gold::gc_process_relocs.
4231 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
4232 paramter to the call to gold::gc_process_relocs.
4233 * gc.h (get_embedded_addend_size): New function.
4234 (gc_process_relocs): Save the size of the reloc for use by ICF.
4235 * icf.cc (get_section_contents): Get the addend from the text section
4236 for SHT_REL relocation sections.
4237 * icf.h (Icf::Reloc_addend_size_info): New typedef.
4238 (Icf::Reloc_info): Add new member reloc_addend_size_info.
4239 * int_encoding.h (read_from_pointer): New overloaded function.
4240 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
4241 * testsuite/icf_sht_rel_addend_test.sh: New file.
4242 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
4243 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
4244
6ea55b82
RW
42452010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4246
4247 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
4248 * Makefile.in: Regenerate.
4249 * testsuite/Makefile.in: Regenerate.
4250
9691462b
ILT
42512010-07-27 Jeffrey Yasskin <jyasskin@google.com>
4252
4253 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
4254 * gold/testsuite/debug_msg.cc: Likewise.
4255 * gold/testsuite/odr_violation1.cc
4256 * gold/testsuite/odr_violation2.cc
4257
76897331
CC
42582010-07-21 Cary Coutant <ccoutant@google.com>
4259
4260 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
4261 string, and length fields.
4262 (Output_merge_string::Merged_strings_list): New type.
4263 (Output_merge_string::Merged_strings_lists): New typedef.
4264 (Output_merge_string): Replace merged_strings_ with
4265 merged_strings_lists_.
4266 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
4267 Merged_strings_list per input object and section. Don't store pointer
4268 to the string. Don't store length with each merged string entry.
4269 (Output_merge_string::finalize_merged_data): Loop over list of merged
4270 strings lists. Recompute length of each merged string.
4271
78384e8f
CC
42722010-07-15 Cary Coutant <ccoutant@google.com>
4273
4274 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
4275 here.
4276
783659f9
ILT
42772010-07-14 Ian Lance Taylor <iant@google.com>
4278
4279 * descriptors.cc (Descriptors::open): Report correct name in error
4280 message.
4281
131687b4
DK
42822010-07-13 Doug Kwan <dougkwan@google.com>
4283
4284 * arm.cc (Arm_input_section::Arm_input_section): For a
4285 SHT_ARM_EXIDX section, always keeps the input sections.
4286 (Arm_input_section::set_exidx_section_link): New method.
4287 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
4288 has_errors_ to false.
4289 (Arm_exidx_input_section::has_errors,
4290 Arm_exidx_input_section::set_has_errors): New methods.
4291 (Arm_exidx_input_section::has_errors_): New data member.
4292 (Arm_relobj::get_exidx_shndx_list): New method.
4293 (Arm_output_section::append_text_sections_to_list): Do not skip
4294 section without SHF_EXECINSTR.
4295 (Arm_output_section::fix_exidx_coverage): Skip input sections with
4296 errors.
4297 (Arm_relobj::make_exidx_input_section): Add new parameter for text
4298 section header. Make error messages more verbose. Check for
4299 a non-executable section linked to an EXIDX section.
4300 (Arm_relobj::do_read_symbols): Remove error checking, which has been
4301 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
4302 check that there is no deferred EXIDX section if we exit early.
4303 Instead of not making an EXIDX section in case of an error, make one
4304 and set the has_errors flag of it.
4305 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
4306 in a relocatable link.
4307 (Target_arm::do_relax): Look for the EXIDX output section instead of
4308 assuming that it is called .ARM.exidx.
4309 (Target_arm::fix_exidx_coverage): Add a new parameter for input
4310 section list. Do not check for SHF_EXECINSTR section flags but
4311 skip any input section with errors.
4312 * output.cc (Output_section::Output_section): Initialize
4313 always_keeps_input_sections_ to false.
4314 (Output_section::add_input_section): Check for
4315 always_keeps_input_sections_.
4316 * output.h (Output_section::always_keeps_input_sections,
4317 Output_section::set_always_keeps_input_sections): New methods.
4318 (Output_section::always_keeps_input_sections): New data member.
4319
69517287
RÁE
43202010-07-13 Rafael Espindola <espindola@google.com>
4321
4322 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
4323 * fileread.h (Input_file): Add try_extra_search_path and find_file.
4324
82742395
ILT
43252010-07-13 Philip Herron <herron.philip@googlemail.com>
4326 Ian Lance Taylor <iant@google.com>
4327
4328 * output.h (Output_section_lookup_maps::add_merge_section):
4329 Correct check of whether value was inserted.
4330 (Output_section_lookup_maps::add_merge_input_section): Likewise.
4331 (Output_section_lookup_maps::add_relaxed_input_section):
4332 Likewise.
4333 * arm.cc (Target_arm::got_section): Remove used local os.
4334 * i386.cc (Target_i386::got_section): Likewise.
4335 * x86_64.cc (Target_x86_64::got_section): Likewise.
4336 * sparc.cc (Target_sparc::got_section): Likewise.
4337 (Target_sparc::relocate): Remove unused local have_got_offset.
4338 * powerpc.cc (Target_powerpc::relocate): Likewise.
4339
f2d707b5
ILT
43402010-07-13 Ian Lance Taylor <iant@google.com>
4341
241531d6
ILT
4342 * compressed_output.cc (zlib_decompress): Fix signature in
4343 !HAVE_ZLIB_H case.
4344
f2d707b5
ILT
4345 * archive.cc (Archive::include_member): Unlock an external member
4346 of a thin archive. Don't bother to delete an object we know is
4347 NULL.
4348
a2e47362
CC
43492010-07-12 Cary Coutant <ccoutant@google.com>
4350
4351 * compressed_output.cc (zlib_decompress): New function.
4352 (get_uncompressed_size): New function.
4353 (decompress_input_section): New function.
4354 * compressed_output.h (get_uncompressed_size): New function.
4355 (decompress_input_section): New function.
4356 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
4357 Handle compressed debug sections.
4358 * layout.cc (is_compressed_debug_section): New function.
4359 (Layout::output_section_name): Map compressed section names to
4360 canonical names.
4361 * layout.h (is_compressed_debug_section): New function.
4362 (is_debug_info_section): Recognize compressed debug sections.
4363 * merge.cc: Include compressed_output.h.
4364 (Output_merge_data::do_add_input_section): Handle compressed
4365 debug sections.
4366 (Output_merge_string::do_add_input_section): Handle compressed
4367 debug sections.
4368 * object.cc: Include compressed_output.h.
4369 (Sized_relobj::Sized_relobj): Initialize new data members.
4370 (build_compressed_section_map): New function.
4371 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
4372 * object.h (Object::section_is_compressed): New method.
4373 (Object::do_section_is_compressed): New method.
4374 (Sized_relobj::Compressed_section_map): New type.
4375 (Sized_relobj::do_section_is_compressed): New method.
4376 (Sized_relobj::compressed_sections_): New data member.
4377 * output.cc (Output_section::add_input_section): Handle compressed
4378 debug sections.
4379 * reloc.cc: Include compressed_output.h.
4380 (Sized_relobj::write_sections): Handle compressed debug sections.
4381
ce279a62
CC
43822010-07-08 Cary Coutant <ccoutant@google.com>
4383
4384 * resolve.cc (Symbol_table::resolve): Remember whether undef was
4385 weak when resolving to a dynamic def.
4386 (Symbol_table::should_override): Add adjust_dyndef flag; set it
4387 for weak undef/dynamic def cases. Adjust callers.
4388 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
4389 undef_binding_weak_.
4390 (Symbol_table::sized_write_globals): Adjust symbol binding.
4391 (Symbol_table::sized_write_symbol): Add binding parameter.
4392 * symtab.h (Symbol::set_undef_binding): New method.
4393 (Symbol::is_undef_binding_weak): New method.
4394 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
4395 (Symbol_table::should_override): Add new parameter.
4396 (Symbol_table::sized_write_symbol): Add new parameter.
4397
4398 * testsuite/weak_undef_file1.cc: Add new test case.
4399 * testsuite/weak_undef_file2.cc: Fix header comment.
4400 * testsuite/weak_undef_test.cc: Add new test case.
4401
b2286c10
DK
44022010-06-29 Doug Kwan <dougkwan@google.com>
4403
4404 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
4405 Initialize USE_SYMBOL_.
4406 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
4407 definition.
4408 (Arm_reloc_property::uses_symbol_): New data member declaration.
4409 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
4410 uses symbol value and symbol is undefined but not weakly undefined.
4411
4802450a
RÁE
44122010-06-28 Rafael Espindola <espindola@google.com>
4413
4414 * plugin.cc (Plugin::load): Use dlerror.
4415
e5ca47ba
ILT
44162010-06-26 Jeffrey Yaskin <jyasskin@google.com>
4417
4418 * symtab.cc (detect_odr_violations): When reporting an ODR
4419 violation, report an object where the symbol is defined.
4420
8a75a161
DK
44212010-06-25 Doug Kwan <dougkwan@google.com>
4422
4423 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
4424 (Target_arm::section_may_have_icf_unsafe_pointers): New method
4425 definition.
4426 (Target_arm::Scan::local_reloc_may_be_function_pointer,
4427 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
4428 target hook to detect function points.
4429 (Target_arm::Scan::possible_function_pointer_reloc): New method.
4430 * icf.h (Icf::check_section_for_function_pointers): Change type of
4431 parameter SECTION_NAME to const reference to std::string. Use
4432 target hook to determine if section may have unsafe pointers.
4433 * target.h (Target::section_may_have_icf_unsafe_pointers): New
4434 method definition.
4435
42218b9f
RÁE
44362010-06-21 Rafael Espindola <espindola@google.com>
4437
4438 * fileread.cc (Input_file::find_fie): New
4439 (Input_file::open): Use Input_file::find_fie.
4440 * fileread.h (Input_file::find_fie): New
4441 * plugin.cc (set_extra_library_path): New.
4442 (Plugin::load): Add set_extra_library_path to the transfer vector.
4443 (Plugin_manager::set_extra_library_path): New.
4444 (Plugin_manager::add_input_file): Use the extra search path if set.
4445 (set_extra_library_path(): New.
4446 * plugin.h (Plugin_manager): Add set_extra_library_path and
4447 extra_search_path_.
4448
a0506cca
CC
44492010-06-19 Cary Coutant <ccoutant@google.com>
4450
4451 * layout.cc (gdb_sections): Add .debug_types.
4452 (lines_only_debug_sections): Likewise.
4453
6508b958
RÁE
44542010-06-18 Rafael Espindola <espindola@google.com>
4455
4456 * plugin.cc (add_input_file,add_input_library)
4457 (Plugin_manager::add_input_file): Make filename arguments const.
4458 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
4459 const.
4460
3e235302
DK
44612010-06-16 Doug Kwan <dougkwan@google.com>
4462
4463 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
4464 .ARM.attributes section if we have not merged any input
4465 attributes sections.
4466
106e8a6c
DK
44672010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4468
4469 * arm.cc: Allow combining objects with no EABI version
4470 information.
4471
91ff43fe
RÁE
44722010-06-15 Rafael Espindola <espindola@google.com>
4473
4474 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
4475
68ed838c
ILT
44762010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4477
4478 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
4479 (struct iovec): Correct !HAVE_READV definition.
4480
f3a2388f
CC
44812010-06-10 Cary Coutant <ccoutant@google.com>
4482
4483 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
4484 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
4485 reloc sections.
4486 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
4487
4488 PR 11683
4489 * symtab.h (Symbol::is_placeholder): New member function.
4490 * target-reloc.h (relocate_section): Check for placeholder symbols.
4491
4492 * testsuite/Makefile.am (plugin_test_8): New test.
4493 (plugin_test_9): New test.
4494 * testsuite/Makefile.in: Regenerate.
4495
e1df38aa
NC
44962010-06-09 Nick Clifton <nickc@redhat.com>
4497
4498 * yyscript.y (input_list_element): Allow strings prefixed with
4499 the '-' character. Treat these as libraries.
4500 * script.cc (script_add_library): New function. Adds a library
4501 specified by "-l<name>" found in an input script.
4502 * script-c.h: Add prototype for script_add_library.
4503
25bbe950
DK
45042010-06-07 Doug Kwan <dougkwan@google.com>
4505
4506 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
4507 Restrict stub-group size to be within long conditional branch
4508 range when working around cortex-A8 erratum.
4509
0f32ea4c
ILT
45102010-06-07 Damien Diederen <dd@crosstwine.com>
4511
4512 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
4513 #ifdef typo.
4514
8fe2a369
ST
45152010-06-03 Sriraman Tallam <tmsriram@google.com>
4516
4517 PR gold/11658
4518 * output.cc
4519 (Output_section::Input_section_sort_entry::compare_section_ordering):
4520 Change to return non-zero correctly.
4521 (Output_section::Input_section_sort_section_order_index_compare
4522 ::operator()): Change to fix ambiguity in comparisons.
4523
6e9ba2ca
ST
45242010-06-01 Sriraman Tallam <tmsriram@google.com>
4525
4526 * gold.h (is_wildcard_string): New function.
4527 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
4528 (Layout::layout_eh_frame): Ditto.
4529 (Layout::find_section_order_index): New method.
4530 (Layout::read_layout_from_file): New method.
4531 * layout.h (Layout::find_section_order_index): New method.
4532 (Layout::read_layout_from_file): New method.
4533 (Layout::input_section_position_): New private member.
4534 (Layout::input_section_glob_): New private member.
4535 * main.cc (main): Call read_layout_from_file here.
4536 * options.h (--section-ordering-file): New option.
4537 * output.cc (Output_section::input_section_order_specified_): New
4538 member.
4539 (Output_section::Output_section): Initialize new member.
4540 (Output_section::add_input_section): Add new parameter.
4541 Keep input sections when --section-ordering-file is used.
4542 (Output_section::set_final_data_size): Sort input sections when
4543 section ordering file is specified.
4544 (Output_section::Input_section_sort_entry): Add new parameter.
4545 Check sorting type.
4546 (Output_section::Input_section_sort_entry::compare_section_ordering):
4547 New method.
4548 (Output_section::Input_section_sort_compare::operator()): Change to
4549 consider section_order_index.
4550 (Output_section::Input_section_sort_init_fini_compare::operator()):
4551 Change to consider section_order_index.
4552 (Output_section::Input_section_sort_section_order_index_compare
4553 ::operator()): New method.
4554 (Output_section::sort_attached_input_sections): Change to sort
4555 according to section order when specified.
e1df38aa
NC
4556 (Output_section::add_input_section<32, true>): Add new parameter.
4557 (Output_section::add_input_section<64, true>): Add new parameter.
4558 (Output_section::add_input_section<32, false>): Add new parameter.
4559 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
4560 * output.h (Output_section::add_input_section): Add new parameter.
4561 (Output_section::input_section_order_specified): New
4562 method.
4563 (Output_section::set_input_section_order_specified): New method.
4564 (Input_section::Input_section): Initialize section_order_index_.
4565 (Input_section::section_order_index): New method.
4566 (Input_section::set_section_order_index): New method.
4567 (Input_section::section_order_index_): New member.
4568 (Input_section::Input_section_sort_section_order_index_compare): New
4569 struct.
4570 (Output_section::input_section_order_specified_): New member.
4571 * script-sections.cc (is_wildcard_string): Delete and move modified
4572 method to gold.h.
4573 (Output_section_element_input::Output_section_element_input): Modify
4574 call to is_wildcard_string.
4575 (Output_section_element_input::Input_section_pattern
4576 ::Input_section_pattern): Ditto.
4577 (Output_section_element_input::Output_section_element_input): Ditto.
4578 * testsuite/Makefile.am (final_layout): New test case.
4579 * testsuite/Makefile.in: Regenerate.
4580 * testsuite/final_layout.cc: New file.
4581 * testsuite/final_layout.sh: New file.
4582
3537c84b
RÁE
45832010-06-01 Rafael Espindola <espindola@google.com>
4584
4585 * plugin.cc (Plugin::load): Pass the output name to the plugin.
4586
105b6afd
RÁE
45872010-06-01 Rafael Espindola <espindola@google.com>
4588
4589 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
4590 visibility of symbols.
4591
29e11421
DK
45922010-05-27 Doug Kwan <dougkwan@google.com>
4593
4594 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
4595 from start of output section instead of address for a local symbol
4596 in a merged or relaxed section when doing a relocatable link.
4597
5e0f337e
RÁE
45982010-05-26 Rafael Espindola <espindola@google.com>
4599
4600 PR 11604
4601 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
4602 adding sections the garbage collector removed.
4603 * gold/testsuite/Makefile.am: Add test.
4604 * gold/testsuite/Makefile.in: Regenerate.
4605 * gold/testsuite/plugin_test_7.sh: New.
4606 * gold/testsuite/plugin_test_7_1.c: New.
4607 * gold/testsuite/plugin_test_7_2.c: New.
4608
f4187277
RÁE
46092010-05-26 Rafael Espindola <espindola@google.com>
4610
4611 * script-sections.cc (Output_section_definition::set_section_addresses):
4612 Check for --section-start.
4613
5c388529
DK
46142010-05-26 Doug Kwan <dougkwan@google.com>
4615
4616 * arm.cc (Arm_scan_relocatable_relocs): New class.
4617 (Target_arm::relocate_special_relocatable): New method.
4618 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
4619 (Arm_relocate_functions::thumb_branch_common): Same.
4620 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
4621 instead of Default_scan_relocatable_relocs.
4622 * target-reloc.h (relocate_for_relocatable): Let target handle
4623 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
4624 * target.h (Sized_target::relocate_special_relocatable): New method.
4625
bca1c3ae
ILT
46262010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4627
4628 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
4629
0439c796
DK
46302010-05-23 Doug Kwan <dougkwan@google.com>
4631
4632 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
4633 instead of a cast.
4634 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
4635 with a direct branch, not a conditional branch, to a stub.
4636 * merge.cc (Output_merge_base::record_input_section): New method
4637 defintion.
4638 (Output_merge_data::do_add_input_section): Record input section if
4639 keeps-input-sections flag is set.
4640 (Output_merge_string::do_add_input_section): Ditto.
4641 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
4642 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
4643 INPUT_SECTIONS_.
4644 (Output_merge_base::keeps_input_sections,
4645 Output_merge_base::set_keeps_input_sections,
4646 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
4647 method definitions.
4648 (Output_merge_base::Input_sections): New type declaration.
4649 (Output_merge_base::input_sections_begin,
4650 Output_merge_base::input_sections_end,
4651 Output_merge_base::do_set_keeps_input_sections): New method definitions.
4652 (Output_merge_base::bool keeps_input_sections_,
4653 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
4654 Output_merge_base::input_sections_): New data members.
4655 (Output_merge_data::do_set_keeps_input_sections): New method
4656 defintion.
4657 (Output_merge_string::do_set_keeps_input_sections): Ditto.
4658 * output.cc (Output_section::Input_section::relobj): Move method
4659 defintion from class declaration to here and handle merge sections.
4660 (Output_section::Input_section::shndx): Ditto.
4661 (Output_section::Output_section): Remove initializations of removed
4662 data members and initialize new data member LOOKUP_MAPS_.
4663 (Output_section::add_input_section): Set keeps-input-sections flag
4664 for a newly created merge output section as appropriate. Adjust code
4665 to use Output_section_lookup_maps class.
4666 (Output_section::add_relaxed_input_section): Adjst code for lookup
4667 maps code refactoring.
4668 (Output_section::add_merge_input_section): Add a new parameter
4669 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
4670 class. If adding input section to a newly created merge output
4671 section fails, remove the new merge section.
4672 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 4673 Adjust code for use of the Output_section_lookup_maps class.
0439c796
DK
4674 (Output_section::find_merge_section): Ditto.
4675 (Output_section::build_lookup_maps): New method defintion.
4676 (Output_section::find_relaxed_input_section): Adjust code to use
4677 Output_section_lookup_maps class.
4678 (Output_section::get_input_sections): Export merge sections. Adjust
4679 code to use Output_section_lookup_maps class.
4680 (Output_section:::add_script_input_section): Adjust code to use
4681 Output_section_lookup_maps class. Update lookup maps for merge
4682 sections also.
4683 (Output_section::discard_states): Use Output_section_lookup_maps.
4684 (Output_section::restore_states): Same.
4685 * output.h (Merge_section_properties): Move class defintion out of
4686 Output_section.
4687 (Output_section_lookup_maps): New class.
4688 (Output_section::Input_section::is_merge_section): New method
4689 defintion.
4690 (Output_section::Input_section::relobj): Move defintion out of class
4691 defintion. Declare method only.
4692 (Output_section::Input_section::shndx): Ditto.
4693 (Output_section::Input_section::output_merge_base): New method defintion.
4694 (Output_section::Input_section::u2_.pomb): New union field.
4695 (Output_section::Merge_section_by_properties_map,
4696 Output_section::Output_section_data_by_input_section_map,
4697 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
4698 Remove types.
4699 (Output_section::add_merge_input_section): Add new parameter
4700 KEEPS_INPUT_SECTIONS.
4701 (Output_section::build_lookup_maps): New method declaration.
4702 (Output_section::merge_section_map_,
4703 Output_section::merge_section_by_properties_map_,
4704 Output_section::relaxed_input_section_map_,
4705 Output_section::is_relaxed_input_section_map_valid_): Remove data
4706 members.
4707 (Output_section::lookup_maps_): New data member.
4708
76295588
L
47092010-05-21 Doug Kwan <dougkwan@google.com>
4710
4711 PR gold/11619
4712 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
4713 avoid a compilation error.
4714
d103a984
RÁE
47152010-05-19 Rafael Espindola <espindola@google.com>
4716
4717 * script-sections.cc (Output_section_definition::allocate_to_segment):
4718 Update the phdrs_list even when the output section is NULL.
4719 * testsuite/Makefile.am: Add test.
4720 * testsuite/Makefile.in: Regenerate.
4721 * testsuite/script_test_9.cc: New.
4722 * testsuite/script_test_9.sh: New.
4723 * testsuite/script_test_9.t: New.
4724
6625d24e
DK
47252010-05-19 Doug Kwan <dougkwan@google.com>
4726
4727 * arm.cc (Arm_input_section::original_size): New method.
4728 (Arm_input_section::do_addralign): Add a cast.
4729 (Arm_input_section::do_output_offset): Remove static cast.
4730 (Arm_input_section::original_addralign,
4731 Arm_input_section::original_size_): Change type to uint32_t.
4732 (Arm_input_section::init): Add safe casts for section alignment
4733 and size.
4734 (Arm_input_section::set_final_data_size): Do not set address and
4735 offset of stub table.
4736 (Arm_output_section::fix_exidx_coverage): Change use of of
4737 Output_section::Simple_input_section to that of
4738 Output_section::Input_section.
4739 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
4740 except for the first pass.
4741 * output.cc (Output_section::get_input_sections): Change type of
4742 input_sections to std::list<Input_section>.
4743 (Output_section::add_script_input_section): Rename from
4744 Output_section::add_simple_input_section. Change type of SIS
4745 parameter from Simple_input_section to Input_section.
4746 * output.h (Output_section::Simple_input_section): Remove class.
4747 (Output_section::Input_section): Change class visibility to public.
4748 (Output_section::Input_section::addralign): Use stored alignments
4749 for special input sections if set.
4750 (Output_section::Input_section::set_addralign): New method.
4751 (Output_section::get_input_sections): Change parameter type from
4752 list of Simple_input_section to list of Input_section.
4753 (Output_section::add_script_input_section): Rename from
4754 Output_section::add_simple_input_section. Change first parameter's
4755 type from Simple_input_section to Input_section and remove the
4756 second and third parameters.
4757 * script-sections.cc (Input_section::Input_section_list): Change
4758 type to list of Output_section::Input_section/
4759 (Input_section_info::Input_section_info): Change parameter type of
4760 INPUT_SECTION to Output_section::Input_section.
4761 (Input_section_info::input_section): Change return type.
4762 (Input_section_info::input_section_): Change type to
4763 Output_section::Input_section.
4764 (Output_section_element_input::set_section_addresses): Adjust code
4765 to use Output_section::Input_section instead of
4766 Output_section::Simple_input_section. Adjust code for renaming
4767 of Output_section::add_simple_input_section.
4768 (Orphan_output_section::set_section_addresses): Ditto.
4769
e1e82ea4
RW
47702010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4771
4772 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
4773 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
4774
91e75c8a
RÁE
47752010-05-18 Rafael Espindola <espindola@google.com>
4776
4777 * options.cc (General_options::finalize): Handle -nostdlib.
4778 * options.h (nostdlib): New option.
4779 * script.cc (script_add_search_dir): Handle -nostdlib.
4780
da59ad79
DK
47812010-05-12 Doug Kwan <dougkwan@google.com>
4782
4783 * arm.cc (Target_arm::do_finalize_sections): Create an empty
4784 attributes section only if there no attributes section after merging.
4785 (Target_arm::merge_object_attributes): Move value of
e1df38aa 4786 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
4787 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
4788 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
4789 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
4790 and arm_attr_merge_7.stdout.
4791 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
4792 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
4793 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
4794 arm_attr_merge_7b.o): New rules.
4795 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
4796 arm_attr_merge_7
4797 * testsuite/Makefile.in: Regenerate.
4798 * testsuite/arm_attr_merge.sh: New file.
4799 * testsuite/arm_attr_merge_[67][ab].s: Same.
4800
3e01a7fd
NC
48012010-05-05 Nick Clifton <nickc@redhat.com>
4802
4803 * po/es.po: Updated Spanish translation.
4804
7ad2014a
L
48052010-04-27 H.J. Lu <hongjiu.lu@intel.com>
4806
4807 * Makefile.am (install-exec-local): Properly install gold as
4808 default cross linker.
4809 * Makefile.in: Regenerated.
4810
4fda8867
NC
48112010-04-27 H.J. Lu <hongjiu.lu@intel.com>
4812 Nick Clifton <nickc@redhat.com>
4813
4814 * configure.ac (install_as_default): Define and set to false
4815 unless --enable-gold or --enable-gold=both/gold has been
4816 specified.
4817 * configure: Regenerate.
4818
4819 * Makefile.am (install-exec-local): Install the executable as
4820 'ld.gold'. If install_as_default is true then also install it as
4821 'ld'.
4822 * Makefile.in: Regenerated.
4823
bd288ea2
ILT
48242010-04-24 Ian Lance Taylor <iant@google.com>
4825
4826 * layout.cc (Layout::layout_reloc): In relocatable link don't
4827 combine reloc sections for grouped sections.
4828
ef38fd8a
ST
48292010-04-23 Sriraman Tallam <tmsriram@google.com>
4830
4831 * gc.h (gc_process_relocs): Pass information on relocs pointing to
4832 sections that are not ordinary to icf.
4833 * icf.cc (get_section_contents): Handle relocation pointing to section
4834 with no object or shndx information.
4835 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
4836 * testsuite/Makefile.in: Regenerate.
4837 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
4838 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
4839
f6973bdc
ILT
48402010-04-22 Ian Lance Taylor <iant@google.com>
4841
4842 * expression.cc (Expression::Expression_eval_info): Add
4843 result_alignment_pointer field.
4844 (Expression::eval_with_dot): Add result_alignment_pointer
4845 parameter. Change all callers.
4846 (Expression::eval_maybe_dot): Likewise.
4847 (class Binary_expression): Add alignment_pointer parameter to
4848 left_value and right_value. Change all callers.
4849 (BINARY_EXPRESSION): Set result alignment.
4850 (class Trinary_expression): Add alignment_pointer parameter to
4851 arg2_value and arg3_value. Change all callers.
4852 (Trinary_cond::value): Set result alignment.
4853 (Max_expression::value, Min_expression::value): Likewise.
4854 (Align_expression::value): Likewise.
4855 * script-sections.cc (class Sections_element): Add dot_alignment
4856 parameter to set_section_addresses virtual function. Update
4857 instantiations.
4858 (class Output_section_element): Likewise.
4859 (Script_sections::create_segments): Add dot_alignment parameter.
4860 Change all callers.
4861 (Script_sections::create_segments_from_phdrs_clause): Likewise.
4862 (Script_sections::set_phdrs_clause_addresses): Likewise.
4863 * script-sections.h: Update declarations.
4864 * script.h: Update declarations.
4865 * output.h (Output_segment::set_minimum_p_align): Don't decrease
4866 min_p_align.
4867 * testsuite/script_test_3.t: Set large alignment.
4868 * testsuite/script_test_3.sh: Make sure that at least one LOAD
4869 segment has expected alignment.
4870
9c9c98a5
NC
48712010-04-22 Nick Clifton <nickc@redhat.com>
4872
4873 * po/gold.pot: Updated by the Translation project.
4874 * po/vi.po: Updated Vietnamese translation.
4875
2253bfba
L
48762010-04-22 H.J. Lu <hongjiu.lu@intel.com>
4877
4878 * testsuite/Makefile.am (check_PROGRAMS): Add
4879 icf_virtual_function_folding_test.
4880 * testsuite/Makefile.in: Regenerated.
4881
85fdf906
AH
48822010-04-15 Andrew Haley <aph@redhat.com>
4883
4884 * options.h (merge_exidx_entries): New option.
4885 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
4886 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
4887 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
4888 (Target_arm::merge_exidx_entries): New function.
4889 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
4890 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
4891 to Arm_exidx_fixup constructor.
4892 Add new arg, merge_exidx_entries.
4893 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
4894 Arm_output_section::fix_exidx_coverage.
4895
ce97fa81
ST
48962010-04-18 Sriraman Tallam <tmsriram@google.com>
4897
4898 * icf.cc (get_section_contents): Check for preemptible functions.
4899 Ignore addend when appropriate.
4900 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
4901 section folded.
4902 (add_from_relobj): Check for section folded.
4903 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
4904 * symtab.h (should_add_dynsym_entry): Add new parameter.
4905 * target-reloc.h (scan_relocs): Check for section folded.
4906 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
4907 Check reloc types for function pointers in shared objects.
4908 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
4909 case.
4910 (icf_preemptible_functions_test): New test case.
4911 (icf_string_merge_test): New test case.
4912 * testsuite.Makefile.in: Regenerate.
4913 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
4914 bar_glob. Refactor code.
4915 * testsuite/icf_preemptible_functions_test.cc: New file.
4916 * testsuite/icf_preemptible_functions_test.sh: New file.
4917 * testsuite/icf_string_merge_test.cc: New file.
4918 * testsuite/icf_string_merge_test.sh: New file.
4919 * testsuite/icf_virtual_function_folding_test.cc: New file.
4920 * testsuite/icf_virtual_function_folding_test.sh: New file.
4921
04ceb17c
DK
49222010-04-14 Doug Kwan <dougkwan@google.com>
4923
4924 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
4925 for local symbol recounting if we remove a section due to ICF.
4926 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
4927 there are no regular objects in input.
4928
153e7da4
DK
49292010-04-13 Doug Kwan <dougkwan@google.com>
4930
4931 * arm.cc (Arm_input_section::set_final_data_size): Compute
4932 accurate final data size instead of using current data size.
4933
4dbd9faf
DK
49342010-04-09 Doug Kwan <dougkwan@google.com>
4935
4936 * layout.cc (Layout::choose_output_section): Handle script section
4937 types.
4938 (Layout::make_output_section_for_script): Add section type parameter.
4939 Handle script section types.
4940 * layout.h (Layout::make_output_section_for_script): Add section
4941 type parameter.
4942 * output.cc (Output_section::Output_section): Initialize data member
4943 is_noload_.
4944 (Output_section::do_reset_address_and_file_offset): Do not set address
4945 to 0 if section is a NOLOAD section.
4946 * output.h (Output_section::is_noload): New method.
4947 (Output_section::set_is_noload): Ditto.
4948 (Output_section::is_noload_): New data member.
4949 * script-c.h (Script_section_type): New enum type.
4950 (struct Parser_output_section_header): Add new file section_type.
4951 * script-sections.cc (Sections_element::output_section_name): Add
4952 parameter for returning script section type.
4953 (Output_section_definition::output_section_name): Ditto.
4954 (Output_section_definition::section_type)P; New method.
4955 (Output_section_definiton::script_section_type_name): Ditto.
4956 (Output_section_definition::script_section_type_): New data member.
4957 (Output_section_definition::Output_section_definition): Initialize
4958 data member Output_section_definition::script_section_type_.
4959 (Output_section_definition::create_sections): Pass script section type
4960 to Layout::make_output_section_for_script.
4961 (Output_section_definition::output_section_name): Return script
4962 section type to caller.
4963 (Output_section_definition::set_section_address): Do not advance
4964 dot value and load address if section type is NOLOAD. Set address
4965 of NOLOAD sections regardless of section flags.
4966 (Output_section_definition::print): Print section type if it is
4967 not SCRIPT_SECTION_TYPE_NONE.
4968 (Output_section_definition::section_type): New method.
4969 (Output_section_definition::script_section_type_name): Ditto.
4970 (Script_sections::output_section_name): Add new parameter
4971 PSECTION_TYPE for returning script section type. Pass it to
4972 section elements. Handle discard sections.
4973 (Sort_output_sections::operator()): Handle NOLOAD sections.
4974 * script-sections.h (Script_sections::Section_type): New enum type.
4975 (Script_sections::output_section_name): Add a new parameter for
4976 returning script section type.
4977 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
4978 INFO and NOLOAD.
4979 * yyscript.y (union): Add new field SECTION_TYPE.
4980 (COPY, DSECT, INFO, NOLOAD): New tokens.
4981 (opt_address_and_section_type): Change type to output_section_header.
4982 (section_type): New non-terminal
4983 (section_header): Handle section type.
2253bfba 4984 (opt_address_and_section_type): Return section type value.
4dbd9faf 4985
721ea635
L
49862010-04-09 H.J. Lu <hongjiu.lu@intel.com>
4987
4988 * testsuite/plugin_common_test_1.c (foo): Add prototype.
4989 * testsuite/plugin_common_test_2.c (foo): Likewise.
4990
6bf924b0
DK
49912010-04-08 Doug Kwan <dougkwan@google.com>
4992
4993 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
4994 Output_merge_data.
4995 * output.cc (Output_section::add_merge_input_section): Simplify
4996 code and return status of Output_merge_base::add_input_section.
e1df38aa 4997 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
4998 returns true.
4999
24af6f92
DK
50002010-04-07 Doug Kwan <dougkwan@google.com>
5001
5002 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
5003 if section is marked as containing instructions but has no mapping
5004 symbols.
5005 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
5006 correct section index.
5007 (Arm_relobj::find_linked_text_section): Ditto.
5008
00698fc5
CC
50092010-04-07 Cary Coutant <ccoutant@google.com>
5010
5011 * archive.cc (include_member): Destroy Read_symbols_data object before
5012 releasing file.
5013 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
5014 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
5015 (Read_symbols_data::~Read_symbols_data) New destructor.
5016 (Section_relocs::Section_relocs) New constructor.
5017 (Section_relocs::~Section_relocs) New destructor.
5018 (Read_relocs_data::Read_relocs_data) New constructor.
5019 (Read_relocs_data::~Read_relocs_data) New destructor.
5020 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
5021 pointers to NULL after deleting.
5022
7296d933
DK
50232010-04-07 Doug Kwan <dougkwan@google.com>
5024
5025 * arm.cc: Replace "endianity" with "endianness" in comments.
5026 (Arm_exidx_cantunwind): Ditto.
5027 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
5028 (Arm_relobj::merge_flags_and_attributes): New method.
5029 (Arm_relobj::merge_flags_and_attributes_): New data member.
5030 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
5031 (Arm_relobj::scan_sections_for_stubs): Ditto.
5032 (Arm_relobj::do_read_symbols): Check to see if we really want to
5033 merge processor-specific flags and attributes. Exit early if
5034 an object is empty except for section names and the undefined symbol.
5035 (Target_arm::do_finalize_sections): Move check for ELF format to
5036 Arm_relobj::do_read_symbols. Merge processor specific flags and
5037 attributes from a regular object only when we have determined that
5038 it is aapropriate. Do not create an .ARM.attributes section in
5039 output if there is no regular input object.
5040 (Target_arm::merge_processor_specific_flags): Check
5041 --warn-mismatch before printing any error.
5042 (Target_arm::merge_object_attributes): Ditto.
5043 * gold.cc (queue_middle_tasks): Handle the case in which there is
5044 no regular object in input.
5045 * options.cc (General_options::parse_EB): New method.
5046 (General_options::parse_EL): Same.
5047 (General_options::General_options): Initialize endianness_.
5048 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
5049 New options.
5050 (General_options::Endianness): New enum.
5051 (General_options::endianness): New method.
5052 (General_options::endianness_): New data member.
5053 * parameters.cc (Parameters::set_options): Check target endianness.
5054 (Parameters::set_target_once): Ditto.
5055 (Parameters::check_target_endianness): New method.
5056 (parameters_force_valid_target): If either -EL or -EB is specified,
5057 use it to define endianness of default target.
5058 * parameters.h (Parameters::check_target_endianness): New method
5059 declaration.
5060 * target.h (class Target): Change "endianity" to "endianness"
5061 in comments.
5062
efc8d4f2
RW
50632010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5064
5065 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
5066 * configure: Regenerate.
5067 * Makefile.in: Regenerate.
5068 * testsuite/Makefile.in: Regenerate.
5069
be234d88
CC
50702010-04-06 Cary Coutant <ccoutant@google.com>
5071
5072 gcc PR lto/42757
5073 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
5074 prevailing definitions of common symbols.
5075 * testsuite/plugin_test_6.sh: New test case.
5076 * testsuite/plugin_common_test_1.c: New test case.
5077 * testsuite/plugin_common_test_2.c: New test case.
5078 * testsuite/Makefile.am (plugin_test_6): New test case.
5079 * testsuite/Makefile.in: Regenerate.
5080
bd32c6bd
NC
50812010-04-06 Nick Clifton <nickc@redhat.com>
5082
5083 * po/vi.po: New Vietnamese translation.
5084
323c532f
DK
50852010-03-30 Doug Kwan <dougkwan@google.com>
5086
5087 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
5088
4fcd97eb
DK
50892010-03-25 Doug Kwan <dougkwan@google.com>
5090
5091 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
5092 to avoid a conversion warning on a 32-bit host.
5093
4ebf39db
ILT
50942010-03-24 Ian Lance Taylor <iant@google.com>
5095
5096 * testsuite/script_test_3.t: Add a TLS segment.
5097 * testsuite/Makefile.am (check_PROGRAMS): Add
5098 tls_phdrs_script_test.
5099 (tls_phdrs_script_test_SOURCES): Define.
5100 (tls_phdrs_script_test_DEPENDENCIES): Define.
5101 (tls_phdrs_script_test_LDFLAGS): Define.
5102 (tls_phdrs_script_test_LDADD): Define.
5103 * testsuite/Makefile.in: Rebuild.
5104
4a599bdd
CC
51052010-03-23 Cary Coutant <ccoutant@google.com>
5106
5107 * fileread.cc (find_or_make_view): Fix comment.
5108
6c93b22c
ILT
51092010-03-23 Ian Lance Taylor <iant@google.com>
5110
5111 * script-sections.cc (class Orphan_section_placement): Define
5112 PLACE_TLS and PLACE_TLS_BSS.
5113 (Orphan_section_placement::Orphan_section_placement): Initialize
5114 new places.
5115 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
5116 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
5117 (tls_script_test_SOURCES): Define.
5118 (tls_script_test_DEPENDENCIES): Define.
5119 (tls_script_test_LDFLAGS): Define.
5120 (tls_script_test_LDADD): Define.
5121 * testsuite/Makefile.in: Rebuild.
5122
a2c7281b
DK
51232010-03-22 Doug Kwan <dougkwan@google.com>
5124
5125 * arm.cc (Arm_relocate_functions::abs8,
5126 Arm_relocate_functions::abs16): Use correct check for overflow
5127 specified in the ARM ELF specs.
5128 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
5129 target of a BLX instruction specially.
5130 (Reloc_stub::stub_type_for_reloc): Ditto.
5131 (Relocate::relocate): Use symbolic names instead of numeric relocation
5132 codes to report error.
5133 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
5134 workaround.
5135 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
5136 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
5137 thumb2_blx_out_of_range.stdout
5138 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
5139 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
5140 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
5141 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
5142 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
5143 thumb2_blx_in_range, thumb2_blx_in_range.o,
5144 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
5145 thumb2_blx_out_of_range.o): New rules.
5146 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
5147 thumb2_blx_in_range and thumb2_blx_out_of_range.
5148 * testsuite/Makefile.in: Regenerate.
5149 * arm_branch_in_range.sh: Add tests for THUMB BLX.
5150 * testsuite/thumb_blx_in_range.s: New file.
5151 * testsuite/thumb_blx_out_of_range.s: New file.
5152
b0193076
RÁE
51532010-03-22 Rafael Espindola <espindola@google.com>
5154
5155 * archive.cc (Should_include): Move to archive.h.
5156 (should_include_member): Make it a member of Archive.
5157 (Lib_group): New.
5158 (Add_lib_group_symbols): New.
5159 * archive.h: Include options.h.
5160 (Archive_member): Moved from Archive.
5161 (Should_include): Moved from archive.cc.
5162 (Lib_group): New.
5163 (Add_lib_group_symbols): New.
5164 * dynobj.cc (do_should_include_member): New.
5165 * dynobj.h (do_should_include_member): New.
5166 * gold.cc (queue_initial_tasks): Update call to queue.
5167 * main.cc (main): Print lib group stats.
5168 * object.cc (do_should_include_member): New.
5169 * object.h: Include archive.h.
5170 (Object::should_include_member): New.
5171 (Object::do_should_include_member): New.
5172 (Sized_relobj::do_should_include_member): New.
5173 * options.cc (General_options::parse_start_lib): New.
5174 (General_options::parse_end_lib): New.
5175 (Input_arguments::add_file): Handle lib groups.
5176 (Input_arguments::start_group): Check we are not in a lib.
5177 (Input_arguments::start_lib): New.
5178 (Input_arguments::end_lib): New.
5179 * options.h (General_options): Add start_lib and end_lib.
5180 (Input_argument::lib_): New.
5181 (Input_argument::lib): New.
5182 (Input_argument::is_lib): New.
5183 (Input_file_lib): New.
5184 (Input_arguments::in_lib_): New.
5185 (Input_arguments::in_lib): New.
5186 (Input_arguments::start_lib): New.
5187 (Input_arguments::end_lib_): New.
5188 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
5189 in unused members as preempted.
5190 (Sized_pluginobj::do_should_include_member): New.
5191 * plugin.h (Sized_pluginobj::do_should_include_member): New.
5192 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
5193 return the blocker.
5194 (Read_symbols::do_whole_lib_group): New.
5195 (Read_symbols::do_lib_group): New.
5196 (Read_symbols::do_read_symbols): Handle lib groups.
5197 (Read_symbols::get_name): Handle lib groups.
5198 * readsyms.h (Read_symbols): Add an archive member pointer.
5199 (Read_symbols::do_whole_lib_group): New.
5200 (Read_symbols::do_lib_group): New.
5201 (Read_symbols::member_): New.
5202 * script.cc (read_input_script): Update call to queue_soon.
5203
d099120c
DK
52042010-03-19 Doug Kwan <dougkwan@google.com>
5205
5206 * arm.cc (Stub_table::Stub_table): Initialize new data members
5207 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
5208 (Stub_table::add_reloc_stub): Assign stub offset and update
5209 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
5210 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
5211 New data members.
5212 (Stub_table::update_data_size_and_addralign): Use
5213 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
5214 instead of going over all reloc stubs.
5215 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
5216 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
5217 Stringpool_template::offset_ to size of Stringpool_char.
5218 (Stringpool_template::new_key_offset): Remove code to initialize
5219 Stringpool_template::offset_.
5220 * stringpool.h (Stringpool_template::set_no_zero_null): Set
5221 Stringpool_template::offset_ to zero.
5222
1aa37384
DK
52232010-03-15 Doug Kwan <dougkwan@google.com>
5224
5225 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
5226 offset_.
5227 (Stringpool_template::new_key_offset): New method.
5228 (Stringpool_template::add_string): Assign offsets when adding new
5229 strings.
5230 (Stringpool_template::set_string_offsets): Do not set string offsets
5231 when not optimizing.
5232 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
5233 member size_.
5234 (Chunked_vector::clear): Clear size_.
5235 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
5236 (Chunked_vector::size): Return size_.
5237 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 5238 (Chunked_vector::size_): New data member.
1aa37384
DK
5239 (Stringpool_template::set_no_zero_null): Assert string set is empty.
5240 (Stringpool_template::new_key_offset): New method declaration.
5241 (Stringpool_template::offset_): New data member.
5242
b672b057
RÁE
52432010-03-15 Rafael Espindola <espindola@google.com>
5244
5245 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
5246 Add_symbols' constructor.
5247 * readsyms.h (Add_symbols): Remove the input_group member.
5248
b6848d3c
ILT
52492010-03-10 Ian Lance Taylor <iant@google.com>
5250
5251 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
5252 target to ask whether a reference to a symbol requires a stack
5253 split.
5254 * target.h (Target::is_call_to_non_split): New function.
5255 (Target::do_is_call_to_non_split): Declare virtual function.
5256 * target.cc: Include "symtab.h".
5257 (Target::do_is_call_to_non_split): New function.
5258 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
5259
a2a5469e
CC
52602010-03-10 Cary Coutant <ccoutant@google.com>
5261
5262 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
5263 (File_read::open[1]): Remove initial mapping of whole_file_view_.
5264 (File_read::open[2]): Add whole_file_view_ to list of views.
5265 (File_read::make_view): Remove test of whole_file_view_.
5266 (File_read::find_or_make_view): Create whole_file_view_ if
5267 necessary.
5268 (File_read::clear_views): Replace bool parameter with enum;
5269 adjust all callers. Don't delete views with permanent data;
5270 do delete cached views and views from archives if
5271 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
5272 if clearing the corresponding view.
5273 * fileread.h (File_read::Clear_views_mode): New enum.
5274 (File_read::View::is_permanent_view): New method.
5275 (File_read::clear_views): Replace bool parameter
5276 with enum; adjust all callers.
5277 * options.h (General_options): Change keep_files_mapped option;
5278 add map_whole_files.
5279 * readsyms.cc (Add_symbols::run): Delete sd_ object before
5280 releasing the file.
5281 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
5282 the file.
5283
8861f32b
DM
52842010-03-10 David S. Miller <davem@davemloft.net>
5285
5286 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
5287
d62d0f5f
ST
52882010-03-09 Sriraman Tallam <tmsriram@google.com>
5289
5290 * icf.cc (get_section_contents): Add '@' marker after processing the
5291 merge reloc.
5292
9177756d
DK
52932010-03-08 Doug Kwan <dougkwan@google.com>
5294
5295 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
5296 due to a conversion warning.
5297 (Arm_relobj::update_output_local_symbol_count): Check for local
5298 symbol with unset output index.
5299
9e9e071b
ILT
53002010-03-05 Ian Lance Taylor <iant@google.com>
5301
5302 * options.h (class General_options): Add --spare-dynamic-tags.
5303 * output.cc (Output_data_dynamic::set_final_data_size): Implement
5304 --spare-dynamic-tags.
5305
a81ee015
ILT
53062010-03-05 Ian Lance Taylor <iant@google.com>
5307
5308 * incremental.cc: Include "libiberty.h".
5309
44ec90b9
RO
53102010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
5311
5312 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
5313 function, is_info_ member.
5314 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
5315 (Versions::Versions): Update caller.
5316 (Versions::define_base_version): Likewise.
5317 (Versions::add_def): Likewise.
5318
0897ed3b
ST
53192010-03-03 Sriraman Tallam <tmsriram@google.com>
5320
5321 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
5322 (Scan::possible_function_pointer_reloc): New function.
5323 (Scan::local_reloc_may_be_function_pointer): Change to call
5324 possible_function_pointer_reloc.
5325 (Scan::global_reloc_may_be_function_pointer): Ditto.
5326 * icf.h (Icf::check_section_for_function_pointers): Change to reject
5327 relocations in ".data.rel.ro._ZTV" section.
5328 * testsuite/icf_safe_so_test.sh: Change to pass i386.
5329 * testsuite/icf_safe_so_test.cc: Ditto.
5330 * testsuite/icf_safe_test.cc: Ditto.
5331 * testsuite/icf_safe_test.sh: Ditto.
5332
d3bbad62
ILT
53332010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5334 Ian Lance Taylor <iant@google.com>
5335
5336 * target-reloc.h (relocate_section): Check the symbol table index
5337 for -1U before setting the local symbol index.
5338 (scan_relocatable_relocs): If copying the relocation, record that
5339 the local symbol is required.
5340 * object.h (Symbol_value::is_output_symtab_index_set): New
5341 function.
5342 (Symbol_value::may_be_discarded_from_output_symtab): New
5343 function.
5344 (Symbol_value::has_output_symtab_entry): New function.
5345 (Symbol_value::needs_output_symtab_entry): Remove.
5346 (Symbol_value::output_symtab_index): Make sure the symbol index is
5347 set.
5348 (Symbol_value::set_output_symtab_index): Make sure the symbol
5349 index is not set. Make sure the new index is valid.
5350 (Symbol_value::set_must_have_output_symtab_entry): New function.
5351 (Symbol_value::has_output_dynsym_entry): New function.
5352 (Symbol_value::set_output_dynsym_index): Make sure the new index
5353 is valid.
5354 (Sized_relobj::set_must_have_output_symtab_entry): New function.
5355 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
5356 local symbol if permitted.
5357 (Sized_relobj::do_finalize_local_symbols): Call
5358 is_output_symtab_index_set rather than needs_output_symtab_entry.
5359 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
5360 rather than needs_output_symtab_entry. Call
5361 has_output_dynsym_entry rather than needs_output_dynsym_entry.
5362 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
5363 is_output_symtab_index_set rather than needs_output_symtab_entry.
5364 * testsuite/discard_locals_relocatable_test.c: New file.
5365 * testsuite/discard_locals_test.sh: Test -r.
5366 * testsuite/Makefile.am (check_DATA): Add
5367 discard_locals_relocatable_test1.syms,
5368 discard_local_relocatable_test2.syms.
5369 (MOSTLYCLEANFILES): Likewise. Also add
5370 discard_locals_relocatable_test1.lout and
5371 discard_locals_relocatable_test2.out.
5372 (discard_locals_relocatable_test1.syms): New target.
5373 (discard_locals_relocatable_test.o): New target.
5374 (discard_locals_relocatable_test1.out): New target.
5375 (discard_locals_relocatable_test2.syms): New target.
5376 (discard_locals_relocatable_test2.out): New target.
5377 (various): Add missing ../ld-new dependencies.
5378 * testsuite/Makefile.in: Rebuild.
5379
7e8ccf26
NC
53802010-03-03 Nick Clifton <nickc@redhat.com>
5381
5382 * po/fi.po: New Finnish translation.
5383
2a0ff005
DK
53842010-03-01 Doug Kwan <dougkwan@google.com>
5385
5386 * layout.cc (Layout::Layout): Force section types of .init_array*,
5387 .preinit_array* and .fini_array* sections.
5388 * output.cc (Output_section::Input_section_sort_entry::has_priority):
5389 Fix check of return value of std::string::find.().
5390 (Output_section::Input_section_sort_compare::operator()): Remove
5391 comment about .init_array.
5392 (Output_section::Input_section_sort_init_fini_compare::operator()):
5393 New method.
5394 (Output_section::sort_attached_input_sections): Handle .init_array
5395 and .fini_array specially.
5396 * output.h (Output_section::Inut_section_sort_compare): Update
5397 comment.
5398 (Output_section::Input_section_sort_init_fini_compare): New struct.
5399
c3e4ae29
DK
54002010-02-26 Doug Kwan <dougkwan@google.com>
5401
5402 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
5403 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
5404 * testsuite/debug_msg.sh: Avoid matching source line number for
5405 use of global variable undef_int.
5406
2fd9ae7a
DK
54072010-02-26 Doug Kwan <dougkwan@google.com>
5408
5409 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
5410 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
5411 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
5412 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
5413 * options.cc (General_options::General_options): Initialize member
5414 fix_v4bx_.
5415 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
5416 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
5417 and rm_no_fix_v4bx.stdout
5418 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
5419 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
5420 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
5421 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
5422 and arm_no_fix_v4bx.
5423 * Makefile.in: Regenerate.
5424 * testsuite/arm_fix_v4bx.s: New file.
5425 * testsuite/arm_fix_v4bx.sh: Ditto.
5426
67ec7d0b
DK
54272010-02-24 Doug Kwan <dougkwan@google.com>
5428
5429 * arm.cc (Target_arm::got_section): Make the .got section the first
5430 non RELRO section in the data segment.
5431 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
5432 suffixes of section names.
5433
10165461
DK
54342010-02-24 Doug Kwan <dougkwan@google.com>
5435
5436 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
5437 flags and attributes merging if an input file is a binary file.
5438 * fileread.cc (Input_file::open): Record format of original file.
5439 * fileread.h (Input_file::Format): New enum type.
5440 (Input_file::Input_file): Initialize data member format_.
5441 (Input_file::format): New method definition.
5442 (Input_file::format_):: New data member.
5443
4a54abbb
DK
54442010-02-24 Doug Kwan <dougkwan@google.com>
5445
5446 * arm.cc (Arm_output_data_got): New class.
5447 (ARM_TCB_SIZE): New constant
5448 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
5449 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
5450 If user uses a script with a SECTIONS clause, issue only a warning
5451 for a misplaced EXIDX input section. Otherwise, issue an error.
5452 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
5453 garbage collection.
5454 (Target_arm::got_mode_index_entry): Handle static linking.
5455 (Target_arm::Scan::local): Ditto.
5456 (Target_arm::Scan::global): Ditto.
5457 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
5458 all incorrectly implemented relocations.
e1df38aa 5459 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
5460 Arm_output_section::fix_exidx_coverage.
5461 * layout.cc (Layout::section_name_mapping): Remove trailing dots
5462 from ".ARM.exidx." and ".ARM.extab.".
5463
ca419a6f
ILT
54642010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5465
5466 * arm.cc (Target_arm::do_finalize_sections): Create attribute
5467 section if it does not already exist.
5468 * attributes.cc (Attributes_section_data::Attributes_section_data):
5469 Don't crash if size is zero.
5470
135b9c78
ILT
54712010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5472 Ian Lance Taylor <iant@google.com>
5473
5474 * gold.cc (queue_middle_tasks): If no input files were opened,
5475 exit.
5476 * workqueue.h (Task_function::Task_function): Assert that there is
5477 a blocker.
5478
bb0bfe4f
DK
54792010-02-22 Doug Kwan <dougkwan@google.com>
5480
5481 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
5482 * icf.cc (get_section_contents): Cast snprintf arguments to long long
5483 types to avoid warnings due to different uint64_t implementations
5484 on different hosts.
5485
2a2b6d42
DK
54862010-02-21 Doug Kwan <dougkwan@google.com>
5487
5488 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
5489 handling of the maximum backward branch offset.
5490 (Arm_relocate_functions::thumb_branch_common): Ditto.
5491 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
5492 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 5493 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
5494 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
5495 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
5496 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
5497 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
5498 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
5499 thumb_bl_out_of_range thumb_bl_out_of_range.o,
5500 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
5501 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
5502 thumb2_bl_out_of_range.o): New rules.
5503 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
5504 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
5505 thumb2_bl_out_of_range
5506 * testsuite/Makefile.in: Regenerate.
5507 * testsuite/arm_bl_in_range.s: New file.
5508 * testsuite/arm_bl_out_of_range.s: Ditto.
5509 * testsuite/arm_branch_in_range.sh: Ditto.
5510 * testsuite/arm_branch_range.t: Ditto.
5511 * testsuite/thumb2_branch_range.t: Ditto.
5512 * testsuite/thumb_bl_in_range.s: Ditto.
5513 * testsuite/thumb_bl_out_of_range.s: Ditto.
5514 * testsuite/thumb_branch_range.t: Ditto.
5515
b487ad64
ST
55162010-02-20 Sriraman Tallam <tmsriram@google.com>
5517
5518 * gc.h (gc_process_relocs): Change vectors to point to the new list.
5519 Add reloc offset information.
5520 * icf.cc (get_section_contents): Change iterators to point to the new
5521 vectors. Add reloc offset information to the contents.
5522 * icf.h (Icf::Sections_reachable_info): New typedef.
5523 (Icf::Sections_reachable_list): New typedef.
5524 (Icf::Offset_info): New typedef.
5525 (Icf::Reloc_info): New struct typedef.
5526 (Icf::Reloc_info_list): New typedef.
5527 (Icf::symbol_reloc_list): Delete method.
5528 (Icf::addend_reloc_list): Delete method.
5529 (Icf::section_reloc_list): Delete method.
5530 (Icf::reloc_info_list): New method.
5531 (Icf::reloc_info_list_): New member.
5532
f96accdf
DK
55332010-02-19 Doug Kwan <dougkwan@google.com>
5534
5535 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
5536 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
5537 * arm.cc (Arm_relocation_functions): New forward declaration.
5538 (Target_arm::Target_arm): Initialize new data members
5539 got_mod_index_offset_ and tls_base_symbol_defined_.
5540 (Target_arm::Relocate::relocate_tls): New method.
5541 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
5542 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
5543 New methods.
5544 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
5545 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
5546 (Target_arm::got_mod_index_offset_,
5547 Target_arm::tls_base_symbol_defined_): New data members.
5548 (Target_arm::Scan::local, Target::Scan::global,
5549 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
5550 relocations.
5551
c8761b9a
DK
55522010-02-18 Doug Kwan <dougkwan@google.com>
5553
5554 * arm.cc (Arm_relobj::find_linked_text_section): New method.
5555 (Arm_relobj::make_exidx_input_section): Pass section index of linked
5556 text section as a parameter becuase some broken tools may not set
5557 the link in section header.
5558 (Target_arm::has_got_section): New method.
5559 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
5560 without any mapping symbol as data only. Remove warning.
5561 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
5562 link in its section header, try to discover the link by inspecting the
5563 REL31 relocation at the beginning of the section.
5564 (Target_arm::Scan::check_non_pic): Report name of offending relocation
5565 in error message.
5566 (Target_arm::Scan::global): Treat any reference to the symbol
5567 _GLOBAL_OFFSET_TABLE_ as a GOT access.
5568
21bb3914
ST
55692010-02-12 Sriraman Tallam <tmsriram@google.com>
5570
5571 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
5572 (Scan::global_reloc_may_be_function_pointer): New function.
5573 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
5574 (Scan::global_reloc_may_be_function_pointer): New function.
5575 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
5576 (Scan::global_reloc_may_be_function_pointer): New function.
5577 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
5578 (Scan::global_reloc_may_be_function_pointer): New function.
5579 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
5580 (Scan::global_reloc_may_be_function_pointer): New function.
5581 (Scan::possible_function_pointer_reloc): New function.
5582 (Target_x86_64::can_check_for_function_pointers): New function.
5583 * gc.h (gc_process_relocs): Scan relocation types to determine if
5584 function pointers were taken for targets that support it.
5585 * icf.cc (Icf::find_identical_sections): Include functions for
5586 folding in safe ICF whose pointer is not taken.
5587 * icf.h (Secn_fptr_taken_set): New typedef.
5588 (fptr_section_id_): New member.
5589 (section_has_function_pointers): New function.
5590 (set_section_has_function_pointers): New function.
5591 (check_section_for_function_pointers): New function.
5592 * options.h: Fix comment for safe ICF option.
5593 * target.h (can_check_for_function_pointers): New function.
5594 * testsuite/Makefile.am: Add icf_safe_so_test test case.
5595 Modify icf_safe_test for X86-64.
5596 * testsuite/Makefile.in: Regenerate.
5597 * testsuite/icf_safe_so_test.cc: New file.
5598 * testsuite/icf_safe_so_test.sh: New file.
5599 * testsuite/icf_safe_test.cc (kept_func_3): New function.
5600 (main): Change to take pointer to function kept_func_3.
5601 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
5602 folding is done correctly for X86-64.
5603
0da6fa6c
DM
56042010-02-12 David S. Miller <davem@davemloft.net>
5605
5606 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
5607 is_symbolless parameter.
5608 (Output_reloc<SHT_REL>::is_symbolless): New.
5609 (Output_reloc<SHT_REL>::is_symbolless_): New.
5610 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
5611 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
5612 (Output_reloc<SHT_RELA>::is_symbolless): New.
5613 (Output_data_reloc::add_global): Handle is_symbolless.
5614 (Output_data_reloc::add_global_relative): Likewise.
5615 (Output_data_reloc::add_local): Likewise.
5616 (Output_data_reloc::add_local_relative): Likewise.
5617 (Output_data_reloc::add_symbolless_global_addend): New.
5618 (Output_data_reloc::add_symbolless_local_addend): New.
5619 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
5620 is_symbolless.
5621 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
5622 instead of ->is_relative_
5623 (Output_reloc::write): Likewise.
5624 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
5625 (Output_reloc::write_rel): Simplify.
5626
5627 * sparc.cc (Target_sparc::Scan::local): Use
5628 ->add_symbolless_local_addend as needed.
5629 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
5630 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
5631 based upon relocation offset.
5632
e4782e83
DK
56332010-02-11 Doug Kwan <dougkwan@google.com>
5634
5635 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
5636 (Target_arm::Scan::global): Ditto. Also remove a comment before the
5637 beginning of function.
5638 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
5639 and MOVT_ABS relocations. Those are non issued in scanning. Fix
5640 parameter is_32bit in calls to should_apply_static_reloc.
5641 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
5642 (check_DATA): Add arm_abs_global.stdout.
5643 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
5644 arm_abs_global.stdout): New rules.
5645 (MOSTLLYCLEANFILES): Add arm_abs_global
5646 * Makefile.in: Regenerate.
5647 * testsuite/arm_abs_global.s: New file.
5648 * testsuite/arm_abs_global.sh: Ditto.
5649 * testsuite/arm_abs_lib.s: Ditto.
5650
93ceb764
ILT
56512010-02-11 Ian Lance Taylor <iant@google.com>
5652
5653 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
5654 Read_relocs task.
5655 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
5656 Allocate_commons_task first.
5657 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
5658 task, rather than symtab_lock_.
5659 (Gc_process_relocs::~Gc_process_relocs): New function.
5660 (Gc_process_relocs::is_runnable): Check this_blocker_.
5661 (Gc_process_relocs::locks): Use next_blocker_ rather than
5662 blocker_.
5663 (Scan_relocs::~Scan_relocs): New function.
5664 (Scan_relocs::is_runnable): Check this_blocker_ rather than
5665 symtab_lock_.
5666 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
5667 next_blocker_.
5668 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
5669 fields. Add this_blocker_ and next_blocker_ fields. Adjust
5670 constructor accordingly.
5671 (class Gc_process_relocs): Likewise.
5672 (class Scan_relocs): Likewise.
5673 * common.h (class Allocate_commons_task): Remove symtab_lock_
5674 field, and corresponding constructor parameter.
5675 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
5676 symtab_lock_.
5677 (Allocate_commons_task::locks): Likewise.
5678
114dfbe1
ILT
56792010-02-11 Ian Lance Taylor <iant@google.com>
5680
5681 * gold-threads.h (class Once): Define.
5682 (class Initialize_lock): Rewrite as child of Once.
5683 * gold-threads.cc (class Once_initialize): Define.
5684 (once_pointer_control): New static variable.
5685 (once_pointer, once_arg): New static variables.
5686 (c_run_once): New static function.
5687 (Once::Once, Once::run_once, Once::internal_run): New functions.
5688 (class Initialize_lock_once): Remove.
5689 (initialize_lock_control): Remove.
5690 (initialize_lock_pointer): Remove.
5691 (initialize_lock_once): Remove.
5692 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
5693 (Initialize_lock::initialize): Rewrite.
5694 (Initialize_lock::do_run_once): New function.
5695 * archive.cc (Archive::interpret_header): Only clear name if it is
5696 not already empty.
5697 * fileread.cc: Include "gold-threads.h"
5698 (file_counts_lock): New static variable.
5699 (file_counts_initialize_lock): Likewise.
5700 (File_read::release): Only increment counts when using --stats.
5701 Use a lock around the increment.
5702 * parameters.cc (class Set_parameters_target_once): Define.
5703 (set_parameters_target_once): New static variable.
5704 (Parameters::Parameters): Move here from parameters.h.
5705 (Parameters::set_target): Rewrite.
5706 (Parameters::set_target_once): New function.
5707 (Parameters::clear_target): Move here and rewrite.
5708 * parameters.h (class Parameters): Update declarations. Add
5709 set_parameters_target_once_ field.
5710 (Parameters::Parameters): Move to parameters.cc.
5711 (Parameters::clear_target): Likewise.
5712 * readsyms.cc (Read_symbols::do_group): Create a Start_group
5713 task.
5714 (Start_group::~Start_group): New function.
5715 (Start_group::is_runnable): New function.
5716 (Start_group::locks, Start_group::run): New functions.
5717 (Finish_group::run): Change saw_undefined to size_t.
5718 * readsyms.h (class Start_group): Define.
5719 (class Finish_group): Change saw_undefined_ field to size_t.
5720 (Finish_group::Finish_group): Remove saw_undefined and
5721 this_blocker parameters. Change all callers.
5722 (Finish_group::set_saw_undefined): New function.
5723 (Finish_group::set_blocker): New function.
5724 * symtab.h (class Symbol_table): Change saw_undefined to return
5725 size_t. Change saw_undefined_ field to size_t.
5726 * target-select.cc (Set_target_once::do_run_once): New function.
5727 (Target_selector::Target_selector): Initialize set_target_once_
5728 field. Don't initialize lock_ and initialize_lock_ fields.
5729 (Target_selector::instantiate_target): Rewrite.
5730 (Target_selector::set_target): New function.
5731 * target-select.h (class Set_target_once): Define.
5732 (class Target_selector): Update declarations. Make
5733 Set_target_once a friend. Remove lock_ and initialize_lock_
5734 fields. Add set_target_once_ field.
5735
fa17a3f4
ILT
57362010-02-10 Ian Lance Taylor <iant@google.com>
5737
5738 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
5739 queueing any tasks.
5740 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
5741 (queue_middle_tasks): Add all blockers before queueing any tasks.
5742 (queue_final_tasks): Likewise.
5743 * token.h (Task_token::add_blockers): New function.
5744 * object.h (Input_objects::number_of_relobjs): New function.
5745
c7177d31
ILT
57462010-02-10 Ian Lance Taylor <iant@google.com>
5747
5de0e392
ILT
5748 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
5749 shared, not if not position independent.
5750 * x86_64.cc (Relocate::relocate_tls): Likewise.
5751 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
5752 (tls_pie_pic_test): New target.
5753 * testsuite/Makefile.in: Rebuild.
5754
c7177d31
ILT
5755 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
5756 (tls_test_main_pie.o, tls_test_pie.o): New targets.
5757 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
5758 * testsuite/Makefile.in: Rebuild.
5759
684b268a
DM
57602010-02-09 David S. Miller <davem@davemloft.net>
5761
5762 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
5763 R_SPARC_RELATIVE using ->add_local_relative().
5764 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
5765
612a8d3d
DM
5766 * output.h (Output_data_dynamic::add_section_size): New method
5767 that takes two Output_data objects.
5768 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
5769 entry param. Handle it in initializers.
5770 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
5771 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
5772 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
5773 arg.
5774 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
5775 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
5776 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
5777 for dynrel_includes_plt.
5778 * i386.cc (Target_i386::do_finalize_sections): Likewise.
5779 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5780 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
5781 before .rela.plt
5782 (Target_sparc::do_finalize_sections): Update to pass true for
5783 dynrel_includes_plt.
5784 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
5785 output before .rela.plt
5786 (Target_powerpc::do_finalize_sections): Update to pass true for
5787 dynrel_includes_plt when 32-bit.
5788
cb1be87e
DK
57892010-02-08 Doug Kwan <dougkwan@google.com>
5790
5791 * arm.cc (Arm_relobj::simple_input_section_output_address): New
5792 method.
5793 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
5794 Arm_relobj::scan_section_for_cortex_a8_stubs,
5795 Arm_relobj::do_relocation_section): Instead of calling
5796 Output_section::output_address, use faster
5797 Arm_relobj::simple_input_section_output_address.
5798
705b5121
DM
57992010-02-08 David S. Miller <davem@davemloft.net>
5800
5801 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
5802 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
5803 relocation helper function.
5804
024c4466
DM
5805 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
5806 just like R_SPARC_GOT{10,13,22}.
5807 (Target_sparc::Scan::local): Likewise.
5808 (Target_sparc::Relocate:relocate): Likewise.
5809
9109c078
ILT
58102010-02-06 Ian Lance Taylor <iant@google.com>
5811
5812 * configure.ac: Rewrite targetobjs duplicate removal code to use
5813 only shell constructs.
5814 * configure: Rebuild.
5815
cf846138
DK
58162010-02-05 Doug Kwan <dougkwan@google.com>
5817
5818 PR 11247
5819 * arm.cc (Arm_relobj::section_is_scannable): New method.
5820 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
5821 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
5822
6cfaf60b
DK
58232010-02-04 Doug Kwan <dougkwan@google.com>
5824
5825 PR 11247
5826 * arm-reloc-property.cc (cstdio): Include.
5827 * configure.ac (targetobjs): Remove duplicates.
5828 * configure: Regenerate.
5829 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
5830 big and little endian version for a given address size.
5831
5c57f1be
DK
58322010-02-03 Doug Kwan <dougkwan@google.com>
5833
5834 * arm-reloc-property.cc
5835 (Arm_reloc_property_table::reloc_name_in_error_message): New method
5836 definition.
5837 * arm-reloc-property.h
5838 (Arm_reloc_property_table::get_implemented_static_reloc_property):
5839 New method definition.
5840 (Arm_reloc_property_table::reloc_name_in_error_message): New method
5841 declaration.
5842 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
5843 overflow to N.
5844 (GOT_PREL): Change implemented to Y.
5845 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
5846 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
5847 (Arm_relocate_functions::movw_abs_nc): Remove method.
5848 (Arm_relocate_functions::movt_abs): Ditto.
5849 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
5850 (Arm_relocate_functions::thm_movt_abs): Ditto.
5851 (Arm_relocate_functions::movw_rel_nc): Ditto.
5852 (Arm_relocate_functions::movw_rel): Ditto.
5853 (Arm_relocate_functions::movt_rel): Ditto.
5854 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
5855 (Arm_relocate_functions:thm_movw_rel): Ditto.
5856 (Arm_relocate_functions:thm_movt_rel): Ditto.
5857 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
5858 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
5859 New method definitions.
5860 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
5861 (Arm_relocation_functions::arm_grp_ldr): Ditto.
5862 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
5863 (Arm_relocation_functions::arm_grp_ldc): Ditto.
5864 (Target_arm::Relocate::relocate): Check for non-static or
5865 unimplemented relocation code and exit early. Change calls to
5866 Target_arm::reloc_uses_thumb_bit and
5867 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
5868 instead. Refactor code to handle similar relocations to increase
5869 code sharing. Remove check for unsupported relocation code in switch
5870 statement.
5871 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
5872 relocation property table to find out size. Change error message to
5873 print out the name of a relocation code instead of the numeric value.
5874 (Target_arm::scan_reloc_for_stub): Use relocation property table
5875 instead of calling Target_arm::reloc_uses_thumb_bit().
5876
218c5831
DK
58772010-02-02 Doug Kwan <dougkwan@google.com>
5878
5879 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
5880 types of relaxed input section.
5881
0d31c79d
DK
58822010-02-02 Doug Kwan <dougkwan@google.com>
5883
5884 * Makefile.am (HFILES): Add arm-reloc-property.h.
5885 (DEFFILES): New.
5886 (TARGETSOURCES): Add arm-reloc-property.cc
5887 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
5888 (libgold_a_SOURCES): $(DEFFILES)
5889 * Makefile.in: Regenerate.
5890 * arm-reloc-property.cc: New file.
5891 * arm-reloc-property.h: New file.
5892 * arm-reloc.def: New file.
5893 * arm.cc: Update comments.
5894 (arm-reloc-property.h): New included header.
5895 (arm_reloc_property_table): New global variable.
5896 (Target_arm::do_select_as_default_target): New method definition.
5897 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
5898 arm-reloc-property to targ_extra_obj.
5899 * parameters.cc (set_parameters_target): Call
5900 Target::select_as_default_target().
5901 * target.h (Target::select_as_default_target): New method definition.
5902 (Target::do_select_as_default_target): Same.
5903
546c7457
DK
59042010-02-01 Doug Kwan <dougkwan@google.com>
5905
5906 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
5907 first_output_text_section_.
5908 (Arm_exidx_fixup::first_output_text_section): New method definition.
5909 (Arm_exidx_fixup::first_output_text_section_): New data member.
5910 (Arm_exidx_fixup::process_exidx_section): Record the first text
5911 output section seen.
5912 (Arm_output_section::fix_exidx_coverage): Set correct linked section
5913 and entsize in output section header.
5914
11b861d5
DK
59152010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5916
5917 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
5918 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
5919 (Arm_relocate_functions::thm_alu11): New Method.
5920 (Arm_relocate_functions::thm_pc8): New Method.
5921 (Arm_relocate_functions::thm_pc12): New Method.
5922 (Target_arm::Scan::local): Handle the relocations.
5923 (Target_arm::Scan::global): Likewise.
5924 (Target_arm::Relocate::relocate): Likewise.
5925 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
5926
c9a2c125
DK
59272010-01-29 Doug Kwan <dougkwan@google.com>
5928
5929 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
5930 of relocation types as ld.
5931
1521477a
DK
59322010-01-29 Doug Kwan <dougkwan@google.com>
5933
5934 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
5935 to public.
5936 (Arm_relocate_functions::thumb_branch_common): Ditto.
5937 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
5938 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
5939 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
5940 Arm_relocate_functions::jump24): Remove.
5941 (Target_arm::Relocate::relocate): Adjust code to call
5942 Arm_relocation_functions::arm_branch_common and
5943 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 5944 wrappers. Merge switch-cases together to reduce source code size.
1521477a 5945
e7eca48c
DK
59462010-01-29 Doug Kwan <dougkwan@google.com>
5947
5948 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
5949 output_local_symbol_count_needs_update_.
5950 (Arm_relobj::output_local_symbol_count_needs_update,
5951 Arm_relobj::set_output_local_symbol_count_needs_update,
5952 Arm_relobj::update_output_local_symbol_count): New methods.
5953 (Arm_relobj::output_local_symbol_count_needs_update_): New data
5954 member.
5955 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
5956 of pointed function as in a R_ARM_PREL31 relocation.
5957 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
5958 for output local symbol count updating.
5959 (Target_arm::do_relax): Update output local symbol counts in objects
5960 if necessary.
5961 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
5962
02961d7e
ILT
59632010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5964
5965 * arm.cc: Added support for the ARM relocations:
5966 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
5967 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
5968 (Arm_relocate_functions::movw_rel_nc): Renamed (was
5969 movw_prel_nc).
5970 (Arm_relocate_functions::movw_rel): New method.
5971 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
5972 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
5973 thm_movw_prel_nc).
5974 (Arm_relocate_functions::thm_movw_rel): New method.
5975 (Arm_relocate_functions::thm_movt_rel): Renamed (was
5976 thm_movt_prel).
5977 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
5978 relocations.
5979 (Target_arm::Scan::global): Likewise.
5980 (Target_arm::Relocate::relocate): Likewise.
5981 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5982 Likewise.
5983
b10d2873
ILT
59842010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5985
5986 * arm.cc: Added support for ARM group relocations.
5987 (Target_arm::reloc_needs_sym_origin): New method.
5988 (Arm_relocate_functions::calc_grp_kn): New method.
5989 (Arm_relocate_functions::calc_grp_residual): New method.
5990 (Arm_relocate_functions::calc_grp_gn): New method.
5991 (Arm_relocate_functions::arm_grp_alu): New Method.
5992 (Arm_relocate_functions::arm_grp_ldr): New Method.
5993 (Arm_relocate_functions::arm_grp_ldrs): New Method.
5994 (Arm_relocate_functions::arm_grp_ldc): New Method.
5995 (Target_arm::Scan::local): Handle the ARM group relocations.
5996 (Target_arm::Scan::global): Likewise.
5997 (Target_arm::Relocate::relocate): Likewise.
5998 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5999 Likewise.
6000
2b328d4e
DK
60012010-01-26 Doug Kwan <dougkwan@google.com>
6002
6003 * arm.cc (set): Include.
6004 (class Arm_exidx_fixup): Change type of last_input_section_ to const
6005 pointer type.
6006 (Arm_output_section::Text_section_list): New type.
6007 (Arm_output_section::append_text_sections_to_list): New method.
6008 (Arm_output_section::fix_exidx_coverage): Ditto.
6009 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
6010 (Arm_relobj::convert_input_section_to_relaxed_section): Use
6011 Relobj::set_section_offset() instead of
6012 Sized_relobj::invalidate_section_offset().
6013 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
6014 parameter for section headers. Ignore relocation sections for
6015 unallocated sections and EXIDX sections.
6016 (Target_arm::fix_exidx_coverage): New method.
6017 (Target_arm::output_section_address_less_than): New type.
6018 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
6019 linked text section instead of the EXIDX section.
6020 (Arm_output_section::create_stub_group): Add an assertion to check
6021 that this is not an EXIDX output section.
6022 (Arm_output_section::append_text_sections_to_list): New method.
6023 (Arm_output_section::fix_exidx_coverage): Ditto.
6024 (Arm_relobj::scan_sections_for_stubs): Adjust call to
6025 Arm_relobj::section_needs_reloc_stub_scanning.
6026 (Target_arm::do_relax): Fix EXIDX output section coverage in the
6027 first pass.
6028 (Target_arm::fix_exidx_coverage): New method.
6029 * object.h (Relobj::set_output_section): New method.
6030 (Sized_relobj::invalidate_section_offset): Remove method.
6031 (Sized_relobj::do_invalidate_section_offset): Remove method.
6032 (Sized_relobj::do_set_section_offset): Handle offset value -1.
6033
c7f3c371
DK
60342010-01-25 Doug Kwan <dougkwan@google.com>
6035
6036 * arm.cc (Arm_exidx_merged_section::do_output_offset):
6037 Fix warning due to signed and unsigned comparison on a 32-bit host.
6038
8923b24c
DK
60392010-01-22 Doug Kwan <dougkwan@google.com>
6040
6041 * arm.cc (Target_arm::do_relax): Record an output section for section
6042 offset adjustment it contains any stub table that has changed.
6043 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
6044 offsets in an output section if necessary.
6045 * output.cc (Output_section::Output_section): Initialize
6046 section_offsets_need_adjustments_.
6047 (Output_section::add_input_section_for_script): Renamed to
6048 Output_section::add_simple_input_section.
6049 (Output_section::save_states): Add a comment.
6050 (Output_section::discard_states): New method defintion.
6051 (Output_section::adjust_section_offsets): Same.
6052 * output.h (Output_section::add_input_section_for_script): Renamed to
6053 Output_section::add_simple_input_section.
6054 (Output_section::discard_states): New method declaration.
6055 (Output_section::adjust_section_offsets): Same.
6056 (Output_section::section_offsets_need_adjustment,
6057 Output_section::set_section_offsets_need_adjustment): New method
6058 definitions.
6059 (Output_section::section_offsets_need_adjustment_): New data member.
6060 * script-sections.cc
6061 (Output_section_element_input::set_section_address): Adjust code for
6062 renaming of Output_section::add_input_section_for_script.
6063 (Orphan_output_section::set_section_address): Same.
6064
9b2fd367
DK
60652010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6066
6067 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
6068 Fix_v4bx enum values .
6069 * gold/options.h (General_options): New option definitions.
6070 (General_options::fix_v4bx): New method.
6071 (General_options::Fix_v4bx): New enum.
6072 * gold/options.cc (General_options::parse_fix_v4bx): New method.
6073 (General_options::parse_fix_v4bx_interworking): New method.
6074
80d0d023
DK
60752010-01-22 Doug Kwan <dougkwan@google.com>
6076
6077 * arm.cc (Arm_exidx_fixup): New class.
6078
af2cdeae
DK
60792010-01-21 Doug Kwan <dougkwan@google.com>
6080
6081 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
6082 classes.
6083 (Arm_exidx_section_offset_map): New type.
6084
993d07c1
DK
60852010-01-21 Doug Kwan <dougkwan@google.com>
6086
6087 * arm.cc (Arm_exidx_input_section): New class.
6088 (Arm_relobj::exidx_input_section_by_link,
6089 Arm_relobj::exidx_input_section_by_shndx,
6090 Arm_relobj::make_exidx_input_section): New methods.
6091 (read_arm_attributes_section): Remove.
6092 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
6093 information about them.
6094 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
6095 to here.
6096
5ac169d4
DK
60972010-01-20 Doug Kwan <dougkwan@google.com>
6098
6099 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
6100 Input_section_specifier to Section_id.
6101 (Target_arm::new_arm_input_section: Adjust code for change of key
6102 type.
6103 (Target_arm::find_arm_input_section): Ditto.
6104 * gc.h (object.h): Include for Section_id nand Section_id_hash.
6105 (Section_id): Remove.
6106 (Garbage_collection::Section_id_hash): Remove.
6107 * icf.h (object.h): Include for Section_id nand Section_id_hash.
6108 (Section_id): Remove.
6109 (Icf::Section_id_hash): Remove.
6110 * object.h (Section_id, Const_section_id, Section_id_hash,
6111 Const_section_id_hash): New type definitions.
6112 * output.cc (Output_section::add_relaxed_input_section): Change to
6113 use Const_section_id instead of Input_section_specifier as key type.
6114 (Output_section::add_merge_input_section): Ditto.
6115 (Output_section::build_relaxation_map): Change to use Section_id
6116 instead of Input_section_specifier as key type.
6117 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6118 Ditto.
6119 (Output_section::convert_input_sections_to_relaxed_sections): Change
6120 to use Const_section_id instead of Input_section_specifier as key type.
6121 (Output_section::find_merge_section): Ditto.
6122 (Output_section::find_relaxed_input_section): Ditto.
6123 * output.h (Input_section_specifier): Remove class.
6124 (Output_section::Output_section_data_by_input_section_map): Change
6125 key type to Const_section_id.
6126 (Output_section::Output_relaxed_input_section_by_input_section_map):
6127 Ditto.
6128 (Output_section::Relaxation_map): Change key type to Section_id.
6129
a2162063
ILT
61302010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6131
6132 * gold/arm.cc: Added support for R_ARM_V4BX relocation
6133 (class Arm_v4bx_stub): New class.
6134 (DEF_STUBS): Updated definition to support v4_veneer_bx.
6135 (Stub_factory::make_arm_v4bx_stub): New method.
6136 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
6137 (Stub_table::empty): Handle v4bx stubs.
6138 (Stub_table::add_arm_v4bx_stub): New method.
6139 (Stub_table::find_arm_v4bx_stub): New method.
6140 (Arm_relocate_functions::v4bx): New method.
6141 (Target_arm::fix_v4bx): New method.
6142 (Target_arm::Target_arm): Handle R_ARM_V4BX.
6143 (Stub_table::relocate_stubs): Likewise.
6144 (Stub_table::do_write): Likewise.
6145 (Stub_table::update_data_size_and_addralign): Likewise.
6146 (Stub_table::finalize_stubs): Likewise.
6147 (Target_arm::Scan::local): Likewise.
6148 (Target_arm::Scan::global): Likewise.
6149 (Target_arm::do_finalize_sections): Likewise.
6150 (Target_arm::Relocate::relocate): Likewise.
6151 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6152 Likewise.
6153 (Target_arm::scan_reloc_for_stub): Likewise.
6154 (Target_arm::scan_reloc_section_for_stubs): Likewise.
6155
5696ab0b
ILT
61562010-01-19 Ian Lance Taylor <iant@google.com>
6157
6158 * output.cc (Output_section_headers::do_sized_write): Write large
6159 segment count to sh_info field.
6160 (Output_file_header::do_sized_write): For large segment count,
6161 write PN_XNUM to e_phnum field.
6162
800d0f56
ILT
61632010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6164
6165 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
6166 (Arm_relocate_functions::thm_jump8): New function.
6167 (Arm_relocate_functions::thm_jump11): New function.
6168 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
6169 R_ARM_THM_JUMP11.
6170 (Target_arm::Scan::global): Likewise.
6171 (Target_arm::Relocate::relocate): Likewise.
6172 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6173 Likewise.
6174
41263c05
DK
61752010-01-14 Doug Kwan <dougkwan@google.com>
6176
6177 * arm.cc (map, utility): Include headers.
6178 (Target_arm::apply_cortex_a8_workaround): New method.
6179 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
6180 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
6181 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
6182 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
6183 the --[no-]fix-cortex-a8 command line options.
6184 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
6185 (Target_arm::relocate_stub): Use addend in instruction template.
6186 * options.h (DEFINE_bool): Set the user-set flag.
6187 (General_options): Add --[no-]-fix-cortex options.
6188 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 6189 : Update fast look-up map after conversion.
41263c05 6190
459e9b03
ST
61912010-01-14 Sriraman Tallam <tmsriram@google.com>
6192
6193 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
6194 in the first pass of do_layout.
6195
b521dfe4
DK
61962010-01-13 Doug Kwan <dougkwan@google.com>
6197
6198 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
6199 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
6200 apparent compiler problem of not folding static constant integral
6201 data members of elfcpp::Elf_sizes<32>.
6202
44272192
DK
62032010-01-13 Doug Kwan <dougkwan@google.com>
6204
6205 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
6206 Arm_relobj::section_needs_cortex_a8_stub_scanning,
6207 Arm_relobj::scan_section_for_cortex_a8_erratum,
6208 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
6209 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
6210 sections to scan for relocation stubs into a new method
6211 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
6212 relocation and Cortex-A8 stub scanning.
6213 (Target_arm::do_relax): Force stubs to be after stubbed sections
6214 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 6215 the beginning of a new relaxation pass. Update a comment.
44272192
DK
6216 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
6217
44b71ece
ILT
62182010-01-12 Ian Lance Taylor <iant@google.com>
6219
6220 * target-reloc.h (visibility_error): New inline function.
6221 (relocate_section): Call visibility_error.
6222 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
6223 (MOSTLYCLEANFILES): Likewise.
6224 (protected_4_pic.o, protected_3.err): New targets.
6225 * testsuite/protected_4.cc: New file.
6226
a120bc7f
DK
62272010-01-12 Doug Kwan <dougkwan@google.com>
6228
6229 * arm.cc (Cortex_a8_reloc): New class.
6230 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
6231 and cortex_a8_relocs_info_.
6232 (Target_arm::fix_cortex_a8): New method definition.
6233 (Target_arm::Cortex_a8_relocs_info): New type.
6234 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
6235 New data member declarations.
6236 (Target_arm::scan_reloc_for_stub): Record information about
6237 relocations for THUMB branches that might be exempted from the
6238 Cortex-A8 workaround.
6239 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
6240 at the beginning of a relaxation pass.
6241
20138696
DK
62422010-01-12 Doug Kwan <dougkwan@google.com>
6243
6244 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
6245 (Arm_relobj::Mapping_symbol_position,
6246 Arm_reloj::Mapping_symbol_position_less,
6247 Arm_relobj::Mapping_symbols_info): New types.
6248 (Target_arm::is_mapping_symbol_name): New method definition.
6249 (Arm_relobj::do_count_local_symbols): Save information about mapping
6250 symbols.
6251
089d69dc
DK
62522010-01-11 Doug Kwan <dougkwan@google.com>
6253
6254 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
6255 Arm_relocate_functions::thumb32_branch_upper,
6256 Arm_relocate_functions::thumb32_branch_lower,
6257 Arm_relocate_functions::thumb32_cond_branch_offset,
6258 Arm_relocate_functions::thumb32_cond_branch_upper,
6259 Arm_relocate_functions::thumb32_cond_branch_lower,
6260 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
6261 branch offset encoding.
6262 (Arm_relocate_functions::thumb_branch_common): Use new branch
6263 offset encoding methods to avoid code duplication.
6264 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
6265 (Stub_addend_reader::operator()): Use new branch encoding method
6266 to avoid code duplication.
6267
99e5bff2
DK
62682010-01-11 Doug Kwan <dougkwan@google.com>
6269
6270 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
6271 (Target_arm::do_finalize_sections): Define special EXIDX section
6272 symbols only if referenced.
6273 * gc.h (Garbage_collection::add_reference): New method.
6274 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
6275 code duplication.
6276
98e090bd
ILT
62772010-01-11 Ian Lance Taylor <iant@google.com>
6278
d0a91bd8
ILT
6279 * script.cc (Version_script_info::build_expression_list_lookup):
6280 Change complaing about duplicate wildcard match from error to
6281 warning.
6282
98e090bd
ILT
6283 * script.cc (class Lazy_demangler): Recreate--revert part of patch
6284 of 2009-12-30.
6285 (Version_script_info::Version_script_info): Initialize globs_,
6286 default_version_, default_is_global_, and exact_. Don't
6287 initialize globals_ or locals_.
6288 (Version_script_info::build_lookup_tables): Build local symbols
6289 first.
6290 (Version_script_info::unquote): New function.
6291 (Version_script_info::add_exact_match): New function.
6292 (Version_script_info::build_expression_list_lookup): Remove lookup
6293 parameter. Add is_global parameter. Change all callers. Handle
6294 wildcard pattern specially. Unquote pattern. Call
6295 add_exact_match.
6296 (Version_script_info::get_name_to_match): New function.
6297 (Version_script_info::get_symbol_version): New function.
6298 (Version_script_info::get_symbol_version_helper): Remove.
6299 (Version_script_info::check_unmatched_names): Call unquote.
6300 * script.h (class Version_script_info): Change get_symbol_version
6301 to be non-inline and add is_global parameter; change all callers.
6302 Rewrite symbol_is_local. Update declarations. Define struct
6303 Version_tree_match, Exact, Globs. Don't define struct Lookup.
6304 Remove globals_ and locals_ members. Add exact_, globs_,
6305 default_version_, is_global_.
6306 (Version_script_info::Glob): Remove pattern, add expression and
6307 is_global. Update constructor. Change all callers.
6308 * dynobj.cc (Versions::finalize): Mark the version symbol as the
6309 default version.
6310 (Versions::symbol_section_contents): If a symbol is undefined, or
6311 defined in a dynamic object, set the version index to
6312 VER_NDX_LOCAL.
6313 * symtab.cc (Symbol_table::add_from_relobj): Don't call
6314 symbol_is_local.
6315 (Symbol_table::add_from_pluginobj): Likewise.
6316 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
6317
d56962d3
DK
63182010-01-11 Doug Kwan <dougkwan@google.com>
6319
6320 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
6321 (incremental_dump_LDADD): Add linking option for libintl.
6322 * Makefile.in: Regenerate.
6323
94e6ee91
L
63242010-01-11 H.J. Lu <hongjiu.lu@intel.com>
6325
6326 PR gold/11144
6327 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
6328 instead of -Ds.
6329 * testsuite/Makefile.in: Regenerated.
6330
e96c574b
DK
63312010-01-10 Doug Kwan <dougkwan@google.com>
6332
6333 * options.h (DEFINE_var): Use parentheses around argument varname__
6334 in macro body to avoid any unintended subsequent substitutions.
6335
7198066b
ILT
63362010-01-10 Ian Lance Taylor <iant@google.com>
6337
ba4d53bf
ILT
6338 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
6339 candidates before doing symbol resolution.
6340
7198066b
ILT
6341 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
6342 ODR candidates if only one is weak.
6343
a2beed37
ILT
63442010-01-08 Ian Lance Taylor <iant@google.com>
6345
6346 * script.cc (Version_script_info::build_expression_list_lookup):
6347 Don't warn about ambiguous version, just record the ambiguity.
6348 (Version_script_info::get_symbol_version_helper): Give error if
6349 version is ambiguous.
6350
2fb7225c
DK
63512010-01-08 Doug Kwan <dougkwan@google.com>
6352
6353 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
6354 prev_data_size_ and prev_addralign_. Remove initializer for
6355 deleted data member has_been_changed_.
6356 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
6357 to determine if the table is empty.
6358 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
6359 Remove.
6360 (Stub_table::add_reloc_stub): Define method in class definition
6361 instead of just declaring it there.
6362 (Stub_table::add_cortex_a8_stub): New method definition.
6363 (Stub_table::update_data_size_and_addralign): Ditto.
6364 (Stub_table::finalize_stubs): Ditto.
6365 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
6366 (Stub_table::do_addralign_): Return address alignment in the
6367 (Stub_table::do_reset_address_and_file_offset): Define method in
6368 class definition instead of declaring it there. Set current data
6369 size to be the data size of the previous pass.
6370 (Stub_table::set_final_data_size): Use current data size as the
6371 final data size.
6372 (Stub_table::relocate_stub): Change parameter type of stub from
6373 Reloc_stub pointer to Stub pointer.
6374 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
6375 (Stub_table::Cortex_a8_stub_list): New typedef.
6376 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
6377 Stub_table::prev_addralign_): New data member.
6378 (Arm_relobj::Arm_relobj): Initialize data member
6379 section_has_cortex_a8_workaround_.
6380 (Arm_relobj::section_has_cortex_a8_workaround,
6381 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
6382 definitions.
6383 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
6384 declarations.
6385 (Target_arm::relocate_stub): Change parameter type of stub from
6386 Reloc_stub pointer to Stub pointer.
6387 (Insn_template::size, Insn_template::alignment): Handle
6388 THUMB16_SPECIAL_TYPE.
6389 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
6390 Stub_table::update_data_size_and_addralign,
6391 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
6392 definitions.
6393 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
6394 (Stub_table::do_write): Ditto.
6395 (Target_arm::do_relax): Adjust code for changes in Stub_table.
6396
880cd20d
ILT
63972010-01-08 Ian Lance Taylor <iant@google.com>
6398
6399 PR 11108
6400 * symtab.h (class Symbol): Remove fields is_target_special_ and
6401 has_plt_offset_. Add field is_defined_in_discarded_section_.
6402 (Symbol::is_defined_in_discarded_section): New function.
6403 (Symbol::set_is_defined_in_discarded_section): New function.
6404 (Symbol::has_plt_offset): Rewrite.
6405 (Symbol::set_plt_offset): Verify that new offset is not -1U.
6406 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
6407 Don't initialize is_target_special_ or has_plt_offset_.
6408 Initialize is_defined_in_discarded_section_.
6409 (Symbol_table::add_from_relobj): If appropriate, set
6410 is_defined_in_discarded_section.
6411 * resolve.cc (Symbol::override_base_with_special): Don't test
6412 is_target_special_. Change has_plt_offset_ to has_plt_offset().
6413 * target-reloc.h (relocate_section): Do special handling for
6414 symbols defined in discarded sections for global symbols as well
6415 as local symbols.
6416
2703e3eb
ILT
64172010-01-08 Ian Lance Taylor <iant@google.com>
6418
6419 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
6420 the SHT_SYMTAB case.
6421
339d40a3
ILT
64222010-01-08 Ian Lance Taylor <iant@google.com>
6423
6424 * object.cc (Sized_relobj::do_layout): Don't get confused if
6425 layout_eh_frame returns NULL.
6426
abecea76
ILT
64272010-01-08 Ian Lance Taylor <iant@google.com>
6428
6429 PR 11084
6430 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
6431 dynamic symbol table, use the normal symbol table.
6432 (Sized_dynobj::do_read_symbols): Remove assertion about type of
6433 symbol table.
6434
6b7dd3f3
ILT
64352010-01-08 Ian Lance Taylor <iant@google.com>
6436
6437 PR 11072
6438 * layout.cc (Layout::include_section): Remove .gnu_debuglink
6439 sections.
6440
36c50e63
L
64412010-01-08 H.J. Lu <hongjiu.lu@intel.com>
6442
6443 * version.cc (print_version): Change to "Copyright 2010".
6444
e291e7b9
ILT
64452010-01-08 Ian Lance Taylor <iant@google.com>
6446
6447 PR 10287
6448 PR 11063
6449 * i386.cc (class Target_i386): Change return type of plt_section
6450 to be non-const.
6451 (class Output_data_plt_i386): Add tls_desc_rel_ field.
6452 (Output_data_plt_i386::Output_data_plt_i386): Initialize
6453 tls_desc_rel_ field.
6454 (Output_data_plt_i386::rel_tls_desc): New function.
6455 (Target_i386::rel_tls_desc_section): New function.
6456 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
6457 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
6458 R_386_TLS_DESC reloc in rel_tls_desc_section.
6459 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
6460 Define struct Tlsdesc_info.
6461 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
6462 (Target_x86_64::do_reloc_symbol_index): New function.
6463 (Target_x86_64::add_tlsdesc_info): New function.
6464 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
6465 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
6466 tlsdesc_rel_ field.
6467 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
6468 all callers.
6469 (Output_data_plt_x86_64::rela_tlsdesc): New function.
6470 (Target_x86_64::rela_tlsdesc_section): New function.
6471 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
6472 handling.
6473 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
6474 (Target_x86_64::do_reloc_addend): New function.
6475 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
6476 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
6477 declarations. Define TARGET_CODE. Add arg field to u1_ union.
6478 (Output_reloc::type): New function.
6479 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
6480 (Output_reloc::is_target_specific): New function.
6481 (Output_reloc::target_arg): New function.
6482 (class Output_reloc) [SHT_RELA]: Add four new constructors for
6483 absolute relocs and target specific relocs.
6484 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
6485 add_target_specific.
6486 (class Output_data_reloc) [SHT_RELA]: Likewise.
6487 * output.cc (Output_reloc::Output_reloc): Add four new versions
6488 for absolute relocs and target specific relocs.
6489 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
6490 (Output_reloc::get_symbol_index): Likewise.
6491 (Output_reloc::local_section_offset): Check that local_sym_index_
6492 is not TARGET_CODE or 0.
6493 (Output_reloc::symbol_value): Likewise.
6494 (Output_reloc::write) [SHT_RELA]: Call target for target specific
6495 reloc.
6496 * target.h (class Target): Add reloc_symbol_index and reloc_addend
6497 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
6498 functions.
6499 * layout.cc (add_target_dynamic_tags): Use output section for
6500 DT_PLTRELSZ and DT_JMPREL.
6501
3a44184e
ILT
65022010-01-07 Ian Lance Taylor <iant@google.com>
6503
6504 PR 11061
6505 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
6506 function.
6507 (class Output_data_reloc_generic): Define.
6508 (class Output_data_reloc_base): Change base class to
6509 Output_data_reloc_generic. Change add() method to call
6510 bump_relative_reloc_count for a relative reloc. Remove
6511 sort_relocs_ field.
6512 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
6513 to sort_relocs().
6514 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
6515 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
6516 appropriate.
6517 * layout.h (class Layout): Update declaration.
6518
ea715a34
ILT
65192010-01-07 Ian Lance Taylor <iant@google.com>
6520
6521 * output.h (class Output_data): Add const version of
6522 output_section and do_output_section.
6523 (class Output_section_data): Add const version of
6524 do_output_section.
6525 (class Output_section): Likewise.
6526 * layout.cc (Layout::add_target_dynamic_tags): New function.
6527 * layout.h (class Layout): Update declarations.
6528 * arm.cc (Target_arm::do_finalize_sections): Use
6529 add_target_dynamic_tags.
6530 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6531 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
6532 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
6533 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6534
659948a4
ILT
65352010-01-07 Ian Lance Taylor <iant@google.com>
6536
6537 PR 11042
6538 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
6539 object as needed.
6540
9d3b86f6
ILT
65412010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
6542 Ian Lance Taylor <iant@google.com>
6543
6544 PR 11019
6545 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
6546 Xindex::read_symtab_xindex.
6547
bb0d3eb0
DK
65482010-01-07 Doug Kwan <dougkwan@google.com>
6549
6550 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
6551 (Insn_template::thumb16_bcond_insn): New method declaration.
6552 (Insn_template): Fix spelling.
6553 (Stub::thumb16_special): New method declaration.
6554 (Stub::do_write): Define virtual method which was previously pure
6555 virtual.
6556 (Stub::do_thumb16_special): New method declaration.
6557 (Stub::do_fixed_endian_write): New template member.
6558 (Reloc_stub::do_write): Remove.
6559 (Reloc_stub::do_fixed_endian_write): Remove.
6560 (Cortex_a8_stub): New class definition.
6561 (Stub_factory::make_cortex_a8_stub): New method definition.
6562 (Stub_factory::Stub_factory): Add missing static storage class
6563 qualifier for elf32_arm_stub_a8_veneer_blx.
6564
ffeef7df
ILT
65652010-01-07 Ian Lance Taylor <iant@google.com>
6566
dc3f80fe
ILT
6567 PR 10980
6568 * options.h (class General_options): Add --warn-unresolved-symbols
6569 and --error-unresolved-symbols.
6570 * errors.cc (Errors::undefined_symbol): Implement
6571 --warn-unresolved-symbols.
6572
ffeef7df
ILT
6573 * options.h (class General_options): Add -z text and -z textoff.
6574 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
6575
f1ec9ded
ST
65762010-01-06 Sriraman Tallam <tmsriram@google.com>
6577
6578 * gc.h (Garbage_collection::Cident_section_map): New typedef.
6579 (Garbage_collection::cident_sections): New function.
6580 (Garbage_collection::add_cident_section): New function.
6581 (Garbage_collection::cident_sections_): New member.
6582 (gc_process_relocs): Add references to sections whose names are C
6583 identifiers.
6584 * gold.h (cident_section_start_prefix): New constant.
6585 (cident_section_stop_prefix): New constant.
6586 (is_cident): New function.
6587 * layout.cc (Layout::define_section_symbols): Replace string constants
6588 with the newly defined constants.
6589 * object.cc (Sized_relobj::do_layout): Track sections whose names are
6590 C identifiers.
6591 * testsuite/Makefile.am: Add gc_orphan_section_test.
6592 * testsuite/Makefile.in: Regenerate.
6593 * testsuite/gc_orphan_section_test.cc: New file.
6594 * testsuite/gc_orphan_section_test.sh: New file.
6595
6eda8c29
ILT
65962010-01-06 Ian Lance Taylor <iant@google.com>
6597
b9674e17
ILT
6598 PR 10980
6599 * options.h (class General_options): Add --warn-shared-textrel.
6600 * layout.cc (Layout::finish_dynamic_section): Implement
6601 --warn-shared-textrel.
6602
6eda8c29
ILT
6603 PR 10980
6604 * options.h (class General_options): Add --warn-multiple-gp.
6605
32dcd44e
ILT
66062010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6607
6608 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
6609 $(THREADSLIB) and $(LIBDL).
6610 * Makefile.in: Rebuild.
6611
a192ba05
ILT
66122010-01-06 Ian Lance Taylor <iant@google.com>
6613
6614 PR 10980
6615 * options.cc (General_options::parse_section_start): New function.
6616 (General_options::section_start): New function.
6617 (General_options::General_options): Initialize all members.
6618 * options.h: Include <map>
6619 (class General_options): Add --section-start. Add section_starts_
6620 member.
6621 * layout.cc (Layout::attach_allocated_section_to_segment): If
6622 --section-start was used, set the address of the segment. Remove
6623 local sort_sections.
6624 (Layout::relaxation_loop_body): If the address of the load segment
6625 has been set by --section-start, don't use it.
6626 * output.h (Output_segment::update_flags_for_output_section): New
6627 function.
6628 * output.cc (Output_segment::add_output_section): Call
6629 update_flags_for_output_section.
6630
dde3f402
ILT
66312010-01-05 Ian Lance Taylor <iant@google.com>
6632
62dfdd4d
ILT
6633 PR 10980
6634 * options.h (class General_options): Add --undefined-version.
6635 * script.cc (struct Version_expression): Add was_matched_by_symbol
6636 field.
6637 (Version_script_info::matched_symbol): New function.
6638 (Version_script_info::get_symbol_version_helper): Call
6639 matched_symbol.
6640 (Version_script_info::check_unmatched_names): New function.
6641 * script.h (class Version_script_info): Update declarations.
6642 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
6643
9c4ae156
ILT
6644 * options.h (class General_options): Use DEFINE_bool_alias for
6645 allow_multiple_definition.
6646 * resolve.cc (Symbol_table::should_override): Don't test
6647 allow_multiple_definition.
6648
dde3f402
ILT
6649 PR 10980
6650 * options.h (class General_options): Add --cref.
6651 * main.cc (main): Print cref table if --cref. Don't close mapfile
6652 until after printing cref table.
6653 * cref.cc: Include "symtab.h".
6654 (class Cref_inputs): Define Cref_table_compare and Cref_table.
6655 (Cref_table_compare::operator()): New function.
6656 (Cref_inputs::gather_cref): New function.
6657 (filecol): New static const.
6658 (Cref_inputs::print_cref): New function.
6659 (Cref::print_cref): New function.
6660 * cref.h: Include <cstdio>.
6661 (class Cref): Update declarations.
6662 * mapfile.h (Mapfile::file): New function.
6663 * object.h (class Object): Define Symbols. Declare virtual
6664 do_get_global_symbols.
6665 (Object::get_global_symbols): New function.
6666 * object.cc (Input_objects::add_object): Pass object to cref_ if
6667 --cref.
6668 (Input_objects::archive_start): Likewise.
6669 (Input_objects::archive_stop): Likewise.
6670 (Input_objects::print_cref): New function.
6671 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
6672 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
6673 --cref.
6674 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
6675 function.
6676 * plugin.h (class Sized_pluginobj): Update declarations.
6677
8781f709
ILT
66782010-01-05 Ian Lance Taylor <iant@google.com>
6679
6680 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
6681 to is_default_version. Rename insdef to insdefault.
6682 (Symbol_table::add_from_relobj): Rename def to is_default_version
6683 and local to is_forced_local.
6684 (Symbol_table::add_from_pluginobj): Likewise.
6685 (Symbol_table::add_from_dynobj): Likewise.
6686 (Symbol_table::define_special_symbol): Rename insdef to
6687 insdefault.
6688
fe35d28d
ILT
66892010-01-04 Ian Lance Taylor <iant@google.com>
6690
30bc8c46
ILT
6691 PR 10980
6692 * options.h (class General_options): Add
6693 --allow-multiple-definition and -z muldefs.
6694 * resolve.cc (Symbol_table::should_override): Don't warn about a
6695 multiple symbol definition if --allow-multiple-definition or -z
6696 muldefs.
6697
7eaea549
ILT
6698 PR 10980
6699 * options.h (class General_options): Add --add-needed and
6700 --copy-dt-needed-entries. Tweak --as-needed help entry.
6701 * object.cc (Input_objects::check_dynamic_dependencies): Give an
6702 error if --copy-dt-needed-entries aka --add-needed is used and
6703 would cause a change in behaviour.
6704
fe35d28d
ILT
6705 PR 10980
6706 * options.h (class General_options): Add -G as a short version of
6707 --shared. Add no-op options -assert, -g, and -i.
6708
55a2bb35
ST
67092010-01-04 Sriraman Tallam <tmsriram@google.com>
6710
6711 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
6712 check for .text or .gnu.linkonce.t sections.
6713 * icf.cc (Icf::find_identical_sections): Ditto.
6714 Change the detection for mangled function name within the section
6715 name.
6716 * icf.h (is_section_foldable_candidate): New function.
6717
719328e1
ILT
67182009-12-30 Ian Lance Taylor <iant@google.com>
6719
6720 PR 10980
6721 * options.h (class General_options): Permit two dashes with
6722 --retain-symbols-file.
6723
d7bb5745
ILT
67242009-12-30 Ian Lance Taylor <iant@google.com>
6725
403a15dd
ILT
6726 PR 10979
6727 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
6728 don't put the file header and segment headers in the text
6729 segment.
6730
eda294df
ILT
6731 PR 10979
6732 * common.cc (Sort_commons::operator()): Stabilize sort when both
6733 entries are NULL.
6734 (Symbol_table::do_allocate_commons_list): When allocating common
6735 symbols, skip a symbol which is no longer common.
6736 * symtab.h (Symbol::is_common): Test whether the symbol comes from
6737 an object before checking its type.
6738 * testsuite/common_test_2.c: New file.
6739 * testsuite/common_test_3.c: New file.
6740 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
6741 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
6742 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
6743 (common_test_2_pic.o, common_test_2.so): New targets.
6744 (common_test_3_pic.o, common_test_3.so): New targets.
6745 * testsuite/Makefile.in: Rebuild.
6746
d7bb5745
ILT
6747 PR 10979
6748 * script.cc (read_input_script): If we see a new SECTIONS clause,
6749 and we have added an input section, give an error.
6750 * layout.h (class Layout): Add have_added_input_section function.
6751 Add have_added_input_section_ field.
6752 * layout.cc (Layout::Layout): Initialize
6753 have_added_input_section_.
6754 (Layout::layout): Set have_added_input_section_.
6755 (Layout::layout_eh_frame): Likewise.
6756
fc59c572
ILT
67572009-12-30 Ian Lance Taylor <iant@google.com>
6758
6759 PR 10931
6760 * options.h (class General_options): Add --sort-common option.
6761 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
6762 * common.cc (Sort_common): Add sort_order parameter to
6763 constructor. Add sort_order_ field.
6764 (Sort_commons::operator): Check sort_order_.
6765 (Symbol_table::allocate_commons): Determine the sort order.
6766 (Symbol_table::do_allocate_commons): Add sort_order parameter.
6767 Change all callers.
6768 (Symbol_table::do_allocate_commons_list): Likewise.
6769
1c74fab0
ILT
67702009-12-30 Ian Lance Taylor <iant@google.com>
6771
6772 PR 10916
6773 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
6774 symbols from this object, don't change the visibility of an
6775 undefined symbol.
6776 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
6777
6affe781
ILT
67782009-12-30 Ian Lance Taylor <iant@google.com>
6779
6780 PR 10861
6781 * script.h (class Version_script_info): Define Language enum.
6782 Update declarations. Define Glob, Exact, and Lookup types. Add
6783 new fields globals_, locals_, and is_finalized_.
6784 * script.cc: Various formatting fixes.
6785 (class Parser_closure): Change language_stack_ from a vector of
6786 std::string to one of Version_script_info::Language. Adjust all
6787 uses accordingly.
6788 (class Lazy_demangler): Remove.
6789 (struct Version_expression): Change language from std::string to
6790 Version_script_info::Language.
6791 (Version_script_info::Version_script_info): New function.
6792 (Version_script_info::~Version_script_info): Don't call clear.
6793 (Version_script_info::finalize): New function.
6794 (Version_script_info::build_lookup_tables): New function.
6795 (Version_script_info::build_expression_list_lookup): New
6796 function.
6797 (Version_script_info::get_symbol_version_helper): Rewrite to use
6798 lookup tables.
6799 (Version_script_info::print_expression_list): Adjust to use
6800 Version_script_info::Language.
6801 (script_push_lex_into_version_mode): Check that the version script
6802 has not been finalized.
6803 (version_script_push_lang): Change language string to
6804 Version_script_info::Language.
6805 * options.cc (Command_line::version_script): New function.
6806 * options.h (class General_options): Add finalize_dynamic_list
6807 function. Change version_script from declaration to definition.
6808 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
6809 * testsuite/version_script.map: Remove duplicate def of foo.
6810 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
6811 version_script.map.
6812 * testsuite/Makefile.in: Rebuild.
6813
818bf354
ILT
68142009-12-30 Ian Lance Taylor <iant@google.com>
6815
6816 PR 10843
6817 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
6818 if the input symbol index is 0, make the output symbol index 0.
6819
ebcc8304
ILT
68202009-12-30 Ian Lance Taylor <iant@google.com>
6821
6822 PR 10670
6823 * options.h (class General_options): Add -x/--discard-all.
6824 * object.cc (Sized_relobj::do_count_local_symbols): Handle
6825 --discard-all. If the local symbol needs a dynamic entry, check
6826 that before handling --discard-locals.
6827
176fe33f
ILT
68282009-12-30 Ian Lance Taylor <iant@google.com>
6829
bb321bb1
ILT
6830 PR 10450
6831 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
6832 flags to PF_R.
6833 (Output_segment::add_output_section): Don't change the flags if
6834 the type is PT_TLS.
6835
176fe33f
ILT
6836 PR 10450
6837 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
6838 GNU hash table if they need a dynamic value. Otherwise, don't add
6839 them if they are defined in a dynamic object or are forced local.
6840
e8cd95c7
ILT
68412009-12-29 Ian Lance Taylor <iant@google.com>
6842
1b81fb71
ILT
6843 PR 10450
6844 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
6845 .gnu.hash table for a 32-bit target.
6846
8d6d383d
ILT
6847 PR 10450
6848 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
6849 regular and a dynamic object only needs a dynamic symbol table
6850 entry if it is externally visible.
6851
e785ec03
ILT
6852 PR 10450
6853 * i386.cc (class Target_i386): Initialize global_offset_table_ in
6854 constructor. Add global_offset_table_ field.
6855 (Target_i386::got_section): Set global_offset_table_.
6856 (Target_i386::do_finalize_sections): Set global_offset_table_
6857 size.
6858 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
6859 in constructor. Add global_offset_table_ field.
6860 (Target_x86_64::got_section): Set global_offset_table_.
6861 (Target_x86_64::do_finalize_sections): Set global_offset_table_
6862 size.
6863
1a2dff53
ILT
6864 * layout.cc (Layout::Layout): Initialize increase_relro_.
6865 (Layout::get_output_section): Add is_relro, is_last_relro, and
6866 is_first_non_relro parameters. Change all callers.
6867 (Layout::choose_output_section): Likewise.
6868 (Layout::add_output_section_data): Likewise.
6869 (Layout::make_output_section): Likewise.
6870 (Layout::set_segment_offsets): Clear increase_relro when using a
6871 linker script.
6872 * layout.h (class Layout): Add increase_relro method. Add
6873 increase_relro_ field. Update declarations.
6874 * output.cc (Output_section::Output_section): Initialize
6875 is_last_relro_ and is_first_non_relro_.
6876 (Output_segment::add_output_section): Group relro sections is
6877 do_sort is true. Handle is_last_relro and is_first_non_relro.
6878 (Output_segment::maximum_alignment): Remove relro handling.
6879 (Output_segment::set_section_addresses): Add increase_relro
6880 parameter. Change all callers. Add initial alignment to align
6881 relro sections on separate page. Remove old relro handling.
6882 (Output_segment::set_section_list_addresses): Remove in_relro
6883 parameter. Change all callers.
6884 (Output_segment::set_offset): Add increase parameter. Change all
6885 callers. Remove old relro handling.
6886 * output.h (class Output_section): Add new methods: is_last_relro,
6887 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
6888 Add is_last_relro_ and is_first_non_relro_ fields.
6889 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
6890 Create separate .got.plt section. Call increase_relro.
6891 * x86_64.cc (Target_x86_64::got_section): Likewise.
6892 * testsuite/relro_script_test.t: Add .got.plt.
6893
f0ba79e2
ILT
6894 PR 10450
6895 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
6896 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
6897 (Layout::finalize): Call set_dynamic_symbol_size.
6898 (Layout::set_dynamic_symbol_size): New function.
6899 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
6900 set_dynamic_symbol_size.
6901
e8cd95c7
ILT
6902 PR 10450
6903 * output.h (class Output_section): Add is_entsize_zero_ field.
6904 * output.cc (Output_section::Output_section): Initialize
6905 is_entsize_zero_.
6906 (Output_section::set_entsize): If two different entsizes are
6907 requested, force it to zero.
6908 (Output_section::add_input_section): Set flags for .debug_str
6909 before updating section flags. Set entsize.
6910 (Output_section::update_flags_for_input_section): Set SHF_MERGE
6911 and SHF_STRING if all input sections have those flags.
6912
3e1b9a8a
RÁE
69132009-12-29 Rafael Espindola <espindola@google.com>
6914
6915 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
6916 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
6917 reporting.
3e1b9a8a 6918
3dcad376
ST
69192009-12-29 Sriraman Tallam <tmsriram@google.com>
6920
6921 * options.cc (General_options::parse_version): Allow -v to exit
6922 without an error if there is nothing to link.
6923
084e2665
ILT
69242009-12-29 Ian Lance Taylor <iant@google.com>
6925
6926 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
6927 using a version of gcc before 4.1.
6928 * configure: Rebuild.
6929
250acde3
CD
69302009-12-28 Chris Demetriou <cgd@google.com>
6931
6932 * attributes.cc (Output_attributes_section_data::do_write): Use
6933 std::vector::front rather than std::vector::data.
6934
99fff23b
ILT
69352009-12-28 Ian Lance Taylor <iant@google.com>
6936
6937 * symtab.h (class Symbol_table): Add enum Defined.
6938 * resolve.cc (Symbol_table::should_override): Add defined
6939 parameter. Change all callers. Test whether object is NULL
6940 before calling a method on it.
6941 (Symbol_table::report_resolve_problem): Add defined parameter.
6942 Change all callers.
6943 (Symbol_table::should_override_with_special): Likewise.
6944 * symtab.cc (Symbol_table::define_in_output_data): Add defined
6945 parameter. Change all callers.
6946 (Symbol_table::do_define_in_output_data): Likewise.
6947 (Symbol_table::define_in_output_segment): Likewise.
6948 (Symbol_table::do_define_in_output_segment): Likewise.
6949 (Symbol_table::define_as_constant): Likewise.
6950 (Symbol_table::do_define_as_constant): Likewise.
6951 * script.h (class Symbol_assignment): Add is_defsym parameter to
6952 constructor; change all callers.
6953 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
6954 parameter. Change all callers. Add is_defsym_ field.
6955 (class Parser_closure): Add parsing_defsym parameter to
6956 constructor; change all callers. Add parsing_defsym accessor
6957 function. Add parsing_defsym_ field.
6958
556bd683
ILT
69592009-12-28 Ian Lance Taylor <iant@google.com>
6960
6961 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 6962 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 6963
1782c879
ILT
69642009-12-23 Ian Lance Taylor <iant@google.com>
6965
6966 * i386.cc (Target_i386::do_calls_non_split): Recognize
6967 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
6968 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
6969 -fsplit-stack prologue when using %r11.
1782c879 6970
329ca2b1
ST
69712009-12-21 Sriraman Tallam <tmsriram@google.com>
6972
6973 * options.cc (General_options::parse_version): Make -v continue and do
6974 the link like GNU ld does.
6975
d675ff46
RÁE
69762009-12-17 Rafael Avila de Espindola <espindola@google.com>
6977
6978 * Makefile.am (CCFILES): Add timer.cc.
6979 (HFILES): Add timer.h.
6980 * configure.ac: Check for sysconf and times.
6981 * main.cc: include timer.h.
6982 (main): Use Timer instead of get_run_time.
6983 * timer.cc: New.
6984 * timer.h: New.
6985 * workqueue.cc: include timer.h.
6986 (Workqueue::find_and_run_task):
6987 Report user, sys and wall time.
6988 * Makefile.in: Regenerate.
6989 * config.in: Regenerate.
6990 * configure: Regenerate.
6991
d6344fb5
DK
69922009-12-16 Doug Kwan <dougkwan@google.com>
6993
6994 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
6995 sections.
6996 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
6997 relaxed input sections.
6998 * output.cc (Output_section::find_relaxed_input_section): Change
6999 return type to Output_relaxed_input_section pointer. Adjust code
7000 for new type of relaxed_input_section_map_.
7001 * output.h (Output_section::find_relaxed_input_section): Change
7002 return type to Output_relaxed_input_section pointer.
7003 (Output_section::Output_relaxed_input_section_by_input_section_map):
7004 New type.
7005 (Output_section::relaxed_input_section_map_): Change type to
7006 Output_section::Output_relaxed_input_section_by_input_section_map.
7007 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
7008 input section.
7009
0e0d5469
ILT
70102009-12-15 Ian Lance Taylor <iant@google.com>
7011
7012 * layout.cc (Layout::create_shstrtab): Only write out after input
7013 sections if we are compressing debug sections.
7014
0649a889
ILT
70152009-12-15 Ian Lance Taylor <iant@google.com>
7016
7017 * archive.cc (Archive::add_symbols): Only look up a symbol without
7018 a version if there is, in fact, a version.
7019
2ea97941
ILT
70202009-12-14 Ian Lance Taylor <iant@google.com>
7021
7022 Revert -Wshadow changes, all changes from:
7023 2009-12-11 Doug Kwan <dougkwan@google.com>
7024 2009-12-11 Nick Clifton <nickc@redhat.com>
7025 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
7026
b0eec2cc
DK
70272009-12-11 Doug Kwan <dougkwan@google.com>
7028
7029 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
7030 due to -Wshadow.
7031 * attributes.cc (Object_attribute::size): Ditto.
7032 (Attributes_section_data::size): Ditto.
7033 (Attributes_section_data::Attributes_section_data): Ditto.
7034 (Output_attributes_section_data::do_write): Ditto.
7035 * attributes.h (Object_attribute::set_type): Ditto.
7036 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
7037
91d6fa6a
NC
70382009-12-11 Nick Clifton <nickc@redhat.com>
7039
7040 * archive.cc: Fix shadowed variable warnings.
7041 * arm.cc: Likewise.
7042 * compressed_output.cc: Likewise.
7043 * compressed_output.h: Likewise.
7044 * configure: Likewise.
7045 * dwarf_reader.cc: Likewise.
7046 * dynobj.cc: Likewise.
7047 * dynobj.h: Likewise.
7048 * ehframe.cc: Likewise.
7049 * ehframe.h: Likewise.
7050 * errors.cc: Likewise.
7051 * expression.cc: Likewise.
7052 * fileread.cc: Likewise.
7053 * fileread.h: Likewise.
7054 * freebsd.h: Likewise.
7055 * i386.cc: Likewise.
7056 * icf.cc: Likewise.
7057 * incremental.h: Likewise.
7058 * layout.cc: Likewise.
7059 * layout.h: Likewise.
7060 * mapfile.cc: Likewise.
7061 * merge.cc: Likewise.
7062 * merge.h: Likewise.
7063 * object.cc: Likewise.
7064 * object.h: Likewise.
7065 * options.h: Likewise.
7066 * output.cc: Likewise.
7067 * output.h: Likewise.
7068 * parameters.cc: Likewise.
7069 * plugin.cc: Likewise.
7070 * powerpc.cc: Likewise.
7071 * reduced_debug_output.cc: Likewise.
7072 * reduced_debug_output.h: Likewise.
7073 * reloc.cc: Likewise.
7074 * reloc.h: Likewise.
7075 * resolve.cc: Likewise.
7076 * script-sections.cc: Likewise.
7077 * script.cc: Likewise.
7078 * script.h: Likewise.
7079 * sparc.cc: Likewise.
7080 * symtab.cc: Likewise.
7081 * symtab.h: Likewise.
7082 * target-select.cc: Likewise.
7083 * target-select.h: Likewise.
7084 * token.h: Likewise.
7085 * workqueue.cc: Likewise.
7086 * workqueue.h: Likewise.
7087 * x86_64.cc: Likewise.
7088
a0351a69
DK
70892009-12-10 Doug Kwan <dougkwan@google.com>
7090
7091 * arm.cc (attributes.h): New include.
7092 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
7093 (Arm_relobj::~Arm_relobj): Delete object pointed by
7094 attributes_section_data_.
7095 (Arm_relobj::attributes_section_data): New method definition.
7096 (Arm_relobj::attributes_section_data_): New data member declaration.
7097 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
7098 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
7099 attributes_section_data_.
7100 (Arm_dynobj::attributes_section_data): New method definition.
7101 (Arm_dynobj::attributes_section_data_): New data member declaration.
7102 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
7103 initialization value of may_use_blx_ to false.
7104 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
7105 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
7106 object attributes to compute results instead of hard-coding.
7107 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
7108 Target_arm::get_secondary_compatible_arch,
7109 Target_arm::set_secondary_compatible_arch
7110 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7111 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
7112 New method declarations.
7113 (Target_arm::get_aeabi_object_attribute): New method definition.
7114 (Target_arm::attributes_section_data_): New data member declaration.
7115 (read_arm_attributes_section): New template definition.
7116 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
7117 (Arm_dynobj::do_read_symbols): Ditto.
7118 (Target_arm::do_finalize_sections): Merge attributes sections from
7119 input. Check for BLX use after attributes section merging.
7120 Fix __exidx_start and __exidx_end visibility. Create an
7121 .ARM.attributes section if necessary.
7122 (Target_arm::get_secondary_compatible_arch,
7123 Target_arm::set_secondary_compatible_arch,
7124 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7125 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 7126 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
7127 New method definitions.
7128
b59befec
ILT
71292009-12-09 Ian Lance Taylor <iant@google.com>
7130
7131 * plugin.cc (Plugin::load): Don't cast from void* to a function
7132 pointer.
7133
1276bc89
ILT
71342009-12-09 Ian Lance Taylor <iant@google.com>
7135
7136 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
7137 information fields.
7138
2f2de248
L
71392009-12-09 H.J. Lu <hongjiu.lu@intel.com>
7140
7141 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
7142 Replace two_file_shared_1.so with two_file_shared_2.so.
7143 * testsuite/Makefile.in: Regenerated.
7144
4f787271
DK
71452009-12-08 Doug Kwan <dougkwan@google.com>
7146
7147 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
7148 (HFILES): Add attributes.h and int_encoding.h.
7149 * Makefile.in: Regenerate.
7150 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
7151 function definitions to int_encoding.cc
7152 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
7153 prototypes to int_encoding.h
7154 * reduced_debug_output.cc (int_encoding.h): New include.
7155 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
7156 function definitions to int_encoding.cc
7157 (insert_into_vector, read_from_pointer): Move template definitions to
7158 int_encoding.h
7159 * attributes.cc: New file.
7160 * attributes.h: New file.
7161 * int_encoding.cc: New file.
7162 * int_encoding.h: New file.
7163
20b52f1a
RÁE
71642009-12-07 Rafael Avila de Espindola <espindola@google.com>
7165
7166 PR gold/11055
7167 * incremental-dump.cc (dump_incremental_inputs): New.
7168 (main): Use dump_incremental_inputs.
7169
53d7974c
L
71702009-12-07 H.J. Lu <hongjiu.lu@intel.com>
7171
7172 PR gold/10893
7173 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
7174 checking elfcpp::STT_FUNC.
7175 (Target_i386::Relocate::relocate): Likewise.
7176 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
7177
7178 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
7179 symbols from shared libraries into normal FUNC symbols.
7180
7181 * symtab.h (Symbol): Add is_func and use it.
7182
05a352e6
DK
71832009-12-05 Doug Kwan <dougkwan@google.com>
7184
7185 * arm.cc (Target_arm::arm_info): Initialize new fields
7186 attributes_section and attributes_vendor.
7187 * i386.cc (Target_i386::i386_info): Same.
7188 * object.cc (Sized_relobj::do_layout): Skip attribute section.
7189 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
7190 fields attributes_section and attributes_vendor.
53d7974c 7191 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
7192 * target.h (Target::attributes_section, Target::attributes_vendor,
7193 Target::is_attributes_section, Target::attribute_arg_type,
7194 Target::attributes_order): New method definitions.
7195 (Target::Target_info::attributes_section,
7196 Target::Target_info::attributes_vendor): New fields.
7197 (Target::do_attribute_arg_type, Target::do_attributes_order): New
7198 virtual method definitions.
7199 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
7200 attributes_section and attributes_vendor.
7201 * testsuite/testfile.cc (Target_test::test_target_info): Same.
7202
f4e5969c
DK
72032009-12-05 Doug Kwan <dougkwan@google.com>
7204
7205 * arm.cc: Update comments about interworking and stub generation.
7206 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
7207 considered as non-PIC.
7208 (Arm_relocate_functions::base_abs): Fix formatting.
7209 (Arm_relocate_functions::got_prel): Fix comment. Change interface
7210 of function to use GOT entry address instead of offset.
7211 (Target_arm::Scan::global): Issue an error if a symbol would need a
7212 PLT does not get one because it is untyped. Remove code to create
7213 dynamic symbols for relative branches.
7214 (Target_arm::Relocate::relocate: Use 0 instead of false since function
7215 takes unsigned integer instead of boolean.
7216
1abce4a6
L
72172009-12-05 H.J. Lu <hongjiu.lu@intel.com>
7218
7219 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
7220 (two_file_test_LDADD): Likewise.
7221 (common_test_1_LDADD): Likewise.
7222 (exception_test_LDADD) Likewise.
7223 (weak_test_LDADD): Likewise.
7224 (many_sections_test_LDADD): Likewise.
7225 (initpri1_LDADD): Likewise.
7226 (script_test_1_LDADD): Likewise.
7227 (script_test_2_LDADD): Likewise.
7228 (justsyms_LDADD): Likewise.
7229 (binary_test_LDADD): Likewise.
7230 (large_LDADD): Likewise.
7231 * testsuite/Makefile.in: Regenerated.
7232
adcf2816 72332009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 7234
adcf2816
L
7235 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
7236 (Symbol_table::override_with_special): Likewise.
7237 (Symbol_table::add_from_object): Likewise.
7238
28e67f5d
RÁE
72392009-12-04 Rafael Avila de Espindola <espindola@google.com>
7240
7241 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
7242 Don't set the data_offset twice.
7243
ae10a101
RÁE
72442009-12-04 Rafael Avila de Espindola <espindola@google.com>
7245
7246 * testsuite/Makefile.in: Regenerate.
7247
f59f41f3
DK
72482009-12-03 Doug Kwan <dougkwan@google.com>
7249
7250 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
7251 (Target_arm::do_finalize_sections): Add parameter for symbol table
7252 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
7253 * i386.cc (Target_i386::do_finalize_sections): Add an additional
7254 parameter for symbol table pointer.
7255 * layout.cc (Layout::finalize): Call Target::finalize_sections with
7256 an additional parameter for a pointer to symbol table.
7257 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
7258 parameter for a symbol table pointer.
7259 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
7260 * target.h (Target::finalize_sections, Target::do_finalize_sections):
7261 Ditto.
7262 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
7263 parameter for a symbol table pointer.
7264
ca55d848
RÁE
72652009-12-03 Rafael Avila de Espindola <espindola@google.com>
7266
7267 * incremental.cc (Incremental_inputs_header)
7268 (Incremental_inputs_header_write, Incremental_inputs_entry)
7269 (Incremental_inputs_entry_write): Move ...
7270 * incremental.h (Incremental_inputs_header)
7271 (Incremental_inputs_header_write, Incremental_inputs_entry)
7272 (Incremental_inputs_entry_write): here.
7273
3aec4f9c
RÁE
72742009-12-02 Rafael Avila de Espindola <espindola@google.com>
7275
7276 * incremental.cc (make_sized_incremental_binary): Set the target.
7277 Error if it is incompatible.
7278 * output.h (Output_file): Add filename method.
7279
9c0ae74d
RÁE
72802009-12-02 Rafael Avila de Espindola <espindola@google.com>
7281
7282 * incremental.cc (Incremental_inputs_entry): Remove unused argument
7283 from the get_* methods.
7284
a45500ae
RÁE
72852009-12-02 Rafael Avila de Espindola <espindola@google.com>
7286
7287 * incremental-dump.cc (main): Check that the offeset of a script is 0.
7288 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
7289 Write 0 for the data_offset of scripts.
7290
325e6408
RÁE
72912009-12-02 Rafael Avila de Espindola <espindola@google.com>
7292
7293 * testsuite/Makefile.am: Add the incremental_test.sh test.
7294 * testsuite/incremental_test.sh: New.
7295 * testsuite/incremental_test_1.c: New.
7296 * testsuite/incremental_test_2.c: New.
7297
954c3e2e
RÁE
72982009-12-01 Rafael Avila de Espindola <espindola@google.com>
7299
7300 * incremental-dump.cc (main): Fix typos.
7301
f8086623
RÁE
73022009-11-27 Rafael Avila de Espindola <espindola@google.com>
7303
7304 PR gold/11025
7305 * incremental-dump.cc (main): Use llu to print 64 bit values.
7306
3b0dd6ac
L
73072009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
7308 H.J. Lu <hongjiu.lu@intel.com>
7309
7310 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
7311 $(LIBDL).
7312 (incremental_dump_LDADD): Likewise.
7313 * Makefile.in: Regenerated.
7314
a6d1ef57 73152009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 7316
a6d1ef57
DK
7317 Revert:
7318
7319 2009-11-25 Doug Kwan <dougkwan@google.com>
7320
7321 * arm.cc (Target_arm::Target_arm): Move method definition
7322 outside of class definition. Add code to handle
7323 --target1-rel, --target1-abs and --target2= options.
7324 (Target_arm::get_reloc_reloc_type): Change method to be
7325 non-static and const.
7326 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
7327 New data member declaration.
7328 (Target_arm::Scan::local, Target_arm::Scan::global,
7329 Target_arm::Relocate::relocate,
7330 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7331 Adjust call to Target_arm::get_real_reloc_type.
7332 (Target_arm::get_real_reloc_type): Use command line options
7333 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
7334 * options.h (--target1-rel, --target1-abs, --target2): New
7335 ARM-only options.
7336
50aeb7d4
DK
73372009-11-25 Doug Kwan <dougkwan@google.com>
7338
7339 * arm.cc (Target_arm::Target_arm): Move method definition outside of
7340 class definition. Add code to handle --target1-rel, --target1-abs
7341 and --target2= options.
7342 (Target_arm::get_reloc_reloc_type): Change method to be non-static
7343 and const.
7344 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
7345 member declaration.
7346 (Target_arm::Scan::local, Target_arm::Scan::global,
7347 Target_arm::Relocate::relocate,
7348 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
7349 call to Target_arm::get_real_reloc_type.
7350 (Target_arm::get_real_reloc_type): Use command line options to
7351 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
7352 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
7353 options.
7354
51938283
DK
73552009-11-25 Doug Kwan <dougkwan@google.com>
7356
7357 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
7358 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
7359 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
7360 formatting.
7361 (Arm_relocate_functions::thm_call): Replace body with a call to
7362 Arm_relocate_functions::thumb_branch_common.
7363 (Arm_relocate_functions::thm_jump24,
7364 Arm_relocate_functions::thm_xpc22): New method definitions.
7365 (Arm_relocate_functions::thumb_branch_common): New method definition.
7366 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
7367 operator.
7368 (Target_arm::Relocate::relocate): Adjust call to thm_call.
7369 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
7370
e2b8f3c4
RÁE
73712009-11-24 Rafael Avila de Espindola <espindola@google.com>
7372
7373 * Makefile.am: Build incremental-dump
7374 * Makefile.in: Regenerate.
7375 * incremental-dump.cc: New.
7376 * incremental.cc (Incremental_inputs_header_data,
7377 Incremental_inputs_entry_data): Move to incremental.h
7378 * incremental.h: (Incremental_inputs_header_data,
7379 Incremental_inputs_entry_data): Move from incremental.cc
7380
bcba9aec
RÁE
73812009-11-24 Rafael Avila de Espindola <espindola@google.com>
7382
7383 * incremental.cc (Incremental_inputs_header,
7384 Incremental_inputs_header_write, Incremental_inputs_entry,
7385 Incremental_inputs_entry_write): Add a typedef with the data type.
7386
7c3afe08
RÁE
73872009-11-24 Rafael Avila de Espindola <espindola@google.com>
7388
7389 * incremental.cc (Incremental_inputs_header,
7390 Incremental_inputs_header_write, Incremental_inputs_entry,
7391 Incremental_inputs_entry_write): Update comment about which
7392 type has the filed descriptions.
7393
d204b6e9
DK
73942009-11-15 Doug Kwan <dougkwan@google.com>
7395
7396 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
7397 (Arm_relocate_functions::arm_branch_common): Change method defintion
7398 in class definition to a method declaration and update list of formal
7399 parameters.
7400 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
7401 Arm_relocation_functions::jump24): Adjust call to
7402 Arm_relocate_functions::arm_branch_common. Update list of formal
7403 parameters.
7404 (Arm_relocate_functions::xpc25): New method definition.
7405 (Arm_relocate_functions::arm_branch_common): Move method defintion
7406 out from class definition. Use stubs for mode-switching and extending
7407 branch ranges.
7408 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
7409 specially. Change code to enable use of stubs in ARM branches.
7410
43d12afe
DK
74112009-11-10 Doug Kwan <dougkwan@google.com>
7412
7413 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
7414 in method declaration.
7415 (Target_arm::relocate_stub): New method declaration.
7416 (Target_arm::default_target): Change to return a pointer instead of
7417 a const reference.
7418 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
7419 Target_arm::default_target.
7420 (Arm_Relobj::do_relocate_sections): Remove options paramater in
7421 method definition.
7422 (Target_arm::relocate_section): Adjust view.
7423 (Target_arm::relocate_stub): New method definition.
7424
ac33a407
DK
74252009-11-10 Doug Kwan <dougkwan@google.com>
7426
7427 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
7428 a format warning.
7429 * incremental.cc (open_incremental_binary): Initialized local
7430 variables to avoid warnings.
7431 * object.cc (make_elf_object): Ditto.
7432 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
7433 a format warning.
e1df38aa 7434
88ee28e9
L
7435009-11-09 H.J. Lu <hongjiu.lu@intel.com>
7436
7437 PR gold/10930
7438 * testsuite/plugin_test.c: Include "config.h".
7439
2daedcd6
DK
74402009-11-09 Doug Kwan <dougkwan@google.com>
7441
7442 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
7443 (arm_symbol_value): Remove.
7444 (Arm_relocate_functions::arm_branch_common,
7445 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
7446 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
7447 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
7448 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
7449 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
7450 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
7451 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
7452 Arm_relocate_functions::thm_mobw_abs_nc,
7453 Arm_relocate_functions::thm_mov_abs,
7454 Arm_relocate_functions::movw_prel_nc,
7455 Arm_relocate_functions::thm_movt_abs,
7456 Arm_relocate_functions::movt_prel,
7457 Arm_relocate_functions::thm_movw_prel_nc,
7458 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
7459 (Target_arm::Relocate::relocate): Only decompose address into two
7460 parts if relocation type uses the thumb-bit and pass the actual
7461 bit instead of a flag indicating that the thumb-bit is used. Adjust
7462 calls to methods in Arm_relocate_functions for this change.
7463
1276bc89 74642009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
7465
7466 PR 10925
7467 * reloc.cc: Instantiate
7468 Sized_relobj::initialize_input_to_output_maps and
7469 Sized_relobj:free_input_to_output_maps.
7470
e53ad1b5
ILT
74712009-11-06 Ian Lance Taylor <iant@google.com>
7472
7473 PR 10876
7474 * defstd.cc (in_segment): Set only_if_ref true for "end".
7475
eb44217c
DK
74762009-11-06 Doug Kwan <dougkwan@google.com>
7477
7478 * arm.cc (class Reloc_stub): Correct a comment.
7479 (Target_arm::Target_arm): Initialize arm_input_section_map_.
7480 (Target_arm::scan_section_for_stubs): New method declaration.
7481 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
7482 Change methods from private to protected.
7483 (Target_arm::do_may_relax): New method definition.
7484 (Target_arm::do_relax, Target_arm::group_sections,
7485 Target_arm::scan_reloc_for_stub,
7486 Target_arm::scan_reloc_section_for_stubs): New method declarations.
7487 (Target_arm::arm_input_section_map_): New data member declaration.
7488 (Target_arm::scan_reloc_for_stub,
7489 Target_arm::scan_reloc_section_for_stubs,
7490 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
7491 Target_arm::do_relax): New method definitions.
7492
5d329b7d
ILT
74932009-11-06 Mikolaj Zalewski <mikolaj@google.com>
7494
7495 * configure.ac: Check for (struct stat)::st_mtim
7496 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
7497 * config.in: Regenerate.
7498 * configure: Regenerate.
7499
96a0d71b
ILT
75002009-11-05 Ian Lance Taylor <iant@google.com>
7501
7502 PR 10910
7503 * output.cc (Output_segment::add_output_section): Add missing
7504 return statement.
7505
594c8e5e
ILT
75062009-11-04 Ian Lance Taylor <iant@google.com>
7507
7508 PR 10880
7509 * object.h (class Object): Add is_needed and set_is_needed
7510 methods. Add is_needed_ field. Make bool fields into bitfields.
7511 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
7512 defined in a dynamic object and referenced by a regular object,
7513 set is_needed for the dynamic object.
7514 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
7515 if the file is marked with as_needed and it is not needed.
7516
22b127cc
ILT
75172009-11-04 Ian Lance Taylor <iant@google.com>
7518
7519 PR 10887
7520 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
7521 tags if data is discarded by linker script.
7522 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7523 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
7524 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
7525 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7526
f5c870d2
ILT
75272009-11-04 Ian Lance Taylor <iant@google.com>
7528
7529 * layout.cc (Layout::get_output_section): Add is_interp and
7530 is_dynamic_linker_section parameters. Change all callers.
7531 (Layout::choose_output_section): Likewise.
7532 (Layout::make_output_section): Likewise.
7533 (Layout::add_output_section_data): Add is_dynamic_linker_section
7534 parameter. Change all callers.
7535 * layout.h (class Layout): Update declarations.
7536 * output.h (class Output_section): Add is_interp, set_is_interp,
7537 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
7538 Add is_interp_, is_dynamic_linker_section_ fields. Change
7539 generate_code_fills_at_write_ to a bitfield.
7540 * output.cc (Output_section::Output_sections): Initialize new
7541 fields.
7542 (Output_segment::add_output_section): Add do_sort parameter.
7543 Change all callers.
7544
1ae4d23b
ILT
75452009-11-03 Ian Lance Taylor <iant@google.com>
7546
7547 PR 10860
7548 * options.h (class General_options): Add --warn-common.
7549 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
7550 merging two common symbols.
7551 (Symbol_table::should_override): Handle --warn-common when merging
7552 a common symbol with a defined symbol. Use report_resolve_problem
7553 for multiple definitions.
7554 (Symbol_table::report_resolve_problem): New function.
7555 * symtab.h (class Symbol_table): Declare report_resolve_problem.
7556
55da9579
DK
75572009-11-03 Doug Kwan <dougkwan@google.com>
7558
7559 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
7560 stub_factory_.
7561 (Target_arm::stub_factory): New method definition.
7562 (Target_arm::new_arm_input_section,
7563 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
7564 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 7565 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
7566 New type definitions.
7567 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
7568 member declarations.
7569 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
7570 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
7571 New method definitions.
7572
37a9ac43
ILT
75732009-11-03 Ian Lance Taylor <iant@google.com>
7574
7575 * options.h (class General_options): Add --warn_constructors.
7576
b3d6a3d4
ILT
75772009-11-03 Ian Lance Taylor <iant@google.com>
7578
7579 PR 10893
7580 * defstd.cc (in_section): Add entries for __rel_iplt_start,
7581 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
7582
934b01dd
ILT
75832009-11-03 Ian Lance Taylor <iant@google.com>
7584
7585 PR 10895
7586 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
7587 --msgid-bugs-address.
7588 (install-pdf): New target.
7589 (install-data_yes): Look up one directory to find mkinstalldirs.
7590
03c1939b
L
75912009-11-03 H.J. Lu <hongjiu.lu@intel.com>
7592
7593 * po/Make-in (.po.gmo): Don't generate .gmo files in source
7594 tree.
7595
ebd95253
DK
75962009-10-30 Doug Kwan <dougkwan@google.com>
7597
7598 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
7599
e9bbb538
DK
76002009-10-30 Doug Kwan <dougkwan@google.com>
7601
7602 * arm.cc (Stub_addend_reader): New struct template definition
7603 and partial specializations.
7604 (Stub_addend_reader::operator()): New method definition for a
7605 partially specialized template.
7606
d5b40221
DK
76072009-10-30 Doug Kwan <dougkwan@google.com>
7608
7609 * arm.cc (Arm_relobj::processor_specific_flags): New method
7610 definition.
7611 (Arm_relobj::do_read_symbols): New method declaration.
7612 (Arm_relobj::processor_specific_flags_): New data member declaration.
7613 (Arm_dynobj): New class definition.
7614 (Target_arm::do_finalize_sections): Add input_objects parameter.
7615 (Target_arm::do_adjust_elf_header): New method declaration.
7616 (Target_arm::are_eabi_versions_compatible,
7617 (Target_arm::merge_processor_specific_flags): New method declaration.
7618 (Target_arm::do_make_elf_object): New overloaded method definitions
7619 and declaration.
7620 (Arm_relobj::do_read_symbols): New method definition.
7621 (Arm_dynobj::do_read_symbols): Ditto.
7622 (Target_arm::do_finalize_sections): Add input_objects parameters.
7623 Merge processor-specific flags from all input objects.
7624 (Target_arm::are_eabi_versions_compatible,
7625 Target_arm::merge_processor_specific_flags,
7626 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
7627 New method definitions.
7628 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
7629 Input_objects pointer type parameter.
7630 * layout.cc (Layout::finalize): Pass input objects to target's.
7631 finalize_sections function.
7632 * output.cc (Output_file_header::do_sized_write): Set ELF file
7633 header's processor-specific flags.
7634 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
7635 Input_objects pointer type parameter.
7636 * sparc.cc (Target_sparc::do_finalize_sections): Same.
7637 * target.h (Input_objects): New forward class declaration.
7638 (Target::processor_specific_flags,
7639 Target::are_processor_specific_flags_sect): New method definitions.
7640 (Target::finalize_sections): Add input_objects parameter.
7641 (Target::Target): Initialize processor_specific_flags_ and
7642 are_processor_specific_flags_set_.
7643 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
7644 parameter.
7645 (Target::set_processor_specific_flags): New method definition.
7646 (Target::processor_specific_flags_,
7647 Target::are_processor_specific_flags_set_): New data member
7648 declarations.
7649 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
7650 Input_objects pointer type parameter.
7651
ebabffbd
DK
76522009-10-30 Doug Kwan <dougkwan@google.com>
7653
7654 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
7655
ad0f2072
ILT
76562009-10-28 Ian Lance Taylor <iant@google.com>
7657
7658 * object.h (class Relobj): Drop options parameter from
7659 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
7660 do_scan_relocs, do_relocate. Change all callers.
7661 (class Sized_relobj): Drop options parameters from
7662 do_gc_process_relocs, do_scan_relocs, do_relocate,
7663 do_relocate_sections, relocate_sections, emit_relocs_scan,
7664 emit_relocs_scan_reltype. Change all callers.
7665 (struct Relocate_info): Remove options field and all references to
7666 it.
7667 * reloc.h (class Read_relocs): Remove options constructor
7668 parameter and options_ field. Change all callers.
7669 (class Gc_process_relocs, class Scan_relocs): Likewise.
7670 (class Relocate_task): Likewise.
7671 * target-reloc.h (scan_relocs): Remove options parameter. Change
7672 all callers.
7673 (scan_relocatable_relocs): Likewise.
7674 * target.h (class Sized_target): Remove options parameter from
7675 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
7676 all callers.
7677 * gc.h (gc_process_relocs): Remove options parameter. Change all
7678 callers.
7679 * arm.cc: Update functions to remove options parameters.
7680 * i386.cc: Likewise.
7681 * powerpc.cc: Likewise.
7682 * sparc.cc: Likewise.
7683 * x86_64.cc: Likewise.
7684 * testsuite/testfile.cc: Likewise.
7685
8ffa3667
DK
76862009-10-28 Doug Kwan <dougkwan@google.com>
7687
7688 * arm.cc (Arm_relobj): New class definition.
e1df38aa 7689 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
7690 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
7691 New method definitions.
7692
40f36857
CC
76932009-10-28 Cary Coutant <ccoutant@google.com>
7694
7695 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
7696 (Plugin::cleanup_done_): New member.
7697 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
7698 (Plugin_manager::cleanup_done_): Remove.
7699 (Plugin_manager::add_input_file): Edit error message.
7700 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
7701 (Plugin_manager::cleanup): Remove use of cleanup_done_.
7702
2c849493
ILT
77032009-10-27 Mikolaj Zalewski <mikolajz@google.com>
7704
7705 * fileread.cc: (File_read::View::~View): Use the new
7706 data_ownership_ filed.
7707 (File_read::~File_read): Dispose the new whole_file_view_.
7708 (File_read::open): Mmap the whole file if needed.
7709 (File_read::open): Use whole_file_view_ instead of contents_.
7710 (File_read::find_view): Use whole_file_view_ if applicable.
7711 (File_read::do_read): Use whole_file_view_ instead of contents_.
7712 (File_read::make_view): Use whole_file_view_ instead of contents_,
7713 update File_read::View::View call.
7714 (File_read::find_or_make_view): Update File_read::View::View
7715 call.
7716 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
7717 remove contents_
7718 (File_read::View::Data_ownership): New enum.
7719 (File_read::View::View): Replace bool mapped_ with Data_ownership
7720 argument.
7721 (File_read::View::mapped_): Remove (replaced by data_ownership_).
7722 (File_read::View::data_ownership_): New field.
7723 (File_read::contents_): Remove (replaced by whole_file_view_).
7724 (File_read::whole_file_view_): New field.
7725 * options.h (class General_options): Add --keep-files-mapped.
7726
24998053
CC
77272009-10-27 Cary Coutant <ccoutant@google.com>
7728
7729 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
7730 * testsuite/Makefile.am (plugin_test_5): New test case.
7731 * testsuite/Makefile.in: Regenerate.
7732
72adc4fa
DK
77332009-10-25 Doug Kwan <dougkwan@google.com>
7734
7735 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
7736 from private to protected to allow access by child class.
7737 (Sized_relobj::do_relocate_sections): New method declaration.
7738 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 7739 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
7740 Sized_relobj::relocate_sections. Instantiate template explicitly
7741 for different target sizes and endianity.
7742
07f508a2
DK
77432009-10-24 Doug Kwan <dougkwan@google.com>
7744
7745 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
7746 (Arm_input_section::as_arm_input_section): New method.
7747 (Arm_output_section): New class definition.
7748 (Arm_output_section::create_stub_group,
7749 Arm_output_section::group_sections): New method definitions.
7750
10ad9fe5
DK
77512009-10-22 Doug Kwan <dougkwan@google.com>
7752
7753 * arm.cc (Arm_input_section): New class definition.
7754 (Arm_input_section::init, Arm_input_section:do_write,
7755 Arm_input_section::set_final_data_size,
7756 Arm_input_section::do_reset_address_and_file_offset): New method
7757 definitions.
7758
56ee5e00
DK
77592009-10-21 Doug Kwan <dougkwan@google.com>
7760
7761 * arm.cc (Stub_table, Arm_input_section): New forward class
7762 declarations.
7763 (Stub_table): New class defintion.
7764 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
7765 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
7766 New method definition.
7767
b569affa
DK
77682009-10-21 Doug Kwan <dougkwan@google.com>
7769
7770 * arm.cc: Update copyright comments.
7771 (Target_arm): New forward class template declaration.
7772 (Arm_address): New type.
7773 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
7774 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
7775 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
7776 constants.
7777 (Insn_template): Same.
7778 (DEF_STUBS): New macro.
7779 (Stub_type): New enum type.
7780 (Stub_template): New class definition.
7781 (Stub): Same.
7782 (Reloc_stub): Same.
7783 (Stub_factory): Same.
7784 (Target_arm::Target_arm): Initialize may_use_blx_ and
7785 should_force_pic_veneer_.
7786 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
7787 Target_arm::should_force_pic_veneer,
7788 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
7789 Target_arm::using_thumb_only, Target_arm:;default_target): New
7790 method defintions.
7791 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
7792 New data member declarations.
7793 (Insn_template::size, Insn_template::alignment): New method defintions.
7794 (Stub_template::Stub_template): New method definition.
7795 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
7796 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
7797 (Stub_factory::Stub_factory): New method definition.
7798 * gold.h (string_hash): New template.
7799 * output.h (Input_section_specifier::hash_value): Use
7800 gold::string_hash.
7801 (Input_section_specifier::string_hash): Remove.
7802 * stringpool.cc (Stringpool_template::string_hash): Use
7803 gold::string_hash.
7804
6c172549
DK
78052009-10-20 Doug Kwan <dougkwan@google.com>
7806
7807 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
7808 symbols of relaxed input sections.
7809 * output.h (Output_section::find_relaxed_input_section): Make
7810 method public.
7811
c5617f2f
DK
78122009-10-16 Doug Kwan <dougkwan@google.com>
7813
7814 * dynobj.cc (Versions::Versions): Initialize version_script_.
7815 Only insert base version symbol definition for a shared object
7816 if version script defines any version versions.
7817 (Versions::define_base_version): New method definition.
7818 (Versions::add_def): Check that base version is not needed.
7819 (Versions::add_need): Define base version lazily.
7820 * dynobj.h (Versions::define_base_version): New method declaration.
7821 (Versions::needs_base_version_): New data member declaration.
7822 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
7823 (check_DATA): Add no_version_test.stdout.
7824 (libno_version_test.so, no_version_test.o no_version_test.stdout):
7825 New make rules.
7826 * testsuite/Makefile.in: Regenerate.
7827 * testsuite/no_version_test.c: New file.
7828 * testsuite/no_version_test.sh: Ditto.
7829
3c12dcdb
DK
78302009-10-16 Doug Kwan <dougkwan@google.com>
7831
7832 * expression.cc (class Segment_start_expression): New class definition.
7833 (Segment_start_expression::value): New method definition.
7834 (script_exp_function_segment_start): Return a new
7835 Segment_start_expression.
7836 * gold/script-c.h (script_saw_segment_start_expression): New function
7837 prototype.
7838 * script-sections.cc (Script_sections::Script_sections): Initialize
7839 SAW_SEGMENT_START_EXPRESSION_ to false.
7840 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
7841 and -Tbbs options to specify section addresses if given in
7842 command line and no SEGMENT_START expression is seen in a script.
7843 * script-sections.h (Script_sections::saw_segment_start_expression,
7844 Script_sections::set_saw_segment_start_expression): New method
7845 definition.
7846 (Script_sections::saw_segment_start_expression_): New data member
7847 declaration.
7848 * script.cc (script_saw_segment_start_expression): New function.
7849 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
7850 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
7851 script_test_7.sh and script_test_8.sh.
7852 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
7853 script_test_8.stdout.
7854 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
7855 (script_test_6, script_test_6.stdout, script_test_7,
7856 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
7857 * Makefile.in: Regenerate.
7858 * testsuite/script_test_6.sh: New file.
7859 * testsuite/script_test_6.t: Same.
7860 * testsuite/script_test_7.sh: Same.
7861 * testsuite/script_test_7.t: Same.
7862 * testsuite/script_test_8.sh: Same.
7863
64b1ae37
DK
78642009-10-16 Doug Kwan <dougkwan@google.com>
7865
7866 * output.cc (Output_segment::set_section_list_address): Cast
7867 expressions to unsigned long long type to avoid format warnings.
7868
661be1e2
ILT
78692009-10-15 Ian Lance Taylor <iant@google.com>
7870
12edd763 7871 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 7872 dot assignment to script_sections_.
12edd763
ILT
7873 * script-sections.cc (Script_sections::add_dot_assignment):
7874 Initialize if necessary.
7875
68b6574b
ILT
7876 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
7877 program headers with no load segment if there is a linker script.
7878
661be1e2
ILT
7879 * layout.cc (Layout::set_segment_offsets): Align the file offset
7880 to the segment aligment for -N or -n with no load segment.
7881 * output.cc (Output_segment::add_output_section): Don't crash if
7882 the first section is a TLS section.
7883 (Output_segment::set_section_list_addresses): Print an error
7884 message if the address moves backward in a linker script.
7885 * script-sections.cc
7886 (Output_section_element_input::set_section_addresses): Don't
7887 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
7888 (Orphan_output_section::set_section_addresses): Likewise.
7889
f15f61a7
DK
78902009-10-15 Doug Kwan <dougkwan@google.com>
7891
7892 * layout.cc (Layout::finish_dynamic_section): Generate tags
7893 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
7894 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
7895 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
7896
82bb573a
ILT
78972009-10-14 Ian Lance Taylor <iant@google.com>
7898
7899 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
7900 fields.
7901 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
7902 data_shdr fields of relinfo.
7903 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
7904 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
7905 R_386_TLS_LDO_32, adjust based on section flags.
7906 (Target_i386::Relocate::fix_up_ldo): Remove.
7907
374ad285
ILT
79082009-10-13 Ian Lance Taylor <iant@google.com>
7909
7910 Add support for -pie.
7911 * options.h (class General_options): Add -pie and
7912 --pic-executable.
7913 (General_options::output_is_position_independent): Test -pie.
7914 (General_options::output_is_executable): Return true if not shared
7915 and not relocatable.
7916 (General_options::output_is_pie): Remove.
7917 * options.cc (General_options::finalize): Reject incompatible uses
7918 of -pie.
7919 * gold.cc (queue_middle_tasks): A -pie link is not static.
7920 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
7921 * symtab.cc (Symbol::final_value_is_known): Return false if
7922 output_is_position_independent.
7923 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
7924 output_is_position_independent.
7925 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
7926 output_is_position_independent.
7927 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
7928 output_is_position_independent.
7929 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
7930 two_file_pie_test.
7931 (basic_pie_test.o, basic_pie_test): New targets.
7932 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
7933 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
7934 (two_file_pie_test): New target.
7935 * testsuite/Makefile.in: Rebuild.
7936 * README: Remove note saying that -pie is not supported.
7937
c6585162
ILT
79382009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
7939
7940 * options.h (class General_options): Add -init and -fini.
7941 * layout.cc (Layout::finish_dynamic_section): Emit
7942 given init and fini functions.
7943
032ce4e9
ST
79442009-10-13 Sriraman Tallam <tmsriram@google.com>
7945
7946 * gc.h (gc_process_relocs): Check if icf is enabled using new
7947 function.
7948 * gold.cc (queue_initial_tasks): Likewise.
7949 (queue_middle_tasks): Likewise.
7950 * object.cc (do_layout): Likewise.
7951 * symtab.cc (is_section_folded): Likewise.
7952 * main.cc (main): Likewise.
7953 * reloc.cc (Read_relocs::run): Likewise.
7954 (Sized_relobj::do_scan_relocs): Likewise.
7955 * icf.cc (is_function_ctor_or_dtor): New function.
7956 (Icf::find_identical_sections): Check if function is ctor or dtor when
7957 safe icf is chosen.
7958 * options.h (General_options::icf): Change option to be an enum.
7959 (Icf_status): New enum.
7960 (icf_enabled): New method.
7961 (icf_safe_folding): New method.
7962 (set_icf_status): New method.
7963 (icf_status_): New variable.
7964 * (options.cc) (General_options::finalize): Set icf_status_.
7965 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
7966 icf_test and icf_keep_unique_test to use the --icf enum flag.
7967 * testsuite/icf_safe_test.sh: New file.
e1df38aa 7968 * testsuite/icf_safe_test.cc: New file.
032ce4e9 7969
f345227a
ST
79702009-10-12 Sriraman Tallam <tmsriram@google.com>
7971
7972 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
7973 includes to gc.h and icf.h.
7974 * arm.cc: Include gc.h.
7975 * gold.cc: Likewise.
7976 * i386.cc: Likewise.
7977 * powerpc.cc: Likewise.
7978 * sparc.cc: Likewise.
7979 * x86_64.cc: Likewise.
7980 * gc.h: Include icf.h.
7981
1c7814ed
ILT
79822009-10-11 Ian Lance Taylor <iant@google.com>
7983
7984 * plugin.cc: Include "gold.h" before other header files.
7985
ae3b5189
CD
79862009-10-10 Chris Demetriou <cgd@google.com>
7987
7988 * options.h (Input_file_argument::Input_file_type): New enum.
7989 (Input_file_argument::is_lib_): Replace with...
7990 (Input_file_argument::type_): New member.
7991 (Input_file_argument::Input_file_argument): Take Input_file_type
7992 'type' rather than boolean 'is_lib' as second argument.
7993 (Input_file_argument::is_lib): Use type_.
7994 (Input_file_argument::is_searched_file): New function.
7995 (Input_file_argument::may_need_search): Handle is_searched_file.
7996 * options.cc (General_options::parse_library): Support -l:filename.
7997 (General_options::parse_just_symbols): Update for Input_file_argument
7998 changes.
7999 (Command_line::process): Likewise.
8000 * archive.cc (Archive::get_file_and_offset): Likewise.
8001 * plugin.cc (Plugin_manager::release_input_file): Likewise.
8002 * script.cc (read_script_file, script_add_file): Likewise.
8003 * fileread.cc (Input_file::Input_file): Likewise.
8004 (Input_file::will_search_for): Handle is_searched_file.
8005 (Input_file::open): Likewise.
8006 * readsyms.cc (Read_symbols::get_name): Likewise.
8007 * testsuite/Makefile.am (searched_file_test): New test.
8008 * testsuite/Makefile.in: Regenerate.
8009 * testsuite/searched_file_test.cc: New file.
8010 * testsuite/searched_file_test_lib.cc: New file.
8011
f3048a1d
ILT
80122009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8013 Ian Lance Taylor <iant@google.com>
8014
8015 * descriptor.cc: Include <cstdio> and "binary-io.h".
8016 (Descriptors::open): Open the files in binary mode always.
8017 * script.cc (Lex::get_token): Treat \r as whitespace.
8018
d4780e57
ILT
80192009-10-09 Ian Lance Taylor <iant@google.com>
8020
8021 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
8022
d9a893b8
ILT
80232009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8024 Ian Lance Taylor <iant@google.com>
8025
8026 * configure.ac: Check for readv function also.
8027 * fileread.cc (readv): Define if not HAVE_READV.
8028 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
8029 does not exist.
8030 * config.in: Regenerate.
8031 * configure: Regenerate.
8032
c0a62865
DK
80332009-10-09 Doug Kwan <dougkwan@google.com>
8034
8035 * layout.cc (Layout::make_output_section): Call target hook to make
8036 ordinary output section.
8037 (Layout::finalize): Adjust parameter list of call the
8038 Target::may_relax().
8039 * layout.h (class Layout::section_list): New method.
8040 * merge.h (Output_merge_base::entsize): Change visibility to public.
8041 (Output_merge_base::is_string, Output_merge_base::do_is_string):
8042 New methods.
8043 (Output_merge_string::do_is_string): New method.
8044 * object.cc (Sized_relobj::do_setup): renamed from
8045 Sized_relobj::set_up.
8046 * object.h (Sized_relobj::adjust_shndx,
8047 Sized_relobj::initializ_input_to_output_maps,
8048 Sized_relobj::free_input_to_output_maps): Change visibilities to
8049 protected.
8050 (Sized_relobj::setup): Virtualize.
8051 (Sized_relobj::do_setup): New method declaration.
8052 (Sized_relobj::invalidate_section_offset,
8053 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
8054 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
8055 * options.cc (parse_int): New function.
8056 * options.h (parse_int): New declaration.
8057 (DEFINE_int): New macro.
8058 (stub_group_size): New option.
8059 * output.cc (Output_section::Output_section): Initialize memebers
8060 merge_section_map_, merge_section_by_properties_map_,
8061 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
8062 (Output_section::add_input_section): Handled deferred code-fill
8063 generation and remove an old comment.
8064 (Output_section::add_relaxed_input_section): New method definition.
8065 (Output_section::add_merge_input_section): Use merge section by
8066 properties map to speed to search. Update merge section maps
8067 as appropriate.
8068 (Output_section::build_relaxation_map): New method definition.
8069 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8070 Same.
8071 (Output_section::relax_input_section): Renamed to
8072 Output_section::convert_input_sections_to_relaxed_sections and change
8073 interface to take a vector of pointers to relaxed sections.
8074 (Output_section::find_merge_section,
8075 Output_section::find_relaxed_input_section): New method definitions.
8076 (Output_section::is_input_address_mapped,
8077 Output_section::output_offset, Output_section::output_address):
8078 Use output section data maps to speed up searching.
8079 (Output_section::find_starting_output_address): Add comments.
8080 (Output_section::do_write,
8081 Output_section::write_to_postprocessing_buffer): Do code-fill
8082 generation as appropriate.
8083 (Output_section::get_input_sections): Invalidate relaxed input section
8084 map.
8085 (Output_section::restore_states): Adjust type of checkpoint .
8086 Invalidate relaxed input section map.
8087 * output.h (Output_merge_base): New class declaration.
8088 (Input_section_specifier): New class defintion.
8089 (class Output_relaxed_input_section) Change base class to
8090 Output_section_data_build.
8091 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
8092 base class initializer.
8093 (Output_section::add_relaxed_input_section): New method declaration.
8094 (Output_section::Input_section): Change visibility to protected.
8095 (Output_section::Input_section::relobj,
8096 Output_section::Input_section::shndx): Handle relaxed input sections.
8097 Output_section::input_sections) Change visibility to protected. Also
8098 define overload to return a non-const pointer.
8099 (Output_section::Merge_section_properties): New class defintion.
8100 (Output_section::Merge_section_by_properties_map,
8101 Output_section::Output_section_data_by_input_section_map,
8102 Output_section::Relaxation_map): New types.
8103 (Output_section::relax_input_section): Rename method to
8104 Output_section::convert_input_sections_to_relaxed_sections and change
8105 interface to take a vector of relaxed section pointers.
8106 (Output_section::find_merge_section,
8107 Output_section::find_relaxed_input_section,
8108 Output_section::build_relaxation_map,
8109 Output_section::convert_input_sections_in_list_to_relaxed_sections):
8110 New method declarations.
8111 (Output_section::merge_section_map_
8112 Output_section::merge_section_by_properties_map_,
8113 Output_section::relaxed_input_section_map_,
8114 Output_section::is_relaxed_input_section_map_valid_,
8115 Output_section::generate_code_fills_at_write_): New data members.
8116 * script-sections.cc
8117 (Output_section_element_input::set_section_addresses): Call
8118 current_data_size and addralign methods of relaxed input sections.
8119 (Orphan_output_section::set_section_addresses): Call current_data_size
8120 and addralign methods of relaxed input sections.
8121 * symtab.cc (Symbol_table::compute_final_value): Extract template
8122 from the body of Symbol_table::sized_finalize_symbol.
8123 (Symbol_table::sized_finalized_symbol): Call
8124 Symbol_table::compute_final_value.
8125 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
8126 (Symbol_table::compute_final_value): New templated method declaration.
8127 * target.cc (Target::do_make_output_section): New method defintion.
8128 * target.h (Target::make_output_section): New method declaration.
8129 (Target::relax): Add more parameters for input objects, symbol table
8130 and layout. Adjust call to do_relax.
8131 (Target::do_make_output_section): New method declaration.
8132 (Target::do_relax): Add parameters for input objects, symbol table
8133 and layout.
8134
d446d6c4
ILT
81352009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8136
8137 * pread.c: Include stdio.h.
8138
bc06c745
ILT
81392009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8140
8141 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
8142 defined.
8143
75aea3d0
ILT
81442009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8145
8146 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8147 Change read_shndx type to unsigned int.
8148 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
8149 int.
8150 (Sized_dwarf_line_info::read_line_mappings): Likewise.
8151 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
8152 Change read_shndx type to unsigned int.
8153 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
8154 int.
8155 (Sized_dwarf_line_info::read_line_mappings): Likewise.
8156 * layout.cc (Layout::create_symtab_sections): Cast the result of
8157 local_symcount * symsize to off_t in the gold_assert.
8158
be8fcb75
ILT
81592009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8160
8161 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
8162 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
8163 R_ARM_BASE_ABS.
8164 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
8165 (Arm_relocate_functions::thm_abs5): New function.
8166 (Arm_relocate_functions::abs12): New function.
8167 (Arm_relocate_functions::abs16): New function.
8168 (Arm_relocate_functions::base_abs): New function.
8169 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
8170 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
8171 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
8172 R_ARM_BASE_ABS.
8173 (Scan::global): Likewise.
8174 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
8175 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
8176 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
8177 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
8178 R_ARM_BASE_ABS.
8179
c2a122b6
ILT
81802009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8181
8182 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
8183 (Arm_relocate_functions::movt_prel): New function.
8184 (Arm_relocate_functions::thm_movw_prel_nc): New function.
8185 (Arm_relocate_functions::thm_movt_prel): New function.
8186 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
8187 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
8188 (Scan::global, Relocate::relocate): Likewise.
8189 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8190
c4aa1e2d
ILT
81912009-10-09 Mikolaj Zalewski <mikolajz@google.com>
8192
8193 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
8194 Incremental_checker.
8195 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
8196 unsigned int.
8197 (class Incremental_inputs_header): New class.
8198 (Incremental_inputs_header_writer): Edit comment.
8199 (Incremental_inputs_entry): New class.
8200 (Incremental_inputs_entry_writer): Edit comment.
8201 (Sized_incremental_binary::do_find_incremental_inputs_section):
8202 Add *strtab_shndx parameter, fill it.
8203 (Sized_incremental_binary::do_check_inputs): New method.
8204 (Incremental_checker::can_incrementally_link_output_file): Use
8205 Sized_incremental_binary::check_inputs.
8206 (Incremental_inputs::report_command_line): Save command line in
8207 command_line_.
8208 * incremental.h:
8209 (Incremental_binary::find_incremental_inputs_section): New
8210 method.
8211 (Incremental_binary::do_find_incremental_inputs_section): Add
8212 strtab_shndx parameter.
8213 (Incremental_binary::do_check_inputs): New pure virtual method.
8214 (Sized_incremental_binary::do_check_inputs): Declare.
8215 (Incremental_checker::Incremental_checker): Add incremental_inputs
8216 parameter, use it to initialize incremental_inputs_.
8217 (Incremental_checker::incremental_inputs_): New field.
8218 (Incremental_checker::command_line): New method.
8219 (Incremental_checker::inputs): New method.
8220 (Incremental_checker::command_line_): New field.
8221
c549a694
ILT
82222009-10-09 Mikolaj Zalewski <mikolajz@google.com>
8223
8224 * incremental.cc: Include <cstdarg> and "target-select.h".
8225 (vexplain_no_incremental): New function.
8226 (explain_no_incremental): New function.
8227 (Incremental_binary::error): New method.
8228 (Sized_incremental_binary::do_find_incremental_inputs_section): New
8229 method.
8230 (make_sized_incremental_binary): New function.
8231 (open_incremental_binary): New function.
8232 (can_incrementally_link_file): Add checks if output is ELF and has
8233 inputs section.
8234 * incremental.h: Include "elfcpp_file.h" and "output.h".
8235 (Incremental_binary): New class.
8236 (Sized_incremental_binary): New class.
8237 (open_incremental_binary): Declare.
8238 * object.cc (is_elf_object): Use
8239 elfcpp::Elf_recognizer::is_elf_file.
8240 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
8241 * output.h (Output_file::filesize): New method.
8242
fd3c5f0b
ILT
82432009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8244
8245 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
8246 New function.
8247 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
8248 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
8249 function.
8250 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
8251 function.
8252 (Arm_relocate_functions::movw_abs_nc): New function.
8253 (Arm_relocate_functions::movt_abs): New function.
8254 (Arm_relocate_functions::thm_movw_abs_nc): New function.
8255 (Arm_relocate_functions::thm_movt_abs): New function.
8256 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
8257 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
8258 (Scan::global): Likewise.
8259 (Relocate::relocate): Likewise.
8260 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8261
7f5309a5
ILT
82622009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8263
8264 * arm.cc (Arm_relocate_functions::got_prel) New function.
8265 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
8266 (Relocate::relocate): Likewise.
8267 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8268
364c7fa5
ILT
82692009-10-06 Ian Lance Taylor <iant@google.com>
8270
8271 * options.h (class General_options): Define
8272 split_stack_adjust_size parameter.
8273 * object.h (class Object): Add uses_split_stack_ and
8274 has_no_split_stack_ fields. Add uses_split_stack and
8275 has_no_split_stack accessor functions. Declare
8276 handle_split_stack_section.
8277 (class Reloc_symbol_changes): Define.
8278 (class Sized_relobj): Define Function_offsets. Declare
8279 split_stack_adjust, split_stack_adjust_reltype, and
8280 find_functions.
8281 * object.cc (Object::handle_split_stack_section): New function.
8282 (Sized_relobj::do_layout): Call handle_split_stack_section.
8283 * dynobj.cc (Sized_dynobj::do_layout): Call
8284 handle_split_stack_section.
8285 * reloc.cc (Sized_relobj::relocate_sections): Call
8286 split_stack_adjust for executable sections in split_stack
8287 objects. Pass reloc_map to relocate_section.
8288 (Sized_relobj::split_stack_adjust): New function.
8289 (Sized_relobj::split_stack_adjust_reltype): New function.
8290 (Sized_relobj::find_functions): New function.
8291 * target-reloc.h: Include "object.h".
8292 (relocate_section): Add reloc_symbol_changes parameter. Change
8293 all callers.
8294 * target.h (class Target): Add calls_non_split method. Declare
8295 do_calls_non_split virtual method. Declare match_view and
8296 set_view_to_nop.
8297 * target.cc: Include "elfcpp.h".
8298 (Target::do_calls_non_split): New function.
8299 (Target::match_view): New function.
8300 (Target::set_view_to_nop): New function.
8301 * gold.cc (queue_middle_tasks): Give an error if mixing
8302 split-stack and non-split-stack objects with -r.
8303 * i386.cc (Target_i386::relocate_section): Add
8304 reloc_symbol_changes parameter.
8305 (Target_i386::do_calls_non_split): New function.
8306 * x86_64.cc (Target_x86_64::relocate_section): Add
8307 reloc_symbol_changes parameter.
8308 (Target_x86_64::do_calls_non_split): New function.
8309 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
8310 parameter.
8311 * powerpc.cc (Target_powerpc::relocate_section): Add
8312 reloc_symbol_changes parameter.
8313 * sparc.cc (Target_sparc::relocate_section): Add
8314 reloc_symbol_changes parameter.
8315 * configure.ac: Call AM_CONDITIONAL for the default target.
8316 * configure: Rebuild.
8317 * testsuite/Makefile.am (TEST_AS): New variable.
8318 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
8319 (check_DATA): Add split_i386 and split_x86_64 files.
8320 (SPLIT_DEFSYMS): Define.
8321 (split_i386_[1234n].o): New targets.
8322 (split_i386_[124]): New targets.
8323 (split_i386_[1234r].stdout): New targets.
8324 (split_x86_64_[1234n].o): New targets.
8325 (split_x86_64_[124]): New targets.
8326 (split_x86_64_[1234r].stdout): New targets.
8327 (MOSTLYCLEANFILES): Add new executables.
8328 * testsuite/split_i386.sh: New file.
8329 * testsuite/split_x86_64.sh: New file.
8330 * testsuite/split_i386_1.s: New file.
8331 * testsuite/split_i386_2.s: New file.
8332 * testsuite/split_i386_3.s: New file.
8333 * testsuite/split_i386_4.s: New file.
8334 * testsuite/split_i386_n.s: New file.
8335 * testsuite/split_x86_64_1.s: New file.
8336 * testsuite/split_x86_64_2.s: New file.
8337 * testsuite/split_x86_64_3.s: New file.
8338 * testsuite/split_x86_64_4.s: New file.
8339 * testsuite/split_x86_64_n.s: New file.
8340 * testsuite/testfile.cc (Target_test): Update relocation_section
8341 function.
8342 * testsuite/Makefile.in: Rebuild.
8343
e8a9fcda
ILT
83442009-10-06 Ian Lance Taylor <iant@google.com>
8345
8346 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
8347 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
8348 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
8349 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
8350 the address on ldo_addrs_.
8351 (Target_i386::Relocate::fix_up_ldo): New function.
8352
e99daf92
ILT
83532009-10-06 Rafael Espindola <espindola@google.com>
8354
8355 * plugin.cc (add_input_library): New.
8356 (Plugin::load): Add add_input_library to tv.
8357 (Plugin_manager::add_input_file): Add the is_lib argument.
8358 (add_input_file): Update call to Plugin_manager::add_input_file.
8359 (add_input_library): New.
8360 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
8361
966d4097
DK
83622009-09-30 Doug Kwan <dougkwan@google.com>
8363
8364 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
8365 symbol and call Symbol::may_need_copy_reloc to determine if
8366 a copy reloc is needed.
8367 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
8368 nocopyreloc is given in command line.
8369 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
8370 given in command line.
8371 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
8372 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
8373 of the removed Target_i386::may_need_copy_reloc.
8374 * options.h (copyreloc): New option with default value false.
8375 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
8376 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
8377 instead of the removed Target_powerpc::may_need_copy_reloc.
8378 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
8379 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
8380 instead of the removed Target_sparc::may_need_copy_reloc.
8381 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
8382 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
8383 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
8384 instead of the removed Target_x86_64::may_need_copy_reloc.
8385
029ba973
ILT
83862009-09-30 Ian Lance Taylor <iant@google.com>
8387
8388 * object.h (class Object): Remove target_ field, and target,
8389 sized_target, and set_target methods.
8390 (Object::sized_target): Remove.
8391 (class Sized_relobj): Update declarations. Remove sized_target.
8392 * object.cc (Sized_relobj::setup): Remove target parameter.
8393 Change all callers.
8394 (Input_objects::add_object): Don't do anything with the target.
8395 (make_elf_sized_object): Add punconfigured parameter. Change all
8396 callers. Set or test parameter target.
8397 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
8398 Change all callers.
8399 * parameters.cc (Parameters::set_target): Change parameter type to
8400 be non-const.
8401 (Parameters::default_target): Remove.
8402 (set_parameters_target): Change parameter type to be non-const.
8403 (parameters_force_valid_target): New function.
8404 (parameters_clear_target): New function.
8405 * parameters.h (class Parameters): Update declarations. Remove
8406 default_target method. Add sized_target and clear_target
8407 methods. Change target_ to be non-const.
8408 (set_parameters_target): Update declaration.
8409 (parameters_force_valid_target): Declare.
8410 (parameters_clear_target): Declare.
8411 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
8412 as NULL if we aren't searching.
8413 (Add_symbols::run): Don't check for compatible target.
8414 * fileread.cc (Input_file::open_binary): Call
8415 parameters_force_valid_target.
8416 * gold.cc (queue_middle_tasks): Likewise.
8417 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
8418 set_target on object.
8419 * dynobj.h (class Sized_dynobj): Update declarations.
8420 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
8421 make_elf_object returns NULL.
8422 (Archive::include_member): Don't check whether object target is
8423 compatible.
8424 * output.cc (Output_section::add_input_section): Get target from
8425 parameters.
8426 (Output_section::relax_input_section): Likewise.
8427 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
8428 parameters.
8429 (Sized_relobj::do_scan_relocs): Likewise.
8430 (Sized_relobj::relocate_sections): Likewise.
8431 * resolve.cc (Symbol_table::resolve): Likewise.
8432 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
8433 parameter. Change all callers.
8434 (Symbol_table::add_from_object): Get target from parameters.
8435 (Symbol_table::add_from_relobj): Don't check object target.
8436 (Symbol_table::add_from_dynobj): Likewise.
8437 (Symbol_table::define_special_symbol): Get target from
8438 parameters.
8439 * symtab.h (class Symbol_table): Update declaration.
8440 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
8441 parameter. Change all callers. Clear parameter target.
8442 (Binary_test): Test target here.
8443 * testsuite/object_unittest.cc (gold_testsuite): Remove
8444 target_test_pointer parameter. Change all callers.
8445 (Object_test): Test target here.
8446
a6a22b83
ILT
84472009-09-26 Ian Lance Taylor <iant@google.com>
8448
8449 * testsuite/initpri1.c: Don't try to use constructor priorities if
8450 compiling with gcc before 4.3.
8451
6a8f49fe
ILT
84522009-09-22 Mikolaj Zalewski <mikolajz@google.com>
8453
8454 * testsuite/retain_symbols_file_test.sh (check_present): Change
8455 output file name to retain_symbols_file_test.stdout.
8456 (check_absent): Likewise.
8457
8c604651
CS
84582009-09-18 Craig Silverstein <csilvers@google.com>
8459
8460 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
8461 * options.cc: Include <cerrno> and <fstream>.
8462 (General_options::finalize): Parse -retain-symbols-file tag.
8463 * options.h: New flag.
8464 (General_options): New method should_retain_symbol, new
8465 variable symbols_to_retain.
8466 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
8467 should_retain_symbol map.
8468 * testsuite/Makefile.am (retain_symbols_file_test): New test.
8469 * testsuite/Makefile.in: Regenerate.
8470 * testsuite/retain_symbols_file_test.sh: New file.
8471
ca58b19f
NC
84722009-09-18 Nick Clifton <nickc@redhat.com>
8473
8474 * po/es.po: Updated Spanish translation.
8475
20e6d0d6
DK
84762009-09-17 Doug Kwan <dougkwan@google.com>
8477
8478 * debug.h (DEBUG_RELAXATION): New constant.
8479 (DEBUG_ALL): Add DEBUG_RELAXATION.
8480 (debug_string_to_enum): Add relaxation debug option.
8481 * layout.cc
8482 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
8483 Layout::Relaxation_debug_check::read_sections,
8484 Layout::Relaxation_debug_check::read_sections): New method definitions.
8485 (Layout::Layout): Initialize data members
8486 record_output_section_data_from_scrips_,
8487 script_output_section_data_list_ and relaxation_debug_check_.
8488 (Layout::save_segments, Layout::restore_segments,
8489 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
8490 Layout::relaxation_loop_body): New method definitions.
8491 (Layout::finalize): Support relaxation. Move section layout code to
8492 Layout::relaxation_loop_body.
8493 (Layout::set_asection_address_from_script): Move code for orphan
8494 section placement out.
8495 (Layout::place_orphan_sections_in_script): New method definition.
8496 * layout.h (Output_segment_headers, Output_file_header):
8497 New forward class declarations.
8498 (Layout::~Layout): Define.
8499 (Layout::new_output_section_data_from_script): New method definition.
8500 (Layout::place_orphan_sections_in_script): New method declaration.
8501 (Layout::Segment_states): New type declaration.
8502 (Layout::save_segments, Layout::restore_segments,
8503 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
8504 Layout::relaxation_loop_body): New method declarations.
8505 (Layout::Output_section_data_list): New type declaration.
8506 (Layout::Relaxation_debug_check): New class definition.
8507 (Layout::record_output_section_data_from_script_,
8508 Layout::script_output_section_data_list_, Layout::segment_states_,
8509 Layout::relaxation_debug_check_): New data members.
8510 * output.cc: (Output_section_headers::do_size): New method definition.
8511 (Output_section_headers::Output_section_headers): Move size
8512 computation to Output_section_headers::do_size.
8513 (Output_segment_headers::do_size): New method definition.
e1df38aa 8514 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
8515 Output_file_header::do_size and call it.
8516 (Output_file_header::do_size): New method definition.
8517 (Output_data_group::Output_data_group): Adjust call to
8518 Output_section_data.
8519 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
8520 (Output_symtab_xindex::do_write): Add array bound check.
8521 (Output_section::Input_section::print_to_mapfile): Handle
8522 RELAXED_INPUT_SECTION_CODE.
8523 (Output_section::Output_section): Initialize data member checkpoint_.
8524 (Output_section::~Output_section): Delete checkpoint object pointed
8525 by checkpoint_.
8526 (Output_section::add_input_section): Always add an Input_section if
8527 relaxing.
8528 (Output_section::add_merge_input_section): Add assert.
8529 (Output_section::relax_input_section): New method definition.
8530 (Output_section::set_final_data_size): Set load address to zero for
8531 an unallocated section.
8532 (Output_section::do_address_and_file_offset_have_reset_values):
8533 New method definition.
8534 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
8535 Handle relaxed input section.
8536 (Output_section::sort_attached_input_sections): Checkpoint input
8537 section list lazily.
8538 (Output_section::get_input_sections): Change type of input_sections to
8539 list of Simple_input_section pointers. Checkpoint input section list
8540 lazily. Also handle relaxed input sections.
8541 (Output_section::add_input_section_for_script): Take a reference to
8542 a Simple_input_section object instead of Relobj pointer and section
8543 index as parameter. Handle relaxed input sections.
8544 (Output_section::save_states, Output_section::restore_states): New
8545 method definitions.
8546 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
8547 (Output_data::is_data_size_fixed): New method definition.
8548 (Output_data::reset_addresss_and_file_offset): Do not reset data size
8549 if it is fixed.
8550 (Output_data::address_and_file_offset_have_reset_values): New method
8551 definition.
8552 (Output_data::do_address_and_file_offset_have_reset_values): New method
8553 definition.
8554 (Output_data::set_data_size): Check that data size is not fixed.
8555 (Output_data::fix_data_size): New method definition.
8556 (Output_data::is_data_size_fixed_): New data member.
8557 (Output_section_headers::set_final_data_size): New method definition.
8558 (Output_section_headers::do_size): New method declaration.
8559 (Output_segment_headers::set_final_data_size): New method definition.
8560 (Output_segment_headers::do_size): New method declaration.
8561 (Output_file_header::set_final_data_size)::New method definition.
8562 (Output_file_header::do_size)::New method declaration.
8563 (Output_section_data::Output_section_data): Add new parameter
8564 is_data_size_fixed and use it to fix data size.
8565 (Output_data_const::Output_data_const): Adjust call to base class
8566 constructor and fix data size.
8567 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
8568 base class constructor and fix data size.
8569 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
8570 base class constructor and fix data size.
8571 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
8572 class constructor and fix data size.
8573 (Output_data_group::set_final_data_size): New method definition.
8574 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
8575 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
8576 class constructor and fix data size.
8577 (Output_relaxed_input_section): New class definition.
8578 (Output_section::Simple_input_section): New class definition.
8579 (Output_section::get_input_sections): Adjust parameter list.
8580 (Output_section::add_input_section_for_script): Same.
8581 (Output_section::save_states, Output_section::restore_states,
8582 Output_section::do_address_and_file_offset_have_reset_values,
8583 (Output_section::Input_section::Input_section): Handle
8584 RELAXED_INPUT_SECTION_CODE. Add new overload for
8585 Output_relaxed_input_section.
8586 (Output_section::Input_section::is_input_section,
8587 Output_section::Input_section::set_output_section): Handle relaxed
8588 input section.
8589 (Output_section::Input_section::is_relaxed_input_section,
8590 Output_section::Input_section::output_section_data,
8591 Output_section::Input_section::relaxed_input_section): New method
8592 definitions.
8593 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
8594 value.
8595 (Output_section::Input_section::u1_): Update comments.
8596 (Output_section::Input_section::u2_): Add new union member poris.
8597 (Output_section::Checkpoint_output_section): New classs definition.
8598 (Output_section::relax_input_section): New method declaration.
8599 (Output_section::checkpoint_): New data member.
8600 (Output_segment): Update comments.
8601 (Output_segment::Output_segment): Un-privatize copy constructor.
8602 (Output_segment::operator=): Un-privatize.
8603 * script-sections.cc (Output_section_element::Input_section_list):
8604 Change element type to Output_section::Simple_input_section.
8605 (Output_section_element_dot_assignment::set_section_addresses):
8606 Register output section data for relaxation clean up.
8607 (Output_data_exression::Output_data_expression): Adjust call to base
8608 constructor to fix data size.
8609 (Output_section_element_data::set_section_addresses): Register
8610 Output_data_expression object for relaxation clean up.
8611 (struct Input_section_info): Replace Relobj pointer and section index
8612 pair with Output_section::Simple_input_section and Convert struct to a
8613 class.
8614 (Input_section_sorter::operator()): Adjust access to
e1df38aa 8615 Input_section_info data member to use accessors.
20e6d0d6
DK
8616 (Output_section_element_input::set_section_addresses): Use layout
8617 parameter. Adjust code to use Output_section::Simple_input_section
8618 and Input_secction_info classes. Register filler for relaxation
8619 clean up.
8620 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
8621 and section index pair with Output_section::Simple_input_section
8622 class. Adjust code accordingly.
8623 (Phdrs_element::release_segment): New method definition.
8624 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
8625 segment list.
8626 (Script_sections::release_segments): New method definition.
8627 * gold/script-sections.h (Script_sections::release_segments): New
8628 method declaration.
8629 * gold/target.h (Target::may_relax, Target::relax,
8630 Target::do_may_relax, Target::do_relax): New method definitions.
8631
5e445df6
ILT
86322009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8633
8634 * arm.cc (has_signed_unsigned_overflow): New function.
8635 (Arm_relocate_functions::abs8): New function.
8636 (Target_arm::Scan::local): Handle R_ARM_ABS8.
8637 (Target_arm::Scan::global): Likewise.
8638 (Target_arm::relocate::relocate): Likewise.
8639 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8640 Likewise.
8641
8c604651 86422009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
8643
8644 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
8645 * testsuite/Makefile.in: Regenerate.
8646
1e9cc1c2
NC
86472009-09-11 Nick Clifton <nickc@redhat.com>
8648
8649 * po/gold.pot: Updated by the Translation project.
8650
6a89f575
CC
86512009-09-08 Cary Coutant <ccoutant@google.com>
8652
8653 * output.cc (Output_file::open): Add execute permission to empty file.
8654 * testsuite/Makefile.am (permission_test): New test.
8655 * testsuite/Makefile.in: Regenerate.
8656
fdcac5af
ILT
86572009-09-02 Ian Lance Taylor <iant@google.com>
8658
8659 * output.cc (Output_file::resize): Call map_no_anonymous rather
8660 than map.
8661
44453f85
ILT
86622009-09-01 Mikolaj Zalewski <mikolajz@google.com>
8663
8664 * gold.cc: Include "incremental.h".
8665 (queue_initial_tasks): Call Incremental_checker methods.
8666 * incremental.cc: Include "output.h".
8667 (Incremental_checker::can_incrementally_link_output_file): New
8668 method.
8669 * incremental.h (Incremental_checker): New class.
8670
8671 * output.cc (Output_file::open_for_modification): New method.
8672 (Output_file::map_anonymous): Changed return type to bool. Record
8673 map in base_ field.
8674 (Output_file::map_no_anonymous): New method, broken out of map.
8675 (Output_file::map): Use map_no_anonymous and map_anonymous.
8676 * output.h (class Output_file): Update declarations.
8677
293c1386
CC
86782009-08-24 Cary Coutant <ccoutant@google.com>
8679
8680 * options.h (Command_line::Pre_options): New class.
8681 (Command_line::pre_options): New member.
8682 * options.cc (gold::options::ready_to_register): New variable.
8683 (One_option::register_option): Do nothing if not registering options.
8684 Assert if same short option registered twice.
8685 (General_options::General_options): Turn off option registration when
8686 done constructing.
8687 (Command_line::Pre_options::Pre_options): New constructor.
8688
f773f3d2
CC
86892009-08-24 Cary Coutant <ccoutant@google.com>
8690
06a73cfe
CC
8691 * options.h (General_options::no_keep_memory): Remove incorrect
8692 short option.
f773f3d2 8693
a15af8e2
RW
86942009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8695
8696 * Makefile.am (am__skiplex, am__skipyacc): New.
8697 * Makefile.in: Regenerate.
8698
c462b41b
RW
86992009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8700
14ec8efd
RW
8701 * Makefile.am (AM_CPPFLAGS): Renamed from ...
8702 (INCLUDES): ... this.
8703 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
8704 (AM_CPPFLAGS): Renamed from ...
8705 (INCLUDE): ... this.
8706 * Makefile.in, testsuite/Makefile.in: Regenerate.
8707
81ecdfbb
RW
8708 * Makefile.in: Regenerate.
8709 * aclocal.m4: Likewise.
8710 * config.in: Likewise.
8711 * configure: Likewise.
8712 * testsuite/Makefile.in: Likewise.
8713
c462b41b
RW
8714 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
8715 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
8716 * Makefile.in: Regenerate.
8717 * testsuite/Makefile.in: Regenerate.
8718
2da73f13
CC
87192009-08-19 Cary Coutant <ccoutant@google.com>
8720
8721 * resolve.cc (Symbol_table::resolve): Don't complain about defined
8722 symbols in shared libraries overridden by hidden or internal symbols
8723 in the main program.
8724
2db70501
CD
87252009-08-19 Chris Demetriou <cgd@google.com>
8726
8727 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
8728 checking source file names in error messages.
8729
f733487b
DK
87302009-08-18 Doug Kwan <dougkwan@google.com>
8731
8732 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
8733 an elcpp::Ehdr as parameter. Adjust call to set_target.
8734 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
8735 an elfcpp::Ehdr as parameter.
8736 * object.cc (Object::set_target): Remove the version that looks up
8737 a target and sets it.
8738 (Sized_relobj::setup): Take a Target object instead of
8739 an elfcpp::Ehdr as parameter. Adjust call to set_target.
8740 (make_elf_sized_object): Find target and ask target to
8741 make an ELF object.
8742 * object.h: (Object::set_target): Remove the version that looks up
8743 a target and sets it.
8744 (Sized_relobj::setup): Take a Target object instead of
8745 an elfcpp:Ehdr as parameter.
8746 * target.cc: Include dynobj.h.
8747 (Target::do_make_elf_object_implementation): New.
8748 (Target::do_make_elf_object): New.
8749 * target.h (Target::make_elf_object): New template declaration.
8750 (Target::do_make_elf_object): New method declarations.
8751 (Target::do_make_elf_object_implementation): New template declaration.
8752
cc70f101
ILT
87532009-08-14 Ian Lance Taylor <iant@google.com>
8754
8755 * gold.h (FUNCTION_NAME): Define.
8756 (gold_unreachable): Use FUNCTION_NAME.
8757
ef5e0cb1
ST
87582009-08-12 Sriraman Tallam <tmsriram@google.com>
8759
8760 * icf.cc (Icf::find_identical_sections): Issue a warning when a
8761 symbol in the --keep-unique list is not found.
8762
48c187ce
ST
87632009-08-12 Sriraman Tallam <tmsriram@google.com>
8764
8765 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
8766 been maked as --keep-unique.
8767 (Icf::unfold_section): New function.
8768 * icf.h (Icf::unfold_section): New function.
8769 * options.h (General_options::keep_unique): New option.
8770 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
8771 * testsuite/Makefile.in: Regenerate.
8772 * testsuite/icf_keep_unique_test.sh: New file.
8773 * testsuite/icf_keep_unique_test.cc: New file.
8774
645afe0c
CC
87752009-08-12 Cary Coutant <ccoutant@google.com>
8776
8777 PR 10471
8778 * resolve.cc (Symbol_table::resolve): Check for references from
8779 dynamic objects to hidden and internal symbols.
8780 * testsuite/Makefile.am (hidden_test.sh): New test.
8781 * testsuite/Makefile.in: Regenerate.
8782 * testsuite/hidden_test.sh: New script.
8783 * testsuite/hidden_test_1.c: New test source.
8784 * testsuite/hidden_test_main.c: New test source.
8785
11af873f
DK
87862009-08-11 Doug Kwan <dougkwan@google.com>
8787
8788 * arm.cc: Update comments.
8789 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
8790 segment to locate the .ARM.exidx section if present.
8791
b9f7d72d
DK
87922009-08-09 Doug Kwan <dougkwan@google.com>
8793
8794 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
8795 patch.
8796
ddd3c53c
ST
87972009-08-07 Sriraman Tallam <tmsriram@google.com>
8798 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
8799 compiler warnings.
8800
27721062
ST
88012009-08-06 Sriraman Tallam <tmsriram@google.com>
8802
8803 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
8804 valid tls_segment only for non-debug-section relocations.
8805 * testsuite/Makefile.am: Add gc_tls_test.
8806 * testsuite/Makefile.in: Regenerate.
8807 * testsuite/gc_tls_test.cc: New file.
8808 * testsuite/gc_tls_test.sh: New file.
8809
ef15dade 88102009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 8811
ef15dade
ST
8812 * icf.cc: New file.
8813 * icf.h: New file.
8814 * Makefile.am (CCFILES): Add icf.cc.
8815 (HFILES): Add icf.h
8816 * Makefile.in: Regenerate.
8817 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
8818 * gc.h (gc_process_relocs): Populate lists used by icf to contain
8819 section, symbol and addend information for the relocs.
8820 * gold.cc (queue_middle_tasks): Call identical code folding.
8821 * gold.h: Add defines for multimap.
8822 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
8823 to the call of finalize_local_symbols.
8824 * main.cc (main): Create object of class Icf.
8825 * object.cc (Sized_relobj::do_layout): Allow this function to be
8826 called twice during icf.
8827 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
8828 to sections marked as identical by icf.
8829 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
8830 when available.
8831 (Sized_relobj::do_section_entsize): New function.
8832 * object.h (Object::section_entsize): New function.
8833 (Object::do_section_entsize): New pure virtual function.
8834 (Relobj::finalize_local_symbols): Add new parameter.
8835 (Relobj::do_section_entsize): New function.
8836 * options.h (General_options::icf): New option.
8837 (General_options::icf_iterations): New option.
8838 (General_options::print_icf_sections): New option.
8839 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
8840 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
8841 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
8842 icf.
8843 * symtab.cc (Symbol_table::is_section_folded): New function.
8844 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
8845 to sections marked as identical by icf.
8846 * symtab.h (Symbol_table::set_icf): New function.
8847 (Symbol_table::icf): New function.
8848 (Symbol_table::is_section_folded): New function.
8849 (Symbol_table::icf_): New data member.
8850 * target-reloc.h (relocate_section): Ignore sections folded by icf.
8851 * testsuite/Makefile.am: Add commands to build icf_test.
8852 * testsuite/Makefile.in: Regenerate.
8853 * testsuite/icf_test.sh: New file.
8854 * testsuite/icf_test.cc: New file.
8855
c3b65ac4
CD
88562009-07-24 Chris Demetriou <cgd@google.com>
8857
8858 * layout.cc (is_compressible_debug_section): Fix incorrect
8859 comment about compressed section names.
8860
1caf2c51
ILT
88612009-07-20 Ian Lance Taylor <ian@airs.com>
8862
8863 PR 10419
8864 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
8865
1ef4d87f
ILT
88662009-07-16 Ian Lance Taylor <iant@google.com>
8867
8868 PR 10400
8869 * layout.h: #include <map>.
8870 (class Kept_section): Change from struct to class. Add accessors
8871 and setters. Add section size to Comdat_group mapping. Change
8872 Comdat_group to std::map. Add is_comdat_ field. Add
8873 linkonce_size field in union.
8874 (class Layout): Update declaration of find_or_add_kept_section.
8875 Don't declare find_kept_object.
8876 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
8877 parameter. Add object, shndx, is_comdat, and is_group_name
8878 parameters. Change all callers. Adjust for new Kept_section.
8879 (Layout::find_kept_object): Remove.
8880 * object.cc (Sized_relobj::include_section_group): Update use of
8881 Kept_section. Rename secnum to shndx. Only record
8882 Kept_comdat_section if sections are the same size.
8883 (Sized_relobj::include_linkonce_section): Update use of
8884 Kept_section. Only record Kept_comdat_section if sections are the
8885 same size. Set size of linkonce section.
8886 (Sized_relobj::map_to_kept_section): Update call to
8887 get_kept_comdat_section.
8888 * object.h (class Sized_relobj): Rename fields in
8889 Kept_comdat_section to drop trailing underscores; change object
8890 field to Relobj*. Change Kept_comdat_section_table to store
8891 struct rather than pointer.
8892 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
8893 Add kept_object and kept_shndx parameters. Change all callers.
8894 (Sized_relobj::get_kept_comdat_section): Change return type to
8895 bool. Add kept_object and kept_shndx parameters. Change all
8896 callers.
8897 * plugin.cc (Pluginobj::include_comdat_group): Update call to
8898 Layout::find_or_add_kept_section.
8899
37c3b7b0
ILT
89002009-07-09 Ian Lance Taylor <iant@google.com>
8901
8902 * merge.cc (Object_merge_map::initialize_input_to_output_map):
8903 Reserve space in the hash table.
8904
98fa85cb
ILT
89052009-07-06 Mikolaj Zalewski <mikolajz@google.com>
8906
8907 * fileread.cc (File_read::get_mtime): New method.
8908 * fileread.h (Timespec): New structure.
8909 (File_read::get_mtime): New method.
8910 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
8911 Renamed from timestamp_nsec.
8912 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
8913 Elf_Xword.
e1df38aa 8914 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 8915 timestamp_nsec.
e1df38aa 8916 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
8917 (Incremental_inputs::report_obejct): Save mtime; style fix.
8918 (Incremental_inputs::report_script): Save mtime; style fix.
8919 (Incremental_inputs::finalize_inputs): Style fix.
8920 (Incremental_inputs::finalize): Style fix.
8921 (Incremental_inputs::create_input_section_data): Store inputs
8922 mtime.
8923 * incremental.h (Incremental_inputs::report_script): Add mtime
8924 argument.
8925 (Incremental_inputs::Input_info::Input_info): Intialize only one
8926 union member.
8927 (Incremental_inputs::Input_info::archive): Move to nameless
8928 union.
8929 (Incremental_inputs::Input_info::obejct): Move to nameless union.
8930 (Incremental_inputs::Input_info::script): Move to nameless union.
8931 (Incremental_inputs::mtime): New field.
8932 * script.cc (read_input_script): Pass file mtime to
8933 Incremental_input.
8934 * script.h (Script_info::inputs): Style fix.
8935
c9d70757
ILT
89362009-07-01 Ian Lance Taylor <ian@airs.com>
8937
8938 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
8939 instead of 32.
8940
9c547ec3
ILT
89412009-06-24 Ian Lance Taylor <iant@google.com>
8942
8943 PR 10156
8944 * layout.cc (Layout::choose_output_section): If we find an
8945 existing section, update the flags.
8946 (Layout::create_notes): New function, broken out of
8947 Layout::finalize.
8948 (Layout::finalize): Don't create note sections.
8949 (Layout::create_note): Don't crash if linker script discards
8950 section.
8951 (Layout::create_gold_note): Likewise.
8952 (Layout::create_build_id): Likewise. Don't set
8953 after_input_sections on the section.
8954 (Layout::create_executable_stack_info): Remove target parameter.
8955 Change caller.
8956 * layout.h (class Layout): Declare create_notes. Update
8957 declaration of create_executable_stack_info.
8958 * gold.cc (queue_middle_tasks): Call create_notes.
8959 * output.cc (Output_section::update_flags_for_input_section): Move
8960 here from output.h. If SHF_ALLOC flag is newly set, mark address
8961 invalid.
8962 * output.h (Output_data::mark_address_invalid): New function.
8963 (class Output_section): Only declare, not define,
8964 update_flags_for_input_section. Remove set_flags.
8965
55458500
ILT
89662009-06-24 Ian Lance Taylor <iant@google.com>
8967
8968 * script-sections.cc (Output_section_definition::
8969 set_section_addresses): Rename shadowing local load_address to
8970 laddr.
8971
1307d6cd
ILT
89722009-06-24 Ian Lance Taylor <iant@google.com>
8973
8974 PR 10244
8975 * reloc.cc (relocate_sections): Skip empty relocation sections.
8976
ec3f783e
ILT
89772009-06-23 Ian Lance Taylor <iant@google.com>
8978
8979 PR 10156
8980 * layout.cc (Layout::create_note): Use choose_output_section
8981 rather than make_output_section.
8982
459c9f1c
ILT
89832009-06-23 Ian Lance Taylor <iant@google.com>
8984
8985 PR 10237
8986 * options.cc (General_options::parse_V): Set printed_version_.
8987 (General_options::General_options): Initialize printed_version_.
8988 * options.h (class General_options): Add printed_version_ field.
8989 * gold.cc (queue_initial_tasks): If there are no input files,
8990 don't give a fatal error if we printed the version information.
8991 (queue_middle_tasks): If using -r with a shared object, give a
8992 fatal error rather than an ordinary error.
8993
1518dc8f
ILT
89942009-06-23 Ian Lance Taylor <iant@google.com>
8995
8996 PR 10219
8997 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
8998 (Layout::make_output_section): Set have_stabstr_section_ if we see
8999 a .stab*str section.
9000 (Layout::finalize): Call link_stabs_sections.
9001 (Layout::link_stabs_sections): New file.
9002 * layout.h (class Layout): Add have_stabstr_section_ field.
9003 Declare link_stabs_sections.
9004
3d857b98
DK
90052009-06-23 Doug Kwan <dougkwan@google.com>
9006
9007 * Makefile.am (libgold_a_LIBADD): New.
9008 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
9009 * Makefile.in: Regenerate.
9010 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
9011 * configure: Regenerate.
9012 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
9013 * fileread.cc: Include sys/state.h
9014 * gold.h: Declare memmem and strndup if found missing.
9015 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
9016
0639a6f6
ILT
90172009-06-23 Ian Lance Taylor <iant@google.com>
9018
9019 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
9020 * configure: Rebuild.
9021
8d63875c
ILT
90222009-06-23 Ian Lance Taylor <iant@google.com>
9023
9024 PR 10147
9025 * object.cc (Object::section_contents): Don't try to get a view if
9026 the section has length zero.
9027 (Object::handle_gnu_warning_section): If the section is empty, use
9028 the name of the section as the warning.
9029
f7c8a183
ILT
90302009-06-23 Ian Lance Taylor <iant@google.com>
9031
9032 PR 10133
9033 * stringpool.h (class Stringpool_template): Add optimize_ field.
9034 (Stringpool_template::set_optimize): New function.
9035 * stringpool.cc (Stringpool_template::Stringpool_template):
9036 Initialize optimize_ field.
9037 (Stringpool_template::set_string_offsets): Test local optimize
9038 fild rather than parameter.
9039 * layout.cc (Layout::Layout): Call set_optimize on the section
9040 name stringpool.
9041
e6a307ba
ILT
90422009-06-22 Ian Lance Taylor <iant@google.com>
9043
9044 PR 10030
9045 * yyscript.y: Parse TARGET.
9046 * script.cc (script_set_target): New function.
9047 * script-c.h (script_set_target): Declare.
9048 * options.cc (General_options::string_to_object_format): Rename
9049 from string_to_object_format in anonymous namespace. Change
9050 callers.
9051 * options.h (class General_options): Declare
9052 string_to_object_format.
9053
3ee173de
ILT
90542009-06-22 Ian Lance Taylor <iant@google.com>
9055
9056 * script-sections.cc (Script_sections::create_segments): Don't put
9057 program headers in a PT_LOAD segment if -n or -N.
9058
90592009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
9060
9061 PR 10141
9062 * options.h (class General_options): Add -z lazy and -z now. Sort
9063 -z options into alphabetical order.
9064 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
9065
cd6739a1 90662009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
9067
9068 * layout.cc (Layout::make_output_section): Call
9069 Target::new_output_section.
9070 (Layout::attach_allocated_section_to_segment): Put large section
9071 sections in a separate load segment with the large segment flag
9072 set.
9073 (Layout::segment_precedes): Sort large data segments after other
9074 load segments.
9075 (align_file_offset): New static function.
9076 (Layout::set_segment_offsets): Use align_file_offset.
9077 * output.h (class Output_section): Add is_small_section_ and
9078 is_large_section_ fields.
9079 (Output_section::is_small_section): New function.
9080 (Output_section::set_is_small_section): New function.
9081 (Output_section::is_large_section): New function.
9082 (Output_section::set_is_large_section): New function.
9083 (Output_section::is_large_data_section): New function.
9084 (class Output_segment): Add is_large_data_segment_ field.
9085 (Output_segment::is_large_data_segment): New function.
9086 (Output_segment::set_is_large_data_segment): New function.
9087 * output.cc (Output_section::Output_section): Initialize new
9088 fields.
9089 (Output_segment::Output_segment): Likewise.
9090 (Output_segment::add_output_section): Add assertion that large
9091 data sections always go in large data segments. Force small data
9092 sections to the end of the list of data sections. Force small BSS
9093 sections to the start of the list of BSS sections. For large BSS
9094 sections to the end of the list of BSS sections.
9095 * symtab.h (class Symbol): Declare is_common_shndx.
9096 (Symbol::is_defined): Check Symbol::is_common_shndx.
9097 (Symbol::is_common): Likewise.
9098 (class Symbol_table): Define enum Commons_section_type. Update
9099 declarations. Add small_commons_ and large_commons_ fields.
9100 * symtab.cc (Symbol::is_common_shndx): New function.
9101 (Symbol_table::Symbol_table): Initialize new fields.
9102 (Symbol_table::add_from_object): Put small and large common
9103 symbols in the right list.
9104 (Symbol_table::sized_finalized_symbol): Check
9105 Symbol::is_common_shndx.
9106 (Symbol_table::sized_write_globals): Likewise.
9107 * common.cc (Symbol_table::do_allocate_commons): Allocate new
9108 common symbol lists. Don't call do_allocate_commons_list if the
9109 list is empty.
9110 (Symbol_table::do_allocate_commons_list): Remove is_tls
9111 parameter. Add comons_section_type parameter. Change all
9112 callers. Handle small and large common symbols.
9113 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
9114 Symbol::is_common_shndx.
9115 * resolve.cc (symbol_to_bits): Likewise.
9116 * target.h (Target::small_common_shndx): New function.
9117 (Target::small_common_section_flags): New function.
9118 (Target::large_common_shndx): New function.
9119 (Target::large_common_section_flags): New function.
9120 (Target::new_output_section): New function.
9121 (Target::Target_info): Add small_common_shndx, large_common_shndx,
9122 small_common_section_flags, and large_common_section_flags
9123 fields.
9124 (Target::do_new_output_section): New virtual function.
9125 * arm.cc (Target_arm::arm_info): Initialize new fields.
9126 * i386.cc (Target_i386::i386_info): Likewise.
9127 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
9128 Likewise.
9129 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
9130 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
9131 (Target_x86_64::do_new_output_section): New function.
9132 * configure.ac: Define conditional MCMODEL_MEDIUM.
9133 * testsuite/Makefile.am (check_PROGRAMS): Add large.
9134 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
9135 (large_LDFLAGS): Define.
9136 * testsuite/large.c: New file.
9137 * testsuite/testfile.cc (Target_test::test_target_info):
9138 Initialize new fields.
9139 * configure, testsuite/Makefile.in: Rebuild.
9140
bb04269c
DK
91412009-06-05 Doug Kwan <dougkwan@google.com>
9142
9143 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 9144 * Makefile.in: Regenerate.
bb04269c
DK
9145 * i386.cc (class Target_i386): Define new virtual method to
9146 override do_is_local_label_name in parent.
9147 * object.cc (Sized_relobj::do_count_local_symbols): Discard
9148 local symbols if --discard-locals or -X is given.
9149 * options.h (class General_options): Declare new options
9150 '--discard-locals' and '-X' for discarding locals.
9151 * target.h (class Target): Define new methods is_local_label_name.
9152 Declare new virtual method do_is_local_label_name.
9153 * target.cc: New file.
9154 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
9155 (check_SCRIPTS): Add discard_locals_test.sh.
9156 (check_DATA): Add discard_local_tests.syms.
9157 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
9158 (discard_local_tests.syms, discard_locals_test.o): New make rules.
9159 * testsuite/Makefile.in: Regenerate.
9160 * testsuite/discard_locals_test.c: New file.
9161 * testsuite/discard_locals_test.sh: Same.
9162
805bb01c
DK
91632009-06-05 Doug Kwan <dougkwan@google.com>
9164
9165 * object.cc (Sized_relobj::Sized_relobj): Initialize
9166 discarded_eh_frame_shndx_ to -1U.
9167 (Sized_relobj::do_layout): Record index of a discard .eh_frame
9168 section.
9169 (Sized_relobj::do_count_local_symbols): Skip local symbols in
9170 a discarded .eh_frame section.
9171 (Sized_relobj::do_finalize_local_symbols): Ditto.
9172 * object.h (class Sized_relobj): Declare new member
9173 discarded_eh_frame_shndx_.
9174 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
9175 (local_labels_test.o, local_labels_test): New rules.
9176 * testsuite/Makefile.in: Regenerate.
9177
1dcd334d
DK
91782009-06-04 Doug Kwan <dougkwan@google.com>
9179
9180 * layout.cc (Layout::section_name_mapping): Add mapping for
9181 special ARM sections.
9182
96d49306
DK
91832009-06-03 Doug Kwan <dougkwan@google.com>
9184
9185 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
9186 (utils::has_overflow): Same.
9187
dff16297
ILT
91882009-06-03 Ian Lance Taylor <iant@google.com>
9189
9190 * layout.cc (Layout::section_name_mapping): New array, replacing
9191 Layout::linkonce_mapping.
9192 (Layout::section_name_mapping_count): New variable, replacing
9193 Layout::linkonce_mapping_count.
9194 (Layout::linkonce_output_name): Remove.
9195 (Layout::output_section_name): Rewrite.
9196 * layout.h (class Layout): Rename Linkonce_mapping to
9197 Section_name_mapping, linkonce_mapping to section_name_mapping,
9198 linkonce_mapping_count to section_name_mapping_count. Don't
9199 declare linkonce_output_name.
9200
c121c671
DK
92012009-06-03 Doug Kwan <dougkwan@google.com>
9202
9203 * gold/arm.cc (namespace utils): New.
9204 (Target_arm::reloc_is_non_pic): Define new method.
9205 (class Arm_relocate_functions): New.
9206 (Target_arm::Relocate::relocate): Handle relocation types used by
9207 Android.
9208
07800fab
ILT
92092009-06-03 Ian Lance Taylor <iant@google.com>
9210
9211 * arm.cc (Target_arm::scan::global): Use || instead of |.
9212
c121c671
DK
92132009-06-02 Doug Kwan <dougkwan@google.com>
9214
9215 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
9216 issued_non_pic_error_.
9217 (class Target_arm::Scan): Declare new method check_non_pic.
9218 Define new method symbol_needs_plt_entry.
9219 Declare new data member issued_non_pic_error_.
9220 (class Target_arm::Relocate): Declare new method
9221 should_apply_static_reloc.
9222 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
9223 (Target_arm::Scan::check_non_pic): Define new method.
9224 (Target_arm::Scan::local): Handle a small subset of reloc types used
9225 by Android.
9226 (Target_arm::Scan::local): Same.
9227 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
9228
b19b0c6d
ILT
92292009-05-31 Mikolaj Zalewski <mikolajz@google.com>
9230
9231 * incremental.cc (Incremental_inputs::report_command_line): Filter
9232 out --incremental-* options.
9233
94cdfcff
DK
92342009-05-29 Doug Kwan <dougkwan@google.com>
9235
9236 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
9237 template class.
9238 (class Target_arm): Update comment.
9239 (Target_arm::Target_arm): Initialize new data members GOT_,
9240 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
9241 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
9242 and Target_arm::rel_dyn_section.
9243 Declare new_enum Target_arm::Got_type.
9244 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
9245 and DYNBSS_.
9246 Update commments for member do_dynsym_value.
9247 (Target_arm::got_size, Target_arm::plt_section,
9248 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
9249 new methods inside class defintion.
9250 (Target_arm::got_section): Define new method.
9251 (Target_arm::rel_dyn_section): Same.
9252 (Output_data_plt_arm): New template class.
9253 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
9254 (Output_data_plt_arm:do_adjust_output_section): Define new method.
9255 (Output_data_plt_arm::add_entry): Same.
9256 (Output_data_plt_arm::first_plt_entry): Define new
9257 static data member for PLT instruction template.
9258 (Output_data_plt_arm::plt_entry): Same.
9259 (Output_data_plt_arm::do_write): Define new method.
9260 (Target_arm::make_plt_entry): Same.
9261 (Target_arm::do_finalize_sections): Same.
9262 (Target_arm::do_dynsym_value): Same.
9263
4a657b0d
DK
92642009-05-28 Doug Kwan <dougkwan@google.com>
9265
9266 * Makefile.am (TARGETSOURCES): Add arm.cc.
9267 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
9268 * Makefile.in: Regenerate.
9269 * arm.cc: New file.
9270 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
9271
e7ae8c36
DK
92722009-05-26 Doug Kwan <dougkwan@google.com>
9273
9274 * options.cc (General_options::parse_exclude_libs). Fix a comment.
9275 (General_options::check_excluded_libs): Strip off directories in
9276 archive name before matching like GNU ld does.
9277 * testsuite/Makefile.am (MOSTLYCLEANFILES,
9278 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
9279 (exclude_libs_test_LDFLAGS): Add linker option
9280 -Wl,--exclude-libs,libexclude_libs_test_3
9281 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
9282 an explicit archive without using -l.
9283 (alt/libexclude_libs_test_3.a): New make rule.
9284 * testsuite/Makefile.in: Regenerate.
9285 * testsuite/exclude_libs_test.c : Declare lib3_default().
9286 (main): Call it.
9287 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
9288 * exclude_libs_test_3.c: New file.
9289
f12e7348
NC
92902009-05-26 Nick Clifton <nickc@redhat.com>
9291
9292 * po/id.po: New Indonesian translation.
9293 * po/gold.pot: Updated template file.
9294
4daadc0d
ST
92952009-05-22 Sriraman Tallam <tmsriram@google.com>
9296
e1df38aa 9297 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
9298 gc_comdat_test files. Add -Wl,--gc-sections to build
9299 gc_comdat_test.
9300 * testsuite/Makefile.in: Regenerate.
9301 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
9302
531813ad
ST
93032009-05-21 Sriraman Tallam <tmsriram@google.com>
9304
9305 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
9306 kept comdat section was garbage collected.
9307 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
9308 * testsuite/Makefile.in: Regenerate.
9309 * testsuite/gc_comdat_test.sh: New file.
9310 * testsuite/gc_comdat_test_1.cc: New file.
9311 * testsuite/gc_comdat_test_2.cc: New file.
9312
65514900
CC
93132009-05-19 Doug Kwan <dougkwan@google.com>
9314
9315 * archive.cc (Archive::Archive): Move constructor from archive.h
9316 to here. Initialize no_export_.
9317 (Archive::get_elf_object_for_member): Set no_export flag of object.
9318 * archive.h (Archive::Archive): Move constructor body to
9319 archive.cc.
9320 (Archive::no_export): New method.
9321 (Archive::no_export_): New field.
9322 * object.h (Object::Object): Initialize no_export_ to false.
9323 (Object::no_export, Object::set_no_export): New methods.
9324 (Object::no_export_): New field.
9325 * options.cc (General_options::parse_exclude_libs): New method.
9326 (General_options::check_excluded_libs) Same.
9327 * options.h (exclude_libs): New option.
9328 (General_options::check_excluded_libs): New method declaration.
9329 (General_options::excluded_libs_): New field.
9330 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
9331 default or protected visibility if an object has no-export flag set.
9332 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
9333 (check_SCRIPTS): Add exclude_libs_test.sh.
9334 (check_DATA): Add exclude_libs_test.syms.
9335 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
9336 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
9337 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
9338 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
9339 (exclude_libs_test.syms, libexclude_libs_test_1.a,
9340 libexclude_libs_test_2.a): New rules.
9341 * testsuite/Makefile.in: Regenerate.
9342 * testsuite/exclude_libs_test.c: New file.
9343 * testsuite/exclude_libs_test.sh: Ditto.
9344 * testsuite/exclude_libs_test_1.c: Ditto.
9345 * testsuite/exclude_libs_test_2.c: Ditto.
9346
1b77ea50
ILT
93472009-05-15 Ian Lance Taylor <iant@google.com>
9348
9349 * configure.ac: Check for declarations for cases where libiberty.h
9350 checks HAVE_DECL_xxx.
9351 * configure, config.in: Rebuild.
9352
072fe7ce
ILT
93532009-05-15 Mikolaj Zalewski <mikolajz@google.com>
9354
9355 * gold.h (Incremental_argument_list): Remove (invalid) forward
9356 declaration.
9357 * incremental.cc (Incremental_inputs::report_achive): New method.
9358 (Incremental_inputs::report_object): New method.
9359 (Incremental_inputs::report_script): New method.
9360 (Incremental_inputs::finalize_inputs): New method.
9361 (Incremental_inputs::finalize): Call finalize_inputs().
9362 (Incremental_inputs::sized_create_incremental_inputs_section_data):
9363 Create inputs entries.
9364 * incremental.h (Incremental_input_type): New enum.
9365 (Incremental_inputs::Incremental_input): Initialize new fields.
9366 (Incremental_inputs::report_inputs): New method.
9367 (Incremental_inputs::report_achive): New method.
9368 (Incremental_inputs::report_object): New method.
9369 (Incremental_inputs::report_script): New method.
9370 (Incremental_inputs::finalize_inputs): New method.
9371 (Incremental_inputs::Input_info): New struct.
9372 (Incremental_inputs::Input_info_map): New typedef.
9373 (Incremental_inputs::lock_): New field.
9374 (Incremental_inputs::Inputs_): New field.
9375 (Incremental_inputs::Inputs_map): New field.
9376 * main.cc (main): Call Incremental_input::report_inputs.
9377 * options.h (Input_argument_list): Typedef moved from
9378 Input_arguments.
9379 (Input_file_group::Files): Remove, use ::Input_argument_list.
9380 (Input_file_group::Input_argument_list): Remove, use
9381 ::Input_argument_list.
9382 * plugin.cc (Plugin_manager::add_input_file): Add error in
9383 incremental build.
9384 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
9385 functions.
9386 * script.cc (read_input_script): Call
9387 Incremental_input::report_script.
9388 * script.h (Script_info): New class.
9389
b0481b0b
ILT
93902009-04-27 Ian Lance Taylor <iant@google.com>
9391
9392 * x86_64.cc (do_adjust_output_section): Set entsize to
9393 plt_entry_size.
9394
b22a5a41 93952009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
9396
9397 * output.cc (Output_file::close): After short writes, continue
9398 writing from the correct offset in the buffer being written.
9399
40fde488
CD
94002009-04-23 Chris Demetriou <cgd@google.com>
9401
9402 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
9403 * configure: Regenerate.
9404 * config.in: Regenerate.
9405 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
9406 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
9407
3ce2c28e
ILT
94082009-04-21 Mikolaj Zalewski <mikolajz@google.com>
9409
9410 * incremental.cc (Incremental_inputs_header_data): Renamed from
9411 Incremental_input_header_data.
9412 (Incremental_inputs_header_data::data_size): New field.
9413 (Incremental_inputs_header_data::put_input_file_count): Renamed
9414 from input_file_count.
9415 (Incremental_inputs_header_data::put_command_line_offset): Renamed
9416 from command_line_offset.
9417 (Incremental_inputs_header_data::put_reserved): Renamed from
9418 put_reserved.
9419 (Incremental_inputs_entry_data): Renamed from
9420 Incremental_input_entry_data.
9421 (Incremental_inputs_entry_data::data_size): New field.
9422 (Incremental_inputs::report_command_line): New method.
9423 (Incremental_inputs::finalize): New method.
9424 (Incremental_inputs::create_incremental_inputs_data): New method.
9425 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
9426 * incremental.h: New file.
9427 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
9428 (Layout::finalize): Create incremental inputs section in
9429 incremental builds.
9430 (Layout::create_incremental_info_sections): New method.
9431 * layout.h (Layout::incremental_inputs): New method.
9432 (Layout::create_incremental_info_sections): New method.
9433 (Layout::incremental_inputs_): New field.
9434 * main.cc (main): Notify Incremental_input of the command line.
9435
e55bde5e
ILT
94362009-04-01 Ian Lance Taylor <iant@google.com>
9437 Mikolaj Zalewski <mikolajz@google.com>
9438
9439 * gold.h (reserve_unordered_map): Define, three versions, one for
9440 each version of Unordered_map.
9441 * layout.cc (Layout::Layout): Remove options parameter. Add
9442 number_of_input_files parameter. Don't initialize options_.
9443 Initialize number_of_input_files_ and resized_signatures_. Move
9444 sections_are_attached_.
9445 (Layout::layout_group): Reserve space for group_signatures_.
9446 (Layout::find_or_add_kept_section): Change name parameter to be a
9447 reference. Resize signatures_ map when it gets large enough.
9448 (Layout::layout_eh_frame): Use parameters->options() instead of
9449 this->options_.
9450 (Layout::make_output_section): Likewise.
9451 (Layout::attach_allocated_section_to_segment): Likewise.
9452 (Layout::finalize, Layout::create_executable_stack): Likewise.
9453 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
9454 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
9455 * layout.h (class Layout): Update declarations. Remove options_
9456 field. Add number_of_input_files_ and resized_signatures_
9457 fields. Move sections_are_attached_ field.
9458 * main.cc (main): Pass number of input files to Layout
9459 constructor. Don't pass options.
9460
154b857c
ILT
94612009-03-30 Ian Lance Taylor <iant@google.com>
9462
9463 * ffsll.c (ffsll): Correct implementation.
9464
2f35ab9b
ILT
94652009-03-27 Ian Lance Taylor <iant@google.com>
9466
fd03461a
ILT
9467 * ffsll.c: New file.
9468 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
9469 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
9470 * ftruncate.c (ftruncate): Declare before definition.
9471 * mremap.c (mremap): Likewise.
9472 * pread.c (pread): Likewise.
9473 * configure, Makefile.in, config.in: Rebuild.
9474
2f35ab9b
ILT
9475 * mremap.c: New file.
9476 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
9477 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
9478 (mremap): Declare if HAVE_MREMAP is not defined.
9479 * configure, Makefile.in, config.in: Rebuild.
9480
33aea2fd
CC
94812009-03-27 Cary Coutant <ccoutant@google.com>
9482
9483 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
9484 position independent.
9485 * sparc.cc (Target_sparc::check_non_pic): Likewise.
9486 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
9487
6d479619
CC
94882009-03-24 Cary Coutant <ccoutant@google.com>
9489
9490 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
9491 an executable.
9492 (needs_dynamic_reloc): Likewise.
9493
afc06bb8
ILT
94942009-03-24 Ian Lance Taylor <iant@google.com>
9495
9496 * yyscript.y (file_cmd): Recognize EXTERN.
9497 (extern_name_list, extern_name_list_body): New nonterminals.
9498 * script.cc (script_add_extern): Define.
9499 * script-c.h (script_add_extern): Declare.
9500
f6060a4d
ILT
95012009-03-24 Rafael Avila de Espindola <espindola@google.com>
9502
9503 * object.cc (is_elf_object): Define.
9504 * object.h (is_elf_object): Declare.
9505 * archive.cc (Archive::get_elf_object_for_member): Call
9506 is_elf_object.
33aea2fd 9507 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 9508
26736d8e
ILT
95092009-03-24 Elliott Hughes <enh@google.com>
9510
9511 * output.cc (Output_file::map_anonymous): Define.
9512 (Output_file::map): Use map_anonymous. If the regular mmap fails,
9513 try an anonymous one. Report the size if the mmap fails.
9514 * output.h (class Output_file): Declare map_anonymous.
9515
22fd9730
ILT
95162009-03-24 Ian Lance Taylor <iant@google.com>
9517
9518 * target-select.cc (instantiate_target): Don't acquire the lock if
9519 the instantiated_target_ field has already been set.
9520
cb010894
ILT
95212009-03-23 Ian Lance Taylor <iant@google.com>
9522
7f055c20
ILT
9523 * gold-threads.h (class Initialize_lock): Define.
9524 * gold-threads.cc (class Initialize_lock_once): Define.
9525 (initialize_lock_control): New static variable.
9526 (initialize_lock_pointer): New static variable.
9527 (initialize_lock_once): New static function.
9528 (Initialize_lock::Initialize_lock): Define.
9529 (Initialize_lock::initialize): Define.
9530 * target-select.h: Include "gold-threads.h".
9531 (class Target_selector): Add lock_ and initialize_lock_ fields.
9532 Don't define instantiate_target, just declare it.
9533 * target-select.cc (Target_selector::Target_selector): Initialize
9534 new fields.
9535 (Target_selector::instantiate_target): Define.
9536 * descriptors.h: Include "gold-threads.h".
9537 (class Descriptors): Add initialize_lock_ field.
9538 * descriptors.cc (Descriptors::Descriptors): Initialize new
9539 field.
9540 (Descriptors::open): Use initialize_lock_ field
9541 * errors.h (class Errors): Add initialize_lock_ field.
9542 * errors.cc (Errors::Errors): Initialize new field.
9543 (Errors::initialize_lock): Use initialize_lock_ field.
9544 * powerpc.cc (class Target_selector_powerpc): Remove
9545 instantiated_target_ field. In do_recognize call
9546 instantiate_target rather than do_instantiate_target. In
9547 do_instantiate_target just allocate a new target.
9548 * sparc.cc (class Target_selector_sparc): Likewise.
9549
36959681
ILT
9550 * freebsd.h: New file.
9551 * i386.cc: Include "freebsd.h".
9552 (Target_i386): Derive from Target_freebsd rather than
9553 Sized_target.
9554 (Target_selector_i386): Derive from Target_selector_freebsd rather
9555 than Target_selector.
9556 * x86_64.cc: Include "freebsd.h".
9557 (Target_x86_64): Derive from Target_freebsd rather than
9558 Sized_target.
9559 (Target_selector_x86_64): Derive from Target_selector_freebsd
9560 rather than Target_selector.
9561 * target.h (class Target): Add adjust_elf_header and
9562 do_adjust_elf_header.
9563 * output.cc (Output_file_header:: do_sized_write): Call target
9564 adjust_elf_header routine.
9565 * configure.tgt: Set targ_osabi.
9566 * configure.ac: Define GOLD_DEFAULT_OSABI.
9567 * parameters.cc (Parameters::default_target): Pass
9568 GOLD_DEFAULT_OSABI to select_target.
9569 * target-select.h (class Target_selector): Make instantiate_target
9570 protected rather than private.
9571 * Makefile.am (HFILES): Add freebsd.h.
9572 * configure, Makefile.in, config.in: Rebuild.
9573
cb010894
ILT
9574 * merge.cc (do_add_input_section): Correct pend value. Change
9575 message about last entry not being null terminated from error to
9576 warning.
9577
0e879927
ILT
95782009-03-20 Mikolaj Zalewski <mikolajz@google.com>
9579
9580 * incremental.cc: New file.
9581 * Makefile.am (CCFILES): Add incremental.cc.
9582 * Makefile.in: Rebuild.
9583
41105937
PP
95842009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
9585
9586 * layout.cc (Layout::output_section_name): Preserve names
9587 of '.note.' sections.
e1df38aa 9588
60439920
ILT
95892009-03-19 Ian Lance Taylor <iant@google.com>
9590
9591 * descriptors.cc (Descriptors::open): Check that the options are
9592 valid before using them.
9593
0d371ad3
ILT
95942009-03-18 Ian Lance Taylor <iant@google.com>
9595
9596 * script-sections.h: Include <list>.
9597 (class Script_sections): Change Sections_elements from std::vector
9598 to std::list. Typedef public Elements_iterator. Add
9599 orphan_section_placement_, data_segment_align_start_, and
9600 saw_data_segment_align_ fields. Remove data_segment_align_index_
9601 field.
9602 * script-sections.cc (class Orphan_section_placement): New class.
9603 (class Sections_element): Add virtual functions is_relro and
9604 orphan_section_init. Remove virtual function place_orphan_here.
9605 (class Output_section_definition): Add is_relro and
9606 orphan_section_init. Remove place_orphan_here.
9607 (class Orphan_output_section): Likewise.
9608 (Script_sections::Script_sections): Update for field changes.
9609 (Script_sections::data_segment_align): Set saw_data_segment_align_
9610 and data_segment_align_start_, not data_segment_align_index.
9611 (Script_sections::data_segment_relro_end): Check
9612 saw_data_segment_align_. Use data_segment_align_start_ rather
9613 than data_segment_align_index_.
9614 (Script_sections::place_orphan): Rewrite to use
9615 Orphan_section_placement.
9616
9201d894
ILT
96172009-03-17 Ian Lance Taylor <iant@google.com>
9618
9c5b8369
ILT
9619 * archive.cc (Archive::add_symbols): Check for a version attached
9620 to the symbol name in the archive map.
9621 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
9622 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
9623 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
9624 (ver_test_11.a): New target.
9625 * testsuite/Makefile.in: Rebuild.
9626
9201d894
ILT
9627 * configure.ac: Check for chsize and posix_fallocate. Replace
9628 ftruncate.
9629 * ftruncate.c: New file, from gnulib.
9630 * output.cc (posix_fallocate): Define dummy version if not
9631 HAVE_POSIX_FALLOCATE.
9632 (Output_file::map): Call posix_fallocate rather than lseek and
9633 write.
9634 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
9635 * configure, Makefile.in, config.in: Rebuild.
9636
ef4ab7a8 96372009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 9638
ef4ab7a8
PP
9639 * layout.h (Layout::create_note): Add section_name parameter.
9640 * layout.cc (Layout::create_note): Likewise.
9641 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 9642
8c500701
ILT
96432009-03-17 Ian Lance Taylor <iant@google.com>
9644
e85b18e1
ILT
9645 * descriptors.cc: Include "options.h".
9646 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
9647 (Descriptors::open): Always use O_CLOEXEC when opening a new
9648 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
9649 then set FD_CLOEXEC.
9650
9efe6174
ILT
9651 * sparc.cc (class Target_sparc): Add has_got_section.
9652 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
9653 make sure we have a GOT section.
9654
9655 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
9656 (Target_sparc::Scan::local): Likewise.
9657 (Target_sparc::Scan::global): Likewise.
9658 (Target_sparc::Relocate::relocate): Likewise.
9659 (Target_sparc::Relocate::relocate_tls): Likewise.
9660
8c500701
ILT
9661 * symtab.cc (Symbol_table::define_default_version): New function,
9662 broken out of add_from_object.
9663 (Symbol_table::add_from_object): Call define_default_version.
9664 (Symbol_table::define_special_symbol): Add resolve_oldsym
9665 parameter. Change all callers. If the version for a symbol comes
9666 from a version script, resolve it with the symbol with the same
9667 name with no version. Also add the symbol without a version if
9668 appropriate.
9669 (do_define_in_output_data): If resolving with oldsym, don't delete
9670 sym.
9671 (do_define_in_output_segment): Likewise.
9672 (do_define_as_constant): Likewise.
9673 * symtab.h (class Symbol_table): Update declarations.
9674
f1ed28fb
ILT
96752009-03-13 Ian Lance Taylor <iant@google.com>
9676
15f8229b
ILT
9677 * readsyms.cc (Read_symbols::incompatible_warning): New function.
9678 (Read_symbols::requeue): New function.
9679 (Read_symbols::do_read_symbols): If make_elf_object fails because
9680 the target type is not configured, and the file was searched for,
9681 issue a warning and retry with the next directory.
9682 (Add_symbols::run): If the file has an incompatible format, and
9683 it was searched for, requeue the Read_symbols task. On error,
9684 release the object.
9685 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
9686 dirindex parameter to constructor. Change all callers. Declare
9687 incompatible_warning and requeue.
9688 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
9689 input_argument_ and input_group_ fields. Add them to
9690 constructor. Change all callers.
9691 (class Read_script): Add dirindex_ field. Add it to constructor.
9692 Change all callers.
9693 * archive.cc (Archive::setup): Remove input_objects parameter.
9694 Change all callers.
9695 (Archive::get_file_and_offset): Likewise.
9696 (Archive::read_all_symbols): Likewise.
9697 (Archive::read_symbols): Likewise.
9698 (Archive::get_elf_object_for_member): Remove input_objects
9699 parameter. Add punconfigured parameter. Change all callers.
9700 (Archive::add_symbols): Change return type to bool. Check return
9701 value of include_member.
9702 (Archive::include_all_members): Likewise.
9703 (Archive::include_member): Change return type to bool. Return
9704 false if first included object has incompatible target. Set
9705 included_member_ field.
9706 (Add_archive_symbols::run): If add_symbols returns false, requeue
9707 Read_symbols task.
9708 * archive.h (class Archive): Add included_member_ field.
9709 Initialize it in constructor. Add input_file and searched_for
9710 methods. Update declarations.
9711 (class Add_archive_symbols): Add dirpath_, dirindex_, and
9712 input_argument_ fields. Add them to constructor. Change all
9713 callers.
9714 * script.cc: Include "target-select.h".
9715 (class Parser_closure): Add skip_on_incompatible_target_ and
9716 found_incompatible_target_ fields. Add
9717 skip_on_incompatible_target parameter to constructor. Change all
9718 callers. Add methods skip_on_incompatible_target,
9719 clear_skip_on_incompatible_target, found_incompatible_target, and
9720 set_found_incompatible_target.
9721 (read_input_script): Add dirindex parameter. Change all callers.
9722 If parser finds an incompatible target, requeue Read_symbols
9723 task.
9724 (script_set_symbol): Clear skip_on_incompatible_target in
9725 closure.
9726 (script_add_assertion, script_parse_option): Likewise.
9727 (script_start_sections, script_add_phdr): Likewise.
9728 (script_check_output_format): New function.
9729 * script.h (read_input_script): Update declaration.
9730 * script-c.h (script_check_output_format): Declare.
9731 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
9732 (ignore_cmd): Remove OUTPUT_FORMAT.
9733 * fileread.cc (Input_file::Input_file): Add explicit this.
9734 (Input_file::will_search_for): New function.
9735 (Input_file::open): Add pindex parameter. Change all callers.
9736 * fileread.h (class Input_file): Add input_file_argument method.
9737 Declare will_search_for. Update declarations.
9738 * object.cc (make_elf_object): Add punconfigured parameter.
9739 Change all callers.
9740 * object.h (class Object): Make input_file public. Add
9741 searched_for method.
9742 (make_elf_object): Update declaration.
9743 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
9744 restart search.
9745 * dirsearch.h (class Dirsearch): Update declaration.
9746 * options.h (class General_options): Add --warn-search-mismatch.
9747 * parameters.cc (Parameters::is_compatible_target): New function.
9748 * parameters.h (class Parameters): Declare is_compatible_target.
9749 * workqueue.cc (Workqueue::add_blocker): New function.
9750 * workqueue.h (class Workqueue): Declare add_blocker.
9751
f1ed28fb
ILT
9752 * fileread.cc (Input_file::open): Remove options parameter.
9753 Change all callers.
9754 (Input_file::open_binary): Likewise.
9755 * script.cc (read_input_script): Likewise.
9756 * readsyms.h (class Read_symbols): Remove options_ field. Remove
9757 options parameter from constructor. Change all callers.
9758 (class Read_script): Likewise.
9759 * fileread.h (class Input_file): Update declarations.
9760 * script.h (read_input_script): Update declaration.
9761
34dd024a
NC
97622009-03-10 Nick Clifton <nickc@redhat.com>
9763
9764 * po/es.po: New Spanish translation.
9765
6d71b17c
CC
97662009-03-06 Cary Coutant <ccoutant@google.com>
9767
9768 * options.cc (parse_short_option): Keep dash_z from registering itself.
9769
031cdbed
ILT
97702009-03-03 Ian Lance Taylor <iant@google.com>
9771
9772 PR 9918
9773 * target-reloc.h (relocate_section): Pass output_section to
9774 relocate.
9775 * i386.cc (Target_i386::should_apply_static_reloc): Add
9776 output_section parameter. Change all callers.
9777 (Target_i386::Relocate::relocate): Add output_section parameter.
9778 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
9779 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
9780 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
9781 * testsuite/two_file_shared.sh: New script.
9782 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
9783 (check_DATA): Add two_file_shared.dbg.
9784 (two_file_shared.dbg): New target.
9785 * testsuite/Makefile.in: Rebuild.
9786
15d5fa16
ILT
97872009-03-01 Ian Lance Taylor <iant@google.com>
9788
9789 * configure.ac: Check for byteswap.h.
9790 * configure: Rebuild.
9791 * config.in: Rebuild.
9792
8a4c0b0d
ILT
97932009-03-01 Mikolaj Zalewski <mikolajz@google.com>
9794
9795 * layout.cc (Layout::find_or_add_kept_section): New function.
9796 (Layout::add_comdat): Removed.
9797 * layout.h (struct Kept_section): Move out of class Layout.
9798 Remove trailing underscores from field names. Add group_sections
9799 field. Rename group_ field to is_group. Change all uses.
9800 (class Layout): Declare find_or_add_kept_section, not add_comdat.
9801 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
9802 comdat_groups_ field.
9803 (Sized_relobj::include_section_group): Use
9804 find_or_add_kept_section and Kept_section::group_sections.
9805 (Sized_relobj::include_linkonce_section): Likewise.
9806 * object.cc (class Sized_relobj): Don't define Comdat_group or
9807 Comdat_group_table. Remove find_comdat_group and
9808 add_comdat_group. Remove comdat_groups_ field.
9809 * plugin.cc (include_comdat_group): Use
9810 Layout::find_or_add_kept_section.
9811
b4ecf66b
ILT
98122009-02-28 Ian Lance Taylor <iant@google.com>
9813
14359ca0
ILT
9814 * README: --gc-sections and map files are now supported. Document
9815 some build requirements.
9816
b4ecf66b
ILT
9817 PR 6992
9818 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
9819 relocatable link set the value of the section symbol to zero.
9820 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
9821 relocatable link don't include the section address in the local
9822 symbol value.
9823
0602e05a
ILT
98242009-02-27 Ian Lance Taylor <iant@google.com>
9825
fd9d194f
ILT
9826 PR 6811
9827 * options.h (class Search_directory): Add is_system_directory.
9828 (class General_options): Declare is_in_system_directory.
9829 * options.cc (get_relative_sysroot): Make static.
9830 (get_default_sysroot): Make static.
9831 (General_optoins::is_in_system_directory): New function.
9832 * fileread.cc (Input_file::is_in_system_directory): New function.
9833 * fileread.h (class Input_file): Declare is_in_system_directory.
9834 * object.h (class Object): Add is_in_system_directory.
9835 (class Input_objects): Remove system_library_directory_ field.
9836 * object.cc (Input_objects::add_object): Don't set
9837 system_library_directory_.
9838 (input_objects::found_in_system_library_directory): Remove.
9839 * symtab.cc (Symbol_table::write_globals): Remove input_objects
9840 parameter. Change all callers.
9841 (Symbol_table::sized_write_globals): Likewise.
9842 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
9843 Call Object::is_in_system_directory.
9844 * symtab.h (class Symbol_table): Update declarations.
9845
61edd21f
ILT
9846 PR 5990
9847 * descriptors.h (Open_descriptor): Add is_on_stack field.
9848 * descriptors.cc (Descriptors::open): If the descriptor is on the
9849 top of the stack, remove it. Initialize is_on_stack field.
9850 (Descriptors::release): Only add pod to stack if it is not on the
9851 stack already.
9852 (Descriptors::close_some_descriptor): Clear stack_next and
9853 is_on_stack fields.
9854
e29e076a
ILT
9855 PR 7091
9856 * output.cc (Output_section::find_starting_output_address): Rename
9857 from starting_output_address; add PADDR parameter; change return
9858 type.
9859 * output.h (class Output_section): Declare
9860 find_starting_output_address instead of starting_output_address.
9861 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
9862 section symbol for which we can't find a merge section.
9863
0602e05a
ILT
9864 PR 9836
9865 * symtab.cc (Symbol_table::add_from_object): If the visibility is
9866 hidden or internal, force the symbol to be local.
9867 * resolve.cc (Symbol::override_visibility): Define.
9868 (Symbol::override_base): Use override_visibility.
9869 (Symbol_table::resolve): Likewise.
9870 (Symbol::override_base_with_special): Likewise.
9871 (Symbol_table::override_with_special): If the visibility is hidden
9872 or internal, force the symbol to be local.
9873 * symtab.h (class Symbol): Add set_visibility and
9874 override_visibility.
9875 * testsuite/ver_test_1.sh: New file.
9876 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
9877 (check_DATA): Add ver_test_1.syms.
9878 (ver_test_1.syms): New target.
9879 * testsuite/Makefile.in: Rebuild.
9880
401a9a73
CC
98812009-02-25 Cary Coutant <ccoutant@google.com>
9882
9883 * layout.cc (Layout::choose_output_section): Don't rename sections
9884 when using a linker script that has a SECTIONS clause.
9885 * Makefile.in: Regenerate.
9886
9887 * testsuite/Makefile.am (script_test_5.sh): New test case.
9888 * testsuite/Makefile.in: Regenerate.
9889 * testsuite/script_test_5.cc: New file.
9890 * testsuite/script_test_5.sh: New file.
9891 * testsuite/script_test_5.t: New file.
9892
f488e4b0
CC
98932009-02-13 Rafael Avila de Espindola <espindola@google.com>
9894
9895 * archive.cc (Archive::include_member): Update calls to add_symbols.
9896 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
9897 the Layout argument.
9898 * dynobj.h (do_add_symbols): Add the Layout argument.
9899 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
9900 Layout argument.
9901 * object.h (Object::add_symbols): Add the Layout argument.
9902 (Object::do_add_symbols): Add the Layout argument.
9903 (Sized_relobj::do_add_symbols): Add the Layout argument.
9904 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
9905 Unify the two versions.
9906 (Add_plugin_symbols): Remove.
9907 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
9908 (Sized_pluginobj::do_add_symbols): Unify the two versions.
9909 (Add_plugin_symbols): Remove.
9910 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
9911 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
9912 (Add_symbols::run): Make it work with Pulginobj.
9913
89dd1680
ILT
99142009-02-06 Ian Lance Taylor <iant@google.com>
9915
9916 * object.cc (Sized_relobj::do_layout): Make info message start
9917 with lower case letter.
9918
266d0a74
ILT
99192009-02-06 Mikolaj Zalewski <mikolajz@google.com>
9920
602b464e
ILT
9921 * binary.cc: Fix file comment.
9922
266d0a74
ILT
9923 * options.h (enum Incremental_disposition): Define.
9924 (class General_options): Add new options: --incremental,
9925 --incremental_changed, --incremental_unchanged,
9926 --incremental_unknown. Add incremental_disposition_ and
9927 implicit_incremental_ fields.
9928 (General_options::incremental_disposition): New function.
9929 (class Position_dependent_options): Add incremental_disposition
9930 option.
9931 (Position_dependent_options::copy_from_options): Set incremental
9932 dispositions.
9933 * options.cc (General_options::parse_incremental_changed): New
9934 function.
9935 (General_options::parse_incremental_unchanged): New function.
9936 (General_options::parse_incremental_unknown): New function.
9937 (General_options::General_options): Initialize new fields
9938 incremental_disposition_ and implicit_incremental_.
9939 (General_options::finalize): Check for uasge of --incremental-*
9940 without --incremental.
9941
f073bbf7
CD
99422009-02-06 Chris Demetriou <cgd@google.com>
9943
9944 * gold.h (gold_undefined_symbol): Change to take only a Symbol
9945 pointer and to report location as the file name associated with
9946 the symbol.
9947 (gold_undefined_symbol_at_location): New function to replace the
9948 old gold_undefined_symbol functionality.
9949 * target-reloc.h (relocate_section): Update to use
9950 gold_undefined_symbol_at_location.
9951 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
9952 Call gold_undefined_symbol function rather than gold_error.
9953 * errors.h (Errors::undefined_symbol): Take location as a
9954 string, rather than calculating it from a relocation.
9955 * errors.cc (Errors::fatal): Print "fatal error:" before the
9956 formatted message.
9957 (Errors::error, Errors::error_at_location): Print "error: "
9958 before the formatted message.
9959 (Errors::undefined_symbol): Take location as a string, rather
9960 than calculating it from a relocation.
9961 (gold_undefined_symbol_at_location): New function akin to
9962 old gold_undefined_symbol, calculates location from relocation.
9963 (gold_undefined_symbol): Change to take only a Symbol pointer
9964 and to report location as the file name associated with the symbol.
9965 * testsuite/debug_msg.sh: Update for changed error messages.
9966 * testsuite/undef_symbol.sh: Likewise.
9967
8e94a90c
ILT
99682009-02-04 Duncan Sands <baldrick@free.fr>
9969
9970 PR 9812
9971 * reduced_debug_output.h
9972 (Output_reduced_debug_abbrev_section::failed): Use format for
9973 gold_warning.
9974 (Output_reduced_debug_info_section::faild): Likewise.
9975
88a0e15b
ILT
99762009-01-31 Mikolaj Zalewski <mikolajz@google.com>
9977
9978 * script.cc (Lazy_demangler): New class.
9979 (Version_script_info::get_symbol_version_helper): Demangle a
9980 symbol only once.
9981
5efc7cd2
CC
99822009-01-29 Cary Coutant <ccoutant@google.com>
9983
9984 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
9985 to __tls_get_addr.
9986 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
9987
e0ebcf42
ILT
99882009-01-28 Ian Lance Taylor <iant@google.com>
9989
5efc7cd2 9990 * version.cc (version_string): Bump to 1.9.
75fe7426 9991
e0ebcf42
ILT
9992 * gold.h: Include <cstring> and <stdint.h>.
9993 * version.cc: Include <cstdio>.
9994 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
9995 warning.
9996 * reduced_debug_output.cc (insert_into_vector): Rename from
9997 Insert_into_vector; change all callers. Use Swap_unaligned to
9998 avoid aliasing issue; remove union since it is unnecessary.
9999
8e2813be 100002009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
10001
10002 * Makefile.am (CCFILES): Add gc.cc.
10003 (HFILES): Add gc.h.
10004 * Makefile.in: Regenerate.
10005 * gold.cc (Gc_runner): New class.
10006 (queue_initial_tasks): Call garbage collection related tasks
10007 when corresponding options are invoked.
10008 (queue_middle_gc_tasks): New function.
10009 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
10010 processed early before laying out sections during garbage collection.
10011 * gold.h (queue_middle_gc_tasks): New function.
10012 (is_prefix_of): Move from "layout.cc".
10013 * i386.cc (Target_i386::gc_process_relocs): New function.
10014 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
10015 * main.cc (main): Create object of class "Garbage_collection".
10016 * object.cc (Relobj::copy_symbols_data): New function.
10017 (Relobj::is_section_name_included): New function.
e1df38aa
NC
10018 (Sized_relobj::do_layout): Allow this function to be called twice
10019 during garbage collection and defer layout of section during the
6d03d481
ST
10020 first call.
10021 * object.h (Relobj::get_symbols_data): New function.
10022 (Relobj::is_section_name_included): New function.
10023 (Relobj::copy_symbols_data): New function.
10024 (Relobj::set_symbols_data): New function.
10025 (Relobj::get_relocs_data): New function.
10026 (Relobj::set_relocs_data): New function.
10027 (Relobj::is_output_section_offset_invalid): New pure virtual function.
10028 (Relobj::gc_process_relocs): New function.
10029 (Relobj::do_gc_process_relocs): New pure virtual function.
10030 (Relobj::sd_): New data member.
10031 (Sized_relobj::is_output_section_offset_invalid): New function.
10032 (Sized_relobj::do_gc_process_relocs): New function.
10033 * options.h (General_options::gc_sections): Modify to not be a no-op.
10034 (General_options::print_gc_sections): New option.
10035 * plugin.cc (Plugin_finish::run): Remove function call to
10036 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
10037 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
10038 * reloc.cc (Read_relocs::run): Add task to process relocs and
10039 determine unreferenced sections when doing garbage collection.
10040 (Gc_process_relocs): New class.
10041 (Sized_relobj::do_gc_process_relocs): New function.
10042 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
10043 sections that are garbage collected.
10044 * reloc.h (Gc_process_relocs): New class.
10045 * sparc.cc (Target_sparc::gc_process_relocs): New function.
10046 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
10047 symbols whose corresponding sections are garbage collected.
10048 (Symbol_table::Symbol_table): Add new parameter for the garbage
10049 collection object.
10050 (Symbol_table::gc_mark_undef_symbols): New function.
10051 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10052 (Symbol_table::gc_mark_dyn_syms): New function.
10053 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
10054 as garbage.
10055 (Symbol_table::add_from_object): Likewise.
10056 (Symbol_table::add_from_relobj): When building shared objects, do not
10057 treat externally visible symbols as garbage.
10058 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
10059 table information for static and relocatable links.
10060 * symtab.h (Symbol_table::set_gc): New function.
10061 (Symbol_table::gc): New function.
10062 (Symbol_table::gc_mark_undef_symbols): New function.
10063 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10064 (Symbol_table::gc_mark_dyn_syms): New function.
10065 (Symbol_table::gc_): New data member.
e1df38aa 10066 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
10067 function.
10068 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
10069 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
10070
3b293544
CF
100712009-01-20 Chris Faylor <me.sourceware@sourceware.org>
10072
10073 * options.h (General_options::gc_sections): Define as a no-op for now.
10074 (General_options::no_keep_memory): Ditto.
10075 (General_options::Bshareable): Define.
10076 * options.cc (General_options::finalize): Honor -Bshareable.
10077
83d22aa8
AS
100782009-01-20 Andreas Schwab <schwab@suse.de>
10079
10080 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
10081 read the value in the contents, since we don't use it. Use the
10082 template endianness when writing.
10083 (Relocate::relocate): Use it for R_PPC_REL16_HA.
10084
cd536b21
AS
100852009-01-19 Andreas Schwab <schwab@suse.de>
10086
10087 * configure.tgt (powerpc64-*): Fix targ_obj.
10088
99e9a495
ILT
100892009-01-15 Ian Lance Taylor <iant@google.com>
10090
10091 * object.cc (Sized_relobj::write_local_symbols): Don't write out
10092 local symbols when stripping all symbols.
10093
bbbfea06
CC
100942009-01-14 Cary Coutant <ccoutant@google.com>
10095
99e9a495 10096 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 10097
0f7c0701
CC
100982009-01-14 Cary Coutant <ccoutant@google.com>
10099
10100 * archive.cc (Archive::get_elf_object_for_member): Remove call
10101 to File_read::claim_for_plugin.
10102 * descriptors.cc (Descriptors::open): Remove reference to
10103 is_claimed.
10104 (Descriptors::claim_for_plugin): Remove.
10105 * descriptors.h (Descriptors::claim_for_plugin): Remove.
10106 (Descriptors::is_claimed): Remove.
10107 (claim_descriptor_for_plugin): Remove.
10108 * fileread.cc (File_read::claim_for_plugin): Remove.
10109 * fileread.h (File_read::claim_for_plugin): Remove.
10110 (File_read::descriptor): Reopen descriptor if necessary.
10111 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
10112 (Plugin_manager::all_symbols_read): Add task parameter. Change
10113 all callers.
10114 (Plugin_manager::get_input_file): New function.
10115 (Plugin_manager::release_input_file): New function.
10116 (Pluginobj::Pluginobj): Add filesize parameter and initialize
10117 corresponding data member.
10118 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
10119 and pass to base constructor. Change all callers.
10120 (get_input_file, release_input_file): New functions.
10121 (make_sized_plugin_object): Add filesize parameter. Change all callers.
10122 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
10123 (Plugin_manager::all_symbols_read): Add task parameter.
10124 (Plugin_manager::get_input_file): New function.
10125 (Plugin_manager::release_input_file): New function.
10126 (Plugin_manager::task_): New data member.
10127 (Pluginobj::Pluginobj): Add filesize parameter.
10128 (Pluginobj::filename): New function.
10129 (Pluginobj::descriptor): New function.
10130 (Pluginobj::filesize): New function.
10131 (Pluginobj::filesize_): New data member.
10132 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
10133 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
10134 File_read::claim_for_plugin; use Object::unlock to unlock the file.
10135
10136 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
10137 with archive libraries.
10138 * testsuite/Makefile.in: Regenerate.
10139 * testsuite/plugin_test.c (struct sym_info): New type.
10140 (get_input_file, release_input_file): New static variables.
10141 (onload): Capture new transfer vector entries.
10142 (claim_file_hook): Stop reading at end of file according to filesize.
10143 Factor out parsing of readelf output into separate function.
10144 (all_symbols_read_hook): Exercise get_input_file and release_input_file
10145 APIs and get the source file name from the symbol table. Convert
10146 source file name to corresponding object file name. Print info
10147 message when adding new input files.
10148 (parse_readelf_line): New function.
10149 * testsuite/plugin_test_1.sh: Add checks for new info messages.
10150 * testsuite/plugin_test_2.sh: Likewise.
10151 * testsuite/plugin_test_3.sh: Likewise.
10152 * testsuite/plugin_test_4.sh: New test case.
10153
62a6d109
ILT
101542009-01-07 Ian Lance Taylor <iant@google.com>
10155
10156 * version.cc (version_string): Bump to 1.8.
10157
483620e8
CC
101582008-12-23 Cary Coutant <ccoutant@google.com>
10159
10160 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
10161 * plugin.cc (Plugin_manager::finish): Rename as
10162 layout_deferred_objects. Move cleanup to separate function.
10163 (Plugin_manager::cleanup): New function.
10164 (Plugin_finish::run): Call layout_deferred_objects and cleanup
10165 separately.
10166 * plugin.h (Plugin_manager::finish): Rename as
10167 layout_deferred_objects.
10168 (Plugin_manager::cleanup): New function.
10169 (Plugin_manager::cleanup_done): New field.
10170
d66a9eb3
CC
101712008-12-23 Cary Coutant <ccoutant@google.com>
10172
10173 * plugin.cc (is_visible_from_outside): New function.
10174 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
10175 so we don't return "IR only" status for exported symbols or -r links.
10176
10177 * testsuite/Makefile.am (plugin_test_3): New test case.
10178 * testsuite/Makefile.in: Regenerate.
10179 * testsuite/plugin_test_3.sh: New file.
10180
5995b570
CC
101812008-12-22 Cary Coutant <ccoutant@google.com>
10182
10183 * object.cc (Sized_relobj::layout_section): New function.
10184 (Sized_relobj::do_layout): Defer layout of input sections until after
10185 plugin has provided replacement files.
10186 (Sized_relobj::do_layout_deferred_sections): New function.
10187 * object.h (Relobj::set_section_offset): Remove virtual keyword.
10188 (Relobj::layout_deferred_sections): New function.
10189 (Relobj::do_layout_deferred_sections): New function.
10190 (Sized_relobj::do_layout_deferred_sections): New function.
10191 (Sized_relobj::layout_section): New function.
10192 (Sized_relobj::Deferred_layout): New structure.
10193 (Sized_relobj::deferred_layout_): New field.
10194 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
10195 Change all callers. Layout deferred sections.
10196 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
10197 references.
10198 (Plugin_hook::run): Move code from do_plugin_hook inline.
10199 (Plugin_hook::do_plugin_hook): Remove.
10200 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
10201 (Plugin_manager::finish): Renamed, was cleanup.
10202 (Plugin_manager::should_defer_layout): New function.
10203 (Plugin_manager::add_deferred_layout_object): New function.
10204 (Plugin_manager::Deferred_layout_list): New type.
10205 (Plugin_manager::deferred_layout_objects_): New field.
10206 (Plugin_hook::do_plugin_hook): Remove.
10207
ee769c88
ILT
102082008-12-17 Ian Lance Taylor <iant@google.com>
10209
10210 * options.h (class General_options): Add --no case for
10211 --export-dynamic.
10212
abc8dcba
CC
102132008-12-16 Cary Coutant <ccoutant@google.com>
10214
10215 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
10216 vector.
10217 (Plugin_manager::claim_file): Create plugin object even if
10218 plugin did not call the add_symbols callback.
10219 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
10220 asking for more symbols than were added.
10221 * testsuite/Makefile.am (plugin_test_1): Add test case with
10222 no global symbols.
10223 (empty.syms): New target.
10224 * testsuite/Makefile.in: Regenerate.
10225 * testsuite/plugin_test.c (claim_file_hook): Add new debug
10226 message. Don't call add_symbols if no globals.
10227 (all_symbols_read_hook): Don't provide replacement for empty
10228 claimed file.
10229
b0074644
ILT
102302008-12-12 Ian Lance Taylor <iant@google.com>
10231
68943102
ILT
10232 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
10233 r_type == 0 for a local symbol with r_sym == 0.
10234 (scan_relocatable_relocs): Pass r_sym to
10235 local_non_section_strategy.
10236 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
10237 r_sym parameter.
10238
b0074644
ILT
10239 * configure.ac: Update test for TLS descriptors: they are
10240 supported as of glibc 2.9.
10241 * configure: Rebuild.
10242
c2508178
ILT
102432008-12-11 Ian Lance Taylor <iant@google.com>
10244
10245 PR 7091
10246 * target-reloc.h (Default_scan_relocatable_relocs): For each
10247 function, map r_type == 0 to RELOC_DISCARD.
10248
2756a258
CC
102492008-12-10 Cary Coutant <ccoutant@google.com>
10250
10251 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
10252 object to override a kept COMDAT group from a plugin object.
10253
bb6f53d3
ILT
102542008-12-09 Ian Lance Taylor <iant@google.com>
10255
fbc558e1
ILT
10256 PR 7088
10257 * yyscript.y (file_cmd): Handle INPUT.
10258
bb6f53d3
ILT
10259 * testsuite/initpri1.c: Change all declarations to be full
10260 prototypes by adding void, to avoid compiler warnings.
10261
4674ecfc
CC
102622008-12-05 Rafael Avila de Espindola <espindola@google.com>
10263
10264 * options.cc (General_options::parse_plugin_opt): New.
10265 (General_options::add_plugin): The argument now is just the filename.
10266 (General_options::add_plugin_option): New.
10267 * options.h (plugin_opt): New.
10268 (add_plugin): Change argument name.
10269 (add_plugin_option): New.
10270 * plugin.cc (Plugin::load): Don't parse the plugin option.
10271 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
10272 (Plugin::add_option): New.
10273 (Plugin::args_): Change type.
10274 (Plugin::filename_): New.
10275 (Plugin_manager::add_plugin_option): New.
10276 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
10277 * testsuite/Makefile.in: Regenerate.
10278
fd06b4aa
CC
102792008-12-05 Cary Coutant <ccoutant@google.com>
10280
10281 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
10282 Handle --strip-lto-sections option.
10283 * options.h (strip_lto_sections): New option.
10284
6c52134c
CC
102852008-12-01 Cary Coutant <ccoutant@google.com>
10286
10287 * plugin.cc (ld_plugin_message): Change format parameter to const.
10288 Fix mismatch between new[] and delete.
10289
a45248e0
CC
102902008-11-14 Cary Coutant <ccoutant@google.com>
10291
10292 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
10293 instead of -1U.
10294
c82fbeee
CS
102952008-11-05 Craig Silverstein <csilvers@google.com>
10296
10297 * options.cc (General_options::parse_dynamic_list): New function.
10298 * options.h (General_options): New flags dynamic_list,
10299 dynamic_list_data, dynamic_list_cpp_new, and
10300 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
10301 (General_options::in_dynamic_list): New function.
10302 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
10303 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
10304 (Lex::can_continue_name): Likewise.
10305 (yylex): Likewise.
10306 (read_script_file): New parameter script_options.
10307 (read_dynamic_list): New function.
10308 (Script_options::define_dynamic_list): New function.
10309 (dynamic_list_keyword_parsecodes): New variable.
10310 (dynamic_list_keywords): New variable.
10311 * script.h (Script_options::define_dynamic_list): New function
10312 prototype.
10313 (read_dynamic_list): New function prototype.
10314 * symtab.cc (strprefix): New macro.
10315 (Symbol::should_add_dynsym_entry): Support dynamic_list,
10316 dynamic_list_data, dynamic_list_cpp_new, and
10317 dynamic_list_cpp_typeinfo.
10318 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
10319 (dynamic_list_expr): New rule.
10320 (dynamic_list_nodes): Likewise.
10321 (dynamic_list_node): Likewise.
10322 * testsuite/Makefile.am (dynamic_list): New test.
10323 * testsuite/Makefile.in: Regenerated.
10324 * testsuite/dynamic_list.t: New file.
10325 * testsuite/dynamic_list.sh: New file.
10326
e0bb29a5
CS
103272008-11-05 Craig Silverstein <csilvers@google.com>
10328
10329 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
10330 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
10331 (t11_last): Likewise.
10332 * testsuite/ver_test_6.c (main): Likewise.
10333
4e1e25e0
CC
103342008-10-07 Cary Coutant <ccoutant@google.com>
10335
10336 * options.c (General_options::finalize): Add check for -static and
10337 -shared.
10338 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
10339 is not empty.
10340
92f03fcb
CC
103412008-10-02 Cary Coutant <ccoutant@google.com>
10342
10343 * plugin.cc (make_sized_plugin_object): Fix conditional
10344 compilation to work when not all targets are enabled.
10345
fbd8a257
CC
103462008-09-29 Cary Coutant <ccoutant@google.com>
10347
10348 * archive.cc (Archive::get_file_and_offset): Use filename instead
10349 of name to get library path.
10350 (Archive::include_member): Unlock external member of a thin archive.
10351
10352 * testsuite/Makefile.am (TEST_AR): New variable.
10353 (thin_archive_test_1): New test.
10354 (thin_archive_test_2): New test.
81636b3f
CC
10355 * testsuite/Makefile.in: Regenerate.
10356 * testsuite/thin_archive_main.cc: New file.
10357 * testsuite/thin_archive_test_1.cc: New file.
10358 * testsuite/thin_archive_test_2.cc: New file.
10359 * testsuite/thin_archive_test_3.cc: New file.
10360 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 10361
eff45813
CC
103622008-09-29 Cary Coutant <ccoutant@google.com>
10363
10364 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
10365 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
10366 instead of -1U.
10367 (Sized_relobj::do_finalize_local_symbols): Likewise.
10368 (Sized_relobj::map_to_kept_section): Likewise.
10369 * object.h (Sized_relobj::invalid_address): New constant.
10370 (Sized_relobj::do_output_section_offset): Check for invalid_address
10371 and return -1ULL.
10372 * output.cc (Output_reloc::local_section_offset): Use constant
10373 invalid_address instead of -1U.
10374 (Output_reloc::get_address): Likewise.
10375 (Output_section::output_address): Change -1U to -1ULL.
10376 * output.h (Output_reloc::invalid_address): New constant.
10377 * reloc.cc (Sized_relobj::write_sections): Use constant
10378 invalid_address instead of -1U.
10379 (Sized_relobj::relocate_sections): Likewise.
10380 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
10381 values for merge sections.
10382 * target-reloc.h (relocate_for_relocatable): Use constant
10383 invalid_address instead of -1U.
10384
89fc3421
CC
103852008-09-19 Cary Coutant <ccoutant@google.com>
10386
10387 Add plugin functionality for link-time optimization (LTO).
10388 * configure.ac (plugins): Add --enable-plugins option.
10389 * configure: Regenerate.
10390 * config.in: Regenerate.
10391 * Makefile.am (LIBDL): New variable.
10392 (CCFILES): Add plugin.cc.
10393 (HFILES): Add plugin.h.
10394 (ldadd_var): Add LIBDL.
10395 * Makefile.in: Regenerate.
10396
10397 * archive.cc: Include "plugin.h".
10398 (Archive::setup): Don't preread archive symbols when using a plugin.
10399 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
10400 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
10401 files.
10402 (Archive::include_member): Add symbols from plugin objects.
10403 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
10404 * descriptors.cc (Descriptors::open): Check for file descriptors
10405 abandoned by plugins.
10406 (Descriptors::claim_for_plugin): New function.
10407 * descriptors.h (Descriptors::claim_for_plugin): New function.
10408 (Open_descriptor::is_claimed): New field.
10409 (claim_descriptor_for_plugin): New function.
10410 * fileread.cc (File_read::claim_for_plugin): New function.
10411 * fileread.h (File_read::claim_for_plugin): New function.
10412 (File_read::descriptor): New function.
10413 * gold.cc: Include "plugin.h".
10414 (queue_initial_tasks): Add task to call plugin hooks for generating
10415 new object files.
10416 * main.cc: Include "plugin.h".
10417 (main): Load plugin libraries.
10418 * object.h (Pluginobj): Declare.
10419 (Object::pluginobj): New function.
10420 (Object::do_pluginobj): New function.
10421 (Object::set_target): New function.
10422 * options.cc: Include "plugin.h".
10423 (General_options::parse_plugin): New function.
10424 (General_options::General_options): Initialize plugins_ field.
10425 (General_options::add_plugin): New function.
10426 * options.h (Plugin_manager): Declare.
10427 (General_options): Add --plugin option.
10428 (General_options::has_plugins): New function.
10429 (General_options::plugins): New function.
10430 (General_options::add_plugin): New function.
10431 (General_options::plugins_): New field.
10432 * plugin.cc: New file.
10433 * plugin.h: New file.
10434 * readsyms.cc: Include "plugin.h".
10435 (Read_symbols::do_read_symbols): Check for archive before checking
10436 for ELF file. Call plugin hooks to claim files.
10437 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
10438 from a real object file; force override when processing replacement
10439 files.
10440 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
10441 (Symbol::init_base_object): Likewise.
10442 (Symbol::init_base_output_data): Likewise.
10443 (Symbol::init_base_output_segment): Likewise.
10444 (Symbol::init_base_constant): Likewise.
10445 (Symbol::init_base_undefined): Likewise.
10446 (Symbol::output_section): Assert that object is not a plugin.
10447 (Symbol_table::add_from_pluginobj): New function.
10448 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
10449 undefined.
10450 (Symbol_table::sized_write_globals): Likewise.
10451 (Symbol_table::add_from_pluginobj): Instantiate template.
10452 * symtab.h (Sized_pluginobj): Declare.
10453 (Symbol::in_real_elf): New function.
10454 (Symbol::set_in_real_elf): New function.
10455 (Symbol::in_real_elf_): New field.
10456 (Symbol_table::add_from_pluginobj): New function.
10457
10458 * testsuite/Makefile.am (AM_CFLAGS): New variable.
10459 (LIBDL): New variable.
10460 (LDADD): Add LIBDL.
10461 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
10462 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
10463 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
10464 (MOSTLYCLEANFILES): Likewise.
10465 * testsuite/Makefile.in: Regenerate.
10466 * testsuite/plugin_test.c: New file.
10467 * testsuite/plugin_test_1.sh: New file.
10468 * testsuite/plugin_test_2.sh: New file.
10469
de31bda5
ILT
104702008-09-16 Ian Lance Taylor <iant@google.com>
10471
9c2d0ef9
ILT
10472 * target-reloc.h (relocate_section): Check whether a symbol is
10473 defined by the ABI before reporting an undefined symbol error.
10474 * target.h (Target::is_defined_by_abi): Make parameter const.
10475 (Target::do_is_defined_by_abi): Likewise.
10476 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
10477 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
10478 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
10479 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
10480 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
10481 * testsuite/Makefile.in: Rebuild.
10482
de31bda5
ILT
10483 * fileread.cc (make_view): Add casts to avoid warning.
10484
9fa33bee
AO
104852008-09-16 Alexandre Oliva <aoliva@redhat.com>
10486
10487 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
10488 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
10489
183fd0e3
AO
104902008-09-16 Alexandre Oliva <aoliva@redhat.com>
10491
10492 * options.h (General_options::output_is_executable): New.
10493 (General_options::output_is_pie): New.
10494 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
10495 for shared libraries.
10496 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
10497
7be8330a
CD
104982008-09-11 Chris Demetriou <cgd@google.com>
10499
10500 * options.h (origin): New -z option.
10501 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
10502 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
10503 in DT_FLAGS_1.
10504
a9caad02
CC
105052008-09-05 Cary Coutant <ccoutant@google.com>
10506
10507 * fileread.cc (File_read::make_view): Add check for attempt to map
10508 beyond end of file.
10509
ae6dce4d
CC
105102008-09-05 Cary Coutant <ccoutant@google.com>
10511
10512 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
10513 explicit instantiations.
10514
d7ab2a47
KVH
105152008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
10516
10517 PR gold/6858
10518 * options.cc (General_options::finalize): Allow undefined symbols
10519 in shlibs if linking -shared.
10520
10521 PR gold/6859
10522 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
10523 symbols as not needing a dynsym entry.
10524
1e52a9c1
CS
105252008-08-20 Craig Silverstein <csilvers@google.com>
10526
10527 * fileread.cc (File_read::open): Do not lock the file unless it
10528 was successfully opened.
10529
d85c80a3
CC
105302008-08-14 Cary Coutant <ccoutant@google.com>
10531
10532 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
10533 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
10534 * testsuite/tls_test.cc (struct int128): 128-bit struct
10535 for testing TLS relocs with non-zero addend.
10536 (v12): New TLS variable.
10537 (t12): New test.
10538 (t_last): Add check for v12.
10539 * testsuite/tls_test.h (t12): New function.
10540 * testsuite/tls_test_main.cc (thread_routine): Call new test.
10541
2d924fd9
ILT
105422008-08-13 Ian Lance Taylor <iant@google.com>
10543
10544 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
10545 set tls_segment_ or relro_segment_.
10546 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
10547 when appropriate.
10548 * output.h (Output_section::clear_is_relro): New function.
10549 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
10550 sections specially even when output_data_ is empty.
10551 (Output_segment::maximum_alignment): When first section is relro,
10552 only force alignment for PT_LOAD segments.
10553 * script.cc (script_data_segment_align): New function.
10554 (script_data_segment_relro_end): New function.
10555 * script-c.h (script_data_segment_align): Declare.
10556 (script_data_segment_relro_end): Declare.
10557 * script-sections.h (class Script_sections): Declare
10558 data_segment_align and data_segment_relro_end. Add fields
10559 segment_align_index_ and saw_relro_end_.
10560 * script-sections.cc (class Sections_element): Add set_is_relro
10561 virtual function. Add new bool* parameter to place_orphan_here.
10562 Add get_output_section virtual function.
10563 (class Output_section_definition): Add set_is_relro. Add new
10564 bool* parameter to place_orphan_here. Add get_output_section.
10565 Add is_relro_ field.
10566 (Output_section_definition::Output_section_definition): Initialize
10567 evaluated_address_, evaluated_load_address, evaluated_addralign_,
10568 and is_relro_ fields.
10569 (Output_section_definition::place_orphan_here): Add is_relro
10570 parameter.
10571 (Output_section_definition::set_section_addresses): Set relro for
10572 output section.
10573 (Output_section_definition::alternate_constraint): Likewise.
10574 (class Orphan_output_section): Add new bool* parameter to
10575 place_orphan_here. Add get_output_section.
10576 (Orphan_output_section::place_orphan_here): Add is_relro
10577 parameter.
10578 (Script_sections::Script_sections): Initialize
10579 data_segment_align_index_ and saw_relro_end_.
10580 (Script_sections::data_segment_align): New function.
10581 (Script_sections::data_segment_relro_end): New function.
10582 (Script_sections::place_orphan): Set or clear is_relro.
10583 (Script_sections::set_section_addresses): Force alignment of first
10584 TLS section.
10585 * yyscript.y (exp): Call script_data_segment_align and
10586 script_data_segment_relro_end.
10587 * testsuite/relro_script_test.t: New file.
10588 * testsuite/relro_test.cc (using_script): Declare.
10589 (t1, t2): Test using_script.
10590 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
10591 (relro_script_test_SOURCES): Define.
10592 (relro_script_test_DEPENDENCIES): Define.
10593 (relro_script_test_LDFLAGS): Define.
10594 (relro_script_test_LDADD): Define.
10595 (relro_script_test.so): New target.
10596 * testsuite/Makefile.in: Rebuild.
10597
f827c9a9
CC
105982008-08-06 Cary Coutant <ccoutant@google.com>
10599
10600 * archive.cc (Archive::total_archives, Archive::total_members)
10601 (Archive::total_members_loaded): New variables.
10602 (Archive::setup): Add parameter. Add option to preread
10603 archive symbols.
10604 (Archive::read_armap): Add counter.
10605 (Archive::get_file_and_offset): New function.
10606 (Archive::get_elf_object_for_member): New function.
10607 (Archive::read_all_symbols): New function.
10608 (Archive::read_symbols): New function.
10609 (Archive::add_symbols): Add counters.
10610 (Archive::include_all_members): Use armap to find members if it's
10611 already built.
10612 (Archive::include_member): Skip reading symbols if already read.
10613 Factored code into Archive::get_file_and_offset and
10614 Archive::get_elf_object_for_member. Changed call to
10615 Mapfile::report_include_archive_member.
10616 (Archive::print_stats): New function.
10617 * archive.h: Declare Object and Read_symbols_data classes.
10618 (Archive::Archive): Add initializers for new members.
10619 (Archive::setup): Add parameter.
10620 (Archive::print_stats): New function.
10621 (Archive::total_archives, Archive::total_members)
10622 (Archive::total_members_loaded): New variables.
10623 (Archive::get_file_and_offset): New function.
10624 (Archive::get_elf_object_for_member): New function.
10625 (Archive::read_all_symbols): New function.
10626 (Archive::read_symbols): New function.
10627 (Archive::Archive_member): New class.
10628 (Archive::members_): New member.
10629 (Archive::num_members_): New member.
10630 * main.cc: Include archive.h.
10631 (main): Call Archive::print_stats.
10632 * mapfile.cc (Mapfile::report_include_archive_member): Delete
10633 archive parameter; member_name is now the fully-decorated name.
10634 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
10635 * options.h: (General_options): Add --preread-archive-symbols option.
10636 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
10637 Archive::setup.
10638
de4c45bd
ILT
106392008-08-04 Ian Lance Taylor <iant@google.com>
10640
10641 * symtab.h (Symbol::use_plt_offset): New function.
10642 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
10643 * powerpc.cc (Relocate::relocate): Likewise.
10644 * sparc.cc (Relocate::relocate): Likewise.
10645 * x86_64.cc (Relocate::relocate): Likewise.
10646 * testsuite/weak_plt.sh: New test.
10647 * testsuite/weak_plt_main.cc: New test.
10648 * testsuite/weak_plt_shared.cc: New test.
10649 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
10650 (check_PROGRAMS): Add weak_plt.
10651 (check_DATA): Add weak_plt_shared.so.
10652 (weak_plt_main_pic.o, weak_plt): New targets.
10653 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
10654 * testsuite/Makefile.in: Rebuild.
10655
10656 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
10657 gcctestdir/ld.
10658 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
10659 * testsuite/Makefile.in: Rebuild.
10660
323ee3f4
AM
106612008-08-04 Alan Modra <amodra@bigpond.net.au>
10662
10663 * Makefile.am (POTFILES.in): Set LC_ALL=C.
10664 * Makefile.in: Regenerate.
10665 * po/POTFILES.in: Regenerate.
10666
7c07ecec
ILT
106672008-07-29 Ian Lance Taylor <iant@google.com>
10668
10669 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
10670 symbols before other symbols.
10671 * testsuite/script_test_2.cc (test_addr): Declare.
10672 (test_addr_alias): Declare.
10673 (main): Check that test_addr and test_addr_alias have the right
cd536b21 10674 values.
7c07ecec
ILT
10675 * testsuite/script_test_2.t: Define test_addr_alias and
10676 test_addr.
10677
5778530e
ILT
106782008-07-24 Ian Lance Taylor <iant@google.com>
10679
2a00e4fb
ILT
10680 PR 5990
10681 * descriptors.cc: New file.
10682 * descriptors.h: New file.
10683 * gold-threads.h (class Hold_optional_lock): New class.
10684 * fileread.cc: Include "descriptors.h".
10685 (File_read::~File_read): Release descriptor rather than closing
10686 it.
10687 (File_read::open) [file]: Call open_descriptor rather than open.
10688 Set is_descriptor_opened_.
10689 (File_read::open) [memory]: Assert that descriptor is not open.
10690 (File_read::reopen_descriptor): New function.
10691 (File_read::release): Release descriptor.
10692 (File_read::do_read): Make non-const. Reopen descriptor.
10693 (File_read::read): Make non-const.
10694 (File_read::make_view): Reopen descriptor.
10695 (File_read::do_readv): Likewise.
10696 * fileread.h (class File_read): Add is_descriptor_opened_ field.
10697 Update declarations.
10698 * layout.cc: Include "descriptors.h".
10699 (Layout::create_build_id): Use open_descriptor rather than open.
10700 * output.cc: Include "descriptors.h".
10701 (Output_file::open): Use open_descriptor rather than open.
10702 * archive.cc (Archive::const_iterator): Change Archive to be
10703 non-const.
10704 (Archive::begin, Archive::end): Make non-const.
10705 (Archive::count_members): Likewise.
10706 * archive.h (class Archive): Update declarations.
10707 * object.h (Object::read): Make non-const.
10708 * Makefile.am (CCFILES): Add descriptors.cc.
10709 (HFILES): Add descriptors.h.
10710 * Makefile.in: Rebuild.
10711
801647d1
ILT
10712 PR 6716
10713 * gold.h: Always include <clocale>. Add Solaris workarounds
10714 following code in binutils/sysdep.h.
10715
5edd166e
ILT
10716 PR 6048
10717 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
10718 this->eh_frame_hdr_ is NULL before using it.
10719
c89ad728
ILT
10720 * dynobj.cc (Versions::Versions): Update comment.
10721
aa86f06b
ILT
10722 * dynobj.cc (Versions::Versions): If there is an soname, use it as
10723 the base version name.
10724
5778530e
ILT
10725 * stringpool.cc (Stringpool_template::add_with_length): Set key to
10726 array size plus one.
10727 (Stringpool_template::set_string_offsets): Subtract one from key
10728 before using it as an array index.
10729 (Stringpool_template::get_offset_with_length): Likewise.
10730 (Stringpool_template::write_to_buffer): Likewise.
10731 * stringpool.h (Stringpool_template::get_offset_from_key):
10732 Likewise.
10733
057ead22
ILT
107342008-07-23 Ian Lance Taylor <iant@google.com>
10735
7f649c59
ILT
10736 PR 6658
10737 * object.h (Merged_symbol_value::value): Do our best to handle a
10738 negative addend.
10739
057ead22
ILT
10740 PR 6647
10741 * script.cc (Version_script_info::get_versions): Don't add empty
10742 version tag to return value.
10743 (Version_script_info::get_symbol_version_helper): Change return
10744 type to bool. Add pversion parameter. Change all callers.
10745 (script_register_vers_node): Don't require a non-NULL tag.
10746 * script.h (class Version_script_info): Update declarations.
10747 (Version_script_info::get_symbol_version): Change return type to
10748 bool. Add version parameter. Change all callers.
10749 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
10750 handling. Handle an empty version from a version script.
10751 (Symbol_table::define_special_symbol): Likewise.
10752 * testsuite/ver_test_10.script: New file.
10753 * testsuite/ver_test_10.sh: New file.
10754 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
10755 (check_DATA): Add ver_test_10.syms.
10756 (ver_test_10.syms, ver_test_10.so): New target.
10757 * testsuite/Makefile.in: Rebuild.
10758
58e54ac2
CD
107592008-07-23 Simon Baldwin <simonb@google.com>
10760
10761 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
10762 to zero for undefined symbols from dynamic libraries.
10763
95d14cd3
ILT
107642008-07-23 Ian Lance Taylor <iant@google.com>
10765
10766 * symtab.cc (Symbol_table::resolve): Remove version parameter.
10767 Change all callers.
10768 * symtab.h (class Symbol_table): Update declaration.
10769 * testsuite/ver_test_9.cc: New file.
10770 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
10771 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
10772 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
10773 (ver_test_9.so, ver_test_9.o): New targets.
10774 * testsuite/Makefile.in: Rebuild.
10775
92de84a6
ILT
107762008-07-22 Ian Lance Taylor <iant@google.com>
10777
34810851
ILT
10778 * options.h (class General_options): Define --check-sections.
10779 * layout.cc (Layout::set_segment_offsets): Handle
10780 --check-sections.
10781
af6156ef
ILT
10782 * options.h (class General_options): Define -n/--nmagic and
10783 -N/--omagic.
10784 * options.cc (General_options::finalize): For -n/--nmagic or
10785 -N/--omagic, set -static.
10786 * layout.cc (Layout::attach_allocated_section_to_segment): If
10787 -N/--omagic, don't put read-only and read-write sections in
10788 different segments.
10789 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
10790 finding a read-only segment.
10791 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
10792 don't set the minimum segment alignment to the common page size,
10793 and don't set the file offset to the address modulo the page size.
10794 * script-sections.cc (Script_sections::create_segments): If
10795 -n/--omagic, don't put read-only and read-write sections in
10796 different segments.
10797
92de84a6
ILT
10798 * cref.cc: New file.
10799 * cref.h: New file.
10800 * options.h (class General_options): Add --print-symbol-counts.
10801 * main.cc (main): Issue defined symbol report if requested.
10802 * archive.cc (Archive::interpret_header): Make into a const member
10803 function.
10804 (Archive::add_symbols): Call Input_objects::archive_start and
10805 archive_stop.
10806 (Archive::const_iterator): Define new class.
10807 (Archive::begin, Archive::end): New functions.
10808 (Archive::include_all_members): Rewrite to use iterator.
10809 (Archive::count_members): New function.
10810 * archive.h (class Archive): Update declarations.
10811 (Archive::filename): New function.
10812 * object.cc: Include "cref.h".
10813 (Sized_relobj::Sized_relobj): Initialize defined_count_.
10814 (Sized_relobj::do_get_global_symbol_counts): New function.
10815 (Input_objects::add_object): Add object to cross-referencer.
10816 (Input_objects::archive_start): New function.
10817 (Input_objects::archive_stop): New function.
10818 (Input_objects::print_symbol_counts): New function.
10819 * object.h: Declare Cref and Archive.
10820 (Object::get_global_symbol_counts): New function.
10821 (Object::do_get_global_symbol_counts): New pure virtual function.
10822 (class Sized_relobj): Add defined_count_ field. Update
10823 declarations.
10824 (class Input_objects): Add cref_ field. Update constructor.
10825 Update declarations.
10826 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
10827 defined_count_.
10828 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
10829 symbol counts.
10830 (Sized_dynobj::do_get_global_symbol_counts): New function.
10831 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
10832 defined_count_. Update declarations. Define Symbols typedef.
10833 * symtab.cc (Symbol_table::add_from_relobj): Add defined
10834 parameter. Change all callers.
10835 (Symbol_table::add_from_dynobj): Add sympointers and defined
10836 parameters. Change all callers.
10837 * symtab.h (class Symbol_table): Update declarations.
10838 * Makefile.am (CCFILES): Add cref.cc.
10839 (HFILES): Add cref.h.
10840 * Makefile.in: Rebuild.
10841
3f7c5e1d
CD
108422008-07-22 Simon Baldwin <simonb@google.com>
10843
10844 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
10845 to zero when writing undefined symbols.
10846
e0b64032
ILT
108472008-07-22 Ian Lance Taylor <iant@google.com>
10848
10849 * output.cc (Output_section::add_input_section): Don't try to
10850 merge empty merge sections.
10851
096b02cf
CS
108522008-07-21 Craig Silverstein <csilvers@google.com>
10853
10854 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
10855 Include symbol version in error message.
cd536b21 10856
1d1f116d
CD
108572008-07-20 Chris Demetriou <cgd@google.com>
10858
cd536b21 10859 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
10860 (RANDOM_SEED_CFLAGS): New substituted variable.
10861 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
10862 * configure: Rebuild.
10863 * Makefile.in: Likewise.
10864 * testsuite/Makefile.in: Likewise.
10865
a18f591e
ILT
108662008-07-18 Ian Lance Taylor <iant@google.com>
10867
10868 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
10869 where we see NAME/NULL and NAME/VERSION as separate symbols.
10870 * testsuite/ver_test_main.cc (main): Call t4.
10871 (t4, t4_2a): Define.
10872 * testsuite/ver_test_2.cc (t4_2): Define.
10873 * testsuite/ver_test_2.script: Put t4_2a in VER2.
10874 * testsuite/ver_test_4.cc (t4_2a): Define.
10875 * testsuite/ver_test_4.script: Put t4_2a in VER2.
10876 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
10877
c6e3f6ed
ILT
108782008-07-17 Ian Lance Taylor <iant@google.com>
10879
10880 * dynobj.cc (Versions::add_def): If we give an error about a
10881 missing version, go ahead and create the version anyhow.
10882
ef9beddf
ILT
108832008-07-10 Ian Lance Taylor <iant@google.com>
10884
10885 Handle output sections with more than 0x7fffffff bytes.
10886 * object.h (class Relobj): Change map_to_output_ to
10887 output_sections_, and just keep a section pointer. Change all
10888 uses. Move comdat group support to Sized_relobj.
10889 (Relobj::is_section_specially_mapped): Remove.
10890 (Relobj::output_section): Remove poff parameter. Change all
10891 callers.
10892 (Relobj::output_section_offset): New function.
10893 (Relobj::set_section_offset): Rewrite.
10894 (Relobj::map_to_output): Remove.
10895 (Relobj::output_sections): New function.
10896 (Relobj::do_output_section_offset): New pure virtual function.
10897 (Relobj::do_set_section_offset): Likewise.
10898 (class Sized_relobj): Add section_offsets_ field. Add comdat
10899 group support from Relobj. Update declarations.
10900 (Sized_relobj::get_output_section_offset): New function.
10901 (Sized_relobj::do_output_section_offset): New function.
10902 (Sized_relobj::do_set_section_offset): New function.
10903 * object.cc (Relobj::output_section_address): Remove.
10904 (Sized_relobj::Sized_relobj): Initialize new fields.
10905 (Sized_relobj::include_section_group): Cast find_kept_object to
10906 Sized_relobj.
10907 (Sized_relobj::include_linkonce_section): Likewise.
10908 (Sized_relobj::do_layout): Use separate arrays for output section
10909 and output offset.
10910 (Sized_relobj::do_count_local_symbols): Change map_to_output to
10911 output_sections.
10912 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
10913 output_sections and section_offsets.
10914 (Sized_relobj::write_local_symbols): Likewise.
10915 (map_to_kept_section): Compute output address directly.
10916 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
10917 output_sections and section_offsets.
10918 (Sized_relobj::write_sections): Likewise.
10919 (Sized_relobj::relocate_sections): Likewise.
10920 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
10921 * output.h (class Output_reloc): Update declarations. Change
10922 u2_.relobj to Sized_relobj*.
10923 (class Output_data_reloc): Change add functions to use
10924 Sized_relobj*.
10925 * output.cc (Output_reloc::Output_reloc): Change relobj to
10926 Sized_relobj*.
10927 (Output_reloc::local_section_offset): Change return type to
10928 Elf_Addr. Use get_output_section_offset.
10929 (Output_reloc::get_address): Likewise.
10930 (Output_section::is_input_address_mapped): Don't call
10931 is_section_specially_mapped.
10932 (Output_section::output_offset): Likewise.
10933 (Output_section::output_address): Likewise.
10934 (Output_section::starting_output_address): Likewise.
10935 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
10936 parameter to Sized_relobj*.
10937 (Copy_relocs::need_copy_reloc): Likewise.
10938 (Copy_relocs::save): Likewise.
10939 * copy-relocs.h (class Copy_relocs): Update declarations.
10940 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
10941 Sized_relobj*. Change relobj_ field to Sized_relobj*.
10942 * target-reloc.h (relocate_for_relocatable): Change
10943 offset_in_output_section type to Elf_Addr. Change code that uses
10944 it as well.
10945 * layout.cc (Layout::layout): Always set *off.
10946 * mapfile.cc (Mapfile::print_input_section): Use
10947 output_section_offset.
10948 * i386.cc (Target_i386::copy_reloc): Change object parameter to
10949 Sized_relobj*.
10950 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
10951 * sparc.cc (Target_sparc::copy_reloc): Likewise.
10952 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
10953
5cb66f97
ILT
109542008-07-03 Ian Lance Taylor <iant@google.com>
10955
10956 * layout.cc (Layout::include_section): Do not discard unrecognized
10957 SHT_STRTAB sections.
10958
afe47622
CS
109592008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
10960
10961 * script.cc (Lex::can_continue_name): Make '?' allowable in
10962 version-script names.
10963 * testsuite/version_script.map: Change glob pattern to use '?'
10964
5adf9721
ILT
109652008-06-30 Manish Singh <yosh@gimp.org>
10966
10967 PR 6585
10968 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
10969 Correct typo.
10970
e6fde208
ILT
109712008-06-30 Ian Lance Taylor <iant@google.com>
10972
10973 PR 6660
10974 PR 6682
10975 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
10976 versions]: Don't try to read the value in the contents, since we
10977 don't use it. Use the template endianness when writing.
10978
3f2e6a2d
CC
109792008-06-25 Cary Coutant <ccoutant@google.com>
10980
10981 * fileread.cc (File_read::make_view): Assert on zero-length view.
10982 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
10983 symbol table when there are no symbols to read.
10984
c43d3a48
CS
109852008-06-23 Craig Silverstein <csilvers@google.com>
10986
10987 * version.cc (version_string): Bump to 1.7
10988
5f494ea0
CS
109892008-06-18 Craig Silverstein <csilvers@google.com>
10990
10991 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
10992 constant 0xFFFF to type Valtype.
10993 (Powerpc_relocate_functions::rel16_ha): Likewise.
10994
c42e122e
ILT
109952008-06-17 Ian Lance Taylor <iant@google.com>
10996
f34787f8
ILT
10997 * output.h (Output_section::Input_section): Initialize p2align_ to
10998 zero for Output_section_data constructors.
10999 (Output_section::Input_section::addralign): If not an input
11000 section, return the alignment of the Output_section_data.
11001 * testsuite/copy_test.cc: New file.
11002 * testsuite/copy_test_1.cc: New file.
11003 * testsuite/copy_test_2.cc: New file.
11004 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
11005 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
11006 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
11007 (copy_test_1_pic.o, copy_test_1.so): New targets.
11008 (copy_test_2_pic.o, copy_test_2.so): New targets.
11009 * testsuite/Makefile.in: Rebuild.
11010
c42e122e
ILT
11011 * script-sections.cc (Script_sections::place_orphan): Initialize
11012 local variable exact.
11013
ce3ac18a
DE
110142008-06-13 David Edelsohn <edelsohn@gnu.org>
11015
11016 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
11017
42cacb20
DE
110182008-06-12 David Edelsohn <edelsohn@gnu.org>
11019 David S. Miller <davem@davemloft.net>
11020
11021 * powerpc.cc: New file.
11022 * Makefile.am (TARGETSOURCES): Add powerpc.cc
11023 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
11024 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
11025 * Makefile.in: Rebuild.
11026
7b308235
ILT
110272008-06-09 Ian Lance Taylor <iant@google.com>
11028
11029 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
11030 <exception>.
11031 (throwing, orig_terminate): New static variables.
11032 (terminate_handler): New static function.
11033 (t2): Set terminate handler.
11034
f0b886e3
ILT
110352008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
11036
11037 PR 6584
cd536b21 11038 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
11039 alignment.
11040
3e90f135
CC
110412008-05-30 Cary Coutant <ccoutant@google.com>
11042
11043 * archive.cc (Archive::include_all_members) Correct to step
11044 over symbol table and extended name table in thin archives.
11045
e09ad04a
ILT
110462008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
11047
11048 PR 6407
11049 * target-reloc.h (relocate_for_relocatable): Fix new_offset
11050 calculation.
11051
62b01cb5
ILT
110522008-05-28 Caleb Howe <cshowe@google.com>
11053
11054 * reduced_debug_output.cc: New file.
11055 * reduced_debug_output.h: New file.
92de84a6 11056 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
11057 * options.cc (General_options::finalize): Add strip_debug_non_line
11058 to the strip heirarchy.
11059 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
11060 fields.
11061 * layout.cc: Include "reduced_debug_output.h".
11062 (Layout::Layout): Initialize new fields.
11063 (line_only_debug_sections): New static array.
11064 (is_lines_only_debug_sections): New static inline function.
11065 (Layout::include_section): Handle --strip-debug-non-line.
11066 (Layout::make_output_section): If --strip-debug-non-line, build
11067 new output sections for .debug_abbrev and .debug_info.
11068 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
11069 gold. Warn about possible overflow.
11070 (read_signed_LEB_128): Likewise.
11071 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
11072 (read_signed_LEB_128): Declare.
11073 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
11074 (HFILES): Add reduced_debug_output.h.
11075 * Makefile.in: Rebuild.
11076
7d9e3d98
ILT
110772008-05-21 Ian Lance Taylor <iant@google.com>
11078
11079 * mapfile.cc: New file.
11080 * mapfile.h: New file.
11081 * options.h (class General_options): Add -M/--print-map and -Map.
11082 * options.cc (General_options::finalize): Make -M equivalent to
11083 -Map -.
11084 * main.cc: Include <cstdio> and "mapfile.h".
11085 (main): Open mapfile if requested.
11086 * gold.cc (class Middle_runner): Add mapfile_ field. Update
11087 constructor. Change caller.
11088 (queue_initial_tasks): Add mapfile parameter. Change caller.
11089 (queue_middle_tasks): Likewise.
11090 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
11091 declarations.
11092 * archive.cc: Include "mapfile.h".
11093 (Archive::add_symbols): Add mapfile parameter. Change all
11094 callers. Pass mapfile, symbol, and reason to include_member.
11095 (Archive::include_all_members): Add mapfile parameter. Change all
11096 callers.
11097 (Archive::include_member): Add mapfile, sym, and why parameters.
11098 Change all callers. Report inclusion to map file.
11099 * archive.h: Include "fileread.h".
11100 (class Archive): Update declarations.
11101 (Archive::file): New const method.
11102 (class Add_archive_symbols): Add mapfile_ field. Update
11103 constructor. Change all callers.
11104 * readsyms.h (class Read_symbols): Likewise.
11105 (class Finish_group): Likewise.
11106 (class Read_script): Likewise.
11107 * common.cc: Include "mapfile.h".
11108 (Symbol_table::allocate_commons): Add mapfile parameter. Change
11109 all callers.
11110 (Symbol_table::do_allocate_commons): Likewise.
11111 (Symbol_table::do_allocate_commons_list): Likewise. Report common
11112 symbol allocation to mapfile.
11113 * common.h (class Allocate_commons_task): Add mapfile_ field.
11114 Update constructor. Change all callers.
11115 * symtab.h (class Symbol_table): Update declarations.
11116 * layout.cc: Include "mapfile.h".
11117 (Layout_task_runner::run): Print information to mapfile.
11118 (Layout::create_gold_note): Change Output_data_fixed_space to
11119 Output_data_zero_fill.
11120 (Layout::create_build_id): Likewise.
11121 (Layout::print_to_mapfile): New function.
11122 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
11123 constructor. Change caller.
11124 (class Layout): Declare print_to_mapfile.
11125 * output.cc (Output_section::Input_section::print_to_mapfile): New
11126 function.
11127 (Output_section::add_input_section): If producing a map, always
11128 add to input_sections_ list.
11129 (Output_section::do_print_to_mapfile): New function.
11130 (Output_segment::print_sections_to_mapfile): New function.
11131 (Output_segment::print_section_list_to_mapfile): New function.
11132 * output.h: Include "mapfile.h".
11133 (Output_data::print_to_mapfile): New function.
11134 (Output_data::do_print_to_mapfile): New virtual function.
11135 (Output_segment_headers::do_print_to_mapfile): New function.
11136 (Output_file_header::do_print_to_mapfile): New function.
11137 (Output_data_const::do_print_to_mapfile): New function.
11138 (class Output_data_const_buffer): Add map_name_ field. Update
11139 constructor. Change all callers. Add do_print_to_mapfile
11140 function.
11141 (class Output_data_fixed_space): Likewise.
11142 (class Output_data_space): Likewise.
11143 (class Output_data_zero_fill): New class.
11144 (Output_data_strtab::do_print_to_mapfile): New function.
11145 (Output_data_reloc_base::do_print_to_mapfile): New function.
11146 (Output_relocatable_relocs::do_print_to_mapfile): New function.
11147 (Output_data_group::do_print_to_mapfile): New function.
11148 (Output_data_got::do_print_to_mapfile): New function.
11149 (Output_data_dynamic::do_print_to_mapfile): New function.
11150 (Output_symtab_xindex::do_print_to_mapfile): New function.
11151 (class Output_section): Declare do_print_to_mapflie. Declare
11152 print_to_mapfile in Input_section.
11153 (class Output_segment): Declare new functions.
11154 * object.h (Sized_relobj::symbol_count): New function.
11155 * script-sections.cc
11156 (Output_section_element_dot_assignment::set_section_addresses):
11157 Change Output_data_fixed_space to Output_data_zero_fill.
11158 (Output_data_expression::do_print_to_mapfile): New function.
11159 * script.cc (read_input_script): Add mapfile parameter. Change
11160 all callers.
11161 * script.h (read_input_script): Update declaration.
11162 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
11163 (Eh_frame::do_print_to_mapfile): New function.
11164 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
11165 (Output_merge_string::do_print_to_mapfile): New function.
11166 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
11167 function.
11168 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
11169 function.
11170 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
11171 function.
11172 * Makefile.am (CCFILES): Add mapfile.cc.
11173 (HFILES): Add mapfile.h.
11174 * Makefile.in: Rebuild.
11175
9f1d377b
ILT
111762008-05-19 Ian Lance Taylor <iant@google.com>
11177
11178 * options.h (class General_options): Add -z relro.
11179 * layout.cc (Layout::Layout): Initialize relro_segment_.
11180 (Layout::add_output_section_data): Return the output section.
11181 (Layout::make_output_section): Rcognize relro sections and mark
11182 them appropriately.
11183 (Layout::attach_allocated_section_to_segment): Put relro sections
11184 in a PT_GNU_RELRO segment.
11185 (Layout::create_initial_dynamic_sections): Mark the .dynamic
11186 section as relro.
11187 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
11188 PT_TLS segments.
11189 (Layout::linkonce_mapping): Map d.rel.ro.local to
11190 .data.rel.ro.local.
11191 (Layout::output_section_name): Us .data.rel.ro.local for any
11192 section which begins with that.
11193 * layout.h (class Layout): Update add_output_section_data
11194 declaration. Add relro_segment_ field.
11195 * output.cc (Output_section::Output_section): Initialize is_relro_
11196 and is_relro_local_ fields.
11197 (Output_segment::add_output_section): Group relro sections.
11198 (Output_segment::is_first_section_relro): New function.
11199 (Output_segment::maximum_alignment): If there is a relro section,
11200 align the segment to the common page size.
11201 (Output_segment::set_section_addresses): Track whether we are
11202 looking at relro sections. If the last section is a relro
11203 section, align to the common page size.
11204 (Output_segment::set_section_list_addresses): Add in_relro
11205 parameter. Change all callers. Align to the page size when
11206 moving from relro to non-relro section.
11207 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
11208 segment.
11209 * output.h (class Output_section): Add is_relro_ and
11210 is_relro_local_ fields.
11211 (Output_section::is_relro): New function.
11212 (Output_section::set_is_relro): New function.
11213 (Output_section::is_relro_local): New function.
11214 (Output_section::set_is_relro_local): New function.
11215 (class Output_segment): Update declarations.
11216 * i386.cc (Target_i386::got_section): Mark .got section as relro.
11217 * sparc.cc (Target_sparc::got_section): Likewise.
11218 * x86_64.cc (Target_x86_64::got_section): Likewise.
11219 * testsuite/relro_test_main.cc: New file.
11220 * testsuite/relro_test.cc: New file.
11221 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
11222 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
11223 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
11224 (relro_test.so, relro_test_pic.o): New targets.
11225 * testsuite/Makefile.in: Rebuild.
11226
a984ee1d
ILT
112272008-05-16 Ian Lance Taylor <iant@google.com>
11228
01676dcd
ILT
11229 * output.cc (Output_segment::add_output_section): Remove front
11230 parameter.
11231 * output.h (class Output_segment): Remove
11232 add_initial_output_section and overloaded add_output_section.
11233 Update declaration of remaining add_output_section.
11234 * layout.cc (Layout::create_interp): Call add_output_section
11235 rather than add_initial_output_section.
11236 (Layout::finish_dynamic_section): Likewise.
11237
497897f9
ILT
11238 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
11239 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
11240 know the dynamic type.
11241 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
11242 field. Initialize it in constructor.
11243 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
11244 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
11245 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
11246 reloc.
11247
a984ee1d
ILT
11248 * output.cc (Output_reloc::get_address): Change return type to
11249 Elf_Addr.
11250 * output.h (class Output_reloc): Update get_address declaration.
11251 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
11252 for section addresses.
11253
55ba0940
ILT
112542008-05-09 Ian Lance Taylor <iant@google.com>
11255
11256 PR 6493
11257 * gold.cc (gold_nomem): Use return value of write.
11258
75517b77
ILT
112592008-05-08 Ian Lance Taylor <iant@google.com>
11260
11261 * symtab.c (Symbol::init_base_output_data): Add version
11262 parameter. Change all callers.
11263 (Symbol::init_base_output_segment): Likewise.
11264 (Symbol::init_base_constant): Likewise.
11265 (Symbol::init_base_undefined): Likewise.
11266 (Sized_symbol::init_output_data): Likewise.
11267 (Sized_symbol::init_output_segment): Likewise.
11268 (Sized_symbol::init_constant): Likewise.
11269 (Sized_symbol::init_undefined): Likewise.
11270 (Symbol_table::do_define_in_output_data): If the new symbol has a
11271 version, mark it as the default.
11272 (Symbol_table::do_define_in_output_segment): Likewise.
11273 (Symbol_table::do_define_as_constant): Likewise.
11274 * symtab.h (class Symbol): Update declarations.
11275 (class Sized_symbol): Likewise.
11276 * resolve.cc (Symbol::override_version): New function.
c42e122e 11277 (Symbol::override_base): Call override_version.
75517b77
ILT
11278 (Symbol::override_base_with_special): Likewise.
11279 * testsuite/ver_script_8.script: New file.
11280 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
11281 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
11282 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
11283 (ver_test_8_1.so, ver_test_8_2.so): New targets.
11284
f1f70eae
ILT
112852008-05-06 Ian Lance Taylor <iant@google.com>
11286
f3e9c5c5
ILT
11287 PR 6049
11288 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
11289 functions.
11290 (class General_options): Remove existing --undefined, and add
11291 --no-undefined instead. Add new --undefined as synonym for -u.
11292 * archive.cc (Archive::add_symbols): Check whether symbol was
11293 named with -u.
11294 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
11295 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
11296 all uses. Add IS_UNDEFINED. Update declarations to split
11297 different versions of init_base. Declare init_base_undefined.
11298 (Symbol::is_defined): Handle IS_UNDEFINED.
11299 (Symbol::is_undefined): Likewise.
11300 (Symbol::is_weak_undefined): Call is_undefined.
11301 (Symbol::is_absolute): Handle IS_CONSTANT.
11302 (class Sized_symbol): Update declarations to split different
11303 versions of init. Declare init_undefined.
11304 (class Symbol_table): Declare new functions.
11305 * symtab.cc (Symbol::init_base_object): Rename from init_base.
11306 Change all callers.
11307 (Symbol::init_base_output_data): Likewise.
11308 (Symbol::init_base_output_segment): Likewise.
11309 (Symbol::init_base_constant): Likewise.
11310 (Symbol::init_base_undefined): New function.
11311 (Sized_symbol::init_object): Rename from init. Change all
11312 callers.
11313 (Sized_symbol::init_output_data): Likewise.
11314 (Sized_symbol::init_output_segment): Likewise.
11315 (Sized_symbol::init_constant): Likewise.
11316 (Sized_symbol::init_undefined): New function.
11317 (Symbol_table::add_undefined_symbols_from_command_line): New
11318 function.
11319 (Symbol_table::do_add_undefined_symbols_from_command_line): New
11320 function.
11321 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
11322 (Symbol::output_section): Likewise.
11323 (Symbol::set_output_section): Likewise.
11324 (Symbol_table::sized_finalize_symbol): Likewise.
11325 (Symbol_table::sized_write_globals): Likewise.
11326 * resolve.cc (Symbol_table::should_override): Likewise.
11327 (Symbol::override_base_with_special): Likewise.
11328
8bdcdf2c
ILT
11329 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
11330 symbol, change it to have default visibility.
11331 * testsuite/protected_1.cc: New file.
11332 * testsuite/protected_2.cc: New file.
11333 * testsuite/protected_3.cc: New file.
11334 * testsuite/protected_main_1.cc: New file.
11335 * testsuite/protected_main_2.cc: New file.
11336 * testsuite/protected_main_3.cc: New file.
11337 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
11338 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
11339 (protected_1_LDFLAGS, protected_1_LDADD): Define.
11340 (protected_1.so): New target.
11341 (protected_1_pic.o, protected_2_pic.o): New targets.
11342 (protected_3_pic.o): New target.
11343 (check_PROGRAMS): Add protected_2.
11344 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
11345 (protected_2_LDFLAGS, protected_2_LDADD): Define.
11346 * testsuite/Makefile.in: Rebuild.
11347
2b706932
ILT
11348 * options.h (DEFINE_var): Add set_user_set_##varname__.
11349 (DEFINE_bool_alias): New macro.
11350 (class General_options): Define -Bstatic using DEFINE_bool_alias
11351 rather than DEFINE_special. Add --undefined as an alias for -z
11352 defs.
11353 * options.cc (General_options::parse_Bstatic): Remove.
11354
d82a5bcc
ILT
11355 * options.h (class General_options): Add --fatal-warnings.
11356 * main.cc (main): Implement --fatal-warnings.
11357 * errors.h (Errors::warning_count): New function.
11358
f1f70eae
ILT
11359 * options.h (class General_options): Add -Bsymbolic-functions.
11360 * symtab.h (Symbol::is_preemptible): Check for
11361 -Bsymbolic-functions.
11362
8825ac63
ILT
113632008-05-05 Ian Lance Taylor <iant@google.com>
11364
d98bc257
ILT
11365 * options.h (DEFINE_bool): For DASH_Z, create the negative option
11366 as noVARNAME rather than no-VARNAME.
11367 (class General_options): Add option -z combreloc.
11368 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
11369 get_address.
11370 (Output_reloc::sort_before) [SHT_REL]: New function.
11371 (Output_reloc::sort_before) [SHT_RELA]: New function.
11372 (class Output_data_reloc_base): Add sort_relocs_ field. Define
11373 Sort_relocs_comparison.
11374 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
11375 parameter. Change all callers.
11376 (Output_data_reloc::Output_data_reloc) [both versions]: Add
11377 sort_relocs parameter. Change all callers.
11378 * output.cc (Output_reloc::get_address): New function, broken out
11379 of write_rel.
11380 (Output_reloc::write_rel): Call it.
11381 (Output_reloc::compare): New function.
11382 (Output_data_reloc_base::do_write): Optionally sort relocs.
11383
60b2b4e7
ILT
11384 * configure.ac: If targ_extra_obj is set, link it in.
11385 * configure.tgt: Initialize all variables.
11386 (x86_64*): Set targ_extra_obj and targ_extra_size.
11387 * configure: Rebuild.
11388
8825ac63
ILT
11389 * object.cc (Sized_relobj::include_section_group): Adjust section
11390 indexes read from group data. Build vector to pass to
11391 layout_group.
11392 * layout.cc (Layout::layout_group): Add flags and shndxes
11393 parameters. Remove contents parameter. Change caller. Update
11394 explicit instantiations.
11395 * layout.h (class Layout): Update layout_group declaration.
11396 * output.cc (Output_data_group::Output_data_group): Add flags and
11397 input_shndxes parameters. Remove contents parameter. Change
11398 caller.
11399 (Output_data_group::do_write): Change input_sections_ to
11400 input_shndxes_.
11401 * output.h (class Output_data_group): Update constructor
11402 declaration. Rename input_sections_ to input_shndxes_.
11403 * testsuite/many_sections_test.cc: Add template.
11404
e94cf127
CC
114052008-04-30 Cary Coutant <ccoutant@google.com>
11406
4418b2d5
CC
11407 * target-reloc.h (relocate_section): Fix dead-pointer bug.
11408
e94cf127
CC
11409 * layout.cc (Layout::include_section): Refactored check for debug
11410 info section.
11411 (Layout::add_comdat): Add new parameters. Change type
11412 of signature parameter. Add object and shndx to signatures table.
11413 (Layout::find_kept_object): New function.
11414 * layout.h: Include <cstring>.
11415 (Layout::is_debug_info_section): New function.
11416 (Layout::add_comdat): Add new parameters.
11417 (Layout::find_kept_object): New function.
11418 (Layout::Kept_section): New struct.
11419 (Layout::Signatures): Change type of map range.
11420 * object.cc (Relobj::output_section_address): New function.
11421 (Sized_relobj::include_section_group): Add new parameters. Change
11422 calls to Layout::add_comdat. Change to build table of kept comdat
11423 groups and table mapping discarded sections to kept sections.
11424 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
11425 (Sized_relobj::do_layout): Change calls to include_section_group and
11426 include_linkonce_section.
11427 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
11428 value to zero when section is discarded.
11429 (Sized_relobj::map_to_kept_section): New function.
11430 * object.h (Relobj::output_section_address): New function.
11431 (Relobj::Comdat_group): New type.
11432 (Relobj::find_comdat_group): New function.
11433 (Relobj::Comdat_group_table): New type.
11434 (Relobj::Kept_comdat_section): New type.
11435 (Relobj::Kept_comdat_section_table): New type.
11436 (Relobj::add_comdat_group): New function.
11437 (Relobj::set_kept_comdat_section): New function.
11438 (Relobj::get_kept_comdat_section): New function.
11439 (Relobj::comdat_groups_): New field.
11440 (Relobj::kept_comdat_sections_): New field.
11441 (Symbol_value::input_value): Update comment.
11442 (Sized_relobj::map_to_kept_section) New function.
11443 (Sized_relobj::include_linkonce_section): Add new parameter.
11444 * target-reloc.h (Comdat_behavior): New type.
11445 (get_comdat_behavior): New function.
11446 (relocate_section): Add code to map a discarded section to the
11447 corresponding kept section when applying a relocation.
11448
e4e5049b
CS
114492008-04-30 Craig Silverstein <csilvers@google.com>
11450
11451 * dwarf_reader.cc (next_generation_count): New static var.
11452 (Addr2line_cache_entry): New struct.
11453 (addr2line_cache): New static var.
11454 (Dwarf_line_info::one_addr2line): Added caching.
11455 (Dwarf_line_info::clear_addr2line_cache): New function.
11456 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
11457 cache-size parameter.
11458 (Dwarf_line_info::one_addr2line_cache): New function.
11459 * symtab.cc (Symbol_table::detect_odr_violations): Pass
11460 new cache-size argument to one_addr2line(), and clear cache.
11461
d09e9154
CC
114622008-04-28 Cary Coutant <ccoutant@google.com>
11463
11464 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
11465 R_386_PC8 relocations.
11466
7ef73768
ILT
114672008-04-23 Ian Lance Taylor <iant@google.com>
11468
55438702
ILT
11469 * object.cc (Sized_relobj::include_section_group): Check for
11470 invalid section group.
11471
c165fb93
ILT
11472 * object.cc (make_elf_object): Correct test for 64-bit ELF file
11473 header size.
11474
7ef73768
ILT
11475 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
11476 than read for file header.
11477 * archive.cc (Archive::include_member): Likewise.
11478
6194aaab
L
114792008-04-23 Paolo Bonzini <bonzini@gnu.org>
11480
11481 * aclocal.m4: Regenerate.
11482 * configure: Regenerate.
11483
d491d34e
ILT
114842008-04-19 Ian Lance Taylor <iant@google.com>
11485
5ea2bac6
ILT
11486 * version.cc (version_string): Bump to 1.6.
11487
7bc3e21a
ILT
11488 * testsuite/Makefile.am (many_sections_r_test): New target.
11489 (many_sections_r_test_SOURCES): Remove.
11490 (many_sections_r_test_DEPENDENCIES): Remove.
11491 (many_sections_r_test_LDFLAGS): Remove.
11492 (many_sections_r_test_LDADD): Remove.
11493
7fcd3aa9
ILT
11494 * object.cc (Sized_relobj::do_add_symbols): Always pass
11495 local_symbol_count_ to add_from_relobj.
11496
4c94d6ae
ILT
11497 * testsuite/Makefile.am (many_sections_check.h): Only check one in
11498 every thousand variables.
11499 * testsuite/Makefile.in: Rebuild.
11500
d491d34e
ILT
11501 * object.cc (Xindex::initialize_symtab_xindex): New function.
11502 (Xindex::read_symtab_xindex): New function.
11503 (Xindex::sym_xindex_to_shndx): New function.
11504 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
11505 available.
11506 (Sized_relobj::do_initialize_xindex): New function.
11507 (Sized_relobj::do_read_symbols): Adjust section links.
11508 (Sized_relobj::symbol_section_and_value): Add is_ordinary
11509 parameter. Change all callers.
11510 (Sized_relobj::include_section_group): Adjust section links and
11511 symbol section indexes.
11512 (Sized_relobj::do_layout): Adjust section links.
11513 (Sized_relobj::do_count_local_symbols): Adjust section links and
11514 symbol section indexes.
11515 (Sized_relobj::do_finalize_local_symbols): Distinguish between
11516 ordinary and special symbols.
11517 (Sized_relobj::write_local_symbols): Add symtab_xindex and
11518 dynsym_xindex parameters. Change all callers. Adjust section
11519 links. Use SHN_XINDEX when needed.
11520 (Sized_relobj::get_symbol_location_info): Adjust section links.
11521 Don't get fooled by special symbols.
11522 * object.h (class Xindex): Define.
11523 (class Object): Add xindex_ parameter. Declare virtual functoin
11524 do_initialize_xindex.
11525 (Object::adjust_sym_shndx): New function.
11526 (Object::set_xindex): New protected function.
11527 (class Symbol_value): Add is_ordinary_shndx_ field.
11528 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
11529 (Symbol_value::value): Assert ordinary section.
11530 (Symbol_value::initialize_input_to_output_map): Likewise.
11531 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
11532 Change all callers.
11533 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
11534 all callers.
11535 (class Sized_relobj): Update declarations.
11536 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
11537 parameter. Change all callers.
11538 (Sized_relobj::adjust_shndx): New function.
11539 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
11540 field.
11541 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
11542 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
11543 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
11544 (Sized_dynobj::read_dynsym_section): Adjust section links.
11545 (Sized_dynobj::read_dynamic): Likewise.
11546 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
11547 section links.
11548 (Sized_dynobj::do_initialize_xindex): New function.
11549 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
11550 do_initialize_xindex.
11551 (Sized_dynobj::adjust_shndx): New function.
11552 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
11553 dynsym_xindex_ fields.
11554 (Layout::finalize): Add a call to set_section_indexes before
11555 creating the symtab sections.
11556 (Layout::set_section_indexes): Don't do anything if the section
11557 already has a section index.
11558 (Layout::create_symtab_sections): Add shnum parameter. Change
11559 caller. Create .symtab_shndx section if needed.
11560 (Layout::create_shdrs): Add shstrtab_section parameter. Change
11561 caller.
11562 (Layout::allocated_output_section_count): New function.
11563 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
11564 needed.
11565 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
11566 fields. Update declarations.
11567 (Layout::symtab_xindex): New function.
11568 (Layout::dynsym_xindex): New function.
11569 (class Write_symbols_task): Add layout_ field.
11570 (Write_symbols_task::Write_symbols_task): Add layout parameter.
11571 Change caller.
11572 * output.cc (Output_section_headers::Output_section_headers): Add
11573 shstrtab_section parameter. Change all callers.
11574 (Output_section_headers::do_sized_write): Store overflow values
11575 for section count and section string table section index in
11576 section header zero.
11577 (Output_file_header::do_sized_write): Check for overflow of
11578 section count and section string table section index.
11579 (Output_symtab_xindex::do_write): New function.
11580 (Output_symtab_xindex::endian_do_write): New function.
11581 * output.h (class Output_section_headers): Add shstrtab_section_.
11582 Update declarations.
11583 (class Output_symtab_xindex): Define.
11584 (Output_section::has_out_shndx): New function.
11585 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
11586 field.
11587 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
11588 Change all callers.
11589 (Sized_symbol::init): Likewise.
11590 (Symbol::output_section): Check for ordinary symbol.
11591 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
11592 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
11593 callers.
11594 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
11595 Change all callers. Simplify handling of symbols from sections
11596 not included in the link.
11597 (Symbol_table::add_from_dynobj): Handle ordinary symbol
11598 distinction.
11599 (Weak_alias_sorter::operator()): Assert that symbols are
11600 ordinary.
11601 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
11602 distinction.
11603 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
11604 parameters. Change all callers.
11605 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
11606 symbol distinction. Use SHN_XINDEX when needed.
11607 (Symbol_table::write_section_symbol): Add symtab_xindex
11608 parameter. Change all callers.
11609 (Symbol_table::sized_write_section_symbol): Likewise. Use
11610 SHN_XINDEX when needed.
11611 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
11612 declarations.
11613 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
11614 (Symbol::is_defined): Check is_ordinary.
11615 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
11616 (Symbol::is_absolute, Symbol::is_common): Likewise.
11617 (class Sized_symbol): Update declarations.
11618 (class Symbol_table): Update declarations.
11619 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
11620 parameters. Change all callers.
11621 (Sized_symbol::override): Likewise.
11622 (Symbol_table::override): Likewise.
11623 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
11624 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
11625 is_ordinary, and orig_st_shndx parameters. Change all callers.
11626 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
11627 to be in an ordinary section.
11628 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
11629 object and is_ordinary parameters. Change all callers.
11630 (Sized_dwarf_line_info::read_relocs): Add object parameter.
11631 Change all callers. Don't add undefined or non-ordinary symbols
11632 to reloc_map_.
11633 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
11634 Change all callers.
11635 * dwarf_reader.h (class Sized_dwarf_line_info): Update
11636 declarations.
11637 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
11638 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
11639 (Sized_relobj::relocate_sections): Likewise.
11640 * target-reloc.h (scan_relocs): Adjust section symbol index.
11641 (scan_relocatable_relocs): Likewise.
11642 * i386.cc (Scan::local): Check for ordinary symbols.
11643 * sparc.cc (Scan::local): Likewise.
11644 * x86_64.cc (Scan::local): Likewise.
11645 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
11646 to symbol_section_and_value.
11647 * testsuite/many_sections_test.cc: New file.
11648 * testsuite/Makefile.am (BUILT_SOURCES): Define.
11649 (check_PROGRAMS): Add many_sections_test.
11650 (many_sections_test_SOURCES): Define.
11651 (many_sections_test_DEPENDENCIES): Define.
11652 (many_sections_test_LDFLAGS): Define.
11653 (BUILT_SOURCES): Add many_sections_define.h.
11654 (many_sections_define.h): New target.
11655 (BUILT_SOURCES): Add many_sections_check.h.
11656 (many_sections_check.h): New target.
11657 (check_PROGRAMS): Add many_sections_r_test.
11658 (many_sections_r_test_SOURCES): Define.
11659 (many_sections_r_test_DEPENDENCIES): Define.
11660 (many_sections_r_test_LDFLAGS): Define.
11661 (many_sections_r_test_LDADD): Define.
11662 (many_sections_r_test.o): New target.
11663 * testsuite/Makefile.in: Rebuild.
11664
c5818ff1
CC
116652008-04-17 Cary Coutant <ccoutant@google.com>
11666
11667 * errors.cc (Errors::info): New function.
11668 (gold_info): New function.
11669 * errors.h (Errors::info): New function.
11670 * gold.h (gold_info): New function.
11671 * object.cc (Input_objects::add_object): Print trace output.
11672 * options.cc (options::parse_set): New function.
11673 (General_options::parse_wrap): Deleted.
11674 (General_options::General_options): Deleted initializer.
11675 * options.h (options::String_set): New typedef.
11676 (options::parse_set): New function.
11677 (DEFINE_set): New macro.
11678 (General_options::wrap): Changed to use DEFINE_set. Changed
11679 callers of any_wrap_symbols and is_wrap_symbol.
11680 (General_options::trace, General_options::trace_symbol):
11681 New options.
11682 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
11683 (General_options::wrap_symbols_): Deleted.
11684 * symtab.cc (Symbol_table::add_from_object): Print trace output.
11685
b5be4a7c
DM
116862008-04-17 David S. Miller <davem@davemloft.net>
11687
11688 * options.cc (General_options::parse_V): New function.
11689 * options.h: Add entries for -V and -Qy.
11690
155a0dd7
ILT
116912008-04-17 Ian Lance Taylor <iant@google.com>
11692
11693 * common.cc (Symbol_table::allocate_commons): Remove options
11694 parameter. Change caller.
11695 (Symbol_table::do_allocate_commons): Remove options parameter.
11696 Change caller. Just call do_allocate_commons_list twice.
11697 (Symbol_table::do_allocate_commons_list): New function, broken out
11698 of do_allocate_commons.
11699 * common.h (class Allocate_commons_task): Remove options_ field.
11700 Update constructor.
11701 * symtab.cc (Symbol_table::Symbol_table): Initialize
11702 tls_commons_.
11703 (Symbol_table::add_from_object): Put TLS common symbols on
11704 tls_commons_ list.
11705 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
11706 which are IN_OUTPUT_DATA.
11707 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
11708 allocate_commons and do_allocate_commons declarations. Declare
11709 do_allocate_commons_list.
11710 * gold.cc (queue_middle_tasks): Update creation of
11711 Allocate_commons_task to not pass options.
11712 * testsuite/Makefile.am (INCLUDES): Add -I.. .
11713 (TLS_TEST_C_FLAGS): New variable.
11714 (tls_test_c_pic.o): New target.
11715 (tls_test_shared.so): Link in tls_test_c_pic.o.
11716 (tls_test_c_pic_ie.o): New target.
11717 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
11718 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
11719 (tls_test_c.o): New target.
11720 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
11721 (tls_pic_test_LDADD): Likewise.
11722 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
11723 (tls_shared_gd_to_ie_test_LDADD): Likewise.
11724 (tls_test_c_gnu2.o): New target.
11725 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
11726 tls_test_c_gnu2.o.
11727 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
11728 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
11729 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
11730 * testsuite/tls_test.cc: Include "config.h".
11731 (t_last): Call t11_last.
11732 * testsuite/tls_test.h (t11, t11_last): Declare.
11733 * testsuite/tls_test_c.c: New file.
11734 * testsuite/tls_test_main.cc (thread_routine): Call t11.
11735 * configure.ac: Check for OpenMP support.
11736 * configure, config.in, Makefile.in: Rebuild.
11737 * testsuite/Makefile.in: Rebuild.
11738
edfbb029
CC
117392008-04-16 Cary Coutant <ccoutant@google.com>
11740
11741 * i386.cc (Target_i386::define_tls_base_symbol): New function.
11742 (Target_i386::tls_base_symbol_defined_): New field.
11743 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
11744 (Target_i386::Scan::global): Likewise.
11745 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
11746 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
11747 (Target_x86_64::tls_base_symbol_defined_): New field.
11748 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
11749 (Target_x86_64::Scan::global): Likewise.
11750
f3c69fca
CC
117512008-04-16 Cary Coutant <ccoutant@google.com>
11752
11753 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
11754 (Symbol::needs_plt_entry): Allow weak undefined symbols.
11755 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
11756 building shared libraries.
11757 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
11758 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
11759 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
11760 * testsuite/Makefile.in: Rebuild.
11761 * testsuite/weak_undef.h: New file.
11762 * testsuite/weak_undef_file1.cc: Add extra test cases.
11763 * testsuite/weak_undef_file2.cc: Likewise.
11764 * testsuite/weak_undef_test.cc: Likewise.
11765
7c414435
DM
117662008-04-16 David S. Miller <davem@davemloft.net>
11767
32b769e1
DM
11768 * sparc.cc (Target_sparc::Scan): Change from struct to class.
11769 Add issued_non_pic_error_ field. Declare check_non_pic.
11770 (Target_sparc::Scan::check_non_pic): New function.
11771 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
11772 (Target_sparc::Scan::global): Likewise.
11773
11936fb1
DM
11774 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
11775 * configure: Rebuild.
11776
7c414435
DM
11777 * options.h (DEFINE_enable): New macro.
11778 (new_dtags): New enable option.
11779 (initfirst, interpose, loadfltr, nodefaultlib,
11780 nodelete, nodlopen, nodump): New -z options.
11781 * layout.cc (Layout:finish_dynamic_section): If new
11782 dtags enabled, emit DT_RUNPATH. Also, emit a
11783 DT_FLAGS_1 containing any specified -z flags.
11784
85c7bf8b
ILT
117852008-04-16 Ian Lance Taylor <iant@google.com>
11786
12c0daef
ILT
11787 * copy-relocs.cc: New file.
11788 * copy-relocs.h: New file.
11789 * reloc.cc: Remove Copy_relocs code.
11790 * reloc.h: Likewise.
11791 * reloc-types.h (struct Reloc_types) [both versions]: Add
11792 get_reloc_addend_noerror.
11793 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
11794 variants of add_global which take an addend which must be zero.
11795 * i386.cc: Include "copy-relocs.h".
11796 (class Target_i386): Change type of copy_relocs_ to variable,
11797 update initializer.
11798 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
11799 Change all callers.
11800 (Target_i386::do_finalize_sections): Change handling of
11801 copy_relocs_.
11802 * sparc.cc: Include "copy-relocs.h".
11803 (class Target_sparc): Change type of copy_relocs_ to variable,
11804 update initializer.
11805 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
11806 Change all callers.
11807 (Target_sparc::do_finalize_sections): Change handling of
11808 copy_relocs_.
11809 * x86_64.cc: Include "copy-relocs.h".
11810 (class Target_x86_64): Change type of copy_relocs_ to variable,
11811 update initializer.
11812 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
11813 class. Change all callers.
11814 (Target_x86_64::do_finalize_sections): Change handling of
11815 copy_relocs_.
11816 * Makefile.am (CCFILES): Add copy-relocs.cc.
11817 (HFILES): Add copy-relocs.h.
11818
4f4995b6
ILT
11819 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
11820
85c7bf8b
ILT
11821 * testsuite/script_test_4.sh: Permit leading zeroes.
11822
4f2a9edd
ILT
118232008-04-15 Ian Lance Taylor <iant@google.com>
11824
e6188289
ILT
11825 * script-sections.cc (Script_sections::create_segments): Use
11826 header_size_adjustment even when there is enough room for the
11827 headers.
11828 * testsuite/script_test_4.sh: New file.
11829 * testsuite/script_test_4.t: New file.
11830 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
11831 (check_DATA): Add script_test_4.stdout.
11832 (MOSTLYCLEANFILES): Likewise.
11833 (script_test_4): New target.
11834 (script_test_4.stdout): New target.
11835 * testsuite/Makefile.in: Rebuild.
11836
4f2a9edd
ILT
11837 * sparc.cc: Add definitions for Output_data_plt_sparc class
11838 constants.
11839
f5314dd5
DM
118402008-04-14 David S. Miller <davem@davemloft.net>
11841
11842 * sparc.cc: New file.
11843 * Makefile.am (TARGETSOURCES): Add sparc.cc
11844 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
11845 * configure.tgt: Document targ_extra_size and
11846 targ_extra_big_endian. Add entries for sparc-* and
11847 sparc64-*.
11848 * configure.ac: Handle targ_extra_size and
11849 targ_extra_big_endian.
11850 * Makefile.in: Rebuild.
11851 * configure: Likewise.
11852 * po/POTFILES.in: Likewise.
11853 * po/gold.pot: Likewise.
11854
154e0e9a
ILT
118552008-04-14 Ian Lance Taylor <iant@google.com>
11856
11857 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
11858 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
11859 in the name/type/flags to section mapping. Don't call
11860 allocate_output_section.
11861 (Layout::choose_output_section): Change parameter from adjust_name
11862 to is_input_section. Don't permit input sections after sections
11863 are attached to segments. Don't call allocate_output_section.
11864 (Layout::layout_eh_frame): Call update_flags_for_input_section,
11865 not write_enable_output_section.
11866 (Layout::make_output_section): Don't push to
11867 unattached_section_list_ nor call attach_to_segment. Call
11868 attach_section_to_segment if sections are attached.
11869 (Layout::attach_sections_to_segments): New function.
11870 (Layout::attach_section_to_segment): New function.
11871 (Layout::attach_allocated_section_to_segment): Rename from
11872 attach_to_segment. Remove flags parameter.
11873 (Layout::allocate_output_section): Remove function.
11874 (Layout::write_enable_output_section): Remove function.
11875 * layout.h (class Layout): Update for above changes. Add new
11876 field sections_are_attached_.
11877 * output.h (Output_section::update_flags_for_input_section): New
11878 function.
11879 * output.cc (Output_section::add_input_section): Call
11880 update_flags_for_input_section.
11881 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
11882
009a67a2
CC
118832008-04-11 Cary Coutant <ccoutant@google.com>
11884
11885 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
11886 thought unnecessary.
11887 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
11888
759b1a24
ILT
118892008-04-11 Ian Lance Taylor <iant@google.com>
11890
11891 * output.h (class Output_section_data): Remove inline definition
11892 of set_addralign.
11893 * output.cc (Output_section_data::set_addralign): New function.
11894
c2b45e22
CC
118952008-04-11 Cary Coutant <ccoutant@google.com>
11896
11897 Add support for TLS descriptors for i386 and x86_64.
11898 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
11899 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
11900 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
11901 GOT_TYPE_TLS_DESC.
11902 (Target_i386::got_mod_index_entry): Remove unnecessary code.
11903 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
11904 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
11905 relocations.
11906 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
11907 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
11908 Fix problem with initial-exec relocations.
11909 (Target_i386::Relocate::relocate_tls): Likewise.
11910 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
11911 relaxation.
11912 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
11913 support for section-plus-offset dynamic table entries.
11914 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
11915 (Output_data_dynamic::Dynamic_entry): Add support for
11916 section-plus-offset dynamic table entries.
11917 (Output_data_dynamic::Classification): Likewise.
11918 (Output_data_dynamic::classification_): Renamed offset_.
11919 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
11920 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
11921 (Target_x86_64::make_plt_section): New function.
11922 (Target_x86_64::reserve_tlsdesc_entries): New function.
11923 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
11924 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
11925 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
11926 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
11927 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
11928 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
11929 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
11930 add extra PLT entry for TLS descriptors.
11931 (Output_data_plt_x86_64::got_): New field.
11932 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
11933 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
11934 fields.
11935 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
11936 descriptors.
11937 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
11938 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
11939 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
11940 R_386_TLS_DESC_CALL relocations.
11941 (Target_x86_64::Scan::global): Likewise.
11942 (Target_x86_64::do_finalize_sections): Add dynamic table entries
11943 for TLS descriptors.
11944 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
11945 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
11946 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
11947 GD-to-IE relaxation.
11948 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
11949 and TLS_DESCRIPTORS.
11950 * Makefile.in: Rebuild.
11951 * configure: Rebuild.
11952 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
11953 (tls_test_shared2.so): New target.
11954 (tls_shared_gd_to_ie_test_SOURCES): New variable.
11955 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
11956 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
11957 (tls_shared_gd_to_ie_test_LDADD): New variable.
11958 (tls_shared_gnu2_gd_to_ie_test): New target.
11959 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
11960 New targets.
11961 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
11962 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
11963 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
11964 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
11965 (tls_shared_gnu2_test): New target.
11966 (tls_test_gnu2_shared.so): New target.
11967 (tls_shared_gnu2_test_SOURCES): New variable.
11968 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
11969 (tls_shared_gnu2_test_LDFLAGS): New variable.
11970 (tls_shared_gnu2_test_LDADD): New variable.
11971 * testsuite/Makefile.in: Rebuild.
11972 * testsuite/Makefile.
11973
83bfb6b7
ILT
119742008-04-11 Ian Lance Taylor <iant@google.com>
11975
11976 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
11977 justsyms.t.
11978 * testsuite/Makefile.in: Rebuild.
11979
11980 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
11981 long.
11982 * testsuite/script_test_2.cc (main): Adjust test.
11983
706e1f5e
ILT
119842008-04-11 David S. Miller <davem@davemloft.net>
11985 Ian Lance Taylor <iant@google.com>
11986
11987 * options.h (General_options): Add entries for '-Y' and
11988 '-relax'.
11989 * options.cc (General_options:finalize): If -Y was used, add those
11990 entries to the library path instead of the default "/lib" and
11991 "/usr/lib".
11992
7c98e6bb
DM
119932008-04-11 David S. Miller <davem@davemloft.net>
11994
11995 * testsuite/justsyms.t: Start at 0x100.
11996 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
11997 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
11998 long.
11999 * testsuite/script_test_2.cc: Adjust string and section length
12000 checks.
7c98e6bb 12001
99a37bfd
ILT
120022008-04-09 Ian Lance Taylor <iant@google.com>
12003
2cefc357
ILT
12004 PR gold/5996
12005 * script-sections.cc (Sections_element::allocate_to_segment): Add
12006 orphan parameter.
12007 (Output_section_definition::allocate_to_segment): Likewise.
12008 (Orphan_output_section::allocate_to_segment): Likewise.
12009 (Script_sections::attach_sections_using_phdrs_clause): Don't
12010 propagate non-PT_LOAD segments to orphan sections.
12011 * testsuite/Makefile.am (script_test_3.stdout): Generate using
12012 readelf rather than objdump.
12013 * testsuite/script_test_3.sh: Adjust accordingly. Test that
12014 .interp section and PT_INTERP segment are the same size.
12015 * testsuite/Makefile.in: Rebuild.
12016
99a37bfd
ILT
12017 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
12018 aliases for symbols defined in the same object.
12019 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
12020 (weak_alias_test_SOURCES): New variable.
12021 (weak_alias_test_DEPENDENCIES): New variable.
12022 (weak_alias_test_LDFLAGS): New variable.
12023 (weak_alias_test_LDADD): New variable.
12024 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
12025 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
12026 (weak_alias_test_3.o): New target.
12027 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
12028 * testsuite/weak_alias_test_main.cc: New file.
12029 * testsuite/weak_alias_test_1.cc: New file.
12030 * testsuite/weak_alias_test_2.cc: New file.
12031 * testsuite/weak_alias_test_3.cc: New file.
12032
780e49c5
ILT
120332008-04-08 Ian Lance Taylor <iant@google.com>
12034
cdb0b8f5
ILT
12035 * options.h (class General_options): Add --noinhibit-exec option.
12036 * main.cc (main): Check --noinhibit-exec.
12037
0864d551
ILT
12038 * options.h (class General_options): Define --wrap as a special
12039 option. Add wrap_symbols_ field.
12040 (General_options::any_wrap_symbols): New function.
12041 (General_options::is_wrap_symbol): New function.
12042 * options.cc (General_options::parse_wrap): New function.
12043 (General_options::General_options): Initialize wrap_symbols_.
12044 * symtab.cc (Symbol_table::wrap_symbol): New function.
12045 (Symbol_table::add_from_object): Handle --wrap.
12046 * symtab.h (class Symbol_table): Declare wrap_symbol.
12047 * target.h (Target::wrap_char): New function.
12048 (Target::Target_info): Add wrap_char field.
12049 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
12050 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12051 * testsuite/testfile.cc (Target_test::test_target_info):
12052 Likewise.
12053
789aa6de
ILT
12054 * errors.cc (Errors::undefined_symbol): Mention symbol version if
12055 there is one.
12056
2c38906f
ILT
12057 * layout.h (class Layout): Add added_eh_frame_data_ field.
12058 * layout.cc (Layout::Layout): Initialize new field.
12059 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
12060 output section until we find a section we merged successfully.
12061 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
12062 that the size be non-zero.
12063
780e49c5
ILT
12064 * merge.cc (Object_merge_map::get_output_offset): Remove inline
12065 qualifier.
12066
7fcd0256
ILT
120672008-04-08 Craig Silverstein <csilvers@google.com>
12068
12069 * configure.ac: Export new conditional variable HAVE_ZLIB.
12070 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
12071 on HAVE_ZLIB.
12072 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
12073 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12074
6835af53
ILT
120752008-04-07 Ian Lance Taylor <iant@google.com>
12076
e24f324c
ILT
12077 * version.cc (version_string): Set to "1.5".
12078
a036edd8
ILT
12079 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
12080 Add issued_non_pic_error_ field. Declare check_non_pic.
12081 (Target_x86_64::Scan::check_non_pic): New function.
12082 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
12083 (Target_x86_64::Scan::global): Likewise.
12084
624f8810
ILT
12085 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
12086 addend parameter. Change caller. Handle merge sections.
12087 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
12088 Address to Addend. Don't add in the result of
12089 local_section_offset, pass down the addend and use the returned
12090 value.
12091 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
12092 Update declarations of local_section_offset and symbol_value.
12093 * testsuite/two_file_test_1.cc (t18): New function.
12094 * testsuite/two_file_test_2.cc (f18): New function.
12095 * testsuite/two_file_test_main.cc (main): Call t18.
12096 * testsuite/two_file_test.h (t18, f18): Declare.
12097
6835af53
ILT
12098 * configure.ac: Don't test for objdump, c++filt, or readelf.
12099 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
12100 conditionals.
12101 (TEST_READELF): New variable.
12102 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
12103 (check_PROGRAMS): Add two_file_strip_test.
12104 (two_file_strip_test): New target.
12105 (check_PROGRAMS): Add two_file_same_shared_strip_test.
12106 (two_file_same_shared_strip_test_SOURCES): New variable.
12107 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
12108 (two_file_same_shared_strip_test_LDFLAGS): New variable.
12109 (two_file_same_shared_strip_test_LDADD): New variable.
12110 (two_file_shared_strip.so): New target.
12111 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
12112 (ver_test_5.syms, ver_test_7.syms): Likewise.
12113 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
12114 (strip_test_3.stdout): Use TEST_OBJDUMP.
12115 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12116
86925eef
CC
121172008-04-04 Cary Coutant <ccoutant@google.com>
12118
12119 * symtab.h (Symbol::is_weak_undefined): New function.
12120 (Symbol::is_strong_undefined): New function.
12121 (Symbol::is_absolute): New function.
12122 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
12123 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
12124 absolute symbols.
12125 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
12126 (weak_undef_test): New target.
12127 * testsuite/Makefile.in: Rebuild.
12128 * testsuite/weak_undef_file1.cc: New file.
12129 * testsuite/weak_undef_file2.cc: New file.
12130 * testsuite/weak_undef_test.cc: New file.
12131
126f3ece
ILT
121322008-04-03 Craig Silverstein <csilvers@google.com>
12133
12134 * compressed_output.h (class Output_compressed_section): Use
12135 unsigned buffer.
12136 * compressed_output.cc (zlib_compress): Use unsigned buffers,
12137 add zlib header.
12138 (zlib_compressed_suffix): Removed.
12139 (Output_compressed_section::set_final_data_size): Use unsigned
12140 buffers.
12141 * testsuite/Makefile.am (flagstest_compress_debug_sections):
12142 Fix linker invocation.
12143 (flagstest_o_specialfile_and_compress_debug_sections):
12144 Likewise.
12145 * testsuite/Makefile.in: Regenerated.
12146
deae2a14
DM
121472008-04-02 David S. Miller <davem@davemloft.net>
12148
12149 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
12150 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
12151
70752818
ILT
121522008-04-02 Craig Silverstein <csilvers@google.com>
12153
12154 * TODO: New file.
12155
39d0cb0e
ILT
121562008-04-02 Ian Lance Taylor <iant@google.com>
12157
12158 * fileread.cc (File_read::find_view): Add byteshift and vshifted
12159 parameters. Update for new key type to views_. Change all
12160 callers.
12161 (File_read::read): Adjust for byteshift in returned view.
12162 (File_read::add_view): New function, broken out of
12163 find_and_make_view.
12164 (File_read::make_view): New function, broken out of
12165 find_and_make_view.
12166 (File_read::find_or_make_view): Add offset and aligned
12167 parameters. Rewrite accordingly. Change all callers.
12168 (File_read::get_view): Add offset and aligned parameters. Adjust
12169 for byteshift in return value.
12170 (File_read::get_lasting_view): Likewise.
12171 * fileread.h (class File_read): Update declarations.
12172 (class File_read::View): Add byteshift_ field. Add byteshift to
12173 constructor. Add byteshift method.
12174 * archive.h (Archive::clear_uncached_views): New function.
12175 (Archive::get_view): Add aligned parameter. Change all callers.
12176 * object.h (Object::get_view): Add aligned parameter. Change all
12177 callers.
12178 (Object::get_lasting_view): Likewise.
12179
12180 * fileread.cc (File_read::release): Don't call clear_views if
12181 there are multiple objects.
12182 * fileread.h (File_read::clear_uncached_views): New function.
12183 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
12184 on the archive.
12185
a1207466
CC
121862008-03-31 Cary Coutant <ccoutant@google.com>
12187
12188 Add thin archive support.
12189 * archive.cc (Archive::armagt): New const.
12190 (Archive::setup): Remove task parameter and calls to unlock.
12191 (Archive::unlock_nested_archives): New function.
12192 (Archive::read_header): Add nested_off parameter. Change
12193 all callers.
12194 (Archive::interpret_header): Likewise.
12195 (Archive::include_all_members): Change to handle thin
12196 archives.
12197 (Archive::include_member): Likewise.
12198 * archive.h (Archive::Archive): Add new parameters and
12199 initializers.
12200 (Archive::armagt): New const.
12201 (Archive::setup): Remove task parameter.
12202 (Archive::unlock_nested_archives): New function.
12203 (Archive::read_header): Add nested_off parameter.
12204 (Archive::interpret_header): Likewise.
12205 (Archive::Nested_archive_table): New typedef.
12206 (Archive::is_thin_archive_): New field.
12207 (Archive::nested_archives_): New field.
12208 (Archive::options_): New field.
12209 (Archive::dirpath_): New field.
12210 (Archive::task_): New field.
12211 * readsyms.cc (Read_symbols::do_read_symbols): Add check
12212 for thin archives. Pass additional parameters to
12213 Archive::Archive. Unlock the archive file after calling
12214 Archive::setup.
cd536b21 12215
479f6503
ILT
122162008-03-29 Ian Lance Taylor <iant@google.com>
12217
686c8caf
ILT
12218 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
12219 version symbol to be local.
12220 * testsuite/ver_test_4.sh: New file.
12221 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
12222 (check_DATA): Add ver_test_4.syms.
12223 (ver_test_4.syms): New target.
12224 * testsuite/Makefile.in: Rebuild.
12225
ab794b6b
ILT
12226 * output.cc
12227 (Output_section::Input_section_sort_entry::has_priority): New
12228 function.
12229 (Output_section::Input_section_sort_entry::match_file_name): New
12230 function.
12231 (Output_section::Input_section_sort_entry::match_section_name):
12232 Remove.
12233 (Output_section::Input_section_sort_entry::match_section_name_prefix):
12234 Remove.
12235 (Output_section::Input_section_sort_entry::match_section_file):
12236 Remove.
12237 (Output_section::Input_section_sort_compare::operator()): Rewrite
12238 using new Input_section_sort_entry functions. Sort crtbegin and
12239 crtend first. Sort sections with no priority before sections with
12240 a priority.
12241 * testsuite/initpri1.c (d3): Check j != 4.
12242 (cd5): New constructor/destructor function.
12243 (main): Check j != 2.
12244
479f6503
ILT
12245 * symtab.cc (Symbol_table::add_from_object): If we don't use the
12246 new symbol when resolving, don't call set_is_default.
12247 * testsuite/ver_test_7.cc: New file.
12248 * testsuite/ver_test_7.sh: New file.
12249 * testsuite/Makefile.am (ver_test_7.so): New target.
12250 (ver_test_7.o): New target.
12251 (check_SCRIPTS): Add ver_test_7.sh.
12252 (check_DATA): Add ver_test_7.syms.
12253 (ver_test_7.syms): New target.
12254
2fd32231
ILT
122552008-03-28 Ian Lance Taylor <iant@google.com>
12256
12257 * layout.cc (Layout::layout): If we see an input section with a
12258 name that needs sorting, set the must_sort flag for the output
12259 section.
12260 (Layout::make_output_section): If the name of the output section
12261 indicates that it might require sorting, set the may_sort flag.
12262 * output.h (Output_section::may_sort_attached_input_sections): New
12263 function.
12264 (Output_section::set_may_sort_attached_input_sections): New
12265 function.
12266 (Output_section::must_sort_attached_input_sections): New
12267 function.
12268 (Output_section::set_must_sort_attached_input_sections): New
12269 function.
12270 (class Output_section): Declare Input_section_sort_entry. Define
12271 Input_section_sort_compare. Declare
12272 sort_attached_input_sections. Add new fields:
12273 may_sort_attached_input_sections_,
12274 must_sort_attached_input_sections_,
12275 attached_input_sections_are_sorted_.
12276 * output.cc (Output_section::Output_section): Initialize new
12277 fields.
12278 (Output_section::add_input_section): Add an entry to
12279 input_sections_ if may_sort or must_sort are true.
12280 (Output_section::set_final_data_size): Call
12281 sort_attached_input_sections if necessary.
12282 (Output_section::Input_section_sort_entry): Define new class.
12283 (Output_section::Input_section_sort_compare::operator()): New
12284 function.
12285 (Output_section::sort_attached_input_sections): New function.
12286 * configure.ac: Check whether the compiler supports constructor
12287 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
12288 * testsuite/initpri1.c: New file.
12289 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
12290 CONSTRUCTOR_PRIORITY.
12291 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
12292 (initpri1_LDFLAGS): New variable.
12293 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12294
18e6b24e
ILT
122952008-03-27 Ian Lance Taylor <iant@google.com>
12296
49bdd526
ILT
12297 * common.cc (Sort_commons::operator): Correct sorting algorithm.
12298 * testsuite/common_test_1.c: New file.
12299 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
12300 (common_test_1_SOURCES): New variable.
12301 (common_test_1_DEPENDENCIES): New variable.
12302 (common_test_1_LDFLAGS): New variable.
12303
18e6b24e
ILT
12304 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
12305 and commons_ correctly when NAME/VERSION does not override
12306 NAME/NULL.
12307 * testsuite/ver_test_6.c: New file.
12308 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
12309 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
12310 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
12311
04bf7072
ILT
123122008-03-26 Ian Lance Taylor <iant@google.com>
12313
5871526f
ILT
12314 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
12315 of an undefined symbol from a version script.
12316 * testsuite/Makefile.am (ver_test_5.so): New target.
12317 (ver_test_5.o): New target.
12318 (check_SCRIPTS): Add ver_test_5.sh.
12319 (check_DATA): Add ver_test_5.syms.
12320 (ver_test_5.syms): New target.
12321 * testsuite/ver_test_5.cc: New file.
12322 * testsuite/ver_test_5.script: New file.
12323 * testsuite/ver_test_5.sh: New file.
12324 * Makefile.in, testsuite/Makefile.in: Rebuild.
12325
04bf7072
ILT
12326 PR gold/5986
12327 Fix problems building gold with gcc 4.3.0.
12328 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
12329 (gold_error_at_location, gold_warning_at_location): Use it.
12330 * configure.ac: Check whether we can compile and use a template
12331 function with a printf attribute.
12332 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
12333 when jumping over bytes.
12334 * object.cc: Instantiate Object::read_section_data.
12335 * debug.h: Include <cstring>
12336 * dwarf_reader.cc: Include <algorithm>
12337 * main.cc: Include <cstring>.
12338 * options.cc: Include <cstring>.
12339 * output.cc: Include <cstring>.
12340 * script.cc: Include <cstring>.
12341 * script.h: Include <string>.
12342 * symtab.cc: Include <cstring> and <algorithm>.
12343 * target-select.cc: Include <cstring>.
12344 * version.cc: Include <string>.
12345 * testsuite/testmain.cc: Include <cstdlib>.
12346 * configure, config.in: Rebuild.
12347
874c5b28
ILT
123482008-03-25 Ian Lance Taylor <iant@google.com>
12349
819d6c3a
ILT
12350 * options.cc: Include "../bfd/bfdver.h".
12351 (options::help): Print bug reporting address.
12352
f4b2c6f5
ILT
12353 * version.cc (print_version): Adjust output for current value of
12354 BFD_VERSION_STRING.
12355
12356 * NEWS: New file.
12357
e96caa79
ILT
12358 * options.cc (options::help): Print list of supported targets.
12359 * target-select.h: Include <vector>.
12360 (class Target_selector): Make machine_, size_, and is_big_endian_
12361 fields const. Add bfd_name_ and instantiated_target_ fields.
12362 (Target_selector::Target_selector): Add bfd_name parameter.
12363 (Target_selector::recognize): Make non-virtual, call
12364 do_recognize.
12365 (Target_selector::recognize_by_name): Make non-virtual, call
12366 do_recognize_by_name.
12367 (Target_selector::supported_names): New function.
12368 (Target_selector::bfd_name): New function.
12369 (Target_selector::do_instantiate_target): New pure virtual
12370 function.
12371 (Target_selector::do_recognize): New virtual function.
12372 (Target_selector::do_recognize_by_name): New virtual function.
12373 (Target_selector::instantiate_target): New private function.
12374 (supported_target_names): Declare.
12375 * target-select.cc (Target_selector::Target_selector): Update for
12376 new parameter and fields.
12377 (select_target_by_name): Check that the name matches before
12378 calling recognize_by_name.
12379 (supported_target_names): New function.
12380 * i386.cc (class Target_selector_i386): Update Target_selector
12381 constructor call. Remove recognize and recognize_by_name. Add
12382 do_instantiate_target.
12383 * x86_64.cc (class Target_selector_x86_64): Likewise.
12384 * testsuite/testfile.cc (class Target_selector_test): Update for
12385 changes to Target_selector.
12386
874c5b28
ILT
12387 * README: Rewrite, with some notes on unsupported features.
12388
0a65a3a7
CC
123892008-03-24 Cary Coutant <ccoutant@google.com>
12390
12391 * i386.cc (Target_i386::Got_type): New enum declaration.
12392 (Target_i386::Scan::local): Updated callers of Output_data_got
12393 member functions.
12394 (Target_i386::Scan::global): Likewise.
12395 (Target_i386::Relocate::relocate): Likewise.
12396 (Target_i386::Relocate::relocate_tls): Likewise.
12397 * object.h (Got_offset_list): New class.
12398 (Sized_relobj::local_has_got_offset): Added got_type parameter.
12399 (Sized_relobj::local_got_offset): Likewise.
12400 (Sized_relobj::set_local_got_offset): Likewise.
12401 (Sized_relobj::local_has_tls_got_offset): Removed.
12402 (Sized_relobj::local_tls_got_offset): Removed.
12403 (Sized_relobj::set_local_tls_got_offset): Removed.
12404 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
12405 * output.cc (Output_data_got::add_global): Added got_type parameter.
12406 (Output_data_got::add_global_with_rel): Likewise.
12407 (Output_data_got::add_global_with_rela): Likewise.
12408 (Output_data_got::add_global_pair_with_rel): New function.
12409 (Output_data_got::add_global_pair_with_rela): New function.
12410 (Output_data_got::add_local): Added got_type parameter.
12411 (Output_data_got::add_local_with_rel): Likewise.
12412 (Output_data_got::add_local_with_rela): Likewise.
12413 (Output_data_got::add_local_pair_with_rel): New function.
12414 (Output_data_got::add_local_pair_with_rela): New function.
12415 (Output_data_got::add_global_tls): Removed.
12416 (Output_data_got::add_global_tls_with_rel): Removed.
12417 (Output_data_got::add_global_tls_with_rela): Removed.
12418 (Output_data_got::add_local_tls): Removed.
12419 (Output_data_got::add_local_tls_with_rel): Removed.
12420 (Output_data_got::add_local_tls_with_rela): Removed.
12421 * output.h (Output_data_got::add_global): Added got_type parameter.
12422 (Output_data_got::add_global_with_rel): Likewise.
12423 (Output_data_got::add_global_with_rela): Likewise.
12424 (Output_data_got::add_global_pair_with_rel): New function.
12425 (Output_data_got::add_global_pair_with_rela): New function.
12426 (Output_data_got::add_local): Added got_type parameter.
12427 (Output_data_got::add_local_with_rel): Likewise.
12428 (Output_data_got::add_local_with_rela): Likewise.
12429 (Output_data_got::add_local_pair_with_rel): New function.
12430 (Output_data_got::add_local_pair_with_rela): New function.
12431 (Output_data_got::add_global_tls): Removed.
12432 (Output_data_got::add_global_tls_with_rel): Removed.
12433 (Output_data_got::add_global_tls_with_rela): Removed.
12434 (Output_data_got::add_local_tls): Removed.
12435 (Output_data_got::add_local_tls_with_rel): Removed.
12436 (Output_data_got::add_local_tls_with_rela): Removed.
12437 * resolve.cc (Symbol::override_base_with_special): Removed
12438 reference to has_got_offset_ field.
12439 * symtab.cc (Symbol::init_fields): Replaced initialization
12440 of got_offset_ with got_offsets_. Removed initialization
12441 of has_got_offset_
53fcba31 12442 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
12443 (Symbol::got_offset): Likewise.
12444 (Symbol::set_got_offset): Likewise.
12445 (Symbol::has_tls_got_offset): Removed.
12446 (Symbol::tls_got_offset): Removed.
12447 (Symbol::set_tls_got_offset): Removed.
12448 (Symbol::got_offset_): Removed.
12449 (Symbol::tls_mod_got_offset_): Removed.
12450 (Symbol::tls_pair_got_offset_): Removed.
12451 (Symbol::got_offsets_): New field.
12452 (Symbol::has_got_offset): Removed.
12453 (Symbol::has_tls_mod_got_offset): Removed.
12454 (Symbol::has_tls_pair_got_offset): Removed.
12455 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
12456 (Target_x86_64::Scan::local): Updated callers of Output_data_got
12457 member functions.
12458 (Target_x86_64::Scan::global): Likewise.
12459 (Target_x86_64::Relocate::relocate): Likewise.
12460 (Target_x86_64::Relocate::relocate_tls): Likewise.
12461
bd52eafb
BE
124622008-03-25 Ben Elliston <bje@au.ibm.com>
12463
12464 * yyscript.y: Fix spelling error in comment.
12465
8b105e34
ILT
124662008-03-24 Ian Lance Taylor <iant@google.com>
12467
8ed814a9
ILT
12468 * options.h (class General_options): Define build_id option.
12469 * layout.h (class Layout): Declare write_build_id, create_note,
12470 create_build_id. Add build_id_note_ member.
12471 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
12472 "libiberty.h", "md5.h", "sha1.h".
12473 (Layout::Layout): Initialize eh_frame_data_,
12474 eh_frame_hdr_section_, and build_id_note_.
12475 (Layout::finalize): Call create_build_id.
12476 (Layout::create_note): New function, broken out of
12477 Layout::create_gold_note.
12478 (Layout::create_gold_note): Call create_note.
12479 (Layout::create_build_id): New function.
12480 (Layout::write_build_id): New function.
12481 (Close_task_runner::run): Call write_build_id.
12482
8b105e34
ILT
12483 * x86_64.cc: Correct license to GPLv3.
12484
086a1841
ILT
124852008-03-23 Ian Lance Taylor <iant@google.com>
12486
12487 * options.cc: Include "demangle.h".
12488 (parse_optional_string): New function.
12489 (parse_long_option): Handle takes_optional_argument.
12490 (parse_short_option): Update dash_z initializer. Handle
12491 takes_optional_argument.
12492 (General_options::General_options): Initialize do_demangle_.
12493 (General_options::finalize): Set do_demangle_. Handle demangling
12494 style.
12495 * options.h (parse_optional_string): Declare.
12496 (struct One_option): Add optional_arg field. Update constructor.
12497 Update call constructor calls. Add takes_optional_argument
12498 function.
12499 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
12500 (DEFINE_optional_string): Define.
12501 (General_options::demangle): Change from DEFINE_bool to
12502 DEFINE_optional_string.
12503 (General_options::no_demangle): New function.
12504 (General_options::do_demangle): New function.
12505 (General_options::set_do_demangle): New function.
12506 (General_options::execstack_status_): Move definition to end of
12507 class definition.
12508 (General_options::static_): Likewise.
12509 (General_options::do_demangle_): New field.
12510 * object.cc (big_endian>::get_symbol_location_info): Call
12511 Options::do_demangle, not Options::demangle.
12512 * symtab.cc (demangle): Likewise.
12513
cbb93e63
ILT
125142008-03-22 Ian Lance Taylor <iant@google.com>
12515
12516 * gold.h: Include <cstddef> and <sys/types.h>
12517 * options.h: Include <cstring>.
12518
ec531623
ILT
125192008-03-21 Ian Lance Taylor <iant@google.com>
12520
12521 * Added source code to GNU binutils.
This page took 0.984877 seconds and 4 git commands to generate.