This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Can local symbols be used to define basic block boundary
- From: Ian Lance Taylor <iant at google dot com>
- To: ééä <chenwj at iis dot sinica dot edu dot tw>
- Cc: binutils at sourceware dot org
- Date: Thu, 09 Jun 2011 06:20:05 -0700
- Subject: Re: Can local symbols be used to define basic block boundary
- References: <20110609052418.GA68415@cs.nctu.edu.tw>
ééä <chenwj@iis.sinica.edu.tw> writes:
> gas has an option "--keep-locals" which asks gas keep local symbols.
> I have read the online manual belows, but still not sure what local
> symbols are for.
> http://sourceware.org/binutils/docs-2.21/as/Symbol-Names.html
Basically, local symbols are symbols used at assembly time but not at
link time. For gcc generated code, they are generally used as branch
targets, to give the address of string constants or other constant
values stored in static memory, or to mark areas of the code for
debugging and exception information. On most targets these days local
symbols start with ".L".
> Can local symbols be be used to define basic block boundary?
Can they be used in that way? Sure. Does gcc use them in that way? I
suppose so, approximately, in that most basic blocks do start with a
label and gcc will normally use a local label for that. But if you are
looking at the assembly code, you won't necessarily know which local
labels indicate the start of a block and which indicate something else.
Ian