mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-22 02:50:08 +08:00
PR ld/13049
* elf32-arm.c (STUB_SUFFIX): Avoid collision with user namespace symbol names. * elf64-ppc.c (STUB_SUFFIX): Likewise. * elf32-hppa.c (STUB_SUFFIX): Likewise.
This commit is contained in:
@ -1,3 +1,11 @@
|
|||||||
|
2011-10-20 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
|
PR ld/13049
|
||||||
|
* elf32-arm.c (STUB_SUFFIX): Avoid collision with user namespace
|
||||||
|
symbol names.
|
||||||
|
* elf64-ppc.c (STUB_SUFFIX): Likewise.
|
||||||
|
* elf32-hppa.c (STUB_SUFFIX): Likewise.
|
||||||
|
|
||||||
2011-10-20 Alan Modra <amodra@gmail.com>
|
2011-10-20 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
* elf32-i386.c (i386_opcode16): Delete.
|
* elf32-i386.c (i386_opcode16): Delete.
|
||||||
|
@ -2354,9 +2354,32 @@ static const insn_sequence elf32_arm_stub_a8_veneer_blx[] =
|
|||||||
ARM_REL_INSN(0xea000000, -8) /* b original_branch_dest. */
|
ARM_REL_INSN(0xea000000, -8) /* b original_branch_dest. */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Section name for stubs is the associated section name plus this
|
/* For each section group there can be a specially created linker section
|
||||||
string. */
|
to hold the stubs for that group. The name of the stub section is based
|
||||||
#define STUB_SUFFIX ".stub"
|
upon the name of another section within that group with the suffix below
|
||||||
|
applied.
|
||||||
|
|
||||||
|
PR 13049: STUB_SUFFIX used to be ".stub", but this allowed the user to
|
||||||
|
create what appeared to be a linker stub section when it actually
|
||||||
|
contained user code/data. For example, consider this fragment:
|
||||||
|
|
||||||
|
const char * stubborn_problems[] = { "np" };
|
||||||
|
|
||||||
|
If this is compiled with "-fPIC -fdata-sections" then gcc produces a
|
||||||
|
section called:
|
||||||
|
|
||||||
|
.data.rel.local.stubborn_problems
|
||||||
|
|
||||||
|
This then causes problems in arm32_arm_build_stubs() as it triggers:
|
||||||
|
|
||||||
|
// Ignore non-stub sections.
|
||||||
|
if (!strstr (stub_sec->name, STUB_SUFFIX))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
And so the section would be ignored instead of being processed. Hence
|
||||||
|
the change in definition of STUB_SUFFIX to a name that cannot be a valid
|
||||||
|
C identifier. */
|
||||||
|
#define STUB_SUFFIX ".__stub"
|
||||||
|
|
||||||
/* One entry per long/short branch stub defined above. */
|
/* One entry per long/short branch stub defined above. */
|
||||||
#define DEF_STUBS \
|
#define DEF_STUBS \
|
||||||
@ -3557,7 +3580,7 @@ arm_type_of_stub (struct bfd_link_info *info,
|
|||||||
stub_type = (info->shared | globals->pic_veneer)
|
stub_type = (info->shared | globals->pic_veneer)
|
||||||
/* PIC stubs. */
|
/* PIC stubs. */
|
||||||
? ((globals->use_blx
|
? ((globals->use_blx
|
||||||
&& (r_type ==R_ARM_THM_CALL))
|
&& (r_type == R_ARM_THM_CALL))
|
||||||
/* V5T and above. Stub starts with ARM code, so
|
/* V5T and above. Stub starts with ARM code, so
|
||||||
we must be able to switch mode before
|
we must be able to switch mode before
|
||||||
reaching it, which is only possible for 'bl'
|
reaching it, which is only possible for 'bl'
|
||||||
@ -3568,7 +3591,7 @@ arm_type_of_stub (struct bfd_link_info *info,
|
|||||||
|
|
||||||
/* non-PIC stubs. */
|
/* non-PIC stubs. */
|
||||||
: ((globals->use_blx
|
: ((globals->use_blx
|
||||||
&& (r_type ==R_ARM_THM_CALL))
|
&& (r_type == R_ARM_THM_CALL))
|
||||||
/* V5T and above. */
|
/* V5T and above. */
|
||||||
? arm_stub_long_branch_any_any
|
? arm_stub_long_branch_any_any
|
||||||
/* V4T. */
|
/* V4T. */
|
||||||
@ -3797,7 +3820,9 @@ elf32_arm_create_or_find_stub_sec (asection **link_sec_p, asection *section,
|
|||||||
asection *stub_sec;
|
asection *stub_sec;
|
||||||
|
|
||||||
link_sec = htab->stub_group[section->id].link_sec;
|
link_sec = htab->stub_group[section->id].link_sec;
|
||||||
|
BFD_ASSERT (link_sec != NULL);
|
||||||
stub_sec = htab->stub_group[section->id].stub_sec;
|
stub_sec = htab->stub_group[section->id].stub_sec;
|
||||||
|
|
||||||
if (stub_sec == NULL)
|
if (stub_sec == NULL)
|
||||||
{
|
{
|
||||||
stub_sec = htab->stub_group[link_sec->id].stub_sec;
|
stub_sec = htab->stub_group[link_sec->id].stub_sec;
|
||||||
|
@ -155,8 +155,8 @@ static const bfd_byte plt_stub[] =
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* Section name for stubs is the associated section name plus this
|
/* Section name for stubs is the associated section name plus this
|
||||||
string. */
|
string. PR 13049: Use a name that is not a valid C identifier. */
|
||||||
#define STUB_SUFFIX ".stub"
|
#define STUB_SUFFIX ".__stub"
|
||||||
|
|
||||||
/* We don't need to copy certain PC- or GP-relative dynamic relocs
|
/* We don't need to copy certain PC- or GP-relative dynamic relocs
|
||||||
into a shared object's dynamic section. All the relocs of the
|
into a shared object's dynamic section. All the relocs of the
|
||||||
|
@ -3527,8 +3527,8 @@ must_be_dyn_reloc (struct bfd_link_info *info,
|
|||||||
#define ELIMINATE_COPY_RELOCS 1
|
#define ELIMINATE_COPY_RELOCS 1
|
||||||
|
|
||||||
/* Section name for stubs is the associated section name plus this
|
/* Section name for stubs is the associated section name plus this
|
||||||
string. */
|
string. PR 13049: Use a name that is not a valid C identifier. */
|
||||||
#define STUB_SUFFIX ".stub"
|
#define STUB_SUFFIX ".__stub"
|
||||||
|
|
||||||
/* Linker stubs.
|
/* Linker stubs.
|
||||||
ppc_stub_long_branch:
|
ppc_stub_long_branch:
|
||||||
|
Reference in New Issue
Block a user