xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Gianni Tedesco <gianni.tedesco@citrix.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: Christoph Egger <Christoph.Egger@amd.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: libxl: link error
Date: Mon, 16 Aug 2010 13:36:22 +0100	[thread overview]
Message-ID: <1281962182.18490.365.camel@qabil.uk.xensource.com> (raw)
In-Reply-To: <19557.14995.499107.257870@mariner.uk.xensource.com>

On Fri, 2010-08-13 at 13:29 +0100, Ian Jackson wrote:
> Christoph Egger writes ("[Xen-devel] libxl: link error"):
> > I get this link error when linking libxl:
> > 
> > ld: libxl_dom.o: relocation R_X86_64_PC32 against symbol 
> > `hvm_build_set_params' can not be used when making a shared object; recompile 
> > with -fPIC
> 
> I think this is probably a side effect of the addition of the
> "_hidden" attribute (aka `__attribute__((visibility("hidden")))',
> defined in libxl_internal.h) to this function ?
> 
> Can you explain what the notable differences are between the Linux and
> BSD ELF linkers ?  Perhaps the BSD linker does not support this
> attribute, in which case we should probably #ifdef it out.

I realise this thread is about another issue but just FYI:

The hidden attribute is handled by gcc in all architectures (AFAIK)
since it's a detail that's implemented at link (ld) time, not in the
dynamic linkers. In the .o files symbols get prepended with ".hidden "
or some such and then when creating an executable or shared object from
them the absolute or relative address is patched directly in to the
machine code and no symbol is emitted. Since we're targeting GNU C and
not something else it should be fine.

There is one "arch" where this attribute won't work and that's windows,
where everything is hidden by default and you need declspec dllexport
for exported functions. When the patches arrive for libxenlight.dll
we'll then need to have _public as well as _hidden attribute macros and
use them for all non-static functions.

Heh :)

      parent reply	other threads:[~2010-08-16 12:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-13  8:57 libxl: link error Christoph Egger
2010-08-13 12:29 ` Ian Jackson
2010-08-13 13:37   ` Christoph Egger
2010-08-13 14:11     ` Christoph Egger
2010-08-13 14:15       ` Ian Jackson
2010-08-13 14:25         ` Olaf Hering
2010-08-13 14:52           ` Ian Jackson
2010-08-16 12:36   ` Gianni Tedesco [this message]

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=1281962182.18490.365.camel@qabil.uk.xensource.com \
    --to=gianni.tedesco@citrix.com \
    --cc=Christoph.Egger@amd.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=xen-devel@lists.xensource.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).