Assembly instructions storing structure

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

Assembly instructions storing structure

Balaji V. Iyer
Hi Everyone,
     I am trying to port binutils to my propriatery architecture, and I
would like to do some "fix" before writing the instructions to the
file. I would to know where it stores the assembly instructions
before writing it to the file (like maybe a linked list or
something).

I am currently using binutils-2.11.93

Any help is highly appreciated and encouraged.

Yours Sincerely,

Balaji V. Iyer.

PS. Please CC me in your response since I am not a subscribing member of
this  mailing list.

Reply | Threaded
Open this post in threaded view
|

Re: Assembly instructions storing structure

Ashwin Pathmudi
hi,

On 11/17/05, Balaji V. Iyer <[hidden email]> wrote:
> Hi Everyone,
>      I am trying to port binutils to my propriatery architecture, and I
> would like to do some "fix" before writing the instructions to the
> file. I would to know where it stores the assembly instructions
> before writing it to the file (like maybe a linked list or
> something).
>
> I am currently using binutils-2.11.93
   The opcode for assembly instruction is written into a  structure called
   frag. I've never worked on binutils-2.11 but its at least the case
in 2.15. More info
  on frags can be got from gas/frags.h.

  When you say "fix" do you mean doing a fixup or you want to tamper with the
  object code of the already generated instruction ?

HTH,
cheers,
Ashwin Pathmudi.
Reply | Threaded
Open this post in threaded view
|

Re: Assembly instructions storing structure

Balaji V. Iyer
Hi Ashwin,
   THanks you for your quick response. When I said "fix" I meant I wanted
to  play with the instructions that are already generated. It is for
getting some results. Can you please tell me a little specificially
where in the frags are the instructions stored and the format they are
stored?

Thanks,

Balaji V. Iyer.


Ashwin Pathmudi wrote:

> hi,
>
> On 11/17/05, Balaji V. Iyer <[hidden email]> wrote:
>> Hi Everyone,
>>      I am trying to port binutils to my propriatery architecture, and I
>> would like to do some "fix" before writing the instructions to the
>> file. I would to know where it stores the assembly instructions
>> before writing it to the file (like maybe a linked list or
>> something).
>>
>> I am currently using binutils-2.11.93
>    The opcode for assembly instruction is written into a  structure called
>    frag. I've never worked on binutils-2.11 but its at least the case
> in 2.15. More info
>   on frags can be got from gas/frags.h.
>
>   When you say "fix" do you mean doing a fixup or you want to tamper with
> the
>   object code of the already generated instruction ?
>
> HTH,
> cheers,
> Ashwin Pathmudi.
>


====================================================
Balaji V. Iyer
PhD Student
Department of Electrical and Computer Engineering
North Carolina State University.
====================================================

Reply | Threaded
Open this post in threaded view
|

Re: Assembly instructions storing structure

Ashwin Pathmudi
hi,

On 11/18/05, Balaji V. Iyer <[hidden email]> wrote:
> Hi Ashwin,
>    THanks you for your quick response. When I said "fix" I meant I wanted
> to  play with the instructions that are already generated. It is for
> getting some results. Can you please tell me a little specificially
> where in the frags are the instructions stored and the format they are
> stored?
>
The bytes of the instructions can be accessed by the pointer
fr_literal of the frag structure and the format they are written in
depends on the
endianess.

HTH,
cheers,
Ashwin Pathmudi.