* symtab.cc (Symbol_table::resolve): Remove version parameter.
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
95d14cd3
ILT
12008-07-23 Ian Lance Taylor <iant@google.com>
2
3 * symtab.cc (Symbol_table::resolve): Remove version parameter.
4 Change all callers.
5 * symtab.h (class Symbol_table): Update declaration.
6 * testsuite/ver_test_9.cc: New file.
7 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
8 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
9 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
10 (ver_test_9.so, ver_test_9.o): New targets.
11 * testsuite/Makefile.in: Rebuild.
12
92de84a6
ILT
132008-07-22 Ian Lance Taylor <iant@google.com>
14
34810851
ILT
15 * options.h (class General_options): Define --check-sections.
16 * layout.cc (Layout::set_segment_offsets): Handle
17 --check-sections.
18
af6156ef
ILT
19 * options.h (class General_options): Define -n/--nmagic and
20 -N/--omagic.
21 * options.cc (General_options::finalize): For -n/--nmagic or
22 -N/--omagic, set -static.
23 * layout.cc (Layout::attach_allocated_section_to_segment): If
24 -N/--omagic, don't put read-only and read-write sections in
25 different segments.
26 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
27 finding a read-only segment.
28 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
29 don't set the minimum segment alignment to the common page size,
30 and don't set the file offset to the address modulo the page size.
31 * script-sections.cc (Script_sections::create_segments): If
32 -n/--omagic, don't put read-only and read-write sections in
33 different segments.
34
92de84a6
ILT
35 * cref.cc: New file.
36 * cref.h: New file.
37 * options.h (class General_options): Add --print-symbol-counts.
38 * main.cc (main): Issue defined symbol report if requested.
39 * archive.cc (Archive::interpret_header): Make into a const member
40 function.
41 (Archive::add_symbols): Call Input_objects::archive_start and
42 archive_stop.
43 (Archive::const_iterator): Define new class.
44 (Archive::begin, Archive::end): New functions.
45 (Archive::include_all_members): Rewrite to use iterator.
46 (Archive::count_members): New function.
47 * archive.h (class Archive): Update declarations.
48 (Archive::filename): New function.
49 * object.cc: Include "cref.h".
50 (Sized_relobj::Sized_relobj): Initialize defined_count_.
51 (Sized_relobj::do_get_global_symbol_counts): New function.
52 (Input_objects::add_object): Add object to cross-referencer.
53 (Input_objects::archive_start): New function.
54 (Input_objects::archive_stop): New function.
55 (Input_objects::print_symbol_counts): New function.
56 * object.h: Declare Cref and Archive.
57 (Object::get_global_symbol_counts): New function.
58 (Object::do_get_global_symbol_counts): New pure virtual function.
59 (class Sized_relobj): Add defined_count_ field. Update
60 declarations.
61 (class Input_objects): Add cref_ field. Update constructor.
62 Update declarations.
63 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
64 defined_count_.
65 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
66 symbol counts.
67 (Sized_dynobj::do_get_global_symbol_counts): New function.
68 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
69 defined_count_. Update declarations. Define Symbols typedef.
70 * symtab.cc (Symbol_table::add_from_relobj): Add defined
71 parameter. Change all callers.
72 (Symbol_table::add_from_dynobj): Add sympointers and defined
73 parameters. Change all callers.
74 * symtab.h (class Symbol_table): Update declarations.
75 * Makefile.am (CCFILES): Add cref.cc.
76 (HFILES): Add cref.h.
77 * Makefile.in: Rebuild.
78
3f7c5e1d
CD
792008-07-22 Simon Baldwin <simonb@google.com>
80
81 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
82 to zero when writing undefined symbols.
83
e0b64032
ILT
842008-07-22 Ian Lance Taylor <iant@google.com>
85
86 * output.cc (Output_section::add_input_section): Don't try to
87 merge empty merge sections.
88
096b02cf
CS
892008-07-21 Craig Silverstein <csilvers@google.com>
90
91 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
92 Include symbol version in error message.
93
1d1f116d
CD
942008-07-20 Chris Demetriou <cgd@google.com>
95
96 * configure.ac (gold_cv_c_random_seed): New configured variable.
97 (RANDOM_SEED_CFLAGS): New substituted variable.
98 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
99 * configure: Rebuild.
100 * Makefile.in: Likewise.
101 * testsuite/Makefile.in: Likewise.
102
a18f591e
ILT
1032008-07-18 Ian Lance Taylor <iant@google.com>
104
105 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
106 where we see NAME/NULL and NAME/VERSION as separate symbols.
107 * testsuite/ver_test_main.cc (main): Call t4.
108 (t4, t4_2a): Define.
109 * testsuite/ver_test_2.cc (t4_2): Define.
110 * testsuite/ver_test_2.script: Put t4_2a in VER2.
111 * testsuite/ver_test_4.cc (t4_2a): Define.
112 * testsuite/ver_test_4.script: Put t4_2a in VER2.
113 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
114
c6e3f6ed
ILT
1152008-07-17 Ian Lance Taylor <iant@google.com>
116
117 * dynobj.cc (Versions::add_def): If we give an error about a
118 missing version, go ahead and create the version anyhow.
119
ef9beddf
ILT
1202008-07-10 Ian Lance Taylor <iant@google.com>
121
122 Handle output sections with more than 0x7fffffff bytes.
123 * object.h (class Relobj): Change map_to_output_ to
124 output_sections_, and just keep a section pointer. Change all
125 uses. Move comdat group support to Sized_relobj.
126 (Relobj::is_section_specially_mapped): Remove.
127 (Relobj::output_section): Remove poff parameter. Change all
128 callers.
129 (Relobj::output_section_offset): New function.
130 (Relobj::set_section_offset): Rewrite.
131 (Relobj::map_to_output): Remove.
132 (Relobj::output_sections): New function.
133 (Relobj::do_output_section_offset): New pure virtual function.
134 (Relobj::do_set_section_offset): Likewise.
135 (class Sized_relobj): Add section_offsets_ field. Add comdat
136 group support from Relobj. Update declarations.
137 (Sized_relobj::get_output_section_offset): New function.
138 (Sized_relobj::do_output_section_offset): New function.
139 (Sized_relobj::do_set_section_offset): New function.
140 * object.cc (Relobj::output_section_address): Remove.
141 (Sized_relobj::Sized_relobj): Initialize new fields.
142 (Sized_relobj::include_section_group): Cast find_kept_object to
143 Sized_relobj.
144 (Sized_relobj::include_linkonce_section): Likewise.
145 (Sized_relobj::do_layout): Use separate arrays for output section
146 and output offset.
147 (Sized_relobj::do_count_local_symbols): Change map_to_output to
148 output_sections.
149 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
150 output_sections and section_offsets.
151 (Sized_relobj::write_local_symbols): Likewise.
152 (map_to_kept_section): Compute output address directly.
153 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
154 output_sections and section_offsets.
155 (Sized_relobj::write_sections): Likewise.
156 (Sized_relobj::relocate_sections): Likewise.
157 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
158 * output.h (class Output_reloc): Update declarations. Change
159 u2_.relobj to Sized_relobj*.
160 (class Output_data_reloc): Change add functions to use
161 Sized_relobj*.
162 * output.cc (Output_reloc::Output_reloc): Change relobj to
163 Sized_relobj*.
164 (Output_reloc::local_section_offset): Change return type to
165 Elf_Addr. Use get_output_section_offset.
166 (Output_reloc::get_address): Likewise.
167 (Output_section::is_input_address_mapped): Don't call
168 is_section_specially_mapped.
169 (Output_section::output_offset): Likewise.
170 (Output_section::output_address): Likewise.
171 (Output_section::starting_output_address): Likewise.
172 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
173 parameter to Sized_relobj*.
174 (Copy_relocs::need_copy_reloc): Likewise.
175 (Copy_relocs::save): Likewise.
176 * copy-relocs.h (class Copy_relocs): Update declarations.
177 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
178 Sized_relobj*. Change relobj_ field to Sized_relobj*.
179 * target-reloc.h (relocate_for_relocatable): Change
180 offset_in_output_section type to Elf_Addr. Change code that uses
181 it as well.
182 * layout.cc (Layout::layout): Always set *off.
183 * mapfile.cc (Mapfile::print_input_section): Use
184 output_section_offset.
185 * i386.cc (Target_i386::copy_reloc): Change object parameter to
186 Sized_relobj*.
187 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
188 * sparc.cc (Target_sparc::copy_reloc): Likewise.
189 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
190
5cb66f97
ILT
1912008-07-03 Ian Lance Taylor <iant@google.com>
192
193 * layout.cc (Layout::include_section): Do not discard unrecognized
194 SHT_STRTAB sections.
195
afe47622
CS
1962008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
197
198 * script.cc (Lex::can_continue_name): Make '?' allowable in
199 version-script names.
200 * testsuite/version_script.map: Change glob pattern to use '?'
201
5adf9721
ILT
2022008-06-30 Manish Singh <yosh@gimp.org>
203
204 PR 6585
205 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
206 Correct typo.
207
e6fde208
ILT
2082008-06-30 Ian Lance Taylor <iant@google.com>
209
210 PR 6660
211 PR 6682
212 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
213 versions]: Don't try to read the value in the contents, since we
214 don't use it. Use the template endianness when writing.
215
3f2e6a2d
CC
2162008-06-25 Cary Coutant <ccoutant@google.com>
217
218 * fileread.cc (File_read::make_view): Assert on zero-length view.
219 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
220 symbol table when there are no symbols to read.
221
c43d3a48
CS
2222008-06-23 Craig Silverstein <csilvers@google.com>
223
224 * version.cc (version_string): Bump to 1.7
225
5f494ea0
CS
2262008-06-18 Craig Silverstein <csilvers@google.com>
227
228 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
229 constant 0xFFFF to type Valtype.
230 (Powerpc_relocate_functions::rel16_ha): Likewise.
231
c42e122e
ILT
2322008-06-17 Ian Lance Taylor <iant@google.com>
233
f34787f8
ILT
234 * output.h (Output_section::Input_section): Initialize p2align_ to
235 zero for Output_section_data constructors.
236 (Output_section::Input_section::addralign): If not an input
237 section, return the alignment of the Output_section_data.
238 * testsuite/copy_test.cc: New file.
239 * testsuite/copy_test_1.cc: New file.
240 * testsuite/copy_test_2.cc: New file.
241 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
242 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
243 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
244 (copy_test_1_pic.o, copy_test_1.so): New targets.
245 (copy_test_2_pic.o, copy_test_2.so): New targets.
246 * testsuite/Makefile.in: Rebuild.
247
c42e122e
ILT
248 * script-sections.cc (Script_sections::place_orphan): Initialize
249 local variable exact.
250
ce3ac18a
DE
2512008-06-13 David Edelsohn <edelsohn@gnu.org>
252
253 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
254
42cacb20
DE
2552008-06-12 David Edelsohn <edelsohn@gnu.org>
256 David S. Miller <davem@davemloft.net>
257
258 * powerpc.cc: New file.
259 * Makefile.am (TARGETSOURCES): Add powerpc.cc
260 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
261 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
262 * Makefile.in: Rebuild.
263
7b308235
ILT
2642008-06-09 Ian Lance Taylor <iant@google.com>
265
266 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
267 <exception>.
268 (throwing, orig_terminate): New static variables.
269 (terminate_handler): New static function.
270 (t2): Set terminate handler.
271
f0b886e3
ILT
2722008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
273
274 PR 6584
275 * binary.cc (Binary_to_elf::sized_convert): Fix .data
276 alignment.
277
3e90f135
CC
2782008-05-30 Cary Coutant <ccoutant@google.com>
279
280 * archive.cc (Archive::include_all_members) Correct to step
281 over symbol table and extended name table in thin archives.
282
e09ad04a
ILT
2832008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
284
285 PR 6407
286 * target-reloc.h (relocate_for_relocatable): Fix new_offset
287 calculation.
288
62b01cb5
ILT
2892008-05-28 Caleb Howe <cshowe@google.com>
290
291 * reduced_debug_output.cc: New file.
292 * reduced_debug_output.h: New file.
92de84a6 293 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
294 * options.cc (General_options::finalize): Add strip_debug_non_line
295 to the strip heirarchy.
296 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
297 fields.
298 * layout.cc: Include "reduced_debug_output.h".
299 (Layout::Layout): Initialize new fields.
300 (line_only_debug_sections): New static array.
301 (is_lines_only_debug_sections): New static inline function.
302 (Layout::include_section): Handle --strip-debug-non-line.
303 (Layout::make_output_section): If --strip-debug-non-line, build
304 new output sections for .debug_abbrev and .debug_info.
305 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
306 gold. Warn about possible overflow.
307 (read_signed_LEB_128): Likewise.
308 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
309 (read_signed_LEB_128): Declare.
310 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
311 (HFILES): Add reduced_debug_output.h.
312 * Makefile.in: Rebuild.
313
7d9e3d98
ILT
3142008-05-21 Ian Lance Taylor <iant@google.com>
315
316 * mapfile.cc: New file.
317 * mapfile.h: New file.
318 * options.h (class General_options): Add -M/--print-map and -Map.
319 * options.cc (General_options::finalize): Make -M equivalent to
320 -Map -.
321 * main.cc: Include <cstdio> and "mapfile.h".
322 (main): Open mapfile if requested.
323 * gold.cc (class Middle_runner): Add mapfile_ field. Update
324 constructor. Change caller.
325 (queue_initial_tasks): Add mapfile parameter. Change caller.
326 (queue_middle_tasks): Likewise.
327 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
328 declarations.
329 * archive.cc: Include "mapfile.h".
330 (Archive::add_symbols): Add mapfile parameter. Change all
331 callers. Pass mapfile, symbol, and reason to include_member.
332 (Archive::include_all_members): Add mapfile parameter. Change all
333 callers.
334 (Archive::include_member): Add mapfile, sym, and why parameters.
335 Change all callers. Report inclusion to map file.
336 * archive.h: Include "fileread.h".
337 (class Archive): Update declarations.
338 (Archive::file): New const method.
339 (class Add_archive_symbols): Add mapfile_ field. Update
340 constructor. Change all callers.
341 * readsyms.h (class Read_symbols): Likewise.
342 (class Finish_group): Likewise.
343 (class Read_script): Likewise.
344 * common.cc: Include "mapfile.h".
345 (Symbol_table::allocate_commons): Add mapfile parameter. Change
346 all callers.
347 (Symbol_table::do_allocate_commons): Likewise.
348 (Symbol_table::do_allocate_commons_list): Likewise. Report common
349 symbol allocation to mapfile.
350 * common.h (class Allocate_commons_task): Add mapfile_ field.
351 Update constructor. Change all callers.
352 * symtab.h (class Symbol_table): Update declarations.
353 * layout.cc: Include "mapfile.h".
354 (Layout_task_runner::run): Print information to mapfile.
355 (Layout::create_gold_note): Change Output_data_fixed_space to
356 Output_data_zero_fill.
357 (Layout::create_build_id): Likewise.
358 (Layout::print_to_mapfile): New function.
359 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
360 constructor. Change caller.
361 (class Layout): Declare print_to_mapfile.
362 * output.cc (Output_section::Input_section::print_to_mapfile): New
363 function.
364 (Output_section::add_input_section): If producing a map, always
365 add to input_sections_ list.
366 (Output_section::do_print_to_mapfile): New function.
367 (Output_segment::print_sections_to_mapfile): New function.
368 (Output_segment::print_section_list_to_mapfile): New function.
369 * output.h: Include "mapfile.h".
370 (Output_data::print_to_mapfile): New function.
371 (Output_data::do_print_to_mapfile): New virtual function.
372 (Output_segment_headers::do_print_to_mapfile): New function.
373 (Output_file_header::do_print_to_mapfile): New function.
374 (Output_data_const::do_print_to_mapfile): New function.
375 (class Output_data_const_buffer): Add map_name_ field. Update
376 constructor. Change all callers. Add do_print_to_mapfile
377 function.
378 (class Output_data_fixed_space): Likewise.
379 (class Output_data_space): Likewise.
380 (class Output_data_zero_fill): New class.
381 (Output_data_strtab::do_print_to_mapfile): New function.
382 (Output_data_reloc_base::do_print_to_mapfile): New function.
383 (Output_relocatable_relocs::do_print_to_mapfile): New function.
384 (Output_data_group::do_print_to_mapfile): New function.
385 (Output_data_got::do_print_to_mapfile): New function.
386 (Output_data_dynamic::do_print_to_mapfile): New function.
387 (Output_symtab_xindex::do_print_to_mapfile): New function.
388 (class Output_section): Declare do_print_to_mapflie. Declare
389 print_to_mapfile in Input_section.
390 (class Output_segment): Declare new functions.
391 * object.h (Sized_relobj::symbol_count): New function.
392 * script-sections.cc
393 (Output_section_element_dot_assignment::set_section_addresses):
394 Change Output_data_fixed_space to Output_data_zero_fill.
395 (Output_data_expression::do_print_to_mapfile): New function.
396 * script.cc (read_input_script): Add mapfile parameter. Change
397 all callers.
398 * script.h (read_input_script): Update declaration.
399 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
400 (Eh_frame::do_print_to_mapfile): New function.
401 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
402 (Output_merge_string::do_print_to_mapfile): New function.
403 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
404 function.
405 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
406 function.
407 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
408 function.
409 * Makefile.am (CCFILES): Add mapfile.cc.
410 (HFILES): Add mapfile.h.
411 * Makefile.in: Rebuild.
412
9f1d377b
ILT
4132008-05-19 Ian Lance Taylor <iant@google.com>
414
415 * options.h (class General_options): Add -z relro.
416 * layout.cc (Layout::Layout): Initialize relro_segment_.
417 (Layout::add_output_section_data): Return the output section.
418 (Layout::make_output_section): Rcognize relro sections and mark
419 them appropriately.
420 (Layout::attach_allocated_section_to_segment): Put relro sections
421 in a PT_GNU_RELRO segment.
422 (Layout::create_initial_dynamic_sections): Mark the .dynamic
423 section as relro.
424 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
425 PT_TLS segments.
426 (Layout::linkonce_mapping): Map d.rel.ro.local to
427 .data.rel.ro.local.
428 (Layout::output_section_name): Us .data.rel.ro.local for any
429 section which begins with that.
430 * layout.h (class Layout): Update add_output_section_data
431 declaration. Add relro_segment_ field.
432 * output.cc (Output_section::Output_section): Initialize is_relro_
433 and is_relro_local_ fields.
434 (Output_segment::add_output_section): Group relro sections.
435 (Output_segment::is_first_section_relro): New function.
436 (Output_segment::maximum_alignment): If there is a relro section,
437 align the segment to the common page size.
438 (Output_segment::set_section_addresses): Track whether we are
439 looking at relro sections. If the last section is a relro
440 section, align to the common page size.
441 (Output_segment::set_section_list_addresses): Add in_relro
442 parameter. Change all callers. Align to the page size when
443 moving from relro to non-relro section.
444 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
445 segment.
446 * output.h (class Output_section): Add is_relro_ and
447 is_relro_local_ fields.
448 (Output_section::is_relro): New function.
449 (Output_section::set_is_relro): New function.
450 (Output_section::is_relro_local): New function.
451 (Output_section::set_is_relro_local): New function.
452 (class Output_segment): Update declarations.
453 * i386.cc (Target_i386::got_section): Mark .got section as relro.
454 * sparc.cc (Target_sparc::got_section): Likewise.
455 * x86_64.cc (Target_x86_64::got_section): Likewise.
456 * testsuite/relro_test_main.cc: New file.
457 * testsuite/relro_test.cc: New file.
458 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
459 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
460 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
461 (relro_test.so, relro_test_pic.o): New targets.
462 * testsuite/Makefile.in: Rebuild.
463
a984ee1d
ILT
4642008-05-16 Ian Lance Taylor <iant@google.com>
465
01676dcd
ILT
466 * output.cc (Output_segment::add_output_section): Remove front
467 parameter.
468 * output.h (class Output_segment): Remove
469 add_initial_output_section and overloaded add_output_section.
470 Update declaration of remaining add_output_section.
471 * layout.cc (Layout::create_interp): Call add_output_section
472 rather than add_initial_output_section.
473 (Layout::finish_dynamic_section): Likewise.
474
497897f9
ILT
475 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
476 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
477 know the dynamic type.
478 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
479 field. Initialize it in constructor.
480 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
481 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
482 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
483 reloc.
484
a984ee1d
ILT
485 * output.cc (Output_reloc::get_address): Change return type to
486 Elf_Addr.
487 * output.h (class Output_reloc): Update get_address declaration.
488 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
489 for section addresses.
490
55ba0940
ILT
4912008-05-09 Ian Lance Taylor <iant@google.com>
492
493 PR 6493
494 * gold.cc (gold_nomem): Use return value of write.
495
75517b77
ILT
4962008-05-08 Ian Lance Taylor <iant@google.com>
497
498 * symtab.c (Symbol::init_base_output_data): Add version
499 parameter. Change all callers.
500 (Symbol::init_base_output_segment): Likewise.
501 (Symbol::init_base_constant): Likewise.
502 (Symbol::init_base_undefined): Likewise.
503 (Sized_symbol::init_output_data): Likewise.
504 (Sized_symbol::init_output_segment): Likewise.
505 (Sized_symbol::init_constant): Likewise.
506 (Sized_symbol::init_undefined): Likewise.
507 (Symbol_table::do_define_in_output_data): If the new symbol has a
508 version, mark it as the default.
509 (Symbol_table::do_define_in_output_segment): Likewise.
510 (Symbol_table::do_define_as_constant): Likewise.
511 * symtab.h (class Symbol): Update declarations.
512 (class Sized_symbol): Likewise.
513 * resolve.cc (Symbol::override_version): New function.
c42e122e 514 (Symbol::override_base): Call override_version.
75517b77
ILT
515 (Symbol::override_base_with_special): Likewise.
516 * testsuite/ver_script_8.script: New file.
517 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
518 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
519 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
520 (ver_test_8_1.so, ver_test_8_2.so): New targets.
521
f1f70eae
ILT
5222008-05-06 Ian Lance Taylor <iant@google.com>
523
f3e9c5c5
ILT
524 PR 6049
525 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
526 functions.
527 (class General_options): Remove existing --undefined, and add
528 --no-undefined instead. Add new --undefined as synonym for -u.
529 * archive.cc (Archive::add_symbols): Check whether symbol was
530 named with -u.
531 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
532 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
533 all uses. Add IS_UNDEFINED. Update declarations to split
534 different versions of init_base. Declare init_base_undefined.
535 (Symbol::is_defined): Handle IS_UNDEFINED.
536 (Symbol::is_undefined): Likewise.
537 (Symbol::is_weak_undefined): Call is_undefined.
538 (Symbol::is_absolute): Handle IS_CONSTANT.
539 (class Sized_symbol): Update declarations to split different
540 versions of init. Declare init_undefined.
541 (class Symbol_table): Declare new functions.
542 * symtab.cc (Symbol::init_base_object): Rename from init_base.
543 Change all callers.
544 (Symbol::init_base_output_data): Likewise.
545 (Symbol::init_base_output_segment): Likewise.
546 (Symbol::init_base_constant): Likewise.
547 (Symbol::init_base_undefined): New function.
548 (Sized_symbol::init_object): Rename from init. Change all
549 callers.
550 (Sized_symbol::init_output_data): Likewise.
551 (Sized_symbol::init_output_segment): Likewise.
552 (Sized_symbol::init_constant): Likewise.
553 (Sized_symbol::init_undefined): New function.
554 (Symbol_table::add_undefined_symbols_from_command_line): New
555 function.
556 (Symbol_table::do_add_undefined_symbols_from_command_line): New
557 function.
558 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
559 (Symbol::output_section): Likewise.
560 (Symbol::set_output_section): Likewise.
561 (Symbol_table::sized_finalize_symbol): Likewise.
562 (Symbol_table::sized_write_globals): Likewise.
563 * resolve.cc (Symbol_table::should_override): Likewise.
564 (Symbol::override_base_with_special): Likewise.
565
8bdcdf2c
ILT
566 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
567 symbol, change it to have default visibility.
568 * testsuite/protected_1.cc: New file.
569 * testsuite/protected_2.cc: New file.
570 * testsuite/protected_3.cc: New file.
571 * testsuite/protected_main_1.cc: New file.
572 * testsuite/protected_main_2.cc: New file.
573 * testsuite/protected_main_3.cc: New file.
574 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
575 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
576 (protected_1_LDFLAGS, protected_1_LDADD): Define.
577 (protected_1.so): New target.
578 (protected_1_pic.o, protected_2_pic.o): New targets.
579 (protected_3_pic.o): New target.
580 (check_PROGRAMS): Add protected_2.
581 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
582 (protected_2_LDFLAGS, protected_2_LDADD): Define.
583 * testsuite/Makefile.in: Rebuild.
584
2b706932
ILT
585 * options.h (DEFINE_var): Add set_user_set_##varname__.
586 (DEFINE_bool_alias): New macro.
587 (class General_options): Define -Bstatic using DEFINE_bool_alias
588 rather than DEFINE_special. Add --undefined as an alias for -z
589 defs.
590 * options.cc (General_options::parse_Bstatic): Remove.
591
d82a5bcc
ILT
592 * options.h (class General_options): Add --fatal-warnings.
593 * main.cc (main): Implement --fatal-warnings.
594 * errors.h (Errors::warning_count): New function.
595
f1f70eae
ILT
596 * options.h (class General_options): Add -Bsymbolic-functions.
597 * symtab.h (Symbol::is_preemptible): Check for
598 -Bsymbolic-functions.
599
8825ac63
ILT
6002008-05-05 Ian Lance Taylor <iant@google.com>
601
d98bc257
ILT
602 * options.h (DEFINE_bool): For DASH_Z, create the negative option
603 as noVARNAME rather than no-VARNAME.
604 (class General_options): Add option -z combreloc.
605 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
606 get_address.
607 (Output_reloc::sort_before) [SHT_REL]: New function.
608 (Output_reloc::sort_before) [SHT_RELA]: New function.
609 (class Output_data_reloc_base): Add sort_relocs_ field. Define
610 Sort_relocs_comparison.
611 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
612 parameter. Change all callers.
613 (Output_data_reloc::Output_data_reloc) [both versions]: Add
614 sort_relocs parameter. Change all callers.
615 * output.cc (Output_reloc::get_address): New function, broken out
616 of write_rel.
617 (Output_reloc::write_rel): Call it.
618 (Output_reloc::compare): New function.
619 (Output_data_reloc_base::do_write): Optionally sort relocs.
620
60b2b4e7
ILT
621 * configure.ac: If targ_extra_obj is set, link it in.
622 * configure.tgt: Initialize all variables.
623 (x86_64*): Set targ_extra_obj and targ_extra_size.
624 * configure: Rebuild.
625
8825ac63
ILT
626 * object.cc (Sized_relobj::include_section_group): Adjust section
627 indexes read from group data. Build vector to pass to
628 layout_group.
629 * layout.cc (Layout::layout_group): Add flags and shndxes
630 parameters. Remove contents parameter. Change caller. Update
631 explicit instantiations.
632 * layout.h (class Layout): Update layout_group declaration.
633 * output.cc (Output_data_group::Output_data_group): Add flags and
634 input_shndxes parameters. Remove contents parameter. Change
635 caller.
636 (Output_data_group::do_write): Change input_sections_ to
637 input_shndxes_.
638 * output.h (class Output_data_group): Update constructor
639 declaration. Rename input_sections_ to input_shndxes_.
640 * testsuite/many_sections_test.cc: Add template.
641
e94cf127
CC
6422008-04-30 Cary Coutant <ccoutant@google.com>
643
4418b2d5
CC
644 * target-reloc.h (relocate_section): Fix dead-pointer bug.
645
e94cf127
CC
646 * layout.cc (Layout::include_section): Refactored check for debug
647 info section.
648 (Layout::add_comdat): Add new parameters. Change type
649 of signature parameter. Add object and shndx to signatures table.
650 (Layout::find_kept_object): New function.
651 * layout.h: Include <cstring>.
652 (Layout::is_debug_info_section): New function.
653 (Layout::add_comdat): Add new parameters.
654 (Layout::find_kept_object): New function.
655 (Layout::Kept_section): New struct.
656 (Layout::Signatures): Change type of map range.
657 * object.cc (Relobj::output_section_address): New function.
658 (Sized_relobj::include_section_group): Add new parameters. Change
659 calls to Layout::add_comdat. Change to build table of kept comdat
660 groups and table mapping discarded sections to kept sections.
661 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
662 (Sized_relobj::do_layout): Change calls to include_section_group and
663 include_linkonce_section.
664 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
665 value to zero when section is discarded.
666 (Sized_relobj::map_to_kept_section): New function.
667 * object.h (Relobj::output_section_address): New function.
668 (Relobj::Comdat_group): New type.
669 (Relobj::find_comdat_group): New function.
670 (Relobj::Comdat_group_table): New type.
671 (Relobj::Kept_comdat_section): New type.
672 (Relobj::Kept_comdat_section_table): New type.
673 (Relobj::add_comdat_group): New function.
674 (Relobj::set_kept_comdat_section): New function.
675 (Relobj::get_kept_comdat_section): New function.
676 (Relobj::comdat_groups_): New field.
677 (Relobj::kept_comdat_sections_): New field.
678 (Symbol_value::input_value): Update comment.
679 (Sized_relobj::map_to_kept_section) New function.
680 (Sized_relobj::include_linkonce_section): Add new parameter.
681 * target-reloc.h (Comdat_behavior): New type.
682 (get_comdat_behavior): New function.
683 (relocate_section): Add code to map a discarded section to the
684 corresponding kept section when applying a relocation.
685
e4e5049b
CS
6862008-04-30 Craig Silverstein <csilvers@google.com>
687
688 * dwarf_reader.cc (next_generation_count): New static var.
689 (Addr2line_cache_entry): New struct.
690 (addr2line_cache): New static var.
691 (Dwarf_line_info::one_addr2line): Added caching.
692 (Dwarf_line_info::clear_addr2line_cache): New function.
693 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
694 cache-size parameter.
695 (Dwarf_line_info::one_addr2line_cache): New function.
696 * symtab.cc (Symbol_table::detect_odr_violations): Pass
697 new cache-size argument to one_addr2line(), and clear cache.
698
d09e9154
CC
6992008-04-28 Cary Coutant <ccoutant@google.com>
700
701 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
702 R_386_PC8 relocations.
703
7ef73768
ILT
7042008-04-23 Ian Lance Taylor <iant@google.com>
705
55438702
ILT
706 * object.cc (Sized_relobj::include_section_group): Check for
707 invalid section group.
708
c165fb93
ILT
709 * object.cc (make_elf_object): Correct test for 64-bit ELF file
710 header size.
711
7ef73768
ILT
712 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
713 than read for file header.
714 * archive.cc (Archive::include_member): Likewise.
715
6194aaab
L
7162008-04-23 Paolo Bonzini <bonzini@gnu.org>
717
718 * aclocal.m4: Regenerate.
719 * configure: Regenerate.
720
d491d34e
ILT
7212008-04-19 Ian Lance Taylor <iant@google.com>
722
5ea2bac6
ILT
723 * version.cc (version_string): Bump to 1.6.
724
7bc3e21a
ILT
725 * testsuite/Makefile.am (many_sections_r_test): New target.
726 (many_sections_r_test_SOURCES): Remove.
727 (many_sections_r_test_DEPENDENCIES): Remove.
728 (many_sections_r_test_LDFLAGS): Remove.
729 (many_sections_r_test_LDADD): Remove.
730
7fcd3aa9
ILT
731 * object.cc (Sized_relobj::do_add_symbols): Always pass
732 local_symbol_count_ to add_from_relobj.
733
4c94d6ae
ILT
734 * testsuite/Makefile.am (many_sections_check.h): Only check one in
735 every thousand variables.
736 * testsuite/Makefile.in: Rebuild.
737
d491d34e
ILT
738 * object.cc (Xindex::initialize_symtab_xindex): New function.
739 (Xindex::read_symtab_xindex): New function.
740 (Xindex::sym_xindex_to_shndx): New function.
741 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
742 available.
743 (Sized_relobj::do_initialize_xindex): New function.
744 (Sized_relobj::do_read_symbols): Adjust section links.
745 (Sized_relobj::symbol_section_and_value): Add is_ordinary
746 parameter. Change all callers.
747 (Sized_relobj::include_section_group): Adjust section links and
748 symbol section indexes.
749 (Sized_relobj::do_layout): Adjust section links.
750 (Sized_relobj::do_count_local_symbols): Adjust section links and
751 symbol section indexes.
752 (Sized_relobj::do_finalize_local_symbols): Distinguish between
753 ordinary and special symbols.
754 (Sized_relobj::write_local_symbols): Add symtab_xindex and
755 dynsym_xindex parameters. Change all callers. Adjust section
756 links. Use SHN_XINDEX when needed.
757 (Sized_relobj::get_symbol_location_info): Adjust section links.
758 Don't get fooled by special symbols.
759 * object.h (class Xindex): Define.
760 (class Object): Add xindex_ parameter. Declare virtual functoin
761 do_initialize_xindex.
762 (Object::adjust_sym_shndx): New function.
763 (Object::set_xindex): New protected function.
764 (class Symbol_value): Add is_ordinary_shndx_ field.
765 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
766 (Symbol_value::value): Assert ordinary section.
767 (Symbol_value::initialize_input_to_output_map): Likewise.
768 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
769 Change all callers.
770 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
771 all callers.
772 (class Sized_relobj): Update declarations.
773 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
774 parameter. Change all callers.
775 (Sized_relobj::adjust_shndx): New function.
776 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
777 field.
778 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
779 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
780 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
781 (Sized_dynobj::read_dynsym_section): Adjust section links.
782 (Sized_dynobj::read_dynamic): Likewise.
783 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
784 section links.
785 (Sized_dynobj::do_initialize_xindex): New function.
786 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
787 do_initialize_xindex.
788 (Sized_dynobj::adjust_shndx): New function.
789 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
790 dynsym_xindex_ fields.
791 (Layout::finalize): Add a call to set_section_indexes before
792 creating the symtab sections.
793 (Layout::set_section_indexes): Don't do anything if the section
794 already has a section index.
795 (Layout::create_symtab_sections): Add shnum parameter. Change
796 caller. Create .symtab_shndx section if needed.
797 (Layout::create_shdrs): Add shstrtab_section parameter. Change
798 caller.
799 (Layout::allocated_output_section_count): New function.
800 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
801 needed.
802 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
803 fields. Update declarations.
804 (Layout::symtab_xindex): New function.
805 (Layout::dynsym_xindex): New function.
806 (class Write_symbols_task): Add layout_ field.
807 (Write_symbols_task::Write_symbols_task): Add layout parameter.
808 Change caller.
809 * output.cc (Output_section_headers::Output_section_headers): Add
810 shstrtab_section parameter. Change all callers.
811 (Output_section_headers::do_sized_write): Store overflow values
812 for section count and section string table section index in
813 section header zero.
814 (Output_file_header::do_sized_write): Check for overflow of
815 section count and section string table section index.
816 (Output_symtab_xindex::do_write): New function.
817 (Output_symtab_xindex::endian_do_write): New function.
818 * output.h (class Output_section_headers): Add shstrtab_section_.
819 Update declarations.
820 (class Output_symtab_xindex): Define.
821 (Output_section::has_out_shndx): New function.
822 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
823 field.
824 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
825 Change all callers.
826 (Sized_symbol::init): Likewise.
827 (Symbol::output_section): Check for ordinary symbol.
828 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
829 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
830 callers.
831 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
832 Change all callers. Simplify handling of symbols from sections
833 not included in the link.
834 (Symbol_table::add_from_dynobj): Handle ordinary symbol
835 distinction.
836 (Weak_alias_sorter::operator()): Assert that symbols are
837 ordinary.
838 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
839 distinction.
840 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
841 parameters. Change all callers.
842 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
843 symbol distinction. Use SHN_XINDEX when needed.
844 (Symbol_table::write_section_symbol): Add symtab_xindex
845 parameter. Change all callers.
846 (Symbol_table::sized_write_section_symbol): Likewise. Use
847 SHN_XINDEX when needed.
848 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
849 declarations.
850 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
851 (Symbol::is_defined): Check is_ordinary.
852 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
853 (Symbol::is_absolute, Symbol::is_common): Likewise.
854 (class Sized_symbol): Update declarations.
855 (class Symbol_table): Update declarations.
856 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
857 parameters. Change all callers.
858 (Sized_symbol::override): Likewise.
859 (Symbol_table::override): Likewise.
860 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
861 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
862 is_ordinary, and orig_st_shndx parameters. Change all callers.
863 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
864 to be in an ordinary section.
865 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
866 object and is_ordinary parameters. Change all callers.
867 (Sized_dwarf_line_info::read_relocs): Add object parameter.
868 Change all callers. Don't add undefined or non-ordinary symbols
869 to reloc_map_.
870 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
871 Change all callers.
872 * dwarf_reader.h (class Sized_dwarf_line_info): Update
873 declarations.
874 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
875 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
876 (Sized_relobj::relocate_sections): Likewise.
877 * target-reloc.h (scan_relocs): Adjust section symbol index.
878 (scan_relocatable_relocs): Likewise.
879 * i386.cc (Scan::local): Check for ordinary symbols.
880 * sparc.cc (Scan::local): Likewise.
881 * x86_64.cc (Scan::local): Likewise.
882 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
883 to symbol_section_and_value.
884 * testsuite/many_sections_test.cc: New file.
885 * testsuite/Makefile.am (BUILT_SOURCES): Define.
886 (check_PROGRAMS): Add many_sections_test.
887 (many_sections_test_SOURCES): Define.
888 (many_sections_test_DEPENDENCIES): Define.
889 (many_sections_test_LDFLAGS): Define.
890 (BUILT_SOURCES): Add many_sections_define.h.
891 (many_sections_define.h): New target.
892 (BUILT_SOURCES): Add many_sections_check.h.
893 (many_sections_check.h): New target.
894 (check_PROGRAMS): Add many_sections_r_test.
895 (many_sections_r_test_SOURCES): Define.
896 (many_sections_r_test_DEPENDENCIES): Define.
897 (many_sections_r_test_LDFLAGS): Define.
898 (many_sections_r_test_LDADD): Define.
899 (many_sections_r_test.o): New target.
900 * testsuite/Makefile.in: Rebuild.
901
c5818ff1
CC
9022008-04-17 Cary Coutant <ccoutant@google.com>
903
904 * errors.cc (Errors::info): New function.
905 (gold_info): New function.
906 * errors.h (Errors::info): New function.
907 * gold.h (gold_info): New function.
908 * object.cc (Input_objects::add_object): Print trace output.
909 * options.cc (options::parse_set): New function.
910 (General_options::parse_wrap): Deleted.
911 (General_options::General_options): Deleted initializer.
912 * options.h (options::String_set): New typedef.
913 (options::parse_set): New function.
914 (DEFINE_set): New macro.
915 (General_options::wrap): Changed to use DEFINE_set. Changed
916 callers of any_wrap_symbols and is_wrap_symbol.
917 (General_options::trace, General_options::trace_symbol):
918 New options.
919 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
920 (General_options::wrap_symbols_): Deleted.
921 * symtab.cc (Symbol_table::add_from_object): Print trace output.
922
b5be4a7c
DM
9232008-04-17 David S. Miller <davem@davemloft.net>
924
925 * options.cc (General_options::parse_V): New function.
926 * options.h: Add entries for -V and -Qy.
927
155a0dd7
ILT
9282008-04-17 Ian Lance Taylor <iant@google.com>
929
930 * common.cc (Symbol_table::allocate_commons): Remove options
931 parameter. Change caller.
932 (Symbol_table::do_allocate_commons): Remove options parameter.
933 Change caller. Just call do_allocate_commons_list twice.
934 (Symbol_table::do_allocate_commons_list): New function, broken out
935 of do_allocate_commons.
936 * common.h (class Allocate_commons_task): Remove options_ field.
937 Update constructor.
938 * symtab.cc (Symbol_table::Symbol_table): Initialize
939 tls_commons_.
940 (Symbol_table::add_from_object): Put TLS common symbols on
941 tls_commons_ list.
942 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
943 which are IN_OUTPUT_DATA.
944 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
945 allocate_commons and do_allocate_commons declarations. Declare
946 do_allocate_commons_list.
947 * gold.cc (queue_middle_tasks): Update creation of
948 Allocate_commons_task to not pass options.
949 * testsuite/Makefile.am (INCLUDES): Add -I.. .
950 (TLS_TEST_C_FLAGS): New variable.
951 (tls_test_c_pic.o): New target.
952 (tls_test_shared.so): Link in tls_test_c_pic.o.
953 (tls_test_c_pic_ie.o): New target.
954 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
955 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
956 (tls_test_c.o): New target.
957 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
958 (tls_pic_test_LDADD): Likewise.
959 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
960 (tls_shared_gd_to_ie_test_LDADD): Likewise.
961 (tls_test_c_gnu2.o): New target.
962 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
963 tls_test_c_gnu2.o.
964 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
965 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
966 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
967 * testsuite/tls_test.cc: Include "config.h".
968 (t_last): Call t11_last.
969 * testsuite/tls_test.h (t11, t11_last): Declare.
970 * testsuite/tls_test_c.c: New file.
971 * testsuite/tls_test_main.cc (thread_routine): Call t11.
972 * configure.ac: Check for OpenMP support.
973 * configure, config.in, Makefile.in: Rebuild.
974 * testsuite/Makefile.in: Rebuild.
975
edfbb029
CC
9762008-04-16 Cary Coutant <ccoutant@google.com>
977
978 * i386.cc (Target_i386::define_tls_base_symbol): New function.
979 (Target_i386::tls_base_symbol_defined_): New field.
980 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
981 (Target_i386::Scan::global): Likewise.
982 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
983 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
984 (Target_x86_64::tls_base_symbol_defined_): New field.
985 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
986 (Target_x86_64::Scan::global): Likewise.
987
f3c69fca
CC
9882008-04-16 Cary Coutant <ccoutant@google.com>
989
990 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
991 (Symbol::needs_plt_entry): Allow weak undefined symbols.
992 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
993 building shared libraries.
994 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
995 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
996 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
997 * testsuite/Makefile.in: Rebuild.
998 * testsuite/weak_undef.h: New file.
999 * testsuite/weak_undef_file1.cc: Add extra test cases.
1000 * testsuite/weak_undef_file2.cc: Likewise.
1001 * testsuite/weak_undef_test.cc: Likewise.
1002
7c414435
DM
10032008-04-16 David S. Miller <davem@davemloft.net>
1004
32b769e1
DM
1005 * sparc.cc (Target_sparc::Scan): Change from struct to class.
1006 Add issued_non_pic_error_ field. Declare check_non_pic.
1007 (Target_sparc::Scan::check_non_pic): New function.
1008 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
1009 (Target_sparc::Scan::global): Likewise.
1010
11936fb1
DM
1011 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
1012 * configure: Rebuild.
1013
7c414435
DM
1014 * options.h (DEFINE_enable): New macro.
1015 (new_dtags): New enable option.
1016 (initfirst, interpose, loadfltr, nodefaultlib,
1017 nodelete, nodlopen, nodump): New -z options.
1018 * layout.cc (Layout:finish_dynamic_section): If new
1019 dtags enabled, emit DT_RUNPATH. Also, emit a
1020 DT_FLAGS_1 containing any specified -z flags.
1021
85c7bf8b
ILT
10222008-04-16 Ian Lance Taylor <iant@google.com>
1023
12c0daef
ILT
1024 * copy-relocs.cc: New file.
1025 * copy-relocs.h: New file.
1026 * reloc.cc: Remove Copy_relocs code.
1027 * reloc.h: Likewise.
1028 * reloc-types.h (struct Reloc_types) [both versions]: Add
1029 get_reloc_addend_noerror.
1030 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
1031 variants of add_global which take an addend which must be zero.
1032 * i386.cc: Include "copy-relocs.h".
1033 (class Target_i386): Change type of copy_relocs_ to variable,
1034 update initializer.
1035 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
1036 Change all callers.
1037 (Target_i386::do_finalize_sections): Change handling of
1038 copy_relocs_.
1039 * sparc.cc: Include "copy-relocs.h".
1040 (class Target_sparc): Change type of copy_relocs_ to variable,
1041 update initializer.
1042 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
1043 Change all callers.
1044 (Target_sparc::do_finalize_sections): Change handling of
1045 copy_relocs_.
1046 * x86_64.cc: Include "copy-relocs.h".
1047 (class Target_x86_64): Change type of copy_relocs_ to variable,
1048 update initializer.
1049 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
1050 class. Change all callers.
1051 (Target_x86_64::do_finalize_sections): Change handling of
1052 copy_relocs_.
1053 * Makefile.am (CCFILES): Add copy-relocs.cc.
1054 (HFILES): Add copy-relocs.h.
1055
4f4995b6
ILT
1056 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
1057
85c7bf8b
ILT
1058 * testsuite/script_test_4.sh: Permit leading zeroes.
1059
4f2a9edd
ILT
10602008-04-15 Ian Lance Taylor <iant@google.com>
1061
e6188289
ILT
1062 * script-sections.cc (Script_sections::create_segments): Use
1063 header_size_adjustment even when there is enough room for the
1064 headers.
1065 * testsuite/script_test_4.sh: New file.
1066 * testsuite/script_test_4.t: New file.
1067 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
1068 (check_DATA): Add script_test_4.stdout.
1069 (MOSTLYCLEANFILES): Likewise.
1070 (script_test_4): New target.
1071 (script_test_4.stdout): New target.
1072 * testsuite/Makefile.in: Rebuild.
1073
4f2a9edd
ILT
1074 * sparc.cc: Add definitions for Output_data_plt_sparc class
1075 constants.
1076
f5314dd5
DM
10772008-04-14 David S. Miller <davem@davemloft.net>
1078
1079 * sparc.cc: New file.
1080 * Makefile.am (TARGETSOURCES): Add sparc.cc
1081 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
1082 * configure.tgt: Document targ_extra_size and
1083 targ_extra_big_endian. Add entries for sparc-* and
1084 sparc64-*.
1085 * configure.ac: Handle targ_extra_size and
1086 targ_extra_big_endian.
1087 * Makefile.in: Rebuild.
1088 * configure: Likewise.
1089 * po/POTFILES.in: Likewise.
1090 * po/gold.pot: Likewise.
1091
154e0e9a
ILT
10922008-04-14 Ian Lance Taylor <iant@google.com>
1093
1094 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
1095 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
1096 in the name/type/flags to section mapping. Don't call
1097 allocate_output_section.
1098 (Layout::choose_output_section): Change parameter from adjust_name
1099 to is_input_section. Don't permit input sections after sections
1100 are attached to segments. Don't call allocate_output_section.
1101 (Layout::layout_eh_frame): Call update_flags_for_input_section,
1102 not write_enable_output_section.
1103 (Layout::make_output_section): Don't push to
1104 unattached_section_list_ nor call attach_to_segment. Call
1105 attach_section_to_segment if sections are attached.
1106 (Layout::attach_sections_to_segments): New function.
1107 (Layout::attach_section_to_segment): New function.
1108 (Layout::attach_allocated_section_to_segment): Rename from
1109 attach_to_segment. Remove flags parameter.
1110 (Layout::allocate_output_section): Remove function.
1111 (Layout::write_enable_output_section): Remove function.
1112 * layout.h (class Layout): Update for above changes. Add new
1113 field sections_are_attached_.
1114 * output.h (Output_section::update_flags_for_input_section): New
1115 function.
1116 * output.cc (Output_section::add_input_section): Call
1117 update_flags_for_input_section.
1118 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
1119
009a67a2
CC
11202008-04-11 Cary Coutant <ccoutant@google.com>
1121
1122 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
1123 thought unnecessary.
1124 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
1125
759b1a24
ILT
11262008-04-11 Ian Lance Taylor <iant@google.com>
1127
1128 * output.h (class Output_section_data): Remove inline definition
1129 of set_addralign.
1130 * output.cc (Output_section_data::set_addralign): New function.
1131
c2b45e22
CC
11322008-04-11 Cary Coutant <ccoutant@google.com>
1133
1134 Add support for TLS descriptors for i386 and x86_64.
1135 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
1136 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
1137 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
1138 GOT_TYPE_TLS_DESC.
1139 (Target_i386::got_mod_index_entry): Remove unnecessary code.
1140 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
1141 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
1142 relocations.
1143 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
1144 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
1145 Fix problem with initial-exec relocations.
1146 (Target_i386::Relocate::relocate_tls): Likewise.
1147 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
1148 relaxation.
1149 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
1150 support for section-plus-offset dynamic table entries.
1151 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
1152 (Output_data_dynamic::Dynamic_entry): Add support for
1153 section-plus-offset dynamic table entries.
1154 (Output_data_dynamic::Classification): Likewise.
1155 (Output_data_dynamic::classification_): Renamed offset_.
1156 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
1157 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
1158 (Target_x86_64::make_plt_section): New function.
1159 (Target_x86_64::reserve_tlsdesc_entries): New function.
1160 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
1161 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
1162 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
1163 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
1164 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
1165 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
1166 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
1167 add extra PLT entry for TLS descriptors.
1168 (Output_data_plt_x86_64::got_): New field.
1169 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
1170 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
1171 fields.
1172 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
1173 descriptors.
1174 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
1175 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
1176 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
1177 R_386_TLS_DESC_CALL relocations.
1178 (Target_x86_64::Scan::global): Likewise.
1179 (Target_x86_64::do_finalize_sections): Add dynamic table entries
1180 for TLS descriptors.
1181 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
1182 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
1183 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
1184 GD-to-IE relaxation.
1185 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
1186 and TLS_DESCRIPTORS.
1187 * Makefile.in: Rebuild.
1188 * configure: Rebuild.
1189 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
1190 (tls_test_shared2.so): New target.
1191 (tls_shared_gd_to_ie_test_SOURCES): New variable.
1192 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
1193 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
1194 (tls_shared_gd_to_ie_test_LDADD): New variable.
1195 (tls_shared_gnu2_gd_to_ie_test): New target.
1196 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
1197 New targets.
1198 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
1199 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
1200 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
1201 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
1202 (tls_shared_gnu2_test): New target.
1203 (tls_test_gnu2_shared.so): New target.
1204 (tls_shared_gnu2_test_SOURCES): New variable.
1205 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
1206 (tls_shared_gnu2_test_LDFLAGS): New variable.
1207 (tls_shared_gnu2_test_LDADD): New variable.
1208 * testsuite/Makefile.in: Rebuild.
1209 * testsuite/Makefile.
1210
83bfb6b7
ILT
12112008-04-11 Ian Lance Taylor <iant@google.com>
1212
1213 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
1214 justsyms.t.
1215 * testsuite/Makefile.in: Rebuild.
1216
1217 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
1218 long.
1219 * testsuite/script_test_2.cc (main): Adjust test.
1220
706e1f5e
ILT
12212008-04-11 David S. Miller <davem@davemloft.net>
1222 Ian Lance Taylor <iant@google.com>
1223
1224 * options.h (General_options): Add entries for '-Y' and
1225 '-relax'.
1226 * options.cc (General_options:finalize): If -Y was used, add those
1227 entries to the library path instead of the default "/lib" and
1228 "/usr/lib".
1229
7c98e6bb
DM
12302008-04-11 David S. Miller <davem@davemloft.net>
1231
1232 * testsuite/justsyms.t: Start at 0x100.
1233 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
1234 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
1235 long.
1236 * testsuite/script_test_2.cc: Adjust string and section length
1237 checks.
7c98e6bb 1238
99a37bfd
ILT
12392008-04-09 Ian Lance Taylor <iant@google.com>
1240
2cefc357
ILT
1241 PR gold/5996
1242 * script-sections.cc (Sections_element::allocate_to_segment): Add
1243 orphan parameter.
1244 (Output_section_definition::allocate_to_segment): Likewise.
1245 (Orphan_output_section::allocate_to_segment): Likewise.
1246 (Script_sections::attach_sections_using_phdrs_clause): Don't
1247 propagate non-PT_LOAD segments to orphan sections.
1248 * testsuite/Makefile.am (script_test_3.stdout): Generate using
1249 readelf rather than objdump.
1250 * testsuite/script_test_3.sh: Adjust accordingly. Test that
1251 .interp section and PT_INTERP segment are the same size.
1252 * testsuite/Makefile.in: Rebuild.
1253
99a37bfd
ILT
1254 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
1255 aliases for symbols defined in the same object.
1256 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
1257 (weak_alias_test_SOURCES): New variable.
1258 (weak_alias_test_DEPENDENCIES): New variable.
1259 (weak_alias_test_LDFLAGS): New variable.
1260 (weak_alias_test_LDADD): New variable.
1261 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
1262 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
1263 (weak_alias_test_3.o): New target.
1264 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
1265 * testsuite/weak_alias_test_main.cc: New file.
1266 * testsuite/weak_alias_test_1.cc: New file.
1267 * testsuite/weak_alias_test_2.cc: New file.
1268 * testsuite/weak_alias_test_3.cc: New file.
1269
780e49c5
ILT
12702008-04-08 Ian Lance Taylor <iant@google.com>
1271
cdb0b8f5
ILT
1272 * options.h (class General_options): Add --noinhibit-exec option.
1273 * main.cc (main): Check --noinhibit-exec.
1274
0864d551
ILT
1275 * options.h (class General_options): Define --wrap as a special
1276 option. Add wrap_symbols_ field.
1277 (General_options::any_wrap_symbols): New function.
1278 (General_options::is_wrap_symbol): New function.
1279 * options.cc (General_options::parse_wrap): New function.
1280 (General_options::General_options): Initialize wrap_symbols_.
1281 * symtab.cc (Symbol_table::wrap_symbol): New function.
1282 (Symbol_table::add_from_object): Handle --wrap.
1283 * symtab.h (class Symbol_table): Declare wrap_symbol.
1284 * target.h (Target::wrap_char): New function.
1285 (Target::Target_info): Add wrap_char field.
1286 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
1287 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
1288 * testsuite/testfile.cc (Target_test::test_target_info):
1289 Likewise.
1290
789aa6de
ILT
1291 * errors.cc (Errors::undefined_symbol): Mention symbol version if
1292 there is one.
1293
2c38906f
ILT
1294 * layout.h (class Layout): Add added_eh_frame_data_ field.
1295 * layout.cc (Layout::Layout): Initialize new field.
1296 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
1297 output section until we find a section we merged successfully.
1298 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
1299 that the size be non-zero.
1300
780e49c5
ILT
1301 * merge.cc (Object_merge_map::get_output_offset): Remove inline
1302 qualifier.
1303
7fcd0256
ILT
13042008-04-08 Craig Silverstein <csilvers@google.com>
1305
1306 * configure.ac: Export new conditional variable HAVE_ZLIB.
1307 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
1308 on HAVE_ZLIB.
1309 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
1310 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
1311
6835af53
ILT
13122008-04-07 Ian Lance Taylor <iant@google.com>
1313
e24f324c
ILT
1314 * version.cc (version_string): Set to "1.5".
1315
a036edd8
ILT
1316 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
1317 Add issued_non_pic_error_ field. Declare check_non_pic.
1318 (Target_x86_64::Scan::check_non_pic): New function.
1319 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
1320 (Target_x86_64::Scan::global): Likewise.
1321
624f8810
ILT
1322 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
1323 addend parameter. Change caller. Handle merge sections.
1324 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
1325 Address to Addend. Don't add in the result of
1326 local_section_offset, pass down the addend and use the returned
1327 value.
1328 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
1329 Update declarations of local_section_offset and symbol_value.
1330 * testsuite/two_file_test_1.cc (t18): New function.
1331 * testsuite/two_file_test_2.cc (f18): New function.
1332 * testsuite/two_file_test_main.cc (main): Call t18.
1333 * testsuite/two_file_test.h (t18, f18): Declare.
1334
6835af53
ILT
1335 * configure.ac: Don't test for objdump, c++filt, or readelf.
1336 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
1337 conditionals.
1338 (TEST_READELF): New variable.
1339 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
1340 (check_PROGRAMS): Add two_file_strip_test.
1341 (two_file_strip_test): New target.
1342 (check_PROGRAMS): Add two_file_same_shared_strip_test.
1343 (two_file_same_shared_strip_test_SOURCES): New variable.
1344 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
1345 (two_file_same_shared_strip_test_LDFLAGS): New variable.
1346 (two_file_same_shared_strip_test_LDADD): New variable.
1347 (two_file_shared_strip.so): New target.
1348 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
1349 (ver_test_5.syms, ver_test_7.syms): Likewise.
1350 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
1351 (strip_test_3.stdout): Use TEST_OBJDUMP.
1352 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
1353
86925eef
CC
13542008-04-04 Cary Coutant <ccoutant@google.com>
1355
1356 * symtab.h (Symbol::is_weak_undefined): New function.
1357 (Symbol::is_strong_undefined): New function.
1358 (Symbol::is_absolute): New function.
1359 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
1360 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
1361 absolute symbols.
1362 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
1363 (weak_undef_test): New target.
1364 * testsuite/Makefile.in: Rebuild.
1365 * testsuite/weak_undef_file1.cc: New file.
1366 * testsuite/weak_undef_file2.cc: New file.
1367 * testsuite/weak_undef_test.cc: New file.
1368
126f3ece
ILT
13692008-04-03 Craig Silverstein <csilvers@google.com>
1370
1371 * compressed_output.h (class Output_compressed_section): Use
1372 unsigned buffer.
1373 * compressed_output.cc (zlib_compress): Use unsigned buffers,
1374 add zlib header.
1375 (zlib_compressed_suffix): Removed.
1376 (Output_compressed_section::set_final_data_size): Use unsigned
1377 buffers.
1378 * testsuite/Makefile.am (flagstest_compress_debug_sections):
1379 Fix linker invocation.
1380 (flagstest_o_specialfile_and_compress_debug_sections):
1381 Likewise.
1382 * testsuite/Makefile.in: Regenerated.
1383
deae2a14
DM
13842008-04-02 David S. Miller <davem@davemloft.net>
1385
1386 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
1387 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
1388
70752818
ILT
13892008-04-02 Craig Silverstein <csilvers@google.com>
1390
1391 * TODO: New file.
1392
39d0cb0e
ILT
13932008-04-02 Ian Lance Taylor <iant@google.com>
1394
1395 * fileread.cc (File_read::find_view): Add byteshift and vshifted
1396 parameters. Update for new key type to views_. Change all
1397 callers.
1398 (File_read::read): Adjust for byteshift in returned view.
1399 (File_read::add_view): New function, broken out of
1400 find_and_make_view.
1401 (File_read::make_view): New function, broken out of
1402 find_and_make_view.
1403 (File_read::find_or_make_view): Add offset and aligned
1404 parameters. Rewrite accordingly. Change all callers.
1405 (File_read::get_view): Add offset and aligned parameters. Adjust
1406 for byteshift in return value.
1407 (File_read::get_lasting_view): Likewise.
1408 * fileread.h (class File_read): Update declarations.
1409 (class File_read::View): Add byteshift_ field. Add byteshift to
1410 constructor. Add byteshift method.
1411 * archive.h (Archive::clear_uncached_views): New function.
1412 (Archive::get_view): Add aligned parameter. Change all callers.
1413 * object.h (Object::get_view): Add aligned parameter. Change all
1414 callers.
1415 (Object::get_lasting_view): Likewise.
1416
1417 * fileread.cc (File_read::release): Don't call clear_views if
1418 there are multiple objects.
1419 * fileread.h (File_read::clear_uncached_views): New function.
1420 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
1421 on the archive.
1422
a1207466
CC
14232008-03-31 Cary Coutant <ccoutant@google.com>
1424
1425 Add thin archive support.
1426 * archive.cc (Archive::armagt): New const.
1427 (Archive::setup): Remove task parameter and calls to unlock.
1428 (Archive::unlock_nested_archives): New function.
1429 (Archive::read_header): Add nested_off parameter. Change
1430 all callers.
1431 (Archive::interpret_header): Likewise.
1432 (Archive::include_all_members): Change to handle thin
1433 archives.
1434 (Archive::include_member): Likewise.
1435 * archive.h (Archive::Archive): Add new parameters and
1436 initializers.
1437 (Archive::armagt): New const.
1438 (Archive::setup): Remove task parameter.
1439 (Archive::unlock_nested_archives): New function.
1440 (Archive::read_header): Add nested_off parameter.
1441 (Archive::interpret_header): Likewise.
1442 (Archive::Nested_archive_table): New typedef.
1443 (Archive::is_thin_archive_): New field.
1444 (Archive::nested_archives_): New field.
1445 (Archive::options_): New field.
1446 (Archive::dirpath_): New field.
1447 (Archive::task_): New field.
1448 * readsyms.cc (Read_symbols::do_read_symbols): Add check
1449 for thin archives. Pass additional parameters to
1450 Archive::Archive. Unlock the archive file after calling
1451 Archive::setup.
1452
479f6503
ILT
14532008-03-29 Ian Lance Taylor <iant@google.com>
1454
686c8caf
ILT
1455 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
1456 version symbol to be local.
1457 * testsuite/ver_test_4.sh: New file.
1458 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
1459 (check_DATA): Add ver_test_4.syms.
1460 (ver_test_4.syms): New target.
1461 * testsuite/Makefile.in: Rebuild.
1462
ab794b6b
ILT
1463 * output.cc
1464 (Output_section::Input_section_sort_entry::has_priority): New
1465 function.
1466 (Output_section::Input_section_sort_entry::match_file_name): New
1467 function.
1468 (Output_section::Input_section_sort_entry::match_section_name):
1469 Remove.
1470 (Output_section::Input_section_sort_entry::match_section_name_prefix):
1471 Remove.
1472 (Output_section::Input_section_sort_entry::match_section_file):
1473 Remove.
1474 (Output_section::Input_section_sort_compare::operator()): Rewrite
1475 using new Input_section_sort_entry functions. Sort crtbegin and
1476 crtend first. Sort sections with no priority before sections with
1477 a priority.
1478 * testsuite/initpri1.c (d3): Check j != 4.
1479 (cd5): New constructor/destructor function.
1480 (main): Check j != 2.
1481
479f6503
ILT
1482 * symtab.cc (Symbol_table::add_from_object): If we don't use the
1483 new symbol when resolving, don't call set_is_default.
1484 * testsuite/ver_test_7.cc: New file.
1485 * testsuite/ver_test_7.sh: New file.
1486 * testsuite/Makefile.am (ver_test_7.so): New target.
1487 (ver_test_7.o): New target.
1488 (check_SCRIPTS): Add ver_test_7.sh.
1489 (check_DATA): Add ver_test_7.syms.
1490 (ver_test_7.syms): New target.
1491
2fd32231
ILT
14922008-03-28 Ian Lance Taylor <iant@google.com>
1493
1494 * layout.cc (Layout::layout): If we see an input section with a
1495 name that needs sorting, set the must_sort flag for the output
1496 section.
1497 (Layout::make_output_section): If the name of the output section
1498 indicates that it might require sorting, set the may_sort flag.
1499 * output.h (Output_section::may_sort_attached_input_sections): New
1500 function.
1501 (Output_section::set_may_sort_attached_input_sections): New
1502 function.
1503 (Output_section::must_sort_attached_input_sections): New
1504 function.
1505 (Output_section::set_must_sort_attached_input_sections): New
1506 function.
1507 (class Output_section): Declare Input_section_sort_entry. Define
1508 Input_section_sort_compare. Declare
1509 sort_attached_input_sections. Add new fields:
1510 may_sort_attached_input_sections_,
1511 must_sort_attached_input_sections_,
1512 attached_input_sections_are_sorted_.
1513 * output.cc (Output_section::Output_section): Initialize new
1514 fields.
1515 (Output_section::add_input_section): Add an entry to
1516 input_sections_ if may_sort or must_sort are true.
1517 (Output_section::set_final_data_size): Call
1518 sort_attached_input_sections if necessary.
1519 (Output_section::Input_section_sort_entry): Define new class.
1520 (Output_section::Input_section_sort_compare::operator()): New
1521 function.
1522 (Output_section::sort_attached_input_sections): New function.
1523 * configure.ac: Check whether the compiler supports constructor
1524 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
1525 * testsuite/initpri1.c: New file.
1526 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
1527 CONSTRUCTOR_PRIORITY.
1528 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
1529 (initpri1_LDFLAGS): New variable.
1530 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
1531
18e6b24e
ILT
15322008-03-27 Ian Lance Taylor <iant@google.com>
1533
49bdd526
ILT
1534 * common.cc (Sort_commons::operator): Correct sorting algorithm.
1535 * testsuite/common_test_1.c: New file.
1536 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
1537 (common_test_1_SOURCES): New variable.
1538 (common_test_1_DEPENDENCIES): New variable.
1539 (common_test_1_LDFLAGS): New variable.
1540
18e6b24e
ILT
1541 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
1542 and commons_ correctly when NAME/VERSION does not override
1543 NAME/NULL.
1544 * testsuite/ver_test_6.c: New file.
1545 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
1546 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
1547 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
1548
04bf7072
ILT
15492008-03-26 Ian Lance Taylor <iant@google.com>
1550
5871526f
ILT
1551 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
1552 of an undefined symbol from a version script.
1553 * testsuite/Makefile.am (ver_test_5.so): New target.
1554 (ver_test_5.o): New target.
1555 (check_SCRIPTS): Add ver_test_5.sh.
1556 (check_DATA): Add ver_test_5.syms.
1557 (ver_test_5.syms): New target.
1558 * testsuite/ver_test_5.cc: New file.
1559 * testsuite/ver_test_5.script: New file.
1560 * testsuite/ver_test_5.sh: New file.
1561 * Makefile.in, testsuite/Makefile.in: Rebuild.
1562
04bf7072
ILT
1563 PR gold/5986
1564 Fix problems building gold with gcc 4.3.0.
1565 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
1566 (gold_error_at_location, gold_warning_at_location): Use it.
1567 * configure.ac: Check whether we can compile and use a template
1568 function with a printf attribute.
1569 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
1570 when jumping over bytes.
1571 * object.cc: Instantiate Object::read_section_data.
1572 * debug.h: Include <cstring>
1573 * dwarf_reader.cc: Include <algorithm>
1574 * main.cc: Include <cstring>.
1575 * options.cc: Include <cstring>.
1576 * output.cc: Include <cstring>.
1577 * script.cc: Include <cstring>.
1578 * script.h: Include <string>.
1579 * symtab.cc: Include <cstring> and <algorithm>.
1580 * target-select.cc: Include <cstring>.
1581 * version.cc: Include <string>.
1582 * testsuite/testmain.cc: Include <cstdlib>.
1583 * configure, config.in: Rebuild.
1584
874c5b28
ILT
15852008-03-25 Ian Lance Taylor <iant@google.com>
1586
819d6c3a
ILT
1587 * options.cc: Include "../bfd/bfdver.h".
1588 (options::help): Print bug reporting address.
1589
f4b2c6f5
ILT
1590 * version.cc (print_version): Adjust output for current value of
1591 BFD_VERSION_STRING.
1592
1593 * NEWS: New file.
1594
e96caa79
ILT
1595 * options.cc (options::help): Print list of supported targets.
1596 * target-select.h: Include <vector>.
1597 (class Target_selector): Make machine_, size_, and is_big_endian_
1598 fields const. Add bfd_name_ and instantiated_target_ fields.
1599 (Target_selector::Target_selector): Add bfd_name parameter.
1600 (Target_selector::recognize): Make non-virtual, call
1601 do_recognize.
1602 (Target_selector::recognize_by_name): Make non-virtual, call
1603 do_recognize_by_name.
1604 (Target_selector::supported_names): New function.
1605 (Target_selector::bfd_name): New function.
1606 (Target_selector::do_instantiate_target): New pure virtual
1607 function.
1608 (Target_selector::do_recognize): New virtual function.
1609 (Target_selector::do_recognize_by_name): New virtual function.
1610 (Target_selector::instantiate_target): New private function.
1611 (supported_target_names): Declare.
1612 * target-select.cc (Target_selector::Target_selector): Update for
1613 new parameter and fields.
1614 (select_target_by_name): Check that the name matches before
1615 calling recognize_by_name.
1616 (supported_target_names): New function.
1617 * i386.cc (class Target_selector_i386): Update Target_selector
1618 constructor call. Remove recognize and recognize_by_name. Add
1619 do_instantiate_target.
1620 * x86_64.cc (class Target_selector_x86_64): Likewise.
1621 * testsuite/testfile.cc (class Target_selector_test): Update for
1622 changes to Target_selector.
1623
874c5b28
ILT
1624 * README: Rewrite, with some notes on unsupported features.
1625
0a65a3a7
CC
16262008-03-24 Cary Coutant <ccoutant@google.com>
1627
1628 * i386.cc (Target_i386::Got_type): New enum declaration.
1629 (Target_i386::Scan::local): Updated callers of Output_data_got
1630 member functions.
1631 (Target_i386::Scan::global): Likewise.
1632 (Target_i386::Relocate::relocate): Likewise.
1633 (Target_i386::Relocate::relocate_tls): Likewise.
1634 * object.h (Got_offset_list): New class.
1635 (Sized_relobj::local_has_got_offset): Added got_type parameter.
1636 (Sized_relobj::local_got_offset): Likewise.
1637 (Sized_relobj::set_local_got_offset): Likewise.
1638 (Sized_relobj::local_has_tls_got_offset): Removed.
1639 (Sized_relobj::local_tls_got_offset): Removed.
1640 (Sized_relobj::set_local_tls_got_offset): Removed.
1641 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
1642 * output.cc (Output_data_got::add_global): Added got_type parameter.
1643 (Output_data_got::add_global_with_rel): Likewise.
1644 (Output_data_got::add_global_with_rela): Likewise.
1645 (Output_data_got::add_global_pair_with_rel): New function.
1646 (Output_data_got::add_global_pair_with_rela): New function.
1647 (Output_data_got::add_local): Added got_type parameter.
1648 (Output_data_got::add_local_with_rel): Likewise.
1649 (Output_data_got::add_local_with_rela): Likewise.
1650 (Output_data_got::add_local_pair_with_rel): New function.
1651 (Output_data_got::add_local_pair_with_rela): New function.
1652 (Output_data_got::add_global_tls): Removed.
1653 (Output_data_got::add_global_tls_with_rel): Removed.
1654 (Output_data_got::add_global_tls_with_rela): Removed.
1655 (Output_data_got::add_local_tls): Removed.
1656 (Output_data_got::add_local_tls_with_rel): Removed.
1657 (Output_data_got::add_local_tls_with_rela): Removed.
1658 * output.h (Output_data_got::add_global): Added got_type parameter.
1659 (Output_data_got::add_global_with_rel): Likewise.
1660 (Output_data_got::add_global_with_rela): Likewise.
1661 (Output_data_got::add_global_pair_with_rel): New function.
1662 (Output_data_got::add_global_pair_with_rela): New function.
1663 (Output_data_got::add_local): Added got_type parameter.
1664 (Output_data_got::add_local_with_rel): Likewise.
1665 (Output_data_got::add_local_with_rela): Likewise.
1666 (Output_data_got::add_local_pair_with_rel): New function.
1667 (Output_data_got::add_local_pair_with_rela): New function.
1668 (Output_data_got::add_global_tls): Removed.
1669 (Output_data_got::add_global_tls_with_rel): Removed.
1670 (Output_data_got::add_global_tls_with_rela): Removed.
1671 (Output_data_got::add_local_tls): Removed.
1672 (Output_data_got::add_local_tls_with_rel): Removed.
1673 (Output_data_got::add_local_tls_with_rela): Removed.
1674 * resolve.cc (Symbol::override_base_with_special): Removed
1675 reference to has_got_offset_ field.
1676 * symtab.cc (Symbol::init_fields): Replaced initialization
1677 of got_offset_ with got_offsets_. Removed initialization
1678 of has_got_offset_
53fcba31 1679 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
1680 (Symbol::got_offset): Likewise.
1681 (Symbol::set_got_offset): Likewise.
1682 (Symbol::has_tls_got_offset): Removed.
1683 (Symbol::tls_got_offset): Removed.
1684 (Symbol::set_tls_got_offset): Removed.
1685 (Symbol::got_offset_): Removed.
1686 (Symbol::tls_mod_got_offset_): Removed.
1687 (Symbol::tls_pair_got_offset_): Removed.
1688 (Symbol::got_offsets_): New field.
1689 (Symbol::has_got_offset): Removed.
1690 (Symbol::has_tls_mod_got_offset): Removed.
1691 (Symbol::has_tls_pair_got_offset): Removed.
1692 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
1693 (Target_x86_64::Scan::local): Updated callers of Output_data_got
1694 member functions.
1695 (Target_x86_64::Scan::global): Likewise.
1696 (Target_x86_64::Relocate::relocate): Likewise.
1697 (Target_x86_64::Relocate::relocate_tls): Likewise.
1698
bd52eafb
BE
16992008-03-25 Ben Elliston <bje@au.ibm.com>
1700
1701 * yyscript.y: Fix spelling error in comment.
1702
8b105e34
ILT
17032008-03-24 Ian Lance Taylor <iant@google.com>
1704
8ed814a9
ILT
1705 * options.h (class General_options): Define build_id option.
1706 * layout.h (class Layout): Declare write_build_id, create_note,
1707 create_build_id. Add build_id_note_ member.
1708 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
1709 "libiberty.h", "md5.h", "sha1.h".
1710 (Layout::Layout): Initialize eh_frame_data_,
1711 eh_frame_hdr_section_, and build_id_note_.
1712 (Layout::finalize): Call create_build_id.
1713 (Layout::create_note): New function, broken out of
1714 Layout::create_gold_note.
1715 (Layout::create_gold_note): Call create_note.
1716 (Layout::create_build_id): New function.
1717 (Layout::write_build_id): New function.
1718 (Close_task_runner::run): Call write_build_id.
1719
8b105e34
ILT
1720 * x86_64.cc: Correct license to GPLv3.
1721
086a1841
ILT
17222008-03-23 Ian Lance Taylor <iant@google.com>
1723
1724 * options.cc: Include "demangle.h".
1725 (parse_optional_string): New function.
1726 (parse_long_option): Handle takes_optional_argument.
1727 (parse_short_option): Update dash_z initializer. Handle
1728 takes_optional_argument.
1729 (General_options::General_options): Initialize do_demangle_.
1730 (General_options::finalize): Set do_demangle_. Handle demangling
1731 style.
1732 * options.h (parse_optional_string): Declare.
1733 (struct One_option): Add optional_arg field. Update constructor.
1734 Update call constructor calls. Add takes_optional_argument
1735 function.
1736 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
1737 (DEFINE_optional_string): Define.
1738 (General_options::demangle): Change from DEFINE_bool to
1739 DEFINE_optional_string.
1740 (General_options::no_demangle): New function.
1741 (General_options::do_demangle): New function.
1742 (General_options::set_do_demangle): New function.
1743 (General_options::execstack_status_): Move definition to end of
1744 class definition.
1745 (General_options::static_): Likewise.
1746 (General_options::do_demangle_): New field.
1747 * object.cc (big_endian>::get_symbol_location_info): Call
1748 Options::do_demangle, not Options::demangle.
1749 * symtab.cc (demangle): Likewise.
1750
cbb93e63
ILT
17512008-03-22 Ian Lance Taylor <iant@google.com>
1752
1753 * gold.h: Include <cstddef> and <sys/types.h>
1754 * options.h: Include <cstring>.
1755
ec531623
ILT
17562008-03-21 Ian Lance Taylor <iant@google.com>
1757
1758 * Added source code to GNU binutils.
1759
This page took 0.114012 seconds and 4 git commands to generate.