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