Skip to content

Commit 424ece8

Browse files
donghengqazcwespressif
authored andcommitted
fix(elfloader): fix script path error
1 parent bc6046a commit 424ece8

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

components/elf_loader/elf_loader.cmake

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,22 @@ macro(project_elf project_name)
4848
endif()
4949

5050
# Link input list of libraries to ELF
51+
list(APPEND ELF_COMPONENTS "main")
5152
if(ELF_COMPONENTS)
5253
foreach(c "${ELF_COMPONENTS}")
53-
set(elf_libs "${elf_libs}" "esp-idf/${c}/lib${c}.a")
54+
list(APPEND elf_libs "esp-idf/${c}/lib${c}.a")
55+
list(APPEND elf_dependeces "idf::${c}")
5456
endforeach()
5557
endif()
56-
57-
set(elf_libs ${elf_libs} "${ELF_LIBS}" "esp-idf/main/libmain.a")
58+
if (ELF_LIBS)
59+
list(APPEND elf_libs "${ELF_LIBS}")
60+
endif()
5861
spaces2list(elf_libs)
5962

6063
add_custom_command(OUTPUT elf_app
6164
COMMAND ${CMAKE_C_COMPILER} ${cflags} ${elf_libs} -o ${elf_app}
6265
COMMAND ${CMAKE_STRIP} ${strip_flags} ${elf_app}
63-
DEPENDS ${elf_libs}
66+
DEPENDS ${elf_dependeces}
6467
COMMENT "Build ELF: ${elf_app}"
6568
)
6669
add_custom_target(elf ALL DEPENDS elf_app)

components/elf_loader/linker.lf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[sections:elf_loader_got_plt]
22
entries:
33
.got.plt
4+
.got
45

56
[scheme:elf_loader_default]
67
entries:

0 commit comments

Comments
 (0)