gdb: sim: check return value of sim_create_inferior
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
f9fa4a63
CC
12012-02-14 Cary Coutant <ccoutant@google.com>
2
3 * options.cc (General_options::finalize): Disallow -pie and -static.
4
2c175ebc
DK
52012-02-03 Doug Kwan <dougkwan@google.com>
6
7 * arm.cc (Arm_relocate_functions::abs8,
8 Arm_relocate_functions::abs16): Use
9 Bits::has_signed_unsigned_overflow32.
10 (Arm_relocate_functions::thm_abs8): Correct range of
11 overflow check.
12 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
13 in assertions.
14
90cff06f
DK
152012-02-02 Doug Kwan <dougkwan@google.com>
16
17 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
18 position independent outputs, not just shared objects.
19
63887f3d
L
202012-01-30 H.J. Lu <hongjiu.lu@intel.com>
21
22 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
23 * configure: Regenerated.
24
bef2b434
ILT
252012-01-27 Ian Lance Taylor <iant@google.com>
26
27 * reloc.h (Bits): New class with static functions, copied from
28 namespace utils in arm.cc.
29 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
30 instead.
31
c335b55d
L
322012-01-27 H.J. Lu <hongjiu.lu@intel.com>
33
34 * incremental.cc (write_info_blocks): Correct relocation offset.
35
41194d9f
L
362012-01-27 H.J. Lu <hongjiu.lu@intel.com>
37
38 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
39 (Relocate::tls_gd_to_le): Likewise.
40
1bae613c
L
412012-01-27 H.J. Lu <hongjiu.lu@intel.com>
42
43 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
44
24482ca0
L
452012-01-27 H.J. Lu <hongjiu.lu@intel.com>
46
47 * configure.ac: Check if -mcmodel=medium works.
48 * configure: Regenerated.
49
c2c7840a
CC
502012-01-24 Cary Coutant <ccoutant@google.com>
51
52 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
53 definition and ...
54 (read_unsigned_LEB_128_x): ... this new function.
55 (read_signed_LEB_128): Replaced with inline definition and ...
56 (read_signed_LEB_128_x): ... this new function.
57 * int_encoding.h (read_unsigned_LEB_128_x): New function.
58 (read_unsigned_LEB_128): Add inline definition.
59 (read_signed_LEB_128_x): New function.
60 (read_signed_LEB_128): Add inline definition.
61 * testsuite/Makefile.am (leb128_unittest): New unit test.
62 * testsuite/Makefile.in: Regenerate.
63 * testsuite/leb128_unittest.cc: New unit test.
64
833de760 652012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
66
67 PR gold/13617
68 * i386.cc (Target_i386::do_code_fill): When using a jmp
69 instruction, pad with nop instructions.
70 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
71
618d6666
L
722012-01-22 H.J. Lu <hongjiu.lu@intel.com>
73
74 * x86_64.cc (gc_process_relocs): Add typename on types used in
75 template.
76 (scan_relocs): Likewise.
77 (relocate_section): Likewise.
78 (apply_relocation): Likewise.
79
3660ff06
L
802012-01-10 H.J. Lu <hongjiu.lu@intel.com>
81
82 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
83 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
84 under x32.
85
fc51264f
L
862012-01-09 H.J. Lu <hongjiu.lu@intel.com>
87
88 * x86_64.cc: Initial support for x32.
89
dd74ae06
CC
902012-01-03 Cary Coutant <ccoutant@google.com>
91
92 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
93 Use abstract base class for GOT.
94 * gold/output.h (class Output_data_got_base): New abstract base class.
95 (class Output_data_got): Derive from new base class, adjust ctors.
96 (Output_data_got::reserve_slot): Make virtual; rename to
97 do_reserve_slot; Adjust callers.
98 * gold/target.h (Sized_target::init_got_plt_for_update): Return
99 pointer to abstract base class.
100 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
101
83896202
ILT
1022011-12-18 Ian Lance Taylor <iant@google.com>
103
104 * object.h (Relobj::local_symbol_value): New function.
105 (Relobj::local_plt_offset): New function.
106 (Relobj::local_has_got_offset): New function.
107 (Relobj::local_got_offset): New function.
108 (Relobj::set_local_got_offset): New function.
109 (Relobj::do_local_symbol_value): New pure virtual function.
110 (Relobj::do_local_plt_offset): Likewise.
111 (Relobj::do_local_has_got_offset): Likewise.
112 (Relobj::do_local_got_offset): Likewise.
113 (Relobj::do_set_local_got_offset): Likewise.
114 (Sized_relobj::do_local_has_got_offset): Rename from
115 local_has_got_offset.
116 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
117 (Sized_relobj::do_set_local_got_offset): Rename from
118 set_local_got_offset.
119 (Sized_relobj_file::do_local_plt_offset): Rename from
120 local_plt_offset.
121 (Sized_relobj_file::do_local_symbol_value): New function.
122 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
123 local_plt_offset.
124 * output.cc (Output_data_got::Got_entry::write): Change object to
125 Relobj. Use local_symbol_value.
126 (Output_data_got::add_global_with_rel): Change rel_dyn to
127 Output_data_reloc_generic*. Use add_global_generic.
128 (Output_data_got::add_global_with_rela): Remove. Change all
129 callers to use add_global_with_rel.
130 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
131 Output_data_reloc_generic*. Use add_global_generic.
132 (Output_data_got::add_global_pair_with_rela): Remove. Change all
133 callers to use add_global_pair_with_rel.
134 (Output_data_got::add_local): Change object to Relobj*.
135 (Output_data_got::add_local_plt): Likewise.
136 (Output_data_got::add_local_with_rel): Change object to Relobj*,
137 change rel_dyn to Output_data_reloc_generic*. Use
138 add_local_generic.
139 (Output_data_got::add_local_with_rela): Remove. Change all
140 callers to use all_local_with_rel.
141 (Output_data_got::add_local_pair_with_rel): Change object to
142 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
143 add_output_section_generic.
144 (Output_data_got::add_local_pair_with_rela): Remove. Change all
145 callers to use add_local_pair_with_rel.
146 (Output_data_got::reserve_local): Change object to Relobj*.
147 * output.h: (class Output_data_reloc_generic): Add pure virtual
148 declarations for add_global_generic, add_local_generic,
149 add_output_section_generic.
150 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
151 functions for Output_data_reloc_generic. Update declarations for
152 changes listed in output.cc.
153 (class Output_data_got): Change template parameter to got_size.
154 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
155 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
156 function.
157 (Sized_relobj_incr::do_local_plt_offset): New function.
158 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
159 add_global_generic.
160
76677ad0
CC
1612011-12-17 Cary Coutant <ccoutant@google.com>
162
163 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
164 * resolve.cc (Symbol_table::resolve): Likewise.
165 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
166 arrays.
167 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
168
8b8dd8d5
ILT
1692011-12-16 Ian Lance Taylor <iant@google.com>
170
171 * output.h (Output_data_reloc_generic::add): Only call
172 add_dynamic_reloc if this is a dynamic reloc section.
173
d55525b9
L
1742011-12-15 H.J. Lu <hongjiu.lu@intel.com>
175
176 PR gold/13505
177 * target-reloc.h (apply_relocation): Replace <64, false> with
178 <size, big_endian>.
179
ff81c7c1
NC
1802011-11-25 Nick Clifton <nickc@redhat.com>
181
182 * po/it.po: New Italian translation.
183
628f39be
SA
1842011-11-17 Sterling Augustine <saugustine@google.com>
185
186 * script.cc (script_include_directive): Implement.
187 (read_script_file): New local variables name and search_path. Update
188 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
189 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
190 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
191
98ef3ea4
SA
1922011-11-11 Sterling Augustine <saugustine@google.com>
193
194 * yyscript.y (section_cmd): Add support for INCLUDE directive.
195 (file_or_sections_cmd): Likewise.
196
f4a8b6d7
DK
1972011-11-11 Doug Kwan <dougkwan@google.com>
198
199 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
200 if --just-symbols is given.
201
29ab395d
DK
2022011-11-10 Doug Kwan <dougkwan@google.com>
203
204 PR gold/13362
205 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
206 when processing data relocs.
207 * reloc.h (Relocate_functions::rel_unaligned): New method.
208 (Relocate_functions::pcrel_unaligned): Ditto.
209 (Relocate_functions::rel32_unaligned): Ditto.
210 (Relocate_functions::pcrel32_unaligned): Ditto.
211
2c339f71
DK
2122011-11-09 Doug Kwan <dougkwan@google.com>
213
214 PR gold/13362
215 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
216 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
217 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
218 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
219 (Relocate_functions::rel_unaligned): New.
220 (Relocate_functions::rel32_unaligned): New.
221 * target-reloc.h (relocate_for_relocatable): Add code to handle
222 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
223 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
224 arm_unaligned_reloc_r): New targets.
225 * testsuite/Makefile.in: Regenerate.
226 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
227 linking.
228
3f3cddf1
ILT
2292011-11-02 Ian Lance Taylor <iant@google.com>
230
231 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
232 NATIVE_LINKER.
233 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
234 * options.cc (General_options::finalize): Use library search path
235 from configure script if specified. If not native and no sysroot,
236 only search TOOLLIBDIR.
237 * options.h (Search_directory::Search_directory): Change name to
238 const std::string&.
239 (General_options::add_to_library_path_with_sysroot): Change arg to
240 const std::string&.
241 * configure, Makefile.in, config.in: Rebuild.
242
a8e2273b
ILT
2432011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
244
245 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
246 we are working around the ARM1176 Erratum.
247 * options.h (General_options::fix_arm1176): Add option.
248 * testsuite/Makefile.am: Add testcases, and keep current ones
249 working.
250 * testsuite/Makefile.in: Regenerate.
251 * testsuite/arm_fix_1176.s: New file.
252 * testsuite/arm_fix_1176.sh: Likewise.
253
cd6eab1c
ILT
2542011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
255
256 * arm.cc (Target_arm::Target_arm): Remove initialisation of
257 may_use_blx_.
258 (Target_arm::may_use_blx): Remove method.
259 (Target_arm::set_may_use_blx): Likewise.
260 (Target_arm::may_use_v4t_interworking): New method.
261 (Target_arm::may_use_v5t_interworking): Likewise.
262 (Target_arm::may_use_blx_): Remove member variable.
263 (Arm_relocate_functions::arm_branch_common): Check for v5T
264 interworking.
265 (Arm_relocate_functions::thumb_branch_common): Likewise.
266 (Reloc_stub::stub_type_for_reloc): Likewise.
267 (Target_arm::do_finalize_sections): Correct interworking checks.
268 * testsuite/Makefile.am: Add new tests.
269 * testsuite/Makefile.in: Regenerate.
270 * testsuite/arm_farcall_arm_arm.s: New test.
271 * testsuite/arm_farcall_arm_arm.sh: Likewise.
272 * testsuite/arm_farcall_arm_thumb.s: Likewise.
273 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
274 * testsuite/arm_farcall_thumb_arm.s: Likewise.
275 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
276 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
277 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
278
286adcf4
CC
2792011-10-31 Cary Coutant <ccoutant@google.com>
280
281 PR gold/13023
282 * expression.cc (Expression::eval_with_dot): Add
283 is_section_dot_assignment parameter.
284 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
285 absolute and assigning to dot within a section.
286 * script-sections.cc
287 (Output_section_element_assignment::set_section_addresses): Pass
288 dot_section to set_if_absolute.
289 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
290 as is_section_dot_assignment flag to eval_with_dot.
291 (Output_section_element_dot_assignment::set_section_addresses):
292 Likewise.
293 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
294 parameter. Also set value if relative to dot_section; set the
295 symbol's output_section.
296 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
297 parameter. Adjust all callers.
298 (Expression::eval_maybe_dot): Likewise.
299 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
300 Adjust all callers.
301 * testsuite/script_test_2.t: Test assignment of an absolute value
302 to dot within an output section element.
303
9634ed06
CC
3042011-10-31 Cary Coutant <ccoutant@google.com>
305
306 * options.h (class General_options): Add --[no-]gnu-unique options.
307 * symtab.cc (Symbol_table::sized_write_globals): Convert
308 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
309
de4101c7
CC
3102011-10-31 Cary Coutant <ccoutant@google.com>
311
312 PR gold/13359
313 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
314 unnecessary assertion.
315 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
316
7257cc92
ST
3172011-10-31 Sriraman Tallam <tmsriram@google.com>
318
319 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
320 gc_mark_symbol.
321 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
322 gc_mark_symbol.
323 Change to just keep the section associated with symbol.
324 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
325 they are externally visible and --export-dynamic is turned on.
326 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
327
bfc34b3f
ILT
3282011-10-19 Ian Lance Taylor <iant@google.com>
329
330 PR gold/13163
331 * script-sections.cc
332 (Output_section_element_dot_assignment::needs_output_section): New
333 function.
334
ea0d8c47
ILT
3352011-10-19 Ian Lance Taylor <iant@google.com>
336
337 PR gold/13204
338 * layout.cc (Layout::segment_precedes): Don't assert failure if a
339 --section-start option was seen.
340 * options.h (General_options::any_section_start): New function.
341
abd242a9
DM
3422011-10-18 David S. Miller <davem@davemloft.net>
343
344 PR binutils/13301
345 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
346 member to track relocation locations that have moved during TLS
347 reloc optimizations.
348 (Target_sparc::Relocate::Relocate): Initialize to NULL.
349 (Target_sparc::Relocate::relocate): Adjust view down by 4
350 bytes if it matches reloc_adjust_addr_.
351 (Target_sparc::Relocate::relocate_tls): Always move the
352 __tls_get_addr call delay slot instruction forward 4 bytes when
353 performing relaxation.
354
bab9090f
CC
3552011-10-18 Cary Coutant <ccoutant@google.com>
356
357 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
358 (Output_file::map_no_anonymous): Check for non-zero
359 return code from posix_fallocate.
360
f7c5b166
CC
3612011-10-17 Cary Coutant <ccoutant@google.com>
362
363 PR gold/13245
364 * plugin.cc (is_visible_from_outside): Check for symbols
365 referenced from dynamic objects.
366 * resolve.cc (Symbol_table::resolve): Don't count references
367 from dynamic objects as references from real ELF files.
368 * testsuite/plugin_test_2.sh: Adjust expected result.
369
b490c0bb
CC
3702011-10-17 Cary Coutant <ccoutant@google.com>
371
372 * gold.cc: Include timer.h.
373 (queue_middle_tasks): Stamp time.
374 (queue_final_tasks): Likewise.
375 * main.cc (main): Store timer in parameters. Print timers
376 for each pass.
377 * parameters.cc (Parameters::Parameters): Initialize timer_.
378 (Parameters::set_timer): New function.
379 (set_parameters_timer): New function.
380 * parameters.h (Parameters::set_timer): New function.
381 (Parameters::timer): New function.
382 (Parameters::timer_): New data member.
383 (set_parameters_timer): New function.
384 * timer.cc (Timer::stamp): New function.
385 (Timer::get_pass_time): New function.
386 * timer.h (Timer::stamp): New function.
387 (Timer::get_pass_time): New function.
388 (Timer::pass_times_): New data member.
389
f475cf7b
CC
3902011-10-17 Cary Coutant <ccoutant@google.com>
391
392 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
393 task for members of lib groups.
394
cdd7e244
CC
3952011-10-17 Cary Coutant <ccoutant@google.com>
396
397 PR gold/13288
4f95c8b4 398 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
399 (File_read::make_view): Move bounds check (replace with assert)...
400 (File_read::find_or_make_view): ... to here.
401
dfb45471
CC
4022011-10-12 Cary Coutant <ccoutant@google.com>
403
4f95c8b4 404 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
405 ::read returns less than requested size.
406
53bbcc1b
CC
4072011-10-10 Cary Coutant <ccoutant@google.com>
408
4f95c8b4 409 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
410 Initialize defined_count_.
411 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
412 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
413 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
414 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
415 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 416 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
417 member.
418 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 419 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
420 Return zeroes instead of internal error.
421
397b129b
CC
4222011-10-10 Cary Coutant <ccoutant@google.com>
423
424 PR gold/13249
4f95c8b4 425 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 426 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 427 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
428 (Output_reloc::type_): Adjust size of bit field.
429 (Output_reloc::use_plt_offset_): New bit field.
430 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
431 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
432 flag. Adjust all callers.
4f95c8b4 433 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
434 creating RELATIVE relocations.
435
d5698657
NC
4362011-10-10 Nick Clifton <nickc@redhat.com>
437
438 * po/es.po: Updated Spanish translation.
439 * po/fi.po: Updated Finnish translation.
440
6a59a5c2
DN
4412011-10-03 Diego Novillo <dnovillo@google.com>
442
443 * options.cc (parse_uint): Fix dereference of RETVAL.
444
f0558624
ST
4452011-09-29 Sriraman Tallam <tmsriram@google.com>
446
447 * layout.h (section_order_map_): New member.
448 (get_section_order_map): New member function.
449 * output.cc (Output_section::add_input_section): Check for patterns
450 only when --section-ordering-file is specified.
451 * gold.cc (queue_middle_tasks): Delay updating order of sections till
452 output_sections have been formed.
453 * layout.cc (Layout_Layout): Initialize section_order_map_.
454 * plugin.cc (update_section_order): Store order in order_map. Do not
455 update the order.
456 * testsuite/Makefile.am: Add test case for plugin_final_layout.
457 * testsuite/Makefile.in: Regenerate.
458 * testsuite/plugin_section_order.c: New file.
459 * testsuite/plugin_final_layout.cc: New file.
460 * testsuite/plugin_final_layout.sh: New file.
461
a7dac153
CC
4622011-09-29 Cary Coutant <ccoutant@google.com>
463
4f95c8b4 464 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 465 Check for NULL.
4f95c8b4 466 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
467 symbols during incremental update.
468 (Symbol_table::add_from_dynobj): Likewise.
469
eebd87a5
ILT
4702011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
471 Ian Lance Taylor <iant@google.com>
472
473 * symtab.cc (Symbol_table::define_special_symbol): Always
474 canonicalize version string.
475
403a3331
CC
4762011-09-26 Cary Coutant <ccoutant@google.com>
477
4f95c8b4
CC
478 * gold.cc (queue_initial_tasks): Move option checks ...
479 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
480 some options; make others fatal.
481
235061c2
CC
4822011-09-26 Cary Coutant <ccoutant@google.com>
483
484 gcc PR lto/47247
485 * plugin.cc (get_symbols_v2): New function.
486 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
487 (is_referenced_from_outside): New function.
488 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
489 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
490 (get_symbols): Pass version parameter.
491 (get_symbols_v2): New function.
492 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
493 parameter.
494 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
495 (onload): Add LDPT_GET_SYMBOLS_V2.
496 (all_symbols_read_hook): Use get_symbols_v2; check for
497 LDPR_PREVAILING_DEF_IRONLY_EXP.
498 * testsuite/plugin_test_3.sh: Update expected results.
499
dc87f620
ILT
5002011-09-23 Simon Baldwin <simonb@google.com>
501
502 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
503 configuration options.
504 * configure: Regenerate.
505 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
506 * Makefile.in: Regenerate.
507 * testsuite/Makefile.in: Regenerate.
508
a8279f82
ST
5092011-09-19 Sriraman Tallam <tmsriram@google.com>
510
511 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
512
0c9350c8
CC
5132011-09-19 Cary Coutant <ccoutant@google.com>
514
515 * incremental.cc (can_incremental_update): Fix typo in comment.
516 * incremental.h (can_incremental_update): Likewise.
517
aa06ae28
CC
5182011-09-18 Cary Coutant <ccoutant@google.com>
519
520 * incremental.cc (can_incremental_update): New function.
521 * incremental.h (can_incremental_update): New function.
522 * layout.cc (Layout::init_fixed_output_section): Call it.
523 (Layout::make_output_section): Don't allow patch space in .eh_frame.
524 * object.cc (Sized_relobj_file::do_layout): Call
525 can_incremental_update.
526
ebb300b2
CC
5272011-09-13 Cary Coutant <ccoutant@google.com>
528
529 * configure.ac: Check for glibc support for gnu_indirect_function
530 support with static linking, setting automake conditional
531 IFUNC_STATIC.
532 * Makefile.in: Regenerate.
533 * configure: Regenerate.
534
535 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
536 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
537 for IFUNC_STATIC.
538 * testsuite/Makefile.in: Regenerate.
539
1206d0d5
CC
5402011-09-13 Cary Coutant <ccoutant@google.com>
541
542 * incremental.cc (Sized_relobj_incr::do_layout): Call
543 report_comdat_group for kept comdat sections.
544 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
545 * testsuite/Makefile.in: Regenerate.
546 * testsuite/incr_comdat_test_1.cc: New source file.
547 * testsuite/incr_comdat_test_2_v1.cc: New source file.
548 * testsuite/incr_comdat_test_2_v2.cc: New source file.
549 * testsuite/incr_comdat_test_2_v3.cc: New source file.
550
40b29874
ILT
5512011-09-13 Ian Lance Taylor <iant@google.com>
552
553 * object.cc (Sized_relobj_file::do_layout): Remove unused local
554 variable external_symbols_offset.
555
1b045aac
ILT
5562011-09-12 Ian Lance Taylor <iant@google.com>
557
558 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
559 triggered if object has no symbols.
560
24c6c55a
DM
5612011-09-09 David S. Miller <davem@davemloft.net>
562
563 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
564 (Output_fill_debug_line::do_write): Likewise.
565
66570254
CC
5662011-08-29 Cary Coutant <ccoutant@google.com>
567
568 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
569 casts to match formatting specs.
570 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
571
8ea8cd50
CC
5722011-08-26 Cary Coutant <ccoutant@google.com>
573
574 * layout.cc (Free_list::allocate): Provide guarantee of minimum
575 remaining hole size when allocating.
576 (Layout::make_output_section): Set fill methods for debug sections.
577 * layout.h (Free_list::Free_list_node): Move from private to
578 public.
579 (Free_list::set_min_hole_size): New function.
580 (Free_list::begin, Free_list::end): New functions.
581 (Free_list::min_hole_): New data member.
582 * output.cc: Include dwarf.h.
583 (Output_fill_debug_info::do_minimum_hole_size): New function.
584 (Output_fill_debug_info::do_write): New function.
585 (Output_fill_debug_line::do_minimum_hole_size): New function.
586 (Output_fill_debug_line::do_write): New function.
587 (Output_section::Output_section): Initialize new data member.
588 (Output_section::set_final_data_size): Ensure patch space is larger
589 than minimum hole size.
590 (Output_section::do_write): Fill holes in debug sections.
591 * output.h (Output_fill): New class.
592 (Output_fill_debug_info): New class.
593 (Output_fill_debug_line): New class.
594 (Output_section::set_free_space_fill): New function.
595 (Output_section::free_space_fill_): New data member.
596 * testsuite/Makefile.am (incremental_test_3): Add
597 --incremental-patch option.
598 (incremental_test_4): Likewise.
599 (incremental_test_5): Likewise.
600 (incremental_test_6): Likewise.
601 (incremental_copy_test): Likewise.
602 (incremental_common_test_1): Likewise.
603 * testsuite/Makefile.in: Regenerate.
604
7cf80422
NC
6052011-08-26 Nick Clifton <nickc@redhat.com>
606
607 * po/es.po: Updated Spanish translation.
608
c3f7b0e5
CC
6092011-08-01 Cary Coutant <ccoutant@google.com>
610
611 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
612 * gold/testsuite/Makefile.in: Regenerate.
613 * gold/testsuite/justsyms_exec.c: New source file.
614 * gold/testsuite/justsyms_lib.c: New source file.
615
9590bf25
CC
6162011-08-01 Cary Coutant <ccoutant@google.com>
617
618 * layout.cc (Layout::set_segment_offsets): Don't realign text
619 segment if -Ttext was specified.
620 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
621 file type.
622 * object.h (Sized_relobj_file::e_type): New function.
623 (Sized_relobj_file::e_type_): New data member.
624 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
625 base address for ET_EXEC files.
626 * target.cc (Target::do_make_elf_object_implementation): Allow
627 ET_EXEC files with --just-symbols option.
628
dcd8d12e
CC
6292011-07-28 Cary Coutant <ccoutant@google.com>
630
631 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
632 Add thread_number parameter.
633 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
634 * workqueue-threads.cc
635 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
636 current thread if its thread number is greater than desired thread
637 count.
638 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
639 Add thread_number parameter.
640 (Workqueue::should_cancel_thread): Likewise.
641 (Workqueue::find_runnable_or_wait): Pass thread_number to
642 should_cancel_thread.
643 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
644 parameter.
645
804eb480
ST
6462011-07-22 Sriraman Tallam <tmsriram@google.com>
647
648 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
649 only after checking if it cannot be forced local.
650 * symtab.h (is_externally_visible): Check if the symbol is not forced
651 local.
652
f1ddb600
ILT
6532011-07-15 Ian Lance Taylor <iant@google.com>
654
655 * options.h (class General_options): Add --print-output-format.
656 Move -EL next to -EB, for better --help output.
657 * target-select.cc: Include <cstdio>, "options.h", and
658 "parameters.h".
659 (Target_selector::do_target_bfd_name): New function.
660 (print_output_format): New function.
661 * target-select.h (class Target_selector): Update declarations.
662 (Target_selector::target_bfd_name): New function.
663 (print_output_format): Declare.
664 * main.cc: Include "target-select.h".
665 (main): Handle --print-output-format.
666 * gold.cc: Include "target-select.h".
667 (queue_initial_tasks): Handle --print-output-format when there are
668 no input files.
669 * parameters.cc (parameters_force_valid_target): Give a better
670 error message if -EB/-EL does not match target.
671 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
672 function.
673
7d172687
ILT
6742011-07-15 Ian Lance Taylor <iant@google.com>
675
676 * i386.cc (class Output_data_plt_i386): Add layout_ field.
677 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
678 (Output_data_plt_i386::do_write): Write address of .dynamic
679 section to first entry in .got.plt section.
680 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
681 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
682 Initialize layout_.
683 (Output_data_plt_x86_64::do_write): Write address of .dynamic
684 section to first entry in .got.plt section.
685 * layout.h (Layout::dynamic_section): New function.
686
e9552f7e
ST
6872011-07-13 Sriraman Tallam <tmsriram@google.com>
688
689 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
690 to claim_file call.
691 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
692 input_section_position_, and input_section_glob_.
693 (read_layout_from_file): Call function section_ordering_specified.
694 * layout.h (is_section_ordering_specified): New function.
695 (section_ordering_specified): New function.
696 (section_ordering_specified_): New boolean member.
697 * main.cc(main): Call load_plugins after layout object is defined.
698 * output.cc (Output_section::add_input_section): Use
699 function section_ordering_specified to check if section ordering is
700 needed.
701 * output.cc (Output_section::add_relaxed_input_section): Use
702 function section_ordering_specified to check if section ordering is
703 needed.
704 (Output_section::update_section_layout): New function.
705 (Output_section::sort_attached_input_sections): Check if input section
706 must be reordered.
707 * output.h (Output_section::update_section_layout): New function.
708 * plugin.cc (get_section_count): New function.
709 (get_section_type): New function.
710 (get_section_name): New function.
711 (get_section_contents): New function.
712 (update_section_order): New function.
713 (allow_section_ordering): New function.
714 (Plugin::load): Add the new interfaces to the transfer vector.
715 (Plugin_manager::load_plugins): New parameter.
716 (Plugin_manager::all_symbols_read): New parameter.
717 (Plugin_manager::claim_file): New parameter. Save the elf object for
718 unclaimed objects.
719 (Plugin_manager::get_elf_object): New function.
720 (Plugin_manager::get_view): Change to directly use the bool to check
721 if get_view is called from claim_file_hook.
722 * plugin.h (input_objects): New function
723 (Plugin__manager::load_plugins): New parameter.
724 (Plugin_manager::claim_file): New parameter.
725 (Plugin_manager::get_elf_object): New function.
726 (Plugin_manager::in_claim_file_handler): New function.
727 (Plugin_manager::in_claim_file_handler_): New member.
728 (layout): New function.
729 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
730 handler with an extra parameter. Make the elf object before calling
731 claim_file handler.
732 * testsuite/plugin_test.c (get_section_count): New function pointer.
733 (get_section_type): New function pointer.
734 (get_section_name): New function pointer.
735 (get_section_contents): New function pointer.
736 (update_section_order): New function pointer.
737 (allow_section_ordering): New function pointer.
738 (onload): Check if the new interfaces exist.
739
9446efde
ILT
7402011-07-13 Ian Lance Taylor <iant@google.com>
741
742 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
743 relro section.
744 * x86_64.cc (Target_x86_64::got_section): Likewise.
745 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
746 (relro_now_test_SOURCES): New variable.
747 (relro_now_test_DEPENDENCIES): New variable.
748 (relro_now_test_LDFLAGS): New variable.
749 (relro_now_test_LDADD): New variable.
750 (relro_now_test.so): New target.
751 * testsuite/Makefile.in: Rebuild.
752
07aa62f2
ILT
7532011-07-12 Ian Lance Taylor <iant@google.com>
754
755 PR gold/12980
756 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
757 GLOB_DAT relocation rather than a RELATIVE relocation for a
758 protected symbol when creating a shared library.
759 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
760 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
761 * testsuite/protected_main_1.cc (main): Test that protected
762 function has same address.
763
e2153196
ILT
7642011-07-11 Ian Lance Taylor <iant@google.com>
765
766 PR gold/12979
767 * options.h (class General_options): Add -Bgroup.
768 * options.cc (General_options::finalize): If -Bgroup is set,
769 default to --unresolved-symbols=report-all.
770 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
771 * target-reloc.h (issue_undefined_symbol_error): Handle
772 --unresolved-symbols=report-all.
773
6daf5215
ILT
7742011-07-08 Ian Lance Taylor <iant@google.com>
775
776 PR gold/11985
777 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
778 if linker script discards key sections.
779 (Layout::create_dynamic_symtab): Likewise.
780 (Layout::assign_local_dynsym_offsets): Likewise.
781 (Layout::sized_create_version_sections): Likewise.
782 (Layout::create_interp): Likewise.
783 (Layout::finish_dynamic_section): Likewise.
784 (Layout::set_dynamic_symbol_size): Likewise.
785
beabb2c6
ILT
7862011-07-08 Ian Lance Taylor <iant@google.com>
787
788 PR gold/12386
789 * options.h (class General_options): Add --unresolved-symbols.
790 * target-reloc.h (issue_undefined_symbol_error): Check
791 --unresolved-symbols. Add comments.
792
9c16daf1
ILT
7932011-07-08 Ian Lance Taylor <iant@google.com>
794
795 * testsuite/odr_violation2.cc (Ordering::operator()): Make
796 expression more complex.
797
191f1a2d
ILT
7982011-07-08 Ian Lance Taylor <iant@google.com>
799
800 PR gold/11317
801 * target-reloc.h (issue_undefined_symbol_error): New inline
802 function, broken out of relocate_section.
803 (relocate_section): Call issue_undefined_symbol_error.
804 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
805 there is no TLS segment if we are about to issue an undefined
806 symbol error.
807 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
808
62855347
ILT
8092011-07-08 Ian Lance Taylor <iant@google.com>
810
811 PR gold/12279
812 * resolve.cc (Symbol_table::should_override): Add fromtype
813 parameter. Change all callers. Give error when linking together
814 TLS and non-TLS symbol.
815 (Symbol_table::should_override_with_special): Add fromtype
816 parameter. Change all callers.
817 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
818 there is no TLS segment if we have reported some errors.
819 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
820
67181c72
ILT
8212011-07-08 Ian Lance Taylor <iant@google.com>
822
823 PR gold/12372
824 * target.h (Target::plt_address_for_global): New function.
825 (Target::plt_address_for_local): New function.
826 (Target::plt_section_for_global): Remove.
827 (Target::plt_section_for_local): Remove.
828 (Target::do_plt_address_for_global): New virtual function.
829 (Target::do_plt_address_for_local): New virtual function.
830 (Target::do_plt_section_for_global): Remove.
831 (Target::do_plt_section_for_local): Remove.
832 (Target::register_global_plt_entry): Add Symbol_table and Layout
833 parameters.
834 * output.cc (Output_data_got::Got_entry::write): Use
835 plt_address_for_global and plt_address_for_local.
836 * layout.cc (Layout::add_target_dynamic_tags): Use size and
837 address of output section.
838 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
839 got_irelative_, and irelative_count_ fields. Update
840 declarations.
841 (Output_data_plt_i386::has_irelative_section): New function.
842 (Output_data_plt_i386::entry_count): Add irelative_count_.
843 (Output_data_plt_i386::set_final_data_size): Likewise.
844 (class Target_i386): Add got_irelative_ and rel_irelative_
845 fields. Update declarations.
846 (Target_i386::Target_i386): Initialize new fields.
847 (Target_i386::do_plt_address_for_global): New function replacing
848 do_plt_section_for_global.
849 (Target_i386::do_plt_address_for_local): New function replacing
850 do_plt_section_for_local.
851 (Target_i386::got_section): Create got_irelative_.
852 (Target_i386::rel_irelative_section): New function.
853 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
854 fields. Don't define __rel_iplt_{start,end}.
855 (Output_data_plt_i386::add_entry): Add symtab and layout
856 parameters. Change all callers. Use different PLT and GOT for
857 IFUNC symbols.
858 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
859 layout parameters. Change all callers. Use different PLT and
860 GOT.
861 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
862 (Output_data_plt_i386::rel_irelative): New function.
863 (Output_data_plt_i386::address_for_global): New function.
864 (Output_data_plt_i386::address_for_local): New function.
865 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
866 IRELATIVE GOT when changing IFUNC GOT entries.
867 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
868 reloc.
869 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
870 if we didn't create an IRELATIVE GOT.
871 (Target_i386::Relocate::relocate): Use plt_address_for_global and
872 plt_address_for_local.
873 (Target_i386::do_dynsym_value): Use plt_address_for_global.
874 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
875 got_irelative_, and irelative_count_ fields. Update
876 declarations.
877 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
878 Initialize new fields. Remove symtab parameter. Change all
879 callers.
880 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
881 irelative_count_.
882 (Output_data_plt_x86_64::has_irelative_section): New function.
883 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
884 (class Target_x86_64): Add got_irelative_ and rel_irelative_
885 fields. Update declarations.
886 (Target_x86_64::Target_x86_64): Initialize new fields.
887 (Target_x86_64::do_plt_address_for_global): New function replacing
888 do_plt_section_for_global.
889 (Target_x86_64::do_plt_address_for_local): New function replacing
890 do_plt_section_for_local.
891 (Target_x86_64::got_section): Create got_irelative_.
892 (Target_x86_64::rela_irelative_section): New function.
893 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
894 all callers. Don't create __rel_iplt_{start,end}.
895 (Output_data_plt_x86_64::add_entry): Add symtab and layout
896 parameters. Change all callers. Use different PLT and GOT for
897 IFUNC symbols.
898 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
899 layout parameters. Change all callers. Use different PLT and
900 GOT.
901 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
902 parameters. Change all callers. Use different PLT and GOT for
903 IFUNC symbols.
904 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
905 (Output_data_plt_x86_64::rela_irelative): New function.
906 (Output_data_plt_x86_64::address_for_global): New function.
907 (Output_data_plt_x86_64::address_for_local): New function.
908 (Output_data_plt_x86_64::set_final_data_size): Likewise.
909 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
910 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
911 (Target_x86_64::register_global_plt_entry): Add symtab and layout
912 parameters.
913 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
914 reloc.
915 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
916 symbols if we didn't create an IRELATIVE GOT.
917 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
918 plt_address_for_local.
919 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
920 * testsuite/ifuncvar1.c: New test file.
921 * testsuite/ifuncvar2.c: New test file.
922 * testsuite/ifuncvar3.c: New test file.
923 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
924 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
925 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
926 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
927 * testsuite/Makefile.in: Rebuild.
928
33c15b45
CC
9292011-07-07 Cary Coutant <ccoutant@google.com>
930
931 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
932 (two_file_test_1_ndebug.o): Likewise.
933 (two_file_test_1b_ndebug.o): Likewise.
934 (two_file_test_2_ndebug.o): Likewise.
935 (two_file_test_main_ndebug.o): Likewise.
936 (incremental_test_2): Link with no-debug versions.
937
f48b5fb7
CC
9382011-07-06 Cary Coutant <ccoutant@google.com>
939
940 * gold/incremental.cc
941 (Output_section_incremental_inputs::write_info_blocks): Check for
942 hidden and internal symbols.
943
221597a5
CC
9442011-07-06 Cary Coutant <ccoutant@google.com>
945
946 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
947 Check disposition for startup file.
948 (Incremental_inputs::report_command_line): Ignore
949 --incremental-startup-unchanged option.
950 * options.cc (General_options::parse_incremental_startup_unchanged):
951 New function.
952 (General_options::General_options): Initialize new data member.
953 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
954 (General_options): Add --incremental-startup-unchanged option.
955 (General_options::incremental_startup_disposition): New function.
956 (General_options::incremental_startup_disposition_): New data member.
957
e24719f6
CC
9582011-07-06 Cary Coutant <ccoutant@google.com>
959
960 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
961 input file index to Script_info ctor.
962 (Sized_incremental_binary::do_file_has_changed): Find the
963 command-line argument for files named in scripts.
964 * incremental.h (Script_info::Script_info): New ctor
965 with input file index.
966 (Script_info::input_file_index): New function.
967 (Script_info::input_file_index_): New data member.
968 (Incremental_binary::get_library): Add const.
969 (Incremental_binary::get_script_info): Add const.
970 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
971 * testsuite/Makefile.am (incremental_test_5): New test case.
972 (incremental_test_6): New test case.
973 * testsuite/Makefile.in: Regenerate.
974
8f7c81e8
CC
9752011-07-06 Cary Coutant <ccoutant@google.com>
976
977 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
978 debug output when command lines differ.
979
9fbd3822
CC
9802011-07-06 Cary Coutant <ccoutant@google.com>
981
982 * incremental.cc (Incremental_inputs::report_command_line): Ignore
983 --incremental-patch option.
984 * layout.cc (Free_list::allocate): Extend allocation beyond original
985 end if enabled.
986 (Layout::make_output_section): Mark sections that should get
987 patch space.
988 * options.cc (parse_percent): New function.
989 * options.h (parse_percent): New function.
990 (DEFINE_percent): New macro.
991 (General_options): Add --incremental-patch option.
992 * output.cc (Output_section::Output_section): Initialize new data
993 members.
994 (Output_section::add_input_section): Print section name when out
995 of patch space.
996 (Output_section::add_output_section_data): Likewise.
997 (Output_section::set_final_data_size): Add patch space when
998 doing --incremental-full.
999 (Output_section::do_reset_address_and_file_offset): Remove patch
1000 space.
1001 (Output_segment::set_section_list_addresses): Print debug output
1002 only if --incremental-update.
1003 * output.h (Output_section::set_is_patch_space_allowed): New function.
1004 (Output_section::is_patch_space_allowed_): New data member.
1005 (Output_section::patch_space_): New data member.
1006 * parameters.cc (Parameters::incremental_full): New function.
1007 * parameters.h (Parameters::incremental_full): New function
1008 * testsuite/Makefile.am (incremental_test_2): Add test for
1009 --incremental-patch option.
1010 * testsuite/Makefile.in: Regenerate.
1011 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
1012 (t18): Remove function body.
1013
f6cccc2c
DK
10142011-07-05 Doug Kwan <dougkwan@google.com>
1015
1016 PR gold/12771
1017 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
1018 Arm_Address type for relocation result.
1019 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
1020 overflow check.
1021 (Arm_relocate_functions::abs32): Use unaligned access.
1022 (Arm_relocate_functions::rel32): Ditto.
1023 (Arm_relocate_functions::prel31): Ditto.
1024 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
1025 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
1026 static data relocations.
1027 * testsuite/Makefile.in: Regnerate.
1028 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
1029
28a13fec
ILT
10302011-07-05 Ian Lance Taylor <iant@google.com>
1031
1032 PR gold/12392
1033 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
1034 symbols if necessary.
1035 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
1036
24d47b34
ILT
10372011-07-05 Ian Lance Taylor <iant@google.com>
1038
1039 PR gold/12952
1040 * resolve.cc (Symbol::override_base_with_special): Simply override
1041 version with special symbol version, ignoring previous version.
1042
41f9cbbe
ILT
10432011-07-05 Ian Lance Taylor <iant@google.com>
1044
1045 * object.cc (Sized_relobj_file::include_section_group): Add
1046 information to comment about signature location.
1047
886288f1
ILT
10482011-07-02 Ian Lance Taylor <iant@google.com>
1049
1050 PR gold/12957
1051 * options.h (class General_options): Add -f and -F.
1052 * options.cc (General_options::finalize): Fatal error if -f/-F
1053 are used without -shared.
1054 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
1055
ae3a6d4f
ILT
10562011-07-02 Ian Lance Taylor <iant@google.com>
1057
1058 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
1059
21131061
ILT
10602011-07-01 Ian Lance Taylor <iant@google.com>
1061
1062 PR gold/12525
1063 PR gold/12952
1064 * resolve.cc (Symbol::override_base_with_special): Don't override
1065 the version if the overriding symbol has a different name.
1066 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
1067 all callers. If we give an error about an undefined version,
1068 define the base version if necessary.
1069 * dynobj.h (class Versions): Update declaration.
1070 * testsuite/weak_alias_test_5.cc: New file.
1071 * testsuite/weak_alias_test.script: New file.
1072 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
1073 and versioned_alias have the right value, and call t2.
1074 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
1075 weak_alias_test_5.so.
1076 (weak_alias_test_LDADD): Likewise.
1077 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
1078 * testsuite/Makefile.in: Rebuild.
1079
611062c0
ILT
10802011-07-01 Ian Lance Taylor <iant@google.com>
1081
1082 PR gold/12525
1083 * options.h (class General_options): Support -z notext.
1084 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
1085 -Wl,-z,notext.
1086 (two_file_shared_nonpic.so): Likewise.
1087 (two_file_shared_mixed.so): Likewise.
1088 (two_file_shared_mixed_1.so): Likewise.
1089 (weak_undef_lib_nonpic.so): Likewise.
1090 (alt/weak_undef_lib_nonpic.so): Likewise.
1091 (tls_test_shared_nonpic.so): Likewise.
1092 * testsuite/Makefile.in: Rebuild.
1093
328c7c2f
ILT
10942011-07-01 Ian Lance Taylor <iant@google.com>
1095
1096 PR gold/12525
1097 * configure.ac: Test whether static linking works, setting
1098 the automake conditional HAVE_STATIC.
1099 * testsuite/Makefile.am: Disable tests using -static if
1100 HAVE_STATIC is not true.
1101 * configure, testsuite/Makefile.in: Rebuild.
1102
02d7cd44
ILT
11032011-07-01 Ian Lance Taylor <iant@google.com>
1104
1105 PR gold/12525
1106 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
1107 Assert if we see DW_EH_PE_indirect.
1108 * target.h (Target::ehframe_datarel_base): New function.
1109 (Target::do_ehframe_datarel_base): New target function.
1110 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
1111 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
1112 function.
1113
07a60597
ILT
11142011-07-01 Ian Lance Taylor <iant@google.com>
1115
1116 PR gold/12571
1117 * options.h (class General_options): Add
1118 --ld-generated-unwind-info.
1119 * ehframe.cc (Fde::write): Add address parameter. Change all
1120 callers. If associated with PLT, fill in address and size.
1121 (Cie::set_output_offset): Only add merge mapping if there is an
1122 object.
1123 (Cie::write): Add address parameter. Change all callers.
1124 (Eh_frame::add_ehframe_for_plt): New function.
1125 * ehframe.h (class Fde): Update declarations. Move shndx_ and
1126 input_offset_ fields into union u_, with new plt field.
1127 (Fde::Fde): Adjust for new union field.
1128 (Fde::Fde) [Output_data version]: New constructor.
1129 (Fde::add_mapping): Only add merge mapping if there is an object.
1130 (class Cie): Update declarations.
1131 (class Eh_frame): Declare add_ehframe_for_plt.
1132 * layout.cc (Layout::layout_eh_frame): Break out code into
1133 make_eh_frame_section, and call it.
1134 (Layout::make_eh_frame_section): New function.
1135 (Layout::add_eh_frame_for_plt): New function.
1136 * layout.h (class Layout): Update declarations.
1137 * merge.cc (Merge_map::add_mapping): Add assertion.
1138 * i386.cc: Include "dwarf.h".
1139 (class Output_data_plt_i386): Make first_plt_entry,
1140 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
1141 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1142 and plt_eh_frame_fde.
1143 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
1144 boundary. Call add_eh_frame_for_plt if appropriate.
1145 * x86_64.cc: Include "dwarf.h".
1146 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
1147 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
1148 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1149 and plt_eh_frame_fde.
1150 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
1151 appropriate.
1152
14788a3f
ILT
11532011-06-29 Ian Lance Taylor <iant@google.com>
1154
1155 PR gold/12629
1156 * object.cc (Sized_relobj_file::layout_section): Change shdr
1157 parameter to be const.
1158 (Sized_relobj_file::layout_eh_frame_section): New function, broken
1159 out of do_layout.
1160 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
1161 appropriate. Call layout_eh_frame_section.
1162 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
1163 sections.
1164 * object.h (class Sized_relobj_file): Update declarations.
1165
6c21fce1
ILT
11662011-06-29 Ian Lance Taylor <iant@google.com>
1167
37e41b03 1168 PR gold/12652
6c21fce1
ILT
1169 * script.cc (Token::integer_value): Accept trailing M/m/K/k
1170 modifier.
1171 (Lex::gather_token): Accept trailing M/m/K/k for integers.
1172
4d5e4e62
ILT
11732011-06-29 Ian Lance Taylor <iant@google.com>
1174
1175 PR gold/12675
1176 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
1177 SHT_X86_64_UNWIND.
1178 * layout.cc (Layout::layout_eh_frame): Likewise.
1179
886f533a
ILT
11802011-06-29 Ian Lance Taylor <iant@google.com>
1181
1182 PR gold/12695
1183 * layout.cc (Layout::symtab_section_shndx): New function.
1184 * layout.h (class Layout): Declare symtab_section_shndx.
1185 * output.cc (Output_section::write_header): Call it.
1186
f3ae1b28
ILT
11872011-06-29 Ian Lance Taylor <iant@google.com>
1188
1189 PR gold/12818
1190 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
1191 symbols which are not used in a relocation.
1192
aecf301f
ILT
11932011-06-28 Ian Lance Taylor <iant@google.com>
1194
1195 PR gold/12898
1196 * layout.cc (Layout::segment_precedes): Don't crash if a linker
1197 script create indistinguishable segments.
1198 (Layout::set_segment_offsets): Use stable_sort when sorting
1199 segments. Pass this to Compare_segments constructor.
1200 * layout.h (class Layout): Make segment_precedes non-static.
1201 (class Compare_segments): Change from struct to class. Add
1202 layout_ field. Add constructor.
1203 * script-sections.cc
1204 (Script_sections::attach_sections_using_phdrs_clause): Rename
1205 local orphan to is_orphan. Don't report failure to put empty
1206 section in segment. On attachment failure, report name of
1207 section, and attach to first PT_LOAD segment.
1208
03ef7571
ILT
12092011-06-28 Ian Lance Taylor <iant@google.com>
1210
1211 PR gold/12934
1212 * target-select.cc (Target_selector::Target_selector): Add
1213 emulation parameter. Change all callers.
1214 (select_target_by_bfd_name): Rename from select_target_by_name.
1215 Change all callers.
1216 (select_target_by_emulation): New function.
1217 (supported_emulation_names): New function.
1218 * target-select.h (class Target_selector): Add emulation_ field.
1219 Update declarations.
1220 (Target_selector::recognize_by_bfd_name): Rename from
1221 recognize_by_name. Change all callers.
1222 (Target_selector::supported_bfd_names): Rename from
1223 supported_names. Change all callers.
1224 (Target_selector::recognize_by_emulation): New function.
1225 (Target_selector::supported_emulations): New function.
1226 (Target_selector::emulation): New function.
1227 (Target_selector::do_recognize_by_bfd_name): Rename from
1228 do_recognize_by_name. Change all callers.
1229 (Target_selector::do_supported_bfd_names): Rename from
1230 do_supported_names. Change all callers.
1231 (Target_selector::do_recognize_by_emulation): New function.
1232 (Target_selector::do_supported_emulations): New function.
1233 (select_target_by_bfd_name): Change name in declaration.
1234 (select_target_by_emulation): Declare.
1235 (supported_emulation_names): Declare.
1236 * parameters.cc (parameters_force_valid_target): Try to find
1237 target based on emulation from -m option.
1238 * options.h (class General_options): Change doc string for -m.
1239 * options.cc (help): Print emulations.
1240 (General_options::parse_V): Likewise.
1241 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
1242 Add emulation parameter. Change all callers.
1243
200b2bb9
ILT
12442011-06-28 Ian Lance Taylor <iant@google.com>
1245
1246 * target.h (class Target): Add osabi_ field.
1247 (Target::osabi): New function.
1248 (Target::set_osabi): New function.
1249 (Target::Target): Initialize osabi_.
1250 (Target::do_adjust_elf_header): Make pure virtual.
1251 (Sized_target::do_adjust_elf_header): Declare.
1252 * target.cc (Sized_target::do_adjust_elf_header): New function.
1253 (class Sized_target): Instantiate all versions.
1254 * freebsd.h (class Target_freebsd): Remove.
1255 (Target_selector_freebsd::do_recognize): Call set_osabi on
1256 Target.
1257 (Target_selector_freebsd::do_recognize_by_name): Likewise.
1258 (Target_selector_freebsd::set_osabi): Remove.
1259 * i386.cc (class Target_i386): Inherit from Sized_target rather
1260 than Target_freebsd.
1261 * x86_64.cc (class Target_x86_64): Likewise.
1262
b3ce541e
ILT
12632011-06-28 Ian Lance Taylor <iant@google.com>
1264
1265 * target.h (Target::can_check_for_function_pointers): Rewrite.
1266 Make non-virtual.
1267 (Target::can_icf_inline_merge_sections): Likewise.
1268 (Target::section_may_have_icf_unsafe_poineters): Likewise.
1269 (Target::Target_info): Add can_icf_inline_merge_sections field.
1270 (Target::do_can_check_for_function_pointers): New virtual
1271 function.
1272 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
1273 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
1274 from can_check_for_function_pointers, move in file.
1275 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
1276 section_may_have_icf_unsafe_poineters, move in file.
1277 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
1278 * i386.cc (Target_i386::do_can_check_for_function_pointers):
1279 Rename from can_check_for_function_pointers, move in file.
1280 (Target_i386::can_icf_inline_merge_sections): Remove.
1281 (Target_i386::i386_info): Initialize
1282 can_icf_inline_merge_sections.
1283 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
1284 Initialize can_icf_inline_merge_sections.
1285 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
1286 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
1287 Rename from can_check_for_function_pointers, move in file.
1288 (Target_x86_64::can_icf_inline_merge_sections): Remove.
1289 (Target_x86_64::x86_64_info): Initialize
1290 can_icf_inline_merge_sections.
1291 * testsuite/testfile.cc (Target_test::test_target_info):
1292 Likewise.
1293 * icf.cc (get_section_contents): Correct formatting.
1294
6d1c4efb
ILT
12952011-06-27 Ian Lance Taylor <iant@google.com>
1296
1297 * symtab.cc (Symbol::versioned_name): New function.
1298 (Symbol_table::add_to_final_symtab): Use versioned_name when
1299 appropriate.
1300 (Symbol_table::sized_write_symbol): Likewise.
1301 * symtab.h (class Symbol): Declare versioned_name.
1302 * stringpool.h (class Stringpool_template): Add variant of add
1303 which takes a std::basic_string.
1304 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
1305 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
1306 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
1307 (ver_test_12.o): New target.
1308 * testsuite/Makefile.in: Rebuild.
1309
57eb9b50
DK
13102011-06-27 Doug Kwan <dougkwan@google.com>
1311
1312 * arm.cc (Arm_relocate_functions::thm_jump8,
1313 Arm_relocate_functions::thm_jump11): Use a wider signed
1314 type to compute offset.
1315 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
1316 arm_thm_jump8.
1317 * testsuite/Makefile.in: Regenerate.
1318 * testsuite/arm_branch_in_range.sh: Check test results of
1319 arm_thm_jump11 and arm_thm_jump8.
1320 * testsuite/arm_thm_jump11.s: New test source file.
1321 * testsuite/arm_thm_jump11.t: New linker script.
1322 * testsuite/arm_thm_jump8.s: New test source file.
1323 * testsuite/arm_thm_jump8.t: New linker script.
1324
487b39df
ILT
13252011-06-24 Ian Lance Taylor <iant@google.com>
1326
1327 * layout.cc: Include "object.h".
1328 (ctors_sections_in_init_array): New static variable.
1329 (Layout::is_ctors_in_init_array): New function.
1330 (Layout::layout): Add entry to ctors_sections_in_init_array if
1331 appropriate.
1332 * layout.h (class Layout): Declare is_ctors_in_init_array.
1333 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
1334 is_ctors_reverse_view is set.
1335 (Sized_relobj_file::write_sections): Add layout parameter. Change
1336 all callers. Set is_ctors_reverse_view field of View_size.
1337 (Sized_relobj_file::reverse_words): New function.
1338 * object.h (Sized_relobj_file::View_size): Add
1339 is_ctors_reverse_view field.
1340 (class Sized_relobj_file): Update declarations.
1341 * testsuite/initpri3.c: New test.
1342 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
1343 initpri3b.
1344 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
1345 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
1346 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
1347 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
1348 * testsuite/Makefile.in: Rebuild.
1349
472076e4
CC
13502011-06-24 Cary Coutant <ccoutant@google.com>
1351
1352 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
1353 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
1354 (debug_msg_cdebug.err): New targets.
1355 * testsuite/Makefile.in: Regenerate.
1356 * testsuite/debug_msg.sh: Check output of link with compressed debug.
1357 Fix checks for link with shared library.
1358
a60af0db
DK
13592011-06-24 Doug Kwan <dougkwan@google.com>
1360
1361 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
1362 skip empty text sections.
1363 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
1364
5393d741
ILT
13652011-06-22 Ian Lance Taylor <iant@google.com>
1366
1367 PR gold/12910
1368 * options.h (class General_options): Add --ctors-in-init-array.
1369 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
1370 friends as SHT_PROGBITS for merging sections.
1371 (Layout::layout): Remove special handling of .init_array and
1372 friends. Don't sort if doing relocatable link. Sort for .ctors
1373 and .dtors if ctors_in_init_array.
1374 (Layout::make_output_section): Force correct section types for
1375 .init_array and friends. Don't sort if doing relocatable link,
1376 Don't sort .ctors and .dtors if ctors_in_init_array.
1377 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
1378 (Layout::output_section_name): Add relobj parameter. Change all
1379 callers. Handle .ctors. and .dtors. in code rather than table.
1380 Handle .ctors and .dtors if ctors_in_init_array.
1381 (Layout::match_file_name): New function, moved from output.cc.
1382 * layout.h (class Layout): Update declarations.
1383 * output.cc: Include "layout.h".
1384 (Input_section_sort_entry::get_priority): New function.
1385 (Input_section_sort_entry::match_file_name): Just call
1386 Layout::match_file_name.
1387 (Output_section::Input_section_sort_init_fini_compare::operator()):
1388 Handle .ctors and .dtors. Sort by explicit priority rather than
1389 by name.
1390 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
1391 * testsuite/initpri2.c: New test.
1392 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
1393 (check_PROGRAMS): Add initpri2.
1394 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
1395 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
1396 * configure, testsuite/Makefile.in: Rebuild.
1397
e1f74f98
ILT
13982011-06-19 Ian Lance Taylor <iant@google.com>
1399
1400 PR gold/12880
1401 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
1402 .interp section to a PT_INTERP segment even if we have seen a
1403 --dynamic-linker option. Don't do it if we have seen a PHDRS
1404 clause in a linker script.
1405 (Layout::finalize): Don't create a .interp section if we've
1406 already create a PT_INTERP segment.
1407 (Layout::create_interp): Always call choose_output_section (revert
1408 patch of 2011-06-17). Don't create PT_INTERP segment.
1409 * script-sections.cc
1410 (Script_sections::create_note_and_tls_segments): Add a .interp
1411 section to a PT_INTERP segment even if we have seen a
1412 --dynamic-linker option.
1413
766f91bb
ILT
14142011-06-18 Ian Lance Taylor <iant@google.com>
1415
1416 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
1417 merely because a non-PT_LOAD segment has a dynamic reloc.
1418
0d212c3a
ILT
14192011-06-18 Ian Lance Taylor <iant@google.com>
1420
1421 * layout.cc (Layout::finish_dynamic_section): Don't create
1422 DT_FLAGS entry if not needed.
1423
911a5072
ILT
14242011-06-18 Ian Lance Taylor <iant@google.com>
1425
1426 PR gold/12745
1427 * layout.cc (Layout::layout_eh_frame): Correct handling of
1428 writable .eh_frame section.
1429
534b4e5f
ILT
14302011-06-17 Ian Lance Taylor <iant@google.com>
1431
1432 PR gold/12893
1433 * resolve.cc (Symbol_table::resolve): Don't give an error if a
1434 symbol is redefined with the exact same object and value.
1435
10b4f102
ILT
14362011-06-17 Ian Lance Taylor <iant@google.com>
1437
1438 PR gold/12880
1439 * layout.h (class Layout): Add interp_segment_ field.
1440 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
1441 (Layout::attach_allocated_section_to_segment): If making shared
1442 library, put .interp section in PT_INTERP segment.
1443 (Layout::finalize): Also call create_interp if -dynamic-linker
1444 option was used.
1445 (Layout::create_interp): Assert that there is no PT_INTERP
1446 segment. If not using a SECTIONS clause, use make_output_section.
1447 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
1448 * script-sections.cc
1449 (Script_sections::create_note_and_tls_segments): If making shared
1450 library, put .interp section in PT_INTERP segment.
1451
a29b0dad
ILT
14522011-06-17 Ian Lance Taylor <iant@google.com>
1453
e588ea8d
ILT
1454 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
1455 when making a shared library.
1456
14572011-06-17 Ian Lance Taylor <iant@google.com>
1458
1459 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
1460 parameter. Change all callers. Don't issue warning about PC32
1461 against locally defined symbol.
a29b0dad 1462
9d3b0698
ILT
14632011-06-16 Ian Lance Taylor <iant@google.com>
1464
1465 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
1466 occurs in same object.
1467
85b0f90c
AM
14682011-06-14 Alan Modra <amodra@gmail.com>
1469
1470 * po/POTFILES.in: Regenerate.
1471
a94907d9
ILT
14722011-06-09 Ian Lance Taylor <iant@google.com>
1473
1474 * script-sections.cc
1475 (Orphan_output_section::set_section_addresses): For a relocatable
1476 link set address to 0.
1477
4fb3a1c3
CC
14782011-06-09 Cary Coutant <ccoutant@google.com>
1479
1480 PR gold/12804
1481 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
1482 used with --compress-debug-sections.
1483 * gold/object.cc (Sized_relobj_file::do_layout): Report
1484 uncompressed size of compressed input sections.
1485
61220854
CC
14862011-06-08 Cary Coutant <ccoutant@google.com>
1487
1488 PR gold/12804
1489 * testsuite/two_file_test_2_v1.cc: Change initialization of
1490 v2 to keep it in .data.
1491
e6455dfb
CC
14922011-06-07 Cary Coutant <ccoutant@google.com>
1493
1494 * common.cc (Symbol_table::do_allocate_commons_list): Call
1495 gold_fallback.
1496 * errors.cc (Errors::fatal): Adjust call to gold_exit.
1497 (Errors::fallback): New function.
1498 (gold_fallback): New function.
1499 * errors.h (Errors::fallback): New function.
1500 * gold.cc (gold_exit): Change status parameter to enum; adjust
1501 all callers.
1502 (queue_initial_tasks): Call gold_fallback.
1503 * gold.h: Include cstdlib.
1504 (Exit_status): New enum type.
1505 (gold_exit): Change status parameter to enum.
1506 (gold_fallback): New function.
1507 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
1508 (Layout::create_symtab_sections): Likewise.
1509 (Layout::create_shdrs): Likewise.
1510 * main.cc (main): Adjust call to gold_exit.
1511 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
1512 (Output_data_got::add_got_entry_pair): Likewise.
1513 (Output_section::add_input_section): Likewise.
1514 (Output_section::add_output_section_data): Likewise.
1515 (Output_segment::set_section_list_addresses): Likewise.
1516 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
1517
fb0e076f
CC
15182011-06-07 Cary Coutant <ccoutant@google.com>
1519
1520 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
1521 for incremental links.
1522 * output.cc (Output_segment::set_section_list_addresses): Remove
1523 FIXME and test for TLS or BSS.
1524
a5ee4d5d
CC
15252011-06-07 Cary Coutant <ccoutant@google.com>
1526
1527 * testsuite/Makefile.am: Add incremental_copy_test,
1528 incremental_common_test_1.
1529 * testsuite/Makefile.in: Regenerate.
1530 * testsuite/common_test_1_v1.c: New source file.
1531 * testsuite/common_test_1_v2.c: New source file.
1532 * testsuite/copy_test_v1.cc: New source file.
1533
5146f448
CC
15342011-06-07 Cary Coutant <ccoutant@google.com>
1535
1536 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
1537 update, allocate common from bss section's free list.
1538 * incremental-dump.cc (dump_incremental_inputs): Print flag for
1539 linker-defined symbols.
1540 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
1541 Skip GOT and PLT entries that are no longer referenced.
1542 (Output_section_incremental_inputs::write_info_blocks): Mark
1543 linker-defined symbols.
1544 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
1545 * output.cc (Output_section::allocate): New function.
1546 * output.h (Output_section::allocate): New function.
1547 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
1548 linker-defined symbols.
1549 (Symbol::override_base_with_special): Copy is_predefined_ flag.
1550 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
1551 (Symbol::init_base_output_data): Likewise.
1552 (Symbol::init_base_output_segment): Likewise.
1553 (Symbol::init_base_constant): Likewise.
1554 (Sized_symbol::init_output_data): Likewise.
1555 (Sized_symbol::init_output_segment): Likewise.
1556 (Sized_symbol::init_constant): Likewise.
1557 (Symbol_table::do_define_in_output_data): Likewise.
1558 (Symbol_table::do_define_in_output_segment): Likewise.
1559 (Symbol_table::do_define_as_constant): Likewise.
1560 * symtab.h (Symbol::is_predefined): New function.
1561 (Symbol::init_base_output_data): Add is_predefined parameter.
1562 (Symbol::init_base_output_segment): Likewise.
1563 (Symbol::init_base_constant): Likewise.
1564 (Symbol::is_predefined_): New data member.
1565 (Sized_symbol::init_output_data): Add is_predefined parameter.
1566 (Sized_symbol::init_output_segment): Likewise.
1567 (Sized_symbol::init_constant): Likewise.
1568 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
1569
26d3c67d
CC
15702011-06-07 Cary Coutant <ccoutant@google.com>
1571
1572 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
1573 instead of emit_copy_reloc.
1574 (Copy_relocs::emit_copy_reloc): Refactor.
1575 (Copy_relocs::make_copy_reloc): New function.
1576 (Copy_relocs::add_copy_reloc): Remove.
1577 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
1578 section.
1579 (Copy_relocs::make_copy_reloc): New function.
1580 (Copy_relocs::add_copy_reloc): Remove.
1581 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
1582 unchanged input files.
1583 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
1584 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
1585 Reserve BSS space for COPY relocations.
1586 (Sized_incremental_binary::do_emit_copy_relocs): New function.
1587 (Output_section_incremental_inputs::write_info_blocks): Record
1588 whether a symbol is copied from a shared object.
1589 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
1590 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
1591 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
1592 (Incremental_input_entry_reader::get_output_symbol_index): Add
1593 is_copy parameter.
1594 (Incremental_binary::emit_copy_relocs): New function.
1595 (Incremental_binary::do_emit_copy_relocs): New function.
1596 (Sized_incremental_binary::Sized_incremental_binary): Initialize
1597 new data member.
1598 (Sized_incremental_binary::add_copy_reloc): New function.
1599 (Sized_incremental_binary::do_emit_copy_relocs): New function.
1600 (Sized_incremental_binary::Copy_reloc): New struct.
1601 (Sized_incremental_binary::Copy_relocs): New typedef.
1602 (Sized_incremental_binary::copy_relocs_): New data member.
1603 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
1604 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
1605 * target.h (Sized_target::emit_copy_reloc): New function.
1606 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
1607
7cdb37d9
CC
16082011-06-02 Cary Coutant <ccoutant@google.com>
1609
1610 PR gold/12163
1611 * gold/archive.cc (Archive::Archive): Initialize new data member.
1612 (Archive::include_all_members): Return if archive has already been
1613 included.
1614 * gold/archive.h (Archive::include_all_members_): New data member.
1615
cc643b88
NC
16162011-06-02 Nick Clifton <nickc@redhat.com>
1617
1618 * dynobj.h: Fix spelling mistake in comment.
1619 * output.cc: Likewise.
1620
f62a3ca7
DK
16212011-05-31 Doug Kwan <dougkwan@google.com>
1622 Asier Llano
1623
1624 PR gold/12826
cc643b88 1625 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
1626 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
1627 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
1628 redundant arm_exidx_test.so.
1629 * testsuite/Makefile.in: Regenerate.
1630 (check_SCRIPTS): Add pr12826.sh
1631 (check_DATA): Add pr12826.stdout
1632 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
1633 * testsuite/pr12826.sh: New file.
1634 * testsuite/pr12826_1.s: Ditto.
1635 * testsuite/pr12826_1.s: Ditto.
1636
8dbe1edc
ILT
16372011-05-30 Ian Lance Taylor <iant@google.com>
1638
1639 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
1640 sections.
1641
c49875be
ILT
16422011-05-29 Ian Lance Taylor <iant@google.com>
1643
1644 PR gold/12804
1645 * testsuite/Makefile.am: Use different file name for two_file_test
1646 temporary file for each incremental test.
1647 * testsuite/Makefile.in: Rebuild.
1648
69d53f7a
ILT
16492011-05-29 Ian Lance Taylor <iant@google.com>
1650
1651 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
1652 binary input file is empty.
1653
41d0ab5f
ILT
16542011-05-27 Ian Lance Taylor <iant@google.com>
1655
1656 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
1657 (ver_test_9.so): Likewise.
1658 * testsuite/Makefile.in: Rebuild.
1659
89d8a36b
CC
16602011-05-26 Cary Coutant <ccoutant@google.com>
1661
1662 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
1663 * incremental.cc (Incremental_inputs::report_input_section): Fix
1664 comment, indentation.
1665 (Incremental_inputs::report_comdat_group): New function.
1666 (Output_section_incremental_inputs::set_final_data_size): Adjust size
1667 of data for incremental input file entry.
1668 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
1669 group count, COMDAT group signatures.
1670 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
1671 an unchanged input file.
1672 * incremental.h (Incremental_object_entry::Incremental_object_entry):
1673 Initialize new data member.
1674 (Incremental_object_entry::add_comdat_group): New function.
1675 (Incremental_object_entry::get_comdat_group_count): New function.
1676 (Incremental_object_entry::get_comdat_signature_key): New function.
1677 (Incremental_object_entry::groups_): New data member.
1678 (Incremental_inputs::report_comdat_group): New function.
1679 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
1680 data for incremental input file entry.
1681 (Incremental_input_entry_reader::get_comdat_group_count): New function.
1682 (Incremental_input_entry_reader::get_input_section): Adjust size of
1683 data for incremental input file entry.
1684 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
1685 (Incremental_input_entry_reader::get_comdat_group_signature): New
1686 function.
1687 * object.cc (Sized_relobj::include_section_group): Report kept
1688 COMDAT groups for incremental links.
1689
1706a06f
ILT
16902011-05-24 David Meyer <pdox@google.com>
1691
1692 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
1693 with name parameter. Add found_name parameter.
1694 * fileread.cc (Input_file::find_file): Adjust code accordingly.
1695 * dirsearch.h (class Dirsearch): Update declaration.
1696
a10ae760
ILT
16972011-05-24 Ian Lance Taylor <iant@google.com>
1698
1699 * archive.cc (Library_base::should_include_member): Pull in object
1700 from archive if it defines the entry symbol.
1701 * parameters.cc (Parameters::entry): New function.
1702 * parameters.h (class Parameters): Declare entry.
1703 * output.h (class Output_file_header): Remove entry_ field.
1704 * output.cc (Output_file_header::Output_file_header): Remove entry
1705 parameter. Change all callers.
1706 (Output_file_header::entry): Use parameters->entry.
1707 * gold.cc (queue_middle_tasks): Likewise.
1708 * plugin.cc (Plugin_hook::run): Likewise.
1709
aa92d6ed
CC
17102011-05-24 Cary Coutant <ccoutant@google.com>
1711
1712 * gold.cc (queue_initial_tasks): Pass incremental base filename
1713 to Output_file::open_base_file; don't print error message.
1714 * incremental-dump.cc (main): Adjust call to
1715 Output_file::open_for_modification.
1716 * incremental-dump.cc (main): Likewise.
1717 * incremental.cc (Incremental_inputs::report_command_line):
1718 Ignore --incremental-base option when comparing command lines.
1719 Ignore parameter when given as separate argument.
1720 * options.h (class General_options): Add --incremental-base.
1721 * output.cc (Output_file::Output_file):
1722 (Output_file::open_base_file): Add base_name and writable parameters;
1723 read base file into new file; print error message here.
1724 (Output_file::map_no_anonymous): Add writable parameter; adjust all
1725 callers.
1726 * output.h (Output_file::open_for_modification): Rename to...
1727 (Output_file::open_base_file): ...this; add base_name and
1728 writable parameters; adjust all callers.
1729 (Output_file::map_no_anonymous): Add writable parameter; adjust all
1730 callers.
1731 * testsuite/Makefile.am (incremental_test_4): Test
1732 --incremental-base.
1733 * testsuite/Makefile.in: Regenerate.
1734
2eedd706
CC
17352011-05-24 Cary Coutant <ccoutant@google.com>
1736
1737 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
1738 incremental_test_4.
1739 * testsuite/Makefile.in: Regenerate.
1740 * testsuite/two_file_test_1_v1.cc: New test source file.
1741 * testsuite/two_file_test_1b_v1.cc: New test source file.
1742 * testsuite/two_file_test_2_v1.cc: New test source file.
1743
0f1c85a6
CC
17442011-05-24 Cary Coutant <ccoutant@google.com>
1745
1746 * dynobj.h (Dynobj::do_dynobj): New function.
1747 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
1748 flag and soname for shared objects.
1749 * incremental.cc (Incremental_inputs::report_object): Make
1750 either Incremental_object_entry or Incremental_dynobj_entry; add
1751 soname to string table.
1752 (Incremental_inputs::report_input_section): Add assertion.
1753 (Output_section_incremental_inputs::set_final_data_size): Adjust
1754 type of input file entry for shared libraries; adjust size of
1755 shared library info entry.
1756 (Output_section_incremental_inputs::write_input_files): Write
1757 as_needed flag for shared libraries.
1758 (Output_section_incremental_inputs::write_info_blocks): Adjust type
1759 of input file entry for shared libraries; write soname.
1760 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
1761 soname from incremental info.
1762 * incremental.h (enum Incremental_input_flags): Add
1763 INCREMENTAL_INPUT_AS_NEEDED.
1764 (Incremental_input_entry::Incremental_input_entry): Initialize new
1765 data member.
1766 (Incremental_input_entry::set_as_needed): New function.
1767 (Incremental_input_entry::as_needed): New function.
1768 (Incremental_input_entry::do_dynobj_entry): New function.
1769 (Incremental_input_entry::as_needed_): New data member.
1770 (Incremental_object_entry::Incremental_object_entry): Don't check
1771 for shared library.
1772 (Incremental_object_entry::do_type): Likewise.
1773 (class Incremental_dynobj_entry): New class.
1774 (Incremental_input_entry_reader::as_needed): New function.
1775 (Incremental_input_entry_reader::get_soname): New function.
1776 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
1777 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
1778 size of shared library info entry.
1779 * layout.cc (Layout::finish_dynamic_section): Don't test for
1780 incremental link when adding DT_NEEDED entries.
1781 * object.h (Object::Object): Initialize new data member.
1782 (Object::dynobj): New function.
1783 (Object::set_as_needed): New function.
1784 (Object::as_needed): New function.
1785 (Object::do_dynobj): New function.
1786 (Object::as_needed_): New data member.
1787
6fa2a40b
CC
17882011-05-24 Cary Coutant <ccoutant@google.com>
1789
1790 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
1791 info; adjust display of GOT entries.
1792 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
1793 vector of input objects; remove file_status_.
1794 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
1795 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
1796 got_plt reader; call target hooks to reserve GOT entries.
1797 (Output_section_incremental_inputs::set_final_data_size): Adjust size
1798 of input file info header and GOT info entry.
1799 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
1800 relocation info.
1801 (Got_plt_view_info::got_descriptor): Remove.
1802 (Got_plt_view_info::sym_index): New data member.
1803 (Got_plt_view_info::input_index): New data member.
1804 (Local_got_offset_visitor::visit): Write input file index.
1805 (Global_got_offset_visitor::visit): Write 0 for input file index.
1806 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
1807 with sym_index and input_index.
1808 (Output_section_incremental_inputs::write_got_plt): Adjust size of
1809 incremental info GOT entry; replace got_descriptor with input_index.
1810 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
1811 map from input file index to object.
1812 (Sized_relobj_incr::do_layout): Replace direct data member reference
1813 with accessor function.
1814 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
1815 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
1816 Adjust size of input file info header.
1817 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
1818 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
1819 (Incremental_input_entry_reader::get_input_section): Adjust size of
1820 input file info header.
1821 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
1822 of incremental info GOT entry.
1823 (Incremental_got_plt_reader::get_got_desc): Remove.
1824 (Incremental_got_plt_reader::get_got_symndx): New function.
1825 (Incremental_got_plt_reader::get_got_input_index): New function.
1826 (Sized_incremental_binary::Sized_incremental_binary): Remove
1827 file_status_; add input_objects_.
1828 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
1829 (Sized_incremental_binary::set_file_is_unchanged): Remove.
1830 (Sized_incremental_binary::file_is_unchanged): Remove.
1831 (Sized_incremental_binary::set_input_object): New function.
1832 (Sized_incremental_binary::input_object): New function.
1833 (Sized_incremental_binary::file_status_): Remove.
1834 (Sized_incremental_binary::input_objects_): New data member.
1835 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
1836 references.
1837 (Sized_relobj_incr::invalid_address): Move to base class.
1838 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
1839 class.
1840 (Sized_relobj_incr::do_output_section_offset): Likewise.
1841 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
1842 (Sized_relobj_incr::section_offsets_): Likewise.
1843 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
1844 function.
1845 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
1846 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
1847 with accessor function.
1848 (Sized_relobj_file::do_layout): Likewise.
1849 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
1850 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
1851 (Sized_relobj_file::compute_final_local_value): Replace refs to
1852 section_offsets_ with accessor function.
1853 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
1854 * object.h (Relobj::Relobj): Initialize new data members.
1855 (Relobj::add_dyn_reloc): New function.
1856 (Relobj::first_dyn_reloc): New function.
1857 (Relobj::dyn_reloc_count): New function.
1858 (Relobj::first_dyn_reloc_): New data member.
1859 (Relobj::dyn_reloc_count_): New data member.
1860 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
1861 references.
1862 (Sized_relobj::Address): New typedef.
1863 (Sized_relobj::invalid_address): Move here from child class.
1864 (Sized_relobj::Sized_relobj): Initialize new data members.
1865 (Sized_relobj::sized_relobj): New function.
1866 (Sized_relobj::is_output_section_offset_invalid): Move here from
1867 child class.
1868 (Sized_relobj::get_output_section_offset): Likewise.
1869 (Sized_relobj::local_has_got_offset): Likewise.
1870 (Sized_relobj::local_got_offset): Likewise.
1871 (Sized_relobj::set_local_got_offset): Likewise.
1872 (Sized_relobj::do_for_all_local_got_entries): Likewise.
1873 (Sized_relobj::clear_got_offsets): New function.
1874 (Sized_relobj::section_offsets): Move here from child class.
1875 (Sized_relobj::do_output_section_offset): Likewise.
1876 (Sized_relobj::do_set_section_offset): Likewise.
1877 (Sized_relobj::Local_got_offsets): Likewise.
1878 (Sized_relobj::local_got_offsets_): Likewise.
1879 (Sized_relobj::section_offsets_): Likewise.
1880 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
1881 references.
1882 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
1883 class.
1884 (Sized_relobj_file::sized_relobj): New function
1885 (Sized_relobj_file::local_has_got_offset): Move to base class.
1886 (Sized_relobj_file::local_got_offset): Likewise.
1887 (Sized_relobj_file::set_local_got_offset): Likewise.
1888 (Sized_relobj_file::get_output_section_offset): Likewise.
1889 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
1890 (Sized_relobj_file::do_output_section_offset): Likewise.
1891 (Sized_relobj_file::do_set_section_offset): Likewise.
1892 (Sized_relobj_file::Local_got_offsets): Likewise.
1893 (Sized_relobj_file::local_got_offsets_): Likewise.
1894 (Sized_relobj_file::section_offsets_): Likewise.
1895 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
1896 (all constructors).
1897 (set_needs_dynsym_index): Convert relobj to derived class pointer.
1898 (Output_reloc::get_symbol_index): Likewise.
1899 (Output_reloc::local_section_offset): Likewise.
1900 (Output_reloc::get_address): Likewise.
1901 (Output_reloc::symbol_value): Likewise.
1902 (Output_data_got::reserve_slot): Move to class definition.
1903 (Output_data_got::reserve_local): New function.
1904 (Output_data_got::reserve_slot_for_global): Remove.
1905 (Output_data_got::reserve_global): New function.
1906 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
1907 (all constructors, two instantiations).
1908 (Output_reloc::get_relobj): New function (two instantiations).
1909 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
1910 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
1911 (Output_data_reloc::add_global): Adjust type of relobj.
1912 (Output_data_reloc::add_global_relative): Likewise.
1913 (Output_data_reloc::add_symbolless_global_addend): Likewise.
1914 (Output_data_reloc::add_local): Likewise.
1915 (Output_data_reloc::add_local_relative): Likewise.
1916 (Output_data_reloc::add_symbolless_local_addend): Likewise.
1917 (Output_data_reloc::add_local_section): Likewise.
1918 (Output_data_reloc::add_output_section): Likewise.
1919 (Output_data_reloc::add_absolute): Likewise.
1920 (Output_data_reloc::add_target_specific): Likewise.
1921 (Output_data_got::reserve_slot): Move definition here.
1922 (Output_data_got::reserve_local): New function.
1923 (Output_data_got::reserve_global): New function.
1924 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
1925 section_offsets_ with accessor function.
1926 (Sized_relobj_file::write_sections): Likewise.
1927 (Sized_relobj_file::do_relocate_sections): Likewise.
1928 * target.h (Sized_target::reserve_local_got_entry): New function.
1929 (Sized_target::reserve_global_got_entry): New function.
1930 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
1931 (Target_x86_64::reserve_global_got_entry): New function.
1932 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
1933
4829d394
CC
19342011-05-23 Cary Coutant <ccoutant@google.com>
1935
1936 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
1937 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
1938 bit when checking got_type.
1939 * incremental.cc (Sized_incremental_binary::setup_readers):
1940 Store symbol table and string table locations; initialize bit vector
1941 of file status flags.
1942 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
1943 unchanged files.
1944 (Sized_incremental_binary::do_process_got_plt): New function.
1945 (Sized_incremental_binary::get_symtab_view): Use stored locations.
1946 (Output_section_incremental_inputs::set_final_data_size): Record
1947 file index for each input file.
1948 (Output_section_incremental_inputs::write_got_plt): Store file index
1949 instead of input entry offset for each GOT entry.
1950 * incremental.h
1951 (Incremental_input_entry::Incremental_input_entry): Initialize new
1952 data member.
1953 (Incremental_input_entry::set_offset): Store file index.
1954 (Incremental_input_entry::get_file_index): New function.
1955 (Incremental_input_entry::file_index_): New data member.
1956 (Incremental_binary::process_got_plt): New function.
1957 (Incremental_binary::do_process_got_plt): New function.
1958 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
1959 data members.
1960 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
1961 (Sized_incremental_binary::set_file_is_unchanged): New function.
1962 (Sized_incremental_binary::file_is_unchanged): New function.
1963 (Sized_incremental_binary::do_process_got_plt): New function.
1964 (Sized_incremental_binary::file_status_): New data member.
1965 (Sized_incremental_binary::main_symtab_loc_): New data member.
1966 (Sized_incremental_binary::main_strtab_loc_): New data member.
1967 * output.cc (Output_data_got::Got_entry::write): Add case
1968 RESERVED_CODE.
1969 (Output_data_got::add_global): Call add_got_entry.
1970 (Output_data_got::add_global_plt): Likewise.
1971 (Output_data_got::add_global_with_rel): Likewise.
1972 (Output_data_got::add_global_with_rela): Likewise.
1973 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
1974 (Output_data_got::add_global_pair_with_rela): Likewise.
1975 (Output_data_got::add_local): Call add_got_entry.
1976 (Output_data_got::add_local_plt): Likewise.
1977 (Output_data_got::add_local_with_rel): Likewise.
1978 (Output_data_got::add_local_with_rela): Likewise.
1979 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
1980 (Output_data_got::add_local_pair_with_rela): Likewise.
1981 (Output_data_got::reserve_slot): New function.
1982 (Output_data_got::reserve_slot_for_global): New function.
1983 (Output_data_got::add_got_entry): New function.
1984 (Output_data_got::add_got_entry_pair): New function.
1985 (Output_section::add_output_section_data): Edit FIXME.
1986 * output.h
1987 (Output_section_data_build::Output_section_data_build): New
1988 constructor with size parameter.
1989 (Output_data_space::Output_data_space): Likewise.
1990 (Output_data_got::Output_data_got): Initialize new data member; new
1991 constructor with size parameter.
1992 (Output_data_got::add_constant): Call add_got_entry.
1993 (Output_data_got::reserve_slot): New function.
1994 (Output_data_got::reserve_slot_for_global): New function.
1995 (class Output_data_got::Got_entry): Add RESERVED_CODE.
1996 (Output_data_got::add_got_entry): New function.
1997 (Output_data_got::add_got_entry_pair): New function.
1998 (Output_data_got::free_list_): New data member.
1999 * target.h (Sized_target::init_got_plt_for_update): New function.
2000 (Sized_target::register_global_plt_entry): New function.
2001 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
2002 Initialize new data member; call init; add constructor with PLT count.
2003 (Output_data_plt_x86_64::init): New function.
2004 (Output_data_plt_x86_64::add_relocation): New function.
2005 (Output_data_plt_x86_64::reserve_slot): New function.
2006 (Output_data_plt_x86_64::free_list_): New data member.
2007 (Target_x86_64::init_got_plt_for_update): New function.
2008 (Target_x86_64::register_global_plt_entry): New function.
2009 (Output_data_plt_x86_64::add_entry): Allocate from free list for
2010 incremental updates.
2011 (Output_data_plt_x86_64::add_relocation): New function.
2012 * testsuite/object_unittest.cc (Object_test): Set default options.
2013
ec69d6da
ILT
20142011-05-16 Ian Lance Taylor <iant@google.com>
2015
2016 * options.h (class General_options): Make -i a synonym for -r.
2017
732e31de
ILT
20182011-05-16 Ian Lance Taylor <iant@google.com>
2019
2020 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
2021
403676b5
CC
20222011-05-10 Cary Coutant <ccoutant@google.com>
2023
2024 * object.cc (Sized_relobj::do_count_local_symbols): Check for
2025 strip_all (-s).
2026
5b7b7d6e
ILT
20272011-05-06 Ian Lance Taylor <iant@google.com>
2028
2029 * layout.cc (Layout::layout): If the output section flags change,
2030 update the ordering.
2031
f0f9babf
CC
20322011-04-25 Cary Coutant <ccoutant@google.com>
2033
2034 * incremental-dump.cc (dump_incremental_inputs): Print local
2035 symbol info for each input file.
2036 * incremental.cc
2037 (Output_section_incremental_inputs::set_final_data_size): Add local
2038 symbol info to input file entries in incremental info.
2039 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2040 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
2041 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
2042 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
2043 implementation.
2044 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
2045 (Sized_incr_relobj::do_relocate): Write the local symbols.
2046 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
2047 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
2048 Adjust size of input file header.
2049 (Incremental_inputs_reader::get_local_symbol_offset): New function.
2050 (Incremental_inputs_reader::get_local_symbol_count): New function.
2051 (Incremental_inputs_reader::get_input_section): Adjust size of input
2052 file header.
2053 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
2054 (Sized_incr_relobj::This): New typedef.
2055 (Sized_incr_relobj::sym_size): New const data member.
2056 (Sized_incr_relobj::Local_symbol): New struct.
2057 (Sized_incr_relobj::do_output_local_symbol_count): New function.
2058 (Sized_incr_relobj::do_local_symbol_offset): New function.
2059 (Sized_incr_relobj::local_symbol_count_): New data member.
2060 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
2061 (Sized_incr_relobj::local_symbol_index_): New data member.
2062 (Sized_incr_relobj::local_symbol_offset_): New data member.
2063 (Sized_incr_relobj::local_dynsym_offset_): New data member.
2064 (Sized_incr_relobj::local_symbols_): New data member.
2065 * object.h (Relobj::output_local_symbol_count): New function.
2066 (Relobj::local_symbol_offset): New function.
2067 (Relobj::do_output_local_symbol_count): New function.
2068 (Relobj::do_local_symbol_offset): New function.
2069 (Sized_relobj::do_output_local_symbol_count): New function.
2070 (Sized_relobj::do_local_symbol_offset): New function.
2071
d0a9ace3
ILT
20722011-04-22 Vladimir Simonov <sv@sw.ru>
2073
2074 * descriptors.cc (set_close_on_exec): New function.
2075 (Descriptors::open): Use set_close_on_exec.
2076 * output.cc (S_ISLNK): Define if not defined.
2077
94a3fc8b
CC
20782011-04-22 Cary Coutant <ccoutant@google.com>
2079
2080 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2081 global symbol map.
2082 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2083 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
2084 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
2085 relocations.
2086 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
2087 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
2088 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
2089 * incremental.h
2090 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
2091 function.
2092 (Incremental_binary::apply_incremental_relocs): New function.
2093 (Incremental_binary::do_apply_incremental_relocs): New function.
2094 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2095 data member.
2096 (Sized_incremental_binary::add_global_symbol): New function.
2097 (Sized_incremental_binary::global_symbol): New function.
2098 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2099 (Sized_incremental_binary::symbol_map_): New data member.
2100 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
2101 * target.h (Sized_target::apply_relocation): New function.
2102 * target-reloc.h (apply_relocation): New function.
2103 * x86_64.cc (Target_x86_64::apply_relocation): New function.
2104
c87e4302
DK
21052011-04-22 Doug Kwan <dougkwan@google.com>
2106
2107 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
2108 flag of a SHT_ARM_EXIDX section.
2109 * testsuite/Makefile.am (arm_exidx_test): New test rules.
2110 * testsuite/Makefile.in: Regenerate.
2111 * testsuite/arm_exidx_test.s: New file.
2112 * testsuite/arm_exidx_test.sh: Same.
2113
e7782cf6
CC
21142011-04-20 Cary Coutant <ccoutant@google.com>
2115
2116 PR gold/12689
2117 * archive.h (Incremental_archive_entry::Archive_member):
2118 Initialize arg_serial_ (second constructor).
2119
308ecdc7
ILT
21202011-04-17 Ian Lance Taylor <iant@google.com>
2121
2122 * object.cc (Relocate_info::location): Simplify location string.
2123 * errors.cc (Errors::error_at_location): Don't print program
2124 name.
2125 (Errors::warning_at_location): Likewise.
2126 (Errors::undefined_symbol): Likewise.
2127 * testsuite/debug_msg.sh: Update accordingly.
2128
bec5b579
CC
21292011-04-14 Cary Coutant <ccoutant@google.com>
2130
2131 * gold/layout.cc (Layout::symtab_section_offset): New function.
2132 * gold/layout.h (Layout::symtab_section_offset): New function.
2133 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
2134
88597d34
ILT
21352011-04-12 Ian Lance Taylor <iant@google.com>
2136
2137 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
2138 with MREMAP_MAYMOVE.
2139 * output.h (class Output_file): Add map_is_allocated_ field.
2140 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
2141 not available, provide stubs. If mremap is not available, #define
2142 it to gold_mremap.
2143 (MREMAP_MAYMOVE): Define if not defined.
2144 (Output_file::Output_file): Initialize map_is_allocated_.
2145 (Output_file::resize): Check map_is_allocated_.
2146 (Output_file::map_anonymous): If mmap fails, use malloc.
2147 (Output_file::unmap): Don't do anything for an anonymous map.
2148 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
2149 is not available, provide stubs.
2150 (File_read::View::~View): Use free rather than delete[].
2151 (File_read::make_view): Use malloc rather than new[]. If mmap
2152 fails, use malloc.
2153 (File_read::find_or_make_view): Use malloc rather than new[].
2154 * gold.h: Remove HAVE_REMAP code.
2155 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
2156 exists. Rename mremap to gold_mremap. If mmap is not available
2157 don't do anything.
2158 * configure, config.in: Rebuild.
2159
11e361bc
ILT
21602011-04-11 Ian Lance Taylor <iant@google.com>
2161
2162 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
2163 initialize local variable v.
2164
cdc29364
CC
21652011-04-11 Cary Coutant <ccoutant@google.com>
2166
2167 * archive.cc (Archive::include_member): Adjust call to
2168 report_object.
2169 (Add_archive_symbols::run): Track argument serial numbers.
2170 (Lib_group::include_member): Likewise.
2171 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
2172 * archive.h (Incremental_archive_entry::Archive_member):
2173 Initialize arg_serial_.
2174 (Archive_member::arg_serial_): New data member.
2175 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
2176 (Sized_dynobj::do_add_symbols): Track symbols when doing an
2177 incremental link.
2178 (Sized_dynobj::do_for_all_local_got_entries): New function.
2179 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
2180 function.
2181 * fileread.cc (get_mtime): New function.
2182 * fileread.h (get_mtime): New function.
2183 * gold.cc (queue_initial_tasks): Check for incremental update.
2184 (process_incremental_input): New function.
2185 (queue_middle_tasks): Don't force valid target for incremental
2186 update.
2187 * incremental-dump.cc (find_input_containing_global): Adjust
2188 size of symbol info entry.
2189 (dump_incremental_inputs): Dump argument serial number and
2190 in_system_directory flag; bias shndx by 1; print symbol names
2191 when dumping per-file symbol lists; use new symbol info readers.
2192 * incremental.cc
2193 (Output_section_incremental_inputs:update_data_size): New function.
2194 (Sized_incremental_binary::setup_readers): Setup input readers
2195 for each input file; build maps for files added from libraries
2196 and scripts.
2197 (Sized_incremental_binary::check_input_args): New function.
2198 (Sized_incremental_binary::do_check_inputs): Build map of argument
2199 serial numbers to input arguments.
2200 (Sized_incremental_binary::do_file_has_changed): Rename
2201 do_file_is_unchanged to this; compare file modification times.
2202 (Sized_incremental_binary::do_init_layout): New function.
2203 (Sized_incremental_binary::do_reserve_layout): New function.
2204 (Sized_incremental_binary::do_get_input_reader): Remove.
2205 (Sized_incremental_binary::get_symtab_view): New function.
2206 (Incremental_checker::can_incrementally_link_output_file): Remove.
2207 (Incremental_inputs::report_command_line): Exclude --debug options.
2208 (Incremental_inputs::report_archive_begin): Add parameter; track
2209 argument serial numbers; don't put input file entry for archive
2210 before archive members.
2211 (Incremental_inputs::report_archive_end): Put input file entry
2212 for archive after archive members.
2213 (Incremental_inputs::report_object): Add parameter; track argument
2214 serial numbers and in_system_directory flag.
2215 (Incremental_inputs::report_script): Add parameter; track argument
2216 serial numbers.
2217 (Output_section_incremental_inputs::set_final_data_size): Adjust
2218 size of symbol info entry; check for forwarding symbols.
2219 (Output_section_incremental_inputs::write_input_files): Write
2220 in_system_directory flag and argument serial number.
2221 (Output_section_incremental_inputs::write_info_blocks): Map section
2222 indices between incremental info and original input file; store
2223 input section index for each symbol.
2224 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
2225 change operator() to visit().
2226 (class Global_got_offset_visitor): Likewise.
2227 (class Global_symbol_visitor_got_plt):
2228 (Output_section_incremental_inputs::write_got_plt): Use new visitor
2229 classes.
2230 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
2231 (Sized_incr_relobj::do_read_symbols): New function.
2232 (Sized_incr_relobj::do_layout): New function.
2233 (Sized_incr_relobj::do_layout_deferred_sections): New function.
2234 (Sized_incr_relobj::do_add_symbols): New function.
2235 (Sized_incr_relobj::do_should_include_member): New function.
2236 (Sized_incr_relobj::do_for_all_global_symbols): New function.
2237 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
2238 (Sized_incr_relobj::do_section_size): New function.
2239 (Sized_incr_relobj::do_section_name): New function.
2240 (Sized_incr_relobj::do_section_contents): New function.
2241 (Sized_incr_relobj::do_section_flags): New function.
2242 (Sized_incr_relobj::do_section_entsize): New function.
2243 (Sized_incr_relobj::do_section_address): New function.
2244 (Sized_incr_relobj::do_section_type): New function.
2245 (Sized_incr_relobj::do_section_link): New function.
2246 (Sized_incr_relobj::do_section_info): New function.
2247 (Sized_incr_relobj::do_section_addralign): New function.
2248 (Sized_incr_relobj::do_initialize_xindex): New function.
2249 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
2250 (Sized_incr_relobj::do_read_relocs): New function.
2251 (Sized_incr_relobj::do_gc_process_relocs): New function.
2252 (Sized_incr_relobj::do_scan_relocs): New function.
2253 (Sized_incr_relobj::do_count_local_symbols): New function.
2254 (Sized_incr_relobj::do_finalize_local_symbols): New function.
2255 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
2256 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
2257 (Sized_incr_relobj::do_relocate): New function.
2258 (Sized_incr_relobj::do_set_section_offset): New function.
2259 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
2260 (Sized_incr_dynobj::do_read_symbols): New function.
2261 (Sized_incr_dynobj::do_layout): New function.
2262 (Sized_incr_dynobj::do_add_symbols): New function.
2263 (Sized_incr_dynobj::do_should_include_member): New function.
2264 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
2265 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
2266 (Sized_incr_dynobj::do_section_size): New function.
2267 (Sized_incr_dynobj::do_section_name): New function.
2268 (Sized_incr_dynobj::do_section_contents): New function.
2269 (Sized_incr_dynobj::do_section_flags): New function.
2270 (Sized_incr_dynobj::do_section_entsize): New function.
2271 (Sized_incr_dynobj::do_section_address): New function.
2272 (Sized_incr_dynobj::do_section_type): New function.
2273 (Sized_incr_dynobj::do_section_link): New function.
2274 (Sized_incr_dynobj::do_section_info): New function.
2275 (Sized_incr_dynobj::do_section_addralign): New function.
2276 (Sized_incr_dynobj::do_initialize_xindex): New function.
2277 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
2278 (make_sized_incremental_object): New function.
2279 (Incremental_library::copy_unused_symbols): New function.
2280 (Incremental_library::do_for_all_unused_symbols): New function.
2281 * incremental.h (enum Incremental_input_flags): New type.
2282 (class Incremental_checker): Remove.
2283 (Incremental_input_entry::Incremental_input_entry): Add argument
2284 serial number.
2285 (Incremental_input_entry::arg_serial): New function.
2286 (Incremental_input_entry::set_is_in_system_directory): New function.
2287 (Incremental_input_entry::is_in_system_directory): New function.
2288 (Incremental_input_entry::arg_serial_): New data member.
2289 (Incremental_input_entry::is_in_system_directory_): New data member.
2290 (class Script_info): Move here from script.h.
2291 (Script_info::Script_info): Add filename parameter.
2292 (Script_info::filename): New function.
2293 (Script_info::filename_): New data member.
2294 (Incremental_script_entry::Incremental_script_entry): Add argument
2295 serial number.
2296 (Incremental_object_entry::Incremental_object_entry): Likewise.
2297 (Incremental_object_entry::add_input_section): Build list of input
2298 sections with map to original shndx.
2299 (Incremental_object_entry::get_input_section_index): New function.
2300 (Incremental_object_entry::shndx_): New data member.
2301 (Incremental_object_entry::name_key_): Rename; adjust all refs.
2302 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
2303 (Incremental_archive_entry::Incremental_archive_entry): Add argument
2304 serial number.
2305 (Incremental_inputs::report_archive_begin): Likewise.
2306 (Incremental_inputs::report_object): Likewise.
2307 (Incremental_inputs::report_script): Likewise.
2308 (class Incremental_global_symbol_reader): New class.
2309 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
2310 and store flags and input file type.
2311 (Incremental_input_entry_reader::arg_serial): New function.
2312 (Incremental_input_entry_reader::type): Extract type from flags.
2313 (Incremental_input_entry_reader::is_in_system_directory): New function.
2314 (Incremental_input_entry_reader::get_input_section_count): Call
2315 accessor function for type.
2316 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
2317 function for type; adjust size of global symbol entry.
2318 (Incremental_input_entry_reader::get_global_symbol_count): Call
2319 accessor function for type.
2320 (Incremental_input_entry_reader::get_object_count): Likewise.
2321 (Incremental_input_entry_reader::get_object_offset): Likewise.
2322 (Incremental_input_entry_reader::get_member_count): Likewise.
2323 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
2324 (Incremental_input_entry_reader::get_member_offset): Likewise.
2325 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
2326 (Incremental_input_entry_reader::Global_symbol_info): Remove.
2327 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
2328 (Incremental_input_entry_reader::get_global_symbol_reader): New
2329 function.
2330 (Incremental_input_entry_reader::get_output_symbol_index): New
2331 function.
2332 (Incremental_input_entry_reader::type_): Remove.
2333 (Incremental_input_entry_reader::flags_): New data member.
2334 (Incremental_inputs_reader::input_file_offset): New function.
2335 (Incremental_inputs_reader::input_file_index): New function.
2336 (Incremental_inputs_reader::input_file): Call input_file_offset.
2337 (Incremental_inputs_reader::input_file_at_offset): New function.
2338 (Incremental_relocs_reader::get_r_type): Reformat.
2339 (Incremental_relocs_reader::get_r_shndx): Reformat.
2340 (Incremental_relocs_reader::get_r_offset): Reformat.
2341 (Incremental_relocs_reader::data): New function.
2342 (Incremental_binary::Incremental_binary): Initialize new data members.
2343 (Incremental_binary::check_inputs): Add cmdline parameter.
2344 (Incremental_binary::file_is_unchanged): Remove.
2345 (Input_reader::arg_serial): New function.
2346 (Input_reader::get_unused_symbol_count): New function.
2347 (Input_reader::get_unused_symbol): New function.
2348 (Input_reader::do_arg_serial): New function.
2349 (Input_reader::do_get_unused_symbol_count): New function.
2350 (Input_reader::do_get_unused_symbol): New function.
2351 (Incremental_binary::input_file_count): New function.
2352 (Incremental_binary::get_input_reader): Change signature to use
2353 index instead of filename.
2354 (Incremental_binary::file_has_changed): New function.
2355 (Incremental_binary::get_input_argument): New function.
2356 (Incremental_binary::get_library): New function.
2357 (Incremental_binary::get_script_info): New function.
2358 (Incremental_binary::init_layout): New function.
2359 (Incremental_binary::reserve_layout): New function.
2360 (Incremental_binary::output_file): New function.
2361 (Incremental_binary::do_check_inputs): New function.
2362 (Incremental_binary::do_file_is_unchanged): Remove.
2363 (Incremental_binary::do_file_has_changed): New function.
2364 (Incremental_binary::do_init_layout): New function.
2365 (Incremental_binary::do_reserve_layout): New function.
2366 (Incremental_binary::do_input_file_count): New function.
2367 (Incremental_binary::do_get_input_reader): Change signature.
2368 (Incremental_binary::input_args_map_): New data member.
2369 (Incremental_binary::library_map_): New data member.
2370 (Incremental_binary::script_map_): New data member.
2371 (Sized_incremental_binary::Sized_incremental_binary): Initialize
2372 new data members.
2373 (Sized_incremental_binary::output_section): New function.
2374 (Sized_incremental_binary::inputs_reader): Add const.
2375 (Sized_incremental_binary::symtab_reader): Add const.
2376 (Sized_incremental_binary::relocs_reader): Add const.
2377 (Sized_incremental_binary::got_plt_reader): Add const.
2378 (Sized_incremental_binary::get_symtab_view): New function.
2379 (Sized_incremental_binary::Inputs_reader): New typedef.
2380 (Sized_incremental_binary::Input_entry_reader): New typedef.
2381 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
2382 (Sized_incremental_binary::do_file_is_unchanged): Remove.
2383 (Sized_incremental_binary::do_file_has_changed): New function.
2384 (Sized_incremental_binary::do_init_layout): New function.
2385 (Sized_incremental_binary::do_reserve_layout): New function.
2386 (Sized_input_reader::Inputs_reader): Remove.
2387 (Sized_input_reader::Input_entry_reader): Remove.
2388 (Sized_input_reader::do_arg_serial): New function.
2389 (Sized_input_reader::do_get_unused_symbol_count): New function.
2390 (Sized_input_reader::do_get_unused_symbol): New function.
2391 (Sized_incremental_binary::do_input_file_count): New function.
2392 (Sized_incremental_binary::do_get_input_reader): Change signature;
2393 use index instead of filename.
2394 (Sized_incremental_binary::section_map_): New data member.
2395 (Sized_incremental_binary::input_entry_readers_): New data member.
2396 (class Sized_incr_relobj): New class.
2397 (class Sized_incr_dynobj): New class.
2398 (make_sized_incremental_object): New function.
2399 (class Incremental_library): New class.
2400 * layout.cc (Free_list::num_lists): New static data member.
2401 (Free_list::num_nodes): New static data member.
2402 (Free_list::num_removes): New static data member.
2403 (Free_list::num_remove_visits): New static data member.
2404 (Free_list::num_allocates): New static data member.
2405 (Free_list::num_allocate_visits): New static data member.
2406 (Free_list::init): New function.
2407 (Free_list::remove): New function.
2408 (Free_list::allocate): New function.
2409 (Free_list::dump): New function.
2410 (Free_list::print_stats): New function.
2411 (Layout_task_runner::run): Resize output file for incremental updates.
2412 (Layout::Layout): Initialize new data members.
2413 (Layout::set_incremental_base): New function.
2414 (Layout::init_fixed_output_section): New function.
2415 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
2416 incremental updates.
2417 (Layout::create_gold_note): Do not create gold note section for
2418 incremental updates.
2419 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
2420 for incremental updates.
2421 (Layout::set_section_offsets): For incremental updates, allocate space
2422 from free list.
2423 (Layout::create_symtab_sections): Layout with offsets relative to
2424 start of section; for incremental updates, allocate space from free
2425 list.
2426 (Layout::create_shdrs): For incremental updates, allocate space from
2427 free list.
2428 (Layout::finish_dynamic_section): For incremental updates, do not
2429 check --as-needed (fixed in subsequent patch).
2430 * layout.h (class Free_list): New class.
2431 (Layout::set_incremental_base): New function.
2432 (Layout::incremental_base): New function.
2433 (Layout::init_fixed_output_section): New function.
2434 (Layout::allocate): New function.
2435 (Layout::incremental_base_): New data member.
2436 (Layout::free_list_): New data member.
2437 * main.cc (main): Print Free_list statistics.
2438 * object.cc (Relobj::finalize_incremental_relocs): Add
2439 clear_counts parameter; clear counts only when clear_counts is set.
2440 (Sized_relobj::Sized_relobj): Initialize new base class.
2441 (Sized_relobj::do_layout): Don't report special sections.
2442 (Sized_relobj::do_for_all_local_got_entries): New function.
2443 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
2444 symtab_off to all symbol table offsets.
2445 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
2446 * object.h (class Got_offset_list): Move to top of file.
2447 (Object::Object): Allow case where input_file == NULL.
2448 (Object::~Object): Likewise.
2449 (Object::input_file): Assert that input_file != NULL.
2450 (Object::lock): Allow case where input_file == NULL.
2451 (Object::unlock): Likewise.
2452 (Object::is_locked): Likewise.
2453 (Object::token): Likewise.
2454 (Object::release): Likewise.
2455 (Object::is_incremental): New function.
2456 (Object::get_mtime): New function.
2457 (Object::for_all_local_got_entries): New function.
2458 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
2459 (Object::set_is_in_system_directory): New function.
2460 (Object::is_in_system_directory): New function.
2461 (Object::do_is_incremental): New function.
2462 (Object::do_get_mtime): New function.
2463 (Object::do_for_all_local_got_entries): New function.
2464 (Object::is_in_system_directory_): New data member.
2465 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
2466 (class Sized_relobj_base): New class.
2467 (class Sized_relobj): Derive from Sized_relobj_base.
2468 (class Sized_relobj::Symbols): Redeclare from base class.
2469 (class Sized_relobj::local_got_offset_list): Remove.
2470 (class Sized_relobj::Output_sections): Redeclare from base class.
2471 (class Sized_relobj::do_for_all_local_got_entries): New function.
2472 (class Sized_relobj::write_local_symbols): Add offset parameter.
2473 (class Sized_relobj::local_symbol_offset_): Update comment.
2474 (class Sized_relobj::local_dynsym_offset_): Update comment.
2475 * options.cc (Input_arguments::add_file): Remove const.
2476 * options.h (Input_file_argument::Input_file_argument):
2477 Initialize arg_serial_ (all constructors).
2478 (Input_file_argument::set_arg_serial): New function.
2479 (Input_file_argument::arg_serial): New function.
2480 (Input_file_argument::arg_serial_): New data member.
2481 (Input_arguments::Input_arguments): Initialize file_count_.
2482 (Input_arguments::add_file): Remove const.
2483 (Input_arguments::number_of_input_files): New function.
2484 (Input_arguments::file_count_): New data member.
2485 (Command_line::number_of_input_files): Call
2486 Input_arguments::number_of_input_files.
2487 * output.cc (Output_segment_headers::Output_segment_headers):
2488 Set current size.
2489 (Output_section::Input_section::current_data_size): New function.
2490 (Output_section::Output_section): Initialize new data members.
2491 (Output_section::add_input_section): Don't do merge sections for
2492 an incremental link; allocate space from free list for an
2493 incremental update.
2494 (Output_section::add_output_section_data): Allocate space from
2495 free list for an incremental update.
2496 (Output_section::update_data_size): New function.
2497 (Output_section::set_fixed_layout): New function.
2498 (Output_section::reserve): New function.
2499 (Output_segment::set_section_addresses): Remove const.
2500 (Output_segment::set_section_list_addresses): Remove const; allocate
2501 space from free list for an incremental update.
2502 (Output_segment::set_offset): Adjust size of RELRO segment for an
2503 incremental update.
2504 * output.h (Output_data::current_data_size): Move here from
2505 child classes.
2506 (Output_data::pre_finalize_data_size): New function.
2507 (Output_data::update_data_size): New function.
2508 (Output_section_headers::update_data_size): new function.
2509 (Output_section_data_build::current_data_size): Move to Output_data.
2510 (Output_data_strtab::update_data_size): New function.
2511 (Output_section::current_data_size): Move to Output_data.
2512 (Output_section::set_fixed_layout): New function.
2513 (Output_section::has_fixed_layout): New function.
2514 (Output_section::reserve): New function.
2515 (Output_section::update_data_size): New function.
2516 (Output_section::has_fixed_layout_): New data member.
2517 (Output_section::free_list_): New data member.
2518 (Output_segment::set_section_addresses): Remove const.
2519 (Output_segment::set_section_list_addresses): Remove const.
2520 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
2521 New function.
2522 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
2523 New function.
2524 * readsyms.cc (Read_symbols::do_read_symbols): Add library
2525 parameter when calling Add_symbols constructor; store argument
2526 serial number for members of a lib group.
2527 (Add_symbols::locks): Allow case where token == NULL.
2528 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
2529 (Read_member::~Read_member): New function.
2530 (Read_member::is_runnable): New function.
2531 (Read_member::locks): New function.
2532 (Read_member::run): New function.
2533 (Check_script::~Check_script): New function.
2534 (Check_script::is_runnable): New function.
2535 (Check_script::locks): New function.
2536 (Check_script::run): New function.
2537 (Check_library::~Check_library): New function.
2538 (Check_library::is_runnable): New function.
2539 (Check_library::locks): New function.
2540 (Check_library::run): New function.
2541 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
2542 (Add_symbols::library_): New data member.
2543 (class Read_member): New class.
2544 (class Check_script): New class.
2545 (class Check_library): New class.
2546 * reloc.cc (Read_relocs::is_runnable): Allow case where
2547 token == NULL.
2548 (Read_relocs::locks): Likewise.
2549 (Scan_relocs::locks): Likewise.
2550 (Relocate_task::locks): Likewise.
2551 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
2552 to clear counters.
2553 (Sized_relobj::incremental_relocs_scan): Fix comment.
2554 (Sized_relobj::do_relocate): Pass output file offset to
2555 write_local_symbols.
2556 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
2557 from class declaration.
2558 * script.cc (read_input_script): Allocate Script_info; pass
2559 argument serial number to report_script.
2560 * script.h (class Script_info): Move to incremental.h.
2561 * symtab.cc (Symbol_table::add_from_incrobj): New function.
2562 * symtab.h (Symbol_table::add_from_incrobj): New function.
2563 (Symbol_table::set_file_offset): New function.
2564
b961d0d7
CC
25652011-04-05 Cary Coutant <ccoutant@google.com>
2566
2567 * incremental-dump.cc (dump_incremental_inputs): Change signature
2568 to take a Sized_incremental_binary; change caller. Use readers
2569 in Sized_incremental_binary.
2570 * incremental.cc
2571 (Sized_incremental_binary::find_incremental_inputs_sections):
2572 Rename do_find_incremental_inputs_sections to this.
2573 (Sized_incremental_binary::setup_readers): New function.
2574 (Sized_incremental_binary::do_check_inputs): Check
2575 has_incremental_info_ flag; move setup code to setup_readers;
2576 use input readers.
2577 (Sized_incremental_binary::do_file_is_unchanged): New function.
2578 (Sized_incremental_binary::do_get_input_reader): New function.
2579 * incremental.h (class Incremental_binary): Move to end of file.
2580 (Incremental_binary::file_is_unchanged): New function.
2581 (Incremental_binary::do_file_is_unchanged): New function.
2582 (Incremental_binary::Input_reader): New class.
2583 (Incremental_binary::get_input_reader): New function.
2584 (class Sized_incremental_binary): Move to end of file.
2585 (Sized_incremental_binary::Sized_incremental_binary): Setup the
2586 input section reader classes.
2587 (Sized_incremental_binary::has_incremental_info): New function.
2588 (Sized_incremental_binary::inputs_reader): New function.
2589 (Sized_incremental_binary::symtab_reader): New function.
2590 (Sized_incremental_binary::relocs_reader): New function.
2591 (Sized_incremental_binary::got_plt_reader): New function.
2592 (Sized_incremental_binary::do_file_is_unchanged): New function.
2593 (Sized_incremental_binary::Sized_input_reader): New class.
2594 (Sized_incremental_binary::get_input_reader): New function.
2595 (Sized_incremental_binary::find_incremental_inputs_sections):
2596 Rename do_find_incremental_inputs_sections to this.
2597 (Sized_incremental_binary::setup_readers): New function.
2598 (Sized_incremental_binary::has_incremental_info_): New data member.
2599 (Sized_incremental_binary::inputs_reader_): New data member.
2600 (Sized_incremental_binary::symtab_reader_): New data member.
2601 (Sized_incremental_binary::relocs_reader_): New data member.
2602 (Sized_incremental_binary::got_plt_reader_): New data member.
2603 (Sized_incremental_binary::current_input_file_): New data member.
2604
a869183f
PP
26052011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
2606
2607 PR gold/12640
2608 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
2609 violation.
2610
26112011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
2612
2613 * archive.cc (Archive::include_member): Adjust call to report_object.
2614 (Add_archive_symbols::run): Add script_info to call to
2615 report_archive_begin.
2616 (Lib_group::include_member): Adjust call to report_object.
2617 (Add_lib_group_symbols::run): Adjust call to report_object.
2618 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
2619 blocks. Add object count for script input files.
2620 * incremental.cc (Incremental_inputs::report_archive_begin): Add
2621 script_info parameter; change all callers.
2622 (Incremental_inputs::report_object): Add script_info parameter;
2623 change all callers.
2624 (Incremental_inputs::report_script): Store backpointer to
2625 incremental info entry.
2626 (Output_section_incremental_inputs::set_final_data_size): Record
2627 additional information for scripts.
2628 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2629 * incremental.h (Incremental_script_entry::add_object): New function.
2630 (Incremental_script_entry::get_object_count): New function.
2631 (Incremental_script_entry::get_object): New function.
2632 (Incremental_script_entry::objects_): New data member; adjust
2633 constructor.
2634 (Incremental_inputs::report_archive_begin): Add script_info parameter.
2635 (Incremental_inputs::report_object): Add script_info parameter.
2636 (Incremental_inputs_reader::get_object_count): New function.
2637 (Incremental_inputs_reader::get_object_offset): New function.
2638 * options.cc (Input_arguments::add_file): Return reference to
2639 new input argument.
2640 * options.h (Input_argument::set_script_info): New function.
2641 (Input_argument::script_info): New function.
2642 (Input_argument::script_info_): New data member; adjust all
2643 constructors.
2644 (Input_file_group::add_file): Return reference to new input argument.
2645 (Input_file_lib::add_file): Likewise.
2646 (Input_arguments::add_file): Likewise.
2647 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
2648 * script.cc (Parser_closure::Parser_closure): Add script_info
2649 parameter; adjust all callers.
2650 (Parser_closure::script_info): New function.
2651 (Parser_closure::script_info_): New data member.
2652 (read_input_script): Report scripts earlier to incremental info.
2653 (script_add_file): Set script_info in Input_argument.
2654 (script_add_library): Likewise.
2655 * script.h (Script_options::Script_info): Rewrite class.
2656
a869183f 26572011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
2658
2659 * archive.cc (Library_base::should_include_member): Move
2660 method here from class Archive.
2661 (Archive::Archive): Initialize base class.
2662 (Archive::should_include_member): Move to base class.
2663 (Archive::do_for_all_unused_symbols): New function.
2664 (Add_archive_symbols::run): Remove redundant access to
2665 incremental_inputs.
2666 (Lib_group::Lib_group): Initialize base class.
2667 (Lib_group::do_filename): New function.
2668 (Lib_group::include_member): Pass pointer to Lib_group to
2669 report_object.
2670 (Lib_group::do_for_all_unused_symbols): New function.
2671 (Add_lib_group_symbols::run): Report archive information for
2672 incremental links.
2673 * archive.h (class Library_base): New base class.
2674 (class Archive): Derive from Library_base.
2675 (Archive::filename): Move to base class.
2676 (Archive::set_incremental_info): Likewise.
2677 (Archive::incremental_info): Likewise.
2678 (Archive::Should_include): Likewise.
2679 (Archive::should_include_member): Likewise.
2680 (Archive::Armap_entry): Remove.
2681 (Archive::Unused_symbol_iterator): Remove.
2682 (Archive::unused_symbols_begin): Remove.
2683 (Archive::unused_symbols_end): Remove.
2684 (Archive::do_filename): New function.
2685 (Archive::do_get_mtime): New function.
2686 (Archive::do_for_all_unused_symbols): New function.
2687 (Archive::task_): Move to base class.
2688 (Archive::incremental_info_): Likewise.
2689 (class Lib_group): Derive from Library_base.
2690 (Lib_group::do_filename): New function.
2691 (Lib_group::do_get_mtime): New function.
2692 (Lib_group::do_for_all_unused_symbols): New function.
2693 (Lib_group::task_): Move to base class.
2694 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
2695 function.
2696 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
2697 function.
2698 * incremental.cc (Incremental_inputs::report_archive_begin):
2699 Use Library_base; call library's get_mtime; add incremental inputs
2700 entry before members.
2701 (class Unused_symbol_visitor): New class.
2702 (Incremental_inputs::report_archive_end): Use Library_base; use
2703 visitor class to record unused symbols; don't add incremental inputs
2704 entry after members.
2705 (Incremental_inputs::report_object): Use Library_base.
2706 * incremental.h
2707 (Incremental_archive_entry::Incremental_archive_entry): Remove
2708 unused Archive parameter.
2709 (Incremental_inputs::report_archive_begin): Use Library_base.
2710 (Incremental_inputs::report_archive_end): Likewise.
2711 (Incremental_inputs::report_object): Likewise.
2712 * object.cc (Sized_relobj::do_for_all_global_symbols): New
2713 function.
2714 * object.h (Object::for_all_global_symbols): New function.
2715 (Object::do_for_all_global_symbols): New function.
2716 (Sized_relobj::do_for_all_global_symbols): New function.
2717 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
2718 function.
2719 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
2720 function.
2721
61ab3e40
ILT
27222011-03-27 Ian Lance Taylor <iant@google.com>
2723
2724 * archive.cc (Archive::interpret_header): Return -1 if something
2725 goes wrong. Change callers accordingly.
2726
30e1f9e6
CC
27272011-03-25 Cary Coutant <ccoutant@google.com>
2728
2729 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
2730 * testsuite/Makefile.in: Regenerate.
2731
9370ce59 27322011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
2733
2734 * plugin.cc (get_view): New.
2735 (Plugin::load): Pass get_view to the plugin.
2736 (Plugin_manager::get_view): New.
2737
9312bb0a
ILT
27382011-03-21 Ian Lance Taylor <iant@google.com>
2739
2740 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 2741 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 2742
7e12ba9e
ST
27432011-03-21 Sriraman Tallam <tmsriram@google.com>
2744
2745 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
2746 Change == to -eq.
2747 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
2748 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
2749 Change == to -eq.
2750 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
2751 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
2752
fd7a005d
ILT
27532011-03-14 Ian Lance Taylor <iant@google.com>
2754
2755 * script-sections.cc (Sort_output_sections::script_compare):
2756 Rename from is_before, change return type.
2757 (Sort_output_sections::operator()): Adjust accordingly.
2758
ed16fd1b
ILT
27592011-03-11 Jeffrey Yasskin <jyasskin@google.com>
2760
2761 PR gold/12572
2762 * testsuite/odr_violation2.cc: Add comment to make all error line
2763 numbers double digits.
2764 * testsuite/debug_msg.sh: Adjust expected errors.
2765
71ff8986
ILT
27662011-03-09 Jeffrey Yasskin <jyasskin@google.com>
2767
2768 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
2769 but mark earlier ones as non-canonical
2770 (offset_to_iterator): Update search target and example
2771 (do_addr2line): Return extra lines in a vector*
2772 (format_file_lineno): Extract from do_addr2line
2773 (one_addr2line): Add vector* out-param
2774 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
2775 when a lineno entry appeared last for its instruction
2776 (Dwarf_line_info): Add vector* out-param
2777 * object.cc (Relocate_info): Pass NULL for the vector* out-param
2778 * symtab.cc (Odr_violation_compare): Include the lineno in the
2779 comparison again.
2780 (linenos_from_loc): New. Combine the canonical line for an
2781 address with its other lines.
2782 (True_if_intersect): New. Helper functor to make
2783 std::set_intersection a query.
2784 (detect_odr_violations): Compare sets of lines instead of just
2785 one line for each function. This became less deterministic, but
2786 has fewer false positives.
2787 * symtab.h: Declarations.
2788 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
2789 mix an optimized and non-optimized object in the same binary
2790 (odr_violation2.so): Same.
2791 * testsuite/Makefile.in: Regenerate from Makefile.am.
2792 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
2793 * testsuite/debug_msg.sh: Update line numbers and add
2794 assertions.
2795 * testsuite/odr_violation1.cc: Use OdrDerived, in a
2796 non-optimized context.
2797 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
2798 isn't inlined, and use OdrDerived in an optimized context.
2799 * testsuite/odr_header1.h: Defines OdrDerived, where
2800 optimization will change the
2801 first-instruction-in-the-destructor's file and line number.
2802 * testsuite/odr_header2.h: Defines OdrBase.
2803
a19fefdc
ILT
28042011-03-09 Ian Lance Taylor <iant@google.com>
2805
2806 * fileread.cc (File_read::clear_views): Don't delete the whole
2807 file view.
2808
ecb351e9
ILT
28092011-03-08 Ian Lance Taylor <iant@google.com>
2810
2811 PR gold/12525
2812 * fileread.cc: #include <climits>.
2813 (GOLD_IOV_MAX): Define.
2814 (File_read::read_multiple): Limit number of entries by iov_max.
2815 * fileread.h (class File_read): Always set max_readv_entries to
2816 128.
2817
b821d13c
ILT
28182011-03-07 Ian Lance Taylor <iant@google.com>
2819
2820 PR gold/12525
2821 * options.h (class General_options): Add -dy and -dn.
2822
89243142
CC
28232011-03-02 Cary Coutant <ccoutant@google.com>
2824
2825 * testsuite/script_test_9.t: Add TLS segment.
2826
d0773f31
ILT
28272011-03-02 Simon Baldwin <simonb@google.com>
2828
2829 * configure.ac: Add check for gnu_indirect_function support in
2830 the toolchain building binutils.
2831 * configure: Rebuild.
2832
9370ce59 28332011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
2834
2835 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
2836 plugin only symbols.
2837 (Symbol_table::sized_finalize_symbol) Mark symbol only present
2838 in plugin files as not needed in the symbol table.
2839
4cf7a849
ST
28402011-02-11 Sriraman Tallam <tmsriram@google.com>
2841
2842 * output.cc (Output_section::add_input_section): Delay fill
2843 generation for section ordering.
2844
b578bd7d
ILT
28452011-02-09 Ian Lance Taylor <iant@google.com>
2846
2847 PR gold/12316
2848 * object.h (class Sized_relobj): Remove clear_local_symbols.
2849 * reloc.cc (Sized_relobj::do_relocate): Don't call
2850 clear_local_symbols.
2851
9370ce59 28522011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
2853
2854 * plugin.cc (is_visible_from_outside): Return true for symbols
2855 in the -u option.
2856
55382fb7
ILT
28572011-02-04 Jeffrey Yasskin <jyasskin@google.com>
2858
2859 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
2860 filename.
2861
4e271fff
ST
28622011-02-02 Sriraman Tallam <tmsriram@google.com>
2863
2864 * icf.h (is_section_foldable_candidate): Change type of parameter
2865 to std::string.
2866 * icf.cc (Icf::find_identical_sections): Change type of local variable
2867 section_name to be std::string.
2868 (is_function_ctor_or_dtor): Change type of parameter to std::string.
2869
d433c3ac
ILT
28702011-01-25 Ian Lance Taylor <iant@google.com>
2871
2872 * script.cc (script_add_extern): Rewrite to use
2873 add_symbol_reference.
2874
880473a6
DK
28752011-01-25 Doug Kwan <dougkwan@google.com>
2876
d433c3ac 2877 * icf.cc (get_section_contents): Always lock section's object.
880473a6 2878
f30f86fa
ILT
28792011-01-24 Ian Lance Taylor <iant@google.com>
2880
2881 * options.h (class General_options): Accept
2882 --no-detect-odr-violations.
2883
8e51a0b9
ILT
28842011-01-24 Ian Lance Taylor <iant@google.com>
2885
2886 * version.cc (version_string): Bump to 1.11.
2887
0f3b89d8
ILT
28882011-01-24 Ian Lance Taylor <iant@google.com>
2889
2890 * plugin.cc (class Plugin_rescan): Define new class.
2891 (Plugin_manager::claim_file): Set any_claimed_.
2892 (Plugin_manager::save_archive): New function.
2893 (Plugin_manager::save_input_group): New function.
2894 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
2895 necessary.
2896 (Plugin_manager::new_undefined_symbol): New function.
2897 (Plugin_manager::rescan): New function.
2898 (Plugin_manager::rescannable_defines): New function.
2899 (Plugin_manager::add_input_file): Set any_added_.
2900 * plugin.h (class Plugin_manager): define new fields rescannable_,
2901 undefined_symbols_, any_claimed_, and any_added_. Declare
2902 Plugin_rescan as friend. Declare new functions.
2903 (Plugin_manager::Rescannable): Define type.
2904 (Plugin_manager::Rescannable_list): Define type.
2905 (Plugin_manager::Undefined_symbol_list): Define type.
2906 (Plugin_manager::Plugin_manager): Initialize new fields.
2907 * archive.cc (Archive::defines_symbol): New function.
2908 (Add_archive_symbols::run): Pass archive to plugins if any.
2909 * archive.h (class Archive): Declare defines_symbol.
2910 * readsyms.cc (Input_group::~Input_group): New function.
2911 (Finish_group::run): Pass input_group to plugins if any.
2912 * readsyms.h (class Input_group): Declare destructor.
2913 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
2914 any.
2915
3bb951e5
ILT
29162011-01-10 Ian Lance Taylor <iant@google.com>
2917
2918 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
2919 section as relro.
2920 (Layout::set_segment_offsets): Reset increase_relro before calling
2921 set_section_addresses a second time.
2922
0aa45fac
CC
29232011-01-04 Cary Coutant <ccoutant@google.com>
2924
2925 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
2926 sections before NOBITS sections.
2927
0db46eb4
L
29282011-01-01 H.J. Lu <hongjiu.lu@intel.com>
2929
2930 * version.cc (print_version): Update copyright to 2011.
2931
829c9745
CC
29322010-12-23 Cary Coutant <ccoutant@google.com>
2933
2934 * output.h (Output_data_reloc::add_output_section): Pass OD instead
2935 of OS to this->add. Add OD parameter to second form of the function.
2936
7500420b
ILT
29372010-12-20 Ian Lance Taylor <iant@google.com>
2938
2939 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
2940 second of two consecutive entries with same offset.
2941
f8e9a930
RW
29422010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2943
2944 * testsuite/Makefile.am (ifuncmain2static_LDADD)
2945 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
2946 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
2947 to avoid unneeded links against $(LDADD).
2948 * testsuite/Makefile.in: Regenerate.
2949
2fbb4320
ILT
29502010-12-15 Ian Lance Taylor <iant@google.com>
2951
2952 PR gold/12324
2953 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
2954 for R_X86_64_32 and R_X86_64_PC32.
2955 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
2956 ver_matching_def_pic.o.
2957 (ver_matching_def_pic.o): New target.
2958
fedb228d
RW
29592010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2960
2961 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
2962 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
2963 Move definition before File_read::View member definitions.
2964 (File_read::View::~View): Initialize and hold lock before
2965 updating current_mapped_bytes.
2966
9b547ce6
RW
29672010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2968
2969 * dwarf_reader.cc: Remove outdated comment.
2970 * gold-threads.cc: Fix typo in error message.
2971 * archive.cc: Fix typos in comments.
2972 * archive.h: Likewise.
2973 * arm-reloc-property.cc: Likewise.
2974 * arm-reloc-property.h: Likewise.
2975 * arm-reloc.def: Likewise.
2976 * arm.cc: Likewise.
2977 * attributes.h: Likewise.
2978 * cref.cc: Likewise.
2979 * ehframe.cc: Likewise.
2980 * fileread.h: Likewise.
2981 * gold.h: Likewise.
2982 * i386.cc: Likewise.
2983 * icf.cc: Likewise.
2984 * incremental.h: Likewise.
2985 * int_encoding.cc: Likewise.
2986 * layout.h: Likewise.
2987 * main.cc: Likewise.
2988 * merge.h: Likewise.
2989 * object.cc: Likewise.
2990 * object.h: Likewise.
2991 * options.cc: Likewise.
2992 * readsyms.cc: Likewise.
2993 * reduced_debug_output.cc: Likewise.
2994 * reloc.cc: Likewise.
2995 * script-sections.cc: Likewise.
2996 * sparc.cc: Likewise.
2997 * symtab.h: Likewise.
2998 * target-reloc.h: Likewise.
2999 * target.cc: Likewise.
3000 * target.h: Likewise.
3001 * timer.cc: Likewise.
3002 * timer.h: Likewise.
3003 * x86_64.cc: Likewise.
3004
83e17bd5
CC
30052010-12-09 Cary Coutant <ccoutant@google.com>
3006
3007 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
3008 stack.
3009 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
3010 parameter; change all callers.
3011 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
3012 * options.h (warn_execstack): New option.
3013
017257f8
DK
30142010-12-07 Doug Kwan <dougkwan@google.com>
3015
3016 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
3017 like function call relocations.
3018
c20cbc06
ILT
30192010-12-07 Ian Lance Taylor <iant@google.com>
3020
3021 * archive.cc (Archive::get_elf_object_for_member): Permit
3022 punconfigured to be NULL.
3023 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
3024 (Archive::include_member): Pass NULL to get_elf_object_for_member
3025 if we searched for the archive and this is the first included
3026 object.
3027
4dbfafcc
ILT
30282010-12-01 Ian Lance Taylor <iant@google.com>
3029
3030 * dwarf_reader.h (class Sized_dwarf_line_info): Add
3031 track_relocs_type_ field.
3032 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3033 Set track_relocs_type_.
3034 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
3035 contents when using RELA relocs.
3036 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
3037 reloc_map_.
3038 * reloc.cc (Track_relocs::next_addend): New function.
3039 * reloc.h (class Track_relocs): Declare next_addend.
3040
e5e19edd
ILT
30412010-12-01 Ian Lance Taylor <iant@google.com>
3042
3043 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
3044 virtual destructor.
3045
9a5ce24c
ILT
30462010-12-01 Ian Lance Taylor <iant@google.com>
3047
3048 * README: Update compilers known to work and fail.
3049
c7791212
NC
30502010-11-23 Matthias Klose <doko@ubuntu.com>
3051
3052 * configure.in: For --enable-gold, handle value `default' instead of
3053 `both*'. Always install ld as ld.bfd, install as ld if gold is
3054 not the default.
3055 * configure: Regenerate.
3056
0ad220c9
DK
30572010-11-18 Doug Kwan <dougkwan@google.com>
3058
3059 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
3060 and right_alignment to be zero. Store result alignment only if it is
3061 greater than existing alignment.
3062
ab8056e0
CC
30632010-11-16 Cary Coutant <ccoutant@google.com>
3064
3065 PR gold/12220
3066 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3067 Check for ".zdebug_line".
3068
fd064a5b
CC
30692010-11-16 Doug Kwan <dougkwan@google.com>
3070 Cary Coutant <ccoutant@google.com>
3071
3072 * output.h (Output_segment::set_section_addresses): Pass increase_relro
3073 by reference; adjust all callers.
3074 * output.cc (Output_segment::set_section_addresses): Adjust references
3075 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
3076 list is empty.
3077 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
3078 end at page boundary.
3079
6fc6ea19
CC
30802010-11-16 Cary Coutant <ccoutant@google.com>
3081
3082 PR gold/12220
3083 * layout.cc (Layout::choose_output_section): Transform names of
3084 compressed sections even when using a script with a SECTIONS clause.
3085 (Layout::output_section_name): Remove code to transform
3086 compressed debug section names.
3087 * output.cc (Output_section::add_input_section): Use uncompressed
3088 section size when tracking input sections.
3089
95a2c8d6
RS
30902010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
3091
3092 * symtab.h (Symbol::NON_PIC_REF): Remove.
3093 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
3094 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
3095 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
3096 (Symbol::use_plt_offset): Take a flags argument and pass it
3097 directly to needs_dynamic_reloc. Restrict check for undefined
3098 weak symbols to function calls.
3099 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
3100 (Target_arm::Scan::global): Use it.
3101 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
3102 (Target_arm::Relocate::relocate): Likewise.
3103 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
3104 parameter with an r_type parameter. Use get_reference_flags
3105 to get the flags.
3106 (Target_arm::Relocate::relocate): Update accordingly.
3107 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
3108 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
3109 (Target_i386::Scan::global): Likewise.
3110 (Target_i386::Relocate::relocate): Likewise.
3111 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
3112 parameter with an r_type parameter. Use get_reference_flags
3113 to get the flags.
3114 (Target_i386::Relocate::relocate): Update accordingly.
3115 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
3116 (Target_powerpc::Scan::global): Use it.
3117 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
3118 (Target_powerpc::Relocate::relocate): Likewise.
3119 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
3120 (Target_sparc::Scan::global): Use it.
3121 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
3122 (Target_sparc::Relocate::relocate): Likewise.
3123 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
3124 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
3125 (Target_x86_64::Scan::global): Likewise.
3126 (Target_x86_64::Relocate::relocate): Likewise.
3127
f625ae50
DK
31282010-11-08 Doug Kwan <dougkwan@google.com>
3129 Cary Coutant <ccoutant@google.com>
3130
3131 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
3132 (Arm_exidx_merge_section::section_contents_): New data member.
3133 (Arm_input_section::Arm_input_section): Initialize original_contents_.
3134 (Arm_input_section::~Arm_input_section): De-allocate memory.
3135 (Arm_input_section::original_contents_): New data member.
3136 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
3137 in parameters instead of calling Object::section_contents without
3138 locking.
3139 (Arm_output_section::group_section): New parameter TASK. Pass it
3140 to callees that need locking objects.
3141 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
3142 to lock EXIDX input sections. Fix a formatting issue. Call
3143 Arm_exidx_merged_section::build_contents to create merged section
3144 contents.
3145 (Arm_output_section::create_stub_group): New parameter TASK. Use it
3146 to lock object of stub table owner.
3147 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
3148 TEXT_SIZE to initialize data member TEXT_SIZE_.
3149 (Arm_exidx_input_section::addralign): Fix typo in comment.
3150 (Arm_exidx_input_section::text_size): New method.
3151 (Target_arm::do_relax): New parameter TASK. Pass it to callees
3152 that require locking objects. Lock objects before scanning for stubs
3153 and updating local symbols.
3154 (Arm_input_section<big_endian>::init): Copy contents of original
3155 input section.
3156 (Arm_input_section<big_endian>::do_write): Use saved contents of
3157 original input section instead of calling Object::section_contents
3158 without locking.
3159 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
3160 size without calling Object::section_size().
3161 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
3162 for size. Allocate a buffer for merged EXIDX entries.
3163 (Arm_exidx_merged_section::build_contents): New method.
3164 (Arm_exidx_merged_section::do_write): Move merge section contents
3165 building code to Arm_exidx_merged_section::build_contetns. Write
3166 out contetns in buffer instead of building it on the fly.
3167 (Arm_relobj::make_exidx_input_section): Also pass text section size
3168 to Arm_exidx_input_section constructor.
3169 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
3170 (Arm_dynobj::do_read_symbols): Fix memory leak.
3171 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
3172 * target.h: (class Task): Add forward declaration.
3173 (Target::relax): Add new parameter TASK and pass it to
3174 Target::do_relax().
3175 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
3176
5f9bcf58
CC
31772010-11-05 Cary Coutant <ccoutant@google.com>
3178
3179 PR gold/10708
3180 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
3181 object when reading from the file.
3182 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
3183 second layout pass.
3184 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
3185 when reading section contents.
3186 (get_section_contents): Likewise.
3187 (icf::find_identical_sections): Likewise.
3188 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
3189 object when reading from the file.
3190 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
3191 the object when doing deferred section layout.
3192
e597fa08
NC
31932010-11-03 Nick Clifton <nickc@redhat.com>
3194
3195 PR gold/12001
3196 * script.h (class Symbol_assignment: name): New member. Returns
3197 the name of the symbol.
3198 * scrfipt.cc (Script_options::is_pending_assignment): New member.
3199 Returns true if the given symbol name is on the list of
3200 assignments wating to be processed.
3201 * archive.cc (should_incldue_member): If the symbol is undefined,
3202 check to see if it is on the list of symbols pending assignment.
3203
3f9a3278
ILT
32042010-11-03 Ryan Mansfield <rmansfield@qnx.com>
3205
3206 * script-sections.cc (Script_sections::find_memory_region): Check
3207 for a NULL output section pointer.
3208
d06fb4d1
DK
32092010-10-29 Doug Kwan <dougkwan@google.com>
3210
3211 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
3212 Output_section::add_relaxed_input_section.
3213 * output.cc (Output_section::add_relaxed_input_section): Add new
3214 arguments LAYOUT and NAME. Set section order index.
3215 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
3216 Copy section order index.
3217 * output.h (Output_section::add_relaxed_input_section): Add new
3218 arguments LAYOUT and NAME.
3219
90e24de5
ILT
32202010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3221
3222 * testsuite/Makefile.am: Move gcctestdir/ld rule to
3223 NATIVE_OR_CROSS_LINKER.
3224 * testsuite/Makefile.in: Regenerate.
3225
c9484ea5
DK
32262010-10-20 Doug Kwan <dougkwan@google.com>
3227
3228 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
3229 without SHF_LINK_ORDER flags.
3230 * layout.cc (Layout::choose_output_section): Do not filter
3231 SHF_LINK_ORDER flag in a relocatable link.
3232
5bc2f5be
CC
32332010-10-17 Cary Coutant <ccoutant@google.com>
3234
3235 * output.h (Output_segment::set_section_addresses): Change function
3236 signature. Update all callers.
3237 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
3238 sections.
3239 (Output_segment::set_section_addresses): Align after last TLS
3240 section. Add padding before last relro section instead of after.
3241
0c91cf04
DK
32422010-10-17 Doug Kwan <dougkwan@google.com>
3243
3244 * gold/arm.cc (Target_arm::got_section): Use correct order and set
3245 GOT output section to be writable.
3246
8c21d9d3
CC
32472010-10-14 Cary Coutant <ccoutant@google.com>
3248
3249 * debug.h (DEBUG_INCREMENTAL): New flag.
3250 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
3251 * gold.cc (queue_initial_tasks): Check parameters for incremental link
3252 mode.
3253 * incremental.cc (report_command_line): Ignore all forms of
3254 --incremental.
3255 * layout.cc (Layout::Layout): Check parameters for incremental link
3256 mode.
3257 * options.cc (General_options::parse_incremental): New function.
3258 (General_options::parse_no_incremental): New function.
3259 (General_options::parse_incremental_full): New function.
3260 (General_options::parse_incremental_update): New function.
3261 (General_options::incremental_mode_): New data member.
3262 (General_options::finalize): Check incremental_mode_.
3263 * options.h (General_options): Update help text for --incremental.
3264 Add --no-incremental, --incremental-full, --incremental-update.
3265 (General_options::Incremental_mode): New enum type.
3266 (General_options::incremental_mode): New function.
3267 (General_options::incremental_mode_): New data member.
3268 * parameters.cc (Parameters::incremental_mode_): New data member.
3269 (Parameters::set_options): Set incremental_mode_.
3270 (Parameters::set_incremental_full): New function.
3271 (Parameters::incremental): New function.
3272 (Parameters::incremental_update): New function.
3273 (set_parameters_incremental_full): New function.
3274 * parameters.h (Parameters::set_incremental_full): New function.
3275 (Parameters::incremental): New function.
3276 (Parameters::incremental_update): New function.
3277 (Parameters::incremental_mode_): New data member.
3278 (set_parameters_incremental_full): New function.
3279 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
3280 incremental link mode.
3281 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
3282 (Sized_relobj::do_relocate_sections): Likewise.
3283 * testsuite/Makefile.am (incremental_test): Use --incremental-full
3284 option.
3285 * testsuite/Makefile.in: Regenerate.
3286 * testsuite/incremental_test.sh: Filter all forms of --incremental.
3287
bb32aa18 32882010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
3289
3290 * script-sections.h (class Script_sections): Make
3291 Sections_elements typedef public.
3292 * script-sections.cc (class Sort_output_sections): Add elements_
3293 field. Add constructor which sets it; change all callers.
3294 (Sort_output_sections::is_before): New function.
3295 (Sort_output_sections::operator()): Call is_before.
3296 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
3297 conditional.
3298 * testsuite/script_test_10.sh: New test. Test script section
3299 order.
3300 * testsuite/script_test_10.t: Likewise.
3301 * testsuite/script_test_10.s: Likewise.
3302 * testsuite/Makefile.am: Wrap the cross linker tests and the
3303 common tests into NATIVE_OR_CROSS_LINKER.
3304 (check_SCRIPTS): Add script_test_10.sh.
3305 (check_DATA): Add script_test_10.stdout.
3306 (script_test_10.o, script_test_10): New targets.
3307 (script_test_10.stdout): New target.
3308 * configure, testsuite/Makefile.in: Regenerate.
3309
3cef7179
ILT
33102010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3311
3312 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
3313 error for the deprecated relocations.
3314 (Target_arm::Scan::global): Likewise.
3315 (Target_arm::Relocate::relocate): Likewise.
3316
7411e9a8
RS
33172010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
3318
3319 * fileread.cc (Input_file::find_file): Initialize *found_name
3320 and *namep when using the fallback search for case 4.
3321
6a9da32a
CC
33222010-10-11 Cary Coutant <ccoutant@google.com>
3323
3324 * options.h (class General_options): Redefine -z lazy as an alias for
3325 the negation of -z now.
3326
ac897c20
ILT
33272010-10-11 Ian Lance Taylor <iant@google.com>
3328
3329 * resolve.cc (symbol_to_bits): Report the value of the unsupported
3330 binding.
3331
ea5cae92
NC
33322010-10-06 Nick Clifton <nickc@redhat.com>
3333
3334 * script-sections.cc(class Memory_region): Remove
3335 current_lma_offset_ field. Rename current_vma_offset_ to
3336 current_offset_. Add last_section_ field.
3337 (Memory_region::get_current_vma_address): Rename to
3338 get_current_address.
3339 (Memory_region::get_current_lma_address): Delete.
3340 (Memory_region::increment_vma_offset): Rename to
3341 increment_offset.
3342 (Memory_region::increment_lma_offset): Delete.
3343 (Memory_region::attributes_compatible): New method. Returns
3344 true if the provided section is compatible with the region.
3345 (Memory_region::get_last_section): New method. Returns the last
3346 section to use the region.
3347 (Memory_region::set_last_section): New method. Stores the last
3348 section to use the region.
3349 (Script_sections::block_in_region): New method. Returns true if
3350 a block of memory is contained within a region.
3351 (Script_sections::find_memory_region): New method. Locates a
3352 memory region to be used to set a VMA or LMA address.
3353 (Output_section_definition::set_section_addresses): Add code to
3354 check for addresses set by memory regions.
3355 (Output_segment::set_section_addresses): Remove memory region
3356 walking code.
3357 (Script_sections::create_segment): Add a warning if a header
3358 segment is created outside of any region.
3359 * script-sections.h (class Script_sections): Add prototypes for
3360 find_memory_region and block_in_region methods.
3361 * testsuite/memory_test.s: Use .long instead of .word.
3362 * testsuite/memory_test.t: Add some more output sections.
3363 * testsuite/memory_test.sh: Update expected output.
3364
a9bfd952
DK
33652010-10-02 Doug Kwan <dougkwan@google.com>
3366
3367 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
3368 defintion to symtab.h
3369 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
3370 declaration to defintion.
3371
bacff3ab
NC
33722010-10-01 Nick Clifton <nickc@redhat.com>
3373
3374 * expression.cc (eval): Replace dummy argument with NULL.
3375 (eval_maybe_dot): Check for a NULL result section pointer.
3376 (Symbol_expression::value): Likewise.
3377 (Dot_expression::value): Likewise.
3378 (BINARY_EXPRESSION): Likewise.
3379 (Max_expression::value): Likewise.
3380 (Min_expression::value): Likewise.
3381 (Absolute_expression::value): Likewise.
3382 (Addr_expression::value_from_output_section): Likewise.
3383 (Loaddddr_expression::value_from_output_section): Likewise.
3384 (Segment_start_expression::value): Likewise.
3385 * script-sections.cc
3386 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
3387 argument with NULL.
3388 (Sections_elememt_dot_assignment::set_section_addresses):
3389 Likewise.
3390 (Output_data_expression::do_write_to_buffer): Likewise.
3391 (Output_section_definition::finalize_symbols): Likewise.
3392 (Output_section_definition::set_section_addresses): Likewise.
3393
f81bc8b5
DK
33942010-09-30 Doug Kwan <dougkwan@google.com>
3395
3396 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
3397
c95e9f27
ST
33982010-09-28 Sriraman Tallam <tmsriram@google.com>
3399
3400 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 3401 function.
c95e9f27
ST
3402 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
3403 virtual function.
3404 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
3405 virtual function.
3406 * icf.cc (get_section_contents): Inline merge sections only when
3407 target allows it.
3408
3cac54d2
RW
34092010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3410
3411 * configure: Regenerate.
3412
2904037a
ILT
34132010-09-17 Ian Lance Taylor <iant@google.com>
3414
3415 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
3416 * testsuite/Makefile.am (memory_test.o): New target.
3417 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
3418 memory_test.t.
3419 * testsuite/Makefile.in: Rebuild.
2904037a 3420
bca7fb63
DK
34212010-09-17 Doug Kwan <dougkwan@google.com>
3422
3423 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
3424 defintion if relocation uses GOT entries of the symbol.
3425 * testsuite/icf_safe_test.sh: Fix test.
3426 * testsuite/icf_safe_so_test.sh: Fix test.
3427
4ef28648
CC
34282010-09-16 Cary Coutant <ccoutant@google.com>
3429
3430 * script_sections.cc (class Memory_region): Remove "NULL" from
3431 vector initializations.
3432
793990de
CC
34332010-09-15 Cary Coutant <ccoutant@google.com>
3434
3435 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
3436 Resolve forwarding symbols.
3437
81e015e2
DK
34382010-09-15 Doug Kwan <dougkwan@google.com>
3439
3440 * gold/testsuite/script_test_3.t: Add ARM special sections.
3441 * gold/testsuite/script_test_4.t: Same.
3442 * gold/testsuite/script_test_5.t: Same.
3443 * gold/testsuite/script_test_6.t: Same.
3444 * gold/testsuite/script_test_7.t: Same.
3445 * gold/testsuite/script_test_7.t: Same.
3446 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
3447
36171d64
CC
34482010-09-14 Cary Coutant <ccoutant@google.com>
3449
3450 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
3451 (Target_x86_64::Relocate::relocate_tls): Replace check for
3452 saw_tls_block_reloc_ with test for executable section.
3453
d89051bd
CC
34542010-09-12 Cary Coutant <ccoutant@google.com>
3455
3456 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
3457 position-independent executables to shared libraries need dynamic
3458 relocations.
3459 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
3460 position-independent executables.
3461 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
3462 * testsuite/Makefile.in: Regenerate.
3463
fca41f0f
NC
34642010-09-10 Nick Clifton <nickc@redhat.com>
3465
3466 PR gold/11997
3467 * testsuite/memory_test.t: Discard any sections that are not
3468 needed.
3469
6695e4b3
L
34702010-09-09 H.J. Lu <hongjiu.lu@intel.com>
3471
3472 PR gold/11996
3473 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
3474 "This::" to work around a bug in gcc 4.2.
3475
3476 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
3477
0f72bf6f
RÁE
34782010-09-09 Rafael Espindola <espindola@google.com>
3479
3480 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
3481 sections with different PF_X flags in the same segment.
3482 (Layout::find_first_load_seg): Search all segments to find the first
3483 one.
3484 * options.h (rosegment): New.
3485
34862010-09-08 Rafael Espindola <espindola@google.com>
a6577478 3487
05a79166 3488 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 3489
aa98ff75
DK
34902010-09-08 Doug Kwan <dougkwan@google.com>
3491
3492 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
3493 (Arm_relobj::do_relocate_sections): Add new parameter for output
3494 file to match the parent.
3495 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
3496 of local symbols instead of input values. Update code to track
3497 changes in gold::relocate_section.
3498 * object.cc (Sized_relobj::compute_final_local_value): New methods.
3499 (Sized_relobj::compute_final_local_value_internal): New methods.
3500 (Sized_relobj::do_finalize_local_symbols): Move code from loop
3501 body into private version of Sized_relobj::compute_final_local_value.
3502 Call the inline method.
3503 * object.h (Symbol_value::Symbol_value): Define destructor. Free
3504 merged symbol value if there is one.
3505 (Symbol_value::has_output_value): New method defintiion.
3506 (Sized_relobj::Compute_final_local_value_status): New enum type.
3507 (Sized_relobj::compute_final_local_value): New methods.
3508 (Sized_relobj::compute_final_local_value_internal): New methods.
3509 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
3510 and arm_cortex_a8.sh.
3511 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
3512 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
3513 New tests.
3514 * Makefile.in: Regenerate.
3515 * testsuite/arm_bl_out_of_range.s: Update test.
3516 * testsuite/thumb_bl_out_of_range.s: Ditto.
3517 * testsuite/thumb_blx_out_of_range.s: Ditto.
3518 * testsuite/arm_branch_out_of_range.sh: New file.
3519 * testsuite/arm_cortex_a8.sh: Ditto.
3520 * testsuite/arm_cortex_a8_b.s: Ditto.
3521 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
3522 * testsuite/arm_cortex_a8_b_local.s: Ditto.
3523 * testsuite/arm_cortex_a8_bl.s: Ditto.
3524 * testsuite/arm_cortex_a8_blx.s: Ditto.
3525 * testsuite/arm_cortex_a8_local.s: Ditto.
3526 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
3527 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
3528
05a79166
L
35292010-09-08 Rafael Espindola <espindola@google.com>
3530
3531 * Makefile.am (memory_test.stdout): Run readelf with -W.
3532 * Makefile.in: Regenerate.
3533 * testsuite/memory_test.sh: Make the regexps accept both 32 and
3534 64 bit output.
3535
33dbc701
RÁE
35362010-09-08 Rafael Espindola <espindola@google.com>
3537
3538 * script-sections.cc (Script_sections::add_memory_region): Convert
3539 field precision to int.
3540 * script.cc (script_set_section_region, script_set_section_region):
3541 Convert field precision to int.
3542
731ca54a
RÁE
35432010-09-08 Rafael Espindola <espindola@google.com>
3544
3545 * arm.cc (do_finalize_sections): Create the __exidx_start and
3546 __exdix_end symbols even when the section is missing.
3547
7f8cd844
NC
35482010-09-08 Nick Clifton <nickc@redhat.com>
3549
3550 * README: Remove claim that MEMORY is not supported.
3551 * expression.cc (script_exp_function_origin)
3552 (script_exp_function_length): Move from here to ...
3553 * script.cc: ... here.
3554 (script_set_section_region, script_add_memory)
3555 (script_parse_memory_attr, script_include_directive): New
3556 functions.
3557 * script-sections.cc
3558 (class Memory_region): New class.
3559 (class Output_section_definition): Add set_memory_region,
3560 set_section_vma, set_section_lma and get_section_name methods.
3561 (class Script_Sections): Add add_memory_region,
3562 find_memory_region, find_memory_region_origin,
3563 find_memory_region_length and set_memory_region methods.
3564 Have set_section_addresses method walk the list of set memory
3565 regions.
3566 Extend the print methos to display memory regions.
3567 * script-sections.h: Add prototypes for new methods.
3568 Add enum for MEMORY region attributes.
3569 * yyscript.y: Add support for parsing MEMORY regions.
3570 * script-c.h: Add prototypes for new functions.
3571 * testsuite/Makefile.am: Add test of MEMORY region functionality.
3572 * testsuite/Makefile.in: Regenerate.
3573 * testsuite/memory_test.sh: New script.
3574 * testsuite/memory_test.s: New assembler source file.
3575 * testsuite/memory_test.t: New linker script.
3576
a4649286
DK
35772010-08-27 Doug Kwan <dougkwan@google.com>
3578
3579 * gold/resolve.cc (Symbol_table::should_override): Let a weak
3580 reference override an existing dynamic weak reference.
3581 * testsuite/Makefile.am: Add new test dyn_weak_ref.
3582 * testsuite/Makefile.in: Regenerate.
3583 * testsuite/dyn_weak_ref.sh: New file.
3584 * testsuite/dyn_weak_ref_1.c: Ditto.
3585 * testsuite/dyn_weak_ref_2.c: Ditto.
3586
b56648ad
ILT
35872010-08-27 Ian Lance Taylor <iant@google.com>
3588
3589 * incremental.h (class Incremental_input_entry): Add virtual
3590 destructor.
3591
809313cb
ILT
35922010-08-27 Ian Lance Taylor <iant@google.com>
3593
3594 * testsuite/start_lib_test_3.c: Mark t3 as used.
3595
11e32464
NC
35962010-08-27 Nick Clifton <nickc@redhat.com>
3597
3598 * options.cc (version_script): Fix small typo in previous
3599 whitespace tidyup.
3600
ca09d69a
NC
36012010-08-25 Nick Clifton <nickc@redhat.com>
3602
3603 * archive.cc: Formatting fixes: Remove whitespace between
3604 typename and following asterisk. Remove whitespace between
3605 function name and opening parenthesis.
3606 * archive.h: Likewise.
3607 * arm.cc: Likewise.
3608 * attributes.cc: Likewise.
3609 * attributes.h: Likewise.
3610 * common.cc: Likewise.
3611 * copy-relocs.cc: Likewise.
3612 * dirsearch.h: Likewise.
3613 * dynobj.cc: Likewise.
3614 * ehframe.cc: Likewise.
3615 * ehframe.h: Likewise.
3616 * expression.cc: Likewise.
3617 * fileread.cc: Likewise.
3618 * fileread.h: Likewise.
3619 * gc.h: Likewise.
3620 * gold-threads.cc: Likewise.
3621 * gold.cc: Likewise.
3622 * i386.cc: Likewise.
3623 * icf.h: Likewise.
3624 * incremental-dump.cc: Likewise.
3625 * incremental.cc: Likewise.
3626 * layout.cc: Likewise.
3627 * layout.h: Likewise.
3628 * main.cc: Likewise.
3629 * merge.cc: Likewise.
3630 * merge.h: Likewise.
3631 * object.cc: Likewise.
3632 * object.h: Likewise.
3633 * options.cc: Likewise.
3634 * options.h: Likewise.
3635 * output.cc: Likewise.
3636 * output.h: Likewise.
3637 * plugin.cc: Likewise.
3638 * plugin.h: Likewise.
3639 * powerpc.cc: Likewise.
3640 * reloc.cc: Likewise.
3641 * script-c.h: Likewise.
3642 * script-sections.cc: Likewise.
3643 * script.cc: Likewise.
3644 * stringpool.cc: Likewise.
3645 * symtab.cc: Likewise.
3646 * symtab.h: Likewise.
3647 * target.cc: Likewise.
3648 * timer.cc: Likewise.
3649 * timer.h: Likewise.
3650 * version.cc: Likewise.
3651 * x86_64.cc: Likewise.
3652
b8fa8750
NC
36532010-08-24 Nick Clifton <nickc@redhat.com>
3654
3655 PR 11899
3656 * layout.cc (segment_precedes): Sort segments by their physical
3657 addresses, if they have been set.
3658
9919d93b
CC
36592010-08-23 Cary Coutant <ccoutant@google.com>
3660
3661 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
3662 symbols data.
3663 (Lib_group::include_member): Unlock object after deleting its
3664 symbols data.
3665 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
3666 the bug fixed here.
3667
97b4be1c
CC
36682010-08-19 Neil Vachharajani <nvachhar@google.com>
3669 Cary Coutant <ccoutant@google.com>
3670
3671 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
3672 constructor, and set_blocker.
3673 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
3674 readsyms_blocker_.
3675 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
3676 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
3677 * testsuite/Makefile.am (start_lib_test): New test case.
3678 * testsuite/Makefile.in: Regenerate.
3679 * testsuite/start_lib_test_main.c: New file.
3680 * testsuite/start_lib_test_1.c: New file.
3681 * testsuite/start_lib_test_2.c: New file.
3682 * testsuite/start_lib_test_3.c: New file.
3683
dd0b1884
ILT
36842010-08-19 Ian Lance Taylor <iant@google.com>
3685
3686 * Makefile.in: Rebuild with automake 1.11.1.
3687 * aclocal.m4: Likewise.
3688 * testsuite/Makefile.in: Likewise.
3689
7223e9ca
ILT
36902010-08-19 Ian Lance Taylor <iant@google.com>
3691
3692 PR 10893
3693 * i386.cc (class Output_data_plt_i386): Update declarations.
3694 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
3695 local_ifuncs_ fields.
3696 (Target_i386::do_plt_section_for_global): New function.
3697 (Target_i386::do_plt_section_for_local): New function.
3698 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
3699 parameter; change all callers. Initialize global_ifuncs_ and
3700 local_ifuncs_. If doing a static link define __rel_iplt_start and
3701 __rel_iplt_end.
3702 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
3703 (Output_data_plt_i386::add_local_ifunc_entry): New function.
3704 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
3705 symbols.
3706 (Target_i386::make_plt_section): New function, broken out of
3707 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
3708 (Target_i386::make_plt_entry): Call make_plt_section.
3709 (Target_i386::make_local_ifunc_plt_entry): New function.
3710 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
3711 (Target_i386::Scan::local): Handle IFUNC symbols. Add
3712 R_386_IRELATIVE to switch.
3713 (Target_i386::Scan::global): Likewise.
3714 (Target_i386::Relocate::relocate): Likewise.
3715 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
3716 switch.
3717 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
3718 (Target_x86_64::do_plt_section_for_global): New function.
3719 (Target_x86_64::do_plt_section_for_local): New function.
3720 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
3721 parameter; change all callers. If doing a static link define
3722 __rela_iplt_start and __rela_iplt_end.
3723 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
3724 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
3725 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
3726 to point to .plt.
3727 (Target_x86_64::make_local_ifunc_plt_entry): New function.
3728 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
3729 switch.
3730 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
3731 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
3732 R_X86_64_IRELATIVE to switch.
3733 (Target_x86_64::Scan::global): Likewise.
3734 (Target_x86_64::Relocate::relocate): Likewise.
3735 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
3736 switch.
3737 * target.h (class Target): Add plt_section_for_global and
3738 plt_section_for_local functions. Add do_plt_section_for_global
3739 and do_plt_section_for_local virtual functions.
3740 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
3741 clarifying comments.
3742 (Symbol::use_plt_offset): Handle IFUNC symbol.
3743 * object.cc (Sized_relobj::Sized_relobj): Initialize
3744 local_plt_offsets_.
3745 (Sized_relobj::local_has_plt_offset): New function.
3746 (Sized_relobj::local_plt_offset): New function.
3747 (Sized_relobj::set_local_plt_offset): New function.
3748 (Sized_relobj::do_count): Handle IFUNC symbol.
3749 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
3750 a bit away from input_shndx_ field. Add set_is_func_symbol and
3751 is_ifunc_symbol functions.
3752 (class Sized_relobj): Update declarations. Remove Tls_got_entry
3753 and Local_tls_got_offsets. Define Local_plt_offsets. Add
3754 local_plt_offsets_ field.
3755 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
3756 * output.h (class Output_section_data): Add non-const
3757 output_section function.
3758 (class Output_data_got): Update declarations.
3759 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
3760 Add use_plt_offset parameter to global and local constructors.
3761 Change all callers. Change local_sym_index_ field to 31 bits.
3762 Change GSYM_CODE and CONSTANT_CODE accordingly.
3763 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
3764 doing a static link don't set sh_link field.
3765 (Output_data_got::Got_entry::write): Use PLT offset if
3766 appropriate.
3767 (Output_data_got::add_global_plt): New function.
3768 (Output_data_got::add_local_plt): New function.
3769 * target-reloc.h (relocate_section): Handle IFUNC symbol.
3770 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
3771 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
3772 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
3773 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
3774 IFUNC conditional.
3775 * testsuite/ifunc-sel.h: New file.
3776 * testsuite/ifuncmain1.c: New file.
3777 * testsuite/ifuncmain1vis.c: New file.
3778 * testsuite/ifuncmod1.c: New file.
3779 * testsuite/ifuncdep2.c: New file.
3780 * testsuite/ifuncmain2.c: New file.
3781 * testsuite/ifuncmain3.c: New file.
3782 * testsuite/ifuncmod3.c: New file.
3783 * testsuite/ifuncmain4.c: New file.
3784 * testsuite/ifuncmain5.c: New file.
3785 * testsuite/ifuncmod5.c: New file.
3786 * testsuite/ifuncmain6pie.c: New file.
3787 * testsuite/ifuncmod6.c: New file.
3788 * testsuite/ifuncmain7.c: New file.
3789 * configure, testsuite/Makefile.in: Rebuild.
3790
56f75c03
ILT
37912010-08-18 Ian Lance Taylor <iant@google.com>
3792
3793 * incremental.cc
3794 (Output_section_incremental_inputs::write_input_files): Add cast
3795 to avoid signed/unsigned comparison warning.
3796 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3797
55455f89
CC
37982010-08-12 Cary Coutant <ccoutant@google.com>
3799
3800 * common.cc (Sort_commons::operator()): Remove unnecessary code.
3801
e2054bcb
ILT
38022010-08-13 Ian Lance Taylor <iant@google.com>
3803
3804 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
3805
74f67560
DK
38062010-08-12 Cary Coutant <ccoutant@google.com>
3807 Doug Kwan <dougkwan@google.com>
3808
3809 * resolve.cc (Symbol_table::should_override): When a weak dynamic
3810 defintion overrides non-weak undef, remember that the original undef
3811 is not weak.
3812 * symtab.cc (Symbol_table::sized_write_global): For undef without
3813 an original weak binding, set binding to global in output.
3814 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
3815 * testsuite/Makefile.in: Regenerate.
3816 * testsuite/strong_ref_weak_def.sh: New file.
3817 * testsuite/strong_ref_weak_def_1.c: Ditto.
3818 * testsuite/strong_ref_weak_def_2.c: Ditto.
3819
d1238d12
CC
38202010-08-12 Cary Coutant <ccoutant@google.com>
3821
3822 * testsuite/incremental_test.sh: Rewrite.
3823 * testsuite/incremental_test_1.c: Rewrite.
3824 * testsuite/incremental_test_2.c: Rewrite.
3825
0e70b911
CC
38262010-08-12 Cary Coutant <ccoutant@google.com>
3827
3828 * arm.cc (Target_arm::got_size): Add const.
3829 (Target_arm::got_entry_count): New function.
3830 (Target_arm::plt_entry_count): New function.
3831 (Target_arm::first_plt_entry_offset): New function.
3832 (Target_arm::plt_entry_size): New function.
3833 (Output_data_plt_arm::entry_count): New function.
3834 (Output_data_plt_arm::first_plt_entry_offset): New function.
3835 (Output_data_plt_arm::get_plt_entry_size): New function.
3836 * i386.cc (Target_i386::got_size): Add const.
3837 (Target_i386::got_entry_count): New function.
3838 (Target_i386::plt_entry_count): New function.
3839 (Target_i386::first_plt_entry_offset): New function.
3840 (Target_i386::plt_entry_size): New function.
3841 (Output_data_plt_i386::entry_count): New function.
3842 (Output_data_plt_i386::first_plt_entry_offset): New function.
3843 (Output_data_plt_i386::get_plt_entry_size): New function.
3844 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
3845 find_incremental_inputs_sections. Dump incremental_got_plt section.
3846 * incremental.cc: Include target.h.
3847 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
3848 parameter. Adjust all callers. Find incremental_got_plt section.
3849 (Incremental_inputs::create_data_sections): Create incremental_got_plt
3850 section.
3851 (Output_section_incremental_inputs::set_final_data_size): Calculate
3852 size of incremental_got_plt section.
3853 (Output_section_incremental_inputs::do_write): Write the
3854 incremental_got_plt section.
3855 (Got_plt_view_info): New struct.
3856 (Local_got_offset_visitor): New class.
3857 (Global_got_offset_visitor): New class.
3858 (Global_symbol_visitor_got_plt): New class.
3859 (Output_section_incremental_inputs::write_got_plt): New function.
3860 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
3861 Add parameter. Adjust all callers.
3862 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
3863 (Incremental_inputs::got_plt_section): New function.
3864 (Incremental_inputs::got_plt_section_): New data member.
3865 (Incremental_got_plt_reader): New class.
3866 * layout.cc (Layout::create_incremental_info_sections): Add the
3867 incremental_got_plt section.
3868 * object.h (Got_offset_list::get_list): New function.
3869 (Got offset_list::for_all_got_offsets): New function.
3870 (Sized_relobj::local_got_offset_list): New function.
3871 * powerpc.cc (Target_powerpc::got_size): Add const.
3872 (Target_powerpc::got_entry_count): New function.
3873 (Target_powerpc::plt_entry_count): New function.
3874 (Target_powerpc::first_plt_entry_offset): New function.
3875 (Target_powerpc::plt_entry_size): New function.
3876 (Output_data_plt_powerpc::entry_count): New function.
3877 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
3878 (Output_data_plt_powerpc::get_plt_entry_size): New function.
3879 * sparc.cc (Target_sparc::got_size): Add const.
3880 (Target_sparc::got_entry_count): New function.
3881 (Target_sparc::plt_entry_count): New function.
3882 (Target_sparc::first_plt_entry_offset): New function.
3883 (Target_sparc::plt_entry_size): New function.
3884 (Output_data_plt_sparc::entry_count): New function.
3885 (Output_data_plt_sparc::first_plt_entry_offset): New function.
3886 (Output_data_plt_sparc::get_plt_entry_size): New function.
3887 * symtab.h (Symbol::got_offset_list): New function.
3888 (Symbol_table::for_all_symbols): New function.
3889 * target.h (Sized_target::got_entry_count): New function.
3890 (Sized_target::plt_entry_count): New function.
3891 (Sized_target::plt_entry_size): New function.
3892 * x86_64.cc (Target_x86_64::got_size): Add const.
3893 (Target_x86_64::got_entry_count): New function.
3894 (Target_x86_64::plt_entry_count): New function.
3895 (Target_x86_64::first_plt_entry_offset): New function.
3896 (Target_x86_64::plt_entry_size): New function.
3897 (Output_data_plt_x86_64::entry_count): New function.
3898 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
3899 (Output_data_plt_x86_64::get_plt_entry_size): New function.
3900
09ec0418
CC
39012010-08-12 Cary Coutant <ccoutant@google.com>
3902
3903 * archive.cc: Include incremental.h.
3904 (Archive::Archive): Initialize incremental_info_.
3905 (Archive::include_member): Record archive members in incremental info.
3906 (Add_archive_symbols::run): Record begin and end of an archive in
3907 incremental info.
3908 (Lib_group::include_member): Record objects in incremental info.
3909 * archive.h (Incremental_archive_entry): Forward declaration.
3910 (Archive::set_incremental_info): New member function.
3911 (Archive::incremental_info): New member function.
3912 (Archive::Unused_symbol_iterator): New class.
3913 (Archive::unused_symbols_begin): New member function.
3914 (Archive::unused_symbols_end): New member function.
3915 (Archive::incremental_info_): New data member.
3916 * incremental-dump.cc (find_input_containing_global): New function.
3917 (dump_incremental_inputs): Dump new incremental info sections.
3918 * incremental.cc: Include symtab.h.
3919 (Output_section_incremental_inputs): New class.
3920 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
3921 new incremental info sections.
3922 (Sized_incremental_binary::do_check_inputs): Likewise.
3923 (Incremental_inputs::report_archive): Remove.
3924 (Incremental_inputs::report_archive_begin): New function.
3925 (Incremental_inputs::report_archive_end): New function.
3926 (Incremental_inputs::report_object): New function.
3927 (Incremental_inputs::finalize_inputs): Remove.
3928 (Incremental_inputs::report_input_section): New function.
3929 (Incremental_inputs::report_script): Rewrite.
3930 (Incremental_inputs::finalize): Do nothing but finalize string table.
3931 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
3932 (Incremental_inputs::sized_create_inputs_section_data): Remove.
3933 (Incremental_inputs::create_data_sections): New function.
3934 (Incremental_inputs::relocs_entsize): New function.
3935 (Output_section_incremental_inputs::set_final_data_size): New function.
3936 (Output_section_incremental_inputs::do_write): New function.
3937 (Output_section_incremental_inputs::write_header): New function.
3938 (Output_section_incremental_inputs::write_input_files): New function.
3939 (Output_section_incremental_inputs::write_info_blocks): New function.
3940 (Output_section_incremental_inputs::write_symtab): New function.
3941 * incremental.h (Incremental_script_entry): Forward declaration.
3942 (Incremental_object_entry): Forward declaration.
3943 (Incremental_archive_entry): Forward declaration.
3944 (Incremental_inputs): Forward declaration.
3945 (Incremental_inputs_header_data): Remove.
3946 (Incremental_inputs_header): Remove.
3947 (Incremental_inputs_header_write): Remove.
3948 (Incremental_inputs_entry_data): Remove.
3949 (Incremental_inputs_entry): Remove.
3950 (Incremental_inputs_entry_write): Remove.
3951 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
3952 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
3953 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
3954 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
3955 Likewise.
3956 (Incremental_input_entry): New class.
3957 (Incremental_script_entry): New class.
3958 (Incremental_object_entry): New class.
3959 (Incremental_archive_entry): New class.
3960 (Incremental_inputs::Incremental_inputs): Initialize new data members.
3961 (Incremental_inputs::report_inputs): Remove.
3962 (Incremental_inputs::report_archive): Remove.
3963 (Incremental_inputs::report_archive_begin): New function.
3964 (Incremental_inputs::report_archive_end): New function.
3965 (Incremental_inputs::report_object): Change prototype.
3966 (Incremental_inputs::report_input_section): New function.
3967 (Incremental_inputs::report_script): Change prototype.
3968 (Incremental_inputs::get_reloc_count): New function.
3969 (Incremental_inputs::set_reloc_count): New function.
3970 (Incremental_inputs::create_data_sections): New function.
3971 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
3972 (Incremental_inputs::inputs_section): New function.
3973 (Incremental_inputs::symtab_section): New function.
3974 (Incremental_inputs::relocs_section): New function.
3975 (Incremental_inputs::get_stringpool): Add const.
3976 (Incremental_inputs::command_line): Add const.
3977 (Incremental_inputs::inputs): Remove.
3978 (Incremental_inputs::command_line_key): New function.
3979 (Incremental_inputs::input_file_count): New function.
3980 (Incremental_inputs::input_files): New function.
3981 (Incremental_inputs::relocs_entsize): New function.
3982 (Incremental_inputs::sized_create_inputs_section_data): Remove.
3983 (Incremental_inputs::finalize_inputs): Remove.
3984 (Incremental_inputs::Input_info): Remove.
3985 (Incremental_inputs::lock_): Remove.
3986 (Incremental_inputs::inputs_): Change type.
3987 (Incremental_inputs::inputs_map_): Remove.
3988 (Incremental_inputs::current_object_entry_): New data member.
3989 (Incremental_inputs::inputs_section_): New data member.
3990 (Incremental_inputs::symtab_section_): New data member.
3991 (Incremental_inputs::relocs_section_): New data member.
3992 (Incremental_inputs::reloc_count_): New data member.
3993 (Incremental_inputs_reader): New class.
3994 (Incremental_symtab_reader): New class.
3995 (Incremental_relocs_reader): New class.
3996 * layout.cc (Layout::finalize): Move finalization of incremental info
3997 and creation of incremental info sections to follow finalization of
3998 symbol table. Set offsets for postprocessing sections.
3999 (Layout::create_incremental_info_sections): Call
4000 Incremental_inputs::create_data_sections. Add incremental symtab
4001 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
4002 sections to layout after input sections.
4003 * layout.h (struct Timespec): Forward declaration.
4004 (Layout::incremental_inputs): Add const.
4005 (Layout::create_incremental_info_sections): Add parameter.
4006 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
4007 * object.cc: Include incremental.h.
4008 (Relobj::finalize_incremental_relocs): New function.
4009 (Sized_relobj::do_layout): Record input sections in incremental info.
4010 * object.h (Object::output_section): New function.
4011 (Object::output_section_offset): Moved from Relobj.
4012 (Object::get_incremental_reloc_base): New function.
4013 (Object::get_incremental_reloc_count): New function.
4014 (Object::do_output_section): New function.
4015 (Object::do_output_section_offset): Moved from Relobj.
4016 (Object::do_get_incremental_reloc_base): New function.
4017 (Object::do_get_incremental_reloc_count): New function.
4018 (Object::Object): Initialize new data members.
4019 (Relobj::output_section): Renamed do_output_section and moved to
4020 protected.
4021 (Relobj::output_section_offset): Moved to Object.
4022 (Relobj::do_get_incremental_reloc_base): New function.
4023 (Relobj::do_get_incremental_reloc_count): New function.
4024 (Relobj::allocate_incremental_reloc_counts): New function.
4025 (Relobj::count_incremental_reloc): New function.
4026 (Relobj::finalize_incremental_relocs): New function.
4027 (Relobj::next_incremental_reloc_index): New function.
4028 (Relobj::reloc_counts_): New data member.
4029 (Relobj::reloc_bases_): New data member.
4030 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
4031 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
4032 (Sized_relobj::incremental_relocs_scan): New function.
4033 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4034 (Sized_relobj::incremental_relocs_write): New function.
4035 (Sized_relobj::incremental_relocs_write_reltype): New function.
4036 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
4037 incremental link.
4038 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
4039 archives and object files elsewhere.
4040 (Add_symbols::run): Report object files here.
4041 (Finish_group::run): Report end of archive at end of group.
4042 * reloc.cc: Include layout.h, incremental.h.
4043 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
4044 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
4045 (Sized_relobj::incremental_relocs_scan): New function.
4046 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4047 (Sized_relobj::do_relocate_sections): Write incremental relocations.
4048 (Sized_relobj::incremental_relocs_write): New function.
4049 (Sized_relobj::incremental_relocs_write_reltype): New function.
4050 * script.cc (read_input_script): Rewrite test for incremental link.
4051 Change call to Incremental_inputs::report_script.
4052 * symtab.h (Symbol_table::first_global_index): New function.
4053 (Symbol_table::output_count): New function.
4054
ce0d1972
DK
40552010-08-12 Doug Kwan <dougkwan@google.com>
4056
4057 * arm.cc (Target_arm::merge_object_attributes): Check command line
4058 options --no-wchar-size-warning and --no-enum-size-warning.
4059 * options.h (General_options): Add ld-compatible options
4060 --no-enum-size-warning and --no-wchar-size-warning.
4061
6e5710ce
ILT
40622010-08-04 Ian Lance Taylor <iant@google.com>
4063
4064 * x86_64.cc (Target_x86_64::Scan::local): Use
4065 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
4066 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
4067 (Target_x86_64::Scan::global): Likewise.
4068 (Target_x86_64::Relocate::relocate): Likewise.
4069 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
4070 Likewise.
4071
fef830db
CC
40722010-08-03 Cary Coutant <ccoutant@google.com>
4073
4074 * merge.cc (Output_merge_string::do_add_input_section): Count strings
4075 to reserve space in merged_strings vector. Keep total input size
4076 for stats.
4077 (Output_merge_string::do_print_merge_stats): Print total input size.
4078 * merge.h (Output_merge_string): Add input_size_ field.
4079 * stringpool.cc (Stringpool_template::string_length): Move
4080 implementations out of Stringpool_template class and place in
4081 stringpool.h.
4082 * stringpool.h (string_length): Move out of Stringpool_template.
4083
1e3811b0
ILT
40842010-08-03 Ian Lance Taylor <iant@google.com>
4085
4086 PR 11712
4087 * layout.cc (relaxation_loop_body): If address of load segment is
4088 set, adjust address to include headers if possible.
4089
7af0c620
ILT
40902010-08-03 Ian Lance Taylor <iant@google.com>
4091
4092 * version.cc (version_string): Bump to 1.10.
4093
22f0da72
ILT
40942010-08-03 Ian Lance Taylor <iant@google.com>
4095
4096 PR 11805
4097 * layout.h (enum Output_section_order): Define.
4098 (class Layout): Update declarations.
4099 * layout.cc (Layout::get_output_section): Add order parameter.
4100 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
4101 is_first_non_relro parameters. Change all callers.
4102 (Layout::choose_output_section): Likewise.
4103 (Layout::add_output_section_data): Likewise.
4104 (Layout::make_output_section): Likewise. Set order.
4105 (Layout::default_section_order): New function.
4106 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
4107 * output.cc (Output_section::Output_section): Initialize order_.
4108 Don't initialize deleted fields.
4109 (Output_segment::Output_segment): Don't initialize deleted
4110 fields.
4111 (Output_segment::add_output_section_to_load): New function
4112 replacing add_output_section. Change all callers to call this or
4113 add_output_section_to_nonload.
4114 (Output_segment::add_output_section_to_nonload): New function.
4115 (Output_segment::remove_output_section): Rewrite.
4116 (Output_segment::add_initial_output_data): Likewise.
4117 (Output_segment::has_any_data_sections): Likewise.
4118 (Output_segment::is_first_section_relro): Likewise.
4119 (Output_segment::maximum_alignment): Likewise.
4120 (Output_segment::has_dynamic_reloc): New function replacing
4121 dynamic_reloc_count. Change all callers.
4122 (Output_segment::has_dynamic_reloc_list): New function replacing
4123 dynamic_reloc_count_list. Change all callers.
4124 (Output_segment::set_section_addresses): Rewrite.
4125 (Output_segment::set_offset): Rewrite.
4126 (Output_segment::find_first_and_last_list): Remove.
4127 (Output_segment::set_tls_offsets): Rewrite.
4128 (Output_segment::first_section_load_address): Likewise.
4129 (Output_segment::output_section_count): Likewise.
4130 (Output_segment::section_with_lowest_load_address): Likewise.
4131 (Output_segment::write_section_headers): Likewise.
4132 (Output_segment::print_sections_to_map): Likewise.
4133 * output.h (class Output_data): Remove dynamic_reloc_count_
4134 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
4135 (Output_data::add_dynamic_reloc): Rewrite.
4136 (Output_data::has_dynamic_reloc): New function.
4137 (Output_data::dynamic_reloc_count): Remove.
4138 (class Output_section): Add order_ field. Remvoe is_relro_local_,
4139 is_last_relro_, is_first_non_relro_, is_interp_,
4140 is_dynamic_linker_section_ fields. Add order and set_order
4141 functions. Remove is_relro_local, set_is_relro_local,
4142 is_last_relro, set_is_last_relro, is_first_non_relro,
4143 set_is_first_non_relro functions, is_interp, set_is_interp,
4144 is_dynamic_linker_section, and set_is_dynamic_linker_section
4145 functions.
4146 (class Output_segment): Change Output_data_list from std::list to
4147 std:;vector. Add output_lists_ field. Remove output_data_ and
4148 output_bss_ fields. Update declarations.
4149
3ff2ccb0
ILT
41502010-08-02 Ian Lance Taylor <iant@google.com>
4151
4152 * arm.cc (Target_arm::gc_process_relocs): Use typename.
4153 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
4154 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
4155
88a4108b
ILT
41562010-08-02 Ian Lance Taylor <iant@google.com>
4157
4158 PR 11855
4159 * script.cc (Script_options::Script_options): Initialize
4160 symbol_definitions_ and symbol_references_.
4161 (Script_options::add_symbol_assignment): Update
4162 symbol_definitions_ and symbol_references_.
4163 (Script_options::add_symbol_reference): New function.
4164 (script_symbol): New function.
4165 * script.h (class Script_options): Add symbol_definitions_ and
4166 symbol_references_ fields.
4167 (Script_options::referenced_const_iterator): New type.
4168 (Script_options::referenced_begin): New function.
4169 (Script_options::referenced_end): New function.
4170 (Script_options::is_referenced): New function.
4171 (Script_options::any_unreferenced): New function.
4172 * script-c.h (script_symbol): Declare.
4173 * yyscript.y (exp): Call script_symbol.
4174 * symtab.cc: Include "script.h".
4175 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
4176 Change all callers. Check symbols referenced by scripts.
4177 (Symbol_table::add_undefined_symbols_from_command_line): Add
4178 layout parameter. Change all callers.
4179 (Symbol_table::do_add_undefined_symbols_from_command_line):
4180 Likewise. Break out loop body. Check symbols referenced by
4181 scripts.
4182 (Symbol_table::add_undefined_symbol_from_command_line): New
4183 function broken out of
4184 do_add_undefined_symbols_from_command_line.
4185 * symtab.h (class Symbol_table): Update declarations.
4186 * archive.cc: Include "layout.h".
4187 (Archive::should_include_member): Add layout parameter. Change
4188 all callers. Check for symbol mentioned in expression.
4189 * archive.h (class Archive): Update declaration.
4190 * object.cc (Sized_relobj::do_should_include_member): Add layout
4191 parameter.
4192 * object.h (Object::should_include_member): Add layout parameter.
4193 Change all callers.
4194 (Object::do_should_include_member): Add layout parameter.
4195 (class Sized_relobj): Update declaration.
4196 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
4197 parameter.
4198 * dynobj.h (class Sized_dynobj): Update declaration.
4199 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
4200 layout parameter.
4201 * plugin.h (class Sized_pluginobj): Update declaration.
4202
5f1ab67a
ILT
42032010-08-02 Ian Lance Taylor <iant@google.com>
4204
4205 PR 11866
4206 * output.cc (Output_segment::set_offset): Search for the first and
4207 last sections rather than assuming that the list is in order.
4208 (Output_segment::find_first_and_last_list): New function.
4209 * output.h (class Output_segment): Update declarations.
4210 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
4211 (relro_strip_test_SOURCES): New variable.
4212 (relro_strip_test_DEPENDENCIES): New variable.
4213 (relro_strip_test_LDFLAGS): New variable.
4214 (relro_strip_test_LDADD): New variable.
4215 (relro_strip_test.so): New target.
4216
a8df5856
ILT
42172010-08-02 Ian Lance Taylor <iant@google.com>
4218
4219 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
4220 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
4221 (Target_i386::got_tlsdesc_section): New function.
4222 (Target_i386::got_section): Create space for GOT entries for
4223 TLSDESC relocations.
4224 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
4225 R_386_TLS_GOTDESC.
4226 (Target_i386::Scan::global): Likewise.
4227 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
4228 using TLSDESC GOT.
4229 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
4230 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
4231 (Target_x86_64::got_tlsdesc_section): New function.
4232 (Target_x86_64::got_section): Create space for GOT entries for
4233 TLSDESC relocations.
4234 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
4235 R_386_TLS_GOTDESC.
4236 (Target_x86_64::Scan::global): Likewise.
4237 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
4238 using TLSDESC GOT.
4239
0c10a0a6
ILT
42402010-08-02 Ian Lance Taylor <iant@google.com>
4241
4242 * testsuite/final_layout.sh: Use dc to convert from hex to
4243 decimal.
4244
41cbeecc
ST
42452010-07-29 Sriraman Tallam <tmsriram@google.com>
4246
4247 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
4248 paramter to the call to gold::gc_process_relocs.
4249 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
4250 paramter to the call to gold::gc_process_relocs.
4251 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
4252 parameter to the call to gold::gc_process_relocs.
4253 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
4254 template parameter to the call to gold::gc_process_relocs.
4255 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
4256 paramter to the call to gold::gc_process_relocs.
4257 * gc.h (get_embedded_addend_size): New function.
4258 (gc_process_relocs): Save the size of the reloc for use by ICF.
4259 * icf.cc (get_section_contents): Get the addend from the text section
4260 for SHT_REL relocation sections.
4261 * icf.h (Icf::Reloc_addend_size_info): New typedef.
4262 (Icf::Reloc_info): Add new member reloc_addend_size_info.
4263 * int_encoding.h (read_from_pointer): New overloaded function.
4264 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
4265 * testsuite/icf_sht_rel_addend_test.sh: New file.
4266 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
4267 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
4268
6ea55b82
RW
42692010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4270
4271 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
4272 * Makefile.in: Regenerate.
4273 * testsuite/Makefile.in: Regenerate.
4274
9691462b
ILT
42752010-07-27 Jeffrey Yasskin <jyasskin@google.com>
4276
4277 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
4278 * gold/testsuite/debug_msg.cc: Likewise.
4279 * gold/testsuite/odr_violation1.cc
4280 * gold/testsuite/odr_violation2.cc
4281
76897331
CC
42822010-07-21 Cary Coutant <ccoutant@google.com>
4283
4284 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
4285 string, and length fields.
4286 (Output_merge_string::Merged_strings_list): New type.
4287 (Output_merge_string::Merged_strings_lists): New typedef.
4288 (Output_merge_string): Replace merged_strings_ with
4289 merged_strings_lists_.
4290 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
4291 Merged_strings_list per input object and section. Don't store pointer
4292 to the string. Don't store length with each merged string entry.
4293 (Output_merge_string::finalize_merged_data): Loop over list of merged
4294 strings lists. Recompute length of each merged string.
4295
78384e8f
CC
42962010-07-15 Cary Coutant <ccoutant@google.com>
4297
4298 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
4299 here.
4300
783659f9
ILT
43012010-07-14 Ian Lance Taylor <iant@google.com>
4302
4303 * descriptors.cc (Descriptors::open): Report correct name in error
4304 message.
4305
131687b4
DK
43062010-07-13 Doug Kwan <dougkwan@google.com>
4307
4308 * arm.cc (Arm_input_section::Arm_input_section): For a
4309 SHT_ARM_EXIDX section, always keeps the input sections.
4310 (Arm_input_section::set_exidx_section_link): New method.
4311 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
4312 has_errors_ to false.
4313 (Arm_exidx_input_section::has_errors,
4314 Arm_exidx_input_section::set_has_errors): New methods.
4315 (Arm_exidx_input_section::has_errors_): New data member.
4316 (Arm_relobj::get_exidx_shndx_list): New method.
4317 (Arm_output_section::append_text_sections_to_list): Do not skip
4318 section without SHF_EXECINSTR.
4319 (Arm_output_section::fix_exidx_coverage): Skip input sections with
4320 errors.
4321 (Arm_relobj::make_exidx_input_section): Add new parameter for text
4322 section header. Make error messages more verbose. Check for
4323 a non-executable section linked to an EXIDX section.
4324 (Arm_relobj::do_read_symbols): Remove error checking, which has been
4325 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
4326 check that there is no deferred EXIDX section if we exit early.
4327 Instead of not making an EXIDX section in case of an error, make one
4328 and set the has_errors flag of it.
4329 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
4330 in a relocatable link.
4331 (Target_arm::do_relax): Look for the EXIDX output section instead of
4332 assuming that it is called .ARM.exidx.
4333 (Target_arm::fix_exidx_coverage): Add a new parameter for input
4334 section list. Do not check for SHF_EXECINSTR section flags but
4335 skip any input section with errors.
4336 * output.cc (Output_section::Output_section): Initialize
4337 always_keeps_input_sections_ to false.
4338 (Output_section::add_input_section): Check for
4339 always_keeps_input_sections_.
4340 * output.h (Output_section::always_keeps_input_sections,
4341 Output_section::set_always_keeps_input_sections): New methods.
4342 (Output_section::always_keeps_input_sections): New data member.
4343
69517287
RÁE
43442010-07-13 Rafael Espindola <espindola@google.com>
4345
4346 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
4347 * fileread.h (Input_file): Add try_extra_search_path and find_file.
4348
82742395
ILT
43492010-07-13 Philip Herron <herron.philip@googlemail.com>
4350 Ian Lance Taylor <iant@google.com>
4351
4352 * output.h (Output_section_lookup_maps::add_merge_section):
4353 Correct check of whether value was inserted.
4354 (Output_section_lookup_maps::add_merge_input_section): Likewise.
4355 (Output_section_lookup_maps::add_relaxed_input_section):
4356 Likewise.
4357 * arm.cc (Target_arm::got_section): Remove used local os.
4358 * i386.cc (Target_i386::got_section): Likewise.
4359 * x86_64.cc (Target_x86_64::got_section): Likewise.
4360 * sparc.cc (Target_sparc::got_section): Likewise.
4361 (Target_sparc::relocate): Remove unused local have_got_offset.
4362 * powerpc.cc (Target_powerpc::relocate): Likewise.
4363
f2d707b5
ILT
43642010-07-13 Ian Lance Taylor <iant@google.com>
4365
241531d6
ILT
4366 * compressed_output.cc (zlib_decompress): Fix signature in
4367 !HAVE_ZLIB_H case.
4368
f2d707b5
ILT
4369 * archive.cc (Archive::include_member): Unlock an external member
4370 of a thin archive. Don't bother to delete an object we know is
4371 NULL.
4372
a2e47362
CC
43732010-07-12 Cary Coutant <ccoutant@google.com>
4374
4375 * compressed_output.cc (zlib_decompress): New function.
4376 (get_uncompressed_size): New function.
4377 (decompress_input_section): New function.
4378 * compressed_output.h (get_uncompressed_size): New function.
4379 (decompress_input_section): New function.
4380 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
4381 Handle compressed debug sections.
4382 * layout.cc (is_compressed_debug_section): New function.
4383 (Layout::output_section_name): Map compressed section names to
4384 canonical names.
4385 * layout.h (is_compressed_debug_section): New function.
4386 (is_debug_info_section): Recognize compressed debug sections.
4387 * merge.cc: Include compressed_output.h.
4388 (Output_merge_data::do_add_input_section): Handle compressed
4389 debug sections.
4390 (Output_merge_string::do_add_input_section): Handle compressed
4391 debug sections.
4392 * object.cc: Include compressed_output.h.
4393 (Sized_relobj::Sized_relobj): Initialize new data members.
4394 (build_compressed_section_map): New function.
4395 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
4396 * object.h (Object::section_is_compressed): New method.
4397 (Object::do_section_is_compressed): New method.
4398 (Sized_relobj::Compressed_section_map): New type.
4399 (Sized_relobj::do_section_is_compressed): New method.
4400 (Sized_relobj::compressed_sections_): New data member.
4401 * output.cc (Output_section::add_input_section): Handle compressed
4402 debug sections.
4403 * reloc.cc: Include compressed_output.h.
4404 (Sized_relobj::write_sections): Handle compressed debug sections.
4405
ce279a62
CC
44062010-07-08 Cary Coutant <ccoutant@google.com>
4407
4408 * resolve.cc (Symbol_table::resolve): Remember whether undef was
4409 weak when resolving to a dynamic def.
4410 (Symbol_table::should_override): Add adjust_dyndef flag; set it
4411 for weak undef/dynamic def cases. Adjust callers.
4412 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
4413 undef_binding_weak_.
4414 (Symbol_table::sized_write_globals): Adjust symbol binding.
4415 (Symbol_table::sized_write_symbol): Add binding parameter.
4416 * symtab.h (Symbol::set_undef_binding): New method.
4417 (Symbol::is_undef_binding_weak): New method.
4418 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
4419 (Symbol_table::should_override): Add new parameter.
4420 (Symbol_table::sized_write_symbol): Add new parameter.
4421
4422 * testsuite/weak_undef_file1.cc: Add new test case.
4423 * testsuite/weak_undef_file2.cc: Fix header comment.
4424 * testsuite/weak_undef_test.cc: Add new test case.
4425
b2286c10
DK
44262010-06-29 Doug Kwan <dougkwan@google.com>
4427
4428 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
4429 Initialize USE_SYMBOL_.
4430 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
4431 definition.
4432 (Arm_reloc_property::uses_symbol_): New data member declaration.
4433 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
4434 uses symbol value and symbol is undefined but not weakly undefined.
4435
4802450a
RÁE
44362010-06-28 Rafael Espindola <espindola@google.com>
4437
4438 * plugin.cc (Plugin::load): Use dlerror.
4439
e5ca47ba
ILT
44402010-06-26 Jeffrey Yaskin <jyasskin@google.com>
4441
4442 * symtab.cc (detect_odr_violations): When reporting an ODR
4443 violation, report an object where the symbol is defined.
4444
8a75a161
DK
44452010-06-25 Doug Kwan <dougkwan@google.com>
4446
4447 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
4448 (Target_arm::section_may_have_icf_unsafe_pointers): New method
4449 definition.
4450 (Target_arm::Scan::local_reloc_may_be_function_pointer,
4451 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
4452 target hook to detect function points.
4453 (Target_arm::Scan::possible_function_pointer_reloc): New method.
4454 * icf.h (Icf::check_section_for_function_pointers): Change type of
4455 parameter SECTION_NAME to const reference to std::string. Use
4456 target hook to determine if section may have unsafe pointers.
4457 * target.h (Target::section_may_have_icf_unsafe_pointers): New
4458 method definition.
4459
42218b9f
RÁE
44602010-06-21 Rafael Espindola <espindola@google.com>
4461
4462 * fileread.cc (Input_file::find_fie): New
4463 (Input_file::open): Use Input_file::find_fie.
4464 * fileread.h (Input_file::find_fie): New
4465 * plugin.cc (set_extra_library_path): New.
4466 (Plugin::load): Add set_extra_library_path to the transfer vector.
4467 (Plugin_manager::set_extra_library_path): New.
4468 (Plugin_manager::add_input_file): Use the extra search path if set.
4469 (set_extra_library_path(): New.
4470 * plugin.h (Plugin_manager): Add set_extra_library_path and
4471 extra_search_path_.
4472
a0506cca
CC
44732010-06-19 Cary Coutant <ccoutant@google.com>
4474
4475 * layout.cc (gdb_sections): Add .debug_types.
4476 (lines_only_debug_sections): Likewise.
4477
6508b958
RÁE
44782010-06-18 Rafael Espindola <espindola@google.com>
4479
4480 * plugin.cc (add_input_file,add_input_library)
4481 (Plugin_manager::add_input_file): Make filename arguments const.
4482 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
4483 const.
4484
3e235302
DK
44852010-06-16 Doug Kwan <dougkwan@google.com>
4486
4487 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
4488 .ARM.attributes section if we have not merged any input
4489 attributes sections.
4490
106e8a6c
DK
44912010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4492
4493 * arm.cc: Allow combining objects with no EABI version
4494 information.
4495
91ff43fe
RÁE
44962010-06-15 Rafael Espindola <espindola@google.com>
4497
4498 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
4499
68ed838c
ILT
45002010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4501
4502 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
4503 (struct iovec): Correct !HAVE_READV definition.
4504
f3a2388f
CC
45052010-06-10 Cary Coutant <ccoutant@google.com>
4506
4507 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
4508 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
4509 reloc sections.
4510 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
4511
4512 PR 11683
4513 * symtab.h (Symbol::is_placeholder): New member function.
4514 * target-reloc.h (relocate_section): Check for placeholder symbols.
4515
4516 * testsuite/Makefile.am (plugin_test_8): New test.
4517 (plugin_test_9): New test.
4518 * testsuite/Makefile.in: Regenerate.
4519
e1df38aa
NC
45202010-06-09 Nick Clifton <nickc@redhat.com>
4521
4522 * yyscript.y (input_list_element): Allow strings prefixed with
4523 the '-' character. Treat these as libraries.
4524 * script.cc (script_add_library): New function. Adds a library
4525 specified by "-l<name>" found in an input script.
4526 * script-c.h: Add prototype for script_add_library.
4527
25bbe950
DK
45282010-06-07 Doug Kwan <dougkwan@google.com>
4529
4530 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
4531 Restrict stub-group size to be within long conditional branch
4532 range when working around cortex-A8 erratum.
4533
0f32ea4c
ILT
45342010-06-07 Damien Diederen <dd@crosstwine.com>
4535
4536 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
4537 #ifdef typo.
4538
8fe2a369
ST
45392010-06-03 Sriraman Tallam <tmsriram@google.com>
4540
4541 PR gold/11658
4542 * output.cc
4543 (Output_section::Input_section_sort_entry::compare_section_ordering):
4544 Change to return non-zero correctly.
4545 (Output_section::Input_section_sort_section_order_index_compare
4546 ::operator()): Change to fix ambiguity in comparisons.
4547
6e9ba2ca
ST
45482010-06-01 Sriraman Tallam <tmsriram@google.com>
4549
4550 * gold.h (is_wildcard_string): New function.
4551 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
4552 (Layout::layout_eh_frame): Ditto.
4553 (Layout::find_section_order_index): New method.
4554 (Layout::read_layout_from_file): New method.
4555 * layout.h (Layout::find_section_order_index): New method.
4556 (Layout::read_layout_from_file): New method.
4557 (Layout::input_section_position_): New private member.
4558 (Layout::input_section_glob_): New private member.
4559 * main.cc (main): Call read_layout_from_file here.
4560 * options.h (--section-ordering-file): New option.
4561 * output.cc (Output_section::input_section_order_specified_): New
4562 member.
4563 (Output_section::Output_section): Initialize new member.
4564 (Output_section::add_input_section): Add new parameter.
4565 Keep input sections when --section-ordering-file is used.
4566 (Output_section::set_final_data_size): Sort input sections when
4567 section ordering file is specified.
4568 (Output_section::Input_section_sort_entry): Add new parameter.
4569 Check sorting type.
4570 (Output_section::Input_section_sort_entry::compare_section_ordering):
4571 New method.
4572 (Output_section::Input_section_sort_compare::operator()): Change to
4573 consider section_order_index.
4574 (Output_section::Input_section_sort_init_fini_compare::operator()):
4575 Change to consider section_order_index.
4576 (Output_section::Input_section_sort_section_order_index_compare
4577 ::operator()): New method.
4578 (Output_section::sort_attached_input_sections): Change to sort
4579 according to section order when specified.
e1df38aa
NC
4580 (Output_section::add_input_section<32, true>): Add new parameter.
4581 (Output_section::add_input_section<64, true>): Add new parameter.
4582 (Output_section::add_input_section<32, false>): Add new parameter.
4583 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
4584 * output.h (Output_section::add_input_section): Add new parameter.
4585 (Output_section::input_section_order_specified): New
4586 method.
4587 (Output_section::set_input_section_order_specified): New method.
4588 (Input_section::Input_section): Initialize section_order_index_.
4589 (Input_section::section_order_index): New method.
4590 (Input_section::set_section_order_index): New method.
4591 (Input_section::section_order_index_): New member.
4592 (Input_section::Input_section_sort_section_order_index_compare): New
4593 struct.
4594 (Output_section::input_section_order_specified_): New member.
4595 * script-sections.cc (is_wildcard_string): Delete and move modified
4596 method to gold.h.
4597 (Output_section_element_input::Output_section_element_input): Modify
4598 call to is_wildcard_string.
4599 (Output_section_element_input::Input_section_pattern
4600 ::Input_section_pattern): Ditto.
4601 (Output_section_element_input::Output_section_element_input): Ditto.
4602 * testsuite/Makefile.am (final_layout): New test case.
4603 * testsuite/Makefile.in: Regenerate.
4604 * testsuite/final_layout.cc: New file.
4605 * testsuite/final_layout.sh: New file.
4606
3537c84b
RÁE
46072010-06-01 Rafael Espindola <espindola@google.com>
4608
4609 * plugin.cc (Plugin::load): Pass the output name to the plugin.
4610
105b6afd
RÁE
46112010-06-01 Rafael Espindola <espindola@google.com>
4612
4613 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
4614 visibility of symbols.
4615
29e11421
DK
46162010-05-27 Doug Kwan <dougkwan@google.com>
4617
4618 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
4619 from start of output section instead of address for a local symbol
4620 in a merged or relaxed section when doing a relocatable link.
4621
5e0f337e
RÁE
46222010-05-26 Rafael Espindola <espindola@google.com>
4623
4624 PR 11604
4625 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
4626 adding sections the garbage collector removed.
4627 * gold/testsuite/Makefile.am: Add test.
4628 * gold/testsuite/Makefile.in: Regenerate.
4629 * gold/testsuite/plugin_test_7.sh: New.
4630 * gold/testsuite/plugin_test_7_1.c: New.
4631 * gold/testsuite/plugin_test_7_2.c: New.
4632
f4187277
RÁE
46332010-05-26 Rafael Espindola <espindola@google.com>
4634
4635 * script-sections.cc (Output_section_definition::set_section_addresses):
4636 Check for --section-start.
4637
5c388529
DK
46382010-05-26 Doug Kwan <dougkwan@google.com>
4639
4640 * arm.cc (Arm_scan_relocatable_relocs): New class.
4641 (Target_arm::relocate_special_relocatable): New method.
4642 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
4643 (Arm_relocate_functions::thumb_branch_common): Same.
4644 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
4645 instead of Default_scan_relocatable_relocs.
4646 * target-reloc.h (relocate_for_relocatable): Let target handle
4647 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
4648 * target.h (Sized_target::relocate_special_relocatable): New method.
4649
bca1c3ae
ILT
46502010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4651
4652 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
4653
0439c796
DK
46542010-05-23 Doug Kwan <dougkwan@google.com>
4655
4656 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
4657 instead of a cast.
4658 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
4659 with a direct branch, not a conditional branch, to a stub.
4660 * merge.cc (Output_merge_base::record_input_section): New method
4661 defintion.
4662 (Output_merge_data::do_add_input_section): Record input section if
4663 keeps-input-sections flag is set.
4664 (Output_merge_string::do_add_input_section): Ditto.
4665 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
4666 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
4667 INPUT_SECTIONS_.
4668 (Output_merge_base::keeps_input_sections,
4669 Output_merge_base::set_keeps_input_sections,
4670 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
4671 method definitions.
4672 (Output_merge_base::Input_sections): New type declaration.
4673 (Output_merge_base::input_sections_begin,
4674 Output_merge_base::input_sections_end,
4675 Output_merge_base::do_set_keeps_input_sections): New method definitions.
4676 (Output_merge_base::bool keeps_input_sections_,
4677 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
4678 Output_merge_base::input_sections_): New data members.
4679 (Output_merge_data::do_set_keeps_input_sections): New method
4680 defintion.
4681 (Output_merge_string::do_set_keeps_input_sections): Ditto.
4682 * output.cc (Output_section::Input_section::relobj): Move method
4683 defintion from class declaration to here and handle merge sections.
4684 (Output_section::Input_section::shndx): Ditto.
4685 (Output_section::Output_section): Remove initializations of removed
4686 data members and initialize new data member LOOKUP_MAPS_.
4687 (Output_section::add_input_section): Set keeps-input-sections flag
4688 for a newly created merge output section as appropriate. Adjust code
4689 to use Output_section_lookup_maps class.
4690 (Output_section::add_relaxed_input_section): Adjst code for lookup
4691 maps code refactoring.
4692 (Output_section::add_merge_input_section): Add a new parameter
4693 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
4694 class. If adding input section to a newly created merge output
4695 section fails, remove the new merge section.
4696 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 4697 Adjust code for use of the Output_section_lookup_maps class.
0439c796
DK
4698 (Output_section::find_merge_section): Ditto.
4699 (Output_section::build_lookup_maps): New method defintion.
4700 (Output_section::find_relaxed_input_section): Adjust code to use
4701 Output_section_lookup_maps class.
4702 (Output_section::get_input_sections): Export merge sections. Adjust
4703 code to use Output_section_lookup_maps class.
4704 (Output_section:::add_script_input_section): Adjust code to use
4705 Output_section_lookup_maps class. Update lookup maps for merge
4706 sections also.
4707 (Output_section::discard_states): Use Output_section_lookup_maps.
4708 (Output_section::restore_states): Same.
4709 * output.h (Merge_section_properties): Move class defintion out of
4710 Output_section.
4711 (Output_section_lookup_maps): New class.
4712 (Output_section::Input_section::is_merge_section): New method
4713 defintion.
4714 (Output_section::Input_section::relobj): Move defintion out of class
4715 defintion. Declare method only.
4716 (Output_section::Input_section::shndx): Ditto.
4717 (Output_section::Input_section::output_merge_base): New method defintion.
4718 (Output_section::Input_section::u2_.pomb): New union field.
4719 (Output_section::Merge_section_by_properties_map,
4720 Output_section::Output_section_data_by_input_section_map,
4721 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
4722 Remove types.
4723 (Output_section::add_merge_input_section): Add new parameter
4724 KEEPS_INPUT_SECTIONS.
4725 (Output_section::build_lookup_maps): New method declaration.
4726 (Output_section::merge_section_map_,
4727 Output_section::merge_section_by_properties_map_,
4728 Output_section::relaxed_input_section_map_,
4729 Output_section::is_relaxed_input_section_map_valid_): Remove data
4730 members.
4731 (Output_section::lookup_maps_): New data member.
4732
76295588
L
47332010-05-21 Doug Kwan <dougkwan@google.com>
4734
4735 PR gold/11619
4736 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
4737 avoid a compilation error.
4738
d103a984
RÁE
47392010-05-19 Rafael Espindola <espindola@google.com>
4740
4741 * script-sections.cc (Output_section_definition::allocate_to_segment):
4742 Update the phdrs_list even when the output section is NULL.
4743 * testsuite/Makefile.am: Add test.
4744 * testsuite/Makefile.in: Regenerate.
4745 * testsuite/script_test_9.cc: New.
4746 * testsuite/script_test_9.sh: New.
4747 * testsuite/script_test_9.t: New.
4748
6625d24e
DK
47492010-05-19 Doug Kwan <dougkwan@google.com>
4750
4751 * arm.cc (Arm_input_section::original_size): New method.
4752 (Arm_input_section::do_addralign): Add a cast.
4753 (Arm_input_section::do_output_offset): Remove static cast.
4754 (Arm_input_section::original_addralign,
4755 Arm_input_section::original_size_): Change type to uint32_t.
4756 (Arm_input_section::init): Add safe casts for section alignment
4757 and size.
4758 (Arm_input_section::set_final_data_size): Do not set address and
4759 offset of stub table.
4760 (Arm_output_section::fix_exidx_coverage): Change use of of
4761 Output_section::Simple_input_section to that of
4762 Output_section::Input_section.
4763 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
4764 except for the first pass.
4765 * output.cc (Output_section::get_input_sections): Change type of
4766 input_sections to std::list<Input_section>.
4767 (Output_section::add_script_input_section): Rename from
4768 Output_section::add_simple_input_section. Change type of SIS
4769 parameter from Simple_input_section to Input_section.
4770 * output.h (Output_section::Simple_input_section): Remove class.
4771 (Output_section::Input_section): Change class visibility to public.
4772 (Output_section::Input_section::addralign): Use stored alignments
4773 for special input sections if set.
4774 (Output_section::Input_section::set_addralign): New method.
4775 (Output_section::get_input_sections): Change parameter type from
4776 list of Simple_input_section to list of Input_section.
4777 (Output_section::add_script_input_section): Rename from
4778 Output_section::add_simple_input_section. Change first parameter's
4779 type from Simple_input_section to Input_section and remove the
4780 second and third parameters.
4781 * script-sections.cc (Input_section::Input_section_list): Change
4782 type to list of Output_section::Input_section/
4783 (Input_section_info::Input_section_info): Change parameter type of
4784 INPUT_SECTION to Output_section::Input_section.
4785 (Input_section_info::input_section): Change return type.
4786 (Input_section_info::input_section_): Change type to
4787 Output_section::Input_section.
4788 (Output_section_element_input::set_section_addresses): Adjust code
4789 to use Output_section::Input_section instead of
4790 Output_section::Simple_input_section. Adjust code for renaming
4791 of Output_section::add_simple_input_section.
4792 (Orphan_output_section::set_section_addresses): Ditto.
4793
e1e82ea4
RW
47942010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4795
4796 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
4797 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
4798
91e75c8a
RÁE
47992010-05-18 Rafael Espindola <espindola@google.com>
4800
4801 * options.cc (General_options::finalize): Handle -nostdlib.
4802 * options.h (nostdlib): New option.
4803 * script.cc (script_add_search_dir): Handle -nostdlib.
4804
da59ad79
DK
48052010-05-12 Doug Kwan <dougkwan@google.com>
4806
4807 * arm.cc (Target_arm::do_finalize_sections): Create an empty
4808 attributes section only if there no attributes section after merging.
4809 (Target_arm::merge_object_attributes): Move value of
e1df38aa 4810 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
4811 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
4812 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
4813 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
4814 and arm_attr_merge_7.stdout.
4815 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
4816 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
4817 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
4818 arm_attr_merge_7b.o): New rules.
4819 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
4820 arm_attr_merge_7
4821 * testsuite/Makefile.in: Regenerate.
4822 * testsuite/arm_attr_merge.sh: New file.
4823 * testsuite/arm_attr_merge_[67][ab].s: Same.
4824
3e01a7fd
NC
48252010-05-05 Nick Clifton <nickc@redhat.com>
4826
4827 * po/es.po: Updated Spanish translation.
4828
7ad2014a
L
48292010-04-27 H.J. Lu <hongjiu.lu@intel.com>
4830
4831 * Makefile.am (install-exec-local): Properly install gold as
4832 default cross linker.
4833 * Makefile.in: Regenerated.
4834
4fda8867
NC
48352010-04-27 H.J. Lu <hongjiu.lu@intel.com>
4836 Nick Clifton <nickc@redhat.com>
4837
4838 * configure.ac (install_as_default): Define and set to false
4839 unless --enable-gold or --enable-gold=both/gold has been
4840 specified.
4841 * configure: Regenerate.
4842
4843 * Makefile.am (install-exec-local): Install the executable as
4844 'ld.gold'. If install_as_default is true then also install it as
4845 'ld'.
4846 * Makefile.in: Regenerated.
4847
bd288ea2
ILT
48482010-04-24 Ian Lance Taylor <iant@google.com>
4849
4850 * layout.cc (Layout::layout_reloc): In relocatable link don't
4851 combine reloc sections for grouped sections.
4852
ef38fd8a
ST
48532010-04-23 Sriraman Tallam <tmsriram@google.com>
4854
4855 * gc.h (gc_process_relocs): Pass information on relocs pointing to
4856 sections that are not ordinary to icf.
4857 * icf.cc (get_section_contents): Handle relocation pointing to section
4858 with no object or shndx information.
4859 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
4860 * testsuite/Makefile.in: Regenerate.
4861 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
4862 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
4863
f6973bdc
ILT
48642010-04-22 Ian Lance Taylor <iant@google.com>
4865
4866 * expression.cc (Expression::Expression_eval_info): Add
4867 result_alignment_pointer field.
4868 (Expression::eval_with_dot): Add result_alignment_pointer
4869 parameter. Change all callers.
4870 (Expression::eval_maybe_dot): Likewise.
4871 (class Binary_expression): Add alignment_pointer parameter to
4872 left_value and right_value. Change all callers.
4873 (BINARY_EXPRESSION): Set result alignment.
4874 (class Trinary_expression): Add alignment_pointer parameter to
4875 arg2_value and arg3_value. Change all callers.
4876 (Trinary_cond::value): Set result alignment.
4877 (Max_expression::value, Min_expression::value): Likewise.
4878 (Align_expression::value): Likewise.
4879 * script-sections.cc (class Sections_element): Add dot_alignment
4880 parameter to set_section_addresses virtual function. Update
4881 instantiations.
4882 (class Output_section_element): Likewise.
4883 (Script_sections::create_segments): Add dot_alignment parameter.
4884 Change all callers.
4885 (Script_sections::create_segments_from_phdrs_clause): Likewise.
4886 (Script_sections::set_phdrs_clause_addresses): Likewise.
4887 * script-sections.h: Update declarations.
4888 * script.h: Update declarations.
4889 * output.h (Output_segment::set_minimum_p_align): Don't decrease
4890 min_p_align.
4891 * testsuite/script_test_3.t: Set large alignment.
4892 * testsuite/script_test_3.sh: Make sure that at least one LOAD
4893 segment has expected alignment.
4894
9c9c98a5
NC
48952010-04-22 Nick Clifton <nickc@redhat.com>
4896
4897 * po/gold.pot: Updated by the Translation project.
4898 * po/vi.po: Updated Vietnamese translation.
4899
2253bfba
L
49002010-04-22 H.J. Lu <hongjiu.lu@intel.com>
4901
4902 * testsuite/Makefile.am (check_PROGRAMS): Add
4903 icf_virtual_function_folding_test.
4904 * testsuite/Makefile.in: Regenerated.
4905
85fdf906
AH
49062010-04-15 Andrew Haley <aph@redhat.com>
4907
4908 * options.h (merge_exidx_entries): New option.
4909 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
4910 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
4911 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
4912 (Target_arm::merge_exidx_entries): New function.
4913 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
4914 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
4915 to Arm_exidx_fixup constructor.
4916 Add new arg, merge_exidx_entries.
4917 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
4918 Arm_output_section::fix_exidx_coverage.
4919
ce97fa81
ST
49202010-04-18 Sriraman Tallam <tmsriram@google.com>
4921
4922 * icf.cc (get_section_contents): Check for preemptible functions.
4923 Ignore addend when appropriate.
4924 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
4925 section folded.
4926 (add_from_relobj): Check for section folded.
4927 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
4928 * symtab.h (should_add_dynsym_entry): Add new parameter.
4929 * target-reloc.h (scan_relocs): Check for section folded.
4930 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
4931 Check reloc types for function pointers in shared objects.
4932 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
4933 case.
4934 (icf_preemptible_functions_test): New test case.
4935 (icf_string_merge_test): New test case.
4936 * testsuite.Makefile.in: Regenerate.
4937 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
4938 bar_glob. Refactor code.
4939 * testsuite/icf_preemptible_functions_test.cc: New file.
4940 * testsuite/icf_preemptible_functions_test.sh: New file.
4941 * testsuite/icf_string_merge_test.cc: New file.
4942 * testsuite/icf_string_merge_test.sh: New file.
4943 * testsuite/icf_virtual_function_folding_test.cc: New file.
4944 * testsuite/icf_virtual_function_folding_test.sh: New file.
4945
04ceb17c
DK
49462010-04-14 Doug Kwan <dougkwan@google.com>
4947
4948 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
4949 for local symbol recounting if we remove a section due to ICF.
4950 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
4951 there are no regular objects in input.
4952
153e7da4
DK
49532010-04-13 Doug Kwan <dougkwan@google.com>
4954
4955 * arm.cc (Arm_input_section::set_final_data_size): Compute
4956 accurate final data size instead of using current data size.
4957
4dbd9faf
DK
49582010-04-09 Doug Kwan <dougkwan@google.com>
4959
4960 * layout.cc (Layout::choose_output_section): Handle script section
4961 types.
4962 (Layout::make_output_section_for_script): Add section type parameter.
4963 Handle script section types.
4964 * layout.h (Layout::make_output_section_for_script): Add section
4965 type parameter.
4966 * output.cc (Output_section::Output_section): Initialize data member
4967 is_noload_.
4968 (Output_section::do_reset_address_and_file_offset): Do not set address
4969 to 0 if section is a NOLOAD section.
4970 * output.h (Output_section::is_noload): New method.
4971 (Output_section::set_is_noload): Ditto.
4972 (Output_section::is_noload_): New data member.
4973 * script-c.h (Script_section_type): New enum type.
4974 (struct Parser_output_section_header): Add new file section_type.
4975 * script-sections.cc (Sections_element::output_section_name): Add
4976 parameter for returning script section type.
4977 (Output_section_definition::output_section_name): Ditto.
4978 (Output_section_definition::section_type)P; New method.
4979 (Output_section_definiton::script_section_type_name): Ditto.
4980 (Output_section_definition::script_section_type_): New data member.
4981 (Output_section_definition::Output_section_definition): Initialize
4982 data member Output_section_definition::script_section_type_.
4983 (Output_section_definition::create_sections): Pass script section type
4984 to Layout::make_output_section_for_script.
4985 (Output_section_definition::output_section_name): Return script
4986 section type to caller.
4987 (Output_section_definition::set_section_address): Do not advance
4988 dot value and load address if section type is NOLOAD. Set address
4989 of NOLOAD sections regardless of section flags.
4990 (Output_section_definition::print): Print section type if it is
4991 not SCRIPT_SECTION_TYPE_NONE.
4992 (Output_section_definition::section_type): New method.
4993 (Output_section_definition::script_section_type_name): Ditto.
4994 (Script_sections::output_section_name): Add new parameter
4995 PSECTION_TYPE for returning script section type. Pass it to
4996 section elements. Handle discard sections.
4997 (Sort_output_sections::operator()): Handle NOLOAD sections.
4998 * script-sections.h (Script_sections::Section_type): New enum type.
4999 (Script_sections::output_section_name): Add a new parameter for
5000 returning script section type.
5001 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
5002 INFO and NOLOAD.
5003 * yyscript.y (union): Add new field SECTION_TYPE.
5004 (COPY, DSECT, INFO, NOLOAD): New tokens.
5005 (opt_address_and_section_type): Change type to output_section_header.
5006 (section_type): New non-terminal
5007 (section_header): Handle section type.
2253bfba 5008 (opt_address_and_section_type): Return section type value.
4dbd9faf 5009
721ea635
L
50102010-04-09 H.J. Lu <hongjiu.lu@intel.com>
5011
5012 * testsuite/plugin_common_test_1.c (foo): Add prototype.
5013 * testsuite/plugin_common_test_2.c (foo): Likewise.
5014
6bf924b0
DK
50152010-04-08 Doug Kwan <dougkwan@google.com>
5016
5017 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
5018 Output_merge_data.
5019 * output.cc (Output_section::add_merge_input_section): Simplify
5020 code and return status of Output_merge_base::add_input_section.
e1df38aa 5021 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
5022 returns true.
5023
24af6f92
DK
50242010-04-07 Doug Kwan <dougkwan@google.com>
5025
5026 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
5027 if section is marked as containing instructions but has no mapping
5028 symbols.
5029 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
5030 correct section index.
5031 (Arm_relobj::find_linked_text_section): Ditto.
5032
00698fc5
CC
50332010-04-07 Cary Coutant <ccoutant@google.com>
5034
5035 * archive.cc (include_member): Destroy Read_symbols_data object before
5036 releasing file.
5037 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
5038 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
5039 (Read_symbols_data::~Read_symbols_data) New destructor.
5040 (Section_relocs::Section_relocs) New constructor.
5041 (Section_relocs::~Section_relocs) New destructor.
5042 (Read_relocs_data::Read_relocs_data) New constructor.
5043 (Read_relocs_data::~Read_relocs_data) New destructor.
5044 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
5045 pointers to NULL after deleting.
5046
7296d933
DK
50472010-04-07 Doug Kwan <dougkwan@google.com>
5048
5049 * arm.cc: Replace "endianity" with "endianness" in comments.
5050 (Arm_exidx_cantunwind): Ditto.
5051 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
5052 (Arm_relobj::merge_flags_and_attributes): New method.
5053 (Arm_relobj::merge_flags_and_attributes_): New data member.
5054 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
5055 (Arm_relobj::scan_sections_for_stubs): Ditto.
5056 (Arm_relobj::do_read_symbols): Check to see if we really want to
5057 merge processor-specific flags and attributes. Exit early if
5058 an object is empty except for section names and the undefined symbol.
5059 (Target_arm::do_finalize_sections): Move check for ELF format to
5060 Arm_relobj::do_read_symbols. Merge processor specific flags and
5061 attributes from a regular object only when we have determined that
5062 it is aapropriate. Do not create an .ARM.attributes section in
5063 output if there is no regular input object.
5064 (Target_arm::merge_processor_specific_flags): Check
5065 --warn-mismatch before printing any error.
5066 (Target_arm::merge_object_attributes): Ditto.
5067 * gold.cc (queue_middle_tasks): Handle the case in which there is
5068 no regular object in input.
5069 * options.cc (General_options::parse_EB): New method.
5070 (General_options::parse_EL): Same.
5071 (General_options::General_options): Initialize endianness_.
5072 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
5073 New options.
5074 (General_options::Endianness): New enum.
5075 (General_options::endianness): New method.
5076 (General_options::endianness_): New data member.
5077 * parameters.cc (Parameters::set_options): Check target endianness.
5078 (Parameters::set_target_once): Ditto.
5079 (Parameters::check_target_endianness): New method.
5080 (parameters_force_valid_target): If either -EL or -EB is specified,
5081 use it to define endianness of default target.
5082 * parameters.h (Parameters::check_target_endianness): New method
5083 declaration.
5084 * target.h (class Target): Change "endianity" to "endianness"
5085 in comments.
5086
efc8d4f2
RW
50872010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5088
5089 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
5090 * configure: Regenerate.
5091 * Makefile.in: Regenerate.
5092 * testsuite/Makefile.in: Regenerate.
5093
be234d88
CC
50942010-04-06 Cary Coutant <ccoutant@google.com>
5095
5096 gcc PR lto/42757
5097 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
5098 prevailing definitions of common symbols.
5099 * testsuite/plugin_test_6.sh: New test case.
5100 * testsuite/plugin_common_test_1.c: New test case.
5101 * testsuite/plugin_common_test_2.c: New test case.
5102 * testsuite/Makefile.am (plugin_test_6): New test case.
5103 * testsuite/Makefile.in: Regenerate.
5104
bd32c6bd
NC
51052010-04-06 Nick Clifton <nickc@redhat.com>
5106
5107 * po/vi.po: New Vietnamese translation.
5108
323c532f
DK
51092010-03-30 Doug Kwan <dougkwan@google.com>
5110
5111 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
5112
4fcd97eb
DK
51132010-03-25 Doug Kwan <dougkwan@google.com>
5114
5115 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
5116 to avoid a conversion warning on a 32-bit host.
5117
4ebf39db
ILT
51182010-03-24 Ian Lance Taylor <iant@google.com>
5119
5120 * testsuite/script_test_3.t: Add a TLS segment.
5121 * testsuite/Makefile.am (check_PROGRAMS): Add
5122 tls_phdrs_script_test.
5123 (tls_phdrs_script_test_SOURCES): Define.
5124 (tls_phdrs_script_test_DEPENDENCIES): Define.
5125 (tls_phdrs_script_test_LDFLAGS): Define.
5126 (tls_phdrs_script_test_LDADD): Define.
5127 * testsuite/Makefile.in: Rebuild.
5128
4a599bdd
CC
51292010-03-23 Cary Coutant <ccoutant@google.com>
5130
5131 * fileread.cc (find_or_make_view): Fix comment.
5132
6c93b22c
ILT
51332010-03-23 Ian Lance Taylor <iant@google.com>
5134
5135 * script-sections.cc (class Orphan_section_placement): Define
5136 PLACE_TLS and PLACE_TLS_BSS.
5137 (Orphan_section_placement::Orphan_section_placement): Initialize
5138 new places.
5139 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
5140 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
5141 (tls_script_test_SOURCES): Define.
5142 (tls_script_test_DEPENDENCIES): Define.
5143 (tls_script_test_LDFLAGS): Define.
5144 (tls_script_test_LDADD): Define.
5145 * testsuite/Makefile.in: Rebuild.
5146
a2c7281b
DK
51472010-03-22 Doug Kwan <dougkwan@google.com>
5148
5149 * arm.cc (Arm_relocate_functions::abs8,
5150 Arm_relocate_functions::abs16): Use correct check for overflow
5151 specified in the ARM ELF specs.
5152 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
5153 target of a BLX instruction specially.
5154 (Reloc_stub::stub_type_for_reloc): Ditto.
5155 (Relocate::relocate): Use symbolic names instead of numeric relocation
5156 codes to report error.
5157 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
5158 workaround.
5159 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
5160 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
5161 thumb2_blx_out_of_range.stdout
5162 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
5163 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
5164 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
5165 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
5166 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
5167 thumb2_blx_in_range, thumb2_blx_in_range.o,
5168 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
5169 thumb2_blx_out_of_range.o): New rules.
5170 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
5171 thumb2_blx_in_range and thumb2_blx_out_of_range.
5172 * testsuite/Makefile.in: Regenerate.
5173 * arm_branch_in_range.sh: Add tests for THUMB BLX.
5174 * testsuite/thumb_blx_in_range.s: New file.
5175 * testsuite/thumb_blx_out_of_range.s: New file.
5176
b0193076
RÁE
51772010-03-22 Rafael Espindola <espindola@google.com>
5178
5179 * archive.cc (Should_include): Move to archive.h.
5180 (should_include_member): Make it a member of Archive.
5181 (Lib_group): New.
5182 (Add_lib_group_symbols): New.
5183 * archive.h: Include options.h.
5184 (Archive_member): Moved from Archive.
5185 (Should_include): Moved from archive.cc.
5186 (Lib_group): New.
5187 (Add_lib_group_symbols): New.
5188 * dynobj.cc (do_should_include_member): New.
5189 * dynobj.h (do_should_include_member): New.
5190 * gold.cc (queue_initial_tasks): Update call to queue.
5191 * main.cc (main): Print lib group stats.
5192 * object.cc (do_should_include_member): New.
5193 * object.h: Include archive.h.
5194 (Object::should_include_member): New.
5195 (Object::do_should_include_member): New.
5196 (Sized_relobj::do_should_include_member): New.
5197 * options.cc (General_options::parse_start_lib): New.
5198 (General_options::parse_end_lib): New.
5199 (Input_arguments::add_file): Handle lib groups.
5200 (Input_arguments::start_group): Check we are not in a lib.
5201 (Input_arguments::start_lib): New.
5202 (Input_arguments::end_lib): New.
5203 * options.h (General_options): Add start_lib and end_lib.
5204 (Input_argument::lib_): New.
5205 (Input_argument::lib): New.
5206 (Input_argument::is_lib): New.
5207 (Input_file_lib): New.
5208 (Input_arguments::in_lib_): New.
5209 (Input_arguments::in_lib): New.
5210 (Input_arguments::start_lib): New.
5211 (Input_arguments::end_lib_): New.
5212 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
5213 in unused members as preempted.
5214 (Sized_pluginobj::do_should_include_member): New.
5215 * plugin.h (Sized_pluginobj::do_should_include_member): New.
5216 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
5217 return the blocker.
5218 (Read_symbols::do_whole_lib_group): New.
5219 (Read_symbols::do_lib_group): New.
5220 (Read_symbols::do_read_symbols): Handle lib groups.
5221 (Read_symbols::get_name): Handle lib groups.
5222 * readsyms.h (Read_symbols): Add an archive member pointer.
5223 (Read_symbols::do_whole_lib_group): New.
5224 (Read_symbols::do_lib_group): New.
5225 (Read_symbols::member_): New.
5226 * script.cc (read_input_script): Update call to queue_soon.
5227
d099120c
DK
52282010-03-19 Doug Kwan <dougkwan@google.com>
5229
5230 * arm.cc (Stub_table::Stub_table): Initialize new data members
5231 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
5232 (Stub_table::add_reloc_stub): Assign stub offset and update
5233 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
5234 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
5235 New data members.
5236 (Stub_table::update_data_size_and_addralign): Use
5237 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
5238 instead of going over all reloc stubs.
5239 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
5240 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
5241 Stringpool_template::offset_ to size of Stringpool_char.
5242 (Stringpool_template::new_key_offset): Remove code to initialize
5243 Stringpool_template::offset_.
5244 * stringpool.h (Stringpool_template::set_no_zero_null): Set
5245 Stringpool_template::offset_ to zero.
5246
1aa37384
DK
52472010-03-15 Doug Kwan <dougkwan@google.com>
5248
5249 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
5250 offset_.
5251 (Stringpool_template::new_key_offset): New method.
5252 (Stringpool_template::add_string): Assign offsets when adding new
5253 strings.
5254 (Stringpool_template::set_string_offsets): Do not set string offsets
5255 when not optimizing.
5256 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
5257 member size_.
5258 (Chunked_vector::clear): Clear size_.
5259 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
5260 (Chunked_vector::size): Return size_.
5261 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 5262 (Chunked_vector::size_): New data member.
1aa37384
DK
5263 (Stringpool_template::set_no_zero_null): Assert string set is empty.
5264 (Stringpool_template::new_key_offset): New method declaration.
5265 (Stringpool_template::offset_): New data member.
5266
b672b057
RÁE
52672010-03-15 Rafael Espindola <espindola@google.com>
5268
5269 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
5270 Add_symbols' constructor.
5271 * readsyms.h (Add_symbols): Remove the input_group member.
5272
b6848d3c
ILT
52732010-03-10 Ian Lance Taylor <iant@google.com>
5274
5275 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
5276 target to ask whether a reference to a symbol requires a stack
5277 split.
5278 * target.h (Target::is_call_to_non_split): New function.
5279 (Target::do_is_call_to_non_split): Declare virtual function.
5280 * target.cc: Include "symtab.h".
5281 (Target::do_is_call_to_non_split): New function.
5282 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
5283
a2a5469e
CC
52842010-03-10 Cary Coutant <ccoutant@google.com>
5285
5286 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
5287 (File_read::open[1]): Remove initial mapping of whole_file_view_.
5288 (File_read::open[2]): Add whole_file_view_ to list of views.
5289 (File_read::make_view): Remove test of whole_file_view_.
5290 (File_read::find_or_make_view): Create whole_file_view_ if
5291 necessary.
5292 (File_read::clear_views): Replace bool parameter with enum;
5293 adjust all callers. Don't delete views with permanent data;
5294 do delete cached views and views from archives if
5295 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
5296 if clearing the corresponding view.
5297 * fileread.h (File_read::Clear_views_mode): New enum.
5298 (File_read::View::is_permanent_view): New method.
5299 (File_read::clear_views): Replace bool parameter
5300 with enum; adjust all callers.
5301 * options.h (General_options): Change keep_files_mapped option;
5302 add map_whole_files.
5303 * readsyms.cc (Add_symbols::run): Delete sd_ object before
5304 releasing the file.
5305 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
5306 the file.
5307
8861f32b
DM
53082010-03-10 David S. Miller <davem@davemloft.net>
5309
5310 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
5311
d62d0f5f
ST
53122010-03-09 Sriraman Tallam <tmsriram@google.com>
5313
5314 * icf.cc (get_section_contents): Add '@' marker after processing the
5315 merge reloc.
5316
9177756d
DK
53172010-03-08 Doug Kwan <dougkwan@google.com>
5318
5319 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
5320 due to a conversion warning.
5321 (Arm_relobj::update_output_local_symbol_count): Check for local
5322 symbol with unset output index.
5323
9e9e071b
ILT
53242010-03-05 Ian Lance Taylor <iant@google.com>
5325
5326 * options.h (class General_options): Add --spare-dynamic-tags.
5327 * output.cc (Output_data_dynamic::set_final_data_size): Implement
5328 --spare-dynamic-tags.
5329
a81ee015
ILT
53302010-03-05 Ian Lance Taylor <iant@google.com>
5331
5332 * incremental.cc: Include "libiberty.h".
5333
44ec90b9
RO
53342010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
5335
5336 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
5337 function, is_info_ member.
5338 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
5339 (Versions::Versions): Update caller.
5340 (Versions::define_base_version): Likewise.
5341 (Versions::add_def): Likewise.
5342
0897ed3b
ST
53432010-03-03 Sriraman Tallam <tmsriram@google.com>
5344
5345 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
5346 (Scan::possible_function_pointer_reloc): New function.
5347 (Scan::local_reloc_may_be_function_pointer): Change to call
5348 possible_function_pointer_reloc.
5349 (Scan::global_reloc_may_be_function_pointer): Ditto.
5350 * icf.h (Icf::check_section_for_function_pointers): Change to reject
5351 relocations in ".data.rel.ro._ZTV" section.
5352 * testsuite/icf_safe_so_test.sh: Change to pass i386.
5353 * testsuite/icf_safe_so_test.cc: Ditto.
5354 * testsuite/icf_safe_test.cc: Ditto.
5355 * testsuite/icf_safe_test.sh: Ditto.
5356
d3bbad62
ILT
53572010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5358 Ian Lance Taylor <iant@google.com>
5359
5360 * target-reloc.h (relocate_section): Check the symbol table index
5361 for -1U before setting the local symbol index.
5362 (scan_relocatable_relocs): If copying the relocation, record that
5363 the local symbol is required.
5364 * object.h (Symbol_value::is_output_symtab_index_set): New
5365 function.
5366 (Symbol_value::may_be_discarded_from_output_symtab): New
5367 function.
5368 (Symbol_value::has_output_symtab_entry): New function.
5369 (Symbol_value::needs_output_symtab_entry): Remove.
5370 (Symbol_value::output_symtab_index): Make sure the symbol index is
5371 set.
5372 (Symbol_value::set_output_symtab_index): Make sure the symbol
5373 index is not set. Make sure the new index is valid.
5374 (Symbol_value::set_must_have_output_symtab_entry): New function.
5375 (Symbol_value::has_output_dynsym_entry): New function.
5376 (Symbol_value::set_output_dynsym_index): Make sure the new index
5377 is valid.
5378 (Sized_relobj::set_must_have_output_symtab_entry): New function.
5379 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
5380 local symbol if permitted.
5381 (Sized_relobj::do_finalize_local_symbols): Call
5382 is_output_symtab_index_set rather than needs_output_symtab_entry.
5383 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
5384 rather than needs_output_symtab_entry. Call
5385 has_output_dynsym_entry rather than needs_output_dynsym_entry.
5386 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
5387 is_output_symtab_index_set rather than needs_output_symtab_entry.
5388 * testsuite/discard_locals_relocatable_test.c: New file.
5389 * testsuite/discard_locals_test.sh: Test -r.
5390 * testsuite/Makefile.am (check_DATA): Add
5391 discard_locals_relocatable_test1.syms,
5392 discard_local_relocatable_test2.syms.
5393 (MOSTLYCLEANFILES): Likewise. Also add
5394 discard_locals_relocatable_test1.lout and
5395 discard_locals_relocatable_test2.out.
5396 (discard_locals_relocatable_test1.syms): New target.
5397 (discard_locals_relocatable_test.o): New target.
5398 (discard_locals_relocatable_test1.out): New target.
5399 (discard_locals_relocatable_test2.syms): New target.
5400 (discard_locals_relocatable_test2.out): New target.
5401 (various): Add missing ../ld-new dependencies.
5402 * testsuite/Makefile.in: Rebuild.
5403
7e8ccf26
NC
54042010-03-03 Nick Clifton <nickc@redhat.com>
5405
5406 * po/fi.po: New Finnish translation.
5407
2a0ff005
DK
54082010-03-01 Doug Kwan <dougkwan@google.com>
5409
5410 * layout.cc (Layout::Layout): Force section types of .init_array*,
5411 .preinit_array* and .fini_array* sections.
5412 * output.cc (Output_section::Input_section_sort_entry::has_priority):
5413 Fix check of return value of std::string::find.().
5414 (Output_section::Input_section_sort_compare::operator()): Remove
5415 comment about .init_array.
5416 (Output_section::Input_section_sort_init_fini_compare::operator()):
5417 New method.
5418 (Output_section::sort_attached_input_sections): Handle .init_array
5419 and .fini_array specially.
5420 * output.h (Output_section::Inut_section_sort_compare): Update
5421 comment.
5422 (Output_section::Input_section_sort_init_fini_compare): New struct.
5423
c3e4ae29
DK
54242010-02-26 Doug Kwan <dougkwan@google.com>
5425
5426 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
5427 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
5428 * testsuite/debug_msg.sh: Avoid matching source line number for
5429 use of global variable undef_int.
5430
2fd9ae7a
DK
54312010-02-26 Doug Kwan <dougkwan@google.com>
5432
5433 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
5434 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
5435 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
5436 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
5437 * options.cc (General_options::General_options): Initialize member
5438 fix_v4bx_.
5439 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
5440 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
5441 and rm_no_fix_v4bx.stdout
5442 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
5443 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
5444 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
5445 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
5446 and arm_no_fix_v4bx.
5447 * Makefile.in: Regenerate.
5448 * testsuite/arm_fix_v4bx.s: New file.
5449 * testsuite/arm_fix_v4bx.sh: Ditto.
5450
67ec7d0b
DK
54512010-02-24 Doug Kwan <dougkwan@google.com>
5452
5453 * arm.cc (Target_arm::got_section): Make the .got section the first
5454 non RELRO section in the data segment.
5455 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
5456 suffixes of section names.
5457
10165461
DK
54582010-02-24 Doug Kwan <dougkwan@google.com>
5459
5460 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
5461 flags and attributes merging if an input file is a binary file.
5462 * fileread.cc (Input_file::open): Record format of original file.
5463 * fileread.h (Input_file::Format): New enum type.
5464 (Input_file::Input_file): Initialize data member format_.
5465 (Input_file::format): New method definition.
5466 (Input_file::format_):: New data member.
5467
4a54abbb
DK
54682010-02-24 Doug Kwan <dougkwan@google.com>
5469
5470 * arm.cc (Arm_output_data_got): New class.
5471 (ARM_TCB_SIZE): New constant
5472 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
5473 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
5474 If user uses a script with a SECTIONS clause, issue only a warning
5475 for a misplaced EXIDX input section. Otherwise, issue an error.
5476 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
5477 garbage collection.
5478 (Target_arm::got_mode_index_entry): Handle static linking.
5479 (Target_arm::Scan::local): Ditto.
5480 (Target_arm::Scan::global): Ditto.
5481 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
5482 all incorrectly implemented relocations.
e1df38aa 5483 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
5484 Arm_output_section::fix_exidx_coverage.
5485 * layout.cc (Layout::section_name_mapping): Remove trailing dots
5486 from ".ARM.exidx." and ".ARM.extab.".
5487
ca419a6f
ILT
54882010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5489
5490 * arm.cc (Target_arm::do_finalize_sections): Create attribute
5491 section if it does not already exist.
5492 * attributes.cc (Attributes_section_data::Attributes_section_data):
5493 Don't crash if size is zero.
5494
135b9c78
ILT
54952010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5496 Ian Lance Taylor <iant@google.com>
5497
5498 * gold.cc (queue_middle_tasks): If no input files were opened,
5499 exit.
5500 * workqueue.h (Task_function::Task_function): Assert that there is
5501 a blocker.
5502
bb0bfe4f
DK
55032010-02-22 Doug Kwan <dougkwan@google.com>
5504
5505 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
5506 * icf.cc (get_section_contents): Cast snprintf arguments to long long
5507 types to avoid warnings due to different uint64_t implementations
5508 on different hosts.
5509
2a2b6d42
DK
55102010-02-21 Doug Kwan <dougkwan@google.com>
5511
5512 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
5513 handling of the maximum backward branch offset.
5514 (Arm_relocate_functions::thumb_branch_common): Ditto.
5515 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
5516 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 5517 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
5518 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
5519 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
5520 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
5521 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
5522 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
5523 thumb_bl_out_of_range thumb_bl_out_of_range.o,
5524 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
5525 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
5526 thumb2_bl_out_of_range.o): New rules.
5527 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
5528 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
5529 thumb2_bl_out_of_range
5530 * testsuite/Makefile.in: Regenerate.
5531 * testsuite/arm_bl_in_range.s: New file.
5532 * testsuite/arm_bl_out_of_range.s: Ditto.
5533 * testsuite/arm_branch_in_range.sh: Ditto.
5534 * testsuite/arm_branch_range.t: Ditto.
5535 * testsuite/thumb2_branch_range.t: Ditto.
5536 * testsuite/thumb_bl_in_range.s: Ditto.
5537 * testsuite/thumb_bl_out_of_range.s: Ditto.
5538 * testsuite/thumb_branch_range.t: Ditto.
5539
b487ad64
ST
55402010-02-20 Sriraman Tallam <tmsriram@google.com>
5541
5542 * gc.h (gc_process_relocs): Change vectors to point to the new list.
5543 Add reloc offset information.
5544 * icf.cc (get_section_contents): Change iterators to point to the new
5545 vectors. Add reloc offset information to the contents.
5546 * icf.h (Icf::Sections_reachable_info): New typedef.
5547 (Icf::Sections_reachable_list): New typedef.
5548 (Icf::Offset_info): New typedef.
5549 (Icf::Reloc_info): New struct typedef.
5550 (Icf::Reloc_info_list): New typedef.
5551 (Icf::symbol_reloc_list): Delete method.
5552 (Icf::addend_reloc_list): Delete method.
5553 (Icf::section_reloc_list): Delete method.
5554 (Icf::reloc_info_list): New method.
5555 (Icf::reloc_info_list_): New member.
5556
f96accdf
DK
55572010-02-19 Doug Kwan <dougkwan@google.com>
5558
5559 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
5560 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
5561 * arm.cc (Arm_relocation_functions): New forward declaration.
5562 (Target_arm::Target_arm): Initialize new data members
5563 got_mod_index_offset_ and tls_base_symbol_defined_.
5564 (Target_arm::Relocate::relocate_tls): New method.
5565 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
5566 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
5567 New methods.
5568 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
5569 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
5570 (Target_arm::got_mod_index_offset_,
5571 Target_arm::tls_base_symbol_defined_): New data members.
5572 (Target_arm::Scan::local, Target::Scan::global,
5573 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
5574 relocations.
5575
c8761b9a
DK
55762010-02-18 Doug Kwan <dougkwan@google.com>
5577
5578 * arm.cc (Arm_relobj::find_linked_text_section): New method.
5579 (Arm_relobj::make_exidx_input_section): Pass section index of linked
5580 text section as a parameter becuase some broken tools may not set
5581 the link in section header.
5582 (Target_arm::has_got_section): New method.
5583 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
5584 without any mapping symbol as data only. Remove warning.
5585 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
5586 link in its section header, try to discover the link by inspecting the
5587 REL31 relocation at the beginning of the section.
5588 (Target_arm::Scan::check_non_pic): Report name of offending relocation
5589 in error message.
5590 (Target_arm::Scan::global): Treat any reference to the symbol
5591 _GLOBAL_OFFSET_TABLE_ as a GOT access.
5592
21bb3914
ST
55932010-02-12 Sriraman Tallam <tmsriram@google.com>
5594
5595 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
5596 (Scan::global_reloc_may_be_function_pointer): New function.
5597 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
5598 (Scan::global_reloc_may_be_function_pointer): New function.
5599 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
5600 (Scan::global_reloc_may_be_function_pointer): New function.
5601 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
5602 (Scan::global_reloc_may_be_function_pointer): New function.
5603 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
5604 (Scan::global_reloc_may_be_function_pointer): New function.
5605 (Scan::possible_function_pointer_reloc): New function.
5606 (Target_x86_64::can_check_for_function_pointers): New function.
5607 * gc.h (gc_process_relocs): Scan relocation types to determine if
5608 function pointers were taken for targets that support it.
5609 * icf.cc (Icf::find_identical_sections): Include functions for
5610 folding in safe ICF whose pointer is not taken.
5611 * icf.h (Secn_fptr_taken_set): New typedef.
5612 (fptr_section_id_): New member.
5613 (section_has_function_pointers): New function.
5614 (set_section_has_function_pointers): New function.
5615 (check_section_for_function_pointers): New function.
5616 * options.h: Fix comment for safe ICF option.
5617 * target.h (can_check_for_function_pointers): New function.
5618 * testsuite/Makefile.am: Add icf_safe_so_test test case.
5619 Modify icf_safe_test for X86-64.
5620 * testsuite/Makefile.in: Regenerate.
5621 * testsuite/icf_safe_so_test.cc: New file.
5622 * testsuite/icf_safe_so_test.sh: New file.
5623 * testsuite/icf_safe_test.cc (kept_func_3): New function.
5624 (main): Change to take pointer to function kept_func_3.
5625 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
5626 folding is done correctly for X86-64.
5627
0da6fa6c
DM
56282010-02-12 David S. Miller <davem@davemloft.net>
5629
5630 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
5631 is_symbolless parameter.
5632 (Output_reloc<SHT_REL>::is_symbolless): New.
5633 (Output_reloc<SHT_REL>::is_symbolless_): New.
5634 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
5635 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
5636 (Output_reloc<SHT_RELA>::is_symbolless): New.
5637 (Output_data_reloc::add_global): Handle is_symbolless.
5638 (Output_data_reloc::add_global_relative): Likewise.
5639 (Output_data_reloc::add_local): Likewise.
5640 (Output_data_reloc::add_local_relative): Likewise.
5641 (Output_data_reloc::add_symbolless_global_addend): New.
5642 (Output_data_reloc::add_symbolless_local_addend): New.
5643 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
5644 is_symbolless.
5645 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
5646 instead of ->is_relative_
5647 (Output_reloc::write): Likewise.
5648 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
5649 (Output_reloc::write_rel): Simplify.
5650
5651 * sparc.cc (Target_sparc::Scan::local): Use
5652 ->add_symbolless_local_addend as needed.
5653 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
5654 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
5655 based upon relocation offset.
5656
e4782e83
DK
56572010-02-11 Doug Kwan <dougkwan@google.com>
5658
5659 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
5660 (Target_arm::Scan::global): Ditto. Also remove a comment before the
5661 beginning of function.
5662 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
5663 and MOVT_ABS relocations. Those are non issued in scanning. Fix
5664 parameter is_32bit in calls to should_apply_static_reloc.
5665 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
5666 (check_DATA): Add arm_abs_global.stdout.
5667 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
5668 arm_abs_global.stdout): New rules.
5669 (MOSTLLYCLEANFILES): Add arm_abs_global
5670 * Makefile.in: Regenerate.
5671 * testsuite/arm_abs_global.s: New file.
5672 * testsuite/arm_abs_global.sh: Ditto.
5673 * testsuite/arm_abs_lib.s: Ditto.
5674
93ceb764
ILT
56752010-02-11 Ian Lance Taylor <iant@google.com>
5676
5677 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
5678 Read_relocs task.
5679 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
5680 Allocate_commons_task first.
5681 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
5682 task, rather than symtab_lock_.
5683 (Gc_process_relocs::~Gc_process_relocs): New function.
5684 (Gc_process_relocs::is_runnable): Check this_blocker_.
5685 (Gc_process_relocs::locks): Use next_blocker_ rather than
5686 blocker_.
5687 (Scan_relocs::~Scan_relocs): New function.
5688 (Scan_relocs::is_runnable): Check this_blocker_ rather than
5689 symtab_lock_.
5690 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
5691 next_blocker_.
5692 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
5693 fields. Add this_blocker_ and next_blocker_ fields. Adjust
5694 constructor accordingly.
5695 (class Gc_process_relocs): Likewise.
5696 (class Scan_relocs): Likewise.
5697 * common.h (class Allocate_commons_task): Remove symtab_lock_
5698 field, and corresponding constructor parameter.
5699 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
5700 symtab_lock_.
5701 (Allocate_commons_task::locks): Likewise.
5702
114dfbe1
ILT
57032010-02-11 Ian Lance Taylor <iant@google.com>
5704
5705 * gold-threads.h (class Once): Define.
5706 (class Initialize_lock): Rewrite as child of Once.
5707 * gold-threads.cc (class Once_initialize): Define.
5708 (once_pointer_control): New static variable.
5709 (once_pointer, once_arg): New static variables.
5710 (c_run_once): New static function.
5711 (Once::Once, Once::run_once, Once::internal_run): New functions.
5712 (class Initialize_lock_once): Remove.
5713 (initialize_lock_control): Remove.
5714 (initialize_lock_pointer): Remove.
5715 (initialize_lock_once): Remove.
5716 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
5717 (Initialize_lock::initialize): Rewrite.
5718 (Initialize_lock::do_run_once): New function.
5719 * archive.cc (Archive::interpret_header): Only clear name if it is
5720 not already empty.
5721 * fileread.cc: Include "gold-threads.h"
5722 (file_counts_lock): New static variable.
5723 (file_counts_initialize_lock): Likewise.
5724 (File_read::release): Only increment counts when using --stats.
5725 Use a lock around the increment.
5726 * parameters.cc (class Set_parameters_target_once): Define.
5727 (set_parameters_target_once): New static variable.
5728 (Parameters::Parameters): Move here from parameters.h.
5729 (Parameters::set_target): Rewrite.
5730 (Parameters::set_target_once): New function.
5731 (Parameters::clear_target): Move here and rewrite.
5732 * parameters.h (class Parameters): Update declarations. Add
5733 set_parameters_target_once_ field.
5734 (Parameters::Parameters): Move to parameters.cc.
5735 (Parameters::clear_target): Likewise.
5736 * readsyms.cc (Read_symbols::do_group): Create a Start_group
5737 task.
5738 (Start_group::~Start_group): New function.
5739 (Start_group::is_runnable): New function.
5740 (Start_group::locks, Start_group::run): New functions.
5741 (Finish_group::run): Change saw_undefined to size_t.
5742 * readsyms.h (class Start_group): Define.
5743 (class Finish_group): Change saw_undefined_ field to size_t.
5744 (Finish_group::Finish_group): Remove saw_undefined and
5745 this_blocker parameters. Change all callers.
5746 (Finish_group::set_saw_undefined): New function.
5747 (Finish_group::set_blocker): New function.
5748 * symtab.h (class Symbol_table): Change saw_undefined to return
5749 size_t. Change saw_undefined_ field to size_t.
5750 * target-select.cc (Set_target_once::do_run_once): New function.
5751 (Target_selector::Target_selector): Initialize set_target_once_
5752 field. Don't initialize lock_ and initialize_lock_ fields.
5753 (Target_selector::instantiate_target): Rewrite.
5754 (Target_selector::set_target): New function.
5755 * target-select.h (class Set_target_once): Define.
5756 (class Target_selector): Update declarations. Make
5757 Set_target_once a friend. Remove lock_ and initialize_lock_
5758 fields. Add set_target_once_ field.
5759
fa17a3f4
ILT
57602010-02-10 Ian Lance Taylor <iant@google.com>
5761
5762 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
5763 queueing any tasks.
5764 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
5765 (queue_middle_tasks): Add all blockers before queueing any tasks.
5766 (queue_final_tasks): Likewise.
5767 * token.h (Task_token::add_blockers): New function.
5768 * object.h (Input_objects::number_of_relobjs): New function.
5769
c7177d31
ILT
57702010-02-10 Ian Lance Taylor <iant@google.com>
5771
5de0e392
ILT
5772 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
5773 shared, not if not position independent.
5774 * x86_64.cc (Relocate::relocate_tls): Likewise.
5775 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
5776 (tls_pie_pic_test): New target.
5777 * testsuite/Makefile.in: Rebuild.
5778
c7177d31
ILT
5779 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
5780 (tls_test_main_pie.o, tls_test_pie.o): New targets.
5781 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
5782 * testsuite/Makefile.in: Rebuild.
5783
684b268a
DM
57842010-02-09 David S. Miller <davem@davemloft.net>
5785
5786 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
5787 R_SPARC_RELATIVE using ->add_local_relative().
5788 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
5789
612a8d3d
DM
5790 * output.h (Output_data_dynamic::add_section_size): New method
5791 that takes two Output_data objects.
5792 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
5793 entry param. Handle it in initializers.
5794 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
5795 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
5796 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
5797 arg.
5798 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
5799 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
5800 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
5801 for dynrel_includes_plt.
5802 * i386.cc (Target_i386::do_finalize_sections): Likewise.
5803 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5804 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
5805 before .rela.plt
5806 (Target_sparc::do_finalize_sections): Update to pass true for
5807 dynrel_includes_plt.
5808 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
5809 output before .rela.plt
5810 (Target_powerpc::do_finalize_sections): Update to pass true for
5811 dynrel_includes_plt when 32-bit.
5812
cb1be87e
DK
58132010-02-08 Doug Kwan <dougkwan@google.com>
5814
5815 * arm.cc (Arm_relobj::simple_input_section_output_address): New
5816 method.
5817 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
5818 Arm_relobj::scan_section_for_cortex_a8_stubs,
5819 Arm_relobj::do_relocation_section): Instead of calling
5820 Output_section::output_address, use faster
5821 Arm_relobj::simple_input_section_output_address.
5822
705b5121
DM
58232010-02-08 David S. Miller <davem@davemloft.net>
5824
5825 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
5826 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
5827 relocation helper function.
5828
024c4466
DM
5829 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
5830 just like R_SPARC_GOT{10,13,22}.
5831 (Target_sparc::Scan::local): Likewise.
5832 (Target_sparc::Relocate:relocate): Likewise.
5833
9109c078
ILT
58342010-02-06 Ian Lance Taylor <iant@google.com>
5835
5836 * configure.ac: Rewrite targetobjs duplicate removal code to use
5837 only shell constructs.
5838 * configure: Rebuild.
5839
cf846138
DK
58402010-02-05 Doug Kwan <dougkwan@google.com>
5841
5842 PR 11247
5843 * arm.cc (Arm_relobj::section_is_scannable): New method.
5844 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
5845 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
5846
6cfaf60b
DK
58472010-02-04 Doug Kwan <dougkwan@google.com>
5848
5849 PR 11247
5850 * arm-reloc-property.cc (cstdio): Include.
5851 * configure.ac (targetobjs): Remove duplicates.
5852 * configure: Regenerate.
5853 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
5854 big and little endian version for a given address size.
5855
5c57f1be
DK
58562010-02-03 Doug Kwan <dougkwan@google.com>
5857
5858 * arm-reloc-property.cc
5859 (Arm_reloc_property_table::reloc_name_in_error_message): New method
5860 definition.
5861 * arm-reloc-property.h
5862 (Arm_reloc_property_table::get_implemented_static_reloc_property):
5863 New method definition.
5864 (Arm_reloc_property_table::reloc_name_in_error_message): New method
5865 declaration.
5866 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
5867 overflow to N.
5868 (GOT_PREL): Change implemented to Y.
5869 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
5870 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
5871 (Arm_relocate_functions::movw_abs_nc): Remove method.
5872 (Arm_relocate_functions::movt_abs): Ditto.
5873 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
5874 (Arm_relocate_functions::thm_movt_abs): Ditto.
5875 (Arm_relocate_functions::movw_rel_nc): Ditto.
5876 (Arm_relocate_functions::movw_rel): Ditto.
5877 (Arm_relocate_functions::movt_rel): Ditto.
5878 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
5879 (Arm_relocate_functions:thm_movw_rel): Ditto.
5880 (Arm_relocate_functions:thm_movt_rel): Ditto.
5881 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
5882 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
5883 New method definitions.
5884 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
5885 (Arm_relocation_functions::arm_grp_ldr): Ditto.
5886 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
5887 (Arm_relocation_functions::arm_grp_ldc): Ditto.
5888 (Target_arm::Relocate::relocate): Check for non-static or
5889 unimplemented relocation code and exit early. Change calls to
5890 Target_arm::reloc_uses_thumb_bit and
5891 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
5892 instead. Refactor code to handle similar relocations to increase
5893 code sharing. Remove check for unsupported relocation code in switch
5894 statement.
5895 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
5896 relocation property table to find out size. Change error message to
5897 print out the name of a relocation code instead of the numeric value.
5898 (Target_arm::scan_reloc_for_stub): Use relocation property table
5899 instead of calling Target_arm::reloc_uses_thumb_bit().
5900
218c5831
DK
59012010-02-02 Doug Kwan <dougkwan@google.com>
5902
5903 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
5904 types of relaxed input section.
5905
0d31c79d
DK
59062010-02-02 Doug Kwan <dougkwan@google.com>
5907
5908 * Makefile.am (HFILES): Add arm-reloc-property.h.
5909 (DEFFILES): New.
5910 (TARGETSOURCES): Add arm-reloc-property.cc
5911 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
5912 (libgold_a_SOURCES): $(DEFFILES)
5913 * Makefile.in: Regenerate.
5914 * arm-reloc-property.cc: New file.
5915 * arm-reloc-property.h: New file.
5916 * arm-reloc.def: New file.
5917 * arm.cc: Update comments.
5918 (arm-reloc-property.h): New included header.
5919 (arm_reloc_property_table): New global variable.
5920 (Target_arm::do_select_as_default_target): New method definition.
5921 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
5922 arm-reloc-property to targ_extra_obj.
5923 * parameters.cc (set_parameters_target): Call
5924 Target::select_as_default_target().
5925 * target.h (Target::select_as_default_target): New method definition.
5926 (Target::do_select_as_default_target): Same.
5927
546c7457
DK
59282010-02-01 Doug Kwan <dougkwan@google.com>
5929
5930 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
5931 first_output_text_section_.
5932 (Arm_exidx_fixup::first_output_text_section): New method definition.
5933 (Arm_exidx_fixup::first_output_text_section_): New data member.
5934 (Arm_exidx_fixup::process_exidx_section): Record the first text
5935 output section seen.
5936 (Arm_output_section::fix_exidx_coverage): Set correct linked section
5937 and entsize in output section header.
5938
11b861d5
DK
59392010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5940
5941 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
5942 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
5943 (Arm_relocate_functions::thm_alu11): New Method.
5944 (Arm_relocate_functions::thm_pc8): New Method.
5945 (Arm_relocate_functions::thm_pc12): New Method.
5946 (Target_arm::Scan::local): Handle the relocations.
5947 (Target_arm::Scan::global): Likewise.
5948 (Target_arm::Relocate::relocate): Likewise.
5949 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
5950
c9a2c125
DK
59512010-01-29 Doug Kwan <dougkwan@google.com>
5952
5953 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
5954 of relocation types as ld.
5955
1521477a
DK
59562010-01-29 Doug Kwan <dougkwan@google.com>
5957
5958 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
5959 to public.
5960 (Arm_relocate_functions::thumb_branch_common): Ditto.
5961 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
5962 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
5963 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
5964 Arm_relocate_functions::jump24): Remove.
5965 (Target_arm::Relocate::relocate): Adjust code to call
5966 Arm_relocation_functions::arm_branch_common and
5967 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 5968 wrappers. Merge switch-cases together to reduce source code size.
1521477a 5969
e7eca48c
DK
59702010-01-29 Doug Kwan <dougkwan@google.com>
5971
5972 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
5973 output_local_symbol_count_needs_update_.
5974 (Arm_relobj::output_local_symbol_count_needs_update,
5975 Arm_relobj::set_output_local_symbol_count_needs_update,
5976 Arm_relobj::update_output_local_symbol_count): New methods.
5977 (Arm_relobj::output_local_symbol_count_needs_update_): New data
5978 member.
5979 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
5980 of pointed function as in a R_ARM_PREL31 relocation.
5981 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
5982 for output local symbol count updating.
5983 (Target_arm::do_relax): Update output local symbol counts in objects
5984 if necessary.
5985 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
5986
02961d7e
ILT
59872010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5988
5989 * arm.cc: Added support for the ARM relocations:
5990 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
5991 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
5992 (Arm_relocate_functions::movw_rel_nc): Renamed (was
5993 movw_prel_nc).
5994 (Arm_relocate_functions::movw_rel): New method.
5995 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
5996 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
5997 thm_movw_prel_nc).
5998 (Arm_relocate_functions::thm_movw_rel): New method.
5999 (Arm_relocate_functions::thm_movt_rel): Renamed (was
6000 thm_movt_prel).
6001 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
6002 relocations.
6003 (Target_arm::Scan::global): Likewise.
6004 (Target_arm::Relocate::relocate): Likewise.
6005 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6006 Likewise.
6007
b10d2873
ILT
60082010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6009
6010 * arm.cc: Added support for ARM group relocations.
6011 (Target_arm::reloc_needs_sym_origin): New method.
6012 (Arm_relocate_functions::calc_grp_kn): New method.
6013 (Arm_relocate_functions::calc_grp_residual): New method.
6014 (Arm_relocate_functions::calc_grp_gn): New method.
6015 (Arm_relocate_functions::arm_grp_alu): New Method.
6016 (Arm_relocate_functions::arm_grp_ldr): New Method.
6017 (Arm_relocate_functions::arm_grp_ldrs): New Method.
6018 (Arm_relocate_functions::arm_grp_ldc): New Method.
6019 (Target_arm::Scan::local): Handle the ARM group relocations.
6020 (Target_arm::Scan::global): Likewise.
6021 (Target_arm::Relocate::relocate): Likewise.
6022 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6023 Likewise.
6024
2b328d4e
DK
60252010-01-26 Doug Kwan <dougkwan@google.com>
6026
6027 * arm.cc (set): Include.
6028 (class Arm_exidx_fixup): Change type of last_input_section_ to const
6029 pointer type.
6030 (Arm_output_section::Text_section_list): New type.
6031 (Arm_output_section::append_text_sections_to_list): New method.
6032 (Arm_output_section::fix_exidx_coverage): Ditto.
6033 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
6034 (Arm_relobj::convert_input_section_to_relaxed_section): Use
6035 Relobj::set_section_offset() instead of
6036 Sized_relobj::invalidate_section_offset().
6037 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
6038 parameter for section headers. Ignore relocation sections for
6039 unallocated sections and EXIDX sections.
6040 (Target_arm::fix_exidx_coverage): New method.
6041 (Target_arm::output_section_address_less_than): New type.
6042 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
6043 linked text section instead of the EXIDX section.
6044 (Arm_output_section::create_stub_group): Add an assertion to check
6045 that this is not an EXIDX output section.
6046 (Arm_output_section::append_text_sections_to_list): New method.
6047 (Arm_output_section::fix_exidx_coverage): Ditto.
6048 (Arm_relobj::scan_sections_for_stubs): Adjust call to
6049 Arm_relobj::section_needs_reloc_stub_scanning.
6050 (Target_arm::do_relax): Fix EXIDX output section coverage in the
6051 first pass.
6052 (Target_arm::fix_exidx_coverage): New method.
6053 * object.h (Relobj::set_output_section): New method.
6054 (Sized_relobj::invalidate_section_offset): Remove method.
6055 (Sized_relobj::do_invalidate_section_offset): Remove method.
6056 (Sized_relobj::do_set_section_offset): Handle offset value -1.
6057
c7f3c371
DK
60582010-01-25 Doug Kwan <dougkwan@google.com>
6059
6060 * arm.cc (Arm_exidx_merged_section::do_output_offset):
6061 Fix warning due to signed and unsigned comparison on a 32-bit host.
6062
8923b24c
DK
60632010-01-22 Doug Kwan <dougkwan@google.com>
6064
6065 * arm.cc (Target_arm::do_relax): Record an output section for section
6066 offset adjustment it contains any stub table that has changed.
6067 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
6068 offsets in an output section if necessary.
6069 * output.cc (Output_section::Output_section): Initialize
6070 section_offsets_need_adjustments_.
6071 (Output_section::add_input_section_for_script): Renamed to
6072 Output_section::add_simple_input_section.
6073 (Output_section::save_states): Add a comment.
6074 (Output_section::discard_states): New method defintion.
6075 (Output_section::adjust_section_offsets): Same.
6076 * output.h (Output_section::add_input_section_for_script): Renamed to
6077 Output_section::add_simple_input_section.
6078 (Output_section::discard_states): New method declaration.
6079 (Output_section::adjust_section_offsets): Same.
6080 (Output_section::section_offsets_need_adjustment,
6081 Output_section::set_section_offsets_need_adjustment): New method
6082 definitions.
6083 (Output_section::section_offsets_need_adjustment_): New data member.
6084 * script-sections.cc
6085 (Output_section_element_input::set_section_address): Adjust code for
6086 renaming of Output_section::add_input_section_for_script.
6087 (Orphan_output_section::set_section_address): Same.
6088
9b2fd367
DK
60892010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6090
6091 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
6092 Fix_v4bx enum values .
6093 * gold/options.h (General_options): New option definitions.
6094 (General_options::fix_v4bx): New method.
6095 (General_options::Fix_v4bx): New enum.
6096 * gold/options.cc (General_options::parse_fix_v4bx): New method.
6097 (General_options::parse_fix_v4bx_interworking): New method.
6098
80d0d023
DK
60992010-01-22 Doug Kwan <dougkwan@google.com>
6100
6101 * arm.cc (Arm_exidx_fixup): New class.
6102
af2cdeae
DK
61032010-01-21 Doug Kwan <dougkwan@google.com>
6104
6105 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
6106 classes.
6107 (Arm_exidx_section_offset_map): New type.
6108
993d07c1
DK
61092010-01-21 Doug Kwan <dougkwan@google.com>
6110
6111 * arm.cc (Arm_exidx_input_section): New class.
6112 (Arm_relobj::exidx_input_section_by_link,
6113 Arm_relobj::exidx_input_section_by_shndx,
6114 Arm_relobj::make_exidx_input_section): New methods.
6115 (read_arm_attributes_section): Remove.
6116 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
6117 information about them.
6118 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
6119 to here.
6120
5ac169d4
DK
61212010-01-20 Doug Kwan <dougkwan@google.com>
6122
6123 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
6124 Input_section_specifier to Section_id.
6125 (Target_arm::new_arm_input_section: Adjust code for change of key
6126 type.
6127 (Target_arm::find_arm_input_section): Ditto.
6128 * gc.h (object.h): Include for Section_id nand Section_id_hash.
6129 (Section_id): Remove.
6130 (Garbage_collection::Section_id_hash): Remove.
6131 * icf.h (object.h): Include for Section_id nand Section_id_hash.
6132 (Section_id): Remove.
6133 (Icf::Section_id_hash): Remove.
6134 * object.h (Section_id, Const_section_id, Section_id_hash,
6135 Const_section_id_hash): New type definitions.
6136 * output.cc (Output_section::add_relaxed_input_section): Change to
6137 use Const_section_id instead of Input_section_specifier as key type.
6138 (Output_section::add_merge_input_section): Ditto.
6139 (Output_section::build_relaxation_map): Change to use Section_id
6140 instead of Input_section_specifier as key type.
6141 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6142 Ditto.
6143 (Output_section::convert_input_sections_to_relaxed_sections): Change
6144 to use Const_section_id instead of Input_section_specifier as key type.
6145 (Output_section::find_merge_section): Ditto.
6146 (Output_section::find_relaxed_input_section): Ditto.
6147 * output.h (Input_section_specifier): Remove class.
6148 (Output_section::Output_section_data_by_input_section_map): Change
6149 key type to Const_section_id.
6150 (Output_section::Output_relaxed_input_section_by_input_section_map):
6151 Ditto.
6152 (Output_section::Relaxation_map): Change key type to Section_id.
6153
a2162063
ILT
61542010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6155
6156 * gold/arm.cc: Added support for R_ARM_V4BX relocation
6157 (class Arm_v4bx_stub): New class.
6158 (DEF_STUBS): Updated definition to support v4_veneer_bx.
6159 (Stub_factory::make_arm_v4bx_stub): New method.
6160 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
6161 (Stub_table::empty): Handle v4bx stubs.
6162 (Stub_table::add_arm_v4bx_stub): New method.
6163 (Stub_table::find_arm_v4bx_stub): New method.
6164 (Arm_relocate_functions::v4bx): New method.
6165 (Target_arm::fix_v4bx): New method.
6166 (Target_arm::Target_arm): Handle R_ARM_V4BX.
6167 (Stub_table::relocate_stubs): Likewise.
6168 (Stub_table::do_write): Likewise.
6169 (Stub_table::update_data_size_and_addralign): Likewise.
6170 (Stub_table::finalize_stubs): Likewise.
6171 (Target_arm::Scan::local): Likewise.
6172 (Target_arm::Scan::global): Likewise.
6173 (Target_arm::do_finalize_sections): Likewise.
6174 (Target_arm::Relocate::relocate): Likewise.
6175 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6176 Likewise.
6177 (Target_arm::scan_reloc_for_stub): Likewise.
6178 (Target_arm::scan_reloc_section_for_stubs): Likewise.
6179
5696ab0b
ILT
61802010-01-19 Ian Lance Taylor <iant@google.com>
6181
6182 * output.cc (Output_section_headers::do_sized_write): Write large
6183 segment count to sh_info field.
6184 (Output_file_header::do_sized_write): For large segment count,
6185 write PN_XNUM to e_phnum field.
6186
800d0f56
ILT
61872010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6188
6189 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
6190 (Arm_relocate_functions::thm_jump8): New function.
6191 (Arm_relocate_functions::thm_jump11): New function.
6192 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
6193 R_ARM_THM_JUMP11.
6194 (Target_arm::Scan::global): Likewise.
6195 (Target_arm::Relocate::relocate): Likewise.
6196 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6197 Likewise.
6198
41263c05
DK
61992010-01-14 Doug Kwan <dougkwan@google.com>
6200
6201 * arm.cc (map, utility): Include headers.
6202 (Target_arm::apply_cortex_a8_workaround): New method.
6203 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
6204 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
6205 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
6206 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
6207 the --[no-]fix-cortex-a8 command line options.
6208 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
6209 (Target_arm::relocate_stub): Use addend in instruction template.
6210 * options.h (DEFINE_bool): Set the user-set flag.
6211 (General_options): Add --[no-]-fix-cortex options.
6212 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 6213 : Update fast look-up map after conversion.
41263c05 6214
459e9b03
ST
62152010-01-14 Sriraman Tallam <tmsriram@google.com>
6216
6217 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
6218 in the first pass of do_layout.
6219
b521dfe4
DK
62202010-01-13 Doug Kwan <dougkwan@google.com>
6221
6222 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
6223 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
6224 apparent compiler problem of not folding static constant integral
6225 data members of elfcpp::Elf_sizes<32>.
6226
44272192
DK
62272010-01-13 Doug Kwan <dougkwan@google.com>
6228
6229 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
6230 Arm_relobj::section_needs_cortex_a8_stub_scanning,
6231 Arm_relobj::scan_section_for_cortex_a8_erratum,
6232 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
6233 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
6234 sections to scan for relocation stubs into a new method
6235 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
6236 relocation and Cortex-A8 stub scanning.
6237 (Target_arm::do_relax): Force stubs to be after stubbed sections
6238 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 6239 the beginning of a new relaxation pass. Update a comment.
44272192
DK
6240 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
6241
44b71ece
ILT
62422010-01-12 Ian Lance Taylor <iant@google.com>
6243
6244 * target-reloc.h (visibility_error): New inline function.
6245 (relocate_section): Call visibility_error.
6246 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
6247 (MOSTLYCLEANFILES): Likewise.
6248 (protected_4_pic.o, protected_3.err): New targets.
6249 * testsuite/protected_4.cc: New file.
6250
a120bc7f
DK
62512010-01-12 Doug Kwan <dougkwan@google.com>
6252
6253 * arm.cc (Cortex_a8_reloc): New class.
6254 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
6255 and cortex_a8_relocs_info_.
6256 (Target_arm::fix_cortex_a8): New method definition.
6257 (Target_arm::Cortex_a8_relocs_info): New type.
6258 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
6259 New data member declarations.
6260 (Target_arm::scan_reloc_for_stub): Record information about
6261 relocations for THUMB branches that might be exempted from the
6262 Cortex-A8 workaround.
6263 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
6264 at the beginning of a relaxation pass.
6265
20138696
DK
62662010-01-12 Doug Kwan <dougkwan@google.com>
6267
6268 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
6269 (Arm_relobj::Mapping_symbol_position,
6270 Arm_reloj::Mapping_symbol_position_less,
6271 Arm_relobj::Mapping_symbols_info): New types.
6272 (Target_arm::is_mapping_symbol_name): New method definition.
6273 (Arm_relobj::do_count_local_symbols): Save information about mapping
6274 symbols.
6275
089d69dc
DK
62762010-01-11 Doug Kwan <dougkwan@google.com>
6277
6278 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
6279 Arm_relocate_functions::thumb32_branch_upper,
6280 Arm_relocate_functions::thumb32_branch_lower,
6281 Arm_relocate_functions::thumb32_cond_branch_offset,
6282 Arm_relocate_functions::thumb32_cond_branch_upper,
6283 Arm_relocate_functions::thumb32_cond_branch_lower,
6284 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
6285 branch offset encoding.
6286 (Arm_relocate_functions::thumb_branch_common): Use new branch
6287 offset encoding methods to avoid code duplication.
6288 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
6289 (Stub_addend_reader::operator()): Use new branch encoding method
6290 to avoid code duplication.
6291
99e5bff2
DK
62922010-01-11 Doug Kwan <dougkwan@google.com>
6293
6294 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
6295 (Target_arm::do_finalize_sections): Define special EXIDX section
6296 symbols only if referenced.
6297 * gc.h (Garbage_collection::add_reference): New method.
6298 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
6299 code duplication.
6300
98e090bd
ILT
63012010-01-11 Ian Lance Taylor <iant@google.com>
6302
d0a91bd8
ILT
6303 * script.cc (Version_script_info::build_expression_list_lookup):
6304 Change complaing about duplicate wildcard match from error to
6305 warning.
6306
98e090bd
ILT
6307 * script.cc (class Lazy_demangler): Recreate--revert part of patch
6308 of 2009-12-30.
6309 (Version_script_info::Version_script_info): Initialize globs_,
6310 default_version_, default_is_global_, and exact_. Don't
6311 initialize globals_ or locals_.
6312 (Version_script_info::build_lookup_tables): Build local symbols
6313 first.
6314 (Version_script_info::unquote): New function.
6315 (Version_script_info::add_exact_match): New function.
6316 (Version_script_info::build_expression_list_lookup): Remove lookup
6317 parameter. Add is_global parameter. Change all callers. Handle
6318 wildcard pattern specially. Unquote pattern. Call
6319 add_exact_match.
6320 (Version_script_info::get_name_to_match): New function.
6321 (Version_script_info::get_symbol_version): New function.
6322 (Version_script_info::get_symbol_version_helper): Remove.
6323 (Version_script_info::check_unmatched_names): Call unquote.
6324 * script.h (class Version_script_info): Change get_symbol_version
6325 to be non-inline and add is_global parameter; change all callers.
6326 Rewrite symbol_is_local. Update declarations. Define struct
6327 Version_tree_match, Exact, Globs. Don't define struct Lookup.
6328 Remove globals_ and locals_ members. Add exact_, globs_,
6329 default_version_, is_global_.
6330 (Version_script_info::Glob): Remove pattern, add expression and
6331 is_global. Update constructor. Change all callers.
6332 * dynobj.cc (Versions::finalize): Mark the version symbol as the
6333 default version.
6334 (Versions::symbol_section_contents): If a symbol is undefined, or
6335 defined in a dynamic object, set the version index to
6336 VER_NDX_LOCAL.
6337 * symtab.cc (Symbol_table::add_from_relobj): Don't call
6338 symbol_is_local.
6339 (Symbol_table::add_from_pluginobj): Likewise.
6340 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
6341
d56962d3
DK
63422010-01-11 Doug Kwan <dougkwan@google.com>
6343
6344 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
6345 (incremental_dump_LDADD): Add linking option for libintl.
6346 * Makefile.in: Regenerate.
6347
94e6ee91
L
63482010-01-11 H.J. Lu <hongjiu.lu@intel.com>
6349
6350 PR gold/11144
6351 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
6352 instead of -Ds.
6353 * testsuite/Makefile.in: Regenerated.
6354
e96c574b
DK
63552010-01-10 Doug Kwan <dougkwan@google.com>
6356
6357 * options.h (DEFINE_var): Use parentheses around argument varname__
6358 in macro body to avoid any unintended subsequent substitutions.
6359
7198066b
ILT
63602010-01-10 Ian Lance Taylor <iant@google.com>
6361
ba4d53bf
ILT
6362 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
6363 candidates before doing symbol resolution.
6364
7198066b
ILT
6365 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
6366 ODR candidates if only one is weak.
6367
a2beed37
ILT
63682010-01-08 Ian Lance Taylor <iant@google.com>
6369
6370 * script.cc (Version_script_info::build_expression_list_lookup):
6371 Don't warn about ambiguous version, just record the ambiguity.
6372 (Version_script_info::get_symbol_version_helper): Give error if
6373 version is ambiguous.
6374
2fb7225c
DK
63752010-01-08 Doug Kwan <dougkwan@google.com>
6376
6377 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
6378 prev_data_size_ and prev_addralign_. Remove initializer for
6379 deleted data member has_been_changed_.
6380 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
6381 to determine if the table is empty.
6382 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
6383 Remove.
6384 (Stub_table::add_reloc_stub): Define method in class definition
6385 instead of just declaring it there.
6386 (Stub_table::add_cortex_a8_stub): New method definition.
6387 (Stub_table::update_data_size_and_addralign): Ditto.
6388 (Stub_table::finalize_stubs): Ditto.
6389 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
6390 (Stub_table::do_addralign_): Return address alignment in the
6391 (Stub_table::do_reset_address_and_file_offset): Define method in
6392 class definition instead of declaring it there. Set current data
6393 size to be the data size of the previous pass.
6394 (Stub_table::set_final_data_size): Use current data size as the
6395 final data size.
6396 (Stub_table::relocate_stub): Change parameter type of stub from
6397 Reloc_stub pointer to Stub pointer.
6398 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
6399 (Stub_table::Cortex_a8_stub_list): New typedef.
6400 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
6401 Stub_table::prev_addralign_): New data member.
6402 (Arm_relobj::Arm_relobj): Initialize data member
6403 section_has_cortex_a8_workaround_.
6404 (Arm_relobj::section_has_cortex_a8_workaround,
6405 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
6406 definitions.
6407 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
6408 declarations.
6409 (Target_arm::relocate_stub): Change parameter type of stub from
6410 Reloc_stub pointer to Stub pointer.
6411 (Insn_template::size, Insn_template::alignment): Handle
6412 THUMB16_SPECIAL_TYPE.
6413 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
6414 Stub_table::update_data_size_and_addralign,
6415 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
6416 definitions.
6417 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
6418 (Stub_table::do_write): Ditto.
6419 (Target_arm::do_relax): Adjust code for changes in Stub_table.
6420
880cd20d
ILT
64212010-01-08 Ian Lance Taylor <iant@google.com>
6422
6423 PR 11108
6424 * symtab.h (class Symbol): Remove fields is_target_special_ and
6425 has_plt_offset_. Add field is_defined_in_discarded_section_.
6426 (Symbol::is_defined_in_discarded_section): New function.
6427 (Symbol::set_is_defined_in_discarded_section): New function.
6428 (Symbol::has_plt_offset): Rewrite.
6429 (Symbol::set_plt_offset): Verify that new offset is not -1U.
6430 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
6431 Don't initialize is_target_special_ or has_plt_offset_.
6432 Initialize is_defined_in_discarded_section_.
6433 (Symbol_table::add_from_relobj): If appropriate, set
6434 is_defined_in_discarded_section.
6435 * resolve.cc (Symbol::override_base_with_special): Don't test
6436 is_target_special_. Change has_plt_offset_ to has_plt_offset().
6437 * target-reloc.h (relocate_section): Do special handling for
6438 symbols defined in discarded sections for global symbols as well
6439 as local symbols.
6440
2703e3eb
ILT
64412010-01-08 Ian Lance Taylor <iant@google.com>
6442
6443 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
6444 the SHT_SYMTAB case.
6445
339d40a3
ILT
64462010-01-08 Ian Lance Taylor <iant@google.com>
6447
6448 * object.cc (Sized_relobj::do_layout): Don't get confused if
6449 layout_eh_frame returns NULL.
6450
abecea76
ILT
64512010-01-08 Ian Lance Taylor <iant@google.com>
6452
6453 PR 11084
6454 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
6455 dynamic symbol table, use the normal symbol table.
6456 (Sized_dynobj::do_read_symbols): Remove assertion about type of
6457 symbol table.
6458
6b7dd3f3
ILT
64592010-01-08 Ian Lance Taylor <iant@google.com>
6460
6461 PR 11072
6462 * layout.cc (Layout::include_section): Remove .gnu_debuglink
6463 sections.
6464
36c50e63
L
64652010-01-08 H.J. Lu <hongjiu.lu@intel.com>
6466
6467 * version.cc (print_version): Change to "Copyright 2010".
6468
e291e7b9
ILT
64692010-01-08 Ian Lance Taylor <iant@google.com>
6470
6471 PR 10287
6472 PR 11063
6473 * i386.cc (class Target_i386): Change return type of plt_section
6474 to be non-const.
6475 (class Output_data_plt_i386): Add tls_desc_rel_ field.
6476 (Output_data_plt_i386::Output_data_plt_i386): Initialize
6477 tls_desc_rel_ field.
6478 (Output_data_plt_i386::rel_tls_desc): New function.
6479 (Target_i386::rel_tls_desc_section): New function.
6480 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
6481 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
6482 R_386_TLS_DESC reloc in rel_tls_desc_section.
6483 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
6484 Define struct Tlsdesc_info.
6485 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
6486 (Target_x86_64::do_reloc_symbol_index): New function.
6487 (Target_x86_64::add_tlsdesc_info): New function.
6488 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
6489 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
6490 tlsdesc_rel_ field.
6491 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
6492 all callers.
6493 (Output_data_plt_x86_64::rela_tlsdesc): New function.
6494 (Target_x86_64::rela_tlsdesc_section): New function.
6495 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
6496 handling.
6497 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
6498 (Target_x86_64::do_reloc_addend): New function.
6499 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
6500 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
6501 declarations. Define TARGET_CODE. Add arg field to u1_ union.
6502 (Output_reloc::type): New function.
6503 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
6504 (Output_reloc::is_target_specific): New function.
6505 (Output_reloc::target_arg): New function.
6506 (class Output_reloc) [SHT_RELA]: Add four new constructors for
6507 absolute relocs and target specific relocs.
6508 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
6509 add_target_specific.
6510 (class Output_data_reloc) [SHT_RELA]: Likewise.
6511 * output.cc (Output_reloc::Output_reloc): Add four new versions
6512 for absolute relocs and target specific relocs.
6513 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
6514 (Output_reloc::get_symbol_index): Likewise.
6515 (Output_reloc::local_section_offset): Check that local_sym_index_
6516 is not TARGET_CODE or 0.
6517 (Output_reloc::symbol_value): Likewise.
6518 (Output_reloc::write) [SHT_RELA]: Call target for target specific
6519 reloc.
6520 * target.h (class Target): Add reloc_symbol_index and reloc_addend
6521 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
6522 functions.
6523 * layout.cc (add_target_dynamic_tags): Use output section for
6524 DT_PLTRELSZ and DT_JMPREL.
6525
3a44184e
ILT
65262010-01-07 Ian Lance Taylor <iant@google.com>
6527
6528 PR 11061
6529 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
6530 function.
6531 (class Output_data_reloc_generic): Define.
6532 (class Output_data_reloc_base): Change base class to
6533 Output_data_reloc_generic. Change add() method to call
6534 bump_relative_reloc_count for a relative reloc. Remove
6535 sort_relocs_ field.
6536 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
6537 to sort_relocs().
6538 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
6539 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
6540 appropriate.
6541 * layout.h (class Layout): Update declaration.
6542
ea715a34
ILT
65432010-01-07 Ian Lance Taylor <iant@google.com>
6544
6545 * output.h (class Output_data): Add const version of
6546 output_section and do_output_section.
6547 (class Output_section_data): Add const version of
6548 do_output_section.
6549 (class Output_section): Likewise.
6550 * layout.cc (Layout::add_target_dynamic_tags): New function.
6551 * layout.h (class Layout): Update declarations.
6552 * arm.cc (Target_arm::do_finalize_sections): Use
6553 add_target_dynamic_tags.
6554 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6555 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
6556 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
6557 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6558
659948a4
ILT
65592010-01-07 Ian Lance Taylor <iant@google.com>
6560
6561 PR 11042
6562 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
6563 object as needed.
6564
9d3b86f6
ILT
65652010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
6566 Ian Lance Taylor <iant@google.com>
6567
6568 PR 11019
6569 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
6570 Xindex::read_symtab_xindex.
6571
bb0d3eb0
DK
65722010-01-07 Doug Kwan <dougkwan@google.com>
6573
6574 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
6575 (Insn_template::thumb16_bcond_insn): New method declaration.
6576 (Insn_template): Fix spelling.
6577 (Stub::thumb16_special): New method declaration.
6578 (Stub::do_write): Define virtual method which was previously pure
6579 virtual.
6580 (Stub::do_thumb16_special): New method declaration.
6581 (Stub::do_fixed_endian_write): New template member.
6582 (Reloc_stub::do_write): Remove.
6583 (Reloc_stub::do_fixed_endian_write): Remove.
6584 (Cortex_a8_stub): New class definition.
6585 (Stub_factory::make_cortex_a8_stub): New method definition.
6586 (Stub_factory::Stub_factory): Add missing static storage class
6587 qualifier for elf32_arm_stub_a8_veneer_blx.
6588
ffeef7df
ILT
65892010-01-07 Ian Lance Taylor <iant@google.com>
6590
dc3f80fe
ILT
6591 PR 10980
6592 * options.h (class General_options): Add --warn-unresolved-symbols
6593 and --error-unresolved-symbols.
6594 * errors.cc (Errors::undefined_symbol): Implement
6595 --warn-unresolved-symbols.
6596
ffeef7df
ILT
6597 * options.h (class General_options): Add -z text and -z textoff.
6598 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
6599
f1ec9ded
ST
66002010-01-06 Sriraman Tallam <tmsriram@google.com>
6601
6602 * gc.h (Garbage_collection::Cident_section_map): New typedef.
6603 (Garbage_collection::cident_sections): New function.
6604 (Garbage_collection::add_cident_section): New function.
6605 (Garbage_collection::cident_sections_): New member.
6606 (gc_process_relocs): Add references to sections whose names are C
6607 identifiers.
6608 * gold.h (cident_section_start_prefix): New constant.
6609 (cident_section_stop_prefix): New constant.
6610 (is_cident): New function.
6611 * layout.cc (Layout::define_section_symbols): Replace string constants
6612 with the newly defined constants.
6613 * object.cc (Sized_relobj::do_layout): Track sections whose names are
6614 C identifiers.
6615 * testsuite/Makefile.am: Add gc_orphan_section_test.
6616 * testsuite/Makefile.in: Regenerate.
6617 * testsuite/gc_orphan_section_test.cc: New file.
6618 * testsuite/gc_orphan_section_test.sh: New file.
6619
6eda8c29
ILT
66202010-01-06 Ian Lance Taylor <iant@google.com>
6621
b9674e17
ILT
6622 PR 10980
6623 * options.h (class General_options): Add --warn-shared-textrel.
6624 * layout.cc (Layout::finish_dynamic_section): Implement
6625 --warn-shared-textrel.
6626
6eda8c29
ILT
6627 PR 10980
6628 * options.h (class General_options): Add --warn-multiple-gp.
6629
32dcd44e
ILT
66302010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6631
6632 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
6633 $(THREADSLIB) and $(LIBDL).
6634 * Makefile.in: Rebuild.
6635
a192ba05
ILT
66362010-01-06 Ian Lance Taylor <iant@google.com>
6637
6638 PR 10980
6639 * options.cc (General_options::parse_section_start): New function.
6640 (General_options::section_start): New function.
6641 (General_options::General_options): Initialize all members.
6642 * options.h: Include <map>
6643 (class General_options): Add --section-start. Add section_starts_
6644 member.
6645 * layout.cc (Layout::attach_allocated_section_to_segment): If
6646 --section-start was used, set the address of the segment. Remove
6647 local sort_sections.
6648 (Layout::relaxation_loop_body): If the address of the load segment
6649 has been set by --section-start, don't use it.
6650 * output.h (Output_segment::update_flags_for_output_section): New
6651 function.
6652 * output.cc (Output_segment::add_output_section): Call
6653 update_flags_for_output_section.
6654
dde3f402
ILT
66552010-01-05 Ian Lance Taylor <iant@google.com>
6656
62dfdd4d
ILT
6657 PR 10980
6658 * options.h (class General_options): Add --undefined-version.
6659 * script.cc (struct Version_expression): Add was_matched_by_symbol
6660 field.
6661 (Version_script_info::matched_symbol): New function.
6662 (Version_script_info::get_symbol_version_helper): Call
6663 matched_symbol.
6664 (Version_script_info::check_unmatched_names): New function.
6665 * script.h (class Version_script_info): Update declarations.
6666 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
6667
9c4ae156
ILT
6668 * options.h (class General_options): Use DEFINE_bool_alias for
6669 allow_multiple_definition.
6670 * resolve.cc (Symbol_table::should_override): Don't test
6671 allow_multiple_definition.
6672
dde3f402
ILT
6673 PR 10980
6674 * options.h (class General_options): Add --cref.
6675 * main.cc (main): Print cref table if --cref. Don't close mapfile
6676 until after printing cref table.
6677 * cref.cc: Include "symtab.h".
6678 (class Cref_inputs): Define Cref_table_compare and Cref_table.
6679 (Cref_table_compare::operator()): New function.
6680 (Cref_inputs::gather_cref): New function.
6681 (filecol): New static const.
6682 (Cref_inputs::print_cref): New function.
6683 (Cref::print_cref): New function.
6684 * cref.h: Include <cstdio>.
6685 (class Cref): Update declarations.
6686 * mapfile.h (Mapfile::file): New function.
6687 * object.h (class Object): Define Symbols. Declare virtual
6688 do_get_global_symbols.
6689 (Object::get_global_symbols): New function.
6690 * object.cc (Input_objects::add_object): Pass object to cref_ if
6691 --cref.
6692 (Input_objects::archive_start): Likewise.
6693 (Input_objects::archive_stop): Likewise.
6694 (Input_objects::print_cref): New function.
6695 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
6696 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
6697 --cref.
6698 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
6699 function.
6700 * plugin.h (class Sized_pluginobj): Update declarations.
6701
8781f709
ILT
67022010-01-05 Ian Lance Taylor <iant@google.com>
6703
6704 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
6705 to is_default_version. Rename insdef to insdefault.
6706 (Symbol_table::add_from_relobj): Rename def to is_default_version
6707 and local to is_forced_local.
6708 (Symbol_table::add_from_pluginobj): Likewise.
6709 (Symbol_table::add_from_dynobj): Likewise.
6710 (Symbol_table::define_special_symbol): Rename insdef to
6711 insdefault.
6712
fe35d28d
ILT
67132010-01-04 Ian Lance Taylor <iant@google.com>
6714
30bc8c46
ILT
6715 PR 10980
6716 * options.h (class General_options): Add
6717 --allow-multiple-definition and -z muldefs.
6718 * resolve.cc (Symbol_table::should_override): Don't warn about a
6719 multiple symbol definition if --allow-multiple-definition or -z
6720 muldefs.
6721
7eaea549
ILT
6722 PR 10980
6723 * options.h (class General_options): Add --add-needed and
6724 --copy-dt-needed-entries. Tweak --as-needed help entry.
6725 * object.cc (Input_objects::check_dynamic_dependencies): Give an
6726 error if --copy-dt-needed-entries aka --add-needed is used and
6727 would cause a change in behaviour.
6728
fe35d28d
ILT
6729 PR 10980
6730 * options.h (class General_options): Add -G as a short version of
6731 --shared. Add no-op options -assert, -g, and -i.
6732
55a2bb35
ST
67332010-01-04 Sriraman Tallam <tmsriram@google.com>
6734
6735 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
6736 check for .text or .gnu.linkonce.t sections.
6737 * icf.cc (Icf::find_identical_sections): Ditto.
6738 Change the detection for mangled function name within the section
6739 name.
6740 * icf.h (is_section_foldable_candidate): New function.
6741
719328e1
ILT
67422009-12-30 Ian Lance Taylor <iant@google.com>
6743
6744 PR 10980
6745 * options.h (class General_options): Permit two dashes with
6746 --retain-symbols-file.
6747
d7bb5745
ILT
67482009-12-30 Ian Lance Taylor <iant@google.com>
6749
403a15dd
ILT
6750 PR 10979
6751 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
6752 don't put the file header and segment headers in the text
6753 segment.
6754
eda294df
ILT
6755 PR 10979
6756 * common.cc (Sort_commons::operator()): Stabilize sort when both
6757 entries are NULL.
6758 (Symbol_table::do_allocate_commons_list): When allocating common
6759 symbols, skip a symbol which is no longer common.
6760 * symtab.h (Symbol::is_common): Test whether the symbol comes from
6761 an object before checking its type.
6762 * testsuite/common_test_2.c: New file.
6763 * testsuite/common_test_3.c: New file.
6764 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
6765 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
6766 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
6767 (common_test_2_pic.o, common_test_2.so): New targets.
6768 (common_test_3_pic.o, common_test_3.so): New targets.
6769 * testsuite/Makefile.in: Rebuild.
6770
d7bb5745
ILT
6771 PR 10979
6772 * script.cc (read_input_script): If we see a new SECTIONS clause,
6773 and we have added an input section, give an error.
6774 * layout.h (class Layout): Add have_added_input_section function.
6775 Add have_added_input_section_ field.
6776 * layout.cc (Layout::Layout): Initialize
6777 have_added_input_section_.
6778 (Layout::layout): Set have_added_input_section_.
6779 (Layout::layout_eh_frame): Likewise.
6780
fc59c572
ILT
67812009-12-30 Ian Lance Taylor <iant@google.com>
6782
6783 PR 10931
6784 * options.h (class General_options): Add --sort-common option.
6785 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
6786 * common.cc (Sort_common): Add sort_order parameter to
6787 constructor. Add sort_order_ field.
6788 (Sort_commons::operator): Check sort_order_.
6789 (Symbol_table::allocate_commons): Determine the sort order.
6790 (Symbol_table::do_allocate_commons): Add sort_order parameter.
6791 Change all callers.
6792 (Symbol_table::do_allocate_commons_list): Likewise.
6793
1c74fab0
ILT
67942009-12-30 Ian Lance Taylor <iant@google.com>
6795
6796 PR 10916
6797 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
6798 symbols from this object, don't change the visibility of an
6799 undefined symbol.
6800 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
6801
6affe781
ILT
68022009-12-30 Ian Lance Taylor <iant@google.com>
6803
6804 PR 10861
6805 * script.h (class Version_script_info): Define Language enum.
6806 Update declarations. Define Glob, Exact, and Lookup types. Add
6807 new fields globals_, locals_, and is_finalized_.
6808 * script.cc: Various formatting fixes.
6809 (class Parser_closure): Change language_stack_ from a vector of
6810 std::string to one of Version_script_info::Language. Adjust all
6811 uses accordingly.
6812 (class Lazy_demangler): Remove.
6813 (struct Version_expression): Change language from std::string to
6814 Version_script_info::Language.
6815 (Version_script_info::Version_script_info): New function.
6816 (Version_script_info::~Version_script_info): Don't call clear.
6817 (Version_script_info::finalize): New function.
6818 (Version_script_info::build_lookup_tables): New function.
6819 (Version_script_info::build_expression_list_lookup): New
6820 function.
6821 (Version_script_info::get_symbol_version_helper): Rewrite to use
6822 lookup tables.
6823 (Version_script_info::print_expression_list): Adjust to use
6824 Version_script_info::Language.
6825 (script_push_lex_into_version_mode): Check that the version script
6826 has not been finalized.
6827 (version_script_push_lang): Change language string to
6828 Version_script_info::Language.
6829 * options.cc (Command_line::version_script): New function.
6830 * options.h (class General_options): Add finalize_dynamic_list
6831 function. Change version_script from declaration to definition.
6832 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
6833 * testsuite/version_script.map: Remove duplicate def of foo.
6834 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
6835 version_script.map.
6836 * testsuite/Makefile.in: Rebuild.
6837
818bf354
ILT
68382009-12-30 Ian Lance Taylor <iant@google.com>
6839
6840 PR 10843
6841 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
6842 if the input symbol index is 0, make the output symbol index 0.
6843
ebcc8304
ILT
68442009-12-30 Ian Lance Taylor <iant@google.com>
6845
6846 PR 10670
6847 * options.h (class General_options): Add -x/--discard-all.
6848 * object.cc (Sized_relobj::do_count_local_symbols): Handle
6849 --discard-all. If the local symbol needs a dynamic entry, check
6850 that before handling --discard-locals.
6851
176fe33f
ILT
68522009-12-30 Ian Lance Taylor <iant@google.com>
6853
bb321bb1
ILT
6854 PR 10450
6855 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
6856 flags to PF_R.
6857 (Output_segment::add_output_section): Don't change the flags if
6858 the type is PT_TLS.
6859
176fe33f
ILT
6860 PR 10450
6861 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
6862 GNU hash table if they need a dynamic value. Otherwise, don't add
6863 them if they are defined in a dynamic object or are forced local.
6864
e8cd95c7
ILT
68652009-12-29 Ian Lance Taylor <iant@google.com>
6866
1b81fb71
ILT
6867 PR 10450
6868 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
6869 .gnu.hash table for a 32-bit target.
6870
8d6d383d
ILT
6871 PR 10450
6872 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
6873 regular and a dynamic object only needs a dynamic symbol table
6874 entry if it is externally visible.
6875
e785ec03
ILT
6876 PR 10450
6877 * i386.cc (class Target_i386): Initialize global_offset_table_ in
6878 constructor. Add global_offset_table_ field.
6879 (Target_i386::got_section): Set global_offset_table_.
6880 (Target_i386::do_finalize_sections): Set global_offset_table_
6881 size.
6882 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
6883 in constructor. Add global_offset_table_ field.
6884 (Target_x86_64::got_section): Set global_offset_table_.
6885 (Target_x86_64::do_finalize_sections): Set global_offset_table_
6886 size.
6887
1a2dff53
ILT
6888 * layout.cc (Layout::Layout): Initialize increase_relro_.
6889 (Layout::get_output_section): Add is_relro, is_last_relro, and
6890 is_first_non_relro parameters. Change all callers.
6891 (Layout::choose_output_section): Likewise.
6892 (Layout::add_output_section_data): Likewise.
6893 (Layout::make_output_section): Likewise.
6894 (Layout::set_segment_offsets): Clear increase_relro when using a
6895 linker script.
6896 * layout.h (class Layout): Add increase_relro method. Add
6897 increase_relro_ field. Update declarations.
6898 * output.cc (Output_section::Output_section): Initialize
6899 is_last_relro_ and is_first_non_relro_.
6900 (Output_segment::add_output_section): Group relro sections is
6901 do_sort is true. Handle is_last_relro and is_first_non_relro.
6902 (Output_segment::maximum_alignment): Remove relro handling.
6903 (Output_segment::set_section_addresses): Add increase_relro
6904 parameter. Change all callers. Add initial alignment to align
6905 relro sections on separate page. Remove old relro handling.
6906 (Output_segment::set_section_list_addresses): Remove in_relro
6907 parameter. Change all callers.
6908 (Output_segment::set_offset): Add increase parameter. Change all
6909 callers. Remove old relro handling.
6910 * output.h (class Output_section): Add new methods: is_last_relro,
6911 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
6912 Add is_last_relro_ and is_first_non_relro_ fields.
6913 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
6914 Create separate .got.plt section. Call increase_relro.
6915 * x86_64.cc (Target_x86_64::got_section): Likewise.
6916 * testsuite/relro_script_test.t: Add .got.plt.
6917
f0ba79e2
ILT
6918 PR 10450
6919 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
6920 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
6921 (Layout::finalize): Call set_dynamic_symbol_size.
6922 (Layout::set_dynamic_symbol_size): New function.
6923 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
6924 set_dynamic_symbol_size.
6925
e8cd95c7
ILT
6926 PR 10450
6927 * output.h (class Output_section): Add is_entsize_zero_ field.
6928 * output.cc (Output_section::Output_section): Initialize
6929 is_entsize_zero_.
6930 (Output_section::set_entsize): If two different entsizes are
6931 requested, force it to zero.
6932 (Output_section::add_input_section): Set flags for .debug_str
6933 before updating section flags. Set entsize.
6934 (Output_section::update_flags_for_input_section): Set SHF_MERGE
6935 and SHF_STRING if all input sections have those flags.
6936
3e1b9a8a
RÁE
69372009-12-29 Rafael Espindola <espindola@google.com>
6938
6939 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
6940 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
6941 reporting.
3e1b9a8a 6942
3dcad376
ST
69432009-12-29 Sriraman Tallam <tmsriram@google.com>
6944
6945 * options.cc (General_options::parse_version): Allow -v to exit
6946 without an error if there is nothing to link.
6947
084e2665
ILT
69482009-12-29 Ian Lance Taylor <iant@google.com>
6949
6950 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
6951 using a version of gcc before 4.1.
6952 * configure: Rebuild.
6953
250acde3
CD
69542009-12-28 Chris Demetriou <cgd@google.com>
6955
6956 * attributes.cc (Output_attributes_section_data::do_write): Use
6957 std::vector::front rather than std::vector::data.
6958
99fff23b
ILT
69592009-12-28 Ian Lance Taylor <iant@google.com>
6960
6961 * symtab.h (class Symbol_table): Add enum Defined.
6962 * resolve.cc (Symbol_table::should_override): Add defined
6963 parameter. Change all callers. Test whether object is NULL
6964 before calling a method on it.
6965 (Symbol_table::report_resolve_problem): Add defined parameter.
6966 Change all callers.
6967 (Symbol_table::should_override_with_special): Likewise.
6968 * symtab.cc (Symbol_table::define_in_output_data): Add defined
6969 parameter. Change all callers.
6970 (Symbol_table::do_define_in_output_data): Likewise.
6971 (Symbol_table::define_in_output_segment): Likewise.
6972 (Symbol_table::do_define_in_output_segment): Likewise.
6973 (Symbol_table::define_as_constant): Likewise.
6974 (Symbol_table::do_define_as_constant): Likewise.
6975 * script.h (class Symbol_assignment): Add is_defsym parameter to
6976 constructor; change all callers.
6977 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
6978 parameter. Change all callers. Add is_defsym_ field.
6979 (class Parser_closure): Add parsing_defsym parameter to
6980 constructor; change all callers. Add parsing_defsym accessor
6981 function. Add parsing_defsym_ field.
6982
556bd683
ILT
69832009-12-28 Ian Lance Taylor <iant@google.com>
6984
6985 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 6986 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 6987
1782c879
ILT
69882009-12-23 Ian Lance Taylor <iant@google.com>
6989
6990 * i386.cc (Target_i386::do_calls_non_split): Recognize
6991 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
6992 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
6993 -fsplit-stack prologue when using %r11.
1782c879 6994
329ca2b1
ST
69952009-12-21 Sriraman Tallam <tmsriram@google.com>
6996
6997 * options.cc (General_options::parse_version): Make -v continue and do
6998 the link like GNU ld does.
6999
d675ff46
RÁE
70002009-12-17 Rafael Avila de Espindola <espindola@google.com>
7001
7002 * Makefile.am (CCFILES): Add timer.cc.
7003 (HFILES): Add timer.h.
7004 * configure.ac: Check for sysconf and times.
7005 * main.cc: include timer.h.
7006 (main): Use Timer instead of get_run_time.
7007 * timer.cc: New.
7008 * timer.h: New.
7009 * workqueue.cc: include timer.h.
7010 (Workqueue::find_and_run_task):
7011 Report user, sys and wall time.
7012 * Makefile.in: Regenerate.
7013 * config.in: Regenerate.
7014 * configure: Regenerate.
7015
d6344fb5
DK
70162009-12-16 Doug Kwan <dougkwan@google.com>
7017
7018 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
7019 sections.
7020 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
7021 relaxed input sections.
7022 * output.cc (Output_section::find_relaxed_input_section): Change
7023 return type to Output_relaxed_input_section pointer. Adjust code
7024 for new type of relaxed_input_section_map_.
7025 * output.h (Output_section::find_relaxed_input_section): Change
7026 return type to Output_relaxed_input_section pointer.
7027 (Output_section::Output_relaxed_input_section_by_input_section_map):
7028 New type.
7029 (Output_section::relaxed_input_section_map_): Change type to
7030 Output_section::Output_relaxed_input_section_by_input_section_map.
7031 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
7032 input section.
7033
0e0d5469
ILT
70342009-12-15 Ian Lance Taylor <iant@google.com>
7035
7036 * layout.cc (Layout::create_shstrtab): Only write out after input
7037 sections if we are compressing debug sections.
7038
0649a889
ILT
70392009-12-15 Ian Lance Taylor <iant@google.com>
7040
7041 * archive.cc (Archive::add_symbols): Only look up a symbol without
7042 a version if there is, in fact, a version.
7043
2ea97941
ILT
70442009-12-14 Ian Lance Taylor <iant@google.com>
7045
7046 Revert -Wshadow changes, all changes from:
7047 2009-12-11 Doug Kwan <dougkwan@google.com>
7048 2009-12-11 Nick Clifton <nickc@redhat.com>
7049 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
7050
b0eec2cc
DK
70512009-12-11 Doug Kwan <dougkwan@google.com>
7052
7053 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
7054 due to -Wshadow.
7055 * attributes.cc (Object_attribute::size): Ditto.
7056 (Attributes_section_data::size): Ditto.
7057 (Attributes_section_data::Attributes_section_data): Ditto.
7058 (Output_attributes_section_data::do_write): Ditto.
7059 * attributes.h (Object_attribute::set_type): Ditto.
7060 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
7061
91d6fa6a
NC
70622009-12-11 Nick Clifton <nickc@redhat.com>
7063
7064 * archive.cc: Fix shadowed variable warnings.
7065 * arm.cc: Likewise.
7066 * compressed_output.cc: Likewise.
7067 * compressed_output.h: Likewise.
7068 * configure: Likewise.
7069 * dwarf_reader.cc: Likewise.
7070 * dynobj.cc: Likewise.
7071 * dynobj.h: Likewise.
7072 * ehframe.cc: Likewise.
7073 * ehframe.h: Likewise.
7074 * errors.cc: Likewise.
7075 * expression.cc: Likewise.
7076 * fileread.cc: Likewise.
7077 * fileread.h: Likewise.
7078 * freebsd.h: Likewise.
7079 * i386.cc: Likewise.
7080 * icf.cc: Likewise.
7081 * incremental.h: Likewise.
7082 * layout.cc: Likewise.
7083 * layout.h: Likewise.
7084 * mapfile.cc: Likewise.
7085 * merge.cc: Likewise.
7086 * merge.h: Likewise.
7087 * object.cc: Likewise.
7088 * object.h: Likewise.
7089 * options.h: Likewise.
7090 * output.cc: Likewise.
7091 * output.h: Likewise.
7092 * parameters.cc: Likewise.
7093 * plugin.cc: Likewise.
7094 * powerpc.cc: Likewise.
7095 * reduced_debug_output.cc: Likewise.
7096 * reduced_debug_output.h: Likewise.
7097 * reloc.cc: Likewise.
7098 * reloc.h: Likewise.
7099 * resolve.cc: Likewise.
7100 * script-sections.cc: Likewise.
7101 * script.cc: Likewise.
7102 * script.h: Likewise.
7103 * sparc.cc: Likewise.
7104 * symtab.cc: Likewise.
7105 * symtab.h: Likewise.
7106 * target-select.cc: Likewise.
7107 * target-select.h: Likewise.
7108 * token.h: Likewise.
7109 * workqueue.cc: Likewise.
7110 * workqueue.h: Likewise.
7111 * x86_64.cc: Likewise.
7112
a0351a69
DK
71132009-12-10 Doug Kwan <dougkwan@google.com>
7114
7115 * arm.cc (attributes.h): New include.
7116 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
7117 (Arm_relobj::~Arm_relobj): Delete object pointed by
7118 attributes_section_data_.
7119 (Arm_relobj::attributes_section_data): New method definition.
7120 (Arm_relobj::attributes_section_data_): New data member declaration.
7121 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
7122 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
7123 attributes_section_data_.
7124 (Arm_dynobj::attributes_section_data): New method definition.
7125 (Arm_dynobj::attributes_section_data_): New data member declaration.
7126 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
7127 initialization value of may_use_blx_ to false.
7128 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
7129 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
7130 object attributes to compute results instead of hard-coding.
7131 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
7132 Target_arm::get_secondary_compatible_arch,
7133 Target_arm::set_secondary_compatible_arch
7134 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7135 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
7136 New method declarations.
7137 (Target_arm::get_aeabi_object_attribute): New method definition.
7138 (Target_arm::attributes_section_data_): New data member declaration.
7139 (read_arm_attributes_section): New template definition.
7140 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
7141 (Arm_dynobj::do_read_symbols): Ditto.
7142 (Target_arm::do_finalize_sections): Merge attributes sections from
7143 input. Check for BLX use after attributes section merging.
7144 Fix __exidx_start and __exidx_end visibility. Create an
7145 .ARM.attributes section if necessary.
7146 (Target_arm::get_secondary_compatible_arch,
7147 Target_arm::set_secondary_compatible_arch,
7148 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7149 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 7150 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
7151 New method definitions.
7152
b59befec
ILT
71532009-12-09 Ian Lance Taylor <iant@google.com>
7154
7155 * plugin.cc (Plugin::load): Don't cast from void* to a function
7156 pointer.
7157
1276bc89
ILT
71582009-12-09 Ian Lance Taylor <iant@google.com>
7159
7160 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
7161 information fields.
7162
2f2de248
L
71632009-12-09 H.J. Lu <hongjiu.lu@intel.com>
7164
7165 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
7166 Replace two_file_shared_1.so with two_file_shared_2.so.
7167 * testsuite/Makefile.in: Regenerated.
7168
4f787271
DK
71692009-12-08 Doug Kwan <dougkwan@google.com>
7170
7171 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
7172 (HFILES): Add attributes.h and int_encoding.h.
7173 * Makefile.in: Regenerate.
7174 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
7175 function definitions to int_encoding.cc
7176 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
7177 prototypes to int_encoding.h
7178 * reduced_debug_output.cc (int_encoding.h): New include.
7179 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
7180 function definitions to int_encoding.cc
7181 (insert_into_vector, read_from_pointer): Move template definitions to
7182 int_encoding.h
7183 * attributes.cc: New file.
7184 * attributes.h: New file.
7185 * int_encoding.cc: New file.
7186 * int_encoding.h: New file.
7187
20b52f1a
RÁE
71882009-12-07 Rafael Avila de Espindola <espindola@google.com>
7189
7190 PR gold/11055
7191 * incremental-dump.cc (dump_incremental_inputs): New.
7192 (main): Use dump_incremental_inputs.
7193
53d7974c
L
71942009-12-07 H.J. Lu <hongjiu.lu@intel.com>
7195
7196 PR gold/10893
7197 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
7198 checking elfcpp::STT_FUNC.
7199 (Target_i386::Relocate::relocate): Likewise.
7200 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
7201
7202 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
7203 symbols from shared libraries into normal FUNC symbols.
7204
7205 * symtab.h (Symbol): Add is_func and use it.
7206
05a352e6
DK
72072009-12-05 Doug Kwan <dougkwan@google.com>
7208
7209 * arm.cc (Target_arm::arm_info): Initialize new fields
7210 attributes_section and attributes_vendor.
7211 * i386.cc (Target_i386::i386_info): Same.
7212 * object.cc (Sized_relobj::do_layout): Skip attribute section.
7213 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
7214 fields attributes_section and attributes_vendor.
53d7974c 7215 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
7216 * target.h (Target::attributes_section, Target::attributes_vendor,
7217 Target::is_attributes_section, Target::attribute_arg_type,
7218 Target::attributes_order): New method definitions.
7219 (Target::Target_info::attributes_section,
7220 Target::Target_info::attributes_vendor): New fields.
7221 (Target::do_attribute_arg_type, Target::do_attributes_order): New
7222 virtual method definitions.
7223 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
7224 attributes_section and attributes_vendor.
7225 * testsuite/testfile.cc (Target_test::test_target_info): Same.
7226
f4e5969c
DK
72272009-12-05 Doug Kwan <dougkwan@google.com>
7228
7229 * arm.cc: Update comments about interworking and stub generation.
7230 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
7231 considered as non-PIC.
7232 (Arm_relocate_functions::base_abs): Fix formatting.
7233 (Arm_relocate_functions::got_prel): Fix comment. Change interface
7234 of function to use GOT entry address instead of offset.
7235 (Target_arm::Scan::global): Issue an error if a symbol would need a
7236 PLT does not get one because it is untyped. Remove code to create
7237 dynamic symbols for relative branches.
7238 (Target_arm::Relocate::relocate: Use 0 instead of false since function
7239 takes unsigned integer instead of boolean.
7240
1abce4a6
L
72412009-12-05 H.J. Lu <hongjiu.lu@intel.com>
7242
7243 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
7244 (two_file_test_LDADD): Likewise.
7245 (common_test_1_LDADD): Likewise.
7246 (exception_test_LDADD) Likewise.
7247 (weak_test_LDADD): Likewise.
7248 (many_sections_test_LDADD): Likewise.
7249 (initpri1_LDADD): Likewise.
7250 (script_test_1_LDADD): Likewise.
7251 (script_test_2_LDADD): Likewise.
7252 (justsyms_LDADD): Likewise.
7253 (binary_test_LDADD): Likewise.
7254 (large_LDADD): Likewise.
7255 * testsuite/Makefile.in: Regenerated.
7256
adcf2816 72572009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 7258
adcf2816
L
7259 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
7260 (Symbol_table::override_with_special): Likewise.
7261 (Symbol_table::add_from_object): Likewise.
7262
28e67f5d
RÁE
72632009-12-04 Rafael Avila de Espindola <espindola@google.com>
7264
7265 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
7266 Don't set the data_offset twice.
7267
ae10a101
RÁE
72682009-12-04 Rafael Avila de Espindola <espindola@google.com>
7269
7270 * testsuite/Makefile.in: Regenerate.
7271
f59f41f3
DK
72722009-12-03 Doug Kwan <dougkwan@google.com>
7273
7274 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
7275 (Target_arm::do_finalize_sections): Add parameter for symbol table
7276 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
7277 * i386.cc (Target_i386::do_finalize_sections): Add an additional
7278 parameter for symbol table pointer.
7279 * layout.cc (Layout::finalize): Call Target::finalize_sections with
7280 an additional parameter for a pointer to symbol table.
7281 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
7282 parameter for a symbol table pointer.
7283 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
7284 * target.h (Target::finalize_sections, Target::do_finalize_sections):
7285 Ditto.
7286 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
7287 parameter for a symbol table pointer.
7288
ca55d848
RÁE
72892009-12-03 Rafael Avila de Espindola <espindola@google.com>
7290
7291 * incremental.cc (Incremental_inputs_header)
7292 (Incremental_inputs_header_write, Incremental_inputs_entry)
7293 (Incremental_inputs_entry_write): Move ...
7294 * incremental.h (Incremental_inputs_header)
7295 (Incremental_inputs_header_write, Incremental_inputs_entry)
7296 (Incremental_inputs_entry_write): here.
7297
3aec4f9c
RÁE
72982009-12-02 Rafael Avila de Espindola <espindola@google.com>
7299
7300 * incremental.cc (make_sized_incremental_binary): Set the target.
7301 Error if it is incompatible.
7302 * output.h (Output_file): Add filename method.
7303
9c0ae74d
RÁE
73042009-12-02 Rafael Avila de Espindola <espindola@google.com>
7305
7306 * incremental.cc (Incremental_inputs_entry): Remove unused argument
7307 from the get_* methods.
7308
a45500ae
RÁE
73092009-12-02 Rafael Avila de Espindola <espindola@google.com>
7310
7311 * incremental-dump.cc (main): Check that the offeset of a script is 0.
7312 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
7313 Write 0 for the data_offset of scripts.
7314
325e6408
RÁE
73152009-12-02 Rafael Avila de Espindola <espindola@google.com>
7316
7317 * testsuite/Makefile.am: Add the incremental_test.sh test.
7318 * testsuite/incremental_test.sh: New.
7319 * testsuite/incremental_test_1.c: New.
7320 * testsuite/incremental_test_2.c: New.
7321
954c3e2e
RÁE
73222009-12-01 Rafael Avila de Espindola <espindola@google.com>
7323
7324 * incremental-dump.cc (main): Fix typos.
7325
f8086623
RÁE
73262009-11-27 Rafael Avila de Espindola <espindola@google.com>
7327
7328 PR gold/11025
7329 * incremental-dump.cc (main): Use llu to print 64 bit values.
7330
3b0dd6ac
L
73312009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
7332 H.J. Lu <hongjiu.lu@intel.com>
7333
7334 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
7335 $(LIBDL).
7336 (incremental_dump_LDADD): Likewise.
7337 * Makefile.in: Regenerated.
7338
a6d1ef57 73392009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 7340
a6d1ef57
DK
7341 Revert:
7342
7343 2009-11-25 Doug Kwan <dougkwan@google.com>
7344
7345 * arm.cc (Target_arm::Target_arm): Move method definition
7346 outside of class definition. Add code to handle
7347 --target1-rel, --target1-abs and --target2= options.
7348 (Target_arm::get_reloc_reloc_type): Change method to be
7349 non-static and const.
7350 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
7351 New data member declaration.
7352 (Target_arm::Scan::local, Target_arm::Scan::global,
7353 Target_arm::Relocate::relocate,
7354 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7355 Adjust call to Target_arm::get_real_reloc_type.
7356 (Target_arm::get_real_reloc_type): Use command line options
7357 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
7358 * options.h (--target1-rel, --target1-abs, --target2): New
7359 ARM-only options.
7360
50aeb7d4
DK
73612009-11-25 Doug Kwan <dougkwan@google.com>
7362
7363 * arm.cc (Target_arm::Target_arm): Move method definition outside of
7364 class definition. Add code to handle --target1-rel, --target1-abs
7365 and --target2= options.
7366 (Target_arm::get_reloc_reloc_type): Change method to be non-static
7367 and const.
7368 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
7369 member declaration.
7370 (Target_arm::Scan::local, Target_arm::Scan::global,
7371 Target_arm::Relocate::relocate,
7372 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
7373 call to Target_arm::get_real_reloc_type.
7374 (Target_arm::get_real_reloc_type): Use command line options to
7375 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
7376 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
7377 options.
7378
51938283
DK
73792009-11-25 Doug Kwan <dougkwan@google.com>
7380
7381 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
7382 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
7383 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
7384 formatting.
7385 (Arm_relocate_functions::thm_call): Replace body with a call to
7386 Arm_relocate_functions::thumb_branch_common.
7387 (Arm_relocate_functions::thm_jump24,
7388 Arm_relocate_functions::thm_xpc22): New method definitions.
7389 (Arm_relocate_functions::thumb_branch_common): New method definition.
7390 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
7391 operator.
7392 (Target_arm::Relocate::relocate): Adjust call to thm_call.
7393 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
7394
e2b8f3c4
RÁE
73952009-11-24 Rafael Avila de Espindola <espindola@google.com>
7396
7397 * Makefile.am: Build incremental-dump
7398 * Makefile.in: Regenerate.
7399 * incremental-dump.cc: New.
7400 * incremental.cc (Incremental_inputs_header_data,
7401 Incremental_inputs_entry_data): Move to incremental.h
7402 * incremental.h: (Incremental_inputs_header_data,
7403 Incremental_inputs_entry_data): Move from incremental.cc
7404
bcba9aec
RÁE
74052009-11-24 Rafael Avila de Espindola <espindola@google.com>
7406
7407 * incremental.cc (Incremental_inputs_header,
7408 Incremental_inputs_header_write, Incremental_inputs_entry,
7409 Incremental_inputs_entry_write): Add a typedef with the data type.
7410
7c3afe08
RÁE
74112009-11-24 Rafael Avila de Espindola <espindola@google.com>
7412
7413 * incremental.cc (Incremental_inputs_header,
7414 Incremental_inputs_header_write, Incremental_inputs_entry,
7415 Incremental_inputs_entry_write): Update comment about which
7416 type has the filed descriptions.
7417
d204b6e9
DK
74182009-11-15 Doug Kwan <dougkwan@google.com>
7419
7420 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
7421 (Arm_relocate_functions::arm_branch_common): Change method defintion
7422 in class definition to a method declaration and update list of formal
7423 parameters.
7424 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
7425 Arm_relocation_functions::jump24): Adjust call to
7426 Arm_relocate_functions::arm_branch_common. Update list of formal
7427 parameters.
7428 (Arm_relocate_functions::xpc25): New method definition.
7429 (Arm_relocate_functions::arm_branch_common): Move method defintion
7430 out from class definition. Use stubs for mode-switching and extending
7431 branch ranges.
7432 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
7433 specially. Change code to enable use of stubs in ARM branches.
7434
43d12afe
DK
74352009-11-10 Doug Kwan <dougkwan@google.com>
7436
7437 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
7438 in method declaration.
7439 (Target_arm::relocate_stub): New method declaration.
7440 (Target_arm::default_target): Change to return a pointer instead of
7441 a const reference.
7442 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
7443 Target_arm::default_target.
7444 (Arm_Relobj::do_relocate_sections): Remove options paramater in
7445 method definition.
7446 (Target_arm::relocate_section): Adjust view.
7447 (Target_arm::relocate_stub): New method definition.
7448
ac33a407
DK
74492009-11-10 Doug Kwan <dougkwan@google.com>
7450
7451 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
7452 a format warning.
7453 * incremental.cc (open_incremental_binary): Initialized local
7454 variables to avoid warnings.
7455 * object.cc (make_elf_object): Ditto.
7456 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
7457 a format warning.
e1df38aa 7458
88ee28e9
L
7459009-11-09 H.J. Lu <hongjiu.lu@intel.com>
7460
7461 PR gold/10930
7462 * testsuite/plugin_test.c: Include "config.h".
7463
2daedcd6
DK
74642009-11-09 Doug Kwan <dougkwan@google.com>
7465
7466 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
7467 (arm_symbol_value): Remove.
7468 (Arm_relocate_functions::arm_branch_common,
7469 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
7470 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
7471 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
7472 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
7473 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
7474 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
7475 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
7476 Arm_relocate_functions::thm_mobw_abs_nc,
7477 Arm_relocate_functions::thm_mov_abs,
7478 Arm_relocate_functions::movw_prel_nc,
7479 Arm_relocate_functions::thm_movt_abs,
7480 Arm_relocate_functions::movt_prel,
7481 Arm_relocate_functions::thm_movw_prel_nc,
7482 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
7483 (Target_arm::Relocate::relocate): Only decompose address into two
7484 parts if relocation type uses the thumb-bit and pass the actual
7485 bit instead of a flag indicating that the thumb-bit is used. Adjust
7486 calls to methods in Arm_relocate_functions for this change.
7487
1276bc89 74882009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
7489
7490 PR 10925
7491 * reloc.cc: Instantiate
7492 Sized_relobj::initialize_input_to_output_maps and
7493 Sized_relobj:free_input_to_output_maps.
7494
e53ad1b5
ILT
74952009-11-06 Ian Lance Taylor <iant@google.com>
7496
7497 PR 10876
7498 * defstd.cc (in_segment): Set only_if_ref true for "end".
7499
eb44217c
DK
75002009-11-06 Doug Kwan <dougkwan@google.com>
7501
7502 * arm.cc (class Reloc_stub): Correct a comment.
7503 (Target_arm::Target_arm): Initialize arm_input_section_map_.
7504 (Target_arm::scan_section_for_stubs): New method declaration.
7505 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
7506 Change methods from private to protected.
7507 (Target_arm::do_may_relax): New method definition.
7508 (Target_arm::do_relax, Target_arm::group_sections,
7509 Target_arm::scan_reloc_for_stub,
7510 Target_arm::scan_reloc_section_for_stubs): New method declarations.
7511 (Target_arm::arm_input_section_map_): New data member declaration.
7512 (Target_arm::scan_reloc_for_stub,
7513 Target_arm::scan_reloc_section_for_stubs,
7514 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
7515 Target_arm::do_relax): New method definitions.
7516
5d329b7d
ILT
75172009-11-06 Mikolaj Zalewski <mikolaj@google.com>
7518
7519 * configure.ac: Check for (struct stat)::st_mtim
7520 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
7521 * config.in: Regenerate.
7522 * configure: Regenerate.
7523
96a0d71b
ILT
75242009-11-05 Ian Lance Taylor <iant@google.com>
7525
7526 PR 10910
7527 * output.cc (Output_segment::add_output_section): Add missing
7528 return statement.
7529
594c8e5e
ILT
75302009-11-04 Ian Lance Taylor <iant@google.com>
7531
7532 PR 10880
7533 * object.h (class Object): Add is_needed and set_is_needed
7534 methods. Add is_needed_ field. Make bool fields into bitfields.
7535 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
7536 defined in a dynamic object and referenced by a regular object,
7537 set is_needed for the dynamic object.
7538 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
7539 if the file is marked with as_needed and it is not needed.
7540
22b127cc
ILT
75412009-11-04 Ian Lance Taylor <iant@google.com>
7542
7543 PR 10887
7544 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
7545 tags if data is discarded by linker script.
7546 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7547 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
7548 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
7549 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7550
f5c870d2
ILT
75512009-11-04 Ian Lance Taylor <iant@google.com>
7552
7553 * layout.cc (Layout::get_output_section): Add is_interp and
7554 is_dynamic_linker_section parameters. Change all callers.
7555 (Layout::choose_output_section): Likewise.
7556 (Layout::make_output_section): Likewise.
7557 (Layout::add_output_section_data): Add is_dynamic_linker_section
7558 parameter. Change all callers.
7559 * layout.h (class Layout): Update declarations.
7560 * output.h (class Output_section): Add is_interp, set_is_interp,
7561 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
7562 Add is_interp_, is_dynamic_linker_section_ fields. Change
7563 generate_code_fills_at_write_ to a bitfield.
7564 * output.cc (Output_section::Output_sections): Initialize new
7565 fields.
7566 (Output_segment::add_output_section): Add do_sort parameter.
7567 Change all callers.
7568
1ae4d23b
ILT
75692009-11-03 Ian Lance Taylor <iant@google.com>
7570
7571 PR 10860
7572 * options.h (class General_options): Add --warn-common.
7573 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
7574 merging two common symbols.
7575 (Symbol_table::should_override): Handle --warn-common when merging
7576 a common symbol with a defined symbol. Use report_resolve_problem
7577 for multiple definitions.
7578 (Symbol_table::report_resolve_problem): New function.
7579 * symtab.h (class Symbol_table): Declare report_resolve_problem.
7580
55da9579
DK
75812009-11-03 Doug Kwan <dougkwan@google.com>
7582
7583 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
7584 stub_factory_.
7585 (Target_arm::stub_factory): New method definition.
7586 (Target_arm::new_arm_input_section,
7587 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
7588 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 7589 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
7590 New type definitions.
7591 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
7592 member declarations.
7593 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
7594 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
7595 New method definitions.
7596
37a9ac43
ILT
75972009-11-03 Ian Lance Taylor <iant@google.com>
7598
7599 * options.h (class General_options): Add --warn_constructors.
7600
b3d6a3d4
ILT
76012009-11-03 Ian Lance Taylor <iant@google.com>
7602
7603 PR 10893
7604 * defstd.cc (in_section): Add entries for __rel_iplt_start,
7605 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
7606
934b01dd
ILT
76072009-11-03 Ian Lance Taylor <iant@google.com>
7608
7609 PR 10895
7610 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
7611 --msgid-bugs-address.
7612 (install-pdf): New target.
7613 (install-data_yes): Look up one directory to find mkinstalldirs.
7614
03c1939b
L
76152009-11-03 H.J. Lu <hongjiu.lu@intel.com>
7616
7617 * po/Make-in (.po.gmo): Don't generate .gmo files in source
7618 tree.
7619
ebd95253
DK
76202009-10-30 Doug Kwan <dougkwan@google.com>
7621
7622 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
7623
e9bbb538
DK
76242009-10-30 Doug Kwan <dougkwan@google.com>
7625
7626 * arm.cc (Stub_addend_reader): New struct template definition
7627 and partial specializations.
7628 (Stub_addend_reader::operator()): New method definition for a
7629 partially specialized template.
7630
d5b40221
DK
76312009-10-30 Doug Kwan <dougkwan@google.com>
7632
7633 * arm.cc (Arm_relobj::processor_specific_flags): New method
7634 definition.
7635 (Arm_relobj::do_read_symbols): New method declaration.
7636 (Arm_relobj::processor_specific_flags_): New data member declaration.
7637 (Arm_dynobj): New class definition.
7638 (Target_arm::do_finalize_sections): Add input_objects parameter.
7639 (Target_arm::do_adjust_elf_header): New method declaration.
7640 (Target_arm::are_eabi_versions_compatible,
7641 (Target_arm::merge_processor_specific_flags): New method declaration.
7642 (Target_arm::do_make_elf_object): New overloaded method definitions
7643 and declaration.
7644 (Arm_relobj::do_read_symbols): New method definition.
7645 (Arm_dynobj::do_read_symbols): Ditto.
7646 (Target_arm::do_finalize_sections): Add input_objects parameters.
7647 Merge processor-specific flags from all input objects.
7648 (Target_arm::are_eabi_versions_compatible,
7649 Target_arm::merge_processor_specific_flags,
7650 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
7651 New method definitions.
7652 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
7653 Input_objects pointer type parameter.
7654 * layout.cc (Layout::finalize): Pass input objects to target's.
7655 finalize_sections function.
7656 * output.cc (Output_file_header::do_sized_write): Set ELF file
7657 header's processor-specific flags.
7658 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
7659 Input_objects pointer type parameter.
7660 * sparc.cc (Target_sparc::do_finalize_sections): Same.
7661 * target.h (Input_objects): New forward class declaration.
7662 (Target::processor_specific_flags,
7663 Target::are_processor_specific_flags_sect): New method definitions.
7664 (Target::finalize_sections): Add input_objects parameter.
7665 (Target::Target): Initialize processor_specific_flags_ and
7666 are_processor_specific_flags_set_.
7667 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
7668 parameter.
7669 (Target::set_processor_specific_flags): New method definition.
7670 (Target::processor_specific_flags_,
7671 Target::are_processor_specific_flags_set_): New data member
7672 declarations.
7673 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
7674 Input_objects pointer type parameter.
7675
ebabffbd
DK
76762009-10-30 Doug Kwan <dougkwan@google.com>
7677
7678 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
7679
ad0f2072
ILT
76802009-10-28 Ian Lance Taylor <iant@google.com>
7681
7682 * object.h (class Relobj): Drop options parameter from
7683 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
7684 do_scan_relocs, do_relocate. Change all callers.
7685 (class Sized_relobj): Drop options parameters from
7686 do_gc_process_relocs, do_scan_relocs, do_relocate,
7687 do_relocate_sections, relocate_sections, emit_relocs_scan,
7688 emit_relocs_scan_reltype. Change all callers.
7689 (struct Relocate_info): Remove options field and all references to
7690 it.
7691 * reloc.h (class Read_relocs): Remove options constructor
7692 parameter and options_ field. Change all callers.
7693 (class Gc_process_relocs, class Scan_relocs): Likewise.
7694 (class Relocate_task): Likewise.
7695 * target-reloc.h (scan_relocs): Remove options parameter. Change
7696 all callers.
7697 (scan_relocatable_relocs): Likewise.
7698 * target.h (class Sized_target): Remove options parameter from
7699 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
7700 all callers.
7701 * gc.h (gc_process_relocs): Remove options parameter. Change all
7702 callers.
7703 * arm.cc: Update functions to remove options parameters.
7704 * i386.cc: Likewise.
7705 * powerpc.cc: Likewise.
7706 * sparc.cc: Likewise.
7707 * x86_64.cc: Likewise.
7708 * testsuite/testfile.cc: Likewise.
7709
8ffa3667
DK
77102009-10-28 Doug Kwan <dougkwan@google.com>
7711
7712 * arm.cc (Arm_relobj): New class definition.
e1df38aa 7713 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
7714 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
7715 New method definitions.
7716
40f36857
CC
77172009-10-28 Cary Coutant <ccoutant@google.com>
7718
7719 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
7720 (Plugin::cleanup_done_): New member.
7721 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
7722 (Plugin_manager::cleanup_done_): Remove.
7723 (Plugin_manager::add_input_file): Edit error message.
7724 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
7725 (Plugin_manager::cleanup): Remove use of cleanup_done_.
7726
2c849493
ILT
77272009-10-27 Mikolaj Zalewski <mikolajz@google.com>
7728
7729 * fileread.cc: (File_read::View::~View): Use the new
7730 data_ownership_ filed.
7731 (File_read::~File_read): Dispose the new whole_file_view_.
7732 (File_read::open): Mmap the whole file if needed.
7733 (File_read::open): Use whole_file_view_ instead of contents_.
7734 (File_read::find_view): Use whole_file_view_ if applicable.
7735 (File_read::do_read): Use whole_file_view_ instead of contents_.
7736 (File_read::make_view): Use whole_file_view_ instead of contents_,
7737 update File_read::View::View call.
7738 (File_read::find_or_make_view): Update File_read::View::View
7739 call.
7740 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
7741 remove contents_
7742 (File_read::View::Data_ownership): New enum.
7743 (File_read::View::View): Replace bool mapped_ with Data_ownership
7744 argument.
7745 (File_read::View::mapped_): Remove (replaced by data_ownership_).
7746 (File_read::View::data_ownership_): New field.
7747 (File_read::contents_): Remove (replaced by whole_file_view_).
7748 (File_read::whole_file_view_): New field.
7749 * options.h (class General_options): Add --keep-files-mapped.
7750
24998053
CC
77512009-10-27 Cary Coutant <ccoutant@google.com>
7752
7753 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
7754 * testsuite/Makefile.am (plugin_test_5): New test case.
7755 * testsuite/Makefile.in: Regenerate.
7756
72adc4fa
DK
77572009-10-25 Doug Kwan <dougkwan@google.com>
7758
7759 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
7760 from private to protected to allow access by child class.
7761 (Sized_relobj::do_relocate_sections): New method declaration.
7762 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 7763 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
7764 Sized_relobj::relocate_sections. Instantiate template explicitly
7765 for different target sizes and endianity.
7766
07f508a2
DK
77672009-10-24 Doug Kwan <dougkwan@google.com>
7768
7769 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
7770 (Arm_input_section::as_arm_input_section): New method.
7771 (Arm_output_section): New class definition.
7772 (Arm_output_section::create_stub_group,
7773 Arm_output_section::group_sections): New method definitions.
7774
10ad9fe5
DK
77752009-10-22 Doug Kwan <dougkwan@google.com>
7776
7777 * arm.cc (Arm_input_section): New class definition.
7778 (Arm_input_section::init, Arm_input_section:do_write,
7779 Arm_input_section::set_final_data_size,
7780 Arm_input_section::do_reset_address_and_file_offset): New method
7781 definitions.
7782
56ee5e00
DK
77832009-10-21 Doug Kwan <dougkwan@google.com>
7784
7785 * arm.cc (Stub_table, Arm_input_section): New forward class
7786 declarations.
7787 (Stub_table): New class defintion.
7788 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
7789 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
7790 New method definition.
7791
b569affa
DK
77922009-10-21 Doug Kwan <dougkwan@google.com>
7793
7794 * arm.cc: Update copyright comments.
7795 (Target_arm): New forward class template declaration.
7796 (Arm_address): New type.
7797 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
7798 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
7799 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
7800 constants.
7801 (Insn_template): Same.
7802 (DEF_STUBS): New macro.
7803 (Stub_type): New enum type.
7804 (Stub_template): New class definition.
7805 (Stub): Same.
7806 (Reloc_stub): Same.
7807 (Stub_factory): Same.
7808 (Target_arm::Target_arm): Initialize may_use_blx_ and
7809 should_force_pic_veneer_.
7810 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
7811 Target_arm::should_force_pic_veneer,
7812 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
7813 Target_arm::using_thumb_only, Target_arm:;default_target): New
7814 method defintions.
7815 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
7816 New data member declarations.
7817 (Insn_template::size, Insn_template::alignment): New method defintions.
7818 (Stub_template::Stub_template): New method definition.
7819 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
7820 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
7821 (Stub_factory::Stub_factory): New method definition.
7822 * gold.h (string_hash): New template.
7823 * output.h (Input_section_specifier::hash_value): Use
7824 gold::string_hash.
7825 (Input_section_specifier::string_hash): Remove.
7826 * stringpool.cc (Stringpool_template::string_hash): Use
7827 gold::string_hash.
7828
6c172549
DK
78292009-10-20 Doug Kwan <dougkwan@google.com>
7830
7831 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
7832 symbols of relaxed input sections.
7833 * output.h (Output_section::find_relaxed_input_section): Make
7834 method public.
7835
c5617f2f
DK
78362009-10-16 Doug Kwan <dougkwan@google.com>
7837
7838 * dynobj.cc (Versions::Versions): Initialize version_script_.
7839 Only insert base version symbol definition for a shared object
7840 if version script defines any version versions.
7841 (Versions::define_base_version): New method definition.
7842 (Versions::add_def): Check that base version is not needed.
7843 (Versions::add_need): Define base version lazily.
7844 * dynobj.h (Versions::define_base_version): New method declaration.
7845 (Versions::needs_base_version_): New data member declaration.
7846 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
7847 (check_DATA): Add no_version_test.stdout.
7848 (libno_version_test.so, no_version_test.o no_version_test.stdout):
7849 New make rules.
7850 * testsuite/Makefile.in: Regenerate.
7851 * testsuite/no_version_test.c: New file.
7852 * testsuite/no_version_test.sh: Ditto.
7853
3c12dcdb
DK
78542009-10-16 Doug Kwan <dougkwan@google.com>
7855
7856 * expression.cc (class Segment_start_expression): New class definition.
7857 (Segment_start_expression::value): New method definition.
7858 (script_exp_function_segment_start): Return a new
7859 Segment_start_expression.
7860 * gold/script-c.h (script_saw_segment_start_expression): New function
7861 prototype.
7862 * script-sections.cc (Script_sections::Script_sections): Initialize
7863 SAW_SEGMENT_START_EXPRESSION_ to false.
7864 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
7865 and -Tbbs options to specify section addresses if given in
7866 command line and no SEGMENT_START expression is seen in a script.
7867 * script-sections.h (Script_sections::saw_segment_start_expression,
7868 Script_sections::set_saw_segment_start_expression): New method
7869 definition.
7870 (Script_sections::saw_segment_start_expression_): New data member
7871 declaration.
7872 * script.cc (script_saw_segment_start_expression): New function.
7873 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
7874 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
7875 script_test_7.sh and script_test_8.sh.
7876 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
7877 script_test_8.stdout.
7878 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
7879 (script_test_6, script_test_6.stdout, script_test_7,
7880 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
7881 * Makefile.in: Regenerate.
7882 * testsuite/script_test_6.sh: New file.
7883 * testsuite/script_test_6.t: Same.
7884 * testsuite/script_test_7.sh: Same.
7885 * testsuite/script_test_7.t: Same.
7886 * testsuite/script_test_8.sh: Same.
7887
64b1ae37
DK
78882009-10-16 Doug Kwan <dougkwan@google.com>
7889
7890 * output.cc (Output_segment::set_section_list_address): Cast
7891 expressions to unsigned long long type to avoid format warnings.
7892
661be1e2
ILT
78932009-10-15 Ian Lance Taylor <iant@google.com>
7894
12edd763 7895 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 7896 dot assignment to script_sections_.
12edd763
ILT
7897 * script-sections.cc (Script_sections::add_dot_assignment):
7898 Initialize if necessary.
7899
68b6574b
ILT
7900 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
7901 program headers with no load segment if there is a linker script.
7902
661be1e2
ILT
7903 * layout.cc (Layout::set_segment_offsets): Align the file offset
7904 to the segment aligment for -N or -n with no load segment.
7905 * output.cc (Output_segment::add_output_section): Don't crash if
7906 the first section is a TLS section.
7907 (Output_segment::set_section_list_addresses): Print an error
7908 message if the address moves backward in a linker script.
7909 * script-sections.cc
7910 (Output_section_element_input::set_section_addresses): Don't
7911 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
7912 (Orphan_output_section::set_section_addresses): Likewise.
7913
f15f61a7
DK
79142009-10-15 Doug Kwan <dougkwan@google.com>
7915
7916 * layout.cc (Layout::finish_dynamic_section): Generate tags
7917 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
7918 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
7919 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
7920
82bb573a
ILT
79212009-10-14 Ian Lance Taylor <iant@google.com>
7922
7923 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
7924 fields.
7925 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
7926 data_shdr fields of relinfo.
7927 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
7928 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
7929 R_386_TLS_LDO_32, adjust based on section flags.
7930 (Target_i386::Relocate::fix_up_ldo): Remove.
7931
374ad285
ILT
79322009-10-13 Ian Lance Taylor <iant@google.com>
7933
7934 Add support for -pie.
7935 * options.h (class General_options): Add -pie and
7936 --pic-executable.
7937 (General_options::output_is_position_independent): Test -pie.
7938 (General_options::output_is_executable): Return true if not shared
7939 and not relocatable.
7940 (General_options::output_is_pie): Remove.
7941 * options.cc (General_options::finalize): Reject incompatible uses
7942 of -pie.
7943 * gold.cc (queue_middle_tasks): A -pie link is not static.
7944 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
7945 * symtab.cc (Symbol::final_value_is_known): Return false if
7946 output_is_position_independent.
7947 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
7948 output_is_position_independent.
7949 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
7950 output_is_position_independent.
7951 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
7952 output_is_position_independent.
7953 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
7954 two_file_pie_test.
7955 (basic_pie_test.o, basic_pie_test): New targets.
7956 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
7957 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
7958 (two_file_pie_test): New target.
7959 * testsuite/Makefile.in: Rebuild.
7960 * README: Remove note saying that -pie is not supported.
7961
c6585162
ILT
79622009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
7963
7964 * options.h (class General_options): Add -init and -fini.
7965 * layout.cc (Layout::finish_dynamic_section): Emit
7966 given init and fini functions.
7967
032ce4e9
ST
79682009-10-13 Sriraman Tallam <tmsriram@google.com>
7969
7970 * gc.h (gc_process_relocs): Check if icf is enabled using new
7971 function.
7972 * gold.cc (queue_initial_tasks): Likewise.
7973 (queue_middle_tasks): Likewise.
7974 * object.cc (do_layout): Likewise.
7975 * symtab.cc (is_section_folded): Likewise.
7976 * main.cc (main): Likewise.
7977 * reloc.cc (Read_relocs::run): Likewise.
7978 (Sized_relobj::do_scan_relocs): Likewise.
7979 * icf.cc (is_function_ctor_or_dtor): New function.
7980 (Icf::find_identical_sections): Check if function is ctor or dtor when
7981 safe icf is chosen.
7982 * options.h (General_options::icf): Change option to be an enum.
7983 (Icf_status): New enum.
7984 (icf_enabled): New method.
7985 (icf_safe_folding): New method.
7986 (set_icf_status): New method.
7987 (icf_status_): New variable.
7988 * (options.cc) (General_options::finalize): Set icf_status_.
7989 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
7990 icf_test and icf_keep_unique_test to use the --icf enum flag.
7991 * testsuite/icf_safe_test.sh: New file.
e1df38aa 7992 * testsuite/icf_safe_test.cc: New file.
032ce4e9 7993
f345227a
ST
79942009-10-12 Sriraman Tallam <tmsriram@google.com>
7995
7996 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
7997 includes to gc.h and icf.h.
7998 * arm.cc: Include gc.h.
7999 * gold.cc: Likewise.
8000 * i386.cc: Likewise.
8001 * powerpc.cc: Likewise.
8002 * sparc.cc: Likewise.
8003 * x86_64.cc: Likewise.
8004 * gc.h: Include icf.h.
8005
1c7814ed
ILT
80062009-10-11 Ian Lance Taylor <iant@google.com>
8007
8008 * plugin.cc: Include "gold.h" before other header files.
8009
ae3b5189
CD
80102009-10-10 Chris Demetriou <cgd@google.com>
8011
8012 * options.h (Input_file_argument::Input_file_type): New enum.
8013 (Input_file_argument::is_lib_): Replace with...
8014 (Input_file_argument::type_): New member.
8015 (Input_file_argument::Input_file_argument): Take Input_file_type
8016 'type' rather than boolean 'is_lib' as second argument.
8017 (Input_file_argument::is_lib): Use type_.
8018 (Input_file_argument::is_searched_file): New function.
8019 (Input_file_argument::may_need_search): Handle is_searched_file.
8020 * options.cc (General_options::parse_library): Support -l:filename.
8021 (General_options::parse_just_symbols): Update for Input_file_argument
8022 changes.
8023 (Command_line::process): Likewise.
8024 * archive.cc (Archive::get_file_and_offset): Likewise.
8025 * plugin.cc (Plugin_manager::release_input_file): Likewise.
8026 * script.cc (read_script_file, script_add_file): Likewise.
8027 * fileread.cc (Input_file::Input_file): Likewise.
8028 (Input_file::will_search_for): Handle is_searched_file.
8029 (Input_file::open): Likewise.
8030 * readsyms.cc (Read_symbols::get_name): Likewise.
8031 * testsuite/Makefile.am (searched_file_test): New test.
8032 * testsuite/Makefile.in: Regenerate.
8033 * testsuite/searched_file_test.cc: New file.
8034 * testsuite/searched_file_test_lib.cc: New file.
8035
f3048a1d
ILT
80362009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8037 Ian Lance Taylor <iant@google.com>
8038
8039 * descriptor.cc: Include <cstdio> and "binary-io.h".
8040 (Descriptors::open): Open the files in binary mode always.
8041 * script.cc (Lex::get_token): Treat \r as whitespace.
8042
d4780e57
ILT
80432009-10-09 Ian Lance Taylor <iant@google.com>
8044
8045 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
8046
d9a893b8
ILT
80472009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8048 Ian Lance Taylor <iant@google.com>
8049
8050 * configure.ac: Check for readv function also.
8051 * fileread.cc (readv): Define if not HAVE_READV.
8052 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
8053 does not exist.
8054 * config.in: Regenerate.
8055 * configure: Regenerate.
8056
c0a62865
DK
80572009-10-09 Doug Kwan <dougkwan@google.com>
8058
8059 * layout.cc (Layout::make_output_section): Call target hook to make
8060 ordinary output section.
8061 (Layout::finalize): Adjust parameter list of call the
8062 Target::may_relax().
8063 * layout.h (class Layout::section_list): New method.
8064 * merge.h (Output_merge_base::entsize): Change visibility to public.
8065 (Output_merge_base::is_string, Output_merge_base::do_is_string):
8066 New methods.
8067 (Output_merge_string::do_is_string): New method.
8068 * object.cc (Sized_relobj::do_setup): renamed from
8069 Sized_relobj::set_up.
8070 * object.h (Sized_relobj::adjust_shndx,
8071 Sized_relobj::initializ_input_to_output_maps,
8072 Sized_relobj::free_input_to_output_maps): Change visibilities to
8073 protected.
8074 (Sized_relobj::setup): Virtualize.
8075 (Sized_relobj::do_setup): New method declaration.
8076 (Sized_relobj::invalidate_section_offset,
8077 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
8078 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
8079 * options.cc (parse_int): New function.
8080 * options.h (parse_int): New declaration.
8081 (DEFINE_int): New macro.
8082 (stub_group_size): New option.
8083 * output.cc (Output_section::Output_section): Initialize memebers
8084 merge_section_map_, merge_section_by_properties_map_,
8085 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
8086 (Output_section::add_input_section): Handled deferred code-fill
8087 generation and remove an old comment.
8088 (Output_section::add_relaxed_input_section): New method definition.
8089 (Output_section::add_merge_input_section): Use merge section by
8090 properties map to speed to search. Update merge section maps
8091 as appropriate.
8092 (Output_section::build_relaxation_map): New method definition.
8093 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8094 Same.
8095 (Output_section::relax_input_section): Renamed to
8096 Output_section::convert_input_sections_to_relaxed_sections and change
8097 interface to take a vector of pointers to relaxed sections.
8098 (Output_section::find_merge_section,
8099 Output_section::find_relaxed_input_section): New method definitions.
8100 (Output_section::is_input_address_mapped,
8101 Output_section::output_offset, Output_section::output_address):
8102 Use output section data maps to speed up searching.
8103 (Output_section::find_starting_output_address): Add comments.
8104 (Output_section::do_write,
8105 Output_section::write_to_postprocessing_buffer): Do code-fill
8106 generation as appropriate.
8107 (Output_section::get_input_sections): Invalidate relaxed input section
8108 map.
8109 (Output_section::restore_states): Adjust type of checkpoint .
8110 Invalidate relaxed input section map.
8111 * output.h (Output_merge_base): New class declaration.
8112 (Input_section_specifier): New class defintion.
8113 (class Output_relaxed_input_section) Change base class to
8114 Output_section_data_build.
8115 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
8116 base class initializer.
8117 (Output_section::add_relaxed_input_section): New method declaration.
8118 (Output_section::Input_section): Change visibility to protected.
8119 (Output_section::Input_section::relobj,
8120 Output_section::Input_section::shndx): Handle relaxed input sections.
8121 Output_section::input_sections) Change visibility to protected. Also
8122 define overload to return a non-const pointer.
8123 (Output_section::Merge_section_properties): New class defintion.
8124 (Output_section::Merge_section_by_properties_map,
8125 Output_section::Output_section_data_by_input_section_map,
8126 Output_section::Relaxation_map): New types.
8127 (Output_section::relax_input_section): Rename method to
8128 Output_section::convert_input_sections_to_relaxed_sections and change
8129 interface to take a vector of relaxed section pointers.
8130 (Output_section::find_merge_section,
8131 Output_section::find_relaxed_input_section,
8132 Output_section::build_relaxation_map,
8133 Output_section::convert_input_sections_in_list_to_relaxed_sections):
8134 New method declarations.
8135 (Output_section::merge_section_map_
8136 Output_section::merge_section_by_properties_map_,
8137 Output_section::relaxed_input_section_map_,
8138 Output_section::is_relaxed_input_section_map_valid_,
8139 Output_section::generate_code_fills_at_write_): New data members.
8140 * script-sections.cc
8141 (Output_section_element_input::set_section_addresses): Call
8142 current_data_size and addralign methods of relaxed input sections.
8143 (Orphan_output_section::set_section_addresses): Call current_data_size
8144 and addralign methods of relaxed input sections.
8145 * symtab.cc (Symbol_table::compute_final_value): Extract template
8146 from the body of Symbol_table::sized_finalize_symbol.
8147 (Symbol_table::sized_finalized_symbol): Call
8148 Symbol_table::compute_final_value.
8149 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
8150 (Symbol_table::compute_final_value): New templated method declaration.
8151 * target.cc (Target::do_make_output_section): New method defintion.
8152 * target.h (Target::make_output_section): New method declaration.
8153 (Target::relax): Add more parameters for input objects, symbol table
8154 and layout. Adjust call to do_relax.
8155 (Target::do_make_output_section): New method declaration.
8156 (Target::do_relax): Add parameters for input objects, symbol table
8157 and layout.
8158
d446d6c4
ILT
81592009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8160
8161 * pread.c: Include stdio.h.
8162
bc06c745
ILT
81632009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8164
8165 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
8166 defined.
8167
75aea3d0
ILT
81682009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8169
8170 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8171 Change read_shndx type to unsigned int.
8172 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
8173 int.
8174 (Sized_dwarf_line_info::read_line_mappings): Likewise.
8175 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
8176 Change read_shndx type to unsigned int.
8177 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
8178 int.
8179 (Sized_dwarf_line_info::read_line_mappings): Likewise.
8180 * layout.cc (Layout::create_symtab_sections): Cast the result of
8181 local_symcount * symsize to off_t in the gold_assert.
8182
be8fcb75
ILT
81832009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8184
8185 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
8186 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
8187 R_ARM_BASE_ABS.
8188 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
8189 (Arm_relocate_functions::thm_abs5): New function.
8190 (Arm_relocate_functions::abs12): New function.
8191 (Arm_relocate_functions::abs16): New function.
8192 (Arm_relocate_functions::base_abs): New function.
8193 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
8194 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
8195 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
8196 R_ARM_BASE_ABS.
8197 (Scan::global): Likewise.
8198 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
8199 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
8200 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
8201 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
8202 R_ARM_BASE_ABS.
8203
c2a122b6
ILT
82042009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8205
8206 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
8207 (Arm_relocate_functions::movt_prel): New function.
8208 (Arm_relocate_functions::thm_movw_prel_nc): New function.
8209 (Arm_relocate_functions::thm_movt_prel): New function.
8210 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
8211 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
8212 (Scan::global, Relocate::relocate): Likewise.
8213 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8214
c4aa1e2d
ILT
82152009-10-09 Mikolaj Zalewski <mikolajz@google.com>
8216
8217 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
8218 Incremental_checker.
8219 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
8220 unsigned int.
8221 (class Incremental_inputs_header): New class.
8222 (Incremental_inputs_header_writer): Edit comment.
8223 (Incremental_inputs_entry): New class.
8224 (Incremental_inputs_entry_writer): Edit comment.
8225 (Sized_incremental_binary::do_find_incremental_inputs_section):
8226 Add *strtab_shndx parameter, fill it.
8227 (Sized_incremental_binary::do_check_inputs): New method.
8228 (Incremental_checker::can_incrementally_link_output_file): Use
8229 Sized_incremental_binary::check_inputs.
8230 (Incremental_inputs::report_command_line): Save command line in
8231 command_line_.
8232 * incremental.h:
8233 (Incremental_binary::find_incremental_inputs_section): New
8234 method.
8235 (Incremental_binary::do_find_incremental_inputs_section): Add
8236 strtab_shndx parameter.
8237 (Incremental_binary::do_check_inputs): New pure virtual method.
8238 (Sized_incremental_binary::do_check_inputs): Declare.
8239 (Incremental_checker::Incremental_checker): Add incremental_inputs
8240 parameter, use it to initialize incremental_inputs_.
8241 (Incremental_checker::incremental_inputs_): New field.
8242 (Incremental_checker::command_line): New method.
8243 (Incremental_checker::inputs): New method.
8244 (Incremental_checker::command_line_): New field.
8245
c549a694
ILT
82462009-10-09 Mikolaj Zalewski <mikolajz@google.com>
8247
8248 * incremental.cc: Include <cstdarg> and "target-select.h".
8249 (vexplain_no_incremental): New function.
8250 (explain_no_incremental): New function.
8251 (Incremental_binary::error): New method.
8252 (Sized_incremental_binary::do_find_incremental_inputs_section): New
8253 method.
8254 (make_sized_incremental_binary): New function.
8255 (open_incremental_binary): New function.
8256 (can_incrementally_link_file): Add checks if output is ELF and has
8257 inputs section.
8258 * incremental.h: Include "elfcpp_file.h" and "output.h".
8259 (Incremental_binary): New class.
8260 (Sized_incremental_binary): New class.
8261 (open_incremental_binary): Declare.
8262 * object.cc (is_elf_object): Use
8263 elfcpp::Elf_recognizer::is_elf_file.
8264 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
8265 * output.h (Output_file::filesize): New method.
8266
fd3c5f0b
ILT
82672009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8268
8269 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
8270 New function.
8271 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
8272 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
8273 function.
8274 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
8275 function.
8276 (Arm_relocate_functions::movw_abs_nc): New function.
8277 (Arm_relocate_functions::movt_abs): New function.
8278 (Arm_relocate_functions::thm_movw_abs_nc): New function.
8279 (Arm_relocate_functions::thm_movt_abs): New function.
8280 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
8281 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
8282 (Scan::global): Likewise.
8283 (Relocate::relocate): Likewise.
8284 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8285
7f5309a5
ILT
82862009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8287
8288 * arm.cc (Arm_relocate_functions::got_prel) New function.
8289 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
8290 (Relocate::relocate): Likewise.
8291 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8292
364c7fa5
ILT
82932009-10-06 Ian Lance Taylor <iant@google.com>
8294
8295 * options.h (class General_options): Define
8296 split_stack_adjust_size parameter.
8297 * object.h (class Object): Add uses_split_stack_ and
8298 has_no_split_stack_ fields. Add uses_split_stack and
8299 has_no_split_stack accessor functions. Declare
8300 handle_split_stack_section.
8301 (class Reloc_symbol_changes): Define.
8302 (class Sized_relobj): Define Function_offsets. Declare
8303 split_stack_adjust, split_stack_adjust_reltype, and
8304 find_functions.
8305 * object.cc (Object::handle_split_stack_section): New function.
8306 (Sized_relobj::do_layout): Call handle_split_stack_section.
8307 * dynobj.cc (Sized_dynobj::do_layout): Call
8308 handle_split_stack_section.
8309 * reloc.cc (Sized_relobj::relocate_sections): Call
8310 split_stack_adjust for executable sections in split_stack
8311 objects. Pass reloc_map to relocate_section.
8312 (Sized_relobj::split_stack_adjust): New function.
8313 (Sized_relobj::split_stack_adjust_reltype): New function.
8314 (Sized_relobj::find_functions): New function.
8315 * target-reloc.h: Include "object.h".
8316 (relocate_section): Add reloc_symbol_changes parameter. Change
8317 all callers.
8318 * target.h (class Target): Add calls_non_split method. Declare
8319 do_calls_non_split virtual method. Declare match_view and
8320 set_view_to_nop.
8321 * target.cc: Include "elfcpp.h".
8322 (Target::do_calls_non_split): New function.
8323 (Target::match_view): New function.
8324 (Target::set_view_to_nop): New function.
8325 * gold.cc (queue_middle_tasks): Give an error if mixing
8326 split-stack and non-split-stack objects with -r.
8327 * i386.cc (Target_i386::relocate_section): Add
8328 reloc_symbol_changes parameter.
8329 (Target_i386::do_calls_non_split): New function.
8330 * x86_64.cc (Target_x86_64::relocate_section): Add
8331 reloc_symbol_changes parameter.
8332 (Target_x86_64::do_calls_non_split): New function.
8333 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
8334 parameter.
8335 * powerpc.cc (Target_powerpc::relocate_section): Add
8336 reloc_symbol_changes parameter.
8337 * sparc.cc (Target_sparc::relocate_section): Add
8338 reloc_symbol_changes parameter.
8339 * configure.ac: Call AM_CONDITIONAL for the default target.
8340 * configure: Rebuild.
8341 * testsuite/Makefile.am (TEST_AS): New variable.
8342 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
8343 (check_DATA): Add split_i386 and split_x86_64 files.
8344 (SPLIT_DEFSYMS): Define.
8345 (split_i386_[1234n].o): New targets.
8346 (split_i386_[124]): New targets.
8347 (split_i386_[1234r].stdout): New targets.
8348 (split_x86_64_[1234n].o): New targets.
8349 (split_x86_64_[124]): New targets.
8350 (split_x86_64_[1234r].stdout): New targets.
8351 (MOSTLYCLEANFILES): Add new executables.
8352 * testsuite/split_i386.sh: New file.
8353 * testsuite/split_x86_64.sh: New file.
8354 * testsuite/split_i386_1.s: New file.
8355 * testsuite/split_i386_2.s: New file.
8356 * testsuite/split_i386_3.s: New file.
8357 * testsuite/split_i386_4.s: New file.
8358 * testsuite/split_i386_n.s: New file.
8359 * testsuite/split_x86_64_1.s: New file.
8360 * testsuite/split_x86_64_2.s: New file.
8361 * testsuite/split_x86_64_3.s: New file.
8362 * testsuite/split_x86_64_4.s: New file.
8363 * testsuite/split_x86_64_n.s: New file.
8364 * testsuite/testfile.cc (Target_test): Update relocation_section
8365 function.
8366 * testsuite/Makefile.in: Rebuild.
8367
e8a9fcda
ILT
83682009-10-06 Ian Lance Taylor <iant@google.com>
8369
8370 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
8371 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
8372 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
8373 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
8374 the address on ldo_addrs_.
8375 (Target_i386::Relocate::fix_up_ldo): New function.
8376
e99daf92
ILT
83772009-10-06 Rafael Espindola <espindola@google.com>
8378
8379 * plugin.cc (add_input_library): New.
8380 (Plugin::load): Add add_input_library to tv.
8381 (Plugin_manager::add_input_file): Add the is_lib argument.
8382 (add_input_file): Update call to Plugin_manager::add_input_file.
8383 (add_input_library): New.
8384 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
8385
966d4097
DK
83862009-09-30 Doug Kwan <dougkwan@google.com>
8387
8388 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
8389 symbol and call Symbol::may_need_copy_reloc to determine if
8390 a copy reloc is needed.
8391 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
8392 nocopyreloc is given in command line.
8393 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
8394 given in command line.
8395 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
8396 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
8397 of the removed Target_i386::may_need_copy_reloc.
8398 * options.h (copyreloc): New option with default value false.
8399 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
8400 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
8401 instead of the removed Target_powerpc::may_need_copy_reloc.
8402 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
8403 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
8404 instead of the removed Target_sparc::may_need_copy_reloc.
8405 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
8406 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
8407 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
8408 instead of the removed Target_x86_64::may_need_copy_reloc.
8409
029ba973
ILT
84102009-09-30 Ian Lance Taylor <iant@google.com>
8411
8412 * object.h (class Object): Remove target_ field, and target,
8413 sized_target, and set_target methods.
8414 (Object::sized_target): Remove.
8415 (class Sized_relobj): Update declarations. Remove sized_target.
8416 * object.cc (Sized_relobj::setup): Remove target parameter.
8417 Change all callers.
8418 (Input_objects::add_object): Don't do anything with the target.
8419 (make_elf_sized_object): Add punconfigured parameter. Change all
8420 callers. Set or test parameter target.
8421 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
8422 Change all callers.
8423 * parameters.cc (Parameters::set_target): Change parameter type to
8424 be non-const.
8425 (Parameters::default_target): Remove.
8426 (set_parameters_target): Change parameter type to be non-const.
8427 (parameters_force_valid_target): New function.
8428 (parameters_clear_target): New function.
8429 * parameters.h (class Parameters): Update declarations. Remove
8430 default_target method. Add sized_target and clear_target
8431 methods. Change target_ to be non-const.
8432 (set_parameters_target): Update declaration.
8433 (parameters_force_valid_target): Declare.
8434 (parameters_clear_target): Declare.
8435 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
8436 as NULL if we aren't searching.
8437 (Add_symbols::run): Don't check for compatible target.
8438 * fileread.cc (Input_file::open_binary): Call
8439 parameters_force_valid_target.
8440 * gold.cc (queue_middle_tasks): Likewise.
8441 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
8442 set_target on object.
8443 * dynobj.h (class Sized_dynobj): Update declarations.
8444 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
8445 make_elf_object returns NULL.
8446 (Archive::include_member): Don't check whether object target is
8447 compatible.
8448 * output.cc (Output_section::add_input_section): Get target from
8449 parameters.
8450 (Output_section::relax_input_section): Likewise.
8451 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
8452 parameters.
8453 (Sized_relobj::do_scan_relocs): Likewise.
8454 (Sized_relobj::relocate_sections): Likewise.
8455 * resolve.cc (Symbol_table::resolve): Likewise.
8456 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
8457 parameter. Change all callers.
8458 (Symbol_table::add_from_object): Get target from parameters.
8459 (Symbol_table::add_from_relobj): Don't check object target.
8460 (Symbol_table::add_from_dynobj): Likewise.
8461 (Symbol_table::define_special_symbol): Get target from
8462 parameters.
8463 * symtab.h (class Symbol_table): Update declaration.
8464 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
8465 parameter. Change all callers. Clear parameter target.
8466 (Binary_test): Test target here.
8467 * testsuite/object_unittest.cc (gold_testsuite): Remove
8468 target_test_pointer parameter. Change all callers.
8469 (Object_test): Test target here.
8470
a6a22b83
ILT
84712009-09-26 Ian Lance Taylor <iant@google.com>
8472
8473 * testsuite/initpri1.c: Don't try to use constructor priorities if
8474 compiling with gcc before 4.3.
8475
6a8f49fe
ILT
84762009-09-22 Mikolaj Zalewski <mikolajz@google.com>
8477
8478 * testsuite/retain_symbols_file_test.sh (check_present): Change
8479 output file name to retain_symbols_file_test.stdout.
8480 (check_absent): Likewise.
8481
8c604651
CS
84822009-09-18 Craig Silverstein <csilvers@google.com>
8483
8484 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
8485 * options.cc: Include <cerrno> and <fstream>.
8486 (General_options::finalize): Parse -retain-symbols-file tag.
8487 * options.h: New flag.
8488 (General_options): New method should_retain_symbol, new
8489 variable symbols_to_retain.
8490 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
8491 should_retain_symbol map.
8492 * testsuite/Makefile.am (retain_symbols_file_test): New test.
8493 * testsuite/Makefile.in: Regenerate.
8494 * testsuite/retain_symbols_file_test.sh: New file.
8495
ca58b19f
NC
84962009-09-18 Nick Clifton <nickc@redhat.com>
8497
8498 * po/es.po: Updated Spanish translation.
8499
20e6d0d6
DK
85002009-09-17 Doug Kwan <dougkwan@google.com>
8501
8502 * debug.h (DEBUG_RELAXATION): New constant.
8503 (DEBUG_ALL): Add DEBUG_RELAXATION.
8504 (debug_string_to_enum): Add relaxation debug option.
8505 * layout.cc
8506 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
8507 Layout::Relaxation_debug_check::read_sections,
8508 Layout::Relaxation_debug_check::read_sections): New method definitions.
8509 (Layout::Layout): Initialize data members
8510 record_output_section_data_from_scrips_,
8511 script_output_section_data_list_ and relaxation_debug_check_.
8512 (Layout::save_segments, Layout::restore_segments,
8513 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
8514 Layout::relaxation_loop_body): New method definitions.
8515 (Layout::finalize): Support relaxation. Move section layout code to
8516 Layout::relaxation_loop_body.
8517 (Layout::set_asection_address_from_script): Move code for orphan
8518 section placement out.
8519 (Layout::place_orphan_sections_in_script): New method definition.
8520 * layout.h (Output_segment_headers, Output_file_header):
8521 New forward class declarations.
8522 (Layout::~Layout): Define.
8523 (Layout::new_output_section_data_from_script): New method definition.
8524 (Layout::place_orphan_sections_in_script): New method declaration.
8525 (Layout::Segment_states): New type declaration.
8526 (Layout::save_segments, Layout::restore_segments,
8527 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
8528 Layout::relaxation_loop_body): New method declarations.
8529 (Layout::Output_section_data_list): New type declaration.
8530 (Layout::Relaxation_debug_check): New class definition.
8531 (Layout::record_output_section_data_from_script_,
8532 Layout::script_output_section_data_list_, Layout::segment_states_,
8533 Layout::relaxation_debug_check_): New data members.
8534 * output.cc: (Output_section_headers::do_size): New method definition.
8535 (Output_section_headers::Output_section_headers): Move size
8536 computation to Output_section_headers::do_size.
8537 (Output_segment_headers::do_size): New method definition.
e1df38aa 8538 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
8539 Output_file_header::do_size and call it.
8540 (Output_file_header::do_size): New method definition.
8541 (Output_data_group::Output_data_group): Adjust call to
8542 Output_section_data.
8543 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
8544 (Output_symtab_xindex::do_write): Add array bound check.
8545 (Output_section::Input_section::print_to_mapfile): Handle
8546 RELAXED_INPUT_SECTION_CODE.
8547 (Output_section::Output_section): Initialize data member checkpoint_.
8548 (Output_section::~Output_section): Delete checkpoint object pointed
8549 by checkpoint_.
8550 (Output_section::add_input_section): Always add an Input_section if
8551 relaxing.
8552 (Output_section::add_merge_input_section): Add assert.
8553 (Output_section::relax_input_section): New method definition.
8554 (Output_section::set_final_data_size): Set load address to zero for
8555 an unallocated section.
8556 (Output_section::do_address_and_file_offset_have_reset_values):
8557 New method definition.
8558 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
8559 Handle relaxed input section.
8560 (Output_section::sort_attached_input_sections): Checkpoint input
8561 section list lazily.
8562 (Output_section::get_input_sections): Change type of input_sections to
8563 list of Simple_input_section pointers. Checkpoint input section list
8564 lazily. Also handle relaxed input sections.
8565 (Output_section::add_input_section_for_script): Take a reference to
8566 a Simple_input_section object instead of Relobj pointer and section
8567 index as parameter. Handle relaxed input sections.
8568 (Output_section::save_states, Output_section::restore_states): New
8569 method definitions.
8570 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
8571 (Output_data::is_data_size_fixed): New method definition.
8572 (Output_data::reset_addresss_and_file_offset): Do not reset data size
8573 if it is fixed.
8574 (Output_data::address_and_file_offset_have_reset_values): New method
8575 definition.
8576 (Output_data::do_address_and_file_offset_have_reset_values): New method
8577 definition.
8578 (Output_data::set_data_size): Check that data size is not fixed.
8579 (Output_data::fix_data_size): New method definition.
8580 (Output_data::is_data_size_fixed_): New data member.
8581 (Output_section_headers::set_final_data_size): New method definition.
8582 (Output_section_headers::do_size): New method declaration.
8583 (Output_segment_headers::set_final_data_size): New method definition.
8584 (Output_segment_headers::do_size): New method declaration.
8585 (Output_file_header::set_final_data_size)::New method definition.
8586 (Output_file_header::do_size)::New method declaration.
8587 (Output_section_data::Output_section_data): Add new parameter
8588 is_data_size_fixed and use it to fix data size.
8589 (Output_data_const::Output_data_const): Adjust call to base class
8590 constructor and fix data size.
8591 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
8592 base class constructor and fix data size.
8593 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
8594 base class constructor and fix data size.
8595 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
8596 class constructor and fix data size.
8597 (Output_data_group::set_final_data_size): New method definition.
8598 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
8599 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
8600 class constructor and fix data size.
8601 (Output_relaxed_input_section): New class definition.
8602 (Output_section::Simple_input_section): New class definition.
8603 (Output_section::get_input_sections): Adjust parameter list.
8604 (Output_section::add_input_section_for_script): Same.
8605 (Output_section::save_states, Output_section::restore_states,
8606 Output_section::do_address_and_file_offset_have_reset_values,
8607 (Output_section::Input_section::Input_section): Handle
8608 RELAXED_INPUT_SECTION_CODE. Add new overload for
8609 Output_relaxed_input_section.
8610 (Output_section::Input_section::is_input_section,
8611 Output_section::Input_section::set_output_section): Handle relaxed
8612 input section.
8613 (Output_section::Input_section::is_relaxed_input_section,
8614 Output_section::Input_section::output_section_data,
8615 Output_section::Input_section::relaxed_input_section): New method
8616 definitions.
8617 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
8618 value.
8619 (Output_section::Input_section::u1_): Update comments.
8620 (Output_section::Input_section::u2_): Add new union member poris.
8621 (Output_section::Checkpoint_output_section): New classs definition.
8622 (Output_section::relax_input_section): New method declaration.
8623 (Output_section::checkpoint_): New data member.
8624 (Output_segment): Update comments.
8625 (Output_segment::Output_segment): Un-privatize copy constructor.
8626 (Output_segment::operator=): Un-privatize.
8627 * script-sections.cc (Output_section_element::Input_section_list):
8628 Change element type to Output_section::Simple_input_section.
8629 (Output_section_element_dot_assignment::set_section_addresses):
8630 Register output section data for relaxation clean up.
8631 (Output_data_exression::Output_data_expression): Adjust call to base
8632 constructor to fix data size.
8633 (Output_section_element_data::set_section_addresses): Register
8634 Output_data_expression object for relaxation clean up.
8635 (struct Input_section_info): Replace Relobj pointer and section index
8636 pair with Output_section::Simple_input_section and Convert struct to a
8637 class.
8638 (Input_section_sorter::operator()): Adjust access to
e1df38aa 8639 Input_section_info data member to use accessors.
20e6d0d6
DK
8640 (Output_section_element_input::set_section_addresses): Use layout
8641 parameter. Adjust code to use Output_section::Simple_input_section
8642 and Input_secction_info classes. Register filler for relaxation
8643 clean up.
8644 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
8645 and section index pair with Output_section::Simple_input_section
8646 class. Adjust code accordingly.
8647 (Phdrs_element::release_segment): New method definition.
8648 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
8649 segment list.
8650 (Script_sections::release_segments): New method definition.
8651 * gold/script-sections.h (Script_sections::release_segments): New
8652 method declaration.
8653 * gold/target.h (Target::may_relax, Target::relax,
8654 Target::do_may_relax, Target::do_relax): New method definitions.
8655
5e445df6
ILT
86562009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8657
8658 * arm.cc (has_signed_unsigned_overflow): New function.
8659 (Arm_relocate_functions::abs8): New function.
8660 (Target_arm::Scan::local): Handle R_ARM_ABS8.
8661 (Target_arm::Scan::global): Likewise.
8662 (Target_arm::relocate::relocate): Likewise.
8663 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8664 Likewise.
8665
8c604651 86662009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
8667
8668 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
8669 * testsuite/Makefile.in: Regenerate.
8670
1e9cc1c2
NC
86712009-09-11 Nick Clifton <nickc@redhat.com>
8672
8673 * po/gold.pot: Updated by the Translation project.
8674
6a89f575
CC
86752009-09-08 Cary Coutant <ccoutant@google.com>
8676
8677 * output.cc (Output_file::open): Add execute permission to empty file.
8678 * testsuite/Makefile.am (permission_test): New test.
8679 * testsuite/Makefile.in: Regenerate.
8680
fdcac5af
ILT
86812009-09-02 Ian Lance Taylor <iant@google.com>
8682
8683 * output.cc (Output_file::resize): Call map_no_anonymous rather
8684 than map.
8685
44453f85
ILT
86862009-09-01 Mikolaj Zalewski <mikolajz@google.com>
8687
8688 * gold.cc: Include "incremental.h".
8689 (queue_initial_tasks): Call Incremental_checker methods.
8690 * incremental.cc: Include "output.h".
8691 (Incremental_checker::can_incrementally_link_output_file): New
8692 method.
8693 * incremental.h (Incremental_checker): New class.
8694
8695 * output.cc (Output_file::open_for_modification): New method.
8696 (Output_file::map_anonymous): Changed return type to bool. Record
8697 map in base_ field.
8698 (Output_file::map_no_anonymous): New method, broken out of map.
8699 (Output_file::map): Use map_no_anonymous and map_anonymous.
8700 * output.h (class Output_file): Update declarations.
8701
293c1386
CC
87022009-08-24 Cary Coutant <ccoutant@google.com>
8703
8704 * options.h (Command_line::Pre_options): New class.
8705 (Command_line::pre_options): New member.
8706 * options.cc (gold::options::ready_to_register): New variable.
8707 (One_option::register_option): Do nothing if not registering options.
8708 Assert if same short option registered twice.
8709 (General_options::General_options): Turn off option registration when
8710 done constructing.
8711 (Command_line::Pre_options::Pre_options): New constructor.
8712
f773f3d2
CC
87132009-08-24 Cary Coutant <ccoutant@google.com>
8714
06a73cfe
CC
8715 * options.h (General_options::no_keep_memory): Remove incorrect
8716 short option.
f773f3d2 8717
a15af8e2
RW
87182009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8719
8720 * Makefile.am (am__skiplex, am__skipyacc): New.
8721 * Makefile.in: Regenerate.
8722
c462b41b
RW
87232009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8724
14ec8efd
RW
8725 * Makefile.am (AM_CPPFLAGS): Renamed from ...
8726 (INCLUDES): ... this.
8727 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
8728 (AM_CPPFLAGS): Renamed from ...
8729 (INCLUDE): ... this.
8730 * Makefile.in, testsuite/Makefile.in: Regenerate.
8731
81ecdfbb
RW
8732 * Makefile.in: Regenerate.
8733 * aclocal.m4: Likewise.
8734 * config.in: Likewise.
8735 * configure: Likewise.
8736 * testsuite/Makefile.in: Likewise.
8737
c462b41b
RW
8738 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
8739 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
8740 * Makefile.in: Regenerate.
8741 * testsuite/Makefile.in: Regenerate.
8742
2da73f13
CC
87432009-08-19 Cary Coutant <ccoutant@google.com>
8744
8745 * resolve.cc (Symbol_table::resolve): Don't complain about defined
8746 symbols in shared libraries overridden by hidden or internal symbols
8747 in the main program.
8748
2db70501
CD
87492009-08-19 Chris Demetriou <cgd@google.com>
8750
8751 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
8752 checking source file names in error messages.
8753
f733487b
DK
87542009-08-18 Doug Kwan <dougkwan@google.com>
8755
8756 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
8757 an elcpp::Ehdr as parameter. Adjust call to set_target.
8758 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
8759 an elfcpp::Ehdr as parameter.
8760 * object.cc (Object::set_target): Remove the version that looks up
8761 a target and sets it.
8762 (Sized_relobj::setup): Take a Target object instead of
8763 an elfcpp::Ehdr as parameter. Adjust call to set_target.
8764 (make_elf_sized_object): Find target and ask target to
8765 make an ELF object.
8766 * object.h: (Object::set_target): Remove the version that looks up
8767 a target and sets it.
8768 (Sized_relobj::setup): Take a Target object instead of
8769 an elfcpp:Ehdr as parameter.
8770 * target.cc: Include dynobj.h.
8771 (Target::do_make_elf_object_implementation): New.
8772 (Target::do_make_elf_object): New.
8773 * target.h (Target::make_elf_object): New template declaration.
8774 (Target::do_make_elf_object): New method declarations.
8775 (Target::do_make_elf_object_implementation): New template declaration.
8776
cc70f101
ILT
87772009-08-14 Ian Lance Taylor <iant@google.com>
8778
8779 * gold.h (FUNCTION_NAME): Define.
8780 (gold_unreachable): Use FUNCTION_NAME.
8781
ef5e0cb1
ST
87822009-08-12 Sriraman Tallam <tmsriram@google.com>
8783
8784 * icf.cc (Icf::find_identical_sections): Issue a warning when a
8785 symbol in the --keep-unique list is not found.
8786
48c187ce
ST
87872009-08-12 Sriraman Tallam <tmsriram@google.com>
8788
8789 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
8790 been maked as --keep-unique.
8791 (Icf::unfold_section): New function.
8792 * icf.h (Icf::unfold_section): New function.
8793 * options.h (General_options::keep_unique): New option.
8794 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
8795 * testsuite/Makefile.in: Regenerate.
8796 * testsuite/icf_keep_unique_test.sh: New file.
8797 * testsuite/icf_keep_unique_test.cc: New file.
8798
645afe0c
CC
87992009-08-12 Cary Coutant <ccoutant@google.com>
8800
8801 PR 10471
8802 * resolve.cc (Symbol_table::resolve): Check for references from
8803 dynamic objects to hidden and internal symbols.
8804 * testsuite/Makefile.am (hidden_test.sh): New test.
8805 * testsuite/Makefile.in: Regenerate.
8806 * testsuite/hidden_test.sh: New script.
8807 * testsuite/hidden_test_1.c: New test source.
8808 * testsuite/hidden_test_main.c: New test source.
8809
11af873f
DK
88102009-08-11 Doug Kwan <dougkwan@google.com>
8811
8812 * arm.cc: Update comments.
8813 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
8814 segment to locate the .ARM.exidx section if present.
8815
b9f7d72d
DK
88162009-08-09 Doug Kwan <dougkwan@google.com>
8817
8818 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
8819 patch.
8820
ddd3c53c
ST
88212009-08-07 Sriraman Tallam <tmsriram@google.com>
8822 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
8823 compiler warnings.
8824
27721062
ST
88252009-08-06 Sriraman Tallam <tmsriram@google.com>
8826
8827 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
8828 valid tls_segment only for non-debug-section relocations.
8829 * testsuite/Makefile.am: Add gc_tls_test.
8830 * testsuite/Makefile.in: Regenerate.
8831 * testsuite/gc_tls_test.cc: New file.
8832 * testsuite/gc_tls_test.sh: New file.
8833
ef15dade 88342009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 8835
ef15dade
ST
8836 * icf.cc: New file.
8837 * icf.h: New file.
8838 * Makefile.am (CCFILES): Add icf.cc.
8839 (HFILES): Add icf.h
8840 * Makefile.in: Regenerate.
8841 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
8842 * gc.h (gc_process_relocs): Populate lists used by icf to contain
8843 section, symbol and addend information for the relocs.
8844 * gold.cc (queue_middle_tasks): Call identical code folding.
8845 * gold.h: Add defines for multimap.
8846 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
8847 to the call of finalize_local_symbols.
8848 * main.cc (main): Create object of class Icf.
8849 * object.cc (Sized_relobj::do_layout): Allow this function to be
8850 called twice during icf.
8851 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
8852 to sections marked as identical by icf.
8853 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
8854 when available.
8855 (Sized_relobj::do_section_entsize): New function.
8856 * object.h (Object::section_entsize): New function.
8857 (Object::do_section_entsize): New pure virtual function.
8858 (Relobj::finalize_local_symbols): Add new parameter.
8859 (Relobj::do_section_entsize): New function.
8860 * options.h (General_options::icf): New option.
8861 (General_options::icf_iterations): New option.
8862 (General_options::print_icf_sections): New option.
8863 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
8864 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
8865 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
8866 icf.
8867 * symtab.cc (Symbol_table::is_section_folded): New function.
8868 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
8869 to sections marked as identical by icf.
8870 * symtab.h (Symbol_table::set_icf): New function.
8871 (Symbol_table::icf): New function.
8872 (Symbol_table::is_section_folded): New function.
8873 (Symbol_table::icf_): New data member.
8874 * target-reloc.h (relocate_section): Ignore sections folded by icf.
8875 * testsuite/Makefile.am: Add commands to build icf_test.
8876 * testsuite/Makefile.in: Regenerate.
8877 * testsuite/icf_test.sh: New file.
8878 * testsuite/icf_test.cc: New file.
8879
c3b65ac4
CD
88802009-07-24 Chris Demetriou <cgd@google.com>
8881
8882 * layout.cc (is_compressible_debug_section): Fix incorrect
8883 comment about compressed section names.
8884
1caf2c51
ILT
88852009-07-20 Ian Lance Taylor <ian@airs.com>
8886
8887 PR 10419
8888 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
8889
1ef4d87f
ILT
88902009-07-16 Ian Lance Taylor <iant@google.com>
8891
8892 PR 10400
8893 * layout.h: #include <map>.
8894 (class Kept_section): Change from struct to class. Add accessors
8895 and setters. Add section size to Comdat_group mapping. Change
8896 Comdat_group to std::map. Add is_comdat_ field. Add
8897 linkonce_size field in union.
8898 (class Layout): Update declaration of find_or_add_kept_section.
8899 Don't declare find_kept_object.
8900 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
8901 parameter. Add object, shndx, is_comdat, and is_group_name
8902 parameters. Change all callers. Adjust for new Kept_section.
8903 (Layout::find_kept_object): Remove.
8904 * object.cc (Sized_relobj::include_section_group): Update use of
8905 Kept_section. Rename secnum to shndx. Only record
8906 Kept_comdat_section if sections are the same size.
8907 (Sized_relobj::include_linkonce_section): Update use of
8908 Kept_section. Only record Kept_comdat_section if sections are the
8909 same size. Set size of linkonce section.
8910 (Sized_relobj::map_to_kept_section): Update call to
8911 get_kept_comdat_section.
8912 * object.h (class Sized_relobj): Rename fields in
8913 Kept_comdat_section to drop trailing underscores; change object
8914 field to Relobj*. Change Kept_comdat_section_table to store
8915 struct rather than pointer.
8916 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
8917 Add kept_object and kept_shndx parameters. Change all callers.
8918 (Sized_relobj::get_kept_comdat_section): Change return type to
8919 bool. Add kept_object and kept_shndx parameters. Change all
8920 callers.
8921 * plugin.cc (Pluginobj::include_comdat_group): Update call to
8922 Layout::find_or_add_kept_section.
8923
37c3b7b0
ILT
89242009-07-09 Ian Lance Taylor <iant@google.com>
8925
8926 * merge.cc (Object_merge_map::initialize_input_to_output_map):
8927 Reserve space in the hash table.
8928
98fa85cb
ILT
89292009-07-06 Mikolaj Zalewski <mikolajz@google.com>
8930
8931 * fileread.cc (File_read::get_mtime): New method.
8932 * fileread.h (Timespec): New structure.
8933 (File_read::get_mtime): New method.
8934 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
8935 Renamed from timestamp_nsec.
8936 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
8937 Elf_Xword.
e1df38aa 8938 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 8939 timestamp_nsec.
e1df38aa 8940 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
8941 (Incremental_inputs::report_obejct): Save mtime; style fix.
8942 (Incremental_inputs::report_script): Save mtime; style fix.
8943 (Incremental_inputs::finalize_inputs): Style fix.
8944 (Incremental_inputs::finalize): Style fix.
8945 (Incremental_inputs::create_input_section_data): Store inputs
8946 mtime.
8947 * incremental.h (Incremental_inputs::report_script): Add mtime
8948 argument.
8949 (Incremental_inputs::Input_info::Input_info): Intialize only one
8950 union member.
8951 (Incremental_inputs::Input_info::archive): Move to nameless
8952 union.
8953 (Incremental_inputs::Input_info::obejct): Move to nameless union.
8954 (Incremental_inputs::Input_info::script): Move to nameless union.
8955 (Incremental_inputs::mtime): New field.
8956 * script.cc (read_input_script): Pass file mtime to
8957 Incremental_input.
8958 * script.h (Script_info::inputs): Style fix.
8959
c9d70757
ILT
89602009-07-01 Ian Lance Taylor <ian@airs.com>
8961
8962 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
8963 instead of 32.
8964
9c547ec3
ILT
89652009-06-24 Ian Lance Taylor <iant@google.com>
8966
8967 PR 10156
8968 * layout.cc (Layout::choose_output_section): If we find an
8969 existing section, update the flags.
8970 (Layout::create_notes): New function, broken out of
8971 Layout::finalize.
8972 (Layout::finalize): Don't create note sections.
8973 (Layout::create_note): Don't crash if linker script discards
8974 section.
8975 (Layout::create_gold_note): Likewise.
8976 (Layout::create_build_id): Likewise. Don't set
8977 after_input_sections on the section.
8978 (Layout::create_executable_stack_info): Remove target parameter.
8979 Change caller.
8980 * layout.h (class Layout): Declare create_notes. Update
8981 declaration of create_executable_stack_info.
8982 * gold.cc (queue_middle_tasks): Call create_notes.
8983 * output.cc (Output_section::update_flags_for_input_section): Move
8984 here from output.h. If SHF_ALLOC flag is newly set, mark address
8985 invalid.
8986 * output.h (Output_data::mark_address_invalid): New function.
8987 (class Output_section): Only declare, not define,
8988 update_flags_for_input_section. Remove set_flags.
8989
55458500
ILT
89902009-06-24 Ian Lance Taylor <iant@google.com>
8991
8992 * script-sections.cc (Output_section_definition::
8993 set_section_addresses): Rename shadowing local load_address to
8994 laddr.
8995
1307d6cd
ILT
89962009-06-24 Ian Lance Taylor <iant@google.com>
8997
8998 PR 10244
8999 * reloc.cc (relocate_sections): Skip empty relocation sections.
9000
ec3f783e
ILT
90012009-06-23 Ian Lance Taylor <iant@google.com>
9002
9003 PR 10156
9004 * layout.cc (Layout::create_note): Use choose_output_section
9005 rather than make_output_section.
9006
459c9f1c
ILT
90072009-06-23 Ian Lance Taylor <iant@google.com>
9008
9009 PR 10237
9010 * options.cc (General_options::parse_V): Set printed_version_.
9011 (General_options::General_options): Initialize printed_version_.
9012 * options.h (class General_options): Add printed_version_ field.
9013 * gold.cc (queue_initial_tasks): If there are no input files,
9014 don't give a fatal error if we printed the version information.
9015 (queue_middle_tasks): If using -r with a shared object, give a
9016 fatal error rather than an ordinary error.
9017
1518dc8f
ILT
90182009-06-23 Ian Lance Taylor <iant@google.com>
9019
9020 PR 10219
9021 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
9022 (Layout::make_output_section): Set have_stabstr_section_ if we see
9023 a .stab*str section.
9024 (Layout::finalize): Call link_stabs_sections.
9025 (Layout::link_stabs_sections): New file.
9026 * layout.h (class Layout): Add have_stabstr_section_ field.
9027 Declare link_stabs_sections.
9028
3d857b98
DK
90292009-06-23 Doug Kwan <dougkwan@google.com>
9030
9031 * Makefile.am (libgold_a_LIBADD): New.
9032 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
9033 * Makefile.in: Regenerate.
9034 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
9035 * configure: Regenerate.
9036 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
9037 * fileread.cc: Include sys/state.h
9038 * gold.h: Declare memmem and strndup if found missing.
9039 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
9040
0639a6f6
ILT
90412009-06-23 Ian Lance Taylor <iant@google.com>
9042
9043 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
9044 * configure: Rebuild.
9045
8d63875c
ILT
90462009-06-23 Ian Lance Taylor <iant@google.com>
9047
9048 PR 10147
9049 * object.cc (Object::section_contents): Don't try to get a view if
9050 the section has length zero.
9051 (Object::handle_gnu_warning_section): If the section is empty, use
9052 the name of the section as the warning.
9053
f7c8a183
ILT
90542009-06-23 Ian Lance Taylor <iant@google.com>
9055
9056 PR 10133
9057 * stringpool.h (class Stringpool_template): Add optimize_ field.
9058 (Stringpool_template::set_optimize): New function.
9059 * stringpool.cc (Stringpool_template::Stringpool_template):
9060 Initialize optimize_ field.
9061 (Stringpool_template::set_string_offsets): Test local optimize
9062 fild rather than parameter.
9063 * layout.cc (Layout::Layout): Call set_optimize on the section
9064 name stringpool.
9065
e6a307ba
ILT
90662009-06-22 Ian Lance Taylor <iant@google.com>
9067
9068 PR 10030
9069 * yyscript.y: Parse TARGET.
9070 * script.cc (script_set_target): New function.
9071 * script-c.h (script_set_target): Declare.
9072 * options.cc (General_options::string_to_object_format): Rename
9073 from string_to_object_format in anonymous namespace. Change
9074 callers.
9075 * options.h (class General_options): Declare
9076 string_to_object_format.
9077
3ee173de
ILT
90782009-06-22 Ian Lance Taylor <iant@google.com>
9079
9080 * script-sections.cc (Script_sections::create_segments): Don't put
9081 program headers in a PT_LOAD segment if -n or -N.
9082
90832009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
9084
9085 PR 10141
9086 * options.h (class General_options): Add -z lazy and -z now. Sort
9087 -z options into alphabetical order.
9088 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
9089
cd6739a1 90902009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
9091
9092 * layout.cc (Layout::make_output_section): Call
9093 Target::new_output_section.
9094 (Layout::attach_allocated_section_to_segment): Put large section
9095 sections in a separate load segment with the large segment flag
9096 set.
9097 (Layout::segment_precedes): Sort large data segments after other
9098 load segments.
9099 (align_file_offset): New static function.
9100 (Layout::set_segment_offsets): Use align_file_offset.
9101 * output.h (class Output_section): Add is_small_section_ and
9102 is_large_section_ fields.
9103 (Output_section::is_small_section): New function.
9104 (Output_section::set_is_small_section): New function.
9105 (Output_section::is_large_section): New function.
9106 (Output_section::set_is_large_section): New function.
9107 (Output_section::is_large_data_section): New function.
9108 (class Output_segment): Add is_large_data_segment_ field.
9109 (Output_segment::is_large_data_segment): New function.
9110 (Output_segment::set_is_large_data_segment): New function.
9111 * output.cc (Output_section::Output_section): Initialize new
9112 fields.
9113 (Output_segment::Output_segment): Likewise.
9114 (Output_segment::add_output_section): Add assertion that large
9115 data sections always go in large data segments. Force small data
9116 sections to the end of the list of data sections. Force small BSS
9117 sections to the start of the list of BSS sections. For large BSS
9118 sections to the end of the list of BSS sections.
9119 * symtab.h (class Symbol): Declare is_common_shndx.
9120 (Symbol::is_defined): Check Symbol::is_common_shndx.
9121 (Symbol::is_common): Likewise.
9122 (class Symbol_table): Define enum Commons_section_type. Update
9123 declarations. Add small_commons_ and large_commons_ fields.
9124 * symtab.cc (Symbol::is_common_shndx): New function.
9125 (Symbol_table::Symbol_table): Initialize new fields.
9126 (Symbol_table::add_from_object): Put small and large common
9127 symbols in the right list.
9128 (Symbol_table::sized_finalized_symbol): Check
9129 Symbol::is_common_shndx.
9130 (Symbol_table::sized_write_globals): Likewise.
9131 * common.cc (Symbol_table::do_allocate_commons): Allocate new
9132 common symbol lists. Don't call do_allocate_commons_list if the
9133 list is empty.
9134 (Symbol_table::do_allocate_commons_list): Remove is_tls
9135 parameter. Add comons_section_type parameter. Change all
9136 callers. Handle small and large common symbols.
9137 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
9138 Symbol::is_common_shndx.
9139 * resolve.cc (symbol_to_bits): Likewise.
9140 * target.h (Target::small_common_shndx): New function.
9141 (Target::small_common_section_flags): New function.
9142 (Target::large_common_shndx): New function.
9143 (Target::large_common_section_flags): New function.
9144 (Target::new_output_section): New function.
9145 (Target::Target_info): Add small_common_shndx, large_common_shndx,
9146 small_common_section_flags, and large_common_section_flags
9147 fields.
9148 (Target::do_new_output_section): New virtual function.
9149 * arm.cc (Target_arm::arm_info): Initialize new fields.
9150 * i386.cc (Target_i386::i386_info): Likewise.
9151 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
9152 Likewise.
9153 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
9154 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
9155 (Target_x86_64::do_new_output_section): New function.
9156 * configure.ac: Define conditional MCMODEL_MEDIUM.
9157 * testsuite/Makefile.am (check_PROGRAMS): Add large.
9158 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
9159 (large_LDFLAGS): Define.
9160 * testsuite/large.c: New file.
9161 * testsuite/testfile.cc (Target_test::test_target_info):
9162 Initialize new fields.
9163 * configure, testsuite/Makefile.in: Rebuild.
9164
bb04269c
DK
91652009-06-05 Doug Kwan <dougkwan@google.com>
9166
9167 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 9168 * Makefile.in: Regenerate.
bb04269c
DK
9169 * i386.cc (class Target_i386): Define new virtual method to
9170 override do_is_local_label_name in parent.
9171 * object.cc (Sized_relobj::do_count_local_symbols): Discard
9172 local symbols if --discard-locals or -X is given.
9173 * options.h (class General_options): Declare new options
9174 '--discard-locals' and '-X' for discarding locals.
9175 * target.h (class Target): Define new methods is_local_label_name.
9176 Declare new virtual method do_is_local_label_name.
9177 * target.cc: New file.
9178 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
9179 (check_SCRIPTS): Add discard_locals_test.sh.
9180 (check_DATA): Add discard_local_tests.syms.
9181 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
9182 (discard_local_tests.syms, discard_locals_test.o): New make rules.
9183 * testsuite/Makefile.in: Regenerate.
9184 * testsuite/discard_locals_test.c: New file.
9185 * testsuite/discard_locals_test.sh: Same.
9186
805bb01c
DK
91872009-06-05 Doug Kwan <dougkwan@google.com>
9188
9189 * object.cc (Sized_relobj::Sized_relobj): Initialize
9190 discarded_eh_frame_shndx_ to -1U.
9191 (Sized_relobj::do_layout): Record index of a discard .eh_frame
9192 section.
9193 (Sized_relobj::do_count_local_symbols): Skip local symbols in
9194 a discarded .eh_frame section.
9195 (Sized_relobj::do_finalize_local_symbols): Ditto.
9196 * object.h (class Sized_relobj): Declare new member
9197 discarded_eh_frame_shndx_.
9198 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
9199 (local_labels_test.o, local_labels_test): New rules.
9200 * testsuite/Makefile.in: Regenerate.
9201
1dcd334d
DK
92022009-06-04 Doug Kwan <dougkwan@google.com>
9203
9204 * layout.cc (Layout::section_name_mapping): Add mapping for
9205 special ARM sections.
9206
96d49306
DK
92072009-06-03 Doug Kwan <dougkwan@google.com>
9208
9209 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
9210 (utils::has_overflow): Same.
9211
dff16297
ILT
92122009-06-03 Ian Lance Taylor <iant@google.com>
9213
9214 * layout.cc (Layout::section_name_mapping): New array, replacing
9215 Layout::linkonce_mapping.
9216 (Layout::section_name_mapping_count): New variable, replacing
9217 Layout::linkonce_mapping_count.
9218 (Layout::linkonce_output_name): Remove.
9219 (Layout::output_section_name): Rewrite.
9220 * layout.h (class Layout): Rename Linkonce_mapping to
9221 Section_name_mapping, linkonce_mapping to section_name_mapping,
9222 linkonce_mapping_count to section_name_mapping_count. Don't
9223 declare linkonce_output_name.
9224
c121c671
DK
92252009-06-03 Doug Kwan <dougkwan@google.com>
9226
9227 * gold/arm.cc (namespace utils): New.
9228 (Target_arm::reloc_is_non_pic): Define new method.
9229 (class Arm_relocate_functions): New.
9230 (Target_arm::Relocate::relocate): Handle relocation types used by
9231 Android.
9232
07800fab
ILT
92332009-06-03 Ian Lance Taylor <iant@google.com>
9234
9235 * arm.cc (Target_arm::scan::global): Use || instead of |.
9236
c121c671
DK
92372009-06-02 Doug Kwan <dougkwan@google.com>
9238
9239 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
9240 issued_non_pic_error_.
9241 (class Target_arm::Scan): Declare new method check_non_pic.
9242 Define new method symbol_needs_plt_entry.
9243 Declare new data member issued_non_pic_error_.
9244 (class Target_arm::Relocate): Declare new method
9245 should_apply_static_reloc.
9246 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
9247 (Target_arm::Scan::check_non_pic): Define new method.
9248 (Target_arm::Scan::local): Handle a small subset of reloc types used
9249 by Android.
9250 (Target_arm::Scan::local): Same.
9251 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
9252
b19b0c6d
ILT
92532009-05-31 Mikolaj Zalewski <mikolajz@google.com>
9254
9255 * incremental.cc (Incremental_inputs::report_command_line): Filter
9256 out --incremental-* options.
9257
94cdfcff
DK
92582009-05-29 Doug Kwan <dougkwan@google.com>
9259
9260 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
9261 template class.
9262 (class Target_arm): Update comment.
9263 (Target_arm::Target_arm): Initialize new data members GOT_,
9264 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
9265 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
9266 and Target_arm::rel_dyn_section.
9267 Declare new_enum Target_arm::Got_type.
9268 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
9269 and DYNBSS_.
9270 Update commments for member do_dynsym_value.
9271 (Target_arm::got_size, Target_arm::plt_section,
9272 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
9273 new methods inside class defintion.
9274 (Target_arm::got_section): Define new method.
9275 (Target_arm::rel_dyn_section): Same.
9276 (Output_data_plt_arm): New template class.
9277 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
9278 (Output_data_plt_arm:do_adjust_output_section): Define new method.
9279 (Output_data_plt_arm::add_entry): Same.
9280 (Output_data_plt_arm::first_plt_entry): Define new
9281 static data member for PLT instruction template.
9282 (Output_data_plt_arm::plt_entry): Same.
9283 (Output_data_plt_arm::do_write): Define new method.
9284 (Target_arm::make_plt_entry): Same.
9285 (Target_arm::do_finalize_sections): Same.
9286 (Target_arm::do_dynsym_value): Same.
9287
4a657b0d
DK
92882009-05-28 Doug Kwan <dougkwan@google.com>
9289
9290 * Makefile.am (TARGETSOURCES): Add arm.cc.
9291 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
9292 * Makefile.in: Regenerate.
9293 * arm.cc: New file.
9294 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
9295
e7ae8c36
DK
92962009-05-26 Doug Kwan <dougkwan@google.com>
9297
9298 * options.cc (General_options::parse_exclude_libs). Fix a comment.
9299 (General_options::check_excluded_libs): Strip off directories in
9300 archive name before matching like GNU ld does.
9301 * testsuite/Makefile.am (MOSTLYCLEANFILES,
9302 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
9303 (exclude_libs_test_LDFLAGS): Add linker option
9304 -Wl,--exclude-libs,libexclude_libs_test_3
9305 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
9306 an explicit archive without using -l.
9307 (alt/libexclude_libs_test_3.a): New make rule.
9308 * testsuite/Makefile.in: Regenerate.
9309 * testsuite/exclude_libs_test.c : Declare lib3_default().
9310 (main): Call it.
9311 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
9312 * exclude_libs_test_3.c: New file.
9313
f12e7348
NC
93142009-05-26 Nick Clifton <nickc@redhat.com>
9315
9316 * po/id.po: New Indonesian translation.
9317 * po/gold.pot: Updated template file.
9318
4daadc0d
ST
93192009-05-22 Sriraman Tallam <tmsriram@google.com>
9320
e1df38aa 9321 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
9322 gc_comdat_test files. Add -Wl,--gc-sections to build
9323 gc_comdat_test.
9324 * testsuite/Makefile.in: Regenerate.
9325 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
9326
531813ad
ST
93272009-05-21 Sriraman Tallam <tmsriram@google.com>
9328
9329 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
9330 kept comdat section was garbage collected.
9331 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
9332 * testsuite/Makefile.in: Regenerate.
9333 * testsuite/gc_comdat_test.sh: New file.
9334 * testsuite/gc_comdat_test_1.cc: New file.
9335 * testsuite/gc_comdat_test_2.cc: New file.
9336
65514900
CC
93372009-05-19 Doug Kwan <dougkwan@google.com>
9338
9339 * archive.cc (Archive::Archive): Move constructor from archive.h
9340 to here. Initialize no_export_.
9341 (Archive::get_elf_object_for_member): Set no_export flag of object.
9342 * archive.h (Archive::Archive): Move constructor body to
9343 archive.cc.
9344 (Archive::no_export): New method.
9345 (Archive::no_export_): New field.
9346 * object.h (Object::Object): Initialize no_export_ to false.
9347 (Object::no_export, Object::set_no_export): New methods.
9348 (Object::no_export_): New field.
9349 * options.cc (General_options::parse_exclude_libs): New method.
9350 (General_options::check_excluded_libs) Same.
9351 * options.h (exclude_libs): New option.
9352 (General_options::check_excluded_libs): New method declaration.
9353 (General_options::excluded_libs_): New field.
9354 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
9355 default or protected visibility if an object has no-export flag set.
9356 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
9357 (check_SCRIPTS): Add exclude_libs_test.sh.
9358 (check_DATA): Add exclude_libs_test.syms.
9359 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
9360 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
9361 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
9362 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
9363 (exclude_libs_test.syms, libexclude_libs_test_1.a,
9364 libexclude_libs_test_2.a): New rules.
9365 * testsuite/Makefile.in: Regenerate.
9366 * testsuite/exclude_libs_test.c: New file.
9367 * testsuite/exclude_libs_test.sh: Ditto.
9368 * testsuite/exclude_libs_test_1.c: Ditto.
9369 * testsuite/exclude_libs_test_2.c: Ditto.
9370
1b77ea50
ILT
93712009-05-15 Ian Lance Taylor <iant@google.com>
9372
9373 * configure.ac: Check for declarations for cases where libiberty.h
9374 checks HAVE_DECL_xxx.
9375 * configure, config.in: Rebuild.
9376
072fe7ce
ILT
93772009-05-15 Mikolaj Zalewski <mikolajz@google.com>
9378
9379 * gold.h (Incremental_argument_list): Remove (invalid) forward
9380 declaration.
9381 * incremental.cc (Incremental_inputs::report_achive): New method.
9382 (Incremental_inputs::report_object): New method.
9383 (Incremental_inputs::report_script): New method.
9384 (Incremental_inputs::finalize_inputs): New method.
9385 (Incremental_inputs::finalize): Call finalize_inputs().
9386 (Incremental_inputs::sized_create_incremental_inputs_section_data):
9387 Create inputs entries.
9388 * incremental.h (Incremental_input_type): New enum.
9389 (Incremental_inputs::Incremental_input): Initialize new fields.
9390 (Incremental_inputs::report_inputs): New method.
9391 (Incremental_inputs::report_achive): New method.
9392 (Incremental_inputs::report_object): New method.
9393 (Incremental_inputs::report_script): New method.
9394 (Incremental_inputs::finalize_inputs): New method.
9395 (Incremental_inputs::Input_info): New struct.
9396 (Incremental_inputs::Input_info_map): New typedef.
9397 (Incremental_inputs::lock_): New field.
9398 (Incremental_inputs::Inputs_): New field.
9399 (Incremental_inputs::Inputs_map): New field.
9400 * main.cc (main): Call Incremental_input::report_inputs.
9401 * options.h (Input_argument_list): Typedef moved from
9402 Input_arguments.
9403 (Input_file_group::Files): Remove, use ::Input_argument_list.
9404 (Input_file_group::Input_argument_list): Remove, use
9405 ::Input_argument_list.
9406 * plugin.cc (Plugin_manager::add_input_file): Add error in
9407 incremental build.
9408 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
9409 functions.
9410 * script.cc (read_input_script): Call
9411 Incremental_input::report_script.
9412 * script.h (Script_info): New class.
9413
b0481b0b
ILT
94142009-04-27 Ian Lance Taylor <iant@google.com>
9415
9416 * x86_64.cc (do_adjust_output_section): Set entsize to
9417 plt_entry_size.
9418
b22a5a41 94192009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
9420
9421 * output.cc (Output_file::close): After short writes, continue
9422 writing from the correct offset in the buffer being written.
9423
40fde488
CD
94242009-04-23 Chris Demetriou <cgd@google.com>
9425
9426 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
9427 * configure: Regenerate.
9428 * config.in: Regenerate.
9429 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
9430 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
9431
3ce2c28e
ILT
94322009-04-21 Mikolaj Zalewski <mikolajz@google.com>
9433
9434 * incremental.cc (Incremental_inputs_header_data): Renamed from
9435 Incremental_input_header_data.
9436 (Incremental_inputs_header_data::data_size): New field.
9437 (Incremental_inputs_header_data::put_input_file_count): Renamed
9438 from input_file_count.
9439 (Incremental_inputs_header_data::put_command_line_offset): Renamed
9440 from command_line_offset.
9441 (Incremental_inputs_header_data::put_reserved): Renamed from
9442 put_reserved.
9443 (Incremental_inputs_entry_data): Renamed from
9444 Incremental_input_entry_data.
9445 (Incremental_inputs_entry_data::data_size): New field.
9446 (Incremental_inputs::report_command_line): New method.
9447 (Incremental_inputs::finalize): New method.
9448 (Incremental_inputs::create_incremental_inputs_data): New method.
9449 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
9450 * incremental.h: New file.
9451 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
9452 (Layout::finalize): Create incremental inputs section in
9453 incremental builds.
9454 (Layout::create_incremental_info_sections): New method.
9455 * layout.h (Layout::incremental_inputs): New method.
9456 (Layout::create_incremental_info_sections): New method.
9457 (Layout::incremental_inputs_): New field.
9458 * main.cc (main): Notify Incremental_input of the command line.
9459
e55bde5e
ILT
94602009-04-01 Ian Lance Taylor <iant@google.com>
9461 Mikolaj Zalewski <mikolajz@google.com>
9462
9463 * gold.h (reserve_unordered_map): Define, three versions, one for
9464 each version of Unordered_map.
9465 * layout.cc (Layout::Layout): Remove options parameter. Add
9466 number_of_input_files parameter. Don't initialize options_.
9467 Initialize number_of_input_files_ and resized_signatures_. Move
9468 sections_are_attached_.
9469 (Layout::layout_group): Reserve space for group_signatures_.
9470 (Layout::find_or_add_kept_section): Change name parameter to be a
9471 reference. Resize signatures_ map when it gets large enough.
9472 (Layout::layout_eh_frame): Use parameters->options() instead of
9473 this->options_.
9474 (Layout::make_output_section): Likewise.
9475 (Layout::attach_allocated_section_to_segment): Likewise.
9476 (Layout::finalize, Layout::create_executable_stack): Likewise.
9477 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
9478 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
9479 * layout.h (class Layout): Update declarations. Remove options_
9480 field. Add number_of_input_files_ and resized_signatures_
9481 fields. Move sections_are_attached_ field.
9482 * main.cc (main): Pass number of input files to Layout
9483 constructor. Don't pass options.
9484
154b857c
ILT
94852009-03-30 Ian Lance Taylor <iant@google.com>
9486
9487 * ffsll.c (ffsll): Correct implementation.
9488
2f35ab9b
ILT
94892009-03-27 Ian Lance Taylor <iant@google.com>
9490
fd03461a
ILT
9491 * ffsll.c: New file.
9492 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
9493 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
9494 * ftruncate.c (ftruncate): Declare before definition.
9495 * mremap.c (mremap): Likewise.
9496 * pread.c (pread): Likewise.
9497 * configure, Makefile.in, config.in: Rebuild.
9498
2f35ab9b
ILT
9499 * mremap.c: New file.
9500 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
9501 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
9502 (mremap): Declare if HAVE_MREMAP is not defined.
9503 * configure, Makefile.in, config.in: Rebuild.
9504
33aea2fd
CC
95052009-03-27 Cary Coutant <ccoutant@google.com>
9506
9507 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
9508 position independent.
9509 * sparc.cc (Target_sparc::check_non_pic): Likewise.
9510 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
9511
6d479619
CC
95122009-03-24 Cary Coutant <ccoutant@google.com>
9513
9514 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
9515 an executable.
9516 (needs_dynamic_reloc): Likewise.
9517
afc06bb8
ILT
95182009-03-24 Ian Lance Taylor <iant@google.com>
9519
9520 * yyscript.y (file_cmd): Recognize EXTERN.
9521 (extern_name_list, extern_name_list_body): New nonterminals.
9522 * script.cc (script_add_extern): Define.
9523 * script-c.h (script_add_extern): Declare.
9524
f6060a4d
ILT
95252009-03-24 Rafael Avila de Espindola <espindola@google.com>
9526
9527 * object.cc (is_elf_object): Define.
9528 * object.h (is_elf_object): Declare.
9529 * archive.cc (Archive::get_elf_object_for_member): Call
9530 is_elf_object.
33aea2fd 9531 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 9532
26736d8e
ILT
95332009-03-24 Elliott Hughes <enh@google.com>
9534
9535 * output.cc (Output_file::map_anonymous): Define.
9536 (Output_file::map): Use map_anonymous. If the regular mmap fails,
9537 try an anonymous one. Report the size if the mmap fails.
9538 * output.h (class Output_file): Declare map_anonymous.
9539
22fd9730
ILT
95402009-03-24 Ian Lance Taylor <iant@google.com>
9541
9542 * target-select.cc (instantiate_target): Don't acquire the lock if
9543 the instantiated_target_ field has already been set.
9544
cb010894
ILT
95452009-03-23 Ian Lance Taylor <iant@google.com>
9546
7f055c20
ILT
9547 * gold-threads.h (class Initialize_lock): Define.
9548 * gold-threads.cc (class Initialize_lock_once): Define.
9549 (initialize_lock_control): New static variable.
9550 (initialize_lock_pointer): New static variable.
9551 (initialize_lock_once): New static function.
9552 (Initialize_lock::Initialize_lock): Define.
9553 (Initialize_lock::initialize): Define.
9554 * target-select.h: Include "gold-threads.h".
9555 (class Target_selector): Add lock_ and initialize_lock_ fields.
9556 Don't define instantiate_target, just declare it.
9557 * target-select.cc (Target_selector::Target_selector): Initialize
9558 new fields.
9559 (Target_selector::instantiate_target): Define.
9560 * descriptors.h: Include "gold-threads.h".
9561 (class Descriptors): Add initialize_lock_ field.
9562 * descriptors.cc (Descriptors::Descriptors): Initialize new
9563 field.
9564 (Descriptors::open): Use initialize_lock_ field
9565 * errors.h (class Errors): Add initialize_lock_ field.
9566 * errors.cc (Errors::Errors): Initialize new field.
9567 (Errors::initialize_lock): Use initialize_lock_ field.
9568 * powerpc.cc (class Target_selector_powerpc): Remove
9569 instantiated_target_ field. In do_recognize call
9570 instantiate_target rather than do_instantiate_target. In
9571 do_instantiate_target just allocate a new target.
9572 * sparc.cc (class Target_selector_sparc): Likewise.
9573
36959681
ILT
9574 * freebsd.h: New file.
9575 * i386.cc: Include "freebsd.h".
9576 (Target_i386): Derive from Target_freebsd rather than
9577 Sized_target.
9578 (Target_selector_i386): Derive from Target_selector_freebsd rather
9579 than Target_selector.
9580 * x86_64.cc: Include "freebsd.h".
9581 (Target_x86_64): Derive from Target_freebsd rather than
9582 Sized_target.
9583 (Target_selector_x86_64): Derive from Target_selector_freebsd
9584 rather than Target_selector.
9585 * target.h (class Target): Add adjust_elf_header and
9586 do_adjust_elf_header.
9587 * output.cc (Output_file_header:: do_sized_write): Call target
9588 adjust_elf_header routine.
9589 * configure.tgt: Set targ_osabi.
9590 * configure.ac: Define GOLD_DEFAULT_OSABI.
9591 * parameters.cc (Parameters::default_target): Pass
9592 GOLD_DEFAULT_OSABI to select_target.
9593 * target-select.h (class Target_selector): Make instantiate_target
9594 protected rather than private.
9595 * Makefile.am (HFILES): Add freebsd.h.
9596 * configure, Makefile.in, config.in: Rebuild.
9597
cb010894
ILT
9598 * merge.cc (do_add_input_section): Correct pend value. Change
9599 message about last entry not being null terminated from error to
9600 warning.
9601
0e879927
ILT
96022009-03-20 Mikolaj Zalewski <mikolajz@google.com>
9603
9604 * incremental.cc: New file.
9605 * Makefile.am (CCFILES): Add incremental.cc.
9606 * Makefile.in: Rebuild.
9607
41105937
PP
96082009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
9609
9610 * layout.cc (Layout::output_section_name): Preserve names
9611 of '.note.' sections.
e1df38aa 9612
60439920
ILT
96132009-03-19 Ian Lance Taylor <iant@google.com>
9614
9615 * descriptors.cc (Descriptors::open): Check that the options are
9616 valid before using them.
9617
0d371ad3
ILT
96182009-03-18 Ian Lance Taylor <iant@google.com>
9619
9620 * script-sections.h: Include <list>.
9621 (class Script_sections): Change Sections_elements from std::vector
9622 to std::list. Typedef public Elements_iterator. Add
9623 orphan_section_placement_, data_segment_align_start_, and
9624 saw_data_segment_align_ fields. Remove data_segment_align_index_
9625 field.
9626 * script-sections.cc (class Orphan_section_placement): New class.
9627 (class Sections_element): Add virtual functions is_relro and
9628 orphan_section_init. Remove virtual function place_orphan_here.
9629 (class Output_section_definition): Add is_relro and
9630 orphan_section_init. Remove place_orphan_here.
9631 (class Orphan_output_section): Likewise.
9632 (Script_sections::Script_sections): Update for field changes.
9633 (Script_sections::data_segment_align): Set saw_data_segment_align_
9634 and data_segment_align_start_, not data_segment_align_index.
9635 (Script_sections::data_segment_relro_end): Check
9636 saw_data_segment_align_. Use data_segment_align_start_ rather
9637 than data_segment_align_index_.
9638 (Script_sections::place_orphan): Rewrite to use
9639 Orphan_section_placement.
9640
9201d894
ILT
96412009-03-17 Ian Lance Taylor <iant@google.com>
9642
9c5b8369
ILT
9643 * archive.cc (Archive::add_symbols): Check for a version attached
9644 to the symbol name in the archive map.
9645 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
9646 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
9647 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
9648 (ver_test_11.a): New target.
9649 * testsuite/Makefile.in: Rebuild.
9650
9201d894
ILT
9651 * configure.ac: Check for chsize and posix_fallocate. Replace
9652 ftruncate.
9653 * ftruncate.c: New file, from gnulib.
9654 * output.cc (posix_fallocate): Define dummy version if not
9655 HAVE_POSIX_FALLOCATE.
9656 (Output_file::map): Call posix_fallocate rather than lseek and
9657 write.
9658 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
9659 * configure, Makefile.in, config.in: Rebuild.
9660
ef4ab7a8 96612009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 9662
ef4ab7a8
PP
9663 * layout.h (Layout::create_note): Add section_name parameter.
9664 * layout.cc (Layout::create_note): Likewise.
9665 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 9666
8c500701
ILT
96672009-03-17 Ian Lance Taylor <iant@google.com>
9668
e85b18e1
ILT
9669 * descriptors.cc: Include "options.h".
9670 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
9671 (Descriptors::open): Always use O_CLOEXEC when opening a new
9672 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
9673 then set FD_CLOEXEC.
9674
9efe6174
ILT
9675 * sparc.cc (class Target_sparc): Add has_got_section.
9676 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
9677 make sure we have a GOT section.
9678
9679 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
9680 (Target_sparc::Scan::local): Likewise.
9681 (Target_sparc::Scan::global): Likewise.
9682 (Target_sparc::Relocate::relocate): Likewise.
9683 (Target_sparc::Relocate::relocate_tls): Likewise.
9684
8c500701
ILT
9685 * symtab.cc (Symbol_table::define_default_version): New function,
9686 broken out of add_from_object.
9687 (Symbol_table::add_from_object): Call define_default_version.
9688 (Symbol_table::define_special_symbol): Add resolve_oldsym
9689 parameter. Change all callers. If the version for a symbol comes
9690 from a version script, resolve it with the symbol with the same
9691 name with no version. Also add the symbol without a version if
9692 appropriate.
9693 (do_define_in_output_data): If resolving with oldsym, don't delete
9694 sym.
9695 (do_define_in_output_segment): Likewise.
9696 (do_define_as_constant): Likewise.
9697 * symtab.h (class Symbol_table): Update declarations.
9698
f1ed28fb
ILT
96992009-03-13 Ian Lance Taylor <iant@google.com>
9700
15f8229b
ILT
9701 * readsyms.cc (Read_symbols::incompatible_warning): New function.
9702 (Read_symbols::requeue): New function.
9703 (Read_symbols::do_read_symbols): If make_elf_object fails because
9704 the target type is not configured, and the file was searched for,
9705 issue a warning and retry with the next directory.
9706 (Add_symbols::run): If the file has an incompatible format, and
9707 it was searched for, requeue the Read_symbols task. On error,
9708 release the object.
9709 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
9710 dirindex parameter to constructor. Change all callers. Declare
9711 incompatible_warning and requeue.
9712 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
9713 input_argument_ and input_group_ fields. Add them to
9714 constructor. Change all callers.
9715 (class Read_script): Add dirindex_ field. Add it to constructor.
9716 Change all callers.
9717 * archive.cc (Archive::setup): Remove input_objects parameter.
9718 Change all callers.
9719 (Archive::get_file_and_offset): Likewise.
9720 (Archive::read_all_symbols): Likewise.
9721 (Archive::read_symbols): Likewise.
9722 (Archive::get_elf_object_for_member): Remove input_objects
9723 parameter. Add punconfigured parameter. Change all callers.
9724 (Archive::add_symbols): Change return type to bool. Check return
9725 value of include_member.
9726 (Archive::include_all_members): Likewise.
9727 (Archive::include_member): Change return type to bool. Return
9728 false if first included object has incompatible target. Set
9729 included_member_ field.
9730 (Add_archive_symbols::run): If add_symbols returns false, requeue
9731 Read_symbols task.
9732 * archive.h (class Archive): Add included_member_ field.
9733 Initialize it in constructor. Add input_file and searched_for
9734 methods. Update declarations.
9735 (class Add_archive_symbols): Add dirpath_, dirindex_, and
9736 input_argument_ fields. Add them to constructor. Change all
9737 callers.
9738 * script.cc: Include "target-select.h".
9739 (class Parser_closure): Add skip_on_incompatible_target_ and
9740 found_incompatible_target_ fields. Add
9741 skip_on_incompatible_target parameter to constructor. Change all
9742 callers. Add methods skip_on_incompatible_target,
9743 clear_skip_on_incompatible_target, found_incompatible_target, and
9744 set_found_incompatible_target.
9745 (read_input_script): Add dirindex parameter. Change all callers.
9746 If parser finds an incompatible target, requeue Read_symbols
9747 task.
9748 (script_set_symbol): Clear skip_on_incompatible_target in
9749 closure.
9750 (script_add_assertion, script_parse_option): Likewise.
9751 (script_start_sections, script_add_phdr): Likewise.
9752 (script_check_output_format): New function.
9753 * script.h (read_input_script): Update declaration.
9754 * script-c.h (script_check_output_format): Declare.
9755 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
9756 (ignore_cmd): Remove OUTPUT_FORMAT.
9757 * fileread.cc (Input_file::Input_file): Add explicit this.
9758 (Input_file::will_search_for): New function.
9759 (Input_file::open): Add pindex parameter. Change all callers.
9760 * fileread.h (class Input_file): Add input_file_argument method.
9761 Declare will_search_for. Update declarations.
9762 * object.cc (make_elf_object): Add punconfigured parameter.
9763 Change all callers.
9764 * object.h (class Object): Make input_file public. Add
9765 searched_for method.
9766 (make_elf_object): Update declaration.
9767 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
9768 restart search.
9769 * dirsearch.h (class Dirsearch): Update declaration.
9770 * options.h (class General_options): Add --warn-search-mismatch.
9771 * parameters.cc (Parameters::is_compatible_target): New function.
9772 * parameters.h (class Parameters): Declare is_compatible_target.
9773 * workqueue.cc (Workqueue::add_blocker): New function.
9774 * workqueue.h (class Workqueue): Declare add_blocker.
9775
f1ed28fb
ILT
9776 * fileread.cc (Input_file::open): Remove options parameter.
9777 Change all callers.
9778 (Input_file::open_binary): Likewise.
9779 * script.cc (read_input_script): Likewise.
9780 * readsyms.h (class Read_symbols): Remove options_ field. Remove
9781 options parameter from constructor. Change all callers.
9782 (class Read_script): Likewise.
9783 * fileread.h (class Input_file): Update declarations.
9784 * script.h (read_input_script): Update declaration.
9785
34dd024a
NC
97862009-03-10 Nick Clifton <nickc@redhat.com>
9787
9788 * po/es.po: New Spanish translation.
9789
6d71b17c
CC
97902009-03-06 Cary Coutant <ccoutant@google.com>
9791
9792 * options.cc (parse_short_option): Keep dash_z from registering itself.
9793
031cdbed
ILT
97942009-03-03 Ian Lance Taylor <iant@google.com>
9795
9796 PR 9918
9797 * target-reloc.h (relocate_section): Pass output_section to
9798 relocate.
9799 * i386.cc (Target_i386::should_apply_static_reloc): Add
9800 output_section parameter. Change all callers.
9801 (Target_i386::Relocate::relocate): Add output_section parameter.
9802 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
9803 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
9804 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
9805 * testsuite/two_file_shared.sh: New script.
9806 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
9807 (check_DATA): Add two_file_shared.dbg.
9808 (two_file_shared.dbg): New target.
9809 * testsuite/Makefile.in: Rebuild.
9810
15d5fa16
ILT
98112009-03-01 Ian Lance Taylor <iant@google.com>
9812
9813 * configure.ac: Check for byteswap.h.
9814 * configure: Rebuild.
9815 * config.in: Rebuild.
9816
8a4c0b0d
ILT
98172009-03-01 Mikolaj Zalewski <mikolajz@google.com>
9818
9819 * layout.cc (Layout::find_or_add_kept_section): New function.
9820 (Layout::add_comdat): Removed.
9821 * layout.h (struct Kept_section): Move out of class Layout.
9822 Remove trailing underscores from field names. Add group_sections
9823 field. Rename group_ field to is_group. Change all uses.
9824 (class Layout): Declare find_or_add_kept_section, not add_comdat.
9825 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
9826 comdat_groups_ field.
9827 (Sized_relobj::include_section_group): Use
9828 find_or_add_kept_section and Kept_section::group_sections.
9829 (Sized_relobj::include_linkonce_section): Likewise.
9830 * object.cc (class Sized_relobj): Don't define Comdat_group or
9831 Comdat_group_table. Remove find_comdat_group and
9832 add_comdat_group. Remove comdat_groups_ field.
9833 * plugin.cc (include_comdat_group): Use
9834 Layout::find_or_add_kept_section.
9835
b4ecf66b
ILT
98362009-02-28 Ian Lance Taylor <iant@google.com>
9837
14359ca0
ILT
9838 * README: --gc-sections and map files are now supported. Document
9839 some build requirements.
9840
b4ecf66b
ILT
9841 PR 6992
9842 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
9843 relocatable link set the value of the section symbol to zero.
9844 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
9845 relocatable link don't include the section address in the local
9846 symbol value.
9847
0602e05a
ILT
98482009-02-27 Ian Lance Taylor <iant@google.com>
9849
fd9d194f
ILT
9850 PR 6811
9851 * options.h (class Search_directory): Add is_system_directory.
9852 (class General_options): Declare is_in_system_directory.
9853 * options.cc (get_relative_sysroot): Make static.
9854 (get_default_sysroot): Make static.
9855 (General_optoins::is_in_system_directory): New function.
9856 * fileread.cc (Input_file::is_in_system_directory): New function.
9857 * fileread.h (class Input_file): Declare is_in_system_directory.
9858 * object.h (class Object): Add is_in_system_directory.
9859 (class Input_objects): Remove system_library_directory_ field.
9860 * object.cc (Input_objects::add_object): Don't set
9861 system_library_directory_.
9862 (input_objects::found_in_system_library_directory): Remove.
9863 * symtab.cc (Symbol_table::write_globals): Remove input_objects
9864 parameter. Change all callers.
9865 (Symbol_table::sized_write_globals): Likewise.
9866 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
9867 Call Object::is_in_system_directory.
9868 * symtab.h (class Symbol_table): Update declarations.
9869
61edd21f
ILT
9870 PR 5990
9871 * descriptors.h (Open_descriptor): Add is_on_stack field.
9872 * descriptors.cc (Descriptors::open): If the descriptor is on the
9873 top of the stack, remove it. Initialize is_on_stack field.
9874 (Descriptors::release): Only add pod to stack if it is not on the
9875 stack already.
9876 (Descriptors::close_some_descriptor): Clear stack_next and
9877 is_on_stack fields.
9878
e29e076a
ILT
9879 PR 7091
9880 * output.cc (Output_section::find_starting_output_address): Rename
9881 from starting_output_address; add PADDR parameter; change return
9882 type.
9883 * output.h (class Output_section): Declare
9884 find_starting_output_address instead of starting_output_address.
9885 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
9886 section symbol for which we can't find a merge section.
9887
0602e05a
ILT
9888 PR 9836
9889 * symtab.cc (Symbol_table::add_from_object): If the visibility is
9890 hidden or internal, force the symbol to be local.
9891 * resolve.cc (Symbol::override_visibility): Define.
9892 (Symbol::override_base): Use override_visibility.
9893 (Symbol_table::resolve): Likewise.
9894 (Symbol::override_base_with_special): Likewise.
9895 (Symbol_table::override_with_special): If the visibility is hidden
9896 or internal, force the symbol to be local.
9897 * symtab.h (class Symbol): Add set_visibility and
9898 override_visibility.
9899 * testsuite/ver_test_1.sh: New file.
9900 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
9901 (check_DATA): Add ver_test_1.syms.
9902 (ver_test_1.syms): New target.
9903 * testsuite/Makefile.in: Rebuild.
9904
401a9a73
CC
99052009-02-25 Cary Coutant <ccoutant@google.com>
9906
9907 * layout.cc (Layout::choose_output_section): Don't rename sections
9908 when using a linker script that has a SECTIONS clause.
9909 * Makefile.in: Regenerate.
9910
9911 * testsuite/Makefile.am (script_test_5.sh): New test case.
9912 * testsuite/Makefile.in: Regenerate.
9913 * testsuite/script_test_5.cc: New file.
9914 * testsuite/script_test_5.sh: New file.
9915 * testsuite/script_test_5.t: New file.
9916
f488e4b0
CC
99172009-02-13 Rafael Avila de Espindola <espindola@google.com>
9918
9919 * archive.cc (Archive::include_member): Update calls to add_symbols.
9920 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
9921 the Layout argument.
9922 * dynobj.h (do_add_symbols): Add the Layout argument.
9923 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
9924 Layout argument.
9925 * object.h (Object::add_symbols): Add the Layout argument.
9926 (Object::do_add_symbols): Add the Layout argument.
9927 (Sized_relobj::do_add_symbols): Add the Layout argument.
9928 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
9929 Unify the two versions.
9930 (Add_plugin_symbols): Remove.
9931 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
9932 (Sized_pluginobj::do_add_symbols): Unify the two versions.
9933 (Add_plugin_symbols): Remove.
9934 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
9935 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
9936 (Add_symbols::run): Make it work with Pulginobj.
9937
89dd1680
ILT
99382009-02-06 Ian Lance Taylor <iant@google.com>
9939
9940 * object.cc (Sized_relobj::do_layout): Make info message start
9941 with lower case letter.
9942
266d0a74
ILT
99432009-02-06 Mikolaj Zalewski <mikolajz@google.com>
9944
602b464e
ILT
9945 * binary.cc: Fix file comment.
9946
266d0a74
ILT
9947 * options.h (enum Incremental_disposition): Define.
9948 (class General_options): Add new options: --incremental,
9949 --incremental_changed, --incremental_unchanged,
9950 --incremental_unknown. Add incremental_disposition_ and
9951 implicit_incremental_ fields.
9952 (General_options::incremental_disposition): New function.
9953 (class Position_dependent_options): Add incremental_disposition
9954 option.
9955 (Position_dependent_options::copy_from_options): Set incremental
9956 dispositions.
9957 * options.cc (General_options::parse_incremental_changed): New
9958 function.
9959 (General_options::parse_incremental_unchanged): New function.
9960 (General_options::parse_incremental_unknown): New function.
9961 (General_options::General_options): Initialize new fields
9962 incremental_disposition_ and implicit_incremental_.
9963 (General_options::finalize): Check for uasge of --incremental-*
9964 without --incremental.
9965
f073bbf7
CD
99662009-02-06 Chris Demetriou <cgd@google.com>
9967
9968 * gold.h (gold_undefined_symbol): Change to take only a Symbol
9969 pointer and to report location as the file name associated with
9970 the symbol.
9971 (gold_undefined_symbol_at_location): New function to replace the
9972 old gold_undefined_symbol functionality.
9973 * target-reloc.h (relocate_section): Update to use
9974 gold_undefined_symbol_at_location.
9975 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
9976 Call gold_undefined_symbol function rather than gold_error.
9977 * errors.h (Errors::undefined_symbol): Take location as a
9978 string, rather than calculating it from a relocation.
9979 * errors.cc (Errors::fatal): Print "fatal error:" before the
9980 formatted message.
9981 (Errors::error, Errors::error_at_location): Print "error: "
9982 before the formatted message.
9983 (Errors::undefined_symbol): Take location as a string, rather
9984 than calculating it from a relocation.
9985 (gold_undefined_symbol_at_location): New function akin to
9986 old gold_undefined_symbol, calculates location from relocation.
9987 (gold_undefined_symbol): Change to take only a Symbol pointer
9988 and to report location as the file name associated with the symbol.
9989 * testsuite/debug_msg.sh: Update for changed error messages.
9990 * testsuite/undef_symbol.sh: Likewise.
9991
8e94a90c
ILT
99922009-02-04 Duncan Sands <baldrick@free.fr>
9993
9994 PR 9812
9995 * reduced_debug_output.h
9996 (Output_reduced_debug_abbrev_section::failed): Use format for
9997 gold_warning.
9998 (Output_reduced_debug_info_section::faild): Likewise.
9999
88a0e15b
ILT
100002009-01-31 Mikolaj Zalewski <mikolajz@google.com>
10001
10002 * script.cc (Lazy_demangler): New class.
10003 (Version_script_info::get_symbol_version_helper): Demangle a
10004 symbol only once.
10005
5efc7cd2
CC
100062009-01-29 Cary Coutant <ccoutant@google.com>
10007
10008 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
10009 to __tls_get_addr.
10010 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10011
e0ebcf42
ILT
100122009-01-28 Ian Lance Taylor <iant@google.com>
10013
5efc7cd2 10014 * version.cc (version_string): Bump to 1.9.
75fe7426 10015
e0ebcf42
ILT
10016 * gold.h: Include <cstring> and <stdint.h>.
10017 * version.cc: Include <cstdio>.
10018 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
10019 warning.
10020 * reduced_debug_output.cc (insert_into_vector): Rename from
10021 Insert_into_vector; change all callers. Use Swap_unaligned to
10022 avoid aliasing issue; remove union since it is unnecessary.
10023
8e2813be 100242009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
10025
10026 * Makefile.am (CCFILES): Add gc.cc.
10027 (HFILES): Add gc.h.
10028 * Makefile.in: Regenerate.
10029 * gold.cc (Gc_runner): New class.
10030 (queue_initial_tasks): Call garbage collection related tasks
10031 when corresponding options are invoked.
10032 (queue_middle_gc_tasks): New function.
10033 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
10034 processed early before laying out sections during garbage collection.
10035 * gold.h (queue_middle_gc_tasks): New function.
10036 (is_prefix_of): Move from "layout.cc".
10037 * i386.cc (Target_i386::gc_process_relocs): New function.
10038 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
10039 * main.cc (main): Create object of class "Garbage_collection".
10040 * object.cc (Relobj::copy_symbols_data): New function.
10041 (Relobj::is_section_name_included): New function.
e1df38aa
NC
10042 (Sized_relobj::do_layout): Allow this function to be called twice
10043 during garbage collection and defer layout of section during the
6d03d481
ST
10044 first call.
10045 * object.h (Relobj::get_symbols_data): New function.
10046 (Relobj::is_section_name_included): New function.
10047 (Relobj::copy_symbols_data): New function.
10048 (Relobj::set_symbols_data): New function.
10049 (Relobj::get_relocs_data): New function.
10050 (Relobj::set_relocs_data): New function.
10051 (Relobj::is_output_section_offset_invalid): New pure virtual function.
10052 (Relobj::gc_process_relocs): New function.
10053 (Relobj::do_gc_process_relocs): New pure virtual function.
10054 (Relobj::sd_): New data member.
10055 (Sized_relobj::is_output_section_offset_invalid): New function.
10056 (Sized_relobj::do_gc_process_relocs): New function.
10057 * options.h (General_options::gc_sections): Modify to not be a no-op.
10058 (General_options::print_gc_sections): New option.
10059 * plugin.cc (Plugin_finish::run): Remove function call to
10060 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
10061 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
10062 * reloc.cc (Read_relocs::run): Add task to process relocs and
10063 determine unreferenced sections when doing garbage collection.
10064 (Gc_process_relocs): New class.
10065 (Sized_relobj::do_gc_process_relocs): New function.
10066 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
10067 sections that are garbage collected.
10068 * reloc.h (Gc_process_relocs): New class.
10069 * sparc.cc (Target_sparc::gc_process_relocs): New function.
10070 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
10071 symbols whose corresponding sections are garbage collected.
10072 (Symbol_table::Symbol_table): Add new parameter for the garbage
10073 collection object.
10074 (Symbol_table::gc_mark_undef_symbols): New function.
10075 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10076 (Symbol_table::gc_mark_dyn_syms): New function.
10077 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
10078 as garbage.
10079 (Symbol_table::add_from_object): Likewise.
10080 (Symbol_table::add_from_relobj): When building shared objects, do not
10081 treat externally visible symbols as garbage.
10082 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
10083 table information for static and relocatable links.
10084 * symtab.h (Symbol_table::set_gc): New function.
10085 (Symbol_table::gc): New function.
10086 (Symbol_table::gc_mark_undef_symbols): New function.
10087 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10088 (Symbol_table::gc_mark_dyn_syms): New function.
10089 (Symbol_table::gc_): New data member.
e1df38aa 10090 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
10091 function.
10092 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
10093 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
10094
3b293544
CF
100952009-01-20 Chris Faylor <me.sourceware@sourceware.org>
10096
10097 * options.h (General_options::gc_sections): Define as a no-op for now.
10098 (General_options::no_keep_memory): Ditto.
10099 (General_options::Bshareable): Define.
10100 * options.cc (General_options::finalize): Honor -Bshareable.
10101
83d22aa8
AS
101022009-01-20 Andreas Schwab <schwab@suse.de>
10103
10104 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
10105 read the value in the contents, since we don't use it. Use the
10106 template endianness when writing.
10107 (Relocate::relocate): Use it for R_PPC_REL16_HA.
10108
cd536b21
AS
101092009-01-19 Andreas Schwab <schwab@suse.de>
10110
10111 * configure.tgt (powerpc64-*): Fix targ_obj.
10112
99e9a495
ILT
101132009-01-15 Ian Lance Taylor <iant@google.com>
10114
10115 * object.cc (Sized_relobj::write_local_symbols): Don't write out
10116 local symbols when stripping all symbols.
10117
bbbfea06
CC
101182009-01-14 Cary Coutant <ccoutant@google.com>
10119
99e9a495 10120 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 10121
0f7c0701
CC
101222009-01-14 Cary Coutant <ccoutant@google.com>
10123
10124 * archive.cc (Archive::get_elf_object_for_member): Remove call
10125 to File_read::claim_for_plugin.
10126 * descriptors.cc (Descriptors::open): Remove reference to
10127 is_claimed.
10128 (Descriptors::claim_for_plugin): Remove.
10129 * descriptors.h (Descriptors::claim_for_plugin): Remove.
10130 (Descriptors::is_claimed): Remove.
10131 (claim_descriptor_for_plugin): Remove.
10132 * fileread.cc (File_read::claim_for_plugin): Remove.
10133 * fileread.h (File_read::claim_for_plugin): Remove.
10134 (File_read::descriptor): Reopen descriptor if necessary.
10135 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
10136 (Plugin_manager::all_symbols_read): Add task parameter. Change
10137 all callers.
10138 (Plugin_manager::get_input_file): New function.
10139 (Plugin_manager::release_input_file): New function.
10140 (Pluginobj::Pluginobj): Add filesize parameter and initialize
10141 corresponding data member.
10142 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
10143 and pass to base constructor. Change all callers.
10144 (get_input_file, release_input_file): New functions.
10145 (make_sized_plugin_object): Add filesize parameter. Change all callers.
10146 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
10147 (Plugin_manager::all_symbols_read): Add task parameter.
10148 (Plugin_manager::get_input_file): New function.
10149 (Plugin_manager::release_input_file): New function.
10150 (Plugin_manager::task_): New data member.
10151 (Pluginobj::Pluginobj): Add filesize parameter.
10152 (Pluginobj::filename): New function.
10153 (Pluginobj::descriptor): New function.
10154 (Pluginobj::filesize): New function.
10155 (Pluginobj::filesize_): New data member.
10156 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
10157 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
10158 File_read::claim_for_plugin; use Object::unlock to unlock the file.
10159
10160 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
10161 with archive libraries.
10162 * testsuite/Makefile.in: Regenerate.
10163 * testsuite/plugin_test.c (struct sym_info): New type.
10164 (get_input_file, release_input_file): New static variables.
10165 (onload): Capture new transfer vector entries.
10166 (claim_file_hook): Stop reading at end of file according to filesize.
10167 Factor out parsing of readelf output into separate function.
10168 (all_symbols_read_hook): Exercise get_input_file and release_input_file
10169 APIs and get the source file name from the symbol table. Convert
10170 source file name to corresponding object file name. Print info
10171 message when adding new input files.
10172 (parse_readelf_line): New function.
10173 * testsuite/plugin_test_1.sh: Add checks for new info messages.
10174 * testsuite/plugin_test_2.sh: Likewise.
10175 * testsuite/plugin_test_3.sh: Likewise.
10176 * testsuite/plugin_test_4.sh: New test case.
10177
62a6d109
ILT
101782009-01-07 Ian Lance Taylor <iant@google.com>
10179
10180 * version.cc (version_string): Bump to 1.8.
10181
483620e8
CC
101822008-12-23 Cary Coutant <ccoutant@google.com>
10183
10184 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
10185 * plugin.cc (Plugin_manager::finish): Rename as
10186 layout_deferred_objects. Move cleanup to separate function.
10187 (Plugin_manager::cleanup): New function.
10188 (Plugin_finish::run): Call layout_deferred_objects and cleanup
10189 separately.
10190 * plugin.h (Plugin_manager::finish): Rename as
10191 layout_deferred_objects.
10192 (Plugin_manager::cleanup): New function.
10193 (Plugin_manager::cleanup_done): New field.
10194
d66a9eb3
CC
101952008-12-23 Cary Coutant <ccoutant@google.com>
10196
10197 * plugin.cc (is_visible_from_outside): New function.
10198 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
10199 so we don't return "IR only" status for exported symbols or -r links.
10200
10201 * testsuite/Makefile.am (plugin_test_3): New test case.
10202 * testsuite/Makefile.in: Regenerate.
10203 * testsuite/plugin_test_3.sh: New file.
10204
5995b570
CC
102052008-12-22 Cary Coutant <ccoutant@google.com>
10206
10207 * object.cc (Sized_relobj::layout_section): New function.
10208 (Sized_relobj::do_layout): Defer layout of input sections until after
10209 plugin has provided replacement files.
10210 (Sized_relobj::do_layout_deferred_sections): New function.
10211 * object.h (Relobj::set_section_offset): Remove virtual keyword.
10212 (Relobj::layout_deferred_sections): New function.
10213 (Relobj::do_layout_deferred_sections): New function.
10214 (Sized_relobj::do_layout_deferred_sections): New function.
10215 (Sized_relobj::layout_section): New function.
10216 (Sized_relobj::Deferred_layout): New structure.
10217 (Sized_relobj::deferred_layout_): New field.
10218 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
10219 Change all callers. Layout deferred sections.
10220 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
10221 references.
10222 (Plugin_hook::run): Move code from do_plugin_hook inline.
10223 (Plugin_hook::do_plugin_hook): Remove.
10224 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
10225 (Plugin_manager::finish): Renamed, was cleanup.
10226 (Plugin_manager::should_defer_layout): New function.
10227 (Plugin_manager::add_deferred_layout_object): New function.
10228 (Plugin_manager::Deferred_layout_list): New type.
10229 (Plugin_manager::deferred_layout_objects_): New field.
10230 (Plugin_hook::do_plugin_hook): Remove.
10231
ee769c88
ILT
102322008-12-17 Ian Lance Taylor <iant@google.com>
10233
10234 * options.h (class General_options): Add --no case for
10235 --export-dynamic.
10236
abc8dcba
CC
102372008-12-16 Cary Coutant <ccoutant@google.com>
10238
10239 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
10240 vector.
10241 (Plugin_manager::claim_file): Create plugin object even if
10242 plugin did not call the add_symbols callback.
10243 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
10244 asking for more symbols than were added.
10245 * testsuite/Makefile.am (plugin_test_1): Add test case with
10246 no global symbols.
10247 (empty.syms): New target.
10248 * testsuite/Makefile.in: Regenerate.
10249 * testsuite/plugin_test.c (claim_file_hook): Add new debug
10250 message. Don't call add_symbols if no globals.
10251 (all_symbols_read_hook): Don't provide replacement for empty
10252 claimed file.
10253
b0074644
ILT
102542008-12-12 Ian Lance Taylor <iant@google.com>
10255
68943102
ILT
10256 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
10257 r_type == 0 for a local symbol with r_sym == 0.
10258 (scan_relocatable_relocs): Pass r_sym to
10259 local_non_section_strategy.
10260 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
10261 r_sym parameter.
10262
b0074644
ILT
10263 * configure.ac: Update test for TLS descriptors: they are
10264 supported as of glibc 2.9.
10265 * configure: Rebuild.
10266
c2508178
ILT
102672008-12-11 Ian Lance Taylor <iant@google.com>
10268
10269 PR 7091
10270 * target-reloc.h (Default_scan_relocatable_relocs): For each
10271 function, map r_type == 0 to RELOC_DISCARD.
10272
2756a258
CC
102732008-12-10 Cary Coutant <ccoutant@google.com>
10274
10275 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
10276 object to override a kept COMDAT group from a plugin object.
10277
bb6f53d3
ILT
102782008-12-09 Ian Lance Taylor <iant@google.com>
10279
fbc558e1
ILT
10280 PR 7088
10281 * yyscript.y (file_cmd): Handle INPUT.
10282
bb6f53d3
ILT
10283 * testsuite/initpri1.c: Change all declarations to be full
10284 prototypes by adding void, to avoid compiler warnings.
10285
4674ecfc
CC
102862008-12-05 Rafael Avila de Espindola <espindola@google.com>
10287
10288 * options.cc (General_options::parse_plugin_opt): New.
10289 (General_options::add_plugin): The argument now is just the filename.
10290 (General_options::add_plugin_option): New.
10291 * options.h (plugin_opt): New.
10292 (add_plugin): Change argument name.
10293 (add_plugin_option): New.
10294 * plugin.cc (Plugin::load): Don't parse the plugin option.
10295 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
10296 (Plugin::add_option): New.
10297 (Plugin::args_): Change type.
10298 (Plugin::filename_): New.
10299 (Plugin_manager::add_plugin_option): New.
10300 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
10301 * testsuite/Makefile.in: Regenerate.
10302
fd06b4aa
CC
103032008-12-05 Cary Coutant <ccoutant@google.com>
10304
10305 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
10306 Handle --strip-lto-sections option.
10307 * options.h (strip_lto_sections): New option.
10308
6c52134c
CC
103092008-12-01 Cary Coutant <ccoutant@google.com>
10310
10311 * plugin.cc (ld_plugin_message): Change format parameter to const.
10312 Fix mismatch between new[] and delete.
10313
a45248e0
CC
103142008-11-14 Cary Coutant <ccoutant@google.com>
10315
10316 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
10317 instead of -1U.
10318
c82fbeee
CS
103192008-11-05 Craig Silverstein <csilvers@google.com>
10320
10321 * options.cc (General_options::parse_dynamic_list): New function.
10322 * options.h (General_options): New flags dynamic_list,
10323 dynamic_list_data, dynamic_list_cpp_new, and
10324 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
10325 (General_options::in_dynamic_list): New function.
10326 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
10327 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
10328 (Lex::can_continue_name): Likewise.
10329 (yylex): Likewise.
10330 (read_script_file): New parameter script_options.
10331 (read_dynamic_list): New function.
10332 (Script_options::define_dynamic_list): New function.
10333 (dynamic_list_keyword_parsecodes): New variable.
10334 (dynamic_list_keywords): New variable.
10335 * script.h (Script_options::define_dynamic_list): New function
10336 prototype.
10337 (read_dynamic_list): New function prototype.
10338 * symtab.cc (strprefix): New macro.
10339 (Symbol::should_add_dynsym_entry): Support dynamic_list,
10340 dynamic_list_data, dynamic_list_cpp_new, and
10341 dynamic_list_cpp_typeinfo.
10342 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
10343 (dynamic_list_expr): New rule.
10344 (dynamic_list_nodes): Likewise.
10345 (dynamic_list_node): Likewise.
10346 * testsuite/Makefile.am (dynamic_list): New test.
10347 * testsuite/Makefile.in: Regenerated.
10348 * testsuite/dynamic_list.t: New file.
10349 * testsuite/dynamic_list.sh: New file.
10350
e0bb29a5
CS
103512008-11-05 Craig Silverstein <csilvers@google.com>
10352
10353 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
10354 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
10355 (t11_last): Likewise.
10356 * testsuite/ver_test_6.c (main): Likewise.
10357
4e1e25e0
CC
103582008-10-07 Cary Coutant <ccoutant@google.com>
10359
10360 * options.c (General_options::finalize): Add check for -static and
10361 -shared.
10362 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
10363 is not empty.
10364
92f03fcb
CC
103652008-10-02 Cary Coutant <ccoutant@google.com>
10366
10367 * plugin.cc (make_sized_plugin_object): Fix conditional
10368 compilation to work when not all targets are enabled.
10369
fbd8a257
CC
103702008-09-29 Cary Coutant <ccoutant@google.com>
10371
10372 * archive.cc (Archive::get_file_and_offset): Use filename instead
10373 of name to get library path.
10374 (Archive::include_member): Unlock external member of a thin archive.
10375
10376 * testsuite/Makefile.am (TEST_AR): New variable.
10377 (thin_archive_test_1): New test.
10378 (thin_archive_test_2): New test.
81636b3f
CC
10379 * testsuite/Makefile.in: Regenerate.
10380 * testsuite/thin_archive_main.cc: New file.
10381 * testsuite/thin_archive_test_1.cc: New file.
10382 * testsuite/thin_archive_test_2.cc: New file.
10383 * testsuite/thin_archive_test_3.cc: New file.
10384 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 10385
eff45813
CC
103862008-09-29 Cary Coutant <ccoutant@google.com>
10387
10388 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
10389 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
10390 instead of -1U.
10391 (Sized_relobj::do_finalize_local_symbols): Likewise.
10392 (Sized_relobj::map_to_kept_section): Likewise.
10393 * object.h (Sized_relobj::invalid_address): New constant.
10394 (Sized_relobj::do_output_section_offset): Check for invalid_address
10395 and return -1ULL.
10396 * output.cc (Output_reloc::local_section_offset): Use constant
10397 invalid_address instead of -1U.
10398 (Output_reloc::get_address): Likewise.
10399 (Output_section::output_address): Change -1U to -1ULL.
10400 * output.h (Output_reloc::invalid_address): New constant.
10401 * reloc.cc (Sized_relobj::write_sections): Use constant
10402 invalid_address instead of -1U.
10403 (Sized_relobj::relocate_sections): Likewise.
10404 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
10405 values for merge sections.
10406 * target-reloc.h (relocate_for_relocatable): Use constant
10407 invalid_address instead of -1U.
10408
89fc3421
CC
104092008-09-19 Cary Coutant <ccoutant@google.com>
10410
10411 Add plugin functionality for link-time optimization (LTO).
10412 * configure.ac (plugins): Add --enable-plugins option.
10413 * configure: Regenerate.
10414 * config.in: Regenerate.
10415 * Makefile.am (LIBDL): New variable.
10416 (CCFILES): Add plugin.cc.
10417 (HFILES): Add plugin.h.
10418 (ldadd_var): Add LIBDL.
10419 * Makefile.in: Regenerate.
10420
10421 * archive.cc: Include "plugin.h".
10422 (Archive::setup): Don't preread archive symbols when using a plugin.
10423 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
10424 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
10425 files.
10426 (Archive::include_member): Add symbols from plugin objects.
10427 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
10428 * descriptors.cc (Descriptors::open): Check for file descriptors
10429 abandoned by plugins.
10430 (Descriptors::claim_for_plugin): New function.
10431 * descriptors.h (Descriptors::claim_for_plugin): New function.
10432 (Open_descriptor::is_claimed): New field.
10433 (claim_descriptor_for_plugin): New function.
10434 * fileread.cc (File_read::claim_for_plugin): New function.
10435 * fileread.h (File_read::claim_for_plugin): New function.
10436 (File_read::descriptor): New function.
10437 * gold.cc: Include "plugin.h".
10438 (queue_initial_tasks): Add task to call plugin hooks for generating
10439 new object files.
10440 * main.cc: Include "plugin.h".
10441 (main): Load plugin libraries.
10442 * object.h (Pluginobj): Declare.
10443 (Object::pluginobj): New function.
10444 (Object::do_pluginobj): New function.
10445 (Object::set_target): New function.
10446 * options.cc: Include "plugin.h".
10447 (General_options::parse_plugin): New function.
10448 (General_options::General_options): Initialize plugins_ field.
10449 (General_options::add_plugin): New function.
10450 * options.h (Plugin_manager): Declare.
10451 (General_options): Add --plugin option.
10452 (General_options::has_plugins): New function.
10453 (General_options::plugins): New function.
10454 (General_options::add_plugin): New function.
10455 (General_options::plugins_): New field.
10456 * plugin.cc: New file.
10457 * plugin.h: New file.
10458 * readsyms.cc: Include "plugin.h".
10459 (Read_symbols::do_read_symbols): Check for archive before checking
10460 for ELF file. Call plugin hooks to claim files.
10461 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
10462 from a real object file; force override when processing replacement
10463 files.
10464 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
10465 (Symbol::init_base_object): Likewise.
10466 (Symbol::init_base_output_data): Likewise.
10467 (Symbol::init_base_output_segment): Likewise.
10468 (Symbol::init_base_constant): Likewise.
10469 (Symbol::init_base_undefined): Likewise.
10470 (Symbol::output_section): Assert that object is not a plugin.
10471 (Symbol_table::add_from_pluginobj): New function.
10472 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
10473 undefined.
10474 (Symbol_table::sized_write_globals): Likewise.
10475 (Symbol_table::add_from_pluginobj): Instantiate template.
10476 * symtab.h (Sized_pluginobj): Declare.
10477 (Symbol::in_real_elf): New function.
10478 (Symbol::set_in_real_elf): New function.
10479 (Symbol::in_real_elf_): New field.
10480 (Symbol_table::add_from_pluginobj): New function.
10481
10482 * testsuite/Makefile.am (AM_CFLAGS): New variable.
10483 (LIBDL): New variable.
10484 (LDADD): Add LIBDL.
10485 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
10486 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
10487 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
10488 (MOSTLYCLEANFILES): Likewise.
10489 * testsuite/Makefile.in: Regenerate.
10490 * testsuite/plugin_test.c: New file.
10491 * testsuite/plugin_test_1.sh: New file.
10492 * testsuite/plugin_test_2.sh: New file.
10493
de31bda5
ILT
104942008-09-16 Ian Lance Taylor <iant@google.com>
10495
9c2d0ef9
ILT
10496 * target-reloc.h (relocate_section): Check whether a symbol is
10497 defined by the ABI before reporting an undefined symbol error.
10498 * target.h (Target::is_defined_by_abi): Make parameter const.
10499 (Target::do_is_defined_by_abi): Likewise.
10500 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
10501 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
10502 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
10503 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
10504 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
10505 * testsuite/Makefile.in: Rebuild.
10506
de31bda5
ILT
10507 * fileread.cc (make_view): Add casts to avoid warning.
10508
9fa33bee
AO
105092008-09-16 Alexandre Oliva <aoliva@redhat.com>
10510
10511 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
10512 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
10513
183fd0e3
AO
105142008-09-16 Alexandre Oliva <aoliva@redhat.com>
10515
10516 * options.h (General_options::output_is_executable): New.
10517 (General_options::output_is_pie): New.
10518 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
10519 for shared libraries.
10520 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
10521
7be8330a
CD
105222008-09-11 Chris Demetriou <cgd@google.com>
10523
10524 * options.h (origin): New -z option.
10525 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
10526 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
10527 in DT_FLAGS_1.
10528
a9caad02
CC
105292008-09-05 Cary Coutant <ccoutant@google.com>
10530
10531 * fileread.cc (File_read::make_view): Add check for attempt to map
10532 beyond end of file.
10533
ae6dce4d
CC
105342008-09-05 Cary Coutant <ccoutant@google.com>
10535
10536 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
10537 explicit instantiations.
10538
d7ab2a47
KVH
105392008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
10540
10541 PR gold/6858
10542 * options.cc (General_options::finalize): Allow undefined symbols
10543 in shlibs if linking -shared.
10544
10545 PR gold/6859
10546 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
10547 symbols as not needing a dynsym entry.
10548
1e52a9c1
CS
105492008-08-20 Craig Silverstein <csilvers@google.com>
10550
10551 * fileread.cc (File_read::open): Do not lock the file unless it
10552 was successfully opened.
10553
d85c80a3
CC
105542008-08-14 Cary Coutant <ccoutant@google.com>
10555
10556 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
10557 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
10558 * testsuite/tls_test.cc (struct int128): 128-bit struct
10559 for testing TLS relocs with non-zero addend.
10560 (v12): New TLS variable.
10561 (t12): New test.
10562 (t_last): Add check for v12.
10563 * testsuite/tls_test.h (t12): New function.
10564 * testsuite/tls_test_main.cc (thread_routine): Call new test.
10565
2d924fd9
ILT
105662008-08-13 Ian Lance Taylor <iant@google.com>
10567
10568 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
10569 set tls_segment_ or relro_segment_.
10570 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
10571 when appropriate.
10572 * output.h (Output_section::clear_is_relro): New function.
10573 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
10574 sections specially even when output_data_ is empty.
10575 (Output_segment::maximum_alignment): When first section is relro,
10576 only force alignment for PT_LOAD segments.
10577 * script.cc (script_data_segment_align): New function.
10578 (script_data_segment_relro_end): New function.
10579 * script-c.h (script_data_segment_align): Declare.
10580 (script_data_segment_relro_end): Declare.
10581 * script-sections.h (class Script_sections): Declare
10582 data_segment_align and data_segment_relro_end. Add fields
10583 segment_align_index_ and saw_relro_end_.
10584 * script-sections.cc (class Sections_element): Add set_is_relro
10585 virtual function. Add new bool* parameter to place_orphan_here.
10586 Add get_output_section virtual function.
10587 (class Output_section_definition): Add set_is_relro. Add new
10588 bool* parameter to place_orphan_here. Add get_output_section.
10589 Add is_relro_ field.
10590 (Output_section_definition::Output_section_definition): Initialize
10591 evaluated_address_, evaluated_load_address, evaluated_addralign_,
10592 and is_relro_ fields.
10593 (Output_section_definition::place_orphan_here): Add is_relro
10594 parameter.
10595 (Output_section_definition::set_section_addresses): Set relro for
10596 output section.
10597 (Output_section_definition::alternate_constraint): Likewise.
10598 (class Orphan_output_section): Add new bool* parameter to
10599 place_orphan_here. Add get_output_section.
10600 (Orphan_output_section::place_orphan_here): Add is_relro
10601 parameter.
10602 (Script_sections::Script_sections): Initialize
10603 data_segment_align_index_ and saw_relro_end_.
10604 (Script_sections::data_segment_align): New function.
10605 (Script_sections::data_segment_relro_end): New function.
10606 (Script_sections::place_orphan): Set or clear is_relro.
10607 (Script_sections::set_section_addresses): Force alignment of first
10608 TLS section.
10609 * yyscript.y (exp): Call script_data_segment_align and
10610 script_data_segment_relro_end.
10611 * testsuite/relro_script_test.t: New file.
10612 * testsuite/relro_test.cc (using_script): Declare.
10613 (t1, t2): Test using_script.
10614 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
10615 (relro_script_test_SOURCES): Define.
10616 (relro_script_test_DEPENDENCIES): Define.
10617 (relro_script_test_LDFLAGS): Define.
10618 (relro_script_test_LDADD): Define.
10619 (relro_script_test.so): New target.
10620 * testsuite/Makefile.in: Rebuild.
10621
f827c9a9
CC
106222008-08-06 Cary Coutant <ccoutant@google.com>
10623
10624 * archive.cc (Archive::total_archives, Archive::total_members)
10625 (Archive::total_members_loaded): New variables.
10626 (Archive::setup): Add parameter. Add option to preread
10627 archive symbols.
10628 (Archive::read_armap): Add counter.
10629 (Archive::get_file_and_offset): New function.
10630 (Archive::get_elf_object_for_member): New function.
10631 (Archive::read_all_symbols): New function.
10632 (Archive::read_symbols): New function.
10633 (Archive::add_symbols): Add counters.
10634 (Archive::include_all_members): Use armap to find members if it's
10635 already built.
10636 (Archive::include_member): Skip reading symbols if already read.
10637 Factored code into Archive::get_file_and_offset and
10638 Archive::get_elf_object_for_member. Changed call to
10639 Mapfile::report_include_archive_member.
10640 (Archive::print_stats): New function.
10641 * archive.h: Declare Object and Read_symbols_data classes.
10642 (Archive::Archive): Add initializers for new members.
10643 (Archive::setup): Add parameter.
10644 (Archive::print_stats): New function.
10645 (Archive::total_archives, Archive::total_members)
10646 (Archive::total_members_loaded): New variables.
10647 (Archive::get_file_and_offset): New function.
10648 (Archive::get_elf_object_for_member): New function.
10649 (Archive::read_all_symbols): New function.
10650 (Archive::read_symbols): New function.
10651 (Archive::Archive_member): New class.
10652 (Archive::members_): New member.
10653 (Archive::num_members_): New member.
10654 * main.cc: Include archive.h.
10655 (main): Call Archive::print_stats.
10656 * mapfile.cc (Mapfile::report_include_archive_member): Delete
10657 archive parameter; member_name is now the fully-decorated name.
10658 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
10659 * options.h: (General_options): Add --preread-archive-symbols option.
10660 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
10661 Archive::setup.
10662
de4c45bd
ILT
106632008-08-04 Ian Lance Taylor <iant@google.com>
10664
10665 * symtab.h (Symbol::use_plt_offset): New function.
10666 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
10667 * powerpc.cc (Relocate::relocate): Likewise.
10668 * sparc.cc (Relocate::relocate): Likewise.
10669 * x86_64.cc (Relocate::relocate): Likewise.
10670 * testsuite/weak_plt.sh: New test.
10671 * testsuite/weak_plt_main.cc: New test.
10672 * testsuite/weak_plt_shared.cc: New test.
10673 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
10674 (check_PROGRAMS): Add weak_plt.
10675 (check_DATA): Add weak_plt_shared.so.
10676 (weak_plt_main_pic.o, weak_plt): New targets.
10677 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
10678 * testsuite/Makefile.in: Rebuild.
10679
10680 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
10681 gcctestdir/ld.
10682 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
10683 * testsuite/Makefile.in: Rebuild.
10684
323ee3f4
AM
106852008-08-04 Alan Modra <amodra@bigpond.net.au>
10686
10687 * Makefile.am (POTFILES.in): Set LC_ALL=C.
10688 * Makefile.in: Regenerate.
10689 * po/POTFILES.in: Regenerate.
10690
7c07ecec
ILT
106912008-07-29 Ian Lance Taylor <iant@google.com>
10692
10693 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
10694 symbols before other symbols.
10695 * testsuite/script_test_2.cc (test_addr): Declare.
10696 (test_addr_alias): Declare.
10697 (main): Check that test_addr and test_addr_alias have the right
cd536b21 10698 values.
7c07ecec
ILT
10699 * testsuite/script_test_2.t: Define test_addr_alias and
10700 test_addr.
10701
5778530e
ILT
107022008-07-24 Ian Lance Taylor <iant@google.com>
10703
2a00e4fb
ILT
10704 PR 5990
10705 * descriptors.cc: New file.
10706 * descriptors.h: New file.
10707 * gold-threads.h (class Hold_optional_lock): New class.
10708 * fileread.cc: Include "descriptors.h".
10709 (File_read::~File_read): Release descriptor rather than closing
10710 it.
10711 (File_read::open) [file]: Call open_descriptor rather than open.
10712 Set is_descriptor_opened_.
10713 (File_read::open) [memory]: Assert that descriptor is not open.
10714 (File_read::reopen_descriptor): New function.
10715 (File_read::release): Release descriptor.
10716 (File_read::do_read): Make non-const. Reopen descriptor.
10717 (File_read::read): Make non-const.
10718 (File_read::make_view): Reopen descriptor.
10719 (File_read::do_readv): Likewise.
10720 * fileread.h (class File_read): Add is_descriptor_opened_ field.
10721 Update declarations.
10722 * layout.cc: Include "descriptors.h".
10723 (Layout::create_build_id): Use open_descriptor rather than open.
10724 * output.cc: Include "descriptors.h".
10725 (Output_file::open): Use open_descriptor rather than open.
10726 * archive.cc (Archive::const_iterator): Change Archive to be
10727 non-const.
10728 (Archive::begin, Archive::end): Make non-const.
10729 (Archive::count_members): Likewise.
10730 * archive.h (class Archive): Update declarations.
10731 * object.h (Object::read): Make non-const.
10732 * Makefile.am (CCFILES): Add descriptors.cc.
10733 (HFILES): Add descriptors.h.
10734 * Makefile.in: Rebuild.
10735
801647d1
ILT
10736 PR 6716
10737 * gold.h: Always include <clocale>. Add Solaris workarounds
10738 following code in binutils/sysdep.h.
10739
5edd166e
ILT
10740 PR 6048
10741 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
10742 this->eh_frame_hdr_ is NULL before using it.
10743
c89ad728
ILT
10744 * dynobj.cc (Versions::Versions): Update comment.
10745
aa86f06b
ILT
10746 * dynobj.cc (Versions::Versions): If there is an soname, use it as
10747 the base version name.
10748
5778530e
ILT
10749 * stringpool.cc (Stringpool_template::add_with_length): Set key to
10750 array size plus one.
10751 (Stringpool_template::set_string_offsets): Subtract one from key
10752 before using it as an array index.
10753 (Stringpool_template::get_offset_with_length): Likewise.
10754 (Stringpool_template::write_to_buffer): Likewise.
10755 * stringpool.h (Stringpool_template::get_offset_from_key):
10756 Likewise.
10757
057ead22
ILT
107582008-07-23 Ian Lance Taylor <iant@google.com>
10759
7f649c59
ILT
10760 PR 6658
10761 * object.h (Merged_symbol_value::value): Do our best to handle a
10762 negative addend.
10763
057ead22
ILT
10764 PR 6647
10765 * script.cc (Version_script_info::get_versions): Don't add empty
10766 version tag to return value.
10767 (Version_script_info::get_symbol_version_helper): Change return
10768 type to bool. Add pversion parameter. Change all callers.
10769 (script_register_vers_node): Don't require a non-NULL tag.
10770 * script.h (class Version_script_info): Update declarations.
10771 (Version_script_info::get_symbol_version): Change return type to
10772 bool. Add version parameter. Change all callers.
10773 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
10774 handling. Handle an empty version from a version script.
10775 (Symbol_table::define_special_symbol): Likewise.
10776 * testsuite/ver_test_10.script: New file.
10777 * testsuite/ver_test_10.sh: New file.
10778 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
10779 (check_DATA): Add ver_test_10.syms.
10780 (ver_test_10.syms, ver_test_10.so): New target.
10781 * testsuite/Makefile.in: Rebuild.
10782
58e54ac2
CD
107832008-07-23 Simon Baldwin <simonb@google.com>
10784
10785 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
10786 to zero for undefined symbols from dynamic libraries.
10787
95d14cd3
ILT
107882008-07-23 Ian Lance Taylor <iant@google.com>
10789
10790 * symtab.cc (Symbol_table::resolve): Remove version parameter.
10791 Change all callers.
10792 * symtab.h (class Symbol_table): Update declaration.
10793 * testsuite/ver_test_9.cc: New file.
10794 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
10795 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
10796 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
10797 (ver_test_9.so, ver_test_9.o): New targets.
10798 * testsuite/Makefile.in: Rebuild.
10799
92de84a6
ILT
108002008-07-22 Ian Lance Taylor <iant@google.com>
10801
34810851
ILT
10802 * options.h (class General_options): Define --check-sections.
10803 * layout.cc (Layout::set_segment_offsets): Handle
10804 --check-sections.
10805
af6156ef
ILT
10806 * options.h (class General_options): Define -n/--nmagic and
10807 -N/--omagic.
10808 * options.cc (General_options::finalize): For -n/--nmagic or
10809 -N/--omagic, set -static.
10810 * layout.cc (Layout::attach_allocated_section_to_segment): If
10811 -N/--omagic, don't put read-only and read-write sections in
10812 different segments.
10813 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
10814 finding a read-only segment.
10815 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
10816 don't set the minimum segment alignment to the common page size,
10817 and don't set the file offset to the address modulo the page size.
10818 * script-sections.cc (Script_sections::create_segments): If
10819 -n/--omagic, don't put read-only and read-write sections in
10820 different segments.
10821
92de84a6
ILT
10822 * cref.cc: New file.
10823 * cref.h: New file.
10824 * options.h (class General_options): Add --print-symbol-counts.
10825 * main.cc (main): Issue defined symbol report if requested.
10826 * archive.cc (Archive::interpret_header): Make into a const member
10827 function.
10828 (Archive::add_symbols): Call Input_objects::archive_start and
10829 archive_stop.
10830 (Archive::const_iterator): Define new class.
10831 (Archive::begin, Archive::end): New functions.
10832 (Archive::include_all_members): Rewrite to use iterator.
10833 (Archive::count_members): New function.
10834 * archive.h (class Archive): Update declarations.
10835 (Archive::filename): New function.
10836 * object.cc: Include "cref.h".
10837 (Sized_relobj::Sized_relobj): Initialize defined_count_.
10838 (Sized_relobj::do_get_global_symbol_counts): New function.
10839 (Input_objects::add_object): Add object to cross-referencer.
10840 (Input_objects::archive_start): New function.
10841 (Input_objects::archive_stop): New function.
10842 (Input_objects::print_symbol_counts): New function.
10843 * object.h: Declare Cref and Archive.
10844 (Object::get_global_symbol_counts): New function.
10845 (Object::do_get_global_symbol_counts): New pure virtual function.
10846 (class Sized_relobj): Add defined_count_ field. Update
10847 declarations.
10848 (class Input_objects): Add cref_ field. Update constructor.
10849 Update declarations.
10850 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
10851 defined_count_.
10852 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
10853 symbol counts.
10854 (Sized_dynobj::do_get_global_symbol_counts): New function.
10855 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
10856 defined_count_. Update declarations. Define Symbols typedef.
10857 * symtab.cc (Symbol_table::add_from_relobj): Add defined
10858 parameter. Change all callers.
10859 (Symbol_table::add_from_dynobj): Add sympointers and defined
10860 parameters. Change all callers.
10861 * symtab.h (class Symbol_table): Update declarations.
10862 * Makefile.am (CCFILES): Add cref.cc.
10863 (HFILES): Add cref.h.
10864 * Makefile.in: Rebuild.
10865
3f7c5e1d
CD
108662008-07-22 Simon Baldwin <simonb@google.com>
10867
10868 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
10869 to zero when writing undefined symbols.
10870
e0b64032
ILT
108712008-07-22 Ian Lance Taylor <iant@google.com>
10872
10873 * output.cc (Output_section::add_input_section): Don't try to
10874 merge empty merge sections.
10875
096b02cf
CS
108762008-07-21 Craig Silverstein <csilvers@google.com>
10877
10878 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
10879 Include symbol version in error message.
cd536b21 10880
1d1f116d
CD
108812008-07-20 Chris Demetriou <cgd@google.com>
10882
cd536b21 10883 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
10884 (RANDOM_SEED_CFLAGS): New substituted variable.
10885 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
10886 * configure: Rebuild.
10887 * Makefile.in: Likewise.
10888 * testsuite/Makefile.in: Likewise.
10889
a18f591e
ILT
108902008-07-18 Ian Lance Taylor <iant@google.com>
10891
10892 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
10893 where we see NAME/NULL and NAME/VERSION as separate symbols.
10894 * testsuite/ver_test_main.cc (main): Call t4.
10895 (t4, t4_2a): Define.
10896 * testsuite/ver_test_2.cc (t4_2): Define.
10897 * testsuite/ver_test_2.script: Put t4_2a in VER2.
10898 * testsuite/ver_test_4.cc (t4_2a): Define.
10899 * testsuite/ver_test_4.script: Put t4_2a in VER2.
10900 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
10901
c6e3f6ed
ILT
109022008-07-17 Ian Lance Taylor <iant@google.com>
10903
10904 * dynobj.cc (Versions::add_def): If we give an error about a
10905 missing version, go ahead and create the version anyhow.
10906
ef9beddf
ILT
109072008-07-10 Ian Lance Taylor <iant@google.com>
10908
10909 Handle output sections with more than 0x7fffffff bytes.
10910 * object.h (class Relobj): Change map_to_output_ to
10911 output_sections_, and just keep a section pointer. Change all
10912 uses. Move comdat group support to Sized_relobj.
10913 (Relobj::is_section_specially_mapped): Remove.
10914 (Relobj::output_section): Remove poff parameter. Change all
10915 callers.
10916 (Relobj::output_section_offset): New function.
10917 (Relobj::set_section_offset): Rewrite.
10918 (Relobj::map_to_output): Remove.
10919 (Relobj::output_sections): New function.
10920 (Relobj::do_output_section_offset): New pure virtual function.
10921 (Relobj::do_set_section_offset): Likewise.
10922 (class Sized_relobj): Add section_offsets_ field. Add comdat
10923 group support from Relobj. Update declarations.
10924 (Sized_relobj::get_output_section_offset): New function.
10925 (Sized_relobj::do_output_section_offset): New function.
10926 (Sized_relobj::do_set_section_offset): New function.
10927 * object.cc (Relobj::output_section_address): Remove.
10928 (Sized_relobj::Sized_relobj): Initialize new fields.
10929 (Sized_relobj::include_section_group): Cast find_kept_object to
10930 Sized_relobj.
10931 (Sized_relobj::include_linkonce_section): Likewise.
10932 (Sized_relobj::do_layout): Use separate arrays for output section
10933 and output offset.
10934 (Sized_relobj::do_count_local_symbols): Change map_to_output to
10935 output_sections.
10936 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
10937 output_sections and section_offsets.
10938 (Sized_relobj::write_local_symbols): Likewise.
10939 (map_to_kept_section): Compute output address directly.
10940 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
10941 output_sections and section_offsets.
10942 (Sized_relobj::write_sections): Likewise.
10943 (Sized_relobj::relocate_sections): Likewise.
10944 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
10945 * output.h (class Output_reloc): Update declarations. Change
10946 u2_.relobj to Sized_relobj*.
10947 (class Output_data_reloc): Change add functions to use
10948 Sized_relobj*.
10949 * output.cc (Output_reloc::Output_reloc): Change relobj to
10950 Sized_relobj*.
10951 (Output_reloc::local_section_offset): Change return type to
10952 Elf_Addr. Use get_output_section_offset.
10953 (Output_reloc::get_address): Likewise.
10954 (Output_section::is_input_address_mapped): Don't call
10955 is_section_specially_mapped.
10956 (Output_section::output_offset): Likewise.
10957 (Output_section::output_address): Likewise.
10958 (Output_section::starting_output_address): Likewise.
10959 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
10960 parameter to Sized_relobj*.
10961 (Copy_relocs::need_copy_reloc): Likewise.
10962 (Copy_relocs::save): Likewise.
10963 * copy-relocs.h (class Copy_relocs): Update declarations.
10964 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
10965 Sized_relobj*. Change relobj_ field to Sized_relobj*.
10966 * target-reloc.h (relocate_for_relocatable): Change
10967 offset_in_output_section type to Elf_Addr. Change code that uses
10968 it as well.
10969 * layout.cc (Layout::layout): Always set *off.
10970 * mapfile.cc (Mapfile::print_input_section): Use
10971 output_section_offset.
10972 * i386.cc (Target_i386::copy_reloc): Change object parameter to
10973 Sized_relobj*.
10974 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
10975 * sparc.cc (Target_sparc::copy_reloc): Likewise.
10976 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
10977
5cb66f97
ILT
109782008-07-03 Ian Lance Taylor <iant@google.com>
10979
10980 * layout.cc (Layout::include_section): Do not discard unrecognized
10981 SHT_STRTAB sections.
10982
afe47622
CS
109832008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
10984
10985 * script.cc (Lex::can_continue_name): Make '?' allowable in
10986 version-script names.
10987 * testsuite/version_script.map: Change glob pattern to use '?'
10988
5adf9721
ILT
109892008-06-30 Manish Singh <yosh@gimp.org>
10990
10991 PR 6585
10992 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
10993 Correct typo.
10994
e6fde208
ILT
109952008-06-30 Ian Lance Taylor <iant@google.com>
10996
10997 PR 6660
10998 PR 6682
10999 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
11000 versions]: Don't try to read the value in the contents, since we
11001 don't use it. Use the template endianness when writing.
11002
3f2e6a2d
CC
110032008-06-25 Cary Coutant <ccoutant@google.com>
11004
11005 * fileread.cc (File_read::make_view): Assert on zero-length view.
11006 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
11007 symbol table when there are no symbols to read.
11008
c43d3a48
CS
110092008-06-23 Craig Silverstein <csilvers@google.com>
11010
11011 * version.cc (version_string): Bump to 1.7
11012
5f494ea0
CS
110132008-06-18 Craig Silverstein <csilvers@google.com>
11014
11015 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
11016 constant 0xFFFF to type Valtype.
11017 (Powerpc_relocate_functions::rel16_ha): Likewise.
11018
c42e122e
ILT
110192008-06-17 Ian Lance Taylor <iant@google.com>
11020
f34787f8
ILT
11021 * output.h (Output_section::Input_section): Initialize p2align_ to
11022 zero for Output_section_data constructors.
11023 (Output_section::Input_section::addralign): If not an input
11024 section, return the alignment of the Output_section_data.
11025 * testsuite/copy_test.cc: New file.
11026 * testsuite/copy_test_1.cc: New file.
11027 * testsuite/copy_test_2.cc: New file.
11028 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
11029 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
11030 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
11031 (copy_test_1_pic.o, copy_test_1.so): New targets.
11032 (copy_test_2_pic.o, copy_test_2.so): New targets.
11033 * testsuite/Makefile.in: Rebuild.
11034
c42e122e
ILT
11035 * script-sections.cc (Script_sections::place_orphan): Initialize
11036 local variable exact.
11037
ce3ac18a
DE
110382008-06-13 David Edelsohn <edelsohn@gnu.org>
11039
11040 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
11041
42cacb20
DE
110422008-06-12 David Edelsohn <edelsohn@gnu.org>
11043 David S. Miller <davem@davemloft.net>
11044
11045 * powerpc.cc: New file.
11046 * Makefile.am (TARGETSOURCES): Add powerpc.cc
11047 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
11048 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
11049 * Makefile.in: Rebuild.
11050
7b308235
ILT
110512008-06-09 Ian Lance Taylor <iant@google.com>
11052
11053 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
11054 <exception>.
11055 (throwing, orig_terminate): New static variables.
11056 (terminate_handler): New static function.
11057 (t2): Set terminate handler.
11058
f0b886e3
ILT
110592008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
11060
11061 PR 6584
cd536b21 11062 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
11063 alignment.
11064
3e90f135
CC
110652008-05-30 Cary Coutant <ccoutant@google.com>
11066
11067 * archive.cc (Archive::include_all_members) Correct to step
11068 over symbol table and extended name table in thin archives.
11069
e09ad04a
ILT
110702008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
11071
11072 PR 6407
11073 * target-reloc.h (relocate_for_relocatable): Fix new_offset
11074 calculation.
11075
62b01cb5
ILT
110762008-05-28 Caleb Howe <cshowe@google.com>
11077
11078 * reduced_debug_output.cc: New file.
11079 * reduced_debug_output.h: New file.
92de84a6 11080 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
11081 * options.cc (General_options::finalize): Add strip_debug_non_line
11082 to the strip heirarchy.
11083 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
11084 fields.
11085 * layout.cc: Include "reduced_debug_output.h".
11086 (Layout::Layout): Initialize new fields.
11087 (line_only_debug_sections): New static array.
11088 (is_lines_only_debug_sections): New static inline function.
11089 (Layout::include_section): Handle --strip-debug-non-line.
11090 (Layout::make_output_section): If --strip-debug-non-line, build
11091 new output sections for .debug_abbrev and .debug_info.
11092 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
11093 gold. Warn about possible overflow.
11094 (read_signed_LEB_128): Likewise.
11095 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
11096 (read_signed_LEB_128): Declare.
11097 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
11098 (HFILES): Add reduced_debug_output.h.
11099 * Makefile.in: Rebuild.
11100
7d9e3d98
ILT
111012008-05-21 Ian Lance Taylor <iant@google.com>
11102
11103 * mapfile.cc: New file.
11104 * mapfile.h: New file.
11105 * options.h (class General_options): Add -M/--print-map and -Map.
11106 * options.cc (General_options::finalize): Make -M equivalent to
11107 -Map -.
11108 * main.cc: Include <cstdio> and "mapfile.h".
11109 (main): Open mapfile if requested.
11110 * gold.cc (class Middle_runner): Add mapfile_ field. Update
11111 constructor. Change caller.
11112 (queue_initial_tasks): Add mapfile parameter. Change caller.
11113 (queue_middle_tasks): Likewise.
11114 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
11115 declarations.
11116 * archive.cc: Include "mapfile.h".
11117 (Archive::add_symbols): Add mapfile parameter. Change all
11118 callers. Pass mapfile, symbol, and reason to include_member.
11119 (Archive::include_all_members): Add mapfile parameter. Change all
11120 callers.
11121 (Archive::include_member): Add mapfile, sym, and why parameters.
11122 Change all callers. Report inclusion to map file.
11123 * archive.h: Include "fileread.h".
11124 (class Archive): Update declarations.
11125 (Archive::file): New const method.
11126 (class Add_archive_symbols): Add mapfile_ field. Update
11127 constructor. Change all callers.
11128 * readsyms.h (class Read_symbols): Likewise.
11129 (class Finish_group): Likewise.
11130 (class Read_script): Likewise.
11131 * common.cc: Include "mapfile.h".
11132 (Symbol_table::allocate_commons): Add mapfile parameter. Change
11133 all callers.
11134 (Symbol_table::do_allocate_commons): Likewise.
11135 (Symbol_table::do_allocate_commons_list): Likewise. Report common
11136 symbol allocation to mapfile.
11137 * common.h (class Allocate_commons_task): Add mapfile_ field.
11138 Update constructor. Change all callers.
11139 * symtab.h (class Symbol_table): Update declarations.
11140 * layout.cc: Include "mapfile.h".
11141 (Layout_task_runner::run): Print information to mapfile.
11142 (Layout::create_gold_note): Change Output_data_fixed_space to
11143 Output_data_zero_fill.
11144 (Layout::create_build_id): Likewise.
11145 (Layout::print_to_mapfile): New function.
11146 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
11147 constructor. Change caller.
11148 (class Layout): Declare print_to_mapfile.
11149 * output.cc (Output_section::Input_section::print_to_mapfile): New
11150 function.
11151 (Output_section::add_input_section): If producing a map, always
11152 add to input_sections_ list.
11153 (Output_section::do_print_to_mapfile): New function.
11154 (Output_segment::print_sections_to_mapfile): New function.
11155 (Output_segment::print_section_list_to_mapfile): New function.
11156 * output.h: Include "mapfile.h".
11157 (Output_data::print_to_mapfile): New function.
11158 (Output_data::do_print_to_mapfile): New virtual function.
11159 (Output_segment_headers::do_print_to_mapfile): New function.
11160 (Output_file_header::do_print_to_mapfile): New function.
11161 (Output_data_const::do_print_to_mapfile): New function.
11162 (class Output_data_const_buffer): Add map_name_ field. Update
11163 constructor. Change all callers. Add do_print_to_mapfile
11164 function.
11165 (class Output_data_fixed_space): Likewise.
11166 (class Output_data_space): Likewise.
11167 (class Output_data_zero_fill): New class.
11168 (Output_data_strtab::do_print_to_mapfile): New function.
11169 (Output_data_reloc_base::do_print_to_mapfile): New function.
11170 (Output_relocatable_relocs::do_print_to_mapfile): New function.
11171 (Output_data_group::do_print_to_mapfile): New function.
11172 (Output_data_got::do_print_to_mapfile): New function.
11173 (Output_data_dynamic::do_print_to_mapfile): New function.
11174 (Output_symtab_xindex::do_print_to_mapfile): New function.
11175 (class Output_section): Declare do_print_to_mapflie. Declare
11176 print_to_mapfile in Input_section.
11177 (class Output_segment): Declare new functions.
11178 * object.h (Sized_relobj::symbol_count): New function.
11179 * script-sections.cc
11180 (Output_section_element_dot_assignment::set_section_addresses):
11181 Change Output_data_fixed_space to Output_data_zero_fill.
11182 (Output_data_expression::do_print_to_mapfile): New function.
11183 * script.cc (read_input_script): Add mapfile parameter. Change
11184 all callers.
11185 * script.h (read_input_script): Update declaration.
11186 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
11187 (Eh_frame::do_print_to_mapfile): New function.
11188 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
11189 (Output_merge_string::do_print_to_mapfile): New function.
11190 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
11191 function.
11192 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
11193 function.
11194 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
11195 function.
11196 * Makefile.am (CCFILES): Add mapfile.cc.
11197 (HFILES): Add mapfile.h.
11198 * Makefile.in: Rebuild.
11199
9f1d377b
ILT
112002008-05-19 Ian Lance Taylor <iant@google.com>
11201
11202 * options.h (class General_options): Add -z relro.
11203 * layout.cc (Layout::Layout): Initialize relro_segment_.
11204 (Layout::add_output_section_data): Return the output section.
11205 (Layout::make_output_section): Rcognize relro sections and mark
11206 them appropriately.
11207 (Layout::attach_allocated_section_to_segment): Put relro sections
11208 in a PT_GNU_RELRO segment.
11209 (Layout::create_initial_dynamic_sections): Mark the .dynamic
11210 section as relro.
11211 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
11212 PT_TLS segments.
11213 (Layout::linkonce_mapping): Map d.rel.ro.local to
11214 .data.rel.ro.local.
11215 (Layout::output_section_name): Us .data.rel.ro.local for any
11216 section which begins with that.
11217 * layout.h (class Layout): Update add_output_section_data
11218 declaration. Add relro_segment_ field.
11219 * output.cc (Output_section::Output_section): Initialize is_relro_
11220 and is_relro_local_ fields.
11221 (Output_segment::add_output_section): Group relro sections.
11222 (Output_segment::is_first_section_relro): New function.
11223 (Output_segment::maximum_alignment): If there is a relro section,
11224 align the segment to the common page size.
11225 (Output_segment::set_section_addresses): Track whether we are
11226 looking at relro sections. If the last section is a relro
11227 section, align to the common page size.
11228 (Output_segment::set_section_list_addresses): Add in_relro
11229 parameter. Change all callers. Align to the page size when
11230 moving from relro to non-relro section.
11231 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
11232 segment.
11233 * output.h (class Output_section): Add is_relro_ and
11234 is_relro_local_ fields.
11235 (Output_section::is_relro): New function.
11236 (Output_section::set_is_relro): New function.
11237 (Output_section::is_relro_local): New function.
11238 (Output_section::set_is_relro_local): New function.
11239 (class Output_segment): Update declarations.
11240 * i386.cc (Target_i386::got_section): Mark .got section as relro.
11241 * sparc.cc (Target_sparc::got_section): Likewise.
11242 * x86_64.cc (Target_x86_64::got_section): Likewise.
11243 * testsuite/relro_test_main.cc: New file.
11244 * testsuite/relro_test.cc: New file.
11245 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
11246 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
11247 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
11248 (relro_test.so, relro_test_pic.o): New targets.
11249 * testsuite/Makefile.in: Rebuild.
11250
a984ee1d
ILT
112512008-05-16 Ian Lance Taylor <iant@google.com>
11252
01676dcd
ILT
11253 * output.cc (Output_segment::add_output_section): Remove front
11254 parameter.
11255 * output.h (class Output_segment): Remove
11256 add_initial_output_section and overloaded add_output_section.
11257 Update declaration of remaining add_output_section.
11258 * layout.cc (Layout::create_interp): Call add_output_section
11259 rather than add_initial_output_section.
11260 (Layout::finish_dynamic_section): Likewise.
11261
497897f9
ILT
11262 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
11263 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
11264 know the dynamic type.
11265 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
11266 field. Initialize it in constructor.
11267 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
11268 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
11269 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
11270 reloc.
11271
a984ee1d
ILT
11272 * output.cc (Output_reloc::get_address): Change return type to
11273 Elf_Addr.
11274 * output.h (class Output_reloc): Update get_address declaration.
11275 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
11276 for section addresses.
11277
55ba0940
ILT
112782008-05-09 Ian Lance Taylor <iant@google.com>
11279
11280 PR 6493
11281 * gold.cc (gold_nomem): Use return value of write.
11282
75517b77
ILT
112832008-05-08 Ian Lance Taylor <iant@google.com>
11284
11285 * symtab.c (Symbol::init_base_output_data): Add version
11286 parameter. Change all callers.
11287 (Symbol::init_base_output_segment): Likewise.
11288 (Symbol::init_base_constant): Likewise.
11289 (Symbol::init_base_undefined): Likewise.
11290 (Sized_symbol::init_output_data): Likewise.
11291 (Sized_symbol::init_output_segment): Likewise.
11292 (Sized_symbol::init_constant): Likewise.
11293 (Sized_symbol::init_undefined): Likewise.
11294 (Symbol_table::do_define_in_output_data): If the new symbol has a
11295 version, mark it as the default.
11296 (Symbol_table::do_define_in_output_segment): Likewise.
11297 (Symbol_table::do_define_as_constant): Likewise.
11298 * symtab.h (class Symbol): Update declarations.
11299 (class Sized_symbol): Likewise.
11300 * resolve.cc (Symbol::override_version): New function.
c42e122e 11301 (Symbol::override_base): Call override_version.
75517b77
ILT
11302 (Symbol::override_base_with_special): Likewise.
11303 * testsuite/ver_script_8.script: New file.
11304 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
11305 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
11306 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
11307 (ver_test_8_1.so, ver_test_8_2.so): New targets.
11308
f1f70eae
ILT
113092008-05-06 Ian Lance Taylor <iant@google.com>
11310
f3e9c5c5
ILT
11311 PR 6049
11312 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
11313 functions.
11314 (class General_options): Remove existing --undefined, and add
11315 --no-undefined instead. Add new --undefined as synonym for -u.
11316 * archive.cc (Archive::add_symbols): Check whether symbol was
11317 named with -u.
11318 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
11319 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
11320 all uses. Add IS_UNDEFINED. Update declarations to split
11321 different versions of init_base. Declare init_base_undefined.
11322 (Symbol::is_defined): Handle IS_UNDEFINED.
11323 (Symbol::is_undefined): Likewise.
11324 (Symbol::is_weak_undefined): Call is_undefined.
11325 (Symbol::is_absolute): Handle IS_CONSTANT.
11326 (class Sized_symbol): Update declarations to split different
11327 versions of init. Declare init_undefined.
11328 (class Symbol_table): Declare new functions.
11329 * symtab.cc (Symbol::init_base_object): Rename from init_base.
11330 Change all callers.
11331 (Symbol::init_base_output_data): Likewise.
11332 (Symbol::init_base_output_segment): Likewise.
11333 (Symbol::init_base_constant): Likewise.
11334 (Symbol::init_base_undefined): New function.
11335 (Sized_symbol::init_object): Rename from init. Change all
11336 callers.
11337 (Sized_symbol::init_output_data): Likewise.
11338 (Sized_symbol::init_output_segment): Likewise.
11339 (Sized_symbol::init_constant): Likewise.
11340 (Sized_symbol::init_undefined): New function.
11341 (Symbol_table::add_undefined_symbols_from_command_line): New
11342 function.
11343 (Symbol_table::do_add_undefined_symbols_from_command_line): New
11344 function.
11345 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
11346 (Symbol::output_section): Likewise.
11347 (Symbol::set_output_section): Likewise.
11348 (Symbol_table::sized_finalize_symbol): Likewise.
11349 (Symbol_table::sized_write_globals): Likewise.
11350 * resolve.cc (Symbol_table::should_override): Likewise.
11351 (Symbol::override_base_with_special): Likewise.
11352
8bdcdf2c
ILT
11353 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
11354 symbol, change it to have default visibility.
11355 * testsuite/protected_1.cc: New file.
11356 * testsuite/protected_2.cc: New file.
11357 * testsuite/protected_3.cc: New file.
11358 * testsuite/protected_main_1.cc: New file.
11359 * testsuite/protected_main_2.cc: New file.
11360 * testsuite/protected_main_3.cc: New file.
11361 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
11362 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
11363 (protected_1_LDFLAGS, protected_1_LDADD): Define.
11364 (protected_1.so): New target.
11365 (protected_1_pic.o, protected_2_pic.o): New targets.
11366 (protected_3_pic.o): New target.
11367 (check_PROGRAMS): Add protected_2.
11368 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
11369 (protected_2_LDFLAGS, protected_2_LDADD): Define.
11370 * testsuite/Makefile.in: Rebuild.
11371
2b706932
ILT
11372 * options.h (DEFINE_var): Add set_user_set_##varname__.
11373 (DEFINE_bool_alias): New macro.
11374 (class General_options): Define -Bstatic using DEFINE_bool_alias
11375 rather than DEFINE_special. Add --undefined as an alias for -z
11376 defs.
11377 * options.cc (General_options::parse_Bstatic): Remove.
11378
d82a5bcc
ILT
11379 * options.h (class General_options): Add --fatal-warnings.
11380 * main.cc (main): Implement --fatal-warnings.
11381 * errors.h (Errors::warning_count): New function.
11382
f1f70eae
ILT
11383 * options.h (class General_options): Add -Bsymbolic-functions.
11384 * symtab.h (Symbol::is_preemptible): Check for
11385 -Bsymbolic-functions.
11386
8825ac63
ILT
113872008-05-05 Ian Lance Taylor <iant@google.com>
11388
d98bc257
ILT
11389 * options.h (DEFINE_bool): For DASH_Z, create the negative option
11390 as noVARNAME rather than no-VARNAME.
11391 (class General_options): Add option -z combreloc.
11392 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
11393 get_address.
11394 (Output_reloc::sort_before) [SHT_REL]: New function.
11395 (Output_reloc::sort_before) [SHT_RELA]: New function.
11396 (class Output_data_reloc_base): Add sort_relocs_ field. Define
11397 Sort_relocs_comparison.
11398 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
11399 parameter. Change all callers.
11400 (Output_data_reloc::Output_data_reloc) [both versions]: Add
11401 sort_relocs parameter. Change all callers.
11402 * output.cc (Output_reloc::get_address): New function, broken out
11403 of write_rel.
11404 (Output_reloc::write_rel): Call it.
11405 (Output_reloc::compare): New function.
11406 (Output_data_reloc_base::do_write): Optionally sort relocs.
11407
60b2b4e7
ILT
11408 * configure.ac: If targ_extra_obj is set, link it in.
11409 * configure.tgt: Initialize all variables.
11410 (x86_64*): Set targ_extra_obj and targ_extra_size.
11411 * configure: Rebuild.
11412
8825ac63
ILT
11413 * object.cc (Sized_relobj::include_section_group): Adjust section
11414 indexes read from group data. Build vector to pass to
11415 layout_group.
11416 * layout.cc (Layout::layout_group): Add flags and shndxes
11417 parameters. Remove contents parameter. Change caller. Update
11418 explicit instantiations.
11419 * layout.h (class Layout): Update layout_group declaration.
11420 * output.cc (Output_data_group::Output_data_group): Add flags and
11421 input_shndxes parameters. Remove contents parameter. Change
11422 caller.
11423 (Output_data_group::do_write): Change input_sections_ to
11424 input_shndxes_.
11425 * output.h (class Output_data_group): Update constructor
11426 declaration. Rename input_sections_ to input_shndxes_.
11427 * testsuite/many_sections_test.cc: Add template.
11428
e94cf127
CC
114292008-04-30 Cary Coutant <ccoutant@google.com>
11430
4418b2d5
CC
11431 * target-reloc.h (relocate_section): Fix dead-pointer bug.
11432
e94cf127
CC
11433 * layout.cc (Layout::include_section): Refactored check for debug
11434 info section.
11435 (Layout::add_comdat): Add new parameters. Change type
11436 of signature parameter. Add object and shndx to signatures table.
11437 (Layout::find_kept_object): New function.
11438 * layout.h: Include <cstring>.
11439 (Layout::is_debug_info_section): New function.
11440 (Layout::add_comdat): Add new parameters.
11441 (Layout::find_kept_object): New function.
11442 (Layout::Kept_section): New struct.
11443 (Layout::Signatures): Change type of map range.
11444 * object.cc (Relobj::output_section_address): New function.
11445 (Sized_relobj::include_section_group): Add new parameters. Change
11446 calls to Layout::add_comdat. Change to build table of kept comdat
11447 groups and table mapping discarded sections to kept sections.
11448 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
11449 (Sized_relobj::do_layout): Change calls to include_section_group and
11450 include_linkonce_section.
11451 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
11452 value to zero when section is discarded.
11453 (Sized_relobj::map_to_kept_section): New function.
11454 * object.h (Relobj::output_section_address): New function.
11455 (Relobj::Comdat_group): New type.
11456 (Relobj::find_comdat_group): New function.
11457 (Relobj::Comdat_group_table): New type.
11458 (Relobj::Kept_comdat_section): New type.
11459 (Relobj::Kept_comdat_section_table): New type.
11460 (Relobj::add_comdat_group): New function.
11461 (Relobj::set_kept_comdat_section): New function.
11462 (Relobj::get_kept_comdat_section): New function.
11463 (Relobj::comdat_groups_): New field.
11464 (Relobj::kept_comdat_sections_): New field.
11465 (Symbol_value::input_value): Update comment.
11466 (Sized_relobj::map_to_kept_section) New function.
11467 (Sized_relobj::include_linkonce_section): Add new parameter.
11468 * target-reloc.h (Comdat_behavior): New type.
11469 (get_comdat_behavior): New function.
11470 (relocate_section): Add code to map a discarded section to the
11471 corresponding kept section when applying a relocation.
11472
e4e5049b
CS
114732008-04-30 Craig Silverstein <csilvers@google.com>
11474
11475 * dwarf_reader.cc (next_generation_count): New static var.
11476 (Addr2line_cache_entry): New struct.
11477 (addr2line_cache): New static var.
11478 (Dwarf_line_info::one_addr2line): Added caching.
11479 (Dwarf_line_info::clear_addr2line_cache): New function.
11480 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
11481 cache-size parameter.
11482 (Dwarf_line_info::one_addr2line_cache): New function.
11483 * symtab.cc (Symbol_table::detect_odr_violations): Pass
11484 new cache-size argument to one_addr2line(), and clear cache.
11485
d09e9154
CC
114862008-04-28 Cary Coutant <ccoutant@google.com>
11487
11488 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
11489 R_386_PC8 relocations.
11490
7ef73768
ILT
114912008-04-23 Ian Lance Taylor <iant@google.com>
11492
55438702
ILT
11493 * object.cc (Sized_relobj::include_section_group): Check for
11494 invalid section group.
11495
c165fb93
ILT
11496 * object.cc (make_elf_object): Correct test for 64-bit ELF file
11497 header size.
11498
7ef73768
ILT
11499 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
11500 than read for file header.
11501 * archive.cc (Archive::include_member): Likewise.
11502
6194aaab
L
115032008-04-23 Paolo Bonzini <bonzini@gnu.org>
11504
11505 * aclocal.m4: Regenerate.
11506 * configure: Regenerate.
11507
d491d34e
ILT
115082008-04-19 Ian Lance Taylor <iant@google.com>
11509
5ea2bac6
ILT
11510 * version.cc (version_string): Bump to 1.6.
11511
7bc3e21a
ILT
11512 * testsuite/Makefile.am (many_sections_r_test): New target.
11513 (many_sections_r_test_SOURCES): Remove.
11514 (many_sections_r_test_DEPENDENCIES): Remove.
11515 (many_sections_r_test_LDFLAGS): Remove.
11516 (many_sections_r_test_LDADD): Remove.
11517
7fcd3aa9
ILT
11518 * object.cc (Sized_relobj::do_add_symbols): Always pass
11519 local_symbol_count_ to add_from_relobj.
11520
4c94d6ae
ILT
11521 * testsuite/Makefile.am (many_sections_check.h): Only check one in
11522 every thousand variables.
11523 * testsuite/Makefile.in: Rebuild.
11524
d491d34e
ILT
11525 * object.cc (Xindex::initialize_symtab_xindex): New function.
11526 (Xindex::read_symtab_xindex): New function.
11527 (Xindex::sym_xindex_to_shndx): New function.
11528 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
11529 available.
11530 (Sized_relobj::do_initialize_xindex): New function.
11531 (Sized_relobj::do_read_symbols): Adjust section links.
11532 (Sized_relobj::symbol_section_and_value): Add is_ordinary
11533 parameter. Change all callers.
11534 (Sized_relobj::include_section_group): Adjust section links and
11535 symbol section indexes.
11536 (Sized_relobj::do_layout): Adjust section links.
11537 (Sized_relobj::do_count_local_symbols): Adjust section links and
11538 symbol section indexes.
11539 (Sized_relobj::do_finalize_local_symbols): Distinguish between
11540 ordinary and special symbols.
11541 (Sized_relobj::write_local_symbols): Add symtab_xindex and
11542 dynsym_xindex parameters. Change all callers. Adjust section
11543 links. Use SHN_XINDEX when needed.
11544 (Sized_relobj::get_symbol_location_info): Adjust section links.
11545 Don't get fooled by special symbols.
11546 * object.h (class Xindex): Define.
11547 (class Object): Add xindex_ parameter. Declare virtual functoin
11548 do_initialize_xindex.
11549 (Object::adjust_sym_shndx): New function.
11550 (Object::set_xindex): New protected function.
11551 (class Symbol_value): Add is_ordinary_shndx_ field.
11552 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
11553 (Symbol_value::value): Assert ordinary section.
11554 (Symbol_value::initialize_input_to_output_map): Likewise.
11555 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
11556 Change all callers.
11557 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
11558 all callers.
11559 (class Sized_relobj): Update declarations.
11560 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
11561 parameter. Change all callers.
11562 (Sized_relobj::adjust_shndx): New function.
11563 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
11564 field.
11565 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
11566 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
11567 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
11568 (Sized_dynobj::read_dynsym_section): Adjust section links.
11569 (Sized_dynobj::read_dynamic): Likewise.
11570 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
11571 section links.
11572 (Sized_dynobj::do_initialize_xindex): New function.
11573 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
11574 do_initialize_xindex.
11575 (Sized_dynobj::adjust_shndx): New function.
11576 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
11577 dynsym_xindex_ fields.
11578 (Layout::finalize): Add a call to set_section_indexes before
11579 creating the symtab sections.
11580 (Layout::set_section_indexes): Don't do anything if the section
11581 already has a section index.
11582 (Layout::create_symtab_sections): Add shnum parameter. Change
11583 caller. Create .symtab_shndx section if needed.
11584 (Layout::create_shdrs): Add shstrtab_section parameter. Change
11585 caller.
11586 (Layout::allocated_output_section_count): New function.
11587 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
11588 needed.
11589 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
11590 fields. Update declarations.
11591 (Layout::symtab_xindex): New function.
11592 (Layout::dynsym_xindex): New function.
11593 (class Write_symbols_task): Add layout_ field.
11594 (Write_symbols_task::Write_symbols_task): Add layout parameter.
11595 Change caller.
11596 * output.cc (Output_section_headers::Output_section_headers): Add
11597 shstrtab_section parameter. Change all callers.
11598 (Output_section_headers::do_sized_write): Store overflow values
11599 for section count and section string table section index in
11600 section header zero.
11601 (Output_file_header::do_sized_write): Check for overflow of
11602 section count and section string table section index.
11603 (Output_symtab_xindex::do_write): New function.
11604 (Output_symtab_xindex::endian_do_write): New function.
11605 * output.h (class Output_section_headers): Add shstrtab_section_.
11606 Update declarations.
11607 (class Output_symtab_xindex): Define.
11608 (Output_section::has_out_shndx): New function.
11609 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
11610 field.
11611 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
11612 Change all callers.
11613 (Sized_symbol::init): Likewise.
11614 (Symbol::output_section): Check for ordinary symbol.
11615 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
11616 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
11617 callers.
11618 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
11619 Change all callers. Simplify handling of symbols from sections
11620 not included in the link.
11621 (Symbol_table::add_from_dynobj): Handle ordinary symbol
11622 distinction.
11623 (Weak_alias_sorter::operator()): Assert that symbols are
11624 ordinary.
11625 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
11626 distinction.
11627 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
11628 parameters. Change all callers.
11629 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
11630 symbol distinction. Use SHN_XINDEX when needed.
11631 (Symbol_table::write_section_symbol): Add symtab_xindex
11632 parameter. Change all callers.
11633 (Symbol_table::sized_write_section_symbol): Likewise. Use
11634 SHN_XINDEX when needed.
11635 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
11636 declarations.
11637 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
11638 (Symbol::is_defined): Check is_ordinary.
11639 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
11640 (Symbol::is_absolute, Symbol::is_common): Likewise.
11641 (class Sized_symbol): Update declarations.
11642 (class Symbol_table): Update declarations.
11643 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
11644 parameters. Change all callers.
11645 (Sized_symbol::override): Likewise.
11646 (Symbol_table::override): Likewise.
11647 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
11648 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
11649 is_ordinary, and orig_st_shndx parameters. Change all callers.
11650 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
11651 to be in an ordinary section.
11652 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
11653 object and is_ordinary parameters. Change all callers.
11654 (Sized_dwarf_line_info::read_relocs): Add object parameter.
11655 Change all callers. Don't add undefined or non-ordinary symbols
11656 to reloc_map_.
11657 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
11658 Change all callers.
11659 * dwarf_reader.h (class Sized_dwarf_line_info): Update
11660 declarations.
11661 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
11662 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
11663 (Sized_relobj::relocate_sections): Likewise.
11664 * target-reloc.h (scan_relocs): Adjust section symbol index.
11665 (scan_relocatable_relocs): Likewise.
11666 * i386.cc (Scan::local): Check for ordinary symbols.
11667 * sparc.cc (Scan::local): Likewise.
11668 * x86_64.cc (Scan::local): Likewise.
11669 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
11670 to symbol_section_and_value.
11671 * testsuite/many_sections_test.cc: New file.
11672 * testsuite/Makefile.am (BUILT_SOURCES): Define.
11673 (check_PROGRAMS): Add many_sections_test.
11674 (many_sections_test_SOURCES): Define.
11675 (many_sections_test_DEPENDENCIES): Define.
11676 (many_sections_test_LDFLAGS): Define.
11677 (BUILT_SOURCES): Add many_sections_define.h.
11678 (many_sections_define.h): New target.
11679 (BUILT_SOURCES): Add many_sections_check.h.
11680 (many_sections_check.h): New target.
11681 (check_PROGRAMS): Add many_sections_r_test.
11682 (many_sections_r_test_SOURCES): Define.
11683 (many_sections_r_test_DEPENDENCIES): Define.
11684 (many_sections_r_test_LDFLAGS): Define.
11685 (many_sections_r_test_LDADD): Define.
11686 (many_sections_r_test.o): New target.
11687 * testsuite/Makefile.in: Rebuild.
11688
c5818ff1
CC
116892008-04-17 Cary Coutant <ccoutant@google.com>
11690
11691 * errors.cc (Errors::info): New function.
11692 (gold_info): New function.
11693 * errors.h (Errors::info): New function.
11694 * gold.h (gold_info): New function.
11695 * object.cc (Input_objects::add_object): Print trace output.
11696 * options.cc (options::parse_set): New function.
11697 (General_options::parse_wrap): Deleted.
11698 (General_options::General_options): Deleted initializer.
11699 * options.h (options::String_set): New typedef.
11700 (options::parse_set): New function.
11701 (DEFINE_set): New macro.
11702 (General_options::wrap): Changed to use DEFINE_set. Changed
11703 callers of any_wrap_symbols and is_wrap_symbol.
11704 (General_options::trace, General_options::trace_symbol):
11705 New options.
11706 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
11707 (General_options::wrap_symbols_): Deleted.
11708 * symtab.cc (Symbol_table::add_from_object): Print trace output.
11709
b5be4a7c
DM
117102008-04-17 David S. Miller <davem@davemloft.net>
11711
11712 * options.cc (General_options::parse_V): New function.
11713 * options.h: Add entries for -V and -Qy.
11714
155a0dd7
ILT
117152008-04-17 Ian Lance Taylor <iant@google.com>
11716
11717 * common.cc (Symbol_table::allocate_commons): Remove options
11718 parameter. Change caller.
11719 (Symbol_table::do_allocate_commons): Remove options parameter.
11720 Change caller. Just call do_allocate_commons_list twice.
11721 (Symbol_table::do_allocate_commons_list): New function, broken out
11722 of do_allocate_commons.
11723 * common.h (class Allocate_commons_task): Remove options_ field.
11724 Update constructor.
11725 * symtab.cc (Symbol_table::Symbol_table): Initialize
11726 tls_commons_.
11727 (Symbol_table::add_from_object): Put TLS common symbols on
11728 tls_commons_ list.
11729 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
11730 which are IN_OUTPUT_DATA.
11731 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
11732 allocate_commons and do_allocate_commons declarations. Declare
11733 do_allocate_commons_list.
11734 * gold.cc (queue_middle_tasks): Update creation of
11735 Allocate_commons_task to not pass options.
11736 * testsuite/Makefile.am (INCLUDES): Add -I.. .
11737 (TLS_TEST_C_FLAGS): New variable.
11738 (tls_test_c_pic.o): New target.
11739 (tls_test_shared.so): Link in tls_test_c_pic.o.
11740 (tls_test_c_pic_ie.o): New target.
11741 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
11742 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
11743 (tls_test_c.o): New target.
11744 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
11745 (tls_pic_test_LDADD): Likewise.
11746 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
11747 (tls_shared_gd_to_ie_test_LDADD): Likewise.
11748 (tls_test_c_gnu2.o): New target.
11749 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
11750 tls_test_c_gnu2.o.
11751 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
11752 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
11753 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
11754 * testsuite/tls_test.cc: Include "config.h".
11755 (t_last): Call t11_last.
11756 * testsuite/tls_test.h (t11, t11_last): Declare.
11757 * testsuite/tls_test_c.c: New file.
11758 * testsuite/tls_test_main.cc (thread_routine): Call t11.
11759 * configure.ac: Check for OpenMP support.
11760 * configure, config.in, Makefile.in: Rebuild.
11761 * testsuite/Makefile.in: Rebuild.
11762
edfbb029
CC
117632008-04-16 Cary Coutant <ccoutant@google.com>
11764
11765 * i386.cc (Target_i386::define_tls_base_symbol): New function.
11766 (Target_i386::tls_base_symbol_defined_): New field.
11767 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
11768 (Target_i386::Scan::global): Likewise.
11769 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
11770 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
11771 (Target_x86_64::tls_base_symbol_defined_): New field.
11772 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
11773 (Target_x86_64::Scan::global): Likewise.
11774
f3c69fca
CC
117752008-04-16 Cary Coutant <ccoutant@google.com>
11776
11777 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
11778 (Symbol::needs_plt_entry): Allow weak undefined symbols.
11779 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
11780 building shared libraries.
11781 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
11782 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
11783 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
11784 * testsuite/Makefile.in: Rebuild.
11785 * testsuite/weak_undef.h: New file.
11786 * testsuite/weak_undef_file1.cc: Add extra test cases.
11787 * testsuite/weak_undef_file2.cc: Likewise.
11788 * testsuite/weak_undef_test.cc: Likewise.
11789
7c414435
DM
117902008-04-16 David S. Miller <davem@davemloft.net>
11791
32b769e1
DM
11792 * sparc.cc (Target_sparc::Scan): Change from struct to class.
11793 Add issued_non_pic_error_ field. Declare check_non_pic.
11794 (Target_sparc::Scan::check_non_pic): New function.
11795 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
11796 (Target_sparc::Scan::global): Likewise.
11797
11936fb1
DM
11798 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
11799 * configure: Rebuild.
11800
7c414435
DM
11801 * options.h (DEFINE_enable): New macro.
11802 (new_dtags): New enable option.
11803 (initfirst, interpose, loadfltr, nodefaultlib,
11804 nodelete, nodlopen, nodump): New -z options.
11805 * layout.cc (Layout:finish_dynamic_section): If new
11806 dtags enabled, emit DT_RUNPATH. Also, emit a
11807 DT_FLAGS_1 containing any specified -z flags.
11808
85c7bf8b
ILT
118092008-04-16 Ian Lance Taylor <iant@google.com>
11810
12c0daef
ILT
11811 * copy-relocs.cc: New file.
11812 * copy-relocs.h: New file.
11813 * reloc.cc: Remove Copy_relocs code.
11814 * reloc.h: Likewise.
11815 * reloc-types.h (struct Reloc_types) [both versions]: Add
11816 get_reloc_addend_noerror.
11817 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
11818 variants of add_global which take an addend which must be zero.
11819 * i386.cc: Include "copy-relocs.h".
11820 (class Target_i386): Change type of copy_relocs_ to variable,
11821 update initializer.
11822 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
11823 Change all callers.
11824 (Target_i386::do_finalize_sections): Change handling of
11825 copy_relocs_.
11826 * sparc.cc: Include "copy-relocs.h".
11827 (class Target_sparc): Change type of copy_relocs_ to variable,
11828 update initializer.
11829 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
11830 Change all callers.
11831 (Target_sparc::do_finalize_sections): Change handling of
11832 copy_relocs_.
11833 * x86_64.cc: Include "copy-relocs.h".
11834 (class Target_x86_64): Change type of copy_relocs_ to variable,
11835 update initializer.
11836 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
11837 class. Change all callers.
11838 (Target_x86_64::do_finalize_sections): Change handling of
11839 copy_relocs_.
11840 * Makefile.am (CCFILES): Add copy-relocs.cc.
11841 (HFILES): Add copy-relocs.h.
11842
4f4995b6
ILT
11843 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
11844
85c7bf8b
ILT
11845 * testsuite/script_test_4.sh: Permit leading zeroes.
11846
4f2a9edd
ILT
118472008-04-15 Ian Lance Taylor <iant@google.com>
11848
e6188289
ILT
11849 * script-sections.cc (Script_sections::create_segments): Use
11850 header_size_adjustment even when there is enough room for the
11851 headers.
11852 * testsuite/script_test_4.sh: New file.
11853 * testsuite/script_test_4.t: New file.
11854 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
11855 (check_DATA): Add script_test_4.stdout.
11856 (MOSTLYCLEANFILES): Likewise.
11857 (script_test_4): New target.
11858 (script_test_4.stdout): New target.
11859 * testsuite/Makefile.in: Rebuild.
11860
4f2a9edd
ILT
11861 * sparc.cc: Add definitions for Output_data_plt_sparc class
11862 constants.
11863
f5314dd5
DM
118642008-04-14 David S. Miller <davem@davemloft.net>
11865
11866 * sparc.cc: New file.
11867 * Makefile.am (TARGETSOURCES): Add sparc.cc
11868 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
11869 * configure.tgt: Document targ_extra_size and
11870 targ_extra_big_endian. Add entries for sparc-* and
11871 sparc64-*.
11872 * configure.ac: Handle targ_extra_size and
11873 targ_extra_big_endian.
11874 * Makefile.in: Rebuild.
11875 * configure: Likewise.
11876 * po/POTFILES.in: Likewise.
11877 * po/gold.pot: Likewise.
11878
154e0e9a
ILT
118792008-04-14 Ian Lance Taylor <iant@google.com>
11880
11881 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
11882 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
11883 in the name/type/flags to section mapping. Don't call
11884 allocate_output_section.
11885 (Layout::choose_output_section): Change parameter from adjust_name
11886 to is_input_section. Don't permit input sections after sections
11887 are attached to segments. Don't call allocate_output_section.
11888 (Layout::layout_eh_frame): Call update_flags_for_input_section,
11889 not write_enable_output_section.
11890 (Layout::make_output_section): Don't push to
11891 unattached_section_list_ nor call attach_to_segment. Call
11892 attach_section_to_segment if sections are attached.
11893 (Layout::attach_sections_to_segments): New function.
11894 (Layout::attach_section_to_segment): New function.
11895 (Layout::attach_allocated_section_to_segment): Rename from
11896 attach_to_segment. Remove flags parameter.
11897 (Layout::allocate_output_section): Remove function.
11898 (Layout::write_enable_output_section): Remove function.
11899 * layout.h (class Layout): Update for above changes. Add new
11900 field sections_are_attached_.
11901 * output.h (Output_section::update_flags_for_input_section): New
11902 function.
11903 * output.cc (Output_section::add_input_section): Call
11904 update_flags_for_input_section.
11905 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
11906
009a67a2
CC
119072008-04-11 Cary Coutant <ccoutant@google.com>
11908
11909 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
11910 thought unnecessary.
11911 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
11912
759b1a24
ILT
119132008-04-11 Ian Lance Taylor <iant@google.com>
11914
11915 * output.h (class Output_section_data): Remove inline definition
11916 of set_addralign.
11917 * output.cc (Output_section_data::set_addralign): New function.
11918
c2b45e22
CC
119192008-04-11 Cary Coutant <ccoutant@google.com>
11920
11921 Add support for TLS descriptors for i386 and x86_64.
11922 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
11923 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
11924 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
11925 GOT_TYPE_TLS_DESC.
11926 (Target_i386::got_mod_index_entry): Remove unnecessary code.
11927 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
11928 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
11929 relocations.
11930 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
11931 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
11932 Fix problem with initial-exec relocations.
11933 (Target_i386::Relocate::relocate_tls): Likewise.
11934 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
11935 relaxation.
11936 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
11937 support for section-plus-offset dynamic table entries.
11938 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
11939 (Output_data_dynamic::Dynamic_entry): Add support for
11940 section-plus-offset dynamic table entries.
11941 (Output_data_dynamic::Classification): Likewise.
11942 (Output_data_dynamic::classification_): Renamed offset_.
11943 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
11944 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
11945 (Target_x86_64::make_plt_section): New function.
11946 (Target_x86_64::reserve_tlsdesc_entries): New function.
11947 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
11948 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
11949 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
11950 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
11951 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
11952 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
11953 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
11954 add extra PLT entry for TLS descriptors.
11955 (Output_data_plt_x86_64::got_): New field.
11956 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
11957 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
11958 fields.
11959 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
11960 descriptors.
11961 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
11962 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
11963 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
11964 R_386_TLS_DESC_CALL relocations.
11965 (Target_x86_64::Scan::global): Likewise.
11966 (Target_x86_64::do_finalize_sections): Add dynamic table entries
11967 for TLS descriptors.
11968 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
11969 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
11970 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
11971 GD-to-IE relaxation.
11972 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
11973 and TLS_DESCRIPTORS.
11974 * Makefile.in: Rebuild.
11975 * configure: Rebuild.
11976 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
11977 (tls_test_shared2.so): New target.
11978 (tls_shared_gd_to_ie_test_SOURCES): New variable.
11979 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
11980 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
11981 (tls_shared_gd_to_ie_test_LDADD): New variable.
11982 (tls_shared_gnu2_gd_to_ie_test): New target.
11983 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
11984 New targets.
11985 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
11986 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
11987 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
11988 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
11989 (tls_shared_gnu2_test): New target.
11990 (tls_test_gnu2_shared.so): New target.
11991 (tls_shared_gnu2_test_SOURCES): New variable.
11992 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
11993 (tls_shared_gnu2_test_LDFLAGS): New variable.
11994 (tls_shared_gnu2_test_LDADD): New variable.
11995 * testsuite/Makefile.in: Rebuild.
11996 * testsuite/Makefile.
11997
83bfb6b7
ILT
119982008-04-11 Ian Lance Taylor <iant@google.com>
11999
12000 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
12001 justsyms.t.
12002 * testsuite/Makefile.in: Rebuild.
12003
12004 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
12005 long.
12006 * testsuite/script_test_2.cc (main): Adjust test.
12007
706e1f5e
ILT
120082008-04-11 David S. Miller <davem@davemloft.net>
12009 Ian Lance Taylor <iant@google.com>
12010
12011 * options.h (General_options): Add entries for '-Y' and
12012 '-relax'.
12013 * options.cc (General_options:finalize): If -Y was used, add those
12014 entries to the library path instead of the default "/lib" and
12015 "/usr/lib".
12016
7c98e6bb
DM
120172008-04-11 David S. Miller <davem@davemloft.net>
12018
12019 * testsuite/justsyms.t: Start at 0x100.
12020 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
12021 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
12022 long.
12023 * testsuite/script_test_2.cc: Adjust string and section length
12024 checks.
7c98e6bb 12025
99a37bfd
ILT
120262008-04-09 Ian Lance Taylor <iant@google.com>
12027
2cefc357
ILT
12028 PR gold/5996
12029 * script-sections.cc (Sections_element::allocate_to_segment): Add
12030 orphan parameter.
12031 (Output_section_definition::allocate_to_segment): Likewise.
12032 (Orphan_output_section::allocate_to_segment): Likewise.
12033 (Script_sections::attach_sections_using_phdrs_clause): Don't
12034 propagate non-PT_LOAD segments to orphan sections.
12035 * testsuite/Makefile.am (script_test_3.stdout): Generate using
12036 readelf rather than objdump.
12037 * testsuite/script_test_3.sh: Adjust accordingly. Test that
12038 .interp section and PT_INTERP segment are the same size.
12039 * testsuite/Makefile.in: Rebuild.
12040
99a37bfd
ILT
12041 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
12042 aliases for symbols defined in the same object.
12043 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
12044 (weak_alias_test_SOURCES): New variable.
12045 (weak_alias_test_DEPENDENCIES): New variable.
12046 (weak_alias_test_LDFLAGS): New variable.
12047 (weak_alias_test_LDADD): New variable.
12048 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
12049 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
12050 (weak_alias_test_3.o): New target.
12051 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
12052 * testsuite/weak_alias_test_main.cc: New file.
12053 * testsuite/weak_alias_test_1.cc: New file.
12054 * testsuite/weak_alias_test_2.cc: New file.
12055 * testsuite/weak_alias_test_3.cc: New file.
12056
780e49c5
ILT
120572008-04-08 Ian Lance Taylor <iant@google.com>
12058
cdb0b8f5
ILT
12059 * options.h (class General_options): Add --noinhibit-exec option.
12060 * main.cc (main): Check --noinhibit-exec.
12061
0864d551
ILT
12062 * options.h (class General_options): Define --wrap as a special
12063 option. Add wrap_symbols_ field.
12064 (General_options::any_wrap_symbols): New function.
12065 (General_options::is_wrap_symbol): New function.
12066 * options.cc (General_options::parse_wrap): New function.
12067 (General_options::General_options): Initialize wrap_symbols_.
12068 * symtab.cc (Symbol_table::wrap_symbol): New function.
12069 (Symbol_table::add_from_object): Handle --wrap.
12070 * symtab.h (class Symbol_table): Declare wrap_symbol.
12071 * target.h (Target::wrap_char): New function.
12072 (Target::Target_info): Add wrap_char field.
12073 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
12074 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12075 * testsuite/testfile.cc (Target_test::test_target_info):
12076 Likewise.
12077
789aa6de
ILT
12078 * errors.cc (Errors::undefined_symbol): Mention symbol version if
12079 there is one.
12080
2c38906f
ILT
12081 * layout.h (class Layout): Add added_eh_frame_data_ field.
12082 * layout.cc (Layout::Layout): Initialize new field.
12083 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
12084 output section until we find a section we merged successfully.
12085 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
12086 that the size be non-zero.
12087
780e49c5
ILT
12088 * merge.cc (Object_merge_map::get_output_offset): Remove inline
12089 qualifier.
12090
7fcd0256
ILT
120912008-04-08 Craig Silverstein <csilvers@google.com>
12092
12093 * configure.ac: Export new conditional variable HAVE_ZLIB.
12094 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
12095 on HAVE_ZLIB.
12096 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
12097 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12098
6835af53
ILT
120992008-04-07 Ian Lance Taylor <iant@google.com>
12100
e24f324c
ILT
12101 * version.cc (version_string): Set to "1.5".
12102
a036edd8
ILT
12103 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
12104 Add issued_non_pic_error_ field. Declare check_non_pic.
12105 (Target_x86_64::Scan::check_non_pic): New function.
12106 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
12107 (Target_x86_64::Scan::global): Likewise.
12108
624f8810
ILT
12109 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
12110 addend parameter. Change caller. Handle merge sections.
12111 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
12112 Address to Addend. Don't add in the result of
12113 local_section_offset, pass down the addend and use the returned
12114 value.
12115 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
12116 Update declarations of local_section_offset and symbol_value.
12117 * testsuite/two_file_test_1.cc (t18): New function.
12118 * testsuite/two_file_test_2.cc (f18): New function.
12119 * testsuite/two_file_test_main.cc (main): Call t18.
12120 * testsuite/two_file_test.h (t18, f18): Declare.
12121
6835af53
ILT
12122 * configure.ac: Don't test for objdump, c++filt, or readelf.
12123 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
12124 conditionals.
12125 (TEST_READELF): New variable.
12126 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
12127 (check_PROGRAMS): Add two_file_strip_test.
12128 (two_file_strip_test): New target.
12129 (check_PROGRAMS): Add two_file_same_shared_strip_test.
12130 (two_file_same_shared_strip_test_SOURCES): New variable.
12131 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
12132 (two_file_same_shared_strip_test_LDFLAGS): New variable.
12133 (two_file_same_shared_strip_test_LDADD): New variable.
12134 (two_file_shared_strip.so): New target.
12135 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
12136 (ver_test_5.syms, ver_test_7.syms): Likewise.
12137 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
12138 (strip_test_3.stdout): Use TEST_OBJDUMP.
12139 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12140
86925eef
CC
121412008-04-04 Cary Coutant <ccoutant@google.com>
12142
12143 * symtab.h (Symbol::is_weak_undefined): New function.
12144 (Symbol::is_strong_undefined): New function.
12145 (Symbol::is_absolute): New function.
12146 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
12147 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
12148 absolute symbols.
12149 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
12150 (weak_undef_test): New target.
12151 * testsuite/Makefile.in: Rebuild.
12152 * testsuite/weak_undef_file1.cc: New file.
12153 * testsuite/weak_undef_file2.cc: New file.
12154 * testsuite/weak_undef_test.cc: New file.
12155
126f3ece
ILT
121562008-04-03 Craig Silverstein <csilvers@google.com>
12157
12158 * compressed_output.h (class Output_compressed_section): Use
12159 unsigned buffer.
12160 * compressed_output.cc (zlib_compress): Use unsigned buffers,
12161 add zlib header.
12162 (zlib_compressed_suffix): Removed.
12163 (Output_compressed_section::set_final_data_size): Use unsigned
12164 buffers.
12165 * testsuite/Makefile.am (flagstest_compress_debug_sections):
12166 Fix linker invocation.
12167 (flagstest_o_specialfile_and_compress_debug_sections):
12168 Likewise.
12169 * testsuite/Makefile.in: Regenerated.
12170
deae2a14
DM
121712008-04-02 David S. Miller <davem@davemloft.net>
12172
12173 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
12174 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
12175
70752818
ILT
121762008-04-02 Craig Silverstein <csilvers@google.com>
12177
12178 * TODO: New file.
12179
39d0cb0e
ILT
121802008-04-02 Ian Lance Taylor <iant@google.com>
12181
12182 * fileread.cc (File_read::find_view): Add byteshift and vshifted
12183 parameters. Update for new key type to views_. Change all
12184 callers.
12185 (File_read::read): Adjust for byteshift in returned view.
12186 (File_read::add_view): New function, broken out of
12187 find_and_make_view.
12188 (File_read::make_view): New function, broken out of
12189 find_and_make_view.
12190 (File_read::find_or_make_view): Add offset and aligned
12191 parameters. Rewrite accordingly. Change all callers.
12192 (File_read::get_view): Add offset and aligned parameters. Adjust
12193 for byteshift in return value.
12194 (File_read::get_lasting_view): Likewise.
12195 * fileread.h (class File_read): Update declarations.
12196 (class File_read::View): Add byteshift_ field. Add byteshift to
12197 constructor. Add byteshift method.
12198 * archive.h (Archive::clear_uncached_views): New function.
12199 (Archive::get_view): Add aligned parameter. Change all callers.
12200 * object.h (Object::get_view): Add aligned parameter. Change all
12201 callers.
12202 (Object::get_lasting_view): Likewise.
12203
12204 * fileread.cc (File_read::release): Don't call clear_views if
12205 there are multiple objects.
12206 * fileread.h (File_read::clear_uncached_views): New function.
12207 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
12208 on the archive.
12209
a1207466
CC
122102008-03-31 Cary Coutant <ccoutant@google.com>
12211
12212 Add thin archive support.
12213 * archive.cc (Archive::armagt): New const.
12214 (Archive::setup): Remove task parameter and calls to unlock.
12215 (Archive::unlock_nested_archives): New function.
12216 (Archive::read_header): Add nested_off parameter. Change
12217 all callers.
12218 (Archive::interpret_header): Likewise.
12219 (Archive::include_all_members): Change to handle thin
12220 archives.
12221 (Archive::include_member): Likewise.
12222 * archive.h (Archive::Archive): Add new parameters and
12223 initializers.
12224 (Archive::armagt): New const.
12225 (Archive::setup): Remove task parameter.
12226 (Archive::unlock_nested_archives): New function.
12227 (Archive::read_header): Add nested_off parameter.
12228 (Archive::interpret_header): Likewise.
12229 (Archive::Nested_archive_table): New typedef.
12230 (Archive::is_thin_archive_): New field.
12231 (Archive::nested_archives_): New field.
12232 (Archive::options_): New field.
12233 (Archive::dirpath_): New field.
12234 (Archive::task_): New field.
12235 * readsyms.cc (Read_symbols::do_read_symbols): Add check
12236 for thin archives. Pass additional parameters to
12237 Archive::Archive. Unlock the archive file after calling
12238 Archive::setup.
cd536b21 12239
479f6503
ILT
122402008-03-29 Ian Lance Taylor <iant@google.com>
12241
686c8caf
ILT
12242 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
12243 version symbol to be local.
12244 * testsuite/ver_test_4.sh: New file.
12245 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
12246 (check_DATA): Add ver_test_4.syms.
12247 (ver_test_4.syms): New target.
12248 * testsuite/Makefile.in: Rebuild.
12249
ab794b6b
ILT
12250 * output.cc
12251 (Output_section::Input_section_sort_entry::has_priority): New
12252 function.
12253 (Output_section::Input_section_sort_entry::match_file_name): New
12254 function.
12255 (Output_section::Input_section_sort_entry::match_section_name):
12256 Remove.
12257 (Output_section::Input_section_sort_entry::match_section_name_prefix):
12258 Remove.
12259 (Output_section::Input_section_sort_entry::match_section_file):
12260 Remove.
12261 (Output_section::Input_section_sort_compare::operator()): Rewrite
12262 using new Input_section_sort_entry functions. Sort crtbegin and
12263 crtend first. Sort sections with no priority before sections with
12264 a priority.
12265 * testsuite/initpri1.c (d3): Check j != 4.
12266 (cd5): New constructor/destructor function.
12267 (main): Check j != 2.
12268
479f6503
ILT
12269 * symtab.cc (Symbol_table::add_from_object): If we don't use the
12270 new symbol when resolving, don't call set_is_default.
12271 * testsuite/ver_test_7.cc: New file.
12272 * testsuite/ver_test_7.sh: New file.
12273 * testsuite/Makefile.am (ver_test_7.so): New target.
12274 (ver_test_7.o): New target.
12275 (check_SCRIPTS): Add ver_test_7.sh.
12276 (check_DATA): Add ver_test_7.syms.
12277 (ver_test_7.syms): New target.
12278
2fd32231
ILT
122792008-03-28 Ian Lance Taylor <iant@google.com>
12280
12281 * layout.cc (Layout::layout): If we see an input section with a
12282 name that needs sorting, set the must_sort flag for the output
12283 section.
12284 (Layout::make_output_section): If the name of the output section
12285 indicates that it might require sorting, set the may_sort flag.
12286 * output.h (Output_section::may_sort_attached_input_sections): New
12287 function.
12288 (Output_section::set_may_sort_attached_input_sections): New
12289 function.
12290 (Output_section::must_sort_attached_input_sections): New
12291 function.
12292 (Output_section::set_must_sort_attached_input_sections): New
12293 function.
12294 (class Output_section): Declare Input_section_sort_entry. Define
12295 Input_section_sort_compare. Declare
12296 sort_attached_input_sections. Add new fields:
12297 may_sort_attached_input_sections_,
12298 must_sort_attached_input_sections_,
12299 attached_input_sections_are_sorted_.
12300 * output.cc (Output_section::Output_section): Initialize new
12301 fields.
12302 (Output_section::add_input_section): Add an entry to
12303 input_sections_ if may_sort or must_sort are true.
12304 (Output_section::set_final_data_size): Call
12305 sort_attached_input_sections if necessary.
12306 (Output_section::Input_section_sort_entry): Define new class.
12307 (Output_section::Input_section_sort_compare::operator()): New
12308 function.
12309 (Output_section::sort_attached_input_sections): New function.
12310 * configure.ac: Check whether the compiler supports constructor
12311 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
12312 * testsuite/initpri1.c: New file.
12313 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
12314 CONSTRUCTOR_PRIORITY.
12315 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
12316 (initpri1_LDFLAGS): New variable.
12317 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12318
18e6b24e
ILT
123192008-03-27 Ian Lance Taylor <iant@google.com>
12320
49bdd526
ILT
12321 * common.cc (Sort_commons::operator): Correct sorting algorithm.
12322 * testsuite/common_test_1.c: New file.
12323 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
12324 (common_test_1_SOURCES): New variable.
12325 (common_test_1_DEPENDENCIES): New variable.
12326 (common_test_1_LDFLAGS): New variable.
12327
18e6b24e
ILT
12328 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
12329 and commons_ correctly when NAME/VERSION does not override
12330 NAME/NULL.
12331 * testsuite/ver_test_6.c: New file.
12332 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
12333 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
12334 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
12335
04bf7072
ILT
123362008-03-26 Ian Lance Taylor <iant@google.com>
12337
5871526f
ILT
12338 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
12339 of an undefined symbol from a version script.
12340 * testsuite/Makefile.am (ver_test_5.so): New target.
12341 (ver_test_5.o): New target.
12342 (check_SCRIPTS): Add ver_test_5.sh.
12343 (check_DATA): Add ver_test_5.syms.
12344 (ver_test_5.syms): New target.
12345 * testsuite/ver_test_5.cc: New file.
12346 * testsuite/ver_test_5.script: New file.
12347 * testsuite/ver_test_5.sh: New file.
12348 * Makefile.in, testsuite/Makefile.in: Rebuild.
12349
04bf7072
ILT
12350 PR gold/5986
12351 Fix problems building gold with gcc 4.3.0.
12352 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
12353 (gold_error_at_location, gold_warning_at_location): Use it.
12354 * configure.ac: Check whether we can compile and use a template
12355 function with a printf attribute.
12356 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
12357 when jumping over bytes.
12358 * object.cc: Instantiate Object::read_section_data.
12359 * debug.h: Include <cstring>
12360 * dwarf_reader.cc: Include <algorithm>
12361 * main.cc: Include <cstring>.
12362 * options.cc: Include <cstring>.
12363 * output.cc: Include <cstring>.
12364 * script.cc: Include <cstring>.
12365 * script.h: Include <string>.
12366 * symtab.cc: Include <cstring> and <algorithm>.
12367 * target-select.cc: Include <cstring>.
12368 * version.cc: Include <string>.
12369 * testsuite/testmain.cc: Include <cstdlib>.
12370 * configure, config.in: Rebuild.
12371
874c5b28
ILT
123722008-03-25 Ian Lance Taylor <iant@google.com>
12373
819d6c3a
ILT
12374 * options.cc: Include "../bfd/bfdver.h".
12375 (options::help): Print bug reporting address.
12376
f4b2c6f5
ILT
12377 * version.cc (print_version): Adjust output for current value of
12378 BFD_VERSION_STRING.
12379
12380 * NEWS: New file.
12381
e96caa79
ILT
12382 * options.cc (options::help): Print list of supported targets.
12383 * target-select.h: Include <vector>.
12384 (class Target_selector): Make machine_, size_, and is_big_endian_
12385 fields const. Add bfd_name_ and instantiated_target_ fields.
12386 (Target_selector::Target_selector): Add bfd_name parameter.
12387 (Target_selector::recognize): Make non-virtual, call
12388 do_recognize.
12389 (Target_selector::recognize_by_name): Make non-virtual, call
12390 do_recognize_by_name.
12391 (Target_selector::supported_names): New function.
12392 (Target_selector::bfd_name): New function.
12393 (Target_selector::do_instantiate_target): New pure virtual
12394 function.
12395 (Target_selector::do_recognize): New virtual function.
12396 (Target_selector::do_recognize_by_name): New virtual function.
12397 (Target_selector::instantiate_target): New private function.
12398 (supported_target_names): Declare.
12399 * target-select.cc (Target_selector::Target_selector): Update for
12400 new parameter and fields.
12401 (select_target_by_name): Check that the name matches before
12402 calling recognize_by_name.
12403 (supported_target_names): New function.
12404 * i386.cc (class Target_selector_i386): Update Target_selector
12405 constructor call. Remove recognize and recognize_by_name. Add
12406 do_instantiate_target.
12407 * x86_64.cc (class Target_selector_x86_64): Likewise.
12408 * testsuite/testfile.cc (class Target_selector_test): Update for
12409 changes to Target_selector.
12410
874c5b28
ILT
12411 * README: Rewrite, with some notes on unsupported features.
12412
0a65a3a7
CC
124132008-03-24 Cary Coutant <ccoutant@google.com>
12414
12415 * i386.cc (Target_i386::Got_type): New enum declaration.
12416 (Target_i386::Scan::local): Updated callers of Output_data_got
12417 member functions.
12418 (Target_i386::Scan::global): Likewise.
12419 (Target_i386::Relocate::relocate): Likewise.
12420 (Target_i386::Relocate::relocate_tls): Likewise.
12421 * object.h (Got_offset_list): New class.
12422 (Sized_relobj::local_has_got_offset): Added got_type parameter.
12423 (Sized_relobj::local_got_offset): Likewise.
12424 (Sized_relobj::set_local_got_offset): Likewise.
12425 (Sized_relobj::local_has_tls_got_offset): Removed.
12426 (Sized_relobj::local_tls_got_offset): Removed.
12427 (Sized_relobj::set_local_tls_got_offset): Removed.
12428 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
12429 * output.cc (Output_data_got::add_global): Added got_type parameter.
12430 (Output_data_got::add_global_with_rel): Likewise.
12431 (Output_data_got::add_global_with_rela): Likewise.
12432 (Output_data_got::add_global_pair_with_rel): New function.
12433 (Output_data_got::add_global_pair_with_rela): New function.
12434 (Output_data_got::add_local): Added got_type parameter.
12435 (Output_data_got::add_local_with_rel): Likewise.
12436 (Output_data_got::add_local_with_rela): Likewise.
12437 (Output_data_got::add_local_pair_with_rel): New function.
12438 (Output_data_got::add_local_pair_with_rela): New function.
12439 (Output_data_got::add_global_tls): Removed.
12440 (Output_data_got::add_global_tls_with_rel): Removed.
12441 (Output_data_got::add_global_tls_with_rela): Removed.
12442 (Output_data_got::add_local_tls): Removed.
12443 (Output_data_got::add_local_tls_with_rel): Removed.
12444 (Output_data_got::add_local_tls_with_rela): Removed.
12445 * output.h (Output_data_got::add_global): Added got_type parameter.
12446 (Output_data_got::add_global_with_rel): Likewise.
12447 (Output_data_got::add_global_with_rela): Likewise.
12448 (Output_data_got::add_global_pair_with_rel): New function.
12449 (Output_data_got::add_global_pair_with_rela): New function.
12450 (Output_data_got::add_local): Added got_type parameter.
12451 (Output_data_got::add_local_with_rel): Likewise.
12452 (Output_data_got::add_local_with_rela): Likewise.
12453 (Output_data_got::add_local_pair_with_rel): New function.
12454 (Output_data_got::add_local_pair_with_rela): New function.
12455 (Output_data_got::add_global_tls): Removed.
12456 (Output_data_got::add_global_tls_with_rel): Removed.
12457 (Output_data_got::add_global_tls_with_rela): Removed.
12458 (Output_data_got::add_local_tls): Removed.
12459 (Output_data_got::add_local_tls_with_rel): Removed.
12460 (Output_data_got::add_local_tls_with_rela): Removed.
12461 * resolve.cc (Symbol::override_base_with_special): Removed
12462 reference to has_got_offset_ field.
12463 * symtab.cc (Symbol::init_fields): Replaced initialization
12464 of got_offset_ with got_offsets_. Removed initialization
12465 of has_got_offset_
53fcba31 12466 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
12467 (Symbol::got_offset): Likewise.
12468 (Symbol::set_got_offset): Likewise.
12469 (Symbol::has_tls_got_offset): Removed.
12470 (Symbol::tls_got_offset): Removed.
12471 (Symbol::set_tls_got_offset): Removed.
12472 (Symbol::got_offset_): Removed.
12473 (Symbol::tls_mod_got_offset_): Removed.
12474 (Symbol::tls_pair_got_offset_): Removed.
12475 (Symbol::got_offsets_): New field.
12476 (Symbol::has_got_offset): Removed.
12477 (Symbol::has_tls_mod_got_offset): Removed.
12478 (Symbol::has_tls_pair_got_offset): Removed.
12479 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
12480 (Target_x86_64::Scan::local): Updated callers of Output_data_got
12481 member functions.
12482 (Target_x86_64::Scan::global): Likewise.
12483 (Target_x86_64::Relocate::relocate): Likewise.
12484 (Target_x86_64::Relocate::relocate_tls): Likewise.
12485
bd52eafb
BE
124862008-03-25 Ben Elliston <bje@au.ibm.com>
12487
12488 * yyscript.y: Fix spelling error in comment.
12489
8b105e34
ILT
124902008-03-24 Ian Lance Taylor <iant@google.com>
12491
8ed814a9
ILT
12492 * options.h (class General_options): Define build_id option.
12493 * layout.h (class Layout): Declare write_build_id, create_note,
12494 create_build_id. Add build_id_note_ member.
12495 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
12496 "libiberty.h", "md5.h", "sha1.h".
12497 (Layout::Layout): Initialize eh_frame_data_,
12498 eh_frame_hdr_section_, and build_id_note_.
12499 (Layout::finalize): Call create_build_id.
12500 (Layout::create_note): New function, broken out of
12501 Layout::create_gold_note.
12502 (Layout::create_gold_note): Call create_note.
12503 (Layout::create_build_id): New function.
12504 (Layout::write_build_id): New function.
12505 (Close_task_runner::run): Call write_build_id.
12506
8b105e34
ILT
12507 * x86_64.cc: Correct license to GPLv3.
12508
086a1841
ILT
125092008-03-23 Ian Lance Taylor <iant@google.com>
12510
12511 * options.cc: Include "demangle.h".
12512 (parse_optional_string): New function.
12513 (parse_long_option): Handle takes_optional_argument.
12514 (parse_short_option): Update dash_z initializer. Handle
12515 takes_optional_argument.
12516 (General_options::General_options): Initialize do_demangle_.
12517 (General_options::finalize): Set do_demangle_. Handle demangling
12518 style.
12519 * options.h (parse_optional_string): Declare.
12520 (struct One_option): Add optional_arg field. Update constructor.
12521 Update call constructor calls. Add takes_optional_argument
12522 function.
12523 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
12524 (DEFINE_optional_string): Define.
12525 (General_options::demangle): Change from DEFINE_bool to
12526 DEFINE_optional_string.
12527 (General_options::no_demangle): New function.
12528 (General_options::do_demangle): New function.
12529 (General_options::set_do_demangle): New function.
12530 (General_options::execstack_status_): Move definition to end of
12531 class definition.
12532 (General_options::static_): Likewise.
12533 (General_options::do_demangle_): New field.
12534 * object.cc (big_endian>::get_symbol_location_info): Call
12535 Options::do_demangle, not Options::demangle.
12536 * symtab.cc (demangle): Likewise.
12537
cbb93e63
ILT
125382008-03-22 Ian Lance Taylor <iant@google.com>
12539
12540 * gold.h: Include <cstddef> and <sys/types.h>
12541 * options.h: Include <cstring>.
12542
ec531623
ILT
125432008-03-21 Ian Lance Taylor <iant@google.com>
12544
12545 * Added source code to GNU binutils.
This page took 0.742261 seconds and 4 git commands to generate.