This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: bfd_find_nearest_line vs local symbols
On Fri, Aug 18, 2000 at 05:26:04PM -0700, Richard Henderson wrote:
> In hand-written assembly or what? Surely the ".L" type symbols
> that the compiler puts out never made it to the object file.
They do, as far as I remember. I use this in the code of my library (libcwd):
// Throw away useless or meaningless symbols
asymbol** se = &symbol_table[number_of_symbols - 1];
for (asymbol** s = symbol_table; s <= se;)
{
if ((*s)->name == 0 || ((*s)->flags & (BSF_LOCAL|BSF_GLOBAL|BSF_FUNCTION|BSF_OBJECT)) == 0
|| ((*s)->flags & (BSF_DEBUGGING|BSF_SECTION_SYM|BSF_OLD_COMMON|BSF_NOT_AT_END|
BSF_CONSTRUCTOR|BSF_WARNING|BSF_INDIRECT|BSF_FILE|BSF_DYNAMIC)) != 0
|| ((*s)->flags == BSF_LOCAL && (*s)->name[0] == '.') // Some labels have a size(?!), their flags seem to be always 1
|| bfd_is_abs_section(bfd_get_section(*s))
|| bfd_is_com_section(bfd_get_section(*s))
|| bfd_is_ind_section(bfd_get_section(*s)))
{
*s = *se--;
--number_of_symbols;
}
else
{
function_symbols.insert(function_symbols_ct::key_type(*s, !bfd_is_und_section(bfd_get_section(*s))));
++s;
}
}
Note the comment that I added there. I added that when I still had a
"(*s)->value == 0" before it, even.
And yes, I DO use symbols that have BSF_LOCAL set!
--
Carlo Wood <carlo@alinoe.com> -=- Jesus Loves you -=-