fixed TLS issues and pass unit tests #26
Merged
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.
RISC-V ELF Specification defines each pointer in DTV
points to 0x800(TLS_DTV_OFFSET) past the start of a TLS block, which has
been suppored well for IE model but not for GD model. This change
complete TLS for GD model.
Note, in our new design, to not modify original code too much, the
pointer in DTV still point to the start of a TLS block, we just compensate
TLS_DTV_OFFSET at two places, one is in relocation(TLS_DTPREL), another
is the place where the pointer of TLS block is returned.
For x86/arm, we can think TLS_DTV_OFFSET was defined as zero to
compatible with current code-base.
Along with this change, we passed following unit cases:
Signed-off-by: Chen Wang wangchen20@iscas.ac.cn