-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
linker: __data_region_start equal to __data_start #38817
Merged
cfriedt
merged 3 commits into
zephyrproject-rtos:main
from
tejlmand:issues/38591_relocate_region_start_symbols
Sep 24, 2021
Merged
linker: __data_region_start equal to __data_start #38817
cfriedt
merged 3 commits into
zephyrproject-rtos:main
from
tejlmand:issues/38591_relocate_region_start_symbols
Sep 24, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tejlmand
added
bug
The issue is a bug, or the PR is fixing a bug
DNM
This PR should not be merged (Do Not Merge)
labels
Sep 24, 2021
tejlmand
requested review from
JordanYates,
stephanosio,
carlescufi and
erwango
September 24, 2021 09:55
tejlmand
requested review from
abrodkin,
carlocaione,
dleach02,
evgeniy-paltsev,
galak,
ioannisg and
kgugala
as code owners
September 24, 2021 09:55
tejlmand
requested review from
MaureenHelm,
pgielda and
ruuddw
as code owners
September 24, 2021 09:55
github-actions
bot
added
area: API
Changes to public APIs
area: ARC
ARC Architecture
area: ARM
ARM (32-bit) Architecture
area: ARM64
ARM (64-bit) Architecture
area: RISCV
RISCV Architecture (32-bit & 64-bit)
labels
Sep 24, 2021
erwango
approved these changes
Sep 24, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I confirm it fixes #38591
carlocaione
approved these changes
Sep 24, 2021
stephanosio
approved these changes
Sep 24, 2021
zephyrbot
requested review from
bbolen,
IRISZZW,
katsuster,
mgielda,
npitre and
povergoing
September 24, 2021 12:29
ruuddw
approved these changes
Sep 24, 2021
evgeniy-paltsev
approved these changes
Sep 24, 2021
abrodkin
approved these changes
Sep 24, 2021
Fixes: zephyrproject-rtos#38591, zephyrproject-rtos#38207, zephyrproject-rtos#37861 The commit 65a2de8 aligned the data linker symbol for sections and regions. The data region symbol start has been placed outside the sections thus being defined as the address of the region before alignment of the first section in the data region, usually the `datas` section. The symbol defining the start address of the data section is after section alignment. In most cases the address of the data region start and datas section start will be identical, but not always. The data region symbol is a new linker symbol and existing code has been depending on the old data section start symbol. Thus, the update to the use of the data region start symbol instead of data ram start symbol thus results in a different address when the section is aligned to a different address. To ensure the original behavior in all cases, the data region start address is now moved inside the data section. Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
tejlmand
force-pushed
the
issues/38591_relocate_region_start_symbols
branch
from
September 24, 2021 15:18
0c48c5c
to
a2507ea
Compare
Two additional commits targeted the ld linker script generator has been added to ensure the data and text region start symbol addresses are defined identical to using the ld template files. |
The root cause of zephyrproject-rtos#38591 was region symbols being placed before the section description for data region. Some region start symbols are placed before section description, other region start symbols are placed inside the first section in the region and thus identical to the sections own first symbol. To support both schemes with the linker generator, a new `SYMBOL SECTION` argument has been added to the zephyr_linker_group() function. The ld_script.cmake linker script generator has been updated to support the new argument so that generated ld linker script has identical behavior to the templated ld linker scripts. Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
The root cause of zephyrproject-rtos#38591 was region symbols being placed before the section description for data region. To support both schemes with the linker generator, a new `SYMBOL SECTION` argument has been added to the zephyr_linker_group() function. This commit updates the arm/linker.cmake CMake linker file to use the new `SYMBOL SECTION` argument for the data region group and text region group so that those two groups now behave identical to the behavior when using the cortex_m linker.ld template. Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
tejlmand
force-pushed
the
issues/38591_relocate_region_start_symbols
branch
from
September 24, 2021 15:25
a2507ea
to
72783f0
Compare
This was referenced Sep 25, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area: API
Changes to public APIs
area: ARC
ARC Architecture
area: ARM
ARM (32-bit) Architecture
area: ARM64
ARM (64-bit) Architecture
area: Build System
area: RISCV
RISCV Architecture (32-bit & 64-bit)
area: SPARC
SPARC Architecture
bug
The issue is a bug, or the PR is fixing a bug
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes: #38591, #38207, #37861
The commit 65a2de8 aligned the data
linker symbol for sections and regions.
The data region symbol start has been placed outside the sections thus
being defined as the address of the region before alignment of the first
section in the data region, usually the
datas
section.The symbol defining the start address of the data section is after
section alignment.
In most cases the address of the data region start and datas section
start will be identical, but not always.
The data region symbol is a new linker symbol and existing code has
been depending on the old data section start symbol.
Thus, the update to the use of the data region start symbol instead of
data ram start symbol thus results in a different address when the
section is aligned to a different address.
To ensure the original behavior in all cases, the data region start
address is now moved inside the data section.
Signed-off-by: Torsten Rasmussen Torsten.Rasmussen@nordicsemi.no
DNM to allow time to examine the ld linker script generator for possible related fixup.