Re: The ".value" directive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Nov 30, 2011, at 4:18 PM, Ian Lance Taylor wrote:

> Amittai Aviram <amittai.aviram@xxxxxxxx> writes:
> 
>> What does the ".value" directive mean and what is it for?  The assembly code I'm looking at is for x86_64, if that makes a difference.  Thanks!
> 
> 
> It puts a two byte value into the output section.  E.g.,
> 
> short x = 1;
> 
> might generate
> 
> x:
> 	.value 1
> 
> Ian


Thanks, Ian.  I don't quite follow your example--I would have expected

short x = 1;

to result in something like

push $1

with the stack pointer at the appropriate address.  But, looking at the objdump disassembly of my code, I think I can see what you mean.  The two-byte value is simply written into the code at that point as the next instruction.  In this case, the value is 0x0f0b, which is, indeed, the "invalid opcode" instruction (UD2), and makes sense in this context as a low-level exception mechanism.


Amittai Aviram
PhD Student in Computer Science
Yale University
646 483 2639
amittai.aviram@xxxxxxxx
http://www.amittai.com




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux