This is the mail archive of the binutils@sources.redhat.com 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: sizeof() in assembler


On Wed, Sep 01, 2004 at 09:28:26AM +0200, Massimiliano Cialdi wrote:
> I can define the size of an object:
> 
>   .section .rodata
>   .align 1
> str:
>   .ascii "+++***+++\r\n"
>   .size	str, .-str
> 
> 
> there exist something like sizeof(str) to retrive the size of object
> str?

No.
But you can always use
str:
  .ascii "+++***+++\r\n"
  sizeof_str = .-str
  .size str, sizeof_str

	Jakub


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