mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* ./scripts/kallsyms.c question
@ 2006-07-10  2:26 Robin Getz
  2006-07-10  3:10 ` Sam Ravnborg
  2006-07-10  6:36 ` Robin Getz
  0 siblings, 2 replies; 4+ messages in thread
From: Robin Getz @ 2006-07-10  2:26 UTC (permalink / raw)
  To: kai; +Cc: linux-kernel

The application kallsyms generate assembler source containing symbol 
information, where "symbol information" is in these pre-defined names:

  _stext, _etext, _sinittext, _einittext, _sextratext, _eextratext

I am working with a processor (Blackfin) which uses these plus two others 
_stext_l1, and _etext_l1.

I can add these in the same fashion as the existing (see below), but was 
wondering if this shouldn't be re-structured with a struct/loop rather than 
the existing n lines of if/else?

Thanks
-Robin

--- ./kallsyms.c.org    2006-04-02 15:42:50.000000000 -0400
+++ ./kallsyms.c        2006-04-02 15:57:25.000000000 -0400
@@ -43,7 +43,7 @@

  static struct sym_entry *table;
  static unsigned int table_size, table_cnt;
-static unsigned long long _stext, _etext, _sinittext, _einittext, 
_sextratext, _eextratext;
+static unsigned long long _stext, _etext, _sinittext, _einittext, 
_sextratext, _eextratext;
+static unsigned long long _stext_l1, _etext_l1;
  static int all_symbols = 0;
  static char symbol_prefix_char = '\0';

@@ -103,6 +103,10 @@
                 _sextratext = s->addr;
         else if (strcmp(sym, "_eextratext") == 0)
                 _eextratext = s->addr;
