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