delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/05/12/19:11:07

Message-Id: <199705122252.SAA19887@delorie.com>
Date: Mon, 12 May 1997 11:43:23 +0200 (METDST)
From: Robert Hoehne <robert DOT hoehne AT Mathematik DOT TU-Chemnitz DOT DE>
To: DJGPP-ANNOUNCE <djgpp-announce AT delorie DOT com>
Subject: ANNOUNCE: obj2bfd, a converter for MS .obj files to COFF
Mime-Version: 1.0

This is to announce that OBJ2BFD version 0.1 has
been uploaded to SimTel.NET mirrors:

  ftp:/ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2apps/o2bfd01b.zip
  ftp:/ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2apps/o2bfd01s.zip

For a description of OBJ2BFD please read below the readme from
the above achives.

---------------------------

Here I will give you some hints about rebuilding and using
OBJ2BFD, the converter of .obj files to an object format,
supported by the in OBJ2BFD linked BFD library.

Why an other converter for .obj files?
======================================

The need for this converter cames from the fact, that the
GNU linker, which comes with binutils 2.7, cannot handle
libraries, which have different types of object files.
That means, emxaout created aout object files from .obj
files and if you put them together with COFF object files
in a library you was not able to use that library.

Most of the source code in OBJ2BFD is taken from emxaout,
written by Eberhard Mattes. I have changed and added "only"
the code to support the BFD output format(s). The biggest
problem was the relocation and since I don't have a tool
to create 32-bit .obj files, I couldn't test it in all cases.
So, if you have any problems with the created object files
by OBJ2BFD, please send any .obj file which produces the
error together with the other files to build a small
executable and a describtion what should be and what
happened. I will try then to give my best to fix the possible
bug.

Limitations
===========

Since DJGPP supports ONLY 32-bit object files, OBJ2BFD
can be used also on .obj files which are compiled in the
flat memory model

Requirements for compiling OBJ2BFD are:
=======================================

1) You have installed the BFD library sources at least
   from version 2.7. These can be the BFD library from
   binutils 2.7 or from gdb 4.16 on DJGPP, which has also
   the BFD library 2.7 (I say here that you need at least
   version 2.7, because I haven't tried it with an other
   version).

2) Together with the BFD library you need also the libiberty
   library, which comes with that package.

Before you can link OBJ2BFD you have to build at first the
two libraries 'libbfd.a' and 'libibert.a'. Since I made this
only for DJGPP I have the names truncated to fit the 8+3
filename limit. If you want to build OBJ2BFD on an other
(unix) environment, you have to change the names in the makefile
'obj2bfd.mak'.

After successfull building of the two above mentioned libraries
you can run make and OBJ2BFD will be build.

I have not added any rule in the makefiles to build that 
libraries. You have to do this manually. Here are the steps,
if I assume, that you have installed them in c:/djgpp/gnu/binutl-2.7

c:
cd \djgpp\gnu\binutl-2.7\libibert
make
cd ..\bfd
make


If you have not installed the BFD library in the default directory,
( %DJDIR%/gnu/binutl-2.7 ), then you have to modify also the path
in 'makefile' to the correct directory.

The makefile 'obj2bfd.mak' is generated automaticaly by RHIDE,
and so it may look a little bit confusing to you if you don't
have so much knowlage about makefiles.

How to use OBJ2BFD?
===================

The usage of OBJ2BFD is very simple.

Usage:
  obj2bfd [-u] [-O <output-target>] -o <output_file> <input_file>
  obj2bfd [-u] [-O <output-target>] <input_file(s)>

Options:
  -u                 Don't add leading underscores
  -o <output_file>   Write output to <output_file>
  -O <outout-target> Create object format <output-target>

As you can see, you have to specify on commandline in most cases
only the input and the output filename and that's all.
Since the BFD library can support multiple object formats,
you can select the output-target also with the -O switch if you
need or want an other than the default. The default is currently
'coff-go32', the COFF object file format used by DJGPP.

Example: To convert all the .obj files in a directory to
COFF objectfiles, you can type

obj2bfd *.obj


The switch '-u' comes originaly from emxaout.

This program was originaly written for the
SciTech MGL Graphics library to convert the .obj files,
but it can be used also for any other purposes.

If you any problems or questions to OBJ2BFD, mail me.

Happy programming,

  Robert Hoehne <robert DOT hoehne AT mathematik DOT tu-chemnitz>


*****************************************************************
* Robert Hoehne, Fakultaet fuer Mathematik, TU-Chemnitz-Zwickau *
* Post:    Am Berg 3, D-09573 Dittmannsdorf                     *
* e-Mail:  Robert DOT Hoehne AT Mathematik DOT TU-Chemnitz DOT DE              *
* WWW:     http://www.tu-chemnitz.de/~rho                       *
*****************************************************************

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019