diff options
author | Mark Harmstone <mark@harmstone.com> | 2023-01-23 23:01:54 +0000 |
---|---|---|
committer | Mark Harmstone <mark@harmstone.com> | 2023-01-25 22:26:18 +0000 |
commit | 9a02fbd1984021c1db08cfd855df0660745a0858 (patch) | |
tree | 9d71b128a9b0d902ac0e0bf8bccab9452c19ceaa /ld/pdb.c | |
parent | 5cf11483141a58314834653003e49709b47822d5 (diff) | |
download | binutils-9a02fbd1984021c1db08cfd855df0660745a0858.zip binutils-9a02fbd1984021c1db08cfd855df0660745a0858.tar.gz binutils-9a02fbd1984021c1db08cfd855df0660745a0858.tar.bz2 |
ld: Add pdb support to aarch64-w64-mingw32
This extends PDB support to the aarch64 PE targets.
The changes to the test files are just to make it so they can be assembled as
either x86, x86_64, or aarch64, mainly by changing the comment style.
The only actual code change here is in adding the architecture constants
to pdb.c.
Diffstat (limited to 'ld/pdb.c')
-rw-r--r-- | ld/pdb.c | 36 |
1 files changed, 25 insertions, 11 deletions
@@ -591,13 +591,20 @@ populate_type_stream (bfd *pdb, bfd *stream, struct types *types) static uint16_t get_arch_number (bfd *abfd) { - if (abfd->arch_info->arch != bfd_arch_i386) - return 0; + switch (abfd->arch_info->arch) + { + case bfd_arch_i386: + if (abfd->arch_info->mach & bfd_mach_x86_64) + return IMAGE_FILE_MACHINE_AMD64; + else + return IMAGE_FILE_MACHINE_I386; - if (abfd->arch_info->mach & bfd_mach_x86_64) - return IMAGE_FILE_MACHINE_AMD64; + case bfd_arch_aarch64: + return IMAGE_FILE_MACHINE_ARM64; - return IMAGE_FILE_MACHINE_I386; + default: + return 0; + } } /* Validate the DEBUG_S_FILECHKSMS entry within a module's .debug$S @@ -3618,13 +3625,20 @@ handle_debugt_section (asection *s, bfd *mod, struct types *types, static uint16_t target_processor (bfd *abfd) { - if (abfd->arch_info->arch != bfd_arch_i386) - return 0; + switch (abfd->arch_info->arch) + { + case bfd_arch_i386: + if (abfd->arch_info->mach & bfd_mach_x86_64) + return CV_CFL_X64; + else + return CV_CFL_80386; - if (abfd->arch_info->mach & bfd_mach_x86_64) - return CV_CFL_X64; - else - return CV_CFL_80386; + case bfd_arch_aarch64: + return CV_CFL_ARM64; + + default: + return 0; + } } /* Create the symbols that go in "* Linker *", the dummy module created |