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