This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Feature request: .section$key


>>>>> Michael Meissner <meissner@cygnus.com> writes:

 > On Mon, Aug 28, 2000 at 01:56:38PM -0700, Jason Merrill wrote:
 >> Currently, if we want the linker to collapse several linkonce sections
 >> into the main section, we need to add something to a linker script:
 >> 
 >> .text : { *(.text) *(.gnu.linkonce.t.*) }

 > Instead ld should be modified so that is the default behavior.

But how would ld know what section to combine .gnu.linkonce.t.bob with
unless we tell it?  I'm proposing a more consistent scheme so it doesn't
have to guess.

 >> The PE format has what seems like a useful feature, such that sections
 >> starting with .foo$ are collapsed at link time into the .foo section.
 >> So we could put definitions of the function "bob" in .text$bob, mark
 >> them comdat, and the linker would deal without needing special
 >> instructions.
 >> 
 >> How about adding this feature to the ELF linker?  We would also want a
 >> new way to indicate that a section should be linkonce; perhaps
 >> 
 >> .text$.linkonce.bob
 >> 
 >> would do the trick.

 > I don't see that this is any different from the existing
 > -ffunction-sections, except that we forgot about the linkonce section.

The idea would be to use this scheme for -ffunction-sections, rather than
just '.bob', which is not combined with .text.

Jason

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]