Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

为导出命令模式使用GCC LD原生的段起止点符号 #175

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ SHELL_USED const ShellCommand shellUserDefault SHELL_SECTION("shellCommand") =
#elif defined(__ICCARM__) || defined(__ICCRX__)
#pragma section="shellCommand"
#elif defined(__GNUC__)
extern const unsigned int _shell_command_start;
extern const unsigned int _shell_command_end;
extern const unsigned int __start_shellCommand;
extern const unsigned int __stop_shellCommand;
#endif
#else
extern const ShellCommand shellCommandList[];
Expand Down Expand Up @@ -212,9 +212,9 @@ void shellInit(Shell *shell, char *buffer, unsigned short size)
- (size_t)(__section_begin("shellCommand")))
/ sizeof(ShellCommand);
#elif defined(__GNUC__)
shell->commandList.base = (ShellCommand *)(&_shell_command_start);
shell->commandList.count = ((size_t)(&_shell_command_end)
- (size_t)(&_shell_command_start))
shell->commandList.base = (ShellCommand *)(&__start_shellCommand);
shell->commandList.count = ((size_t)(&__stop_shellCommand)
- (size_t)(&__start_shellCommand))
/ sizeof(ShellCommand);
#else
#error not supported compiler, please use command table mode
Expand Down