* buildsym.c (watch_main_source_file_lossage): New fn.
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
155a0dd7
ILT
12008-04-17 Ian Lance Taylor <iant@google.com>
2
3 * common.cc (Symbol_table::allocate_commons): Remove options
4 parameter. Change caller.
5 (Symbol_table::do_allocate_commons): Remove options parameter.
6 Change caller. Just call do_allocate_commons_list twice.
7 (Symbol_table::do_allocate_commons_list): New function, broken out
8 of do_allocate_commons.
9 * common.h (class Allocate_commons_task): Remove options_ field.
10 Update constructor.
11 * symtab.cc (Symbol_table::Symbol_table): Initialize
12 tls_commons_.
13 (Symbol_table::add_from_object): Put TLS common symbols on
14 tls_commons_ list.
15 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
16 which are IN_OUTPUT_DATA.
17 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
18 allocate_commons and do_allocate_commons declarations. Declare
19 do_allocate_commons_list.
20 * gold.cc (queue_middle_tasks): Update creation of
21 Allocate_commons_task to not pass options.
22 * testsuite/Makefile.am (INCLUDES): Add -I.. .
23 (TLS_TEST_C_FLAGS): New variable.
24 (tls_test_c_pic.o): New target.
25 (tls_test_shared.so): Link in tls_test_c_pic.o.
26 (tls_test_c_pic_ie.o): New target.
27 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
28 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
29 (tls_test_c.o): New target.
30 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
31 (tls_pic_test_LDADD): Likewise.
32 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
33 (tls_shared_gd_to_ie_test_LDADD): Likewise.
34 (tls_test_c_gnu2.o): New target.
35 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
36 tls_test_c_gnu2.o.
37 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
38 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
39 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
40 * testsuite/tls_test.cc: Include "config.h".
41 (t_last): Call t11_last.
42 * testsuite/tls_test.h (t11, t11_last): Declare.
43 * testsuite/tls_test_c.c: New file.
44 * testsuite/tls_test_main.cc (thread_routine): Call t11.
45 * configure.ac: Check for OpenMP support.
46 * configure, config.in, Makefile.in: Rebuild.
47 * testsuite/Makefile.in: Rebuild.
48
edfbb029
CC
492008-04-16 Cary Coutant <ccoutant@google.com>
50
51 * i386.cc (Target_i386::define_tls_base_symbol): New function.
52 (Target_i386::tls_base_symbol_defined_): New field.
53 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
54 (Target_i386::Scan::global): Likewise.
55 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
56 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
57 (Target_x86_64::tls_base_symbol_defined_): New field.
58 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
59 (Target_x86_64::Scan::global): Likewise.
60
f3c69fca
CC
612008-04-16 Cary Coutant <ccoutant@google.com>
62
63 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
64 (Symbol::needs_plt_entry): Allow weak undefined symbols.
65 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
66 building shared libraries.
67 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
68 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
69 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
70 * testsuite/Makefile.in: Rebuild.
71 * testsuite/weak_undef.h: New file.
72 * testsuite/weak_undef_file1.cc: Add extra test cases.
73 * testsuite/weak_undef_file2.cc: Likewise.
74 * testsuite/weak_undef_test.cc: Likewise.
75
7c414435
DM
762008-04-16 David S. Miller <davem@davemloft.net>
77
32b769e1
DM
78 * sparc.cc (Target_sparc::Scan): Change from struct to class.
79 Add issued_non_pic_error_ field. Declare check_non_pic.
80 (Target_sparc::Scan::check_non_pic): New function.
81 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
82 (Target_sparc::Scan::global): Likewise.
83
11936fb1
DM
84 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
85 * configure: Rebuild.
86
7c414435
DM
87 * options.h (DEFINE_enable): New macro.
88 (new_dtags): New enable option.
89 (initfirst, interpose, loadfltr, nodefaultlib,
90 nodelete, nodlopen, nodump): New -z options.
91 * layout.cc (Layout:finish_dynamic_section): If new
92 dtags enabled, emit DT_RUNPATH. Also, emit a
93 DT_FLAGS_1 containing any specified -z flags.
94
85c7bf8b
ILT
952008-04-16 Ian Lance Taylor <iant@google.com>
96
12c0daef
ILT
97 * copy-relocs.cc: New file.
98 * copy-relocs.h: New file.
99 * reloc.cc: Remove Copy_relocs code.
100 * reloc.h: Likewise.
101 * reloc-types.h (struct Reloc_types) [both versions]: Add
102 get_reloc_addend_noerror.
103 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
104 variants of add_global which take an addend which must be zero.
105 * i386.cc: Include "copy-relocs.h".
106 (class Target_i386): Change type of copy_relocs_ to variable,
107 update initializer.
108 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
109 Change all callers.
110 (Target_i386::do_finalize_sections): Change handling of
111 copy_relocs_.
112 * sparc.cc: Include "copy-relocs.h".
113 (class Target_sparc): Change type of copy_relocs_ to variable,
114 update initializer.
115 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
116 Change all callers.
117 (Target_sparc::do_finalize_sections): Change handling of
118 copy_relocs_.
119 * x86_64.cc: Include "copy-relocs.h".
120 (class Target_x86_64): Change type of copy_relocs_ to variable,
121 update initializer.
122 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
123 class. Change all callers.
124 (Target_x86_64::do_finalize_sections): Change handling of
125 copy_relocs_.
126 * Makefile.am (CCFILES): Add copy-relocs.cc.
127 (HFILES): Add copy-relocs.h.
128
4f4995b6
ILT
129 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
130
85c7bf8b
ILT
131 * testsuite/script_test_4.sh: Permit leading zeroes.
132
4f2a9edd
ILT
1332008-04-15 Ian Lance Taylor <iant@google.com>
134
e6188289
ILT
135 * script-sections.cc (Script_sections::create_segments): Use
136 header_size_adjustment even when there is enough room for the
137 headers.
138 * testsuite/script_test_4.sh: New file.
139 * testsuite/script_test_4.t: New file.
140 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
141 (check_DATA): Add script_test_4.stdout.
142 (MOSTLYCLEANFILES): Likewise.
143 (script_test_4): New target.
144 (script_test_4.stdout): New target.
145 * testsuite/Makefile.in: Rebuild.
146
4f2a9edd
ILT
147 * sparc.cc: Add definitions for Output_data_plt_sparc class
148 constants.
149
f5314dd5
DM
1502008-04-14 David S. Miller <davem@davemloft.net>
151
152 * sparc.cc: New file.
153 * Makefile.am (TARGETSOURCES): Add sparc.cc
154 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
155 * configure.tgt: Document targ_extra_size and
156 targ_extra_big_endian. Add entries for sparc-* and
157 sparc64-*.
158 * configure.ac: Handle targ_extra_size and
159 targ_extra_big_endian.
160 * Makefile.in: Rebuild.
161 * configure: Likewise.
162 * po/POTFILES.in: Likewise.
163 * po/gold.pot: Likewise.
164
154e0e9a
ILT
1652008-04-14 Ian Lance Taylor <iant@google.com>
166
167 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
168 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
169 in the name/type/flags to section mapping. Don't call
170 allocate_output_section.
171 (Layout::choose_output_section): Change parameter from adjust_name
172 to is_input_section. Don't permit input sections after sections
173 are attached to segments. Don't call allocate_output_section.
174 (Layout::layout_eh_frame): Call update_flags_for_input_section,
175 not write_enable_output_section.
176 (Layout::make_output_section): Don't push to
177 unattached_section_list_ nor call attach_to_segment. Call
178 attach_section_to_segment if sections are attached.
179 (Layout::attach_sections_to_segments): New function.
180 (Layout::attach_section_to_segment): New function.
181 (Layout::attach_allocated_section_to_segment): Rename from
182 attach_to_segment. Remove flags parameter.
183 (Layout::allocate_output_section): Remove function.
184 (Layout::write_enable_output_section): Remove function.
185 * layout.h (class Layout): Update for above changes. Add new
186 field sections_are_attached_.
187 * output.h (Output_section::update_flags_for_input_section): New
188 function.
189 * output.cc (Output_section::add_input_section): Call
190 update_flags_for_input_section.
191 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
192
009a67a2
CC
1932008-04-11 Cary Coutant <ccoutant@google.com>
194
195 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
196 thought unnecessary.
197 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
198
759b1a24
ILT
1992008-04-11 Ian Lance Taylor <iant@google.com>
200
201 * output.h (class Output_section_data): Remove inline definition
202 of set_addralign.
203 * output.cc (Output_section_data::set_addralign): New function.
204
c2b45e22
CC
2052008-04-11 Cary Coutant <ccoutant@google.com>
206
207 Add support for TLS descriptors for i386 and x86_64.
208 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
209 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
210 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
211 GOT_TYPE_TLS_DESC.
212 (Target_i386::got_mod_index_entry): Remove unnecessary code.
213 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
214 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
215 relocations.
216 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
217 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
218 Fix problem with initial-exec relocations.
219 (Target_i386::Relocate::relocate_tls): Likewise.
220 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
221 relaxation.
222 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
223 support for section-plus-offset dynamic table entries.
224 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
225 (Output_data_dynamic::Dynamic_entry): Add support for
226 section-plus-offset dynamic table entries.
227 (Output_data_dynamic::Classification): Likewise.
228 (Output_data_dynamic::classification_): Renamed offset_.
229 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
230 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
231 (Target_x86_64::make_plt_section): New function.
232 (Target_x86_64::reserve_tlsdesc_entries): New function.
233 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
234 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
235 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
236 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
237 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
238 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
239 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
240 add extra PLT entry for TLS descriptors.
241 (Output_data_plt_x86_64::got_): New field.
242 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
243 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
244 fields.
245 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
246 descriptors.
247 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
248 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
249 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
250 R_386_TLS_DESC_CALL relocations.
251 (Target_x86_64::Scan::global): Likewise.
252 (Target_x86_64::do_finalize_sections): Add dynamic table entries
253 for TLS descriptors.
254 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
255 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
256 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
257 GD-to-IE relaxation.
258 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
259 and TLS_DESCRIPTORS.
260 * Makefile.in: Rebuild.
261 * configure: Rebuild.
262 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
263 (tls_test_shared2.so): New target.
264 (tls_shared_gd_to_ie_test_SOURCES): New variable.
265 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
266 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
267 (tls_shared_gd_to_ie_test_LDADD): New variable.
268 (tls_shared_gnu2_gd_to_ie_test): New target.
269 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
270 New targets.
271 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
272 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
273 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
274 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
275 (tls_shared_gnu2_test): New target.
276 (tls_test_gnu2_shared.so): New target.
277 (tls_shared_gnu2_test_SOURCES): New variable.
278 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
279 (tls_shared_gnu2_test_LDFLAGS): New variable.
280 (tls_shared_gnu2_test_LDADD): New variable.
281 * testsuite/Makefile.in: Rebuild.
282 * testsuite/Makefile.
283
83bfb6b7
ILT
2842008-04-11 Ian Lance Taylor <iant@google.com>
285
286 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
287 justsyms.t.
288 * testsuite/Makefile.in: Rebuild.
289
290 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
291 long.
292 * testsuite/script_test_2.cc (main): Adjust test.
293
706e1f5e
ILT
2942008-04-11 David S. Miller <davem@davemloft.net>
295 Ian Lance Taylor <iant@google.com>
296
297 * options.h (General_options): Add entries for '-Y' and
298 '-relax'.
299 * options.cc (General_options:finalize): If -Y was used, add those
300 entries to the library path instead of the default "/lib" and
301 "/usr/lib".
302
7c98e6bb
DM
3032008-04-11 David S. Miller <davem@davemloft.net>
304
305 * testsuite/justsyms.t: Start at 0x100.
306 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
307 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
308 long.
309 * testsuite/script_test_2.cc: Adjust string and section length
310 checks.
7c98e6bb 311
99a37bfd
ILT
3122008-04-09 Ian Lance Taylor <iant@google.com>
313
2cefc357
ILT
314 PR gold/5996
315 * script-sections.cc (Sections_element::allocate_to_segment): Add
316 orphan parameter.
317 (Output_section_definition::allocate_to_segment): Likewise.
318 (Orphan_output_section::allocate_to_segment): Likewise.
319 (Script_sections::attach_sections_using_phdrs_clause): Don't
320 propagate non-PT_LOAD segments to orphan sections.
321 * testsuite/Makefile.am (script_test_3.stdout): Generate using
322 readelf rather than objdump.
323 * testsuite/script_test_3.sh: Adjust accordingly. Test that
324 .interp section and PT_INTERP segment are the same size.
325 * testsuite/Makefile.in: Rebuild.
326
99a37bfd
ILT
327 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
328 aliases for symbols defined in the same object.
329 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
330 (weak_alias_test_SOURCES): New variable.
331 (weak_alias_test_DEPENDENCIES): New variable.
332 (weak_alias_test_LDFLAGS): New variable.
333 (weak_alias_test_LDADD): New variable.
334 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
335 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
336 (weak_alias_test_3.o): New target.
337 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
338 * testsuite/weak_alias_test_main.cc: New file.
339 * testsuite/weak_alias_test_1.cc: New file.
340 * testsuite/weak_alias_test_2.cc: New file.
341 * testsuite/weak_alias_test_3.cc: New file.
342
780e49c5
ILT
3432008-04-08 Ian Lance Taylor <iant@google.com>
344
cdb0b8f5
ILT
345 * options.h (class General_options): Add --noinhibit-exec option.
346 * main.cc (main): Check --noinhibit-exec.
347
0864d551
ILT
348 * options.h (class General_options): Define --wrap as a special
349 option. Add wrap_symbols_ field.
350 (General_options::any_wrap_symbols): New function.
351 (General_options::is_wrap_symbol): New function.
352 * options.cc (General_options::parse_wrap): New function.
353 (General_options::General_options): Initialize wrap_symbols_.
354 * symtab.cc (Symbol_table::wrap_symbol): New function.
355 (Symbol_table::add_from_object): Handle --wrap.
356 * symtab.h (class Symbol_table): Declare wrap_symbol.
357 * target.h (Target::wrap_char): New function.
358 (Target::Target_info): Add wrap_char field.
359 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
360 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
361 * testsuite/testfile.cc (Target_test::test_target_info):
362 Likewise.
363
789aa6de
ILT
364 * errors.cc (Errors::undefined_symbol): Mention symbol version if
365 there is one.
366
2c38906f
ILT
367 * layout.h (class Layout): Add added_eh_frame_data_ field.
368 * layout.cc (Layout::Layout): Initialize new field.
369 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
370 output section until we find a section we merged successfully.
371 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
372 that the size be non-zero.
373
780e49c5
ILT
374 * merge.cc (Object_merge_map::get_output_offset): Remove inline
375 qualifier.
376
7fcd0256
ILT
3772008-04-08 Craig Silverstein <csilvers@google.com>
378
379 * configure.ac: Export new conditional variable HAVE_ZLIB.
380 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
381 on HAVE_ZLIB.
382 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
383 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
384
6835af53
ILT
3852008-04-07 Ian Lance Taylor <iant@google.com>
386
e24f324c
ILT
387 * version.cc (version_string): Set to "1.5".
388
a036edd8
ILT
389 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
390 Add issued_non_pic_error_ field. Declare check_non_pic.
391 (Target_x86_64::Scan::check_non_pic): New function.
392 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
393 (Target_x86_64::Scan::global): Likewise.
394
624f8810
ILT
395 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
396 addend parameter. Change caller. Handle merge sections.
397 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
398 Address to Addend. Don't add in the result of
399 local_section_offset, pass down the addend and use the returned
400 value.
401 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
402 Update declarations of local_section_offset and symbol_value.
403 * testsuite/two_file_test_1.cc (t18): New function.
404 * testsuite/two_file_test_2.cc (f18): New function.
405 * testsuite/two_file_test_main.cc (main): Call t18.
406 * testsuite/two_file_test.h (t18, f18): Declare.
407
6835af53
ILT
408 * configure.ac: Don't test for objdump, c++filt, or readelf.
409 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
410 conditionals.
411 (TEST_READELF): New variable.
412 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
413 (check_PROGRAMS): Add two_file_strip_test.
414 (two_file_strip_test): New target.
415 (check_PROGRAMS): Add two_file_same_shared_strip_test.
416 (two_file_same_shared_strip_test_SOURCES): New variable.
417 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
418 (two_file_same_shared_strip_test_LDFLAGS): New variable.
419 (two_file_same_shared_strip_test_LDADD): New variable.
420 (two_file_shared_strip.so): New target.
421 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
422 (ver_test_5.syms, ver_test_7.syms): Likewise.
423 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
424 (strip_test_3.stdout): Use TEST_OBJDUMP.
425 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
426
86925eef
CC
4272008-04-04 Cary Coutant <ccoutant@google.com>
428
429 * symtab.h (Symbol::is_weak_undefined): New function.
430 (Symbol::is_strong_undefined): New function.
431 (Symbol::is_absolute): New function.
432 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
433 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
434 absolute symbols.
435 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
436 (weak_undef_test): New target.
437 * testsuite/Makefile.in: Rebuild.
438 * testsuite/weak_undef_file1.cc: New file.
439 * testsuite/weak_undef_file2.cc: New file.
440 * testsuite/weak_undef_test.cc: New file.
441
126f3ece
ILT
4422008-04-03 Craig Silverstein <csilvers@google.com>
443
444 * compressed_output.h (class Output_compressed_section): Use
445 unsigned buffer.
446 * compressed_output.cc (zlib_compress): Use unsigned buffers,
447 add zlib header.
448 (zlib_compressed_suffix): Removed.
449 (Output_compressed_section::set_final_data_size): Use unsigned
450 buffers.
451 * testsuite/Makefile.am (flagstest_compress_debug_sections):
452 Fix linker invocation.
453 (flagstest_o_specialfile_and_compress_debug_sections):
454 Likewise.
455 * testsuite/Makefile.in: Regenerated.
456
deae2a14
DM
4572008-04-02 David S. Miller <davem@davemloft.net>
458
459 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
460 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
461
70752818
ILT
4622008-04-02 Craig Silverstein <csilvers@google.com>
463
464 * TODO: New file.
465
39d0cb0e
ILT
4662008-04-02 Ian Lance Taylor <iant@google.com>
467
468 * fileread.cc (File_read::find_view): Add byteshift and vshifted
469 parameters. Update for new key type to views_. Change all
470 callers.
471 (File_read::read): Adjust for byteshift in returned view.
472 (File_read::add_view): New function, broken out of
473 find_and_make_view.
474 (File_read::make_view): New function, broken out of
475 find_and_make_view.
476 (File_read::find_or_make_view): Add offset and aligned
477 parameters. Rewrite accordingly. Change all callers.
478 (File_read::get_view): Add offset and aligned parameters. Adjust
479 for byteshift in return value.
480 (File_read::get_lasting_view): Likewise.
481 * fileread.h (class File_read): Update declarations.
482 (class File_read::View): Add byteshift_ field. Add byteshift to
483 constructor. Add byteshift method.
484 * archive.h (Archive::clear_uncached_views): New function.
485 (Archive::get_view): Add aligned parameter. Change all callers.
486 * object.h (Object::get_view): Add aligned parameter. Change all
487 callers.
488 (Object::get_lasting_view): Likewise.
489
490 * fileread.cc (File_read::release): Don't call clear_views if
491 there are multiple objects.
492 * fileread.h (File_read::clear_uncached_views): New function.
493 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
494 on the archive.
495
a1207466
CC
4962008-03-31 Cary Coutant <ccoutant@google.com>
497
498 Add thin archive support.
499 * archive.cc (Archive::armagt): New const.
500 (Archive::setup): Remove task parameter and calls to unlock.
501 (Archive::unlock_nested_archives): New function.
502 (Archive::read_header): Add nested_off parameter. Change
503 all callers.
504 (Archive::interpret_header): Likewise.
505 (Archive::include_all_members): Change to handle thin
506 archives.
507 (Archive::include_member): Likewise.
508 * archive.h (Archive::Archive): Add new parameters and
509 initializers.
510 (Archive::armagt): New const.
511 (Archive::setup): Remove task parameter.
512 (Archive::unlock_nested_archives): New function.
513 (Archive::read_header): Add nested_off parameter.
514 (Archive::interpret_header): Likewise.
515 (Archive::Nested_archive_table): New typedef.
516 (Archive::is_thin_archive_): New field.
517 (Archive::nested_archives_): New field.
518 (Archive::options_): New field.
519 (Archive::dirpath_): New field.
520 (Archive::task_): New field.
521 * readsyms.cc (Read_symbols::do_read_symbols): Add check
522 for thin archives. Pass additional parameters to
523 Archive::Archive. Unlock the archive file after calling
524 Archive::setup.
525
479f6503
ILT
5262008-03-29 Ian Lance Taylor <iant@google.com>
527
686c8caf
ILT
528 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
529 version symbol to be local.
530 * testsuite/ver_test_4.sh: New file.
531 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
532 (check_DATA): Add ver_test_4.syms.
533 (ver_test_4.syms): New target.
534 * testsuite/Makefile.in: Rebuild.
535
ab794b6b
ILT
536 * output.cc
537 (Output_section::Input_section_sort_entry::has_priority): New
538 function.
539 (Output_section::Input_section_sort_entry::match_file_name): New
540 function.
541 (Output_section::Input_section_sort_entry::match_section_name):
542 Remove.
543 (Output_section::Input_section_sort_entry::match_section_name_prefix):
544 Remove.
545 (Output_section::Input_section_sort_entry::match_section_file):
546 Remove.
547 (Output_section::Input_section_sort_compare::operator()): Rewrite
548 using new Input_section_sort_entry functions. Sort crtbegin and
549 crtend first. Sort sections with no priority before sections with
550 a priority.
551 * testsuite/initpri1.c (d3): Check j != 4.
552 (cd5): New constructor/destructor function.
553 (main): Check j != 2.
554
479f6503
ILT
555 * symtab.cc (Symbol_table::add_from_object): If we don't use the
556 new symbol when resolving, don't call set_is_default.
557 * testsuite/ver_test_7.cc: New file.
558 * testsuite/ver_test_7.sh: New file.
559 * testsuite/Makefile.am (ver_test_7.so): New target.
560 (ver_test_7.o): New target.
561 (check_SCRIPTS): Add ver_test_7.sh.
562 (check_DATA): Add ver_test_7.syms.
563 (ver_test_7.syms): New target.
564
2fd32231
ILT
5652008-03-28 Ian Lance Taylor <iant@google.com>
566
567 * layout.cc (Layout::layout): If we see an input section with a
568 name that needs sorting, set the must_sort flag for the output
569 section.
570 (Layout::make_output_section): If the name of the output section
571 indicates that it might require sorting, set the may_sort flag.
572 * output.h (Output_section::may_sort_attached_input_sections): New
573 function.
574 (Output_section::set_may_sort_attached_input_sections): New
575 function.
576 (Output_section::must_sort_attached_input_sections): New
577 function.
578 (Output_section::set_must_sort_attached_input_sections): New
579 function.
580 (class Output_section): Declare Input_section_sort_entry. Define
581 Input_section_sort_compare. Declare
582 sort_attached_input_sections. Add new fields:
583 may_sort_attached_input_sections_,
584 must_sort_attached_input_sections_,
585 attached_input_sections_are_sorted_.
586 * output.cc (Output_section::Output_section): Initialize new
587 fields.
588 (Output_section::add_input_section): Add an entry to
589 input_sections_ if may_sort or must_sort are true.
590 (Output_section::set_final_data_size): Call
591 sort_attached_input_sections if necessary.
592 (Output_section::Input_section_sort_entry): Define new class.
593 (Output_section::Input_section_sort_compare::operator()): New
594 function.
595 (Output_section::sort_attached_input_sections): New function.
596 * configure.ac: Check whether the compiler supports constructor
597 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
598 * testsuite/initpri1.c: New file.
599 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
600 CONSTRUCTOR_PRIORITY.
601 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
602 (initpri1_LDFLAGS): New variable.
603 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
604
18e6b24e
ILT
6052008-03-27 Ian Lance Taylor <iant@google.com>
606
49bdd526
ILT
607 * common.cc (Sort_commons::operator): Correct sorting algorithm.
608 * testsuite/common_test_1.c: New file.
609 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
610 (common_test_1_SOURCES): New variable.
611 (common_test_1_DEPENDENCIES): New variable.
612 (common_test_1_LDFLAGS): New variable.
613
18e6b24e
ILT
614 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
615 and commons_ correctly when NAME/VERSION does not override
616 NAME/NULL.
617 * testsuite/ver_test_6.c: New file.
618 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
619 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
620 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
621
04bf7072
ILT
6222008-03-26 Ian Lance Taylor <iant@google.com>
623
5871526f
ILT
624 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
625 of an undefined symbol from a version script.
626 * testsuite/Makefile.am (ver_test_5.so): New target.
627 (ver_test_5.o): New target.
628 (check_SCRIPTS): Add ver_test_5.sh.
629 (check_DATA): Add ver_test_5.syms.
630 (ver_test_5.syms): New target.
631 * testsuite/ver_test_5.cc: New file.
632 * testsuite/ver_test_5.script: New file.
633 * testsuite/ver_test_5.sh: New file.
634 * Makefile.in, testsuite/Makefile.in: Rebuild.
635
04bf7072
ILT
636 PR gold/5986
637 Fix problems building gold with gcc 4.3.0.
638 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
639 (gold_error_at_location, gold_warning_at_location): Use it.
640 * configure.ac: Check whether we can compile and use a template
641 function with a printf attribute.
642 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
643 when jumping over bytes.
644 * object.cc: Instantiate Object::read_section_data.
645 * debug.h: Include <cstring>
646 * dwarf_reader.cc: Include <algorithm>
647 * main.cc: Include <cstring>.
648 * options.cc: Include <cstring>.
649 * output.cc: Include <cstring>.
650 * script.cc: Include <cstring>.
651 * script.h: Include <string>.
652 * symtab.cc: Include <cstring> and <algorithm>.
653 * target-select.cc: Include <cstring>.
654 * version.cc: Include <string>.
655 * testsuite/testmain.cc: Include <cstdlib>.
656 * configure, config.in: Rebuild.
657
874c5b28
ILT
6582008-03-25 Ian Lance Taylor <iant@google.com>
659
819d6c3a
ILT
660 * options.cc: Include "../bfd/bfdver.h".
661 (options::help): Print bug reporting address.
662
f4b2c6f5
ILT
663 * version.cc (print_version): Adjust output for current value of
664 BFD_VERSION_STRING.
665
666 * NEWS: New file.
667
e96caa79
ILT
668 * options.cc (options::help): Print list of supported targets.
669 * target-select.h: Include <vector>.
670 (class Target_selector): Make machine_, size_, and is_big_endian_
671 fields const. Add bfd_name_ and instantiated_target_ fields.
672 (Target_selector::Target_selector): Add bfd_name parameter.
673 (Target_selector::recognize): Make non-virtual, call
674 do_recognize.
675 (Target_selector::recognize_by_name): Make non-virtual, call
676 do_recognize_by_name.
677 (Target_selector::supported_names): New function.
678 (Target_selector::bfd_name): New function.
679 (Target_selector::do_instantiate_target): New pure virtual
680 function.
681 (Target_selector::do_recognize): New virtual function.
682 (Target_selector::do_recognize_by_name): New virtual function.
683 (Target_selector::instantiate_target): New private function.
684 (supported_target_names): Declare.
685 * target-select.cc (Target_selector::Target_selector): Update for
686 new parameter and fields.
687 (select_target_by_name): Check that the name matches before
688 calling recognize_by_name.
689 (supported_target_names): New function.
690 * i386.cc (class Target_selector_i386): Update Target_selector
691 constructor call. Remove recognize and recognize_by_name. Add
692 do_instantiate_target.
693 * x86_64.cc (class Target_selector_x86_64): Likewise.
694 * testsuite/testfile.cc (class Target_selector_test): Update for
695 changes to Target_selector.
696
874c5b28
ILT
697 * README: Rewrite, with some notes on unsupported features.
698
0a65a3a7
CC
6992008-03-24 Cary Coutant <ccoutant@google.com>
700
701 * i386.cc (Target_i386::Got_type): New enum declaration.
702 (Target_i386::Scan::local): Updated callers of Output_data_got
703 member functions.
704 (Target_i386::Scan::global): Likewise.
705 (Target_i386::Relocate::relocate): Likewise.
706 (Target_i386::Relocate::relocate_tls): Likewise.
707 * object.h (Got_offset_list): New class.
708 (Sized_relobj::local_has_got_offset): Added got_type parameter.
709 (Sized_relobj::local_got_offset): Likewise.
710 (Sized_relobj::set_local_got_offset): Likewise.
711 (Sized_relobj::local_has_tls_got_offset): Removed.
712 (Sized_relobj::local_tls_got_offset): Removed.
713 (Sized_relobj::set_local_tls_got_offset): Removed.
714 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
715 * output.cc (Output_data_got::add_global): Added got_type parameter.
716 (Output_data_got::add_global_with_rel): Likewise.
717 (Output_data_got::add_global_with_rela): Likewise.
718 (Output_data_got::add_global_pair_with_rel): New function.
719 (Output_data_got::add_global_pair_with_rela): New function.
720 (Output_data_got::add_local): Added got_type parameter.
721 (Output_data_got::add_local_with_rel): Likewise.
722 (Output_data_got::add_local_with_rela): Likewise.
723 (Output_data_got::add_local_pair_with_rel): New function.
724 (Output_data_got::add_local_pair_with_rela): New function.
725 (Output_data_got::add_global_tls): Removed.
726 (Output_data_got::add_global_tls_with_rel): Removed.
727 (Output_data_got::add_global_tls_with_rela): Removed.
728 (Output_data_got::add_local_tls): Removed.
729 (Output_data_got::add_local_tls_with_rel): Removed.
730 (Output_data_got::add_local_tls_with_rela): Removed.
731 * output.h (Output_data_got::add_global): Added got_type parameter.
732 (Output_data_got::add_global_with_rel): Likewise.
733 (Output_data_got::add_global_with_rela): Likewise.
734 (Output_data_got::add_global_pair_with_rel): New function.
735 (Output_data_got::add_global_pair_with_rela): New function.
736 (Output_data_got::add_local): Added got_type parameter.
737 (Output_data_got::add_local_with_rel): Likewise.
738 (Output_data_got::add_local_with_rela): Likewise.
739 (Output_data_got::add_local_pair_with_rel): New function.
740 (Output_data_got::add_local_pair_with_rela): New function.
741 (Output_data_got::add_global_tls): Removed.
742 (Output_data_got::add_global_tls_with_rel): Removed.
743 (Output_data_got::add_global_tls_with_rela): Removed.
744 (Output_data_got::add_local_tls): Removed.
745 (Output_data_got::add_local_tls_with_rel): Removed.
746 (Output_data_got::add_local_tls_with_rela): Removed.
747 * resolve.cc (Symbol::override_base_with_special): Removed
748 reference to has_got_offset_ field.
749 * symtab.cc (Symbol::init_fields): Replaced initialization
750 of got_offset_ with got_offsets_. Removed initialization
751 of has_got_offset_
53fcba31 752 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
753 (Symbol::got_offset): Likewise.
754 (Symbol::set_got_offset): Likewise.
755 (Symbol::has_tls_got_offset): Removed.
756 (Symbol::tls_got_offset): Removed.
757 (Symbol::set_tls_got_offset): Removed.
758 (Symbol::got_offset_): Removed.
759 (Symbol::tls_mod_got_offset_): Removed.
760 (Symbol::tls_pair_got_offset_): Removed.
761 (Symbol::got_offsets_): New field.
762 (Symbol::has_got_offset): Removed.
763 (Symbol::has_tls_mod_got_offset): Removed.
764 (Symbol::has_tls_pair_got_offset): Removed.
765 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
766 (Target_x86_64::Scan::local): Updated callers of Output_data_got
767 member functions.
768 (Target_x86_64::Scan::global): Likewise.
769 (Target_x86_64::Relocate::relocate): Likewise.
770 (Target_x86_64::Relocate::relocate_tls): Likewise.
771
bd52eafb
BE
7722008-03-25 Ben Elliston <bje@au.ibm.com>
773
774 * yyscript.y: Fix spelling error in comment.
775
8b105e34
ILT
7762008-03-24 Ian Lance Taylor <iant@google.com>
777
8ed814a9
ILT
778 * options.h (class General_options): Define build_id option.
779 * layout.h (class Layout): Declare write_build_id, create_note,
780 create_build_id. Add build_id_note_ member.
781 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
782 "libiberty.h", "md5.h", "sha1.h".
783 (Layout::Layout): Initialize eh_frame_data_,
784 eh_frame_hdr_section_, and build_id_note_.
785 (Layout::finalize): Call create_build_id.
786 (Layout::create_note): New function, broken out of
787 Layout::create_gold_note.
788 (Layout::create_gold_note): Call create_note.
789 (Layout::create_build_id): New function.
790 (Layout::write_build_id): New function.
791 (Close_task_runner::run): Call write_build_id.
792
8b105e34
ILT
793 * x86_64.cc: Correct license to GPLv3.
794
086a1841
ILT
7952008-03-23 Ian Lance Taylor <iant@google.com>
796
797 * options.cc: Include "demangle.h".
798 (parse_optional_string): New function.
799 (parse_long_option): Handle takes_optional_argument.
800 (parse_short_option): Update dash_z initializer. Handle
801 takes_optional_argument.
802 (General_options::General_options): Initialize do_demangle_.
803 (General_options::finalize): Set do_demangle_. Handle demangling
804 style.
805 * options.h (parse_optional_string): Declare.
806 (struct One_option): Add optional_arg field. Update constructor.
807 Update call constructor calls. Add takes_optional_argument
808 function.
809 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
810 (DEFINE_optional_string): Define.
811 (General_options::demangle): Change from DEFINE_bool to
812 DEFINE_optional_string.
813 (General_options::no_demangle): New function.
814 (General_options::do_demangle): New function.
815 (General_options::set_do_demangle): New function.
816 (General_options::execstack_status_): Move definition to end of
817 class definition.
818 (General_options::static_): Likewise.
819 (General_options::do_demangle_): New field.
820 * object.cc (big_endian>::get_symbol_location_info): Call
821 Options::do_demangle, not Options::demangle.
822 * symtab.cc (demangle): Likewise.
823
cbb93e63
ILT
8242008-03-22 Ian Lance Taylor <iant@google.com>
825
826 * gold.h: Include <cstddef> and <sys/types.h>
827 * options.h: Include <cstring>.
828
ec531623
ILT
8292008-03-21 Ian Lance Taylor <iant@google.com>
830
831 * Added source code to GNU binutils.
832
This page took 0.062808 seconds and 4 git commands to generate.