qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: Richard Henderson <rth@twiddle.net>
Cc: pbonzini@redhat.com, mjt@tls.msk.ru, qemu-devel@nongnu.org,
	stefanha@redhat.com
Subject: Re: [Qemu-devel] [RFC PATCH 4/6] Makefile: introduce common-obj-m and block-obj-m for DSO
Date: Fri, 6 Sep 2013 13:53:56 +0800	[thread overview]
Message-ID: <20130906055356.GA6847@T430s.nay.redhat.com> (raw)
In-Reply-To: <5228DA64.2020009@twiddle.net>

On Thu, 09/05 12:24, Richard Henderson wrote:
> On 09/05/2013 03:20 AM, Fam Zheng wrote:
> >   1) %.o in $(common-obj-m) is compiled to %.o, with
> >      "QEMU_CFLAGS += -shared -fPIC". Then "linked" to %.mo, which is an
> >      incremental object with "ln -r". This step is for consistency with
> >      %.mod case and has no effect.
> 
> As a general rule, you should avoid ld -r unless you know exactly
> what that implies for the given machine.  This is the sort of thing
> that's highly likely to work on x86 while failing elsewhere.
> 
> E.g. ARM and PPC ld would like to add trampolines for direct calls
> to reach the PLT entry.  If you create one object that's too large
> then that's no longer possible.
> 
> E.g. MIPS and Alpha ld require that any one input object file
> reference less than 64K worth of got entries.  Every separate
> object file can address its own 64K segment of the got.  If you
> combine too many objectsyou could overflow the got subsegments.
> 
> If our modules are small enough, we may never see any of these, but...
> 
> If you really require a single input file to ld for pattern matching
> purposes, I highly recommend an ar file, and then use --whole-archive
> to force the entire contents of the .a to be included.  This preserves
> the original translation-unit boundaries for ld.
> 
OK. Thanks for pointing out. The problem with ar file is that --whole-archive
needs to be done specificly to modules .a, other libs shouldn't be linked with
this flag. I'll drop this step by changing my pattern matching approach in
Makefile, and just compile and link without such intermediate object file.

Fam

  parent reply	other threads:[~2013-09-06  5:54 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-05 10:20 [Qemu-devel] [RFC PATCH 0/6] Shared Library Module Support Fam Zheng
2013-09-05 10:20 ` [Qemu-devel] [RFC PATCH 1/6] make.rule: fix $(obj) to a real relative path Fam Zheng
2013-09-06  9:41   ` Paolo Bonzini
2013-09-05 10:20 ` [Qemu-devel] [RFC PATCH 2/6] rule.mak: allow per object cflags and libs Fam Zheng
2013-09-05 10:20 ` [Qemu-devel] [RFC PATCH 3/6] Makefile: define curl cflags and libs with object Fam Zheng
2013-09-05 10:20 ` [Qemu-devel] [RFC PATCH 4/6] Makefile: introduce common-obj-m and block-obj-m for DSO Fam Zheng
2013-09-05 19:24   ` Richard Henderson
2013-09-05 19:41     ` Paolo Bonzini
2013-09-05 21:45       ` Peter Maydell
2013-09-06  8:26         ` Paolo Bonzini
2013-09-06  5:53     ` Fam Zheng [this message]
2013-09-06  7:20       ` Richard Henderson
2013-09-06  7:27         ` Fam Zheng
2013-09-05 10:20 ` [Qemu-devel] [RFC PATCH 5/6] module: load modules at start Fam Zheng
2013-09-05 11:43   ` Lluís Vilanova
2013-09-06  6:33     ` Fam Zheng
2013-09-05 11:49   ` Michael Tokarev
2013-09-05 10:20 ` [Qemu-devel] [RFC PATCH 6/6] curl: build as shared library Fam Zheng
2013-09-05 10:25 ` [Qemu-devel] [RFC PATCH 0/6] Shared Library Module Support Fam Zheng

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=20130906055356.GA6847@T430s.nay.redhat.com \
    --to=famz@redhat.com \
    --cc=mjt@tls.msk.ru \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=stefanha@redhat.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 NNTP newsgroup(s).