This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: Your change to ldlang.c
- To: mark@codesourcery.com
- Subject: Re: Your change to ldlang.c
- From: Ian Lance Taylor <ian@zembu.com>
- Date: 1 Jul 1999 22:43:11 -0400
- CC: binutils@sourceware.cygnus.com
- References: <19990701175806N.mitchell@codesourcery.com>
From: Mark Mitchell <mark@codesourcery.com>
Date: Thu, 01 Jul 1999 17:58:06 -0700
1999-06-23 Ian Lance Taylor <ian@zembu.com>
* ldlang.c (section_already_linked): Only discard link once
sections if we are building constructors.
This change breaks the MIPS ABI with ld -r. The reason is
that the .reginfo section uses SEC_LINK_ONCE to avoid duplication, and
that is true even when doing ld -r. In fact, I'm not sure what the
purpose of your change was; I don't see why we should not discard link
once sections for ld -r things.
I thought it was discussed on the list a bit, but I can't find the
messages, so it must have been somewhere else. Richard, do you
remember?
My main concern was that it would mess up relocations. If an input
section disappears, relocations against symbols in that section need
to be adjusted to use different symbols, and relocations for that
section need to disappear. I doubt the backends do either of these
correctly.
We could go back to letting the emultempl file handle the .reginfo
sections for MIPS files when doing a relocateable link, I suppose.
Does anybody have a better suggestion?
Ian