* fileio.c (elf2b): When checking the bounds of the current

program header segment, subtract `low' from ph[n].p_paddr in order
to correct the magic section offsets for the AVR's non-flash
memory regions.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1080 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
joerg_wunsch 2012-04-18 16:00:21 +00:00
parent 9f0aeb90e2
commit 9704aaeb74
2 changed files with 8 additions and 1 deletions

View File

@ -1,3 +1,10 @@
2012-04-18 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
* fileio.c (elf2b): When checking the bounds of the current
program header segment, subtract `low' from ph[n].p_paddr in order
to correct the magic section offsets for the AVR's non-flash
memory regions.
2012-04-18 Joerg Wunsch <j.gnu@uriah.heep.sax.de> 2012-04-18 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
* fileio.c (elf_get_scn): Rather than trying to just match whether * fileio.c (elf_get_scn): Rather than trying to just match whether

View File

@ -948,7 +948,7 @@ static int elf2b(char * infile, FILE * inf,
* from it, using the "foff" offset obtained above. * from it, using the "foff" offset obtained above.
*/ */
if (mem->size != 1 && if (mem->size != 1 &&
ph[i].p_paddr + ph[i].p_filesz > mem->size) { ph[i].p_paddr - low + ph[i].p_filesz > mem->size) {
fprintf(stderr, fprintf(stderr,
"%s: ERROR: program header entry #%d does not fit into \"%s\" memory:\n" "%s: ERROR: program header entry #%d does not fit into \"%s\" memory:\n"
" 0x%x + %u > %u\n", " 0x%x + %u > %u\n",