Re: [PATCH 5/5] perf symbols: Implement poor man's ELF parser

From: Namhyung Kim
Date: Mon May 21 2012 - 21:11:20 EST


Hi, again

On Mon, 21 May 2012 13:47:39 +0200, Jiri Olsa wrote:
> On Mon, May 14, 2012 at 04:10:24PM +0900, Namhyung Kim wrote:
>> Implement minimalistic elf parser for getting build-id.
>> A couple of structs needed are copied from elf.h and
>> the parser only looks for PT_NOTE program header to
>> check build-id.
>> ---
>> tools/perf/util/elf-minimal.h | 153 ++++++++++++++++++++++++
>> tools/perf/util/symbol-minimal.c | 244 ++++++++++++++++++++++++++++++++++++--
>> 2 files changed, 388 insertions(+), 9 deletions(-)
>> create mode 100644 tools/perf/util/elf-minimal.h
>>
>> diff --git a/tools/perf/util/elf-minimal.h b/tools/perf/util/elf-minimal.h
>> new file mode 100644
>> index 000000000000..26540b5718a1
>> --- /dev/null
>> +++ b/tools/perf/util/elf-minimal.h
>> @@ -0,0 +1,153 @@
>> +/*
>> + * Minimal ELF definitions for parsing build-id.
>> + */
>> +/* This file defines standard ELF types, structures, and macros.
>> + Copyright (C) 1995-2003,2004,2005,2006,2007,2008,2009,2010,2011
>> + Free Software Foundation, Inc.
>> + This file is part of the GNU C Library.
>> +
>> + The GNU C Library is free software; you can redistribute it and/or
>> + modify it under the terms of the GNU Lesser General Public
>> + License as published by the Free Software Foundation; either
>> + version 2.1 of the License, or (at your option) any later version.
>> +
>> + The GNU C Library is distributed in the hope that it will be useful,
>> + but WITHOUT ANY WARRANTY; without even the implied warranty of
>> + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
>> + Lesser General Public License for more details.
>> +
>> + You should have received a copy of the GNU Lesser General Public
>> + License along with the GNU C Library; if not, write to the Free
>> + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
>> + 02111-1307 USA. */
>
> I can see all this exported in:
>
> [jolsa@dhcp-26-214 perf]$ rpm -qf /usr/include/elf.h
> glibc-headers-2.14.90-24.fc16.6.x86_64
>
> so maybe we dont need to add our own, since glic-headers
> seems crutial anyway ;)
>

Thanks for pointing it out. Actually I wanted to be independent to glibc
either, but it seems we tied to it tightly already. Will remove it.

Thanks,
Namhyung
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/