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]

Re: Only obj_coff_weak() with BFD_ASSEMBLERs


Hi Aaron,

On a related note, I need help with getting relocations to work with
COFF weak symbols.  When generating relocations, GAS needs to treat weak
symbols as undefined symbols, not as defined symbols, which is what it
presently does.  It gets it halfway right, and knows to generate
relocations for weak symbols where a defined symbol wouldn't need one,
but the fixup to the frag and the relocation itself don't create correct
results when linked.  All of the obvious places to add this sort of
logic are places I am very hesitant to add changes, such as in
bfd_perform_relocations.

Changing and debugging reloc processing in BFD is notoriously difficult. It is also well known that bfd_perform_relocations() often fails to do what is desired so a lot of backends choose to perform their own reloc processing.


For simplicity sake this is what I suggest you do for now. Look at the backend specific file for the target you are interested in (coff-i386.c ??) and try adding to or defining its coff_relocate_section function.

Cheers
  Nick



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