Skip to content

Commit

Permalink
bfd: Add support for LoongArch64 EFI (efi-*-loongarch64).
Browse files Browse the repository at this point in the history
This adds support for efi-loongarch64 by virtue of adding a new PEI target
pei-loongarch64.  This is not a full target and only exists to support EFI at
this time.

This means that this target does not support relocation processing and is mostly
a container format.  This format has been added to elf based loongarch64 targets
such that efi images can be made natively on Linux.

However this target is not valid for use with gas but only with objcopy.

We should't limit addresses to 32-bits for 64-bit vma, otherwise there will be
"RVA truncated" error when using objcopy on loongarch64.

With these changes the resulting file is recognized as an efi image.

Any magic number is based on the Microsoft PE specification [1].

The test results are as follows:
$ make check-binutils RUNTESTFLAGS='loongarch64.exp'
  PASS: Check if efi app format is recognized

$ objdump -h -f tmpdir/loongarch64copy.o
  tmpdir/loongarch64copy.o:     file format pei-loongarch64
  architecture: Loongarch64, flags 0x00000132:
  EXEC_P, HAS_SYMS, HAS_LOCALS, D_PAGED
  start address 0x0000000000000000

  Sections:
  Idx Name          Size      VMA               LMA               File off  Algn
    0 .text         0000003c  00000000200000b0  00000000200000b0  00000200  2**2
                    CONTENTS, ALLOC, LOAD, READONLY, CODE

[1] https://docs.microsoft.com/en-us/windows/win32/debug/pe-format

bfd:
  * .gitignore (pe-loongarch64igen.c): New.
  * Makefile.am (pei-loongarch64.lo, pe-loongarch64igen.lo, pei-loongarch64.c,
  pe-loongarch64igen.c): Add support.
  * Makefile.in: Likewise.
  * bfd.c (bfd_get_sign_extend_vma): Add pei-loongarch64.
  * coff-loongarch64.c: New file.
  * coffcode.h (coff_set_arch_mach_hook, coff_set_flags,
  coff_write_object_contents) Add loongarch64 (loongarch64_pei_vec) support.
  * config.bfd: Likewise.
  * configure: Likewise.
  * configure.ac: Likewise.
  * libpei.h (GET_OPTHDR_IMAGE_BASE, PUT_OPTHDR_IMAGE_BASE,
  GET_OPTHDR_SIZE_OF_STACK_RESERVE, PUT_OPTHDR_SIZE_OF_STACK_RESERVE,
  GET_OPTHDR_SIZE_OF_STACK_COMMIT, PUT_OPTHDR_SIZE_OF_STACK_COMMIT,
  GET_OPTHDR_SIZE_OF_HEAP_RESERVE, PUT_OPTHDR_SIZE_OF_HEAP_RESERVE,
  GET_OPTHDR_SIZE_OF_HEAP_COMMIT, PUT_OPTHDR_SIZE_OF_HEAP_COMMIT,
  GET_PDATA_ENTRY, _bfd_peLoongArch64_bfd_copy_private_bfd_data_common,
  _bfd_peLoongArch64_bfd_copy_private_section_data,
  _bfd_peLoongArch64_get_symbol_info, _bfd_peLoongArch64_only_swap_filehdr_out,
  _bfd_peLoongArch64_print_private_bfd_data_common,
  _bfd_peLoongArch64i_final_link_postscript,
  _bfd_peLoongArch64i_only_swap_filehdr_out, _bfd_peLoongArch64i_swap_aouthdr_in,
  _bfd_peLoongArch64i_swap_aouthdr_out, _bfd_peLoongArch64i_swap_aux_in,
  _bfd_peLoongArch64i_swap_aux_out, _bfd_peLoongArch64i_swap_lineno_in,
  _bfd_peLoongArch64i_swap_lineno_out, _bfd_peLoongArch64i_swap_scnhdr_out,
  _bfd_peLoongArch64i_swap_sym_in, _bfd_peLoongArch64i_swap_sym_out,
  _bfd_peLoongArch64i_swap_debugdir_in, _bfd_peLoongArch64i_swap_debugdir_out,
  _bfd_peLoongArch64i_write_codeview_record,
  _bfd_peLoongArch64i_slurp_codeview_record,
  _bfd_peLoongArch64_print_ce_compressed_pdata): New.
  * peXXigen.c (_bfd_XXi_swap_aouthdr_in, _bfd_XXi_swap_aouthdr_out,
  _bfd_XXi_swap_scnhdr_out, pe_print_pdata, _bfd_XX_print_private_bfd_data_common,
  _bfd_XX_bfd_copy_private_section_data, _bfd_XXi_final_link_postscript):
  Support COFF_WITH_peLoongArch64,
  * pei-loongarch64.c: New file.
  * peicode.h (coff_swap_scnhdr_in, pe_ILF_build_a_bfd, pe_ILF_object_p):
  Support COFF_WITH_peLoongArch64.
  (jtab): Add dummy entry that traps.
  * targets.c (loongarch64_pei_vec): New.

binutils
  * testsuite/binutils-all/loongarch64/loongarch64.exp: New file.
  * testsuite/binutils-all/loongarch64/pei-loongarch64.d: New test.
  * testsuite/binutils-all/loongarch64/pei-loongarch64.s: New test.

include
  * coff/loongarch64.h: New file.
  * coff/pe.h (IMAGE_FILE_MACHINE_LOONGARCH64): New.

Signed-off-by: Youling Tang <[email protected]>
  • Loading branch information
Youling Tang authored and lzshhxx committed Aug 10, 2022
1 parent 4c3cb23 commit 31f6009
Show file tree
Hide file tree
Showing 19 changed files with 506 additions and 27 deletions.
1 change: 1 addition & 0 deletions bfd/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
/pepigen.c
/pex64igen.c
/pe-aarch64igen.c
/pe-loongarch64igen.c
/stmp-bfd-h
/targmatch.h

Expand Down
9 changes: 8 additions & 1 deletion bfd/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -573,9 +573,11 @@ BFD64_BACKENDS = \
mach-o-x86-64.lo \
mmo.lo \
pe-aarch64igen.lo \
pe-loongarch64igen.lo \
pe-x86_64.lo \
pei-aarch64.lo \
pei-ia64.lo \
pei-loongarch64.lo \
pei-x86_64.lo \
pepigen.lo \
pex64igen.lo \
Expand Down Expand Up @@ -618,6 +620,7 @@ BFD64_BACKENDS_CFILES = \
pe-x86_64.c \
pei-aarch64.c \
pei-ia64.c \
pei-loongarch64.c \
pei-x86_64.c \
vms-alpha.c

Expand Down Expand Up @@ -677,7 +680,7 @@ BUILD_CFILES = \
elf32-ia64.c elf64-ia64.c \
elf32-loongarch.c elf64-loongarch.c \
elf32-riscv.c elf64-riscv.c \
peigen.c pepigen.c pex64igen.c pe-aarch64igen.c
peigen.c pepigen.c pex64igen.c pe-aarch64igen.c pe-loongarch64igen.c

CFILES = $(SOURCE_CFILES) $(BUILD_CFILES)

Expand Down Expand Up @@ -894,6 +897,10 @@ pe-aarch64igen.c: peXXigen.c
$(AM_V_at)echo "#line 1 \"peXXigen.c\"" > $@
$(AM_V_GEN)$(SED) -e s/XX/peAArch64/g < $< >> $@

pe-loongarch64igen.c: peXXigen.c
$(AM_V_at)echo "#line 1 \"peXXigen.c\"" > $@
$(AM_V_GEN)$(SED) -e s/XX/peLoongArch64/g < $< >> $@

host-aout.lo: Makefile

# The following program can be used to generate a simple config file
Expand Down
11 changes: 10 additions & 1 deletion bfd/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -1036,9 +1036,11 @@ BFD64_BACKENDS = \
mach-o-x86-64.lo \
mmo.lo \
pe-aarch64igen.lo \
pe-loongarch64igen.lo \
pe-x86_64.lo \
pei-aarch64.lo \
pei-ia64.lo \
pei-loongarch64.lo \
pei-x86_64.lo \
pepigen.lo \
pex64igen.lo \
Expand Down Expand Up @@ -1081,6 +1083,7 @@ BFD64_BACKENDS_CFILES = \
pe-x86_64.c \
pei-aarch64.c \
pei-ia64.c \
pei-loongarch64.c \
pei-x86_64.c \
vms-alpha.c

Expand Down Expand Up @@ -1139,7 +1142,7 @@ BUILD_CFILES = \
elf32-ia64.c elf64-ia64.c \
elf32-loongarch.c elf64-loongarch.c \
elf32-riscv.c elf64-riscv.c \
peigen.c pepigen.c pex64igen.c pe-aarch64igen.c
peigen.c pepigen.c pex64igen.c pe-aarch64igen.c pe-loongarch64igen.c

CFILES = $(SOURCE_CFILES) $(BUILD_CFILES)
SOURCE_HFILES = \
Expand Down Expand Up @@ -1690,6 +1693,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pe-arm-wince.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pe-arm.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pe-i386.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pe-loongarch64igen.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pe-mcore.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pe-sh.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pe-x86_64.Plo@am__quote@
Expand All @@ -1699,6 +1703,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pei-arm.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pei-i386.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pei-ia64.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pei-loongarch64.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pei-mcore.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pei-sh.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pei-x86_64.Plo@am__quote@
Expand Down Expand Up @@ -2401,6 +2406,10 @@ pe-aarch64igen.c: peXXigen.c
$(AM_V_at)echo "#line 1 \"peXXigen.c\"" > $@
$(AM_V_GEN)$(SED) -e s/XX/peAArch64/g < $< >> $@

pe-loongarch64igen.c: peXXigen.c
$(AM_V_at)echo "#line 1 \"peXXigen.c\"" > $@
$(AM_V_GEN)$(SED) -e s/XX/peLoongArch64/g < $< >> $@

host-aout.lo: Makefile

# The following program can be used to generate a simple config file
Expand Down
1 change: 1 addition & 0 deletions bfd/bfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1743,6 +1743,7 @@ bfd_get_sign_extend_vma (bfd *abfd)
|| strcmp (name, "pei-aarch64-little") == 0
|| strcmp (name, "pe-arm-wince-little") == 0
|| strcmp (name, "pei-arm-wince-little") == 0
|| strcmp (name, "pei-loongarch64") == 0
|| strcmp (name, "aixcoff-rs6000") == 0
|| strcmp (name, "aix5coff64-rs6000") == 0)
return 1;
Expand Down
165 changes: 165 additions & 0 deletions bfd/coff-loongarch64.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
/* BFD back-end for LoongArch64 COFF files.
Copyright (C) 2022 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
MA 02110-1301, USA. */


#ifndef COFF_WITH_peLoongArch64
#define COFF_WITH_peLoongArch64
#endif

/* Note we have to make sure not to include headers twice.
Not all headers are wrapped in #ifdef guards, so we define
PEI_HEADERS to prevent double including here. */
#ifndef PEI_HEADERS
#include "sysdep.h"
#include "bfd.h"
#include "libbfd.h"
#include "coff/loongarch64.h"
#include "coff/internal.h"
#include "coff/pe.h"
#include "libcoff.h"
#include "libiberty.h"
#endif

#include "libcoff.h"

/* The page size is a guess based on ELF. */

#define COFF_PAGE_SIZE 0x4000

/* All users of this file have bfd_octets_per_byte (abfd, sec) == 1. */
#define OCTETS_PER_BYTE(ABFD, SEC) 1

#ifndef PCRELOFFSET
#define PCRELOFFSET true
#endif

/* Currently we don't handle any relocations. */
static reloc_howto_type pe_loongarch64_std_reloc_howto[] =
{

};

#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER 2

#ifndef NUM_ELEM
#define NUM_ELEM(a) ((sizeof (a)) / sizeof ((a)[0]))
#endif

