Hello community,
here is the log from the commit of package binutils
checked in at Wed Apr 5 17:02:12 CEST 2006.
--------
--- binutils/binutils.changes 2006-03-31 16:10:51.000000000 +0200
+++ binutils/binutils.changes 2006-04-03 19:46:24.000000000 +0200
@@ -1,0 +2,12 @@
+Mon Apr 3 13:07:29 CEST 2006 - schwab@suse.de
+
+- Add various bug fix backports collected by Alan Modra. Fixes the
+ following binutils bugs:
+ * PR ld/2443
+ * PR ld/2462
+ * PR ld/2267
+ * incompatibilities between REL{32,24,14}
+ * ld -r on ppc64
+ * -msecure-plt vs TLS
+
+-------------------------------------------------------------------
cross-alpha-binutils.changes: same change
cross-arm-binutils.changes: same change
cross-avr-binutils.changes: same change
cross-hppa-binutils.changes: same change
cross-i386-binutils.changes: same change
cross-ia64-binutils.changes: same change
cross-mips-binutils.changes: same change
cross-ppc-binutils.changes: same change
cross-ppc64-binutils.changes: same change
cross-s390-binutils.changes: same change
cross-s390x-binutils.changes: same change
cross-sparc-binutils.changes: same change
cross-x86_64-binutils.changes: same change
New:
----
concat-filename.diff
dwarf2dbg-file.diff
eh-frame.diff
elf-emit-reloc.diff
elf-fixup.diff
gas-close.diff
ld-search-order.diff
lookup-symbol-in-function-table.diff
ppc-got-reloc.diff
ppc-stub-sym.diff
ppc-tls.diff
ppc64-opd.diff
ppc64-toc1.diff
readelf.diff
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ binutils.spec ++++++
--- /var/tmp/diff_new_pack.0JW181/_old 2006-04-05 17:00:52.000000000 +0200
+++ /var/tmp/diff_new_pack.0JW181/_new 2006-04-05 17:00:52.000000000 +0200
@@ -49,7 +49,7 @@
%endif
Autoreqprov: on
Version: 2.16.91.0.5
-Release: 12
+Release: 13
Summary: GNU Binutils
Source: ftp://ftp.kernel.org/pub/linux/devel/binutils/binutils-%{version}.tar.bz2
Source1: pre_checkin.sh
@@ -74,6 +74,21 @@
Patch18: suse-dynsort.diff
Patch19: suse-hashvals.diff
Patch20: bfd-find-nearest-line.diff
+# Collected by Alan Modra
+Patch42: lookup-symbol-in-function-table.diff
+Patch43: ppc-stub-sym.diff
+Patch44: ppc64-opd.diff
+Patch45: ppc64-toc1.diff
+Patch46: gas-close.diff
+Patch47: ld-search-order.diff
+Patch48: eh-frame.diff
+Patch49: dwarf2dbg-file.diff
+Patch50: readelf.diff
+Patch51: concat-filename.diff
+Patch52: ppc-got-reloc.diff
+Patch53: elf-emit-reloc.diff
+Patch54: ppc-tls.diff
+Patch55: elf-fixup.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if "%{name}" != "binutils"
%define _prefix /opt/cross
@@ -185,6 +200,21 @@
%patch19 -p1
%patch20 -p1
#
+%patch42
+%patch43
+%patch44
+%patch45
+%patch46
+%patch47
+%patch48
+%patch49
+%patch50
+%patch51
+%patch52
+%patch53
+%patch54
+%patch55
+#
# test_vanilla
%endif
@@ -227,7 +257,8 @@
${ADDITIONAL_TARGETS:+--enable-targets="${ADDITIONAL_TARGETS// /,}"}
make configure-bfd
make headers -C bfd
-make configure-bfd
+# force reconfiguring
+rm bfd/Makefile
make %{?jobs:-j%jobs}
%ifnarch %arm
make -k check CFLAGS="$RPM_OPT_FLAGS -Wno-unused" || %{make_check_handling}
@@ -415,6 +446,15 @@
%endif
%changelog -n binutils
+* Mon Apr 03 2006 - schwab@suse.de
+- Add various bug fix backports collected by Alan Modra. Fixes the
+ following binutils bugs:
+ * PR ld/2443
+ * PR ld/2462
+ * PR ld/2267
+ * incompatibilities between REL{32,24,14}
+ * ld -r on ppc64
+ * -msecure-plt vs TLS
* Fri Mar 31 2006 - schwab@suse.de
- Fix build race.
* Fri Mar 31 2006 - matz@suse.de
cross-alpha-binutils.spec: same change
cross-arm-binutils.spec: same change
cross-avr-binutils.spec: same change
cross-hppa-binutils.spec: same change
cross-i386-binutils.spec: same change
cross-ia64-binutils.spec: same change
cross-mips-binutils.spec: same change
cross-ppc-binutils.spec: same change
cross-ppc64-binutils.spec: same change
cross-s390-binutils.spec: same change
cross-s390x-binutils.spec: same change
cross-sparc-binutils.spec: same change
cross-x86_64-binutils.spec: same change
++++++ binutils-version.patch ++++++
--- /var/tmp/diff_new_pack.0JW181/_old 2006-04-05 17:00:53.000000000 +0200
+++ /var/tmp/diff_new_pack.0JW181/_new 2006-04-05 17:00:53.000000000 +0200
@@ -1,6 +1,6 @@
--- bfd/Makefile.am
+++ bfd/Makefile.am
-@@ -889,10 +889,10 @@
+@@ -897,10 +897,10 @@
bfdver.h: $(srcdir)/version.h $(srcdir)/Makefile.in
@echo "creating $@"
@bfd_version=`echo "$(VERSION)" | sed -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\
@@ -15,7 +15,7 @@
--- bfd/Makefile.in
+++ bfd/Makefile.in
-@@ -1458,10 +1458,10 @@
+@@ -1466,10 +1466,10 @@
bfdver.h: $(srcdir)/version.h $(srcdir)/Makefile.in
@echo "creating $@"
@bfd_version=`echo "$(VERSION)" | sed -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\
@@ -28,3 +28,10 @@
fi ;\
sed -e "s/@bfd_version@/$$bfd_version/" -e "s/@bfd_version_string@/$$bfd_version_string/" < $(srcdir)/version.h > $@
+--- include/bin-bugs.h
++++ include/bin-bugs.h
+@@ -1,3 +1,3 @@
+ #ifndef REPORT_BUGS_TO
+-#define REPORT_BUGS_TO "URL:http://www.sourceware.org/bugzilla/ and hjl@lucon.org"
++#define REPORT_BUGS_TO "URL:http://bugs.opensuse.org/"
+ #endif
++++++ concat-filename.diff ++++++
2006-03-11 H.J. Lu
PR ld/2443
* dwarf2.c (concat_filename): Don't issue an error if file is
0.
cvs diff -D"2006/03/11 15:00Z" -D"2006/03/11 15:03Z"
Index: bfd/dwarf2.c
===================================================================
RCS file: /src/cygnus-cvs/src/bfd/dwarf2.c,v
retrieving revision 1.86
retrieving revision 1.87
diff -u -p -r1.86 -r1.87
--- bfd/dwarf2.c 6 Mar 2006 04:52:03 -0000 1.86
+++ bfd/dwarf2.c 11 Mar 2006 15:01:18 -0000 1.87
@@ -865,8 +865,10 @@ concat_filename (struct line_info_table
if (file - 1 >= table->num_files)
{
- (*_bfd_error_handler)
- (_("Dwarf Error: mangled line number section (bad file number)."));
+ /* FILE == 0 means unknown. */
+ if (file)
+ (*_bfd_error_handler)
+ (_("Dwarf Error: mangled line number section (bad file number)."));
return strdup ("<unknown>");
}
++++++ dwarf2dbg-file.diff ++++++
gas/
2006-02-28 Mat
* dwarf2dbg.c (get_filenum): Don't inadvertently decrease files_in_use.
cvs diff -D"2006/02/28 00:37Z" -D"2006/02/28 00:40Z"
Index: gas/dwarf2dbg.c
===================================================================
RCS file: /src/cygnus-cvs/src/gas/dwarf2dbg.c,v
retrieving revision 1.80
retrieving revision 1.81
diff -u -p -r1.80 -r1.81
--- gas/dwarf2dbg.c 20 Sep 2005 21:00:15 -0000 1.80
+++ gas/dwarf2dbg.c 28 Feb 2006 00:38:19 -0000 1.81
@@ -1,5 +1,5 @@
/* dwarf2dbg.c - DWARF2 debug support
- Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005
+ Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
Contributed by David Mosberger-Tang
@@ -484,7 +484,8 @@ get_filenum (const char *filename, unsig
files[i].filename = num ? file : xstrdup (file);
files[i].dir = dir;
- files_in_use = i + 1;
+ if (files_in_use < i + 1)
+ files_in_use = i + 1;
last_used = i;
last_used_dir_len = dir_len;
++++++ eh-frame.diff ++++++
bfd/
2006-02-27 Jakub Jelinek
* elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Handle S flag.
(_bfd_elf_write_section_eh_frame): Likewise.
gas/
2006-02-27 Jakub Jelinek
* dw2gencfi.c (struct fde_entry, struct cie_entry): Add signal_frame
field.
(CFI_signal_frame): Define.
(cfi_pseudo_table): Add .cfi_signal_frame.
(dot_cfi): Handle CFI_signal_frame.
(output_cie): Handle cie->signal_frame.
(select_cie_for_fde): Don't share CIE if signal_frame flag is
different. Copy signal_frame from FDE to newly created CIE.
* doc/as.texinfo: Document .cfi_signal_frame.
cvs diff -D"2006/02/27 23:06Z" -D"2006/02/27 23:08Z"
Index: bfd/elf-eh-frame.c
===================================================================
RCS file: /src/cygnus-cvs/src/bfd/elf-eh-frame.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -p -r1.47 -r1.48
--- bfd/elf-eh-frame.c 4 May 2005 15:53:07 -0000 1.47
+++ bfd/elf-eh-frame.c 27 Feb 2006 23:07:05 -0000 1.48
@@ -1,5 +1,5 @@
/* .eh_frame section optimization.
- Copyright 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+ Copyright 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
Written by Jakub Jelinek .
This file is part of BFD, the Binary File Descriptor library.
@@ -613,6 +613,8 @@ _bfd_elf_discard_section_eh_frame
ENSURE_NO_RELOCS (buf);
REQUIRE (get_DW_EH_PE_width (cie.fde_encoding, ptr_size));
break;
+ case 'S':
+ break;
case 'P':
{
int per_width;
@@ -1177,6 +1179,8 @@ _bfd_elf_write_section_eh_frame (bfd *ab
action &= ~1;
}
buf++;
+ break;
+ case 'S':
break;
default:
BFD_FAIL ();
Index: gas/dw2gencfi.c
===================================================================
RCS file: /src/cygnus-cvs/src/gas/dw2gencfi.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -p -r1.27 -r1.28
--- gas/dw2gencfi.c 17 Nov 2005 08:33:36 -0000 1.27
+++ gas/dw2gencfi.c 27 Feb 2006 23:07:06 -0000 1.28
@@ -1,5 +1,5 @@
/* dw2gencfi.c - Support for generating Dwarf2 CFI information.
- Copyright 2003, 2004, 2005 Free Software Foundation, Inc.
+ Copyright 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
Contributed by Michal Ludvig
This file is part of GAS, the GNU Assembler.
@@ -88,6 +88,7 @@ struct fde_entry
struct cfi_insn_data *data;
struct cfi_insn_data **last;
unsigned int return_column;
+ unsigned int signal_frame;
};
struct cie_entry
@@ -95,6 +96,7 @@ struct cie_entry
struct cie_entry *next;
symbolS *start_address;
unsigned int return_column;
+ unsigned int signal_frame;
struct cfi_insn_data *first, *last;
};
@@ -354,6 +356,7 @@ static void dot_cfi_endproc (int);
#define CFI_return_column 0x101
#define CFI_rel_offset 0x102
#define CFI_escape 0x103
+#define CFI_signal_frame 0x104
const pseudo_typeS cfi_pseudo_table[] =
{
@@ -374,6 +377,7 @@ const pseudo_typeS cfi_pseudo_table[] =
{ "cfi_restore_state", dot_cfi, DW_CFA_restore_state },
{ "cfi_window_save", dot_cfi, DW_CFA_GNU_window_save },
{ "cfi_escape", dot_cfi_escape, 0 },
+ { "cfi_signal_frame", dot_cfi, CFI_signal_frame },
{ NULL, NULL, 0 }
};
@@ -547,6 +551,10 @@ dot_cfi (int arg)
cfi_add_CFA_insn (DW_CFA_GNU_window_save);
break;
+ case CFI_signal_frame:
+ cur_fde_data->signal_frame = 1;
+ break;
+
default:
abort ();
}
@@ -864,6 +872,8 @@ output_cie (struct cie_entry *cie)
out_one (DW_CIE_VERSION); /* Version. */
out_one ('z'); /* Augmentation. */
out_one ('R');
+ if (cie->signal_frame)
+ out_one ('S');
out_one (0);
out_uleb128 (DWARF2_LINE_MIN_INSN_LENGTH); /* Code alignment. */
out_sleb128 (DWARF2_CIE_DATA_ALIGNMENT); /* Data alignment. */
@@ -944,7 +954,8 @@ select_cie_for_fde (struct fde_entry *fd
for (cie = cie_root; cie; cie = cie->next)
{
- if (cie->return_column != fde->return_column)
+ if (cie->return_column != fde->return_column
+ || cie->signal_frame != fde->signal_frame)
continue;
for (i = cie->first, j = fde->data;
i != cie->last && j != NULL;
@@ -1017,6 +1028,7 @@ select_cie_for_fde (struct fde_entry *fd
cie->next = cie_root;
cie_root = cie;
cie->return_column = fde->return_column;
+ cie->signal_frame = fde->signal_frame;
cie->first = fde->data;
for (i = cie->first; i ; i = i->next)
Index: gas/doc/as.texinfo
===================================================================
RCS file: /src/cygnus-cvs/src/gas/doc/as.texinfo,v
retrieving revision 1.139
retrieving revision 1.140
diff -u -p -r1.139 -r1.140
--- gas/doc/as.texinfo 26 Nov 2005 20:03:53 -0000 1.139
+++ gas/doc/as.texinfo 27 Feb 2006 23:07:06 -0000 1.140
@@ -4102,6 +4102,9 @@ using the known displacement of the CFA
This is often easier to use, because the number will match the
code it's annotating.
+@section @code{.cfi_signal_frame}
+Mark current function as signal trampoline.
+
@section @code{.cfi_window_save}
SPARC register window has been saved.
++++++ elf-emit-reloc.diff ++++++
2006-03-17 Daniel Jacobowitz
PR ld/2462
* elflink.c (bfd_elf_final_link): Remove
bed->elf_backend_emit_relocs from emit_relocs.
cvs diff -D"2006/03/17 18:37Z" -D"2006/03/17 18:38Z"
Index: bfd/elflink.c
===================================================================
RCS file: /src/cygnus-cvs/src/bfd/elflink.c,v
retrieving revision 1.206
retrieving revision 1.207
diff -u -p -r1.206 -r1.207
--- bfd/elflink.c 17 Mar 2006 03:19:56 -0000 1.206
+++ bfd/elflink.c 17 Mar 2006 18:37:21 -0000 1.207
@@ -7782,8 +7782,7 @@ bfd_elf_final_link (bfd *abfd, struct bf
dynobj = elf_hash_table (info)->dynobj;
emit_relocs = (info->relocatable
- || info->emitrelocations
- || bed->elf_backend_emit_relocs);
+ || info->emitrelocations);
finfo.info = info;
finfo.output_bfd = abfd;
++++++ elf-fixup.diff ++++++
2006-03-30 Ben Elliston
PR ld/2267
* elflink.c (elf_fixup_link_order): Ensure `elfsec' is not a
special section number that exceeds the number of ELF sections
(eg. SHN_MIPS_SCOMMON).
cvs diff -D"2006/03/30 00:21Z" -D"2006/03/30 00:24Z"
Index: bfd/elflink.c
===================================================================
RCS file: /src/cygnus-cvs/src/bfd/elflink.c,v
retrieving revision 1.207
retrieving revision 1.208
diff -u -p -r1.207 -r1.208
--- bfd/elflink.c 17 Mar 2006 18:37:21 -0000 1.207
+++ bfd/elflink.c 30 Mar 2006 00:22:20 -0000 1.208
@@ -7665,7 +7665,7 @@ elf_fixup_link_order (bfd *abfd, asectio
struct bfd_link_order *p;
bfd *sub;
const struct elf_backend_data *bed = get_elf_backend_data (abfd);
- int elfsec;
+ unsigned elfsec;
struct bfd_link_order **sections;
asection *s, *other_sec, *linkorder_sec;
bfd_vma offset;
@@ -7682,7 +7682,8 @@ elf_fixup_link_order (bfd *abfd, asectio
sub = s->owner;
if (bfd_get_flavour (sub) == bfd_target_elf_flavour
&& elf_elfheader (sub)->e_ident[EI_CLASS] == bed->s->elfclass
- && (elfsec = _bfd_elf_section_from_bfd_section (sub, s)) != -1
+ && (elfsec = _bfd_elf_section_from_bfd_section (sub, s))
+ && elfsec < elf_numsections (sub)
&& elf_elfsections (sub)[elfsec]->sh_flags & SHF_LINK_ORDER)
{
seen_linkorder++;
++++++ gas-close.diff ++++++
2006-02-08 H.J. Lu
* as.c (close_output_file): New.
(main): Register close_output_file with xatexit before
dump_statistics. Don't call output_file_close.
cvs diff -D"2006/02/09 00:07Z" -D"2006/02/09 00:09Z"
Index: gas/as.c
===================================================================
RCS file: /src/cygnus-cvs/src/gas/as.c,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -p -r1.67 -r1.68
--- gas/as.c 30 Oct 2005 18:08:52 -0000 1.67
+++ gas/as.c 9 Feb 2006 00:07:41 -0000 1.68
@@ -930,6 +930,14 @@ dump_statistics (void)
#endif
}
+#ifndef OBJ_VMS
+static void
+close_output_file (void)
+{
+ output_file_close (out_file_name);
+}
+#endif
+
/* The interface between the macro code and gas expression handling. */
static int
@@ -1081,6 +1089,11 @@ main (int argc, char ** argv)
input_scrub_begin ();
expr_begin ();
+#ifndef OBJ_VMS /* Does its own file handling. */
+ /* It has to be called after dump_statistics (). */
+ xatexit (close_output_file);
+#endif
+
if (flag_print_statistics)
xatexit (dump_statistics);
@@ -1167,10 +1180,6 @@ main (int argc, char ** argv)
#ifndef NO_LISTING
listing_print (listing_filename);
-#endif
-
-#ifndef OBJ_VMS /* Does its own file handling. */
- output_file_close (out_file_name);
#endif
if (flag_fatal_warnings && had_warnings () > 0 && had_errors () == 0)
++++++ ld-search-order.diff ++++++
2006-02-08 H.J. Lu
PR ld/2290
* NEWS: Updated for the Linux linker search order change.
* emultempl/elf32.em (gld${EMULATION_NAME}_after_open): Call
gld${EMULATION_NAME}_check_ld_so_conf before checking default
search directories for DT_NEEDED entries.
cvs diff -D"2006/02/09 01:04Z" -D"2006/02/09 01:06Z"
(edited NEWS diff)
Index: ld/NEWS
===================================================================
RCS file: /src/cygnus-cvs/src/ld/NEWS,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -p -r1.62 -r1.63
--- ld/NEWS 31 Jan 2006 22:13:41 -0000 1.62
+++ ld/NEWS 9 Feb 2006 01:05:10 -0000 1.63
@@ -1,5 +1,8 @@
-*- text -*-
+* Modify the Linux linker to seach /etc/ld.so.conf first before
+ checking default search directories for DT_NEEDED entries.
+
* Support for the Z80 processor family has been added.
* Add support for the "@<file>" syntax to the command line, so that extra
Index: ld/emultempl/elf32.em
===================================================================
RCS file: /src/cygnus-cvs/src/ld/emultempl/elf32.em,v
retrieving revision 1.161
retrieving revision 1.162
diff -u -p -r1.161 -r1.162
--- ld/emultempl/elf32.em 7 Dec 2005 14:43:54 -0000 1.161
+++ ld/emultempl/elf32.em 9 Feb 2006 01:05:10 -0000 1.162
@@ -919,6 +919,18 @@ cat >>e${EMULATION_NAME}.c <>e${EMULATION_NAME}.c <name, force))
+ break;
+
+EOF
+ ;;
+ esac
+fi
cat >>e${EMULATION_NAME}.c <name);
for (search = search_head; search != NULL; search = search->next)
@@ -937,17 +949,6 @@ cat >>e${EMULATION_NAME}.c <>e${EMULATION_NAME}.c <name, force))
- break;
-EOF
- # Linux
- ;;
- esac
-fi
cat >>e${EMULATION_NAME}.c <
* dwarf2.c (lookup_symbol_in_function_table): Check for a function
name before passing it to strcmp.
cvs diff -D"2005/12/27 16:06Z" -D"2005/12/27 16:09Z"
Index: bfd/dwarf2.c
===================================================================
RCS file: /src/cygnus-cvs/src/bfd/dwarf2.c,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -p -r1.81 -r1.82
--- bfd/dwarf2.c 22 Sep 2005 19:50:27 -0000 1.81
+++ bfd/dwarf2.c 27 Dec 2005 16:07:36 -0000 1.82
@@ -1467,6 +1467,7 @@ lookup_symbol_in_function_table (struct
if ((!each_func->sec || each_func->sec == sec)
&& addr >= arange->low
&& addr < arange->high
+ && each_func->name
&& strcmp (name, each_func->name) == 0
&& (!best_fit
|| ((arange->high - arange->low)
++++++ ppc-got-reloc.diff ++++++
2006-03-16 Alan Modra
* elf32-ppc.c (ppc_elf_check_relocs): REL24 and REL14 relocs
against __GLOBAL_OFFSET_TABLE__ need never be dynamic. Tweak
last change to REL32 relocs so that they are counted as
possibly dynamic as per REL24 and REL14.
2006-03-16 Alan Modra
* elf32-ppc.c (ppc_elf_check_relocs): Don't fall into REL24
checks from REL32.
cvs diff -D"2006/03/15 13:52Z" -D"2006/03/15 14:31Z"
(edited to suit lack of htab->plt_type patch)
Index: bfd/elf32-ppc.c
===================================================================
RCS file: /src/cygnus-cvs/src/bfd/elf32-ppc.c,v
retrieving revision 1.192
retrieving revision 1.194
diff -u -p -r1.192 -r1.194
--- bfd/elf32-ppc.c 2 Mar 2006 09:44:23 -0000 1.192
+++ bfd/elf32-ppc.c 15 Mar 2006 14:30:18 -0000 1.194
@@ -3335,7 +3335,9 @@ ppc_elf_check_relocs (bfd *abfd,
if (s == got2)
htab->old_plt = 1;
}
- /* fall through */
+ if (h == NULL || h == htab->elf.hgot)
+ break;
+ goto dodyn1;
case R_PPC_REL24:
case R_PPC_REL14:
@@ -3361,6 +3364,7 @@ ppc_elf_check_relocs (bfd *abfd,
case R_PPC_ADDR14_BRNTAKEN:
case R_PPC_UADDR32:
case R_PPC_UADDR16:
+ dodyn1:
if (h != NULL && !info->shared)
{
/* We may need a plt entry if the symbol turns out to be
++++++ ppc-stub-sym.diff ++++++
2005-12-27 Alan Modra
* elf32-ppc.c (add_stub_sym): Pass info rather than htab.
Use different names for pic vs non-pic, '.' instead of '_'.
(allocate_dynrelocs): Adjust add_stub_sym call.
cvs diff -D"2005/12/27 03:53Z" -D"2005/12/27 03:56Z"
Index: bfd/elf32-ppc.c
===================================================================
RCS file: /src/cygnus-cvs/src/bfd/elf32-ppc.c,v
retrieving revision 1.184
retrieving revision 1.185
diff -u -p -r1.184 -r1.185
--- bfd/elf32-ppc.c 8 Dec 2005 11:41:11 -0000 1.184
+++ bfd/elf32-ppc.c 27 Dec 2005 03:54:33 -0000 1.185
@@ -4213,34 +4213,41 @@ ppc_elf_adjust_dynamic_symbol (struct bf
return TRUE;
}
-/* Generate a symbol to mark plt call stubs, of the form
- xxxxxxxx_plt_call_<callee> where xxxxxxxx is a hex number, usually 0,
- specifying the addend on the plt relocation, or for -fPIC,
- xxxxxxxx.got2_plt_call_<callee>. */
+/* Generate a symbol to mark plt call stubs. For non-PIC code the sym is
+ xxxxxxxx.plt_call32.<callee> where xxxxxxxx is a hex number, usually 0,
+ specifying the addend on the plt relocation. For -fpic code, the sym
+ is xxxxxxxx.plt_pic32.<callee>, and for -fPIC
+ xxxxxxxx.got2.plt_pic32.<callee>. */
static bfd_boolean
add_stub_sym (struct plt_entry *ent,
struct elf_link_hash_entry *h,
- struct ppc_elf_link_hash_table *htab)
+ struct bfd_link_info *info)
{
struct elf_link_hash_entry *sh;
size_t len1, len2, len3;
char *name;
+ const char *stub;
+ struct ppc_elf_link_hash_table *htab = ppc_elf_hash_table (info);
+
+ if (info->shared || info->pie)
+ stub = ".plt_pic32.";
+ else
+ stub = ".plt_call32.";
len1 = strlen (h->root.root.string);
- len2 = sizeof ("plt_call_") - 1;
+ len2 = strlen (stub);
len3 = 0;
if (ent->sec)
len3 = strlen (ent->sec->name);
- name = bfd_malloc (len1 + len2 + len3 + 10);
+ name = bfd_malloc (len1 + len2 + len3 + 9);
if (name == NULL)
return FALSE;
sprintf (name, "%08x", (unsigned) ent->addend & 0xffffffff);
if (ent->sec)
memcpy (name + 8, ent->sec->name, len3);
- name[len3 + 8] = '_';
- memcpy (name + len3 + 9, "plt_call_", len2);
- memcpy (name + len3 + 9 + len2, h->root.root.string, len1 + 1);
+ memcpy (name + 8 + len3, stub, len2);
+ memcpy (name + 8 + len3 + len2, h->root.root.string, len1 + 1);
sh = elf_link_hash_lookup (&htab->elf, name, TRUE, FALSE, FALSE);
if (sh == NULL)
return FALSE;
@@ -4361,7 +4368,7 @@ allocate_dynrelocs (struct elf_link_hash
ent->glink_offset = glink_offset;
if (htab->emit_stub_syms
- && !add_stub_sym (ent, h, htab))
+ && !add_stub_sym (ent, h, info))
return FALSE;
}
else
++++++ ppc-tls.diff ++++++
bfd/
2006-03-17 Alexandre Oliva
* elf32-ppc.c (ppc_elf_relocate_section): Copy addend from
first relocation to the second when relaxing TLS GD to LE;
zero it out when relaxing to IE.
ld/testsuite/
2006-03-17 Alexandre Oliva
* ld-powerpc/tls32.s: Verify that +32768 @plt addend is
discarded.
cvs diff -D"2006/03/17 06:44Z" -D"2006/03/17 06:45Z"
Index: bfd/elf32-ppc.c
===================================================================
RCS file: /src/cygnus-cvs/src/bfd/elf32-ppc.c,v
retrieving revision 1.195
retrieving revision 1.196
diff -u -p -r1.195 -r1.196
--- bfd/elf32-ppc.c 16 Mar 2006 12:20:15 -0000 1.195
+++ bfd/elf32-ppc.c 17 Mar 2006 06:44:37 -0000 1.196
@@ -5768,6 +5768,7 @@ ppc_elf_relocate_section (bfd *output_bf
insn1 |= 32 << 26; /* lwz */
insn2 = 0x7c631214; /* add 3,3,2 */
rel[1].r_info = ELF32_R_INFO (r_symndx2, R_PPC_NONE);
+ rel[1].r_addend = 0;
r_type = (((r_type - (R_PPC_GOT_TLSGD16 & 3)) & 3)
+ R_PPC_GOT_TPREL16);
rel->r_info = ELF32_R_INFO (r_symndx, r_type);
@@ -5782,13 +5783,13 @@ ppc_elf_relocate_section (bfd *output_bf
/* Was an LD reloc. */
r_symndx = 0;
rel->r_addend = htab->elf.tls_sec->vma + DTP_OFFSET;
- rel[1].r_addend = htab->elf.tls_sec->vma + DTP_OFFSET;
}
r_type = R_PPC_TPREL16_HA;
rel->r_info = ELF32_R_INFO (r_symndx, r_type);
rel[1].r_info = ELF32_R_INFO (r_symndx,
R_PPC_TPREL16_LO);
rel[1].r_offset += 2;
+ rel[1].r_addend = rel->r_addend;
}
bfd_put_32 (output_bfd, insn1, contents + rel->r_offset - 2);
bfd_put_32 (output_bfd, insn2, contents + offset);
Index: ld/testsuite/ld-powerpc/tls32.s
===================================================================
RCS file: /src/cygnus-cvs/src/ld/testsuite/ld-powerpc/tls32.s,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- ld/testsuite/ld-powerpc/tls32.s 1 Oct 2004 20:11:39 -0000 1.3
+++ ld/testsuite/ld-powerpc/tls32.s 17 Mar 2006 06:44:37 -0000 1.4
@@ -33,11 +33,11 @@ _start:
#global syms
#GD
addi 3,31,gd0@got@tlsgd #R_PPC_GOT_TLSGD16 gd0
- bl __tls_get_addr@plt #R_PPC_PLTREL24 __tls_get_addr
+ bl __tls_get_addr+0x8000@plt #R_PPC_PLTREL24 __tls_get_addr
#LD
addi 3,31,ld0@got@tlsld #R_PPC_GOT_TLSLD16 ld0
- bl __tls_get_addr@plt #R_PPC_PLTREL24 __tls_get_addr
+ bl __tls_get_addr+0x8000@plt #R_PPC_PLTREL24 __tls_get_addr
addi 9,3,ld0@dtprel #R_PPC_DTPREL16 ld0
++++++ ppc64-opd.diff ++++++
2005-12-31 Alan Modra
* elf64-ppc.c (ppc64_elf_relocate_section): Adjust relocs against
opd section sym when opd has been edited. Use correct addend
when determining branch 'y' bit and branch overflow. Adjust and
save opd relocs for ld -r too.
cvs diff -D"2005/12/31 12:54Z" -D"2005/12/31 12:57Z"
Index: bfd/elf64-ppc.c
===================================================================
RCS file: /src/cygnus-cvs/src/bfd/elf64-ppc.c,v
retrieving revision 1.228
retrieving revision 1.229
diff -u -p -r1.228 -r1.229
--- bfd/elf64-ppc.c 13 Dec 2005 05:39:34 -0000 1.228
+++ bfd/elf64-ppc.c 31 Dec 2005 12:55:10 -0000 1.229
@@ -9550,9 +9550,6 @@ ppc64_elf_relocate_section (bfd *output_
/* Disabled until we sort out how ld should choose 'y' vs 'at'. */
bfd_boolean is_power4 = FALSE;
- if (info->relocatable)
- return TRUE;
-
/* Initialize howto table if needed. */
if (!ppc64_elf_howto_table[R_PPC64_ADDR32])
ppc_howto_init ();
@@ -9574,7 +9571,7 @@ ppc64_elf_relocate_section (bfd *output_
for (; rel < relend; rel++)
{
enum elf_ppc64_reloc_type r_type;
- bfd_vma addend;
+ bfd_vma addend, orig_addend;
bfd_reloc_status_type r;
Elf_Internal_Sym *sym;
asection *sec;
@@ -9611,6 +9608,7 @@ ppc64_elf_relocate_section (bfd *output_
sym_name = NULL;
unresolved_reloc = FALSE;
warned = FALSE;
+ orig_addend = rel->r_addend;
if (r_symndx < symtab_hdr->sh_info)
{
@@ -9629,11 +9627,25 @@ ppc64_elf_relocate_section (bfd *output_
if (adjust == -1)
relocation = 0;
else
- relocation += adjust;
+ {
+ /* If this is a relocation against the opd section sym
+ and we have edited .opd, adjust the reloc addend so
+ that ld -r and ld --emit-relocs output is correct.
+ If it is a reloc against some other .opd symbol,
+ then the symbol value will be adjusted later. */
+ if (ELF_ST_TYPE (sym->st_info) == STT_SECTION)
+ rel->r_addend += adjust;
+ else
+ relocation += adjust;
+ }
}
+ if (info->relocatable)
+ continue;
}
else
{
+ if (info->relocatable)
+ continue;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h_elf, sec, relocation,
@@ -10126,8 +10138,9 @@ ppc64_elf_relocate_section (bfd *output_
&& get_opd_info (sec) != NULL)
{
/* The branch destination is the value of the opd entry. */
- bfd_vma off = (relocation - sec->output_section->vma
- - sec->output_offset + rel->r_addend);
+ bfd_vma off = (relocation + addend
+ - sec->output_section->vma
+ - sec->output_offset);
bfd_vma dest = opd_entry_value (sec, off, NULL, NULL);
if (dest != (bfd_vma) -1)
{
@@ -10143,7 +10156,7 @@ ppc64_elf_relocate_section (bfd *output_
+ input_section->output_section->vma);
if (stub_entry == NULL
- && (relocation + rel->r_addend - from + max_br_offset
+ && (relocation + addend - from + max_br_offset
>= 2 * max_br_offset)
&& r_type != R_PPC64_ADDR14_BRTAKEN
&& r_type != R_PPC64_ADDR14_BRNTAKEN)
@@ -10177,7 +10190,7 @@ ppc64_elf_relocate_section (bfd *output_
else
{
/* Invert 'y' bit if not the default. */
- if ((bfd_signed_vma) (relocation + rel->r_addend - from) < 0)
+ if ((bfd_signed_vma) (relocation + addend - from) < 0)
insn ^= 0x01 << 21;
}
@@ -10191,7 +10204,7 @@ ppc64_elf_relocate_section (bfd *output_
&& h->elf.root.type == bfd_link_hash_undefweak
&& r_type == R_PPC64_REL24
&& relocation == 0
- && rel->r_addend == 0)
+ && addend == 0)
{
bfd_put_32 (output_bfd, NOP, contents + rel->r_offset);
continue;
@@ -10300,7 +10313,7 @@ ppc64_elf_relocate_section (bfd *output_
}
for (; ent != NULL; ent = ent->next)
- if (ent->addend == rel->r_addend
+ if (ent->addend == orig_addend
&& ent->owner == input_bfd
&& ent->tls_type == tls_type)
break;
@@ -10335,7 +10348,7 @@ ppc64_elf_relocate_section (bfd *output_
outrel.r_offset = (got->output_section->vma
+ got->output_offset
+ off);
- outrel.r_addend = rel->r_addend;
+ outrel.r_addend = addend;
if (tls_type & (TLS_LD | TLS_GD))
{
outrel.r_addend = 0;
@@ -10348,7 +10361,7 @@ ppc64_elf_relocate_section (bfd *output_
bfd_elf64_swap_reloca_out (output_bfd,
&outrel, loc);
outrel.r_offset += 8;
- outrel.r_addend = rel->r_addend;
+ outrel.r_addend = addend;
outrel.r_info
= ELF64_R_INFO (indx, R_PPC64_DTPREL64);
}
@@ -10386,7 +10399,7 @@ ppc64_elf_relocate_section (bfd *output_
emitting a reloc. */
else
{
- relocation += rel->r_addend;
+ relocation += addend;
if (tls_type == (TLS_TLS | TLS_LD))
relocation = 1;
else if (tls_type != 0)
@@ -10439,7 +10452,7 @@ ppc64_elf_relocate_section (bfd *output_
{
struct plt_entry *ent;
for (ent = h->elf.plt.plist; ent != NULL; ent = ent->next)
- if (ent->addend == rel->r_addend
+ if (ent->addend == orig_addend
&& ent->plt.offset != (bfd_vma) -1)
{
relocation = (htab->plt->output_section->vma
@@ -10885,7 +10898,7 @@ ppc64_elf_relocate_section (bfd *output_
if (!((*info->callbacks->reloc_overflow)
(info, (h ? &h->elf.root : NULL), sym_name,
ppc64_elf_howto_table[r_type]->name,
- rel->r_addend, input_bfd, input_section, rel->r_offset)))
+ orig_addend, input_bfd, input_section, rel->r_offset)))
return FALSE;
}
else
@@ -10908,7 +10921,7 @@ ppc64_elf_relocate_section (bfd *output_
adjusted. Worse, reloc symbol indices will be for the output
file rather than the input. Save a copy of the relocs for
opd_entry_value. */
- if (is_opd && info->emitrelocations)
+ if (is_opd && (info->emitrelocations || info->relocatable))
{
bfd_size_type amt;
amt = input_section->reloc_count * sizeof (Elf_Internal_Rela);
++++++ ppc64-toc1.diff ++++++
2006-01-01 Jakub Jelinek
* elf64-ppc.c (ppc64_elf_action_discarded): Return 0
for .toc1 section.
cvs diff -D"2006/01/01 00:05Z" -D"2006/01/01 00:07Z"
Index: bfd/elf64-ppc.c
===================================================================
RCS file: /src/cygnus-cvs/src/bfd/elf64-ppc.c,v
retrieving revision 1.229
retrieving revision 1.230
diff -u -p -r1.229 -r1.230
--- bfd/elf64-ppc.c 31 Dec 2005 12:55:10 -0000 1.229
+++ bfd/elf64-ppc.c 1 Jan 2006 00:06:24 -0000 1.230
@@ -1,5 +1,5 @@
/* PowerPC64-specific support for 64-bit ELF.
- Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005
+ Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
Written by Linus Nordberg, Swox AB ,
based on elf32-ppc.c by Ian Lance Taylor.
@@ -9492,6 +9492,9 @@ ppc64_elf_action_discarded (asection *se
return 0;
if (strcmp (".toc", sec->name) == 0)
+ return 0;
+
+ if (strcmp (".toc1", sec->name) == 0)
return 0;
return _bfd_elf_default_action_discarded (sec);
++++++ readelf.diff ++++++
2006-03-10 Alan Modra
* dwarf.c (process_extended_line_op): Remove pointer_size param.
Use length instead to determine address size.
(get_pointer_size_and_offset_of_comp_unit): Delete.
(display_debug_lines): Adjust for above.
(display_debug_aranges): Don't stop on finding two zeros.
(display_debug_frames): For warning, print offset not pointer.
cvs diff -D"2006/03/10 13:29Z" -D"2006/03/10 13:32Z"
Index: binutils/dwarf.c
===================================================================
RCS file: /src/cygnus-cvs/src/binutils/dwarf.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- binutils/dwarf.c 3 Mar 2006 18:29:40 -0000 1.3
+++ binutils/dwarf.c 10 Mar 2006 13:30:10 -0000 1.4
@@ -221,7 +221,7 @@ reset_state_machine (int is_stmt)
Returns the number of bytes read. */
static int
-process_extended_line_op (unsigned char *data, int is_stmt, int pointer_size)
+process_extended_line_op (unsigned char *data, int is_stmt)
{
unsigned char op_code;
unsigned int bytes_read;
@@ -251,7 +251,7 @@ process_extended_line_op (unsigned char
break;
case DW_LNE_set_address:
- adr = byte_get (data, pointer_size);
+ adr = byte_get (data, len - bytes_read - 1);
printf (_("set Address to 0x%lx\n"), adr);
state_machine_regs.address = adr;
break;
@@ -1766,55 +1766,12 @@ load_debug_info (void * file)
return 0;
}
-/* Retrieve the pointer size associated with the given compilation unit.
- Optionally the offset of this unit into the .debug_info section is
- also retutned. If there is no .debug_info section then an error
- message is issued and 0 is returned. If the requested comp unit has
- not been defined in the .debug_info section then a warning message
- is issued and the last know pointer size is returned. This message
- is only issued once per section dumped per file dumped. */
-
-static unsigned int
-get_pointer_size_and_offset_of_comp_unit (unsigned int comp_unit,
- const char * section_name,
- unsigned long * offset_return)
-{
- unsigned long offset = 0;
-
- if (num_debug_info_entries == 0)
- error (_("%s section needs a populated .debug_info section\n"),
- section_name);
-
- else if (comp_unit >= num_debug_info_entries)
- {
- if (!warned_about_missing_comp_units)
- {
- warn (_("%s section has more comp units than .debug_info section\n"),
- section_name);
- warn (_("assuming that the pointer size is %d, from the last comp unit in .debug_info\n\n"),
- last_pointer_size);
- warned_about_missing_comp_units = TRUE;
- }
- }
- else
- {
- last_pointer_size = debug_information [comp_unit].pointer_size;
- offset = debug_information [comp_unit].cu_offset;
- }
-
- if (offset_return != NULL)
- * offset_return = offset;
-
- return last_pointer_size;
-}
-
static int
display_debug_lines (struct dwarf_section *section, void *file)
{
unsigned char *start = section->start;
unsigned char *data = start;
unsigned char *end = start + section->size;
- unsigned int comp_unit = 0;
printf (_("\nDump of debug contents of section %s:\n\n"),
section->name);
@@ -1827,7 +1784,6 @@ display_debug_lines (struct dwarf_sectio
unsigned char *standard_opcodes;
unsigned char *end_of_sequence;
unsigned char *hdrptr;
- unsigned int pointer_size;
int initial_length_size;
int offset_size;
int i;
@@ -1885,12 +1841,6 @@ display_debug_lines (struct dwarf_sectio
info.li_line_base <<= 24;
info.li_line_base >>= 24;
- /* Get the pointer size from the comp unit associated
- with this block of line number information. */
- pointer_size = get_pointer_size_and_offset_of_comp_unit
- (comp_unit, ".debug_line", NULL);
- comp_unit ++;
-
printf (_(" Length: %ld\n"), info.li_length);
printf (_(" DWARF Version: %d\n"), info.li_version);
printf (_(" Prologue Length: %d\n"), info.li_prologue_length);
@@ -1899,9 +1849,6 @@ display_debug_lines (struct dwarf_sectio
printf (_(" Line Base: %d\n"), info.li_line_base);
printf (_(" Line Range: %d\n"), info.li_line_range);
printf (_(" Opcode Base: %d\n"), info.li_opcode_base);
- printf (_(" (Pointer size: %u)%s\n"),
- pointer_size,
- warned_about_missing_comp_units ? " [assumed]" : "" );
end_of_sequence = data + info.li_length + initial_length_size;
@@ -1993,14 +1940,7 @@ display_debug_lines (struct dwarf_sectio
else switch (op_code)
{
case DW_LNS_extended_op:
- if (pointer_size == 0)
- {
- warn (_("Extend line ops need a valid pointer size, guessing at 4\n"));
- pointer_size = 4;
- }
-
- data += process_extended_line_op (data, info.li_default_is_stmt,
- pointer_size);
+ data += process_extended_line_op (data, info.li_default_is_stmt);
break;
case DW_LNS_copy:
@@ -2634,7 +2574,9 @@ display_debug_aranges (struct dwarf_sect
if (excess)
ranges += (2 * arange.ar_pointer_size) - excess;
- for (;;)
+ start += arange.ar_length + initial_length_size;
+
+ while (ranges + 2 * arange.ar_pointer_size <= start)
{
address = byte_get (ranges, arange.ar_pointer_size);
@@ -2644,14 +2586,8 @@ display_debug_aranges (struct dwarf_sect
ranges += arange.ar_pointer_size;
- /* A pair of zeros marks the end of the list. */
- if (address == 0 && length == 0)
- break;
-
printf (" %8.8lx %lu\n", address, length);
}
-
- start += arange.ar_length + initial_length_size;
}
printf ("\n");
@@ -3142,8 +3078,8 @@ display_debug_frames (struct dwarf_secti
if (!cie)
{
- warn ("Invalid CIE pointer %08lx in FDE at %p\n",
- cie_id, saved_start);
+ warn ("Invalid CIE pointer %08lx in FDE at %08lx\n",
+ cie_id, (unsigned long)(saved_start - section_start));
start = block_end;
fc->ncols = 0;
fc->col_type = xmalloc (sizeof (short int));
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...