[PATCH] m68k/uC5282: linkcmds KEEP and SORT sections

2021-07-01 Thread Gedare Bloom
Fixes a problem with bad epilog code in _fini and to keep sections
necessary with the -ffunction/data-sections.
---
 bsps/m68k/uC5282/start/linkcmds | 34 ++---
 1 file changed, 19 insertions(+), 15 deletions(-)

diff --git a/bsps/m68k/uC5282/start/linkcmds b/bsps/m68k/uC5282/start/linkcmds
index 6ac9de96ae..2111e53036 100644
--- a/bsps/m68k/uC5282/start/linkcmds
+++ b/bsps/m68k/uC5282/start/linkcmds
@@ -91,13 +91,13 @@ SECTIONS
  * crtn.o are in.
  */
 PROVIDE (_init = .);
-*crti.o(.init)
-*(.init)
-*crtn.o(.init)
+KEEP (*crti.o(.init))
+KEEP (*(.init))
+KEEP (*crtn.o(.init))
 PROVIDE (_fini = .);
-*crti.o(.fini)
-*(.fini)
-*crtn.o(.fini)
+KEEP (*crti.o(.fini))
+KEEP (*(.fini))
+KEEP (*crtn.o(.fini))
 
 /*
  * Special FreeBSD sysctl sections.
@@ -122,18 +122,22 @@ SECTIONS
  * crtend.o.  The same comments apply to it.
  */
 . = ALIGN (16);
-*crtbegin.o(.ctors)
-*(.ctors)
-*crtend.o(.ctors)
-*crtbegin.o(.dtors)
-*(.dtors)
-*crtend.o(.dtors)
+KEEP (*crtbegin.o(.ctors))
+KEEP (*crtbegin?.o(.ctors))
+KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+KEEP (*(SORT(.ctors.*)))
+KEEP (*(.ctors))
+KEEP (*crtbegin.o(.dtors))
+KEEP (*crtbegin?.o(.dtors))
+KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+KEEP (*(SORT(.dtors.*)))
+KEEP (*(.dtors))
 
 /*
  * Exception frame info
  */
 . = ALIGN (16);
