This is the mail archive of the binutils@sources.redhat.com 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]

Minor feature for ld


I think the linker should support segments whose address is a
function of the segment name. It would allow definitions like
this in GCC:

__attribute__((section("/0x123456/"))) int IOPort;

In the above example, the linker would locate the variable at
the given address, so these two statements would be equivalent:

IOPort = x;
*(int *)0x123456 = x;

Really this feature belongs in the compiler, but sections are
the closest C/C++ compilers come to letting you control the
address of variables. Everything else is handled by the linker,
so that seems like the simplest place to fix. (If not, maybe
I should be pestering the GCC people.)

Thanks,
-Pete

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