Skip to content

std.{coff,elf}: Remove the {MachineType,EM}.toTargetCpuArch() functions.#21177

Merged
andrewrk merged 2 commits intoziglang:masterfrom
alexrp:elf-coff-conv
Aug 25, 2024
Merged

std.{coff,elf}: Remove the {MachineType,EM}.toTargetCpuArch() functions.#21177
andrewrk merged 2 commits intoziglang:masterfrom
alexrp:elf-coff-conv

Conversation

@alexrp
Copy link
Member

@alexrp alexrp commented Aug 23, 2024

These are fundamentally incapable of producing accurate information for reasons I've laid out in #20771. Since our only use of these functions is to check that object files have the correct machine type, and since #21020 made std.Target.to{Coff,Elf}Machine() more accurate, just switch these checks over to that and compare the machine type tags instead.

Closes #20771.

alexrp added 2 commits August 23, 2024 19:56
These are fundamentally incapable of producing accurate information for reasons
I've laid out in #20771. Since our only use of these functions is to check that
object files have the correct machine type, and since #21020 made
`std.Target.to{Coff,Elf}Machine()` more accurate, just switch these checks over
to that and compare the machine type tags instead.

Closes #20771.
@andrewrk andrewrk enabled auto-merge August 23, 2024 22:08
@alexrp
Copy link
Member Author

alexrp commented Aug 24, 2024

x86_64-windows-release timeout looks unrelated.

@andrewrk andrewrk merged commit 849c31a into ziglang:master Aug 25, 2024
@alexrp alexrp deleted the elf-coff-conv branch August 25, 2024 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Conversion functions to/from ELF/COFF machine types need rethinking

3 participants