summaryrefslogtreecommitdiff
path: root/ld/pdb.c
diff options
context:
space:
mode:
authorMark Harmstone <mark@harmstone.com>2023-01-23 23:01:54 +0000
committerMark Harmstone <mark@harmstone.com>2023-01-25 22:26:18 +0000
commit9a02fbd1984021c1db08cfd855df0660745a0858 (patch)
tree9d71b128a9b0d902ac0e0bf8bccab9452c19ceaa /ld/pdb.c
parent5cf11483141a58314834653003e49709b47822d5 (diff)
downloadbinutils-gdb-9a02fbd1984021c1db08cfd855df0660745a0858.tar.gz
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.c36
1 files changed, 25 insertions, 11 deletions
diff --git a/ld/pdb.c b/ld/pdb.c
index dade888b885..12c4ac4b112 100644
--- a/ld/pdb.c
+++ b/ld/pdb.c
@@ -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