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

[DO NOT MERGE]PIC #317

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

[DO NOT MERGE]PIC #317

wants to merge 3 commits into from

Conversation

badochov
Copy link
Contributor

@badochov badochov commented Dec 1, 2023

Description

Motivation and Context

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

How Has This Been Tested?

  • Already covered by automatic testing.
  • New test added: (add PR link here).
  • Tested by hand on: (list targets here).

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing linter checks and tests passed.
  • My changes generate no new compilation warnings for any of the targets.

Special treatment

  • This PR needs additional PRs to work (list the PRs, preferably in merge-order).
  • I will merge this PR by myself when appropriate.

@badochov badochov marked this pull request as draft December 1, 2023 17:47
Copy link

github-actions bot commented Dec 1, 2023

Unit Test Results

6 410 tests  +1 211   5 776 ✅ +1 123   30m 52s ⏱️ + 2m 53s
  354 suites +   56     634 💤 +   89 
    1 files   ±    0       0 ❌  -     1 

Results for commit ffe08e5. ± Comparison against base commit 9d138b9.

♻️ This comment has been updated with latest results.

@badochov badochov force-pushed the badochov/PIC branch 6 times, most recently from 36e0e4f to 4790fa3 Compare December 7, 2023 12:18
arch/armv7a/tls.c Outdated Show resolved Hide resolved
arch/riscv64/tls.c Outdated Show resolved Hide resolved
@agkaminski
Copy link
Member

Perhaps it might be better to make these TLS code files directly as asm (.S) files?

@badochov
Copy link
Contributor Author

badochov commented Dec 8, 2023

Perhaps it might be better to make these TLS code files directly as asm (.S) files?

Yeah, I think it's justified in this case

@badochov badochov force-pushed the badochov/PIC branch 10 times, most recently from 603f6e8 to 353e971 Compare December 11, 2023 01:41
@badochov
Copy link
Contributor Author

@astalke could you have a look at my changes to ia32 asm?

@badochov badochov force-pushed the badochov/PIC branch 2 times, most recently from 780047e to 00a1625 Compare December 11, 2023 12:39
@astalke
Copy link
Contributor

astalke commented Dec 12, 2023

@astalke could you have a look at my changes to ia32 asm?

I've skimmed through code and I think it looks fine. I'm only concerned about cmove, because I am not sure if it is available in every version of CPU we support.

arch/armv7a/tls.S Outdated Show resolved Hide resolved
arch/armv7a/tls.S Outdated Show resolved Hide resolved
arch/ia32/jmp.S Outdated Show resolved Hide resolved
arch/ia32/jmp.S Outdated Show resolved Hide resolved
arch/ia32/jmp.S Outdated Show resolved Hide resolved
arch/ia32/signal.S Outdated Show resolved Hide resolved
arch/ia32/signal.S Outdated Show resolved Hide resolved
@kemonats
Copy link
Contributor

Simple example:

int foo(int a, int b)
{
    return (a > 3) ? 4 : b;
}

-march=i586 ( as it is compiled target i386 ) without cmov

00000000 <foo>:
   0:   83 7c 24 04 03          cmpl   $0x3,0x4(%esp)
   5:   8b 44 24 08             mov    0x8(%esp),%eax
   9:   7f 05                   jg     10 <foo+0x10>
   b:   c3                      ret
   c:   8d 74 26 00             lea    0x0(%esi,%eiz,1),%esi
  10:   b8 04 00 00 00          mov    $0x4,%eax
  15:   c3                      ret

-march=i686

00000000 <foo>:
   0:   83 7c 24 04 03          cmpl   $0x3,0x4(%esp)
   5:   b8 04 00 00 00          mov    $0x4,%eax
   a:   0f 4e 44 24 08          cmovle 0x8(%esp),%eax
   f:   c3                      ret

badochov and others added 3 commits September 11, 2024 14:14
In PIE on ia32 function calls should be made using GOT.

JIRA: RTOS-664
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants