This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC 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: Add assembly instruction to GCC


On 04/13/2012 03:58 PM, Amir Ghanbari wrote:
> Ok, let me get this straight. I'm not sure how the binary files are
> structured. Shouldn't the address of each instruction be in the binary
> file?

No, it's a continuous stream of bytes.  Instruction boundaries are
not marked.

> if I have something like:
>>>>     401ba0 :  f0 0f                     lock mov (bad),%db1"
>>>>     401ba2 :  23 48 89               and    -0x77(%rax),%ecx"
> is it the same as:
>>>>     401ba0 :  f0 0f 23                 lock (bad)
>>>>     401ba3 :  48 89
> aren't those two forms different(they're gonna have different addresses)?

No, they're the same.

> I want GCC to discriminate between these two forms and do it like the
> latter (if those two are different in a binary sense).

It can't.

Andrew.


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