2008-12-09 Tristan Gingold <gingold@adacore.com>
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
4674ecfc
CC
12008-12-05 Rafael Avila de Espindola <espindola@google.com>
2
3 * options.cc (General_options::parse_plugin_opt): New.
4 (General_options::add_plugin): The argument now is just the filename.
5 (General_options::add_plugin_option): New.
6 * options.h (plugin_opt): New.
7 (add_plugin): Change argument name.
8 (add_plugin_option): New.
9 * plugin.cc (Plugin::load): Don't parse the plugin option.
10 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
11 (Plugin::add_option): New.
12 (Plugin::args_): Change type.
13 (Plugin::filename_): New.
14 (Plugin_manager::add_plugin_option): New.
15 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
16 * testsuite/Makefile.in: Regenerate.
17
fd06b4aa
CC
182008-12-05 Cary Coutant <ccoutant@google.com>
19
20 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
21 Handle --strip-lto-sections option.
22 * options.h (strip_lto_sections): New option.
23
6c52134c
CC
242008-12-01 Cary Coutant <ccoutant@google.com>
25
26 * plugin.cc (ld_plugin_message): Change format parameter to const.
27 Fix mismatch between new[] and delete.
28
a45248e0
CC
292008-11-14 Cary Coutant <ccoutant@google.com>
30
31 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
32 instead of -1U.
33
c82fbeee
CS
342008-11-05 Craig Silverstein <csilvers@google.com>
35
36 * options.cc (General_options::parse_dynamic_list): New function.
37 * options.h (General_options): New flags dynamic_list,
38 dynamic_list_data, dynamic_list_cpp_new, and
39 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
40 (General_options::in_dynamic_list): New function.
41 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
42 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
43 (Lex::can_continue_name): Likewise.
44 (yylex): Likewise.
45 (read_script_file): New parameter script_options.
46 (read_dynamic_list): New function.
47 (Script_options::define_dynamic_list): New function.
48 (dynamic_list_keyword_parsecodes): New variable.
49 (dynamic_list_keywords): New variable.
50 * script.h (Script_options::define_dynamic_list): New function
51 prototype.
52 (read_dynamic_list): New function prototype.
53 * symtab.cc (strprefix): New macro.
54 (Symbol::should_add_dynsym_entry): Support dynamic_list,
55 dynamic_list_data, dynamic_list_cpp_new, and
56 dynamic_list_cpp_typeinfo.
57 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
58 (dynamic_list_expr): New rule.
59 (dynamic_list_nodes): Likewise.
60 (dynamic_list_node): Likewise.
61 * testsuite/Makefile.am (dynamic_list): New test.
62 * testsuite/Makefile.in: Regenerated.
63 * testsuite/dynamic_list.t: New file.
64 * testsuite/dynamic_list.sh: New file.
65
e0bb29a5
CS
662008-11-05 Craig Silverstein <csilvers@google.com>
67
68 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
69 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
70 (t11_last): Likewise.
71 * testsuite/ver_test_6.c (main): Likewise.
72
4e1e25e0
CC
732008-10-07 Cary Coutant <ccoutant@google.com>
74
75 * options.c (General_options::finalize): Add check for -static and
76 -shared.
77 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
78 is not empty.
79
92f03fcb
CC
802008-10-02 Cary Coutant <ccoutant@google.com>
81
82 * plugin.cc (make_sized_plugin_object): Fix conditional
83 compilation to work when not all targets are enabled.
84
fbd8a257
CC
852008-09-29 Cary Coutant <ccoutant@google.com>
86
87 * archive.cc (Archive::get_file_and_offset): Use filename instead
88 of name to get library path.
89 (Archive::include_member): Unlock external member of a thin archive.
90
91 * testsuite/Makefile.am (TEST_AR): New variable.
92 (thin_archive_test_1): New test.
93 (thin_archive_test_2): New test.
81636b3f
CC
94 * testsuite/Makefile.in: Regenerate.
95 * testsuite/thin_archive_main.cc: New file.
96 * testsuite/thin_archive_test_1.cc: New file.
97 * testsuite/thin_archive_test_2.cc: New file.
98 * testsuite/thin_archive_test_3.cc: New file.
99 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 100
eff45813
CC
1012008-09-29 Cary Coutant <ccoutant@google.com>
102
103 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
104 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
105 instead of -1U.
106 (Sized_relobj::do_finalize_local_symbols): Likewise.
107 (Sized_relobj::map_to_kept_section): Likewise.
108 * object.h (Sized_relobj::invalid_address): New constant.
109 (Sized_relobj::do_output_section_offset): Check for invalid_address
110 and return -1ULL.
111 * output.cc (Output_reloc::local_section_offset): Use constant
112 invalid_address instead of -1U.
113 (Output_reloc::get_address): Likewise.
114 (Output_section::output_address): Change -1U to -1ULL.
115 * output.h (Output_reloc::invalid_address): New constant.
116 * reloc.cc (Sized_relobj::write_sections): Use constant
117 invalid_address instead of -1U.
118 (Sized_relobj::relocate_sections): Likewise.
119 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
120 values for merge sections.
121 * target-reloc.h (relocate_for_relocatable): Use constant
122 invalid_address instead of -1U.
123
89fc3421
CC
1242008-09-19 Cary Coutant <ccoutant@google.com>
125
126 Add plugin functionality for link-time optimization (LTO).
127 * configure.ac (plugins): Add --enable-plugins option.
128 * configure: Regenerate.
129 * config.in: Regenerate.
130 * Makefile.am (LIBDL): New variable.
131 (CCFILES): Add plugin.cc.
132 (HFILES): Add plugin.h.
133 (ldadd_var): Add LIBDL.
134 * Makefile.in: Regenerate.
135
136 * archive.cc: Include "plugin.h".
137 (Archive::setup): Don't preread archive symbols when using a plugin.
138 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
139 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
140 files.
141 (Archive::include_member): Add symbols from plugin objects.
142 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
143 * descriptors.cc (Descriptors::open): Check for file descriptors
144 abandoned by plugins.
145 (Descriptors::claim_for_plugin): New function.
146 * descriptors.h (Descriptors::claim_for_plugin): New function.
147 (Open_descriptor::is_claimed): New field.
148 (claim_descriptor_for_plugin): New function.
149 * fileread.cc (File_read::claim_for_plugin): New function.
150 * fileread.h (File_read::claim_for_plugin): New function.
151 (File_read::descriptor): New function.
152 * gold.cc: Include "plugin.h".
153 (queue_initial_tasks): Add task to call plugin hooks for generating
154 new object files.
155 * main.cc: Include "plugin.h".
156 (main): Load plugin libraries.
157 * object.h (Pluginobj): Declare.
158 (Object::pluginobj): New function.
159 (Object::do_pluginobj): New function.
160 (Object::set_target): New function.
161 * options.cc: Include "plugin.h".
162 (General_options::parse_plugin): New function.
163 (General_options::General_options): Initialize plugins_ field.
164 (General_options::add_plugin): New function.
165 * options.h (Plugin_manager): Declare.
166 (General_options): Add --plugin option.
167 (General_options::has_plugins): New function.
168 (General_options::plugins): New function.
169 (General_options::add_plugin): New function.
170 (General_options::plugins_): New field.
171 * plugin.cc: New file.
172 * plugin.h: New file.
173 * readsyms.cc: Include "plugin.h".
174 (Read_symbols::do_read_symbols): Check for archive before checking
175 for ELF file. Call plugin hooks to claim files.
176 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
177 from a real object file; force override when processing replacement
178 files.
179 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
180 (Symbol::init_base_object): Likewise.
181 (Symbol::init_base_output_data): Likewise.
182 (Symbol::init_base_output_segment): Likewise.
183 (Symbol::init_base_constant): Likewise.
184 (Symbol::init_base_undefined): Likewise.
185 (Symbol::output_section): Assert that object is not a plugin.
186 (Symbol_table::add_from_pluginobj): New function.
187 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
188 undefined.
189 (Symbol_table::sized_write_globals): Likewise.
190 (Symbol_table::add_from_pluginobj): Instantiate template.
191 * symtab.h (Sized_pluginobj): Declare.
192 (Symbol::in_real_elf): New function.
193 (Symbol::set_in_real_elf): New function.
194 (Symbol::in_real_elf_): New field.
195 (Symbol_table::add_from_pluginobj): New function.
196
197 * testsuite/Makefile.am (AM_CFLAGS): New variable.
198 (LIBDL): New variable.
199 (LDADD): Add LIBDL.
200 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
201 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
202 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
203 (MOSTLYCLEANFILES): Likewise.
204 * testsuite/Makefile.in: Regenerate.
205 * testsuite/plugin_test.c: New file.
206 * testsuite/plugin_test_1.sh: New file.
207 * testsuite/plugin_test_2.sh: New file.
208
de31bda5
ILT
2092008-09-16 Ian Lance Taylor <iant@google.com>
210
9c2d0ef9
ILT
211 * target-reloc.h (relocate_section): Check whether a symbol is
212 defined by the ABI before reporting an undefined symbol error.
213 * target.h (Target::is_defined_by_abi): Make parameter const.
214 (Target::do_is_defined_by_abi): Likewise.
215 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
216 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
217 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
218 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
219 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
220 * testsuite/Makefile.in: Rebuild.
221
de31bda5
ILT
222 * fileread.cc (make_view): Add casts to avoid warning.
223
9fa33bee
AO
2242008-09-16 Alexandre Oliva <aoliva@redhat.com>
225
226 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
227 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
228
183fd0e3
AO
2292008-09-16 Alexandre Oliva <aoliva@redhat.com>
230
231 * options.h (General_options::output_is_executable): New.
232 (General_options::output_is_pie): New.
233 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
234 for shared libraries.
235 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
236
7be8330a
CD
2372008-09-11 Chris Demetriou <cgd@google.com>
238
239 * options.h (origin): New -z option.
240 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
241 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
242 in DT_FLAGS_1.
243
a9caad02
CC
2442008-09-05 Cary Coutant <ccoutant@google.com>
245
246 * fileread.cc (File_read::make_view): Add check for attempt to map
247 beyond end of file.
248
ae6dce4d
CC
2492008-09-05 Cary Coutant <ccoutant@google.com>
250
251 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
252 explicit instantiations.
253
d7ab2a47
KVH
2542008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
255
256 PR gold/6858
257 * options.cc (General_options::finalize): Allow undefined symbols
258 in shlibs if linking -shared.
259
260 PR gold/6859
261 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
262 symbols as not needing a dynsym entry.
263
1e52a9c1
CS
2642008-08-20 Craig Silverstein <csilvers@google.com>
265
266 * fileread.cc (File_read::open): Do not lock the file unless it
267 was successfully opened.
268
d85c80a3
CC
2692008-08-14 Cary Coutant <ccoutant@google.com>
270
271 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
272 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
273 * testsuite/tls_test.cc (struct int128): 128-bit struct
274 for testing TLS relocs with non-zero addend.
275 (v12): New TLS variable.
276 (t12): New test.
277 (t_last): Add check for v12.
278 * testsuite/tls_test.h (t12): New function.
279 * testsuite/tls_test_main.cc (thread_routine): Call new test.
280
2d924fd9
ILT
2812008-08-13 Ian Lance Taylor <iant@google.com>
282
283 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
284 set tls_segment_ or relro_segment_.
285 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
286 when appropriate.
287 * output.h (Output_section::clear_is_relro): New function.
288 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
289 sections specially even when output_data_ is empty.
290 (Output_segment::maximum_alignment): When first section is relro,
291 only force alignment for PT_LOAD segments.
292 * script.cc (script_data_segment_align): New function.
293 (script_data_segment_relro_end): New function.
294 * script-c.h (script_data_segment_align): Declare.
295 (script_data_segment_relro_end): Declare.
296 * script-sections.h (class Script_sections): Declare
297 data_segment_align and data_segment_relro_end. Add fields
298 segment_align_index_ and saw_relro_end_.
299 * script-sections.cc (class Sections_element): Add set_is_relro
300 virtual function. Add new bool* parameter to place_orphan_here.
301 Add get_output_section virtual function.
302 (class Output_section_definition): Add set_is_relro. Add new
303 bool* parameter to place_orphan_here. Add get_output_section.
304 Add is_relro_ field.
305 (Output_section_definition::Output_section_definition): Initialize
306 evaluated_address_, evaluated_load_address, evaluated_addralign_,
307 and is_relro_ fields.
308 (Output_section_definition::place_orphan_here): Add is_relro
309 parameter.
310 (Output_section_definition::set_section_addresses): Set relro for
311 output section.
312 (Output_section_definition::alternate_constraint): Likewise.
313 (class Orphan_output_section): Add new bool* parameter to
314 place_orphan_here. Add get_output_section.
315 (Orphan_output_section::place_orphan_here): Add is_relro
316 parameter.
317 (Script_sections::Script_sections): Initialize
318 data_segment_align_index_ and saw_relro_end_.
319 (Script_sections::data_segment_align): New function.
320 (Script_sections::data_segment_relro_end): New function.
321 (Script_sections::place_orphan): Set or clear is_relro.
322 (Script_sections::set_section_addresses): Force alignment of first
323 TLS section.
324 * yyscript.y (exp): Call script_data_segment_align and
325 script_data_segment_relro_end.
326 * testsuite/relro_script_test.t: New file.
327 * testsuite/relro_test.cc (using_script): Declare.
328 (t1, t2): Test using_script.
329 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
330 (relro_script_test_SOURCES): Define.
331 (relro_script_test_DEPENDENCIES): Define.
332 (relro_script_test_LDFLAGS): Define.
333 (relro_script_test_LDADD): Define.
334 (relro_script_test.so): New target.
335 * testsuite/Makefile.in: Rebuild.
336
f827c9a9
CC
3372008-08-06 Cary Coutant <ccoutant@google.com>
338
339 * archive.cc (Archive::total_archives, Archive::total_members)
340 (Archive::total_members_loaded): New variables.
341 (Archive::setup): Add parameter. Add option to preread
342 archive symbols.
343 (Archive::read_armap): Add counter.
344 (Archive::get_file_and_offset): New function.
345 (Archive::get_elf_object_for_member): New function.
346 (Archive::read_all_symbols): New function.
347 (Archive::read_symbols): New function.
348 (Archive::add_symbols): Add counters.
349 (Archive::include_all_members): Use armap to find members if it's
350 already built.
351 (Archive::include_member): Skip reading symbols if already read.
352 Factored code into Archive::get_file_and_offset and
353 Archive::get_elf_object_for_member. Changed call to
354 Mapfile::report_include_archive_member.
355 (Archive::print_stats): New function.
356 * archive.h: Declare Object and Read_symbols_data classes.
357 (Archive::Archive): Add initializers for new members.
358 (Archive::setup): Add parameter.
359 (Archive::print_stats): New function.
360 (Archive::total_archives, Archive::total_members)
361 (Archive::total_members_loaded): New variables.
362 (Archive::get_file_and_offset): New function.
363 (Archive::get_elf_object_for_member): New function.
364 (Archive::read_all_symbols): New function.
365 (Archive::read_symbols): New function.
366 (Archive::Archive_member): New class.
367 (Archive::members_): New member.
368 (Archive::num_members_): New member.
369 * main.cc: Include archive.h.
370 (main): Call Archive::print_stats.
371 * mapfile.cc (Mapfile::report_include_archive_member): Delete
372 archive parameter; member_name is now the fully-decorated name.
373 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
374 * options.h: (General_options): Add --preread-archive-symbols option.
375 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
376 Archive::setup.
377
de4c45bd
ILT
3782008-08-04 Ian Lance Taylor <iant@google.com>
379
380 * symtab.h (Symbol::use_plt_offset): New function.
381 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
382 * powerpc.cc (Relocate::relocate): Likewise.
383 * sparc.cc (Relocate::relocate): Likewise.
384 * x86_64.cc (Relocate::relocate): Likewise.
385 * testsuite/weak_plt.sh: New test.
386 * testsuite/weak_plt_main.cc: New test.
387 * testsuite/weak_plt_shared.cc: New test.
388 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
389 (check_PROGRAMS): Add weak_plt.
390 (check_DATA): Add weak_plt_shared.so.
391 (weak_plt_main_pic.o, weak_plt): New targets.
392 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
393 * testsuite/Makefile.in: Rebuild.
394
395 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
396 gcctestdir/ld.
397 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
398 * testsuite/Makefile.in: Rebuild.
399
323ee3f4
AM
4002008-08-04 Alan Modra <amodra@bigpond.net.au>
401
402 * Makefile.am (POTFILES.in): Set LC_ALL=C.
403 * Makefile.in: Regenerate.
404 * po/POTFILES.in: Regenerate.
405
7c07ecec
ILT
4062008-07-29 Ian Lance Taylor <iant@google.com>
407
408 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
409 symbols before other symbols.
410 * testsuite/script_test_2.cc (test_addr): Declare.
411 (test_addr_alias): Declare.
412 (main): Check that test_addr and test_addr_alias have the right
413 values.
414 * testsuite/script_test_2.t: Define test_addr_alias and
415 test_addr.
416
5778530e
ILT
4172008-07-24 Ian Lance Taylor <iant@google.com>
418
2a00e4fb
ILT
419 PR 5990
420 * descriptors.cc: New file.
421 * descriptors.h: New file.
422 * gold-threads.h (class Hold_optional_lock): New class.
423 * fileread.cc: Include "descriptors.h".
424 (File_read::~File_read): Release descriptor rather than closing
425 it.
426 (File_read::open) [file]: Call open_descriptor rather than open.
427 Set is_descriptor_opened_.
428 (File_read::open) [memory]: Assert that descriptor is not open.
429 (File_read::reopen_descriptor): New function.
430 (File_read::release): Release descriptor.
431 (File_read::do_read): Make non-const. Reopen descriptor.
432 (File_read::read): Make non-const.
433 (File_read::make_view): Reopen descriptor.
434 (File_read::do_readv): Likewise.
435 * fileread.h (class File_read): Add is_descriptor_opened_ field.
436 Update declarations.
437 * layout.cc: Include "descriptors.h".
438 (Layout::create_build_id): Use open_descriptor rather than open.
439 * output.cc: Include "descriptors.h".
440 (Output_file::open): Use open_descriptor rather than open.
441 * archive.cc (Archive::const_iterator): Change Archive to be
442 non-const.
443 (Archive::begin, Archive::end): Make non-const.
444 (Archive::count_members): Likewise.
445 * archive.h (class Archive): Update declarations.
446 * object.h (Object::read): Make non-const.
447 * Makefile.am (CCFILES): Add descriptors.cc.
448 (HFILES): Add descriptors.h.
449 * Makefile.in: Rebuild.
450
801647d1
ILT
451 PR 6716
452 * gold.h: Always include <clocale>. Add Solaris workarounds
453 following code in binutils/sysdep.h.
454
5edd166e
ILT
455 PR 6048
456 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
457 this->eh_frame_hdr_ is NULL before using it.
458
c89ad728
ILT
459 * dynobj.cc (Versions::Versions): Update comment.
460
aa86f06b
ILT
461 * dynobj.cc (Versions::Versions): If there is an soname, use it as
462 the base version name.
463
5778530e
ILT
464 * stringpool.cc (Stringpool_template::add_with_length): Set key to
465 array size plus one.
466 (Stringpool_template::set_string_offsets): Subtract one from key
467 before using it as an array index.
468 (Stringpool_template::get_offset_with_length): Likewise.
469 (Stringpool_template::write_to_buffer): Likewise.
470 * stringpool.h (Stringpool_template::get_offset_from_key):
471 Likewise.
472
057ead22
ILT
4732008-07-23 Ian Lance Taylor <iant@google.com>
474
7f649c59
ILT
475 PR 6658
476 * object.h (Merged_symbol_value::value): Do our best to handle a
477 negative addend.
478
057ead22
ILT
479 PR 6647
480 * script.cc (Version_script_info::get_versions): Don't add empty
481 version tag to return value.
482 (Version_script_info::get_symbol_version_helper): Change return
483 type to bool. Add pversion parameter. Change all callers.
484 (script_register_vers_node): Don't require a non-NULL tag.
485 * script.h (class Version_script_info): Update declarations.
486 (Version_script_info::get_symbol_version): Change return type to
487 bool. Add version parameter. Change all callers.
488 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
489 handling. Handle an empty version from a version script.
490 (Symbol_table::define_special_symbol): Likewise.
491 * testsuite/ver_test_10.script: New file.
492 * testsuite/ver_test_10.sh: New file.
493 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
494 (check_DATA): Add ver_test_10.syms.
495 (ver_test_10.syms, ver_test_10.so): New target.
496 * testsuite/Makefile.in: Rebuild.
497
58e54ac2
CD
4982008-07-23 Simon Baldwin <simonb@google.com>
499
500 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
501 to zero for undefined symbols from dynamic libraries.
502
95d14cd3
ILT
5032008-07-23 Ian Lance Taylor <iant@google.com>
504
505 * symtab.cc (Symbol_table::resolve): Remove version parameter.
506 Change all callers.
507 * symtab.h (class Symbol_table): Update declaration.
508 * testsuite/ver_test_9.cc: New file.
509 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
510 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
511 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
512 (ver_test_9.so, ver_test_9.o): New targets.
513 * testsuite/Makefile.in: Rebuild.
514
92de84a6
ILT
5152008-07-22 Ian Lance Taylor <iant@google.com>
516
34810851
ILT
517 * options.h (class General_options): Define --check-sections.
518 * layout.cc (Layout::set_segment_offsets): Handle
519 --check-sections.
520
af6156ef
ILT
521 * options.h (class General_options): Define -n/--nmagic and
522 -N/--omagic.
523 * options.cc (General_options::finalize): For -n/--nmagic or
524 -N/--omagic, set -static.
525 * layout.cc (Layout::attach_allocated_section_to_segment): If
526 -N/--omagic, don't put read-only and read-write sections in
527 different segments.
528 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
529 finding a read-only segment.
530 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
531 don't set the minimum segment alignment to the common page size,
532 and don't set the file offset to the address modulo the page size.
533 * script-sections.cc (Script_sections::create_segments): If
534 -n/--omagic, don't put read-only and read-write sections in
535 different segments.
536
92de84a6
ILT
537 * cref.cc: New file.
538 * cref.h: New file.
539 * options.h (class General_options): Add --print-symbol-counts.
540 * main.cc (main): Issue defined symbol report if requested.
541 * archive.cc (Archive::interpret_header): Make into a const member
542 function.
543 (Archive::add_symbols): Call Input_objects::archive_start and
544 archive_stop.
545 (Archive::const_iterator): Define new class.
546 (Archive::begin, Archive::end): New functions.
547 (Archive::include_all_members): Rewrite to use iterator.
548 (Archive::count_members): New function.
549 * archive.h (class Archive): Update declarations.
550 (Archive::filename): New function.
551 * object.cc: Include "cref.h".
552 (Sized_relobj::Sized_relobj): Initialize defined_count_.
553 (Sized_relobj::do_get_global_symbol_counts): New function.
554 (Input_objects::add_object): Add object to cross-referencer.
555 (Input_objects::archive_start): New function.
556 (Input_objects::archive_stop): New function.
557 (Input_objects::print_symbol_counts): New function.
558 * object.h: Declare Cref and Archive.
559 (Object::get_global_symbol_counts): New function.
560 (Object::do_get_global_symbol_counts): New pure virtual function.
561 (class Sized_relobj): Add defined_count_ field. Update
562 declarations.
563 (class Input_objects): Add cref_ field. Update constructor.
564 Update declarations.
565 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
566 defined_count_.
567 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
568 symbol counts.
569 (Sized_dynobj::do_get_global_symbol_counts): New function.
570 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
571 defined_count_. Update declarations. Define Symbols typedef.
572 * symtab.cc (Symbol_table::add_from_relobj): Add defined
573 parameter. Change all callers.
574 (Symbol_table::add_from_dynobj): Add sympointers and defined
575 parameters. Change all callers.
576 * symtab.h (class Symbol_table): Update declarations.
577 * Makefile.am (CCFILES): Add cref.cc.
578 (HFILES): Add cref.h.
579 * Makefile.in: Rebuild.
580
3f7c5e1d
CD
5812008-07-22 Simon Baldwin <simonb@google.com>
582
583 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
584 to zero when writing undefined symbols.
585
e0b64032
ILT
5862008-07-22 Ian Lance Taylor <iant@google.com>
587
588 * output.cc (Output_section::add_input_section): Don't try to
589 merge empty merge sections.
590
096b02cf
CS
5912008-07-21 Craig Silverstein <csilvers@google.com>
592
593 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
594 Include symbol version in error message.
595
1d1f116d
CD
5962008-07-20 Chris Demetriou <cgd@google.com>
597
598 * configure.ac (gold_cv_c_random_seed): New configured variable.
599 (RANDOM_SEED_CFLAGS): New substituted variable.
600 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
601 * configure: Rebuild.
602 * Makefile.in: Likewise.
603 * testsuite/Makefile.in: Likewise.
604
a18f591e
ILT
6052008-07-18 Ian Lance Taylor <iant@google.com>
606
607 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
608 where we see NAME/NULL and NAME/VERSION as separate symbols.
609 * testsuite/ver_test_main.cc (main): Call t4.
610 (t4, t4_2a): Define.
611 * testsuite/ver_test_2.cc (t4_2): Define.
612 * testsuite/ver_test_2.script: Put t4_2a in VER2.
613 * testsuite/ver_test_4.cc (t4_2a): Define.
614 * testsuite/ver_test_4.script: Put t4_2a in VER2.
615 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
616
c6e3f6ed
ILT
6172008-07-17 Ian Lance Taylor <iant@google.com>
618
619 * dynobj.cc (Versions::add_def): If we give an error about a
620 missing version, go ahead and create the version anyhow.
621
ef9beddf
ILT
6222008-07-10 Ian Lance Taylor <iant@google.com>
623
624 Handle output sections with more than 0x7fffffff bytes.
625 * object.h (class Relobj): Change map_to_output_ to
626 output_sections_, and just keep a section pointer. Change all
627 uses. Move comdat group support to Sized_relobj.
628 (Relobj::is_section_specially_mapped): Remove.
629 (Relobj::output_section): Remove poff parameter. Change all
630 callers.
631 (Relobj::output_section_offset): New function.
632 (Relobj::set_section_offset): Rewrite.
633 (Relobj::map_to_output): Remove.
634 (Relobj::output_sections): New function.
635 (Relobj::do_output_section_offset): New pure virtual function.
636 (Relobj::do_set_section_offset): Likewise.
637 (class Sized_relobj): Add section_offsets_ field. Add comdat
638 group support from Relobj. Update declarations.
639 (Sized_relobj::get_output_section_offset): New function.
640 (Sized_relobj::do_output_section_offset): New function.
641 (Sized_relobj::do_set_section_offset): New function.
642 * object.cc (Relobj::output_section_address): Remove.
643 (Sized_relobj::Sized_relobj): Initialize new fields.
644 (Sized_relobj::include_section_group): Cast find_kept_object to
645 Sized_relobj.
646 (Sized_relobj::include_linkonce_section): Likewise.
647 (Sized_relobj::do_layout): Use separate arrays for output section
648 and output offset.
649 (Sized_relobj::do_count_local_symbols): Change map_to_output to
650 output_sections.
651 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
652 output_sections and section_offsets.
653 (Sized_relobj::write_local_symbols): Likewise.
654 (map_to_kept_section): Compute output address directly.
655 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
656 output_sections and section_offsets.
657 (Sized_relobj::write_sections): Likewise.
658 (Sized_relobj::relocate_sections): Likewise.
659 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
660 * output.h (class Output_reloc): Update declarations. Change
661 u2_.relobj to Sized_relobj*.
662 (class Output_data_reloc): Change add functions to use
663 Sized_relobj*.
664 * output.cc (Output_reloc::Output_reloc): Change relobj to
665 Sized_relobj*.
666 (Output_reloc::local_section_offset): Change return type to
667 Elf_Addr. Use get_output_section_offset.
668 (Output_reloc::get_address): Likewise.
669 (Output_section::is_input_address_mapped): Don't call
670 is_section_specially_mapped.
671 (Output_section::output_offset): Likewise.
672 (Output_section::output_address): Likewise.
673 (Output_section::starting_output_address): Likewise.
674 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
675 parameter to Sized_relobj*.
676 (Copy_relocs::need_copy_reloc): Likewise.
677 (Copy_relocs::save): Likewise.
678 * copy-relocs.h (class Copy_relocs): Update declarations.
679 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
680 Sized_relobj*. Change relobj_ field to Sized_relobj*.
681 * target-reloc.h (relocate_for_relocatable): Change
682 offset_in_output_section type to Elf_Addr. Change code that uses
683 it as well.
684 * layout.cc (Layout::layout): Always set *off.
685 * mapfile.cc (Mapfile::print_input_section): Use
686 output_section_offset.
687 * i386.cc (Target_i386::copy_reloc): Change object parameter to
688 Sized_relobj*.
689 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
690 * sparc.cc (Target_sparc::copy_reloc): Likewise.
691 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
692
5cb66f97
ILT
6932008-07-03 Ian Lance Taylor <iant@google.com>
694
695 * layout.cc (Layout::include_section): Do not discard unrecognized
696 SHT_STRTAB sections.
697
afe47622
CS
6982008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
699
700 * script.cc (Lex::can_continue_name): Make '?' allowable in
701 version-script names.
702 * testsuite/version_script.map: Change glob pattern to use '?'
703
5adf9721
ILT
7042008-06-30 Manish Singh <yosh@gimp.org>
705
706 PR 6585
707 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
708 Correct typo.
709
e6fde208
ILT
7102008-06-30 Ian Lance Taylor <iant@google.com>
711
712 PR 6660
713 PR 6682
714 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
715 versions]: Don't try to read the value in the contents, since we
716 don't use it. Use the template endianness when writing.
717
3f2e6a2d
CC
7182008-06-25 Cary Coutant <ccoutant@google.com>
719
720 * fileread.cc (File_read::make_view): Assert on zero-length view.
721 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
722 symbol table when there are no symbols to read.
723
c43d3a48
CS
7242008-06-23 Craig Silverstein <csilvers@google.com>
725
726 * version.cc (version_string): Bump to 1.7
727
5f494ea0
CS
7282008-06-18 Craig Silverstein <csilvers@google.com>
729
730 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
731 constant 0xFFFF to type Valtype.
732 (Powerpc_relocate_functions::rel16_ha): Likewise.
733
c42e122e
ILT
7342008-06-17 Ian Lance Taylor <iant@google.com>
735
f34787f8
ILT
736 * output.h (Output_section::Input_section): Initialize p2align_ to
737 zero for Output_section_data constructors.
738 (Output_section::Input_section::addralign): If not an input
739 section, return the alignment of the Output_section_data.
740 * testsuite/copy_test.cc: New file.
741 * testsuite/copy_test_1.cc: New file.
742 * testsuite/copy_test_2.cc: New file.
743 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
744 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
745 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
746 (copy_test_1_pic.o, copy_test_1.so): New targets.
747 (copy_test_2_pic.o, copy_test_2.so): New targets.
748 * testsuite/Makefile.in: Rebuild.
749
c42e122e
ILT
750 * script-sections.cc (Script_sections::place_orphan): Initialize
751 local variable exact.
752
ce3ac18a
DE
7532008-06-13 David Edelsohn <edelsohn@gnu.org>
754
755 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
756
42cacb20
DE
7572008-06-12 David Edelsohn <edelsohn@gnu.org>
758 David S. Miller <davem@davemloft.net>
759
760 * powerpc.cc: New file.
761 * Makefile.am (TARGETSOURCES): Add powerpc.cc
762 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
763 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
764 * Makefile.in: Rebuild.
765
7b308235
ILT
7662008-06-09 Ian Lance Taylor <iant@google.com>
767
768 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
769 <exception>.
770 (throwing, orig_terminate): New static variables.
771 (terminate_handler): New static function.
772 (t2): Set terminate handler.
773
f0b886e3
ILT
7742008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
775
776 PR 6584
777 * binary.cc (Binary_to_elf::sized_convert): Fix .data
778 alignment.
779
3e90f135
CC
7802008-05-30 Cary Coutant <ccoutant@google.com>
781
782 * archive.cc (Archive::include_all_members) Correct to step
783 over symbol table and extended name table in thin archives.
784
e09ad04a
ILT
7852008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
786
787 PR 6407
788 * target-reloc.h (relocate_for_relocatable): Fix new_offset
789 calculation.
790
62b01cb5
ILT
7912008-05-28 Caleb Howe <cshowe@google.com>
792
793 * reduced_debug_output.cc: New file.
794 * reduced_debug_output.h: New file.
92de84a6 795 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
796 * options.cc (General_options::finalize): Add strip_debug_non_line
797 to the strip heirarchy.
798 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
799 fields.
800 * layout.cc: Include "reduced_debug_output.h".
801 (Layout::Layout): Initialize new fields.
802 (line_only_debug_sections): New static array.
803 (is_lines_only_debug_sections): New static inline function.
804 (Layout::include_section): Handle --strip-debug-non-line.
805 (Layout::make_output_section): If --strip-debug-non-line, build
806 new output sections for .debug_abbrev and .debug_info.
807 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
808 gold. Warn about possible overflow.
809 (read_signed_LEB_128): Likewise.
810 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
811 (read_signed_LEB_128): Declare.
812 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
813 (HFILES): Add reduced_debug_output.h.
814 * Makefile.in: Rebuild.
815
7d9e3d98
ILT
8162008-05-21 Ian Lance Taylor <iant@google.com>
817
818 * mapfile.cc: New file.
819 * mapfile.h: New file.
820 * options.h (class General_options): Add -M/--print-map and -Map.
821 * options.cc (General_options::finalize): Make -M equivalent to
822 -Map -.
823 * main.cc: Include <cstdio> and "mapfile.h".
824 (main): Open mapfile if requested.
825 * gold.cc (class Middle_runner): Add mapfile_ field. Update
826 constructor. Change caller.
827 (queue_initial_tasks): Add mapfile parameter. Change caller.
828 (queue_middle_tasks): Likewise.
829 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
830 declarations.
831 * archive.cc: Include "mapfile.h".
832 (Archive::add_symbols): Add mapfile parameter. Change all
833 callers. Pass mapfile, symbol, and reason to include_member.
834 (Archive::include_all_members): Add mapfile parameter. Change all
835 callers.
836 (Archive::include_member): Add mapfile, sym, and why parameters.
837 Change all callers. Report inclusion to map file.
838 * archive.h: Include "fileread.h".
839 (class Archive): Update declarations.
840 (Archive::file): New const method.
841 (class Add_archive_symbols): Add mapfile_ field. Update
842 constructor. Change all callers.
843 * readsyms.h (class Read_symbols): Likewise.
844 (class Finish_group): Likewise.
845 (class Read_script): Likewise.
846 * common.cc: Include "mapfile.h".
847 (Symbol_table::allocate_commons): Add mapfile parameter. Change
848 all callers.
849 (Symbol_table::do_allocate_commons): Likewise.
850 (Symbol_table::do_allocate_commons_list): Likewise. Report common
851 symbol allocation to mapfile.
852 * common.h (class Allocate_commons_task): Add mapfile_ field.
853 Update constructor. Change all callers.
854 * symtab.h (class Symbol_table): Update declarations.
855 * layout.cc: Include "mapfile.h".
856 (Layout_task_runner::run): Print information to mapfile.
857 (Layout::create_gold_note): Change Output_data_fixed_space to
858 Output_data_zero_fill.
859 (Layout::create_build_id): Likewise.
860 (Layout::print_to_mapfile): New function.
861 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
862 constructor. Change caller.
863 (class Layout): Declare print_to_mapfile.
864 * output.cc (Output_section::Input_section::print_to_mapfile): New
865 function.
866 (Output_section::add_input_section): If producing a map, always
867 add to input_sections_ list.
868 (Output_section::do_print_to_mapfile): New function.
869 (Output_segment::print_sections_to_mapfile): New function.
870 (Output_segment::print_section_list_to_mapfile): New function.
871 * output.h: Include "mapfile.h".
872 (Output_data::print_to_mapfile): New function.
873 (Output_data::do_print_to_mapfile): New virtual function.
874 (Output_segment_headers::do_print_to_mapfile): New function.
875 (Output_file_header::do_print_to_mapfile): New function.
876 (Output_data_const::do_print_to_mapfile): New function.
877 (class Output_data_const_buffer): Add map_name_ field. Update
878 constructor. Change all callers. Add do_print_to_mapfile
879 function.
880 (class Output_data_fixed_space): Likewise.
881 (class Output_data_space): Likewise.
882 (class Output_data_zero_fill): New class.
883 (Output_data_strtab::do_print_to_mapfile): New function.
884 (Output_data_reloc_base::do_print_to_mapfile): New function.
885 (Output_relocatable_relocs::do_print_to_mapfile): New function.
886 (Output_data_group::do_print_to_mapfile): New function.
887 (Output_data_got::do_print_to_mapfile): New function.
888 (Output_data_dynamic::do_print_to_mapfile): New function.
889 (Output_symtab_xindex::do_print_to_mapfile): New function.
890 (class Output_section): Declare do_print_to_mapflie. Declare
891 print_to_mapfile in Input_section.
892 (class Output_segment): Declare new functions.
893 * object.h (Sized_relobj::symbol_count): New function.
894 * script-sections.cc
895 (Output_section_element_dot_assignment::set_section_addresses):
896 Change Output_data_fixed_space to Output_data_zero_fill.
897 (Output_data_expression::do_print_to_mapfile): New function.
898 * script.cc (read_input_script): Add mapfile parameter. Change
899 all callers.
900 * script.h (read_input_script): Update declaration.
901 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
902 (Eh_frame::do_print_to_mapfile): New function.
903 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
904 (Output_merge_string::do_print_to_mapfile): New function.
905 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
906 function.
907 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
908 function.
909 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
910 function.
911 * Makefile.am (CCFILES): Add mapfile.cc.
912 (HFILES): Add mapfile.h.
913 * Makefile.in: Rebuild.
914
9f1d377b
ILT
9152008-05-19 Ian Lance Taylor <iant@google.com>
916
917 * options.h (class General_options): Add -z relro.
918 * layout.cc (Layout::Layout): Initialize relro_segment_.
919 (Layout::add_output_section_data): Return the output section.
920 (Layout::make_output_section): Rcognize relro sections and mark
921 them appropriately.
922 (Layout::attach_allocated_section_to_segment): Put relro sections
923 in a PT_GNU_RELRO segment.
924 (Layout::create_initial_dynamic_sections): Mark the .dynamic
925 section as relro.
926 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
927 PT_TLS segments.
928 (Layout::linkonce_mapping): Map d.rel.ro.local to
929 .data.rel.ro.local.
930 (Layout::output_section_name): Us .data.rel.ro.local for any
931 section which begins with that.
932 * layout.h (class Layout): Update add_output_section_data
933 declaration. Add relro_segment_ field.
934 * output.cc (Output_section::Output_section): Initialize is_relro_
935 and is_relro_local_ fields.
936 (Output_segment::add_output_section): Group relro sections.
937 (Output_segment::is_first_section_relro): New function.
938 (Output_segment::maximum_alignment): If there is a relro section,
939 align the segment to the common page size.
940 (Output_segment::set_section_addresses): Track whether we are
941 looking at relro sections. If the last section is a relro
942 section, align to the common page size.
943 (Output_segment::set_section_list_addresses): Add in_relro
944 parameter. Change all callers. Align to the page size when
945 moving from relro to non-relro section.
946 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
947 segment.
948 * output.h (class Output_section): Add is_relro_ and
949 is_relro_local_ fields.
950 (Output_section::is_relro): New function.
951 (Output_section::set_is_relro): New function.
952 (Output_section::is_relro_local): New function.
953 (Output_section::set_is_relro_local): New function.
954 (class Output_segment): Update declarations.
955 * i386.cc (Target_i386::got_section): Mark .got section as relro.
956 * sparc.cc (Target_sparc::got_section): Likewise.
957 * x86_64.cc (Target_x86_64::got_section): Likewise.
958 * testsuite/relro_test_main.cc: New file.
959 * testsuite/relro_test.cc: New file.
960 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
961 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
962 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
963 (relro_test.so, relro_test_pic.o): New targets.
964 * testsuite/Makefile.in: Rebuild.
965
a984ee1d
ILT
9662008-05-16 Ian Lance Taylor <iant@google.com>
967
01676dcd
ILT
968 * output.cc (Output_segment::add_output_section): Remove front
969 parameter.
970 * output.h (class Output_segment): Remove
971 add_initial_output_section and overloaded add_output_section.
972 Update declaration of remaining add_output_section.
973 * layout.cc (Layout::create_interp): Call add_output_section
974 rather than add_initial_output_section.
975 (Layout::finish_dynamic_section): Likewise.
976
497897f9
ILT
977 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
978 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
979 know the dynamic type.
980 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
981 field. Initialize it in constructor.
982 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
983 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
984 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
985 reloc.
986
a984ee1d
ILT
987 * output.cc (Output_reloc::get_address): Change return type to
988 Elf_Addr.
989 * output.h (class Output_reloc): Update get_address declaration.
990 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
991 for section addresses.
992
55ba0940
ILT
9932008-05-09 Ian Lance Taylor <iant@google.com>
994
995 PR 6493
996 * gold.cc (gold_nomem): Use return value of write.
997
75517b77
ILT
9982008-05-08 Ian Lance Taylor <iant@google.com>
999
1000 * symtab.c (Symbol::init_base_output_data): Add version
1001 parameter. Change all callers.
1002 (Symbol::init_base_output_segment): Likewise.
1003 (Symbol::init_base_constant): Likewise.
1004 (Symbol::init_base_undefined): Likewise.
1005 (Sized_symbol::init_output_data): Likewise.
1006 (Sized_symbol::init_output_segment): Likewise.
1007 (Sized_symbol::init_constant): Likewise.
1008 (Sized_symbol::init_undefined): Likewise.
1009 (Symbol_table::do_define_in_output_data): If the new symbol has a
1010 version, mark it as the default.
1011 (Symbol_table::do_define_in_output_segment): Likewise.
1012 (Symbol_table::do_define_as_constant): Likewise.
1013 * symtab.h (class Symbol): Update declarations.
1014 (class Sized_symbol): Likewise.
1015 * resolve.cc (Symbol::override_version): New function.
c42e122e 1016 (Symbol::override_base): Call override_version.
75517b77
ILT
1017 (Symbol::override_base_with_special): Likewise.
1018 * testsuite/ver_script_8.script: New file.
1019 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
1020 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
1021 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
1022 (ver_test_8_1.so, ver_test_8_2.so): New targets.
1023
f1f70eae
ILT
10242008-05-06 Ian Lance Taylor <iant@google.com>
1025
f3e9c5c5
ILT
1026 PR 6049
1027 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
1028 functions.
1029 (class General_options): Remove existing --undefined, and add
1030 --no-undefined instead. Add new --undefined as synonym for -u.
1031 * archive.cc (Archive::add_symbols): Check whether symbol was
1032 named with -u.
1033 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
1034 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
1035 all uses. Add IS_UNDEFINED. Update declarations to split
1036 different versions of init_base. Declare init_base_undefined.
1037 (Symbol::is_defined): Handle IS_UNDEFINED.
1038 (Symbol::is_undefined): Likewise.
1039 (Symbol::is_weak_undefined): Call is_undefined.
1040 (Symbol::is_absolute): Handle IS_CONSTANT.
1041 (class Sized_symbol): Update declarations to split different
1042 versions of init. Declare init_undefined.
1043 (class Symbol_table): Declare new functions.
1044 * symtab.cc (Symbol::init_base_object): Rename from init_base.
1045 Change all callers.
1046 (Symbol::init_base_output_data): Likewise.
1047 (Symbol::init_base_output_segment): Likewise.
1048 (Symbol::init_base_constant): Likewise.
1049 (Symbol::init_base_undefined): New function.
1050 (Sized_symbol::init_object): Rename from init. Change all
1051 callers.
1052 (Sized_symbol::init_output_data): Likewise.
1053 (Sized_symbol::init_output_segment): Likewise.
1054 (Sized_symbol::init_constant): Likewise.
1055 (Sized_symbol::init_undefined): New function.
1056 (Symbol_table::add_undefined_symbols_from_command_line): New
1057 function.
1058 (Symbol_table::do_add_undefined_symbols_from_command_line): New
1059 function.
1060 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
1061 (Symbol::output_section): Likewise.
1062 (Symbol::set_output_section): Likewise.
1063 (Symbol_table::sized_finalize_symbol): Likewise.
1064 (Symbol_table::sized_write_globals): Likewise.
1065 * resolve.cc (Symbol_table::should_override): Likewise.
1066 (Symbol::override_base_with_special): Likewise.
1067
8bdcdf2c
ILT
1068 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
1069 symbol, change it to have default visibility.
1070 * testsuite/protected_1.cc: New file.
1071 * testsuite/protected_2.cc: New file.
1072 * testsuite/protected_3.cc: New file.
1073 * testsuite/protected_main_1.cc: New file.
1074 * testsuite/protected_main_2.cc: New file.
1075 * testsuite/protected_main_3.cc: New file.
1076 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
1077 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
1078 (protected_1_LDFLAGS, protected_1_LDADD): Define.
1079 (protected_1.so): New target.
1080 (protected_1_pic.o, protected_2_pic.o): New targets.
1081 (protected_3_pic.o): New target.
1082 (check_PROGRAMS): Add protected_2.
1083 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
1084 (protected_2_LDFLAGS, protected_2_LDADD): Define.
1085 * testsuite/Makefile.in: Rebuild.
1086
2b706932
ILT
1087 * options.h (DEFINE_var): Add set_user_set_##varname__.
1088 (DEFINE_bool_alias): New macro.
1089 (class General_options): Define -Bstatic using DEFINE_bool_alias
1090 rather than DEFINE_special. Add --undefined as an alias for -z
1091 defs.
1092 * options.cc (General_options::parse_Bstatic): Remove.
1093
d82a5bcc
ILT
1094 * options.h (class General_options): Add --fatal-warnings.
1095 * main.cc (main): Implement --fatal-warnings.
1096 * errors.h (Errors::warning_count): New function.
1097
f1f70eae
ILT
1098 * options.h (class General_options): Add -Bsymbolic-functions.
1099 * symtab.h (Symbol::is_preemptible): Check for
1100 -Bsymbolic-functions.
1101
8825ac63
ILT
11022008-05-05 Ian Lance Taylor <iant@google.com>
1103
d98bc257
ILT
1104 * options.h (DEFINE_bool): For DASH_Z, create the negative option
1105 as noVARNAME rather than no-VARNAME.
1106 (class General_options): Add option -z combreloc.
1107 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
1108 get_address.
1109 (Output_reloc::sort_before) [SHT_REL]: New function.
1110 (Output_reloc::sort_before) [SHT_RELA]: New function.
1111 (class Output_data_reloc_base): Add sort_relocs_ field. Define
1112 Sort_relocs_comparison.
1113 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
1114 parameter. Change all callers.
1115 (Output_data_reloc::Output_data_reloc) [both versions]: Add
1116 sort_relocs parameter. Change all callers.
1117 * output.cc (Output_reloc::get_address): New function, broken out
1118 of write_rel.
1119 (Output_reloc::write_rel): Call it.
1120 (Output_reloc::compare): New function.
1121 (Output_data_reloc_base::do_write): Optionally sort relocs.
1122
60b2b4e7
ILT
1123 * configure.ac: If targ_extra_obj is set, link it in.
1124 * configure.tgt: Initialize all variables.
1125 (x86_64*): Set targ_extra_obj and targ_extra_size.
1126 * configure: Rebuild.
1127
8825ac63
ILT
1128 * object.cc (Sized_relobj::include_section_group): Adjust section
1129 indexes read from group data. Build vector to pass to
1130 layout_group.
1131 * layout.cc (Layout::layout_group): Add flags and shndxes
1132 parameters. Remove contents parameter. Change caller. Update
1133 explicit instantiations.
1134 * layout.h (class Layout): Update layout_group declaration.
1135 * output.cc (Output_data_group::Output_data_group): Add flags and
1136 input_shndxes parameters. Remove contents parameter. Change
1137 caller.
1138 (Output_data_group::do_write): Change input_sections_ to
1139 input_shndxes_.
1140 * output.h (class Output_data_group): Update constructor
1141 declaration. Rename input_sections_ to input_shndxes_.
1142 * testsuite/many_sections_test.cc: Add template.
1143
e94cf127
CC
11442008-04-30 Cary Coutant <ccoutant@google.com>
1145
4418b2d5
CC
1146 * target-reloc.h (relocate_section): Fix dead-pointer bug.
1147
e94cf127
CC
1148 * layout.cc (Layout::include_section): Refactored check for debug
1149 info section.
1150 (Layout::add_comdat): Add new parameters. Change type
1151 of signature parameter. Add object and shndx to signatures table.
1152 (Layout::find_kept_object): New function.
1153 * layout.h: Include <cstring>.
1154 (Layout::is_debug_info_section): New function.
1155 (Layout::add_comdat): Add new parameters.
1156 (Layout::find_kept_object): New function.
1157 (Layout::Kept_section): New struct.
1158 (Layout::Signatures): Change type of map range.
1159 * object.cc (Relobj::output_section_address): New function.
1160 (Sized_relobj::include_section_group): Add new parameters. Change
1161 calls to Layout::add_comdat. Change to build table of kept comdat
1162 groups and table mapping discarded sections to kept sections.
1163 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
1164 (Sized_relobj::do_layout): Change calls to include_section_group and
1165 include_linkonce_section.
1166 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
1167 value to zero when section is discarded.
1168 (Sized_relobj::map_to_kept_section): New function.
1169 * object.h (Relobj::output_section_address): New function.
1170 (Relobj::Comdat_group): New type.
1171 (Relobj::find_comdat_group): New function.
1172 (Relobj::Comdat_group_table): New type.
1173 (Relobj::Kept_comdat_section): New type.
1174 (Relobj::Kept_comdat_section_table): New type.
1175 (Relobj::add_comdat_group): New function.
1176 (Relobj::set_kept_comdat_section): New function.
1177 (Relobj::get_kept_comdat_section): New function.
1178 (Relobj::comdat_groups_): New field.
1179 (Relobj::kept_comdat_sections_): New field.
1180 (Symbol_value::input_value): Update comment.
1181 (Sized_relobj::map_to_kept_section) New function.
1182 (Sized_relobj::include_linkonce_section): Add new parameter.
1183 * target-reloc.h (Comdat_behavior): New type.
1184 (get_comdat_behavior): New function.
1185 (relocate_section): Add code to map a discarded section to the
1186 corresponding kept section when applying a relocation.
1187
e4e5049b
CS
11882008-04-30 Craig Silverstein <csilvers@google.com>
1189
1190 * dwarf_reader.cc (next_generation_count): New static var.
1191 (Addr2line_cache_entry): New struct.
1192 (addr2line_cache): New static var.
1193 (Dwarf_line_info::one_addr2line): Added caching.
1194 (Dwarf_line_info::clear_addr2line_cache): New function.
1195 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
1196 cache-size parameter.
1197 (Dwarf_line_info::one_addr2line_cache): New function.
1198 * symtab.cc (Symbol_table::detect_odr_violations): Pass
1199 new cache-size argument to one_addr2line(), and clear cache.
1200
d09e9154
CC
12012008-04-28 Cary Coutant <ccoutant@google.com>
1202
1203 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
1204 R_386_PC8 relocations.
1205
7ef73768
ILT
12062008-04-23 Ian Lance Taylor <iant@google.com>
1207
55438702
ILT
1208 * object.cc (Sized_relobj::include_section_group): Check for
1209 invalid section group.
1210
c165fb93
ILT
1211 * object.cc (make_elf_object): Correct test for 64-bit ELF file
1212 header size.
1213
7ef73768
ILT
1214 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
1215 than read for file header.
1216 * archive.cc (Archive::include_member): Likewise.
1217
6194aaab
L
12182008-04-23 Paolo Bonzini <bonzini@gnu.org>
1219
1220 * aclocal.m4: Regenerate.
1221 * configure: Regenerate.
1222
d491d34e
ILT
12232008-04-19 Ian Lance Taylor <iant@google.com>
1224
5ea2bac6
ILT
1225 * version.cc (version_string): Bump to 1.6.
1226
7bc3e21a
ILT
1227 * testsuite/Makefile.am (many_sections_r_test): New target.
1228 (many_sections_r_test_SOURCES): Remove.
1229 (many_sections_r_test_DEPENDENCIES): Remove.
1230 (many_sections_r_test_LDFLAGS): Remove.
1231 (many_sections_r_test_LDADD): Remove.
1232
7fcd3aa9
ILT
1233 * object.cc (Sized_relobj::do_add_symbols): Always pass
1234 local_symbol_count_ to add_from_relobj.
1235
4c94d6ae
ILT
1236 * testsuite/Makefile.am (many_sections_check.h): Only check one in
1237 every thousand variables.
1238 * testsuite/Makefile.in: Rebuild.
1239
d491d34e
ILT
1240 * object.cc (Xindex::initialize_symtab_xindex): New function.
1241 (Xindex::read_symtab_xindex): New function.
1242 (Xindex::sym_xindex_to_shndx): New function.
1243 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
1244 available.
1245 (Sized_relobj::do_initialize_xindex): New function.
1246 (Sized_relobj::do_read_symbols): Adjust section links.
1247 (Sized_relobj::symbol_section_and_value): Add is_ordinary
1248 parameter. Change all callers.
1249 (Sized_relobj::include_section_group): Adjust section links and
1250 symbol section indexes.
1251 (Sized_relobj::do_layout): Adjust section links.
1252 (Sized_relobj::do_count_local_symbols): Adjust section links and
1253 symbol section indexes.
1254 (Sized_relobj::do_finalize_local_symbols): Distinguish between
1255 ordinary and special symbols.
1256 (Sized_relobj::write_local_symbols): Add symtab_xindex and
1257 dynsym_xindex parameters. Change all callers. Adjust section
1258 links. Use SHN_XINDEX when needed.
1259 (Sized_relobj::get_symbol_location_info): Adjust section links.
1260 Don't get fooled by special symbols.
1261 * object.h (class Xindex): Define.
1262 (class Object): Add xindex_ parameter. Declare virtual functoin
1263 do_initialize_xindex.
1264 (Object::adjust_sym_shndx): New function.
1265 (Object::set_xindex): New protected function.
1266 (class Symbol_value): Add is_ordinary_shndx_ field.
1267 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
1268 (Symbol_value::value): Assert ordinary section.
1269 (Symbol_value::initialize_input_to_output_map): Likewise.
1270 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
1271 Change all callers.
1272 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
1273 all callers.
1274 (class Sized_relobj): Update declarations.
1275 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
1276 parameter. Change all callers.
1277 (Sized_relobj::adjust_shndx): New function.
1278 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
1279 field.
1280 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
1281 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
1282 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
1283 (Sized_dynobj::read_dynsym_section): Adjust section links.
1284 (Sized_dynobj::read_dynamic): Likewise.
1285 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
1286 section links.
1287 (Sized_dynobj::do_initialize_xindex): New function.
1288 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
1289 do_initialize_xindex.
1290 (Sized_dynobj::adjust_shndx): New function.
1291 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
1292 dynsym_xindex_ fields.
1293 (Layout::finalize): Add a call to set_section_indexes before
1294 creating the symtab sections.
1295 (Layout::set_section_indexes): Don't do anything if the section
1296 already has a section index.
1297 (Layout::create_symtab_sections): Add shnum parameter. Change
1298 caller. Create .symtab_shndx section if needed.
1299 (Layout::create_shdrs): Add shstrtab_section parameter. Change
1300 caller.
1301 (Layout::allocated_output_section_count): New function.
1302 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
1303 needed.
1304 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
1305 fields. Update declarations.
1306 (Layout::symtab_xindex): New function.
1307 (Layout::dynsym_xindex): New function.
1308 (class Write_symbols_task): Add layout_ field.
1309 (Write_symbols_task::Write_symbols_task): Add layout parameter.
1310 Change caller.
1311 * output.cc (Output_section_headers::Output_section_headers): Add
1312 shstrtab_section parameter. Change all callers.
1313 (Output_section_headers::do_sized_write): Store overflow values
1314 for section count and section string table section index in
1315 section header zero.
1316 (Output_file_header::do_sized_write): Check for overflow of
1317 section count and section string table section index.
1318 (Output_symtab_xindex::do_write): New function.
1319 (Output_symtab_xindex::endian_do_write): New function.
1320 * output.h (class Output_section_headers): Add shstrtab_section_.
1321 Update declarations.
1322 (class Output_symtab_xindex): Define.
1323 (Output_section::has_out_shndx): New function.
1324 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
1325 field.
1326 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
1327 Change all callers.
1328 (Sized_symbol::init): Likewise.
1329 (Symbol::output_section): Check for ordinary symbol.
1330 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
1331 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
1332 callers.
1333 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
1334 Change all callers. Simplify handling of symbols from sections
1335 not included in the link.
1336 (Symbol_table::add_from_dynobj): Handle ordinary symbol
1337 distinction.
1338 (Weak_alias_sorter::operator()): Assert that symbols are
1339 ordinary.
1340 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
1341 distinction.
1342 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
1343 parameters. Change all callers.
1344 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
1345 symbol distinction. Use SHN_XINDEX when needed.
1346 (Symbol_table::write_section_symbol): Add symtab_xindex
1347 parameter. Change all callers.
1348 (Symbol_table::sized_write_section_symbol): Likewise. Use
1349 SHN_XINDEX when needed.
1350 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
1351 declarations.
1352 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
1353 (Symbol::is_defined): Check is_ordinary.
1354 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
1355 (Symbol::is_absolute, Symbol::is_common): Likewise.
1356 (class Sized_symbol): Update declarations.
1357 (class Symbol_table): Update declarations.
1358 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
1359 parameters. Change all callers.
1360 (Sized_symbol::override): Likewise.
1361 (Symbol_table::override): Likewise.
1362 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
1363 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
1364 is_ordinary, and orig_st_shndx parameters. Change all callers.
1365 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
1366 to be in an ordinary section.
1367 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
1368 object and is_ordinary parameters. Change all callers.
1369 (Sized_dwarf_line_info::read_relocs): Add object parameter.
1370 Change all callers. Don't add undefined or non-ordinary symbols
1371 to reloc_map_.
1372 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
1373 Change all callers.
1374 * dwarf_reader.h (class Sized_dwarf_line_info): Update
1375 declarations.
1376 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
1377 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
1378 (Sized_relobj::relocate_sections): Likewise.
1379 * target-reloc.h (scan_relocs): Adjust section symbol index.
1380 (scan_relocatable_relocs): Likewise.
1381 * i386.cc (Scan::local): Check for ordinary symbols.
1382 * sparc.cc (Scan::local): Likewise.
1383 * x86_64.cc (Scan::local): Likewise.
1384 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
1385 to symbol_section_and_value.
1386 * testsuite/many_sections_test.cc: New file.
1387 * testsuite/Makefile.am (BUILT_SOURCES): Define.
1388 (check_PROGRAMS): Add many_sections_test.
1389 (many_sections_test_SOURCES): Define.
1390 (many_sections_test_DEPENDENCIES): Define.
1391 (many_sections_test_LDFLAGS): Define.
1392 (BUILT_SOURCES): Add many_sections_define.h.
1393 (many_sections_define.h): New target.
1394 (BUILT_SOURCES): Add many_sections_check.h.
1395 (many_sections_check.h): New target.
1396 (check_PROGRAMS): Add many_sections_r_test.
1397 (many_sections_r_test_SOURCES): Define.
1398 (many_sections_r_test_DEPENDENCIES): Define.
1399 (many_sections_r_test_LDFLAGS): Define.
1400 (many_sections_r_test_LDADD): Define.
1401 (many_sections_r_test.o): New target.
1402 * testsuite/Makefile.in: Rebuild.
1403
c5818ff1
CC
14042008-04-17 Cary Coutant <ccoutant@google.com>
1405
1406 * errors.cc (Errors::info): New function.
1407 (gold_info): New function.
1408 * errors.h (Errors::info): New function.
1409 * gold.h (gold_info): New function.
1410 * object.cc (Input_objects::add_object): Print trace output.
1411 * options.cc (options::parse_set): New function.
1412 (General_options::parse_wrap): Deleted.
1413 (General_options::General_options): Deleted initializer.
1414 * options.h (options::String_set): New typedef.
1415 (options::parse_set): New function.
1416 (DEFINE_set): New macro.
1417 (General_options::wrap): Changed to use DEFINE_set. Changed
1418 callers of any_wrap_symbols and is_wrap_symbol.
1419 (General_options::trace, General_options::trace_symbol):
1420 New options.
1421 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
1422 (General_options::wrap_symbols_): Deleted.
1423 * symtab.cc (Symbol_table::add_from_object): Print trace output.
1424
b5be4a7c
DM
14252008-04-17 David S. Miller <davem@davemloft.net>
1426
1427 * options.cc (General_options::parse_V): New function.
1428 * options.h: Add entries for -V and -Qy.
1429
155a0dd7
ILT
14302008-04-17 Ian Lance Taylor <iant@google.com>
1431
1432 * common.cc (Symbol_table::allocate_commons): Remove options
1433 parameter. Change caller.
1434 (Symbol_table::do_allocate_commons): Remove options parameter.
1435 Change caller. Just call do_allocate_commons_list twice.
1436 (Symbol_table::do_allocate_commons_list): New function, broken out
1437 of do_allocate_commons.
1438 * common.h (class Allocate_commons_task): Remove options_ field.
1439 Update constructor.
1440 * symtab.cc (Symbol_table::Symbol_table): Initialize
1441 tls_commons_.
1442 (Symbol_table::add_from_object): Put TLS common symbols on
1443 tls_commons_ list.
1444 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
1445 which are IN_OUTPUT_DATA.
1446 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
1447 allocate_commons and do_allocate_commons declarations. Declare
1448 do_allocate_commons_list.
1449 * gold.cc (queue_middle_tasks): Update creation of
1450 Allocate_commons_task to not pass options.
1451 * testsuite/Makefile.am (INCLUDES): Add -I.. .
1452 (TLS_TEST_C_FLAGS): New variable.
1453 (tls_test_c_pic.o): New target.
1454 (tls_test_shared.so): Link in tls_test_c_pic.o.
1455 (tls_test_c_pic_ie.o): New target.
1456 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
1457 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
1458 (tls_test_c.o): New target.
1459 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
1460 (tls_pic_test_LDADD): Likewise.
1461 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
1462 (tls_shared_gd_to_ie_test_LDADD): Likewise.
1463 (tls_test_c_gnu2.o): New target.
1464 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
1465 tls_test_c_gnu2.o.
1466 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
1467 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
1468 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
1469 * testsuite/tls_test.cc: Include "config.h".
1470 (t_last): Call t11_last.
1471 * testsuite/tls_test.h (t11, t11_last): Declare.
1472 * testsuite/tls_test_c.c: New file.
1473 * testsuite/tls_test_main.cc (thread_routine): Call t11.
1474 * configure.ac: Check for OpenMP support.
1475 * configure, config.in, Makefile.in: Rebuild.
1476 * testsuite/Makefile.in: Rebuild.
1477
edfbb029
CC
14782008-04-16 Cary Coutant <ccoutant@google.com>
1479
1480 * i386.cc (Target_i386::define_tls_base_symbol): New function.
1481 (Target_i386::tls_base_symbol_defined_): New field.
1482 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
1483 (Target_i386::Scan::global): Likewise.
1484 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
1485 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
1486 (Target_x86_64::tls_base_symbol_defined_): New field.
1487 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
1488 (Target_x86_64::Scan::global): Likewise.
1489
f3c69fca
CC
14902008-04-16 Cary Coutant <ccoutant@google.com>
1491
1492 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
1493 (Symbol::needs_plt_entry): Allow weak undefined symbols.
1494 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
1495 building shared libraries.
1496 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
1497 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
1498 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
1499 * testsuite/Makefile.in: Rebuild.
1500 * testsuite/weak_undef.h: New file.
1501 * testsuite/weak_undef_file1.cc: Add extra test cases.
1502 * testsuite/weak_undef_file2.cc: Likewise.
1503 * testsuite/weak_undef_test.cc: Likewise.
1504
7c414435
DM
15052008-04-16 David S. Miller <davem@davemloft.net>
1506
32b769e1
DM
1507 * sparc.cc (Target_sparc::Scan): Change from struct to class.
1508 Add issued_non_pic_error_ field. Declare check_non_pic.
1509 (Target_sparc::Scan::check_non_pic): New function.
1510 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
1511 (Target_sparc::Scan::global): Likewise.
1512
11936fb1
DM
1513 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
1514 * configure: Rebuild.
1515
7c414435
DM
1516 * options.h (DEFINE_enable): New macro.
1517 (new_dtags): New enable option.
1518 (initfirst, interpose, loadfltr, nodefaultlib,
1519 nodelete, nodlopen, nodump): New -z options.
1520 * layout.cc (Layout:finish_dynamic_section): If new
1521 dtags enabled, emit DT_RUNPATH. Also, emit a
1522 DT_FLAGS_1 containing any specified -z flags.
1523
85c7bf8b
ILT
15242008-04-16 Ian Lance Taylor <iant@google.com>
1525
12c0daef
ILT
1526 * copy-relocs.cc: New file.
1527 * copy-relocs.h: New file.
1528 * reloc.cc: Remove Copy_relocs code.
1529 * reloc.h: Likewise.
1530 * reloc-types.h (struct Reloc_types) [both versions]: Add
1531 get_reloc_addend_noerror.
1532 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
1533 variants of add_global which take an addend which must be zero.
1534 * i386.cc: Include "copy-relocs.h".
1535 (class Target_i386): Change type of copy_relocs_ to variable,
1536 update initializer.
1537 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
1538 Change all callers.
1539 (Target_i386::do_finalize_sections): Change handling of
1540 copy_relocs_.
1541 * sparc.cc: Include "copy-relocs.h".
1542 (class Target_sparc): Change type of copy_relocs_ to variable,
1543 update initializer.
1544 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
1545 Change all callers.
1546 (Target_sparc::do_finalize_sections): Change handling of
1547 copy_relocs_.
1548 * x86_64.cc: Include "copy-relocs.h".
1549 (class Target_x86_64): Change type of copy_relocs_ to variable,
1550 update initializer.
1551 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
1552 class. Change all callers.
1553 (Target_x86_64::do_finalize_sections): Change handling of
1554 copy_relocs_.
1555 * Makefile.am (CCFILES): Add copy-relocs.cc.
1556 (HFILES): Add copy-relocs.h.
1557
4f4995b6
ILT
1558 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
1559
85c7bf8b
ILT
1560 * testsuite/script_test_4.sh: Permit leading zeroes.
1561
4f2a9edd
ILT
15622008-04-15 Ian Lance Taylor <iant@google.com>
1563
e6188289
ILT
1564 * script-sections.cc (Script_sections::create_segments): Use
1565 header_size_adjustment even when there is enough room for the
1566 headers.
1567 * testsuite/script_test_4.sh: New file.
1568 * testsuite/script_test_4.t: New file.
1569 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
1570 (check_DATA): Add script_test_4.stdout.
1571 (MOSTLYCLEANFILES): Likewise.
1572 (script_test_4): New target.
1573 (script_test_4.stdout): New target.
1574 * testsuite/Makefile.in: Rebuild.
1575
4f2a9edd
ILT
1576 * sparc.cc: Add definitions for Output_data_plt_sparc class
1577 constants.
1578
f5314dd5
DM
15792008-04-14 David S. Miller <davem@davemloft.net>
1580
1581 * sparc.cc: New file.
1582 * Makefile.am (TARGETSOURCES): Add sparc.cc
1583 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
1584 * configure.tgt: Document targ_extra_size and
1585 targ_extra_big_endian. Add entries for sparc-* and
1586 sparc64-*.
1587 * configure.ac: Handle targ_extra_size and
1588 targ_extra_big_endian.
1589 * Makefile.in: Rebuild.
1590 * configure: Likewise.
1591 * po/POTFILES.in: Likewise.
1592 * po/gold.pot: Likewise.
1593
154e0e9a
ILT
15942008-04-14 Ian Lance Taylor <iant@google.com>
1595
1596 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
1597 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
1598 in the name/type/flags to section mapping. Don't call
1599 allocate_output_section.
1600 (Layout::choose_output_section): Change parameter from adjust_name
1601 to is_input_section. Don't permit input sections after sections
1602 are attached to segments. Don't call allocate_output_section.
1603 (Layout::layout_eh_frame): Call update_flags_for_input_section,
1604 not write_enable_output_section.
1605 (Layout::make_output_section): Don't push to
1606 unattached_section_list_ nor call attach_to_segment. Call
1607 attach_section_to_segment if sections are attached.
1608 (Layout::attach_sections_to_segments): New function.
1609 (Layout::attach_section_to_segment): New function.
1610 (Layout::attach_allocated_section_to_segment): Rename from
1611 attach_to_segment. Remove flags parameter.
1612 (Layout::allocate_output_section): Remove function.
1613 (Layout::write_enable_output_section): Remove function.
1614 * layout.h (class Layout): Update for above changes. Add new
1615 field sections_are_attached_.
1616 * output.h (Output_section::update_flags_for_input_section): New
1617 function.
1618 * output.cc (Output_section::add_input_section): Call
1619 update_flags_for_input_section.
1620 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
1621
009a67a2
CC
16222008-04-11 Cary Coutant <ccoutant@google.com>
1623
1624 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
1625 thought unnecessary.
1626 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
1627
759b1a24
ILT
16282008-04-11 Ian Lance Taylor <iant@google.com>
1629
1630 * output.h (class Output_section_data): Remove inline definition
1631 of set_addralign.
1632 * output.cc (Output_section_data::set_addralign): New function.
1633
c2b45e22
CC
16342008-04-11 Cary Coutant <ccoutant@google.com>
1635
1636 Add support for TLS descriptors for i386 and x86_64.
1637 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
1638 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
1639 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
1640 GOT_TYPE_TLS_DESC.
1641 (Target_i386::got_mod_index_entry): Remove unnecessary code.
1642 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
1643 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
1644 relocations.
1645 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
1646 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
1647 Fix problem with initial-exec relocations.
1648 (Target_i386::Relocate::relocate_tls): Likewise.
1649 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
1650 relaxation.
1651 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
1652 support for section-plus-offset dynamic table entries.
1653 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
1654 (Output_data_dynamic::Dynamic_entry): Add support for
1655 section-plus-offset dynamic table entries.
1656 (Output_data_dynamic::Classification): Likewise.
1657 (Output_data_dynamic::classification_): Renamed offset_.
1658 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
1659 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
1660 (Target_x86_64::make_plt_section): New function.
1661 (Target_x86_64::reserve_tlsdesc_entries): New function.
1662 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
1663 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
1664 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
1665 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
1666 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
1667 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
1668 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
1669 add extra PLT entry for TLS descriptors.
1670 (Output_data_plt_x86_64::got_): New field.
1671 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
1672 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
1673 fields.
1674 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
1675 descriptors.
1676 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
1677 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
1678 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
1679 R_386_TLS_DESC_CALL relocations.
1680 (Target_x86_64::Scan::global): Likewise.
1681 (Target_x86_64::do_finalize_sections): Add dynamic table entries
1682 for TLS descriptors.
1683 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
1684 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
1685 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
1686 GD-to-IE relaxation.
1687 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
1688 and TLS_DESCRIPTORS.
1689 * Makefile.in: Rebuild.
1690 * configure: Rebuild.
1691 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
1692 (tls_test_shared2.so): New target.
1693 (tls_shared_gd_to_ie_test_SOURCES): New variable.
1694 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
1695 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
1696 (tls_shared_gd_to_ie_test_LDADD): New variable.
1697 (tls_shared_gnu2_gd_to_ie_test): New target.
1698 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
1699 New targets.
1700 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
1701 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
1702 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
1703 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
1704 (tls_shared_gnu2_test): New target.
1705 (tls_test_gnu2_shared.so): New target.
1706 (tls_shared_gnu2_test_SOURCES): New variable.
1707 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
1708 (tls_shared_gnu2_test_LDFLAGS): New variable.
1709 (tls_shared_gnu2_test_LDADD): New variable.
1710 * testsuite/Makefile.in: Rebuild.
1711 * testsuite/Makefile.
1712
83bfb6b7
ILT
17132008-04-11 Ian Lance Taylor <iant@google.com>
1714
1715 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
1716 justsyms.t.
1717 * testsuite/Makefile.in: Rebuild.
1718
1719 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
1720 long.
1721 * testsuite/script_test_2.cc (main): Adjust test.
1722
706e1f5e
ILT
17232008-04-11 David S. Miller <davem@davemloft.net>
1724 Ian Lance Taylor <iant@google.com>
1725
1726 * options.h (General_options): Add entries for '-Y' and
1727 '-relax'.
1728 * options.cc (General_options:finalize): If -Y was used, add those
1729 entries to the library path instead of the default "/lib" and
1730 "/usr/lib".
1731
7c98e6bb
DM
17322008-04-11 David S. Miller <davem@davemloft.net>
1733
1734 * testsuite/justsyms.t: Start at 0x100.
1735 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
1736 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
1737 long.
1738 * testsuite/script_test_2.cc: Adjust string and section length
1739 checks.
7c98e6bb 1740
99a37bfd
ILT
17412008-04-09 Ian Lance Taylor <iant@google.com>
1742
2cefc357
ILT
1743 PR gold/5996
1744 * script-sections.cc (Sections_element::allocate_to_segment): Add
1745 orphan parameter.
1746 (Output_section_definition::allocate_to_segment): Likewise.
1747 (Orphan_output_section::allocate_to_segment): Likewise.
1748 (Script_sections::attach_sections_using_phdrs_clause): Don't
1749 propagate non-PT_LOAD segments to orphan sections.
1750 * testsuite/Makefile.am (script_test_3.stdout): Generate using
1751 readelf rather than objdump.
1752 * testsuite/script_test_3.sh: Adjust accordingly. Test that
1753 .interp section and PT_INTERP segment are the same size.
1754 * testsuite/Makefile.in: Rebuild.
1755
99a37bfd
ILT
1756 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
1757 aliases for symbols defined in the same object.
1758 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
1759 (weak_alias_test_SOURCES): New variable.
1760 (weak_alias_test_DEPENDENCIES): New variable.
1761 (weak_alias_test_LDFLAGS): New variable.
1762 (weak_alias_test_LDADD): New variable.
1763 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
1764 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
1765 (weak_alias_test_3.o): New target.
1766 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
1767 * testsuite/weak_alias_test_main.cc: New file.
1768 * testsuite/weak_alias_test_1.cc: New file.
1769 * testsuite/weak_alias_test_2.cc: New file.
1770 * testsuite/weak_alias_test_3.cc: New file.
1771
780e49c5
ILT
17722008-04-08 Ian Lance Taylor <iant@google.com>
1773
cdb0b8f5
ILT
1774 * options.h (class General_options): Add --noinhibit-exec option.
1775 * main.cc (main): Check --noinhibit-exec.
1776
0864d551
ILT
1777 * options.h (class General_options): Define --wrap as a special
1778 option. Add wrap_symbols_ field.
1779 (General_options::any_wrap_symbols): New function.
1780 (General_options::is_wrap_symbol): New function.
1781 * options.cc (General_options::parse_wrap): New function.
1782 (General_options::General_options): Initialize wrap_symbols_.
1783 * symtab.cc (Symbol_table::wrap_symbol): New function.
1784 (Symbol_table::add_from_object): Handle --wrap.
1785 * symtab.h (class Symbol_table): Declare wrap_symbol.
1786 * target.h (Target::wrap_char): New function.
1787 (Target::Target_info): Add wrap_char field.
1788 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
1789 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
1790 * testsuite/testfile.cc (Target_test::test_target_info):
1791 Likewise.
1792
789aa6de
ILT
1793 * errors.cc (Errors::undefined_symbol): Mention symbol version if
1794 there is one.
1795
2c38906f
ILT
1796 * layout.h (class Layout): Add added_eh_frame_data_ field.
1797 * layout.cc (Layout::Layout): Initialize new field.
1798 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
1799 output section until we find a section we merged successfully.
1800 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
1801 that the size be non-zero.
1802
780e49c5
ILT
1803 * merge.cc (Object_merge_map::get_output_offset): Remove inline
1804 qualifier.
1805
7fcd0256
ILT
18062008-04-08 Craig Silverstein <csilvers@google.com>
1807
1808 * configure.ac: Export new conditional variable HAVE_ZLIB.
1809 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
1810 on HAVE_ZLIB.
1811 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
1812 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
1813
6835af53
ILT
18142008-04-07 Ian Lance Taylor <iant@google.com>
1815
e24f324c
ILT
1816 * version.cc (version_string): Set to "1.5".
1817
a036edd8
ILT
1818 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
1819 Add issued_non_pic_error_ field. Declare check_non_pic.
1820 (Target_x86_64::Scan::check_non_pic): New function.
1821 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
1822 (Target_x86_64::Scan::global): Likewise.
1823
624f8810
ILT
1824 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
1825 addend parameter. Change caller. Handle merge sections.
1826 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
1827 Address to Addend. Don't add in the result of
1828 local_section_offset, pass down the addend and use the returned
1829 value.
1830 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
1831 Update declarations of local_section_offset and symbol_value.
1832 * testsuite/two_file_test_1.cc (t18): New function.
1833 * testsuite/two_file_test_2.cc (f18): New function.
1834 * testsuite/two_file_test_main.cc (main): Call t18.
1835 * testsuite/two_file_test.h (t18, f18): Declare.
1836
6835af53
ILT
1837 * configure.ac: Don't test for objdump, c++filt, or readelf.
1838 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
1839 conditionals.
1840 (TEST_READELF): New variable.
1841 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
1842 (check_PROGRAMS): Add two_file_strip_test.
1843 (two_file_strip_test): New target.
1844 (check_PROGRAMS): Add two_file_same_shared_strip_test.
1845 (two_file_same_shared_strip_test_SOURCES): New variable.
1846 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
1847 (two_file_same_shared_strip_test_LDFLAGS): New variable.
1848 (two_file_same_shared_strip_test_LDADD): New variable.
1849 (two_file_shared_strip.so): New target.
1850 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
1851 (ver_test_5.syms, ver_test_7.syms): Likewise.
1852 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
1853 (strip_test_3.stdout): Use TEST_OBJDUMP.
1854 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
1855
86925eef
CC
18562008-04-04 Cary Coutant <ccoutant@google.com>
1857
1858 * symtab.h (Symbol::is_weak_undefined): New function.
1859 (Symbol::is_strong_undefined): New function.
1860 (Symbol::is_absolute): New function.
1861 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
1862 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
1863 absolute symbols.
1864 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
1865 (weak_undef_test): New target.
1866 * testsuite/Makefile.in: Rebuild.
1867 * testsuite/weak_undef_file1.cc: New file.
1868 * testsuite/weak_undef_file2.cc: New file.
1869 * testsuite/weak_undef_test.cc: New file.
1870
126f3ece
ILT
18712008-04-03 Craig Silverstein <csilvers@google.com>
1872
1873 * compressed_output.h (class Output_compressed_section): Use
1874 unsigned buffer.
1875 * compressed_output.cc (zlib_compress): Use unsigned buffers,
1876 add zlib header.
1877 (zlib_compressed_suffix): Removed.
1878 (Output_compressed_section::set_final_data_size): Use unsigned
1879 buffers.
1880 * testsuite/Makefile.am (flagstest_compress_debug_sections):
1881 Fix linker invocation.
1882 (flagstest_o_specialfile_and_compress_debug_sections):
1883 Likewise.
1884 * testsuite/Makefile.in: Regenerated.
1885
deae2a14
DM
18862008-04-02 David S. Miller <davem@davemloft.net>
1887
1888 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
1889 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
1890
70752818
ILT
18912008-04-02 Craig Silverstein <csilvers@google.com>
1892
1893 * TODO: New file.
1894
39d0cb0e
ILT
18952008-04-02 Ian Lance Taylor <iant@google.com>
1896
1897 * fileread.cc (File_read::find_view): Add byteshift and vshifted
1898 parameters. Update for new key type to views_. Change all
1899 callers.
1900 (File_read::read): Adjust for byteshift in returned view.
1901 (File_read::add_view): New function, broken out of
1902 find_and_make_view.
1903 (File_read::make_view): New function, broken out of
1904 find_and_make_view.
1905 (File_read::find_or_make_view): Add offset and aligned
1906 parameters. Rewrite accordingly. Change all callers.
1907 (File_read::get_view): Add offset and aligned parameters. Adjust
1908 for byteshift in return value.
1909 (File_read::get_lasting_view): Likewise.
1910 * fileread.h (class File_read): Update declarations.
1911 (class File_read::View): Add byteshift_ field. Add byteshift to
1912 constructor. Add byteshift method.
1913 * archive.h (Archive::clear_uncached_views): New function.
1914 (Archive::get_view): Add aligned parameter. Change all callers.
1915 * object.h (Object::get_view): Add aligned parameter. Change all
1916 callers.
1917 (Object::get_lasting_view): Likewise.
1918
1919 * fileread.cc (File_read::release): Don't call clear_views if
1920 there are multiple objects.
1921 * fileread.h (File_read::clear_uncached_views): New function.
1922 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
1923 on the archive.
1924
a1207466
CC
19252008-03-31 Cary Coutant <ccoutant@google.com>
1926
1927 Add thin archive support.
1928 * archive.cc (Archive::armagt): New const.
1929 (Archive::setup): Remove task parameter and calls to unlock.
1930 (Archive::unlock_nested_archives): New function.
1931 (Archive::read_header): Add nested_off parameter. Change
1932 all callers.
1933 (Archive::interpret_header): Likewise.
1934 (Archive::include_all_members): Change to handle thin
1935 archives.
1936 (Archive::include_member): Likewise.
1937 * archive.h (Archive::Archive): Add new parameters and
1938 initializers.
1939 (Archive::armagt): New const.
1940 (Archive::setup): Remove task parameter.
1941 (Archive::unlock_nested_archives): New function.
1942 (Archive::read_header): Add nested_off parameter.
1943 (Archive::interpret_header): Likewise.
1944 (Archive::Nested_archive_table): New typedef.
1945 (Archive::is_thin_archive_): New field.
1946 (Archive::nested_archives_): New field.
1947 (Archive::options_): New field.
1948 (Archive::dirpath_): New field.
1949 (Archive::task_): New field.
1950 * readsyms.cc (Read_symbols::do_read_symbols): Add check
1951 for thin archives. Pass additional parameters to
1952 Archive::Archive. Unlock the archive file after calling
1953 Archive::setup.
1954
479f6503
ILT
19552008-03-29 Ian Lance Taylor <iant@google.com>
1956
686c8caf
ILT
1957 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
1958 version symbol to be local.
1959 * testsuite/ver_test_4.sh: New file.
1960 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
1961 (check_DATA): Add ver_test_4.syms.
1962 (ver_test_4.syms): New target.
1963 * testsuite/Makefile.in: Rebuild.
1964
ab794b6b
ILT
1965 * output.cc
1966 (Output_section::Input_section_sort_entry::has_priority): New
1967 function.
1968 (Output_section::Input_section_sort_entry::match_file_name): New
1969 function.
1970 (Output_section::Input_section_sort_entry::match_section_name):
1971 Remove.
1972 (Output_section::Input_section_sort_entry::match_section_name_prefix):
1973 Remove.
1974 (Output_section::Input_section_sort_entry::match_section_file):
1975 Remove.
1976 (Output_section::Input_section_sort_compare::operator()): Rewrite
1977 using new Input_section_sort_entry functions. Sort crtbegin and
1978 crtend first. Sort sections with no priority before sections with
1979 a priority.
1980 * testsuite/initpri1.c (d3): Check j != 4.
1981 (cd5): New constructor/destructor function.
1982 (main): Check j != 2.
1983
479f6503
ILT
1984 * symtab.cc (Symbol_table::add_from_object): If we don't use the
1985 new symbol when resolving, don't call set_is_default.
1986 * testsuite/ver_test_7.cc: New file.
1987 * testsuite/ver_test_7.sh: New file.
1988 * testsuite/Makefile.am (ver_test_7.so): New target.
1989 (ver_test_7.o): New target.
1990 (check_SCRIPTS): Add ver_test_7.sh.
1991 (check_DATA): Add ver_test_7.syms.
1992 (ver_test_7.syms): New target.
1993
2fd32231
ILT
19942008-03-28 Ian Lance Taylor <iant@google.com>
1995
1996 * layout.cc (Layout::layout): If we see an input section with a
1997 name that needs sorting, set the must_sort flag for the output
1998 section.
1999 (Layout::make_output_section): If the name of the output section
2000 indicates that it might require sorting, set the may_sort flag.
2001 * output.h (Output_section::may_sort_attached_input_sections): New
2002 function.
2003 (Output_section::set_may_sort_attached_input_sections): New
2004 function.
2005 (Output_section::must_sort_attached_input_sections): New
2006 function.
2007 (Output_section::set_must_sort_attached_input_sections): New
2008 function.
2009 (class Output_section): Declare Input_section_sort_entry. Define
2010 Input_section_sort_compare. Declare
2011 sort_attached_input_sections. Add new fields:
2012 may_sort_attached_input_sections_,
2013 must_sort_attached_input_sections_,
2014 attached_input_sections_are_sorted_.
2015 * output.cc (Output_section::Output_section): Initialize new
2016 fields.
2017 (Output_section::add_input_section): Add an entry to
2018 input_sections_ if may_sort or must_sort are true.
2019 (Output_section::set_final_data_size): Call
2020 sort_attached_input_sections if necessary.
2021 (Output_section::Input_section_sort_entry): Define new class.
2022 (Output_section::Input_section_sort_compare::operator()): New
2023 function.
2024 (Output_section::sort_attached_input_sections): New function.
2025 * configure.ac: Check whether the compiler supports constructor
2026 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
2027 * testsuite/initpri1.c: New file.
2028 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
2029 CONSTRUCTOR_PRIORITY.
2030 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
2031 (initpri1_LDFLAGS): New variable.
2032 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
2033
18e6b24e
ILT
20342008-03-27 Ian Lance Taylor <iant@google.com>
2035
49bdd526
ILT
2036 * common.cc (Sort_commons::operator): Correct sorting algorithm.
2037 * testsuite/common_test_1.c: New file.
2038 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
2039 (common_test_1_SOURCES): New variable.
2040 (common_test_1_DEPENDENCIES): New variable.
2041 (common_test_1_LDFLAGS): New variable.
2042
18e6b24e
ILT
2043 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
2044 and commons_ correctly when NAME/VERSION does not override
2045 NAME/NULL.
2046 * testsuite/ver_test_6.c: New file.
2047 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
2048 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
2049 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
2050
04bf7072
ILT
20512008-03-26 Ian Lance Taylor <iant@google.com>
2052
5871526f
ILT
2053 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
2054 of an undefined symbol from a version script.
2055 * testsuite/Makefile.am (ver_test_5.so): New target.
2056 (ver_test_5.o): New target.
2057 (check_SCRIPTS): Add ver_test_5.sh.
2058 (check_DATA): Add ver_test_5.syms.
2059 (ver_test_5.syms): New target.
2060 * testsuite/ver_test_5.cc: New file.
2061 * testsuite/ver_test_5.script: New file.
2062 * testsuite/ver_test_5.sh: New file.
2063 * Makefile.in, testsuite/Makefile.in: Rebuild.
2064
04bf7072
ILT
2065 PR gold/5986
2066 Fix problems building gold with gcc 4.3.0.
2067 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
2068 (gold_error_at_location, gold_warning_at_location): Use it.
2069 * configure.ac: Check whether we can compile and use a template
2070 function with a printf attribute.
2071 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
2072 when jumping over bytes.
2073 * object.cc: Instantiate Object::read_section_data.
2074 * debug.h: Include <cstring>
2075 * dwarf_reader.cc: Include <algorithm>
2076 * main.cc: Include <cstring>.
2077 * options.cc: Include <cstring>.
2078 * output.cc: Include <cstring>.
2079 * script.cc: Include <cstring>.
2080 * script.h: Include <string>.
2081 * symtab.cc: Include <cstring> and <algorithm>.
2082 * target-select.cc: Include <cstring>.
2083 * version.cc: Include <string>.
2084 * testsuite/testmain.cc: Include <cstdlib>.
2085 * configure, config.in: Rebuild.
2086
874c5b28
ILT
20872008-03-25 Ian Lance Taylor <iant@google.com>
2088
819d6c3a
ILT
2089 * options.cc: Include "../bfd/bfdver.h".
2090 (options::help): Print bug reporting address.
2091
f4b2c6f5
ILT
2092 * version.cc (print_version): Adjust output for current value of
2093 BFD_VERSION_STRING.
2094
2095 * NEWS: New file.
2096
e96caa79
ILT
2097 * options.cc (options::help): Print list of supported targets.
2098 * target-select.h: Include <vector>.
2099 (class Target_selector): Make machine_, size_, and is_big_endian_
2100 fields const. Add bfd_name_ and instantiated_target_ fields.
2101 (Target_selector::Target_selector): Add bfd_name parameter.
2102 (Target_selector::recognize): Make non-virtual, call
2103 do_recognize.
2104 (Target_selector::recognize_by_name): Make non-virtual, call
2105 do_recognize_by_name.
2106 (Target_selector::supported_names): New function.
2107 (Target_selector::bfd_name): New function.
2108 (Target_selector::do_instantiate_target): New pure virtual
2109 function.
2110 (Target_selector::do_recognize): New virtual function.
2111 (Target_selector::do_recognize_by_name): New virtual function.
2112 (Target_selector::instantiate_target): New private function.
2113 (supported_target_names): Declare.
2114 * target-select.cc (Target_selector::Target_selector): Update for
2115 new parameter and fields.
2116 (select_target_by_name): Check that the name matches before
2117 calling recognize_by_name.
2118 (supported_target_names): New function.
2119 * i386.cc (class Target_selector_i386): Update Target_selector
2120 constructor call. Remove recognize and recognize_by_name. Add
2121 do_instantiate_target.
2122 * x86_64.cc (class Target_selector_x86_64): Likewise.
2123 * testsuite/testfile.cc (class Target_selector_test): Update for
2124 changes to Target_selector.
2125
874c5b28
ILT
2126 * README: Rewrite, with some notes on unsupported features.
2127
0a65a3a7
CC
21282008-03-24 Cary Coutant <ccoutant@google.com>
2129
2130 * i386.cc (Target_i386::Got_type): New enum declaration.
2131 (Target_i386::Scan::local): Updated callers of Output_data_got
2132 member functions.
2133 (Target_i386::Scan::global): Likewise.
2134 (Target_i386::Relocate::relocate): Likewise.
2135 (Target_i386::Relocate::relocate_tls): Likewise.
2136 * object.h (Got_offset_list): New class.
2137 (Sized_relobj::local_has_got_offset): Added got_type parameter.
2138 (Sized_relobj::local_got_offset): Likewise.
2139 (Sized_relobj::set_local_got_offset): Likewise.
2140 (Sized_relobj::local_has_tls_got_offset): Removed.
2141 (Sized_relobj::local_tls_got_offset): Removed.
2142 (Sized_relobj::set_local_tls_got_offset): Removed.
2143 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
2144 * output.cc (Output_data_got::add_global): Added got_type parameter.
2145 (Output_data_got::add_global_with_rel): Likewise.
2146 (Output_data_got::add_global_with_rela): Likewise.
2147 (Output_data_got::add_global_pair_with_rel): New function.
2148 (Output_data_got::add_global_pair_with_rela): New function.
2149 (Output_data_got::add_local): Added got_type parameter.
2150 (Output_data_got::add_local_with_rel): Likewise.
2151 (Output_data_got::add_local_with_rela): Likewise.
2152 (Output_data_got::add_local_pair_with_rel): New function.
2153 (Output_data_got::add_local_pair_with_rela): New function.
2154 (Output_data_got::add_global_tls): Removed.
2155 (Output_data_got::add_global_tls_with_rel): Removed.
2156 (Output_data_got::add_global_tls_with_rela): Removed.
2157 (Output_data_got::add_local_tls): Removed.
2158 (Output_data_got::add_local_tls_with_rel): Removed.
2159 (Output_data_got::add_local_tls_with_rela): Removed.
2160 * output.h (Output_data_got::add_global): Added got_type parameter.
2161 (Output_data_got::add_global_with_rel): Likewise.
2162 (Output_data_got::add_global_with_rela): Likewise.
2163 (Output_data_got::add_global_pair_with_rel): New function.
2164 (Output_data_got::add_global_pair_with_rela): New function.
2165 (Output_data_got::add_local): Added got_type parameter.
2166 (Output_data_got::add_local_with_rel): Likewise.
2167 (Output_data_got::add_local_with_rela): Likewise.
2168 (Output_data_got::add_local_pair_with_rel): New function.
2169 (Output_data_got::add_local_pair_with_rela): New function.
2170 (Output_data_got::add_global_tls): Removed.
2171 (Output_data_got::add_global_tls_with_rel): Removed.
2172 (Output_data_got::add_global_tls_with_rela): Removed.
2173 (Output_data_got::add_local_tls): Removed.
2174 (Output_data_got::add_local_tls_with_rel): Removed.
2175 (Output_data_got::add_local_tls_with_rela): Removed.
2176 * resolve.cc (Symbol::override_base_with_special): Removed
2177 reference to has_got_offset_ field.
2178 * symtab.cc (Symbol::init_fields): Replaced initialization
2179 of got_offset_ with got_offsets_. Removed initialization
2180 of has_got_offset_
53fcba31 2181 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
2182 (Symbol::got_offset): Likewise.
2183 (Symbol::set_got_offset): Likewise.
2184 (Symbol::has_tls_got_offset): Removed.
2185 (Symbol::tls_got_offset): Removed.
2186 (Symbol::set_tls_got_offset): Removed.
2187 (Symbol::got_offset_): Removed.
2188 (Symbol::tls_mod_got_offset_): Removed.
2189 (Symbol::tls_pair_got_offset_): Removed.
2190 (Symbol::got_offsets_): New field.
2191 (Symbol::has_got_offset): Removed.
2192 (Symbol::has_tls_mod_got_offset): Removed.
2193 (Symbol::has_tls_pair_got_offset): Removed.
2194 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
2195 (Target_x86_64::Scan::local): Updated callers of Output_data_got
2196 member functions.
2197 (Target_x86_64::Scan::global): Likewise.
2198 (Target_x86_64::Relocate::relocate): Likewise.
2199 (Target_x86_64::Relocate::relocate_tls): Likewise.
2200
bd52eafb
BE
22012008-03-25 Ben Elliston <bje@au.ibm.com>
2202
2203 * yyscript.y: Fix spelling error in comment.
2204
8b105e34
ILT
22052008-03-24 Ian Lance Taylor <iant@google.com>
2206
8ed814a9
ILT
2207 * options.h (class General_options): Define build_id option.
2208 * layout.h (class Layout): Declare write_build_id, create_note,
2209 create_build_id. Add build_id_note_ member.
2210 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
2211 "libiberty.h", "md5.h", "sha1.h".
2212 (Layout::Layout): Initialize eh_frame_data_,
2213 eh_frame_hdr_section_, and build_id_note_.
2214 (Layout::finalize): Call create_build_id.
2215 (Layout::create_note): New function, broken out of
2216 Layout::create_gold_note.
2217 (Layout::create_gold_note): Call create_note.
2218 (Layout::create_build_id): New function.
2219 (Layout::write_build_id): New function.
2220 (Close_task_runner::run): Call write_build_id.
2221
8b105e34
ILT
2222 * x86_64.cc: Correct license to GPLv3.
2223
086a1841
ILT
22242008-03-23 Ian Lance Taylor <iant@google.com>
2225
2226 * options.cc: Include "demangle.h".
2227 (parse_optional_string): New function.
2228 (parse_long_option): Handle takes_optional_argument.
2229 (parse_short_option): Update dash_z initializer. Handle
2230 takes_optional_argument.
2231 (General_options::General_options): Initialize do_demangle_.
2232 (General_options::finalize): Set do_demangle_. Handle demangling
2233 style.
2234 * options.h (parse_optional_string): Declare.
2235 (struct One_option): Add optional_arg field. Update constructor.
2236 Update call constructor calls. Add takes_optional_argument
2237 function.
2238 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
2239 (DEFINE_optional_string): Define.
2240 (General_options::demangle): Change from DEFINE_bool to
2241 DEFINE_optional_string.
2242 (General_options::no_demangle): New function.
2243 (General_options::do_demangle): New function.
2244 (General_options::set_do_demangle): New function.
2245 (General_options::execstack_status_): Move definition to end of
2246 class definition.
2247 (General_options::static_): Likewise.
2248 (General_options::do_demangle_): New field.
2249 * object.cc (big_endian>::get_symbol_location_info): Call
2250 Options::do_demangle, not Options::demangle.
2251 * symtab.cc (demangle): Likewise.
2252
cbb93e63
ILT
22532008-03-22 Ian Lance Taylor <iant@google.com>
2254
2255 * gold.h: Include <cstddef> and <sys/types.h>
2256 * options.h: Include <cstring>.
2257
ec531623
ILT
22582008-03-21 Ian Lance Taylor <iant@google.com>
2259
2260 * Added source code to GNU binutils.
2261
This page took 0.174321 seconds and 4 git commands to generate.