Add the MOVT/MOVW types to the list of relocs which do not generate .plt

entries.  This fixes the segfaults in arm userland code compiled with
-march= or -mcpu= values that allow the compiler to generate movw/movt
sequences to load 32-bit constants.
This commit is contained in:
Ian Lepore 2015-12-30 23:04:08 +00:00
parent 2155bb238f
commit dfd3a89ff0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=292964

View File

@ -7720,12 +7720,26 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info,
refers to is in a different object. We can't tell for
sure yet, because something later might force the
symbol local. */
if (r_type != R_ARM_ABS32
&& r_type != R_ARM_REL32
&& r_type != R_ARM_ABS32_NOI
&& r_type != R_ARM_REL32_NOI
&& r_type != R_ARM_ABS12)
h->needs_plt = 1;
switch (r_type)
{
case R_ARM_ABS12:
case R_ARM_ABS32:
case R_ARM_ABS32_NOI:
case R_ARM_REL32:
case R_ARM_REL32_NOI:
case R_ARM_MOVW_ABS_NC:
case R_ARM_MOVT_ABS:
case R_ARM_MOVW_PREL_NC:
case R_ARM_MOVT_PREL:
case R_ARM_THM_MOVW_ABS_NC:
case R_ARM_THM_MOVT_ABS:
case R_ARM_THM_MOVW_PREL_NC:
case R_ARM_THM_MOVT_PREL:
break;
default:
h->needs_plt = 1;
break;
}
/* If we create a PLT entry, this relocation will reference
it, even if it's an ABS32 relocation. */