public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Paul Brook <paul@codesourcery.com>, binutils@sources.redhat.com
Subject: Re: [patch] VxWorks x86 shared library support.
Date: Fri, 15 Apr 2005 12:19:00 -0000	[thread overview]
Message-ID: <20050415121911.GA22552@nevyn.them.org> (raw)
In-Reply-To: <20050415070921.GI31303@bubble.modra.org>

On Fri, Apr 15, 2005 at 04:39:21PM +0930, Alan Modra wrote:
> I don't like any of your hacks to the generic ELF linker code.  With a
> little thought, you should be able to eliminate most of them.

FWIW, I'll take blame for most of the gross common ELF bits.  They're
much prettier when Paul posted them than when I got through with them,
though.

> On Thu, Apr 14, 2005 at 02:58:25PM +0100, Paul Brook wrote:
> > 	* elf-bfd.h (struct elf_backend_data): Add is_vxworks.
> > 	(RELOC_FOR_GLOBAL_SYMBOL): Ignore VxWorks magic GOT symbols.
> 
> No way is this RELOC_FOR_GLOBAL_SYMBOL hack acceptable.  Instead, do
> something about giving these magic symbols a value.  See, for example,
> elf32_hppa_set_gp.

Won't this cause the symbols to be output as defined?  The loader
requires them to be undefined.

> > 	(elf_link_adjust_relocs): Convert SHN_UNDEF relocs for PLT stubs
> > 	into section relative relocs.
> 
> Yikes!  You say
> 
> +         /* This is a relocation from an executable or shared library
> +            against a symbol in a different shared library.  We are
> +            createing a definition in the output file but it does not come
> +            from any of out normal (.o) files. ie. a PLT stub.
> 
> So this is presumably a linker created reloc.  Why can't you create it
> such that it doesn't need this horrible hack?

No, it isn't linker created.  VxWorks executables are kind of odd; they
are linked using --emit-relocs, and both the dynamic and non-dynamic
relocations are required for proper loading.  What this bit is doing is
fixing up relocations from an input file that would otherwise be copied
straight to the output file.  They're reloaded from the input file
here, so this is the only place the linker has an opportunity to frob
them.

I suppose it could be a backend hook and defined by the various VxWorks
backends...

-- 
Daniel Jacobowitz
CodeSourcery, LLC

  reply	other threads:[~2005-04-15 12:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-14 13:58 Paul Brook
2005-04-15  7:09 ` Alan Modra
2005-04-15 12:19   ` Daniel Jacobowitz [this message]
2005-04-15 22:20     ` 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=20050415121911.GA22552@nevyn.them.org \
    --to=drow@false.org \
    --cc=binutils@sources.redhat.com \
    --cc=paul@codesourcery.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).