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