This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
Hi, I have attached a patch to use relocation types during safe ICF and detect function pointer taken in i386. For i386, relocation types function pointers are always different from function calls. Function pointer reloc types can be one of R_386_32, R_386_16, R_386_8, R_386_GOTOFF, R_386_GOT32 depending on whether it is compiled with pic, pie or not. Please let me know what you think. * i386.cc (Target_i386::can_check_for_function_pointers): New function. (Scan::possible_function_pointer_reloc): New function. (Scan::local_reloc_may_be_function_pointer): Change to call possible_function_pointer_reloc. (Scan::global_reloc_may_be_function_pointer): Ditto. * icf.h (Icf::check_section_for_function_pointers): Change to reject relocations in ".data.rel.ro._ZTV" section. * testsuite/icf_safe_so_test.sh: Change to pass i386. * testsuite/icf_safe_so_test.cc: Ditto. * testsuite/icf_safe_test.cc: Ditto. * testsuite/icf_safe_test.sh: Ditto. Thanks, -Sri.
Attachment:
safe_icf_i386_patch.txt
Description: Text document
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |