2009-10-28 Kai Tietz <kai.tietz@onevision.com>
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
2c849493
ILT
12009-10-27 Mikolaj Zalewski <mikolajz@google.com>
2
3 * fileread.cc: (File_read::View::~View): Use the new
4 data_ownership_ filed.
5 (File_read::~File_read): Dispose the new whole_file_view_.
6 (File_read::open): Mmap the whole file if needed.
7 (File_read::open): Use whole_file_view_ instead of contents_.
8 (File_read::find_view): Use whole_file_view_ if applicable.
9 (File_read::do_read): Use whole_file_view_ instead of contents_.
10 (File_read::make_view): Use whole_file_view_ instead of contents_,
11 update File_read::View::View call.
12 (File_read::find_or_make_view): Update File_read::View::View
13 call.
14 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
15 remove contents_
16 (File_read::View::Data_ownership): New enum.
17 (File_read::View::View): Replace bool mapped_ with Data_ownership
18 argument.
19 (File_read::View::mapped_): Remove (replaced by data_ownership_).
20 (File_read::View::data_ownership_): New field.
21 (File_read::contents_): Remove (replaced by whole_file_view_).
22 (File_read::whole_file_view_): New field.
23 * options.h (class General_options): Add --keep-files-mapped.
24
24998053
CC
252009-10-27 Cary Coutant <ccoutant@google.com>
26
27 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
28 * testsuite/Makefile.am (plugin_test_5): New test case.
29 * testsuite/Makefile.in: Regenerate.
30
72adc4fa
DK
312009-10-25 Doug Kwan <dougkwan@google.com>
32
33 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
34 from private to protected to allow access by child class.
35 (Sized_relobj::do_relocate_sections): New method declaration.
36 (Sized_relobj::relocate_sections): Virtualize.
37 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
38 Sized_relobj::relocate_sections. Instantiate template explicitly
39 for different target sizes and endianity.
40
07f508a2
DK
412009-10-24 Doug Kwan <dougkwan@google.com>
42
43 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
44 (Arm_input_section::as_arm_input_section): New method.
45 (Arm_output_section): New class definition.
46 (Arm_output_section::create_stub_group,
47 Arm_output_section::group_sections): New method definitions.
48
10ad9fe5
DK
492009-10-22 Doug Kwan <dougkwan@google.com>
50
51 * arm.cc (Arm_input_section): New class definition.
52 (Arm_input_section::init, Arm_input_section:do_write,
53 Arm_input_section::set_final_data_size,
54 Arm_input_section::do_reset_address_and_file_offset): New method
55 definitions.
56
56ee5e00
DK
572009-10-21 Doug Kwan <dougkwan@google.com>
58
59 * arm.cc (Stub_table, Arm_input_section): New forward class
60 declarations.
61 (Stub_table): New class defintion.
62 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
63 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
64 New method definition.
65
b569affa
DK
662009-10-21 Doug Kwan <dougkwan@google.com>
67
68 * arm.cc: Update copyright comments.
69 (Target_arm): New forward class template declaration.
70 (Arm_address): New type.
71 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
72 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
73 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
74 constants.
75 (Insn_template): Same.
76 (DEF_STUBS): New macro.
77 (Stub_type): New enum type.
78 (Stub_template): New class definition.
79 (Stub): Same.
80 (Reloc_stub): Same.
81 (Stub_factory): Same.
82 (Target_arm::Target_arm): Initialize may_use_blx_ and
83 should_force_pic_veneer_.
84 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
85 Target_arm::should_force_pic_veneer,
86 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
87 Target_arm::using_thumb_only, Target_arm:;default_target): New
88 method defintions.
89 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
90 New data member declarations.
91 (Insn_template::size, Insn_template::alignment): New method defintions.
92 (Stub_template::Stub_template): New method definition.
93 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
94 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
95 (Stub_factory::Stub_factory): New method definition.
96 * gold.h (string_hash): New template.
97 * output.h (Input_section_specifier::hash_value): Use
98 gold::string_hash.
99 (Input_section_specifier::string_hash): Remove.
100 * stringpool.cc (Stringpool_template::string_hash): Use
101 gold::string_hash.
102
6c172549
DK
1032009-10-20 Doug Kwan <dougkwan@google.com>
104
105 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
106 symbols of relaxed input sections.
107 * output.h (Output_section::find_relaxed_input_section): Make
108 method public.
109
c5617f2f
DK
1102009-10-16 Doug Kwan <dougkwan@google.com>
111
112 * dynobj.cc (Versions::Versions): Initialize version_script_.
113 Only insert base version symbol definition for a shared object
114 if version script defines any version versions.
115 (Versions::define_base_version): New method definition.
116 (Versions::add_def): Check that base version is not needed.
117 (Versions::add_need): Define base version lazily.
118 * dynobj.h (Versions::define_base_version): New method declaration.
119 (Versions::needs_base_version_): New data member declaration.
120 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
121 (check_DATA): Add no_version_test.stdout.
122 (libno_version_test.so, no_version_test.o no_version_test.stdout):
123 New make rules.
124 * testsuite/Makefile.in: Regenerate.
125 * testsuite/no_version_test.c: New file.
126 * testsuite/no_version_test.sh: Ditto.
127
3c12dcdb
DK
1282009-10-16 Doug Kwan <dougkwan@google.com>
129
130 * expression.cc (class Segment_start_expression): New class definition.
131 (Segment_start_expression::value): New method definition.
132 (script_exp_function_segment_start): Return a new
133 Segment_start_expression.
134 * gold/script-c.h (script_saw_segment_start_expression): New function
135 prototype.
136 * script-sections.cc (Script_sections::Script_sections): Initialize
137 SAW_SEGMENT_START_EXPRESSION_ to false.
138 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
139 and -Tbbs options to specify section addresses if given in
140 command line and no SEGMENT_START expression is seen in a script.
141 * script-sections.h (Script_sections::saw_segment_start_expression,
142 Script_sections::set_saw_segment_start_expression): New method
143 definition.
144 (Script_sections::saw_segment_start_expression_): New data member
145 declaration.
146 * script.cc (script_saw_segment_start_expression): New function.
147 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
148 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
149 script_test_7.sh and script_test_8.sh.
150 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
151 script_test_8.stdout.
152 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
153 (script_test_6, script_test_6.stdout, script_test_7,
154 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
155 * Makefile.in: Regenerate.
156 * testsuite/script_test_6.sh: New file.
157 * testsuite/script_test_6.t: Same.
158 * testsuite/script_test_7.sh: Same.
159 * testsuite/script_test_7.t: Same.
160 * testsuite/script_test_8.sh: Same.
161
64b1ae37
DK
1622009-10-16 Doug Kwan <dougkwan@google.com>
163
164 * output.cc (Output_segment::set_section_list_address): Cast
165 expressions to unsigned long long type to avoid format warnings.
166
661be1e2
ILT
1672009-10-15 Ian Lance Taylor <iant@google.com>
168
12edd763
ILT
169 * script.cc (Script_options::add_symbol_assignment): Always add a
170 dot assginment to script_sections_.
171 * script-sections.cc (Script_sections::add_dot_assignment):
172 Initialize if necessary.
173
68b6574b
ILT
174 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
175 program headers with no load segment if there is a linker script.
176
661be1e2
ILT
177 * layout.cc (Layout::set_segment_offsets): Align the file offset
178 to the segment aligment for -N or -n with no load segment.
179 * output.cc (Output_segment::add_output_section): Don't crash if
180 the first section is a TLS section.
181 (Output_segment::set_section_list_addresses): Print an error
182 message if the address moves backward in a linker script.
183 * script-sections.cc
184 (Output_section_element_input::set_section_addresses): Don't
185 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
186 (Orphan_output_section::set_section_addresses): Likewise.
187
f15f61a7
DK
1882009-10-15 Doug Kwan <dougkwan@google.com>
189
190 * layout.cc (Layout::finish_dynamic_section): Generate tags
191 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
192 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
193 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
194
82bb573a
ILT
1952009-10-14 Ian Lance Taylor <iant@google.com>
196
197 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
198 fields.
199 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
200 data_shdr fields of relinfo.
201 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
202 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
203 R_386_TLS_LDO_32, adjust based on section flags.
204 (Target_i386::Relocate::fix_up_ldo): Remove.
205
374ad285
ILT
2062009-10-13 Ian Lance Taylor <iant@google.com>
207
208 Add support for -pie.
209 * options.h (class General_options): Add -pie and
210 --pic-executable.
211 (General_options::output_is_position_independent): Test -pie.
212 (General_options::output_is_executable): Return true if not shared
213 and not relocatable.
214 (General_options::output_is_pie): Remove.
215 * options.cc (General_options::finalize): Reject incompatible uses
216 of -pie.
217 * gold.cc (queue_middle_tasks): A -pie link is not static.
218 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
219 * symtab.cc (Symbol::final_value_is_known): Return false if
220 output_is_position_independent.
221 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
222 output_is_position_independent.
223 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
224 output_is_position_independent.
225 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
226 output_is_position_independent.
227 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
228 two_file_pie_test.
229 (basic_pie_test.o, basic_pie_test): New targets.
230 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
231 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
232 (two_file_pie_test): New target.
233 * testsuite/Makefile.in: Rebuild.
234 * README: Remove note saying that -pie is not supported.
235
c6585162
ILT
2362009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
237
238 * options.h (class General_options): Add -init and -fini.
239 * layout.cc (Layout::finish_dynamic_section): Emit
240 given init and fini functions.
241
032ce4e9
ST
2422009-10-13 Sriraman Tallam <tmsriram@google.com>
243
244 * gc.h (gc_process_relocs): Check if icf is enabled using new
245 function.
246 * gold.cc (queue_initial_tasks): Likewise.
247 (queue_middle_tasks): Likewise.
248 * object.cc (do_layout): Likewise.
249 * symtab.cc (is_section_folded): Likewise.
250 * main.cc (main): Likewise.
251 * reloc.cc (Read_relocs::run): Likewise.
252 (Sized_relobj::do_scan_relocs): Likewise.
253 * icf.cc (is_function_ctor_or_dtor): New function.
254 (Icf::find_identical_sections): Check if function is ctor or dtor when
255 safe icf is chosen.
256 * options.h (General_options::icf): Change option to be an enum.
257 (Icf_status): New enum.
258 (icf_enabled): New method.
259 (icf_safe_folding): New method.
260 (set_icf_status): New method.
261 (icf_status_): New variable.
262 * (options.cc) (General_options::finalize): Set icf_status_.
263 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
264 icf_test and icf_keep_unique_test to use the --icf enum flag.
265 * testsuite/icf_safe_test.sh: New file.
266 * testsuite/icf_safe_test.cc: New file.
267
f345227a
ST
2682009-10-12 Sriraman Tallam <tmsriram@google.com>
269
270 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
271 includes to gc.h and icf.h.
272 * arm.cc: Include gc.h.
273 * gold.cc: Likewise.
274 * i386.cc: Likewise.
275 * powerpc.cc: Likewise.
276 * sparc.cc: Likewise.
277 * x86_64.cc: Likewise.
278 * gc.h: Include icf.h.
279
1c7814ed
ILT
2802009-10-11 Ian Lance Taylor <iant@google.com>
281
282 * plugin.cc: Include "gold.h" before other header files.
283
ae3b5189
CD
2842009-10-10 Chris Demetriou <cgd@google.com>
285
286 * options.h (Input_file_argument::Input_file_type): New enum.
287 (Input_file_argument::is_lib_): Replace with...
288 (Input_file_argument::type_): New member.
289 (Input_file_argument::Input_file_argument): Take Input_file_type
290 'type' rather than boolean 'is_lib' as second argument.
291 (Input_file_argument::is_lib): Use type_.
292 (Input_file_argument::is_searched_file): New function.
293 (Input_file_argument::may_need_search): Handle is_searched_file.
294 * options.cc (General_options::parse_library): Support -l:filename.
295 (General_options::parse_just_symbols): Update for Input_file_argument
296 changes.
297 (Command_line::process): Likewise.
298 * archive.cc (Archive::get_file_and_offset): Likewise.
299 * plugin.cc (Plugin_manager::release_input_file): Likewise.
300 * script.cc (read_script_file, script_add_file): Likewise.
301 * fileread.cc (Input_file::Input_file): Likewise.
302 (Input_file::will_search_for): Handle is_searched_file.
303 (Input_file::open): Likewise.
304 * readsyms.cc (Read_symbols::get_name): Likewise.
305 * testsuite/Makefile.am (searched_file_test): New test.
306 * testsuite/Makefile.in: Regenerate.
307 * testsuite/searched_file_test.cc: New file.
308 * testsuite/searched_file_test_lib.cc: New file.
309
f3048a1d
ILT
3102009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
311 Ian Lance Taylor <iant@google.com>
312
313 * descriptor.cc: Include <cstdio> and "binary-io.h".
314 (Descriptors::open): Open the files in binary mode always.
315 * script.cc (Lex::get_token): Treat \r as whitespace.
316
d4780e57
ILT
3172009-10-09 Ian Lance Taylor <iant@google.com>
318
319 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
320
d9a893b8
ILT
3212009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
322 Ian Lance Taylor <iant@google.com>
323
324 * configure.ac: Check for readv function also.
325 * fileread.cc (readv): Define if not HAVE_READV.
326 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
327 does not exist.
328 * config.in: Regenerate.
329 * configure: Regenerate.
330
c0a62865
DK
3312009-10-09 Doug Kwan <dougkwan@google.com>
332
333 * layout.cc (Layout::make_output_section): Call target hook to make
334 ordinary output section.
335 (Layout::finalize): Adjust parameter list of call the
336 Target::may_relax().
337 * layout.h (class Layout::section_list): New method.
338 * merge.h (Output_merge_base::entsize): Change visibility to public.
339 (Output_merge_base::is_string, Output_merge_base::do_is_string):
340 New methods.
341 (Output_merge_string::do_is_string): New method.
342 * object.cc (Sized_relobj::do_setup): renamed from
343 Sized_relobj::set_up.
344 * object.h (Sized_relobj::adjust_shndx,
345 Sized_relobj::initializ_input_to_output_maps,
346 Sized_relobj::free_input_to_output_maps): Change visibilities to
347 protected.
348 (Sized_relobj::setup): Virtualize.
349 (Sized_relobj::do_setup): New method declaration.
350 (Sized_relobj::invalidate_section_offset,
351 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
352 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
353 * options.cc (parse_int): New function.
354 * options.h (parse_int): New declaration.
355 (DEFINE_int): New macro.
356 (stub_group_size): New option.
357 * output.cc (Output_section::Output_section): Initialize memebers
358 merge_section_map_, merge_section_by_properties_map_,
359 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
360 (Output_section::add_input_section): Handled deferred code-fill
361 generation and remove an old comment.
362 (Output_section::add_relaxed_input_section): New method definition.
363 (Output_section::add_merge_input_section): Use merge section by
364 properties map to speed to search. Update merge section maps
365 as appropriate.
366 (Output_section::build_relaxation_map): New method definition.
367 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
368 Same.
369 (Output_section::relax_input_section): Renamed to
370 Output_section::convert_input_sections_to_relaxed_sections and change
371 interface to take a vector of pointers to relaxed sections.
372 (Output_section::find_merge_section,
373 Output_section::find_relaxed_input_section): New method definitions.
374 (Output_section::is_input_address_mapped,
375 Output_section::output_offset, Output_section::output_address):
376 Use output section data maps to speed up searching.
377 (Output_section::find_starting_output_address): Add comments.
378 (Output_section::do_write,
379 Output_section::write_to_postprocessing_buffer): Do code-fill
380 generation as appropriate.
381 (Output_section::get_input_sections): Invalidate relaxed input section
382 map.
383 (Output_section::restore_states): Adjust type of checkpoint .
384 Invalidate relaxed input section map.
385 * output.h (Output_merge_base): New class declaration.
386 (Input_section_specifier): New class defintion.
387 (class Output_relaxed_input_section) Change base class to
388 Output_section_data_build.
389 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
390 base class initializer.
391 (Output_section::add_relaxed_input_section): New method declaration.
392 (Output_section::Input_section): Change visibility to protected.
393 (Output_section::Input_section::relobj,
394 Output_section::Input_section::shndx): Handle relaxed input sections.
395 Output_section::input_sections) Change visibility to protected. Also
396 define overload to return a non-const pointer.
397 (Output_section::Merge_section_properties): New class defintion.
398 (Output_section::Merge_section_by_properties_map,
399 Output_section::Output_section_data_by_input_section_map,
400 Output_section::Relaxation_map): New types.
401 (Output_section::relax_input_section): Rename method to
402 Output_section::convert_input_sections_to_relaxed_sections and change
403 interface to take a vector of relaxed section pointers.
404 (Output_section::find_merge_section,
405 Output_section::find_relaxed_input_section,
406 Output_section::build_relaxation_map,
407 Output_section::convert_input_sections_in_list_to_relaxed_sections):
408 New method declarations.
409 (Output_section::merge_section_map_
410 Output_section::merge_section_by_properties_map_,
411 Output_section::relaxed_input_section_map_,
412 Output_section::is_relaxed_input_section_map_valid_,
413 Output_section::generate_code_fills_at_write_): New data members.
414 * script-sections.cc
415 (Output_section_element_input::set_section_addresses): Call
416 current_data_size and addralign methods of relaxed input sections.
417 (Orphan_output_section::set_section_addresses): Call current_data_size
418 and addralign methods of relaxed input sections.
419 * symtab.cc (Symbol_table::compute_final_value): Extract template
420 from the body of Symbol_table::sized_finalize_symbol.
421 (Symbol_table::sized_finalized_symbol): Call
422 Symbol_table::compute_final_value.
423 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
424 (Symbol_table::compute_final_value): New templated method declaration.
425 * target.cc (Target::do_make_output_section): New method defintion.
426 * target.h (Target::make_output_section): New method declaration.
427 (Target::relax): Add more parameters for input objects, symbol table
428 and layout. Adjust call to do_relax.
429 (Target::do_make_output_section): New method declaration.
430 (Target::do_relax): Add parameters for input objects, symbol table
431 and layout.
432
d446d6c4
ILT
4332009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
434
435 * pread.c: Include stdio.h.
436
bc06c745
ILT
4372009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
438
439 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
440 defined.
441
75aea3d0
ILT
4422009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
443
444 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
445 Change read_shndx type to unsigned int.
446 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
447 int.
448 (Sized_dwarf_line_info::read_line_mappings): Likewise.
449 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
450 Change read_shndx type to unsigned int.
451 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
452 int.
453 (Sized_dwarf_line_info::read_line_mappings): Likewise.
454 * layout.cc (Layout::create_symtab_sections): Cast the result of
455 local_symcount * symsize to off_t in the gold_assert.
456
be8fcb75
ILT
4572009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
458
459 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
460 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
461 R_ARM_BASE_ABS.
462 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
463 (Arm_relocate_functions::thm_abs5): New function.
464 (Arm_relocate_functions::abs12): New function.
465 (Arm_relocate_functions::abs16): New function.
466 (Arm_relocate_functions::base_abs): New function.
467 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
468 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
469 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
470 R_ARM_BASE_ABS.
471 (Scan::global): Likewise.
472 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
473 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
474 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
475 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
476 R_ARM_BASE_ABS.
477
c2a122b6
ILT
4782009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
479
480 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
481 (Arm_relocate_functions::movt_prel): New function.
482 (Arm_relocate_functions::thm_movw_prel_nc): New function.
483 (Arm_relocate_functions::thm_movt_prel): New function.
484 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
485 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
486 (Scan::global, Relocate::relocate): Likewise.
487 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
488
c4aa1e2d
ILT
4892009-10-09 Mikolaj Zalewski <mikolajz@google.com>
490
491 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
492 Incremental_checker.
493 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
494 unsigned int.
495 (class Incremental_inputs_header): New class.
496 (Incremental_inputs_header_writer): Edit comment.
497 (Incremental_inputs_entry): New class.
498 (Incremental_inputs_entry_writer): Edit comment.
499 (Sized_incremental_binary::do_find_incremental_inputs_section):
500 Add *strtab_shndx parameter, fill it.
501 (Sized_incremental_binary::do_check_inputs): New method.
502 (Incremental_checker::can_incrementally_link_output_file): Use
503 Sized_incremental_binary::check_inputs.
504 (Incremental_inputs::report_command_line): Save command line in
505 command_line_.
506 * incremental.h:
507 (Incremental_binary::find_incremental_inputs_section): New
508 method.
509 (Incremental_binary::do_find_incremental_inputs_section): Add
510 strtab_shndx parameter.
511 (Incremental_binary::do_check_inputs): New pure virtual method.
512 (Sized_incremental_binary::do_check_inputs): Declare.
513 (Incremental_checker::Incremental_checker): Add incremental_inputs
514 parameter, use it to initialize incremental_inputs_.
515 (Incremental_checker::incremental_inputs_): New field.
516 (Incremental_checker::command_line): New method.
517 (Incremental_checker::inputs): New method.
518 (Incremental_checker::command_line_): New field.
519
c549a694
ILT
5202009-10-09 Mikolaj Zalewski <mikolajz@google.com>
521
522 * incremental.cc: Include <cstdarg> and "target-select.h".
523 (vexplain_no_incremental): New function.
524 (explain_no_incremental): New function.
525 (Incremental_binary::error): New method.
526 (Sized_incremental_binary::do_find_incremental_inputs_section): New
527 method.
528 (make_sized_incremental_binary): New function.
529 (open_incremental_binary): New function.
530 (can_incrementally_link_file): Add checks if output is ELF and has
531 inputs section.
532 * incremental.h: Include "elfcpp_file.h" and "output.h".
533 (Incremental_binary): New class.
534 (Sized_incremental_binary): New class.
535 (open_incremental_binary): Declare.
536 * object.cc (is_elf_object): Use
537 elfcpp::Elf_recognizer::is_elf_file.
538 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
539 * output.h (Output_file::filesize): New method.
540
fd3c5f0b
ILT
5412009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
542
543 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
544 New function.
545 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
546 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
547 function.
548 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
549 function.
550 (Arm_relocate_functions::movw_abs_nc): New function.
551 (Arm_relocate_functions::movt_abs): New function.
552 (Arm_relocate_functions::thm_movw_abs_nc): New function.
553 (Arm_relocate_functions::thm_movt_abs): New function.
554 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
555 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
556 (Scan::global): Likewise.
557 (Relocate::relocate): Likewise.
558 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
559
7f5309a5
ILT
5602009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
561
562 * arm.cc (Arm_relocate_functions::got_prel) New function.
563 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
564 (Relocate::relocate): Likewise.
565 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
566
364c7fa5
ILT
5672009-10-06 Ian Lance Taylor <iant@google.com>
568
569 * options.h (class General_options): Define
570 split_stack_adjust_size parameter.
571 * object.h (class Object): Add uses_split_stack_ and
572 has_no_split_stack_ fields. Add uses_split_stack and
573 has_no_split_stack accessor functions. Declare
574 handle_split_stack_section.
575 (class Reloc_symbol_changes): Define.
576 (class Sized_relobj): Define Function_offsets. Declare
577 split_stack_adjust, split_stack_adjust_reltype, and
578 find_functions.
579 * object.cc (Object::handle_split_stack_section): New function.
580 (Sized_relobj::do_layout): Call handle_split_stack_section.
581 * dynobj.cc (Sized_dynobj::do_layout): Call
582 handle_split_stack_section.
583 * reloc.cc (Sized_relobj::relocate_sections): Call
584 split_stack_adjust for executable sections in split_stack
585 objects. Pass reloc_map to relocate_section.
586 (Sized_relobj::split_stack_adjust): New function.
587 (Sized_relobj::split_stack_adjust_reltype): New function.
588 (Sized_relobj::find_functions): New function.
589 * target-reloc.h: Include "object.h".
590 (relocate_section): Add reloc_symbol_changes parameter. Change
591 all callers.
592 * target.h (class Target): Add calls_non_split method. Declare
593 do_calls_non_split virtual method. Declare match_view and
594 set_view_to_nop.
595 * target.cc: Include "elfcpp.h".
596 (Target::do_calls_non_split): New function.
597 (Target::match_view): New function.
598 (Target::set_view_to_nop): New function.
599 * gold.cc (queue_middle_tasks): Give an error if mixing
600 split-stack and non-split-stack objects with -r.
601 * i386.cc (Target_i386::relocate_section): Add
602 reloc_symbol_changes parameter.
603 (Target_i386::do_calls_non_split): New function.
604 * x86_64.cc (Target_x86_64::relocate_section): Add
605 reloc_symbol_changes parameter.
606 (Target_x86_64::do_calls_non_split): New function.
607 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
608 parameter.
609 * powerpc.cc (Target_powerpc::relocate_section): Add
610 reloc_symbol_changes parameter.
611 * sparc.cc (Target_sparc::relocate_section): Add
612 reloc_symbol_changes parameter.
613 * configure.ac: Call AM_CONDITIONAL for the default target.
614 * configure: Rebuild.
615 * testsuite/Makefile.am (TEST_AS): New variable.
616 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
617 (check_DATA): Add split_i386 and split_x86_64 files.
618 (SPLIT_DEFSYMS): Define.
619 (split_i386_[1234n].o): New targets.
620 (split_i386_[124]): New targets.
621 (split_i386_[1234r].stdout): New targets.
622 (split_x86_64_[1234n].o): New targets.
623 (split_x86_64_[124]): New targets.
624 (split_x86_64_[1234r].stdout): New targets.
625 (MOSTLYCLEANFILES): Add new executables.
626 * testsuite/split_i386.sh: New file.
627 * testsuite/split_x86_64.sh: New file.
628 * testsuite/split_i386_1.s: New file.
629 * testsuite/split_i386_2.s: New file.
630 * testsuite/split_i386_3.s: New file.
631 * testsuite/split_i386_4.s: New file.
632 * testsuite/split_i386_n.s: New file.
633 * testsuite/split_x86_64_1.s: New file.
634 * testsuite/split_x86_64_2.s: New file.
635 * testsuite/split_x86_64_3.s: New file.
636 * testsuite/split_x86_64_4.s: New file.
637 * testsuite/split_x86_64_n.s: New file.
638 * testsuite/testfile.cc (Target_test): Update relocation_section
639 function.
640 * testsuite/Makefile.in: Rebuild.
641
e8a9fcda
ILT
6422009-10-06 Ian Lance Taylor <iant@google.com>
643
644 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
645 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
646 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
647 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
648 the address on ldo_addrs_.
649 (Target_i386::Relocate::fix_up_ldo): New function.
650
e99daf92
ILT
6512009-10-06 Rafael Espindola <espindola@google.com>
652
653 * plugin.cc (add_input_library): New.
654 (Plugin::load): Add add_input_library to tv.
655 (Plugin_manager::add_input_file): Add the is_lib argument.
656 (add_input_file): Update call to Plugin_manager::add_input_file.
657 (add_input_library): New.
658 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
659
966d4097
DK
6602009-09-30 Doug Kwan <dougkwan@google.com>
661
662 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
663 symbol and call Symbol::may_need_copy_reloc to determine if
664 a copy reloc is needed.
665 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
666 nocopyreloc is given in command line.
667 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
668 given in command line.
669 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
670 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
671 of the removed Target_i386::may_need_copy_reloc.
672 * options.h (copyreloc): New option with default value false.
673 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
674 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
675 instead of the removed Target_powerpc::may_need_copy_reloc.
676 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
677 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
678 instead of the removed Target_sparc::may_need_copy_reloc.
679 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
680 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
681 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
682 instead of the removed Target_x86_64::may_need_copy_reloc.
683
029ba973
ILT
6842009-09-30 Ian Lance Taylor <iant@google.com>
685
686 * object.h (class Object): Remove target_ field, and target,
687 sized_target, and set_target methods.
688 (Object::sized_target): Remove.
689 (class Sized_relobj): Update declarations. Remove sized_target.
690 * object.cc (Sized_relobj::setup): Remove target parameter.
691 Change all callers.
692 (Input_objects::add_object): Don't do anything with the target.
693 (make_elf_sized_object): Add punconfigured parameter. Change all
694 callers. Set or test parameter target.
695 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
696 Change all callers.
697 * parameters.cc (Parameters::set_target): Change parameter type to
698 be non-const.
699 (Parameters::default_target): Remove.
700 (set_parameters_target): Change parameter type to be non-const.
701 (parameters_force_valid_target): New function.
702 (parameters_clear_target): New function.
703 * parameters.h (class Parameters): Update declarations. Remove
704 default_target method. Add sized_target and clear_target
705 methods. Change target_ to be non-const.
706 (set_parameters_target): Update declaration.
707 (parameters_force_valid_target): Declare.
708 (parameters_clear_target): Declare.
709 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
710 as NULL if we aren't searching.
711 (Add_symbols::run): Don't check for compatible target.
712 * fileread.cc (Input_file::open_binary): Call
713 parameters_force_valid_target.
714 * gold.cc (queue_middle_tasks): Likewise.
715 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
716 set_target on object.
717 * dynobj.h (class Sized_dynobj): Update declarations.
718 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
719 make_elf_object returns NULL.
720 (Archive::include_member): Don't check whether object target is
721 compatible.
722 * output.cc (Output_section::add_input_section): Get target from
723 parameters.
724 (Output_section::relax_input_section): Likewise.
725 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
726 parameters.
727 (Sized_relobj::do_scan_relocs): Likewise.
728 (Sized_relobj::relocate_sections): Likewise.
729 * resolve.cc (Symbol_table::resolve): Likewise.
730 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
731 parameter. Change all callers.
732 (Symbol_table::add_from_object): Get target from parameters.
733 (Symbol_table::add_from_relobj): Don't check object target.
734 (Symbol_table::add_from_dynobj): Likewise.
735 (Symbol_table::define_special_symbol): Get target from
736 parameters.
737 * symtab.h (class Symbol_table): Update declaration.
738 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
739 parameter. Change all callers. Clear parameter target.
740 (Binary_test): Test target here.
741 * testsuite/object_unittest.cc (gold_testsuite): Remove
742 target_test_pointer parameter. Change all callers.
743 (Object_test): Test target here.
744
a6a22b83
ILT
7452009-09-26 Ian Lance Taylor <iant@google.com>
746
747 * testsuite/initpri1.c: Don't try to use constructor priorities if
748 compiling with gcc before 4.3.
749
6a8f49fe
ILT
7502009-09-22 Mikolaj Zalewski <mikolajz@google.com>
751
752 * testsuite/retain_symbols_file_test.sh (check_present): Change
753 output file name to retain_symbols_file_test.stdout.
754 (check_absent): Likewise.
755
8c604651
CS
7562009-09-18 Craig Silverstein <csilvers@google.com>
757
758 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
759 * options.cc: Include <cerrno> and <fstream>.
760 (General_options::finalize): Parse -retain-symbols-file tag.
761 * options.h: New flag.
762 (General_options): New method should_retain_symbol, new
763 variable symbols_to_retain.
764 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
765 should_retain_symbol map.
766 * testsuite/Makefile.am (retain_symbols_file_test): New test.
767 * testsuite/Makefile.in: Regenerate.
768 * testsuite/retain_symbols_file_test.sh: New file.
769
ca58b19f
NC
7702009-09-18 Nick Clifton <nickc@redhat.com>
771
772 * po/es.po: Updated Spanish translation.
773
20e6d0d6
DK
7742009-09-17 Doug Kwan <dougkwan@google.com>
775
776 * debug.h (DEBUG_RELAXATION): New constant.
777 (DEBUG_ALL): Add DEBUG_RELAXATION.
778 (debug_string_to_enum): Add relaxation debug option.
779 * layout.cc
780 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
781 Layout::Relaxation_debug_check::read_sections,
782 Layout::Relaxation_debug_check::read_sections): New method definitions.
783 (Layout::Layout): Initialize data members
784 record_output_section_data_from_scrips_,
785 script_output_section_data_list_ and relaxation_debug_check_.
786 (Layout::save_segments, Layout::restore_segments,
787 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
788 Layout::relaxation_loop_body): New method definitions.
789 (Layout::finalize): Support relaxation. Move section layout code to
790 Layout::relaxation_loop_body.
791 (Layout::set_asection_address_from_script): Move code for orphan
792 section placement out.
793 (Layout::place_orphan_sections_in_script): New method definition.
794 * layout.h (Output_segment_headers, Output_file_header):
795 New forward class declarations.
796 (Layout::~Layout): Define.
797 (Layout::new_output_section_data_from_script): New method definition.
798 (Layout::place_orphan_sections_in_script): New method declaration.
799 (Layout::Segment_states): New type declaration.
800 (Layout::save_segments, Layout::restore_segments,
801 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
802 Layout::relaxation_loop_body): New method declarations.
803 (Layout::Output_section_data_list): New type declaration.
804 (Layout::Relaxation_debug_check): New class definition.
805 (Layout::record_output_section_data_from_script_,
806 Layout::script_output_section_data_list_, Layout::segment_states_,
807 Layout::relaxation_debug_check_): New data members.
808 * output.cc: (Output_section_headers::do_size): New method definition.
809 (Output_section_headers::Output_section_headers): Move size
810 computation to Output_section_headers::do_size.
811 (Output_segment_headers::do_size): New method definition.
812 (Output_file_header::Output_file_header): Move size computation to
813 Output_file_header::do_size and call it.
814 (Output_file_header::do_size): New method definition.
815 (Output_data_group::Output_data_group): Adjust call to
816 Output_section_data.
817 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
818 (Output_symtab_xindex::do_write): Add array bound check.
819 (Output_section::Input_section::print_to_mapfile): Handle
820 RELAXED_INPUT_SECTION_CODE.
821 (Output_section::Output_section): Initialize data member checkpoint_.
822 (Output_section::~Output_section): Delete checkpoint object pointed
823 by checkpoint_.
824 (Output_section::add_input_section): Always add an Input_section if
825 relaxing.
826 (Output_section::add_merge_input_section): Add assert.
827 (Output_section::relax_input_section): New method definition.
828 (Output_section::set_final_data_size): Set load address to zero for
829 an unallocated section.
830 (Output_section::do_address_and_file_offset_have_reset_values):
831 New method definition.
832 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
833 Handle relaxed input section.
834 (Output_section::sort_attached_input_sections): Checkpoint input
835 section list lazily.
836 (Output_section::get_input_sections): Change type of input_sections to
837 list of Simple_input_section pointers. Checkpoint input section list
838 lazily. Also handle relaxed input sections.
839 (Output_section::add_input_section_for_script): Take a reference to
840 a Simple_input_section object instead of Relobj pointer and section
841 index as parameter. Handle relaxed input sections.
842 (Output_section::save_states, Output_section::restore_states): New
843 method definitions.
844 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
845 (Output_data::is_data_size_fixed): New method definition.
846 (Output_data::reset_addresss_and_file_offset): Do not reset data size
847 if it is fixed.
848 (Output_data::address_and_file_offset_have_reset_values): New method
849 definition.
850 (Output_data::do_address_and_file_offset_have_reset_values): New method
851 definition.
852 (Output_data::set_data_size): Check that data size is not fixed.
853 (Output_data::fix_data_size): New method definition.
854 (Output_data::is_data_size_fixed_): New data member.
855 (Output_section_headers::set_final_data_size): New method definition.
856 (Output_section_headers::do_size): New method declaration.
857 (Output_segment_headers::set_final_data_size): New method definition.
858 (Output_segment_headers::do_size): New method declaration.
859 (Output_file_header::set_final_data_size)::New method definition.
860 (Output_file_header::do_size)::New method declaration.
861 (Output_section_data::Output_section_data): Add new parameter
862 is_data_size_fixed and use it to fix data size.
863 (Output_data_const::Output_data_const): Adjust call to base class
864 constructor and fix data size.
865 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
866 base class constructor and fix data size.
867 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
868 base class constructor and fix data size.
869 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
870 class constructor and fix data size.
871 (Output_data_group::set_final_data_size): New method definition.
872 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
873 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
874 class constructor and fix data size.
875 (Output_relaxed_input_section): New class definition.
876 (Output_section::Simple_input_section): New class definition.
877 (Output_section::get_input_sections): Adjust parameter list.
878 (Output_section::add_input_section_for_script): Same.
879 (Output_section::save_states, Output_section::restore_states,
880 Output_section::do_address_and_file_offset_have_reset_values,
881 (Output_section::Input_section::Input_section): Handle
882 RELAXED_INPUT_SECTION_CODE. Add new overload for
883 Output_relaxed_input_section.
884 (Output_section::Input_section::is_input_section,
885 Output_section::Input_section::set_output_section): Handle relaxed
886 input section.
887 (Output_section::Input_section::is_relaxed_input_section,
888 Output_section::Input_section::output_section_data,
889 Output_section::Input_section::relaxed_input_section): New method
890 definitions.
891 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
892 value.
893 (Output_section::Input_section::u1_): Update comments.
894 (Output_section::Input_section::u2_): Add new union member poris.
895 (Output_section::Checkpoint_output_section): New classs definition.
896 (Output_section::relax_input_section): New method declaration.
897 (Output_section::checkpoint_): New data member.
898 (Output_segment): Update comments.
899 (Output_segment::Output_segment): Un-privatize copy constructor.
900 (Output_segment::operator=): Un-privatize.
901 * script-sections.cc (Output_section_element::Input_section_list):
902 Change element type to Output_section::Simple_input_section.
903 (Output_section_element_dot_assignment::set_section_addresses):
904 Register output section data for relaxation clean up.
905 (Output_data_exression::Output_data_expression): Adjust call to base
906 constructor to fix data size.
907 (Output_section_element_data::set_section_addresses): Register
908 Output_data_expression object for relaxation clean up.
909 (struct Input_section_info): Replace Relobj pointer and section index
910 pair with Output_section::Simple_input_section and Convert struct to a
911 class.
912 (Input_section_sorter::operator()): Adjust access to
913 Input_section_info data member to use accessors.
914 (Output_section_element_input::set_section_addresses): Use layout
915 parameter. Adjust code to use Output_section::Simple_input_section
916 and Input_secction_info classes. Register filler for relaxation
917 clean up.
918 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
919 and section index pair with Output_section::Simple_input_section
920 class. Adjust code accordingly.
921 (Phdrs_element::release_segment): New method definition.
922 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
923 segment list.
924 (Script_sections::release_segments): New method definition.
925 * gold/script-sections.h (Script_sections::release_segments): New
926 method declaration.
927 * gold/target.h (Target::may_relax, Target::relax,
928 Target::do_may_relax, Target::do_relax): New method definitions.
929
5e445df6
ILT
9302009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
931
932 * arm.cc (has_signed_unsigned_overflow): New function.
933 (Arm_relocate_functions::abs8): New function.
934 (Target_arm::Scan::local): Handle R_ARM_ABS8.
935 (Target_arm::Scan::global): Likewise.
936 (Target_arm::relocate::relocate): Likewise.
937 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
938 Likewise.
939
8c604651 9402009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
941
942 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
943 * testsuite/Makefile.in: Regenerate.
944
1e9cc1c2
NC
9452009-09-11 Nick Clifton <nickc@redhat.com>
946
947 * po/gold.pot: Updated by the Translation project.
948
6a89f575
CC
9492009-09-08 Cary Coutant <ccoutant@google.com>
950
951 * output.cc (Output_file::open): Add execute permission to empty file.
952 * testsuite/Makefile.am (permission_test): New test.
953 * testsuite/Makefile.in: Regenerate.
954
fdcac5af
ILT
9552009-09-02 Ian Lance Taylor <iant@google.com>
956
957 * output.cc (Output_file::resize): Call map_no_anonymous rather
958 than map.
959
44453f85
ILT
9602009-09-01 Mikolaj Zalewski <mikolajz@google.com>
961
962 * gold.cc: Include "incremental.h".
963 (queue_initial_tasks): Call Incremental_checker methods.
964 * incremental.cc: Include "output.h".
965 (Incremental_checker::can_incrementally_link_output_file): New
966 method.
967 * incremental.h (Incremental_checker): New class.
968
969 * output.cc (Output_file::open_for_modification): New method.
970 (Output_file::map_anonymous): Changed return type to bool. Record
971 map in base_ field.
972 (Output_file::map_no_anonymous): New method, broken out of map.
973 (Output_file::map): Use map_no_anonymous and map_anonymous.
974 * output.h (class Output_file): Update declarations.
975
293c1386
CC
9762009-08-24 Cary Coutant <ccoutant@google.com>
977
978 * options.h (Command_line::Pre_options): New class.
979 (Command_line::pre_options): New member.
980 * options.cc (gold::options::ready_to_register): New variable.
981 (One_option::register_option): Do nothing if not registering options.
982 Assert if same short option registered twice.
983 (General_options::General_options): Turn off option registration when
984 done constructing.
985 (Command_line::Pre_options::Pre_options): New constructor.
986
f773f3d2
CC
9872009-08-24 Cary Coutant <ccoutant@google.com>
988
06a73cfe
CC
989 * options.h (General_options::no_keep_memory): Remove incorrect
990 short option.
f773f3d2 991
a15af8e2
RW
9922009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
993
994 * Makefile.am (am__skiplex, am__skipyacc): New.
995 * Makefile.in: Regenerate.
996
c462b41b
RW
9972009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
998
14ec8efd
RW
999 * Makefile.am (AM_CPPFLAGS): Renamed from ...
1000 (INCLUDES): ... this.
1001 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
1002 (AM_CPPFLAGS): Renamed from ...
1003 (INCLUDE): ... this.
1004 * Makefile.in, testsuite/Makefile.in: Regenerate.
1005
81ecdfbb
RW
1006 * Makefile.in: Regenerate.
1007 * aclocal.m4: Likewise.
1008 * config.in: Likewise.
1009 * configure: Likewise.
1010 * testsuite/Makefile.in: Likewise.
1011
c462b41b
RW
1012 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
1013 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
1014 * Makefile.in: Regenerate.
1015 * testsuite/Makefile.in: Regenerate.
1016
2da73f13
CC
10172009-08-19 Cary Coutant <ccoutant@google.com>
1018
1019 * resolve.cc (Symbol_table::resolve): Don't complain about defined
1020 symbols in shared libraries overridden by hidden or internal symbols
1021 in the main program.
1022
2db70501
CD
10232009-08-19 Chris Demetriou <cgd@google.com>
1024
1025 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
1026 checking source file names in error messages.
1027
f733487b
DK
10282009-08-18 Doug Kwan <dougkwan@google.com>
1029
1030 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
1031 an elcpp::Ehdr as parameter. Adjust call to set_target.
1032 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
1033 an elfcpp::Ehdr as parameter.
1034 * object.cc (Object::set_target): Remove the version that looks up
1035 a target and sets it.
1036 (Sized_relobj::setup): Take a Target object instead of
1037 an elfcpp::Ehdr as parameter. Adjust call to set_target.
1038 (make_elf_sized_object): Find target and ask target to
1039 make an ELF object.
1040 * object.h: (Object::set_target): Remove the version that looks up
1041 a target and sets it.
1042 (Sized_relobj::setup): Take a Target object instead of
1043 an elfcpp:Ehdr as parameter.
1044 * target.cc: Include dynobj.h.
1045 (Target::do_make_elf_object_implementation): New.
1046 (Target::do_make_elf_object): New.
1047 * target.h (Target::make_elf_object): New template declaration.
1048 (Target::do_make_elf_object): New method declarations.
1049 (Target::do_make_elf_object_implementation): New template declaration.
1050
cc70f101
ILT
10512009-08-14 Ian Lance Taylor <iant@google.com>
1052
1053 * gold.h (FUNCTION_NAME): Define.
1054 (gold_unreachable): Use FUNCTION_NAME.
1055
ef5e0cb1
ST
10562009-08-12 Sriraman Tallam <tmsriram@google.com>
1057
1058 * icf.cc (Icf::find_identical_sections): Issue a warning when a
1059 symbol in the --keep-unique list is not found.
1060
48c187ce
ST
10612009-08-12 Sriraman Tallam <tmsriram@google.com>
1062
1063 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
1064 been maked as --keep-unique.
1065 (Icf::unfold_section): New function.
1066 * icf.h (Icf::unfold_section): New function.
1067 * options.h (General_options::keep_unique): New option.
1068 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
1069 * testsuite/Makefile.in: Regenerate.
1070 * testsuite/icf_keep_unique_test.sh: New file.
1071 * testsuite/icf_keep_unique_test.cc: New file.
1072
645afe0c
CC
10732009-08-12 Cary Coutant <ccoutant@google.com>
1074
1075 PR 10471
1076 * resolve.cc (Symbol_table::resolve): Check for references from
1077 dynamic objects to hidden and internal symbols.
1078 * testsuite/Makefile.am (hidden_test.sh): New test.
1079 * testsuite/Makefile.in: Regenerate.
1080 * testsuite/hidden_test.sh: New script.
1081 * testsuite/hidden_test_1.c: New test source.
1082 * testsuite/hidden_test_main.c: New test source.
1083
11af873f
DK
10842009-08-11 Doug Kwan <dougkwan@google.com>
1085
1086 * arm.cc: Update comments.
1087 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
1088 segment to locate the .ARM.exidx section if present.
1089
b9f7d72d
DK
10902009-08-09 Doug Kwan <dougkwan@google.com>
1091
1092 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
1093 patch.
1094
ddd3c53c
ST
10952009-08-07 Sriraman Tallam <tmsriram@google.com>
1096 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
1097 compiler warnings.
1098
27721062
ST
10992009-08-06 Sriraman Tallam <tmsriram@google.com>
1100
1101 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
1102 valid tls_segment only for non-debug-section relocations.
1103 * testsuite/Makefile.am: Add gc_tls_test.
1104 * testsuite/Makefile.in: Regenerate.
1105 * testsuite/gc_tls_test.cc: New file.
1106 * testsuite/gc_tls_test.sh: New file.
1107
ef15dade
ST
11082009-08-05 Sriraman Tallam <tmsriram@google.com>
1109
1110 * icf.cc: New file.
1111 * icf.h: New file.
1112 * Makefile.am (CCFILES): Add icf.cc.
1113 (HFILES): Add icf.h
1114 * Makefile.in: Regenerate.
1115 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
1116 * gc.h (gc_process_relocs): Populate lists used by icf to contain
1117 section, symbol and addend information for the relocs.
1118 * gold.cc (queue_middle_tasks): Call identical code folding.
1119 * gold.h: Add defines for multimap.
1120 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
1121 to the call of finalize_local_symbols.
1122 * main.cc (main): Create object of class Icf.
1123 * object.cc (Sized_relobj::do_layout): Allow this function to be
1124 called twice during icf.
1125 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
1126 to sections marked as identical by icf.
1127 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
1128 when available.
1129 (Sized_relobj::do_section_entsize): New function.
1130 * object.h (Object::section_entsize): New function.
1131 (Object::do_section_entsize): New pure virtual function.
1132 (Relobj::finalize_local_symbols): Add new parameter.
1133 (Relobj::do_section_entsize): New function.
1134 * options.h (General_options::icf): New option.
1135 (General_options::icf_iterations): New option.
1136 (General_options::print_icf_sections): New option.
1137 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
1138 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
1139 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
1140 icf.
1141 * symtab.cc (Symbol_table::is_section_folded): New function.
1142 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
1143 to sections marked as identical by icf.
1144 * symtab.h (Symbol_table::set_icf): New function.
1145 (Symbol_table::icf): New function.
1146 (Symbol_table::is_section_folded): New function.
1147 (Symbol_table::icf_): New data member.
1148 * target-reloc.h (relocate_section): Ignore sections folded by icf.
1149 * testsuite/Makefile.am: Add commands to build icf_test.
1150 * testsuite/Makefile.in: Regenerate.
1151 * testsuite/icf_test.sh: New file.
1152 * testsuite/icf_test.cc: New file.
1153
c3b65ac4
CD
11542009-07-24 Chris Demetriou <cgd@google.com>
1155
1156 * layout.cc (is_compressible_debug_section): Fix incorrect
1157 comment about compressed section names.
1158
1caf2c51
ILT
11592009-07-20 Ian Lance Taylor <ian@airs.com>
1160
1161 PR 10419
1162 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
1163
1ef4d87f
ILT
11642009-07-16 Ian Lance Taylor <iant@google.com>
1165
1166 PR 10400
1167 * layout.h: #include <map>.
1168 (class Kept_section): Change from struct to class. Add accessors
1169 and setters. Add section size to Comdat_group mapping. Change
1170 Comdat_group to std::map. Add is_comdat_ field. Add
1171 linkonce_size field in union.
1172 (class Layout): Update declaration of find_or_add_kept_section.
1173 Don't declare find_kept_object.
1174 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
1175 parameter. Add object, shndx, is_comdat, and is_group_name
1176 parameters. Change all callers. Adjust for new Kept_section.
1177 (Layout::find_kept_object): Remove.
1178 * object.cc (Sized_relobj::include_section_group): Update use of
1179 Kept_section. Rename secnum to shndx. Only record
1180 Kept_comdat_section if sections are the same size.
1181 (Sized_relobj::include_linkonce_section): Update use of
1182 Kept_section. Only record Kept_comdat_section if sections are the
1183 same size. Set size of linkonce section.
1184 (Sized_relobj::map_to_kept_section): Update call to
1185 get_kept_comdat_section.
1186 * object.h (class Sized_relobj): Rename fields in
1187 Kept_comdat_section to drop trailing underscores; change object
1188 field to Relobj*. Change Kept_comdat_section_table to store
1189 struct rather than pointer.
1190 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
1191 Add kept_object and kept_shndx parameters. Change all callers.
1192 (Sized_relobj::get_kept_comdat_section): Change return type to
1193 bool. Add kept_object and kept_shndx parameters. Change all
1194 callers.
1195 * plugin.cc (Pluginobj::include_comdat_group): Update call to
1196 Layout::find_or_add_kept_section.
1197
37c3b7b0
ILT
11982009-07-09 Ian Lance Taylor <iant@google.com>
1199
1200 * merge.cc (Object_merge_map::initialize_input_to_output_map):
1201 Reserve space in the hash table.
1202
98fa85cb
ILT
12032009-07-06 Mikolaj Zalewski <mikolajz@google.com>
1204
1205 * fileread.cc (File_read::get_mtime): New method.
1206 * fileread.h (Timespec): New structure.
1207 (File_read::get_mtime): New method.
1208 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
1209 Renamed from timestamp_nsec.
1210 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
1211 Elf_Xword.
1212 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
1213 timestamp_nsec.
1214 (Incremental_inputs::report_archive): Save mtime; style fix.
1215 (Incremental_inputs::report_obejct): Save mtime; style fix.
1216 (Incremental_inputs::report_script): Save mtime; style fix.
1217 (Incremental_inputs::finalize_inputs): Style fix.
1218 (Incremental_inputs::finalize): Style fix.
1219 (Incremental_inputs::create_input_section_data): Store inputs
1220 mtime.
1221 * incremental.h (Incremental_inputs::report_script): Add mtime
1222 argument.
1223 (Incremental_inputs::Input_info::Input_info): Intialize only one
1224 union member.
1225 (Incremental_inputs::Input_info::archive): Move to nameless
1226 union.
1227 (Incremental_inputs::Input_info::obejct): Move to nameless union.
1228 (Incremental_inputs::Input_info::script): Move to nameless union.
1229 (Incremental_inputs::mtime): New field.
1230 * script.cc (read_input_script): Pass file mtime to
1231 Incremental_input.
1232 * script.h (Script_info::inputs): Style fix.
1233
c9d70757
ILT
12342009-07-01 Ian Lance Taylor <ian@airs.com>
1235
1236 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
1237 instead of 32.
1238
9c547ec3
ILT
12392009-06-24 Ian Lance Taylor <iant@google.com>
1240
1241 PR 10156
1242 * layout.cc (Layout::choose_output_section): If we find an
1243 existing section, update the flags.
1244 (Layout::create_notes): New function, broken out of
1245 Layout::finalize.
1246 (Layout::finalize): Don't create note sections.
1247 (Layout::create_note): Don't crash if linker script discards
1248 section.
1249 (Layout::create_gold_note): Likewise.
1250 (Layout::create_build_id): Likewise. Don't set
1251 after_input_sections on the section.
1252 (Layout::create_executable_stack_info): Remove target parameter.
1253 Change caller.
1254 * layout.h (class Layout): Declare create_notes. Update
1255 declaration of create_executable_stack_info.
1256 * gold.cc (queue_middle_tasks): Call create_notes.
1257 * output.cc (Output_section::update_flags_for_input_section): Move
1258 here from output.h. If SHF_ALLOC flag is newly set, mark address
1259 invalid.
1260 * output.h (Output_data::mark_address_invalid): New function.
1261 (class Output_section): Only declare, not define,
1262 update_flags_for_input_section. Remove set_flags.
1263
55458500
ILT
12642009-06-24 Ian Lance Taylor <iant@google.com>
1265
1266 * script-sections.cc (Output_section_definition::
1267 set_section_addresses): Rename shadowing local load_address to
1268 laddr.
1269
1307d6cd
ILT
12702009-06-24 Ian Lance Taylor <iant@google.com>
1271
1272 PR 10244
1273 * reloc.cc (relocate_sections): Skip empty relocation sections.
1274
ec3f783e
ILT
12752009-06-23 Ian Lance Taylor <iant@google.com>
1276
1277 PR 10156
1278 * layout.cc (Layout::create_note): Use choose_output_section
1279 rather than make_output_section.
1280
459c9f1c
ILT
12812009-06-23 Ian Lance Taylor <iant@google.com>
1282
1283 PR 10237
1284 * options.cc (General_options::parse_V): Set printed_version_.
1285 (General_options::General_options): Initialize printed_version_.
1286 * options.h (class General_options): Add printed_version_ field.
1287 * gold.cc (queue_initial_tasks): If there are no input files,
1288 don't give a fatal error if we printed the version information.
1289 (queue_middle_tasks): If using -r with a shared object, give a
1290 fatal error rather than an ordinary error.
1291
1518dc8f
ILT
12922009-06-23 Ian Lance Taylor <iant@google.com>
1293
1294 PR 10219
1295 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
1296 (Layout::make_output_section): Set have_stabstr_section_ if we see
1297 a .stab*str section.
1298 (Layout::finalize): Call link_stabs_sections.
1299 (Layout::link_stabs_sections): New file.
1300 * layout.h (class Layout): Add have_stabstr_section_ field.
1301 Declare link_stabs_sections.
1302
3d857b98
DK
13032009-06-23 Doug Kwan <dougkwan@google.com>
1304
1305 * Makefile.am (libgold_a_LIBADD): New.
1306 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
1307 * Makefile.in: Regenerate.
1308 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
1309 * configure: Regenerate.
1310 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
1311 * fileread.cc: Include sys/state.h
1312 * gold.h: Declare memmem and strndup if found missing.
1313 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
1314
0639a6f6
ILT
13152009-06-23 Ian Lance Taylor <iant@google.com>
1316
1317 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
1318 * configure: Rebuild.
1319
8d63875c
ILT
13202009-06-23 Ian Lance Taylor <iant@google.com>
1321
1322 PR 10147
1323 * object.cc (Object::section_contents): Don't try to get a view if
1324 the section has length zero.
1325 (Object::handle_gnu_warning_section): If the section is empty, use
1326 the name of the section as the warning.
1327
f7c8a183
ILT
13282009-06-23 Ian Lance Taylor <iant@google.com>
1329
1330 PR 10133
1331 * stringpool.h (class Stringpool_template): Add optimize_ field.
1332 (Stringpool_template::set_optimize): New function.
1333 * stringpool.cc (Stringpool_template::Stringpool_template):
1334 Initialize optimize_ field.
1335 (Stringpool_template::set_string_offsets): Test local optimize
1336 fild rather than parameter.
1337 * layout.cc (Layout::Layout): Call set_optimize on the section
1338 name stringpool.
1339
e6a307ba
ILT
13402009-06-22 Ian Lance Taylor <iant@google.com>
1341
1342 PR 10030
1343 * yyscript.y: Parse TARGET.
1344 * script.cc (script_set_target): New function.
1345 * script-c.h (script_set_target): Declare.
1346 * options.cc (General_options::string_to_object_format): Rename
1347 from string_to_object_format in anonymous namespace. Change
1348 callers.
1349 * options.h (class General_options): Declare
1350 string_to_object_format.
1351
3ee173de
ILT
13522009-06-22 Ian Lance Taylor <iant@google.com>
1353
1354 * script-sections.cc (Script_sections::create_segments): Don't put
1355 program headers in a PT_LOAD segment if -n or -N.
1356
13572009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
1358
1359 PR 10141
1360 * options.h (class General_options): Add -z lazy and -z now. Sort
1361 -z options into alphabetical order.
1362 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
1363
cd6739a1 13642009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
1365
1366 * layout.cc (Layout::make_output_section): Call
1367 Target::new_output_section.
1368 (Layout::attach_allocated_section_to_segment): Put large section
1369 sections in a separate load segment with the large segment flag
1370 set.
1371 (Layout::segment_precedes): Sort large data segments after other
1372 load segments.
1373 (align_file_offset): New static function.
1374 (Layout::set_segment_offsets): Use align_file_offset.
1375 * output.h (class Output_section): Add is_small_section_ and
1376 is_large_section_ fields.
1377 (Output_section::is_small_section): New function.
1378 (Output_section::set_is_small_section): New function.
1379 (Output_section::is_large_section): New function.
1380 (Output_section::set_is_large_section): New function.
1381 (Output_section::is_large_data_section): New function.
1382 (class Output_segment): Add is_large_data_segment_ field.
1383 (Output_segment::is_large_data_segment): New function.
1384 (Output_segment::set_is_large_data_segment): New function.
1385 * output.cc (Output_section::Output_section): Initialize new
1386 fields.
1387 (Output_segment::Output_segment): Likewise.
1388 (Output_segment::add_output_section): Add assertion that large
1389 data sections always go in large data segments. Force small data
1390 sections to the end of the list of data sections. Force small BSS
1391 sections to the start of the list of BSS sections. For large BSS
1392 sections to the end of the list of BSS sections.
1393 * symtab.h (class Symbol): Declare is_common_shndx.
1394 (Symbol::is_defined): Check Symbol::is_common_shndx.
1395 (Symbol::is_common): Likewise.
1396 (class Symbol_table): Define enum Commons_section_type. Update
1397 declarations. Add small_commons_ and large_commons_ fields.
1398 * symtab.cc (Symbol::is_common_shndx): New function.
1399 (Symbol_table::Symbol_table): Initialize new fields.
1400 (Symbol_table::add_from_object): Put small and large common
1401 symbols in the right list.
1402 (Symbol_table::sized_finalized_symbol): Check
1403 Symbol::is_common_shndx.
1404 (Symbol_table::sized_write_globals): Likewise.
1405 * common.cc (Symbol_table::do_allocate_commons): Allocate new
1406 common symbol lists. Don't call do_allocate_commons_list if the
1407 list is empty.
1408 (Symbol_table::do_allocate_commons_list): Remove is_tls
1409 parameter. Add comons_section_type parameter. Change all
1410 callers. Handle small and large common symbols.
1411 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
1412 Symbol::is_common_shndx.
1413 * resolve.cc (symbol_to_bits): Likewise.
1414 * target.h (Target::small_common_shndx): New function.
1415 (Target::small_common_section_flags): New function.
1416 (Target::large_common_shndx): New function.
1417 (Target::large_common_section_flags): New function.
1418 (Target::new_output_section): New function.
1419 (Target::Target_info): Add small_common_shndx, large_common_shndx,
1420 small_common_section_flags, and large_common_section_flags
1421 fields.
1422 (Target::do_new_output_section): New virtual function.
1423 * arm.cc (Target_arm::arm_info): Initialize new fields.
1424 * i386.cc (Target_i386::i386_info): Likewise.
1425 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
1426 Likewise.
1427 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
1428 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
1429 (Target_x86_64::do_new_output_section): New function.
1430 * configure.ac: Define conditional MCMODEL_MEDIUM.
1431 * testsuite/Makefile.am (check_PROGRAMS): Add large.
1432 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
1433 (large_LDFLAGS): Define.
1434 * testsuite/large.c: New file.
1435 * testsuite/testfile.cc (Target_test::test_target_info):
1436 Initialize new fields.
1437 * configure, testsuite/Makefile.in: Rebuild.
1438
bb04269c
DK
14392009-06-05 Doug Kwan <dougkwan@google.com>
1440
1441 * Makefile.am (CCFILES): Add target.cc.
1442 * Makefile.in: Regenerate.
1443 * i386.cc (class Target_i386): Define new virtual method to
1444 override do_is_local_label_name in parent.
1445 * object.cc (Sized_relobj::do_count_local_symbols): Discard
1446 local symbols if --discard-locals or -X is given.
1447 * options.h (class General_options): Declare new options
1448 '--discard-locals' and '-X' for discarding locals.
1449 * target.h (class Target): Define new methods is_local_label_name.
1450 Declare new virtual method do_is_local_label_name.
1451 * target.cc: New file.
1452 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
1453 (check_SCRIPTS): Add discard_locals_test.sh.
1454 (check_DATA): Add discard_local_tests.syms.
1455 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
1456 (discard_local_tests.syms, discard_locals_test.o): New make rules.
1457 * testsuite/Makefile.in: Regenerate.
1458 * testsuite/discard_locals_test.c: New file.
1459 * testsuite/discard_locals_test.sh: Same.
1460
805bb01c
DK
14612009-06-05 Doug Kwan <dougkwan@google.com>
1462
1463 * object.cc (Sized_relobj::Sized_relobj): Initialize
1464 discarded_eh_frame_shndx_ to -1U.
1465 (Sized_relobj::do_layout): Record index of a discard .eh_frame
1466 section.
1467 (Sized_relobj::do_count_local_symbols): Skip local symbols in
1468 a discarded .eh_frame section.
1469 (Sized_relobj::do_finalize_local_symbols): Ditto.
1470 * object.h (class Sized_relobj): Declare new member
1471 discarded_eh_frame_shndx_.
1472 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
1473 (local_labels_test.o, local_labels_test): New rules.
1474 * testsuite/Makefile.in: Regenerate.
1475
1dcd334d
DK
14762009-06-04 Doug Kwan <dougkwan@google.com>
1477
1478 * layout.cc (Layout::section_name_mapping): Add mapping for
1479 special ARM sections.
1480
96d49306
DK
14812009-06-03 Doug Kwan <dougkwan@google.com>
1482
1483 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
1484 (utils::has_overflow): Same.
1485
dff16297
ILT
14862009-06-03 Ian Lance Taylor <iant@google.com>
1487
1488 * layout.cc (Layout::section_name_mapping): New array, replacing
1489 Layout::linkonce_mapping.
1490 (Layout::section_name_mapping_count): New variable, replacing
1491 Layout::linkonce_mapping_count.
1492 (Layout::linkonce_output_name): Remove.
1493 (Layout::output_section_name): Rewrite.
1494 * layout.h (class Layout): Rename Linkonce_mapping to
1495 Section_name_mapping, linkonce_mapping to section_name_mapping,
1496 linkonce_mapping_count to section_name_mapping_count. Don't
1497 declare linkonce_output_name.
1498
c121c671
DK
14992009-06-03 Doug Kwan <dougkwan@google.com>
1500
1501 * gold/arm.cc (namespace utils): New.
1502 (Target_arm::reloc_is_non_pic): Define new method.
1503 (class Arm_relocate_functions): New.
1504 (Target_arm::Relocate::relocate): Handle relocation types used by
1505 Android.
1506
07800fab
ILT
15072009-06-03 Ian Lance Taylor <iant@google.com>
1508
1509 * arm.cc (Target_arm::scan::global): Use || instead of |.
1510
c121c671
DK
15112009-06-02 Doug Kwan <dougkwan@google.com>
1512
1513 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
1514 issued_non_pic_error_.
1515 (class Target_arm::Scan): Declare new method check_non_pic.
1516 Define new method symbol_needs_plt_entry.
1517 Declare new data member issued_non_pic_error_.
1518 (class Target_arm::Relocate): Declare new method
1519 should_apply_static_reloc.
1520 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
1521 (Target_arm::Scan::check_non_pic): Define new method.
1522 (Target_arm::Scan::local): Handle a small subset of reloc types used
1523 by Android.
1524 (Target_arm::Scan::local): Same.
1525 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
1526
b19b0c6d
ILT
15272009-05-31 Mikolaj Zalewski <mikolajz@google.com>
1528
1529 * incremental.cc (Incremental_inputs::report_command_line): Filter
1530 out --incremental-* options.
1531
94cdfcff
DK
15322009-05-29 Doug Kwan <dougkwan@google.com>
1533
1534 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
1535 template class.
1536 (class Target_arm): Update comment.
1537 (Target_arm::Target_arm): Initialize new data members GOT_,
1538 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
1539 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
1540 and Target_arm::rel_dyn_section.
1541 Declare new_enum Target_arm::Got_type.
1542 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
1543 and DYNBSS_.
1544 Update commments for member do_dynsym_value.
1545 (Target_arm::got_size, Target_arm::plt_section,
1546 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
1547 new methods inside class defintion.
1548 (Target_arm::got_section): Define new method.
1549 (Target_arm::rel_dyn_section): Same.
1550 (Output_data_plt_arm): New template class.
1551 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
1552 (Output_data_plt_arm:do_adjust_output_section): Define new method.
1553 (Output_data_plt_arm::add_entry): Same.
1554 (Output_data_plt_arm::first_plt_entry): Define new
1555 static data member for PLT instruction template.
1556 (Output_data_plt_arm::plt_entry): Same.
1557 (Output_data_plt_arm::do_write): Define new method.
1558 (Target_arm::make_plt_entry): Same.
1559 (Target_arm::do_finalize_sections): Same.
1560 (Target_arm::do_dynsym_value): Same.
1561
4a657b0d
DK
15622009-05-28 Doug Kwan <dougkwan@google.com>
1563
1564 * Makefile.am (TARGETSOURCES): Add arm.cc.
1565 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
1566 * Makefile.in: Regenerate.
1567 * arm.cc: New file.
1568 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
1569
e7ae8c36
DK
15702009-05-26 Doug Kwan <dougkwan@google.com>
1571
1572 * options.cc (General_options::parse_exclude_libs). Fix a comment.
1573 (General_options::check_excluded_libs): Strip off directories in
1574 archive name before matching like GNU ld does.
1575 * testsuite/Makefile.am (MOSTLYCLEANFILES,
1576 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
1577 (exclude_libs_test_LDFLAGS): Add linker option
1578 -Wl,--exclude-libs,libexclude_libs_test_3
1579 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
1580 an explicit archive without using -l.
1581 (alt/libexclude_libs_test_3.a): New make rule.
1582 * testsuite/Makefile.in: Regenerate.
1583 * testsuite/exclude_libs_test.c : Declare lib3_default().
1584 (main): Call it.
1585 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
1586 * exclude_libs_test_3.c: New file.
1587
f12e7348
NC
15882009-05-26 Nick Clifton <nickc@redhat.com>
1589
1590 * po/id.po: New Indonesian translation.
1591 * po/gold.pot: Updated template file.
1592
4daadc0d
ST
15932009-05-22 Sriraman Tallam <tmsriram@google.com>
1594
1595 * testsuite/Makefile.am: Add -ffunction-sections to compile
1596 gc_comdat_test files. Add -Wl,--gc-sections to build
1597 gc_comdat_test.
1598 * testsuite/Makefile.in: Regenerate.
1599 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
1600
531813ad
ST
16012009-05-21 Sriraman Tallam <tmsriram@google.com>
1602
1603 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
1604 kept comdat section was garbage collected.
1605 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
1606 * testsuite/Makefile.in: Regenerate.
1607 * testsuite/gc_comdat_test.sh: New file.
1608 * testsuite/gc_comdat_test_1.cc: New file.
1609 * testsuite/gc_comdat_test_2.cc: New file.
1610
65514900
CC
16112009-05-19 Doug Kwan <dougkwan@google.com>
1612
1613 * archive.cc (Archive::Archive): Move constructor from archive.h
1614 to here. Initialize no_export_.
1615 (Archive::get_elf_object_for_member): Set no_export flag of object.
1616 * archive.h (Archive::Archive): Move constructor body to
1617 archive.cc.
1618 (Archive::no_export): New method.
1619 (Archive::no_export_): New field.
1620 * object.h (Object::Object): Initialize no_export_ to false.
1621 (Object::no_export, Object::set_no_export): New methods.
1622 (Object::no_export_): New field.
1623 * options.cc (General_options::parse_exclude_libs): New method.
1624 (General_options::check_excluded_libs) Same.
1625 * options.h (exclude_libs): New option.
1626 (General_options::check_excluded_libs): New method declaration.
1627 (General_options::excluded_libs_): New field.
1628 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
1629 default or protected visibility if an object has no-export flag set.
1630 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
1631 (check_SCRIPTS): Add exclude_libs_test.sh.
1632 (check_DATA): Add exclude_libs_test.syms.
1633 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
1634 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
1635 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
1636 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
1637 (exclude_libs_test.syms, libexclude_libs_test_1.a,
1638 libexclude_libs_test_2.a): New rules.
1639 * testsuite/Makefile.in: Regenerate.
1640 * testsuite/exclude_libs_test.c: New file.
1641 * testsuite/exclude_libs_test.sh: Ditto.
1642 * testsuite/exclude_libs_test_1.c: Ditto.
1643 * testsuite/exclude_libs_test_2.c: Ditto.
1644
1b77ea50
ILT
16452009-05-15 Ian Lance Taylor <iant@google.com>
1646
1647 * configure.ac: Check for declarations for cases where libiberty.h
1648 checks HAVE_DECL_xxx.
1649 * configure, config.in: Rebuild.
1650
072fe7ce
ILT
16512009-05-15 Mikolaj Zalewski <mikolajz@google.com>
1652
1653 * gold.h (Incremental_argument_list): Remove (invalid) forward
1654 declaration.
1655 * incremental.cc (Incremental_inputs::report_achive): New method.
1656 (Incremental_inputs::report_object): New method.
1657 (Incremental_inputs::report_script): New method.
1658 (Incremental_inputs::finalize_inputs): New method.
1659 (Incremental_inputs::finalize): Call finalize_inputs().
1660 (Incremental_inputs::sized_create_incremental_inputs_section_data):
1661 Create inputs entries.
1662 * incremental.h (Incremental_input_type): New enum.
1663 (Incremental_inputs::Incremental_input): Initialize new fields.
1664 (Incremental_inputs::report_inputs): New method.
1665 (Incremental_inputs::report_achive): New method.
1666 (Incremental_inputs::report_object): New method.
1667 (Incremental_inputs::report_script): New method.
1668 (Incremental_inputs::finalize_inputs): New method.
1669 (Incremental_inputs::Input_info): New struct.
1670 (Incremental_inputs::Input_info_map): New typedef.
1671 (Incremental_inputs::lock_): New field.
1672 (Incremental_inputs::Inputs_): New field.
1673 (Incremental_inputs::Inputs_map): New field.
1674 * main.cc (main): Call Incremental_input::report_inputs.
1675 * options.h (Input_argument_list): Typedef moved from
1676 Input_arguments.
1677 (Input_file_group::Files): Remove, use ::Input_argument_list.
1678 (Input_file_group::Input_argument_list): Remove, use
1679 ::Input_argument_list.
1680 * plugin.cc (Plugin_manager::add_input_file): Add error in
1681 incremental build.
1682 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
1683 functions.
1684 * script.cc (read_input_script): Call
1685 Incremental_input::report_script.
1686 * script.h (Script_info): New class.
1687
b0481b0b
ILT
16882009-04-27 Ian Lance Taylor <iant@google.com>
1689
1690 * x86_64.cc (do_adjust_output_section): Set entsize to
1691 plt_entry_size.
1692
b22a5a41 16932009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
1694
1695 * output.cc (Output_file::close): After short writes, continue
1696 writing from the correct offset in the buffer being written.
1697
40fde488
CD
16982009-04-23 Chris Demetriou <cgd@google.com>
1699
1700 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
1701 * configure: Regenerate.
1702 * config.in: Regenerate.
1703 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
1704 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
1705
3ce2c28e
ILT
17062009-04-21 Mikolaj Zalewski <mikolajz@google.com>
1707
1708 * incremental.cc (Incremental_inputs_header_data): Renamed from
1709 Incremental_input_header_data.
1710 (Incremental_inputs_header_data::data_size): New field.
1711 (Incremental_inputs_header_data::put_input_file_count): Renamed
1712 from input_file_count.
1713 (Incremental_inputs_header_data::put_command_line_offset): Renamed
1714 from command_line_offset.
1715 (Incremental_inputs_header_data::put_reserved): Renamed from
1716 put_reserved.
1717 (Incremental_inputs_entry_data): Renamed from
1718 Incremental_input_entry_data.
1719 (Incremental_inputs_entry_data::data_size): New field.
1720 (Incremental_inputs::report_command_line): New method.
1721 (Incremental_inputs::finalize): New method.
1722 (Incremental_inputs::create_incremental_inputs_data): New method.
1723 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
1724 * incremental.h: New file.
1725 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
1726 (Layout::finalize): Create incremental inputs section in
1727 incremental builds.
1728 (Layout::create_incremental_info_sections): New method.
1729 * layout.h (Layout::incremental_inputs): New method.
1730 (Layout::create_incremental_info_sections): New method.
1731 (Layout::incremental_inputs_): New field.
1732 * main.cc (main): Notify Incremental_input of the command line.
1733
e55bde5e
ILT
17342009-04-01 Ian Lance Taylor <iant@google.com>
1735 Mikolaj Zalewski <mikolajz@google.com>
1736
1737 * gold.h (reserve_unordered_map): Define, three versions, one for
1738 each version of Unordered_map.
1739 * layout.cc (Layout::Layout): Remove options parameter. Add
1740 number_of_input_files parameter. Don't initialize options_.
1741 Initialize number_of_input_files_ and resized_signatures_. Move
1742 sections_are_attached_.
1743 (Layout::layout_group): Reserve space for group_signatures_.
1744 (Layout::find_or_add_kept_section): Change name parameter to be a
1745 reference. Resize signatures_ map when it gets large enough.
1746 (Layout::layout_eh_frame): Use parameters->options() instead of
1747 this->options_.
1748 (Layout::make_output_section): Likewise.
1749 (Layout::attach_allocated_section_to_segment): Likewise.
1750 (Layout::finalize, Layout::create_executable_stack): Likewise.
1751 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
1752 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
1753 * layout.h (class Layout): Update declarations. Remove options_
1754 field. Add number_of_input_files_ and resized_signatures_
1755 fields. Move sections_are_attached_ field.
1756 * main.cc (main): Pass number of input files to Layout
1757 constructor. Don't pass options.
1758
154b857c
ILT
17592009-03-30 Ian Lance Taylor <iant@google.com>
1760
1761 * ffsll.c (ffsll): Correct implementation.
1762
2f35ab9b
ILT
17632009-03-27 Ian Lance Taylor <iant@google.com>
1764
fd03461a
ILT
1765 * ffsll.c: New file.
1766 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
1767 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
1768 * ftruncate.c (ftruncate): Declare before definition.
1769 * mremap.c (mremap): Likewise.
1770 * pread.c (pread): Likewise.
1771 * configure, Makefile.in, config.in: Rebuild.
1772
2f35ab9b
ILT
1773 * mremap.c: New file.
1774 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
1775 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
1776 (mremap): Declare if HAVE_MREMAP is not defined.
1777 * configure, Makefile.in, config.in: Rebuild.
1778
33aea2fd
CC
17792009-03-27 Cary Coutant <ccoutant@google.com>
1780
1781 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
1782 position independent.
1783 * sparc.cc (Target_sparc::check_non_pic): Likewise.
1784 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
1785
6d479619
CC
17862009-03-24 Cary Coutant <ccoutant@google.com>
1787
1788 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
1789 an executable.
1790 (needs_dynamic_reloc): Likewise.
1791
afc06bb8
ILT
17922009-03-24 Ian Lance Taylor <iant@google.com>
1793
1794 * yyscript.y (file_cmd): Recognize EXTERN.
1795 (extern_name_list, extern_name_list_body): New nonterminals.
1796 * script.cc (script_add_extern): Define.
1797 * script-c.h (script_add_extern): Declare.
1798
f6060a4d
ILT
17992009-03-24 Rafael Avila de Espindola <espindola@google.com>
1800
1801 * object.cc (is_elf_object): Define.
1802 * object.h (is_elf_object): Declare.
1803 * archive.cc (Archive::get_elf_object_for_member): Call
1804 is_elf_object.
33aea2fd 1805 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 1806
26736d8e
ILT
18072009-03-24 Elliott Hughes <enh@google.com>
1808
1809 * output.cc (Output_file::map_anonymous): Define.
1810 (Output_file::map): Use map_anonymous. If the regular mmap fails,
1811 try an anonymous one. Report the size if the mmap fails.
1812 * output.h (class Output_file): Declare map_anonymous.
1813
22fd9730
ILT
18142009-03-24 Ian Lance Taylor <iant@google.com>
1815
1816 * target-select.cc (instantiate_target): Don't acquire the lock if
1817 the instantiated_target_ field has already been set.
1818
cb010894
ILT
18192009-03-23 Ian Lance Taylor <iant@google.com>
1820
7f055c20
ILT
1821 * gold-threads.h (class Initialize_lock): Define.
1822 * gold-threads.cc (class Initialize_lock_once): Define.
1823 (initialize_lock_control): New static variable.
1824 (initialize_lock_pointer): New static variable.
1825 (initialize_lock_once): New static function.
1826 (Initialize_lock::Initialize_lock): Define.
1827 (Initialize_lock::initialize): Define.
1828 * target-select.h: Include "gold-threads.h".
1829 (class Target_selector): Add lock_ and initialize_lock_ fields.
1830 Don't define instantiate_target, just declare it.
1831 * target-select.cc (Target_selector::Target_selector): Initialize
1832 new fields.
1833 (Target_selector::instantiate_target): Define.
1834 * descriptors.h: Include "gold-threads.h".
1835 (class Descriptors): Add initialize_lock_ field.
1836 * descriptors.cc (Descriptors::Descriptors): Initialize new
1837 field.
1838 (Descriptors::open): Use initialize_lock_ field
1839 * errors.h (class Errors): Add initialize_lock_ field.
1840 * errors.cc (Errors::Errors): Initialize new field.
1841 (Errors::initialize_lock): Use initialize_lock_ field.
1842 * powerpc.cc (class Target_selector_powerpc): Remove
1843 instantiated_target_ field. In do_recognize call
1844 instantiate_target rather than do_instantiate_target. In
1845 do_instantiate_target just allocate a new target.
1846 * sparc.cc (class Target_selector_sparc): Likewise.
1847
36959681
ILT
1848 * freebsd.h: New file.
1849 * i386.cc: Include "freebsd.h".
1850 (Target_i386): Derive from Target_freebsd rather than
1851 Sized_target.
1852 (Target_selector_i386): Derive from Target_selector_freebsd rather
1853 than Target_selector.
1854 * x86_64.cc: Include "freebsd.h".
1855 (Target_x86_64): Derive from Target_freebsd rather than
1856 Sized_target.
1857 (Target_selector_x86_64): Derive from Target_selector_freebsd
1858 rather than Target_selector.
1859 * target.h (class Target): Add adjust_elf_header and
1860 do_adjust_elf_header.
1861 * output.cc (Output_file_header:: do_sized_write): Call target
1862 adjust_elf_header routine.
1863 * configure.tgt: Set targ_osabi.
1864 * configure.ac: Define GOLD_DEFAULT_OSABI.
1865 * parameters.cc (Parameters::default_target): Pass
1866 GOLD_DEFAULT_OSABI to select_target.
1867 * target-select.h (class Target_selector): Make instantiate_target
1868 protected rather than private.
1869 * Makefile.am (HFILES): Add freebsd.h.
1870 * configure, Makefile.in, config.in: Rebuild.
1871
cb010894
ILT
1872 * merge.cc (do_add_input_section): Correct pend value. Change
1873 message about last entry not being null terminated from error to
1874 warning.
1875
0e879927
ILT
18762009-03-20 Mikolaj Zalewski <mikolajz@google.com>
1877
1878 * incremental.cc: New file.
1879 * Makefile.am (CCFILES): Add incremental.cc.
1880 * Makefile.in: Rebuild.
1881
41105937
PP
18822009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
1883
1884 * layout.cc (Layout::output_section_name): Preserve names
1885 of '.note.' sections.
1886
60439920
ILT
18872009-03-19 Ian Lance Taylor <iant@google.com>
1888
1889 * descriptors.cc (Descriptors::open): Check that the options are
1890 valid before using them.
1891
0d371ad3
ILT
18922009-03-18 Ian Lance Taylor <iant@google.com>
1893
1894 * script-sections.h: Include <list>.
1895 (class Script_sections): Change Sections_elements from std::vector
1896 to std::list. Typedef public Elements_iterator. Add
1897 orphan_section_placement_, data_segment_align_start_, and
1898 saw_data_segment_align_ fields. Remove data_segment_align_index_
1899 field.
1900 * script-sections.cc (class Orphan_section_placement): New class.
1901 (class Sections_element): Add virtual functions is_relro and
1902 orphan_section_init. Remove virtual function place_orphan_here.
1903 (class Output_section_definition): Add is_relro and
1904 orphan_section_init. Remove place_orphan_here.
1905 (class Orphan_output_section): Likewise.
1906 (Script_sections::Script_sections): Update for field changes.
1907 (Script_sections::data_segment_align): Set saw_data_segment_align_
1908 and data_segment_align_start_, not data_segment_align_index.
1909 (Script_sections::data_segment_relro_end): Check
1910 saw_data_segment_align_. Use data_segment_align_start_ rather
1911 than data_segment_align_index_.
1912 (Script_sections::place_orphan): Rewrite to use
1913 Orphan_section_placement.
1914
9201d894
ILT
19152009-03-17 Ian Lance Taylor <iant@google.com>
1916
9c5b8369
ILT
1917 * archive.cc (Archive::add_symbols): Check for a version attached
1918 to the symbol name in the archive map.
1919 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
1920 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
1921 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
1922 (ver_test_11.a): New target.
1923 * testsuite/Makefile.in: Rebuild.
1924
9201d894
ILT
1925 * configure.ac: Check for chsize and posix_fallocate. Replace
1926 ftruncate.
1927 * ftruncate.c: New file, from gnulib.
1928 * output.cc (posix_fallocate): Define dummy version if not
1929 HAVE_POSIX_FALLOCATE.
1930 (Output_file::map): Call posix_fallocate rather than lseek and
1931 write.
1932 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
1933 * configure, Makefile.in, config.in: Rebuild.
1934
ef4ab7a8
PP
19352009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
1936
1937 * layout.h (Layout::create_note): Add section_name parameter.
1938 * layout.cc (Layout::create_note): Likewise.
1939 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
1940
8c500701
ILT
19412009-03-17 Ian Lance Taylor <iant@google.com>
1942
e85b18e1
ILT
1943 * descriptors.cc: Include "options.h".
1944 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
1945 (Descriptors::open): Always use O_CLOEXEC when opening a new
1946 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
1947 then set FD_CLOEXEC.
1948
9efe6174
ILT
1949 * sparc.cc (class Target_sparc): Add has_got_section.
1950 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
1951 make sure we have a GOT section.
1952
1953 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
1954 (Target_sparc::Scan::local): Likewise.
1955 (Target_sparc::Scan::global): Likewise.
1956 (Target_sparc::Relocate::relocate): Likewise.
1957 (Target_sparc::Relocate::relocate_tls): Likewise.
1958
8c500701
ILT
1959 * symtab.cc (Symbol_table::define_default_version): New function,
1960 broken out of add_from_object.
1961 (Symbol_table::add_from_object): Call define_default_version.
1962 (Symbol_table::define_special_symbol): Add resolve_oldsym
1963 parameter. Change all callers. If the version for a symbol comes
1964 from a version script, resolve it with the symbol with the same
1965 name with no version. Also add the symbol without a version if
1966 appropriate.
1967 (do_define_in_output_data): If resolving with oldsym, don't delete
1968 sym.
1969 (do_define_in_output_segment): Likewise.
1970 (do_define_as_constant): Likewise.
1971 * symtab.h (class Symbol_table): Update declarations.
1972
f1ed28fb
ILT
19732009-03-13 Ian Lance Taylor <iant@google.com>
1974
15f8229b
ILT
1975 * readsyms.cc (Read_symbols::incompatible_warning): New function.
1976 (Read_symbols::requeue): New function.
1977 (Read_symbols::do_read_symbols): If make_elf_object fails because
1978 the target type is not configured, and the file was searched for,
1979 issue a warning and retry with the next directory.
1980 (Add_symbols::run): If the file has an incompatible format, and
1981 it was searched for, requeue the Read_symbols task. On error,
1982 release the object.
1983 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
1984 dirindex parameter to constructor. Change all callers. Declare
1985 incompatible_warning and requeue.
1986 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
1987 input_argument_ and input_group_ fields. Add them to
1988 constructor. Change all callers.
1989 (class Read_script): Add dirindex_ field. Add it to constructor.
1990 Change all callers.
1991 * archive.cc (Archive::setup): Remove input_objects parameter.
1992 Change all callers.
1993 (Archive::get_file_and_offset): Likewise.
1994 (Archive::read_all_symbols): Likewise.
1995 (Archive::read_symbols): Likewise.
1996 (Archive::get_elf_object_for_member): Remove input_objects
1997 parameter. Add punconfigured parameter. Change all callers.
1998 (Archive::add_symbols): Change return type to bool. Check return
1999 value of include_member.
2000 (Archive::include_all_members): Likewise.
2001 (Archive::include_member): Change return type to bool. Return
2002 false if first included object has incompatible target. Set
2003 included_member_ field.
2004 (Add_archive_symbols::run): If add_symbols returns false, requeue
2005 Read_symbols task.
2006 * archive.h (class Archive): Add included_member_ field.
2007 Initialize it in constructor. Add input_file and searched_for
2008 methods. Update declarations.
2009 (class Add_archive_symbols): Add dirpath_, dirindex_, and
2010 input_argument_ fields. Add them to constructor. Change all
2011 callers.
2012 * script.cc: Include "target-select.h".
2013 (class Parser_closure): Add skip_on_incompatible_target_ and
2014 found_incompatible_target_ fields. Add
2015 skip_on_incompatible_target parameter to constructor. Change all
2016 callers. Add methods skip_on_incompatible_target,
2017 clear_skip_on_incompatible_target, found_incompatible_target, and
2018 set_found_incompatible_target.
2019 (read_input_script): Add dirindex parameter. Change all callers.
2020 If parser finds an incompatible target, requeue Read_symbols
2021 task.
2022 (script_set_symbol): Clear skip_on_incompatible_target in
2023 closure.
2024 (script_add_assertion, script_parse_option): Likewise.
2025 (script_start_sections, script_add_phdr): Likewise.
2026 (script_check_output_format): New function.
2027 * script.h (read_input_script): Update declaration.
2028 * script-c.h (script_check_output_format): Declare.
2029 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
2030 (ignore_cmd): Remove OUTPUT_FORMAT.
2031 * fileread.cc (Input_file::Input_file): Add explicit this.
2032 (Input_file::will_search_for): New function.
2033 (Input_file::open): Add pindex parameter. Change all callers.
2034 * fileread.h (class Input_file): Add input_file_argument method.
2035 Declare will_search_for. Update declarations.
2036 * object.cc (make_elf_object): Add punconfigured parameter.
2037 Change all callers.
2038 * object.h (class Object): Make input_file public. Add
2039 searched_for method.
2040 (make_elf_object): Update declaration.
2041 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
2042 restart search.
2043 * dirsearch.h (class Dirsearch): Update declaration.
2044 * options.h (class General_options): Add --warn-search-mismatch.
2045 * parameters.cc (Parameters::is_compatible_target): New function.
2046 * parameters.h (class Parameters): Declare is_compatible_target.
2047 * workqueue.cc (Workqueue::add_blocker): New function.
2048 * workqueue.h (class Workqueue): Declare add_blocker.
2049
f1ed28fb
ILT
2050 * fileread.cc (Input_file::open): Remove options parameter.
2051 Change all callers.
2052 (Input_file::open_binary): Likewise.
2053 * script.cc (read_input_script): Likewise.
2054 * readsyms.h (class Read_symbols): Remove options_ field. Remove
2055 options parameter from constructor. Change all callers.
2056 (class Read_script): Likewise.
2057 * fileread.h (class Input_file): Update declarations.
2058 * script.h (read_input_script): Update declaration.
2059
34dd024a
NC
20602009-03-10 Nick Clifton <nickc@redhat.com>
2061
2062 * po/es.po: New Spanish translation.
2063
6d71b17c
CC
20642009-03-06 Cary Coutant <ccoutant@google.com>
2065
2066 * options.cc (parse_short_option): Keep dash_z from registering itself.
2067
031cdbed
ILT
20682009-03-03 Ian Lance Taylor <iant@google.com>
2069
2070 PR 9918
2071 * target-reloc.h (relocate_section): Pass output_section to
2072 relocate.
2073 * i386.cc (Target_i386::should_apply_static_reloc): Add
2074 output_section parameter. Change all callers.
2075 (Target_i386::Relocate::relocate): Add output_section parameter.
2076 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
2077 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
2078 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
2079 * testsuite/two_file_shared.sh: New script.
2080 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
2081 (check_DATA): Add two_file_shared.dbg.
2082 (two_file_shared.dbg): New target.
2083 * testsuite/Makefile.in: Rebuild.
2084
15d5fa16
ILT
20852009-03-01 Ian Lance Taylor <iant@google.com>
2086
2087 * configure.ac: Check for byteswap.h.
2088 * configure: Rebuild.
2089 * config.in: Rebuild.
2090
8a4c0b0d
ILT
20912009-03-01 Mikolaj Zalewski <mikolajz@google.com>
2092
2093 * layout.cc (Layout::find_or_add_kept_section): New function.
2094 (Layout::add_comdat): Removed.
2095 * layout.h (struct Kept_section): Move out of class Layout.
2096 Remove trailing underscores from field names. Add group_sections
2097 field. Rename group_ field to is_group. Change all uses.
2098 (class Layout): Declare find_or_add_kept_section, not add_comdat.
2099 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
2100 comdat_groups_ field.
2101 (Sized_relobj::include_section_group): Use
2102 find_or_add_kept_section and Kept_section::group_sections.
2103 (Sized_relobj::include_linkonce_section): Likewise.
2104 * object.cc (class Sized_relobj): Don't define Comdat_group or
2105 Comdat_group_table. Remove find_comdat_group and
2106 add_comdat_group. Remove comdat_groups_ field.
2107 * plugin.cc (include_comdat_group): Use
2108 Layout::find_or_add_kept_section.
2109
b4ecf66b
ILT
21102009-02-28 Ian Lance Taylor <iant@google.com>
2111
14359ca0
ILT
2112 * README: --gc-sections and map files are now supported. Document
2113 some build requirements.
2114
b4ecf66b
ILT
2115 PR 6992
2116 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
2117 relocatable link set the value of the section symbol to zero.
2118 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
2119 relocatable link don't include the section address in the local
2120 symbol value.
2121
0602e05a
ILT
21222009-02-27 Ian Lance Taylor <iant@google.com>
2123
fd9d194f
ILT
2124 PR 6811
2125 * options.h (class Search_directory): Add is_system_directory.
2126 (class General_options): Declare is_in_system_directory.
2127 * options.cc (get_relative_sysroot): Make static.
2128 (get_default_sysroot): Make static.
2129 (General_optoins::is_in_system_directory): New function.
2130 * fileread.cc (Input_file::is_in_system_directory): New function.
2131 * fileread.h (class Input_file): Declare is_in_system_directory.
2132 * object.h (class Object): Add is_in_system_directory.
2133 (class Input_objects): Remove system_library_directory_ field.
2134 * object.cc (Input_objects::add_object): Don't set
2135 system_library_directory_.
2136 (input_objects::found_in_system_library_directory): Remove.
2137 * symtab.cc (Symbol_table::write_globals): Remove input_objects
2138 parameter. Change all callers.
2139 (Symbol_table::sized_write_globals): Likewise.
2140 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
2141 Call Object::is_in_system_directory.
2142 * symtab.h (class Symbol_table): Update declarations.
2143
61edd21f
ILT
2144 PR 5990
2145 * descriptors.h (Open_descriptor): Add is_on_stack field.
2146 * descriptors.cc (Descriptors::open): If the descriptor is on the
2147 top of the stack, remove it. Initialize is_on_stack field.
2148 (Descriptors::release): Only add pod to stack if it is not on the
2149 stack already.
2150 (Descriptors::close_some_descriptor): Clear stack_next and
2151 is_on_stack fields.
2152
e29e076a
ILT
2153 PR 7091
2154 * output.cc (Output_section::find_starting_output_address): Rename
2155 from starting_output_address; add PADDR parameter; change return
2156 type.
2157 * output.h (class Output_section): Declare
2158 find_starting_output_address instead of starting_output_address.
2159 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
2160 section symbol for which we can't find a merge section.
2161
0602e05a
ILT
2162 PR 9836
2163 * symtab.cc (Symbol_table::add_from_object): If the visibility is
2164 hidden or internal, force the symbol to be local.
2165 * resolve.cc (Symbol::override_visibility): Define.
2166 (Symbol::override_base): Use override_visibility.
2167 (Symbol_table::resolve): Likewise.
2168 (Symbol::override_base_with_special): Likewise.
2169 (Symbol_table::override_with_special): If the visibility is hidden
2170 or internal, force the symbol to be local.
2171 * symtab.h (class Symbol): Add set_visibility and
2172 override_visibility.
2173 * testsuite/ver_test_1.sh: New file.
2174 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
2175 (check_DATA): Add ver_test_1.syms.
2176 (ver_test_1.syms): New target.
2177 * testsuite/Makefile.in: Rebuild.
2178
401a9a73
CC
21792009-02-25 Cary Coutant <ccoutant@google.com>
2180
2181 * layout.cc (Layout::choose_output_section): Don't rename sections
2182 when using a linker script that has a SECTIONS clause.
2183 * Makefile.in: Regenerate.
2184
2185 * testsuite/Makefile.am (script_test_5.sh): New test case.
2186 * testsuite/Makefile.in: Regenerate.
2187 * testsuite/script_test_5.cc: New file.
2188 * testsuite/script_test_5.sh: New file.
2189 * testsuite/script_test_5.t: New file.
2190
f488e4b0
CC
21912009-02-13 Rafael Avila de Espindola <espindola@google.com>
2192
2193 * archive.cc (Archive::include_member): Update calls to add_symbols.
2194 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
2195 the Layout argument.
2196 * dynobj.h (do_add_symbols): Add the Layout argument.
2197 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
2198 Layout argument.
2199 * object.h (Object::add_symbols): Add the Layout argument.
2200 (Object::do_add_symbols): Add the Layout argument.
2201 (Sized_relobj::do_add_symbols): Add the Layout argument.
2202 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
2203 Unify the two versions.
2204 (Add_plugin_symbols): Remove.
2205 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
2206 (Sized_pluginobj::do_add_symbols): Unify the two versions.
2207 (Add_plugin_symbols): Remove.
2208 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
2209 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
2210 (Add_symbols::run): Make it work with Pulginobj.
2211
89dd1680
ILT
22122009-02-06 Ian Lance Taylor <iant@google.com>
2213
2214 * object.cc (Sized_relobj::do_layout): Make info message start
2215 with lower case letter.
2216
266d0a74
ILT
22172009-02-06 Mikolaj Zalewski <mikolajz@google.com>
2218
602b464e
ILT
2219 * binary.cc: Fix file comment.
2220
266d0a74
ILT
2221 * options.h (enum Incremental_disposition): Define.
2222 (class General_options): Add new options: --incremental,
2223 --incremental_changed, --incremental_unchanged,
2224 --incremental_unknown. Add incremental_disposition_ and
2225 implicit_incremental_ fields.
2226 (General_options::incremental_disposition): New function.
2227 (class Position_dependent_options): Add incremental_disposition
2228 option.
2229 (Position_dependent_options::copy_from_options): Set incremental
2230 dispositions.
2231 * options.cc (General_options::parse_incremental_changed): New
2232 function.
2233 (General_options::parse_incremental_unchanged): New function.
2234 (General_options::parse_incremental_unknown): New function.
2235 (General_options::General_options): Initialize new fields
2236 incremental_disposition_ and implicit_incremental_.
2237 (General_options::finalize): Check for uasge of --incremental-*
2238 without --incremental.
2239
f073bbf7
CD
22402009-02-06 Chris Demetriou <cgd@google.com>
2241
2242 * gold.h (gold_undefined_symbol): Change to take only a Symbol
2243 pointer and to report location as the file name associated with
2244 the symbol.
2245 (gold_undefined_symbol_at_location): New function to replace the
2246 old gold_undefined_symbol functionality.
2247 * target-reloc.h (relocate_section): Update to use
2248 gold_undefined_symbol_at_location.
2249 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
2250 Call gold_undefined_symbol function rather than gold_error.
2251 * errors.h (Errors::undefined_symbol): Take location as a
2252 string, rather than calculating it from a relocation.
2253 * errors.cc (Errors::fatal): Print "fatal error:" before the
2254 formatted message.
2255 (Errors::error, Errors::error_at_location): Print "error: "
2256 before the formatted message.
2257 (Errors::undefined_symbol): Take location as a string, rather
2258 than calculating it from a relocation.
2259 (gold_undefined_symbol_at_location): New function akin to
2260 old gold_undefined_symbol, calculates location from relocation.
2261 (gold_undefined_symbol): Change to take only a Symbol pointer
2262 and to report location as the file name associated with the symbol.
2263 * testsuite/debug_msg.sh: Update for changed error messages.
2264 * testsuite/undef_symbol.sh: Likewise.
2265
8e94a90c
ILT
22662009-02-04 Duncan Sands <baldrick@free.fr>
2267
2268 PR 9812
2269 * reduced_debug_output.h
2270 (Output_reduced_debug_abbrev_section::failed): Use format for
2271 gold_warning.
2272 (Output_reduced_debug_info_section::faild): Likewise.
2273
88a0e15b
ILT
22742009-01-31 Mikolaj Zalewski <mikolajz@google.com>
2275
2276 * script.cc (Lazy_demangler): New class.
2277 (Version_script_info::get_symbol_version_helper): Demangle a
2278 symbol only once.
2279
5efc7cd2
CC
22802009-01-29 Cary Coutant <ccoutant@google.com>
2281
2282 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
2283 to __tls_get_addr.
2284 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
2285
e0ebcf42
ILT
22862009-01-28 Ian Lance Taylor <iant@google.com>
2287
5efc7cd2 2288 * version.cc (version_string): Bump to 1.9.
75fe7426 2289
e0ebcf42
ILT
2290 * gold.h: Include <cstring> and <stdint.h>.
2291 * version.cc: Include <cstdio>.
2292 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
2293 warning.
2294 * reduced_debug_output.cc (insert_into_vector): Rename from
2295 Insert_into_vector; change all callers. Use Swap_unaligned to
2296 avoid aliasing issue; remove union since it is unnecessary.
2297
8e2813be 22982009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
2299
2300 * Makefile.am (CCFILES): Add gc.cc.
2301 (HFILES): Add gc.h.
2302 * Makefile.in: Regenerate.
2303 * gold.cc (Gc_runner): New class.
2304 (queue_initial_tasks): Call garbage collection related tasks
2305 when corresponding options are invoked.
2306 (queue_middle_gc_tasks): New function.
2307 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
2308 processed early before laying out sections during garbage collection.
2309 * gold.h (queue_middle_gc_tasks): New function.
2310 (is_prefix_of): Move from "layout.cc".
2311 * i386.cc (Target_i386::gc_process_relocs): New function.
2312 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
2313 * main.cc (main): Create object of class "Garbage_collection".
2314 * object.cc (Relobj::copy_symbols_data): New function.
2315 (Relobj::is_section_name_included): New function.
2316 (Sized_relobj::do_layout): Allow this function to be called twice
2317 during garbage collection and defer layout of section during the
2318 first call.
2319 * object.h (Relobj::get_symbols_data): New function.
2320 (Relobj::is_section_name_included): New function.
2321 (Relobj::copy_symbols_data): New function.
2322 (Relobj::set_symbols_data): New function.
2323 (Relobj::get_relocs_data): New function.
2324 (Relobj::set_relocs_data): New function.
2325 (Relobj::is_output_section_offset_invalid): New pure virtual function.
2326 (Relobj::gc_process_relocs): New function.
2327 (Relobj::do_gc_process_relocs): New pure virtual function.
2328 (Relobj::sd_): New data member.
2329 (Sized_relobj::is_output_section_offset_invalid): New function.
2330 (Sized_relobj::do_gc_process_relocs): New function.
2331 * options.h (General_options::gc_sections): Modify to not be a no-op.
2332 (General_options::print_gc_sections): New option.
2333 * plugin.cc (Plugin_finish::run): Remove function call to
2334 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
2335 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
2336 * reloc.cc (Read_relocs::run): Add task to process relocs and
2337 determine unreferenced sections when doing garbage collection.
2338 (Gc_process_relocs): New class.
2339 (Sized_relobj::do_gc_process_relocs): New function.
2340 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
2341 sections that are garbage collected.
2342 * reloc.h (Gc_process_relocs): New class.
2343 * sparc.cc (Target_sparc::gc_process_relocs): New function.
2344 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
2345 symbols whose corresponding sections are garbage collected.
2346 (Symbol_table::Symbol_table): Add new parameter for the garbage
2347 collection object.
2348 (Symbol_table::gc_mark_undef_symbols): New function.
2349 (Symbol_table::gc_mark_symbol_for_shlib): New function.
2350 (Symbol_table::gc_mark_dyn_syms): New function.
2351 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
2352 as garbage.
2353 (Symbol_table::add_from_object): Likewise.
2354 (Symbol_table::add_from_relobj): When building shared objects, do not
2355 treat externally visible symbols as garbage.
2356 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
2357 table information for static and relocatable links.
2358 * symtab.h (Symbol_table::set_gc): New function.
2359 (Symbol_table::gc): New function.
2360 (Symbol_table::gc_mark_undef_symbols): New function.
2361 (Symbol_table::gc_mark_symbol_for_shlib): New function.
2362 (Symbol_table::gc_mark_dyn_syms): New function.
2363 (Symbol_table::gc_): New data member.
2364 * target.h (Sized_target::gc_process_relocs): New pure virtual
2365 function.
2366 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
2367 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
2368
3b293544
CF
23692009-01-20 Chris Faylor <me.sourceware@sourceware.org>
2370
2371 * options.h (General_options::gc_sections): Define as a no-op for now.
2372 (General_options::no_keep_memory): Ditto.
2373 (General_options::Bshareable): Define.
2374 * options.cc (General_options::finalize): Honor -Bshareable.
2375
83d22aa8
AS
23762009-01-20 Andreas Schwab <schwab@suse.de>
2377
2378 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
2379 read the value in the contents, since we don't use it. Use the
2380 template endianness when writing.
2381 (Relocate::relocate): Use it for R_PPC_REL16_HA.
2382
cd536b21
AS
23832009-01-19 Andreas Schwab <schwab@suse.de>
2384
2385 * configure.tgt (powerpc64-*): Fix targ_obj.
2386
99e9a495
ILT
23872009-01-15 Ian Lance Taylor <iant@google.com>
2388
2389 * object.cc (Sized_relobj::write_local_symbols): Don't write out
2390 local symbols when stripping all symbols.
2391
bbbfea06
CC
23922009-01-14 Cary Coutant <ccoutant@google.com>
2393
99e9a495 2394 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 2395
0f7c0701
CC
23962009-01-14 Cary Coutant <ccoutant@google.com>
2397
2398 * archive.cc (Archive::get_elf_object_for_member): Remove call
2399 to File_read::claim_for_plugin.
2400 * descriptors.cc (Descriptors::open): Remove reference to
2401 is_claimed.
2402 (Descriptors::claim_for_plugin): Remove.
2403 * descriptors.h (Descriptors::claim_for_plugin): Remove.
2404 (Descriptors::is_claimed): Remove.
2405 (claim_descriptor_for_plugin): Remove.
2406 * fileread.cc (File_read::claim_for_plugin): Remove.
2407 * fileread.h (File_read::claim_for_plugin): Remove.
2408 (File_read::descriptor): Reopen descriptor if necessary.
2409 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
2410 (Plugin_manager::all_symbols_read): Add task parameter. Change
2411 all callers.
2412 (Plugin_manager::get_input_file): New function.
2413 (Plugin_manager::release_input_file): New function.
2414 (Pluginobj::Pluginobj): Add filesize parameter and initialize
2415 corresponding data member.
2416 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
2417 and pass to base constructor. Change all callers.
2418 (get_input_file, release_input_file): New functions.
2419 (make_sized_plugin_object): Add filesize parameter. Change all callers.
2420 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
2421 (Plugin_manager::all_symbols_read): Add task parameter.
2422 (Plugin_manager::get_input_file): New function.
2423 (Plugin_manager::release_input_file): New function.
2424 (Plugin_manager::task_): New data member.
2425 (Pluginobj::Pluginobj): Add filesize parameter.
2426 (Pluginobj::filename): New function.
2427 (Pluginobj::descriptor): New function.
2428 (Pluginobj::filesize): New function.
2429 (Pluginobj::filesize_): New data member.
2430 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
2431 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
2432 File_read::claim_for_plugin; use Object::unlock to unlock the file.
2433
2434 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
2435 with archive libraries.
2436 * testsuite/Makefile.in: Regenerate.
2437 * testsuite/plugin_test.c (struct sym_info): New type.
2438 (get_input_file, release_input_file): New static variables.
2439 (onload): Capture new transfer vector entries.
2440 (claim_file_hook): Stop reading at end of file according to filesize.
2441 Factor out parsing of readelf output into separate function.
2442 (all_symbols_read_hook): Exercise get_input_file and release_input_file
2443 APIs and get the source file name from the symbol table. Convert
2444 source file name to corresponding object file name. Print info
2445 message when adding new input files.
2446 (parse_readelf_line): New function.
2447 * testsuite/plugin_test_1.sh: Add checks for new info messages.
2448 * testsuite/plugin_test_2.sh: Likewise.
2449 * testsuite/plugin_test_3.sh: Likewise.
2450 * testsuite/plugin_test_4.sh: New test case.
2451
62a6d109
ILT
24522009-01-07 Ian Lance Taylor <iant@google.com>
2453
2454 * version.cc (version_string): Bump to 1.8.
2455
483620e8
CC
24562008-12-23 Cary Coutant <ccoutant@google.com>
2457
2458 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
2459 * plugin.cc (Plugin_manager::finish): Rename as
2460 layout_deferred_objects. Move cleanup to separate function.
2461 (Plugin_manager::cleanup): New function.
2462 (Plugin_finish::run): Call layout_deferred_objects and cleanup
2463 separately.
2464 * plugin.h (Plugin_manager::finish): Rename as
2465 layout_deferred_objects.
2466 (Plugin_manager::cleanup): New function.
2467 (Plugin_manager::cleanup_done): New field.
2468
d66a9eb3
CC
24692008-12-23 Cary Coutant <ccoutant@google.com>
2470
2471 * plugin.cc (is_visible_from_outside): New function.
2472 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
2473 so we don't return "IR only" status for exported symbols or -r links.
2474
2475 * testsuite/Makefile.am (plugin_test_3): New test case.
2476 * testsuite/Makefile.in: Regenerate.
2477 * testsuite/plugin_test_3.sh: New file.
2478
5995b570
CC
24792008-12-22 Cary Coutant <ccoutant@google.com>
2480
2481 * object.cc (Sized_relobj::layout_section): New function.
2482 (Sized_relobj::do_layout): Defer layout of input sections until after
2483 plugin has provided replacement files.
2484 (Sized_relobj::do_layout_deferred_sections): New function.
2485 * object.h (Relobj::set_section_offset): Remove virtual keyword.
2486 (Relobj::layout_deferred_sections): New function.
2487 (Relobj::do_layout_deferred_sections): New function.
2488 (Sized_relobj::do_layout_deferred_sections): New function.
2489 (Sized_relobj::layout_section): New function.
2490 (Sized_relobj::Deferred_layout): New structure.
2491 (Sized_relobj::deferred_layout_): New field.
2492 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
2493 Change all callers. Layout deferred sections.
2494 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
2495 references.
2496 (Plugin_hook::run): Move code from do_plugin_hook inline.
2497 (Plugin_hook::do_plugin_hook): Remove.
2498 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
2499 (Plugin_manager::finish): Renamed, was cleanup.
2500 (Plugin_manager::should_defer_layout): New function.
2501 (Plugin_manager::add_deferred_layout_object): New function.
2502 (Plugin_manager::Deferred_layout_list): New type.
2503 (Plugin_manager::deferred_layout_objects_): New field.
2504 (Plugin_hook::do_plugin_hook): Remove.
2505
ee769c88
ILT
25062008-12-17 Ian Lance Taylor <iant@google.com>
2507
2508 * options.h (class General_options): Add --no case for
2509 --export-dynamic.
2510
abc8dcba
CC
25112008-12-16 Cary Coutant <ccoutant@google.com>
2512
2513 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
2514 vector.
2515 (Plugin_manager::claim_file): Create plugin object even if
2516 plugin did not call the add_symbols callback.
2517 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
2518 asking for more symbols than were added.
2519 * testsuite/Makefile.am (plugin_test_1): Add test case with
2520 no global symbols.
2521 (empty.syms): New target.
2522 * testsuite/Makefile.in: Regenerate.
2523 * testsuite/plugin_test.c (claim_file_hook): Add new debug
2524 message. Don't call add_symbols if no globals.
2525 (all_symbols_read_hook): Don't provide replacement for empty
2526 claimed file.
2527
b0074644
ILT
25282008-12-12 Ian Lance Taylor <iant@google.com>
2529
68943102
ILT
2530 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
2531 r_type == 0 for a local symbol with r_sym == 0.
2532 (scan_relocatable_relocs): Pass r_sym to
2533 local_non_section_strategy.
2534 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
2535 r_sym parameter.
2536
b0074644
ILT
2537 * configure.ac: Update test for TLS descriptors: they are
2538 supported as of glibc 2.9.
2539 * configure: Rebuild.
2540
c2508178
ILT
25412008-12-11 Ian Lance Taylor <iant@google.com>
2542
2543 PR 7091
2544 * target-reloc.h (Default_scan_relocatable_relocs): For each
2545 function, map r_type == 0 to RELOC_DISCARD.
2546
2756a258
CC
25472008-12-10 Cary Coutant <ccoutant@google.com>
2548
2549 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
2550 object to override a kept COMDAT group from a plugin object.
2551
bb6f53d3
ILT
25522008-12-09 Ian Lance Taylor <iant@google.com>
2553
fbc558e1
ILT
2554 PR 7088
2555 * yyscript.y (file_cmd): Handle INPUT.
2556
bb6f53d3
ILT
2557 * testsuite/initpri1.c: Change all declarations to be full
2558 prototypes by adding void, to avoid compiler warnings.
2559
4674ecfc
CC
25602008-12-05 Rafael Avila de Espindola <espindola@google.com>
2561
2562 * options.cc (General_options::parse_plugin_opt): New.
2563 (General_options::add_plugin): The argument now is just the filename.
2564 (General_options::add_plugin_option): New.
2565 * options.h (plugin_opt): New.
2566 (add_plugin): Change argument name.
2567 (add_plugin_option): New.
2568 * plugin.cc (Plugin::load): Don't parse the plugin option.
2569 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
2570 (Plugin::add_option): New.
2571 (Plugin::args_): Change type.
2572 (Plugin::filename_): New.
2573 (Plugin_manager::add_plugin_option): New.
2574 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
2575 * testsuite/Makefile.in: Regenerate.
2576
fd06b4aa
CC
25772008-12-05 Cary Coutant <ccoutant@google.com>
2578
2579 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
2580 Handle --strip-lto-sections option.
2581 * options.h (strip_lto_sections): New option.
2582
6c52134c
CC
25832008-12-01 Cary Coutant <ccoutant@google.com>
2584
2585 * plugin.cc (ld_plugin_message): Change format parameter to const.
2586 Fix mismatch between new[] and delete.
2587
a45248e0
CC
25882008-11-14 Cary Coutant <ccoutant@google.com>
2589
2590 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
2591 instead of -1U.
2592
c82fbeee
CS
25932008-11-05 Craig Silverstein <csilvers@google.com>
2594
2595 * options.cc (General_options::parse_dynamic_list): New function.
2596 * options.h (General_options): New flags dynamic_list,
2597 dynamic_list_data, dynamic_list_cpp_new, and
2598 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
2599 (General_options::in_dynamic_list): New function.
2600 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
2601 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
2602 (Lex::can_continue_name): Likewise.
2603 (yylex): Likewise.
2604 (read_script_file): New parameter script_options.
2605 (read_dynamic_list): New function.
2606 (Script_options::define_dynamic_list): New function.
2607 (dynamic_list_keyword_parsecodes): New variable.
2608 (dynamic_list_keywords): New variable.
2609 * script.h (Script_options::define_dynamic_list): New function
2610 prototype.
2611 (read_dynamic_list): New function prototype.
2612 * symtab.cc (strprefix): New macro.
2613 (Symbol::should_add_dynsym_entry): Support dynamic_list,
2614 dynamic_list_data, dynamic_list_cpp_new, and
2615 dynamic_list_cpp_typeinfo.
2616 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
2617 (dynamic_list_expr): New rule.
2618 (dynamic_list_nodes): Likewise.
2619 (dynamic_list_node): Likewise.
2620 * testsuite/Makefile.am (dynamic_list): New test.
2621 * testsuite/Makefile.in: Regenerated.
2622 * testsuite/dynamic_list.t: New file.
2623 * testsuite/dynamic_list.sh: New file.
2624
e0bb29a5
CS
26252008-11-05 Craig Silverstein <csilvers@google.com>
2626
2627 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
2628 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
2629 (t11_last): Likewise.
2630 * testsuite/ver_test_6.c (main): Likewise.
2631
4e1e25e0
CC
26322008-10-07 Cary Coutant <ccoutant@google.com>
2633
2634 * options.c (General_options::finalize): Add check for -static and
2635 -shared.
2636 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
2637 is not empty.
2638
92f03fcb
CC
26392008-10-02 Cary Coutant <ccoutant@google.com>
2640
2641 * plugin.cc (make_sized_plugin_object): Fix conditional
2642 compilation to work when not all targets are enabled.
2643
fbd8a257
CC
26442008-09-29 Cary Coutant <ccoutant@google.com>
2645
2646 * archive.cc (Archive::get_file_and_offset): Use filename instead
2647 of name to get library path.
2648 (Archive::include_member): Unlock external member of a thin archive.
2649
2650 * testsuite/Makefile.am (TEST_AR): New variable.
2651 (thin_archive_test_1): New test.
2652 (thin_archive_test_2): New test.
81636b3f
CC
2653 * testsuite/Makefile.in: Regenerate.
2654 * testsuite/thin_archive_main.cc: New file.
2655 * testsuite/thin_archive_test_1.cc: New file.
2656 * testsuite/thin_archive_test_2.cc: New file.
2657 * testsuite/thin_archive_test_3.cc: New file.
2658 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 2659
eff45813
CC
26602008-09-29 Cary Coutant <ccoutant@google.com>
2661
2662 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
2663 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
2664 instead of -1U.
2665 (Sized_relobj::do_finalize_local_symbols): Likewise.
2666 (Sized_relobj::map_to_kept_section): Likewise.
2667 * object.h (Sized_relobj::invalid_address): New constant.
2668 (Sized_relobj::do_output_section_offset): Check for invalid_address
2669 and return -1ULL.
2670 * output.cc (Output_reloc::local_section_offset): Use constant
2671 invalid_address instead of -1U.
2672 (Output_reloc::get_address): Likewise.
2673 (Output_section::output_address): Change -1U to -1ULL.
2674 * output.h (Output_reloc::invalid_address): New constant.
2675 * reloc.cc (Sized_relobj::write_sections): Use constant
2676 invalid_address instead of -1U.
2677 (Sized_relobj::relocate_sections): Likewise.
2678 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
2679 values for merge sections.
2680 * target-reloc.h (relocate_for_relocatable): Use constant
2681 invalid_address instead of -1U.
2682
89fc3421
CC
26832008-09-19 Cary Coutant <ccoutant@google.com>
2684
2685 Add plugin functionality for link-time optimization (LTO).
2686 * configure.ac (plugins): Add --enable-plugins option.
2687 * configure: Regenerate.
2688 * config.in: Regenerate.
2689 * Makefile.am (LIBDL): New variable.
2690 (CCFILES): Add plugin.cc.
2691 (HFILES): Add plugin.h.
2692 (ldadd_var): Add LIBDL.
2693 * Makefile.in: Regenerate.
2694
2695 * archive.cc: Include "plugin.h".
2696 (Archive::setup): Don't preread archive symbols when using a plugin.
2697 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
2698 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
2699 files.
2700 (Archive::include_member): Add symbols from plugin objects.
2701 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
2702 * descriptors.cc (Descriptors::open): Check for file descriptors
2703 abandoned by plugins.
2704 (Descriptors::claim_for_plugin): New function.
2705 * descriptors.h (Descriptors::claim_for_plugin): New function.
2706 (Open_descriptor::is_claimed): New field.
2707 (claim_descriptor_for_plugin): New function.
2708 * fileread.cc (File_read::claim_for_plugin): New function.
2709 * fileread.h (File_read::claim_for_plugin): New function.
2710 (File_read::descriptor): New function.
2711 * gold.cc: Include "plugin.h".
2712 (queue_initial_tasks): Add task to call plugin hooks for generating
2713 new object files.
2714 * main.cc: Include "plugin.h".
2715 (main): Load plugin libraries.
2716 * object.h (Pluginobj): Declare.
2717 (Object::pluginobj): New function.
2718 (Object::do_pluginobj): New function.
2719 (Object::set_target): New function.
2720 * options.cc: Include "plugin.h".
2721 (General_options::parse_plugin): New function.
2722 (General_options::General_options): Initialize plugins_ field.
2723 (General_options::add_plugin): New function.
2724 * options.h (Plugin_manager): Declare.
2725 (General_options): Add --plugin option.
2726 (General_options::has_plugins): New function.
2727 (General_options::plugins): New function.
2728 (General_options::add_plugin): New function.
2729 (General_options::plugins_): New field.
2730 * plugin.cc: New file.
2731 * plugin.h: New file.
2732 * readsyms.cc: Include "plugin.h".
2733 (Read_symbols::do_read_symbols): Check for archive before checking
2734 for ELF file. Call plugin hooks to claim files.
2735 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
2736 from a real object file; force override when processing replacement
2737 files.
2738 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
2739 (Symbol::init_base_object): Likewise.
2740 (Symbol::init_base_output_data): Likewise.
2741 (Symbol::init_base_output_segment): Likewise.
2742 (Symbol::init_base_constant): Likewise.
2743 (Symbol::init_base_undefined): Likewise.
2744 (Symbol::output_section): Assert that object is not a plugin.
2745 (Symbol_table::add_from_pluginobj): New function.
2746 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
2747 undefined.
2748 (Symbol_table::sized_write_globals): Likewise.
2749 (Symbol_table::add_from_pluginobj): Instantiate template.
2750 * symtab.h (Sized_pluginobj): Declare.
2751 (Symbol::in_real_elf): New function.
2752 (Symbol::set_in_real_elf): New function.
2753 (Symbol::in_real_elf_): New field.
2754 (Symbol_table::add_from_pluginobj): New function.
2755
2756 * testsuite/Makefile.am (AM_CFLAGS): New variable.
2757 (LIBDL): New variable.
2758 (LDADD): Add LIBDL.
2759 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
2760 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
2761 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
2762 (MOSTLYCLEANFILES): Likewise.
2763 * testsuite/Makefile.in: Regenerate.
2764 * testsuite/plugin_test.c: New file.
2765 * testsuite/plugin_test_1.sh: New file.
2766 * testsuite/plugin_test_2.sh: New file.
2767
de31bda5
ILT
27682008-09-16 Ian Lance Taylor <iant@google.com>
2769
9c2d0ef9
ILT
2770 * target-reloc.h (relocate_section): Check whether a symbol is
2771 defined by the ABI before reporting an undefined symbol error.
2772 * target.h (Target::is_defined_by_abi): Make parameter const.
2773 (Target::do_is_defined_by_abi): Likewise.
2774 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
2775 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
2776 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
2777 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
2778 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
2779 * testsuite/Makefile.in: Rebuild.
2780
de31bda5
ILT
2781 * fileread.cc (make_view): Add casts to avoid warning.
2782
9fa33bee
AO
27832008-09-16 Alexandre Oliva <aoliva@redhat.com>
2784
2785 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
2786 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
2787
183fd0e3
AO
27882008-09-16 Alexandre Oliva <aoliva@redhat.com>
2789
2790 * options.h (General_options::output_is_executable): New.
2791 (General_options::output_is_pie): New.
2792 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
2793 for shared libraries.
2794 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
2795
7be8330a
CD
27962008-09-11 Chris Demetriou <cgd@google.com>
2797
2798 * options.h (origin): New -z option.
2799 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
2800 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
2801 in DT_FLAGS_1.
2802
a9caad02
CC
28032008-09-05 Cary Coutant <ccoutant@google.com>
2804
2805 * fileread.cc (File_read::make_view): Add check for attempt to map
2806 beyond end of file.
2807
ae6dce4d
CC
28082008-09-05 Cary Coutant <ccoutant@google.com>
2809
2810 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
2811 explicit instantiations.
2812
d7ab2a47
KVH
28132008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
2814
2815 PR gold/6858
2816 * options.cc (General_options::finalize): Allow undefined symbols
2817 in shlibs if linking -shared.
2818
2819 PR gold/6859
2820 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
2821 symbols as not needing a dynsym entry.
2822
1e52a9c1
CS
28232008-08-20 Craig Silverstein <csilvers@google.com>
2824
2825 * fileread.cc (File_read::open): Do not lock the file unless it
2826 was successfully opened.
2827
d85c80a3
CC
28282008-08-14 Cary Coutant <ccoutant@google.com>
2829
2830 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
2831 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
2832 * testsuite/tls_test.cc (struct int128): 128-bit struct
2833 for testing TLS relocs with non-zero addend.
2834 (v12): New TLS variable.
2835 (t12): New test.
2836 (t_last): Add check for v12.
2837 * testsuite/tls_test.h (t12): New function.
2838 * testsuite/tls_test_main.cc (thread_routine): Call new test.
2839
2d924fd9
ILT
28402008-08-13 Ian Lance Taylor <iant@google.com>
2841
2842 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
2843 set tls_segment_ or relro_segment_.
2844 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
2845 when appropriate.
2846 * output.h (Output_section::clear_is_relro): New function.
2847 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
2848 sections specially even when output_data_ is empty.
2849 (Output_segment::maximum_alignment): When first section is relro,
2850 only force alignment for PT_LOAD segments.
2851 * script.cc (script_data_segment_align): New function.
2852 (script_data_segment_relro_end): New function.
2853 * script-c.h (script_data_segment_align): Declare.
2854 (script_data_segment_relro_end): Declare.
2855 * script-sections.h (class Script_sections): Declare
2856 data_segment_align and data_segment_relro_end. Add fields
2857 segment_align_index_ and saw_relro_end_.
2858 * script-sections.cc (class Sections_element): Add set_is_relro
2859 virtual function. Add new bool* parameter to place_orphan_here.
2860 Add get_output_section virtual function.
2861 (class Output_section_definition): Add set_is_relro. Add new
2862 bool* parameter to place_orphan_here. Add get_output_section.
2863 Add is_relro_ field.
2864 (Output_section_definition::Output_section_definition): Initialize
2865 evaluated_address_, evaluated_load_address, evaluated_addralign_,
2866 and is_relro_ fields.
2867 (Output_section_definition::place_orphan_here): Add is_relro
2868 parameter.
2869 (Output_section_definition::set_section_addresses): Set relro for
2870 output section.
2871 (Output_section_definition::alternate_constraint): Likewise.
2872 (class Orphan_output_section): Add new bool* parameter to
2873 place_orphan_here. Add get_output_section.
2874 (Orphan_output_section::place_orphan_here): Add is_relro
2875 parameter.
2876 (Script_sections::Script_sections): Initialize
2877 data_segment_align_index_ and saw_relro_end_.
2878 (Script_sections::data_segment_align): New function.
2879 (Script_sections::data_segment_relro_end): New function.
2880 (Script_sections::place_orphan): Set or clear is_relro.
2881 (Script_sections::set_section_addresses): Force alignment of first
2882 TLS section.
2883 * yyscript.y (exp): Call script_data_segment_align and
2884 script_data_segment_relro_end.
2885 * testsuite/relro_script_test.t: New file.
2886 * testsuite/relro_test.cc (using_script): Declare.
2887 (t1, t2): Test using_script.
2888 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
2889 (relro_script_test_SOURCES): Define.
2890 (relro_script_test_DEPENDENCIES): Define.
2891 (relro_script_test_LDFLAGS): Define.
2892 (relro_script_test_LDADD): Define.
2893 (relro_script_test.so): New target.
2894 * testsuite/Makefile.in: Rebuild.
2895
f827c9a9
CC
28962008-08-06 Cary Coutant <ccoutant@google.com>
2897
2898 * archive.cc (Archive::total_archives, Archive::total_members)
2899 (Archive::total_members_loaded): New variables.
2900 (Archive::setup): Add parameter. Add option to preread
2901 archive symbols.
2902 (Archive::read_armap): Add counter.
2903 (Archive::get_file_and_offset): New function.
2904 (Archive::get_elf_object_for_member): New function.
2905 (Archive::read_all_symbols): New function.
2906 (Archive::read_symbols): New function.
2907 (Archive::add_symbols): Add counters.
2908 (Archive::include_all_members): Use armap to find members if it's
2909 already built.
2910 (Archive::include_member): Skip reading symbols if already read.
2911 Factored code into Archive::get_file_and_offset and
2912 Archive::get_elf_object_for_member. Changed call to
2913 Mapfile::report_include_archive_member.
2914 (Archive::print_stats): New function.
2915 * archive.h: Declare Object and Read_symbols_data classes.
2916 (Archive::Archive): Add initializers for new members.
2917 (Archive::setup): Add parameter.
2918 (Archive::print_stats): New function.
2919 (Archive::total_archives, Archive::total_members)
2920 (Archive::total_members_loaded): New variables.
2921 (Archive::get_file_and_offset): New function.
2922 (Archive::get_elf_object_for_member): New function.
2923 (Archive::read_all_symbols): New function.
2924 (Archive::read_symbols): New function.
2925 (Archive::Archive_member): New class.
2926 (Archive::members_): New member.
2927 (Archive::num_members_): New member.
2928 * main.cc: Include archive.h.
2929 (main): Call Archive::print_stats.
2930 * mapfile.cc (Mapfile::report_include_archive_member): Delete
2931 archive parameter; member_name is now the fully-decorated name.
2932 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
2933 * options.h: (General_options): Add --preread-archive-symbols option.
2934 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
2935 Archive::setup.
2936
de4c45bd
ILT
29372008-08-04 Ian Lance Taylor <iant@google.com>
2938
2939 * symtab.h (Symbol::use_plt_offset): New function.
2940 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
2941 * powerpc.cc (Relocate::relocate): Likewise.
2942 * sparc.cc (Relocate::relocate): Likewise.
2943 * x86_64.cc (Relocate::relocate): Likewise.
2944 * testsuite/weak_plt.sh: New test.
2945 * testsuite/weak_plt_main.cc: New test.
2946 * testsuite/weak_plt_shared.cc: New test.
2947 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
2948 (check_PROGRAMS): Add weak_plt.
2949 (check_DATA): Add weak_plt_shared.so.
2950 (weak_plt_main_pic.o, weak_plt): New targets.
2951 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
2952 * testsuite/Makefile.in: Rebuild.
2953
2954 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
2955 gcctestdir/ld.
2956 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
2957 * testsuite/Makefile.in: Rebuild.
2958
323ee3f4
AM
29592008-08-04 Alan Modra <amodra@bigpond.net.au>
2960
2961 * Makefile.am (POTFILES.in): Set LC_ALL=C.
2962 * Makefile.in: Regenerate.
2963 * po/POTFILES.in: Regenerate.
2964
7c07ecec
ILT
29652008-07-29 Ian Lance Taylor <iant@google.com>
2966
2967 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
2968 symbols before other symbols.
2969 * testsuite/script_test_2.cc (test_addr): Declare.
2970 (test_addr_alias): Declare.
2971 (main): Check that test_addr and test_addr_alias have the right
cd536b21 2972 values.
7c07ecec
ILT
2973 * testsuite/script_test_2.t: Define test_addr_alias and
2974 test_addr.
2975
5778530e
ILT
29762008-07-24 Ian Lance Taylor <iant@google.com>
2977
2a00e4fb
ILT
2978 PR 5990
2979 * descriptors.cc: New file.
2980 * descriptors.h: New file.
2981 * gold-threads.h (class Hold_optional_lock): New class.
2982 * fileread.cc: Include "descriptors.h".
2983 (File_read::~File_read): Release descriptor rather than closing
2984 it.
2985 (File_read::open) [file]: Call open_descriptor rather than open.
2986 Set is_descriptor_opened_.
2987 (File_read::open) [memory]: Assert that descriptor is not open.
2988 (File_read::reopen_descriptor): New function.
2989 (File_read::release): Release descriptor.
2990 (File_read::do_read): Make non-const. Reopen descriptor.
2991 (File_read::read): Make non-const.
2992 (File_read::make_view): Reopen descriptor.
2993 (File_read::do_readv): Likewise.
2994 * fileread.h (class File_read): Add is_descriptor_opened_ field.
2995 Update declarations.
2996 * layout.cc: Include "descriptors.h".
2997 (Layout::create_build_id): Use open_descriptor rather than open.
2998 * output.cc: Include "descriptors.h".
2999 (Output_file::open): Use open_descriptor rather than open.
3000 * archive.cc (Archive::const_iterator): Change Archive to be
3001 non-const.
3002 (Archive::begin, Archive::end): Make non-const.
3003 (Archive::count_members): Likewise.
3004 * archive.h (class Archive): Update declarations.
3005 * object.h (Object::read): Make non-const.
3006 * Makefile.am (CCFILES): Add descriptors.cc.
3007 (HFILES): Add descriptors.h.
3008 * Makefile.in: Rebuild.
3009
801647d1
ILT
3010 PR 6716
3011 * gold.h: Always include <clocale>. Add Solaris workarounds
3012 following code in binutils/sysdep.h.
3013
5edd166e
ILT
3014 PR 6048
3015 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
3016 this->eh_frame_hdr_ is NULL before using it.
3017
c89ad728
ILT
3018 * dynobj.cc (Versions::Versions): Update comment.
3019
aa86f06b
ILT
3020 * dynobj.cc (Versions::Versions): If there is an soname, use it as
3021 the base version name.
3022
5778530e
ILT
3023 * stringpool.cc (Stringpool_template::add_with_length): Set key to
3024 array size plus one.
3025 (Stringpool_template::set_string_offsets): Subtract one from key
3026 before using it as an array index.
3027 (Stringpool_template::get_offset_with_length): Likewise.
3028 (Stringpool_template::write_to_buffer): Likewise.
3029 * stringpool.h (Stringpool_template::get_offset_from_key):
3030 Likewise.
3031
057ead22
ILT
30322008-07-23 Ian Lance Taylor <iant@google.com>
3033
7f649c59
ILT
3034 PR 6658
3035 * object.h (Merged_symbol_value::value): Do our best to handle a
3036 negative addend.
3037
057ead22
ILT
3038 PR 6647
3039 * script.cc (Version_script_info::get_versions): Don't add empty
3040 version tag to return value.
3041 (Version_script_info::get_symbol_version_helper): Change return
3042 type to bool. Add pversion parameter. Change all callers.
3043 (script_register_vers_node): Don't require a non-NULL tag.
3044 * script.h (class Version_script_info): Update declarations.
3045 (Version_script_info::get_symbol_version): Change return type to
3046 bool. Add version parameter. Change all callers.
3047 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
3048 handling. Handle an empty version from a version script.
3049 (Symbol_table::define_special_symbol): Likewise.
3050 * testsuite/ver_test_10.script: New file.
3051 * testsuite/ver_test_10.sh: New file.
3052 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
3053 (check_DATA): Add ver_test_10.syms.
3054 (ver_test_10.syms, ver_test_10.so): New target.
3055 * testsuite/Makefile.in: Rebuild.
3056
58e54ac2
CD
30572008-07-23 Simon Baldwin <simonb@google.com>
3058
3059 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
3060 to zero for undefined symbols from dynamic libraries.
3061
95d14cd3
ILT
30622008-07-23 Ian Lance Taylor <iant@google.com>
3063
3064 * symtab.cc (Symbol_table::resolve): Remove version parameter.
3065 Change all callers.
3066 * symtab.h (class Symbol_table): Update declaration.
3067 * testsuite/ver_test_9.cc: New file.
3068 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
3069 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
3070 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
3071 (ver_test_9.so, ver_test_9.o): New targets.
3072 * testsuite/Makefile.in: Rebuild.
3073
92de84a6
ILT
30742008-07-22 Ian Lance Taylor <iant@google.com>
3075
34810851
ILT
3076 * options.h (class General_options): Define --check-sections.
3077 * layout.cc (Layout::set_segment_offsets): Handle
3078 --check-sections.
3079
af6156ef
ILT
3080 * options.h (class General_options): Define -n/--nmagic and
3081 -N/--omagic.
3082 * options.cc (General_options::finalize): For -n/--nmagic or
3083 -N/--omagic, set -static.
3084 * layout.cc (Layout::attach_allocated_section_to_segment): If
3085 -N/--omagic, don't put read-only and read-write sections in
3086 different segments.
3087 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
3088 finding a read-only segment.
3089 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
3090 don't set the minimum segment alignment to the common page size,
3091 and don't set the file offset to the address modulo the page size.
3092 * script-sections.cc (Script_sections::create_segments): If
3093 -n/--omagic, don't put read-only and read-write sections in
3094 different segments.
3095
92de84a6
ILT
3096 * cref.cc: New file.
3097 * cref.h: New file.
3098 * options.h (class General_options): Add --print-symbol-counts.
3099 * main.cc (main): Issue defined symbol report if requested.
3100 * archive.cc (Archive::interpret_header): Make into a const member
3101 function.
3102 (Archive::add_symbols): Call Input_objects::archive_start and
3103 archive_stop.
3104 (Archive::const_iterator): Define new class.
3105 (Archive::begin, Archive::end): New functions.
3106 (Archive::include_all_members): Rewrite to use iterator.
3107 (Archive::count_members): New function.
3108 * archive.h (class Archive): Update declarations.
3109 (Archive::filename): New function.
3110 * object.cc: Include "cref.h".
3111 (Sized_relobj::Sized_relobj): Initialize defined_count_.
3112 (Sized_relobj::do_get_global_symbol_counts): New function.
3113 (Input_objects::add_object): Add object to cross-referencer.
3114 (Input_objects::archive_start): New function.
3115 (Input_objects::archive_stop): New function.
3116 (Input_objects::print_symbol_counts): New function.
3117 * object.h: Declare Cref and Archive.
3118 (Object::get_global_symbol_counts): New function.
3119 (Object::do_get_global_symbol_counts): New pure virtual function.
3120 (class Sized_relobj): Add defined_count_ field. Update
3121 declarations.
3122 (class Input_objects): Add cref_ field. Update constructor.
3123 Update declarations.
3124 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
3125 defined_count_.
3126 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
3127 symbol counts.
3128 (Sized_dynobj::do_get_global_symbol_counts): New function.
3129 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
3130 defined_count_. Update declarations. Define Symbols typedef.
3131 * symtab.cc (Symbol_table::add_from_relobj): Add defined
3132 parameter. Change all callers.
3133 (Symbol_table::add_from_dynobj): Add sympointers and defined
3134 parameters. Change all callers.
3135 * symtab.h (class Symbol_table): Update declarations.
3136 * Makefile.am (CCFILES): Add cref.cc.
3137 (HFILES): Add cref.h.
3138 * Makefile.in: Rebuild.
3139
3f7c5e1d
CD
31402008-07-22 Simon Baldwin <simonb@google.com>
3141
3142 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
3143 to zero when writing undefined symbols.
3144
e0b64032
ILT
31452008-07-22 Ian Lance Taylor <iant@google.com>
3146
3147 * output.cc (Output_section::add_input_section): Don't try to
3148 merge empty merge sections.
3149
096b02cf
CS
31502008-07-21 Craig Silverstein <csilvers@google.com>
3151
3152 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
3153 Include symbol version in error message.
cd536b21 3154
1d1f116d
CD
31552008-07-20 Chris Demetriou <cgd@google.com>
3156
cd536b21 3157 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
3158 (RANDOM_SEED_CFLAGS): New substituted variable.
3159 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
3160 * configure: Rebuild.
3161 * Makefile.in: Likewise.
3162 * testsuite/Makefile.in: Likewise.
3163
a18f591e
ILT
31642008-07-18 Ian Lance Taylor <iant@google.com>
3165
3166 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
3167 where we see NAME/NULL and NAME/VERSION as separate symbols.
3168 * testsuite/ver_test_main.cc (main): Call t4.
3169 (t4, t4_2a): Define.
3170 * testsuite/ver_test_2.cc (t4_2): Define.
3171 * testsuite/ver_test_2.script: Put t4_2a in VER2.
3172 * testsuite/ver_test_4.cc (t4_2a): Define.
3173 * testsuite/ver_test_4.script: Put t4_2a in VER2.
3174 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
3175
c6e3f6ed
ILT
31762008-07-17 Ian Lance Taylor <iant@google.com>
3177
3178 * dynobj.cc (Versions::add_def): If we give an error about a
3179 missing version, go ahead and create the version anyhow.
3180
ef9beddf
ILT
31812008-07-10 Ian Lance Taylor <iant@google.com>
3182
3183 Handle output sections with more than 0x7fffffff bytes.
3184 * object.h (class Relobj): Change map_to_output_ to
3185 output_sections_, and just keep a section pointer. Change all
3186 uses. Move comdat group support to Sized_relobj.
3187 (Relobj::is_section_specially_mapped): Remove.
3188 (Relobj::output_section): Remove poff parameter. Change all
3189 callers.
3190 (Relobj::output_section_offset): New function.
3191 (Relobj::set_section_offset): Rewrite.
3192 (Relobj::map_to_output): Remove.
3193 (Relobj::output_sections): New function.
3194 (Relobj::do_output_section_offset): New pure virtual function.
3195 (Relobj::do_set_section_offset): Likewise.
3196 (class Sized_relobj): Add section_offsets_ field. Add comdat
3197 group support from Relobj. Update declarations.
3198 (Sized_relobj::get_output_section_offset): New function.
3199 (Sized_relobj::do_output_section_offset): New function.
3200 (Sized_relobj::do_set_section_offset): New function.
3201 * object.cc (Relobj::output_section_address): Remove.
3202 (Sized_relobj::Sized_relobj): Initialize new fields.
3203 (Sized_relobj::include_section_group): Cast find_kept_object to
3204 Sized_relobj.
3205 (Sized_relobj::include_linkonce_section): Likewise.
3206 (Sized_relobj::do_layout): Use separate arrays for output section
3207 and output offset.
3208 (Sized_relobj::do_count_local_symbols): Change map_to_output to
3209 output_sections.
3210 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
3211 output_sections and section_offsets.
3212 (Sized_relobj::write_local_symbols): Likewise.
3213 (map_to_kept_section): Compute output address directly.
3214 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
3215 output_sections and section_offsets.
3216 (Sized_relobj::write_sections): Likewise.
3217 (Sized_relobj::relocate_sections): Likewise.
3218 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
3219 * output.h (class Output_reloc): Update declarations. Change
3220 u2_.relobj to Sized_relobj*.
3221 (class Output_data_reloc): Change add functions to use
3222 Sized_relobj*.
3223 * output.cc (Output_reloc::Output_reloc): Change relobj to
3224 Sized_relobj*.
3225 (Output_reloc::local_section_offset): Change return type to
3226 Elf_Addr. Use get_output_section_offset.
3227 (Output_reloc::get_address): Likewise.
3228 (Output_section::is_input_address_mapped): Don't call
3229 is_section_specially_mapped.
3230 (Output_section::output_offset): Likewise.
3231 (Output_section::output_address): Likewise.
3232 (Output_section::starting_output_address): Likewise.
3233 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
3234 parameter to Sized_relobj*.
3235 (Copy_relocs::need_copy_reloc): Likewise.
3236 (Copy_relocs::save): Likewise.
3237 * copy-relocs.h (class Copy_relocs): Update declarations.
3238 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
3239 Sized_relobj*. Change relobj_ field to Sized_relobj*.
3240 * target-reloc.h (relocate_for_relocatable): Change
3241 offset_in_output_section type to Elf_Addr. Change code that uses
3242 it as well.
3243 * layout.cc (Layout::layout): Always set *off.
3244 * mapfile.cc (Mapfile::print_input_section): Use
3245 output_section_offset.
3246 * i386.cc (Target_i386::copy_reloc): Change object parameter to
3247 Sized_relobj*.
3248 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
3249 * sparc.cc (Target_sparc::copy_reloc): Likewise.
3250 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
3251
5cb66f97
ILT
32522008-07-03 Ian Lance Taylor <iant@google.com>
3253
3254 * layout.cc (Layout::include_section): Do not discard unrecognized
3255 SHT_STRTAB sections.
3256
afe47622
CS
32572008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
3258
3259 * script.cc (Lex::can_continue_name): Make '?' allowable in
3260 version-script names.
3261 * testsuite/version_script.map: Change glob pattern to use '?'
3262
5adf9721
ILT
32632008-06-30 Manish Singh <yosh@gimp.org>
3264
3265 PR 6585
3266 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
3267 Correct typo.
3268
e6fde208
ILT
32692008-06-30 Ian Lance Taylor <iant@google.com>
3270
3271 PR 6660
3272 PR 6682
3273 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
3274 versions]: Don't try to read the value in the contents, since we
3275 don't use it. Use the template endianness when writing.
3276
3f2e6a2d
CC
32772008-06-25 Cary Coutant <ccoutant@google.com>
3278
3279 * fileread.cc (File_read::make_view): Assert on zero-length view.
3280 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
3281 symbol table when there are no symbols to read.
3282
c43d3a48
CS
32832008-06-23 Craig Silverstein <csilvers@google.com>
3284
3285 * version.cc (version_string): Bump to 1.7
3286
5f494ea0
CS
32872008-06-18 Craig Silverstein <csilvers@google.com>
3288
3289 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
3290 constant 0xFFFF to type Valtype.
3291 (Powerpc_relocate_functions::rel16_ha): Likewise.
3292
c42e122e
ILT
32932008-06-17 Ian Lance Taylor <iant@google.com>
3294
f34787f8
ILT
3295 * output.h (Output_section::Input_section): Initialize p2align_ to
3296 zero for Output_section_data constructors.
3297 (Output_section::Input_section::addralign): If not an input
3298 section, return the alignment of the Output_section_data.
3299 * testsuite/copy_test.cc: New file.
3300 * testsuite/copy_test_1.cc: New file.
3301 * testsuite/copy_test_2.cc: New file.
3302 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
3303 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
3304 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
3305 (copy_test_1_pic.o, copy_test_1.so): New targets.
3306 (copy_test_2_pic.o, copy_test_2.so): New targets.
3307 * testsuite/Makefile.in: Rebuild.
3308
c42e122e
ILT
3309 * script-sections.cc (Script_sections::place_orphan): Initialize
3310 local variable exact.
3311
ce3ac18a
DE
33122008-06-13 David Edelsohn <edelsohn@gnu.org>
3313
3314 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
3315
42cacb20
DE
33162008-06-12 David Edelsohn <edelsohn@gnu.org>
3317 David S. Miller <davem@davemloft.net>
3318
3319 * powerpc.cc: New file.
3320 * Makefile.am (TARGETSOURCES): Add powerpc.cc
3321 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
3322 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
3323 * Makefile.in: Rebuild.
3324
7b308235
ILT
33252008-06-09 Ian Lance Taylor <iant@google.com>
3326
3327 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
3328 <exception>.
3329 (throwing, orig_terminate): New static variables.
3330 (terminate_handler): New static function.
3331 (t2): Set terminate handler.
3332
f0b886e3
ILT
33332008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
3334
3335 PR 6584
cd536b21 3336 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
3337 alignment.
3338
3e90f135
CC
33392008-05-30 Cary Coutant <ccoutant@google.com>
3340
3341 * archive.cc (Archive::include_all_members) Correct to step
3342 over symbol table and extended name table in thin archives.
3343
e09ad04a
ILT
33442008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
3345
3346 PR 6407
3347 * target-reloc.h (relocate_for_relocatable): Fix new_offset
3348 calculation.
3349
62b01cb5
ILT
33502008-05-28 Caleb Howe <cshowe@google.com>
3351
3352 * reduced_debug_output.cc: New file.
3353 * reduced_debug_output.h: New file.
92de84a6 3354 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
3355 * options.cc (General_options::finalize): Add strip_debug_non_line
3356 to the strip heirarchy.
3357 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
3358 fields.
3359 * layout.cc: Include "reduced_debug_output.h".
3360 (Layout::Layout): Initialize new fields.
3361 (line_only_debug_sections): New static array.
3362 (is_lines_only_debug_sections): New static inline function.
3363 (Layout::include_section): Handle --strip-debug-non-line.
3364 (Layout::make_output_section): If --strip-debug-non-line, build
3365 new output sections for .debug_abbrev and .debug_info.
3366 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
3367 gold. Warn about possible overflow.
3368 (read_signed_LEB_128): Likewise.
3369 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
3370 (read_signed_LEB_128): Declare.
3371 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
3372 (HFILES): Add reduced_debug_output.h.
3373 * Makefile.in: Rebuild.
3374
7d9e3d98
ILT
33752008-05-21 Ian Lance Taylor <iant@google.com>
3376
3377 * mapfile.cc: New file.
3378 * mapfile.h: New file.
3379 * options.h (class General_options): Add -M/--print-map and -Map.
3380 * options.cc (General_options::finalize): Make -M equivalent to
3381 -Map -.
3382 * main.cc: Include <cstdio> and "mapfile.h".
3383 (main): Open mapfile if requested.
3384 * gold.cc (class Middle_runner): Add mapfile_ field. Update
3385 constructor. Change caller.
3386 (queue_initial_tasks): Add mapfile parameter. Change caller.
3387 (queue_middle_tasks): Likewise.
3388 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
3389 declarations.
3390 * archive.cc: Include "mapfile.h".
3391 (Archive::add_symbols): Add mapfile parameter. Change all
3392 callers. Pass mapfile, symbol, and reason to include_member.
3393 (Archive::include_all_members): Add mapfile parameter. Change all
3394 callers.
3395 (Archive::include_member): Add mapfile, sym, and why parameters.
3396 Change all callers. Report inclusion to map file.
3397 * archive.h: Include "fileread.h".
3398 (class Archive): Update declarations.
3399 (Archive::file): New const method.
3400 (class Add_archive_symbols): Add mapfile_ field. Update
3401 constructor. Change all callers.
3402 * readsyms.h (class Read_symbols): Likewise.
3403 (class Finish_group): Likewise.
3404 (class Read_script): Likewise.
3405 * common.cc: Include "mapfile.h".
3406 (Symbol_table::allocate_commons): Add mapfile parameter. Change
3407 all callers.
3408 (Symbol_table::do_allocate_commons): Likewise.
3409 (Symbol_table::do_allocate_commons_list): Likewise. Report common
3410 symbol allocation to mapfile.
3411 * common.h (class Allocate_commons_task): Add mapfile_ field.
3412 Update constructor. Change all callers.
3413 * symtab.h (class Symbol_table): Update declarations.
3414 * layout.cc: Include "mapfile.h".
3415 (Layout_task_runner::run): Print information to mapfile.
3416 (Layout::create_gold_note): Change Output_data_fixed_space to
3417 Output_data_zero_fill.
3418 (Layout::create_build_id): Likewise.
3419 (Layout::print_to_mapfile): New function.
3420 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
3421 constructor. Change caller.
3422 (class Layout): Declare print_to_mapfile.
3423 * output.cc (Output_section::Input_section::print_to_mapfile): New
3424 function.
3425 (Output_section::add_input_section): If producing a map, always
3426 add to input_sections_ list.
3427 (Output_section::do_print_to_mapfile): New function.
3428 (Output_segment::print_sections_to_mapfile): New function.
3429 (Output_segment::print_section_list_to_mapfile): New function.
3430 * output.h: Include "mapfile.h".
3431 (Output_data::print_to_mapfile): New function.
3432 (Output_data::do_print_to_mapfile): New virtual function.
3433 (Output_segment_headers::do_print_to_mapfile): New function.
3434 (Output_file_header::do_print_to_mapfile): New function.
3435 (Output_data_const::do_print_to_mapfile): New function.
3436 (class Output_data_const_buffer): Add map_name_ field. Update
3437 constructor. Change all callers. Add do_print_to_mapfile
3438 function.
3439 (class Output_data_fixed_space): Likewise.
3440 (class Output_data_space): Likewise.
3441 (class Output_data_zero_fill): New class.
3442 (Output_data_strtab::do_print_to_mapfile): New function.
3443 (Output_data_reloc_base::do_print_to_mapfile): New function.
3444 (Output_relocatable_relocs::do_print_to_mapfile): New function.
3445 (Output_data_group::do_print_to_mapfile): New function.
3446 (Output_data_got::do_print_to_mapfile): New function.
3447 (Output_data_dynamic::do_print_to_mapfile): New function.
3448 (Output_symtab_xindex::do_print_to_mapfile): New function.
3449 (class Output_section): Declare do_print_to_mapflie. Declare
3450 print_to_mapfile in Input_section.
3451 (class Output_segment): Declare new functions.
3452 * object.h (Sized_relobj::symbol_count): New function.
3453 * script-sections.cc
3454 (Output_section_element_dot_assignment::set_section_addresses):
3455 Change Output_data_fixed_space to Output_data_zero_fill.
3456 (Output_data_expression::do_print_to_mapfile): New function.
3457 * script.cc (read_input_script): Add mapfile parameter. Change
3458 all callers.
3459 * script.h (read_input_script): Update declaration.
3460 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
3461 (Eh_frame::do_print_to_mapfile): New function.
3462 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
3463 (Output_merge_string::do_print_to_mapfile): New function.
3464 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
3465 function.
3466 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
3467 function.
3468 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
3469 function.
3470 * Makefile.am (CCFILES): Add mapfile.cc.
3471 (HFILES): Add mapfile.h.
3472 * Makefile.in: Rebuild.
3473
9f1d377b
ILT
34742008-05-19 Ian Lance Taylor <iant@google.com>
3475
3476 * options.h (class General_options): Add -z relro.
3477 * layout.cc (Layout::Layout): Initialize relro_segment_.
3478 (Layout::add_output_section_data): Return the output section.
3479 (Layout::make_output_section): Rcognize relro sections and mark
3480 them appropriately.
3481 (Layout::attach_allocated_section_to_segment): Put relro sections
3482 in a PT_GNU_RELRO segment.
3483 (Layout::create_initial_dynamic_sections): Mark the .dynamic
3484 section as relro.
3485 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
3486 PT_TLS segments.
3487 (Layout::linkonce_mapping): Map d.rel.ro.local to
3488 .data.rel.ro.local.
3489 (Layout::output_section_name): Us .data.rel.ro.local for any
3490 section which begins with that.
3491 * layout.h (class Layout): Update add_output_section_data
3492 declaration. Add relro_segment_ field.
3493 * output.cc (Output_section::Output_section): Initialize is_relro_
3494 and is_relro_local_ fields.
3495 (Output_segment::add_output_section): Group relro sections.
3496 (Output_segment::is_first_section_relro): New function.
3497 (Output_segment::maximum_alignment): If there is a relro section,
3498 align the segment to the common page size.
3499 (Output_segment::set_section_addresses): Track whether we are
3500 looking at relro sections. If the last section is a relro
3501 section, align to the common page size.
3502 (Output_segment::set_section_list_addresses): Add in_relro
3503 parameter. Change all callers. Align to the page size when
3504 moving from relro to non-relro section.
3505 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
3506 segment.
3507 * output.h (class Output_section): Add is_relro_ and
3508 is_relro_local_ fields.
3509 (Output_section::is_relro): New function.
3510 (Output_section::set_is_relro): New function.
3511 (Output_section::is_relro_local): New function.
3512 (Output_section::set_is_relro_local): New function.
3513 (class Output_segment): Update declarations.
3514 * i386.cc (Target_i386::got_section): Mark .got section as relro.
3515 * sparc.cc (Target_sparc::got_section): Likewise.
3516 * x86_64.cc (Target_x86_64::got_section): Likewise.
3517 * testsuite/relro_test_main.cc: New file.
3518 * testsuite/relro_test.cc: New file.
3519 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
3520 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
3521 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
3522 (relro_test.so, relro_test_pic.o): New targets.
3523 * testsuite/Makefile.in: Rebuild.
3524
a984ee1d
ILT
35252008-05-16 Ian Lance Taylor <iant@google.com>
3526
01676dcd
ILT
3527 * output.cc (Output_segment::add_output_section): Remove front
3528 parameter.
3529 * output.h (class Output_segment): Remove
3530 add_initial_output_section and overloaded add_output_section.
3531 Update declaration of remaining add_output_section.
3532 * layout.cc (Layout::create_interp): Call add_output_section
3533 rather than add_initial_output_section.
3534 (Layout::finish_dynamic_section): Likewise.
3535
497897f9
ILT
3536 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
3537 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
3538 know the dynamic type.
3539 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
3540 field. Initialize it in constructor.
3541 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
3542 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
3543 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
3544 reloc.
3545
a984ee1d
ILT
3546 * output.cc (Output_reloc::get_address): Change return type to
3547 Elf_Addr.
3548 * output.h (class Output_reloc): Update get_address declaration.
3549 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
3550 for section addresses.
3551
55ba0940
ILT
35522008-05-09 Ian Lance Taylor <iant@google.com>
3553
3554 PR 6493
3555 * gold.cc (gold_nomem): Use return value of write.
3556
75517b77
ILT
35572008-05-08 Ian Lance Taylor <iant@google.com>
3558
3559 * symtab.c (Symbol::init_base_output_data): Add version
3560 parameter. Change all callers.
3561 (Symbol::init_base_output_segment): Likewise.
3562 (Symbol::init_base_constant): Likewise.
3563 (Symbol::init_base_undefined): Likewise.
3564 (Sized_symbol::init_output_data): Likewise.
3565 (Sized_symbol::init_output_segment): Likewise.
3566 (Sized_symbol::init_constant): Likewise.
3567 (Sized_symbol::init_undefined): Likewise.
3568 (Symbol_table::do_define_in_output_data): If the new symbol has a
3569 version, mark it as the default.
3570 (Symbol_table::do_define_in_output_segment): Likewise.
3571 (Symbol_table::do_define_as_constant): Likewise.
3572 * symtab.h (class Symbol): Update declarations.
3573 (class Sized_symbol): Likewise.
3574 * resolve.cc (Symbol::override_version): New function.
c42e122e 3575 (Symbol::override_base): Call override_version.
75517b77
ILT
3576 (Symbol::override_base_with_special): Likewise.
3577 * testsuite/ver_script_8.script: New file.
3578 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
3579 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
3580 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
3581 (ver_test_8_1.so, ver_test_8_2.so): New targets.
3582
f1f70eae
ILT
35832008-05-06 Ian Lance Taylor <iant@google.com>
3584
f3e9c5c5
ILT
3585 PR 6049
3586 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
3587 functions.
3588 (class General_options): Remove existing --undefined, and add
3589 --no-undefined instead. Add new --undefined as synonym for -u.
3590 * archive.cc (Archive::add_symbols): Check whether symbol was
3591 named with -u.
3592 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
3593 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
3594 all uses. Add IS_UNDEFINED. Update declarations to split
3595 different versions of init_base. Declare init_base_undefined.
3596 (Symbol::is_defined): Handle IS_UNDEFINED.
3597 (Symbol::is_undefined): Likewise.
3598 (Symbol::is_weak_undefined): Call is_undefined.
3599 (Symbol::is_absolute): Handle IS_CONSTANT.
3600 (class Sized_symbol): Update declarations to split different
3601 versions of init. Declare init_undefined.
3602 (class Symbol_table): Declare new functions.
3603 * symtab.cc (Symbol::init_base_object): Rename from init_base.
3604 Change all callers.
3605 (Symbol::init_base_output_data): Likewise.
3606 (Symbol::init_base_output_segment): Likewise.
3607 (Symbol::init_base_constant): Likewise.
3608 (Symbol::init_base_undefined): New function.
3609 (Sized_symbol::init_object): Rename from init. Change all
3610 callers.
3611 (Sized_symbol::init_output_data): Likewise.
3612 (Sized_symbol::init_output_segment): Likewise.
3613 (Sized_symbol::init_constant): Likewise.
3614 (Sized_symbol::init_undefined): New function.
3615 (Symbol_table::add_undefined_symbols_from_command_line): New
3616 function.
3617 (Symbol_table::do_add_undefined_symbols_from_command_line): New
3618 function.
3619 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
3620 (Symbol::output_section): Likewise.
3621 (Symbol::set_output_section): Likewise.
3622 (Symbol_table::sized_finalize_symbol): Likewise.
3623 (Symbol_table::sized_write_globals): Likewise.
3624 * resolve.cc (Symbol_table::should_override): Likewise.
3625 (Symbol::override_base_with_special): Likewise.
3626
8bdcdf2c
ILT
3627 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
3628 symbol, change it to have default visibility.
3629 * testsuite/protected_1.cc: New file.
3630 * testsuite/protected_2.cc: New file.
3631 * testsuite/protected_3.cc: New file.
3632 * testsuite/protected_main_1.cc: New file.
3633 * testsuite/protected_main_2.cc: New file.
3634 * testsuite/protected_main_3.cc: New file.
3635 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
3636 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
3637 (protected_1_LDFLAGS, protected_1_LDADD): Define.
3638 (protected_1.so): New target.
3639 (protected_1_pic.o, protected_2_pic.o): New targets.
3640 (protected_3_pic.o): New target.
3641 (check_PROGRAMS): Add protected_2.
3642 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
3643 (protected_2_LDFLAGS, protected_2_LDADD): Define.
3644 * testsuite/Makefile.in: Rebuild.
3645
2b706932
ILT
3646 * options.h (DEFINE_var): Add set_user_set_##varname__.
3647 (DEFINE_bool_alias): New macro.
3648 (class General_options): Define -Bstatic using DEFINE_bool_alias
3649 rather than DEFINE_special. Add --undefined as an alias for -z
3650 defs.
3651 * options.cc (General_options::parse_Bstatic): Remove.
3652
d82a5bcc
ILT
3653 * options.h (class General_options): Add --fatal-warnings.
3654 * main.cc (main): Implement --fatal-warnings.
3655 * errors.h (Errors::warning_count): New function.
3656
f1f70eae
ILT
3657 * options.h (class General_options): Add -Bsymbolic-functions.
3658 * symtab.h (Symbol::is_preemptible): Check for
3659 -Bsymbolic-functions.
3660
8825ac63
ILT
36612008-05-05 Ian Lance Taylor <iant@google.com>
3662
d98bc257
ILT
3663 * options.h (DEFINE_bool): For DASH_Z, create the negative option
3664 as noVARNAME rather than no-VARNAME.
3665 (class General_options): Add option -z combreloc.
3666 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
3667 get_address.
3668 (Output_reloc::sort_before) [SHT_REL]: New function.
3669 (Output_reloc::sort_before) [SHT_RELA]: New function.
3670 (class Output_data_reloc_base): Add sort_relocs_ field. Define
3671 Sort_relocs_comparison.
3672 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
3673 parameter. Change all callers.
3674 (Output_data_reloc::Output_data_reloc) [both versions]: Add
3675 sort_relocs parameter. Change all callers.
3676 * output.cc (Output_reloc::get_address): New function, broken out
3677 of write_rel.
3678 (Output_reloc::write_rel): Call it.
3679 (Output_reloc::compare): New function.
3680 (Output_data_reloc_base::do_write): Optionally sort relocs.
3681
60b2b4e7
ILT
3682 * configure.ac: If targ_extra_obj is set, link it in.
3683 * configure.tgt: Initialize all variables.
3684 (x86_64*): Set targ_extra_obj and targ_extra_size.
3685 * configure: Rebuild.
3686
8825ac63
ILT
3687 * object.cc (Sized_relobj::include_section_group): Adjust section
3688 indexes read from group data. Build vector to pass to
3689 layout_group.
3690 * layout.cc (Layout::layout_group): Add flags and shndxes
3691 parameters. Remove contents parameter. Change caller. Update
3692 explicit instantiations.
3693 * layout.h (class Layout): Update layout_group declaration.
3694 * output.cc (Output_data_group::Output_data_group): Add flags and
3695 input_shndxes parameters. Remove contents parameter. Change
3696 caller.
3697 (Output_data_group::do_write): Change input_sections_ to
3698 input_shndxes_.
3699 * output.h (class Output_data_group): Update constructor
3700 declaration. Rename input_sections_ to input_shndxes_.
3701 * testsuite/many_sections_test.cc: Add template.
3702
e94cf127
CC
37032008-04-30 Cary Coutant <ccoutant@google.com>
3704
4418b2d5
CC
3705 * target-reloc.h (relocate_section): Fix dead-pointer bug.
3706
e94cf127
CC
3707 * layout.cc (Layout::include_section): Refactored check for debug
3708 info section.
3709 (Layout::add_comdat): Add new parameters. Change type
3710 of signature parameter. Add object and shndx to signatures table.
3711 (Layout::find_kept_object): New function.
3712 * layout.h: Include <cstring>.
3713 (Layout::is_debug_info_section): New function.
3714 (Layout::add_comdat): Add new parameters.
3715 (Layout::find_kept_object): New function.
3716 (Layout::Kept_section): New struct.
3717 (Layout::Signatures): Change type of map range.
3718 * object.cc (Relobj::output_section_address): New function.
3719 (Sized_relobj::include_section_group): Add new parameters. Change
3720 calls to Layout::add_comdat. Change to build table of kept comdat
3721 groups and table mapping discarded sections to kept sections.
3722 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
3723 (Sized_relobj::do_layout): Change calls to include_section_group and
3724 include_linkonce_section.
3725 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
3726 value to zero when section is discarded.
3727 (Sized_relobj::map_to_kept_section): New function.
3728 * object.h (Relobj::output_section_address): New function.
3729 (Relobj::Comdat_group): New type.
3730 (Relobj::find_comdat_group): New function.
3731 (Relobj::Comdat_group_table): New type.
3732 (Relobj::Kept_comdat_section): New type.
3733 (Relobj::Kept_comdat_section_table): New type.
3734 (Relobj::add_comdat_group): New function.
3735 (Relobj::set_kept_comdat_section): New function.
3736 (Relobj::get_kept_comdat_section): New function.
3737 (Relobj::comdat_groups_): New field.
3738 (Relobj::kept_comdat_sections_): New field.
3739 (Symbol_value::input_value): Update comment.
3740 (Sized_relobj::map_to_kept_section) New function.
3741 (Sized_relobj::include_linkonce_section): Add new parameter.
3742 * target-reloc.h (Comdat_behavior): New type.
3743 (get_comdat_behavior): New function.
3744 (relocate_section): Add code to map a discarded section to the
3745 corresponding kept section when applying a relocation.
3746
e4e5049b
CS
37472008-04-30 Craig Silverstein <csilvers@google.com>
3748
3749 * dwarf_reader.cc (next_generation_count): New static var.
3750 (Addr2line_cache_entry): New struct.
3751 (addr2line_cache): New static var.
3752 (Dwarf_line_info::one_addr2line): Added caching.
3753 (Dwarf_line_info::clear_addr2line_cache): New function.
3754 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
3755 cache-size parameter.
3756 (Dwarf_line_info::one_addr2line_cache): New function.
3757 * symtab.cc (Symbol_table::detect_odr_violations): Pass
3758 new cache-size argument to one_addr2line(), and clear cache.
3759
d09e9154
CC
37602008-04-28 Cary Coutant <ccoutant@google.com>
3761
3762 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
3763 R_386_PC8 relocations.
3764
7ef73768
ILT
37652008-04-23 Ian Lance Taylor <iant@google.com>
3766
55438702
ILT
3767 * object.cc (Sized_relobj::include_section_group): Check for
3768 invalid section group.
3769
c165fb93
ILT
3770 * object.cc (make_elf_object): Correct test for 64-bit ELF file
3771 header size.
3772
7ef73768
ILT
3773 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
3774 than read for file header.
3775 * archive.cc (Archive::include_member): Likewise.
3776
6194aaab
L
37772008-04-23 Paolo Bonzini <bonzini@gnu.org>
3778
3779 * aclocal.m4: Regenerate.
3780 * configure: Regenerate.
3781
d491d34e
ILT
37822008-04-19 Ian Lance Taylor <iant@google.com>
3783
5ea2bac6
ILT
3784 * version.cc (version_string): Bump to 1.6.
3785
7bc3e21a
ILT
3786 * testsuite/Makefile.am (many_sections_r_test): New target.
3787 (many_sections_r_test_SOURCES): Remove.
3788 (many_sections_r_test_DEPENDENCIES): Remove.
3789 (many_sections_r_test_LDFLAGS): Remove.
3790 (many_sections_r_test_LDADD): Remove.
3791
7fcd3aa9
ILT
3792 * object.cc (Sized_relobj::do_add_symbols): Always pass
3793 local_symbol_count_ to add_from_relobj.
3794
4c94d6ae
ILT
3795 * testsuite/Makefile.am (many_sections_check.h): Only check one in
3796 every thousand variables.
3797 * testsuite/Makefile.in: Rebuild.
3798
d491d34e
ILT
3799 * object.cc (Xindex::initialize_symtab_xindex): New function.
3800 (Xindex::read_symtab_xindex): New function.
3801 (Xindex::sym_xindex_to_shndx): New function.
3802 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
3803 available.
3804 (Sized_relobj::do_initialize_xindex): New function.
3805 (Sized_relobj::do_read_symbols): Adjust section links.
3806 (Sized_relobj::symbol_section_and_value): Add is_ordinary
3807 parameter. Change all callers.
3808 (Sized_relobj::include_section_group): Adjust section links and
3809 symbol section indexes.
3810 (Sized_relobj::do_layout): Adjust section links.
3811 (Sized_relobj::do_count_local_symbols): Adjust section links and
3812 symbol section indexes.
3813 (Sized_relobj::do_finalize_local_symbols): Distinguish between
3814 ordinary and special symbols.
3815 (Sized_relobj::write_local_symbols): Add symtab_xindex and
3816 dynsym_xindex parameters. Change all callers. Adjust section
3817 links. Use SHN_XINDEX when needed.
3818 (Sized_relobj::get_symbol_location_info): Adjust section links.
3819 Don't get fooled by special symbols.
3820 * object.h (class Xindex): Define.
3821 (class Object): Add xindex_ parameter. Declare virtual functoin
3822 do_initialize_xindex.
3823 (Object::adjust_sym_shndx): New function.
3824 (Object::set_xindex): New protected function.
3825 (class Symbol_value): Add is_ordinary_shndx_ field.
3826 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
3827 (Symbol_value::value): Assert ordinary section.
3828 (Symbol_value::initialize_input_to_output_map): Likewise.
3829 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
3830 Change all callers.
3831 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
3832 all callers.
3833 (class Sized_relobj): Update declarations.
3834 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
3835 parameter. Change all callers.
3836 (Sized_relobj::adjust_shndx): New function.
3837 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
3838 field.
3839 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
3840 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
3841 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
3842 (Sized_dynobj::read_dynsym_section): Adjust section links.
3843 (Sized_dynobj::read_dynamic): Likewise.
3844 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
3845 section links.
3846 (Sized_dynobj::do_initialize_xindex): New function.
3847 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
3848 do_initialize_xindex.
3849 (Sized_dynobj::adjust_shndx): New function.
3850 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
3851 dynsym_xindex_ fields.
3852 (Layout::finalize): Add a call to set_section_indexes before
3853 creating the symtab sections.
3854 (Layout::set_section_indexes): Don't do anything if the section
3855 already has a section index.
3856 (Layout::create_symtab_sections): Add shnum parameter. Change
3857 caller. Create .symtab_shndx section if needed.
3858 (Layout::create_shdrs): Add shstrtab_section parameter. Change
3859 caller.
3860 (Layout::allocated_output_section_count): New function.
3861 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
3862 needed.
3863 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
3864 fields. Update declarations.
3865 (Layout::symtab_xindex): New function.
3866 (Layout::dynsym_xindex): New function.
3867 (class Write_symbols_task): Add layout_ field.
3868 (Write_symbols_task::Write_symbols_task): Add layout parameter.
3869 Change caller.
3870 * output.cc (Output_section_headers::Output_section_headers): Add
3871 shstrtab_section parameter. Change all callers.
3872 (Output_section_headers::do_sized_write): Store overflow values
3873 for section count and section string table section index in
3874 section header zero.
3875 (Output_file_header::do_sized_write): Check for overflow of
3876 section count and section string table section index.
3877 (Output_symtab_xindex::do_write): New function.
3878 (Output_symtab_xindex::endian_do_write): New function.
3879 * output.h (class Output_section_headers): Add shstrtab_section_.
3880 Update declarations.
3881 (class Output_symtab_xindex): Define.
3882 (Output_section::has_out_shndx): New function.
3883 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
3884 field.
3885 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
3886 Change all callers.
3887 (Sized_symbol::init): Likewise.
3888 (Symbol::output_section): Check for ordinary symbol.
3889 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
3890 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
3891 callers.
3892 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
3893 Change all callers. Simplify handling of symbols from sections
3894 not included in the link.
3895 (Symbol_table::add_from_dynobj): Handle ordinary symbol
3896 distinction.
3897 (Weak_alias_sorter::operator()): Assert that symbols are
3898 ordinary.
3899 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
3900 distinction.
3901 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
3902 parameters. Change all callers.
3903 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
3904 symbol distinction. Use SHN_XINDEX when needed.
3905 (Symbol_table::write_section_symbol): Add symtab_xindex
3906 parameter. Change all callers.
3907 (Symbol_table::sized_write_section_symbol): Likewise. Use
3908 SHN_XINDEX when needed.
3909 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
3910 declarations.
3911 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
3912 (Symbol::is_defined): Check is_ordinary.
3913 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
3914 (Symbol::is_absolute, Symbol::is_common): Likewise.
3915 (class Sized_symbol): Update declarations.
3916 (class Symbol_table): Update declarations.
3917 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
3918 parameters. Change all callers.
3919 (Sized_symbol::override): Likewise.
3920 (Symbol_table::override): Likewise.
3921 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
3922 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
3923 is_ordinary, and orig_st_shndx parameters. Change all callers.
3924 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
3925 to be in an ordinary section.
3926 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
3927 object and is_ordinary parameters. Change all callers.
3928 (Sized_dwarf_line_info::read_relocs): Add object parameter.
3929 Change all callers. Don't add undefined or non-ordinary symbols
3930 to reloc_map_.
3931 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
3932 Change all callers.
3933 * dwarf_reader.h (class Sized_dwarf_line_info): Update
3934 declarations.
3935 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
3936 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
3937 (Sized_relobj::relocate_sections): Likewise.
3938 * target-reloc.h (scan_relocs): Adjust section symbol index.
3939 (scan_relocatable_relocs): Likewise.
3940 * i386.cc (Scan::local): Check for ordinary symbols.
3941 * sparc.cc (Scan::local): Likewise.
3942 * x86_64.cc (Scan::local): Likewise.
3943 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
3944 to symbol_section_and_value.
3945 * testsuite/many_sections_test.cc: New file.
3946 * testsuite/Makefile.am (BUILT_SOURCES): Define.
3947 (check_PROGRAMS): Add many_sections_test.
3948 (many_sections_test_SOURCES): Define.
3949 (many_sections_test_DEPENDENCIES): Define.
3950 (many_sections_test_LDFLAGS): Define.
3951 (BUILT_SOURCES): Add many_sections_define.h.
3952 (many_sections_define.h): New target.
3953 (BUILT_SOURCES): Add many_sections_check.h.
3954 (many_sections_check.h): New target.
3955 (check_PROGRAMS): Add many_sections_r_test.
3956 (many_sections_r_test_SOURCES): Define.
3957 (many_sections_r_test_DEPENDENCIES): Define.
3958 (many_sections_r_test_LDFLAGS): Define.
3959 (many_sections_r_test_LDADD): Define.
3960 (many_sections_r_test.o): New target.
3961 * testsuite/Makefile.in: Rebuild.
3962
c5818ff1
CC
39632008-04-17 Cary Coutant <ccoutant@google.com>
3964
3965 * errors.cc (Errors::info): New function.
3966 (gold_info): New function.
3967 * errors.h (Errors::info): New function.
3968 * gold.h (gold_info): New function.
3969 * object.cc (Input_objects::add_object): Print trace output.
3970 * options.cc (options::parse_set): New function.
3971 (General_options::parse_wrap): Deleted.
3972 (General_options::General_options): Deleted initializer.
3973 * options.h (options::String_set): New typedef.
3974 (options::parse_set): New function.
3975 (DEFINE_set): New macro.
3976 (General_options::wrap): Changed to use DEFINE_set. Changed
3977 callers of any_wrap_symbols and is_wrap_symbol.
3978 (General_options::trace, General_options::trace_symbol):
3979 New options.
3980 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
3981 (General_options::wrap_symbols_): Deleted.
3982 * symtab.cc (Symbol_table::add_from_object): Print trace output.
3983
b5be4a7c
DM
39842008-04-17 David S. Miller <davem@davemloft.net>
3985
3986 * options.cc (General_options::parse_V): New function.
3987 * options.h: Add entries for -V and -Qy.
3988
155a0dd7
ILT
39892008-04-17 Ian Lance Taylor <iant@google.com>
3990
3991 * common.cc (Symbol_table::allocate_commons): Remove options
3992 parameter. Change caller.
3993 (Symbol_table::do_allocate_commons): Remove options parameter.
3994 Change caller. Just call do_allocate_commons_list twice.
3995 (Symbol_table::do_allocate_commons_list): New function, broken out
3996 of do_allocate_commons.
3997 * common.h (class Allocate_commons_task): Remove options_ field.
3998 Update constructor.
3999 * symtab.cc (Symbol_table::Symbol_table): Initialize
4000 tls_commons_.
4001 (Symbol_table::add_from_object): Put TLS common symbols on
4002 tls_commons_ list.
4003 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
4004 which are IN_OUTPUT_DATA.
4005 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
4006 allocate_commons and do_allocate_commons declarations. Declare
4007 do_allocate_commons_list.
4008 * gold.cc (queue_middle_tasks): Update creation of
4009 Allocate_commons_task to not pass options.
4010 * testsuite/Makefile.am (INCLUDES): Add -I.. .
4011 (TLS_TEST_C_FLAGS): New variable.
4012 (tls_test_c_pic.o): New target.
4013 (tls_test_shared.so): Link in tls_test_c_pic.o.
4014 (tls_test_c_pic_ie.o): New target.
4015 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
4016 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
4017 (tls_test_c.o): New target.
4018 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
4019 (tls_pic_test_LDADD): Likewise.
4020 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
4021 (tls_shared_gd_to_ie_test_LDADD): Likewise.
4022 (tls_test_c_gnu2.o): New target.
4023 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
4024 tls_test_c_gnu2.o.
4025 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
4026 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
4027 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
4028 * testsuite/tls_test.cc: Include "config.h".
4029 (t_last): Call t11_last.
4030 * testsuite/tls_test.h (t11, t11_last): Declare.
4031 * testsuite/tls_test_c.c: New file.
4032 * testsuite/tls_test_main.cc (thread_routine): Call t11.
4033 * configure.ac: Check for OpenMP support.
4034 * configure, config.in, Makefile.in: Rebuild.
4035 * testsuite/Makefile.in: Rebuild.
4036
edfbb029
CC
40372008-04-16 Cary Coutant <ccoutant@google.com>
4038
4039 * i386.cc (Target_i386::define_tls_base_symbol): New function.
4040 (Target_i386::tls_base_symbol_defined_): New field.
4041 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
4042 (Target_i386::Scan::global): Likewise.
4043 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
4044 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
4045 (Target_x86_64::tls_base_symbol_defined_): New field.
4046 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
4047 (Target_x86_64::Scan::global): Likewise.
4048
f3c69fca
CC
40492008-04-16 Cary Coutant <ccoutant@google.com>
4050
4051 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
4052 (Symbol::needs_plt_entry): Allow weak undefined symbols.
4053 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
4054 building shared libraries.
4055 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
4056 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
4057 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
4058 * testsuite/Makefile.in: Rebuild.
4059 * testsuite/weak_undef.h: New file.
4060 * testsuite/weak_undef_file1.cc: Add extra test cases.
4061 * testsuite/weak_undef_file2.cc: Likewise.
4062 * testsuite/weak_undef_test.cc: Likewise.
4063
7c414435
DM
40642008-04-16 David S. Miller <davem@davemloft.net>
4065
32b769e1
DM
4066 * sparc.cc (Target_sparc::Scan): Change from struct to class.
4067 Add issued_non_pic_error_ field. Declare check_non_pic.
4068 (Target_sparc::Scan::check_non_pic): New function.
4069 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
4070 (Target_sparc::Scan::global): Likewise.
4071
11936fb1
DM
4072 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
4073 * configure: Rebuild.
4074
7c414435
DM
4075 * options.h (DEFINE_enable): New macro.
4076 (new_dtags): New enable option.
4077 (initfirst, interpose, loadfltr, nodefaultlib,
4078 nodelete, nodlopen, nodump): New -z options.
4079 * layout.cc (Layout:finish_dynamic_section): If new
4080 dtags enabled, emit DT_RUNPATH. Also, emit a
4081 DT_FLAGS_1 containing any specified -z flags.
4082
85c7bf8b
ILT
40832008-04-16 Ian Lance Taylor <iant@google.com>
4084
12c0daef
ILT
4085 * copy-relocs.cc: New file.
4086 * copy-relocs.h: New file.
4087 * reloc.cc: Remove Copy_relocs code.
4088 * reloc.h: Likewise.
4089 * reloc-types.h (struct Reloc_types) [both versions]: Add
4090 get_reloc_addend_noerror.
4091 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
4092 variants of add_global which take an addend which must be zero.
4093 * i386.cc: Include "copy-relocs.h".
4094 (class Target_i386): Change type of copy_relocs_ to variable,
4095 update initializer.
4096 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
4097 Change all callers.
4098 (Target_i386::do_finalize_sections): Change handling of
4099 copy_relocs_.
4100 * sparc.cc: Include "copy-relocs.h".
4101 (class Target_sparc): Change type of copy_relocs_ to variable,
4102 update initializer.
4103 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
4104 Change all callers.
4105 (Target_sparc::do_finalize_sections): Change handling of
4106 copy_relocs_.
4107 * x86_64.cc: Include "copy-relocs.h".
4108 (class Target_x86_64): Change type of copy_relocs_ to variable,
4109 update initializer.
4110 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
4111 class. Change all callers.
4112 (Target_x86_64::do_finalize_sections): Change handling of
4113 copy_relocs_.
4114 * Makefile.am (CCFILES): Add copy-relocs.cc.
4115 (HFILES): Add copy-relocs.h.
4116
4f4995b6
ILT
4117 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
4118
85c7bf8b
ILT
4119 * testsuite/script_test_4.sh: Permit leading zeroes.
4120
4f2a9edd
ILT
41212008-04-15 Ian Lance Taylor <iant@google.com>
4122
e6188289
ILT
4123 * script-sections.cc (Script_sections::create_segments): Use
4124 header_size_adjustment even when there is enough room for the
4125 headers.
4126 * testsuite/script_test_4.sh: New file.
4127 * testsuite/script_test_4.t: New file.
4128 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
4129 (check_DATA): Add script_test_4.stdout.
4130 (MOSTLYCLEANFILES): Likewise.
4131 (script_test_4): New target.
4132 (script_test_4.stdout): New target.
4133 * testsuite/Makefile.in: Rebuild.
4134
4f2a9edd
ILT
4135 * sparc.cc: Add definitions for Output_data_plt_sparc class
4136 constants.
4137
f5314dd5
DM
41382008-04-14 David S. Miller <davem@davemloft.net>
4139
4140 * sparc.cc: New file.
4141 * Makefile.am (TARGETSOURCES): Add sparc.cc
4142 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
4143 * configure.tgt: Document targ_extra_size and
4144 targ_extra_big_endian. Add entries for sparc-* and
4145 sparc64-*.
4146 * configure.ac: Handle targ_extra_size and
4147 targ_extra_big_endian.
4148 * Makefile.in: Rebuild.
4149 * configure: Likewise.
4150 * po/POTFILES.in: Likewise.
4151 * po/gold.pot: Likewise.
4152
154e0e9a
ILT
41532008-04-14 Ian Lance Taylor <iant@google.com>
4154
4155 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
4156 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
4157 in the name/type/flags to section mapping. Don't call
4158 allocate_output_section.
4159 (Layout::choose_output_section): Change parameter from adjust_name
4160 to is_input_section. Don't permit input sections after sections
4161 are attached to segments. Don't call allocate_output_section.
4162 (Layout::layout_eh_frame): Call update_flags_for_input_section,
4163 not write_enable_output_section.
4164 (Layout::make_output_section): Don't push to
4165 unattached_section_list_ nor call attach_to_segment. Call
4166 attach_section_to_segment if sections are attached.
4167 (Layout::attach_sections_to_segments): New function.
4168 (Layout::attach_section_to_segment): New function.
4169 (Layout::attach_allocated_section_to_segment): Rename from
4170 attach_to_segment. Remove flags parameter.
4171 (Layout::allocate_output_section): Remove function.
4172 (Layout::write_enable_output_section): Remove function.
4173 * layout.h (class Layout): Update for above changes. Add new
4174 field sections_are_attached_.
4175 * output.h (Output_section::update_flags_for_input_section): New
4176 function.
4177 * output.cc (Output_section::add_input_section): Call
4178 update_flags_for_input_section.
4179 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
4180
009a67a2
CC
41812008-04-11 Cary Coutant <ccoutant@google.com>
4182
4183 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
4184 thought unnecessary.
4185 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
4186
759b1a24
ILT
41872008-04-11 Ian Lance Taylor <iant@google.com>
4188
4189 * output.h (class Output_section_data): Remove inline definition
4190 of set_addralign.
4191 * output.cc (Output_section_data::set_addralign): New function.
4192
c2b45e22
CC
41932008-04-11 Cary Coutant <ccoutant@google.com>
4194
4195 Add support for TLS descriptors for i386 and x86_64.
4196 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
4197 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
4198 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
4199 GOT_TYPE_TLS_DESC.
4200 (Target_i386::got_mod_index_entry): Remove unnecessary code.
4201 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
4202 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
4203 relocations.
4204 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
4205 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
4206 Fix problem with initial-exec relocations.
4207 (Target_i386::Relocate::relocate_tls): Likewise.
4208 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
4209 relaxation.
4210 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
4211 support for section-plus-offset dynamic table entries.
4212 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
4213 (Output_data_dynamic::Dynamic_entry): Add support for
4214 section-plus-offset dynamic table entries.
4215 (Output_data_dynamic::Classification): Likewise.
4216 (Output_data_dynamic::classification_): Renamed offset_.
4217 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
4218 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
4219 (Target_x86_64::make_plt_section): New function.
4220 (Target_x86_64::reserve_tlsdesc_entries): New function.
4221 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
4222 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
4223 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
4224 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
4225 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
4226 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
4227 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
4228 add extra PLT entry for TLS descriptors.
4229 (Output_data_plt_x86_64::got_): New field.
4230 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
4231 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
4232 fields.
4233 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
4234 descriptors.
4235 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
4236 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
4237 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
4238 R_386_TLS_DESC_CALL relocations.
4239 (Target_x86_64::Scan::global): Likewise.
4240 (Target_x86_64::do_finalize_sections): Add dynamic table entries
4241 for TLS descriptors.
4242 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
4243 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
4244 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
4245 GD-to-IE relaxation.
4246 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
4247 and TLS_DESCRIPTORS.
4248 * Makefile.in: Rebuild.
4249 * configure: Rebuild.
4250 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
4251 (tls_test_shared2.so): New target.
4252 (tls_shared_gd_to_ie_test_SOURCES): New variable.
4253 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
4254 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
4255 (tls_shared_gd_to_ie_test_LDADD): New variable.
4256 (tls_shared_gnu2_gd_to_ie_test): New target.
4257 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
4258 New targets.
4259 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
4260 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
4261 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
4262 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
4263 (tls_shared_gnu2_test): New target.
4264 (tls_test_gnu2_shared.so): New target.
4265 (tls_shared_gnu2_test_SOURCES): New variable.
4266 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
4267 (tls_shared_gnu2_test_LDFLAGS): New variable.
4268 (tls_shared_gnu2_test_LDADD): New variable.
4269 * testsuite/Makefile.in: Rebuild.
4270 * testsuite/Makefile.
4271
83bfb6b7
ILT
42722008-04-11 Ian Lance Taylor <iant@google.com>
4273
4274 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
4275 justsyms.t.
4276 * testsuite/Makefile.in: Rebuild.
4277
4278 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
4279 long.
4280 * testsuite/script_test_2.cc (main): Adjust test.
4281
706e1f5e
ILT
42822008-04-11 David S. Miller <davem@davemloft.net>
4283 Ian Lance Taylor <iant@google.com>
4284
4285 * options.h (General_options): Add entries for '-Y' and
4286 '-relax'.
4287 * options.cc (General_options:finalize): If -Y was used, add those
4288 entries to the library path instead of the default "/lib" and
4289 "/usr/lib".
4290
7c98e6bb
DM
42912008-04-11 David S. Miller <davem@davemloft.net>
4292
4293 * testsuite/justsyms.t: Start at 0x100.
4294 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
4295 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
4296 long.
4297 * testsuite/script_test_2.cc: Adjust string and section length
4298 checks.
7c98e6bb 4299
99a37bfd
ILT
43002008-04-09 Ian Lance Taylor <iant@google.com>
4301
2cefc357
ILT
4302 PR gold/5996
4303 * script-sections.cc (Sections_element::allocate_to_segment): Add
4304 orphan parameter.
4305 (Output_section_definition::allocate_to_segment): Likewise.
4306 (Orphan_output_section::allocate_to_segment): Likewise.
4307 (Script_sections::attach_sections_using_phdrs_clause): Don't
4308 propagate non-PT_LOAD segments to orphan sections.
4309 * testsuite/Makefile.am (script_test_3.stdout): Generate using
4310 readelf rather than objdump.
4311 * testsuite/script_test_3.sh: Adjust accordingly. Test that
4312 .interp section and PT_INTERP segment are the same size.
4313 * testsuite/Makefile.in: Rebuild.
4314
99a37bfd
ILT
4315 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
4316 aliases for symbols defined in the same object.
4317 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
4318 (weak_alias_test_SOURCES): New variable.
4319 (weak_alias_test_DEPENDENCIES): New variable.
4320 (weak_alias_test_LDFLAGS): New variable.
4321 (weak_alias_test_LDADD): New variable.
4322 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
4323 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
4324 (weak_alias_test_3.o): New target.
4325 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
4326 * testsuite/weak_alias_test_main.cc: New file.
4327 * testsuite/weak_alias_test_1.cc: New file.
4328 * testsuite/weak_alias_test_2.cc: New file.
4329 * testsuite/weak_alias_test_3.cc: New file.
4330
780e49c5
ILT
43312008-04-08 Ian Lance Taylor <iant@google.com>
4332
cdb0b8f5
ILT
4333 * options.h (class General_options): Add --noinhibit-exec option.
4334 * main.cc (main): Check --noinhibit-exec.
4335
0864d551
ILT
4336 * options.h (class General_options): Define --wrap as a special
4337 option. Add wrap_symbols_ field.
4338 (General_options::any_wrap_symbols): New function.
4339 (General_options::is_wrap_symbol): New function.
4340 * options.cc (General_options::parse_wrap): New function.
4341 (General_options::General_options): Initialize wrap_symbols_.
4342 * symtab.cc (Symbol_table::wrap_symbol): New function.
4343 (Symbol_table::add_from_object): Handle --wrap.
4344 * symtab.h (class Symbol_table): Declare wrap_symbol.
4345 * target.h (Target::wrap_char): New function.
4346 (Target::Target_info): Add wrap_char field.
4347 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
4348 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4349 * testsuite/testfile.cc (Target_test::test_target_info):
4350 Likewise.
4351
789aa6de
ILT
4352 * errors.cc (Errors::undefined_symbol): Mention symbol version if
4353 there is one.
4354
2c38906f
ILT
4355 * layout.h (class Layout): Add added_eh_frame_data_ field.
4356 * layout.cc (Layout::Layout): Initialize new field.
4357 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
4358 output section until we find a section we merged successfully.
4359 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
4360 that the size be non-zero.
4361
780e49c5
ILT
4362 * merge.cc (Object_merge_map::get_output_offset): Remove inline
4363 qualifier.
4364
7fcd0256
ILT
43652008-04-08 Craig Silverstein <csilvers@google.com>
4366
4367 * configure.ac: Export new conditional variable HAVE_ZLIB.
4368 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
4369 on HAVE_ZLIB.
4370 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
4371 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
4372
6835af53
ILT
43732008-04-07 Ian Lance Taylor <iant@google.com>
4374
e24f324c
ILT
4375 * version.cc (version_string): Set to "1.5".
4376
a036edd8
ILT
4377 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
4378 Add issued_non_pic_error_ field. Declare check_non_pic.
4379 (Target_x86_64::Scan::check_non_pic): New function.
4380 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
4381 (Target_x86_64::Scan::global): Likewise.
4382
624f8810
ILT
4383 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
4384 addend parameter. Change caller. Handle merge sections.
4385 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
4386 Address to Addend. Don't add in the result of
4387 local_section_offset, pass down the addend and use the returned
4388 value.
4389 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
4390 Update declarations of local_section_offset and symbol_value.
4391 * testsuite/two_file_test_1.cc (t18): New function.
4392 * testsuite/two_file_test_2.cc (f18): New function.
4393 * testsuite/two_file_test_main.cc (main): Call t18.
4394 * testsuite/two_file_test.h (t18, f18): Declare.
4395
6835af53
ILT
4396 * configure.ac: Don't test for objdump, c++filt, or readelf.
4397 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
4398 conditionals.
4399 (TEST_READELF): New variable.
4400 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
4401 (check_PROGRAMS): Add two_file_strip_test.
4402 (two_file_strip_test): New target.
4403 (check_PROGRAMS): Add two_file_same_shared_strip_test.
4404 (two_file_same_shared_strip_test_SOURCES): New variable.
4405 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
4406 (two_file_same_shared_strip_test_LDFLAGS): New variable.
4407 (two_file_same_shared_strip_test_LDADD): New variable.
4408 (two_file_shared_strip.so): New target.
4409 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
4410 (ver_test_5.syms, ver_test_7.syms): Likewise.
4411 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
4412 (strip_test_3.stdout): Use TEST_OBJDUMP.
4413 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
4414
86925eef
CC
44152008-04-04 Cary Coutant <ccoutant@google.com>
4416
4417 * symtab.h (Symbol::is_weak_undefined): New function.
4418 (Symbol::is_strong_undefined): New function.
4419 (Symbol::is_absolute): New function.
4420 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
4421 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
4422 absolute symbols.
4423 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
4424 (weak_undef_test): New target.
4425 * testsuite/Makefile.in: Rebuild.
4426 * testsuite/weak_undef_file1.cc: New file.
4427 * testsuite/weak_undef_file2.cc: New file.
4428 * testsuite/weak_undef_test.cc: New file.
4429
126f3ece
ILT
44302008-04-03 Craig Silverstein <csilvers@google.com>
4431
4432 * compressed_output.h (class Output_compressed_section): Use
4433 unsigned buffer.
4434 * compressed_output.cc (zlib_compress): Use unsigned buffers,
4435 add zlib header.
4436 (zlib_compressed_suffix): Removed.
4437 (Output_compressed_section::set_final_data_size): Use unsigned
4438 buffers.
4439 * testsuite/Makefile.am (flagstest_compress_debug_sections):
4440 Fix linker invocation.
4441 (flagstest_o_specialfile_and_compress_debug_sections):
4442 Likewise.
4443 * testsuite/Makefile.in: Regenerated.
4444
deae2a14
DM
44452008-04-02 David S. Miller <davem@davemloft.net>
4446
4447 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
4448 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
4449
70752818
ILT
44502008-04-02 Craig Silverstein <csilvers@google.com>
4451
4452 * TODO: New file.
4453
39d0cb0e
ILT
44542008-04-02 Ian Lance Taylor <iant@google.com>
4455
4456 * fileread.cc (File_read::find_view): Add byteshift and vshifted
4457 parameters. Update for new key type to views_. Change all
4458 callers.
4459 (File_read::read): Adjust for byteshift in returned view.
4460 (File_read::add_view): New function, broken out of
4461 find_and_make_view.
4462 (File_read::make_view): New function, broken out of
4463 find_and_make_view.
4464 (File_read::find_or_make_view): Add offset and aligned
4465 parameters. Rewrite accordingly. Change all callers.
4466 (File_read::get_view): Add offset and aligned parameters. Adjust
4467 for byteshift in return value.
4468 (File_read::get_lasting_view): Likewise.
4469 * fileread.h (class File_read): Update declarations.
4470 (class File_read::View): Add byteshift_ field. Add byteshift to
4471 constructor. Add byteshift method.
4472 * archive.h (Archive::clear_uncached_views): New function.
4473 (Archive::get_view): Add aligned parameter. Change all callers.
4474 * object.h (Object::get_view): Add aligned parameter. Change all
4475 callers.
4476 (Object::get_lasting_view): Likewise.
4477
4478 * fileread.cc (File_read::release): Don't call clear_views if
4479 there are multiple objects.
4480 * fileread.h (File_read::clear_uncached_views): New function.
4481 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
4482 on the archive.
4483
a1207466
CC
44842008-03-31 Cary Coutant <ccoutant@google.com>
4485
4486 Add thin archive support.
4487 * archive.cc (Archive::armagt): New const.
4488 (Archive::setup): Remove task parameter and calls to unlock.
4489 (Archive::unlock_nested_archives): New function.
4490 (Archive::read_header): Add nested_off parameter. Change
4491 all callers.
4492 (Archive::interpret_header): Likewise.
4493 (Archive::include_all_members): Change to handle thin
4494 archives.
4495 (Archive::include_member): Likewise.
4496 * archive.h (Archive::Archive): Add new parameters and
4497 initializers.
4498 (Archive::armagt): New const.
4499 (Archive::setup): Remove task parameter.
4500 (Archive::unlock_nested_archives): New function.
4501 (Archive::read_header): Add nested_off parameter.
4502 (Archive::interpret_header): Likewise.
4503 (Archive::Nested_archive_table): New typedef.
4504 (Archive::is_thin_archive_): New field.
4505 (Archive::nested_archives_): New field.
4506 (Archive::options_): New field.
4507 (Archive::dirpath_): New field.
4508 (Archive::task_): New field.
4509 * readsyms.cc (Read_symbols::do_read_symbols): Add check
4510 for thin archives. Pass additional parameters to
4511 Archive::Archive. Unlock the archive file after calling
4512 Archive::setup.
cd536b21 4513
479f6503
ILT
45142008-03-29 Ian Lance Taylor <iant@google.com>
4515
686c8caf
ILT
4516 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
4517 version symbol to be local.
4518 * testsuite/ver_test_4.sh: New file.
4519 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
4520 (check_DATA): Add ver_test_4.syms.
4521 (ver_test_4.syms): New target.
4522 * testsuite/Makefile.in: Rebuild.
4523
ab794b6b
ILT
4524 * output.cc
4525 (Output_section::Input_section_sort_entry::has_priority): New
4526 function.
4527 (Output_section::Input_section_sort_entry::match_file_name): New
4528 function.
4529 (Output_section::Input_section_sort_entry::match_section_name):
4530 Remove.
4531 (Output_section::Input_section_sort_entry::match_section_name_prefix):
4532 Remove.
4533 (Output_section::Input_section_sort_entry::match_section_file):
4534 Remove.
4535 (Output_section::Input_section_sort_compare::operator()): Rewrite
4536 using new Input_section_sort_entry functions. Sort crtbegin and
4537 crtend first. Sort sections with no priority before sections with
4538 a priority.
4539 * testsuite/initpri1.c (d3): Check j != 4.
4540 (cd5): New constructor/destructor function.
4541 (main): Check j != 2.
4542
479f6503
ILT
4543 * symtab.cc (Symbol_table::add_from_object): If we don't use the
4544 new symbol when resolving, don't call set_is_default.
4545 * testsuite/ver_test_7.cc: New file.
4546 * testsuite/ver_test_7.sh: New file.
4547 * testsuite/Makefile.am (ver_test_7.so): New target.
4548 (ver_test_7.o): New target.
4549 (check_SCRIPTS): Add ver_test_7.sh.
4550 (check_DATA): Add ver_test_7.syms.
4551 (ver_test_7.syms): New target.
4552
2fd32231
ILT
45532008-03-28 Ian Lance Taylor <iant@google.com>
4554
4555 * layout.cc (Layout::layout): If we see an input section with a
4556 name that needs sorting, set the must_sort flag for the output
4557 section.
4558 (Layout::make_output_section): If the name of the output section
4559 indicates that it might require sorting, set the may_sort flag.
4560 * output.h (Output_section::may_sort_attached_input_sections): New
4561 function.
4562 (Output_section::set_may_sort_attached_input_sections): New
4563 function.
4564 (Output_section::must_sort_attached_input_sections): New
4565 function.
4566 (Output_section::set_must_sort_attached_input_sections): New
4567 function.
4568 (class Output_section): Declare Input_section_sort_entry. Define
4569 Input_section_sort_compare. Declare
4570 sort_attached_input_sections. Add new fields:
4571 may_sort_attached_input_sections_,
4572 must_sort_attached_input_sections_,
4573 attached_input_sections_are_sorted_.
4574 * output.cc (Output_section::Output_section): Initialize new
4575 fields.
4576 (Output_section::add_input_section): Add an entry to
4577 input_sections_ if may_sort or must_sort are true.
4578 (Output_section::set_final_data_size): Call
4579 sort_attached_input_sections if necessary.
4580 (Output_section::Input_section_sort_entry): Define new class.
4581 (Output_section::Input_section_sort_compare::operator()): New
4582 function.
4583 (Output_section::sort_attached_input_sections): New function.
4584 * configure.ac: Check whether the compiler supports constructor
4585 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
4586 * testsuite/initpri1.c: New file.
4587 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
4588 CONSTRUCTOR_PRIORITY.
4589 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
4590 (initpri1_LDFLAGS): New variable.
4591 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
4592
18e6b24e
ILT
45932008-03-27 Ian Lance Taylor <iant@google.com>
4594
49bdd526
ILT
4595 * common.cc (Sort_commons::operator): Correct sorting algorithm.
4596 * testsuite/common_test_1.c: New file.
4597 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
4598 (common_test_1_SOURCES): New variable.
4599 (common_test_1_DEPENDENCIES): New variable.
4600 (common_test_1_LDFLAGS): New variable.
4601
18e6b24e
ILT
4602 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
4603 and commons_ correctly when NAME/VERSION does not override
4604 NAME/NULL.
4605 * testsuite/ver_test_6.c: New file.
4606 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
4607 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
4608 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
4609
04bf7072
ILT
46102008-03-26 Ian Lance Taylor <iant@google.com>
4611
5871526f
ILT
4612 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
4613 of an undefined symbol from a version script.
4614 * testsuite/Makefile.am (ver_test_5.so): New target.
4615 (ver_test_5.o): New target.
4616 (check_SCRIPTS): Add ver_test_5.sh.
4617 (check_DATA): Add ver_test_5.syms.
4618 (ver_test_5.syms): New target.
4619 * testsuite/ver_test_5.cc: New file.
4620 * testsuite/ver_test_5.script: New file.
4621 * testsuite/ver_test_5.sh: New file.
4622 * Makefile.in, testsuite/Makefile.in: Rebuild.
4623
04bf7072
ILT
4624 PR gold/5986
4625 Fix problems building gold with gcc 4.3.0.
4626 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
4627 (gold_error_at_location, gold_warning_at_location): Use it.
4628 * configure.ac: Check whether we can compile and use a template
4629 function with a printf attribute.
4630 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
4631 when jumping over bytes.
4632 * object.cc: Instantiate Object::read_section_data.
4633 * debug.h: Include <cstring>
4634 * dwarf_reader.cc: Include <algorithm>
4635 * main.cc: Include <cstring>.
4636 * options.cc: Include <cstring>.
4637 * output.cc: Include <cstring>.
4638 * script.cc: Include <cstring>.
4639 * script.h: Include <string>.
4640 * symtab.cc: Include <cstring> and <algorithm>.
4641 * target-select.cc: Include <cstring>.
4642 * version.cc: Include <string>.
4643 * testsuite/testmain.cc: Include <cstdlib>.
4644 * configure, config.in: Rebuild.
4645
874c5b28
ILT
46462008-03-25 Ian Lance Taylor <iant@google.com>
4647
819d6c3a
ILT
4648 * options.cc: Include "../bfd/bfdver.h".
4649 (options::help): Print bug reporting address.
4650
f4b2c6f5
ILT
4651 * version.cc (print_version): Adjust output for current value of
4652 BFD_VERSION_STRING.
4653
4654 * NEWS: New file.
4655
e96caa79
ILT
4656 * options.cc (options::help): Print list of supported targets.
4657 * target-select.h: Include <vector>.
4658 (class Target_selector): Make machine_, size_, and is_big_endian_
4659 fields const. Add bfd_name_ and instantiated_target_ fields.
4660 (Target_selector::Target_selector): Add bfd_name parameter.
4661 (Target_selector::recognize): Make non-virtual, call
4662 do_recognize.
4663 (Target_selector::recognize_by_name): Make non-virtual, call
4664 do_recognize_by_name.
4665 (Target_selector::supported_names): New function.
4666 (Target_selector::bfd_name): New function.
4667 (Target_selector::do_instantiate_target): New pure virtual
4668 function.
4669 (Target_selector::do_recognize): New virtual function.
4670 (Target_selector::do_recognize_by_name): New virtual function.
4671 (Target_selector::instantiate_target): New private function.
4672 (supported_target_names): Declare.
4673 * target-select.cc (Target_selector::Target_selector): Update for
4674 new parameter and fields.
4675 (select_target_by_name): Check that the name matches before
4676 calling recognize_by_name.
4677 (supported_target_names): New function.
4678 * i386.cc (class Target_selector_i386): Update Target_selector
4679 constructor call. Remove recognize and recognize_by_name. Add
4680 do_instantiate_target.
4681 * x86_64.cc (class Target_selector_x86_64): Likewise.
4682 * testsuite/testfile.cc (class Target_selector_test): Update for
4683 changes to Target_selector.
4684
874c5b28
ILT
4685 * README: Rewrite, with some notes on unsupported features.
4686
0a65a3a7
CC
46872008-03-24 Cary Coutant <ccoutant@google.com>
4688
4689 * i386.cc (Target_i386::Got_type): New enum declaration.
4690 (Target_i386::Scan::local): Updated callers of Output_data_got
4691 member functions.
4692 (Target_i386::Scan::global): Likewise.
4693 (Target_i386::Relocate::relocate): Likewise.
4694 (Target_i386::Relocate::relocate_tls): Likewise.
4695 * object.h (Got_offset_list): New class.
4696 (Sized_relobj::local_has_got_offset): Added got_type parameter.
4697 (Sized_relobj::local_got_offset): Likewise.
4698 (Sized_relobj::set_local_got_offset): Likewise.
4699 (Sized_relobj::local_has_tls_got_offset): Removed.
4700 (Sized_relobj::local_tls_got_offset): Removed.
4701 (Sized_relobj::set_local_tls_got_offset): Removed.
4702 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
4703 * output.cc (Output_data_got::add_global): Added got_type parameter.
4704 (Output_data_got::add_global_with_rel): Likewise.
4705 (Output_data_got::add_global_with_rela): Likewise.
4706 (Output_data_got::add_global_pair_with_rel): New function.
4707 (Output_data_got::add_global_pair_with_rela): New function.
4708 (Output_data_got::add_local): Added got_type parameter.
4709 (Output_data_got::add_local_with_rel): Likewise.
4710 (Output_data_got::add_local_with_rela): Likewise.
4711 (Output_data_got::add_local_pair_with_rel): New function.
4712 (Output_data_got::add_local_pair_with_rela): New function.
4713 (Output_data_got::add_global_tls): Removed.
4714 (Output_data_got::add_global_tls_with_rel): Removed.
4715 (Output_data_got::add_global_tls_with_rela): Removed.
4716 (Output_data_got::add_local_tls): Removed.
4717 (Output_data_got::add_local_tls_with_rel): Removed.
4718 (Output_data_got::add_local_tls_with_rela): Removed.
4719 * output.h (Output_data_got::add_global): Added got_type parameter.
4720 (Output_data_got::add_global_with_rel): Likewise.
4721 (Output_data_got::add_global_with_rela): Likewise.
4722 (Output_data_got::add_global_pair_with_rel): New function.
4723 (Output_data_got::add_global_pair_with_rela): New function.
4724 (Output_data_got::add_local): Added got_type parameter.
4725 (Output_data_got::add_local_with_rel): Likewise.
4726 (Output_data_got::add_local_with_rela): Likewise.
4727 (Output_data_got::add_local_pair_with_rel): New function.
4728 (Output_data_got::add_local_pair_with_rela): New function.
4729 (Output_data_got::add_global_tls): Removed.
4730 (Output_data_got::add_global_tls_with_rel): Removed.
4731 (Output_data_got::add_global_tls_with_rela): Removed.
4732 (Output_data_got::add_local_tls): Removed.
4733 (Output_data_got::add_local_tls_with_rel): Removed.
4734 (Output_data_got::add_local_tls_with_rela): Removed.
4735 * resolve.cc (Symbol::override_base_with_special): Removed
4736 reference to has_got_offset_ field.
4737 * symtab.cc (Symbol::init_fields): Replaced initialization
4738 of got_offset_ with got_offsets_. Removed initialization
4739 of has_got_offset_
53fcba31 4740 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
4741 (Symbol::got_offset): Likewise.
4742 (Symbol::set_got_offset): Likewise.
4743 (Symbol::has_tls_got_offset): Removed.
4744 (Symbol::tls_got_offset): Removed.
4745 (Symbol::set_tls_got_offset): Removed.
4746 (Symbol::got_offset_): Removed.
4747 (Symbol::tls_mod_got_offset_): Removed.
4748 (Symbol::tls_pair_got_offset_): Removed.
4749 (Symbol::got_offsets_): New field.
4750 (Symbol::has_got_offset): Removed.
4751 (Symbol::has_tls_mod_got_offset): Removed.
4752 (Symbol::has_tls_pair_got_offset): Removed.
4753 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
4754 (Target_x86_64::Scan::local): Updated callers of Output_data_got
4755 member functions.
4756 (Target_x86_64::Scan::global): Likewise.
4757 (Target_x86_64::Relocate::relocate): Likewise.
4758 (Target_x86_64::Relocate::relocate_tls): Likewise.
4759
bd52eafb
BE
47602008-03-25 Ben Elliston <bje@au.ibm.com>
4761
4762 * yyscript.y: Fix spelling error in comment.
4763
8b105e34
ILT
47642008-03-24 Ian Lance Taylor <iant@google.com>
4765
8ed814a9
ILT
4766 * options.h (class General_options): Define build_id option.
4767 * layout.h (class Layout): Declare write_build_id, create_note,
4768 create_build_id. Add build_id_note_ member.
4769 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
4770 "libiberty.h", "md5.h", "sha1.h".
4771 (Layout::Layout): Initialize eh_frame_data_,
4772 eh_frame_hdr_section_, and build_id_note_.
4773 (Layout::finalize): Call create_build_id.
4774 (Layout::create_note): New function, broken out of
4775 Layout::create_gold_note.
4776 (Layout::create_gold_note): Call create_note.
4777 (Layout::create_build_id): New function.
4778 (Layout::write_build_id): New function.
4779 (Close_task_runner::run): Call write_build_id.
4780
8b105e34
ILT
4781 * x86_64.cc: Correct license to GPLv3.
4782
086a1841
ILT
47832008-03-23 Ian Lance Taylor <iant@google.com>
4784
4785 * options.cc: Include "demangle.h".
4786 (parse_optional_string): New function.
4787 (parse_long_option): Handle takes_optional_argument.
4788 (parse_short_option): Update dash_z initializer. Handle
4789 takes_optional_argument.
4790 (General_options::General_options): Initialize do_demangle_.
4791 (General_options::finalize): Set do_demangle_. Handle demangling
4792 style.
4793 * options.h (parse_optional_string): Declare.
4794 (struct One_option): Add optional_arg field. Update constructor.
4795 Update call constructor calls. Add takes_optional_argument
4796 function.
4797 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
4798 (DEFINE_optional_string): Define.
4799 (General_options::demangle): Change from DEFINE_bool to
4800 DEFINE_optional_string.
4801 (General_options::no_demangle): New function.
4802 (General_options::do_demangle): New function.
4803 (General_options::set_do_demangle): New function.
4804 (General_options::execstack_status_): Move definition to end of
4805 class definition.
4806 (General_options::static_): Likewise.
4807 (General_options::do_demangle_): New field.
4808 * object.cc (big_endian>::get_symbol_location_info): Call
4809 Options::do_demangle, not Options::demangle.
4810 * symtab.cc (demangle): Likewise.
4811
cbb93e63
ILT
48122008-03-22 Ian Lance Taylor <iant@google.com>
4813
4814 * gold.h: Include <cstddef> and <sys/types.h>
4815 * options.h: Include <cstring>.
4816
ec531623
ILT
48172008-03-21 Ian Lance Taylor <iant@google.com>
4818
4819 * Added source code to GNU binutils.
This page took 0.298644 seconds and 4 git commands to generate.