public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Using objcopy to replace elftoaout
@ 2005-10-13 17:40 Jim Gifford
  2005-10-14  8:20 ` Nick Clifton
  0 siblings, 1 reply; 2+ messages in thread
From: Jim Gifford @ 2005-10-13 17:40 UTC (permalink / raw)
  To: binutils

I'm trying to get rid of using the elftoaout tool in my silo and linux 
kernel builds, since the tool is not being maintained.

The problem I have is .rodata gives me errors in the conversion.
BFD: arch/sparc64/boot/vmlinux.aout: can not represent section `.rodata' 
in a.out object file format

In my research I found this
http://mail-index.netbsd.org/netbsd-bugs/2001/04/04/0006.html

Which basically said the elftoaout converts symbols to .text.
"elftoaout(1) folds .rodata and .data section into text"

How can I accomplish this using objcopy?

-- 
----
Jim Gifford
maillist@jg555.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Using objcopy to replace elftoaout
  2005-10-13 17:40 Using objcopy to replace elftoaout Jim Gifford
@ 2005-10-14  8:20 ` Nick Clifton
  0 siblings, 0 replies; 2+ messages in thread
From: Nick Clifton @ 2005-10-14  8:20 UTC (permalink / raw)
  To: Jim Gifford; +Cc: binutils

Hi Jim,

> Which basically said the elftoaout converts symbols to .text.
> "elftoaout(1) folds .rodata and .data section into text"
> 
> How can I accomplish this using objcopy?

I do not believe that objcopy can do this (at the moment, anyway).  What 
you need is the ability to merge one section into another.  One thing 
that might work, although it is rather complicated and completely 
untested is:

   Make a copy of the file.

   In the copy use "objcopy --remove-section ..." to remove all sections 
except say the .rodata section.

   Then use "objcopy --rename-section 
.rodata=.text,alloc,load,readonly,code,contents" to get a .text section.

   Repeat the first three steps to get another file which contains the 
.data section renamed to .text.

   Now use "objcopy --remove-section..." to remove the .rodata and .data 
sections from the original file.

   Finally use the linker to link together these three new files, all of 
which contain .text sections.  The linker should now merge these 
sections together giving you the output that you want.


Or you could just write a patch for objcopy that does all of this for you...

Cheers
   Nick

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-10-14  8:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-13 17:40 Using objcopy to replace elftoaout Jim Gifford
2005-10-14  8:20 ` Nick Clifton

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).