#define NUM_RELOCS NUM_ELEM (pe_loongarch64_std_reloc_howto)

#define RTYPE2HOWTO(cache_ptr, dst) \
(cache_ptr)->howto = NULL

#ifndef bfd_pe_print_pdata
#define bfd_pe_print_pdata NULL
#endif

/* Return TRUE if this relocation should
appear in the output .reloc section. */

static bool
in_reloc_p (bfd * abfd ATTRIBUTE_UNUSED,
reloc_howto_type * howto)
{
return !howto->pc_relative;
}

#include "coffcode.h"

/* Target vectors. */
const bfd_target
#ifdef TARGET_SYM
TARGET_SYM =
#else
loongarch64_pei_vec =
#endif
{
#ifdef TARGET_NAME
TARGET_NAME,
#else
"pei-loongarch64", /* Name. */
#endif
bfd_target_coff_flavour,
BFD_ENDIAN_LITTLE, /* Data byte order is little. */
BFD_ENDIAN_LITTLE, /* Header byte order is little. */

(HAS_RELOC | EXEC_P /* Object flags. */
| HAS_LINENO | HAS_DEBUG
| HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED | BFD_COMPRESS | BFD_DECOMPRESS),

(SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC /* Section flags. */
#if defined(COFF_WITH_PE)
| SEC_LINK_ONCE | SEC_LINK_DUPLICATES | SEC_READONLY | SEC_DEBUGGING
#endif
| SEC_CODE | SEC_DATA | SEC_EXCLUDE ),

#ifdef TARGET_UNDERSCORE
TARGET_UNDERSCORE, /* Leading underscore. */
#else
0, /* Leading underscore. */
#endif
'/', /* Ar_pad_char. */
15, /* Ar_max_namelen. */
0, /* match priority. */
TARGET_KEEP_UNUSED_SECTION_SYMBOLS, /* keep unused section symbols. */

/* Data conversion functions. */
bfd_getl64, bfd_getl_signed_64, bfd_putl64,
bfd_getl32, bfd_getl_signed_32, bfd_putl32,
bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* Data. */
/* Header conversion functions. */
bfd_getl64, bfd_getl_signed_64, bfd_putl64,
bfd_getl32, bfd_getl_signed_32, bfd_putl32,
bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* Hdrs. */

/* Note that we allow an object file to be treated as a core file as well. */
{ /* bfd_check_format. */
_bfd_dummy_target,
coff_object_p,
bfd_generic_archive_p,
coff_object_p
},
{ /* bfd_set_format. */
_bfd_bool_bfd_false_error,
coff_mkobject,
_bfd_generic_mkarchive,
_bfd_bool_bfd_false_error
},
{ /* bfd_write_contents. */
_bfd_bool_bfd_false_error,
coff_write_object_contents,
_bfd_write_archive_contents,
_bfd_bool_bfd_false_error
},

BFD_JUMP_TABLE_GENERIC (coff),
BFD_JUMP_TABLE_COPY (coff),
BFD_JUMP_TABLE_CORE (_bfd_nocore),
BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
BFD_JUMP_TABLE_SYMBOLS (coff),
BFD_JUMP_TABLE_RELOCS (coff),
BFD_JUMP_TABLE_WRITE (coff),
BFD_JUMP_TABLE_LINK (coff),
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),

NULL,

COFF_SWAP_TABLE
};
19 changes: 18 additions & 1 deletion bfd/coffcode.h
Original file line number Diff line number Diff line change
Expand Up @@ -2231,6 +2231,12 @@ coff_set_arch_mach_hook (bfd *abfd, void * filehdr)
machine = internal_f->f_flags & F_AARCH64_ARCHITECTURE_MASK;
break;
#endif
#ifdef LOONGARCH64MAGIC
case LOONGARCH64MAGIC:
arch = bfd_arch_loongarch;
machine = internal_f->f_flags & F_LOONGARCH64_ARCHITECTURE_MASK;
break;
#endif
#ifdef Z80MAGIC
case Z80MAGIC:
arch = bfd_arch_z80;
Expand Down Expand Up @@ -2795,6 +2801,12 @@ coff_set_flags (bfd * abfd,
return true;
#endif

#ifdef LOONGARCH64MAGIC
case bfd_arch_loongarch:
* magicp = LOONGARCH64MAGIC;
return true;
#endif

#ifdef ARMMAGIC
case bfd_arch_arm:
#ifdef ARM_WINCE
Expand Down Expand Up @@ -3890,7 +3902,7 @@ coff_write_object_contents (bfd * abfd)
internal_f.f_flags |= IMAGE_FILE_LARGE_ADDRESS_AWARE;
#endif

#if !defined(COFF_WITH_pex64) && !defined(COFF_WITH_peAArch64)
#if !defined(COFF_WITH_pex64) && !defined(COFF_WITH_peAArch64) && !defined(COFF_WITH_peLoongArch64)
#ifdef COFF_WITH_PE
internal_f.f_flags |= IMAGE_FILE_32BIT_MACHINE;
#else
Expand Down Expand Up @@ -3944,6 +3956,11 @@ coff_write_object_contents (bfd * abfd)
internal_a.magic = ZMAGIC;
#endif

#if defined(LOONGARCH64)
#define __A_MAGIC_SET__
internal_a.magic = ZMAGIC;
#endif

#if defined MCORE_PE
#define __A_MAGIC_SET__
internal_a.magic = IMAGE_NT_OPTIONAL_HDR_MAGIC;
Expand Down
2 changes: 1 addition & 1 deletion bfd/config.bfd
Original file line number Diff line number Diff line change
Expand Up @@ -1465,7 +1465,7 @@ case "${targ}" in

loongarch64-*)
targ_defvec=loongarch_elf64_vec
targ_selvecs="loongarch_elf32_vec loongarch_elf64_vec"
targ_selvecs="loongarch_elf32_vec loongarch_elf64_vec loongarch64_pei_vec"
want64=true
;;
#endif
Expand Down
1 change: 1 addition & 0 deletions bfd/configure
Original file line number Diff line number Diff line change
Expand Up @@ -13415,6 +13415,7 @@ do
lm32_elf32_fdpic_vec) tb="$tb elf32-lm32.lo elf32.lo $elf" ;;
loongarch_elf32_vec) tb="$tb elf32-loongarch.lo elfxx-loongarch.lo elf32.lo elf-ifunc.lo $elf" ;;
loongarch_elf64_vec) tb="$tb elf64-loongarch.lo elf64.lo elfxx-loongarch.lo elf32.lo elf-ifunc.lo $elf"; target_size=64 ;;
loongarch64_pei_vec) tb="$tb pei-loongarch64.lo pe-loongarch64igen.lo $coff"; target_size=64 ;;
m32c_elf32_vec) tb="$tb elf32-m32c.lo elf32.lo $elf" ;;
m32r_elf32_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
m32r_elf32_le_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
Expand Down
1 change: 1 addition & 0 deletions bfd/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@ do
lm32_elf32_fdpic_vec) tb="$tb elf32-lm32.lo elf32.lo $elf" ;;
loongarch_elf32_vec) tb="$tb elf32-loongarch.lo elfxx-loongarch.lo elf32.lo elf-ifunc.lo $elf" ;;
loongarch_elf64_vec) tb="$tb elf64-loongarch.lo elf64.lo elfxx-loongarch.lo elf32.lo elf-ifunc.lo $elf"; target_size=64 ;;
loongarch64_pei_vec) tb="$tb pei-loongarch64.lo pe-loongarch64igen.lo $coff"; target_size=64 ;;
m32c_elf32_vec) tb="$tb elf32-m32c.lo elf32.lo $elf" ;;
m32r_elf32_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
m32r_elf32_le_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
Expand Down
36 changes: 36 additions & 0 deletions bfd/libpei.h
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,41 @@
#define _bfd_XXi_write_codeview_record _bfd_peAArch64i_write_codeview_record
#define _bfd_XXi_slurp_codeview_record _bfd_peAArch64i_slurp_codeview_record

