aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorPaul Brook <paul@codesourcery.com>2007-03-20 20:19:07 +0000
committerPaul Brook <paul@codesourcery.com>2007-03-20 20:19:07 +0000
commit27e55c4d0b94f5d358385b9641d26b84ee611768 (patch)
treeeaacfbddbcc1ecc50c48870fa35865384a46de2c /bfd
parentbf21ed7807b864b6f137d093bbf0164b443b504b (diff)
downloadgdb-27e55c4d0b94f5d358385b9641d26b84ee611768.zip
gdb-27e55c4d0b94f5d358385b9641d26b84ee611768.tar.gz
gdb-27e55c4d0b94f5d358385b9641d26b84ee611768.tar.bz2
2007-03-20 Paul Brook <paul@codesourcery.com>
ld/ * emultempl/armelf.em (pic_veneer): New variable. (PARSE_AND_LIST_PROLOGUE): Add OPTION_PIC_VENEER. (PARSE_AND_LIST_ARGS_CASES): Ditto. (PARSE_AND_LIST_LONGOPTS): Add "pic-veneer". (PARSE_AND_LIST_OPTIONS): Ditto. * ld.texinfo: Document --pic-veneer. ld/testsuite/ * ld-arm/arm-elf.exp (ld-arm/arm-elf.exp): Add arm-pic-veneer. * ld-arm/arm-pic-veneer.d: New test. * ld-arm/arm-pic-veneer.s: New test. bfd/ * bfd-in.h (bfd_elf32_arm_set_target_relocs): Update prototype. * bfd-in2.h: Regenerate. * elf32-arm.c (elf32_arm_link_hash_table): Add pic_veneer. (record_arm_to_thumb_glue): Use globals->pic_veneer. (elf32_arm_create_thumb_stub): Ditto. (bfd_elf32_arm_set_target_relocs): Set globals->pic_veneer.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog9
-rw-r--r--bfd/bfd-in.h2
-rw-r--r--bfd/bfd-in2.h2
-rw-r--r--bfd/elf32-arm.c12
4 files changed, 20 insertions, 5 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 863640b..004bfe7 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,12 @@
+2007-03-20 Paul Brook <paul@codesourcery.com>
+
+ * bfd-in.h (bfd_elf32_arm_set_target_relocs): Update prototype.
+ * bfd-in2.h: Regenerate.
+ * elf32-arm.c (elf32_arm_link_hash_table): Add pic_veneer.
+ (record_arm_to_thumb_glue): Use globals->pic_veneer.
+ (elf32_arm_create_thumb_stub): Ditto.
+ (bfd_elf32_arm_set_target_relocs): Set globals->pic_veneer.
+
2007-03-18 Mark Shinwell <shinwell@codesourcery.com>
* bfd-in.h (bfd_elf32_arm_set_target_relocs): Add "bfd *"
diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h
index 1e6dc12..617aa07 100644
--- a/bfd/bfd-in.h
+++ b/bfd/bfd-in.h
@@ -903,7 +903,7 @@ extern bfd_boolean bfd_elf32_arm_process_before_allocation
void bfd_elf32_arm_set_target_relocs
(bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix,
- int);
+ int, int);
extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking
(bfd *, struct bfd_link_info *);
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index d0af00b..ca5810c 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -910,7 +910,7 @@ extern bfd_boolean bfd_elf32_arm_process_before_allocation
void bfd_elf32_arm_set_target_relocs
(bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix,
- int);
+ int, int);
extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking
(bfd *, struct bfd_link_info *);
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 3be85b1..be10923 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -2191,6 +2191,9 @@ struct elf32_arm_link_hash_table
/* Global counter for the number of fixes we have emitted. */
int num_vfp11_fixes;
+ /* Nonzero to force PIC branch veneers. */
+ int pic_veneer;
+
/* The number of bytes in the initial entry in the PLT. */
bfd_size_type plt_header_size;
@@ -2714,7 +2717,8 @@ record_arm_to_thumb_glue (struct bfd_link_info * link_info,
free (tmp_name);
- if ((link_info->shared || globals->root.is_relocatable_executable))
+ if (link_info->shared || globals->root.is_relocatable_executable
+ || globals->pic_veneer)
size = ARM2THUMB_PIC_GLUE_SIZE;
else
size = ARM2THUMB_STATIC_GLUE_SIZE;
@@ -3868,7 +3872,7 @@ bfd_elf32_arm_set_target_relocs (struct bfd *output_bfd,
int fix_v4bx,
int use_blx,
bfd_arm_vfp11_fix vfp11_fix,
- int no_enum_warn)
+ int no_enum_warn, int pic_veneer)
{
struct elf32_arm_link_hash_table *globals;
@@ -3889,6 +3893,7 @@ bfd_elf32_arm_set_target_relocs (struct bfd *output_bfd,
globals->fix_v4bx = fix_v4bx;
globals->use_blx |= use_blx;
globals->vfp11_fix = vfp11_fix;
+ globals->pic_veneer = pic_veneer;
elf32_arm_tdata (output_bfd)->no_enum_size_warning = no_enum_warn;
}
@@ -4127,7 +4132,8 @@ elf32_arm_create_thumb_stub (struct bfd_link_info * info,
--my_offset;
myh->root.u.def.value = my_offset;
- if ((info->shared || globals->root.is_relocatable_executable))
+ if (info->shared || globals->root.is_relocatable_executable
+ || globals->pic_veneer)
{
/* For relocatable objects we can't use absolute addresses,
so construct the address from a relative offset. */