[uClinux-dev] [PATCH] elf2flt: only print No relocations when in verbose mode

2009-05-07 Thread Mike Frysinger
From: Jie Zhang jie.zh...@analog.com

Signed-off-by: Jie Zhang jie.zh...@analog.com
Signed-off-by: Mike Frysinger vap...@gentoo.org
---
 elf2flt.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/elf2flt.c b/elf2flt.c
index 9ff0299..889ea98 100644
--- a/elf2flt.c
+++ b/elf2flt.c
@@ -2049,7 +2049,7 @@ int main(int argc, char *argv[])
 output_relocs(abs_bfd, symbol_table, number_of_symbols, reloc_len,
  text, text_len, text_vma, data, data_len, data_vma, rel_bfd);
 
-  if (reloc == NULL)
+  if (reloc == NULL  verbose)
 printf(No relocations in code!\n);
 
   text_offs = real_address_bits(text_vma);
-- 
1.6.2.5

___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


[uClinux-dev] [PATCH] elf2flt: update Blackfin port

2009-05-07 Thread Mike Frysinger
Signed-off-by: Mike Frysinger vap...@gentoo.org
---
 elf2flt.c |  337 -
 1 files changed, 130 insertions(+), 207 deletions(-)

diff --git a/elf2flt.c b/elf2flt.c
index 889ea98..9b1ea37 100644
--- a/elf2flt.c
+++ b/elf2flt.c
@@ -102,13 +102,6 @@
 #define ARCHe1-coff
 #elif defined(TARGET_bfin)
 #define ARCH   bfin
-#define FLAT_RELOC_TYPE_TEXT 0
-#define FLAT_RELOC_TYPE_DATA 1
-#define FLAT_RELOC_TYPE_BSS 2
-#define FLAT_RELOC_TYPE_STACK 3
-#define FLAT_RELOC_PART_LO 0
-#define FLAT_RELOC_PART_HI 1
-#define PCREL24_MAGIC_OFFSET -1
 #elif defined(TARGET_nios)
 #define ARCH   nios
 #elif defined(TARGET_nios2)
@@ -152,6 +145,9 @@ int use_resolved = 0; /* If true, get the value of symbol 
references from */
  /* versions of GNU ld will give you a fully resolved */
  /* output file with relocation entries).  */
 
+/* Set if the text section contains any relocations.  If it does, we must
+   set the load_to_ram flag.  */
+int text_has_relocs = 0;
 const char *progname, *filename;
 int lineno;
 
@@ -335,51 +331,52 @@ weak_und_symbol(const char *reloc_section_name,
 }
 
 static int
