bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/28399] Flag to order functions in a specific order based on orde


From: nickc at redhat dot com
Subject: [Bug ld/28399] Flag to order functions in a specific order based on order file
Date: Tue, 05 Oct 2021 16:24:29 +0000

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

Nick Clifton <nickc at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nickc at redhat dot com

--- Comment #1 from Nick Clifton <nickc at redhat dot com> ---
(In reply to hiraditya from comment #0)
> The BSD linker has this option `--symbol-ordering-file=file <order file>`
> that lays out functions (and possibly other symbols) in the order specified
> in order file.

The documentation does not appear to specify the format of the file, nor what
happens to symbols that are not in the file, or symbols that are in the file
but which do not appear in any of the input files.  (Or what happens to weak
symbols, or aliases or ...)  Basically it does not appear to be very well
documented.


> I can't find similar flag in gnu ld.

There is none.  But ... you can use linker scripts to achieve a similar effect
- at least on an object file basis, rather than a symbol basis.  In linker
scripts you can specify the order in which input sections will appear in the
output section, so you can choose for example to have .text from foo.o appear
first, followed by .text from bar.o, followed by any remaining .text sections
from any remaining input files.

Other than that though you are right, ld does not have this facility.  Of
course if someone wants to write a patch to implement it, I will be happy to
review it...

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