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