This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: objcopy question


Hi Jeffery,

> We're using a gcc variant provided by WindRiver for use with the
> VxWorks OS.

Since WindRiver sell support for their OS, and its tools, you should
probably ask them this question, however...

> I'd like to be able to add some text (version) information to object
> files using objcopy --add-section.

Why ?  Why not just create some assembler source containing the text
you want to add, using a section name that you want to use, and then
just assemble it and link it in as a normal object file ?

> Are there any gotchas in doing this?

Well it depends upon the file format you are using.  Not all file
formats can support arbitrary section names.  Also if you use the name
of an already existing section you may get some strange behaviour.
But in general it should just work.

> Can this be done in object files that are linked during the build
> process, or dynamically linked later?

I doubt if it will work satisfactorily on dynamically linked files.
It would be best to stick to altering object files before they are
linked.

> Also, I've noticed that I can only add one new section to the object
> file.  Is this normal? 

No.  You should be able to use the --add-section switch multiple times
to add multiple sections.  Of course you may have an old/buggy version
of objcopy.

Cheers
        Nick


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]