mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-06-08 02:49:59 -04:00
The x86 startup code must not use absolute references to code or data, as it executes before the kernel virtual mapping is up. Add an action to objtool to check all allocatable sections (with the exception of __patchable_function_entries, which uses absolute references for nebulous reasons) and raise an error if any absolute references are found. Note that debug sections typically contain lots of absolute references too, but those are not allocatable so they will be ignored. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lore.kernel.org/20250828102202.1849035-39-ardb+git@google.com
54 lines
887 B
C
54 lines
887 B
C
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
/*
|
|
* Copyright (C) 2015 Josh Poimboeuf <jpoimboe@redhat.com>
|
|
*/
|
|
#ifndef _BUILTIN_H
|
|
#define _BUILTIN_H
|
|
|
|
#include <subcmd/parse-options.h>
|
|
|
|
struct opts {
|
|
/* actions: */
|
|
bool dump_orc;
|
|
bool hack_jump_label;
|
|
bool hack_noinstr;
|
|
bool hack_skylake;
|
|
bool ibt;
|
|
bool mcount;
|
|
bool noinstr;
|
|
bool orc;
|
|
bool retpoline;
|
|
bool rethunk;
|
|
bool unret;
|
|
bool sls;
|
|
bool stackval;
|
|
bool static_call;
|
|
bool uaccess;
|
|
int prefix;
|
|
bool cfi;
|
|
bool noabs;
|
|
|
|
/* options: */
|
|
bool backtrace;
|
|
bool dryrun;
|
|
bool link;
|
|
bool mnop;
|
|
bool module;
|
|
bool no_unreachable;
|
|
const char *output;
|
|
bool sec_address;
|
|
bool stats;
|
|
bool verbose;
|
|
bool werror;
|
|
};
|
|
|
|
extern struct opts opts;
|
|
|
|
int cmd_parse_options(int argc, const char **argv, const char * const usage[]);
|
|
|
|
int objtool_run(int argc, const char **argv);
|
|
|
|
void print_args(void);
|
|
|
|
#endif /* _BUILTIN_H */
|