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