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