* blockframe.c (find_pc_partial_function_gnu_ifunc): Change type of
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
63887f3d
L
12012-01-30 H.J. Lu <hongjiu.lu@intel.com>
2
3 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
4 * configure: Regenerated.
5
bef2b434
ILT
62012-01-27 Ian Lance Taylor <iant@google.com>
7
8 * reloc.h (Bits): New class with static functions, copied from
9 namespace utils in arm.cc.
10 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
11 instead.
12
c335b55d
L
132012-01-27 H.J. Lu <hongjiu.lu@intel.com>
14
15 * incremental.cc (write_info_blocks): Correct relocation offset.
16
41194d9f
L
172012-01-27 H.J. Lu <hongjiu.lu@intel.com>
18
19 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
20 (Relocate::tls_gd_to_le): Likewise.
21
1bae613c
L
222012-01-27 H.J. Lu <hongjiu.lu@intel.com>
23
24 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
25
24482ca0
L
262012-01-27 H.J. Lu <hongjiu.lu@intel.com>
27
28 * configure.ac: Check if -mcmodel=medium works.
29 * configure: Regenerated.
30
c2c7840a
CC
312012-01-24 Cary Coutant <ccoutant@google.com>
32
33 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
34 definition and ...
35 (read_unsigned_LEB_128_x): ... this new function.
36 (read_signed_LEB_128): Replaced with inline definition and ...
37 (read_signed_LEB_128_x): ... this new function.
38 * int_encoding.h (read_unsigned_LEB_128_x): New function.
39 (read_unsigned_LEB_128): Add inline definition.
40 (read_signed_LEB_128_x): New function.
41 (read_signed_LEB_128): Add inline definition.
42 * testsuite/Makefile.am (leb128_unittest): New unit test.
43 * testsuite/Makefile.in: Regenerate.
44 * testsuite/leb128_unittest.cc: New unit test.
45
833de760 462012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
47
48 PR gold/13617
49 * i386.cc (Target_i386::do_code_fill): When using a jmp
50 instruction, pad with nop instructions.
51 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
52
618d6666
L
532012-01-22 H.J. Lu <hongjiu.lu@intel.com>
54
55 * x86_64.cc (gc_process_relocs): Add typename on types used in
56 template.
57 (scan_relocs): Likewise.
58 (relocate_section): Likewise.
59 (apply_relocation): Likewise.
60
3660ff06
L
612012-01-10 H.J. Lu <hongjiu.lu@intel.com>
62
63 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
64 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
65 under x32.
66
fc51264f
L
672012-01-09 H.J. Lu <hongjiu.lu@intel.com>
68
69 * x86_64.cc: Initial support for x32.
70
dd74ae06
CC
712012-01-03 Cary Coutant <ccoutant@google.com>
72
73 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
74 Use abstract base class for GOT.
75 * gold/output.h (class Output_data_got_base): New abstract base class.
76 (class Output_data_got): Derive from new base class, adjust ctors.
77 (Output_data_got::reserve_slot): Make virtual; rename to
78 do_reserve_slot; Adjust callers.
79 * gold/target.h (Sized_target::init_got_plt_for_update): Return
80 pointer to abstract base class.
81 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
82
83896202
ILT
832011-12-18 Ian Lance Taylor <iant@google.com>
84
85 * object.h (Relobj::local_symbol_value): New function.
86 (Relobj::local_plt_offset): New function.
87 (Relobj::local_has_got_offset): New function.
88 (Relobj::local_got_offset): New function.
89 (Relobj::set_local_got_offset): New function.
90 (Relobj::do_local_symbol_value): New pure virtual function.
91 (Relobj::do_local_plt_offset): Likewise.
92 (Relobj::do_local_has_got_offset): Likewise.
93 (Relobj::do_local_got_offset): Likewise.
94 (Relobj::do_set_local_got_offset): Likewise.
95 (Sized_relobj::do_local_has_got_offset): Rename from
96 local_has_got_offset.
97 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
98 (Sized_relobj::do_set_local_got_offset): Rename from
99 set_local_got_offset.
100 (Sized_relobj_file::do_local_plt_offset): Rename from
101 local_plt_offset.
102 (Sized_relobj_file::do_local_symbol_value): New function.
103 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
104 local_plt_offset.
105 * output.cc (Output_data_got::Got_entry::write): Change object to
106 Relobj. Use local_symbol_value.
107 (Output_data_got::add_global_with_rel): Change rel_dyn to
108 Output_data_reloc_generic*. Use add_global_generic.
109 (Output_data_got::add_global_with_rela): Remove. Change all
110 callers to use add_global_with_rel.
111 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
112 Output_data_reloc_generic*. Use add_global_generic.
113 (Output_data_got::add_global_pair_with_rela): Remove. Change all
114 callers to use add_global_pair_with_rel.
115 (Output_data_got::add_local): Change object to Relobj*.
116 (Output_data_got::add_local_plt): Likewise.
117 (Output_data_got::add_local_with_rel): Change object to Relobj*,
118 change rel_dyn to Output_data_reloc_generic*. Use
119 add_local_generic.
120 (Output_data_got::add_local_with_rela): Remove. Change all
121 callers to use all_local_with_rel.
122 (Output_data_got::add_local_pair_with_rel): Change object to
123 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
124 add_output_section_generic.
125 (Output_data_got::add_local_pair_with_rela): Remove. Change all
126 callers to use add_local_pair_with_rel.
127 (Output_data_got::reserve_local): Change object to Relobj*.
128 * output.h: (class Output_data_reloc_generic): Add pure virtual
129 declarations for add_global_generic, add_local_generic,
130 add_output_section_generic.
131 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
132 functions for Output_data_reloc_generic. Update declarations for
133 changes listed in output.cc.
134 (class Output_data_got): Change template parameter to got_size.
135 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
136 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
137 function.
138 (Sized_relobj_incr::do_local_plt_offset): New function.
139 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
140 add_global_generic.
141
76677ad0
CC
1422011-12-17 Cary Coutant <ccoutant@google.com>
143
144 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
145 * resolve.cc (Symbol_table::resolve): Likewise.
146 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
147 arrays.
148 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
149
8b8dd8d5
ILT
1502011-12-16 Ian Lance Taylor <iant@google.com>
151
152 * output.h (Output_data_reloc_generic::add): Only call
153 add_dynamic_reloc if this is a dynamic reloc section.
154
d55525b9
L
1552011-12-15 H.J. Lu <hongjiu.lu@intel.com>
156
157 PR gold/13505
158 * target-reloc.h (apply_relocation): Replace <64, false> with
159 <size, big_endian>.
160
ff81c7c1
NC
1612011-11-25 Nick Clifton <nickc@redhat.com>
162
163 * po/it.po: New Italian translation.
164
628f39be
SA
1652011-11-17 Sterling Augustine <saugustine@google.com>
166
167 * script.cc (script_include_directive): Implement.
168 (read_script_file): New local variables name and search_path. Update
169 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
170 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
171 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
172
98ef3ea4
SA
1732011-11-11 Sterling Augustine <saugustine@google.com>
174
175 * yyscript.y (section_cmd): Add support for INCLUDE directive.
176 (file_or_sections_cmd): Likewise.
177
f4a8b6d7
DK
1782011-11-11 Doug Kwan <dougkwan@google.com>
179
180 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
181 if --just-symbols is given.
182
29ab395d
DK
1832011-11-10 Doug Kwan <dougkwan@google.com>
184
185 PR gold/13362
186 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
187 when processing data relocs.
188 * reloc.h (Relocate_functions::rel_unaligned): New method.
189 (Relocate_functions::pcrel_unaligned): Ditto.
190 (Relocate_functions::rel32_unaligned): Ditto.
191 (Relocate_functions::pcrel32_unaligned): Ditto.
192
2c339f71
DK
1932011-11-09 Doug Kwan <dougkwan@google.com>
194
195 PR gold/13362
196 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
197 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
198 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
199 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
200 (Relocate_functions::rel_unaligned): New.
201 (Relocate_functions::rel32_unaligned): New.
202 * target-reloc.h (relocate_for_relocatable): Add code to handle
203 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
204 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
205 arm_unaligned_reloc_r): New targets.
206 * testsuite/Makefile.in: Regenerate.
207 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
208 linking.
209
3f3cddf1
ILT
2102011-11-02 Ian Lance Taylor <iant@google.com>
211
212 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
213 NATIVE_LINKER.
214 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
215 * options.cc (General_options::finalize): Use library search path
216 from configure script if specified. If not native and no sysroot,
217 only search TOOLLIBDIR.
218 * options.h (Search_directory::Search_directory): Change name to
219 const std::string&.
220 (General_options::add_to_library_path_with_sysroot): Change arg to
221 const std::string&.
222 * configure, Makefile.in, config.in: Rebuild.
223
a8e2273b
ILT
2242011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
225
226 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
227 we are working around the ARM1176 Erratum.
228 * options.h (General_options::fix_arm1176): Add option.
229 * testsuite/Makefile.am: Add testcases, and keep current ones
230 working.
231 * testsuite/Makefile.in: Regenerate.
232 * testsuite/arm_fix_1176.s: New file.
233 * testsuite/arm_fix_1176.sh: Likewise.
234
cd6eab1c
ILT
2352011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
236
237 * arm.cc (Target_arm::Target_arm): Remove initialisation of
238 may_use_blx_.
239 (Target_arm::may_use_blx): Remove method.
240 (Target_arm::set_may_use_blx): Likewise.
241 (Target_arm::may_use_v4t_interworking): New method.
242 (Target_arm::may_use_v5t_interworking): Likewise.
243 (Target_arm::may_use_blx_): Remove member variable.
244 (Arm_relocate_functions::arm_branch_common): Check for v5T
245 interworking.
246 (Arm_relocate_functions::thumb_branch_common): Likewise.
247 (Reloc_stub::stub_type_for_reloc): Likewise.
248 (Target_arm::do_finalize_sections): Correct interworking checks.
249 * testsuite/Makefile.am: Add new tests.
250 * testsuite/Makefile.in: Regenerate.
251 * testsuite/arm_farcall_arm_arm.s: New test.
252 * testsuite/arm_farcall_arm_arm.sh: Likewise.
253 * testsuite/arm_farcall_arm_thumb.s: Likewise.
254 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
255 * testsuite/arm_farcall_thumb_arm.s: Likewise.
256 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
257 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
258 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
259
286adcf4
CC
2602011-10-31 Cary Coutant <ccoutant@google.com>
261
262 PR gold/13023
263 * expression.cc (Expression::eval_with_dot): Add
264 is_section_dot_assignment parameter.
265 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
266 absolute and assigning to dot within a section.
267 * script-sections.cc
268 (Output_section_element_assignment::set_section_addresses): Pass
269 dot_section to set_if_absolute.
270 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
271 as is_section_dot_assignment flag to eval_with_dot.
272 (Output_section_element_dot_assignment::set_section_addresses):
273 Likewise.
274 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
275 parameter. Also set value if relative to dot_section; set the
276 symbol's output_section.
277 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
278 parameter. Adjust all callers.
279 (Expression::eval_maybe_dot): Likewise.
280 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
281 Adjust all callers.
282 * testsuite/script_test_2.t: Test assignment of an absolute value
283 to dot within an output section element.
284
9634ed06
CC
2852011-10-31 Cary Coutant <ccoutant@google.com>
286
287 * options.h (class General_options): Add --[no-]gnu-unique options.
288 * symtab.cc (Symbol_table::sized_write_globals): Convert
289 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
290
de4101c7
CC
2912011-10-31 Cary Coutant <ccoutant@google.com>
292
293 PR gold/13359
294 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
295 unnecessary assertion.
296 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
297
7257cc92
ST
2982011-10-31 Sriraman Tallam <tmsriram@google.com>
299
300 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
301 gc_mark_symbol.
302 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
303 gc_mark_symbol.
304 Change to just keep the section associated with symbol.
305 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
306 they are externally visible and --export-dynamic is turned on.
307 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
308
bfc34b3f
ILT
3092011-10-19 Ian Lance Taylor <iant@google.com>
310
311 PR gold/13163
312 * script-sections.cc
313 (Output_section_element_dot_assignment::needs_output_section): New
314 function.
315
ea0d8c47
ILT
3162011-10-19 Ian Lance Taylor <iant@google.com>
317
318 PR gold/13204
319 * layout.cc (Layout::segment_precedes): Don't assert failure if a
320 --section-start option was seen.
321 * options.h (General_options::any_section_start): New function.
322
abd242a9
DM
3232011-10-18 David S. Miller <davem@davemloft.net>
324
325 PR binutils/13301
326 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
327 member to track relocation locations that have moved during TLS
328 reloc optimizations.
329 (Target_sparc::Relocate::Relocate): Initialize to NULL.
330 (Target_sparc::Relocate::relocate): Adjust view down by 4
331 bytes if it matches reloc_adjust_addr_.
332 (Target_sparc::Relocate::relocate_tls): Always move the
333 __tls_get_addr call delay slot instruction forward 4 bytes when
334 performing relaxation.
335
bab9090f
CC
3362011-10-18 Cary Coutant <ccoutant@google.com>
337
338 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
339 (Output_file::map_no_anonymous): Check for non-zero
340 return code from posix_fallocate.
341
f7c5b166
CC
3422011-10-17 Cary Coutant <ccoutant@google.com>
343
344 PR gold/13245
345 * plugin.cc (is_visible_from_outside): Check for symbols
346 referenced from dynamic objects.
347 * resolve.cc (Symbol_table::resolve): Don't count references
348 from dynamic objects as references from real ELF files.
349 * testsuite/plugin_test_2.sh: Adjust expected result.
350
b490c0bb
CC
3512011-10-17 Cary Coutant <ccoutant@google.com>
352
353 * gold.cc: Include timer.h.
354 (queue_middle_tasks): Stamp time.
355 (queue_final_tasks): Likewise.
356 * main.cc (main): Store timer in parameters. Print timers
357 for each pass.
358 * parameters.cc (Parameters::Parameters): Initialize timer_.
359 (Parameters::set_timer): New function.
360 (set_parameters_timer): New function.
361 * parameters.h (Parameters::set_timer): New function.
362 (Parameters::timer): New function.
363 (Parameters::timer_): New data member.
364 (set_parameters_timer): New function.
365 * timer.cc (Timer::stamp): New function.
366 (Timer::get_pass_time): New function.
367 * timer.h (Timer::stamp): New function.
368 (Timer::get_pass_time): New function.
369 (Timer::pass_times_): New data member.
370
f475cf7b
CC
3712011-10-17 Cary Coutant <ccoutant@google.com>
372
373 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
374 task for members of lib groups.
375
cdd7e244
CC
3762011-10-17 Cary Coutant <ccoutant@google.com>
377
378 PR gold/13288
4f95c8b4 379 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
380 (File_read::make_view): Move bounds check (replace with assert)...
381 (File_read::find_or_make_view): ... to here.
382
dfb45471
CC
3832011-10-12 Cary Coutant <ccoutant@google.com>
384
4f95c8b4 385 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
386 ::read returns less than requested size.
387
53bbcc1b
CC
3882011-10-10 Cary Coutant <ccoutant@google.com>
389
4f95c8b4 390 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
391 Initialize defined_count_.
392 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
393 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
394 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
395 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
396 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 397 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
398 member.
399 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 400 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
401 Return zeroes instead of internal error.
402
397b129b
CC
4032011-10-10 Cary Coutant <ccoutant@google.com>
404
405 PR gold/13249
4f95c8b4 406 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 407 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 408 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
409 (Output_reloc::type_): Adjust size of bit field.
410 (Output_reloc::use_plt_offset_): New bit field.
411 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
412 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
413 flag. Adjust all callers.
4f95c8b4 414 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
415 creating RELATIVE relocations.
416
d5698657
NC
4172011-10-10 Nick Clifton <nickc@redhat.com>
418
419 * po/es.po: Updated Spanish translation.
420 * po/fi.po: Updated Finnish translation.
421
6a59a5c2
DN
4222011-10-03 Diego Novillo <dnovillo@google.com>
423
424 * options.cc (parse_uint): Fix dereference of RETVAL.
425
f0558624
ST
4262011-09-29 Sriraman Tallam <tmsriram@google.com>
427
428 * layout.h (section_order_map_): New member.
429 (get_section_order_map): New member function.
430 * output.cc (Output_section::add_input_section): Check for patterns
431 only when --section-ordering-file is specified.
432 * gold.cc (queue_middle_tasks): Delay updating order of sections till
433 output_sections have been formed.
434 * layout.cc (Layout_Layout): Initialize section_order_map_.
435 * plugin.cc (update_section_order): Store order in order_map. Do not
436 update the order.
437 * testsuite/Makefile.am: Add test case for plugin_final_layout.
438 * testsuite/Makefile.in: Regenerate.
439 * testsuite/plugin_section_order.c: New file.
440 * testsuite/plugin_final_layout.cc: New file.
441 * testsuite/plugin_final_layout.sh: New file.
442
a7dac153
CC
4432011-09-29 Cary Coutant <ccoutant@google.com>
444
4f95c8b4 445 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 446 Check for NULL.
4f95c8b4 447 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
448 symbols during incremental update.
449 (Symbol_table::add_from_dynobj): Likewise.
450
eebd87a5
ILT
4512011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
452 Ian Lance Taylor <iant@google.com>
453
454 * symtab.cc (Symbol_table::define_special_symbol): Always
455 canonicalize version string.
456
403a3331
CC
4572011-09-26 Cary Coutant <ccoutant@google.com>
458
4f95c8b4
CC
459 * gold.cc (queue_initial_tasks): Move option checks ...
460 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
461 some options; make others fatal.
462
235061c2
CC
4632011-09-26 Cary Coutant <ccoutant@google.com>
464
465 gcc PR lto/47247
466 * plugin.cc (get_symbols_v2): New function.
467 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
468 (is_referenced_from_outside): New function.
469 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
470 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
471 (get_symbols): Pass version parameter.
472 (get_symbols_v2): New function.
473 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
474 parameter.
475 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
476 (onload): Add LDPT_GET_SYMBOLS_V2.
477 (all_symbols_read_hook): Use get_symbols_v2; check for
478 LDPR_PREVAILING_DEF_IRONLY_EXP.
479 * testsuite/plugin_test_3.sh: Update expected results.
480
dc87f620
ILT
4812011-09-23 Simon Baldwin <simonb@google.com>
482
483 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
484 configuration options.
485 * configure: Regenerate.
486 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
487 * Makefile.in: Regenerate.
488 * testsuite/Makefile.in: Regenerate.
489
a8279f82
ST
4902011-09-19 Sriraman Tallam <tmsriram@google.com>
491
492 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
493
0c9350c8
CC
4942011-09-19 Cary Coutant <ccoutant@google.com>
495
496 * incremental.cc (can_incremental_update): Fix typo in comment.
497 * incremental.h (can_incremental_update): Likewise.
498
aa06ae28
CC
4992011-09-18 Cary Coutant <ccoutant@google.com>
500
501 * incremental.cc (can_incremental_update): New function.
502 * incremental.h (can_incremental_update): New function.
503 * layout.cc (Layout::init_fixed_output_section): Call it.
504 (Layout::make_output_section): Don't allow patch space in .eh_frame.
505 * object.cc (Sized_relobj_file::do_layout): Call
506 can_incremental_update.
507
ebb300b2
CC
5082011-09-13 Cary Coutant <ccoutant@google.com>
509
510 * configure.ac: Check for glibc support for gnu_indirect_function
511 support with static linking, setting automake conditional
512 IFUNC_STATIC.
513 * Makefile.in: Regenerate.
514 * configure: Regenerate.
515
516 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
517 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
518 for IFUNC_STATIC.
519 * testsuite/Makefile.in: Regenerate.
520
1206d0d5
CC
5212011-09-13 Cary Coutant <ccoutant@google.com>
522
523 * incremental.cc (Sized_relobj_incr::do_layout): Call
524 report_comdat_group for kept comdat sections.
525 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
526 * testsuite/Makefile.in: Regenerate.
527 * testsuite/incr_comdat_test_1.cc: New source file.
528 * testsuite/incr_comdat_test_2_v1.cc: New source file.
529 * testsuite/incr_comdat_test_2_v2.cc: New source file.
530 * testsuite/incr_comdat_test_2_v3.cc: New source file.
531
40b29874
ILT
5322011-09-13 Ian Lance Taylor <iant@google.com>
533
534 * object.cc (Sized_relobj_file::do_layout): Remove unused local
535 variable external_symbols_offset.
536
1b045aac
ILT
5372011-09-12 Ian Lance Taylor <iant@google.com>
538
539 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
540 triggered if object has no symbols.
541
24c6c55a
DM
5422011-09-09 David S. Miller <davem@davemloft.net>
543
544 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
545 (Output_fill_debug_line::do_write): Likewise.
546
66570254
CC
5472011-08-29 Cary Coutant <ccoutant@google.com>
548
549 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
550 casts to match formatting specs.
551 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
552
8ea8cd50
CC
5532011-08-26 Cary Coutant <ccoutant@google.com>
554
555 * layout.cc (Free_list::allocate): Provide guarantee of minimum
556 remaining hole size when allocating.
557 (Layout::make_output_section): Set fill methods for debug sections.
558 * layout.h (Free_list::Free_list_node): Move from private to
559 public.
560 (Free_list::set_min_hole_size): New function.
561 (Free_list::begin, Free_list::end): New functions.
562 (Free_list::min_hole_): New data member.
563 * output.cc: Include dwarf.h.
564 (Output_fill_debug_info::do_minimum_hole_size): New function.
565 (Output_fill_debug_info::do_write): New function.
566 (Output_fill_debug_line::do_minimum_hole_size): New function.
567 (Output_fill_debug_line::do_write): New function.
568 (Output_section::Output_section): Initialize new data member.
569 (Output_section::set_final_data_size): Ensure patch space is larger
570 than minimum hole size.
571 (Output_section::do_write): Fill holes in debug sections.
572 * output.h (Output_fill): New class.
573 (Output_fill_debug_info): New class.
574 (Output_fill_debug_line): New class.
575 (Output_section::set_free_space_fill): New function.
576 (Output_section::free_space_fill_): New data member.
577 * testsuite/Makefile.am (incremental_test_3): Add
578 --incremental-patch option.
579 (incremental_test_4): Likewise.
580 (incremental_test_5): Likewise.
581 (incremental_test_6): Likewise.
582 (incremental_copy_test): Likewise.
583 (incremental_common_test_1): Likewise.
584 * testsuite/Makefile.in: Regenerate.
585
7cf80422
NC
5862011-08-26 Nick Clifton <nickc@redhat.com>
587
588 * po/es.po: Updated Spanish translation.
589
c3f7b0e5
CC
5902011-08-01 Cary Coutant <ccoutant@google.com>
591
592 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
593 * gold/testsuite/Makefile.in: Regenerate.
594 * gold/testsuite/justsyms_exec.c: New source file.
595 * gold/testsuite/justsyms_lib.c: New source file.
596
9590bf25
CC
5972011-08-01 Cary Coutant <ccoutant@google.com>
598
599 * layout.cc (Layout::set_segment_offsets): Don't realign text
600 segment if -Ttext was specified.
601 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
602 file type.
603 * object.h (Sized_relobj_file::e_type): New function.
604 (Sized_relobj_file::e_type_): New data member.
605 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
606 base address for ET_EXEC files.
607 * target.cc (Target::do_make_elf_object_implementation): Allow
608 ET_EXEC files with --just-symbols option.
609
dcd8d12e
CC
6102011-07-28 Cary Coutant <ccoutant@google.com>
611
612 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
613 Add thread_number parameter.
614 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
615 * workqueue-threads.cc
616 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
617 current thread if its thread number is greater than desired thread
618 count.
619 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
620 Add thread_number parameter.
621 (Workqueue::should_cancel_thread): Likewise.
622 (Workqueue::find_runnable_or_wait): Pass thread_number to
623 should_cancel_thread.
624 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
625 parameter.
626
804eb480
ST
6272011-07-22 Sriraman Tallam <tmsriram@google.com>
628
629 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
630 only after checking if it cannot be forced local.
631 * symtab.h (is_externally_visible): Check if the symbol is not forced
632 local.
633
f1ddb600
ILT
6342011-07-15 Ian Lance Taylor <iant@google.com>
635
636 * options.h (class General_options): Add --print-output-format.
637 Move -EL next to -EB, for better --help output.
638 * target-select.cc: Include <cstdio>, "options.h", and
639 "parameters.h".
640 (Target_selector::do_target_bfd_name): New function.
641 (print_output_format): New function.
642 * target-select.h (class Target_selector): Update declarations.
643 (Target_selector::target_bfd_name): New function.
644 (print_output_format): Declare.
645 * main.cc: Include "target-select.h".
646 (main): Handle --print-output-format.
647 * gold.cc: Include "target-select.h".
648 (queue_initial_tasks): Handle --print-output-format when there are
649 no input files.
650 * parameters.cc (parameters_force_valid_target): Give a better
651 error message if -EB/-EL does not match target.
652 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
653 function.
654
7d172687
ILT
6552011-07-15 Ian Lance Taylor <iant@google.com>
656
657 * i386.cc (class Output_data_plt_i386): Add layout_ field.
658 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
659 (Output_data_plt_i386::do_write): Write address of .dynamic
660 section to first entry in .got.plt section.
661 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
662 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
663 Initialize layout_.
664 (Output_data_plt_x86_64::do_write): Write address of .dynamic
665 section to first entry in .got.plt section.
666 * layout.h (Layout::dynamic_section): New function.
667
e9552f7e
ST
6682011-07-13 Sriraman Tallam <tmsriram@google.com>
669
670 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
671 to claim_file call.
672 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
673 input_section_position_, and input_section_glob_.
674 (read_layout_from_file): Call function section_ordering_specified.
675 * layout.h (is_section_ordering_specified): New function.
676 (section_ordering_specified): New function.
677 (section_ordering_specified_): New boolean member.
678 * main.cc(main): Call load_plugins after layout object is defined.
679 * output.cc (Output_section::add_input_section): Use
680 function section_ordering_specified to check if section ordering is
681 needed.
682 * output.cc (Output_section::add_relaxed_input_section): Use
683 function section_ordering_specified to check if section ordering is
684 needed.
685 (Output_section::update_section_layout): New function.
686 (Output_section::sort_attached_input_sections): Check if input section
687 must be reordered.
688 * output.h (Output_section::update_section_layout): New function.
689 * plugin.cc (get_section_count): New function.
690 (get_section_type): New function.
691 (get_section_name): New function.
692 (get_section_contents): New function.
693 (update_section_order): New function.
694 (allow_section_ordering): New function.
695 (Plugin::load): Add the new interfaces to the transfer vector.
696 (Plugin_manager::load_plugins): New parameter.
697 (Plugin_manager::all_symbols_read): New parameter.
698 (Plugin_manager::claim_file): New parameter. Save the elf object for
699 unclaimed objects.
700 (Plugin_manager::get_elf_object): New function.
701 (Plugin_manager::get_view): Change to directly use the bool to check
702 if get_view is called from claim_file_hook.
703 * plugin.h (input_objects): New function
704 (Plugin__manager::load_plugins): New parameter.
705 (Plugin_manager::claim_file): New parameter.
706 (Plugin_manager::get_elf_object): New function.
707 (Plugin_manager::in_claim_file_handler): New function.
708 (Plugin_manager::in_claim_file_handler_): New member.
709 (layout): New function.
710 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
711 handler with an extra parameter. Make the elf object before calling
712 claim_file handler.
713 * testsuite/plugin_test.c (get_section_count): New function pointer.
714 (get_section_type): New function pointer.
715 (get_section_name): New function pointer.
716 (get_section_contents): New function pointer.
717 (update_section_order): New function pointer.
718 (allow_section_ordering): New function pointer.
719 (onload): Check if the new interfaces exist.
720
9446efde
ILT
7212011-07-13 Ian Lance Taylor <iant@google.com>
722
723 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
724 relro section.
725 * x86_64.cc (Target_x86_64::got_section): Likewise.
726 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
727 (relro_now_test_SOURCES): New variable.
728 (relro_now_test_DEPENDENCIES): New variable.
729 (relro_now_test_LDFLAGS): New variable.
730 (relro_now_test_LDADD): New variable.
731 (relro_now_test.so): New target.
732 * testsuite/Makefile.in: Rebuild.
733
07aa62f2
ILT
7342011-07-12 Ian Lance Taylor <iant@google.com>
735
736 PR gold/12980
737 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
738 GLOB_DAT relocation rather than a RELATIVE relocation for a
739 protected symbol when creating a shared library.
740 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
741 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
742 * testsuite/protected_main_1.cc (main): Test that protected
743 function has same address.
744
e2153196
ILT
7452011-07-11 Ian Lance Taylor <iant@google.com>
746
747 PR gold/12979
748 * options.h (class General_options): Add -Bgroup.
749 * options.cc (General_options::finalize): If -Bgroup is set,
750 default to --unresolved-symbols=report-all.
751 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
752 * target-reloc.h (issue_undefined_symbol_error): Handle
753 --unresolved-symbols=report-all.
754
6daf5215
ILT
7552011-07-08 Ian Lance Taylor <iant@google.com>
756
757 PR gold/11985
758 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
759 if linker script discards key sections.
760 (Layout::create_dynamic_symtab): Likewise.
761 (Layout::assign_local_dynsym_offsets): Likewise.
762 (Layout::sized_create_version_sections): Likewise.
763 (Layout::create_interp): Likewise.
764 (Layout::finish_dynamic_section): Likewise.
765 (Layout::set_dynamic_symbol_size): Likewise.
766
beabb2c6
ILT
7672011-07-08 Ian Lance Taylor <iant@google.com>
768
769 PR gold/12386
770 * options.h (class General_options): Add --unresolved-symbols.
771 * target-reloc.h (issue_undefined_symbol_error): Check
772 --unresolved-symbols. Add comments.
773
9c16daf1
ILT
7742011-07-08 Ian Lance Taylor <iant@google.com>
775
776 * testsuite/odr_violation2.cc (Ordering::operator()): Make
777 expression more complex.
778
191f1a2d
ILT
7792011-07-08 Ian Lance Taylor <iant@google.com>
780
781 PR gold/11317
782 * target-reloc.h (issue_undefined_symbol_error): New inline
783 function, broken out of relocate_section.
784 (relocate_section): Call issue_undefined_symbol_error.
785 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
786 there is no TLS segment if we are about to issue an undefined
787 symbol error.
788 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
789
62855347
ILT
7902011-07-08 Ian Lance Taylor <iant@google.com>
791
792 PR gold/12279
793 * resolve.cc (Symbol_table::should_override): Add fromtype
794 parameter. Change all callers. Give error when linking together
795 TLS and non-TLS symbol.
796 (Symbol_table::should_override_with_special): Add fromtype
797 parameter. Change all callers.
798 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
799 there is no TLS segment if we have reported some errors.
800 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
801
67181c72
ILT
8022011-07-08 Ian Lance Taylor <iant@google.com>
803
804 PR gold/12372
805 * target.h (Target::plt_address_for_global): New function.
806 (Target::plt_address_for_local): New function.
807 (Target::plt_section_for_global): Remove.
808 (Target::plt_section_for_local): Remove.
809 (Target::do_plt_address_for_global): New virtual function.
810 (Target::do_plt_address_for_local): New virtual function.
811 (Target::do_plt_section_for_global): Remove.
812 (Target::do_plt_section_for_local): Remove.
813 (Target::register_global_plt_entry): Add Symbol_table and Layout
814 parameters.
815 * output.cc (Output_data_got::Got_entry::write): Use
816 plt_address_for_global and plt_address_for_local.
817 * layout.cc (Layout::add_target_dynamic_tags): Use size and
818 address of output section.
819 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
820 got_irelative_, and irelative_count_ fields. Update
821 declarations.
822 (Output_data_plt_i386::has_irelative_section): New function.
823 (Output_data_plt_i386::entry_count): Add irelative_count_.
824 (Output_data_plt_i386::set_final_data_size): Likewise.
825 (class Target_i386): Add got_irelative_ and rel_irelative_
826 fields. Update declarations.
827 (Target_i386::Target_i386): Initialize new fields.
828 (Target_i386::do_plt_address_for_global): New function replacing
829 do_plt_section_for_global.
830 (Target_i386::do_plt_address_for_local): New function replacing
831 do_plt_section_for_local.
832 (Target_i386::got_section): Create got_irelative_.
833 (Target_i386::rel_irelative_section): New function.
834 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
835 fields. Don't define __rel_iplt_{start,end}.
836 (Output_data_plt_i386::add_entry): Add symtab and layout
837 parameters. Change all callers. Use different PLT and GOT for
838 IFUNC symbols.
839 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
840 layout parameters. Change all callers. Use different PLT and
841 GOT.
842 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
843 (Output_data_plt_i386::rel_irelative): New function.
844 (Output_data_plt_i386::address_for_global): New function.
845 (Output_data_plt_i386::address_for_local): New function.
846 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
847 IRELATIVE GOT when changing IFUNC GOT entries.
848 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
849 reloc.
850 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
851 if we didn't create an IRELATIVE GOT.
852 (Target_i386::Relocate::relocate): Use plt_address_for_global and
853 plt_address_for_local.
854 (Target_i386::do_dynsym_value): Use plt_address_for_global.
855 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
856 got_irelative_, and irelative_count_ fields. Update
857 declarations.
858 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
859 Initialize new fields. Remove symtab parameter. Change all
860 callers.
861 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
862 irelative_count_.
863 (Output_data_plt_x86_64::has_irelative_section): New function.
864 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
865 (class Target_x86_64): Add got_irelative_ and rel_irelative_
866 fields. Update declarations.
867 (Target_x86_64::Target_x86_64): Initialize new fields.
868 (Target_x86_64::do_plt_address_for_global): New function replacing
869 do_plt_section_for_global.
870 (Target_x86_64::do_plt_address_for_local): New function replacing
871 do_plt_section_for_local.
872 (Target_x86_64::got_section): Create got_irelative_.
873 (Target_x86_64::rela_irelative_section): New function.
874 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
875 all callers. Don't create __rel_iplt_{start,end}.
876 (Output_data_plt_x86_64::add_entry): Add symtab and layout
877 parameters. Change all callers. Use different PLT and GOT for
878 IFUNC symbols.
879 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
880 layout parameters. Change all callers. Use different PLT and
881 GOT.
882 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
883 parameters. Change all callers. Use different PLT and GOT for
884 IFUNC symbols.
885 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
886 (Output_data_plt_x86_64::rela_irelative): New function.
887 (Output_data_plt_x86_64::address_for_global): New function.
888 (Output_data_plt_x86_64::address_for_local): New function.
889 (Output_data_plt_x86_64::set_final_data_size): Likewise.
890 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
891 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
892 (Target_x86_64::register_global_plt_entry): Add symtab and layout
893 parameters.
894 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
895 reloc.
896 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
897 symbols if we didn't create an IRELATIVE GOT.
898 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
899 plt_address_for_local.
900 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
901 * testsuite/ifuncvar1.c: New test file.
902 * testsuite/ifuncvar2.c: New test file.
903 * testsuite/ifuncvar3.c: New test file.
904 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
905 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
906 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
907 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
908 * testsuite/Makefile.in: Rebuild.
909
33c15b45
CC
9102011-07-07 Cary Coutant <ccoutant@google.com>
911
912 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
913 (two_file_test_1_ndebug.o): Likewise.
914 (two_file_test_1b_ndebug.o): Likewise.
915 (two_file_test_2_ndebug.o): Likewise.
916 (two_file_test_main_ndebug.o): Likewise.
917 (incremental_test_2): Link with no-debug versions.
918
f48b5fb7
CC
9192011-07-06 Cary Coutant <ccoutant@google.com>
920
921 * gold/incremental.cc
922 (Output_section_incremental_inputs::write_info_blocks): Check for
923 hidden and internal symbols.
924
221597a5
CC
9252011-07-06 Cary Coutant <ccoutant@google.com>
926
927 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
928 Check disposition for startup file.
929 (Incremental_inputs::report_command_line): Ignore
930 --incremental-startup-unchanged option.
931 * options.cc (General_options::parse_incremental_startup_unchanged):
932 New function.
933 (General_options::General_options): Initialize new data member.
934 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
935 (General_options): Add --incremental-startup-unchanged option.
936 (General_options::incremental_startup_disposition): New function.
937 (General_options::incremental_startup_disposition_): New data member.
938
e24719f6
CC
9392011-07-06 Cary Coutant <ccoutant@google.com>
940
941 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
942 input file index to Script_info ctor.
943 (Sized_incremental_binary::do_file_has_changed): Find the
944 command-line argument for files named in scripts.
945 * incremental.h (Script_info::Script_info): New ctor
946 with input file index.
947 (Script_info::input_file_index): New function.
948 (Script_info::input_file_index_): New data member.
949 (Incremental_binary::get_library): Add const.
950 (Incremental_binary::get_script_info): Add const.
951 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
952 * testsuite/Makefile.am (incremental_test_5): New test case.
953 (incremental_test_6): New test case.
954 * testsuite/Makefile.in: Regenerate.
955
8f7c81e8
CC
9562011-07-06 Cary Coutant <ccoutant@google.com>
957
958 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
959 debug output when command lines differ.
960
9fbd3822
CC
9612011-07-06 Cary Coutant <ccoutant@google.com>
962
963 * incremental.cc (Incremental_inputs::report_command_line): Ignore
964 --incremental-patch option.
965 * layout.cc (Free_list::allocate): Extend allocation beyond original
966 end if enabled.
967 (Layout::make_output_section): Mark sections that should get
968 patch space.
969 * options.cc (parse_percent): New function.
970 * options.h (parse_percent): New function.
971 (DEFINE_percent): New macro.
972 (General_options): Add --incremental-patch option.
973 * output.cc (Output_section::Output_section): Initialize new data
974 members.
975 (Output_section::add_input_section): Print section name when out
976 of patch space.
977 (Output_section::add_output_section_data): Likewise.
978 (Output_section::set_final_data_size): Add patch space when
979 doing --incremental-full.
980 (Output_section::do_reset_address_and_file_offset): Remove patch
981 space.
982 (Output_segment::set_section_list_addresses): Print debug output
983 only if --incremental-update.
984 * output.h (Output_section::set_is_patch_space_allowed): New function.
985 (Output_section::is_patch_space_allowed_): New data member.
986 (Output_section::patch_space_): New data member.
987 * parameters.cc (Parameters::incremental_full): New function.
988 * parameters.h (Parameters::incremental_full): New function
989 * testsuite/Makefile.am (incremental_test_2): Add test for
990 --incremental-patch option.
991 * testsuite/Makefile.in: Regenerate.
992 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
993 (t18): Remove function body.
994
f6cccc2c
DK
9952011-07-05 Doug Kwan <dougkwan@google.com>
996
997 PR gold/12771
998 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
999 Arm_Address type for relocation result.
1000 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
1001 overflow check.
1002 (Arm_relocate_functions::abs32): Use unaligned access.
1003 (Arm_relocate_functions::rel32): Ditto.
1004 (Arm_relocate_functions::prel31): Ditto.
1005 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
1006 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
1007 static data relocations.
1008 * testsuite/Makefile.in: Regnerate.
1009 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
1010
28a13fec
ILT
10112011-07-05 Ian Lance Taylor <iant@google.com>
1012
1013 PR gold/12392
1014 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
1015 symbols if necessary.
1016 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
1017
24d47b34
ILT
10182011-07-05 Ian Lance Taylor <iant@google.com>
1019
1020 PR gold/12952
1021 * resolve.cc (Symbol::override_base_with_special): Simply override
1022 version with special symbol version, ignoring previous version.
1023
41f9cbbe
ILT
10242011-07-05 Ian Lance Taylor <iant@google.com>
1025
1026 * object.cc (Sized_relobj_file::include_section_group): Add
1027 information to comment about signature location.
1028
886288f1
ILT
10292011-07-02 Ian Lance Taylor <iant@google.com>
1030
1031 PR gold/12957
1032 * options.h (class General_options): Add -f and -F.
1033 * options.cc (General_options::finalize): Fatal error if -f/-F
1034 are used without -shared.
1035 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
1036
ae3a6d4f
ILT
10372011-07-02 Ian Lance Taylor <iant@google.com>
1038
1039 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
1040
21131061
ILT
10412011-07-01 Ian Lance Taylor <iant@google.com>
1042
1043 PR gold/12525
1044 PR gold/12952
1045 * resolve.cc (Symbol::override_base_with_special): Don't override
1046 the version if the overriding symbol has a different name.
1047 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
1048 all callers. If we give an error about an undefined version,
1049 define the base version if necessary.
1050 * dynobj.h (class Versions): Update declaration.
1051 * testsuite/weak_alias_test_5.cc: New file.
1052 * testsuite/weak_alias_test.script: New file.
1053 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
1054 and versioned_alias have the right value, and call t2.
1055 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
1056 weak_alias_test_5.so.
1057 (weak_alias_test_LDADD): Likewise.
1058 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
1059 * testsuite/Makefile.in: Rebuild.
1060
611062c0
ILT
10612011-07-01 Ian Lance Taylor <iant@google.com>
1062
1063 PR gold/12525
1064 * options.h (class General_options): Support -z notext.
1065 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
1066 -Wl,-z,notext.
1067 (two_file_shared_nonpic.so): Likewise.
1068 (two_file_shared_mixed.so): Likewise.
1069 (two_file_shared_mixed_1.so): Likewise.
1070 (weak_undef_lib_nonpic.so): Likewise.
1071 (alt/weak_undef_lib_nonpic.so): Likewise.
1072 (tls_test_shared_nonpic.so): Likewise.
1073 * testsuite/Makefile.in: Rebuild.
1074
328c7c2f
ILT
10752011-07-01 Ian Lance Taylor <iant@google.com>
1076
1077 PR gold/12525
1078 * configure.ac: Test whether static linking works, setting
1079 the automake conditional HAVE_STATIC.
1080 * testsuite/Makefile.am: Disable tests using -static if
1081 HAVE_STATIC is not true.
1082 * configure, testsuite/Makefile.in: Rebuild.
1083
02d7cd44
ILT
10842011-07-01 Ian Lance Taylor <iant@google.com>
1085
1086 PR gold/12525
1087 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
1088 Assert if we see DW_EH_PE_indirect.
1089 * target.h (Target::ehframe_datarel_base): New function.
1090 (Target::do_ehframe_datarel_base): New target function.
1091 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
1092 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
1093 function.
1094
07a60597
ILT
10952011-07-01 Ian Lance Taylor <iant@google.com>
1096
1097 PR gold/12571
1098 * options.h (class General_options): Add
1099 --ld-generated-unwind-info.
1100 * ehframe.cc (Fde::write): Add address parameter. Change all
1101 callers. If associated with PLT, fill in address and size.
1102 (Cie::set_output_offset): Only add merge mapping if there is an
1103 object.
1104 (Cie::write): Add address parameter. Change all callers.
1105 (Eh_frame::add_ehframe_for_plt): New function.
1106 * ehframe.h (class Fde): Update declarations. Move shndx_ and
1107 input_offset_ fields into union u_, with new plt field.
1108 (Fde::Fde): Adjust for new union field.
1109 (Fde::Fde) [Output_data version]: New constructor.
1110 (Fde::add_mapping): Only add merge mapping if there is an object.
1111 (class Cie): Update declarations.
1112 (class Eh_frame): Declare add_ehframe_for_plt.
1113 * layout.cc (Layout::layout_eh_frame): Break out code into
1114 make_eh_frame_section, and call it.
1115 (Layout::make_eh_frame_section): New function.
1116 (Layout::add_eh_frame_for_plt): New function.
1117 * layout.h (class Layout): Update declarations.
1118 * merge.cc (Merge_map::add_mapping): Add assertion.
1119 * i386.cc: Include "dwarf.h".
1120 (class Output_data_plt_i386): Make first_plt_entry,
1121 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
1122 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1123 and plt_eh_frame_fde.
1124 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
1125 boundary. Call add_eh_frame_for_plt if appropriate.
1126 * x86_64.cc: Include "dwarf.h".
1127 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
1128 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
1129 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1130 and plt_eh_frame_fde.
1131 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
1132 appropriate.
1133
14788a3f
ILT
11342011-06-29 Ian Lance Taylor <iant@google.com>
1135
1136 PR gold/12629
1137 * object.cc (Sized_relobj_file::layout_section): Change shdr
1138 parameter to be const.
1139 (Sized_relobj_file::layout_eh_frame_section): New function, broken
1140 out of do_layout.
1141 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
1142 appropriate. Call layout_eh_frame_section.
1143 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
1144 sections.
1145 * object.h (class Sized_relobj_file): Update declarations.
1146
6c21fce1
ILT
11472011-06-29 Ian Lance Taylor <iant@google.com>
1148
37e41b03 1149 PR gold/12652
6c21fce1
ILT
1150 * script.cc (Token::integer_value): Accept trailing M/m/K/k
1151 modifier.
1152 (Lex::gather_token): Accept trailing M/m/K/k for integers.
1153
4d5e4e62
ILT
11542011-06-29 Ian Lance Taylor <iant@google.com>
1155
1156 PR gold/12675
1157 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
1158 SHT_X86_64_UNWIND.
1159 * layout.cc (Layout::layout_eh_frame): Likewise.
1160
886f533a
ILT
11612011-06-29 Ian Lance Taylor <iant@google.com>
1162
1163 PR gold/12695
1164 * layout.cc (Layout::symtab_section_shndx): New function.
1165 * layout.h (class Layout): Declare symtab_section_shndx.
1166 * output.cc (Output_section::write_header): Call it.
1167
f3ae1b28
ILT
11682011-06-29 Ian Lance Taylor <iant@google.com>
1169
1170 PR gold/12818
1171 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
1172 symbols which are not used in a relocation.
1173
aecf301f
ILT
11742011-06-28 Ian Lance Taylor <iant@google.com>
1175
1176 PR gold/12898
1177 * layout.cc (Layout::segment_precedes): Don't crash if a linker
1178 script create indistinguishable segments.
1179 (Layout::set_segment_offsets): Use stable_sort when sorting
1180 segments. Pass this to Compare_segments constructor.
1181 * layout.h (class Layout): Make segment_precedes non-static.
1182 (class Compare_segments): Change from struct to class. Add
1183 layout_ field. Add constructor.
1184 * script-sections.cc
1185 (Script_sections::attach_sections_using_phdrs_clause): Rename
1186 local orphan to is_orphan. Don't report failure to put empty
1187 section in segment. On attachment failure, report name of
1188 section, and attach to first PT_LOAD segment.
1189
03ef7571
ILT
11902011-06-28 Ian Lance Taylor <iant@google.com>
1191
1192 PR gold/12934
1193 * target-select.cc (Target_selector::Target_selector): Add
1194 emulation parameter. Change all callers.
1195 (select_target_by_bfd_name): Rename from select_target_by_name.
1196 Change all callers.
1197 (select_target_by_emulation): New function.
1198 (supported_emulation_names): New function.
1199 * target-select.h (class Target_selector): Add emulation_ field.
1200 Update declarations.
1201 (Target_selector::recognize_by_bfd_name): Rename from
1202 recognize_by_name. Change all callers.
1203 (Target_selector::supported_bfd_names): Rename from
1204 supported_names. Change all callers.
1205 (Target_selector::recognize_by_emulation): New function.
1206 (Target_selector::supported_emulations): New function.
1207 (Target_selector::emulation): New function.
1208 (Target_selector::do_recognize_by_bfd_name): Rename from
1209 do_recognize_by_name. Change all callers.
1210 (Target_selector::do_supported_bfd_names): Rename from
1211 do_supported_names. Change all callers.
1212 (Target_selector::do_recognize_by_emulation): New function.
1213 (Target_selector::do_supported_emulations): New function.
1214 (select_target_by_bfd_name): Change name in declaration.
1215 (select_target_by_emulation): Declare.
1216 (supported_emulation_names): Declare.
1217 * parameters.cc (parameters_force_valid_target): Try to find
1218 target based on emulation from -m option.
1219 * options.h (class General_options): Change doc string for -m.
1220 * options.cc (help): Print emulations.
1221 (General_options::parse_V): Likewise.
1222 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
1223 Add emulation parameter. Change all callers.
1224
200b2bb9
ILT
12252011-06-28 Ian Lance Taylor <iant@google.com>
1226
1227 * target.h (class Target): Add osabi_ field.
1228 (Target::osabi): New function.
1229 (Target::set_osabi): New function.
1230 (Target::Target): Initialize osabi_.
1231 (Target::do_adjust_elf_header): Make pure virtual.
1232 (Sized_target::do_adjust_elf_header): Declare.
1233 * target.cc (Sized_target::do_adjust_elf_header): New function.
1234 (class Sized_target): Instantiate all versions.
1235 * freebsd.h (class Target_freebsd): Remove.
1236 (Target_selector_freebsd::do_recognize): Call set_osabi on
1237 Target.
1238 (Target_selector_freebsd::do_recognize_by_name): Likewise.
1239 (Target_selector_freebsd::set_osabi): Remove.
1240 * i386.cc (class Target_i386): Inherit from Sized_target rather
1241 than Target_freebsd.
1242 * x86_64.cc (class Target_x86_64): Likewise.
1243
b3ce541e
ILT
12442011-06-28 Ian Lance Taylor <iant@google.com>
1245
1246 * target.h (Target::can_check_for_function_pointers): Rewrite.
1247 Make non-virtual.
1248 (Target::can_icf_inline_merge_sections): Likewise.
1249 (Target::section_may_have_icf_unsafe_poineters): Likewise.
1250 (Target::Target_info): Add can_icf_inline_merge_sections field.
1251 (Target::do_can_check_for_function_pointers): New virtual
1252 function.
1253 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
1254 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
1255 from can_check_for_function_pointers, move in file.
1256 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
1257 section_may_have_icf_unsafe_poineters, move in file.
1258 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
1259 * i386.cc (Target_i386::do_can_check_for_function_pointers):
1260 Rename from can_check_for_function_pointers, move in file.
1261 (Target_i386::can_icf_inline_merge_sections): Remove.
1262 (Target_i386::i386_info): Initialize
1263 can_icf_inline_merge_sections.
1264 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
1265 Initialize can_icf_inline_merge_sections.
1266 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
1267 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
1268 Rename from can_check_for_function_pointers, move in file.
1269 (Target_x86_64::can_icf_inline_merge_sections): Remove.
1270 (Target_x86_64::x86_64_info): Initialize
1271 can_icf_inline_merge_sections.
1272 * testsuite/testfile.cc (Target_test::test_target_info):
1273 Likewise.
1274 * icf.cc (get_section_contents): Correct formatting.
1275
6d1c4efb
ILT
12762011-06-27 Ian Lance Taylor <iant@google.com>
1277
1278 * symtab.cc (Symbol::versioned_name): New function.
1279 (Symbol_table::add_to_final_symtab): Use versioned_name when
1280 appropriate.
1281 (Symbol_table::sized_write_symbol): Likewise.
1282 * symtab.h (class Symbol): Declare versioned_name.
1283 * stringpool.h (class Stringpool_template): Add variant of add
1284 which takes a std::basic_string.
1285 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
1286 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
1287 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
1288 (ver_test_12.o): New target.
1289 * testsuite/Makefile.in: Rebuild.
1290
57eb9b50
DK
12912011-06-27 Doug Kwan <dougkwan@google.com>
1292
1293 * arm.cc (Arm_relocate_functions::thm_jump8,
1294 Arm_relocate_functions::thm_jump11): Use a wider signed
1295 type to compute offset.
1296 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
1297 arm_thm_jump8.
1298 * testsuite/Makefile.in: Regenerate.
1299 * testsuite/arm_branch_in_range.sh: Check test results of
1300 arm_thm_jump11 and arm_thm_jump8.
1301 * testsuite/arm_thm_jump11.s: New test source file.
1302 * testsuite/arm_thm_jump11.t: New linker script.
1303 * testsuite/arm_thm_jump8.s: New test source file.
1304 * testsuite/arm_thm_jump8.t: New linker script.
1305
487b39df
ILT
13062011-06-24 Ian Lance Taylor <iant@google.com>
1307
1308 * layout.cc: Include "object.h".
1309 (ctors_sections_in_init_array): New static variable.
1310 (Layout::is_ctors_in_init_array): New function.
1311 (Layout::layout): Add entry to ctors_sections_in_init_array if
1312 appropriate.
1313 * layout.h (class Layout): Declare is_ctors_in_init_array.
1314 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
1315 is_ctors_reverse_view is set.
1316 (Sized_relobj_file::write_sections): Add layout parameter. Change
1317 all callers. Set is_ctors_reverse_view field of View_size.
1318 (Sized_relobj_file::reverse_words): New function.
1319 * object.h (Sized_relobj_file::View_size): Add
1320 is_ctors_reverse_view field.
1321 (class Sized_relobj_file): Update declarations.
1322 * testsuite/initpri3.c: New test.
1323 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
1324 initpri3b.
1325 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
1326 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
1327 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
1328 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
1329 * testsuite/Makefile.in: Rebuild.
1330
472076e4
CC
13312011-06-24 Cary Coutant <ccoutant@google.com>
1332
1333 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
1334 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
1335 (debug_msg_cdebug.err): New targets.
1336 * testsuite/Makefile.in: Regenerate.
1337 * testsuite/debug_msg.sh: Check output of link with compressed debug.
1338 Fix checks for link with shared library.
1339
a60af0db
DK
13402011-06-24 Doug Kwan <dougkwan@google.com>
1341
1342 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
1343 skip empty text sections.
1344 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
1345
5393d741
ILT
13462011-06-22 Ian Lance Taylor <iant@google.com>
1347
1348 PR gold/12910
1349 * options.h (class General_options): Add --ctors-in-init-array.
1350 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
1351 friends as SHT_PROGBITS for merging sections.
1352 (Layout::layout): Remove special handling of .init_array and
1353 friends. Don't sort if doing relocatable link. Sort for .ctors
1354 and .dtors if ctors_in_init_array.
1355 (Layout::make_output_section): Force correct section types for
1356 .init_array and friends. Don't sort if doing relocatable link,
1357 Don't sort .ctors and .dtors if ctors_in_init_array.
1358 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
1359 (Layout::output_section_name): Add relobj parameter. Change all
1360 callers. Handle .ctors. and .dtors. in code rather than table.
1361 Handle .ctors and .dtors if ctors_in_init_array.
1362 (Layout::match_file_name): New function, moved from output.cc.
1363 * layout.h (class Layout): Update declarations.
1364 * output.cc: Include "layout.h".
1365 (Input_section_sort_entry::get_priority): New function.
1366 (Input_section_sort_entry::match_file_name): Just call
1367 Layout::match_file_name.
1368 (Output_section::Input_section_sort_init_fini_compare::operator()):
1369 Handle .ctors and .dtors. Sort by explicit priority rather than
1370 by name.
1371 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
1372 * testsuite/initpri2.c: New test.
1373 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
1374 (check_PROGRAMS): Add initpri2.
1375 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
1376 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
1377 * configure, testsuite/Makefile.in: Rebuild.
1378
e1f74f98
ILT
13792011-06-19 Ian Lance Taylor <iant@google.com>
1380
1381 PR gold/12880
1382 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
1383 .interp section to a PT_INTERP segment even if we have seen a
1384 --dynamic-linker option. Don't do it if we have seen a PHDRS
1385 clause in a linker script.
1386 (Layout::finalize): Don't create a .interp section if we've
1387 already create a PT_INTERP segment.
1388 (Layout::create_interp): Always call choose_output_section (revert
1389 patch of 2011-06-17). Don't create PT_INTERP segment.
1390 * script-sections.cc
1391 (Script_sections::create_note_and_tls_segments): Add a .interp
1392 section to a PT_INTERP segment even if we have seen a
1393 --dynamic-linker option.
1394
766f91bb
ILT
13952011-06-18 Ian Lance Taylor <iant@google.com>
1396
1397 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
1398 merely because a non-PT_LOAD segment has a dynamic reloc.
1399
0d212c3a
ILT
14002011-06-18 Ian Lance Taylor <iant@google.com>
1401
1402 * layout.cc (Layout::finish_dynamic_section): Don't create
1403 DT_FLAGS entry if not needed.
1404
911a5072
ILT
14052011-06-18 Ian Lance Taylor <iant@google.com>
1406
1407 PR gold/12745
1408 * layout.cc (Layout::layout_eh_frame): Correct handling of
1409 writable .eh_frame section.
1410
534b4e5f
ILT
14112011-06-17 Ian Lance Taylor <iant@google.com>
1412
1413 PR gold/12893
1414 * resolve.cc (Symbol_table::resolve): Don't give an error if a
1415 symbol is redefined with the exact same object and value.
1416
10b4f102
ILT
14172011-06-17 Ian Lance Taylor <iant@google.com>
1418
1419 PR gold/12880
1420 * layout.h (class Layout): Add interp_segment_ field.
1421 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
1422 (Layout::attach_allocated_section_to_segment): If making shared
1423 library, put .interp section in PT_INTERP segment.
1424 (Layout::finalize): Also call create_interp if -dynamic-linker
1425 option was used.
1426 (Layout::create_interp): Assert that there is no PT_INTERP
1427 segment. If not using a SECTIONS clause, use make_output_section.
1428 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
1429 * script-sections.cc
1430 (Script_sections::create_note_and_tls_segments): If making shared
1431 library, put .interp section in PT_INTERP segment.
1432
a29b0dad
ILT
14332011-06-17 Ian Lance Taylor <iant@google.com>
1434
e588ea8d
ILT
1435 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
1436 when making a shared library.
1437
14382011-06-17 Ian Lance Taylor <iant@google.com>
1439
1440 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
1441 parameter. Change all callers. Don't issue warning about PC32
1442 against locally defined symbol.
a29b0dad 1443
9d3b0698
ILT
14442011-06-16 Ian Lance Taylor <iant@google.com>
1445
1446 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
1447 occurs in same object.
1448
85b0f90c
AM
14492011-06-14 Alan Modra <amodra@gmail.com>
1450
1451 * po/POTFILES.in: Regenerate.
1452
a94907d9
ILT
14532011-06-09 Ian Lance Taylor <iant@google.com>
1454
1455 * script-sections.cc
1456 (Orphan_output_section::set_section_addresses): For a relocatable
1457 link set address to 0.
1458
4fb3a1c3
CC
14592011-06-09 Cary Coutant <ccoutant@google.com>
1460
1461 PR gold/12804
1462 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
1463 used with --compress-debug-sections.
1464 * gold/object.cc (Sized_relobj_file::do_layout): Report
1465 uncompressed size of compressed input sections.
1466
61220854
CC
14672011-06-08 Cary Coutant <ccoutant@google.com>
1468
1469 PR gold/12804
1470 * testsuite/two_file_test_2_v1.cc: Change initialization of
1471 v2 to keep it in .data.
1472
e6455dfb
CC
14732011-06-07 Cary Coutant <ccoutant@google.com>
1474
1475 * common.cc (Symbol_table::do_allocate_commons_list): Call
1476 gold_fallback.
1477 * errors.cc (Errors::fatal): Adjust call to gold_exit.
1478 (Errors::fallback): New function.
1479 (gold_fallback): New function.
1480 * errors.h (Errors::fallback): New function.
1481 * gold.cc (gold_exit): Change status parameter to enum; adjust
1482 all callers.
1483 (queue_initial_tasks): Call gold_fallback.
1484 * gold.h: Include cstdlib.
1485 (Exit_status): New enum type.
1486 (gold_exit): Change status parameter to enum.
1487 (gold_fallback): New function.
1488 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
1489 (Layout::create_symtab_sections): Likewise.
1490 (Layout::create_shdrs): Likewise.
1491 * main.cc (main): Adjust call to gold_exit.
1492 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
1493 (Output_data_got::add_got_entry_pair): Likewise.
1494 (Output_section::add_input_section): Likewise.
1495 (Output_section::add_output_section_data): Likewise.
1496 (Output_segment::set_section_list_addresses): Likewise.
1497 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
1498
fb0e076f
CC
14992011-06-07 Cary Coutant <ccoutant@google.com>
1500
1501 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
1502 for incremental links.
1503 * output.cc (Output_segment::set_section_list_addresses): Remove
1504 FIXME and test for TLS or BSS.
1505
a5ee4d5d
CC
15062011-06-07 Cary Coutant <ccoutant@google.com>
1507
1508 * testsuite/Makefile.am: Add incremental_copy_test,
1509 incremental_common_test_1.
1510 * testsuite/Makefile.in: Regenerate.
1511 * testsuite/common_test_1_v1.c: New source file.
1512 * testsuite/common_test_1_v2.c: New source file.
1513 * testsuite/copy_test_v1.cc: New source file.
1514
5146f448
CC
15152011-06-07 Cary Coutant <ccoutant@google.com>
1516
1517 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
1518 update, allocate common from bss section's free list.
1519 * incremental-dump.cc (dump_incremental_inputs): Print flag for
1520 linker-defined symbols.
1521 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
1522 Skip GOT and PLT entries that are no longer referenced.
1523 (Output_section_incremental_inputs::write_info_blocks): Mark
1524 linker-defined symbols.
1525 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
1526 * output.cc (Output_section::allocate): New function.
1527 * output.h (Output_section::allocate): New function.
1528 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
1529 linker-defined symbols.
1530 (Symbol::override_base_with_special): Copy is_predefined_ flag.
1531 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
1532 (Symbol::init_base_output_data): Likewise.
1533 (Symbol::init_base_output_segment): Likewise.
1534 (Symbol::init_base_constant): Likewise.
1535 (Sized_symbol::init_output_data): Likewise.
1536 (Sized_symbol::init_output_segment): Likewise.
1537 (Sized_symbol::init_constant): Likewise.
1538 (Symbol_table::do_define_in_output_data): Likewise.
1539 (Symbol_table::do_define_in_output_segment): Likewise.
1540 (Symbol_table::do_define_as_constant): Likewise.
1541 * symtab.h (Symbol::is_predefined): New function.
1542 (Symbol::init_base_output_data): Add is_predefined parameter.
1543 (Symbol::init_base_output_segment): Likewise.
1544 (Symbol::init_base_constant): Likewise.
1545 (Symbol::is_predefined_): New data member.
1546 (Sized_symbol::init_output_data): Add is_predefined parameter.
1547 (Sized_symbol::init_output_segment): Likewise.
1548 (Sized_symbol::init_constant): Likewise.
1549 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
1550
26d3c67d
CC
15512011-06-07 Cary Coutant <ccoutant@google.com>
1552
1553 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
1554 instead of emit_copy_reloc.
1555 (Copy_relocs::emit_copy_reloc): Refactor.
1556 (Copy_relocs::make_copy_reloc): New function.
1557 (Copy_relocs::add_copy_reloc): Remove.
1558 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
1559 section.
1560 (Copy_relocs::make_copy_reloc): New function.
1561 (Copy_relocs::add_copy_reloc): Remove.
1562 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
1563 unchanged input files.
1564 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
1565 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
1566 Reserve BSS space for COPY relocations.
1567 (Sized_incremental_binary::do_emit_copy_relocs): New function.
1568 (Output_section_incremental_inputs::write_info_blocks): Record
1569 whether a symbol is copied from a shared object.
1570 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
1571 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
1572 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
1573 (Incremental_input_entry_reader::get_output_symbol_index): Add
1574 is_copy parameter.
1575 (Incremental_binary::emit_copy_relocs): New function.
1576 (Incremental_binary::do_emit_copy_relocs): New function.
1577 (Sized_incremental_binary::Sized_incremental_binary): Initialize
1578 new data member.
1579 (Sized_incremental_binary::add_copy_reloc): New function.
1580 (Sized_incremental_binary::do_emit_copy_relocs): New function.
1581 (Sized_incremental_binary::Copy_reloc): New struct.
1582 (Sized_incremental_binary::Copy_relocs): New typedef.
1583 (Sized_incremental_binary::copy_relocs_): New data member.
1584 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
1585 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
1586 * target.h (Sized_target::emit_copy_reloc): New function.
1587 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
1588
7cdb37d9
CC
15892011-06-02 Cary Coutant <ccoutant@google.com>
1590
1591 PR gold/12163
1592 * gold/archive.cc (Archive::Archive): Initialize new data member.
1593 (Archive::include_all_members): Return if archive has already been
1594 included.
1595 * gold/archive.h (Archive::include_all_members_): New data member.
1596
cc643b88
NC
15972011-06-02 Nick Clifton <nickc@redhat.com>
1598
1599 * dynobj.h: Fix spelling mistake in comment.
1600 * output.cc: Likewise.
1601
f62a3ca7
DK
16022011-05-31 Doug Kwan <dougkwan@google.com>
1603 Asier Llano
1604
1605 PR gold/12826
cc643b88 1606 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
1607 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
1608 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
1609 redundant arm_exidx_test.so.
1610 * testsuite/Makefile.in: Regenerate.
1611 (check_SCRIPTS): Add pr12826.sh
1612 (check_DATA): Add pr12826.stdout
1613 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
1614 * testsuite/pr12826.sh: New file.
1615 * testsuite/pr12826_1.s: Ditto.
1616 * testsuite/pr12826_1.s: Ditto.
1617
8dbe1edc
ILT
16182011-05-30 Ian Lance Taylor <iant@google.com>
1619
1620 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
1621 sections.
1622
c49875be
ILT
16232011-05-29 Ian Lance Taylor <iant@google.com>
1624
1625 PR gold/12804
1626 * testsuite/Makefile.am: Use different file name for two_file_test
1627 temporary file for each incremental test.
1628 * testsuite/Makefile.in: Rebuild.
1629
69d53f7a
ILT
16302011-05-29 Ian Lance Taylor <iant@google.com>
1631
1632 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
1633 binary input file is empty.
1634
41d0ab5f
ILT
16352011-05-27 Ian Lance Taylor <iant@google.com>
1636
1637 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
1638 (ver_test_9.so): Likewise.
1639 * testsuite/Makefile.in: Rebuild.
1640
89d8a36b
CC
16412011-05-26 Cary Coutant <ccoutant@google.com>
1642
1643 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
1644 * incremental.cc (Incremental_inputs::report_input_section): Fix
1645 comment, indentation.
1646 (Incremental_inputs::report_comdat_group): New function.
1647 (Output_section_incremental_inputs::set_final_data_size): Adjust size
1648 of data for incremental input file entry.
1649 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
1650 group count, COMDAT group signatures.
1651 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
1652 an unchanged input file.
1653 * incremental.h (Incremental_object_entry::Incremental_object_entry):
1654 Initialize new data member.
1655 (Incremental_object_entry::add_comdat_group): New function.
1656 (Incremental_object_entry::get_comdat_group_count): New function.
1657 (Incremental_object_entry::get_comdat_signature_key): New function.
1658 (Incremental_object_entry::groups_): New data member.
1659 (Incremental_inputs::report_comdat_group): New function.
1660 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
1661 data for incremental input file entry.
1662 (Incremental_input_entry_reader::get_comdat_group_count): New function.
1663 (Incremental_input_entry_reader::get_input_section): Adjust size of
1664 data for incremental input file entry.
1665 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
1666 (Incremental_input_entry_reader::get_comdat_group_signature): New
1667 function.
1668 * object.cc (Sized_relobj::include_section_group): Report kept
1669 COMDAT groups for incremental links.
1670
1706a06f
ILT
16712011-05-24 David Meyer <pdox@google.com>
1672
1673 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
1674 with name parameter. Add found_name parameter.
1675 * fileread.cc (Input_file::find_file): Adjust code accordingly.
1676 * dirsearch.h (class Dirsearch): Update declaration.
1677
a10ae760
ILT
16782011-05-24 Ian Lance Taylor <iant@google.com>
1679
1680 * archive.cc (Library_base::should_include_member): Pull in object
1681 from archive if it defines the entry symbol.
1682 * parameters.cc (Parameters::entry): New function.
1683 * parameters.h (class Parameters): Declare entry.
1684 * output.h (class Output_file_header): Remove entry_ field.
1685 * output.cc (Output_file_header::Output_file_header): Remove entry
1686 parameter. Change all callers.
1687 (Output_file_header::entry): Use parameters->entry.
1688 * gold.cc (queue_middle_tasks): Likewise.
1689 * plugin.cc (Plugin_hook::run): Likewise.
1690
aa92d6ed
CC
16912011-05-24 Cary Coutant <ccoutant@google.com>
1692
1693 * gold.cc (queue_initial_tasks): Pass incremental base filename
1694 to Output_file::open_base_file; don't print error message.
1695 * incremental-dump.cc (main): Adjust call to
1696 Output_file::open_for_modification.
1697 * incremental-dump.cc (main): Likewise.
1698 * incremental.cc (Incremental_inputs::report_command_line):
1699 Ignore --incremental-base option when comparing command lines.
1700 Ignore parameter when given as separate argument.
1701 * options.h (class General_options): Add --incremental-base.
1702 * output.cc (Output_file::Output_file):
1703 (Output_file::open_base_file): Add base_name and writable parameters;
1704 read base file into new file; print error message here.
1705 (Output_file::map_no_anonymous): Add writable parameter; adjust all
1706 callers.
1707 * output.h (Output_file::open_for_modification): Rename to...
1708 (Output_file::open_base_file): ...this; add base_name and
1709 writable parameters; adjust all callers.
1710 (Output_file::map_no_anonymous): Add writable parameter; adjust all
1711 callers.
1712 * testsuite/Makefile.am (incremental_test_4): Test
1713 --incremental-base.
1714 * testsuite/Makefile.in: Regenerate.
1715
2eedd706
CC
17162011-05-24 Cary Coutant <ccoutant@google.com>
1717
1718 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
1719 incremental_test_4.
1720 * testsuite/Makefile.in: Regenerate.
1721 * testsuite/two_file_test_1_v1.cc: New test source file.
1722 * testsuite/two_file_test_1b_v1.cc: New test source file.
1723 * testsuite/two_file_test_2_v1.cc: New test source file.
1724
0f1c85a6
CC
17252011-05-24 Cary Coutant <ccoutant@google.com>
1726
1727 * dynobj.h (Dynobj::do_dynobj): New function.
1728 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
1729 flag and soname for shared objects.
1730 * incremental.cc (Incremental_inputs::report_object): Make
1731 either Incremental_object_entry or Incremental_dynobj_entry; add
1732 soname to string table.
1733 (Incremental_inputs::report_input_section): Add assertion.
1734 (Output_section_incremental_inputs::set_final_data_size): Adjust
1735 type of input file entry for shared libraries; adjust size of
1736 shared library info entry.
1737 (Output_section_incremental_inputs::write_input_files): Write
1738 as_needed flag for shared libraries.
1739 (Output_section_incremental_inputs::write_info_blocks): Adjust type
1740 of input file entry for shared libraries; write soname.
1741 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
1742 soname from incremental info.
1743 * incremental.h (enum Incremental_input_flags): Add
1744 INCREMENTAL_INPUT_AS_NEEDED.
1745 (Incremental_input_entry::Incremental_input_entry): Initialize new
1746 data member.
1747 (Incremental_input_entry::set_as_needed): New function.
1748 (Incremental_input_entry::as_needed): New function.
1749 (Incremental_input_entry::do_dynobj_entry): New function.
1750 (Incremental_input_entry::as_needed_): New data member.
1751 (Incremental_object_entry::Incremental_object_entry): Don't check
1752 for shared library.
1753 (Incremental_object_entry::do_type): Likewise.
1754 (class Incremental_dynobj_entry): New class.
1755 (Incremental_input_entry_reader::as_needed): New function.
1756 (Incremental_input_entry_reader::get_soname): New function.
1757 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
1758 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
1759 size of shared library info entry.
1760 * layout.cc (Layout::finish_dynamic_section): Don't test for
1761 incremental link when adding DT_NEEDED entries.
1762 * object.h (Object::Object): Initialize new data member.
1763 (Object::dynobj): New function.
1764 (Object::set_as_needed): New function.
1765 (Object::as_needed): New function.
1766 (Object::do_dynobj): New function.
1767 (Object::as_needed_): New data member.
1768
6fa2a40b
CC
17692011-05-24 Cary Coutant <ccoutant@google.com>
1770
1771 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
1772 info; adjust display of GOT entries.
1773 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
1774 vector of input objects; remove file_status_.
1775 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
1776 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
1777 got_plt reader; call target hooks to reserve GOT entries.
1778 (Output_section_incremental_inputs::set_final_data_size): Adjust size
1779 of input file info header and GOT info entry.
1780 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
1781 relocation info.
1782 (Got_plt_view_info::got_descriptor): Remove.
1783 (Got_plt_view_info::sym_index): New data member.
1784 (Got_plt_view_info::input_index): New data member.
1785 (Local_got_offset_visitor::visit): Write input file index.
1786 (Global_got_offset_visitor::visit): Write 0 for input file index.
1787 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
1788 with sym_index and input_index.
1789 (Output_section_incremental_inputs::write_got_plt): Adjust size of
1790 incremental info GOT entry; replace got_descriptor with input_index.
1791 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
1792 map from input file index to object.
1793 (Sized_relobj_incr::do_layout): Replace direct data member reference
1794 with accessor function.
1795 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
1796 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
1797 Adjust size of input file info header.
1798 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
1799 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
1800 (Incremental_input_entry_reader::get_input_section): Adjust size of
1801 input file info header.
1802 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
1803 of incremental info GOT entry.
1804 (Incremental_got_plt_reader::get_got_desc): Remove.
1805 (Incremental_got_plt_reader::get_got_symndx): New function.
1806 (Incremental_got_plt_reader::get_got_input_index): New function.
1807 (Sized_incremental_binary::Sized_incremental_binary): Remove
1808 file_status_; add input_objects_.
1809 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
1810 (Sized_incremental_binary::set_file_is_unchanged): Remove.
1811 (Sized_incremental_binary::file_is_unchanged): Remove.
1812 (Sized_incremental_binary::set_input_object): New function.
1813 (Sized_incremental_binary::input_object): New function.
1814 (Sized_incremental_binary::file_status_): Remove.
1815 (Sized_incremental_binary::input_objects_): New data member.
1816 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
1817 references.
1818 (Sized_relobj_incr::invalid_address): Move to base class.
1819 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
1820 class.
1821 (Sized_relobj_incr::do_output_section_offset): Likewise.
1822 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
1823 (Sized_relobj_incr::section_offsets_): Likewise.
1824 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
1825 function.
1826 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
1827 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
1828 with accessor function.
1829 (Sized_relobj_file::do_layout): Likewise.
1830 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
1831 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
1832 (Sized_relobj_file::compute_final_local_value): Replace refs to
1833 section_offsets_ with accessor function.
1834 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
1835 * object.h (Relobj::Relobj): Initialize new data members.
1836 (Relobj::add_dyn_reloc): New function.
1837 (Relobj::first_dyn_reloc): New function.
1838 (Relobj::dyn_reloc_count): New function.
1839 (Relobj::first_dyn_reloc_): New data member.
1840 (Relobj::dyn_reloc_count_): New data member.
1841 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
1842 references.
1843 (Sized_relobj::Address): New typedef.
1844 (Sized_relobj::invalid_address): Move here from child class.
1845 (Sized_relobj::Sized_relobj): Initialize new data members.
1846 (Sized_relobj::sized_relobj): New function.
1847 (Sized_relobj::is_output_section_offset_invalid): Move here from
1848 child class.
1849 (Sized_relobj::get_output_section_offset): Likewise.
1850 (Sized_relobj::local_has_got_offset): Likewise.
1851 (Sized_relobj::local_got_offset): Likewise.
1852 (Sized_relobj::set_local_got_offset): Likewise.
1853 (Sized_relobj::do_for_all_local_got_entries): Likewise.
1854 (Sized_relobj::clear_got_offsets): New function.
1855 (Sized_relobj::section_offsets): Move here from child class.
1856 (Sized_relobj::do_output_section_offset): Likewise.
1857 (Sized_relobj::do_set_section_offset): Likewise.
1858 (Sized_relobj::Local_got_offsets): Likewise.
1859 (Sized_relobj::local_got_offsets_): Likewise.
1860 (Sized_relobj::section_offsets_): Likewise.
1861 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
1862 references.
1863 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
1864 class.
1865 (Sized_relobj_file::sized_relobj): New function
1866 (Sized_relobj_file::local_has_got_offset): Move to base class.
1867 (Sized_relobj_file::local_got_offset): Likewise.
1868 (Sized_relobj_file::set_local_got_offset): Likewise.
1869 (Sized_relobj_file::get_output_section_offset): Likewise.
1870 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
1871 (Sized_relobj_file::do_output_section_offset): Likewise.
1872 (Sized_relobj_file::do_set_section_offset): Likewise.
1873 (Sized_relobj_file::Local_got_offsets): Likewise.
1874 (Sized_relobj_file::local_got_offsets_): Likewise.
1875 (Sized_relobj_file::section_offsets_): Likewise.
1876 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
1877 (all constructors).
1878 (set_needs_dynsym_index): Convert relobj to derived class pointer.
1879 (Output_reloc::get_symbol_index): Likewise.
1880 (Output_reloc::local_section_offset): Likewise.
1881 (Output_reloc::get_address): Likewise.
1882 (Output_reloc::symbol_value): Likewise.
1883 (Output_data_got::reserve_slot): Move to class definition.
1884 (Output_data_got::reserve_local): New function.
1885 (Output_data_got::reserve_slot_for_global): Remove.
1886 (Output_data_got::reserve_global): New function.
1887 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
1888 (all constructors, two instantiations).
1889 (Output_reloc::get_relobj): New function (two instantiations).
1890 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
1891 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
1892 (Output_data_reloc::add_global): Adjust type of relobj.
1893 (Output_data_reloc::add_global_relative): Likewise.
1894 (Output_data_reloc::add_symbolless_global_addend): Likewise.
1895 (Output_data_reloc::add_local): Likewise.
1896 (Output_data_reloc::add_local_relative): Likewise.
1897 (Output_data_reloc::add_symbolless_local_addend): Likewise.
1898 (Output_data_reloc::add_local_section): Likewise.
1899 (Output_data_reloc::add_output_section): Likewise.
1900 (Output_data_reloc::add_absolute): Likewise.
1901 (Output_data_reloc::add_target_specific): Likewise.
1902 (Output_data_got::reserve_slot): Move definition here.
1903 (Output_data_got::reserve_local): New function.
1904 (Output_data_got::reserve_global): New function.
1905 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
1906 section_offsets_ with accessor function.
1907 (Sized_relobj_file::write_sections): Likewise.
1908 (Sized_relobj_file::do_relocate_sections): Likewise.
1909 * target.h (Sized_target::reserve_local_got_entry): New function.
1910 (Sized_target::reserve_global_got_entry): New function.
1911 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
1912 (Target_x86_64::reserve_global_got_entry): New function.
1913 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
1914
4829d394
CC
19152011-05-23 Cary Coutant <ccoutant@google.com>
1916
1917 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
1918 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
1919 bit when checking got_type.
1920 * incremental.cc (Sized_incremental_binary::setup_readers):
1921 Store symbol table and string table locations; initialize bit vector
1922 of file status flags.
1923 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
1924 unchanged files.
1925 (Sized_incremental_binary::do_process_got_plt): New function.
1926 (Sized_incremental_binary::get_symtab_view): Use stored locations.
1927 (Output_section_incremental_inputs::set_final_data_size): Record
1928 file index for each input file.
1929 (Output_section_incremental_inputs::write_got_plt): Store file index
1930 instead of input entry offset for each GOT entry.
1931 * incremental.h
1932 (Incremental_input_entry::Incremental_input_entry): Initialize new
1933 data member.
1934 (Incremental_input_entry::set_offset): Store file index.
1935 (Incremental_input_entry::get_file_index): New function.
1936 (Incremental_input_entry::file_index_): New data member.
1937 (Incremental_binary::process_got_plt): New function.
1938 (Incremental_binary::do_process_got_plt): New function.
1939 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
1940 data members.
1941 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
1942 (Sized_incremental_binary::set_file_is_unchanged): New function.
1943 (Sized_incremental_binary::file_is_unchanged): New function.
1944 (Sized_incremental_binary::do_process_got_plt): New function.
1945 (Sized_incremental_binary::file_status_): New data member.
1946 (Sized_incremental_binary::main_symtab_loc_): New data member.
1947 (Sized_incremental_binary::main_strtab_loc_): New data member.
1948 * output.cc (Output_data_got::Got_entry::write): Add case
1949 RESERVED_CODE.
1950 (Output_data_got::add_global): Call add_got_entry.
1951 (Output_data_got::add_global_plt): Likewise.
1952 (Output_data_got::add_global_with_rel): Likewise.
1953 (Output_data_got::add_global_with_rela): Likewise.
1954 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
1955 (Output_data_got::add_global_pair_with_rela): Likewise.
1956 (Output_data_got::add_local): Call add_got_entry.
1957 (Output_data_got::add_local_plt): Likewise.
1958 (Output_data_got::add_local_with_rel): Likewise.
1959 (Output_data_got::add_local_with_rela): Likewise.
1960 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
1961 (Output_data_got::add_local_pair_with_rela): Likewise.
1962 (Output_data_got::reserve_slot): New function.
1963 (Output_data_got::reserve_slot_for_global): New function.
1964 (Output_data_got::add_got_entry): New function.
1965 (Output_data_got::add_got_entry_pair): New function.
1966 (Output_section::add_output_section_data): Edit FIXME.
1967 * output.h
1968 (Output_section_data_build::Output_section_data_build): New
1969 constructor with size parameter.
1970 (Output_data_space::Output_data_space): Likewise.
1971 (Output_data_got::Output_data_got): Initialize new data member; new
1972 constructor with size parameter.
1973 (Output_data_got::add_constant): Call add_got_entry.
1974 (Output_data_got::reserve_slot): New function.
1975 (Output_data_got::reserve_slot_for_global): New function.
1976 (class Output_data_got::Got_entry): Add RESERVED_CODE.
1977 (Output_data_got::add_got_entry): New function.
1978 (Output_data_got::add_got_entry_pair): New function.
1979 (Output_data_got::free_list_): New data member.
1980 * target.h (Sized_target::init_got_plt_for_update): New function.
1981 (Sized_target::register_global_plt_entry): New function.
1982 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
1983 Initialize new data member; call init; add constructor with PLT count.
1984 (Output_data_plt_x86_64::init): New function.
1985 (Output_data_plt_x86_64::add_relocation): New function.
1986 (Output_data_plt_x86_64::reserve_slot): New function.
1987 (Output_data_plt_x86_64::free_list_): New data member.
1988 (Target_x86_64::init_got_plt_for_update): New function.
1989 (Target_x86_64::register_global_plt_entry): New function.
1990 (Output_data_plt_x86_64::add_entry): Allocate from free list for
1991 incremental updates.
1992 (Output_data_plt_x86_64::add_relocation): New function.
1993 * testsuite/object_unittest.cc (Object_test): Set default options.
1994
ec69d6da
ILT
19952011-05-16 Ian Lance Taylor <iant@google.com>
1996
1997 * options.h (class General_options): Make -i a synonym for -r.
1998
732e31de
ILT
19992011-05-16 Ian Lance Taylor <iant@google.com>
2000
2001 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
2002
403676b5
CC
20032011-05-10 Cary Coutant <ccoutant@google.com>
2004
2005 * object.cc (Sized_relobj::do_count_local_symbols): Check for
2006 strip_all (-s).
2007
5b7b7d6e
ILT
20082011-05-06 Ian Lance Taylor <iant@google.com>
2009
2010 * layout.cc (Layout::layout): If the output section flags change,
2011 update the ordering.
2012
f0f9babf
CC
20132011-04-25 Cary Coutant <ccoutant@google.com>
2014
2015 * incremental-dump.cc (dump_incremental_inputs): Print local
2016 symbol info for each input file.
2017 * incremental.cc
2018 (Output_section_incremental_inputs::set_final_data_size): Add local
2019 symbol info to input file entries in incremental info.
2020 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2021 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
2022 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
2023 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
2024 implementation.
2025 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
2026 (Sized_incr_relobj::do_relocate): Write the local symbols.
2027 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
2028 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
2029 Adjust size of input file header.
2030 (Incremental_inputs_reader::get_local_symbol_offset): New function.
2031 (Incremental_inputs_reader::get_local_symbol_count): New function.
2032 (Incremental_inputs_reader::get_input_section): Adjust size of input
2033 file header.
2034 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
2035 (Sized_incr_relobj::This): New typedef.
2036 (Sized_incr_relobj::sym_size): New const data member.
2037 (Sized_incr_relobj::Local_symbol): New struct.
2038 (Sized_incr_relobj::do_output_local_symbol_count): New function.
2039 (Sized_incr_relobj::do_local_symbol_offset): New function.
2040 (Sized_incr_relobj::local_symbol_count_): New data member.
2041 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
2042 (Sized_incr_relobj::local_symbol_index_): New data member.
2043 (Sized_incr_relobj::local_symbol_offset_): New data member.
2044 (Sized_incr_relobj::local_dynsym_offset_): New data member.
2045 (Sized_incr_relobj::local_symbols_): New data member.
2046 * object.h (Relobj::output_local_symbol_count): New function.
2047 (Relobj::local_symbol_offset): New function.
2048 (Relobj::do_output_local_symbol_count): New function.
2049 (Relobj::do_local_symbol_offset): New function.
2050 (Sized_relobj::do_output_local_symbol_count): New function.
2051 (Sized_relobj::do_local_symbol_offset): New function.
2052
d0a9ace3
ILT
20532011-04-22 Vladimir Simonov <sv@sw.ru>
2054
2055 * descriptors.cc (set_close_on_exec): New function.
2056 (Descriptors::open): Use set_close_on_exec.
2057 * output.cc (S_ISLNK): Define if not defined.
2058
94a3fc8b
CC
20592011-04-22 Cary Coutant <ccoutant@google.com>
2060
2061 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2062 global symbol map.
2063 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2064 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
2065 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
2066 relocations.
2067 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
2068 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
2069 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
2070 * incremental.h
2071 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
2072 function.
2073 (Incremental_binary::apply_incremental_relocs): New function.
2074 (Incremental_binary::do_apply_incremental_relocs): New function.
2075 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2076 data member.
2077 (Sized_incremental_binary::add_global_symbol): New function.
2078 (Sized_incremental_binary::global_symbol): New function.
2079 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2080 (Sized_incremental_binary::symbol_map_): New data member.
2081 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
2082 * target.h (Sized_target::apply_relocation): New function.
2083 * target-reloc.h (apply_relocation): New function.
2084 * x86_64.cc (Target_x86_64::apply_relocation): New function.
2085
c87e4302
DK
20862011-04-22 Doug Kwan <dougkwan@google.com>
2087
2088 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
2089 flag of a SHT_ARM_EXIDX section.
2090 * testsuite/Makefile.am (arm_exidx_test): New test rules.
2091 * testsuite/Makefile.in: Regenerate.
2092 * testsuite/arm_exidx_test.s: New file.
2093 * testsuite/arm_exidx_test.sh: Same.
2094
e7782cf6
CC
20952011-04-20 Cary Coutant <ccoutant@google.com>
2096
2097 PR gold/12689
2098 * archive.h (Incremental_archive_entry::Archive_member):
2099 Initialize arg_serial_ (second constructor).
2100
308ecdc7
ILT
21012011-04-17 Ian Lance Taylor <iant@google.com>
2102
2103 * object.cc (Relocate_info::location): Simplify location string.
2104 * errors.cc (Errors::error_at_location): Don't print program
2105 name.
2106 (Errors::warning_at_location): Likewise.
2107 (Errors::undefined_symbol): Likewise.
2108 * testsuite/debug_msg.sh: Update accordingly.
2109
bec5b579
CC
21102011-04-14 Cary Coutant <ccoutant@google.com>
2111
2112 * gold/layout.cc (Layout::symtab_section_offset): New function.
2113 * gold/layout.h (Layout::symtab_section_offset): New function.
2114 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
2115
88597d34
ILT
21162011-04-12 Ian Lance Taylor <iant@google.com>
2117
2118 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
2119 with MREMAP_MAYMOVE.
2120 * output.h (class Output_file): Add map_is_allocated_ field.
2121 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
2122 not available, provide stubs. If mremap is not available, #define
2123 it to gold_mremap.
2124 (MREMAP_MAYMOVE): Define if not defined.
2125 (Output_file::Output_file): Initialize map_is_allocated_.
2126 (Output_file::resize): Check map_is_allocated_.
2127 (Output_file::map_anonymous): If mmap fails, use malloc.
2128 (Output_file::unmap): Don't do anything for an anonymous map.
2129 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
2130 is not available, provide stubs.
2131 (File_read::View::~View): Use free rather than delete[].
2132 (File_read::make_view): Use malloc rather than new[]. If mmap
2133 fails, use malloc.
2134 (File_read::find_or_make_view): Use malloc rather than new[].
2135 * gold.h: Remove HAVE_REMAP code.
2136 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
2137 exists. Rename mremap to gold_mremap. If mmap is not available
2138 don't do anything.
2139 * configure, config.in: Rebuild.
2140
11e361bc
ILT
21412011-04-11 Ian Lance Taylor <iant@google.com>
2142
2143 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
2144 initialize local variable v.
2145
cdc29364
CC
21462011-04-11 Cary Coutant <ccoutant@google.com>
2147
2148 * archive.cc (Archive::include_member): Adjust call to
2149 report_object.
2150 (Add_archive_symbols::run): Track argument serial numbers.
2151 (Lib_group::include_member): Likewise.
2152 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
2153 * archive.h (Incremental_archive_entry::Archive_member):
2154 Initialize arg_serial_.
2155 (Archive_member::arg_serial_): New data member.
2156 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
2157 (Sized_dynobj::do_add_symbols): Track symbols when doing an
2158 incremental link.
2159 (Sized_dynobj::do_for_all_local_got_entries): New function.
2160 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
2161 function.
2162 * fileread.cc (get_mtime): New function.
2163 * fileread.h (get_mtime): New function.
2164 * gold.cc (queue_initial_tasks): Check for incremental update.
2165 (process_incremental_input): New function.
2166 (queue_middle_tasks): Don't force valid target for incremental
2167 update.
2168 * incremental-dump.cc (find_input_containing_global): Adjust
2169 size of symbol info entry.
2170 (dump_incremental_inputs): Dump argument serial number and
2171 in_system_directory flag; bias shndx by 1; print symbol names
2172 when dumping per-file symbol lists; use new symbol info readers.
2173 * incremental.cc
2174 (Output_section_incremental_inputs:update_data_size): New function.
2175 (Sized_incremental_binary::setup_readers): Setup input readers
2176 for each input file; build maps for files added from libraries
2177 and scripts.
2178 (Sized_incremental_binary::check_input_args): New function.
2179 (Sized_incremental_binary::do_check_inputs): Build map of argument
2180 serial numbers to input arguments.
2181 (Sized_incremental_binary::do_file_has_changed): Rename
2182 do_file_is_unchanged to this; compare file modification times.
2183 (Sized_incremental_binary::do_init_layout): New function.
2184 (Sized_incremental_binary::do_reserve_layout): New function.
2185 (Sized_incremental_binary::do_get_input_reader): Remove.
2186 (Sized_incremental_binary::get_symtab_view): New function.
2187 (Incremental_checker::can_incrementally_link_output_file): Remove.
2188 (Incremental_inputs::report_command_line): Exclude --debug options.
2189 (Incremental_inputs::report_archive_begin): Add parameter; track
2190 argument serial numbers; don't put input file entry for archive
2191 before archive members.
2192 (Incremental_inputs::report_archive_end): Put input file entry
2193 for archive after archive members.
2194 (Incremental_inputs::report_object): Add parameter; track argument
2195 serial numbers and in_system_directory flag.
2196 (Incremental_inputs::report_script): Add parameter; track argument
2197 serial numbers.
2198 (Output_section_incremental_inputs::set_final_data_size): Adjust
2199 size of symbol info entry; check for forwarding symbols.
2200 (Output_section_incremental_inputs::write_input_files): Write
2201 in_system_directory flag and argument serial number.
2202 (Output_section_incremental_inputs::write_info_blocks): Map section
2203 indices between incremental info and original input file; store
2204 input section index for each symbol.
2205 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
2206 change operator() to visit().
2207 (class Global_got_offset_visitor): Likewise.
2208 (class Global_symbol_visitor_got_plt):
2209 (Output_section_incremental_inputs::write_got_plt): Use new visitor
2210 classes.
2211 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
2212 (Sized_incr_relobj::do_read_symbols): New function.
2213 (Sized_incr_relobj::do_layout): New function.
2214 (Sized_incr_relobj::do_layout_deferred_sections): New function.
2215 (Sized_incr_relobj::do_add_symbols): New function.
2216 (Sized_incr_relobj::do_should_include_member): New function.
2217 (Sized_incr_relobj::do_for_all_global_symbols): New function.
2218 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
2219 (Sized_incr_relobj::do_section_size): New function.
2220 (Sized_incr_relobj::do_section_name): New function.
2221 (Sized_incr_relobj::do_section_contents): New function.
2222 (Sized_incr_relobj::do_section_flags): New function.
2223 (Sized_incr_relobj::do_section_entsize): New function.
2224 (Sized_incr_relobj::do_section_address): New function.
2225 (Sized_incr_relobj::do_section_type): New function.
2226 (Sized_incr_relobj::do_section_link): New function.
2227 (Sized_incr_relobj::do_section_info): New function.
2228 (Sized_incr_relobj::do_section_addralign): New function.
2229 (Sized_incr_relobj::do_initialize_xindex): New function.
2230 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
2231 (Sized_incr_relobj::do_read_relocs): New function.
2232 (Sized_incr_relobj::do_gc_process_relocs): New function.
2233 (Sized_incr_relobj::do_scan_relocs): New function.
2234 (Sized_incr_relobj::do_count_local_symbols): New function.
2235 (Sized_incr_relobj::do_finalize_local_symbols): New function.
2236 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
2237 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
2238 (Sized_incr_relobj::do_relocate): New function.
2239 (Sized_incr_relobj::do_set_section_offset): New function.
2240 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
2241 (Sized_incr_dynobj::do_read_symbols): New function.
2242 (Sized_incr_dynobj::do_layout): New function.
2243 (Sized_incr_dynobj::do_add_symbols): New function.
2244 (Sized_incr_dynobj::do_should_include_member): New function.
2245 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
2246 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
2247 (Sized_incr_dynobj::do_section_size): New function.
2248 (Sized_incr_dynobj::do_section_name): New function.
2249 (Sized_incr_dynobj::do_section_contents): New function.
2250 (Sized_incr_dynobj::do_section_flags): New function.
2251 (Sized_incr_dynobj::do_section_entsize): New function.
2252 (Sized_incr_dynobj::do_section_address): New function.
2253 (Sized_incr_dynobj::do_section_type): New function.
2254 (Sized_incr_dynobj::do_section_link): New function.
2255 (Sized_incr_dynobj::do_section_info): New function.
2256 (Sized_incr_dynobj::do_section_addralign): New function.
2257 (Sized_incr_dynobj::do_initialize_xindex): New function.
2258 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
2259 (make_sized_incremental_object): New function.
2260 (Incremental_library::copy_unused_symbols): New function.
2261 (Incremental_library::do_for_all_unused_symbols): New function.
2262 * incremental.h (enum Incremental_input_flags): New type.
2263 (class Incremental_checker): Remove.
2264 (Incremental_input_entry::Incremental_input_entry): Add argument
2265 serial number.
2266 (Incremental_input_entry::arg_serial): New function.
2267 (Incremental_input_entry::set_is_in_system_directory): New function.
2268 (Incremental_input_entry::is_in_system_directory): New function.
2269 (Incremental_input_entry::arg_serial_): New data member.
2270 (Incremental_input_entry::is_in_system_directory_): New data member.
2271 (class Script_info): Move here from script.h.
2272 (Script_info::Script_info): Add filename parameter.
2273 (Script_info::filename): New function.
2274 (Script_info::filename_): New data member.
2275 (Incremental_script_entry::Incremental_script_entry): Add argument
2276 serial number.
2277 (Incremental_object_entry::Incremental_object_entry): Likewise.
2278 (Incremental_object_entry::add_input_section): Build list of input
2279 sections with map to original shndx.
2280 (Incremental_object_entry::get_input_section_index): New function.
2281 (Incremental_object_entry::shndx_): New data member.
2282 (Incremental_object_entry::name_key_): Rename; adjust all refs.
2283 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
2284 (Incremental_archive_entry::Incremental_archive_entry): Add argument
2285 serial number.
2286 (Incremental_inputs::report_archive_begin): Likewise.
2287 (Incremental_inputs::report_object): Likewise.
2288 (Incremental_inputs::report_script): Likewise.
2289 (class Incremental_global_symbol_reader): New class.
2290 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
2291 and store flags and input file type.
2292 (Incremental_input_entry_reader::arg_serial): New function.
2293 (Incremental_input_entry_reader::type): Extract type from flags.
2294 (Incremental_input_entry_reader::is_in_system_directory): New function.
2295 (Incremental_input_entry_reader::get_input_section_count): Call
2296 accessor function for type.
2297 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
2298 function for type; adjust size of global symbol entry.
2299 (Incremental_input_entry_reader::get_global_symbol_count): Call
2300 accessor function for type.
2301 (Incremental_input_entry_reader::get_object_count): Likewise.
2302 (Incremental_input_entry_reader::get_object_offset): Likewise.
2303 (Incremental_input_entry_reader::get_member_count): Likewise.
2304 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
2305 (Incremental_input_entry_reader::get_member_offset): Likewise.
2306 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
2307 (Incremental_input_entry_reader::Global_symbol_info): Remove.
2308 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
2309 (Incremental_input_entry_reader::get_global_symbol_reader): New
2310 function.
2311 (Incremental_input_entry_reader::get_output_symbol_index): New
2312 function.
2313 (Incremental_input_entry_reader::type_): Remove.
2314 (Incremental_input_entry_reader::flags_): New data member.
2315 (Incremental_inputs_reader::input_file_offset): New function.
2316 (Incremental_inputs_reader::input_file_index): New function.
2317 (Incremental_inputs_reader::input_file): Call input_file_offset.
2318 (Incremental_inputs_reader::input_file_at_offset): New function.
2319 (Incremental_relocs_reader::get_r_type): Reformat.
2320 (Incremental_relocs_reader::get_r_shndx): Reformat.
2321 (Incremental_relocs_reader::get_r_offset): Reformat.
2322 (Incremental_relocs_reader::data): New function.
2323 (Incremental_binary::Incremental_binary): Initialize new data members.
2324 (Incremental_binary::check_inputs): Add cmdline parameter.
2325 (Incremental_binary::file_is_unchanged): Remove.
2326 (Input_reader::arg_serial): New function.
2327 (Input_reader::get_unused_symbol_count): New function.
2328 (Input_reader::get_unused_symbol): New function.
2329 (Input_reader::do_arg_serial): New function.
2330 (Input_reader::do_get_unused_symbol_count): New function.
2331 (Input_reader::do_get_unused_symbol): New function.
2332 (Incremental_binary::input_file_count): New function.
2333 (Incremental_binary::get_input_reader): Change signature to use
2334 index instead of filename.
2335 (Incremental_binary::file_has_changed): New function.
2336 (Incremental_binary::get_input_argument): New function.
2337 (Incremental_binary::get_library): New function.
2338 (Incremental_binary::get_script_info): New function.
2339 (Incremental_binary::init_layout): New function.
2340 (Incremental_binary::reserve_layout): New function.
2341 (Incremental_binary::output_file): New function.
2342 (Incremental_binary::do_check_inputs): New function.
2343 (Incremental_binary::do_file_is_unchanged): Remove.
2344 (Incremental_binary::do_file_has_changed): New function.
2345 (Incremental_binary::do_init_layout): New function.
2346 (Incremental_binary::do_reserve_layout): New function.
2347 (Incremental_binary::do_input_file_count): New function.
2348 (Incremental_binary::do_get_input_reader): Change signature.
2349 (Incremental_binary::input_args_map_): New data member.
2350 (Incremental_binary::library_map_): New data member.
2351 (Incremental_binary::script_map_): New data member.
2352 (Sized_incremental_binary::Sized_incremental_binary): Initialize
2353 new data members.
2354 (Sized_incremental_binary::output_section): New function.
2355 (Sized_incremental_binary::inputs_reader): Add const.
2356 (Sized_incremental_binary::symtab_reader): Add const.
2357 (Sized_incremental_binary::relocs_reader): Add const.
2358 (Sized_incremental_binary::got_plt_reader): Add const.
2359 (Sized_incremental_binary::get_symtab_view): New function.
2360 (Sized_incremental_binary::Inputs_reader): New typedef.
2361 (Sized_incremental_binary::Input_entry_reader): New typedef.
2362 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
2363 (Sized_incremental_binary::do_file_is_unchanged): Remove.
2364 (Sized_incremental_binary::do_file_has_changed): New function.
2365 (Sized_incremental_binary::do_init_layout): New function.
2366 (Sized_incremental_binary::do_reserve_layout): New function.
2367 (Sized_input_reader::Inputs_reader): Remove.
2368 (Sized_input_reader::Input_entry_reader): Remove.
2369 (Sized_input_reader::do_arg_serial): New function.
2370 (Sized_input_reader::do_get_unused_symbol_count): New function.
2371 (Sized_input_reader::do_get_unused_symbol): New function.
2372 (Sized_incremental_binary::do_input_file_count): New function.
2373 (Sized_incremental_binary::do_get_input_reader): Change signature;
2374 use index instead of filename.
2375 (Sized_incremental_binary::section_map_): New data member.
2376 (Sized_incremental_binary::input_entry_readers_): New data member.
2377 (class Sized_incr_relobj): New class.
2378 (class Sized_incr_dynobj): New class.
2379 (make_sized_incremental_object): New function.
2380 (class Incremental_library): New class.
2381 * layout.cc (Free_list::num_lists): New static data member.
2382 (Free_list::num_nodes): New static data member.
2383 (Free_list::num_removes): New static data member.
2384 (Free_list::num_remove_visits): New static data member.
2385 (Free_list::num_allocates): New static data member.
2386 (Free_list::num_allocate_visits): New static data member.
2387 (Free_list::init): New function.
2388 (Free_list::remove): New function.
2389 (Free_list::allocate): New function.
2390 (Free_list::dump): New function.
2391 (Free_list::print_stats): New function.
2392 (Layout_task_runner::run): Resize output file for incremental updates.
2393 (Layout::Layout): Initialize new data members.
2394 (Layout::set_incremental_base): New function.
2395 (Layout::init_fixed_output_section): New function.
2396 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
2397 incremental updates.
2398 (Layout::create_gold_note): Do not create gold note section for
2399 incremental updates.
2400 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
2401 for incremental updates.
2402 (Layout::set_section_offsets): For incremental updates, allocate space
2403 from free list.
2404 (Layout::create_symtab_sections): Layout with offsets relative to
2405 start of section; for incremental updates, allocate space from free
2406 list.
2407 (Layout::create_shdrs): For incremental updates, allocate space from
2408 free list.
2409 (Layout::finish_dynamic_section): For incremental updates, do not
2410 check --as-needed (fixed in subsequent patch).
2411 * layout.h (class Free_list): New class.
2412 (Layout::set_incremental_base): New function.
2413 (Layout::incremental_base): New function.
2414 (Layout::init_fixed_output_section): New function.
2415 (Layout::allocate): New function.
2416 (Layout::incremental_base_): New data member.
2417 (Layout::free_list_): New data member.
2418 * main.cc (main): Print Free_list statistics.
2419 * object.cc (Relobj::finalize_incremental_relocs): Add
2420 clear_counts parameter; clear counts only when clear_counts is set.
2421 (Sized_relobj::Sized_relobj): Initialize new base class.
2422 (Sized_relobj::do_layout): Don't report special sections.
2423 (Sized_relobj::do_for_all_local_got_entries): New function.
2424 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
2425 symtab_off to all symbol table offsets.
2426 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
2427 * object.h (class Got_offset_list): Move to top of file.
2428 (Object::Object): Allow case where input_file == NULL.
2429 (Object::~Object): Likewise.
2430 (Object::input_file): Assert that input_file != NULL.
2431 (Object::lock): Allow case where input_file == NULL.
2432 (Object::unlock): Likewise.
2433 (Object::is_locked): Likewise.
2434 (Object::token): Likewise.
2435 (Object::release): Likewise.
2436 (Object::is_incremental): New function.
2437 (Object::get_mtime): New function.
2438 (Object::for_all_local_got_entries): New function.
2439 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
2440 (Object::set_is_in_system_directory): New function.
2441 (Object::is_in_system_directory): New function.
2442 (Object::do_is_incremental): New function.
2443 (Object::do_get_mtime): New function.
2444 (Object::do_for_all_local_got_entries): New function.
2445 (Object::is_in_system_directory_): New data member.
2446 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
2447 (class Sized_relobj_base): New class.
2448 (class Sized_relobj): Derive from Sized_relobj_base.
2449 (class Sized_relobj::Symbols): Redeclare from base class.
2450 (class Sized_relobj::local_got_offset_list): Remove.
2451 (class Sized_relobj::Output_sections): Redeclare from base class.
2452 (class Sized_relobj::do_for_all_local_got_entries): New function.
2453 (class Sized_relobj::write_local_symbols): Add offset parameter.
2454 (class Sized_relobj::local_symbol_offset_): Update comment.
2455 (class Sized_relobj::local_dynsym_offset_): Update comment.
2456 * options.cc (Input_arguments::add_file): Remove const.
2457 * options.h (Input_file_argument::Input_file_argument):
2458 Initialize arg_serial_ (all constructors).
2459 (Input_file_argument::set_arg_serial): New function.
2460 (Input_file_argument::arg_serial): New function.
2461 (Input_file_argument::arg_serial_): New data member.
2462 (Input_arguments::Input_arguments): Initialize file_count_.
2463 (Input_arguments::add_file): Remove const.
2464 (Input_arguments::number_of_input_files): New function.
2465 (Input_arguments::file_count_): New data member.
2466 (Command_line::number_of_input_files): Call
2467 Input_arguments::number_of_input_files.
2468 * output.cc (Output_segment_headers::Output_segment_headers):
2469 Set current size.
2470 (Output_section::Input_section::current_data_size): New function.
2471 (Output_section::Output_section): Initialize new data members.
2472 (Output_section::add_input_section): Don't do merge sections for
2473 an incremental link; allocate space from free list for an
2474 incremental update.
2475 (Output_section::add_output_section_data): Allocate space from
2476 free list for an incremental update.
2477 (Output_section::update_data_size): New function.
2478 (Output_section::set_fixed_layout): New function.
2479 (Output_section::reserve): New function.
2480 (Output_segment::set_section_addresses): Remove const.
2481 (Output_segment::set_section_list_addresses): Remove const; allocate
2482 space from free list for an incremental update.
2483 (Output_segment::set_offset): Adjust size of RELRO segment for an
2484 incremental update.
2485 * output.h (Output_data::current_data_size): Move here from
2486 child classes.
2487 (Output_data::pre_finalize_data_size): New function.
2488 (Output_data::update_data_size): New function.
2489 (Output_section_headers::update_data_size): new function.
2490 (Output_section_data_build::current_data_size): Move to Output_data.
2491 (Output_data_strtab::update_data_size): New function.
2492 (Output_section::current_data_size): Move to Output_data.
2493 (Output_section::set_fixed_layout): New function.
2494 (Output_section::has_fixed_layout): New function.
2495 (Output_section::reserve): New function.
2496 (Output_section::update_data_size): New function.
2497 (Output_section::has_fixed_layout_): New data member.
2498 (Output_section::free_list_): New data member.
2499 (Output_segment::set_section_addresses): Remove const.
2500 (Output_segment::set_section_list_addresses): Remove const.
2501 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
2502 New function.
2503 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
2504 New function.
2505 * readsyms.cc (Read_symbols::do_read_symbols): Add library
2506 parameter when calling Add_symbols constructor; store argument
2507 serial number for members of a lib group.
2508 (Add_symbols::locks): Allow case where token == NULL.
2509 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
2510 (Read_member::~Read_member): New function.
2511 (Read_member::is_runnable): New function.
2512 (Read_member::locks): New function.
2513 (Read_member::run): New function.
2514 (Check_script::~Check_script): New function.
2515 (Check_script::is_runnable): New function.
2516 (Check_script::locks): New function.
2517 (Check_script::run): New function.
2518 (Check_library::~Check_library): New function.
2519 (Check_library::is_runnable): New function.
2520 (Check_library::locks): New function.
2521 (Check_library::run): New function.
2522 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
2523 (Add_symbols::library_): New data member.
2524 (class Read_member): New class.
2525 (class Check_script): New class.
2526 (class Check_library): New class.
2527 * reloc.cc (Read_relocs::is_runnable): Allow case where
2528 token == NULL.
2529 (Read_relocs::locks): Likewise.
2530 (Scan_relocs::locks): Likewise.
2531 (Relocate_task::locks): Likewise.
2532 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
2533 to clear counters.
2534 (Sized_relobj::incremental_relocs_scan): Fix comment.
2535 (Sized_relobj::do_relocate): Pass output file offset to
2536 write_local_symbols.
2537 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
2538 from class declaration.
2539 * script.cc (read_input_script): Allocate Script_info; pass
2540 argument serial number to report_script.
2541 * script.h (class Script_info): Move to incremental.h.
2542 * symtab.cc (Symbol_table::add_from_incrobj): New function.
2543 * symtab.h (Symbol_table::add_from_incrobj): New function.
2544 (Symbol_table::set_file_offset): New function.
2545
b961d0d7
CC
25462011-04-05 Cary Coutant <ccoutant@google.com>
2547
2548 * incremental-dump.cc (dump_incremental_inputs): Change signature
2549 to take a Sized_incremental_binary; change caller. Use readers
2550 in Sized_incremental_binary.
2551 * incremental.cc
2552 (Sized_incremental_binary::find_incremental_inputs_sections):
2553 Rename do_find_incremental_inputs_sections to this.
2554 (Sized_incremental_binary::setup_readers): New function.
2555 (Sized_incremental_binary::do_check_inputs): Check
2556 has_incremental_info_ flag; move setup code to setup_readers;
2557 use input readers.
2558 (Sized_incremental_binary::do_file_is_unchanged): New function.
2559 (Sized_incremental_binary::do_get_input_reader): New function.
2560 * incremental.h (class Incremental_binary): Move to end of file.
2561 (Incremental_binary::file_is_unchanged): New function.
2562 (Incremental_binary::do_file_is_unchanged): New function.
2563 (Incremental_binary::Input_reader): New class.
2564 (Incremental_binary::get_input_reader): New function.
2565 (class Sized_incremental_binary): Move to end of file.
2566 (Sized_incremental_binary::Sized_incremental_binary): Setup the
2567 input section reader classes.
2568 (Sized_incremental_binary::has_incremental_info): New function.
2569 (Sized_incremental_binary::inputs_reader): New function.
2570 (Sized_incremental_binary::symtab_reader): New function.
2571 (Sized_incremental_binary::relocs_reader): New function.
2572 (Sized_incremental_binary::got_plt_reader): New function.
2573 (Sized_incremental_binary::do_file_is_unchanged): New function.
2574 (Sized_incremental_binary::Sized_input_reader): New class.
2575 (Sized_incremental_binary::get_input_reader): New function.
2576 (Sized_incremental_binary::find_incremental_inputs_sections):
2577 Rename do_find_incremental_inputs_sections to this.
2578 (Sized_incremental_binary::setup_readers): New function.
2579 (Sized_incremental_binary::has_incremental_info_): New data member.
2580 (Sized_incremental_binary::inputs_reader_): New data member.
2581 (Sized_incremental_binary::symtab_reader_): New data member.
2582 (Sized_incremental_binary::relocs_reader_): New data member.
2583 (Sized_incremental_binary::got_plt_reader_): New data member.
2584 (Sized_incremental_binary::current_input_file_): New data member.
2585
a869183f
PP
25862011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
2587
2588 PR gold/12640
2589 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
2590 violation.
2591
25922011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
2593
2594 * archive.cc (Archive::include_member): Adjust call to report_object.
2595 (Add_archive_symbols::run): Add script_info to call to
2596 report_archive_begin.
2597 (Lib_group::include_member): Adjust call to report_object.
2598 (Add_lib_group_symbols::run): Adjust call to report_object.
2599 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
2600 blocks. Add object count for script input files.
2601 * incremental.cc (Incremental_inputs::report_archive_begin): Add
2602 script_info parameter; change all callers.
2603 (Incremental_inputs::report_object): Add script_info parameter;
2604 change all callers.
2605 (Incremental_inputs::report_script): Store backpointer to
2606 incremental info entry.
2607 (Output_section_incremental_inputs::set_final_data_size): Record
2608 additional information for scripts.
2609 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2610 * incremental.h (Incremental_script_entry::add_object): New function.
2611 (Incremental_script_entry::get_object_count): New function.
2612 (Incremental_script_entry::get_object): New function.
2613 (Incremental_script_entry::objects_): New data member; adjust
2614 constructor.
2615 (Incremental_inputs::report_archive_begin): Add script_info parameter.
2616 (Incremental_inputs::report_object): Add script_info parameter.
2617 (Incremental_inputs_reader::get_object_count): New function.
2618 (Incremental_inputs_reader::get_object_offset): New function.
2619 * options.cc (Input_arguments::add_file): Return reference to
2620 new input argument.
2621 * options.h (Input_argument::set_script_info): New function.
2622 (Input_argument::script_info): New function.
2623 (Input_argument::script_info_): New data member; adjust all
2624 constructors.
2625 (Input_file_group::add_file): Return reference to new input argument.
2626 (Input_file_lib::add_file): Likewise.
2627 (Input_arguments::add_file): Likewise.
2628 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
2629 * script.cc (Parser_closure::Parser_closure): Add script_info
2630 parameter; adjust all callers.
2631 (Parser_closure::script_info): New function.
2632 (Parser_closure::script_info_): New data member.
2633 (read_input_script): Report scripts earlier to incremental info.
2634 (script_add_file): Set script_info in Input_argument.
2635 (script_add_library): Likewise.
2636 * script.h (Script_options::Script_info): Rewrite class.
2637
a869183f 26382011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
2639
2640 * archive.cc (Library_base::should_include_member): Move
2641 method here from class Archive.
2642 (Archive::Archive): Initialize base class.
2643 (Archive::should_include_member): Move to base class.
2644 (Archive::do_for_all_unused_symbols): New function.
2645 (Add_archive_symbols::run): Remove redundant access to
2646 incremental_inputs.
2647 (Lib_group::Lib_group): Initialize base class.
2648 (Lib_group::do_filename): New function.
2649 (Lib_group::include_member): Pass pointer to Lib_group to
2650 report_object.
2651 (Lib_group::do_for_all_unused_symbols): New function.
2652 (Add_lib_group_symbols::run): Report archive information for
2653 incremental links.
2654 * archive.h (class Library_base): New base class.
2655 (class Archive): Derive from Library_base.
2656 (Archive::filename): Move to base class.
2657 (Archive::set_incremental_info): Likewise.
2658 (Archive::incremental_info): Likewise.
2659 (Archive::Should_include): Likewise.
2660 (Archive::should_include_member): Likewise.
2661 (Archive::Armap_entry): Remove.
2662 (Archive::Unused_symbol_iterator): Remove.
2663 (Archive::unused_symbols_begin): Remove.
2664 (Archive::unused_symbols_end): Remove.
2665 (Archive::do_filename): New function.
2666 (Archive::do_get_mtime): New function.
2667 (Archive::do_for_all_unused_symbols): New function.
2668 (Archive::task_): Move to base class.
2669 (Archive::incremental_info_): Likewise.
2670 (class Lib_group): Derive from Library_base.
2671 (Lib_group::do_filename): New function.
2672 (Lib_group::do_get_mtime): New function.
2673 (Lib_group::do_for_all_unused_symbols): New function.
2674 (Lib_group::task_): Move to base class.
2675 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
2676 function.
2677 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
2678 function.
2679 * incremental.cc (Incremental_inputs::report_archive_begin):
2680 Use Library_base; call library's get_mtime; add incremental inputs
2681 entry before members.
2682 (class Unused_symbol_visitor): New class.
2683 (Incremental_inputs::report_archive_end): Use Library_base; use
2684 visitor class to record unused symbols; don't add incremental inputs
2685 entry after members.
2686 (Incremental_inputs::report_object): Use Library_base.
2687 * incremental.h
2688 (Incremental_archive_entry::Incremental_archive_entry): Remove
2689 unused Archive parameter.
2690 (Incremental_inputs::report_archive_begin): Use Library_base.
2691 (Incremental_inputs::report_archive_end): Likewise.
2692 (Incremental_inputs::report_object): Likewise.
2693 * object.cc (Sized_relobj::do_for_all_global_symbols): New
2694 function.
2695 * object.h (Object::for_all_global_symbols): New function.
2696 (Object::do_for_all_global_symbols): New function.
2697 (Sized_relobj::do_for_all_global_symbols): New function.
2698 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
2699 function.
2700 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
2701 function.
2702
61ab3e40
ILT
27032011-03-27 Ian Lance Taylor <iant@google.com>
2704
2705 * archive.cc (Archive::interpret_header): Return -1 if something
2706 goes wrong. Change callers accordingly.
2707
30e1f9e6
CC
27082011-03-25 Cary Coutant <ccoutant@google.com>
2709
2710 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
2711 * testsuite/Makefile.in: Regenerate.
2712
9370ce59 27132011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
2714
2715 * plugin.cc (get_view): New.
2716 (Plugin::load): Pass get_view to the plugin.
2717 (Plugin_manager::get_view): New.
2718
9312bb0a
ILT
27192011-03-21 Ian Lance Taylor <iant@google.com>
2720
2721 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 2722 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 2723
7e12ba9e
ST
27242011-03-21 Sriraman Tallam <tmsriram@google.com>
2725
2726 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
2727 Change == to -eq.
2728 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
2729 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
2730 Change == to -eq.
2731 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
2732 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
2733
fd7a005d
ILT
27342011-03-14 Ian Lance Taylor <iant@google.com>
2735
2736 * script-sections.cc (Sort_output_sections::script_compare):
2737 Rename from is_before, change return type.
2738 (Sort_output_sections::operator()): Adjust accordingly.
2739
ed16fd1b
ILT
27402011-03-11 Jeffrey Yasskin <jyasskin@google.com>
2741
2742 PR gold/12572
2743 * testsuite/odr_violation2.cc: Add comment to make all error line
2744 numbers double digits.
2745 * testsuite/debug_msg.sh: Adjust expected errors.
2746
71ff8986
ILT
27472011-03-09 Jeffrey Yasskin <jyasskin@google.com>
2748
2749 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
2750 but mark earlier ones as non-canonical
2751 (offset_to_iterator): Update search target and example
2752 (do_addr2line): Return extra lines in a vector*
2753 (format_file_lineno): Extract from do_addr2line
2754 (one_addr2line): Add vector* out-param
2755 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
2756 when a lineno entry appeared last for its instruction
2757 (Dwarf_line_info): Add vector* out-param
2758 * object.cc (Relocate_info): Pass NULL for the vector* out-param
2759 * symtab.cc (Odr_violation_compare): Include the lineno in the
2760 comparison again.
2761 (linenos_from_loc): New. Combine the canonical line for an
2762 address with its other lines.
2763 (True_if_intersect): New. Helper functor to make
2764 std::set_intersection a query.
2765 (detect_odr_violations): Compare sets of lines instead of just
2766 one line for each function. This became less deterministic, but
2767 has fewer false positives.
2768 * symtab.h: Declarations.
2769 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
2770 mix an optimized and non-optimized object in the same binary
2771 (odr_violation2.so): Same.
2772 * testsuite/Makefile.in: Regenerate from Makefile.am.
2773 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
2774 * testsuite/debug_msg.sh: Update line numbers and add
2775 assertions.
2776 * testsuite/odr_violation1.cc: Use OdrDerived, in a
2777 non-optimized context.
2778 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
2779 isn't inlined, and use OdrDerived in an optimized context.
2780 * testsuite/odr_header1.h: Defines OdrDerived, where
2781 optimization will change the
2782 first-instruction-in-the-destructor's file and line number.
2783 * testsuite/odr_header2.h: Defines OdrBase.
2784
a19fefdc
ILT
27852011-03-09 Ian Lance Taylor <iant@google.com>
2786
2787 * fileread.cc (File_read::clear_views): Don't delete the whole
2788 file view.
2789
ecb351e9
ILT
27902011-03-08 Ian Lance Taylor <iant@google.com>
2791
2792 PR gold/12525
2793 * fileread.cc: #include <climits>.
2794 (GOLD_IOV_MAX): Define.
2795 (File_read::read_multiple): Limit number of entries by iov_max.
2796 * fileread.h (class File_read): Always set max_readv_entries to
2797 128.
2798
b821d13c
ILT
27992011-03-07 Ian Lance Taylor <iant@google.com>
2800
2801 PR gold/12525
2802 * options.h (class General_options): Add -dy and -dn.
2803
89243142
CC
28042011-03-02 Cary Coutant <ccoutant@google.com>
2805
2806 * testsuite/script_test_9.t: Add TLS segment.
2807
d0773f31
ILT
28082011-03-02 Simon Baldwin <simonb@google.com>
2809
2810 * configure.ac: Add check for gnu_indirect_function support in
2811 the toolchain building binutils.
2812 * configure: Rebuild.
2813
9370ce59 28142011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
2815
2816 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
2817 plugin only symbols.
2818 (Symbol_table::sized_finalize_symbol) Mark symbol only present
2819 in plugin files as not needed in the symbol table.
2820
4cf7a849
ST
28212011-02-11 Sriraman Tallam <tmsriram@google.com>
2822
2823 * output.cc (Output_section::add_input_section): Delay fill
2824 generation for section ordering.
2825
b578bd7d
ILT
28262011-02-09 Ian Lance Taylor <iant@google.com>
2827
2828 PR gold/12316
2829 * object.h (class Sized_relobj): Remove clear_local_symbols.
2830 * reloc.cc (Sized_relobj::do_relocate): Don't call
2831 clear_local_symbols.
2832
9370ce59 28332011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
2834
2835 * plugin.cc (is_visible_from_outside): Return true for symbols
2836 in the -u option.
2837
55382fb7
ILT
28382011-02-04 Jeffrey Yasskin <jyasskin@google.com>
2839
2840 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
2841 filename.
2842
4e271fff
ST
28432011-02-02 Sriraman Tallam <tmsriram@google.com>
2844
2845 * icf.h (is_section_foldable_candidate): Change type of parameter
2846 to std::string.
2847 * icf.cc (Icf::find_identical_sections): Change type of local variable
2848 section_name to be std::string.
2849 (is_function_ctor_or_dtor): Change type of parameter to std::string.
2850
d433c3ac
ILT
28512011-01-25 Ian Lance Taylor <iant@google.com>
2852
2853 * script.cc (script_add_extern): Rewrite to use
2854 add_symbol_reference.
2855
880473a6
DK
28562011-01-25 Doug Kwan <dougkwan@google.com>
2857
d433c3ac 2858 * icf.cc (get_section_contents): Always lock section's object.
880473a6 2859
f30f86fa
ILT
28602011-01-24 Ian Lance Taylor <iant@google.com>
2861
2862 * options.h (class General_options): Accept
2863 --no-detect-odr-violations.
2864
8e51a0b9
ILT
28652011-01-24 Ian Lance Taylor <iant@google.com>
2866
2867 * version.cc (version_string): Bump to 1.11.
2868
0f3b89d8
ILT
28692011-01-24 Ian Lance Taylor <iant@google.com>
2870
2871 * plugin.cc (class Plugin_rescan): Define new class.
2872 (Plugin_manager::claim_file): Set any_claimed_.
2873 (Plugin_manager::save_archive): New function.
2874 (Plugin_manager::save_input_group): New function.
2875 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
2876 necessary.
2877 (Plugin_manager::new_undefined_symbol): New function.
2878 (Plugin_manager::rescan): New function.
2879 (Plugin_manager::rescannable_defines): New function.
2880 (Plugin_manager::add_input_file): Set any_added_.
2881 * plugin.h (class Plugin_manager): define new fields rescannable_,
2882 undefined_symbols_, any_claimed_, and any_added_. Declare
2883 Plugin_rescan as friend. Declare new functions.
2884 (Plugin_manager::Rescannable): Define type.
2885 (Plugin_manager::Rescannable_list): Define type.
2886 (Plugin_manager::Undefined_symbol_list): Define type.
2887 (Plugin_manager::Plugin_manager): Initialize new fields.
2888 * archive.cc (Archive::defines_symbol): New function.
2889 (Add_archive_symbols::run): Pass archive to plugins if any.
2890 * archive.h (class Archive): Declare defines_symbol.
2891 * readsyms.cc (Input_group::~Input_group): New function.
2892 (Finish_group::run): Pass input_group to plugins if any.
2893 * readsyms.h (class Input_group): Declare destructor.
2894 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
2895 any.
2896
3bb951e5
ILT
28972011-01-10 Ian Lance Taylor <iant@google.com>
2898
2899 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
2900 section as relro.
2901 (Layout::set_segment_offsets): Reset increase_relro before calling
2902 set_section_addresses a second time.
2903
0aa45fac
CC
29042011-01-04 Cary Coutant <ccoutant@google.com>
2905
2906 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
2907 sections before NOBITS sections.
2908
0db46eb4
L
29092011-01-01 H.J. Lu <hongjiu.lu@intel.com>
2910
2911 * version.cc (print_version): Update copyright to 2011.
2912
829c9745
CC
29132010-12-23 Cary Coutant <ccoutant@google.com>
2914
2915 * output.h (Output_data_reloc::add_output_section): Pass OD instead
2916 of OS to this->add. Add OD parameter to second form of the function.
2917
7500420b
ILT
29182010-12-20 Ian Lance Taylor <iant@google.com>
2919
2920 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
2921 second of two consecutive entries with same offset.
2922
f8e9a930
RW
29232010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2924
2925 * testsuite/Makefile.am (ifuncmain2static_LDADD)
2926 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
2927 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
2928 to avoid unneeded links against $(LDADD).
2929 * testsuite/Makefile.in: Regenerate.
2930
2fbb4320
ILT
29312010-12-15 Ian Lance Taylor <iant@google.com>
2932
2933 PR gold/12324
2934 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
2935 for R_X86_64_32 and R_X86_64_PC32.
2936 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
2937 ver_matching_def_pic.o.
2938 (ver_matching_def_pic.o): New target.
2939
fedb228d
RW
29402010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2941
2942 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
2943 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
2944 Move definition before File_read::View member definitions.
2945 (File_read::View::~View): Initialize and hold lock before
2946 updating current_mapped_bytes.
2947
9b547ce6
RW
29482010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2949
2950 * dwarf_reader.cc: Remove outdated comment.
2951 * gold-threads.cc: Fix typo in error message.
2952 * archive.cc: Fix typos in comments.
2953 * archive.h: Likewise.
2954 * arm-reloc-property.cc: Likewise.
2955 * arm-reloc-property.h: Likewise.
2956 * arm-reloc.def: Likewise.
2957 * arm.cc: Likewise.
2958 * attributes.h: Likewise.
2959 * cref.cc: Likewise.
2960 * ehframe.cc: Likewise.
2961 * fileread.h: Likewise.
2962 * gold.h: Likewise.
2963 * i386.cc: Likewise.
2964 * icf.cc: Likewise.
2965 * incremental.h: Likewise.
2966 * int_encoding.cc: Likewise.
2967 * layout.h: Likewise.
2968 * main.cc: Likewise.
2969 * merge.h: Likewise.
2970 * object.cc: Likewise.
2971 * object.h: Likewise.
2972 * options.cc: Likewise.
2973 * readsyms.cc: Likewise.
2974 * reduced_debug_output.cc: Likewise.
2975 * reloc.cc: Likewise.
2976 * script-sections.cc: Likewise.
2977 * sparc.cc: Likewise.
2978 * symtab.h: Likewise.
2979 * target-reloc.h: Likewise.
2980 * target.cc: Likewise.
2981 * target.h: Likewise.
2982 * timer.cc: Likewise.
2983 * timer.h: Likewise.
2984 * x86_64.cc: Likewise.
2985
83e17bd5
CC
29862010-12-09 Cary Coutant <ccoutant@google.com>
2987
2988 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
2989 stack.
2990 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
2991 parameter; change all callers.
2992 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
2993 * options.h (warn_execstack): New option.
2994
017257f8
DK
29952010-12-07 Doug Kwan <dougkwan@google.com>
2996
2997 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
2998 like function call relocations.
2999
c20cbc06
ILT
30002010-12-07 Ian Lance Taylor <iant@google.com>
3001
3002 * archive.cc (Archive::get_elf_object_for_member): Permit
3003 punconfigured to be NULL.
3004 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
3005 (Archive::include_member): Pass NULL to get_elf_object_for_member
3006 if we searched for the archive and this is the first included
3007 object.
3008
4dbfafcc
ILT
30092010-12-01 Ian Lance Taylor <iant@google.com>
3010
3011 * dwarf_reader.h (class Sized_dwarf_line_info): Add
3012 track_relocs_type_ field.
3013 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3014 Set track_relocs_type_.
3015 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
3016 contents when using RELA relocs.
3017 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
3018 reloc_map_.
3019 * reloc.cc (Track_relocs::next_addend): New function.
3020 * reloc.h (class Track_relocs): Declare next_addend.
3021
e5e19edd
ILT
30222010-12-01 Ian Lance Taylor <iant@google.com>
3023
3024 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
3025 virtual destructor.
3026
9a5ce24c
ILT
30272010-12-01 Ian Lance Taylor <iant@google.com>
3028
3029 * README: Update compilers known to work and fail.
3030
c7791212
NC
30312010-11-23 Matthias Klose <doko@ubuntu.com>
3032
3033 * configure.in: For --enable-gold, handle value `default' instead of
3034 `both*'. Always install ld as ld.bfd, install as ld if gold is
3035 not the default.
3036 * configure: Regenerate.
3037
0ad220c9
DK
30382010-11-18 Doug Kwan <dougkwan@google.com>
3039
3040 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
3041 and right_alignment to be zero. Store result alignment only if it is
3042 greater than existing alignment.
3043
ab8056e0
CC
30442010-11-16 Cary Coutant <ccoutant@google.com>
3045
3046 PR gold/12220
3047 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3048 Check for ".zdebug_line".
3049
fd064a5b
CC
30502010-11-16 Doug Kwan <dougkwan@google.com>
3051 Cary Coutant <ccoutant@google.com>
3052
3053 * output.h (Output_segment::set_section_addresses): Pass increase_relro
3054 by reference; adjust all callers.
3055 * output.cc (Output_segment::set_section_addresses): Adjust references
3056 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
3057 list is empty.
3058 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
3059 end at page boundary.
3060
6fc6ea19
CC
30612010-11-16 Cary Coutant <ccoutant@google.com>
3062
3063 PR gold/12220
3064 * layout.cc (Layout::choose_output_section): Transform names of
3065 compressed sections even when using a script with a SECTIONS clause.
3066 (Layout::output_section_name): Remove code to transform
3067 compressed debug section names.
3068 * output.cc (Output_section::add_input_section): Use uncompressed
3069 section size when tracking input sections.
3070
95a2c8d6
RS
30712010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
3072
3073 * symtab.h (Symbol::NON_PIC_REF): Remove.
3074 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
3075 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
3076 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
3077 (Symbol::use_plt_offset): Take a flags argument and pass it
3078 directly to needs_dynamic_reloc. Restrict check for undefined
3079 weak symbols to function calls.
3080 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
3081 (Target_arm::Scan::global): Use it.
3082 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
3083 (Target_arm::Relocate::relocate): Likewise.
3084 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
3085 parameter with an r_type parameter. Use get_reference_flags
3086 to get the flags.
3087 (Target_arm::Relocate::relocate): Update accordingly.
3088 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
3089 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
3090 (Target_i386::Scan::global): Likewise.
3091 (Target_i386::Relocate::relocate): Likewise.
3092 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
3093 parameter with an r_type parameter. Use get_reference_flags
3094 to get the flags.
3095 (Target_i386::Relocate::relocate): Update accordingly.
3096 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
3097 (Target_powerpc::Scan::global): Use it.
3098 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
3099 (Target_powerpc::Relocate::relocate): Likewise.
3100 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
3101 (Target_sparc::Scan::global): Use it.
3102 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
3103 (Target_sparc::Relocate::relocate): Likewise.
3104 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
3105 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
3106 (Target_x86_64::Scan::global): Likewise.
3107 (Target_x86_64::Relocate::relocate): Likewise.
3108
f625ae50
DK
31092010-11-08 Doug Kwan <dougkwan@google.com>
3110 Cary Coutant <ccoutant@google.com>
3111
3112 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
3113 (Arm_exidx_merge_section::section_contents_): New data member.
3114 (Arm_input_section::Arm_input_section): Initialize original_contents_.
3115 (Arm_input_section::~Arm_input_section): De-allocate memory.
3116 (Arm_input_section::original_contents_): New data member.
3117 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
3118 in parameters instead of calling Object::section_contents without
3119 locking.
3120 (Arm_output_section::group_section): New parameter TASK. Pass it
3121 to callees that need locking objects.
3122 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
3123 to lock EXIDX input sections. Fix a formatting issue. Call
3124 Arm_exidx_merged_section::build_contents to create merged section
3125 contents.
3126 (Arm_output_section::create_stub_group): New parameter TASK. Use it
3127 to lock object of stub table owner.
3128 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
3129 TEXT_SIZE to initialize data member TEXT_SIZE_.
3130 (Arm_exidx_input_section::addralign): Fix typo in comment.
3131 (Arm_exidx_input_section::text_size): New method.
3132 (Target_arm::do_relax): New parameter TASK. Pass it to callees
3133 that require locking objects. Lock objects before scanning for stubs
3134 and updating local symbols.
3135 (Arm_input_section<big_endian>::init): Copy contents of original
3136 input section.
3137 (Arm_input_section<big_endian>::do_write): Use saved contents of
3138 original input section instead of calling Object::section_contents
3139 without locking.
3140 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
3141 size without calling Object::section_size().
3142 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
3143 for size. Allocate a buffer for merged EXIDX entries.
3144 (Arm_exidx_merged_section::build_contents): New method.
3145 (Arm_exidx_merged_section::do_write): Move merge section contents
3146 building code to Arm_exidx_merged_section::build_contetns. Write
3147 out contetns in buffer instead of building it on the fly.
3148 (Arm_relobj::make_exidx_input_section): Also pass text section size
3149 to Arm_exidx_input_section constructor.
3150 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
3151 (Arm_dynobj::do_read_symbols): Fix memory leak.
3152 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
3153 * target.h: (class Task): Add forward declaration.
3154 (Target::relax): Add new parameter TASK and pass it to
3155 Target::do_relax().
3156 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
3157
5f9bcf58
CC
31582010-11-05 Cary Coutant <ccoutant@google.com>
3159
3160 PR gold/10708
3161 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
3162 object when reading from the file.
3163 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
3164 second layout pass.
3165 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
3166 when reading section contents.
3167 (get_section_contents): Likewise.
3168 (icf::find_identical_sections): Likewise.
3169 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
3170 object when reading from the file.
3171 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
3172 the object when doing deferred section layout.
3173
e597fa08
NC
31742010-11-03 Nick Clifton <nickc@redhat.com>
3175
3176 PR gold/12001
3177 * script.h (class Symbol_assignment: name): New member. Returns
3178 the name of the symbol.
3179 * scrfipt.cc (Script_options::is_pending_assignment): New member.
3180 Returns true if the given symbol name is on the list of
3181 assignments wating to be processed.
3182 * archive.cc (should_incldue_member): If the symbol is undefined,
3183 check to see if it is on the list of symbols pending assignment.
3184
3f9a3278
ILT
31852010-11-03 Ryan Mansfield <rmansfield@qnx.com>
3186
3187 * script-sections.cc (Script_sections::find_memory_region): Check
3188 for a NULL output section pointer.
3189
d06fb4d1
DK
31902010-10-29 Doug Kwan <dougkwan@google.com>
3191
3192 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
3193 Output_section::add_relaxed_input_section.
3194 * output.cc (Output_section::add_relaxed_input_section): Add new
3195 arguments LAYOUT and NAME. Set section order index.
3196 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
3197 Copy section order index.
3198 * output.h (Output_section::add_relaxed_input_section): Add new
3199 arguments LAYOUT and NAME.
3200
90e24de5
ILT
32012010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3202
3203 * testsuite/Makefile.am: Move gcctestdir/ld rule to
3204 NATIVE_OR_CROSS_LINKER.
3205 * testsuite/Makefile.in: Regenerate.
3206
c9484ea5
DK
32072010-10-20 Doug Kwan <dougkwan@google.com>
3208
3209 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
3210 without SHF_LINK_ORDER flags.
3211 * layout.cc (Layout::choose_output_section): Do not filter
3212 SHF_LINK_ORDER flag in a relocatable link.
3213
5bc2f5be
CC
32142010-10-17 Cary Coutant <ccoutant@google.com>
3215
3216 * output.h (Output_segment::set_section_addresses): Change function
3217 signature. Update all callers.
3218 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
3219 sections.
3220 (Output_segment::set_section_addresses): Align after last TLS
3221 section. Add padding before last relro section instead of after.
3222
0c91cf04
DK
32232010-10-17 Doug Kwan <dougkwan@google.com>
3224
3225 * gold/arm.cc (Target_arm::got_section): Use correct order and set
3226 GOT output section to be writable.
3227
8c21d9d3
CC
32282010-10-14 Cary Coutant <ccoutant@google.com>
3229
3230 * debug.h (DEBUG_INCREMENTAL): New flag.
3231 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
3232 * gold.cc (queue_initial_tasks): Check parameters for incremental link
3233 mode.
3234 * incremental.cc (report_command_line): Ignore all forms of
3235 --incremental.
3236 * layout.cc (Layout::Layout): Check parameters for incremental link
3237 mode.
3238 * options.cc (General_options::parse_incremental): New function.
3239 (General_options::parse_no_incremental): New function.
3240 (General_options::parse_incremental_full): New function.
3241 (General_options::parse_incremental_update): New function.
3242 (General_options::incremental_mode_): New data member.
3243 (General_options::finalize): Check incremental_mode_.
3244 * options.h (General_options): Update help text for --incremental.
3245 Add --no-incremental, --incremental-full, --incremental-update.
3246 (General_options::Incremental_mode): New enum type.
3247 (General_options::incremental_mode): New function.
3248 (General_options::incremental_mode_): New data member.
3249 * parameters.cc (Parameters::incremental_mode_): New data member.
3250 (Parameters::set_options): Set incremental_mode_.
3251 (Parameters::set_incremental_full): New function.
3252 (Parameters::incremental): New function.
3253 (Parameters::incremental_update): New function.
3254 (set_parameters_incremental_full): New function.
3255 * parameters.h (Parameters::set_incremental_full): New function.
3256 (Parameters::incremental): New function.
3257 (Parameters::incremental_update): New function.
3258 (Parameters::incremental_mode_): New data member.
3259 (set_parameters_incremental_full): New function.
3260 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
3261 incremental link mode.
3262 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
3263 (Sized_relobj::do_relocate_sections): Likewise.
3264 * testsuite/Makefile.am (incremental_test): Use --incremental-full
3265 option.
3266 * testsuite/Makefile.in: Regenerate.
3267 * testsuite/incremental_test.sh: Filter all forms of --incremental.
3268
bb32aa18 32692010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
3270
3271 * script-sections.h (class Script_sections): Make
3272 Sections_elements typedef public.
3273 * script-sections.cc (class Sort_output_sections): Add elements_
3274 field. Add constructor which sets it; change all callers.
3275 (Sort_output_sections::is_before): New function.
3276 (Sort_output_sections::operator()): Call is_before.
3277 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
3278 conditional.
3279 * testsuite/script_test_10.sh: New test. Test script section
3280 order.
3281 * testsuite/script_test_10.t: Likewise.
3282 * testsuite/script_test_10.s: Likewise.
3283 * testsuite/Makefile.am: Wrap the cross linker tests and the
3284 common tests into NATIVE_OR_CROSS_LINKER.
3285 (check_SCRIPTS): Add script_test_10.sh.
3286 (check_DATA): Add script_test_10.stdout.
3287 (script_test_10.o, script_test_10): New targets.
3288 (script_test_10.stdout): New target.
3289 * configure, testsuite/Makefile.in: Regenerate.
3290
3cef7179
ILT
32912010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3292
3293 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
3294 error for the deprecated relocations.
3295 (Target_arm::Scan::global): Likewise.
3296 (Target_arm::Relocate::relocate): Likewise.
3297
7411e9a8
RS
32982010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
3299
3300 * fileread.cc (Input_file::find_file): Initialize *found_name
3301 and *namep when using the fallback search for case 4.
3302
6a9da32a
CC
33032010-10-11 Cary Coutant <ccoutant@google.com>
3304
3305 * options.h (class General_options): Redefine -z lazy as an alias for
3306 the negation of -z now.
3307
ac897c20
ILT
33082010-10-11 Ian Lance Taylor <iant@google.com>
3309
3310 * resolve.cc (symbol_to_bits): Report the value of the unsupported
3311 binding.
3312
ea5cae92
NC
33132010-10-06 Nick Clifton <nickc@redhat.com>
3314
3315 * script-sections.cc(class Memory_region): Remove
3316 current_lma_offset_ field. Rename current_vma_offset_ to
3317 current_offset_. Add last_section_ field.
3318 (Memory_region::get_current_vma_address): Rename to
3319 get_current_address.
3320 (Memory_region::get_current_lma_address): Delete.
3321 (Memory_region::increment_vma_offset): Rename to
3322 increment_offset.
3323 (Memory_region::increment_lma_offset): Delete.
3324 (Memory_region::attributes_compatible): New method. Returns
3325 true if the provided section is compatible with the region.
3326 (Memory_region::get_last_section): New method. Returns the last
3327 section to use the region.
3328 (Memory_region::set_last_section): New method. Stores the last
3329 section to use the region.
3330 (Script_sections::block_in_region): New method. Returns true if
3331 a block of memory is contained within a region.
3332 (Script_sections::find_memory_region): New method. Locates a
3333 memory region to be used to set a VMA or LMA address.
3334 (Output_section_definition::set_section_addresses): Add code to
3335 check for addresses set by memory regions.
3336 (Output_segment::set_section_addresses): Remove memory region
3337 walking code.
3338 (Script_sections::create_segment): Add a warning if a header
3339 segment is created outside of any region.
3340 * script-sections.h (class Script_sections): Add prototypes for
3341 find_memory_region and block_in_region methods.
3342 * testsuite/memory_test.s: Use .long instead of .word.
3343 * testsuite/memory_test.t: Add some more output sections.
3344 * testsuite/memory_test.sh: Update expected output.
3345
a9bfd952
DK
33462010-10-02 Doug Kwan <dougkwan@google.com>
3347
3348 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
3349 defintion to symtab.h
3350 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
3351 declaration to defintion.
3352
bacff3ab
NC
33532010-10-01 Nick Clifton <nickc@redhat.com>
3354
3355 * expression.cc (eval): Replace dummy argument with NULL.
3356 (eval_maybe_dot): Check for a NULL result section pointer.
3357 (Symbol_expression::value): Likewise.
3358 (Dot_expression::value): Likewise.
3359 (BINARY_EXPRESSION): Likewise.
3360 (Max_expression::value): Likewise.
3361 (Min_expression::value): Likewise.
3362 (Absolute_expression::value): Likewise.
3363 (Addr_expression::value_from_output_section): Likewise.
3364 (Loaddddr_expression::value_from_output_section): Likewise.
3365 (Segment_start_expression::value): Likewise.
3366 * script-sections.cc
3367 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
3368 argument with NULL.
3369 (Sections_elememt_dot_assignment::set_section_addresses):
3370 Likewise.
3371 (Output_data_expression::do_write_to_buffer): Likewise.
3372 (Output_section_definition::finalize_symbols): Likewise.
3373 (Output_section_definition::set_section_addresses): Likewise.
3374
f81bc8b5
DK
33752010-09-30 Doug Kwan <dougkwan@google.com>
3376
3377 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
3378
c95e9f27
ST
33792010-09-28 Sriraman Tallam <tmsriram@google.com>
3380
3381 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 3382 function.
c95e9f27
ST
3383 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
3384 virtual function.
3385 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
3386 virtual function.
3387 * icf.cc (get_section_contents): Inline merge sections only when
3388 target allows it.
3389
3cac54d2
RW
33902010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3391
3392 * configure: Regenerate.
3393
2904037a
ILT
33942010-09-17 Ian Lance Taylor <iant@google.com>
3395
3396 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
3397 * testsuite/Makefile.am (memory_test.o): New target.
3398 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
3399 memory_test.t.
3400 * testsuite/Makefile.in: Rebuild.
2904037a 3401
bca7fb63
DK
34022010-09-17 Doug Kwan <dougkwan@google.com>
3403
3404 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
3405 defintion if relocation uses GOT entries of the symbol.
3406 * testsuite/icf_safe_test.sh: Fix test.
3407 * testsuite/icf_safe_so_test.sh: Fix test.
3408
4ef28648
CC
34092010-09-16 Cary Coutant <ccoutant@google.com>
3410
3411 * script_sections.cc (class Memory_region): Remove "NULL" from
3412 vector initializations.
3413
793990de
CC
34142010-09-15 Cary Coutant <ccoutant@google.com>
3415
3416 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
3417 Resolve forwarding symbols.
3418
81e015e2
DK
34192010-09-15 Doug Kwan <dougkwan@google.com>
3420
3421 * gold/testsuite/script_test_3.t: Add ARM special sections.
3422 * gold/testsuite/script_test_4.t: Same.
3423 * gold/testsuite/script_test_5.t: Same.
3424 * gold/testsuite/script_test_6.t: Same.
3425 * gold/testsuite/script_test_7.t: Same.
3426 * gold/testsuite/script_test_7.t: Same.
3427 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
3428
36171d64
CC
34292010-09-14 Cary Coutant <ccoutant@google.com>
3430
3431 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
3432 (Target_x86_64::Relocate::relocate_tls): Replace check for
3433 saw_tls_block_reloc_ with test for executable section.
3434
d89051bd
CC
34352010-09-12 Cary Coutant <ccoutant@google.com>
3436
3437 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
3438 position-independent executables to shared libraries need dynamic
3439 relocations.
3440 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
3441 position-independent executables.
3442 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
3443 * testsuite/Makefile.in: Regenerate.
3444
fca41f0f
NC
34452010-09-10 Nick Clifton <nickc@redhat.com>
3446
3447 PR gold/11997
3448 * testsuite/memory_test.t: Discard any sections that are not
3449 needed.
3450
6695e4b3
L
34512010-09-09 H.J. Lu <hongjiu.lu@intel.com>
3452
3453 PR gold/11996
3454 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
3455 "This::" to work around a bug in gcc 4.2.
3456
3457 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
3458
0f72bf6f
RÁE
34592010-09-09 Rafael Espindola <espindola@google.com>
3460
3461 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
3462 sections with different PF_X flags in the same segment.
3463 (Layout::find_first_load_seg): Search all segments to find the first
3464 one.
3465 * options.h (rosegment): New.
3466
34672010-09-08 Rafael Espindola <espindola@google.com>
a6577478 3468
05a79166 3469 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 3470
aa98ff75
DK
34712010-09-08 Doug Kwan <dougkwan@google.com>
3472
3473 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
3474 (Arm_relobj::do_relocate_sections): Add new parameter for output
3475 file to match the parent.
3476 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
3477 of local symbols instead of input values. Update code to track
3478 changes in gold::relocate_section.
3479 * object.cc (Sized_relobj::compute_final_local_value): New methods.
3480 (Sized_relobj::compute_final_local_value_internal): New methods.
3481 (Sized_relobj::do_finalize_local_symbols): Move code from loop
3482 body into private version of Sized_relobj::compute_final_local_value.
3483 Call the inline method.
3484 * object.h (Symbol_value::Symbol_value): Define destructor. Free
3485 merged symbol value if there is one.
3486 (Symbol_value::has_output_value): New method defintiion.
3487 (Sized_relobj::Compute_final_local_value_status): New enum type.
3488 (Sized_relobj::compute_final_local_value): New methods.
3489 (Sized_relobj::compute_final_local_value_internal): New methods.
3490 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
3491 and arm_cortex_a8.sh.
3492 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
3493 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
3494 New tests.
3495 * Makefile.in: Regenerate.
3496 * testsuite/arm_bl_out_of_range.s: Update test.
3497 * testsuite/thumb_bl_out_of_range.s: Ditto.
3498 * testsuite/thumb_blx_out_of_range.s: Ditto.
3499 * testsuite/arm_branch_out_of_range.sh: New file.
3500 * testsuite/arm_cortex_a8.sh: Ditto.
3501 * testsuite/arm_cortex_a8_b.s: Ditto.
3502 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
3503 * testsuite/arm_cortex_a8_b_local.s: Ditto.
3504 * testsuite/arm_cortex_a8_bl.s: Ditto.
3505 * testsuite/arm_cortex_a8_blx.s: Ditto.
3506 * testsuite/arm_cortex_a8_local.s: Ditto.
3507 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
3508 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
3509
05a79166
L
35102010-09-08 Rafael Espindola <espindola@google.com>
3511
3512 * Makefile.am (memory_test.stdout): Run readelf with -W.
3513 * Makefile.in: Regenerate.
3514 * testsuite/memory_test.sh: Make the regexps accept both 32 and
3515 64 bit output.
3516
33dbc701
RÁE
35172010-09-08 Rafael Espindola <espindola@google.com>
3518
3519 * script-sections.cc (Script_sections::add_memory_region): Convert
3520 field precision to int.
3521 * script.cc (script_set_section_region, script_set_section_region):
3522 Convert field precision to int.
3523
731ca54a
RÁE
35242010-09-08 Rafael Espindola <espindola@google.com>
3525
3526 * arm.cc (do_finalize_sections): Create the __exidx_start and
3527 __exdix_end symbols even when the section is missing.
3528
7f8cd844
NC
35292010-09-08 Nick Clifton <nickc@redhat.com>
3530
3531 * README: Remove claim that MEMORY is not supported.
3532 * expression.cc (script_exp_function_origin)
3533 (script_exp_function_length): Move from here to ...
3534 * script.cc: ... here.
3535 (script_set_section_region, script_add_memory)
3536 (script_parse_memory_attr, script_include_directive): New
3537 functions.
3538 * script-sections.cc
3539 (class Memory_region): New class.
3540 (class Output_section_definition): Add set_memory_region,
3541 set_section_vma, set_section_lma and get_section_name methods.
3542 (class Script_Sections): Add add_memory_region,
3543 find_memory_region, find_memory_region_origin,
3544 find_memory_region_length and set_memory_region methods.
3545 Have set_section_addresses method walk the list of set memory
3546 regions.
3547 Extend the print methos to display memory regions.
3548 * script-sections.h: Add prototypes for new methods.
3549 Add enum for MEMORY region attributes.
3550 * yyscript.y: Add support for parsing MEMORY regions.
3551 * script-c.h: Add prototypes for new functions.
3552 * testsuite/Makefile.am: Add test of MEMORY region functionality.
3553 * testsuite/Makefile.in: Regenerate.
3554 * testsuite/memory_test.sh: New script.
3555 * testsuite/memory_test.s: New assembler source file.
3556 * testsuite/memory_test.t: New linker script.
3557
a4649286
DK
35582010-08-27 Doug Kwan <dougkwan@google.com>
3559
3560 * gold/resolve.cc (Symbol_table::should_override): Let a weak
3561 reference override an existing dynamic weak reference.
3562 * testsuite/Makefile.am: Add new test dyn_weak_ref.
3563 * testsuite/Makefile.in: Regenerate.
3564 * testsuite/dyn_weak_ref.sh: New file.
3565 * testsuite/dyn_weak_ref_1.c: Ditto.
3566 * testsuite/dyn_weak_ref_2.c: Ditto.
3567
b56648ad
ILT
35682010-08-27 Ian Lance Taylor <iant@google.com>
3569
3570 * incremental.h (class Incremental_input_entry): Add virtual
3571 destructor.
3572
809313cb
ILT
35732010-08-27 Ian Lance Taylor <iant@google.com>
3574
3575 * testsuite/start_lib_test_3.c: Mark t3 as used.
3576
11e32464
NC
35772010-08-27 Nick Clifton <nickc@redhat.com>
3578
3579 * options.cc (version_script): Fix small typo in previous
3580 whitespace tidyup.
3581
ca09d69a
NC
35822010-08-25 Nick Clifton <nickc@redhat.com>
3583
3584 * archive.cc: Formatting fixes: Remove whitespace between
3585 typename and following asterisk. Remove whitespace between
3586 function name and opening parenthesis.
3587 * archive.h: Likewise.
3588 * arm.cc: Likewise.
3589 * attributes.cc: Likewise.
3590 * attributes.h: Likewise.
3591 * common.cc: Likewise.
3592 * copy-relocs.cc: Likewise.
3593 * dirsearch.h: Likewise.
3594 * dynobj.cc: Likewise.
3595 * ehframe.cc: Likewise.
3596 * ehframe.h: Likewise.
3597 * expression.cc: Likewise.
3598 * fileread.cc: Likewise.
3599 * fileread.h: Likewise.
3600 * gc.h: Likewise.
3601 * gold-threads.cc: Likewise.
3602 * gold.cc: Likewise.
3603 * i386.cc: Likewise.
3604 * icf.h: Likewise.
3605 * incremental-dump.cc: Likewise.
3606 * incremental.cc: Likewise.
3607 * layout.cc: Likewise.
3608 * layout.h: Likewise.
3609 * main.cc: Likewise.
3610 * merge.cc: Likewise.
3611 * merge.h: Likewise.
3612 * object.cc: Likewise.
3613 * object.h: Likewise.
3614 * options.cc: Likewise.
3615 * options.h: Likewise.
3616 * output.cc: Likewise.
3617 * output.h: Likewise.
3618 * plugin.cc: Likewise.
3619 * plugin.h: Likewise.
3620 * powerpc.cc: Likewise.
3621 * reloc.cc: Likewise.
3622 * script-c.h: Likewise.
3623 * script-sections.cc: Likewise.
3624 * script.cc: Likewise.
3625 * stringpool.cc: Likewise.
3626 * symtab.cc: Likewise.
3627 * symtab.h: Likewise.
3628 * target.cc: Likewise.
3629 * timer.cc: Likewise.
3630 * timer.h: Likewise.
3631 * version.cc: Likewise.
3632 * x86_64.cc: Likewise.
3633
b8fa8750
NC
36342010-08-24 Nick Clifton <nickc@redhat.com>
3635
3636 PR 11899
3637 * layout.cc (segment_precedes): Sort segments by their physical
3638 addresses, if they have been set.
3639
9919d93b
CC
36402010-08-23 Cary Coutant <ccoutant@google.com>
3641
3642 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
3643 symbols data.
3644 (Lib_group::include_member): Unlock object after deleting its
3645 symbols data.
3646 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
3647 the bug fixed here.
3648
97b4be1c
CC
36492010-08-19 Neil Vachharajani <nvachhar@google.com>
3650 Cary Coutant <ccoutant@google.com>
3651
3652 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
3653 constructor, and set_blocker.
3654 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
3655 readsyms_blocker_.
3656 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
3657 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
3658 * testsuite/Makefile.am (start_lib_test): New test case.
3659 * testsuite/Makefile.in: Regenerate.
3660 * testsuite/start_lib_test_main.c: New file.
3661 * testsuite/start_lib_test_1.c: New file.
3662 * testsuite/start_lib_test_2.c: New file.
3663 * testsuite/start_lib_test_3.c: New file.
3664
dd0b1884
ILT
36652010-08-19 Ian Lance Taylor <iant@google.com>
3666
3667 * Makefile.in: Rebuild with automake 1.11.1.
3668 * aclocal.m4: Likewise.
3669 * testsuite/Makefile.in: Likewise.
3670
7223e9ca
ILT
36712010-08-19 Ian Lance Taylor <iant@google.com>
3672
3673 PR 10893
3674 * i386.cc (class Output_data_plt_i386): Update declarations.
3675 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
3676 local_ifuncs_ fields.
3677 (Target_i386::do_plt_section_for_global): New function.
3678 (Target_i386::do_plt_section_for_local): New function.
3679 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
3680 parameter; change all callers. Initialize global_ifuncs_ and
3681 local_ifuncs_. If doing a static link define __rel_iplt_start and
3682 __rel_iplt_end.
3683 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
3684 (Output_data_plt_i386::add_local_ifunc_entry): New function.
3685 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
3686 symbols.
3687 (Target_i386::make_plt_section): New function, broken out of
3688 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
3689 (Target_i386::make_plt_entry): Call make_plt_section.
3690 (Target_i386::make_local_ifunc_plt_entry): New function.
3691 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
3692 (Target_i386::Scan::local): Handle IFUNC symbols. Add
3693 R_386_IRELATIVE to switch.
3694 (Target_i386::Scan::global): Likewise.
3695 (Target_i386::Relocate::relocate): Likewise.
3696 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
3697 switch.
3698 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
3699 (Target_x86_64::do_plt_section_for_global): New function.
3700 (Target_x86_64::do_plt_section_for_local): New function.
3701 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
3702 parameter; change all callers. If doing a static link define
3703 __rela_iplt_start and __rela_iplt_end.
3704 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
3705 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
3706 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
3707 to point to .plt.
3708 (Target_x86_64::make_local_ifunc_plt_entry): New function.
3709 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
3710 switch.
3711 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
3712 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
3713 R_X86_64_IRELATIVE to switch.
3714 (Target_x86_64::Scan::global): Likewise.
3715 (Target_x86_64::Relocate::relocate): Likewise.
3716 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
3717 switch.
3718 * target.h (class Target): Add plt_section_for_global and
3719 plt_section_for_local functions. Add do_plt_section_for_global
3720 and do_plt_section_for_local virtual functions.
3721 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
3722 clarifying comments.
3723 (Symbol::use_plt_offset): Handle IFUNC symbol.
3724 * object.cc (Sized_relobj::Sized_relobj): Initialize
3725 local_plt_offsets_.
3726 (Sized_relobj::local_has_plt_offset): New function.
3727 (Sized_relobj::local_plt_offset): New function.
3728 (Sized_relobj::set_local_plt_offset): New function.
3729 (Sized_relobj::do_count): Handle IFUNC symbol.
3730 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
3731 a bit away from input_shndx_ field. Add set_is_func_symbol and
3732 is_ifunc_symbol functions.
3733 (class Sized_relobj): Update declarations. Remove Tls_got_entry
3734 and Local_tls_got_offsets. Define Local_plt_offsets. Add
3735 local_plt_offsets_ field.
3736 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
3737 * output.h (class Output_section_data): Add non-const
3738 output_section function.
3739 (class Output_data_got): Update declarations.
3740 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
3741 Add use_plt_offset parameter to global and local constructors.
3742 Change all callers. Change local_sym_index_ field to 31 bits.
3743 Change GSYM_CODE and CONSTANT_CODE accordingly.
3744 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
3745 doing a static link don't set sh_link field.
3746 (Output_data_got::Got_entry::write): Use PLT offset if
3747 appropriate.
3748 (Output_data_got::add_global_plt): New function.
3749 (Output_data_got::add_local_plt): New function.
3750 * target-reloc.h (relocate_section): Handle IFUNC symbol.
3751 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
3752 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
3753 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
3754 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
3755 IFUNC conditional.
3756 * testsuite/ifunc-sel.h: New file.
3757 * testsuite/ifuncmain1.c: New file.
3758 * testsuite/ifuncmain1vis.c: New file.
3759 * testsuite/ifuncmod1.c: New file.
3760 * testsuite/ifuncdep2.c: New file.
3761 * testsuite/ifuncmain2.c: New file.
3762 * testsuite/ifuncmain3.c: New file.
3763 * testsuite/ifuncmod3.c: New file.
3764 * testsuite/ifuncmain4.c: New file.
3765 * testsuite/ifuncmain5.c: New file.
3766 * testsuite/ifuncmod5.c: New file.
3767 * testsuite/ifuncmain6pie.c: New file.
3768 * testsuite/ifuncmod6.c: New file.
3769 * testsuite/ifuncmain7.c: New file.
3770 * configure, testsuite/Makefile.in: Rebuild.
3771
56f75c03
ILT
37722010-08-18 Ian Lance Taylor <iant@google.com>
3773
3774 * incremental.cc
3775 (Output_section_incremental_inputs::write_input_files): Add cast
3776 to avoid signed/unsigned comparison warning.
3777 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3778
55455f89
CC
37792010-08-12 Cary Coutant <ccoutant@google.com>
3780
3781 * common.cc (Sort_commons::operator()): Remove unnecessary code.
3782
e2054bcb
ILT
37832010-08-13 Ian Lance Taylor <iant@google.com>
3784
3785 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
3786
74f67560
DK
37872010-08-12 Cary Coutant <ccoutant@google.com>
3788 Doug Kwan <dougkwan@google.com>
3789
3790 * resolve.cc (Symbol_table::should_override): When a weak dynamic
3791 defintion overrides non-weak undef, remember that the original undef
3792 is not weak.
3793 * symtab.cc (Symbol_table::sized_write_global): For undef without
3794 an original weak binding, set binding to global in output.
3795 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
3796 * testsuite/Makefile.in: Regenerate.
3797 * testsuite/strong_ref_weak_def.sh: New file.
3798 * testsuite/strong_ref_weak_def_1.c: Ditto.
3799 * testsuite/strong_ref_weak_def_2.c: Ditto.
3800
d1238d12
CC
38012010-08-12 Cary Coutant <ccoutant@google.com>
3802
3803 * testsuite/incremental_test.sh: Rewrite.
3804 * testsuite/incremental_test_1.c: Rewrite.
3805 * testsuite/incremental_test_2.c: Rewrite.
3806
0e70b911
CC
38072010-08-12 Cary Coutant <ccoutant@google.com>
3808
3809 * arm.cc (Target_arm::got_size): Add const.
3810 (Target_arm::got_entry_count): New function.
3811 (Target_arm::plt_entry_count): New function.
3812 (Target_arm::first_plt_entry_offset): New function.
3813 (Target_arm::plt_entry_size): New function.
3814 (Output_data_plt_arm::entry_count): New function.
3815 (Output_data_plt_arm::first_plt_entry_offset): New function.
3816 (Output_data_plt_arm::get_plt_entry_size): New function.
3817 * i386.cc (Target_i386::got_size): Add const.
3818 (Target_i386::got_entry_count): New function.
3819 (Target_i386::plt_entry_count): New function.
3820 (Target_i386::first_plt_entry_offset): New function.
3821 (Target_i386::plt_entry_size): New function.
3822 (Output_data_plt_i386::entry_count): New function.
3823 (Output_data_plt_i386::first_plt_entry_offset): New function.
3824 (Output_data_plt_i386::get_plt_entry_size): New function.
3825 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
3826 find_incremental_inputs_sections. Dump incremental_got_plt section.
3827 * incremental.cc: Include target.h.
3828 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
3829 parameter. Adjust all callers. Find incremental_got_plt section.
3830 (Incremental_inputs::create_data_sections): Create incremental_got_plt
3831 section.
3832 (Output_section_incremental_inputs::set_final_data_size): Calculate
3833 size of incremental_got_plt section.
3834 (Output_section_incremental_inputs::do_write): Write the
3835 incremental_got_plt section.
3836 (Got_plt_view_info): New struct.
3837 (Local_got_offset_visitor): New class.
3838 (Global_got_offset_visitor): New class.
3839 (Global_symbol_visitor_got_plt): New class.
3840 (Output_section_incremental_inputs::write_got_plt): New function.
3841 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
3842 Add parameter. Adjust all callers.
3843 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
3844 (Incremental_inputs::got_plt_section): New function.
3845 (Incremental_inputs::got_plt_section_): New data member.
3846 (Incremental_got_plt_reader): New class.
3847 * layout.cc (Layout::create_incremental_info_sections): Add the
3848 incremental_got_plt section.
3849 * object.h (Got_offset_list::get_list): New function.
3850 (Got offset_list::for_all_got_offsets): New function.
3851 (Sized_relobj::local_got_offset_list): New function.
3852 * powerpc.cc (Target_powerpc::got_size): Add const.
3853 (Target_powerpc::got_entry_count): New function.
3854 (Target_powerpc::plt_entry_count): New function.
3855 (Target_powerpc::first_plt_entry_offset): New function.
3856 (Target_powerpc::plt_entry_size): New function.
3857 (Output_data_plt_powerpc::entry_count): New function.
3858 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
3859 (Output_data_plt_powerpc::get_plt_entry_size): New function.
3860 * sparc.cc (Target_sparc::got_size): Add const.
3861 (Target_sparc::got_entry_count): New function.
3862 (Target_sparc::plt_entry_count): New function.
3863 (Target_sparc::first_plt_entry_offset): New function.
3864 (Target_sparc::plt_entry_size): New function.
3865 (Output_data_plt_sparc::entry_count): New function.
3866 (Output_data_plt_sparc::first_plt_entry_offset): New function.
3867 (Output_data_plt_sparc::get_plt_entry_size): New function.
3868 * symtab.h (Symbol::got_offset_list): New function.
3869 (Symbol_table::for_all_symbols): New function.
3870 * target.h (Sized_target::got_entry_count): New function.
3871 (Sized_target::plt_entry_count): New function.
3872 (Sized_target::plt_entry_size): New function.
3873 * x86_64.cc (Target_x86_64::got_size): Add const.
3874 (Target_x86_64::got_entry_count): New function.
3875 (Target_x86_64::plt_entry_count): New function.
3876 (Target_x86_64::first_plt_entry_offset): New function.
3877 (Target_x86_64::plt_entry_size): New function.
3878 (Output_data_plt_x86_64::entry_count): New function.
3879 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
3880 (Output_data_plt_x86_64::get_plt_entry_size): New function.
3881
09ec0418
CC
38822010-08-12 Cary Coutant <ccoutant@google.com>
3883
3884 * archive.cc: Include incremental.h.
3885 (Archive::Archive): Initialize incremental_info_.
3886 (Archive::include_member): Record archive members in incremental info.
3887 (Add_archive_symbols::run): Record begin and end of an archive in
3888 incremental info.
3889 (Lib_group::include_member): Record objects in incremental info.
3890 * archive.h (Incremental_archive_entry): Forward declaration.
3891 (Archive::set_incremental_info): New member function.
3892 (Archive::incremental_info): New member function.
3893 (Archive::Unused_symbol_iterator): New class.
3894 (Archive::unused_symbols_begin): New member function.
3895 (Archive::unused_symbols_end): New member function.
3896 (Archive::incremental_info_): New data member.
3897 * incremental-dump.cc (find_input_containing_global): New function.
3898 (dump_incremental_inputs): Dump new incremental info sections.
3899 * incremental.cc: Include symtab.h.
3900 (Output_section_incremental_inputs): New class.
3901 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
3902 new incremental info sections.
3903 (Sized_incremental_binary::do_check_inputs): Likewise.
3904 (Incremental_inputs::report_archive): Remove.
3905 (Incremental_inputs::report_archive_begin): New function.
3906 (Incremental_inputs::report_archive_end): New function.
3907 (Incremental_inputs::report_object): New function.
3908 (Incremental_inputs::finalize_inputs): Remove.
3909 (Incremental_inputs::report_input_section): New function.
3910 (Incremental_inputs::report_script): Rewrite.
3911 (Incremental_inputs::finalize): Do nothing but finalize string table.
3912 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
3913 (Incremental_inputs::sized_create_inputs_section_data): Remove.
3914 (Incremental_inputs::create_data_sections): New function.
3915 (Incremental_inputs::relocs_entsize): New function.
3916 (Output_section_incremental_inputs::set_final_data_size): New function.
3917 (Output_section_incremental_inputs::do_write): New function.
3918 (Output_section_incremental_inputs::write_header): New function.
3919 (Output_section_incremental_inputs::write_input_files): New function.
3920 (Output_section_incremental_inputs::write_info_blocks): New function.
3921 (Output_section_incremental_inputs::write_symtab): New function.
3922 * incremental.h (Incremental_script_entry): Forward declaration.
3923 (Incremental_object_entry): Forward declaration.
3924 (Incremental_archive_entry): Forward declaration.
3925 (Incremental_inputs): Forward declaration.
3926 (Incremental_inputs_header_data): Remove.
3927 (Incremental_inputs_header): Remove.
3928 (Incremental_inputs_header_write): Remove.
3929 (Incremental_inputs_entry_data): Remove.
3930 (Incremental_inputs_entry): Remove.
3931 (Incremental_inputs_entry_write): Remove.
3932 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
3933 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
3934 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
3935 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
3936 Likewise.
3937 (Incremental_input_entry): New class.
3938 (Incremental_script_entry): New class.
3939 (Incremental_object_entry): New class.
3940 (Incremental_archive_entry): New class.
3941 (Incremental_inputs::Incremental_inputs): Initialize new data members.
3942 (Incremental_inputs::report_inputs): Remove.
3943 (Incremental_inputs::report_archive): Remove.
3944 (Incremental_inputs::report_archive_begin): New function.
3945 (Incremental_inputs::report_archive_end): New function.
3946 (Incremental_inputs::report_object): Change prototype.
3947 (Incremental_inputs::report_input_section): New function.
3948 (Incremental_inputs::report_script): Change prototype.
3949 (Incremental_inputs::get_reloc_count): New function.
3950 (Incremental_inputs::set_reloc_count): New function.
3951 (Incremental_inputs::create_data_sections): New function.
3952 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
3953 (Incremental_inputs::inputs_section): New function.
3954 (Incremental_inputs::symtab_section): New function.
3955 (Incremental_inputs::relocs_section): New function.
3956 (Incremental_inputs::get_stringpool): Add const.
3957 (Incremental_inputs::command_line): Add const.
3958 (Incremental_inputs::inputs): Remove.
3959 (Incremental_inputs::command_line_key): New function.
3960 (Incremental_inputs::input_file_count): New function.
3961 (Incremental_inputs::input_files): New function.
3962 (Incremental_inputs::relocs_entsize): New function.
3963 (Incremental_inputs::sized_create_inputs_section_data): Remove.
3964 (Incremental_inputs::finalize_inputs): Remove.
3965 (Incremental_inputs::Input_info): Remove.
3966 (Incremental_inputs::lock_): Remove.
3967 (Incremental_inputs::inputs_): Change type.
3968 (Incremental_inputs::inputs_map_): Remove.
3969 (Incremental_inputs::current_object_entry_): New data member.
3970 (Incremental_inputs::inputs_section_): New data member.
3971 (Incremental_inputs::symtab_section_): New data member.
3972 (Incremental_inputs::relocs_section_): New data member.
3973 (Incremental_inputs::reloc_count_): New data member.
3974 (Incremental_inputs_reader): New class.
3975 (Incremental_symtab_reader): New class.
3976 (Incremental_relocs_reader): New class.
3977 * layout.cc (Layout::finalize): Move finalization of incremental info
3978 and creation of incremental info sections to follow finalization of
3979 symbol table. Set offsets for postprocessing sections.
3980 (Layout::create_incremental_info_sections): Call
3981 Incremental_inputs::create_data_sections. Add incremental symtab
3982 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
3983 sections to layout after input sections.
3984 * layout.h (struct Timespec): Forward declaration.
3985 (Layout::incremental_inputs): Add const.
3986 (Layout::create_incremental_info_sections): Add parameter.
3987 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
3988 * object.cc: Include incremental.h.
3989 (Relobj::finalize_incremental_relocs): New function.
3990 (Sized_relobj::do_layout): Record input sections in incremental info.
3991 * object.h (Object::output_section): New function.
3992 (Object::output_section_offset): Moved from Relobj.
3993 (Object::get_incremental_reloc_base): New function.
3994 (Object::get_incremental_reloc_count): New function.
3995 (Object::do_output_section): New function.
3996 (Object::do_output_section_offset): Moved from Relobj.
3997 (Object::do_get_incremental_reloc_base): New function.
3998 (Object::do_get_incremental_reloc_count): New function.
3999 (Object::Object): Initialize new data members.
4000 (Relobj::output_section): Renamed do_output_section and moved to
4001 protected.
4002 (Relobj::output_section_offset): Moved to Object.
4003 (Relobj::do_get_incremental_reloc_base): New function.
4004 (Relobj::do_get_incremental_reloc_count): New function.
4005 (Relobj::allocate_incremental_reloc_counts): New function.
4006 (Relobj::count_incremental_reloc): New function.
4007 (Relobj::finalize_incremental_relocs): New function.
4008 (Relobj::next_incremental_reloc_index): New function.
4009 (Relobj::reloc_counts_): New data member.
4010 (Relobj::reloc_bases_): New data member.
4011 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
4012 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
4013 (Sized_relobj::incremental_relocs_scan): New function.
4014 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4015 (Sized_relobj::incremental_relocs_write): New function.
4016 (Sized_relobj::incremental_relocs_write_reltype): New function.
4017 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
4018 incremental link.
4019 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
4020 archives and object files elsewhere.
4021 (Add_symbols::run): Report object files here.
4022 (Finish_group::run): Report end of archive at end of group.
4023 * reloc.cc: Include layout.h, incremental.h.
4024 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
4025 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
4026 (Sized_relobj::incremental_relocs_scan): New function.
4027 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4028 (Sized_relobj::do_relocate_sections): Write incremental relocations.
4029 (Sized_relobj::incremental_relocs_write): New function.
4030 (Sized_relobj::incremental_relocs_write_reltype): New function.
4031 * script.cc (read_input_script): Rewrite test for incremental link.
4032 Change call to Incremental_inputs::report_script.
4033 * symtab.h (Symbol_table::first_global_index): New function.
4034 (Symbol_table::output_count): New function.
4035
ce0d1972
DK
40362010-08-12 Doug Kwan <dougkwan@google.com>
4037
4038 * arm.cc (Target_arm::merge_object_attributes): Check command line
4039 options --no-wchar-size-warning and --no-enum-size-warning.
4040 * options.h (General_options): Add ld-compatible options
4041 --no-enum-size-warning and --no-wchar-size-warning.
4042
6e5710ce
ILT
40432010-08-04 Ian Lance Taylor <iant@google.com>
4044
4045 * x86_64.cc (Target_x86_64::Scan::local): Use
4046 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
4047 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
4048 (Target_x86_64::Scan::global): Likewise.
4049 (Target_x86_64::Relocate::relocate): Likewise.
4050 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
4051 Likewise.
4052
fef830db
CC
40532010-08-03 Cary Coutant <ccoutant@google.com>
4054
4055 * merge.cc (Output_merge_string::do_add_input_section): Count strings
4056 to reserve space in merged_strings vector. Keep total input size
4057 for stats.
4058 (Output_merge_string::do_print_merge_stats): Print total input size.
4059 * merge.h (Output_merge_string): Add input_size_ field.
4060 * stringpool.cc (Stringpool_template::string_length): Move
4061 implementations out of Stringpool_template class and place in
4062 stringpool.h.
4063 * stringpool.h (string_length): Move out of Stringpool_template.
4064
1e3811b0
ILT
40652010-08-03 Ian Lance Taylor <iant@google.com>
4066
4067 PR 11712
4068 * layout.cc (relaxation_loop_body): If address of load segment is
4069 set, adjust address to include headers if possible.
4070
7af0c620
ILT
40712010-08-03 Ian Lance Taylor <iant@google.com>
4072
4073 * version.cc (version_string): Bump to 1.10.
4074
22f0da72
ILT
40752010-08-03 Ian Lance Taylor <iant@google.com>
4076
4077 PR 11805
4078 * layout.h (enum Output_section_order): Define.
4079 (class Layout): Update declarations.
4080 * layout.cc (Layout::get_output_section): Add order parameter.
4081 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
4082 is_first_non_relro parameters. Change all callers.
4083 (Layout::choose_output_section): Likewise.
4084 (Layout::add_output_section_data): Likewise.
4085 (Layout::make_output_section): Likewise. Set order.
4086 (Layout::default_section_order): New function.
4087 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
4088 * output.cc (Output_section::Output_section): Initialize order_.
4089 Don't initialize deleted fields.
4090 (Output_segment::Output_segment): Don't initialize deleted
4091 fields.
4092 (Output_segment::add_output_section_to_load): New function
4093 replacing add_output_section. Change all callers to call this or
4094 add_output_section_to_nonload.
4095 (Output_segment::add_output_section_to_nonload): New function.
4096 (Output_segment::remove_output_section): Rewrite.
4097 (Output_segment::add_initial_output_data): Likewise.
4098 (Output_segment::has_any_data_sections): Likewise.
4099 (Output_segment::is_first_section_relro): Likewise.
4100 (Output_segment::maximum_alignment): Likewise.
4101 (Output_segment::has_dynamic_reloc): New function replacing
4102 dynamic_reloc_count. Change all callers.
4103 (Output_segment::has_dynamic_reloc_list): New function replacing
4104 dynamic_reloc_count_list. Change all callers.
4105 (Output_segment::set_section_addresses): Rewrite.
4106 (Output_segment::set_offset): Rewrite.
4107 (Output_segment::find_first_and_last_list): Remove.
4108 (Output_segment::set_tls_offsets): Rewrite.
4109 (Output_segment::first_section_load_address): Likewise.
4110 (Output_segment::output_section_count): Likewise.
4111 (Output_segment::section_with_lowest_load_address): Likewise.
4112 (Output_segment::write_section_headers): Likewise.
4113 (Output_segment::print_sections_to_map): Likewise.
4114 * output.h (class Output_data): Remove dynamic_reloc_count_
4115 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
4116 (Output_data::add_dynamic_reloc): Rewrite.
4117 (Output_data::has_dynamic_reloc): New function.
4118 (Output_data::dynamic_reloc_count): Remove.
4119 (class Output_section): Add order_ field. Remvoe is_relro_local_,
4120 is_last_relro_, is_first_non_relro_, is_interp_,
4121 is_dynamic_linker_section_ fields. Add order and set_order
4122 functions. Remove is_relro_local, set_is_relro_local,
4123 is_last_relro, set_is_last_relro, is_first_non_relro,
4124 set_is_first_non_relro functions, is_interp, set_is_interp,
4125 is_dynamic_linker_section, and set_is_dynamic_linker_section
4126 functions.
4127 (class Output_segment): Change Output_data_list from std::list to
4128 std:;vector. Add output_lists_ field. Remove output_data_ and
4129 output_bss_ fields. Update declarations.
4130
3ff2ccb0
ILT
41312010-08-02 Ian Lance Taylor <iant@google.com>
4132
4133 * arm.cc (Target_arm::gc_process_relocs): Use typename.
4134 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
4135 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
4136
88a4108b
ILT
41372010-08-02 Ian Lance Taylor <iant@google.com>
4138
4139 PR 11855
4140 * script.cc (Script_options::Script_options): Initialize
4141 symbol_definitions_ and symbol_references_.
4142 (Script_options::add_symbol_assignment): Update
4143 symbol_definitions_ and symbol_references_.
4144 (Script_options::add_symbol_reference): New function.
4145 (script_symbol): New function.
4146 * script.h (class Script_options): Add symbol_definitions_ and
4147 symbol_references_ fields.
4148 (Script_options::referenced_const_iterator): New type.
4149 (Script_options::referenced_begin): New function.
4150 (Script_options::referenced_end): New function.
4151 (Script_options::is_referenced): New function.
4152 (Script_options::any_unreferenced): New function.
4153 * script-c.h (script_symbol): Declare.
4154 * yyscript.y (exp): Call script_symbol.
4155 * symtab.cc: Include "script.h".
4156 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
4157 Change all callers. Check symbols referenced by scripts.
4158 (Symbol_table::add_undefined_symbols_from_command_line): Add
4159 layout parameter. Change all callers.
4160 (Symbol_table::do_add_undefined_symbols_from_command_line):
4161 Likewise. Break out loop body. Check symbols referenced by
4162 scripts.
4163 (Symbol_table::add_undefined_symbol_from_command_line): New
4164 function broken out of
4165 do_add_undefined_symbols_from_command_line.
4166 * symtab.h (class Symbol_table): Update declarations.
4167 * archive.cc: Include "layout.h".
4168 (Archive::should_include_member): Add layout parameter. Change
4169 all callers. Check for symbol mentioned in expression.
4170 * archive.h (class Archive): Update declaration.
4171 * object.cc (Sized_relobj::do_should_include_member): Add layout
4172 parameter.
4173 * object.h (Object::should_include_member): Add layout parameter.
4174 Change all callers.
4175 (Object::do_should_include_member): Add layout parameter.
4176 (class Sized_relobj): Update declaration.
4177 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
4178 parameter.
4179 * dynobj.h (class Sized_dynobj): Update declaration.
4180 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
4181 layout parameter.
4182 * plugin.h (class Sized_pluginobj): Update declaration.
4183
5f1ab67a
ILT
41842010-08-02 Ian Lance Taylor <iant@google.com>
4185
4186 PR 11866
4187 * output.cc (Output_segment::set_offset): Search for the first and
4188 last sections rather than assuming that the list is in order.
4189 (Output_segment::find_first_and_last_list): New function.
4190 * output.h (class Output_segment): Update declarations.
4191 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
4192 (relro_strip_test_SOURCES): New variable.
4193 (relro_strip_test_DEPENDENCIES): New variable.
4194 (relro_strip_test_LDFLAGS): New variable.
4195 (relro_strip_test_LDADD): New variable.
4196 (relro_strip_test.so): New target.
4197
a8df5856
ILT
41982010-08-02 Ian Lance Taylor <iant@google.com>
4199
4200 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
4201 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
4202 (Target_i386::got_tlsdesc_section): New function.
4203 (Target_i386::got_section): Create space for GOT entries for
4204 TLSDESC relocations.
4205 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
4206 R_386_TLS_GOTDESC.
4207 (Target_i386::Scan::global): Likewise.
4208 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
4209 using TLSDESC GOT.
4210 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
4211 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
4212 (Target_x86_64::got_tlsdesc_section): New function.
4213 (Target_x86_64::got_section): Create space for GOT entries for
4214 TLSDESC relocations.
4215 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
4216 R_386_TLS_GOTDESC.
4217 (Target_x86_64::Scan::global): Likewise.
4218 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
4219 using TLSDESC GOT.
4220
0c10a0a6
ILT
42212010-08-02 Ian Lance Taylor <iant@google.com>
4222
4223 * testsuite/final_layout.sh: Use dc to convert from hex to
4224 decimal.
4225
41cbeecc
ST
42262010-07-29 Sriraman Tallam <tmsriram@google.com>
4227
4228 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
4229 paramter to the call to gold::gc_process_relocs.
4230 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
4231 paramter to the call to gold::gc_process_relocs.
4232 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
4233 parameter to the call to gold::gc_process_relocs.
4234 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
4235 template parameter to the call to gold::gc_process_relocs.
4236 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
4237 paramter to the call to gold::gc_process_relocs.
4238 * gc.h (get_embedded_addend_size): New function.
4239 (gc_process_relocs): Save the size of the reloc for use by ICF.
4240 * icf.cc (get_section_contents): Get the addend from the text section
4241 for SHT_REL relocation sections.
4242 * icf.h (Icf::Reloc_addend_size_info): New typedef.
4243 (Icf::Reloc_info): Add new member reloc_addend_size_info.
4244 * int_encoding.h (read_from_pointer): New overloaded function.
4245 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
4246 * testsuite/icf_sht_rel_addend_test.sh: New file.
4247 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
4248 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
4249
6ea55b82
RW
42502010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4251
4252 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
4253 * Makefile.in: Regenerate.
4254 * testsuite/Makefile.in: Regenerate.
4255
9691462b
ILT
42562010-07-27 Jeffrey Yasskin <jyasskin@google.com>
4257
4258 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
4259 * gold/testsuite/debug_msg.cc: Likewise.
4260 * gold/testsuite/odr_violation1.cc
4261 * gold/testsuite/odr_violation2.cc
4262
76897331
CC
42632010-07-21 Cary Coutant <ccoutant@google.com>
4264
4265 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
4266 string, and length fields.
4267 (Output_merge_string::Merged_strings_list): New type.
4268 (Output_merge_string::Merged_strings_lists): New typedef.
4269 (Output_merge_string): Replace merged_strings_ with
4270 merged_strings_lists_.
4271 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
4272 Merged_strings_list per input object and section. Don't store pointer
4273 to the string. Don't store length with each merged string entry.
4274 (Output_merge_string::finalize_merged_data): Loop over list of merged
4275 strings lists. Recompute length of each merged string.
4276
78384e8f
CC
42772010-07-15 Cary Coutant <ccoutant@google.com>
4278
4279 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
4280 here.
4281
783659f9
ILT
42822010-07-14 Ian Lance Taylor <iant@google.com>
4283
4284 * descriptors.cc (Descriptors::open): Report correct name in error
4285 message.
4286
131687b4
DK
42872010-07-13 Doug Kwan <dougkwan@google.com>
4288
4289 * arm.cc (Arm_input_section::Arm_input_section): For a
4290 SHT_ARM_EXIDX section, always keeps the input sections.
4291 (Arm_input_section::set_exidx_section_link): New method.
4292 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
4293 has_errors_ to false.
4294 (Arm_exidx_input_section::has_errors,
4295 Arm_exidx_input_section::set_has_errors): New methods.
4296 (Arm_exidx_input_section::has_errors_): New data member.
4297 (Arm_relobj::get_exidx_shndx_list): New method.
4298 (Arm_output_section::append_text_sections_to_list): Do not skip
4299 section without SHF_EXECINSTR.
4300 (Arm_output_section::fix_exidx_coverage): Skip input sections with
4301 errors.
4302 (Arm_relobj::make_exidx_input_section): Add new parameter for text
4303 section header. Make error messages more verbose. Check for
4304 a non-executable section linked to an EXIDX section.
4305 (Arm_relobj::do_read_symbols): Remove error checking, which has been
4306 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
4307 check that there is no deferred EXIDX section if we exit early.
4308 Instead of not making an EXIDX section in case of an error, make one
4309 and set the has_errors flag of it.
4310 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
4311 in a relocatable link.
4312 (Target_arm::do_relax): Look for the EXIDX output section instead of
4313 assuming that it is called .ARM.exidx.
4314 (Target_arm::fix_exidx_coverage): Add a new parameter for input
4315 section list. Do not check for SHF_EXECINSTR section flags but
4316 skip any input section with errors.
4317 * output.cc (Output_section::Output_section): Initialize
4318 always_keeps_input_sections_ to false.
4319 (Output_section::add_input_section): Check for
4320 always_keeps_input_sections_.
4321 * output.h (Output_section::always_keeps_input_sections,
4322 Output_section::set_always_keeps_input_sections): New methods.
4323 (Output_section::always_keeps_input_sections): New data member.
4324
69517287
RÁE
43252010-07-13 Rafael Espindola <espindola@google.com>
4326
4327 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
4328 * fileread.h (Input_file): Add try_extra_search_path and find_file.
4329
82742395
ILT
43302010-07-13 Philip Herron <herron.philip@googlemail.com>
4331 Ian Lance Taylor <iant@google.com>
4332
4333 * output.h (Output_section_lookup_maps::add_merge_section):
4334 Correct check of whether value was inserted.
4335 (Output_section_lookup_maps::add_merge_input_section): Likewise.
4336 (Output_section_lookup_maps::add_relaxed_input_section):
4337 Likewise.
4338 * arm.cc (Target_arm::got_section): Remove used local os.
4339 * i386.cc (Target_i386::got_section): Likewise.
4340 * x86_64.cc (Target_x86_64::got_section): Likewise.
4341 * sparc.cc (Target_sparc::got_section): Likewise.
4342 (Target_sparc::relocate): Remove unused local have_got_offset.
4343 * powerpc.cc (Target_powerpc::relocate): Likewise.
4344
f2d707b5
ILT
43452010-07-13 Ian Lance Taylor <iant@google.com>
4346
241531d6
ILT
4347 * compressed_output.cc (zlib_decompress): Fix signature in
4348 !HAVE_ZLIB_H case.
4349
f2d707b5
ILT
4350 * archive.cc (Archive::include_member): Unlock an external member
4351 of a thin archive. Don't bother to delete an object we know is
4352 NULL.
4353
a2e47362
CC
43542010-07-12 Cary Coutant <ccoutant@google.com>
4355
4356 * compressed_output.cc (zlib_decompress): New function.
4357 (get_uncompressed_size): New function.
4358 (decompress_input_section): New function.
4359 * compressed_output.h (get_uncompressed_size): New function.
4360 (decompress_input_section): New function.
4361 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
4362 Handle compressed debug sections.
4363 * layout.cc (is_compressed_debug_section): New function.
4364 (Layout::output_section_name): Map compressed section names to
4365 canonical names.
4366 * layout.h (is_compressed_debug_section): New function.
4367 (is_debug_info_section): Recognize compressed debug sections.
4368 * merge.cc: Include compressed_output.h.
4369 (Output_merge_data::do_add_input_section): Handle compressed
4370 debug sections.
4371 (Output_merge_string::do_add_input_section): Handle compressed
4372 debug sections.
4373 * object.cc: Include compressed_output.h.
4374 (Sized_relobj::Sized_relobj): Initialize new data members.
4375 (build_compressed_section_map): New function.
4376 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
4377 * object.h (Object::section_is_compressed): New method.
4378 (Object::do_section_is_compressed): New method.
4379 (Sized_relobj::Compressed_section_map): New type.
4380 (Sized_relobj::do_section_is_compressed): New method.
4381 (Sized_relobj::compressed_sections_): New data member.
4382 * output.cc (Output_section::add_input_section): Handle compressed
4383 debug sections.
4384 * reloc.cc: Include compressed_output.h.
4385 (Sized_relobj::write_sections): Handle compressed debug sections.
4386
ce279a62
CC
43872010-07-08 Cary Coutant <ccoutant@google.com>
4388
4389 * resolve.cc (Symbol_table::resolve): Remember whether undef was
4390 weak when resolving to a dynamic def.
4391 (Symbol_table::should_override): Add adjust_dyndef flag; set it
4392 for weak undef/dynamic def cases. Adjust callers.
4393 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
4394 undef_binding_weak_.
4395 (Symbol_table::sized_write_globals): Adjust symbol binding.
4396 (Symbol_table::sized_write_symbol): Add binding parameter.
4397 * symtab.h (Symbol::set_undef_binding): New method.
4398 (Symbol::is_undef_binding_weak): New method.
4399 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
4400 (Symbol_table::should_override): Add new parameter.
4401 (Symbol_table::sized_write_symbol): Add new parameter.
4402
4403 * testsuite/weak_undef_file1.cc: Add new test case.
4404 * testsuite/weak_undef_file2.cc: Fix header comment.
4405 * testsuite/weak_undef_test.cc: Add new test case.
4406
b2286c10
DK
44072010-06-29 Doug Kwan <dougkwan@google.com>
4408
4409 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
4410 Initialize USE_SYMBOL_.
4411 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
4412 definition.
4413 (Arm_reloc_property::uses_symbol_): New data member declaration.
4414 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
4415 uses symbol value and symbol is undefined but not weakly undefined.
4416
4802450a
RÁE
44172010-06-28 Rafael Espindola <espindola@google.com>
4418
4419 * plugin.cc (Plugin::load): Use dlerror.
4420
e5ca47ba
ILT
44212010-06-26 Jeffrey Yaskin <jyasskin@google.com>
4422
4423 * symtab.cc (detect_odr_violations): When reporting an ODR
4424 violation, report an object where the symbol is defined.
4425
8a75a161
DK
44262010-06-25 Doug Kwan <dougkwan@google.com>
4427
4428 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
4429 (Target_arm::section_may_have_icf_unsafe_pointers): New method
4430 definition.
4431 (Target_arm::Scan::local_reloc_may_be_function_pointer,
4432 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
4433 target hook to detect function points.
4434 (Target_arm::Scan::possible_function_pointer_reloc): New method.
4435 * icf.h (Icf::check_section_for_function_pointers): Change type of
4436 parameter SECTION_NAME to const reference to std::string. Use
4437 target hook to determine if section may have unsafe pointers.
4438 * target.h (Target::section_may_have_icf_unsafe_pointers): New
4439 method definition.
4440
42218b9f
RÁE
44412010-06-21 Rafael Espindola <espindola@google.com>
4442
4443 * fileread.cc (Input_file::find_fie): New
4444 (Input_file::open): Use Input_file::find_fie.
4445 * fileread.h (Input_file::find_fie): New
4446 * plugin.cc (set_extra_library_path): New.
4447 (Plugin::load): Add set_extra_library_path to the transfer vector.
4448 (Plugin_manager::set_extra_library_path): New.
4449 (Plugin_manager::add_input_file): Use the extra search path if set.
4450 (set_extra_library_path(): New.
4451 * plugin.h (Plugin_manager): Add set_extra_library_path and
4452 extra_search_path_.
4453
a0506cca
CC
44542010-06-19 Cary Coutant <ccoutant@google.com>
4455
4456 * layout.cc (gdb_sections): Add .debug_types.
4457 (lines_only_debug_sections): Likewise.
4458
6508b958
RÁE
44592010-06-18 Rafael Espindola <espindola@google.com>
4460
4461 * plugin.cc (add_input_file,add_input_library)
4462 (Plugin_manager::add_input_file): Make filename arguments const.
4463 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
4464 const.
4465
3e235302
DK
44662010-06-16 Doug Kwan <dougkwan@google.com>
4467
4468 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
4469 .ARM.attributes section if we have not merged any input
4470 attributes sections.
4471
106e8a6c
DK
44722010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4473
4474 * arm.cc: Allow combining objects with no EABI version
4475 information.
4476
91ff43fe
RÁE
44772010-06-15 Rafael Espindola <espindola@google.com>
4478
4479 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
4480
68ed838c
ILT
44812010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4482
4483 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
4484 (struct iovec): Correct !HAVE_READV definition.
4485
f3a2388f
CC
44862010-06-10 Cary Coutant <ccoutant@google.com>
4487
4488 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
4489 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
4490 reloc sections.
4491 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
4492
4493 PR 11683
4494 * symtab.h (Symbol::is_placeholder): New member function.
4495 * target-reloc.h (relocate_section): Check for placeholder symbols.
4496
4497 * testsuite/Makefile.am (plugin_test_8): New test.
4498 (plugin_test_9): New test.
4499 * testsuite/Makefile.in: Regenerate.
4500
e1df38aa
NC
45012010-06-09 Nick Clifton <nickc@redhat.com>
4502
4503 * yyscript.y (input_list_element): Allow strings prefixed with
4504 the '-' character. Treat these as libraries.
4505 * script.cc (script_add_library): New function. Adds a library
4506 specified by "-l<name>" found in an input script.
4507 * script-c.h: Add prototype for script_add_library.
4508
25bbe950
DK
45092010-06-07 Doug Kwan <dougkwan@google.com>
4510
4511 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
4512 Restrict stub-group size to be within long conditional branch
4513 range when working around cortex-A8 erratum.
4514
0f32ea4c
ILT
45152010-06-07 Damien Diederen <dd@crosstwine.com>
4516
4517 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
4518 #ifdef typo.
4519
8fe2a369
ST
45202010-06-03 Sriraman Tallam <tmsriram@google.com>
4521
4522 PR gold/11658
4523 * output.cc
4524 (Output_section::Input_section_sort_entry::compare_section_ordering):
4525 Change to return non-zero correctly.
4526 (Output_section::Input_section_sort_section_order_index_compare
4527 ::operator()): Change to fix ambiguity in comparisons.
4528
6e9ba2ca
ST
45292010-06-01 Sriraman Tallam <tmsriram@google.com>
4530
4531 * gold.h (is_wildcard_string): New function.
4532 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
4533 (Layout::layout_eh_frame): Ditto.
4534 (Layout::find_section_order_index): New method.
4535 (Layout::read_layout_from_file): New method.
4536 * layout.h (Layout::find_section_order_index): New method.
4537 (Layout::read_layout_from_file): New method.
4538 (Layout::input_section_position_): New private member.
4539 (Layout::input_section_glob_): New private member.
4540 * main.cc (main): Call read_layout_from_file here.
4541 * options.h (--section-ordering-file): New option.
4542 * output.cc (Output_section::input_section_order_specified_): New
4543 member.
4544 (Output_section::Output_section): Initialize new member.
4545 (Output_section::add_input_section): Add new parameter.
4546 Keep input sections when --section-ordering-file is used.
4547 (Output_section::set_final_data_size): Sort input sections when
4548 section ordering file is specified.
4549 (Output_section::Input_section_sort_entry): Add new parameter.
4550 Check sorting type.
4551 (Output_section::Input_section_sort_entry::compare_section_ordering):
4552 New method.
4553 (Output_section::Input_section_sort_compare::operator()): Change to
4554 consider section_order_index.
4555 (Output_section::Input_section_sort_init_fini_compare::operator()):
4556 Change to consider section_order_index.
4557 (Output_section::Input_section_sort_section_order_index_compare
4558 ::operator()): New method.
4559 (Output_section::sort_attached_input_sections): Change to sort
4560 according to section order when specified.
e1df38aa
NC
4561 (Output_section::add_input_section<32, true>): Add new parameter.
4562 (Output_section::add_input_section<64, true>): Add new parameter.
4563 (Output_section::add_input_section<32, false>): Add new parameter.
4564 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
4565 * output.h (Output_section::add_input_section): Add new parameter.
4566 (Output_section::input_section_order_specified): New
4567 method.
4568 (Output_section::set_input_section_order_specified): New method.
4569 (Input_section::Input_section): Initialize section_order_index_.
4570 (Input_section::section_order_index): New method.
4571 (Input_section::set_section_order_index): New method.
4572 (Input_section::section_order_index_): New member.
4573 (Input_section::Input_section_sort_section_order_index_compare): New
4574 struct.
4575 (Output_section::input_section_order_specified_): New member.
4576 * script-sections.cc (is_wildcard_string): Delete and move modified
4577 method to gold.h.
4578 (Output_section_element_input::Output_section_element_input): Modify
4579 call to is_wildcard_string.
4580 (Output_section_element_input::Input_section_pattern
4581 ::Input_section_pattern): Ditto.
4582 (Output_section_element_input::Output_section_element_input): Ditto.
4583 * testsuite/Makefile.am (final_layout): New test case.
4584 * testsuite/Makefile.in: Regenerate.
4585 * testsuite/final_layout.cc: New file.
4586 * testsuite/final_layout.sh: New file.
4587
3537c84b
RÁE
45882010-06-01 Rafael Espindola <espindola@google.com>
4589
4590 * plugin.cc (Plugin::load): Pass the output name to the plugin.
4591
105b6afd
RÁE
45922010-06-01 Rafael Espindola <espindola@google.com>
4593
4594 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
4595 visibility of symbols.
4596
29e11421
DK
45972010-05-27 Doug Kwan <dougkwan@google.com>
4598
4599 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
4600 from start of output section instead of address for a local symbol
4601 in a merged or relaxed section when doing a relocatable link.
4602
5e0f337e
RÁE
46032010-05-26 Rafael Espindola <espindola@google.com>
4604
4605 PR 11604
4606 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
4607 adding sections the garbage collector removed.
4608 * gold/testsuite/Makefile.am: Add test.
4609 * gold/testsuite/Makefile.in: Regenerate.
4610 * gold/testsuite/plugin_test_7.sh: New.
4611 * gold/testsuite/plugin_test_7_1.c: New.
4612 * gold/testsuite/plugin_test_7_2.c: New.
4613
f4187277
RÁE
46142010-05-26 Rafael Espindola <espindola@google.com>
4615
4616 * script-sections.cc (Output_section_definition::set_section_addresses):
4617 Check for --section-start.
4618
5c388529
DK
46192010-05-26 Doug Kwan <dougkwan@google.com>
4620
4621 * arm.cc (Arm_scan_relocatable_relocs): New class.
4622 (Target_arm::relocate_special_relocatable): New method.
4623 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
4624 (Arm_relocate_functions::thumb_branch_common): Same.
4625 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
4626 instead of Default_scan_relocatable_relocs.
4627 * target-reloc.h (relocate_for_relocatable): Let target handle
4628 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
4629 * target.h (Sized_target::relocate_special_relocatable): New method.
4630
bca1c3ae
ILT
46312010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4632
4633 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
4634
0439c796
DK
46352010-05-23 Doug Kwan <dougkwan@google.com>
4636
4637 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
4638 instead of a cast.
4639 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
4640 with a direct branch, not a conditional branch, to a stub.
4641 * merge.cc (Output_merge_base::record_input_section): New method
4642 defintion.
4643 (Output_merge_data::do_add_input_section): Record input section if
4644 keeps-input-sections flag is set.
4645 (Output_merge_string::do_add_input_section): Ditto.
4646 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
4647 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
4648 INPUT_SECTIONS_.
4649 (Output_merge_base::keeps_input_sections,
4650 Output_merge_base::set_keeps_input_sections,
4651 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
4652 method definitions.
4653 (Output_merge_base::Input_sections): New type declaration.
4654 (Output_merge_base::input_sections_begin,
4655 Output_merge_base::input_sections_end,
4656 Output_merge_base::do_set_keeps_input_sections): New method definitions.
4657 (Output_merge_base::bool keeps_input_sections_,
4658 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
4659 Output_merge_base::input_sections_): New data members.
4660 (Output_merge_data::do_set_keeps_input_sections): New method
4661 defintion.
4662 (Output_merge_string::do_set_keeps_input_sections): Ditto.
4663 * output.cc (Output_section::Input_section::relobj): Move method
4664 defintion from class declaration to here and handle merge sections.
4665 (Output_section::Input_section::shndx): Ditto.
4666 (Output_section::Output_section): Remove initializations of removed
4667 data members and initialize new data member LOOKUP_MAPS_.
4668 (Output_section::add_input_section): Set keeps-input-sections flag
4669 for a newly created merge output section as appropriate. Adjust code
4670 to use Output_section_lookup_maps class.
4671 (Output_section::add_relaxed_input_section): Adjst code for lookup
4672 maps code refactoring.
4673 (Output_section::add_merge_input_section): Add a new parameter
4674 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
4675 class. If adding input section to a newly created merge output
4676 section fails, remove the new merge section.
4677 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 4678 Adjust code for use of the Output_section_lookup_maps class.
0439c796
DK
4679 (Output_section::find_merge_section): Ditto.
4680 (Output_section::build_lookup_maps): New method defintion.
4681 (Output_section::find_relaxed_input_section): Adjust code to use
4682 Output_section_lookup_maps class.
4683 (Output_section::get_input_sections): Export merge sections. Adjust
4684 code to use Output_section_lookup_maps class.
4685 (Output_section:::add_script_input_section): Adjust code to use
4686 Output_section_lookup_maps class. Update lookup maps for merge
4687 sections also.
4688 (Output_section::discard_states): Use Output_section_lookup_maps.
4689 (Output_section::restore_states): Same.
4690 * output.h (Merge_section_properties): Move class defintion out of
4691 Output_section.
4692 (Output_section_lookup_maps): New class.
4693 (Output_section::Input_section::is_merge_section): New method
4694 defintion.
4695 (Output_section::Input_section::relobj): Move defintion out of class
4696 defintion. Declare method only.
4697 (Output_section::Input_section::shndx): Ditto.
4698 (Output_section::Input_section::output_merge_base): New method defintion.
4699 (Output_section::Input_section::u2_.pomb): New union field.
4700 (Output_section::Merge_section_by_properties_map,
4701 Output_section::Output_section_data_by_input_section_map,
4702 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
4703 Remove types.
4704 (Output_section::add_merge_input_section): Add new parameter
4705 KEEPS_INPUT_SECTIONS.
4706 (Output_section::build_lookup_maps): New method declaration.
4707 (Output_section::merge_section_map_,
4708 Output_section::merge_section_by_properties_map_,
4709 Output_section::relaxed_input_section_map_,
4710 Output_section::is_relaxed_input_section_map_valid_): Remove data
4711 members.
4712 (Output_section::lookup_maps_): New data member.
4713
76295588
L
47142010-05-21 Doug Kwan <dougkwan@google.com>
4715
4716 PR gold/11619
4717 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
4718 avoid a compilation error.
4719
d103a984
RÁE
47202010-05-19 Rafael Espindola <espindola@google.com>
4721
4722 * script-sections.cc (Output_section_definition::allocate_to_segment):
4723 Update the phdrs_list even when the output section is NULL.
4724 * testsuite/Makefile.am: Add test.
4725 * testsuite/Makefile.in: Regenerate.
4726 * testsuite/script_test_9.cc: New.
4727 * testsuite/script_test_9.sh: New.
4728 * testsuite/script_test_9.t: New.
4729
6625d24e
DK
47302010-05-19 Doug Kwan <dougkwan@google.com>
4731
4732 * arm.cc (Arm_input_section::original_size): New method.
4733 (Arm_input_section::do_addralign): Add a cast.
4734 (Arm_input_section::do_output_offset): Remove static cast.
4735 (Arm_input_section::original_addralign,
4736 Arm_input_section::original_size_): Change type to uint32_t.
4737 (Arm_input_section::init): Add safe casts for section alignment
4738 and size.
4739 (Arm_input_section::set_final_data_size): Do not set address and
4740 offset of stub table.
4741 (Arm_output_section::fix_exidx_coverage): Change use of of
4742 Output_section::Simple_input_section to that of
4743 Output_section::Input_section.
4744 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
4745 except for the first pass.
4746 * output.cc (Output_section::get_input_sections): Change type of
4747 input_sections to std::list<Input_section>.
4748 (Output_section::add_script_input_section): Rename from
4749 Output_section::add_simple_input_section. Change type of SIS
4750 parameter from Simple_input_section to Input_section.
4751 * output.h (Output_section::Simple_input_section): Remove class.
4752 (Output_section::Input_section): Change class visibility to public.
4753 (Output_section::Input_section::addralign): Use stored alignments
4754 for special input sections if set.
4755 (Output_section::Input_section::set_addralign): New method.
4756 (Output_section::get_input_sections): Change parameter type from
4757 list of Simple_input_section to list of Input_section.
4758 (Output_section::add_script_input_section): Rename from
4759 Output_section::add_simple_input_section. Change first parameter's
4760 type from Simple_input_section to Input_section and remove the
4761 second and third parameters.
4762 * script-sections.cc (Input_section::Input_section_list): Change
4763 type to list of Output_section::Input_section/
4764 (Input_section_info::Input_section_info): Change parameter type of
4765 INPUT_SECTION to Output_section::Input_section.
4766 (Input_section_info::input_section): Change return type.
4767 (Input_section_info::input_section_): Change type to
4768 Output_section::Input_section.
4769 (Output_section_element_input::set_section_addresses): Adjust code
4770 to use Output_section::Input_section instead of
4771 Output_section::Simple_input_section. Adjust code for renaming
4772 of Output_section::add_simple_input_section.
4773 (Orphan_output_section::set_section_addresses): Ditto.
4774
e1e82ea4
RW
47752010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4776
4777 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
4778 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
4779
91e75c8a
RÁE
47802010-05-18 Rafael Espindola <espindola@google.com>
4781
4782 * options.cc (General_options::finalize): Handle -nostdlib.
4783 * options.h (nostdlib): New option.
4784 * script.cc (script_add_search_dir): Handle -nostdlib.
4785
da59ad79
DK
47862010-05-12 Doug Kwan <dougkwan@google.com>
4787
4788 * arm.cc (Target_arm::do_finalize_sections): Create an empty
4789 attributes section only if there no attributes section after merging.
4790 (Target_arm::merge_object_attributes): Move value of
e1df38aa 4791 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
4792 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
4793 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
4794 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
4795 and arm_attr_merge_7.stdout.
4796 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
4797 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
4798 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
4799 arm_attr_merge_7b.o): New rules.
4800 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
4801 arm_attr_merge_7
4802 * testsuite/Makefile.in: Regenerate.
4803 * testsuite/arm_attr_merge.sh: New file.
4804 * testsuite/arm_attr_merge_[67][ab].s: Same.
4805
3e01a7fd
NC
48062010-05-05 Nick Clifton <nickc@redhat.com>
4807
4808 * po/es.po: Updated Spanish translation.
4809
7ad2014a
L
48102010-04-27 H.J. Lu <hongjiu.lu@intel.com>
4811
4812 * Makefile.am (install-exec-local): Properly install gold as
4813 default cross linker.
4814 * Makefile.in: Regenerated.
4815
4fda8867
NC
48162010-04-27 H.J. Lu <hongjiu.lu@intel.com>
4817 Nick Clifton <nickc@redhat.com>
4818
4819 * configure.ac (install_as_default): Define and set to false
4820 unless --enable-gold or --enable-gold=both/gold has been
4821 specified.
4822 * configure: Regenerate.
4823
4824 * Makefile.am (install-exec-local): Install the executable as
4825 'ld.gold'. If install_as_default is true then also install it as
4826 'ld'.
4827 * Makefile.in: Regenerated.
4828
bd288ea2
ILT
48292010-04-24 Ian Lance Taylor <iant@google.com>
4830
4831 * layout.cc (Layout::layout_reloc): In relocatable link don't
4832 combine reloc sections for grouped sections.
4833
ef38fd8a
ST
48342010-04-23 Sriraman Tallam <tmsriram@google.com>
4835
4836 * gc.h (gc_process_relocs): Pass information on relocs pointing to
4837 sections that are not ordinary to icf.
4838 * icf.cc (get_section_contents): Handle relocation pointing to section
4839 with no object or shndx information.
4840 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
4841 * testsuite/Makefile.in: Regenerate.
4842 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
4843 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
4844
f6973bdc
ILT
48452010-04-22 Ian Lance Taylor <iant@google.com>
4846
4847 * expression.cc (Expression::Expression_eval_info): Add
4848 result_alignment_pointer field.
4849 (Expression::eval_with_dot): Add result_alignment_pointer
4850 parameter. Change all callers.
4851 (Expression::eval_maybe_dot): Likewise.
4852 (class Binary_expression): Add alignment_pointer parameter to
4853 left_value and right_value. Change all callers.
4854 (BINARY_EXPRESSION): Set result alignment.
4855 (class Trinary_expression): Add alignment_pointer parameter to
4856 arg2_value and arg3_value. Change all callers.
4857 (Trinary_cond::value): Set result alignment.
4858 (Max_expression::value, Min_expression::value): Likewise.
4859 (Align_expression::value): Likewise.
4860 * script-sections.cc (class Sections_element): Add dot_alignment
4861 parameter to set_section_addresses virtual function. Update
4862 instantiations.
4863 (class Output_section_element): Likewise.
4864 (Script_sections::create_segments): Add dot_alignment parameter.
4865 Change all callers.
4866 (Script_sections::create_segments_from_phdrs_clause): Likewise.
4867 (Script_sections::set_phdrs_clause_addresses): Likewise.
4868 * script-sections.h: Update declarations.
4869 * script.h: Update declarations.
4870 * output.h (Output_segment::set_minimum_p_align): Don't decrease
4871 min_p_align.
4872 * testsuite/script_test_3.t: Set large alignment.
4873 * testsuite/script_test_3.sh: Make sure that at least one LOAD
4874 segment has expected alignment.
4875
9c9c98a5
NC
48762010-04-22 Nick Clifton <nickc@redhat.com>
4877
4878 * po/gold.pot: Updated by the Translation project.
4879 * po/vi.po: Updated Vietnamese translation.
4880
2253bfba
L
48812010-04-22 H.J. Lu <hongjiu.lu@intel.com>
4882
4883 * testsuite/Makefile.am (check_PROGRAMS): Add
4884 icf_virtual_function_folding_test.
4885 * testsuite/Makefile.in: Regenerated.
4886
85fdf906
AH
48872010-04-15 Andrew Haley <aph@redhat.com>
4888
4889 * options.h (merge_exidx_entries): New option.
4890 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
4891 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
4892 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
4893 (Target_arm::merge_exidx_entries): New function.
4894 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
4895 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
4896 to Arm_exidx_fixup constructor.
4897 Add new arg, merge_exidx_entries.
4898 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
4899 Arm_output_section::fix_exidx_coverage.
4900
ce97fa81
ST
49012010-04-18 Sriraman Tallam <tmsriram@google.com>
4902
4903 * icf.cc (get_section_contents): Check for preemptible functions.
4904 Ignore addend when appropriate.
4905 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
4906 section folded.
4907 (add_from_relobj): Check for section folded.
4908 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
4909 * symtab.h (should_add_dynsym_entry): Add new parameter.
4910 * target-reloc.h (scan_relocs): Check for section folded.
4911 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
4912 Check reloc types for function pointers in shared objects.
4913 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
4914 case.
4915 (icf_preemptible_functions_test): New test case.
4916 (icf_string_merge_test): New test case.
4917 * testsuite.Makefile.in: Regenerate.
4918 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
4919 bar_glob. Refactor code.
4920 * testsuite/icf_preemptible_functions_test.cc: New file.
4921 * testsuite/icf_preemptible_functions_test.sh: New file.
4922 * testsuite/icf_string_merge_test.cc: New file.
4923 * testsuite/icf_string_merge_test.sh: New file.
4924 * testsuite/icf_virtual_function_folding_test.cc: New file.
4925 * testsuite/icf_virtual_function_folding_test.sh: New file.
4926
04ceb17c
DK
49272010-04-14 Doug Kwan <dougkwan@google.com>
4928
4929 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
4930 for local symbol recounting if we remove a section due to ICF.
4931 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
4932 there are no regular objects in input.
4933
153e7da4
DK
49342010-04-13 Doug Kwan <dougkwan@google.com>
4935
4936 * arm.cc (Arm_input_section::set_final_data_size): Compute
4937 accurate final data size instead of using current data size.
4938
4dbd9faf
DK
49392010-04-09 Doug Kwan <dougkwan@google.com>
4940
4941 * layout.cc (Layout::choose_output_section): Handle script section
4942 types.
4943 (Layout::make_output_section_for_script): Add section type parameter.
4944 Handle script section types.
4945 * layout.h (Layout::make_output_section_for_script): Add section
4946 type parameter.
4947 * output.cc (Output_section::Output_section): Initialize data member
4948 is_noload_.
4949 (Output_section::do_reset_address_and_file_offset): Do not set address
4950 to 0 if section is a NOLOAD section.
4951 * output.h (Output_section::is_noload): New method.
4952 (Output_section::set_is_noload): Ditto.
4953 (Output_section::is_noload_): New data member.
4954 * script-c.h (Script_section_type): New enum type.
4955 (struct Parser_output_section_header): Add new file section_type.
4956 * script-sections.cc (Sections_element::output_section_name): Add
4957 parameter for returning script section type.
4958 (Output_section_definition::output_section_name): Ditto.
4959 (Output_section_definition::section_type)P; New method.
4960 (Output_section_definiton::script_section_type_name): Ditto.
4961 (Output_section_definition::script_section_type_): New data member.
4962 (Output_section_definition::Output_section_definition): Initialize
4963 data member Output_section_definition::script_section_type_.
4964 (Output_section_definition::create_sections): Pass script section type
4965 to Layout::make_output_section_for_script.
4966 (Output_section_definition::output_section_name): Return script
4967 section type to caller.
4968 (Output_section_definition::set_section_address): Do not advance
4969 dot value and load address if section type is NOLOAD. Set address
4970 of NOLOAD sections regardless of section flags.
4971 (Output_section_definition::print): Print section type if it is
4972 not SCRIPT_SECTION_TYPE_NONE.
4973 (Output_section_definition::section_type): New method.
4974 (Output_section_definition::script_section_type_name): Ditto.
4975 (Script_sections::output_section_name): Add new parameter
4976 PSECTION_TYPE for returning script section type. Pass it to
4977 section elements. Handle discard sections.
4978 (Sort_output_sections::operator()): Handle NOLOAD sections.
4979 * script-sections.h (Script_sections::Section_type): New enum type.
4980 (Script_sections::output_section_name): Add a new parameter for
4981 returning script section type.
4982 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
4983 INFO and NOLOAD.
4984 * yyscript.y (union): Add new field SECTION_TYPE.
4985 (COPY, DSECT, INFO, NOLOAD): New tokens.
4986 (opt_address_and_section_type): Change type to output_section_header.
4987 (section_type): New non-terminal
4988 (section_header): Handle section type.
2253bfba 4989 (opt_address_and_section_type): Return section type value.
4dbd9faf 4990
721ea635
L
49912010-04-09 H.J. Lu <hongjiu.lu@intel.com>
4992
4993 * testsuite/plugin_common_test_1.c (foo): Add prototype.
4994 * testsuite/plugin_common_test_2.c (foo): Likewise.
4995
6bf924b0
DK
49962010-04-08 Doug Kwan <dougkwan@google.com>
4997
4998 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
4999 Output_merge_data.
5000 * output.cc (Output_section::add_merge_input_section): Simplify
5001 code and return status of Output_merge_base::add_input_section.
e1df38aa 5002 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
5003 returns true.
5004
24af6f92
DK
50052010-04-07 Doug Kwan <dougkwan@google.com>
5006
5007 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
5008 if section is marked as containing instructions but has no mapping
5009 symbols.
5010 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
5011 correct section index.
5012 (Arm_relobj::find_linked_text_section): Ditto.
5013
00698fc5
CC
50142010-04-07 Cary Coutant <ccoutant@google.com>
5015
5016 * archive.cc (include_member): Destroy Read_symbols_data object before
5017 releasing file.
5018 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
5019 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
5020 (Read_symbols_data::~Read_symbols_data) New destructor.
5021 (Section_relocs::Section_relocs) New constructor.
5022 (Section_relocs::~Section_relocs) New destructor.
5023 (Read_relocs_data::Read_relocs_data) New constructor.
5024 (Read_relocs_data::~Read_relocs_data) New destructor.
5025 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
5026 pointers to NULL after deleting.
5027
7296d933
DK
50282010-04-07 Doug Kwan <dougkwan@google.com>
5029
5030 * arm.cc: Replace "endianity" with "endianness" in comments.
5031 (Arm_exidx_cantunwind): Ditto.
5032 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
5033 (Arm_relobj::merge_flags_and_attributes): New method.
5034 (Arm_relobj::merge_flags_and_attributes_): New data member.
5035 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
5036 (Arm_relobj::scan_sections_for_stubs): Ditto.
5037 (Arm_relobj::do_read_symbols): Check to see if we really want to
5038 merge processor-specific flags and attributes. Exit early if
5039 an object is empty except for section names and the undefined symbol.
5040 (Target_arm::do_finalize_sections): Move check for ELF format to
5041 Arm_relobj::do_read_symbols. Merge processor specific flags and
5042 attributes from a regular object only when we have determined that
5043 it is aapropriate. Do not create an .ARM.attributes section in
5044 output if there is no regular input object.
5045 (Target_arm::merge_processor_specific_flags): Check
5046 --warn-mismatch before printing any error.
5047 (Target_arm::merge_object_attributes): Ditto.
5048 * gold.cc (queue_middle_tasks): Handle the case in which there is
5049 no regular object in input.
5050 * options.cc (General_options::parse_EB): New method.
5051 (General_options::parse_EL): Same.
5052 (General_options::General_options): Initialize endianness_.
5053 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
5054 New options.
5055 (General_options::Endianness): New enum.
5056 (General_options::endianness): New method.
5057 (General_options::endianness_): New data member.
5058 * parameters.cc (Parameters::set_options): Check target endianness.
5059 (Parameters::set_target_once): Ditto.
5060 (Parameters::check_target_endianness): New method.
5061 (parameters_force_valid_target): If either -EL or -EB is specified,
5062 use it to define endianness of default target.
5063 * parameters.h (Parameters::check_target_endianness): New method
5064 declaration.
5065 * target.h (class Target): Change "endianity" to "endianness"
5066 in comments.
5067
efc8d4f2
RW
50682010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5069
5070 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
5071 * configure: Regenerate.
5072 * Makefile.in: Regenerate.
5073 * testsuite/Makefile.in: Regenerate.
5074
be234d88
CC
50752010-04-06 Cary Coutant <ccoutant@google.com>
5076
5077 gcc PR lto/42757
5078 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
5079 prevailing definitions of common symbols.
5080 * testsuite/plugin_test_6.sh: New test case.
5081 * testsuite/plugin_common_test_1.c: New test case.
5082 * testsuite/plugin_common_test_2.c: New test case.
5083 * testsuite/Makefile.am (plugin_test_6): New test case.
5084 * testsuite/Makefile.in: Regenerate.
5085
bd32c6bd
NC
50862010-04-06 Nick Clifton <nickc@redhat.com>
5087
5088 * po/vi.po: New Vietnamese translation.
5089
323c532f
DK
50902010-03-30 Doug Kwan <dougkwan@google.com>
5091
5092 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
5093
4fcd97eb
DK
50942010-03-25 Doug Kwan <dougkwan@google.com>
5095
5096 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
5097 to avoid a conversion warning on a 32-bit host.
5098
4ebf39db
ILT
50992010-03-24 Ian Lance Taylor <iant@google.com>
5100
5101 * testsuite/script_test_3.t: Add a TLS segment.
5102 * testsuite/Makefile.am (check_PROGRAMS): Add
5103 tls_phdrs_script_test.
5104 (tls_phdrs_script_test_SOURCES): Define.
5105 (tls_phdrs_script_test_DEPENDENCIES): Define.
5106 (tls_phdrs_script_test_LDFLAGS): Define.
5107 (tls_phdrs_script_test_LDADD): Define.
5108 * testsuite/Makefile.in: Rebuild.
5109
4a599bdd
CC
51102010-03-23 Cary Coutant <ccoutant@google.com>
5111
5112 * fileread.cc (find_or_make_view): Fix comment.
5113
6c93b22c
ILT
51142010-03-23 Ian Lance Taylor <iant@google.com>
5115
5116 * script-sections.cc (class Orphan_section_placement): Define
5117 PLACE_TLS and PLACE_TLS_BSS.
5118 (Orphan_section_placement::Orphan_section_placement): Initialize
5119 new places.
5120 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
5121 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
5122 (tls_script_test_SOURCES): Define.
5123 (tls_script_test_DEPENDENCIES): Define.
5124 (tls_script_test_LDFLAGS): Define.
5125 (tls_script_test_LDADD): Define.
5126 * testsuite/Makefile.in: Rebuild.
5127
a2c7281b
DK
51282010-03-22 Doug Kwan <dougkwan@google.com>
5129
5130 * arm.cc (Arm_relocate_functions::abs8,
5131 Arm_relocate_functions::abs16): Use correct check for overflow
5132 specified in the ARM ELF specs.
5133 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
5134 target of a BLX instruction specially.
5135 (Reloc_stub::stub_type_for_reloc): Ditto.
5136 (Relocate::relocate): Use symbolic names instead of numeric relocation
5137 codes to report error.
5138 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
5139 workaround.
5140 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
5141 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
5142 thumb2_blx_out_of_range.stdout
5143 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
5144 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
5145 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
5146 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
5147 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
5148 thumb2_blx_in_range, thumb2_blx_in_range.o,
5149 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
5150 thumb2_blx_out_of_range.o): New rules.
5151 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
5152 thumb2_blx_in_range and thumb2_blx_out_of_range.
5153 * testsuite/Makefile.in: Regenerate.
5154 * arm_branch_in_range.sh: Add tests for THUMB BLX.
5155 * testsuite/thumb_blx_in_range.s: New file.
5156 * testsuite/thumb_blx_out_of_range.s: New file.
5157
b0193076
RÁE
51582010-03-22 Rafael Espindola <espindola@google.com>
5159
5160 * archive.cc (Should_include): Move to archive.h.
5161 (should_include_member): Make it a member of Archive.
5162 (Lib_group): New.
5163 (Add_lib_group_symbols): New.
5164 * archive.h: Include options.h.
5165 (Archive_member): Moved from Archive.
5166 (Should_include): Moved from archive.cc.
5167 (Lib_group): New.
5168 (Add_lib_group_symbols): New.
5169 * dynobj.cc (do_should_include_member): New.
5170 * dynobj.h (do_should_include_member): New.
5171 * gold.cc (queue_initial_tasks): Update call to queue.
5172 * main.cc (main): Print lib group stats.
5173 * object.cc (do_should_include_member): New.
5174 * object.h: Include archive.h.
5175 (Object::should_include_member): New.
5176 (Object::do_should_include_member): New.
5177 (Sized_relobj::do_should_include_member): New.
5178 * options.cc (General_options::parse_start_lib): New.
5179 (General_options::parse_end_lib): New.
5180 (Input_arguments::add_file): Handle lib groups.
5181 (Input_arguments::start_group): Check we are not in a lib.
5182 (Input_arguments::start_lib): New.
5183 (Input_arguments::end_lib): New.
5184 * options.h (General_options): Add start_lib and end_lib.
5185 (Input_argument::lib_): New.
5186 (Input_argument::lib): New.
5187 (Input_argument::is_lib): New.
5188 (Input_file_lib): New.
5189 (Input_arguments::in_lib_): New.
5190 (Input_arguments::in_lib): New.
5191 (Input_arguments::start_lib): New.
5192 (Input_arguments::end_lib_): New.
5193 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
5194 in unused members as preempted.
5195 (Sized_pluginobj::do_should_include_member): New.
5196 * plugin.h (Sized_pluginobj::do_should_include_member): New.
5197 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
5198 return the blocker.
5199 (Read_symbols::do_whole_lib_group): New.
5200 (Read_symbols::do_lib_group): New.
5201 (Read_symbols::do_read_symbols): Handle lib groups.
5202 (Read_symbols::get_name): Handle lib groups.
5203 * readsyms.h (Read_symbols): Add an archive member pointer.
5204 (Read_symbols::do_whole_lib_group): New.
5205 (Read_symbols::do_lib_group): New.
5206 (Read_symbols::member_): New.
5207 * script.cc (read_input_script): Update call to queue_soon.
5208
d099120c
DK
52092010-03-19 Doug Kwan <dougkwan@google.com>
5210
5211 * arm.cc (Stub_table::Stub_table): Initialize new data members
5212 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
5213 (Stub_table::add_reloc_stub): Assign stub offset and update
5214 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
5215 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
5216 New data members.
5217 (Stub_table::update_data_size_and_addralign): Use
5218 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
5219 instead of going over all reloc stubs.
5220 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
5221 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
5222 Stringpool_template::offset_ to size of Stringpool_char.
5223 (Stringpool_template::new_key_offset): Remove code to initialize
5224 Stringpool_template::offset_.
5225 * stringpool.h (Stringpool_template::set_no_zero_null): Set
5226 Stringpool_template::offset_ to zero.
5227
1aa37384
DK
52282010-03-15 Doug Kwan <dougkwan@google.com>
5229
5230 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
5231 offset_.
5232 (Stringpool_template::new_key_offset): New method.
5233 (Stringpool_template::add_string): Assign offsets when adding new
5234 strings.
5235 (Stringpool_template::set_string_offsets): Do not set string offsets
5236 when not optimizing.
5237 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
5238 member size_.
5239 (Chunked_vector::clear): Clear size_.
5240 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
5241 (Chunked_vector::size): Return size_.
5242 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 5243 (Chunked_vector::size_): New data member.
1aa37384
DK
5244 (Stringpool_template::set_no_zero_null): Assert string set is empty.
5245 (Stringpool_template::new_key_offset): New method declaration.
5246 (Stringpool_template::offset_): New data member.
5247
b672b057
RÁE
52482010-03-15 Rafael Espindola <espindola@google.com>
5249
5250 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
5251 Add_symbols' constructor.
5252 * readsyms.h (Add_symbols): Remove the input_group member.
5253
b6848d3c
ILT
52542010-03-10 Ian Lance Taylor <iant@google.com>
5255
5256 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
5257 target to ask whether a reference to a symbol requires a stack
5258 split.
5259 * target.h (Target::is_call_to_non_split): New function.
5260 (Target::do_is_call_to_non_split): Declare virtual function.
5261 * target.cc: Include "symtab.h".
5262 (Target::do_is_call_to_non_split): New function.
5263 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
5264
a2a5469e
CC
52652010-03-10 Cary Coutant <ccoutant@google.com>
5266
5267 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
5268 (File_read::open[1]): Remove initial mapping of whole_file_view_.
5269 (File_read::open[2]): Add whole_file_view_ to list of views.
5270 (File_read::make_view): Remove test of whole_file_view_.
5271 (File_read::find_or_make_view): Create whole_file_view_ if
5272 necessary.
5273 (File_read::clear_views): Replace bool parameter with enum;
5274 adjust all callers. Don't delete views with permanent data;
5275 do delete cached views and views from archives if
5276 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
5277 if clearing the corresponding view.
5278 * fileread.h (File_read::Clear_views_mode): New enum.
5279 (File_read::View::is_permanent_view): New method.
5280 (File_read::clear_views): Replace bool parameter
5281 with enum; adjust all callers.
5282 * options.h (General_options): Change keep_files_mapped option;
5283 add map_whole_files.
5284 * readsyms.cc (Add_symbols::run): Delete sd_ object before
5285 releasing the file.
5286 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
5287 the file.
5288
8861f32b
DM
52892010-03-10 David S. Miller <davem@davemloft.net>
5290
5291 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
5292
d62d0f5f
ST
52932010-03-09 Sriraman Tallam <tmsriram@google.com>
5294
5295 * icf.cc (get_section_contents): Add '@' marker after processing the
5296 merge reloc.
5297
9177756d
DK
52982010-03-08 Doug Kwan <dougkwan@google.com>
5299
5300 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
5301 due to a conversion warning.
5302 (Arm_relobj::update_output_local_symbol_count): Check for local
5303 symbol with unset output index.
5304
9e9e071b
ILT
53052010-03-05 Ian Lance Taylor <iant@google.com>
5306
5307 * options.h (class General_options): Add --spare-dynamic-tags.
5308 * output.cc (Output_data_dynamic::set_final_data_size): Implement
5309 --spare-dynamic-tags.
5310
a81ee015
ILT
53112010-03-05 Ian Lance Taylor <iant@google.com>
5312
5313 * incremental.cc: Include "libiberty.h".
5314
44ec90b9
RO
53152010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
5316
5317 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
5318 function, is_info_ member.
5319 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
5320 (Versions::Versions): Update caller.
5321 (Versions::define_base_version): Likewise.
5322 (Versions::add_def): Likewise.
5323
0897ed3b
ST
53242010-03-03 Sriraman Tallam <tmsriram@google.com>
5325
5326 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
5327 (Scan::possible_function_pointer_reloc): New function.
5328 (Scan::local_reloc_may_be_function_pointer): Change to call
5329 possible_function_pointer_reloc.
5330 (Scan::global_reloc_may_be_function_pointer): Ditto.
5331 * icf.h (Icf::check_section_for_function_pointers): Change to reject
5332 relocations in ".data.rel.ro._ZTV" section.
5333 * testsuite/icf_safe_so_test.sh: Change to pass i386.
5334 * testsuite/icf_safe_so_test.cc: Ditto.
5335 * testsuite/icf_safe_test.cc: Ditto.
5336 * testsuite/icf_safe_test.sh: Ditto.
5337
d3bbad62
ILT
53382010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5339 Ian Lance Taylor <iant@google.com>
5340
5341 * target-reloc.h (relocate_section): Check the symbol table index
5342 for -1U before setting the local symbol index.
5343 (scan_relocatable_relocs): If copying the relocation, record that
5344 the local symbol is required.
5345 * object.h (Symbol_value::is_output_symtab_index_set): New
5346 function.
5347 (Symbol_value::may_be_discarded_from_output_symtab): New
5348 function.
5349 (Symbol_value::has_output_symtab_entry): New function.
5350 (Symbol_value::needs_output_symtab_entry): Remove.
5351 (Symbol_value::output_symtab_index): Make sure the symbol index is
5352 set.
5353 (Symbol_value::set_output_symtab_index): Make sure the symbol
5354 index is not set. Make sure the new index is valid.
5355 (Symbol_value::set_must_have_output_symtab_entry): New function.
5356 (Symbol_value::has_output_dynsym_entry): New function.
5357 (Symbol_value::set_output_dynsym_index): Make sure the new index
5358 is valid.
5359 (Sized_relobj::set_must_have_output_symtab_entry): New function.
5360 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
5361 local symbol if permitted.
5362 (Sized_relobj::do_finalize_local_symbols): Call
5363 is_output_symtab_index_set rather than needs_output_symtab_entry.
5364 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
5365 rather than needs_output_symtab_entry. Call
5366 has_output_dynsym_entry rather than needs_output_dynsym_entry.
5367 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
5368 is_output_symtab_index_set rather than needs_output_symtab_entry.
5369 * testsuite/discard_locals_relocatable_test.c: New file.
5370 * testsuite/discard_locals_test.sh: Test -r.
5371 * testsuite/Makefile.am (check_DATA): Add
5372 discard_locals_relocatable_test1.syms,
5373 discard_local_relocatable_test2.syms.
5374 (MOSTLYCLEANFILES): Likewise. Also add
5375 discard_locals_relocatable_test1.lout and
5376 discard_locals_relocatable_test2.out.
5377 (discard_locals_relocatable_test1.syms): New target.
5378 (discard_locals_relocatable_test.o): New target.
5379 (discard_locals_relocatable_test1.out): New target.
5380 (discard_locals_relocatable_test2.syms): New target.
5381 (discard_locals_relocatable_test2.out): New target.
5382 (various): Add missing ../ld-new dependencies.
5383 * testsuite/Makefile.in: Rebuild.
5384
7e8ccf26
NC
53852010-03-03 Nick Clifton <nickc@redhat.com>
5386
5387 * po/fi.po: New Finnish translation.
5388
2a0ff005
DK
53892010-03-01 Doug Kwan <dougkwan@google.com>
5390
5391 * layout.cc (Layout::Layout): Force section types of .init_array*,
5392 .preinit_array* and .fini_array* sections.
5393 * output.cc (Output_section::Input_section_sort_entry::has_priority):
5394 Fix check of return value of std::string::find.().
5395 (Output_section::Input_section_sort_compare::operator()): Remove
5396 comment about .init_array.
5397 (Output_section::Input_section_sort_init_fini_compare::operator()):
5398 New method.
5399 (Output_section::sort_attached_input_sections): Handle .init_array
5400 and .fini_array specially.
5401 * output.h (Output_section::Inut_section_sort_compare): Update
5402 comment.
5403 (Output_section::Input_section_sort_init_fini_compare): New struct.
5404
c3e4ae29
DK
54052010-02-26 Doug Kwan <dougkwan@google.com>
5406
5407 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
5408 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
5409 * testsuite/debug_msg.sh: Avoid matching source line number for
5410 use of global variable undef_int.
5411
2fd9ae7a
DK
54122010-02-26 Doug Kwan <dougkwan@google.com>
5413
5414 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
5415 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
5416 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
5417 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
5418 * options.cc (General_options::General_options): Initialize member
5419 fix_v4bx_.
5420 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
5421 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
5422 and rm_no_fix_v4bx.stdout
5423 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
5424 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
5425 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
5426 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
5427 and arm_no_fix_v4bx.
5428 * Makefile.in: Regenerate.
5429 * testsuite/arm_fix_v4bx.s: New file.
5430 * testsuite/arm_fix_v4bx.sh: Ditto.
5431
67ec7d0b
DK
54322010-02-24 Doug Kwan <dougkwan@google.com>
5433
5434 * arm.cc (Target_arm::got_section): Make the .got section the first
5435 non RELRO section in the data segment.
5436 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
5437 suffixes of section names.
5438
10165461
DK
54392010-02-24 Doug Kwan <dougkwan@google.com>
5440
5441 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
5442 flags and attributes merging if an input file is a binary file.
5443 * fileread.cc (Input_file::open): Record format of original file.
5444 * fileread.h (Input_file::Format): New enum type.
5445 (Input_file::Input_file): Initialize data member format_.
5446 (Input_file::format): New method definition.
5447 (Input_file::format_):: New data member.
5448
4a54abbb
DK
54492010-02-24 Doug Kwan <dougkwan@google.com>
5450
5451 * arm.cc (Arm_output_data_got): New class.
5452 (ARM_TCB_SIZE): New constant
5453 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
5454 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
5455 If user uses a script with a SECTIONS clause, issue only a warning
5456 for a misplaced EXIDX input section. Otherwise, issue an error.
5457 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
5458 garbage collection.
5459 (Target_arm::got_mode_index_entry): Handle static linking.
5460 (Target_arm::Scan::local): Ditto.
5461 (Target_arm::Scan::global): Ditto.
5462 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
5463 all incorrectly implemented relocations.
e1df38aa 5464 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
5465 Arm_output_section::fix_exidx_coverage.
5466 * layout.cc (Layout::section_name_mapping): Remove trailing dots
5467 from ".ARM.exidx." and ".ARM.extab.".
5468
ca419a6f
ILT
54692010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5470
5471 * arm.cc (Target_arm::do_finalize_sections): Create attribute
5472 section if it does not already exist.
5473 * attributes.cc (Attributes_section_data::Attributes_section_data):
5474 Don't crash if size is zero.
5475
135b9c78
ILT
54762010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5477 Ian Lance Taylor <iant@google.com>
5478
5479 * gold.cc (queue_middle_tasks): If no input files were opened,
5480 exit.
5481 * workqueue.h (Task_function::Task_function): Assert that there is
5482 a blocker.
5483
bb0bfe4f
DK
54842010-02-22 Doug Kwan <dougkwan@google.com>
5485
5486 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
5487 * icf.cc (get_section_contents): Cast snprintf arguments to long long
5488 types to avoid warnings due to different uint64_t implementations
5489 on different hosts.
5490
2a2b6d42
DK
54912010-02-21 Doug Kwan <dougkwan@google.com>
5492
5493 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
5494 handling of the maximum backward branch offset.
5495 (Arm_relocate_functions::thumb_branch_common): Ditto.
5496 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
5497 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 5498 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
5499 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
5500 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
5501 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
5502 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
5503 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
5504 thumb_bl_out_of_range thumb_bl_out_of_range.o,
5505 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
5506 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
5507 thumb2_bl_out_of_range.o): New rules.
5508 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
5509 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
5510 thumb2_bl_out_of_range
5511 * testsuite/Makefile.in: Regenerate.
5512 * testsuite/arm_bl_in_range.s: New file.
5513 * testsuite/arm_bl_out_of_range.s: Ditto.
5514 * testsuite/arm_branch_in_range.sh: Ditto.
5515 * testsuite/arm_branch_range.t: Ditto.
5516 * testsuite/thumb2_branch_range.t: Ditto.
5517 * testsuite/thumb_bl_in_range.s: Ditto.
5518 * testsuite/thumb_bl_out_of_range.s: Ditto.
5519 * testsuite/thumb_branch_range.t: Ditto.
5520
b487ad64
ST
55212010-02-20 Sriraman Tallam <tmsriram@google.com>
5522
5523 * gc.h (gc_process_relocs): Change vectors to point to the new list.
5524 Add reloc offset information.
5525 * icf.cc (get_section_contents): Change iterators to point to the new
5526 vectors. Add reloc offset information to the contents.
5527 * icf.h (Icf::Sections_reachable_info): New typedef.
5528 (Icf::Sections_reachable_list): New typedef.
5529 (Icf::Offset_info): New typedef.
5530 (Icf::Reloc_info): New struct typedef.
5531 (Icf::Reloc_info_list): New typedef.
5532 (Icf::symbol_reloc_list): Delete method.
5533 (Icf::addend_reloc_list): Delete method.
5534 (Icf::section_reloc_list): Delete method.
5535 (Icf::reloc_info_list): New method.
5536 (Icf::reloc_info_list_): New member.
5537
f96accdf
DK
55382010-02-19 Doug Kwan <dougkwan@google.com>
5539
5540 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
5541 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
5542 * arm.cc (Arm_relocation_functions): New forward declaration.
5543 (Target_arm::Target_arm): Initialize new data members
5544 got_mod_index_offset_ and tls_base_symbol_defined_.
5545 (Target_arm::Relocate::relocate_tls): New method.
5546 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
5547 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
5548 New methods.
5549 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
5550 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
5551 (Target_arm::got_mod_index_offset_,
5552 Target_arm::tls_base_symbol_defined_): New data members.
5553 (Target_arm::Scan::local, Target::Scan::global,
5554 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
5555 relocations.
5556
c8761b9a
DK
55572010-02-18 Doug Kwan <dougkwan@google.com>
5558
5559 * arm.cc (Arm_relobj::find_linked_text_section): New method.
5560 (Arm_relobj::make_exidx_input_section): Pass section index of linked
5561 text section as a parameter becuase some broken tools may not set
5562 the link in section header.
5563 (Target_arm::has_got_section): New method.
5564 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
5565 without any mapping symbol as data only. Remove warning.
5566 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
5567 link in its section header, try to discover the link by inspecting the
5568 REL31 relocation at the beginning of the section.
5569 (Target_arm::Scan::check_non_pic): Report name of offending relocation
5570 in error message.
5571 (Target_arm::Scan::global): Treat any reference to the symbol
5572 _GLOBAL_OFFSET_TABLE_ as a GOT access.
5573
21bb3914
ST
55742010-02-12 Sriraman Tallam <tmsriram@google.com>
5575
5576 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
5577 (Scan::global_reloc_may_be_function_pointer): New function.
5578 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
5579 (Scan::global_reloc_may_be_function_pointer): New function.
5580 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
5581 (Scan::global_reloc_may_be_function_pointer): New function.
5582 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
5583 (Scan::global_reloc_may_be_function_pointer): New function.
5584 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
5585 (Scan::global_reloc_may_be_function_pointer): New function.
5586 (Scan::possible_function_pointer_reloc): New function.
5587 (Target_x86_64::can_check_for_function_pointers): New function.
5588 * gc.h (gc_process_relocs): Scan relocation types to determine if
5589 function pointers were taken for targets that support it.
5590 * icf.cc (Icf::find_identical_sections): Include functions for
5591 folding in safe ICF whose pointer is not taken.
5592 * icf.h (Secn_fptr_taken_set): New typedef.
5593 (fptr_section_id_): New member.
5594 (section_has_function_pointers): New function.
5595 (set_section_has_function_pointers): New function.
5596 (check_section_for_function_pointers): New function.
5597 * options.h: Fix comment for safe ICF option.
5598 * target.h (can_check_for_function_pointers): New function.
5599 * testsuite/Makefile.am: Add icf_safe_so_test test case.
5600 Modify icf_safe_test for X86-64.
5601 * testsuite/Makefile.in: Regenerate.
5602 * testsuite/icf_safe_so_test.cc: New file.
5603 * testsuite/icf_safe_so_test.sh: New file.
5604 * testsuite/icf_safe_test.cc (kept_func_3): New function.
5605 (main): Change to take pointer to function kept_func_3.
5606 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
5607 folding is done correctly for X86-64.
5608
0da6fa6c
DM
56092010-02-12 David S. Miller <davem@davemloft.net>
5610
5611 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
5612 is_symbolless parameter.
5613 (Output_reloc<SHT_REL>::is_symbolless): New.
5614 (Output_reloc<SHT_REL>::is_symbolless_): New.
5615 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
5616 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
5617 (Output_reloc<SHT_RELA>::is_symbolless): New.
5618 (Output_data_reloc::add_global): Handle is_symbolless.
5619 (Output_data_reloc::add_global_relative): Likewise.
5620 (Output_data_reloc::add_local): Likewise.
5621 (Output_data_reloc::add_local_relative): Likewise.
5622 (Output_data_reloc::add_symbolless_global_addend): New.
5623 (Output_data_reloc::add_symbolless_local_addend): New.
5624 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
5625 is_symbolless.
5626 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
5627 instead of ->is_relative_
5628 (Output_reloc::write): Likewise.
5629 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
5630 (Output_reloc::write_rel): Simplify.
5631
5632 * sparc.cc (Target_sparc::Scan::local): Use
5633 ->add_symbolless_local_addend as needed.
5634 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
5635 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
5636 based upon relocation offset.
5637
e4782e83
DK
56382010-02-11 Doug Kwan <dougkwan@google.com>
5639
5640 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
5641 (Target_arm::Scan::global): Ditto. Also remove a comment before the
5642 beginning of function.
5643 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
5644 and MOVT_ABS relocations. Those are non issued in scanning. Fix
5645 parameter is_32bit in calls to should_apply_static_reloc.
5646 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
5647 (check_DATA): Add arm_abs_global.stdout.
5648 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
5649 arm_abs_global.stdout): New rules.
5650 (MOSTLLYCLEANFILES): Add arm_abs_global
5651 * Makefile.in: Regenerate.
5652 * testsuite/arm_abs_global.s: New file.
5653 * testsuite/arm_abs_global.sh: Ditto.
5654 * testsuite/arm_abs_lib.s: Ditto.
5655
93ceb764
ILT
56562010-02-11 Ian Lance Taylor <iant@google.com>
5657
5658 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
5659 Read_relocs task.
5660 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
5661 Allocate_commons_task first.
5662 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
5663 task, rather than symtab_lock_.
5664 (Gc_process_relocs::~Gc_process_relocs): New function.
5665 (Gc_process_relocs::is_runnable): Check this_blocker_.
5666 (Gc_process_relocs::locks): Use next_blocker_ rather than
5667 blocker_.
5668 (Scan_relocs::~Scan_relocs): New function.
5669 (Scan_relocs::is_runnable): Check this_blocker_ rather than
5670 symtab_lock_.
5671 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
5672 next_blocker_.
5673 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
5674 fields. Add this_blocker_ and next_blocker_ fields. Adjust
5675 constructor accordingly.
5676 (class Gc_process_relocs): Likewise.
5677 (class Scan_relocs): Likewise.
5678 * common.h (class Allocate_commons_task): Remove symtab_lock_
5679 field, and corresponding constructor parameter.
5680 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
5681 symtab_lock_.
5682 (Allocate_commons_task::locks): Likewise.
5683
114dfbe1
ILT
56842010-02-11 Ian Lance Taylor <iant@google.com>
5685
5686 * gold-threads.h (class Once): Define.
5687 (class Initialize_lock): Rewrite as child of Once.
5688 * gold-threads.cc (class Once_initialize): Define.
5689 (once_pointer_control): New static variable.
5690 (once_pointer, once_arg): New static variables.
5691 (c_run_once): New static function.
5692 (Once::Once, Once::run_once, Once::internal_run): New functions.
5693 (class Initialize_lock_once): Remove.
5694 (initialize_lock_control): Remove.
5695 (initialize_lock_pointer): Remove.
5696 (initialize_lock_once): Remove.
5697 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
5698 (Initialize_lock::initialize): Rewrite.
5699 (Initialize_lock::do_run_once): New function.
5700 * archive.cc (Archive::interpret_header): Only clear name if it is
5701 not already empty.
5702 * fileread.cc: Include "gold-threads.h"
5703 (file_counts_lock): New static variable.
5704 (file_counts_initialize_lock): Likewise.
5705 (File_read::release): Only increment counts when using --stats.
5706 Use a lock around the increment.
5707 * parameters.cc (class Set_parameters_target_once): Define.
5708 (set_parameters_target_once): New static variable.
5709 (Parameters::Parameters): Move here from parameters.h.
5710 (Parameters::set_target): Rewrite.
5711 (Parameters::set_target_once): New function.
5712 (Parameters::clear_target): Move here and rewrite.
5713 * parameters.h (class Parameters): Update declarations. Add
5714 set_parameters_target_once_ field.
5715 (Parameters::Parameters): Move to parameters.cc.
5716 (Parameters::clear_target): Likewise.
5717 * readsyms.cc (Read_symbols::do_group): Create a Start_group
5718 task.
5719 (Start_group::~Start_group): New function.
5720 (Start_group::is_runnable): New function.
5721 (Start_group::locks, Start_group::run): New functions.
5722 (Finish_group::run): Change saw_undefined to size_t.
5723 * readsyms.h (class Start_group): Define.
5724 (class Finish_group): Change saw_undefined_ field to size_t.
5725 (Finish_group::Finish_group): Remove saw_undefined and
5726 this_blocker parameters. Change all callers.
5727 (Finish_group::set_saw_undefined): New function.
5728 (Finish_group::set_blocker): New function.
5729 * symtab.h (class Symbol_table): Change saw_undefined to return
5730 size_t. Change saw_undefined_ field to size_t.
5731 * target-select.cc (Set_target_once::do_run_once): New function.
5732 (Target_selector::Target_selector): Initialize set_target_once_
5733 field. Don't initialize lock_ and initialize_lock_ fields.
5734 (Target_selector::instantiate_target): Rewrite.
5735 (Target_selector::set_target): New function.
5736 * target-select.h (class Set_target_once): Define.
5737 (class Target_selector): Update declarations. Make
5738 Set_target_once a friend. Remove lock_ and initialize_lock_
5739 fields. Add set_target_once_ field.
5740
fa17a3f4
ILT
57412010-02-10 Ian Lance Taylor <iant@google.com>
5742
5743 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
5744 queueing any tasks.
5745 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
5746 (queue_middle_tasks): Add all blockers before queueing any tasks.
5747 (queue_final_tasks): Likewise.
5748 * token.h (Task_token::add_blockers): New function.
5749 * object.h (Input_objects::number_of_relobjs): New function.
5750
c7177d31
ILT
57512010-02-10 Ian Lance Taylor <iant@google.com>
5752
5de0e392
ILT
5753 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
5754 shared, not if not position independent.
5755 * x86_64.cc (Relocate::relocate_tls): Likewise.
5756 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
5757 (tls_pie_pic_test): New target.
5758 * testsuite/Makefile.in: Rebuild.
5759
c7177d31
ILT
5760 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
5761 (tls_test_main_pie.o, tls_test_pie.o): New targets.
5762 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
5763 * testsuite/Makefile.in: Rebuild.
5764
684b268a
DM
57652010-02-09 David S. Miller <davem@davemloft.net>
5766
5767 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
5768 R_SPARC_RELATIVE using ->add_local_relative().
5769 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
5770
612a8d3d
DM
5771 * output.h (Output_data_dynamic::add_section_size): New method
5772 that takes two Output_data objects.
5773 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
5774 entry param. Handle it in initializers.
5775 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
5776 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
5777 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
5778 arg.
5779 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
5780 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
5781 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
5782 for dynrel_includes_plt.
5783 * i386.cc (Target_i386::do_finalize_sections): Likewise.
5784 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5785 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
5786 before .rela.plt
5787 (Target_sparc::do_finalize_sections): Update to pass true for
5788 dynrel_includes_plt.
5789 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
5790 output before .rela.plt
5791 (Target_powerpc::do_finalize_sections): Update to pass true for
5792 dynrel_includes_plt when 32-bit.
5793
cb1be87e
DK
57942010-02-08 Doug Kwan <dougkwan@google.com>
5795
5796 * arm.cc (Arm_relobj::simple_input_section_output_address): New
5797 method.
5798 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
5799 Arm_relobj::scan_section_for_cortex_a8_stubs,
5800 Arm_relobj::do_relocation_section): Instead of calling
5801 Output_section::output_address, use faster
5802 Arm_relobj::simple_input_section_output_address.
5803
705b5121
DM
58042010-02-08 David S. Miller <davem@davemloft.net>
5805
5806 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
5807 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
5808 relocation helper function.
5809
024c4466
DM
5810 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
5811 just like R_SPARC_GOT{10,13,22}.
5812 (Target_sparc::Scan::local): Likewise.
5813 (Target_sparc::Relocate:relocate): Likewise.
5814
9109c078
ILT
58152010-02-06 Ian Lance Taylor <iant@google.com>
5816
5817 * configure.ac: Rewrite targetobjs duplicate removal code to use
5818 only shell constructs.
5819 * configure: Rebuild.
5820
cf846138
DK
58212010-02-05 Doug Kwan <dougkwan@google.com>
5822
5823 PR 11247
5824 * arm.cc (Arm_relobj::section_is_scannable): New method.
5825 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
5826 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
5827
6cfaf60b
DK
58282010-02-04 Doug Kwan <dougkwan@google.com>
5829
5830 PR 11247
5831 * arm-reloc-property.cc (cstdio): Include.
5832 * configure.ac (targetobjs): Remove duplicates.
5833 * configure: Regenerate.
5834 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
5835 big and little endian version for a given address size.
5836
5c57f1be
DK
58372010-02-03 Doug Kwan <dougkwan@google.com>
5838
5839 * arm-reloc-property.cc
5840 (Arm_reloc_property_table::reloc_name_in_error_message): New method
5841 definition.
5842 * arm-reloc-property.h
5843 (Arm_reloc_property_table::get_implemented_static_reloc_property):
5844 New method definition.
5845 (Arm_reloc_property_table::reloc_name_in_error_message): New method
5846 declaration.
5847 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
5848 overflow to N.
5849 (GOT_PREL): Change implemented to Y.
5850 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
5851 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
5852 (Arm_relocate_functions::movw_abs_nc): Remove method.
5853 (Arm_relocate_functions::movt_abs): Ditto.
5854 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
5855 (Arm_relocate_functions::thm_movt_abs): Ditto.
5856 (Arm_relocate_functions::movw_rel_nc): Ditto.
5857 (Arm_relocate_functions::movw_rel): Ditto.
5858 (Arm_relocate_functions::movt_rel): Ditto.
5859 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
5860 (Arm_relocate_functions:thm_movw_rel): Ditto.
5861 (Arm_relocate_functions:thm_movt_rel): Ditto.
5862 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
5863 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
5864 New method definitions.
5865 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
5866 (Arm_relocation_functions::arm_grp_ldr): Ditto.
5867 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
5868 (Arm_relocation_functions::arm_grp_ldc): Ditto.
5869 (Target_arm::Relocate::relocate): Check for non-static or
5870 unimplemented relocation code and exit early. Change calls to
5871 Target_arm::reloc_uses_thumb_bit and
5872 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
5873 instead. Refactor code to handle similar relocations to increase
5874 code sharing. Remove check for unsupported relocation code in switch
5875 statement.
5876 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
5877 relocation property table to find out size. Change error message to
5878 print out the name of a relocation code instead of the numeric value.
5879 (Target_arm::scan_reloc_for_stub): Use relocation property table
5880 instead of calling Target_arm::reloc_uses_thumb_bit().
5881
218c5831
DK
58822010-02-02 Doug Kwan <dougkwan@google.com>
5883
5884 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
5885 types of relaxed input section.
5886
0d31c79d
DK
58872010-02-02 Doug Kwan <dougkwan@google.com>
5888
5889 * Makefile.am (HFILES): Add arm-reloc-property.h.
5890 (DEFFILES): New.
5891 (TARGETSOURCES): Add arm-reloc-property.cc
5892 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
5893 (libgold_a_SOURCES): $(DEFFILES)
5894 * Makefile.in: Regenerate.
5895 * arm-reloc-property.cc: New file.
5896 * arm-reloc-property.h: New file.
5897 * arm-reloc.def: New file.
5898 * arm.cc: Update comments.
5899 (arm-reloc-property.h): New included header.
5900 (arm_reloc_property_table): New global variable.
5901 (Target_arm::do_select_as_default_target): New method definition.
5902 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
5903 arm-reloc-property to targ_extra_obj.
5904 * parameters.cc (set_parameters_target): Call
5905 Target::select_as_default_target().
5906 * target.h (Target::select_as_default_target): New method definition.
5907 (Target::do_select_as_default_target): Same.
5908
546c7457
DK
59092010-02-01 Doug Kwan <dougkwan@google.com>
5910
5911 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
5912 first_output_text_section_.
5913 (Arm_exidx_fixup::first_output_text_section): New method definition.
5914 (Arm_exidx_fixup::first_output_text_section_): New data member.
5915 (Arm_exidx_fixup::process_exidx_section): Record the first text
5916 output section seen.
5917 (Arm_output_section::fix_exidx_coverage): Set correct linked section
5918 and entsize in output section header.
5919
11b861d5
DK
59202010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5921
5922 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
5923 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
5924 (Arm_relocate_functions::thm_alu11): New Method.
5925 (Arm_relocate_functions::thm_pc8): New Method.
5926 (Arm_relocate_functions::thm_pc12): New Method.
5927 (Target_arm::Scan::local): Handle the relocations.
5928 (Target_arm::Scan::global): Likewise.
5929 (Target_arm::Relocate::relocate): Likewise.
5930 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
5931
c9a2c125
DK
59322010-01-29 Doug Kwan <dougkwan@google.com>
5933
5934 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
5935 of relocation types as ld.
5936
1521477a
DK
59372010-01-29 Doug Kwan <dougkwan@google.com>
5938
5939 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
5940 to public.
5941 (Arm_relocate_functions::thumb_branch_common): Ditto.
5942 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
5943 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
5944 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
5945 Arm_relocate_functions::jump24): Remove.
5946 (Target_arm::Relocate::relocate): Adjust code to call
5947 Arm_relocation_functions::arm_branch_common and
5948 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 5949 wrappers. Merge switch-cases together to reduce source code size.
1521477a 5950
e7eca48c
DK
59512010-01-29 Doug Kwan <dougkwan@google.com>
5952
5953 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
5954 output_local_symbol_count_needs_update_.
5955 (Arm_relobj::output_local_symbol_count_needs_update,
5956 Arm_relobj::set_output_local_symbol_count_needs_update,
5957 Arm_relobj::update_output_local_symbol_count): New methods.
5958 (Arm_relobj::output_local_symbol_count_needs_update_): New data
5959 member.
5960 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
5961 of pointed function as in a R_ARM_PREL31 relocation.
5962 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
5963 for output local symbol count updating.
5964 (Target_arm::do_relax): Update output local symbol counts in objects
5965 if necessary.
5966 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
5967
02961d7e
ILT
59682010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5969
5970 * arm.cc: Added support for the ARM relocations:
5971 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
5972 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
5973 (Arm_relocate_functions::movw_rel_nc): Renamed (was
5974 movw_prel_nc).
5975 (Arm_relocate_functions::movw_rel): New method.
5976 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
5977 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
5978 thm_movw_prel_nc).
5979 (Arm_relocate_functions::thm_movw_rel): New method.
5980 (Arm_relocate_functions::thm_movt_rel): Renamed (was
5981 thm_movt_prel).
5982 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
5983 relocations.
5984 (Target_arm::Scan::global): Likewise.
5985 (Target_arm::Relocate::relocate): Likewise.
5986 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5987 Likewise.
5988
b10d2873
ILT
59892010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5990
5991 * arm.cc: Added support for ARM group relocations.
5992 (Target_arm::reloc_needs_sym_origin): New method.
5993 (Arm_relocate_functions::calc_grp_kn): New method.
5994 (Arm_relocate_functions::calc_grp_residual): New method.
5995 (Arm_relocate_functions::calc_grp_gn): New method.
5996 (Arm_relocate_functions::arm_grp_alu): New Method.
5997 (Arm_relocate_functions::arm_grp_ldr): New Method.
5998 (Arm_relocate_functions::arm_grp_ldrs): New Method.
5999 (Arm_relocate_functions::arm_grp_ldc): New Method.
6000 (Target_arm::Scan::local): Handle the ARM group relocations.
6001 (Target_arm::Scan::global): Likewise.
6002 (Target_arm::Relocate::relocate): Likewise.
6003 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6004 Likewise.
6005
2b328d4e
DK
60062010-01-26 Doug Kwan <dougkwan@google.com>
6007
6008 * arm.cc (set): Include.
6009 (class Arm_exidx_fixup): Change type of last_input_section_ to const
6010 pointer type.
6011 (Arm_output_section::Text_section_list): New type.
6012 (Arm_output_section::append_text_sections_to_list): New method.
6013 (Arm_output_section::fix_exidx_coverage): Ditto.
6014 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
6015 (Arm_relobj::convert_input_section_to_relaxed_section): Use
6016 Relobj::set_section_offset() instead of
6017 Sized_relobj::invalidate_section_offset().
6018 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
6019 parameter for section headers. Ignore relocation sections for
6020 unallocated sections and EXIDX sections.
6021 (Target_arm::fix_exidx_coverage): New method.
6022 (Target_arm::output_section_address_less_than): New type.
6023 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
6024 linked text section instead of the EXIDX section.
6025 (Arm_output_section::create_stub_group): Add an assertion to check
6026 that this is not an EXIDX output section.
6027 (Arm_output_section::append_text_sections_to_list): New method.
6028 (Arm_output_section::fix_exidx_coverage): Ditto.
6029 (Arm_relobj::scan_sections_for_stubs): Adjust call to
6030 Arm_relobj::section_needs_reloc_stub_scanning.
6031 (Target_arm::do_relax): Fix EXIDX output section coverage in the
6032 first pass.
6033 (Target_arm::fix_exidx_coverage): New method.
6034 * object.h (Relobj::set_output_section): New method.
6035 (Sized_relobj::invalidate_section_offset): Remove method.
6036 (Sized_relobj::do_invalidate_section_offset): Remove method.
6037 (Sized_relobj::do_set_section_offset): Handle offset value -1.
6038
c7f3c371
DK
60392010-01-25 Doug Kwan <dougkwan@google.com>
6040
6041 * arm.cc (Arm_exidx_merged_section::do_output_offset):
6042 Fix warning due to signed and unsigned comparison on a 32-bit host.
6043
8923b24c
DK
60442010-01-22 Doug Kwan <dougkwan@google.com>
6045
6046 * arm.cc (Target_arm::do_relax): Record an output section for section
6047 offset adjustment it contains any stub table that has changed.
6048 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
6049 offsets in an output section if necessary.
6050 * output.cc (Output_section::Output_section): Initialize
6051 section_offsets_need_adjustments_.
6052 (Output_section::add_input_section_for_script): Renamed to
6053 Output_section::add_simple_input_section.
6054 (Output_section::save_states): Add a comment.
6055 (Output_section::discard_states): New method defintion.
6056 (Output_section::adjust_section_offsets): Same.
6057 * output.h (Output_section::add_input_section_for_script): Renamed to
6058 Output_section::add_simple_input_section.
6059 (Output_section::discard_states): New method declaration.
6060 (Output_section::adjust_section_offsets): Same.
6061 (Output_section::section_offsets_need_adjustment,
6062 Output_section::set_section_offsets_need_adjustment): New method
6063 definitions.
6064 (Output_section::section_offsets_need_adjustment_): New data member.
6065 * script-sections.cc
6066 (Output_section_element_input::set_section_address): Adjust code for
6067 renaming of Output_section::add_input_section_for_script.
6068 (Orphan_output_section::set_section_address): Same.
6069
9b2fd367
DK
60702010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6071
6072 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
6073 Fix_v4bx enum values .
6074 * gold/options.h (General_options): New option definitions.
6075 (General_options::fix_v4bx): New method.
6076 (General_options::Fix_v4bx): New enum.
6077 * gold/options.cc (General_options::parse_fix_v4bx): New method.
6078 (General_options::parse_fix_v4bx_interworking): New method.
6079
80d0d023
DK
60802010-01-22 Doug Kwan <dougkwan@google.com>
6081
6082 * arm.cc (Arm_exidx_fixup): New class.
6083
af2cdeae
DK
60842010-01-21 Doug Kwan <dougkwan@google.com>
6085
6086 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
6087 classes.
6088 (Arm_exidx_section_offset_map): New type.
6089
993d07c1
DK
60902010-01-21 Doug Kwan <dougkwan@google.com>
6091
6092 * arm.cc (Arm_exidx_input_section): New class.
6093 (Arm_relobj::exidx_input_section_by_link,
6094 Arm_relobj::exidx_input_section_by_shndx,
6095 Arm_relobj::make_exidx_input_section): New methods.
6096 (read_arm_attributes_section): Remove.
6097 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
6098 information about them.
6099 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
6100 to here.
6101
5ac169d4
DK
61022010-01-20 Doug Kwan <dougkwan@google.com>
6103
6104 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
6105 Input_section_specifier to Section_id.
6106 (Target_arm::new_arm_input_section: Adjust code for change of key
6107 type.
6108 (Target_arm::find_arm_input_section): Ditto.
6109 * gc.h (object.h): Include for Section_id nand Section_id_hash.
6110 (Section_id): Remove.
6111 (Garbage_collection::Section_id_hash): Remove.
6112 * icf.h (object.h): Include for Section_id nand Section_id_hash.
6113 (Section_id): Remove.
6114 (Icf::Section_id_hash): Remove.
6115 * object.h (Section_id, Const_section_id, Section_id_hash,
6116 Const_section_id_hash): New type definitions.
6117 * output.cc (Output_section::add_relaxed_input_section): Change to
6118 use Const_section_id instead of Input_section_specifier as key type.
6119 (Output_section::add_merge_input_section): Ditto.
6120 (Output_section::build_relaxation_map): Change to use Section_id
6121 instead of Input_section_specifier as key type.
6122 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6123 Ditto.
6124 (Output_section::convert_input_sections_to_relaxed_sections): Change
6125 to use Const_section_id instead of Input_section_specifier as key type.
6126 (Output_section::find_merge_section): Ditto.
6127 (Output_section::find_relaxed_input_section): Ditto.
6128 * output.h (Input_section_specifier): Remove class.
6129 (Output_section::Output_section_data_by_input_section_map): Change
6130 key type to Const_section_id.
6131 (Output_section::Output_relaxed_input_section_by_input_section_map):
6132 Ditto.
6133 (Output_section::Relaxation_map): Change key type to Section_id.
6134
a2162063
ILT
61352010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6136
6137 * gold/arm.cc: Added support for R_ARM_V4BX relocation
6138 (class Arm_v4bx_stub): New class.
6139 (DEF_STUBS): Updated definition to support v4_veneer_bx.
6140 (Stub_factory::make_arm_v4bx_stub): New method.
6141 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
6142 (Stub_table::empty): Handle v4bx stubs.
6143 (Stub_table::add_arm_v4bx_stub): New method.
6144 (Stub_table::find_arm_v4bx_stub): New method.
6145 (Arm_relocate_functions::v4bx): New method.
6146 (Target_arm::fix_v4bx): New method.
6147 (Target_arm::Target_arm): Handle R_ARM_V4BX.
6148 (Stub_table::relocate_stubs): Likewise.
6149 (Stub_table::do_write): Likewise.
6150 (Stub_table::update_data_size_and_addralign): Likewise.
6151 (Stub_table::finalize_stubs): Likewise.
6152 (Target_arm::Scan::local): Likewise.
6153 (Target_arm::Scan::global): Likewise.
6154 (Target_arm::do_finalize_sections): Likewise.
6155 (Target_arm::Relocate::relocate): Likewise.
6156 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6157 Likewise.
6158 (Target_arm::scan_reloc_for_stub): Likewise.
6159 (Target_arm::scan_reloc_section_for_stubs): Likewise.
6160
5696ab0b
ILT
61612010-01-19 Ian Lance Taylor <iant@google.com>
6162
6163 * output.cc (Output_section_headers::do_sized_write): Write large
6164 segment count to sh_info field.
6165 (Output_file_header::do_sized_write): For large segment count,
6166 write PN_XNUM to e_phnum field.
6167
800d0f56
ILT
61682010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6169
6170 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
6171 (Arm_relocate_functions::thm_jump8): New function.
6172 (Arm_relocate_functions::thm_jump11): New function.
6173 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
6174 R_ARM_THM_JUMP11.
6175 (Target_arm::Scan::global): Likewise.
6176 (Target_arm::Relocate::relocate): Likewise.
6177 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6178 Likewise.
6179
41263c05
DK
61802010-01-14 Doug Kwan <dougkwan@google.com>
6181
6182 * arm.cc (map, utility): Include headers.
6183 (Target_arm::apply_cortex_a8_workaround): New method.
6184 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
6185 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
6186 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
6187 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
6188 the --[no-]fix-cortex-a8 command line options.
6189 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
6190 (Target_arm::relocate_stub): Use addend in instruction template.
6191 * options.h (DEFINE_bool): Set the user-set flag.
6192 (General_options): Add --[no-]-fix-cortex options.
6193 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 6194 : Update fast look-up map after conversion.
41263c05 6195
459e9b03
ST
61962010-01-14 Sriraman Tallam <tmsriram@google.com>
6197
6198 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
6199 in the first pass of do_layout.
6200
b521dfe4
DK
62012010-01-13 Doug Kwan <dougkwan@google.com>
6202
6203 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
6204 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
6205 apparent compiler problem of not folding static constant integral
6206 data members of elfcpp::Elf_sizes<32>.
6207
44272192
DK
62082010-01-13 Doug Kwan <dougkwan@google.com>
6209
6210 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
6211 Arm_relobj::section_needs_cortex_a8_stub_scanning,
6212 Arm_relobj::scan_section_for_cortex_a8_erratum,
6213 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
6214 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
6215 sections to scan for relocation stubs into a new method
6216 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
6217 relocation and Cortex-A8 stub scanning.
6218 (Target_arm::do_relax): Force stubs to be after stubbed sections
6219 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 6220 the beginning of a new relaxation pass. Update a comment.
44272192
DK
6221 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
6222
44b71ece
ILT
62232010-01-12 Ian Lance Taylor <iant@google.com>
6224
6225 * target-reloc.h (visibility_error): New inline function.
6226 (relocate_section): Call visibility_error.
6227 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
6228 (MOSTLYCLEANFILES): Likewise.
6229 (protected_4_pic.o, protected_3.err): New targets.
6230 * testsuite/protected_4.cc: New file.
6231
a120bc7f
DK
62322010-01-12 Doug Kwan <dougkwan@google.com>
6233
6234 * arm.cc (Cortex_a8_reloc): New class.
6235 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
6236 and cortex_a8_relocs_info_.
6237 (Target_arm::fix_cortex_a8): New method definition.
6238 (Target_arm::Cortex_a8_relocs_info): New type.
6239 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
6240 New data member declarations.
6241 (Target_arm::scan_reloc_for_stub): Record information about
6242 relocations for THUMB branches that might be exempted from the
6243 Cortex-A8 workaround.
6244 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
6245 at the beginning of a relaxation pass.
6246
20138696
DK
62472010-01-12 Doug Kwan <dougkwan@google.com>
6248
6249 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
6250 (Arm_relobj::Mapping_symbol_position,
6251 Arm_reloj::Mapping_symbol_position_less,
6252 Arm_relobj::Mapping_symbols_info): New types.
6253 (Target_arm::is_mapping_symbol_name): New method definition.
6254 (Arm_relobj::do_count_local_symbols): Save information about mapping
6255 symbols.
6256
089d69dc
DK
62572010-01-11 Doug Kwan <dougkwan@google.com>
6258
6259 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
6260 Arm_relocate_functions::thumb32_branch_upper,
6261 Arm_relocate_functions::thumb32_branch_lower,
6262 Arm_relocate_functions::thumb32_cond_branch_offset,
6263 Arm_relocate_functions::thumb32_cond_branch_upper,
6264 Arm_relocate_functions::thumb32_cond_branch_lower,
6265 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
6266 branch offset encoding.
6267 (Arm_relocate_functions::thumb_branch_common): Use new branch
6268 offset encoding methods to avoid code duplication.
6269 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
6270 (Stub_addend_reader::operator()): Use new branch encoding method
6271 to avoid code duplication.
6272
99e5bff2
DK
62732010-01-11 Doug Kwan <dougkwan@google.com>
6274
6275 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
6276 (Target_arm::do_finalize_sections): Define special EXIDX section
6277 symbols only if referenced.
6278 * gc.h (Garbage_collection::add_reference): New method.
6279 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
6280 code duplication.
6281
98e090bd
ILT
62822010-01-11 Ian Lance Taylor <iant@google.com>
6283
d0a91bd8
ILT
6284 * script.cc (Version_script_info::build_expression_list_lookup):
6285 Change complaing about duplicate wildcard match from error to
6286 warning.
6287
98e090bd
ILT
6288 * script.cc (class Lazy_demangler): Recreate--revert part of patch
6289 of 2009-12-30.
6290 (Version_script_info::Version_script_info): Initialize globs_,
6291 default_version_, default_is_global_, and exact_. Don't
6292 initialize globals_ or locals_.
6293 (Version_script_info::build_lookup_tables): Build local symbols
6294 first.
6295 (Version_script_info::unquote): New function.
6296 (Version_script_info::add_exact_match): New function.
6297 (Version_script_info::build_expression_list_lookup): Remove lookup
6298 parameter. Add is_global parameter. Change all callers. Handle
6299 wildcard pattern specially. Unquote pattern. Call
6300 add_exact_match.
6301 (Version_script_info::get_name_to_match): New function.
6302 (Version_script_info::get_symbol_version): New function.
6303 (Version_script_info::get_symbol_version_helper): Remove.
6304 (Version_script_info::check_unmatched_names): Call unquote.
6305 * script.h (class Version_script_info): Change get_symbol_version
6306 to be non-inline and add is_global parameter; change all callers.
6307 Rewrite symbol_is_local. Update declarations. Define struct
6308 Version_tree_match, Exact, Globs. Don't define struct Lookup.
6309 Remove globals_ and locals_ members. Add exact_, globs_,
6310 default_version_, is_global_.
6311 (Version_script_info::Glob): Remove pattern, add expression and
6312 is_global. Update constructor. Change all callers.
6313 * dynobj.cc (Versions::finalize): Mark the version symbol as the
6314 default version.
6315 (Versions::symbol_section_contents): If a symbol is undefined, or
6316 defined in a dynamic object, set the version index to
6317 VER_NDX_LOCAL.
6318 * symtab.cc (Symbol_table::add_from_relobj): Don't call
6319 symbol_is_local.
6320 (Symbol_table::add_from_pluginobj): Likewise.
6321 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
6322
d56962d3
DK
63232010-01-11 Doug Kwan <dougkwan@google.com>
6324
6325 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
6326 (incremental_dump_LDADD): Add linking option for libintl.
6327 * Makefile.in: Regenerate.
6328
94e6ee91
L
63292010-01-11 H.J. Lu <hongjiu.lu@intel.com>
6330
6331 PR gold/11144
6332 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
6333 instead of -Ds.
6334 * testsuite/Makefile.in: Regenerated.
6335
e96c574b
DK
63362010-01-10 Doug Kwan <dougkwan@google.com>
6337
6338 * options.h (DEFINE_var): Use parentheses around argument varname__
6339 in macro body to avoid any unintended subsequent substitutions.
6340
7198066b
ILT
63412010-01-10 Ian Lance Taylor <iant@google.com>
6342
ba4d53bf
ILT
6343 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
6344 candidates before doing symbol resolution.
6345
7198066b
ILT
6346 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
6347 ODR candidates if only one is weak.
6348
a2beed37
ILT
63492010-01-08 Ian Lance Taylor <iant@google.com>
6350
6351 * script.cc (Version_script_info::build_expression_list_lookup):
6352 Don't warn about ambiguous version, just record the ambiguity.
6353 (Version_script_info::get_symbol_version_helper): Give error if
6354 version is ambiguous.
6355
2fb7225c
DK
63562010-01-08 Doug Kwan <dougkwan@google.com>
6357
6358 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
6359 prev_data_size_ and prev_addralign_. Remove initializer for
6360 deleted data member has_been_changed_.
6361 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
6362 to determine if the table is empty.
6363 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
6364 Remove.
6365 (Stub_table::add_reloc_stub): Define method in class definition
6366 instead of just declaring it there.
6367 (Stub_table::add_cortex_a8_stub): New method definition.
6368 (Stub_table::update_data_size_and_addralign): Ditto.
6369 (Stub_table::finalize_stubs): Ditto.
6370 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
6371 (Stub_table::do_addralign_): Return address alignment in the
6372 (Stub_table::do_reset_address_and_file_offset): Define method in
6373 class definition instead of declaring it there. Set current data
6374 size to be the data size of the previous pass.
6375 (Stub_table::set_final_data_size): Use current data size as the
6376 final data size.
6377 (Stub_table::relocate_stub): Change parameter type of stub from
6378 Reloc_stub pointer to Stub pointer.
6379 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
6380 (Stub_table::Cortex_a8_stub_list): New typedef.
6381 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
6382 Stub_table::prev_addralign_): New data member.
6383 (Arm_relobj::Arm_relobj): Initialize data member
6384 section_has_cortex_a8_workaround_.
6385 (Arm_relobj::section_has_cortex_a8_workaround,
6386 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
6387 definitions.
6388 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
6389 declarations.
6390 (Target_arm::relocate_stub): Change parameter type of stub from
6391 Reloc_stub pointer to Stub pointer.
6392 (Insn_template::size, Insn_template::alignment): Handle
6393 THUMB16_SPECIAL_TYPE.
6394 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
6395 Stub_table::update_data_size_and_addralign,
6396 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
6397 definitions.
6398 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
6399 (Stub_table::do_write): Ditto.
6400 (Target_arm::do_relax): Adjust code for changes in Stub_table.
6401
880cd20d
ILT
64022010-01-08 Ian Lance Taylor <iant@google.com>
6403
6404 PR 11108
6405 * symtab.h (class Symbol): Remove fields is_target_special_ and
6406 has_plt_offset_. Add field is_defined_in_discarded_section_.
6407 (Symbol::is_defined_in_discarded_section): New function.
6408 (Symbol::set_is_defined_in_discarded_section): New function.
6409 (Symbol::has_plt_offset): Rewrite.
6410 (Symbol::set_plt_offset): Verify that new offset is not -1U.
6411 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
6412 Don't initialize is_target_special_ or has_plt_offset_.
6413 Initialize is_defined_in_discarded_section_.
6414 (Symbol_table::add_from_relobj): If appropriate, set
6415 is_defined_in_discarded_section.
6416 * resolve.cc (Symbol::override_base_with_special): Don't test
6417 is_target_special_. Change has_plt_offset_ to has_plt_offset().
6418 * target-reloc.h (relocate_section): Do special handling for
6419 symbols defined in discarded sections for global symbols as well
6420 as local symbols.
6421
2703e3eb
ILT
64222010-01-08 Ian Lance Taylor <iant@google.com>
6423
6424 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
6425 the SHT_SYMTAB case.
6426
339d40a3
ILT
64272010-01-08 Ian Lance Taylor <iant@google.com>
6428
6429 * object.cc (Sized_relobj::do_layout): Don't get confused if
6430 layout_eh_frame returns NULL.
6431
abecea76
ILT
64322010-01-08 Ian Lance Taylor <iant@google.com>
6433
6434 PR 11084
6435 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
6436 dynamic symbol table, use the normal symbol table.
6437 (Sized_dynobj::do_read_symbols): Remove assertion about type of
6438 symbol table.
6439
6b7dd3f3
ILT
64402010-01-08 Ian Lance Taylor <iant@google.com>
6441
6442 PR 11072
6443 * layout.cc (Layout::include_section): Remove .gnu_debuglink
6444 sections.
6445
36c50e63
L
64462010-01-08 H.J. Lu <hongjiu.lu@intel.com>
6447
6448 * version.cc (print_version): Change to "Copyright 2010".
6449
e291e7b9
ILT
64502010-01-08 Ian Lance Taylor <iant@google.com>
6451
6452 PR 10287
6453 PR 11063
6454 * i386.cc (class Target_i386): Change return type of plt_section
6455 to be non-const.
6456 (class Output_data_plt_i386): Add tls_desc_rel_ field.
6457 (Output_data_plt_i386::Output_data_plt_i386): Initialize
6458 tls_desc_rel_ field.
6459 (Output_data_plt_i386::rel_tls_desc): New function.
6460 (Target_i386::rel_tls_desc_section): New function.
6461 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
6462 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
6463 R_386_TLS_DESC reloc in rel_tls_desc_section.
6464 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
6465 Define struct Tlsdesc_info.
6466 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
6467 (Target_x86_64::do_reloc_symbol_index): New function.
6468 (Target_x86_64::add_tlsdesc_info): New function.
6469 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
6470 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
6471 tlsdesc_rel_ field.
6472 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
6473 all callers.
6474 (Output_data_plt_x86_64::rela_tlsdesc): New function.
6475 (Target_x86_64::rela_tlsdesc_section): New function.
6476 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
6477 handling.
6478 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
6479 (Target_x86_64::do_reloc_addend): New function.
6480 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
6481 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
6482 declarations. Define TARGET_CODE. Add arg field to u1_ union.
6483 (Output_reloc::type): New function.
6484 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
6485 (Output_reloc::is_target_specific): New function.
6486 (Output_reloc::target_arg): New function.
6487 (class Output_reloc) [SHT_RELA]: Add four new constructors for
6488 absolute relocs and target specific relocs.
6489 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
6490 add_target_specific.
6491 (class Output_data_reloc) [SHT_RELA]: Likewise.
6492 * output.cc (Output_reloc::Output_reloc): Add four new versions
6493 for absolute relocs and target specific relocs.
6494 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
6495 (Output_reloc::get_symbol_index): Likewise.
6496 (Output_reloc::local_section_offset): Check that local_sym_index_
6497 is not TARGET_CODE or 0.
6498 (Output_reloc::symbol_value): Likewise.
6499 (Output_reloc::write) [SHT_RELA]: Call target for target specific
6500 reloc.
6501 * target.h (class Target): Add reloc_symbol_index and reloc_addend
6502 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
6503 functions.
6504 * layout.cc (add_target_dynamic_tags): Use output section for
6505 DT_PLTRELSZ and DT_JMPREL.
6506
3a44184e
ILT
65072010-01-07 Ian Lance Taylor <iant@google.com>
6508
6509 PR 11061
6510 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
6511 function.
6512 (class Output_data_reloc_generic): Define.
6513 (class Output_data_reloc_base): Change base class to
6514 Output_data_reloc_generic. Change add() method to call
6515 bump_relative_reloc_count for a relative reloc. Remove
6516 sort_relocs_ field.
6517 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
6518 to sort_relocs().
6519 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
6520 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
6521 appropriate.
6522 * layout.h (class Layout): Update declaration.
6523
ea715a34
ILT
65242010-01-07 Ian Lance Taylor <iant@google.com>
6525
6526 * output.h (class Output_data): Add const version of
6527 output_section and do_output_section.
6528 (class Output_section_data): Add const version of
6529 do_output_section.
6530 (class Output_section): Likewise.
6531 * layout.cc (Layout::add_target_dynamic_tags): New function.
6532 * layout.h (class Layout): Update declarations.
6533 * arm.cc (Target_arm::do_finalize_sections): Use
6534 add_target_dynamic_tags.
6535 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6536 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
6537 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
6538 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6539
659948a4
ILT
65402010-01-07 Ian Lance Taylor <iant@google.com>
6541
6542 PR 11042
6543 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
6544 object as needed.
6545
9d3b86f6
ILT
65462010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
6547 Ian Lance Taylor <iant@google.com>
6548
6549 PR 11019
6550 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
6551 Xindex::read_symtab_xindex.
6552
bb0d3eb0
DK
65532010-01-07 Doug Kwan <dougkwan@google.com>
6554
6555 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
6556 (Insn_template::thumb16_bcond_insn): New method declaration.
6557 (Insn_template): Fix spelling.
6558 (Stub::thumb16_special): New method declaration.
6559 (Stub::do_write): Define virtual method which was previously pure
6560 virtual.
6561 (Stub::do_thumb16_special): New method declaration.
6562 (Stub::do_fixed_endian_write): New template member.
6563 (Reloc_stub::do_write): Remove.
6564 (Reloc_stub::do_fixed_endian_write): Remove.
6565 (Cortex_a8_stub): New class definition.
6566 (Stub_factory::make_cortex_a8_stub): New method definition.
6567 (Stub_factory::Stub_factory): Add missing static storage class
6568 qualifier for elf32_arm_stub_a8_veneer_blx.
6569
ffeef7df
ILT
65702010-01-07 Ian Lance Taylor <iant@google.com>
6571
dc3f80fe
ILT
6572 PR 10980
6573 * options.h (class General_options): Add --warn-unresolved-symbols
6574 and --error-unresolved-symbols.
6575 * errors.cc (Errors::undefined_symbol): Implement
6576 --warn-unresolved-symbols.
6577
ffeef7df
ILT
6578 * options.h (class General_options): Add -z text and -z textoff.
6579 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
6580
f1ec9ded
ST
65812010-01-06 Sriraman Tallam <tmsriram@google.com>
6582
6583 * gc.h (Garbage_collection::Cident_section_map): New typedef.
6584 (Garbage_collection::cident_sections): New function.
6585 (Garbage_collection::add_cident_section): New function.
6586 (Garbage_collection::cident_sections_): New member.
6587 (gc_process_relocs): Add references to sections whose names are C
6588 identifiers.
6589 * gold.h (cident_section_start_prefix): New constant.
6590 (cident_section_stop_prefix): New constant.
6591 (is_cident): New function.
6592 * layout.cc (Layout::define_section_symbols): Replace string constants
6593 with the newly defined constants.
6594 * object.cc (Sized_relobj::do_layout): Track sections whose names are
6595 C identifiers.
6596 * testsuite/Makefile.am: Add gc_orphan_section_test.
6597 * testsuite/Makefile.in: Regenerate.
6598 * testsuite/gc_orphan_section_test.cc: New file.
6599 * testsuite/gc_orphan_section_test.sh: New file.
6600
6eda8c29
ILT
66012010-01-06 Ian Lance Taylor <iant@google.com>
6602
b9674e17
ILT
6603 PR 10980
6604 * options.h (class General_options): Add --warn-shared-textrel.
6605 * layout.cc (Layout::finish_dynamic_section): Implement
6606 --warn-shared-textrel.
6607
6eda8c29
ILT
6608 PR 10980
6609 * options.h (class General_options): Add --warn-multiple-gp.
6610
32dcd44e
ILT
66112010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6612
6613 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
6614 $(THREADSLIB) and $(LIBDL).
6615 * Makefile.in: Rebuild.
6616
a192ba05
ILT
66172010-01-06 Ian Lance Taylor <iant@google.com>
6618
6619 PR 10980
6620 * options.cc (General_options::parse_section_start): New function.
6621 (General_options::section_start): New function.
6622 (General_options::General_options): Initialize all members.
6623 * options.h: Include <map>
6624 (class General_options): Add --section-start. Add section_starts_
6625 member.
6626 * layout.cc (Layout::attach_allocated_section_to_segment): If
6627 --section-start was used, set the address of the segment. Remove
6628 local sort_sections.
6629 (Layout::relaxation_loop_body): If the address of the load segment
6630 has been set by --section-start, don't use it.
6631 * output.h (Output_segment::update_flags_for_output_section): New
6632 function.
6633 * output.cc (Output_segment::add_output_section): Call
6634 update_flags_for_output_section.
6635
dde3f402
ILT
66362010-01-05 Ian Lance Taylor <iant@google.com>
6637
62dfdd4d
ILT
6638 PR 10980
6639 * options.h (class General_options): Add --undefined-version.
6640 * script.cc (struct Version_expression): Add was_matched_by_symbol
6641 field.
6642 (Version_script_info::matched_symbol): New function.
6643 (Version_script_info::get_symbol_version_helper): Call
6644 matched_symbol.
6645 (Version_script_info::check_unmatched_names): New function.
6646 * script.h (class Version_script_info): Update declarations.
6647 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
6648
9c4ae156
ILT
6649 * options.h (class General_options): Use DEFINE_bool_alias for
6650 allow_multiple_definition.
6651 * resolve.cc (Symbol_table::should_override): Don't test
6652 allow_multiple_definition.
6653
dde3f402
ILT
6654 PR 10980
6655 * options.h (class General_options): Add --cref.
6656 * main.cc (main): Print cref table if --cref. Don't close mapfile
6657 until after printing cref table.
6658 * cref.cc: Include "symtab.h".
6659 (class Cref_inputs): Define Cref_table_compare and Cref_table.
6660 (Cref_table_compare::operator()): New function.
6661 (Cref_inputs::gather_cref): New function.
6662 (filecol): New static const.
6663 (Cref_inputs::print_cref): New function.
6664 (Cref::print_cref): New function.
6665 * cref.h: Include <cstdio>.
6666 (class Cref): Update declarations.
6667 * mapfile.h (Mapfile::file): New function.
6668 * object.h (class Object): Define Symbols. Declare virtual
6669 do_get_global_symbols.
6670 (Object::get_global_symbols): New function.
6671 * object.cc (Input_objects::add_object): Pass object to cref_ if
6672 --cref.
6673 (Input_objects::archive_start): Likewise.
6674 (Input_objects::archive_stop): Likewise.
6675 (Input_objects::print_cref): New function.
6676 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
6677 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
6678 --cref.
6679 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
6680 function.
6681 * plugin.h (class Sized_pluginobj): Update declarations.
6682
8781f709
ILT
66832010-01-05 Ian Lance Taylor <iant@google.com>
6684
6685 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
6686 to is_default_version. Rename insdef to insdefault.
6687 (Symbol_table::add_from_relobj): Rename def to is_default_version
6688 and local to is_forced_local.
6689 (Symbol_table::add_from_pluginobj): Likewise.
6690 (Symbol_table::add_from_dynobj): Likewise.
6691 (Symbol_table::define_special_symbol): Rename insdef to
6692 insdefault.
6693
fe35d28d
ILT
66942010-01-04 Ian Lance Taylor <iant@google.com>
6695
30bc8c46
ILT
6696 PR 10980
6697 * options.h (class General_options): Add
6698 --allow-multiple-definition and -z muldefs.
6699 * resolve.cc (Symbol_table::should_override): Don't warn about a
6700 multiple symbol definition if --allow-multiple-definition or -z
6701 muldefs.
6702
7eaea549
ILT
6703 PR 10980
6704 * options.h (class General_options): Add --add-needed and
6705 --copy-dt-needed-entries. Tweak --as-needed help entry.
6706 * object.cc (Input_objects::check_dynamic_dependencies): Give an
6707 error if --copy-dt-needed-entries aka --add-needed is used and
6708 would cause a change in behaviour.
6709
fe35d28d
ILT
6710 PR 10980
6711 * options.h (class General_options): Add -G as a short version of
6712 --shared. Add no-op options -assert, -g, and -i.
6713
55a2bb35
ST
67142010-01-04 Sriraman Tallam <tmsriram@google.com>
6715
6716 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
6717 check for .text or .gnu.linkonce.t sections.
6718 * icf.cc (Icf::find_identical_sections): Ditto.
6719 Change the detection for mangled function name within the section
6720 name.
6721 * icf.h (is_section_foldable_candidate): New function.
6722
719328e1
ILT
67232009-12-30 Ian Lance Taylor <iant@google.com>
6724
6725 PR 10980
6726 * options.h (class General_options): Permit two dashes with
6727 --retain-symbols-file.
6728
d7bb5745
ILT
67292009-12-30 Ian Lance Taylor <iant@google.com>
6730
403a15dd
ILT
6731 PR 10979
6732 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
6733 don't put the file header and segment headers in the text
6734 segment.
6735
eda294df
ILT
6736 PR 10979
6737 * common.cc (Sort_commons::operator()): Stabilize sort when both
6738 entries are NULL.
6739 (Symbol_table::do_allocate_commons_list): When allocating common
6740 symbols, skip a symbol which is no longer common.
6741 * symtab.h (Symbol::is_common): Test whether the symbol comes from
6742 an object before checking its type.
6743 * testsuite/common_test_2.c: New file.
6744 * testsuite/common_test_3.c: New file.
6745 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
6746 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
6747 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
6748 (common_test_2_pic.o, common_test_2.so): New targets.
6749 (common_test_3_pic.o, common_test_3.so): New targets.
6750 * testsuite/Makefile.in: Rebuild.
6751
d7bb5745
ILT
6752 PR 10979
6753 * script.cc (read_input_script): If we see a new SECTIONS clause,
6754 and we have added an input section, give an error.
6755 * layout.h (class Layout): Add have_added_input_section function.
6756 Add have_added_input_section_ field.
6757 * layout.cc (Layout::Layout): Initialize
6758 have_added_input_section_.
6759 (Layout::layout): Set have_added_input_section_.
6760 (Layout::layout_eh_frame): Likewise.
6761
fc59c572
ILT
67622009-12-30 Ian Lance Taylor <iant@google.com>
6763
6764 PR 10931
6765 * options.h (class General_options): Add --sort-common option.
6766 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
6767 * common.cc (Sort_common): Add sort_order parameter to
6768 constructor. Add sort_order_ field.
6769 (Sort_commons::operator): Check sort_order_.
6770 (Symbol_table::allocate_commons): Determine the sort order.
6771 (Symbol_table::do_allocate_commons): Add sort_order parameter.
6772 Change all callers.
6773 (Symbol_table::do_allocate_commons_list): Likewise.
6774
1c74fab0
ILT
67752009-12-30 Ian Lance Taylor <iant@google.com>
6776
6777 PR 10916
6778 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
6779 symbols from this object, don't change the visibility of an
6780 undefined symbol.
6781 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
6782
6affe781
ILT
67832009-12-30 Ian Lance Taylor <iant@google.com>
6784
6785 PR 10861
6786 * script.h (class Version_script_info): Define Language enum.
6787 Update declarations. Define Glob, Exact, and Lookup types. Add
6788 new fields globals_, locals_, and is_finalized_.
6789 * script.cc: Various formatting fixes.
6790 (class Parser_closure): Change language_stack_ from a vector of
6791 std::string to one of Version_script_info::Language. Adjust all
6792 uses accordingly.
6793 (class Lazy_demangler): Remove.
6794 (struct Version_expression): Change language from std::string to
6795 Version_script_info::Language.
6796 (Version_script_info::Version_script_info): New function.
6797 (Version_script_info::~Version_script_info): Don't call clear.
6798 (Version_script_info::finalize): New function.
6799 (Version_script_info::build_lookup_tables): New function.
6800 (Version_script_info::build_expression_list_lookup): New
6801 function.
6802 (Version_script_info::get_symbol_version_helper): Rewrite to use
6803 lookup tables.
6804 (Version_script_info::print_expression_list): Adjust to use
6805 Version_script_info::Language.
6806 (script_push_lex_into_version_mode): Check that the version script
6807 has not been finalized.
6808 (version_script_push_lang): Change language string to
6809 Version_script_info::Language.
6810 * options.cc (Command_line::version_script): New function.
6811 * options.h (class General_options): Add finalize_dynamic_list
6812 function. Change version_script from declaration to definition.
6813 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
6814 * testsuite/version_script.map: Remove duplicate def of foo.
6815 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
6816 version_script.map.
6817 * testsuite/Makefile.in: Rebuild.
6818
818bf354
ILT
68192009-12-30 Ian Lance Taylor <iant@google.com>
6820
6821 PR 10843
6822 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
6823 if the input symbol index is 0, make the output symbol index 0.
6824
ebcc8304
ILT
68252009-12-30 Ian Lance Taylor <iant@google.com>
6826
6827 PR 10670
6828 * options.h (class General_options): Add -x/--discard-all.
6829 * object.cc (Sized_relobj::do_count_local_symbols): Handle
6830 --discard-all. If the local symbol needs a dynamic entry, check
6831 that before handling --discard-locals.
6832
176fe33f
ILT
68332009-12-30 Ian Lance Taylor <iant@google.com>
6834
bb321bb1
ILT
6835 PR 10450
6836 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
6837 flags to PF_R.
6838 (Output_segment::add_output_section): Don't change the flags if
6839 the type is PT_TLS.
6840
176fe33f
ILT
6841 PR 10450
6842 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
6843 GNU hash table if they need a dynamic value. Otherwise, don't add
6844 them if they are defined in a dynamic object or are forced local.
6845
e8cd95c7
ILT
68462009-12-29 Ian Lance Taylor <iant@google.com>
6847
1b81fb71
ILT
6848 PR 10450
6849 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
6850 .gnu.hash table for a 32-bit target.
6851
8d6d383d
ILT
6852 PR 10450
6853 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
6854 regular and a dynamic object only needs a dynamic symbol table
6855 entry if it is externally visible.
6856
e785ec03
ILT
6857 PR 10450
6858 * i386.cc (class Target_i386): Initialize global_offset_table_ in
6859 constructor. Add global_offset_table_ field.
6860 (Target_i386::got_section): Set global_offset_table_.
6861 (Target_i386::do_finalize_sections): Set global_offset_table_
6862 size.
6863 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
6864 in constructor. Add global_offset_table_ field.
6865 (Target_x86_64::got_section): Set global_offset_table_.
6866 (Target_x86_64::do_finalize_sections): Set global_offset_table_
6867 size.
6868
1a2dff53
ILT
6869 * layout.cc (Layout::Layout): Initialize increase_relro_.
6870 (Layout::get_output_section): Add is_relro, is_last_relro, and
6871 is_first_non_relro parameters. Change all callers.
6872 (Layout::choose_output_section): Likewise.
6873 (Layout::add_output_section_data): Likewise.
6874 (Layout::make_output_section): Likewise.
6875 (Layout::set_segment_offsets): Clear increase_relro when using a
6876 linker script.
6877 * layout.h (class Layout): Add increase_relro method. Add
6878 increase_relro_ field. Update declarations.
6879 * output.cc (Output_section::Output_section): Initialize
6880 is_last_relro_ and is_first_non_relro_.
6881 (Output_segment::add_output_section): Group relro sections is
6882 do_sort is true. Handle is_last_relro and is_first_non_relro.
6883 (Output_segment::maximum_alignment): Remove relro handling.
6884 (Output_segment::set_section_addresses): Add increase_relro
6885 parameter. Change all callers. Add initial alignment to align
6886 relro sections on separate page. Remove old relro handling.
6887 (Output_segment::set_section_list_addresses): Remove in_relro
6888 parameter. Change all callers.
6889 (Output_segment::set_offset): Add increase parameter. Change all
6890 callers. Remove old relro handling.
6891 * output.h (class Output_section): Add new methods: is_last_relro,
6892 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
6893 Add is_last_relro_ and is_first_non_relro_ fields.
6894 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
6895 Create separate .got.plt section. Call increase_relro.
6896 * x86_64.cc (Target_x86_64::got_section): Likewise.
6897 * testsuite/relro_script_test.t: Add .got.plt.
6898
f0ba79e2
ILT
6899 PR 10450
6900 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
6901 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
6902 (Layout::finalize): Call set_dynamic_symbol_size.
6903 (Layout::set_dynamic_symbol_size): New function.
6904 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
6905 set_dynamic_symbol_size.
6906
e8cd95c7
ILT
6907 PR 10450
6908 * output.h (class Output_section): Add is_entsize_zero_ field.
6909 * output.cc (Output_section::Output_section): Initialize
6910 is_entsize_zero_.
6911 (Output_section::set_entsize): If two different entsizes are
6912 requested, force it to zero.
6913 (Output_section::add_input_section): Set flags for .debug_str
6914 before updating section flags. Set entsize.
6915 (Output_section::update_flags_for_input_section): Set SHF_MERGE
6916 and SHF_STRING if all input sections have those flags.
6917
3e1b9a8a
RÁE
69182009-12-29 Rafael Espindola <espindola@google.com>
6919
6920 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
6921 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
6922 reporting.
3e1b9a8a 6923
3dcad376
ST
69242009-12-29 Sriraman Tallam <tmsriram@google.com>
6925
6926 * options.cc (General_options::parse_version): Allow -v to exit
6927 without an error if there is nothing to link.
6928
084e2665
ILT
69292009-12-29 Ian Lance Taylor <iant@google.com>
6930
6931 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
6932 using a version of gcc before 4.1.
6933 * configure: Rebuild.
6934
250acde3
CD
69352009-12-28 Chris Demetriou <cgd@google.com>
6936
6937 * attributes.cc (Output_attributes_section_data::do_write): Use
6938 std::vector::front rather than std::vector::data.
6939
99fff23b
ILT
69402009-12-28 Ian Lance Taylor <iant@google.com>
6941
6942 * symtab.h (class Symbol_table): Add enum Defined.
6943 * resolve.cc (Symbol_table::should_override): Add defined
6944 parameter. Change all callers. Test whether object is NULL
6945 before calling a method on it.
6946 (Symbol_table::report_resolve_problem): Add defined parameter.
6947 Change all callers.
6948 (Symbol_table::should_override_with_special): Likewise.
6949 * symtab.cc (Symbol_table::define_in_output_data): Add defined
6950 parameter. Change all callers.
6951 (Symbol_table::do_define_in_output_data): Likewise.
6952 (Symbol_table::define_in_output_segment): Likewise.
6953 (Symbol_table::do_define_in_output_segment): Likewise.
6954 (Symbol_table::define_as_constant): Likewise.
6955 (Symbol_table::do_define_as_constant): Likewise.
6956 * script.h (class Symbol_assignment): Add is_defsym parameter to
6957 constructor; change all callers.
6958 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
6959 parameter. Change all callers. Add is_defsym_ field.
6960 (class Parser_closure): Add parsing_defsym parameter to
6961 constructor; change all callers. Add parsing_defsym accessor
6962 function. Add parsing_defsym_ field.
6963
556bd683
ILT
69642009-12-28 Ian Lance Taylor <iant@google.com>
6965
6966 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 6967 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 6968
1782c879
ILT
69692009-12-23 Ian Lance Taylor <iant@google.com>
6970
6971 * i386.cc (Target_i386::do_calls_non_split): Recognize
6972 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
6973 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
6974 -fsplit-stack prologue when using %r11.
1782c879 6975
329ca2b1
ST
69762009-12-21 Sriraman Tallam <tmsriram@google.com>
6977
6978 * options.cc (General_options::parse_version): Make -v continue and do
6979 the link like GNU ld does.
6980
d675ff46
RÁE
69812009-12-17 Rafael Avila de Espindola <espindola@google.com>
6982
6983 * Makefile.am (CCFILES): Add timer.cc.
6984 (HFILES): Add timer.h.
6985 * configure.ac: Check for sysconf and times.
6986 * main.cc: include timer.h.
6987 (main): Use Timer instead of get_run_time.
6988 * timer.cc: New.
6989 * timer.h: New.
6990 * workqueue.cc: include timer.h.
6991 (Workqueue::find_and_run_task):
6992 Report user, sys and wall time.
6993 * Makefile.in: Regenerate.
6994 * config.in: Regenerate.
6995 * configure: Regenerate.
6996
d6344fb5
DK
69972009-12-16 Doug Kwan <dougkwan@google.com>
6998
6999 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
7000 sections.
7001 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
7002 relaxed input sections.
7003 * output.cc (Output_section::find_relaxed_input_section): Change
7004 return type to Output_relaxed_input_section pointer. Adjust code
7005 for new type of relaxed_input_section_map_.
7006 * output.h (Output_section::find_relaxed_input_section): Change
7007 return type to Output_relaxed_input_section pointer.
7008 (Output_section::Output_relaxed_input_section_by_input_section_map):
7009 New type.
7010 (Output_section::relaxed_input_section_map_): Change type to
7011 Output_section::Output_relaxed_input_section_by_input_section_map.
7012 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
7013 input section.
7014
0e0d5469
ILT
70152009-12-15 Ian Lance Taylor <iant@google.com>
7016
7017 * layout.cc (Layout::create_shstrtab): Only write out after input
7018 sections if we are compressing debug sections.
7019
0649a889
ILT
70202009-12-15 Ian Lance Taylor <iant@google.com>
7021
7022 * archive.cc (Archive::add_symbols): Only look up a symbol without
7023 a version if there is, in fact, a version.
7024
2ea97941
ILT
70252009-12-14 Ian Lance Taylor <iant@google.com>
7026
7027 Revert -Wshadow changes, all changes from:
7028 2009-12-11 Doug Kwan <dougkwan@google.com>
7029 2009-12-11 Nick Clifton <nickc@redhat.com>
7030 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
7031
b0eec2cc
DK
70322009-12-11 Doug Kwan <dougkwan@google.com>
7033
7034 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
7035 due to -Wshadow.
7036 * attributes.cc (Object_attribute::size): Ditto.
7037 (Attributes_section_data::size): Ditto.
7038 (Attributes_section_data::Attributes_section_data): Ditto.
7039 (Output_attributes_section_data::do_write): Ditto.
7040 * attributes.h (Object_attribute::set_type): Ditto.
7041 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
7042
91d6fa6a
NC
70432009-12-11 Nick Clifton <nickc@redhat.com>
7044
7045 * archive.cc: Fix shadowed variable warnings.
7046 * arm.cc: Likewise.
7047 * compressed_output.cc: Likewise.
7048 * compressed_output.h: Likewise.
7049 * configure: Likewise.
7050 * dwarf_reader.cc: Likewise.
7051 * dynobj.cc: Likewise.
7052 * dynobj.h: Likewise.
7053 * ehframe.cc: Likewise.
7054 * ehframe.h: Likewise.
7055 * errors.cc: Likewise.
7056 * expression.cc: Likewise.
7057 * fileread.cc: Likewise.
7058 * fileread.h: Likewise.
7059 * freebsd.h: Likewise.
7060 * i386.cc: Likewise.
7061 * icf.cc: Likewise.
7062 * incremental.h: Likewise.
7063 * layout.cc: Likewise.
7064 * layout.h: Likewise.
7065 * mapfile.cc: Likewise.
7066 * merge.cc: Likewise.
7067 * merge.h: Likewise.
7068 * object.cc: Likewise.
7069 * object.h: Likewise.
7070 * options.h: Likewise.
7071 * output.cc: Likewise.
7072 * output.h: Likewise.
7073 * parameters.cc: Likewise.
7074 * plugin.cc: Likewise.
7075 * powerpc.cc: Likewise.
7076 * reduced_debug_output.cc: Likewise.
7077 * reduced_debug_output.h: Likewise.
7078 * reloc.cc: Likewise.
7079 * reloc.h: Likewise.
7080 * resolve.cc: Likewise.
7081 * script-sections.cc: Likewise.
7082 * script.cc: Likewise.
7083 * script.h: Likewise.
7084 * sparc.cc: Likewise.
7085 * symtab.cc: Likewise.
7086 * symtab.h: Likewise.
7087 * target-select.cc: Likewise.
7088 * target-select.h: Likewise.
7089 * token.h: Likewise.
7090 * workqueue.cc: Likewise.
7091 * workqueue.h: Likewise.
7092 * x86_64.cc: Likewise.
7093
a0351a69
DK
70942009-12-10 Doug Kwan <dougkwan@google.com>
7095
7096 * arm.cc (attributes.h): New include.
7097 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
7098 (Arm_relobj::~Arm_relobj): Delete object pointed by
7099 attributes_section_data_.
7100 (Arm_relobj::attributes_section_data): New method definition.
7101 (Arm_relobj::attributes_section_data_): New data member declaration.
7102 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
7103 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
7104 attributes_section_data_.
7105 (Arm_dynobj::attributes_section_data): New method definition.
7106 (Arm_dynobj::attributes_section_data_): New data member declaration.
7107 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
7108 initialization value of may_use_blx_ to false.
7109 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
7110 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
7111 object attributes to compute results instead of hard-coding.
7112 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
7113 Target_arm::get_secondary_compatible_arch,
7114 Target_arm::set_secondary_compatible_arch
7115 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7116 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
7117 New method declarations.
7118 (Target_arm::get_aeabi_object_attribute): New method definition.
7119 (Target_arm::attributes_section_data_): New data member declaration.
7120 (read_arm_attributes_section): New template definition.
7121 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
7122 (Arm_dynobj::do_read_symbols): Ditto.
7123 (Target_arm::do_finalize_sections): Merge attributes sections from
7124 input. Check for BLX use after attributes section merging.
7125 Fix __exidx_start and __exidx_end visibility. Create an
7126 .ARM.attributes section if necessary.
7127 (Target_arm::get_secondary_compatible_arch,
7128 Target_arm::set_secondary_compatible_arch,
7129 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7130 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 7131 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
7132 New method definitions.
7133
b59befec
ILT
71342009-12-09 Ian Lance Taylor <iant@google.com>
7135
7136 * plugin.cc (Plugin::load): Don't cast from void* to a function
7137 pointer.
7138
1276bc89
ILT
71392009-12-09 Ian Lance Taylor <iant@google.com>
7140
7141 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
7142 information fields.
7143
2f2de248
L
71442009-12-09 H.J. Lu <hongjiu.lu@intel.com>
7145
7146 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
7147 Replace two_file_shared_1.so with two_file_shared_2.so.
7148 * testsuite/Makefile.in: Regenerated.
7149
4f787271
DK
71502009-12-08 Doug Kwan <dougkwan@google.com>
7151
7152 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
7153 (HFILES): Add attributes.h and int_encoding.h.
7154 * Makefile.in: Regenerate.
7155 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
7156 function definitions to int_encoding.cc
7157 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
7158 prototypes to int_encoding.h
7159 * reduced_debug_output.cc (int_encoding.h): New include.
7160 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
7161 function definitions to int_encoding.cc
7162 (insert_into_vector, read_from_pointer): Move template definitions to
7163 int_encoding.h
7164 * attributes.cc: New file.
7165 * attributes.h: New file.
7166 * int_encoding.cc: New file.
7167 * int_encoding.h: New file.
7168
20b52f1a
RÁE
71692009-12-07 Rafael Avila de Espindola <espindola@google.com>
7170
7171 PR gold/11055
7172 * incremental-dump.cc (dump_incremental_inputs): New.
7173 (main): Use dump_incremental_inputs.
7174
53d7974c
L
71752009-12-07 H.J. Lu <hongjiu.lu@intel.com>
7176
7177 PR gold/10893
7178 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
7179 checking elfcpp::STT_FUNC.
7180 (Target_i386::Relocate::relocate): Likewise.
7181 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
7182
7183 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
7184 symbols from shared libraries into normal FUNC symbols.
7185
7186 * symtab.h (Symbol): Add is_func and use it.
7187
05a352e6
DK
71882009-12-05 Doug Kwan <dougkwan@google.com>
7189
7190 * arm.cc (Target_arm::arm_info): Initialize new fields
7191 attributes_section and attributes_vendor.
7192 * i386.cc (Target_i386::i386_info): Same.
7193 * object.cc (Sized_relobj::do_layout): Skip attribute section.
7194 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
7195 fields attributes_section and attributes_vendor.
53d7974c 7196 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
7197 * target.h (Target::attributes_section, Target::attributes_vendor,
7198 Target::is_attributes_section, Target::attribute_arg_type,
7199 Target::attributes_order): New method definitions.
7200 (Target::Target_info::attributes_section,
7201 Target::Target_info::attributes_vendor): New fields.
7202 (Target::do_attribute_arg_type, Target::do_attributes_order): New
7203 virtual method definitions.
7204 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
7205 attributes_section and attributes_vendor.
7206 * testsuite/testfile.cc (Target_test::test_target_info): Same.
7207
f4e5969c
DK
72082009-12-05 Doug Kwan <dougkwan@google.com>
7209
7210 * arm.cc: Update comments about interworking and stub generation.
7211 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
7212 considered as non-PIC.
7213 (Arm_relocate_functions::base_abs): Fix formatting.
7214 (Arm_relocate_functions::got_prel): Fix comment. Change interface
7215 of function to use GOT entry address instead of offset.
7216 (Target_arm::Scan::global): Issue an error if a symbol would need a
7217 PLT does not get one because it is untyped. Remove code to create
7218 dynamic symbols for relative branches.
7219 (Target_arm::Relocate::relocate: Use 0 instead of false since function
7220 takes unsigned integer instead of boolean.
7221
1abce4a6
L
72222009-12-05 H.J. Lu <hongjiu.lu@intel.com>
7223
7224 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
7225 (two_file_test_LDADD): Likewise.
7226 (common_test_1_LDADD): Likewise.
7227 (exception_test_LDADD) Likewise.
7228 (weak_test_LDADD): Likewise.
7229 (many_sections_test_LDADD): Likewise.
7230 (initpri1_LDADD): Likewise.
7231 (script_test_1_LDADD): Likewise.
7232 (script_test_2_LDADD): Likewise.
7233 (justsyms_LDADD): Likewise.
7234 (binary_test_LDADD): Likewise.
7235 (large_LDADD): Likewise.
7236 * testsuite/Makefile.in: Regenerated.
7237
adcf2816 72382009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 7239
adcf2816
L
7240 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
7241 (Symbol_table::override_with_special): Likewise.
7242 (Symbol_table::add_from_object): Likewise.
7243
28e67f5d
RÁE
72442009-12-04 Rafael Avila de Espindola <espindola@google.com>
7245
7246 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
7247 Don't set the data_offset twice.
7248
ae10a101
RÁE
72492009-12-04 Rafael Avila de Espindola <espindola@google.com>
7250
7251 * testsuite/Makefile.in: Regenerate.
7252
f59f41f3
DK
72532009-12-03 Doug Kwan <dougkwan@google.com>
7254
7255 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
7256 (Target_arm::do_finalize_sections): Add parameter for symbol table
7257 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
7258 * i386.cc (Target_i386::do_finalize_sections): Add an additional
7259 parameter for symbol table pointer.
7260 * layout.cc (Layout::finalize): Call Target::finalize_sections with
7261 an additional parameter for a pointer to symbol table.
7262 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
7263 parameter for a symbol table pointer.
7264 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
7265 * target.h (Target::finalize_sections, Target::do_finalize_sections):
7266 Ditto.
7267 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
7268 parameter for a symbol table pointer.
7269
ca55d848
RÁE
72702009-12-03 Rafael Avila de Espindola <espindola@google.com>
7271
7272 * incremental.cc (Incremental_inputs_header)
7273 (Incremental_inputs_header_write, Incremental_inputs_entry)
7274 (Incremental_inputs_entry_write): Move ...
7275 * incremental.h (Incremental_inputs_header)
7276 (Incremental_inputs_header_write, Incremental_inputs_entry)
7277 (Incremental_inputs_entry_write): here.
7278
3aec4f9c
RÁE
72792009-12-02 Rafael Avila de Espindola <espindola@google.com>
7280
7281 * incremental.cc (make_sized_incremental_binary): Set the target.
7282 Error if it is incompatible.
7283 * output.h (Output_file): Add filename method.
7284
9c0ae74d
RÁE
72852009-12-02 Rafael Avila de Espindola <espindola@google.com>
7286
7287 * incremental.cc (Incremental_inputs_entry): Remove unused argument
7288 from the get_* methods.
7289
a45500ae
RÁE
72902009-12-02 Rafael Avila de Espindola <espindola@google.com>
7291
7292 * incremental-dump.cc (main): Check that the offeset of a script is 0.
7293 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
7294 Write 0 for the data_offset of scripts.
7295
325e6408
RÁE
72962009-12-02 Rafael Avila de Espindola <espindola@google.com>
7297
7298 * testsuite/Makefile.am: Add the incremental_test.sh test.
7299 * testsuite/incremental_test.sh: New.
7300 * testsuite/incremental_test_1.c: New.
7301 * testsuite/incremental_test_2.c: New.
7302
954c3e2e
RÁE
73032009-12-01 Rafael Avila de Espindola <espindola@google.com>
7304
7305 * incremental-dump.cc (main): Fix typos.
7306
f8086623
RÁE
73072009-11-27 Rafael Avila de Espindola <espindola@google.com>
7308
7309 PR gold/11025
7310 * incremental-dump.cc (main): Use llu to print 64 bit values.
7311
3b0dd6ac
L
73122009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
7313 H.J. Lu <hongjiu.lu@intel.com>
7314
7315 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
7316 $(LIBDL).
7317 (incremental_dump_LDADD): Likewise.
7318 * Makefile.in: Regenerated.
7319
a6d1ef57 73202009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 7321
a6d1ef57
DK
7322 Revert:
7323
7324 2009-11-25 Doug Kwan <dougkwan@google.com>
7325
7326 * arm.cc (Target_arm::Target_arm): Move method definition
7327 outside of class definition. Add code to handle
7328 --target1-rel, --target1-abs and --target2= options.
7329 (Target_arm::get_reloc_reloc_type): Change method to be
7330 non-static and const.
7331 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
7332 New data member declaration.
7333 (Target_arm::Scan::local, Target_arm::Scan::global,
7334 Target_arm::Relocate::relocate,
7335 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7336 Adjust call to Target_arm::get_real_reloc_type.
7337 (Target_arm::get_real_reloc_type): Use command line options
7338 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
7339 * options.h (--target1-rel, --target1-abs, --target2): New
7340 ARM-only options.
7341
50aeb7d4
DK
73422009-11-25 Doug Kwan <dougkwan@google.com>
7343
7344 * arm.cc (Target_arm::Target_arm): Move method definition outside of
7345 class definition. Add code to handle --target1-rel, --target1-abs
7346 and --target2= options.
7347 (Target_arm::get_reloc_reloc_type): Change method to be non-static
7348 and const.
7349 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
7350 member declaration.
7351 (Target_arm::Scan::local, Target_arm::Scan::global,
7352 Target_arm::Relocate::relocate,
7353 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
7354 call to Target_arm::get_real_reloc_type.
7355 (Target_arm::get_real_reloc_type): Use command line options to
7356 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
7357 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
7358 options.
7359
51938283
DK
73602009-11-25 Doug Kwan <dougkwan@google.com>
7361
7362 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
7363 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
7364 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
7365 formatting.
7366 (Arm_relocate_functions::thm_call): Replace body with a call to
7367 Arm_relocate_functions::thumb_branch_common.
7368 (Arm_relocate_functions::thm_jump24,
7369 Arm_relocate_functions::thm_xpc22): New method definitions.
7370 (Arm_relocate_functions::thumb_branch_common): New method definition.
7371 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
7372 operator.
7373 (Target_arm::Relocate::relocate): Adjust call to thm_call.
7374 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
7375
e2b8f3c4
RÁE
73762009-11-24 Rafael Avila de Espindola <espindola@google.com>
7377
7378 * Makefile.am: Build incremental-dump
7379 * Makefile.in: Regenerate.
7380 * incremental-dump.cc: New.
7381 * incremental.cc (Incremental_inputs_header_data,
7382 Incremental_inputs_entry_data): Move to incremental.h
7383 * incremental.h: (Incremental_inputs_header_data,
7384 Incremental_inputs_entry_data): Move from incremental.cc
7385
bcba9aec
RÁE
73862009-11-24 Rafael Avila de Espindola <espindola@google.com>
7387
7388 * incremental.cc (Incremental_inputs_header,
7389 Incremental_inputs_header_write, Incremental_inputs_entry,
7390 Incremental_inputs_entry_write): Add a typedef with the data type.
7391
7c3afe08
RÁE
73922009-11-24 Rafael Avila de Espindola <espindola@google.com>
7393
7394 * incremental.cc (Incremental_inputs_header,
7395 Incremental_inputs_header_write, Incremental_inputs_entry,
7396 Incremental_inputs_entry_write): Update comment about which
7397 type has the filed descriptions.
7398
d204b6e9
DK
73992009-11-15 Doug Kwan <dougkwan@google.com>
7400
7401 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
7402 (Arm_relocate_functions::arm_branch_common): Change method defintion
7403 in class definition to a method declaration and update list of formal
7404 parameters.
7405 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
7406 Arm_relocation_functions::jump24): Adjust call to
7407 Arm_relocate_functions::arm_branch_common. Update list of formal
7408 parameters.
7409 (Arm_relocate_functions::xpc25): New method definition.
7410 (Arm_relocate_functions::arm_branch_common): Move method defintion
7411 out from class definition. Use stubs for mode-switching and extending
7412 branch ranges.
7413 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
7414 specially. Change code to enable use of stubs in ARM branches.
7415
43d12afe
DK
74162009-11-10 Doug Kwan <dougkwan@google.com>
7417
7418 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
7419 in method declaration.
7420 (Target_arm::relocate_stub): New method declaration.
7421 (Target_arm::default_target): Change to return a pointer instead of
7422 a const reference.
7423 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
7424 Target_arm::default_target.
7425 (Arm_Relobj::do_relocate_sections): Remove options paramater in
7426 method definition.
7427 (Target_arm::relocate_section): Adjust view.
7428 (Target_arm::relocate_stub): New method definition.
7429
ac33a407
DK
74302009-11-10 Doug Kwan <dougkwan@google.com>
7431
7432 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
7433 a format warning.
7434 * incremental.cc (open_incremental_binary): Initialized local
7435 variables to avoid warnings.
7436 * object.cc (make_elf_object): Ditto.
7437 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
7438 a format warning.
e1df38aa 7439
88ee28e9
L
7440009-11-09 H.J. Lu <hongjiu.lu@intel.com>
7441
7442 PR gold/10930
7443 * testsuite/plugin_test.c: Include "config.h".
7444
2daedcd6
DK
74452009-11-09 Doug Kwan <dougkwan@google.com>
7446
7447 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
7448 (arm_symbol_value): Remove.
7449 (Arm_relocate_functions::arm_branch_common,
7450 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
7451 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
7452 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
7453 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
7454 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
7455 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
7456 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
7457 Arm_relocate_functions::thm_mobw_abs_nc,
7458 Arm_relocate_functions::thm_mov_abs,
7459 Arm_relocate_functions::movw_prel_nc,
7460 Arm_relocate_functions::thm_movt_abs,
7461 Arm_relocate_functions::movt_prel,
7462 Arm_relocate_functions::thm_movw_prel_nc,
7463 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
7464 (Target_arm::Relocate::relocate): Only decompose address into two
7465 parts if relocation type uses the thumb-bit and pass the actual
7466 bit instead of a flag indicating that the thumb-bit is used. Adjust
7467 calls to methods in Arm_relocate_functions for this change.
7468
1276bc89 74692009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
7470
7471 PR 10925
7472 * reloc.cc: Instantiate
7473 Sized_relobj::initialize_input_to_output_maps and
7474 Sized_relobj:free_input_to_output_maps.
7475
e53ad1b5
ILT
74762009-11-06 Ian Lance Taylor <iant@google.com>
7477
7478 PR 10876
7479 * defstd.cc (in_segment): Set only_if_ref true for "end".
7480
eb44217c
DK
74812009-11-06 Doug Kwan <dougkwan@google.com>
7482
7483 * arm.cc (class Reloc_stub): Correct a comment.
7484 (Target_arm::Target_arm): Initialize arm_input_section_map_.
7485 (Target_arm::scan_section_for_stubs): New method declaration.
7486 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
7487 Change methods from private to protected.
7488 (Target_arm::do_may_relax): New method definition.
7489 (Target_arm::do_relax, Target_arm::group_sections,
7490 Target_arm::scan_reloc_for_stub,
7491 Target_arm::scan_reloc_section_for_stubs): New method declarations.
7492 (Target_arm::arm_input_section_map_): New data member declaration.
7493 (Target_arm::scan_reloc_for_stub,
7494 Target_arm::scan_reloc_section_for_stubs,
7495 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
7496 Target_arm::do_relax): New method definitions.
7497
5d329b7d
ILT
74982009-11-06 Mikolaj Zalewski <mikolaj@google.com>
7499
7500 * configure.ac: Check for (struct stat)::st_mtim
7501 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
7502 * config.in: Regenerate.
7503 * configure: Regenerate.
7504
96a0d71b
ILT
75052009-11-05 Ian Lance Taylor <iant@google.com>
7506
7507 PR 10910
7508 * output.cc (Output_segment::add_output_section): Add missing
7509 return statement.
7510
594c8e5e
ILT
75112009-11-04 Ian Lance Taylor <iant@google.com>
7512
7513 PR 10880
7514 * object.h (class Object): Add is_needed and set_is_needed
7515 methods. Add is_needed_ field. Make bool fields into bitfields.
7516 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
7517 defined in a dynamic object and referenced by a regular object,
7518 set is_needed for the dynamic object.
7519 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
7520 if the file is marked with as_needed and it is not needed.
7521
22b127cc
ILT
75222009-11-04 Ian Lance Taylor <iant@google.com>
7523
7524 PR 10887
7525 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
7526 tags if data is discarded by linker script.
7527 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7528 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
7529 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
7530 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7531
f5c870d2
ILT
75322009-11-04 Ian Lance Taylor <iant@google.com>
7533
7534 * layout.cc (Layout::get_output_section): Add is_interp and
7535 is_dynamic_linker_section parameters. Change all callers.
7536 (Layout::choose_output_section): Likewise.
7537 (Layout::make_output_section): Likewise.
7538 (Layout::add_output_section_data): Add is_dynamic_linker_section
7539 parameter. Change all callers.
7540 * layout.h (class Layout): Update declarations.
7541 * output.h (class Output_section): Add is_interp, set_is_interp,
7542 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
7543 Add is_interp_, is_dynamic_linker_section_ fields. Change
7544 generate_code_fills_at_write_ to a bitfield.
7545 * output.cc (Output_section::Output_sections): Initialize new
7546 fields.
7547 (Output_segment::add_output_section): Add do_sort parameter.
7548 Change all callers.
7549
1ae4d23b
ILT
75502009-11-03 Ian Lance Taylor <iant@google.com>
7551
7552 PR 10860
7553 * options.h (class General_options): Add --warn-common.
7554 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
7555 merging two common symbols.
7556 (Symbol_table::should_override): Handle --warn-common when merging
7557 a common symbol with a defined symbol. Use report_resolve_problem
7558 for multiple definitions.
7559 (Symbol_table::report_resolve_problem): New function.
7560 * symtab.h (class Symbol_table): Declare report_resolve_problem.
7561
55da9579
DK
75622009-11-03 Doug Kwan <dougkwan@google.com>
7563
7564 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
7565 stub_factory_.
7566 (Target_arm::stub_factory): New method definition.
7567 (Target_arm::new_arm_input_section,
7568 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
7569 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 7570 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
7571 New type definitions.
7572 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
7573 member declarations.
7574 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
7575 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
7576 New method definitions.
7577
37a9ac43
ILT
75782009-11-03 Ian Lance Taylor <iant@google.com>
7579
7580 * options.h (class General_options): Add --warn_constructors.
7581
b3d6a3d4
ILT
75822009-11-03 Ian Lance Taylor <iant@google.com>
7583
7584 PR 10893
7585 * defstd.cc (in_section): Add entries for __rel_iplt_start,
7586 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
7587
934b01dd
ILT
75882009-11-03 Ian Lance Taylor <iant@google.com>
7589
7590 PR 10895
7591 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
7592 --msgid-bugs-address.
7593 (install-pdf): New target.
7594 (install-data_yes): Look up one directory to find mkinstalldirs.
7595
03c1939b
L
75962009-11-03 H.J. Lu <hongjiu.lu@intel.com>
7597
7598 * po/Make-in (.po.gmo): Don't generate .gmo files in source
7599 tree.
7600
ebd95253
DK
76012009-10-30 Doug Kwan <dougkwan@google.com>
7602
7603 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
7604
e9bbb538
DK
76052009-10-30 Doug Kwan <dougkwan@google.com>
7606
7607 * arm.cc (Stub_addend_reader): New struct template definition
7608 and partial specializations.
7609 (Stub_addend_reader::operator()): New method definition for a
7610 partially specialized template.
7611
d5b40221
DK
76122009-10-30 Doug Kwan <dougkwan@google.com>
7613
7614 * arm.cc (Arm_relobj::processor_specific_flags): New method
7615 definition.
7616 (Arm_relobj::do_read_symbols): New method declaration.
7617 (Arm_relobj::processor_specific_flags_): New data member declaration.
7618 (Arm_dynobj): New class definition.
7619 (Target_arm::do_finalize_sections): Add input_objects parameter.
7620 (Target_arm::do_adjust_elf_header): New method declaration.
7621 (Target_arm::are_eabi_versions_compatible,
7622 (Target_arm::merge_processor_specific_flags): New method declaration.
7623 (Target_arm::do_make_elf_object): New overloaded method definitions
7624 and declaration.
7625 (Arm_relobj::do_read_symbols): New method definition.
7626 (Arm_dynobj::do_read_symbols): Ditto.
7627 (Target_arm::do_finalize_sections): Add input_objects parameters.
7628 Merge processor-specific flags from all input objects.
7629 (Target_arm::are_eabi_versions_compatible,
7630 Target_arm::merge_processor_specific_flags,
7631 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
7632 New method definitions.
7633 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
7634 Input_objects pointer type parameter.
7635 * layout.cc (Layout::finalize): Pass input objects to target's.
7636 finalize_sections function.
7637 * output.cc (Output_file_header::do_sized_write): Set ELF file
7638 header's processor-specific flags.
7639 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
7640 Input_objects pointer type parameter.
7641 * sparc.cc (Target_sparc::do_finalize_sections): Same.
7642 * target.h (Input_objects): New forward class declaration.
7643 (Target::processor_specific_flags,
7644 Target::are_processor_specific_flags_sect): New method definitions.
7645 (Target::finalize_sections): Add input_objects parameter.
7646 (Target::Target): Initialize processor_specific_flags_ and
7647 are_processor_specific_flags_set_.
7648 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
7649 parameter.
7650 (Target::set_processor_specific_flags): New method definition.
7651 (Target::processor_specific_flags_,
7652 Target::are_processor_specific_flags_set_): New data member
7653 declarations.
7654 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
7655 Input_objects pointer type parameter.
7656
ebabffbd
DK
76572009-10-30 Doug Kwan <dougkwan@google.com>
7658
7659 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
7660
ad0f2072
ILT
76612009-10-28 Ian Lance Taylor <iant@google.com>
7662
7663 * object.h (class Relobj): Drop options parameter from
7664 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
7665 do_scan_relocs, do_relocate. Change all callers.
7666 (class Sized_relobj): Drop options parameters from
7667 do_gc_process_relocs, do_scan_relocs, do_relocate,
7668 do_relocate_sections, relocate_sections, emit_relocs_scan,
7669 emit_relocs_scan_reltype. Change all callers.
7670 (struct Relocate_info): Remove options field and all references to
7671 it.
7672 * reloc.h (class Read_relocs): Remove options constructor
7673 parameter and options_ field. Change all callers.
7674 (class Gc_process_relocs, class Scan_relocs): Likewise.
7675 (class Relocate_task): Likewise.
7676 * target-reloc.h (scan_relocs): Remove options parameter. Change
7677 all callers.
7678 (scan_relocatable_relocs): Likewise.
7679 * target.h (class Sized_target): Remove options parameter from
7680 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
7681 all callers.
7682 * gc.h (gc_process_relocs): Remove options parameter. Change all
7683 callers.
7684 * arm.cc: Update functions to remove options parameters.
7685 * i386.cc: Likewise.
7686 * powerpc.cc: Likewise.
7687 * sparc.cc: Likewise.
7688 * x86_64.cc: Likewise.
7689 * testsuite/testfile.cc: Likewise.
7690
8ffa3667
DK
76912009-10-28 Doug Kwan <dougkwan@google.com>
7692
7693 * arm.cc (Arm_relobj): New class definition.
e1df38aa 7694 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
7695 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
7696 New method definitions.
7697
40f36857
CC
76982009-10-28 Cary Coutant <ccoutant@google.com>
7699
7700 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
7701 (Plugin::cleanup_done_): New member.
7702 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
7703 (Plugin_manager::cleanup_done_): Remove.
7704 (Plugin_manager::add_input_file): Edit error message.
7705 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
7706 (Plugin_manager::cleanup): Remove use of cleanup_done_.
7707
2c849493
ILT
77082009-10-27 Mikolaj Zalewski <mikolajz@google.com>
7709
7710 * fileread.cc: (File_read::View::~View): Use the new
7711 data_ownership_ filed.
7712 (File_read::~File_read): Dispose the new whole_file_view_.
7713 (File_read::open): Mmap the whole file if needed.
7714 (File_read::open): Use whole_file_view_ instead of contents_.
7715 (File_read::find_view): Use whole_file_view_ if applicable.
7716 (File_read::do_read): Use whole_file_view_ instead of contents_.
7717 (File_read::make_view): Use whole_file_view_ instead of contents_,
7718 update File_read::View::View call.
7719 (File_read::find_or_make_view): Update File_read::View::View
7720 call.
7721 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
7722 remove contents_
7723 (File_read::View::Data_ownership): New enum.
7724 (File_read::View::View): Replace bool mapped_ with Data_ownership
7725 argument.
7726 (File_read::View::mapped_): Remove (replaced by data_ownership_).
7727 (File_read::View::data_ownership_): New field.
7728 (File_read::contents_): Remove (replaced by whole_file_view_).
7729 (File_read::whole_file_view_): New field.
7730 * options.h (class General_options): Add --keep-files-mapped.
7731
24998053
CC
77322009-10-27 Cary Coutant <ccoutant@google.com>
7733
7734 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
7735 * testsuite/Makefile.am (plugin_test_5): New test case.
7736 * testsuite/Makefile.in: Regenerate.
7737
72adc4fa
DK
77382009-10-25 Doug Kwan <dougkwan@google.com>
7739
7740 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
7741 from private to protected to allow access by child class.
7742 (Sized_relobj::do_relocate_sections): New method declaration.
7743 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 7744 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
7745 Sized_relobj::relocate_sections. Instantiate template explicitly
7746 for different target sizes and endianity.
7747
07f508a2
DK
77482009-10-24 Doug Kwan <dougkwan@google.com>
7749
7750 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
7751 (Arm_input_section::as_arm_input_section): New method.
7752 (Arm_output_section): New class definition.
7753 (Arm_output_section::create_stub_group,
7754 Arm_output_section::group_sections): New method definitions.
7755
10ad9fe5
DK
77562009-10-22 Doug Kwan <dougkwan@google.com>
7757
7758 * arm.cc (Arm_input_section): New class definition.
7759 (Arm_input_section::init, Arm_input_section:do_write,
7760 Arm_input_section::set_final_data_size,
7761 Arm_input_section::do_reset_address_and_file_offset): New method
7762 definitions.
7763
56ee5e00
DK
77642009-10-21 Doug Kwan <dougkwan@google.com>
7765
7766 * arm.cc (Stub_table, Arm_input_section): New forward class
7767 declarations.
7768 (Stub_table): New class defintion.
7769 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
7770 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
7771 New method definition.
7772
b569affa
DK
77732009-10-21 Doug Kwan <dougkwan@google.com>
7774
7775 * arm.cc: Update copyright comments.
7776 (Target_arm): New forward class template declaration.
7777 (Arm_address): New type.
7778 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
7779 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
7780 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
7781 constants.
7782 (Insn_template): Same.
7783 (DEF_STUBS): New macro.
7784 (Stub_type): New enum type.
7785 (Stub_template): New class definition.
7786 (Stub): Same.
7787 (Reloc_stub): Same.
7788 (Stub_factory): Same.
7789 (Target_arm::Target_arm): Initialize may_use_blx_ and
7790 should_force_pic_veneer_.
7791 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
7792 Target_arm::should_force_pic_veneer,
7793 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
7794 Target_arm::using_thumb_only, Target_arm:;default_target): New
7795 method defintions.
7796 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
7797 New data member declarations.
7798 (Insn_template::size, Insn_template::alignment): New method defintions.
7799 (Stub_template::Stub_template): New method definition.
7800 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
7801 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
7802 (Stub_factory::Stub_factory): New method definition.
7803 * gold.h (string_hash): New template.
7804 * output.h (Input_section_specifier::hash_value): Use
7805 gold::string_hash.
7806 (Input_section_specifier::string_hash): Remove.
7807 * stringpool.cc (Stringpool_template::string_hash): Use
7808 gold::string_hash.
7809
6c172549
DK
78102009-10-20 Doug Kwan <dougkwan@google.com>
7811
7812 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
7813 symbols of relaxed input sections.
7814 * output.h (Output_section::find_relaxed_input_section): Make
7815 method public.
7816
c5617f2f
DK
78172009-10-16 Doug Kwan <dougkwan@google.com>
7818
7819 * dynobj.cc (Versions::Versions): Initialize version_script_.
7820 Only insert base version symbol definition for a shared object
7821 if version script defines any version versions.
7822 (Versions::define_base_version): New method definition.
7823 (Versions::add_def): Check that base version is not needed.
7824 (Versions::add_need): Define base version lazily.
7825 * dynobj.h (Versions::define_base_version): New method declaration.
7826 (Versions::needs_base_version_): New data member declaration.
7827 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
7828 (check_DATA): Add no_version_test.stdout.
7829 (libno_version_test.so, no_version_test.o no_version_test.stdout):
7830 New make rules.
7831 * testsuite/Makefile.in: Regenerate.
7832 * testsuite/no_version_test.c: New file.
7833 * testsuite/no_version_test.sh: Ditto.
7834
3c12dcdb
DK
78352009-10-16 Doug Kwan <dougkwan@google.com>
7836
7837 * expression.cc (class Segment_start_expression): New class definition.
7838 (Segment_start_expression::value): New method definition.
7839 (script_exp_function_segment_start): Return a new
7840 Segment_start_expression.
7841 * gold/script-c.h (script_saw_segment_start_expression): New function
7842 prototype.
7843 * script-sections.cc (Script_sections::Script_sections): Initialize
7844 SAW_SEGMENT_START_EXPRESSION_ to false.
7845 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
7846 and -Tbbs options to specify section addresses if given in
7847 command line and no SEGMENT_START expression is seen in a script.
7848 * script-sections.h (Script_sections::saw_segment_start_expression,
7849 Script_sections::set_saw_segment_start_expression): New method
7850 definition.
7851 (Script_sections::saw_segment_start_expression_): New data member
7852 declaration.
7853 * script.cc (script_saw_segment_start_expression): New function.
7854 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
7855 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
7856 script_test_7.sh and script_test_8.sh.
7857 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
7858 script_test_8.stdout.
7859 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
7860 (script_test_6, script_test_6.stdout, script_test_7,
7861 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
7862 * Makefile.in: Regenerate.
7863 * testsuite/script_test_6.sh: New file.
7864 * testsuite/script_test_6.t: Same.
7865 * testsuite/script_test_7.sh: Same.
7866 * testsuite/script_test_7.t: Same.
7867 * testsuite/script_test_8.sh: Same.
7868
64b1ae37
DK
78692009-10-16 Doug Kwan <dougkwan@google.com>
7870
7871 * output.cc (Output_segment::set_section_list_address): Cast
7872 expressions to unsigned long long type to avoid format warnings.
7873
661be1e2
ILT
78742009-10-15 Ian Lance Taylor <iant@google.com>
7875
12edd763 7876 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 7877 dot assignment to script_sections_.
12edd763
ILT
7878 * script-sections.cc (Script_sections::add_dot_assignment):
7879 Initialize if necessary.
7880
68b6574b
ILT
7881 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
7882 program headers with no load segment if there is a linker script.
7883
661be1e2
ILT
7884 * layout.cc (Layout::set_segment_offsets): Align the file offset
7885 to the segment aligment for -N or -n with no load segment.
7886 * output.cc (Output_segment::add_output_section): Don't crash if
7887 the first section is a TLS section.
7888 (Output_segment::set_section_list_addresses): Print an error
7889 message if the address moves backward in a linker script.
7890 * script-sections.cc
7891 (Output_section_element_input::set_section_addresses): Don't
7892 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
7893 (Orphan_output_section::set_section_addresses): Likewise.
7894
f15f61a7
DK
78952009-10-15 Doug Kwan <dougkwan@google.com>
7896
7897 * layout.cc (Layout::finish_dynamic_section): Generate tags
7898 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
7899 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
7900 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
7901
82bb573a
ILT
79022009-10-14 Ian Lance Taylor <iant@google.com>
7903
7904 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
7905 fields.
7906 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
7907 data_shdr fields of relinfo.
7908 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
7909 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
7910 R_386_TLS_LDO_32, adjust based on section flags.
7911 (Target_i386::Relocate::fix_up_ldo): Remove.
7912
374ad285
ILT
79132009-10-13 Ian Lance Taylor <iant@google.com>
7914
7915 Add support for -pie.
7916 * options.h (class General_options): Add -pie and
7917 --pic-executable.
7918 (General_options::output_is_position_independent): Test -pie.
7919 (General_options::output_is_executable): Return true if not shared
7920 and not relocatable.
7921 (General_options::output_is_pie): Remove.
7922 * options.cc (General_options::finalize): Reject incompatible uses
7923 of -pie.
7924 * gold.cc (queue_middle_tasks): A -pie link is not static.
7925 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
7926 * symtab.cc (Symbol::final_value_is_known): Return false if
7927 output_is_position_independent.
7928 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
7929 output_is_position_independent.
7930 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
7931 output_is_position_independent.
7932 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
7933 output_is_position_independent.
7934 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
7935 two_file_pie_test.
7936 (basic_pie_test.o, basic_pie_test): New targets.
7937 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
7938 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
7939 (two_file_pie_test): New target.
7940 * testsuite/Makefile.in: Rebuild.
7941 * README: Remove note saying that -pie is not supported.
7942
c6585162
ILT
79432009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
7944
7945 * options.h (class General_options): Add -init and -fini.
7946 * layout.cc (Layout::finish_dynamic_section): Emit
7947 given init and fini functions.
7948
032ce4e9
ST
79492009-10-13 Sriraman Tallam <tmsriram@google.com>
7950
7951 * gc.h (gc_process_relocs): Check if icf is enabled using new
7952 function.
7953 * gold.cc (queue_initial_tasks): Likewise.
7954 (queue_middle_tasks): Likewise.
7955 * object.cc (do_layout): Likewise.
7956 * symtab.cc (is_section_folded): Likewise.
7957 * main.cc (main): Likewise.
7958 * reloc.cc (Read_relocs::run): Likewise.
7959 (Sized_relobj::do_scan_relocs): Likewise.
7960 * icf.cc (is_function_ctor_or_dtor): New function.
7961 (Icf::find_identical_sections): Check if function is ctor or dtor when
7962 safe icf is chosen.
7963 * options.h (General_options::icf): Change option to be an enum.
7964 (Icf_status): New enum.
7965 (icf_enabled): New method.
7966 (icf_safe_folding): New method.
7967 (set_icf_status): New method.
7968 (icf_status_): New variable.
7969 * (options.cc) (General_options::finalize): Set icf_status_.
7970 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
7971 icf_test and icf_keep_unique_test to use the --icf enum flag.
7972 * testsuite/icf_safe_test.sh: New file.
e1df38aa 7973 * testsuite/icf_safe_test.cc: New file.
032ce4e9 7974
f345227a
ST
79752009-10-12 Sriraman Tallam <tmsriram@google.com>
7976
7977 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
7978 includes to gc.h and icf.h.
7979 * arm.cc: Include gc.h.
7980 * gold.cc: Likewise.
7981 * i386.cc: Likewise.
7982 * powerpc.cc: Likewise.
7983 * sparc.cc: Likewise.
7984 * x86_64.cc: Likewise.
7985 * gc.h: Include icf.h.
7986
1c7814ed
ILT
79872009-10-11 Ian Lance Taylor <iant@google.com>
7988
7989 * plugin.cc: Include "gold.h" before other header files.
7990
ae3b5189
CD
79912009-10-10 Chris Demetriou <cgd@google.com>
7992
7993 * options.h (Input_file_argument::Input_file_type): New enum.
7994 (Input_file_argument::is_lib_): Replace with...
7995 (Input_file_argument::type_): New member.
7996 (Input_file_argument::Input_file_argument): Take Input_file_type
7997 'type' rather than boolean 'is_lib' as second argument.
7998 (Input_file_argument::is_lib): Use type_.
7999 (Input_file_argument::is_searched_file): New function.
8000 (Input_file_argument::may_need_search): Handle is_searched_file.
8001 * options.cc (General_options::parse_library): Support -l:filename.
8002 (General_options::parse_just_symbols): Update for Input_file_argument
8003 changes.
8004 (Command_line::process): Likewise.
8005 * archive.cc (Archive::get_file_and_offset): Likewise.
8006 * plugin.cc (Plugin_manager::release_input_file): Likewise.
8007 * script.cc (read_script_file, script_add_file): Likewise.
8008 * fileread.cc (Input_file::Input_file): Likewise.
8009 (Input_file::will_search_for): Handle is_searched_file.
8010 (Input_file::open): Likewise.
8011 * readsyms.cc (Read_symbols::get_name): Likewise.
8012 * testsuite/Makefile.am (searched_file_test): New test.
8013 * testsuite/Makefile.in: Regenerate.
8014 * testsuite/searched_file_test.cc: New file.
8015 * testsuite/searched_file_test_lib.cc: New file.
8016
f3048a1d
ILT
80172009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8018 Ian Lance Taylor <iant@google.com>
8019
8020 * descriptor.cc: Include <cstdio> and "binary-io.h".
8021 (Descriptors::open): Open the files in binary mode always.
8022 * script.cc (Lex::get_token): Treat \r as whitespace.
8023
d4780e57
ILT
80242009-10-09 Ian Lance Taylor <iant@google.com>
8025
8026 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
8027
d9a893b8
ILT
80282009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8029 Ian Lance Taylor <iant@google.com>
8030
8031 * configure.ac: Check for readv function also.
8032 * fileread.cc (readv): Define if not HAVE_READV.
8033 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
8034 does not exist.
8035 * config.in: Regenerate.
8036 * configure: Regenerate.
8037
c0a62865
DK
80382009-10-09 Doug Kwan <dougkwan@google.com>
8039
8040 * layout.cc (Layout::make_output_section): Call target hook to make
8041 ordinary output section.
8042 (Layout::finalize): Adjust parameter list of call the
8043 Target::may_relax().
8044 * layout.h (class Layout::section_list): New method.
8045 * merge.h (Output_merge_base::entsize): Change visibility to public.
8046 (Output_merge_base::is_string, Output_merge_base::do_is_string):
8047 New methods.
8048 (Output_merge_string::do_is_string): New method.
8049 * object.cc (Sized_relobj::do_setup): renamed from
8050 Sized_relobj::set_up.
8051 * object.h (Sized_relobj::adjust_shndx,
8052 Sized_relobj::initializ_input_to_output_maps,
8053 Sized_relobj::free_input_to_output_maps): Change visibilities to
8054 protected.
8055 (Sized_relobj::setup): Virtualize.
8056 (Sized_relobj::do_setup): New method declaration.
8057 (Sized_relobj::invalidate_section_offset,
8058 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
8059 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
8060 * options.cc (parse_int): New function.
8061 * options.h (parse_int): New declaration.
8062 (DEFINE_int): New macro.
8063 (stub_group_size): New option.
8064 * output.cc (Output_section::Output_section): Initialize memebers
8065 merge_section_map_, merge_section_by_properties_map_,
8066 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
8067 (Output_section::add_input_section): Handled deferred code-fill
8068 generation and remove an old comment.
8069 (Output_section::add_relaxed_input_section): New method definition.
8070 (Output_section::add_merge_input_section): Use merge section by
8071 properties map to speed to search. Update merge section maps
8072 as appropriate.
8073 (Output_section::build_relaxation_map): New method definition.
8074 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8075 Same.
8076 (Output_section::relax_input_section): Renamed to
8077 Output_section::convert_input_sections_to_relaxed_sections and change
8078 interface to take a vector of pointers to relaxed sections.
8079 (Output_section::find_merge_section,
8080 Output_section::find_relaxed_input_section): New method definitions.
8081 (Output_section::is_input_address_mapped,
8082 Output_section::output_offset, Output_section::output_address):
8083 Use output section data maps to speed up searching.
8084 (Output_section::find_starting_output_address): Add comments.
8085 (Output_section::do_write,
8086 Output_section::write_to_postprocessing_buffer): Do code-fill
8087 generation as appropriate.
8088 (Output_section::get_input_sections): Invalidate relaxed input section
8089 map.
8090 (Output_section::restore_states): Adjust type of checkpoint .
8091 Invalidate relaxed input section map.
8092 * output.h (Output_merge_base): New class declaration.
8093 (Input_section_specifier): New class defintion.
8094 (class Output_relaxed_input_section) Change base class to
8095 Output_section_data_build.
8096 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
8097 base class initializer.
8098 (Output_section::add_relaxed_input_section): New method declaration.
8099 (Output_section::Input_section): Change visibility to protected.
8100 (Output_section::Input_section::relobj,
8101 Output_section::Input_section::shndx): Handle relaxed input sections.
8102 Output_section::input_sections) Change visibility to protected. Also
8103 define overload to return a non-const pointer.
8104 (Output_section::Merge_section_properties): New class defintion.
8105 (Output_section::Merge_section_by_properties_map,
8106 Output_section::Output_section_data_by_input_section_map,
8107 Output_section::Relaxation_map): New types.
8108 (Output_section::relax_input_section): Rename method to
8109 Output_section::convert_input_sections_to_relaxed_sections and change
8110 interface to take a vector of relaxed section pointers.
8111 (Output_section::find_merge_section,
8112 Output_section::find_relaxed_input_section,
8113 Output_section::build_relaxation_map,
8114 Output_section::convert_input_sections_in_list_to_relaxed_sections):
8115 New method declarations.
8116 (Output_section::merge_section_map_
8117 Output_section::merge_section_by_properties_map_,
8118 Output_section::relaxed_input_section_map_,
8119 Output_section::is_relaxed_input_section_map_valid_,
8120 Output_section::generate_code_fills_at_write_): New data members.
8121 * script-sections.cc
8122 (Output_section_element_input::set_section_addresses): Call
8123 current_data_size and addralign methods of relaxed input sections.
8124 (Orphan_output_section::set_section_addresses): Call current_data_size
8125 and addralign methods of relaxed input sections.
8126 * symtab.cc (Symbol_table::compute_final_value): Extract template
8127 from the body of Symbol_table::sized_finalize_symbol.
8128 (Symbol_table::sized_finalized_symbol): Call
8129 Symbol_table::compute_final_value.
8130 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
8131 (Symbol_table::compute_final_value): New templated method declaration.
8132 * target.cc (Target::do_make_output_section): New method defintion.
8133 * target.h (Target::make_output_section): New method declaration.
8134 (Target::relax): Add more parameters for input objects, symbol table
8135 and layout. Adjust call to do_relax.
8136 (Target::do_make_output_section): New method declaration.
8137 (Target::do_relax): Add parameters for input objects, symbol table
8138 and layout.
8139
d446d6c4
ILT
81402009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8141
8142 * pread.c: Include stdio.h.
8143
bc06c745
ILT
81442009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8145
8146 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
8147 defined.
8148
75aea3d0
ILT
81492009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8150
8151 * dwarf_reader.cc (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 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
8157 Change read_shndx type to unsigned int.
8158 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
8159 int.
8160 (Sized_dwarf_line_info::read_line_mappings): Likewise.
8161 * layout.cc (Layout::create_symtab_sections): Cast the result of
8162 local_symcount * symsize to off_t in the gold_assert.
8163
be8fcb75
ILT
81642009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8165
8166 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
8167 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
8168 R_ARM_BASE_ABS.
8169 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
8170 (Arm_relocate_functions::thm_abs5): New function.
8171 (Arm_relocate_functions::abs12): New function.
8172 (Arm_relocate_functions::abs16): New function.
8173 (Arm_relocate_functions::base_abs): New function.
8174 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
8175 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
8176 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
8177 R_ARM_BASE_ABS.
8178 (Scan::global): Likewise.
8179 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
8180 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
8181 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
8182 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
8183 R_ARM_BASE_ABS.
8184
c2a122b6
ILT
81852009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8186
8187 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
8188 (Arm_relocate_functions::movt_prel): New function.
8189 (Arm_relocate_functions::thm_movw_prel_nc): New function.
8190 (Arm_relocate_functions::thm_movt_prel): New function.
8191 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
8192 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
8193 (Scan::global, Relocate::relocate): Likewise.
8194 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8195
c4aa1e2d
ILT
81962009-10-09 Mikolaj Zalewski <mikolajz@google.com>
8197
8198 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
8199 Incremental_checker.
8200 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
8201 unsigned int.
8202 (class Incremental_inputs_header): New class.
8203 (Incremental_inputs_header_writer): Edit comment.
8204 (Incremental_inputs_entry): New class.
8205 (Incremental_inputs_entry_writer): Edit comment.
8206 (Sized_incremental_binary::do_find_incremental_inputs_section):
8207 Add *strtab_shndx parameter, fill it.
8208 (Sized_incremental_binary::do_check_inputs): New method.
8209 (Incremental_checker::can_incrementally_link_output_file): Use
8210 Sized_incremental_binary::check_inputs.
8211 (Incremental_inputs::report_command_line): Save command line in
8212 command_line_.
8213 * incremental.h:
8214 (Incremental_binary::find_incremental_inputs_section): New
8215 method.
8216 (Incremental_binary::do_find_incremental_inputs_section): Add
8217 strtab_shndx parameter.
8218 (Incremental_binary::do_check_inputs): New pure virtual method.
8219 (Sized_incremental_binary::do_check_inputs): Declare.
8220 (Incremental_checker::Incremental_checker): Add incremental_inputs
8221 parameter, use it to initialize incremental_inputs_.
8222 (Incremental_checker::incremental_inputs_): New field.
8223 (Incremental_checker::command_line): New method.
8224 (Incremental_checker::inputs): New method.
8225 (Incremental_checker::command_line_): New field.
8226
c549a694
ILT
82272009-10-09 Mikolaj Zalewski <mikolajz@google.com>
8228
8229 * incremental.cc: Include <cstdarg> and "target-select.h".
8230 (vexplain_no_incremental): New function.
8231 (explain_no_incremental): New function.
8232 (Incremental_binary::error): New method.
8233 (Sized_incremental_binary::do_find_incremental_inputs_section): New
8234 method.
8235 (make_sized_incremental_binary): New function.
8236 (open_incremental_binary): New function.
8237 (can_incrementally_link_file): Add checks if output is ELF and has
8238 inputs section.
8239 * incremental.h: Include "elfcpp_file.h" and "output.h".
8240 (Incremental_binary): New class.
8241 (Sized_incremental_binary): New class.
8242 (open_incremental_binary): Declare.
8243 * object.cc (is_elf_object): Use
8244 elfcpp::Elf_recognizer::is_elf_file.
8245 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
8246 * output.h (Output_file::filesize): New method.
8247
fd3c5f0b
ILT
82482009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8249
8250 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
8251 New function.
8252 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
8253 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
8254 function.
8255 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
8256 function.
8257 (Arm_relocate_functions::movw_abs_nc): New function.
8258 (Arm_relocate_functions::movt_abs): New function.
8259 (Arm_relocate_functions::thm_movw_abs_nc): New function.
8260 (Arm_relocate_functions::thm_movt_abs): New function.
8261 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
8262 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
8263 (Scan::global): Likewise.
8264 (Relocate::relocate): Likewise.
8265 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8266
7f5309a5
ILT
82672009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8268
8269 * arm.cc (Arm_relocate_functions::got_prel) New function.
8270 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
8271 (Relocate::relocate): Likewise.
8272 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8273
364c7fa5
ILT
82742009-10-06 Ian Lance Taylor <iant@google.com>
8275
8276 * options.h (class General_options): Define
8277 split_stack_adjust_size parameter.
8278 * object.h (class Object): Add uses_split_stack_ and
8279 has_no_split_stack_ fields. Add uses_split_stack and
8280 has_no_split_stack accessor functions. Declare
8281 handle_split_stack_section.
8282 (class Reloc_symbol_changes): Define.
8283 (class Sized_relobj): Define Function_offsets. Declare
8284 split_stack_adjust, split_stack_adjust_reltype, and
8285 find_functions.
8286 * object.cc (Object::handle_split_stack_section): New function.
8287 (Sized_relobj::do_layout): Call handle_split_stack_section.
8288 * dynobj.cc (Sized_dynobj::do_layout): Call
8289 handle_split_stack_section.
8290 * reloc.cc (Sized_relobj::relocate_sections): Call
8291 split_stack_adjust for executable sections in split_stack
8292 objects. Pass reloc_map to relocate_section.
8293 (Sized_relobj::split_stack_adjust): New function.
8294 (Sized_relobj::split_stack_adjust_reltype): New function.
8295 (Sized_relobj::find_functions): New function.
8296 * target-reloc.h: Include "object.h".
8297 (relocate_section): Add reloc_symbol_changes parameter. Change
8298 all callers.
8299 * target.h (class Target): Add calls_non_split method. Declare
8300 do_calls_non_split virtual method. Declare match_view and
8301 set_view_to_nop.
8302 * target.cc: Include "elfcpp.h".
8303 (Target::do_calls_non_split): New function.
8304 (Target::match_view): New function.
8305 (Target::set_view_to_nop): New function.
8306 * gold.cc (queue_middle_tasks): Give an error if mixing
8307 split-stack and non-split-stack objects with -r.
8308 * i386.cc (Target_i386::relocate_section): Add
8309 reloc_symbol_changes parameter.
8310 (Target_i386::do_calls_non_split): New function.
8311 * x86_64.cc (Target_x86_64::relocate_section): Add
8312 reloc_symbol_changes parameter.
8313 (Target_x86_64::do_calls_non_split): New function.
8314 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
8315 parameter.
8316 * powerpc.cc (Target_powerpc::relocate_section): Add
8317 reloc_symbol_changes parameter.
8318 * sparc.cc (Target_sparc::relocate_section): Add
8319 reloc_symbol_changes parameter.
8320 * configure.ac: Call AM_CONDITIONAL for the default target.
8321 * configure: Rebuild.
8322 * testsuite/Makefile.am (TEST_AS): New variable.
8323 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
8324 (check_DATA): Add split_i386 and split_x86_64 files.
8325 (SPLIT_DEFSYMS): Define.
8326 (split_i386_[1234n].o): New targets.
8327 (split_i386_[124]): New targets.
8328 (split_i386_[1234r].stdout): New targets.
8329 (split_x86_64_[1234n].o): New targets.
8330 (split_x86_64_[124]): New targets.
8331 (split_x86_64_[1234r].stdout): New targets.
8332 (MOSTLYCLEANFILES): Add new executables.
8333 * testsuite/split_i386.sh: New file.
8334 * testsuite/split_x86_64.sh: New file.
8335 * testsuite/split_i386_1.s: New file.
8336 * testsuite/split_i386_2.s: New file.
8337 * testsuite/split_i386_3.s: New file.
8338 * testsuite/split_i386_4.s: New file.
8339 * testsuite/split_i386_n.s: New file.
8340 * testsuite/split_x86_64_1.s: New file.
8341 * testsuite/split_x86_64_2.s: New file.
8342 * testsuite/split_x86_64_3.s: New file.
8343 * testsuite/split_x86_64_4.s: New file.
8344 * testsuite/split_x86_64_n.s: New file.
8345 * testsuite/testfile.cc (Target_test): Update relocation_section
8346 function.
8347 * testsuite/Makefile.in: Rebuild.
8348
e8a9fcda
ILT
83492009-10-06 Ian Lance Taylor <iant@google.com>
8350
8351 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
8352 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
8353 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
8354 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
8355 the address on ldo_addrs_.
8356 (Target_i386::Relocate::fix_up_ldo): New function.
8357
e99daf92
ILT
83582009-10-06 Rafael Espindola <espindola@google.com>
8359
8360 * plugin.cc (add_input_library): New.
8361 (Plugin::load): Add add_input_library to tv.
8362 (Plugin_manager::add_input_file): Add the is_lib argument.
8363 (add_input_file): Update call to Plugin_manager::add_input_file.
8364 (add_input_library): New.
8365 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
8366
966d4097
DK
83672009-09-30 Doug Kwan <dougkwan@google.com>
8368
8369 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
8370 symbol and call Symbol::may_need_copy_reloc to determine if
8371 a copy reloc is needed.
8372 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
8373 nocopyreloc is given in command line.
8374 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
8375 given in command line.
8376 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
8377 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
8378 of the removed Target_i386::may_need_copy_reloc.
8379 * options.h (copyreloc): New option with default value false.
8380 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
8381 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
8382 instead of the removed Target_powerpc::may_need_copy_reloc.
8383 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
8384 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
8385 instead of the removed Target_sparc::may_need_copy_reloc.
8386 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
8387 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
8388 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
8389 instead of the removed Target_x86_64::may_need_copy_reloc.
8390
029ba973
ILT
83912009-09-30 Ian Lance Taylor <iant@google.com>
8392
8393 * object.h (class Object): Remove target_ field, and target,
8394 sized_target, and set_target methods.
8395 (Object::sized_target): Remove.
8396 (class Sized_relobj): Update declarations. Remove sized_target.
8397 * object.cc (Sized_relobj::setup): Remove target parameter.
8398 Change all callers.
8399 (Input_objects::add_object): Don't do anything with the target.
8400 (make_elf_sized_object): Add punconfigured parameter. Change all
8401 callers. Set or test parameter target.
8402 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
8403 Change all callers.
8404 * parameters.cc (Parameters::set_target): Change parameter type to
8405 be non-const.
8406 (Parameters::default_target): Remove.
8407 (set_parameters_target): Change parameter type to be non-const.
8408 (parameters_force_valid_target): New function.
8409 (parameters_clear_target): New function.
8410 * parameters.h (class Parameters): Update declarations. Remove
8411 default_target method. Add sized_target and clear_target
8412 methods. Change target_ to be non-const.
8413 (set_parameters_target): Update declaration.
8414 (parameters_force_valid_target): Declare.
8415 (parameters_clear_target): Declare.
8416 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
8417 as NULL if we aren't searching.
8418 (Add_symbols::run): Don't check for compatible target.
8419 * fileread.cc (Input_file::open_binary): Call
8420 parameters_force_valid_target.
8421 * gold.cc (queue_middle_tasks): Likewise.
8422 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
8423 set_target on object.
8424 * dynobj.h (class Sized_dynobj): Update declarations.
8425 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
8426 make_elf_object returns NULL.
8427 (Archive::include_member): Don't check whether object target is
8428 compatible.
8429 * output.cc (Output_section::add_input_section): Get target from
8430 parameters.
8431 (Output_section::relax_input_section): Likewise.
8432 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
8433 parameters.
8434 (Sized_relobj::do_scan_relocs): Likewise.
8435 (Sized_relobj::relocate_sections): Likewise.
8436 * resolve.cc (Symbol_table::resolve): Likewise.
8437 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
8438 parameter. Change all callers.
8439 (Symbol_table::add_from_object): Get target from parameters.
8440 (Symbol_table::add_from_relobj): Don't check object target.
8441 (Symbol_table::add_from_dynobj): Likewise.
8442 (Symbol_table::define_special_symbol): Get target from
8443 parameters.
8444 * symtab.h (class Symbol_table): Update declaration.
8445 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
8446 parameter. Change all callers. Clear parameter target.
8447 (Binary_test): Test target here.
8448 * testsuite/object_unittest.cc (gold_testsuite): Remove
8449 target_test_pointer parameter. Change all callers.
8450 (Object_test): Test target here.
8451
a6a22b83
ILT
84522009-09-26 Ian Lance Taylor <iant@google.com>
8453
8454 * testsuite/initpri1.c: Don't try to use constructor priorities if
8455 compiling with gcc before 4.3.
8456
6a8f49fe
ILT
84572009-09-22 Mikolaj Zalewski <mikolajz@google.com>
8458
8459 * testsuite/retain_symbols_file_test.sh (check_present): Change
8460 output file name to retain_symbols_file_test.stdout.
8461 (check_absent): Likewise.
8462
8c604651
CS
84632009-09-18 Craig Silverstein <csilvers@google.com>
8464
8465 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
8466 * options.cc: Include <cerrno> and <fstream>.
8467 (General_options::finalize): Parse -retain-symbols-file tag.
8468 * options.h: New flag.
8469 (General_options): New method should_retain_symbol, new
8470 variable symbols_to_retain.
8471 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
8472 should_retain_symbol map.
8473 * testsuite/Makefile.am (retain_symbols_file_test): New test.
8474 * testsuite/Makefile.in: Regenerate.
8475 * testsuite/retain_symbols_file_test.sh: New file.
8476
ca58b19f
NC
84772009-09-18 Nick Clifton <nickc@redhat.com>
8478
8479 * po/es.po: Updated Spanish translation.
8480
20e6d0d6
DK
84812009-09-17 Doug Kwan <dougkwan@google.com>
8482
8483 * debug.h (DEBUG_RELAXATION): New constant.
8484 (DEBUG_ALL): Add DEBUG_RELAXATION.
8485 (debug_string_to_enum): Add relaxation debug option.
8486 * layout.cc
8487 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
8488 Layout::Relaxation_debug_check::read_sections,
8489 Layout::Relaxation_debug_check::read_sections): New method definitions.
8490 (Layout::Layout): Initialize data members
8491 record_output_section_data_from_scrips_,
8492 script_output_section_data_list_ and relaxation_debug_check_.
8493 (Layout::save_segments, Layout::restore_segments,
8494 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
8495 Layout::relaxation_loop_body): New method definitions.
8496 (Layout::finalize): Support relaxation. Move section layout code to
8497 Layout::relaxation_loop_body.
8498 (Layout::set_asection_address_from_script): Move code for orphan
8499 section placement out.
8500 (Layout::place_orphan_sections_in_script): New method definition.
8501 * layout.h (Output_segment_headers, Output_file_header):
8502 New forward class declarations.
8503 (Layout::~Layout): Define.
8504 (Layout::new_output_section_data_from_script): New method definition.
8505 (Layout::place_orphan_sections_in_script): New method declaration.
8506 (Layout::Segment_states): New type declaration.
8507 (Layout::save_segments, Layout::restore_segments,
8508 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
8509 Layout::relaxation_loop_body): New method declarations.
8510 (Layout::Output_section_data_list): New type declaration.
8511 (Layout::Relaxation_debug_check): New class definition.
8512 (Layout::record_output_section_data_from_script_,
8513 Layout::script_output_section_data_list_, Layout::segment_states_,
8514 Layout::relaxation_debug_check_): New data members.
8515 * output.cc: (Output_section_headers::do_size): New method definition.
8516 (Output_section_headers::Output_section_headers): Move size
8517 computation to Output_section_headers::do_size.
8518 (Output_segment_headers::do_size): New method definition.
e1df38aa 8519 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
8520 Output_file_header::do_size and call it.
8521 (Output_file_header::do_size): New method definition.
8522 (Output_data_group::Output_data_group): Adjust call to
8523 Output_section_data.
8524 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
8525 (Output_symtab_xindex::do_write): Add array bound check.
8526 (Output_section::Input_section::print_to_mapfile): Handle
8527 RELAXED_INPUT_SECTION_CODE.
8528 (Output_section::Output_section): Initialize data member checkpoint_.
8529 (Output_section::~Output_section): Delete checkpoint object pointed
8530 by checkpoint_.
8531 (Output_section::add_input_section): Always add an Input_section if
8532 relaxing.
8533 (Output_section::add_merge_input_section): Add assert.
8534 (Output_section::relax_input_section): New method definition.
8535 (Output_section::set_final_data_size): Set load address to zero for
8536 an unallocated section.
8537 (Output_section::do_address_and_file_offset_have_reset_values):
8538 New method definition.
8539 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
8540 Handle relaxed input section.
8541 (Output_section::sort_attached_input_sections): Checkpoint input
8542 section list lazily.
8543 (Output_section::get_input_sections): Change type of input_sections to
8544 list of Simple_input_section pointers. Checkpoint input section list
8545 lazily. Also handle relaxed input sections.
8546 (Output_section::add_input_section_for_script): Take a reference to
8547 a Simple_input_section object instead of Relobj pointer and section
8548 index as parameter. Handle relaxed input sections.
8549 (Output_section::save_states, Output_section::restore_states): New
8550 method definitions.
8551 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
8552 (Output_data::is_data_size_fixed): New method definition.
8553 (Output_data::reset_addresss_and_file_offset): Do not reset data size
8554 if it is fixed.
8555 (Output_data::address_and_file_offset_have_reset_values): New method
8556 definition.
8557 (Output_data::do_address_and_file_offset_have_reset_values): New method
8558 definition.
8559 (Output_data::set_data_size): Check that data size is not fixed.
8560 (Output_data::fix_data_size): New method definition.
8561 (Output_data::is_data_size_fixed_): New data member.
8562 (Output_section_headers::set_final_data_size): New method definition.
8563 (Output_section_headers::do_size): New method declaration.
8564 (Output_segment_headers::set_final_data_size): New method definition.
8565 (Output_segment_headers::do_size): New method declaration.
8566 (Output_file_header::set_final_data_size)::New method definition.
8567 (Output_file_header::do_size)::New method declaration.
8568 (Output_section_data::Output_section_data): Add new parameter
8569 is_data_size_fixed and use it to fix data size.
8570 (Output_data_const::Output_data_const): Adjust call to base class
8571 constructor and fix data size.
8572 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
8573 base class constructor and fix data size.
8574 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
8575 base class constructor and fix data size.
8576 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
8577 class constructor and fix data size.
8578 (Output_data_group::set_final_data_size): New method definition.
8579 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
8580 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
8581 class constructor and fix data size.
8582 (Output_relaxed_input_section): New class definition.
8583 (Output_section::Simple_input_section): New class definition.
8584 (Output_section::get_input_sections): Adjust parameter list.
8585 (Output_section::add_input_section_for_script): Same.
8586 (Output_section::save_states, Output_section::restore_states,
8587 Output_section::do_address_and_file_offset_have_reset_values,
8588 (Output_section::Input_section::Input_section): Handle
8589 RELAXED_INPUT_SECTION_CODE. Add new overload for
8590 Output_relaxed_input_section.
8591 (Output_section::Input_section::is_input_section,
8592 Output_section::Input_section::set_output_section): Handle relaxed
8593 input section.
8594 (Output_section::Input_section::is_relaxed_input_section,
8595 Output_section::Input_section::output_section_data,
8596 Output_section::Input_section::relaxed_input_section): New method
8597 definitions.
8598 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
8599 value.
8600 (Output_section::Input_section::u1_): Update comments.
8601 (Output_section::Input_section::u2_): Add new union member poris.
8602 (Output_section::Checkpoint_output_section): New classs definition.
8603 (Output_section::relax_input_section): New method declaration.
8604 (Output_section::checkpoint_): New data member.
8605 (Output_segment): Update comments.
8606 (Output_segment::Output_segment): Un-privatize copy constructor.
8607 (Output_segment::operator=): Un-privatize.
8608 * script-sections.cc (Output_section_element::Input_section_list):
8609 Change element type to Output_section::Simple_input_section.
8610 (Output_section_element_dot_assignment::set_section_addresses):
8611 Register output section data for relaxation clean up.
8612 (Output_data_exression::Output_data_expression): Adjust call to base
8613 constructor to fix data size.
8614 (Output_section_element_data::set_section_addresses): Register
8615 Output_data_expression object for relaxation clean up.
8616 (struct Input_section_info): Replace Relobj pointer and section index
8617 pair with Output_section::Simple_input_section and Convert struct to a
8618 class.
8619 (Input_section_sorter::operator()): Adjust access to
e1df38aa 8620 Input_section_info data member to use accessors.
20e6d0d6
DK
8621 (Output_section_element_input::set_section_addresses): Use layout
8622 parameter. Adjust code to use Output_section::Simple_input_section
8623 and Input_secction_info classes. Register filler for relaxation
8624 clean up.
8625 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
8626 and section index pair with Output_section::Simple_input_section
8627 class. Adjust code accordingly.
8628 (Phdrs_element::release_segment): New method definition.
8629 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
8630 segment list.
8631 (Script_sections::release_segments): New method definition.
8632 * gold/script-sections.h (Script_sections::release_segments): New
8633 method declaration.
8634 * gold/target.h (Target::may_relax, Target::relax,
8635 Target::do_may_relax, Target::do_relax): New method definitions.
8636
5e445df6
ILT
86372009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8638
8639 * arm.cc (has_signed_unsigned_overflow): New function.
8640 (Arm_relocate_functions::abs8): New function.
8641 (Target_arm::Scan::local): Handle R_ARM_ABS8.
8642 (Target_arm::Scan::global): Likewise.
8643 (Target_arm::relocate::relocate): Likewise.
8644 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8645 Likewise.
8646
8c604651 86472009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
8648
8649 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
8650 * testsuite/Makefile.in: Regenerate.
8651
1e9cc1c2
NC
86522009-09-11 Nick Clifton <nickc@redhat.com>
8653
8654 * po/gold.pot: Updated by the Translation project.
8655
6a89f575
CC
86562009-09-08 Cary Coutant <ccoutant@google.com>
8657
8658 * output.cc (Output_file::open): Add execute permission to empty file.
8659 * testsuite/Makefile.am (permission_test): New test.
8660 * testsuite/Makefile.in: Regenerate.
8661
fdcac5af
ILT
86622009-09-02 Ian Lance Taylor <iant@google.com>
8663
8664 * output.cc (Output_file::resize): Call map_no_anonymous rather
8665 than map.
8666
44453f85
ILT
86672009-09-01 Mikolaj Zalewski <mikolajz@google.com>
8668
8669 * gold.cc: Include "incremental.h".
8670 (queue_initial_tasks): Call Incremental_checker methods.
8671 * incremental.cc: Include "output.h".
8672 (Incremental_checker::can_incrementally_link_output_file): New
8673 method.
8674 * incremental.h (Incremental_checker): New class.
8675
8676 * output.cc (Output_file::open_for_modification): New method.
8677 (Output_file::map_anonymous): Changed return type to bool. Record
8678 map in base_ field.
8679 (Output_file::map_no_anonymous): New method, broken out of map.
8680 (Output_file::map): Use map_no_anonymous and map_anonymous.
8681 * output.h (class Output_file): Update declarations.
8682
293c1386
CC
86832009-08-24 Cary Coutant <ccoutant@google.com>
8684
8685 * options.h (Command_line::Pre_options): New class.
8686 (Command_line::pre_options): New member.
8687 * options.cc (gold::options::ready_to_register): New variable.
8688 (One_option::register_option): Do nothing if not registering options.
8689 Assert if same short option registered twice.
8690 (General_options::General_options): Turn off option registration when
8691 done constructing.
8692 (Command_line::Pre_options::Pre_options): New constructor.
8693
f773f3d2
CC
86942009-08-24 Cary Coutant <ccoutant@google.com>
8695
06a73cfe
CC
8696 * options.h (General_options::no_keep_memory): Remove incorrect
8697 short option.
f773f3d2 8698
a15af8e2
RW
86992009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8700
8701 * Makefile.am (am__skiplex, am__skipyacc): New.
8702 * Makefile.in: Regenerate.
8703
c462b41b
RW
87042009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8705
14ec8efd
RW
8706 * Makefile.am (AM_CPPFLAGS): Renamed from ...
8707 (INCLUDES): ... this.
8708 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
8709 (AM_CPPFLAGS): Renamed from ...
8710 (INCLUDE): ... this.
8711 * Makefile.in, testsuite/Makefile.in: Regenerate.
8712
81ecdfbb
RW
8713 * Makefile.in: Regenerate.
8714 * aclocal.m4: Likewise.
8715 * config.in: Likewise.
8716 * configure: Likewise.
8717 * testsuite/Makefile.in: Likewise.
8718
c462b41b
RW
8719 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
8720 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
8721 * Makefile.in: Regenerate.
8722 * testsuite/Makefile.in: Regenerate.
8723
2da73f13
CC
87242009-08-19 Cary Coutant <ccoutant@google.com>
8725
8726 * resolve.cc (Symbol_table::resolve): Don't complain about defined
8727 symbols in shared libraries overridden by hidden or internal symbols
8728 in the main program.
8729
2db70501
CD
87302009-08-19 Chris Demetriou <cgd@google.com>
8731
8732 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
8733 checking source file names in error messages.
8734
f733487b
DK
87352009-08-18 Doug Kwan <dougkwan@google.com>
8736
8737 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
8738 an elcpp::Ehdr as parameter. Adjust call to set_target.
8739 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
8740 an elfcpp::Ehdr as parameter.
8741 * object.cc (Object::set_target): Remove the version that looks up
8742 a target and sets it.
8743 (Sized_relobj::setup): Take a Target object instead of
8744 an elfcpp::Ehdr as parameter. Adjust call to set_target.
8745 (make_elf_sized_object): Find target and ask target to
8746 make an ELF object.
8747 * object.h: (Object::set_target): Remove the version that looks up
8748 a target and sets it.
8749 (Sized_relobj::setup): Take a Target object instead of
8750 an elfcpp:Ehdr as parameter.
8751 * target.cc: Include dynobj.h.
8752 (Target::do_make_elf_object_implementation): New.
8753 (Target::do_make_elf_object): New.
8754 * target.h (Target::make_elf_object): New template declaration.
8755 (Target::do_make_elf_object): New method declarations.
8756 (Target::do_make_elf_object_implementation): New template declaration.
8757
cc70f101
ILT
87582009-08-14 Ian Lance Taylor <iant@google.com>
8759
8760 * gold.h (FUNCTION_NAME): Define.
8761 (gold_unreachable): Use FUNCTION_NAME.
8762
ef5e0cb1
ST
87632009-08-12 Sriraman Tallam <tmsriram@google.com>
8764
8765 * icf.cc (Icf::find_identical_sections): Issue a warning when a
8766 symbol in the --keep-unique list is not found.
8767
48c187ce
ST
87682009-08-12 Sriraman Tallam <tmsriram@google.com>
8769
8770 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
8771 been maked as --keep-unique.
8772 (Icf::unfold_section): New function.
8773 * icf.h (Icf::unfold_section): New function.
8774 * options.h (General_options::keep_unique): New option.
8775 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
8776 * testsuite/Makefile.in: Regenerate.
8777 * testsuite/icf_keep_unique_test.sh: New file.
8778 * testsuite/icf_keep_unique_test.cc: New file.
8779
645afe0c
CC
87802009-08-12 Cary Coutant <ccoutant@google.com>
8781
8782 PR 10471
8783 * resolve.cc (Symbol_table::resolve): Check for references from
8784 dynamic objects to hidden and internal symbols.
8785 * testsuite/Makefile.am (hidden_test.sh): New test.
8786 * testsuite/Makefile.in: Regenerate.
8787 * testsuite/hidden_test.sh: New script.
8788 * testsuite/hidden_test_1.c: New test source.
8789 * testsuite/hidden_test_main.c: New test source.
8790
11af873f
DK
87912009-08-11 Doug Kwan <dougkwan@google.com>
8792
8793 * arm.cc: Update comments.
8794 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
8795 segment to locate the .ARM.exidx section if present.
8796
b9f7d72d
DK
87972009-08-09 Doug Kwan <dougkwan@google.com>
8798
8799 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
8800 patch.
8801
ddd3c53c
ST
88022009-08-07 Sriraman Tallam <tmsriram@google.com>
8803 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
8804 compiler warnings.
8805
27721062
ST
88062009-08-06 Sriraman Tallam <tmsriram@google.com>
8807
8808 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
8809 valid tls_segment only for non-debug-section relocations.
8810 * testsuite/Makefile.am: Add gc_tls_test.
8811 * testsuite/Makefile.in: Regenerate.
8812 * testsuite/gc_tls_test.cc: New file.
8813 * testsuite/gc_tls_test.sh: New file.
8814
ef15dade 88152009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 8816
ef15dade
ST
8817 * icf.cc: New file.
8818 * icf.h: New file.
8819 * Makefile.am (CCFILES): Add icf.cc.
8820 (HFILES): Add icf.h
8821 * Makefile.in: Regenerate.
8822 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
8823 * gc.h (gc_process_relocs): Populate lists used by icf to contain
8824 section, symbol and addend information for the relocs.
8825 * gold.cc (queue_middle_tasks): Call identical code folding.
8826 * gold.h: Add defines for multimap.
8827 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
8828 to the call of finalize_local_symbols.
8829 * main.cc (main): Create object of class Icf.
8830 * object.cc (Sized_relobj::do_layout): Allow this function to be
8831 called twice during icf.
8832 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
8833 to sections marked as identical by icf.
8834 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
8835 when available.
8836 (Sized_relobj::do_section_entsize): New function.
8837 * object.h (Object::section_entsize): New function.
8838 (Object::do_section_entsize): New pure virtual function.
8839 (Relobj::finalize_local_symbols): Add new parameter.
8840 (Relobj::do_section_entsize): New function.
8841 * options.h (General_options::icf): New option.
8842 (General_options::icf_iterations): New option.
8843 (General_options::print_icf_sections): New option.
8844 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
8845 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
8846 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
8847 icf.
8848 * symtab.cc (Symbol_table::is_section_folded): New function.
8849 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
8850 to sections marked as identical by icf.
8851 * symtab.h (Symbol_table::set_icf): New function.
8852 (Symbol_table::icf): New function.
8853 (Symbol_table::is_section_folded): New function.
8854 (Symbol_table::icf_): New data member.
8855 * target-reloc.h (relocate_section): Ignore sections folded by icf.
8856 * testsuite/Makefile.am: Add commands to build icf_test.
8857 * testsuite/Makefile.in: Regenerate.
8858 * testsuite/icf_test.sh: New file.
8859 * testsuite/icf_test.cc: New file.
8860
c3b65ac4
CD
88612009-07-24 Chris Demetriou <cgd@google.com>
8862
8863 * layout.cc (is_compressible_debug_section): Fix incorrect
8864 comment about compressed section names.
8865
1caf2c51
ILT
88662009-07-20 Ian Lance Taylor <ian@airs.com>
8867
8868 PR 10419
8869 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
8870
1ef4d87f
ILT
88712009-07-16 Ian Lance Taylor <iant@google.com>
8872
8873 PR 10400
8874 * layout.h: #include <map>.
8875 (class Kept_section): Change from struct to class. Add accessors
8876 and setters. Add section size to Comdat_group mapping. Change
8877 Comdat_group to std::map. Add is_comdat_ field. Add
8878 linkonce_size field in union.
8879 (class Layout): Update declaration of find_or_add_kept_section.
8880 Don't declare find_kept_object.
8881 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
8882 parameter. Add object, shndx, is_comdat, and is_group_name
8883 parameters. Change all callers. Adjust for new Kept_section.
8884 (Layout::find_kept_object): Remove.
8885 * object.cc (Sized_relobj::include_section_group): Update use of
8886 Kept_section. Rename secnum to shndx. Only record
8887 Kept_comdat_section if sections are the same size.
8888 (Sized_relobj::include_linkonce_section): Update use of
8889 Kept_section. Only record Kept_comdat_section if sections are the
8890 same size. Set size of linkonce section.
8891 (Sized_relobj::map_to_kept_section): Update call to
8892 get_kept_comdat_section.
8893 * object.h (class Sized_relobj): Rename fields in
8894 Kept_comdat_section to drop trailing underscores; change object
8895 field to Relobj*. Change Kept_comdat_section_table to store
8896 struct rather than pointer.
8897 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
8898 Add kept_object and kept_shndx parameters. Change all callers.
8899 (Sized_relobj::get_kept_comdat_section): Change return type to
8900 bool. Add kept_object and kept_shndx parameters. Change all
8901 callers.
8902 * plugin.cc (Pluginobj::include_comdat_group): Update call to
8903 Layout::find_or_add_kept_section.
8904
37c3b7b0
ILT
89052009-07-09 Ian Lance Taylor <iant@google.com>
8906
8907 * merge.cc (Object_merge_map::initialize_input_to_output_map):
8908 Reserve space in the hash table.
8909
98fa85cb
ILT
89102009-07-06 Mikolaj Zalewski <mikolajz@google.com>
8911
8912 * fileread.cc (File_read::get_mtime): New method.
8913 * fileread.h (Timespec): New structure.
8914 (File_read::get_mtime): New method.
8915 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
8916 Renamed from timestamp_nsec.
8917 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
8918 Elf_Xword.
e1df38aa 8919 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 8920 timestamp_nsec.
e1df38aa 8921 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
8922 (Incremental_inputs::report_obejct): Save mtime; style fix.
8923 (Incremental_inputs::report_script): Save mtime; style fix.
8924 (Incremental_inputs::finalize_inputs): Style fix.
8925 (Incremental_inputs::finalize): Style fix.
8926 (Incremental_inputs::create_input_section_data): Store inputs
8927 mtime.
8928 * incremental.h (Incremental_inputs::report_script): Add mtime
8929 argument.
8930 (Incremental_inputs::Input_info::Input_info): Intialize only one
8931 union member.
8932 (Incremental_inputs::Input_info::archive): Move to nameless
8933 union.
8934 (Incremental_inputs::Input_info::obejct): Move to nameless union.
8935 (Incremental_inputs::Input_info::script): Move to nameless union.
8936 (Incremental_inputs::mtime): New field.
8937 * script.cc (read_input_script): Pass file mtime to
8938 Incremental_input.
8939 * script.h (Script_info::inputs): Style fix.
8940
c9d70757
ILT
89412009-07-01 Ian Lance Taylor <ian@airs.com>
8942
8943 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
8944 instead of 32.
8945
9c547ec3
ILT
89462009-06-24 Ian Lance Taylor <iant@google.com>
8947
8948 PR 10156
8949 * layout.cc (Layout::choose_output_section): If we find an
8950 existing section, update the flags.
8951 (Layout::create_notes): New function, broken out of
8952 Layout::finalize.
8953 (Layout::finalize): Don't create note sections.
8954 (Layout::create_note): Don't crash if linker script discards
8955 section.
8956 (Layout::create_gold_note): Likewise.
8957 (Layout::create_build_id): Likewise. Don't set
8958 after_input_sections on the section.
8959 (Layout::create_executable_stack_info): Remove target parameter.
8960 Change caller.
8961 * layout.h (class Layout): Declare create_notes. Update
8962 declaration of create_executable_stack_info.
8963 * gold.cc (queue_middle_tasks): Call create_notes.
8964 * output.cc (Output_section::update_flags_for_input_section): Move
8965 here from output.h. If SHF_ALLOC flag is newly set, mark address
8966 invalid.
8967 * output.h (Output_data::mark_address_invalid): New function.
8968 (class Output_section): Only declare, not define,
8969 update_flags_for_input_section. Remove set_flags.
8970
55458500
ILT
89712009-06-24 Ian Lance Taylor <iant@google.com>
8972
8973 * script-sections.cc (Output_section_definition::
8974 set_section_addresses): Rename shadowing local load_address to
8975 laddr.
8976
1307d6cd
ILT
89772009-06-24 Ian Lance Taylor <iant@google.com>
8978
8979 PR 10244
8980 * reloc.cc (relocate_sections): Skip empty relocation sections.
8981
ec3f783e
ILT
89822009-06-23 Ian Lance Taylor <iant@google.com>
8983
8984 PR 10156
8985 * layout.cc (Layout::create_note): Use choose_output_section
8986 rather than make_output_section.
8987
459c9f1c
ILT
89882009-06-23 Ian Lance Taylor <iant@google.com>
8989
8990 PR 10237
8991 * options.cc (General_options::parse_V): Set printed_version_.
8992 (General_options::General_options): Initialize printed_version_.
8993 * options.h (class General_options): Add printed_version_ field.
8994 * gold.cc (queue_initial_tasks): If there are no input files,
8995 don't give a fatal error if we printed the version information.
8996 (queue_middle_tasks): If using -r with a shared object, give a
8997 fatal error rather than an ordinary error.
8998
1518dc8f
ILT
89992009-06-23 Ian Lance Taylor <iant@google.com>
9000
9001 PR 10219
9002 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
9003 (Layout::make_output_section): Set have_stabstr_section_ if we see
9004 a .stab*str section.
9005 (Layout::finalize): Call link_stabs_sections.
9006 (Layout::link_stabs_sections): New file.
9007 * layout.h (class Layout): Add have_stabstr_section_ field.
9008 Declare link_stabs_sections.
9009
3d857b98
DK
90102009-06-23 Doug Kwan <dougkwan@google.com>
9011
9012 * Makefile.am (libgold_a_LIBADD): New.
9013 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
9014 * Makefile.in: Regenerate.
9015 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
9016 * configure: Regenerate.
9017 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
9018 * fileread.cc: Include sys/state.h
9019 * gold.h: Declare memmem and strndup if found missing.
9020 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
9021
0639a6f6
ILT
90222009-06-23 Ian Lance Taylor <iant@google.com>
9023
9024 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
9025 * configure: Rebuild.
9026
8d63875c
ILT
90272009-06-23 Ian Lance Taylor <iant@google.com>
9028
9029 PR 10147
9030 * object.cc (Object::section_contents): Don't try to get a view if
9031 the section has length zero.
9032 (Object::handle_gnu_warning_section): If the section is empty, use
9033 the name of the section as the warning.
9034
f7c8a183
ILT
90352009-06-23 Ian Lance Taylor <iant@google.com>
9036
9037 PR 10133
9038 * stringpool.h (class Stringpool_template): Add optimize_ field.
9039 (Stringpool_template::set_optimize): New function.
9040 * stringpool.cc (Stringpool_template::Stringpool_template):
9041 Initialize optimize_ field.
9042 (Stringpool_template::set_string_offsets): Test local optimize
9043 fild rather than parameter.
9044 * layout.cc (Layout::Layout): Call set_optimize on the section
9045 name stringpool.
9046
e6a307ba
ILT
90472009-06-22 Ian Lance Taylor <iant@google.com>
9048
9049 PR 10030
9050 * yyscript.y: Parse TARGET.
9051 * script.cc (script_set_target): New function.
9052 * script-c.h (script_set_target): Declare.
9053 * options.cc (General_options::string_to_object_format): Rename
9054 from string_to_object_format in anonymous namespace. Change
9055 callers.
9056 * options.h (class General_options): Declare
9057 string_to_object_format.
9058
3ee173de
ILT
90592009-06-22 Ian Lance Taylor <iant@google.com>
9060
9061 * script-sections.cc (Script_sections::create_segments): Don't put
9062 program headers in a PT_LOAD segment if -n or -N.
9063
90642009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
9065
9066 PR 10141
9067 * options.h (class General_options): Add -z lazy and -z now. Sort
9068 -z options into alphabetical order.
9069 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
9070
cd6739a1 90712009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
9072
9073 * layout.cc (Layout::make_output_section): Call
9074 Target::new_output_section.
9075 (Layout::attach_allocated_section_to_segment): Put large section
9076 sections in a separate load segment with the large segment flag
9077 set.
9078 (Layout::segment_precedes): Sort large data segments after other
9079 load segments.
9080 (align_file_offset): New static function.
9081 (Layout::set_segment_offsets): Use align_file_offset.
9082 * output.h (class Output_section): Add is_small_section_ and
9083 is_large_section_ fields.
9084 (Output_section::is_small_section): New function.
9085 (Output_section::set_is_small_section): New function.
9086 (Output_section::is_large_section): New function.
9087 (Output_section::set_is_large_section): New function.
9088 (Output_section::is_large_data_section): New function.
9089 (class Output_segment): Add is_large_data_segment_ field.
9090 (Output_segment::is_large_data_segment): New function.
9091 (Output_segment::set_is_large_data_segment): New function.
9092 * output.cc (Output_section::Output_section): Initialize new
9093 fields.
9094 (Output_segment::Output_segment): Likewise.
9095 (Output_segment::add_output_section): Add assertion that large
9096 data sections always go in large data segments. Force small data
9097 sections to the end of the list of data sections. Force small BSS
9098 sections to the start of the list of BSS sections. For large BSS
9099 sections to the end of the list of BSS sections.
9100 * symtab.h (class Symbol): Declare is_common_shndx.
9101 (Symbol::is_defined): Check Symbol::is_common_shndx.
9102 (Symbol::is_common): Likewise.
9103 (class Symbol_table): Define enum Commons_section_type. Update
9104 declarations. Add small_commons_ and large_commons_ fields.
9105 * symtab.cc (Symbol::is_common_shndx): New function.
9106 (Symbol_table::Symbol_table): Initialize new fields.
9107 (Symbol_table::add_from_object): Put small and large common
9108 symbols in the right list.
9109 (Symbol_table::sized_finalized_symbol): Check
9110 Symbol::is_common_shndx.
9111 (Symbol_table::sized_write_globals): Likewise.
9112 * common.cc (Symbol_table::do_allocate_commons): Allocate new
9113 common symbol lists. Don't call do_allocate_commons_list if the
9114 list is empty.
9115 (Symbol_table::do_allocate_commons_list): Remove is_tls
9116 parameter. Add comons_section_type parameter. Change all
9117 callers. Handle small and large common symbols.
9118 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
9119 Symbol::is_common_shndx.
9120 * resolve.cc (symbol_to_bits): Likewise.
9121 * target.h (Target::small_common_shndx): New function.
9122 (Target::small_common_section_flags): New function.
9123 (Target::large_common_shndx): New function.
9124 (Target::large_common_section_flags): New function.
9125 (Target::new_output_section): New function.
9126 (Target::Target_info): Add small_common_shndx, large_common_shndx,
9127 small_common_section_flags, and large_common_section_flags
9128 fields.
9129 (Target::do_new_output_section): New virtual function.
9130 * arm.cc (Target_arm::arm_info): Initialize new fields.
9131 * i386.cc (Target_i386::i386_info): Likewise.
9132 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
9133 Likewise.
9134 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
9135 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
9136 (Target_x86_64::do_new_output_section): New function.
9137 * configure.ac: Define conditional MCMODEL_MEDIUM.
9138 * testsuite/Makefile.am (check_PROGRAMS): Add large.
9139 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
9140 (large_LDFLAGS): Define.
9141 * testsuite/large.c: New file.
9142 * testsuite/testfile.cc (Target_test::test_target_info):
9143 Initialize new fields.
9144 * configure, testsuite/Makefile.in: Rebuild.
9145
bb04269c
DK
91462009-06-05 Doug Kwan <dougkwan@google.com>
9147
9148 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 9149 * Makefile.in: Regenerate.
bb04269c
DK
9150 * i386.cc (class Target_i386): Define new virtual method to
9151 override do_is_local_label_name in parent.
9152 * object.cc (Sized_relobj::do_count_local_symbols): Discard
9153 local symbols if --discard-locals or -X is given.
9154 * options.h (class General_options): Declare new options
9155 '--discard-locals' and '-X' for discarding locals.
9156 * target.h (class Target): Define new methods is_local_label_name.
9157 Declare new virtual method do_is_local_label_name.
9158 * target.cc: New file.
9159 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
9160 (check_SCRIPTS): Add discard_locals_test.sh.
9161 (check_DATA): Add discard_local_tests.syms.
9162 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
9163 (discard_local_tests.syms, discard_locals_test.o): New make rules.
9164 * testsuite/Makefile.in: Regenerate.
9165 * testsuite/discard_locals_test.c: New file.
9166 * testsuite/discard_locals_test.sh: Same.
9167
805bb01c
DK
91682009-06-05 Doug Kwan <dougkwan@google.com>
9169
9170 * object.cc (Sized_relobj::Sized_relobj): Initialize
9171 discarded_eh_frame_shndx_ to -1U.
9172 (Sized_relobj::do_layout): Record index of a discard .eh_frame
9173 section.
9174 (Sized_relobj::do_count_local_symbols): Skip local symbols in
9175 a discarded .eh_frame section.
9176 (Sized_relobj::do_finalize_local_symbols): Ditto.
9177 * object.h (class Sized_relobj): Declare new member
9178 discarded_eh_frame_shndx_.
9179 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
9180 (local_labels_test.o, local_labels_test): New rules.
9181 * testsuite/Makefile.in: Regenerate.
9182
1dcd334d
DK
91832009-06-04 Doug Kwan <dougkwan@google.com>
9184
9185 * layout.cc (Layout::section_name_mapping): Add mapping for
9186 special ARM sections.
9187
96d49306
DK
91882009-06-03 Doug Kwan <dougkwan@google.com>
9189
9190 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
9191 (utils::has_overflow): Same.
9192
dff16297
ILT
91932009-06-03 Ian Lance Taylor <iant@google.com>
9194
9195 * layout.cc (Layout::section_name_mapping): New array, replacing
9196 Layout::linkonce_mapping.
9197 (Layout::section_name_mapping_count): New variable, replacing
9198 Layout::linkonce_mapping_count.
9199 (Layout::linkonce_output_name): Remove.
9200 (Layout::output_section_name): Rewrite.
9201 * layout.h (class Layout): Rename Linkonce_mapping to
9202 Section_name_mapping, linkonce_mapping to section_name_mapping,
9203 linkonce_mapping_count to section_name_mapping_count. Don't
9204 declare linkonce_output_name.
9205
c121c671
DK
92062009-06-03 Doug Kwan <dougkwan@google.com>
9207
9208 * gold/arm.cc (namespace utils): New.
9209 (Target_arm::reloc_is_non_pic): Define new method.
9210 (class Arm_relocate_functions): New.
9211 (Target_arm::Relocate::relocate): Handle relocation types used by
9212 Android.
9213
07800fab
ILT
92142009-06-03 Ian Lance Taylor <iant@google.com>
9215
9216 * arm.cc (Target_arm::scan::global): Use || instead of |.
9217
c121c671
DK
92182009-06-02 Doug Kwan <dougkwan@google.com>
9219
9220 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
9221 issued_non_pic_error_.
9222 (class Target_arm::Scan): Declare new method check_non_pic.
9223 Define new method symbol_needs_plt_entry.
9224 Declare new data member issued_non_pic_error_.
9225 (class Target_arm::Relocate): Declare new method
9226 should_apply_static_reloc.
9227 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
9228 (Target_arm::Scan::check_non_pic): Define new method.
9229 (Target_arm::Scan::local): Handle a small subset of reloc types used
9230 by Android.
9231 (Target_arm::Scan::local): Same.
9232 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
9233
b19b0c6d
ILT
92342009-05-31 Mikolaj Zalewski <mikolajz@google.com>
9235
9236 * incremental.cc (Incremental_inputs::report_command_line): Filter
9237 out --incremental-* options.
9238
94cdfcff
DK
92392009-05-29 Doug Kwan <dougkwan@google.com>
9240
9241 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
9242 template class.
9243 (class Target_arm): Update comment.
9244 (Target_arm::Target_arm): Initialize new data members GOT_,
9245 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
9246 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
9247 and Target_arm::rel_dyn_section.
9248 Declare new_enum Target_arm::Got_type.
9249 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
9250 and DYNBSS_.
9251 Update commments for member do_dynsym_value.
9252 (Target_arm::got_size, Target_arm::plt_section,
9253 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
9254 new methods inside class defintion.
9255 (Target_arm::got_section): Define new method.
9256 (Target_arm::rel_dyn_section): Same.
9257 (Output_data_plt_arm): New template class.
9258 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
9259 (Output_data_plt_arm:do_adjust_output_section): Define new method.
9260 (Output_data_plt_arm::add_entry): Same.
9261 (Output_data_plt_arm::first_plt_entry): Define new
9262 static data member for PLT instruction template.
9263 (Output_data_plt_arm::plt_entry): Same.
9264 (Output_data_plt_arm::do_write): Define new method.
9265 (Target_arm::make_plt_entry): Same.
9266 (Target_arm::do_finalize_sections): Same.
9267 (Target_arm::do_dynsym_value): Same.
9268
4a657b0d
DK
92692009-05-28 Doug Kwan <dougkwan@google.com>
9270
9271 * Makefile.am (TARGETSOURCES): Add arm.cc.
9272 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
9273 * Makefile.in: Regenerate.
9274 * arm.cc: New file.
9275 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
9276
e7ae8c36
DK
92772009-05-26 Doug Kwan <dougkwan@google.com>
9278
9279 * options.cc (General_options::parse_exclude_libs). Fix a comment.
9280 (General_options::check_excluded_libs): Strip off directories in
9281 archive name before matching like GNU ld does.
9282 * testsuite/Makefile.am (MOSTLYCLEANFILES,
9283 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
9284 (exclude_libs_test_LDFLAGS): Add linker option
9285 -Wl,--exclude-libs,libexclude_libs_test_3
9286 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
9287 an explicit archive without using -l.
9288 (alt/libexclude_libs_test_3.a): New make rule.
9289 * testsuite/Makefile.in: Regenerate.
9290 * testsuite/exclude_libs_test.c : Declare lib3_default().
9291 (main): Call it.
9292 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
9293 * exclude_libs_test_3.c: New file.
9294
f12e7348
NC
92952009-05-26 Nick Clifton <nickc@redhat.com>
9296
9297 * po/id.po: New Indonesian translation.
9298 * po/gold.pot: Updated template file.
9299
4daadc0d
ST
93002009-05-22 Sriraman Tallam <tmsriram@google.com>
9301
e1df38aa 9302 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
9303 gc_comdat_test files. Add -Wl,--gc-sections to build
9304 gc_comdat_test.
9305 * testsuite/Makefile.in: Regenerate.
9306 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
9307
531813ad
ST
93082009-05-21 Sriraman Tallam <tmsriram@google.com>
9309
9310 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
9311 kept comdat section was garbage collected.
9312 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
9313 * testsuite/Makefile.in: Regenerate.
9314 * testsuite/gc_comdat_test.sh: New file.
9315 * testsuite/gc_comdat_test_1.cc: New file.
9316 * testsuite/gc_comdat_test_2.cc: New file.
9317
65514900
CC
93182009-05-19 Doug Kwan <dougkwan@google.com>
9319
9320 * archive.cc (Archive::Archive): Move constructor from archive.h
9321 to here. Initialize no_export_.
9322 (Archive::get_elf_object_for_member): Set no_export flag of object.
9323 * archive.h (Archive::Archive): Move constructor body to
9324 archive.cc.
9325 (Archive::no_export): New method.
9326 (Archive::no_export_): New field.
9327 * object.h (Object::Object): Initialize no_export_ to false.
9328 (Object::no_export, Object::set_no_export): New methods.
9329 (Object::no_export_): New field.
9330 * options.cc (General_options::parse_exclude_libs): New method.
9331 (General_options::check_excluded_libs) Same.
9332 * options.h (exclude_libs): New option.
9333 (General_options::check_excluded_libs): New method declaration.
9334 (General_options::excluded_libs_): New field.
9335 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
9336 default or protected visibility if an object has no-export flag set.
9337 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
9338 (check_SCRIPTS): Add exclude_libs_test.sh.
9339 (check_DATA): Add exclude_libs_test.syms.
9340 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
9341 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
9342 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
9343 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
9344 (exclude_libs_test.syms, libexclude_libs_test_1.a,
9345 libexclude_libs_test_2.a): New rules.
9346 * testsuite/Makefile.in: Regenerate.
9347 * testsuite/exclude_libs_test.c: New file.
9348 * testsuite/exclude_libs_test.sh: Ditto.
9349 * testsuite/exclude_libs_test_1.c: Ditto.
9350 * testsuite/exclude_libs_test_2.c: Ditto.
9351
1b77ea50
ILT
93522009-05-15 Ian Lance Taylor <iant@google.com>
9353
9354 * configure.ac: Check for declarations for cases where libiberty.h
9355 checks HAVE_DECL_xxx.
9356 * configure, config.in: Rebuild.
9357
072fe7ce
ILT
93582009-05-15 Mikolaj Zalewski <mikolajz@google.com>
9359
9360 * gold.h (Incremental_argument_list): Remove (invalid) forward
9361 declaration.
9362 * incremental.cc (Incremental_inputs::report_achive): New method.
9363 (Incremental_inputs::report_object): New method.
9364 (Incremental_inputs::report_script): New method.
9365 (Incremental_inputs::finalize_inputs): New method.
9366 (Incremental_inputs::finalize): Call finalize_inputs().
9367 (Incremental_inputs::sized_create_incremental_inputs_section_data):
9368 Create inputs entries.
9369 * incremental.h (Incremental_input_type): New enum.
9370 (Incremental_inputs::Incremental_input): Initialize new fields.
9371 (Incremental_inputs::report_inputs): New method.
9372 (Incremental_inputs::report_achive): New method.
9373 (Incremental_inputs::report_object): New method.
9374 (Incremental_inputs::report_script): New method.
9375 (Incremental_inputs::finalize_inputs): New method.
9376 (Incremental_inputs::Input_info): New struct.
9377 (Incremental_inputs::Input_info_map): New typedef.
9378 (Incremental_inputs::lock_): New field.
9379 (Incremental_inputs::Inputs_): New field.
9380 (Incremental_inputs::Inputs_map): New field.
9381 * main.cc (main): Call Incremental_input::report_inputs.
9382 * options.h (Input_argument_list): Typedef moved from
9383 Input_arguments.
9384 (Input_file_group::Files): Remove, use ::Input_argument_list.
9385 (Input_file_group::Input_argument_list): Remove, use
9386 ::Input_argument_list.
9387 * plugin.cc (Plugin_manager::add_input_file): Add error in
9388 incremental build.
9389 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
9390 functions.
9391 * script.cc (read_input_script): Call
9392 Incremental_input::report_script.
9393 * script.h (Script_info): New class.
9394
b0481b0b
ILT
93952009-04-27 Ian Lance Taylor <iant@google.com>
9396
9397 * x86_64.cc (do_adjust_output_section): Set entsize to
9398 plt_entry_size.
9399
b22a5a41 94002009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
9401
9402 * output.cc (Output_file::close): After short writes, continue
9403 writing from the correct offset in the buffer being written.
9404
40fde488
CD
94052009-04-23 Chris Demetriou <cgd@google.com>
9406
9407 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
9408 * configure: Regenerate.
9409 * config.in: Regenerate.
9410 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
9411 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
9412
3ce2c28e
ILT
94132009-04-21 Mikolaj Zalewski <mikolajz@google.com>
9414
9415 * incremental.cc (Incremental_inputs_header_data): Renamed from
9416 Incremental_input_header_data.
9417 (Incremental_inputs_header_data::data_size): New field.
9418 (Incremental_inputs_header_data::put_input_file_count): Renamed
9419 from input_file_count.
9420 (Incremental_inputs_header_data::put_command_line_offset): Renamed
9421 from command_line_offset.
9422 (Incremental_inputs_header_data::put_reserved): Renamed from
9423 put_reserved.
9424 (Incremental_inputs_entry_data): Renamed from
9425 Incremental_input_entry_data.
9426 (Incremental_inputs_entry_data::data_size): New field.
9427 (Incremental_inputs::report_command_line): New method.
9428 (Incremental_inputs::finalize): New method.
9429 (Incremental_inputs::create_incremental_inputs_data): New method.
9430 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
9431 * incremental.h: New file.
9432 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
9433 (Layout::finalize): Create incremental inputs section in
9434 incremental builds.
9435 (Layout::create_incremental_info_sections): New method.
9436 * layout.h (Layout::incremental_inputs): New method.
9437 (Layout::create_incremental_info_sections): New method.
9438 (Layout::incremental_inputs_): New field.
9439 * main.cc (main): Notify Incremental_input of the command line.
9440
e55bde5e
ILT
94412009-04-01 Ian Lance Taylor <iant@google.com>
9442 Mikolaj Zalewski <mikolajz@google.com>
9443
9444 * gold.h (reserve_unordered_map): Define, three versions, one for
9445 each version of Unordered_map.
9446 * layout.cc (Layout::Layout): Remove options parameter. Add
9447 number_of_input_files parameter. Don't initialize options_.
9448 Initialize number_of_input_files_ and resized_signatures_. Move
9449 sections_are_attached_.
9450 (Layout::layout_group): Reserve space for group_signatures_.
9451 (Layout::find_or_add_kept_section): Change name parameter to be a
9452 reference. Resize signatures_ map when it gets large enough.
9453 (Layout::layout_eh_frame): Use parameters->options() instead of
9454 this->options_.
9455 (Layout::make_output_section): Likewise.
9456 (Layout::attach_allocated_section_to_segment): Likewise.
9457 (Layout::finalize, Layout::create_executable_stack): Likewise.
9458 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
9459 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
9460 * layout.h (class Layout): Update declarations. Remove options_
9461 field. Add number_of_input_files_ and resized_signatures_
9462 fields. Move sections_are_attached_ field.
9463 * main.cc (main): Pass number of input files to Layout
9464 constructor. Don't pass options.
9465
154b857c
ILT
94662009-03-30 Ian Lance Taylor <iant@google.com>
9467
9468 * ffsll.c (ffsll): Correct implementation.
9469
2f35ab9b
ILT
94702009-03-27 Ian Lance Taylor <iant@google.com>
9471
fd03461a
ILT
9472 * ffsll.c: New file.
9473 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
9474 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
9475 * ftruncate.c (ftruncate): Declare before definition.
9476 * mremap.c (mremap): Likewise.
9477 * pread.c (pread): Likewise.
9478 * configure, Makefile.in, config.in: Rebuild.
9479
2f35ab9b
ILT
9480 * mremap.c: New file.
9481 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
9482 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
9483 (mremap): Declare if HAVE_MREMAP is not defined.
9484 * configure, Makefile.in, config.in: Rebuild.
9485
33aea2fd
CC
94862009-03-27 Cary Coutant <ccoutant@google.com>
9487
9488 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
9489 position independent.
9490 * sparc.cc (Target_sparc::check_non_pic): Likewise.
9491 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
9492
6d479619
CC
94932009-03-24 Cary Coutant <ccoutant@google.com>
9494
9495 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
9496 an executable.
9497 (needs_dynamic_reloc): Likewise.
9498
afc06bb8
ILT
94992009-03-24 Ian Lance Taylor <iant@google.com>
9500
9501 * yyscript.y (file_cmd): Recognize EXTERN.
9502 (extern_name_list, extern_name_list_body): New nonterminals.
9503 * script.cc (script_add_extern): Define.
9504 * script-c.h (script_add_extern): Declare.
9505
f6060a4d
ILT
95062009-03-24 Rafael Avila de Espindola <espindola@google.com>
9507
9508 * object.cc (is_elf_object): Define.
9509 * object.h (is_elf_object): Declare.
9510 * archive.cc (Archive::get_elf_object_for_member): Call
9511 is_elf_object.
33aea2fd 9512 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 9513
26736d8e
ILT
95142009-03-24 Elliott Hughes <enh@google.com>
9515
9516 * output.cc (Output_file::map_anonymous): Define.
9517 (Output_file::map): Use map_anonymous. If the regular mmap fails,
9518 try an anonymous one. Report the size if the mmap fails.
9519 * output.h (class Output_file): Declare map_anonymous.
9520
22fd9730
ILT
95212009-03-24 Ian Lance Taylor <iant@google.com>
9522
9523 * target-select.cc (instantiate_target): Don't acquire the lock if
9524 the instantiated_target_ field has already been set.
9525
cb010894
ILT
95262009-03-23 Ian Lance Taylor <iant@google.com>
9527
7f055c20
ILT
9528 * gold-threads.h (class Initialize_lock): Define.
9529 * gold-threads.cc (class Initialize_lock_once): Define.
9530 (initialize_lock_control): New static variable.
9531 (initialize_lock_pointer): New static variable.
9532 (initialize_lock_once): New static function.
9533 (Initialize_lock::Initialize_lock): Define.
9534 (Initialize_lock::initialize): Define.
9535 * target-select.h: Include "gold-threads.h".
9536 (class Target_selector): Add lock_ and initialize_lock_ fields.
9537 Don't define instantiate_target, just declare it.
9538 * target-select.cc (Target_selector::Target_selector): Initialize
9539 new fields.
9540 (Target_selector::instantiate_target): Define.
9541 * descriptors.h: Include "gold-threads.h".
9542 (class Descriptors): Add initialize_lock_ field.
9543 * descriptors.cc (Descriptors::Descriptors): Initialize new
9544 field.
9545 (Descriptors::open): Use initialize_lock_ field
9546 * errors.h (class Errors): Add initialize_lock_ field.
9547 * errors.cc (Errors::Errors): Initialize new field.
9548 (Errors::initialize_lock): Use initialize_lock_ field.
9549 * powerpc.cc (class Target_selector_powerpc): Remove
9550 instantiated_target_ field. In do_recognize call
9551 instantiate_target rather than do_instantiate_target. In
9552 do_instantiate_target just allocate a new target.
9553 * sparc.cc (class Target_selector_sparc): Likewise.
9554
36959681
ILT
9555 * freebsd.h: New file.
9556 * i386.cc: Include "freebsd.h".
9557 (Target_i386): Derive from Target_freebsd rather than
9558 Sized_target.
9559 (Target_selector_i386): Derive from Target_selector_freebsd rather
9560 than Target_selector.
9561 * x86_64.cc: Include "freebsd.h".
9562 (Target_x86_64): Derive from Target_freebsd rather than
9563 Sized_target.
9564 (Target_selector_x86_64): Derive from Target_selector_freebsd
9565 rather than Target_selector.
9566 * target.h (class Target): Add adjust_elf_header and
9567 do_adjust_elf_header.
9568 * output.cc (Output_file_header:: do_sized_write): Call target
9569 adjust_elf_header routine.
9570 * configure.tgt: Set targ_osabi.
9571 * configure.ac: Define GOLD_DEFAULT_OSABI.
9572 * parameters.cc (Parameters::default_target): Pass
9573 GOLD_DEFAULT_OSABI to select_target.
9574 * target-select.h (class Target_selector): Make instantiate_target
9575 protected rather than private.
9576 * Makefile.am (HFILES): Add freebsd.h.
9577 * configure, Makefile.in, config.in: Rebuild.
9578
cb010894
ILT
9579 * merge.cc (do_add_input_section): Correct pend value. Change
9580 message about last entry not being null terminated from error to
9581 warning.
9582
0e879927
ILT
95832009-03-20 Mikolaj Zalewski <mikolajz@google.com>
9584
9585 * incremental.cc: New file.
9586 * Makefile.am (CCFILES): Add incremental.cc.
9587 * Makefile.in: Rebuild.
9588
41105937
PP
95892009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
9590
9591 * layout.cc (Layout::output_section_name): Preserve names
9592 of '.note.' sections.
e1df38aa 9593
60439920
ILT
95942009-03-19 Ian Lance Taylor <iant@google.com>
9595
9596 * descriptors.cc (Descriptors::open): Check that the options are
9597 valid before using them.
9598
0d371ad3
ILT
95992009-03-18 Ian Lance Taylor <iant@google.com>
9600
9601 * script-sections.h: Include <list>.
9602 (class Script_sections): Change Sections_elements from std::vector
9603 to std::list. Typedef public Elements_iterator. Add
9604 orphan_section_placement_, data_segment_align_start_, and
9605 saw_data_segment_align_ fields. Remove data_segment_align_index_
9606 field.
9607 * script-sections.cc (class Orphan_section_placement): New class.
9608 (class Sections_element): Add virtual functions is_relro and
9609 orphan_section_init. Remove virtual function place_orphan_here.
9610 (class Output_section_definition): Add is_relro and
9611 orphan_section_init. Remove place_orphan_here.
9612 (class Orphan_output_section): Likewise.
9613 (Script_sections::Script_sections): Update for field changes.
9614 (Script_sections::data_segment_align): Set saw_data_segment_align_
9615 and data_segment_align_start_, not data_segment_align_index.
9616 (Script_sections::data_segment_relro_end): Check
9617 saw_data_segment_align_. Use data_segment_align_start_ rather
9618 than data_segment_align_index_.
9619 (Script_sections::place_orphan): Rewrite to use
9620 Orphan_section_placement.
9621
9201d894
ILT
96222009-03-17 Ian Lance Taylor <iant@google.com>
9623
9c5b8369
ILT
9624 * archive.cc (Archive::add_symbols): Check for a version attached
9625 to the symbol name in the archive map.
9626 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
9627 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
9628 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
9629 (ver_test_11.a): New target.
9630 * testsuite/Makefile.in: Rebuild.
9631
9201d894
ILT
9632 * configure.ac: Check for chsize and posix_fallocate. Replace
9633 ftruncate.
9634 * ftruncate.c: New file, from gnulib.
9635 * output.cc (posix_fallocate): Define dummy version if not
9636 HAVE_POSIX_FALLOCATE.
9637 (Output_file::map): Call posix_fallocate rather than lseek and
9638 write.
9639 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
9640 * configure, Makefile.in, config.in: Rebuild.
9641
ef4ab7a8 96422009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 9643
ef4ab7a8
PP
9644 * layout.h (Layout::create_note): Add section_name parameter.
9645 * layout.cc (Layout::create_note): Likewise.
9646 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 9647
8c500701
ILT
96482009-03-17 Ian Lance Taylor <iant@google.com>
9649
e85b18e1
ILT
9650 * descriptors.cc: Include "options.h".
9651 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
9652 (Descriptors::open): Always use O_CLOEXEC when opening a new
9653 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
9654 then set FD_CLOEXEC.
9655
9efe6174
ILT
9656 * sparc.cc (class Target_sparc): Add has_got_section.
9657 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
9658 make sure we have a GOT section.
9659
9660 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
9661 (Target_sparc::Scan::local): Likewise.
9662 (Target_sparc::Scan::global): Likewise.
9663 (Target_sparc::Relocate::relocate): Likewise.
9664 (Target_sparc::Relocate::relocate_tls): Likewise.
9665
8c500701
ILT
9666 * symtab.cc (Symbol_table::define_default_version): New function,
9667 broken out of add_from_object.
9668 (Symbol_table::add_from_object): Call define_default_version.
9669 (Symbol_table::define_special_symbol): Add resolve_oldsym
9670 parameter. Change all callers. If the version for a symbol comes
9671 from a version script, resolve it with the symbol with the same
9672 name with no version. Also add the symbol without a version if
9673 appropriate.
9674 (do_define_in_output_data): If resolving with oldsym, don't delete
9675 sym.
9676 (do_define_in_output_segment): Likewise.
9677 (do_define_as_constant): Likewise.
9678 * symtab.h (class Symbol_table): Update declarations.
9679
f1ed28fb
ILT
96802009-03-13 Ian Lance Taylor <iant@google.com>
9681
15f8229b
ILT
9682 * readsyms.cc (Read_symbols::incompatible_warning): New function.
9683 (Read_symbols::requeue): New function.
9684 (Read_symbols::do_read_symbols): If make_elf_object fails because
9685 the target type is not configured, and the file was searched for,
9686 issue a warning and retry with the next directory.
9687 (Add_symbols::run): If the file has an incompatible format, and
9688 it was searched for, requeue the Read_symbols task. On error,
9689 release the object.
9690 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
9691 dirindex parameter to constructor. Change all callers. Declare
9692 incompatible_warning and requeue.
9693 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
9694 input_argument_ and input_group_ fields. Add them to
9695 constructor. Change all callers.
9696 (class Read_script): Add dirindex_ field. Add it to constructor.
9697 Change all callers.
9698 * archive.cc (Archive::setup): Remove input_objects parameter.
9699 Change all callers.
9700 (Archive::get_file_and_offset): Likewise.
9701 (Archive::read_all_symbols): Likewise.
9702 (Archive::read_symbols): Likewise.
9703 (Archive::get_elf_object_for_member): Remove input_objects
9704 parameter. Add punconfigured parameter. Change all callers.
9705 (Archive::add_symbols): Change return type to bool. Check return
9706 value of include_member.
9707 (Archive::include_all_members): Likewise.
9708 (Archive::include_member): Change return type to bool. Return
9709 false if first included object has incompatible target. Set
9710 included_member_ field.
9711 (Add_archive_symbols::run): If add_symbols returns false, requeue
9712 Read_symbols task.
9713 * archive.h (class Archive): Add included_member_ field.
9714 Initialize it in constructor. Add input_file and searched_for
9715 methods. Update declarations.
9716 (class Add_archive_symbols): Add dirpath_, dirindex_, and
9717 input_argument_ fields. Add them to constructor. Change all
9718 callers.
9719 * script.cc: Include "target-select.h".
9720 (class Parser_closure): Add skip_on_incompatible_target_ and
9721 found_incompatible_target_ fields. Add
9722 skip_on_incompatible_target parameter to constructor. Change all
9723 callers. Add methods skip_on_incompatible_target,
9724 clear_skip_on_incompatible_target, found_incompatible_target, and
9725 set_found_incompatible_target.
9726 (read_input_script): Add dirindex parameter. Change all callers.
9727 If parser finds an incompatible target, requeue Read_symbols
9728 task.
9729 (script_set_symbol): Clear skip_on_incompatible_target in
9730 closure.
9731 (script_add_assertion, script_parse_option): Likewise.
9732 (script_start_sections, script_add_phdr): Likewise.
9733 (script_check_output_format): New function.
9734 * script.h (read_input_script): Update declaration.
9735 * script-c.h (script_check_output_format): Declare.
9736 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
9737 (ignore_cmd): Remove OUTPUT_FORMAT.
9738 * fileread.cc (Input_file::Input_file): Add explicit this.
9739 (Input_file::will_search_for): New function.
9740 (Input_file::open): Add pindex parameter. Change all callers.
9741 * fileread.h (class Input_file): Add input_file_argument method.
9742 Declare will_search_for. Update declarations.
9743 * object.cc (make_elf_object): Add punconfigured parameter.
9744 Change all callers.
9745 * object.h (class Object): Make input_file public. Add
9746 searched_for method.
9747 (make_elf_object): Update declaration.
9748 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
9749 restart search.
9750 * dirsearch.h (class Dirsearch): Update declaration.
9751 * options.h (class General_options): Add --warn-search-mismatch.
9752 * parameters.cc (Parameters::is_compatible_target): New function.
9753 * parameters.h (class Parameters): Declare is_compatible_target.
9754 * workqueue.cc (Workqueue::add_blocker): New function.
9755 * workqueue.h (class Workqueue): Declare add_blocker.
9756
f1ed28fb
ILT
9757 * fileread.cc (Input_file::open): Remove options parameter.
9758 Change all callers.
9759 (Input_file::open_binary): Likewise.
9760 * script.cc (read_input_script): Likewise.
9761 * readsyms.h (class Read_symbols): Remove options_ field. Remove
9762 options parameter from constructor. Change all callers.
9763 (class Read_script): Likewise.
9764 * fileread.h (class Input_file): Update declarations.
9765 * script.h (read_input_script): Update declaration.
9766
34dd024a
NC
97672009-03-10 Nick Clifton <nickc@redhat.com>
9768
9769 * po/es.po: New Spanish translation.
9770
6d71b17c
CC
97712009-03-06 Cary Coutant <ccoutant@google.com>
9772
9773 * options.cc (parse_short_option): Keep dash_z from registering itself.
9774
031cdbed
ILT
97752009-03-03 Ian Lance Taylor <iant@google.com>
9776
9777 PR 9918
9778 * target-reloc.h (relocate_section): Pass output_section to
9779 relocate.
9780 * i386.cc (Target_i386::should_apply_static_reloc): Add
9781 output_section parameter. Change all callers.
9782 (Target_i386::Relocate::relocate): Add output_section parameter.
9783 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
9784 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
9785 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
9786 * testsuite/two_file_shared.sh: New script.
9787 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
9788 (check_DATA): Add two_file_shared.dbg.
9789 (two_file_shared.dbg): New target.
9790 * testsuite/Makefile.in: Rebuild.
9791
15d5fa16
ILT
97922009-03-01 Ian Lance Taylor <iant@google.com>
9793
9794 * configure.ac: Check for byteswap.h.
9795 * configure: Rebuild.
9796 * config.in: Rebuild.
9797
8a4c0b0d
ILT
97982009-03-01 Mikolaj Zalewski <mikolajz@google.com>
9799
9800 * layout.cc (Layout::find_or_add_kept_section): New function.
9801 (Layout::add_comdat): Removed.
9802 * layout.h (struct Kept_section): Move out of class Layout.
9803 Remove trailing underscores from field names. Add group_sections
9804 field. Rename group_ field to is_group. Change all uses.
9805 (class Layout): Declare find_or_add_kept_section, not add_comdat.
9806 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
9807 comdat_groups_ field.
9808 (Sized_relobj::include_section_group): Use
9809 find_or_add_kept_section and Kept_section::group_sections.
9810 (Sized_relobj::include_linkonce_section): Likewise.
9811 * object.cc (class Sized_relobj): Don't define Comdat_group or
9812 Comdat_group_table. Remove find_comdat_group and
9813 add_comdat_group. Remove comdat_groups_ field.
9814 * plugin.cc (include_comdat_group): Use
9815 Layout::find_or_add_kept_section.
9816
b4ecf66b
ILT
98172009-02-28 Ian Lance Taylor <iant@google.com>
9818
14359ca0
ILT
9819 * README: --gc-sections and map files are now supported. Document
9820 some build requirements.
9821
b4ecf66b
ILT
9822 PR 6992
9823 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
9824 relocatable link set the value of the section symbol to zero.
9825 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
9826 relocatable link don't include the section address in the local
9827 symbol value.
9828
0602e05a
ILT
98292009-02-27 Ian Lance Taylor <iant@google.com>
9830
fd9d194f
ILT
9831 PR 6811
9832 * options.h (class Search_directory): Add is_system_directory.
9833 (class General_options): Declare is_in_system_directory.
9834 * options.cc (get_relative_sysroot): Make static.
9835 (get_default_sysroot): Make static.
9836 (General_optoins::is_in_system_directory): New function.
9837 * fileread.cc (Input_file::is_in_system_directory): New function.
9838 * fileread.h (class Input_file): Declare is_in_system_directory.
9839 * object.h (class Object): Add is_in_system_directory.
9840 (class Input_objects): Remove system_library_directory_ field.
9841 * object.cc (Input_objects::add_object): Don't set
9842 system_library_directory_.
9843 (input_objects::found_in_system_library_directory): Remove.
9844 * symtab.cc (Symbol_table::write_globals): Remove input_objects
9845 parameter. Change all callers.
9846 (Symbol_table::sized_write_globals): Likewise.
9847 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
9848 Call Object::is_in_system_directory.
9849 * symtab.h (class Symbol_table): Update declarations.
9850
61edd21f
ILT
9851 PR 5990
9852 * descriptors.h (Open_descriptor): Add is_on_stack field.
9853 * descriptors.cc (Descriptors::open): If the descriptor is on the
9854 top of the stack, remove it. Initialize is_on_stack field.
9855 (Descriptors::release): Only add pod to stack if it is not on the
9856 stack already.
9857 (Descriptors::close_some_descriptor): Clear stack_next and
9858 is_on_stack fields.
9859
e29e076a
ILT
9860 PR 7091
9861 * output.cc (Output_section::find_starting_output_address): Rename
9862 from starting_output_address; add PADDR parameter; change return
9863 type.
9864 * output.h (class Output_section): Declare
9865 find_starting_output_address instead of starting_output_address.
9866 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
9867 section symbol for which we can't find a merge section.
9868
0602e05a
ILT
9869 PR 9836
9870 * symtab.cc (Symbol_table::add_from_object): If the visibility is
9871 hidden or internal, force the symbol to be local.
9872 * resolve.cc (Symbol::override_visibility): Define.
9873 (Symbol::override_base): Use override_visibility.
9874 (Symbol_table::resolve): Likewise.
9875 (Symbol::override_base_with_special): Likewise.
9876 (Symbol_table::override_with_special): If the visibility is hidden
9877 or internal, force the symbol to be local.
9878 * symtab.h (class Symbol): Add set_visibility and
9879 override_visibility.
9880 * testsuite/ver_test_1.sh: New file.
9881 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
9882 (check_DATA): Add ver_test_1.syms.
9883 (ver_test_1.syms): New target.
9884 * testsuite/Makefile.in: Rebuild.
9885
401a9a73
CC
98862009-02-25 Cary Coutant <ccoutant@google.com>
9887
9888 * layout.cc (Layout::choose_output_section): Don't rename sections
9889 when using a linker script that has a SECTIONS clause.
9890 * Makefile.in: Regenerate.
9891
9892 * testsuite/Makefile.am (script_test_5.sh): New test case.
9893 * testsuite/Makefile.in: Regenerate.
9894 * testsuite/script_test_5.cc: New file.
9895 * testsuite/script_test_5.sh: New file.
9896 * testsuite/script_test_5.t: New file.
9897
f488e4b0
CC
98982009-02-13 Rafael Avila de Espindola <espindola@google.com>
9899
9900 * archive.cc (Archive::include_member): Update calls to add_symbols.
9901 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
9902 the Layout argument.
9903 * dynobj.h (do_add_symbols): Add the Layout argument.
9904 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
9905 Layout argument.
9906 * object.h (Object::add_symbols): Add the Layout argument.
9907 (Object::do_add_symbols): Add the Layout argument.
9908 (Sized_relobj::do_add_symbols): Add the Layout argument.
9909 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
9910 Unify the two versions.
9911 (Add_plugin_symbols): Remove.
9912 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
9913 (Sized_pluginobj::do_add_symbols): Unify the two versions.
9914 (Add_plugin_symbols): Remove.
9915 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
9916 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
9917 (Add_symbols::run): Make it work with Pulginobj.
9918
89dd1680
ILT
99192009-02-06 Ian Lance Taylor <iant@google.com>
9920
9921 * object.cc (Sized_relobj::do_layout): Make info message start
9922 with lower case letter.
9923
266d0a74
ILT
99242009-02-06 Mikolaj Zalewski <mikolajz@google.com>
9925
602b464e
ILT
9926 * binary.cc: Fix file comment.
9927
266d0a74
ILT
9928 * options.h (enum Incremental_disposition): Define.
9929 (class General_options): Add new options: --incremental,
9930 --incremental_changed, --incremental_unchanged,
9931 --incremental_unknown. Add incremental_disposition_ and
9932 implicit_incremental_ fields.
9933 (General_options::incremental_disposition): New function.
9934 (class Position_dependent_options): Add incremental_disposition
9935 option.
9936 (Position_dependent_options::copy_from_options): Set incremental
9937 dispositions.
9938 * options.cc (General_options::parse_incremental_changed): New
9939 function.
9940 (General_options::parse_incremental_unchanged): New function.
9941 (General_options::parse_incremental_unknown): New function.
9942 (General_options::General_options): Initialize new fields
9943 incremental_disposition_ and implicit_incremental_.
9944 (General_options::finalize): Check for uasge of --incremental-*
9945 without --incremental.
9946
f073bbf7
CD
99472009-02-06 Chris Demetriou <cgd@google.com>
9948
9949 * gold.h (gold_undefined_symbol): Change to take only a Symbol
9950 pointer and to report location as the file name associated with
9951 the symbol.
9952 (gold_undefined_symbol_at_location): New function to replace the
9953 old gold_undefined_symbol functionality.
9954 * target-reloc.h (relocate_section): Update to use
9955 gold_undefined_symbol_at_location.
9956 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
9957 Call gold_undefined_symbol function rather than gold_error.
9958 * errors.h (Errors::undefined_symbol): Take location as a
9959 string, rather than calculating it from a relocation.
9960 * errors.cc (Errors::fatal): Print "fatal error:" before the
9961 formatted message.
9962 (Errors::error, Errors::error_at_location): Print "error: "
9963 before the formatted message.
9964 (Errors::undefined_symbol): Take location as a string, rather
9965 than calculating it from a relocation.
9966 (gold_undefined_symbol_at_location): New function akin to
9967 old gold_undefined_symbol, calculates location from relocation.
9968 (gold_undefined_symbol): Change to take only a Symbol pointer
9969 and to report location as the file name associated with the symbol.
9970 * testsuite/debug_msg.sh: Update for changed error messages.
9971 * testsuite/undef_symbol.sh: Likewise.
9972
8e94a90c
ILT
99732009-02-04 Duncan Sands <baldrick@free.fr>
9974
9975 PR 9812
9976 * reduced_debug_output.h
9977 (Output_reduced_debug_abbrev_section::failed): Use format for
9978 gold_warning.
9979 (Output_reduced_debug_info_section::faild): Likewise.
9980
88a0e15b
ILT
99812009-01-31 Mikolaj Zalewski <mikolajz@google.com>
9982
9983 * script.cc (Lazy_demangler): New class.
9984 (Version_script_info::get_symbol_version_helper): Demangle a
9985 symbol only once.
9986
5efc7cd2
CC
99872009-01-29 Cary Coutant <ccoutant@google.com>
9988
9989 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
9990 to __tls_get_addr.
9991 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
9992
e0ebcf42
ILT
99932009-01-28 Ian Lance Taylor <iant@google.com>
9994
5efc7cd2 9995 * version.cc (version_string): Bump to 1.9.
75fe7426 9996
e0ebcf42
ILT
9997 * gold.h: Include <cstring> and <stdint.h>.
9998 * version.cc: Include <cstdio>.
9999 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
10000 warning.
10001 * reduced_debug_output.cc (insert_into_vector): Rename from
10002 Insert_into_vector; change all callers. Use Swap_unaligned to
10003 avoid aliasing issue; remove union since it is unnecessary.
10004
8e2813be 100052009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
10006
10007 * Makefile.am (CCFILES): Add gc.cc.
10008 (HFILES): Add gc.h.
10009 * Makefile.in: Regenerate.
10010 * gold.cc (Gc_runner): New class.
10011 (queue_initial_tasks): Call garbage collection related tasks
10012 when corresponding options are invoked.
10013 (queue_middle_gc_tasks): New function.
10014 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
10015 processed early before laying out sections during garbage collection.
10016 * gold.h (queue_middle_gc_tasks): New function.
10017 (is_prefix_of): Move from "layout.cc".
10018 * i386.cc (Target_i386::gc_process_relocs): New function.
10019 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
10020 * main.cc (main): Create object of class "Garbage_collection".
10021 * object.cc (Relobj::copy_symbols_data): New function.
10022 (Relobj::is_section_name_included): New function.
e1df38aa
NC
10023 (Sized_relobj::do_layout): Allow this function to be called twice
10024 during garbage collection and defer layout of section during the
6d03d481
ST
10025 first call.
10026 * object.h (Relobj::get_symbols_data): New function.
10027 (Relobj::is_section_name_included): New function.
10028 (Relobj::copy_symbols_data): New function.
10029 (Relobj::set_symbols_data): New function.
10030 (Relobj::get_relocs_data): New function.
10031 (Relobj::set_relocs_data): New function.
10032 (Relobj::is_output_section_offset_invalid): New pure virtual function.
10033 (Relobj::gc_process_relocs): New function.
10034 (Relobj::do_gc_process_relocs): New pure virtual function.
10035 (Relobj::sd_): New data member.
10036 (Sized_relobj::is_output_section_offset_invalid): New function.
10037 (Sized_relobj::do_gc_process_relocs): New function.
10038 * options.h (General_options::gc_sections): Modify to not be a no-op.
10039 (General_options::print_gc_sections): New option.
10040 * plugin.cc (Plugin_finish::run): Remove function call to
10041 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
10042 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
10043 * reloc.cc (Read_relocs::run): Add task to process relocs and
10044 determine unreferenced sections when doing garbage collection.
10045 (Gc_process_relocs): New class.
10046 (Sized_relobj::do_gc_process_relocs): New function.
10047 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
10048 sections that are garbage collected.
10049 * reloc.h (Gc_process_relocs): New class.
10050 * sparc.cc (Target_sparc::gc_process_relocs): New function.
10051 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
10052 symbols whose corresponding sections are garbage collected.
10053 (Symbol_table::Symbol_table): Add new parameter for the garbage
10054 collection object.
10055 (Symbol_table::gc_mark_undef_symbols): New function.
10056 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10057 (Symbol_table::gc_mark_dyn_syms): New function.
10058 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
10059 as garbage.
10060 (Symbol_table::add_from_object): Likewise.
10061 (Symbol_table::add_from_relobj): When building shared objects, do not
10062 treat externally visible symbols as garbage.
10063 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
10064 table information for static and relocatable links.
10065 * symtab.h (Symbol_table::set_gc): New function.
10066 (Symbol_table::gc): New function.
10067 (Symbol_table::gc_mark_undef_symbols): New function.
10068 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10069 (Symbol_table::gc_mark_dyn_syms): New function.
10070 (Symbol_table::gc_): New data member.
e1df38aa 10071 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
10072 function.
10073 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
10074 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
10075
3b293544
CF
100762009-01-20 Chris Faylor <me.sourceware@sourceware.org>
10077
10078 * options.h (General_options::gc_sections): Define as a no-op for now.
10079 (General_options::no_keep_memory): Ditto.
10080 (General_options::Bshareable): Define.
10081 * options.cc (General_options::finalize): Honor -Bshareable.
10082
83d22aa8
AS
100832009-01-20 Andreas Schwab <schwab@suse.de>
10084
10085 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
10086 read the value in the contents, since we don't use it. Use the
10087 template endianness when writing.
10088 (Relocate::relocate): Use it for R_PPC_REL16_HA.
10089
cd536b21
AS
100902009-01-19 Andreas Schwab <schwab@suse.de>
10091
10092 * configure.tgt (powerpc64-*): Fix targ_obj.
10093
99e9a495
ILT
100942009-01-15 Ian Lance Taylor <iant@google.com>
10095
10096 * object.cc (Sized_relobj::write_local_symbols): Don't write out
10097 local symbols when stripping all symbols.
10098
bbbfea06
CC
100992009-01-14 Cary Coutant <ccoutant@google.com>
10100
99e9a495 10101 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 10102
0f7c0701
CC
101032009-01-14 Cary Coutant <ccoutant@google.com>
10104
10105 * archive.cc (Archive::get_elf_object_for_member): Remove call
10106 to File_read::claim_for_plugin.
10107 * descriptors.cc (Descriptors::open): Remove reference to
10108 is_claimed.
10109 (Descriptors::claim_for_plugin): Remove.
10110 * descriptors.h (Descriptors::claim_for_plugin): Remove.
10111 (Descriptors::is_claimed): Remove.
10112 (claim_descriptor_for_plugin): Remove.
10113 * fileread.cc (File_read::claim_for_plugin): Remove.
10114 * fileread.h (File_read::claim_for_plugin): Remove.
10115 (File_read::descriptor): Reopen descriptor if necessary.
10116 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
10117 (Plugin_manager::all_symbols_read): Add task parameter. Change
10118 all callers.
10119 (Plugin_manager::get_input_file): New function.
10120 (Plugin_manager::release_input_file): New function.
10121 (Pluginobj::Pluginobj): Add filesize parameter and initialize
10122 corresponding data member.
10123 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
10124 and pass to base constructor. Change all callers.
10125 (get_input_file, release_input_file): New functions.
10126 (make_sized_plugin_object): Add filesize parameter. Change all callers.
10127 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
10128 (Plugin_manager::all_symbols_read): Add task parameter.
10129 (Plugin_manager::get_input_file): New function.
10130 (Plugin_manager::release_input_file): New function.
10131 (Plugin_manager::task_): New data member.
10132 (Pluginobj::Pluginobj): Add filesize parameter.
10133 (Pluginobj::filename): New function.
10134 (Pluginobj::descriptor): New function.
10135 (Pluginobj::filesize): New function.
10136 (Pluginobj::filesize_): New data member.
10137 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
10138 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
10139 File_read::claim_for_plugin; use Object::unlock to unlock the file.
10140
10141 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
10142 with archive libraries.
10143 * testsuite/Makefile.in: Regenerate.
10144 * testsuite/plugin_test.c (struct sym_info): New type.
10145 (get_input_file, release_input_file): New static variables.
10146 (onload): Capture new transfer vector entries.
10147 (claim_file_hook): Stop reading at end of file according to filesize.
10148 Factor out parsing of readelf output into separate function.
10149 (all_symbols_read_hook): Exercise get_input_file and release_input_file
10150 APIs and get the source file name from the symbol table. Convert
10151 source file name to corresponding object file name. Print info
10152 message when adding new input files.
10153 (parse_readelf_line): New function.
10154 * testsuite/plugin_test_1.sh: Add checks for new info messages.
10155 * testsuite/plugin_test_2.sh: Likewise.
10156 * testsuite/plugin_test_3.sh: Likewise.
10157 * testsuite/plugin_test_4.sh: New test case.
10158
62a6d109
ILT
101592009-01-07 Ian Lance Taylor <iant@google.com>
10160
10161 * version.cc (version_string): Bump to 1.8.
10162
483620e8
CC
101632008-12-23 Cary Coutant <ccoutant@google.com>
10164
10165 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
10166 * plugin.cc (Plugin_manager::finish): Rename as
10167 layout_deferred_objects. Move cleanup to separate function.
10168 (Plugin_manager::cleanup): New function.
10169 (Plugin_finish::run): Call layout_deferred_objects and cleanup
10170 separately.
10171 * plugin.h (Plugin_manager::finish): Rename as
10172 layout_deferred_objects.
10173 (Plugin_manager::cleanup): New function.
10174 (Plugin_manager::cleanup_done): New field.
10175
d66a9eb3
CC
101762008-12-23 Cary Coutant <ccoutant@google.com>
10177
10178 * plugin.cc (is_visible_from_outside): New function.
10179 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
10180 so we don't return "IR only" status for exported symbols or -r links.
10181
10182 * testsuite/Makefile.am (plugin_test_3): New test case.
10183 * testsuite/Makefile.in: Regenerate.
10184 * testsuite/plugin_test_3.sh: New file.
10185
5995b570
CC
101862008-12-22 Cary Coutant <ccoutant@google.com>
10187
10188 * object.cc (Sized_relobj::layout_section): New function.
10189 (Sized_relobj::do_layout): Defer layout of input sections until after
10190 plugin has provided replacement files.
10191 (Sized_relobj::do_layout_deferred_sections): New function.
10192 * object.h (Relobj::set_section_offset): Remove virtual keyword.
10193 (Relobj::layout_deferred_sections): New function.
10194 (Relobj::do_layout_deferred_sections): New function.
10195 (Sized_relobj::do_layout_deferred_sections): New function.
10196 (Sized_relobj::layout_section): New function.
10197 (Sized_relobj::Deferred_layout): New structure.
10198 (Sized_relobj::deferred_layout_): New field.
10199 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
10200 Change all callers. Layout deferred sections.
10201 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
10202 references.
10203 (Plugin_hook::run): Move code from do_plugin_hook inline.
10204 (Plugin_hook::do_plugin_hook): Remove.
10205 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
10206 (Plugin_manager::finish): Renamed, was cleanup.
10207 (Plugin_manager::should_defer_layout): New function.
10208 (Plugin_manager::add_deferred_layout_object): New function.
10209 (Plugin_manager::Deferred_layout_list): New type.
10210 (Plugin_manager::deferred_layout_objects_): New field.
10211 (Plugin_hook::do_plugin_hook): Remove.
10212
ee769c88
ILT
102132008-12-17 Ian Lance Taylor <iant@google.com>
10214
10215 * options.h (class General_options): Add --no case for
10216 --export-dynamic.
10217
abc8dcba
CC
102182008-12-16 Cary Coutant <ccoutant@google.com>
10219
10220 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
10221 vector.
10222 (Plugin_manager::claim_file): Create plugin object even if
10223 plugin did not call the add_symbols callback.
10224 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
10225 asking for more symbols than were added.
10226 * testsuite/Makefile.am (plugin_test_1): Add test case with
10227 no global symbols.
10228 (empty.syms): New target.
10229 * testsuite/Makefile.in: Regenerate.
10230 * testsuite/plugin_test.c (claim_file_hook): Add new debug
10231 message. Don't call add_symbols if no globals.
10232 (all_symbols_read_hook): Don't provide replacement for empty
10233 claimed file.
10234
b0074644
ILT
102352008-12-12 Ian Lance Taylor <iant@google.com>
10236
68943102
ILT
10237 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
10238 r_type == 0 for a local symbol with r_sym == 0.
10239 (scan_relocatable_relocs): Pass r_sym to
10240 local_non_section_strategy.
10241 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
10242 r_sym parameter.
10243
b0074644
ILT
10244 * configure.ac: Update test for TLS descriptors: they are
10245 supported as of glibc 2.9.
10246 * configure: Rebuild.
10247
c2508178
ILT
102482008-12-11 Ian Lance Taylor <iant@google.com>
10249
10250 PR 7091
10251 * target-reloc.h (Default_scan_relocatable_relocs): For each
10252 function, map r_type == 0 to RELOC_DISCARD.
10253
2756a258
CC
102542008-12-10 Cary Coutant <ccoutant@google.com>
10255
10256 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
10257 object to override a kept COMDAT group from a plugin object.
10258
bb6f53d3
ILT
102592008-12-09 Ian Lance Taylor <iant@google.com>
10260
fbc558e1
ILT
10261 PR 7088
10262 * yyscript.y (file_cmd): Handle INPUT.
10263
bb6f53d3
ILT
10264 * testsuite/initpri1.c: Change all declarations to be full
10265 prototypes by adding void, to avoid compiler warnings.
10266
4674ecfc
CC
102672008-12-05 Rafael Avila de Espindola <espindola@google.com>
10268
10269 * options.cc (General_options::parse_plugin_opt): New.
10270 (General_options::add_plugin): The argument now is just the filename.
10271 (General_options::add_plugin_option): New.
10272 * options.h (plugin_opt): New.
10273 (add_plugin): Change argument name.
10274 (add_plugin_option): New.
10275 * plugin.cc (Plugin::load): Don't parse the plugin option.
10276 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
10277 (Plugin::add_option): New.
10278 (Plugin::args_): Change type.
10279 (Plugin::filename_): New.
10280 (Plugin_manager::add_plugin_option): New.
10281 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
10282 * testsuite/Makefile.in: Regenerate.
10283
fd06b4aa
CC
102842008-12-05 Cary Coutant <ccoutant@google.com>
10285
10286 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
10287 Handle --strip-lto-sections option.
10288 * options.h (strip_lto_sections): New option.
10289
6c52134c
CC
102902008-12-01 Cary Coutant <ccoutant@google.com>
10291
10292 * plugin.cc (ld_plugin_message): Change format parameter to const.
10293 Fix mismatch between new[] and delete.
10294
a45248e0
CC
102952008-11-14 Cary Coutant <ccoutant@google.com>
10296
10297 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
10298 instead of -1U.
10299
c82fbeee
CS
103002008-11-05 Craig Silverstein <csilvers@google.com>
10301
10302 * options.cc (General_options::parse_dynamic_list): New function.
10303 * options.h (General_options): New flags dynamic_list,
10304 dynamic_list_data, dynamic_list_cpp_new, and
10305 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
10306 (General_options::in_dynamic_list): New function.
10307 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
10308 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
10309 (Lex::can_continue_name): Likewise.
10310 (yylex): Likewise.
10311 (read_script_file): New parameter script_options.
10312 (read_dynamic_list): New function.
10313 (Script_options::define_dynamic_list): New function.
10314 (dynamic_list_keyword_parsecodes): New variable.
10315 (dynamic_list_keywords): New variable.
10316 * script.h (Script_options::define_dynamic_list): New function
10317 prototype.
10318 (read_dynamic_list): New function prototype.
10319 * symtab.cc (strprefix): New macro.
10320 (Symbol::should_add_dynsym_entry): Support dynamic_list,
10321 dynamic_list_data, dynamic_list_cpp_new, and
10322 dynamic_list_cpp_typeinfo.
10323 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
10324 (dynamic_list_expr): New rule.
10325 (dynamic_list_nodes): Likewise.
10326 (dynamic_list_node): Likewise.
10327 * testsuite/Makefile.am (dynamic_list): New test.
10328 * testsuite/Makefile.in: Regenerated.
10329 * testsuite/dynamic_list.t: New file.
10330 * testsuite/dynamic_list.sh: New file.
10331
e0bb29a5
CS
103322008-11-05 Craig Silverstein <csilvers@google.com>
10333
10334 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
10335 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
10336 (t11_last): Likewise.
10337 * testsuite/ver_test_6.c (main): Likewise.
10338
4e1e25e0
CC
103392008-10-07 Cary Coutant <ccoutant@google.com>
10340
10341 * options.c (General_options::finalize): Add check for -static and
10342 -shared.
10343 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
10344 is not empty.
10345
92f03fcb
CC
103462008-10-02 Cary Coutant <ccoutant@google.com>
10347
10348 * plugin.cc (make_sized_plugin_object): Fix conditional
10349 compilation to work when not all targets are enabled.
10350
fbd8a257
CC
103512008-09-29 Cary Coutant <ccoutant@google.com>
10352
10353 * archive.cc (Archive::get_file_and_offset): Use filename instead
10354 of name to get library path.
10355 (Archive::include_member): Unlock external member of a thin archive.
10356
10357 * testsuite/Makefile.am (TEST_AR): New variable.
10358 (thin_archive_test_1): New test.
10359 (thin_archive_test_2): New test.
81636b3f
CC
10360 * testsuite/Makefile.in: Regenerate.
10361 * testsuite/thin_archive_main.cc: New file.
10362 * testsuite/thin_archive_test_1.cc: New file.
10363 * testsuite/thin_archive_test_2.cc: New file.
10364 * testsuite/thin_archive_test_3.cc: New file.
10365 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 10366
eff45813
CC
103672008-09-29 Cary Coutant <ccoutant@google.com>
10368
10369 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
10370 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
10371 instead of -1U.
10372 (Sized_relobj::do_finalize_local_symbols): Likewise.
10373 (Sized_relobj::map_to_kept_section): Likewise.
10374 * object.h (Sized_relobj::invalid_address): New constant.
10375 (Sized_relobj::do_output_section_offset): Check for invalid_address
10376 and return -1ULL.
10377 * output.cc (Output_reloc::local_section_offset): Use constant
10378 invalid_address instead of -1U.
10379 (Output_reloc::get_address): Likewise.
10380 (Output_section::output_address): Change -1U to -1ULL.
10381 * output.h (Output_reloc::invalid_address): New constant.
10382 * reloc.cc (Sized_relobj::write_sections): Use constant
10383 invalid_address instead of -1U.
10384 (Sized_relobj::relocate_sections): Likewise.
10385 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
10386 values for merge sections.
10387 * target-reloc.h (relocate_for_relocatable): Use constant
10388 invalid_address instead of -1U.
10389
89fc3421
CC
103902008-09-19 Cary Coutant <ccoutant@google.com>
10391
10392 Add plugin functionality for link-time optimization (LTO).
10393 * configure.ac (plugins): Add --enable-plugins option.
10394 * configure: Regenerate.
10395 * config.in: Regenerate.
10396 * Makefile.am (LIBDL): New variable.
10397 (CCFILES): Add plugin.cc.
10398 (HFILES): Add plugin.h.
10399 (ldadd_var): Add LIBDL.
10400 * Makefile.in: Regenerate.
10401
10402 * archive.cc: Include "plugin.h".
10403 (Archive::setup): Don't preread archive symbols when using a plugin.
10404 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
10405 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
10406 files.
10407 (Archive::include_member): Add symbols from plugin objects.
10408 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
10409 * descriptors.cc (Descriptors::open): Check for file descriptors
10410 abandoned by plugins.
10411 (Descriptors::claim_for_plugin): New function.
10412 * descriptors.h (Descriptors::claim_for_plugin): New function.
10413 (Open_descriptor::is_claimed): New field.
10414 (claim_descriptor_for_plugin): New function.
10415 * fileread.cc (File_read::claim_for_plugin): New function.
10416 * fileread.h (File_read::claim_for_plugin): New function.
10417 (File_read::descriptor): New function.
10418 * gold.cc: Include "plugin.h".
10419 (queue_initial_tasks): Add task to call plugin hooks for generating
10420 new object files.
10421 * main.cc: Include "plugin.h".
10422 (main): Load plugin libraries.
10423 * object.h (Pluginobj): Declare.
10424 (Object::pluginobj): New function.
10425 (Object::do_pluginobj): New function.
10426 (Object::set_target): New function.
10427 * options.cc: Include "plugin.h".
10428 (General_options::parse_plugin): New function.
10429 (General_options::General_options): Initialize plugins_ field.
10430 (General_options::add_plugin): New function.
10431 * options.h (Plugin_manager): Declare.
10432 (General_options): Add --plugin option.
10433 (General_options::has_plugins): New function.
10434 (General_options::plugins): New function.
10435 (General_options::add_plugin): New function.
10436 (General_options::plugins_): New field.
10437 * plugin.cc: New file.
10438 * plugin.h: New file.
10439 * readsyms.cc: Include "plugin.h".
10440 (Read_symbols::do_read_symbols): Check for archive before checking
10441 for ELF file. Call plugin hooks to claim files.
10442 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
10443 from a real object file; force override when processing replacement
10444 files.
10445 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
10446 (Symbol::init_base_object): Likewise.
10447 (Symbol::init_base_output_data): Likewise.
10448 (Symbol::init_base_output_segment): Likewise.
10449 (Symbol::init_base_constant): Likewise.
10450 (Symbol::init_base_undefined): Likewise.
10451 (Symbol::output_section): Assert that object is not a plugin.
10452 (Symbol_table::add_from_pluginobj): New function.
10453 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
10454 undefined.
10455 (Symbol_table::sized_write_globals): Likewise.
10456 (Symbol_table::add_from_pluginobj): Instantiate template.
10457 * symtab.h (Sized_pluginobj): Declare.
10458 (Symbol::in_real_elf): New function.
10459 (Symbol::set_in_real_elf): New function.
10460 (Symbol::in_real_elf_): New field.
10461 (Symbol_table::add_from_pluginobj): New function.
10462
10463 * testsuite/Makefile.am (AM_CFLAGS): New variable.
10464 (LIBDL): New variable.
10465 (LDADD): Add LIBDL.
10466 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
10467 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
10468 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
10469 (MOSTLYCLEANFILES): Likewise.
10470 * testsuite/Makefile.in: Regenerate.
10471 * testsuite/plugin_test.c: New file.
10472 * testsuite/plugin_test_1.sh: New file.
10473 * testsuite/plugin_test_2.sh: New file.
10474
de31bda5
ILT
104752008-09-16 Ian Lance Taylor <iant@google.com>
10476
9c2d0ef9
ILT
10477 * target-reloc.h (relocate_section): Check whether a symbol is
10478 defined by the ABI before reporting an undefined symbol error.
10479 * target.h (Target::is_defined_by_abi): Make parameter const.
10480 (Target::do_is_defined_by_abi): Likewise.
10481 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
10482 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
10483 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
10484 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
10485 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
10486 * testsuite/Makefile.in: Rebuild.
10487
de31bda5
ILT
10488 * fileread.cc (make_view): Add casts to avoid warning.
10489
9fa33bee
AO
104902008-09-16 Alexandre Oliva <aoliva@redhat.com>
10491
10492 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
10493 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
10494
183fd0e3
AO
104952008-09-16 Alexandre Oliva <aoliva@redhat.com>
10496
10497 * options.h (General_options::output_is_executable): New.
10498 (General_options::output_is_pie): New.
10499 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
10500 for shared libraries.
10501 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
10502
7be8330a
CD
105032008-09-11 Chris Demetriou <cgd@google.com>
10504
10505 * options.h (origin): New -z option.
10506 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
10507 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
10508 in DT_FLAGS_1.
10509
a9caad02
CC
105102008-09-05 Cary Coutant <ccoutant@google.com>
10511
10512 * fileread.cc (File_read::make_view): Add check for attempt to map
10513 beyond end of file.
10514
ae6dce4d
CC
105152008-09-05 Cary Coutant <ccoutant@google.com>
10516
10517 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
10518 explicit instantiations.
10519
d7ab2a47
KVH
105202008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
10521
10522 PR gold/6858
10523 * options.cc (General_options::finalize): Allow undefined symbols
10524 in shlibs if linking -shared.
10525
10526 PR gold/6859
10527 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
10528 symbols as not needing a dynsym entry.
10529
1e52a9c1
CS
105302008-08-20 Craig Silverstein <csilvers@google.com>
10531
10532 * fileread.cc (File_read::open): Do not lock the file unless it
10533 was successfully opened.
10534
d85c80a3
CC
105352008-08-14 Cary Coutant <ccoutant@google.com>
10536
10537 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
10538 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
10539 * testsuite/tls_test.cc (struct int128): 128-bit struct
10540 for testing TLS relocs with non-zero addend.
10541 (v12): New TLS variable.
10542 (t12): New test.
10543 (t_last): Add check for v12.
10544 * testsuite/tls_test.h (t12): New function.
10545 * testsuite/tls_test_main.cc (thread_routine): Call new test.
10546
2d924fd9
ILT
105472008-08-13 Ian Lance Taylor <iant@google.com>
10548
10549 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
10550 set tls_segment_ or relro_segment_.
10551 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
10552 when appropriate.
10553 * output.h (Output_section::clear_is_relro): New function.
10554 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
10555 sections specially even when output_data_ is empty.
10556 (Output_segment::maximum_alignment): When first section is relro,
10557 only force alignment for PT_LOAD segments.
10558 * script.cc (script_data_segment_align): New function.
10559 (script_data_segment_relro_end): New function.
10560 * script-c.h (script_data_segment_align): Declare.
10561 (script_data_segment_relro_end): Declare.
10562 * script-sections.h (class Script_sections): Declare
10563 data_segment_align and data_segment_relro_end. Add fields
10564 segment_align_index_ and saw_relro_end_.
10565 * script-sections.cc (class Sections_element): Add set_is_relro
10566 virtual function. Add new bool* parameter to place_orphan_here.
10567 Add get_output_section virtual function.
10568 (class Output_section_definition): Add set_is_relro. Add new
10569 bool* parameter to place_orphan_here. Add get_output_section.
10570 Add is_relro_ field.
10571 (Output_section_definition::Output_section_definition): Initialize
10572 evaluated_address_, evaluated_load_address, evaluated_addralign_,
10573 and is_relro_ fields.
10574 (Output_section_definition::place_orphan_here): Add is_relro
10575 parameter.
10576 (Output_section_definition::set_section_addresses): Set relro for
10577 output section.
10578 (Output_section_definition::alternate_constraint): Likewise.
10579 (class Orphan_output_section): Add new bool* parameter to
10580 place_orphan_here. Add get_output_section.
10581 (Orphan_output_section::place_orphan_here): Add is_relro
10582 parameter.
10583 (Script_sections::Script_sections): Initialize
10584 data_segment_align_index_ and saw_relro_end_.
10585 (Script_sections::data_segment_align): New function.
10586 (Script_sections::data_segment_relro_end): New function.
10587 (Script_sections::place_orphan): Set or clear is_relro.
10588 (Script_sections::set_section_addresses): Force alignment of first
10589 TLS section.
10590 * yyscript.y (exp): Call script_data_segment_align and
10591 script_data_segment_relro_end.
10592 * testsuite/relro_script_test.t: New file.
10593 * testsuite/relro_test.cc (using_script): Declare.
10594 (t1, t2): Test using_script.
10595 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
10596 (relro_script_test_SOURCES): Define.
10597 (relro_script_test_DEPENDENCIES): Define.
10598 (relro_script_test_LDFLAGS): Define.
10599 (relro_script_test_LDADD): Define.
10600 (relro_script_test.so): New target.
10601 * testsuite/Makefile.in: Rebuild.
10602
f827c9a9
CC
106032008-08-06 Cary Coutant <ccoutant@google.com>
10604
10605 * archive.cc (Archive::total_archives, Archive::total_members)
10606 (Archive::total_members_loaded): New variables.
10607 (Archive::setup): Add parameter. Add option to preread
10608 archive symbols.
10609 (Archive::read_armap): Add counter.
10610 (Archive::get_file_and_offset): New function.
10611 (Archive::get_elf_object_for_member): New function.
10612 (Archive::read_all_symbols): New function.
10613 (Archive::read_symbols): New function.
10614 (Archive::add_symbols): Add counters.
10615 (Archive::include_all_members): Use armap to find members if it's
10616 already built.
10617 (Archive::include_member): Skip reading symbols if already read.
10618 Factored code into Archive::get_file_and_offset and
10619 Archive::get_elf_object_for_member. Changed call to
10620 Mapfile::report_include_archive_member.
10621 (Archive::print_stats): New function.
10622 * archive.h: Declare Object and Read_symbols_data classes.
10623 (Archive::Archive): Add initializers for new members.
10624 (Archive::setup): Add parameter.
10625 (Archive::print_stats): New function.
10626 (Archive::total_archives, Archive::total_members)
10627 (Archive::total_members_loaded): New variables.
10628 (Archive::get_file_and_offset): New function.
10629 (Archive::get_elf_object_for_member): New function.
10630 (Archive::read_all_symbols): New function.
10631 (Archive::read_symbols): New function.
10632 (Archive::Archive_member): New class.
10633 (Archive::members_): New member.
10634 (Archive::num_members_): New member.
10635 * main.cc: Include archive.h.
10636 (main): Call Archive::print_stats.
10637 * mapfile.cc (Mapfile::report_include_archive_member): Delete
10638 archive parameter; member_name is now the fully-decorated name.
10639 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
10640 * options.h: (General_options): Add --preread-archive-symbols option.
10641 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
10642 Archive::setup.
10643
de4c45bd
ILT
106442008-08-04 Ian Lance Taylor <iant@google.com>
10645
10646 * symtab.h (Symbol::use_plt_offset): New function.
10647 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
10648 * powerpc.cc (Relocate::relocate): Likewise.
10649 * sparc.cc (Relocate::relocate): Likewise.
10650 * x86_64.cc (Relocate::relocate): Likewise.
10651 * testsuite/weak_plt.sh: New test.
10652 * testsuite/weak_plt_main.cc: New test.
10653 * testsuite/weak_plt_shared.cc: New test.
10654 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
10655 (check_PROGRAMS): Add weak_plt.
10656 (check_DATA): Add weak_plt_shared.so.
10657 (weak_plt_main_pic.o, weak_plt): New targets.
10658 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
10659 * testsuite/Makefile.in: Rebuild.
10660
10661 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
10662 gcctestdir/ld.
10663 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
10664 * testsuite/Makefile.in: Rebuild.
10665
323ee3f4
AM
106662008-08-04 Alan Modra <amodra@bigpond.net.au>
10667
10668 * Makefile.am (POTFILES.in): Set LC_ALL=C.
10669 * Makefile.in: Regenerate.
10670 * po/POTFILES.in: Regenerate.
10671
7c07ecec
ILT
106722008-07-29 Ian Lance Taylor <iant@google.com>
10673
10674 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
10675 symbols before other symbols.
10676 * testsuite/script_test_2.cc (test_addr): Declare.
10677 (test_addr_alias): Declare.
10678 (main): Check that test_addr and test_addr_alias have the right
cd536b21 10679 values.
7c07ecec
ILT
10680 * testsuite/script_test_2.t: Define test_addr_alias and
10681 test_addr.
10682
5778530e
ILT
106832008-07-24 Ian Lance Taylor <iant@google.com>
10684
2a00e4fb
ILT
10685 PR 5990
10686 * descriptors.cc: New file.
10687 * descriptors.h: New file.
10688 * gold-threads.h (class Hold_optional_lock): New class.
10689 * fileread.cc: Include "descriptors.h".
10690 (File_read::~File_read): Release descriptor rather than closing
10691 it.
10692 (File_read::open) [file]: Call open_descriptor rather than open.
10693 Set is_descriptor_opened_.
10694 (File_read::open) [memory]: Assert that descriptor is not open.
10695 (File_read::reopen_descriptor): New function.
10696 (File_read::release): Release descriptor.
10697 (File_read::do_read): Make non-const. Reopen descriptor.
10698 (File_read::read): Make non-const.
10699 (File_read::make_view): Reopen descriptor.
10700 (File_read::do_readv): Likewise.
10701 * fileread.h (class File_read): Add is_descriptor_opened_ field.
10702 Update declarations.
10703 * layout.cc: Include "descriptors.h".
10704 (Layout::create_build_id): Use open_descriptor rather than open.
10705 * output.cc: Include "descriptors.h".
10706 (Output_file::open): Use open_descriptor rather than open.
10707 * archive.cc (Archive::const_iterator): Change Archive to be
10708 non-const.
10709 (Archive::begin, Archive::end): Make non-const.
10710 (Archive::count_members): Likewise.
10711 * archive.h (class Archive): Update declarations.
10712 * object.h (Object::read): Make non-const.
10713 * Makefile.am (CCFILES): Add descriptors.cc.
10714 (HFILES): Add descriptors.h.
10715 * Makefile.in: Rebuild.
10716
801647d1
ILT
10717 PR 6716
10718 * gold.h: Always include <clocale>. Add Solaris workarounds
10719 following code in binutils/sysdep.h.
10720
5edd166e
ILT
10721 PR 6048
10722 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
10723 this->eh_frame_hdr_ is NULL before using it.
10724
c89ad728
ILT
10725 * dynobj.cc (Versions::Versions): Update comment.
10726
aa86f06b
ILT
10727 * dynobj.cc (Versions::Versions): If there is an soname, use it as
10728 the base version name.
10729
5778530e
ILT
10730 * stringpool.cc (Stringpool_template::add_with_length): Set key to
10731 array size plus one.
10732 (Stringpool_template::set_string_offsets): Subtract one from key
10733 before using it as an array index.
10734 (Stringpool_template::get_offset_with_length): Likewise.
10735 (Stringpool_template::write_to_buffer): Likewise.
10736 * stringpool.h (Stringpool_template::get_offset_from_key):
10737 Likewise.
10738
057ead22
ILT
107392008-07-23 Ian Lance Taylor <iant@google.com>
10740
7f649c59
ILT
10741 PR 6658
10742 * object.h (Merged_symbol_value::value): Do our best to handle a
10743 negative addend.
10744
057ead22
ILT
10745 PR 6647
10746 * script.cc (Version_script_info::get_versions): Don't add empty
10747 version tag to return value.
10748 (Version_script_info::get_symbol_version_helper): Change return
10749 type to bool. Add pversion parameter. Change all callers.
10750 (script_register_vers_node): Don't require a non-NULL tag.
10751 * script.h (class Version_script_info): Update declarations.
10752 (Version_script_info::get_symbol_version): Change return type to
10753 bool. Add version parameter. Change all callers.
10754 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
10755 handling. Handle an empty version from a version script.
10756 (Symbol_table::define_special_symbol): Likewise.
10757 * testsuite/ver_test_10.script: New file.
10758 * testsuite/ver_test_10.sh: New file.
10759 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
10760 (check_DATA): Add ver_test_10.syms.
10761 (ver_test_10.syms, ver_test_10.so): New target.
10762 * testsuite/Makefile.in: Rebuild.
10763
58e54ac2
CD
107642008-07-23 Simon Baldwin <simonb@google.com>
10765
10766 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
10767 to zero for undefined symbols from dynamic libraries.
10768
95d14cd3
ILT
107692008-07-23 Ian Lance Taylor <iant@google.com>
10770
10771 * symtab.cc (Symbol_table::resolve): Remove version parameter.
10772 Change all callers.
10773 * symtab.h (class Symbol_table): Update declaration.
10774 * testsuite/ver_test_9.cc: New file.
10775 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
10776 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
10777 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
10778 (ver_test_9.so, ver_test_9.o): New targets.
10779 * testsuite/Makefile.in: Rebuild.
10780
92de84a6
ILT
107812008-07-22 Ian Lance Taylor <iant@google.com>
10782
34810851
ILT
10783 * options.h (class General_options): Define --check-sections.
10784 * layout.cc (Layout::set_segment_offsets): Handle
10785 --check-sections.
10786
af6156ef
ILT
10787 * options.h (class General_options): Define -n/--nmagic and
10788 -N/--omagic.
10789 * options.cc (General_options::finalize): For -n/--nmagic or
10790 -N/--omagic, set -static.
10791 * layout.cc (Layout::attach_allocated_section_to_segment): If
10792 -N/--omagic, don't put read-only and read-write sections in
10793 different segments.
10794 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
10795 finding a read-only segment.
10796 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
10797 don't set the minimum segment alignment to the common page size,
10798 and don't set the file offset to the address modulo the page size.
10799 * script-sections.cc (Script_sections::create_segments): If
10800 -n/--omagic, don't put read-only and read-write sections in
10801 different segments.
10802
92de84a6
ILT
10803 * cref.cc: New file.
10804 * cref.h: New file.
10805 * options.h (class General_options): Add --print-symbol-counts.
10806 * main.cc (main): Issue defined symbol report if requested.
10807 * archive.cc (Archive::interpret_header): Make into a const member
10808 function.
10809 (Archive::add_symbols): Call Input_objects::archive_start and
10810 archive_stop.
10811 (Archive::const_iterator): Define new class.
10812 (Archive::begin, Archive::end): New functions.
10813 (Archive::include_all_members): Rewrite to use iterator.
10814 (Archive::count_members): New function.
10815 * archive.h (class Archive): Update declarations.
10816 (Archive::filename): New function.
10817 * object.cc: Include "cref.h".
10818 (Sized_relobj::Sized_relobj): Initialize defined_count_.
10819 (Sized_relobj::do_get_global_symbol_counts): New function.
10820 (Input_objects::add_object): Add object to cross-referencer.
10821 (Input_objects::archive_start): New function.
10822 (Input_objects::archive_stop): New function.
10823 (Input_objects::print_symbol_counts): New function.
10824 * object.h: Declare Cref and Archive.
10825 (Object::get_global_symbol_counts): New function.
10826 (Object::do_get_global_symbol_counts): New pure virtual function.
10827 (class Sized_relobj): Add defined_count_ field. Update
10828 declarations.
10829 (class Input_objects): Add cref_ field. Update constructor.
10830 Update declarations.
10831 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
10832 defined_count_.
10833 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
10834 symbol counts.
10835 (Sized_dynobj::do_get_global_symbol_counts): New function.
10836 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
10837 defined_count_. Update declarations. Define Symbols typedef.
10838 * symtab.cc (Symbol_table::add_from_relobj): Add defined
10839 parameter. Change all callers.
10840 (Symbol_table::add_from_dynobj): Add sympointers and defined
10841 parameters. Change all callers.
10842 * symtab.h (class Symbol_table): Update declarations.
10843 * Makefile.am (CCFILES): Add cref.cc.
10844 (HFILES): Add cref.h.
10845 * Makefile.in: Rebuild.
10846
3f7c5e1d
CD
108472008-07-22 Simon Baldwin <simonb@google.com>
10848
10849 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
10850 to zero when writing undefined symbols.
10851
e0b64032
ILT
108522008-07-22 Ian Lance Taylor <iant@google.com>
10853
10854 * output.cc (Output_section::add_input_section): Don't try to
10855 merge empty merge sections.
10856
096b02cf
CS
108572008-07-21 Craig Silverstein <csilvers@google.com>
10858
10859 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
10860 Include symbol version in error message.
cd536b21 10861
1d1f116d
CD
108622008-07-20 Chris Demetriou <cgd@google.com>
10863
cd536b21 10864 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
10865 (RANDOM_SEED_CFLAGS): New substituted variable.
10866 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
10867 * configure: Rebuild.
10868 * Makefile.in: Likewise.
10869 * testsuite/Makefile.in: Likewise.
10870
a18f591e
ILT
108712008-07-18 Ian Lance Taylor <iant@google.com>
10872
10873 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
10874 where we see NAME/NULL and NAME/VERSION as separate symbols.
10875 * testsuite/ver_test_main.cc (main): Call t4.
10876 (t4, t4_2a): Define.
10877 * testsuite/ver_test_2.cc (t4_2): Define.
10878 * testsuite/ver_test_2.script: Put t4_2a in VER2.
10879 * testsuite/ver_test_4.cc (t4_2a): Define.
10880 * testsuite/ver_test_4.script: Put t4_2a in VER2.
10881 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
10882
c6e3f6ed
ILT
108832008-07-17 Ian Lance Taylor <iant@google.com>
10884
10885 * dynobj.cc (Versions::add_def): If we give an error about a
10886 missing version, go ahead and create the version anyhow.
10887
ef9beddf
ILT
108882008-07-10 Ian Lance Taylor <iant@google.com>
10889
10890 Handle output sections with more than 0x7fffffff bytes.
10891 * object.h (class Relobj): Change map_to_output_ to
10892 output_sections_, and just keep a section pointer. Change all
10893 uses. Move comdat group support to Sized_relobj.
10894 (Relobj::is_section_specially_mapped): Remove.
10895 (Relobj::output_section): Remove poff parameter. Change all
10896 callers.
10897 (Relobj::output_section_offset): New function.
10898 (Relobj::set_section_offset): Rewrite.
10899 (Relobj::map_to_output): Remove.
10900 (Relobj::output_sections): New function.
10901 (Relobj::do_output_section_offset): New pure virtual function.
10902 (Relobj::do_set_section_offset): Likewise.
10903 (class Sized_relobj): Add section_offsets_ field. Add comdat
10904 group support from Relobj. Update declarations.
10905 (Sized_relobj::get_output_section_offset): New function.
10906 (Sized_relobj::do_output_section_offset): New function.
10907 (Sized_relobj::do_set_section_offset): New function.
10908 * object.cc (Relobj::output_section_address): Remove.
10909 (Sized_relobj::Sized_relobj): Initialize new fields.
10910 (Sized_relobj::include_section_group): Cast find_kept_object to
10911 Sized_relobj.
10912 (Sized_relobj::include_linkonce_section): Likewise.
10913 (Sized_relobj::do_layout): Use separate arrays for output section
10914 and output offset.
10915 (Sized_relobj::do_count_local_symbols): Change map_to_output to
10916 output_sections.
10917 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
10918 output_sections and section_offsets.
10919 (Sized_relobj::write_local_symbols): Likewise.
10920 (map_to_kept_section): Compute output address directly.
10921 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
10922 output_sections and section_offsets.
10923 (Sized_relobj::write_sections): Likewise.
10924 (Sized_relobj::relocate_sections): Likewise.
10925 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
10926 * output.h (class Output_reloc): Update declarations. Change
10927 u2_.relobj to Sized_relobj*.
10928 (class Output_data_reloc): Change add functions to use
10929 Sized_relobj*.
10930 * output.cc (Output_reloc::Output_reloc): Change relobj to
10931 Sized_relobj*.
10932 (Output_reloc::local_section_offset): Change return type to
10933 Elf_Addr. Use get_output_section_offset.
10934 (Output_reloc::get_address): Likewise.
10935 (Output_section::is_input_address_mapped): Don't call
10936 is_section_specially_mapped.
10937 (Output_section::output_offset): Likewise.
10938 (Output_section::output_address): Likewise.
10939 (Output_section::starting_output_address): Likewise.
10940 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
10941 parameter to Sized_relobj*.
10942 (Copy_relocs::need_copy_reloc): Likewise.
10943 (Copy_relocs::save): Likewise.
10944 * copy-relocs.h (class Copy_relocs): Update declarations.
10945 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
10946 Sized_relobj*. Change relobj_ field to Sized_relobj*.
10947 * target-reloc.h (relocate_for_relocatable): Change
10948 offset_in_output_section type to Elf_Addr. Change code that uses
10949 it as well.
10950 * layout.cc (Layout::layout): Always set *off.
10951 * mapfile.cc (Mapfile::print_input_section): Use
10952 output_section_offset.
10953 * i386.cc (Target_i386::copy_reloc): Change object parameter to
10954 Sized_relobj*.
10955 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
10956 * sparc.cc (Target_sparc::copy_reloc): Likewise.
10957 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
10958
5cb66f97
ILT
109592008-07-03 Ian Lance Taylor <iant@google.com>
10960
10961 * layout.cc (Layout::include_section): Do not discard unrecognized
10962 SHT_STRTAB sections.
10963
afe47622
CS
109642008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
10965
10966 * script.cc (Lex::can_continue_name): Make '?' allowable in
10967 version-script names.
10968 * testsuite/version_script.map: Change glob pattern to use '?'
10969
5adf9721
ILT
109702008-06-30 Manish Singh <yosh@gimp.org>
10971
10972 PR 6585
10973 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
10974 Correct typo.
10975
e6fde208
ILT
109762008-06-30 Ian Lance Taylor <iant@google.com>
10977
10978 PR 6660
10979 PR 6682
10980 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
10981 versions]: Don't try to read the value in the contents, since we
10982 don't use it. Use the template endianness when writing.
10983
3f2e6a2d
CC
109842008-06-25 Cary Coutant <ccoutant@google.com>
10985
10986 * fileread.cc (File_read::make_view): Assert on zero-length view.
10987 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
10988 symbol table when there are no symbols to read.
10989
c43d3a48
CS
109902008-06-23 Craig Silverstein <csilvers@google.com>
10991
10992 * version.cc (version_string): Bump to 1.7
10993
5f494ea0
CS
109942008-06-18 Craig Silverstein <csilvers@google.com>
10995
10996 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
10997 constant 0xFFFF to type Valtype.
10998 (Powerpc_relocate_functions::rel16_ha): Likewise.
10999
c42e122e
ILT
110002008-06-17 Ian Lance Taylor <iant@google.com>
11001
f34787f8
ILT
11002 * output.h (Output_section::Input_section): Initialize p2align_ to
11003 zero for Output_section_data constructors.
11004 (Output_section::Input_section::addralign): If not an input
11005 section, return the alignment of the Output_section_data.
11006 * testsuite/copy_test.cc: New file.
11007 * testsuite/copy_test_1.cc: New file.
11008 * testsuite/copy_test_2.cc: New file.
11009 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
11010 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
11011 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
11012 (copy_test_1_pic.o, copy_test_1.so): New targets.
11013 (copy_test_2_pic.o, copy_test_2.so): New targets.
11014 * testsuite/Makefile.in: Rebuild.
11015
c42e122e
ILT
11016 * script-sections.cc (Script_sections::place_orphan): Initialize
11017 local variable exact.
11018
ce3ac18a
DE
110192008-06-13 David Edelsohn <edelsohn@gnu.org>
11020
11021 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
11022
42cacb20
DE
110232008-06-12 David Edelsohn <edelsohn@gnu.org>
11024 David S. Miller <davem@davemloft.net>
11025
11026 * powerpc.cc: New file.
11027 * Makefile.am (TARGETSOURCES): Add powerpc.cc
11028 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
11029 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
11030 * Makefile.in: Rebuild.
11031
7b308235
ILT
110322008-06-09 Ian Lance Taylor <iant@google.com>
11033
11034 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
11035 <exception>.
11036 (throwing, orig_terminate): New static variables.
11037 (terminate_handler): New static function.
11038 (t2): Set terminate handler.
11039
f0b886e3
ILT
110402008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
11041
11042 PR 6584
cd536b21 11043 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
11044 alignment.
11045
3e90f135
CC
110462008-05-30 Cary Coutant <ccoutant@google.com>
11047
11048 * archive.cc (Archive::include_all_members) Correct to step
11049 over symbol table and extended name table in thin archives.
11050
e09ad04a
ILT
110512008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
11052
11053 PR 6407
11054 * target-reloc.h (relocate_for_relocatable): Fix new_offset
11055 calculation.
11056
62b01cb5
ILT
110572008-05-28 Caleb Howe <cshowe@google.com>
11058
11059 * reduced_debug_output.cc: New file.
11060 * reduced_debug_output.h: New file.
92de84a6 11061 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
11062 * options.cc (General_options::finalize): Add strip_debug_non_line
11063 to the strip heirarchy.
11064 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
11065 fields.
11066 * layout.cc: Include "reduced_debug_output.h".
11067 (Layout::Layout): Initialize new fields.
11068 (line_only_debug_sections): New static array.
11069 (is_lines_only_debug_sections): New static inline function.
11070 (Layout::include_section): Handle --strip-debug-non-line.
11071 (Layout::make_output_section): If --strip-debug-non-line, build
11072 new output sections for .debug_abbrev and .debug_info.
11073 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
11074 gold. Warn about possible overflow.
11075 (read_signed_LEB_128): Likewise.
11076 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
11077 (read_signed_LEB_128): Declare.
11078 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
11079 (HFILES): Add reduced_debug_output.h.
11080 * Makefile.in: Rebuild.
11081
7d9e3d98
ILT
110822008-05-21 Ian Lance Taylor <iant@google.com>
11083
11084 * mapfile.cc: New file.
11085 * mapfile.h: New file.
11086 * options.h (class General_options): Add -M/--print-map and -Map.
11087 * options.cc (General_options::finalize): Make -M equivalent to
11088 -Map -.
11089 * main.cc: Include <cstdio> and "mapfile.h".
11090 (main): Open mapfile if requested.
11091 * gold.cc (class Middle_runner): Add mapfile_ field. Update
11092 constructor. Change caller.
11093 (queue_initial_tasks): Add mapfile parameter. Change caller.
11094 (queue_middle_tasks): Likewise.
11095 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
11096 declarations.
11097 * archive.cc: Include "mapfile.h".
11098 (Archive::add_symbols): Add mapfile parameter. Change all
11099 callers. Pass mapfile, symbol, and reason to include_member.
11100 (Archive::include_all_members): Add mapfile parameter. Change all
11101 callers.
11102 (Archive::include_member): Add mapfile, sym, and why parameters.
11103 Change all callers. Report inclusion to map file.
11104 * archive.h: Include "fileread.h".
11105 (class Archive): Update declarations.
11106 (Archive::file): New const method.
11107 (class Add_archive_symbols): Add mapfile_ field. Update
11108 constructor. Change all callers.
11109 * readsyms.h (class Read_symbols): Likewise.
11110 (class Finish_group): Likewise.
11111 (class Read_script): Likewise.
11112 * common.cc: Include "mapfile.h".
11113 (Symbol_table::allocate_commons): Add mapfile parameter. Change
11114 all callers.
11115 (Symbol_table::do_allocate_commons): Likewise.
11116 (Symbol_table::do_allocate_commons_list): Likewise. Report common
11117 symbol allocation to mapfile.
11118 * common.h (class Allocate_commons_task): Add mapfile_ field.
11119 Update constructor. Change all callers.
11120 * symtab.h (class Symbol_table): Update declarations.
11121 * layout.cc: Include "mapfile.h".
11122 (Layout_task_runner::run): Print information to mapfile.
11123 (Layout::create_gold_note): Change Output_data_fixed_space to
11124 Output_data_zero_fill.
11125 (Layout::create_build_id): Likewise.
11126 (Layout::print_to_mapfile): New function.
11127 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
11128 constructor. Change caller.
11129 (class Layout): Declare print_to_mapfile.
11130 * output.cc (Output_section::Input_section::print_to_mapfile): New
11131 function.
11132 (Output_section::add_input_section): If producing a map, always
11133 add to input_sections_ list.
11134 (Output_section::do_print_to_mapfile): New function.
11135 (Output_segment::print_sections_to_mapfile): New function.
11136 (Output_segment::print_section_list_to_mapfile): New function.
11137 * output.h: Include "mapfile.h".
11138 (Output_data::print_to_mapfile): New function.
11139 (Output_data::do_print_to_mapfile): New virtual function.
11140 (Output_segment_headers::do_print_to_mapfile): New function.
11141 (Output_file_header::do_print_to_mapfile): New function.
11142 (Output_data_const::do_print_to_mapfile): New function.
11143 (class Output_data_const_buffer): Add map_name_ field. Update
11144 constructor. Change all callers. Add do_print_to_mapfile
11145 function.
11146 (class Output_data_fixed_space): Likewise.
11147 (class Output_data_space): Likewise.
11148 (class Output_data_zero_fill): New class.
11149 (Output_data_strtab::do_print_to_mapfile): New function.
11150 (Output_data_reloc_base::do_print_to_mapfile): New function.
11151 (Output_relocatable_relocs::do_print_to_mapfile): New function.
11152 (Output_data_group::do_print_to_mapfile): New function.
11153 (Output_data_got::do_print_to_mapfile): New function.
11154 (Output_data_dynamic::do_print_to_mapfile): New function.
11155 (Output_symtab_xindex::do_print_to_mapfile): New function.
11156 (class Output_section): Declare do_print_to_mapflie. Declare
11157 print_to_mapfile in Input_section.
11158 (class Output_segment): Declare new functions.
11159 * object.h (Sized_relobj::symbol_count): New function.
11160 * script-sections.cc
11161 (Output_section_element_dot_assignment::set_section_addresses):
11162 Change Output_data_fixed_space to Output_data_zero_fill.
11163 (Output_data_expression::do_print_to_mapfile): New function.
11164 * script.cc (read_input_script): Add mapfile parameter. Change
11165 all callers.
11166 * script.h (read_input_script): Update declaration.
11167 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
11168 (Eh_frame::do_print_to_mapfile): New function.
11169 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
11170 (Output_merge_string::do_print_to_mapfile): New function.
11171 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
11172 function.
11173 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
11174 function.
11175 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
11176 function.
11177 * Makefile.am (CCFILES): Add mapfile.cc.
11178 (HFILES): Add mapfile.h.
11179 * Makefile.in: Rebuild.
11180
9f1d377b
ILT
111812008-05-19 Ian Lance Taylor <iant@google.com>
11182
11183 * options.h (class General_options): Add -z relro.
11184 * layout.cc (Layout::Layout): Initialize relro_segment_.
11185 (Layout::add_output_section_data): Return the output section.
11186 (Layout::make_output_section): Rcognize relro sections and mark
11187 them appropriately.
11188 (Layout::attach_allocated_section_to_segment): Put relro sections
11189 in a PT_GNU_RELRO segment.
11190 (Layout::create_initial_dynamic_sections): Mark the .dynamic
11191 section as relro.
11192 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
11193 PT_TLS segments.
11194 (Layout::linkonce_mapping): Map d.rel.ro.local to
11195 .data.rel.ro.local.
11196 (Layout::output_section_name): Us .data.rel.ro.local for any
11197 section which begins with that.
11198 * layout.h (class Layout): Update add_output_section_data
11199 declaration. Add relro_segment_ field.
11200 * output.cc (Output_section::Output_section): Initialize is_relro_
11201 and is_relro_local_ fields.
11202 (Output_segment::add_output_section): Group relro sections.
11203 (Output_segment::is_first_section_relro): New function.
11204 (Output_segment::maximum_alignment): If there is a relro section,
11205 align the segment to the common page size.
11206 (Output_segment::set_section_addresses): Track whether we are
11207 looking at relro sections. If the last section is a relro
11208 section, align to the common page size.
11209 (Output_segment::set_section_list_addresses): Add in_relro
11210 parameter. Change all callers. Align to the page size when
11211 moving from relro to non-relro section.
11212 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
11213 segment.
11214 * output.h (class Output_section): Add is_relro_ and
11215 is_relro_local_ fields.
11216 (Output_section::is_relro): New function.
11217 (Output_section::set_is_relro): New function.
11218 (Output_section::is_relro_local): New function.
11219 (Output_section::set_is_relro_local): New function.
11220 (class Output_segment): Update declarations.
11221 * i386.cc (Target_i386::got_section): Mark .got section as relro.
11222 * sparc.cc (Target_sparc::got_section): Likewise.
11223 * x86_64.cc (Target_x86_64::got_section): Likewise.
11224 * testsuite/relro_test_main.cc: New file.
11225 * testsuite/relro_test.cc: New file.
11226 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
11227 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
11228 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
11229 (relro_test.so, relro_test_pic.o): New targets.
11230 * testsuite/Makefile.in: Rebuild.
11231
a984ee1d
ILT
112322008-05-16 Ian Lance Taylor <iant@google.com>
11233
01676dcd
ILT
11234 * output.cc (Output_segment::add_output_section): Remove front
11235 parameter.
11236 * output.h (class Output_segment): Remove
11237 add_initial_output_section and overloaded add_output_section.
11238 Update declaration of remaining add_output_section.
11239 * layout.cc (Layout::create_interp): Call add_output_section
11240 rather than add_initial_output_section.
11241 (Layout::finish_dynamic_section): Likewise.
11242
497897f9
ILT
11243 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
11244 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
11245 know the dynamic type.
11246 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
11247 field. Initialize it in constructor.
11248 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
11249 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
11250 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
11251 reloc.
11252
a984ee1d
ILT
11253 * output.cc (Output_reloc::get_address): Change return type to
11254 Elf_Addr.
11255 * output.h (class Output_reloc): Update get_address declaration.
11256 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
11257 for section addresses.
11258
55ba0940
ILT
112592008-05-09 Ian Lance Taylor <iant@google.com>
11260
11261 PR 6493
11262 * gold.cc (gold_nomem): Use return value of write.
11263
75517b77
ILT
112642008-05-08 Ian Lance Taylor <iant@google.com>
11265
11266 * symtab.c (Symbol::init_base_output_data): Add version
11267 parameter. Change all callers.
11268 (Symbol::init_base_output_segment): Likewise.
11269 (Symbol::init_base_constant): Likewise.
11270 (Symbol::init_base_undefined): Likewise.
11271 (Sized_symbol::init_output_data): Likewise.
11272 (Sized_symbol::init_output_segment): Likewise.
11273 (Sized_symbol::init_constant): Likewise.
11274 (Sized_symbol::init_undefined): Likewise.
11275 (Symbol_table::do_define_in_output_data): If the new symbol has a
11276 version, mark it as the default.
11277 (Symbol_table::do_define_in_output_segment): Likewise.
11278 (Symbol_table::do_define_as_constant): Likewise.
11279 * symtab.h (class Symbol): Update declarations.
11280 (class Sized_symbol): Likewise.
11281 * resolve.cc (Symbol::override_version): New function.
c42e122e 11282 (Symbol::override_base): Call override_version.
75517b77
ILT
11283 (Symbol::override_base_with_special): Likewise.
11284 * testsuite/ver_script_8.script: New file.
11285 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
11286 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
11287 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
11288 (ver_test_8_1.so, ver_test_8_2.so): New targets.
11289
f1f70eae
ILT
112902008-05-06 Ian Lance Taylor <iant@google.com>
11291
f3e9c5c5
ILT
11292 PR 6049
11293 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
11294 functions.
11295 (class General_options): Remove existing --undefined, and add
11296 --no-undefined instead. Add new --undefined as synonym for -u.
11297 * archive.cc (Archive::add_symbols): Check whether symbol was
11298 named with -u.
11299 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
11300 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
11301 all uses. Add IS_UNDEFINED. Update declarations to split
11302 different versions of init_base. Declare init_base_undefined.
11303 (Symbol::is_defined): Handle IS_UNDEFINED.
11304 (Symbol::is_undefined): Likewise.
11305 (Symbol::is_weak_undefined): Call is_undefined.
11306 (Symbol::is_absolute): Handle IS_CONSTANT.
11307 (class Sized_symbol): Update declarations to split different
11308 versions of init. Declare init_undefined.
11309 (class Symbol_table): Declare new functions.
11310 * symtab.cc (Symbol::init_base_object): Rename from init_base.
11311 Change all callers.
11312 (Symbol::init_base_output_data): Likewise.
11313 (Symbol::init_base_output_segment): Likewise.
11314 (Symbol::init_base_constant): Likewise.
11315 (Symbol::init_base_undefined): New function.
11316 (Sized_symbol::init_object): Rename from init. Change all
11317 callers.
11318 (Sized_symbol::init_output_data): Likewise.
11319 (Sized_symbol::init_output_segment): Likewise.
11320 (Sized_symbol::init_constant): Likewise.
11321 (Sized_symbol::init_undefined): New function.
11322 (Symbol_table::add_undefined_symbols_from_command_line): New
11323 function.
11324 (Symbol_table::do_add_undefined_symbols_from_command_line): New
11325 function.
11326 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
11327 (Symbol::output_section): Likewise.
11328 (Symbol::set_output_section): Likewise.
11329 (Symbol_table::sized_finalize_symbol): Likewise.
11330 (Symbol_table::sized_write_globals): Likewise.
11331 * resolve.cc (Symbol_table::should_override): Likewise.
11332 (Symbol::override_base_with_special): Likewise.
11333
8bdcdf2c
ILT
11334 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
11335 symbol, change it to have default visibility.
11336 * testsuite/protected_1.cc: New file.
11337 * testsuite/protected_2.cc: New file.
11338 * testsuite/protected_3.cc: New file.
11339 * testsuite/protected_main_1.cc: New file.
11340 * testsuite/protected_main_2.cc: New file.
11341 * testsuite/protected_main_3.cc: New file.
11342 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
11343 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
11344 (protected_1_LDFLAGS, protected_1_LDADD): Define.
11345 (protected_1.so): New target.
11346 (protected_1_pic.o, protected_2_pic.o): New targets.
11347 (protected_3_pic.o): New target.
11348 (check_PROGRAMS): Add protected_2.
11349 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
11350 (protected_2_LDFLAGS, protected_2_LDADD): Define.
11351 * testsuite/Makefile.in: Rebuild.
11352
2b706932
ILT
11353 * options.h (DEFINE_var): Add set_user_set_##varname__.
11354 (DEFINE_bool_alias): New macro.
11355 (class General_options): Define -Bstatic using DEFINE_bool_alias
11356 rather than DEFINE_special. Add --undefined as an alias for -z
11357 defs.
11358 * options.cc (General_options::parse_Bstatic): Remove.
11359
d82a5bcc
ILT
11360 * options.h (class General_options): Add --fatal-warnings.
11361 * main.cc (main): Implement --fatal-warnings.
11362 * errors.h (Errors::warning_count): New function.
11363
f1f70eae
ILT
11364 * options.h (class General_options): Add -Bsymbolic-functions.
11365 * symtab.h (Symbol::is_preemptible): Check for
11366 -Bsymbolic-functions.
11367
8825ac63
ILT
113682008-05-05 Ian Lance Taylor <iant@google.com>
11369
d98bc257
ILT
11370 * options.h (DEFINE_bool): For DASH_Z, create the negative option
11371 as noVARNAME rather than no-VARNAME.
11372 (class General_options): Add option -z combreloc.
11373 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
11374 get_address.
11375 (Output_reloc::sort_before) [SHT_REL]: New function.
11376 (Output_reloc::sort_before) [SHT_RELA]: New function.
11377 (class Output_data_reloc_base): Add sort_relocs_ field. Define
11378 Sort_relocs_comparison.
11379 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
11380 parameter. Change all callers.
11381 (Output_data_reloc::Output_data_reloc) [both versions]: Add
11382 sort_relocs parameter. Change all callers.
11383 * output.cc (Output_reloc::get_address): New function, broken out
11384 of write_rel.
11385 (Output_reloc::write_rel): Call it.
11386 (Output_reloc::compare): New function.
11387 (Output_data_reloc_base::do_write): Optionally sort relocs.
11388
60b2b4e7
ILT
11389 * configure.ac: If targ_extra_obj is set, link it in.
11390 * configure.tgt: Initialize all variables.
11391 (x86_64*): Set targ_extra_obj and targ_extra_size.
11392 * configure: Rebuild.
11393
8825ac63
ILT
11394 * object.cc (Sized_relobj::include_section_group): Adjust section
11395 indexes read from group data. Build vector to pass to
11396 layout_group.
11397 * layout.cc (Layout::layout_group): Add flags and shndxes
11398 parameters. Remove contents parameter. Change caller. Update
11399 explicit instantiations.
11400 * layout.h (class Layout): Update layout_group declaration.
11401 * output.cc (Output_data_group::Output_data_group): Add flags and
11402 input_shndxes parameters. Remove contents parameter. Change
11403 caller.
11404 (Output_data_group::do_write): Change input_sections_ to
11405 input_shndxes_.
11406 * output.h (class Output_data_group): Update constructor
11407 declaration. Rename input_sections_ to input_shndxes_.
11408 * testsuite/many_sections_test.cc: Add template.
11409
e94cf127
CC
114102008-04-30 Cary Coutant <ccoutant@google.com>
11411
4418b2d5
CC
11412 * target-reloc.h (relocate_section): Fix dead-pointer bug.
11413
e94cf127
CC
11414 * layout.cc (Layout::include_section): Refactored check for debug
11415 info section.
11416 (Layout::add_comdat): Add new parameters. Change type
11417 of signature parameter. Add object and shndx to signatures table.
11418 (Layout::find_kept_object): New function.
11419 * layout.h: Include <cstring>.
11420 (Layout::is_debug_info_section): New function.
11421 (Layout::add_comdat): Add new parameters.
11422 (Layout::find_kept_object): New function.
11423 (Layout::Kept_section): New struct.
11424 (Layout::Signatures): Change type of map range.
11425 * object.cc (Relobj::output_section_address): New function.
11426 (Sized_relobj::include_section_group): Add new parameters. Change
11427 calls to Layout::add_comdat. Change to build table of kept comdat
11428 groups and table mapping discarded sections to kept sections.
11429 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
11430 (Sized_relobj::do_layout): Change calls to include_section_group and
11431 include_linkonce_section.
11432 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
11433 value to zero when section is discarded.
11434 (Sized_relobj::map_to_kept_section): New function.
11435 * object.h (Relobj::output_section_address): New function.
11436 (Relobj::Comdat_group): New type.
11437 (Relobj::find_comdat_group): New function.
11438 (Relobj::Comdat_group_table): New type.
11439 (Relobj::Kept_comdat_section): New type.
11440 (Relobj::Kept_comdat_section_table): New type.
11441 (Relobj::add_comdat_group): New function.
11442 (Relobj::set_kept_comdat_section): New function.
11443 (Relobj::get_kept_comdat_section): New function.
11444 (Relobj::comdat_groups_): New field.
11445 (Relobj::kept_comdat_sections_): New field.
11446 (Symbol_value::input_value): Update comment.
11447 (Sized_relobj::map_to_kept_section) New function.
11448 (Sized_relobj::include_linkonce_section): Add new parameter.
11449 * target-reloc.h (Comdat_behavior): New type.
11450 (get_comdat_behavior): New function.
11451 (relocate_section): Add code to map a discarded section to the
11452 corresponding kept section when applying a relocation.
11453
e4e5049b
CS
114542008-04-30 Craig Silverstein <csilvers@google.com>
11455
11456 * dwarf_reader.cc (next_generation_count): New static var.
11457 (Addr2line_cache_entry): New struct.
11458 (addr2line_cache): New static var.
11459 (Dwarf_line_info::one_addr2line): Added caching.
11460 (Dwarf_line_info::clear_addr2line_cache): New function.
11461 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
11462 cache-size parameter.
11463 (Dwarf_line_info::one_addr2line_cache): New function.
11464 * symtab.cc (Symbol_table::detect_odr_violations): Pass
11465 new cache-size argument to one_addr2line(), and clear cache.
11466
d09e9154
CC
114672008-04-28 Cary Coutant <ccoutant@google.com>
11468
11469 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
11470 R_386_PC8 relocations.
11471
7ef73768
ILT
114722008-04-23 Ian Lance Taylor <iant@google.com>
11473
55438702
ILT
11474 * object.cc (Sized_relobj::include_section_group): Check for
11475 invalid section group.
11476
c165fb93
ILT
11477 * object.cc (make_elf_object): Correct test for 64-bit ELF file
11478 header size.
11479
7ef73768
ILT
11480 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
11481 than read for file header.
11482 * archive.cc (Archive::include_member): Likewise.
11483
6194aaab
L
114842008-04-23 Paolo Bonzini <bonzini@gnu.org>
11485
11486 * aclocal.m4: Regenerate.
11487 * configure: Regenerate.
11488
d491d34e
ILT
114892008-04-19 Ian Lance Taylor <iant@google.com>
11490
5ea2bac6
ILT
11491 * version.cc (version_string): Bump to 1.6.
11492
7bc3e21a
ILT
11493 * testsuite/Makefile.am (many_sections_r_test): New target.
11494 (many_sections_r_test_SOURCES): Remove.
11495 (many_sections_r_test_DEPENDENCIES): Remove.
11496 (many_sections_r_test_LDFLAGS): Remove.
11497 (many_sections_r_test_LDADD): Remove.
11498
7fcd3aa9
ILT
11499 * object.cc (Sized_relobj::do_add_symbols): Always pass
11500 local_symbol_count_ to add_from_relobj.
11501
4c94d6ae
ILT
11502 * testsuite/Makefile.am (many_sections_check.h): Only check one in
11503 every thousand variables.
11504 * testsuite/Makefile.in: Rebuild.
11505
d491d34e
ILT
11506 * object.cc (Xindex::initialize_symtab_xindex): New function.
11507 (Xindex::read_symtab_xindex): New function.
11508 (Xindex::sym_xindex_to_shndx): New function.
11509 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
11510 available.
11511 (Sized_relobj::do_initialize_xindex): New function.
11512 (Sized_relobj::do_read_symbols): Adjust section links.
11513 (Sized_relobj::symbol_section_and_value): Add is_ordinary
11514 parameter. Change all callers.
11515 (Sized_relobj::include_section_group): Adjust section links and
11516 symbol section indexes.
11517 (Sized_relobj::do_layout): Adjust section links.
11518 (Sized_relobj::do_count_local_symbols): Adjust section links and
11519 symbol section indexes.
11520 (Sized_relobj::do_finalize_local_symbols): Distinguish between
11521 ordinary and special symbols.
11522 (Sized_relobj::write_local_symbols): Add symtab_xindex and
11523 dynsym_xindex parameters. Change all callers. Adjust section
11524 links. Use SHN_XINDEX when needed.
11525 (Sized_relobj::get_symbol_location_info): Adjust section links.
11526 Don't get fooled by special symbols.
11527 * object.h (class Xindex): Define.
11528 (class Object): Add xindex_ parameter. Declare virtual functoin
11529 do_initialize_xindex.
11530 (Object::adjust_sym_shndx): New function.
11531 (Object::set_xindex): New protected function.
11532 (class Symbol_value): Add is_ordinary_shndx_ field.
11533 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
11534 (Symbol_value::value): Assert ordinary section.
11535 (Symbol_value::initialize_input_to_output_map): Likewise.
11536 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
11537 Change all callers.
11538 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
11539 all callers.
11540 (class Sized_relobj): Update declarations.
11541 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
11542 parameter. Change all callers.
11543 (Sized_relobj::adjust_shndx): New function.
11544 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
11545 field.
11546 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
11547 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
11548 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
11549 (Sized_dynobj::read_dynsym_section): Adjust section links.
11550 (Sized_dynobj::read_dynamic): Likewise.
11551 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
11552 section links.
11553 (Sized_dynobj::do_initialize_xindex): New function.
11554 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
11555 do_initialize_xindex.
11556 (Sized_dynobj::adjust_shndx): New function.
11557 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
11558 dynsym_xindex_ fields.
11559 (Layout::finalize): Add a call to set_section_indexes before
11560 creating the symtab sections.
11561 (Layout::set_section_indexes): Don't do anything if the section
11562 already has a section index.
11563 (Layout::create_symtab_sections): Add shnum parameter. Change
11564 caller. Create .symtab_shndx section if needed.
11565 (Layout::create_shdrs): Add shstrtab_section parameter. Change
11566 caller.
11567 (Layout::allocated_output_section_count): New function.
11568 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
11569 needed.
11570 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
11571 fields. Update declarations.
11572 (Layout::symtab_xindex): New function.
11573 (Layout::dynsym_xindex): New function.
11574 (class Write_symbols_task): Add layout_ field.
11575 (Write_symbols_task::Write_symbols_task): Add layout parameter.
11576 Change caller.
11577 * output.cc (Output_section_headers::Output_section_headers): Add
11578 shstrtab_section parameter. Change all callers.
11579 (Output_section_headers::do_sized_write): Store overflow values
11580 for section count and section string table section index in
11581 section header zero.
11582 (Output_file_header::do_sized_write): Check for overflow of
11583 section count and section string table section index.
11584 (Output_symtab_xindex::do_write): New function.
11585 (Output_symtab_xindex::endian_do_write): New function.
11586 * output.h (class Output_section_headers): Add shstrtab_section_.
11587 Update declarations.
11588 (class Output_symtab_xindex): Define.
11589 (Output_section::has_out_shndx): New function.
11590 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
11591 field.
11592 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
11593 Change all callers.
11594 (Sized_symbol::init): Likewise.
11595 (Symbol::output_section): Check for ordinary symbol.
11596 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
11597 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
11598 callers.
11599 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
11600 Change all callers. Simplify handling of symbols from sections
11601 not included in the link.
11602 (Symbol_table::add_from_dynobj): Handle ordinary symbol
11603 distinction.
11604 (Weak_alias_sorter::operator()): Assert that symbols are
11605 ordinary.
11606 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
11607 distinction.
11608 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
11609 parameters. Change all callers.
11610 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
11611 symbol distinction. Use SHN_XINDEX when needed.
11612 (Symbol_table::write_section_symbol): Add symtab_xindex
11613 parameter. Change all callers.
11614 (Symbol_table::sized_write_section_symbol): Likewise. Use
11615 SHN_XINDEX when needed.
11616 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
11617 declarations.
11618 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
11619 (Symbol::is_defined): Check is_ordinary.
11620 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
11621 (Symbol::is_absolute, Symbol::is_common): Likewise.
11622 (class Sized_symbol): Update declarations.
11623 (class Symbol_table): Update declarations.
11624 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
11625 parameters. Change all callers.
11626 (Sized_symbol::override): Likewise.
11627 (Symbol_table::override): Likewise.
11628 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
11629 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
11630 is_ordinary, and orig_st_shndx parameters. Change all callers.
11631 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
11632 to be in an ordinary section.
11633 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
11634 object and is_ordinary parameters. Change all callers.
11635 (Sized_dwarf_line_info::read_relocs): Add object parameter.
11636 Change all callers. Don't add undefined or non-ordinary symbols
11637 to reloc_map_.
11638 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
11639 Change all callers.
11640 * dwarf_reader.h (class Sized_dwarf_line_info): Update
11641 declarations.
11642 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
11643 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
11644 (Sized_relobj::relocate_sections): Likewise.
11645 * target-reloc.h (scan_relocs): Adjust section symbol index.
11646 (scan_relocatable_relocs): Likewise.
11647 * i386.cc (Scan::local): Check for ordinary symbols.
11648 * sparc.cc (Scan::local): Likewise.
11649 * x86_64.cc (Scan::local): Likewise.
11650 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
11651 to symbol_section_and_value.
11652 * testsuite/many_sections_test.cc: New file.
11653 * testsuite/Makefile.am (BUILT_SOURCES): Define.
11654 (check_PROGRAMS): Add many_sections_test.
11655 (many_sections_test_SOURCES): Define.
11656 (many_sections_test_DEPENDENCIES): Define.
11657 (many_sections_test_LDFLAGS): Define.
11658 (BUILT_SOURCES): Add many_sections_define.h.
11659 (many_sections_define.h): New target.
11660 (BUILT_SOURCES): Add many_sections_check.h.
11661 (many_sections_check.h): New target.
11662 (check_PROGRAMS): Add many_sections_r_test.
11663 (many_sections_r_test_SOURCES): Define.
11664 (many_sections_r_test_DEPENDENCIES): Define.
11665 (many_sections_r_test_LDFLAGS): Define.
11666 (many_sections_r_test_LDADD): Define.
11667 (many_sections_r_test.o): New target.
11668 * testsuite/Makefile.in: Rebuild.
11669
c5818ff1
CC
116702008-04-17 Cary Coutant <ccoutant@google.com>
11671
11672 * errors.cc (Errors::info): New function.
11673 (gold_info): New function.
11674 * errors.h (Errors::info): New function.
11675 * gold.h (gold_info): New function.
11676 * object.cc (Input_objects::add_object): Print trace output.
11677 * options.cc (options::parse_set): New function.
11678 (General_options::parse_wrap): Deleted.
11679 (General_options::General_options): Deleted initializer.
11680 * options.h (options::String_set): New typedef.
11681 (options::parse_set): New function.
11682 (DEFINE_set): New macro.
11683 (General_options::wrap): Changed to use DEFINE_set. Changed
11684 callers of any_wrap_symbols and is_wrap_symbol.
11685 (General_options::trace, General_options::trace_symbol):
11686 New options.
11687 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
11688 (General_options::wrap_symbols_): Deleted.
11689 * symtab.cc (Symbol_table::add_from_object): Print trace output.
11690
b5be4a7c
DM
116912008-04-17 David S. Miller <davem@davemloft.net>
11692
11693 * options.cc (General_options::parse_V): New function.
11694 * options.h: Add entries for -V and -Qy.
11695
155a0dd7
ILT
116962008-04-17 Ian Lance Taylor <iant@google.com>
11697
11698 * common.cc (Symbol_table::allocate_commons): Remove options
11699 parameter. Change caller.
11700 (Symbol_table::do_allocate_commons): Remove options parameter.
11701 Change caller. Just call do_allocate_commons_list twice.
11702 (Symbol_table::do_allocate_commons_list): New function, broken out
11703 of do_allocate_commons.
11704 * common.h (class Allocate_commons_task): Remove options_ field.
11705 Update constructor.
11706 * symtab.cc (Symbol_table::Symbol_table): Initialize
11707 tls_commons_.
11708 (Symbol_table::add_from_object): Put TLS common symbols on
11709 tls_commons_ list.
11710 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
11711 which are IN_OUTPUT_DATA.
11712 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
11713 allocate_commons and do_allocate_commons declarations. Declare
11714 do_allocate_commons_list.
11715 * gold.cc (queue_middle_tasks): Update creation of
11716 Allocate_commons_task to not pass options.
11717 * testsuite/Makefile.am (INCLUDES): Add -I.. .
11718 (TLS_TEST_C_FLAGS): New variable.
11719 (tls_test_c_pic.o): New target.
11720 (tls_test_shared.so): Link in tls_test_c_pic.o.
11721 (tls_test_c_pic_ie.o): New target.
11722 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
11723 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
11724 (tls_test_c.o): New target.
11725 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
11726 (tls_pic_test_LDADD): Likewise.
11727 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
11728 (tls_shared_gd_to_ie_test_LDADD): Likewise.
11729 (tls_test_c_gnu2.o): New target.
11730 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
11731 tls_test_c_gnu2.o.
11732 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
11733 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
11734 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
11735 * testsuite/tls_test.cc: Include "config.h".
11736 (t_last): Call t11_last.
11737 * testsuite/tls_test.h (t11, t11_last): Declare.
11738 * testsuite/tls_test_c.c: New file.
11739 * testsuite/tls_test_main.cc (thread_routine): Call t11.
11740 * configure.ac: Check for OpenMP support.
11741 * configure, config.in, Makefile.in: Rebuild.
11742 * testsuite/Makefile.in: Rebuild.
11743
edfbb029
CC
117442008-04-16 Cary Coutant <ccoutant@google.com>
11745
11746 * i386.cc (Target_i386::define_tls_base_symbol): New function.
11747 (Target_i386::tls_base_symbol_defined_): New field.
11748 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
11749 (Target_i386::Scan::global): Likewise.
11750 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
11751 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
11752 (Target_x86_64::tls_base_symbol_defined_): New field.
11753 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
11754 (Target_x86_64::Scan::global): Likewise.
11755
f3c69fca
CC
117562008-04-16 Cary Coutant <ccoutant@google.com>
11757
11758 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
11759 (Symbol::needs_plt_entry): Allow weak undefined symbols.
11760 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
11761 building shared libraries.
11762 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
11763 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
11764 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
11765 * testsuite/Makefile.in: Rebuild.
11766 * testsuite/weak_undef.h: New file.
11767 * testsuite/weak_undef_file1.cc: Add extra test cases.
11768 * testsuite/weak_undef_file2.cc: Likewise.
11769 * testsuite/weak_undef_test.cc: Likewise.
11770
7c414435
DM
117712008-04-16 David S. Miller <davem@davemloft.net>
11772
32b769e1
DM
11773 * sparc.cc (Target_sparc::Scan): Change from struct to class.
11774 Add issued_non_pic_error_ field. Declare check_non_pic.
11775 (Target_sparc::Scan::check_non_pic): New function.
11776 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
11777 (Target_sparc::Scan::global): Likewise.
11778
11936fb1
DM
11779 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
11780 * configure: Rebuild.
11781
7c414435
DM
11782 * options.h (DEFINE_enable): New macro.
11783 (new_dtags): New enable option.
11784 (initfirst, interpose, loadfltr, nodefaultlib,
11785 nodelete, nodlopen, nodump): New -z options.
11786 * layout.cc (Layout:finish_dynamic_section): If new
11787 dtags enabled, emit DT_RUNPATH. Also, emit a
11788 DT_FLAGS_1 containing any specified -z flags.
11789
85c7bf8b
ILT
117902008-04-16 Ian Lance Taylor <iant@google.com>
11791
12c0daef
ILT
11792 * copy-relocs.cc: New file.
11793 * copy-relocs.h: New file.
11794 * reloc.cc: Remove Copy_relocs code.
11795 * reloc.h: Likewise.
11796 * reloc-types.h (struct Reloc_types) [both versions]: Add
11797 get_reloc_addend_noerror.
11798 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
11799 variants of add_global which take an addend which must be zero.
11800 * i386.cc: Include "copy-relocs.h".
11801 (class Target_i386): Change type of copy_relocs_ to variable,
11802 update initializer.
11803 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
11804 Change all callers.
11805 (Target_i386::do_finalize_sections): Change handling of
11806 copy_relocs_.
11807 * sparc.cc: Include "copy-relocs.h".
11808 (class Target_sparc): Change type of copy_relocs_ to variable,
11809 update initializer.
11810 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
11811 Change all callers.
11812 (Target_sparc::do_finalize_sections): Change handling of
11813 copy_relocs_.
11814 * x86_64.cc: Include "copy-relocs.h".
11815 (class Target_x86_64): Change type of copy_relocs_ to variable,
11816 update initializer.
11817 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
11818 class. Change all callers.
11819 (Target_x86_64::do_finalize_sections): Change handling of
11820 copy_relocs_.
11821 * Makefile.am (CCFILES): Add copy-relocs.cc.
11822 (HFILES): Add copy-relocs.h.
11823
4f4995b6
ILT
11824 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
11825
85c7bf8b
ILT
11826 * testsuite/script_test_4.sh: Permit leading zeroes.
11827
4f2a9edd
ILT
118282008-04-15 Ian Lance Taylor <iant@google.com>
11829
e6188289
ILT
11830 * script-sections.cc (Script_sections::create_segments): Use
11831 header_size_adjustment even when there is enough room for the
11832 headers.
11833 * testsuite/script_test_4.sh: New file.
11834 * testsuite/script_test_4.t: New file.
11835 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
11836 (check_DATA): Add script_test_4.stdout.
11837 (MOSTLYCLEANFILES): Likewise.
11838 (script_test_4): New target.
11839 (script_test_4.stdout): New target.
11840 * testsuite/Makefile.in: Rebuild.
11841
4f2a9edd
ILT
11842 * sparc.cc: Add definitions for Output_data_plt_sparc class
11843 constants.
11844
f5314dd5
DM
118452008-04-14 David S. Miller <davem@davemloft.net>
11846
11847 * sparc.cc: New file.
11848 * Makefile.am (TARGETSOURCES): Add sparc.cc
11849 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
11850 * configure.tgt: Document targ_extra_size and
11851 targ_extra_big_endian. Add entries for sparc-* and
11852 sparc64-*.
11853 * configure.ac: Handle targ_extra_size and
11854 targ_extra_big_endian.
11855 * Makefile.in: Rebuild.
11856 * configure: Likewise.
11857 * po/POTFILES.in: Likewise.
11858 * po/gold.pot: Likewise.
11859
154e0e9a
ILT
118602008-04-14 Ian Lance Taylor <iant@google.com>
11861
11862 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
11863 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
11864 in the name/type/flags to section mapping. Don't call
11865 allocate_output_section.
11866 (Layout::choose_output_section): Change parameter from adjust_name
11867 to is_input_section. Don't permit input sections after sections
11868 are attached to segments. Don't call allocate_output_section.
11869 (Layout::layout_eh_frame): Call update_flags_for_input_section,
11870 not write_enable_output_section.
11871 (Layout::make_output_section): Don't push to
11872 unattached_section_list_ nor call attach_to_segment. Call
11873 attach_section_to_segment if sections are attached.
11874 (Layout::attach_sections_to_segments): New function.
11875 (Layout::attach_section_to_segment): New function.
11876 (Layout::attach_allocated_section_to_segment): Rename from
11877 attach_to_segment. Remove flags parameter.
11878 (Layout::allocate_output_section): Remove function.
11879 (Layout::write_enable_output_section): Remove function.
11880 * layout.h (class Layout): Update for above changes. Add new
11881 field sections_are_attached_.
11882 * output.h (Output_section::update_flags_for_input_section): New
11883 function.
11884 * output.cc (Output_section::add_input_section): Call
11885 update_flags_for_input_section.
11886 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
11887
009a67a2
CC
118882008-04-11 Cary Coutant <ccoutant@google.com>
11889
11890 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
11891 thought unnecessary.
11892 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
11893
759b1a24
ILT
118942008-04-11 Ian Lance Taylor <iant@google.com>
11895
11896 * output.h (class Output_section_data): Remove inline definition
11897 of set_addralign.
11898 * output.cc (Output_section_data::set_addralign): New function.
11899
c2b45e22
CC
119002008-04-11 Cary Coutant <ccoutant@google.com>
11901
11902 Add support for TLS descriptors for i386 and x86_64.
11903 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
11904 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
11905 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
11906 GOT_TYPE_TLS_DESC.
11907 (Target_i386::got_mod_index_entry): Remove unnecessary code.
11908 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
11909 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
11910 relocations.
11911 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
11912 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
11913 Fix problem with initial-exec relocations.
11914 (Target_i386::Relocate::relocate_tls): Likewise.
11915 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
11916 relaxation.
11917 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
11918 support for section-plus-offset dynamic table entries.
11919 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
11920 (Output_data_dynamic::Dynamic_entry): Add support for
11921 section-plus-offset dynamic table entries.
11922 (Output_data_dynamic::Classification): Likewise.
11923 (Output_data_dynamic::classification_): Renamed offset_.
11924 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
11925 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
11926 (Target_x86_64::make_plt_section): New function.
11927 (Target_x86_64::reserve_tlsdesc_entries): New function.
11928 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
11929 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
11930 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
11931 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
11932 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
11933 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
11934 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
11935 add extra PLT entry for TLS descriptors.
11936 (Output_data_plt_x86_64::got_): New field.
11937 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
11938 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
11939 fields.
11940 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
11941 descriptors.
11942 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
11943 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
11944 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
11945 R_386_TLS_DESC_CALL relocations.
11946 (Target_x86_64::Scan::global): Likewise.
11947 (Target_x86_64::do_finalize_sections): Add dynamic table entries
11948 for TLS descriptors.
11949 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
11950 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
11951 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
11952 GD-to-IE relaxation.
11953 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
11954 and TLS_DESCRIPTORS.
11955 * Makefile.in: Rebuild.
11956 * configure: Rebuild.
11957 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
11958 (tls_test_shared2.so): New target.
11959 (tls_shared_gd_to_ie_test_SOURCES): New variable.
11960 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
11961 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
11962 (tls_shared_gd_to_ie_test_LDADD): New variable.
11963 (tls_shared_gnu2_gd_to_ie_test): New target.
11964 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
11965 New targets.
11966 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
11967 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
11968 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
11969 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
11970 (tls_shared_gnu2_test): New target.
11971 (tls_test_gnu2_shared.so): New target.
11972 (tls_shared_gnu2_test_SOURCES): New variable.
11973 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
11974 (tls_shared_gnu2_test_LDFLAGS): New variable.
11975 (tls_shared_gnu2_test_LDADD): New variable.
11976 * testsuite/Makefile.in: Rebuild.
11977 * testsuite/Makefile.
11978
83bfb6b7
ILT
119792008-04-11 Ian Lance Taylor <iant@google.com>
11980
11981 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
11982 justsyms.t.
11983 * testsuite/Makefile.in: Rebuild.
11984
11985 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
11986 long.
11987 * testsuite/script_test_2.cc (main): Adjust test.
11988
706e1f5e
ILT
119892008-04-11 David S. Miller <davem@davemloft.net>
11990 Ian Lance Taylor <iant@google.com>
11991
11992 * options.h (General_options): Add entries for '-Y' and
11993 '-relax'.
11994 * options.cc (General_options:finalize): If -Y was used, add those
11995 entries to the library path instead of the default "/lib" and
11996 "/usr/lib".
11997
7c98e6bb
DM
119982008-04-11 David S. Miller <davem@davemloft.net>
11999
12000 * testsuite/justsyms.t: Start at 0x100.
12001 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
12002 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
12003 long.
12004 * testsuite/script_test_2.cc: Adjust string and section length
12005 checks.
7c98e6bb 12006
99a37bfd
ILT
120072008-04-09 Ian Lance Taylor <iant@google.com>
12008
2cefc357
ILT
12009 PR gold/5996
12010 * script-sections.cc (Sections_element::allocate_to_segment): Add
12011 orphan parameter.
12012 (Output_section_definition::allocate_to_segment): Likewise.
12013 (Orphan_output_section::allocate_to_segment): Likewise.
12014 (Script_sections::attach_sections_using_phdrs_clause): Don't
12015 propagate non-PT_LOAD segments to orphan sections.
12016 * testsuite/Makefile.am (script_test_3.stdout): Generate using
12017 readelf rather than objdump.
12018 * testsuite/script_test_3.sh: Adjust accordingly. Test that
12019 .interp section and PT_INTERP segment are the same size.
12020 * testsuite/Makefile.in: Rebuild.
12021
99a37bfd
ILT
12022 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
12023 aliases for symbols defined in the same object.
12024 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
12025 (weak_alias_test_SOURCES): New variable.
12026 (weak_alias_test_DEPENDENCIES): New variable.
12027 (weak_alias_test_LDFLAGS): New variable.
12028 (weak_alias_test_LDADD): New variable.
12029 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
12030 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
12031 (weak_alias_test_3.o): New target.
12032 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
12033 * testsuite/weak_alias_test_main.cc: New file.
12034 * testsuite/weak_alias_test_1.cc: New file.
12035 * testsuite/weak_alias_test_2.cc: New file.
12036 * testsuite/weak_alias_test_3.cc: New file.
12037
780e49c5
ILT
120382008-04-08 Ian Lance Taylor <iant@google.com>
12039
cdb0b8f5
ILT
12040 * options.h (class General_options): Add --noinhibit-exec option.
12041 * main.cc (main): Check --noinhibit-exec.
12042
0864d551
ILT
12043 * options.h (class General_options): Define --wrap as a special
12044 option. Add wrap_symbols_ field.
12045 (General_options::any_wrap_symbols): New function.
12046 (General_options::is_wrap_symbol): New function.
12047 * options.cc (General_options::parse_wrap): New function.
12048 (General_options::General_options): Initialize wrap_symbols_.
12049 * symtab.cc (Symbol_table::wrap_symbol): New function.
12050 (Symbol_table::add_from_object): Handle --wrap.
12051 * symtab.h (class Symbol_table): Declare wrap_symbol.
12052 * target.h (Target::wrap_char): New function.
12053 (Target::Target_info): Add wrap_char field.
12054 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
12055 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12056 * testsuite/testfile.cc (Target_test::test_target_info):
12057 Likewise.
12058
789aa6de
ILT
12059 * errors.cc (Errors::undefined_symbol): Mention symbol version if
12060 there is one.
12061
2c38906f
ILT
12062 * layout.h (class Layout): Add added_eh_frame_data_ field.
12063 * layout.cc (Layout::Layout): Initialize new field.
12064 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
12065 output section until we find a section we merged successfully.
12066 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
12067 that the size be non-zero.
12068
780e49c5
ILT
12069 * merge.cc (Object_merge_map::get_output_offset): Remove inline
12070 qualifier.
12071
7fcd0256
ILT
120722008-04-08 Craig Silverstein <csilvers@google.com>
12073
12074 * configure.ac: Export new conditional variable HAVE_ZLIB.
12075 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
12076 on HAVE_ZLIB.
12077 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
12078 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12079
6835af53
ILT
120802008-04-07 Ian Lance Taylor <iant@google.com>
12081
e24f324c
ILT
12082 * version.cc (version_string): Set to "1.5".
12083
a036edd8
ILT
12084 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
12085 Add issued_non_pic_error_ field. Declare check_non_pic.
12086 (Target_x86_64::Scan::check_non_pic): New function.
12087 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
12088 (Target_x86_64::Scan::global): Likewise.
12089
624f8810
ILT
12090 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
12091 addend parameter. Change caller. Handle merge sections.
12092 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
12093 Address to Addend. Don't add in the result of
12094 local_section_offset, pass down the addend and use the returned
12095 value.
12096 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
12097 Update declarations of local_section_offset and symbol_value.
12098 * testsuite/two_file_test_1.cc (t18): New function.
12099 * testsuite/two_file_test_2.cc (f18): New function.
12100 * testsuite/two_file_test_main.cc (main): Call t18.
12101 * testsuite/two_file_test.h (t18, f18): Declare.
12102
6835af53
ILT
12103 * configure.ac: Don't test for objdump, c++filt, or readelf.
12104 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
12105 conditionals.
12106 (TEST_READELF): New variable.
12107 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
12108 (check_PROGRAMS): Add two_file_strip_test.
12109 (two_file_strip_test): New target.
12110 (check_PROGRAMS): Add two_file_same_shared_strip_test.
12111 (two_file_same_shared_strip_test_SOURCES): New variable.
12112 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
12113 (two_file_same_shared_strip_test_LDFLAGS): New variable.
12114 (two_file_same_shared_strip_test_LDADD): New variable.
12115 (two_file_shared_strip.so): New target.
12116 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
12117 (ver_test_5.syms, ver_test_7.syms): Likewise.
12118 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
12119 (strip_test_3.stdout): Use TEST_OBJDUMP.
12120 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12121
86925eef
CC
121222008-04-04 Cary Coutant <ccoutant@google.com>
12123
12124 * symtab.h (Symbol::is_weak_undefined): New function.
12125 (Symbol::is_strong_undefined): New function.
12126 (Symbol::is_absolute): New function.
12127 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
12128 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
12129 absolute symbols.
12130 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
12131 (weak_undef_test): New target.
12132 * testsuite/Makefile.in: Rebuild.
12133 * testsuite/weak_undef_file1.cc: New file.
12134 * testsuite/weak_undef_file2.cc: New file.
12135 * testsuite/weak_undef_test.cc: New file.
12136
126f3ece
ILT
121372008-04-03 Craig Silverstein <csilvers@google.com>
12138
12139 * compressed_output.h (class Output_compressed_section): Use
12140 unsigned buffer.
12141 * compressed_output.cc (zlib_compress): Use unsigned buffers,
12142 add zlib header.
12143 (zlib_compressed_suffix): Removed.
12144 (Output_compressed_section::set_final_data_size): Use unsigned
12145 buffers.
12146 * testsuite/Makefile.am (flagstest_compress_debug_sections):
12147 Fix linker invocation.
12148 (flagstest_o_specialfile_and_compress_debug_sections):
12149 Likewise.
12150 * testsuite/Makefile.in: Regenerated.
12151
deae2a14
DM
121522008-04-02 David S. Miller <davem@davemloft.net>
12153
12154 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
12155 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
12156
70752818
ILT
121572008-04-02 Craig Silverstein <csilvers@google.com>
12158
12159 * TODO: New file.
12160
39d0cb0e
ILT
121612008-04-02 Ian Lance Taylor <iant@google.com>
12162
12163 * fileread.cc (File_read::find_view): Add byteshift and vshifted
12164 parameters. Update for new key type to views_. Change all
12165 callers.
12166 (File_read::read): Adjust for byteshift in returned view.
12167 (File_read::add_view): New function, broken out of
12168 find_and_make_view.
12169 (File_read::make_view): New function, broken out of
12170 find_and_make_view.
12171 (File_read::find_or_make_view): Add offset and aligned
12172 parameters. Rewrite accordingly. Change all callers.
12173 (File_read::get_view): Add offset and aligned parameters. Adjust
12174 for byteshift in return value.
12175 (File_read::get_lasting_view): Likewise.
12176 * fileread.h (class File_read): Update declarations.
12177 (class File_read::View): Add byteshift_ field. Add byteshift to
12178 constructor. Add byteshift method.
12179 * archive.h (Archive::clear_uncached_views): New function.
12180 (Archive::get_view): Add aligned parameter. Change all callers.
12181 * object.h (Object::get_view): Add aligned parameter. Change all
12182 callers.
12183 (Object::get_lasting_view): Likewise.
12184
12185 * fileread.cc (File_read::release): Don't call clear_views if
12186 there are multiple objects.
12187 * fileread.h (File_read::clear_uncached_views): New function.
12188 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
12189 on the archive.
12190
a1207466
CC
121912008-03-31 Cary Coutant <ccoutant@google.com>
12192
12193 Add thin archive support.
12194 * archive.cc (Archive::armagt): New const.
12195 (Archive::setup): Remove task parameter and calls to unlock.
12196 (Archive::unlock_nested_archives): New function.
12197 (Archive::read_header): Add nested_off parameter. Change
12198 all callers.
12199 (Archive::interpret_header): Likewise.
12200 (Archive::include_all_members): Change to handle thin
12201 archives.
12202 (Archive::include_member): Likewise.
12203 * archive.h (Archive::Archive): Add new parameters and
12204 initializers.
12205 (Archive::armagt): New const.
12206 (Archive::setup): Remove task parameter.
12207 (Archive::unlock_nested_archives): New function.
12208 (Archive::read_header): Add nested_off parameter.
12209 (Archive::interpret_header): Likewise.
12210 (Archive::Nested_archive_table): New typedef.
12211 (Archive::is_thin_archive_): New field.
12212 (Archive::nested_archives_): New field.
12213 (Archive::options_): New field.
12214 (Archive::dirpath_): New field.
12215 (Archive::task_): New field.
12216 * readsyms.cc (Read_symbols::do_read_symbols): Add check
12217 for thin archives. Pass additional parameters to
12218 Archive::Archive. Unlock the archive file after calling
12219 Archive::setup.
cd536b21 12220
479f6503
ILT
122212008-03-29 Ian Lance Taylor <iant@google.com>
12222
686c8caf
ILT
12223 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
12224 version symbol to be local.
12225 * testsuite/ver_test_4.sh: New file.
12226 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
12227 (check_DATA): Add ver_test_4.syms.
12228 (ver_test_4.syms): New target.
12229 * testsuite/Makefile.in: Rebuild.
12230
ab794b6b
ILT
12231 * output.cc
12232 (Output_section::Input_section_sort_entry::has_priority): New
12233 function.
12234 (Output_section::Input_section_sort_entry::match_file_name): New
12235 function.
12236 (Output_section::Input_section_sort_entry::match_section_name):
12237 Remove.
12238 (Output_section::Input_section_sort_entry::match_section_name_prefix):
12239 Remove.
12240 (Output_section::Input_section_sort_entry::match_section_file):
12241 Remove.
12242 (Output_section::Input_section_sort_compare::operator()): Rewrite
12243 using new Input_section_sort_entry functions. Sort crtbegin and
12244 crtend first. Sort sections with no priority before sections with
12245 a priority.
12246 * testsuite/initpri1.c (d3): Check j != 4.
12247 (cd5): New constructor/destructor function.
12248 (main): Check j != 2.
12249
479f6503
ILT
12250 * symtab.cc (Symbol_table::add_from_object): If we don't use the
12251 new symbol when resolving, don't call set_is_default.
12252 * testsuite/ver_test_7.cc: New file.
12253 * testsuite/ver_test_7.sh: New file.
12254 * testsuite/Makefile.am (ver_test_7.so): New target.
12255 (ver_test_7.o): New target.
12256 (check_SCRIPTS): Add ver_test_7.sh.
12257 (check_DATA): Add ver_test_7.syms.
12258 (ver_test_7.syms): New target.
12259
2fd32231
ILT
122602008-03-28 Ian Lance Taylor <iant@google.com>
12261
12262 * layout.cc (Layout::layout): If we see an input section with a
12263 name that needs sorting, set the must_sort flag for the output
12264 section.
12265 (Layout::make_output_section): If the name of the output section
12266 indicates that it might require sorting, set the may_sort flag.
12267 * output.h (Output_section::may_sort_attached_input_sections): New
12268 function.
12269 (Output_section::set_may_sort_attached_input_sections): New
12270 function.
12271 (Output_section::must_sort_attached_input_sections): New
12272 function.
12273 (Output_section::set_must_sort_attached_input_sections): New
12274 function.
12275 (class Output_section): Declare Input_section_sort_entry. Define
12276 Input_section_sort_compare. Declare
12277 sort_attached_input_sections. Add new fields:
12278 may_sort_attached_input_sections_,
12279 must_sort_attached_input_sections_,
12280 attached_input_sections_are_sorted_.
12281 * output.cc (Output_section::Output_section): Initialize new
12282 fields.
12283 (Output_section::add_input_section): Add an entry to
12284 input_sections_ if may_sort or must_sort are true.
12285 (Output_section::set_final_data_size): Call
12286 sort_attached_input_sections if necessary.
12287 (Output_section::Input_section_sort_entry): Define new class.
12288 (Output_section::Input_section_sort_compare::operator()): New
12289 function.
12290 (Output_section::sort_attached_input_sections): New function.
12291 * configure.ac: Check whether the compiler supports constructor
12292 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
12293 * testsuite/initpri1.c: New file.
12294 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
12295 CONSTRUCTOR_PRIORITY.
12296 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
12297 (initpri1_LDFLAGS): New variable.
12298 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12299
18e6b24e
ILT
123002008-03-27 Ian Lance Taylor <iant@google.com>
12301
49bdd526
ILT
12302 * common.cc (Sort_commons::operator): Correct sorting algorithm.
12303 * testsuite/common_test_1.c: New file.
12304 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
12305 (common_test_1_SOURCES): New variable.
12306 (common_test_1_DEPENDENCIES): New variable.
12307 (common_test_1_LDFLAGS): New variable.
12308
18e6b24e
ILT
12309 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
12310 and commons_ correctly when NAME/VERSION does not override
12311 NAME/NULL.
12312 * testsuite/ver_test_6.c: New file.
12313 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
12314 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
12315 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
12316
04bf7072
ILT
123172008-03-26 Ian Lance Taylor <iant@google.com>
12318
5871526f
ILT
12319 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
12320 of an undefined symbol from a version script.
12321 * testsuite/Makefile.am (ver_test_5.so): New target.
12322 (ver_test_5.o): New target.
12323 (check_SCRIPTS): Add ver_test_5.sh.
12324 (check_DATA): Add ver_test_5.syms.
12325 (ver_test_5.syms): New target.
12326 * testsuite/ver_test_5.cc: New file.
12327 * testsuite/ver_test_5.script: New file.
12328 * testsuite/ver_test_5.sh: New file.
12329 * Makefile.in, testsuite/Makefile.in: Rebuild.
12330
04bf7072
ILT
12331 PR gold/5986
12332 Fix problems building gold with gcc 4.3.0.
12333 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
12334 (gold_error_at_location, gold_warning_at_location): Use it.
12335 * configure.ac: Check whether we can compile and use a template
12336 function with a printf attribute.
12337 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
12338 when jumping over bytes.
12339 * object.cc: Instantiate Object::read_section_data.
12340 * debug.h: Include <cstring>
12341 * dwarf_reader.cc: Include <algorithm>
12342 * main.cc: Include <cstring>.
12343 * options.cc: Include <cstring>.
12344 * output.cc: Include <cstring>.
12345 * script.cc: Include <cstring>.
12346 * script.h: Include <string>.
12347 * symtab.cc: Include <cstring> and <algorithm>.
12348 * target-select.cc: Include <cstring>.
12349 * version.cc: Include <string>.
12350 * testsuite/testmain.cc: Include <cstdlib>.
12351 * configure, config.in: Rebuild.
12352
874c5b28
ILT
123532008-03-25 Ian Lance Taylor <iant@google.com>
12354
819d6c3a
ILT
12355 * options.cc: Include "../bfd/bfdver.h".
12356 (options::help): Print bug reporting address.
12357
f4b2c6f5
ILT
12358 * version.cc (print_version): Adjust output for current value of
12359 BFD_VERSION_STRING.
12360
12361 * NEWS: New file.
12362
e96caa79
ILT
12363 * options.cc (options::help): Print list of supported targets.
12364 * target-select.h: Include <vector>.
12365 (class Target_selector): Make machine_, size_, and is_big_endian_
12366 fields const. Add bfd_name_ and instantiated_target_ fields.
12367 (Target_selector::Target_selector): Add bfd_name parameter.
12368 (Target_selector::recognize): Make non-virtual, call
12369 do_recognize.
12370 (Target_selector::recognize_by_name): Make non-virtual, call
12371 do_recognize_by_name.
12372 (Target_selector::supported_names): New function.
12373 (Target_selector::bfd_name): New function.
12374 (Target_selector::do_instantiate_target): New pure virtual
12375 function.
12376 (Target_selector::do_recognize): New virtual function.
12377 (Target_selector::do_recognize_by_name): New virtual function.
12378 (Target_selector::instantiate_target): New private function.
12379 (supported_target_names): Declare.
12380 * target-select.cc (Target_selector::Target_selector): Update for
12381 new parameter and fields.
12382 (select_target_by_name): Check that the name matches before
12383 calling recognize_by_name.
12384 (supported_target_names): New function.
12385 * i386.cc (class Target_selector_i386): Update Target_selector
12386 constructor call. Remove recognize and recognize_by_name. Add
12387 do_instantiate_target.
12388 * x86_64.cc (class Target_selector_x86_64): Likewise.
12389 * testsuite/testfile.cc (class Target_selector_test): Update for
12390 changes to Target_selector.
12391
874c5b28
ILT
12392 * README: Rewrite, with some notes on unsupported features.
12393
0a65a3a7
CC
123942008-03-24 Cary Coutant <ccoutant@google.com>
12395
12396 * i386.cc (Target_i386::Got_type): New enum declaration.
12397 (Target_i386::Scan::local): Updated callers of Output_data_got
12398 member functions.
12399 (Target_i386::Scan::global): Likewise.
12400 (Target_i386::Relocate::relocate): Likewise.
12401 (Target_i386::Relocate::relocate_tls): Likewise.
12402 * object.h (Got_offset_list): New class.
12403 (Sized_relobj::local_has_got_offset): Added got_type parameter.
12404 (Sized_relobj::local_got_offset): Likewise.
12405 (Sized_relobj::set_local_got_offset): Likewise.
12406 (Sized_relobj::local_has_tls_got_offset): Removed.
12407 (Sized_relobj::local_tls_got_offset): Removed.
12408 (Sized_relobj::set_local_tls_got_offset): Removed.
12409 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
12410 * output.cc (Output_data_got::add_global): Added got_type parameter.
12411 (Output_data_got::add_global_with_rel): Likewise.
12412 (Output_data_got::add_global_with_rela): Likewise.
12413 (Output_data_got::add_global_pair_with_rel): New function.
12414 (Output_data_got::add_global_pair_with_rela): New function.
12415 (Output_data_got::add_local): Added got_type parameter.
12416 (Output_data_got::add_local_with_rel): Likewise.
12417 (Output_data_got::add_local_with_rela): Likewise.
12418 (Output_data_got::add_local_pair_with_rel): New function.
12419 (Output_data_got::add_local_pair_with_rela): New function.
12420 (Output_data_got::add_global_tls): Removed.
12421 (Output_data_got::add_global_tls_with_rel): Removed.
12422 (Output_data_got::add_global_tls_with_rela): Removed.
12423 (Output_data_got::add_local_tls): Removed.
12424 (Output_data_got::add_local_tls_with_rel): Removed.
12425 (Output_data_got::add_local_tls_with_rela): Removed.
12426 * output.h (Output_data_got::add_global): Added got_type parameter.
12427 (Output_data_got::add_global_with_rel): Likewise.
12428 (Output_data_got::add_global_with_rela): Likewise.
12429 (Output_data_got::add_global_pair_with_rel): New function.
12430 (Output_data_got::add_global_pair_with_rela): New function.
12431 (Output_data_got::add_local): Added got_type parameter.
12432 (Output_data_got::add_local_with_rel): Likewise.
12433 (Output_data_got::add_local_with_rela): Likewise.
12434 (Output_data_got::add_local_pair_with_rel): New function.
12435 (Output_data_got::add_local_pair_with_rela): New function.
12436 (Output_data_got::add_global_tls): Removed.
12437 (Output_data_got::add_global_tls_with_rel): Removed.
12438 (Output_data_got::add_global_tls_with_rela): Removed.
12439 (Output_data_got::add_local_tls): Removed.
12440 (Output_data_got::add_local_tls_with_rel): Removed.
12441 (Output_data_got::add_local_tls_with_rela): Removed.
12442 * resolve.cc (Symbol::override_base_with_special): Removed
12443 reference to has_got_offset_ field.
12444 * symtab.cc (Symbol::init_fields): Replaced initialization
12445 of got_offset_ with got_offsets_. Removed initialization
12446 of has_got_offset_
53fcba31 12447 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
12448 (Symbol::got_offset): Likewise.
12449 (Symbol::set_got_offset): Likewise.
12450 (Symbol::has_tls_got_offset): Removed.
12451 (Symbol::tls_got_offset): Removed.
12452 (Symbol::set_tls_got_offset): Removed.
12453 (Symbol::got_offset_): Removed.
12454 (Symbol::tls_mod_got_offset_): Removed.
12455 (Symbol::tls_pair_got_offset_): Removed.
12456 (Symbol::got_offsets_): New field.
12457 (Symbol::has_got_offset): Removed.
12458 (Symbol::has_tls_mod_got_offset): Removed.
12459 (Symbol::has_tls_pair_got_offset): Removed.
12460 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
12461 (Target_x86_64::Scan::local): Updated callers of Output_data_got
12462 member functions.
12463 (Target_x86_64::Scan::global): Likewise.
12464 (Target_x86_64::Relocate::relocate): Likewise.
12465 (Target_x86_64::Relocate::relocate_tls): Likewise.
12466
bd52eafb
BE
124672008-03-25 Ben Elliston <bje@au.ibm.com>
12468
12469 * yyscript.y: Fix spelling error in comment.
12470
8b105e34
ILT
124712008-03-24 Ian Lance Taylor <iant@google.com>
12472
8ed814a9
ILT
12473 * options.h (class General_options): Define build_id option.
12474 * layout.h (class Layout): Declare write_build_id, create_note,
12475 create_build_id. Add build_id_note_ member.
12476 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
12477 "libiberty.h", "md5.h", "sha1.h".
12478 (Layout::Layout): Initialize eh_frame_data_,
12479 eh_frame_hdr_section_, and build_id_note_.
12480 (Layout::finalize): Call create_build_id.
12481 (Layout::create_note): New function, broken out of
12482 Layout::create_gold_note.
12483 (Layout::create_gold_note): Call create_note.
12484 (Layout::create_build_id): New function.
12485 (Layout::write_build_id): New function.
12486 (Close_task_runner::run): Call write_build_id.
12487
8b105e34
ILT
12488 * x86_64.cc: Correct license to GPLv3.
12489
086a1841
ILT
124902008-03-23 Ian Lance Taylor <iant@google.com>
12491
12492 * options.cc: Include "demangle.h".
12493 (parse_optional_string): New function.
12494 (parse_long_option): Handle takes_optional_argument.
12495 (parse_short_option): Update dash_z initializer. Handle
12496 takes_optional_argument.
12497 (General_options::General_options): Initialize do_demangle_.
12498 (General_options::finalize): Set do_demangle_. Handle demangling
12499 style.
12500 * options.h (parse_optional_string): Declare.
12501 (struct One_option): Add optional_arg field. Update constructor.
12502 Update call constructor calls. Add takes_optional_argument
12503 function.
12504 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
12505 (DEFINE_optional_string): Define.
12506 (General_options::demangle): Change from DEFINE_bool to
12507 DEFINE_optional_string.
12508 (General_options::no_demangle): New function.
12509 (General_options::do_demangle): New function.
12510 (General_options::set_do_demangle): New function.
12511 (General_options::execstack_status_): Move definition to end of
12512 class definition.
12513 (General_options::static_): Likewise.
12514 (General_options::do_demangle_): New field.
12515 * object.cc (big_endian>::get_symbol_location_info): Call
12516 Options::do_demangle, not Options::demangle.
12517 * symtab.cc (demangle): Likewise.
12518
cbb93e63
ILT
125192008-03-22 Ian Lance Taylor <iant@google.com>
12520
12521 * gold.h: Include <cstddef> and <sys/types.h>
12522 * options.h: Include <cstring>.
12523
ec531623
ILT
125242008-03-21 Ian Lance Taylor <iant@google.com>
12525
12526 * Added source code to GNU binutils.
This page took 0.739918 seconds and 4 git commands to generate.