-bfin_set_reloc (uint32_t *reloc, 
-   const char *reloc_section_name, 
+bfin_set_reloc (uint32_t *reloc,
+   const char *reloc_section_name,
const char *sym_name,
struct bfd_symbol *symbol,
-   int sp, int hilo, int32_t offset)
+   int sp, int32_t offset)
 {
-unsigned int type;
+unsigned int type = 0;
 uint32_t val;
 
-if (strstr (reloc_section_name, text))
-   type = FLAT_RELOC_TYPE_TEXT;
-else if (strstr (reloc_section_name, data))
-   type = FLAT_RELOC_TYPE_DATA;
-else if (strstr (reloc_section_name, bss))
-   type = FLAT_RELOC_TYPE_BSS;
-else if (strstr (reloc_section_name, stack))
-   type = FLAT_RELOC_TYPE_STACK;
-else if (symbol-flags  BSF_WEAK){
-   /* weak symbol support ... if a weak symbol is undefined at the
-  end of a final link, it should return 0 rather than error
-  We will assume text section for the moment.
-   */
-   type = FLAT_RELOC_TYPE_TEXT;
-} else if (strstr (reloc_section_name, *ABS*)){
-   /* (A data section initialization of something in the shared libc's 
text section
-  does not resolve - i.e. a global pointer to function initialized with
-  a libc function).
-  The text section here is appropriate as the section information
-  of the shared library is lost. The loader will do some calcs.
-   */
-   type = FLAT_RELOC_TYPE_TEXT;
-} else {
-   printf (Unknown Type - relocation for %s in bad section - %s\n, 
sym_name, reloc_section_name);
-   return 1;
+if (strstr (reloc_section_name, stack)) {
+   if (verbose)
+   printf (Stack-relative reloc, offset %08lx\n, offset);
+   /* This must be a stack_start reloc for stack checking.  */
+   type = 1;
 }
-
-val = (offset  ((1  26) - 1))  6;
-val |= (sp  (1  3) - 1)  3;
-val |= (hilo  1)  2;
-val |= (type  (1  2) - 1);
+val = (offset  ((1  26) - 1));
+val |= (sp  (1  3) - 1)  26;
+val |= type  29;
 *reloc = val;
 return 0;
 }
-#endif
 
+static bfd *compare_relocs_bfd;
+
+static int
+compare_relocs (const void *pa, const void *pb)
+{
+   const arelent *const *a = pa, *const *b = pb;
+   const arelent *ra = *a, *rb = *b;
+   unsigned long va, vb;
+   uint32_t a_vma, b_vma;
+
+   if (!ra-sym_ptr_ptr || !*ra-sym_ptr_ptr)
+   return -1;
+   else if (!rb-sym_ptr_ptr || !*rb-sym_ptr_ptr)
+   return 1;
+
+   a_vma = bfd_section_vma(compare_relocs_bfd,
+   (*(ra-sym_ptr_ptr))-section);
+   b_vma = bfd_section_vma(compare_relocs_bfd,
+   (*(rb-sym_ptr_ptr))-section);
+   va = (*(ra-sym_ptr_ptr))-value + a_vma + ra-addend;
+   vb = (*(rb-sym_ptr_ptr))-value + b_vma + rb-addend;
+   return va - vb;
+}
+#endif
 
 uint32_t *
 output_relocs (
@@ -406,6 +403,9 @@ output_relocs (
   int  bad_relocs = 0;
   asymbol  **symb;
   long nsymb;
+#ifdef TARGET_bfin
+  unsigned longpersistent_data = 0;
+#endif
   
 #if 0
   printf(%s(%d): output_relocs(abs_bfd=%d,synbols=0x%x,number_of_symbols=%d
@@ -505,6 +505,10 @@ dump_symbols(symbols, number_of_symbols);
__FILE__, __LINE__, r-name);
continue;
} else {
+#ifdef TARGET_bfin
+   compare_relocs_bfd = abs_bfd;
+   qsort (relpp, relcount, sizeof *relpp, compare_relocs);
+#endif
for (p = relpp; (relcount  (*p != NULL)); p++, relcount--) {
unsigned char *r_mem;
int relocation_needed = 0;
@@ -603,7 +607,7 @@ dump_symbols(symbols, 

Re: [uClinux-dev] [PATCH] elf2flt: make code 64-bit clean

2009-05-07 Thread David McCullough
Jivin Mike Frysinger lays it down ...
 From: Bernd Schmidt bernds_...@t-online.de
 
 The FLAT structure is all built on 32bit types, so make sure the elf2flt
 code uses 32bit types rather than long's.  This way we get correct
 behavior when the host sizeof(long) is not 32bit as is on all 64bit
 systems nowadays.
 
 Signed-off-by: Bernd Schmidt bernds_...@t-online.de
 Signed-off-by: Mike Frysinger vap...@gentoo.org

Applied,

Thanks,
Davidm


 ---
  elf2flt.c |   70 ++--
  1 files changed, 35 insertions(+), 35 deletions(-)
 
 diff --git a/elf2flt.c b/elf2flt.c
 index 289d542..a950ff7 100644
 --- a/elf2flt.c
 +++ b/elf2flt.c
 @@ -225,7 +225,7 @@ einfo (int type, const char *format, ...) {
  asymbol**
  get_symbols (bfd *abfd, long *num)
  {
 -  long storage_needed;
 +  int32_t storage_needed;
asymbol **symbol_table;
long number_of_symbols;

 @@ -294,11 +294,11 @@ get_gp_value(asymbol **symbol_table, long 
 number_of_symbols)
   
  
  
 -long
 -add_com_to_bss(asymbol **symbol_table, long number_of_symbols, long bss_len)
 +int32_t
 +add_com_to_bss(asymbol **symbol_table, int32_t number_of_symbols, int32_t 
 bss_len)
  {
 -  long i, comsize;
 -  long offset;
 +  int32_t i, comsize;
 +  int32_t offset;
  
comsize = 0;
for (i=0; inumber_of_symbols; i++) {
 @@ -384,9 +384,9 @@ output_relocs (
bfd *abs_bfd,
asymbol **symbols,
int number_of_symbols,
 -  unsigned long *n_relocs,
 -  unsigned char *text, int text_len, unsigned long text_vma,
 -  unsigned char *data, int data_len, unsigned long data_vma,
 +  uint32_t *n_relocs,
 +  unsigned char *text, int text_len, uint32_t text_vma,
 +  unsigned char *data, int data_len, uint32_t data_vma,
bfd *rel_bfd)
  {
uint32_t   *flat_relocs;
 @@ -396,7 +396,7 @@ output_relocs (
unsigned char  *sectionp;
unsigned long  pflags;
char   addstr[16];
 -  long   sym_addr, sym_vma, section_vma;
 +  uint32_t   sym_addr, sym_vma, section_vma;
intrelsize, relcount;
intflat_reloc_count;
intsym_reloc_size, rc;
 @@ -428,13 +428,13 @@ dump_symbols(symbols, number_of_symbols);
 * terminator even though the relocatable one doesn't have the GOT!
 */
if (pic_with_got  !use_resolved) {
 -unsigned long *lp = (unsigned long *)data;
 +uint32_t *lp = (uint32_t *)data;
  /* Should call ntohl(*lp) here but is isn't going to matter */
  while (*lp != 0x) lp++;
  got_size = ((unsigned char *)lp) - data;
  if (verbose)
   printf(GOT table contains %d entries (%d bytes)\n,
 - got_size/sizeof(unsigned long), got_size);
 + got_size/sizeof(uint32_t), got_size);
  #ifdef TARGET_m68k
  if (got_size  GOT_LIMIT) {
   fprintf(stderr, GOT too large: %d bytes (limit = %d bytes)\n,
 @@ -795,7 +795,7 @@ dump_symbols(symbols, number_of_symbols);
   sym_vma, 
 (*(q-sym_ptr_ptr))-value,
   q-address, sym_addr,
   (*p)-howto-rightshift,
 - *(unsigned long 
 *)r_mem);
 + *(uint32_t *)r_mem);
   sym_vma = bfd_section_vma(abs_bfd, 
 sym_section);
   sym_addr += sym_vma + q-addend;
   break;
 @@ -812,7 +812,7 @@ dump_symbols(symbols, number_of_symbols);
   sym_vma, 
 (*(q-sym_ptr_ptr))-value,
   q-address, sym_addr,
   (*p)-howto-rightshift,
 - *(unsigned long 
 *)r_mem);
 + *(uint32_t *)r_mem);
   case R_ARM_PC24:
   sym_vma = 0;
   sym_addr = 
 (sym_addr-q-address)(*p)-howto-rightshift;
 @@ -903,7 +903,7 @@ dump_symbols(symbols, number_of_symbols);
  the relocation symbol. */
   {
   unsigned char *p = r_mem;
 - unsigned long offset;
 + uint32_t offset;
   pflags=0x8000;
  
   /* work out the relocation */
 @@ -1152,7 +1152,7 @@ NIOS2_RELOC_ERR:
   sym_addr = (((*(q-sym_ptr_ptr))-value-
   q-address)  2)  0x3fff;
  

Re: [uClinux-dev] [PATCH] elf2flt: only print No relocations when in verbose mode

2009-05-07 Thread David McCullough
Jivin Mike Frysinger lays it down ...
 From: Jie Zhang jie.zh...@analog.com
 
 Signed-off-by: Jie Zhang jie.zh...@analog.com
 Signed-off-by: Mike Frysinger vap...@gentoo.org

Applied,

Thanks,
Davidm


 ---
  elf2flt.c |2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
 
 diff --git a/elf2flt.c b/elf2flt.c
 index 9ff0299..889ea98 100644
 --- a/elf2flt.c
 +++ b/elf2flt.c
 @@ -2049,7 +2049,7 @@ int main(int argc, char *argv[])
  output_relocs(abs_bfd, symbol_table, number_of_symbols, reloc_len,
 text, text_len, text_vma, data, data_len, data_vma, rel_bfd);
  
 -  if (reloc == NULL)
 +  if (reloc == NULL  verbose)
  printf(No relocations in code!\n);
  
text_offs = real_address_bits(text_vma);
 -- 
 1.6.2.5
 
 ___
 uClinux-dev mailing list
 uClinux-dev@uclinux.org
 http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
 This message was resent by uclinux-dev@uclinux.org
 To unsubscribe see:
 http://mailman.uclinux.org/mailman/options/uclinux-dev
 

-- 
David McCullough,  david_mccullo...@securecomputing.com,  Ph:+61 734352815
McAfee - SnapGear  http://www.snapgear.comhttp://www.uCdot.org
___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


Re: [uClinux-dev] [PATCH] elf2flt: update Blackfin port

2009-05-07 Thread David McCullough

Jivin Mike Frysinger lays it down ...
 Signed-off-by: Mike Frysinger vap...@gentoo.org

Applied,

Thanks,
Davidm

 ---
  elf2flt.c |  337 
 -
  1 files changed, 130 insertions(+), 207 deletions(-)
 
 diff --git a/elf2flt.c b/elf2flt.c
 index 889ea98..9b1ea37 100644
 --- a/elf2flt.c
 +++ b/elf2flt.c
 @@ -102,13 +102,6 @@
  #define ARCHe1-coff
  #elif defined(TARGET_bfin)
  #define ARCH bfin
 -#define FLAT_RELOC_TYPE_TEXT 0
 -#define FLAT_RELOC_TYPE_DATA 1
 -#define FLAT_RELOC_TYPE_BSS 2
 -#define FLAT_RELOC_TYPE_STACK 3
 -#define FLAT_RELOC_PART_LO 0
 -#define FLAT_RELOC_PART_HI 1
 -#define PCREL24_MAGIC_OFFSET -1
  #elif defined(TARGET_nios)
  #define ARCH nios
  #elif defined(TARGET_nios2)
 @@ -152,6 +145,9 @@ int use_resolved = 0; /* If true, get the value of symbol 
 references from */
 /* versions of GNU ld will give you a fully resolved */
 /* output file with relocation entries).  */
  
 +/* Set if the text section contains any relocations.  If it does, we must
 +   set the load_to_ram flag.  */
 +int text_has_relocs = 0;
  const char *progname, *filename;
  int lineno;
  
 @@ -335,51 +331,52 @@ weak_und_symbol(const char *reloc_section_name,
  }
  
  static int
 -bfin_set_reloc (uint32_t *reloc, 
 - const char *reloc_section_name, 
 +bfin_set_reloc (uint32_t *reloc,
 + const char *reloc_section_name,
   const char *sym_name,
   struct bfd_symbol *symbol,
 - int sp, int hilo, int32_t offset)
 + int sp, int32_t offset)
  {
 -unsigned int type;
 +unsigned int type = 0;
  uint32_t val;
  
 -if (strstr (reloc_section_name, text))
 - type = FLAT_RELOC_TYPE_TEXT;
 -else if (strstr (reloc_section_name, data))
 - type = FLAT_RELOC_TYPE_DATA;
 -else if (strstr (reloc_section_name, bss))
 - type = FLAT_RELOC_TYPE_BSS;
 -else if (strstr (reloc_section_name, stack))
 - type = FLAT_RELOC_TYPE_STACK;
 -else if (symbol-flags  BSF_WEAK){
 - /* weak symbol support ... if a weak symbol is undefined at the
 -end of a final link, it should return 0 rather than error
 -We will assume text section for the moment.
 - */
 - type = FLAT_RELOC_TYPE_TEXT;
 -} else if (strstr (reloc_section_name, *ABS*)){
 - /* (A data section initialization of something in the shared libc's 
 text section
 -does not resolve - i.e. a global pointer to function initialized with
 -a libc function).
 -The text section here is appropriate as the section information
 -of the shared library is lost. The loader will do some calcs.
 - */
 - type = FLAT_RELOC_TYPE_TEXT;
 -} else {
 - printf (Unknown Type - relocation for %s in bad section - %s\n, 
 sym_name, reloc_section_name);
 - return 1;
 +if (strstr (reloc_section_name, stack)) {
 + if (verbose)
 + printf (Stack-relative reloc, offset %08lx\n, offset);
 + /* This must be a stack_start reloc for stack checking.  */
 + type = 1;
  }
 -
 -val = (offset  ((1  26) - 1))  6;
 -val |= (sp  (1  3) - 1)  3;
 -val |= (hilo  1)  2;
 -val |= (type  (1  2) - 1);
 +val = (offset  ((1  26) - 1));
 +val |= (sp  (1  3) - 1)  26;
 +val |= type  29;
  *reloc = val;
  return 0;
  }
 -#endif
  
 +static bfd *compare_relocs_bfd;
 +
 +static int
 +compare_relocs (const void *pa, const void *pb)
 +{
 + const arelent *const *a = pa, *const *b = pb;
 + const arelent *ra = *a, *rb = *b;
 + unsigned long va, vb;
 + uint32_t a_vma, b_vma;
 +
 + if (!ra-sym_ptr_ptr || !*ra-sym_ptr_ptr)
 + return -1;
 + else if (!rb-sym_ptr_ptr || !*rb-sym_ptr_ptr)
 + return 1;
 +
 + a_vma = bfd_section_vma(compare_relocs_bfd,
 + (*(ra-sym_ptr_ptr))-section);
 + b_vma = bfd_section_vma(compare_relocs_bfd,
 + (*(rb-sym_ptr_ptr))-section);
 + va = (*(ra-sym_ptr_ptr))-value + a_vma + ra-addend;
 + vb = (*(rb-sym_ptr_ptr))-value + b_vma + rb-addend;
 + return va - vb;
 +}
 +#endif
  
  uint32_t *
  output_relocs (
 @@ -406,6 +403,9 @@ output_relocs (
intbad_relocs = 0;
asymbol**symb;
long   nsymb;
 +#ifdef TARGET_bfin
 +  unsigned long  persistent_data = 0;
 +#endif

  #if 0
printf(%s(%d): output_relocs(abs_bfd=%d,synbols=0x%x,number_of_symbols=%d
 @@ -505,6 +505,10 @@ dump_symbols(symbols, number_of_symbols);
   __FILE__, __LINE__, r-name);
   continue;
   } else {
 +#ifdef TARGET_bfin
 + compare_relocs_bfd = abs_bfd;
 + qsort (relpp, relcount, sizeof *relpp, compare_relocs);
 +#endif
   for (p = relpp; (relcount  (*p != NULL)); p++, relcount--) {
   unsigned 

Re: [uClinux-dev] [PATCH] elf2flt: only define get_gp_value for nios2

2009-05-07 Thread David McCullough
Jivin Mike Frysinger lays it down ...
 Since the nios2 port is the only one to use the get_gp_value() function,
 stick it behind a TARGET_nios2 ifdef.
 
 Signed-off-by: Mike Frysinger vap...@gentoo.org

Applied,

Thanks,
Davidm


 ---
  elf2flt.c |4 +++-
  1 files changed, 3 insertions(+), 1 deletions(-)
 
 diff --git a/elf2flt.c b/elf2flt.c
 index a950ff7..9ff0299 100644
 --- a/elf2flt.c
 +++ b/elf2flt.c
 @@ -281,6 +281,7 @@ get_symbol_offset(char *name, asection *sec, asymbol 
 **symbol_table, long number
  
  
  
 +#ifdef TARGET_nios2
  long
  get_gp_value(asymbol **symbol_table, long number_of_symbols)
  {
 @@ -291,7 +292,8 @@ get_gp_value(asymbol **symbol_table, long 
 number_of_symbols)
}
return -1;
  }
 - 
 +#endif
 +
  
  
  int32_t
 -- 
 1.6.2.5
 
 ___
 uClinux-dev mailing list
 uClinux-dev@uclinux.org
 http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
 This message was resent by uclinux-dev@uclinux.org
 To unsubscribe see:
 http://mailman.uclinux.org/mailman/options/uclinux-dev
 

-- 
David McCullough,  david_mccullo...@securecomputing.com,  Ph:+61 734352815
McAfee - SnapGear  http://www.snapgear.comhttp://www.uCdot.org
___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


[uClinux-dev] [PATCH] elf2flt: only define get_gp_value for nios2

2009-05-07 Thread Mike Frysinger
Since the nios2 port is the only one to use the get_gp_value() function,
stick it behind a TARGET_nios2 ifdef.

Signed-off-by: Mike Frysinger vap...@gentoo.org
---
 elf2flt.c |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/elf2flt.c b/elf2flt.c
index a950ff7..9ff0299 100644
--- a/elf2flt.c
+++ b/elf2flt.c
@@ -281,6 +281,7 @@ get_symbol_offset(char *name, asection *sec, asymbol 
**symbol_table, long number
 
 
 
+#ifdef TARGET_nios2
 long
 get_gp_value(asymbol **symbol_table, long number_of_symbols)
 {
@@ -291,7 +292,8 @@ get_gp_value(asymbol **symbol_table, long number_of_symbols)
   }
   return -1;
 }
- 
+#endif
+
 
 
 int32_t
-- 
1.6.2.5

___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


[uClinux-dev] [PATCH] elf2flt: make code 64-bit clean

2009-05-07 Thread Mike Frysinger
From: Bernd Schmidt bernds_...@t-online.de

The FLAT structure is all built on 32bit types, so make sure the elf2flt
code uses 32bit types rather than long's.  This way we get correct
behavior when the host sizeof(long) is not 32bit as is on all 64bit
systems nowadays.

Signed-off-by: Bernd Schmidt bernds_...@t-online.de
Signed-off-by: Mike Frysinger vap...@gentoo.org
---
 elf2flt.c |   70 ++--
 1 files changed, 35 insertions(+), 35 deletions(-)

diff --git a/elf2flt.c b/elf2flt.c
index 289d542..a950ff7 100644
--- a/elf2flt.c
+++ b/elf2flt.c
@@ -225,7 +225,7 @@ einfo (int type, const char *format, ...) {
 asymbol**
 get_symbols (bfd *abfd, long *num)
 {
-  long storage_needed;
+  int32_t storage_needed;
   asymbol **symbol_table;
   long number_of_symbols;
   
@@ -294,11 +294,11 @@ get_gp_value(asymbol **symbol_table, long 
number_of_symbols)
  
 
 
-long
-add_com_to_bss(asymbol **symbol_table, long number_of_symbols, long bss_len)
+int32_t
+add_com_to_bss(asymbol **symbol_table, int32_t number_of_symbols, int32_t 
bss_len)
 {
-  long i, comsize;
-  long offset;
+  int32_t i, comsize;
+  int32_t offset;
 
   comsize = 0;
   for (i=0; inumber_of_symbols; i++) {
@@ -384,9 +384,9 @@ output_relocs (
   bfd *abs_bfd,
   asymbol **symbols,
   int number_of_symbols,
-  unsigned long *n_relocs,
-  unsigned char *text, int text_len, unsigned long text_vma,
-  unsigned char *data, int data_len, unsigned long data_vma,
+  uint32_t *n_relocs,
+  unsigned char *text, int text_len, uint32_t text_vma,
+  unsigned char *data, int data_len, uint32_t data_vma,
   bfd *rel_bfd)
 {
   uint32_t *flat_relocs;
@@ -396,7 +396,7 @@ output_relocs (
   unsigned char*sectionp;
   unsigned longpflags;
   char addstr[16];
-  long sym_addr, sym_vma, section_vma;
+  uint32_t sym_addr, sym_vma, section_vma;
   int  relsize, relcount;
   int  flat_reloc_count;
   int  sym_reloc_size, rc;
@@ -428,13 +428,13 @@ dump_symbols(symbols, number_of_symbols);
* terminator even though the relocatable one doesn't have the GOT!
*/
   if (pic_with_got  !use_resolved) {
-unsigned long *lp = (unsigned long *)data;
+uint32_t *lp = (uint32_t *)data;
 /* Should call ntohl(*lp) here but is isn't going to matter */
 while (*lp != 0x) lp++;
 got_size = ((unsigned char *)lp) - data;
 if (verbose)
printf(GOT table contains %d entries (%d bytes)\n,
-   got_size/sizeof(unsigned long), got_size);
+   got_size/sizeof(uint32_t), got_size);
 #ifdef TARGET_m68k
 if (got_size  GOT_LIMIT) {
fprintf(stderr, GOT too large: %d bytes (limit = %d bytes)\n,
@@ -795,7 +795,7 @@ dump_symbols(symbols, number_of_symbols);
sym_vma, 
(*(q-sym_ptr_ptr))-value,
q-address, sym_addr,
(*p)-howto-rightshift,
-   *(unsigned long 
*)r_mem);
+   *(uint32_t *)r_mem);
sym_vma = bfd_section_vma(abs_bfd, 
sym_section);
sym_addr += sym_vma + q-addend;
break;
@@ -812,7 +812,7 @@ dump_symbols(symbols, number_of_symbols);
sym_vma, 
(*(q-sym_ptr_ptr))-value,
q-address, sym_addr,
(*p)-howto-rightshift,
-   *(unsigned long 
*)r_mem);
+   *(uint32_t *)r_mem);
case R_ARM_PC24:
sym_vma = 0;
sym_addr = 
(sym_addr-q-address)(*p)-howto-rightshift;
@@ -903,7 +903,7 @@ dump_symbols(symbols, number_of_symbols);
   the relocation symbol. */
{
unsigned char *p = r_mem;
-   unsigned long offset;
+   uint32_t offset;
pflags=0x8000;
 
/* work out the relocation */
@@ -1152,7 +1152,7 @@ NIOS2_RELOC_ERR:
sym_addr = (((*(q-sym_ptr_ptr))-value-
q-address)  2)  0x3fff;
sym_addr |= (
-   ntohl(*(unsigned long *)r_mem)
+

Re: [uClinux-dev] [PATCH] elf2flt: only define get_gp_value for nios2

2009-05-07 Thread Michael Schnell

Mike Frysinger wrote:

Since the nios2 port is the only one to use ...

Is NIOS now official here ?

-Michael
___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


[uClinux-dev] Re: uclinux make menuconfig process ?

2009-05-07 Thread Arthur Wong
In top level Makefile:

@if egrep ^CONFIG_DEFAULTS_VENDOR=y .config  /dev/null; then \
$(MAKE) config_$@; \
 fi


2009/5/6 Arthur Wong wzc0...@gmail.com

 Hi, all:

 When make menuconfig, after select [*] Customize Application/Library
 Settings, then the userland's configuration will auto displayed.
 I only know the option is defined in uClinux-dist/config/mkconfig, but
 cannot track deeper...

 Does anybody know how it's happened ?

___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

[uClinux-dev] uClinux on the Linksys BEFSX41?

2009-05-07 Thread Andrew Wiley
I've just stumbled onto this project because I'm investigating the
possibility of running linux on my Linksys BEFSX41 wired router. The Linksys
firmware is... bad, and while running uClinux on this appliance has been
proven to be possible (
http://www.bettina-attack.de/jonny/view.php/projects/linksys_befsx41_stuff/installing_uclinux/),
I can't find any documentation describing the build process.
As that page shows, this router runs on a Conexant CX82100-51 processor, an
ARM 940T processor. This system has no MMU, 2 MB of flash memory, and 8MB of
RAM.
Is it feasible to install uClinux in this device? Would it have enough space
in the flash memory to function as a standalone router?

Andrew Wiley
___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Re: [uClinux-dev] uClinux on the Linksys BEFSX41?

2009-05-07 Thread Erwin Authried
I had uClinux running on a W90N740 based router with only 1MB Flash and
4MB RAM. This was close to the minimum that is required. With 2MB Flash
and 8MB RAM, you have plenty of space.

-Erwin

Am Donnerstag, den 07.05.2009, 09:43 -0500 schrieb Andrew Wiley:
 I've just stumbled onto this project because I'm investigating the
 possibility of running linux on my Linksys BEFSX41 wired router. The
 Linksys firmware is... bad, and while running uClinux on this
 appliance has been proven to be possible
 (http://www.bettina-attack.de/jonny/view.php/projects/linksys_befsx41_stuff/installing_uclinux/),
  I can't find any documentation describing the build process.
 As that page shows, this router runs on a Conexant CX82100-51
 processor, an ARM 940T processor. This system has no MMU, 2 MB of
 flash memory, and 8MB of RAM.
 Is it feasible to install uClinux in this device? Would it have enough
 space in the flash memory to function as a standalone router?
 
 Andrew Wiley



___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


Re: [uClinux-dev] [PATCH] elf2flt: only define get_gp_value for nios2

2009-05-07 Thread Mike Frysinger
On Thursday 07 May 2009 04:58:31 Michael Schnell wrote:
 Mike Frysinger wrote:
  Since the nios2 port is the only one to use ...

 Is NIOS now official here ?

the elf2flt code has had nios changes in it for a very long time.  it has no 
bearing on the uclinux-dist.
-mike


signature.asc
Description: This is a digitally signed message part.
___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

[uClinux-dev] request

2009-05-07 Thread 张胜源

 
request___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

[uClinux-dev] can uclinux be installed on str710F-Z2T6?

2009-05-07 Thread 冯娟
hello everyone
  I am using str710F-Z2T6 and I want to install an OS on it which
includes networking protocol especially wireless ones. Does unlinux include
that? and can uclinux be installed on str710F-Z2T6? It only has (256+16)KB
Flash、64KB SRAM, and 256K×16 SRAM = 512KB RAM. I want to know what's
smallest size of uclinux?
  Thanks a lot
___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev