bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/27567] New: Linking PE files adds alignment section flags to exe


From: qsniyg at protonmail dot com
Subject: [Bug ld/27567] New: Linking PE files adds alignment section flags to executables
Date: Fri, 12 Mar 2021 08:07:39 +0000

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

            Bug ID: 27567
           Summary: Linking PE files adds alignment section flags to
                    executables
           Product: binutils
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: qsniyg at protonmail dot com
  Target Milestone: ---

Created attachment 13303
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13303&action=edit
patch to avoid section alignment flags for executables

Under wine, there is currently a problem where certain DRM systems will fail if
the wrong section characteristics on DLLs are detected.

Currently, ld will always add IMAGE_SCN_ALIGN_* characteristics for sections,
which does not match MSVC's output, therefore tripping the DRM.

According to
https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#section-flags,
IMAGE_SCN_ALIGN_* is only valid for object files (as opposed to
image/executable files).

I have attached a patch that fixes this issue on my end by only applying
section alignment flags to object files (!(flags & EXEC_P)).

Thanks to Paul Gofman for providing the DRM research.

-- 
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]