{
const aarch64_protection_opts *sw_protections
= &elf_aarch64_tdata (info->output_bfd)->sw_protections;
- aarch64_bti_report bti_report = sw_protections->bti_report;
+ aarch64_feature_marking_report bti_report = sw_protections->bti_report;
/* If output has been marked with BTI using command line argument, give
out warning if necessary. */
if ((prop & GNU_PROPERTY_AARCH64_FEATURE_1_BTI)
- && (bti_report != BTI_NONE))
+ && (bti_report != MARKING_NONE))
{
if ((aprop && !(aprop->u.number & GNU_PROPERTY_AARCH64_FEATURE_1_BTI))
|| !aprop)
/* Check AArch64 BTI report. */
void
-_bfd_aarch64_elf_check_bti_report (aarch64_bti_report bti_report, bfd *ebfd)
+_bfd_aarch64_elf_check_bti_report (aarch64_feature_marking_report bti_report,
+ bfd *ebfd)
{
- if (bti_report == BTI_NONE)
+ if (bti_report == MARKING_NONE)
return;
- const char *log_level = (bti_report == BTI_WARN ? "warning" : "error");
+ const char *msg
+ = (bti_report == MARKING_WARN)
+ ? _("%pB: warning: BTI turned on by -z force-bti on the output when all "
+ "inputs do not have BTI in NOTE section.")
+ : _("%pB: error: BTI turned on by -z force-bti on the output when all "
+ "inputs do not have BTI in NOTE section.");
- const char *msg = _("%pB: %s: BTI turned on by -z force-bti on the output "
- "when all inputs do not have BTI in NOTE section.");
-
- _bfd_error_handler (msg, ebfd, log_level);
+ _bfd_error_handler (msg, ebfd);
}
\ No newline at end of file
PLT_BTI_PAC = PLT_BTI | PLT_PAC
} aarch64_plt_type;
-/* Indicates whether the linker should generate warnings/errors when input
- objects are missing BTI markings and the output has BTI markings. */
+/* Indicates whether the linker should generate warnings, errors, or nothing
+ when input objects are missing GNU feature property markings and the output
+ has the markings. */
typedef enum
{
- BTI_NONE = 0, /* Does not emit any warning/error messages. */
- BTI_WARN = 1, /* Emit warning when the input objects are missing BTI
- markings and output have BTI marking. */
- BTI_ERROR = 2, /* Emit error when the input objects are missing BTI
- markings and output have BTI marking. */
-} aarch64_bti_report;
+ MARKING_NONE = 0, /* Does not emit any warning/error messages. */
+ MARKING_WARN = 1, /* Emit warning when the input objects are missing GNU
+ feature property markings, and the output has the
+ markings. */
+ MARKING_ERROR = 2, /* Emit error when the input objects are missing GNU
+ feature property markings, and the output has the
+ markings. */
+} aarch64_feature_marking_report;
/* A structure to encompass all information about software protections coming
from BTI or PAC related command line options. */
aarch64_plt_type plt_type;
/* Report level for BTI issues. */
- aarch64_bti_report bti_report;
+ aarch64_feature_marking_report bti_report;
};
typedef struct aarch64_protection_opts aarch64_protection_opts;
uint32_t);
extern void
-_bfd_aarch64_elf_check_bti_report (aarch64_bti_report, bfd *);
+_bfd_aarch64_elf_check_bti_report (aarch64_feature_marking_report, bfd *);
extern void
_bfd_aarch64_elf_link_fixup_gnu_properties (struct bfd_link_info *,
static int no_apply_dynamic_relocs = 0;
static aarch64_protection_opts sw_protections = {
.plt_type = PLT_NORMAL,
- .bti_report = BTI_WARN,
+ .bti_report = MARKING_WARN,
};
#define COMPILE_TIME_STRLEN(s) \
if (strlen (optarg) == BTI_REPORT_LEN
|| strcmp (optarg + BTI_REPORT_LEN, "=warning") == 0)
- sw_protections.bti_report = BTI_WARN;
+ sw_protections.bti_report = MARKING_WARN;
else if (strcmp (optarg + BTI_REPORT_LEN, "=none") == 0)
- sw_protections.bti_report = BTI_NONE;
+ sw_protections.bti_report = MARKING_NONE;
else if (strcmp (optarg + BTI_REPORT_LEN, "=error") == 0)
- sw_protections.bti_report = BTI_ERROR;
+ sw_protections.bti_report = MARKING_ERROR;
else
einfo (_("%X%P: error: unrecognized value '-z %s'\n"), optarg);