Commit Graph

365 Commits

Author SHA1 Message Date
chao.an
7cbb8da692 binfmt/elf: add bare metal coredump support
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-11-23 20:48:00 -06:00
Xiang Xiao
9e60c33d4d binfmt: Remove umm_initialize from elf_load
since umm_try_initialize will do it automatically

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-10-18 22:51:18 -03:00
chao.an
5ff4e33e3f binfmt/Makefile: remove the specified prefix from target variables
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-10-19 00:35:35 +02:00
Jiuzhu Dong
2cfda2bffd binfmt: remove file_ioctl and get filename by strrchr
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-09-13 08:56:10 +08:00
Xiang Xiao
5025fbef8d Rename LIB_ to LIBC_ for all libc Kconfig
follow other libc component naming convention

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-05 19:45:24 +02:00
jordi
f3af6edf93 Kconfig: add quotes in source to clean warnings from setconfig
To avoid the setconfig warning "style: quotes recommended around xxx in
source xxx"
2021-07-23 02:32:19 -07:00
Xiang Xiao
841a4922aa binfmt: Replace all nx_ API with file_ API
since binfmt is a kernel component

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-07-06 11:18:13 +09:00
Abdelatif Guettouche
af5e0c620f Rename MODULE_TEXT to TEXT_HEAP as the latter is more generic.
Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2021-06-18 07:14:17 -05:00
Xiang Xiao
34f31ff3f8 binfmt: Handle argv/argv[0] == NULL correctly in exec_module
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-06-15 13:55:01 -06:00
Xiang Xiao
bec68ad8ea sched/posix_spawn: Don't insert name at the begin of argv
since the standard require the caller pass the name explicitly
https://pubs.opengroup.org/onlinepubs/009695399/functions/posix_spawn.html:
The argument argv is an array of character pointers to null-terminated strings.
The last member of this array shall be a null pointer and is not counted in argc.
These strings constitute the argument list available to the new process image.
The value in argv[0] should point to a filename that is associated with the
process image being started by the posix_spawn() or posix_spawnp() function.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-06-15 07:32:33 -06:00
Xiang Xiao
90f71bd017 Revert "sched/posix_spawn: Don't insert name at the begin of argv"
This reverts commit 032086870d.
2021-06-15 07:32:33 -06:00
Xiang Xiao
032086870d sched/posix_spawn: Don't insert name at the begin of argv
since the standard require the caller pass the name explicitly
https://pubs.opengroup.org/onlinepubs/009695399/functions/posix_spawn.html:
The argument argv is an array of character pointers to null-terminated strings.
The last member of this array shall be a null pointer and is not counted in argc.
These strings constitute the argument list available to the new process image.
The value in argv[0] should point to a filename that is associated with the
process image being started by the posix_spawn() or posix_spawnp() function.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Id79ffcc501ae9552dc4e908418ff555f498be7f1
2021-06-14 07:11:53 -06:00
Masayuki Ishikawa
304d72ed00 binfmt: Call up_module_text_free() in unload_module()
Summary:
- I noticed that up_module_text_free() is not called
  if CONFIG_ARCH_USE_MODULE_TEXT=y
- This commit fixes this issue

Impact:
- None

Testing:
- Tested with spresense

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2021-06-04 01:40:37 -05:00
Xiang Xiao
2e54df0f35 Don't include assert.h from public header file
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-06-03 08:36:03 -07:00
Masayuki Ishikawa
4d492104a7 binfmt: Introduce a separate text memory for ELF
Summary:
- This commit introduces a separate text memory for ELF
- The logic is similar to modlib

Impact:
- None

