diff options
author | Rahul Chaudhry <rahulchaudhry@google.com> | 2017-02-15 00:37:10 -0800 |
---|---|---|
committer | Cary Coutant <ccoutant@gmail.com> | 2017-02-15 00:37:10 -0800 |
commit | 4aebb6312eb5dcd12f2f8420028547584b708907 (patch) | |
tree | 3ddb862e883a0ae0c3cb7f4e517f32b33979c360 /gold/gc.h | |
parent | 4e746bb68947abd2f64ced0dcf5a00021571e45d (diff) | |
download | gdb-4aebb6312eb5dcd12f2f8420028547584b708907.zip gdb-4aebb6312eb5dcd12f2f8420028547584b708907.tar.gz gdb-4aebb6312eb5dcd12f2f8420028547584b708907.tar.bz2 |
Improved support for --icf=safe when used with -pie.
gold/
* x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
Return true even when building pie binaries.
(Target_x86_64::possible_function_pointer_reloc): Check opcode
for R_X86_64_PC32 relocations.
(Target_x86_64::local_reloc_may_be_function_pointer): Pass
extra arguments to local_reloc_may_be_function_pointer.
(Target_x86_64::global_reloc_may_be_function_pointer): Likewise.
* gc.h (gc_process_relocs): Add check for STT_FUNC.
* testsuite/Makefile.am (icf_safe_pie_test): New test case.
* testsuite/Makefile.in: Regenerate.
* testsuite/icf_safe_pie_test.sh: New shell script.
Diffstat (limited to 'gold/gc.h')
-rw-r--r-- | gold/gc.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -295,6 +295,7 @@ gc_process_relocs( // When doing safe folding, check to see if this relocation is that // of a function pointer being taken. if (gsym->source() == Symbol::FROM_OBJECT + && gsym->type() == elfcpp::STT_FUNC && check_section_for_function_pointers && dst_obj != NULL && (!is_ordinary |