mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 06:42:32 +08:00
binfmt/, binfmt/libelf/, include/nuttx, libs/libc/machine, libs/libc/modlib, and others: Move elf related arch function to include/nuttx/elf.h because the implementation is located in libs/libc/machine and in order to avoid the conflict with the 3rd party libraries and clean up the file inclusion: (1) Remove redundant elf32.h, (2) Remove nuttx/binfmt/elf.h in libs/libc/machine, (2) Remove nuttx/binfmt/elf.h in modlib, and (4) Rmove nuttx/module.h in modlib.
This commit is contained in:
+4
-49
@@ -105,10 +105,6 @@
|
||||
#include <stdbool.h>
|
||||
#include <sched.h>
|
||||
|
||||
#if defined(CONFIG_ELF) || defined(CONFIG_MODULE)
|
||||
# include <elf32.h>
|
||||
#endif
|
||||
|
||||
#include <arch/arch.h>
|
||||
|
||||
/****************************************************************************
|
||||
@@ -1323,55 +1319,14 @@ int up_shmdt(uintptr_t vaddr, unsigned int npages);
|
||||
|
||||
/****************************************************************************
|
||||
* Interfaces required for ELF module support
|
||||
****************************************************************************/
|
||||
/****************************************************************************
|
||||
* Name: up_checkarch
|
||||
*
|
||||
* Description:
|
||||
* Given the ELF header in 'hdr', verify that the module is appropriate
|
||||
* for the current, configured architecture. Every architecture that uses
|
||||
* the module loader must provide this function.
|
||||
*
|
||||
* Input Parameters:
|
||||
* hdr - The ELF header read from the module file.
|
||||
*
|
||||
* Returned Value:
|
||||
* True if the architecture supports this module file.
|
||||
* up_checkarch - Perform architecture-specific ELF check
|
||||
* up_relocate - Perform architecture-specific ELF relocation
|
||||
* up_relocateadd - Perform architecture-specific ELF relocation
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_ELF) || defined(CONFIG_MODULE)
|
||||
bool up_checkarch(FAR const Elf32_Ehdr *hdr);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_relocate and up_relocateadd
|
||||
*
|
||||
* Description:
|
||||
* Perform on architecture-specific ELF relocation. Every architecture
|
||||
* that uses the module loader must provide this function.
|
||||
*
|
||||
* Input Parameters:
|
||||
* rel - The relocation type
|
||||
* sym - The ELF symbol structure containing the fully resolved value.
|
||||
* There are a few relocation types for a few architectures that do
|
||||
* not require symbol information. For those, this value will be
|
||||
* NULL. Implementations of these functions must be able to handle
|
||||
* that case.
|
||||
* addr - The address that requires the relocation.
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) if the relocation was successful. Otherwise, a negated errno
|
||||
* value indicating the cause of the relocation failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_ELF) || defined(CONFIG_MODULE)
|
||||
int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
||||
uintptr_t addr);
|
||||
int up_relocateadd(FAR const Elf32_Rela *rel,
|
||||
FAR const Elf32_Sym *sym, uintptr_t addr);
|
||||
#endif
|
||||
/* See prototype in include/nuttx/elf.h */
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_coherent_dcache
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <nxflat.h>
|
||||
|
||||
#include <nuttx/arch.h>
|
||||
#include <nuttx/sched.h>
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
#include <elf32.h>
|
||||
|
||||
#include <nuttx/arch.h>
|
||||
#include <nuttx/module.h>
|
||||
#include <nuttx/symtab.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
@@ -136,7 +136,7 @@ struct mod_info_s
|
||||
mod_uninitializer_t uninitializer; /* Module uninitializer */
|
||||
FAR void *arg; /* Uninitializer argument */
|
||||
FAR const struct symtab_s *exports; /* Symbols exported by module */
|
||||
unsigned int nexports; /* Number of symobols in exports list */
|
||||
unsigned int nexports; /* Number of symbols in exports list */
|
||||
};
|
||||
|
||||
/* A NuttX module is expected to export a function called module_initialize()
|
||||
@@ -161,7 +161,6 @@ typedef CODE int (*mod_callback_t)(FAR struct module_s *modp, FAR void *arg);
|
||||
|
||||
/* This describes the file to be loaded. */
|
||||
|
||||
struct symtab_s;
|
||||
struct module_s
|
||||
{
|
||||
FAR struct module_s *flink; /* Supports a singly linked list */
|
||||
@@ -221,8 +220,6 @@ struct mod_loadinfo_s
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
struct symtab_s;
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
Reference in New Issue
Block a user