Testing:
- Tested with spresense:elf
- NOTE: needs separate commits

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2021-06-02 02:27:04 -05:00
Xiang Xiao
bebdbc5c87 binfmt: Remove filename/exports/nexports from binary_s
to simplify the life cycle management

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-06-02 15:20:38 +09:00
Xiang Xiao
cf78a5b6cf binfmt: Move argv copy into exec_module
and remove the related fields from struct binary_s

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-06-02 15:20:38 +09:00
Xiang Xiao
d7f96003cf Don't include debug.h from public header file
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-06-01 06:42:02 +09:00
Xiang Xiao
8a14a13819 binfmt: Rename dump_module to binfmt_dumpmodule
follow other binfmt function naming convention

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-05-24 12:16:06 +09:00
Alexander Lunev
4018cc186c libelf: fix "nsh: nsh_session: readline failed: 13" error
Resolves issue #3751
2021-05-21 02:12:31 -07:00
Xiang Xiao
85c1354043 binfmt/elf: Don't close filfd in the fail path
to avoid close the same handle twice because
the caller also call elf_uninit in this case

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Iddcbae9587d11d3b5b06e876d4a037ac0d11992e
2021-05-12 21:09:29 -07:00
Liio Chen
468e08c1b4 binnfmt:Fix return before close ELF fd
elf_init open a elf file , if both enabled
   CONFIG_NSH_BUIlTAPPS and CONFIG_NSH_FILE_APPS ,
   elf_init will read elf file in /bin directory, but
   that length is zero , elf_read failed return and NOT
   close elf fd, so this line MUST be return to errout_with_init
2021-05-07 06:42:15 -07:00
Byron Ellacott
c9db653c8d symtabs: improve handling of symbol lookups
When CONFIG_SYMTAB_ORDEREDBYNAME is selected most code will use
the ordered search function. When it is not selected no code will
use the ordered search function. This change merges the two
functions and varies its behaviour based on the config setting,
such that all callers can simply call the one search function
and get the best behaviour.

An additional configuration option allows leading underscores to
be stripped from symbols being relocated in loaded objects. This
allows toolchains which prefix C symbol with underscores to make
loadable ELF objects.
2021-03-16 10:18:17 -07:00
Abdelatif Guettouche
d85c432278 Few typos fixes in binfmt and libc/machine.
Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2021-03-11 10:35:40 +08:00
Gustavo Henrique Nihei
330eff36d7 sourcefiles: Fix relative path in file header 2021-03-09 23:18:28 +08:00
Gustavo Henrique Nihei
13535d8725 linkerfiles: Fix relative path in file header 2021-03-09 23:18:28 +08:00
Alin Jerpelea
f9fb182809 Author: Gregory Nutt: update licenses to Apache
Update files from Gregory Nutt to Apache 2.0 license.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-02-05 12:15:56 -03:00
Alin Jerpelea
789d3751ad binfmt: libnxflat: nxstyle error fix
Fix nxstyle errors to pass CI

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-02-05 12:15:56 -03:00
Xiang Xiao
0dc6990166 Fix nxstyle warning
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-01-13 08:57:58 +01:00
Xiang Xiao
0536953ded Kernel module should prefer functions with nx/kmm prefix
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-01-13 08:57:58 +01:00
chao.an
c56785bd0d style/Makefile: remove unnecessary trailing whitespace
N/A

Signed-off-by: chao.an <anchao@xiaomi.com>
2020-11-28 12:20:30 +01:00
YAMAMOTO Takashi
85f38b01c1 binfmt/libelf/libelf_dtors.c: Fix a syslog format 2020-11-27 05:18:57 -06:00
YAMAMOTO Takashi
44e61d7fe7 binfmt/libelf/libelf_ctors.c: Fix a syslog format 2020-11-27 05:18:57 -06:00
YAMAMOTO Takashi
78797dc1da binfmt/libnxflat/libnxflat_bind.c: Fix syslog formats 2020-11-25 05:11:26 -08:00
YAMAMOTO Takashi
ca2cc5133d binfmt/libnxflat/libnxflat_load.c: Fix syslog formats 2020-11-25 05:11:26 -08:00
YAMAMOTO Takashi
b9538bf885 binfmt/libnxflat/libnxflat_load.c: Appease nxstyle 2020-11-25 05:11:26 -08:00
Matias N
d5b6ec450f Parallelize depend file generation 2020-11-22 09:02:59 -03:00
YAMAMOTO Takashi
d068713738 binfmt/libelf/libelf_symbols.c: Fix syslog formats 2020-11-21 19:38:32 -08:00
YAMAMOTO Takashi
148ee150f0 binfmt/libelf/libelf_bind.c: Fix syslog formats 2020-11-21 19:38:32 -08:00
YAMAMOTO Takashi
48e3e2d390 binfmt/binfmt_dumpmodule.c: Fix syslog format errors 2020-11-20 22:22:53 -08:00
Nathan Hartman
80ce7800a9 Sources and Docs: Fix typos and nxstyle issues
Documentation/contributing/coding_style.rst:

    * Fix repeated words: ("this this").
    * Remove trailing spaces.

