Skip to content

Commit f197422

Browse files
Matt Helsleyjpoimboe
authored andcommitted
objtool: Rename rela to reloc
Before supporting additional relocation types rename the relevant types and functions from "rela" to "reloc". This work be done with the following regex: sed -e 's/struct rela/struct reloc/g' \ -e 's/\([_\*]\)rela\(s\{0,1\}\)/\1reloc\2/g' \ -e 's/tmprela\(s\{0,1\}\)/tmpreloc\1/g' \ -e 's/relasec/relocsec/g' \ -e 's/rela_list/reloc_list/g' \ -e 's/rela_hash/reloc_hash/g' \ -e 's/add_rela/add_reloc/g' \ -e 's/rela->/reloc->/g' \ -e '/rela[,\.]/{ s/\([^\.>]\)rela\([\.,]\)/\1reloc\2/g ; }' \ -e 's/rela =/reloc =/g' \ -e 's/relas =/relocs =/g' \ -e 's/relas\[/relocs[/g' \ -e 's/relaname =/relocname =/g' \ -e 's/= rela\;/= reloc\;/g' \ -e 's/= relas\;/= relocs\;/g' \ -e 's/= relaname\;/= relocname\;/g' \ -e 's/, rela)/, reloc)/g' \ -e 's/\([ @]\)rela\([ "]\)/\1reloc\2/g' \ -e 's/ rela$/ reloc/g' \ -e 's/, relaname/, relocname/g' \ -e 's/sec->rela/sec->reloc/g' \ -e 's/(\(!\{0,1\}\)rela/(\1reloc/g' \ -i \ arch.h \ arch/x86/decode.c \ check.c \ check.h \ elf.c \ elf.h \ orc_gen.c \ special.c Notable exceptions which complicate the regex include gelf_* library calls and standard/expected section names which still use "rela" because they encode the type of relocation expected. Also, keep "rela" in the struct because it encodes a specific type of relocation we currently expect. It will eventually turn into a member of an anonymous union when a susequent patch adds implicit addend, or "rel", relocation support. Signed-off-by: Matt Helsley <[email protected]> Signed-off-by: Josh Poimboeuf <[email protected]>
1 parent 1e968bf commit f197422

File tree

8 files changed

+218
-218
lines changed

8 files changed

+218
-218
lines changed

tools/objtool/arch.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,6 @@ bool arch_callee_saved_reg(unsigned char reg);
8282

8383
unsigned long arch_jump_destination(struct instruction *insn);
8484

85-
unsigned long arch_dest_rela_offset(int addend);
85+
unsigned long arch_dest_reloc_offset(int addend);
8686

8787
#endif /* _ARCH_H */

tools/objtool/arch/x86/decode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ bool arch_callee_saved_reg(unsigned char reg)
6767
}
6868
}
6969

70-
unsigned long arch_dest_rela_offset(int addend)
70+
unsigned long arch_dest_reloc_offset(int addend)
7171
{
7272
return addend + 4;
7373
}

0 commit comments

Comments
 (0)