Re: Preprocessor for assembler macros?

2009-03-09 Thread Philipp Marek
> gcc -S tmp.S for some reason prints to stdout, so gcc -S tmp.S > tmp.s > is what you need Thank you very much, I'll take a look. Regards, Phil -- Versioning your /etc, /home or even your whole installation? Try fsvs (fsvs.tigris.org)!

Preprocessor for assembler macros?

2009-03-08 Thread Philipp Marek
Hello everybody, I already asked that on gcc-help@ but got no answer, so I'm trying again here. I'm looking for a way to get inbetween the assembler macro processor and the assembler. I'd like to get the assembler sources mostly as-is, but with the macros used therein already expanded. I've a

[ANN]: Redundancy remover

2009-02-27 Thread Philipp Marek
Hello everybody, the idea I presented last year [1], and which I said in January that I thought how to realize [2], has come true. I'd like to show you a tool that removes a bit of redundancy off your binaries, without needing to change the sources, by identifying repeated code blocks, and s

Re: RFC: Idea for code size reduction

2009-01-23 Thread Philipp Marek
Hello everybody, On Friday 07 March 2008 Philipp Marek wrote: > Here you are. > > > code_overlap.pl - disassembles a binary, and outputs a list > (address, name, instruction, bytes) to STDOUT. > > bytes_saved.pl - takes such a list, and tries to estimate > the amoun

Re: Idea for code size reduction

2008-03-07 Thread Philipp Marek
On Friday 07 March 2008 Ian Lance Taylor wrote: > "Philipp Marek" <[EMAIL PROTECTED]> writes: > >> Shouldn't this be done in the linker instead? > > > > Well, can the linker change the instruction sequences? Ie. put a JMP > > instead of other c

Re: RFC: Idea for code size reduction

2008-03-07 Thread Philipp Marek
BTW - It gets much better: $ ls -la /usr/lib/libgcj.so.90.0.0 -rw-r--r-- 1 root root 32844984 3. Feb 16:03 /usr/lib/libgcj.so.90.0.0 $ ./run /usr/lib/libgcj.so.90.0.0 Approx. 470045 bytes saved. That's 1.4% :-) If my script isn't buggy, that is -- Versioning your /etc, /home or

Re: RFC: Idea for code size reduction

2008-03-07 Thread Philipp Marek
Hello Jakub! >> When wouldn't that possible? My script currently splits on an >> instruction-level -- although I would see no problem that some branch >> jumps into a "half" opcode of another branch, if the byte sequence >> matches. > > Consider: > : >0: b8 a4 00 00 00

Re: RFC: Idea for code size reduction

2008-03-07 Thread Philipp Marek
Hello Jakub! > You need to be very careful with it, as if there are any jumps > into the middle of the to be abstracted tail sequences, you can't > abstract them or would need to adjust also the jumps into them (if > possible, which not always is). When wouldn't that possible? My script currently

RE: Idea for code size reduction

2008-03-07 Thread Philipp Marek
Hello Dave! > One achitectural problem here is that GCC doesn't emit bytes. It emits > ASCII text, in the form of assembly instructions, and it's > not always easy to predict how they'll look by the time they've been > through the assembler and then had relocs applied by the > linker. (Indeed, to

Re: RFC: Idea for code size reduction

2008-03-07 Thread Philipp Marek
Hello Michael! > Can I test your script in my embedded system? > Can you send to me? Here you are. code_overlap.pl - disassembles a binary, and outputs a list (address, name, instruction, bytes) to STDOUT. bytes_saved.pl - takes such a list, and tries to estimate the amount of bytes that c

Re: RFC: Idea for code size reduction

2008-03-07 Thread Philipp Marek
Hello Richard! [ I took linux-tiny out - it's moderated, and I don't want to spam them. ] > Sounds like what -frtl-abstract-sequences is trying to do. Yes, thank you. I didn't know that; that should be close. *But*: I think it doesn't work. $ size vmlinux-as vmlinux-Os textdata b

RFC: Idea for code size reduction

2008-03-07 Thread Philipp Marek
Hello everybody, I have a feature request. I'd like to (manually) define some byte blocks, eg. as functions with an identifier. Then, if GCC would emit exactly these bytes, it puts a JMP identifier there instead. This would help by sharing many identical (text/code) byte sequences, to make a s

Dynamic macro expansion through a pipe?

2008-02-20 Thread Philipp Marek
Hello everybody, I'm looking for a nice solution. One of my programs has a lot of strings in it; about 20% of binary size, or something like that. Now most of them are rarely used - error messages like "Cannot write to file", "No space left while allocating memory", etc. I tried to compress ju