Skip to content

Instantly share code, notes, and snippets.

@eblot
Last active May 1, 2020 19:21
Show Gist options
  • Save eblot/43509ee1803b835d1b51f92700efb4d2 to your computer and use it in GitHub Desktop.
Save eblot/43509ee1803b835d1b51f92700efb4d2 to your computer and use it in GitHub Desktop.

Revisions

  1. eblot revised this gist May 1, 2020. 1 changed file with 16 additions and 18 deletions.
    34 changes: 16 additions & 18 deletions newlib-3.3.0-armv6m.diff
    Original file line number Diff line number Diff line change
    @@ -1,55 +1,53 @@
    diff -ur a/libgloss/arm/crt0.S b/libgloss/arm/crt0.S
    --- a/libgloss/arm/crt0.S 2020-05-01 21:14:30.000000000 +0200
    +++ b/libgloss/arm/crt0.S 2020-01-22 11:05:51.000000000 +0100
    --- a/libgloss/arm/crt0.S 2020-01-22 11:05:51.000000000 +0100
    +++ b/libgloss/arm/crt0.S 2020-05-01 21:19:59.000000000 +0200
    @@ -565,7 +565,7 @@

    /* For Thumb, constants must be after the code since only
    positive offsets are supported for PC relative addresses. */
    - .align 2
    + .align 0
    - .align 0
    + .align 2
    .LC0:
    #ifdef ARM_RDI_MONITOR
    .word HeapBase
    Only in a/libgloss/arm: crt0.S.orig
    Only in a/libgloss/arm: crt0.S.rej
    diff -ur a/newlib/libc/machine/arm/setjmp.S b/newlib/libc/machine/arm/setjmp.S
    --- a/newlib/libc/machine/arm/setjmp.S 2020-05-01 21:13:59.000000000 +0200
    +++ b/newlib/libc/machine/arm/setjmp.S 2020-01-22 11:05:51.000000000 +0100
    --- a/newlib/libc/machine/arm/setjmp.S 2020-01-22 11:05:51.000000000 +0100
    +++ b/newlib/libc/machine/arm/setjmp.S 2020-05-01 21:19:21.000000000 +0200
    @@ -74,11 +74,11 @@
    mov r5, sp
    mov r6, lr
    stmia r0!, {r1, r2, r3, r4, r5, r6}
    - subs r0, r0, #40
    + sub r0, r0, #40
    - sub r0, r0, #40
    + subs r0, r0, #40
    /* Restore callee-saved low regs. */
    ldmia r0!, {r4, r5, r6, r7}
    /* Return zero. */
    - movs r0, #0
    + mov r0, #0
    - mov r0, #0
    + movs r0, #0
    bx lr

    .thumb_func
    @@ -86,7 +86,7 @@
    TYPE (longjmp)
    SYM (longjmp):
    /* Restore High regs. */
    - adds r0, r0, #16
    + add r0, r0, #16
    - add r0, r0, #16
    + adds r0, r0, #16
    ldmia r0!, {r2, r3, r4, r5, r6}
    mov r8, r2
    mov r9, r3
    @@ -95,12 +95,12 @@
    mov sp, r6
    ldmia r0!, {r3} /* lr */
    /* Restore low regs. */
    - subs r0, r0, #40
    + sub r0, r0, #40
    - sub r0, r0, #40
    + subs r0, r0, #40
    ldmia r0!, {r4, r5, r6, r7}
    /* Return the result argument, or 1 if it is zero. */
    mov r0, r1
    bne 1f
    - movs r0, #1
    + mov r0, #1
    - mov r0, #1
    + movs r0, #1
    1:
    bx r3

  2. eblot created this gist May 1, 2020.
    55 changes: 55 additions & 0 deletions newlib-3.3.0-armv6m.diff
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,55 @@
    diff -ur a/libgloss/arm/crt0.S b/libgloss/arm/crt0.S
    --- a/libgloss/arm/crt0.S 2020-05-01 21:14:30.000000000 +0200
    +++ b/libgloss/arm/crt0.S 2020-01-22 11:05:51.000000000 +0100
    @@ -565,7 +565,7 @@

    /* For Thumb, constants must be after the code since only
    positive offsets are supported for PC relative addresses. */
    - .align 2
    + .align 0
    .LC0:
    #ifdef ARM_RDI_MONITOR
    .word HeapBase
    Only in a/libgloss/arm: crt0.S.orig
    Only in a/libgloss/arm: crt0.S.rej
    diff -ur a/newlib/libc/machine/arm/setjmp.S b/newlib/libc/machine/arm/setjmp.S
    --- a/newlib/libc/machine/arm/setjmp.S 2020-05-01 21:13:59.000000000 +0200
    +++ b/newlib/libc/machine/arm/setjmp.S 2020-01-22 11:05:51.000000000 +0100
    @@ -74,11 +74,11 @@
    mov r5, sp
    mov r6, lr
    stmia r0!, {r1, r2, r3, r4, r5, r6}
    - subs r0, r0, #40
    + sub r0, r0, #40
    /* Restore callee-saved low regs. */
    ldmia r0!, {r4, r5, r6, r7}
    /* Return zero. */
    - movs r0, #0
    + mov r0, #0
    bx lr

    .thumb_func
    @@ -86,7 +86,7 @@
    TYPE (longjmp)
    SYM (longjmp):
    /* Restore High regs. */
    - adds r0, r0, #16
    + add r0, r0, #16
    ldmia r0!, {r2, r3, r4, r5, r6}
    mov r8, r2
    mov r9, r3
    @@ -95,12 +95,12 @@
    mov sp, r6
    ldmia r0!, {r3} /* lr */
    /* Restore low regs. */
    - subs r0, r0, #40
    + sub r0, r0, #40
    ldmia r0!, {r4, r5, r6, r7}
    /* Return the result argument, or 1 if it is zero. */
    mov r0, r1
    bne 1f
    - movs r0, #1
    + mov r0, #1
    1:
    bx r3