Improved support for --icf=safe when used with -pie.
authorRahul Chaudhry <rahulchaudhry@google.com>
Wed, 15 Feb 2017 08:37:10 +0000 (00:37 -0800)
committerCary Coutant <ccoutant@gmail.com>
Wed, 15 Feb 2017 08:37:10 +0000 (00:37 -0800)
commit4aebb6312eb5dcd12f2f8420028547584b708907
tree3ddb862e883a0ae0c3cb7f4e517f32b33979c360
parent4e746bb68947abd2f64ced0dcf5a00021571e45d
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.
gold/ChangeLog
gold/gc.h
gold/testsuite/Makefile.am
gold/testsuite/Makefile.in
gold/testsuite/icf_safe_pie_test.sh [new file with mode: 0755]
gold/x86_64.cc