|
Packit |
b23fcc |
/* annobin - Header file for the annobin package.
|
|
Packit |
b23fcc |
Copyright (c) 2019, 2020 Red Hat.
|
|
Packit |
b23fcc |
Created by Nick Clifton.
|
|
Packit |
b23fcc |
|
|
Packit |
b23fcc |
This is free software; you can redistribute it and/or modify it
|
|
Packit |
b23fcc |
under the terms of the GNU General Public License as published
|
|
Packit |
b23fcc |
by the Free Software Foundation; either version 3, or (at your
|
|
Packit |
b23fcc |
option) any later version.
|
|
Packit |
b23fcc |
|
|
Packit |
b23fcc |
It is distributed in the hope that it will be useful, but
|
|
Packit |
b23fcc |
WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
b23fcc |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
Packit |
b23fcc |
GNU General Public License for more details. */
|
|
Packit |
b23fcc |
|
|
Packit |
b23fcc |
#ifdef __cplusplus
|
|
Packit |
b23fcc |
extern "C" {
|
|
Packit |
b23fcc |
#endif
|
|
Packit |
b23fcc |
|
|
Packit |
b23fcc |
/* The version of the package.
|
|
Packit |
b23fcc |
NB/ This number is expected to be in the form "Nnn" where
|
|
Packit |
b23fcc |
"N" is major version number and "nn" is the minor version number. */
|
|
Packit Service |
da26c4 |
#define ANNOBIN_VERSION 950
|
|
Packit |
b23fcc |
|
|
Packit |
b23fcc |
/* The version of the annotation specification supported. */
|
|
Packit |
b23fcc |
#define SPEC_VERSION 3
|
|
Packit |
b23fcc |
|
|
Packit |
b23fcc |
#if 0 /* This would be the correct thing to do if elf/common.h did not conflict with elf.h. */
|
|
Packit |
b23fcc |
#include "elf/common.h"
|
|
Packit |
b23fcc |
#else
|
|
Packit Service |
16c28e |
#define NT_GNU_PROPERTY_TYPE_0 5 /* Note type for notes generated by gcc. */
|
|
Packit Service |
16c28e |
|
|
Packit Service |
16c28e |
#define GNU_PROPERTY_AARCH64_FEATURE_1_AND 0xc0000000
|
|
Packit Service |
16c28e |
#define GNU_PROPERTY_AARCH64_FEATURE_1_BTI (1U << 0)
|
|
Packit Service |
16c28e |
#define GNU_PROPERTY_AARCH64_FEATURE_1_PAC (1U << 1)
|
|
Packit Service |
16c28e |
#define DT_AARCH64_BTI_PLT (DT_LOPROC + 1)
|
|
Packit Service |
16c28e |
#define DT_AARCH64_PAC_PLT (DT_LOPROC + 3)
|
|
Packit Service |
16c28e |
|
|
Packit |
b23fcc |
#define NT_GNU_BUILD_ATTRIBUTE_OPEN 0x100
|
|
Packit |
b23fcc |
#define NT_GNU_BUILD_ATTRIBUTE_FUNC 0x101
|
|
Packit |
b23fcc |
/* Short-hand versions of the above defines. */
|
|
Packit |
b23fcc |
#define OPEN NT_GNU_BUILD_ATTRIBUTE_OPEN
|
|
Packit |
b23fcc |
#define FUNC NT_GNU_BUILD_ATTRIBUTE_FUNC
|
|
Packit |
b23fcc |
|
|
Packit |
b23fcc |
#define GNU_BUILD_ATTRIBUTE_TYPE_NUMERIC '*'
|
|
Packit |
b23fcc |
#define GNU_BUILD_ATTRIBUTE_TYPE_STRING '$'
|
|
Packit |
b23fcc |
#define GNU_BUILD_ATTRIBUTE_TYPE_BOOL_TRUE '+'
|
|
Packit |
b23fcc |
#define GNU_BUILD_ATTRIBUTE_TYPE_BOOL_FALSE '!'
|
|
Packit |
b23fcc |
|
|
Packit |
b23fcc |
#define NUMERIC GNU_BUILD_ATTRIBUTE_TYPE_NUMERIC
|
|
Packit |
b23fcc |
#define STRING GNU_BUILD_ATTRIBUTE_TYPE_STRING
|
|
Packit |
b23fcc |
#define BOOL_T GNU_BUILD_ATTRIBUTE_TYPE_BOOL_TRUE
|
|
Packit |
b23fcc |
#define BOOL_F GNU_BUILD_ATTRIBUTE_TYPE_BOOL_FALSE
|
|
Packit |
b23fcc |
|
|
Packit |
b23fcc |
#define GNU_BUILD_ATTRIBUTE_VERSION 1
|
|
Packit |
b23fcc |
#define GNU_BUILD_ATTRIBUTE_STACK_PROT 2
|
|
Packit |
b23fcc |
#define GNU_BUILD_ATTRIBUTE_RELRO 3
|
|
Packit |
b23fcc |
#define GNU_BUILD_ATTRIBUTE_STACK_SIZE 4
|
|
Packit |
b23fcc |
#define GNU_BUILD_ATTRIBUTE_TOOL 5
|
|
Packit |
b23fcc |
#define GNU_BUILD_ATTRIBUTE_ABI 6
|
|
Packit |
b23fcc |
#define GNU_BUILD_ATTRIBUTE_PIC 7
|
|
Packit |
b23fcc |
#define GNU_BUILD_ATTRIBUTE_SHORT_ENUM 8
|
|
Packit |
b23fcc |
|
|
Packit |
b23fcc |
#define NOTE_GNU_PROPERTY_SECTION_NAME ".note.gnu.property"
|
|
Packit |
b23fcc |
#define GNU_BUILD_ATTRS_SECTION_NAME ".gnu.build.attributes"
|
|
Packit |
b23fcc |
|
|
Packit |
b23fcc |
/* Characters used in the GNU_BUILD_ATTRIBUTE_VERSION note to identify the code producer. */
|
|
Packit |
b23fcc |
#define ANNOBIN_TOOL_ID_CLANG 'L'
|
|
Packit |
b23fcc |
#define ANNOBIN_TOOL_ID_LLVM 'V'
|
|
Packit |
b23fcc |
#define ANNOBIN_TOOL_ID_ASSEMBLER 'a'
|
|
Packit |
b23fcc |
#define ANNOBIN_TOOL_ID_LINKER 'l'
|
|
Packit |
b23fcc |
#define ANNOBIN_TOOL_ID_GCC 'p'
|
|
Packit |
b23fcc |
#define ANNOBIN_TOOL_ID_GCC_COLD 'c'
|
|
Packit |
b23fcc |
#define ANNOBIN_TOOL_ID_GCC_HOT 'h'
|
|
Packit |
b23fcc |
#define ANNOBIN_TOOL_ID_GCC_STARTUP 's'
|
|
Packit |
b23fcc |
#define ANNOBIN_TOOL_ID_GCC_EXIT 'e'
|
|
Packit |
b23fcc |
|
|
Packit |
b23fcc |
/* Values used in GNU .note.gnu.property notes (NT_GNU_PROPERTY_TYPE_0). */
|
|
Packit |
b23fcc |
#define GNU_PROPERTY_STACK_SIZE 1
|
|
Packit |
b23fcc |
#define GNU_PROPERTY_NO_COPY_ON_PROTECTED 2
|
|
Packit |
b23fcc |
#endif /* Copy of elf/common.h */
|
|
Packit |
b23fcc |
|
|
Packit |
b23fcc |
/* Utlity macros to make the code cleaner. */
|
|
Packit |
b23fcc |
#define streq(a,b) (strcmp ((a), (b)) == 0)
|
|
Packit |
b23fcc |
#define strneq(a,b,n) (strncmp ((a), (b), (n)) == 0)
|
|
Packit |
b23fcc |
#define const_strneq(a,b) (strncmp ((a), (b), sizeof (b) - 1) == 0)
|
|
Packit |
b23fcc |
|
|
Packit |
b23fcc |
#ifdef __cplusplus
|
|
Packit |
b23fcc |
}
|
|
Packit |
b23fcc |
#endif
|
|
Packit |
b23fcc |
|