diff options
author | Paul Brook <paul@codesourcery.com> | 2007-03-20 20:19:07 +0000 |
---|---|---|
committer | Paul Brook <paul@codesourcery.com> | 2007-03-20 20:19:07 +0000 |
commit | c0d537e0f876ceea4dd6d570f2f916a27ea6c7dd (patch) | |
tree | 073ee7432dc621ce258b99790933399c4f29aec2 /bfd/elf32-arm.c | |
parent | e29d654a3be2f08f83011918d49a933f4f449cd5 (diff) | |
download | gdb-c0d537e0f876ceea4dd6d570f2f916a27ea6c7dd.tar.gz |
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/elf32-arm.c')
-rw-r--r-- | bfd/elf32-arm.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index 3be85b1cdd7..be109232235 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. */ |