annotate agent/src/os/bsd/salibelf.h @ 3525:a0c4bf029c0f

Merge from jdk7u4 repository
author Greg Lewis <glewis@eyesbeyond.com>
date Thu, 17 May 2012 16:11:29 -0700
parents 84983ac597f8 f08d439fab8c
children
rev   line source
never@3009 1 /*
never@3009 2 * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
never@3009 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
never@3009 4 *
never@3009 5 * This code is free software; you can redistribute it and/or modify it
never@3009 6 * under the terms of the GNU General Public License version 2 only, as
never@3009 7 * published by the Free Software Foundation.
never@3009 8 *
never@3009 9 * This code is distributed in the hope that it will be useful, but WITHOUT
never@3009 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
never@3009 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
never@3009 12 * version 2 for more details (a copy is included in the LICENSE file that
never@3009 13 * accompanied this code).
never@3009 14 *
never@3009 15 * You should have received a copy of the GNU General Public License version
never@3009 16 * 2 along with this work; if not, write to the Free Software Foundation,
never@3009 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
never@3009 18 *
never@3009 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
never@3009 20 * or visit www.oracle.com if you need additional information or have any
never@3009 21 * questions.
never@3009 22 *
never@3009 23 */
never@3009 24
never@3009 25 #ifndef _SALIBELF_H_
never@3009 26 #define _SALIBELF_H_
never@3009 27
never@3009 28 #include <elf.h>
never@3009 29 #include "elfmacros.h"
never@3009 30 #include "libproc_impl.h"
never@3009 31
never@3009 32 // read ELF file header.
never@3009 33 int read_elf_header(int fd, ELF_EHDR* ehdr);
never@3009 34
never@3009 35 // is given file descriptor corresponds to an ELF file?
never@3009 36 bool is_elf_file(int fd);
never@3009 37
never@3009 38 // read program header table of an ELF file. caller has to
never@3009 39 // free the result pointer after use. NULL on failure.
never@3009 40 ELF_PHDR* read_program_header_table(int fd, ELF_EHDR* hdr);
never@3009 41
never@3009 42 // read section header table of an ELF file. caller has to
never@3009 43 // free the result pointer after use. NULL on failure.
never@3009 44 ELF_SHDR* read_section_header_table(int fd, ELF_EHDR* hdr);
never@3009 45
never@3009 46 // read a particular section's data. caller has to free the
never@3009 47 // result pointer after use. NULL on failure.
never@3009 48 void* read_section_data(int fd, ELF_EHDR* ehdr, ELF_SHDR* shdr);
never@3009 49
never@3009 50 // find the base address at which the library wants to load itself
never@3009 51 uintptr_t find_base_address(int fd, ELF_EHDR* ehdr);
never@3009 52 #endif /* _SALIBELF_H_ */