Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 155205
b: refs/heads/master
c: 30d7a77
h: refs/heads/master
i:
  155203: ffdb9d8
v: v3
  • Loading branch information
Arnaldo Carvalho de Melo authored and Ingo Molnar committed Jul 3, 2009
1 parent 2fcd75e commit ff058a1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 24b57c6988c5791628c89a8838910991abc9cc1e
refs/heads/master: 30d7a77dd5a9720430af72f6f62f5156fe073e55
11 changes: 6 additions & 5 deletions trunk/tools/perf/util/symbol.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,9 +555,10 @@ static int dso__load_sym(struct dso *self, int fd, const char *name,
nr_syms = shdr.sh_size / shdr.sh_entsize;

memset(&sym, 0, sizeof(sym));
self->prelinked = elf_section_by_name(elf, &ehdr, &shdr,
".gnu.prelink_undo",
NULL) != NULL;
self->adjust_symbols = (ehdr.e_type == ET_EXEC ||
elf_section_by_name(elf, &ehdr, &shdr,
".gnu.prelink_undo",
NULL) != NULL);
elf_symtab__for_each_symbol(syms, nr_syms, index, sym) {
struct symbol *f;
u64 obj_start;
Expand All @@ -580,7 +581,7 @@ static int dso__load_sym(struct dso *self, int fd, const char *name,
section_name = elf_sec__name(&shdr, secstrs);
obj_start = sym.st_value;

if (self->prelinked) {
if (self->adjust_symbols) {
if (verbose >= 2)
printf("adjusting symbol: st_value: %Lx sh_addr: %Lx sh_offset: %Lx\n",
(u64)sym.st_value, (u64)shdr.sh_addr, (u64)shdr.sh_offset);
Expand Down Expand Up @@ -632,7 +633,7 @@ int dso__load(struct dso *self, symbol_filter_t filter, int verbose)
if (!name)
return -1;

self->prelinked = 0;
self->adjust_symbols = 0;

if (strncmp(self->name, "/tmp/perf-", 10) == 0)
return dso__load_perf_map(self, filter, verbose);
Expand Down
2 changes: 1 addition & 1 deletion trunk/tools/perf/util/symbol.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ struct dso {
struct rb_root syms;
struct symbol *(*find_symbol)(struct dso *, u64 ip);
unsigned int sym_priv_size;
unsigned char prelinked;
unsigned char adjust_symbols;
char name[0];
};

Expand Down

0 comments on commit ff058a1

Please sign in to comment.