/[dynamips]/trunk/rom2c.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/rom2c.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

upstream/dynamips-0.2.6-RC5/rom2c.c revision 6 by dpavlin, Sat Oct 6 16:09:07 2007 UTC upstream/dynamips-0.2.7-RC1/rom2c.c revision 7 by dpavlin, Sat Oct 6 16:23:47 2007 UTC
# Line 1  Line 1 
1  /*  /*
2   * Cisco 7200 (Predator) simulation platform.   * Cisco router simulation platform.
3   * Copyright (c) 2006 Christophe Fillot (cf@utc.fr)   * Copyright (c) 2006 Christophe Fillot (cf@utc.fr)
4   */   */
5    
# Line 21  Line 21 
21  int main(int argc,char *argv[])  int main(int argc,char *argv[])
22  {    {  
23     unsigned char buffer[8];     unsigned char buffer[8];
24     m_uint32_t vaddr;     m_uint32_t vaddr,start;
25     Elf32_Ehdr *ehdr;     Elf32_Ehdr *ehdr;
26     Elf32_Phdr *phdr;     Elf32_Phdr *phdr;
27     Elf *img_elf;     Elf *img_elf;
# Line 29  int main(int argc,char *argv[]) Line 29  int main(int argc,char *argv[])
29     int i,j,fd;     int i,j,fd;
30     FILE *bfd,*fd_out;     FILE *bfd,*fd_out;
31    
32     if (argc != 3) {     if (argc != 4) {
33        fprintf(stderr,"Usage: %s <input_file> <output_file>\n",argv[0]);        fprintf(stderr,"Usage: %s <input_file> <output_file> <addr>\n",argv[0]);
34        exit(EXIT_FAILURE);        exit(EXIT_FAILURE);
35     }     }
36    
37       start = strtoul(argv[3],NULL,0);
38    
39     if ((fd = open(argv[1],O_RDONLY)) == -1)     if ((fd = open(argv[1],O_RDONLY)) == -1)
40        return(-1);        return(-1);
41    
# Line 77  int main(int argc,char *argv[]) Line 79  int main(int argc,char *argv[])
79        vaddr = (m_uint64_t)phdr->p_vaddr;        vaddr = (m_uint64_t)phdr->p_vaddr;
80        len = phdr->p_filesz;        len = phdr->p_filesz;
81    
82        if (vaddr != 0xbfc00000)        if (vaddr != start)
83           continue;           continue;
84    
85        while(len > 0)        while(len > 0)

Legend:
Removed from v.6  
changed lines
  Added in v.7

  ViewVC Help
Powered by ViewVC 1.1.26