boards/z80/z80/z80sim/README.txt:

    * Fix repeated words: ("this this") and rewrap lines.

graphics/Kconfig,
libs/libc/math/Kconfig:

    * Fix repeated words: ("this this").

arch/arm/src/armv7-a/arm_assert.c,
arch/arm/src/armv7-r/arm_assert.c,
arch/arm/src/imxrt/imxrt_enet.c,
arch/arm/src/kinetis/kinetis_enet.c,
arch/arm/src/kinetis/kinetis_flexcan.c,
arch/arm/src/s32k1xx/s32k1xx_enet.c,
arch/arm/src/s32k1xx/s32k1xx_flexcan.c,
arch/arm/src/stm32/stm32_pwm.c,
arch/arm/src/stm32h7/stm32_pwm.c,
arch/arm/src/stm32l4/stm32l4_pwm.c,
arch/renesas/src/rx65n/rx65n_usbdev.c,
binfmt/libnxflat/libnxflat_bind.c,
drivers/pipes/pipe_common.c,
net/igmp/igmp_input.c,
net/tcp/tcp_conn.c,
sched/sched/sched_roundrobin.c:

    * Fix typo in comment ("this this").

arch/arm/src/cxd56xx/cxd56_usbdev.c,
arch/arm/src/lc823450/lc823450_usbdev.c:

    * Fix typo in comment and rewrap lines.

arch/arm/src/imxrt/imxrt_usbdev.c,
arch/arm/src/stm32/stm32_dac.c,
arch/arm/src/stm32f0l0g0/stm32_pwm.c,
arch/arm/src/stm32f7/stm32_pwm.c,
arch/arm/src/tiva/lm/lm4f_gpio.h,
fs/nxffs/nxffs_write.c,
include/nuttx/analog/pga11x.h,
include/nuttx/usb/usbdev.h,
net/mld/mld_join.c:

    * Fix typo in comment ("this this").
    * Fix nxstyle issues.
2020-10-02 04:54:52 +02:00
Xiang Xiao
ae356001cf Change all files come from Xiaomi/Pinecone to Apache License 2.0
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-22 17:37:21 -06:00
SPRESENSE
e249a2f82f Makefile: Fix Make.dep not updated by config changes
Make.dep file should be updated by .config changed after first make.
There are 2 cases affected for this problem:

 1) Add source files by config symbol
 2) Include header files in #ifdef directive

These 2 cases may not be included in Make.dep and this may prevent the
differential build from working correctly.
2020-07-28 03:59:45 -05:00
Xiang Xiao
2b7528feae binfmt: Fix warning: unused variable ‘exidx’
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I55d3355813b8b24727e2a7f78fcd72622a1e6758
2020-07-21 00:03:47 -07:00
Xiang Xiao
fbfd9d62da libelf: Parse .ARM.exidx only for ARM architecture
since other arch has the different unwind approach

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Icefa0d4bc31bff967372949216d337770cd7e768
2020-07-11 10:34:22 -07:00
Xiang Xiao
14ecb8723a sched: Change tcb_s to task_tcb_s for nxtask_[un]init
since these functions can just work with task not thread

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-06-30 10:54:42 -06:00
chao.an
b9ad4a000e binfmt/exec: allocate stack from internal
Implement of nxtask_init() support stack allocation from internal

Change-Id: I4885c5b901d90e57eb9d15d8bc1af32761584d19
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-06-30 08:26:38 +02:00
chao.an
2fc02ec4a4 sched/task_init: change the stack pointer type to (void *)
change the stack pointer type from (uint32_t *) to (void *)

Change-Id: I90bb7d6a9cb0184c133578a1a2ae9a19c233ad30
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-06-30 08:26:38 +02:00
Xiang Xiao
a69678810d sched: Change the return type of nxtask_activate to void
to simplify the error handling logic

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I00fedd4d69620a7cc7b9f9e8bf4ba7f7989dc2b2
2020-06-04 22:20:45 +01:00
Xiang Xiao
b932b653dd arch: Select 64bit elf base on the architecture characteristic
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I09eec5a76f255016a910cfec3b3f70cd7577525e
2020-05-31 21:38:32 -07:00