- StdLoader.Fixup

From: CFB Software <"CFB>
Date: Thu, 28 Jul 2005 21:52:37 +0930

----boundary-LibPST-iamunique-489353746_-_-
Content-type: text/plain

Andrew,

The term 'Fixups' usually refers to the task of adjusting inter-module
addresses when loading all of the separate modules of an application into
memory. These addresses cannot be calculated by the compiler as they can
only be determined at runtime as they are dependent on where the modules are
loaded in memory.

You have got the source code of StdLoader haven't you? If not, download
Blackbox 1.5 Beta, which includes the source code, from

http://www.oberon.ch/blackbox.html

SYSTEM.GET just reads the contents of memory locations:

  GET(a, v) is equivalent to v := M[a]

where M[a] is the contents of the memory location with absolute address a,
so it certainly could result in an "illegal memory read" if a is a location
in memory that does not belong to the process that is executing.

Chris Burrows
CFB Software
http://www.cfbsoftware.com/gpcp


> -----Original Message-----
> From: blackbox{([at]})nowhere.xy
> Thomas
> Sent: Thursday, 28 July 2005 5:18 PM
> To: BlackBox Mailing List
> Subject: [BlackBox] - StdLoader.Fixup
>
>
> Hei BlackBox World,
>
> Does anyone know what the Fixup procedure in module StdLoader does?
> I am getting an "illegal memory read error". What can cause this type of
> error?
>
> Fixup uses the low level functions SYSTEM.GET and SYSTEM.PUT to manipulate
> the code file that has been read into memory using
> Files.reader.ReadBytes. I
> guess that the code file has become corrupted on reading in. (It is ok on
> file because I can load its module in some cases but not others.)
>
> What sort of errors can SYSTEM.GET give? Can it cause an "illegal memory
> read"?
>
> Fixup has error code for detecting corrupt code files but I do
> not see this
> error. Are there any checks I can do on the code after it has been read in
> before Fixup is called?
>
> I am having the problem on Linux (Fedora Core). I have linked a few code
> files together into a so file using the ELF linker and then call
> a function
> from the so that uses Meta to load a module.
>
> Any suggestions what to try?
>
> Thanks in advance for any suggestions.
>
> Regards
>
> Andrew
>
> --- BlackBox
> --- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy
>
>

--- BlackBox
--- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy



----boundary-LibPST-iamunique-489353746_-_-
Content-type: application/rtf
Content-transf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QgaW5ccGFyDQo+IGJl
Zm9yZSBGaXh1cCBpcyBjYWxsZWQ/XHBhcg0KPlxwYXINCj4gSSBhbSBoYXZpbmcgdGhlIHByb2Js
ZW0gb24gTGludXggKEZlZG9yYSBDb3JlKS4gSSBoYXZlIGxpbmtlZCBhIGZldyBjb2RlXHBhcg0K
PiBmaWxlcyB0b2dldGhlciBpbnRvIGEgc28gZmlsZSB1c2luZyB0aGUgRUxGIGxpbmtlciBhbmQg
dGhlbiBjYWxsXHBhcg0KPiBhIGZ1bmN0aW9uXHBhcg0KPiBmcm9tIHRoZSBzbyB0aGF0IHVzZXMg
TWV0YSB0byBsb2FkIGEgbW9kdWxlLlxwYXINCj5ccGFyDQo+IEFueSBzdWdnZXN0aW9ucyB3aGF0
IHRvIHRyeT9ccGFyDQo+XHBhcg0KPiBUaGFua3MgaW4gYWR2YW5jZSBmb3IgYW55IHN1Z2dlc3Rp
b25zLlxwYXINCj5ccGFyDQo+IFJlZ2FyZHNccGFyDQo+XHBhcg0KPiBcdGFiIEFuZHJld1xwYXIN
Cj5ccGFyDQo+IC0tLSBCbGFja0JveFxwYXINCj4gLS0tIHNlbmQgc3ViamVjdCBIRUxQIG9yIFVO
U1VCU0NSSUJFIHRvIGJsYWNrYm94QG9iZXJvbi5jaFxwYXINCj5ccGFyDQo+XHBhcg0KXHBhcg0K
LS0tIEJsYWNrQm94XHBhcg0KLS0tIHNlbmQgc3ViamVjdCBIRUxQIG9yIFVOU1VCU0NSSUJFIHRv
IGJsYWNrYm94QG9iZXJvbi5jaFxwYXINCn19ADozNyA=


----boundary-LibPST-iamunique-489353746_-_---
Received on Thu Jul 28 2005 - 14:22:37 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:28:11 UTC