-*(.eh_frame)
+KEEP (*(.eh_frame))
 
 /*
  * Read-only data
@@ -141,7 +145,7 @@ SECTIONS
 . = ALIGN (16);
 _rodata_start = . ;
 *(.rodata*)
-   KEEP (*(SORT(.rtemsroset.*)))
+KEEP (*(SORT(.rtemsroset.*)))
 *(.gnu.linkonce.r*)
 
 . = ALIGN (16);
@@ -179,7 +183,7 @@ SECTIONS
 KEEP (*(SORT(.rtemsrwset.*)))
 *(.gnu.linkonce.d*)
 *(.gcc_except_table*)
-*(.jcr)
+KEEP (*(.jcr))
 . = ALIGN (16);
 PROVIDE (_edata = .);
 PROVIDE (_copy_end = .);
-- 
2.25.1

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH] m68k/uC5282: linkcmds KEEP and SORT sections

2021-07-01 Thread Gedare Bloom
Hello all,

The uC5282 stopped working in 5 and master. This patch seems to get
things working again on both branches. I can run hello.exe and
ticker.exe on the WIP qemu Harrison is working on.

I will back-port to 5 with a ticket.

We'll work on full tester configuration after the WIP qemu
modifications are finished. (Test execution termination isn't working,
so automation is out.)

Gedare

On Thu, Jul 1, 2021 at 12:40 PM Gedare Bloom  wrote:
>
> Fixes a problem with bad epilog code in _fini and to keep sections
> necessary with the -ffunction/data-sections.
> ---
>  bsps/m68k/uC5282/start/linkcmds | 34 ++---
>  1 file changed, 19 insertions(+), 15 deletions(-)
>
> diff --git a/bsps/m68k/uC5282/start/linkcmds b/bsps/m68k/uC5282/start/linkcmds
> index 6ac9de96ae..2111e53036 100644
> --- a/bsps/m68k/uC5282/start/linkcmds
> +++ b/bsps/m68k/uC5282/start/linkcmds
> @@ -91,13 +91,13 @@ SECTIONS
>   * crtn.o are in.
>   */
>  PROVIDE (_init = .);
> -*crti.o(.init)
> -*(.init)
> -*crtn.o(.init)
> +KEEP (*crti.o(.init))
> +KEEP (*(.init))
> +KEEP (*crtn.o(.init))
>  PROVIDE (_fini = .);
> -*crti.o(.fini)
> -*(.fini)
> -*crtn.o(.fini)
> +KEEP (*crti.o(.fini))
> +KEEP (*(.fini))
> +KEEP (*crtn.o(.fini))
>
>  /*
>   * Special FreeBSD sysctl sections.
> @@ -122,18 +122,22 @@ SECTIONS
>   * crtend.o.  The same comments apply to it.
>   */
>  . = ALIGN (16);
> -*crtbegin.o(.ctors)
> -*(.ctors)
> -*crtend.o(.ctors)
> -*crtbegin.o(.dtors)
> -*(.dtors)
> -*crtend.o(.dtors)
> +KEEP (*crtbegin.o(.ctors))
> +KEEP (*crtbegin?.o(.ctors))
> +KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
> +KEEP (*(SORT(.ctors.*)))
> +KEEP (*(.ctors))
> +KEEP (*crtbegin.o(.dtors))
> +KEEP (*crtbegin?.o(.dtors))
> +KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
> +KEEP (*(SORT(.dtors.*)))
> +KEEP (*(.dtors))
>
>  /*
>   * Exception frame info
>   */
>  . = ALIGN (16);
> -*(.eh_frame)
> +KEEP (*(.eh_frame))
>
>  /*
>   * Read-only data
> @@ -141,7 +145,7 @@ SECTIONS
>  . = ALIGN (16);
>  _rodata_start = . ;
>  *(.rodata*)
> -   KEEP (*(SORT(.rtemsroset.*)))
> +KEEP (*(SORT(.rtemsroset.*)))
>  *(.gnu.linkonce.r*)
>
>  . = ALIGN (16);
> @@ -179,7 +183,7 @@ SECTIONS
>  KEEP (*(SORT(.rtemsrwset.*)))
>  *(.gnu.linkonce.d*)
>  *(.gcc_except_table*)
> -*(.jcr)
> +KEEP (*(.jcr))
>  . = ALIGN (16);
>  PROVIDE (_edata = .);
>  PROVIDE (_copy_end = .);
> --
> 2.25.1
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH] m68k/uC5282: linkcmds KEEP and SORT sections

2021-07-01 Thread Joel Sherrill
On Thu, Jul 1, 2021 at 1:50 PM Gedare Bloom  wrote:
>
> Hello all,
>
> The uC5282 stopped working in 5 and master. This patch seems to get
> things working again on both branches. I can run hello.exe and
> ticker.exe on the WIP qemu Harrison is working on.

Based on our chats, it looks like the move to per function section linking
pointing out deficiencies in a few BSPs linker scripts. Maybe someone
on your side can grep and see if there are any more obvious places
missing KEEP.

> I will back-port to 5 with a ticket.

Great!

> We'll work on full tester configuration after the WIP qemu
> modifications are finished. (Test execution termination isn't working,
> so automation is out.)

Is there a reset register on the uc5282? Qemu has support in some
machine models for exiting instead of resetting via a command line
option.

Otherwise, poke Alex to see what he did with the Microblaze. I don't
think qemu exits automatically for it either.

--joel

>
> Gedare
>
> On Thu, Jul 1, 2021 at 12:40 PM Gedare Bloom  wrote:
> >
> > Fixes a problem with bad epilog code in _fini and to keep sections
> > necessary with the -ffunction/data-sections.
> > ---
> >  bsps/m68k/uC5282/start/linkcmds | 34 ++---
> >  1 file changed, 19 insertions(+), 15 deletions(-)
> >
> > diff --git a/bsps/m68k/uC5282/start/linkcmds 
> > b/bsps/m68k/uC5282/start/linkcmds
> > index 6ac9de96ae..2111e53036 100644
> > --- a/bsps/m68k/uC5282/start/linkcmds
> > +++ b/bsps/m68k/uC5282/start/linkcmds
> > @@ -91,13 +91,13 @@ SECTIONS
> >   * crtn.o are in.
> >   */
> >  PROVIDE (_init = .);
> > -*crti.o(.init)
> > -*(.init)
> > -*crtn.o(.init)
> > +KEEP (*crti.o(.init))
> > +KEEP (*(.init))
> > +KEEP (*crtn.o(.init))
> >  PROVIDE (_fini = .);
> > -*crti.o(.fini)
> > -*(.fini)
> > -*crtn.o(.fini)
> > +KEEP (*crti.o(.fini))
> > +KEEP (*(.fini))
> > +KEEP (*crtn.o(.fini))
> >
> >  /*
> >   * Special FreeBSD sysctl sections.
> > @@ -122,18 +122,22 @@ SECTIONS
> >   * crtend.o.  The same comments apply to it.
> >   */
> >  . = ALIGN (16);
> > -*crtbegin.o(.ctors)
> > -*(.ctors)
> > -*crtend.o(.ctors)
> > -*crtbegin.o(.dtors)
> > -*(.dtors)
> > -*crtend.o(.dtors)
> > +KEEP (*crtbegin.o(.ctors))
> > +KEEP (*crtbegin?.o(.ctors))
> > +KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
> > +KEEP (*(SORT(.ctors.*)))
> > +KEEP (*(.ctors))
> > +KEEP (*crtbegin.o(.dtors))
> > +KEEP (*crtbegin?.o(.dtors))
> > +KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
> > +KEEP (*(SORT(.dtors.*)))
> > +KEEP (*(.dtors))
> >
> >  /*
> >   * Exception frame info
> >   */
> >  . = ALIGN (16);
> > -*(.eh_frame)
> > +KEEP (*(.eh_frame))
> >
> >  /*
> >   * Read-only data
> > @@ -141,7 +145,7 @@ SECTIONS
> >  . = ALIGN (16);
> >  _rodata_start = . ;
> >  *(.rodata*)
> > -   KEEP (*(SORT(.rtemsroset.*)))
> > +KEEP (*(SORT(.rtemsroset.*)))
> >  *(.gnu.linkonce.r*)
> >
> >  . = ALIGN (16);
> > @@ -179,7 +183,7 @@ SECTIONS
> >  KEEP (*(SORT(.rtemsrwset.*)))
> >  *(.gnu.linkonce.d*)
> >  *(.gcc_except_table*)
> > -*(.jcr)
> > +KEEP (*(.jcr))
> >  . = ALIGN (16);
> >  PROVIDE (_edata = .);
> >  PROVIDE (_copy_end = .);
> > --
> > 2.25.1
> >
> ___
> devel mailing list
> devel@rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH] m68k/uC5282: linkcmds KEEP and SORT sections

2021-07-01 Thread Joel Sherrill
Looks ok to me. Push to both branches.

On Thu, Jul 1, 2021 at 1:40 PM Gedare Bloom  wrote:
>
> Fixes a problem with bad epilog code in _fini and to keep sections
> necessary with the -ffunction/data-sections.
> ---
>  bsps/m68k/uC5282/start/linkcmds | 34 ++---
>  1 file changed, 19 insertions(+), 15 deletions(-)
>
> diff --git a/bsps/m68k/uC5282/start/linkcmds b/bsps/m68k/uC5282/start/linkcmds
> index 6ac9de96ae..2111e53036 100644
> --- a/bsps/m68k/uC5282/start/linkcmds
> +++ b/bsps/m68k/uC5282/start/linkcmds
> @@ -91,13 +91,13 @@ SECTIONS
>   * crtn.o are in.
>   */
>  PROVIDE (_init = .);
> -*crti.o(.init)
> -*(.init)
> -*crtn.o(.init)
> +KEEP (*crti.o(.init))
> +KEEP (*(.init))
> +KEEP (*crtn.o(.init))
>  PROVIDE (_fini = .);
> -*crti.o(.fini)
> -*(.fini)
> -*crtn.o(.fini)
> +KEEP (*crti.o(.fini))
> +KEEP (*(.fini))
> +KEEP (*crtn.o(.fini))
>
>  /*
>   * Special FreeBSD sysctl sections.
> @@ -122,18 +122,22 @@ SECTIONS
>   * crtend.o.  The same comments apply to it.
>   */
>  . = ALIGN (16);
> -*crtbegin.o(.ctors)
> -*(.ctors)
> -*crtend.o(.ctors)
> -*crtbegin.o(.dtors)
> -*(.dtors)
> -*crtend.o(.dtors)
> +KEEP (*crtbegin.o(.ctors))
> +KEEP (*crtbegin?.o(.ctors))
> +KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
> +KEEP (*(SORT(.ctors.*)))
> +KEEP (*(.ctors))
> +KEEP (*crtbegin.o(.dtors))
> +KEEP (*crtbegin?.o(.dtors))
> +KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
> +KEEP (*(SORT(.dtors.*)))
> +KEEP (*(.dtors))
>
>  /*
>   * Exception frame info
>   */
>  . = ALIGN (16);
> -*(.eh_frame)
> +KEEP (*(.eh_frame))
>
>  /*
>   * Read-only data
> @@ -141,7 +145,7 @@ SECTIONS
>  . = ALIGN (16);
>  _rodata_start = . ;
>  *(.rodata*)
> -   KEEP (*(SORT(.rtemsroset.*)))
> +KEEP (*(SORT(.rtemsroset.*)))
>  *(.gnu.linkonce.r*)
>
>  . = ALIGN (16);
> @@ -179,7 +183,7 @@ SECTIONS
>  KEEP (*(SORT(.rtemsrwset.*)))
>  *(.gnu.linkonce.d*)
>  *(.gcc_except_table*)
> -*(.jcr)
> +KEEP (*(.jcr))
>  . = ALIGN (16);
>  PROVIDE (_edata = .);
>  PROVIDE (_copy_end = .);
> --
> 2.25.1
>
> ___
> devel mailing list
> devel@rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH] m68k/uC5282: linkcmds KEEP and SORT sections

2021-07-01 Thread Gedare Bloom
On Thu, Jul 1, 2021 at 12:58 PM Joel Sherrill  wrote:
>
> On Thu, Jul 1, 2021 at 1:50 PM Gedare Bloom  wrote:
> >
> > Hello all,
> >
> > The uC5282 stopped working in 5 and master. This patch seems to get
> > things working again on both branches. I can run hello.exe and
> > ticker.exe on the WIP qemu Harrison is working on.
>
> Based on our chats, it looks like the move to per function section linking
> pointing out deficiencies in a few BSPs linker scripts. Maybe someone
> on your side can grep and see if there are any more obvious places
> missing KEEP.
>
> > I will back-port to 5 with a ticket.
>
> Great!
>
> > We'll work on full tester configuration after the WIP qemu
> > modifications are finished. (Test execution termination isn't working,
> > so automation is out.)
>
> Is there a reset register on the uc5282? Qemu has support in some
> machine models for exiting instead of resetting via a command line
> option.
>
> Otherwise, poke Alex to see what he did with the Microblaze. I don't
> think qemu exits automatically for it either.
>
There's some kind of reset controller modeled. I think we're close.

"Looks ok to me. Push to both branches."
Thanks, I'm going to check this in on both branches.

> --joel
>
> >
> > Gedare
> >
> > On Thu, Jul 1, 2021 at 12:40 PM Gedare Bloom  wrote:
> > >
> > > Fixes a problem with bad epilog code in _fini and to keep sections
> > > necessary with the -ffunction/data-sections.
> > > ---
> > >  bsps/m68k/uC5282/start/linkcmds | 34 ++---
> > >  1 file changed, 19 insertions(+), 15 deletions(-)
> > >
> > > diff --git a/bsps/m68k/uC5282/start/linkcmds 
> > > b/bsps/m68k/uC5282/start/linkcmds
> > > index 6ac9de96ae..2111e53036 100644
> > > --- a/bsps/m68k/uC5282/start/linkcmds
> > > +++ b/bsps/m68k/uC5282/start/linkcmds
> > > @@ -91,13 +91,13 @@ SECTIONS
> > >   * crtn.o are in.
> > >   */
> > >  PROVIDE (_init = .);
> > > -*crti.o(.init)
> > > -*(.init)
> > > -*crtn.o(.init)
> > > +KEEP (*crti.o(.init))
> > > +KEEP (*(.init))
> > > +KEEP (*crtn.o(.init))
> > >  PROVIDE (_fini = .);
> > > -*crti.o(.fini)
> > > -*(.fini)
> > > -*crtn.o(.fini)
> > > +KEEP (*crti.o(.fini))
> > > +KEEP (*(.fini))
> > > +KEEP (*crtn.o(.fini))
> > >
> > >  /*
> > >   * Special FreeBSD sysctl sections.
> > > @@ -122,18 +122,22 @@ SECTIONS
> > >   * crtend.o.  The same comments apply to it.
> > >   */
> > >  . = ALIGN (16);
> > > -*crtbegin.o(.ctors)
> > > -*(.ctors)
> > > -*crtend.o(.ctors)
> > > -*crtbegin.o(.dtors)
> > > -*(.dtors)
> > > -*crtend.o(.dtors)
> > > +KEEP (*crtbegin.o(.ctors))
> > > +KEEP (*crtbegin?.o(.ctors))
> > > +KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
> > > +KEEP (*(SORT(.ctors.*)))
> > > +KEEP (*(.ctors))
> > > +KEEP (*crtbegin.o(.dtors))
> > > +KEEP (*crtbegin?.o(.dtors))
> > > +KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
> > > +KEEP (*(SORT(.dtors.*)))
> > > +KEEP (*(.dtors))
> > >
> > >  /*
> > >   * Exception frame info
> > >   */
> > >  . = ALIGN (16);
> > > -*(.eh_frame)
> > > +KEEP (*(.eh_frame))
> > >
> > >  /*
> > >   * Read-only data
> > > @@ -141,7 +145,7 @@ SECTIONS
> > >  . = ALIGN (16);
> > >  _rodata_start = . ;
> > >  *(.rodata*)
> > > -   KEEP (*(SORT(.rtemsroset.*)))
> > > +KEEP (*(SORT(.rtemsroset.*)))
> > >  *(.gnu.linkonce.r*)
> > >
> > >  . = ALIGN (16);
> > > @@ -179,7 +183,7 @@ SECTIONS
> > >  KEEP (*(SORT(.rtemsrwset.*)))
> > >  *(.gnu.linkonce.d*)
> > >  *(.gcc_except_table*)
> > > -*(.jcr)
> > > +KEEP (*(.jcr))
> > >  . = ALIGN (16);
> > >  PROVIDE (_edata = .);
> > >  PROVIDE (_copy_end = .);
> > > --
> > > 2.25.1
> > >
> > ___
> > devel mailing list
> > devel@rtems.org
> > http://lists.rtems.org/mailman/listinfo/devel
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel