Skip to content

Commit

Permalink
readobj: add new relocs introduced by LoongArch psABI v2
Browse files Browse the repository at this point in the history
  • Loading branch information
xry111 committed Jul 29, 2022
1 parent a2b3751 commit 46072b8
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
37 changes: 37 additions & 0 deletions crates/examples/src/readobj/elf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3020,6 +3020,43 @@ static FLAGS_R_LOONGARCH: &[Flag<u32>] = &flags!(
R_LARCH_SUB64,
R_LARCH_GNU_VTINHERIT,
R_LARCH_GNU_VTENTRY,
R_LARCH_B16,
R_LARCH_B21,
R_LARCH_B26,
R_LARCH_ABS_HI20,
R_LARCH_ABS_LO12,
R_LARCH_ABS64_LO20,
R_LARCH_ABS64_HI12,
R_LARCH_PCALA_HI20,
R_LARCH_PCALA_LO12,
R_LARCH_PCALA64_LO20,
R_LARCH_PCALA64_HI12,
R_LARCH_GOT_PC_HI20,
R_LARCH_GOT_PC_LO12,
R_LARCH_GOT64_PC_LO20,
R_LARCH_GOT64_PC_HI12,
R_LARCH_GOT_HI20,
R_LARCH_GOT_LO12,
R_LARCH_GOT64_LO20,
R_LARCH_GOT64_HI12,
R_LARCH_TLS_LE_HI20,
R_LARCH_TLS_LE_LO12,
R_LARCH_TLS_LE64_LO20,
R_LARCH_TLS_LE64_HI12,
R_LARCH_TLS_IE_PC_HI20,
R_LARCH_TLS_IE_PC_LO12,
R_LARCH_TLS_IE64_PC_LO20,
R_LARCH_TLS_IE64_PC_HI12,
R_LARCH_TLS_IE_HI20,
R_LARCH_TLS_IE_LO12,
R_LARCH_TLS_IE64_LO20,
R_LARCH_TLS_IE64_HI12,
R_LARCH_TLS_LD_PC_HI20,
R_LARCH_TLS_LD_HI20,
R_LARCH_TLS_GD_PC_HI20,
R_LARCH_TLS_GD_HI20,
R_LARCH_32_PCREL,
R_LARCH_RELAX,
);
static FLAGS_NT_CORE: &[Flag<u32>] = &flags!(
NT_PRSTATUS,
Expand Down
5 changes: 5 additions & 0 deletions src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,11 @@ pub enum RelocationEncoding {
///
/// The `RelocationKind` must be PC relative.
AArch64Call,

/// LoongArch branch offset with two trailing zeros.
///
/// The `RelocationKind` must be PC relative.
LoongArchBranch,
}

/// File flags that are specific to each file format.
Expand Down

0 comments on commit 46072b8

Please sign in to comment.