public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [RFC] Extension to NOCROSSREFS linker script command
@ 2016-04-12 13:51 Matthew Fortune
  2016-04-13 13:47 ` Nick Clifton
  2016-04-14 17:27 ` Hans-Peter Nilsson
  0 siblings, 2 replies; 4+ messages in thread
From: Matthew Fortune @ 2016-04-12 13:51 UTC (permalink / raw)
  To: binutils

I am putting together some advice for creating applications that will run
over multiple cores.  This is in the sense that you create one application
with multiple entry points for each core. Some code and data is specific
to a core and some is shared. Where code and data is private to a core
then I want to guarantee there are no cross references between cores. I
also want to support some checks on references between core-specific and
shared code/data. These restrictions are required because the memory is
simply not accessible on both cores in some cases.

The NOCROSSREFS command in a linker script can easily identify when there
are references between the core-specific code/data of each core, which is
great.

The case I want to handle for shared code and core-specific code is to
allow references from core specific code to shared code but not in the
reverse direction. (Passing function pointers around can of course still
violate this but some level of automated support would be useful.)

My proposal is relatively simple... A new command to check one direction
only:

NOCROSSREFSTO (<to-section> , <from-section1> , <from-section2> ...)

The implementation of this in LD is pretty trivial. Any thoughts on this
or alternative approaches?

Thanks,
Matthew

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC] Extension to NOCROSSREFS linker script command
  2016-04-12 13:51 [RFC] Extension to NOCROSSREFS linker script command Matthew Fortune
@ 2016-04-13 13:47 ` Nick Clifton
  2016-04-13 15:49   ` Matthew Fortune
  2016-04-14 17:27 ` Hans-Peter Nilsson
  1 sibling, 1 reply; 4+ messages in thread
From: Nick Clifton @ 2016-04-13 13:47 UTC (permalink / raw)
  To: Matthew Fortune, binutils

Hi Matthew,

> My proposal is relatively simple... A new command to check one direction
> only:
> 
> NOCROSSREFSTO (<to-section> , <from-section1> , <from-section2> ...)
> 
> The implementation of this in LD is pretty trivial. Any thoughts on this
> or alternative approaches?

Actually this sounds like a sensible approach.

My concern from a binutils point of view is "is it worth it ?"  Any new
feature has the possibility of introducing new bugs, and we want to avoid
feature-creep.  So adding a new feature that is only going to be used by
one person - ie you - would seem like a bad idea.  Now if there were other
people also requesting this functionality, then that would be a different
matter.

Of course this does not mean you should not create the patch if you want to,
just that you should be prepared for the possibility that the patch might
not be accepted into the official sources if we think that it is too risky.

Cheers
  Nick

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [RFC] Extension to NOCROSSREFS linker script command
  2016-04-13 13:47 ` Nick Clifton
@ 2016-04-13 15:49   ` Matthew Fortune
  0 siblings, 0 replies; 4+ messages in thread
From: Matthew Fortune @ 2016-04-13 15:49 UTC (permalink / raw)
  To: Nick Clifton, binutils

Nick Clifton <nickc@redhat.com> writes:
> Hi Matthew,
> 
> > My proposal is relatively simple... A new command to check one
> > direction
> > only:
> >
> > NOCROSSREFSTO (<to-section> , <from-section1> , <from-section2> ...)
> >
> > The implementation of this in LD is pretty trivial. Any thoughts on
> > this or alternative approaches?
> 
> Actually this sounds like a sensible approach.
> 
> My concern from a binutils point of view is "is it worth it ?"  Any new
> feature has the possibility of introducing new bugs, and we want to
> avoid feature-creep.  So adding a new feature that is only going to be
> used by one person - ie you - would seem like a bad idea.  Now if there
> were other people also requesting this functionality, then that would be
> a different matter.
> 
> Of course this does not mean you should not create the patch if you want
> to, just that you should be prepared for the possibility that the patch
> might not be accepted into the official sources if we think that it is
> too risky.

Understood and agreed.

I would hope there are other users beyond myself (or rather MIPS embedded
users) who would find this kind of check useful when working with complex
memory layouts in multi-threaded or multi-core environments...

Either way I'll prepare the patch; it is small (sub 30 lines in my first
attempt) but number of lines doesn't always make decisions easier.

Thanks,
Matthew

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC] Extension to NOCROSSREFS linker script command
  2016-04-12 13:51 [RFC] Extension to NOCROSSREFS linker script command Matthew Fortune
  2016-04-13 13:47 ` Nick Clifton
@ 2016-04-14 17:27 ` Hans-Peter Nilsson
  1 sibling, 0 replies; 4+ messages in thread
From: Hans-Peter Nilsson @ 2016-04-14 17:27 UTC (permalink / raw)
  To: Matthew Fortune; +Cc: binutils

On Tue, 12 Apr 2016, Matthew Fortune wrote:
> My proposal is relatively simple... A new command to check one direction
> only:
>
> NOCROSSREFSTO (<to-section> , <from-section1> , <from-section2> ...)
>
> The implementation of this in LD is pretty trivial. Any thoughts on this
> or alternative approaches?

Today's bikeshed: IMHO there are now one too many juxtaposed
words there.  NOCROSSREFS_TO?

brgds, H-P

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-04-14 17:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-12 13:51 [RFC] Extension to NOCROSSREFS linker script command Matthew Fortune
2016-04-13 13:47 ` Nick Clifton
2016-04-13 15:49   ` Matthew Fortune
2016-04-14 17:27 ` Hans-Peter Nilsson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).