#elif defined COFF_WITH_peLoongArch64

#define GET_OPTHDR_IMAGE_BASE H_GET_64
#define PUT_OPTHDR_IMAGE_BASE H_PUT_64
#define GET_OPTHDR_SIZE_OF_STACK_RESERVE H_GET_64
#define PUT_OPTHDR_SIZE_OF_STACK_RESERVE H_PUT_64
#define GET_OPTHDR_SIZE_OF_STACK_COMMIT H_GET_64
#define PUT_OPTHDR_SIZE_OF_STACK_COMMIT H_PUT_64
#define GET_OPTHDR_SIZE_OF_HEAP_RESERVE H_GET_64
#define PUT_OPTHDR_SIZE_OF_HEAP_RESERVE H_PUT_64
#define GET_OPTHDR_SIZE_OF_HEAP_COMMIT H_GET_64
#define PUT_OPTHDR_SIZE_OF_HEAP_COMMIT H_PUT_64
#define GET_PDATA_ENTRY bfd_get_32

#define _bfd_XX_bfd_copy_private_bfd_data_common _bfd_peLoongArch64_bfd_copy_private_bfd_data_common
#define _bfd_XX_bfd_copy_private_section_data _bfd_peLoongArch64_bfd_copy_private_section_data
#define _bfd_XX_get_symbol_info _bfd_peLoongArch64_get_symbol_info
#define _bfd_XX_only_swap_filehdr_out _bfd_peLoongArch64_only_swap_filehdr_out
#define _bfd_XX_print_private_bfd_data_common _bfd_peLoongArch64_print_private_bfd_data_common
#define _bfd_XXi_final_link_postscript _bfd_peLoongArch64i_final_link_postscript
#define _bfd_XXi_only_swap_filehdr_out _bfd_peLoongArch64i_only_swap_filehdr_out
#define _bfd_XXi_swap_aouthdr_in _bfd_peLoongArch64i_swap_aouthdr_in
#define _bfd_XXi_swap_aouthdr_out _bfd_peLoongArch64i_swap_aouthdr_out
#define _bfd_XXi_swap_aux_in _bfd_peLoongArch64i_swap_aux_in
#define _bfd_XXi_swap_aux_out _bfd_peLoongArch64i_swap_aux_out
#define _bfd_XXi_swap_lineno_in _bfd_peLoongArch64i_swap_lineno_in
#define _bfd_XXi_swap_lineno_out _bfd_peLoongArch64i_swap_lineno_out
#define _bfd_XXi_swap_scnhdr_out _bfd_peLoongArch64i_swap_scnhdr_out
#define _bfd_XXi_swap_sym_in _bfd_peLoongArch64i_swap_sym_in
#define _bfd_XXi_swap_sym_out _bfd_peLoongArch64i_swap_sym_out
#define _bfd_XXi_swap_debugdir_in _bfd_peLoongArch64i_swap_debugdir_in
#define _bfd_XXi_swap_debugdir_out _bfd_peLoongArch64i_swap_debugdir_out
#define _bfd_XXi_write_codeview_record _bfd_peLoongArch64i_write_codeview_record
#define _bfd_XXi_slurp_codeview_record _bfd_peLoongArch64i_slurp_codeview_record

#else /* !COFF_WITH_pep */

#define GET_OPTHDR_IMAGE_BASE H_GET_32
Expand Down Expand Up @@ -405,5 +440,6 @@ bool _bfd_pe_print_ce_compressed_pdata (bfd *, void *);
bool _bfd_pe64_print_ce_compressed_pdata (bfd *, void *);
bool _bfd_pex64_print_ce_compressed_pdata (bfd *, void *);
bool _bfd_peAArch64_print_ce_compressed_pdata (bfd *, void *);
bool _bfd_peLoongArch64_print_ce_compressed_pdata (bfd *, void *);
bool _bfd_pep_print_ce_compressed_pdata (bfd *, void *);

Loading

0 comments on commit 31f6009

Please sign in to comment.