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

Subversion Repositories zipcpu

[/] [zipcpu/] [trunk/] [sim/] [cpp/] [zipelf.cpp] - Diff between revs 207 and 209

Show entire file | Details | Blame | View Log

Rev 207 Rev 209
Line 213... Line 213...
 
 
                current_section++;
                current_section++;
 
 
                r[i]->m_start = phdr.p_paddr;
                r[i]->m_start = phdr.p_paddr;
                r[i]->m_len   = phdr.p_filesz;
                r[i]->m_len   = phdr.p_filesz;
 
                r[i]->m_vaddr = phdr.p_vaddr;
 
 
                current_offset += phdr.p_filesz + sizeof(ELFSECTION);
                current_offset += phdr.p_filesz + sizeof(ELFSECTION);
 
 
                // Now, let's read in our section ...
                // Now, let's read in our section ...
                if (lseek(fd, phdr.p_offset, SEEK_SET) < 0) {
                if (lseek(fd, phdr.p_offset, SEEK_SET) < 0) {
                        fprintf(stderr, "Could not seek to file position %08lx\n", phdr.p_offset);
                        fprintf(stderr, "Could not seek to file position %08lx\n", (unsigned long)phdr.p_offset);
                        perror("O/S Err:");
                        perror("O/S Err:");
                        exit(EXIT_FAILURE);
                        exit(EXIT_FAILURE);
                } if (phdr.p_filesz > phdr.p_memsz)
                } if (phdr.p_filesz > phdr.p_memsz)
                        phdr.p_filesz = 0;
                        phdr.p_filesz = 0;
                if (read(fd, r[i]->m_data, phdr.p_filesz) != (int)phdr.p_filesz) {
                if (read(fd, r[i]->m_data, phdr.p_filesz) != (int)phdr.p_filesz) {

powered by: WebSVN 2.1.0

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