1e99af270a60891e68d465c4cd97dbe29cd1a05e4Petr Machata/*
2e99af270a60891e68d465c4cd97dbe29cd1a05e4Petr Machata * This file is part of ltrace.
3e99af270a60891e68d465c4cd97dbe29cd1a05e4Petr Machata * Copyright (C) 2004,2008,2009 Juan Cespedes
4e99af270a60891e68d465c4cd97dbe29cd1a05e4Petr Machata *
5e99af270a60891e68d465c4cd97dbe29cd1a05e4Petr Machata * This program is free software; you can redistribute it and/or
6e99af270a60891e68d465c4cd97dbe29cd1a05e4Petr Machata * modify it under the terms of the GNU General Public License as
7e99af270a60891e68d465c4cd97dbe29cd1a05e4Petr Machata * published by the Free Software Foundation; either version 2 of the
8e99af270a60891e68d465c4cd97dbe29cd1a05e4Petr Machata * License, or (at your option) any later version.
9e99af270a60891e68d465c4cd97dbe29cd1a05e4Petr Machata *
10e99af270a60891e68d465c4cd97dbe29cd1a05e4Petr Machata * This program is distributed in the hope that it will be useful, but
11e99af270a60891e68d465c4cd97dbe29cd1a05e4Petr Machata * WITHOUT ANY WARRANTY; without even the implied warranty of
12e99af270a60891e68d465c4cd97dbe29cd1a05e4Petr Machata * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13e99af270a60891e68d465c4cd97dbe29cd1a05e4Petr Machata * General Public License for more details.
14e99af270a60891e68d465c4cd97dbe29cd1a05e4Petr Machata *
15e99af270a60891e68d465c4cd97dbe29cd1a05e4Petr Machata * You should have received a copy of the GNU General Public License
16e99af270a60891e68d465c4cd97dbe29cd1a05e4Petr Machata * along with this program; if not, write to the Free Software
17e99af270a60891e68d465c4cd97dbe29cd1a05e4Petr Machata * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18e99af270a60891e68d465c4cd97dbe29cd1a05e4Petr Machata * 02110-1301 USA
19e99af270a60891e68d465c4cd97dbe29cd1a05e4Petr Machata */
20e99af270a60891e68d465c4cd97dbe29cd1a05e4Petr Machata
21d914a206a11cc1011a45f00674b1e16988fae77fJuan Cespedes#include <gelf.h>
22366c2f46d844f040458df9b7e35fc3b8527ed2d3Petr Machata#include "proc.h"
23f728123bd75a65a6a1536e198c3c30719e494e71Juan Cespedes#include "common.h"
24d914a206a11cc1011a45f00674b1e16988fae77fJuan Cespedes
25f13505251e6402460f6cc7ec84e0d8ca91607b4fJuan CespedesGElf_Addr
26929bd57ca202fd2f2e8485ebf65d683e664f67b5Petr Machataarch_plt_sym_val(struct ltelf *lte, size_t ndx, GElf_Rela *rela)
27929bd57ca202fd2f2e8485ebf65d683e664f67b5Petr Machata{
282d45b1a8e26a36a9f85dc49e721c4390ca93dc40Ian Wienand	return lte->plt_addr + ndx * 12 + 32;
299a2ad351a1c3215dc596ff3e2e3fd4bc24445a6bIan Wienand}
309a2ad351a1c3215dc596ff3e2e3fd4bc24445a6bIan Wienand
31f13505251e6402460f6cc7ec84e0d8ca91607b4fJuan Cespedesvoid *
32929bd57ca202fd2f2e8485ebf65d683e664f67b5Petr Machatasym2addr(struct process *proc, struct library_symbol *sym)
33929bd57ca202fd2f2e8485ebf65d683e664f67b5Petr Machata{
3476c61f15d7989bf7adffed2e46a44c34a80bd927Paul Gilliam	return sym->enter_addr;
35d914a206a11cc1011a45f00674b1e16988fae77fJuan Cespedes}
36