[PATCH] ld: Drop pep-dll-{aarch64,x86_64}.c

Jon Turney jon.turney@dronecode.org.uk
Thu Jun 4 12:37:37 GMT 2026


On 31/05/2026 23:19, Alan Modra wrote:
> On Sun, May 31, 2026 at 03:17:45PM +0100, Jon Turney wrote:
>> I can't see anything in pe{,p}-dll.c which depends on the
>> COFF_WITH_peAArch64 or COFF_WITH_pex64 defines, so just remove all this.
> 
> Yes, and it's not just pe-dll.c but all of its headers.  As evidenced
> by the fact that compiling pep-dll.c with either of those defines on
> the command line gives the same object as compiling pep-dll.c.

Thanks for double checking!

(In fact, I think COFF_WITH_pe{AArch674,x64} are only used in pep.em, 
which I guess is the only place it makes sense to use them, given my 
vague memory of the preprocessing gymnastics that go on there...)

>> (Neither pep-dll-aarch64.o or pep-dll-x86_64.o are listed in
>> ALL_EMUL_EXTRA_OFILES, so this multiple definition problem doesn't show
>> up when configured --enable-targets=all', but this seems like another
>> source of subtle bugs if those defines did do anything here...)
> 
> True.
> 
>> Cc'ed Evgeny (Hi!), because I think this crosses with not-yet-submitted
>> patches of his which do add some code conditional on COFF_WITH_peAArch64.
>>
>> I imagine it's possible in code which *does* need to depend on the
>> output target to replace build time checks of COFF_WITH_pe{AArch64,x64}
>> with a runtime check of the output architecture (via
>> pe_details->pe_arch?).
>>
>> Cc: Evgeny Karpov <evgeny.karpov@arm.com>
>> Fixes: c60b3806799a ("aarch64-pe support for LD, GAS and BFD")
>> Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
>>
>> 2026-05-29  Jon Turney  <jon.turney@dronecode.org.uk>
>>
>> 	* Makefile.am (EXTRA_ld_new_SOURCES): Update.
>> 	* Makefile.in: Regenerate.
>> 	* configure.tgt (tar_extra_ofiles): Update.
>> 	* pep-dll-aarch64.c: Remove.
>> 	* pep-dll-x86_64.c: Remove.
> 
> OK.

Thanks, applied.



More information about the Binutils mailing list