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


In a word, current linker (and object file format) is designed
for STRUCTURED PROGRAMING, and nobody complained about almost
20 years around.

Object oriented programming proposed inheritance, thus, adding
member variables to another structure (mignt be in another file),
and no linker and object file format can handle this sincerely.

I think native linker designed for OOP is definately necessary.

---
Mikiya Matsuzaka

************************************************************************
====================================
------- FILE1.m -------
RootClass
{
   classMethod_1
   instanceMethod_1
   instanceMethod_2
}
-----------------------
         ||
         \/

RootClassIMIndex_1    EQU     0
RootClassIMIndex_2    EQU     1
RootClassIMIndex_MAX  EQU     2

====================================

------- FILE2.m -------
SubClass: RootClass
{
   classMethod_2
   instanceMethod_1
   instanceMethod_3
   instanceMethod_4
}
-----------------------
         ||
         \/

SubClassIMIndex_1 EQU RootClassIMIndex_1

SubClassIMIndex_3    EQU    RootClassIMIndex_MAX .PLUS 1
SubClassIMIndex_4    EQU    RootClassIMIndex_MAX .PLUS 2
SubClassIMIndex_MAX  EQU    RootClassIMIndex_MAX .PLUS 3

====================================
************************************************************************
               ||
               \/

============== a.out ===============
Metaclass {
   Class*  isa;
   IMP     method[] = {
       classMethod_1,
       classMethod_2
   };
}

RootClass {
   Class*  isa;
   Class*  super;
   IMP     method[] = {
       RootClass:instanceMethod_1,
       RootClass:instanceMethod_2,
   };
}

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


====================================
*************************************************************************



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