2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
a869183f
PP
12011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
2
3 PR gold/12640
4 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
5 violation.
6
72011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
8
9 * archive.cc (Archive::include_member): Adjust call to report_object.
10 (Add_archive_symbols::run): Add script_info to call to
11 report_archive_begin.
12 (Lib_group::include_member): Adjust call to report_object.
13 (Add_lib_group_symbols::run): Adjust call to report_object.
14 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
15 blocks. Add object count for script input files.
16 * incremental.cc (Incremental_inputs::report_archive_begin): Add
17 script_info parameter; change all callers.
18 (Incremental_inputs::report_object): Add script_info parameter;
19 change all callers.
20 (Incremental_inputs::report_script): Store backpointer to
21 incremental info entry.
22 (Output_section_incremental_inputs::set_final_data_size): Record
23 additional information for scripts.
24 (Output_section_incremental_inputs::write_info_blocks): Likewise.
25 * incremental.h (Incremental_script_entry::add_object): New function.
26 (Incremental_script_entry::get_object_count): New function.
27 (Incremental_script_entry::get_object): New function.
28 (Incremental_script_entry::objects_): New data member; adjust
29 constructor.
30 (Incremental_inputs::report_archive_begin): Add script_info parameter.
31 (Incremental_inputs::report_object): Add script_info parameter.
32 (Incremental_inputs_reader::get_object_count): New function.
33 (Incremental_inputs_reader::get_object_offset): New function.
34 * options.cc (Input_arguments::add_file): Return reference to
35 new input argument.
36 * options.h (Input_argument::set_script_info): New function.
37 (Input_argument::script_info): New function.
38 (Input_argument::script_info_): New data member; adjust all
39 constructors.
40 (Input_file_group::add_file): Return reference to new input argument.
41 (Input_file_lib::add_file): Likewise.
42 (Input_arguments::add_file): Likewise.
43 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
44 * script.cc (Parser_closure::Parser_closure): Add script_info
45 parameter; adjust all callers.
46 (Parser_closure::script_info): New function.
47 (Parser_closure::script_info_): New data member.
48 (read_input_script): Report scripts earlier to incremental info.
49 (script_add_file): Set script_info in Input_argument.
50 (script_add_library): Likewise.
51 * script.h (Script_options::Script_info): Rewrite class.
52
a869183f 532011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
54
55 * archive.cc (Library_base::should_include_member): Move
56 method here from class Archive.
57 (Archive::Archive): Initialize base class.
58 (Archive::should_include_member): Move to base class.
59 (Archive::do_for_all_unused_symbols): New function.
60 (Add_archive_symbols::run): Remove redundant access to
61 incremental_inputs.
62 (Lib_group::Lib_group): Initialize base class.
63 (Lib_group::do_filename): New function.
64 (Lib_group::include_member): Pass pointer to Lib_group to
65 report_object.
66 (Lib_group::do_for_all_unused_symbols): New function.
67 (Add_lib_group_symbols::run): Report archive information for
68 incremental links.
69 * archive.h (class Library_base): New base class.
70 (class Archive): Derive from Library_base.
71 (Archive::filename): Move to base class.
72 (Archive::set_incremental_info): Likewise.
73 (Archive::incremental_info): Likewise.
74 (Archive::Should_include): Likewise.
75 (Archive::should_include_member): Likewise.
76 (Archive::Armap_entry): Remove.
77 (Archive::Unused_symbol_iterator): Remove.
78 (Archive::unused_symbols_begin): Remove.
79 (Archive::unused_symbols_end): Remove.
80 (Archive::do_filename): New function.
81 (Archive::do_get_mtime): New function.
82 (Archive::do_for_all_unused_symbols): New function.
83 (Archive::task_): Move to base class.
84 (Archive::incremental_info_): Likewise.
85 (class Lib_group): Derive from Library_base.
86 (Lib_group::do_filename): New function.
87 (Lib_group::do_get_mtime): New function.
88 (Lib_group::do_for_all_unused_symbols): New function.
89 (Lib_group::task_): Move to base class.
90 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
91 function.
92 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
93 function.
94 * incremental.cc (Incremental_inputs::report_archive_begin):
95 Use Library_base; call library's get_mtime; add incremental inputs
96 entry before members.
97 (class Unused_symbol_visitor): New class.
98 (Incremental_inputs::report_archive_end): Use Library_base; use
99 visitor class to record unused symbols; don't add incremental inputs
100 entry after members.
101 (Incremental_inputs::report_object): Use Library_base.
102 * incremental.h
103 (Incremental_archive_entry::Incremental_archive_entry): Remove
104 unused Archive parameter.
105 (Incremental_inputs::report_archive_begin): Use Library_base.
106 (Incremental_inputs::report_archive_end): Likewise.
107 (Incremental_inputs::report_object): Likewise.
108 * object.cc (Sized_relobj::do_for_all_global_symbols): New
109 function.
110 * object.h (Object::for_all_global_symbols): New function.
111 (Object::do_for_all_global_symbols): New function.
112 (Sized_relobj::do_for_all_global_symbols): New function.
113 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
114 function.
115 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
116 function.
117
61ab3e40
ILT
1182011-03-27 Ian Lance Taylor <iant@google.com>
119
120 * archive.cc (Archive::interpret_header): Return -1 if something
121 goes wrong. Change callers accordingly.
122
30e1f9e6
CC
1232011-03-25 Cary Coutant <ccoutant@google.com>
124
125 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
126 * testsuite/Makefile.in: Regenerate.
127
9c793f14
RÁE
1282010-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
129
130 * plugin.cc (get_view): New.
131 (Plugin::load): Pass get_view to the plugin.
132 (Plugin_manager::get_view): New.
133
9312bb0a
ILT
1342011-03-21 Ian Lance Taylor <iant@google.com>
135
136 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 137 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 138
7e12ba9e
ST
1392011-03-21 Sriraman Tallam <tmsriram@google.com>
140
141 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
142 Change == to -eq.
143 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
144 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
145 Change == to -eq.
146 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
147 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
148
fd7a005d
ILT
1492011-03-14 Ian Lance Taylor <iant@google.com>
150
151 * script-sections.cc (Sort_output_sections::script_compare):
152 Rename from is_before, change return type.
153 (Sort_output_sections::operator()): Adjust accordingly.
154
ed16fd1b
ILT
1552011-03-11 Jeffrey Yasskin <jyasskin@google.com>
156
157 PR gold/12572
158 * testsuite/odr_violation2.cc: Add comment to make all error line
159 numbers double digits.
160 * testsuite/debug_msg.sh: Adjust expected errors.
161
71ff8986
ILT
1622011-03-09 Jeffrey Yasskin <jyasskin@google.com>
163
164 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
165 but mark earlier ones as non-canonical
166 (offset_to_iterator): Update search target and example
167 (do_addr2line): Return extra lines in a vector*
168 (format_file_lineno): Extract from do_addr2line
169 (one_addr2line): Add vector* out-param
170 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
171 when a lineno entry appeared last for its instruction
172 (Dwarf_line_info): Add vector* out-param
173 * object.cc (Relocate_info): Pass NULL for the vector* out-param
174 * symtab.cc (Odr_violation_compare): Include the lineno in the
175 comparison again.
176 (linenos_from_loc): New. Combine the canonical line for an
177 address with its other lines.
178 (True_if_intersect): New. Helper functor to make
179 std::set_intersection a query.
180 (detect_odr_violations): Compare sets of lines instead of just
181 one line for each function. This became less deterministic, but
182 has fewer false positives.
183 * symtab.h: Declarations.
184 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
185 mix an optimized and non-optimized object in the same binary
186 (odr_violation2.so): Same.
187 * testsuite/Makefile.in: Regenerate from Makefile.am.
188 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
189 * testsuite/debug_msg.sh: Update line numbers and add
190 assertions.
191 * testsuite/odr_violation1.cc: Use OdrDerived, in a
192 non-optimized context.
193 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
194 isn't inlined, and use OdrDerived in an optimized context.
195 * testsuite/odr_header1.h: Defines OdrDerived, where
196 optimization will change the
197 first-instruction-in-the-destructor's file and line number.
198 * testsuite/odr_header2.h: Defines OdrBase.
199
a19fefdc
ILT
2002011-03-09 Ian Lance Taylor <iant@google.com>
201
202 * fileread.cc (File_read::clear_views): Don't delete the whole
203 file view.
204
ecb351e9
ILT
2052011-03-08 Ian Lance Taylor <iant@google.com>
206
207 PR gold/12525
208 * fileread.cc: #include <climits>.
209 (GOLD_IOV_MAX): Define.
210 (File_read::read_multiple): Limit number of entries by iov_max.
211 * fileread.h (class File_read): Always set max_readv_entries to
212 128.
213
b821d13c
ILT
2142011-03-07 Ian Lance Taylor <iant@google.com>
215
216 PR gold/12525
217 * options.h (class General_options): Add -dy and -dn.
218
89243142
CC
2192011-03-02 Cary Coutant <ccoutant@google.com>
220
221 * testsuite/script_test_9.t: Add TLS segment.
222
d0773f31
ILT
2232011-03-02 Simon Baldwin <simonb@google.com>
224
225 * configure.ac: Add check for gnu_indirect_function support in
226 the toolchain building binutils.
227 * configure: Rebuild.
228
badc8139
RÁE
2292010-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
230
231 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
232 plugin only symbols.
233 (Symbol_table::sized_finalize_symbol) Mark symbol only present
234 in plugin files as not needed in the symbol table.
235
4cf7a849
ST
2362011-02-11 Sriraman Tallam <tmsriram@google.com>
237
238 * output.cc (Output_section::add_input_section): Delay fill
239 generation for section ordering.
240
b578bd7d
ILT
2412011-02-09 Ian Lance Taylor <iant@google.com>
242
243 PR gold/12316
244 * object.h (class Sized_relobj): Remove clear_local_symbols.
245 * reloc.cc (Sized_relobj::do_relocate): Don't call
246 clear_local_symbols.
247
84ced98a
RÁE
2482010-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
249
250 * plugin.cc (is_visible_from_outside): Return true for symbols
251 in the -u option.
252
55382fb7
ILT
2532011-02-04 Jeffrey Yasskin <jyasskin@google.com>
254
255 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
256 filename.
257
4e271fff
ST
2582011-02-02 Sriraman Tallam <tmsriram@google.com>
259
260 * icf.h (is_section_foldable_candidate): Change type of parameter
261 to std::string.
262 * icf.cc (Icf::find_identical_sections): Change type of local variable
263 section_name to be std::string.
264 (is_function_ctor_or_dtor): Change type of parameter to std::string.
265
d433c3ac
ILT
2662011-01-25 Ian Lance Taylor <iant@google.com>
267
268 * script.cc (script_add_extern): Rewrite to use
269 add_symbol_reference.
270
880473a6
DK
2712011-01-25 Doug Kwan <dougkwan@google.com>
272
d433c3ac 273 * icf.cc (get_section_contents): Always lock section's object.
880473a6 274
f30f86fa
ILT
2752011-01-24 Ian Lance Taylor <iant@google.com>
276
277 * options.h (class General_options): Accept
278 --no-detect-odr-violations.
279
8e51a0b9
ILT
2802011-01-24 Ian Lance Taylor <iant@google.com>
281
282 * version.cc (version_string): Bump to 1.11.
283
0f3b89d8
ILT
2842011-01-24 Ian Lance Taylor <iant@google.com>
285
286 * plugin.cc (class Plugin_rescan): Define new class.
287 (Plugin_manager::claim_file): Set any_claimed_.
288 (Plugin_manager::save_archive): New function.
289 (Plugin_manager::save_input_group): New function.
290 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
291 necessary.
292 (Plugin_manager::new_undefined_symbol): New function.
293 (Plugin_manager::rescan): New function.
294 (Plugin_manager::rescannable_defines): New function.
295 (Plugin_manager::add_input_file): Set any_added_.
296 * plugin.h (class Plugin_manager): define new fields rescannable_,
297 undefined_symbols_, any_claimed_, and any_added_. Declare
298 Plugin_rescan as friend. Declare new functions.
299 (Plugin_manager::Rescannable): Define type.
300 (Plugin_manager::Rescannable_list): Define type.
301 (Plugin_manager::Undefined_symbol_list): Define type.
302 (Plugin_manager::Plugin_manager): Initialize new fields.
303 * archive.cc (Archive::defines_symbol): New function.
304 (Add_archive_symbols::run): Pass archive to plugins if any.
305 * archive.h (class Archive): Declare defines_symbol.
306 * readsyms.cc (Input_group::~Input_group): New function.
307 (Finish_group::run): Pass input_group to plugins if any.
308 * readsyms.h (class Input_group): Declare destructor.
309 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
310 any.
311
3bb951e5
ILT
3122011-01-10 Ian Lance Taylor <iant@google.com>
313
314 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
315 section as relro.
316 (Layout::set_segment_offsets): Reset increase_relro before calling
317 set_section_addresses a second time.
318
0aa45fac
CC
3192011-01-04 Cary Coutant <ccoutant@google.com>
320
321 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
322 sections before NOBITS sections.
323
0db46eb4
L
3242011-01-01 H.J. Lu <hongjiu.lu@intel.com>
325
326 * version.cc (print_version): Update copyright to 2011.
327
829c9745
CC
3282010-12-23 Cary Coutant <ccoutant@google.com>
329
330 * output.h (Output_data_reloc::add_output_section): Pass OD instead
331 of OS to this->add. Add OD parameter to second form of the function.
332
7500420b
ILT
3332010-12-20 Ian Lance Taylor <iant@google.com>
334
335 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
336 second of two consecutive entries with same offset.
337
f8e9a930
RW
3382010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
339
340 * testsuite/Makefile.am (ifuncmain2static_LDADD)
341 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
342 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
343 to avoid unneeded links against $(LDADD).
344 * testsuite/Makefile.in: Regenerate.
345
2fbb4320
ILT
3462010-12-15 Ian Lance Taylor <iant@google.com>
347
348 PR gold/12324
349 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
350 for R_X86_64_32 and R_X86_64_PC32.
351 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
352 ver_matching_def_pic.o.
353 (ver_matching_def_pic.o): New target.
354
fedb228d
RW
3552010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
356
357 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
358 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
359 Move definition before File_read::View member definitions.
360 (File_read::View::~View): Initialize and hold lock before
361 updating current_mapped_bytes.
362
9b547ce6
RW
3632010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
364
365 * dwarf_reader.cc: Remove outdated comment.
366 * gold-threads.cc: Fix typo in error message.
367 * archive.cc: Fix typos in comments.
368 * archive.h: Likewise.
369 * arm-reloc-property.cc: Likewise.
370 * arm-reloc-property.h: Likewise.
371 * arm-reloc.def: Likewise.
372 * arm.cc: Likewise.
373 * attributes.h: Likewise.
374 * cref.cc: Likewise.
375 * ehframe.cc: Likewise.
376 * fileread.h: Likewise.
377 * gold.h: Likewise.
378 * i386.cc: Likewise.
379 * icf.cc: Likewise.
380 * incremental.h: Likewise.
381 * int_encoding.cc: Likewise.
382 * layout.h: Likewise.
383 * main.cc: Likewise.
384 * merge.h: Likewise.
385 * object.cc: Likewise.
386 * object.h: Likewise.
387 * options.cc: Likewise.
388 * readsyms.cc: Likewise.
389 * reduced_debug_output.cc: Likewise.
390 * reloc.cc: Likewise.
391 * script-sections.cc: Likewise.
392 * sparc.cc: Likewise.
393 * symtab.h: Likewise.
394 * target-reloc.h: Likewise.
395 * target.cc: Likewise.
396 * target.h: Likewise.
397 * timer.cc: Likewise.
398 * timer.h: Likewise.
399 * x86_64.cc: Likewise.
400
83e17bd5
CC
4012010-12-09 Cary Coutant <ccoutant@google.com>
402
403 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
404 stack.
405 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
406 parameter; change all callers.
407 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
408 * options.h (warn_execstack): New option.
409
017257f8
DK
4102010-12-07 Doug Kwan <dougkwan@google.com>
411
412 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
413 like function call relocations.
414
c20cbc06
ILT
4152010-12-07 Ian Lance Taylor <iant@google.com>
416
417 * archive.cc (Archive::get_elf_object_for_member): Permit
418 punconfigured to be NULL.
419 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
420 (Archive::include_member): Pass NULL to get_elf_object_for_member
421 if we searched for the archive and this is the first included
422 object.
423
4dbfafcc
ILT
4242010-12-01 Ian Lance Taylor <iant@google.com>
425
426 * dwarf_reader.h (class Sized_dwarf_line_info): Add
427 track_relocs_type_ field.
428 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
429 Set track_relocs_type_.
430 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
431 contents when using RELA relocs.
432 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
433 reloc_map_.
434 * reloc.cc (Track_relocs::next_addend): New function.
435 * reloc.h (class Track_relocs): Declare next_addend.
436
e5e19edd
ILT
4372010-12-01 Ian Lance Taylor <iant@google.com>
438
439 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
440 virtual destructor.
441
9a5ce24c
ILT
4422010-12-01 Ian Lance Taylor <iant@google.com>
443
444 * README: Update compilers known to work and fail.
445
c7791212
NC
4462010-11-23 Matthias Klose <doko@ubuntu.com>
447
448 * configure.in: For --enable-gold, handle value `default' instead of
449 `both*'. Always install ld as ld.bfd, install as ld if gold is
450 not the default.
451 * configure: Regenerate.
452
0ad220c9
DK
4532010-11-18 Doug Kwan <dougkwan@google.com>
454
455 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
456 and right_alignment to be zero. Store result alignment only if it is
457 greater than existing alignment.
458
ab8056e0
CC
4592010-11-16 Cary Coutant <ccoutant@google.com>
460
461 PR gold/12220
462 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
463 Check for ".zdebug_line".
464
fd064a5b
CC
4652010-11-16 Doug Kwan <dougkwan@google.com>
466 Cary Coutant <ccoutant@google.com>
467
468 * output.h (Output_segment::set_section_addresses): Pass increase_relro
469 by reference; adjust all callers.
470 * output.cc (Output_segment::set_section_addresses): Adjust references
471 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
472 list is empty.
473 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
474 end at page boundary.
475
6fc6ea19
CC
4762010-11-16 Cary Coutant <ccoutant@google.com>
477
478 PR gold/12220
479 * layout.cc (Layout::choose_output_section): Transform names of
480 compressed sections even when using a script with a SECTIONS clause.
481 (Layout::output_section_name): Remove code to transform
482 compressed debug section names.
483 * output.cc (Output_section::add_input_section): Use uncompressed
484 section size when tracking input sections.
485
95a2c8d6
RS
4862010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
487
488 * symtab.h (Symbol::NON_PIC_REF): Remove.
489 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
490 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
491 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
492 (Symbol::use_plt_offset): Take a flags argument and pass it
493 directly to needs_dynamic_reloc. Restrict check for undefined
494 weak symbols to function calls.
495 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
496 (Target_arm::Scan::global): Use it.
497 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
498 (Target_arm::Relocate::relocate): Likewise.
499 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
500 parameter with an r_type parameter. Use get_reference_flags
501 to get the flags.
502 (Target_arm::Relocate::relocate): Update accordingly.
503 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
504 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
505 (Target_i386::Scan::global): Likewise.
506 (Target_i386::Relocate::relocate): Likewise.
507 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
508 parameter with an r_type parameter. Use get_reference_flags
509 to get the flags.
510 (Target_i386::Relocate::relocate): Update accordingly.
511 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
512 (Target_powerpc::Scan::global): Use it.
513 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
514 (Target_powerpc::Relocate::relocate): Likewise.
515 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
516 (Target_sparc::Scan::global): Use it.
517 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
518 (Target_sparc::Relocate::relocate): Likewise.
519 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
520 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
521 (Target_x86_64::Scan::global): Likewise.
522 (Target_x86_64::Relocate::relocate): Likewise.
523
f625ae50
DK
5242010-11-08 Doug Kwan <dougkwan@google.com>
525 Cary Coutant <ccoutant@google.com>
526
527 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
528 (Arm_exidx_merge_section::section_contents_): New data member.
529 (Arm_input_section::Arm_input_section): Initialize original_contents_.
530 (Arm_input_section::~Arm_input_section): De-allocate memory.
531 (Arm_input_section::original_contents_): New data member.
532 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
533 in parameters instead of calling Object::section_contents without
534 locking.
535 (Arm_output_section::group_section): New parameter TASK. Pass it
536 to callees that need locking objects.
537 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
538 to lock EXIDX input sections. Fix a formatting issue. Call
539 Arm_exidx_merged_section::build_contents to create merged section
540 contents.
541 (Arm_output_section::create_stub_group): New parameter TASK. Use it
542 to lock object of stub table owner.
543 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
544 TEXT_SIZE to initialize data member TEXT_SIZE_.
545 (Arm_exidx_input_section::addralign): Fix typo in comment.
546 (Arm_exidx_input_section::text_size): New method.
547 (Target_arm::do_relax): New parameter TASK. Pass it to callees
548 that require locking objects. Lock objects before scanning for stubs
549 and updating local symbols.
550 (Arm_input_section<big_endian>::init): Copy contents of original
551 input section.
552 (Arm_input_section<big_endian>::do_write): Use saved contents of
553 original input section instead of calling Object::section_contents
554 without locking.
555 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
556 size without calling Object::section_size().
557 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
558 for size. Allocate a buffer for merged EXIDX entries.
559 (Arm_exidx_merged_section::build_contents): New method.
560 (Arm_exidx_merged_section::do_write): Move merge section contents
561 building code to Arm_exidx_merged_section::build_contetns. Write
562 out contetns in buffer instead of building it on the fly.
563 (Arm_relobj::make_exidx_input_section): Also pass text section size
564 to Arm_exidx_input_section constructor.
565 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
566 (Arm_dynobj::do_read_symbols): Fix memory leak.
567 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
568 * target.h: (class Task): Add forward declaration.
569 (Target::relax): Add new parameter TASK and pass it to
570 Target::do_relax().
571 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
572
5f9bcf58
CC
5732010-11-05 Cary Coutant <ccoutant@google.com>
574
575 PR gold/10708
576 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
577 object when reading from the file.
578 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
579 second layout pass.
580 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
581 when reading section contents.
582 (get_section_contents): Likewise.
583 (icf::find_identical_sections): Likewise.
584 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
585 object when reading from the file.
586 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
587 the object when doing deferred section layout.
588
e597fa08
NC
5892010-11-03 Nick Clifton <nickc@redhat.com>
590
591 PR gold/12001
592 * script.h (class Symbol_assignment: name): New member. Returns
593 the name of the symbol.
594 * scrfipt.cc (Script_options::is_pending_assignment): New member.
595 Returns true if the given symbol name is on the list of
596 assignments wating to be processed.
597 * archive.cc (should_incldue_member): If the symbol is undefined,
598 check to see if it is on the list of symbols pending assignment.
599
3f9a3278
ILT
6002010-11-03 Ryan Mansfield <rmansfield@qnx.com>
601
602 * script-sections.cc (Script_sections::find_memory_region): Check
603 for a NULL output section pointer.
604
d06fb4d1
DK
6052010-10-29 Doug Kwan <dougkwan@google.com>
606
607 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
608 Output_section::add_relaxed_input_section.
609 * output.cc (Output_section::add_relaxed_input_section): Add new
610 arguments LAYOUT and NAME. Set section order index.
611 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
612 Copy section order index.
613 * output.h (Output_section::add_relaxed_input_section): Add new
614 arguments LAYOUT and NAME.
615
90e24de5
ILT
6162010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
617
618 * testsuite/Makefile.am: Move gcctestdir/ld rule to
619 NATIVE_OR_CROSS_LINKER.
620 * testsuite/Makefile.in: Regenerate.
621
c9484ea5
DK
6222010-10-20 Doug Kwan <dougkwan@google.com>
623
624 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
625 without SHF_LINK_ORDER flags.
626 * layout.cc (Layout::choose_output_section): Do not filter
627 SHF_LINK_ORDER flag in a relocatable link.
628
5bc2f5be
CC
6292010-10-17 Cary Coutant <ccoutant@google.com>
630
631 * output.h (Output_segment::set_section_addresses): Change function
632 signature. Update all callers.
633 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
634 sections.
635 (Output_segment::set_section_addresses): Align after last TLS
636 section. Add padding before last relro section instead of after.
637
0c91cf04
DK
6382010-10-17 Doug Kwan <dougkwan@google.com>
639
640 * gold/arm.cc (Target_arm::got_section): Use correct order and set
641 GOT output section to be writable.
642
8c21d9d3
CC
6432010-10-14 Cary Coutant <ccoutant@google.com>
644
645 * debug.h (DEBUG_INCREMENTAL): New flag.
646 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
647 * gold.cc (queue_initial_tasks): Check parameters for incremental link
648 mode.
649 * incremental.cc (report_command_line): Ignore all forms of
650 --incremental.
651 * layout.cc (Layout::Layout): Check parameters for incremental link
652 mode.
653 * options.cc (General_options::parse_incremental): New function.
654 (General_options::parse_no_incremental): New function.
655 (General_options::parse_incremental_full): New function.
656 (General_options::parse_incremental_update): New function.
657 (General_options::incremental_mode_): New data member.
658 (General_options::finalize): Check incremental_mode_.
659 * options.h (General_options): Update help text for --incremental.
660 Add --no-incremental, --incremental-full, --incremental-update.
661 (General_options::Incremental_mode): New enum type.
662 (General_options::incremental_mode): New function.
663 (General_options::incremental_mode_): New data member.
664 * parameters.cc (Parameters::incremental_mode_): New data member.
665 (Parameters::set_options): Set incremental_mode_.
666 (Parameters::set_incremental_full): New function.
667 (Parameters::incremental): New function.
668 (Parameters::incremental_update): New function.
669 (set_parameters_incremental_full): New function.
670 * parameters.h (Parameters::set_incremental_full): New function.
671 (Parameters::incremental): New function.
672 (Parameters::incremental_update): New function.
673 (Parameters::incremental_mode_): New data member.
674 (set_parameters_incremental_full): New function.
675 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
676 incremental link mode.
677 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
678 (Sized_relobj::do_relocate_sections): Likewise.
679 * testsuite/Makefile.am (incremental_test): Use --incremental-full
680 option.
681 * testsuite/Makefile.in: Regenerate.
682 * testsuite/incremental_test.sh: Filter all forms of --incremental.
683
bb32aa18 6842010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
685
686 * script-sections.h (class Script_sections): Make
687 Sections_elements typedef public.
688 * script-sections.cc (class Sort_output_sections): Add elements_
689 field. Add constructor which sets it; change all callers.
690 (Sort_output_sections::is_before): New function.
691 (Sort_output_sections::operator()): Call is_before.
692 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
693 conditional.
694 * testsuite/script_test_10.sh: New test. Test script section
695 order.
696 * testsuite/script_test_10.t: Likewise.
697 * testsuite/script_test_10.s: Likewise.
698 * testsuite/Makefile.am: Wrap the cross linker tests and the
699 common tests into NATIVE_OR_CROSS_LINKER.
700 (check_SCRIPTS): Add script_test_10.sh.
701 (check_DATA): Add script_test_10.stdout.
702 (script_test_10.o, script_test_10): New targets.
703 (script_test_10.stdout): New target.
704 * configure, testsuite/Makefile.in: Regenerate.
705
3cef7179
ILT
7062010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
707
708 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
709 error for the deprecated relocations.
710 (Target_arm::Scan::global): Likewise.
711 (Target_arm::Relocate::relocate): Likewise.
712
7411e9a8
RS
7132010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
714
715 * fileread.cc (Input_file::find_file): Initialize *found_name
716 and *namep when using the fallback search for case 4.
717
6a9da32a
CC
7182010-10-11 Cary Coutant <ccoutant@google.com>
719
720 * options.h (class General_options): Redefine -z lazy as an alias for
721 the negation of -z now.
722
ac897c20
ILT
7232010-10-11 Ian Lance Taylor <iant@google.com>
724
725 * resolve.cc (symbol_to_bits): Report the value of the unsupported
726 binding.
727
ea5cae92
NC
7282010-10-06 Nick Clifton <nickc@redhat.com>
729
730 * script-sections.cc(class Memory_region): Remove
731 current_lma_offset_ field. Rename current_vma_offset_ to
732 current_offset_. Add last_section_ field.
733 (Memory_region::get_current_vma_address): Rename to
734 get_current_address.
735 (Memory_region::get_current_lma_address): Delete.
736 (Memory_region::increment_vma_offset): Rename to
737 increment_offset.
738 (Memory_region::increment_lma_offset): Delete.
739 (Memory_region::attributes_compatible): New method. Returns
740 true if the provided section is compatible with the region.
741 (Memory_region::get_last_section): New method. Returns the last
742 section to use the region.
743 (Memory_region::set_last_section): New method. Stores the last
744 section to use the region.
745 (Script_sections::block_in_region): New method. Returns true if
746 a block of memory is contained within a region.
747 (Script_sections::find_memory_region): New method. Locates a
748 memory region to be used to set a VMA or LMA address.
749 (Output_section_definition::set_section_addresses): Add code to
750 check for addresses set by memory regions.
751 (Output_segment::set_section_addresses): Remove memory region
752 walking code.
753 (Script_sections::create_segment): Add a warning if a header
754 segment is created outside of any region.
755 * script-sections.h (class Script_sections): Add prototypes for
756 find_memory_region and block_in_region methods.
757 * testsuite/memory_test.s: Use .long instead of .word.
758 * testsuite/memory_test.t: Add some more output sections.
759 * testsuite/memory_test.sh: Update expected output.
760
a9bfd952
DK
7612010-10-02 Doug Kwan <dougkwan@google.com>
762
763 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
764 defintion to symtab.h
765 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
766 declaration to defintion.
767
bacff3ab
NC
7682010-10-01 Nick Clifton <nickc@redhat.com>
769
770 * expression.cc (eval): Replace dummy argument with NULL.
771 (eval_maybe_dot): Check for a NULL result section pointer.
772 (Symbol_expression::value): Likewise.
773 (Dot_expression::value): Likewise.
774 (BINARY_EXPRESSION): Likewise.
775 (Max_expression::value): Likewise.
776 (Min_expression::value): Likewise.
777 (Absolute_expression::value): Likewise.
778 (Addr_expression::value_from_output_section): Likewise.
779 (Loaddddr_expression::value_from_output_section): Likewise.
780 (Segment_start_expression::value): Likewise.
781 * script-sections.cc
782 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
783 argument with NULL.
784 (Sections_elememt_dot_assignment::set_section_addresses):
785 Likewise.
786 (Output_data_expression::do_write_to_buffer): Likewise.
787 (Output_section_definition::finalize_symbols): Likewise.
788 (Output_section_definition::set_section_addresses): Likewise.
789
f81bc8b5
DK
7902010-09-30 Doug Kwan <dougkwan@google.com>
791
792 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
793
c95e9f27
ST
7942010-09-28 Sriraman Tallam <tmsriram@google.com>
795
796 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 797 function.
c95e9f27
ST
798 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
799 virtual function.
800 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
801 virtual function.
802 * icf.cc (get_section_contents): Inline merge sections only when
803 target allows it.
804
3cac54d2
RW
8052010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
806
807 * configure: Regenerate.
808
2904037a
ILT
8092010-09-17 Ian Lance Taylor <iant@google.com>
810
811 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
812 * testsuite/Makefile.am (memory_test.o): New target.
813 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
814 memory_test.t.
815 * testsuite/Makefile.in: Rebuild.
2904037a 816
bca7fb63
DK
8172010-09-17 Doug Kwan <dougkwan@google.com>
818
819 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
820 defintion if relocation uses GOT entries of the symbol.
821 * testsuite/icf_safe_test.sh: Fix test.
822 * testsuite/icf_safe_so_test.sh: Fix test.
823
4ef28648
CC
8242010-09-16 Cary Coutant <ccoutant@google.com>
825
826 * script_sections.cc (class Memory_region): Remove "NULL" from
827 vector initializations.
828
793990de
CC
8292010-09-15 Cary Coutant <ccoutant@google.com>
830
831 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
832 Resolve forwarding symbols.
833
81e015e2
DK
8342010-09-15 Doug Kwan <dougkwan@google.com>
835
836 * gold/testsuite/script_test_3.t: Add ARM special sections.
837 * gold/testsuite/script_test_4.t: Same.
838 * gold/testsuite/script_test_5.t: Same.
839 * gold/testsuite/script_test_6.t: Same.
840 * gold/testsuite/script_test_7.t: Same.
841 * gold/testsuite/script_test_7.t: Same.
842 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
843
36171d64
CC
8442010-09-14 Cary Coutant <ccoutant@google.com>
845
846 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
847 (Target_x86_64::Relocate::relocate_tls): Replace check for
848 saw_tls_block_reloc_ with test for executable section.
849
d89051bd
CC
8502010-09-12 Cary Coutant <ccoutant@google.com>
851
852 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
853 position-independent executables to shared libraries need dynamic
854 relocations.
855 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
856 position-independent executables.
857 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
858 * testsuite/Makefile.in: Regenerate.
859
fca41f0f
NC
8602010-09-10 Nick Clifton <nickc@redhat.com>
861
862 PR gold/11997
863 * testsuite/memory_test.t: Discard any sections that are not
864 needed.
865
6695e4b3
L
8662010-09-09 H.J. Lu <hongjiu.lu@intel.com>
867
868 PR gold/11996
869 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
870 "This::" to work around a bug in gcc 4.2.
871
872 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
873
0f72bf6f
RÁE
8742010-09-09 Rafael Espindola <espindola@google.com>
875
876 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
877 sections with different PF_X flags in the same segment.
878 (Layout::find_first_load_seg): Search all segments to find the first
879 one.
880 * options.h (rosegment): New.
881
8822010-09-08 Rafael Espindola <espindola@google.com>
a6577478 883
05a79166 884 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 885
aa98ff75
DK
8862010-09-08 Doug Kwan <dougkwan@google.com>
887
888 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
889 (Arm_relobj::do_relocate_sections): Add new parameter for output
890 file to match the parent.
891 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
892 of local symbols instead of input values. Update code to track
893 changes in gold::relocate_section.
894 * object.cc (Sized_relobj::compute_final_local_value): New methods.
895 (Sized_relobj::compute_final_local_value_internal): New methods.
896 (Sized_relobj::do_finalize_local_symbols): Move code from loop
897 body into private version of Sized_relobj::compute_final_local_value.
898 Call the inline method.
899 * object.h (Symbol_value::Symbol_value): Define destructor. Free
900 merged symbol value if there is one.
901 (Symbol_value::has_output_value): New method defintiion.
902 (Sized_relobj::Compute_final_local_value_status): New enum type.
903 (Sized_relobj::compute_final_local_value): New methods.
904 (Sized_relobj::compute_final_local_value_internal): New methods.
905 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
906 and arm_cortex_a8.sh.
907 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
908 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
909 New tests.
910 * Makefile.in: Regenerate.
911 * testsuite/arm_bl_out_of_range.s: Update test.
912 * testsuite/thumb_bl_out_of_range.s: Ditto.
913 * testsuite/thumb_blx_out_of_range.s: Ditto.
914 * testsuite/arm_branch_out_of_range.sh: New file.
915 * testsuite/arm_cortex_a8.sh: Ditto.
916 * testsuite/arm_cortex_a8_b.s: Ditto.
917 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
918 * testsuite/arm_cortex_a8_b_local.s: Ditto.
919 * testsuite/arm_cortex_a8_bl.s: Ditto.
920 * testsuite/arm_cortex_a8_blx.s: Ditto.
921 * testsuite/arm_cortex_a8_local.s: Ditto.
922 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
923 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
924
05a79166
L
9252010-09-08 Rafael Espindola <espindola@google.com>
926
927 * Makefile.am (memory_test.stdout): Run readelf with -W.
928 * Makefile.in: Regenerate.
929 * testsuite/memory_test.sh: Make the regexps accept both 32 and
930 64 bit output.
931
33dbc701
RÁE
9322010-09-08 Rafael Espindola <espindola@google.com>
933
934 * script-sections.cc (Script_sections::add_memory_region): Convert
935 field precision to int.
936 * script.cc (script_set_section_region, script_set_section_region):
937 Convert field precision to int.
938
731ca54a
RÁE
9392010-09-08 Rafael Espindola <espindola@google.com>
940
941 * arm.cc (do_finalize_sections): Create the __exidx_start and
942 __exdix_end symbols even when the section is missing.
943
7f8cd844
NC
9442010-09-08 Nick Clifton <nickc@redhat.com>
945
946 * README: Remove claim that MEMORY is not supported.
947 * expression.cc (script_exp_function_origin)
948 (script_exp_function_length): Move from here to ...
949 * script.cc: ... here.
950 (script_set_section_region, script_add_memory)
951 (script_parse_memory_attr, script_include_directive): New
952 functions.
953 * script-sections.cc
954 (class Memory_region): New class.
955 (class Output_section_definition): Add set_memory_region,
956 set_section_vma, set_section_lma and get_section_name methods.
957 (class Script_Sections): Add add_memory_region,
958 find_memory_region, find_memory_region_origin,
959 find_memory_region_length and set_memory_region methods.
960 Have set_section_addresses method walk the list of set memory
961 regions.
962 Extend the print methos to display memory regions.
963 * script-sections.h: Add prototypes for new methods.
964 Add enum for MEMORY region attributes.
965 * yyscript.y: Add support for parsing MEMORY regions.
966 * script-c.h: Add prototypes for new functions.
967 * testsuite/Makefile.am: Add test of MEMORY region functionality.
968 * testsuite/Makefile.in: Regenerate.
969 * testsuite/memory_test.sh: New script.
970 * testsuite/memory_test.s: New assembler source file.
971 * testsuite/memory_test.t: New linker script.
972
a4649286
DK
9732010-08-27 Doug Kwan <dougkwan@google.com>
974
975 * gold/resolve.cc (Symbol_table::should_override): Let a weak
976 reference override an existing dynamic weak reference.
977 * testsuite/Makefile.am: Add new test dyn_weak_ref.
978 * testsuite/Makefile.in: Regenerate.
979 * testsuite/dyn_weak_ref.sh: New file.
980 * testsuite/dyn_weak_ref_1.c: Ditto.
981 * testsuite/dyn_weak_ref_2.c: Ditto.
982
b56648ad
ILT
9832010-08-27 Ian Lance Taylor <iant@google.com>
984
985 * incremental.h (class Incremental_input_entry): Add virtual
986 destructor.
987
809313cb
ILT
9882010-08-27 Ian Lance Taylor <iant@google.com>
989
990 * testsuite/start_lib_test_3.c: Mark t3 as used.
991
11e32464
NC
9922010-08-27 Nick Clifton <nickc@redhat.com>
993
994 * options.cc (version_script): Fix small typo in previous
995 whitespace tidyup.
996
ca09d69a
NC
9972010-08-25 Nick Clifton <nickc@redhat.com>
998
999 * archive.cc: Formatting fixes: Remove whitespace between
1000 typename and following asterisk. Remove whitespace between
1001 function name and opening parenthesis.
1002 * archive.h: Likewise.
1003 * arm.cc: Likewise.
1004 * attributes.cc: Likewise.
1005 * attributes.h: Likewise.
1006 * common.cc: Likewise.
1007 * copy-relocs.cc: Likewise.
1008 * dirsearch.h: Likewise.
1009 * dynobj.cc: Likewise.
1010 * ehframe.cc: Likewise.
1011 * ehframe.h: Likewise.
1012 * expression.cc: Likewise.
1013 * fileread.cc: Likewise.
1014 * fileread.h: Likewise.
1015 * gc.h: Likewise.
1016 * gold-threads.cc: Likewise.
1017 * gold.cc: Likewise.
1018 * i386.cc: Likewise.
1019 * icf.h: Likewise.
1020 * incremental-dump.cc: Likewise.
1021 * incremental.cc: Likewise.
1022 * layout.cc: Likewise.
1023 * layout.h: Likewise.
1024 * main.cc: Likewise.
1025 * merge.cc: Likewise.
1026 * merge.h: Likewise.
1027 * object.cc: Likewise.
1028 * object.h: Likewise.
1029 * options.cc: Likewise.
1030 * options.h: Likewise.
1031 * output.cc: Likewise.
1032 * output.h: Likewise.
1033 * plugin.cc: Likewise.
1034 * plugin.h: Likewise.
1035 * powerpc.cc: Likewise.
1036 * reloc.cc: Likewise.
1037 * script-c.h: Likewise.
1038 * script-sections.cc: Likewise.
1039 * script.cc: Likewise.
1040 * stringpool.cc: Likewise.
1041 * symtab.cc: Likewise.
1042 * symtab.h: Likewise.
1043 * target.cc: Likewise.
1044 * timer.cc: Likewise.
1045 * timer.h: Likewise.
1046 * version.cc: Likewise.
1047 * x86_64.cc: Likewise.
1048
b8fa8750
NC
10492010-08-24 Nick Clifton <nickc@redhat.com>
1050
1051 PR 11899
1052 * layout.cc (segment_precedes): Sort segments by their physical
1053 addresses, if they have been set.
1054
9919d93b
CC
10552010-08-23 Cary Coutant <ccoutant@google.com>
1056
1057 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
1058 symbols data.
1059 (Lib_group::include_member): Unlock object after deleting its
1060 symbols data.
1061 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
1062 the bug fixed here.
1063
97b4be1c
CC
10642010-08-19 Neil Vachharajani <nvachhar@google.com>
1065 Cary Coutant <ccoutant@google.com>
1066
1067 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
1068 constructor, and set_blocker.
1069 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
1070 readsyms_blocker_.
1071 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
1072 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
1073 * testsuite/Makefile.am (start_lib_test): New test case.
1074 * testsuite/Makefile.in: Regenerate.
1075 * testsuite/start_lib_test_main.c: New file.
1076 * testsuite/start_lib_test_1.c: New file.
1077 * testsuite/start_lib_test_2.c: New file.
1078 * testsuite/start_lib_test_3.c: New file.
1079
dd0b1884
ILT
10802010-08-19 Ian Lance Taylor <iant@google.com>
1081
1082 * Makefile.in: Rebuild with automake 1.11.1.
1083 * aclocal.m4: Likewise.
1084 * testsuite/Makefile.in: Likewise.
1085
7223e9ca
ILT
10862010-08-19 Ian Lance Taylor <iant@google.com>
1087
1088 PR 10893
1089 * i386.cc (class Output_data_plt_i386): Update declarations.
1090 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
1091 local_ifuncs_ fields.
1092 (Target_i386::do_plt_section_for_global): New function.
1093 (Target_i386::do_plt_section_for_local): New function.
1094 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
1095 parameter; change all callers. Initialize global_ifuncs_ and
1096 local_ifuncs_. If doing a static link define __rel_iplt_start and
1097 __rel_iplt_end.
1098 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
1099 (Output_data_plt_i386::add_local_ifunc_entry): New function.
1100 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
1101 symbols.
1102 (Target_i386::make_plt_section): New function, broken out of
1103 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
1104 (Target_i386::make_plt_entry): Call make_plt_section.
1105 (Target_i386::make_local_ifunc_plt_entry): New function.
1106 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
1107 (Target_i386::Scan::local): Handle IFUNC symbols. Add
1108 R_386_IRELATIVE to switch.
1109 (Target_i386::Scan::global): Likewise.
1110 (Target_i386::Relocate::relocate): Likewise.
1111 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
1112 switch.
1113 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
1114 (Target_x86_64::do_plt_section_for_global): New function.
1115 (Target_x86_64::do_plt_section_for_local): New function.
1116 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
1117 parameter; change all callers. If doing a static link define
1118 __rela_iplt_start and __rela_iplt_end.
1119 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
1120 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
1121 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
1122 to point to .plt.
1123 (Target_x86_64::make_local_ifunc_plt_entry): New function.
1124 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
1125 switch.
1126 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
1127 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
1128 R_X86_64_IRELATIVE to switch.
1129 (Target_x86_64::Scan::global): Likewise.
1130 (Target_x86_64::Relocate::relocate): Likewise.
1131 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
1132 switch.
1133 * target.h (class Target): Add plt_section_for_global and
1134 plt_section_for_local functions. Add do_plt_section_for_global
1135 and do_plt_section_for_local virtual functions.
1136 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
1137 clarifying comments.
1138 (Symbol::use_plt_offset): Handle IFUNC symbol.
1139 * object.cc (Sized_relobj::Sized_relobj): Initialize
1140 local_plt_offsets_.
1141 (Sized_relobj::local_has_plt_offset): New function.
1142 (Sized_relobj::local_plt_offset): New function.
1143 (Sized_relobj::set_local_plt_offset): New function.
1144 (Sized_relobj::do_count): Handle IFUNC symbol.
1145 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
1146 a bit away from input_shndx_ field. Add set_is_func_symbol and
1147 is_ifunc_symbol functions.
1148 (class Sized_relobj): Update declarations. Remove Tls_got_entry
1149 and Local_tls_got_offsets. Define Local_plt_offsets. Add
1150 local_plt_offsets_ field.
1151 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
1152 * output.h (class Output_section_data): Add non-const
1153 output_section function.
1154 (class Output_data_got): Update declarations.
1155 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
1156 Add use_plt_offset parameter to global and local constructors.
1157 Change all callers. Change local_sym_index_ field to 31 bits.
1158 Change GSYM_CODE and CONSTANT_CODE accordingly.
1159 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
1160 doing a static link don't set sh_link field.
1161 (Output_data_got::Got_entry::write): Use PLT offset if
1162 appropriate.
1163 (Output_data_got::add_global_plt): New function.
1164 (Output_data_got::add_local_plt): New function.
1165 * target-reloc.h (relocate_section): Handle IFUNC symbol.
1166 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
1167 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
1168 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
1169 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
1170 IFUNC conditional.
1171 * testsuite/ifunc-sel.h: New file.
1172 * testsuite/ifuncmain1.c: New file.
1173 * testsuite/ifuncmain1vis.c: New file.
1174 * testsuite/ifuncmod1.c: New file.
1175 * testsuite/ifuncdep2.c: New file.
1176 * testsuite/ifuncmain2.c: New file.
1177 * testsuite/ifuncmain3.c: New file.
1178 * testsuite/ifuncmod3.c: New file.
1179 * testsuite/ifuncmain4.c: New file.
1180 * testsuite/ifuncmain5.c: New file.
1181 * testsuite/ifuncmod5.c: New file.
1182 * testsuite/ifuncmain6pie.c: New file.
1183 * testsuite/ifuncmod6.c: New file.
1184 * testsuite/ifuncmain7.c: New file.
1185 * configure, testsuite/Makefile.in: Rebuild.
1186
56f75c03
ILT
11872010-08-18 Ian Lance Taylor <iant@google.com>
1188
1189 * incremental.cc
1190 (Output_section_incremental_inputs::write_input_files): Add cast
1191 to avoid signed/unsigned comparison warning.
1192 (Output_section_incremental_inputs::write_info_blocks): Likewise.
1193
55455f89
CC
11942010-08-12 Cary Coutant <ccoutant@google.com>
1195
1196 * common.cc (Sort_commons::operator()): Remove unnecessary code.
1197
e2054bcb
ILT
11982010-08-13 Ian Lance Taylor <iant@google.com>
1199
1200 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
1201
74f67560
DK
12022010-08-12 Cary Coutant <ccoutant@google.com>
1203 Doug Kwan <dougkwan@google.com>
1204
1205 * resolve.cc (Symbol_table::should_override): When a weak dynamic
1206 defintion overrides non-weak undef, remember that the original undef
1207 is not weak.
1208 * symtab.cc (Symbol_table::sized_write_global): For undef without
1209 an original weak binding, set binding to global in output.
1210 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
1211 * testsuite/Makefile.in: Regenerate.
1212 * testsuite/strong_ref_weak_def.sh: New file.
1213 * testsuite/strong_ref_weak_def_1.c: Ditto.
1214 * testsuite/strong_ref_weak_def_2.c: Ditto.
1215
d1238d12
CC
12162010-08-12 Cary Coutant <ccoutant@google.com>
1217
1218 * testsuite/incremental_test.sh: Rewrite.
1219 * testsuite/incremental_test_1.c: Rewrite.
1220 * testsuite/incremental_test_2.c: Rewrite.
1221
0e70b911
CC
12222010-08-12 Cary Coutant <ccoutant@google.com>
1223
1224 * arm.cc (Target_arm::got_size): Add const.
1225 (Target_arm::got_entry_count): New function.
1226 (Target_arm::plt_entry_count): New function.
1227 (Target_arm::first_plt_entry_offset): New function.
1228 (Target_arm::plt_entry_size): New function.
1229 (Output_data_plt_arm::entry_count): New function.
1230 (Output_data_plt_arm::first_plt_entry_offset): New function.
1231 (Output_data_plt_arm::get_plt_entry_size): New function.
1232 * i386.cc (Target_i386::got_size): Add const.
1233 (Target_i386::got_entry_count): New function.
1234 (Target_i386::plt_entry_count): New function.
1235 (Target_i386::first_plt_entry_offset): New function.
1236 (Target_i386::plt_entry_size): New function.
1237 (Output_data_plt_i386::entry_count): New function.
1238 (Output_data_plt_i386::first_plt_entry_offset): New function.
1239 (Output_data_plt_i386::get_plt_entry_size): New function.
1240 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
1241 find_incremental_inputs_sections. Dump incremental_got_plt section.
1242 * incremental.cc: Include target.h.
1243 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
1244 parameter. Adjust all callers. Find incremental_got_plt section.
1245 (Incremental_inputs::create_data_sections): Create incremental_got_plt
1246 section.
1247 (Output_section_incremental_inputs::set_final_data_size): Calculate
1248 size of incremental_got_plt section.
1249 (Output_section_incremental_inputs::do_write): Write the
1250 incremental_got_plt section.
1251 (Got_plt_view_info): New struct.
1252 (Local_got_offset_visitor): New class.
1253 (Global_got_offset_visitor): New class.
1254 (Global_symbol_visitor_got_plt): New class.
1255 (Output_section_incremental_inputs::write_got_plt): New function.
1256 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
1257 Add parameter. Adjust all callers.
1258 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
1259 (Incremental_inputs::got_plt_section): New function.
1260 (Incremental_inputs::got_plt_section_): New data member.
1261 (Incremental_got_plt_reader): New class.
1262 * layout.cc (Layout::create_incremental_info_sections): Add the
1263 incremental_got_plt section.
1264 * object.h (Got_offset_list::get_list): New function.
1265 (Got offset_list::for_all_got_offsets): New function.
1266 (Sized_relobj::local_got_offset_list): New function.
1267 * powerpc.cc (Target_powerpc::got_size): Add const.
1268 (Target_powerpc::got_entry_count): New function.
1269 (Target_powerpc::plt_entry_count): New function.
1270 (Target_powerpc::first_plt_entry_offset): New function.
1271 (Target_powerpc::plt_entry_size): New function.
1272 (Output_data_plt_powerpc::entry_count): New function.
1273 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
1274 (Output_data_plt_powerpc::get_plt_entry_size): New function.
1275 * sparc.cc (Target_sparc::got_size): Add const.
1276 (Target_sparc::got_entry_count): New function.
1277 (Target_sparc::plt_entry_count): New function.
1278 (Target_sparc::first_plt_entry_offset): New function.
1279 (Target_sparc::plt_entry_size): New function.
1280 (Output_data_plt_sparc::entry_count): New function.
1281 (Output_data_plt_sparc::first_plt_entry_offset): New function.
1282 (Output_data_plt_sparc::get_plt_entry_size): New function.
1283 * symtab.h (Symbol::got_offset_list): New function.
1284 (Symbol_table::for_all_symbols): New function.
1285 * target.h (Sized_target::got_entry_count): New function.
1286 (Sized_target::plt_entry_count): New function.
1287 (Sized_target::plt_entry_size): New function.
1288 * x86_64.cc (Target_x86_64::got_size): Add const.
1289 (Target_x86_64::got_entry_count): New function.
1290 (Target_x86_64::plt_entry_count): New function.
1291 (Target_x86_64::first_plt_entry_offset): New function.
1292 (Target_x86_64::plt_entry_size): New function.
1293 (Output_data_plt_x86_64::entry_count): New function.
1294 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
1295 (Output_data_plt_x86_64::get_plt_entry_size): New function.
1296
09ec0418
CC
12972010-08-12 Cary Coutant <ccoutant@google.com>
1298
1299 * archive.cc: Include incremental.h.
1300 (Archive::Archive): Initialize incremental_info_.
1301 (Archive::include_member): Record archive members in incremental info.
1302 (Add_archive_symbols::run): Record begin and end of an archive in
1303 incremental info.
1304 (Lib_group::include_member): Record objects in incremental info.
1305 * archive.h (Incremental_archive_entry): Forward declaration.
1306 (Archive::set_incremental_info): New member function.
1307 (Archive::incremental_info): New member function.
1308 (Archive::Unused_symbol_iterator): New class.
1309 (Archive::unused_symbols_begin): New member function.
1310 (Archive::unused_symbols_end): New member function.
1311 (Archive::incremental_info_): New data member.
1312 * incremental-dump.cc (find_input_containing_global): New function.
1313 (dump_incremental_inputs): Dump new incremental info sections.
1314 * incremental.cc: Include symtab.h.
1315 (Output_section_incremental_inputs): New class.
1316 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
1317 new incremental info sections.
1318 (Sized_incremental_binary::do_check_inputs): Likewise.
1319 (Incremental_inputs::report_archive): Remove.
1320 (Incremental_inputs::report_archive_begin): New function.
1321 (Incremental_inputs::report_archive_end): New function.
1322 (Incremental_inputs::report_object): New function.
1323 (Incremental_inputs::finalize_inputs): Remove.
1324 (Incremental_inputs::report_input_section): New function.
1325 (Incremental_inputs::report_script): Rewrite.
1326 (Incremental_inputs::finalize): Do nothing but finalize string table.
1327 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
1328 (Incremental_inputs::sized_create_inputs_section_data): Remove.
1329 (Incremental_inputs::create_data_sections): New function.
1330 (Incremental_inputs::relocs_entsize): New function.
1331 (Output_section_incremental_inputs::set_final_data_size): New function.
1332 (Output_section_incremental_inputs::do_write): New function.
1333 (Output_section_incremental_inputs::write_header): New function.
1334 (Output_section_incremental_inputs::write_input_files): New function.
1335 (Output_section_incremental_inputs::write_info_blocks): New function.
1336 (Output_section_incremental_inputs::write_symtab): New function.
1337 * incremental.h (Incremental_script_entry): Forward declaration.
1338 (Incremental_object_entry): Forward declaration.
1339 (Incremental_archive_entry): Forward declaration.
1340 (Incremental_inputs): Forward declaration.
1341 (Incremental_inputs_header_data): Remove.
1342 (Incremental_inputs_header): Remove.
1343 (Incremental_inputs_header_write): Remove.
1344 (Incremental_inputs_entry_data): Remove.
1345 (Incremental_inputs_entry): Remove.
1346 (Incremental_inputs_entry_write): Remove.
1347 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
1348 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
1349 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
1350 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
1351 Likewise.
1352 (Incremental_input_entry): New class.
1353 (Incremental_script_entry): New class.
1354 (Incremental_object_entry): New class.
1355 (Incremental_archive_entry): New class.
1356 (Incremental_inputs::Incremental_inputs): Initialize new data members.
1357 (Incremental_inputs::report_inputs): Remove.
1358 (Incremental_inputs::report_archive): Remove.
1359 (Incremental_inputs::report_archive_begin): New function.
1360 (Incremental_inputs::report_archive_end): New function.
1361 (Incremental_inputs::report_object): Change prototype.
1362 (Incremental_inputs::report_input_section): New function.
1363 (Incremental_inputs::report_script): Change prototype.
1364 (Incremental_inputs::get_reloc_count): New function.
1365 (Incremental_inputs::set_reloc_count): New function.
1366 (Incremental_inputs::create_data_sections): New function.
1367 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
1368 (Incremental_inputs::inputs_section): New function.
1369 (Incremental_inputs::symtab_section): New function.
1370 (Incremental_inputs::relocs_section): New function.
1371 (Incremental_inputs::get_stringpool): Add const.
1372 (Incremental_inputs::command_line): Add const.
1373 (Incremental_inputs::inputs): Remove.
1374 (Incremental_inputs::command_line_key): New function.
1375 (Incremental_inputs::input_file_count): New function.
1376 (Incremental_inputs::input_files): New function.
1377 (Incremental_inputs::relocs_entsize): New function.
1378 (Incremental_inputs::sized_create_inputs_section_data): Remove.
1379 (Incremental_inputs::finalize_inputs): Remove.
1380 (Incremental_inputs::Input_info): Remove.
1381 (Incremental_inputs::lock_): Remove.
1382 (Incremental_inputs::inputs_): Change type.
1383 (Incremental_inputs::inputs_map_): Remove.
1384 (Incremental_inputs::current_object_entry_): New data member.
1385 (Incremental_inputs::inputs_section_): New data member.
1386 (Incremental_inputs::symtab_section_): New data member.
1387 (Incremental_inputs::relocs_section_): New data member.
1388 (Incremental_inputs::reloc_count_): New data member.
1389 (Incremental_inputs_reader): New class.
1390 (Incremental_symtab_reader): New class.
1391 (Incremental_relocs_reader): New class.
1392 * layout.cc (Layout::finalize): Move finalization of incremental info
1393 and creation of incremental info sections to follow finalization of
1394 symbol table. Set offsets for postprocessing sections.
1395 (Layout::create_incremental_info_sections): Call
1396 Incremental_inputs::create_data_sections. Add incremental symtab
1397 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
1398 sections to layout after input sections.
1399 * layout.h (struct Timespec): Forward declaration.
1400 (Layout::incremental_inputs): Add const.
1401 (Layout::create_incremental_info_sections): Add parameter.
1402 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
1403 * object.cc: Include incremental.h.
1404 (Relobj::finalize_incremental_relocs): New function.
1405 (Sized_relobj::do_layout): Record input sections in incremental info.
1406 * object.h (Object::output_section): New function.
1407 (Object::output_section_offset): Moved from Relobj.
1408 (Object::get_incremental_reloc_base): New function.
1409 (Object::get_incremental_reloc_count): New function.
1410 (Object::do_output_section): New function.
1411 (Object::do_output_section_offset): Moved from Relobj.
1412 (Object::do_get_incremental_reloc_base): New function.
1413 (Object::do_get_incremental_reloc_count): New function.
1414 (Object::Object): Initialize new data members.
1415 (Relobj::output_section): Renamed do_output_section and moved to
1416 protected.
1417 (Relobj::output_section_offset): Moved to Object.
1418 (Relobj::do_get_incremental_reloc_base): New function.
1419 (Relobj::do_get_incremental_reloc_count): New function.
1420 (Relobj::allocate_incremental_reloc_counts): New function.
1421 (Relobj::count_incremental_reloc): New function.
1422 (Relobj::finalize_incremental_relocs): New function.
1423 (Relobj::next_incremental_reloc_index): New function.
1424 (Relobj::reloc_counts_): New data member.
1425 (Relobj::reloc_bases_): New data member.
1426 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
1427 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
1428 (Sized_relobj::incremental_relocs_scan): New function.
1429 (Sized_relobj::incremental_relocs_scan_reltype): New function.
1430 (Sized_relobj::incremental_relocs_write): New function.
1431 (Sized_relobj::incremental_relocs_write_reltype): New function.
1432 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
1433 incremental link.
1434 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
1435 archives and object files elsewhere.
1436 (Add_symbols::run): Report object files here.
1437 (Finish_group::run): Report end of archive at end of group.
1438 * reloc.cc: Include layout.h, incremental.h.
1439 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
1440 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
1441 (Sized_relobj::incremental_relocs_scan): New function.
1442 (Sized_relobj::incremental_relocs_scan_reltype): New function.
1443 (Sized_relobj::do_relocate_sections): Write incremental relocations.
1444 (Sized_relobj::incremental_relocs_write): New function.
1445 (Sized_relobj::incremental_relocs_write_reltype): New function.
1446 * script.cc (read_input_script): Rewrite test for incremental link.
1447 Change call to Incremental_inputs::report_script.
1448 * symtab.h (Symbol_table::first_global_index): New function.
1449 (Symbol_table::output_count): New function.
1450
ce0d1972
DK
14512010-08-12 Doug Kwan <dougkwan@google.com>
1452
1453 * arm.cc (Target_arm::merge_object_attributes): Check command line
1454 options --no-wchar-size-warning and --no-enum-size-warning.
1455 * options.h (General_options): Add ld-compatible options
1456 --no-enum-size-warning and --no-wchar-size-warning.
1457
6e5710ce
ILT
14582010-08-04 Ian Lance Taylor <iant@google.com>
1459
1460 * x86_64.cc (Target_x86_64::Scan::local): Use
1461 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
1462 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
1463 (Target_x86_64::Scan::global): Likewise.
1464 (Target_x86_64::Relocate::relocate): Likewise.
1465 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
1466 Likewise.
1467
fef830db
CC
14682010-08-03 Cary Coutant <ccoutant@google.com>
1469
1470 * merge.cc (Output_merge_string::do_add_input_section): Count strings
1471 to reserve space in merged_strings vector. Keep total input size
1472 for stats.
1473 (Output_merge_string::do_print_merge_stats): Print total input size.
1474 * merge.h (Output_merge_string): Add input_size_ field.
1475 * stringpool.cc (Stringpool_template::string_length): Move
1476 implementations out of Stringpool_template class and place in
1477 stringpool.h.
1478 * stringpool.h (string_length): Move out of Stringpool_template.
1479
1e3811b0
ILT
14802010-08-03 Ian Lance Taylor <iant@google.com>
1481
1482 PR 11712
1483 * layout.cc (relaxation_loop_body): If address of load segment is
1484 set, adjust address to include headers if possible.
1485
7af0c620
ILT
14862010-08-03 Ian Lance Taylor <iant@google.com>
1487
1488 * version.cc (version_string): Bump to 1.10.
1489
22f0da72
ILT
14902010-08-03 Ian Lance Taylor <iant@google.com>
1491
1492 PR 11805
1493 * layout.h (enum Output_section_order): Define.
1494 (class Layout): Update declarations.
1495 * layout.cc (Layout::get_output_section): Add order parameter.
1496 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
1497 is_first_non_relro parameters. Change all callers.
1498 (Layout::choose_output_section): Likewise.
1499 (Layout::add_output_section_data): Likewise.
1500 (Layout::make_output_section): Likewise. Set order.
1501 (Layout::default_section_order): New function.
1502 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
1503 * output.cc (Output_section::Output_section): Initialize order_.
1504 Don't initialize deleted fields.
1505 (Output_segment::Output_segment): Don't initialize deleted
1506 fields.
1507 (Output_segment::add_output_section_to_load): New function
1508 replacing add_output_section. Change all callers to call this or
1509 add_output_section_to_nonload.
1510 (Output_segment::add_output_section_to_nonload): New function.
1511 (Output_segment::remove_output_section): Rewrite.
1512 (Output_segment::add_initial_output_data): Likewise.
1513 (Output_segment::has_any_data_sections): Likewise.
1514 (Output_segment::is_first_section_relro): Likewise.
1515 (Output_segment::maximum_alignment): Likewise.
1516 (Output_segment::has_dynamic_reloc): New function replacing
1517 dynamic_reloc_count. Change all callers.
1518 (Output_segment::has_dynamic_reloc_list): New function replacing
1519 dynamic_reloc_count_list. Change all callers.
1520 (Output_segment::set_section_addresses): Rewrite.
1521 (Output_segment::set_offset): Rewrite.
1522 (Output_segment::find_first_and_last_list): Remove.
1523 (Output_segment::set_tls_offsets): Rewrite.
1524 (Output_segment::first_section_load_address): Likewise.
1525 (Output_segment::output_section_count): Likewise.
1526 (Output_segment::section_with_lowest_load_address): Likewise.
1527 (Output_segment::write_section_headers): Likewise.
1528 (Output_segment::print_sections_to_map): Likewise.
1529 * output.h (class Output_data): Remove dynamic_reloc_count_
1530 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
1531 (Output_data::add_dynamic_reloc): Rewrite.
1532 (Output_data::has_dynamic_reloc): New function.
1533 (Output_data::dynamic_reloc_count): Remove.
1534 (class Output_section): Add order_ field. Remvoe is_relro_local_,
1535 is_last_relro_, is_first_non_relro_, is_interp_,
1536 is_dynamic_linker_section_ fields. Add order and set_order
1537 functions. Remove is_relro_local, set_is_relro_local,
1538 is_last_relro, set_is_last_relro, is_first_non_relro,
1539 set_is_first_non_relro functions, is_interp, set_is_interp,
1540 is_dynamic_linker_section, and set_is_dynamic_linker_section
1541 functions.
1542 (class Output_segment): Change Output_data_list from std::list to
1543 std:;vector. Add output_lists_ field. Remove output_data_ and
1544 output_bss_ fields. Update declarations.
1545
3ff2ccb0
ILT
15462010-08-02 Ian Lance Taylor <iant@google.com>
1547
1548 * arm.cc (Target_arm::gc_process_relocs): Use typename.
1549 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
1550 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
1551
88a4108b
ILT
15522010-08-02 Ian Lance Taylor <iant@google.com>
1553
1554 PR 11855
1555 * script.cc (Script_options::Script_options): Initialize
1556 symbol_definitions_ and symbol_references_.
1557 (Script_options::add_symbol_assignment): Update
1558 symbol_definitions_ and symbol_references_.
1559 (Script_options::add_symbol_reference): New function.
1560 (script_symbol): New function.
1561 * script.h (class Script_options): Add symbol_definitions_ and
1562 symbol_references_ fields.
1563 (Script_options::referenced_const_iterator): New type.
1564 (Script_options::referenced_begin): New function.
1565 (Script_options::referenced_end): New function.
1566 (Script_options::is_referenced): New function.
1567 (Script_options::any_unreferenced): New function.
1568 * script-c.h (script_symbol): Declare.
1569 * yyscript.y (exp): Call script_symbol.
1570 * symtab.cc: Include "script.h".
1571 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
1572 Change all callers. Check symbols referenced by scripts.
1573 (Symbol_table::add_undefined_symbols_from_command_line): Add
1574 layout parameter. Change all callers.
1575 (Symbol_table::do_add_undefined_symbols_from_command_line):
1576 Likewise. Break out loop body. Check symbols referenced by
1577 scripts.
1578 (Symbol_table::add_undefined_symbol_from_command_line): New
1579 function broken out of
1580 do_add_undefined_symbols_from_command_line.
1581 * symtab.h (class Symbol_table): Update declarations.
1582 * archive.cc: Include "layout.h".
1583 (Archive::should_include_member): Add layout parameter. Change
1584 all callers. Check for symbol mentioned in expression.
1585 * archive.h (class Archive): Update declaration.
1586 * object.cc (Sized_relobj::do_should_include_member): Add layout
1587 parameter.
1588 * object.h (Object::should_include_member): Add layout parameter.
1589 Change all callers.
1590 (Object::do_should_include_member): Add layout parameter.
1591 (class Sized_relobj): Update declaration.
1592 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
1593 parameter.
1594 * dynobj.h (class Sized_dynobj): Update declaration.
1595 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
1596 layout parameter.
1597 * plugin.h (class Sized_pluginobj): Update declaration.
1598
5f1ab67a
ILT
15992010-08-02 Ian Lance Taylor <iant@google.com>
1600
1601 PR 11866
1602 * output.cc (Output_segment::set_offset): Search for the first and
1603 last sections rather than assuming that the list is in order.
1604 (Output_segment::find_first_and_last_list): New function.
1605 * output.h (class Output_segment): Update declarations.
1606 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
1607 (relro_strip_test_SOURCES): New variable.
1608 (relro_strip_test_DEPENDENCIES): New variable.
1609 (relro_strip_test_LDFLAGS): New variable.
1610 (relro_strip_test_LDADD): New variable.
1611 (relro_strip_test.so): New target.
1612
a8df5856
ILT
16132010-08-02 Ian Lance Taylor <iant@google.com>
1614
1615 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
1616 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
1617 (Target_i386::got_tlsdesc_section): New function.
1618 (Target_i386::got_section): Create space for GOT entries for
1619 TLSDESC relocations.
1620 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
1621 R_386_TLS_GOTDESC.
1622 (Target_i386::Scan::global): Likewise.
1623 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
1624 using TLSDESC GOT.
1625 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
1626 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
1627 (Target_x86_64::got_tlsdesc_section): New function.
1628 (Target_x86_64::got_section): Create space for GOT entries for
1629 TLSDESC relocations.
1630 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
1631 R_386_TLS_GOTDESC.
1632 (Target_x86_64::Scan::global): Likewise.
1633 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
1634 using TLSDESC GOT.
1635
0c10a0a6
ILT
16362010-08-02 Ian Lance Taylor <iant@google.com>
1637
1638 * testsuite/final_layout.sh: Use dc to convert from hex to
1639 decimal.
1640
41cbeecc
ST
16412010-07-29 Sriraman Tallam <tmsriram@google.com>
1642
1643 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
1644 paramter to the call to gold::gc_process_relocs.
1645 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
1646 paramter to the call to gold::gc_process_relocs.
1647 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
1648 parameter to the call to gold::gc_process_relocs.
1649 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
1650 template parameter to the call to gold::gc_process_relocs.
1651 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
1652 paramter to the call to gold::gc_process_relocs.
1653 * gc.h (get_embedded_addend_size): New function.
1654 (gc_process_relocs): Save the size of the reloc for use by ICF.
1655 * icf.cc (get_section_contents): Get the addend from the text section
1656 for SHT_REL relocation sections.
1657 * icf.h (Icf::Reloc_addend_size_info): New typedef.
1658 (Icf::Reloc_info): Add new member reloc_addend_size_info.
1659 * int_encoding.h (read_from_pointer): New overloaded function.
1660 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
1661 * testsuite/icf_sht_rel_addend_test.sh: New file.
1662 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
1663 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
1664
6ea55b82
RW
16652010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1666
1667 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
1668 * Makefile.in: Regenerate.
1669 * testsuite/Makefile.in: Regenerate.
1670
9691462b
ILT
16712010-07-27 Jeffrey Yasskin <jyasskin@google.com>
1672
1673 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
1674 * gold/testsuite/debug_msg.cc: Likewise.
1675 * gold/testsuite/odr_violation1.cc
1676 * gold/testsuite/odr_violation2.cc
1677
76897331
CC
16782010-07-21 Cary Coutant <ccoutant@google.com>
1679
1680 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
1681 string, and length fields.
1682 (Output_merge_string::Merged_strings_list): New type.
1683 (Output_merge_string::Merged_strings_lists): New typedef.
1684 (Output_merge_string): Replace merged_strings_ with
1685 merged_strings_lists_.
1686 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
1687 Merged_strings_list per input object and section. Don't store pointer
1688 to the string. Don't store length with each merged string entry.
1689 (Output_merge_string::finalize_merged_data): Loop over list of merged
1690 strings lists. Recompute length of each merged string.
1691
78384e8f
CC
16922010-07-15 Cary Coutant <ccoutant@google.com>
1693
1694 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
1695 here.
1696
783659f9
ILT
16972010-07-14 Ian Lance Taylor <iant@google.com>
1698
1699 * descriptors.cc (Descriptors::open): Report correct name in error
1700 message.
1701
131687b4
DK
17022010-07-13 Doug Kwan <dougkwan@google.com>
1703
1704 * arm.cc (Arm_input_section::Arm_input_section): For a
1705 SHT_ARM_EXIDX section, always keeps the input sections.
1706 (Arm_input_section::set_exidx_section_link): New method.
1707 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
1708 has_errors_ to false.
1709 (Arm_exidx_input_section::has_errors,
1710 Arm_exidx_input_section::set_has_errors): New methods.
1711 (Arm_exidx_input_section::has_errors_): New data member.
1712 (Arm_relobj::get_exidx_shndx_list): New method.
1713 (Arm_output_section::append_text_sections_to_list): Do not skip
1714 section without SHF_EXECINSTR.
1715 (Arm_output_section::fix_exidx_coverage): Skip input sections with
1716 errors.
1717 (Arm_relobj::make_exidx_input_section): Add new parameter for text
1718 section header. Make error messages more verbose. Check for
1719 a non-executable section linked to an EXIDX section.
1720 (Arm_relobj::do_read_symbols): Remove error checking, which has been
1721 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
1722 check that there is no deferred EXIDX section if we exit early.
1723 Instead of not making an EXIDX section in case of an error, make one
1724 and set the has_errors flag of it.
1725 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
1726 in a relocatable link.
1727 (Target_arm::do_relax): Look for the EXIDX output section instead of
1728 assuming that it is called .ARM.exidx.
1729 (Target_arm::fix_exidx_coverage): Add a new parameter for input
1730 section list. Do not check for SHF_EXECINSTR section flags but
1731 skip any input section with errors.
1732 * output.cc (Output_section::Output_section): Initialize
1733 always_keeps_input_sections_ to false.
1734 (Output_section::add_input_section): Check for
1735 always_keeps_input_sections_.
1736 * output.h (Output_section::always_keeps_input_sections,
1737 Output_section::set_always_keeps_input_sections): New methods.
1738 (Output_section::always_keeps_input_sections): New data member.
1739
69517287
RÁE
17402010-07-13 Rafael Espindola <espindola@google.com>
1741
1742 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
1743 * fileread.h (Input_file): Add try_extra_search_path and find_file.
1744
82742395
ILT
17452010-07-13 Philip Herron <herron.philip@googlemail.com>
1746 Ian Lance Taylor <iant@google.com>
1747
1748 * output.h (Output_section_lookup_maps::add_merge_section):
1749 Correct check of whether value was inserted.
1750 (Output_section_lookup_maps::add_merge_input_section): Likewise.
1751 (Output_section_lookup_maps::add_relaxed_input_section):
1752 Likewise.
1753 * arm.cc (Target_arm::got_section): Remove used local os.
1754 * i386.cc (Target_i386::got_section): Likewise.
1755 * x86_64.cc (Target_x86_64::got_section): Likewise.
1756 * sparc.cc (Target_sparc::got_section): Likewise.
1757 (Target_sparc::relocate): Remove unused local have_got_offset.
1758 * powerpc.cc (Target_powerpc::relocate): Likewise.
1759
f2d707b5
ILT
17602010-07-13 Ian Lance Taylor <iant@google.com>
1761
241531d6
ILT
1762 * compressed_output.cc (zlib_decompress): Fix signature in
1763 !HAVE_ZLIB_H case.
1764
f2d707b5
ILT
1765 * archive.cc (Archive::include_member): Unlock an external member
1766 of a thin archive. Don't bother to delete an object we know is
1767 NULL.
1768
a2e47362
CC
17692010-07-12 Cary Coutant <ccoutant@google.com>
1770
1771 * compressed_output.cc (zlib_decompress): New function.
1772 (get_uncompressed_size): New function.
1773 (decompress_input_section): New function.
1774 * compressed_output.h (get_uncompressed_size): New function.
1775 (decompress_input_section): New function.
1776 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
1777 Handle compressed debug sections.
1778 * layout.cc (is_compressed_debug_section): New function.
1779 (Layout::output_section_name): Map compressed section names to
1780 canonical names.
1781 * layout.h (is_compressed_debug_section): New function.
1782 (is_debug_info_section): Recognize compressed debug sections.
1783 * merge.cc: Include compressed_output.h.
1784 (Output_merge_data::do_add_input_section): Handle compressed
1785 debug sections.
1786 (Output_merge_string::do_add_input_section): Handle compressed
1787 debug sections.
1788 * object.cc: Include compressed_output.h.
1789 (Sized_relobj::Sized_relobj): Initialize new data members.
1790 (build_compressed_section_map): New function.
1791 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
1792 * object.h (Object::section_is_compressed): New method.
1793 (Object::do_section_is_compressed): New method.
1794 (Sized_relobj::Compressed_section_map): New type.
1795 (Sized_relobj::do_section_is_compressed): New method.
1796 (Sized_relobj::compressed_sections_): New data member.
1797 * output.cc (Output_section::add_input_section): Handle compressed
1798 debug sections.
1799 * reloc.cc: Include compressed_output.h.
1800 (Sized_relobj::write_sections): Handle compressed debug sections.
1801
ce279a62
CC
18022010-07-08 Cary Coutant <ccoutant@google.com>
1803
1804 * resolve.cc (Symbol_table::resolve): Remember whether undef was
1805 weak when resolving to a dynamic def.
1806 (Symbol_table::should_override): Add adjust_dyndef flag; set it
1807 for weak undef/dynamic def cases. Adjust callers.
1808 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
1809 undef_binding_weak_.
1810 (Symbol_table::sized_write_globals): Adjust symbol binding.
1811 (Symbol_table::sized_write_symbol): Add binding parameter.
1812 * symtab.h (Symbol::set_undef_binding): New method.
1813 (Symbol::is_undef_binding_weak): New method.
1814 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
1815 (Symbol_table::should_override): Add new parameter.
1816 (Symbol_table::sized_write_symbol): Add new parameter.
1817
1818 * testsuite/weak_undef_file1.cc: Add new test case.
1819 * testsuite/weak_undef_file2.cc: Fix header comment.
1820 * testsuite/weak_undef_test.cc: Add new test case.
1821
b2286c10
DK
18222010-06-29 Doug Kwan <dougkwan@google.com>
1823
1824 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
1825 Initialize USE_SYMBOL_.
1826 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
1827 definition.
1828 (Arm_reloc_property::uses_symbol_): New data member declaration.
1829 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
1830 uses symbol value and symbol is undefined but not weakly undefined.
1831
4802450a
RÁE
18322010-06-28 Rafael Espindola <espindola@google.com>
1833
1834 * plugin.cc (Plugin::load): Use dlerror.
1835
e5ca47ba
ILT
18362010-06-26 Jeffrey Yaskin <jyasskin@google.com>
1837
1838 * symtab.cc (detect_odr_violations): When reporting an ODR
1839 violation, report an object where the symbol is defined.
1840
8a75a161
DK
18412010-06-25 Doug Kwan <dougkwan@google.com>
1842
1843 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
1844 (Target_arm::section_may_have_icf_unsafe_pointers): New method
1845 definition.
1846 (Target_arm::Scan::local_reloc_may_be_function_pointer,
1847 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
1848 target hook to detect function points.
1849 (Target_arm::Scan::possible_function_pointer_reloc): New method.
1850 * icf.h (Icf::check_section_for_function_pointers): Change type of
1851 parameter SECTION_NAME to const reference to std::string. Use
1852 target hook to determine if section may have unsafe pointers.
1853 * target.h (Target::section_may_have_icf_unsafe_pointers): New
1854 method definition.
1855
42218b9f
RÁE
18562010-06-21 Rafael Espindola <espindola@google.com>
1857
1858 * fileread.cc (Input_file::find_fie): New
1859 (Input_file::open): Use Input_file::find_fie.
1860 * fileread.h (Input_file::find_fie): New
1861 * plugin.cc (set_extra_library_path): New.
1862 (Plugin::load): Add set_extra_library_path to the transfer vector.
1863 (Plugin_manager::set_extra_library_path): New.
1864 (Plugin_manager::add_input_file): Use the extra search path if set.
1865 (set_extra_library_path(): New.
1866 * plugin.h (Plugin_manager): Add set_extra_library_path and
1867 extra_search_path_.
1868
a0506cca
CC
18692010-06-19 Cary Coutant <ccoutant@google.com>
1870
1871 * layout.cc (gdb_sections): Add .debug_types.
1872 (lines_only_debug_sections): Likewise.
1873
6508b958
RÁE
18742010-06-18 Rafael Espindola <espindola@google.com>
1875
1876 * plugin.cc (add_input_file,add_input_library)
1877 (Plugin_manager::add_input_file): Make filename arguments const.
1878 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
1879 const.
1880
3e235302
DK
18812010-06-16 Doug Kwan <dougkwan@google.com>
1882
1883 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
1884 .ARM.attributes section if we have not merged any input
1885 attributes sections.
1886
106e8a6c
DK
18872010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1888
1889 * arm.cc: Allow combining objects with no EABI version
1890 information.
1891
91ff43fe
RÁE
18922010-06-15 Rafael Espindola <espindola@google.com>
1893
1894 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
1895
68ed838c
ILT
18962010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1897
1898 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
1899 (struct iovec): Correct !HAVE_READV definition.
1900
f3a2388f
CC
19012010-06-10 Cary Coutant <ccoutant@google.com>
1902
1903 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
1904 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
1905 reloc sections.
1906 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
1907
1908 PR 11683
1909 * symtab.h (Symbol::is_placeholder): New member function.
1910 * target-reloc.h (relocate_section): Check for placeholder symbols.
1911
1912 * testsuite/Makefile.am (plugin_test_8): New test.
1913 (plugin_test_9): New test.
1914 * testsuite/Makefile.in: Regenerate.
1915
e1df38aa
NC
19162010-06-09 Nick Clifton <nickc@redhat.com>
1917
1918 * yyscript.y (input_list_element): Allow strings prefixed with
1919 the '-' character. Treat these as libraries.
1920 * script.cc (script_add_library): New function. Adds a library
1921 specified by "-l<name>" found in an input script.
1922 * script-c.h: Add prototype for script_add_library.
1923
25bbe950
DK
19242010-06-07 Doug Kwan <dougkwan@google.com>
1925
1926 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
1927 Restrict stub-group size to be within long conditional branch
1928 range when working around cortex-A8 erratum.
1929
0f32ea4c
ILT
19302010-06-07 Damien Diederen <dd@crosstwine.com>
1931
1932 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
1933 #ifdef typo.
1934
8fe2a369
ST
19352010-06-03 Sriraman Tallam <tmsriram@google.com>
1936
1937 PR gold/11658
1938 * output.cc
1939 (Output_section::Input_section_sort_entry::compare_section_ordering):
1940 Change to return non-zero correctly.
1941 (Output_section::Input_section_sort_section_order_index_compare
1942 ::operator()): Change to fix ambiguity in comparisons.
1943
6e9ba2ca
ST
19442010-06-01 Sriraman Tallam <tmsriram@google.com>
1945
1946 * gold.h (is_wildcard_string): New function.
1947 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
1948 (Layout::layout_eh_frame): Ditto.
1949 (Layout::find_section_order_index): New method.
1950 (Layout::read_layout_from_file): New method.
1951 * layout.h (Layout::find_section_order_index): New method.
1952 (Layout::read_layout_from_file): New method.
1953 (Layout::input_section_position_): New private member.
1954 (Layout::input_section_glob_): New private member.
1955 * main.cc (main): Call read_layout_from_file here.
1956 * options.h (--section-ordering-file): New option.
1957 * output.cc (Output_section::input_section_order_specified_): New
1958 member.
1959 (Output_section::Output_section): Initialize new member.
1960 (Output_section::add_input_section): Add new parameter.
1961 Keep input sections when --section-ordering-file is used.
1962 (Output_section::set_final_data_size): Sort input sections when
1963 section ordering file is specified.
1964 (Output_section::Input_section_sort_entry): Add new parameter.
1965 Check sorting type.
1966 (Output_section::Input_section_sort_entry::compare_section_ordering):
1967 New method.
1968 (Output_section::Input_section_sort_compare::operator()): Change to
1969 consider section_order_index.
1970 (Output_section::Input_section_sort_init_fini_compare::operator()):
1971 Change to consider section_order_index.
1972 (Output_section::Input_section_sort_section_order_index_compare
1973 ::operator()): New method.
1974 (Output_section::sort_attached_input_sections): Change to sort
1975 according to section order when specified.
e1df38aa
NC
1976 (Output_section::add_input_section<32, true>): Add new parameter.
1977 (Output_section::add_input_section<64, true>): Add new parameter.
1978 (Output_section::add_input_section<32, false>): Add new parameter.
1979 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
1980 * output.h (Output_section::add_input_section): Add new parameter.
1981 (Output_section::input_section_order_specified): New
1982 method.
1983 (Output_section::set_input_section_order_specified): New method.
1984 (Input_section::Input_section): Initialize section_order_index_.
1985 (Input_section::section_order_index): New method.
1986 (Input_section::set_section_order_index): New method.
1987 (Input_section::section_order_index_): New member.
1988 (Input_section::Input_section_sort_section_order_index_compare): New
1989 struct.
1990 (Output_section::input_section_order_specified_): New member.
1991 * script-sections.cc (is_wildcard_string): Delete and move modified
1992 method to gold.h.
1993 (Output_section_element_input::Output_section_element_input): Modify
1994 call to is_wildcard_string.
1995 (Output_section_element_input::Input_section_pattern
1996 ::Input_section_pattern): Ditto.
1997 (Output_section_element_input::Output_section_element_input): Ditto.
1998 * testsuite/Makefile.am (final_layout): New test case.
1999 * testsuite/Makefile.in: Regenerate.
2000 * testsuite/final_layout.cc: New file.
2001 * testsuite/final_layout.sh: New file.
2002
3537c84b
RÁE
20032010-06-01 Rafael Espindola <espindola@google.com>
2004
2005 * plugin.cc (Plugin::load): Pass the output name to the plugin.
2006
105b6afd
RÁE
20072010-06-01 Rafael Espindola <espindola@google.com>
2008
2009 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
2010 visibility of symbols.
2011
29e11421
DK
20122010-05-27 Doug Kwan <dougkwan@google.com>
2013
2014 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
2015 from start of output section instead of address for a local symbol
2016 in a merged or relaxed section when doing a relocatable link.
2017
5e0f337e
RÁE
20182010-05-26 Rafael Espindola <espindola@google.com>
2019
2020 PR 11604
2021 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
2022 adding sections the garbage collector removed.
2023 * gold/testsuite/Makefile.am: Add test.
2024 * gold/testsuite/Makefile.in: Regenerate.
2025 * gold/testsuite/plugin_test_7.sh: New.
2026 * gold/testsuite/plugin_test_7_1.c: New.
2027 * gold/testsuite/plugin_test_7_2.c: New.
2028
f4187277
RÁE
20292010-05-26 Rafael Espindola <espindola@google.com>
2030
2031 * script-sections.cc (Output_section_definition::set_section_addresses):
2032 Check for --section-start.
2033
5c388529
DK
20342010-05-26 Doug Kwan <dougkwan@google.com>
2035
2036 * arm.cc (Arm_scan_relocatable_relocs): New class.
2037 (Target_arm::relocate_special_relocatable): New method.
2038 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
2039 (Arm_relocate_functions::thumb_branch_common): Same.
2040 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
2041 instead of Default_scan_relocatable_relocs.
2042 * target-reloc.h (relocate_for_relocatable): Let target handle
2043 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
2044 * target.h (Sized_target::relocate_special_relocatable): New method.
2045
bca1c3ae
ILT
20462010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2047
2048 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
2049
0439c796
DK
20502010-05-23 Doug Kwan <dougkwan@google.com>
2051
2052 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
2053 instead of a cast.
2054 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
2055 with a direct branch, not a conditional branch, to a stub.
2056 * merge.cc (Output_merge_base::record_input_section): New method
2057 defintion.
2058 (Output_merge_data::do_add_input_section): Record input section if
2059 keeps-input-sections flag is set.
2060 (Output_merge_string::do_add_input_section): Ditto.
2061 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
2062 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
2063 INPUT_SECTIONS_.
2064 (Output_merge_base::keeps_input_sections,
2065 Output_merge_base::set_keeps_input_sections,
2066 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
2067 method definitions.
2068 (Output_merge_base::Input_sections): New type declaration.
2069 (Output_merge_base::input_sections_begin,
2070 Output_merge_base::input_sections_end,
2071 Output_merge_base::do_set_keeps_input_sections): New method definitions.
2072 (Output_merge_base::bool keeps_input_sections_,
2073 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
2074 Output_merge_base::input_sections_): New data members.
2075 (Output_merge_data::do_set_keeps_input_sections): New method
2076 defintion.
2077 (Output_merge_string::do_set_keeps_input_sections): Ditto.
2078 * output.cc (Output_section::Input_section::relobj): Move method
2079 defintion from class declaration to here and handle merge sections.
2080 (Output_section::Input_section::shndx): Ditto.
2081 (Output_section::Output_section): Remove initializations of removed
2082 data members and initialize new data member LOOKUP_MAPS_.
2083 (Output_section::add_input_section): Set keeps-input-sections flag
2084 for a newly created merge output section as appropriate. Adjust code
2085 to use Output_section_lookup_maps class.
2086 (Output_section::add_relaxed_input_section): Adjst code for lookup
2087 maps code refactoring.
2088 (Output_section::add_merge_input_section): Add a new parameter
2089 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
2090 class. If adding input section to a newly created merge output
2091 section fails, remove the new merge section.
2092 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 2093 Adjust code for use of the Output_section_lookup_maps class.
0439c796
DK
2094 (Output_section::find_merge_section): Ditto.
2095 (Output_section::build_lookup_maps): New method defintion.
2096 (Output_section::find_relaxed_input_section): Adjust code to use
2097 Output_section_lookup_maps class.
2098 (Output_section::get_input_sections): Export merge sections. Adjust
2099 code to use Output_section_lookup_maps class.
2100 (Output_section:::add_script_input_section): Adjust code to use
2101 Output_section_lookup_maps class. Update lookup maps for merge
2102 sections also.
2103 (Output_section::discard_states): Use Output_section_lookup_maps.
2104 (Output_section::restore_states): Same.
2105 * output.h (Merge_section_properties): Move class defintion out of
2106 Output_section.
2107 (Output_section_lookup_maps): New class.
2108 (Output_section::Input_section::is_merge_section): New method
2109 defintion.
2110 (Output_section::Input_section::relobj): Move defintion out of class
2111 defintion. Declare method only.
2112 (Output_section::Input_section::shndx): Ditto.
2113 (Output_section::Input_section::output_merge_base): New method defintion.
2114 (Output_section::Input_section::u2_.pomb): New union field.
2115 (Output_section::Merge_section_by_properties_map,
2116 Output_section::Output_section_data_by_input_section_map,
2117 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
2118 Remove types.
2119 (Output_section::add_merge_input_section): Add new parameter
2120 KEEPS_INPUT_SECTIONS.
2121 (Output_section::build_lookup_maps): New method declaration.
2122 (Output_section::merge_section_map_,
2123 Output_section::merge_section_by_properties_map_,
2124 Output_section::relaxed_input_section_map_,
2125 Output_section::is_relaxed_input_section_map_valid_): Remove data
2126 members.
2127 (Output_section::lookup_maps_): New data member.
2128
76295588
L
21292010-05-21 Doug Kwan <dougkwan@google.com>
2130
2131 PR gold/11619
2132 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
2133 avoid a compilation error.
2134
d103a984
RÁE
21352010-05-19 Rafael Espindola <espindola@google.com>
2136
2137 * script-sections.cc (Output_section_definition::allocate_to_segment):
2138 Update the phdrs_list even when the output section is NULL.
2139 * testsuite/Makefile.am: Add test.
2140 * testsuite/Makefile.in: Regenerate.
2141 * testsuite/script_test_9.cc: New.
2142 * testsuite/script_test_9.sh: New.
2143 * testsuite/script_test_9.t: New.
2144
6625d24e
DK
21452010-05-19 Doug Kwan <dougkwan@google.com>
2146
2147 * arm.cc (Arm_input_section::original_size): New method.
2148 (Arm_input_section::do_addralign): Add a cast.
2149 (Arm_input_section::do_output_offset): Remove static cast.
2150 (Arm_input_section::original_addralign,
2151 Arm_input_section::original_size_): Change type to uint32_t.
2152 (Arm_input_section::init): Add safe casts for section alignment
2153 and size.
2154 (Arm_input_section::set_final_data_size): Do not set address and
2155 offset of stub table.
2156 (Arm_output_section::fix_exidx_coverage): Change use of of
2157 Output_section::Simple_input_section to that of
2158 Output_section::Input_section.
2159 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
2160 except for the first pass.
2161 * output.cc (Output_section::get_input_sections): Change type of
2162 input_sections to std::list<Input_section>.
2163 (Output_section::add_script_input_section): Rename from
2164 Output_section::add_simple_input_section. Change type of SIS
2165 parameter from Simple_input_section to Input_section.
2166 * output.h (Output_section::Simple_input_section): Remove class.
2167 (Output_section::Input_section): Change class visibility to public.
2168 (Output_section::Input_section::addralign): Use stored alignments
2169 for special input sections if set.
2170 (Output_section::Input_section::set_addralign): New method.
2171 (Output_section::get_input_sections): Change parameter type from
2172 list of Simple_input_section to list of Input_section.
2173 (Output_section::add_script_input_section): Rename from
2174 Output_section::add_simple_input_section. Change first parameter's
2175 type from Simple_input_section to Input_section and remove the
2176 second and third parameters.
2177 * script-sections.cc (Input_section::Input_section_list): Change
2178 type to list of Output_section::Input_section/
2179 (Input_section_info::Input_section_info): Change parameter type of
2180 INPUT_SECTION to Output_section::Input_section.
2181 (Input_section_info::input_section): Change return type.
2182 (Input_section_info::input_section_): Change type to
2183 Output_section::Input_section.
2184 (Output_section_element_input::set_section_addresses): Adjust code
2185 to use Output_section::Input_section instead of
2186 Output_section::Simple_input_section. Adjust code for renaming
2187 of Output_section::add_simple_input_section.
2188 (Orphan_output_section::set_section_addresses): Ditto.
2189
e1e82ea4
RW
21902010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2191
2192 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
2193 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
2194
91e75c8a
RÁE
21952010-05-18 Rafael Espindola <espindola@google.com>
2196
2197 * options.cc (General_options::finalize): Handle -nostdlib.
2198 * options.h (nostdlib): New option.
2199 * script.cc (script_add_search_dir): Handle -nostdlib.
2200
da59ad79
DK
22012010-05-12 Doug Kwan <dougkwan@google.com>
2202
2203 * arm.cc (Target_arm::do_finalize_sections): Create an empty
2204 attributes section only if there no attributes section after merging.
2205 (Target_arm::merge_object_attributes): Move value of
e1df38aa 2206 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
2207 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
2208 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
2209 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
2210 and arm_attr_merge_7.stdout.
2211 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
2212 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
2213 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
2214 arm_attr_merge_7b.o): New rules.
2215 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
2216 arm_attr_merge_7
2217 * testsuite/Makefile.in: Regenerate.
2218 * testsuite/arm_attr_merge.sh: New file.
2219 * testsuite/arm_attr_merge_[67][ab].s: Same.
2220
3e01a7fd
NC
22212010-05-05 Nick Clifton <nickc@redhat.com>
2222
2223 * po/es.po: Updated Spanish translation.
2224
7ad2014a
L
22252010-04-27 H.J. Lu <hongjiu.lu@intel.com>
2226
2227 * Makefile.am (install-exec-local): Properly install gold as
2228 default cross linker.
2229 * Makefile.in: Regenerated.
2230
4fda8867
NC
22312010-04-27 H.J. Lu <hongjiu.lu@intel.com>
2232 Nick Clifton <nickc@redhat.com>
2233
2234 * configure.ac (install_as_default): Define and set to false
2235 unless --enable-gold or --enable-gold=both/gold has been
2236 specified.
2237 * configure: Regenerate.
2238
2239 * Makefile.am (install-exec-local): Install the executable as
2240 'ld.gold'. If install_as_default is true then also install it as
2241 'ld'.
2242 * Makefile.in: Regenerated.
2243
bd288ea2
ILT
22442010-04-24 Ian Lance Taylor <iant@google.com>
2245
2246 * layout.cc (Layout::layout_reloc): In relocatable link don't
2247 combine reloc sections for grouped sections.
2248
ef38fd8a
ST
22492010-04-23 Sriraman Tallam <tmsriram@google.com>
2250
2251 * gc.h (gc_process_relocs): Pass information on relocs pointing to
2252 sections that are not ordinary to icf.
2253 * icf.cc (get_section_contents): Handle relocation pointing to section
2254 with no object or shndx information.
2255 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
2256 * testsuite/Makefile.in: Regenerate.
2257 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
2258 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
2259
f6973bdc
ILT
22602010-04-22 Ian Lance Taylor <iant@google.com>
2261
2262 * expression.cc (Expression::Expression_eval_info): Add
2263 result_alignment_pointer field.
2264 (Expression::eval_with_dot): Add result_alignment_pointer
2265 parameter. Change all callers.
2266 (Expression::eval_maybe_dot): Likewise.
2267 (class Binary_expression): Add alignment_pointer parameter to
2268 left_value and right_value. Change all callers.
2269 (BINARY_EXPRESSION): Set result alignment.
2270 (class Trinary_expression): Add alignment_pointer parameter to
2271 arg2_value and arg3_value. Change all callers.
2272 (Trinary_cond::value): Set result alignment.
2273 (Max_expression::value, Min_expression::value): Likewise.
2274 (Align_expression::value): Likewise.
2275 * script-sections.cc (class Sections_element): Add dot_alignment
2276 parameter to set_section_addresses virtual function. Update
2277 instantiations.
2278 (class Output_section_element): Likewise.
2279 (Script_sections::create_segments): Add dot_alignment parameter.
2280 Change all callers.
2281 (Script_sections::create_segments_from_phdrs_clause): Likewise.
2282 (Script_sections::set_phdrs_clause_addresses): Likewise.
2283 * script-sections.h: Update declarations.
2284 * script.h: Update declarations.
2285 * output.h (Output_segment::set_minimum_p_align): Don't decrease
2286 min_p_align.
2287 * testsuite/script_test_3.t: Set large alignment.
2288 * testsuite/script_test_3.sh: Make sure that at least one LOAD
2289 segment has expected alignment.
2290
9c9c98a5
NC
22912010-04-22 Nick Clifton <nickc@redhat.com>
2292
2293 * po/gold.pot: Updated by the Translation project.
2294 * po/vi.po: Updated Vietnamese translation.
2295
2253bfba
L
22962010-04-22 H.J. Lu <hongjiu.lu@intel.com>
2297
2298 * testsuite/Makefile.am (check_PROGRAMS): Add
2299 icf_virtual_function_folding_test.
2300 * testsuite/Makefile.in: Regenerated.
2301
85fdf906
AH
23022010-04-15 Andrew Haley <aph@redhat.com>
2303
2304 * options.h (merge_exidx_entries): New option.
2305 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
2306 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
2307 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
2308 (Target_arm::merge_exidx_entries): New function.
2309 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
2310 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
2311 to Arm_exidx_fixup constructor.
2312 Add new arg, merge_exidx_entries.
2313 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
2314 Arm_output_section::fix_exidx_coverage.
2315
ce97fa81
ST
23162010-04-18 Sriraman Tallam <tmsriram@google.com>
2317
2318 * icf.cc (get_section_contents): Check for preemptible functions.
2319 Ignore addend when appropriate.
2320 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
2321 section folded.
2322 (add_from_relobj): Check for section folded.
2323 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
2324 * symtab.h (should_add_dynsym_entry): Add new parameter.
2325 * target-reloc.h (scan_relocs): Check for section folded.
2326 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
2327 Check reloc types for function pointers in shared objects.
2328 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
2329 case.
2330 (icf_preemptible_functions_test): New test case.
2331 (icf_string_merge_test): New test case.
2332 * testsuite.Makefile.in: Regenerate.
2333 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
2334 bar_glob. Refactor code.
2335 * testsuite/icf_preemptible_functions_test.cc: New file.
2336 * testsuite/icf_preemptible_functions_test.sh: New file.
2337 * testsuite/icf_string_merge_test.cc: New file.
2338 * testsuite/icf_string_merge_test.sh: New file.
2339 * testsuite/icf_virtual_function_folding_test.cc: New file.
2340 * testsuite/icf_virtual_function_folding_test.sh: New file.
2341
04ceb17c
DK
23422010-04-14 Doug Kwan <dougkwan@google.com>
2343
2344 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
2345 for local symbol recounting if we remove a section due to ICF.
2346 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
2347 there are no regular objects in input.
2348
153e7da4
DK
23492010-04-13 Doug Kwan <dougkwan@google.com>
2350
2351 * arm.cc (Arm_input_section::set_final_data_size): Compute
2352 accurate final data size instead of using current data size.
2353
4dbd9faf
DK
23542010-04-09 Doug Kwan <dougkwan@google.com>
2355
2356 * layout.cc (Layout::choose_output_section): Handle script section
2357 types.
2358 (Layout::make_output_section_for_script): Add section type parameter.
2359 Handle script section types.
2360 * layout.h (Layout::make_output_section_for_script): Add section
2361 type parameter.
2362 * output.cc (Output_section::Output_section): Initialize data member
2363 is_noload_.
2364 (Output_section::do_reset_address_and_file_offset): Do not set address
2365 to 0 if section is a NOLOAD section.
2366 * output.h (Output_section::is_noload): New method.
2367 (Output_section::set_is_noload): Ditto.
2368 (Output_section::is_noload_): New data member.
2369 * script-c.h (Script_section_type): New enum type.
2370 (struct Parser_output_section_header): Add new file section_type.
2371 * script-sections.cc (Sections_element::output_section_name): Add
2372 parameter for returning script section type.
2373 (Output_section_definition::output_section_name): Ditto.
2374 (Output_section_definition::section_type)P; New method.
2375 (Output_section_definiton::script_section_type_name): Ditto.
2376 (Output_section_definition::script_section_type_): New data member.
2377 (Output_section_definition::Output_section_definition): Initialize
2378 data member Output_section_definition::script_section_type_.
2379 (Output_section_definition::create_sections): Pass script section type
2380 to Layout::make_output_section_for_script.
2381 (Output_section_definition::output_section_name): Return script
2382 section type to caller.
2383 (Output_section_definition::set_section_address): Do not advance
2384 dot value and load address if section type is NOLOAD. Set address
2385 of NOLOAD sections regardless of section flags.
2386 (Output_section_definition::print): Print section type if it is
2387 not SCRIPT_SECTION_TYPE_NONE.
2388 (Output_section_definition::section_type): New method.
2389 (Output_section_definition::script_section_type_name): Ditto.
2390 (Script_sections::output_section_name): Add new parameter
2391 PSECTION_TYPE for returning script section type. Pass it to
2392 section elements. Handle discard sections.
2393 (Sort_output_sections::operator()): Handle NOLOAD sections.
2394 * script-sections.h (Script_sections::Section_type): New enum type.
2395 (Script_sections::output_section_name): Add a new parameter for
2396 returning script section type.
2397 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
2398 INFO and NOLOAD.
2399 * yyscript.y (union): Add new field SECTION_TYPE.
2400 (COPY, DSECT, INFO, NOLOAD): New tokens.
2401 (opt_address_and_section_type): Change type to output_section_header.
2402 (section_type): New non-terminal
2403 (section_header): Handle section type.
2253bfba 2404 (opt_address_and_section_type): Return section type value.
4dbd9faf 2405
721ea635
L
24062010-04-09 H.J. Lu <hongjiu.lu@intel.com>
2407
2408 * testsuite/plugin_common_test_1.c (foo): Add prototype.
2409 * testsuite/plugin_common_test_2.c (foo): Likewise.
2410
6bf924b0
DK
24112010-04-08 Doug Kwan <dougkwan@google.com>
2412
2413 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
2414 Output_merge_data.
2415 * output.cc (Output_section::add_merge_input_section): Simplify
2416 code and return status of Output_merge_base::add_input_section.
e1df38aa 2417 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
2418 returns true.
2419
24af6f92
DK
24202010-04-07 Doug Kwan <dougkwan@google.com>
2421
2422 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
2423 if section is marked as containing instructions but has no mapping
2424 symbols.
2425 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
2426 correct section index.
2427 (Arm_relobj::find_linked_text_section): Ditto.
2428
00698fc5
CC
24292010-04-07 Cary Coutant <ccoutant@google.com>
2430
2431 * archive.cc (include_member): Destroy Read_symbols_data object before
2432 releasing file.
2433 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
2434 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
2435 (Read_symbols_data::~Read_symbols_data) New destructor.
2436 (Section_relocs::Section_relocs) New constructor.
2437 (Section_relocs::~Section_relocs) New destructor.
2438 (Read_relocs_data::Read_relocs_data) New constructor.
2439 (Read_relocs_data::~Read_relocs_data) New destructor.
2440 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
2441 pointers to NULL after deleting.
2442
7296d933
DK
24432010-04-07 Doug Kwan <dougkwan@google.com>
2444
2445 * arm.cc: Replace "endianity" with "endianness" in comments.
2446 (Arm_exidx_cantunwind): Ditto.
2447 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
2448 (Arm_relobj::merge_flags_and_attributes): New method.
2449 (Arm_relobj::merge_flags_and_attributes_): New data member.
2450 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
2451 (Arm_relobj::scan_sections_for_stubs): Ditto.
2452 (Arm_relobj::do_read_symbols): Check to see if we really want to
2453 merge processor-specific flags and attributes. Exit early if
2454 an object is empty except for section names and the undefined symbol.
2455 (Target_arm::do_finalize_sections): Move check for ELF format to
2456 Arm_relobj::do_read_symbols. Merge processor specific flags and
2457 attributes from a regular object only when we have determined that
2458 it is aapropriate. Do not create an .ARM.attributes section in
2459 output if there is no regular input object.
2460 (Target_arm::merge_processor_specific_flags): Check
2461 --warn-mismatch before printing any error.
2462 (Target_arm::merge_object_attributes): Ditto.
2463 * gold.cc (queue_middle_tasks): Handle the case in which there is
2464 no regular object in input.
2465 * options.cc (General_options::parse_EB): New method.
2466 (General_options::parse_EL): Same.
2467 (General_options::General_options): Initialize endianness_.
2468 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
2469 New options.
2470 (General_options::Endianness): New enum.
2471 (General_options::endianness): New method.
2472 (General_options::endianness_): New data member.
2473 * parameters.cc (Parameters::set_options): Check target endianness.
2474 (Parameters::set_target_once): Ditto.
2475 (Parameters::check_target_endianness): New method.
2476 (parameters_force_valid_target): If either -EL or -EB is specified,
2477 use it to define endianness of default target.
2478 * parameters.h (Parameters::check_target_endianness): New method
2479 declaration.
2480 * target.h (class Target): Change "endianity" to "endianness"
2481 in comments.
2482
efc8d4f2
RW
24832010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2484
2485 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
2486 * configure: Regenerate.
2487 * Makefile.in: Regenerate.
2488 * testsuite/Makefile.in: Regenerate.
2489
be234d88
CC
24902010-04-06 Cary Coutant <ccoutant@google.com>
2491
2492 gcc PR lto/42757
2493 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
2494 prevailing definitions of common symbols.
2495 * testsuite/plugin_test_6.sh: New test case.
2496 * testsuite/plugin_common_test_1.c: New test case.
2497 * testsuite/plugin_common_test_2.c: New test case.
2498 * testsuite/Makefile.am (plugin_test_6): New test case.
2499 * testsuite/Makefile.in: Regenerate.
2500
bd32c6bd
NC
25012010-04-06 Nick Clifton <nickc@redhat.com>
2502
2503 * po/vi.po: New Vietnamese translation.
2504
323c532f
DK
25052010-03-30 Doug Kwan <dougkwan@google.com>
2506
2507 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
2508
4fcd97eb
DK
25092010-03-25 Doug Kwan <dougkwan@google.com>
2510
2511 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
2512 to avoid a conversion warning on a 32-bit host.
2513
4ebf39db
ILT
25142010-03-24 Ian Lance Taylor <iant@google.com>
2515
2516 * testsuite/script_test_3.t: Add a TLS segment.
2517 * testsuite/Makefile.am (check_PROGRAMS): Add
2518 tls_phdrs_script_test.
2519 (tls_phdrs_script_test_SOURCES): Define.
2520 (tls_phdrs_script_test_DEPENDENCIES): Define.
2521 (tls_phdrs_script_test_LDFLAGS): Define.
2522 (tls_phdrs_script_test_LDADD): Define.
2523 * testsuite/Makefile.in: Rebuild.
2524
4a599bdd
CC
25252010-03-23 Cary Coutant <ccoutant@google.com>
2526
2527 * fileread.cc (find_or_make_view): Fix comment.
2528
6c93b22c
ILT
25292010-03-23 Ian Lance Taylor <iant@google.com>
2530
2531 * script-sections.cc (class Orphan_section_placement): Define
2532 PLACE_TLS and PLACE_TLS_BSS.
2533 (Orphan_section_placement::Orphan_section_placement): Initialize
2534 new places.
2535 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
2536 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
2537 (tls_script_test_SOURCES): Define.
2538 (tls_script_test_DEPENDENCIES): Define.
2539 (tls_script_test_LDFLAGS): Define.
2540 (tls_script_test_LDADD): Define.
2541 * testsuite/Makefile.in: Rebuild.
2542
a2c7281b
DK
25432010-03-22 Doug Kwan <dougkwan@google.com>
2544
2545 * arm.cc (Arm_relocate_functions::abs8,
2546 Arm_relocate_functions::abs16): Use correct check for overflow
2547 specified in the ARM ELF specs.
2548 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
2549 target of a BLX instruction specially.
2550 (Reloc_stub::stub_type_for_reloc): Ditto.
2551 (Relocate::relocate): Use symbolic names instead of numeric relocation
2552 codes to report error.
2553 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
2554 workaround.
2555 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
2556 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
2557 thumb2_blx_out_of_range.stdout
2558 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
2559 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
2560 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
2561 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
2562 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
2563 thumb2_blx_in_range, thumb2_blx_in_range.o,
2564 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
2565 thumb2_blx_out_of_range.o): New rules.
2566 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
2567 thumb2_blx_in_range and thumb2_blx_out_of_range.
2568 * testsuite/Makefile.in: Regenerate.
2569 * arm_branch_in_range.sh: Add tests for THUMB BLX.
2570 * testsuite/thumb_blx_in_range.s: New file.
2571 * testsuite/thumb_blx_out_of_range.s: New file.
2572
b0193076
RÁE
25732010-03-22 Rafael Espindola <espindola@google.com>
2574
2575 * archive.cc (Should_include): Move to archive.h.
2576 (should_include_member): Make it a member of Archive.
2577 (Lib_group): New.
2578 (Add_lib_group_symbols): New.
2579 * archive.h: Include options.h.
2580 (Archive_member): Moved from Archive.
2581 (Should_include): Moved from archive.cc.
2582 (Lib_group): New.
2583 (Add_lib_group_symbols): New.
2584 * dynobj.cc (do_should_include_member): New.
2585 * dynobj.h (do_should_include_member): New.
2586 * gold.cc (queue_initial_tasks): Update call to queue.
2587 * main.cc (main): Print lib group stats.
2588 * object.cc (do_should_include_member): New.
2589 * object.h: Include archive.h.
2590 (Object::should_include_member): New.
2591 (Object::do_should_include_member): New.
2592 (Sized_relobj::do_should_include_member): New.
2593 * options.cc (General_options::parse_start_lib): New.
2594 (General_options::parse_end_lib): New.
2595 (Input_arguments::add_file): Handle lib groups.
2596 (Input_arguments::start_group): Check we are not in a lib.
2597 (Input_arguments::start_lib): New.
2598 (Input_arguments::end_lib): New.
2599 * options.h (General_options): Add start_lib and end_lib.
2600 (Input_argument::lib_): New.
2601 (Input_argument::lib): New.
2602 (Input_argument::is_lib): New.
2603 (Input_file_lib): New.
2604 (Input_arguments::in_lib_): New.
2605 (Input_arguments::in_lib): New.
2606 (Input_arguments::start_lib): New.
2607 (Input_arguments::end_lib_): New.
2608 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
2609 in unused members as preempted.
2610 (Sized_pluginobj::do_should_include_member): New.
2611 * plugin.h (Sized_pluginobj::do_should_include_member): New.
2612 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
2613 return the blocker.
2614 (Read_symbols::do_whole_lib_group): New.
2615 (Read_symbols::do_lib_group): New.
2616 (Read_symbols::do_read_symbols): Handle lib groups.
2617 (Read_symbols::get_name): Handle lib groups.
2618 * readsyms.h (Read_symbols): Add an archive member pointer.
2619 (Read_symbols::do_whole_lib_group): New.
2620 (Read_symbols::do_lib_group): New.
2621 (Read_symbols::member_): New.
2622 * script.cc (read_input_script): Update call to queue_soon.
2623
d099120c
DK
26242010-03-19 Doug Kwan <dougkwan@google.com>
2625
2626 * arm.cc (Stub_table::Stub_table): Initialize new data members
2627 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
2628 (Stub_table::add_reloc_stub): Assign stub offset and update
2629 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
2630 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
2631 New data members.
2632 (Stub_table::update_data_size_and_addralign): Use
2633 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
2634 instead of going over all reloc stubs.
2635 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
2636 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
2637 Stringpool_template::offset_ to size of Stringpool_char.
2638 (Stringpool_template::new_key_offset): Remove code to initialize
2639 Stringpool_template::offset_.
2640 * stringpool.h (Stringpool_template::set_no_zero_null): Set
2641 Stringpool_template::offset_ to zero.
2642
1aa37384
DK
26432010-03-15 Doug Kwan <dougkwan@google.com>
2644
2645 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
2646 offset_.
2647 (Stringpool_template::new_key_offset): New method.
2648 (Stringpool_template::add_string): Assign offsets when adding new
2649 strings.
2650 (Stringpool_template::set_string_offsets): Do not set string offsets
2651 when not optimizing.
2652 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
2653 member size_.
2654 (Chunked_vector::clear): Clear size_.
2655 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
2656 (Chunked_vector::size): Return size_.
2657 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 2658 (Chunked_vector::size_): New data member.
1aa37384
DK
2659 (Stringpool_template::set_no_zero_null): Assert string set is empty.
2660 (Stringpool_template::new_key_offset): New method declaration.
2661 (Stringpool_template::offset_): New data member.
2662
b672b057
RÁE
26632010-03-15 Rafael Espindola <espindola@google.com>
2664
2665 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
2666 Add_symbols' constructor.
2667 * readsyms.h (Add_symbols): Remove the input_group member.
2668
b6848d3c
ILT
26692010-03-10 Ian Lance Taylor <iant@google.com>
2670
2671 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
2672 target to ask whether a reference to a symbol requires a stack
2673 split.
2674 * target.h (Target::is_call_to_non_split): New function.
2675 (Target::do_is_call_to_non_split): Declare virtual function.
2676 * target.cc: Include "symtab.h".
2677 (Target::do_is_call_to_non_split): New function.
2678 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
2679
a2a5469e
CC
26802010-03-10 Cary Coutant <ccoutant@google.com>
2681
2682 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
2683 (File_read::open[1]): Remove initial mapping of whole_file_view_.
2684 (File_read::open[2]): Add whole_file_view_ to list of views.
2685 (File_read::make_view): Remove test of whole_file_view_.
2686 (File_read::find_or_make_view): Create whole_file_view_ if
2687 necessary.
2688 (File_read::clear_views): Replace bool parameter with enum;
2689 adjust all callers. Don't delete views with permanent data;
2690 do delete cached views and views from archives if
2691 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
2692 if clearing the corresponding view.
2693 * fileread.h (File_read::Clear_views_mode): New enum.
2694 (File_read::View::is_permanent_view): New method.
2695 (File_read::clear_views): Replace bool parameter
2696 with enum; adjust all callers.
2697 * options.h (General_options): Change keep_files_mapped option;
2698 add map_whole_files.
2699 * readsyms.cc (Add_symbols::run): Delete sd_ object before
2700 releasing the file.
2701 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
2702 the file.
2703
8861f32b
DM
27042010-03-10 David S. Miller <davem@davemloft.net>
2705
2706 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
2707
d62d0f5f
ST
27082010-03-09 Sriraman Tallam <tmsriram@google.com>
2709
2710 * icf.cc (get_section_contents): Add '@' marker after processing the
2711 merge reloc.
2712
9177756d
DK
27132010-03-08 Doug Kwan <dougkwan@google.com>
2714
2715 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
2716 due to a conversion warning.
2717 (Arm_relobj::update_output_local_symbol_count): Check for local
2718 symbol with unset output index.
2719
9e9e071b
ILT
27202010-03-05 Ian Lance Taylor <iant@google.com>
2721
2722 * options.h (class General_options): Add --spare-dynamic-tags.
2723 * output.cc (Output_data_dynamic::set_final_data_size): Implement
2724 --spare-dynamic-tags.
2725
a81ee015
ILT
27262010-03-05 Ian Lance Taylor <iant@google.com>
2727
2728 * incremental.cc: Include "libiberty.h".
2729
44ec90b9
RO
27302010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2731
2732 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
2733 function, is_info_ member.
2734 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
2735 (Versions::Versions): Update caller.
2736 (Versions::define_base_version): Likewise.
2737 (Versions::add_def): Likewise.
2738
0897ed3b
ST
27392010-03-03 Sriraman Tallam <tmsriram@google.com>
2740
2741 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
2742 (Scan::possible_function_pointer_reloc): New function.
2743 (Scan::local_reloc_may_be_function_pointer): Change to call
2744 possible_function_pointer_reloc.
2745 (Scan::global_reloc_may_be_function_pointer): Ditto.
2746 * icf.h (Icf::check_section_for_function_pointers): Change to reject
2747 relocations in ".data.rel.ro._ZTV" section.
2748 * testsuite/icf_safe_so_test.sh: Change to pass i386.
2749 * testsuite/icf_safe_so_test.cc: Ditto.
2750 * testsuite/icf_safe_test.cc: Ditto.
2751 * testsuite/icf_safe_test.sh: Ditto.
2752
d3bbad62
ILT
27532010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2754 Ian Lance Taylor <iant@google.com>
2755
2756 * target-reloc.h (relocate_section): Check the symbol table index
2757 for -1U before setting the local symbol index.
2758 (scan_relocatable_relocs): If copying the relocation, record that
2759 the local symbol is required.
2760 * object.h (Symbol_value::is_output_symtab_index_set): New
2761 function.
2762 (Symbol_value::may_be_discarded_from_output_symtab): New
2763 function.
2764 (Symbol_value::has_output_symtab_entry): New function.
2765 (Symbol_value::needs_output_symtab_entry): Remove.
2766 (Symbol_value::output_symtab_index): Make sure the symbol index is
2767 set.
2768 (Symbol_value::set_output_symtab_index): Make sure the symbol
2769 index is not set. Make sure the new index is valid.
2770 (Symbol_value::set_must_have_output_symtab_entry): New function.
2771 (Symbol_value::has_output_dynsym_entry): New function.
2772 (Symbol_value::set_output_dynsym_index): Make sure the new index
2773 is valid.
2774 (Sized_relobj::set_must_have_output_symtab_entry): New function.
2775 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
2776 local symbol if permitted.
2777 (Sized_relobj::do_finalize_local_symbols): Call
2778 is_output_symtab_index_set rather than needs_output_symtab_entry.
2779 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
2780 rather than needs_output_symtab_entry. Call
2781 has_output_dynsym_entry rather than needs_output_dynsym_entry.
2782 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
2783 is_output_symtab_index_set rather than needs_output_symtab_entry.
2784 * testsuite/discard_locals_relocatable_test.c: New file.
2785 * testsuite/discard_locals_test.sh: Test -r.
2786 * testsuite/Makefile.am (check_DATA): Add
2787 discard_locals_relocatable_test1.syms,
2788 discard_local_relocatable_test2.syms.
2789 (MOSTLYCLEANFILES): Likewise. Also add
2790 discard_locals_relocatable_test1.lout and
2791 discard_locals_relocatable_test2.out.
2792 (discard_locals_relocatable_test1.syms): New target.
2793 (discard_locals_relocatable_test.o): New target.
2794 (discard_locals_relocatable_test1.out): New target.
2795 (discard_locals_relocatable_test2.syms): New target.
2796 (discard_locals_relocatable_test2.out): New target.
2797 (various): Add missing ../ld-new dependencies.
2798 * testsuite/Makefile.in: Rebuild.
2799
7e8ccf26
NC
28002010-03-03 Nick Clifton <nickc@redhat.com>
2801
2802 * po/fi.po: New Finnish translation.
2803
2a0ff005
DK
28042010-03-01 Doug Kwan <dougkwan@google.com>
2805
2806 * layout.cc (Layout::Layout): Force section types of .init_array*,
2807 .preinit_array* and .fini_array* sections.
2808 * output.cc (Output_section::Input_section_sort_entry::has_priority):
2809 Fix check of return value of std::string::find.().
2810 (Output_section::Input_section_sort_compare::operator()): Remove
2811 comment about .init_array.
2812 (Output_section::Input_section_sort_init_fini_compare::operator()):
2813 New method.
2814 (Output_section::sort_attached_input_sections): Handle .init_array
2815 and .fini_array specially.
2816 * output.h (Output_section::Inut_section_sort_compare): Update
2817 comment.
2818 (Output_section::Input_section_sort_init_fini_compare): New struct.
2819
c3e4ae29
DK
28202010-02-26 Doug Kwan <dougkwan@google.com>
2821
2822 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
2823 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
2824 * testsuite/debug_msg.sh: Avoid matching source line number for
2825 use of global variable undef_int.
2826
2fd9ae7a
DK
28272010-02-26 Doug Kwan <dougkwan@google.com>
2828
2829 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
2830 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
2831 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
2832 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
2833 * options.cc (General_options::General_options): Initialize member
2834 fix_v4bx_.
2835 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
2836 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
2837 and rm_no_fix_v4bx.stdout
2838 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
2839 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
2840 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
2841 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
2842 and arm_no_fix_v4bx.
2843 * Makefile.in: Regenerate.
2844 * testsuite/arm_fix_v4bx.s: New file.
2845 * testsuite/arm_fix_v4bx.sh: Ditto.
2846
67ec7d0b
DK
28472010-02-24 Doug Kwan <dougkwan@google.com>
2848
2849 * arm.cc (Target_arm::got_section): Make the .got section the first
2850 non RELRO section in the data segment.
2851 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
2852 suffixes of section names.
2853
10165461
DK
28542010-02-24 Doug Kwan <dougkwan@google.com>
2855
2856 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
2857 flags and attributes merging if an input file is a binary file.
2858 * fileread.cc (Input_file::open): Record format of original file.
2859 * fileread.h (Input_file::Format): New enum type.
2860 (Input_file::Input_file): Initialize data member format_.
2861 (Input_file::format): New method definition.
2862 (Input_file::format_):: New data member.
2863
4a54abbb
DK
28642010-02-24 Doug Kwan <dougkwan@google.com>
2865
2866 * arm.cc (Arm_output_data_got): New class.
2867 (ARM_TCB_SIZE): New constant
2868 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
2869 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
2870 If user uses a script with a SECTIONS clause, issue only a warning
2871 for a misplaced EXIDX input section. Otherwise, issue an error.
2872 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
2873 garbage collection.
2874 (Target_arm::got_mode_index_entry): Handle static linking.
2875 (Target_arm::Scan::local): Ditto.
2876 (Target_arm::Scan::global): Ditto.
2877 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
2878 all incorrectly implemented relocations.
e1df38aa 2879 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
2880 Arm_output_section::fix_exidx_coverage.
2881 * layout.cc (Layout::section_name_mapping): Remove trailing dots
2882 from ".ARM.exidx." and ".ARM.extab.".
2883
ca419a6f
ILT
28842010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2885
2886 * arm.cc (Target_arm::do_finalize_sections): Create attribute
2887 section if it does not already exist.
2888 * attributes.cc (Attributes_section_data::Attributes_section_data):
2889 Don't crash if size is zero.
2890
135b9c78
ILT
28912010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2892 Ian Lance Taylor <iant@google.com>
2893
2894 * gold.cc (queue_middle_tasks): If no input files were opened,
2895 exit.
2896 * workqueue.h (Task_function::Task_function): Assert that there is
2897 a blocker.
2898
bb0bfe4f
DK
28992010-02-22 Doug Kwan <dougkwan@google.com>
2900
2901 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
2902 * icf.cc (get_section_contents): Cast snprintf arguments to long long
2903 types to avoid warnings due to different uint64_t implementations
2904 on different hosts.
2905
2a2b6d42
DK
29062010-02-21 Doug Kwan <dougkwan@google.com>
2907
2908 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
2909 handling of the maximum backward branch offset.
2910 (Arm_relocate_functions::thumb_branch_common): Ditto.
2911 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
2912 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 2913 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
2914 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
2915 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
2916 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
2917 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
2918 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
2919 thumb_bl_out_of_range thumb_bl_out_of_range.o,
2920 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
2921 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
2922 thumb2_bl_out_of_range.o): New rules.
2923 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
2924 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
2925 thumb2_bl_out_of_range
2926 * testsuite/Makefile.in: Regenerate.
2927 * testsuite/arm_bl_in_range.s: New file.
2928 * testsuite/arm_bl_out_of_range.s: Ditto.
2929 * testsuite/arm_branch_in_range.sh: Ditto.
2930 * testsuite/arm_branch_range.t: Ditto.
2931 * testsuite/thumb2_branch_range.t: Ditto.
2932 * testsuite/thumb_bl_in_range.s: Ditto.
2933 * testsuite/thumb_bl_out_of_range.s: Ditto.
2934 * testsuite/thumb_branch_range.t: Ditto.
2935
b487ad64
ST
29362010-02-20 Sriraman Tallam <tmsriram@google.com>
2937
2938 * gc.h (gc_process_relocs): Change vectors to point to the new list.
2939 Add reloc offset information.
2940 * icf.cc (get_section_contents): Change iterators to point to the new
2941 vectors. Add reloc offset information to the contents.
2942 * icf.h (Icf::Sections_reachable_info): New typedef.
2943 (Icf::Sections_reachable_list): New typedef.
2944 (Icf::Offset_info): New typedef.
2945 (Icf::Reloc_info): New struct typedef.
2946 (Icf::Reloc_info_list): New typedef.
2947 (Icf::symbol_reloc_list): Delete method.
2948 (Icf::addend_reloc_list): Delete method.
2949 (Icf::section_reloc_list): Delete method.
2950 (Icf::reloc_info_list): New method.
2951 (Icf::reloc_info_list_): New member.
2952
f96accdf
DK
29532010-02-19 Doug Kwan <dougkwan@google.com>
2954
2955 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
2956 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
2957 * arm.cc (Arm_relocation_functions): New forward declaration.
2958 (Target_arm::Target_arm): Initialize new data members
2959 got_mod_index_offset_ and tls_base_symbol_defined_.
2960 (Target_arm::Relocate::relocate_tls): New method.
2961 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
2962 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
2963 New methods.
2964 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
2965 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
2966 (Target_arm::got_mod_index_offset_,
2967 Target_arm::tls_base_symbol_defined_): New data members.
2968 (Target_arm::Scan::local, Target::Scan::global,
2969 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
2970 relocations.
2971
c8761b9a
DK
29722010-02-18 Doug Kwan <dougkwan@google.com>
2973
2974 * arm.cc (Arm_relobj::find_linked_text_section): New method.
2975 (Arm_relobj::make_exidx_input_section): Pass section index of linked
2976 text section as a parameter becuase some broken tools may not set
2977 the link in section header.
2978 (Target_arm::has_got_section): New method.
2979 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
2980 without any mapping symbol as data only. Remove warning.
2981 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
2982 link in its section header, try to discover the link by inspecting the
2983 REL31 relocation at the beginning of the section.
2984 (Target_arm::Scan::check_non_pic): Report name of offending relocation
2985 in error message.
2986 (Target_arm::Scan::global): Treat any reference to the symbol
2987 _GLOBAL_OFFSET_TABLE_ as a GOT access.
2988
21bb3914
ST
29892010-02-12 Sriraman Tallam <tmsriram@google.com>
2990
2991 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
2992 (Scan::global_reloc_may_be_function_pointer): New function.
2993 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
2994 (Scan::global_reloc_may_be_function_pointer): New function.
2995 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
2996 (Scan::global_reloc_may_be_function_pointer): New function.
2997 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
2998 (Scan::global_reloc_may_be_function_pointer): New function.
2999 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
3000 (Scan::global_reloc_may_be_function_pointer): New function.
3001 (Scan::possible_function_pointer_reloc): New function.
3002 (Target_x86_64::can_check_for_function_pointers): New function.
3003 * gc.h (gc_process_relocs): Scan relocation types to determine if
3004 function pointers were taken for targets that support it.
3005 * icf.cc (Icf::find_identical_sections): Include functions for
3006 folding in safe ICF whose pointer is not taken.
3007 * icf.h (Secn_fptr_taken_set): New typedef.
3008 (fptr_section_id_): New member.
3009 (section_has_function_pointers): New function.
3010 (set_section_has_function_pointers): New function.
3011 (check_section_for_function_pointers): New function.
3012 * options.h: Fix comment for safe ICF option.
3013 * target.h (can_check_for_function_pointers): New function.
3014 * testsuite/Makefile.am: Add icf_safe_so_test test case.
3015 Modify icf_safe_test for X86-64.
3016 * testsuite/Makefile.in: Regenerate.
3017 * testsuite/icf_safe_so_test.cc: New file.
3018 * testsuite/icf_safe_so_test.sh: New file.
3019 * testsuite/icf_safe_test.cc (kept_func_3): New function.
3020 (main): Change to take pointer to function kept_func_3.
3021 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
3022 folding is done correctly for X86-64.
3023
0da6fa6c
DM
30242010-02-12 David S. Miller <davem@davemloft.net>
3025
3026 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
3027 is_symbolless parameter.
3028 (Output_reloc<SHT_REL>::is_symbolless): New.
3029 (Output_reloc<SHT_REL>::is_symbolless_): New.
3030 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
3031 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
3032 (Output_reloc<SHT_RELA>::is_symbolless): New.
3033 (Output_data_reloc::add_global): Handle is_symbolless.
3034 (Output_data_reloc::add_global_relative): Likewise.
3035 (Output_data_reloc::add_local): Likewise.
3036 (Output_data_reloc::add_local_relative): Likewise.
3037 (Output_data_reloc::add_symbolless_global_addend): New.
3038 (Output_data_reloc::add_symbolless_local_addend): New.
3039 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
3040 is_symbolless.
3041 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
3042 instead of ->is_relative_
3043 (Output_reloc::write): Likewise.
3044 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
3045 (Output_reloc::write_rel): Simplify.
3046
3047 * sparc.cc (Target_sparc::Scan::local): Use
3048 ->add_symbolless_local_addend as needed.
3049 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
3050 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
3051 based upon relocation offset.
3052
e4782e83
DK
30532010-02-11 Doug Kwan <dougkwan@google.com>
3054
3055 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
3056 (Target_arm::Scan::global): Ditto. Also remove a comment before the
3057 beginning of function.
3058 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
3059 and MOVT_ABS relocations. Those are non issued in scanning. Fix
3060 parameter is_32bit in calls to should_apply_static_reloc.
3061 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
3062 (check_DATA): Add arm_abs_global.stdout.
3063 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
3064 arm_abs_global.stdout): New rules.
3065 (MOSTLLYCLEANFILES): Add arm_abs_global
3066 * Makefile.in: Regenerate.
3067 * testsuite/arm_abs_global.s: New file.
3068 * testsuite/arm_abs_global.sh: Ditto.
3069 * testsuite/arm_abs_lib.s: Ditto.
3070
93ceb764
ILT
30712010-02-11 Ian Lance Taylor <iant@google.com>
3072
3073 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
3074 Read_relocs task.
3075 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
3076 Allocate_commons_task first.
3077 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
3078 task, rather than symtab_lock_.
3079 (Gc_process_relocs::~Gc_process_relocs): New function.
3080 (Gc_process_relocs::is_runnable): Check this_blocker_.
3081 (Gc_process_relocs::locks): Use next_blocker_ rather than
3082 blocker_.
3083 (Scan_relocs::~Scan_relocs): New function.
3084 (Scan_relocs::is_runnable): Check this_blocker_ rather than
3085 symtab_lock_.
3086 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
3087 next_blocker_.
3088 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
3089 fields. Add this_blocker_ and next_blocker_ fields. Adjust
3090 constructor accordingly.
3091 (class Gc_process_relocs): Likewise.
3092 (class Scan_relocs): Likewise.
3093 * common.h (class Allocate_commons_task): Remove symtab_lock_
3094 field, and corresponding constructor parameter.
3095 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
3096 symtab_lock_.
3097 (Allocate_commons_task::locks): Likewise.
3098
114dfbe1
ILT
30992010-02-11 Ian Lance Taylor <iant@google.com>
3100
3101 * gold-threads.h (class Once): Define.
3102 (class Initialize_lock): Rewrite as child of Once.
3103 * gold-threads.cc (class Once_initialize): Define.
3104 (once_pointer_control): New static variable.
3105 (once_pointer, once_arg): New static variables.
3106 (c_run_once): New static function.
3107 (Once::Once, Once::run_once, Once::internal_run): New functions.
3108 (class Initialize_lock_once): Remove.
3109 (initialize_lock_control): Remove.
3110 (initialize_lock_pointer): Remove.
3111 (initialize_lock_once): Remove.
3112 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
3113 (Initialize_lock::initialize): Rewrite.
3114 (Initialize_lock::do_run_once): New function.
3115 * archive.cc (Archive::interpret_header): Only clear name if it is
3116 not already empty.
3117 * fileread.cc: Include "gold-threads.h"
3118 (file_counts_lock): New static variable.
3119 (file_counts_initialize_lock): Likewise.
3120 (File_read::release): Only increment counts when using --stats.
3121 Use a lock around the increment.
3122 * parameters.cc (class Set_parameters_target_once): Define.
3123 (set_parameters_target_once): New static variable.
3124 (Parameters::Parameters): Move here from parameters.h.
3125 (Parameters::set_target): Rewrite.
3126 (Parameters::set_target_once): New function.
3127 (Parameters::clear_target): Move here and rewrite.
3128 * parameters.h (class Parameters): Update declarations. Add
3129 set_parameters_target_once_ field.
3130 (Parameters::Parameters): Move to parameters.cc.
3131 (Parameters::clear_target): Likewise.
3132 * readsyms.cc (Read_symbols::do_group): Create a Start_group
3133 task.
3134 (Start_group::~Start_group): New function.
3135 (Start_group::is_runnable): New function.
3136 (Start_group::locks, Start_group::run): New functions.
3137 (Finish_group::run): Change saw_undefined to size_t.
3138 * readsyms.h (class Start_group): Define.
3139 (class Finish_group): Change saw_undefined_ field to size_t.
3140 (Finish_group::Finish_group): Remove saw_undefined and
3141 this_blocker parameters. Change all callers.
3142 (Finish_group::set_saw_undefined): New function.
3143 (Finish_group::set_blocker): New function.
3144 * symtab.h (class Symbol_table): Change saw_undefined to return
3145 size_t. Change saw_undefined_ field to size_t.
3146 * target-select.cc (Set_target_once::do_run_once): New function.
3147 (Target_selector::Target_selector): Initialize set_target_once_
3148 field. Don't initialize lock_ and initialize_lock_ fields.
3149 (Target_selector::instantiate_target): Rewrite.
3150 (Target_selector::set_target): New function.
3151 * target-select.h (class Set_target_once): Define.
3152 (class Target_selector): Update declarations. Make
3153 Set_target_once a friend. Remove lock_ and initialize_lock_
3154 fields. Add set_target_once_ field.
3155
fa17a3f4
ILT
31562010-02-10 Ian Lance Taylor <iant@google.com>
3157
3158 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
3159 queueing any tasks.
3160 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
3161 (queue_middle_tasks): Add all blockers before queueing any tasks.
3162 (queue_final_tasks): Likewise.
3163 * token.h (Task_token::add_blockers): New function.
3164 * object.h (Input_objects::number_of_relobjs): New function.
3165
c7177d31
ILT
31662010-02-10 Ian Lance Taylor <iant@google.com>
3167
5de0e392
ILT
3168 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
3169 shared, not if not position independent.
3170 * x86_64.cc (Relocate::relocate_tls): Likewise.
3171 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
3172 (tls_pie_pic_test): New target.
3173 * testsuite/Makefile.in: Rebuild.
3174
c7177d31
ILT
3175 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
3176 (tls_test_main_pie.o, tls_test_pie.o): New targets.
3177 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
3178 * testsuite/Makefile.in: Rebuild.
3179
684b268a
DM
31802010-02-09 David S. Miller <davem@davemloft.net>
3181
3182 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
3183 R_SPARC_RELATIVE using ->add_local_relative().
3184 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
3185
612a8d3d
DM
3186 * output.h (Output_data_dynamic::add_section_size): New method
3187 that takes two Output_data objects.
3188 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
3189 entry param. Handle it in initializers.
3190 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
3191 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
3192 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
3193 arg.
3194 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
3195 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
3196 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
3197 for dynrel_includes_plt.
3198 * i386.cc (Target_i386::do_finalize_sections): Likewise.
3199 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
3200 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
3201 before .rela.plt
3202 (Target_sparc::do_finalize_sections): Update to pass true for
3203 dynrel_includes_plt.
3204 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
3205 output before .rela.plt
3206 (Target_powerpc::do_finalize_sections): Update to pass true for
3207 dynrel_includes_plt when 32-bit.
3208
cb1be87e
DK
32092010-02-08 Doug Kwan <dougkwan@google.com>
3210
3211 * arm.cc (Arm_relobj::simple_input_section_output_address): New
3212 method.
3213 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
3214 Arm_relobj::scan_section_for_cortex_a8_stubs,
3215 Arm_relobj::do_relocation_section): Instead of calling
3216 Output_section::output_address, use faster
3217 Arm_relobj::simple_input_section_output_address.
3218
705b5121
DM
32192010-02-08 David S. Miller <davem@davemloft.net>
3220
3221 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
3222 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
3223 relocation helper function.
3224
024c4466
DM
3225 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
3226 just like R_SPARC_GOT{10,13,22}.
3227 (Target_sparc::Scan::local): Likewise.
3228 (Target_sparc::Relocate:relocate): Likewise.
3229
9109c078
ILT
32302010-02-06 Ian Lance Taylor <iant@google.com>
3231
3232 * configure.ac: Rewrite targetobjs duplicate removal code to use
3233 only shell constructs.
3234 * configure: Rebuild.
3235
cf846138
DK
32362010-02-05 Doug Kwan <dougkwan@google.com>
3237
3238 PR 11247
3239 * arm.cc (Arm_relobj::section_is_scannable): New method.
3240 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
3241 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
3242
6cfaf60b
DK
32432010-02-04 Doug Kwan <dougkwan@google.com>
3244
3245 PR 11247
3246 * arm-reloc-property.cc (cstdio): Include.
3247 * configure.ac (targetobjs): Remove duplicates.
3248 * configure: Regenerate.
3249 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
3250 big and little endian version for a given address size.
3251
5c57f1be
DK
32522010-02-03 Doug Kwan <dougkwan@google.com>
3253
3254 * arm-reloc-property.cc
3255 (Arm_reloc_property_table::reloc_name_in_error_message): New method
3256 definition.
3257 * arm-reloc-property.h
3258 (Arm_reloc_property_table::get_implemented_static_reloc_property):
3259 New method definition.
3260 (Arm_reloc_property_table::reloc_name_in_error_message): New method
3261 declaration.
3262 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
3263 overflow to N.
3264 (GOT_PREL): Change implemented to Y.
3265 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
3266 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
3267 (Arm_relocate_functions::movw_abs_nc): Remove method.
3268 (Arm_relocate_functions::movt_abs): Ditto.
3269 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
3270 (Arm_relocate_functions::thm_movt_abs): Ditto.
3271 (Arm_relocate_functions::movw_rel_nc): Ditto.
3272 (Arm_relocate_functions::movw_rel): Ditto.
3273 (Arm_relocate_functions::movt_rel): Ditto.
3274 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
3275 (Arm_relocate_functions:thm_movw_rel): Ditto.
3276 (Arm_relocate_functions:thm_movt_rel): Ditto.
3277 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
3278 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
3279 New method definitions.
3280 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
3281 (Arm_relocation_functions::arm_grp_ldr): Ditto.
3282 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
3283 (Arm_relocation_functions::arm_grp_ldc): Ditto.
3284 (Target_arm::Relocate::relocate): Check for non-static or
3285 unimplemented relocation code and exit early. Change calls to
3286 Target_arm::reloc_uses_thumb_bit and
3287 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
3288 instead. Refactor code to handle similar relocations to increase
3289 code sharing. Remove check for unsupported relocation code in switch
3290 statement.
3291 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
3292 relocation property table to find out size. Change error message to
3293 print out the name of a relocation code instead of the numeric value.
3294 (Target_arm::scan_reloc_for_stub): Use relocation property table
3295 instead of calling Target_arm::reloc_uses_thumb_bit().
3296
218c5831
DK
32972010-02-02 Doug Kwan <dougkwan@google.com>
3298
3299 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
3300 types of relaxed input section.
3301
0d31c79d
DK
33022010-02-02 Doug Kwan <dougkwan@google.com>
3303
3304 * Makefile.am (HFILES): Add arm-reloc-property.h.
3305 (DEFFILES): New.
3306 (TARGETSOURCES): Add arm-reloc-property.cc
3307 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
3308 (libgold_a_SOURCES): $(DEFFILES)
3309 * Makefile.in: Regenerate.
3310 * arm-reloc-property.cc: New file.
3311 * arm-reloc-property.h: New file.
3312 * arm-reloc.def: New file.
3313 * arm.cc: Update comments.
3314 (arm-reloc-property.h): New included header.
3315 (arm_reloc_property_table): New global variable.
3316 (Target_arm::do_select_as_default_target): New method definition.
3317 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
3318 arm-reloc-property to targ_extra_obj.
3319 * parameters.cc (set_parameters_target): Call
3320 Target::select_as_default_target().
3321 * target.h (Target::select_as_default_target): New method definition.
3322 (Target::do_select_as_default_target): Same.
3323
546c7457
DK
33242010-02-01 Doug Kwan <dougkwan@google.com>
3325
3326 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
3327 first_output_text_section_.
3328 (Arm_exidx_fixup::first_output_text_section): New method definition.
3329 (Arm_exidx_fixup::first_output_text_section_): New data member.
3330 (Arm_exidx_fixup::process_exidx_section): Record the first text
3331 output section seen.
3332 (Arm_output_section::fix_exidx_coverage): Set correct linked section
3333 and entsize in output section header.
3334
11b861d5
DK
33352010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3336
3337 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
3338 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
3339 (Arm_relocate_functions::thm_alu11): New Method.
3340 (Arm_relocate_functions::thm_pc8): New Method.
3341 (Arm_relocate_functions::thm_pc12): New Method.
3342 (Target_arm::Scan::local): Handle the relocations.
3343 (Target_arm::Scan::global): Likewise.
3344 (Target_arm::Relocate::relocate): Likewise.
3345 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
3346
c9a2c125
DK
33472010-01-29 Doug Kwan <dougkwan@google.com>
3348
3349 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
3350 of relocation types as ld.
3351
1521477a
DK
33522010-01-29 Doug Kwan <dougkwan@google.com>
3353
3354 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
3355 to public.
3356 (Arm_relocate_functions::thumb_branch_common): Ditto.
3357 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
3358 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
3359 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
3360 Arm_relocate_functions::jump24): Remove.
3361 (Target_arm::Relocate::relocate): Adjust code to call
3362 Arm_relocation_functions::arm_branch_common and
3363 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 3364 wrappers. Merge switch-cases together to reduce source code size.
1521477a 3365
e7eca48c
DK
33662010-01-29 Doug Kwan <dougkwan@google.com>
3367
3368 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
3369 output_local_symbol_count_needs_update_.
3370 (Arm_relobj::output_local_symbol_count_needs_update,
3371 Arm_relobj::set_output_local_symbol_count_needs_update,
3372 Arm_relobj::update_output_local_symbol_count): New methods.
3373 (Arm_relobj::output_local_symbol_count_needs_update_): New data
3374 member.
3375 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
3376 of pointed function as in a R_ARM_PREL31 relocation.
3377 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
3378 for output local symbol count updating.
3379 (Target_arm::do_relax): Update output local symbol counts in objects
3380 if necessary.
3381 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
3382
02961d7e
ILT
33832010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3384
3385 * arm.cc: Added support for the ARM relocations:
3386 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
3387 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
3388 (Arm_relocate_functions::movw_rel_nc): Renamed (was
3389 movw_prel_nc).
3390 (Arm_relocate_functions::movw_rel): New method.
3391 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
3392 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
3393 thm_movw_prel_nc).
3394 (Arm_relocate_functions::thm_movw_rel): New method.
3395 (Arm_relocate_functions::thm_movt_rel): Renamed (was
3396 thm_movt_prel).
3397 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
3398 relocations.
3399 (Target_arm::Scan::global): Likewise.
3400 (Target_arm::Relocate::relocate): Likewise.
3401 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
3402 Likewise.
3403
b10d2873
ILT
34042010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3405
3406 * arm.cc: Added support for ARM group relocations.
3407 (Target_arm::reloc_needs_sym_origin): New method.
3408 (Arm_relocate_functions::calc_grp_kn): New method.
3409 (Arm_relocate_functions::calc_grp_residual): New method.
3410 (Arm_relocate_functions::calc_grp_gn): New method.
3411 (Arm_relocate_functions::arm_grp_alu): New Method.
3412 (Arm_relocate_functions::arm_grp_ldr): New Method.
3413 (Arm_relocate_functions::arm_grp_ldrs): New Method.
3414 (Arm_relocate_functions::arm_grp_ldc): New Method.
3415 (Target_arm::Scan::local): Handle the ARM group relocations.
3416 (Target_arm::Scan::global): Likewise.
3417 (Target_arm::Relocate::relocate): Likewise.
3418 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
3419 Likewise.
3420
2b328d4e
DK
34212010-01-26 Doug Kwan <dougkwan@google.com>
3422
3423 * arm.cc (set): Include.
3424 (class Arm_exidx_fixup): Change type of last_input_section_ to const
3425 pointer type.
3426 (Arm_output_section::Text_section_list): New type.
3427 (Arm_output_section::append_text_sections_to_list): New method.
3428 (Arm_output_section::fix_exidx_coverage): Ditto.
3429 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
3430 (Arm_relobj::convert_input_section_to_relaxed_section): Use
3431 Relobj::set_section_offset() instead of
3432 Sized_relobj::invalidate_section_offset().
3433 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
3434 parameter for section headers. Ignore relocation sections for
3435 unallocated sections and EXIDX sections.
3436 (Target_arm::fix_exidx_coverage): New method.
3437 (Target_arm::output_section_address_less_than): New type.
3438 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
3439 linked text section instead of the EXIDX section.
3440 (Arm_output_section::create_stub_group): Add an assertion to check
3441 that this is not an EXIDX output section.
3442 (Arm_output_section::append_text_sections_to_list): New method.
3443 (Arm_output_section::fix_exidx_coverage): Ditto.
3444 (Arm_relobj::scan_sections_for_stubs): Adjust call to
3445 Arm_relobj::section_needs_reloc_stub_scanning.
3446 (Target_arm::do_relax): Fix EXIDX output section coverage in the
3447 first pass.
3448 (Target_arm::fix_exidx_coverage): New method.
3449 * object.h (Relobj::set_output_section): New method.
3450 (Sized_relobj::invalidate_section_offset): Remove method.
3451 (Sized_relobj::do_invalidate_section_offset): Remove method.
3452 (Sized_relobj::do_set_section_offset): Handle offset value -1.
3453
c7f3c371
DK
34542010-01-25 Doug Kwan <dougkwan@google.com>
3455
3456 * arm.cc (Arm_exidx_merged_section::do_output_offset):
3457 Fix warning due to signed and unsigned comparison on a 32-bit host.
3458
8923b24c
DK
34592010-01-22 Doug Kwan <dougkwan@google.com>
3460
3461 * arm.cc (Target_arm::do_relax): Record an output section for section
3462 offset adjustment it contains any stub table that has changed.
3463 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
3464 offsets in an output section if necessary.
3465 * output.cc (Output_section::Output_section): Initialize
3466 section_offsets_need_adjustments_.
3467 (Output_section::add_input_section_for_script): Renamed to
3468 Output_section::add_simple_input_section.
3469 (Output_section::save_states): Add a comment.
3470 (Output_section::discard_states): New method defintion.
3471 (Output_section::adjust_section_offsets): Same.
3472 * output.h (Output_section::add_input_section_for_script): Renamed to
3473 Output_section::add_simple_input_section.
3474 (Output_section::discard_states): New method declaration.
3475 (Output_section::adjust_section_offsets): Same.
3476 (Output_section::section_offsets_need_adjustment,
3477 Output_section::set_section_offsets_need_adjustment): New method
3478 definitions.
3479 (Output_section::section_offsets_need_adjustment_): New data member.
3480 * script-sections.cc
3481 (Output_section_element_input::set_section_address): Adjust code for
3482 renaming of Output_section::add_input_section_for_script.
3483 (Orphan_output_section::set_section_address): Same.
3484
9b2fd367
DK
34852010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3486
3487 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
3488 Fix_v4bx enum values .
3489 * gold/options.h (General_options): New option definitions.
3490 (General_options::fix_v4bx): New method.
3491 (General_options::Fix_v4bx): New enum.
3492 * gold/options.cc (General_options::parse_fix_v4bx): New method.
3493 (General_options::parse_fix_v4bx_interworking): New method.
3494
80d0d023
DK
34952010-01-22 Doug Kwan <dougkwan@google.com>
3496
3497 * arm.cc (Arm_exidx_fixup): New class.
3498
af2cdeae
DK
34992010-01-21 Doug Kwan <dougkwan@google.com>
3500
3501 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
3502 classes.
3503 (Arm_exidx_section_offset_map): New type.
3504
993d07c1
DK
35052010-01-21 Doug Kwan <dougkwan@google.com>
3506
3507 * arm.cc (Arm_exidx_input_section): New class.
3508 (Arm_relobj::exidx_input_section_by_link,
3509 Arm_relobj::exidx_input_section_by_shndx,
3510 Arm_relobj::make_exidx_input_section): New methods.
3511 (read_arm_attributes_section): Remove.
3512 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
3513 information about them.
3514 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
3515 to here.
3516
5ac169d4
DK
35172010-01-20 Doug Kwan <dougkwan@google.com>
3518
3519 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
3520 Input_section_specifier to Section_id.
3521 (Target_arm::new_arm_input_section: Adjust code for change of key
3522 type.
3523 (Target_arm::find_arm_input_section): Ditto.
3524 * gc.h (object.h): Include for Section_id nand Section_id_hash.
3525 (Section_id): Remove.
3526 (Garbage_collection::Section_id_hash): Remove.
3527 * icf.h (object.h): Include for Section_id nand Section_id_hash.
3528 (Section_id): Remove.
3529 (Icf::Section_id_hash): Remove.
3530 * object.h (Section_id, Const_section_id, Section_id_hash,
3531 Const_section_id_hash): New type definitions.
3532 * output.cc (Output_section::add_relaxed_input_section): Change to
3533 use Const_section_id instead of Input_section_specifier as key type.
3534 (Output_section::add_merge_input_section): Ditto.
3535 (Output_section::build_relaxation_map): Change to use Section_id
3536 instead of Input_section_specifier as key type.
3537 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
3538 Ditto.
3539 (Output_section::convert_input_sections_to_relaxed_sections): Change
3540 to use Const_section_id instead of Input_section_specifier as key type.
3541 (Output_section::find_merge_section): Ditto.
3542 (Output_section::find_relaxed_input_section): Ditto.
3543 * output.h (Input_section_specifier): Remove class.
3544 (Output_section::Output_section_data_by_input_section_map): Change
3545 key type to Const_section_id.
3546 (Output_section::Output_relaxed_input_section_by_input_section_map):
3547 Ditto.
3548 (Output_section::Relaxation_map): Change key type to Section_id.
3549
a2162063
ILT
35502010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3551
3552 * gold/arm.cc: Added support for R_ARM_V4BX relocation
3553 (class Arm_v4bx_stub): New class.
3554 (DEF_STUBS): Updated definition to support v4_veneer_bx.
3555 (Stub_factory::make_arm_v4bx_stub): New method.
3556 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
3557 (Stub_table::empty): Handle v4bx stubs.
3558 (Stub_table::add_arm_v4bx_stub): New method.
3559 (Stub_table::find_arm_v4bx_stub): New method.
3560 (Arm_relocate_functions::v4bx): New method.
3561 (Target_arm::fix_v4bx): New method.
3562 (Target_arm::Target_arm): Handle R_ARM_V4BX.
3563 (Stub_table::relocate_stubs): Likewise.
3564 (Stub_table::do_write): Likewise.
3565 (Stub_table::update_data_size_and_addralign): Likewise.
3566 (Stub_table::finalize_stubs): Likewise.
3567 (Target_arm::Scan::local): Likewise.
3568 (Target_arm::Scan::global): Likewise.
3569 (Target_arm::do_finalize_sections): Likewise.
3570 (Target_arm::Relocate::relocate): Likewise.
3571 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
3572 Likewise.
3573 (Target_arm::scan_reloc_for_stub): Likewise.
3574 (Target_arm::scan_reloc_section_for_stubs): Likewise.
3575
5696ab0b
ILT
35762010-01-19 Ian Lance Taylor <iant@google.com>
3577
3578 * output.cc (Output_section_headers::do_sized_write): Write large
3579 segment count to sh_info field.
3580 (Output_file_header::do_sized_write): For large segment count,
3581 write PN_XNUM to e_phnum field.
3582
800d0f56
ILT
35832010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3584
3585 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
3586 (Arm_relocate_functions::thm_jump8): New function.
3587 (Arm_relocate_functions::thm_jump11): New function.
3588 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
3589 R_ARM_THM_JUMP11.
3590 (Target_arm::Scan::global): Likewise.
3591 (Target_arm::Relocate::relocate): Likewise.
3592 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
3593 Likewise.
3594
41263c05
DK
35952010-01-14 Doug Kwan <dougkwan@google.com>
3596
3597 * arm.cc (map, utility): Include headers.
3598 (Target_arm::apply_cortex_a8_workaround): New method.
3599 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
3600 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
3601 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
3602 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
3603 the --[no-]fix-cortex-a8 command line options.
3604 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
3605 (Target_arm::relocate_stub): Use addend in instruction template.
3606 * options.h (DEFINE_bool): Set the user-set flag.
3607 (General_options): Add --[no-]-fix-cortex options.
3608 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 3609 : Update fast look-up map after conversion.
41263c05 3610
459e9b03
ST
36112010-01-14 Sriraman Tallam <tmsriram@google.com>
3612
3613 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
3614 in the first pass of do_layout.
3615
b521dfe4
DK
36162010-01-13 Doug Kwan <dougkwan@google.com>
3617
3618 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
3619 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
3620 apparent compiler problem of not folding static constant integral
3621 data members of elfcpp::Elf_sizes<32>.
3622
44272192
DK
36232010-01-13 Doug Kwan <dougkwan@google.com>
3624
3625 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
3626 Arm_relobj::section_needs_cortex_a8_stub_scanning,
3627 Arm_relobj::scan_section_for_cortex_a8_erratum,
3628 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
3629 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
3630 sections to scan for relocation stubs into a new method
3631 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
3632 relocation and Cortex-A8 stub scanning.
3633 (Target_arm::do_relax): Force stubs to be after stubbed sections
3634 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 3635 the beginning of a new relaxation pass. Update a comment.
44272192
DK
3636 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
3637
44b71ece
ILT
36382010-01-12 Ian Lance Taylor <iant@google.com>
3639
3640 * target-reloc.h (visibility_error): New inline function.
3641 (relocate_section): Call visibility_error.
3642 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
3643 (MOSTLYCLEANFILES): Likewise.
3644 (protected_4_pic.o, protected_3.err): New targets.
3645 * testsuite/protected_4.cc: New file.
3646
a120bc7f
DK
36472010-01-12 Doug Kwan <dougkwan@google.com>
3648
3649 * arm.cc (Cortex_a8_reloc): New class.
3650 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
3651 and cortex_a8_relocs_info_.
3652 (Target_arm::fix_cortex_a8): New method definition.
3653 (Target_arm::Cortex_a8_relocs_info): New type.
3654 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
3655 New data member declarations.
3656 (Target_arm::scan_reloc_for_stub): Record information about
3657 relocations for THUMB branches that might be exempted from the
3658 Cortex-A8 workaround.
3659 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
3660 at the beginning of a relaxation pass.
3661
20138696
DK
36622010-01-12 Doug Kwan <dougkwan@google.com>
3663
3664 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
3665 (Arm_relobj::Mapping_symbol_position,
3666 Arm_reloj::Mapping_symbol_position_less,
3667 Arm_relobj::Mapping_symbols_info): New types.
3668 (Target_arm::is_mapping_symbol_name): New method definition.
3669 (Arm_relobj::do_count_local_symbols): Save information about mapping
3670 symbols.
3671
089d69dc
DK
36722010-01-11 Doug Kwan <dougkwan@google.com>
3673
3674 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
3675 Arm_relocate_functions::thumb32_branch_upper,
3676 Arm_relocate_functions::thumb32_branch_lower,
3677 Arm_relocate_functions::thumb32_cond_branch_offset,
3678 Arm_relocate_functions::thumb32_cond_branch_upper,
3679 Arm_relocate_functions::thumb32_cond_branch_lower,
3680 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
3681 branch offset encoding.
3682 (Arm_relocate_functions::thumb_branch_common): Use new branch
3683 offset encoding methods to avoid code duplication.
3684 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
3685 (Stub_addend_reader::operator()): Use new branch encoding method
3686 to avoid code duplication.
3687
99e5bff2
DK
36882010-01-11 Doug Kwan <dougkwan@google.com>
3689
3690 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
3691 (Target_arm::do_finalize_sections): Define special EXIDX section
3692 symbols only if referenced.
3693 * gc.h (Garbage_collection::add_reference): New method.
3694 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
3695 code duplication.
3696
98e090bd
ILT
36972010-01-11 Ian Lance Taylor <iant@google.com>
3698
d0a91bd8
ILT
3699 * script.cc (Version_script_info::build_expression_list_lookup):
3700 Change complaing about duplicate wildcard match from error to
3701 warning.
3702
98e090bd
ILT
3703 * script.cc (class Lazy_demangler): Recreate--revert part of patch
3704 of 2009-12-30.
3705 (Version_script_info::Version_script_info): Initialize globs_,
3706 default_version_, default_is_global_, and exact_. Don't
3707 initialize globals_ or locals_.
3708 (Version_script_info::build_lookup_tables): Build local symbols
3709 first.
3710 (Version_script_info::unquote): New function.
3711 (Version_script_info::add_exact_match): New function.
3712 (Version_script_info::build_expression_list_lookup): Remove lookup
3713 parameter. Add is_global parameter. Change all callers. Handle
3714 wildcard pattern specially. Unquote pattern. Call
3715 add_exact_match.
3716 (Version_script_info::get_name_to_match): New function.
3717 (Version_script_info::get_symbol_version): New function.
3718 (Version_script_info::get_symbol_version_helper): Remove.
3719 (Version_script_info::check_unmatched_names): Call unquote.
3720 * script.h (class Version_script_info): Change get_symbol_version
3721 to be non-inline and add is_global parameter; change all callers.
3722 Rewrite symbol_is_local. Update declarations. Define struct
3723 Version_tree_match, Exact, Globs. Don't define struct Lookup.
3724 Remove globals_ and locals_ members. Add exact_, globs_,
3725 default_version_, is_global_.
3726 (Version_script_info::Glob): Remove pattern, add expression and
3727 is_global. Update constructor. Change all callers.
3728 * dynobj.cc (Versions::finalize): Mark the version symbol as the
3729 default version.
3730 (Versions::symbol_section_contents): If a symbol is undefined, or
3731 defined in a dynamic object, set the version index to
3732 VER_NDX_LOCAL.
3733 * symtab.cc (Symbol_table::add_from_relobj): Don't call
3734 symbol_is_local.
3735 (Symbol_table::add_from_pluginobj): Likewise.
3736 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
3737
d56962d3
DK
37382010-01-11 Doug Kwan <dougkwan@google.com>
3739
3740 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
3741 (incremental_dump_LDADD): Add linking option for libintl.
3742 * Makefile.in: Regenerate.
3743
94e6ee91
L
37442010-01-11 H.J. Lu <hongjiu.lu@intel.com>
3745
3746 PR gold/11144
3747 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
3748 instead of -Ds.
3749 * testsuite/Makefile.in: Regenerated.
3750
e96c574b
DK
37512010-01-10 Doug Kwan <dougkwan@google.com>
3752
3753 * options.h (DEFINE_var): Use parentheses around argument varname__
3754 in macro body to avoid any unintended subsequent substitutions.
3755
7198066b
ILT
37562010-01-10 Ian Lance Taylor <iant@google.com>
3757
ba4d53bf
ILT
3758 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
3759 candidates before doing symbol resolution.
3760
7198066b
ILT
3761 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
3762 ODR candidates if only one is weak.
3763
a2beed37
ILT
37642010-01-08 Ian Lance Taylor <iant@google.com>
3765
3766 * script.cc (Version_script_info::build_expression_list_lookup):
3767 Don't warn about ambiguous version, just record the ambiguity.
3768 (Version_script_info::get_symbol_version_helper): Give error if
3769 version is ambiguous.
3770
2fb7225c
DK
37712010-01-08 Doug Kwan <dougkwan@google.com>
3772
3773 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
3774 prev_data_size_ and prev_addralign_. Remove initializer for
3775 deleted data member has_been_changed_.
3776 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
3777 to determine if the table is empty.
3778 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
3779 Remove.
3780 (Stub_table::add_reloc_stub): Define method in class definition
3781 instead of just declaring it there.
3782 (Stub_table::add_cortex_a8_stub): New method definition.
3783 (Stub_table::update_data_size_and_addralign): Ditto.
3784 (Stub_table::finalize_stubs): Ditto.
3785 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
3786 (Stub_table::do_addralign_): Return address alignment in the
3787 (Stub_table::do_reset_address_and_file_offset): Define method in
3788 class definition instead of declaring it there. Set current data
3789 size to be the data size of the previous pass.
3790 (Stub_table::set_final_data_size): Use current data size as the
3791 final data size.
3792 (Stub_table::relocate_stub): Change parameter type of stub from
3793 Reloc_stub pointer to Stub pointer.
3794 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
3795 (Stub_table::Cortex_a8_stub_list): New typedef.
3796 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
3797 Stub_table::prev_addralign_): New data member.
3798 (Arm_relobj::Arm_relobj): Initialize data member
3799 section_has_cortex_a8_workaround_.
3800 (Arm_relobj::section_has_cortex_a8_workaround,
3801 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
3802 definitions.
3803 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
3804 declarations.
3805 (Target_arm::relocate_stub): Change parameter type of stub from
3806 Reloc_stub pointer to Stub pointer.
3807 (Insn_template::size, Insn_template::alignment): Handle
3808 THUMB16_SPECIAL_TYPE.
3809 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
3810 Stub_table::update_data_size_and_addralign,
3811 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
3812 definitions.
3813 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
3814 (Stub_table::do_write): Ditto.
3815 (Target_arm::do_relax): Adjust code for changes in Stub_table.
3816
880cd20d
ILT
38172010-01-08 Ian Lance Taylor <iant@google.com>
3818
3819 PR 11108
3820 * symtab.h (class Symbol): Remove fields is_target_special_ and
3821 has_plt_offset_. Add field is_defined_in_discarded_section_.
3822 (Symbol::is_defined_in_discarded_section): New function.
3823 (Symbol::set_is_defined_in_discarded_section): New function.
3824 (Symbol::has_plt_offset): Rewrite.
3825 (Symbol::set_plt_offset): Verify that new offset is not -1U.
3826 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
3827 Don't initialize is_target_special_ or has_plt_offset_.
3828 Initialize is_defined_in_discarded_section_.
3829 (Symbol_table::add_from_relobj): If appropriate, set
3830 is_defined_in_discarded_section.
3831 * resolve.cc (Symbol::override_base_with_special): Don't test
3832 is_target_special_. Change has_plt_offset_ to has_plt_offset().
3833 * target-reloc.h (relocate_section): Do special handling for
3834 symbols defined in discarded sections for global symbols as well
3835 as local symbols.
3836
2703e3eb
ILT
38372010-01-08 Ian Lance Taylor <iant@google.com>
3838
3839 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
3840 the SHT_SYMTAB case.
3841
339d40a3
ILT
38422010-01-08 Ian Lance Taylor <iant@google.com>
3843
3844 * object.cc (Sized_relobj::do_layout): Don't get confused if
3845 layout_eh_frame returns NULL.
3846
abecea76
ILT
38472010-01-08 Ian Lance Taylor <iant@google.com>
3848
3849 PR 11084
3850 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
3851 dynamic symbol table, use the normal symbol table.
3852 (Sized_dynobj::do_read_symbols): Remove assertion about type of
3853 symbol table.
3854
6b7dd3f3
ILT
38552010-01-08 Ian Lance Taylor <iant@google.com>
3856
3857 PR 11072
3858 * layout.cc (Layout::include_section): Remove .gnu_debuglink
3859 sections.
3860
36c50e63
L
38612010-01-08 H.J. Lu <hongjiu.lu@intel.com>
3862
3863 * version.cc (print_version): Change to "Copyright 2010".
3864
e291e7b9
ILT
38652010-01-08 Ian Lance Taylor <iant@google.com>
3866
3867 PR 10287
3868 PR 11063
3869 * i386.cc (class Target_i386): Change return type of plt_section
3870 to be non-const.
3871 (class Output_data_plt_i386): Add tls_desc_rel_ field.
3872 (Output_data_plt_i386::Output_data_plt_i386): Initialize
3873 tls_desc_rel_ field.
3874 (Output_data_plt_i386::rel_tls_desc): New function.
3875 (Target_i386::rel_tls_desc_section): New function.
3876 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
3877 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
3878 R_386_TLS_DESC reloc in rel_tls_desc_section.
3879 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
3880 Define struct Tlsdesc_info.
3881 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
3882 (Target_x86_64::do_reloc_symbol_index): New function.
3883 (Target_x86_64::add_tlsdesc_info): New function.
3884 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
3885 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
3886 tlsdesc_rel_ field.
3887 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
3888 all callers.
3889 (Output_data_plt_x86_64::rela_tlsdesc): New function.
3890 (Target_x86_64::rela_tlsdesc_section): New function.
3891 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
3892 handling.
3893 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
3894 (Target_x86_64::do_reloc_addend): New function.
3895 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
3896 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
3897 declarations. Define TARGET_CODE. Add arg field to u1_ union.
3898 (Output_reloc::type): New function.
3899 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
3900 (Output_reloc::is_target_specific): New function.
3901 (Output_reloc::target_arg): New function.
3902 (class Output_reloc) [SHT_RELA]: Add four new constructors for
3903 absolute relocs and target specific relocs.
3904 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
3905 add_target_specific.
3906 (class Output_data_reloc) [SHT_RELA]: Likewise.
3907 * output.cc (Output_reloc::Output_reloc): Add four new versions
3908 for absolute relocs and target specific relocs.
3909 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
3910 (Output_reloc::get_symbol_index): Likewise.
3911 (Output_reloc::local_section_offset): Check that local_sym_index_
3912 is not TARGET_CODE or 0.
3913 (Output_reloc::symbol_value): Likewise.
3914 (Output_reloc::write) [SHT_RELA]: Call target for target specific
3915 reloc.
3916 * target.h (class Target): Add reloc_symbol_index and reloc_addend
3917 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
3918 functions.
3919 * layout.cc (add_target_dynamic_tags): Use output section for
3920 DT_PLTRELSZ and DT_JMPREL.
3921
3a44184e
ILT
39222010-01-07 Ian Lance Taylor <iant@google.com>
3923
3924 PR 11061
3925 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
3926 function.
3927 (class Output_data_reloc_generic): Define.
3928 (class Output_data_reloc_base): Change base class to
3929 Output_data_reloc_generic. Change add() method to call
3930 bump_relative_reloc_count for a relative reloc. Remove
3931 sort_relocs_ field.
3932 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
3933 to sort_relocs().
3934 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
3935 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
3936 appropriate.
3937 * layout.h (class Layout): Update declaration.
3938
ea715a34
ILT
39392010-01-07 Ian Lance Taylor <iant@google.com>
3940
3941 * output.h (class Output_data): Add const version of
3942 output_section and do_output_section.
3943 (class Output_section_data): Add const version of
3944 do_output_section.
3945 (class Output_section): Likewise.
3946 * layout.cc (Layout::add_target_dynamic_tags): New function.
3947 * layout.h (class Layout): Update declarations.
3948 * arm.cc (Target_arm::do_finalize_sections): Use
3949 add_target_dynamic_tags.
3950 * i386.cc (Target_i386::do_finalize_sections): Likewise.
3951 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
3952 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
3953 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
3954
659948a4
ILT
39552010-01-07 Ian Lance Taylor <iant@google.com>
3956
3957 PR 11042
3958 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
3959 object as needed.
3960
9d3b86f6
ILT
39612010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
3962 Ian Lance Taylor <iant@google.com>
3963
3964 PR 11019
3965 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
3966 Xindex::read_symtab_xindex.
3967
bb0d3eb0
DK
39682010-01-07 Doug Kwan <dougkwan@google.com>
3969
3970 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
3971 (Insn_template::thumb16_bcond_insn): New method declaration.
3972 (Insn_template): Fix spelling.
3973 (Stub::thumb16_special): New method declaration.
3974 (Stub::do_write): Define virtual method which was previously pure
3975 virtual.
3976 (Stub::do_thumb16_special): New method declaration.
3977 (Stub::do_fixed_endian_write): New template member.
3978 (Reloc_stub::do_write): Remove.
3979 (Reloc_stub::do_fixed_endian_write): Remove.
3980 (Cortex_a8_stub): New class definition.
3981 (Stub_factory::make_cortex_a8_stub): New method definition.
3982 (Stub_factory::Stub_factory): Add missing static storage class
3983 qualifier for elf32_arm_stub_a8_veneer_blx.
3984
ffeef7df
ILT
39852010-01-07 Ian Lance Taylor <iant@google.com>
3986
dc3f80fe
ILT
3987 PR 10980
3988 * options.h (class General_options): Add --warn-unresolved-symbols
3989 and --error-unresolved-symbols.
3990 * errors.cc (Errors::undefined_symbol): Implement
3991 --warn-unresolved-symbols.
3992
ffeef7df
ILT
3993 * options.h (class General_options): Add -z text and -z textoff.
3994 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
3995
f1ec9ded
ST
39962010-01-06 Sriraman Tallam <tmsriram@google.com>
3997
3998 * gc.h (Garbage_collection::Cident_section_map): New typedef.
3999 (Garbage_collection::cident_sections): New function.
4000 (Garbage_collection::add_cident_section): New function.
4001 (Garbage_collection::cident_sections_): New member.
4002 (gc_process_relocs): Add references to sections whose names are C
4003 identifiers.
4004 * gold.h (cident_section_start_prefix): New constant.
4005 (cident_section_stop_prefix): New constant.
4006 (is_cident): New function.
4007 * layout.cc (Layout::define_section_symbols): Replace string constants
4008 with the newly defined constants.
4009 * object.cc (Sized_relobj::do_layout): Track sections whose names are
4010 C identifiers.
4011 * testsuite/Makefile.am: Add gc_orphan_section_test.
4012 * testsuite/Makefile.in: Regenerate.
4013 * testsuite/gc_orphan_section_test.cc: New file.
4014 * testsuite/gc_orphan_section_test.sh: New file.
4015
6eda8c29
ILT
40162010-01-06 Ian Lance Taylor <iant@google.com>
4017
b9674e17
ILT
4018 PR 10980
4019 * options.h (class General_options): Add --warn-shared-textrel.
4020 * layout.cc (Layout::finish_dynamic_section): Implement
4021 --warn-shared-textrel.
4022
6eda8c29
ILT
4023 PR 10980
4024 * options.h (class General_options): Add --warn-multiple-gp.
4025
32dcd44e
ILT
40262010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4027
4028 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
4029 $(THREADSLIB) and $(LIBDL).
4030 * Makefile.in: Rebuild.
4031
a192ba05
ILT
40322010-01-06 Ian Lance Taylor <iant@google.com>
4033
4034 PR 10980
4035 * options.cc (General_options::parse_section_start): New function.
4036 (General_options::section_start): New function.
4037 (General_options::General_options): Initialize all members.
4038 * options.h: Include <map>
4039 (class General_options): Add --section-start. Add section_starts_
4040 member.
4041 * layout.cc (Layout::attach_allocated_section_to_segment): If
4042 --section-start was used, set the address of the segment. Remove
4043 local sort_sections.
4044 (Layout::relaxation_loop_body): If the address of the load segment
4045 has been set by --section-start, don't use it.
4046 * output.h (Output_segment::update_flags_for_output_section): New
4047 function.
4048 * output.cc (Output_segment::add_output_section): Call
4049 update_flags_for_output_section.
4050
dde3f402
ILT
40512010-01-05 Ian Lance Taylor <iant@google.com>
4052
62dfdd4d
ILT
4053 PR 10980
4054 * options.h (class General_options): Add --undefined-version.
4055 * script.cc (struct Version_expression): Add was_matched_by_symbol
4056 field.
4057 (Version_script_info::matched_symbol): New function.
4058 (Version_script_info::get_symbol_version_helper): Call
4059 matched_symbol.
4060 (Version_script_info::check_unmatched_names): New function.
4061 * script.h (class Version_script_info): Update declarations.
4062 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
4063
9c4ae156
ILT
4064 * options.h (class General_options): Use DEFINE_bool_alias for
4065 allow_multiple_definition.
4066 * resolve.cc (Symbol_table::should_override): Don't test
4067 allow_multiple_definition.
4068
dde3f402
ILT
4069 PR 10980
4070 * options.h (class General_options): Add --cref.
4071 * main.cc (main): Print cref table if --cref. Don't close mapfile
4072 until after printing cref table.
4073 * cref.cc: Include "symtab.h".
4074 (class Cref_inputs): Define Cref_table_compare and Cref_table.
4075 (Cref_table_compare::operator()): New function.
4076 (Cref_inputs::gather_cref): New function.
4077 (filecol): New static const.
4078 (Cref_inputs::print_cref): New function.
4079 (Cref::print_cref): New function.
4080 * cref.h: Include <cstdio>.
4081 (class Cref): Update declarations.
4082 * mapfile.h (Mapfile::file): New function.
4083 * object.h (class Object): Define Symbols. Declare virtual
4084 do_get_global_symbols.
4085 (Object::get_global_symbols): New function.
4086 * object.cc (Input_objects::add_object): Pass object to cref_ if
4087 --cref.
4088 (Input_objects::archive_start): Likewise.
4089 (Input_objects::archive_stop): Likewise.
4090 (Input_objects::print_cref): New function.
4091 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
4092 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
4093 --cref.
4094 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
4095 function.
4096 * plugin.h (class Sized_pluginobj): Update declarations.
4097
8781f709
ILT
40982010-01-05 Ian Lance Taylor <iant@google.com>
4099
4100 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
4101 to is_default_version. Rename insdef to insdefault.
4102 (Symbol_table::add_from_relobj): Rename def to is_default_version
4103 and local to is_forced_local.
4104 (Symbol_table::add_from_pluginobj): Likewise.
4105 (Symbol_table::add_from_dynobj): Likewise.
4106 (Symbol_table::define_special_symbol): Rename insdef to
4107 insdefault.
4108
fe35d28d
ILT
41092010-01-04 Ian Lance Taylor <iant@google.com>
4110
30bc8c46
ILT
4111 PR 10980
4112 * options.h (class General_options): Add
4113 --allow-multiple-definition and -z muldefs.
4114 * resolve.cc (Symbol_table::should_override): Don't warn about a
4115 multiple symbol definition if --allow-multiple-definition or -z
4116 muldefs.
4117
7eaea549
ILT
4118 PR 10980
4119 * options.h (class General_options): Add --add-needed and
4120 --copy-dt-needed-entries. Tweak --as-needed help entry.
4121 * object.cc (Input_objects::check_dynamic_dependencies): Give an
4122 error if --copy-dt-needed-entries aka --add-needed is used and
4123 would cause a change in behaviour.
4124
fe35d28d
ILT
4125 PR 10980
4126 * options.h (class General_options): Add -G as a short version of
4127 --shared. Add no-op options -assert, -g, and -i.
4128
55a2bb35
ST
41292010-01-04 Sriraman Tallam <tmsriram@google.com>
4130
4131 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
4132 check for .text or .gnu.linkonce.t sections.
4133 * icf.cc (Icf::find_identical_sections): Ditto.
4134 Change the detection for mangled function name within the section
4135 name.
4136 * icf.h (is_section_foldable_candidate): New function.
4137
719328e1
ILT
41382009-12-30 Ian Lance Taylor <iant@google.com>
4139
4140 PR 10980
4141 * options.h (class General_options): Permit two dashes with
4142 --retain-symbols-file.
4143
d7bb5745
ILT
41442009-12-30 Ian Lance Taylor <iant@google.com>
4145
403a15dd
ILT
4146 PR 10979
4147 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
4148 don't put the file header and segment headers in the text
4149 segment.
4150
eda294df
ILT
4151 PR 10979
4152 * common.cc (Sort_commons::operator()): Stabilize sort when both
4153 entries are NULL.
4154 (Symbol_table::do_allocate_commons_list): When allocating common
4155 symbols, skip a symbol which is no longer common.
4156 * symtab.h (Symbol::is_common): Test whether the symbol comes from
4157 an object before checking its type.
4158 * testsuite/common_test_2.c: New file.
4159 * testsuite/common_test_3.c: New file.
4160 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
4161 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
4162 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
4163 (common_test_2_pic.o, common_test_2.so): New targets.
4164 (common_test_3_pic.o, common_test_3.so): New targets.
4165 * testsuite/Makefile.in: Rebuild.
4166
d7bb5745
ILT
4167 PR 10979
4168 * script.cc (read_input_script): If we see a new SECTIONS clause,
4169 and we have added an input section, give an error.
4170 * layout.h (class Layout): Add have_added_input_section function.
4171 Add have_added_input_section_ field.
4172 * layout.cc (Layout::Layout): Initialize
4173 have_added_input_section_.
4174 (Layout::layout): Set have_added_input_section_.
4175 (Layout::layout_eh_frame): Likewise.
4176
fc59c572
ILT
41772009-12-30 Ian Lance Taylor <iant@google.com>
4178
4179 PR 10931
4180 * options.h (class General_options): Add --sort-common option.
4181 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
4182 * common.cc (Sort_common): Add sort_order parameter to
4183 constructor. Add sort_order_ field.
4184 (Sort_commons::operator): Check sort_order_.
4185 (Symbol_table::allocate_commons): Determine the sort order.
4186 (Symbol_table::do_allocate_commons): Add sort_order parameter.
4187 Change all callers.
4188 (Symbol_table::do_allocate_commons_list): Likewise.
4189
1c74fab0
ILT
41902009-12-30 Ian Lance Taylor <iant@google.com>
4191
4192 PR 10916
4193 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
4194 symbols from this object, don't change the visibility of an
4195 undefined symbol.
4196 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
4197
6affe781
ILT
41982009-12-30 Ian Lance Taylor <iant@google.com>
4199
4200 PR 10861
4201 * script.h (class Version_script_info): Define Language enum.
4202 Update declarations. Define Glob, Exact, and Lookup types. Add
4203 new fields globals_, locals_, and is_finalized_.
4204 * script.cc: Various formatting fixes.
4205 (class Parser_closure): Change language_stack_ from a vector of
4206 std::string to one of Version_script_info::Language. Adjust all
4207 uses accordingly.
4208 (class Lazy_demangler): Remove.
4209 (struct Version_expression): Change language from std::string to
4210 Version_script_info::Language.
4211 (Version_script_info::Version_script_info): New function.
4212 (Version_script_info::~Version_script_info): Don't call clear.
4213 (Version_script_info::finalize): New function.
4214 (Version_script_info::build_lookup_tables): New function.
4215 (Version_script_info::build_expression_list_lookup): New
4216 function.
4217 (Version_script_info::get_symbol_version_helper): Rewrite to use
4218 lookup tables.
4219 (Version_script_info::print_expression_list): Adjust to use
4220 Version_script_info::Language.
4221 (script_push_lex_into_version_mode): Check that the version script
4222 has not been finalized.
4223 (version_script_push_lang): Change language string to
4224 Version_script_info::Language.
4225 * options.cc (Command_line::version_script): New function.
4226 * options.h (class General_options): Add finalize_dynamic_list
4227 function. Change version_script from declaration to definition.
4228 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
4229 * testsuite/version_script.map: Remove duplicate def of foo.
4230 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
4231 version_script.map.
4232 * testsuite/Makefile.in: Rebuild.
4233
818bf354
ILT
42342009-12-30 Ian Lance Taylor <iant@google.com>
4235
4236 PR 10843
4237 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
4238 if the input symbol index is 0, make the output symbol index 0.
4239
ebcc8304
ILT
42402009-12-30 Ian Lance Taylor <iant@google.com>
4241
4242 PR 10670
4243 * options.h (class General_options): Add -x/--discard-all.
4244 * object.cc (Sized_relobj::do_count_local_symbols): Handle
4245 --discard-all. If the local symbol needs a dynamic entry, check
4246 that before handling --discard-locals.
4247
176fe33f
ILT
42482009-12-30 Ian Lance Taylor <iant@google.com>
4249
bb321bb1
ILT
4250 PR 10450
4251 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
4252 flags to PF_R.
4253 (Output_segment::add_output_section): Don't change the flags if
4254 the type is PT_TLS.
4255
176fe33f
ILT
4256 PR 10450
4257 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
4258 GNU hash table if they need a dynamic value. Otherwise, don't add
4259 them if they are defined in a dynamic object or are forced local.
4260
e8cd95c7
ILT
42612009-12-29 Ian Lance Taylor <iant@google.com>
4262
1b81fb71
ILT
4263 PR 10450
4264 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
4265 .gnu.hash table for a 32-bit target.
4266
8d6d383d
ILT
4267 PR 10450
4268 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
4269 regular and a dynamic object only needs a dynamic symbol table
4270 entry if it is externally visible.
4271
e785ec03
ILT
4272 PR 10450
4273 * i386.cc (class Target_i386): Initialize global_offset_table_ in
4274 constructor. Add global_offset_table_ field.
4275 (Target_i386::got_section): Set global_offset_table_.
4276 (Target_i386::do_finalize_sections): Set global_offset_table_
4277 size.
4278 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
4279 in constructor. Add global_offset_table_ field.
4280 (Target_x86_64::got_section): Set global_offset_table_.
4281 (Target_x86_64::do_finalize_sections): Set global_offset_table_
4282 size.
4283
1a2dff53
ILT
4284 * layout.cc (Layout::Layout): Initialize increase_relro_.
4285 (Layout::get_output_section): Add is_relro, is_last_relro, and
4286 is_first_non_relro parameters. Change all callers.
4287 (Layout::choose_output_section): Likewise.
4288 (Layout::add_output_section_data): Likewise.
4289 (Layout::make_output_section): Likewise.
4290 (Layout::set_segment_offsets): Clear increase_relro when using a
4291 linker script.
4292 * layout.h (class Layout): Add increase_relro method. Add
4293 increase_relro_ field. Update declarations.
4294 * output.cc (Output_section::Output_section): Initialize
4295 is_last_relro_ and is_first_non_relro_.
4296 (Output_segment::add_output_section): Group relro sections is
4297 do_sort is true. Handle is_last_relro and is_first_non_relro.
4298 (Output_segment::maximum_alignment): Remove relro handling.
4299 (Output_segment::set_section_addresses): Add increase_relro
4300 parameter. Change all callers. Add initial alignment to align
4301 relro sections on separate page. Remove old relro handling.
4302 (Output_segment::set_section_list_addresses): Remove in_relro
4303 parameter. Change all callers.
4304 (Output_segment::set_offset): Add increase parameter. Change all
4305 callers. Remove old relro handling.
4306 * output.h (class Output_section): Add new methods: is_last_relro,
4307 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
4308 Add is_last_relro_ and is_first_non_relro_ fields.
4309 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
4310 Create separate .got.plt section. Call increase_relro.
4311 * x86_64.cc (Target_x86_64::got_section): Likewise.
4312 * testsuite/relro_script_test.t: Add .got.plt.
4313
f0ba79e2
ILT
4314 PR 10450
4315 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
4316 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
4317 (Layout::finalize): Call set_dynamic_symbol_size.
4318 (Layout::set_dynamic_symbol_size): New function.
4319 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
4320 set_dynamic_symbol_size.
4321
e8cd95c7
ILT
4322 PR 10450
4323 * output.h (class Output_section): Add is_entsize_zero_ field.
4324 * output.cc (Output_section::Output_section): Initialize
4325 is_entsize_zero_.
4326 (Output_section::set_entsize): If two different entsizes are
4327 requested, force it to zero.
4328 (Output_section::add_input_section): Set flags for .debug_str
4329 before updating section flags. Set entsize.
4330 (Output_section::update_flags_for_input_section): Set SHF_MERGE
4331 and SHF_STRING if all input sections have those flags.
4332
3e1b9a8a
RÁE
43332009-12-29 Rafael Espindola <espindola@google.com>
4334
4335 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
4336 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
4337 reporting.
3e1b9a8a 4338
3dcad376
ST
43392009-12-29 Sriraman Tallam <tmsriram@google.com>
4340
4341 * options.cc (General_options::parse_version): Allow -v to exit
4342 without an error if there is nothing to link.
4343
084e2665
ILT
43442009-12-29 Ian Lance Taylor <iant@google.com>
4345
4346 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
4347 using a version of gcc before 4.1.
4348 * configure: Rebuild.
4349
250acde3
CD
43502009-12-28 Chris Demetriou <cgd@google.com>
4351
4352 * attributes.cc (Output_attributes_section_data::do_write): Use
4353 std::vector::front rather than std::vector::data.
4354
99fff23b
ILT
43552009-12-28 Ian Lance Taylor <iant@google.com>
4356
4357 * symtab.h (class Symbol_table): Add enum Defined.
4358 * resolve.cc (Symbol_table::should_override): Add defined
4359 parameter. Change all callers. Test whether object is NULL
4360 before calling a method on it.
4361 (Symbol_table::report_resolve_problem): Add defined parameter.
4362 Change all callers.
4363 (Symbol_table::should_override_with_special): Likewise.
4364 * symtab.cc (Symbol_table::define_in_output_data): Add defined
4365 parameter. Change all callers.
4366 (Symbol_table::do_define_in_output_data): Likewise.
4367 (Symbol_table::define_in_output_segment): Likewise.
4368 (Symbol_table::do_define_in_output_segment): Likewise.
4369 (Symbol_table::define_as_constant): Likewise.
4370 (Symbol_table::do_define_as_constant): Likewise.
4371 * script.h (class Symbol_assignment): Add is_defsym parameter to
4372 constructor; change all callers.
4373 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
4374 parameter. Change all callers. Add is_defsym_ field.
4375 (class Parser_closure): Add parsing_defsym parameter to
4376 constructor; change all callers. Add parsing_defsym accessor
4377 function. Add parsing_defsym_ field.
4378
556bd683
ILT
43792009-12-28 Ian Lance Taylor <iant@google.com>
4380
4381 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 4382 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 4383
1782c879
ILT
43842009-12-23 Ian Lance Taylor <iant@google.com>
4385
4386 * i386.cc (Target_i386::do_calls_non_split): Recognize
4387 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
4388 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
4389 -fsplit-stack prologue when using %r11.
1782c879 4390
329ca2b1
ST
43912009-12-21 Sriraman Tallam <tmsriram@google.com>
4392
4393 * options.cc (General_options::parse_version): Make -v continue and do
4394 the link like GNU ld does.
4395
d675ff46
RÁE
43962009-12-17 Rafael Avila de Espindola <espindola@google.com>
4397
4398 * Makefile.am (CCFILES): Add timer.cc.
4399 (HFILES): Add timer.h.
4400 * configure.ac: Check for sysconf and times.
4401 * main.cc: include timer.h.
4402 (main): Use Timer instead of get_run_time.
4403 * timer.cc: New.
4404 * timer.h: New.
4405 * workqueue.cc: include timer.h.
4406 (Workqueue::find_and_run_task):
4407 Report user, sys and wall time.
4408 * Makefile.in: Regenerate.
4409 * config.in: Regenerate.
4410 * configure: Regenerate.
4411
d6344fb5
DK
44122009-12-16 Doug Kwan <dougkwan@google.com>
4413
4414 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
4415 sections.
4416 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
4417 relaxed input sections.
4418 * output.cc (Output_section::find_relaxed_input_section): Change
4419 return type to Output_relaxed_input_section pointer. Adjust code
4420 for new type of relaxed_input_section_map_.
4421 * output.h (Output_section::find_relaxed_input_section): Change
4422 return type to Output_relaxed_input_section pointer.
4423 (Output_section::Output_relaxed_input_section_by_input_section_map):
4424 New type.
4425 (Output_section::relaxed_input_section_map_): Change type to
4426 Output_section::Output_relaxed_input_section_by_input_section_map.
4427 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
4428 input section.
4429
0e0d5469
ILT
44302009-12-15 Ian Lance Taylor <iant@google.com>
4431
4432 * layout.cc (Layout::create_shstrtab): Only write out after input
4433 sections if we are compressing debug sections.
4434
0649a889
ILT
44352009-12-15 Ian Lance Taylor <iant@google.com>
4436
4437 * archive.cc (Archive::add_symbols): Only look up a symbol without
4438 a version if there is, in fact, a version.
4439
2ea97941
ILT
44402009-12-14 Ian Lance Taylor <iant@google.com>
4441
4442 Revert -Wshadow changes, all changes from:
4443 2009-12-11 Doug Kwan <dougkwan@google.com>
4444 2009-12-11 Nick Clifton <nickc@redhat.com>
4445 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
4446
b0eec2cc
DK
44472009-12-11 Doug Kwan <dougkwan@google.com>
4448
4449 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
4450 due to -Wshadow.
4451 * attributes.cc (Object_attribute::size): Ditto.
4452 (Attributes_section_data::size): Ditto.
4453 (Attributes_section_data::Attributes_section_data): Ditto.
4454 (Output_attributes_section_data::do_write): Ditto.
4455 * attributes.h (Object_attribute::set_type): Ditto.
4456 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
4457
91d6fa6a
NC
44582009-12-11 Nick Clifton <nickc@redhat.com>
4459
4460 * archive.cc: Fix shadowed variable warnings.
4461 * arm.cc: Likewise.
4462 * compressed_output.cc: Likewise.
4463 * compressed_output.h: Likewise.
4464 * configure: Likewise.
4465 * dwarf_reader.cc: Likewise.
4466 * dynobj.cc: Likewise.
4467 * dynobj.h: Likewise.
4468 * ehframe.cc: Likewise.
4469 * ehframe.h: Likewise.
4470 * errors.cc: Likewise.
4471 * expression.cc: Likewise.
4472 * fileread.cc: Likewise.
4473 * fileread.h: Likewise.
4474 * freebsd.h: Likewise.
4475 * i386.cc: Likewise.
4476 * icf.cc: Likewise.
4477 * incremental.h: Likewise.
4478 * layout.cc: Likewise.
4479 * layout.h: Likewise.
4480 * mapfile.cc: Likewise.
4481 * merge.cc: Likewise.
4482 * merge.h: Likewise.
4483 * object.cc: Likewise.
4484 * object.h: Likewise.
4485 * options.h: Likewise.
4486 * output.cc: Likewise.
4487 * output.h: Likewise.
4488 * parameters.cc: Likewise.
4489 * plugin.cc: Likewise.
4490 * powerpc.cc: Likewise.
4491 * reduced_debug_output.cc: Likewise.
4492 * reduced_debug_output.h: Likewise.
4493 * reloc.cc: Likewise.
4494 * reloc.h: Likewise.
4495 * resolve.cc: Likewise.
4496 * script-sections.cc: Likewise.
4497 * script.cc: Likewise.
4498 * script.h: Likewise.
4499 * sparc.cc: Likewise.
4500 * symtab.cc: Likewise.
4501 * symtab.h: Likewise.
4502 * target-select.cc: Likewise.
4503 * target-select.h: Likewise.
4504 * token.h: Likewise.
4505 * workqueue.cc: Likewise.
4506 * workqueue.h: Likewise.
4507 * x86_64.cc: Likewise.
4508
a0351a69
DK
45092009-12-10 Doug Kwan <dougkwan@google.com>
4510
4511 * arm.cc (attributes.h): New include.
4512 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
4513 (Arm_relobj::~Arm_relobj): Delete object pointed by
4514 attributes_section_data_.
4515 (Arm_relobj::attributes_section_data): New method definition.
4516 (Arm_relobj::attributes_section_data_): New data member declaration.
4517 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
4518 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
4519 attributes_section_data_.
4520 (Arm_dynobj::attributes_section_data): New method definition.
4521 (Arm_dynobj::attributes_section_data_): New data member declaration.
4522 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
4523 initialization value of may_use_blx_ to false.
4524 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
4525 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
4526 object attributes to compute results instead of hard-coding.
4527 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
4528 Target_arm::get_secondary_compatible_arch,
4529 Target_arm::set_secondary_compatible_arch
4530 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
4531 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
4532 New method declarations.
4533 (Target_arm::get_aeabi_object_attribute): New method definition.
4534 (Target_arm::attributes_section_data_): New data member declaration.
4535 (read_arm_attributes_section): New template definition.
4536 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
4537 (Arm_dynobj::do_read_symbols): Ditto.
4538 (Target_arm::do_finalize_sections): Merge attributes sections from
4539 input. Check for BLX use after attributes section merging.
4540 Fix __exidx_start and __exidx_end visibility. Create an
4541 .ARM.attributes section if necessary.
4542 (Target_arm::get_secondary_compatible_arch,
4543 Target_arm::set_secondary_compatible_arch,
4544 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
4545 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 4546 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
4547 New method definitions.
4548
b59befec
ILT
45492009-12-09 Ian Lance Taylor <iant@google.com>
4550
4551 * plugin.cc (Plugin::load): Don't cast from void* to a function
4552 pointer.
4553
1276bc89
ILT
45542009-12-09 Ian Lance Taylor <iant@google.com>
4555
4556 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
4557 information fields.
4558
2f2de248
L
45592009-12-09 H.J. Lu <hongjiu.lu@intel.com>
4560
4561 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
4562 Replace two_file_shared_1.so with two_file_shared_2.so.
4563 * testsuite/Makefile.in: Regenerated.
4564
4f787271
DK
45652009-12-08 Doug Kwan <dougkwan@google.com>
4566
4567 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
4568 (HFILES): Add attributes.h and int_encoding.h.
4569 * Makefile.in: Regenerate.
4570 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
4571 function definitions to int_encoding.cc
4572 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
4573 prototypes to int_encoding.h
4574 * reduced_debug_output.cc (int_encoding.h): New include.
4575 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
4576 function definitions to int_encoding.cc
4577 (insert_into_vector, read_from_pointer): Move template definitions to
4578 int_encoding.h
4579 * attributes.cc: New file.
4580 * attributes.h: New file.
4581 * int_encoding.cc: New file.
4582 * int_encoding.h: New file.
4583
20b52f1a
RÁE
45842009-12-07 Rafael Avila de Espindola <espindola@google.com>
4585
4586 PR gold/11055
4587 * incremental-dump.cc (dump_incremental_inputs): New.
4588 (main): Use dump_incremental_inputs.
4589
53d7974c
L
45902009-12-07 H.J. Lu <hongjiu.lu@intel.com>
4591
4592 PR gold/10893
4593 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
4594 checking elfcpp::STT_FUNC.
4595 (Target_i386::Relocate::relocate): Likewise.
4596 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4597
4598 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
4599 symbols from shared libraries into normal FUNC symbols.
4600
4601 * symtab.h (Symbol): Add is_func and use it.
4602
05a352e6
DK
46032009-12-05 Doug Kwan <dougkwan@google.com>
4604
4605 * arm.cc (Target_arm::arm_info): Initialize new fields
4606 attributes_section and attributes_vendor.
4607 * i386.cc (Target_i386::i386_info): Same.
4608 * object.cc (Sized_relobj::do_layout): Skip attribute section.
4609 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
4610 fields attributes_section and attributes_vendor.
53d7974c 4611 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
4612 * target.h (Target::attributes_section, Target::attributes_vendor,
4613 Target::is_attributes_section, Target::attribute_arg_type,
4614 Target::attributes_order): New method definitions.
4615 (Target::Target_info::attributes_section,
4616 Target::Target_info::attributes_vendor): New fields.
4617 (Target::do_attribute_arg_type, Target::do_attributes_order): New
4618 virtual method definitions.
4619 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
4620 attributes_section and attributes_vendor.
4621 * testsuite/testfile.cc (Target_test::test_target_info): Same.
4622
f4e5969c
DK
46232009-12-05 Doug Kwan <dougkwan@google.com>
4624
4625 * arm.cc: Update comments about interworking and stub generation.
4626 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
4627 considered as non-PIC.
4628 (Arm_relocate_functions::base_abs): Fix formatting.
4629 (Arm_relocate_functions::got_prel): Fix comment. Change interface
4630 of function to use GOT entry address instead of offset.
4631 (Target_arm::Scan::global): Issue an error if a symbol would need a
4632 PLT does not get one because it is untyped. Remove code to create
4633 dynamic symbols for relative branches.
4634 (Target_arm::Relocate::relocate: Use 0 instead of false since function
4635 takes unsigned integer instead of boolean.
4636
1abce4a6
L
46372009-12-05 H.J. Lu <hongjiu.lu@intel.com>
4638
4639 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
4640 (two_file_test_LDADD): Likewise.
4641 (common_test_1_LDADD): Likewise.
4642 (exception_test_LDADD) Likewise.
4643 (weak_test_LDADD): Likewise.
4644 (many_sections_test_LDADD): Likewise.
4645 (initpri1_LDADD): Likewise.
4646 (script_test_1_LDADD): Likewise.
4647 (script_test_2_LDADD): Likewise.
4648 (justsyms_LDADD): Likewise.
4649 (binary_test_LDADD): Likewise.
4650 (large_LDADD): Likewise.
4651 * testsuite/Makefile.in: Regenerated.
4652
adcf2816 46532009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 4654
adcf2816
L
4655 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
4656 (Symbol_table::override_with_special): Likewise.
4657 (Symbol_table::add_from_object): Likewise.
4658
28e67f5d
RÁE
46592009-12-04 Rafael Avila de Espindola <espindola@google.com>
4660
4661 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
4662 Don't set the data_offset twice.
4663
ae10a101
RÁE
46642009-12-04 Rafael Avila de Espindola <espindola@google.com>
4665
4666 * testsuite/Makefile.in: Regenerate.
4667
f59f41f3
DK
46682009-12-03 Doug Kwan <dougkwan@google.com>
4669
4670 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
4671 (Target_arm::do_finalize_sections): Add parameter for symbol table
4672 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
4673 * i386.cc (Target_i386::do_finalize_sections): Add an additional
4674 parameter for symbol table pointer.
4675 * layout.cc (Layout::finalize): Call Target::finalize_sections with
4676 an additional parameter for a pointer to symbol table.
4677 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
4678 parameter for a symbol table pointer.
4679 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
4680 * target.h (Target::finalize_sections, Target::do_finalize_sections):
4681 Ditto.
4682 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
4683 parameter for a symbol table pointer.
4684
ca55d848
RÁE
46852009-12-03 Rafael Avila de Espindola <espindola@google.com>
4686
4687 * incremental.cc (Incremental_inputs_header)
4688 (Incremental_inputs_header_write, Incremental_inputs_entry)
4689 (Incremental_inputs_entry_write): Move ...
4690 * incremental.h (Incremental_inputs_header)
4691 (Incremental_inputs_header_write, Incremental_inputs_entry)
4692 (Incremental_inputs_entry_write): here.
4693
3aec4f9c
RÁE
46942009-12-02 Rafael Avila de Espindola <espindola@google.com>
4695
4696 * incremental.cc (make_sized_incremental_binary): Set the target.
4697 Error if it is incompatible.
4698 * output.h (Output_file): Add filename method.
4699
9c0ae74d
RÁE
47002009-12-02 Rafael Avila de Espindola <espindola@google.com>
4701
4702 * incremental.cc (Incremental_inputs_entry): Remove unused argument
4703 from the get_* methods.
4704
a45500ae
RÁE
47052009-12-02 Rafael Avila de Espindola <espindola@google.com>
4706
4707 * incremental-dump.cc (main): Check that the offeset of a script is 0.
4708 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
4709 Write 0 for the data_offset of scripts.
4710
325e6408
RÁE
47112009-12-02 Rafael Avila de Espindola <espindola@google.com>
4712
4713 * testsuite/Makefile.am: Add the incremental_test.sh test.
4714 * testsuite/incremental_test.sh: New.
4715 * testsuite/incremental_test_1.c: New.
4716 * testsuite/incremental_test_2.c: New.
4717
954c3e2e
RÁE
47182009-12-01 Rafael Avila de Espindola <espindola@google.com>
4719
4720 * incremental-dump.cc (main): Fix typos.
4721
f8086623
RÁE
47222009-11-27 Rafael Avila de Espindola <espindola@google.com>
4723
4724 PR gold/11025
4725 * incremental-dump.cc (main): Use llu to print 64 bit values.
4726
3b0dd6ac
L
47272009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
4728 H.J. Lu <hongjiu.lu@intel.com>
4729
4730 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
4731 $(LIBDL).
4732 (incremental_dump_LDADD): Likewise.
4733 * Makefile.in: Regenerated.
4734
a6d1ef57 47352009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 4736
a6d1ef57
DK
4737 Revert:
4738
4739 2009-11-25 Doug Kwan <dougkwan@google.com>
4740
4741 * arm.cc (Target_arm::Target_arm): Move method definition
4742 outside of class definition. Add code to handle
4743 --target1-rel, --target1-abs and --target2= options.
4744 (Target_arm::get_reloc_reloc_type): Change method to be
4745 non-static and const.
4746 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
4747 New data member declaration.
4748 (Target_arm::Scan::local, Target_arm::Scan::global,
4749 Target_arm::Relocate::relocate,
4750 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4751 Adjust call to Target_arm::get_real_reloc_type.
4752 (Target_arm::get_real_reloc_type): Use command line options
4753 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
4754 * options.h (--target1-rel, --target1-abs, --target2): New
4755 ARM-only options.
4756
50aeb7d4
DK
47572009-11-25 Doug Kwan <dougkwan@google.com>
4758
4759 * arm.cc (Target_arm::Target_arm): Move method definition outside of
4760 class definition. Add code to handle --target1-rel, --target1-abs
4761 and --target2= options.
4762 (Target_arm::get_reloc_reloc_type): Change method to be non-static
4763 and const.
4764 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
4765 member declaration.
4766 (Target_arm::Scan::local, Target_arm::Scan::global,
4767 Target_arm::Relocate::relocate,
4768 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
4769 call to Target_arm::get_real_reloc_type.
4770 (Target_arm::get_real_reloc_type): Use command line options to
4771 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
4772 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
4773 options.
4774
51938283
DK
47752009-11-25 Doug Kwan <dougkwan@google.com>
4776
4777 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
4778 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
4779 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
4780 formatting.
4781 (Arm_relocate_functions::thm_call): Replace body with a call to
4782 Arm_relocate_functions::thumb_branch_common.
4783 (Arm_relocate_functions::thm_jump24,
4784 Arm_relocate_functions::thm_xpc22): New method definitions.
4785 (Arm_relocate_functions::thumb_branch_common): New method definition.
4786 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
4787 operator.
4788 (Target_arm::Relocate::relocate): Adjust call to thm_call.
4789 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
4790
e2b8f3c4
RÁE
47912009-11-24 Rafael Avila de Espindola <espindola@google.com>
4792
4793 * Makefile.am: Build incremental-dump
4794 * Makefile.in: Regenerate.
4795 * incremental-dump.cc: New.
4796 * incremental.cc (Incremental_inputs_header_data,
4797 Incremental_inputs_entry_data): Move to incremental.h
4798 * incremental.h: (Incremental_inputs_header_data,
4799 Incremental_inputs_entry_data): Move from incremental.cc
4800
bcba9aec
RÁE
48012009-11-24 Rafael Avila de Espindola <espindola@google.com>
4802
4803 * incremental.cc (Incremental_inputs_header,
4804 Incremental_inputs_header_write, Incremental_inputs_entry,
4805 Incremental_inputs_entry_write): Add a typedef with the data type.
4806
7c3afe08
RÁE
48072009-11-24 Rafael Avila de Espindola <espindola@google.com>
4808
4809 * incremental.cc (Incremental_inputs_header,
4810 Incremental_inputs_header_write, Incremental_inputs_entry,
4811 Incremental_inputs_entry_write): Update comment about which
4812 type has the filed descriptions.
4813
d204b6e9
DK
48142009-11-15 Doug Kwan <dougkwan@google.com>
4815
4816 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
4817 (Arm_relocate_functions::arm_branch_common): Change method defintion
4818 in class definition to a method declaration and update list of formal
4819 parameters.
4820 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
4821 Arm_relocation_functions::jump24): Adjust call to
4822 Arm_relocate_functions::arm_branch_common. Update list of formal
4823 parameters.
4824 (Arm_relocate_functions::xpc25): New method definition.
4825 (Arm_relocate_functions::arm_branch_common): Move method defintion
4826 out from class definition. Use stubs for mode-switching and extending
4827 branch ranges.
4828 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
4829 specially. Change code to enable use of stubs in ARM branches.
4830
43d12afe
DK
48312009-11-10 Doug Kwan <dougkwan@google.com>
4832
4833 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
4834 in method declaration.
4835 (Target_arm::relocate_stub): New method declaration.
4836 (Target_arm::default_target): Change to return a pointer instead of
4837 a const reference.
4838 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
4839 Target_arm::default_target.
4840 (Arm_Relobj::do_relocate_sections): Remove options paramater in
4841 method definition.
4842 (Target_arm::relocate_section): Adjust view.
4843 (Target_arm::relocate_stub): New method definition.
4844
ac33a407
DK
48452009-11-10 Doug Kwan <dougkwan@google.com>
4846
4847 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
4848 a format warning.
4849 * incremental.cc (open_incremental_binary): Initialized local
4850 variables to avoid warnings.
4851 * object.cc (make_elf_object): Ditto.
4852 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
4853 a format warning.
e1df38aa 4854
88ee28e9
L
4855009-11-09 H.J. Lu <hongjiu.lu@intel.com>
4856
4857 PR gold/10930
4858 * testsuite/plugin_test.c: Include "config.h".
4859
2daedcd6
DK
48602009-11-09 Doug Kwan <dougkwan@google.com>
4861
4862 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
4863 (arm_symbol_value): Remove.
4864 (Arm_relocate_functions::arm_branch_common,
4865 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
4866 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
4867 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
4868 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
4869 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
4870 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
4871 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
4872 Arm_relocate_functions::thm_mobw_abs_nc,
4873 Arm_relocate_functions::thm_mov_abs,
4874 Arm_relocate_functions::movw_prel_nc,
4875 Arm_relocate_functions::thm_movt_abs,
4876 Arm_relocate_functions::movt_prel,
4877 Arm_relocate_functions::thm_movw_prel_nc,
4878 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
4879 (Target_arm::Relocate::relocate): Only decompose address into two
4880 parts if relocation type uses the thumb-bit and pass the actual
4881 bit instead of a flag indicating that the thumb-bit is used. Adjust
4882 calls to methods in Arm_relocate_functions for this change.
4883
1276bc89 48842009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
4885
4886 PR 10925
4887 * reloc.cc: Instantiate
4888 Sized_relobj::initialize_input_to_output_maps and
4889 Sized_relobj:free_input_to_output_maps.
4890
e53ad1b5
ILT
48912009-11-06 Ian Lance Taylor <iant@google.com>
4892
4893 PR 10876
4894 * defstd.cc (in_segment): Set only_if_ref true for "end".
4895
eb44217c
DK
48962009-11-06 Doug Kwan <dougkwan@google.com>
4897
4898 * arm.cc (class Reloc_stub): Correct a comment.
4899 (Target_arm::Target_arm): Initialize arm_input_section_map_.
4900 (Target_arm::scan_section_for_stubs): New method declaration.
4901 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
4902 Change methods from private to protected.
4903 (Target_arm::do_may_relax): New method definition.
4904 (Target_arm::do_relax, Target_arm::group_sections,
4905 Target_arm::scan_reloc_for_stub,
4906 Target_arm::scan_reloc_section_for_stubs): New method declarations.
4907 (Target_arm::arm_input_section_map_): New data member declaration.
4908 (Target_arm::scan_reloc_for_stub,
4909 Target_arm::scan_reloc_section_for_stubs,
4910 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
4911 Target_arm::do_relax): New method definitions.
4912
5d329b7d
ILT
49132009-11-06 Mikolaj Zalewski <mikolaj@google.com>
4914
4915 * configure.ac: Check for (struct stat)::st_mtim
4916 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
4917 * config.in: Regenerate.
4918 * configure: Regenerate.
4919
96a0d71b
ILT
49202009-11-05 Ian Lance Taylor <iant@google.com>
4921
4922 PR 10910
4923 * output.cc (Output_segment::add_output_section): Add missing
4924 return statement.
4925
594c8e5e
ILT
49262009-11-04 Ian Lance Taylor <iant@google.com>
4927
4928 PR 10880
4929 * object.h (class Object): Add is_needed and set_is_needed
4930 methods. Add is_needed_ field. Make bool fields into bitfields.
4931 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
4932 defined in a dynamic object and referenced by a regular object,
4933 set is_needed for the dynamic object.
4934 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
4935 if the file is marked with as_needed and it is not needed.
4936
22b127cc
ILT
49372009-11-04 Ian Lance Taylor <iant@google.com>
4938
4939 PR 10887
4940 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
4941 tags if data is discarded by linker script.
4942 * i386.cc (Target_i386::do_finalize_sections): Likewise.
4943 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
4944 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
4945 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4946
f5c870d2
ILT
49472009-11-04 Ian Lance Taylor <iant@google.com>
4948
4949 * layout.cc (Layout::get_output_section): Add is_interp and
4950 is_dynamic_linker_section parameters. Change all callers.
4951 (Layout::choose_output_section): Likewise.
4952 (Layout::make_output_section): Likewise.
4953 (Layout::add_output_section_data): Add is_dynamic_linker_section
4954 parameter. Change all callers.
4955 * layout.h (class Layout): Update declarations.
4956 * output.h (class Output_section): Add is_interp, set_is_interp,
4957 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
4958 Add is_interp_, is_dynamic_linker_section_ fields. Change
4959 generate_code_fills_at_write_ to a bitfield.
4960 * output.cc (Output_section::Output_sections): Initialize new
4961 fields.
4962 (Output_segment::add_output_section): Add do_sort parameter.
4963 Change all callers.
4964
1ae4d23b
ILT
49652009-11-03 Ian Lance Taylor <iant@google.com>
4966
4967 PR 10860
4968 * options.h (class General_options): Add --warn-common.
4969 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
4970 merging two common symbols.
4971 (Symbol_table::should_override): Handle --warn-common when merging
4972 a common symbol with a defined symbol. Use report_resolve_problem
4973 for multiple definitions.
4974 (Symbol_table::report_resolve_problem): New function.
4975 * symtab.h (class Symbol_table): Declare report_resolve_problem.
4976
55da9579
DK
49772009-11-03 Doug Kwan <dougkwan@google.com>
4978
4979 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
4980 stub_factory_.
4981 (Target_arm::stub_factory): New method definition.
4982 (Target_arm::new_arm_input_section,
4983 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
4984 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 4985 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
4986 New type definitions.
4987 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
4988 member declarations.
4989 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
4990 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
4991 New method definitions.
4992
37a9ac43
ILT
49932009-11-03 Ian Lance Taylor <iant@google.com>
4994
4995 * options.h (class General_options): Add --warn_constructors.
4996
b3d6a3d4
ILT
49972009-11-03 Ian Lance Taylor <iant@google.com>
4998
4999 PR 10893
5000 * defstd.cc (in_section): Add entries for __rel_iplt_start,
5001 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
5002
934b01dd
ILT
50032009-11-03 Ian Lance Taylor <iant@google.com>
5004
5005 PR 10895
5006 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
5007 --msgid-bugs-address.
5008 (install-pdf): New target.
5009 (install-data_yes): Look up one directory to find mkinstalldirs.
5010
03c1939b
L
50112009-11-03 H.J. Lu <hongjiu.lu@intel.com>
5012
5013 * po/Make-in (.po.gmo): Don't generate .gmo files in source
5014 tree.
5015
ebd95253
DK
50162009-10-30 Doug Kwan <dougkwan@google.com>
5017
5018 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
5019
e9bbb538
DK
50202009-10-30 Doug Kwan <dougkwan@google.com>
5021
5022 * arm.cc (Stub_addend_reader): New struct template definition
5023 and partial specializations.
5024 (Stub_addend_reader::operator()): New method definition for a
5025 partially specialized template.
5026
d5b40221
DK
50272009-10-30 Doug Kwan <dougkwan@google.com>
5028
5029 * arm.cc (Arm_relobj::processor_specific_flags): New method
5030 definition.
5031 (Arm_relobj::do_read_symbols): New method declaration.
5032 (Arm_relobj::processor_specific_flags_): New data member declaration.
5033 (Arm_dynobj): New class definition.
5034 (Target_arm::do_finalize_sections): Add input_objects parameter.
5035 (Target_arm::do_adjust_elf_header): New method declaration.
5036 (Target_arm::are_eabi_versions_compatible,
5037 (Target_arm::merge_processor_specific_flags): New method declaration.
5038 (Target_arm::do_make_elf_object): New overloaded method definitions
5039 and declaration.
5040 (Arm_relobj::do_read_symbols): New method definition.
5041 (Arm_dynobj::do_read_symbols): Ditto.
5042 (Target_arm::do_finalize_sections): Add input_objects parameters.
5043 Merge processor-specific flags from all input objects.
5044 (Target_arm::are_eabi_versions_compatible,
5045 Target_arm::merge_processor_specific_flags,
5046 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
5047 New method definitions.
5048 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
5049 Input_objects pointer type parameter.
5050 * layout.cc (Layout::finalize): Pass input objects to target's.
5051 finalize_sections function.
5052 * output.cc (Output_file_header::do_sized_write): Set ELF file
5053 header's processor-specific flags.
5054 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
5055 Input_objects pointer type parameter.
5056 * sparc.cc (Target_sparc::do_finalize_sections): Same.
5057 * target.h (Input_objects): New forward class declaration.
5058 (Target::processor_specific_flags,
5059 Target::are_processor_specific_flags_sect): New method definitions.
5060 (Target::finalize_sections): Add input_objects parameter.
5061 (Target::Target): Initialize processor_specific_flags_ and
5062 are_processor_specific_flags_set_.
5063 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
5064 parameter.
5065 (Target::set_processor_specific_flags): New method definition.
5066 (Target::processor_specific_flags_,
5067 Target::are_processor_specific_flags_set_): New data member
5068 declarations.
5069 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
5070 Input_objects pointer type parameter.
5071
ebabffbd
DK
50722009-10-30 Doug Kwan <dougkwan@google.com>
5073
5074 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
5075
ad0f2072
ILT
50762009-10-28 Ian Lance Taylor <iant@google.com>
5077
5078 * object.h (class Relobj): Drop options parameter from
5079 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
5080 do_scan_relocs, do_relocate. Change all callers.
5081 (class Sized_relobj): Drop options parameters from
5082 do_gc_process_relocs, do_scan_relocs, do_relocate,
5083 do_relocate_sections, relocate_sections, emit_relocs_scan,
5084 emit_relocs_scan_reltype. Change all callers.
5085 (struct Relocate_info): Remove options field and all references to
5086 it.
5087 * reloc.h (class Read_relocs): Remove options constructor
5088 parameter and options_ field. Change all callers.
5089 (class Gc_process_relocs, class Scan_relocs): Likewise.
5090 (class Relocate_task): Likewise.
5091 * target-reloc.h (scan_relocs): Remove options parameter. Change
5092 all callers.
5093 (scan_relocatable_relocs): Likewise.
5094 * target.h (class Sized_target): Remove options parameter from
5095 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
5096 all callers.
5097 * gc.h (gc_process_relocs): Remove options parameter. Change all
5098 callers.
5099 * arm.cc: Update functions to remove options parameters.
5100 * i386.cc: Likewise.
5101 * powerpc.cc: Likewise.
5102 * sparc.cc: Likewise.
5103 * x86_64.cc: Likewise.
5104 * testsuite/testfile.cc: Likewise.
5105
8ffa3667
DK
51062009-10-28 Doug Kwan <dougkwan@google.com>
5107
5108 * arm.cc (Arm_relobj): New class definition.
e1df38aa 5109 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
5110 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
5111 New method definitions.
5112
40f36857
CC
51132009-10-28 Cary Coutant <ccoutant@google.com>
5114
5115 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
5116 (Plugin::cleanup_done_): New member.
5117 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
5118 (Plugin_manager::cleanup_done_): Remove.
5119 (Plugin_manager::add_input_file): Edit error message.
5120 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
5121 (Plugin_manager::cleanup): Remove use of cleanup_done_.
5122
2c849493
ILT
51232009-10-27 Mikolaj Zalewski <mikolajz@google.com>
5124
5125 * fileread.cc: (File_read::View::~View): Use the new
5126 data_ownership_ filed.
5127 (File_read::~File_read): Dispose the new whole_file_view_.
5128 (File_read::open): Mmap the whole file if needed.
5129 (File_read::open): Use whole_file_view_ instead of contents_.
5130 (File_read::find_view): Use whole_file_view_ if applicable.
5131 (File_read::do_read): Use whole_file_view_ instead of contents_.
5132 (File_read::make_view): Use whole_file_view_ instead of contents_,
5133 update File_read::View::View call.
5134 (File_read::find_or_make_view): Update File_read::View::View
5135 call.
5136 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
5137 remove contents_
5138 (File_read::View::Data_ownership): New enum.
5139 (File_read::View::View): Replace bool mapped_ with Data_ownership
5140 argument.
5141 (File_read::View::mapped_): Remove (replaced by data_ownership_).
5142 (File_read::View::data_ownership_): New field.
5143 (File_read::contents_): Remove (replaced by whole_file_view_).
5144 (File_read::whole_file_view_): New field.
5145 * options.h (class General_options): Add --keep-files-mapped.
5146
24998053
CC
51472009-10-27 Cary Coutant <ccoutant@google.com>
5148
5149 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
5150 * testsuite/Makefile.am (plugin_test_5): New test case.
5151 * testsuite/Makefile.in: Regenerate.
5152
72adc4fa
DK
51532009-10-25 Doug Kwan <dougkwan@google.com>
5154
5155 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
5156 from private to protected to allow access by child class.
5157 (Sized_relobj::do_relocate_sections): New method declaration.
5158 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 5159 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
5160 Sized_relobj::relocate_sections. Instantiate template explicitly
5161 for different target sizes and endianity.
5162
07f508a2
DK
51632009-10-24 Doug Kwan <dougkwan@google.com>
5164
5165 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
5166 (Arm_input_section::as_arm_input_section): New method.
5167 (Arm_output_section): New class definition.
5168 (Arm_output_section::create_stub_group,
5169 Arm_output_section::group_sections): New method definitions.
5170
10ad9fe5
DK
51712009-10-22 Doug Kwan <dougkwan@google.com>
5172
5173 * arm.cc (Arm_input_section): New class definition.
5174 (Arm_input_section::init, Arm_input_section:do_write,
5175 Arm_input_section::set_final_data_size,
5176 Arm_input_section::do_reset_address_and_file_offset): New method
5177 definitions.
5178
56ee5e00
DK
51792009-10-21 Doug Kwan <dougkwan@google.com>
5180
5181 * arm.cc (Stub_table, Arm_input_section): New forward class
5182 declarations.
5183 (Stub_table): New class defintion.
5184 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
5185 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
5186 New method definition.
5187
b569affa
DK
51882009-10-21 Doug Kwan <dougkwan@google.com>
5189
5190 * arm.cc: Update copyright comments.
5191 (Target_arm): New forward class template declaration.
5192 (Arm_address): New type.
5193 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
5194 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
5195 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
5196 constants.
5197 (Insn_template): Same.
5198 (DEF_STUBS): New macro.
5199 (Stub_type): New enum type.
5200 (Stub_template): New class definition.
5201 (Stub): Same.
5202 (Reloc_stub): Same.
5203 (Stub_factory): Same.
5204 (Target_arm::Target_arm): Initialize may_use_blx_ and
5205 should_force_pic_veneer_.
5206 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
5207 Target_arm::should_force_pic_veneer,
5208 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
5209 Target_arm::using_thumb_only, Target_arm:;default_target): New
5210 method defintions.
5211 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
5212 New data member declarations.
5213 (Insn_template::size, Insn_template::alignment): New method defintions.
5214 (Stub_template::Stub_template): New method definition.
5215 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
5216 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
5217 (Stub_factory::Stub_factory): New method definition.
5218 * gold.h (string_hash): New template.
5219 * output.h (Input_section_specifier::hash_value): Use
5220 gold::string_hash.
5221 (Input_section_specifier::string_hash): Remove.
5222 * stringpool.cc (Stringpool_template::string_hash): Use
5223 gold::string_hash.
5224
6c172549
DK
52252009-10-20 Doug Kwan <dougkwan@google.com>
5226
5227 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
5228 symbols of relaxed input sections.
5229 * output.h (Output_section::find_relaxed_input_section): Make
5230 method public.
5231
c5617f2f
DK
52322009-10-16 Doug Kwan <dougkwan@google.com>
5233
5234 * dynobj.cc (Versions::Versions): Initialize version_script_.
5235 Only insert base version symbol definition for a shared object
5236 if version script defines any version versions.
5237 (Versions::define_base_version): New method definition.
5238 (Versions::add_def): Check that base version is not needed.
5239 (Versions::add_need): Define base version lazily.
5240 * dynobj.h (Versions::define_base_version): New method declaration.
5241 (Versions::needs_base_version_): New data member declaration.
5242 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
5243 (check_DATA): Add no_version_test.stdout.
5244 (libno_version_test.so, no_version_test.o no_version_test.stdout):
5245 New make rules.
5246 * testsuite/Makefile.in: Regenerate.
5247 * testsuite/no_version_test.c: New file.
5248 * testsuite/no_version_test.sh: Ditto.
5249
3c12dcdb
DK
52502009-10-16 Doug Kwan <dougkwan@google.com>
5251
5252 * expression.cc (class Segment_start_expression): New class definition.
5253 (Segment_start_expression::value): New method definition.
5254 (script_exp_function_segment_start): Return a new
5255 Segment_start_expression.
5256 * gold/script-c.h (script_saw_segment_start_expression): New function
5257 prototype.
5258 * script-sections.cc (Script_sections::Script_sections): Initialize
5259 SAW_SEGMENT_START_EXPRESSION_ to false.
5260 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
5261 and -Tbbs options to specify section addresses if given in
5262 command line and no SEGMENT_START expression is seen in a script.
5263 * script-sections.h (Script_sections::saw_segment_start_expression,
5264 Script_sections::set_saw_segment_start_expression): New method
5265 definition.
5266 (Script_sections::saw_segment_start_expression_): New data member
5267 declaration.
5268 * script.cc (script_saw_segment_start_expression): New function.
5269 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
5270 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
5271 script_test_7.sh and script_test_8.sh.
5272 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
5273 script_test_8.stdout.
5274 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
5275 (script_test_6, script_test_6.stdout, script_test_7,
5276 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
5277 * Makefile.in: Regenerate.
5278 * testsuite/script_test_6.sh: New file.
5279 * testsuite/script_test_6.t: Same.
5280 * testsuite/script_test_7.sh: Same.
5281 * testsuite/script_test_7.t: Same.
5282 * testsuite/script_test_8.sh: Same.
5283
64b1ae37
DK
52842009-10-16 Doug Kwan <dougkwan@google.com>
5285
5286 * output.cc (Output_segment::set_section_list_address): Cast
5287 expressions to unsigned long long type to avoid format warnings.
5288
661be1e2
ILT
52892009-10-15 Ian Lance Taylor <iant@google.com>
5290
12edd763 5291 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 5292 dot assignment to script_sections_.
12edd763
ILT
5293 * script-sections.cc (Script_sections::add_dot_assignment):
5294 Initialize if necessary.
5295
68b6574b
ILT
5296 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
5297 program headers with no load segment if there is a linker script.
5298
661be1e2
ILT
5299 * layout.cc (Layout::set_segment_offsets): Align the file offset
5300 to the segment aligment for -N or -n with no load segment.
5301 * output.cc (Output_segment::add_output_section): Don't crash if
5302 the first section is a TLS section.
5303 (Output_segment::set_section_list_addresses): Print an error
5304 message if the address moves backward in a linker script.
5305 * script-sections.cc
5306 (Output_section_element_input::set_section_addresses): Don't
5307 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
5308 (Orphan_output_section::set_section_addresses): Likewise.
5309
f15f61a7
DK
53102009-10-15 Doug Kwan <dougkwan@google.com>
5311
5312 * layout.cc (Layout::finish_dynamic_section): Generate tags
5313 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
5314 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
5315 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
5316
82bb573a
ILT
53172009-10-14 Ian Lance Taylor <iant@google.com>
5318
5319 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
5320 fields.
5321 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
5322 data_shdr fields of relinfo.
5323 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
5324 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
5325 R_386_TLS_LDO_32, adjust based on section flags.
5326 (Target_i386::Relocate::fix_up_ldo): Remove.
5327
374ad285
ILT
53282009-10-13 Ian Lance Taylor <iant@google.com>
5329
5330 Add support for -pie.
5331 * options.h (class General_options): Add -pie and
5332 --pic-executable.
5333 (General_options::output_is_position_independent): Test -pie.
5334 (General_options::output_is_executable): Return true if not shared
5335 and not relocatable.
5336 (General_options::output_is_pie): Remove.
5337 * options.cc (General_options::finalize): Reject incompatible uses
5338 of -pie.
5339 * gold.cc (queue_middle_tasks): A -pie link is not static.
5340 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
5341 * symtab.cc (Symbol::final_value_is_known): Return false if
5342 output_is_position_independent.
5343 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
5344 output_is_position_independent.
5345 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
5346 output_is_position_independent.
5347 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
5348 output_is_position_independent.
5349 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
5350 two_file_pie_test.
5351 (basic_pie_test.o, basic_pie_test): New targets.
5352 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
5353 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
5354 (two_file_pie_test): New target.
5355 * testsuite/Makefile.in: Rebuild.
5356 * README: Remove note saying that -pie is not supported.
5357
c6585162
ILT
53582009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
5359
5360 * options.h (class General_options): Add -init and -fini.
5361 * layout.cc (Layout::finish_dynamic_section): Emit
5362 given init and fini functions.
5363
032ce4e9
ST
53642009-10-13 Sriraman Tallam <tmsriram@google.com>
5365
5366 * gc.h (gc_process_relocs): Check if icf is enabled using new
5367 function.
5368 * gold.cc (queue_initial_tasks): Likewise.
5369 (queue_middle_tasks): Likewise.
5370 * object.cc (do_layout): Likewise.
5371 * symtab.cc (is_section_folded): Likewise.
5372 * main.cc (main): Likewise.
5373 * reloc.cc (Read_relocs::run): Likewise.
5374 (Sized_relobj::do_scan_relocs): Likewise.
5375 * icf.cc (is_function_ctor_or_dtor): New function.
5376 (Icf::find_identical_sections): Check if function is ctor or dtor when
5377 safe icf is chosen.
5378 * options.h (General_options::icf): Change option to be an enum.
5379 (Icf_status): New enum.
5380 (icf_enabled): New method.
5381 (icf_safe_folding): New method.
5382 (set_icf_status): New method.
5383 (icf_status_): New variable.
5384 * (options.cc) (General_options::finalize): Set icf_status_.
5385 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
5386 icf_test and icf_keep_unique_test to use the --icf enum flag.
5387 * testsuite/icf_safe_test.sh: New file.
e1df38aa 5388 * testsuite/icf_safe_test.cc: New file.
032ce4e9 5389
f345227a
ST
53902009-10-12 Sriraman Tallam <tmsriram@google.com>
5391
5392 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
5393 includes to gc.h and icf.h.
5394 * arm.cc: Include gc.h.
5395 * gold.cc: Likewise.
5396 * i386.cc: Likewise.
5397 * powerpc.cc: Likewise.
5398 * sparc.cc: Likewise.
5399 * x86_64.cc: Likewise.
5400 * gc.h: Include icf.h.
5401
1c7814ed
ILT
54022009-10-11 Ian Lance Taylor <iant@google.com>
5403
5404 * plugin.cc: Include "gold.h" before other header files.
5405
ae3b5189
CD
54062009-10-10 Chris Demetriou <cgd@google.com>
5407
5408 * options.h (Input_file_argument::Input_file_type): New enum.
5409 (Input_file_argument::is_lib_): Replace with...
5410 (Input_file_argument::type_): New member.
5411 (Input_file_argument::Input_file_argument): Take Input_file_type
5412 'type' rather than boolean 'is_lib' as second argument.
5413 (Input_file_argument::is_lib): Use type_.
5414 (Input_file_argument::is_searched_file): New function.
5415 (Input_file_argument::may_need_search): Handle is_searched_file.
5416 * options.cc (General_options::parse_library): Support -l:filename.
5417 (General_options::parse_just_symbols): Update for Input_file_argument
5418 changes.
5419 (Command_line::process): Likewise.
5420 * archive.cc (Archive::get_file_and_offset): Likewise.
5421 * plugin.cc (Plugin_manager::release_input_file): Likewise.
5422 * script.cc (read_script_file, script_add_file): Likewise.
5423 * fileread.cc (Input_file::Input_file): Likewise.
5424 (Input_file::will_search_for): Handle is_searched_file.
5425 (Input_file::open): Likewise.
5426 * readsyms.cc (Read_symbols::get_name): Likewise.
5427 * testsuite/Makefile.am (searched_file_test): New test.
5428 * testsuite/Makefile.in: Regenerate.
5429 * testsuite/searched_file_test.cc: New file.
5430 * testsuite/searched_file_test_lib.cc: New file.
5431
f3048a1d
ILT
54322009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
5433 Ian Lance Taylor <iant@google.com>
5434
5435 * descriptor.cc: Include <cstdio> and "binary-io.h".
5436 (Descriptors::open): Open the files in binary mode always.
5437 * script.cc (Lex::get_token): Treat \r as whitespace.
5438
d4780e57
ILT
54392009-10-09 Ian Lance Taylor <iant@google.com>
5440
5441 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
5442
d9a893b8
ILT
54432009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
5444 Ian Lance Taylor <iant@google.com>
5445
5446 * configure.ac: Check for readv function also.
5447 * fileread.cc (readv): Define if not HAVE_READV.
5448 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
5449 does not exist.
5450 * config.in: Regenerate.
5451 * configure: Regenerate.
5452
c0a62865
DK
54532009-10-09 Doug Kwan <dougkwan@google.com>
5454
5455 * layout.cc (Layout::make_output_section): Call target hook to make
5456 ordinary output section.
5457 (Layout::finalize): Adjust parameter list of call the
5458 Target::may_relax().
5459 * layout.h (class Layout::section_list): New method.
5460 * merge.h (Output_merge_base::entsize): Change visibility to public.
5461 (Output_merge_base::is_string, Output_merge_base::do_is_string):
5462 New methods.
5463 (Output_merge_string::do_is_string): New method.
5464 * object.cc (Sized_relobj::do_setup): renamed from
5465 Sized_relobj::set_up.
5466 * object.h (Sized_relobj::adjust_shndx,
5467 Sized_relobj::initializ_input_to_output_maps,
5468 Sized_relobj::free_input_to_output_maps): Change visibilities to
5469 protected.
5470 (Sized_relobj::setup): Virtualize.
5471 (Sized_relobj::do_setup): New method declaration.
5472 (Sized_relobj::invalidate_section_offset,
5473 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
5474 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
5475 * options.cc (parse_int): New function.
5476 * options.h (parse_int): New declaration.
5477 (DEFINE_int): New macro.
5478 (stub_group_size): New option.
5479 * output.cc (Output_section::Output_section): Initialize memebers
5480 merge_section_map_, merge_section_by_properties_map_,
5481 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
5482 (Output_section::add_input_section): Handled deferred code-fill
5483 generation and remove an old comment.
5484 (Output_section::add_relaxed_input_section): New method definition.
5485 (Output_section::add_merge_input_section): Use merge section by
5486 properties map to speed to search. Update merge section maps
5487 as appropriate.
5488 (Output_section::build_relaxation_map): New method definition.
5489 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5490 Same.
5491 (Output_section::relax_input_section): Renamed to
5492 Output_section::convert_input_sections_to_relaxed_sections and change
5493 interface to take a vector of pointers to relaxed sections.
5494 (Output_section::find_merge_section,
5495 Output_section::find_relaxed_input_section): New method definitions.
5496 (Output_section::is_input_address_mapped,
5497 Output_section::output_offset, Output_section::output_address):
5498 Use output section data maps to speed up searching.
5499 (Output_section::find_starting_output_address): Add comments.
5500 (Output_section::do_write,
5501 Output_section::write_to_postprocessing_buffer): Do code-fill
5502 generation as appropriate.
5503 (Output_section::get_input_sections): Invalidate relaxed input section
5504 map.
5505 (Output_section::restore_states): Adjust type of checkpoint .
5506 Invalidate relaxed input section map.
5507 * output.h (Output_merge_base): New class declaration.
5508 (Input_section_specifier): New class defintion.
5509 (class Output_relaxed_input_section) Change base class to
5510 Output_section_data_build.
5511 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
5512 base class initializer.
5513 (Output_section::add_relaxed_input_section): New method declaration.
5514 (Output_section::Input_section): Change visibility to protected.
5515 (Output_section::Input_section::relobj,
5516 Output_section::Input_section::shndx): Handle relaxed input sections.
5517 Output_section::input_sections) Change visibility to protected. Also
5518 define overload to return a non-const pointer.
5519 (Output_section::Merge_section_properties): New class defintion.
5520 (Output_section::Merge_section_by_properties_map,
5521 Output_section::Output_section_data_by_input_section_map,
5522 Output_section::Relaxation_map): New types.
5523 (Output_section::relax_input_section): Rename method to
5524 Output_section::convert_input_sections_to_relaxed_sections and change
5525 interface to take a vector of relaxed section pointers.
5526 (Output_section::find_merge_section,
5527 Output_section::find_relaxed_input_section,
5528 Output_section::build_relaxation_map,
5529 Output_section::convert_input_sections_in_list_to_relaxed_sections):
5530 New method declarations.
5531 (Output_section::merge_section_map_
5532 Output_section::merge_section_by_properties_map_,
5533 Output_section::relaxed_input_section_map_,
5534 Output_section::is_relaxed_input_section_map_valid_,
5535 Output_section::generate_code_fills_at_write_): New data members.
5536 * script-sections.cc
5537 (Output_section_element_input::set_section_addresses): Call
5538 current_data_size and addralign methods of relaxed input sections.
5539 (Orphan_output_section::set_section_addresses): Call current_data_size
5540 and addralign methods of relaxed input sections.
5541 * symtab.cc (Symbol_table::compute_final_value): Extract template
5542 from the body of Symbol_table::sized_finalize_symbol.
5543 (Symbol_table::sized_finalized_symbol): Call
5544 Symbol_table::compute_final_value.
5545 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
5546 (Symbol_table::compute_final_value): New templated method declaration.
5547 * target.cc (Target::do_make_output_section): New method defintion.
5548 * target.h (Target::make_output_section): New method declaration.
5549 (Target::relax): Add more parameters for input objects, symbol table
5550 and layout. Adjust call to do_relax.
5551 (Target::do_make_output_section): New method declaration.
5552 (Target::do_relax): Add parameters for input objects, symbol table
5553 and layout.
5554
d446d6c4
ILT
55552009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
5556
5557 * pread.c: Include stdio.h.
5558
bc06c745
ILT
55592009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
5560
5561 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
5562 defined.
5563
75aea3d0
ILT
55642009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
5565
5566 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5567 Change read_shndx type to unsigned int.
5568 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
5569 int.
5570 (Sized_dwarf_line_info::read_line_mappings): Likewise.
5571 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
5572 Change read_shndx type to unsigned int.
5573 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
5574 int.
5575 (Sized_dwarf_line_info::read_line_mappings): Likewise.
5576 * layout.cc (Layout::create_symtab_sections): Cast the result of
5577 local_symcount * symsize to off_t in the gold_assert.
5578
be8fcb75
ILT
55792009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5580
5581 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
5582 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
5583 R_ARM_BASE_ABS.
5584 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
5585 (Arm_relocate_functions::thm_abs5): New function.
5586 (Arm_relocate_functions::abs12): New function.
5587 (Arm_relocate_functions::abs16): New function.
5588 (Arm_relocate_functions::base_abs): New function.
5589 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
5590 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
5591 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
5592 R_ARM_BASE_ABS.
5593 (Scan::global): Likewise.
5594 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
5595 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
5596 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
5597 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
5598 R_ARM_BASE_ABS.
5599
c2a122b6
ILT
56002009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5601
5602 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
5603 (Arm_relocate_functions::movt_prel): New function.
5604 (Arm_relocate_functions::thm_movw_prel_nc): New function.
5605 (Arm_relocate_functions::thm_movt_prel): New function.
5606 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
5607 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
5608 (Scan::global, Relocate::relocate): Likewise.
5609 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
5610
c4aa1e2d
ILT
56112009-10-09 Mikolaj Zalewski <mikolajz@google.com>
5612
5613 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
5614 Incremental_checker.
5615 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
5616 unsigned int.
5617 (class Incremental_inputs_header): New class.
5618 (Incremental_inputs_header_writer): Edit comment.
5619 (Incremental_inputs_entry): New class.
5620 (Incremental_inputs_entry_writer): Edit comment.
5621 (Sized_incremental_binary::do_find_incremental_inputs_section):
5622 Add *strtab_shndx parameter, fill it.
5623 (Sized_incremental_binary::do_check_inputs): New method.
5624 (Incremental_checker::can_incrementally_link_output_file): Use
5625 Sized_incremental_binary::check_inputs.
5626 (Incremental_inputs::report_command_line): Save command line in
5627 command_line_.
5628 * incremental.h:
5629 (Incremental_binary::find_incremental_inputs_section): New
5630 method.
5631 (Incremental_binary::do_find_incremental_inputs_section): Add
5632 strtab_shndx parameter.
5633 (Incremental_binary::do_check_inputs): New pure virtual method.
5634 (Sized_incremental_binary::do_check_inputs): Declare.
5635 (Incremental_checker::Incremental_checker): Add incremental_inputs
5636 parameter, use it to initialize incremental_inputs_.
5637 (Incremental_checker::incremental_inputs_): New field.
5638 (Incremental_checker::command_line): New method.
5639 (Incremental_checker::inputs): New method.
5640 (Incremental_checker::command_line_): New field.
5641
c549a694
ILT
56422009-10-09 Mikolaj Zalewski <mikolajz@google.com>
5643
5644 * incremental.cc: Include <cstdarg> and "target-select.h".
5645 (vexplain_no_incremental): New function.
5646 (explain_no_incremental): New function.
5647 (Incremental_binary::error): New method.
5648 (Sized_incremental_binary::do_find_incremental_inputs_section): New
5649 method.
5650 (make_sized_incremental_binary): New function.
5651 (open_incremental_binary): New function.
5652 (can_incrementally_link_file): Add checks if output is ELF and has
5653 inputs section.
5654 * incremental.h: Include "elfcpp_file.h" and "output.h".
5655 (Incremental_binary): New class.
5656 (Sized_incremental_binary): New class.
5657 (open_incremental_binary): Declare.
5658 * object.cc (is_elf_object): Use
5659 elfcpp::Elf_recognizer::is_elf_file.
5660 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
5661 * output.h (Output_file::filesize): New method.
5662
fd3c5f0b
ILT
56632009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5664
5665 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
5666 New function.
5667 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
5668 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
5669 function.
5670 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
5671 function.
5672 (Arm_relocate_functions::movw_abs_nc): New function.
5673 (Arm_relocate_functions::movt_abs): New function.
5674 (Arm_relocate_functions::thm_movw_abs_nc): New function.
5675 (Arm_relocate_functions::thm_movt_abs): New function.
5676 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
5677 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
5678 (Scan::global): Likewise.
5679 (Relocate::relocate): Likewise.
5680 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
5681
7f5309a5
ILT
56822009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5683
5684 * arm.cc (Arm_relocate_functions::got_prel) New function.
5685 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
5686 (Relocate::relocate): Likewise.
5687 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
5688
364c7fa5
ILT
56892009-10-06 Ian Lance Taylor <iant@google.com>
5690
5691 * options.h (class General_options): Define
5692 split_stack_adjust_size parameter.
5693 * object.h (class Object): Add uses_split_stack_ and
5694 has_no_split_stack_ fields. Add uses_split_stack and
5695 has_no_split_stack accessor functions. Declare
5696 handle_split_stack_section.
5697 (class Reloc_symbol_changes): Define.
5698 (class Sized_relobj): Define Function_offsets. Declare
5699 split_stack_adjust, split_stack_adjust_reltype, and
5700 find_functions.
5701 * object.cc (Object::handle_split_stack_section): New function.
5702 (Sized_relobj::do_layout): Call handle_split_stack_section.
5703 * dynobj.cc (Sized_dynobj::do_layout): Call
5704 handle_split_stack_section.
5705 * reloc.cc (Sized_relobj::relocate_sections): Call
5706 split_stack_adjust for executable sections in split_stack
5707 objects. Pass reloc_map to relocate_section.
5708 (Sized_relobj::split_stack_adjust): New function.
5709 (Sized_relobj::split_stack_adjust_reltype): New function.
5710 (Sized_relobj::find_functions): New function.
5711 * target-reloc.h: Include "object.h".
5712 (relocate_section): Add reloc_symbol_changes parameter. Change
5713 all callers.
5714 * target.h (class Target): Add calls_non_split method. Declare
5715 do_calls_non_split virtual method. Declare match_view and
5716 set_view_to_nop.
5717 * target.cc: Include "elfcpp.h".
5718 (Target::do_calls_non_split): New function.
5719 (Target::match_view): New function.
5720 (Target::set_view_to_nop): New function.
5721 * gold.cc (queue_middle_tasks): Give an error if mixing
5722 split-stack and non-split-stack objects with -r.
5723 * i386.cc (Target_i386::relocate_section): Add
5724 reloc_symbol_changes parameter.
5725 (Target_i386::do_calls_non_split): New function.
5726 * x86_64.cc (Target_x86_64::relocate_section): Add
5727 reloc_symbol_changes parameter.
5728 (Target_x86_64::do_calls_non_split): New function.
5729 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
5730 parameter.
5731 * powerpc.cc (Target_powerpc::relocate_section): Add
5732 reloc_symbol_changes parameter.
5733 * sparc.cc (Target_sparc::relocate_section): Add
5734 reloc_symbol_changes parameter.
5735 * configure.ac: Call AM_CONDITIONAL for the default target.
5736 * configure: Rebuild.
5737 * testsuite/Makefile.am (TEST_AS): New variable.
5738 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
5739 (check_DATA): Add split_i386 and split_x86_64 files.
5740 (SPLIT_DEFSYMS): Define.
5741 (split_i386_[1234n].o): New targets.
5742 (split_i386_[124]): New targets.
5743 (split_i386_[1234r].stdout): New targets.
5744 (split_x86_64_[1234n].o): New targets.
5745 (split_x86_64_[124]): New targets.
5746 (split_x86_64_[1234r].stdout): New targets.
5747 (MOSTLYCLEANFILES): Add new executables.
5748 * testsuite/split_i386.sh: New file.
5749 * testsuite/split_x86_64.sh: New file.
5750 * testsuite/split_i386_1.s: New file.
5751 * testsuite/split_i386_2.s: New file.
5752 * testsuite/split_i386_3.s: New file.
5753 * testsuite/split_i386_4.s: New file.
5754 * testsuite/split_i386_n.s: New file.
5755 * testsuite/split_x86_64_1.s: New file.
5756 * testsuite/split_x86_64_2.s: New file.
5757 * testsuite/split_x86_64_3.s: New file.
5758 * testsuite/split_x86_64_4.s: New file.
5759 * testsuite/split_x86_64_n.s: New file.
5760 * testsuite/testfile.cc (Target_test): Update relocation_section
5761 function.
5762 * testsuite/Makefile.in: Rebuild.
5763
e8a9fcda
ILT
57642009-10-06 Ian Lance Taylor <iant@google.com>
5765
5766 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
5767 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
5768 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
5769 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
5770 the address on ldo_addrs_.
5771 (Target_i386::Relocate::fix_up_ldo): New function.
5772
e99daf92
ILT
57732009-10-06 Rafael Espindola <espindola@google.com>
5774
5775 * plugin.cc (add_input_library): New.
5776 (Plugin::load): Add add_input_library to tv.
5777 (Plugin_manager::add_input_file): Add the is_lib argument.
5778 (add_input_file): Update call to Plugin_manager::add_input_file.
5779 (add_input_library): New.
5780 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
5781
966d4097
DK
57822009-09-30 Doug Kwan <dougkwan@google.com>
5783
5784 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
5785 symbol and call Symbol::may_need_copy_reloc to determine if
5786 a copy reloc is needed.
5787 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
5788 nocopyreloc is given in command line.
5789 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
5790 given in command line.
5791 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
5792 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
5793 of the removed Target_i386::may_need_copy_reloc.
5794 * options.h (copyreloc): New option with default value false.
5795 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
5796 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
5797 instead of the removed Target_powerpc::may_need_copy_reloc.
5798 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
5799 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
5800 instead of the removed Target_sparc::may_need_copy_reloc.
5801 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
5802 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
5803 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
5804 instead of the removed Target_x86_64::may_need_copy_reloc.
5805
029ba973
ILT
58062009-09-30 Ian Lance Taylor <iant@google.com>
5807
5808 * object.h (class Object): Remove target_ field, and target,
5809 sized_target, and set_target methods.
5810 (Object::sized_target): Remove.
5811 (class Sized_relobj): Update declarations. Remove sized_target.
5812 * object.cc (Sized_relobj::setup): Remove target parameter.
5813 Change all callers.
5814 (Input_objects::add_object): Don't do anything with the target.
5815 (make_elf_sized_object): Add punconfigured parameter. Change all
5816 callers. Set or test parameter target.
5817 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
5818 Change all callers.
5819 * parameters.cc (Parameters::set_target): Change parameter type to
5820 be non-const.
5821 (Parameters::default_target): Remove.
5822 (set_parameters_target): Change parameter type to be non-const.
5823 (parameters_force_valid_target): New function.
5824 (parameters_clear_target): New function.
5825 * parameters.h (class Parameters): Update declarations. Remove
5826 default_target method. Add sized_target and clear_target
5827 methods. Change target_ to be non-const.
5828 (set_parameters_target): Update declaration.
5829 (parameters_force_valid_target): Declare.
5830 (parameters_clear_target): Declare.
5831 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
5832 as NULL if we aren't searching.
5833 (Add_symbols::run): Don't check for compatible target.
5834 * fileread.cc (Input_file::open_binary): Call
5835 parameters_force_valid_target.
5836 * gold.cc (queue_middle_tasks): Likewise.
5837 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
5838 set_target on object.
5839 * dynobj.h (class Sized_dynobj): Update declarations.
5840 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
5841 make_elf_object returns NULL.
5842 (Archive::include_member): Don't check whether object target is
5843 compatible.
5844 * output.cc (Output_section::add_input_section): Get target from
5845 parameters.
5846 (Output_section::relax_input_section): Likewise.
5847 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
5848 parameters.
5849 (Sized_relobj::do_scan_relocs): Likewise.
5850 (Sized_relobj::relocate_sections): Likewise.
5851 * resolve.cc (Symbol_table::resolve): Likewise.
5852 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
5853 parameter. Change all callers.
5854 (Symbol_table::add_from_object): Get target from parameters.
5855 (Symbol_table::add_from_relobj): Don't check object target.
5856 (Symbol_table::add_from_dynobj): Likewise.
5857 (Symbol_table::define_special_symbol): Get target from
5858 parameters.
5859 * symtab.h (class Symbol_table): Update declaration.
5860 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
5861 parameter. Change all callers. Clear parameter target.
5862 (Binary_test): Test target here.
5863 * testsuite/object_unittest.cc (gold_testsuite): Remove
5864 target_test_pointer parameter. Change all callers.
5865 (Object_test): Test target here.
5866
a6a22b83
ILT
58672009-09-26 Ian Lance Taylor <iant@google.com>
5868
5869 * testsuite/initpri1.c: Don't try to use constructor priorities if
5870 compiling with gcc before 4.3.
5871
6a8f49fe
ILT
58722009-09-22 Mikolaj Zalewski <mikolajz@google.com>
5873
5874 * testsuite/retain_symbols_file_test.sh (check_present): Change
5875 output file name to retain_symbols_file_test.stdout.
5876 (check_absent): Likewise.
5877
8c604651
CS
58782009-09-18 Craig Silverstein <csilvers@google.com>
5879
5880 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
5881 * options.cc: Include <cerrno> and <fstream>.
5882 (General_options::finalize): Parse -retain-symbols-file tag.
5883 * options.h: New flag.
5884 (General_options): New method should_retain_symbol, new
5885 variable symbols_to_retain.
5886 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
5887 should_retain_symbol map.
5888 * testsuite/Makefile.am (retain_symbols_file_test): New test.
5889 * testsuite/Makefile.in: Regenerate.
5890 * testsuite/retain_symbols_file_test.sh: New file.
5891
ca58b19f
NC
58922009-09-18 Nick Clifton <nickc@redhat.com>
5893
5894 * po/es.po: Updated Spanish translation.
5895
20e6d0d6
DK
58962009-09-17 Doug Kwan <dougkwan@google.com>
5897
5898 * debug.h (DEBUG_RELAXATION): New constant.
5899 (DEBUG_ALL): Add DEBUG_RELAXATION.
5900 (debug_string_to_enum): Add relaxation debug option.
5901 * layout.cc
5902 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
5903 Layout::Relaxation_debug_check::read_sections,
5904 Layout::Relaxation_debug_check::read_sections): New method definitions.
5905 (Layout::Layout): Initialize data members
5906 record_output_section_data_from_scrips_,
5907 script_output_section_data_list_ and relaxation_debug_check_.
5908 (Layout::save_segments, Layout::restore_segments,
5909 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
5910 Layout::relaxation_loop_body): New method definitions.
5911 (Layout::finalize): Support relaxation. Move section layout code to
5912 Layout::relaxation_loop_body.
5913 (Layout::set_asection_address_from_script): Move code for orphan
5914 section placement out.
5915 (Layout::place_orphan_sections_in_script): New method definition.
5916 * layout.h (Output_segment_headers, Output_file_header):
5917 New forward class declarations.
5918 (Layout::~Layout): Define.
5919 (Layout::new_output_section_data_from_script): New method definition.
5920 (Layout::place_orphan_sections_in_script): New method declaration.
5921 (Layout::Segment_states): New type declaration.
5922 (Layout::save_segments, Layout::restore_segments,
5923 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
5924 Layout::relaxation_loop_body): New method declarations.
5925 (Layout::Output_section_data_list): New type declaration.
5926 (Layout::Relaxation_debug_check): New class definition.
5927 (Layout::record_output_section_data_from_script_,
5928 Layout::script_output_section_data_list_, Layout::segment_states_,
5929 Layout::relaxation_debug_check_): New data members.
5930 * output.cc: (Output_section_headers::do_size): New method definition.
5931 (Output_section_headers::Output_section_headers): Move size
5932 computation to Output_section_headers::do_size.
5933 (Output_segment_headers::do_size): New method definition.
e1df38aa 5934 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
5935 Output_file_header::do_size and call it.
5936 (Output_file_header::do_size): New method definition.
5937 (Output_data_group::Output_data_group): Adjust call to
5938 Output_section_data.
5939 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
5940 (Output_symtab_xindex::do_write): Add array bound check.
5941 (Output_section::Input_section::print_to_mapfile): Handle
5942 RELAXED_INPUT_SECTION_CODE.
5943 (Output_section::Output_section): Initialize data member checkpoint_.
5944 (Output_section::~Output_section): Delete checkpoint object pointed
5945 by checkpoint_.
5946 (Output_section::add_input_section): Always add an Input_section if
5947 relaxing.
5948 (Output_section::add_merge_input_section): Add assert.
5949 (Output_section::relax_input_section): New method definition.
5950 (Output_section::set_final_data_size): Set load address to zero for
5951 an unallocated section.
5952 (Output_section::do_address_and_file_offset_have_reset_values):
5953 New method definition.
5954 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
5955 Handle relaxed input section.
5956 (Output_section::sort_attached_input_sections): Checkpoint input
5957 section list lazily.
5958 (Output_section::get_input_sections): Change type of input_sections to
5959 list of Simple_input_section pointers. Checkpoint input section list
5960 lazily. Also handle relaxed input sections.
5961 (Output_section::add_input_section_for_script): Take a reference to
5962 a Simple_input_section object instead of Relobj pointer and section
5963 index as parameter. Handle relaxed input sections.
5964 (Output_section::save_states, Output_section::restore_states): New
5965 method definitions.
5966 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
5967 (Output_data::is_data_size_fixed): New method definition.
5968 (Output_data::reset_addresss_and_file_offset): Do not reset data size
5969 if it is fixed.
5970 (Output_data::address_and_file_offset_have_reset_values): New method
5971 definition.
5972 (Output_data::do_address_and_file_offset_have_reset_values): New method
5973 definition.
5974 (Output_data::set_data_size): Check that data size is not fixed.
5975 (Output_data::fix_data_size): New method definition.
5976 (Output_data::is_data_size_fixed_): New data member.
5977 (Output_section_headers::set_final_data_size): New method definition.
5978 (Output_section_headers::do_size): New method declaration.
5979 (Output_segment_headers::set_final_data_size): New method definition.
5980 (Output_segment_headers::do_size): New method declaration.
5981 (Output_file_header::set_final_data_size)::New method definition.
5982 (Output_file_header::do_size)::New method declaration.
5983 (Output_section_data::Output_section_data): Add new parameter
5984 is_data_size_fixed and use it to fix data size.
5985 (Output_data_const::Output_data_const): Adjust call to base class
5986 constructor and fix data size.
5987 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
5988 base class constructor and fix data size.
5989 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
5990 base class constructor and fix data size.
5991 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
5992 class constructor and fix data size.
5993 (Output_data_group::set_final_data_size): New method definition.
5994 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
5995 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
5996 class constructor and fix data size.
5997 (Output_relaxed_input_section): New class definition.
5998 (Output_section::Simple_input_section): New class definition.
5999 (Output_section::get_input_sections): Adjust parameter list.
6000 (Output_section::add_input_section_for_script): Same.
6001 (Output_section::save_states, Output_section::restore_states,
6002 Output_section::do_address_and_file_offset_have_reset_values,
6003 (Output_section::Input_section::Input_section): Handle
6004 RELAXED_INPUT_SECTION_CODE. Add new overload for
6005 Output_relaxed_input_section.
6006 (Output_section::Input_section::is_input_section,
6007 Output_section::Input_section::set_output_section): Handle relaxed
6008 input section.
6009 (Output_section::Input_section::is_relaxed_input_section,
6010 Output_section::Input_section::output_section_data,
6011 Output_section::Input_section::relaxed_input_section): New method
6012 definitions.
6013 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
6014 value.
6015 (Output_section::Input_section::u1_): Update comments.
6016 (Output_section::Input_section::u2_): Add new union member poris.
6017 (Output_section::Checkpoint_output_section): New classs definition.
6018 (Output_section::relax_input_section): New method declaration.
6019 (Output_section::checkpoint_): New data member.
6020 (Output_segment): Update comments.
6021 (Output_segment::Output_segment): Un-privatize copy constructor.
6022 (Output_segment::operator=): Un-privatize.
6023 * script-sections.cc (Output_section_element::Input_section_list):
6024 Change element type to Output_section::Simple_input_section.
6025 (Output_section_element_dot_assignment::set_section_addresses):
6026 Register output section data for relaxation clean up.
6027 (Output_data_exression::Output_data_expression): Adjust call to base
6028 constructor to fix data size.
6029 (Output_section_element_data::set_section_addresses): Register
6030 Output_data_expression object for relaxation clean up.
6031 (struct Input_section_info): Replace Relobj pointer and section index
6032 pair with Output_section::Simple_input_section and Convert struct to a
6033 class.
6034 (Input_section_sorter::operator()): Adjust access to
e1df38aa 6035 Input_section_info data member to use accessors.
20e6d0d6
DK
6036 (Output_section_element_input::set_section_addresses): Use layout
6037 parameter. Adjust code to use Output_section::Simple_input_section
6038 and Input_secction_info classes. Register filler for relaxation
6039 clean up.
6040 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
6041 and section index pair with Output_section::Simple_input_section
6042 class. Adjust code accordingly.
6043 (Phdrs_element::release_segment): New method definition.
6044 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
6045 segment list.
6046 (Script_sections::release_segments): New method definition.
6047 * gold/script-sections.h (Script_sections::release_segments): New
6048 method declaration.
6049 * gold/target.h (Target::may_relax, Target::relax,
6050 Target::do_may_relax, Target::do_relax): New method definitions.
6051
5e445df6
ILT
60522009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6053
6054 * arm.cc (has_signed_unsigned_overflow): New function.
6055 (Arm_relocate_functions::abs8): New function.
6056 (Target_arm::Scan::local): Handle R_ARM_ABS8.
6057 (Target_arm::Scan::global): Likewise.
6058 (Target_arm::relocate::relocate): Likewise.
6059 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6060 Likewise.
6061
8c604651 60622009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
6063
6064 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
6065 * testsuite/Makefile.in: Regenerate.
6066
1e9cc1c2
NC
60672009-09-11 Nick Clifton <nickc@redhat.com>
6068
6069 * po/gold.pot: Updated by the Translation project.
6070
6a89f575
CC
60712009-09-08 Cary Coutant <ccoutant@google.com>
6072
6073 * output.cc (Output_file::open): Add execute permission to empty file.
6074 * testsuite/Makefile.am (permission_test): New test.
6075 * testsuite/Makefile.in: Regenerate.
6076
fdcac5af
ILT
60772009-09-02 Ian Lance Taylor <iant@google.com>
6078
6079 * output.cc (Output_file::resize): Call map_no_anonymous rather
6080 than map.
6081
44453f85
ILT
60822009-09-01 Mikolaj Zalewski <mikolajz@google.com>
6083
6084 * gold.cc: Include "incremental.h".
6085 (queue_initial_tasks): Call Incremental_checker methods.
6086 * incremental.cc: Include "output.h".
6087 (Incremental_checker::can_incrementally_link_output_file): New
6088 method.
6089 * incremental.h (Incremental_checker): New class.
6090
6091 * output.cc (Output_file::open_for_modification): New method.
6092 (Output_file::map_anonymous): Changed return type to bool. Record
6093 map in base_ field.
6094 (Output_file::map_no_anonymous): New method, broken out of map.
6095 (Output_file::map): Use map_no_anonymous and map_anonymous.
6096 * output.h (class Output_file): Update declarations.
6097
293c1386
CC
60982009-08-24 Cary Coutant <ccoutant@google.com>
6099
6100 * options.h (Command_line::Pre_options): New class.
6101 (Command_line::pre_options): New member.
6102 * options.cc (gold::options::ready_to_register): New variable.
6103 (One_option::register_option): Do nothing if not registering options.
6104 Assert if same short option registered twice.
6105 (General_options::General_options): Turn off option registration when
6106 done constructing.
6107 (Command_line::Pre_options::Pre_options): New constructor.
6108
f773f3d2
CC
61092009-08-24 Cary Coutant <ccoutant@google.com>
6110
06a73cfe
CC
6111 * options.h (General_options::no_keep_memory): Remove incorrect
6112 short option.
f773f3d2 6113
a15af8e2
RW
61142009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6115
6116 * Makefile.am (am__skiplex, am__skipyacc): New.
6117 * Makefile.in: Regenerate.
6118
c462b41b
RW
61192009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6120
14ec8efd
RW
6121 * Makefile.am (AM_CPPFLAGS): Renamed from ...
6122 (INCLUDES): ... this.
6123 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
6124 (AM_CPPFLAGS): Renamed from ...
6125 (INCLUDE): ... this.
6126 * Makefile.in, testsuite/Makefile.in: Regenerate.
6127
81ecdfbb
RW
6128 * Makefile.in: Regenerate.
6129 * aclocal.m4: Likewise.
6130 * config.in: Likewise.
6131 * configure: Likewise.
6132 * testsuite/Makefile.in: Likewise.
6133
c462b41b
RW
6134 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
6135 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
6136 * Makefile.in: Regenerate.
6137 * testsuite/Makefile.in: Regenerate.
6138
2da73f13
CC
61392009-08-19 Cary Coutant <ccoutant@google.com>
6140
6141 * resolve.cc (Symbol_table::resolve): Don't complain about defined
6142 symbols in shared libraries overridden by hidden or internal symbols
6143 in the main program.
6144
2db70501
CD
61452009-08-19 Chris Demetriou <cgd@google.com>
6146
6147 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
6148 checking source file names in error messages.
6149
f733487b
DK
61502009-08-18 Doug Kwan <dougkwan@google.com>
6151
6152 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
6153 an elcpp::Ehdr as parameter. Adjust call to set_target.
6154 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
6155 an elfcpp::Ehdr as parameter.
6156 * object.cc (Object::set_target): Remove the version that looks up
6157 a target and sets it.
6158 (Sized_relobj::setup): Take a Target object instead of
6159 an elfcpp::Ehdr as parameter. Adjust call to set_target.
6160 (make_elf_sized_object): Find target and ask target to
6161 make an ELF object.
6162 * object.h: (Object::set_target): Remove the version that looks up
6163 a target and sets it.
6164 (Sized_relobj::setup): Take a Target object instead of
6165 an elfcpp:Ehdr as parameter.
6166 * target.cc: Include dynobj.h.
6167 (Target::do_make_elf_object_implementation): New.
6168 (Target::do_make_elf_object): New.
6169 * target.h (Target::make_elf_object): New template declaration.
6170 (Target::do_make_elf_object): New method declarations.
6171 (Target::do_make_elf_object_implementation): New template declaration.
6172
cc70f101
ILT
61732009-08-14 Ian Lance Taylor <iant@google.com>
6174
6175 * gold.h (FUNCTION_NAME): Define.
6176 (gold_unreachable): Use FUNCTION_NAME.
6177
ef5e0cb1
ST
61782009-08-12 Sriraman Tallam <tmsriram@google.com>
6179
6180 * icf.cc (Icf::find_identical_sections): Issue a warning when a
6181 symbol in the --keep-unique list is not found.
6182
48c187ce
ST
61832009-08-12 Sriraman Tallam <tmsriram@google.com>
6184
6185 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
6186 been maked as --keep-unique.
6187 (Icf::unfold_section): New function.
6188 * icf.h (Icf::unfold_section): New function.
6189 * options.h (General_options::keep_unique): New option.
6190 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
6191 * testsuite/Makefile.in: Regenerate.
6192 * testsuite/icf_keep_unique_test.sh: New file.
6193 * testsuite/icf_keep_unique_test.cc: New file.
6194
645afe0c
CC
61952009-08-12 Cary Coutant <ccoutant@google.com>
6196
6197 PR 10471
6198 * resolve.cc (Symbol_table::resolve): Check for references from
6199 dynamic objects to hidden and internal symbols.
6200 * testsuite/Makefile.am (hidden_test.sh): New test.
6201 * testsuite/Makefile.in: Regenerate.
6202 * testsuite/hidden_test.sh: New script.
6203 * testsuite/hidden_test_1.c: New test source.
6204 * testsuite/hidden_test_main.c: New test source.
6205
11af873f
DK
62062009-08-11 Doug Kwan <dougkwan@google.com>
6207
6208 * arm.cc: Update comments.
6209 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
6210 segment to locate the .ARM.exidx section if present.
6211
b9f7d72d
DK
62122009-08-09 Doug Kwan <dougkwan@google.com>
6213
6214 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
6215 patch.
6216
ddd3c53c
ST
62172009-08-07 Sriraman Tallam <tmsriram@google.com>
6218 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
6219 compiler warnings.
6220
27721062
ST
62212009-08-06 Sriraman Tallam <tmsriram@google.com>
6222
6223 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
6224 valid tls_segment only for non-debug-section relocations.
6225 * testsuite/Makefile.am: Add gc_tls_test.
6226 * testsuite/Makefile.in: Regenerate.
6227 * testsuite/gc_tls_test.cc: New file.
6228 * testsuite/gc_tls_test.sh: New file.
6229
ef15dade 62302009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 6231
ef15dade
ST
6232 * icf.cc: New file.
6233 * icf.h: New file.
6234 * Makefile.am (CCFILES): Add icf.cc.
6235 (HFILES): Add icf.h
6236 * Makefile.in: Regenerate.
6237 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
6238 * gc.h (gc_process_relocs): Populate lists used by icf to contain
6239 section, symbol and addend information for the relocs.
6240 * gold.cc (queue_middle_tasks): Call identical code folding.
6241 * gold.h: Add defines for multimap.
6242 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
6243 to the call of finalize_local_symbols.
6244 * main.cc (main): Create object of class Icf.
6245 * object.cc (Sized_relobj::do_layout): Allow this function to be
6246 called twice during icf.
6247 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
6248 to sections marked as identical by icf.
6249 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
6250 when available.
6251 (Sized_relobj::do_section_entsize): New function.
6252 * object.h (Object::section_entsize): New function.
6253 (Object::do_section_entsize): New pure virtual function.
6254 (Relobj::finalize_local_symbols): Add new parameter.
6255 (Relobj::do_section_entsize): New function.
6256 * options.h (General_options::icf): New option.
6257 (General_options::icf_iterations): New option.
6258 (General_options::print_icf_sections): New option.
6259 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
6260 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
6261 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
6262 icf.
6263 * symtab.cc (Symbol_table::is_section_folded): New function.
6264 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
6265 to sections marked as identical by icf.
6266 * symtab.h (Symbol_table::set_icf): New function.
6267 (Symbol_table::icf): New function.
6268 (Symbol_table::is_section_folded): New function.
6269 (Symbol_table::icf_): New data member.
6270 * target-reloc.h (relocate_section): Ignore sections folded by icf.
6271 * testsuite/Makefile.am: Add commands to build icf_test.
6272 * testsuite/Makefile.in: Regenerate.
6273 * testsuite/icf_test.sh: New file.
6274 * testsuite/icf_test.cc: New file.
6275
c3b65ac4
CD
62762009-07-24 Chris Demetriou <cgd@google.com>
6277
6278 * layout.cc (is_compressible_debug_section): Fix incorrect
6279 comment about compressed section names.
6280
1caf2c51
ILT
62812009-07-20 Ian Lance Taylor <ian@airs.com>
6282
6283 PR 10419
6284 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
6285
1ef4d87f
ILT
62862009-07-16 Ian Lance Taylor <iant@google.com>
6287
6288 PR 10400
6289 * layout.h: #include <map>.
6290 (class Kept_section): Change from struct to class. Add accessors
6291 and setters. Add section size to Comdat_group mapping. Change
6292 Comdat_group to std::map. Add is_comdat_ field. Add
6293 linkonce_size field in union.
6294 (class Layout): Update declaration of find_or_add_kept_section.
6295 Don't declare find_kept_object.
6296 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
6297 parameter. Add object, shndx, is_comdat, and is_group_name
6298 parameters. Change all callers. Adjust for new Kept_section.
6299 (Layout::find_kept_object): Remove.
6300 * object.cc (Sized_relobj::include_section_group): Update use of
6301 Kept_section. Rename secnum to shndx. Only record
6302 Kept_comdat_section if sections are the same size.
6303 (Sized_relobj::include_linkonce_section): Update use of
6304 Kept_section. Only record Kept_comdat_section if sections are the
6305 same size. Set size of linkonce section.
6306 (Sized_relobj::map_to_kept_section): Update call to
6307 get_kept_comdat_section.
6308 * object.h (class Sized_relobj): Rename fields in
6309 Kept_comdat_section to drop trailing underscores; change object
6310 field to Relobj*. Change Kept_comdat_section_table to store
6311 struct rather than pointer.
6312 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
6313 Add kept_object and kept_shndx parameters. Change all callers.
6314 (Sized_relobj::get_kept_comdat_section): Change return type to
6315 bool. Add kept_object and kept_shndx parameters. Change all
6316 callers.
6317 * plugin.cc (Pluginobj::include_comdat_group): Update call to
6318 Layout::find_or_add_kept_section.
6319
37c3b7b0
ILT
63202009-07-09 Ian Lance Taylor <iant@google.com>
6321
6322 * merge.cc (Object_merge_map::initialize_input_to_output_map):
6323 Reserve space in the hash table.
6324
98fa85cb
ILT
63252009-07-06 Mikolaj Zalewski <mikolajz@google.com>
6326
6327 * fileread.cc (File_read::get_mtime): New method.
6328 * fileread.h (Timespec): New structure.
6329 (File_read::get_mtime): New method.
6330 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
6331 Renamed from timestamp_nsec.
6332 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
6333 Elf_Xword.
e1df38aa 6334 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 6335 timestamp_nsec.
e1df38aa 6336 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
6337 (Incremental_inputs::report_obejct): Save mtime; style fix.
6338 (Incremental_inputs::report_script): Save mtime; style fix.
6339 (Incremental_inputs::finalize_inputs): Style fix.
6340 (Incremental_inputs::finalize): Style fix.
6341 (Incremental_inputs::create_input_section_data): Store inputs
6342 mtime.
6343 * incremental.h (Incremental_inputs::report_script): Add mtime
6344 argument.
6345 (Incremental_inputs::Input_info::Input_info): Intialize only one
6346 union member.
6347 (Incremental_inputs::Input_info::archive): Move to nameless
6348 union.
6349 (Incremental_inputs::Input_info::obejct): Move to nameless union.
6350 (Incremental_inputs::Input_info::script): Move to nameless union.
6351 (Incremental_inputs::mtime): New field.
6352 * script.cc (read_input_script): Pass file mtime to
6353 Incremental_input.
6354 * script.h (Script_info::inputs): Style fix.
6355
c9d70757
ILT
63562009-07-01 Ian Lance Taylor <ian@airs.com>
6357
6358 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
6359 instead of 32.
6360
9c547ec3
ILT
63612009-06-24 Ian Lance Taylor <iant@google.com>
6362
6363 PR 10156
6364 * layout.cc (Layout::choose_output_section): If we find an
6365 existing section, update the flags.
6366 (Layout::create_notes): New function, broken out of
6367 Layout::finalize.
6368 (Layout::finalize): Don't create note sections.
6369 (Layout::create_note): Don't crash if linker script discards
6370 section.
6371 (Layout::create_gold_note): Likewise.
6372 (Layout::create_build_id): Likewise. Don't set
6373 after_input_sections on the section.
6374 (Layout::create_executable_stack_info): Remove target parameter.
6375 Change caller.
6376 * layout.h (class Layout): Declare create_notes. Update
6377 declaration of create_executable_stack_info.
6378 * gold.cc (queue_middle_tasks): Call create_notes.
6379 * output.cc (Output_section::update_flags_for_input_section): Move
6380 here from output.h. If SHF_ALLOC flag is newly set, mark address
6381 invalid.
6382 * output.h (Output_data::mark_address_invalid): New function.
6383 (class Output_section): Only declare, not define,
6384 update_flags_for_input_section. Remove set_flags.
6385
55458500
ILT
63862009-06-24 Ian Lance Taylor <iant@google.com>
6387
6388 * script-sections.cc (Output_section_definition::
6389 set_section_addresses): Rename shadowing local load_address to
6390 laddr.
6391
1307d6cd
ILT
63922009-06-24 Ian Lance Taylor <iant@google.com>
6393
6394 PR 10244
6395 * reloc.cc (relocate_sections): Skip empty relocation sections.
6396
ec3f783e
ILT
63972009-06-23 Ian Lance Taylor <iant@google.com>
6398
6399 PR 10156
6400 * layout.cc (Layout::create_note): Use choose_output_section
6401 rather than make_output_section.
6402
459c9f1c
ILT
64032009-06-23 Ian Lance Taylor <iant@google.com>
6404
6405 PR 10237
6406 * options.cc (General_options::parse_V): Set printed_version_.
6407 (General_options::General_options): Initialize printed_version_.
6408 * options.h (class General_options): Add printed_version_ field.
6409 * gold.cc (queue_initial_tasks): If there are no input files,
6410 don't give a fatal error if we printed the version information.
6411 (queue_middle_tasks): If using -r with a shared object, give a
6412 fatal error rather than an ordinary error.
6413
1518dc8f
ILT
64142009-06-23 Ian Lance Taylor <iant@google.com>
6415
6416 PR 10219
6417 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
6418 (Layout::make_output_section): Set have_stabstr_section_ if we see
6419 a .stab*str section.
6420 (Layout::finalize): Call link_stabs_sections.
6421 (Layout::link_stabs_sections): New file.
6422 * layout.h (class Layout): Add have_stabstr_section_ field.
6423 Declare link_stabs_sections.
6424
3d857b98
DK
64252009-06-23 Doug Kwan <dougkwan@google.com>
6426
6427 * Makefile.am (libgold_a_LIBADD): New.
6428 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
6429 * Makefile.in: Regenerate.
6430 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
6431 * configure: Regenerate.
6432 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
6433 * fileread.cc: Include sys/state.h
6434 * gold.h: Declare memmem and strndup if found missing.
6435 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
6436
0639a6f6
ILT
64372009-06-23 Ian Lance Taylor <iant@google.com>
6438
6439 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
6440 * configure: Rebuild.
6441
8d63875c
ILT
64422009-06-23 Ian Lance Taylor <iant@google.com>
6443
6444 PR 10147
6445 * object.cc (Object::section_contents): Don't try to get a view if
6446 the section has length zero.
6447 (Object::handle_gnu_warning_section): If the section is empty, use
6448 the name of the section as the warning.
6449
f7c8a183
ILT
64502009-06-23 Ian Lance Taylor <iant@google.com>
6451
6452 PR 10133
6453 * stringpool.h (class Stringpool_template): Add optimize_ field.
6454 (Stringpool_template::set_optimize): New function.
6455 * stringpool.cc (Stringpool_template::Stringpool_template):
6456 Initialize optimize_ field.
6457 (Stringpool_template::set_string_offsets): Test local optimize
6458 fild rather than parameter.
6459 * layout.cc (Layout::Layout): Call set_optimize on the section
6460 name stringpool.
6461
e6a307ba
ILT
64622009-06-22 Ian Lance Taylor <iant@google.com>
6463
6464 PR 10030
6465 * yyscript.y: Parse TARGET.
6466 * script.cc (script_set_target): New function.
6467 * script-c.h (script_set_target): Declare.
6468 * options.cc (General_options::string_to_object_format): Rename
6469 from string_to_object_format in anonymous namespace. Change
6470 callers.
6471 * options.h (class General_options): Declare
6472 string_to_object_format.
6473
3ee173de
ILT
64742009-06-22 Ian Lance Taylor <iant@google.com>
6475
6476 * script-sections.cc (Script_sections::create_segments): Don't put
6477 program headers in a PT_LOAD segment if -n or -N.
6478
64792009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
6480
6481 PR 10141
6482 * options.h (class General_options): Add -z lazy and -z now. Sort
6483 -z options into alphabetical order.
6484 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
6485
cd6739a1 64862009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
6487
6488 * layout.cc (Layout::make_output_section): Call
6489 Target::new_output_section.
6490 (Layout::attach_allocated_section_to_segment): Put large section
6491 sections in a separate load segment with the large segment flag
6492 set.
6493 (Layout::segment_precedes): Sort large data segments after other
6494 load segments.
6495 (align_file_offset): New static function.
6496 (Layout::set_segment_offsets): Use align_file_offset.
6497 * output.h (class Output_section): Add is_small_section_ and
6498 is_large_section_ fields.
6499 (Output_section::is_small_section): New function.
6500 (Output_section::set_is_small_section): New function.
6501 (Output_section::is_large_section): New function.
6502 (Output_section::set_is_large_section): New function.
6503 (Output_section::is_large_data_section): New function.
6504 (class Output_segment): Add is_large_data_segment_ field.
6505 (Output_segment::is_large_data_segment): New function.
6506 (Output_segment::set_is_large_data_segment): New function.
6507 * output.cc (Output_section::Output_section): Initialize new
6508 fields.
6509 (Output_segment::Output_segment): Likewise.
6510 (Output_segment::add_output_section): Add assertion that large
6511 data sections always go in large data segments. Force small data
6512 sections to the end of the list of data sections. Force small BSS
6513 sections to the start of the list of BSS sections. For large BSS
6514 sections to the end of the list of BSS sections.
6515 * symtab.h (class Symbol): Declare is_common_shndx.
6516 (Symbol::is_defined): Check Symbol::is_common_shndx.
6517 (Symbol::is_common): Likewise.
6518 (class Symbol_table): Define enum Commons_section_type. Update
6519 declarations. Add small_commons_ and large_commons_ fields.
6520 * symtab.cc (Symbol::is_common_shndx): New function.
6521 (Symbol_table::Symbol_table): Initialize new fields.
6522 (Symbol_table::add_from_object): Put small and large common
6523 symbols in the right list.
6524 (Symbol_table::sized_finalized_symbol): Check
6525 Symbol::is_common_shndx.
6526 (Symbol_table::sized_write_globals): Likewise.
6527 * common.cc (Symbol_table::do_allocate_commons): Allocate new
6528 common symbol lists. Don't call do_allocate_commons_list if the
6529 list is empty.
6530 (Symbol_table::do_allocate_commons_list): Remove is_tls
6531 parameter. Add comons_section_type parameter. Change all
6532 callers. Handle small and large common symbols.
6533 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
6534 Symbol::is_common_shndx.
6535 * resolve.cc (symbol_to_bits): Likewise.
6536 * target.h (Target::small_common_shndx): New function.
6537 (Target::small_common_section_flags): New function.
6538 (Target::large_common_shndx): New function.
6539 (Target::large_common_section_flags): New function.
6540 (Target::new_output_section): New function.
6541 (Target::Target_info): Add small_common_shndx, large_common_shndx,
6542 small_common_section_flags, and large_common_section_flags
6543 fields.
6544 (Target::do_new_output_section): New virtual function.
6545 * arm.cc (Target_arm::arm_info): Initialize new fields.
6546 * i386.cc (Target_i386::i386_info): Likewise.
6547 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
6548 Likewise.
6549 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
6550 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
6551 (Target_x86_64::do_new_output_section): New function.
6552 * configure.ac: Define conditional MCMODEL_MEDIUM.
6553 * testsuite/Makefile.am (check_PROGRAMS): Add large.
6554 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
6555 (large_LDFLAGS): Define.
6556 * testsuite/large.c: New file.
6557 * testsuite/testfile.cc (Target_test::test_target_info):
6558 Initialize new fields.
6559 * configure, testsuite/Makefile.in: Rebuild.
6560
bb04269c
DK
65612009-06-05 Doug Kwan <dougkwan@google.com>
6562
6563 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 6564 * Makefile.in: Regenerate.
bb04269c
DK
6565 * i386.cc (class Target_i386): Define new virtual method to
6566 override do_is_local_label_name in parent.
6567 * object.cc (Sized_relobj::do_count_local_symbols): Discard
6568 local symbols if --discard-locals or -X is given.
6569 * options.h (class General_options): Declare new options
6570 '--discard-locals' and '-X' for discarding locals.
6571 * target.h (class Target): Define new methods is_local_label_name.
6572 Declare new virtual method do_is_local_label_name.
6573 * target.cc: New file.
6574 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
6575 (check_SCRIPTS): Add discard_locals_test.sh.
6576 (check_DATA): Add discard_local_tests.syms.
6577 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
6578 (discard_local_tests.syms, discard_locals_test.o): New make rules.
6579 * testsuite/Makefile.in: Regenerate.
6580 * testsuite/discard_locals_test.c: New file.
6581 * testsuite/discard_locals_test.sh: Same.
6582
805bb01c
DK
65832009-06-05 Doug Kwan <dougkwan@google.com>
6584
6585 * object.cc (Sized_relobj::Sized_relobj): Initialize
6586 discarded_eh_frame_shndx_ to -1U.
6587 (Sized_relobj::do_layout): Record index of a discard .eh_frame
6588 section.
6589 (Sized_relobj::do_count_local_symbols): Skip local symbols in
6590 a discarded .eh_frame section.
6591 (Sized_relobj::do_finalize_local_symbols): Ditto.
6592 * object.h (class Sized_relobj): Declare new member
6593 discarded_eh_frame_shndx_.
6594 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
6595 (local_labels_test.o, local_labels_test): New rules.
6596 * testsuite/Makefile.in: Regenerate.
6597
1dcd334d
DK
65982009-06-04 Doug Kwan <dougkwan@google.com>
6599
6600 * layout.cc (Layout::section_name_mapping): Add mapping for
6601 special ARM sections.
6602
96d49306
DK
66032009-06-03 Doug Kwan <dougkwan@google.com>
6604
6605 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
6606 (utils::has_overflow): Same.
6607
dff16297
ILT
66082009-06-03 Ian Lance Taylor <iant@google.com>
6609
6610 * layout.cc (Layout::section_name_mapping): New array, replacing
6611 Layout::linkonce_mapping.
6612 (Layout::section_name_mapping_count): New variable, replacing
6613 Layout::linkonce_mapping_count.
6614 (Layout::linkonce_output_name): Remove.
6615 (Layout::output_section_name): Rewrite.
6616 * layout.h (class Layout): Rename Linkonce_mapping to
6617 Section_name_mapping, linkonce_mapping to section_name_mapping,
6618 linkonce_mapping_count to section_name_mapping_count. Don't
6619 declare linkonce_output_name.
6620
c121c671
DK
66212009-06-03 Doug Kwan <dougkwan@google.com>
6622
6623 * gold/arm.cc (namespace utils): New.
6624 (Target_arm::reloc_is_non_pic): Define new method.
6625 (class Arm_relocate_functions): New.
6626 (Target_arm::Relocate::relocate): Handle relocation types used by
6627 Android.
6628
07800fab
ILT
66292009-06-03 Ian Lance Taylor <iant@google.com>
6630
6631 * arm.cc (Target_arm::scan::global): Use || instead of |.
6632
c121c671
DK
66332009-06-02 Doug Kwan <dougkwan@google.com>
6634
6635 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
6636 issued_non_pic_error_.
6637 (class Target_arm::Scan): Declare new method check_non_pic.
6638 Define new method symbol_needs_plt_entry.
6639 Declare new data member issued_non_pic_error_.
6640 (class Target_arm::Relocate): Declare new method
6641 should_apply_static_reloc.
6642 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
6643 (Target_arm::Scan::check_non_pic): Define new method.
6644 (Target_arm::Scan::local): Handle a small subset of reloc types used
6645 by Android.
6646 (Target_arm::Scan::local): Same.
6647 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
6648
b19b0c6d
ILT
66492009-05-31 Mikolaj Zalewski <mikolajz@google.com>
6650
6651 * incremental.cc (Incremental_inputs::report_command_line): Filter
6652 out --incremental-* options.
6653
94cdfcff
DK
66542009-05-29 Doug Kwan <dougkwan@google.com>
6655
6656 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
6657 template class.
6658 (class Target_arm): Update comment.
6659 (Target_arm::Target_arm): Initialize new data members GOT_,
6660 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
6661 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
6662 and Target_arm::rel_dyn_section.
6663 Declare new_enum Target_arm::Got_type.
6664 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
6665 and DYNBSS_.
6666 Update commments for member do_dynsym_value.
6667 (Target_arm::got_size, Target_arm::plt_section,
6668 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
6669 new methods inside class defintion.
6670 (Target_arm::got_section): Define new method.
6671 (Target_arm::rel_dyn_section): Same.
6672 (Output_data_plt_arm): New template class.
6673 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
6674 (Output_data_plt_arm:do_adjust_output_section): Define new method.
6675 (Output_data_plt_arm::add_entry): Same.
6676 (Output_data_plt_arm::first_plt_entry): Define new
6677 static data member for PLT instruction template.
6678 (Output_data_plt_arm::plt_entry): Same.
6679 (Output_data_plt_arm::do_write): Define new method.
6680 (Target_arm::make_plt_entry): Same.
6681 (Target_arm::do_finalize_sections): Same.
6682 (Target_arm::do_dynsym_value): Same.
6683
4a657b0d
DK
66842009-05-28 Doug Kwan <dougkwan@google.com>
6685
6686 * Makefile.am (TARGETSOURCES): Add arm.cc.
6687 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
6688 * Makefile.in: Regenerate.
6689 * arm.cc: New file.
6690 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
6691
e7ae8c36
DK
66922009-05-26 Doug Kwan <dougkwan@google.com>
6693
6694 * options.cc (General_options::parse_exclude_libs). Fix a comment.
6695 (General_options::check_excluded_libs): Strip off directories in
6696 archive name before matching like GNU ld does.
6697 * testsuite/Makefile.am (MOSTLYCLEANFILES,
6698 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
6699 (exclude_libs_test_LDFLAGS): Add linker option
6700 -Wl,--exclude-libs,libexclude_libs_test_3
6701 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
6702 an explicit archive without using -l.
6703 (alt/libexclude_libs_test_3.a): New make rule.
6704 * testsuite/Makefile.in: Regenerate.
6705 * testsuite/exclude_libs_test.c : Declare lib3_default().
6706 (main): Call it.
6707 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
6708 * exclude_libs_test_3.c: New file.
6709
f12e7348
NC
67102009-05-26 Nick Clifton <nickc@redhat.com>
6711
6712 * po/id.po: New Indonesian translation.
6713 * po/gold.pot: Updated template file.
6714
4daadc0d
ST
67152009-05-22 Sriraman Tallam <tmsriram@google.com>
6716
e1df38aa 6717 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
6718 gc_comdat_test files. Add -Wl,--gc-sections to build
6719 gc_comdat_test.
6720 * testsuite/Makefile.in: Regenerate.
6721 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
6722
531813ad
ST
67232009-05-21 Sriraman Tallam <tmsriram@google.com>
6724
6725 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
6726 kept comdat section was garbage collected.
6727 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
6728 * testsuite/Makefile.in: Regenerate.
6729 * testsuite/gc_comdat_test.sh: New file.
6730 * testsuite/gc_comdat_test_1.cc: New file.
6731 * testsuite/gc_comdat_test_2.cc: New file.
6732
65514900
CC
67332009-05-19 Doug Kwan <dougkwan@google.com>
6734
6735 * archive.cc (Archive::Archive): Move constructor from archive.h
6736 to here. Initialize no_export_.
6737 (Archive::get_elf_object_for_member): Set no_export flag of object.
6738 * archive.h (Archive::Archive): Move constructor body to
6739 archive.cc.
6740 (Archive::no_export): New method.
6741 (Archive::no_export_): New field.
6742 * object.h (Object::Object): Initialize no_export_ to false.
6743 (Object::no_export, Object::set_no_export): New methods.
6744 (Object::no_export_): New field.
6745 * options.cc (General_options::parse_exclude_libs): New method.
6746 (General_options::check_excluded_libs) Same.
6747 * options.h (exclude_libs): New option.
6748 (General_options::check_excluded_libs): New method declaration.
6749 (General_options::excluded_libs_): New field.
6750 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
6751 default or protected visibility if an object has no-export flag set.
6752 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
6753 (check_SCRIPTS): Add exclude_libs_test.sh.
6754 (check_DATA): Add exclude_libs_test.syms.
6755 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
6756 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
6757 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
6758 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
6759 (exclude_libs_test.syms, libexclude_libs_test_1.a,
6760 libexclude_libs_test_2.a): New rules.
6761 * testsuite/Makefile.in: Regenerate.
6762 * testsuite/exclude_libs_test.c: New file.
6763 * testsuite/exclude_libs_test.sh: Ditto.
6764 * testsuite/exclude_libs_test_1.c: Ditto.
6765 * testsuite/exclude_libs_test_2.c: Ditto.
6766
1b77ea50
ILT
67672009-05-15 Ian Lance Taylor <iant@google.com>
6768
6769 * configure.ac: Check for declarations for cases where libiberty.h
6770 checks HAVE_DECL_xxx.
6771 * configure, config.in: Rebuild.
6772
072fe7ce
ILT
67732009-05-15 Mikolaj Zalewski <mikolajz@google.com>
6774
6775 * gold.h (Incremental_argument_list): Remove (invalid) forward
6776 declaration.
6777 * incremental.cc (Incremental_inputs::report_achive): New method.
6778 (Incremental_inputs::report_object): New method.
6779 (Incremental_inputs::report_script): New method.
6780 (Incremental_inputs::finalize_inputs): New method.
6781 (Incremental_inputs::finalize): Call finalize_inputs().
6782 (Incremental_inputs::sized_create_incremental_inputs_section_data):
6783 Create inputs entries.
6784 * incremental.h (Incremental_input_type): New enum.
6785 (Incremental_inputs::Incremental_input): Initialize new fields.
6786 (Incremental_inputs::report_inputs): New method.
6787 (Incremental_inputs::report_achive): New method.
6788 (Incremental_inputs::report_object): New method.
6789 (Incremental_inputs::report_script): New method.
6790 (Incremental_inputs::finalize_inputs): New method.
6791 (Incremental_inputs::Input_info): New struct.
6792 (Incremental_inputs::Input_info_map): New typedef.
6793 (Incremental_inputs::lock_): New field.
6794 (Incremental_inputs::Inputs_): New field.
6795 (Incremental_inputs::Inputs_map): New field.
6796 * main.cc (main): Call Incremental_input::report_inputs.
6797 * options.h (Input_argument_list): Typedef moved from
6798 Input_arguments.
6799 (Input_file_group::Files): Remove, use ::Input_argument_list.
6800 (Input_file_group::Input_argument_list): Remove, use
6801 ::Input_argument_list.
6802 * plugin.cc (Plugin_manager::add_input_file): Add error in
6803 incremental build.
6804 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
6805 functions.
6806 * script.cc (read_input_script): Call
6807 Incremental_input::report_script.
6808 * script.h (Script_info): New class.
6809
b0481b0b
ILT
68102009-04-27 Ian Lance Taylor <iant@google.com>
6811
6812 * x86_64.cc (do_adjust_output_section): Set entsize to
6813 plt_entry_size.
6814
b22a5a41 68152009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
6816
6817 * output.cc (Output_file::close): After short writes, continue
6818 writing from the correct offset in the buffer being written.
6819
40fde488
CD
68202009-04-23 Chris Demetriou <cgd@google.com>
6821
6822 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
6823 * configure: Regenerate.
6824 * config.in: Regenerate.
6825 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
6826 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
6827
3ce2c28e
ILT
68282009-04-21 Mikolaj Zalewski <mikolajz@google.com>
6829
6830 * incremental.cc (Incremental_inputs_header_data): Renamed from
6831 Incremental_input_header_data.
6832 (Incremental_inputs_header_data::data_size): New field.
6833 (Incremental_inputs_header_data::put_input_file_count): Renamed
6834 from input_file_count.
6835 (Incremental_inputs_header_data::put_command_line_offset): Renamed
6836 from command_line_offset.
6837 (Incremental_inputs_header_data::put_reserved): Renamed from
6838 put_reserved.
6839 (Incremental_inputs_entry_data): Renamed from
6840 Incremental_input_entry_data.
6841 (Incremental_inputs_entry_data::data_size): New field.
6842 (Incremental_inputs::report_command_line): New method.
6843 (Incremental_inputs::finalize): New method.
6844 (Incremental_inputs::create_incremental_inputs_data): New method.
6845 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
6846 * incremental.h: New file.
6847 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
6848 (Layout::finalize): Create incremental inputs section in
6849 incremental builds.
6850 (Layout::create_incremental_info_sections): New method.
6851 * layout.h (Layout::incremental_inputs): New method.
6852 (Layout::create_incremental_info_sections): New method.
6853 (Layout::incremental_inputs_): New field.
6854 * main.cc (main): Notify Incremental_input of the command line.
6855
e55bde5e
ILT
68562009-04-01 Ian Lance Taylor <iant@google.com>
6857 Mikolaj Zalewski <mikolajz@google.com>
6858
6859 * gold.h (reserve_unordered_map): Define, three versions, one for
6860 each version of Unordered_map.
6861 * layout.cc (Layout::Layout): Remove options parameter. Add
6862 number_of_input_files parameter. Don't initialize options_.
6863 Initialize number_of_input_files_ and resized_signatures_. Move
6864 sections_are_attached_.
6865 (Layout::layout_group): Reserve space for group_signatures_.
6866 (Layout::find_or_add_kept_section): Change name parameter to be a
6867 reference. Resize signatures_ map when it gets large enough.
6868 (Layout::layout_eh_frame): Use parameters->options() instead of
6869 this->options_.
6870 (Layout::make_output_section): Likewise.
6871 (Layout::attach_allocated_section_to_segment): Likewise.
6872 (Layout::finalize, Layout::create_executable_stack): Likewise.
6873 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
6874 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
6875 * layout.h (class Layout): Update declarations. Remove options_
6876 field. Add number_of_input_files_ and resized_signatures_
6877 fields. Move sections_are_attached_ field.
6878 * main.cc (main): Pass number of input files to Layout
6879 constructor. Don't pass options.
6880
154b857c
ILT
68812009-03-30 Ian Lance Taylor <iant@google.com>
6882
6883 * ffsll.c (ffsll): Correct implementation.
6884
2f35ab9b
ILT
68852009-03-27 Ian Lance Taylor <iant@google.com>
6886
fd03461a
ILT
6887 * ffsll.c: New file.
6888 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
6889 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
6890 * ftruncate.c (ftruncate): Declare before definition.
6891 * mremap.c (mremap): Likewise.
6892 * pread.c (pread): Likewise.
6893 * configure, Makefile.in, config.in: Rebuild.
6894
2f35ab9b
ILT
6895 * mremap.c: New file.
6896 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
6897 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
6898 (mremap): Declare if HAVE_MREMAP is not defined.
6899 * configure, Makefile.in, config.in: Rebuild.
6900
33aea2fd
CC
69012009-03-27 Cary Coutant <ccoutant@google.com>
6902
6903 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
6904 position independent.
6905 * sparc.cc (Target_sparc::check_non_pic): Likewise.
6906 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
6907
6d479619
CC
69082009-03-24 Cary Coutant <ccoutant@google.com>
6909
6910 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
6911 an executable.
6912 (needs_dynamic_reloc): Likewise.
6913
afc06bb8
ILT
69142009-03-24 Ian Lance Taylor <iant@google.com>
6915
6916 * yyscript.y (file_cmd): Recognize EXTERN.
6917 (extern_name_list, extern_name_list_body): New nonterminals.
6918 * script.cc (script_add_extern): Define.
6919 * script-c.h (script_add_extern): Declare.
6920
f6060a4d
ILT
69212009-03-24 Rafael Avila de Espindola <espindola@google.com>
6922
6923 * object.cc (is_elf_object): Define.
6924 * object.h (is_elf_object): Declare.
6925 * archive.cc (Archive::get_elf_object_for_member): Call
6926 is_elf_object.
33aea2fd 6927 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 6928
26736d8e
ILT
69292009-03-24 Elliott Hughes <enh@google.com>
6930
6931 * output.cc (Output_file::map_anonymous): Define.
6932 (Output_file::map): Use map_anonymous. If the regular mmap fails,
6933 try an anonymous one. Report the size if the mmap fails.
6934 * output.h (class Output_file): Declare map_anonymous.
6935
22fd9730
ILT
69362009-03-24 Ian Lance Taylor <iant@google.com>
6937
6938 * target-select.cc (instantiate_target): Don't acquire the lock if
6939 the instantiated_target_ field has already been set.
6940
cb010894
ILT
69412009-03-23 Ian Lance Taylor <iant@google.com>
6942
7f055c20
ILT
6943 * gold-threads.h (class Initialize_lock): Define.
6944 * gold-threads.cc (class Initialize_lock_once): Define.
6945 (initialize_lock_control): New static variable.
6946 (initialize_lock_pointer): New static variable.
6947 (initialize_lock_once): New static function.
6948 (Initialize_lock::Initialize_lock): Define.
6949 (Initialize_lock::initialize): Define.
6950 * target-select.h: Include "gold-threads.h".
6951 (class Target_selector): Add lock_ and initialize_lock_ fields.
6952 Don't define instantiate_target, just declare it.
6953 * target-select.cc (Target_selector::Target_selector): Initialize
6954 new fields.
6955 (Target_selector::instantiate_target): Define.
6956 * descriptors.h: Include "gold-threads.h".
6957 (class Descriptors): Add initialize_lock_ field.
6958 * descriptors.cc (Descriptors::Descriptors): Initialize new
6959 field.
6960 (Descriptors::open): Use initialize_lock_ field
6961 * errors.h (class Errors): Add initialize_lock_ field.
6962 * errors.cc (Errors::Errors): Initialize new field.
6963 (Errors::initialize_lock): Use initialize_lock_ field.
6964 * powerpc.cc (class Target_selector_powerpc): Remove
6965 instantiated_target_ field. In do_recognize call
6966 instantiate_target rather than do_instantiate_target. In
6967 do_instantiate_target just allocate a new target.
6968 * sparc.cc (class Target_selector_sparc): Likewise.
6969
36959681
ILT
6970 * freebsd.h: New file.
6971 * i386.cc: Include "freebsd.h".
6972 (Target_i386): Derive from Target_freebsd rather than
6973 Sized_target.
6974 (Target_selector_i386): Derive from Target_selector_freebsd rather
6975 than Target_selector.
6976 * x86_64.cc: Include "freebsd.h".
6977 (Target_x86_64): Derive from Target_freebsd rather than
6978 Sized_target.
6979 (Target_selector_x86_64): Derive from Target_selector_freebsd
6980 rather than Target_selector.
6981 * target.h (class Target): Add adjust_elf_header and
6982 do_adjust_elf_header.
6983 * output.cc (Output_file_header:: do_sized_write): Call target
6984 adjust_elf_header routine.
6985 * configure.tgt: Set targ_osabi.
6986 * configure.ac: Define GOLD_DEFAULT_OSABI.
6987 * parameters.cc (Parameters::default_target): Pass
6988 GOLD_DEFAULT_OSABI to select_target.
6989 * target-select.h (class Target_selector): Make instantiate_target
6990 protected rather than private.
6991 * Makefile.am (HFILES): Add freebsd.h.
6992 * configure, Makefile.in, config.in: Rebuild.
6993
cb010894
ILT
6994 * merge.cc (do_add_input_section): Correct pend value. Change
6995 message about last entry not being null terminated from error to
6996 warning.
6997
0e879927
ILT
69982009-03-20 Mikolaj Zalewski <mikolajz@google.com>
6999
7000 * incremental.cc: New file.
7001 * Makefile.am (CCFILES): Add incremental.cc.
7002 * Makefile.in: Rebuild.
7003
41105937
PP
70042009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
7005
7006 * layout.cc (Layout::output_section_name): Preserve names
7007 of '.note.' sections.
e1df38aa 7008
60439920
ILT
70092009-03-19 Ian Lance Taylor <iant@google.com>
7010
7011 * descriptors.cc (Descriptors::open): Check that the options are
7012 valid before using them.
7013
0d371ad3
ILT
70142009-03-18 Ian Lance Taylor <iant@google.com>
7015
7016 * script-sections.h: Include <list>.
7017 (class Script_sections): Change Sections_elements from std::vector
7018 to std::list. Typedef public Elements_iterator. Add
7019 orphan_section_placement_, data_segment_align_start_, and
7020 saw_data_segment_align_ fields. Remove data_segment_align_index_
7021 field.
7022 * script-sections.cc (class Orphan_section_placement): New class.
7023 (class Sections_element): Add virtual functions is_relro and
7024 orphan_section_init. Remove virtual function place_orphan_here.
7025 (class Output_section_definition): Add is_relro and
7026 orphan_section_init. Remove place_orphan_here.
7027 (class Orphan_output_section): Likewise.
7028 (Script_sections::Script_sections): Update for field changes.
7029 (Script_sections::data_segment_align): Set saw_data_segment_align_
7030 and data_segment_align_start_, not data_segment_align_index.
7031 (Script_sections::data_segment_relro_end): Check
7032 saw_data_segment_align_. Use data_segment_align_start_ rather
7033 than data_segment_align_index_.
7034 (Script_sections::place_orphan): Rewrite to use
7035 Orphan_section_placement.
7036
9201d894
ILT
70372009-03-17 Ian Lance Taylor <iant@google.com>
7038
9c5b8369
ILT
7039 * archive.cc (Archive::add_symbols): Check for a version attached
7040 to the symbol name in the archive map.
7041 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
7042 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
7043 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
7044 (ver_test_11.a): New target.
7045 * testsuite/Makefile.in: Rebuild.
7046
9201d894
ILT
7047 * configure.ac: Check for chsize and posix_fallocate. Replace
7048 ftruncate.
7049 * ftruncate.c: New file, from gnulib.
7050 * output.cc (posix_fallocate): Define dummy version if not
7051 HAVE_POSIX_FALLOCATE.
7052 (Output_file::map): Call posix_fallocate rather than lseek and
7053 write.
7054 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
7055 * configure, Makefile.in, config.in: Rebuild.
7056
ef4ab7a8 70572009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 7058
ef4ab7a8
PP
7059 * layout.h (Layout::create_note): Add section_name parameter.
7060 * layout.cc (Layout::create_note): Likewise.
7061 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 7062
8c500701
ILT
70632009-03-17 Ian Lance Taylor <iant@google.com>
7064
e85b18e1
ILT
7065 * descriptors.cc: Include "options.h".
7066 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
7067 (Descriptors::open): Always use O_CLOEXEC when opening a new
7068 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
7069 then set FD_CLOEXEC.
7070
9efe6174
ILT
7071 * sparc.cc (class Target_sparc): Add has_got_section.
7072 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
7073 make sure we have a GOT section.
7074
7075 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
7076 (Target_sparc::Scan::local): Likewise.
7077 (Target_sparc::Scan::global): Likewise.
7078 (Target_sparc::Relocate::relocate): Likewise.
7079 (Target_sparc::Relocate::relocate_tls): Likewise.
7080
8c500701
ILT
7081 * symtab.cc (Symbol_table::define_default_version): New function,
7082 broken out of add_from_object.
7083 (Symbol_table::add_from_object): Call define_default_version.
7084 (Symbol_table::define_special_symbol): Add resolve_oldsym
7085 parameter. Change all callers. If the version for a symbol comes
7086 from a version script, resolve it with the symbol with the same
7087 name with no version. Also add the symbol without a version if
7088 appropriate.
7089 (do_define_in_output_data): If resolving with oldsym, don't delete
7090 sym.
7091 (do_define_in_output_segment): Likewise.
7092 (do_define_as_constant): Likewise.
7093 * symtab.h (class Symbol_table): Update declarations.
7094
f1ed28fb
ILT
70952009-03-13 Ian Lance Taylor <iant@google.com>
7096
15f8229b
ILT
7097 * readsyms.cc (Read_symbols::incompatible_warning): New function.
7098 (Read_symbols::requeue): New function.
7099 (Read_symbols::do_read_symbols): If make_elf_object fails because
7100 the target type is not configured, and the file was searched for,
7101 issue a warning and retry with the next directory.
7102 (Add_symbols::run): If the file has an incompatible format, and
7103 it was searched for, requeue the Read_symbols task. On error,
7104 release the object.
7105 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
7106 dirindex parameter to constructor. Change all callers. Declare
7107 incompatible_warning and requeue.
7108 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
7109 input_argument_ and input_group_ fields. Add them to
7110 constructor. Change all callers.
7111 (class Read_script): Add dirindex_ field. Add it to constructor.
7112 Change all callers.
7113 * archive.cc (Archive::setup): Remove input_objects parameter.
7114 Change all callers.
7115 (Archive::get_file_and_offset): Likewise.
7116 (Archive::read_all_symbols): Likewise.
7117 (Archive::read_symbols): Likewise.
7118 (Archive::get_elf_object_for_member): Remove input_objects
7119 parameter. Add punconfigured parameter. Change all callers.
7120 (Archive::add_symbols): Change return type to bool. Check return
7121 value of include_member.
7122 (Archive::include_all_members): Likewise.
7123 (Archive::include_member): Change return type to bool. Return
7124 false if first included object has incompatible target. Set
7125 included_member_ field.
7126 (Add_archive_symbols::run): If add_symbols returns false, requeue
7127 Read_symbols task.
7128 * archive.h (class Archive): Add included_member_ field.
7129 Initialize it in constructor. Add input_file and searched_for
7130 methods. Update declarations.
7131 (class Add_archive_symbols): Add dirpath_, dirindex_, and
7132 input_argument_ fields. Add them to constructor. Change all
7133 callers.
7134 * script.cc: Include "target-select.h".
7135 (class Parser_closure): Add skip_on_incompatible_target_ and
7136 found_incompatible_target_ fields. Add
7137 skip_on_incompatible_target parameter to constructor. Change all
7138 callers. Add methods skip_on_incompatible_target,
7139 clear_skip_on_incompatible_target, found_incompatible_target, and
7140 set_found_incompatible_target.
7141 (read_input_script): Add dirindex parameter. Change all callers.
7142 If parser finds an incompatible target, requeue Read_symbols
7143 task.
7144 (script_set_symbol): Clear skip_on_incompatible_target in
7145 closure.
7146 (script_add_assertion, script_parse_option): Likewise.
7147 (script_start_sections, script_add_phdr): Likewise.
7148 (script_check_output_format): New function.
7149 * script.h (read_input_script): Update declaration.
7150 * script-c.h (script_check_output_format): Declare.
7151 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
7152 (ignore_cmd): Remove OUTPUT_FORMAT.
7153 * fileread.cc (Input_file::Input_file): Add explicit this.
7154 (Input_file::will_search_for): New function.
7155 (Input_file::open): Add pindex parameter. Change all callers.
7156 * fileread.h (class Input_file): Add input_file_argument method.
7157 Declare will_search_for. Update declarations.
7158 * object.cc (make_elf_object): Add punconfigured parameter.
7159 Change all callers.
7160 * object.h (class Object): Make input_file public. Add
7161 searched_for method.
7162 (make_elf_object): Update declaration.
7163 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
7164 restart search.
7165 * dirsearch.h (class Dirsearch): Update declaration.
7166 * options.h (class General_options): Add --warn-search-mismatch.
7167 * parameters.cc (Parameters::is_compatible_target): New function.
7168 * parameters.h (class Parameters): Declare is_compatible_target.
7169 * workqueue.cc (Workqueue::add_blocker): New function.
7170 * workqueue.h (class Workqueue): Declare add_blocker.
7171
f1ed28fb
ILT
7172 * fileread.cc (Input_file::open): Remove options parameter.
7173 Change all callers.
7174 (Input_file::open_binary): Likewise.
7175 * script.cc (read_input_script): Likewise.
7176 * readsyms.h (class Read_symbols): Remove options_ field. Remove
7177 options parameter from constructor. Change all callers.
7178 (class Read_script): Likewise.
7179 * fileread.h (class Input_file): Update declarations.
7180 * script.h (read_input_script): Update declaration.
7181
34dd024a
NC
71822009-03-10 Nick Clifton <nickc@redhat.com>
7183
7184 * po/es.po: New Spanish translation.
7185
6d71b17c
CC
71862009-03-06 Cary Coutant <ccoutant@google.com>
7187
7188 * options.cc (parse_short_option): Keep dash_z from registering itself.
7189
031cdbed
ILT
71902009-03-03 Ian Lance Taylor <iant@google.com>
7191
7192 PR 9918
7193 * target-reloc.h (relocate_section): Pass output_section to
7194 relocate.
7195 * i386.cc (Target_i386::should_apply_static_reloc): Add
7196 output_section parameter. Change all callers.
7197 (Target_i386::Relocate::relocate): Add output_section parameter.
7198 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
7199 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
7200 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
7201 * testsuite/two_file_shared.sh: New script.
7202 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
7203 (check_DATA): Add two_file_shared.dbg.
7204 (two_file_shared.dbg): New target.
7205 * testsuite/Makefile.in: Rebuild.
7206
15d5fa16
ILT
72072009-03-01 Ian Lance Taylor <iant@google.com>
7208
7209 * configure.ac: Check for byteswap.h.
7210 * configure: Rebuild.
7211 * config.in: Rebuild.
7212
8a4c0b0d
ILT
72132009-03-01 Mikolaj Zalewski <mikolajz@google.com>
7214
7215 * layout.cc (Layout::find_or_add_kept_section): New function.
7216 (Layout::add_comdat): Removed.
7217 * layout.h (struct Kept_section): Move out of class Layout.
7218 Remove trailing underscores from field names. Add group_sections
7219 field. Rename group_ field to is_group. Change all uses.
7220 (class Layout): Declare find_or_add_kept_section, not add_comdat.
7221 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
7222 comdat_groups_ field.
7223 (Sized_relobj::include_section_group): Use
7224 find_or_add_kept_section and Kept_section::group_sections.
7225 (Sized_relobj::include_linkonce_section): Likewise.
7226 * object.cc (class Sized_relobj): Don't define Comdat_group or
7227 Comdat_group_table. Remove find_comdat_group and
7228 add_comdat_group. Remove comdat_groups_ field.
7229 * plugin.cc (include_comdat_group): Use
7230 Layout::find_or_add_kept_section.
7231
b4ecf66b
ILT
72322009-02-28 Ian Lance Taylor <iant@google.com>
7233
14359ca0
ILT
7234 * README: --gc-sections and map files are now supported. Document
7235 some build requirements.
7236
b4ecf66b
ILT
7237 PR 6992
7238 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
7239 relocatable link set the value of the section symbol to zero.
7240 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
7241 relocatable link don't include the section address in the local
7242 symbol value.
7243
0602e05a
ILT
72442009-02-27 Ian Lance Taylor <iant@google.com>
7245
fd9d194f
ILT
7246 PR 6811
7247 * options.h (class Search_directory): Add is_system_directory.
7248 (class General_options): Declare is_in_system_directory.
7249 * options.cc (get_relative_sysroot): Make static.
7250 (get_default_sysroot): Make static.
7251 (General_optoins::is_in_system_directory): New function.
7252 * fileread.cc (Input_file::is_in_system_directory): New function.
7253 * fileread.h (class Input_file): Declare is_in_system_directory.
7254 * object.h (class Object): Add is_in_system_directory.
7255 (class Input_objects): Remove system_library_directory_ field.
7256 * object.cc (Input_objects::add_object): Don't set
7257 system_library_directory_.
7258 (input_objects::found_in_system_library_directory): Remove.
7259 * symtab.cc (Symbol_table::write_globals): Remove input_objects
7260 parameter. Change all callers.
7261 (Symbol_table::sized_write_globals): Likewise.
7262 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
7263 Call Object::is_in_system_directory.
7264 * symtab.h (class Symbol_table): Update declarations.
7265
61edd21f
ILT
7266 PR 5990
7267 * descriptors.h (Open_descriptor): Add is_on_stack field.
7268 * descriptors.cc (Descriptors::open): If the descriptor is on the
7269 top of the stack, remove it. Initialize is_on_stack field.
7270 (Descriptors::release): Only add pod to stack if it is not on the
7271 stack already.
7272 (Descriptors::close_some_descriptor): Clear stack_next and
7273 is_on_stack fields.
7274
e29e076a
ILT
7275 PR 7091
7276 * output.cc (Output_section::find_starting_output_address): Rename
7277 from starting_output_address; add PADDR parameter; change return
7278 type.
7279 * output.h (class Output_section): Declare
7280 find_starting_output_address instead of starting_output_address.
7281 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
7282 section symbol for which we can't find a merge section.
7283
0602e05a
ILT
7284 PR 9836
7285 * symtab.cc (Symbol_table::add_from_object): If the visibility is
7286 hidden or internal, force the symbol to be local.
7287 * resolve.cc (Symbol::override_visibility): Define.
7288 (Symbol::override_base): Use override_visibility.
7289 (Symbol_table::resolve): Likewise.
7290 (Symbol::override_base_with_special): Likewise.
7291 (Symbol_table::override_with_special): If the visibility is hidden
7292 or internal, force the symbol to be local.
7293 * symtab.h (class Symbol): Add set_visibility and
7294 override_visibility.
7295 * testsuite/ver_test_1.sh: New file.
7296 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
7297 (check_DATA): Add ver_test_1.syms.
7298 (ver_test_1.syms): New target.
7299 * testsuite/Makefile.in: Rebuild.
7300
401a9a73
CC
73012009-02-25 Cary Coutant <ccoutant@google.com>
7302
7303 * layout.cc (Layout::choose_output_section): Don't rename sections
7304 when using a linker script that has a SECTIONS clause.
7305 * Makefile.in: Regenerate.
7306
7307 * testsuite/Makefile.am (script_test_5.sh): New test case.
7308 * testsuite/Makefile.in: Regenerate.
7309 * testsuite/script_test_5.cc: New file.
7310 * testsuite/script_test_5.sh: New file.
7311 * testsuite/script_test_5.t: New file.
7312
f488e4b0
CC
73132009-02-13 Rafael Avila de Espindola <espindola@google.com>
7314
7315 * archive.cc (Archive::include_member): Update calls to add_symbols.
7316 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
7317 the Layout argument.
7318 * dynobj.h (do_add_symbols): Add the Layout argument.
7319 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
7320 Layout argument.
7321 * object.h (Object::add_symbols): Add the Layout argument.
7322 (Object::do_add_symbols): Add the Layout argument.
7323 (Sized_relobj::do_add_symbols): Add the Layout argument.
7324 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
7325 Unify the two versions.
7326 (Add_plugin_symbols): Remove.
7327 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
7328 (Sized_pluginobj::do_add_symbols): Unify the two versions.
7329 (Add_plugin_symbols): Remove.
7330 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
7331 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
7332 (Add_symbols::run): Make it work with Pulginobj.
7333
89dd1680
ILT
73342009-02-06 Ian Lance Taylor <iant@google.com>
7335
7336 * object.cc (Sized_relobj::do_layout): Make info message start
7337 with lower case letter.
7338
266d0a74
ILT
73392009-02-06 Mikolaj Zalewski <mikolajz@google.com>
7340
602b464e
ILT
7341 * binary.cc: Fix file comment.
7342
266d0a74
ILT
7343 * options.h (enum Incremental_disposition): Define.
7344 (class General_options): Add new options: --incremental,
7345 --incremental_changed, --incremental_unchanged,
7346 --incremental_unknown. Add incremental_disposition_ and
7347 implicit_incremental_ fields.
7348 (General_options::incremental_disposition): New function.
7349 (class Position_dependent_options): Add incremental_disposition
7350 option.
7351 (Position_dependent_options::copy_from_options): Set incremental
7352 dispositions.
7353 * options.cc (General_options::parse_incremental_changed): New
7354 function.
7355 (General_options::parse_incremental_unchanged): New function.
7356 (General_options::parse_incremental_unknown): New function.
7357 (General_options::General_options): Initialize new fields
7358 incremental_disposition_ and implicit_incremental_.
7359 (General_options::finalize): Check for uasge of --incremental-*
7360 without --incremental.
7361
f073bbf7
CD
73622009-02-06 Chris Demetriou <cgd@google.com>
7363
7364 * gold.h (gold_undefined_symbol): Change to take only a Symbol
7365 pointer and to report location as the file name associated with
7366 the symbol.
7367 (gold_undefined_symbol_at_location): New function to replace the
7368 old gold_undefined_symbol functionality.
7369 * target-reloc.h (relocate_section): Update to use
7370 gold_undefined_symbol_at_location.
7371 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
7372 Call gold_undefined_symbol function rather than gold_error.
7373 * errors.h (Errors::undefined_symbol): Take location as a
7374 string, rather than calculating it from a relocation.
7375 * errors.cc (Errors::fatal): Print "fatal error:" before the
7376 formatted message.
7377 (Errors::error, Errors::error_at_location): Print "error: "
7378 before the formatted message.
7379 (Errors::undefined_symbol): Take location as a string, rather
7380 than calculating it from a relocation.
7381 (gold_undefined_symbol_at_location): New function akin to
7382 old gold_undefined_symbol, calculates location from relocation.
7383 (gold_undefined_symbol): Change to take only a Symbol pointer
7384 and to report location as the file name associated with the symbol.
7385 * testsuite/debug_msg.sh: Update for changed error messages.
7386 * testsuite/undef_symbol.sh: Likewise.
7387
8e94a90c
ILT
73882009-02-04 Duncan Sands <baldrick@free.fr>
7389
7390 PR 9812
7391 * reduced_debug_output.h
7392 (Output_reduced_debug_abbrev_section::failed): Use format for
7393 gold_warning.
7394 (Output_reduced_debug_info_section::faild): Likewise.
7395
88a0e15b
ILT
73962009-01-31 Mikolaj Zalewski <mikolajz@google.com>
7397
7398 * script.cc (Lazy_demangler): New class.
7399 (Version_script_info::get_symbol_version_helper): Demangle a
7400 symbol only once.
7401
5efc7cd2
CC
74022009-01-29 Cary Coutant <ccoutant@google.com>
7403
7404 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
7405 to __tls_get_addr.
7406 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
7407
e0ebcf42
ILT
74082009-01-28 Ian Lance Taylor <iant@google.com>
7409
5efc7cd2 7410 * version.cc (version_string): Bump to 1.9.
75fe7426 7411
e0ebcf42
ILT
7412 * gold.h: Include <cstring> and <stdint.h>.
7413 * version.cc: Include <cstdio>.
7414 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
7415 warning.
7416 * reduced_debug_output.cc (insert_into_vector): Rename from
7417 Insert_into_vector; change all callers. Use Swap_unaligned to
7418 avoid aliasing issue; remove union since it is unnecessary.
7419
8e2813be 74202009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
7421
7422 * Makefile.am (CCFILES): Add gc.cc.
7423 (HFILES): Add gc.h.
7424 * Makefile.in: Regenerate.
7425 * gold.cc (Gc_runner): New class.
7426 (queue_initial_tasks): Call garbage collection related tasks
7427 when corresponding options are invoked.
7428 (queue_middle_gc_tasks): New function.
7429 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
7430 processed early before laying out sections during garbage collection.
7431 * gold.h (queue_middle_gc_tasks): New function.
7432 (is_prefix_of): Move from "layout.cc".
7433 * i386.cc (Target_i386::gc_process_relocs): New function.
7434 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
7435 * main.cc (main): Create object of class "Garbage_collection".
7436 * object.cc (Relobj::copy_symbols_data): New function.
7437 (Relobj::is_section_name_included): New function.
e1df38aa
NC
7438 (Sized_relobj::do_layout): Allow this function to be called twice
7439 during garbage collection and defer layout of section during the
6d03d481
ST
7440 first call.
7441 * object.h (Relobj::get_symbols_data): New function.
7442 (Relobj::is_section_name_included): New function.
7443 (Relobj::copy_symbols_data): New function.
7444 (Relobj::set_symbols_data): New function.
7445 (Relobj::get_relocs_data): New function.
7446 (Relobj::set_relocs_data): New function.
7447 (Relobj::is_output_section_offset_invalid): New pure virtual function.
7448 (Relobj::gc_process_relocs): New function.
7449 (Relobj::do_gc_process_relocs): New pure virtual function.
7450 (Relobj::sd_): New data member.
7451 (Sized_relobj::is_output_section_offset_invalid): New function.
7452 (Sized_relobj::do_gc_process_relocs): New function.
7453 * options.h (General_options::gc_sections): Modify to not be a no-op.
7454 (General_options::print_gc_sections): New option.
7455 * plugin.cc (Plugin_finish::run): Remove function call to
7456 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
7457 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
7458 * reloc.cc (Read_relocs::run): Add task to process relocs and
7459 determine unreferenced sections when doing garbage collection.
7460 (Gc_process_relocs): New class.
7461 (Sized_relobj::do_gc_process_relocs): New function.
7462 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
7463 sections that are garbage collected.
7464 * reloc.h (Gc_process_relocs): New class.
7465 * sparc.cc (Target_sparc::gc_process_relocs): New function.
7466 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
7467 symbols whose corresponding sections are garbage collected.
7468 (Symbol_table::Symbol_table): Add new parameter for the garbage
7469 collection object.
7470 (Symbol_table::gc_mark_undef_symbols): New function.
7471 (Symbol_table::gc_mark_symbol_for_shlib): New function.
7472 (Symbol_table::gc_mark_dyn_syms): New function.
7473 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
7474 as garbage.
7475 (Symbol_table::add_from_object): Likewise.
7476 (Symbol_table::add_from_relobj): When building shared objects, do not
7477 treat externally visible symbols as garbage.
7478 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
7479 table information for static and relocatable links.
7480 * symtab.h (Symbol_table::set_gc): New function.
7481 (Symbol_table::gc): New function.
7482 (Symbol_table::gc_mark_undef_symbols): New function.
7483 (Symbol_table::gc_mark_symbol_for_shlib): New function.
7484 (Symbol_table::gc_mark_dyn_syms): New function.
7485 (Symbol_table::gc_): New data member.
e1df38aa 7486 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
7487 function.
7488 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
7489 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
7490
3b293544
CF
74912009-01-20 Chris Faylor <me.sourceware@sourceware.org>
7492
7493 * options.h (General_options::gc_sections): Define as a no-op for now.
7494 (General_options::no_keep_memory): Ditto.
7495 (General_options::Bshareable): Define.
7496 * options.cc (General_options::finalize): Honor -Bshareable.
7497
83d22aa8
AS
74982009-01-20 Andreas Schwab <schwab@suse.de>
7499
7500 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
7501 read the value in the contents, since we don't use it. Use the
7502 template endianness when writing.
7503 (Relocate::relocate): Use it for R_PPC_REL16_HA.
7504
cd536b21
AS
75052009-01-19 Andreas Schwab <schwab@suse.de>
7506
7507 * configure.tgt (powerpc64-*): Fix targ_obj.
7508
99e9a495
ILT
75092009-01-15 Ian Lance Taylor <iant@google.com>
7510
7511 * object.cc (Sized_relobj::write_local_symbols): Don't write out
7512 local symbols when stripping all symbols.
7513
bbbfea06
CC
75142009-01-14 Cary Coutant <ccoutant@google.com>
7515
99e9a495 7516 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 7517
0f7c0701
CC
75182009-01-14 Cary Coutant <ccoutant@google.com>
7519
7520 * archive.cc (Archive::get_elf_object_for_member): Remove call
7521 to File_read::claim_for_plugin.
7522 * descriptors.cc (Descriptors::open): Remove reference to
7523 is_claimed.
7524 (Descriptors::claim_for_plugin): Remove.
7525 * descriptors.h (Descriptors::claim_for_plugin): Remove.
7526 (Descriptors::is_claimed): Remove.
7527 (claim_descriptor_for_plugin): Remove.
7528 * fileread.cc (File_read::claim_for_plugin): Remove.
7529 * fileread.h (File_read::claim_for_plugin): Remove.
7530 (File_read::descriptor): Reopen descriptor if necessary.
7531 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
7532 (Plugin_manager::all_symbols_read): Add task parameter. Change
7533 all callers.
7534 (Plugin_manager::get_input_file): New function.
7535 (Plugin_manager::release_input_file): New function.
7536 (Pluginobj::Pluginobj): Add filesize parameter and initialize
7537 corresponding data member.
7538 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
7539 and pass to base constructor. Change all callers.
7540 (get_input_file, release_input_file): New functions.
7541 (make_sized_plugin_object): Add filesize parameter. Change all callers.
7542 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
7543 (Plugin_manager::all_symbols_read): Add task parameter.
7544 (Plugin_manager::get_input_file): New function.
7545 (Plugin_manager::release_input_file): New function.
7546 (Plugin_manager::task_): New data member.
7547 (Pluginobj::Pluginobj): Add filesize parameter.
7548 (Pluginobj::filename): New function.
7549 (Pluginobj::descriptor): New function.
7550 (Pluginobj::filesize): New function.
7551 (Pluginobj::filesize_): New data member.
7552 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
7553 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
7554 File_read::claim_for_plugin; use Object::unlock to unlock the file.
7555
7556 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
7557 with archive libraries.
7558 * testsuite/Makefile.in: Regenerate.
7559 * testsuite/plugin_test.c (struct sym_info): New type.
7560 (get_input_file, release_input_file): New static variables.
7561 (onload): Capture new transfer vector entries.
7562 (claim_file_hook): Stop reading at end of file according to filesize.
7563 Factor out parsing of readelf output into separate function.
7564 (all_symbols_read_hook): Exercise get_input_file and release_input_file
7565 APIs and get the source file name from the symbol table. Convert
7566 source file name to corresponding object file name. Print info
7567 message when adding new input files.
7568 (parse_readelf_line): New function.
7569 * testsuite/plugin_test_1.sh: Add checks for new info messages.
7570 * testsuite/plugin_test_2.sh: Likewise.
7571 * testsuite/plugin_test_3.sh: Likewise.
7572 * testsuite/plugin_test_4.sh: New test case.
7573
62a6d109
ILT
75742009-01-07 Ian Lance Taylor <iant@google.com>
7575
7576 * version.cc (version_string): Bump to 1.8.
7577
483620e8
CC
75782008-12-23 Cary Coutant <ccoutant@google.com>
7579
7580 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
7581 * plugin.cc (Plugin_manager::finish): Rename as
7582 layout_deferred_objects. Move cleanup to separate function.
7583 (Plugin_manager::cleanup): New function.
7584 (Plugin_finish::run): Call layout_deferred_objects and cleanup
7585 separately.
7586 * plugin.h (Plugin_manager::finish): Rename as
7587 layout_deferred_objects.
7588 (Plugin_manager::cleanup): New function.
7589 (Plugin_manager::cleanup_done): New field.
7590
d66a9eb3
CC
75912008-12-23 Cary Coutant <ccoutant@google.com>
7592
7593 * plugin.cc (is_visible_from_outside): New function.
7594 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
7595 so we don't return "IR only" status for exported symbols or -r links.
7596
7597 * testsuite/Makefile.am (plugin_test_3): New test case.
7598 * testsuite/Makefile.in: Regenerate.
7599 * testsuite/plugin_test_3.sh: New file.
7600
5995b570
CC
76012008-12-22 Cary Coutant <ccoutant@google.com>
7602
7603 * object.cc (Sized_relobj::layout_section): New function.
7604 (Sized_relobj::do_layout): Defer layout of input sections until after
7605 plugin has provided replacement files.
7606 (Sized_relobj::do_layout_deferred_sections): New function.
7607 * object.h (Relobj::set_section_offset): Remove virtual keyword.
7608 (Relobj::layout_deferred_sections): New function.
7609 (Relobj::do_layout_deferred_sections): New function.
7610 (Sized_relobj::do_layout_deferred_sections): New function.
7611 (Sized_relobj::layout_section): New function.
7612 (Sized_relobj::Deferred_layout): New structure.
7613 (Sized_relobj::deferred_layout_): New field.
7614 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
7615 Change all callers. Layout deferred sections.
7616 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
7617 references.
7618 (Plugin_hook::run): Move code from do_plugin_hook inline.
7619 (Plugin_hook::do_plugin_hook): Remove.
7620 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
7621 (Plugin_manager::finish): Renamed, was cleanup.
7622 (Plugin_manager::should_defer_layout): New function.
7623 (Plugin_manager::add_deferred_layout_object): New function.
7624 (Plugin_manager::Deferred_layout_list): New type.
7625 (Plugin_manager::deferred_layout_objects_): New field.
7626 (Plugin_hook::do_plugin_hook): Remove.
7627
ee769c88
ILT
76282008-12-17 Ian Lance Taylor <iant@google.com>
7629
7630 * options.h (class General_options): Add --no case for
7631 --export-dynamic.
7632
abc8dcba
CC
76332008-12-16 Cary Coutant <ccoutant@google.com>
7634
7635 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
7636 vector.
7637 (Plugin_manager::claim_file): Create plugin object even if
7638 plugin did not call the add_symbols callback.
7639 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
7640 asking for more symbols than were added.
7641 * testsuite/Makefile.am (plugin_test_1): Add test case with
7642 no global symbols.
7643 (empty.syms): New target.
7644 * testsuite/Makefile.in: Regenerate.
7645 * testsuite/plugin_test.c (claim_file_hook): Add new debug
7646 message. Don't call add_symbols if no globals.
7647 (all_symbols_read_hook): Don't provide replacement for empty
7648 claimed file.
7649
b0074644
ILT
76502008-12-12 Ian Lance Taylor <iant@google.com>
7651
68943102
ILT
7652 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
7653 r_type == 0 for a local symbol with r_sym == 0.
7654 (scan_relocatable_relocs): Pass r_sym to
7655 local_non_section_strategy.
7656 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
7657 r_sym parameter.
7658
b0074644
ILT
7659 * configure.ac: Update test for TLS descriptors: they are
7660 supported as of glibc 2.9.
7661 * configure: Rebuild.
7662
c2508178
ILT
76632008-12-11 Ian Lance Taylor <iant@google.com>
7664
7665 PR 7091
7666 * target-reloc.h (Default_scan_relocatable_relocs): For each
7667 function, map r_type == 0 to RELOC_DISCARD.
7668
2756a258
CC
76692008-12-10 Cary Coutant <ccoutant@google.com>
7670
7671 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
7672 object to override a kept COMDAT group from a plugin object.
7673
bb6f53d3
ILT
76742008-12-09 Ian Lance Taylor <iant@google.com>
7675
fbc558e1
ILT
7676 PR 7088
7677 * yyscript.y (file_cmd): Handle INPUT.
7678
bb6f53d3
ILT
7679 * testsuite/initpri1.c: Change all declarations to be full
7680 prototypes by adding void, to avoid compiler warnings.
7681
4674ecfc
CC
76822008-12-05 Rafael Avila de Espindola <espindola@google.com>
7683
7684 * options.cc (General_options::parse_plugin_opt): New.
7685 (General_options::add_plugin): The argument now is just the filename.
7686 (General_options::add_plugin_option): New.
7687 * options.h (plugin_opt): New.
7688 (add_plugin): Change argument name.
7689 (add_plugin_option): New.
7690 * plugin.cc (Plugin::load): Don't parse the plugin option.
7691 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
7692 (Plugin::add_option): New.
7693 (Plugin::args_): Change type.
7694 (Plugin::filename_): New.
7695 (Plugin_manager::add_plugin_option): New.
7696 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
7697 * testsuite/Makefile.in: Regenerate.
7698
fd06b4aa
CC
76992008-12-05 Cary Coutant <ccoutant@google.com>
7700
7701 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
7702 Handle --strip-lto-sections option.
7703 * options.h (strip_lto_sections): New option.
7704
6c52134c
CC
77052008-12-01 Cary Coutant <ccoutant@google.com>
7706
7707 * plugin.cc (ld_plugin_message): Change format parameter to const.
7708 Fix mismatch between new[] and delete.
7709
a45248e0
CC
77102008-11-14 Cary Coutant <ccoutant@google.com>
7711
7712 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
7713 instead of -1U.
7714
c82fbeee
CS
77152008-11-05 Craig Silverstein <csilvers@google.com>
7716
7717 * options.cc (General_options::parse_dynamic_list): New function.
7718 * options.h (General_options): New flags dynamic_list,
7719 dynamic_list_data, dynamic_list_cpp_new, and
7720 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
7721 (General_options::in_dynamic_list): New function.
7722 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
7723 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
7724 (Lex::can_continue_name): Likewise.
7725 (yylex): Likewise.
7726 (read_script_file): New parameter script_options.
7727 (read_dynamic_list): New function.
7728 (Script_options::define_dynamic_list): New function.
7729 (dynamic_list_keyword_parsecodes): New variable.
7730 (dynamic_list_keywords): New variable.
7731 * script.h (Script_options::define_dynamic_list): New function
7732 prototype.
7733 (read_dynamic_list): New function prototype.
7734 * symtab.cc (strprefix): New macro.
7735 (Symbol::should_add_dynsym_entry): Support dynamic_list,
7736 dynamic_list_data, dynamic_list_cpp_new, and
7737 dynamic_list_cpp_typeinfo.
7738 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
7739 (dynamic_list_expr): New rule.
7740 (dynamic_list_nodes): Likewise.
7741 (dynamic_list_node): Likewise.
7742 * testsuite/Makefile.am (dynamic_list): New test.
7743 * testsuite/Makefile.in: Regenerated.
7744 * testsuite/dynamic_list.t: New file.
7745 * testsuite/dynamic_list.sh: New file.
7746
e0bb29a5
CS
77472008-11-05 Craig Silverstein <csilvers@google.com>
7748
7749 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
7750 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
7751 (t11_last): Likewise.
7752 * testsuite/ver_test_6.c (main): Likewise.
7753
4e1e25e0
CC
77542008-10-07 Cary Coutant <ccoutant@google.com>
7755
7756 * options.c (General_options::finalize): Add check for -static and
7757 -shared.
7758 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
7759 is not empty.
7760
92f03fcb
CC
77612008-10-02 Cary Coutant <ccoutant@google.com>
7762
7763 * plugin.cc (make_sized_plugin_object): Fix conditional
7764 compilation to work when not all targets are enabled.
7765
fbd8a257
CC
77662008-09-29 Cary Coutant <ccoutant@google.com>
7767
7768 * archive.cc (Archive::get_file_and_offset): Use filename instead
7769 of name to get library path.
7770 (Archive::include_member): Unlock external member of a thin archive.
7771
7772 * testsuite/Makefile.am (TEST_AR): New variable.
7773 (thin_archive_test_1): New test.
7774 (thin_archive_test_2): New test.
81636b3f
CC
7775 * testsuite/Makefile.in: Regenerate.
7776 * testsuite/thin_archive_main.cc: New file.
7777 * testsuite/thin_archive_test_1.cc: New file.
7778 * testsuite/thin_archive_test_2.cc: New file.
7779 * testsuite/thin_archive_test_3.cc: New file.
7780 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 7781
eff45813
CC
77822008-09-29 Cary Coutant <ccoutant@google.com>
7783
7784 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
7785 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
7786 instead of -1U.
7787 (Sized_relobj::do_finalize_local_symbols): Likewise.
7788 (Sized_relobj::map_to_kept_section): Likewise.
7789 * object.h (Sized_relobj::invalid_address): New constant.
7790 (Sized_relobj::do_output_section_offset): Check for invalid_address
7791 and return -1ULL.
7792 * output.cc (Output_reloc::local_section_offset): Use constant
7793 invalid_address instead of -1U.
7794 (Output_reloc::get_address): Likewise.
7795 (Output_section::output_address): Change -1U to -1ULL.
7796 * output.h (Output_reloc::invalid_address): New constant.
7797 * reloc.cc (Sized_relobj::write_sections): Use constant
7798 invalid_address instead of -1U.
7799 (Sized_relobj::relocate_sections): Likewise.
7800 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
7801 values for merge sections.
7802 * target-reloc.h (relocate_for_relocatable): Use constant
7803 invalid_address instead of -1U.
7804
89fc3421
CC
78052008-09-19 Cary Coutant <ccoutant@google.com>
7806
7807 Add plugin functionality for link-time optimization (LTO).
7808 * configure.ac (plugins): Add --enable-plugins option.
7809 * configure: Regenerate.
7810 * config.in: Regenerate.
7811 * Makefile.am (LIBDL): New variable.
7812 (CCFILES): Add plugin.cc.
7813 (HFILES): Add plugin.h.
7814 (ldadd_var): Add LIBDL.
7815 * Makefile.in: Regenerate.
7816
7817 * archive.cc: Include "plugin.h".
7818 (Archive::setup): Don't preread archive symbols when using a plugin.
7819 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
7820 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
7821 files.
7822 (Archive::include_member): Add symbols from plugin objects.
7823 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
7824 * descriptors.cc (Descriptors::open): Check for file descriptors
7825 abandoned by plugins.
7826 (Descriptors::claim_for_plugin): New function.
7827 * descriptors.h (Descriptors::claim_for_plugin): New function.
7828 (Open_descriptor::is_claimed): New field.
7829 (claim_descriptor_for_plugin): New function.
7830 * fileread.cc (File_read::claim_for_plugin): New function.
7831 * fileread.h (File_read::claim_for_plugin): New function.
7832 (File_read::descriptor): New function.
7833 * gold.cc: Include "plugin.h".
7834 (queue_initial_tasks): Add task to call plugin hooks for generating
7835 new object files.
7836 * main.cc: Include "plugin.h".
7837 (main): Load plugin libraries.
7838 * object.h (Pluginobj): Declare.
7839 (Object::pluginobj): New function.
7840 (Object::do_pluginobj): New function.
7841 (Object::set_target): New function.
7842 * options.cc: Include "plugin.h".
7843 (General_options::parse_plugin): New function.
7844 (General_options::General_options): Initialize plugins_ field.
7845 (General_options::add_plugin): New function.
7846 * options.h (Plugin_manager): Declare.
7847 (General_options): Add --plugin option.
7848 (General_options::has_plugins): New function.
7849 (General_options::plugins): New function.
7850 (General_options::add_plugin): New function.
7851 (General_options::plugins_): New field.
7852 * plugin.cc: New file.
7853 * plugin.h: New file.
7854 * readsyms.cc: Include "plugin.h".
7855 (Read_symbols::do_read_symbols): Check for archive before checking
7856 for ELF file. Call plugin hooks to claim files.
7857 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
7858 from a real object file; force override when processing replacement
7859 files.
7860 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
7861 (Symbol::init_base_object): Likewise.
7862 (Symbol::init_base_output_data): Likewise.
7863 (Symbol::init_base_output_segment): Likewise.
7864 (Symbol::init_base_constant): Likewise.
7865 (Symbol::init_base_undefined): Likewise.
7866 (Symbol::output_section): Assert that object is not a plugin.
7867 (Symbol_table::add_from_pluginobj): New function.
7868 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
7869 undefined.
7870 (Symbol_table::sized_write_globals): Likewise.
7871 (Symbol_table::add_from_pluginobj): Instantiate template.
7872 * symtab.h (Sized_pluginobj): Declare.
7873 (Symbol::in_real_elf): New function.
7874 (Symbol::set_in_real_elf): New function.
7875 (Symbol::in_real_elf_): New field.
7876 (Symbol_table::add_from_pluginobj): New function.
7877
7878 * testsuite/Makefile.am (AM_CFLAGS): New variable.
7879 (LIBDL): New variable.
7880 (LDADD): Add LIBDL.
7881 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
7882 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
7883 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
7884 (MOSTLYCLEANFILES): Likewise.
7885 * testsuite/Makefile.in: Regenerate.
7886 * testsuite/plugin_test.c: New file.
7887 * testsuite/plugin_test_1.sh: New file.
7888 * testsuite/plugin_test_2.sh: New file.
7889
de31bda5
ILT
78902008-09-16 Ian Lance Taylor <iant@google.com>
7891
9c2d0ef9
ILT
7892 * target-reloc.h (relocate_section): Check whether a symbol is
7893 defined by the ABI before reporting an undefined symbol error.
7894 * target.h (Target::is_defined_by_abi): Make parameter const.
7895 (Target::do_is_defined_by_abi): Likewise.
7896 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
7897 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
7898 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
7899 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
7900 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
7901 * testsuite/Makefile.in: Rebuild.
7902
de31bda5
ILT
7903 * fileread.cc (make_view): Add casts to avoid warning.
7904
9fa33bee
AO
79052008-09-16 Alexandre Oliva <aoliva@redhat.com>
7906
7907 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
7908 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
7909
183fd0e3
AO
79102008-09-16 Alexandre Oliva <aoliva@redhat.com>
7911
7912 * options.h (General_options::output_is_executable): New.
7913 (General_options::output_is_pie): New.
7914 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
7915 for shared libraries.
7916 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
7917
7be8330a
CD
79182008-09-11 Chris Demetriou <cgd@google.com>
7919
7920 * options.h (origin): New -z option.
7921 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
7922 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
7923 in DT_FLAGS_1.
7924
a9caad02
CC
79252008-09-05 Cary Coutant <ccoutant@google.com>
7926
7927 * fileread.cc (File_read::make_view): Add check for attempt to map
7928 beyond end of file.
7929
ae6dce4d
CC
79302008-09-05 Cary Coutant <ccoutant@google.com>
7931
7932 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
7933 explicit instantiations.
7934
d7ab2a47
KVH
79352008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
7936
7937 PR gold/6858
7938 * options.cc (General_options::finalize): Allow undefined symbols
7939 in shlibs if linking -shared.
7940
7941 PR gold/6859
7942 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
7943 symbols as not needing a dynsym entry.
7944
1e52a9c1
CS
79452008-08-20 Craig Silverstein <csilvers@google.com>
7946
7947 * fileread.cc (File_read::open): Do not lock the file unless it
7948 was successfully opened.
7949
d85c80a3
CC
79502008-08-14 Cary Coutant <ccoutant@google.com>
7951
7952 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
7953 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
7954 * testsuite/tls_test.cc (struct int128): 128-bit struct
7955 for testing TLS relocs with non-zero addend.
7956 (v12): New TLS variable.
7957 (t12): New test.
7958 (t_last): Add check for v12.
7959 * testsuite/tls_test.h (t12): New function.
7960 * testsuite/tls_test_main.cc (thread_routine): Call new test.
7961
2d924fd9
ILT
79622008-08-13 Ian Lance Taylor <iant@google.com>
7963
7964 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
7965 set tls_segment_ or relro_segment_.
7966 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
7967 when appropriate.
7968 * output.h (Output_section::clear_is_relro): New function.
7969 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
7970 sections specially even when output_data_ is empty.
7971 (Output_segment::maximum_alignment): When first section is relro,
7972 only force alignment for PT_LOAD segments.
7973 * script.cc (script_data_segment_align): New function.
7974 (script_data_segment_relro_end): New function.
7975 * script-c.h (script_data_segment_align): Declare.
7976 (script_data_segment_relro_end): Declare.
7977 * script-sections.h (class Script_sections): Declare
7978 data_segment_align and data_segment_relro_end. Add fields
7979 segment_align_index_ and saw_relro_end_.
7980 * script-sections.cc (class Sections_element): Add set_is_relro
7981 virtual function. Add new bool* parameter to place_orphan_here.
7982 Add get_output_section virtual function.
7983 (class Output_section_definition): Add set_is_relro. Add new
7984 bool* parameter to place_orphan_here. Add get_output_section.
7985 Add is_relro_ field.
7986 (Output_section_definition::Output_section_definition): Initialize
7987 evaluated_address_, evaluated_load_address, evaluated_addralign_,
7988 and is_relro_ fields.
7989 (Output_section_definition::place_orphan_here): Add is_relro
7990 parameter.
7991 (Output_section_definition::set_section_addresses): Set relro for
7992 output section.
7993 (Output_section_definition::alternate_constraint): Likewise.
7994 (class Orphan_output_section): Add new bool* parameter to
7995 place_orphan_here. Add get_output_section.
7996 (Orphan_output_section::place_orphan_here): Add is_relro
7997 parameter.
7998 (Script_sections::Script_sections): Initialize
7999 data_segment_align_index_ and saw_relro_end_.
8000 (Script_sections::data_segment_align): New function.
8001 (Script_sections::data_segment_relro_end): New function.
8002 (Script_sections::place_orphan): Set or clear is_relro.
8003 (Script_sections::set_section_addresses): Force alignment of first
8004 TLS section.
8005 * yyscript.y (exp): Call script_data_segment_align and
8006 script_data_segment_relro_end.
8007 * testsuite/relro_script_test.t: New file.
8008 * testsuite/relro_test.cc (using_script): Declare.
8009 (t1, t2): Test using_script.
8010 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
8011 (relro_script_test_SOURCES): Define.
8012 (relro_script_test_DEPENDENCIES): Define.
8013 (relro_script_test_LDFLAGS): Define.
8014 (relro_script_test_LDADD): Define.
8015 (relro_script_test.so): New target.
8016 * testsuite/Makefile.in: Rebuild.
8017
f827c9a9
CC
80182008-08-06 Cary Coutant <ccoutant@google.com>
8019
8020 * archive.cc (Archive::total_archives, Archive::total_members)
8021 (Archive::total_members_loaded): New variables.
8022 (Archive::setup): Add parameter. Add option to preread
8023 archive symbols.
8024 (Archive::read_armap): Add counter.
8025 (Archive::get_file_and_offset): New function.
8026 (Archive::get_elf_object_for_member): New function.
8027 (Archive::read_all_symbols): New function.
8028 (Archive::read_symbols): New function.
8029 (Archive::add_symbols): Add counters.
8030 (Archive::include_all_members): Use armap to find members if it's
8031 already built.
8032 (Archive::include_member): Skip reading symbols if already read.
8033 Factored code into Archive::get_file_and_offset and
8034 Archive::get_elf_object_for_member. Changed call to
8035 Mapfile::report_include_archive_member.
8036 (Archive::print_stats): New function.
8037 * archive.h: Declare Object and Read_symbols_data classes.
8038 (Archive::Archive): Add initializers for new members.
8039 (Archive::setup): Add parameter.
8040 (Archive::print_stats): New function.
8041 (Archive::total_archives, Archive::total_members)
8042 (Archive::total_members_loaded): New variables.
8043 (Archive::get_file_and_offset): New function.
8044 (Archive::get_elf_object_for_member): New function.
8045 (Archive::read_all_symbols): New function.
8046 (Archive::read_symbols): New function.
8047 (Archive::Archive_member): New class.
8048 (Archive::members_): New member.
8049 (Archive::num_members_): New member.
8050 * main.cc: Include archive.h.
8051 (main): Call Archive::print_stats.
8052 * mapfile.cc (Mapfile::report_include_archive_member): Delete
8053 archive parameter; member_name is now the fully-decorated name.
8054 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
8055 * options.h: (General_options): Add --preread-archive-symbols option.
8056 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
8057 Archive::setup.
8058
de4c45bd
ILT
80592008-08-04 Ian Lance Taylor <iant@google.com>
8060
8061 * symtab.h (Symbol::use_plt_offset): New function.
8062 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
8063 * powerpc.cc (Relocate::relocate): Likewise.
8064 * sparc.cc (Relocate::relocate): Likewise.
8065 * x86_64.cc (Relocate::relocate): Likewise.
8066 * testsuite/weak_plt.sh: New test.
8067 * testsuite/weak_plt_main.cc: New test.
8068 * testsuite/weak_plt_shared.cc: New test.
8069 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
8070 (check_PROGRAMS): Add weak_plt.
8071 (check_DATA): Add weak_plt_shared.so.
8072 (weak_plt_main_pic.o, weak_plt): New targets.
8073 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
8074 * testsuite/Makefile.in: Rebuild.
8075
8076 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
8077 gcctestdir/ld.
8078 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
8079 * testsuite/Makefile.in: Rebuild.
8080
323ee3f4
AM
80812008-08-04 Alan Modra <amodra@bigpond.net.au>
8082
8083 * Makefile.am (POTFILES.in): Set LC_ALL=C.
8084 * Makefile.in: Regenerate.
8085 * po/POTFILES.in: Regenerate.
8086
7c07ecec
ILT
80872008-07-29 Ian Lance Taylor <iant@google.com>
8088
8089 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
8090 symbols before other symbols.
8091 * testsuite/script_test_2.cc (test_addr): Declare.
8092 (test_addr_alias): Declare.
8093 (main): Check that test_addr and test_addr_alias have the right
cd536b21 8094 values.
7c07ecec
ILT
8095 * testsuite/script_test_2.t: Define test_addr_alias and
8096 test_addr.
8097
5778530e
ILT
80982008-07-24 Ian Lance Taylor <iant@google.com>
8099
2a00e4fb
ILT
8100 PR 5990
8101 * descriptors.cc: New file.
8102 * descriptors.h: New file.
8103 * gold-threads.h (class Hold_optional_lock): New class.
8104 * fileread.cc: Include "descriptors.h".
8105 (File_read::~File_read): Release descriptor rather than closing
8106 it.
8107 (File_read::open) [file]: Call open_descriptor rather than open.
8108 Set is_descriptor_opened_.
8109 (File_read::open) [memory]: Assert that descriptor is not open.
8110 (File_read::reopen_descriptor): New function.
8111 (File_read::release): Release descriptor.
8112 (File_read::do_read): Make non-const. Reopen descriptor.
8113 (File_read::read): Make non-const.
8114 (File_read::make_view): Reopen descriptor.
8115 (File_read::do_readv): Likewise.
8116 * fileread.h (class File_read): Add is_descriptor_opened_ field.
8117 Update declarations.
8118 * layout.cc: Include "descriptors.h".
8119 (Layout::create_build_id): Use open_descriptor rather than open.
8120 * output.cc: Include "descriptors.h".
8121 (Output_file::open): Use open_descriptor rather than open.
8122 * archive.cc (Archive::const_iterator): Change Archive to be
8123 non-const.
8124 (Archive::begin, Archive::end): Make non-const.
8125 (Archive::count_members): Likewise.
8126 * archive.h (class Archive): Update declarations.
8127 * object.h (Object::read): Make non-const.
8128 * Makefile.am (CCFILES): Add descriptors.cc.
8129 (HFILES): Add descriptors.h.
8130 * Makefile.in: Rebuild.
8131
801647d1
ILT
8132 PR 6716
8133 * gold.h: Always include <clocale>. Add Solaris workarounds
8134 following code in binutils/sysdep.h.
8135
5edd166e
ILT
8136 PR 6048
8137 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
8138 this->eh_frame_hdr_ is NULL before using it.
8139
c89ad728
ILT
8140 * dynobj.cc (Versions::Versions): Update comment.
8141
aa86f06b
ILT
8142 * dynobj.cc (Versions::Versions): If there is an soname, use it as
8143 the base version name.
8144
5778530e
ILT
8145 * stringpool.cc (Stringpool_template::add_with_length): Set key to
8146 array size plus one.
8147 (Stringpool_template::set_string_offsets): Subtract one from key
8148 before using it as an array index.
8149 (Stringpool_template::get_offset_with_length): Likewise.
8150 (Stringpool_template::write_to_buffer): Likewise.
8151 * stringpool.h (Stringpool_template::get_offset_from_key):
8152 Likewise.
8153
057ead22
ILT
81542008-07-23 Ian Lance Taylor <iant@google.com>
8155
7f649c59
ILT
8156 PR 6658
8157 * object.h (Merged_symbol_value::value): Do our best to handle a
8158 negative addend.
8159
057ead22
ILT
8160 PR 6647
8161 * script.cc (Version_script_info::get_versions): Don't add empty
8162 version tag to return value.
8163 (Version_script_info::get_symbol_version_helper): Change return
8164 type to bool. Add pversion parameter. Change all callers.
8165 (script_register_vers_node): Don't require a non-NULL tag.
8166 * script.h (class Version_script_info): Update declarations.
8167 (Version_script_info::get_symbol_version): Change return type to
8168 bool. Add version parameter. Change all callers.
8169 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
8170 handling. Handle an empty version from a version script.
8171 (Symbol_table::define_special_symbol): Likewise.
8172 * testsuite/ver_test_10.script: New file.
8173 * testsuite/ver_test_10.sh: New file.
8174 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
8175 (check_DATA): Add ver_test_10.syms.
8176 (ver_test_10.syms, ver_test_10.so): New target.
8177 * testsuite/Makefile.in: Rebuild.
8178
58e54ac2
CD
81792008-07-23 Simon Baldwin <simonb@google.com>
8180
8181 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
8182 to zero for undefined symbols from dynamic libraries.
8183
95d14cd3
ILT
81842008-07-23 Ian Lance Taylor <iant@google.com>
8185
8186 * symtab.cc (Symbol_table::resolve): Remove version parameter.
8187 Change all callers.
8188 * symtab.h (class Symbol_table): Update declaration.
8189 * testsuite/ver_test_9.cc: New file.
8190 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
8191 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
8192 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
8193 (ver_test_9.so, ver_test_9.o): New targets.
8194 * testsuite/Makefile.in: Rebuild.
8195
92de84a6
ILT
81962008-07-22 Ian Lance Taylor <iant@google.com>
8197
34810851
ILT
8198 * options.h (class General_options): Define --check-sections.
8199 * layout.cc (Layout::set_segment_offsets): Handle
8200 --check-sections.
8201
af6156ef
ILT
8202 * options.h (class General_options): Define -n/--nmagic and
8203 -N/--omagic.
8204 * options.cc (General_options::finalize): For -n/--nmagic or
8205 -N/--omagic, set -static.
8206 * layout.cc (Layout::attach_allocated_section_to_segment): If
8207 -N/--omagic, don't put read-only and read-write sections in
8208 different segments.
8209 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
8210 finding a read-only segment.
8211 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
8212 don't set the minimum segment alignment to the common page size,
8213 and don't set the file offset to the address modulo the page size.
8214 * script-sections.cc (Script_sections::create_segments): If
8215 -n/--omagic, don't put read-only and read-write sections in
8216 different segments.
8217
92de84a6
ILT
8218 * cref.cc: New file.
8219 * cref.h: New file.
8220 * options.h (class General_options): Add --print-symbol-counts.
8221 * main.cc (main): Issue defined symbol report if requested.
8222 * archive.cc (Archive::interpret_header): Make into a const member
8223 function.
8224 (Archive::add_symbols): Call Input_objects::archive_start and
8225 archive_stop.
8226 (Archive::const_iterator): Define new class.
8227 (Archive::begin, Archive::end): New functions.
8228 (Archive::include_all_members): Rewrite to use iterator.
8229 (Archive::count_members): New function.
8230 * archive.h (class Archive): Update declarations.
8231 (Archive::filename): New function.
8232 * object.cc: Include "cref.h".
8233 (Sized_relobj::Sized_relobj): Initialize defined_count_.
8234 (Sized_relobj::do_get_global_symbol_counts): New function.
8235 (Input_objects::add_object): Add object to cross-referencer.
8236 (Input_objects::archive_start): New function.
8237 (Input_objects::archive_stop): New function.
8238 (Input_objects::print_symbol_counts): New function.
8239 * object.h: Declare Cref and Archive.
8240 (Object::get_global_symbol_counts): New function.
8241 (Object::do_get_global_symbol_counts): New pure virtual function.
8242 (class Sized_relobj): Add defined_count_ field. Update
8243 declarations.
8244 (class Input_objects): Add cref_ field. Update constructor.
8245 Update declarations.
8246 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
8247 defined_count_.
8248 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
8249 symbol counts.
8250 (Sized_dynobj::do_get_global_symbol_counts): New function.
8251 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
8252 defined_count_. Update declarations. Define Symbols typedef.
8253 * symtab.cc (Symbol_table::add_from_relobj): Add defined
8254 parameter. Change all callers.
8255 (Symbol_table::add_from_dynobj): Add sympointers and defined
8256 parameters. Change all callers.
8257 * symtab.h (class Symbol_table): Update declarations.
8258 * Makefile.am (CCFILES): Add cref.cc.
8259 (HFILES): Add cref.h.
8260 * Makefile.in: Rebuild.
8261
3f7c5e1d
CD
82622008-07-22 Simon Baldwin <simonb@google.com>
8263
8264 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
8265 to zero when writing undefined symbols.
8266
e0b64032
ILT
82672008-07-22 Ian Lance Taylor <iant@google.com>
8268
8269 * output.cc (Output_section::add_input_section): Don't try to
8270 merge empty merge sections.
8271
096b02cf
CS
82722008-07-21 Craig Silverstein <csilvers@google.com>
8273
8274 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
8275 Include symbol version in error message.
cd536b21 8276
1d1f116d
CD
82772008-07-20 Chris Demetriou <cgd@google.com>
8278
cd536b21 8279 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
8280 (RANDOM_SEED_CFLAGS): New substituted variable.
8281 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
8282 * configure: Rebuild.
8283 * Makefile.in: Likewise.
8284 * testsuite/Makefile.in: Likewise.
8285
a18f591e
ILT
82862008-07-18 Ian Lance Taylor <iant@google.com>
8287
8288 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
8289 where we see NAME/NULL and NAME/VERSION as separate symbols.
8290 * testsuite/ver_test_main.cc (main): Call t4.
8291 (t4, t4_2a): Define.
8292 * testsuite/ver_test_2.cc (t4_2): Define.
8293 * testsuite/ver_test_2.script: Put t4_2a in VER2.
8294 * testsuite/ver_test_4.cc (t4_2a): Define.
8295 * testsuite/ver_test_4.script: Put t4_2a in VER2.
8296 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
8297
c6e3f6ed
ILT
82982008-07-17 Ian Lance Taylor <iant@google.com>
8299
8300 * dynobj.cc (Versions::add_def): If we give an error about a
8301 missing version, go ahead and create the version anyhow.
8302
ef9beddf
ILT
83032008-07-10 Ian Lance Taylor <iant@google.com>
8304
8305 Handle output sections with more than 0x7fffffff bytes.
8306 * object.h (class Relobj): Change map_to_output_ to
8307 output_sections_, and just keep a section pointer. Change all
8308 uses. Move comdat group support to Sized_relobj.
8309 (Relobj::is_section_specially_mapped): Remove.
8310 (Relobj::output_section): Remove poff parameter. Change all
8311 callers.
8312 (Relobj::output_section_offset): New function.
8313 (Relobj::set_section_offset): Rewrite.
8314 (Relobj::map_to_output): Remove.
8315 (Relobj::output_sections): New function.
8316 (Relobj::do_output_section_offset): New pure virtual function.
8317 (Relobj::do_set_section_offset): Likewise.
8318 (class Sized_relobj): Add section_offsets_ field. Add comdat
8319 group support from Relobj. Update declarations.
8320 (Sized_relobj::get_output_section_offset): New function.
8321 (Sized_relobj::do_output_section_offset): New function.
8322 (Sized_relobj::do_set_section_offset): New function.
8323 * object.cc (Relobj::output_section_address): Remove.
8324 (Sized_relobj::Sized_relobj): Initialize new fields.
8325 (Sized_relobj::include_section_group): Cast find_kept_object to
8326 Sized_relobj.
8327 (Sized_relobj::include_linkonce_section): Likewise.
8328 (Sized_relobj::do_layout): Use separate arrays for output section
8329 and output offset.
8330 (Sized_relobj::do_count_local_symbols): Change map_to_output to
8331 output_sections.
8332 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
8333 output_sections and section_offsets.
8334 (Sized_relobj::write_local_symbols): Likewise.
8335 (map_to_kept_section): Compute output address directly.
8336 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
8337 output_sections and section_offsets.
8338 (Sized_relobj::write_sections): Likewise.
8339 (Sized_relobj::relocate_sections): Likewise.
8340 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
8341 * output.h (class Output_reloc): Update declarations. Change
8342 u2_.relobj to Sized_relobj*.
8343 (class Output_data_reloc): Change add functions to use
8344 Sized_relobj*.
8345 * output.cc (Output_reloc::Output_reloc): Change relobj to
8346 Sized_relobj*.
8347 (Output_reloc::local_section_offset): Change return type to
8348 Elf_Addr. Use get_output_section_offset.
8349 (Output_reloc::get_address): Likewise.
8350 (Output_section::is_input_address_mapped): Don't call
8351 is_section_specially_mapped.
8352 (Output_section::output_offset): Likewise.
8353 (Output_section::output_address): Likewise.
8354 (Output_section::starting_output_address): Likewise.
8355 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
8356 parameter to Sized_relobj*.
8357 (Copy_relocs::need_copy_reloc): Likewise.
8358 (Copy_relocs::save): Likewise.
8359 * copy-relocs.h (class Copy_relocs): Update declarations.
8360 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
8361 Sized_relobj*. Change relobj_ field to Sized_relobj*.
8362 * target-reloc.h (relocate_for_relocatable): Change
8363 offset_in_output_section type to Elf_Addr. Change code that uses
8364 it as well.
8365 * layout.cc (Layout::layout): Always set *off.
8366 * mapfile.cc (Mapfile::print_input_section): Use
8367 output_section_offset.
8368 * i386.cc (Target_i386::copy_reloc): Change object parameter to
8369 Sized_relobj*.
8370 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
8371 * sparc.cc (Target_sparc::copy_reloc): Likewise.
8372 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
8373
5cb66f97
ILT
83742008-07-03 Ian Lance Taylor <iant@google.com>
8375
8376 * layout.cc (Layout::include_section): Do not discard unrecognized
8377 SHT_STRTAB sections.
8378
afe47622
CS
83792008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
8380
8381 * script.cc (Lex::can_continue_name): Make '?' allowable in
8382 version-script names.
8383 * testsuite/version_script.map: Change glob pattern to use '?'
8384
5adf9721
ILT
83852008-06-30 Manish Singh <yosh@gimp.org>
8386
8387 PR 6585
8388 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
8389 Correct typo.
8390
e6fde208
ILT
83912008-06-30 Ian Lance Taylor <iant@google.com>
8392
8393 PR 6660
8394 PR 6682
8395 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
8396 versions]: Don't try to read the value in the contents, since we
8397 don't use it. Use the template endianness when writing.
8398
3f2e6a2d
CC
83992008-06-25 Cary Coutant <ccoutant@google.com>
8400
8401 * fileread.cc (File_read::make_view): Assert on zero-length view.
8402 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
8403 symbol table when there are no symbols to read.
8404
c43d3a48
CS
84052008-06-23 Craig Silverstein <csilvers@google.com>
8406
8407 * version.cc (version_string): Bump to 1.7
8408
5f494ea0
CS
84092008-06-18 Craig Silverstein <csilvers@google.com>
8410
8411 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
8412 constant 0xFFFF to type Valtype.
8413 (Powerpc_relocate_functions::rel16_ha): Likewise.
8414
c42e122e
ILT
84152008-06-17 Ian Lance Taylor <iant@google.com>
8416
f34787f8
ILT
8417 * output.h (Output_section::Input_section): Initialize p2align_ to
8418 zero for Output_section_data constructors.
8419 (Output_section::Input_section::addralign): If not an input
8420 section, return the alignment of the Output_section_data.
8421 * testsuite/copy_test.cc: New file.
8422 * testsuite/copy_test_1.cc: New file.
8423 * testsuite/copy_test_2.cc: New file.
8424 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
8425 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
8426 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
8427 (copy_test_1_pic.o, copy_test_1.so): New targets.
8428 (copy_test_2_pic.o, copy_test_2.so): New targets.
8429 * testsuite/Makefile.in: Rebuild.
8430
c42e122e
ILT
8431 * script-sections.cc (Script_sections::place_orphan): Initialize
8432 local variable exact.
8433
ce3ac18a
DE
84342008-06-13 David Edelsohn <edelsohn@gnu.org>
8435
8436 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
8437
42cacb20
DE
84382008-06-12 David Edelsohn <edelsohn@gnu.org>
8439 David S. Miller <davem@davemloft.net>
8440
8441 * powerpc.cc: New file.
8442 * Makefile.am (TARGETSOURCES): Add powerpc.cc
8443 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
8444 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
8445 * Makefile.in: Rebuild.
8446
7b308235
ILT
84472008-06-09 Ian Lance Taylor <iant@google.com>
8448
8449 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
8450 <exception>.
8451 (throwing, orig_terminate): New static variables.
8452 (terminate_handler): New static function.
8453 (t2): Set terminate handler.
8454
f0b886e3
ILT
84552008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
8456
8457 PR 6584
cd536b21 8458 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
8459 alignment.
8460
3e90f135
CC
84612008-05-30 Cary Coutant <ccoutant@google.com>
8462
8463 * archive.cc (Archive::include_all_members) Correct to step
8464 over symbol table and extended name table in thin archives.
8465
e09ad04a
ILT
84662008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
8467
8468 PR 6407
8469 * target-reloc.h (relocate_for_relocatable): Fix new_offset
8470 calculation.
8471
62b01cb5
ILT
84722008-05-28 Caleb Howe <cshowe@google.com>
8473
8474 * reduced_debug_output.cc: New file.
8475 * reduced_debug_output.h: New file.
92de84a6 8476 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
8477 * options.cc (General_options::finalize): Add strip_debug_non_line
8478 to the strip heirarchy.
8479 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
8480 fields.
8481 * layout.cc: Include "reduced_debug_output.h".
8482 (Layout::Layout): Initialize new fields.
8483 (line_only_debug_sections): New static array.
8484 (is_lines_only_debug_sections): New static inline function.
8485 (Layout::include_section): Handle --strip-debug-non-line.
8486 (Layout::make_output_section): If --strip-debug-non-line, build
8487 new output sections for .debug_abbrev and .debug_info.
8488 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
8489 gold. Warn about possible overflow.
8490 (read_signed_LEB_128): Likewise.
8491 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
8492 (read_signed_LEB_128): Declare.
8493 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
8494 (HFILES): Add reduced_debug_output.h.
8495 * Makefile.in: Rebuild.
8496
7d9e3d98
ILT
84972008-05-21 Ian Lance Taylor <iant@google.com>
8498
8499 * mapfile.cc: New file.
8500 * mapfile.h: New file.
8501 * options.h (class General_options): Add -M/--print-map and -Map.
8502 * options.cc (General_options::finalize): Make -M equivalent to
8503 -Map -.
8504 * main.cc: Include <cstdio> and "mapfile.h".
8505 (main): Open mapfile if requested.
8506 * gold.cc (class Middle_runner): Add mapfile_ field. Update
8507 constructor. Change caller.
8508 (queue_initial_tasks): Add mapfile parameter. Change caller.
8509 (queue_middle_tasks): Likewise.
8510 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
8511 declarations.
8512 * archive.cc: Include "mapfile.h".
8513 (Archive::add_symbols): Add mapfile parameter. Change all
8514 callers. Pass mapfile, symbol, and reason to include_member.
8515 (Archive::include_all_members): Add mapfile parameter. Change all
8516 callers.
8517 (Archive::include_member): Add mapfile, sym, and why parameters.
8518 Change all callers. Report inclusion to map file.
8519 * archive.h: Include "fileread.h".
8520 (class Archive): Update declarations.
8521 (Archive::file): New const method.
8522 (class Add_archive_symbols): Add mapfile_ field. Update
8523 constructor. Change all callers.
8524 * readsyms.h (class Read_symbols): Likewise.
8525 (class Finish_group): Likewise.
8526 (class Read_script): Likewise.
8527 * common.cc: Include "mapfile.h".
8528 (Symbol_table::allocate_commons): Add mapfile parameter. Change
8529 all callers.
8530 (Symbol_table::do_allocate_commons): Likewise.
8531 (Symbol_table::do_allocate_commons_list): Likewise. Report common
8532 symbol allocation to mapfile.
8533 * common.h (class Allocate_commons_task): Add mapfile_ field.
8534 Update constructor. Change all callers.
8535 * symtab.h (class Symbol_table): Update declarations.
8536 * layout.cc: Include "mapfile.h".
8537 (Layout_task_runner::run): Print information to mapfile.
8538 (Layout::create_gold_note): Change Output_data_fixed_space to
8539 Output_data_zero_fill.
8540 (Layout::create_build_id): Likewise.
8541 (Layout::print_to_mapfile): New function.
8542 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
8543 constructor. Change caller.
8544 (class Layout): Declare print_to_mapfile.
8545 * output.cc (Output_section::Input_section::print_to_mapfile): New
8546 function.
8547 (Output_section::add_input_section): If producing a map, always
8548 add to input_sections_ list.
8549 (Output_section::do_print_to_mapfile): New function.
8550 (Output_segment::print_sections_to_mapfile): New function.
8551 (Output_segment::print_section_list_to_mapfile): New function.
8552 * output.h: Include "mapfile.h".
8553 (Output_data::print_to_mapfile): New function.
8554 (Output_data::do_print_to_mapfile): New virtual function.
8555 (Output_segment_headers::do_print_to_mapfile): New function.
8556 (Output_file_header::do_print_to_mapfile): New function.
8557 (Output_data_const::do_print_to_mapfile): New function.
8558 (class Output_data_const_buffer): Add map_name_ field. Update
8559 constructor. Change all callers. Add do_print_to_mapfile
8560 function.
8561 (class Output_data_fixed_space): Likewise.
8562 (class Output_data_space): Likewise.
8563 (class Output_data_zero_fill): New class.
8564 (Output_data_strtab::do_print_to_mapfile): New function.
8565 (Output_data_reloc_base::do_print_to_mapfile): New function.
8566 (Output_relocatable_relocs::do_print_to_mapfile): New function.
8567 (Output_data_group::do_print_to_mapfile): New function.
8568 (Output_data_got::do_print_to_mapfile): New function.
8569 (Output_data_dynamic::do_print_to_mapfile): New function.
8570 (Output_symtab_xindex::do_print_to_mapfile): New function.
8571 (class Output_section): Declare do_print_to_mapflie. Declare
8572 print_to_mapfile in Input_section.
8573 (class Output_segment): Declare new functions.
8574 * object.h (Sized_relobj::symbol_count): New function.
8575 * script-sections.cc
8576 (Output_section_element_dot_assignment::set_section_addresses):
8577 Change Output_data_fixed_space to Output_data_zero_fill.
8578 (Output_data_expression::do_print_to_mapfile): New function.
8579 * script.cc (read_input_script): Add mapfile parameter. Change
8580 all callers.
8581 * script.h (read_input_script): Update declaration.
8582 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
8583 (Eh_frame::do_print_to_mapfile): New function.
8584 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
8585 (Output_merge_string::do_print_to_mapfile): New function.
8586 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
8587 function.
8588 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
8589 function.
8590 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
8591 function.
8592 * Makefile.am (CCFILES): Add mapfile.cc.
8593 (HFILES): Add mapfile.h.
8594 * Makefile.in: Rebuild.
8595
9f1d377b
ILT
85962008-05-19 Ian Lance Taylor <iant@google.com>
8597
8598 * options.h (class General_options): Add -z relro.
8599 * layout.cc (Layout::Layout): Initialize relro_segment_.
8600 (Layout::add_output_section_data): Return the output section.
8601 (Layout::make_output_section): Rcognize relro sections and mark
8602 them appropriately.
8603 (Layout::attach_allocated_section_to_segment): Put relro sections
8604 in a PT_GNU_RELRO segment.
8605 (Layout::create_initial_dynamic_sections): Mark the .dynamic
8606 section as relro.
8607 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
8608 PT_TLS segments.
8609 (Layout::linkonce_mapping): Map d.rel.ro.local to
8610 .data.rel.ro.local.
8611 (Layout::output_section_name): Us .data.rel.ro.local for any
8612 section which begins with that.
8613 * layout.h (class Layout): Update add_output_section_data
8614 declaration. Add relro_segment_ field.
8615 * output.cc (Output_section::Output_section): Initialize is_relro_
8616 and is_relro_local_ fields.
8617 (Output_segment::add_output_section): Group relro sections.
8618 (Output_segment::is_first_section_relro): New function.
8619 (Output_segment::maximum_alignment): If there is a relro section,
8620 align the segment to the common page size.
8621 (Output_segment::set_section_addresses): Track whether we are
8622 looking at relro sections. If the last section is a relro
8623 section, align to the common page size.
8624 (Output_segment::set_section_list_addresses): Add in_relro
8625 parameter. Change all callers. Align to the page size when
8626 moving from relro to non-relro section.
8627 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
8628 segment.
8629 * output.h (class Output_section): Add is_relro_ and
8630 is_relro_local_ fields.
8631 (Output_section::is_relro): New function.
8632 (Output_section::set_is_relro): New function.
8633 (Output_section::is_relro_local): New function.
8634 (Output_section::set_is_relro_local): New function.
8635 (class Output_segment): Update declarations.
8636 * i386.cc (Target_i386::got_section): Mark .got section as relro.
8637 * sparc.cc (Target_sparc::got_section): Likewise.
8638 * x86_64.cc (Target_x86_64::got_section): Likewise.
8639 * testsuite/relro_test_main.cc: New file.
8640 * testsuite/relro_test.cc: New file.
8641 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
8642 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
8643 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
8644 (relro_test.so, relro_test_pic.o): New targets.
8645 * testsuite/Makefile.in: Rebuild.
8646
a984ee1d
ILT
86472008-05-16 Ian Lance Taylor <iant@google.com>
8648
01676dcd
ILT
8649 * output.cc (Output_segment::add_output_section): Remove front
8650 parameter.
8651 * output.h (class Output_segment): Remove
8652 add_initial_output_section and overloaded add_output_section.
8653 Update declaration of remaining add_output_section.
8654 * layout.cc (Layout::create_interp): Call add_output_section
8655 rather than add_initial_output_section.
8656 (Layout::finish_dynamic_section): Likewise.
8657
497897f9
ILT
8658 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
8659 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
8660 know the dynamic type.
8661 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
8662 field. Initialize it in constructor.
8663 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
8664 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
8665 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
8666 reloc.
8667
a984ee1d
ILT
8668 * output.cc (Output_reloc::get_address): Change return type to
8669 Elf_Addr.
8670 * output.h (class Output_reloc): Update get_address declaration.
8671 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
8672 for section addresses.
8673
55ba0940
ILT
86742008-05-09 Ian Lance Taylor <iant@google.com>
8675
8676 PR 6493
8677 * gold.cc (gold_nomem): Use return value of write.
8678
75517b77
ILT
86792008-05-08 Ian Lance Taylor <iant@google.com>
8680
8681 * symtab.c (Symbol::init_base_output_data): Add version
8682 parameter. Change all callers.
8683 (Symbol::init_base_output_segment): Likewise.
8684 (Symbol::init_base_constant): Likewise.
8685 (Symbol::init_base_undefined): Likewise.
8686 (Sized_symbol::init_output_data): Likewise.
8687 (Sized_symbol::init_output_segment): Likewise.
8688 (Sized_symbol::init_constant): Likewise.
8689 (Sized_symbol::init_undefined): Likewise.
8690 (Symbol_table::do_define_in_output_data): If the new symbol has a
8691 version, mark it as the default.
8692 (Symbol_table::do_define_in_output_segment): Likewise.
8693 (Symbol_table::do_define_as_constant): Likewise.
8694 * symtab.h (class Symbol): Update declarations.
8695 (class Sized_symbol): Likewise.
8696 * resolve.cc (Symbol::override_version): New function.
c42e122e 8697 (Symbol::override_base): Call override_version.
75517b77
ILT
8698 (Symbol::override_base_with_special): Likewise.
8699 * testsuite/ver_script_8.script: New file.
8700 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
8701 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
8702 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
8703 (ver_test_8_1.so, ver_test_8_2.so): New targets.
8704
f1f70eae
ILT
87052008-05-06 Ian Lance Taylor <iant@google.com>
8706
f3e9c5c5
ILT
8707 PR 6049
8708 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
8709 functions.
8710 (class General_options): Remove existing --undefined, and add
8711 --no-undefined instead. Add new --undefined as synonym for -u.
8712 * archive.cc (Archive::add_symbols): Check whether symbol was
8713 named with -u.
8714 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
8715 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
8716 all uses. Add IS_UNDEFINED. Update declarations to split
8717 different versions of init_base. Declare init_base_undefined.
8718 (Symbol::is_defined): Handle IS_UNDEFINED.
8719 (Symbol::is_undefined): Likewise.
8720 (Symbol::is_weak_undefined): Call is_undefined.
8721 (Symbol::is_absolute): Handle IS_CONSTANT.
8722 (class Sized_symbol): Update declarations to split different
8723 versions of init. Declare init_undefined.
8724 (class Symbol_table): Declare new functions.
8725 * symtab.cc (Symbol::init_base_object): Rename from init_base.
8726 Change all callers.
8727 (Symbol::init_base_output_data): Likewise.
8728 (Symbol::init_base_output_segment): Likewise.
8729 (Symbol::init_base_constant): Likewise.
8730 (Symbol::init_base_undefined): New function.
8731 (Sized_symbol::init_object): Rename from init. Change all
8732 callers.
8733 (Sized_symbol::init_output_data): Likewise.
8734 (Sized_symbol::init_output_segment): Likewise.
8735 (Sized_symbol::init_constant): Likewise.
8736 (Sized_symbol::init_undefined): New function.
8737 (Symbol_table::add_undefined_symbols_from_command_line): New
8738 function.
8739 (Symbol_table::do_add_undefined_symbols_from_command_line): New
8740 function.
8741 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
8742 (Symbol::output_section): Likewise.
8743 (Symbol::set_output_section): Likewise.
8744 (Symbol_table::sized_finalize_symbol): Likewise.
8745 (Symbol_table::sized_write_globals): Likewise.
8746 * resolve.cc (Symbol_table::should_override): Likewise.
8747 (Symbol::override_base_with_special): Likewise.
8748
8bdcdf2c
ILT
8749 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
8750 symbol, change it to have default visibility.
8751 * testsuite/protected_1.cc: New file.
8752 * testsuite/protected_2.cc: New file.
8753 * testsuite/protected_3.cc: New file.
8754 * testsuite/protected_main_1.cc: New file.
8755 * testsuite/protected_main_2.cc: New file.
8756 * testsuite/protected_main_3.cc: New file.
8757 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
8758 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
8759 (protected_1_LDFLAGS, protected_1_LDADD): Define.
8760 (protected_1.so): New target.
8761 (protected_1_pic.o, protected_2_pic.o): New targets.
8762 (protected_3_pic.o): New target.
8763 (check_PROGRAMS): Add protected_2.
8764 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
8765 (protected_2_LDFLAGS, protected_2_LDADD): Define.
8766 * testsuite/Makefile.in: Rebuild.
8767
2b706932
ILT
8768 * options.h (DEFINE_var): Add set_user_set_##varname__.
8769 (DEFINE_bool_alias): New macro.
8770 (class General_options): Define -Bstatic using DEFINE_bool_alias
8771 rather than DEFINE_special. Add --undefined as an alias for -z
8772 defs.
8773 * options.cc (General_options::parse_Bstatic): Remove.
8774
d82a5bcc
ILT
8775 * options.h (class General_options): Add --fatal-warnings.
8776 * main.cc (main): Implement --fatal-warnings.
8777 * errors.h (Errors::warning_count): New function.
8778
f1f70eae
ILT
8779 * options.h (class General_options): Add -Bsymbolic-functions.
8780 * symtab.h (Symbol::is_preemptible): Check for
8781 -Bsymbolic-functions.
8782
8825ac63
ILT
87832008-05-05 Ian Lance Taylor <iant@google.com>
8784
d98bc257
ILT
8785 * options.h (DEFINE_bool): For DASH_Z, create the negative option
8786 as noVARNAME rather than no-VARNAME.
8787 (class General_options): Add option -z combreloc.
8788 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
8789 get_address.
8790 (Output_reloc::sort_before) [SHT_REL]: New function.
8791 (Output_reloc::sort_before) [SHT_RELA]: New function.
8792 (class Output_data_reloc_base): Add sort_relocs_ field. Define
8793 Sort_relocs_comparison.
8794 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
8795 parameter. Change all callers.
8796 (Output_data_reloc::Output_data_reloc) [both versions]: Add
8797 sort_relocs parameter. Change all callers.
8798 * output.cc (Output_reloc::get_address): New function, broken out
8799 of write_rel.
8800 (Output_reloc::write_rel): Call it.
8801 (Output_reloc::compare): New function.
8802 (Output_data_reloc_base::do_write): Optionally sort relocs.
8803
60b2b4e7
ILT
8804 * configure.ac: If targ_extra_obj is set, link it in.
8805 * configure.tgt: Initialize all variables.
8806 (x86_64*): Set targ_extra_obj and targ_extra_size.
8807 * configure: Rebuild.
8808
8825ac63
ILT
8809 * object.cc (Sized_relobj::include_section_group): Adjust section
8810 indexes read from group data. Build vector to pass to
8811 layout_group.
8812 * layout.cc (Layout::layout_group): Add flags and shndxes
8813 parameters. Remove contents parameter. Change caller. Update
8814 explicit instantiations.
8815 * layout.h (class Layout): Update layout_group declaration.
8816 * output.cc (Output_data_group::Output_data_group): Add flags and
8817 input_shndxes parameters. Remove contents parameter. Change
8818 caller.
8819 (Output_data_group::do_write): Change input_sections_ to
8820 input_shndxes_.
8821 * output.h (class Output_data_group): Update constructor
8822 declaration. Rename input_sections_ to input_shndxes_.
8823 * testsuite/many_sections_test.cc: Add template.
8824
e94cf127
CC
88252008-04-30 Cary Coutant <ccoutant@google.com>
8826
4418b2d5
CC
8827 * target-reloc.h (relocate_section): Fix dead-pointer bug.
8828
e94cf127
CC
8829 * layout.cc (Layout::include_section): Refactored check for debug
8830 info section.
8831 (Layout::add_comdat): Add new parameters. Change type
8832 of signature parameter. Add object and shndx to signatures table.
8833 (Layout::find_kept_object): New function.
8834 * layout.h: Include <cstring>.
8835 (Layout::is_debug_info_section): New function.
8836 (Layout::add_comdat): Add new parameters.
8837 (Layout::find_kept_object): New function.
8838 (Layout::Kept_section): New struct.
8839 (Layout::Signatures): Change type of map range.
8840 * object.cc (Relobj::output_section_address): New function.
8841 (Sized_relobj::include_section_group): Add new parameters. Change
8842 calls to Layout::add_comdat. Change to build table of kept comdat
8843 groups and table mapping discarded sections to kept sections.
8844 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
8845 (Sized_relobj::do_layout): Change calls to include_section_group and
8846 include_linkonce_section.
8847 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
8848 value to zero when section is discarded.
8849 (Sized_relobj::map_to_kept_section): New function.
8850 * object.h (Relobj::output_section_address): New function.
8851 (Relobj::Comdat_group): New type.
8852 (Relobj::find_comdat_group): New function.
8853 (Relobj::Comdat_group_table): New type.
8854 (Relobj::Kept_comdat_section): New type.
8855 (Relobj::Kept_comdat_section_table): New type.
8856 (Relobj::add_comdat_group): New function.
8857 (Relobj::set_kept_comdat_section): New function.
8858 (Relobj::get_kept_comdat_section): New function.
8859 (Relobj::comdat_groups_): New field.
8860 (Relobj::kept_comdat_sections_): New field.
8861 (Symbol_value::input_value): Update comment.
8862 (Sized_relobj::map_to_kept_section) New function.
8863 (Sized_relobj::include_linkonce_section): Add new parameter.
8864 * target-reloc.h (Comdat_behavior): New type.
8865 (get_comdat_behavior): New function.
8866 (relocate_section): Add code to map a discarded section to the
8867 corresponding kept section when applying a relocation.
8868
e4e5049b
CS
88692008-04-30 Craig Silverstein <csilvers@google.com>
8870
8871 * dwarf_reader.cc (next_generation_count): New static var.
8872 (Addr2line_cache_entry): New struct.
8873 (addr2line_cache): New static var.
8874 (Dwarf_line_info::one_addr2line): Added caching.
8875 (Dwarf_line_info::clear_addr2line_cache): New function.
8876 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
8877 cache-size parameter.
8878 (Dwarf_line_info::one_addr2line_cache): New function.
8879 * symtab.cc (Symbol_table::detect_odr_violations): Pass
8880 new cache-size argument to one_addr2line(), and clear cache.
8881
d09e9154
CC
88822008-04-28 Cary Coutant <ccoutant@google.com>
8883
8884 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
8885 R_386_PC8 relocations.
8886
7ef73768
ILT
88872008-04-23 Ian Lance Taylor <iant@google.com>
8888
55438702
ILT
8889 * object.cc (Sized_relobj::include_section_group): Check for
8890 invalid section group.
8891
c165fb93
ILT
8892 * object.cc (make_elf_object): Correct test for 64-bit ELF file
8893 header size.
8894
7ef73768
ILT
8895 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
8896 than read for file header.
8897 * archive.cc (Archive::include_member): Likewise.
8898
6194aaab
L
88992008-04-23 Paolo Bonzini <bonzini@gnu.org>
8900
8901 * aclocal.m4: Regenerate.
8902 * configure: Regenerate.
8903
d491d34e
ILT
89042008-04-19 Ian Lance Taylor <iant@google.com>
8905
5ea2bac6
ILT
8906 * version.cc (version_string): Bump to 1.6.
8907
7bc3e21a
ILT
8908 * testsuite/Makefile.am (many_sections_r_test): New target.
8909 (many_sections_r_test_SOURCES): Remove.
8910 (many_sections_r_test_DEPENDENCIES): Remove.
8911 (many_sections_r_test_LDFLAGS): Remove.
8912 (many_sections_r_test_LDADD): Remove.
8913
7fcd3aa9
ILT
8914 * object.cc (Sized_relobj::do_add_symbols): Always pass
8915 local_symbol_count_ to add_from_relobj.
8916
4c94d6ae
ILT
8917 * testsuite/Makefile.am (many_sections_check.h): Only check one in
8918 every thousand variables.
8919 * testsuite/Makefile.in: Rebuild.
8920
d491d34e
ILT
8921 * object.cc (Xindex::initialize_symtab_xindex): New function.
8922 (Xindex::read_symtab_xindex): New function.
8923 (Xindex::sym_xindex_to_shndx): New function.
8924 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
8925 available.
8926 (Sized_relobj::do_initialize_xindex): New function.
8927 (Sized_relobj::do_read_symbols): Adjust section links.
8928 (Sized_relobj::symbol_section_and_value): Add is_ordinary
8929 parameter. Change all callers.
8930 (Sized_relobj::include_section_group): Adjust section links and
8931 symbol section indexes.
8932 (Sized_relobj::do_layout): Adjust section links.
8933 (Sized_relobj::do_count_local_symbols): Adjust section links and
8934 symbol section indexes.
8935 (Sized_relobj::do_finalize_local_symbols): Distinguish between
8936 ordinary and special symbols.
8937 (Sized_relobj::write_local_symbols): Add symtab_xindex and
8938 dynsym_xindex parameters. Change all callers. Adjust section
8939 links. Use SHN_XINDEX when needed.
8940 (Sized_relobj::get_symbol_location_info): Adjust section links.
8941 Don't get fooled by special symbols.
8942 * object.h (class Xindex): Define.
8943 (class Object): Add xindex_ parameter. Declare virtual functoin
8944 do_initialize_xindex.
8945 (Object::adjust_sym_shndx): New function.
8946 (Object::set_xindex): New protected function.
8947 (class Symbol_value): Add is_ordinary_shndx_ field.
8948 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
8949 (Symbol_value::value): Assert ordinary section.
8950 (Symbol_value::initialize_input_to_output_map): Likewise.
8951 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
8952 Change all callers.
8953 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
8954 all callers.
8955 (class Sized_relobj): Update declarations.
8956 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
8957 parameter. Change all callers.
8958 (Sized_relobj::adjust_shndx): New function.
8959 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
8960 field.
8961 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
8962 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
8963 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
8964 (Sized_dynobj::read_dynsym_section): Adjust section links.
8965 (Sized_dynobj::read_dynamic): Likewise.
8966 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
8967 section links.
8968 (Sized_dynobj::do_initialize_xindex): New function.
8969 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
8970 do_initialize_xindex.
8971 (Sized_dynobj::adjust_shndx): New function.
8972 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
8973 dynsym_xindex_ fields.
8974 (Layout::finalize): Add a call to set_section_indexes before
8975 creating the symtab sections.
8976 (Layout::set_section_indexes): Don't do anything if the section
8977 already has a section index.
8978 (Layout::create_symtab_sections): Add shnum parameter. Change
8979 caller. Create .symtab_shndx section if needed.
8980 (Layout::create_shdrs): Add shstrtab_section parameter. Change
8981 caller.
8982 (Layout::allocated_output_section_count): New function.
8983 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
8984 needed.
8985 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
8986 fields. Update declarations.
8987 (Layout::symtab_xindex): New function.
8988 (Layout::dynsym_xindex): New function.
8989 (class Write_symbols_task): Add layout_ field.
8990 (Write_symbols_task::Write_symbols_task): Add layout parameter.
8991 Change caller.
8992 * output.cc (Output_section_headers::Output_section_headers): Add
8993 shstrtab_section parameter. Change all callers.
8994 (Output_section_headers::do_sized_write): Store overflow values
8995 for section count and section string table section index in
8996 section header zero.
8997 (Output_file_header::do_sized_write): Check for overflow of
8998 section count and section string table section index.
8999 (Output_symtab_xindex::do_write): New function.
9000 (Output_symtab_xindex::endian_do_write): New function.
9001 * output.h (class Output_section_headers): Add shstrtab_section_.
9002 Update declarations.
9003 (class Output_symtab_xindex): Define.
9004 (Output_section::has_out_shndx): New function.
9005 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
9006 field.
9007 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
9008 Change all callers.
9009 (Sized_symbol::init): Likewise.
9010 (Symbol::output_section): Check for ordinary symbol.
9011 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
9012 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
9013 callers.
9014 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
9015 Change all callers. Simplify handling of symbols from sections
9016 not included in the link.
9017 (Symbol_table::add_from_dynobj): Handle ordinary symbol
9018 distinction.
9019 (Weak_alias_sorter::operator()): Assert that symbols are
9020 ordinary.
9021 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
9022 distinction.
9023 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
9024 parameters. Change all callers.
9025 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
9026 symbol distinction. Use SHN_XINDEX when needed.
9027 (Symbol_table::write_section_symbol): Add symtab_xindex
9028 parameter. Change all callers.
9029 (Symbol_table::sized_write_section_symbol): Likewise. Use
9030 SHN_XINDEX when needed.
9031 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
9032 declarations.
9033 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
9034 (Symbol::is_defined): Check is_ordinary.
9035 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
9036 (Symbol::is_absolute, Symbol::is_common): Likewise.
9037 (class Sized_symbol): Update declarations.
9038 (class Symbol_table): Update declarations.
9039 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
9040 parameters. Change all callers.
9041 (Sized_symbol::override): Likewise.
9042 (Symbol_table::override): Likewise.
9043 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
9044 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
9045 is_ordinary, and orig_st_shndx parameters. Change all callers.
9046 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
9047 to be in an ordinary section.
9048 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
9049 object and is_ordinary parameters. Change all callers.
9050 (Sized_dwarf_line_info::read_relocs): Add object parameter.
9051 Change all callers. Don't add undefined or non-ordinary symbols
9052 to reloc_map_.
9053 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
9054 Change all callers.
9055 * dwarf_reader.h (class Sized_dwarf_line_info): Update
9056 declarations.
9057 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
9058 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
9059 (Sized_relobj::relocate_sections): Likewise.
9060 * target-reloc.h (scan_relocs): Adjust section symbol index.
9061 (scan_relocatable_relocs): Likewise.
9062 * i386.cc (Scan::local): Check for ordinary symbols.
9063 * sparc.cc (Scan::local): Likewise.
9064 * x86_64.cc (Scan::local): Likewise.
9065 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
9066 to symbol_section_and_value.
9067 * testsuite/many_sections_test.cc: New file.
9068 * testsuite/Makefile.am (BUILT_SOURCES): Define.
9069 (check_PROGRAMS): Add many_sections_test.
9070 (many_sections_test_SOURCES): Define.
9071 (many_sections_test_DEPENDENCIES): Define.
9072 (many_sections_test_LDFLAGS): Define.
9073 (BUILT_SOURCES): Add many_sections_define.h.
9074 (many_sections_define.h): New target.
9075 (BUILT_SOURCES): Add many_sections_check.h.
9076 (many_sections_check.h): New target.
9077 (check_PROGRAMS): Add many_sections_r_test.
9078 (many_sections_r_test_SOURCES): Define.
9079 (many_sections_r_test_DEPENDENCIES): Define.
9080 (many_sections_r_test_LDFLAGS): Define.
9081 (many_sections_r_test_LDADD): Define.
9082 (many_sections_r_test.o): New target.
9083 * testsuite/Makefile.in: Rebuild.
9084
c5818ff1
CC
90852008-04-17 Cary Coutant <ccoutant@google.com>
9086
9087 * errors.cc (Errors::info): New function.
9088 (gold_info): New function.
9089 * errors.h (Errors::info): New function.
9090 * gold.h (gold_info): New function.
9091 * object.cc (Input_objects::add_object): Print trace output.
9092 * options.cc (options::parse_set): New function.
9093 (General_options::parse_wrap): Deleted.
9094 (General_options::General_options): Deleted initializer.
9095 * options.h (options::String_set): New typedef.
9096 (options::parse_set): New function.
9097 (DEFINE_set): New macro.
9098 (General_options::wrap): Changed to use DEFINE_set. Changed
9099 callers of any_wrap_symbols and is_wrap_symbol.
9100 (General_options::trace, General_options::trace_symbol):
9101 New options.
9102 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
9103 (General_options::wrap_symbols_): Deleted.
9104 * symtab.cc (Symbol_table::add_from_object): Print trace output.
9105
b5be4a7c
DM
91062008-04-17 David S. Miller <davem@davemloft.net>
9107
9108 * options.cc (General_options::parse_V): New function.
9109 * options.h: Add entries for -V and -Qy.
9110
155a0dd7
ILT
91112008-04-17 Ian Lance Taylor <iant@google.com>
9112
9113 * common.cc (Symbol_table::allocate_commons): Remove options
9114 parameter. Change caller.
9115 (Symbol_table::do_allocate_commons): Remove options parameter.
9116 Change caller. Just call do_allocate_commons_list twice.
9117 (Symbol_table::do_allocate_commons_list): New function, broken out
9118 of do_allocate_commons.
9119 * common.h (class Allocate_commons_task): Remove options_ field.
9120 Update constructor.
9121 * symtab.cc (Symbol_table::Symbol_table): Initialize
9122 tls_commons_.
9123 (Symbol_table::add_from_object): Put TLS common symbols on
9124 tls_commons_ list.
9125 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
9126 which are IN_OUTPUT_DATA.
9127 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
9128 allocate_commons and do_allocate_commons declarations. Declare
9129 do_allocate_commons_list.
9130 * gold.cc (queue_middle_tasks): Update creation of
9131 Allocate_commons_task to not pass options.
9132 * testsuite/Makefile.am (INCLUDES): Add -I.. .
9133 (TLS_TEST_C_FLAGS): New variable.
9134 (tls_test_c_pic.o): New target.
9135 (tls_test_shared.so): Link in tls_test_c_pic.o.
9136 (tls_test_c_pic_ie.o): New target.
9137 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
9138 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
9139 (tls_test_c.o): New target.
9140 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
9141 (tls_pic_test_LDADD): Likewise.
9142 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
9143 (tls_shared_gd_to_ie_test_LDADD): Likewise.
9144 (tls_test_c_gnu2.o): New target.
9145 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
9146 tls_test_c_gnu2.o.
9147 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
9148 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
9149 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
9150 * testsuite/tls_test.cc: Include "config.h".
9151 (t_last): Call t11_last.
9152 * testsuite/tls_test.h (t11, t11_last): Declare.
9153 * testsuite/tls_test_c.c: New file.
9154 * testsuite/tls_test_main.cc (thread_routine): Call t11.
9155 * configure.ac: Check for OpenMP support.
9156 * configure, config.in, Makefile.in: Rebuild.
9157 * testsuite/Makefile.in: Rebuild.
9158
edfbb029
CC
91592008-04-16 Cary Coutant <ccoutant@google.com>
9160
9161 * i386.cc (Target_i386::define_tls_base_symbol): New function.
9162 (Target_i386::tls_base_symbol_defined_): New field.
9163 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
9164 (Target_i386::Scan::global): Likewise.
9165 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
9166 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
9167 (Target_x86_64::tls_base_symbol_defined_): New field.
9168 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
9169 (Target_x86_64::Scan::global): Likewise.
9170
f3c69fca
CC
91712008-04-16 Cary Coutant <ccoutant@google.com>
9172
9173 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
9174 (Symbol::needs_plt_entry): Allow weak undefined symbols.
9175 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
9176 building shared libraries.
9177 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
9178 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
9179 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
9180 * testsuite/Makefile.in: Rebuild.
9181 * testsuite/weak_undef.h: New file.
9182 * testsuite/weak_undef_file1.cc: Add extra test cases.
9183 * testsuite/weak_undef_file2.cc: Likewise.
9184 * testsuite/weak_undef_test.cc: Likewise.
9185
7c414435
DM
91862008-04-16 David S. Miller <davem@davemloft.net>
9187
32b769e1
DM
9188 * sparc.cc (Target_sparc::Scan): Change from struct to class.
9189 Add issued_non_pic_error_ field. Declare check_non_pic.
9190 (Target_sparc::Scan::check_non_pic): New function.
9191 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
9192 (Target_sparc::Scan::global): Likewise.
9193
11936fb1
DM
9194 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
9195 * configure: Rebuild.
9196
7c414435
DM
9197 * options.h (DEFINE_enable): New macro.
9198 (new_dtags): New enable option.
9199 (initfirst, interpose, loadfltr, nodefaultlib,
9200 nodelete, nodlopen, nodump): New -z options.
9201 * layout.cc (Layout:finish_dynamic_section): If new
9202 dtags enabled, emit DT_RUNPATH. Also, emit a
9203 DT_FLAGS_1 containing any specified -z flags.
9204
85c7bf8b
ILT
92052008-04-16 Ian Lance Taylor <iant@google.com>
9206
12c0daef
ILT
9207 * copy-relocs.cc: New file.
9208 * copy-relocs.h: New file.
9209 * reloc.cc: Remove Copy_relocs code.
9210 * reloc.h: Likewise.
9211 * reloc-types.h (struct Reloc_types) [both versions]: Add
9212 get_reloc_addend_noerror.
9213 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
9214 variants of add_global which take an addend which must be zero.
9215 * i386.cc: Include "copy-relocs.h".
9216 (class Target_i386): Change type of copy_relocs_ to variable,
9217 update initializer.
9218 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
9219 Change all callers.
9220 (Target_i386::do_finalize_sections): Change handling of
9221 copy_relocs_.
9222 * sparc.cc: Include "copy-relocs.h".
9223 (class Target_sparc): Change type of copy_relocs_ to variable,
9224 update initializer.
9225 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
9226 Change all callers.
9227 (Target_sparc::do_finalize_sections): Change handling of
9228 copy_relocs_.
9229 * x86_64.cc: Include "copy-relocs.h".
9230 (class Target_x86_64): Change type of copy_relocs_ to variable,
9231 update initializer.
9232 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
9233 class. Change all callers.
9234 (Target_x86_64::do_finalize_sections): Change handling of
9235 copy_relocs_.
9236 * Makefile.am (CCFILES): Add copy-relocs.cc.
9237 (HFILES): Add copy-relocs.h.
9238
4f4995b6
ILT
9239 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
9240
85c7bf8b
ILT
9241 * testsuite/script_test_4.sh: Permit leading zeroes.
9242
4f2a9edd
ILT
92432008-04-15 Ian Lance Taylor <iant@google.com>
9244
e6188289
ILT
9245 * script-sections.cc (Script_sections::create_segments): Use
9246 header_size_adjustment even when there is enough room for the
9247 headers.
9248 * testsuite/script_test_4.sh: New file.
9249 * testsuite/script_test_4.t: New file.
9250 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
9251 (check_DATA): Add script_test_4.stdout.
9252 (MOSTLYCLEANFILES): Likewise.
9253 (script_test_4): New target.
9254 (script_test_4.stdout): New target.
9255 * testsuite/Makefile.in: Rebuild.
9256
4f2a9edd
ILT
9257 * sparc.cc: Add definitions for Output_data_plt_sparc class
9258 constants.
9259
f5314dd5
DM
92602008-04-14 David S. Miller <davem@davemloft.net>
9261
9262 * sparc.cc: New file.
9263 * Makefile.am (TARGETSOURCES): Add sparc.cc
9264 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
9265 * configure.tgt: Document targ_extra_size and
9266 targ_extra_big_endian. Add entries for sparc-* and
9267 sparc64-*.
9268 * configure.ac: Handle targ_extra_size and
9269 targ_extra_big_endian.
9270 * Makefile.in: Rebuild.
9271 * configure: Likewise.
9272 * po/POTFILES.in: Likewise.
9273 * po/gold.pot: Likewise.
9274
154e0e9a
ILT
92752008-04-14 Ian Lance Taylor <iant@google.com>
9276
9277 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
9278 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
9279 in the name/type/flags to section mapping. Don't call
9280 allocate_output_section.
9281 (Layout::choose_output_section): Change parameter from adjust_name
9282 to is_input_section. Don't permit input sections after sections
9283 are attached to segments. Don't call allocate_output_section.
9284 (Layout::layout_eh_frame): Call update_flags_for_input_section,
9285 not write_enable_output_section.
9286 (Layout::make_output_section): Don't push to
9287 unattached_section_list_ nor call attach_to_segment. Call
9288 attach_section_to_segment if sections are attached.
9289 (Layout::attach_sections_to_segments): New function.
9290 (Layout::attach_section_to_segment): New function.
9291 (Layout::attach_allocated_section_to_segment): Rename from
9292 attach_to_segment. Remove flags parameter.
9293 (Layout::allocate_output_section): Remove function.
9294 (Layout::write_enable_output_section): Remove function.
9295 * layout.h (class Layout): Update for above changes. Add new
9296 field sections_are_attached_.
9297 * output.h (Output_section::update_flags_for_input_section): New
9298 function.
9299 * output.cc (Output_section::add_input_section): Call
9300 update_flags_for_input_section.
9301 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
9302
009a67a2
CC
93032008-04-11 Cary Coutant <ccoutant@google.com>
9304
9305 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
9306 thought unnecessary.
9307 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
9308
759b1a24
ILT
93092008-04-11 Ian Lance Taylor <iant@google.com>
9310
9311 * output.h (class Output_section_data): Remove inline definition
9312 of set_addralign.
9313 * output.cc (Output_section_data::set_addralign): New function.
9314
c2b45e22
CC
93152008-04-11 Cary Coutant <ccoutant@google.com>
9316
9317 Add support for TLS descriptors for i386 and x86_64.
9318 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
9319 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
9320 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
9321 GOT_TYPE_TLS_DESC.
9322 (Target_i386::got_mod_index_entry): Remove unnecessary code.
9323 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
9324 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
9325 relocations.
9326 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
9327 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
9328 Fix problem with initial-exec relocations.
9329 (Target_i386::Relocate::relocate_tls): Likewise.
9330 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
9331 relaxation.
9332 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
9333 support for section-plus-offset dynamic table entries.
9334 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
9335 (Output_data_dynamic::Dynamic_entry): Add support for
9336 section-plus-offset dynamic table entries.
9337 (Output_data_dynamic::Classification): Likewise.
9338 (Output_data_dynamic::classification_): Renamed offset_.
9339 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
9340 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
9341 (Target_x86_64::make_plt_section): New function.
9342 (Target_x86_64::reserve_tlsdesc_entries): New function.
9343 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
9344 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
9345 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
9346 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
9347 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
9348 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
9349 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
9350 add extra PLT entry for TLS descriptors.
9351 (Output_data_plt_x86_64::got_): New field.
9352 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
9353 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
9354 fields.
9355 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
9356 descriptors.
9357 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
9358 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
9359 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
9360 R_386_TLS_DESC_CALL relocations.
9361 (Target_x86_64::Scan::global): Likewise.
9362 (Target_x86_64::do_finalize_sections): Add dynamic table entries
9363 for TLS descriptors.
9364 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
9365 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
9366 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
9367 GD-to-IE relaxation.
9368 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
9369 and TLS_DESCRIPTORS.
9370 * Makefile.in: Rebuild.
9371 * configure: Rebuild.
9372 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
9373 (tls_test_shared2.so): New target.
9374 (tls_shared_gd_to_ie_test_SOURCES): New variable.
9375 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
9376 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
9377 (tls_shared_gd_to_ie_test_LDADD): New variable.
9378 (tls_shared_gnu2_gd_to_ie_test): New target.
9379 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
9380 New targets.
9381 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
9382 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
9383 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
9384 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
9385 (tls_shared_gnu2_test): New target.
9386 (tls_test_gnu2_shared.so): New target.
9387 (tls_shared_gnu2_test_SOURCES): New variable.
9388 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
9389 (tls_shared_gnu2_test_LDFLAGS): New variable.
9390 (tls_shared_gnu2_test_LDADD): New variable.
9391 * testsuite/Makefile.in: Rebuild.
9392 * testsuite/Makefile.
9393
83bfb6b7
ILT
93942008-04-11 Ian Lance Taylor <iant@google.com>
9395
9396 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
9397 justsyms.t.
9398 * testsuite/Makefile.in: Rebuild.
9399
9400 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
9401 long.
9402 * testsuite/script_test_2.cc (main): Adjust test.
9403
706e1f5e
ILT
94042008-04-11 David S. Miller <davem@davemloft.net>
9405 Ian Lance Taylor <iant@google.com>
9406
9407 * options.h (General_options): Add entries for '-Y' and
9408 '-relax'.
9409 * options.cc (General_options:finalize): If -Y was used, add those
9410 entries to the library path instead of the default "/lib" and
9411 "/usr/lib".
9412
7c98e6bb
DM
94132008-04-11 David S. Miller <davem@davemloft.net>
9414
9415 * testsuite/justsyms.t: Start at 0x100.
9416 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
9417 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
9418 long.
9419 * testsuite/script_test_2.cc: Adjust string and section length
9420 checks.
7c98e6bb 9421
99a37bfd
ILT
94222008-04-09 Ian Lance Taylor <iant@google.com>
9423
2cefc357
ILT
9424 PR gold/5996
9425 * script-sections.cc (Sections_element::allocate_to_segment): Add
9426 orphan parameter.
9427 (Output_section_definition::allocate_to_segment): Likewise.
9428 (Orphan_output_section::allocate_to_segment): Likewise.
9429 (Script_sections::attach_sections_using_phdrs_clause): Don't
9430 propagate non-PT_LOAD segments to orphan sections.
9431 * testsuite/Makefile.am (script_test_3.stdout): Generate using
9432 readelf rather than objdump.
9433 * testsuite/script_test_3.sh: Adjust accordingly. Test that
9434 .interp section and PT_INTERP segment are the same size.
9435 * testsuite/Makefile.in: Rebuild.
9436
99a37bfd
ILT
9437 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
9438 aliases for symbols defined in the same object.
9439 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
9440 (weak_alias_test_SOURCES): New variable.
9441 (weak_alias_test_DEPENDENCIES): New variable.
9442 (weak_alias_test_LDFLAGS): New variable.
9443 (weak_alias_test_LDADD): New variable.
9444 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
9445 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
9446 (weak_alias_test_3.o): New target.
9447 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
9448 * testsuite/weak_alias_test_main.cc: New file.
9449 * testsuite/weak_alias_test_1.cc: New file.
9450 * testsuite/weak_alias_test_2.cc: New file.
9451 * testsuite/weak_alias_test_3.cc: New file.
9452
780e49c5
ILT
94532008-04-08 Ian Lance Taylor <iant@google.com>
9454
cdb0b8f5
ILT
9455 * options.h (class General_options): Add --noinhibit-exec option.
9456 * main.cc (main): Check --noinhibit-exec.
9457
0864d551
ILT
9458 * options.h (class General_options): Define --wrap as a special
9459 option. Add wrap_symbols_ field.
9460 (General_options::any_wrap_symbols): New function.
9461 (General_options::is_wrap_symbol): New function.
9462 * options.cc (General_options::parse_wrap): New function.
9463 (General_options::General_options): Initialize wrap_symbols_.
9464 * symtab.cc (Symbol_table::wrap_symbol): New function.
9465 (Symbol_table::add_from_object): Handle --wrap.
9466 * symtab.h (class Symbol_table): Declare wrap_symbol.
9467 * target.h (Target::wrap_char): New function.
9468 (Target::Target_info): Add wrap_char field.
9469 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
9470 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
9471 * testsuite/testfile.cc (Target_test::test_target_info):
9472 Likewise.
9473
789aa6de
ILT
9474 * errors.cc (Errors::undefined_symbol): Mention symbol version if
9475 there is one.
9476
2c38906f
ILT
9477 * layout.h (class Layout): Add added_eh_frame_data_ field.
9478 * layout.cc (Layout::Layout): Initialize new field.
9479 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
9480 output section until we find a section we merged successfully.
9481 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
9482 that the size be non-zero.
9483
780e49c5
ILT
9484 * merge.cc (Object_merge_map::get_output_offset): Remove inline
9485 qualifier.
9486
7fcd0256
ILT
94872008-04-08 Craig Silverstein <csilvers@google.com>
9488
9489 * configure.ac: Export new conditional variable HAVE_ZLIB.
9490 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
9491 on HAVE_ZLIB.
9492 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
9493 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
9494
6835af53
ILT
94952008-04-07 Ian Lance Taylor <iant@google.com>
9496
e24f324c
ILT
9497 * version.cc (version_string): Set to "1.5".
9498
a036edd8
ILT
9499 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
9500 Add issued_non_pic_error_ field. Declare check_non_pic.
9501 (Target_x86_64::Scan::check_non_pic): New function.
9502 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
9503 (Target_x86_64::Scan::global): Likewise.
9504
624f8810
ILT
9505 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
9506 addend parameter. Change caller. Handle merge sections.
9507 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
9508 Address to Addend. Don't add in the result of
9509 local_section_offset, pass down the addend and use the returned
9510 value.
9511 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
9512 Update declarations of local_section_offset and symbol_value.
9513 * testsuite/two_file_test_1.cc (t18): New function.
9514 * testsuite/two_file_test_2.cc (f18): New function.
9515 * testsuite/two_file_test_main.cc (main): Call t18.
9516 * testsuite/two_file_test.h (t18, f18): Declare.
9517
6835af53
ILT
9518 * configure.ac: Don't test for objdump, c++filt, or readelf.
9519 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
9520 conditionals.
9521 (TEST_READELF): New variable.
9522 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
9523 (check_PROGRAMS): Add two_file_strip_test.
9524 (two_file_strip_test): New target.
9525 (check_PROGRAMS): Add two_file_same_shared_strip_test.
9526 (two_file_same_shared_strip_test_SOURCES): New variable.
9527 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
9528 (two_file_same_shared_strip_test_LDFLAGS): New variable.
9529 (two_file_same_shared_strip_test_LDADD): New variable.
9530 (two_file_shared_strip.so): New target.
9531 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
9532 (ver_test_5.syms, ver_test_7.syms): Likewise.
9533 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
9534 (strip_test_3.stdout): Use TEST_OBJDUMP.
9535 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
9536
86925eef
CC
95372008-04-04 Cary Coutant <ccoutant@google.com>
9538
9539 * symtab.h (Symbol::is_weak_undefined): New function.
9540 (Symbol::is_strong_undefined): New function.
9541 (Symbol::is_absolute): New function.
9542 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
9543 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
9544 absolute symbols.
9545 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
9546 (weak_undef_test): New target.
9547 * testsuite/Makefile.in: Rebuild.
9548 * testsuite/weak_undef_file1.cc: New file.
9549 * testsuite/weak_undef_file2.cc: New file.
9550 * testsuite/weak_undef_test.cc: New file.
9551
126f3ece
ILT
95522008-04-03 Craig Silverstein <csilvers@google.com>
9553
9554 * compressed_output.h (class Output_compressed_section): Use
9555 unsigned buffer.
9556 * compressed_output.cc (zlib_compress): Use unsigned buffers,
9557 add zlib header.
9558 (zlib_compressed_suffix): Removed.
9559 (Output_compressed_section::set_final_data_size): Use unsigned
9560 buffers.
9561 * testsuite/Makefile.am (flagstest_compress_debug_sections):
9562 Fix linker invocation.
9563 (flagstest_o_specialfile_and_compress_debug_sections):
9564 Likewise.
9565 * testsuite/Makefile.in: Regenerated.
9566
deae2a14
DM
95672008-04-02 David S. Miller <davem@davemloft.net>
9568
9569 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
9570 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
9571
70752818
ILT
95722008-04-02 Craig Silverstein <csilvers@google.com>
9573
9574 * TODO: New file.
9575
39d0cb0e
ILT
95762008-04-02 Ian Lance Taylor <iant@google.com>
9577
9578 * fileread.cc (File_read::find_view): Add byteshift and vshifted
9579 parameters. Update for new key type to views_. Change all
9580 callers.
9581 (File_read::read): Adjust for byteshift in returned view.
9582 (File_read::add_view): New function, broken out of
9583 find_and_make_view.
9584 (File_read::make_view): New function, broken out of
9585 find_and_make_view.
9586 (File_read::find_or_make_view): Add offset and aligned
9587 parameters. Rewrite accordingly. Change all callers.
9588 (File_read::get_view): Add offset and aligned parameters. Adjust
9589 for byteshift in return value.
9590 (File_read::get_lasting_view): Likewise.
9591 * fileread.h (class File_read): Update declarations.
9592 (class File_read::View): Add byteshift_ field. Add byteshift to
9593 constructor. Add byteshift method.
9594 * archive.h (Archive::clear_uncached_views): New function.
9595 (Archive::get_view): Add aligned parameter. Change all callers.
9596 * object.h (Object::get_view): Add aligned parameter. Change all
9597 callers.
9598 (Object::get_lasting_view): Likewise.
9599
9600 * fileread.cc (File_read::release): Don't call clear_views if
9601 there are multiple objects.
9602 * fileread.h (File_read::clear_uncached_views): New function.
9603 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
9604 on the archive.
9605
a1207466
CC
96062008-03-31 Cary Coutant <ccoutant@google.com>
9607
9608 Add thin archive support.
9609 * archive.cc (Archive::armagt): New const.
9610 (Archive::setup): Remove task parameter and calls to unlock.
9611 (Archive::unlock_nested_archives): New function.
9612 (Archive::read_header): Add nested_off parameter. Change
9613 all callers.
9614 (Archive::interpret_header): Likewise.
9615 (Archive::include_all_members): Change to handle thin
9616 archives.
9617 (Archive::include_member): Likewise.
9618 * archive.h (Archive::Archive): Add new parameters and
9619 initializers.
9620 (Archive::armagt): New const.
9621 (Archive::setup): Remove task parameter.
9622 (Archive::unlock_nested_archives): New function.
9623 (Archive::read_header): Add nested_off parameter.
9624 (Archive::interpret_header): Likewise.
9625 (Archive::Nested_archive_table): New typedef.
9626 (Archive::is_thin_archive_): New field.
9627 (Archive::nested_archives_): New field.
9628 (Archive::options_): New field.
9629 (Archive::dirpath_): New field.
9630 (Archive::task_): New field.
9631 * readsyms.cc (Read_symbols::do_read_symbols): Add check
9632 for thin archives. Pass additional parameters to
9633 Archive::Archive. Unlock the archive file after calling
9634 Archive::setup.
cd536b21 9635
479f6503
ILT
96362008-03-29 Ian Lance Taylor <iant@google.com>
9637
686c8caf
ILT
9638 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
9639 version symbol to be local.
9640 * testsuite/ver_test_4.sh: New file.
9641 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
9642 (check_DATA): Add ver_test_4.syms.
9643 (ver_test_4.syms): New target.
9644 * testsuite/Makefile.in: Rebuild.
9645
ab794b6b
ILT
9646 * output.cc
9647 (Output_section::Input_section_sort_entry::has_priority): New
9648 function.
9649 (Output_section::Input_section_sort_entry::match_file_name): New
9650 function.
9651 (Output_section::Input_section_sort_entry::match_section_name):
9652 Remove.
9653 (Output_section::Input_section_sort_entry::match_section_name_prefix):
9654 Remove.
9655 (Output_section::Input_section_sort_entry::match_section_file):
9656 Remove.
9657 (Output_section::Input_section_sort_compare::operator()): Rewrite
9658 using new Input_section_sort_entry functions. Sort crtbegin and
9659 crtend first. Sort sections with no priority before sections with
9660 a priority.
9661 * testsuite/initpri1.c (d3): Check j != 4.
9662 (cd5): New constructor/destructor function.
9663 (main): Check j != 2.
9664
479f6503
ILT
9665 * symtab.cc (Symbol_table::add_from_object): If we don't use the
9666 new symbol when resolving, don't call set_is_default.
9667 * testsuite/ver_test_7.cc: New file.
9668 * testsuite/ver_test_7.sh: New file.
9669 * testsuite/Makefile.am (ver_test_7.so): New target.
9670 (ver_test_7.o): New target.
9671 (check_SCRIPTS): Add ver_test_7.sh.
9672 (check_DATA): Add ver_test_7.syms.
9673 (ver_test_7.syms): New target.
9674
2fd32231
ILT
96752008-03-28 Ian Lance Taylor <iant@google.com>
9676
9677 * layout.cc (Layout::layout): If we see an input section with a
9678 name that needs sorting, set the must_sort flag for the output
9679 section.
9680 (Layout::make_output_section): If the name of the output section
9681 indicates that it might require sorting, set the may_sort flag.
9682 * output.h (Output_section::may_sort_attached_input_sections): New
9683 function.
9684 (Output_section::set_may_sort_attached_input_sections): New
9685 function.
9686 (Output_section::must_sort_attached_input_sections): New
9687 function.
9688 (Output_section::set_must_sort_attached_input_sections): New
9689 function.
9690 (class Output_section): Declare Input_section_sort_entry. Define
9691 Input_section_sort_compare. Declare
9692 sort_attached_input_sections. Add new fields:
9693 may_sort_attached_input_sections_,
9694 must_sort_attached_input_sections_,
9695 attached_input_sections_are_sorted_.
9696 * output.cc (Output_section::Output_section): Initialize new
9697 fields.
9698 (Output_section::add_input_section): Add an entry to
9699 input_sections_ if may_sort or must_sort are true.
9700 (Output_section::set_final_data_size): Call
9701 sort_attached_input_sections if necessary.
9702 (Output_section::Input_section_sort_entry): Define new class.
9703 (Output_section::Input_section_sort_compare::operator()): New
9704 function.
9705 (Output_section::sort_attached_input_sections): New function.
9706 * configure.ac: Check whether the compiler supports constructor
9707 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
9708 * testsuite/initpri1.c: New file.
9709 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
9710 CONSTRUCTOR_PRIORITY.
9711 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
9712 (initpri1_LDFLAGS): New variable.
9713 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
9714
18e6b24e
ILT
97152008-03-27 Ian Lance Taylor <iant@google.com>
9716
49bdd526
ILT
9717 * common.cc (Sort_commons::operator): Correct sorting algorithm.
9718 * testsuite/common_test_1.c: New file.
9719 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
9720 (common_test_1_SOURCES): New variable.
9721 (common_test_1_DEPENDENCIES): New variable.
9722 (common_test_1_LDFLAGS): New variable.
9723
18e6b24e
ILT
9724 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
9725 and commons_ correctly when NAME/VERSION does not override
9726 NAME/NULL.
9727 * testsuite/ver_test_6.c: New file.
9728 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
9729 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
9730 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
9731
04bf7072
ILT
97322008-03-26 Ian Lance Taylor <iant@google.com>
9733
5871526f
ILT
9734 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
9735 of an undefined symbol from a version script.
9736 * testsuite/Makefile.am (ver_test_5.so): New target.
9737 (ver_test_5.o): New target.
9738 (check_SCRIPTS): Add ver_test_5.sh.
9739 (check_DATA): Add ver_test_5.syms.
9740 (ver_test_5.syms): New target.
9741 * testsuite/ver_test_5.cc: New file.
9742 * testsuite/ver_test_5.script: New file.
9743 * testsuite/ver_test_5.sh: New file.
9744 * Makefile.in, testsuite/Makefile.in: Rebuild.
9745
04bf7072
ILT
9746 PR gold/5986
9747 Fix problems building gold with gcc 4.3.0.
9748 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
9749 (gold_error_at_location, gold_warning_at_location): Use it.
9750 * configure.ac: Check whether we can compile and use a template
9751 function with a printf attribute.
9752 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
9753 when jumping over bytes.
9754 * object.cc: Instantiate Object::read_section_data.
9755 * debug.h: Include <cstring>
9756 * dwarf_reader.cc: Include <algorithm>
9757 * main.cc: Include <cstring>.
9758 * options.cc: Include <cstring>.
9759 * output.cc: Include <cstring>.
9760 * script.cc: Include <cstring>.
9761 * script.h: Include <string>.
9762 * symtab.cc: Include <cstring> and <algorithm>.
9763 * target-select.cc: Include <cstring>.
9764 * version.cc: Include <string>.
9765 * testsuite/testmain.cc: Include <cstdlib>.
9766 * configure, config.in: Rebuild.
9767
874c5b28
ILT
97682008-03-25 Ian Lance Taylor <iant@google.com>
9769
819d6c3a
ILT
9770 * options.cc: Include "../bfd/bfdver.h".
9771 (options::help): Print bug reporting address.
9772
f4b2c6f5
ILT
9773 * version.cc (print_version): Adjust output for current value of
9774 BFD_VERSION_STRING.
9775
9776 * NEWS: New file.
9777
e96caa79
ILT
9778 * options.cc (options::help): Print list of supported targets.
9779 * target-select.h: Include <vector>.
9780 (class Target_selector): Make machine_, size_, and is_big_endian_
9781 fields const. Add bfd_name_ and instantiated_target_ fields.
9782 (Target_selector::Target_selector): Add bfd_name parameter.
9783 (Target_selector::recognize): Make non-virtual, call
9784 do_recognize.
9785 (Target_selector::recognize_by_name): Make non-virtual, call
9786 do_recognize_by_name.
9787 (Target_selector::supported_names): New function.
9788 (Target_selector::bfd_name): New function.
9789 (Target_selector::do_instantiate_target): New pure virtual
9790 function.
9791 (Target_selector::do_recognize): New virtual function.
9792 (Target_selector::do_recognize_by_name): New virtual function.
9793 (Target_selector::instantiate_target): New private function.
9794 (supported_target_names): Declare.
9795 * target-select.cc (Target_selector::Target_selector): Update for
9796 new parameter and fields.
9797 (select_target_by_name): Check that the name matches before
9798 calling recognize_by_name.
9799 (supported_target_names): New function.
9800 * i386.cc (class Target_selector_i386): Update Target_selector
9801 constructor call. Remove recognize and recognize_by_name. Add
9802 do_instantiate_target.
9803 * x86_64.cc (class Target_selector_x86_64): Likewise.
9804 * testsuite/testfile.cc (class Target_selector_test): Update for
9805 changes to Target_selector.
9806
874c5b28
ILT
9807 * README: Rewrite, with some notes on unsupported features.
9808
0a65a3a7
CC
98092008-03-24 Cary Coutant <ccoutant@google.com>
9810
9811 * i386.cc (Target_i386::Got_type): New enum declaration.
9812 (Target_i386::Scan::local): Updated callers of Output_data_got
9813 member functions.
9814 (Target_i386::Scan::global): Likewise.
9815 (Target_i386::Relocate::relocate): Likewise.
9816 (Target_i386::Relocate::relocate_tls): Likewise.
9817 * object.h (Got_offset_list): New class.
9818 (Sized_relobj::local_has_got_offset): Added got_type parameter.
9819 (Sized_relobj::local_got_offset): Likewise.
9820 (Sized_relobj::set_local_got_offset): Likewise.
9821 (Sized_relobj::local_has_tls_got_offset): Removed.
9822 (Sized_relobj::local_tls_got_offset): Removed.
9823 (Sized_relobj::set_local_tls_got_offset): Removed.
9824 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
9825 * output.cc (Output_data_got::add_global): Added got_type parameter.
9826 (Output_data_got::add_global_with_rel): Likewise.
9827 (Output_data_got::add_global_with_rela): Likewise.
9828 (Output_data_got::add_global_pair_with_rel): New function.
9829 (Output_data_got::add_global_pair_with_rela): New function.
9830 (Output_data_got::add_local): Added got_type parameter.
9831 (Output_data_got::add_local_with_rel): Likewise.
9832 (Output_data_got::add_local_with_rela): Likewise.
9833 (Output_data_got::add_local_pair_with_rel): New function.
9834 (Output_data_got::add_local_pair_with_rela): New function.
9835 (Output_data_got::add_global_tls): Removed.
9836 (Output_data_got::add_global_tls_with_rel): Removed.
9837 (Output_data_got::add_global_tls_with_rela): Removed.
9838 (Output_data_got::add_local_tls): Removed.
9839 (Output_data_got::add_local_tls_with_rel): Removed.
9840 (Output_data_got::add_local_tls_with_rela): Removed.
9841 * output.h (Output_data_got::add_global): Added got_type parameter.
9842 (Output_data_got::add_global_with_rel): Likewise.
9843 (Output_data_got::add_global_with_rela): Likewise.
9844 (Output_data_got::add_global_pair_with_rel): New function.
9845 (Output_data_got::add_global_pair_with_rela): New function.
9846 (Output_data_got::add_local): Added got_type parameter.
9847 (Output_data_got::add_local_with_rel): Likewise.
9848 (Output_data_got::add_local_with_rela): Likewise.
9849 (Output_data_got::add_local_pair_with_rel): New function.
9850 (Output_data_got::add_local_pair_with_rela): New function.
9851 (Output_data_got::add_global_tls): Removed.
9852 (Output_data_got::add_global_tls_with_rel): Removed.
9853 (Output_data_got::add_global_tls_with_rela): Removed.
9854 (Output_data_got::add_local_tls): Removed.
9855 (Output_data_got::add_local_tls_with_rel): Removed.
9856 (Output_data_got::add_local_tls_with_rela): Removed.
9857 * resolve.cc (Symbol::override_base_with_special): Removed
9858 reference to has_got_offset_ field.
9859 * symtab.cc (Symbol::init_fields): Replaced initialization
9860 of got_offset_ with got_offsets_. Removed initialization
9861 of has_got_offset_
53fcba31 9862 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
9863 (Symbol::got_offset): Likewise.
9864 (Symbol::set_got_offset): Likewise.
9865 (Symbol::has_tls_got_offset): Removed.
9866 (Symbol::tls_got_offset): Removed.
9867 (Symbol::set_tls_got_offset): Removed.
9868 (Symbol::got_offset_): Removed.
9869 (Symbol::tls_mod_got_offset_): Removed.
9870 (Symbol::tls_pair_got_offset_): Removed.
9871 (Symbol::got_offsets_): New field.
9872 (Symbol::has_got_offset): Removed.
9873 (Symbol::has_tls_mod_got_offset): Removed.
9874 (Symbol::has_tls_pair_got_offset): Removed.
9875 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
9876 (Target_x86_64::Scan::local): Updated callers of Output_data_got
9877 member functions.
9878 (Target_x86_64::Scan::global): Likewise.
9879 (Target_x86_64::Relocate::relocate): Likewise.
9880 (Target_x86_64::Relocate::relocate_tls): Likewise.
9881
bd52eafb
BE
98822008-03-25 Ben Elliston <bje@au.ibm.com>
9883
9884 * yyscript.y: Fix spelling error in comment.
9885
8b105e34
ILT
98862008-03-24 Ian Lance Taylor <iant@google.com>
9887
8ed814a9
ILT
9888 * options.h (class General_options): Define build_id option.
9889 * layout.h (class Layout): Declare write_build_id, create_note,
9890 create_build_id. Add build_id_note_ member.
9891 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
9892 "libiberty.h", "md5.h", "sha1.h".
9893 (Layout::Layout): Initialize eh_frame_data_,
9894 eh_frame_hdr_section_, and build_id_note_.
9895 (Layout::finalize): Call create_build_id.
9896 (Layout::create_note): New function, broken out of
9897 Layout::create_gold_note.
9898 (Layout::create_gold_note): Call create_note.
9899 (Layout::create_build_id): New function.
9900 (Layout::write_build_id): New function.
9901 (Close_task_runner::run): Call write_build_id.
9902
8b105e34
ILT
9903 * x86_64.cc: Correct license to GPLv3.
9904
086a1841
ILT
99052008-03-23 Ian Lance Taylor <iant@google.com>
9906
9907 * options.cc: Include "demangle.h".
9908 (parse_optional_string): New function.
9909 (parse_long_option): Handle takes_optional_argument.
9910 (parse_short_option): Update dash_z initializer. Handle
9911 takes_optional_argument.
9912 (General_options::General_options): Initialize do_demangle_.
9913 (General_options::finalize): Set do_demangle_. Handle demangling
9914 style.
9915 * options.h (parse_optional_string): Declare.
9916 (struct One_option): Add optional_arg field. Update constructor.
9917 Update call constructor calls. Add takes_optional_argument
9918 function.
9919 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
9920 (DEFINE_optional_string): Define.
9921 (General_options::demangle): Change from DEFINE_bool to
9922 DEFINE_optional_string.
9923 (General_options::no_demangle): New function.
9924 (General_options::do_demangle): New function.
9925 (General_options::set_do_demangle): New function.
9926 (General_options::execstack_status_): Move definition to end of
9927 class definition.
9928 (General_options::static_): Likewise.
9929 (General_options::do_demangle_): New field.
9930 * object.cc (big_endian>::get_symbol_location_info): Call
9931 Options::do_demangle, not Options::demangle.
9932 * symtab.cc (demangle): Likewise.
9933
cbb93e63
ILT
99342008-03-22 Ian Lance Taylor <iant@google.com>
9935
9936 * gold.h: Include <cstddef> and <sys/types.h>
9937 * options.h: Include <cstring>.
9938
ec531623
ILT
99392008-03-21 Ian Lance Taylor <iant@google.com>
9940
9941 * Added source code to GNU binutils.
This page took 0.58408 seconds and 4 git commands to generate.