1 /* AArch64 specific symbolic name handling.
2 Copyright (C) 2013, 2015 Red Hat, Inc.
3 This file is part of elfutils.
5 This file is free software; you can redistribute it and/or modify
6 it under the terms of either
8 * the GNU Lesser General Public License as published by the Free
9 Software Foundation; either version 3 of the License, or (at
10 your option) any later version
14 * the GNU General Public License as published by the Free
15 Software Foundation; either version 2 of the License, or (at
16 your option) any later version
18 or both in parallel, as here.
20 elfutils is distributed in the hope that it will be useful, but
21 WITHOUT ANY WARRANTY; without even the implied warranty of
22 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 General Public License for more details.
25 You should have received copies of the GNU General Public License and
26 the GNU Lesser General Public License along with this program. If
27 not, see <http://www.gnu.org/licenses/>. */
37 #define BACKEND aarch64_
38 #include "libebl_CPU.h"
41 /* Check for the simple reloc types. */
43 aarch64_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type)
59 /* If this is the _GLOBAL_OFFSET_TABLE_ symbol, then it should point in
60 the .got even if there is a .got.plt section.
61 https://sourceware.org/ml/libc-ports/2013-06/msg00057.html
62 https://bugzilla.redhat.com/show_bug.cgi?id=1201778
65 aarch64_check_special_symbol (Elf *elf, GElf_Ehdr *ehdr, const GElf_Sym *sym,
66 const char *name, const GElf_Shdr *destshdr)
69 && strcmp (name, "_GLOBAL_OFFSET_TABLE_") == 0)
71 const char *sname = elf_strptr (elf, ehdr->e_shstrndx, destshdr->sh_name);
73 && (strcmp (sname, ".got") == 0 || strcmp (sname, ".got.plt") == 0))
76 while ((scn = elf_nextscn (elf, scn)) != NULL)
79 GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
82 sname = elf_strptr (elf, ehdr->e_shstrndx, shdr->sh_name);
83 if (sname != NULL && strcmp (sname, ".got") == 0)
84 return (sym->st_value >= shdr->sh_addr
85 && sym->st_value < shdr->sh_addr + shdr->sh_size);