qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC PATCH 4/6] Makefile: introduce common-obj-m and bl


From: Fam Zheng
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
User-agent: Mutt/1.5.21 (2010-09-15)

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]