diff options
author | Doug Kwan <dougkwan@google.com> | 2012-02-02 20:21:17 +0000 |
---|---|---|
committer | Doug Kwan <dougkwan@google.com> | 2012-02-02 20:21:17 +0000 |
commit | 90cff06f4e84400f2db010217cc75547f788d558 (patch) | |
tree | e6c9fd630f247b1849d3cd9a2db7d44ecdbf8286 /gold/arm.cc | |
parent | 2c02bd729076b940958bccf68f1cc0b1ecf8403b (diff) | |
download | gdb-90cff06f4e84400f2db010217cc75547f788d558.zip gdb-90cff06f4e84400f2db010217cc75547f788d558.tar.gz gdb-90cff06f4e84400f2db010217cc75547f788d558.tar.bz2 |
2012-02-02 Doug Kwan <dougkwan@google.com>
* arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
position independent outputs, not just shared objects.
Diffstat (limited to 'gold/arm.cc')
-rw-r--r-- | gold/arm.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/gold/arm.cc b/gold/arm.cc index d187a91..ec80d67 100644 --- a/gold/arm.cc +++ b/gold/arm.cc @@ -4442,6 +4442,8 @@ Reloc_stub::stub_type_for_reloc( } int64_t branch_offset; + bool output_is_position_independent = + parameters->options().output_is_position_independent(); if (r_type == elfcpp::R_ARM_THM_CALL || r_type == elfcpp::R_ARM_THM_JUMP24) { // For THUMB BLX instruction, bit 1 of target comes from bit 1 of the @@ -4470,7 +4472,7 @@ Reloc_stub::stub_type_for_reloc( // Thumb to thumb. if (!thumb_only) { - stub_type = (parameters->options().shared() + stub_type = (output_is_position_independent || should_force_pic_veneer) // PIC stubs. ? ((may_use_blx @@ -4491,7 +4493,7 @@ Reloc_stub::stub_type_for_reloc( } else { - stub_type = (parameters->options().shared() + stub_type = (output_is_position_independent || should_force_pic_veneer) ? arm_stub_long_branch_thumb_only_pic // PIC stub. : arm_stub_long_branch_thumb_only; // non-PIC stub. @@ -4504,7 +4506,7 @@ Reloc_stub::stub_type_for_reloc( // FIXME: We should check that the input section is from an // object that has interwork enabled. - stub_type = (parameters->options().shared() + stub_type = (output_is_position_independent || should_force_pic_veneer) // PIC stubs. ? ((may_use_blx @@ -4546,7 +4548,7 @@ Reloc_stub::stub_type_for_reloc( || (r_type == elfcpp::R_ARM_JUMP24) || (r_type == elfcpp::R_ARM_PLT32)) { - stub_type = (parameters->options().shared() + stub_type = (output_is_position_independent || should_force_pic_veneer) // PIC stubs. ? (may_use_blx @@ -4565,7 +4567,7 @@ Reloc_stub::stub_type_for_reloc( if (branch_offset > ARM_MAX_FWD_BRANCH_OFFSET || (branch_offset < ARM_MAX_BWD_BRANCH_OFFSET)) { - stub_type = (parameters->options().shared() + stub_type = (output_is_position_independent || should_force_pic_veneer) ? arm_stub_long_branch_any_arm_pic // PIC stubs. : arm_stub_long_branch_any_any; /// non-PIC. |