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