OpenCores
URL https://opencores.org/ocsvn/eco32/eco32/trunk

Subversion Repositories eco32

[/] [eco32/] [trunk/] [binutils/] [ar/] [ranlib.c] - Diff between revs 7 and 115

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 7 Rev 115
Line 26... Line 26...
#define MSB     ((unsigned int) 1 << (sizeof(unsigned int) * 8 - 1))
#define MSB     ((unsigned int) 1 << (sizeof(unsigned int) * 8 - 1))
 
 
 
 
typedef struct {
typedef struct {
  unsigned int name;    /* name of symbol (as offset into string space) */
  unsigned int name;    /* name of symbol (as offset into string space) */
  off_t position;       /* position of member which defines the symbol */
  long position;        /* position of member which defines the symbol */
                        /* (as file offset to the member's ArHeader) */
                        /* (as file offset to the member's ArHeader) */
} Entry;
} Entry;
 
 
 
 
FILE *fi;
FILE *fi;
FILE *fo;
FILE *fo;
 
 
off_t nxtOff;           /* file offset to next member */
long nxtOff;            /* file offset to next member */
off_t curOff;
long curOff;
 
 
Entry table[MAX_SYM_ENTRIES];
Entry table[MAX_SYM_ENTRIES];
int numEntries;
int numEntries;
 
 
int createIndex;
int createIndex;
Line 110... Line 110...
  return 1;
  return 1;
}
}
 
 
 
 
void addSymbol(unsigned int nameOffset) {
void addSymbol(unsigned int nameOffset) {
  off_t curPos;
  long curPos;
  int c;
  int c;
 
 
  if (numEntries >= MAX_SYM_ENTRIES) {
  if (numEntries >= MAX_SYM_ENTRIES) {
    fprintf(stderr, "ar: symbol table overflow\n");
    fprintf(stderr, "ar: symbol table overflow\n");
    exit(1);
    exit(1);
Line 131... Line 131...
  fseek(fi, curPos, SEEK_SET);
  fseek(fi, curPos, SEEK_SET);
}
}
 
 
 
 
void fixSize(void) {
void fixSize(void) {
  off_t deltaOff;
  long deltaOff;
  int pad;
  int pad;
  int i;
  int i;
 
 
  deltaOff = sizeof(arhdr) + sizeof(int) +
  deltaOff = sizeof(arhdr) + sizeof(int) +
             numEntries * sizeof(Entry) + getStringPos();
             numEntries * sizeof(Entry) + getStringPos();
Line 164... Line 164...
void showSymdefs(char *symdefs) {
void showSymdefs(char *symdefs) {
  FILE *in;
  FILE *in;
  int numSymbols;
  int numSymbols;
  int i;
  int i;
  Entry e;
  Entry e;
  off_t curPos;
  long curPos;
  off_t pos;
  long pos;
  int c;
  int c;
 
 
  in = fopen(symdefs, "r");
  in = fopen(symdefs, "r");
  if (in == NULL) {
  if (in == NULL) {
    printf("error: cannot open symdef file '%s'\n", symdefs);
    printf("error: cannot open symdef file '%s'\n", symdefs);

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.