This repository has been archived by the owner on Dec 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FFI]Inline the missing libc functions for symbol lookup on AIX
The changes aim to support the symbol lookup via FFI for the missing libc functions in loading the default library on AIX by inlining their address into a function list in native to ensure they are correctly invoked with the native address fetched in the FFI code. Signed-off-by: ChengJin01 <jincheng@ca.ibm.com>
- Loading branch information
ChengJin01
committed
Mar 4, 2023
1 parent
f989025
commit 4bc22b2
Showing
2 changed files
with
73 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* =========================================================================== | ||
* (c) Copyright IBM Corp. 2023, 2023 All Rights Reserved | ||
* =========================================================================== | ||
* | ||
* This code is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License version 2 only, as | ||
* published by the Free Software Foundation. | ||
* | ||
* IBM designates this particular file as subject to the "Classpath" exception | ||
* as provided by IBM in the LICENSE file that accompanied this code. | ||
* | ||
* This code 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 | ||
* version 2 for more details (a copy is included in the LICENSE file that | ||
* accompanied this code). | ||
* | ||
* You should have received a copy of the GNU General Public License version | ||
* 2 along with this work; if not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* =========================================================================== | ||
*/ | ||
|
||
#include <fstab.h> | ||
#include <setjmp.h> | ||
#include <string.h> | ||
#include <strings.h> | ||
|
||
/* The function list inlines the libc functions which | ||
* are missing in loading the default library. | ||
*/ | ||
__attribute__((visibility("default"))) void* funcs[] = { | ||
&bcopy, &endfsent, &getfsent, &getfsfile, &getfsspec, &longjmp, | ||
&memcpy, &memmove, &setfsent, &setjmp, &siglongjmp, &strcat, | ||
&strcpy, &strncat, &strncpy | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters