Merge tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
[sfrench/cifs-2.6.git] / tools / perf / arch / s390 / util / sym-handling.c
1 /*
2  * Architecture specific ELF symbol handling and relocation mapping.
3  *
4  * Copyright 2017 IBM Corp.
5  * Author(s): Thomas Richter <tmricht@linux.vnet.ibm.com>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License (version 2 only)
9  * as published by the Free Software Foundation.
10  */
11
12 #include "symbol.h"
13
14 #ifdef HAVE_LIBELF_SUPPORT
15 bool elf__needs_adjust_symbols(GElf_Ehdr ehdr)
16 {
17         if (ehdr.e_type == ET_EXEC)
18                 return false;
19         return ehdr.e_type == ET_REL || ehdr.e_type == ET_DYN;
20 }
21
22 void arch__adjust_sym_map_offset(GElf_Sym *sym,
23                                  GElf_Shdr *shdr __maybe_unused,
24                                  struct map *map)
25 {
26         if (map->type == MAP__FUNCTION)
27                 sym->st_value += map->start;
28 }
29 #endif