Porting BFD to new architecture

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Porting BFD to new architecture

ibanez-2





 We are porting libbfd to a new architecture.
 But the libbfd internal is highly architecture dependent which
 is very different with other tools.

 For example, to port gas to a new target, all we need to do
 is add some target related files, add a few lines to the config file
 and rebuild it.

 But to port bfd, we need to hack the bfd source code.
 It makes upgrade to a new libbfd version impossible without re-porting.

 How can we add our architecture to the libbfd in a smart and transparent
way?

Reply | Threaded
Open this post in threaded view
|

Re: Porting BFD to new architecture

Mark D-5
On Wed, 2005-10-12 at 18:02 +0800, [hidden email] wrote:

>
>
>
>
>  We are porting libbfd to a new architecture.
>  But the libbfd internal is highly architecture dependent which
>  is very different with other tools.
>
>  For example, to port gas to a new target, all we need to do
>  is add some target related files, add a few lines to the config file
>  and rebuild it.
>
>  But to port bfd, we need to hack the bfd source code.
>  It makes upgrade to a new libbfd version impossible without re-porting.
>
>  How can we add our architecture to the libbfd in a smart and transparent
> way?
>

This is kind of a strange question.  I mean if it's a totally new
architecture, it's a totally new CPU - in that case I know for certain
you must do a lot more with GAS.  Likewise if it was a brand new
architecture, you could model your binary format from a preexisting one
like aout or elf.  I handle binutils on m68kmint and we use a bfd format
that is a hacked up aout format.  Very little work needed to be done to
upgrade between versions, but you're not going to get away clean without
doing anything ever ;)

Thanks,
Mark


Reply | Threaded
Open this post in threaded view
|

Re: Porting BFD to new architecture

Ian Lance Taylor
In reply to this post by ibanez-2
[hidden email] writes:

>  But to port bfd, we need to hack the bfd source code.
>  It makes upgrade to a new libbfd version impossible without re-porting.
>
>  How can we add our architecture to the libbfd in a smart and transparent
> way?

We don't know.  For most targets you can port BFD by adding a few
files and adding a line or two to reloc.c, archures.c, targets.c,
config.bfd, and perhaps configure.in.

If you tell us the problems you are encountering, perhaps we can help
solve them.

Ian
Reply | Threaded
Open this post in threaded view
|

Re: Porting BFD to new architecture

Ravi Ramaseshan
Hi,

On 12 Oct 2005 13:43:46 -0700, Ian Lance Taylor <[hidden email]> wrote:

> [hidden email] writes:
>
> >  But to port bfd, we need to hack the bfd source code.
> >  It makes upgrade to a new libbfd version impossible without re-porting.
> >
> >  How can we add our architecture to the libbfd in a smart and transparent
> > way?
>
> We don't know.  For most targets you can port BFD by adding a few
> files and adding a line or two to reloc.c, archures.c, targets.c,
> config.bfd, and perhaps configure.in.

And don't forget to build using --enable-maintainer-mode configure flag.

--
Ravi Ramaseshan
http://www.geocities.com/ramaseshan_ravi/

" Reality is only something we believe in strongly. "