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: ld's targets vs emulations (intending to link EFI binaries on Linux)


Hi Jan,

What is the point of ld supporting (in e.g. the default x86 Linux
configurations) PE executables as targets, but not as emulations?
This basically means that one can link such executables, but there's
no control over the various linking parameters (as those are
processed by the respective [not present] emulation code).

Essentially this is because it is easier this way. Supporting multiple, dissimilar emulations would make the linker a lot more complex.


Changing the output format is actually a problematic feature of the linker, and one that is disabled for some architectures. It is much cleaner to link without changing format and then use objcopy to convert the resulting binary. You are correct however in saying that objcopy will not convert relocations and this is actually one of the big problems with format conversions - there is rarely a good mapping between the relocations of the formats.

Cheers
  Nick


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