bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/30359] Create Resource-Only DLL


From: nickc at redhat dot com
Subject: [Bug ld/30359] Create Resource-Only DLL
Date: Wed, 26 Apr 2023 15:19:34 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=30359

--- Comment #8 from Nick Clifton <nickc at redhat dot com> ---
(In reply to Pali Rohár from comment #6)
Hi Pali,


> And then somehow put 
> 
> LONG (-1); LONG (-1);
> 
> only if _LENGTH_OF_DATA_ is non-zero.
> 
> This is also not possible by linker script language? Because it looks like
> very common thing...

I agree that it would be useful, but sadly conditional linkage is just not
supported by the linker script syntax.


> So I have feeling that generated DLL file is valid and this is bug in the
> binutils PE parser.

Yes, I am beginning to suspect this as well. :-(


> I played a bit with binutils code and found out that zero VMA in peicode.h
> is handled specially - as ignored.

If I remember correctly this is because no normal PE section has a VMA of zero.
 Or rather the only sections that have a VMA of 0 are debugging sections and
other non-execution related sections.  I am a little bit surprised that Windows
did not complain about the .rsrc section having a VMA of 0, but if it likes it
then I am not going to worry.

> -  if (scnhdr_int->s_vaddr != 0)
> +  if (scnhdr_int->s_size != 0)
>      {
>        scnhdr_int->s_vaddr += pe_data (abfd)->pe_opthdr.ImageBase;

This would be wrong, I think, as it would cause debugging sections to end up
with non-0 load addresses, which I am pretty sure is a bad thing.

Cheers
  Nick

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]