2017-01-23 15:20:24 +01:00
|
|
|
/****************************************************************************
|
2021-03-08 22:39:04 +01:00
|
|
|
* libs/libc/dlfcn/lib_dlsymtab.c
|
2017-01-23 15:20:24 +01:00
|
|
|
*
|
2021-03-02 15:54:21 +01:00
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed with
|
|
|
|
* this work for additional information regarding copyright ownership. The
|
|
|
|
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
|
|
|
* "License"); you may not use this file except in compliance with the
|
|
|
|
* License. You may obtain a copy of the License at
|
2017-01-23 15:20:24 +01:00
|
|
|
*
|
2021-03-02 15:54:21 +01:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2017-01-23 15:20:24 +01:00
|
|
|
*
|
2021-03-02 15:54:21 +01:00
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
|
|
* License for the specific language governing permissions and limitations
|
|
|
|
* under the License.
|
2017-01-23 15:20:24 +01:00
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Included Files
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include <nuttx/config.h>
|
|
|
|
|
2019-02-09 21:09:28 +01:00
|
|
|
#include <dlfcn.h>
|
2017-01-29 20:03:53 +01:00
|
|
|
#include <errno.h>
|
2017-01-23 15:20:24 +01:00
|
|
|
|
|
|
|
#include <nuttx/module.h>
|
2017-01-29 18:54:54 +01:00
|
|
|
#include <nuttx/lib/modlib.h>
|
2017-01-23 15:20:24 +01:00
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public Functions
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: dlsymtab
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* dlsymtab() is a non-standard shared library interface. It selects the
|
2019-01-26 18:39:05 +01:00
|
|
|
* symbol table to use when binding a shared library to the base firmware
|
2017-01-23 15:20:24 +01:00
|
|
|
* which may be in FLASH memory.
|
|
|
|
*
|
|
|
|
* Input Parameters:
|
|
|
|
* symtab - The new symbol table.
|
|
|
|
* nsymbols - The number of symbols in the symbol table.
|
|
|
|
*
|
|
|
|
* Returned Value:
|
|
|
|
* Always returns OK.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
int dlsymtab(FAR const struct symtab_s *symtab, int nsymbols)
|
|
|
|
{
|
2020-04-29 21:21:23 +02:00
|
|
|
#ifdef CONFIG_BUILD_KERNEL
|
2017-01-23 15:20:24 +01:00
|
|
|
/* The KERNEL build is considerably more complex: In order to be shared,
|
|
|
|
* the .text portion of the module must be (1) build for PIC/PID operation
|
|
|
|
* and (2) must like in a shared memory region accessible from all
|
|
|
|
* processes. The .data/.bss portion of the module must be allocated in
|
|
|
|
* the user space of each process, but must lie at the same virtual address
|
|
|
|
* so that it can be referenced from the one copy of the text in the shared
|
|
|
|
* memory region.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#warning Missing logic
|
2017-01-29 20:03:53 +01:00
|
|
|
return -ENOSYS;
|
2020-04-29 21:21:23 +02:00
|
|
|
|
|
|
|
#else
|
|
|
|
/* Set the symbol take information that will be used by this instance of
|
|
|
|
* the module library.
|
|
|
|
*/
|
|
|
|
|
|
|
|
modlib_setsymtab(symtab, nsymbols);
|
|
|
|
return OK;
|
2017-01-23 15:20:24 +01:00
|
|
|
#endif
|
2017-01-29 14:52:44 +01:00
|
|
|
}
|