public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
To: Cary Coutant <ccoutant@gmail.com>
Cc: "binutils@sourceware.org" <binutils@sourceware.org>,
	"jan.smets@nokia.com"	<jan.smets@nokia.com>,
	Petar Jovanovic <Petar.Jovanovic@imgtec.com>
Subject: RE: [PATCH][gold] PR 21152: Mips: Handle more relocations in relocatable link
Date: Thu, 16 Mar 2017 18:25:00 -0000	[thread overview]
Message-ID: <3060420525346945A0ADBD567348A917EF93C7D8@BADAG02.ba.imgtec.org> (raw)
In-Reply-To: <CAJimCsFuXqLsUYgYqgPqTjiKoJ3PDq93-uZT4-wHhqRKT-PXdg@mail.gmail.com>

Hi Cary,

> What problem are you referring to? I'm guessing that you're thinking
> you can't use the approach of pushing HI16 relocations onto a list
> like Scan::local does with target->got16_addends_, because
> relocate_special_relocatable can be called in multiple threads, and
> thus cannot update the non-thread-specific list. Well, got16_addends_
> ought to be a member of the Target::Scan class, which would make it
> thread specific, but it doesn't really matter that much since
> Scan::local() and Scan::global() always run single threaded. The same
> idea, however, could be used if needed in Target::Relocate, but that
> doesn't help with relocate_relocs since there is no Target::Scan or
> Target::Relocate equivalent class. It also doesn't help because here
> you're trying to look ahead to the paired LO16 while processing a
> HI16, while in Scan::local(), it only needs to look back to the paired
> HI16 while processing a LO16.

Yes, I'm referring to the problem that you described.
What do you think about moving these lists into the class Mips_relobj?  If I do
that, there is no need to reimplement the whole relocate_relocs() and the same
approach from Target::Relocate can be used (look back to the paired HI16 while
processing a LO16).  Report if there is no matching LO16 reloc can be added at
the end of the Target_mips::relocate_relocs for relocatable link.

> I'm not happy with the potentially quadratic behavior introduced by
> get_lo16_rel_addend(), but I guess my real issue isn't with your patch
> so much as with the MIPS ABI itself.

Relocation section is sorted so each HI16 relocation is followed immediately
by an associated LO16 entry (there can be more than one HI16 reloc for one
LO16), so this approach shouldn't have an impact on performance.

Regards,
Vladimir

  reply	other threads:[~2017-03-16 18:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-10 16:52 Vladimir Radosavljevic
2017-03-15 22:18 ` Cary Coutant
2017-03-16 18:25   ` Vladimir Radosavljevic [this message]
2017-03-17  3:47     ` Cary Coutant
2017-03-21 16:14       ` Vladimir Radosavljevic
2017-03-30 13:06         ` Maciej W. Rozycki

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=3060420525346945A0ADBD567348A917EF93C7D8@BADAG02.ba.imgtec.org \
    --to=vladimir.radosavljevic@imgtec.com \
    --cc=Petar.Jovanovic@imgtec.com \
    --cc=binutils@sourceware.org \
    --cc=ccoutant@gmail.com \
    --cc=jan.smets@nokia.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).