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