mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-07-15 05:01:13 +08:00
* elf32-ppc.c: Formatting and comment fixes.
(ELIMINATE_COPY_RELOCS): Move before ppc_elf_copy_indirect_symbol. (ppc_elf_copy_indirect_symbol): Copy flags here for weakdefs.
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
2003-04-24 Alan Modra <amodra@bigpond.net.au>
|
||||||
|
|
||||||
|
* elf32-ppc.c: Formatting and comment fixes.
|
||||||
|
(ELIMINATE_COPY_RELOCS): Move before ppc_elf_copy_indirect_symbol.
|
||||||
|
(ppc_elf_copy_indirect_symbol): Copy flags here for weakdefs.
|
||||||
|
|
||||||
2003-04-24 Dhananjay Deshpande <dhananjayd@kpitcummins.com>
|
2003-04-24 Dhananjay Deshpande <dhananjayd@kpitcummins.com>
|
||||||
|
|
||||||
* archures.c (bfd_mach_h8300hn, bfd_mach_h8300sn): Added.
|
* archures.c (bfd_mach_h8300hn, bfd_mach_h8300sn): Added.
|
||||||
@ -16,9 +22,9 @@
|
|||||||
* elf32-sh.c (tpoff): New.
|
* elf32-sh.c (tpoff): New.
|
||||||
(struct elf_sh_dyn_relocs): Remove tls_tpoff32.
|
(struct elf_sh_dyn_relocs): Remove tls_tpoff32.
|
||||||
(WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO.
|
(WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO.
|
||||||
(allocate_dynrelocs): Don't make unnecessary dynamic TLS
|
(allocate_dynrelocs): Don't make unnecessary dynamic TLS
|
||||||
relocations. Adjust WILL_CALL_FINISH_DYNAMIC_SYMBOL uses.
|
relocations. Adjust WILL_CALL_FINISH_DYNAMIC_SYMBOL uses.
|
||||||
(sh_elf_relocate_section): Likewise. Remove unnecessary tests.
|
(sh_elf_relocate_section): Likewise. Remove unnecessary tests.
|
||||||
(dtpoff_base): Fix wrong indentation.
|
(dtpoff_base): Fix wrong indentation.
|
||||||
(sh_elf_check_relocs): Don't set DF_STATIC_TLS flag with non-TLS
|
(sh_elf_check_relocs): Don't set DF_STATIC_TLS flag with non-TLS
|
||||||
relocations. Don't set tls_tpoff32 flag. Don't make unnecessary
|
relocations. Don't set tls_tpoff32 flag. Don't make unnecessary
|
||||||
|
@ -16,8 +16,9 @@
|
|||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
/* This file is based on a preliminary PowerPC ELF ABI. The
|
/* This file is based on a preliminary PowerPC ELF ABI. The
|
||||||
information may not match the final PowerPC ELF ABI. It includes
|
information may not match the final PowerPC ELF ABI. It includes
|
||||||
@ -152,7 +153,7 @@ static bfd_boolean ppc_elf_grok_psinfo
|
|||||||
function symbols not defined in an app are set to their .plt entry,
|
function symbols not defined in an app are set to their .plt entry,
|
||||||
it's necessary for shared libs to also reference the .plt even
|
it's necessary for shared libs to also reference the .plt even
|
||||||
though the symbol is really local to the shared lib. */
|
though the symbol is really local to the shared lib. */
|
||||||
#define SYMBOL_REFERENCES_LOCAL(INFO, H) \
|
#define SYMBOL_REFERENCES_LOCAL(INFO, H) \
|
||||||
((! INFO->shared \
|
((! INFO->shared \
|
||||||
|| INFO->symbolic \
|
|| INFO->symbolic \
|
||||||
|| H->dynindx == -1 \
|
|| H->dynindx == -1 \
|
||||||
@ -161,7 +162,7 @@ static bfd_boolean ppc_elf_grok_psinfo
|
|||||||
&& (H->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0)
|
&& (H->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0)
|
||||||
|
|
||||||
/* Will _calls_ to this symbol always call the version in this object? */
|
/* Will _calls_ to this symbol always call the version in this object? */
|
||||||
#define SYMBOL_CALLS_LOCAL(INFO, H) \
|
#define SYMBOL_CALLS_LOCAL(INFO, H) \
|
||||||
((! INFO->shared \
|
((! INFO->shared \
|
||||||
|| INFO->symbolic \
|
|| INFO->symbolic \
|
||||||
|| H->dynindx == -1 \
|
|| H->dynindx == -1 \
|
||||||
@ -198,7 +199,7 @@ struct ppc_elf_link_hash_entry
|
|||||||
struct ppc_elf_dyn_relocs *dyn_relocs;
|
struct ppc_elf_dyn_relocs *dyn_relocs;
|
||||||
|
|
||||||
/* Contexts in which symbol is used in the GOT (or TOC).
|
/* Contexts in which symbol is used in the GOT (or TOC).
|
||||||
TLS_GD .. TLS_EXPLICIT bits are or'd into the mask as the
|
TLS_GD .. TLS_TLS bits are or'd into the mask as the
|
||||||
corresponding relocs are encountered during check_relocs.
|
corresponding relocs are encountered during check_relocs.
|
||||||
tls_optimize clears TLS_GD .. TLS_TPREL when optimizing to
|
tls_optimize clears TLS_GD .. TLS_TPREL when optimizing to
|
||||||
indicate the corresponding GOT entry type is not needed. */
|
indicate the corresponding GOT entry type is not needed. */
|
||||||
@ -319,6 +320,12 @@ ppc_elf_link_hash_table_create (abfd)
|
|||||||
return &ret->elf.root;
|
return &ret->elf.root;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 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
|
||||||
|
|
||||||
/* Copy the extra info we tack onto an elf_link_hash_entry. */
|
/* Copy the extra info we tack onto an elf_link_hash_entry. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -367,7 +374,16 @@ ppc_elf_copy_indirect_symbol (bed, dir, ind)
|
|||||||
|
|
||||||
edir->tls_mask |= eind->tls_mask;
|
edir->tls_mask |= eind->tls_mask;
|
||||||
|
|
||||||
_bfd_elf_link_hash_copy_indirect (bed, dir, ind);
|
if (ELIMINATE_COPY_RELOCS && ind->root.type != bfd_link_hash_indirect)
|
||||||
|
/* If called to transfer flags for a weakdef during processing
|
||||||
|
of elf_adjust_dynamic_symbol, don't copy ELF_LINK_NON_GOT_REF.
|
||||||
|
We clear it ourselves for ELIMINATE_COPY_RELOCS. */
|
||||||
|
dir->elf_link_hash_flags |=
|
||||||
|
(ind->elf_link_hash_flags & (ELF_LINK_HASH_REF_DYNAMIC
|
||||||
|
| ELF_LINK_HASH_REF_REGULAR
|
||||||
|
| ELF_LINK_HASH_REF_REGULAR_NONWEAK));
|
||||||
|
else
|
||||||
|
_bfd_elf_link_hash_copy_indirect (bed, dir, ind);
|
||||||
}
|
}
|
||||||
|
|
||||||
static reloc_howto_type *ppc_elf_howto_table[(int) R_PPC_max];
|
static reloc_howto_type *ppc_elf_howto_table[(int) R_PPC_max];
|
||||||
@ -1613,10 +1629,14 @@ ppc_elf_howto_init ()
|
|||||||
{
|
{
|
||||||
unsigned int i, type;
|
unsigned int i, type;
|
||||||
|
|
||||||
for (i = 0; i < sizeof (ppc_elf_howto_raw) / sizeof (ppc_elf_howto_raw[0]); i++)
|
for (i = 0;
|
||||||
|
i < sizeof (ppc_elf_howto_raw) / sizeof (ppc_elf_howto_raw[0]);
|
||||||
|
i++)
|
||||||
{
|
{
|
||||||
type = ppc_elf_howto_raw[i].type;
|
type = ppc_elf_howto_raw[i].type;
|
||||||
BFD_ASSERT (type < sizeof (ppc_elf_howto_table) / sizeof (ppc_elf_howto_table[0]));
|
if (type >= (sizeof (ppc_elf_howto_table)
|
||||||
|
/ sizeof (ppc_elf_howto_table[0])))
|
||||||
|
abort ();
|
||||||
ppc_elf_howto_table[type] = &ppc_elf_howto_raw[i];
|
ppc_elf_howto_table[type] = &ppc_elf_howto_raw[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1630,7 +1650,8 @@ ppc_elf_howto_init ()
|
|||||||
2/ The branch is predicted as not taken.
|
2/ The branch is predicted as not taken.
|
||||||
3/ The branch is taken.
|
3/ The branch is taken.
|
||||||
4/ The branch is located in the last 5 words of a page.
|
4/ The branch is located in the last 5 words of a page.
|
||||||
(The EOP limit is 5 by default but may be specified as any value from 1-10.)
|
(The EOP limit is 5 by default but may be specified as any value
|
||||||
|
from 1-10.)
|
||||||
|
|
||||||
Our software solution is to detect these problematic branches in a
|
Our software solution is to detect these problematic branches in a
|
||||||
linker pass and modify them as follows:
|
linker pass and modify them as follows:
|
||||||
@ -2455,12 +2476,6 @@ ppc_elf_create_dynamic_sections (abfd, info)
|
|||||||
return bfd_set_section_flags (abfd, s, flags);
|
return bfd_set_section_flags (abfd, s, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 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
|
|
||||||
|
|
||||||
/* Adjust a symbol defined by a dynamic object and referenced by a
|
/* Adjust a symbol defined by a dynamic object and referenced by a
|
||||||
regular object. The current definition is in some section of the
|
regular object. The current definition is in some section of the
|
||||||
dynamic object, but we're not including those sections. We have to
|
dynamic object, but we're not including those sections. We have to
|
||||||
@ -2500,7 +2515,7 @@ ppc_elf_adjust_dynamic_symbol (info, h)
|
|||||||
/* Clear procedure linkage table information for any symbol that
|
/* Clear procedure linkage table information for any symbol that
|
||||||
won't need a .plt entry. */
|
won't need a .plt entry. */
|
||||||
if (! htab->elf.dynamic_sections_created
|
if (! htab->elf.dynamic_sections_created
|
||||||
|| SYMBOL_CALLS_LOCAL (info, h)
|
|| SYMBOL_CALLS_LOCAL (info, h)
|
||||||
|| h->plt.refcount <= 0)
|
|| h->plt.refcount <= 0)
|
||||||
{
|
{
|
||||||
/* A PLT entry is not required/allowed when:
|
/* A PLT entry is not required/allowed when:
|
||||||
|
Reference in New Issue
Block a user