This is the mail archive of the binutils@sourceware.org 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]
Other format: [Raw text]

Re: binary blob conversions/other blob questions


> If it can be done, I think it can be done with --wrap.
> That said, it might not be possible:
> External_fred:
>    ...
>    ; don't return yet
> External_greg:
>    ...
>    RET
> Overriding one without overriding the other might be difficult.
> Can you ascertain whether there are external
> references not preceeded by returns?
> It's even worse if someone does arithmetic on code addresses.
Well, as this blob was generated from 100% C, using gcc-3.2 for MIPS,
with simple -O2 options, I hope, there will not be such thing,
and disassembly found no such problems. And there's no
arithmetics on code addresses.

So I persist with the same questions. --wrap option requires a symbol as
argument, which means I have to put lots of stuff on a command line
which might not be an options in case of big numbers of symbols.

Well, I think I need to provide more detail.
Lets suppose, we have blob.o we work with, which implements network
interface as it were in 2.4.17 kernel, and we want to run it on 2.6
with API changes. Without much digging around, lets suppose we need to
wrap structure from some function and provide it to some other function.
so we have in our .o
T driver_func
t driver_func2
U api_func

For now I need to replace driver_func2, which is executed by driver_func
by my own code, which uses newer API with structure format changed,
which then converts this struct back for other binary module parts to
use, and then call (optionally) call older version of function until it
is rewritten fully. Is there some options on how to achieve this to a
few hundreds of global and static functions so that at any step of
conversion I could check that I did not break anything?

So, as it is being done, I add additional module wrapper.o and rename
functions in blob.o. But a problem is still there with static functions,
how do these to be handled for them to be replaced? Especially in case
when I need to delete it and write version which entirely sits in
wrapper.o, so in separate .o. Is it will guarantee that there will be no
references left somewhere for old version (all function names are in
symbol table and they are called either directly or over function
pointers (which are directly assigned without calculations).

Any ideas?

All the best,
S.


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