From: Dave Korn <dave.korn.cygwin@gmail.com>
To: Dave Korn <dave.korn.cygwin@gmail.com>,
"H.J. Lu" <hjl.tools@gmail.com>,
"binutils@sourceware.org" <binutils@sourceware.org>
Subject: Re: [PATCH,take 2,trunk+2.21.1] Re: Fix link order problem with LD plugin API.
Date: Thu, 03 Feb 2011 05:44:00 -0000 [thread overview]
Message-ID: <4D4A46D2.4000709@gmail.com> (raw)
In-Reply-To: <20110203051145.GV9489@bubble.grove.modra.org>
On 03/02/2011 05:11, Alan Modra wrote:
> On Mon, Jan 31, 2011 at 02:23:27AM +0000, Dave Korn wrote:
>> * ldlang.h (lang_input_statement_type): Add new 'claim_archive' flag.
>> * ldmain.c (add_archive_element): Set it if the member is claimed.
>> * ldlang.c (new_afile): Initialise claim_archive and claimed members.
>> (find_replacements_insert_point): New helper function.
>> (lang_process): After adding and opening replacement files passed
>> from plugin, splice them into correct place in statement list and
>> file chains to preserve critical link order.
>> (lang_list_insert_after): New helper function.
>> (lang_list_remove_tail): Likewise.
>
> OK.
>
>> + /* Are we adding at the very end of the list? */
>> + if (*field == NULL)
>> + {
>> + /* (*field == NULL) should imply (destlist->tail == field),
>> + if not then the element isn't really in the DESTLIST. */
>> + ASSERT (destlist->tail == field);
>> + /* Yes, append to and update tail pointer. */
>> + *(destlist->tail) = srclist->head;
>> + destlist->tail = srclist->tail;
>> + }
>> + else
>> + {
>> + /* We're inserting in the middle somewhere. */
>> + *(srclist->tail) = *field;
>> + *field = srclist->head;
>> + }
>
> Maybe this instead?
>
> *(srclist->tail) = *field;
> *field = srclist->head;
> if (destlist->tail == field)
> destlist->tail = srclist->tail;
Seems like a good plan. I notice that I omitted #ifdef ENABLE_PLUGINS
guards around those new functions, which, being static, will cause unused
warnings. Respin shortly, along with a series of other patches (in
particular, something to get rid of those stray left-over symbols when the IR
symtabs in the input files mention something that ltrans subsequently decides
it can optimise away.)
cheers,
DaveK
next prev parent reply other threads:[~2011-02-03 5:44 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-29 1:23 [PATCH,trunk+2.21.1] " Dave Korn
2011-01-29 1:45 ` H.J. Lu
2011-01-29 2:01 ` H.J. Lu
2011-01-29 2:05 ` H.J. Lu
2011-01-29 2:11 ` Dave Korn
2011-01-29 2:45 ` H.J. Lu
2011-01-29 2:59 ` Dave Korn
2011-01-29 4:11 ` Dave Korn
2011-01-29 4:41 ` H.J. Lu
2011-01-31 1:57 ` [PATCH,take 2,trunk+2.21.1] " Dave Korn
2011-02-03 5:12 ` Alan Modra
2011-02-03 5:44 ` Dave Korn [this message]
2011-02-03 13:28 ` Alan Modra
2011-02-05 1:56 ` Alan Modra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D4A46D2.4000709@gmail.com \
--to=dave.korn.cygwin@gmail.com \
--cc=binutils@sourceware.org \
--cc=hjl.tools@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).