Ticket #389 (Fixed)Sun May 18 20:05:12 UTC 2014
Objasm INCBIN not accepting Unix style names
Reported by: | Sprow (202) | Severity: | Minor |
Part: | RISC OS: C/C++ toolchain | Release: | |
Milestone: | Status | Fixed |
Details by Sprow (202):
This problem prevents files from being specified in a host agnostic way.
Example
INCBIN test.dat
would expect this to look in “dat.test” in a similar way to
GET test.s
will include the file “s.test”.
Also tried putting it in the current source directory, as hinted at as “current place” in armasm
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.kui0100a/armasm_caccaghf.htm
but no joy there either. It seems INCBIN can only handle RISC OS style paths and filenames.
Changelog:
Modified by Chris Hall (132) Tue, August 05 2014 - 16:01:48 GMT
Why did we use the convention ‘dat.test’ rather than ‘test/dat’ for a leafname containing ‘.’ rather than ‘/’?
Modified by Jeffrey Lee (213) Wed, August 06 2014 - 10:50:02 GMT
Probably a compromise to allow things to work relatively cleanly with the filesystem limitations of the 80’s. On RISC OS you would have been limited to 77 files per directory and 10 character filenames. Although I suspect the convention actually originated with the BBC micro, where ADFS was limited to one character for directory names, and 7 character filenames. In fact I’ve just downloaded the Beebug C manual and that’s full of “#include <h.stdio>” and the like – they didn’t even try to hide the fact that the host machine wasn’t using Unix style pathnames.
Modified by Ben Avison (25) Mon, November 10 2014 - 12:43:08 GMT
- Status changed from Open to Fixed
Fixed in objasm 4.02, as featured in DDE25.
Note, the specific case mentioned in this ticket is not affected. Before re-ordering the last two dot-separated elements of a path, objasm (like the rest of the DDE) has to determine that the last element is a filename extension, rather than a filename within a subdirectory (using the RISC OS directory separator character). It does that by using a whitelist of known extensions which varies from tool to tool, and ‘.dat’ isn’t in the list for objasm, unsurprisingly.
The simplest way around this is to rewrite the line so that it includes a ‘/’ character. In this case, objasm will switch to parsing the filename as though it were a Unix pathname. Then you can unambiguously specify any filename extension you want and it will be reordered as the fault raiser desired when you run objasm on RISC OS, despite the use of a non-standard extension:
INCBIN ./test.datThis already worked elsewhere in the DDE (for example #include in the C compiler), but its use in the INCBIN directive specifically is new in objasm 4.02.