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