diff options
author | Elliott Hughes <enh@google.com> | 2015-02-25 16:51:55 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-02-25 16:51:55 +0000 |
commit | 412f6b917fc658c24dd7d624bb82bf1a1e791b95 (patch) | |
tree | a63e40b5dd9927bd04ec7427c8797975c2a71f85 /src/backends/ppc_symbol.c | |
parent | a969285f70219c5d35ee5aa8ceab0f532fc1e54d (diff) | |
parent | 7401a30e8b3a0de25d7e8a6b635fc33f45894118 (diff) | |
download | android_external_elfutils-412f6b917fc658c24dd7d624bb82bf1a1e791b95.tar.gz android_external_elfutils-412f6b917fc658c24dd7d624bb82bf1a1e791b95.tar.bz2 android_external_elfutils-412f6b917fc658c24dd7d624bb82bf1a1e791b95.zip |
am 7401a30e: am 36e62782: Merge "Upgrade to elfutils 0.161."
* commit '7401a30e8b3a0de25d7e8a6b635fc33f45894118':
Upgrade to elfutils 0.161.
Diffstat (limited to 'src/backends/ppc_symbol.c')
-rw-r--r-- | src/backends/ppc_symbol.c | 51 |
1 files changed, 29 insertions, 22 deletions
diff --git a/src/backends/ppc_symbol.c b/src/backends/ppc_symbol.c index 9540a3e9..c17ab374 100644 --- a/src/backends/ppc_symbol.c +++ b/src/backends/ppc_symbol.c @@ -1,28 +1,31 @@ /* PPC specific symbolic name handling. - Copyright (C) 2004, 2005, 2007 Red Hat, Inc. - This file is part of Red Hat elfutils. + Copyright (C) 2004, 2005, 2007, 2014 Red Hat, Inc. + This file is part of elfutils. Written by Ulrich Drepper <drepper@redhat.com>, 2004. - Red Hat elfutils is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by the - Free Software Foundation; version 2 of the License. + This file is free software; you can redistribute it and/or modify + it under the terms of either - Red Hat elfutils is distributed in the hope that it will be useful, but + * the GNU Lesser General Public License as published by the Free + Software Foundation; either version 3 of the License, or (at + your option) any later version + + or + + * the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at + your option) any later version + + or both in parallel, as here. + + elfutils 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 General Public License for more details. - You should have received a copy of the GNU General Public License along - with Red Hat elfutils; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. - - Red Hat elfutils is an included package of the Open Invention Network. - An included package of the Open Invention Network is a package for which - Open Invention Network licensees cross-license their patents. No patent - license is granted, either expressly or impliedly, by designation as an - included package. Should you wish to participate in the Open Invention - Network licensing program, please visit www.openinventionnetwork.com - <http://www.openinventionnetwork.com>. */ + You should have received copies of the GNU General Public License and + the GNU Lesser General Public License along with this program. If + not, see <http://www.gnu.org/licenses/>. */ #ifdef HAVE_CONFIG_H # include <config.h> @@ -78,9 +81,13 @@ ppc_dynamic_tag_check (int64_t tag) /* Look for DT_PPC_GOT. */ static bool -find_dyn_got (Elf *elf, GElf_Ehdr *ehdr, GElf_Addr *addr) +find_dyn_got (Elf *elf, GElf_Addr *addr) { - for (int i = 0; i < ehdr->e_phnum; ++i) + size_t phnum; + if (elf_getphdrnum (elf, &phnum) != 0) + return false; + + for (size_t i = 0; i < phnum; ++i) { GElf_Phdr phdr_mem; GElf_Phdr *phdr = gelf_getphdr (elf, i, &phdr_mem); @@ -124,7 +131,7 @@ ppc_check_special_symbol (Elf *elf, GElf_Ehdr *ehdr, const GElf_Sym *sym, { /* In -msecure-plt mode, DT_PPC_GOT is present and must match. */ GElf_Addr gotaddr; - if (find_dyn_got (elf, ehdr, &gotaddr)) + if (find_dyn_got (elf, &gotaddr)) return sym->st_value == gotaddr; /* In -mbss-plt mode, any place in the section is valid. */ @@ -151,8 +158,8 @@ ppc_check_special_symbol (Elf *elf, GElf_Ehdr *ehdr, const GElf_Sym *sym, /* Check if backend uses a bss PLT in this file. */ bool -ppc_bss_plt_p (Elf *elf, GElf_Ehdr *ehdr) +ppc_bss_plt_p (Elf *elf) { GElf_Addr addr; - return ! find_dyn_got (elf, ehdr, &addr); + return ! find_dyn_got (elf, &addr); } |