diff options
Diffstat (limited to 'misc/pascal/libpoff')
43 files changed, 946 insertions, 946 deletions
diff --git a/misc/pascal/libpoff/Make.defs b/misc/pascal/libpoff/Make.defs index 7de36ec5a..41f0a63f0 100644 --- a/misc/pascal/libpoff/Make.defs +++ b/misc/pascal/libpoff/Make.defs @@ -3,7 +3,7 @@ # NuttX runtime makefile fragment # # Copyright (C) 2008 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt <spudmonkey@racsa.co.cr> +# Author: Gregory Nutt <gnutt@nuttx.org> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions diff --git a/misc/pascal/libpoff/pfdbgcontainer.c b/misc/pascal/libpoff/pfdbgcontainer.c index 572f1c2e6..8387fa15b 100644 --- a/misc/pascal/libpoff/pfdbgcontainer.c +++ b/misc/pascal/libpoff/pfdbgcontainer.c @@ -3,7 +3,7 @@ * Create/destroy debug info container. * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/libpoff/pfdbgdiscard.c b/misc/pascal/libpoff/pfdbgdiscard.c index 0b80e9f45..2574644db 100644 --- a/misc/pascal/libpoff/pfdbgdiscard.c +++ b/misc/pascal/libpoff/pfdbgdiscard.c @@ -1,94 +1,94 @@ -/**********************************************************************
- * pfdbgdiscard.c
- * Discard debug function information
- *
- * Copyright (C) 2008 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- **********************************************************************/
-
-/**********************************************************************
- * Included Files
- **********************************************************************/
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "keywords.h" /* Standard types */
-
-#include "pofflib.h" /* POFF library interface */
-#include "pfprivate.h" /* POFF private definitions */
-
-/**********************************************************************
- * Definitions
- **********************************************************************/
-
-/**********************************************************************
- * Global Variables
- **********************************************************************/
-
-/**********************************************************************
- * Private Variables
- **********************************************************************/
-
-/***********************************************************************
- * Private Function Prototypes
- ***********************************************************************/
-
-/***********************************************************************
- * Private Functions
- ***********************************************************************/
-
-/***********************************************************************
- * Public Functions
- ***********************************************************************/
-
-/***********************************************************************/
-
-void poffDiscardDebugFuncInfo(poffHandle_t handle)
-{
- poffInfo_t *poffInfo = (poffInfo_t*)handle;
-
- /* Deallocate any buffered data */
-
- if (poffInfo->debugFuncTable)
- {
- free(poffInfo->debugFuncTable);
- }
-
- /* And erase any knowledge of the debug info */
-
- poffInfo->debugFuncSection.sh_size = 0;
- poffInfo->debugFuncTable = NULL;
- poffInfo->debugFuncTableAlloc = 0;
- poffInfo->debugFuncIndex = 0;
-}
-
-/***********************************************************************/
+/********************************************************************** + * pfdbgdiscard.c + * Discard debug function information + * + * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt <gnutt@nuttx.org> + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + **********************************************************************/ + +/********************************************************************** + * Included Files + **********************************************************************/ + +#include <stdio.h> +#include <stdlib.h> + +#include "keywords.h" /* Standard types */ + +#include "pofflib.h" /* POFF library interface */ +#include "pfprivate.h" /* POFF private definitions */ + +/********************************************************************** + * Definitions + **********************************************************************/ + +/********************************************************************** + * Global Variables + **********************************************************************/ + +/********************************************************************** + * Private Variables + **********************************************************************/ + +/*********************************************************************** + * Private Function Prototypes + ***********************************************************************/ + +/*********************************************************************** + * Private Functions + ***********************************************************************/ + +/*********************************************************************** + * Public Functions + ***********************************************************************/ + +/***********************************************************************/ + +void poffDiscardDebugFuncInfo(poffHandle_t handle) +{ + poffInfo_t *poffInfo = (poffInfo_t*)handle; + + /* Deallocate any buffered data */ + + if (poffInfo->debugFuncTable) + { + free(poffInfo->debugFuncTable); + } + + /* And erase any knowledge of the debug info */ + + poffInfo->debugFuncSection.sh_size = 0; + poffInfo->debugFuncTable = NULL; + poffInfo->debugFuncTableAlloc = 0; + poffInfo->debugFuncIndex = 0; +} + +/***********************************************************************/ diff --git a/misc/pascal/libpoff/pfdbginfo.c b/misc/pascal/libpoff/pfdbginfo.c index 41ea995cd..1a743f091 100644 --- a/misc/pascal/libpoff/pfdbginfo.c +++ b/misc/pascal/libpoff/pfdbginfo.c @@ -3,7 +3,7 @@ * Manage debug information * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/libpoff/pfdhdr.c b/misc/pascal/libpoff/pfdhdr.c index 4e674a6a5..5ac627e10 100644 --- a/misc/pascal/libpoff/pfdhdr.c +++ b/misc/pascal/libpoff/pfdhdr.c @@ -1,182 +1,182 @@ -/**********************************************************************
- * pfdhdr.c
- * Dump the contents of POFF file and section headers
- *
- * Copyright (C) 2008 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- **********************************************************************/
-
-/**********************************************************************
- * Included Files
- **********************************************************************/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "keywords.h" /* Standard types */
-#include "pfprivate.h" /* POFF private definitions */
-#include "pofflib.h" /* Public interfaces */
-
-/**********************************************************************
- * Definitions
- **********************************************************************/
-
-/**********************************************************************
- * Global Variables
- **********************************************************************/
-
-/**********************************************************************
- * Private Variables
- **********************************************************************/
-
-/**********************************************************************
- * Private Constant Data
- **********************************************************************/
-
-static const char *poffFhTypes[FHT_NTYPES] =
-{
- "NONE ", /* Shouldn't happen */
- "EXEC ", /* Pascal program executable */
- "SHLIB ", /* Pascal shared library */
- "PROGRAM ", /* Pascal program object */
- "UNIT " /* Pascal unit object */
-};
-
-static const char *poffShTypes[SHT_NTYPES] =
-{
- "NULL ", /* Shouldn't happen */
- "PROGDATA", /* Program data */
- "SYMTAB ", /* Symbol table */
- "STRTAB ", /* String table */
- "REL ", /* Relocation data */
- "FILETAB ", /* File table */
- "LINENO ", /* Line number data */
- "DEBUG " /* Func/Proc debug data */
-};
-
-/***********************************************************************
- * Private Function Prototypes
- ***********************************************************************/
-
-/***********************************************************************
- * Private Functions
- ***********************************************************************/
-
-static void poffDumpSectionHeader(poffHandle_t handle,
- poffSectionHeader_t *shdr,
- FILE *outFile)
-{
- poffInfo_t *poffInfo = (poffInfo_t*)handle;
-
- fprintf(outFile, "%-10s %8s 0x%02x 0x%04x 0x%08lx 0x%08lx %ld\n",
- poffGetString(poffInfo, shdr->sh_name),
- poffShTypes[shdr->sh_type], shdr->sh_flags,
- shdr->sh_entsize, shdr->sh_addr, shdr->sh_offset,
- shdr->sh_size);
-}
-
-/***********************************************************************
- * Public Functions
- ***********************************************************************/
-
-/***********************************************************************/
-
-void poffDumpFileHeader(poffHandle_t handle, FILE *outFile)
-{
- poffInfo_t *poffInfo = (poffInfo_t*)handle;
-
- fprintf(outFile, "\nPOFF File Header:\n");
- fprintf(outFile, " fh_ident: %c%c%c%c\n",
- poffInfo->fileHeader.fh_ident[0], poffInfo->fileHeader.fh_ident[1],
- poffInfo->fileHeader.fh_ident[2], poffInfo->fileHeader.fh_ident[3]);
- fprintf(outFile, " fh_version: %d\n", poffInfo->fileHeader.fh_version);
- fprintf(outFile, " fh_type: %s\n",
- poffFhTypes[poffInfo->fileHeader.fh_type]);
- fprintf(outFile, " fh_shsize: %d\n", poffInfo->fileHeader.fh_shsize);
- fprintf(outFile, " fh_shnum: %d\n", poffInfo->fileHeader.fh_shnum);
- fprintf(outFile, " fh_name: %s\n",
- poffGetString(poffInfo, poffInfo->fileHeader.fh_name));
- fprintf(outFile, " fh_entry: 0x%08lx\n", poffInfo->fileHeader.fh_entry);
- fprintf(outFile, " fh_shoff: 0x%08lx\n", poffInfo->fileHeader.fh_shoff);
-}
-
-/***********************************************************************/
-
-void poffDumpSectionHeaders(poffHandle_t handle, FILE *outFile)
-{
- poffInfo_t *poffInfo = (poffInfo_t*)handle;
-
- fprintf(outFile, "\nPOFF Section Headers:\n");
- fprintf(outFile, "NAME TYPE FLAG ENTSZE ADDRESS OFFSET SIZE\n");
-
- if (poffInfo->progSection.sh_size > 0)
- {
- poffDumpSectionHeader(handle, &poffInfo->progSection, outFile);
- }
-
- if (poffInfo->roDataSection.sh_size > 0)
- {
- poffDumpSectionHeader(handle, &poffInfo->roDataSection, outFile);
- }
-
- if (poffInfo->symbolTableSection.sh_size > 0)
- {
- poffDumpSectionHeader(handle, &poffInfo->symbolTableSection, outFile);
- }
-
- if (poffInfo->stringTableSection.sh_size > 0)
- {
- poffDumpSectionHeader(handle, &poffInfo->stringTableSection, outFile);
- }
-
- if (poffInfo->relocSection.sh_size > 0)
- {
- poffDumpSectionHeader(handle, &poffInfo->relocSection, outFile);
- }
-
- if (poffInfo->fileNameTableSection.sh_size > 0)
- {
- poffDumpSectionHeader(handle, &poffInfo->fileNameTableSection, outFile);
- }
-
- if (poffInfo->lineNumberSection.sh_size > 0)
- {
- poffDumpSectionHeader(handle, &poffInfo->lineNumberSection, outFile);
- }
-
- if (poffInfo->debugFuncSection.sh_size > 0)
- {
- poffDumpSectionHeader(handle, &poffInfo->debugFuncSection, outFile);
- }
-}
-
-/***********************************************************************/
+/********************************************************************** + * pfdhdr.c + * Dump the contents of POFF file and section headers + * + * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt <gnutt@nuttx.org> + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + **********************************************************************/ + +/********************************************************************** + * Included Files + **********************************************************************/ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include "keywords.h" /* Standard types */ +#include "pfprivate.h" /* POFF private definitions */ +#include "pofflib.h" /* Public interfaces */ + +/********************************************************************** + * Definitions + **********************************************************************/ + +/********************************************************************** + * Global Variables + **********************************************************************/ + +/********************************************************************** + * Private Variables + **********************************************************************/ + +/********************************************************************** + * Private Constant Data + **********************************************************************/ + +static const char *poffFhTypes[FHT_NTYPES] = +{ + "NONE ", /* Shouldn't happen */ + "EXEC ", /* Pascal program executable */ + "SHLIB ", /* Pascal shared library */ + "PROGRAM ", /* Pascal program object */ + "UNIT " /* Pascal unit object */ +}; + +static const char *poffShTypes[SHT_NTYPES] = +{ + "NULL ", /* Shouldn't happen */ + "PROGDATA", /* Program data */ + "SYMTAB ", /* Symbol table */ + "STRTAB ", /* String table */ + "REL ", /* Relocation data */ + "FILETAB ", /* File table */ + "LINENO ", /* Line number data */ + "DEBUG " /* Func/Proc debug data */ +}; + +/*********************************************************************** + * Private Function Prototypes + ***********************************************************************/ + +/*********************************************************************** + * Private Functions + ***********************************************************************/ + +static void poffDumpSectionHeader(poffHandle_t handle, + poffSectionHeader_t *shdr, + FILE *outFile) +{ + poffInfo_t *poffInfo = (poffInfo_t*)handle; + + fprintf(outFile, "%-10s %8s 0x%02x 0x%04x 0x%08lx 0x%08lx %ld\n", + poffGetString(poffInfo, shdr->sh_name), + poffShTypes[shdr->sh_type], shdr->sh_flags, + shdr->sh_entsize, shdr->sh_addr, shdr->sh_offset, + shdr->sh_size); +} + +/*********************************************************************** + * Public Functions + ***********************************************************************/ + +/***********************************************************************/ + +void poffDumpFileHeader(poffHandle_t handle, FILE *outFile) +{ + poffInfo_t *poffInfo = (poffInfo_t*)handle; + + fprintf(outFile, "\nPOFF File Header:\n"); + fprintf(outFile, " fh_ident: %c%c%c%c\n", + poffInfo->fileHeader.fh_ident[0], poffInfo->fileHeader.fh_ident[1], + poffInfo->fileHeader.fh_ident[2], poffInfo->fileHeader.fh_ident[3]); + fprintf(outFile, " fh_version: %d\n", poffInfo->fileHeader.fh_version); + fprintf(outFile, " fh_type: %s\n", + poffFhTypes[poffInfo->fileHeader.fh_type]); + fprintf(outFile, " fh_shsize: %d\n", poffInfo->fileHeader.fh_shsize); + fprintf(outFile, " fh_shnum: %d\n", poffInfo->fileHeader.fh_shnum); + fprintf(outFile, " fh_name: %s\n", + poffGetString(poffInfo, poffInfo->fileHeader.fh_name)); + fprintf(outFile, " fh_entry: 0x%08lx\n", poffInfo->fileHeader.fh_entry); + fprintf(outFile, " fh_shoff: 0x%08lx\n", poffInfo->fileHeader.fh_shoff); +} + +/***********************************************************************/ + +void poffDumpSectionHeaders(poffHandle_t handle, FILE *outFile) +{ + poffInfo_t *poffInfo = (poffInfo_t*)handle; + + fprintf(outFile, "\nPOFF Section Headers:\n"); + fprintf(outFile, "NAME TYPE FLAG ENTSZE ADDRESS OFFSET SIZE\n"); + + if (poffInfo->progSection.sh_size > 0) + { + poffDumpSectionHeader(handle, &poffInfo->progSection, outFile); + } + + if (poffInfo->roDataSection.sh_size > 0) + { + poffDumpSectionHeader(handle, &poffInfo->roDataSection, outFile); + } + + if (poffInfo->symbolTableSection.sh_size > 0) + { + poffDumpSectionHeader(handle, &poffInfo->symbolTableSection, outFile); + } + + if (poffInfo->stringTableSection.sh_size > 0) + { + poffDumpSectionHeader(handle, &poffInfo->stringTableSection, outFile); + } + + if (poffInfo->relocSection.sh_size > 0) + { + poffDumpSectionHeader(handle, &poffInfo->relocSection, outFile); + } + + if (poffInfo->fileNameTableSection.sh_size > 0) + { + poffDumpSectionHeader(handle, &poffInfo->fileNameTableSection, outFile); + } + + if (poffInfo->lineNumberSection.sh_size > 0) + { + poffDumpSectionHeader(handle, &poffInfo->lineNumberSection, outFile); + } + + if (poffInfo->debugFuncSection.sh_size > 0) + { + poffDumpSectionHeader(handle, &poffInfo->debugFuncSection, outFile); + } +} + +/***********************************************************************/ diff --git a/misc/pascal/libpoff/pfdreloc.c b/misc/pascal/libpoff/pfdreloc.c index 5e9f5bcfe..06726e1a1 100644 --- a/misc/pascal/libpoff/pfdreloc.c +++ b/misc/pascal/libpoff/pfdreloc.c @@ -3,7 +3,7 @@ * Dump contents of a POFF file reloc table * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/libpoff/pfdsymbol.c b/misc/pascal/libpoff/pfdsymbol.c index cce272616..c65fa7267 100644 --- a/misc/pascal/libpoff/pfdsymbol.c +++ b/misc/pascal/libpoff/pfdsymbol.c @@ -3,7 +3,7 @@ * Dump contents of a POFF file symbol table * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/libpoff/pfhandle.c b/misc/pascal/libpoff/pfhandle.c index 458d63182..96d072322 100644 --- a/misc/pascal/libpoff/pfhandle.c +++ b/misc/pascal/libpoff/pfhandle.c @@ -1,195 +1,195 @@ -/**********************************************************************
- * pfhandle.c
- * POFF library global variables
- *
- * Copyright (C) 2008 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- **********************************************************************/
-
-/**********************************************************************
- * Included Files
- **********************************************************************/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "keywords.h" /* Standard types */
-#include "pfprivate.h" /* POFF private definitions */
-#include "pofflib.h" /* Public interfaces */
-
-/**********************************************************************
- * Definitions
- **********************************************************************/
-
-/**********************************************************************
- * Global Variables
- **********************************************************************/
-
-/**********************************************************************
- * Private Variables
- **********************************************************************/
-
-/***********************************************************************
- * Private Function Prototypes
- ***********************************************************************/
-
-/***********************************************************************
- * Private Functions
- ***********************************************************************/
-
-/***********************************************************************
- * Public Functions
- ***********************************************************************/
-
-/***********************************************************************/
-/* Set all global data structures to a known state */
-
-poffHandle_t poffCreateHandle(void)
-{
- poffInfo_t *poffInfo;
-
- /* Create a new POFF handle */
-
- poffInfo = (poffInfo_t*)malloc(sizeof(poffInfo_t));
- if (poffInfo != NULL)
- {
- /* Set everthing to zero */
-
- memset(poffInfo, 0, sizeof(poffInfo_t));
-
- /* Initialize POFF file header */
-
- poffInfo->fileHeader.fh_ident[FHI_MAG0] = FHI_POFF_MAG0;
- poffInfo->fileHeader.fh_ident[FHI_MAG1] = FHI_POFF_MAG1;
- poffInfo->fileHeader.fh_ident[FHI_MAG2] = FHI_POFF_MAG2;
- poffInfo->fileHeader.fh_ident[FHI_MAG3] = FHI_POFF_MAG3;
- poffInfo->fileHeader.fh_version = FHV_CURRENT;
- poffInfo->fileHeader.fh_shsize = sizeof(poffSectionHeader_t);
- poffInfo->fileHeader.fh_shoff = sizeof(poffFileHeader_t);
-
- /* Initialize the program section header */
-
- poffInfo->progSection.sh_type = SHT_PROGDATA;
- poffInfo->progSection.sh_flags = SHF_ALLOC | SHF_EXEC;
-
- /* Initialize the initialized data section header */
-
- poffInfo->roDataSection.sh_type = SHT_PROGDATA;
- poffInfo->roDataSection.sh_flags = SHF_WRITE | SHF_ALLOC;
-
- /* Initialize the symbol table section header */
-
- poffInfo->symbolTableSection.sh_type = SHT_SYMTAB;
- poffInfo->symbolTableSection.sh_entsize = sizeof(poffSymbol_t);
-
- /* Initialize the string table section header */
-
- poffInfo->stringTableSection.sh_type = SHT_STRTAB;
-
- /* Initialize the relocation table section header */
-
- poffInfo->relocSection.sh_type = SHT_REL;
- poffInfo->relocSection.sh_entsize = sizeof(poffRelocation_t);
-
- /* Initialize the file table section header */
-
- poffInfo->fileNameTableSection.sh_type = SHT_FILETAB;
- poffInfo->fileNameTableSection.sh_entsize = sizeof(poffFileTab_t);
-
- /* Initialize the line number section header */
-
- poffInfo->lineNumberSection.sh_type = SHT_LINENO;
- poffInfo->lineNumberSection.sh_entsize = sizeof(poffLineNumber_t);
-
- /* Initialize the debug function info section header */
-
- poffInfo->debugFuncSection.sh_type = SHT_DEBUG;
- poffInfo->debugFuncSection.sh_entsize = sizeof(poffDebugFuncInfo_t);
- }
- return poffInfo;
-}
-
-/***********************************************************************/
-
-void poffDestroyHandle(poffHandle_t handle)
-{
- poffInfo_t *poffInfo = (poffInfo_t*)handle;
-
- /* Free all of the allocated, in-memory data */
-
- if (poffInfo->progSectionData)
- free(poffInfo->progSectionData);
-
- if (poffInfo->roDataSectionData)
- free(poffInfo->roDataSectionData);
-
- if (poffInfo->symbolTable)
- free(poffInfo->symbolTable);
-
- if (poffInfo->stringTable)
- free(poffInfo->stringTable);
-
- if (poffInfo->relocTable)
- free(poffInfo->relocTable);
-
- if (poffInfo->fileNameTable)
- free(poffInfo->fileNameTable);
-
- if (poffInfo->lineNumberTable)
- free(poffInfo->lineNumberTable);
-
- if (poffInfo->debugFuncTable)
- free(poffInfo->debugFuncTable);
-
- /* Free the container */
-
- free(handle);
-}
-
-/***********************************************************************/
-
-void poffResetAccess(poffHandle_t handle)
-{
- poffInfo_t *poffInfo = (poffInfo_t*)handle;
-
- /* Reset read/write indices */
-
- poffInfo->symbolIndex = 0;
- poffInfo->progSectionIndex = 0;
- poffInfo->relocIndex = 0;
- poffInfo->fileNameIndex = 0;
- poffInfo->lineNumberIndex = 0;
- poffInfo->debugFuncIndex = 0;
-}
-
-/***********************************************************************/
-
+/********************************************************************** + * pfhandle.c + * POFF library global variables + * + * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt <gnutt@nuttx.org> + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + **********************************************************************/ + +/********************************************************************** + * Included Files + **********************************************************************/ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include "keywords.h" /* Standard types */ +#include "pfprivate.h" /* POFF private definitions */ +#include "pofflib.h" /* Public interfaces */ + +/********************************************************************** + * Definitions + **********************************************************************/ + +/********************************************************************** + * Global Variables + **********************************************************************/ + +/********************************************************************** + * Private Variables + **********************************************************************/ + +/*********************************************************************** + * Private Function Prototypes + ***********************************************************************/ + +/*********************************************************************** + * Private Functions + ***********************************************************************/ + +/*********************************************************************** + * Public Functions + ***********************************************************************/ + +/***********************************************************************/ +/* Set all global data structures to a known state */ + +poffHandle_t poffCreateHandle(void) +{ + poffInfo_t *poffInfo; + + /* Create a new POFF handle */ + + poffInfo = (poffInfo_t*)malloc(sizeof(poffInfo_t)); + if (poffInfo != NULL) + { + /* Set everthing to zero */ + + memset(poffInfo, 0, sizeof(poffInfo_t)); + + /* Initialize POFF file header */ + + poffInfo->fileHeader.fh_ident[FHI_MAG0] = FHI_POFF_MAG0; + poffInfo->fileHeader.fh_ident[FHI_MAG1] = FHI_POFF_MAG1; + poffInfo->fileHeader.fh_ident[FHI_MAG2] = FHI_POFF_MAG2; + poffInfo->fileHeader.fh_ident[FHI_MAG3] = FHI_POFF_MAG3; + poffInfo->fileHeader.fh_version = FHV_CURRENT; + poffInfo->fileHeader.fh_shsize = sizeof(poffSectionHeader_t); + poffInfo->fileHeader.fh_shoff = sizeof(poffFileHeader_t); + + /* Initialize the program section header */ + + poffInfo->progSection.sh_type = SHT_PROGDATA; + poffInfo->progSection.sh_flags = SHF_ALLOC | SHF_EXEC; + + /* Initialize the initialized data section header */ + + poffInfo->roDataSection.sh_type = SHT_PROGDATA; + poffInfo->roDataSection.sh_flags = SHF_WRITE | SHF_ALLOC; + + /* Initialize the symbol table section header */ + + poffInfo->symbolTableSection.sh_type = SHT_SYMTAB; + poffInfo->symbolTableSection.sh_entsize = sizeof(poffSymbol_t); + + /* Initialize the string table section header */ + + poffInfo->stringTableSection.sh_type = SHT_STRTAB; + + /* Initialize the relocation table section header */ + + poffInfo->relocSection.sh_type = SHT_REL; + poffInfo->relocSection.sh_entsize = sizeof(poffRelocation_t); + + /* Initialize the file table section header */ + + poffInfo->fileNameTableSection.sh_type = SHT_FILETAB; + poffInfo->fileNameTableSection.sh_entsize = sizeof(poffFileTab_t); + + /* Initialize the line number section header */ + + poffInfo->lineNumberSection.sh_type = SHT_LINENO; + poffInfo->lineNumberSection.sh_entsize = sizeof(poffLineNumber_t); + + /* Initialize the debug function info section header */ + + poffInfo->debugFuncSection.sh_type = SHT_DEBUG; + poffInfo->debugFuncSection.sh_entsize = sizeof(poffDebugFuncInfo_t); + } + return poffInfo; +} + +/***********************************************************************/ + +void poffDestroyHandle(poffHandle_t handle) +{ + poffInfo_t *poffInfo = (poffInfo_t*)handle; + + /* Free all of the allocated, in-memory data */ + + if (poffInfo->progSectionData) + free(poffInfo->progSectionData); + + if (poffInfo->roDataSectionData) + free(poffInfo->roDataSectionData); + + if (poffInfo->symbolTable) + free(poffInfo->symbolTable); + + if (poffInfo->stringTable) + free(poffInfo->stringTable); + + if (poffInfo->relocTable) + free(poffInfo->relocTable); + + if (poffInfo->fileNameTable) + free(poffInfo->fileNameTable); + + if (poffInfo->lineNumberTable) + free(poffInfo->lineNumberTable); + + if (poffInfo->debugFuncTable) + free(poffInfo->debugFuncTable); + + /* Free the container */ + + free(handle); +} + +/***********************************************************************/ + +void poffResetAccess(poffHandle_t handle) +{ + poffInfo_t *poffInfo = (poffInfo_t*)handle; + + /* Reset read/write indices */ + + poffInfo->symbolIndex = 0; + poffInfo->progSectionIndex = 0; + poffInfo->relocIndex = 0; + poffInfo->fileNameIndex = 0; + poffInfo->lineNumberIndex = 0; + poffInfo->debugFuncIndex = 0; +} + +/***********************************************************************/ + diff --git a/misc/pascal/libpoff/pfiprog.c b/misc/pascal/libpoff/pfiprog.c index c768cb075..c2c241f58 100644 --- a/misc/pascal/libpoff/pfiprog.c +++ b/misc/pascal/libpoff/pfiprog.c @@ -3,7 +3,7 @@ * Insert program data int a POFF file * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/libpoff/pfirodata.c b/misc/pascal/libpoff/pfirodata.c index baaed6f7f..61600a6ce 100644 --- a/misc/pascal/libpoff/pfirodata.c +++ b/misc/pascal/libpoff/pfirodata.c @@ -3,7 +3,7 @@ * Append program read-only data to a POFF file * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/libpoff/pflabel.c b/misc/pascal/libpoff/pflabel.c index 088ad77ca..973366466 100644 --- a/misc/pascal/libpoff/pflabel.c +++ b/misc/pascal/libpoff/pflabel.c @@ -3,7 +3,7 @@ * Label resolution logic * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/libpoff/pflineno.c b/misc/pascal/libpoff/pflineno.c index 3cd26c6eb..983a74554 100644 --- a/misc/pascal/libpoff/pflineno.c +++ b/misc/pascal/libpoff/pflineno.c @@ -3,7 +3,7 @@ * Manage line number information * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/libpoff/pfprivate.h b/misc/pascal/libpoff/pfprivate.h index 76fdc867e..560342215 100644 --- a/misc/pascal/libpoff/pfprivate.h +++ b/misc/pascal/libpoff/pfprivate.h @@ -4,7 +4,7 @@ * the POFF library. These were not intended for exportation. * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/libpoff/pfproghandle.c b/misc/pascal/libpoff/pfproghandle.c index fe5aa7fb2..6dc64c4d8 100644 --- a/misc/pascal/libpoff/pfproghandle.c +++ b/misc/pascal/libpoff/pfproghandle.c @@ -1,127 +1,127 @@ -/**********************************************************************
- * pfproghandle.c
- * POFF temporary progdata support
- *
- * Copyright (C) 2008 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- **********************************************************************/
-
-/**********************************************************************
- * Included Files
- **********************************************************************/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "keywords.h" /* Standard types */
-#include "pedefs.h" /* Pascal error codes */
-
-#include "pfprivate.h" /* POFF private definitions */
-#include "pofflib.h" /* Public interfaces */
-
-/**********************************************************************
- * Definitions
- **********************************************************************/
-
-/**********************************************************************
- * Global Variables
- **********************************************************************/
-
-/**********************************************************************
- * Private Variables
- **********************************************************************/
-
-/***********************************************************************
- * Private Function Prototypes
- ***********************************************************************/
-
-/***********************************************************************
- * Private Functions
- ***********************************************************************/
-
-/***********************************************************************
- * Public Functions
- ***********************************************************************/
-
-/***********************************************************************/
-/* Set all global data structures to a known state */
-
-poffProgHandle_t poffCreateProgHandle(void)
-{
- poffProgInfo_t *poffProgInfo;
-
- /* Create a new POFF handle */
-
- poffProgInfo = (poffProgInfo_t*)malloc(sizeof(poffProgInfo_t));
- if (poffProgInfo != NULL)
- {
- /* Set everthing to zero */
-
- memset(poffProgInfo, 0, sizeof(poffProgInfo_t));
- }
- return poffProgInfo;
-}
-
-/***********************************************************************/
-
-void poffDestroyProgHandle(poffProgHandle_t handle)
-{
- /* Free all of the allocated, in-memory data */
-
- poffResetProgHandle(handle);
-
- /* Free the container */
-
- free(handle);
-}
-
-/***********************************************************************/
-
-void poffResetProgHandle(poffProgHandle_t handle)
-{
- poffProgInfo_t *poffProgInfo = (poffProgInfo_t*)handle;
-
- /* Free all of the allocated, in-memory data */
-
- if (poffProgInfo->progSectionData)
- {
- free(poffProgInfo->progSectionData);
- }
-
- /* Reset everything to the initial state */
-
- poffProgInfo->progSectionData = NULL;
- poffProgInfo->progSectionSize = 0;
- poffProgInfo->progSectionAlloc = 0;
-}
-
-/***********************************************************************/
+/********************************************************************** + * pfproghandle.c + * POFF temporary progdata support + * + * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt <gnutt@nuttx.org> + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + **********************************************************************/ + +/********************************************************************** + * Included Files + **********************************************************************/ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include "keywords.h" /* Standard types */ +#include "pedefs.h" /* Pascal error codes */ + +#include "pfprivate.h" /* POFF private definitions */ +#include "pofflib.h" /* Public interfaces */ + +/********************************************************************** + * Definitions + **********************************************************************/ + +/********************************************************************** + * Global Variables + **********************************************************************/ + +/********************************************************************** + * Private Variables + **********************************************************************/ + +/*********************************************************************** + * Private Function Prototypes + ***********************************************************************/ + +/*********************************************************************** + * Private Functions + ***********************************************************************/ + +/*********************************************************************** + * Public Functions + ***********************************************************************/ + +/***********************************************************************/ +/* Set all global data structures to a known state */ + +poffProgHandle_t poffCreateProgHandle(void) +{ + poffProgInfo_t *poffProgInfo; + + /* Create a new POFF handle */ + + poffProgInfo = (poffProgInfo_t*)malloc(sizeof(poffProgInfo_t)); + if (poffProgInfo != NULL) + { + /* Set everthing to zero */ + + memset(poffProgInfo, 0, sizeof(poffProgInfo_t)); + } + return poffProgInfo; +} + +/***********************************************************************/ + +void poffDestroyProgHandle(poffProgHandle_t handle) +{ + /* Free all of the allocated, in-memory data */ + + poffResetProgHandle(handle); + + /* Free the container */ + + free(handle); +} + +/***********************************************************************/ + +void poffResetProgHandle(poffProgHandle_t handle) +{ + poffProgInfo_t *poffProgInfo = (poffProgInfo_t*)handle; + + /* Free all of the allocated, in-memory data */ + + if (poffProgInfo->progSectionData) + { + free(poffProgInfo->progSectionData); + } + + /* Reset everything to the initial state */ + + poffProgInfo->progSectionData = NULL; + poffProgInfo->progSectionSize = 0; + poffProgInfo->progSectionAlloc = 0; +} + +/***********************************************************************/ diff --git a/misc/pascal/libpoff/pfrdbgfunc.c b/misc/pascal/libpoff/pfrdbgfunc.c index 0efce4380..5e21aa328 100644 --- a/misc/pascal/libpoff/pfrdbgfunc.c +++ b/misc/pascal/libpoff/pfrdbgfunc.c @@ -3,7 +3,7 @@ * Read debug function information from a POFF file * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/libpoff/pfread.c b/misc/pascal/libpoff/pfread.c index f10dd8c9a..850965749 100644 --- a/misc/pascal/libpoff/pfread.c +++ b/misc/pascal/libpoff/pfread.c @@ -3,7 +3,7 @@ * POFF library global variables * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/libpoff/pfrelease.c b/misc/pascal/libpoff/pfrelease.c index 8b8b3d123..72bdf0d10 100644 --- a/misc/pascal/libpoff/pfrelease.c +++ b/misc/pascal/libpoff/pfrelease.c @@ -1,94 +1,94 @@ -/**********************************************************************
- * pfrelease.c
- * Program data manipulations on POFF temporary object
- *
- * Copyright (C) 2008 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- **********************************************************************/
-
-/**********************************************************************
- * Included Files
- **********************************************************************/
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "keywords.h" /* Standard types */
-
-#include "pfprivate.h" /* POFF private definitions */
-#include "pofflib.h" /* Public interfaces */
-
-/**********************************************************************
- * Definitions
- **********************************************************************/
-
-/**********************************************************************
- * Global Variables
- **********************************************************************/
-
-/**********************************************************************
- * Private Variables
- **********************************************************************/
-
-/***********************************************************************
- * Private Function Prototypes
- ***********************************************************************/
-
-/***********************************************************************
- * Private Functions
- ***********************************************************************/
-
-/***********************************************************************
- * Public Functions
- ***********************************************************************/
-
-/***********************************************************************/
-
-void poffReleaseProgData(poffHandle_t handle)
-{
- poffInfo_t *poffInfo = (poffInfo_t*)handle;
-
- /* Discard any existing program section data */
-
- if (poffInfo->progSectionData)
- {
- free(poffInfo->progSectionData);
- poffInfo->progSectionData = NULL;
- }
-
- /* Indicate that there is no program data */
-
- poffInfo->progSection.sh_size = 0;
- poffInfo->progSectionAlloc = 0;
- poffInfo->progSectionIndex = 0;
-}
-
-/***********************************************************************/
+/********************************************************************** + * pfrelease.c + * Program data manipulations on POFF temporary object + * + * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt <gnutt@nuttx.org> + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + **********************************************************************/ + +/********************************************************************** + * Included Files + **********************************************************************/ + +#include <stdio.h> +#include <stdlib.h> + +#include "keywords.h" /* Standard types */ + +#include "pfprivate.h" /* POFF private definitions */ +#include "pofflib.h" /* Public interfaces */ + +/********************************************************************** + * Definitions + **********************************************************************/ + +/********************************************************************** + * Global Variables + **********************************************************************/ + +/********************************************************************** + * Private Variables + **********************************************************************/ + +/*********************************************************************** + * Private Function Prototypes + ***********************************************************************/ + +/*********************************************************************** + * Private Functions + ***********************************************************************/ + +/*********************************************************************** + * Public Functions + ***********************************************************************/ + +/***********************************************************************/ + +void poffReleaseProgData(poffHandle_t handle) +{ + poffInfo_t *poffInfo = (poffInfo_t*)handle; + + /* Discard any existing program section data */ + + if (poffInfo->progSectionData) + { + free(poffInfo->progSectionData); + poffInfo->progSectionData = NULL; + } + + /* Indicate that there is no program data */ + + poffInfo->progSection.sh_size = 0; + poffInfo->progSectionAlloc = 0; + poffInfo->progSectionIndex = 0; +} + +/***********************************************************************/ diff --git a/misc/pascal/libpoff/pfrfname.c b/misc/pascal/libpoff/pfrfname.c index 20d964a9e..48a4f10ae 100644 --- a/misc/pascal/libpoff/pfrfname.c +++ b/misc/pascal/libpoff/pfrfname.c @@ -3,7 +3,7 @@ * Read file name data from a POFF file * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/libpoff/pfrhdr.c b/misc/pascal/libpoff/pfrhdr.c index 1605511a8..a1a65a151 100644 --- a/misc/pascal/libpoff/pfrhdr.c +++ b/misc/pascal/libpoff/pfrhdr.c @@ -3,7 +3,7 @@ * Read info from a POFF file header * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/libpoff/pfrlineno.c b/misc/pascal/libpoff/pfrlineno.c index 8ca13c526..64bb41157 100644 --- a/misc/pascal/libpoff/pfrlineno.c +++ b/misc/pascal/libpoff/pfrlineno.c @@ -3,7 +3,7 @@ * Read line number data from a POFF file * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/libpoff/pfrprog.c b/misc/pascal/libpoff/pfrprog.c index d1df10d5e..2de3da049 100644 --- a/misc/pascal/libpoff/pfrprog.c +++ b/misc/pascal/libpoff/pfrprog.c @@ -1,91 +1,91 @@ -/**********************************************************************
- * pfrprog.c
- * Read program data from a POFF file
- *
- * Copyright (C) 2008 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- **********************************************************************/
-
-/**********************************************************************
- * Included Files
- **********************************************************************/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-
-#include "keywords.h" /* Standard types */
-#include "pedefs.h" /* error code definitions */
-
-#include "perr.h" /* error() */
-#include "pofflib.h" /* POFF library interface */
-#include "pfprivate.h" /* POFF private definitions */
-
-/**********************************************************************
- * Definitions
- **********************************************************************/
-
-/**********************************************************************
- * Global Variables
- **********************************************************************/
-
-/**********************************************************************
- * Private Variables
- **********************************************************************/
-
-/***********************************************************************
- * Private Function Prototypes
- ***********************************************************************/
-
-/***********************************************************************
- * Private Functions
- ***********************************************************************/
-
-/***********************************************************************/
-
-int poffGetProgByte(poffHandle_t handle)
-{
- poffInfo_t *poffInfo = (poffInfo_t*)handle;
- int retval = EOF;
-
- /* Check if there is more data that has not yet been read */
-
- if ((poffInfo->progSectionIndex < poffInfo->progSection.sh_size) &&
- (poffInfo->progSectionData != NULL))
- {
- retval = (int)poffInfo->progSectionData[poffInfo->progSectionIndex];
- poffInfo->progSectionIndex++;
- }
- return retval;
-}
-
-/***********************************************************************/
+/********************************************************************** + * pfrprog.c + * Read program data from a POFF file + * + * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt <gnutt@nuttx.org> + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + **********************************************************************/ + +/********************************************************************** + * Included Files + **********************************************************************/ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <errno.h> + +#include "keywords.h" /* Standard types */ +#include "pedefs.h" /* error code definitions */ + +#include "perr.h" /* error() */ +#include "pofflib.h" /* POFF library interface */ +#include "pfprivate.h" /* POFF private definitions */ + +/********************************************************************** + * Definitions + **********************************************************************/ + +/********************************************************************** + * Global Variables + **********************************************************************/ + +/********************************************************************** + * Private Variables + **********************************************************************/ + +/*********************************************************************** + * Private Function Prototypes + ***********************************************************************/ + +/*********************************************************************** + * Private Functions + ***********************************************************************/ + +/***********************************************************************/ + +int poffGetProgByte(poffHandle_t handle) +{ + poffInfo_t *poffInfo = (poffInfo_t*)handle; + int retval = EOF; + + /* Check if there is more data that has not yet been read */ + + if ((poffInfo->progSectionIndex < poffInfo->progSection.sh_size) && + (poffInfo->progSectionData != NULL)) + { + retval = (int)poffInfo->progSectionData[poffInfo->progSectionIndex]; + poffInfo->progSectionIndex++; + } + return retval; +} + +/***********************************************************************/ diff --git a/misc/pascal/libpoff/pfrrawlineno.c b/misc/pascal/libpoff/pfrrawlineno.c index ec2e950c0..3268b7fdd 100644 --- a/misc/pascal/libpoff/pfrrawlineno.c +++ b/misc/pascal/libpoff/pfrrawlineno.c @@ -3,7 +3,7 @@ * Read raw line number data from a POFF file * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/libpoff/pfrrawreloc.c b/misc/pascal/libpoff/pfrrawreloc.c index a9f44a89e..af4959517 100644 --- a/misc/pascal/libpoff/pfrrawreloc.c +++ b/misc/pascal/libpoff/pfrrawreloc.c @@ -3,7 +3,7 @@ * Read raw relocation data from a POFF file * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/libpoff/pfrseek.c b/misc/pascal/libpoff/pfrseek.c index e3dc1bcc2..7c98323e6 100644 --- a/misc/pascal/libpoff/pfrseek.c +++ b/misc/pascal/libpoff/pfrseek.c @@ -3,7 +3,7 @@ * Seek to a position in buffered program data from a POFF file * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/libpoff/pfrstring.c b/misc/pascal/libpoff/pfrstring.c index 2f8c7ae49..de7e0e2c1 100644 --- a/misc/pascal/libpoff/pfrstring.c +++ b/misc/pascal/libpoff/pfrstring.c @@ -3,7 +3,7 @@ * Read a string from a POFF file * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/libpoff/pfrsymbol.c b/misc/pascal/libpoff/pfrsymbol.c index fe22de270..592038071 100644 --- a/misc/pascal/libpoff/pfrsymbol.c +++ b/misc/pascal/libpoff/pfrsymbol.c @@ -3,7 +3,7 @@ * Read symbols from a POFF file * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/libpoff/pfswap.c b/misc/pascal/libpoff/pfswap.c index a33e633c3..69174af37 100644 --- a/misc/pascal/libpoff/pfswap.c +++ b/misc/pascal/libpoff/pfswap.c @@ -3,7 +3,7 @@ * Handle POFF Endian-ness * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/libpoff/pfsymhandle.c b/misc/pascal/libpoff/pfsymhandle.c index 819fb2a17..4d38b286c 100644 --- a/misc/pascal/libpoff/pfsymhandle.c +++ b/misc/pascal/libpoff/pfsymhandle.c @@ -1,127 +1,127 @@ -/**********************************************************************
- * pfsymhandle.c
- * POFF temporary symdata support
- *
- * Copyright (C) 2008 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- **********************************************************************/
-
-/**********************************************************************
- * Included Files
- **********************************************************************/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "keywords.h" /* Standard types */
-#include "pedefs.h" /* Pascal error codes */
-
-#include "pfprivate.h" /* POFF private definitions */
-#include "pofflib.h" /* Public interfaces */
-
-/**********************************************************************
- * Definitions
- **********************************************************************/
-
-/**********************************************************************
- * Global Variables
- **********************************************************************/
-
-/**********************************************************************
- * Private Variables
- **********************************************************************/
-
-/***********************************************************************
- * Private Function Prototypes
- ***********************************************************************/
-
-/***********************************************************************
- * Private Functions
- ***********************************************************************/
-
-/***********************************************************************
- * Public Functions
- ***********************************************************************/
-
-/***********************************************************************/
-/* Set all global data structures to a known state */
-
-poffSymHandle_t poffCreateSymHandle(void)
-{
- poffSymInfo_t *poffSymInfo;
-
- /* Create a new POFF handle */
-
- poffSymInfo = (poffSymInfo_t*)malloc(sizeof(poffSymInfo_t));
- if (poffSymInfo != NULL)
- {
- /* Set everthing to zero */
-
- memset(poffSymInfo, 0, sizeof(poffSymInfo_t));
- }
- return poffSymInfo;
-}
-
-/***********************************************************************/
-
-void poffDestroySymHandle(poffSymHandle_t handle)
-{
- /* Free all of the allocated, in-memory data */
-
- poffResetSymHandle(handle);
-
- /* Free the container */
-
- free(handle);
-}
-
-/***********************************************************************/
-
-void poffResetSymHandle(poffSymHandle_t handle)
-{
- poffSymInfo_t *poffSymInfo = (poffSymInfo_t*)handle;
-
- /* Free all of the allocated, in-memory data */
-
- if (poffSymInfo->symbolTable)
- {
- free(poffSymInfo->symbolTable);
- }
-
- /* Reset everything to the initial state */
-
- poffSymInfo->symbolTable = NULL;
- poffSymInfo->symbolTableSize = 0;
- poffSymInfo->symbolTableAlloc = 0;
-}
-
-/***********************************************************************/
+/********************************************************************** + * pfsymhandle.c + * POFF temporary symdata support + * + * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt <gnutt@nuttx.org> + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + **********************************************************************/ + +/********************************************************************** + * Included Files + **********************************************************************/ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include "keywords.h" /* Standard types */ +#include "pedefs.h" /* Pascal error codes */ + +#include "pfprivate.h" /* POFF private definitions */ +#include "pofflib.h" /* Public interfaces */ + +/********************************************************************** + * Definitions + **********************************************************************/ + +/********************************************************************** + * Global Variables + **********************************************************************/ + +/********************************************************************** + * Private Variables + **********************************************************************/ + +/*********************************************************************** + * Private Function Prototypes + ***********************************************************************/ + +/*********************************************************************** + * Private Functions + ***********************************************************************/ + +/*********************************************************************** + * Public Functions + ***********************************************************************/ + +/***********************************************************************/ +/* Set all global data structures to a known state */ + +poffSymHandle_t poffCreateSymHandle(void) +{ + poffSymInfo_t *poffSymInfo; + + /* Create a new POFF handle */ + + poffSymInfo = (poffSymInfo_t*)malloc(sizeof(poffSymInfo_t)); + if (poffSymInfo != NULL) + { + /* Set everthing to zero */ + + memset(poffSymInfo, 0, sizeof(poffSymInfo_t)); + } + return poffSymInfo; +} + +/***********************************************************************/ + +void poffDestroySymHandle(poffSymHandle_t handle) +{ + /* Free all of the allocated, in-memory data */ + + poffResetSymHandle(handle); + + /* Free the container */ + + free(handle); +} + +/***********************************************************************/ + +void poffResetSymHandle(poffSymHandle_t handle) +{ + poffSymInfo_t *poffSymInfo = (poffSymInfo_t*)handle; + + /* Free all of the allocated, in-memory data */ + + if (poffSymInfo->symbolTable) + { + free(poffSymInfo->symbolTable); + } + + /* Reset everything to the initial state */ + + poffSymInfo->symbolTable = NULL; + poffSymInfo->symbolTableSize = 0; + poffSymInfo->symbolTableAlloc = 0; +} + +/***********************************************************************/ diff --git a/misc/pascal/libpoff/pftprog.c b/misc/pascal/libpoff/pftprog.c index a2a16aa3d..9e7f2818f 100644 --- a/misc/pascal/libpoff/pftprog.c +++ b/misc/pascal/libpoff/pftprog.c @@ -3,7 +3,7 @@ * Program data manipulations on POFF temporary object * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/libpoff/pftsymbol.c b/misc/pascal/libpoff/pftsymbol.c index a8d9aed8b..f7298d8f5 100644 --- a/misc/pascal/libpoff/pftsymbol.c +++ b/misc/pascal/libpoff/pftsymbol.c @@ -3,7 +3,7 @@ * Write symbol information to a temporary container * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/libpoff/pfwdbgfunc.c b/misc/pascal/libpoff/pfwdbgfunc.c index f6879c088..8f80ff12c 100644 --- a/misc/pascal/libpoff/pfwdbgfunc.c +++ b/misc/pascal/libpoff/pfwdbgfunc.c @@ -2,7 +2,7 @@ * pfwdbgfunc.c * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/libpoff/pfwfname.c b/misc/pascal/libpoff/pfwfname.c index 3d2bea32d..9f6687aae 100644 --- a/misc/pascal/libpoff/pfwfname.c +++ b/misc/pascal/libpoff/pfwfname.c @@ -3,7 +3,7 @@ * Write filename data to a POFF file * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/libpoff/pfwhdr.c b/misc/pascal/libpoff/pfwhdr.c index 710721c27..2c8a2feb4 100644 --- a/misc/pascal/libpoff/pfwhdr.c +++ b/misc/pascal/libpoff/pfwhdr.c @@ -3,7 +3,7 @@ * Write to POFF file file and section headers * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/libpoff/pfwlineno.c b/misc/pascal/libpoff/pfwlineno.c index 1b7cdab15..4765391b9 100644 --- a/misc/pascal/libpoff/pfwlineno.c +++ b/misc/pascal/libpoff/pfwlineno.c @@ -3,7 +3,7 @@ * Write line number data to a POFF file * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/libpoff/pfwprog.c b/misc/pascal/libpoff/pfwprog.c index 22d47d49b..1ecf70688 100644 --- a/misc/pascal/libpoff/pfwprog.c +++ b/misc/pascal/libpoff/pfwprog.c @@ -3,7 +3,7 @@ * Write program data to a POFF file * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/libpoff/pfwreloc.c b/misc/pascal/libpoff/pfwreloc.c index db2a2feba..e7b4def24 100644 --- a/misc/pascal/libpoff/pfwreloc.c +++ b/misc/pascal/libpoff/pfwreloc.c @@ -3,7 +3,7 @@ * Write relocation data to a POFF file * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/libpoff/pfwrite.c b/misc/pascal/libpoff/pfwrite.c index 916f25dc5..984b3511b 100644 --- a/misc/pascal/libpoff/pfwrite.c +++ b/misc/pascal/libpoff/pfwrite.c @@ -3,7 +3,7 @@ * Write a POFF file * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/libpoff/pfwrodata.c b/misc/pascal/libpoff/pfwrodata.c index 7d059a547..c6128b9aa 100644 --- a/misc/pascal/libpoff/pfwrodata.c +++ b/misc/pascal/libpoff/pfwrodata.c @@ -3,7 +3,7 @@ * Write to the RODATA section of a POFF file * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/libpoff/pfwstring.c b/misc/pascal/libpoff/pfwstring.c index 9c3d854d7..45669576d 100644 --- a/misc/pascal/libpoff/pfwstring.c +++ b/misc/pascal/libpoff/pfwstring.c @@ -3,7 +3,7 @@ * Write string table data a POFF file * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/libpoff/pfwsymbol.c b/misc/pascal/libpoff/pfwsymbol.c index 534e7651a..0a0beb2be 100644 --- a/misc/pascal/libpoff/pfwsymbol.c +++ b/misc/pascal/libpoff/pfwsymbol.c @@ -3,7 +3,7 @@ * Write symbol information to a POFF file * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/libpoff/pfxprog.c b/misc/pascal/libpoff/pfxprog.c index caa1d4864..238e109be 100644 --- a/misc/pascal/libpoff/pfxprog.c +++ b/misc/pascal/libpoff/pfxprog.c @@ -3,7 +3,7 @@ * Extract program data from a POFF file * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/libpoff/pfxrodata.c b/misc/pascal/libpoff/pfxrodata.c index f778ab42b..87ae3c4c6 100644 --- a/misc/pascal/libpoff/pfxrodata.c +++ b/misc/pascal/libpoff/pfxrodata.c @@ -3,7 +3,7 @@ * Extract program read-only data from a POFF file * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/libpoff/pofferr.c b/misc/pascal/libpoff/pofferr.c index f32db0475..3253acdfd 100644 --- a/misc/pascal/libpoff/pofferr.c +++ b/misc/pascal/libpoff/pofferr.c @@ -3,7 +3,7 @@ * Simple error handlers * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions |