Commit ab4e0744 authored by Josh Poimboeuf's avatar Josh Poimboeuf
Browse files

objtool: Refactor ORC section generation



Decouple ORC entries from instructions.  This simplifies the
control/data flow, and is going to make it easier to support alternative
instructions which change the stack layout.

Signed-off-by: default avatarJosh Poimboeuf <jpoimboe@redhat.com>
parent 5ed934e5
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -47,10 +47,6 @@ ifeq ($(SRCARCH),x86)
	SUBCMD_ORC := y
endif

ifeq ($(SUBCMD_ORC),y)
	CFLAGS += -DINSN_USE_ORC
endif

export SUBCMD_CHECK SUBCMD_ORC
export srctree OUTPUT CFLAGS SRCARCH AWK
include $(srctree)/tools/build/Makefile.include
+1 −5
Original line number Diff line number Diff line
@@ -51,11 +51,7 @@ int cmd_orc(int argc, const char **argv)
		if (list_empty(&file->insn_list))
			return 0;

		ret = create_orc(file);
		if (ret)
			return ret;

		ret = create_orc_sections(file);
		ret = orc_create(file);
		if (ret)
			return ret;

+0 −4
Original line number Diff line number Diff line
@@ -11,10 +11,6 @@
#include <objtool/objtool.h>
#include <objtool/cfi.h>

#ifdef INSN_USE_ORC
#include <asm/orc_types.h>
#endif

enum insn_type {
	INSN_JUMP_CONDITIONAL,
	INSN_JUMP_UNCONDITIONAL,
+0 −3
Original line number Diff line number Diff line
@@ -43,9 +43,6 @@ struct instruction {
	struct symbol *func;
	struct list_head stack_ops;
	struct cfi_state cfi;
#ifdef INSN_USE_ORC
	struct orc_entry orc;
#endif
};

static inline bool is_static_jump(struct instruction *insn)
+1 −2
Original line number Diff line number Diff line
@@ -26,7 +26,6 @@ struct objtool_file *objtool_open_read(const char *_objname);

int check(struct objtool_file *file);
int orc_dump(const char *objname);
int create_orc(struct objtool_file *file);
int create_orc_sections(struct objtool_file *file);
int orc_create(struct objtool_file *file);

#endif /* _OBJTOOL_H */
Loading