linter: update clang-format installation to version 20 (#5451)
* fix: format with clang-format-20 * fix: fix clang-format linter with rewrite '^#define.*/\*.*\\$' * fix: update clang-format to version 20 in workflows and documentation * fix: add SPDX license information to .git-blame-ignore-revs
This commit is contained in:
parent
4872db027b
commit
7a77b8f7bd
69 changed files with 4827 additions and 1434 deletions
6
.git-blame-ignore-revs
Normal file
6
.git-blame-ignore-revs
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
# SPDX-FileCopyrightText: 2025 Billow <billow.fun@gmail.com>
|
||||
# SPDX-License-Identifier: LGPL-3.0-only
|
||||
|
||||
# Update to clang-format-20
|
||||
2d87400ce332b9d30b4f20ff9c64029350860e28
|
||||
f21940662a90b3e0474f97fd7124a4e2afa87254
|
||||
6
.github/workflows/linter.yml
vendored
6
.github/workflows/linter.yml
vendored
|
|
@ -110,15 +110,15 @@ jobs:
|
|||
- name: Checkout repository
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Install clang-format-16
|
||||
run: sudo apt --assume-yes install clang-format-16
|
||||
- name: Install clang-format-20
|
||||
run: sudo apt --assume-yes install clang-format-20
|
||||
|
||||
- name: Install gitpython
|
||||
run: sudo pip install gitpython
|
||||
|
||||
- name: Run clang-format
|
||||
run: |
|
||||
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-16 160
|
||||
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-20 200
|
||||
clang-format --version
|
||||
python sys/clang-format.py --check --verbose
|
||||
|
||||
|
|
|
|||
|
|
@ -51,13 +51,13 @@ E.g.: `Bug fix did not change the general behavior of the function. No documenta
|
|||
In order to contribute with patches or plugins, we encourage you to use the same
|
||||
coding style as the rest of the code base.
|
||||
|
||||
* Use git-clang-format 16 to format your code. If clang-format-16 is not available on
|
||||
* Use git-clang-format-20 to format your code. If clang-format-20 is not available on
|
||||
your Debian-based distribution, you can install it from https://apt.llvm.org/.
|
||||
You should invoke it as below (after making sure that your local copy of `dev`
|
||||
is up-to-date and your branch is up-to-date with `dev`):
|
||||
|
||||
```bash
|
||||
git-clang-format-16 --extensions c,cpp,h,hpp,inc --style file dev
|
||||
git-clang-format-20 --extensions c,cpp,h,hpp,inc --style file dev
|
||||
```
|
||||
|
||||
There is a script available to run on all source files; you will need python and
|
||||
|
|
|
|||
|
|
@ -33,7 +33,10 @@
|
|||
{ .type = RX_TOKEN_CB, .tk.cb.tk_len = (x) }
|
||||
#define RxDspSplit(x, v, it, xx) \
|
||||
{ .type = RX_TOKEN_DSP_SPLIT, \
|
||||
.tk.dsp_sp.tk_len = (x), .tk.dsp_sp.vid = (v), .tk.dsp_sp.tk_len_more = (xx), .tk.dsp_sp.interval = (it) }
|
||||
.tk.dsp_sp.tk_len = (x), \
|
||||
.tk.dsp_sp.vid = (v), \
|
||||
.tk.dsp_sp.tk_len_more = (xx), \
|
||||
.tk.dsp_sp.interval = (it) }
|
||||
#define RxIgnore(x) \
|
||||
{ .type = RX_TOKEN_IGNORE, .tk.reserved.tk_len = (x) }
|
||||
|
||||
|
|
|
|||
|
|
@ -134,8 +134,7 @@ typedef struct rz_bin_elf_section_t {
|
|||
typedef struct Elf_(rz_bin_elf_segment_t) {
|
||||
Elf_(Phdr) data;
|
||||
bool is_valid;
|
||||
}
|
||||
RzBinElfSegment;
|
||||
} RzBinElfSegment;
|
||||
|
||||
typedef struct rz_bin_elf_symbol_t {
|
||||
ut64 paddr;
|
||||
|
|
@ -173,8 +172,7 @@ typedef struct Elf_(rz_bin_elf_note_file_t) {
|
|||
Elf_(Addr) end_vaddr;
|
||||
Elf_(Addr) file_off;
|
||||
char *file;
|
||||
}
|
||||
RzBinElfNoteFile;
|
||||
} RzBinElfNoteFile;
|
||||
|
||||
/**
|
||||
* \brief Parsed PT_NOTE of type NT_PRSTATUS.
|
||||
|
|
@ -193,8 +191,7 @@ typedef struct Elf_(rz_bin_elf_note_t) {
|
|||
RzBinElfNoteFile file; //< for type == NT_FILE
|
||||
RzBinElfNotePrStatus prstatus; //< for type = NT_PRSTATUS
|
||||
};
|
||||
}
|
||||
RzBinElfNote;
|
||||
} RzBinElfNote;
|
||||
|
||||
typedef struct rz_bin_elf_strtab RzBinElfStrtab;
|
||||
|
||||
|
|
|
|||
|
|
@ -516,10 +516,8 @@ typedef struct
|
|||
#define SHN_UNDEF 0 /* Undefined section */
|
||||
#define SHN_LORESERVE 0xff00 /* Start of reserved indices */
|
||||
#define SHN_LOPROC 0xff00 /* Start of processor-specific */
|
||||
#define SHN_BEFORE 0xff00 /* Order section before all others \
|
||||
(Solaris). */
|
||||
#define SHN_AFTER 0xff01 /* Order section after all others \
|
||||
(Solaris). */
|
||||
#define SHN_BEFORE 0xff00 /* Order section before all others (Solaris). */
|
||||
#define SHN_AFTER 0xff01 /* Order section after all others (Solaris). */
|
||||
#define SHN_HIPROC 0xff1f /* End of processor-specific */
|
||||
#define SHN_LOOS 0xff20 /* Start of OS-specific */
|
||||
#define SHN_HIOS 0xff3f /* End of OS-specific */
|
||||
|
|
@ -576,17 +574,14 @@ typedef struct
|
|||
#define SHF_STRINGS (1 << 5) /* Contains nul-terminated strings */
|
||||
#define SHF_INFO_LINK (1 << 6) /* `sh_info' contains SHT index */
|
||||
#define SHF_LINK_ORDER (1 << 7) /* Preserve order after combining */
|
||||
#define SHF_OS_NONCONFORMING (1 << 8) /* Non-standard OS specific handling \
|
||||
required */
|
||||
#define SHF_OS_NONCONFORMING (1 << 8) /* Non-standard OS specific handling required */
|
||||
#define SHF_GROUP (1 << 9) /* Section is member of a group. */
|
||||
#define SHF_TLS (1 << 10) /* Section hold thread-local data. */
|
||||
#define SHF_COMPRESSED (1 << 11) /* Section with compressed data. */
|
||||
#define SHF_MASKOS 0x0ff00000 /* OS-specific. */
|
||||
#define SHF_MASKPROC 0xf0000000 /* Processor-specific */
|
||||
#define SHF_ORDERED (1 << 30) /* Special ordering requirement \
|
||||
(Solaris). */
|
||||
#define SHF_EXCLUDE (1U << 31) /* Section is excluded unless \
|
||||
referenced or allocated (Solaris).*/
|
||||
#define SHF_ORDERED (1 << 30) /* Special ordering requirement (Solaris). */
|
||||
#define SHF_EXCLUDE (1U << 31) /* Section is excluded unless referenced or allocated (Solaris).*/
|
||||
|
||||
/* Section compression header. Used when SHF_COMPRESSED is set. */
|
||||
|
||||
|
|
@ -662,8 +657,7 @@ typedef struct
|
|||
#define SYMINFO_FLG_DIRECT 0x0001 /* Direct bound symbol */
|
||||
#define SYMINFO_FLG_PASSTHRU 0x0002 /* Pass-thru symbol for translator */
|
||||
#define SYMINFO_FLG_COPY 0x0004 /* Symbol is a copy-reloc */
|
||||
#define SYMINFO_FLG_LAZYLOAD 0x0008 /* Symbol bound to object to be lazy \
|
||||
loaded */
|
||||
#define SYMINFO_FLG_LAZYLOAD 0x0008 /* Symbol bound to object to be lazy loaded */
|
||||
/* Syminfo version values. */
|
||||
#define SYMINFO_NONE 0
|
||||
#define SYMINFO_CURRENT 1
|
||||
|
|
@ -839,8 +833,7 @@ typedef struct
|
|||
/* Legal values for note segment descriptor types for core files. */
|
||||
|
||||
#define NT_PRSTATUS 1 /* Contains copy of prstatus struct */
|
||||
#define NT_PRFPREG 2 /* Contains copy of fpregset \
|
||||
struct. */
|
||||
#define NT_PRFPREG 2 /* Contains copy of fpregset struct. */
|
||||
#define NT_FPREGSET 2 /* Contains copy of fpregset struct */
|
||||
#define NT_PRPSINFO 3 /* Contains copy of prpsinfo struct */
|
||||
#define NT_PRXREG 4 /* Contains copy of prxregset struct */
|
||||
|
|
@ -856,10 +849,8 @@ typedef struct
|
|||
#define NT_LWPSTATUS 16 /* Contains copy of lwpstatus struct */
|
||||
#define NT_LWPSINFO 17 /* Contains copy of lwpinfo struct */
|
||||
#define NT_PRFPXREG 20 /* Contains copy of fprxregset struct */
|
||||
#define NT_SIGINFO 0x53494749 /* Contains copy of siginfo_t, \
|
||||
size might increase */
|
||||
#define NT_FILE 0x46494c45 /* Contains information about mapped \
|
||||
files */
|
||||
#define NT_SIGINFO 0x53494749 /* Contains copy of siginfo_t, size might increase */
|
||||
#define NT_FILE 0x46494c45 /* Contains information about mapped files */
|
||||
#define NT_PRXFPREG 0x46e62b7f /* Contains copy of user_fxsr_struct */
|
||||
#define NT_PPC_VMX 0x100 /* PowerPC Altivec/VMX registers */
|
||||
#define NT_PPC_SPE 0x101 /* PowerPC SPE/EVR registers */
|
||||
|
|
@ -874,14 +865,10 @@ typedef struct
|
|||
#define NT_PPC_TM_CVMX 0x10a /* TM checkpointed VMX Registers */
|
||||
#define NT_PPC_TM_CVSX 0x10b /* TM checkpointed VSX Registers */
|
||||
#define NT_PPC_TM_SPR 0x10c /* TM Special Purpose Registers */
|
||||
#define NT_PPC_TM_CTAR 0x10d /* TM checkpointed Target Address \
|
||||
Register */
|
||||
#define NT_PPC_TM_CPPR 0x10e /* TM checkpointed Program Priority \
|
||||
Register */
|
||||
#define NT_PPC_TM_CDSCR 0x10f /* TM checkpointed Data Stream Control \
|
||||
Register */
|
||||
#define NT_PPC_PKEY 0x110 /* Memory Protection Keys \
|
||||
registers. */
|
||||
#define NT_PPC_TM_CTAR 0x10d /* TM checkpointed Target Address Register */
|
||||
#define NT_PPC_TM_CPPR 0x10e /* TM checkpointed Program Priority Register */
|
||||
#define NT_PPC_TM_CDSCR 0x10f /* TM checkpointed Data Stream Control Register */
|
||||
#define NT_PPC_PKEY 0x110 /* Memory Protection Keys registers. */
|
||||
#define NT_386_TLS 0x200 /* i386 TLS slots (struct user_desc) */
|
||||
#define NT_386_IOPERM 0x201 /* x86 io permission bitmap (1=deny) */
|
||||
#define NT_X86_XSTATE 0x202 /* x86 extended state using xsave */
|
||||
|
|
@ -894,26 +881,20 @@ typedef struct
|
|||
#define NT_S390_LAST_BREAK 0x306 /* s390 breaking event address */
|
||||
#define NT_S390_SYSTEM_CALL 0x307 /* s390 system call restart data */
|
||||
#define NT_S390_TDB 0x308 /* s390 transaction diagnostic block */
|
||||
#define NT_S390_VXRS_LOW 0x309 /* s390 vector registers 0-15 \
|
||||
upper half. */
|
||||
#define NT_S390_VXRS_LOW 0x309 /* s390 vector registers 0-15 upper half. */
|
||||
#define NT_S390_VXRS_HIGH 0x30a /* s390 vector registers 16-31. */
|
||||
#define NT_S390_GS_CB 0x30b /* s390 guarded storage registers. */
|
||||
#define NT_S390_GS_BC 0x30c /* s390 guarded storage \
|
||||
broadcast control block. */
|
||||
#define NT_S390_GS_BC 0x30c /* s390 guarded storage broadcast control block. */
|
||||
#define NT_S390_RI_CB 0x30d /* s390 runtime instrumentation. */
|
||||
#define NT_ARM_VFP 0x400 /* ARM VFP/NEON registers */
|
||||
#define NT_ARM_TLS 0x401 /* ARM TLS register */
|
||||
#define NT_ARM_HW_BREAK 0x402 /* ARM hardware breakpoint registers */
|
||||
#define NT_ARM_HW_WATCH 0x403 /* ARM hardware watchpoint registers */
|
||||
#define NT_ARM_SYSTEM_CALL 0x404 /* ARM system call number */
|
||||
#define NT_ARM_SVE 0x405 /* ARM Scalable Vector Extension \
|
||||
registers */
|
||||
#define NT_ARM_PAC_MASK 0x406 /* ARM pointer authentication \
|
||||
code masks. */
|
||||
#define NT_ARM_PACA_KEYS 0x407 /* ARM pointer authentication \
|
||||
address keys. */
|
||||
#define NT_ARM_PACG_KEYS 0x408 /* ARM pointer authentication \
|
||||
generic key. */
|
||||
#define NT_ARM_SVE 0x405 /* ARM Scalable Vector Extension registers */
|
||||
#define NT_ARM_PAC_MASK 0x406 /* ARM pointer authentication code masks. */
|
||||
#define NT_ARM_PACA_KEYS 0x407 /* ARM pointer authentication address keys. */
|
||||
#define NT_ARM_PACG_KEYS 0x408 /* ARM pointer authentication generic key. */
|
||||
#define NT_VMCOREDD 0x700 /* Vmcore Device Dump Note. */
|
||||
#define NT_MIPS_DSP 0x800 /* MIPS DSP ASE registers. */
|
||||
#define NT_MIPS_FP_MODE 0x801 /* MIPS floating-point mode. */
|
||||
|
|
@ -1007,8 +988,7 @@ typedef struct
|
|||
#define DT_MOVEENT 0x6ffffdfa
|
||||
#define DT_MOVESZ 0x6ffffdfb
|
||||
#define DT_FEATURE_1 0x6ffffdfc /* Feature selection (DTF_*). */
|
||||
#define DT_POSFLAG_1 0x6ffffdfd /* Flags for DT_* entries, effecting \
|
||||
the following DT_* entry. */
|
||||
#define DT_POSFLAG_1 0x6ffffdfd /* Flags for DT_* entries, effecting the following DT_* entry. */
|
||||
#define DT_SYMINSZ 0x6ffffdfe /* Size of syminfo table (in bytes) */
|
||||
#define DT_SYMINENT 0x6ffffdff /* Entry size of syminfo */
|
||||
#define DT_VALRNGHI 0x6ffffdff
|
||||
|
|
@ -1045,11 +1025,9 @@ typedef struct
|
|||
|
||||
/* These were chosen by Sun. */
|
||||
#define DT_FLAGS_1 0x6ffffffb /* State flags, see DF_1_* below. */
|
||||
#define DT_VERDEF 0x6ffffffc /* Address of version definition \
|
||||
table */
|
||||
#define DT_VERDEF 0x6ffffffc /* Address of version definition table */
|
||||
#define DT_VERDEFNUM 0x6ffffffd /* Number of version definitions */
|
||||
#define DT_VERNEED 0x6ffffffe /* Address of table with needed \
|
||||
versions */
|
||||
#define DT_VERNEED 0x6ffffffe /* Address of table with needed versions */
|
||||
#define DT_VERNEEDNUM 0x6fffffff /* Number of needed versions */
|
||||
#define DT_VERSIONTAGIDX(tag) (DT_VERNEEDNUM - (tag)) /* Reverse order! */
|
||||
#define DT_VERSIONTAGNUM 16
|
||||
|
|
@ -1108,8 +1086,7 @@ typedef struct
|
|||
|
||||
/* Flags in the DT_POSFLAG_1 entry effecting only the next DT_* entry. */
|
||||
#define DF_P1_LAZYLOAD 0x00000001 /* Lazyload following object. */
|
||||
#define DF_P1_GROUPPERM 0x00000002 /* Symbols from next object are not \
|
||||
generally available. */
|
||||
#define DF_P1_GROUPPERM 0x00000002 /* Symbols from next object are not generally available. */
|
||||
|
||||
/* Version definition sections. */
|
||||
|
||||
|
|
@ -1274,8 +1251,7 @@ typedef struct
|
|||
|
||||
/* Some more special a_type values describing the hardware. */
|
||||
#define AT_PLATFORM 15 /* String identifying platform. */
|
||||
#define AT_HWCAP 16 /* Machine-dependent hints about \
|
||||
processor capabilities. */
|
||||
#define AT_HWCAP 16 /* Machine-dependent hints about processor capabilities. */
|
||||
|
||||
/* This entry gives some information about the FPU initialization
|
||||
performed by the kernel. */
|
||||
|
|
@ -1296,8 +1272,7 @@ typedef struct
|
|||
|
||||
#define AT_RANDOM 25 /* Address of 16 random bytes. */
|
||||
|
||||
#define AT_HWCAP2 26 /* More machine-dependent hints about \
|
||||
processor capabilities. */
|
||||
#define AT_HWCAP2 26 /* More machine-dependent hints about processor capabilities. */
|
||||
|
||||
#define AT_EXECFN 31 /* Filename of executable. */
|
||||
|
||||
|
|
@ -1325,8 +1300,7 @@ typedef struct
|
|||
#define AT_L3_CACHESIZE 46
|
||||
#define AT_L3_CACHEGEOMETRY 47
|
||||
|
||||
#define AT_MINSIGSTKSZ 51 /* Stack needed for signal delivery \
|
||||
(AArch64). */
|
||||
#define AT_MINSIGSTKSZ 51 /* Stack needed for signal delivery (AArch64). */
|
||||
|
||||
/* Note section contents. Each entry in the note section begins with
|
||||
a header of a fixed form. */
|
||||
|
|
@ -1524,12 +1498,9 @@ typedef struct
|
|||
#define R_68K_TLS_IE32 34 /* 32 bit GOT offset for IE */
|
||||
#define R_68K_TLS_IE16 35 /* 16 bit GOT offset for IE */
|
||||
#define R_68K_TLS_IE8 36 /* 8 bit GOT offset for IE */
|
||||
#define R_68K_TLS_LE32 37 /* 32 bit offset relative to \
|
||||
static TLS block */
|
||||
#define R_68K_TLS_LE16 38 /* 16 bit offset relative to \
|
||||
static TLS block */
|
||||
#define R_68K_TLS_LE8 39 /* 8 bit offset relative to \
|
||||
static TLS block */
|
||||
#define R_68K_TLS_LE32 37 /* 32 bit offset relative to static TLS block */
|
||||
#define R_68K_TLS_LE16 38 /* 16 bit offset relative to static TLS block */
|
||||
#define R_68K_TLS_LE8 39 /* 8 bit offset relative to static TLS block */
|
||||
#define R_68K_TLS_DTPMOD32 40 /* 32 bit module number */
|
||||
#define R_68K_TLS_DTPREL32 41 /* 32 bit module-relative offset */
|
||||
#define R_68K_TLS_TPREL32 42 /* 32 bit TP-relative offset */
|
||||
|
|
@ -2121,22 +2092,15 @@ typedef struct
|
|||
#define DT_MIPS_HIPAGENO 0x70000014 /* Number of GOT page table entries */
|
||||
#define DT_MIPS_RLD_MAP 0x70000016 /* Address of run time loader map. */
|
||||
#define DT_MIPS_DELTA_CLASS 0x70000017 /* Delta C++ class definition. */
|
||||
#define DT_MIPS_DELTA_CLASS_NO 0x70000018 /* Number of entries in \
|
||||
DT_MIPS_DELTA_CLASS. */
|
||||
#define DT_MIPS_DELTA_CLASS_NO 0x70000018 /* Number of entries in DT_MIPS_DELTA_CLASS. */
|
||||
#define DT_MIPS_DELTA_INSTANCE 0x70000019 /* Delta C++ class instances. */
|
||||
#define DT_MIPS_DELTA_INSTANCE_NO 0x7000001a /* Number of entries in \
|
||||
DT_MIPS_DELTA_INSTANCE. */
|
||||
#define DT_MIPS_DELTA_INSTANCE_NO 0x7000001a /* Number of entries in DT_MIPS_DELTA_INSTANCE. */
|
||||
#define DT_MIPS_DELTA_RELOC 0x7000001b /* Delta relocations. */
|
||||
#define DT_MIPS_DELTA_RELOC_NO 0x7000001c /* Number of entries in \
|
||||
DT_MIPS_DELTA_RELOC. */
|
||||
#define DT_MIPS_DELTA_SYM 0x7000001d /* Delta symbols that Delta \
|
||||
relocations refer to. */
|
||||
#define DT_MIPS_DELTA_SYM_NO 0x7000001e /* Number of entries in \
|
||||
DT_MIPS_DELTA_SYM. */
|
||||
#define DT_MIPS_DELTA_CLASSSYM 0x70000020 /* Delta symbols that hold the \
|
||||
class declaration. */
|
||||
#define DT_MIPS_DELTA_CLASSSYM_NO 0x70000021 /* Number of entries in \
|
||||
DT_MIPS_DELTA_CLASSSYM. */
|
||||
#define DT_MIPS_DELTA_RELOC_NO 0x7000001c /* Number of entries in DT_MIPS_DELTA_RELOC. */
|
||||
#define DT_MIPS_DELTA_SYM 0x7000001d /* Delta symbols that Delta relocations refer to. */
|
||||
#define DT_MIPS_DELTA_SYM_NO 0x7000001e /* Number of entries in DT_MIPS_DELTA_SYM. */
|
||||
#define DT_MIPS_DELTA_CLASSSYM 0x70000020 /* Delta symbols that hold the class declaration. */
|
||||
#define DT_MIPS_DELTA_CLASSSYM_NO 0x70000021 /* Number of entries in DT_MIPS_DELTA_CLASSSYM. */
|
||||
#define DT_MIPS_CXX_FLAGS 0x70000022 /* Flags indicating for C++ flavor. */
|
||||
#define DT_MIPS_PIXIE_INIT 0x70000023
|
||||
#define DT_MIPS_SYMBOL_LIB 0x70000024
|
||||
|
|
@ -2148,10 +2112,8 @@ typedef struct
|
|||
#define DT_MIPS_INTERFACE 0x7000002a /* Address of .interface. */
|
||||
#define DT_MIPS_DYNSTR_ALIGN 0x7000002b
|
||||
#define DT_MIPS_INTERFACE_SIZE 0x7000002c /* Size of the .interface section. */
|
||||
#define DT_MIPS_RLD_TEXT_RESOLVE_ADDR 0x7000002d /* Address of rld_text_rsolve \
|
||||
function stored in GOT. */
|
||||
#define DT_MIPS_PERF_SUFFIX 0x7000002e /* Default suffix of dso to be added \
|
||||
by rld on dlopen() calls. */
|
||||
#define DT_MIPS_RLD_TEXT_RESOLVE_ADDR 0x7000002d /* Address of rld_text_rsolve function stored in GOT. */
|
||||
#define DT_MIPS_PERF_SUFFIX 0x7000002e /* Default suffix of dso to be added by rld on dlopen() calls. */
|
||||
#define DT_MIPS_COMPACT_SIZE 0x7000002f /* (O32)Size of compact rel section. */
|
||||
#define DT_MIPS_GP_VALUE 0x70000030 /* GP value for aux GOTs. */
|
||||
#define DT_MIPS_AUX_DYNAMIC 0x70000031 /* Address of aux .dynamic. */
|
||||
|
|
@ -2325,8 +2287,7 @@ enum {
|
|||
#define EF_PARISC_EXT 0x00020000 /* Program uses arch. extensions. */
|
||||
#define EF_PARISC_LSB 0x00040000 /* Program expects little endian. */
|
||||
#define EF_PARISC_WIDE 0x00080000 /* Program expects wide mode. */
|
||||
#define EF_PARISC_NO_KABP 0x00100000 /* No kernel assisted branch \
|
||||
prediction. */
|
||||
#define EF_PARISC_NO_KABP 0x00100000 /* No kernel assisted branch prediction. */
|
||||
#define EF_PARISC_LAZYSWAP 0x00400000 /* Allow lazy swapping. */
|
||||
#define EF_PARISC_ARCH 0x0000ffff /* Architecture version. */
|
||||
|
||||
|
|
@ -2338,8 +2299,7 @@ enum {
|
|||
|
||||
/* Additional section indeces. */
|
||||
|
||||
#define SHN_PARISC_ANSI_COMMON 0xff00 /* Section for tenatively declared \
|
||||
symbols in ANSI C. */
|
||||
#define SHN_PARISC_ANSI_COMMON 0xff00 /* Section for tenatively declared symbols in ANSI C. */
|
||||
#define SHN_PARISC_HUGE_COMMON 0xff01 /* Common blocks in huge model. */
|
||||
|
||||
/* Legal values for sh_type field of Elf32_Shdr. */
|
||||
|
|
@ -2585,8 +2545,7 @@ enum {
|
|||
|
||||
/* Cygnus local bits below */
|
||||
#define EF_PPC_RELOCATABLE 0x00010000 /* PowerPC -mrelocatable flag*/
|
||||
#define EF_PPC_RELOCATABLE_LIB 0x00008000 /* PowerPC -mrelocatable-lib \
|
||||
flag */
|
||||
#define EF_PPC_RELOCATABLE_LIB 0x00008000 /* PowerPC -mrelocatable-lib flag */
|
||||
|
||||
/* PowerPC relocations defined by the ABIs */
|
||||
#define R_PPC_NONE 0
|
||||
|
|
@ -2906,12 +2865,10 @@ enum {
|
|||
|
||||
/* ARM-specific values for sh_flags */
|
||||
#define SHF_ARM_ENTRYSECT 0x10000000 /* Section contains an entry point */
|
||||
#define SHF_ARM_COMDEF 0x80000000 /* Section may be multiply defined \
|
||||
in the input to a link step. */
|
||||
#define SHF_ARM_COMDEF 0x80000000 /* Section may be multiply defined in the input to a link step. */
|
||||
|
||||
/* ARM-specific program header flags */
|
||||
#define PF_ARM_SB 0x10000000 /* Segment contains the location \
|
||||
addressed by the static base. */
|
||||
#define PF_ARM_SB 0x10000000 /* Segment contains the location addressed by the static base. */
|
||||
#define PF_ARM_PI 0x20000000 /* Position-independent segment. */
|
||||
#define PF_ARM_ABS 0x40000000 /* Absolute segment. */
|
||||
|
||||
|
|
@ -3073,8 +3030,7 @@ enum {
|
|||
/* ARM relocs. */
|
||||
|
||||
#define R_ARM_NONE 0 /* No reloc */
|
||||
#define R_ARM_PC24 1 /* Deprecated PC relative 26 \
|
||||
bit branch. */
|
||||
#define R_ARM_PC24 1 /* Deprecated PC relative 26 bit branch. */
|
||||
#define R_ARM_ABS32 2 /* Direct 32 bit */
|
||||
#define R_ARM_REL32 3 /* PC relative 32 bit */
|
||||
#define R_ARM_PC13 4
|
||||
|
|
@ -3084,8 +3040,7 @@ enum {
|
|||
#define R_ARM_ABS8 8 /* Direct 8 bit */
|
||||
#define R_ARM_SBREL32 9
|
||||
#define R_ARM_THM_PC22 10 /* PC relative 24 bit (Thumb32 BL). */
|
||||
#define R_ARM_THM_PC8 11 /* PC relative & 0x3FC \
|
||||
(Thumb16 LDR, ADD, ADR). */
|
||||
#define R_ARM_THM_PC8 11 /* PC relative & 0x3FC (Thumb16 LDR, ADD, ADR). */
|
||||
#define R_ARM_AMP_VCALL9 12
|
||||
#define R_ARM_SWI24 13 /* Obsolete static relocation. */
|
||||
#define R_ARM_TLS_DESC 13 /* Dynamic relocation. */
|
||||
|
|
@ -3104,8 +3059,7 @@ enum {
|
|||
#define R_ARM_GOT32 26 /* 32 bit GOT entry */
|
||||
#define R_ARM_PLT32 27 /* Deprecated, 32 bit PLT address. */
|
||||
#define R_ARM_CALL 28 /* PC relative 24 bit (BL, BLX). */
|
||||
#define R_ARM_JUMP24 29 /* PC relative 24 bit \
|
||||
(B, BL<cond>). */
|
||||
#define R_ARM_JUMP24 29 /* PC relative 24 bit (B, BL<cond>). */
|
||||
#define R_ARM_THM_JUMP24 30 /* PC relative 24 bit (Thumb32 B.W). */
|
||||
#define R_ARM_BASE_ABS 31 /* Adjust by program base. */
|
||||
#define R_ARM_ALU_PCREL_7_0 32 /* Obsolete. */
|
||||
|
|
@ -3124,20 +3078,13 @@ enum {
|
|||
#define R_ARM_MOVW_PREL_NC 45 /* PC relative 16-bit (MOVW). */
|
||||
#define R_ARM_MOVT_PREL 46 /* PC relative (MOVT). */
|
||||
#define R_ARM_THM_MOVW_ABS_NC 47 /* Direct 16 bit (Thumb32 MOVW). */
|
||||
#define R_ARM_THM_MOVT_ABS 48 /* Direct high 16 bit \
|
||||
(Thumb32 MOVT). */
|
||||
#define R_ARM_THM_MOVW_PREL_NC 49 /* PC relative 16 bit \
|
||||
(Thumb32 MOVW). */
|
||||
#define R_ARM_THM_MOVT_PREL 50 /* PC relative high 16 bit \
|
||||
(Thumb32 MOVT). */
|
||||
#define R_ARM_THM_JUMP19 51 /* PC relative 20 bit \
|
||||
(Thumb32 B<cond>.W). */
|
||||
#define R_ARM_THM_JUMP6 52 /* PC relative X & 0x7E \
|
||||
(Thumb16 CBZ, CBNZ). */
|
||||
#define R_ARM_THM_ALU_PREL_11_0 53 /* PC relative 12 bit \
|
||||
(Thumb32 ADR.W). */
|
||||
#define R_ARM_THM_PC12 54 /* PC relative 12 bit \
|
||||
(Thumb32 LDR{D,SB,H,SH}). */
|
||||
#define R_ARM_THM_MOVT_ABS 48 /* Direct high 16 bit (Thumb32 MOVT). */
|
||||
#define R_ARM_THM_MOVW_PREL_NC 49 /* PC relative 16 bit (Thumb32 MOVW). */
|
||||
#define R_ARM_THM_MOVT_PREL 50 /* PC relative high 16 bit (Thumb32 MOVT). */
|
||||
#define R_ARM_THM_JUMP19 51 /* PC relative 20 bit (Thumb32 B<cond>.W). */
|
||||
#define R_ARM_THM_JUMP6 52 /* PC relative X & 0x7E (Thumb16 CBZ, CBNZ). */
|
||||
#define R_ARM_THM_ALU_PREL_11_0 53 /* PC relative 12 bit (Thumb32 ADR.W). */
|
||||
#define R_ARM_THM_PC12 54 /* PC relative 12 bit (Thumb32 LDR{D,SB,H,SH}). */
|
||||
#define R_ARM_ABS32_NOI 55 /* Direct 32-bit. */
|
||||
#define R_ARM_REL32_NOI 56 /* PC relative 32-bit. */
|
||||
#define R_ARM_ALU_PC_G0_NC 57 /* PC relative (ADD, SUB). */
|
||||
|
|
@ -3147,12 +3094,9 @@ enum {
|
|||
#define R_ARM_ALU_PC_G2 61 /* PC relative (ADD, SUB). */
|
||||
#define R_ARM_LDR_PC_G1 62 /* PC relative (LDR,STR,LDRB,STRB). */
|
||||
#define R_ARM_LDR_PC_G2 63 /* PC relative (LDR,STR,LDRB,STRB). */
|
||||
#define R_ARM_LDRS_PC_G0 64 /* PC relative (STR{D,H}, \
|
||||
LDR{D,SB,H,SH}). */
|
||||
#define R_ARM_LDRS_PC_G1 65 /* PC relative (STR{D,H}, \
|
||||
LDR{D,SB,H,SH}). */
|
||||
#define R_ARM_LDRS_PC_G2 66 /* PC relative (STR{D,H}, \
|
||||
LDR{D,SB,H,SH}). */
|
||||
#define R_ARM_LDRS_PC_G0 64 /* PC relative (STR{D,H}, LDR{D,SB,H,SH}). */
|
||||
#define R_ARM_LDRS_PC_G1 65 /* PC relative (STR{D,H}, LDR{D,SB,H,SH}). */
|
||||
#define R_ARM_LDRS_PC_G2 66 /* PC relative (STR{D,H}, LDR{D,SB,H,SH}). */
|
||||
#define R_ARM_LDC_PC_G0 67 /* PC relative (LDC, STC). */
|
||||
#define R_ARM_LDC_PC_G1 68 /* PC relative (LDC, STC). */
|
||||
#define R_ARM_LDC_PC_G2 69 /* PC relative (LDC, STC). */
|
||||
|
|
@ -3161,33 +3105,21 @@ enum {
|
|||
#define R_ARM_ALU_SB_G1_NC 72 /* Program base relative (ADD,SUB). */
|
||||
#define R_ARM_ALU_SB_G1 73 /* Program base relative (ADD,SUB). */
|
||||
#define R_ARM_ALU_SB_G2 74 /* Program base relative (ADD,SUB). */
|
||||
#define R_ARM_LDR_SB_G0 75 /* Program base relative (LDR, \
|
||||
STR, LDRB, STRB). */
|
||||
#define R_ARM_LDR_SB_G1 76 /* Program base relative \
|
||||
(LDR, STR, LDRB, STRB). */
|
||||
#define R_ARM_LDR_SB_G2 77 /* Program base relative \
|
||||
(LDR, STR, LDRB, STRB). */
|
||||
#define R_ARM_LDRS_SB_G0 78 /* Program base relative \
|
||||
(LDR, STR, LDRB, STRB). */
|
||||
#define R_ARM_LDRS_SB_G1 79 /* Program base relative \
|
||||
(LDR, STR, LDRB, STRB). */
|
||||
#define R_ARM_LDRS_SB_G2 80 /* Program base relative \
|
||||
(LDR, STR, LDRB, STRB). */
|
||||
#define R_ARM_LDR_SB_G0 75 /* Program base relative (LDR, STR, LDRB, STRB). */
|
||||
#define R_ARM_LDR_SB_G1 76 /* Program base relative (LDR, STR, LDRB, STRB). */
|
||||
#define R_ARM_LDR_SB_G2 77 /* Program base relative (LDR, STR, LDRB, STRB). */
|
||||
#define R_ARM_LDRS_SB_G0 78 /* Program base relative (LDR, STR, LDRB, STRB). */
|
||||
#define R_ARM_LDRS_SB_G1 79 /* Program base relative (LDR, STR, LDRB, STRB). */
|
||||
#define R_ARM_LDRS_SB_G2 80 /* Program base relative (LDR, STR, LDRB, STRB). */
|
||||
#define R_ARM_LDC_SB_G0 81 /* Program base relative (LDC,STC). */
|
||||
#define R_ARM_LDC_SB_G1 82 /* Program base relative (LDC,STC). */
|
||||
#define R_ARM_LDC_SB_G2 83 /* Program base relative (LDC,STC). */
|
||||
#define R_ARM_MOVW_BREL_NC 84 /* Program base relative 16 \
|
||||
bit (MOVW). */
|
||||
#define R_ARM_MOVT_BREL 85 /* Program base relative high \
|
||||
16 bit (MOVT). */
|
||||
#define R_ARM_MOVW_BREL 86 /* Program base relative 16 \
|
||||
bit (MOVW). */
|
||||
#define R_ARM_THM_MOVW_BREL_NC 87 /* Program base relative 16 \
|
||||
bit (Thumb32 MOVW). */
|
||||
#define R_ARM_THM_MOVT_BREL 88 /* Program base relative high \
|
||||
16 bit (Thumb32 MOVT). */
|
||||
#define R_ARM_THM_MOVW_BREL 89 /* Program base relative 16 \
|
||||
bit (Thumb32 MOVW). */
|
||||
#define R_ARM_MOVW_BREL_NC 84 /* Program base relative 16 bit (MOVW). */
|
||||
#define R_ARM_MOVT_BREL 85 /* Program base relative high 16 bit (MOVT). */
|
||||
#define R_ARM_MOVW_BREL 86 /* Program base relative 16 bit (MOVW). */
|
||||
#define R_ARM_THM_MOVW_BREL_NC 87 /* Program base relative 16 bit (Thumb32 MOVW). */
|
||||
#define R_ARM_THM_MOVT_BREL 88 /* Program base relative high 16 bit (Thumb32 MOVT). */
|
||||
#define R_ARM_THM_MOVW_BREL 89 /* Program base relative 16 bit (Thumb32 MOVW). */
|
||||
#define R_ARM_TLS_GOTDESC 90
|
||||
#define R_ARM_TLS_CALL 91
|
||||
#define R_ARM_TLS_DESCSEQ 92 /* TLS relaxation. */
|
||||
|
|
@ -3195,38 +3127,26 @@ enum {
|
|||
#define R_ARM_PLT32_ABS 94
|
||||
#define R_ARM_GOT_ABS 95 /* GOT entry. */
|
||||
#define R_ARM_GOT_PREL 96 /* PC relative GOT entry. */
|
||||
#define R_ARM_GOT_BREL12 97 /* GOT entry relative to GOT \
|
||||
origin (LDR). */
|
||||
#define R_ARM_GOTOFF12 98 /* 12 bit, GOT entry relative \
|
||||
to GOT origin (LDR, STR). */
|
||||
#define R_ARM_GOT_BREL12 97 /* GOT entry relative to GOT origin (LDR). */
|
||||
#define R_ARM_GOTOFF12 98 /* 12 bit, GOT entry relative to GOT origin (LDR, STR). */
|
||||
#define R_ARM_GOTRELAX 99
|
||||
#define R_ARM_GNU_VTENTRY 100
|
||||
#define R_ARM_GNU_VTINHERIT 101
|
||||
#define R_ARM_THM_PC11 102 /* PC relative & 0xFFE (Thumb16 B). */
|
||||
#define R_ARM_THM_PC9 103 /* PC relative & 0x1FE \
|
||||
(Thumb16 B/B<cond>). */
|
||||
#define R_ARM_TLS_GD32 104 /* PC-rel 32 bit for global dynamic \
|
||||
thread local data */
|
||||
#define R_ARM_TLS_LDM32 105 /* PC-rel 32 bit for local dynamic \
|
||||
thread local data */
|
||||
#define R_ARM_TLS_LDO32 106 /* 32 bit offset relative to TLS \
|
||||
block */
|
||||
#define R_ARM_TLS_IE32 107 /* PC-rel 32 bit for GOT entry of \
|
||||
static TLS block offset */
|
||||
#define R_ARM_TLS_LE32 108 /* 32 bit offset relative to static \
|
||||
TLS block */
|
||||
#define R_ARM_TLS_LDO12 109 /* 12 bit relative to TLS \
|
||||
block (LDR, STR). */
|
||||
#define R_ARM_TLS_LE12 110 /* 12 bit relative to static \
|
||||
TLS block (LDR, STR). */
|
||||
#define R_ARM_TLS_IE12GP 111 /* 12 bit GOT entry relative \
|
||||
to GOT origin (LDR). */
|
||||
#define R_ARM_THM_PC9 103 /* PC relative & 0x1FE (Thumb16 B/B<cond>). */
|
||||
#define R_ARM_TLS_GD32 104 /* PC-rel 32 bit for global dynamic thread local data */
|
||||
#define R_ARM_TLS_LDM32 105 /* PC-rel 32 bit for local dynamic thread local data */
|
||||
#define R_ARM_TLS_LDO32 106 /* 32 bit offset relative to TLS block */
|
||||
#define R_ARM_TLS_IE32 107 /* PC-rel 32 bit for GOT entry of static TLS block offset */
|
||||
#define R_ARM_TLS_LE32 108 /* 32 bit offset relative to static TLS block */
|
||||
#define R_ARM_TLS_LDO12 109 /* 12 bit relative to TLS block (LDR, STR). */
|
||||
#define R_ARM_TLS_LE12 110 /* 12 bit relative to static TLS block (LDR, STR). */
|
||||
#define R_ARM_TLS_IE12GP 111 /* 12 bit GOT entry relative to GOT origin (LDR). */
|
||||
#define R_ARM_ME_TOO 128 /* Obsolete. */
|
||||
#define R_ARM_THM_TLS_DESCSEQ 129
|
||||
#define R_ARM_THM_TLS_DESCSEQ16 129
|
||||
#define R_ARM_THM_TLS_DESCSEQ32 130
|
||||
#define R_ARM_THM_GOT_BREL12 131 /* GOT entry relative to GOT \
|
||||
origin, 12 bit (Thumb32 LDR). */
|
||||
#define R_ARM_THM_GOT_BREL12 131 /* GOT entry relative to GOT origin, 12 bit (Thumb32 LDR). */
|
||||
#define R_ARM_IRELATIVE 160
|
||||
#define R_ARM_RXPC25 249
|
||||
#define R_ARM_RSBREL32 250
|
||||
|
|
@ -3538,47 +3458,29 @@ enum {
|
|||
#define R_390_PLTOFF32 35 /* 32 bit offset from GOT to PLT. */
|
||||
#define R_390_PLTOFF64 36 /* 16 bit offset from GOT to PLT. */
|
||||
#define R_390_TLS_LOAD 37 /* Tag for load insn in TLS code. */
|
||||
#define R_390_TLS_GDCALL 38 /* Tag for function call in general \
|
||||
dynamic TLS code. */
|
||||
#define R_390_TLS_LDCALL 39 /* Tag for function call in local \
|
||||
dynamic TLS code. */
|
||||
#define R_390_TLS_GD32 40 /* Direct 32 bit for general dynamic \
|
||||
thread local data. */
|
||||
#define R_390_TLS_GD64 41 /* Direct 64 bit for general dynamic \
|
||||
thread local data. */
|
||||
#define R_390_TLS_GOTIE12 42 /* 12 bit GOT offset for static TLS \
|
||||
block offset. */
|
||||
#define R_390_TLS_GOTIE32 43 /* 32 bit GOT offset for static TLS \
|
||||
block offset. */
|
||||
#define R_390_TLS_GOTIE64 44 /* 64 bit GOT offset for static TLS \
|
||||
block offset. */
|
||||
#define R_390_TLS_LDM32 45 /* Direct 32 bit for local dynamic \
|
||||
thread local data in LE code. */
|
||||
#define R_390_TLS_LDM64 46 /* Direct 64 bit for local dynamic \
|
||||
thread local data in LE code. */
|
||||
#define R_390_TLS_IE32 47 /* 32 bit address of GOT entry for \
|
||||
negated static TLS block offset. */
|
||||
#define R_390_TLS_IE64 48 /* 64 bit address of GOT entry for \
|
||||
negated static TLS block offset. */
|
||||
#define R_390_TLS_IEENT 49 /* 32 bit rel. offset to GOT entry for \
|
||||
negated static TLS block offset. */
|
||||
#define R_390_TLS_LE32 50 /* 32 bit negated offset relative to \
|
||||
static TLS block. */
|
||||
#define R_390_TLS_LE64 51 /* 64 bit negated offset relative to \
|
||||
static TLS block. */
|
||||
#define R_390_TLS_LDO32 52 /* 32 bit offset relative to TLS \
|
||||
block. */
|
||||
#define R_390_TLS_LDO64 53 /* 64 bit offset relative to TLS \
|
||||
block. */
|
||||
#define R_390_TLS_GDCALL 38 /* Tag for function call in general dynamic TLS code. */
|
||||
#define R_390_TLS_LDCALL 39 /* Tag for function call in local dynamic TLS code. */
|
||||
#define R_390_TLS_GD32 40 /* Direct 32 bit for general dynamic thread local data. */
|
||||
#define R_390_TLS_GD64 41 /* Direct 64 bit for general dynamic thread local data. */
|
||||
#define R_390_TLS_GOTIE12 42 /* 12 bit GOT offset for static TLS block offset. */
|
||||
#define R_390_TLS_GOTIE32 43 /* 32 bit GOT offset for static TLS block offset. */
|
||||
#define R_390_TLS_GOTIE64 44 /* 64 bit GOT offset for static TLS block offset. */
|
||||
#define R_390_TLS_LDM32 45 /* Direct 32 bit for local dynamic thread local data in LE code. */
|
||||
#define R_390_TLS_LDM64 46 /* Direct 64 bit for local dynamic thread local data in LE code. */
|
||||
#define R_390_TLS_IE32 47 /* 32 bit address of GOT entry for negated static TLS block offset. */
|
||||
#define R_390_TLS_IE64 48 /* 64 bit address of GOT entry for negated static TLS block offset. */
|
||||
#define R_390_TLS_IEENT 49 /* 32 bit rel. offset to GOT entry for negated static TLS block offset. */
|
||||
#define R_390_TLS_LE32 50 /* 32 bit negated offset relative to static TLS block. */
|
||||
#define R_390_TLS_LE64 51 /* 64 bit negated offset relative to static TLS block. */
|
||||
#define R_390_TLS_LDO32 52 /* 32 bit offset relative to TLS block. */
|
||||
#define R_390_TLS_LDO64 53 /* 64 bit offset relative to TLS block. */
|
||||
#define R_390_TLS_DTPMOD 54 /* ID of module containing symbol. */
|
||||
#define R_390_TLS_DTPOFF 55 /* Offset in TLS block. */
|
||||
#define R_390_TLS_TPOFF 56 /* Negated offset in static TLS \
|
||||
block. */
|
||||
#define R_390_TLS_TPOFF 56 /* Negated offset in static TLS block. */
|
||||
#define R_390_20 57 /* Direct 20 bit. */
|
||||
#define R_390_GOT20 58 /* 20 bit GOT offset. */
|
||||
#define R_390_GOTPLT20 59 /* 20 bit offset to jump slot. */
|
||||
#define R_390_TLS_GOTIE20 60 /* 20 bit GOT offset for static TLS \
|
||||
block offset. */
|
||||
#define R_390_TLS_GOTIE20 60 /* 20 bit GOT offset for static TLS block offset. */
|
||||
#define R_390_IRELATIVE 61 /* STT_GNU_IFUNC relocation. */
|
||||
/* Keep this the last entry. */
|
||||
#define R_390_NUM 62
|
||||
|
|
@ -3684,19 +3586,14 @@ enum {
|
|||
#define R_MN10300_TLS_GD 24 /* 32-bit offset for global dynamic. */
|
||||
#define R_MN10300_TLS_LD 25 /* 32-bit offset for local dynamic. */
|
||||
#define R_MN10300_TLS_LDO 26 /* Module-relative offset. */
|
||||
#define R_MN10300_TLS_GOTIE 27 /* GOT offset for static TLS block \
|
||||
offset. */
|
||||
#define R_MN10300_TLS_IE 28 /* GOT address for static TLS block \
|
||||
offset. */
|
||||
#define R_MN10300_TLS_LE 29 /* Offset relative to static TLS \
|
||||
block. */
|
||||
#define R_MN10300_TLS_GOTIE 27 /* GOT offset for static TLS block offset. */
|
||||
#define R_MN10300_TLS_IE 28 /* GOT address for static TLS block offset. */
|
||||
#define R_MN10300_TLS_LE 29 /* Offset relative to static TLS block. */
|
||||
#define R_MN10300_TLS_DTPMOD 30 /* ID of module containing symbol. */
|
||||
#define R_MN10300_TLS_DTPOFF 31 /* Offset in module TLS block. */
|
||||
#define R_MN10300_TLS_TPOFF 32 /* Offset in static TLS block. */
|
||||
#define R_MN10300_SYM_DIFF 33 /* Adjustment for next reloc as needed \
|
||||
by linker relaxation. */
|
||||
#define R_MN10300_ALIGN 34 /* Alignment requirement for linker \
|
||||
relaxation. */
|
||||
#define R_MN10300_SYM_DIFF 33 /* Adjustment for next reloc as needed by linker relaxation. */
|
||||
#define R_MN10300_ALIGN 34 /* Alignment requirement for linker relaxation. */
|
||||
#define R_MN10300_NUM 35
|
||||
|
||||
/* M32R relocs. */
|
||||
|
|
@ -3736,21 +3633,14 @@ enum {
|
|||
#define R_M32R_RELATIVE 53 /* Adjust by program base */
|
||||
#define R_M32R_GOTOFF 54 /* 24 bit offset to GOT */
|
||||
#define R_M32R_GOTPC24 55 /* 24 bit PC relative offset to GOT */
|
||||
#define R_M32R_GOT16_HI_ULO 56 /* High 16 bit GOT entry with unsigned \
|
||||
low */
|
||||
#define R_M32R_GOT16_HI_SLO 57 /* High 16 bit GOT entry with signed \
|
||||
low */
|
||||
#define R_M32R_GOT16_HI_ULO 56 /* High 16 bit GOT entry with unsigned low */
|
||||
#define R_M32R_GOT16_HI_SLO 57 /* High 16 bit GOT entry with signed low */
|
||||
#define R_M32R_GOT16_LO 58 /* Low 16 bit GOT entry */
|
||||
#define R_M32R_GOTPC_HI_ULO 59 /* High 16 bit PC relative offset to \
|
||||
GOT with unsigned low */
|
||||
#define R_M32R_GOTPC_HI_SLO 60 /* High 16 bit PC relative offset to \
|
||||
GOT with signed low */
|
||||
#define R_M32R_GOTPC_LO 61 /* Low 16 bit PC relative offset to \
|
||||
GOT */
|
||||
#define R_M32R_GOTOFF_HI_ULO 62 /* High 16 bit offset to GOT \
|
||||
with unsigned low */
|
||||
#define R_M32R_GOTOFF_HI_SLO 63 /* High 16 bit offset to GOT \
|
||||
with signed low */
|
||||
#define R_M32R_GOTPC_HI_ULO 59 /* High 16 bit PC relative offset to GOT with unsigned low */
|
||||
#define R_M32R_GOTPC_HI_SLO 60 /* High 16 bit PC relative offset to GOT with signed low */
|
||||
#define R_M32R_GOTPC_LO 61 /* Low 16 bit PC relative offset to GOT */
|
||||
#define R_M32R_GOTOFF_HI_ULO 62 /* High 16 bit offset to GOT with unsigned low */
|
||||
#define R_M32R_GOTOFF_HI_SLO 63 /* High 16 bit offset to GOT with signed low */
|
||||
#define R_M32R_GOTOFF_LO 64 /* Low 16 bit offset to GOT */
|
||||
#define R_M32R_NUM 256 /* Keep this the last entry. */
|
||||
|
||||
|
|
@ -3811,8 +3701,7 @@ enum {
|
|||
#define R_NIOS2_UJMP 18 /* Unconditional branch. */
|
||||
#define R_NIOS2_CJMP 19 /* Conditional branch. */
|
||||
#define R_NIOS2_CALLR 20 /* Indirect call through register. */
|
||||
#define R_NIOS2_ALIGN 21 /* Alignment requirement for \
|
||||
linker relaxation. */
|
||||
#define R_NIOS2_ALIGN 21 /* Alignment requirement for linker relaxation. */
|
||||
#define R_NIOS2_GOT16 22 /* 16 bit GOT entry. */
|
||||
#define R_NIOS2_CALL16 23 /* 16 bit GOT entry for function. */
|
||||
#define R_NIOS2_GOTOFF_LO 24 /* %lo of offset to GOT pointer. */
|
||||
|
|
|
|||
|
|
@ -70,8 +70,7 @@ RzPVector /*<RzBinAddr *>*/ *PE_(rz_bin_mdmp_pe_get_entrypoint)(struct PE_(rz_bi
|
|||
rz_pvector_push(ret, ptr);
|
||||
}
|
||||
|
||||
PE_(add_tls_callbacks)
|
||||
(pe_bin->bin, ret);
|
||||
PE_(add_tls_callbacks)(pe_bin->bin, ret);
|
||||
|
||||
free(entry);
|
||||
|
||||
|
|
@ -135,8 +134,7 @@ RzPVector /*<RzBinSection *>*/ *PE_(rz_bin_mdmp_pe_get_sections)(struct PE_(rz_b
|
|||
rz_pvector_free(ret);
|
||||
return NULL;
|
||||
}
|
||||
PE_(rz_bin_pe_check_sections)
|
||||
(pe_bin->bin, §ions);
|
||||
PE_(rz_bin_pe_check_sections)(pe_bin->bin, §ions);
|
||||
for (i = 0; !sections[i].last; i++) {
|
||||
if (!(ptr = RZ_NEW0(RzBinSection))) {
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -60,29 +60,19 @@ static int bin_pe_init(RzBinPEObj *bin) {
|
|||
return false;
|
||||
}
|
||||
bin->sections = PE_(rz_bin_pe_get_sections)(bin);
|
||||
PE_(bin_pe_init_imports)
|
||||
(bin);
|
||||
PE_(bin_pe_init_exports)
|
||||
(bin);
|
||||
PE_(bin_pe_init_resource)
|
||||
(bin);
|
||||
PE_(bin_pe_init_security)
|
||||
(bin);
|
||||
PE_(bin_pe_init_relocs)
|
||||
(bin);
|
||||
PE_(bin_pe_init_imports)(bin);
|
||||
PE_(bin_pe_init_exports)(bin);
|
||||
PE_(bin_pe_init_resource)(bin);
|
||||
PE_(bin_pe_init_security)(bin);
|
||||
PE_(bin_pe_init_relocs)(bin);
|
||||
|
||||
bin->big_endian = PE_(rz_bin_pe_is_big_endian)(bin);
|
||||
|
||||
PE_(bin_pe_init_rich_info)
|
||||
(bin);
|
||||
PE_(bin_pe_init_tls)
|
||||
(bin);
|
||||
PE_(bin_pe_init_clr)
|
||||
(bin);
|
||||
PE_(bin_pe_init_overlay)
|
||||
(bin);
|
||||
PE_(bin_pe_parse_resource)
|
||||
(bin);
|
||||
PE_(bin_pe_init_rich_info)(bin);
|
||||
PE_(bin_pe_init_tls)(bin);
|
||||
PE_(bin_pe_init_clr)(bin);
|
||||
PE_(bin_pe_init_overlay)(bin);
|
||||
PE_(bin_pe_parse_resource)(bin);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -96,8 +86,7 @@ void *PE_(rz_bin_pe_free)(RzBinPEObj *bin) {
|
|||
free(bin->export_directory);
|
||||
free(bin->import_directory);
|
||||
free(bin->resource_directory);
|
||||
PE_(free_security_directory)
|
||||
(bin->security_directory);
|
||||
PE_(free_security_directory)(bin->security_directory);
|
||||
free(bin->delay_import_directory);
|
||||
bin_pe_dotnet_destroy_clr(bin->clr);
|
||||
free(bin->tls_directory);
|
||||
|
|
|
|||
|
|
@ -45,8 +45,7 @@ RzBinPEObj *rz_bin_pemixed_init_dos(RzBinPEObj *pe_bin) {
|
|||
|
||||
RzBinPEObj *sub_bin_dos = RZ_NEW0(RzBinPEObj);
|
||||
if (!(sub_bin_dos->b = rz_buf_new_with_bytes(tmp_buf, pe_hdr_off))) {
|
||||
PE_(rz_bin_pe_free)
|
||||
(sub_bin_dos);
|
||||
PE_(rz_bin_pe_free)(sub_bin_dos);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
@ -141,8 +140,7 @@ void *rz_bin_pemixed_free(struct rz_bin_pemixed_obj_t *bin) {
|
|||
// only one free is nessescary since they all point
|
||||
// to the same original pe struct
|
||||
// possible memleak here
|
||||
PE_(rz_bin_pe_free)
|
||||
(bin->sub_bin_net);
|
||||
PE_(rz_bin_pe_free)(bin->sub_bin_net);
|
||||
if (bin->sub_bin_dos) {
|
||||
rz_buf_free(bin->sub_bin_dos->b); // dos is the only one with its own buf
|
||||
}
|
||||
|
|
@ -169,26 +167,22 @@ struct rz_bin_pemixed_obj_t *rz_bin_pemixed_from_bytes_new(const ut8 *buf, ut64
|
|||
bin->size = size;
|
||||
pe_bin = PE_(rz_bin_pe_new_buf)(bin->b, true);
|
||||
if (!pe_bin) {
|
||||
PE_(rz_bin_pe_free)
|
||||
(pe_bin);
|
||||
PE_(rz_bin_pe_free)(pe_bin);
|
||||
return rz_bin_pemixed_free(bin);
|
||||
}
|
||||
if (!pe_bin->clr || !pe_bin->clr->header) {
|
||||
PE_(rz_bin_pe_free)
|
||||
(pe_bin);
|
||||
PE_(rz_bin_pe_free)(pe_bin);
|
||||
return rz_bin_pemixed_free(bin);
|
||||
}
|
||||
// check if binary only contains managed code
|
||||
// check implemented here cuz we need to intialize
|
||||
// the pe header to access the clr hdr
|
||||
if (check_il_only(pe_bin->clr->header->Flags)) {
|
||||
PE_(rz_bin_pe_free)
|
||||
(pe_bin);
|
||||
PE_(rz_bin_pe_free)(pe_bin);
|
||||
return rz_bin_pemixed_free(bin);
|
||||
}
|
||||
if (!rz_bin_pemixed_init(bin, pe_bin)) {
|
||||
PE_(rz_bin_pe_free)
|
||||
(pe_bin);
|
||||
PE_(rz_bin_pe_free)(pe_bin);
|
||||
return rz_bin_pemixed_free(bin);
|
||||
}
|
||||
return bin;
|
||||
|
|
|
|||
|
|
@ -32,8 +32,7 @@ static bool pe_load_buffer(RzBinFile *bf, RzBinObject *obj, RzBuffer *buf, Sdb *
|
|||
}
|
||||
|
||||
static void pe_destroy(RzBinFile *bf) {
|
||||
PE_(rz_bin_pe_free)
|
||||
((struct PE_(rz_bin_pe_obj_t) *)bf->o->bin_obj);
|
||||
PE_(rz_bin_pe_free)((struct PE_(rz_bin_pe_obj_t) *)bf->o->bin_obj);
|
||||
}
|
||||
|
||||
static ut64 pe_baddr(RzBinFile *bf) {
|
||||
|
|
@ -166,8 +165,7 @@ static RzPVector /*<RzBinMap *>*/ *pe_maps(RzBinFile *bf) {
|
|||
map->vsize = RZ_ROUND(map->psize, 4096);
|
||||
map->perm = RZ_PERM_R;
|
||||
rz_pvector_push(ret, map);
|
||||
PE_(rz_bin_pe_check_sections)
|
||||
(bin, §ions);
|
||||
PE_(rz_bin_pe_check_sections)(bin, §ions);
|
||||
for (size_t i = 0; !sections[i].last; i++) {
|
||||
RzBinMap *map = RZ_NEW0(RzBinMap);
|
||||
if (!map) {
|
||||
|
|
@ -210,8 +208,7 @@ static RzPVector /*<RzBinSection *>*/ *pe_sections(RzBinFile *bf) {
|
|||
rz_pvector_free(ret);
|
||||
return NULL;
|
||||
}
|
||||
PE_(rz_bin_pe_check_sections)
|
||||
(bin, §ions);
|
||||
PE_(rz_bin_pe_check_sections)(bin, §ions);
|
||||
for (i = 0; !sections[i].last; i++) {
|
||||
if (!(ptr = RZ_NEW0(RzBinSection))) {
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -134,8 +134,7 @@ static void print_offset_in_binary_line_bar(RzAnnotatedCode *code, ut64 offset,
|
|||
width--;
|
||||
}
|
||||
} else {
|
||||
PRINT_COLOR(PALETTE(offset)
|
||||
: Color_GREEN);
|
||||
PRINT_COLOR(PALETTE(offset) : Color_GREEN);
|
||||
rz_cons_printf(fmt[width], offset);
|
||||
PRINT_COLOR(Color_RESET);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -280,8 +280,7 @@ static RZ_BORROW RzList /*<RzList *>*/ *GH(fill_tcache_entries)(RzCore *core, GH
|
|||
bin->bin_num = i;
|
||||
bin->chunks = rz_list_newf((RzListFree)GH(rz_heap_chunk_free));
|
||||
if (!bin->chunks) {
|
||||
GH(rz_heap_bin_free)
|
||||
(bin);
|
||||
GH(rz_heap_bin_free)(bin);
|
||||
goto error;
|
||||
}
|
||||
rz_list_append(tcache_bins_list, bin);
|
||||
|
|
@ -292,8 +291,7 @@ static RZ_BORROW RzList /*<RzList *>*/ *GH(fill_tcache_entries)(RzCore *core, GH
|
|||
// get first chunk
|
||||
RzHeapChunkListItem *chunk = RZ_NEW0(RzHeapChunkListItem);
|
||||
if (!chunk) {
|
||||
GH(rz_heap_bin_free)
|
||||
(bin);
|
||||
GH(rz_heap_bin_free)(bin);
|
||||
goto error;
|
||||
}
|
||||
chunk->addr = (ut64)(entry - GH(HDR_SZ));
|
||||
|
|
@ -367,8 +365,7 @@ static void GH(print_tcache)(RzCore *core, RzList /*<RzList *>*/ *bins, PJ *pj,
|
|||
if (!pj) {
|
||||
rz_cons_printf(" -> ");
|
||||
}
|
||||
GH(print_heap_chunk_simple)
|
||||
(core, pos->addr, NULL, pj);
|
||||
GH(print_heap_chunk_simple)(core, pos->addr, NULL, pj);
|
||||
if (!pj) {
|
||||
rz_cons_newline();
|
||||
}
|
||||
|
|
@ -527,8 +524,7 @@ RZ_API bool GH(rz_heap_update_main_arena)(RzCore *core, GHT m_arena, MallocState
|
|||
if (!cmain_arena->next) {
|
||||
return false;
|
||||
}
|
||||
GH(update_arena_with_tc)
|
||||
(cmain_arena, main_arena);
|
||||
GH(update_arena_with_tc)(cmain_arena, main_arena);
|
||||
free(cmain_arena);
|
||||
} else {
|
||||
GH(RzHeap_MallocState) *cmain_arena = RZ_NEW0(GH(RzHeap_MallocState));
|
||||
|
|
@ -536,8 +532,7 @@ RZ_API bool GH(rz_heap_update_main_arena)(RzCore *core, GHT m_arena, MallocState
|
|||
return false;
|
||||
}
|
||||
(void)rz_io_read_at(core->io, m_arena, (ut8 *)cmain_arena, sizeof(GH(RzHeap_MallocState)));
|
||||
GH(update_arena_without_tc)
|
||||
(cmain_arena, main_arena);
|
||||
GH(update_arena_without_tc)(cmain_arena, main_arena);
|
||||
free(cmain_arena);
|
||||
}
|
||||
return true;
|
||||
|
|
@ -783,8 +778,7 @@ RZ_API bool GH(rz_heap_resolve_main_arena)(RzCore *core, GHT *m_arena) {
|
|||
return false;
|
||||
}
|
||||
|
||||
GH(get_brks)
|
||||
(core, &brk_start, &brk_end);
|
||||
GH(get_brks)(core, &brk_start, &brk_end);
|
||||
if (brk_start == GHT_MAX || brk_end == GHT_MAX) {
|
||||
RZ_LOG_ERROR("core: no heap section\n");
|
||||
return false;
|
||||
|
|
@ -798,16 +792,14 @@ RZ_API bool GH(rz_heap_resolve_main_arena)(RzCore *core, GHT *m_arena) {
|
|||
}
|
||||
|
||||
if (main_arena_sym != GHT_MAX) {
|
||||
GH(rz_heap_update_main_arena)
|
||||
(core, main_arena_sym, ta);
|
||||
GH(rz_heap_update_main_arena)(core, main_arena_sym, ta);
|
||||
*m_arena = main_arena_sym;
|
||||
core->dbg->main_arena_resolved = true;
|
||||
free(ta);
|
||||
return true;
|
||||
}
|
||||
while (addr_srch < libc_addr_end) {
|
||||
GH(rz_heap_update_main_arena)
|
||||
(core, addr_srch, ta);
|
||||
GH(rz_heap_update_main_arena)(core, addr_srch, ta);
|
||||
if (ta->top > brk_start && ta->top < brk_end &&
|
||||
ta->system_mem == heap_sz) {
|
||||
|
||||
|
|
@ -866,18 +858,15 @@ static bool GH(parse_tcache_from_addr)(RzCore *core, const GHT tls_addr, const G
|
|||
#endif
|
||||
tcache_heap = GH(tcache_new)(core);
|
||||
if (!GH(tcache_read)(core, tcache_guess, tcache_heap)) {
|
||||
GH(tcache_free)
|
||||
(tcache_heap);
|
||||
GH(tcache_free)(tcache_heap);
|
||||
tcache_heap = NULL;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (tcache_heap != NULL) {
|
||||
RzList *bins = GH(fill_tcache_entries)(core, tcache_heap);
|
||||
GH(print_tcache)
|
||||
(core, bins, NULL, tid);
|
||||
GH(tcache_free)
|
||||
(tcache_heap);
|
||||
GH(print_tcache)(core, bins, NULL, tid);
|
||||
GH(tcache_free)(tcache_heap);
|
||||
tcache_heap = NULL;
|
||||
return true;
|
||||
}
|
||||
|
|
@ -954,8 +943,7 @@ static void GH(resolve_tcache_perthread)(RZ_NONNULL RzCore *core) {
|
|||
RzList *thread_list = rz_debug_native_threads(dbg, dbg->pid);
|
||||
RzDebugPid *thread_dbg = rz_debug_get_thread(thread_list, th->pid);
|
||||
if (thread_dbg) {
|
||||
GH(parse_tls_data)
|
||||
(core, thread_dbg, tid);
|
||||
GH(parse_tls_data)(core, thread_dbg, tid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -965,15 +953,13 @@ RZ_API RZ_OWN bool GH(resolve_heap_tcache)(RZ_NONNULL RzCore *core, GHT arena_ba
|
|||
RzDebug *dbg = core->dbg;
|
||||
|
||||
if (dbg->threads) {
|
||||
GH(resolve_tcache_perthread)
|
||||
(core);
|
||||
GH(resolve_tcache_perthread)(core);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Only main thread is present
|
||||
RzList *bins = GH(rz_heap_tcache_content)(core, arena_base);
|
||||
GH(print_tcache)
|
||||
(core, bins, NULL, 0);
|
||||
GH(print_tcache)(core, bins, NULL, 0);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -1263,8 +1249,7 @@ static int GH(print_double_linked_list_bin)(RzCore *core, MallocState *main_aren
|
|||
return -1;
|
||||
}
|
||||
|
||||
GH(get_brks)
|
||||
(core, &brk_start, &brk_end);
|
||||
GH(get_brks)(core, &brk_start, &brk_end);
|
||||
if (brk_start == GHT_MAX || brk_end == GHT_MAX) {
|
||||
RZ_LOG_ERROR("core: no heap section\n");
|
||||
return -1;
|
||||
|
|
@ -1313,8 +1298,7 @@ static void GH(print_heap_bin)(RzCore *core, GHT m_arena, MallocState *main_aren
|
|||
PRINT_YA("Bins {\n");
|
||||
for (size_t i = 0; i < NBINS - 1; i++) {
|
||||
PRINTF_YA(" Bin %03" PFMTSZu ":\n", i);
|
||||
GH(print_double_linked_list_bin)
|
||||
(core, main_arena, m_arena, offset, i, print_graph);
|
||||
GH(print_double_linked_list_bin)(core, main_arena, m_arena, offset, i, print_graph);
|
||||
}
|
||||
PRINT_YA("\n}\n");
|
||||
} else {
|
||||
|
|
@ -1324,8 +1308,7 @@ static void GH(print_heap_bin)(RzCore *core, GHT m_arena, MallocState *main_aren
|
|||
return;
|
||||
}
|
||||
PRINTF_YA(" Bin %03" PFMT64u ":\n", (ut64)num_bin);
|
||||
GH(print_double_linked_list_bin)
|
||||
(core, main_arena, m_arena, offset, num_bin, print_graph);
|
||||
GH(print_double_linked_list_bin)(core, main_arena, m_arena, offset, num_bin, print_graph);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
@ -1359,8 +1342,7 @@ RZ_API RzHeapBin *GH(rz_heap_fastbin_content)(RzCore *core, MallocState *main_ar
|
|||
free(cnk);
|
||||
return heap_bin;
|
||||
}
|
||||
GH(get_brks)
|
||||
(core, &brk_start, &brk_end);
|
||||
GH(get_brks)(core, &brk_start, &brk_end);
|
||||
heap_bin->fd = next;
|
||||
if (brk_start == GHT_MAX || brk_end == GHT_MAX) {
|
||||
free(cnk);
|
||||
|
|
@ -1468,8 +1450,7 @@ void GH(print_heap_fastbin)(RzCore *core, GHT m_arena, MallocState *main_arena,
|
|||
if (!pj) {
|
||||
rz_cons_printf(" -> ");
|
||||
}
|
||||
GH(print_heap_chunk_simple)
|
||||
(core, pos->addr, NULL, pj);
|
||||
GH(print_heap_chunk_simple)(core, pos->addr, NULL, pj);
|
||||
if (!pj) {
|
||||
rz_cons_newline();
|
||||
}
|
||||
|
|
@ -1482,8 +1463,7 @@ void GH(print_heap_fastbin)(RzCore *core, GHT m_arena, MallocState *main_arena,
|
|||
pj_end(pj);
|
||||
pj_end(pj);
|
||||
}
|
||||
GH(rz_heap_bin_free)
|
||||
(bin);
|
||||
GH(rz_heap_bin_free)(bin);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1553,8 +1533,7 @@ RZ_API RzList /*<RzHeapBin *>*/ *GH(rz_heap_tcache_content)(RzCore *core, GHT ar
|
|||
}
|
||||
|
||||
GHT brk_start = GHT_MAX, brk_end = GHT_MAX, initial_brk = GHT_MAX;
|
||||
GH(get_brks)
|
||||
(core, &brk_start, &brk_end);
|
||||
GH(get_brks)(core, &brk_start, &brk_end);
|
||||
GHT fc_offset = GH(tcache_chunk_size)(core, brk_start);
|
||||
initial_brk = brk_start + fc_offset;
|
||||
if (brk_start == GHT_MAX || brk_end == GHT_MAX || initial_brk == GHT_MAX) {
|
||||
|
|
@ -1587,8 +1566,7 @@ RZ_API RzList /*<RzHeapBin *>*/ *GH(rz_heap_tcache_content)(RzCore *core, GHT ar
|
|||
// Get rz_tcache struct
|
||||
GH(RTcache) *tcache = GH(tcache_new)(core);
|
||||
if (!GH(tcache_read)(core, tcache_start, tcache)) {
|
||||
GH(tcache_free)
|
||||
(tcache);
|
||||
GH(tcache_free)(tcache);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
@ -1608,8 +1586,7 @@ RZ_API RzList /*<RzHeapBin *>*/ *GH(rz_heap_tcache_content)(RzCore *core, GHT ar
|
|||
bin->bin_num = i;
|
||||
bin->chunks = rz_list_newf((RzListFree)GH(rz_heap_chunk_free));
|
||||
if (!bin->chunks) {
|
||||
GH(rz_heap_bin_free)
|
||||
(bin);
|
||||
GH(rz_heap_bin_free)(bin);
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
|
@ -1673,8 +1650,7 @@ static void GH(print_tcache_content)(RzCore *core, GHT arena_base, GHT main_aren
|
|||
}
|
||||
PRINTF_YA("0x%" PFMT64x "\n", (ut64)arena_base);
|
||||
}
|
||||
GH(print_tcache)
|
||||
(core, bins, pj, 0);
|
||||
GH(print_tcache)(core, bins, pj, 0);
|
||||
}
|
||||
|
||||
void GH(print_malloc_states)(RzCore *core, GHT m_arena, MallocState *main_arena, bool json) {
|
||||
|
|
@ -1792,8 +1768,7 @@ void GH(print_malloc_info)(RzCore *core, GHT m_state, GHT malloc_state) {
|
|||
return;
|
||||
}
|
||||
rz_io_read_at(core->io, h_info, (ut8 *)heap_info, sizeof(GH(RzHeapInfo)));
|
||||
GH(print_inst_minfo)
|
||||
(core, heap_info, h_info);
|
||||
GH(print_inst_minfo)(core, heap_info, h_info);
|
||||
MallocState *ms = RZ_NEW0(MallocState);
|
||||
if (!ms) {
|
||||
free(heap_info);
|
||||
|
|
@ -1809,8 +1784,7 @@ void GH(print_malloc_info)(RzCore *core, GHT m_state, GHT malloc_state) {
|
|||
if ((ms->top >> 16) << 16 != h_info) {
|
||||
h_info = (ms->top >> 16) << 16;
|
||||
rz_io_read_at(core->io, h_info, (ut8 *)heap_info, sizeof(GH(RzHeapInfo)));
|
||||
GH(print_inst_minfo)
|
||||
(core, heap_info, h_info);
|
||||
GH(print_inst_minfo)(core, heap_info, h_info);
|
||||
}
|
||||
}
|
||||
free(heap_info);
|
||||
|
|
@ -1868,8 +1842,7 @@ RZ_API RzHeapBin *GH(rz_heap_bin_content)(RzCore *core, MallocState *main_arena,
|
|||
bin->chunks = rz_list_newf(free);
|
||||
GH(RzHeapChunk) *head = RZ_NEW0(GH(RzHeapChunk));
|
||||
if (!head) {
|
||||
GH(rz_heap_bin_free)
|
||||
(bin);
|
||||
GH(rz_heap_bin_free)(bin);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
@ -1880,13 +1853,11 @@ RZ_API RzHeapBin *GH(rz_heap_bin_content)(RzCore *core, MallocState *main_arena,
|
|||
}
|
||||
GH(RzHeapChunk) *cnk = RZ_NEW0(GH(RzHeapChunk));
|
||||
if (!cnk) {
|
||||
GH(rz_heap_bin_free)
|
||||
(bin);
|
||||
GH(rz_heap_bin_free)(bin);
|
||||
return NULL;
|
||||
}
|
||||
GHT brk_start = GHT_MAX, brk_end = GHT_MAX, initial_brk = GHT_MAX;
|
||||
GH(get_brks)
|
||||
(core, &brk_start, &brk_end);
|
||||
GH(get_brks)(core, &brk_start, &brk_end);
|
||||
if (brk_start == GHT_MAX || brk_end == GHT_MAX) {
|
||||
free(cnk);
|
||||
return bin;
|
||||
|
|
@ -1936,8 +1907,7 @@ static int GH(print_bin_content)(RzCore *core, MallocState *main_arena, int bin_
|
|||
RzHeapBin *bin = GH(rz_heap_bin_content)(core, main_arena, bin_num, m_arena);
|
||||
RzList *chunks = bin->chunks;
|
||||
if (rz_list_length(chunks) == 0) {
|
||||
GH(rz_heap_bin_free)
|
||||
(bin);
|
||||
GH(rz_heap_bin_free)(bin);
|
||||
return 0;
|
||||
}
|
||||
int chunks_cnt = 0;
|
||||
|
|
@ -1967,8 +1937,7 @@ static int GH(print_bin_content)(RzCore *core, MallocState *main_arena, int bin_
|
|||
if (!pj) {
|
||||
rz_cons_printf(" -> ");
|
||||
}
|
||||
GH(print_heap_chunk_simple)
|
||||
(core, pos->addr, NULL, pj);
|
||||
GH(print_heap_chunk_simple)(core, pos->addr, NULL, pj);
|
||||
if (!pj) {
|
||||
rz_cons_newline();
|
||||
}
|
||||
|
|
@ -1977,8 +1946,7 @@ static int GH(print_bin_content)(RzCore *core, MallocState *main_arena, int bin_
|
|||
if (bin->message) {
|
||||
PRINTF_RA("%s\n", bin->message);
|
||||
}
|
||||
GH(rz_heap_bin_free)
|
||||
(bin);
|
||||
GH(rz_heap_bin_free)(bin);
|
||||
if (pj) {
|
||||
pj_end(pj);
|
||||
}
|
||||
|
|
@ -2098,31 +2066,26 @@ static void GH(print_main_arena_bins)(RzCore *core, GHT m_arena, MallocState *ma
|
|||
pj_ka(pj, "bins");
|
||||
}
|
||||
if (format == RZ_HEAP_BIN_ANY || format == RZ_HEAP_BIN_TCACHE) {
|
||||
GH(print_tcache_content)
|
||||
(core, m_arena, main_arena_base, pj);
|
||||
GH(print_tcache_content)(core, m_arena, main_arena_base, pj);
|
||||
rz_cons_newline();
|
||||
}
|
||||
if (format == RZ_HEAP_BIN_ANY || format == RZ_HEAP_BIN_FAST) {
|
||||
char *input = rz_str_newlen("", 1);
|
||||
bool main_arena_only = true;
|
||||
GH(print_heap_fastbin)
|
||||
(core, m_arena, main_arena, global_max_fast, input, main_arena_only, pj);
|
||||
GH(print_heap_fastbin)(core, m_arena, main_arena, global_max_fast, input, main_arena_only, pj);
|
||||
free(input);
|
||||
rz_cons_newline();
|
||||
}
|
||||
if (format == RZ_HEAP_BIN_ANY || format == RZ_HEAP_BIN_UNSORTED) {
|
||||
GH(print_unsortedbin_description)
|
||||
(core, m_arena, main_arena, pj);
|
||||
GH(print_unsortedbin_description)(core, m_arena, main_arena, pj);
|
||||
rz_cons_newline();
|
||||
}
|
||||
if (format == RZ_HEAP_BIN_ANY || format == RZ_HEAP_BIN_SMALL) {
|
||||
GH(print_smallbin_description)
|
||||
(core, m_arena, main_arena, pj);
|
||||
GH(print_smallbin_description)(core, m_arena, main_arena, pj);
|
||||
rz_cons_newline();
|
||||
}
|
||||
if (format == RZ_HEAP_BIN_ANY || format == RZ_HEAP_BIN_LARGE) {
|
||||
GH(print_largebin_description)
|
||||
(core, m_arena, main_arena, pj);
|
||||
GH(print_largebin_description)(core, m_arena, main_arena, pj);
|
||||
rz_cons_newline();
|
||||
}
|
||||
if (json) {
|
||||
|
|
@ -2215,8 +2178,7 @@ RZ_API RzList /*<RzHeapChunkListItem *>*/ *GH(rz_heap_chunks_list)(RzCore *core,
|
|||
int glibc_version = core->dbg->glibc_version;
|
||||
|
||||
if (m_arena == m_state) {
|
||||
GH(get_brks)
|
||||
(core, &brk_start, &brk_end);
|
||||
GH(get_brks)(core, &brk_start, &brk_end);
|
||||
if (tcache) {
|
||||
initial_brk = ((brk_start >> 12) << 12) + GH(HDR_SZ);
|
||||
if (rz_config_get_b(core->config, "cfg.debug")) {
|
||||
|
|
@ -2324,8 +2286,7 @@ RZ_API RzList /*<RzHeapChunkListItem *>*/ *GH(rz_heap_chunks_list)(RzCore *core,
|
|||
free(cnk_next);
|
||||
return chunks;
|
||||
}
|
||||
GH(tcache_read)
|
||||
(core, tcache_initial_brk, tcache_heap);
|
||||
GH(tcache_read)(core, tcache_initial_brk, tcache_heap);
|
||||
size_t i;
|
||||
for (i = 0; i < TCACHE_MAX_BINS; i++) {
|
||||
int count = GH(tcache_get_count)(tcache_heap, i);
|
||||
|
|
@ -2355,8 +2316,7 @@ RZ_API RzList /*<RzHeapChunkListItem *>*/ *GH(rz_heap_chunks_list)(RzCore *core,
|
|||
}
|
||||
}
|
||||
}
|
||||
GH(tcache_free)
|
||||
(tcache_heap);
|
||||
GH(tcache_free)(tcache_heap);
|
||||
}
|
||||
|
||||
next_chunk += size_tmp;
|
||||
|
|
@ -2477,8 +2437,7 @@ RZ_IPI RzCmdStatus GH(rz_cmd_heap_chunks_print_handler)(RzCore *core, int argc,
|
|||
}
|
||||
GHT brk_start, brk_end;
|
||||
if (m_arena == m_state) {
|
||||
GH(get_brks)
|
||||
(core, &brk_start, &brk_end);
|
||||
GH(get_brks)(core, &brk_start, &brk_end);
|
||||
|
||||
} else {
|
||||
brk_start = ((m_state >> 16) << 16);
|
||||
|
|
@ -2534,8 +2493,7 @@ RZ_IPI RzCmdStatus GH(rz_cmd_heap_chunks_print_handler)(RzCore *core, int argc,
|
|||
}
|
||||
rz_list_foreach (chunks, iter, pos) {
|
||||
if (mode == RZ_OUTPUT_MODE_STANDARD || mode == RZ_OUTPUT_MODE_LONG) {
|
||||
GH(print_heap_chunk_simple)
|
||||
(core, pos->addr, pos->status, NULL);
|
||||
GH(print_heap_chunk_simple)(core, pos->addr, pos->status, NULL);
|
||||
rz_cons_newline();
|
||||
if (mode == RZ_OUTPUT_MODE_LONG) {
|
||||
int size = 0x10;
|
||||
|
|
@ -2577,8 +2535,7 @@ RZ_IPI RzCmdStatus GH(rz_cmd_heap_chunks_print_handler)(RzCore *core, int argc,
|
|||
}
|
||||
}
|
||||
if (mode == RZ_OUTPUT_MODE_STANDARD || mode == RZ_OUTPUT_MODE_LONG) {
|
||||
GH(print_heap_chunk_simple)
|
||||
(core, main_arena->top, "free", NULL);
|
||||
GH(print_heap_chunk_simple)(core, main_arena->top, "free", NULL);
|
||||
PRINT_RA("[top]");
|
||||
rz_cons_printf("[brk_start: ");
|
||||
PRINTF_YA("0x%" PFMT64x, (ut64)brk_start);
|
||||
|
|
@ -2644,8 +2601,7 @@ RZ_IPI RzCmdStatus GH(rz_cmd_main_arena_print_handler)(RzCore *core, int argc, c
|
|||
free(main_arena);
|
||||
return RZ_CMD_STATUS_ERROR;
|
||||
}
|
||||
GH(print_arena_stats)
|
||||
(core, m_state, main_arena, global_max_fast, mode);
|
||||
GH(print_arena_stats)(core, m_state, main_arena, global_max_fast, mode);
|
||||
free(main_arena);
|
||||
return RZ_CMD_STATUS_OK;
|
||||
}
|
||||
|
|
@ -2661,8 +2617,7 @@ RZ_IPI RzCmdStatus GH(rz_cmd_heap_chunk_print_handler)(RzCore *core, int argc, c
|
|||
return RZ_CMD_STATUS_ERROR;
|
||||
}
|
||||
ut64 addr = core->offset;
|
||||
GH(print_heap_chunk)
|
||||
(core, addr);
|
||||
GH(print_heap_chunk)(core, addr);
|
||||
free(main_arena);
|
||||
return RZ_CMD_STATUS_OK;
|
||||
}
|
||||
|
|
@ -2692,8 +2647,7 @@ RZ_IPI RzCmdStatus GH(rz_cmd_heap_info_print_handler)(RzCore *core, int argc, co
|
|||
free(main_arena);
|
||||
return RZ_CMD_STATUS_ERROR;
|
||||
}
|
||||
GH(print_malloc_info)
|
||||
(core, m_arena, m_state);
|
||||
GH(print_malloc_info)(core, m_arena, m_state);
|
||||
free(main_arena);
|
||||
return RZ_CMD_STATUS_OK;
|
||||
}
|
||||
|
|
@ -2747,8 +2701,7 @@ RZ_IPI RzCmdStatus GH(rz_cmd_heap_bins_list_print_handler)(RzCore *core, const c
|
|||
free(dup);
|
||||
return RZ_CMD_STATUS_ERROR;
|
||||
}
|
||||
GH(print_heap_bin)
|
||||
(core, m_state, main_arena, dup, mode == RZ_OUTPUT_MODE_GRAPH);
|
||||
GH(print_heap_bin)(core, m_state, main_arena, dup, mode == RZ_OUTPUT_MODE_GRAPH);
|
||||
} else {
|
||||
PRINT_RA("This address is not part of the arenas\n");
|
||||
free(main_arena);
|
||||
|
|
@ -2792,8 +2745,7 @@ RZ_IPI RzCmdStatus GH(rz_cmd_heap_fastbins_print_handler)(void *data, const char
|
|||
free(main_arena);
|
||||
return RZ_CMD_STATUS_ERROR;
|
||||
}
|
||||
GH(print_heap_fastbin)
|
||||
(core, m_state, main_arena, global_max_fast, dup, main_arena_only, NULL);
|
||||
GH(print_heap_fastbin)(core, m_state, main_arena, global_max_fast, dup, main_arena_only, NULL);
|
||||
} else {
|
||||
PRINT_RA("This address is not part of the arenas\n");
|
||||
free(dup);
|
||||
|
|
@ -2851,8 +2803,7 @@ RZ_IPI RzCmdStatus GH(rz_cmd_heap_arena_bins_print_handler)(RzCore *core, int ar
|
|||
bin_format = RZ_HEAP_BIN_LARGE;
|
||||
}
|
||||
}
|
||||
GH(print_main_arena_bins)
|
||||
(core, m_state, main_arena, m_arena, global_max_fast, bin_format, json);
|
||||
GH(print_main_arena_bins)(core, m_state, main_arena, m_arena, global_max_fast, bin_format, json);
|
||||
free(main_arena);
|
||||
return RZ_CMD_STATUS_OK;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -497,16 +497,13 @@ static void GH(jemalloc_get_runs)(RzCore *core, const char *input) {
|
|||
static void GH(cmd_dbg_map_jemalloc)(RzCore *core, char dmx_variant, const char *arg) {
|
||||
switch (dmx_variant) {
|
||||
case 'a': // dmxa
|
||||
GH(jemalloc_print_narenas)
|
||||
(core, arg);
|
||||
GH(jemalloc_print_narenas)(core, arg);
|
||||
break;
|
||||
case 'b': // dmxb
|
||||
GH(jemalloc_get_bins)
|
||||
(core, arg);
|
||||
GH(jemalloc_get_bins)(core, arg);
|
||||
break;
|
||||
case 'c': // dmxc
|
||||
GH(jemalloc_get_chunks)
|
||||
(core, arg);
|
||||
GH(jemalloc_get_chunks)(core, arg);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -114,10 +114,8 @@ typedef struct {
|
|||
} LIB_ITEM, *PLIB_ITEM;
|
||||
|
||||
// Vista
|
||||
BOOL(WINAPI *w32_ProcessIdToSessionId)
|
||||
(DWORD, DWORD *);
|
||||
BOOL(WINAPI *w32_QueryFullProcessImageNameW)
|
||||
(HANDLE, DWORD, LPWSTR, PDWORD);
|
||||
BOOL(WINAPI *w32_ProcessIdToSessionId)(DWORD, DWORD *);
|
||||
BOOL(WINAPI *w32_QueryFullProcessImageNameW)(HANDLE, DWORD, LPWSTR, PDWORD);
|
||||
// Internal NT functions (winternl.h)
|
||||
NTSTATUS(WINAPI *w32_NtQuerySystemInformation)
|
||||
(ULONG, PVOID, ULONG, PULONG);
|
||||
|
|
@ -129,14 +127,11 @@ NTSTATUS(WINAPI *w32_NtQueryObject)
|
|||
(HANDLE, ULONG, PVOID, ULONG, PULONG);
|
||||
// fpu access API (Windows 7)
|
||||
ut64(WINAPI *w32_GetEnabledXStateFeatures)();
|
||||
BOOL(WINAPI *w32_InitializeContext)
|
||||
(PVOID, DWORD, PCONTEXT *, PDWORD);
|
||||
BOOL(WINAPI *w32_GetXStateFeaturesMask)
|
||||
(PCONTEXT Context, PDWORD64);
|
||||
BOOL(WINAPI *w32_InitializeContext)(PVOID, DWORD, PCONTEXT *, PDWORD);
|
||||
BOOL(WINAPI *w32_GetXStateFeaturesMask)(PCONTEXT Context, PDWORD64);
|
||||
PVOID(WINAPI *w32_LocateXStateFeature)
|
||||
(PCONTEXT Context, DWORD, PDWORD);
|
||||
BOOL(WINAPI *w32_SetXStateFeaturesMask)
|
||||
(PCONTEXT Context, DWORD64);
|
||||
BOOL(WINAPI *w32_SetXStateFeaturesMask)(PCONTEXT Context, DWORD64);
|
||||
|
||||
// APIs
|
||||
int w32_init(RzDebug *dbg);
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -71,8 +71,7 @@ struct rz_magic {
|
|||
#define INDIROFFADD 0x04 /* if '>&(' appears */
|
||||
#define UNSIGNED 0x08 /* comparison is unsigned */
|
||||
#define NOSPACE 0x10 /* suppress space character before output */
|
||||
#define BINTEST 0x20 /* test is for a binary type (set only \
|
||||
for top-level tests) */
|
||||
#define BINTEST 0x20 /* test is for a binary type (set only for top-level tests) */
|
||||
#define TEXTTEST 0 /* for passing to file_softmagic */
|
||||
|
||||
ut8 dummy1;
|
||||
|
|
|
|||
|
|
@ -113,8 +113,7 @@ typedef struct Ht_(kv) {
|
|||
VALUE_TYPE value;
|
||||
ut32 key_len;
|
||||
ut32 value_len;
|
||||
}
|
||||
HT_(Kv);
|
||||
} HT_(Kv);
|
||||
|
||||
typedef void (*HT_(FiniKv))(HT_(Kv) *kv, void *user);
|
||||
typedef KEY_TYPE (*HT_(DupKey))(const KEY_TYPE);
|
||||
|
|
@ -129,8 +128,7 @@ typedef bool (*HT_(ForeachCallback))(void *user, const KEY_TYPE, const VALUE_TYP
|
|||
typedef struct Ht_(bucket_t) {
|
||||
HT_(Kv) *arr;
|
||||
ut32 count;
|
||||
}
|
||||
HT_(Bucket);
|
||||
} HT_(Bucket);
|
||||
|
||||
/**
|
||||
* Options contain all the settings of the hashtable.
|
||||
|
|
@ -155,8 +153,7 @@ typedef struct Ht_(options_t) {
|
|||
void *finiKV_user; ///< RZ_NULLABLE. User data which is passed into finiKV.
|
||||
size_t elem_size; ///< Size of each HtKv element (useful for subclassing like SdbKv).
|
||||
///< Zero value means to use default size of HtKv.
|
||||
}
|
||||
HT_(Options);
|
||||
} HT_(Options);
|
||||
|
||||
/* Ht is the hashtable structure */
|
||||
typedef struct Ht_(t) {
|
||||
|
|
@ -165,24 +162,21 @@ typedef struct Ht_(t) {
|
|||
HT_(Bucket) *table; ///< Actual table.
|
||||
ut32 prime_idx;
|
||||
HT_(Options) opt;
|
||||
}
|
||||
HtName_(Ht);
|
||||
} HtName_(Ht);
|
||||
|
||||
typedef struct Ht_(iter_mut_t) {
|
||||
HtName_(Ht) *ht; ///< The hash table to iterate over.
|
||||
ut32 ti; ///< Table index
|
||||
ut32 bi; ///< Bucket index
|
||||
HT_(Kv) *kv; ///< Current Key-Value-pair.
|
||||
}
|
||||
HT_(IterMutState);
|
||||
} HT_(IterMutState);
|
||||
|
||||
typedef struct Ht_(iter_t) {
|
||||
const HtName_(Ht) *ht; ///< The hash table to iterate over.
|
||||
ut32 ti; ///< Table index
|
||||
ut32 bi; ///< Bucket index
|
||||
const HT_(Kv) *kv; ///< Current Key-Value-pair.
|
||||
}
|
||||
HT_(IterState);
|
||||
} HT_(IterState);
|
||||
|
||||
// Create a new Ht with the provided Options
|
||||
RZ_API RZ_OWN HtName_(Ht) *Ht_(new_opt)(RZ_NONNULL HT_(Options) *opt);
|
||||
|
|
|
|||
|
|
@ -154,7 +154,9 @@ RZ_API void rz_sys_backtrace(void);
|
|||
#ifndef rz_sys_breakpoint
|
||||
#if __WINDOWS__
|
||||
#define rz_sys_breakpoint() \
|
||||
{ __debugbreak(); }
|
||||
{ \
|
||||
__debugbreak(); \
|
||||
}
|
||||
#else
|
||||
#if __GNUC__
|
||||
#define rz_sys_breakpoint() __builtin_trap()
|
||||
|
|
|
|||
|
|
@ -294,14 +294,11 @@ static bool isAllZeros(const ut8 *buf, int len) {
|
|||
RZ_API void rz_print_hexii(RzPrint *rp, ut64 addr, const ut8 *buf, int len, int step) {
|
||||
PrintfCallback p = (PrintfCallback)rp->cb_printf;
|
||||
bool c = rp->flags & RZ_PRINT_FLAGS_COLOR;
|
||||
const char *color_0xff = c ? (Pal(rp, b0xff)
|
||||
: Color_RED)
|
||||
const char *color_0xff = c ? (Pal(rp, b0xff) : Color_RED)
|
||||
: "";
|
||||
const char *color_text = c ? (Pal(rp, btext)
|
||||
: Color_MAGENTA)
|
||||
const char *color_text = c ? (Pal(rp, btext) : Color_MAGENTA)
|
||||
: "";
|
||||
const char *color_other = c ? (Pal(rp, other)
|
||||
: Color_WHITE)
|
||||
const char *color_other = c ? (Pal(rp, other) : Color_WHITE)
|
||||
: "";
|
||||
const char *color_reset = c ? Color_RESET : "";
|
||||
int i, j;
|
||||
|
|
|
|||
|
|
@ -10,7 +10,9 @@
|
|||
#ifndef HAVE_EPRINTF
|
||||
#include <stdio.h>
|
||||
#define eprintf(...) \
|
||||
{ fprintf(stderr, ##__VA_ARGS__); }
|
||||
{ \
|
||||
fprintf(stderr, ##__VA_ARGS__); \
|
||||
}
|
||||
#define HAVE_EPRINTF 1
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue