Path: blob/master/src/java.desktop/aix/native/libawt/porting_aix.h
41149 views
/*1* Copyright (c) 2012, 2018 SAP SE. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*24*/2526/*27* Header file to contain porting-relevant code which does not have a28* home anywhere else.29* This is intially based on hotspot/src/os/aix/vm/{loadlib,porting}_aix.{hpp,cpp}30*/3132/*33* Aix' own version of dladdr().34* This function tries to mimick dladdr(3) on Linux35* (see http://linux.die.net/man/3/dladdr)36* dladdr(3) is not POSIX but a GNU extension, and is not available on AIX.37*38* Differences between AIX dladdr and Linux dladdr:39*40* 1) Dl_info.dli_fbase: can never work, is disabled.41* A loaded image on AIX is divided in multiple segments, at least two42* (text and data) but potentially also far more. This is because the loader may43* load each member into an own segment, as for instance happens with the libC.a44* 2) Dl_info.dli_sname: This only works for code symbols (functions); for data, a45* zero-length string is returned ("").46* 3) Dl_info.dli_saddr: For code, this will return the entry point of the function,47* not the function descriptor.48*/4950typedef struct {51const char *dli_fname; /* file path of loaded library */52void *dli_fbase; /* doesn't make sence on AIX */53const char *dli_sname; /* symbol name; "" if not known */54void *dli_saddr; /* address of *entry* of function; not function descriptor; */55} Dl_info;5657#ifdef __cplusplus58extern "C"59#endif60int dladdr(void *addr, Dl_info *info);616263