+       else if (strcmp(sym, "_stext_l1" ) == 0)
+               _stext_l1 = s->addr;
+       else if (strcmp(sym, "_etext_l1" ) == 0)
+               _etext_l1 = s->addr;
         else if (toupper(stype) == 'A')
         {
                 /* Keep these useful absolute symbols */
@@ -161,7 +165,8 @@
         if (!all_symbols) {
                 if ((s->addr < _stext || s->addr > _etext)
                     && (s->addr < _sinittext || s->addr > _einittext)
-                   && (s->addr < _sextratext || s->addr > _eextratext))
+                   && (s->addr < _sextratext || s->addr > _eextratext)
+                   && (s->addr < _stext_l1 || s->addr > _etext_l1))
                         return 0;
                 /* Corner case.  Discard any symbols with the same value as
                  * _etext _einittext or _eextratext; they can move between 
pass


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

* Re: ./scripts/kallsyms.c question
  2006-07-10  2:26 ./scripts/kallsyms.c question Robin Getz
@ 2006-07-10  3:10 ` Sam Ravnborg
  2006-07-10  6:36 ` Robin Getz
  1 sibling, 0 replies; 4+ messages in thread
From: Sam Ravnborg @ 2006-07-10  3:10 UTC (permalink / raw)
  To: Robin Getz; +Cc: kai, linux-kernel

On Sun, Jul 09, 2006 at 10:26:39PM -0400, Robin Getz wrote:
> The application kallsyms generate assembler source containing symbol 
> information, where "symbol information" is in these pre-defined names:
> 
>  _stext, _etext, _sinittext, _einittext, _sextratext, _eextratext
> 
> I am working with a processor (Blackfin) which uses these plus two others 
> _stext_l1, and _etext_l1.
> 
> I can add these in the same fashion as the existing (see below), but was 
> wondering if this shouldn't be re-structured with a struct/loop rather than 
> the existing n lines of if/else?
Keep the existing if/else - it is still readable.
But please add a comment describing that it is blackfin that requires
these two odd sections.

	Sam

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

* Re: ./scripts/kallsyms.c question
  2006-07-10  2:26 ./scripts/kallsyms.c question Robin Getz
  2006-07-10  3:10 ` Sam Ravnborg
@ 2006-07-10  6:36 ` Robin Getz
  2006-07-13 19:23   ` Sam Ravnborg
  1 sibling, 1 reply; 4+ messages in thread
From: Robin Getz @ 2006-07-10  6:36 UTC (permalink / raw)
  To: sam; +Cc: linux-kernel, kai

Sam wrote:
>Keep the existing if/else - it is still readable.
>But please add a comment describing that it is blackfin that requires 
>these two odd sections.

OK - here you go...

-Robin

--- uClinux-dist/linux-2.6.x/scripts/kallsyms.c 2006/03/22 02:52:05     1.5
+++ uClinux-dist/linux-2.6.x/scripts/kallsyms.c 2006/07/10 06:25:40     1.6
@@ -12,6 +12,8 @@
   * (25/Aug/2004) Paulo Marques <pmarques@grupopie.com>
   *      Changed the compression method from stem compression to "table 
lookup"
   *      compression
+ * (10/Jul/2006) Robin Getz <rgetz@blackfin.uclinux.org>
+ *      Add _stext_l1, _etext_l1 for the L1 memory section in Blackfin.
   *
   *      Table compression uses all the unused char codes on the symbols and
   *  maps these to the most used substrings (tokens). For instance, it might
@@ -44,6 +46,7 @@ struct sym_entry {
  static struct sym_entry *table;
  static unsigned int table_size, table_cnt;
  static unsigned long long _stext, _etext, _sinittext, _einittext, 
_sextratext, _eextratext;
+static unsigned long long _stext_l1, _etext_l1;
  static int all_symbols = 0;
  static char symbol_prefix_char = '\0';

@@ -103,6 +106,10 @@ static int read_symbol(FILE *in, struct
                 _sextratext = s->addr;
         else if (strcmp(sym, "_eextratext") == 0)
                 _eextratext = s->addr;
+       else if (strcmp(sym, "_stext_l1" ) == 0)
+               _stext_l1 = s->addr;
+       else if (strcmp(sym, "_etext_l1" ) == 0)
+               _etext_l1 = s->addr;
         else if (toupper(stype) == 'A')
         {
                 /* Keep these useful absolute symbols */
@@ -161,7 +168,8 @@ static int symbol_valid(struct sym_entry
         if (!all_symbols) {
                 if ((s->addr < _stext || s->addr > _etext)
                     && (s->addr < _sinittext || s->addr > _einittext)
-                   && (s->addr < _sextratext || s->addr > _eextratext))
+                   && (s->addr < _sextratext || s->addr > _eextratext)
+                   && (s->addr < _stext_l1 || s->addr > _etext_l1))
                         return 0;
                 /* Corner case.  Discard any symbols with the same value as
                  * _etext _einittext or _eextratext; they can move between 
pass



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

* Re: ./scripts/kallsyms.c question
  2006-07-10  6:36 ` Robin Getz
@ 2006-07-13 19:23   ` Sam Ravnborg
  0 siblings, 0 replies; 4+ messages in thread
From: Sam Ravnborg @ 2006-07-13 19:23 UTC (permalink / raw)
  To: Robin Getz; +Cc: linux-kernel, kai

On Mon, Jul 10, 2006 at 02:36:15AM -0400, Robin Getz wrote:
> Sam wrote:
> >Keep the existing if/else - it is still readable.
> >But please add a comment describing that it is blackfin that requires 
> >these two odd sections.
> 
> OK - here you go...
Thanks. But I'm missing a "signed-off-by: line as per
Documentation/SubmittingPatches.
Please resend with proper changlog and signed-off-by line.

	Sam

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

end of thread, other threads:[~2006-07-13 19:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-10  2:26 ./scripts/kallsyms.c question Robin Getz
2006-07-10  3:10 ` Sam Ravnborg
2006-07-10  6:36 ` Robin Getz
2006-07-13 19:23   ` Sam Ravnborg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®