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