c0612930773559a5ec81d744709bb365e8076687
[binutils-gdb.git] / gold / ChangeLog
1 2008-04-30 Cary Coutant <ccoutant@google.com>
2
3 * layout.cc (Layout::include_section): Refactored check for debug
4 info section.
5 (Layout::add_comdat): Add new parameters. Change type
6 of signature parameter. Add object and shndx to signatures table.
7 (Layout::find_kept_object): New function.
8 * layout.h: Include <cstring>.
9 (Layout::is_debug_info_section): New function.
10 (Layout::add_comdat): Add new parameters.
11 (Layout::find_kept_object): New function.
12 (Layout::Kept_section): New struct.
13 (Layout::Signatures): Change type of map range.
14 * object.cc (Relobj::output_section_address): New function.
15 (Sized_relobj::include_section_group): Add new parameters. Change
16 calls to Layout::add_comdat. Change to build table of kept comdat
17 groups and table mapping discarded sections to kept sections.
18 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
19 (Sized_relobj::do_layout): Change calls to include_section_group and
20 include_linkonce_section.
21 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
22 value to zero when section is discarded.
23 (Sized_relobj::map_to_kept_section): New function.
24 * object.h (Relobj::output_section_address): New function.
25 (Relobj::Comdat_group): New type.
26 (Relobj::find_comdat_group): New function.
27 (Relobj::Comdat_group_table): New type.
28 (Relobj::Kept_comdat_section): New type.
29 (Relobj::Kept_comdat_section_table): New type.
30 (Relobj::add_comdat_group): New function.
31 (Relobj::set_kept_comdat_section): New function.
32 (Relobj::get_kept_comdat_section): New function.
33 (Relobj::comdat_groups_): New field.
34 (Relobj::kept_comdat_sections_): New field.
35 (Symbol_value::input_value): Update comment.
36 (Sized_relobj::map_to_kept_section) New function.
37 (Sized_relobj::include_linkonce_section): Add new parameter.
38 * target-reloc.h (Comdat_behavior): New type.
39 (get_comdat_behavior): New function.
40 (relocate_section): Add code to map a discarded section to the
41 corresponding kept section when applying a relocation.
42
43 2008-04-30 Craig Silverstein <csilvers@google.com>
44
45 * dwarf_reader.cc (next_generation_count): New static var.
46 (Addr2line_cache_entry): New struct.
47 (addr2line_cache): New static var.
48 (Dwarf_line_info::one_addr2line): Added caching.
49 (Dwarf_line_info::clear_addr2line_cache): New function.
50 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
51 cache-size parameter.
52 (Dwarf_line_info::one_addr2line_cache): New function.
53 * symtab.cc (Symbol_table::detect_odr_violations): Pass
54 new cache-size argument to one_addr2line(), and clear cache.
55
56 2008-04-28 Cary Coutant <ccoutant@google.com>
57
58 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
59 R_386_PC8 relocations.
60
61 2008-04-23 Ian Lance Taylor <iant@google.com>
62
63 * object.cc (Sized_relobj::include_section_group): Check for
64 invalid section group.
65
66 * object.cc (make_elf_object): Correct test for 64-bit ELF file
67 header size.
68
69 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
70 than read for file header.
71 * archive.cc (Archive::include_member): Likewise.
72
73 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
74
75 * aclocal.m4: Regenerate.
76 * configure: Regenerate.
77
78 2008-04-19 Ian Lance Taylor <iant@google.com>
79
80 * version.cc (version_string): Bump to 1.6.
81
82 * testsuite/Makefile.am (many_sections_r_test): New target.
83 (many_sections_r_test_SOURCES): Remove.
84 (many_sections_r_test_DEPENDENCIES): Remove.
85 (many_sections_r_test_LDFLAGS): Remove.
86 (many_sections_r_test_LDADD): Remove.
87
88 * object.cc (Sized_relobj::do_add_symbols): Always pass
89 local_symbol_count_ to add_from_relobj.
90
91 * testsuite/Makefile.am (many_sections_check.h): Only check one in
92 every thousand variables.
93 * testsuite/Makefile.in: Rebuild.
94
95 * object.cc (Xindex::initialize_symtab_xindex): New function.
96 (Xindex::read_symtab_xindex): New function.
97 (Xindex::sym_xindex_to_shndx): New function.
98 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
99 available.
100 (Sized_relobj::do_initialize_xindex): New function.
101 (Sized_relobj::do_read_symbols): Adjust section links.
102 (Sized_relobj::symbol_section_and_value): Add is_ordinary
103 parameter. Change all callers.
104 (Sized_relobj::include_section_group): Adjust section links and
105 symbol section indexes.
106 (Sized_relobj::do_layout): Adjust section links.
107 (Sized_relobj::do_count_local_symbols): Adjust section links and
108 symbol section indexes.
109 (Sized_relobj::do_finalize_local_symbols): Distinguish between
110 ordinary and special symbols.
111 (Sized_relobj::write_local_symbols): Add symtab_xindex and
112 dynsym_xindex parameters. Change all callers. Adjust section
113 links. Use SHN_XINDEX when needed.
114 (Sized_relobj::get_symbol_location_info): Adjust section links.
115 Don't get fooled by special symbols.
116 * object.h (class Xindex): Define.
117 (class Object): Add xindex_ parameter. Declare virtual functoin
118 do_initialize_xindex.
119 (Object::adjust_sym_shndx): New function.
120 (Object::set_xindex): New protected function.
121 (class Symbol_value): Add is_ordinary_shndx_ field.
122 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
123 (Symbol_value::value): Assert ordinary section.
124 (Symbol_value::initialize_input_to_output_map): Likewise.
125 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
126 Change all callers.
127 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
128 all callers.
129 (class Sized_relobj): Update declarations.
130 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
131 parameter. Change all callers.
132 (Sized_relobj::adjust_shndx): New function.
133 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
134 field.
135 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
136 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
137 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
138 (Sized_dynobj::read_dynsym_section): Adjust section links.
139 (Sized_dynobj::read_dynamic): Likewise.
140 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
141 section links.
142 (Sized_dynobj::do_initialize_xindex): New function.
143 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
144 do_initialize_xindex.
145 (Sized_dynobj::adjust_shndx): New function.
146 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
147 dynsym_xindex_ fields.
148 (Layout::finalize): Add a call to set_section_indexes before
149 creating the symtab sections.
150 (Layout::set_section_indexes): Don't do anything if the section
151 already has a section index.
152 (Layout::create_symtab_sections): Add shnum parameter. Change
153 caller. Create .symtab_shndx section if needed.
154 (Layout::create_shdrs): Add shstrtab_section parameter. Change
155 caller.
156 (Layout::allocated_output_section_count): New function.
157 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
158 needed.
159 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
160 fields. Update declarations.
161 (Layout::symtab_xindex): New function.
162 (Layout::dynsym_xindex): New function.
163 (class Write_symbols_task): Add layout_ field.
164 (Write_symbols_task::Write_symbols_task): Add layout parameter.
165 Change caller.
166 * output.cc (Output_section_headers::Output_section_headers): Add
167 shstrtab_section parameter. Change all callers.
168 (Output_section_headers::do_sized_write): Store overflow values
169 for section count and section string table section index in
170 section header zero.
171 (Output_file_header::do_sized_write): Check for overflow of
172 section count and section string table section index.
173 (Output_symtab_xindex::do_write): New function.
174 (Output_symtab_xindex::endian_do_write): New function.
175 * output.h (class Output_section_headers): Add shstrtab_section_.
176 Update declarations.
177 (class Output_symtab_xindex): Define.
178 (Output_section::has_out_shndx): New function.
179 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
180 field.
181 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
182 Change all callers.
183 (Sized_symbol::init): Likewise.
184 (Symbol::output_section): Check for ordinary symbol.
185 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
186 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
187 callers.
188 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
189 Change all callers. Simplify handling of symbols from sections
190 not included in the link.
191 (Symbol_table::add_from_dynobj): Handle ordinary symbol
192 distinction.
193 (Weak_alias_sorter::operator()): Assert that symbols are
194 ordinary.
195 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
196 distinction.
197 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
198 parameters. Change all callers.
199 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
200 symbol distinction. Use SHN_XINDEX when needed.
201 (Symbol_table::write_section_symbol): Add symtab_xindex
202 parameter. Change all callers.
203 (Symbol_table::sized_write_section_symbol): Likewise. Use
204 SHN_XINDEX when needed.
205 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
206 declarations.
207 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
208 (Symbol::is_defined): Check is_ordinary.
209 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
210 (Symbol::is_absolute, Symbol::is_common): Likewise.
211 (class Sized_symbol): Update declarations.
212 (class Symbol_table): Update declarations.
213 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
214 parameters. Change all callers.
215 (Sized_symbol::override): Likewise.
216 (Symbol_table::override): Likewise.
217 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
218 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
219 is_ordinary, and orig_st_shndx parameters. Change all callers.
220 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
221 to be in an ordinary section.
222 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
223 object and is_ordinary parameters. Change all callers.
224 (Sized_dwarf_line_info::read_relocs): Add object parameter.
225 Change all callers. Don't add undefined or non-ordinary symbols
226 to reloc_map_.
227 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
228 Change all callers.
229 * dwarf_reader.h (class Sized_dwarf_line_info): Update
230 declarations.
231 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
232 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
233 (Sized_relobj::relocate_sections): Likewise.
234 * target-reloc.h (scan_relocs): Adjust section symbol index.
235 (scan_relocatable_relocs): Likewise.
236 * i386.cc (Scan::local): Check for ordinary symbols.
237 * sparc.cc (Scan::local): Likewise.
238 * x86_64.cc (Scan::local): Likewise.
239 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
240 to symbol_section_and_value.
241 * testsuite/many_sections_test.cc: New file.
242 * testsuite/Makefile.am (BUILT_SOURCES): Define.
243 (check_PROGRAMS): Add many_sections_test.
244 (many_sections_test_SOURCES): Define.
245 (many_sections_test_DEPENDENCIES): Define.
246 (many_sections_test_LDFLAGS): Define.
247 (BUILT_SOURCES): Add many_sections_define.h.
248 (many_sections_define.h): New target.
249 (BUILT_SOURCES): Add many_sections_check.h.
250 (many_sections_check.h): New target.
251 (check_PROGRAMS): Add many_sections_r_test.
252 (many_sections_r_test_SOURCES): Define.
253 (many_sections_r_test_DEPENDENCIES): Define.
254 (many_sections_r_test_LDFLAGS): Define.
255 (many_sections_r_test_LDADD): Define.
256 (many_sections_r_test.o): New target.
257 * testsuite/Makefile.in: Rebuild.
258
259 2008-04-17 Cary Coutant <ccoutant@google.com>
260
261 * errors.cc (Errors::info): New function.
262 (gold_info): New function.
263 * errors.h (Errors::info): New function.
264 * gold.h (gold_info): New function.
265 * object.cc (Input_objects::add_object): Print trace output.
266 * options.cc (options::parse_set): New function.
267 (General_options::parse_wrap): Deleted.
268 (General_options::General_options): Deleted initializer.
269 * options.h (options::String_set): New typedef.
270 (options::parse_set): New function.
271 (DEFINE_set): New macro.
272 (General_options::wrap): Changed to use DEFINE_set. Changed
273 callers of any_wrap_symbols and is_wrap_symbol.
274 (General_options::trace, General_options::trace_symbol):
275 New options.
276 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
277 (General_options::wrap_symbols_): Deleted.
278 * symtab.cc (Symbol_table::add_from_object): Print trace output.
279
280 2008-04-17 David S. Miller <davem@davemloft.net>
281
282 * options.cc (General_options::parse_V): New function.
283 * options.h: Add entries for -V and -Qy.
284
285 2008-04-17 Ian Lance Taylor <iant@google.com>
286
287 * common.cc (Symbol_table::allocate_commons): Remove options
288 parameter. Change caller.
289 (Symbol_table::do_allocate_commons): Remove options parameter.
290 Change caller. Just call do_allocate_commons_list twice.
291 (Symbol_table::do_allocate_commons_list): New function, broken out
292 of do_allocate_commons.
293 * common.h (class Allocate_commons_task): Remove options_ field.
294 Update constructor.
295 * symtab.cc (Symbol_table::Symbol_table): Initialize
296 tls_commons_.
297 (Symbol_table::add_from_object): Put TLS common symbols on
298 tls_commons_ list.
299 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
300 which are IN_OUTPUT_DATA.
301 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
302 allocate_commons and do_allocate_commons declarations. Declare
303 do_allocate_commons_list.
304 * gold.cc (queue_middle_tasks): Update creation of
305 Allocate_commons_task to not pass options.
306 * testsuite/Makefile.am (INCLUDES): Add -I.. .
307 (TLS_TEST_C_FLAGS): New variable.
308 (tls_test_c_pic.o): New target.
309 (tls_test_shared.so): Link in tls_test_c_pic.o.
310 (tls_test_c_pic_ie.o): New target.
311 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
312 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
313 (tls_test_c.o): New target.
314 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
315 (tls_pic_test_LDADD): Likewise.
316 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
317 (tls_shared_gd_to_ie_test_LDADD): Likewise.
318 (tls_test_c_gnu2.o): New target.
319 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
320 tls_test_c_gnu2.o.
321 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
322 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
323 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
324 * testsuite/tls_test.cc: Include "config.h".
325 (t_last): Call t11_last.
326 * testsuite/tls_test.h (t11, t11_last): Declare.
327 * testsuite/tls_test_c.c: New file.
328 * testsuite/tls_test_main.cc (thread_routine): Call t11.
329 * configure.ac: Check for OpenMP support.
330 * configure, config.in, Makefile.in: Rebuild.
331 * testsuite/Makefile.in: Rebuild.
332
333 2008-04-16 Cary Coutant <ccoutant@google.com>
334
335 * i386.cc (Target_i386::define_tls_base_symbol): New function.
336 (Target_i386::tls_base_symbol_defined_): New field.
337 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
338 (Target_i386::Scan::global): Likewise.
339 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
340 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
341 (Target_x86_64::tls_base_symbol_defined_): New field.
342 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
343 (Target_x86_64::Scan::global): Likewise.
344
345 2008-04-16 Cary Coutant <ccoutant@google.com>
346
347 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
348 (Symbol::needs_plt_entry): Allow weak undefined symbols.
349 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
350 building shared libraries.
351 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
352 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
353 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
354 * testsuite/Makefile.in: Rebuild.
355 * testsuite/weak_undef.h: New file.
356 * testsuite/weak_undef_file1.cc: Add extra test cases.
357 * testsuite/weak_undef_file2.cc: Likewise.
358 * testsuite/weak_undef_test.cc: Likewise.
359
360 2008-04-16 David S. Miller <davem@davemloft.net>
361
362 * sparc.cc (Target_sparc::Scan): Change from struct to class.
363 Add issued_non_pic_error_ field. Declare check_non_pic.
364 (Target_sparc::Scan::check_non_pic): New function.
365 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
366 (Target_sparc::Scan::global): Likewise.
367
368 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
369 * configure: Rebuild.
370
371 * options.h (DEFINE_enable): New macro.
372 (new_dtags): New enable option.
373 (initfirst, interpose, loadfltr, nodefaultlib,
374 nodelete, nodlopen, nodump): New -z options.
375 * layout.cc (Layout:finish_dynamic_section): If new
376 dtags enabled, emit DT_RUNPATH. Also, emit a
377 DT_FLAGS_1 containing any specified -z flags.
378
379 2008-04-16 Ian Lance Taylor <iant@google.com>
380
381 * copy-relocs.cc: New file.
382 * copy-relocs.h: New file.
383 * reloc.cc: Remove Copy_relocs code.
384 * reloc.h: Likewise.
385 * reloc-types.h (struct Reloc_types) [both versions]: Add
386 get_reloc_addend_noerror.
387 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
388 variants of add_global which take an addend which must be zero.
389 * i386.cc: Include "copy-relocs.h".
390 (class Target_i386): Change type of copy_relocs_ to variable,
391 update initializer.
392 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
393 Change all callers.
394 (Target_i386::do_finalize_sections): Change handling of
395 copy_relocs_.
396 * sparc.cc: Include "copy-relocs.h".
397 (class Target_sparc): Change type of copy_relocs_ to variable,
398 update initializer.
399 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
400 Change all callers.
401 (Target_sparc::do_finalize_sections): Change handling of
402 copy_relocs_.
403 * x86_64.cc: Include "copy-relocs.h".
404 (class Target_x86_64): Change type of copy_relocs_ to variable,
405 update initializer.
406 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
407 class. Change all callers.
408 (Target_x86_64::do_finalize_sections): Change handling of
409 copy_relocs_.
410 * Makefile.am (CCFILES): Add copy-relocs.cc.
411 (HFILES): Add copy-relocs.h.
412
413 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
414
415 * testsuite/script_test_4.sh: Permit leading zeroes.
416
417 2008-04-15 Ian Lance Taylor <iant@google.com>
418
419 * script-sections.cc (Script_sections::create_segments): Use
420 header_size_adjustment even when there is enough room for the
421 headers.
422 * testsuite/script_test_4.sh: New file.
423 * testsuite/script_test_4.t: New file.
424 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
425 (check_DATA): Add script_test_4.stdout.
426 (MOSTLYCLEANFILES): Likewise.
427 (script_test_4): New target.
428 (script_test_4.stdout): New target.
429 * testsuite/Makefile.in: Rebuild.
430
431 * sparc.cc: Add definitions for Output_data_plt_sparc class
432 constants.
433
434 2008-04-14 David S. Miller <davem@davemloft.net>
435
436 * sparc.cc: New file.
437 * Makefile.am (TARGETSOURCES): Add sparc.cc
438 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
439 * configure.tgt: Document targ_extra_size and
440 targ_extra_big_endian. Add entries for sparc-* and
441 sparc64-*.
442 * configure.ac: Handle targ_extra_size and
443 targ_extra_big_endian.
444 * Makefile.in: Rebuild.
445 * configure: Likewise.
446 * po/POTFILES.in: Likewise.
447 * po/gold.pot: Likewise.
448
449 2008-04-14 Ian Lance Taylor <iant@google.com>
450
451 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
452 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
453 in the name/type/flags to section mapping. Don't call
454 allocate_output_section.
455 (Layout::choose_output_section): Change parameter from adjust_name
456 to is_input_section. Don't permit input sections after sections
457 are attached to segments. Don't call allocate_output_section.
458 (Layout::layout_eh_frame): Call update_flags_for_input_section,
459 not write_enable_output_section.
460 (Layout::make_output_section): Don't push to
461 unattached_section_list_ nor call attach_to_segment. Call
462 attach_section_to_segment if sections are attached.
463 (Layout::attach_sections_to_segments): New function.
464 (Layout::attach_section_to_segment): New function.
465 (Layout::attach_allocated_section_to_segment): Rename from
466 attach_to_segment. Remove flags parameter.
467 (Layout::allocate_output_section): Remove function.
468 (Layout::write_enable_output_section): Remove function.
469 * layout.h (class Layout): Update for above changes. Add new
470 field sections_are_attached_.
471 * output.h (Output_section::update_flags_for_input_section): New
472 function.
473 * output.cc (Output_section::add_input_section): Call
474 update_flags_for_input_section.
475 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
476
477 2008-04-11 Cary Coutant <ccoutant@google.com>
478
479 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
480 thought unnecessary.
481 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
482
483 2008-04-11 Ian Lance Taylor <iant@google.com>
484
485 * output.h (class Output_section_data): Remove inline definition
486 of set_addralign.
487 * output.cc (Output_section_data::set_addralign): New function.
488
489 2008-04-11 Cary Coutant <ccoutant@google.com>
490
491 Add support for TLS descriptors for i386 and x86_64.
492 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
493 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
494 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
495 GOT_TYPE_TLS_DESC.
496 (Target_i386::got_mod_index_entry): Remove unnecessary code.
497 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
498 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
499 relocations.
500 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
501 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
502 Fix problem with initial-exec relocations.
503 (Target_i386::Relocate::relocate_tls): Likewise.
504 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
505 relaxation.
506 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
507 support for section-plus-offset dynamic table entries.
508 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
509 (Output_data_dynamic::Dynamic_entry): Add support for
510 section-plus-offset dynamic table entries.
511 (Output_data_dynamic::Classification): Likewise.
512 (Output_data_dynamic::classification_): Renamed offset_.
513 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
514 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
515 (Target_x86_64::make_plt_section): New function.
516 (Target_x86_64::reserve_tlsdesc_entries): New function.
517 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
518 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
519 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
520 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
521 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
522 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
523 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
524 add extra PLT entry for TLS descriptors.
525 (Output_data_plt_x86_64::got_): New field.
526 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
527 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
528 fields.
529 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
530 descriptors.
531 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
532 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
533 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
534 R_386_TLS_DESC_CALL relocations.
535 (Target_x86_64::Scan::global): Likewise.
536 (Target_x86_64::do_finalize_sections): Add dynamic table entries
537 for TLS descriptors.
538 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
539 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
540 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
541 GD-to-IE relaxation.
542 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
543 and TLS_DESCRIPTORS.
544 * Makefile.in: Rebuild.
545 * configure: Rebuild.
546 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
547 (tls_test_shared2.so): New target.
548 (tls_shared_gd_to_ie_test_SOURCES): New variable.
549 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
550 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
551 (tls_shared_gd_to_ie_test_LDADD): New variable.
552 (tls_shared_gnu2_gd_to_ie_test): New target.
553 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
554 New targets.
555 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
556 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
557 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
558 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
559 (tls_shared_gnu2_test): New target.
560 (tls_test_gnu2_shared.so): New target.
561 (tls_shared_gnu2_test_SOURCES): New variable.
562 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
563 (tls_shared_gnu2_test_LDFLAGS): New variable.
564 (tls_shared_gnu2_test_LDADD): New variable.
565 * testsuite/Makefile.in: Rebuild.
566 * testsuite/Makefile.
567
568 2008-04-11 Ian Lance Taylor <iant@google.com>
569
570 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
571 justsyms.t.
572 * testsuite/Makefile.in: Rebuild.
573
574 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
575 long.
576 * testsuite/script_test_2.cc (main): Adjust test.
577
578 2008-04-11 David S. Miller <davem@davemloft.net>
579 Ian Lance Taylor <iant@google.com>
580
581 * options.h (General_options): Add entries for '-Y' and
582 '-relax'.
583 * options.cc (General_options:finalize): If -Y was used, add those
584 entries to the library path instead of the default "/lib" and
585 "/usr/lib".
586
587 2008-04-11 David S. Miller <davem@davemloft.net>
588
589 * testsuite/justsyms.t: Start at 0x100.
590 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
591 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
592 long.
593 * testsuite/script_test_2.cc: Adjust string and section length
594 checks.
595
596 2008-04-09 Ian Lance Taylor <iant@google.com>
597
598 PR gold/5996
599 * script-sections.cc (Sections_element::allocate_to_segment): Add
600 orphan parameter.
601 (Output_section_definition::allocate_to_segment): Likewise.
602 (Orphan_output_section::allocate_to_segment): Likewise.
603 (Script_sections::attach_sections_using_phdrs_clause): Don't
604 propagate non-PT_LOAD segments to orphan sections.
605 * testsuite/Makefile.am (script_test_3.stdout): Generate using
606 readelf rather than objdump.
607 * testsuite/script_test_3.sh: Adjust accordingly. Test that
608 .interp section and PT_INTERP segment are the same size.
609 * testsuite/Makefile.in: Rebuild.
610
611 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
612 aliases for symbols defined in the same object.
613 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
614 (weak_alias_test_SOURCES): New variable.
615 (weak_alias_test_DEPENDENCIES): New variable.
616 (weak_alias_test_LDFLAGS): New variable.
617 (weak_alias_test_LDADD): New variable.
618 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
619 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
620 (weak_alias_test_3.o): New target.
621 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
622 * testsuite/weak_alias_test_main.cc: New file.
623 * testsuite/weak_alias_test_1.cc: New file.
624 * testsuite/weak_alias_test_2.cc: New file.
625 * testsuite/weak_alias_test_3.cc: New file.
626
627 2008-04-08 Ian Lance Taylor <iant@google.com>
628
629 * options.h (class General_options): Add --noinhibit-exec option.
630 * main.cc (main): Check --noinhibit-exec.
631
632 * options.h (class General_options): Define --wrap as a special
633 option. Add wrap_symbols_ field.
634 (General_options::any_wrap_symbols): New function.
635 (General_options::is_wrap_symbol): New function.
636 * options.cc (General_options::parse_wrap): New function.
637 (General_options::General_options): Initialize wrap_symbols_.
638 * symtab.cc (Symbol_table::wrap_symbol): New function.
639 (Symbol_table::add_from_object): Handle --wrap.
640 * symtab.h (class Symbol_table): Declare wrap_symbol.
641 * target.h (Target::wrap_char): New function.
642 (Target::Target_info): Add wrap_char field.
643 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
644 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
645 * testsuite/testfile.cc (Target_test::test_target_info):
646 Likewise.
647
648 * errors.cc (Errors::undefined_symbol): Mention symbol version if
649 there is one.
650
651 * layout.h (class Layout): Add added_eh_frame_data_ field.
652 * layout.cc (Layout::Layout): Initialize new field.
653 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
654 output section until we find a section we merged successfully.
655 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
656 that the size be non-zero.
657
658 * merge.cc (Object_merge_map::get_output_offset): Remove inline
659 qualifier.
660
661 2008-04-08 Craig Silverstein <csilvers@google.com>
662
663 * configure.ac: Export new conditional variable HAVE_ZLIB.
664 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
665 on HAVE_ZLIB.
666 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
667 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
668
669 2008-04-07 Ian Lance Taylor <iant@google.com>
670
671 * version.cc (version_string): Set to "1.5".
672
673 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
674 Add issued_non_pic_error_ field. Declare check_non_pic.
675 (Target_x86_64::Scan::check_non_pic): New function.
676 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
677 (Target_x86_64::Scan::global): Likewise.
678
679 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
680 addend parameter. Change caller. Handle merge sections.
681 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
682 Address to Addend. Don't add in the result of
683 local_section_offset, pass down the addend and use the returned
684 value.
685 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
686 Update declarations of local_section_offset and symbol_value.
687 * testsuite/two_file_test_1.cc (t18): New function.
688 * testsuite/two_file_test_2.cc (f18): New function.
689 * testsuite/two_file_test_main.cc (main): Call t18.
690 * testsuite/two_file_test.h (t18, f18): Declare.
691
692 * configure.ac: Don't test for objdump, c++filt, or readelf.
693 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
694 conditionals.
695 (TEST_READELF): New variable.
696 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
697 (check_PROGRAMS): Add two_file_strip_test.
698 (two_file_strip_test): New target.
699 (check_PROGRAMS): Add two_file_same_shared_strip_test.
700 (two_file_same_shared_strip_test_SOURCES): New variable.
701 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
702 (two_file_same_shared_strip_test_LDFLAGS): New variable.
703 (two_file_same_shared_strip_test_LDADD): New variable.
704 (two_file_shared_strip.so): New target.
705 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
706 (ver_test_5.syms, ver_test_7.syms): Likewise.
707 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
708 (strip_test_3.stdout): Use TEST_OBJDUMP.
709 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
710
711 2008-04-04 Cary Coutant <ccoutant@google.com>
712
713 * symtab.h (Symbol::is_weak_undefined): New function.
714 (Symbol::is_strong_undefined): New function.
715 (Symbol::is_absolute): New function.
716 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
717 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
718 absolute symbols.
719 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
720 (weak_undef_test): New target.
721 * testsuite/Makefile.in: Rebuild.
722 * testsuite/weak_undef_file1.cc: New file.
723 * testsuite/weak_undef_file2.cc: New file.
724 * testsuite/weak_undef_test.cc: New file.
725
726 2008-04-03 Craig Silverstein <csilvers@google.com>
727
728 * compressed_output.h (class Output_compressed_section): Use
729 unsigned buffer.
730 * compressed_output.cc (zlib_compress): Use unsigned buffers,
731 add zlib header.
732 (zlib_compressed_suffix): Removed.
733 (Output_compressed_section::set_final_data_size): Use unsigned
734 buffers.
735 * testsuite/Makefile.am (flagstest_compress_debug_sections):
736 Fix linker invocation.
737 (flagstest_o_specialfile_and_compress_debug_sections):
738 Likewise.
739 * testsuite/Makefile.in: Regenerated.
740
741 2008-04-02 David S. Miller <davem@davemloft.net>
742
743 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
744 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
745
746 2008-04-02 Craig Silverstein <csilvers@google.com>
747
748 * TODO: New file.
749
750 2008-04-02 Ian Lance Taylor <iant@google.com>
751
752 * fileread.cc (File_read::find_view): Add byteshift and vshifted
753 parameters. Update for new key type to views_. Change all
754 callers.
755 (File_read::read): Adjust for byteshift in returned view.
756 (File_read::add_view): New function, broken out of
757 find_and_make_view.
758 (File_read::make_view): New function, broken out of
759 find_and_make_view.
760 (File_read::find_or_make_view): Add offset and aligned
761 parameters. Rewrite accordingly. Change all callers.
762 (File_read::get_view): Add offset and aligned parameters. Adjust
763 for byteshift in return value.
764 (File_read::get_lasting_view): Likewise.
765 * fileread.h (class File_read): Update declarations.
766 (class File_read::View): Add byteshift_ field. Add byteshift to
767 constructor. Add byteshift method.
768 * archive.h (Archive::clear_uncached_views): New function.
769 (Archive::get_view): Add aligned parameter. Change all callers.
770 * object.h (Object::get_view): Add aligned parameter. Change all
771 callers.
772 (Object::get_lasting_view): Likewise.
773
774 * fileread.cc (File_read::release): Don't call clear_views if
775 there are multiple objects.
776 * fileread.h (File_read::clear_uncached_views): New function.
777 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
778 on the archive.
779
780 2008-03-31 Cary Coutant <ccoutant@google.com>
781
782 Add thin archive support.
783 * archive.cc (Archive::armagt): New const.
784 (Archive::setup): Remove task parameter and calls to unlock.
785 (Archive::unlock_nested_archives): New function.
786 (Archive::read_header): Add nested_off parameter. Change
787 all callers.
788 (Archive::interpret_header): Likewise.
789 (Archive::include_all_members): Change to handle thin
790 archives.
791 (Archive::include_member): Likewise.
792 * archive.h (Archive::Archive): Add new parameters and
793 initializers.
794 (Archive::armagt): New const.
795 (Archive::setup): Remove task parameter.
796 (Archive::unlock_nested_archives): New function.
797 (Archive::read_header): Add nested_off parameter.
798 (Archive::interpret_header): Likewise.
799 (Archive::Nested_archive_table): New typedef.
800 (Archive::is_thin_archive_): New field.
801 (Archive::nested_archives_): New field.
802 (Archive::options_): New field.
803 (Archive::dirpath_): New field.
804 (Archive::task_): New field.
805 * readsyms.cc (Read_symbols::do_read_symbols): Add check
806 for thin archives. Pass additional parameters to
807 Archive::Archive. Unlock the archive file after calling
808 Archive::setup.
809
810 2008-03-29 Ian Lance Taylor <iant@google.com>
811
812 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
813 version symbol to be local.
814 * testsuite/ver_test_4.sh: New file.
815 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
816 (check_DATA): Add ver_test_4.syms.
817 (ver_test_4.syms): New target.
818 * testsuite/Makefile.in: Rebuild.
819
820 * output.cc
821 (Output_section::Input_section_sort_entry::has_priority): New
822 function.
823 (Output_section::Input_section_sort_entry::match_file_name): New
824 function.
825 (Output_section::Input_section_sort_entry::match_section_name):
826 Remove.
827 (Output_section::Input_section_sort_entry::match_section_name_prefix):
828 Remove.
829 (Output_section::Input_section_sort_entry::match_section_file):
830 Remove.
831 (Output_section::Input_section_sort_compare::operator()): Rewrite
832 using new Input_section_sort_entry functions. Sort crtbegin and
833 crtend first. Sort sections with no priority before sections with
834 a priority.
835 * testsuite/initpri1.c (d3): Check j != 4.
836 (cd5): New constructor/destructor function.
837 (main): Check j != 2.
838
839 * symtab.cc (Symbol_table::add_from_object): If we don't use the
840 new symbol when resolving, don't call set_is_default.
841 * testsuite/ver_test_7.cc: New file.
842 * testsuite/ver_test_7.sh: New file.
843 * testsuite/Makefile.am (ver_test_7.so): New target.
844 (ver_test_7.o): New target.
845 (check_SCRIPTS): Add ver_test_7.sh.
846 (check_DATA): Add ver_test_7.syms.
847 (ver_test_7.syms): New target.
848
849 2008-03-28 Ian Lance Taylor <iant@google.com>
850
851 * layout.cc (Layout::layout): If we see an input section with a
852 name that needs sorting, set the must_sort flag for the output
853 section.
854 (Layout::make_output_section): If the name of the output section
855 indicates that it might require sorting, set the may_sort flag.
856 * output.h (Output_section::may_sort_attached_input_sections): New
857 function.
858 (Output_section::set_may_sort_attached_input_sections): New
859 function.
860 (Output_section::must_sort_attached_input_sections): New
861 function.
862 (Output_section::set_must_sort_attached_input_sections): New
863 function.
864 (class Output_section): Declare Input_section_sort_entry. Define
865 Input_section_sort_compare. Declare
866 sort_attached_input_sections. Add new fields:
867 may_sort_attached_input_sections_,
868 must_sort_attached_input_sections_,
869 attached_input_sections_are_sorted_.
870 * output.cc (Output_section::Output_section): Initialize new
871 fields.
872 (Output_section::add_input_section): Add an entry to
873 input_sections_ if may_sort or must_sort are true.
874 (Output_section::set_final_data_size): Call
875 sort_attached_input_sections if necessary.
876 (Output_section::Input_section_sort_entry): Define new class.
877 (Output_section::Input_section_sort_compare::operator()): New
878 function.
879 (Output_section::sort_attached_input_sections): New function.
880 * configure.ac: Check whether the compiler supports constructor
881 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
882 * testsuite/initpri1.c: New file.
883 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
884 CONSTRUCTOR_PRIORITY.
885 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
886 (initpri1_LDFLAGS): New variable.
887 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
888
889 2008-03-27 Ian Lance Taylor <iant@google.com>
890
891 * common.cc (Sort_commons::operator): Correct sorting algorithm.
892 * testsuite/common_test_1.c: New file.
893 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
894 (common_test_1_SOURCES): New variable.
895 (common_test_1_DEPENDENCIES): New variable.
896 (common_test_1_LDFLAGS): New variable.
897
898 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
899 and commons_ correctly when NAME/VERSION does not override
900 NAME/NULL.
901 * testsuite/ver_test_6.c: New file.
902 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
903 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
904 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
905
906 2008-03-26 Ian Lance Taylor <iant@google.com>
907
908 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
909 of an undefined symbol from a version script.
910 * testsuite/Makefile.am (ver_test_5.so): New target.
911 (ver_test_5.o): New target.
912 (check_SCRIPTS): Add ver_test_5.sh.
913 (check_DATA): Add ver_test_5.syms.
914 (ver_test_5.syms): New target.
915 * testsuite/ver_test_5.cc: New file.
916 * testsuite/ver_test_5.script: New file.
917 * testsuite/ver_test_5.sh: New file.
918 * Makefile.in, testsuite/Makefile.in: Rebuild.
919
920 PR gold/5986
921 Fix problems building gold with gcc 4.3.0.
922 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
923 (gold_error_at_location, gold_warning_at_location): Use it.
924 * configure.ac: Check whether we can compile and use a template
925 function with a printf attribute.
926 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
927 when jumping over bytes.
928 * object.cc: Instantiate Object::read_section_data.
929 * debug.h: Include <cstring>
930 * dwarf_reader.cc: Include <algorithm>
931 * main.cc: Include <cstring>.
932 * options.cc: Include <cstring>.
933 * output.cc: Include <cstring>.
934 * script.cc: Include <cstring>.
935 * script.h: Include <string>.
936 * symtab.cc: Include <cstring> and <algorithm>.
937 * target-select.cc: Include <cstring>.
938 * version.cc: Include <string>.
939 * testsuite/testmain.cc: Include <cstdlib>.
940 * configure, config.in: Rebuild.
941
942 2008-03-25 Ian Lance Taylor <iant@google.com>
943
944 * options.cc: Include "../bfd/bfdver.h".
945 (options::help): Print bug reporting address.
946
947 * version.cc (print_version): Adjust output for current value of
948 BFD_VERSION_STRING.
949
950 * NEWS: New file.
951
952 * options.cc (options::help): Print list of supported targets.
953 * target-select.h: Include <vector>.
954 (class Target_selector): Make machine_, size_, and is_big_endian_
955 fields const. Add bfd_name_ and instantiated_target_ fields.
956 (Target_selector::Target_selector): Add bfd_name parameter.
957 (Target_selector::recognize): Make non-virtual, call
958 do_recognize.
959 (Target_selector::recognize_by_name): Make non-virtual, call
960 do_recognize_by_name.
961 (Target_selector::supported_names): New function.
962 (Target_selector::bfd_name): New function.
963 (Target_selector::do_instantiate_target): New pure virtual
964 function.
965 (Target_selector::do_recognize): New virtual function.
966 (Target_selector::do_recognize_by_name): New virtual function.
967 (Target_selector::instantiate_target): New private function.
968 (supported_target_names): Declare.
969 * target-select.cc (Target_selector::Target_selector): Update for
970 new parameter and fields.
971 (select_target_by_name): Check that the name matches before
972 calling recognize_by_name.
973 (supported_target_names): New function.
974 * i386.cc (class Target_selector_i386): Update Target_selector
975 constructor call. Remove recognize and recognize_by_name. Add
976 do_instantiate_target.
977 * x86_64.cc (class Target_selector_x86_64): Likewise.
978 * testsuite/testfile.cc (class Target_selector_test): Update for
979 changes to Target_selector.
980
981 * README: Rewrite, with some notes on unsupported features.
982
983 2008-03-24 Cary Coutant <ccoutant@google.com>
984
985 * i386.cc (Target_i386::Got_type): New enum declaration.
986 (Target_i386::Scan::local): Updated callers of Output_data_got
987 member functions.
988 (Target_i386::Scan::global): Likewise.
989 (Target_i386::Relocate::relocate): Likewise.
990 (Target_i386::Relocate::relocate_tls): Likewise.
991 * object.h (Got_offset_list): New class.
992 (Sized_relobj::local_has_got_offset): Added got_type parameter.
993 (Sized_relobj::local_got_offset): Likewise.
994 (Sized_relobj::set_local_got_offset): Likewise.
995 (Sized_relobj::local_has_tls_got_offset): Removed.
996 (Sized_relobj::local_tls_got_offset): Removed.
997 (Sized_relobj::set_local_tls_got_offset): Removed.
998 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
999 * output.cc (Output_data_got::add_global): Added got_type parameter.
1000 (Output_data_got::add_global_with_rel): Likewise.
1001 (Output_data_got::add_global_with_rela): Likewise.
1002 (Output_data_got::add_global_pair_with_rel): New function.
1003 (Output_data_got::add_global_pair_with_rela): New function.
1004 (Output_data_got::add_local): Added got_type parameter.
1005 (Output_data_got::add_local_with_rel): Likewise.
1006 (Output_data_got::add_local_with_rela): Likewise.
1007 (Output_data_got::add_local_pair_with_rel): New function.
1008 (Output_data_got::add_local_pair_with_rela): New function.
1009 (Output_data_got::add_global_tls): Removed.
1010 (Output_data_got::add_global_tls_with_rel): Removed.
1011 (Output_data_got::add_global_tls_with_rela): Removed.
1012 (Output_data_got::add_local_tls): Removed.
1013 (Output_data_got::add_local_tls_with_rel): Removed.
1014 (Output_data_got::add_local_tls_with_rela): Removed.
1015 * output.h (Output_data_got::add_global): Added got_type parameter.
1016 (Output_data_got::add_global_with_rel): Likewise.
1017 (Output_data_got::add_global_with_rela): Likewise.
1018 (Output_data_got::add_global_pair_with_rel): New function.
1019 (Output_data_got::add_global_pair_with_rela): New function.
1020 (Output_data_got::add_local): Added got_type parameter.
1021 (Output_data_got::add_local_with_rel): Likewise.
1022 (Output_data_got::add_local_with_rela): Likewise.
1023 (Output_data_got::add_local_pair_with_rel): New function.
1024 (Output_data_got::add_local_pair_with_rela): New function.
1025 (Output_data_got::add_global_tls): Removed.
1026 (Output_data_got::add_global_tls_with_rel): Removed.
1027 (Output_data_got::add_global_tls_with_rela): Removed.
1028 (Output_data_got::add_local_tls): Removed.
1029 (Output_data_got::add_local_tls_with_rel): Removed.
1030 (Output_data_got::add_local_tls_with_rela): Removed.
1031 * resolve.cc (Symbol::override_base_with_special): Removed
1032 reference to has_got_offset_ field.
1033 * symtab.cc (Symbol::init_fields): Replaced initialization
1034 of got_offset_ with got_offsets_. Removed initialization
1035 of has_got_offset_
1036 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
1037 (Symbol::got_offset): Likewise.
1038 (Symbol::set_got_offset): Likewise.
1039 (Symbol::has_tls_got_offset): Removed.
1040 (Symbol::tls_got_offset): Removed.
1041 (Symbol::set_tls_got_offset): Removed.
1042 (Symbol::got_offset_): Removed.
1043 (Symbol::tls_mod_got_offset_): Removed.
1044 (Symbol::tls_pair_got_offset_): Removed.
1045 (Symbol::got_offsets_): New field.
1046 (Symbol::has_got_offset): Removed.
1047 (Symbol::has_tls_mod_got_offset): Removed.
1048 (Symbol::has_tls_pair_got_offset): Removed.
1049 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
1050 (Target_x86_64::Scan::local): Updated callers of Output_data_got
1051 member functions.
1052 (Target_x86_64::Scan::global): Likewise.
1053 (Target_x86_64::Relocate::relocate): Likewise.
1054 (Target_x86_64::Relocate::relocate_tls): Likewise.
1055
1056 2008-03-25 Ben Elliston <bje@au.ibm.com>
1057
1058 * yyscript.y: Fix spelling error in comment.
1059
1060 2008-03-24 Ian Lance Taylor <iant@google.com>
1061
1062 * options.h (class General_options): Define build_id option.
1063 * layout.h (class Layout): Declare write_build_id, create_note,
1064 create_build_id. Add build_id_note_ member.
1065 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
1066 "libiberty.h", "md5.h", "sha1.h".
1067 (Layout::Layout): Initialize eh_frame_data_,
1068 eh_frame_hdr_section_, and build_id_note_.
1069 (Layout::finalize): Call create_build_id.
1070 (Layout::create_note): New function, broken out of
1071 Layout::create_gold_note.
1072 (Layout::create_gold_note): Call create_note.
1073 (Layout::create_build_id): New function.
1074 (Layout::write_build_id): New function.
1075 (Close_task_runner::run): Call write_build_id.
1076
1077 * x86_64.cc: Correct license to GPLv3.
1078
1079 2008-03-23 Ian Lance Taylor <iant@google.com>
1080
1081 * options.cc: Include "demangle.h".
1082 (parse_optional_string): New function.
1083 (parse_long_option): Handle takes_optional_argument.
1084 (parse_short_option): Update dash_z initializer. Handle
1085 takes_optional_argument.
1086 (General_options::General_options): Initialize do_demangle_.
1087 (General_options::finalize): Set do_demangle_. Handle demangling
1088 style.
1089 * options.h (parse_optional_string): Declare.
1090 (struct One_option): Add optional_arg field. Update constructor.
1091 Update call constructor calls. Add takes_optional_argument
1092 function.
1093 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
1094 (DEFINE_optional_string): Define.
1095 (General_options::demangle): Change from DEFINE_bool to
1096 DEFINE_optional_string.
1097 (General_options::no_demangle): New function.
1098 (General_options::do_demangle): New function.
1099 (General_options::set_do_demangle): New function.
1100 (General_options::execstack_status_): Move definition to end of
1101 class definition.
1102 (General_options::static_): Likewise.
1103 (General_options::do_demangle_): New field.
1104 * object.cc (big_endian>::get_symbol_location_info): Call
1105 Options::do_demangle, not Options::demangle.
1106 * symtab.cc (demangle): Likewise.
1107
1108 2008-03-22 Ian Lance Taylor <iant@google.com>
1109
1110 * gold.h: Include <cstddef> and <sys/types.h>
1111 * options.h: Include <cstring>.
1112
1113 2008-03-21 Ian Lance Taylor <iant@google.com>
1114
1115 * Added source code to GNU binutils.
1116