Re: PT_NOTE section in the ELF header



prix prad wrote:
Hi All,
I was looking through the below link:

http://www.netbsd.org/docs/kernel/elf-notes.html

Thanks for the link! I *knew* I'd seen something like that somewhere!

I was confused as to why we have something linke 1f - 0f, 3f - 2f:
****************************************************************************************************************
.long 1f - 0f # name size (not including padding)
.long 3f - 2f # desc size (not including padding)
****************************************************************************************************************

Why can't this be simply .long 1f
.long 1f ? I am assuming you just
have to subtract 3f - 2f = 1f.

Could someone please explain me this?

I'm not familiar with Gas, but Nasm's excuse for making us do a similar thing is that labels are "relocatable values", whose final values are not known at assemble-time. The *difference* between two labels *can* be calculated at assemble-time - provided that they're in the same section.

Best,
Frank
.