incubator-nuttx/tools/build-globals.sh

139 lines
3.7 KiB
Bash
Raw Normal View History

#!/usr/bin/env bash
############################################################################
# tools/build-globals.sh
Add support for the loading of ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Fix cast of error message parameters * build-globals.sh - Build the modlib_globals.S file used to resolve symbols when dynamically loading * libs/libc/modlib/Make.defs - Build modlib_globals.S for all targets * libs/libc/modlib/modlib_load.c - Calculate sizes and text/data addresses based on program headers rather than section headers - Handle objects with no program headers * libs/libc/modlib/modlib_bind.c - Call modlib_readsym with pointer to symbol table - Add modlib_relocatedyn to manage relocation of symbols with shared object (ET_DYN) - Differentiate between ET_REL and ET_DYN objects - Use arch independent symbol ELF_R_SYM - Cast sizes to avoid warnings * libs/libc/modlib/modlib_load.c - Cast sizes to avoid warnings * include/elf.h - Add definitions that may be found in shared objects * include/nuttx/lib/modlib.h - Add parameter to modlib_readsym prototype - Add prototypes for: - modlib_insertsymtab - modlib_findglobal - Define Elf_Dyn and Elf_Off according to the elf architecture - Add fields to mod_loadifno_s: - Program headers - Exported symbols - Data section address - Padding requirement - Section index for dynamic symbol table - Number of symbols exported - Add prottotype for modlib_freesymtab * libs/libc/dlfcn/lib_dlclose.c - Free the symbol table when the dll is closed * libs/libc/dlfcn/lib_dlopen.c - Add dump of program headers to debug routine - Differentiate between ET_REL and ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Add handling of R_ARM_RELATIVE and R_ARM_JUMP slot relocation types * libs/libc/modlib/modlib_loadshdrs.c - Rename modlib_loadshdrs.c to modlib_loadhdrs.c - Rename modlib_loadshdrs to modlib_loadhdrs - Add code to load program headers * libs/libc/modlib/modlib_symbols.c - Define entry point structure - Add offset parameter to modlib_symname() and use to find symbol names - Add symtab section header parameter to modlib_readsym() - Add offset parameter to modlib_symvalue() to locate symbol names - Add modlib_insertsyntab() to create a symbol table for exporting and resolution - Add findEP() to resolve a symbol in the modlib_global table - Add modlib_findglobal() to find symbol in the modlib_global table - Add modlib_freesymtab() to free the symbol table * libs/libc/modlib/modlib_uninit.c - Free header and sections from a module_loadinfo_s control block * libs/libc/modlib/modlib_verify.c - Handle ET_DYN shared objects * libs/libc/modlib/modlib_globals.S - Multi-target global table - Define library APIs that may be resolved when loading a shared object
2022-09-26 14:22:03 +08:00
#
# SPDX-License-Identifier: Apache-2.0
#
# 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
Add support for the loading of ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Fix cast of error message parameters * build-globals.sh - Build the modlib_globals.S file used to resolve symbols when dynamically loading * libs/libc/modlib/Make.defs - Build modlib_globals.S for all targets * libs/libc/modlib/modlib_load.c - Calculate sizes and text/data addresses based on program headers rather than section headers - Handle objects with no program headers * libs/libc/modlib/modlib_bind.c - Call modlib_readsym with pointer to symbol table - Add modlib_relocatedyn to manage relocation of symbols with shared object (ET_DYN) - Differentiate between ET_REL and ET_DYN objects - Use arch independent symbol ELF_R_SYM - Cast sizes to avoid warnings * libs/libc/modlib/modlib_load.c - Cast sizes to avoid warnings * include/elf.h - Add definitions that may be found in shared objects * include/nuttx/lib/modlib.h - Add parameter to modlib_readsym prototype - Add prototypes for: - modlib_insertsymtab - modlib_findglobal - Define Elf_Dyn and Elf_Off according to the elf architecture - Add fields to mod_loadifno_s: - Program headers - Exported symbols - Data section address - Padding requirement - Section index for dynamic symbol table - Number of symbols exported - Add prottotype for modlib_freesymtab * libs/libc/dlfcn/lib_dlclose.c - Free the symbol table when the dll is closed * libs/libc/dlfcn/lib_dlopen.c - Add dump of program headers to debug routine - Differentiate between ET_REL and ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Add handling of R_ARM_RELATIVE and R_ARM_JUMP slot relocation types * libs/libc/modlib/modlib_loadshdrs.c - Rename modlib_loadshdrs.c to modlib_loadhdrs.c - Rename modlib_loadshdrs to modlib_loadhdrs - Add code to load program headers * libs/libc/modlib/modlib_symbols.c - Define entry point structure - Add offset parameter to modlib_symname() and use to find symbol names - Add symtab section header parameter to modlib_readsym() - Add offset parameter to modlib_symvalue() to locate symbol names - Add modlib_insertsyntab() to create a symbol table for exporting and resolution - Add findEP() to resolve a symbol in the modlib_global table - Add modlib_findglobal() to find symbol in the modlib_global table - Add modlib_freesymtab() to free the symbol table * libs/libc/modlib/modlib_uninit.c - Free header and sections from a module_loadinfo_s control block * libs/libc/modlib/modlib_verify.c - Handle ET_DYN shared objects * libs/libc/modlib/modlib_globals.S - Multi-target global table - Define library APIs that may be resolved when loading a shared object
2022-09-26 14:22:03 +08:00
#
# http://www.apache.org/licenses/LICENSE-2.0
Add support for the loading of ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Fix cast of error message parameters * build-globals.sh - Build the modlib_globals.S file used to resolve symbols when dynamically loading * libs/libc/modlib/Make.defs - Build modlib_globals.S for all targets * libs/libc/modlib/modlib_load.c - Calculate sizes and text/data addresses based on program headers rather than section headers - Handle objects with no program headers * libs/libc/modlib/modlib_bind.c - Call modlib_readsym with pointer to symbol table - Add modlib_relocatedyn to manage relocation of symbols with shared object (ET_DYN) - Differentiate between ET_REL and ET_DYN objects - Use arch independent symbol ELF_R_SYM - Cast sizes to avoid warnings * libs/libc/modlib/modlib_load.c - Cast sizes to avoid warnings * include/elf.h - Add definitions that may be found in shared objects * include/nuttx/lib/modlib.h - Add parameter to modlib_readsym prototype - Add prototypes for: - modlib_insertsymtab - modlib_findglobal - Define Elf_Dyn and Elf_Off according to the elf architecture - Add fields to mod_loadifno_s: - Program headers - Exported symbols - Data section address - Padding requirement - Section index for dynamic symbol table - Number of symbols exported - Add prottotype for modlib_freesymtab * libs/libc/dlfcn/lib_dlclose.c - Free the symbol table when the dll is closed * libs/libc/dlfcn/lib_dlopen.c - Add dump of program headers to debug routine - Differentiate between ET_REL and ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Add handling of R_ARM_RELATIVE and R_ARM_JUMP slot relocation types * libs/libc/modlib/modlib_loadshdrs.c - Rename modlib_loadshdrs.c to modlib_loadhdrs.c - Rename modlib_loadshdrs to modlib_loadhdrs - Add code to load program headers * libs/libc/modlib/modlib_symbols.c - Define entry point structure - Add offset parameter to modlib_symname() and use to find symbol names - Add symtab section header parameter to modlib_readsym() - Add offset parameter to modlib_symvalue() to locate symbol names - Add modlib_insertsyntab() to create a symbol table for exporting and resolution - Add findEP() to resolve a symbol in the modlib_global table - Add modlib_findglobal() to find symbol in the modlib_global table - Add modlib_freesymtab() to free the symbol table * libs/libc/modlib/modlib_uninit.c - Free header and sections from a module_loadinfo_s control block * libs/libc/modlib/modlib_verify.c - Handle ET_DYN shared objects * libs/libc/modlib/modlib_globals.S - Multi-target global table - Define library APIs that may be resolved when loading a shared object
2022-09-26 14:22:03 +08: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.
Add support for the loading of ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Fix cast of error message parameters * build-globals.sh - Build the modlib_globals.S file used to resolve symbols when dynamically loading * libs/libc/modlib/Make.defs - Build modlib_globals.S for all targets * libs/libc/modlib/modlib_load.c - Calculate sizes and text/data addresses based on program headers rather than section headers - Handle objects with no program headers * libs/libc/modlib/modlib_bind.c - Call modlib_readsym with pointer to symbol table - Add modlib_relocatedyn to manage relocation of symbols with shared object (ET_DYN) - Differentiate between ET_REL and ET_DYN objects - Use arch independent symbol ELF_R_SYM - Cast sizes to avoid warnings * libs/libc/modlib/modlib_load.c - Cast sizes to avoid warnings * include/elf.h - Add definitions that may be found in shared objects * include/nuttx/lib/modlib.h - Add parameter to modlib_readsym prototype - Add prototypes for: - modlib_insertsymtab - modlib_findglobal - Define Elf_Dyn and Elf_Off according to the elf architecture - Add fields to mod_loadifno_s: - Program headers - Exported symbols - Data section address - Padding requirement - Section index for dynamic symbol table - Number of symbols exported - Add prottotype for modlib_freesymtab * libs/libc/dlfcn/lib_dlclose.c - Free the symbol table when the dll is closed * libs/libc/dlfcn/lib_dlopen.c - Add dump of program headers to debug routine - Differentiate between ET_REL and ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Add handling of R_ARM_RELATIVE and R_ARM_JUMP slot relocation types * libs/libc/modlib/modlib_loadshdrs.c - Rename modlib_loadshdrs.c to modlib_loadhdrs.c - Rename modlib_loadshdrs to modlib_loadhdrs - Add code to load program headers * libs/libc/modlib/modlib_symbols.c - Define entry point structure - Add offset parameter to modlib_symname() and use to find symbol names - Add symtab section header parameter to modlib_readsym() - Add offset parameter to modlib_symvalue() to locate symbol names - Add modlib_insertsyntab() to create a symbol table for exporting and resolution - Add findEP() to resolve a symbol in the modlib_global table - Add modlib_findglobal() to find symbol in the modlib_global table - Add modlib_freesymtab() to free the symbol table * libs/libc/modlib/modlib_uninit.c - Free header and sections from a module_loadinfo_s control block * libs/libc/modlib/modlib_verify.c - Handle ET_DYN shared objects * libs/libc/modlib/modlib_globals.S - Multi-target global table - Define library APIs that may be resolved when loading a shared object
2022-09-26 14:22:03 +08:00
#
############################################################################
Add support for the loading of ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Fix cast of error message parameters * build-globals.sh - Build the modlib_globals.S file used to resolve symbols when dynamically loading * libs/libc/modlib/Make.defs - Build modlib_globals.S for all targets * libs/libc/modlib/modlib_load.c - Calculate sizes and text/data addresses based on program headers rather than section headers - Handle objects with no program headers * libs/libc/modlib/modlib_bind.c - Call modlib_readsym with pointer to symbol table - Add modlib_relocatedyn to manage relocation of symbols with shared object (ET_DYN) - Differentiate between ET_REL and ET_DYN objects - Use arch independent symbol ELF_R_SYM - Cast sizes to avoid warnings * libs/libc/modlib/modlib_load.c - Cast sizes to avoid warnings * include/elf.h - Add definitions that may be found in shared objects * include/nuttx/lib/modlib.h - Add parameter to modlib_readsym prototype - Add prototypes for: - modlib_insertsymtab - modlib_findglobal - Define Elf_Dyn and Elf_Off according to the elf architecture - Add fields to mod_loadifno_s: - Program headers - Exported symbols - Data section address - Padding requirement - Section index for dynamic symbol table - Number of symbols exported - Add prottotype for modlib_freesymtab * libs/libc/dlfcn/lib_dlclose.c - Free the symbol table when the dll is closed * libs/libc/dlfcn/lib_dlopen.c - Add dump of program headers to debug routine - Differentiate between ET_REL and ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Add handling of R_ARM_RELATIVE and R_ARM_JUMP slot relocation types * libs/libc/modlib/modlib_loadshdrs.c - Rename modlib_loadshdrs.c to modlib_loadhdrs.c - Rename modlib_loadshdrs to modlib_loadhdrs - Add code to load program headers * libs/libc/modlib/modlib_symbols.c - Define entry point structure - Add offset parameter to modlib_symname() and use to find symbol names - Add symtab section header parameter to modlib_readsym() - Add offset parameter to modlib_symvalue() to locate symbol names - Add modlib_insertsyntab() to create a symbol table for exporting and resolution - Add findEP() to resolve a symbol in the modlib_global table - Add modlib_findglobal() to find symbol in the modlib_global table - Add modlib_freesymtab() to free the symbol table * libs/libc/modlib/modlib_uninit.c - Free header and sections from a module_loadinfo_s control block * libs/libc/modlib/modlib_verify.c - Handle ET_DYN shared objects * libs/libc/modlib/modlib_globals.S - Multi-target global table - Define library APIs that may be resolved when loading a shared object
2022-09-26 14:22:03 +08:00
#
# Script to create modlib_global.S which contains a structure define
# the API names and addresses we will export for resolving symbols in
# dynamic loaded shared objects. Typically these are libc APIs.
Add support for the loading of ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Fix cast of error message parameters * build-globals.sh - Build the modlib_globals.S file used to resolve symbols when dynamically loading * libs/libc/modlib/Make.defs - Build modlib_globals.S for all targets * libs/libc/modlib/modlib_load.c - Calculate sizes and text/data addresses based on program headers rather than section headers - Handle objects with no program headers * libs/libc/modlib/modlib_bind.c - Call modlib_readsym with pointer to symbol table - Add modlib_relocatedyn to manage relocation of symbols with shared object (ET_DYN) - Differentiate between ET_REL and ET_DYN objects - Use arch independent symbol ELF_R_SYM - Cast sizes to avoid warnings * libs/libc/modlib/modlib_load.c - Cast sizes to avoid warnings * include/elf.h - Add definitions that may be found in shared objects * include/nuttx/lib/modlib.h - Add parameter to modlib_readsym prototype - Add prototypes for: - modlib_insertsymtab - modlib_findglobal - Define Elf_Dyn and Elf_Off according to the elf architecture - Add fields to mod_loadifno_s: - Program headers - Exported symbols - Data section address - Padding requirement - Section index for dynamic symbol table - Number of symbols exported - Add prottotype for modlib_freesymtab * libs/libc/dlfcn/lib_dlclose.c - Free the symbol table when the dll is closed * libs/libc/dlfcn/lib_dlopen.c - Add dump of program headers to debug routine - Differentiate between ET_REL and ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Add handling of R_ARM_RELATIVE and R_ARM_JUMP slot relocation types * libs/libc/modlib/modlib_loadshdrs.c - Rename modlib_loadshdrs.c to modlib_loadhdrs.c - Rename modlib_loadshdrs to modlib_loadhdrs - Add code to load program headers * libs/libc/modlib/modlib_symbols.c - Define entry point structure - Add offset parameter to modlib_symname() and use to find symbol names - Add symtab section header parameter to modlib_readsym() - Add offset parameter to modlib_symvalue() to locate symbol names - Add modlib_insertsyntab() to create a symbol table for exporting and resolution - Add findEP() to resolve a symbol in the modlib_global table - Add modlib_findglobal() to find symbol in the modlib_global table - Add modlib_freesymtab() to free the symbol table * libs/libc/modlib/modlib_uninit.c - Free header and sections from a module_loadinfo_s control block * libs/libc/modlib/modlib_verify.c - Handle ET_DYN shared objects * libs/libc/modlib/modlib_globals.S - Multi-target global table - Define library APIs that may be resolved when loading a shared object
2022-09-26 14:22:03 +08:00
#
# Symbols to ignore within the NuttX libraries
#
FILTER="^lib_low|^FUNCTION|^STUB|^__start|^_vect|^arm_|^arp_|^bch|^binfmt|^blake|^block_|^cdcacm|^chksum|^clock_|^close_|^crypto_|^devif_|^devnull|^devuran|^devzero|^emerg|^epoll_|^elf_|^_dbgR|^dq_|^env_|^file_|^files_|^fs_|^ftl_|^g_|^get_|^group_|^global|^hcom|^i2c_|^inode_|^iob_|^irq_|^kmm_|^lfs_|^lib_|^local_|^mm_|^modlib_|^mpu_|^mq_|^nglobals|^net_|^netdev_|^nx|^pipecommon|^posix_spawn_file|^psock_|^ramlog|^rammap|^readline_|^register_|^sched_|^sockfd|^spawn_|^sq_|^stm32|^symtab_|^syslog_|^syslogstream|^task_|^tcp_|^timer_|^uart_|^ub[12]|^udp_|^umm_|^umount|^unload_|^unregister|^up_|^usb|^usrsock_|^watchdog|^wd_|globalNames$|nglobals$|global_table$|^\.l"
if [ -z "${NM}" ]; then
NM="nm"
fi
Add support for the loading of ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Fix cast of error message parameters * build-globals.sh - Build the modlib_globals.S file used to resolve symbols when dynamically loading * libs/libc/modlib/Make.defs - Build modlib_globals.S for all targets * libs/libc/modlib/modlib_load.c - Calculate sizes and text/data addresses based on program headers rather than section headers - Handle objects with no program headers * libs/libc/modlib/modlib_bind.c - Call modlib_readsym with pointer to symbol table - Add modlib_relocatedyn to manage relocation of symbols with shared object (ET_DYN) - Differentiate between ET_REL and ET_DYN objects - Use arch independent symbol ELF_R_SYM - Cast sizes to avoid warnings * libs/libc/modlib/modlib_load.c - Cast sizes to avoid warnings * include/elf.h - Add definitions that may be found in shared objects * include/nuttx/lib/modlib.h - Add parameter to modlib_readsym prototype - Add prototypes for: - modlib_insertsymtab - modlib_findglobal - Define Elf_Dyn and Elf_Off according to the elf architecture - Add fields to mod_loadifno_s: - Program headers - Exported symbols - Data section address - Padding requirement - Section index for dynamic symbol table - Number of symbols exported - Add prottotype for modlib_freesymtab * libs/libc/dlfcn/lib_dlclose.c - Free the symbol table when the dll is closed * libs/libc/dlfcn/lib_dlopen.c - Add dump of program headers to debug routine - Differentiate between ET_REL and ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Add handling of R_ARM_RELATIVE and R_ARM_JUMP slot relocation types * libs/libc/modlib/modlib_loadshdrs.c - Rename modlib_loadshdrs.c to modlib_loadhdrs.c - Rename modlib_loadshdrs to modlib_loadhdrs - Add code to load program headers * libs/libc/modlib/modlib_symbols.c - Define entry point structure - Add offset parameter to modlib_symname() and use to find symbol names - Add symtab section header parameter to modlib_readsym() - Add offset parameter to modlib_symvalue() to locate symbol names - Add modlib_insertsyntab() to create a symbol table for exporting and resolution - Add findEP() to resolve a symbol in the modlib_global table - Add modlib_findglobal() to find symbol in the modlib_global table - Add modlib_freesymtab() to free the symbol table * libs/libc/modlib/modlib_uninit.c - Free header and sections from a module_loadinfo_s control block * libs/libc/modlib/modlib_verify.c - Handle ET_DYN shared objects * libs/libc/modlib/modlib_globals.S - Multi-target global table - Define library APIs that may be resolved when loading a shared object
2022-09-26 14:22:03 +08:00
#
# Extract symbols from the runtime
#
SYMS=`cat System.map | awk '{print $3}' | sort | grep -Ev ${FILTER}`
Add support for the loading of ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Fix cast of error message parameters * build-globals.sh - Build the modlib_globals.S file used to resolve symbols when dynamically loading * libs/libc/modlib/Make.defs - Build modlib_globals.S for all targets * libs/libc/modlib/modlib_load.c - Calculate sizes and text/data addresses based on program headers rather than section headers - Handle objects with no program headers * libs/libc/modlib/modlib_bind.c - Call modlib_readsym with pointer to symbol table - Add modlib_relocatedyn to manage relocation of symbols with shared object (ET_DYN) - Differentiate between ET_REL and ET_DYN objects - Use arch independent symbol ELF_R_SYM - Cast sizes to avoid warnings * libs/libc/modlib/modlib_load.c - Cast sizes to avoid warnings * include/elf.h - Add definitions that may be found in shared objects * include/nuttx/lib/modlib.h - Add parameter to modlib_readsym prototype - Add prototypes for: - modlib_insertsymtab - modlib_findglobal - Define Elf_Dyn and Elf_Off according to the elf architecture - Add fields to mod_loadifno_s: - Program headers - Exported symbols - Data section address - Padding requirement - Section index for dynamic symbol table - Number of symbols exported - Add prottotype for modlib_freesymtab * libs/libc/dlfcn/lib_dlclose.c - Free the symbol table when the dll is closed * libs/libc/dlfcn/lib_dlopen.c - Add dump of program headers to debug routine - Differentiate between ET_REL and ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Add handling of R_ARM_RELATIVE and R_ARM_JUMP slot relocation types * libs/libc/modlib/modlib_loadshdrs.c - Rename modlib_loadshdrs.c to modlib_loadhdrs.c - Rename modlib_loadshdrs to modlib_loadhdrs - Add code to load program headers * libs/libc/modlib/modlib_symbols.c - Define entry point structure - Add offset parameter to modlib_symname() and use to find symbol names - Add symtab section header parameter to modlib_readsym() - Add offset parameter to modlib_symvalue() to locate symbol names - Add modlib_insertsyntab() to create a symbol table for exporting and resolution - Add findEP() to resolve a symbol in the modlib_global table - Add modlib_findglobal() to find symbol in the modlib_global table - Add modlib_freesymtab() to free the symbol table * libs/libc/modlib/modlib_uninit.c - Free header and sections from a module_loadinfo_s control block * libs/libc/modlib/modlib_verify.c - Handle ET_DYN shared objects * libs/libc/modlib/modlib_globals.S - Multi-target global table - Define library APIs that may be resolved when loading a shared object
2022-09-26 14:22:03 +08:00
SYM=(${SYMS})
GLOBALS="libs/libc/modlib/modlib_globals.S"
Add support for the loading of ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Fix cast of error message parameters * build-globals.sh - Build the modlib_globals.S file used to resolve symbols when dynamically loading * libs/libc/modlib/Make.defs - Build modlib_globals.S for all targets * libs/libc/modlib/modlib_load.c - Calculate sizes and text/data addresses based on program headers rather than section headers - Handle objects with no program headers * libs/libc/modlib/modlib_bind.c - Call modlib_readsym with pointer to symbol table - Add modlib_relocatedyn to manage relocation of symbols with shared object (ET_DYN) - Differentiate between ET_REL and ET_DYN objects - Use arch independent symbol ELF_R_SYM - Cast sizes to avoid warnings * libs/libc/modlib/modlib_load.c - Cast sizes to avoid warnings * include/elf.h - Add definitions that may be found in shared objects * include/nuttx/lib/modlib.h - Add parameter to modlib_readsym prototype - Add prototypes for: - modlib_insertsymtab - modlib_findglobal - Define Elf_Dyn and Elf_Off according to the elf architecture - Add fields to mod_loadifno_s: - Program headers - Exported symbols - Data section address - Padding requirement - Section index for dynamic symbol table - Number of symbols exported - Add prottotype for modlib_freesymtab * libs/libc/dlfcn/lib_dlclose.c - Free the symbol table when the dll is closed * libs/libc/dlfcn/lib_dlopen.c - Add dump of program headers to debug routine - Differentiate between ET_REL and ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Add handling of R_ARM_RELATIVE and R_ARM_JUMP slot relocation types * libs/libc/modlib/modlib_loadshdrs.c - Rename modlib_loadshdrs.c to modlib_loadhdrs.c - Rename modlib_loadshdrs to modlib_loadhdrs - Add code to load program headers * libs/libc/modlib/modlib_symbols.c - Define entry point structure - Add offset parameter to modlib_symname() and use to find symbol names - Add symtab section header parameter to modlib_readsym() - Add offset parameter to modlib_symvalue() to locate symbol names - Add modlib_insertsyntab() to create a symbol table for exporting and resolution - Add findEP() to resolve a symbol in the modlib_global table - Add modlib_findglobal() to find symbol in the modlib_global table - Add modlib_freesymtab() to free the symbol table * libs/libc/modlib/modlib_uninit.c - Free header and sections from a module_loadinfo_s control block * libs/libc/modlib/modlib_verify.c - Handle ET_DYN shared objects * libs/libc/modlib/modlib_globals.S - Multi-target global table - Define library APIs that may be resolved when loading a shared object
2022-09-26 14:22:03 +08:00
#
# Generate the modlib_xxxx_globals.S file
#
cat >${GLOBALS} <<__EOF__
#ifdef __CYGWIN__
# define SYMBOL(s) _##s
# define GLOBAL .global
# define SECTION .data
.macro GLOBAL ep
.global SYMBOL(\ep)
.type SYMBOL(\ep), "object"
.endm
.macro SIZE ep
.endm
#elif defined(__ELF__)
# define SYMBOL(s) s
# define SECTION .data
.macro GLOBAL ep
.global SYMBOL(\ep)
.type SYMBOL(\ep), "object"
.endm
.macro SIZE ep
.size SYMBOL(\ep), . - SYMBOL(\ep)
.endm
#else
# define SYMBOL(s) _##s
# define SECTION .section __DATA,__data
.macro GLOBAL ep
.private_extern SYMBOL(\ep)
.globl SYMBOL(\ep)
.endm
.macro SIZE ep
.endm
#endif
Add support for the loading of ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Fix cast of error message parameters * build-globals.sh - Build the modlib_globals.S file used to resolve symbols when dynamically loading * libs/libc/modlib/Make.defs - Build modlib_globals.S for all targets * libs/libc/modlib/modlib_load.c - Calculate sizes and text/data addresses based on program headers rather than section headers - Handle objects with no program headers * libs/libc/modlib/modlib_bind.c - Call modlib_readsym with pointer to symbol table - Add modlib_relocatedyn to manage relocation of symbols with shared object (ET_DYN) - Differentiate between ET_REL and ET_DYN objects - Use arch independent symbol ELF_R_SYM - Cast sizes to avoid warnings * libs/libc/modlib/modlib_load.c - Cast sizes to avoid warnings * include/elf.h - Add definitions that may be found in shared objects * include/nuttx/lib/modlib.h - Add parameter to modlib_readsym prototype - Add prototypes for: - modlib_insertsymtab - modlib_findglobal - Define Elf_Dyn and Elf_Off according to the elf architecture - Add fields to mod_loadifno_s: - Program headers - Exported symbols - Data section address - Padding requirement - Section index for dynamic symbol table - Number of symbols exported - Add prottotype for modlib_freesymtab * libs/libc/dlfcn/lib_dlclose.c - Free the symbol table when the dll is closed * libs/libc/dlfcn/lib_dlopen.c - Add dump of program headers to debug routine - Differentiate between ET_REL and ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Add handling of R_ARM_RELATIVE and R_ARM_JUMP slot relocation types * libs/libc/modlib/modlib_loadshdrs.c - Rename modlib_loadshdrs.c to modlib_loadhdrs.c - Rename modlib_loadshdrs to modlib_loadhdrs - Add code to load program headers * libs/libc/modlib/modlib_symbols.c - Define entry point structure - Add offset parameter to modlib_symname() and use to find symbol names - Add symtab section header parameter to modlib_readsym() - Add offset parameter to modlib_symvalue() to locate symbol names - Add modlib_insertsyntab() to create a symbol table for exporting and resolution - Add findEP() to resolve a symbol in the modlib_global table - Add modlib_findglobal() to find symbol in the modlib_global table - Add modlib_freesymtab() to free the symbol table * libs/libc/modlib/modlib_uninit.c - Free header and sections from a module_loadinfo_s control block * libs/libc/modlib/modlib_verify.c - Handle ET_DYN shared objects * libs/libc/modlib/modlib_globals.S - Multi-target global table - Define library APIs that may be resolved when loading a shared object
2022-09-26 14:22:03 +08:00
#if __SIZEOF_POINTER__ == 8
.macro globalEntry index, ep
.quad .l\index
.quad \ep
Add support for the loading of ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Fix cast of error message parameters * build-globals.sh - Build the modlib_globals.S file used to resolve symbols when dynamically loading * libs/libc/modlib/Make.defs - Build modlib_globals.S for all targets * libs/libc/modlib/modlib_load.c - Calculate sizes and text/data addresses based on program headers rather than section headers - Handle objects with no program headers * libs/libc/modlib/modlib_bind.c - Call modlib_readsym with pointer to symbol table - Add modlib_relocatedyn to manage relocation of symbols with shared object (ET_DYN) - Differentiate between ET_REL and ET_DYN objects - Use arch independent symbol ELF_R_SYM - Cast sizes to avoid warnings * libs/libc/modlib/modlib_load.c - Cast sizes to avoid warnings * include/elf.h - Add definitions that may be found in shared objects * include/nuttx/lib/modlib.h - Add parameter to modlib_readsym prototype - Add prototypes for: - modlib_insertsymtab - modlib_findglobal - Define Elf_Dyn and Elf_Off according to the elf architecture - Add fields to mod_loadifno_s: - Program headers - Exported symbols - Data section address - Padding requirement - Section index for dynamic symbol table - Number of symbols exported - Add prottotype for modlib_freesymtab * libs/libc/dlfcn/lib_dlclose.c - Free the symbol table when the dll is closed * libs/libc/dlfcn/lib_dlopen.c - Add dump of program headers to debug routine - Differentiate between ET_REL and ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Add handling of R_ARM_RELATIVE and R_ARM_JUMP slot relocation types * libs/libc/modlib/modlib_loadshdrs.c - Rename modlib_loadshdrs.c to modlib_loadhdrs.c - Rename modlib_loadshdrs to modlib_loadhdrs - Add code to load program headers * libs/libc/modlib/modlib_symbols.c - Define entry point structure - Add offset parameter to modlib_symname() and use to find symbol names - Add symtab section header parameter to modlib_readsym() - Add offset parameter to modlib_symvalue() to locate symbol names - Add modlib_insertsyntab() to create a symbol table for exporting and resolution - Add findEP() to resolve a symbol in the modlib_global table - Add modlib_findglobal() to find symbol in the modlib_global table - Add modlib_freesymtab() to free the symbol table * libs/libc/modlib/modlib_uninit.c - Free header and sections from a module_loadinfo_s control block * libs/libc/modlib/modlib_verify.c - Handle ET_DYN shared objects * libs/libc/modlib/modlib_globals.S - Multi-target global table - Define library APIs that may be resolved when loading a shared object
2022-09-26 14:22:03 +08:00
.endm
# define ALIGN 8
#else
.macro globalEntry index, ep
.long .l\index
.long \ep
Add support for the loading of ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Fix cast of error message parameters * build-globals.sh - Build the modlib_globals.S file used to resolve symbols when dynamically loading * libs/libc/modlib/Make.defs - Build modlib_globals.S for all targets * libs/libc/modlib/modlib_load.c - Calculate sizes and text/data addresses based on program headers rather than section headers - Handle objects with no program headers * libs/libc/modlib/modlib_bind.c - Call modlib_readsym with pointer to symbol table - Add modlib_relocatedyn to manage relocation of symbols with shared object (ET_DYN) - Differentiate between ET_REL and ET_DYN objects - Use arch independent symbol ELF_R_SYM - Cast sizes to avoid warnings * libs/libc/modlib/modlib_load.c - Cast sizes to avoid warnings * include/elf.h - Add definitions that may be found in shared objects * include/nuttx/lib/modlib.h - Add parameter to modlib_readsym prototype - Add prototypes for: - modlib_insertsymtab - modlib_findglobal - Define Elf_Dyn and Elf_Off according to the elf architecture - Add fields to mod_loadifno_s: - Program headers - Exported symbols - Data section address - Padding requirement - Section index for dynamic symbol table - Number of symbols exported - Add prottotype for modlib_freesymtab * libs/libc/dlfcn/lib_dlclose.c - Free the symbol table when the dll is closed * libs/libc/dlfcn/lib_dlopen.c - Add dump of program headers to debug routine - Differentiate between ET_REL and ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Add handling of R_ARM_RELATIVE and R_ARM_JUMP slot relocation types * libs/libc/modlib/modlib_loadshdrs.c - Rename modlib_loadshdrs.c to modlib_loadhdrs.c - Rename modlib_loadshdrs to modlib_loadhdrs - Add code to load program headers * libs/libc/modlib/modlib_symbols.c - Define entry point structure - Add offset parameter to modlib_symname() and use to find symbol names - Add symtab section header parameter to modlib_readsym() - Add offset parameter to modlib_symvalue() to locate symbol names - Add modlib_insertsyntab() to create a symbol table for exporting and resolution - Add findEP() to resolve a symbol in the modlib_global table - Add modlib_findglobal() to find symbol in the modlib_global table - Add modlib_freesymtab() to free the symbol table * libs/libc/modlib/modlib_uninit.c - Free header and sections from a module_loadinfo_s control block * libs/libc/modlib/modlib_verify.c - Handle ET_DYN shared objects * libs/libc/modlib/modlib_globals.S - Multi-target global table - Define library APIs that may be resolved when loading a shared object
2022-09-26 14:22:03 +08:00
.endm
# define ALIGN 4
#endif
#ifdef __ARM_ARCH_ISA_THUMB2
# ifdef __ARM_ARCH_7M__
.arch armv7e-m
Add support for the loading of ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Fix cast of error message parameters * build-globals.sh - Build the modlib_globals.S file used to resolve symbols when dynamically loading * libs/libc/modlib/Make.defs - Build modlib_globals.S for all targets * libs/libc/modlib/modlib_load.c - Calculate sizes and text/data addresses based on program headers rather than section headers - Handle objects with no program headers * libs/libc/modlib/modlib_bind.c - Call modlib_readsym with pointer to symbol table - Add modlib_relocatedyn to manage relocation of symbols with shared object (ET_DYN) - Differentiate between ET_REL and ET_DYN objects - Use arch independent symbol ELF_R_SYM - Cast sizes to avoid warnings * libs/libc/modlib/modlib_load.c - Cast sizes to avoid warnings * include/elf.h - Add definitions that may be found in shared objects * include/nuttx/lib/modlib.h - Add parameter to modlib_readsym prototype - Add prototypes for: - modlib_insertsymtab - modlib_findglobal - Define Elf_Dyn and Elf_Off according to the elf architecture - Add fields to mod_loadifno_s: - Program headers - Exported symbols - Data section address - Padding requirement - Section index for dynamic symbol table - Number of symbols exported - Add prottotype for modlib_freesymtab * libs/libc/dlfcn/lib_dlclose.c - Free the symbol table when the dll is closed * libs/libc/dlfcn/lib_dlopen.c - Add dump of program headers to debug routine - Differentiate between ET_REL and ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Add handling of R_ARM_RELATIVE and R_ARM_JUMP slot relocation types * libs/libc/modlib/modlib_loadshdrs.c - Rename modlib_loadshdrs.c to modlib_loadhdrs.c - Rename modlib_loadshdrs to modlib_loadhdrs - Add code to load program headers * libs/libc/modlib/modlib_symbols.c - Define entry point structure - Add offset parameter to modlib_symname() and use to find symbol names - Add symtab section header parameter to modlib_readsym() - Add offset parameter to modlib_symvalue() to locate symbol names - Add modlib_insertsyntab() to create a symbol table for exporting and resolution - Add findEP() to resolve a symbol in the modlib_global table - Add modlib_findglobal() to find symbol in the modlib_global table - Add modlib_freesymtab() to free the symbol table * libs/libc/modlib/modlib_uninit.c - Free header and sections from a module_loadinfo_s control block * libs/libc/modlib/modlib_verify.c - Handle ET_DYN shared objects * libs/libc/modlib/modlib_globals.S - Multi-target global table - Define library APIs that may be resolved when loading a shared object
2022-09-26 14:22:03 +08:00
# elif defined ___ARM_ARCH 8
.arch armv8-m.base
#endif
#ifdef __ARM_ASM_SYNTAX_UNIFIED__
.syntax unified
Add support for the loading of ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Fix cast of error message parameters * build-globals.sh - Build the modlib_globals.S file used to resolve symbols when dynamically loading * libs/libc/modlib/Make.defs - Build modlib_globals.S for all targets * libs/libc/modlib/modlib_load.c - Calculate sizes and text/data addresses based on program headers rather than section headers - Handle objects with no program headers * libs/libc/modlib/modlib_bind.c - Call modlib_readsym with pointer to symbol table - Add modlib_relocatedyn to manage relocation of symbols with shared object (ET_DYN) - Differentiate between ET_REL and ET_DYN objects - Use arch independent symbol ELF_R_SYM - Cast sizes to avoid warnings * libs/libc/modlib/modlib_load.c - Cast sizes to avoid warnings * include/elf.h - Add definitions that may be found in shared objects * include/nuttx/lib/modlib.h - Add parameter to modlib_readsym prototype - Add prototypes for: - modlib_insertsymtab - modlib_findglobal - Define Elf_Dyn and Elf_Off according to the elf architecture - Add fields to mod_loadifno_s: - Program headers - Exported symbols - Data section address - Padding requirement - Section index for dynamic symbol table - Number of symbols exported - Add prottotype for modlib_freesymtab * libs/libc/dlfcn/lib_dlclose.c - Free the symbol table when the dll is closed * libs/libc/dlfcn/lib_dlopen.c - Add dump of program headers to debug routine - Differentiate between ET_REL and ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Add handling of R_ARM_RELATIVE and R_ARM_JUMP slot relocation types * libs/libc/modlib/modlib_loadshdrs.c - Rename modlib_loadshdrs.c to modlib_loadhdrs.c - Rename modlib_loadshdrs to modlib_loadhdrs - Add code to load program headers * libs/libc/modlib/modlib_symbols.c - Define entry point structure - Add offset parameter to modlib_symname() and use to find symbol names - Add symtab section header parameter to modlib_readsym() - Add offset parameter to modlib_symvalue() to locate symbol names - Add modlib_insertsyntab() to create a symbol table for exporting and resolution - Add findEP() to resolve a symbol in the modlib_global table - Add modlib_findglobal() to find symbol in the modlib_global table - Add modlib_freesymtab() to free the symbol table * libs/libc/modlib/modlib_uninit.c - Free header and sections from a module_loadinfo_s control block * libs/libc/modlib/modlib_verify.c - Handle ET_DYN shared objects * libs/libc/modlib/modlib_globals.S - Multi-target global table - Define library APIs that may be resolved when loading a shared object
2022-09-26 14:22:03 +08:00
#endif
.thumb
Add support for the loading of ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Fix cast of error message parameters * build-globals.sh - Build the modlib_globals.S file used to resolve symbols when dynamically loading * libs/libc/modlib/Make.defs - Build modlib_globals.S for all targets * libs/libc/modlib/modlib_load.c - Calculate sizes and text/data addresses based on program headers rather than section headers - Handle objects with no program headers * libs/libc/modlib/modlib_bind.c - Call modlib_readsym with pointer to symbol table - Add modlib_relocatedyn to manage relocation of symbols with shared object (ET_DYN) - Differentiate between ET_REL and ET_DYN objects - Use arch independent symbol ELF_R_SYM - Cast sizes to avoid warnings * libs/libc/modlib/modlib_load.c - Cast sizes to avoid warnings * include/elf.h - Add definitions that may be found in shared objects * include/nuttx/lib/modlib.h - Add parameter to modlib_readsym prototype - Add prototypes for: - modlib_insertsymtab - modlib_findglobal - Define Elf_Dyn and Elf_Off according to the elf architecture - Add fields to mod_loadifno_s: - Program headers - Exported symbols - Data section address - Padding requirement - Section index for dynamic symbol table - Number of symbols exported - Add prottotype for modlib_freesymtab * libs/libc/dlfcn/lib_dlclose.c - Free the symbol table when the dll is closed * libs/libc/dlfcn/lib_dlopen.c - Add dump of program headers to debug routine - Differentiate between ET_REL and ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Add handling of R_ARM_RELATIVE and R_ARM_JUMP slot relocation types * libs/libc/modlib/modlib_loadshdrs.c - Rename modlib_loadshdrs.c to modlib_loadhdrs.c - Rename modlib_loadshdrs to modlib_loadhdrs - Add code to load program headers * libs/libc/modlib/modlib_symbols.c - Define entry point structure - Add offset parameter to modlib_symname() and use to find symbol names - Add symtab section header parameter to modlib_readsym() - Add offset parameter to modlib_symvalue() to locate symbol names - Add modlib_insertsyntab() to create a symbol table for exporting and resolution - Add findEP() to resolve a symbol in the modlib_global table - Add modlib_findglobal() to find symbol in the modlib_global table - Add modlib_freesymtab() to free the symbol table * libs/libc/modlib/modlib_uninit.c - Free header and sections from a module_loadinfo_s control block * libs/libc/modlib/modlib_verify.c - Handle ET_DYN shared objects * libs/libc/modlib/modlib_globals.S - Multi-target global table - Define library APIs that may be resolved when loading a shared object
2022-09-26 14:22:03 +08:00
#endif
.data
.align ALIGN
GLOBAL globalNames
Add support for the loading of ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Fix cast of error message parameters * build-globals.sh - Build the modlib_globals.S file used to resolve symbols when dynamically loading * libs/libc/modlib/Make.defs - Build modlib_globals.S for all targets * libs/libc/modlib/modlib_load.c - Calculate sizes and text/data addresses based on program headers rather than section headers - Handle objects with no program headers * libs/libc/modlib/modlib_bind.c - Call modlib_readsym with pointer to symbol table - Add modlib_relocatedyn to manage relocation of symbols with shared object (ET_DYN) - Differentiate between ET_REL and ET_DYN objects - Use arch independent symbol ELF_R_SYM - Cast sizes to avoid warnings * libs/libc/modlib/modlib_load.c - Cast sizes to avoid warnings * include/elf.h - Add definitions that may be found in shared objects * include/nuttx/lib/modlib.h - Add parameter to modlib_readsym prototype - Add prototypes for: - modlib_insertsymtab - modlib_findglobal - Define Elf_Dyn and Elf_Off according to the elf architecture - Add fields to mod_loadifno_s: - Program headers - Exported symbols - Data section address - Padding requirement - Section index for dynamic symbol table - Number of symbols exported - Add prottotype for modlib_freesymtab * libs/libc/dlfcn/lib_dlclose.c - Free the symbol table when the dll is closed * libs/libc/dlfcn/lib_dlopen.c - Add dump of program headers to debug routine - Differentiate between ET_REL and ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Add handling of R_ARM_RELATIVE and R_ARM_JUMP slot relocation types * libs/libc/modlib/modlib_loadshdrs.c - Rename modlib_loadshdrs.c to modlib_loadhdrs.c - Rename modlib_loadshdrs to modlib_loadhdrs - Add code to load program headers * libs/libc/modlib/modlib_symbols.c - Define entry point structure - Add offset parameter to modlib_symname() and use to find symbol names - Add symtab section header parameter to modlib_readsym() - Add offset parameter to modlib_symvalue() to locate symbol names - Add modlib_insertsyntab() to create a symbol table for exporting and resolution - Add findEP() to resolve a symbol in the modlib_global table - Add modlib_findglobal() to find symbol in the modlib_global table - Add modlib_freesymtab() to free the symbol table * libs/libc/modlib/modlib_uninit.c - Free header and sections from a module_loadinfo_s control block * libs/libc/modlib/modlib_verify.c - Handle ET_DYN shared objects * libs/libc/modlib/modlib_globals.S - Multi-target global table - Define library APIs that may be resolved when loading a shared object
2022-09-26 14:22:03 +08:00
SYMBOL(globalNames):
Add support for the loading of ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Fix cast of error message parameters * build-globals.sh - Build the modlib_globals.S file used to resolve symbols when dynamically loading * libs/libc/modlib/Make.defs - Build modlib_globals.S for all targets * libs/libc/modlib/modlib_load.c - Calculate sizes and text/data addresses based on program headers rather than section headers - Handle objects with no program headers * libs/libc/modlib/modlib_bind.c - Call modlib_readsym with pointer to symbol table - Add modlib_relocatedyn to manage relocation of symbols with shared object (ET_DYN) - Differentiate between ET_REL and ET_DYN objects - Use arch independent symbol ELF_R_SYM - Cast sizes to avoid warnings * libs/libc/modlib/modlib_load.c - Cast sizes to avoid warnings * include/elf.h - Add definitions that may be found in shared objects * include/nuttx/lib/modlib.h - Add parameter to modlib_readsym prototype - Add prototypes for: - modlib_insertsymtab - modlib_findglobal - Define Elf_Dyn and Elf_Off according to the elf architecture - Add fields to mod_loadifno_s: - Program headers - Exported symbols - Data section address - Padding requirement - Section index for dynamic symbol table - Number of symbols exported - Add prottotype for modlib_freesymtab * libs/libc/dlfcn/lib_dlclose.c - Free the symbol table when the dll is closed * libs/libc/dlfcn/lib_dlopen.c - Add dump of program headers to debug routine - Differentiate between ET_REL and ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Add handling of R_ARM_RELATIVE and R_ARM_JUMP slot relocation types * libs/libc/modlib/modlib_loadshdrs.c - Rename modlib_loadshdrs.c to modlib_loadhdrs.c - Rename modlib_loadshdrs to modlib_loadhdrs - Add code to load program headers * libs/libc/modlib/modlib_symbols.c - Define entry point structure - Add offset parameter to modlib_symname() and use to find symbol names - Add symtab section header parameter to modlib_readsym() - Add offset parameter to modlib_symvalue() to locate symbol names - Add modlib_insertsyntab() to create a symbol table for exporting and resolution - Add findEP() to resolve a symbol in the modlib_global table - Add modlib_findglobal() to find symbol in the modlib_global table - Add modlib_freesymtab() to free the symbol table * libs/libc/modlib/modlib_uninit.c - Free header and sections from a module_loadinfo_s control block * libs/libc/modlib/modlib_verify.c - Handle ET_DYN shared objects * libs/libc/modlib/modlib_globals.S - Multi-target global table - Define library APIs that may be resolved when loading a shared object
2022-09-26 14:22:03 +08:00
__EOF__
for ((i = 0; i < ${#SYM[@]}; i++))
Add support for the loading of ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Fix cast of error message parameters * build-globals.sh - Build the modlib_globals.S file used to resolve symbols when dynamically loading * libs/libc/modlib/Make.defs - Build modlib_globals.S for all targets * libs/libc/modlib/modlib_load.c - Calculate sizes and text/data addresses based on program headers rather than section headers - Handle objects with no program headers * libs/libc/modlib/modlib_bind.c - Call modlib_readsym with pointer to symbol table - Add modlib_relocatedyn to manage relocation of symbols with shared object (ET_DYN) - Differentiate between ET_REL and ET_DYN objects - Use arch independent symbol ELF_R_SYM - Cast sizes to avoid warnings * libs/libc/modlib/modlib_load.c - Cast sizes to avoid warnings * include/elf.h - Add definitions that may be found in shared objects * include/nuttx/lib/modlib.h - Add parameter to modlib_readsym prototype - Add prototypes for: - modlib_insertsymtab - modlib_findglobal - Define Elf_Dyn and Elf_Off according to the elf architecture - Add fields to mod_loadifno_s: - Program headers - Exported symbols - Data section address - Padding requirement - Section index for dynamic symbol table - Number of symbols exported - Add prottotype for modlib_freesymtab * libs/libc/dlfcn/lib_dlclose.c - Free the symbol table when the dll is closed * libs/libc/dlfcn/lib_dlopen.c - Add dump of program headers to debug routine - Differentiate between ET_REL and ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Add handling of R_ARM_RELATIVE and R_ARM_JUMP slot relocation types * libs/libc/modlib/modlib_loadshdrs.c - Rename modlib_loadshdrs.c to modlib_loadhdrs.c - Rename modlib_loadshdrs to modlib_loadhdrs - Add code to load program headers * libs/libc/modlib/modlib_symbols.c - Define entry point structure - Add offset parameter to modlib_symname() and use to find symbol names - Add symtab section header parameter to modlib_readsym() - Add offset parameter to modlib_symvalue() to locate symbol names - Add modlib_insertsyntab() to create a symbol table for exporting and resolution - Add findEP() to resolve a symbol in the modlib_global table - Add modlib_findglobal() to find symbol in the modlib_global table - Add modlib_freesymtab() to free the symbol table * libs/libc/modlib/modlib_uninit.c - Free header and sections from a module_loadinfo_s control block * libs/libc/modlib/modlib_verify.c - Handle ET_DYN shared objects * libs/libc/modlib/modlib_globals.S - Multi-target global table - Define library APIs that may be resolved when loading a shared object
2022-09-26 14:22:03 +08:00
do
echo ".l${i}: .string \"${SYM[$i]}\"" >>${GLOBALS}
Add support for the loading of ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Fix cast of error message parameters * build-globals.sh - Build the modlib_globals.S file used to resolve symbols when dynamically loading * libs/libc/modlib/Make.defs - Build modlib_globals.S for all targets * libs/libc/modlib/modlib_load.c - Calculate sizes and text/data addresses based on program headers rather than section headers - Handle objects with no program headers * libs/libc/modlib/modlib_bind.c - Call modlib_readsym with pointer to symbol table - Add modlib_relocatedyn to manage relocation of symbols with shared object (ET_DYN) - Differentiate between ET_REL and ET_DYN objects - Use arch independent symbol ELF_R_SYM - Cast sizes to avoid warnings * libs/libc/modlib/modlib_load.c - Cast sizes to avoid warnings * include/elf.h - Add definitions that may be found in shared objects * include/nuttx/lib/modlib.h - Add parameter to modlib_readsym prototype - Add prototypes for: - modlib_insertsymtab - modlib_findglobal - Define Elf_Dyn and Elf_Off according to the elf architecture - Add fields to mod_loadifno_s: - Program headers - Exported symbols - Data section address - Padding requirement - Section index for dynamic symbol table - Number of symbols exported - Add prottotype for modlib_freesymtab * libs/libc/dlfcn/lib_dlclose.c - Free the symbol table when the dll is closed * libs/libc/dlfcn/lib_dlopen.c - Add dump of program headers to debug routine - Differentiate between ET_REL and ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Add handling of R_ARM_RELATIVE and R_ARM_JUMP slot relocation types * libs/libc/modlib/modlib_loadshdrs.c - Rename modlib_loadshdrs.c to modlib_loadhdrs.c - Rename modlib_loadshdrs to modlib_loadhdrs - Add code to load program headers * libs/libc/modlib/modlib_symbols.c - Define entry point structure - Add offset parameter to modlib_symname() and use to find symbol names - Add symtab section header parameter to modlib_readsym() - Add offset parameter to modlib_symvalue() to locate symbol names - Add modlib_insertsyntab() to create a symbol table for exporting and resolution - Add findEP() to resolve a symbol in the modlib_global table - Add modlib_findglobal() to find symbol in the modlib_global table - Add modlib_freesymtab() to free the symbol table * libs/libc/modlib/modlib_uninit.c - Free header and sections from a module_loadinfo_s control block * libs/libc/modlib/modlib_verify.c - Handle ET_DYN shared objects * libs/libc/modlib/modlib_globals.S - Multi-target global table - Define library APIs that may be resolved when loading a shared object
2022-09-26 14:22:03 +08:00
done
cat >>${GLOBALS} <<__EOF__
SIZE globalNames
Add support for the loading of ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Fix cast of error message parameters * build-globals.sh - Build the modlib_globals.S file used to resolve symbols when dynamically loading * libs/libc/modlib/Make.defs - Build modlib_globals.S for all targets * libs/libc/modlib/modlib_load.c - Calculate sizes and text/data addresses based on program headers rather than section headers - Handle objects with no program headers * libs/libc/modlib/modlib_bind.c - Call modlib_readsym with pointer to symbol table - Add modlib_relocatedyn to manage relocation of symbols with shared object (ET_DYN) - Differentiate between ET_REL and ET_DYN objects - Use arch independent symbol ELF_R_SYM - Cast sizes to avoid warnings * libs/libc/modlib/modlib_load.c - Cast sizes to avoid warnings * include/elf.h - Add definitions that may be found in shared objects * include/nuttx/lib/modlib.h - Add parameter to modlib_readsym prototype - Add prototypes for: - modlib_insertsymtab - modlib_findglobal - Define Elf_Dyn and Elf_Off according to the elf architecture - Add fields to mod_loadifno_s: - Program headers - Exported symbols - Data section address - Padding requirement - Section index for dynamic symbol table - Number of symbols exported - Add prottotype for modlib_freesymtab * libs/libc/dlfcn/lib_dlclose.c - Free the symbol table when the dll is closed * libs/libc/dlfcn/lib_dlopen.c - Add dump of program headers to debug routine - Differentiate between ET_REL and ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Add handling of R_ARM_RELATIVE and R_ARM_JUMP slot relocation types * libs/libc/modlib/modlib_loadshdrs.c - Rename modlib_loadshdrs.c to modlib_loadhdrs.c - Rename modlib_loadshdrs to modlib_loadhdrs - Add code to load program headers * libs/libc/modlib/modlib_symbols.c - Define entry point structure - Add offset parameter to modlib_symname() and use to find symbol names - Add symtab section header parameter to modlib_readsym() - Add offset parameter to modlib_symvalue() to locate symbol names - Add modlib_insertsyntab() to create a symbol table for exporting and resolution - Add findEP() to resolve a symbol in the modlib_global table - Add modlib_findglobal() to find symbol in the modlib_global table - Add modlib_freesymtab() to free the symbol table * libs/libc/modlib/modlib_uninit.c - Free header and sections from a module_loadinfo_s control block * libs/libc/modlib/modlib_verify.c - Handle ET_DYN shared objects * libs/libc/modlib/modlib_globals.S - Multi-target global table - Define library APIs that may be resolved when loading a shared object
2022-09-26 14:22:03 +08:00
.align ALIGN
GLOBAL nglobals
SYMBOL(nglobals):
.word ${#SYM[@]}
SIZE nglobals
Add support for the loading of ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Fix cast of error message parameters * build-globals.sh - Build the modlib_globals.S file used to resolve symbols when dynamically loading * libs/libc/modlib/Make.defs - Build modlib_globals.S for all targets * libs/libc/modlib/modlib_load.c - Calculate sizes and text/data addresses based on program headers rather than section headers - Handle objects with no program headers * libs/libc/modlib/modlib_bind.c - Call modlib_readsym with pointer to symbol table - Add modlib_relocatedyn to manage relocation of symbols with shared object (ET_DYN) - Differentiate between ET_REL and ET_DYN objects - Use arch independent symbol ELF_R_SYM - Cast sizes to avoid warnings * libs/libc/modlib/modlib_load.c - Cast sizes to avoid warnings * include/elf.h - Add definitions that may be found in shared objects * include/nuttx/lib/modlib.h - Add parameter to modlib_readsym prototype - Add prototypes for: - modlib_insertsymtab - modlib_findglobal - Define Elf_Dyn and Elf_Off according to the elf architecture - Add fields to mod_loadifno_s: - Program headers - Exported symbols - Data section address - Padding requirement - Section index for dynamic symbol table - Number of symbols exported - Add prottotype for modlib_freesymtab * libs/libc/dlfcn/lib_dlclose.c - Free the symbol table when the dll is closed * libs/libc/dlfcn/lib_dlopen.c - Add dump of program headers to debug routine - Differentiate between ET_REL and ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Add handling of R_ARM_RELATIVE and R_ARM_JUMP slot relocation types * libs/libc/modlib/modlib_loadshdrs.c - Rename modlib_loadshdrs.c to modlib_loadhdrs.c - Rename modlib_loadshdrs to modlib_loadhdrs - Add code to load program headers * libs/libc/modlib/modlib_symbols.c - Define entry point structure - Add offset parameter to modlib_symname() and use to find symbol names - Add symtab section header parameter to modlib_readsym() - Add offset parameter to modlib_symvalue() to locate symbol names - Add modlib_insertsyntab() to create a symbol table for exporting and resolution - Add findEP() to resolve a symbol in the modlib_global table - Add modlib_findglobal() to find symbol in the modlib_global table - Add modlib_freesymtab() to free the symbol table * libs/libc/modlib/modlib_uninit.c - Free header and sections from a module_loadinfo_s control block * libs/libc/modlib/modlib_verify.c - Handle ET_DYN shared objects * libs/libc/modlib/modlib_globals.S - Multi-target global table - Define library APIs that may be resolved when loading a shared object
2022-09-26 14:22:03 +08:00
.align ALIGN
GLOBAL global_table
SYMBOL(global_table):
Add support for the loading of ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Fix cast of error message parameters * build-globals.sh - Build the modlib_globals.S file used to resolve symbols when dynamically loading * libs/libc/modlib/Make.defs - Build modlib_globals.S for all targets * libs/libc/modlib/modlib_load.c - Calculate sizes and text/data addresses based on program headers rather than section headers - Handle objects with no program headers * libs/libc/modlib/modlib_bind.c - Call modlib_readsym with pointer to symbol table - Add modlib_relocatedyn to manage relocation of symbols with shared object (ET_DYN) - Differentiate between ET_REL and ET_DYN objects - Use arch independent symbol ELF_R_SYM - Cast sizes to avoid warnings * libs/libc/modlib/modlib_load.c - Cast sizes to avoid warnings * include/elf.h - Add definitions that may be found in shared objects * include/nuttx/lib/modlib.h - Add parameter to modlib_readsym prototype - Add prototypes for: - modlib_insertsymtab - modlib_findglobal - Define Elf_Dyn and Elf_Off according to the elf architecture - Add fields to mod_loadifno_s: - Program headers - Exported symbols - Data section address - Padding requirement - Section index for dynamic symbol table - Number of symbols exported - Add prottotype for modlib_freesymtab * libs/libc/dlfcn/lib_dlclose.c - Free the symbol table when the dll is closed * libs/libc/dlfcn/lib_dlopen.c - Add dump of program headers to debug routine - Differentiate between ET_REL and ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Add handling of R_ARM_RELATIVE and R_ARM_JUMP slot relocation types * libs/libc/modlib/modlib_loadshdrs.c - Rename modlib_loadshdrs.c to modlib_loadhdrs.c - Rename modlib_loadshdrs to modlib_loadhdrs - Add code to load program headers * libs/libc/modlib/modlib_symbols.c - Define entry point structure - Add offset parameter to modlib_symname() and use to find symbol names - Add symtab section header parameter to modlib_readsym() - Add offset parameter to modlib_symvalue() to locate symbol names - Add modlib_insertsyntab() to create a symbol table for exporting and resolution - Add findEP() to resolve a symbol in the modlib_global table - Add modlib_findglobal() to find symbol in the modlib_global table - Add modlib_freesymtab() to free the symbol table * libs/libc/modlib/modlib_uninit.c - Free header and sections from a module_loadinfo_s control block * libs/libc/modlib/modlib_verify.c - Handle ET_DYN shared objects * libs/libc/modlib/modlib_globals.S - Multi-target global table - Define library APIs that may be resolved when loading a shared object
2022-09-26 14:22:03 +08:00
__EOF__
for ((i = 0; i < ${#SYM[@]}; i++))
Add support for the loading of ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Fix cast of error message parameters * build-globals.sh - Build the modlib_globals.S file used to resolve symbols when dynamically loading * libs/libc/modlib/Make.defs - Build modlib_globals.S for all targets * libs/libc/modlib/modlib_load.c - Calculate sizes and text/data addresses based on program headers rather than section headers - Handle objects with no program headers * libs/libc/modlib/modlib_bind.c - Call modlib_readsym with pointer to symbol table - Add modlib_relocatedyn to manage relocation of symbols with shared object (ET_DYN) - Differentiate between ET_REL and ET_DYN objects - Use arch independent symbol ELF_R_SYM - Cast sizes to avoid warnings * libs/libc/modlib/modlib_load.c - Cast sizes to avoid warnings * include/elf.h - Add definitions that may be found in shared objects * include/nuttx/lib/modlib.h - Add parameter to modlib_readsym prototype - Add prototypes for: - modlib_insertsymtab - modlib_findglobal - Define Elf_Dyn and Elf_Off according to the elf architecture - Add fields to mod_loadifno_s: - Program headers - Exported symbols - Data section address - Padding requirement - Section index for dynamic symbol table - Number of symbols exported - Add prottotype for modlib_freesymtab * libs/libc/dlfcn/lib_dlclose.c - Free the symbol table when the dll is closed * libs/libc/dlfcn/lib_dlopen.c - Add dump of program headers to debug routine - Differentiate between ET_REL and ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Add handling of R_ARM_RELATIVE and R_ARM_JUMP slot relocation types * libs/libc/modlib/modlib_loadshdrs.c - Rename modlib_loadshdrs.c to modlib_loadhdrs.c - Rename modlib_loadshdrs to modlib_loadhdrs - Add code to load program headers * libs/libc/modlib/modlib_symbols.c - Define entry point structure - Add offset parameter to modlib_symname() and use to find symbol names - Add symtab section header parameter to modlib_readsym() - Add offset parameter to modlib_symvalue() to locate symbol names - Add modlib_insertsyntab() to create a symbol table for exporting and resolution - Add findEP() to resolve a symbol in the modlib_global table - Add modlib_findglobal() to find symbol in the modlib_global table - Add modlib_freesymtab() to free the symbol table * libs/libc/modlib/modlib_uninit.c - Free header and sections from a module_loadinfo_s control block * libs/libc/modlib/modlib_verify.c - Handle ET_DYN shared objects * libs/libc/modlib/modlib_globals.S - Multi-target global table - Define library APIs that may be resolved when loading a shared object
2022-09-26 14:22:03 +08:00
do
echo " globalEntry ${i}, ${SYM[$i]}" >>${GLOBALS}
Add support for the loading of ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Fix cast of error message parameters * build-globals.sh - Build the modlib_globals.S file used to resolve symbols when dynamically loading * libs/libc/modlib/Make.defs - Build modlib_globals.S for all targets * libs/libc/modlib/modlib_load.c - Calculate sizes and text/data addresses based on program headers rather than section headers - Handle objects with no program headers * libs/libc/modlib/modlib_bind.c - Call modlib_readsym with pointer to symbol table - Add modlib_relocatedyn to manage relocation of symbols with shared object (ET_DYN) - Differentiate between ET_REL and ET_DYN objects - Use arch independent symbol ELF_R_SYM - Cast sizes to avoid warnings * libs/libc/modlib/modlib_load.c - Cast sizes to avoid warnings * include/elf.h - Add definitions that may be found in shared objects * include/nuttx/lib/modlib.h - Add parameter to modlib_readsym prototype - Add prototypes for: - modlib_insertsymtab - modlib_findglobal - Define Elf_Dyn and Elf_Off according to the elf architecture - Add fields to mod_loadifno_s: - Program headers - Exported symbols - Data section address - Padding requirement - Section index for dynamic symbol table - Number of symbols exported - Add prottotype for modlib_freesymtab * libs/libc/dlfcn/lib_dlclose.c - Free the symbol table when the dll is closed * libs/libc/dlfcn/lib_dlopen.c - Add dump of program headers to debug routine - Differentiate between ET_REL and ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Add handling of R_ARM_RELATIVE and R_ARM_JUMP slot relocation types * libs/libc/modlib/modlib_loadshdrs.c - Rename modlib_loadshdrs.c to modlib_loadhdrs.c - Rename modlib_loadshdrs to modlib_loadhdrs - Add code to load program headers * libs/libc/modlib/modlib_symbols.c - Define entry point structure - Add offset parameter to modlib_symname() and use to find symbol names - Add symtab section header parameter to modlib_readsym() - Add offset parameter to modlib_symvalue() to locate symbol names - Add modlib_insertsyntab() to create a symbol table for exporting and resolution - Add findEP() to resolve a symbol in the modlib_global table - Add modlib_findglobal() to find symbol in the modlib_global table - Add modlib_freesymtab() to free the symbol table * libs/libc/modlib/modlib_uninit.c - Free header and sections from a module_loadinfo_s control block * libs/libc/modlib/modlib_verify.c - Handle ET_DYN shared objects * libs/libc/modlib/modlib_globals.S - Multi-target global table - Define library APIs that may be resolved when loading a shared object
2022-09-26 14:22:03 +08:00
done
cat >>${GLOBALS} <<__EOF__
SIZE global_table
Add support for the loading of ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Fix cast of error message parameters * build-globals.sh - Build the modlib_globals.S file used to resolve symbols when dynamically loading * libs/libc/modlib/Make.defs - Build modlib_globals.S for all targets * libs/libc/modlib/modlib_load.c - Calculate sizes and text/data addresses based on program headers rather than section headers - Handle objects with no program headers * libs/libc/modlib/modlib_bind.c - Call modlib_readsym with pointer to symbol table - Add modlib_relocatedyn to manage relocation of symbols with shared object (ET_DYN) - Differentiate between ET_REL and ET_DYN objects - Use arch independent symbol ELF_R_SYM - Cast sizes to avoid warnings * libs/libc/modlib/modlib_load.c - Cast sizes to avoid warnings * include/elf.h - Add definitions that may be found in shared objects * include/nuttx/lib/modlib.h - Add parameter to modlib_readsym prototype - Add prototypes for: - modlib_insertsymtab - modlib_findglobal - Define Elf_Dyn and Elf_Off according to the elf architecture - Add fields to mod_loadifno_s: - Program headers - Exported symbols - Data section address - Padding requirement - Section index for dynamic symbol table - Number of symbols exported - Add prottotype for modlib_freesymtab * libs/libc/dlfcn/lib_dlclose.c - Free the symbol table when the dll is closed * libs/libc/dlfcn/lib_dlopen.c - Add dump of program headers to debug routine - Differentiate between ET_REL and ET_DYN objects * libs/libc/machine/arm/armv7-m/arch_elf.c - Add handling of R_ARM_RELATIVE and R_ARM_JUMP slot relocation types * libs/libc/modlib/modlib_loadshdrs.c - Rename modlib_loadshdrs.c to modlib_loadhdrs.c - Rename modlib_loadshdrs to modlib_loadhdrs - Add code to load program headers * libs/libc/modlib/modlib_symbols.c - Define entry point structure - Add offset parameter to modlib_symname() and use to find symbol names - Add symtab section header parameter to modlib_readsym() - Add offset parameter to modlib_symvalue() to locate symbol names - Add modlib_insertsyntab() to create a symbol table for exporting and resolution - Add findEP() to resolve a symbol in the modlib_global table - Add modlib_findglobal() to find symbol in the modlib_global table - Add modlib_freesymtab() to free the symbol table * libs/libc/modlib/modlib_uninit.c - Free header and sections from a module_loadinfo_s control block * libs/libc/modlib/modlib_verify.c - Handle ET_DYN shared objects * libs/libc/modlib/modlib_globals.S - Multi-target global table - Define library APIs that may be resolved when loading a shared object
2022-09-26 14:22:03 +08:00
__EOF__
echo "${#SYM[@]} symbols defined"