diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-06-17 23:38:05 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-06-17 23:38:05 +0000 |
commit | d1a54833aa39c06f38bc656d0811674e9826f7d3 (patch) | |
tree | 4b5911ef52d216a622db785fddf36eb72c5c3512 /nuttx/binfmt/libnxflat | |
parent | 05f9f43d38c58f39c7c62279b6a7d1c848507ade (diff) | |
download | px4-nuttx-d1a54833aa39c06f38bc656d0811674e9826f7d3.tar.gz px4-nuttx-d1a54833aa39c06f38bc656d0811674e9826f7d3.tar.bz2 px4-nuttx-d1a54833aa39c06f38bc656d0811674e9826f7d3.zip |
Integrate PIC support into context switching
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1900 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/binfmt/libnxflat')
-rw-r--r-- | nuttx/binfmt/libnxflat/libnxflat_load.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/nuttx/binfmt/libnxflat/libnxflat_load.c b/nuttx/binfmt/libnxflat/libnxflat_load.c index aa00f50c7..b27dca935 100644 --- a/nuttx/binfmt/libnxflat/libnxflat_load.c +++ b/nuttx/binfmt/libnxflat/libnxflat_load.c @@ -118,7 +118,7 @@ static void nxflat_reloc(struct nxflat_loadinfo_s *loadinfo, uint32 rl) * DSpace to hold information needed by ld.so at run time. */ - datastart = loadinfo->dspace; + datastart = (uint32)loadinfo->dspace->region; /* Get a pointer to the value that needs relocation in * DSpace. @@ -257,22 +257,22 @@ int nxflat_load(struct nxflat_loadinfo_s *loadinfo) * uninitialized ISpace memory. */ - loadinfo->dspace = (uint32)malloc(loadinfo->dsize); + loadinfo->dspace = (struct dspace_s *)malloc(SIZEOF_DSPACE_S(loadinfo->dsize)); if (loadinfo->dspace == 0) { bdbg("Failed to allocate DSpace\n"); ret = -ENOMEM; goto errout; } + loadinfo->dspace->crefs = 1; - bvdbg("Allocated DSpace (%d bytes) at %08x\n", - loadinfo->dsize, loadinfo->dspace); + bvdbg("Allocated DSpace (%d bytes) at %p\n", loadinfo->dsize, loadinfo->dspace); /* Now, read the data into allocated DSpace at doffset into the * allocated DSpace memory. */ - ret = nxflat_read(loadinfo, (char*)loadinfo->dspace, dreadsize, doffset); + ret = nxflat_read(loadinfo, (char*)loadinfo->dspace->region, dreadsize, doffset); if (ret < 0) { bdbg("Failed to read .data section: %d\n", ret); @@ -285,10 +285,10 @@ int nxflat_load(struct nxflat_loadinfo_s *loadinfo) /* Resolve the address of the relocation table. In the file, the * relocations should lie at the same offset as BSS. The current * value of relocstart is the offset from the beginning of the file. - * The following adjustment will convert it to an address in DSpace. + * The following adjustment will convert it to an address in dspace-> */ - reloctab = (uint32*)(loadinfo->relocstart + loadinfo->dspace - loadinfo->isize); + reloctab = (uint32*)(loadinfo->relocstart + (uint32)loadinfo->dspace->region - loadinfo->isize); bvdbg("Relocation table at 0x%p, reloccount=%d\n", reloctab, loadinfo->reloccount); @@ -304,7 +304,7 @@ int nxflat_load(struct nxflat_loadinfo_s *loadinfo) * in the file. */ - memset((void*)(loadinfo->dspace + loadinfo->datasize), + memset((void*)(loadinfo->dspace->region + loadinfo->datasize), 0, loadinfo->bsssize); return OK; |