bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/29900] Partial Linking removes alignment from linker directives


From: nickc at redhat dot com
Subject: [Bug ld/29900] Partial Linking removes alignment from linker directives
Date: Mon, 19 Dec 2022 17:08:19 +0000

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

Nick Clifton <nickc at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |ASSIGNED
           Assignee|unassigned at sourceware dot org   |nickc at redhat dot com
   Last reconfirmed|                            |2022-12-19

--- Comment #4 from Nick Clifton <nickc at redhat dot com> ---
(In reply to Denys Linke from comment #0)
Hi Denys,

  Thanks for the object files.

> As far as I can tell it is not possible to check the symbol alignment with
> one of the binutils tools.

I think that this might actually be the key to this mystery.  As far
as I can tell the PE file format does not allow for symbols to have
alignments.  This is why none of the binutils tools display this information.

> Therefore I use dumpbin.exe, which is part of MS
> Visual Studio.

I suspect that what is happening here is that dumpbin is decoding the contents
of the .drectve section and using that to recreate the alignment needs of the
symbols.


>> dumpbin.exe /directives linked.o
> Microsoft (R) COFF/PE Dumper Version 14.23.28107.0
> Copyright (C) Microsoft Corporation.  All rights reserved.
> 
> Dump of file linked.o
> 
> File Type: COFF OBJECT
> 
>   Summary
>            0 .bss
>            0 .data
>           20 .rdata$zzz
>            0 .text

And here is the problem.  The partially linked file does not have its
.drectve section.

Not being a PE expert I am not sure what should happen when you partially
link two or more files containing .drectve sections.  Should the contents
just be concatenated together, or is there more to it than that ?

On the assumption that concatenation is OK, would you be able to try out the
patch that I am about to upload.  This should preserve the .drectve sections
when performing a partial link.

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]