This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Linker for OOP


Somebody?

I think linker's native support for OOP is really good thing.

I have been thinking about Objective-C dialect.  I think Obj-C is
simple and good, and if its `@selector' takes two arguments, class
name and message name, then the method lookup mechanism is no more
necessary because it becomes just an offset to method table that
resolved in link phase.

Somebody respond please.


+----------------------------+ FILE1.m => | File1.o | +-----------------------+ | +------------------------+ | | RootClass | | | | | | { | | | | | | classMethod_1 | | | | | | instanceMethod_1 | => | | 0 | | | instanceMethod_2 | => | | 1 | | | } | | | | | | | | | RootClassMAX | | | | | | => 2 | | +-----------------------+ | +------------------------+ | | | | | | | FILE2.m => | File2.o | +-----------------------+ | +------------------------+ | | SubClass: RootClass | | | | | | { | | | | | | classMethod_2 | | | | | | instanceMethod_3 | => | | RootClassMAX + 0 | | | instanceMethod_4 | => | | RootClassMAX + 1 | | | } | | | | | | | | | SubClassMAX | | | | | | => RootClassMAX + 2 | | +-----------------------+ | +------------------------+ | +----------------------------+ || \/

Metaclass {
Class* isa;
IMP method[] = {
classMethod_1,
classMethod_2
};
}
RootClass {
Class* isa;
Class* super;
IMP method[] = {
instanceMethod_1,
instanceMethod_2,
};
}
SubClass {
Class* isa;
Class* super; IMP method[] = {
instanceMethod_1,
instanceMethod_2,
instanceMethod_3,
instanceMethod_4,
};
}


----- Original Message ----- From: "Mikiya Matsuzaka" <yoyu@tiara.ocn.ne.jp>
To: <binutils@sourceware.org>
Sent: Friday, September 01, 2006 8:37 AM
Subject: Linker for OOP



I found this description in GCC Internals info file.

------------------------------------------------------------------------
   11.7 Constant Expression Types
   ==============================

...

   `(const:M EXP)'
        Represents a constant that is the result of an assembly-time
        arithmetic computation.  The operand, EXP, is an expression that
        contains only constants (`const_int', `symbol_ref' and `label_ref'
        expressions) combined with `plus' and `minus'.  However, not all
        combinations are valid, since the assembler cannot do arbitrary
        arithmetic on relocatable symbols.

        M should be `Pmode'.
------------------------------------------------------------------------

Are there any plan to implement this facility as an extension to
object file format?

I don't know the fact but I suppose why linker was originally
invented was to promise user to recompile only modified .c files, and this principal was broken with object oriented programming.


I think with this facility, simple OO language will be much cleaner
than the current, because the offset of member variables or method
table are resolved in link phase.

Please comment.

---
Mikiya Matsuzaka




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]