aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authornobody <>2003-03-08 00:00:32 +0000
committernobody <>2003-03-08 00:00:32 +0000
commitdf12d73d19b31ec578eb6be37bb15e21b06ec746 (patch)
treea6d43b314e3acc615c2a1b86d8756228881c91e3 /bfd
parent900958cda09af0ca2839cc7e2a7c46355b051c83 (diff)
downloadfsf-binutils-gdb-df12d73d19b31ec578eb6be37bb15e21b06ec746.zip
fsf-binutils-gdb-df12d73d19b31ec578eb6be37bb15e21b06ec746.tar.gz
fsf-binutils-gdb-df12d73d19b31ec578eb6be37bb15e21b06ec746.tar.bz2
This commit was manufactured by cvs2svn to create branch 'kettenis-kettenis-i386newframe-20030308-branchpoint
i386newframe-20030308-branch'. Sprout from cagney_offbyone-20030303-branch 2003-03-03 20:50:21 UTC nobody 'This commit was manufactured by cvs2svn to create branch' Cherrypick from master 2003-03-08 00:00:31 UTC gdbadmin <gdbadmin@sourceware.org> '*** empty log message ***': ChangeLog Makefile.in Makefile.tpl bfd/ChangeLog bfd/elf32-i386.c bfd/elf32-ppc.c bfd/elf32-sh.c bfd/elf64-ppc.c bfd/elflink.h bfd/elfxx-ia64.c bfd/som.c bfd/version.h config/ChangeLog configure configure.in gdb/ChangeLog gdb/MAINTAINERS gdb/Makefile.in gdb/avr-tdep.c gdb/cp-abi.c gdb/cp-abi.h gdb/d10v-tdep.c gdb/doc/ChangeLog gdb/doc/gdb.texinfo gdb/doc/gdbint.texinfo gdb/doc/stabs.texinfo gdb/dwarf2expr.c gdb/dwarf2loc.c gdb/frame.c gdb/frame.h gdb/gdbarch.c gdb/gdbarch.h gdb/gdbarch.sh gdb/gnu-v2-abi.c gdb/gnu-v3-abi.c gdb/hpacc-abi.c gdb/minsyms.c gdb/symtab.c gdb/testsuite/ChangeLog gdb/testsuite/gdb.c++/templates.exp gdb/version.in gdb/x86-64-tdep.c gdb/x86-64-tdep.h include/aout/ChangeLog include/aout/aout64.h include/elf/ChangeLog include/elf/sh.h libiberty/ChangeLog libiberty/cplus-dem.c texinfo/texinfo.tex Delete: config/mh-dgux
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog57
-rw-r--r--bfd/elf32-i386.c50
-rw-r--r--bfd/elf32-ppc.c66
-rw-r--r--bfd/elf32-sh.c40
-rw-r--r--bfd/elf64-ppc.c37
-rw-r--r--bfd/elflink.h8
-rw-r--r--bfd/elfxx-ia64.c31
-rw-r--r--bfd/som.c19
-rw-r--r--bfd/version.h2
9 files changed, 187 insertions, 123 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 393ab0f..aca51b8 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,60 @@
+2003-03-07 Alan Modra <amodra@bigpond.net.au>
+
+ * elf32-ppc.c (ppc_elf_relocate_section): Don't look for a nop after
+ a tls_get_addr call.
+
+ * elf32-ppc.c (ELIMINATE_COPY_RELOCS): Define as one.
+ (ppc_elf_adjust_dynamic_symbol): For weak symbols, copy
+ ELF_LINK_NON_GOT_REF from weakdef.
+ * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Define as one.
+ (ppc64_elf_adjust_dynamic_symbol): For weak symbols, copy
+ ELF_LINK_NON_GOT_REF from weakdef.
+ * elf32-i386.c (ELIMINATE_COPY_RELOCS): Define as one. Use throughout.
+ (elf_i386_adjust_dynamic_symbol): For weak symbols, copy
+ ELF_LINK_NON_GOT_REF from weakdef.
+
+2003-03-06 Jakub Jelinek <jakub@redhat.com>
+ Andrew Haley <aph@redhat.com>
+
+ * elflink.h (elf_bfd_discard_info): Don't process eh frames if
+ output is relocateable.
+
+2003-03-06 Steven Konopa <skonopa@kgo.csc.com>
+
+ * som.c (som_fixup_formats): Correct formats for R_AUX_UNWIND and
+ R_COMMENT.
+
+2003-03-06 Alan Modra <amodra@bigpond.net.au>
+
+ * elf32-ppc.c (ppc_elf_create_linker_section): Don't capitalize
+ error messages.
+ (ELIMINATE_COPY_RELOCS): Define to zero.
+ (ppc_elf_relocate_section): Don't deref htab->tls_sec when calculating
+ TLSLD relocs. Report reloc types on a number of errors. Optimize
+ LOCAL24PC check for non-local syms. Don't capitalize error messages.
+ * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Define to zero.
+ (ppc64_elf_relocate_section): Don't deref htab->tls_sec when
+ calculating TLSLD relocs. Report reloc types on a number of errors.
+ Don't capitalize error messages.
+
+2003-03-03 H.J. Lu <hjl@gnu.org>
+
+ * elfxx-ia64.c (USE_BRL): Removed.
+ (oor_ip): Removed.
+
+2003-03-03 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * elf32-sh.c (sh_elf_howto_tab): Make R_SH_IND12W into an ordinary
+ relocation (no special function), and make it non-partial_inplace.
+ (sh_elf_relax_section): When creating a bsr, use a consistent value
+ no matter if the symbol is extern or not; set addend to -4.
+ Don't swap load / non-load instructions for SH4.
+ (sh_elf_relax_delete_bytes): In R_SH_IND12W case, check the offset
+ rather than if the symbol is external to determine if adjusting the
+ offset makes sense. Adjust the addend too if appropriate.
+ (sh_elf_relocate_section): In R_SH_IND12W, don't fiddle with the
+ relocation.
+
2003-03-03 Nick Clifton <nickc@redhat.com>
* po/da.po: Installed latest translation.
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index a751d98..eae3190 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -506,6 +506,12 @@ elf_i386_grok_psinfo (abfd, note)
#define ELF_DYNAMIC_INTERPRETER "/usr/lib/libc.so.1"
+/* If ELIMINATE_COPY_RELOCS is non-zero, the linker will try to avoid
+ copying dynamic variables from a shared lib into an app's dynbss
+ section, and instead use a dynamic relocation to point into the
+ shared lib. */
+#define ELIMINATE_COPY_RELOCS 1
+
/* The size in bytes of an entry in the procedure linkage table. */
#define PLT_ENTRY_SIZE 16
@@ -1106,7 +1112,8 @@ elf_i386_check_relocs (abfd, info, sec, relocs)
|| h->root.type == bfd_link_hash_defweak
|| (h->elf_link_hash_flags
& ELF_LINK_HASH_DEF_REGULAR) == 0))))
- || (!info->shared
+ || (ELIMINATE_COPY_RELOCS
+ && !info->shared
&& (sec->flags & SEC_ALLOC) != 0
&& h != NULL
&& (h->root.type == bfd_link_hash_defweak
@@ -1372,8 +1379,6 @@ elf_i386_adjust_dynamic_symbol (info, h)
struct elf_link_hash_entry *h;
{
struct elf_i386_link_hash_table *htab;
- struct elf_i386_link_hash_entry * eh;
- struct elf_i386_dyn_relocs *p;
asection *s;
unsigned int power_of_two;
@@ -1418,6 +1423,10 @@ elf_i386_adjust_dynamic_symbol (info, h)
|| h->weakdef->root.type == bfd_link_hash_defweak);
h->root.u.def.section = h->weakdef->root.u.def.section;
h->root.u.def.value = h->weakdef->root.u.def.value;
+ if (ELIMINATE_COPY_RELOCS || info->nocopyreloc)
+ h->elf_link_hash_flags
+ = ((h->elf_link_hash_flags & ~ELF_LINK_NON_GOT_REF)
+ | (h->weakdef->elf_link_hash_flags & ELF_LINK_NON_GOT_REF));
return TRUE;
}
@@ -1443,20 +1452,26 @@ elf_i386_adjust_dynamic_symbol (info, h)
return TRUE;
}
- eh = (struct elf_i386_link_hash_entry *) h;
- for (p = eh->dyn_relocs; p != NULL; p = p->next)
+ if (ELIMINATE_COPY_RELOCS)
{
- s = p->sec->output_section;
- if (s != NULL && (s->flags & SEC_READONLY) != 0)
- break;
- }
+ struct elf_i386_link_hash_entry * eh;
+ struct elf_i386_dyn_relocs *p;
- /* If we didn't find any dynamic relocs in read-only sections, then
- we'll be keeping the dynamic relocs and avoiding the copy reloc. */
- if (p == NULL)
- {
- h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
- return TRUE;
+ eh = (struct elf_i386_link_hash_entry *) h;
+ for (p = eh->dyn_relocs; p != NULL; p = p->next)
+ {
+ s = p->sec->output_section;
+ if (s != NULL && (s->flags & SEC_READONLY) != 0)
+ break;
+ }
+
+ /* If we didn't find any dynamic relocs in read-only sections, then
+ we'll be keeping the dynamic relocs and avoiding the copy reloc. */
+ if (p == NULL)
+ {
+ h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
+ return TRUE;
+ }
}
/* We must allocate the symbol in our .dynbss section, which will
@@ -1676,7 +1691,7 @@ allocate_dynrelocs (h, inf)
}
}
}
- else
+ else if (ELIMINATE_COPY_RELOCS)
{
/* For the non-shared case, discard space for relocs against
symbols which turn out to need copy relocs or are not
@@ -2412,7 +2427,8 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
&& (! info->symbolic
|| (h->elf_link_hash_flags
& ELF_LINK_HASH_DEF_REGULAR) == 0))))
- || (!info->shared
+ || (ELIMINATE_COPY_RELOCS
+ && !info->shared
&& h != NULL
&& h->dynindx != -1
&& (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index 9947af8..b7b09dc 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -2300,7 +2300,7 @@ ppc_elf_create_linker_section (abfd, info, which)
switch (which)
{
default:
- (*_bfd_error_handler) (_("%s: Unknown special linker type %d"),
+ (*_bfd_error_handler) (_("%s: unknown special linker type %d"),
bfd_get_filename (abfd),
(int) which);
@@ -2525,6 +2525,10 @@ ppc_elf_adjust_dynamic_symbol (info, h)
|| h->weakdef->root.type == bfd_link_hash_defweak);
h->root.u.def.section = h->weakdef->root.u.def.section;
h->root.u.def.value = h->weakdef->root.u.def.value;
+ if (ELIMINATE_COPY_RELOCS)
+ h->elf_link_hash_flags
+ = ((h->elf_link_hash_flags & ~ELF_LINK_NON_GOT_REF)
+ | (h->weakdef->elf_link_hash_flags & ELF_LINK_NON_GOT_REF));
return TRUE;
}
@@ -4520,7 +4524,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
enum elf_ppc_reloc_type r_type2;
unsigned long r_symndx2;
struct elf_link_hash_entry *h2;
- bfd_vma insn1, insn2, insn3;
+ bfd_vma insn1, insn2;
bfd_vma offset;
/* The next instruction should be a call to
@@ -4547,8 +4551,6 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
offset = rel[1].r_offset;
insn1 = bfd_get_32 (output_bfd,
contents + rel->r_offset - 2);
- insn3 = bfd_get_32 (output_bfd,
- contents + offset + 4);
if ((tls_mask & tls_gd) != 0)
{
/* IE */
@@ -4578,16 +4580,8 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
R_PPC_TPREL16_LO);
rel[1].r_offset += 2;
}
- if (insn3 == NOP
- || insn3 == CROR_151515 || insn3 == CROR_313131)
- {
- insn3 = insn2;
- insn2 = NOP;
- rel[1].r_offset += 4;
- }
bfd_put_32 (output_bfd, insn1, contents + rel->r_offset - 2);
bfd_put_32 (output_bfd, insn2, contents + offset);
- bfd_put_32 (output_bfd, insn3, contents + offset + 4);
if (tls_gd == 0)
{
/* We changed the symbol on an LD reloc. Start over
@@ -4824,22 +4818,21 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
{
bfd_vma value = relocation;
- if ((tls_ty & (TLS_GD | TLS_TPREL | TLS_DTPREL
- | TLS_TPRELGD)) != 0)
+ if (tls_ty == (TLS_TLS | TLS_LD))
+ value = 1;
+ else if (tls_ty != 0)
{
value -= htab->tls_sec->vma + DTP_OFFSET;
- if ((tls_ty & TLS_TPREL) != 0)
+ if (tls_ty == (TLS_TLS | TLS_TPREL))
value += DTP_OFFSET - TP_OFFSET;
- }
- if (tls_ty == (TLS_TLS | TLS_GD))
- {
- bfd_put_32 (output_bfd, value,
- htab->got->contents + off + 4);
- value = 1;
+ if (tls_ty == (TLS_TLS | TLS_GD))
+ {
+ bfd_put_32 (output_bfd, value,
+ htab->got->contents + off + 4);
+ value = 1;
+ }
}
- else if (tls_ty == (TLS_TLS | TLS_LD))
- value = 1;
bfd_put_32 (output_bfd, value,
htab->got->contents + off);
}
@@ -4887,10 +4880,11 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
got at entry m+n bears little relation to the entry m. */
if (addend != 0)
(*_bfd_error_handler)
- (_("%s(%s+0x%lx): non-zero addend on got reloc against `%s'"),
+ (_("%s(%s+0x%lx): non-zero addend on %s reloc against `%s'"),
bfd_archive_filename (input_bfd),
bfd_get_section_name (input_bfd, input_section),
(long) rel->r_offset,
+ howto->name,
sym_name);
}
break;
@@ -4899,10 +4893,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
case R_PPC_LOCAL24PC:
/* It makes no sense to point a local relocation
at a symbol not in this object. */
- if (h != NULL
- && (h->root.type == bfd_link_hash_defined
- || h->root.type == bfd_link_hash_defweak)
- && sec->output_section == NULL)
+ if (unresolved_reloc)
{
if (! (*info->callbacks->undefined_symbol) (info,
h->root.root.string,
@@ -5037,8 +5028,6 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
if (skip)
memset (&outrel, 0, sizeof outrel);
- /* h->dynindx may be -1 if this symbol was marked to
- become local. */
else if (h != NULL
&& !SYMBOL_REFERENCES_LOCAL (info, h))
{
@@ -5175,7 +5164,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|| (strncmp (name, ".sbss", 5) == 0
&& (name[5] == 0 || name[5] == '.'))))
{
- (*_bfd_error_handler) (_("%s: The target (%s) of a %s relocation is in the wrong output section (%s)"),
+ (*_bfd_error_handler) (_("%s: the target (%s) of a %s relocation is in the wrong output section (%s)"),
bfd_archive_filename (input_bfd),
sym_name,
howto->name,
@@ -5199,7 +5188,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
if (! (strncmp (name, ".sdata2", 7) == 0
|| strncmp (name, ".sbss2", 6) == 0))
{
- (*_bfd_error_handler) (_("%s: The target (%s) of a %s relocation is in the wrong output section (%s)"),
+ (*_bfd_error_handler) (_("%s: the target (%s) of a %s relocation is in the wrong output section (%s)"),
bfd_archive_filename (input_bfd),
sym_name,
howto->name,
@@ -5256,7 +5245,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
else
{
- (*_bfd_error_handler) (_("%s: The target (%s) of a %s relocation is in the wrong output section (%s)"),
+ (*_bfd_error_handler) (_("%s: the target (%s) of a %s relocation is in the wrong output section (%s)"),
bfd_archive_filename (input_bfd),
sym_name,
howto->name,
@@ -5310,7 +5299,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
case R_PPC_EMB_RELST_HA:
case R_PPC_EMB_BIT_FLD:
(*_bfd_error_handler)
- (_("%s: Relocation %s is not yet supported for symbol %s."),
+ (_("%s: relocation %s is not yet supported for symbol %s."),
bfd_archive_filename (input_bfd),
howto->name,
sym_name);
@@ -5339,7 +5328,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
case R_PPC_EMB_NADDR16_HA:
case R_PPC_EMB_RELST_HA:
/* It's just possible that this symbol is a weak symbol
- that's not actually defined anywhere. In that case,
+ that's not actually defined anywhere. In that case,
'sec' would be NULL, and we should leave the symbol
alone (it will be set to zero elsewhere in the link). */
if (sec != NULL)
@@ -5363,10 +5352,11 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
{
(*_bfd_error_handler)
- (_("%s(%s+0x%lx): unresolvable relocation against symbol `%s'"),
+ (_("%s(%s+0x%lx): unresolvable %s relocation against symbol `%s'"),
bfd_archive_filename (input_bfd),
bfd_get_section_name (input_bfd, input_section),
(long) rel->r_offset,
+ howto->name,
sym_name);
ret = FALSE;
}
@@ -5412,10 +5402,10 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
else
{
(*_bfd_error_handler)
- (_("%s(%s+0x%lx): reloc against `%s': error %d"),
+ (_("%s(%s+0x%lx): %s reloc against `%s': error %d"),
bfd_archive_filename (input_bfd),
bfd_get_section_name (input_bfd, input_section),
- (long) rel->r_offset, sym_name, (int) r);
+ (long) rel->r_offset, howto->name, sym_name, (int) r);
ret = FALSE;
}
}
diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c
index 20dc7d1..c9167bc 100644
--- a/bfd/elf32-sh.c
+++ b/bfd/elf32-sh.c
@@ -179,6 +179,8 @@ static reloc_howto_type sh_elf_howto_table[] =
TRUE), /* pcrel_offset */
/* 12 bit PC relative branch divided by 2. */
+ /* This cannot be partial_inplace because relaxation can't know the
+ eventual value of a symbol. */
HOWTO (R_SH_IND12W, /* type */
1, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
@@ -186,10 +188,10 @@ static reloc_howto_type sh_elf_howto_table[] =
TRUE, /* pc_relative */
0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
- sh_elf_reloc, /* special_function */
+ NULL, /* special_function */
"R_SH_IND12W", /* name */
- TRUE, /* partial_inplace */
- 0xfff, /* src_mask */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
0xfff, /* dst_mask */
TRUE), /* pcrel_offset */
@@ -2232,6 +2234,12 @@ sh_elf_relax_section (abfd, sec, link_info, again)
/* Change the R_SH_USES reloc into an R_SH_IND12W reloc, and
replace the jsr with a bsr. */
irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irelfn->r_info), R_SH_IND12W);
+ /* We used to test (ELF32_R_SYM (irelfn->r_info) < symtab_hdr->sh_info)
+ here, but that only checks if the symbol is an external symbol,
+ not if the symbol is in a different section. Besides, we need
+ a consistent meaning for the relocation, so we just assume here that
+ the value of the symbol is not available. */
+#if 0
if (ELF32_R_SYM (irelfn->r_info) < symtab_hdr->sh_info)
{
/* If this needs to be changed because of future relaxing,
@@ -2242,12 +2250,14 @@ sh_elf_relax_section (abfd, sec, link_info, again)
contents + irel->r_offset);
}
else
+#endif
{
/* We can't fully resolve this yet, because the external
symbol value may be changed by future relaxing. We let
the final link phase handle it. */
bfd_put_16 (abfd, (bfd_vma) 0xb000, contents + irel->r_offset);
}
+ irel->r_addend = -4;
/* See if there is another R_SH_USES reloc referring to the same
register load. */
@@ -2316,7 +2326,8 @@ sh_elf_relax_section (abfd, sec, link_info, again)
/* Look for load and store instructions that we can align on four
byte boundaries. */
- if (have_code)
+ if ((elf_elfheader (abfd)->e_flags & EF_SH_MACH_MASK) != EF_SH4
+ && have_code)
{
bfd_boolean swapped;
@@ -2542,14 +2553,28 @@ sh_elf_relax_delete_bytes (abfd, sec, addr, count)
break;
case R_SH_IND12W:
- if (ELF32_R_SYM (irel->r_info) >= symtab_hdr->sh_info)
- start = stop = addr;
+ off = insn & 0xfff;
+ if (! off)
+ {
+ /* This has been made by previous relaxation. Since the
+ relocation will be against an external symbol, the
+ final relocation will just do the right thing. */
+ start = stop = addr;
+ }
else
{
- off = insn & 0xfff;
if (off & 0x800)
off -= 0x1000;
stop = (bfd_vma) ((bfd_signed_vma) start + 4 + off * 2);
+
+ /* The addend will be against the section symbol, thus
+ for adjusting the addend, the relevant start is the
+ start of the section.
+ N.B. If we want to abandom in-place changes here and
+ test directly using symbol + addend, we have to take into
+ account that the addend has already been adjusted by -4. */
+ if (stop > addr && stop < toaddr)
+ irel->r_addend -= count;
}
break;
@@ -4811,7 +4836,6 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
break;
case R_SH_IND12W:
- relocation -= 4;
goto final_link_relocate;
case R_SH_DIR8WPN:
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index 23d95d5..1030e69 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -4518,6 +4518,10 @@ ppc64_elf_adjust_dynamic_symbol (info, h)
|| h->weakdef->root.type == bfd_link_hash_defweak);
h->root.u.def.section = h->weakdef->root.u.def.section;
h->root.u.def.value = h->weakdef->root.u.def.value;
+ if (ELIMINATE_COPY_RELOCS)
+ h->elf_link_hash_flags
+ = ((h->elf_link_hash_flags & ~ELF_LINK_NON_GOT_REF)
+ | (h->weakdef->elf_link_hash_flags & ELF_LINK_NON_GOT_REF));
return TRUE;
}
@@ -7670,21 +7674,22 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
else
{
relocation += rel->r_addend;
- if (tls_type != 0)
+ if (tls_type == (TLS_TLS | TLS_LD))
+ relocation = 1;
+ else if (tls_type != 0)
{
relocation -= htab->tls_sec->vma + DTP_OFFSET;
- if ((tls_type & TLS_TPREL) != 0)
+ if (tls_type == (TLS_TLS | TLS_TPREL))
relocation += DTP_OFFSET - TP_OFFSET;
- }
- if ((tls_type & TLS_GD) != 0)
- {
- bfd_put_64 (output_bfd, relocation,
- htab->sgot->contents + off + 8);
- relocation = 1;
+ if (tls_type == (TLS_TLS | TLS_GD))
+ {
+ bfd_put_64 (output_bfd, relocation,
+ htab->sgot->contents + off + 8);
+ relocation = 1;
+ }
}
- else if (tls_type == (TLS_TLS | TLS_LD))
- relocation = 1;
+
bfd_put_64 (output_bfd, relocation,
htab->sgot->contents + off);
}
@@ -7981,7 +7986,7 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
/* These ones haven't been implemented yet. */
(*_bfd_error_handler)
- (_("%s: Relocation %s is not supported for symbol %s."),
+ (_("%s: relocation %s is not supported for symbol %s."),
bfd_archive_filename (input_bfd),
ppc64_elf_howto_table[(int) r_type]->name, sym_name);
@@ -8095,10 +8100,11 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
{
(*_bfd_error_handler)
- (_("%s(%s+0x%lx): unresolvable relocation against symbol `%s'"),
+ (_("%s(%s+0x%lx): unresolvable %s relocation against symbol `%s'"),
bfd_archive_filename (input_bfd),
bfd_get_section_name (input_bfd, input_section),
(long) rel->r_offset,
+ ppc64_elf_howto_table[(int) r_type]->name,
h->root.root.string);
ret = FALSE;
}
@@ -8140,10 +8146,13 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
else
{
(*_bfd_error_handler)
- (_("%s(%s+0x%lx): reloc against `%s': error %d"),
+ (_("%s(%s+0x%lx): %s reloc against `%s': error %d"),
bfd_archive_filename (input_bfd),
bfd_get_section_name (input_bfd, input_section),
- (long) rel->r_offset, sym_name, (int) r);
+ (long) rel->r_offset,
+ ppc64_elf_howto_table[(int) r_type]->name,
+ sym_name,
+ (int) r);
ret = FALSE;
}
}
diff --git a/bfd/elflink.h b/bfd/elflink.h
index 7d2d2e2..c39120d 100644
--- a/bfd/elflink.h
+++ b/bfd/elflink.h
@@ -8329,9 +8329,10 @@ elf_bfd_discard_info (output_bfd, info)
continue;
eh = bfd_get_section_by_name (abfd, ".eh_frame");
- if (eh != NULL
- && (eh->_raw_size == 0
- || bfd_is_abs_section (eh->output_section)))
+ if (info->relocateable
+ || (eh != NULL
+ && (eh->_raw_size == 0
+ || bfd_is_abs_section (eh->output_section))))
eh = NULL;
stab = bfd_get_section_by_name (abfd, ".stab");
@@ -8432,6 +8433,7 @@ elf_bfd_discard_info (output_bfd, info)
}
if (info->eh_frame_hdr
+ && !info->relocateable
&& _bfd_elf_discard_section_eh_frame_hdr (output_bfd, info))
ret = TRUE;
diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c
index 6678dd6..d1a78ab 100644
--- a/bfd/elfxx-ia64.c
+++ b/bfd/elfxx-ia64.c
@@ -656,31 +656,12 @@ static const bfd_byte plt_full_entry[PLT_FULL_ENTRY_SIZE] =
#define DYNAMIC_INTERPRETER(abfd) \
(elfNN_ia64_aix_vec (abfd->xvec) ? AIX_DYNAMIC_INTERPRETER : ELF_DYNAMIC_INTERPRETER)
-/* Select out of range branch fixup type. Note that Itanium does
- not support brl, and so it gets emulated by the kernel. */
-#undef USE_BRL
-
-#ifdef USE_BRL
static const bfd_byte oor_brl[16] =
{
0x05, 0x00, 0x00, 0x00, 0x01, 0x00, /* [MLX] nop.m 0 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* brl.sptk.few tgt;; */
0x00, 0x00, 0x00, 0xc0
};
-#else
-static const bfd_byte oor_ip[48] =
-{
- 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, /* [MLX] nop.m 0 */
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, /* movl r15=0 */
- 0x01, 0x00, 0x00, 0x60,
- 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, /* [MII] nop.m 0 */
- 0x00, 0x01, 0x00, 0x60, 0x00, 0x00, /* mov r16=ip;; */
- 0xf2, 0x80, 0x00, 0x80, /* add r16=r15,r16;; */
- 0x11, 0x00, 0x00, 0x00, 0x01, 0x00, /* [MIB] nop.m 0 */
- 0x60, 0x80, 0x04, 0x80, 0x03, 0x00, /* mov b6=r16 */
- 0x60, 0x00, 0x80, 0x00 /* br b6;; */
-};
-#endif
/* These functions do relaxation for IA-64 ELF. */
@@ -897,11 +878,7 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again)
size = sizeof (plt_full_entry);
else
{
-#ifdef USE_BRL
size = sizeof (oor_brl);
-#else
- size = sizeof (oor_ip);
-#endif
}
/* Resize the current section to make room for the new branch. */
@@ -923,18 +900,10 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again)
}
else
{
-#ifdef USE_BRL
memcpy (contents + trampoff, oor_brl, size);
irel->r_info = ELFNN_R_INFO (ELFNN_R_SYM (irel->r_info),
R_IA64_PCREL60B);
irel->r_offset = trampoff + 2;
-#else
- memcpy (contents + trampoff, oor_ip, size);
- irel->r_info = ELFNN_R_INFO (ELFNN_R_SYM (irel->r_info),
- R_IA64_PCREL64I);
- irel->r_addend -= 16;
- irel->r_offset = trampoff + 2;
-#endif
}
/* Record the fixup so we don't do it again this section. */
diff --git a/bfd/som.c b/bfd/som.c
index c6486c4..90b0cf5 100644
--- a/bfd/som.c
+++ b/bfd/som.c
@@ -1,6 +1,6 @@
/* bfd back-end for HP PA-RISC SOM objects.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002
+ 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Contributed by the Center for Software Science at the
@@ -38,7 +38,7 @@
#include <machine/reg.h>
#include <sys/file.h>
-/* Magic not defined in standard HP-UX header files until 8.0 */
+/* Magic not defined in standard HP-UX header files until 8.0. */
#ifndef CPU_PA_RISC1_0
#define CPU_PA_RISC1_0 0x20B
@@ -148,7 +148,7 @@ struct som_misc_symbol_info {
unsigned int secondary_def;
};
-/* Forward declarations */
+/* Forward declarations. */
static bfd_boolean som_mkobject
PARAMS ((bfd *));
@@ -220,7 +220,6 @@ static int som_reloc_queue_find
PARAMS ((unsigned char *, unsigned int, struct reloc_queue *));
static unsigned char * try_prev_fixup
PARAMS ((bfd *, int *, unsigned char *, unsigned int, struct reloc_queue *));
-
static unsigned char * som_reloc_skip
PARAMS ((bfd *, unsigned int, unsigned char *, unsigned int *,
struct reloc_queue *));
@@ -267,9 +266,8 @@ static int som_decode_symclass
PARAMS ((asymbol *));
static bfd_boolean som_bfd_count_ar_symbols
PARAMS ((bfd *, struct lst_header *, symindex *));
-
static bfd_boolean som_bfd_fill_in_ar_symbols
- PARAMS ((bfd *, struct lst_header *, carsym **syms));
+ PARAMS ((bfd *, struct lst_header *, carsym **));
static bfd_boolean som_slurp_armap
PARAMS ((bfd *));
static bfd_boolean som_write_armap
@@ -659,7 +657,7 @@ static const struct fixup_format som_fixup_formats[256] = {
/* R_TRANSLATED */
{ 0, "" }, /* 0xce */
/* R_AUX_UNWIND */
- { 0,"Sd=Vf=Ef=" }, /* 0xcf */
+ { 0,"Sd=Ve=Ee=" }, /* 0xcf */
/* R_COMP1 */
{ 0, "Ob=" }, /* 0xd0 */
/* R_COMP2 */
@@ -684,7 +682,7 @@ static const struct fixup_format som_fixup_formats[256] = {
/* R_LTP_OVERRIDE */
{ 0, "" }, /* 0xdc */
/* R_COMMENT */
- { 0, "Ob=Ve=" }, /* 0xdd */
+ { 0, "Ob=Vf=" }, /* 0xdd */
/* R_RESERVED */
{ 0, "" }, /* 0xde */
{ 0, "" }, /* 0xdf */
@@ -2328,7 +2326,6 @@ som_prep_headers (abfd)
if (abfd->flags & (EXEC_P | DYNAMIC))
{
-
/* Make and attach an exec header to the BFD. */
amt = sizeof (struct som_exec_auxhdr);
obj_som_exec_hdr (abfd) =
@@ -5353,7 +5350,7 @@ som_get_section_contents (abfd, section, location, offset, count)
if ((bfd_size_type) (offset+count) > section->_raw_size
|| bfd_seek (abfd, (file_ptr) (section->filepos + offset), SEEK_SET) != 0
|| bfd_bread (location, count, abfd) != count)
- return FALSE; /* on error */
+ return FALSE; /* On error. */
return TRUE;
}
@@ -6369,7 +6366,7 @@ const bfd_target som_vec = {
| SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
/* leading_symbol_char: is the first char of a user symbol
- predictable, and if so what is it */
+ predictable, and if so what is it. */
0,
'/', /* ar_pad_char */
14, /* ar_max_namelen */
diff --git a/bfd/version.h b/bfd/version.h
index 3a264cb..1aaeb25 100644
--- a/bfd/version.h
+++ b/bfd/version.h
@@ -1,3 +1,3 @@
-#define BFD_VERSION_DATE 20030303
+#define BFD_VERSION_DATE 20030308
#define BFD_VERSION @bfd_version@
#define BFD_VERSION_STRING @bfd_version_string@