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