1 2008-07-17 Ian Lance Taylor <iant@google.com>
3 * dynobj.cc (Versions::add_def): If we give an error about a
4 missing version, go ahead and create the version anyhow.
6 2008-07-10 Ian Lance Taylor <iant@google.com>
8 Handle output sections with more than 0x7fffffff bytes.
9 * object.h (class Relobj): Change map_to_output_ to
10 output_sections_, and just keep a section pointer. Change all
11 uses. Move comdat group support to Sized_relobj.
12 (Relobj::is_section_specially_mapped): Remove.
13 (Relobj::output_section): Remove poff parameter. Change all
15 (Relobj::output_section_offset): New function.
16 (Relobj::set_section_offset): Rewrite.
17 (Relobj::map_to_output): Remove.
18 (Relobj::output_sections): New function.
19 (Relobj::do_output_section_offset): New pure virtual function.
20 (Relobj::do_set_section_offset): Likewise.
21 (class Sized_relobj): Add section_offsets_ field. Add comdat
22 group support from Relobj. Update declarations.
23 (Sized_relobj::get_output_section_offset): New function.
24 (Sized_relobj::do_output_section_offset): New function.
25 (Sized_relobj::do_set_section_offset): New function.
26 * object.cc (Relobj::output_section_address): Remove.
27 (Sized_relobj::Sized_relobj): Initialize new fields.
28 (Sized_relobj::include_section_group): Cast find_kept_object to
30 (Sized_relobj::include_linkonce_section): Likewise.
31 (Sized_relobj::do_layout): Use separate arrays for output section
33 (Sized_relobj::do_count_local_symbols): Change map_to_output to
35 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
36 output_sections and section_offsets.
37 (Sized_relobj::write_local_symbols): Likewise.
38 (map_to_kept_section): Compute output address directly.
39 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
40 output_sections and section_offsets.
41 (Sized_relobj::write_sections): Likewise.
42 (Sized_relobj::relocate_sections): Likewise.
43 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
44 * output.h (class Output_reloc): Update declarations. Change
45 u2_.relobj to Sized_relobj*.
46 (class Output_data_reloc): Change add functions to use
48 * output.cc (Output_reloc::Output_reloc): Change relobj to
50 (Output_reloc::local_section_offset): Change return type to
51 Elf_Addr. Use get_output_section_offset.
52 (Output_reloc::get_address): Likewise.
53 (Output_section::is_input_address_mapped): Don't call
54 is_section_specially_mapped.
55 (Output_section::output_offset): Likewise.
56 (Output_section::output_address): Likewise.
57 (Output_section::starting_output_address): Likewise.
58 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
59 parameter to Sized_relobj*.
60 (Copy_relocs::need_copy_reloc): Likewise.
61 (Copy_relocs::save): Likewise.
62 * copy-relocs.h (class Copy_relocs): Update declarations.
63 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
64 Sized_relobj*. Change relobj_ field to Sized_relobj*.
65 * target-reloc.h (relocate_for_relocatable): Change
66 offset_in_output_section type to Elf_Addr. Change code that uses
68 * layout.cc (Layout::layout): Always set *off.
69 * mapfile.cc (Mapfile::print_input_section): Use
70 output_section_offset.
71 * i386.cc (Target_i386::copy_reloc): Change object parameter to
73 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
74 * sparc.cc (Target_sparc::copy_reloc): Likewise.
75 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
77 2008-07-03 Ian Lance Taylor <iant@google.com>
79 * layout.cc (Layout::include_section): Do not discard unrecognized
82 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
84 * script.cc (Lex::can_continue_name): Make '?' allowable in
86 * testsuite/version_script.map: Change glob pattern to use '?'
88 2008-06-30 Manish Singh <yosh@gimp.org>
91 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
94 2008-06-30 Ian Lance Taylor <iant@google.com>
98 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
99 versions]: Don't try to read the value in the contents, since we
100 don't use it. Use the template endianness when writing.
102 2008-06-25 Cary Coutant <ccoutant@google.com>
104 * fileread.cc (File_read::make_view): Assert on zero-length view.
105 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
106 symbol table when there are no symbols to read.
108 2008-06-23 Craig Silverstein <csilvers@google.com>
110 * version.cc (version_string): Bump to 1.7
112 2008-06-18 Craig Silverstein <csilvers@google.com>
114 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
115 constant 0xFFFF to type Valtype.
116 (Powerpc_relocate_functions::rel16_ha): Likewise.
118 2008-06-17 Ian Lance Taylor <iant@google.com>
120 * output.h (Output_section::Input_section): Initialize p2align_ to
121 zero for Output_section_data constructors.
122 (Output_section::Input_section::addralign): If not an input
123 section, return the alignment of the Output_section_data.
124 * testsuite/copy_test.cc: New file.
125 * testsuite/copy_test_1.cc: New file.
126 * testsuite/copy_test_2.cc: New file.
127 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
128 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
129 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
130 (copy_test_1_pic.o, copy_test_1.so): New targets.
131 (copy_test_2_pic.o, copy_test_2.so): New targets.
132 * testsuite/Makefile.in: Rebuild.
134 * script-sections.cc (Script_sections::place_orphan): Initialize
135 local variable exact.
137 2008-06-13 David Edelsohn <edelsohn@gnu.org>
139 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
141 2008-06-12 David Edelsohn <edelsohn@gnu.org>
142 David S. Miller <davem@davemloft.net>
144 * powerpc.cc: New file.
145 * Makefile.am (TARGETSOURCES): Add powerpc.cc
146 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
147 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
148 * Makefile.in: Rebuild.
150 2008-06-09 Ian Lance Taylor <iant@google.com>
152 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
154 (throwing, orig_terminate): New static variables.
155 (terminate_handler): New static function.
156 (t2): Set terminate handler.
158 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
161 * binary.cc (Binary_to_elf::sized_convert): Fix .data
164 2008-05-30 Cary Coutant <ccoutant@google.com>
166 * archive.cc (Archive::include_all_members) Correct to step
167 over symbol table and extended name table in thin archives.
169 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
172 * target-reloc.h (relocate_for_relocatable): Fix new_offset
175 2008-05-28 Caleb Howe <cshowe@google.com>
177 * reduced_debug_output.cc: New file.
178 * reduced_debug_output.h: New file.
179 * options.h (class General_optoins): Add --strip-debug-non-line.
180 * options.cc (General_options::finalize): Add strip_debug_non_line
181 to the strip heirarchy.
182 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
184 * layout.cc: Include "reduced_debug_output.h".
185 (Layout::Layout): Initialize new fields.
186 (line_only_debug_sections): New static array.
187 (is_lines_only_debug_sections): New static inline function.
188 (Layout::include_section): Handle --strip-debug-non-line.
189 (Layout::make_output_section): If --strip-debug-non-line, build
190 new output sections for .debug_abbrev and .debug_info.
191 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
192 gold. Warn about possible overflow.
193 (read_signed_LEB_128): Likewise.
194 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
195 (read_signed_LEB_128): Declare.
196 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
197 (HFILES): Add reduced_debug_output.h.
198 * Makefile.in: Rebuild.
200 2008-05-21 Ian Lance Taylor <iant@google.com>
202 * mapfile.cc: New file.
203 * mapfile.h: New file.
204 * options.h (class General_options): Add -M/--print-map and -Map.
205 * options.cc (General_options::finalize): Make -M equivalent to
207 * main.cc: Include <cstdio> and "mapfile.h".
208 (main): Open mapfile if requested.
209 * gold.cc (class Middle_runner): Add mapfile_ field. Update
210 constructor. Change caller.
211 (queue_initial_tasks): Add mapfile parameter. Change caller.
212 (queue_middle_tasks): Likewise.
213 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
215 * archive.cc: Include "mapfile.h".
216 (Archive::add_symbols): Add mapfile parameter. Change all
217 callers. Pass mapfile, symbol, and reason to include_member.
218 (Archive::include_all_members): Add mapfile parameter. Change all
220 (Archive::include_member): Add mapfile, sym, and why parameters.
221 Change all callers. Report inclusion to map file.
222 * archive.h: Include "fileread.h".
223 (class Archive): Update declarations.
224 (Archive::file): New const method.
225 (class Add_archive_symbols): Add mapfile_ field. Update
226 constructor. Change all callers.
227 * readsyms.h (class Read_symbols): Likewise.
228 (class Finish_group): Likewise.
229 (class Read_script): Likewise.
230 * common.cc: Include "mapfile.h".
231 (Symbol_table::allocate_commons): Add mapfile parameter. Change
233 (Symbol_table::do_allocate_commons): Likewise.
234 (Symbol_table::do_allocate_commons_list): Likewise. Report common
235 symbol allocation to mapfile.
236 * common.h (class Allocate_commons_task): Add mapfile_ field.
237 Update constructor. Change all callers.
238 * symtab.h (class Symbol_table): Update declarations.
239 * layout.cc: Include "mapfile.h".
240 (Layout_task_runner::run): Print information to mapfile.
241 (Layout::create_gold_note): Change Output_data_fixed_space to
242 Output_data_zero_fill.
243 (Layout::create_build_id): Likewise.
244 (Layout::print_to_mapfile): New function.
245 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
246 constructor. Change caller.
247 (class Layout): Declare print_to_mapfile.
248 * output.cc (Output_section::Input_section::print_to_mapfile): New
250 (Output_section::add_input_section): If producing a map, always
251 add to input_sections_ list.
252 (Output_section::do_print_to_mapfile): New function.
253 (Output_segment::print_sections_to_mapfile): New function.
254 (Output_segment::print_section_list_to_mapfile): New function.
255 * output.h: Include "mapfile.h".
256 (Output_data::print_to_mapfile): New function.
257 (Output_data::do_print_to_mapfile): New virtual function.
258 (Output_segment_headers::do_print_to_mapfile): New function.
259 (Output_file_header::do_print_to_mapfile): New function.
260 (Output_data_const::do_print_to_mapfile): New function.
261 (class Output_data_const_buffer): Add map_name_ field. Update
262 constructor. Change all callers. Add do_print_to_mapfile
264 (class Output_data_fixed_space): Likewise.
265 (class Output_data_space): Likewise.
266 (class Output_data_zero_fill): New class.
267 (Output_data_strtab::do_print_to_mapfile): New function.
268 (Output_data_reloc_base::do_print_to_mapfile): New function.
269 (Output_relocatable_relocs::do_print_to_mapfile): New function.
270 (Output_data_group::do_print_to_mapfile): New function.
271 (Output_data_got::do_print_to_mapfile): New function.
272 (Output_data_dynamic::do_print_to_mapfile): New function.
273 (Output_symtab_xindex::do_print_to_mapfile): New function.
274 (class Output_section): Declare do_print_to_mapflie. Declare
275 print_to_mapfile in Input_section.
276 (class Output_segment): Declare new functions.
277 * object.h (Sized_relobj::symbol_count): New function.
279 (Output_section_element_dot_assignment::set_section_addresses):
280 Change Output_data_fixed_space to Output_data_zero_fill.
281 (Output_data_expression::do_print_to_mapfile): New function.
282 * script.cc (read_input_script): Add mapfile parameter. Change
284 * script.h (read_input_script): Update declaration.
285 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
286 (Eh_frame::do_print_to_mapfile): New function.
287 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
288 (Output_merge_string::do_print_to_mapfile): New function.
289 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
291 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
293 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
295 * Makefile.am (CCFILES): Add mapfile.cc.
296 (HFILES): Add mapfile.h.
297 * Makefile.in: Rebuild.
299 2008-05-19 Ian Lance Taylor <iant@google.com>
301 * options.h (class General_options): Add -z relro.
302 * layout.cc (Layout::Layout): Initialize relro_segment_.
303 (Layout::add_output_section_data): Return the output section.
304 (Layout::make_output_section): Rcognize relro sections and mark
306 (Layout::attach_allocated_section_to_segment): Put relro sections
307 in a PT_GNU_RELRO segment.
308 (Layout::create_initial_dynamic_sections): Mark the .dynamic
310 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
312 (Layout::linkonce_mapping): Map d.rel.ro.local to
314 (Layout::output_section_name): Us .data.rel.ro.local for any
315 section which begins with that.
316 * layout.h (class Layout): Update add_output_section_data
317 declaration. Add relro_segment_ field.
318 * output.cc (Output_section::Output_section): Initialize is_relro_
319 and is_relro_local_ fields.
320 (Output_segment::add_output_section): Group relro sections.
321 (Output_segment::is_first_section_relro): New function.
322 (Output_segment::maximum_alignment): If there is a relro section,
323 align the segment to the common page size.
324 (Output_segment::set_section_addresses): Track whether we are
325 looking at relro sections. If the last section is a relro
326 section, align to the common page size.
327 (Output_segment::set_section_list_addresses): Add in_relro
328 parameter. Change all callers. Align to the page size when
329 moving from relro to non-relro section.
330 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
332 * output.h (class Output_section): Add is_relro_ and
333 is_relro_local_ fields.
334 (Output_section::is_relro): New function.
335 (Output_section::set_is_relro): New function.
336 (Output_section::is_relro_local): New function.
337 (Output_section::set_is_relro_local): New function.
338 (class Output_segment): Update declarations.
339 * i386.cc (Target_i386::got_section): Mark .got section as relro.
340 * sparc.cc (Target_sparc::got_section): Likewise.
341 * x86_64.cc (Target_x86_64::got_section): Likewise.
342 * testsuite/relro_test_main.cc: New file.
343 * testsuite/relro_test.cc: New file.
344 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
345 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
346 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
347 (relro_test.so, relro_test_pic.o): New targets.
348 * testsuite/Makefile.in: Rebuild.
350 2008-05-16 Ian Lance Taylor <iant@google.com>
352 * output.cc (Output_segment::add_output_section): Remove front
354 * output.h (class Output_segment): Remove
355 add_initial_output_section and overloaded add_output_section.
356 Update declaration of remaining add_output_section.
357 * layout.cc (Layout::create_interp): Call add_output_section
358 rather than add_initial_output_section.
359 (Layout::finish_dynamic_section): Likewise.
361 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
362 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
363 know the dynamic type.
364 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
365 field. Initialize it in constructor.
366 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
367 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
368 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
371 * output.cc (Output_reloc::get_address): Change return type to
373 * output.h (class Output_reloc): Update get_address declaration.
374 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
375 for section addresses.
377 2008-05-09 Ian Lance Taylor <iant@google.com>
380 * gold.cc (gold_nomem): Use return value of write.
382 2008-05-08 Ian Lance Taylor <iant@google.com>
384 * symtab.c (Symbol::init_base_output_data): Add version
385 parameter. Change all callers.
386 (Symbol::init_base_output_segment): Likewise.
387 (Symbol::init_base_constant): Likewise.
388 (Symbol::init_base_undefined): Likewise.
389 (Sized_symbol::init_output_data): Likewise.
390 (Sized_symbol::init_output_segment): Likewise.
391 (Sized_symbol::init_constant): Likewise.
392 (Sized_symbol::init_undefined): Likewise.
393 (Symbol_table::do_define_in_output_data): If the new symbol has a
394 version, mark it as the default.
395 (Symbol_table::do_define_in_output_segment): Likewise.
396 (Symbol_table::do_define_as_constant): Likewise.
397 * symtab.h (class Symbol): Update declarations.
398 (class Sized_symbol): Likewise.
399 * resolve.cc (Symbol::override_version): New function.
400 (Symbol::override_base): Call override_version.
401 (Symbol::override_base_with_special): Likewise.
402 * testsuite/ver_script_8.script: New file.
403 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
404 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
405 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
406 (ver_test_8_1.so, ver_test_8_2.so): New targets.
408 2008-05-06 Ian Lance Taylor <iant@google.com>
411 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
413 (class General_options): Remove existing --undefined, and add
414 --no-undefined instead. Add new --undefined as synonym for -u.
415 * archive.cc (Archive::add_symbols): Check whether symbol was
417 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
418 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
419 all uses. Add IS_UNDEFINED. Update declarations to split
420 different versions of init_base. Declare init_base_undefined.
421 (Symbol::is_defined): Handle IS_UNDEFINED.
422 (Symbol::is_undefined): Likewise.
423 (Symbol::is_weak_undefined): Call is_undefined.
424 (Symbol::is_absolute): Handle IS_CONSTANT.
425 (class Sized_symbol): Update declarations to split different
426 versions of init. Declare init_undefined.
427 (class Symbol_table): Declare new functions.
428 * symtab.cc (Symbol::init_base_object): Rename from init_base.
430 (Symbol::init_base_output_data): Likewise.
431 (Symbol::init_base_output_segment): Likewise.
432 (Symbol::init_base_constant): Likewise.
433 (Symbol::init_base_undefined): New function.
434 (Sized_symbol::init_object): Rename from init. Change all
436 (Sized_symbol::init_output_data): Likewise.
437 (Sized_symbol::init_output_segment): Likewise.
438 (Sized_symbol::init_constant): Likewise.
439 (Sized_symbol::init_undefined): New function.
440 (Symbol_table::add_undefined_symbols_from_command_line): New
442 (Symbol_table::do_add_undefined_symbols_from_command_line): New
444 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
445 (Symbol::output_section): Likewise.
446 (Symbol::set_output_section): Likewise.
447 (Symbol_table::sized_finalize_symbol): Likewise.
448 (Symbol_table::sized_write_globals): Likewise.
449 * resolve.cc (Symbol_table::should_override): Likewise.
450 (Symbol::override_base_with_special): Likewise.
452 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
453 symbol, change it to have default visibility.
454 * testsuite/protected_1.cc: New file.
455 * testsuite/protected_2.cc: New file.
456 * testsuite/protected_3.cc: New file.
457 * testsuite/protected_main_1.cc: New file.
458 * testsuite/protected_main_2.cc: New file.
459 * testsuite/protected_main_3.cc: New file.
460 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
461 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
462 (protected_1_LDFLAGS, protected_1_LDADD): Define.
463 (protected_1.so): New target.
464 (protected_1_pic.o, protected_2_pic.o): New targets.
465 (protected_3_pic.o): New target.
466 (check_PROGRAMS): Add protected_2.
467 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
468 (protected_2_LDFLAGS, protected_2_LDADD): Define.
469 * testsuite/Makefile.in: Rebuild.
471 * options.h (DEFINE_var): Add set_user_set_##varname__.
472 (DEFINE_bool_alias): New macro.
473 (class General_options): Define -Bstatic using DEFINE_bool_alias
474 rather than DEFINE_special. Add --undefined as an alias for -z
476 * options.cc (General_options::parse_Bstatic): Remove.
478 * options.h (class General_options): Add --fatal-warnings.
479 * main.cc (main): Implement --fatal-warnings.
480 * errors.h (Errors::warning_count): New function.
482 * options.h (class General_options): Add -Bsymbolic-functions.
483 * symtab.h (Symbol::is_preemptible): Check for
484 -Bsymbolic-functions.
486 2008-05-05 Ian Lance Taylor <iant@google.com>
488 * options.h (DEFINE_bool): For DASH_Z, create the negative option
489 as noVARNAME rather than no-VARNAME.
490 (class General_options): Add option -z combreloc.
491 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
493 (Output_reloc::sort_before) [SHT_REL]: New function.
494 (Output_reloc::sort_before) [SHT_RELA]: New function.
495 (class Output_data_reloc_base): Add sort_relocs_ field. Define
496 Sort_relocs_comparison.
497 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
498 parameter. Change all callers.
499 (Output_data_reloc::Output_data_reloc) [both versions]: Add
500 sort_relocs parameter. Change all callers.
501 * output.cc (Output_reloc::get_address): New function, broken out
503 (Output_reloc::write_rel): Call it.
504 (Output_reloc::compare): New function.
505 (Output_data_reloc_base::do_write): Optionally sort relocs.
507 * configure.ac: If targ_extra_obj is set, link it in.
508 * configure.tgt: Initialize all variables.
509 (x86_64*): Set targ_extra_obj and targ_extra_size.
510 * configure: Rebuild.
512 * object.cc (Sized_relobj::include_section_group): Adjust section
513 indexes read from group data. Build vector to pass to
515 * layout.cc (Layout::layout_group): Add flags and shndxes
516 parameters. Remove contents parameter. Change caller. Update
517 explicit instantiations.
518 * layout.h (class Layout): Update layout_group declaration.
519 * output.cc (Output_data_group::Output_data_group): Add flags and
520 input_shndxes parameters. Remove contents parameter. Change
522 (Output_data_group::do_write): Change input_sections_ to
524 * output.h (class Output_data_group): Update constructor
525 declaration. Rename input_sections_ to input_shndxes_.
526 * testsuite/many_sections_test.cc: Add template.
528 2008-04-30 Cary Coutant <ccoutant@google.com>
530 * target-reloc.h (relocate_section): Fix dead-pointer bug.
532 * layout.cc (Layout::include_section): Refactored check for debug
534 (Layout::add_comdat): Add new parameters. Change type
535 of signature parameter. Add object and shndx to signatures table.
536 (Layout::find_kept_object): New function.
537 * layout.h: Include <cstring>.
538 (Layout::is_debug_info_section): New function.
539 (Layout::add_comdat): Add new parameters.
540 (Layout::find_kept_object): New function.
541 (Layout::Kept_section): New struct.
542 (Layout::Signatures): Change type of map range.
543 * object.cc (Relobj::output_section_address): New function.
544 (Sized_relobj::include_section_group): Add new parameters. Change
545 calls to Layout::add_comdat. Change to build table of kept comdat
546 groups and table mapping discarded sections to kept sections.
547 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
548 (Sized_relobj::do_layout): Change calls to include_section_group and
549 include_linkonce_section.
550 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
551 value to zero when section is discarded.
552 (Sized_relobj::map_to_kept_section): New function.
553 * object.h (Relobj::output_section_address): New function.
554 (Relobj::Comdat_group): New type.
555 (Relobj::find_comdat_group): New function.
556 (Relobj::Comdat_group_table): New type.
557 (Relobj::Kept_comdat_section): New type.
558 (Relobj::Kept_comdat_section_table): New type.
559 (Relobj::add_comdat_group): New function.
560 (Relobj::set_kept_comdat_section): New function.
561 (Relobj::get_kept_comdat_section): New function.
562 (Relobj::comdat_groups_): New field.
563 (Relobj::kept_comdat_sections_): New field.
564 (Symbol_value::input_value): Update comment.
565 (Sized_relobj::map_to_kept_section) New function.
566 (Sized_relobj::include_linkonce_section): Add new parameter.
567 * target-reloc.h (Comdat_behavior): New type.
568 (get_comdat_behavior): New function.
569 (relocate_section): Add code to map a discarded section to the
570 corresponding kept section when applying a relocation.
572 2008-04-30 Craig Silverstein <csilvers@google.com>
574 * dwarf_reader.cc (next_generation_count): New static var.
575 (Addr2line_cache_entry): New struct.
576 (addr2line_cache): New static var.
577 (Dwarf_line_info::one_addr2line): Added caching.
578 (Dwarf_line_info::clear_addr2line_cache): New function.
579 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
580 cache-size parameter.
581 (Dwarf_line_info::one_addr2line_cache): New function.
582 * symtab.cc (Symbol_table::detect_odr_violations): Pass
583 new cache-size argument to one_addr2line(), and clear cache.
585 2008-04-28 Cary Coutant <ccoutant@google.com>
587 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
588 R_386_PC8 relocations.
590 2008-04-23 Ian Lance Taylor <iant@google.com>
592 * object.cc (Sized_relobj::include_section_group): Check for
593 invalid section group.
595 * object.cc (make_elf_object): Correct test for 64-bit ELF file
598 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
599 than read for file header.
600 * archive.cc (Archive::include_member): Likewise.
602 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
604 * aclocal.m4: Regenerate.
605 * configure: Regenerate.
607 2008-04-19 Ian Lance Taylor <iant@google.com>
609 * version.cc (version_string): Bump to 1.6.
611 * testsuite/Makefile.am (many_sections_r_test): New target.
612 (many_sections_r_test_SOURCES): Remove.
613 (many_sections_r_test_DEPENDENCIES): Remove.
614 (many_sections_r_test_LDFLAGS): Remove.
615 (many_sections_r_test_LDADD): Remove.
617 * object.cc (Sized_relobj::do_add_symbols): Always pass
618 local_symbol_count_ to add_from_relobj.
620 * testsuite/Makefile.am (many_sections_check.h): Only check one in
621 every thousand variables.
622 * testsuite/Makefile.in: Rebuild.
624 * object.cc (Xindex::initialize_symtab_xindex): New function.
625 (Xindex::read_symtab_xindex): New function.
626 (Xindex::sym_xindex_to_shndx): New function.
627 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
629 (Sized_relobj::do_initialize_xindex): New function.
630 (Sized_relobj::do_read_symbols): Adjust section links.
631 (Sized_relobj::symbol_section_and_value): Add is_ordinary
632 parameter. Change all callers.
633 (Sized_relobj::include_section_group): Adjust section links and
634 symbol section indexes.
635 (Sized_relobj::do_layout): Adjust section links.
636 (Sized_relobj::do_count_local_symbols): Adjust section links and
637 symbol section indexes.
638 (Sized_relobj::do_finalize_local_symbols): Distinguish between
639 ordinary and special symbols.
640 (Sized_relobj::write_local_symbols): Add symtab_xindex and
641 dynsym_xindex parameters. Change all callers. Adjust section
642 links. Use SHN_XINDEX when needed.
643 (Sized_relobj::get_symbol_location_info): Adjust section links.
644 Don't get fooled by special symbols.
645 * object.h (class Xindex): Define.
646 (class Object): Add xindex_ parameter. Declare virtual functoin
647 do_initialize_xindex.
648 (Object::adjust_sym_shndx): New function.
649 (Object::set_xindex): New protected function.
650 (class Symbol_value): Add is_ordinary_shndx_ field.
651 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
652 (Symbol_value::value): Assert ordinary section.
653 (Symbol_value::initialize_input_to_output_map): Likewise.
654 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
656 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
658 (class Sized_relobj): Update declarations.
659 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
660 parameter. Change all callers.
661 (Sized_relobj::adjust_shndx): New function.
662 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
664 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
665 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
666 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
667 (Sized_dynobj::read_dynsym_section): Adjust section links.
668 (Sized_dynobj::read_dynamic): Likewise.
669 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
671 (Sized_dynobj::do_initialize_xindex): New function.
672 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
673 do_initialize_xindex.
674 (Sized_dynobj::adjust_shndx): New function.
675 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
676 dynsym_xindex_ fields.
677 (Layout::finalize): Add a call to set_section_indexes before
678 creating the symtab sections.
679 (Layout::set_section_indexes): Don't do anything if the section
680 already has a section index.
681 (Layout::create_symtab_sections): Add shnum parameter. Change
682 caller. Create .symtab_shndx section if needed.
683 (Layout::create_shdrs): Add shstrtab_section parameter. Change
685 (Layout::allocated_output_section_count): New function.
686 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
688 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
689 fields. Update declarations.
690 (Layout::symtab_xindex): New function.
691 (Layout::dynsym_xindex): New function.
692 (class Write_symbols_task): Add layout_ field.
693 (Write_symbols_task::Write_symbols_task): Add layout parameter.
695 * output.cc (Output_section_headers::Output_section_headers): Add
696 shstrtab_section parameter. Change all callers.
697 (Output_section_headers::do_sized_write): Store overflow values
698 for section count and section string table section index in
700 (Output_file_header::do_sized_write): Check for overflow of
701 section count and section string table section index.
702 (Output_symtab_xindex::do_write): New function.
703 (Output_symtab_xindex::endian_do_write): New function.
704 * output.h (class Output_section_headers): Add shstrtab_section_.
706 (class Output_symtab_xindex): Define.
707 (Output_section::has_out_shndx): New function.
708 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
710 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
712 (Sized_symbol::init): Likewise.
713 (Symbol::output_section): Check for ordinary symbol.
714 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
715 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
717 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
718 Change all callers. Simplify handling of symbols from sections
719 not included in the link.
720 (Symbol_table::add_from_dynobj): Handle ordinary symbol
722 (Weak_alias_sorter::operator()): Assert that symbols are
724 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
726 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
727 parameters. Change all callers.
728 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
729 symbol distinction. Use SHN_XINDEX when needed.
730 (Symbol_table::write_section_symbol): Add symtab_xindex
731 parameter. Change all callers.
732 (Symbol_table::sized_write_section_symbol): Likewise. Use
733 SHN_XINDEX when needed.
734 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
736 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
737 (Symbol::is_defined): Check is_ordinary.
738 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
739 (Symbol::is_absolute, Symbol::is_common): Likewise.
740 (class Sized_symbol): Update declarations.
741 (class Symbol_table): Update declarations.
742 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
743 parameters. Change all callers.
744 (Sized_symbol::override): Likewise.
745 (Symbol_table::override): Likewise.
746 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
747 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
748 is_ordinary, and orig_st_shndx parameters. Change all callers.
749 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
750 to be in an ordinary section.
751 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
752 object and is_ordinary parameters. Change all callers.
753 (Sized_dwarf_line_info::read_relocs): Add object parameter.
754 Change all callers. Don't add undefined or non-ordinary symbols
756 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
758 * dwarf_reader.h (class Sized_dwarf_line_info): Update
760 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
761 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
762 (Sized_relobj::relocate_sections): Likewise.
763 * target-reloc.h (scan_relocs): Adjust section symbol index.
764 (scan_relocatable_relocs): Likewise.
765 * i386.cc (Scan::local): Check for ordinary symbols.
766 * sparc.cc (Scan::local): Likewise.
767 * x86_64.cc (Scan::local): Likewise.
768 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
769 to symbol_section_and_value.
770 * testsuite/many_sections_test.cc: New file.
771 * testsuite/Makefile.am (BUILT_SOURCES): Define.
772 (check_PROGRAMS): Add many_sections_test.
773 (many_sections_test_SOURCES): Define.
774 (many_sections_test_DEPENDENCIES): Define.
775 (many_sections_test_LDFLAGS): Define.
776 (BUILT_SOURCES): Add many_sections_define.h.
777 (many_sections_define.h): New target.
778 (BUILT_SOURCES): Add many_sections_check.h.
779 (many_sections_check.h): New target.
780 (check_PROGRAMS): Add many_sections_r_test.
781 (many_sections_r_test_SOURCES): Define.
782 (many_sections_r_test_DEPENDENCIES): Define.
783 (many_sections_r_test_LDFLAGS): Define.
784 (many_sections_r_test_LDADD): Define.
785 (many_sections_r_test.o): New target.
786 * testsuite/Makefile.in: Rebuild.
788 2008-04-17 Cary Coutant <ccoutant@google.com>
790 * errors.cc (Errors::info): New function.
791 (gold_info): New function.
792 * errors.h (Errors::info): New function.
793 * gold.h (gold_info): New function.
794 * object.cc (Input_objects::add_object): Print trace output.
795 * options.cc (options::parse_set): New function.
796 (General_options::parse_wrap): Deleted.
797 (General_options::General_options): Deleted initializer.
798 * options.h (options::String_set): New typedef.
799 (options::parse_set): New function.
800 (DEFINE_set): New macro.
801 (General_options::wrap): Changed to use DEFINE_set. Changed
802 callers of any_wrap_symbols and is_wrap_symbol.
803 (General_options::trace, General_options::trace_symbol):
805 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
806 (General_options::wrap_symbols_): Deleted.
807 * symtab.cc (Symbol_table::add_from_object): Print trace output.
809 2008-04-17 David S. Miller <davem@davemloft.net>
811 * options.cc (General_options::parse_V): New function.
812 * options.h: Add entries for -V and -Qy.
814 2008-04-17 Ian Lance Taylor <iant@google.com>
816 * common.cc (Symbol_table::allocate_commons): Remove options
817 parameter. Change caller.
818 (Symbol_table::do_allocate_commons): Remove options parameter.
819 Change caller. Just call do_allocate_commons_list twice.
820 (Symbol_table::do_allocate_commons_list): New function, broken out
821 of do_allocate_commons.
822 * common.h (class Allocate_commons_task): Remove options_ field.
824 * symtab.cc (Symbol_table::Symbol_table): Initialize
826 (Symbol_table::add_from_object): Put TLS common symbols on
828 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
829 which are IN_OUTPUT_DATA.
830 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
831 allocate_commons and do_allocate_commons declarations. Declare
832 do_allocate_commons_list.
833 * gold.cc (queue_middle_tasks): Update creation of
834 Allocate_commons_task to not pass options.
835 * testsuite/Makefile.am (INCLUDES): Add -I.. .
836 (TLS_TEST_C_FLAGS): New variable.
837 (tls_test_c_pic.o): New target.
838 (tls_test_shared.so): Link in tls_test_c_pic.o.
839 (tls_test_c_pic_ie.o): New target.
840 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
841 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
842 (tls_test_c.o): New target.
843 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
844 (tls_pic_test_LDADD): Likewise.
845 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
846 (tls_shared_gd_to_ie_test_LDADD): Likewise.
847 (tls_test_c_gnu2.o): New target.
848 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
850 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
851 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
852 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
853 * testsuite/tls_test.cc: Include "config.h".
854 (t_last): Call t11_last.
855 * testsuite/tls_test.h (t11, t11_last): Declare.
856 * testsuite/tls_test_c.c: New file.
857 * testsuite/tls_test_main.cc (thread_routine): Call t11.
858 * configure.ac: Check for OpenMP support.
859 * configure, config.in, Makefile.in: Rebuild.
860 * testsuite/Makefile.in: Rebuild.
862 2008-04-16 Cary Coutant <ccoutant@google.com>
864 * i386.cc (Target_i386::define_tls_base_symbol): New function.
865 (Target_i386::tls_base_symbol_defined_): New field.
866 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
867 (Target_i386::Scan::global): Likewise.
868 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
869 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
870 (Target_x86_64::tls_base_symbol_defined_): New field.
871 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
872 (Target_x86_64::Scan::global): Likewise.
874 2008-04-16 Cary Coutant <ccoutant@google.com>
876 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
877 (Symbol::needs_plt_entry): Allow weak undefined symbols.
878 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
879 building shared libraries.
880 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
881 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
882 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
883 * testsuite/Makefile.in: Rebuild.
884 * testsuite/weak_undef.h: New file.
885 * testsuite/weak_undef_file1.cc: Add extra test cases.
886 * testsuite/weak_undef_file2.cc: Likewise.
887 * testsuite/weak_undef_test.cc: Likewise.
889 2008-04-16 David S. Miller <davem@davemloft.net>
891 * sparc.cc (Target_sparc::Scan): Change from struct to class.
892 Add issued_non_pic_error_ field. Declare check_non_pic.
893 (Target_sparc::Scan::check_non_pic): New function.
894 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
895 (Target_sparc::Scan::global): Likewise.
897 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
898 * configure: Rebuild.
900 * options.h (DEFINE_enable): New macro.
901 (new_dtags): New enable option.
902 (initfirst, interpose, loadfltr, nodefaultlib,
903 nodelete, nodlopen, nodump): New -z options.
904 * layout.cc (Layout:finish_dynamic_section): If new
905 dtags enabled, emit DT_RUNPATH. Also, emit a
906 DT_FLAGS_1 containing any specified -z flags.
908 2008-04-16 Ian Lance Taylor <iant@google.com>
910 * copy-relocs.cc: New file.
911 * copy-relocs.h: New file.
912 * reloc.cc: Remove Copy_relocs code.
914 * reloc-types.h (struct Reloc_types) [both versions]: Add
915 get_reloc_addend_noerror.
916 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
917 variants of add_global which take an addend which must be zero.
918 * i386.cc: Include "copy-relocs.h".
919 (class Target_i386): Change type of copy_relocs_ to variable,
921 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
923 (Target_i386::do_finalize_sections): Change handling of
925 * sparc.cc: Include "copy-relocs.h".
926 (class Target_sparc): Change type of copy_relocs_ to variable,
928 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
930 (Target_sparc::do_finalize_sections): Change handling of
932 * x86_64.cc: Include "copy-relocs.h".
933 (class Target_x86_64): Change type of copy_relocs_ to variable,
935 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
936 class. Change all callers.
937 (Target_x86_64::do_finalize_sections): Change handling of
939 * Makefile.am (CCFILES): Add copy-relocs.cc.
940 (HFILES): Add copy-relocs.h.
942 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
944 * testsuite/script_test_4.sh: Permit leading zeroes.
946 2008-04-15 Ian Lance Taylor <iant@google.com>
948 * script-sections.cc (Script_sections::create_segments): Use
949 header_size_adjustment even when there is enough room for the
951 * testsuite/script_test_4.sh: New file.
952 * testsuite/script_test_4.t: New file.
953 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
954 (check_DATA): Add script_test_4.stdout.
955 (MOSTLYCLEANFILES): Likewise.
956 (script_test_4): New target.
957 (script_test_4.stdout): New target.
958 * testsuite/Makefile.in: Rebuild.
960 * sparc.cc: Add definitions for Output_data_plt_sparc class
963 2008-04-14 David S. Miller <davem@davemloft.net>
965 * sparc.cc: New file.
966 * Makefile.am (TARGETSOURCES): Add sparc.cc
967 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
968 * configure.tgt: Document targ_extra_size and
969 targ_extra_big_endian. Add entries for sparc-* and
971 * configure.ac: Handle targ_extra_size and
972 targ_extra_big_endian.
973 * Makefile.in: Rebuild.
974 * configure: Likewise.
975 * po/POTFILES.in: Likewise.
976 * po/gold.pot: Likewise.
978 2008-04-14 Ian Lance Taylor <iant@google.com>
980 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
981 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
982 in the name/type/flags to section mapping. Don't call
983 allocate_output_section.
984 (Layout::choose_output_section): Change parameter from adjust_name
985 to is_input_section. Don't permit input sections after sections
986 are attached to segments. Don't call allocate_output_section.
987 (Layout::layout_eh_frame): Call update_flags_for_input_section,
988 not write_enable_output_section.
989 (Layout::make_output_section): Don't push to
990 unattached_section_list_ nor call attach_to_segment. Call
991 attach_section_to_segment if sections are attached.
992 (Layout::attach_sections_to_segments): New function.
993 (Layout::attach_section_to_segment): New function.
994 (Layout::attach_allocated_section_to_segment): Rename from
995 attach_to_segment. Remove flags parameter.
996 (Layout::allocate_output_section): Remove function.
997 (Layout::write_enable_output_section): Remove function.
998 * layout.h (class Layout): Update for above changes. Add new
999 field sections_are_attached_.
1000 * output.h (Output_section::update_flags_for_input_section): New
1002 * output.cc (Output_section::add_input_section): Call
1003 update_flags_for_input_section.
1004 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
1006 2008-04-11 Cary Coutant <ccoutant@google.com>
1008 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
1009 thought unnecessary.
1010 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
1012 2008-04-11 Ian Lance Taylor <iant@google.com>
1014 * output.h (class Output_section_data): Remove inline definition
1016 * output.cc (Output_section_data::set_addralign): New function.
1018 2008-04-11 Cary Coutant <ccoutant@google.com>
1020 Add support for TLS descriptors for i386 and x86_64.
1021 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
1022 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
1023 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
1025 (Target_i386::got_mod_index_entry): Remove unnecessary code.
1026 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
1027 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
1029 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
1030 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
1031 Fix problem with initial-exec relocations.
1032 (Target_i386::Relocate::relocate_tls): Likewise.
1033 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
1035 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
1036 support for section-plus-offset dynamic table entries.
1037 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
1038 (Output_data_dynamic::Dynamic_entry): Add support for
1039 section-plus-offset dynamic table entries.
1040 (Output_data_dynamic::Classification): Likewise.
1041 (Output_data_dynamic::classification_): Renamed offset_.
1042 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
1043 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
1044 (Target_x86_64::make_plt_section): New function.
1045 (Target_x86_64::reserve_tlsdesc_entries): New function.
1046 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
1047 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
1048 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
1049 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
1050 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
1051 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
1052 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
1053 add extra PLT entry for TLS descriptors.
1054 (Output_data_plt_x86_64::got_): New field.
1055 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
1056 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
1058 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
1060 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
1061 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
1062 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
1063 R_386_TLS_DESC_CALL relocations.
1064 (Target_x86_64::Scan::global): Likewise.
1065 (Target_x86_64::do_finalize_sections): Add dynamic table entries
1066 for TLS descriptors.
1067 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
1068 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
1069 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
1070 GD-to-IE relaxation.
1071 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
1072 and TLS_DESCRIPTORS.
1073 * Makefile.in: Rebuild.
1074 * configure: Rebuild.
1075 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
1076 (tls_test_shared2.so): New target.
1077 (tls_shared_gd_to_ie_test_SOURCES): New variable.
1078 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
1079 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
1080 (tls_shared_gd_to_ie_test_LDADD): New variable.
1081 (tls_shared_gnu2_gd_to_ie_test): New target.
1082 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
1084 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
1085 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
1086 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
1087 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
1088 (tls_shared_gnu2_test): New target.
1089 (tls_test_gnu2_shared.so): New target.
1090 (tls_shared_gnu2_test_SOURCES): New variable.
1091 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
1092 (tls_shared_gnu2_test_LDFLAGS): New variable.
1093 (tls_shared_gnu2_test_LDADD): New variable.
1094 * testsuite/Makefile.in: Rebuild.
1095 * testsuite/Makefile.
1097 2008-04-11 Ian Lance Taylor <iant@google.com>
1099 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
1101 * testsuite/Makefile.in: Rebuild.
1103 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
1105 * testsuite/script_test_2.cc (main): Adjust test.
1107 2008-04-11 David S. Miller <davem@davemloft.net>
1108 Ian Lance Taylor <iant@google.com>
1110 * options.h (General_options): Add entries for '-Y' and
1112 * options.cc (General_options:finalize): If -Y was used, add those
1113 entries to the library path instead of the default "/lib" and
1116 2008-04-11 David S. Miller <davem@davemloft.net>
1118 * testsuite/justsyms.t: Start at 0x100.
1119 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
1120 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
1122 * testsuite/script_test_2.cc: Adjust string and section length
1125 2008-04-09 Ian Lance Taylor <iant@google.com>
1128 * script-sections.cc (Sections_element::allocate_to_segment): Add
1130 (Output_section_definition::allocate_to_segment): Likewise.
1131 (Orphan_output_section::allocate_to_segment): Likewise.
1132 (Script_sections::attach_sections_using_phdrs_clause): Don't
1133 propagate non-PT_LOAD segments to orphan sections.
1134 * testsuite/Makefile.am (script_test_3.stdout): Generate using
1135 readelf rather than objdump.
1136 * testsuite/script_test_3.sh: Adjust accordingly. Test that
1137 .interp section and PT_INTERP segment are the same size.
1138 * testsuite/Makefile.in: Rebuild.
1140 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
1141 aliases for symbols defined in the same object.
1142 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
1143 (weak_alias_test_SOURCES): New variable.
1144 (weak_alias_test_DEPENDENCIES): New variable.
1145 (weak_alias_test_LDFLAGS): New variable.
1146 (weak_alias_test_LDADD): New variable.
1147 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
1148 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
1149 (weak_alias_test_3.o): New target.
1150 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
1151 * testsuite/weak_alias_test_main.cc: New file.
1152 * testsuite/weak_alias_test_1.cc: New file.
1153 * testsuite/weak_alias_test_2.cc: New file.
1154 * testsuite/weak_alias_test_3.cc: New file.
1156 2008-04-08 Ian Lance Taylor <iant@google.com>
1158 * options.h (class General_options): Add --noinhibit-exec option.
1159 * main.cc (main): Check --noinhibit-exec.
1161 * options.h (class General_options): Define --wrap as a special
1162 option. Add wrap_symbols_ field.
1163 (General_options::any_wrap_symbols): New function.
1164 (General_options::is_wrap_symbol): New function.
1165 * options.cc (General_options::parse_wrap): New function.
1166 (General_options::General_options): Initialize wrap_symbols_.
1167 * symtab.cc (Symbol_table::wrap_symbol): New function.
1168 (Symbol_table::add_from_object): Handle --wrap.
1169 * symtab.h (class Symbol_table): Declare wrap_symbol.
1170 * target.h (Target::wrap_char): New function.
1171 (Target::Target_info): Add wrap_char field.
1172 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
1173 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
1174 * testsuite/testfile.cc (Target_test::test_target_info):
1177 * errors.cc (Errors::undefined_symbol): Mention symbol version if
1180 * layout.h (class Layout): Add added_eh_frame_data_ field.
1181 * layout.cc (Layout::Layout): Initialize new field.
1182 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
1183 output section until we find a section we merged successfully.
1184 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
1185 that the size be non-zero.
1187 * merge.cc (Object_merge_map::get_output_offset): Remove inline
1190 2008-04-08 Craig Silverstein <csilvers@google.com>
1192 * configure.ac: Export new conditional variable HAVE_ZLIB.
1193 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
1195 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
1196 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
1198 2008-04-07 Ian Lance Taylor <iant@google.com>
1200 * version.cc (version_string): Set to "1.5".
1202 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
1203 Add issued_non_pic_error_ field. Declare check_non_pic.
1204 (Target_x86_64::Scan::check_non_pic): New function.
1205 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
1206 (Target_x86_64::Scan::global): Likewise.
1208 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
1209 addend parameter. Change caller. Handle merge sections.
1210 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
1211 Address to Addend. Don't add in the result of
1212 local_section_offset, pass down the addend and use the returned
1214 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
1215 Update declarations of local_section_offset and symbol_value.
1216 * testsuite/two_file_test_1.cc (t18): New function.
1217 * testsuite/two_file_test_2.cc (f18): New function.
1218 * testsuite/two_file_test_main.cc (main): Call t18.
1219 * testsuite/two_file_test.h (t18, f18): Declare.
1221 * configure.ac: Don't test for objdump, c++filt, or readelf.
1222 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
1224 (TEST_READELF): New variable.
1225 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
1226 (check_PROGRAMS): Add two_file_strip_test.
1227 (two_file_strip_test): New target.
1228 (check_PROGRAMS): Add two_file_same_shared_strip_test.
1229 (two_file_same_shared_strip_test_SOURCES): New variable.
1230 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
1231 (two_file_same_shared_strip_test_LDFLAGS): New variable.
1232 (two_file_same_shared_strip_test_LDADD): New variable.
1233 (two_file_shared_strip.so): New target.
1234 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
1235 (ver_test_5.syms, ver_test_7.syms): Likewise.
1236 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
1237 (strip_test_3.stdout): Use TEST_OBJDUMP.
1238 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
1240 2008-04-04 Cary Coutant <ccoutant@google.com>
1242 * symtab.h (Symbol::is_weak_undefined): New function.
1243 (Symbol::is_strong_undefined): New function.
1244 (Symbol::is_absolute): New function.
1245 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
1246 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
1248 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
1249 (weak_undef_test): New target.
1250 * testsuite/Makefile.in: Rebuild.
1251 * testsuite/weak_undef_file1.cc: New file.
1252 * testsuite/weak_undef_file2.cc: New file.
1253 * testsuite/weak_undef_test.cc: New file.
1255 2008-04-03 Craig Silverstein <csilvers@google.com>
1257 * compressed_output.h (class Output_compressed_section): Use
1259 * compressed_output.cc (zlib_compress): Use unsigned buffers,
1261 (zlib_compressed_suffix): Removed.
1262 (Output_compressed_section::set_final_data_size): Use unsigned
1264 * testsuite/Makefile.am (flagstest_compress_debug_sections):
1265 Fix linker invocation.
1266 (flagstest_o_specialfile_and_compress_debug_sections):
1268 * testsuite/Makefile.in: Regenerated.
1270 2008-04-02 David S. Miller <davem@davemloft.net>
1272 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
1273 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
1275 2008-04-02 Craig Silverstein <csilvers@google.com>
1279 2008-04-02 Ian Lance Taylor <iant@google.com>
1281 * fileread.cc (File_read::find_view): Add byteshift and vshifted
1282 parameters. Update for new key type to views_. Change all
1284 (File_read::read): Adjust for byteshift in returned view.
1285 (File_read::add_view): New function, broken out of
1287 (File_read::make_view): New function, broken out of
1289 (File_read::find_or_make_view): Add offset and aligned
1290 parameters. Rewrite accordingly. Change all callers.
1291 (File_read::get_view): Add offset and aligned parameters. Adjust
1292 for byteshift in return value.
1293 (File_read::get_lasting_view): Likewise.
1294 * fileread.h (class File_read): Update declarations.
1295 (class File_read::View): Add byteshift_ field. Add byteshift to
1296 constructor. Add byteshift method.
1297 * archive.h (Archive::clear_uncached_views): New function.
1298 (Archive::get_view): Add aligned parameter. Change all callers.
1299 * object.h (Object::get_view): Add aligned parameter. Change all
1301 (Object::get_lasting_view): Likewise.
1303 * fileread.cc (File_read::release): Don't call clear_views if
1304 there are multiple objects.
1305 * fileread.h (File_read::clear_uncached_views): New function.
1306 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
1309 2008-03-31 Cary Coutant <ccoutant@google.com>
1311 Add thin archive support.
1312 * archive.cc (Archive::armagt): New const.
1313 (Archive::setup): Remove task parameter and calls to unlock.
1314 (Archive::unlock_nested_archives): New function.
1315 (Archive::read_header): Add nested_off parameter. Change
1317 (Archive::interpret_header): Likewise.
1318 (Archive::include_all_members): Change to handle thin
1320 (Archive::include_member): Likewise.
1321 * archive.h (Archive::Archive): Add new parameters and
1323 (Archive::armagt): New const.
1324 (Archive::setup): Remove task parameter.
1325 (Archive::unlock_nested_archives): New function.
1326 (Archive::read_header): Add nested_off parameter.
1327 (Archive::interpret_header): Likewise.
1328 (Archive::Nested_archive_table): New typedef.
1329 (Archive::is_thin_archive_): New field.
1330 (Archive::nested_archives_): New field.
1331 (Archive::options_): New field.
1332 (Archive::dirpath_): New field.
1333 (Archive::task_): New field.
1334 * readsyms.cc (Read_symbols::do_read_symbols): Add check
1335 for thin archives. Pass additional parameters to
1336 Archive::Archive. Unlock the archive file after calling
1339 2008-03-29 Ian Lance Taylor <iant@google.com>
1341 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
1342 version symbol to be local.
1343 * testsuite/ver_test_4.sh: New file.
1344 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
1345 (check_DATA): Add ver_test_4.syms.
1346 (ver_test_4.syms): New target.
1347 * testsuite/Makefile.in: Rebuild.
1350 (Output_section::Input_section_sort_entry::has_priority): New
1352 (Output_section::Input_section_sort_entry::match_file_name): New
1354 (Output_section::Input_section_sort_entry::match_section_name):
1356 (Output_section::Input_section_sort_entry::match_section_name_prefix):
1358 (Output_section::Input_section_sort_entry::match_section_file):
1360 (Output_section::Input_section_sort_compare::operator()): Rewrite
1361 using new Input_section_sort_entry functions. Sort crtbegin and
1362 crtend first. Sort sections with no priority before sections with
1364 * testsuite/initpri1.c (d3): Check j != 4.
1365 (cd5): New constructor/destructor function.
1366 (main): Check j != 2.
1368 * symtab.cc (Symbol_table::add_from_object): If we don't use the
1369 new symbol when resolving, don't call set_is_default.
1370 * testsuite/ver_test_7.cc: New file.
1371 * testsuite/ver_test_7.sh: New file.
1372 * testsuite/Makefile.am (ver_test_7.so): New target.
1373 (ver_test_7.o): New target.
1374 (check_SCRIPTS): Add ver_test_7.sh.
1375 (check_DATA): Add ver_test_7.syms.
1376 (ver_test_7.syms): New target.
1378 2008-03-28 Ian Lance Taylor <iant@google.com>
1380 * layout.cc (Layout::layout): If we see an input section with a
1381 name that needs sorting, set the must_sort flag for the output
1383 (Layout::make_output_section): If the name of the output section
1384 indicates that it might require sorting, set the may_sort flag.
1385 * output.h (Output_section::may_sort_attached_input_sections): New
1387 (Output_section::set_may_sort_attached_input_sections): New
1389 (Output_section::must_sort_attached_input_sections): New
1391 (Output_section::set_must_sort_attached_input_sections): New
1393 (class Output_section): Declare Input_section_sort_entry. Define
1394 Input_section_sort_compare. Declare
1395 sort_attached_input_sections. Add new fields:
1396 may_sort_attached_input_sections_,
1397 must_sort_attached_input_sections_,
1398 attached_input_sections_are_sorted_.
1399 * output.cc (Output_section::Output_section): Initialize new
1401 (Output_section::add_input_section): Add an entry to
1402 input_sections_ if may_sort or must_sort are true.
1403 (Output_section::set_final_data_size): Call
1404 sort_attached_input_sections if necessary.
1405 (Output_section::Input_section_sort_entry): Define new class.
1406 (Output_section::Input_section_sort_compare::operator()): New
1408 (Output_section::sort_attached_input_sections): New function.
1409 * configure.ac: Check whether the compiler supports constructor
1410 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
1411 * testsuite/initpri1.c: New file.
1412 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
1413 CONSTRUCTOR_PRIORITY.
1414 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
1415 (initpri1_LDFLAGS): New variable.
1416 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
1418 2008-03-27 Ian Lance Taylor <iant@google.com>
1420 * common.cc (Sort_commons::operator): Correct sorting algorithm.
1421 * testsuite/common_test_1.c: New file.
1422 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
1423 (common_test_1_SOURCES): New variable.
1424 (common_test_1_DEPENDENCIES): New variable.
1425 (common_test_1_LDFLAGS): New variable.
1427 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
1428 and commons_ correctly when NAME/VERSION does not override
1430 * testsuite/ver_test_6.c: New file.
1431 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
1432 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
1433 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
1435 2008-03-26 Ian Lance Taylor <iant@google.com>
1437 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
1438 of an undefined symbol from a version script.
1439 * testsuite/Makefile.am (ver_test_5.so): New target.
1440 (ver_test_5.o): New target.
1441 (check_SCRIPTS): Add ver_test_5.sh.
1442 (check_DATA): Add ver_test_5.syms.
1443 (ver_test_5.syms): New target.
1444 * testsuite/ver_test_5.cc: New file.
1445 * testsuite/ver_test_5.script: New file.
1446 * testsuite/ver_test_5.sh: New file.
1447 * Makefile.in, testsuite/Makefile.in: Rebuild.
1450 Fix problems building gold with gcc 4.3.0.
1451 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
1452 (gold_error_at_location, gold_warning_at_location): Use it.
1453 * configure.ac: Check whether we can compile and use a template
1454 function with a printf attribute.
1455 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
1456 when jumping over bytes.
1457 * object.cc: Instantiate Object::read_section_data.
1458 * debug.h: Include <cstring>
1459 * dwarf_reader.cc: Include <algorithm>
1460 * main.cc: Include <cstring>.
1461 * options.cc: Include <cstring>.
1462 * output.cc: Include <cstring>.
1463 * script.cc: Include <cstring>.
1464 * script.h: Include <string>.
1465 * symtab.cc: Include <cstring> and <algorithm>.
1466 * target-select.cc: Include <cstring>.
1467 * version.cc: Include <string>.
1468 * testsuite/testmain.cc: Include <cstdlib>.
1469 * configure, config.in: Rebuild.
1471 2008-03-25 Ian Lance Taylor <iant@google.com>
1473 * options.cc: Include "../bfd/bfdver.h".
1474 (options::help): Print bug reporting address.
1476 * version.cc (print_version): Adjust output for current value of
1481 * options.cc (options::help): Print list of supported targets.
1482 * target-select.h: Include <vector>.
1483 (class Target_selector): Make machine_, size_, and is_big_endian_
1484 fields const. Add bfd_name_ and instantiated_target_ fields.
1485 (Target_selector::Target_selector): Add bfd_name parameter.
1486 (Target_selector::recognize): Make non-virtual, call
1488 (Target_selector::recognize_by_name): Make non-virtual, call
1489 do_recognize_by_name.
1490 (Target_selector::supported_names): New function.
1491 (Target_selector::bfd_name): New function.
1492 (Target_selector::do_instantiate_target): New pure virtual
1494 (Target_selector::do_recognize): New virtual function.
1495 (Target_selector::do_recognize_by_name): New virtual function.
1496 (Target_selector::instantiate_target): New private function.
1497 (supported_target_names): Declare.
1498 * target-select.cc (Target_selector::Target_selector): Update for
1499 new parameter and fields.
1500 (select_target_by_name): Check that the name matches before
1501 calling recognize_by_name.
1502 (supported_target_names): New function.
1503 * i386.cc (class Target_selector_i386): Update Target_selector
1504 constructor call. Remove recognize and recognize_by_name. Add
1505 do_instantiate_target.
1506 * x86_64.cc (class Target_selector_x86_64): Likewise.
1507 * testsuite/testfile.cc (class Target_selector_test): Update for
1508 changes to Target_selector.
1510 * README: Rewrite, with some notes on unsupported features.
1512 2008-03-24 Cary Coutant <ccoutant@google.com>
1514 * i386.cc (Target_i386::Got_type): New enum declaration.
1515 (Target_i386::Scan::local): Updated callers of Output_data_got
1517 (Target_i386::Scan::global): Likewise.
1518 (Target_i386::Relocate::relocate): Likewise.
1519 (Target_i386::Relocate::relocate_tls): Likewise.
1520 * object.h (Got_offset_list): New class.
1521 (Sized_relobj::local_has_got_offset): Added got_type parameter.
1522 (Sized_relobj::local_got_offset): Likewise.
1523 (Sized_relobj::set_local_got_offset): Likewise.
1524 (Sized_relobj::local_has_tls_got_offset): Removed.
1525 (Sized_relobj::local_tls_got_offset): Removed.
1526 (Sized_relobj::set_local_tls_got_offset): Removed.
1527 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
1528 * output.cc (Output_data_got::add_global): Added got_type parameter.
1529 (Output_data_got::add_global_with_rel): Likewise.
1530 (Output_data_got::add_global_with_rela): Likewise.
1531 (Output_data_got::add_global_pair_with_rel): New function.
1532 (Output_data_got::add_global_pair_with_rela): New function.
1533 (Output_data_got::add_local): Added got_type parameter.
1534 (Output_data_got::add_local_with_rel): Likewise.
1535 (Output_data_got::add_local_with_rela): Likewise.
1536 (Output_data_got::add_local_pair_with_rel): New function.
1537 (Output_data_got::add_local_pair_with_rela): New function.
1538 (Output_data_got::add_global_tls): Removed.
1539 (Output_data_got::add_global_tls_with_rel): Removed.
1540 (Output_data_got::add_global_tls_with_rela): Removed.
1541 (Output_data_got::add_local_tls): Removed.
1542 (Output_data_got::add_local_tls_with_rel): Removed.
1543 (Output_data_got::add_local_tls_with_rela): Removed.
1544 * output.h (Output_data_got::add_global): Added got_type parameter.
1545 (Output_data_got::add_global_with_rel): Likewise.
1546 (Output_data_got::add_global_with_rela): Likewise.
1547 (Output_data_got::add_global_pair_with_rel): New function.
1548 (Output_data_got::add_global_pair_with_rela): New function.
1549 (Output_data_got::add_local): Added got_type parameter.
1550 (Output_data_got::add_local_with_rel): Likewise.
1551 (Output_data_got::add_local_with_rela): Likewise.
1552 (Output_data_got::add_local_pair_with_rel): New function.
1553 (Output_data_got::add_local_pair_with_rela): New function.
1554 (Output_data_got::add_global_tls): Removed.
1555 (Output_data_got::add_global_tls_with_rel): Removed.
1556 (Output_data_got::add_global_tls_with_rela): Removed.
1557 (Output_data_got::add_local_tls): Removed.
1558 (Output_data_got::add_local_tls_with_rel): Removed.
1559 (Output_data_got::add_local_tls_with_rela): Removed.
1560 * resolve.cc (Symbol::override_base_with_special): Removed
1561 reference to has_got_offset_ field.
1562 * symtab.cc (Symbol::init_fields): Replaced initialization
1563 of got_offset_ with got_offsets_. Removed initialization
1565 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
1566 (Symbol::got_offset): Likewise.
1567 (Symbol::set_got_offset): Likewise.
1568 (Symbol::has_tls_got_offset): Removed.
1569 (Symbol::tls_got_offset): Removed.
1570 (Symbol::set_tls_got_offset): Removed.
1571 (Symbol::got_offset_): Removed.
1572 (Symbol::tls_mod_got_offset_): Removed.
1573 (Symbol::tls_pair_got_offset_): Removed.
1574 (Symbol::got_offsets_): New field.
1575 (Symbol::has_got_offset): Removed.
1576 (Symbol::has_tls_mod_got_offset): Removed.
1577 (Symbol::has_tls_pair_got_offset): Removed.
1578 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
1579 (Target_x86_64::Scan::local): Updated callers of Output_data_got
1581 (Target_x86_64::Scan::global): Likewise.
1582 (Target_x86_64::Relocate::relocate): Likewise.
1583 (Target_x86_64::Relocate::relocate_tls): Likewise.
1585 2008-03-25 Ben Elliston <bje@au.ibm.com>
1587 * yyscript.y: Fix spelling error in comment.
1589 2008-03-24 Ian Lance Taylor <iant@google.com>
1591 * options.h (class General_options): Define build_id option.
1592 * layout.h (class Layout): Declare write_build_id, create_note,
1593 create_build_id. Add build_id_note_ member.
1594 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
1595 "libiberty.h", "md5.h", "sha1.h".
1596 (Layout::Layout): Initialize eh_frame_data_,
1597 eh_frame_hdr_section_, and build_id_note_.
1598 (Layout::finalize): Call create_build_id.
1599 (Layout::create_note): New function, broken out of
1600 Layout::create_gold_note.
1601 (Layout::create_gold_note): Call create_note.
1602 (Layout::create_build_id): New function.
1603 (Layout::write_build_id): New function.
1604 (Close_task_runner::run): Call write_build_id.
1606 * x86_64.cc: Correct license to GPLv3.
1608 2008-03-23 Ian Lance Taylor <iant@google.com>
1610 * options.cc: Include "demangle.h".
1611 (parse_optional_string): New function.
1612 (parse_long_option): Handle takes_optional_argument.
1613 (parse_short_option): Update dash_z initializer. Handle
1614 takes_optional_argument.
1615 (General_options::General_options): Initialize do_demangle_.
1616 (General_options::finalize): Set do_demangle_. Handle demangling
1618 * options.h (parse_optional_string): Declare.
1619 (struct One_option): Add optional_arg field. Update constructor.
1620 Update call constructor calls. Add takes_optional_argument
1622 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
1623 (DEFINE_optional_string): Define.
1624 (General_options::demangle): Change from DEFINE_bool to
1625 DEFINE_optional_string.
1626 (General_options::no_demangle): New function.
1627 (General_options::do_demangle): New function.
1628 (General_options::set_do_demangle): New function.
1629 (General_options::execstack_status_): Move definition to end of
1631 (General_options::static_): Likewise.
1632 (General_options::do_demangle_): New field.
1633 * object.cc (big_endian>::get_symbol_location_info): Call
1634 Options::do_demangle, not Options::demangle.
1635 * symtab.cc (demangle): Likewise.
1637 2008-03-22 Ian Lance Taylor <iant@google.com>
1639 * gold.h: Include <cstddef> and <sys/types.h>
1640 * options.h: Include <cstring>.
1642 2008-03-21 Ian Lance Taylor <iant@google.com>
1644 * Added source code to GNU binutils.