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