diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-02-07 01:49:38 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-02-07 01:49:38 +0000 |
commit | 02665f6061ac2edd5f22a43ab016067fe6f15d81 (patch) | |
tree | 283523f3fe221179626dff7375d57e539b886bcb /misc/pascal/libpoff | |
parent | f2ac07effed03e8b4910baeabde79f42e6455cdd (diff) | |
download | nuttx-02665f6061ac2edd5f22a43ab016067fe6f15d81.tar.gz nuttx-02665f6061ac2edd5f22a43ab016067fe6f15d81.tar.bz2 nuttx-02665f6061ac2edd5f22a43ab016067fe6f15d81.zip |
changes for build with SDCC toolchain
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@657 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'misc/pascal/libpoff')
-rw-r--r-- | misc/pascal/libpoff/Make.defs | 2 | ||||
-rw-r--r-- | misc/pascal/libpoff/pflineno.c | 4 | ||||
-rw-r--r-- | misc/pascal/libpoff/pfread.c | 18 | ||||
-rw-r--r-- | misc/pascal/libpoff/pfrrawlineno.c | 2 | ||||
-rw-r--r-- | misc/pascal/libpoff/pfrrawreloc.c | 2 |
5 files changed, 16 insertions, 12 deletions
diff --git a/misc/pascal/libpoff/Make.defs b/misc/pascal/libpoff/Make.defs index 67852b705..7de36ec5a 100644 --- a/misc/pascal/libpoff/Make.defs +++ b/misc/pascal/libpoff/Make.defs @@ -45,4 +45,4 @@ POFF_CSRCS = pfhandle.c pfproghandle.c pftprog.c \ pfrelease.c pfdbgcontainer.c pfdbgdiscard.c \ pfxprog.c pfxrodata.c pfiprog.c pfirodata.c \ pfdhdr.c pfdsymbol.c pfdreloc.c pflabel.c \ - pflineno.c pfdbginfo.c pfswap.c + pfdbginfo.c pfswap.c diff --git a/misc/pascal/libpoff/pflineno.c b/misc/pascal/libpoff/pflineno.c index 647194643..95d17723b 100644 --- a/misc/pascal/libpoff/pflineno.c +++ b/misc/pascal/libpoff/pflineno.c @@ -49,6 +49,8 @@ #include "perr.h" /* error() */
#include "pofflib.h" /* POFF library interface */
+poffLibLineNumber_t
+
/**********************************************************************
* Definitions
**********************************************************************/
@@ -139,7 +141,7 @@ static void poffAddLineNumberToTable(poffLibLineNumber_t *lineno) /* Save the line number information in the line number table */
- lineNumberTable[nLineNumbers] = *lineno;
+ memcpy(&lineNumberTable[nLineNumbers], lineno, sizeof(poffLibLineNumber_t));
nLineNumbers++;
}
diff --git a/misc/pascal/libpoff/pfread.c b/misc/pascal/libpoff/pfread.c index 1bcc1618a..e28236e43 100644 --- a/misc/pascal/libpoff/pfread.c +++ b/misc/pascal/libpoff/pfread.c @@ -125,6 +125,7 @@ static uint16 poffReadSectionHeaders(poffHandle_t handle, FILE *poffFile) {
poffInfo_t *poffInfo = (poffInfo_t*)handle;
poffSectionHeader_t sectionHeader;
+ poffSectionHeader_t *dest;
long offset;
size_t entriesRead;
int i;
@@ -159,38 +160,39 @@ static uint16 poffReadSectionHeaders(poffHandle_t handle, FILE *poffFile) {
case SHT_PROGDATA : /* Program data */
if ((sectionHeader.sh_flags & SHF_EXEC) != 0)
- poffInfo->progSection = sectionHeader;
+ dest = &poffInfo->progSection;
else
- poffInfo->roDataSection = sectionHeader;
+ dest = &poffInfo->roDataSection;
break;
case SHT_SYMTAB : /* Symbol table */
- poffInfo->symbolTableSection = sectionHeader;
+ dest = &poffInfo->symbolTableSection;
break;
case SHT_STRTAB : /* String table */
- poffInfo->stringTableSection = sectionHeader;
+ dest = &poffInfo->stringTableSection;
break;
case SHT_REL : /* Relocation data */
- poffInfo->relocSection = sectionHeader;
+ dest = &poffInfo->relocSection;
break;
case SHT_FILETAB : /* File table */
- poffInfo->fileNameTableSection = sectionHeader;
+ dest = &poffInfo->fileNameTableSection;
break;
case SHT_LINENO : /* Line number data */
- poffInfo->lineNumberSection = sectionHeader;
+ dest = &poffInfo->lineNumberSection;
break;
case SHT_DEBUG : /* Debug function info data */
- poffInfo->debugFuncSection = sectionHeader;
+ dest = &poffInfo->debugFuncSection;
break;
default:
return ePOFFREADERROR;
}
+ memcpy(dest, §ionHeader, sizeof(poffSectionHeader_t));
/* Get the offset to the next section */
diff --git a/misc/pascal/libpoff/pfrrawlineno.c b/misc/pascal/libpoff/pfrrawlineno.c index 7d3aa1ab0..6eb137157 100644 --- a/misc/pascal/libpoff/pfrrawlineno.c +++ b/misc/pascal/libpoff/pfrrawlineno.c @@ -98,7 +98,7 @@ sint32 poffGetRawLineNumber(poffHandle_t handle, poffLineNumber_t *lineno) {
/* Copy the raw line number information to the user */
- *lineno = *(poffLineNumber_t*)&poffInfo->lineNumberTable[lineNumberIndex];
+ memcpy(lineno, &poffInfo->lineNumberTable[lineNumberIndex], sizeof(poffLineNumber_t));
/* Set up for the next read */
diff --git a/misc/pascal/libpoff/pfrrawreloc.c b/misc/pascal/libpoff/pfrrawreloc.c index 143830d4e..2a3e6d7d5 100644 --- a/misc/pascal/libpoff/pfrrawreloc.c +++ b/misc/pascal/libpoff/pfrrawreloc.c @@ -95,7 +95,7 @@ sint32 poffGetRawRelocation(poffHandle_t handle, poffRelocation_t *lineno) {
/* Copy the raw line number information to the user */
- *lineno = *(poffRelocation_t*)&poffInfo->relocTable[relocIndex];
+ memcpy(lineno, &poffInfo->relocTable[relocIndex], sizeof(poffRelocation_t));
/* Set up for the next read */
|